Files
CreaBook/client/dist/assets/index-9IOnhCkb.js
2026-04-05 03:11:25 +02:00

233 lines
630 KiB
JavaScript

var fy=t=>{throw TypeError(t)};var Op=(t,e,n)=>e.has(t)||fy("Cannot "+n);var F=(t,e,n)=>(Op(t,e,"read from private field"),n?n.call(t):e.get(t)),de=(t,e,n)=>e.has(t)?fy("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ne=(t,e,n,r)=>(Op(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),_e=(t,e,n)=>(Op(t,e,"access private method"),n);var Cc=(t,e,n,r)=>({set _(i){ne(t,e,i,n)},get _(){return F(t,e,r)}});function x9(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var py=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var N3={exports:{}},Xd={},R3={exports:{}},Ne={};/**
* @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 pu=Symbol.for("react.element"),w9=Symbol.for("react.portal"),_9=Symbol.for("react.fragment"),C9=Symbol.for("react.strict_mode"),k9=Symbol.for("react.profiler"),E9=Symbol.for("react.provider"),P9=Symbol.for("react.context"),N9=Symbol.for("react.forward_ref"),R9=Symbol.for("react.suspense"),T9=Symbol.for("react.memo"),O9=Symbol.for("react.lazy"),gy=Symbol.iterator;function b9(t){return t===null||typeof t!="object"?null:(t=gy&&t[gy]||t["@@iterator"],typeof t=="function"?t:null)}var T3={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O3=Object.assign,b3={};function Pa(t,e,n){this.props=t,this.context=e,this.refs=b3,this.updater=n||T3}Pa.prototype.isReactComponent={};Pa.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState")};Pa.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function L3(){}L3.prototype=Pa.prototype;function Jg(t,e,n){this.props=t,this.context=e,this.refs=b3,this.updater=n||T3}var Zg=Jg.prototype=new L3;Zg.constructor=Jg;O3(Zg,Pa.prototype);Zg.isPureReactComponent=!0;var my=Array.isArray,F3=Object.prototype.hasOwnProperty,e1={current:null},A3={key:!0,ref:!0,__self:!0,__source:!0};function M3(t,e,n){var r,i={},s=null,l=null;if(e!=null)for(r in e.ref!==void 0&&(l=e.ref),e.key!==void 0&&(s=""+e.key),e)F3.call(e,r)&&!A3.hasOwnProperty(r)&&(i[r]=e[r]);var u=arguments.length-2;if(u===1)i.children=n;else if(1<u){for(var c=Array(u),h=0;h<u;h++)c[h]=arguments[h+2];i.children=c}if(t&&t.defaultProps)for(r in u=t.defaultProps,u)i[r]===void 0&&(i[r]=u[r]);return{$$typeof:pu,type:t,key:s,ref:l,props:i,_owner:e1.current}}function L9(t,e){return{$$typeof:pu,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function t1(t){return typeof t=="object"&&t!==null&&t.$$typeof===pu}function F9(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var yy=/\/+/g;function bp(t,e){return typeof t=="object"&&t!==null&&t.key!=null?F9(""+t.key):e.toString(36)}function qc(t,e,n,r,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var l=!1;if(t===null)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case pu:case w9:l=!0}}if(l)return l=t,i=i(l),t=r===""?"."+bp(l,0):r,my(i)?(n="",t!=null&&(n=t.replace(yy,"$&/")+"/"),qc(i,e,n,"",function(h){return h})):i!=null&&(t1(i)&&(i=L9(i,n+(!i.key||l&&l.key===i.key?"":(""+i.key).replace(yy,"$&/")+"/")+t)),e.push(i)),1;if(l=0,r=r===""?".":r+":",my(t))for(var u=0;u<t.length;u++){s=t[u];var c=r+bp(s,u);l+=qc(s,e,n,c,i)}else if(c=b9(t),typeof c=="function")for(t=c.call(t),u=0;!(s=t.next()).done;)s=s.value,c=r+bp(s,u++),l+=qc(s,e,n,c,i);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return l}function kc(t,e,n){if(t==null)return t;var r=[],i=0;return qc(t,r,"","",function(s){return e.call(n,s,i++)}),r}function A9(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var an={current:null},Yc={transition:null},M9={ReactCurrentDispatcher:an,ReactCurrentBatchConfig:Yc,ReactCurrentOwner:e1};function I3(){throw Error("act(...) is not supported in production builds of React.")}Ne.Children={map:kc,forEach:function(t,e,n){kc(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return kc(t,function(){e++}),e},toArray:function(t){return kc(t,function(e){return e})||[]},only:function(t){if(!t1(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Ne.Component=Pa;Ne.Fragment=_9;Ne.Profiler=k9;Ne.PureComponent=Jg;Ne.StrictMode=C9;Ne.Suspense=R9;Ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=M9;Ne.act=I3;Ne.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=O3({},t.props),i=t.key,s=t.ref,l=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,l=e1.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var u=t.type.defaultProps;for(c in e)F3.call(e,c)&&!A3.hasOwnProperty(c)&&(r[c]=e[c]===void 0&&u!==void 0?u[c]:e[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){u=Array(c);for(var h=0;h<c;h++)u[h]=arguments[h+2];r.children=u}return{$$typeof:pu,type:t.type,key:i,ref:s,props:r,_owner:l}};Ne.createContext=function(t){return t={$$typeof:P9,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:E9,_context:t},t.Consumer=t};Ne.createElement=M3;Ne.createFactory=function(t){var e=M3.bind(null,t);return e.type=t,e};Ne.createRef=function(){return{current:null}};Ne.forwardRef=function(t){return{$$typeof:N9,render:t}};Ne.isValidElement=t1;Ne.lazy=function(t){return{$$typeof:O9,_payload:{_status:-1,_result:t},_init:A9}};Ne.memo=function(t,e){return{$$typeof:T9,type:t,compare:e===void 0?null:e}};Ne.startTransition=function(t){var e=Yc.transition;Yc.transition={};try{t()}finally{Yc.transition=e}};Ne.unstable_act=I3;Ne.useCallback=function(t,e){return an.current.useCallback(t,e)};Ne.useContext=function(t){return an.current.useContext(t)};Ne.useDebugValue=function(){};Ne.useDeferredValue=function(t){return an.current.useDeferredValue(t)};Ne.useEffect=function(t,e){return an.current.useEffect(t,e)};Ne.useId=function(){return an.current.useId()};Ne.useImperativeHandle=function(t,e,n){return an.current.useImperativeHandle(t,e,n)};Ne.useInsertionEffect=function(t,e){return an.current.useInsertionEffect(t,e)};Ne.useLayoutEffect=function(t,e){return an.current.useLayoutEffect(t,e)};Ne.useMemo=function(t,e){return an.current.useMemo(t,e)};Ne.useReducer=function(t,e,n){return an.current.useReducer(t,e,n)};Ne.useRef=function(t){return an.current.useRef(t)};Ne.useState=function(t){return an.current.useState(t)};Ne.useSyncExternalStore=function(t,e,n){return an.current.useSyncExternalStore(t,e,n)};Ne.useTransition=function(){return an.current.useTransition()};Ne.version="18.3.1";R3.exports=Ne;var V=R3.exports;const Mt=Yd(V),I9=x9({__proto__:null,default:Mt},[V]);/**
* @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 D9=V,j9=Symbol.for("react.element"),U9=Symbol.for("react.fragment"),z9=Object.prototype.hasOwnProperty,B9=D9.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,G9={key:!0,ref:!0,__self:!0,__source:!0};function D3(t,e,n){var r,i={},s=null,l=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(l=e.ref);for(r in e)z9.call(e,r)&&!G9.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:j9,type:t,key:s,ref:l,props:i,_owner:B9.current}}Xd.Fragment=U9;Xd.jsx=D3;Xd.jsxs=D3;N3.exports=Xd;var N=N3.exports,k0={},j3={exports:{}},Fn={},U3={exports:{}},z3={};/**
* @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(t){function e(W,te){var Z=W.length;W.push(te);e:for(;0<Z;){var Y=Z-1>>>1,ie=W[Y];if(0<i(ie,te))W[Y]=te,W[Z]=ie,Z=Y;else break e}}function n(W){return W.length===0?null:W[0]}function r(W){if(W.length===0)return null;var te=W[0],Z=W.pop();if(Z!==te){W[0]=Z;e:for(var Y=0,ie=W.length,xe=ie>>>1;Y<xe;){var Ke=2*(Y+1)-1,it=W[Ke],$e=Ke+1,D=W[$e];if(0>i(it,Z))$e<ie&&0>i(D,it)?(W[Y]=D,W[$e]=Z,Y=$e):(W[Y]=it,W[Ke]=Z,Y=Ke);else if($e<ie&&0>i(D,Z))W[Y]=D,W[$e]=Z,Y=$e;else break e}}return te}function i(W,te){var Z=W.sortIndex-te.sortIndex;return Z!==0?Z:W.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var l=Date,u=l.now();t.unstable_now=function(){return l.now()-u}}var c=[],h=[],p=1,y=null,S=3,x=!1,m=!1,C=!1,P=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(W){for(var te=n(h);te!==null;){if(te.callback===null)r(h);else if(te.startTime<=W)r(h),te.sortIndex=te.expirationTime,e(c,te);else break;te=n(h)}}function _(W){if(C=!1,v(W),!m)if(n(c)!==null)m=!0,re(R);else{var te=n(h);te!==null&&he(_,te.startTime-W)}}function R(W,te){m=!1,C&&(C=!1,E(O),O=-1),x=!0;var Z=S;try{for(v(te),y=n(c);y!==null&&(!(y.expirationTime>te)||W&&!H());){var Y=y.callback;if(typeof Y=="function"){y.callback=null,S=y.priorityLevel;var ie=Y(y.expirationTime<=te);te=t.unstable_now(),typeof ie=="function"?y.callback=ie:y===n(c)&&r(c),v(te)}else r(c);y=n(c)}if(y!==null)var xe=!0;else{var Ke=n(h);Ke!==null&&he(_,Ke.startTime-te),xe=!1}return xe}finally{y=null,S=Z,x=!1}}var b=!1,A=null,O=-1,I=5,L=-1;function H(){return!(t.unstable_now()-L<I)}function B(){if(A!==null){var W=t.unstable_now();L=W;var te=!0;try{te=A(!0,W)}finally{te?$():(b=!1,A=null)}}else b=!1}var $;if(typeof k=="function")$=function(){k(B)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,Q=q.port2;q.port1.onmessage=B,$=function(){Q.postMessage(null)}}else $=function(){P(B,0)};function re(W){A=W,b||(b=!0,$())}function he(W,te){O=P(function(){W(t.unstable_now())},te)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(W){W.callback=null},t.unstable_continueExecution=function(){m||x||(m=!0,re(R))},t.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<W?Math.floor(1e3/W):5},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(W){switch(S){case 1:case 2:case 3:var te=3;break;default:te=S}var Z=S;S=te;try{return W()}finally{S=Z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(W,te){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var Z=S;S=W;try{return te()}finally{S=Z}},t.unstable_scheduleCallback=function(W,te,Z){var Y=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?Y+Z:Y):Z=Y,W){case 1:var ie=-1;break;case 2:ie=250;break;case 5:ie=1073741823;break;case 4:ie=1e4;break;default:ie=5e3}return ie=Z+ie,W={id:p++,callback:te,priorityLevel:W,startTime:Z,expirationTime:ie,sortIndex:-1},Z>Y?(W.sortIndex=Z,e(h,W),n(c)===null&&W===n(h)&&(C?(E(O),O=-1):C=!0,he(_,Z-Y))):(W.sortIndex=ie,e(c,W),m||x||(m=!0,re(R))),W},t.unstable_shouldYield=H,t.unstable_wrapCallback=function(W){var te=S;return function(){var Z=S;S=te;try{return W.apply(this,arguments)}finally{S=Z}}}})(z3);U3.exports=z3;var Pl=U3.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 H9=V,Ln=Pl;function J(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var B3=new Set,jl={};function ro(t,e){pa(t,e),pa(t+"Capture",e)}function pa(t,e){for(jl[t]=e,t=0;t<e.length;t++)B3.add(e[t])}var oi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),E0=Object.prototype.hasOwnProperty,V9=/^[: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]*$/,vy={},Sy={};function W9(t){return E0.call(Sy,t)?!0:E0.call(vy,t)?!1:V9.test(t)?Sy[t]=!0:(vy[t]=!0,!1)}function K9(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function $9(t,e,n,r){if(e===null||typeof e>"u"||K9(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ln(t,e,n,r,i,s,l){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=l}var Gt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Gt[t]=new ln(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Gt[e]=new ln(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Gt[t]=new ln(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Gt[t]=new ln(t,2,!1,t,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(t){Gt[t]=new ln(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Gt[t]=new ln(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Gt[t]=new ln(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Gt[t]=new ln(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Gt[t]=new ln(t,5,!1,t.toLowerCase(),null,!1,!1)});var n1=/[\-:]([a-z])/g;function r1(t){return t[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(t){var e=t.replace(n1,r1);Gt[e]=new ln(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(n1,r1);Gt[e]=new ln(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(n1,r1);Gt[e]=new ln(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Gt[t]=new ln(t,1,!1,t.toLowerCase(),null,!1,!1)});Gt.xlinkHref=new ln("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Gt[t]=new ln(t,1,!1,t.toLowerCase(),null,!0,!0)});function i1(t,e,n,r){var i=Gt.hasOwnProperty(e)?Gt[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&($9(e,n,i,r)&&(n=null),r||i===null?W9(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var ci=H9.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ec=Symbol.for("react.element"),Do=Symbol.for("react.portal"),jo=Symbol.for("react.fragment"),s1=Symbol.for("react.strict_mode"),P0=Symbol.for("react.profiler"),G3=Symbol.for("react.provider"),H3=Symbol.for("react.context"),o1=Symbol.for("react.forward_ref"),N0=Symbol.for("react.suspense"),R0=Symbol.for("react.suspense_list"),a1=Symbol.for("react.memo"),bi=Symbol.for("react.lazy"),V3=Symbol.for("react.offscreen"),xy=Symbol.iterator;function ol(t){return t===null||typeof t!="object"?null:(t=xy&&t[xy]||t["@@iterator"],typeof t=="function"?t:null)}var ut=Object.assign,Lp;function Sl(t){if(Lp===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Lp=e&&e[1]||""}return`
`+Lp+t}var Fp=!1;function Ap(t,e){if(!t||Fp)return"";Fp=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(h){var r=h}Reflect.construct(t,[],e)}else{try{e.call()}catch(h){r=h}t.call(e.prototype)}else{try{throw Error()}catch(h){r=h}t()}}catch(h){if(h&&r&&typeof h.stack=="string"){for(var i=h.stack.split(`
`),s=r.stack.split(`
`),l=i.length-1,u=s.length-1;1<=l&&0<=u&&i[l]!==s[u];)u--;for(;1<=l&&0<=u;l--,u--)if(i[l]!==s[u]){if(l!==1||u!==1)do if(l--,u--,0>u||i[l]!==s[u]){var c=`
`+i[l].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=l&&0<=u);break}}}finally{Fp=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Sl(t):""}function Q9(t){switch(t.tag){case 5:return Sl(t.type);case 16:return Sl("Lazy");case 13:return Sl("Suspense");case 19:return Sl("SuspenseList");case 0:case 2:case 15:return t=Ap(t.type,!1),t;case 11:return t=Ap(t.type.render,!1),t;case 1:return t=Ap(t.type,!0),t;default:return""}}function T0(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case jo:return"Fragment";case Do:return"Portal";case P0:return"Profiler";case s1:return"StrictMode";case N0:return"Suspense";case R0:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case H3:return(t.displayName||"Context")+".Consumer";case G3:return(t._context.displayName||"Context")+".Provider";case o1:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case a1:return e=t.displayName||null,e!==null?e:T0(t.type)||"Memo";case bi:e=t._payload,t=t._init;try{return T0(t(e))}catch{}}return null}function q9(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return T0(e);case 8:return e===s1?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ns(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function W3(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Y9(t){var e=W3(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,s.call(this,l)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Pc(t){t._valueTracker||(t._valueTracker=Y9(t))}function K3(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=W3(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function pd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function O0(t,e){var n=e.checked;return ut({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function wy(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=ns(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function $3(t,e){e=e.checked,e!=null&&i1(t,"checked",e,!1)}function b0(t,e){$3(t,e);var n=ns(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?L0(t,e.type,n):e.hasOwnProperty("defaultValue")&&L0(t,e.type,ns(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function _y(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function L0(t,e,n){(e!=="number"||pd(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var xl=Array.isArray;function qo(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+ns(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function F0(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(J(91));return ut({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Cy(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(J(92));if(xl(n)){if(1<n.length)throw Error(J(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:ns(n)}}function Q3(t,e){var n=ns(e.value),r=ns(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function ky(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function q3(t){switch(t){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 A0(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?q3(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Nc,Y3=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Nc=Nc||document.createElement("div"),Nc.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Nc.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ul(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Nl={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},X9=["Webkit","ms","Moz","O"];Object.keys(Nl).forEach(function(t){X9.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Nl[e]=Nl[t]})});function X3(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Nl.hasOwnProperty(t)&&Nl[t]?(""+e).trim():e+"px"}function J3(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=X3(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var J9=ut({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 M0(t,e){if(e){if(J9[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(J(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(J(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(J(61))}if(e.style!=null&&typeof e.style!="object")throw Error(J(62))}}function I0(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 D0=null;function l1(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var j0=null,Yo=null,Xo=null;function Ey(t){if(t=yu(t)){if(typeof j0!="function")throw Error(J(280));var e=t.stateNode;e&&(e=nh(e),j0(t.stateNode,t.type,e))}}function Z3(t){Yo?Xo?Xo.push(t):Xo=[t]:Yo=t}function e5(){if(Yo){var t=Yo,e=Xo;if(Xo=Yo=null,Ey(t),e)for(t=0;t<e.length;t++)Ey(e[t])}}function t5(t,e){return t(e)}function n5(){}var Mp=!1;function r5(t,e,n){if(Mp)return t(e,n);Mp=!0;try{return t5(t,e,n)}finally{Mp=!1,(Yo!==null||Xo!==null)&&(n5(),e5())}}function zl(t,e){var n=t.stateNode;if(n===null)return null;var r=nh(n);if(r===null)return null;n=r[e];e:switch(e){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)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(J(231,e,typeof n));return n}var U0=!1;if(oi)try{var al={};Object.defineProperty(al,"passive",{get:function(){U0=!0}}),window.addEventListener("test",al,al),window.removeEventListener("test",al,al)}catch{U0=!1}function Z9(t,e,n,r,i,s,l,u,c){var h=Array.prototype.slice.call(arguments,3);try{e.apply(n,h)}catch(p){this.onError(p)}}var Rl=!1,gd=null,md=!1,z0=null,e7={onError:function(t){Rl=!0,gd=t}};function t7(t,e,n,r,i,s,l,u,c){Rl=!1,gd=null,Z9.apply(e7,arguments)}function n7(t,e,n,r,i,s,l,u,c){if(t7.apply(this,arguments),Rl){if(Rl){var h=gd;Rl=!1,gd=null}else throw Error(J(198));md||(md=!0,z0=h)}}function io(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function i5(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Py(t){if(io(t)!==t)throw Error(J(188))}function r7(t){var e=t.alternate;if(!e){if(e=io(t),e===null)throw Error(J(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Py(i),t;if(s===r)return Py(i),e;s=s.sibling}throw Error(J(188))}if(n.return!==r.return)n=i,r=s;else{for(var l=!1,u=i.child;u;){if(u===n){l=!0,n=i,r=s;break}if(u===r){l=!0,r=i,n=s;break}u=u.sibling}if(!l){for(u=s.child;u;){if(u===n){l=!0,n=s,r=i;break}if(u===r){l=!0,r=s,n=i;break}u=u.sibling}if(!l)throw Error(J(189))}}if(n.alternate!==r)throw Error(J(190))}if(n.tag!==3)throw Error(J(188));return n.stateNode.current===n?t:e}function s5(t){return t=r7(t),t!==null?o5(t):null}function o5(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=o5(t);if(e!==null)return e;t=t.sibling}return null}var a5=Ln.unstable_scheduleCallback,Ny=Ln.unstable_cancelCallback,i7=Ln.unstable_shouldYield,s7=Ln.unstable_requestPaint,mt=Ln.unstable_now,o7=Ln.unstable_getCurrentPriorityLevel,u1=Ln.unstable_ImmediatePriority,l5=Ln.unstable_UserBlockingPriority,yd=Ln.unstable_NormalPriority,a7=Ln.unstable_LowPriority,u5=Ln.unstable_IdlePriority,Jd=null,Mr=null;function l7(t){if(Mr&&typeof Mr.onCommitFiberRoot=="function")try{Mr.onCommitFiberRoot(Jd,t,void 0,(t.current.flags&128)===128)}catch{}}var hr=Math.clz32?Math.clz32:d7,u7=Math.log,c7=Math.LN2;function d7(t){return t>>>=0,t===0?32:31-(u7(t)/c7|0)|0}var Rc=64,Tc=4194304;function wl(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function vd(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,l=n&268435455;if(l!==0){var u=l&~i;u!==0?r=wl(u):(s&=l,s!==0&&(r=wl(s)))}else l=n&~i,l!==0?r=wl(l):s!==0&&(r=wl(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-hr(e),i=1<<n,r|=t[n],e&=~i;return r}function h7(t,e){switch(t){case 1:case 2:case 4:return e+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 e+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 f7(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var l=31-hr(s),u=1<<l,c=i[l];c===-1?(!(u&n)||u&r)&&(i[l]=h7(u,e)):c<=e&&(t.expiredLanes|=u),s&=~u}}function B0(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function c5(){var t=Rc;return Rc<<=1,!(Rc&4194240)&&(Rc=64),t}function Ip(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function gu(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-hr(e),t[e]=n}function p7(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-hr(n),s=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~s}}function c1(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-hr(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var je=0;function d5(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var h5,d1,f5,p5,g5,G0=!1,Oc=[],$i=null,Qi=null,qi=null,Bl=new Map,Gl=new Map,Fi=[],g7="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 Ry(t,e){switch(t){case"focusin":case"focusout":$i=null;break;case"dragenter":case"dragleave":Qi=null;break;case"mouseover":case"mouseout":qi=null;break;case"pointerover":case"pointerout":Bl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gl.delete(e.pointerId)}}function ll(t,e,n,r,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=yu(e),e!==null&&d1(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function m7(t,e,n,r,i){switch(e){case"focusin":return $i=ll($i,t,e,n,r,i),!0;case"dragenter":return Qi=ll(Qi,t,e,n,r,i),!0;case"mouseover":return qi=ll(qi,t,e,n,r,i),!0;case"pointerover":var s=i.pointerId;return Bl.set(s,ll(Bl.get(s)||null,t,e,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Gl.set(s,ll(Gl.get(s)||null,t,e,n,r,i)),!0}return!1}function m5(t){var e=Os(t.target);if(e!==null){var n=io(e);if(n!==null){if(e=n.tag,e===13){if(e=i5(n),e!==null){t.blockedOn=e,g5(t.priority,function(){f5(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Xc(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=H0(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);D0=r,n.target.dispatchEvent(r),D0=null}else return e=yu(n),e!==null&&d1(e),t.blockedOn=n,!1;e.shift()}return!0}function Ty(t,e,n){Xc(t)&&n.delete(e)}function y7(){G0=!1,$i!==null&&Xc($i)&&($i=null),Qi!==null&&Xc(Qi)&&(Qi=null),qi!==null&&Xc(qi)&&(qi=null),Bl.forEach(Ty),Gl.forEach(Ty)}function ul(t,e){t.blockedOn===e&&(t.blockedOn=null,G0||(G0=!0,Ln.unstable_scheduleCallback(Ln.unstable_NormalPriority,y7)))}function Hl(t){function e(i){return ul(i,t)}if(0<Oc.length){ul(Oc[0],t);for(var n=1;n<Oc.length;n++){var r=Oc[n];r.blockedOn===t&&(r.blockedOn=null)}}for($i!==null&&ul($i,t),Qi!==null&&ul(Qi,t),qi!==null&&ul(qi,t),Bl.forEach(e),Gl.forEach(e),n=0;n<Fi.length;n++)r=Fi[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Fi.length&&(n=Fi[0],n.blockedOn===null);)m5(n),n.blockedOn===null&&Fi.shift()}var Jo=ci.ReactCurrentBatchConfig,Sd=!0;function v7(t,e,n,r){var i=je,s=Jo.transition;Jo.transition=null;try{je=1,h1(t,e,n,r)}finally{je=i,Jo.transition=s}}function S7(t,e,n,r){var i=je,s=Jo.transition;Jo.transition=null;try{je=4,h1(t,e,n,r)}finally{je=i,Jo.transition=s}}function h1(t,e,n,r){if(Sd){var i=H0(t,e,n,r);if(i===null)Kp(t,e,r,xd,n),Ry(t,r);else if(m7(i,t,e,n,r))r.stopPropagation();else if(Ry(t,r),e&4&&-1<g7.indexOf(t)){for(;i!==null;){var s=yu(i);if(s!==null&&h5(s),s=H0(t,e,n,r),s===null&&Kp(t,e,r,xd,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Kp(t,e,r,null,n)}}var xd=null;function H0(t,e,n,r){if(xd=null,t=l1(r),t=Os(t),t!==null)if(e=io(t),e===null)t=null;else if(n=e.tag,n===13){if(t=i5(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return xd=t,null}function y5(t){switch(t){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(o7()){case u1:return 1;case l5:return 4;case yd:case a7:return 16;case u5:return 536870912;default:return 16}default:return 16}}var Vi=null,f1=null,Jc=null;function v5(){if(Jc)return Jc;var t,e=f1,n=e.length,r,i="value"in Vi?Vi.value:Vi.textContent,s=i.length;for(t=0;t<n&&e[t]===i[t];t++);var l=n-t;for(r=1;r<=l&&e[n-r]===i[s-r];r++);return Jc=i.slice(t,1<r?1-r:void 0)}function Zc(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function bc(){return!0}function Oy(){return!1}function An(t){function e(n,r,i,s,l){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=l,this.currentTarget=null;for(var u in t)t.hasOwnProperty(u)&&(n=t[u],this[u]=n?n(s):s[u]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?bc:Oy,this.isPropagationStopped=Oy,this}return ut(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=bc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=bc)},persist:function(){},isPersistent:bc}),e}var Na={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},p1=An(Na),mu=ut({},Na,{view:0,detail:0}),x7=An(mu),Dp,jp,cl,Zd=ut({},mu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:g1,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==cl&&(cl&&t.type==="mousemove"?(Dp=t.screenX-cl.screenX,jp=t.screenY-cl.screenY):jp=Dp=0,cl=t),Dp)},movementY:function(t){return"movementY"in t?t.movementY:jp}}),by=An(Zd),w7=ut({},Zd,{dataTransfer:0}),_7=An(w7),C7=ut({},mu,{relatedTarget:0}),Up=An(C7),k7=ut({},Na,{animationName:0,elapsedTime:0,pseudoElement:0}),E7=An(k7),P7=ut({},Na,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),N7=An(P7),R7=ut({},Na,{data:0}),Ly=An(R7),T7={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},O7={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"},b7={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function L7(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=b7[t])?!!e[t]:!1}function g1(){return L7}var F7=ut({},mu,{key:function(t){if(t.key){var e=T7[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Zc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?O7[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:g1,charCode:function(t){return t.type==="keypress"?Zc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Zc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),A7=An(F7),M7=ut({},Zd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fy=An(M7),I7=ut({},mu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:g1}),D7=An(I7),j7=ut({},Na,{propertyName:0,elapsedTime:0,pseudoElement:0}),U7=An(j7),z7=ut({},Zd,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),B7=An(z7),G7=[9,13,27,32],m1=oi&&"CompositionEvent"in window,Tl=null;oi&&"documentMode"in document&&(Tl=document.documentMode);var H7=oi&&"TextEvent"in window&&!Tl,S5=oi&&(!m1||Tl&&8<Tl&&11>=Tl),Ay=" ",My=!1;function x5(t,e){switch(t){case"keyup":return G7.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function w5(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Uo=!1;function V7(t,e){switch(t){case"compositionend":return w5(e);case"keypress":return e.which!==32?null:(My=!0,Ay);case"textInput":return t=e.data,t===Ay&&My?null:t;default:return null}}function W7(t,e){if(Uo)return t==="compositionend"||!m1&&x5(t,e)?(t=v5(),Jc=f1=Vi=null,Uo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return S5&&e.locale!=="ko"?null:e.data;default:return null}}var K7={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 Iy(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!K7[t.type]:e==="textarea"}function _5(t,e,n,r){Z3(r),e=wd(e,"onChange"),0<e.length&&(n=new p1("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Ol=null,Vl=null;function $7(t){F5(t,0)}function eh(t){var e=Go(t);if(K3(e))return t}function Q7(t,e){if(t==="change")return e}var C5=!1;if(oi){var zp;if(oi){var Bp="oninput"in document;if(!Bp){var Dy=document.createElement("div");Dy.setAttribute("oninput","return;"),Bp=typeof Dy.oninput=="function"}zp=Bp}else zp=!1;C5=zp&&(!document.documentMode||9<document.documentMode)}function jy(){Ol&&(Ol.detachEvent("onpropertychange",k5),Vl=Ol=null)}function k5(t){if(t.propertyName==="value"&&eh(Vl)){var e=[];_5(e,Vl,t,l1(t)),r5($7,e)}}function q7(t,e,n){t==="focusin"?(jy(),Ol=e,Vl=n,Ol.attachEvent("onpropertychange",k5)):t==="focusout"&&jy()}function Y7(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return eh(Vl)}function X7(t,e){if(t==="click")return eh(e)}function J7(t,e){if(t==="input"||t==="change")return eh(e)}function Z7(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var gr=typeof Object.is=="function"?Object.is:Z7;function Wl(t,e){if(gr(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!E0.call(e,i)||!gr(t[i],e[i]))return!1}return!0}function Uy(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function zy(t,e){var n=Uy(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Uy(n)}}function E5(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?E5(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function P5(){for(var t=window,e=pd();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=pd(t.document)}return e}function y1(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function ew(t){var e=P5(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&E5(n.ownerDocument.documentElement,n)){if(r!==null&&y1(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=zy(n,s);var l=zy(n,r);i&&l&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==l.node||t.focusOffset!==l.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(l.node,l.offset)):(e.setEnd(l.node,l.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var tw=oi&&"documentMode"in document&&11>=document.documentMode,zo=null,V0=null,bl=null,W0=!1;function By(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;W0||zo==null||zo!==pd(r)||(r=zo,"selectionStart"in r&&y1(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}),bl&&Wl(bl,r)||(bl=r,r=wd(V0,"onSelect"),0<r.length&&(e=new p1("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=zo)))}function Lc(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Bo={animationend:Lc("Animation","AnimationEnd"),animationiteration:Lc("Animation","AnimationIteration"),animationstart:Lc("Animation","AnimationStart"),transitionend:Lc("Transition","TransitionEnd")},Gp={},N5={};oi&&(N5=document.createElement("div").style,"AnimationEvent"in window||(delete Bo.animationend.animation,delete Bo.animationiteration.animation,delete Bo.animationstart.animation),"TransitionEvent"in window||delete Bo.transitionend.transition);function th(t){if(Gp[t])return Gp[t];if(!Bo[t])return t;var e=Bo[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in N5)return Gp[t]=e[n];return t}var R5=th("animationend"),T5=th("animationiteration"),O5=th("animationstart"),b5=th("transitionend"),L5=new Map,Gy="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 ss(t,e){L5.set(t,e),ro(e,[t])}for(var Hp=0;Hp<Gy.length;Hp++){var Vp=Gy[Hp],nw=Vp.toLowerCase(),rw=Vp[0].toUpperCase()+Vp.slice(1);ss(nw,"on"+rw)}ss(R5,"onAnimationEnd");ss(T5,"onAnimationIteration");ss(O5,"onAnimationStart");ss("dblclick","onDoubleClick");ss("focusin","onFocus");ss("focusout","onBlur");ss(b5,"onTransitionEnd");pa("onMouseEnter",["mouseout","mouseover"]);pa("onMouseLeave",["mouseout","mouseover"]);pa("onPointerEnter",["pointerout","pointerover"]);pa("onPointerLeave",["pointerout","pointerover"]);ro("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ro("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ro("onBeforeInput",["compositionend","keypress","textInput","paste"]);ro("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ro("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ro("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _l="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(" "),iw=new Set("cancel close invalid load scroll toggle".split(" ").concat(_l));function Hy(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,n7(r,e,void 0,t),t.currentTarget=null}function F5(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var l=r.length-1;0<=l;l--){var u=r[l],c=u.instance,h=u.currentTarget;if(u=u.listener,c!==s&&i.isPropagationStopped())break e;Hy(i,u,h),s=c}else for(l=0;l<r.length;l++){if(u=r[l],c=u.instance,h=u.currentTarget,u=u.listener,c!==s&&i.isPropagationStopped())break e;Hy(i,u,h),s=c}}}if(md)throw t=z0,md=!1,z0=null,t}function Xe(t,e){var n=e[Y0];n===void 0&&(n=e[Y0]=new Set);var r=t+"__bubble";n.has(r)||(A5(e,t,2,!1),n.add(r))}function Wp(t,e,n){var r=0;e&&(r|=4),A5(n,t,r,e)}var Fc="_reactListening"+Math.random().toString(36).slice(2);function Kl(t){if(!t[Fc]){t[Fc]=!0,B3.forEach(function(n){n!=="selectionchange"&&(iw.has(n)||Wp(n,!1,t),Wp(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Fc]||(e[Fc]=!0,Wp("selectionchange",!1,e))}}function A5(t,e,n,r){switch(y5(e)){case 1:var i=v7;break;case 4:i=S7;break;default:i=h1}n=i.bind(null,e,n,t),i=void 0,!U0||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function Kp(t,e,n,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var u=r.stateNode.containerInfo;if(u===i||u.nodeType===8&&u.parentNode===i)break;if(l===4)for(l=r.return;l!==null;){var c=l.tag;if((c===3||c===4)&&(c=l.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;l=l.return}for(;u!==null;){if(l=Os(u),l===null)return;if(c=l.tag,c===5||c===6){r=s=l;continue e}u=u.parentNode}}r=r.return}r5(function(){var h=s,p=l1(n),y=[];e:{var S=L5.get(t);if(S!==void 0){var x=p1,m=t;switch(t){case"keypress":if(Zc(n)===0)break e;case"keydown":case"keyup":x=A7;break;case"focusin":m="focus",x=Up;break;case"focusout":m="blur",x=Up;break;case"beforeblur":case"afterblur":x=Up;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":x=by;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=_7;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=D7;break;case R5:case T5:case O5:x=E7;break;case b5:x=U7;break;case"scroll":x=x7;break;case"wheel":x=B7;break;case"copy":case"cut":case"paste":x=N7;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Fy}var C=(e&4)!==0,P=!C&&t==="scroll",E=C?S!==null?S+"Capture":null:S;C=[];for(var k=h,v;k!==null;){v=k;var _=v.stateNode;if(v.tag===5&&_!==null&&(v=_,E!==null&&(_=zl(k,E),_!=null&&C.push($l(k,_,v)))),P)break;k=k.return}0<C.length&&(S=new x(S,m,null,n,p),y.push({event:S,listeners:C}))}}if(!(e&7)){e:{if(S=t==="mouseover"||t==="pointerover",x=t==="mouseout"||t==="pointerout",S&&n!==D0&&(m=n.relatedTarget||n.fromElement)&&(Os(m)||m[ai]))break e;if((x||S)&&(S=p.window===p?p:(S=p.ownerDocument)?S.defaultView||S.parentWindow:window,x?(m=n.relatedTarget||n.toElement,x=h,m=m?Os(m):null,m!==null&&(P=io(m),m!==P||m.tag!==5&&m.tag!==6)&&(m=null)):(x=null,m=h),x!==m)){if(C=by,_="onMouseLeave",E="onMouseEnter",k="mouse",(t==="pointerout"||t==="pointerover")&&(C=Fy,_="onPointerLeave",E="onPointerEnter",k="pointer"),P=x==null?S:Go(x),v=m==null?S:Go(m),S=new C(_,k+"leave",x,n,p),S.target=P,S.relatedTarget=v,_=null,Os(p)===h&&(C=new C(E,k+"enter",m,n,p),C.target=v,C.relatedTarget=P,_=C),P=_,x&&m)t:{for(C=x,E=m,k=0,v=C;v;v=Oo(v))k++;for(v=0,_=E;_;_=Oo(_))v++;for(;0<k-v;)C=Oo(C),k--;for(;0<v-k;)E=Oo(E),v--;for(;k--;){if(C===E||E!==null&&C===E.alternate)break t;C=Oo(C),E=Oo(E)}C=null}else C=null;x!==null&&Vy(y,S,x,C,!1),m!==null&&P!==null&&Vy(y,P,m,C,!0)}}e:{if(S=h?Go(h):window,x=S.nodeName&&S.nodeName.toLowerCase(),x==="select"||x==="input"&&S.type==="file")var R=Q7;else if(Iy(S))if(C5)R=J7;else{R=Y7;var b=q7}else(x=S.nodeName)&&x.toLowerCase()==="input"&&(S.type==="checkbox"||S.type==="radio")&&(R=X7);if(R&&(R=R(t,h))){_5(y,R,n,p);break e}b&&b(t,S,h),t==="focusout"&&(b=S._wrapperState)&&b.controlled&&S.type==="number"&&L0(S,"number",S.value)}switch(b=h?Go(h):window,t){case"focusin":(Iy(b)||b.contentEditable==="true")&&(zo=b,V0=h,bl=null);break;case"focusout":bl=V0=zo=null;break;case"mousedown":W0=!0;break;case"contextmenu":case"mouseup":case"dragend":W0=!1,By(y,n,p);break;case"selectionchange":if(tw)break;case"keydown":case"keyup":By(y,n,p)}var A;if(m1)e:{switch(t){case"compositionstart":var O="onCompositionStart";break e;case"compositionend":O="onCompositionEnd";break e;case"compositionupdate":O="onCompositionUpdate";break e}O=void 0}else Uo?x5(t,n)&&(O="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(O="onCompositionStart");O&&(S5&&n.locale!=="ko"&&(Uo||O!=="onCompositionStart"?O==="onCompositionEnd"&&Uo&&(A=v5()):(Vi=p,f1="value"in Vi?Vi.value:Vi.textContent,Uo=!0)),b=wd(h,O),0<b.length&&(O=new Ly(O,t,null,n,p),y.push({event:O,listeners:b}),A?O.data=A:(A=w5(n),A!==null&&(O.data=A)))),(A=H7?V7(t,n):W7(t,n))&&(h=wd(h,"onBeforeInput"),0<h.length&&(p=new Ly("onBeforeInput","beforeinput",null,n,p),y.push({event:p,listeners:h}),p.data=A))}F5(y,e)})}function $l(t,e,n){return{instance:t,listener:e,currentTarget:n}}function wd(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=zl(t,n),s!=null&&r.unshift($l(t,s,i)),s=zl(t,e),s!=null&&r.push($l(t,s,i))),t=t.return}return r}function Oo(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Vy(t,e,n,r,i){for(var s=e._reactName,l=[];n!==null&&n!==r;){var u=n,c=u.alternate,h=u.stateNode;if(c!==null&&c===r)break;u.tag===5&&h!==null&&(u=h,i?(c=zl(n,s),c!=null&&l.unshift($l(n,c,u))):i||(c=zl(n,s),c!=null&&l.push($l(n,c,u)))),n=n.return}l.length!==0&&t.push({event:e,listeners:l})}var sw=/\r\n?/g,ow=/\u0000|\uFFFD/g;function Wy(t){return(typeof t=="string"?t:""+t).replace(sw,`
`).replace(ow,"")}function Ac(t,e,n){if(e=Wy(e),Wy(t)!==e&&n)throw Error(J(425))}function _d(){}var K0=null,$0=null;function Q0(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var q0=typeof setTimeout=="function"?setTimeout:void 0,aw=typeof clearTimeout=="function"?clearTimeout:void 0,Ky=typeof Promise=="function"?Promise:void 0,lw=typeof queueMicrotask=="function"?queueMicrotask:typeof Ky<"u"?function(t){return Ky.resolve(null).then(t).catch(uw)}:q0;function uw(t){setTimeout(function(){throw t})}function $p(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),Hl(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Hl(e)}function Yi(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function $y(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Ra=Math.random().toString(36).slice(2),Lr="__reactFiber$"+Ra,Ql="__reactProps$"+Ra,ai="__reactContainer$"+Ra,Y0="__reactEvents$"+Ra,cw="__reactListeners$"+Ra,dw="__reactHandles$"+Ra;function Os(t){var e=t[Lr];if(e)return e;for(var n=t.parentNode;n;){if(e=n[ai]||n[Lr]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=$y(t);t!==null;){if(n=t[Lr])return n;t=$y(t)}return e}t=n,n=t.parentNode}return null}function yu(t){return t=t[Lr]||t[ai],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Go(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(J(33))}function nh(t){return t[Ql]||null}var X0=[],Ho=-1;function os(t){return{current:t}}function Je(t){0>Ho||(t.current=X0[Ho],X0[Ho]=null,Ho--)}function We(t,e){Ho++,X0[Ho]=t.current,t.current=e}var rs={},Zt=os(rs),xn=os(!1),Qs=rs;function ga(t,e){var n=t.type.contextTypes;if(!n)return rs;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function wn(t){return t=t.childContextTypes,t!=null}function Cd(){Je(xn),Je(Zt)}function Qy(t,e,n){if(Zt.current!==rs)throw Error(J(168));We(Zt,e),We(xn,n)}function M5(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(J(108,q9(t)||"Unknown",i));return ut({},n,r)}function kd(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||rs,Qs=Zt.current,We(Zt,t),We(xn,xn.current),!0}function qy(t,e,n){var r=t.stateNode;if(!r)throw Error(J(169));n?(t=M5(t,e,Qs),r.__reactInternalMemoizedMergedChildContext=t,Je(xn),Je(Zt),We(Zt,t)):Je(xn),We(xn,n)}var Yr=null,rh=!1,Qp=!1;function I5(t){Yr===null?Yr=[t]:Yr.push(t)}function hw(t){rh=!0,I5(t)}function as(){if(!Qp&&Yr!==null){Qp=!0;var t=0,e=je;try{var n=Yr;for(je=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Yr=null,rh=!1}catch(i){throw Yr!==null&&(Yr=Yr.slice(t+1)),a5(u1,as),i}finally{je=e,Qp=!1}}return null}var Vo=[],Wo=0,Ed=null,Pd=0,$n=[],Qn=0,qs=null,ti=1,ni="";function Ns(t,e){Vo[Wo++]=Pd,Vo[Wo++]=Ed,Ed=t,Pd=e}function D5(t,e,n){$n[Qn++]=ti,$n[Qn++]=ni,$n[Qn++]=qs,qs=t;var r=ti;t=ni;var i=32-hr(r)-1;r&=~(1<<i),n+=1;var s=32-hr(e)+i;if(30<s){var l=i-i%5;s=(r&(1<<l)-1).toString(32),r>>=l,i-=l,ti=1<<32-hr(e)+i|n<<i|r,ni=s+t}else ti=1<<s|n<<i|r,ni=t}function v1(t){t.return!==null&&(Ns(t,1),D5(t,1,0))}function S1(t){for(;t===Ed;)Ed=Vo[--Wo],Vo[Wo]=null,Pd=Vo[--Wo],Vo[Wo]=null;for(;t===qs;)qs=$n[--Qn],$n[Qn]=null,ni=$n[--Qn],$n[Qn]=null,ti=$n[--Qn],$n[Qn]=null}var bn=null,On=null,tt=!1,dr=null;function j5(t,e){var n=qn(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function Yy(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,bn=t,On=Yi(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,bn=t,On=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=qs!==null?{id:ti,overflow:ni}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=qn(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,bn=t,On=null,!0):!1;default:return!1}}function J0(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Z0(t){if(tt){var e=On;if(e){var n=e;if(!Yy(t,e)){if(J0(t))throw Error(J(418));e=Yi(n.nextSibling);var r=bn;e&&Yy(t,e)?j5(r,n):(t.flags=t.flags&-4097|2,tt=!1,bn=t)}}else{if(J0(t))throw Error(J(418));t.flags=t.flags&-4097|2,tt=!1,bn=t}}}function Xy(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;bn=t}function Mc(t){if(t!==bn)return!1;if(!tt)return Xy(t),tt=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Q0(t.type,t.memoizedProps)),e&&(e=On)){if(J0(t))throw U5(),Error(J(418));for(;e;)j5(t,e),e=Yi(e.nextSibling)}if(Xy(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(J(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){On=Yi(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}On=null}}else On=bn?Yi(t.stateNode.nextSibling):null;return!0}function U5(){for(var t=On;t;)t=Yi(t.nextSibling)}function ma(){On=bn=null,tt=!1}function x1(t){dr===null?dr=[t]:dr.push(t)}var fw=ci.ReactCurrentBatchConfig;function dl(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(J(309));var r=n.stateNode}if(!r)throw Error(J(147,t));var i=r,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(l){var u=i.refs;l===null?delete u[s]:u[s]=l},e._stringRef=s,e)}if(typeof t!="string")throw Error(J(284));if(!n._owner)throw Error(J(290,t))}return t}function Ic(t,e){throw t=Object.prototype.toString.call(e),Error(J(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Jy(t){var e=t._init;return e(t._payload)}function z5(t){function e(E,k){if(t){var v=E.deletions;v===null?(E.deletions=[k],E.flags|=16):v.push(k)}}function n(E,k){if(!t)return null;for(;k!==null;)e(E,k),k=k.sibling;return null}function r(E,k){for(E=new Map;k!==null;)k.key!==null?E.set(k.key,k):E.set(k.index,k),k=k.sibling;return E}function i(E,k){return E=es(E,k),E.index=0,E.sibling=null,E}function s(E,k,v){return E.index=v,t?(v=E.alternate,v!==null?(v=v.index,v<k?(E.flags|=2,k):v):(E.flags|=2,k)):(E.flags|=1048576,k)}function l(E){return t&&E.alternate===null&&(E.flags|=2),E}function u(E,k,v,_){return k===null||k.tag!==6?(k=t0(v,E.mode,_),k.return=E,k):(k=i(k,v),k.return=E,k)}function c(E,k,v,_){var R=v.type;return R===jo?p(E,k,v.props.children,_,v.key):k!==null&&(k.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===bi&&Jy(R)===k.type)?(_=i(k,v.props),_.ref=dl(E,k,v),_.return=E,_):(_=od(v.type,v.key,v.props,null,E.mode,_),_.ref=dl(E,k,v),_.return=E,_)}function h(E,k,v,_){return k===null||k.tag!==4||k.stateNode.containerInfo!==v.containerInfo||k.stateNode.implementation!==v.implementation?(k=n0(v,E.mode,_),k.return=E,k):(k=i(k,v.children||[]),k.return=E,k)}function p(E,k,v,_,R){return k===null||k.tag!==7?(k=Ws(v,E.mode,_,R),k.return=E,k):(k=i(k,v),k.return=E,k)}function y(E,k,v){if(typeof k=="string"&&k!==""||typeof k=="number")return k=t0(""+k,E.mode,v),k.return=E,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Ec:return v=od(k.type,k.key,k.props,null,E.mode,v),v.ref=dl(E,null,k),v.return=E,v;case Do:return k=n0(k,E.mode,v),k.return=E,k;case bi:var _=k._init;return y(E,_(k._payload),v)}if(xl(k)||ol(k))return k=Ws(k,E.mode,v,null),k.return=E,k;Ic(E,k)}return null}function S(E,k,v,_){var R=k!==null?k.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return R!==null?null:u(E,k,""+v,_);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Ec:return v.key===R?c(E,k,v,_):null;case Do:return v.key===R?h(E,k,v,_):null;case bi:return R=v._init,S(E,k,R(v._payload),_)}if(xl(v)||ol(v))return R!==null?null:p(E,k,v,_,null);Ic(E,v)}return null}function x(E,k,v,_,R){if(typeof _=="string"&&_!==""||typeof _=="number")return E=E.get(v)||null,u(k,E,""+_,R);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Ec:return E=E.get(_.key===null?v:_.key)||null,c(k,E,_,R);case Do:return E=E.get(_.key===null?v:_.key)||null,h(k,E,_,R);case bi:var b=_._init;return x(E,k,v,b(_._payload),R)}if(xl(_)||ol(_))return E=E.get(v)||null,p(k,E,_,R,null);Ic(k,_)}return null}function m(E,k,v,_){for(var R=null,b=null,A=k,O=k=0,I=null;A!==null&&O<v.length;O++){A.index>O?(I=A,A=null):I=A.sibling;var L=S(E,A,v[O],_);if(L===null){A===null&&(A=I);break}t&&A&&L.alternate===null&&e(E,A),k=s(L,k,O),b===null?R=L:b.sibling=L,b=L,A=I}if(O===v.length)return n(E,A),tt&&Ns(E,O),R;if(A===null){for(;O<v.length;O++)A=y(E,v[O],_),A!==null&&(k=s(A,k,O),b===null?R=A:b.sibling=A,b=A);return tt&&Ns(E,O),R}for(A=r(E,A);O<v.length;O++)I=x(A,E,O,v[O],_),I!==null&&(t&&I.alternate!==null&&A.delete(I.key===null?O:I.key),k=s(I,k,O),b===null?R=I:b.sibling=I,b=I);return t&&A.forEach(function(H){return e(E,H)}),tt&&Ns(E,O),R}function C(E,k,v,_){var R=ol(v);if(typeof R!="function")throw Error(J(150));if(v=R.call(v),v==null)throw Error(J(151));for(var b=R=null,A=k,O=k=0,I=null,L=v.next();A!==null&&!L.done;O++,L=v.next()){A.index>O?(I=A,A=null):I=A.sibling;var H=S(E,A,L.value,_);if(H===null){A===null&&(A=I);break}t&&A&&H.alternate===null&&e(E,A),k=s(H,k,O),b===null?R=H:b.sibling=H,b=H,A=I}if(L.done)return n(E,A),tt&&Ns(E,O),R;if(A===null){for(;!L.done;O++,L=v.next())L=y(E,L.value,_),L!==null&&(k=s(L,k,O),b===null?R=L:b.sibling=L,b=L);return tt&&Ns(E,O),R}for(A=r(E,A);!L.done;O++,L=v.next())L=x(A,E,O,L.value,_),L!==null&&(t&&L.alternate!==null&&A.delete(L.key===null?O:L.key),k=s(L,k,O),b===null?R=L:b.sibling=L,b=L);return t&&A.forEach(function(B){return e(E,B)}),tt&&Ns(E,O),R}function P(E,k,v,_){if(typeof v=="object"&&v!==null&&v.type===jo&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Ec:e:{for(var R=v.key,b=k;b!==null;){if(b.key===R){if(R=v.type,R===jo){if(b.tag===7){n(E,b.sibling),k=i(b,v.props.children),k.return=E,E=k;break e}}else if(b.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===bi&&Jy(R)===b.type){n(E,b.sibling),k=i(b,v.props),k.ref=dl(E,b,v),k.return=E,E=k;break e}n(E,b);break}else e(E,b);b=b.sibling}v.type===jo?(k=Ws(v.props.children,E.mode,_,v.key),k.return=E,E=k):(_=od(v.type,v.key,v.props,null,E.mode,_),_.ref=dl(E,k,v),_.return=E,E=_)}return l(E);case Do:e:{for(b=v.key;k!==null;){if(k.key===b)if(k.tag===4&&k.stateNode.containerInfo===v.containerInfo&&k.stateNode.implementation===v.implementation){n(E,k.sibling),k=i(k,v.children||[]),k.return=E,E=k;break e}else{n(E,k);break}else e(E,k);k=k.sibling}k=n0(v,E.mode,_),k.return=E,E=k}return l(E);case bi:return b=v._init,P(E,k,b(v._payload),_)}if(xl(v))return m(E,k,v,_);if(ol(v))return C(E,k,v,_);Ic(E,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,k!==null&&k.tag===6?(n(E,k.sibling),k=i(k,v),k.return=E,E=k):(n(E,k),k=t0(v,E.mode,_),k.return=E,E=k),l(E)):n(E,k)}return P}var ya=z5(!0),B5=z5(!1),Nd=os(null),Rd=null,Ko=null,w1=null;function _1(){w1=Ko=Rd=null}function C1(t){var e=Nd.current;Je(Nd),t._currentValue=e}function eg(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Zo(t,e){Rd=t,w1=Ko=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Sn=!0),t.firstContext=null)}function Xn(t){var e=t._currentValue;if(w1!==t)if(t={context:t,memoizedValue:e,next:null},Ko===null){if(Rd===null)throw Error(J(308));Ko=t,Rd.dependencies={lanes:0,firstContext:t}}else Ko=Ko.next=t;return e}var bs=null;function k1(t){bs===null?bs=[t]:bs.push(t)}function G5(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,k1(e)):(n.next=i.next,i.next=n),e.interleaved=n,li(t,r)}function li(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Li=!1;function E1(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function H5(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ri(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Xi(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,be&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,li(t,n)}return i=r.interleaved,i===null?(e.next=e,k1(r)):(e.next=i.next,i.next=e),r.interleaved=e,li(t,n)}function ed(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,c1(t,n)}}function Zy(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=l:s=s.next=l,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Td(t,e,n,r){var i=t.updateQueue;Li=!1;var s=i.firstBaseUpdate,l=i.lastBaseUpdate,u=i.shared.pending;if(u!==null){i.shared.pending=null;var c=u,h=c.next;c.next=null,l===null?s=h:l.next=h,l=c;var p=t.alternate;p!==null&&(p=p.updateQueue,u=p.lastBaseUpdate,u!==l&&(u===null?p.firstBaseUpdate=h:u.next=h,p.lastBaseUpdate=c))}if(s!==null){var y=i.baseState;l=0,p=h=c=null,u=s;do{var S=u.lane,x=u.eventTime;if((r&S)===S){p!==null&&(p=p.next={eventTime:x,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var m=t,C=u;switch(S=e,x=n,C.tag){case 1:if(m=C.payload,typeof m=="function"){y=m.call(x,y,S);break e}y=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=C.payload,S=typeof m=="function"?m.call(x,y,S):m,S==null)break e;y=ut({},y,S);break e;case 2:Li=!0}}u.callback!==null&&u.lane!==0&&(t.flags|=64,S=i.effects,S===null?i.effects=[u]:S.push(u))}else x={eventTime:x,lane:S,tag:u.tag,payload:u.payload,callback:u.callback,next:null},p===null?(h=p=x,c=y):p=p.next=x,l|=S;if(u=u.next,u===null){if(u=i.shared.pending,u===null)break;S=u,u=S.next,S.next=null,i.lastBaseUpdate=S,i.shared.pending=null}}while(!0);if(p===null&&(c=y),i.baseState=c,i.firstBaseUpdate=h,i.lastBaseUpdate=p,e=i.shared.interleaved,e!==null){i=e;do l|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Xs|=l,t.lanes=l,t.memoizedState=y}}function ev(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(J(191,i));i.call(r)}}}var vu={},Ir=os(vu),ql=os(vu),Yl=os(vu);function Ls(t){if(t===vu)throw Error(J(174));return t}function P1(t,e){switch(We(Yl,e),We(ql,t),We(Ir,vu),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:A0(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=A0(e,t)}Je(Ir),We(Ir,e)}function va(){Je(Ir),Je(ql),Je(Yl)}function V5(t){Ls(Yl.current);var e=Ls(Ir.current),n=A0(e,t.type);e!==n&&(We(ql,t),We(Ir,n))}function N1(t){ql.current===t&&(Je(Ir),Je(ql))}var at=os(0);function Od(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var qp=[];function R1(){for(var t=0;t<qp.length;t++)qp[t]._workInProgressVersionPrimary=null;qp.length=0}var td=ci.ReactCurrentDispatcher,Yp=ci.ReactCurrentBatchConfig,Ys=0,lt=null,Et=null,It=null,bd=!1,Ll=!1,Xl=0,pw=0;function Qt(){throw Error(J(321))}function T1(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!gr(t[n],e[n]))return!1;return!0}function O1(t,e,n,r,i,s){if(Ys=s,lt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,td.current=t===null||t.memoizedState===null?vw:Sw,t=n(r,i),Ll){s=0;do{if(Ll=!1,Xl=0,25<=s)throw Error(J(301));s+=1,It=Et=null,e.updateQueue=null,td.current=xw,t=n(r,i)}while(Ll)}if(td.current=Ld,e=Et!==null&&Et.next!==null,Ys=0,It=Et=lt=null,bd=!1,e)throw Error(J(300));return t}function b1(){var t=Xl!==0;return Xl=0,t}function Rr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?lt.memoizedState=It=t:It=It.next=t,It}function Jn(){if(Et===null){var t=lt.alternate;t=t!==null?t.memoizedState:null}else t=Et.next;var e=It===null?lt.memoizedState:It.next;if(e!==null)It=e,Et=t;else{if(t===null)throw Error(J(310));Et=t,t={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},It===null?lt.memoizedState=It=t:It=It.next=t}return It}function Jl(t,e){return typeof e=="function"?e(t):e}function Xp(t){var e=Jn(),n=e.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=t;var r=Et,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var l=i.next;i.next=s.next,s.next=l}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var u=l=null,c=null,h=s;do{var p=h.lane;if((Ys&p)===p)c!==null&&(c=c.next={lane:0,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null}),r=h.hasEagerState?h.eagerState:t(r,h.action);else{var y={lane:p,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null};c===null?(u=c=y,l=r):c=c.next=y,lt.lanes|=p,Xs|=p}h=h.next}while(h!==null&&h!==s);c===null?l=r:c.next=u,gr(r,e.memoizedState)||(Sn=!0),e.memoizedState=r,e.baseState=l,e.baseQueue=c,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do s=i.lane,lt.lanes|=s,Xs|=s,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Jp(t){var e=Jn(),n=e.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,s=e.memoizedState;if(i!==null){n.pending=null;var l=i=i.next;do s=t(s,l.action),l=l.next;while(l!==i);gr(s,e.memoizedState)||(Sn=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,r]}function W5(){}function K5(t,e){var n=lt,r=Jn(),i=e(),s=!gr(r.memoizedState,i);if(s&&(r.memoizedState=i,Sn=!0),r=r.queue,L1(q5.bind(null,n,r,t),[t]),r.getSnapshot!==e||s||It!==null&&It.memoizedState.tag&1){if(n.flags|=2048,Zl(9,Q5.bind(null,n,r,i,e),void 0,null),Dt===null)throw Error(J(349));Ys&30||$5(n,e,i)}return i}function $5(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=lt.updateQueue,e===null?(e={lastEffect:null,stores:null},lt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function Q5(t,e,n,r){e.value=n,e.getSnapshot=r,Y5(e)&&X5(t)}function q5(t,e,n){return n(function(){Y5(e)&&X5(t)})}function Y5(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!gr(t,n)}catch{return!0}}function X5(t){var e=li(t,1);e!==null&&fr(e,t,1,-1)}function tv(t){var e=Rr();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Jl,lastRenderedState:t},e.queue=t,t=t.dispatch=yw.bind(null,lt,t),[e.memoizedState,t]}function Zl(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=lt.updateQueue,e===null?(e={lastEffect:null,stores:null},lt.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function J5(){return Jn().memoizedState}function nd(t,e,n,r){var i=Rr();lt.flags|=t,i.memoizedState=Zl(1|e,n,void 0,r===void 0?null:r)}function ih(t,e,n,r){var i=Jn();r=r===void 0?null:r;var s=void 0;if(Et!==null){var l=Et.memoizedState;if(s=l.destroy,r!==null&&T1(r,l.deps)){i.memoizedState=Zl(e,n,s,r);return}}lt.flags|=t,i.memoizedState=Zl(1|e,n,s,r)}function nv(t,e){return nd(8390656,8,t,e)}function L1(t,e){return ih(2048,8,t,e)}function Z5(t,e){return ih(4,2,t,e)}function e6(t,e){return ih(4,4,t,e)}function t6(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function n6(t,e,n){return n=n!=null?n.concat([t]):null,ih(4,4,t6.bind(null,e,t),n)}function F1(){}function r6(t,e){var n=Jn();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&T1(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function i6(t,e){var n=Jn();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&T1(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function s6(t,e,n){return Ys&21?(gr(n,e)||(n=c5(),lt.lanes|=n,Xs|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Sn=!0),t.memoizedState=n)}function gw(t,e){var n=je;je=n!==0&&4>n?n:4,t(!0);var r=Yp.transition;Yp.transition={};try{t(!1),e()}finally{je=n,Yp.transition=r}}function o6(){return Jn().memoizedState}function mw(t,e,n){var r=Zi(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},a6(t))l6(e,n);else if(n=G5(t,e,n,r),n!==null){var i=on();fr(n,t,r,i),u6(n,e,r)}}function yw(t,e,n){var r=Zi(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(a6(t))l6(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var l=e.lastRenderedState,u=s(l,n);if(i.hasEagerState=!0,i.eagerState=u,gr(u,l)){var c=e.interleaved;c===null?(i.next=i,k1(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}n=G5(t,e,i,r),n!==null&&(i=on(),fr(n,t,r,i),u6(n,e,r))}}function a6(t){var e=t.alternate;return t===lt||e!==null&&e===lt}function l6(t,e){Ll=bd=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function u6(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,c1(t,n)}}var Ld={readContext:Xn,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useInsertionEffect:Qt,useLayoutEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useMutableSource:Qt,useSyncExternalStore:Qt,useId:Qt,unstable_isNewReconciler:!1},vw={readContext:Xn,useCallback:function(t,e){return Rr().memoizedState=[t,e===void 0?null:e],t},useContext:Xn,useEffect:nv,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,nd(4194308,4,t6.bind(null,e,t),n)},useLayoutEffect:function(t,e){return nd(4194308,4,t,e)},useInsertionEffect:function(t,e){return nd(4,2,t,e)},useMemo:function(t,e){var n=Rr();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Rr();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=mw.bind(null,lt,t),[r.memoizedState,t]},useRef:function(t){var e=Rr();return t={current:t},e.memoizedState=t},useState:tv,useDebugValue:F1,useDeferredValue:function(t){return Rr().memoizedState=t},useTransition:function(){var t=tv(!1),e=t[0];return t=gw.bind(null,t[1]),Rr().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=lt,i=Rr();if(tt){if(n===void 0)throw Error(J(407));n=n()}else{if(n=e(),Dt===null)throw Error(J(349));Ys&30||$5(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,nv(q5.bind(null,r,s,t),[t]),r.flags|=2048,Zl(9,Q5.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=Rr(),e=Dt.identifierPrefix;if(tt){var n=ni,r=ti;n=(r&~(1<<32-hr(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Xl++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=pw++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Sw={readContext:Xn,useCallback:r6,useContext:Xn,useEffect:L1,useImperativeHandle:n6,useInsertionEffect:Z5,useLayoutEffect:e6,useMemo:i6,useReducer:Xp,useRef:J5,useState:function(){return Xp(Jl)},useDebugValue:F1,useDeferredValue:function(t){var e=Jn();return s6(e,Et.memoizedState,t)},useTransition:function(){var t=Xp(Jl)[0],e=Jn().memoizedState;return[t,e]},useMutableSource:W5,useSyncExternalStore:K5,useId:o6,unstable_isNewReconciler:!1},xw={readContext:Xn,useCallback:r6,useContext:Xn,useEffect:L1,useImperativeHandle:n6,useInsertionEffect:Z5,useLayoutEffect:e6,useMemo:i6,useReducer:Jp,useRef:J5,useState:function(){return Jp(Jl)},useDebugValue:F1,useDeferredValue:function(t){var e=Jn();return Et===null?e.memoizedState=t:s6(e,Et.memoizedState,t)},useTransition:function(){var t=Jp(Jl)[0],e=Jn().memoizedState;return[t,e]},useMutableSource:W5,useSyncExternalStore:K5,useId:o6,unstable_isNewReconciler:!1};function lr(t,e){if(t&&t.defaultProps){e=ut({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function tg(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:ut({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var sh={isMounted:function(t){return(t=t._reactInternals)?io(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=on(),i=Zi(t),s=ri(r,i);s.payload=e,n!=null&&(s.callback=n),e=Xi(t,s,i),e!==null&&(fr(e,t,i,r),ed(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=on(),i=Zi(t),s=ri(r,i);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=Xi(t,s,i),e!==null&&(fr(e,t,i,r),ed(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=on(),r=Zi(t),i=ri(n,r);i.tag=2,e!=null&&(i.callback=e),e=Xi(t,i,r),e!==null&&(fr(e,t,r,n),ed(e,t,r))}};function rv(t,e,n,r,i,s,l){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,s,l):e.prototype&&e.prototype.isPureReactComponent?!Wl(n,r)||!Wl(i,s):!0}function c6(t,e,n){var r=!1,i=rs,s=e.contextType;return typeof s=="object"&&s!==null?s=Xn(s):(i=wn(e)?Qs:Zt.current,r=e.contextTypes,s=(r=r!=null)?ga(t,i):rs),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=sh,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function iv(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&sh.enqueueReplaceState(e,e.state,null)}function ng(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},E1(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=Xn(s):(s=wn(e)?Qs:Zt.current,i.context=ga(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(tg(t,e,s,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&sh.enqueueReplaceState(i,i.state,null),Td(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Sa(t,e){try{var n="",r=e;do n+=Q9(r),r=r.return;while(r);var i=n}catch(s){i=`
Error generating stack: `+s.message+`
`+s.stack}return{value:t,source:e,stack:i,digest:null}}function Zp(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function rg(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var ww=typeof WeakMap=="function"?WeakMap:Map;function d6(t,e,n){n=ri(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Ad||(Ad=!0,fg=r),rg(t,e)},n}function h6(t,e,n){n=ri(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){rg(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){rg(t,e),typeof r!="function"&&(Ji===null?Ji=new Set([this]):Ji.add(this));var l=e.stack;this.componentDidCatch(e.value,{componentStack:l!==null?l:""})}),n}function sv(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new ww;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=Mw.bind(null,t,e,n),e.then(t,t))}function ov(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function av(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=ri(-1,1),e.tag=2,Xi(n,e,1))),n.lanes|=1),t)}var _w=ci.ReactCurrentOwner,Sn=!1;function rn(t,e,n,r){e.child=t===null?B5(e,null,n,r):ya(e,t.child,n,r)}function lv(t,e,n,r,i){n=n.render;var s=e.ref;return Zo(e,i),r=O1(t,e,n,r,s,i),n=b1(),t!==null&&!Sn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,ui(t,e,i)):(tt&&n&&v1(e),e.flags|=1,rn(t,e,r,i),e.child)}function uv(t,e,n,r,i){if(t===null){var s=n.type;return typeof s=="function"&&!B1(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,f6(t,e,s,r,i)):(t=od(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var l=s.memoizedProps;if(n=n.compare,n=n!==null?n:Wl,n(l,r)&&t.ref===e.ref)return ui(t,e,i)}return e.flags|=1,t=es(s,r),t.ref=e.ref,t.return=e,e.child=t}function f6(t,e,n,r,i){if(t!==null){var s=t.memoizedProps;if(Wl(s,r)&&t.ref===e.ref)if(Sn=!1,e.pendingProps=r=s,(t.lanes&i)!==0)t.flags&131072&&(Sn=!0);else return e.lanes=t.lanes,ui(t,e,i)}return ig(t,e,n,r,i)}function p6(t,e,n){var r=e.pendingProps,i=r.children,s=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},We(Qo,Nn),Nn|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,We(Qo,Nn),Nn|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,We(Qo,Nn),Nn|=r}else s!==null?(r=s.baseLanes|n,e.memoizedState=null):r=n,We(Qo,Nn),Nn|=r;return rn(t,e,i,n),e.child}function g6(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function ig(t,e,n,r,i){var s=wn(n)?Qs:Zt.current;return s=ga(e,s),Zo(e,i),n=O1(t,e,n,r,s,i),r=b1(),t!==null&&!Sn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,ui(t,e,i)):(tt&&r&&v1(e),e.flags|=1,rn(t,e,n,i),e.child)}function cv(t,e,n,r,i){if(wn(n)){var s=!0;kd(e)}else s=!1;if(Zo(e,i),e.stateNode===null)rd(t,e),c6(e,n,r),ng(e,n,r,i),r=!0;else if(t===null){var l=e.stateNode,u=e.memoizedProps;l.props=u;var c=l.context,h=n.contextType;typeof h=="object"&&h!==null?h=Xn(h):(h=wn(n)?Qs:Zt.current,h=ga(e,h));var p=n.getDerivedStateFromProps,y=typeof p=="function"||typeof l.getSnapshotBeforeUpdate=="function";y||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(u!==r||c!==h)&&iv(e,l,r,h),Li=!1;var S=e.memoizedState;l.state=S,Td(e,r,l,i),c=e.memoizedState,u!==r||S!==c||xn.current||Li?(typeof p=="function"&&(tg(e,n,p,r),c=e.memoizedState),(u=Li||rv(e,n,u,r,S,c,h))?(y||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(e.flags|=4194308)):(typeof l.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=c),l.props=r,l.state=c,l.context=h,r=u):(typeof l.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{l=e.stateNode,H5(t,e),u=e.memoizedProps,h=e.type===e.elementType?u:lr(e.type,u),l.props=h,y=e.pendingProps,S=l.context,c=n.contextType,typeof c=="object"&&c!==null?c=Xn(c):(c=wn(n)?Qs:Zt.current,c=ga(e,c));var x=n.getDerivedStateFromProps;(p=typeof x=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(u!==y||S!==c)&&iv(e,l,r,c),Li=!1,S=e.memoizedState,l.state=S,Td(e,r,l,i);var m=e.memoizedState;u!==y||S!==m||xn.current||Li?(typeof x=="function"&&(tg(e,n,x,r),m=e.memoizedState),(h=Li||rv(e,n,h,r,S,m,c)||!1)?(p||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,m,c),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,m,c)),typeof l.componentDidUpdate=="function"&&(e.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof l.componentDidUpdate!="function"||u===t.memoizedProps&&S===t.memoizedState||(e.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||u===t.memoizedProps&&S===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=m),l.props=r,l.state=m,l.context=c,r=h):(typeof l.componentDidUpdate!="function"||u===t.memoizedProps&&S===t.memoizedState||(e.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||u===t.memoizedProps&&S===t.memoizedState||(e.flags|=1024),r=!1)}return sg(t,e,n,r,s,i)}function sg(t,e,n,r,i,s){g6(t,e);var l=(e.flags&128)!==0;if(!r&&!l)return i&&qy(e,n,!1),ui(t,e,s);r=e.stateNode,_w.current=e;var u=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&l?(e.child=ya(e,t.child,null,s),e.child=ya(e,null,u,s)):rn(t,e,u,s),e.memoizedState=r.state,i&&qy(e,n,!0),e.child}function m6(t){var e=t.stateNode;e.pendingContext?Qy(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Qy(t,e.context,!1),P1(t,e.containerInfo)}function dv(t,e,n,r,i){return ma(),x1(i),e.flags|=256,rn(t,e,n,r),e.child}var og={dehydrated:null,treeContext:null,retryLane:0};function ag(t){return{baseLanes:t,cachePool:null,transitions:null}}function y6(t,e,n){var r=e.pendingProps,i=at.current,s=!1,l=(e.flags&128)!==0,u;if((u=l)||(u=t!==null&&t.memoizedState===null?!1:(i&2)!==0),u?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),We(at,i&1),t===null)return Z0(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(l=r.children,t=r.fallback,s?(r=e.mode,s=e.child,l={mode:"hidden",children:l},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=l):s=lh(l,r,0,null),t=Ws(t,r,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=ag(n),e.memoizedState=og,t):A1(e,l));if(i=t.memoizedState,i!==null&&(u=i.dehydrated,u!==null))return Cw(t,e,l,r,u,i,n);if(s){s=r.fallback,l=e.mode,i=t.child,u=i.sibling;var c={mode:"hidden",children:r.children};return!(l&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=c,e.deletions=null):(r=es(i,c),r.subtreeFlags=i.subtreeFlags&14680064),u!==null?s=es(u,s):(s=Ws(s,l,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,l=t.child.memoizedState,l=l===null?ag(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=t.childLanes&~n,e.memoizedState=og,r}return s=t.child,t=s.sibling,r=es(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function A1(t,e){return e=lh({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Dc(t,e,n,r){return r!==null&&x1(r),ya(e,t.child,null,n),t=A1(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Cw(t,e,n,r,i,s,l){if(n)return e.flags&256?(e.flags&=-257,r=Zp(Error(J(422))),Dc(t,e,l,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=lh({mode:"visible",children:r.children},i,0,null),s=Ws(s,i,l,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&ya(e,t.child,null,l),e.child.memoizedState=ag(l),e.memoizedState=og,s);if(!(e.mode&1))return Dc(t,e,l,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var u=r.dgst;return r=u,s=Error(J(419)),r=Zp(s,r,void 0),Dc(t,e,l,r)}if(u=(l&t.childLanes)!==0,Sn||u){if(r=Dt,r!==null){switch(l&-l){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|l)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,li(t,i),fr(r,t,i,-1))}return z1(),r=Zp(Error(J(421))),Dc(t,e,l,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=Iw.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,On=Yi(i.nextSibling),bn=e,tt=!0,dr=null,t!==null&&($n[Qn++]=ti,$n[Qn++]=ni,$n[Qn++]=qs,ti=t.id,ni=t.overflow,qs=e),e=A1(e,r.children),e.flags|=4096,e)}function hv(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),eg(t.return,e,n)}function e0(t,e,n,r,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function v6(t,e,n){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(rn(t,e,r.children,n),r=at.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&hv(t,n,e);else if(t.tag===19)hv(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(We(at,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&Od(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),e0(e,!1,i,n,s);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Od(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}e0(e,!0,n,null,s);break;case"together":e0(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function rd(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function ui(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Xs|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(J(153));if(e.child!==null){for(t=e.child,n=es(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=es(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function kw(t,e,n){switch(e.tag){case 3:m6(e),ma();break;case 5:V5(e);break;case 1:wn(e.type)&&kd(e);break;case 4:P1(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;We(Nd,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(We(at,at.current&1),e.flags|=128,null):n&e.child.childLanes?y6(t,e,n):(We(at,at.current&1),t=ui(t,e,n),t!==null?t.sibling:null);We(at,at.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return v6(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),We(at,at.current),r)break;return null;case 22:case 23:return e.lanes=0,p6(t,e,n)}return ui(t,e,n)}var S6,lg,x6,w6;S6=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};lg=function(){};x6=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,Ls(Ir.current);var s=null;switch(n){case"input":i=O0(t,i),r=O0(t,r),s=[];break;case"select":i=ut({},i,{value:void 0}),r=ut({},r,{value:void 0}),s=[];break;case"textarea":i=F0(t,i),r=F0(t,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=_d)}M0(n,r);var l;n=null;for(h in i)if(!r.hasOwnProperty(h)&&i.hasOwnProperty(h)&&i[h]!=null)if(h==="style"){var u=i[h];for(l in u)u.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else h!=="dangerouslySetInnerHTML"&&h!=="children"&&h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(jl.hasOwnProperty(h)?s||(s=[]):(s=s||[]).push(h,null));for(h in r){var c=r[h];if(u=i!=null?i[h]:void 0,r.hasOwnProperty(h)&&c!==u&&(c!=null||u!=null))if(h==="style")if(u){for(l in u)!u.hasOwnProperty(l)||c&&c.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in c)c.hasOwnProperty(l)&&u[l]!==c[l]&&(n||(n={}),n[l]=c[l])}else n||(s||(s=[]),s.push(h,n)),n=c;else h==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,u=u?u.__html:void 0,c!=null&&u!==c&&(s=s||[]).push(h,c)):h==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(h,""+c):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&(jl.hasOwnProperty(h)?(c!=null&&h==="onScroll"&&Xe("scroll",t),s||u===c||(s=[])):(s=s||[]).push(h,c))}n&&(s=s||[]).push("style",n);var h=s;(e.updateQueue=h)&&(e.flags|=4)}};w6=function(t,e,n,r){n!==r&&(e.flags|=4)};function hl(t,e){if(!tt)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function qt(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function Ew(t,e,n){var r=e.pendingProps;switch(S1(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qt(e),null;case 1:return wn(e.type)&&Cd(),qt(e),null;case 3:return r=e.stateNode,va(),Je(xn),Je(Zt),R1(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Mc(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,dr!==null&&(mg(dr),dr=null))),lg(t,e),qt(e),null;case 5:N1(e);var i=Ls(Yl.current);if(n=e.type,t!==null&&e.stateNode!=null)x6(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(J(166));return qt(e),null}if(t=Ls(Ir.current),Mc(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[Lr]=e,r[Ql]=s,t=(e.mode&1)!==0,n){case"dialog":Xe("cancel",r),Xe("close",r);break;case"iframe":case"object":case"embed":Xe("load",r);break;case"video":case"audio":for(i=0;i<_l.length;i++)Xe(_l[i],r);break;case"source":Xe("error",r);break;case"img":case"image":case"link":Xe("error",r),Xe("load",r);break;case"details":Xe("toggle",r);break;case"input":wy(r,s),Xe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Xe("invalid",r);break;case"textarea":Cy(r,s),Xe("invalid",r)}M0(n,s),i=null;for(var l in s)if(s.hasOwnProperty(l)){var u=s[l];l==="children"?typeof u=="string"?r.textContent!==u&&(s.suppressHydrationWarning!==!0&&Ac(r.textContent,u,t),i=["children",u]):typeof u=="number"&&r.textContent!==""+u&&(s.suppressHydrationWarning!==!0&&Ac(r.textContent,u,t),i=["children",""+u]):jl.hasOwnProperty(l)&&u!=null&&l==="onScroll"&&Xe("scroll",r)}switch(n){case"input":Pc(r),_y(r,s,!0);break;case"textarea":Pc(r),ky(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=_d)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{l=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=q3(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=l.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=l.createElement(n,{is:r.is}):(t=l.createElement(n),n==="select"&&(l=t,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):t=l.createElementNS(t,n),t[Lr]=e,t[Ql]=r,S6(t,e,!1,!1),e.stateNode=t;e:{switch(l=I0(n,r),n){case"dialog":Xe("cancel",t),Xe("close",t),i=r;break;case"iframe":case"object":case"embed":Xe("load",t),i=r;break;case"video":case"audio":for(i=0;i<_l.length;i++)Xe(_l[i],t);i=r;break;case"source":Xe("error",t),i=r;break;case"img":case"image":case"link":Xe("error",t),Xe("load",t),i=r;break;case"details":Xe("toggle",t),i=r;break;case"input":wy(t,r),i=O0(t,r),Xe("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=ut({},r,{value:void 0}),Xe("invalid",t);break;case"textarea":Cy(t,r),i=F0(t,r),Xe("invalid",t);break;default:i=r}M0(n,i),u=i;for(s in u)if(u.hasOwnProperty(s)){var c=u[s];s==="style"?J3(t,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Y3(t,c)):s==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Ul(t,c):typeof c=="number"&&Ul(t,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(jl.hasOwnProperty(s)?c!=null&&s==="onScroll"&&Xe("scroll",t):c!=null&&i1(t,s,c,l))}switch(n){case"input":Pc(t),_y(t,r,!1);break;case"textarea":Pc(t),ky(t);break;case"option":r.value!=null&&t.setAttribute("value",""+ns(r.value));break;case"select":t.multiple=!!r.multiple,s=r.value,s!=null?qo(t,!!r.multiple,s,!1):r.defaultValue!=null&&qo(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=_d)}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&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return qt(e),null;case 6:if(t&&e.stateNode!=null)w6(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(J(166));if(n=Ls(Yl.current),Ls(Ir.current),Mc(e)){if(r=e.stateNode,n=e.memoizedProps,r[Lr]=e,(s=r.nodeValue!==n)&&(t=bn,t!==null))switch(t.tag){case 3:Ac(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Ac(r.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Lr]=e,e.stateNode=r}return qt(e),null;case 13:if(Je(at),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(tt&&On!==null&&e.mode&1&&!(e.flags&128))U5(),ma(),e.flags|=98560,s=!1;else if(s=Mc(e),r!==null&&r.dehydrated!==null){if(t===null){if(!s)throw Error(J(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(J(317));s[Lr]=e}else ma(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;qt(e),s=!1}else dr!==null&&(mg(dr),dr=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||at.current&1?Nt===0&&(Nt=3):z1())),e.updateQueue!==null&&(e.flags|=4),qt(e),null);case 4:return va(),lg(t,e),t===null&&Kl(e.stateNode.containerInfo),qt(e),null;case 10:return C1(e.type._context),qt(e),null;case 17:return wn(e.type)&&Cd(),qt(e),null;case 19:if(Je(at),s=e.memoizedState,s===null)return qt(e),null;if(r=(e.flags&128)!==0,l=s.rendering,l===null)if(r)hl(s,!1);else{if(Nt!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(l=Od(t),l!==null){for(e.flags|=128,hl(s,!1),r=l.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)s=n,t=r,s.flags&=14680066,l=s.alternate,l===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,t=l.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return We(at,at.current&1|2),e.child}t=t.sibling}s.tail!==null&&mt()>xa&&(e.flags|=128,r=!0,hl(s,!1),e.lanes=4194304)}else{if(!r)if(t=Od(l),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),hl(s,!0),s.tail===null&&s.tailMode==="hidden"&&!l.alternate&&!tt)return qt(e),null}else 2*mt()-s.renderingStartTime>xa&&n!==1073741824&&(e.flags|=128,r=!0,hl(s,!1),e.lanes=4194304);s.isBackwards?(l.sibling=e.child,e.child=l):(n=s.last,n!==null?n.sibling=l:e.child=l,s.last=l)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=mt(),e.sibling=null,n=at.current,We(at,r?n&1|2:n&1),e):(qt(e),null);case 22:case 23:return U1(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Nn&1073741824&&(qt(e),e.subtreeFlags&6&&(e.flags|=8192)):qt(e),null;case 24:return null;case 25:return null}throw Error(J(156,e.tag))}function Pw(t,e){switch(S1(e),e.tag){case 1:return wn(e.type)&&Cd(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return va(),Je(xn),Je(Zt),R1(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return N1(e),null;case 13:if(Je(at),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(J(340));ma()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Je(at),null;case 4:return va(),null;case 10:return C1(e.type._context),null;case 22:case 23:return U1(),null;case 24:return null;default:return null}}var jc=!1,Xt=!1,Nw=typeof WeakSet=="function"?WeakSet:Set,le=null;function $o(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ht(t,e,r)}else n.current=null}function ug(t,e,n){try{n()}catch(r){ht(t,e,r)}}var fv=!1;function Rw(t,e){if(K0=Sd,t=P5(),y1(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var l=0,u=-1,c=-1,h=0,p=0,y=t,S=null;t:for(;;){for(var x;y!==n||i!==0&&y.nodeType!==3||(u=l+i),y!==s||r!==0&&y.nodeType!==3||(c=l+r),y.nodeType===3&&(l+=y.nodeValue.length),(x=y.firstChild)!==null;)S=y,y=x;for(;;){if(y===t)break t;if(S===n&&++h===i&&(u=l),S===s&&++p===r&&(c=l),(x=y.nextSibling)!==null)break;y=S,S=y.parentNode}y=x}n=u===-1||c===-1?null:{start:u,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for($0={focusedElem:t,selectionRange:n},Sd=!1,le=e;le!==null;)if(e=le,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,le=t;else for(;le!==null;){e=le;try{var m=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var C=m.memoizedProps,P=m.memoizedState,E=e.stateNode,k=E.getSnapshotBeforeUpdate(e.elementType===e.type?C:lr(e.type,C),P);E.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var v=e.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(J(163))}}catch(_){ht(e,e.return,_)}if(t=e.sibling,t!==null){t.return=e.return,le=t;break}le=e.return}return m=fv,fv=!1,m}function Fl(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&ug(e,n,s)}i=i.next}while(i!==r)}}function oh(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function cg(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function _6(t){var e=t.alternate;e!==null&&(t.alternate=null,_6(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Lr],delete e[Ql],delete e[Y0],delete e[cw],delete e[dw])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function C6(t){return t.tag===5||t.tag===3||t.tag===4}function pv(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||C6(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function dg(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=_d));else if(r!==4&&(t=t.child,t!==null))for(dg(t,e,n),t=t.sibling;t!==null;)dg(t,e,n),t=t.sibling}function hg(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(hg(t,e,n),t=t.sibling;t!==null;)hg(t,e,n),t=t.sibling}var zt=null,cr=!1;function Ni(t,e,n){for(n=n.child;n!==null;)k6(t,e,n),n=n.sibling}function k6(t,e,n){if(Mr&&typeof Mr.onCommitFiberUnmount=="function")try{Mr.onCommitFiberUnmount(Jd,n)}catch{}switch(n.tag){case 5:Xt||$o(n,e);case 6:var r=zt,i=cr;zt=null,Ni(t,e,n),zt=r,cr=i,zt!==null&&(cr?(t=zt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):zt.removeChild(n.stateNode));break;case 18:zt!==null&&(cr?(t=zt,n=n.stateNode,t.nodeType===8?$p(t.parentNode,n):t.nodeType===1&&$p(t,n),Hl(t)):$p(zt,n.stateNode));break;case 4:r=zt,i=cr,zt=n.stateNode.containerInfo,cr=!0,Ni(t,e,n),zt=r,cr=i;break;case 0:case 11:case 14:case 15:if(!Xt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,l=s.destroy;s=s.tag,l!==void 0&&(s&2||s&4)&&ug(n,e,l),i=i.next}while(i!==r)}Ni(t,e,n);break;case 1:if(!Xt&&($o(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){ht(n,e,u)}Ni(t,e,n);break;case 21:Ni(t,e,n);break;case 22:n.mode&1?(Xt=(r=Xt)||n.memoizedState!==null,Ni(t,e,n),Xt=r):Ni(t,e,n);break;default:Ni(t,e,n)}}function gv(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Nw),e.forEach(function(r){var i=Dw.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function or(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=t,l=e,u=l;e:for(;u!==null;){switch(u.tag){case 5:zt=u.stateNode,cr=!1;break e;case 3:zt=u.stateNode.containerInfo,cr=!0;break e;case 4:zt=u.stateNode.containerInfo,cr=!0;break e}u=u.return}if(zt===null)throw Error(J(160));k6(s,l,i),zt=null,cr=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(h){ht(i,e,h)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)E6(e,t),e=e.sibling}function E6(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(or(e,t),Nr(t),r&4){try{Fl(3,t,t.return),oh(3,t)}catch(C){ht(t,t.return,C)}try{Fl(5,t,t.return)}catch(C){ht(t,t.return,C)}}break;case 1:or(e,t),Nr(t),r&512&&n!==null&&$o(n,n.return);break;case 5:if(or(e,t),Nr(t),r&512&&n!==null&&$o(n,n.return),t.flags&32){var i=t.stateNode;try{Ul(i,"")}catch(C){ht(t,t.return,C)}}if(r&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,l=n!==null?n.memoizedProps:s,u=t.type,c=t.updateQueue;if(t.updateQueue=null,c!==null)try{u==="input"&&s.type==="radio"&&s.name!=null&&$3(i,s),I0(u,l);var h=I0(u,s);for(l=0;l<c.length;l+=2){var p=c[l],y=c[l+1];p==="style"?J3(i,y):p==="dangerouslySetInnerHTML"?Y3(i,y):p==="children"?Ul(i,y):i1(i,p,y,h)}switch(u){case"input":b0(i,s);break;case"textarea":Q3(i,s);break;case"select":var S=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var x=s.value;x!=null?qo(i,!!s.multiple,x,!1):S!==!!s.multiple&&(s.defaultValue!=null?qo(i,!!s.multiple,s.defaultValue,!0):qo(i,!!s.multiple,s.multiple?[]:"",!1))}i[Ql]=s}catch(C){ht(t,t.return,C)}}break;case 6:if(or(e,t),Nr(t),r&4){if(t.stateNode===null)throw Error(J(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(C){ht(t,t.return,C)}}break;case 3:if(or(e,t),Nr(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Hl(e.containerInfo)}catch(C){ht(t,t.return,C)}break;case 4:or(e,t),Nr(t);break;case 13:or(e,t),Nr(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(D1=mt())),r&4&&gv(t);break;case 22:if(p=n!==null&&n.memoizedState!==null,t.mode&1?(Xt=(h=Xt)||p,or(e,t),Xt=h):or(e,t),Nr(t),r&8192){if(h=t.memoizedState!==null,(t.stateNode.isHidden=h)&&!p&&t.mode&1)for(le=t,p=t.child;p!==null;){for(y=le=p;le!==null;){switch(S=le,x=S.child,S.tag){case 0:case 11:case 14:case 15:Fl(4,S,S.return);break;case 1:$o(S,S.return);var m=S.stateNode;if(typeof m.componentWillUnmount=="function"){r=S,n=S.return;try{e=r,m.props=e.memoizedProps,m.state=e.memoizedState,m.componentWillUnmount()}catch(C){ht(r,n,C)}}break;case 5:$o(S,S.return);break;case 22:if(S.memoizedState!==null){yv(y);continue}}x!==null?(x.return=S,le=x):yv(y)}p=p.sibling}e:for(p=null,y=t;;){if(y.tag===5){if(p===null){p=y;try{i=y.stateNode,h?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(u=y.stateNode,c=y.memoizedProps.style,l=c!=null&&c.hasOwnProperty("display")?c.display:null,u.style.display=X3("display",l))}catch(C){ht(t,t.return,C)}}}else if(y.tag===6){if(p===null)try{y.stateNode.nodeValue=h?"":y.memoizedProps}catch(C){ht(t,t.return,C)}}else if((y.tag!==22&&y.tag!==23||y.memoizedState===null||y===t)&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===t)break e;for(;y.sibling===null;){if(y.return===null||y.return===t)break e;p===y&&(p=null),y=y.return}p===y&&(p=null),y.sibling.return=y.return,y=y.sibling}}break;case 19:or(e,t),Nr(t),r&4&&gv(t);break;case 21:break;default:or(e,t),Nr(t)}}function Nr(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(C6(n)){var r=n;break e}n=n.return}throw Error(J(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ul(i,""),r.flags&=-33);var s=pv(t);hg(t,s,i);break;case 3:case 4:var l=r.stateNode.containerInfo,u=pv(t);dg(t,u,l);break;default:throw Error(J(161))}}catch(c){ht(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Tw(t,e,n){le=t,P6(t)}function P6(t,e,n){for(var r=(t.mode&1)!==0;le!==null;){var i=le,s=i.child;if(i.tag===22&&r){var l=i.memoizedState!==null||jc;if(!l){var u=i.alternate,c=u!==null&&u.memoizedState!==null||Xt;u=jc;var h=Xt;if(jc=l,(Xt=c)&&!h)for(le=i;le!==null;)l=le,c=l.child,l.tag===22&&l.memoizedState!==null?vv(i):c!==null?(c.return=l,le=c):vv(i);for(;s!==null;)le=s,P6(s),s=s.sibling;le=i,jc=u,Xt=h}mv(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,le=s):mv(t)}}function mv(t){for(;le!==null;){var e=le;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Xt||oh(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Xt)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:lr(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&ev(e,s,r);break;case 3:var l=e.updateQueue;if(l!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}ev(e,l,n)}break;case 5:var u=e.stateNode;if(n===null&&e.flags&4){n=u;var c=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var h=e.alternate;if(h!==null){var p=h.memoizedState;if(p!==null){var y=p.dehydrated;y!==null&&Hl(y)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(J(163))}Xt||e.flags&512&&cg(e)}catch(S){ht(e,e.return,S)}}if(e===t){le=null;break}if(n=e.sibling,n!==null){n.return=e.return,le=n;break}le=e.return}}function yv(t){for(;le!==null;){var e=le;if(e===t){le=null;break}var n=e.sibling;if(n!==null){n.return=e.return,le=n;break}le=e.return}}function vv(t){for(;le!==null;){var e=le;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{oh(4,e)}catch(c){ht(e,n,c)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(c){ht(e,i,c)}}var s=e.return;try{cg(e)}catch(c){ht(e,s,c)}break;case 5:var l=e.return;try{cg(e)}catch(c){ht(e,l,c)}}}catch(c){ht(e,e.return,c)}if(e===t){le=null;break}var u=e.sibling;if(u!==null){u.return=e.return,le=u;break}le=e.return}}var Ow=Math.ceil,Fd=ci.ReactCurrentDispatcher,M1=ci.ReactCurrentOwner,Yn=ci.ReactCurrentBatchConfig,be=0,Dt=null,St=null,Bt=0,Nn=0,Qo=os(0),Nt=0,eu=null,Xs=0,ah=0,I1=0,Al=null,vn=null,D1=0,xa=1/0,qr=null,Ad=!1,fg=null,Ji=null,Uc=!1,Wi=null,Md=0,Ml=0,pg=null,id=-1,sd=0;function on(){return be&6?mt():id!==-1?id:id=mt()}function Zi(t){return t.mode&1?be&2&&Bt!==0?Bt&-Bt:fw.transition!==null?(sd===0&&(sd=c5()),sd):(t=je,t!==0||(t=window.event,t=t===void 0?16:y5(t.type)),t):1}function fr(t,e,n,r){if(50<Ml)throw Ml=0,pg=null,Error(J(185));gu(t,n,r),(!(be&2)||t!==Dt)&&(t===Dt&&(!(be&2)&&(ah|=n),Nt===4&&Ai(t,Bt)),_n(t,r),n===1&&be===0&&!(e.mode&1)&&(xa=mt()+500,rh&&as()))}function _n(t,e){var n=t.callbackNode;f7(t,e);var r=vd(t,t===Dt?Bt:0);if(r===0)n!==null&&Ny(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&Ny(n),e===1)t.tag===0?hw(Sv.bind(null,t)):I5(Sv.bind(null,t)),lw(function(){!(be&6)&&as()}),n=null;else{switch(d5(r)){case 1:n=u1;break;case 4:n=l5;break;case 16:n=yd;break;case 536870912:n=u5;break;default:n=yd}n=A6(n,N6.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function N6(t,e){if(id=-1,sd=0,be&6)throw Error(J(327));var n=t.callbackNode;if(ea()&&t.callbackNode!==n)return null;var r=vd(t,t===Dt?Bt:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=Id(t,r);else{e=r;var i=be;be|=2;var s=T6();(Dt!==t||Bt!==e)&&(qr=null,xa=mt()+500,Vs(t,e));do try{Fw();break}catch(u){R6(t,u)}while(!0);_1(),Fd.current=s,be=i,St!==null?e=0:(Dt=null,Bt=0,e=Nt)}if(e!==0){if(e===2&&(i=B0(t),i!==0&&(r=i,e=gg(t,i))),e===1)throw n=eu,Vs(t,0),Ai(t,r),_n(t,mt()),n;if(e===6)Ai(t,r);else{if(i=t.current.alternate,!(r&30)&&!bw(i)&&(e=Id(t,r),e===2&&(s=B0(t),s!==0&&(r=s,e=gg(t,s))),e===1))throw n=eu,Vs(t,0),Ai(t,r),_n(t,mt()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(J(345));case 2:Rs(t,vn,qr);break;case 3:if(Ai(t,r),(r&130023424)===r&&(e=D1+500-mt(),10<e)){if(vd(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){on(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=q0(Rs.bind(null,t,vn,qr),e);break}Rs(t,vn,qr);break;case 4:if(Ai(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var l=31-hr(r);s=1<<l,l=e[l],l>i&&(i=l),r&=~s}if(r=i,r=mt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ow(r/1960))-r,10<r){t.timeoutHandle=q0(Rs.bind(null,t,vn,qr),r);break}Rs(t,vn,qr);break;case 5:Rs(t,vn,qr);break;default:throw Error(J(329))}}}return _n(t,mt()),t.callbackNode===n?N6.bind(null,t):null}function gg(t,e){var n=Al;return t.current.memoizedState.isDehydrated&&(Vs(t,e).flags|=256),t=Id(t,e),t!==2&&(e=vn,vn=n,e!==null&&mg(e)),t}function mg(t){vn===null?vn=t:vn.push.apply(vn,t)}function bw(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!gr(s(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Ai(t,e){for(e&=~I1,e&=~ah,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-hr(e),r=1<<n;t[n]=-1,e&=~r}}function Sv(t){if(be&6)throw Error(J(327));ea();var e=vd(t,0);if(!(e&1))return _n(t,mt()),null;var n=Id(t,e);if(t.tag!==0&&n===2){var r=B0(t);r!==0&&(e=r,n=gg(t,r))}if(n===1)throw n=eu,Vs(t,0),Ai(t,e),_n(t,mt()),n;if(n===6)throw Error(J(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Rs(t,vn,qr),_n(t,mt()),null}function j1(t,e){var n=be;be|=1;try{return t(e)}finally{be=n,be===0&&(xa=mt()+500,rh&&as())}}function Js(t){Wi!==null&&Wi.tag===0&&!(be&6)&&ea();var e=be;be|=1;var n=Yn.transition,r=je;try{if(Yn.transition=null,je=1,t)return t()}finally{je=r,Yn.transition=n,be=e,!(be&6)&&as()}}function U1(){Nn=Qo.current,Je(Qo)}function Vs(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,aw(n)),St!==null)for(n=St.return;n!==null;){var r=n;switch(S1(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Cd();break;case 3:va(),Je(xn),Je(Zt),R1();break;case 5:N1(r);break;case 4:va();break;case 13:Je(at);break;case 19:Je(at);break;case 10:C1(r.type._context);break;case 22:case 23:U1()}n=n.return}if(Dt=t,St=t=es(t.current,null),Bt=Nn=e,Nt=0,eu=null,I1=ah=Xs=0,vn=Al=null,bs!==null){for(e=0;e<bs.length;e++)if(n=bs[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var l=s.next;s.next=i,r.next=l}n.pending=r}bs=null}return t}function R6(t,e){do{var n=St;try{if(_1(),td.current=Ld,bd){for(var r=lt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}bd=!1}if(Ys=0,It=Et=lt=null,Ll=!1,Xl=0,M1.current=null,n===null||n.return===null){Nt=1,eu=e,St=null;break}e:{var s=t,l=n.return,u=n,c=e;if(e=Bt,u.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var h=c,p=u,y=p.tag;if(!(p.mode&1)&&(y===0||y===11||y===15)){var S=p.alternate;S?(p.updateQueue=S.updateQueue,p.memoizedState=S.memoizedState,p.lanes=S.lanes):(p.updateQueue=null,p.memoizedState=null)}var x=ov(l);if(x!==null){x.flags&=-257,av(x,l,u,s,e),x.mode&1&&sv(s,h,e),e=x,c=h;var m=e.updateQueue;if(m===null){var C=new Set;C.add(c),e.updateQueue=C}else m.add(c);break e}else{if(!(e&1)){sv(s,h,e),z1();break e}c=Error(J(426))}}else if(tt&&u.mode&1){var P=ov(l);if(P!==null){!(P.flags&65536)&&(P.flags|=256),av(P,l,u,s,e),x1(Sa(c,u));break e}}s=c=Sa(c,u),Nt!==4&&(Nt=2),Al===null?Al=[s]:Al.push(s),s=l;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var E=d6(s,c,e);Zy(s,E);break e;case 1:u=c;var k=s.type,v=s.stateNode;if(!(s.flags&128)&&(typeof k.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Ji===null||!Ji.has(v)))){s.flags|=65536,e&=-e,s.lanes|=e;var _=h6(s,u,e);Zy(s,_);break e}}s=s.return}while(s!==null)}b6(n)}catch(R){e=R,St===n&&n!==null&&(St=n=n.return);continue}break}while(!0)}function T6(){var t=Fd.current;return Fd.current=Ld,t===null?Ld:t}function z1(){(Nt===0||Nt===3||Nt===2)&&(Nt=4),Dt===null||!(Xs&268435455)&&!(ah&268435455)||Ai(Dt,Bt)}function Id(t,e){var n=be;be|=2;var r=T6();(Dt!==t||Bt!==e)&&(qr=null,Vs(t,e));do try{Lw();break}catch(i){R6(t,i)}while(!0);if(_1(),be=n,Fd.current=r,St!==null)throw Error(J(261));return Dt=null,Bt=0,Nt}function Lw(){for(;St!==null;)O6(St)}function Fw(){for(;St!==null&&!i7();)O6(St)}function O6(t){var e=F6(t.alternate,t,Nn);t.memoizedProps=t.pendingProps,e===null?b6(t):St=e,M1.current=null}function b6(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=Pw(n,e),n!==null){n.flags&=32767,St=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Nt=6,St=null;return}}else if(n=Ew(n,e,Nn),n!==null){St=n;return}if(e=e.sibling,e!==null){St=e;return}St=e=t}while(e!==null);Nt===0&&(Nt=5)}function Rs(t,e,n){var r=je,i=Yn.transition;try{Yn.transition=null,je=1,Aw(t,e,n,r)}finally{Yn.transition=i,je=r}return null}function Aw(t,e,n,r){do ea();while(Wi!==null);if(be&6)throw Error(J(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(J(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(p7(t,s),t===Dt&&(St=Dt=null,Bt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Uc||(Uc=!0,A6(yd,function(){return ea(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Yn.transition,Yn.transition=null;var l=je;je=1;var u=be;be|=4,M1.current=null,Rw(t,n),E6(n,t),ew($0),Sd=!!K0,$0=K0=null,t.current=n,Tw(n),s7(),be=u,je=l,Yn.transition=s}else t.current=n;if(Uc&&(Uc=!1,Wi=t,Md=i),s=t.pendingLanes,s===0&&(Ji=null),l7(n.stateNode),_n(t,mt()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Ad)throw Ad=!1,t=fg,fg=null,t;return Md&1&&t.tag!==0&&ea(),s=t.pendingLanes,s&1?t===pg?Ml++:(Ml=0,pg=t):Ml=0,as(),null}function ea(){if(Wi!==null){var t=d5(Md),e=Yn.transition,n=je;try{if(Yn.transition=null,je=16>t?16:t,Wi===null)var r=!1;else{if(t=Wi,Wi=null,Md=0,be&6)throw Error(J(331));var i=be;for(be|=4,le=t.current;le!==null;){var s=le,l=s.child;if(le.flags&16){var u=s.deletions;if(u!==null){for(var c=0;c<u.length;c++){var h=u[c];for(le=h;le!==null;){var p=le;switch(p.tag){case 0:case 11:case 15:Fl(8,p,s)}var y=p.child;if(y!==null)y.return=p,le=y;else for(;le!==null;){p=le;var S=p.sibling,x=p.return;if(_6(p),p===h){le=null;break}if(S!==null){S.return=x,le=S;break}le=x}}}var m=s.alternate;if(m!==null){var C=m.child;if(C!==null){m.child=null;do{var P=C.sibling;C.sibling=null,C=P}while(C!==null)}}le=s}}if(s.subtreeFlags&2064&&l!==null)l.return=s,le=l;else e:for(;le!==null;){if(s=le,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Fl(9,s,s.return)}var E=s.sibling;if(E!==null){E.return=s.return,le=E;break e}le=s.return}}var k=t.current;for(le=k;le!==null;){l=le;var v=l.child;if(l.subtreeFlags&2064&&v!==null)v.return=l,le=v;else e:for(l=k;le!==null;){if(u=le,u.flags&2048)try{switch(u.tag){case 0:case 11:case 15:oh(9,u)}}catch(R){ht(u,u.return,R)}if(u===l){le=null;break e}var _=u.sibling;if(_!==null){_.return=u.return,le=_;break e}le=u.return}}if(be=i,as(),Mr&&typeof Mr.onPostCommitFiberRoot=="function")try{Mr.onPostCommitFiberRoot(Jd,t)}catch{}r=!0}return r}finally{je=n,Yn.transition=e}}return!1}function xv(t,e,n){e=Sa(n,e),e=d6(t,e,1),t=Xi(t,e,1),e=on(),t!==null&&(gu(t,1,e),_n(t,e))}function ht(t,e,n){if(t.tag===3)xv(t,t,n);else for(;e!==null;){if(e.tag===3){xv(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ji===null||!Ji.has(r))){t=Sa(n,t),t=h6(e,t,1),e=Xi(e,t,1),t=on(),e!==null&&(gu(e,1,t),_n(e,t));break}}e=e.return}}function Mw(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=on(),t.pingedLanes|=t.suspendedLanes&n,Dt===t&&(Bt&n)===n&&(Nt===4||Nt===3&&(Bt&130023424)===Bt&&500>mt()-D1?Vs(t,0):I1|=n),_n(t,e)}function L6(t,e){e===0&&(t.mode&1?(e=Tc,Tc<<=1,!(Tc&130023424)&&(Tc=4194304)):e=1);var n=on();t=li(t,e),t!==null&&(gu(t,e,n),_n(t,n))}function Iw(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),L6(t,n)}function Dw(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(J(314))}r!==null&&r.delete(e),L6(t,n)}var F6;F6=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||xn.current)Sn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Sn=!1,kw(t,e,n);Sn=!!(t.flags&131072)}else Sn=!1,tt&&e.flags&1048576&&D5(e,Pd,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;rd(t,e),t=e.pendingProps;var i=ga(e,Zt.current);Zo(e,n),i=O1(null,e,r,t,i,n);var s=b1();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,wn(r)?(s=!0,kd(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,E1(e),i.updater=sh,e.stateNode=i,i._reactInternals=e,ng(e,r,t,n),e=sg(null,e,r,!0,s,n)):(e.tag=0,tt&&s&&v1(e),rn(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(rd(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=Uw(r),t=lr(r,t),i){case 0:e=ig(null,e,r,t,n);break e;case 1:e=cv(null,e,r,t,n);break e;case 11:e=lv(null,e,r,t,n);break e;case 14:e=uv(null,e,r,lr(r.type,t),n);break e}throw Error(J(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:lr(r,i),ig(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:lr(r,i),cv(t,e,r,i,n);case 3:e:{if(m6(e),t===null)throw Error(J(387));r=e.pendingProps,s=e.memoizedState,i=s.element,H5(t,e),Td(e,r,null,n);var l=e.memoizedState;if(r=l.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Sa(Error(J(423)),e),e=dv(t,e,r,n,i);break e}else if(r!==i){i=Sa(Error(J(424)),e),e=dv(t,e,r,n,i);break e}else for(On=Yi(e.stateNode.containerInfo.firstChild),bn=e,tt=!0,dr=null,n=B5(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ma(),r===i){e=ui(t,e,n);break e}rn(t,e,r,n)}e=e.child}return e;case 5:return V5(e),t===null&&Z0(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,l=i.children,Q0(r,i)?l=null:s!==null&&Q0(r,s)&&(e.flags|=32),g6(t,e),rn(t,e,l,n),e.child;case 6:return t===null&&Z0(e),null;case 13:return y6(t,e,n);case 4:return P1(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=ya(e,null,r,n):rn(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:lr(r,i),lv(t,e,r,i,n);case 7:return rn(t,e,e.pendingProps,n),e.child;case 8:return rn(t,e,e.pendingProps.children,n),e.child;case 12:return rn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,l=i.value,We(Nd,r._currentValue),r._currentValue=l,s!==null)if(gr(s.value,l)){if(s.children===i.children&&!xn.current){e=ui(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var u=s.dependencies;if(u!==null){l=s.child;for(var c=u.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=ri(-1,n&-n),c.tag=2;var h=s.updateQueue;if(h!==null){h=h.shared;var p=h.pending;p===null?c.next=c:(c.next=p.next,p.next=c),h.pending=c}}s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),eg(s.return,n,e),u.lanes|=n;break}c=c.next}}else if(s.tag===10)l=s.type===e.type?null:s.child;else if(s.tag===18){if(l=s.return,l===null)throw Error(J(341));l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),eg(l,n,e),l=s.sibling}else l=s.child;if(l!==null)l.return=s;else for(l=s;l!==null;){if(l===e){l=null;break}if(s=l.sibling,s!==null){s.return=l.return,l=s;break}l=l.return}s=l}rn(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Zo(e,n),i=Xn(i),r=r(i),e.flags|=1,rn(t,e,r,n),e.child;case 14:return r=e.type,i=lr(r,e.pendingProps),i=lr(r.type,i),uv(t,e,r,i,n);case 15:return f6(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:lr(r,i),rd(t,e),e.tag=1,wn(r)?(t=!0,kd(e)):t=!1,Zo(e,n),c6(e,r,i),ng(e,r,i,n),sg(null,e,r,!0,t,n);case 19:return v6(t,e,n);case 22:return p6(t,e,n)}throw Error(J(156,e.tag))};function A6(t,e){return a5(t,e)}function jw(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,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 qn(t,e,n,r){return new jw(t,e,n,r)}function B1(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Uw(t){if(typeof t=="function")return B1(t)?1:0;if(t!=null){if(t=t.$$typeof,t===o1)return 11;if(t===a1)return 14}return 2}function es(t,e){var n=t.alternate;return n===null?(n=qn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function od(t,e,n,r,i,s){var l=2;if(r=t,typeof t=="function")B1(t)&&(l=1);else if(typeof t=="string")l=5;else e:switch(t){case jo:return Ws(n.children,i,s,e);case s1:l=8,i|=8;break;case P0:return t=qn(12,n,e,i|2),t.elementType=P0,t.lanes=s,t;case N0:return t=qn(13,n,e,i),t.elementType=N0,t.lanes=s,t;case R0:return t=qn(19,n,e,i),t.elementType=R0,t.lanes=s,t;case V3:return lh(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case G3:l=10;break e;case H3:l=9;break e;case o1:l=11;break e;case a1:l=14;break e;case bi:l=16,r=null;break e}throw Error(J(130,t==null?t:typeof t,""))}return e=qn(l,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function Ws(t,e,n,r){return t=qn(7,t,r,e),t.lanes=n,t}function lh(t,e,n,r){return t=qn(22,t,r,e),t.elementType=V3,t.lanes=n,t.stateNode={isHidden:!1},t}function t0(t,e,n){return t=qn(6,t,null,e),t.lanes=n,t}function n0(t,e,n){return e=qn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function zw(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ip(0),this.expirationTimes=Ip(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ip(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function G1(t,e,n,r,i,s,l,u,c){return t=new zw(t,e,n,u,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=qn(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},E1(s),t}function Bw(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Do,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function M6(t){if(!t)return rs;t=t._reactInternals;e:{if(io(t)!==t||t.tag!==1)throw Error(J(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(wn(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(J(171))}if(t.tag===1){var n=t.type;if(wn(n))return M5(t,n,e)}return e}function I6(t,e,n,r,i,s,l,u,c){return t=G1(n,r,!0,t,i,s,l,u,c),t.context=M6(null),n=t.current,r=on(),i=Zi(n),s=ri(r,i),s.callback=e??null,Xi(n,s,i),t.current.lanes=i,gu(t,i,r),_n(t,r),t}function uh(t,e,n,r){var i=e.current,s=on(),l=Zi(i);return n=M6(n),e.context===null?e.context=n:e.pendingContext=n,e=ri(s,l),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Xi(i,e,l),t!==null&&(fr(t,i,l,s),ed(t,i,l)),l}function Dd(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function wv(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function H1(t,e){wv(t,e),(t=t.alternate)&&wv(t,e)}function Gw(){return null}var D6=typeof reportError=="function"?reportError:function(t){console.error(t)};function V1(t){this._internalRoot=t}ch.prototype.render=V1.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(J(409));uh(t,e,null,null)};ch.prototype.unmount=V1.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Js(function(){uh(null,t,null,null)}),e[ai]=null}};function ch(t){this._internalRoot=t}ch.prototype.unstable_scheduleHydration=function(t){if(t){var e=p5();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Fi.length&&e!==0&&e<Fi[n].priority;n++);Fi.splice(n,0,t),n===0&&m5(t)}};function W1(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function dh(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function _v(){}function Hw(t,e,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var h=Dd(l);s.call(h)}}var l=I6(e,r,t,0,null,!1,!1,"",_v);return t._reactRootContainer=l,t[ai]=l.current,Kl(t.nodeType===8?t.parentNode:t),Js(),l}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var u=r;r=function(){var h=Dd(c);u.call(h)}}var c=G1(t,0,!1,null,null,!1,!1,"",_v);return t._reactRootContainer=c,t[ai]=c.current,Kl(t.nodeType===8?t.parentNode:t),Js(function(){uh(e,c,n,r)}),c}function hh(t,e,n,r,i){var s=n._reactRootContainer;if(s){var l=s;if(typeof i=="function"){var u=i;i=function(){var c=Dd(l);u.call(c)}}uh(e,l,t,i)}else l=Hw(n,e,t,i,r);return Dd(l)}h5=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=wl(e.pendingLanes);n!==0&&(c1(e,n|1),_n(e,mt()),!(be&6)&&(xa=mt()+500,as()))}break;case 13:Js(function(){var r=li(t,1);if(r!==null){var i=on();fr(r,t,1,i)}}),H1(t,1)}};d1=function(t){if(t.tag===13){var e=li(t,134217728);if(e!==null){var n=on();fr(e,t,134217728,n)}H1(t,134217728)}};f5=function(t){if(t.tag===13){var e=Zi(t),n=li(t,e);if(n!==null){var r=on();fr(n,t,e,r)}H1(t,e)}};p5=function(){return je};g5=function(t,e){var n=je;try{return je=t,e()}finally{je=n}};j0=function(t,e,n){switch(e){case"input":if(b0(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=nh(r);if(!i)throw Error(J(90));K3(r),b0(r,i)}}}break;case"textarea":Q3(t,n);break;case"select":e=n.value,e!=null&&qo(t,!!n.multiple,e,!1)}};t5=j1;n5=Js;var Vw={usingClientEntryPoint:!1,Events:[yu,Go,nh,Z3,e5,j1]},fl={findFiberByHostInstance:Os,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ww={bundleType:fl.bundleType,version:fl.version,rendererPackageName:fl.rendererPackageName,rendererConfig:fl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ci.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=s5(t),t===null?null:t.stateNode},findFiberByHostInstance:fl.findFiberByHostInstance||Gw,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zc.isDisabled&&zc.supportsFiber)try{Jd=zc.inject(Ww),Mr=zc}catch{}}Fn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Vw;Fn.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!W1(e))throw Error(J(200));return Bw(t,e,null,n)};Fn.createRoot=function(t,e){if(!W1(t))throw Error(J(299));var n=!1,r="",i=D6;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=G1(t,1,!1,null,null,n,!1,r,i),t[ai]=e.current,Kl(t.nodeType===8?t.parentNode:t),new V1(e)};Fn.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(J(188)):(t=Object.keys(t).join(","),Error(J(268,t)));return t=s5(e),t=t===null?null:t.stateNode,t};Fn.flushSync=function(t){return Js(t)};Fn.hydrate=function(t,e,n){if(!dh(e))throw Error(J(200));return hh(null,t,e,!0,n)};Fn.hydrateRoot=function(t,e,n){if(!W1(t))throw Error(J(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",l=D6;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),e=I6(e,null,t,1,n??null,i,!1,s,l),t[ai]=e.current,Kl(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new ch(e)};Fn.render=function(t,e,n){if(!dh(e))throw Error(J(200));return hh(null,t,e,!1,n)};Fn.unmountComponentAtNode=function(t){if(!dh(t))throw Error(J(40));return t._reactRootContainer?(Js(function(){hh(null,null,t,!1,function(){t._reactRootContainer=null,t[ai]=null})}),!0):!1};Fn.unstable_batchedUpdates=j1;Fn.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!dh(n))throw Error(J(200));if(t==null||t._reactInternals===void 0)throw Error(J(38));return hh(t,e,n,!1,r)};Fn.version="18.3.1-next-f1338f8080-20240426";function j6(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j6)}catch(t){console.error(t)}}j6(),j3.exports=Fn;var Kw=j3.exports,Cv=Kw;k0.createRoot=Cv.createRoot,k0.hydrateRoot=Cv.hydrateRoot;/**
* @remix-run/router v1.23.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function tu(){return tu=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},tu.apply(this,arguments)}var Ki;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Ki||(Ki={}));const kv="popstate";function $w(t){t===void 0&&(t={});function e(r,i){let{pathname:s,search:l,hash:u}=r.location;return yg("",{pathname:s,search:l,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:U6(i)}return qw(e,n,null,t)}function xt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function K1(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Qw(){return Math.random().toString(36).substr(2,8)}function Ev(t,e){return{usr:t.state,key:t.key,idx:e}}function yg(t,e,n,r){return n===void 0&&(n=null),tu({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Ta(e):e,{state:n,key:e&&e.key||r||Qw()})}function U6(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Ta(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function qw(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,l=i.history,u=Ki.Pop,c=null,h=p();h==null&&(h=0,l.replaceState(tu({},l.state,{idx:h}),""));function p(){return(l.state||{idx:null}).idx}function y(){u=Ki.Pop;let P=p(),E=P==null?null:P-h;h=P,c&&c({action:u,location:C.location,delta:E})}function S(P,E){u=Ki.Push;let k=yg(C.location,P,E);h=p()+1;let v=Ev(k,h),_=C.createHref(k);try{l.pushState(v,"",_)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;i.location.assign(_)}s&&c&&c({action:u,location:C.location,delta:1})}function x(P,E){u=Ki.Replace;let k=yg(C.location,P,E);h=p();let v=Ev(k,h),_=C.createHref(k);l.replaceState(v,"",_),s&&c&&c({action:u,location:C.location,delta:0})}function m(P){let E=i.location.origin!=="null"?i.location.origin:i.location.href,k=typeof P=="string"?P:U6(P);return k=k.replace(/ $/,"%20"),xt(E,"No window.location.(origin|href) available to create URL for href: "+k),new URL(k,E)}let C={get action(){return u},get location(){return t(i,l)},listen(P){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(kv,y),c=P,()=>{i.removeEventListener(kv,y),c=null}},createHref(P){return e(i,P)},createURL:m,encodeLocation(P){let E=m(P);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:S,replace:x,go(P){return l.go(P)}};return C}var Pv;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Pv||(Pv={}));function Yw(t,e,n){return n===void 0&&(n="/"),Xw(t,e,n)}function Xw(t,e,n,r){let i=typeof e=="string"?Ta(e):e,s=G6(i.pathname||"/",n);if(s==null)return null;let l=z6(t);Jw(l);let u=null;for(let c=0;u==null&&c<l.length;++c){let h=c_(s);u=a_(l[c],h)}return u}function z6(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,l,u)=>{let c={relativePath:u===void 0?s.path||"":u,caseSensitive:s.caseSensitive===!0,childrenIndex:l,route:s};c.relativePath.startsWith("/")&&(xt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let h=Ks([r,c.relativePath]),p=n.concat(c);s.children&&s.children.length>0&&(xt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+h+'".')),z6(s.children,e,p,h)),!(s.path==null&&!s.index)&&e.push({path:h,score:s_(h,s.index),routesMeta:p})};return t.forEach((s,l)=>{var u;if(s.path===""||!((u=s.path)!=null&&u.includes("?")))i(s,l);else for(let c of B6(s.path))i(s,l,c)}),e}function B6(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let l=B6(r.join("/")),u=[];return u.push(...l.map(c=>c===""?s:[s,c].join("/"))),i&&u.push(...l),u.map(c=>t.startsWith("/")&&c===""?"/":c)}function Jw(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:o_(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Zw=/^:[\w-]+$/,e_=3,t_=2,n_=1,r_=10,i_=-2,Nv=t=>t==="*";function s_(t,e){let n=t.split("/"),r=n.length;return n.some(Nv)&&(r+=i_),e&&(r+=t_),n.filter(i=>!Nv(i)).reduce((i,s)=>i+(Zw.test(s)?e_:s===""?n_:r_),r)}function o_(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function a_(t,e,n){let{routesMeta:r}=t,i={},s="/",l=[];for(let u=0;u<r.length;++u){let c=r[u],h=u===r.length-1,p=s==="/"?e:e.slice(s.length)||"/",y=l_({path:c.relativePath,caseSensitive:c.caseSensitive,end:h},p),S=c.route;if(!y)return null;Object.assign(i,y.params),l.push({params:i,pathname:Ks([s,y.pathname]),pathnameBase:g_(Ks([s,y.pathnameBase])),route:S}),y.pathnameBase!=="/"&&(s=Ks([s,y.pathnameBase]))}return l}function l_(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=u_(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],l=s.replace(/(.)\/+$/,"$1"),u=i.slice(1);return{params:r.reduce((h,p,y)=>{let{paramName:S,isOptional:x}=p;if(S==="*"){let C=u[y]||"";l=s.slice(0,s.length-C.length).replace(/(.)\/+$/,"$1")}const m=u[y];return x&&!m?h[S]=void 0:h[S]=(m||"").replace(/%2F/g,"/"),h},{}),pathname:s,pathnameBase:l,pattern:t}}function u_(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),K1(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,c)=>(r.push({paramName:u,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function c_(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return K1(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function G6(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}const d_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,h_=t=>d_.test(t);function f_(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Ta(t):t,s;if(n)if(h_(n))s=n;else{if(n.includes("//")){let l=n;n=n.replace(/\/\/+/g,"/"),K1(!1,"Pathnames cannot have embedded double slashes - normalizing "+(l+" -> "+n))}n.startsWith("/")?s=Rv(n.substring(1),"/"):s=Rv(n,e)}else s=e;return{pathname:s,search:m_(r),hash:y_(i)}}function Rv(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function r0(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function p_(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function H6(t,e){let n=p_(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function V6(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=Ta(t):(i=tu({},t),xt(!i.pathname||!i.pathname.includes("?"),r0("?","pathname","search",i)),xt(!i.pathname||!i.pathname.includes("#"),r0("#","pathname","hash",i)),xt(!i.search||!i.search.includes("#"),r0("#","search","hash",i)));let s=t===""||i.pathname==="",l=s?"/":i.pathname,u;if(l==null)u=n;else{let y=e.length-1;if(!r&&l.startsWith("..")){let S=l.split("/");for(;S[0]==="..";)S.shift(),y-=1;i.pathname=S.join("/")}u=y>=0?e[y]:"/"}let c=f_(i,u),h=l&&l!=="/"&&l.endsWith("/"),p=(s||l===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(h||p)&&(c.pathname+="/"),c}const Ks=t=>t.join("/").replace(/\/\/+/g,"/"),g_=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),m_=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,y_=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function v_(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const W6=["post","put","patch","delete"];new Set(W6);const S_=["get",...W6];new Set(S_);/**
* React Router v6.30.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function nu(){return nu=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},nu.apply(this,arguments)}const $1=V.createContext(null),x_=V.createContext(null),Su=V.createContext(null),fh=V.createContext(null),so=V.createContext({outlet:null,matches:[],isDataRoute:!1}),K6=V.createContext(null);function xu(){return V.useContext(fh)!=null}function Q1(){return xu()||xt(!1),V.useContext(fh).location}function $6(t){V.useContext(Su).static||V.useLayoutEffect(t)}function w_(){let{isDataRoute:t}=V.useContext(so);return t?A_():__()}function __(){xu()||xt(!1);let t=V.useContext($1),{basename:e,future:n,navigator:r}=V.useContext(Su),{matches:i}=V.useContext(so),{pathname:s}=Q1(),l=JSON.stringify(H6(i,n.v7_relativeSplatPath)),u=V.useRef(!1);return $6(()=>{u.current=!0}),V.useCallback(function(h,p){if(p===void 0&&(p={}),!u.current)return;if(typeof h=="number"){r.go(h);return}let y=V6(h,JSON.parse(l),s,p.relative==="path");t==null&&e!=="/"&&(y.pathname=y.pathname==="/"?e:Ks([e,y.pathname])),(p.replace?r.replace:r.push)(y,p.state,p)},[e,r,l,s,t])}function C_(t,e){return k_(t,e)}function k_(t,e,n,r){xu()||xt(!1);let{navigator:i}=V.useContext(Su),{matches:s}=V.useContext(so),l=s[s.length-1],u=l?l.params:{};l&&l.pathname;let c=l?l.pathnameBase:"/";l&&l.route;let h=Q1(),p;if(e){var y;let P=typeof e=="string"?Ta(e):e;c==="/"||(y=P.pathname)!=null&&y.startsWith(c)||xt(!1),p=P}else p=h;let S=p.pathname||"/",x=S;if(c!=="/"){let P=c.replace(/^\//,"").split("/");x="/"+S.replace(/^\//,"").split("/").slice(P.length).join("/")}let m=Yw(t,{pathname:x}),C=T_(m&&m.map(P=>Object.assign({},P,{params:Object.assign({},u,P.params),pathname:Ks([c,i.encodeLocation?i.encodeLocation(P.pathname).pathname:P.pathname]),pathnameBase:P.pathnameBase==="/"?c:Ks([c,i.encodeLocation?i.encodeLocation(P.pathnameBase).pathname:P.pathnameBase])})),s,n,r);return e&&C?V.createElement(fh.Provider,{value:{location:nu({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:Ki.Pop}},C):C}function E_(){let t=F_(),e=v_(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return V.createElement(V.Fragment,null,V.createElement("h2",null,"Unexpected Application Error!"),V.createElement("h3",{style:{fontStyle:"italic"}},e),n?V.createElement("pre",{style:i},n):null,null)}const P_=V.createElement(E_,null);class N_ extends V.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?V.createElement(so.Provider,{value:this.props.routeContext},V.createElement(K6.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function R_(t){let{routeContext:e,match:n,children:r}=t,i=V.useContext($1);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),V.createElement(so.Provider,{value:e},r)}function T_(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var s;if(!n)return null;if(n.errors)t=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let l=t,u=(i=n)==null?void 0:i.errors;if(u!=null){let p=l.findIndex(y=>y.route.id&&(u==null?void 0:u[y.route.id])!==void 0);p>=0||xt(!1),l=l.slice(0,Math.min(l.length,p+1))}let c=!1,h=-1;if(n&&r&&r.v7_partialHydration)for(let p=0;p<l.length;p++){let y=l[p];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(h=p),y.route.id){let{loaderData:S,errors:x}=n,m=y.route.loader&&S[y.route.id]===void 0&&(!x||x[y.route.id]===void 0);if(y.route.lazy||m){c=!0,h>=0?l=l.slice(0,h+1):l=[l[0]];break}}}return l.reduceRight((p,y,S)=>{let x,m=!1,C=null,P=null;n&&(x=u&&y.route.id?u[y.route.id]:void 0,C=y.route.errorElement||P_,c&&(h<0&&S===0?(M_("route-fallback"),m=!0,P=null):h===S&&(m=!0,P=y.route.hydrateFallbackElement||null)));let E=e.concat(l.slice(0,S+1)),k=()=>{let v;return x?v=C:m?v=P:y.route.Component?v=V.createElement(y.route.Component,null):y.route.element?v=y.route.element:v=p,V.createElement(R_,{match:y,routeContext:{outlet:p,matches:E,isDataRoute:n!=null},children:v})};return n&&(y.route.ErrorBoundary||y.route.errorElement||S===0)?V.createElement(N_,{location:n.location,revalidation:n.revalidation,component:C,error:x,children:k(),routeContext:{outlet:null,matches:E,isDataRoute:!0}}):k()},null)}var Q6=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(Q6||{}),q6=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(q6||{});function O_(t){let e=V.useContext($1);return e||xt(!1),e}function b_(t){let e=V.useContext(x_);return e||xt(!1),e}function L_(t){let e=V.useContext(so);return e||xt(!1),e}function Y6(t){let e=L_(),n=e.matches[e.matches.length-1];return n.route.id||xt(!1),n.route.id}function F_(){var t;let e=V.useContext(K6),n=b_(),r=Y6();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function A_(){let{router:t}=O_(Q6.UseNavigateStable),e=Y6(q6.UseNavigateStable),n=V.useRef(!1);return $6(()=>{n.current=!0}),V.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,nu({fromRouteId:e},s)))},[t,e])}const Tv={};function M_(t,e,n){Tv[t]||(Tv[t]=!0)}function I_(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function D_(t){let{to:e,replace:n,state:r,relative:i}=t;xu()||xt(!1);let{future:s,static:l}=V.useContext(Su),{matches:u}=V.useContext(so),{pathname:c}=Q1(),h=w_(),p=V6(e,H6(u,s.v7_relativeSplatPath),c,i==="path"),y=JSON.stringify(p);return V.useEffect(()=>h(JSON.parse(y),{replace:n,state:r,relative:i}),[h,y,i,n,r]),null}function Cl(t){xt(!1)}function j_(t){let{basename:e="/",children:n=null,location:r,navigationType:i=Ki.Pop,navigator:s,static:l=!1,future:u}=t;xu()&&xt(!1);let c=e.replace(/^\/*/,"/"),h=V.useMemo(()=>({basename:c,navigator:s,static:l,future:nu({v7_relativeSplatPath:!1},u)}),[c,u,s,l]);typeof r=="string"&&(r=Ta(r));let{pathname:p="/",search:y="",hash:S="",state:x=null,key:m="default"}=r,C=V.useMemo(()=>{let P=G6(p,c);return P==null?null:{location:{pathname:P,search:y,hash:S,state:x,key:m},navigationType:i}},[c,p,y,S,x,m,i]);return C==null?null:V.createElement(Su.Provider,{value:h},V.createElement(fh.Provider,{children:n,value:C}))}function U_(t){let{children:e,location:n}=t;return C_(vg(e),n)}new Promise(()=>{});function vg(t,e){e===void 0&&(e=[]);let n=[];return V.Children.forEach(t,(r,i)=>{if(!V.isValidElement(r))return;let s=[...e,i];if(r.type===V.Fragment){n.push.apply(n,vg(r.props.children,s));return}r.type!==Cl&&xt(!1),!r.props.index||!r.props.children||xt(!1);let l={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=vg(r.props.children,s)),n.push(l)}),n}/**
* React Router DOM v6.30.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/const z_="6";try{window.__reactRouterVersion=z_}catch{}const B_="startTransition",Ov=I9[B_];function G_(t){let{basename:e,children:n,future:r,window:i}=t,s=V.useRef();s.current==null&&(s.current=$w({window:i,v5Compat:!0}));let l=s.current,[u,c]=V.useState({action:l.action,location:l.location}),{v7_startTransition:h}=r||{},p=V.useCallback(y=>{h&&Ov?Ov(()=>c(y)):c(y)},[c,h]);return V.useLayoutEffect(()=>l.listen(p),[l,p]),V.useEffect(()=>I_(r),[r]),V.createElement(j_,{basename:e,children:n,location:u.location,navigationType:u.action,navigator:l,future:r})}var bv;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(bv||(bv={}));var Lv;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Lv||(Lv={}));var Oa=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ms,Mi,na,m3,H_=(m3=class extends Oa{constructor(){super();de(this,Ms);de(this,Mi);de(this,na);ne(this,na,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){F(this,Mi)||this.setEventListener(F(this,na))}onUnsubscribe(){var e;this.hasListeners()||((e=F(this,Mi))==null||e.call(this),ne(this,Mi,void 0))}setEventListener(e){var n;ne(this,na,e),(n=F(this,Mi))==null||n.call(this),ne(this,Mi,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){F(this,Ms)!==e&&(ne(this,Ms,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof F(this,Ms)=="boolean"?F(this,Ms):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Ms=new WeakMap,Mi=new WeakMap,na=new WeakMap,m3),q1=new H_,V_={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Ii,Xg,y3,W_=(y3=class{constructor(){de(this,Ii,V_);de(this,Xg,!1)}setTimeoutProvider(t){ne(this,Ii,t)}setTimeout(t,e){return F(this,Ii).setTimeout(t,e)}clearTimeout(t){F(this,Ii).clearTimeout(t)}setInterval(t,e){return F(this,Ii).setInterval(t,e)}clearInterval(t){F(this,Ii).clearInterval(t)}},Ii=new WeakMap,Xg=new WeakMap,y3),Fs=new W_;function K_(t){setTimeout(t,0)}var $_=typeof window>"u"||"Deno"in globalThis;function sn(){}function Q_(t,e){return typeof t=="function"?t(e):t}function Sg(t){return typeof t=="number"&&t>=0&&t!==1/0}function X6(t,e){return Math.max(t+(e||0)-Date.now(),0)}function ts(t,e){return typeof t=="function"?t(e):t}function Kn(t,e){return typeof t=="function"?t(e):t}function Fv(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:l,stale:u}=t;if(l){if(r){if(e.queryHash!==Y1(l,e.options))return!1}else if(!ru(e.queryKey,l))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||i&&i!==e.state.fetchStatus||s&&!s(e))}function Av(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(Zs(e.options.mutationKey)!==Zs(s))return!1}else if(!ru(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function Y1(t,e){return((e==null?void 0:e.queryKeyHashFn)||Zs)(t)}function Zs(t){return JSON.stringify(t,(e,n)=>xg(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function ru(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>ru(t[n],e[n])):!1}var q_=Object.prototype.hasOwnProperty;function J6(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=Mv(t)&&Mv(e);if(!r&&!(xg(t)&&xg(e)))return e;const s=(r?t:Object.keys(t)).length,l=r?e:Object.keys(e),u=l.length,c=r?new Array(u):{};let h=0;for(let p=0;p<u;p++){const y=r?p:l[p],S=t[y],x=e[y];if(S===x){c[y]=S,(r?p<s:q_.call(t,y))&&h++;continue}if(S===null||x===null||typeof S!="object"||typeof x!="object"){c[y]=x;continue}const m=J6(S,x,n+1);c[y]=m,m===S&&h++}return s===u&&h===s?t:c}function jd(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Mv(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function xg(t){if(!Iv(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!Iv(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Iv(t){return Object.prototype.toString.call(t)==="[object Object]"}function Y_(t){return new Promise(e=>{Fs.setTimeout(e,t)})}function wg(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?J6(t,e):e}function X_(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function J_(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var X1=Symbol();function Z6(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===X1?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function J1(t,e){return typeof t=="function"?t(...e):!!t}function Z_(t,e,n){let r=!1,i;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??(i=e()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),t}var iu=(()=>{let t=()=>$_;return{isServer(){return t()},setIsServer(e){t=e}}})();function _g(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}var eC=K_;function tC(){let t=[],e=0,n=u=>{u()},r=u=>{u()},i=eC;const s=u=>{e?t.push(u):i(()=>{n(u)})},l=()=>{const u=t;t=[],u.length&&i(()=>{r(()=>{u.forEach(c=>{n(c)})})})};return{batch:u=>{let c;e++;try{c=u()}finally{e--,e||l()}return c},batchCalls:u=>(...c)=>{s(()=>{u(...c)})},schedule:s,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var Pt=tC(),ra,Di,ia,v3,nC=(v3=class extends Oa{constructor(){super();de(this,ra,!0);de(this,Di);de(this,ia);ne(this,ia,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){F(this,Di)||this.setEventListener(F(this,ia))}onUnsubscribe(){var e;this.hasListeners()||((e=F(this,Di))==null||e.call(this),ne(this,Di,void 0))}setEventListener(e){var n;ne(this,ia,e),(n=F(this,Di))==null||n.call(this),ne(this,Di,e(this.setOnline.bind(this)))}setOnline(e){F(this,ra)!==e&&(ne(this,ra,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return F(this,ra)}},ra=new WeakMap,Di=new WeakMap,ia=new WeakMap,v3),Ud=new nC;function rC(t){return Math.min(1e3*2**t,3e4)}function e8(t){return(t??"online")==="online"?Ud.isOnline():!0}var Cg=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function t8(t){let e=!1,n=0,r;const i=_g(),s=()=>i.status!=="pending",l=C=>{var P;if(!s()){const E=new Cg(C);S(E),(P=t.onCancel)==null||P.call(t,E)}},u=()=>{e=!0},c=()=>{e=!1},h=()=>q1.isFocused()&&(t.networkMode==="always"||Ud.isOnline())&&t.canRun(),p=()=>e8(t.networkMode)&&t.canRun(),y=C=>{s()||(r==null||r(),i.resolve(C))},S=C=>{s()||(r==null||r(),i.reject(C))},x=()=>new Promise(C=>{var P;r=E=>{(s()||h())&&C(E)},(P=t.onPause)==null||P.call(t)}).then(()=>{var C;r=void 0,s()||(C=t.onContinue)==null||C.call(t)}),m=()=>{if(s())return;let C;const P=n===0?t.initialPromise:void 0;try{C=P??t.fn()}catch(E){C=Promise.reject(E)}Promise.resolve(C).then(y).catch(E=>{var b;if(s())return;const k=t.retry??(iu.isServer()?0:3),v=t.retryDelay??rC,_=typeof v=="function"?v(n,E):v,R=k===!0||typeof k=="number"&&n<k||typeof k=="function"&&k(n,E);if(e||!R){S(E);return}n++,(b=t.onFail)==null||b.call(t,n,E),Y_(_).then(()=>h()?void 0:x()).then(()=>{e?S(E):m()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r==null||r(),i),cancelRetry:u,continueRetry:c,canStart:p,start:()=>(p()?m():x().then(m),i)}}var Is,S3,n8=(S3=class{constructor(){de(this,Is)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Sg(this.gcTime)&&ne(this,Is,Fs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(iu.isServer()?1/0:5*60*1e3))}clearGcTimeout(){F(this,Is)&&(Fs.clearTimeout(F(this,Is)),ne(this,Is,void 0))}},Is=new WeakMap,S3),Ds,sa,Wn,js,At,uu,Us,Rn,r8,$r,x3,iC=(x3=class extends n8{constructor(e){super();de(this,Rn);de(this,Ds);de(this,sa);de(this,Wn);de(this,js);de(this,At);de(this,uu);de(this,Us);ne(this,Us,!1),ne(this,uu,e.defaultOptions),this.setOptions(e.options),this.observers=[],ne(this,js,e.client),ne(this,Wn,F(this,js).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ne(this,Ds,jv(this.options)),this.state=e.state??F(this,Ds),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=F(this,At))==null?void 0:e.promise}setOptions(e){if(this.options={...F(this,uu),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=jv(this.options);n.data!==void 0&&(this.setState(Dv(n.data,n.dataUpdatedAt)),ne(this,Ds,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,Wn).remove(this)}setData(e,n){const r=wg(this.state.data,e,this.options);return _e(this,Rn,$r).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){_e(this,Rn,$r).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=F(this,At))==null?void 0:r.promise;return(i=F(this,At))==null||i.cancel(e),n?n.then(sn).catch(sn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return F(this,Ds)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Kn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===X1||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ts(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!X6(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=F(this,At))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=F(this,At))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),F(this,Wn).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(F(this,At)&&(F(this,Us)||_e(this,Rn,r8).call(this)?F(this,At).cancel({revert:!0}):F(this,At).cancelRetry()),this.scheduleGc()),F(this,Wn).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||_e(this,Rn,$r).call(this,{type:"invalidate"})}async fetch(e,n){var c,h,p,y,S,x,m,C,P,E,k,v;if(this.state.fetchStatus!=="idle"&&((c=F(this,At))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(F(this,At))return F(this,At).continueRetry(),F(this,At).promise}if(e&&this.setOptions(e),!this.options.queryFn){const _=this.observers.find(R=>R.options.queryFn);_&&this.setOptions(_.options)}const r=new AbortController,i=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(ne(this,Us,!0),r.signal)})},s=()=>{const _=Z6(this.options,n),b=(()=>{const A={client:F(this,js),queryKey:this.queryKey,meta:this.meta};return i(A),A})();return ne(this,Us,!1),this.options.persister?this.options.persister(_,b,this):_(b)},u=(()=>{const _={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:F(this,js),state:this.state,fetchFn:s};return i(_),_})();(h=this.options.behavior)==null||h.onFetch(u,this),ne(this,sa,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=u.fetchOptions)==null?void 0:p.meta))&&_e(this,Rn,$r).call(this,{type:"fetch",meta:(y=u.fetchOptions)==null?void 0:y.meta}),ne(this,At,t8({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:_=>{_ instanceof Cg&&_.revert&&this.setState({...F(this,sa),fetchStatus:"idle"}),r.abort()},onFail:(_,R)=>{_e(this,Rn,$r).call(this,{type:"failed",failureCount:_,error:R})},onPause:()=>{_e(this,Rn,$r).call(this,{type:"pause"})},onContinue:()=>{_e(this,Rn,$r).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const _=await F(this,At).start();if(_===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(_),(x=(S=F(this,Wn).config).onSuccess)==null||x.call(S,_,this),(C=(m=F(this,Wn).config).onSettled)==null||C.call(m,_,this.state.error,this),_}catch(_){if(_ instanceof Cg){if(_.silent)return F(this,At).promise;if(_.revert){if(this.state.data===void 0)throw _;return this.state.data}}throw _e(this,Rn,$r).call(this,{type:"error",error:_}),(E=(P=F(this,Wn).config).onError)==null||E.call(P,_,this),(v=(k=F(this,Wn).config).onSettled)==null||v.call(k,this.state.data,_,this),_}finally{this.scheduleGc()}}},Ds=new WeakMap,sa=new WeakMap,Wn=new WeakMap,js=new WeakMap,At=new WeakMap,uu=new WeakMap,Us=new WeakMap,Rn=new WeakSet,r8=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},$r=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...i8(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...Dv(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ne(this,sa,e.manual?i:void 0),i;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Pt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),F(this,Wn).notify({query:this,type:"updated",action:e})})},x3);function i8(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:e8(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Dv(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jv(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,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 mn,Te,cu,nn,zs,oa,Xr,ji,du,aa,la,Bs,Gs,Ui,ua,Ie,kl,kg,Eg,Pg,Ng,Rg,Tg,Og,s8,w3,sC=(w3=class extends Oa{constructor(e,n){super();de(this,Ie);de(this,mn);de(this,Te);de(this,cu);de(this,nn);de(this,zs);de(this,oa);de(this,Xr);de(this,ji);de(this,du);de(this,aa);de(this,la);de(this,Bs);de(this,Gs);de(this,Ui);de(this,ua,new Set);this.options=n,ne(this,mn,e),ne(this,ji,null),ne(this,Xr,_g()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,Te).addObserver(this),Uv(F(this,Te),this.options)?_e(this,Ie,kl).call(this):this.updateResult(),_e(this,Ie,Ng).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bg(F(this,Te),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bg(F(this,Te),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,_e(this,Ie,Rg).call(this),_e(this,Ie,Tg).call(this),F(this,Te).removeObserver(this)}setOptions(e){const n=this.options,r=F(this,Te);if(this.options=F(this,mn).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Kn(this.options.enabled,F(this,Te))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");_e(this,Ie,Og).call(this),F(this,Te).setOptions(this.options),n._defaulted&&!jd(this.options,n)&&F(this,mn).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,Te),observer:this});const i=this.hasListeners();i&&zv(F(this,Te),r,this.options,n)&&_e(this,Ie,kl).call(this),this.updateResult(),i&&(F(this,Te)!==r||Kn(this.options.enabled,F(this,Te))!==Kn(n.enabled,F(this,Te))||ts(this.options.staleTime,F(this,Te))!==ts(n.staleTime,F(this,Te)))&&_e(this,Ie,kg).call(this);const s=_e(this,Ie,Eg).call(this);i&&(F(this,Te)!==r||Kn(this.options.enabled,F(this,Te))!==Kn(n.enabled,F(this,Te))||s!==F(this,Ui))&&_e(this,Ie,Pg).call(this,s)}getOptimisticResult(e){const n=F(this,mn).getQueryCache().build(F(this,mn),e),r=this.createResult(n,e);return aC(this,r)&&(ne(this,nn,r),ne(this,oa,this.options),ne(this,zs,F(this,Te).state)),r}getCurrentResult(){return F(this,nn)}trackResult(e,n){return new Proxy(e,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&F(this,Xr).status==="pending"&&F(this,Xr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(e){F(this,ua).add(e)}getCurrentQuery(){return F(this,Te)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=F(this,mn).defaultQueryOptions(e),r=F(this,mn).getQueryCache().build(F(this,mn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return _e(this,Ie,kl).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,nn)))}createResult(e,n){var I;const r=F(this,Te),i=this.options,s=F(this,nn),l=F(this,zs),u=F(this,oa),h=e!==r?e.state:F(this,cu),{state:p}=e;let y={...p},S=!1,x;if(n._optimisticResults){const L=this.hasListeners(),H=!L&&Uv(e,n),B=L&&zv(e,r,n,i);(H||B)&&(y={...y,...i8(p.data,e.options)}),n._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:m,errorUpdatedAt:C,status:P}=y;x=y.data;let E=!1;if(n.placeholderData!==void 0&&x===void 0&&P==="pending"){let L;s!=null&&s.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(L=s.data,E=!0):L=typeof n.placeholderData=="function"?n.placeholderData((I=F(this,la))==null?void 0:I.state.data,F(this,la)):n.placeholderData,L!==void 0&&(P="success",x=wg(s==null?void 0:s.data,L,n),S=!0)}if(n.select&&x!==void 0&&!E)if(s&&x===(l==null?void 0:l.data)&&n.select===F(this,du))x=F(this,aa);else try{ne(this,du,n.select),x=n.select(x),x=wg(s==null?void 0:s.data,x,n),ne(this,aa,x),ne(this,ji,null)}catch(L){ne(this,ji,L)}F(this,ji)&&(m=F(this,ji),x=F(this,aa),C=Date.now(),P="error");const k=y.fetchStatus==="fetching",v=P==="pending",_=P==="error",R=v&&k,b=x!==void 0,O={status:P,fetchStatus:y.fetchStatus,isPending:v,isSuccess:P==="success",isError:_,isInitialLoading:R,isLoading:R,data:x,dataUpdatedAt:y.dataUpdatedAt,error:m,errorUpdatedAt:C,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:y.dataUpdateCount>h.dataUpdateCount||y.errorUpdateCount>h.errorUpdateCount,isFetching:k,isRefetching:k&&!v,isLoadingError:_&&!b,isPaused:y.fetchStatus==="paused",isPlaceholderData:S,isRefetchError:_&&b,isStale:Z1(e,n),refetch:this.refetch,promise:F(this,Xr),isEnabled:Kn(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const L=O.data!==void 0,H=O.status==="error"&&!L,B=Q=>{H?Q.reject(O.error):L&&Q.resolve(O.data)},$=()=>{const Q=ne(this,Xr,O.promise=_g());B(Q)},q=F(this,Xr);switch(q.status){case"pending":e.queryHash===r.queryHash&&B(q);break;case"fulfilled":(H||O.data!==q.value)&&$();break;case"rejected":(!H||O.error!==q.reason)&&$();break}}return O}updateResult(){const e=F(this,nn),n=this.createResult(F(this,Te),this.options);if(ne(this,zs,F(this,Te).state),ne(this,oa,this.options),F(this,zs).data!==void 0&&ne(this,la,F(this,Te)),jd(n,e))return;ne(this,nn,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!F(this,ua).size)return!0;const l=new Set(s??F(this,ua));return this.options.throwOnError&&l.add("error"),Object.keys(F(this,nn)).some(u=>{const c=u;return F(this,nn)[c]!==e[c]&&l.has(c)})};_e(this,Ie,s8).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&_e(this,Ie,Ng).call(this)}},mn=new WeakMap,Te=new WeakMap,cu=new WeakMap,nn=new WeakMap,zs=new WeakMap,oa=new WeakMap,Xr=new WeakMap,ji=new WeakMap,du=new WeakMap,aa=new WeakMap,la=new WeakMap,Bs=new WeakMap,Gs=new WeakMap,Ui=new WeakMap,ua=new WeakMap,Ie=new WeakSet,kl=function(e){_e(this,Ie,Og).call(this);let n=F(this,Te).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(sn)),n},kg=function(){_e(this,Ie,Rg).call(this);const e=ts(this.options.staleTime,F(this,Te));if(iu.isServer()||F(this,nn).isStale||!Sg(e))return;const r=X6(F(this,nn).dataUpdatedAt,e)+1;ne(this,Bs,Fs.setTimeout(()=>{F(this,nn).isStale||this.updateResult()},r))},Eg=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(F(this,Te)):this.options.refetchInterval)??!1},Pg=function(e){_e(this,Ie,Tg).call(this),ne(this,Ui,e),!(iu.isServer()||Kn(this.options.enabled,F(this,Te))===!1||!Sg(F(this,Ui))||F(this,Ui)===0)&&ne(this,Gs,Fs.setInterval(()=>{(this.options.refetchIntervalInBackground||q1.isFocused())&&_e(this,Ie,kl).call(this)},F(this,Ui)))},Ng=function(){_e(this,Ie,kg).call(this),_e(this,Ie,Pg).call(this,_e(this,Ie,Eg).call(this))},Rg=function(){F(this,Bs)&&(Fs.clearTimeout(F(this,Bs)),ne(this,Bs,void 0))},Tg=function(){F(this,Gs)&&(Fs.clearInterval(F(this,Gs)),ne(this,Gs,void 0))},Og=function(){const e=F(this,mn).getQueryCache().build(F(this,mn),this.options);if(e===F(this,Te))return;const n=F(this,Te);ne(this,Te,e),ne(this,cu,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},s8=function(e){Pt.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(F(this,nn))}),F(this,mn).getQueryCache().notify({query:F(this,Te),type:"observerResultsUpdated"})})},w3);function oC(t,e){return Kn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Uv(t,e){return oC(t,e)||t.state.data!==void 0&&bg(t,e,e.refetchOnMount)}function bg(t,e,n){if(Kn(e.enabled,t)!==!1&&ts(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&Z1(t,e)}return!1}function zv(t,e,n,r){return(t!==e||Kn(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Z1(t,n)}function Z1(t,e){return Kn(e.enabled,t)!==!1&&t.isStaleByTime(ts(e.staleTime,t))}function aC(t,e){return!jd(t.getCurrentResult(),e)}function Bv(t){return{onFetch:(e,n)=>{var p,y,S,x,m;const r=e.options,i=(S=(y=(p=e.fetchOptions)==null?void 0:p.meta)==null?void 0:y.fetchMore)==null?void 0:S.direction,s=((x=e.state.data)==null?void 0:x.pages)||[],l=((m=e.state.data)==null?void 0:m.pageParams)||[];let u={pages:[],pageParams:[]},c=0;const h=async()=>{let C=!1;const P=v=>{Z_(v,()=>e.signal,()=>C=!0)},E=Z6(e.options,e.fetchOptions),k=async(v,_,R)=>{if(C)return Promise.reject();if(_==null&&v.pages.length)return Promise.resolve(v);const A=(()=>{const H={client:e.client,queryKey:e.queryKey,pageParam:_,direction:R?"backward":"forward",meta:e.options.meta};return P(H),H})(),O=await E(A),{maxPages:I}=e.options,L=R?J_:X_;return{pages:L(v.pages,O,I),pageParams:L(v.pageParams,_,I)}};if(i&&s.length){const v=i==="backward",_=v?lC:Gv,R={pages:s,pageParams:l},b=_(r,R);u=await k(R,b,v)}else{const v=t??s.length;do{const _=c===0?l[0]??r.initialPageParam:Gv(r,u);if(c>0&&_==null)break;u=await k(u,_),c++}while(c<v)}return u};e.options.persister?e.fetchFn=()=>{var C,P;return(P=(C=e.options).persister)==null?void 0:P.call(C,h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=h}}}function Gv(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function lC(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var hu,Tr,Yt,Hs,Or,Ti,_3,uC=(_3=class extends n8{constructor(e){super();de(this,Or);de(this,hu);de(this,Tr);de(this,Yt);de(this,Hs);ne(this,hu,e.client),this.mutationId=e.mutationId,ne(this,Yt,e.mutationCache),ne(this,Tr,[]),this.state=e.state||o8(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){F(this,Tr).includes(e)||(F(this,Tr).push(e),this.clearGcTimeout(),F(this,Yt).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ne(this,Tr,F(this,Tr).filter(n=>n!==e)),this.scheduleGc(),F(this,Yt).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){F(this,Tr).length||(this.state.status==="pending"?this.scheduleGc():F(this,Yt).remove(this))}continue(){var e;return((e=F(this,Hs))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var l,u,c,h,p,y,S,x,m,C,P,E,k,v,_,R,b,A;const n=()=>{_e(this,Or,Ti).call(this,{type:"continue"})},r={client:F(this,hu),meta:this.options.meta,mutationKey:this.options.mutationKey};ne(this,Hs,t8({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(O,I)=>{_e(this,Or,Ti).call(this,{type:"failed",failureCount:O,error:I})},onPause:()=>{_e(this,Or,Ti).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,Yt).canRun(this)}));const i=this.state.status==="pending",s=!F(this,Hs).canStart();try{if(i)n();else{_e(this,Or,Ti).call(this,{type:"pending",variables:e,isPaused:s}),F(this,Yt).config.onMutate&&await F(this,Yt).config.onMutate(e,this,r);const I=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e,r));I!==this.state.context&&_e(this,Or,Ti).call(this,{type:"pending",context:I,variables:e,isPaused:s})}const O=await F(this,Hs).start();return await((h=(c=F(this,Yt).config).onSuccess)==null?void 0:h.call(c,O,e,this.state.context,this,r)),await((y=(p=this.options).onSuccess)==null?void 0:y.call(p,O,e,this.state.context,r)),await((x=(S=F(this,Yt).config).onSettled)==null?void 0:x.call(S,O,null,this.state.variables,this.state.context,this,r)),await((C=(m=this.options).onSettled)==null?void 0:C.call(m,O,null,e,this.state.context,r)),_e(this,Or,Ti).call(this,{type:"success",data:O}),O}catch(O){try{await((E=(P=F(this,Yt).config).onError)==null?void 0:E.call(P,O,e,this.state.context,this,r))}catch(I){Promise.reject(I)}try{await((v=(k=this.options).onError)==null?void 0:v.call(k,O,e,this.state.context,r))}catch(I){Promise.reject(I)}try{await((R=(_=F(this,Yt).config).onSettled)==null?void 0:R.call(_,void 0,O,this.state.variables,this.state.context,this,r))}catch(I){Promise.reject(I)}try{await((A=(b=this.options).onSettled)==null?void 0:A.call(b,void 0,O,e,this.state.context,r))}catch(I){Promise.reject(I)}throw _e(this,Or,Ti).call(this,{type:"error",error:O}),O}finally{F(this,Yt).runNext(this)}}},hu=new WeakMap,Tr=new WeakMap,Yt=new WeakMap,Hs=new WeakMap,Or=new WeakSet,Ti=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Pt.batch(()=>{F(this,Tr).forEach(r=>{r.onMutationUpdate(e)}),F(this,Yt).notify({mutation:this,type:"updated",action:e})})},_3);function o8(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Jr,ur,fu,C3,cC=(C3=class extends Oa{constructor(e={}){super();de(this,Jr);de(this,ur);de(this,fu);this.config=e,ne(this,Jr,new Set),ne(this,ur,new Map),ne(this,fu,0)}build(e,n,r){const i=new uC({client:e,mutationCache:this,mutationId:++Cc(this,fu)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){F(this,Jr).add(e);const n=Bc(e);if(typeof n=="string"){const r=F(this,ur).get(n);r?r.push(e):F(this,ur).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(F(this,Jr).delete(e)){const n=Bc(e);if(typeof n=="string"){const r=F(this,ur).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&F(this,ur).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Bc(e);if(typeof n=="string"){const r=F(this,ur).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=Bc(e);if(typeof n=="string"){const i=(r=F(this,ur).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Pt.batch(()=>{F(this,Jr).forEach(e=>{this.notify({type:"removed",mutation:e})}),F(this,Jr).clear(),F(this,ur).clear()})}getAll(){return Array.from(F(this,Jr))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Av(n,r))}findAll(e={}){return this.getAll().filter(n=>Av(e,n))}notify(e){Pt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Pt.batch(()=>Promise.all(e.map(n=>n.continue().catch(sn))))}},Jr=new WeakMap,ur=new WeakMap,fu=new WeakMap,C3);function Bc(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Zr,zi,yn,ei,si,ad,Lg,k3,dC=(k3=class extends Oa{constructor(n,r){super();de(this,si);de(this,Zr);de(this,zi);de(this,yn);de(this,ei);ne(this,Zr,n),this.setOptions(r),this.bindMethods(),_e(this,si,ad).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=F(this,Zr).defaultMutationOptions(n),jd(this.options,r)||F(this,Zr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:F(this,yn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Zs(r.mutationKey)!==Zs(this.options.mutationKey)?this.reset():((i=F(this,yn))==null?void 0:i.state.status)==="pending"&&F(this,yn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=F(this,yn))==null||n.removeObserver(this)}onMutationUpdate(n){_e(this,si,ad).call(this),_e(this,si,Lg).call(this,n)}getCurrentResult(){return F(this,zi)}reset(){var n;(n=F(this,yn))==null||n.removeObserver(this),ne(this,yn,void 0),_e(this,si,ad).call(this),_e(this,si,Lg).call(this)}mutate(n,r){var i;return ne(this,ei,r),(i=F(this,yn))==null||i.removeObserver(this),ne(this,yn,F(this,Zr).getMutationCache().build(F(this,Zr),this.options)),F(this,yn).addObserver(this),F(this,yn).execute(n)}},Zr=new WeakMap,zi=new WeakMap,yn=new WeakMap,ei=new WeakMap,si=new WeakSet,ad=function(){var r;const n=((r=F(this,yn))==null?void 0:r.state)??o8();ne(this,zi,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Lg=function(n){Pt.batch(()=>{var r,i,s,l,u,c,h,p;if(F(this,ei)&&this.hasListeners()){const y=F(this,zi).variables,S=F(this,zi).context,x={client:F(this,Zr),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=F(this,ei)).onSuccess)==null||i.call(r,n.data,y,S,x)}catch(m){Promise.reject(m)}try{(l=(s=F(this,ei)).onSettled)==null||l.call(s,n.data,null,y,S,x)}catch(m){Promise.reject(m)}}else if((n==null?void 0:n.type)==="error"){try{(c=(u=F(this,ei)).onError)==null||c.call(u,n.error,y,S,x)}catch(m){Promise.reject(m)}try{(p=(h=F(this,ei)).onSettled)==null||p.call(h,void 0,n.error,y,S,x)}catch(m){Promise.reject(m)}}}this.listeners.forEach(y=>{y(F(this,zi))})})},k3),br,E3,hC=(E3=class extends Oa{constructor(e={}){super();de(this,br);this.config=e,ne(this,br,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??Y1(i,n);let l=this.get(s);return l||(l=new iC({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}add(e){F(this,br).has(e.queryHash)||(F(this,br).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=F(this,br).get(e.queryHash);n&&(e.destroy(),n===e&&F(this,br).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Pt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return F(this,br).get(e)}getAll(){return[...F(this,br).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Fv(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>Fv(e,r)):n}notify(e){Pt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Pt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Pt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},br=new WeakMap,E3),dt,Bi,Gi,ca,da,Hi,ha,fa,P3,fC=(P3=class{constructor(t={}){de(this,dt);de(this,Bi);de(this,Gi);de(this,ca);de(this,da);de(this,Hi);de(this,ha);de(this,fa);ne(this,dt,t.queryCache||new hC),ne(this,Bi,t.mutationCache||new cC),ne(this,Gi,t.defaultOptions||{}),ne(this,ca,new Map),ne(this,da,new Map),ne(this,Hi,0)}mount(){Cc(this,Hi)._++,F(this,Hi)===1&&(ne(this,ha,q1.subscribe(async t=>{t&&(await this.resumePausedMutations(),F(this,dt).onFocus())})),ne(this,fa,Ud.subscribe(async t=>{t&&(await this.resumePausedMutations(),F(this,dt).onOnline())})))}unmount(){var t,e;Cc(this,Hi)._--,F(this,Hi)===0&&((t=F(this,ha))==null||t.call(this),ne(this,ha,void 0),(e=F(this,fa))==null||e.call(this),ne(this,fa,void 0))}isFetching(t){return F(this,dt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return F(this,Bi).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=F(this,dt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=F(this,dt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(ts(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return F(this,dt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=F(this,dt).get(r.queryHash),s=i==null?void 0:i.state.data,l=Q_(e,s);if(l!==void 0)return F(this,dt).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(t,e,n){return Pt.batch(()=>F(this,dt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=F(this,dt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=F(this,dt);Pt.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=F(this,dt);return Pt.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Pt.batch(()=>F(this,dt).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(sn).catch(sn)}invalidateQueries(t,e={}){return Pt.batch(()=>(F(this,dt).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Pt.batch(()=>F(this,dt).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(sn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(sn)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=F(this,dt).build(this,e);return n.isStaleByTime(ts(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(sn).catch(sn)}fetchInfiniteQuery(t){return t.behavior=Bv(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(sn).catch(sn)}ensureInfiniteQueryData(t){return t.behavior=Bv(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ud.isOnline()?F(this,Bi).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,dt)}getMutationCache(){return F(this,Bi)}getDefaultOptions(){return F(this,Gi)}setDefaultOptions(t){ne(this,Gi,t)}setQueryDefaults(t,e){F(this,ca).set(Zs(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...F(this,ca).values()],n={};return e.forEach(r=>{ru(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){F(this,da).set(Zs(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...F(this,da).values()],n={};return e.forEach(r=>{ru(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...F(this,Gi).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Y1(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===X1&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...F(this,Gi).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){F(this,dt).clear(),F(this,Bi).clear()}},dt=new WeakMap,Bi=new WeakMap,Gi=new WeakMap,ca=new WeakMap,da=new WeakMap,Hi=new WeakMap,ha=new WeakMap,fa=new WeakMap,P3),a8=V.createContext(void 0),em=t=>{const e=V.useContext(a8);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},pC=({client:t,children:e})=>(V.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),N.jsx(a8.Provider,{value:t,children:e})),l8=V.createContext(!1),gC=()=>V.useContext(l8);l8.Provider;function mC(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var yC=V.createContext(mC()),vC=()=>V.useContext(yC),SC=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?J1(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},xC=t=>{V.useEffect(()=>{t.clearReset()},[t])},wC=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||J1(n,[t.error,r])),_C=t=>{if(t.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},CC=(t,e)=>t.isLoading&&t.isFetching&&!e,kC=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Hv=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function EC(t,e,n){var S,x,m,C;const r=gC(),i=vC(),s=em(),l=s.defaultQueryOptions(t);(x=(S=s.getDefaultOptions().queries)==null?void 0:S._experimental_beforeQuery)==null||x.call(S,l);const u=s.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",_C(l),SC(l,i,u),xC(i);const c=!s.getQueryCache().get(l.queryHash),[h]=V.useState(()=>new e(s,l)),p=h.getOptimisticResult(l),y=!r&&t.subscribed!==!1;if(V.useSyncExternalStore(V.useCallback(P=>{const E=y?h.subscribe(Pt.batchCalls(P)):sn;return h.updateResult(),E},[h,y]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),V.useEffect(()=>{h.setOptions(l)},[l,h]),kC(l,p))throw Hv(l,h,i);if(wC({result:p,errorResetBoundary:i,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw p.error;if((C=(m=s.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||C.call(m,l,p),l.experimental_prefetchInRender&&!iu.isServer()&&CC(p,r)){const P=c?Hv(l,h,i):u==null?void 0:u.promise;P==null||P.catch(sn).finally(()=>{h.updateResult()})}return l.notifyOnChangeProps?p:h.trackResult(p)}function u8(t,e){return EC(t,sC)}function PC(t,e){const n=em(),[r]=V.useState(()=>new dC(n,t));V.useEffect(()=>{r.setOptions(t)},[r,t]);const i=V.useSyncExternalStore(V.useCallback(l=>r.subscribe(Pt.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=V.useCallback((l,u)=>{r.mutate(l,u).catch(sn)},[r]);if(i.error&&J1(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var NC={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"};/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const RC=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),wt=(t,e)=>{const n=V.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:l,className:u="",children:c,...h},p)=>V.createElement("svg",{ref:p,...NC,width:i,height:i,stroke:r,strokeWidth:l?Number(s)*24/Number(i):s,className:["lucide",`lucide-${RC(t)}`,u].join(" "),...h},[...e.map(([y,S])=>V.createElement(y,S)),...Array.isArray(c)?c:[c]]));return n.displayName=`${t}`,n};/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zd=wt("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const TC=wt("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const OC=wt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const bC=wt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const LC=wt("Cpu",[["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"9",y:"9",width:"6",height:"6",key:"o3kz5p"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const c8=wt("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"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const FC=wt("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"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const AC=wt("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const MC=wt("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tm=wt("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const IC=wt("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const DC=wt("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const jC=wt("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const UC=wt("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"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const d8=wt("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zC=wt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ld=wt("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const h8=wt("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const eo=wt("Wand2",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72Z",key:"1bcowg"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const BC=wt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),me=t=>typeof t=="string",pl=()=>{let t,e;const n=new Promise((r,i)=>{t=r,e=i});return n.resolve=t,n.reject=e,n},Vv=t=>t==null?"":String(t),GC=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},HC=/###/g,Wv=t=>t&&t.includes("###")?t.replace(HC,"."):t,Kv=t=>!t||me(t),Il=(t,e,n)=>{const r=me(e)?e.split("."):e;let i=0;for(;i<r.length-1;){if(Kv(t))return{};const s=Wv(r[i]);!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={},++i}return Kv(t)?{}:{obj:t,k:Wv(r[i])}},$v=(t,e,n)=>{const{obj:r,k:i}=Il(t,e,Object);if(r!==void 0||e.length===1){r[i]=n;return}let s=e[e.length-1],l=e.slice(0,e.length-1),u=Il(t,l,Object);for(;u.obj===void 0&&l.length;)s=`${l[l.length-1]}.${s}`,l=l.slice(0,l.length-1),u=Il(t,l,Object),u!=null&&u.obj&&typeof u.obj[`${u.k}.${s}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${s}`]=n},VC=(t,e,n,r)=>{const{obj:i,k:s}=Il(t,e,Object);i[s]=i[s]||[],i[s].push(n)},Bd=(t,e)=>{const{obj:n,k:r}=Il(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},WC=(t,e,n)=>{const r=Bd(t,n);return r!==void 0?r:Bd(e,n)},f8=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?me(t[r])||t[r]instanceof String||me(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):f8(t[r],e[r],n):t[r]=e[r]);return t},Es=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),KC={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},$C=t=>me(t)?t.replace(/[&<>"'\/]/g,e=>KC[e]):t;class QC{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const qC=[" ",",","?","!",";"],YC=new QC(20),XC=(t,e,n)=>{e=e||"",n=n||"";const r=qC.filter(l=>!e.includes(l)&&!n.includes(l));if(r.length===0)return!0;const i=YC.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let s=!i.test(t);if(!s){const l=t.indexOf(n);l>0&&!i.test(t.substring(0,l))&&(s=!0)}return s},Fg=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const r=e.split(n);let i=t;for(let s=0;s<r.length;){if(!i||typeof i!="object")return;let l,u="";for(let c=s;c<r.length;++c)if(c!==s&&(u+=n),u+=r[c],l=i[u],l!==void 0){if(["string","number","boolean"].includes(typeof l)&&c<r.length-1)continue;s+=c-s+1;break}i=l}return i},su=t=>t==null?void 0:t.replace(/_/g,"-"),JC={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var n,r;(r=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||r.call(n,console,e)}};class Gd{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||JC,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,i){return i&&!this.debug?null:(me(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new Gd(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Gd(this.logger,e)}}var Ar=new Gd;class ph{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}once(e,n){const r=(...i)=>{n(...i),this.off(e,r)};return this.on(e,r),this}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,s])=>{for(let l=0;l<s;l++)i(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,s])=>{for(let l=0;l<s;l++)i(e,...n)})}}class Qv extends ph{constructor(e,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r,i={}){var h,p;const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,l=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let u;e.includes(".")?u=e.split("."):(u=[e,n],r&&(Array.isArray(r)?u.push(...r):me(r)&&s?u.push(...r.split(s)):u.push(r)));const c=Bd(this.data,u);return!c&&!n&&!r&&e.includes(".")&&(e=u[0],n=u[1],r=u.slice(2).join(".")),c||!l||!me(r)?c:Fg((p=(h=this.data)==null?void 0:h[e])==null?void 0:p[n],r,s)}addResource(e,n,r,i,s={silent:!1}){const l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let u=[e,n];r&&(u=u.concat(l?r.split(l):r)),e.includes(".")&&(u=e.split("."),i=n,n=u[1]),this.addNamespaces(n),$v(this.data,u,i),s.silent||this.emit("added",e,n,r,i)}addResources(e,n,r,i={silent:!1}){for(const s in r)(me(r[s])||Array.isArray(r[s]))&&this.addResource(e,n,s,r[s],{silent:!0});i.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,i,s,l={silent:!1,skipCopy:!1}){let u=[e,n];e.includes(".")&&(u=e.split("."),i=r,r=n,n=u[1]),this.addNamespaces(n);let c=Bd(this.data,u)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?f8(c,r,s):c={...c,...r},$v(this.data,u,c),l.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var p8={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,i){return t.forEach(s=>{var l;e=((l=this.processors[s])==null?void 0:l.process(e,n,r,i))??e}),e}};const g8=Symbol("i18next/PATH_KEY");function ZC(){const t=[],e=Object.create(null);let n;return e.get=(r,i)=>{var s;return(s=n==null?void 0:n.revoke)==null||s.call(n),i===g8?t:(t.push(i),n=Proxy.revocable(r,e),n.proxy)},Proxy.revocable(Object.create(null),e).proxy}function ta(t,e){const{[g8]:n}=t(ZC()),r=(e==null?void 0:e.keySeparator)??".",i=(e==null?void 0:e.nsSeparator)??":";if(n.length>1&&i){const s=e==null?void 0:e.ns,l=Array.isArray(s)?s:null;if(l&&l.length>1&&l.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}const i0=t=>!me(t)&&typeof t!="boolean"&&typeof t!="number";class Hd extends ph{constructor(e,n={}){super(),GC(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ar.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const r={...n};if(e==null)return!1;const i=this.resolve(e,r);if((i==null?void 0:i.res)===void 0)return!1;const s=i0(i.res);return!(r.returnObjects===!1&&s)}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const l=r&&e.includes(r),u=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!XC(e,r,i);if(l&&!u){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:me(s)?[s]:s};const h=e.split(r);(r!==i||r===i&&this.options.ns.includes(h[0]))&&(s=h.shift()),e=h.join(i)}return{key:e,namespaces:me(s)?[s]:s}}translate(e,n,r){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=ta(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map($=>typeof $=="function"?ta($,{...this.options,...i}):String($));const s=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,l=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:u,namespaces:c}=this.extractFromKey(e[e.length-1],i),h=c[c.length-1];let p=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;p===void 0&&(p=":");const y=i.lng||this.language,S=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((y==null?void 0:y.toLowerCase())==="cimode")return S?s?{res:`${h}${p}${u}`,usedKey:u,exactUsedKey:u,usedLng:y,usedNS:h,usedParams:this.getUsedParamsDetails(i)}:`${h}${p}${u}`:s?{res:u,usedKey:u,exactUsedKey:u,usedLng:y,usedNS:h,usedParams:this.getUsedParamsDetails(i)}:u;const x=this.resolve(e,i);let m=x==null?void 0:x.res;const C=(x==null?void 0:x.usedKey)||u,P=(x==null?void 0:x.exactUsedKey)||u,E=["[object Number]","[object Function]","[object RegExp]"],k=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,_=i.count!==void 0&&!me(i.count),R=Hd.hasDefaultValue(i),b=_?this.pluralResolver.getSuffix(y,i.count,i):"",A=i.ordinal&&_?this.pluralResolver.getSuffix(y,i.count,{ordinal:!1}):"",O=_&&!i.ordinal&&i.count===0,I=O&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${b}`]||i[`defaultValue${A}`]||i.defaultValue;let L=m;v&&!m&&R&&(L=I);const H=i0(L),B=Object.prototype.toString.apply(L);if(v&&L&&H&&!E.includes(B)&&!(me(k)&&Array.isArray(L))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const $=this.options.returnedObjectHandler?this.options.returnedObjectHandler(C,L,{...i,ns:c}):`key '${u} (${this.language})' returned an object instead of string.`;return s?(x.res=$,x.usedParams=this.getUsedParamsDetails(i),x):$}if(l){const $=Array.isArray(L),q=$?[]:{},Q=$?P:C;for(const re in L)if(Object.prototype.hasOwnProperty.call(L,re)){const he=`${Q}${l}${re}`;R&&!m?q[re]=this.translate(he,{...i,defaultValue:i0(I)?I[re]:void 0,joinArrays:!1,ns:c}):q[re]=this.translate(he,{...i,joinArrays:!1,ns:c}),q[re]===he&&(q[re]=L[re])}m=q}}else if(v&&me(k)&&Array.isArray(m))m=m.join(k),m&&(m=this.extendTranslation(m,e,i,r));else{let $=!1,q=!1;!this.isValidLookup(m)&&R&&($=!0,m=I),this.isValidLookup(m)||(q=!0,m=u);const re=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&q?void 0:m,he=R&&I!==m&&this.options.updateMissing;if(q||$||he){if(this.logger.log(he?"updateKey":"missingKey",y,h,u,he?I:m),l){const Y=this.resolve(u,{...i,keySeparator:!1});Y&&Y.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let W=[];const te=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&te&&te[0])for(let Y=0;Y<te.length;Y++)W.push(te[Y]);else this.options.saveMissingTo==="all"?W=this.languageUtils.toResolveHierarchy(i.lng||this.language):W.push(i.lng||this.language);const Z=(Y,ie,xe)=>{var it;const Ke=R&&xe!==m?xe:re;this.options.missingKeyHandler?this.options.missingKeyHandler(Y,h,ie,Ke,he,i):(it=this.backendConnector)!=null&&it.saveMissing&&this.backendConnector.saveMissing(Y,h,ie,Ke,he,i),this.emit("missingKey",Y,h,ie,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&_?W.forEach(Y=>{const ie=this.pluralResolver.getSuffixes(Y,i);O&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!ie.includes(`${this.options.pluralSeparator}zero`)&&ie.push(`${this.options.pluralSeparator}zero`),ie.forEach(xe=>{Z([Y],u+xe,i[`defaultValue${xe}`]||I)})}):Z(W,u,I))}m=this.extendTranslation(m,e,i,x,r),q&&m===u&&this.options.appendNamespaceToMissingKey&&(m=`${h}${p}${u}`),(q||$)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${p}${u}`:u,$?m:void 0,i))}return s?(x.res=m,x.usedParams=this.getUsedParamsDetails(i),x):m}extendTranslation(e,n,r,i,s){var c,h;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const p=me(e)&&(((h=r==null?void 0:r.interpolation)==null?void 0:h.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let y;if(p){const x=e.match(this.interpolator.nestingRegexp);y=x&&x.length}let S=r.replace&&!me(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(S={...this.options.interpolation.defaultVariables,...S}),e=this.interpolator.interpolate(e,S,r.lng||this.language||i.usedLng,r),p){const x=e.match(this.interpolator.nestingRegexp),m=x&&x.length;y<m&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,(...x)=>(s==null?void 0:s[0])===x[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${x[0]} in key: ${n[0]}`),null):this.translate(...x,n),r)),r.interpolation&&this.interpolator.reset()}const l=r.postProcess||this.options.postProcess,u=me(l)?[l]:l;return e!=null&&(u!=null&&u.length)&&r.applyPostProcessor!==!1&&(e=p8.handle(u,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,n={}){let r,i,s,l,u;return me(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(c=>typeof c=="function"?ta(c,{...this.options,...n}):c)),e.forEach(c=>{if(this.isValidLookup(r))return;const h=this.extractFromKey(c,n),p=h.key;i=p;let y=h.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const S=n.count!==void 0&&!me(n.count),x=S&&!n.ordinal&&n.count===0,m=n.context!==void 0&&(me(n.context)||typeof n.context=="number")&&n.context!=="",C=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);y.forEach(P=>{var E,k;this.isValidLookup(r)||(u=P,!this.checkedLoadedFor[`${C[0]}-${P}`]&&((E=this.utils)!=null&&E.hasLoadedNamespace)&&!((k=this.utils)!=null&&k.hasLoadedNamespace(u))&&(this.checkedLoadedFor[`${C[0]}-${P}`]=!0,this.logger.warn(`key "${i}" for languages "${C.join(", ")}" won't get resolved as namespace "${u}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),C.forEach(v=>{var b;if(this.isValidLookup(r))return;l=v;const _=[p];if((b=this.i18nFormat)!=null&&b.addLookupKeys)this.i18nFormat.addLookupKeys(_,p,v,P,n);else{let A;S&&(A=this.pluralResolver.getSuffix(v,n.count,n));const O=`${this.options.pluralSeparator}zero`,I=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(S&&(n.ordinal&&A.startsWith(I)&&_.push(p+A.replace(I,this.options.pluralSeparator)),_.push(p+A),x&&_.push(p+O)),m){const L=`${p}${this.options.contextSeparator||"_"}${n.context}`;_.push(L),S&&(n.ordinal&&A.startsWith(I)&&_.push(L+A.replace(I,this.options.pluralSeparator)),_.push(L+A),x&&_.push(L+O))}}let R;for(;R=_.pop();)this.isValidLookup(r)||(s=R,r=this.getResource(v,P,R,n))}))})}),{res:r,usedKey:i,exactUsedKey:s,usedLng:l,usedNS:u}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r,i={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(e,n,r,i):this.resourceStore.getResource(e,n,r,i)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!me(e.replace);let i=r?e.replace:e;if(r&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const s of n)delete i[s]}return i}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&r.startsWith(n)&&e[r]!==void 0)return!0;return!1}}class qv{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ar.create("languageUtils")}getScriptPartFromCode(e){if(e=su(e),!e||!e.includes("-"))return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=su(e),!e||!e.includes("-"))return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(me(e)&&e.includes("-")){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return n=i;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(l=>l===s?!0:!l.includes("-")&&!s.includes("-")?!1:!!(l.includes("-")&&!s.includes("-")&&l.slice(0,l.indexOf("-"))===s||l.startsWith(s)&&s.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),me(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),i=[],s=l=>{l&&(this.isSupportedCode(l)?i.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return me(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(e))):me(e)&&s(this.formatLanguageCode(e)),r.forEach(l=>{i.includes(l)||s(this.formatLanguageCode(l))}),i}}const Yv={zero:0,one:1,two:2,few:3,many:4,other:5},Xv={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ek{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=Ar.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const r=su(e==="dev"?"en":e),i=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:r,type:i});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let l;try{l=new Intl.PluralRules(r,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Xv;if(!e.match(/-|_/))return Xv;const c=this.languageUtils.getLanguagePartFromCode(e);l=this.getRule(c,n)}return this.pluralRulesCache[s]=l,l}needsPlural(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n,r={}){return this.getSuffixes(e,r).map(i=>`${n}${i}`)}getSuffixes(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,s)=>Yv[i]-Yv[s]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,n,r={}){const i=this.getRule(e,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const Jv=(t,e,n,r=".",i=!0)=>{let s=WC(t,e,n);return!s&&i&&me(n)&&(s=Fg(t,n,r),s===void 0&&(s=Fg(e,n,r))),s},s0=t=>t.replace(/\$/g,"$$$$");class Zv{constructor(e={}){var n;this.logger=Ar.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(r=>r),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:s,prefixEscaped:l,suffix:u,suffixEscaped:c,formatSeparator:h,unescapeSuffix:p,unescapePrefix:y,nestingPrefix:S,nestingPrefixEscaped:x,nestingSuffix:m,nestingSuffixEscaped:C,nestingOptionsSeparator:P,maxReplaces:E,alwaysFormat:k}=e.interpolation;this.escape=n!==void 0?n:$C,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=s?Es(s):l||"{{",this.suffix=u?Es(u):c||"}}",this.formatSeparator=h||",",this.unescapePrefix=p?"":y||"-",this.unescapeSuffix=this.unescapePrefix?"":p||"",this.nestingPrefix=S?Es(S):x||Es("$t("),this.nestingSuffix=m?Es(m):C||Es(")"),this.nestingOptionsSeparator=P||",",this.maxReplaces=E||1e3,this.alwaysFormat=k!==void 0?k:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,n,r,i){var x;let s,l,u;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=m=>{if(!m.includes(this.formatSeparator)){const k=Jv(n,c,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,r,{...i,...n,interpolationkey:m}):k}const C=m.split(this.formatSeparator),P=C.shift().trim(),E=C.join(this.formatSeparator).trim();return this.format(Jv(n,c,P,this.options.keySeparator,this.options.ignoreJSONStructure),E,r,{...i,...n,interpolationkey:P})};this.resetRegExp();const p=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,y=((x=i==null?void 0:i.interpolation)==null?void 0:x.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>s0(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?s0(this.escape(m)):s0(m)}].forEach(m=>{for(u=0;s=m.regex.exec(e);){const C=s[1].trim();if(l=h(C),l===void 0)if(typeof p=="function"){const E=p(e,s,i);l=me(E)?E:""}else if(i&&Object.prototype.hasOwnProperty.call(i,C))l="";else if(y){l=s[0];continue}else this.logger.warn(`missed to pass in variable ${C} for interpolating ${e}`),l="";else!me(l)&&!this.useRawValueToEscape&&(l=Vv(l));const P=m.safeValue(l);if(e=e.replace(s[0],P),y?(m.regex.lastIndex+=l.length,m.regex.lastIndex-=s[0].length):m.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),e}nest(e,n,r={}){let i,s,l;const u=(c,h)=>{const p=this.nestingOptionsSeparator;if(!c.includes(p))return c;const y=c.split(new RegExp(`${Es(p)}[ ]*{`));let S=`{${y[1]}`;c=y[0],S=this.interpolate(S,l);const x=S.match(/'/g),m=S.match(/"/g);(((x==null?void 0:x.length)??0)%2===0&&!m||((m==null?void 0:m.length)??0)%2!==0)&&(S=S.replace(/'/g,'"'));try{l=JSON.parse(S),h&&(l={...h,...l})}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,C),`${c}${p}${S}`}return l.defaultValue&&l.defaultValue.includes(this.prefix)&&delete l.defaultValue,c};for(;i=this.nestingRegexp.exec(e);){let c=[];l={...r},l=l.replace&&!me(l.replace)?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;const h=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(h!==-1&&(c=i[1].slice(h).split(this.formatSeparator).map(p=>p.trim()).filter(Boolean),i[1]=i[1].slice(0,h)),s=n(u.call(this,i[1].trim(),l),l),s&&i[0]===e&&!me(s))return s;me(s)||(s=Vv(s)),s||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),s=""),c.length&&(s=c.reduce((p,y)=>this.format(p,y,r.lng,{...r,interpolationkey:i[1].trim()}),s.trim())),e=e.replace(i[0],s),this.regexp.lastIndex=0}return e}}const tk=t=>{let e=t.toLowerCase().trim();const n={};if(t.includes("(")){const r=t.split("(");e=r[0].toLowerCase().trim();const i=r[1].slice(0,-1);e==="currency"&&!i.includes(":")?n.currency||(n.currency=i.trim()):e==="relativetime"&&!i.includes(":")?n.range||(n.range=i.trim()):i.split(";").forEach(l=>{if(l){const[u,...c]=l.split(":"),h=c.join(":").trim().replace(/^'+|'+$/g,""),p=u.trim();n[p]||(n[p]=h),h==="false"&&(n[p]=!1),h==="true"&&(n[p]=!0),isNaN(h)||(n[p]=parseInt(h,10))}})}return{formatName:e,formatOptions:n}},e4=t=>{const e={};return(n,r,i)=>{let s=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(s={...s,[i.interpolationkey]:void 0});const l=r+JSON.stringify(s);let u=e[l];return u||(u=t(su(r),i),e[l]=u),u(n)}},nk=t=>(e,n,r)=>t(su(n),r)(e);class rk{constructor(e={}){this.logger=Ar.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?e4:nk;this.formats={number:r((i,s)=>{const l=new Intl.NumberFormat(i,{...s});return u=>l.format(u)}),currency:r((i,s)=>{const l=new Intl.NumberFormat(i,{...s,style:"currency"});return u=>l.format(u)}),datetime:r((i,s)=>{const l=new Intl.DateTimeFormat(i,{...s});return u=>l.format(u)}),relativetime:r((i,s)=>{const l=new Intl.RelativeTimeFormat(i,{...s});return u=>l.format(u,s.range||"day")}),list:r((i,s)=>{const l=new Intl.ListFormat(i,{...s});return u=>l.format(u)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=e4(n)}format(e,n,r,i={}){if(!n||e==null)return e;const s=n.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&!s[0].includes(")")&&s.find(u=>u.includes(")"))){const u=s.findIndex(c=>c.includes(")"));s[0]=[s[0],...s.splice(1,u)].join(this.formatSeparator)}return s.reduce((u,c)=>{var y;const{formatName:h,formatOptions:p}=tk(c);if(this.formats[h]){let S=u;try{const x=((y=i==null?void 0:i.formatParams)==null?void 0:y[i.interpolationkey])||{},m=x.locale||x.lng||i.locale||i.lng||r;S=this.formats[h](u,m,{...p,...i,...x})}catch(x){this.logger.warn(x)}return S}else this.logger.warn(`there was no format function for ${h}`);return u},e)}}const ik=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class sk extends ph{constructor(e,n,r,i={}){var s,l;super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=Ar.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(l=(s=this.backend)==null?void 0:s.init)==null||l.call(s,r,i.backend,i)}queueLoad(e,n,r,i){const s={},l={},u={},c={};return e.forEach(h=>{let p=!0;n.forEach(y=>{const S=`${h}|${y}`;!r.reload&&this.store.hasResourceBundle(h,y)?this.state[S]=2:this.state[S]<0||(this.state[S]===1?l[S]===void 0&&(l[S]=!0):(this.state[S]=1,p=!1,l[S]===void 0&&(l[S]=!0),s[S]===void 0&&(s[S]=!0),c[y]===void 0&&(c[y]=!0)))}),p||(u[h]=!0)}),(Object.keys(s).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(l),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const i=e.split("|"),s=i[0],l=i[1];n&&this.emit("failedLoading",s,l,n),!n&&r&&this.store.addResourceBundle(s,l,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const u={};this.queue.forEach(c=>{VC(c.loaded,[s],l),ik(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(h=>{u[h]||(u[h]={});const p=c.loaded[h];p.length&&p.forEach(y=>{u[h][y]===void 0&&(u[h][y]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(c=>!c.done)}read(e,n,r,i=0,s=this.retryTimeout,l){if(!e.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:i,wait:s,callback:l});return}this.readingCalls++;const u=(h,p)=>{if(this.readingCalls--,this.waitingReads.length>0){const y=this.waitingReads.shift();this.read(y.lng,y.ns,y.fcName,y.tried,y.wait,y.callback)}if(h&&p&&i<this.maxRetries){setTimeout(()=>{this.read(e,n,r,i+1,s*2,l)},s);return}l(h,p)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const h=c(e,n);h&&typeof h.then=="function"?h.then(p=>u(null,p)).catch(u):u(null,h)}catch(h){u(h)}return}return c(e,n,u)}prepareLoading(e,n,r={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();me(e)&&(e=this.languageUtils.toResolveHierarchy(e)),me(n)&&(n=[n]);const s=this.queueLoad(e,n,r,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.toLoad.forEach(l=>{this.loadOne(l)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e,n=""){const r=e.split("|"),i=r[0],s=r[1];this.read(i,s,"read",void 0,void 0,(l,u)=>{l&&this.logger.warn(`${n}loading namespace ${s} for language ${i} failed`,l),!l&&u&&this.logger.log(`${n}loaded namespace ${s} for language ${i}`,u),this.loaded(e,l,u)})}saveMissing(e,n,r,i,s,l={},u=()=>{}){var c,h,p,y,S;if((h=(c=this.services)==null?void 0:c.utils)!=null&&h.hasLoadedNamespace&&!((y=(p=this.services)==null?void 0:p.utils)!=null&&y.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((S=this.backend)!=null&&S.create){const x={...l,isUpdate:s},m=this.backend.create.bind(this.backend);if(m.length<6)try{let C;m.length===5?C=m(e,n,r,i,x):C=m(e,n,r,i),C&&typeof C.then=="function"?C.then(P=>u(null,P)).catch(u):u(null,C)}catch(C){u(C)}else m(e,n,r,i,u,x)}!e||!e[0]||this.store.addResource(e[0],n,r,i)}}}const o0=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),me(t[1])&&(e.defaultValue=t[1]),me(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),t4=t=>(me(t.ns)&&(t.ns=[t.ns]),me(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),me(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),Gc=()=>{},ok=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class Dl extends ph{constructor(e={},n){if(super(),this.options=t4(e),this.services={},this.logger=Ar,this.modules={external:[]},ok(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(me(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const r=o0();this.options={...r,...this.options,...t4(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler);const i=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?Ar.init(i(this.modules.logger),this.options):Ar.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=rk;const p=new qv(this.options);this.store=new Qv(this.options.resources,this.options);const y=this.services;y.logger=Ar,y.resourceStore=this.store,y.languageUtils=p,y.pluralResolver=new ek(p,{prepend:this.options.pluralSeparator}),h&&(y.formatter=i(h),y.formatter.init&&y.formatter.init(y,this.options),this.options.interpolation.format=y.formatter.format.bind(y.formatter)),y.interpolator=new Zv(this.options),y.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},y.backendConnector=new sk(i(this.modules.backend),y.resourceStore,y,this.options),y.backendConnector.on("*",(S,...x)=>{this.emit(S,...x)}),this.modules.languageDetector&&(y.languageDetector=i(this.modules.languageDetector),y.languageDetector.init&&y.languageDetector.init(y,this.options.detection,this.options)),this.modules.i18nFormat&&(y.i18nFormat=i(this.modules.i18nFormat),y.i18nFormat.init&&y.i18nFormat.init(this)),this.translator=new Hd(this.services,this.options),this.translator.on("*",(S,...x)=>{this.emit(S,...x)}),this.modules.external.forEach(S=>{S.init&&S.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Gc),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=(...p)=>this.store[h](...p)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=(...p)=>(this.store[h](...p),this)});const u=pl(),c=()=>{const h=(p,y)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(y),n(p,y)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),u}loadResources(e,n=Gc){var s,l;let r=n;const i=me(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const u=[],c=h=>{if(!h||h==="cimode")return;this.services.languageUtils.toResolveHierarchy(h).forEach(y=>{y!=="cimode"&&(u.includes(y)||u.push(y))})};i?c(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(p=>c(p)),(l=(s=this.options.preload)==null?void 0:s.forEach)==null||l.call(s,h=>c(h)),this.services.backendConnector.load(u,this.options.ns,h=>{!h&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(h)})}else r(null)}reloadResources(e,n,r){const i=pl();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=Gc),this.services.backendConnector.reload(e,n,s=>{i.resolve(),r(s)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&p8.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!["cimode","dev"].includes(e)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!["cimode","dev"].includes(r)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const r=pl();this.emit("languageChanging",e);const i=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},s=(u,c)=>{c?this.isLanguageChangingTo===e&&(i(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,r.resolve((...h)=>this.t(...h)),n&&n(u,(...h)=>this.t(...h))},l=u=>{var p,y;!e&&!u&&this.services.languageDetector&&(u=[]);const c=me(u)?u:u&&u[0],h=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(me(u)?[u]:u);h&&(this.language||i(h),this.translator.language||this.translator.changeLanguage(h),(y=(p=this.services.languageDetector)==null?void 0:p.cacheUserLanguage)==null||y.call(p,h)),this.loadResources(h,S=>{s(S,h)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(e),r}getFixedT(e,n,r){const i=(s,l,...u)=>{let c;typeof l!="object"?c=this.options.overloadTranslationOptionHandler([s,l].concat(u)):c={...l},c.lng=c.lng||i.lng,c.lngs=c.lngs||i.lngs,c.ns=c.ns||i.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||i.keyPrefix);const h={...this.options,...c};typeof c.keyPrefix=="function"&&(c.keyPrefix=ta(c.keyPrefix,h));const p=this.options.keySeparator||".";let y;return c.keyPrefix&&Array.isArray(s)?y=s.map(S=>(typeof S=="function"&&(S=ta(S,h)),`${c.keyPrefix}${p}${S}`)):(typeof s=="function"&&(s=ta(s,h)),y=c.keyPrefix?`${c.keyPrefix}${p}${s}`:s),this.t(y,c)};return me(e)?i.lng=e:i.lngs=e,i.ns=n,i.keyPrefix=r,i}t(...e){var n;return(n=this.translator)==null?void 0:n.translate(...e)}exists(...e){var n;return(n=this.translator)==null?void 0:n.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(u,c)=>{const h=this.services.backendConnector.state[`${u}|${c}`];return h===-1||h===0||h===2};if(n.precheck){const u=n.precheck(this,l);if(u!==void 0)return u}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,e)&&(!i||l(s,e)))}loadNamespaces(e,n){const r=pl();return this.options.ns?(me(e)&&(e=[e]),e.forEach(i=>{this.options.ns.includes(i)||this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=pl();me(e)&&(e=[e]);const i=this.options.preload||[],s=e.filter(l=>!i.includes(l)&&this.services.languageUtils.isSupportedCode(l));return s.length?(this.options.preload=i.concat(s),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(e){var i,s;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const l=new Intl.Locale(e);if(l&&l.getTextInfo){const u=l.getTextInfo();if(u&&u.direction)return u.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((s=this.services)==null?void 0:s.languageUtils)||new qv(o0());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(r.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){const r=new Dl(e,n);return r.createInstance=Dl.createInstance,r}cloneInstance(e={},n=Gc){const r=e.forkResourceStore;r&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},s=new Dl(i);if((e.debug!==void 0||e.prefix!==void 0)&&(s.logger=s.logger.clone(e)),["store","services","language"].forEach(u=>{s[u]=this[u]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r){const u=Object.keys(this.store.data).reduce((c,h)=>(c[h]={...this.store.data[h]},c[h]=Object.keys(c[h]).reduce((p,y)=>(p[y]={...c[h][y]},p),c[h]),c),{});s.store=new Qv(u,i),s.services.resourceStore=s.store}if(e.interpolation){const c={...o0().interpolation,...this.options.interpolation,...e.interpolation},h={...i,interpolation:c};s.services.interpolator=new Zv(h)}return s.translator=new Hd(s.services,i),s.translator.on("*",(u,...c)=>{s.emit(u,...c)}),s.init(i,n),s.translator.options=i,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const un=Dl.createInstance();un.createInstance;un.dir;un.init;un.loadResources;un.reloadResources;un.use;un.changeLanguage;un.getFixedT;un.t;un.exists;un.setDefaultNamespace;un.hasLoadedNamespace;un.loadNamespaces;un.loadLanguages;const ak=(t,e,n,r)=>{var s,l,u,c;const i=[n,{code:e,...r||{}}];if((l=(s=t==null?void 0:t.services)==null?void 0:s.logger)!=null&&l.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);to(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(c=(u=t==null?void 0:t.services)==null?void 0:u.logger)!=null&&c.warn?t.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},n4={},Ag=(t,e,n,r)=>{to(n)&&n4[n]||(to(n)&&(n4[n]=new Date),ak(t,e,n,r))},m8=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},Mg=(t,e,n)=>{t.loadNamespaces(e,m8(t,n))},r4=(t,e,n,r)=>{if(to(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return Mg(t,n,r);n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,m8(t,r))},lk=(t,e,n={})=>!e.languages||!e.languages.length?(Ag(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,t))return!1}}),to=t=>typeof t=="string",uk=t=>typeof t=="object"&&t!==null,ck=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,dk={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},hk=t=>dk[t],fk=t=>t.replace(ck,hk);let Ig={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:fk,transDefaultProps:void 0};const pk=(t={})=>{Ig={...Ig,...t}},gk=()=>Ig;let y8;const mk=t=>{y8=t},yk=()=>y8,vk={type:"3rdParty",init(t){pk(t.options.react),mk(t)}},Sk=V.createContext();class xk{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var v8={exports:{}},S8={};/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var wa=V;function wk(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var _k=typeof Object.is=="function"?Object.is:wk,Ck=wa.useState,kk=wa.useEffect,Ek=wa.useLayoutEffect,Pk=wa.useDebugValue;function Nk(t,e){var n=e(),r=Ck({inst:{value:n,getSnapshot:e}}),i=r[0].inst,s=r[1];return Ek(function(){i.value=n,i.getSnapshot=e,a0(i)&&s({inst:i})},[t,n,e]),kk(function(){return a0(i)&&s({inst:i}),t(function(){a0(i)&&s({inst:i})})},[t]),Pk(n),n}function a0(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!_k(t,n)}catch{return!0}}function Rk(t,e){return e()}var Tk=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Rk:Nk;S8.useSyncExternalStore=wa.useSyncExternalStore!==void 0?wa.useSyncExternalStore:Tk;v8.exports=S8;var x8=v8.exports;const Ok=(t,e)=>{if(to(e))return e;if(uk(e)&&to(e.defaultValue))return e.defaultValue;if(typeof t=="function")return"";if(Array.isArray(t)){const n=t[t.length-1];return typeof n=="function"?"":n}return t},bk={t:Ok,ready:!1},Lk=()=>()=>{},nm=(t,e={})=>{var I,L,H;const{i18n:n}=e,{i18n:r,defaultNS:i}=V.useContext(Sk)||{},s=n||r||yk();s&&!s.reportNamespaces&&(s.reportNamespaces=new xk),s||Ag(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const l=V.useMemo(()=>{var B;return{...gk(),...(B=s==null?void 0:s.options)==null?void 0:B.react,...e}},[s,e]),{useSuspense:u,keyPrefix:c}=l,h=i||((I=s==null?void 0:s.options)==null?void 0:I.defaultNS),p=to(h)?[h]:h||["translation"],y=V.useMemo(()=>p,p);(H=(L=s==null?void 0:s.reportNamespaces)==null?void 0:L.addUsedNamespaces)==null||H.call(L,y);const S=V.useRef(0),x=V.useCallback(B=>{if(!s)return Lk;const{bindI18n:$,bindI18nStore:q}=l,Q=()=>{S.current+=1,B()};return $&&s.on($,Q),q&&s.store.on(q,Q),()=>{$&&$.split(" ").forEach(re=>s.off(re,Q)),q&&q.split(" ").forEach(re=>s.store.off(re,Q))}},[s,l]),m=V.useRef(),C=V.useCallback(()=>{if(!s)return bk;const B=!!(s.isInitialized||s.initializedStoreOnce)&&y.every(W=>lk(W,s,l)),$=e.lng||s.language,q=S.current,Q=m.current;if(Q&&Q.ready===B&&Q.lng===$&&Q.keyPrefix===c&&Q.revision===q)return Q;const he={t:s.getFixedT($,l.nsMode==="fallback"?y:y[0],c),ready:B,lng:$,keyPrefix:c,revision:q};return m.current=he,he},[s,y,c,l,e.lng]),[P,E]=V.useState(0),{t:k,ready:v}=x8.useSyncExternalStore(x,C,C);V.useEffect(()=>{if(s&&!v&&!u){const B=()=>E($=>$+1);e.lng?r4(s,e.lng,y,B):Mg(s,y,B)}},[s,e.lng,y,v,u,P]);const _=s||{},R=V.useRef(null),b=V.useRef(),A=B=>{const $=Object.getOwnPropertyDescriptors(B);$.__original&&delete $.__original;const q=Object.create(Object.getPrototypeOf(B),$);if(!Object.prototype.hasOwnProperty.call(q,"__original"))try{Object.defineProperty(q,"__original",{value:B,writable:!1,enumerable:!1,configurable:!1})}catch{}return q},O=V.useMemo(()=>{const B=_,$=B==null?void 0:B.language;let q=B;B&&(R.current&&R.current.__original===B?b.current!==$?(q=A(B),R.current=q,b.current=$):q=R.current:(q=A(B),R.current=q,b.current=$));const Q=!v&&!u?(...he)=>(Ag(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),k(...he)):k,re=[Q,q,v];return re.t=Q,re.i18n=q,re.ready=v,re},[k,_,v,_.resolvedLanguage,_.language,_.languages]);if(s&&u&&!v)throw new Promise(B=>{const $=()=>B();e.lng?r4(s,e.lng,y,$):Mg(s,y,$)});return O},Fk={},i4=t=>{let e;const n=new Set,r=(p,y)=>{const S=typeof p=="function"?p(e):p;if(!Object.is(S,e)){const x=e;e=y??(typeof S!="object"||S===null)?S:Object.assign({},e,S),n.forEach(m=>m(e,x))}},i=()=>e,c={setState:r,getState:i,getInitialState:()=>h,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(Fk?"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()}},h=e=t(r,i,c);return c},Ak=t=>t?i4(t):i4;var w8={exports:{}},_8={};/**
* @license React
* use-sync-external-store-shim/with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var gh=V,Mk=x8;function Ik(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Dk=typeof Object.is=="function"?Object.is:Ik,jk=Mk.useSyncExternalStore,Uk=gh.useRef,zk=gh.useEffect,Bk=gh.useMemo,Gk=gh.useDebugValue;_8.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var s=Uk(null);if(s.current===null){var l={hasValue:!1,value:null};s.current=l}else l=s.current;s=Bk(function(){function c(x){if(!h){if(h=!0,p=x,x=r(x),i!==void 0&&l.hasValue){var m=l.value;if(i(m,x))return y=m}return y=x}if(m=y,Dk(p,x))return m;var C=r(x);return i!==void 0&&i(m,C)?(p=x,m):(p=x,y=C)}var h=!1,p,y,S=n===void 0?null:n;return[function(){return c(e())},S===null?void 0:function(){return c(S())}]},[e,n,r,i]);var u=jk(t,s[0],s[1]);return zk(function(){l.hasValue=!0,l.value=u},[u]),Gk(u),u};w8.exports=_8;var Hk=w8.exports;const Vk=Yd(Hk),C8={},{useDebugValue:Wk}=Mt,{useSyncExternalStoreWithSelector:Kk}=Vk;let s4=!1;const $k=t=>t;function Qk(t,e=$k,n){(C8?"production":void 0)!=="production"&&n&&!s4&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),s4=!0);const r=Kk(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return Wk(r),r}const o4=t=>{(C8?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?Ak(t):t,n=(r,i)=>Qk(e,r,i);return Object.assign(n,e),n},rm=t=>t?o4(t):o4;function k8(t,e){return function(){return t.apply(e,arguments)}}const{toString:qk}=Object.prototype,{getPrototypeOf:im}=Object,{iterator:mh,toStringTag:E8}=Symbol,yh=(t=>e=>{const n=qk.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),mr=t=>(t=t.toLowerCase(),e=>yh(e)===t),vh=t=>e=>typeof e===t,{isArray:ba}=Array,_a=vh("undefined");function wu(t){return t!==null&&!_a(t)&&t.constructor!==null&&!_a(t.constructor)&&Cn(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const P8=mr("ArrayBuffer");function Yk(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&P8(t.buffer),e}const Xk=vh("string"),Cn=vh("function"),N8=vh("number"),_u=t=>t!==null&&typeof t=="object",Jk=t=>t===!0||t===!1,ud=t=>{if(yh(t)!=="object")return!1;const e=im(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(E8 in t)&&!(mh in t)},Zk=t=>{if(!_u(t)||wu(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},eE=mr("Date"),tE=mr("File"),nE=t=>!!(t&&typeof t.uri<"u"),rE=t=>t&&typeof t.getParts<"u",iE=mr("Blob"),sE=mr("FileList"),oE=t=>_u(t)&&Cn(t.pipe);function aE(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const a4=aE(),l4=typeof a4.FormData<"u"?a4.FormData:void 0,lE=t=>{let e;return t&&(l4&&t instanceof l4||Cn(t.append)&&((e=yh(t))==="formdata"||e==="object"&&Cn(t.toString)&&t.toString()==="[object FormData]"))},uE=mr("URLSearchParams"),[cE,dE,hE,fE]=["ReadableStream","Request","Response","Headers"].map(mr),pE=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Cu(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),ba(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{if(wu(t))return;const s=n?Object.getOwnPropertyNames(t):Object.keys(t),l=s.length;let u;for(r=0;r<l;r++)u=s[r],e.call(null,t[u],u,t)}}function R8(t,e){if(wu(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const As=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,T8=t=>!_a(t)&&t!==As;function Dg(){const{caseless:t,skipUndefined:e}=T8(this)&&this||{},n={},r=(i,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const l=t&&R8(n,s)||s;ud(n[l])&&ud(i)?n[l]=Dg(n[l],i):ud(i)?n[l]=Dg({},i):ba(i)?n[l]=i.slice():(!e||!_a(i))&&(n[l]=i)};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&Cu(arguments[i],r);return n}const gE=(t,e,n,{allOwnKeys:r}={})=>(Cu(e,(i,s)=>{n&&Cn(i)?Object.defineProperty(t,s,{value:k8(i,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,s,{value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),mE=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),yE=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},vE=(t,e,n,r)=>{let i,s,l;const u={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)l=i[s],(!r||r(l,t,e))&&!u[l]&&(e[l]=t[l],u[l]=!0);t=n!==!1&&im(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},SE=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},xE=t=>{if(!t)return null;if(ba(t))return t;let e=t.length;if(!N8(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},wE=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&im(Uint8Array)),_E=(t,e)=>{const r=(t&&t[mh]).call(t);let i;for(;(i=r.next())&&!i.done;){const s=i.value;e.call(t,s[0],s[1])}},CE=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},kE=mr("HTMLFormElement"),EE=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),u4=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),PE=mr("RegExp"),O8=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Cu(n,(i,s)=>{let l;(l=e(i,s,t))!==!1&&(r[s]=l||i)}),Object.defineProperties(t,r)},NE=t=>{O8(t,(e,n)=>{if(Cn(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Cn(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},RE=(t,e)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return ba(t)?r(t):r(String(t).split(e)),n},TE=()=>{},OE=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function bE(t){return!!(t&&Cn(t.append)&&t[E8]==="FormData"&&t[mh])}const LE=t=>{const e=new Array(10),n=(r,i)=>{if(_u(r)){if(e.indexOf(r)>=0)return;if(wu(r))return r;if(!("toJSON"in r)){e[i]=r;const s=ba(r)?[]:{};return Cu(r,(l,u)=>{const c=n(l,i+1);!_a(c)&&(s[u]=c)}),e[i]=void 0,s}}return r};return n(t,0)},FE=mr("AsyncFunction"),AE=t=>t&&(_u(t)||Cn(t))&&Cn(t.then)&&Cn(t.catch),b8=((t,e)=>t?setImmediate:e?((n,r)=>(As.addEventListener("message",({source:i,data:s})=>{i===As&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),As.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Cn(As.postMessage)),ME=typeof queueMicrotask<"u"?queueMicrotask.bind(As):typeof process<"u"&&process.nextTick||b8,IE=t=>t!=null&&Cn(t[mh]),z={isArray:ba,isArrayBuffer:P8,isBuffer:wu,isFormData:lE,isArrayBufferView:Yk,isString:Xk,isNumber:N8,isBoolean:Jk,isObject:_u,isPlainObject:ud,isEmptyObject:Zk,isReadableStream:cE,isRequest:dE,isResponse:hE,isHeaders:fE,isUndefined:_a,isDate:eE,isFile:tE,isReactNativeBlob:nE,isReactNative:rE,isBlob:iE,isRegExp:PE,isFunction:Cn,isStream:oE,isURLSearchParams:uE,isTypedArray:wE,isFileList:sE,forEach:Cu,merge:Dg,extend:gE,trim:pE,stripBOM:mE,inherits:yE,toFlatObject:vE,kindOf:yh,kindOfTest:mr,endsWith:SE,toArray:xE,forEachEntry:_E,matchAll:CE,isHTMLForm:kE,hasOwnProperty:u4,hasOwnProp:u4,reduceDescriptors:O8,freezeMethods:NE,toObjectSet:RE,toCamelCase:EE,noop:TE,toFiniteNumber:OE,findKey:R8,global:As,isContextDefined:T8,isSpecCompliantForm:bE,toJSONObject:LE,isAsyncFn:FE,isThenable:AE,setImmediate:b8,asap:ME,isIterable:IE};let pe=class L8 extends Error{static from(e,n,r,i,s,l){const u=new L8(e.message,n||e.code,r,i,s);return u.cause=e,u.name=e.name,e.status!=null&&u.status==null&&(u.status=e.status),l&&Object.assign(u,l),u}constructor(e,n,r,i,s){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),i&&(this.request=i),s&&(this.response=s,this.status=s.status)}toJSON(){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:z.toJSONObject(this.config),code:this.code,status:this.status}}};pe.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";pe.ERR_BAD_OPTION="ERR_BAD_OPTION";pe.ECONNABORTED="ECONNABORTED";pe.ETIMEDOUT="ETIMEDOUT";pe.ERR_NETWORK="ERR_NETWORK";pe.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";pe.ERR_DEPRECATED="ERR_DEPRECATED";pe.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";pe.ERR_BAD_REQUEST="ERR_BAD_REQUEST";pe.ERR_CANCELED="ERR_CANCELED";pe.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";pe.ERR_INVALID_URL="ERR_INVALID_URL";const DE=null;function jg(t){return z.isPlainObject(t)||z.isArray(t)}function F8(t){return z.endsWith(t,"[]")?t.slice(0,-2):t}function l0(t,e,n){return t?t.concat(e).map(function(i,s){return i=F8(i),!n&&s?"["+i+"]":i}).join(n?".":""):e}function jE(t){return z.isArray(t)&&!t.some(jg)}const UE=z.toFlatObject(z,{},null,function(e){return/^is[A-Z]/.test(e)});function Sh(t,e,n){if(!z.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=z.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,P){return!z.isUndefined(P[C])});const r=n.metaTokens,i=n.visitor||p,s=n.dots,l=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&z.isSpecCompliantForm(e);if(!z.isFunction(i))throw new TypeError("visitor must be a function");function h(m){if(m===null)return"";if(z.isDate(m))return m.toISOString();if(z.isBoolean(m))return m.toString();if(!c&&z.isBlob(m))throw new pe("Blob is not supported. Use a Buffer instead.");return z.isArrayBuffer(m)||z.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function p(m,C,P){let E=m;if(z.isReactNative(e)&&z.isReactNativeBlob(m))return e.append(l0(P,C,s),h(m)),!1;if(m&&!P&&typeof m=="object"){if(z.endsWith(C,"{}"))C=r?C:C.slice(0,-2),m=JSON.stringify(m);else if(z.isArray(m)&&jE(m)||(z.isFileList(m)||z.endsWith(C,"[]"))&&(E=z.toArray(m)))return C=F8(C),E.forEach(function(v,_){!(z.isUndefined(v)||v===null)&&e.append(l===!0?l0([C],_,s):l===null?C:C+"[]",h(v))}),!1}return jg(m)?!0:(e.append(l0(P,C,s),h(m)),!1)}const y=[],S=Object.assign(UE,{defaultVisitor:p,convertValue:h,isVisitable:jg});function x(m,C){if(!z.isUndefined(m)){if(y.indexOf(m)!==-1)throw Error("Circular reference detected in "+C.join("."));y.push(m),z.forEach(m,function(E,k){(!(z.isUndefined(E)||E===null)&&i.call(e,E,z.isString(k)?k.trim():k,C,S))===!0&&x(E,C?C.concat(k):[k])}),y.pop()}}if(!z.isObject(t))throw new TypeError("data must be an object");return x(t),e}function c4(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function sm(t,e){this._pairs=[],t&&Sh(t,this,e)}const A8=sm.prototype;A8.append=function(e,n){this._pairs.push([e,n])};A8.toString=function(e){const n=e?function(r){return e.call(this,r,c4)}:c4;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function zE(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function M8(t,e,n){if(!e)return t;const r=n&&n.encode||zE,i=z.isFunction(n)?{serialize:n}:n,s=i&&i.serialize;let l;if(s?l=s(e,i):l=z.isURLSearchParams(e)?e.toString():new sm(e,i).toString(r),l){const u=t.indexOf("#");u!==-1&&(t=t.slice(0,u)),t+=(t.indexOf("?")===-1?"?":"&")+l}return t}class d4{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){z.forEach(this.handlers,function(r){r!==null&&e(r)})}}const om={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},BE=typeof URLSearchParams<"u"?URLSearchParams:sm,GE=typeof FormData<"u"?FormData:null,HE=typeof Blob<"u"?Blob:null,VE={isBrowser:!0,classes:{URLSearchParams:BE,FormData:GE,Blob:HE},protocols:["http","https","file","blob","url","data"]},am=typeof window<"u"&&typeof document<"u",Ug=typeof navigator=="object"&&navigator||void 0,WE=am&&(!Ug||["ReactNative","NativeScript","NS"].indexOf(Ug.product)<0),KE=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",$E=am&&window.location.href||"http://localhost",QE=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:am,hasStandardBrowserEnv:WE,hasStandardBrowserWebWorkerEnv:KE,navigator:Ug,origin:$E},Symbol.toStringTag,{value:"Module"})),Jt={...QE,...VE};function qE(t,e){return Sh(t,new Jt.classes.URLSearchParams,{visitor:function(n,r,i,s){return Jt.isNode&&z.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...e})}function YE(t){return z.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function XE(t){const e={},n=Object.keys(t);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],e[s]=t[s];return e}function I8(t){function e(n,r,i,s){let l=n[s++];if(l==="__proto__")return!0;const u=Number.isFinite(+l),c=s>=n.length;return l=!l&&z.isArray(i)?i.length:l,c?(z.hasOwnProp(i,l)?i[l]=[i[l],r]:i[l]=r,!u):((!i[l]||!z.isObject(i[l]))&&(i[l]=[]),e(n,r,i[l],s)&&z.isArray(i[l])&&(i[l]=XE(i[l])),!u)}if(z.isFormData(t)&&z.isFunction(t.entries)){const n={};return z.forEachEntry(t,(r,i)=>{e(YE(r),i,n,0)}),n}return null}function JE(t,e,n){if(z.isString(t))try{return(e||JSON.parse)(t),z.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const ku={transitional:om,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=z.isObject(e);if(s&&z.isHTMLForm(e)&&(e=new FormData(e)),z.isFormData(e))return i?JSON.stringify(I8(e)):e;if(z.isArrayBuffer(e)||z.isBuffer(e)||z.isStream(e)||z.isFile(e)||z.isBlob(e)||z.isReadableStream(e))return e;if(z.isArrayBufferView(e))return e.buffer;if(z.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let u;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return qE(e,this.formSerializer).toString();if((u=z.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Sh(u?{"files[]":e}:e,c&&new c,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),JE(e)):e}],transformResponse:[function(e){const n=this.transitional||ku.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(z.isResponse(e)||z.isReadableStream(e))return e;if(e&&z.isString(e)&&(r&&!this.responseType||i)){const l=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(u){if(l)throw u.name==="SyntaxError"?pe.from(u,pe.ERR_BAD_RESPONSE,this,null,this.response):u}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Jt.classes.FormData,Blob:Jt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};z.forEach(["delete","get","head","post","put","patch"],t=>{ku.headers[t]={}});const ZE=z.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"]),eP=t=>{const e={};let n,r,i;return t&&t.split(`
`).forEach(function(l){i=l.indexOf(":"),n=l.substring(0,i).trim().toLowerCase(),r=l.substring(i+1).trim(),!(!n||e[n]&&ZE[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},h4=Symbol("internals");function gl(t){return t&&String(t).trim().toLowerCase()}function cd(t){return t===!1||t==null?t:z.isArray(t)?t.map(cd):String(t).replace(/[\r\n]+$/,"")}function tP(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const nP=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function u0(t,e,n,r,i){if(z.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!z.isString(e)){if(z.isString(r))return e.indexOf(r)!==-1;if(z.isRegExp(r))return r.test(e)}}function rP(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function iP(t,e){const n=z.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,s,l){return this[r].call(this,e,i,s,l)},configurable:!0})})}let kn=class{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function s(u,c,h){const p=gl(c);if(!p)throw new Error("header name must be a non-empty string");const y=z.findKey(i,p);(!y||i[y]===void 0||h===!0||h===void 0&&i[y]!==!1)&&(i[y||c]=cd(u))}const l=(u,c)=>z.forEach(u,(h,p)=>s(h,p,c));if(z.isPlainObject(e)||e instanceof this.constructor)l(e,n);else if(z.isString(e)&&(e=e.trim())&&!nP(e))l(eP(e),n);else if(z.isObject(e)&&z.isIterable(e)){let u={},c,h;for(const p of e){if(!z.isArray(p))throw TypeError("Object iterator must return a key-value pair");u[h=p[0]]=(c=u[h])?z.isArray(c)?[...c,p[1]]:[c,p[1]]:p[1]}l(u,n)}else e!=null&&s(n,e,r);return this}get(e,n){if(e=gl(e),e){const r=z.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return tP(i);if(z.isFunction(n))return n.call(this,i,r);if(z.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=gl(e),e){const r=z.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||u0(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function s(l){if(l=gl(l),l){const u=z.findKey(r,l);u&&(!n||u0(r,r[u],u,n))&&(delete r[u],i=!0)}}return z.isArray(e)?e.forEach(s):s(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!e||u0(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const n=this,r={};return z.forEach(this,(i,s)=>{const l=z.findKey(r,s);if(l){n[l]=cd(i),delete n[s];return}const u=e?rP(s):String(s).trim();u!==s&&delete n[s],n[u]=cd(i),r[u]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return z.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&z.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[h4]=this[h4]={accessors:{}}).accessors,i=this.prototype;function s(l){const u=gl(l);r[u]||(iP(i,l),r[u]=!0)}return z.isArray(e)?e.forEach(s):s(e),this}};kn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);z.reduceDescriptors(kn.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});z.freezeMethods(kn);function c0(t,e){const n=this||ku,r=e||n,i=kn.from(r.headers);let s=r.data;return z.forEach(t,function(u){s=u.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function D8(t){return!!(t&&t.__CANCEL__)}let Eu=class extends pe{constructor(e,n,r){super(e??"canceled",pe.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function j8(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new pe("Request failed with status code "+n.status,[pe.ERR_BAD_REQUEST,pe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function sP(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function oP(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,s=0,l;return e=e!==void 0?e:1e3,function(c){const h=Date.now(),p=r[s];l||(l=h),n[i]=c,r[i]=h;let y=s,S=0;for(;y!==i;)S+=n[y++],y=y%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),h-l<e)return;const x=p&&h-p;return x?Math.round(S*1e3/x):void 0}}function aP(t,e){let n=0,r=1e3/e,i,s;const l=(h,p=Date.now())=>{n=p,i=null,s&&(clearTimeout(s),s=null),t(...h)};return[(...h)=>{const p=Date.now(),y=p-n;y>=r?l(h,p):(i=h,s||(s=setTimeout(()=>{s=null,l(i)},r-y)))},()=>i&&l(i)]}const Vd=(t,e,n=3)=>{let r=0;const i=oP(50,250);return aP(s=>{const l=s.loaded,u=s.lengthComputable?s.total:void 0,c=l-r,h=i(c),p=l<=u;r=l;const y={loaded:l,total:u,progress:u?l/u:void 0,bytes:c,rate:h||void 0,estimated:h&&u&&p?(u-l)/h:void 0,event:s,lengthComputable:u!=null,[e?"download":"upload"]:!0};t(y)},n)},f4=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},p4=t=>(...e)=>z.asap(()=>t(...e)),lP=Jt.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Jt.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Jt.origin),Jt.navigator&&/(msie|trident)/i.test(Jt.navigator.userAgent)):()=>!0,uP=Jt.hasStandardBrowserEnv?{write(t,e,n,r,i,s,l){if(typeof document>"u")return;const u=[`${t}=${encodeURIComponent(e)}`];z.isNumber(n)&&u.push(`expires=${new Date(n).toUTCString()}`),z.isString(r)&&u.push(`path=${r}`),z.isString(i)&&u.push(`domain=${i}`),s===!0&&u.push("secure"),z.isString(l)&&u.push(`SameSite=${l}`),document.cookie=u.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function cP(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function dP(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function U8(t,e,n){let r=!cP(e);return t&&(r||n==!1)?dP(t,e):e}const g4=t=>t instanceof kn?{...t}:t;function no(t,e){e=e||{};const n={};function r(h,p,y,S){return z.isPlainObject(h)&&z.isPlainObject(p)?z.merge.call({caseless:S},h,p):z.isPlainObject(p)?z.merge({},p):z.isArray(p)?p.slice():p}function i(h,p,y,S){if(z.isUndefined(p)){if(!z.isUndefined(h))return r(void 0,h,y,S)}else return r(h,p,y,S)}function s(h,p){if(!z.isUndefined(p))return r(void 0,p)}function l(h,p){if(z.isUndefined(p)){if(!z.isUndefined(h))return r(void 0,h)}else return r(void 0,p)}function u(h,p,y){if(y in e)return r(h,p);if(y in t)return r(void 0,h)}const c={url:s,method:s,data:s,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(h,p,y)=>i(g4(h),g4(p),y,!0)};return z.forEach(Object.keys({...t,...e}),function(p){if(p==="__proto__"||p==="constructor"||p==="prototype")return;const y=z.hasOwnProp(c,p)?c[p]:i,S=y(t[p],e[p],p);z.isUndefined(S)&&y!==u||(n[p]=S)}),n}const z8=t=>{const e=no({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:l,auth:u}=e;if(e.headers=l=kn.from(l),e.url=M8(U8(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),z.isFormData(n)){if(Jt.hasStandardBrowserEnv||Jt.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(z.isFunction(n.getHeaders)){const c=n.getHeaders(),h=["content-type","content-length"];Object.entries(c).forEach(([p,y])=>{h.includes(p.toLowerCase())&&l.set(p,y)})}}if(Jt.hasStandardBrowserEnv&&(r&&z.isFunction(r)&&(r=r(e)),r||r!==!1&&lP(e.url))){const c=i&&s&&uP.read(s);c&&l.set(i,c)}return e},hP=typeof XMLHttpRequest<"u",fP=hP&&function(t){return new Promise(function(n,r){const i=z8(t);let s=i.data;const l=kn.from(i.headers).normalize();let{responseType:u,onUploadProgress:c,onDownloadProgress:h}=i,p,y,S,x,m;function C(){x&&x(),m&&m(),i.cancelToken&&i.cancelToken.unsubscribe(p),i.signal&&i.signal.removeEventListener("abort",p)}let P=new XMLHttpRequest;P.open(i.method.toUpperCase(),i.url,!0),P.timeout=i.timeout;function E(){if(!P)return;const v=kn.from("getAllResponseHeaders"in P&&P.getAllResponseHeaders()),R={data:!u||u==="text"||u==="json"?P.responseText:P.response,status:P.status,statusText:P.statusText,headers:v,config:t,request:P};j8(function(A){n(A),C()},function(A){r(A),C()},R),P=null}"onloadend"in P?P.onloadend=E:P.onreadystatechange=function(){!P||P.readyState!==4||P.status===0&&!(P.responseURL&&P.responseURL.indexOf("file:")===0)||setTimeout(E)},P.onabort=function(){P&&(r(new pe("Request aborted",pe.ECONNABORTED,t,P)),P=null)},P.onerror=function(_){const R=_&&_.message?_.message:"Network Error",b=new pe(R,pe.ERR_NETWORK,t,P);b.event=_||null,r(b),P=null},P.ontimeout=function(){let _=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const R=i.transitional||om;i.timeoutErrorMessage&&(_=i.timeoutErrorMessage),r(new pe(_,R.clarifyTimeoutError?pe.ETIMEDOUT:pe.ECONNABORTED,t,P)),P=null},s===void 0&&l.setContentType(null),"setRequestHeader"in P&&z.forEach(l.toJSON(),function(_,R){P.setRequestHeader(R,_)}),z.isUndefined(i.withCredentials)||(P.withCredentials=!!i.withCredentials),u&&u!=="json"&&(P.responseType=i.responseType),h&&([S,m]=Vd(h,!0),P.addEventListener("progress",S)),c&&P.upload&&([y,x]=Vd(c),P.upload.addEventListener("progress",y),P.upload.addEventListener("loadend",x)),(i.cancelToken||i.signal)&&(p=v=>{P&&(r(!v||v.type?new Eu(null,t,P):v),P.abort(),P=null)},i.cancelToken&&i.cancelToken.subscribe(p),i.signal&&(i.signal.aborted?p():i.signal.addEventListener("abort",p)));const k=sP(i.url);if(k&&Jt.protocols.indexOf(k)===-1){r(new pe("Unsupported protocol "+k+":",pe.ERR_BAD_REQUEST,t));return}P.send(s||null)})},pP=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const s=function(h){if(!i){i=!0,u();const p=h instanceof Error?h:this.reason;r.abort(p instanceof pe?p:new Eu(p instanceof Error?p.message:p))}};let l=e&&setTimeout(()=>{l=null,s(new pe(`timeout of ${e}ms exceeded`,pe.ETIMEDOUT))},e);const u=()=>{t&&(l&&clearTimeout(l),l=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(s):h.removeEventListener("abort",s)}),t=null)};t.forEach(h=>h.addEventListener("abort",s));const{signal:c}=r;return c.unsubscribe=()=>z.asap(u),c}},gP=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},mP=async function*(t,e){for await(const n of yP(t))yield*gP(n,e)},yP=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},m4=(t,e,n,r)=>{const i=mP(t,e);let s=0,l,u=c=>{l||(l=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:h,value:p}=await i.next();if(h){u(),c.close();return}let y=p.byteLength;if(n){let S=s+=y;n(S)}c.enqueue(new Uint8Array(p))}catch(h){throw u(h),h}},cancel(c){return u(c),i.return()}},{highWaterMark:2})},y4=64*1024,{isFunction:Hc}=z,vP=(({Request:t,Response:e})=>({Request:t,Response:e}))(z.global),{ReadableStream:v4,TextEncoder:S4}=z.global,x4=(t,...e)=>{try{return!!t(...e)}catch{return!1}},SP=t=>{t=z.merge.call({skipUndefined:!0},vP,t);const{fetch:e,Request:n,Response:r}=t,i=e?Hc(e):typeof fetch=="function",s=Hc(n),l=Hc(r);if(!i)return!1;const u=i&&Hc(v4),c=i&&(typeof S4=="function"?(m=>C=>m.encode(C))(new S4):async m=>new Uint8Array(await new n(m).arrayBuffer())),h=s&&u&&x4(()=>{let m=!1;const C=new v4,P=new n(Jt.origin,{body:C,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return C.cancel(),m&&!P}),p=l&&u&&x4(()=>z.isReadableStream(new r("").body)),y={stream:p&&(m=>m.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!y[m]&&(y[m]=(C,P)=>{let E=C&&C[m];if(E)return E.call(C);throw new pe(`Response type '${m}' is not supported`,pe.ERR_NOT_SUPPORT,P)})});const S=async m=>{if(m==null)return 0;if(z.isBlob(m))return m.size;if(z.isSpecCompliantForm(m))return(await new n(Jt.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(z.isArrayBufferView(m)||z.isArrayBuffer(m))return m.byteLength;if(z.isURLSearchParams(m)&&(m=m+""),z.isString(m))return(await c(m)).byteLength},x=async(m,C)=>{const P=z.toFiniteNumber(m.getContentLength());return P??S(C)};return async m=>{let{url:C,method:P,data:E,signal:k,cancelToken:v,timeout:_,onDownloadProgress:R,onUploadProgress:b,responseType:A,headers:O,withCredentials:I="same-origin",fetchOptions:L}=z8(m),H=e||fetch;A=A?(A+"").toLowerCase():"text";let B=pP([k,v&&v.toAbortSignal()],_),$=null;const q=B&&B.unsubscribe&&(()=>{B.unsubscribe()});let Q;try{if(b&&h&&P!=="get"&&P!=="head"&&(Q=await x(O,E))!==0){let Y=new n(C,{method:"POST",body:E,duplex:"half"}),ie;if(z.isFormData(E)&&(ie=Y.headers.get("content-type"))&&O.setContentType(ie),Y.body){const[xe,Ke]=f4(Q,Vd(p4(b)));E=m4(Y.body,y4,xe,Ke)}}z.isString(I)||(I=I?"include":"omit");const re=s&&"credentials"in n.prototype,he={...L,signal:B,method:P.toUpperCase(),headers:O.normalize().toJSON(),body:E,duplex:"half",credentials:re?I:void 0};$=s&&new n(C,he);let W=await(s?H($,L):H(C,he));const te=p&&(A==="stream"||A==="response");if(p&&(R||te&&q)){const Y={};["status","statusText","headers"].forEach(it=>{Y[it]=W[it]});const ie=z.toFiniteNumber(W.headers.get("content-length")),[xe,Ke]=R&&f4(ie,Vd(p4(R),!0))||[];W=new r(m4(W.body,y4,xe,()=>{Ke&&Ke(),q&&q()}),Y)}A=A||"text";let Z=await y[z.findKey(y,A)||"text"](W,m);return!te&&q&&q(),await new Promise((Y,ie)=>{j8(Y,ie,{data:Z,headers:kn.from(W.headers),status:W.status,statusText:W.statusText,config:m,request:$})})}catch(re){throw q&&q(),re&&re.name==="TypeError"&&/Load failed|fetch/i.test(re.message)?Object.assign(new pe("Network Error",pe.ERR_NETWORK,m,$,re&&re.response),{cause:re.cause||re}):pe.from(re,re&&re.code,m,$,re&&re.response)}}},xP=new Map,B8=t=>{let e=t&&t.env||{};const{fetch:n,Request:r,Response:i}=e,s=[r,i,n];let l=s.length,u=l,c,h,p=xP;for(;u--;)c=s[u],h=p.get(c),h===void 0&&p.set(c,h=u?new Map:SP(e)),p=h;return h};B8();const lm={http:DE,xhr:fP,fetch:{get:B8}};z.forEach(lm,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const w4=t=>`- ${t}`,wP=t=>z.isFunction(t)||t===null||t===!1;function _P(t,e){t=z.isArray(t)?t:[t];const{length:n}=t;let r,i;const s={};for(let l=0;l<n;l++){r=t[l];let u;if(i=r,!wP(r)&&(i=lm[(u=String(r)).toLowerCase()],i===void 0))throw new pe(`Unknown adapter '${u}'`);if(i&&(z.isFunction(i)||(i=i.get(e))))break;s[u||"#"+l]=i}if(!i){const l=Object.entries(s).map(([c,h])=>`adapter ${c} `+(h===!1?"is not supported by the environment":"is not available in the build"));let u=n?l.length>1?`since :
`+l.map(w4).join(`
`):" "+w4(l[0]):"as no adapter specified";throw new pe("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return i}const G8={getAdapter:_P,adapters:lm};function d0(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Eu(null,t)}function _4(t){return d0(t),t.headers=kn.from(t.headers),t.data=c0.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),G8.getAdapter(t.adapter||ku.adapter,t)(t).then(function(r){return d0(t),r.data=c0.call(t,t.transformResponse,r),r.headers=kn.from(r.headers),r},function(r){return D8(r)||(d0(t),r&&r.response&&(r.response.data=c0.call(t,t.transformResponse,r.response),r.response.headers=kn.from(r.response.headers))),Promise.reject(r)})}const H8="1.14.0",xh={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{xh[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const C4={};xh.transitional=function(e,n,r){function i(s,l){return"[Axios v"+H8+"] Transitional option '"+s+"'"+l+(r?". "+r:"")}return(s,l,u)=>{if(e===!1)throw new pe(i(l," has been removed"+(n?" in "+n:"")),pe.ERR_DEPRECATED);return n&&!C4[l]&&(C4[l]=!0,console.warn(i(l," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,l,u):!0}};xh.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function CP(t,e,n){if(typeof t!="object")throw new pe("options must be an object",pe.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],l=e[s];if(l){const u=t[s],c=u===void 0||l(u,s,t);if(c!==!0)throw new pe("option "+s+" must be "+c,pe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new pe("Unknown option "+s,pe.ERR_BAD_OPTION)}}const dd={assertOptions:CP,validators:xh},Hn=dd.validators;let $s=class{constructor(e){this.defaults=e||{},this.interceptors={request:new d4,response:new d4}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=no(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&dd.assertOptions(r,{silentJSONParsing:Hn.transitional(Hn.boolean),forcedJSONParsing:Hn.transitional(Hn.boolean),clarifyTimeoutError:Hn.transitional(Hn.boolean),legacyInterceptorReqResOrdering:Hn.transitional(Hn.boolean)},!1),i!=null&&(z.isFunction(i)?n.paramsSerializer={serialize:i}:dd.assertOptions(i,{encode:Hn.function,serialize:Hn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),dd.assertOptions(n,{baseUrl:Hn.spelling("baseURL"),withXsrfToken:Hn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=s&&z.merge(s.common,s[n.method]);s&&z.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),n.headers=kn.concat(l,s);const u=[];let c=!0;this.interceptors.request.forEach(function(C){if(typeof C.runWhen=="function"&&C.runWhen(n)===!1)return;c=c&&C.synchronous;const P=n.transitional||om;P&&P.legacyInterceptorReqResOrdering?u.unshift(C.fulfilled,C.rejected):u.push(C.fulfilled,C.rejected)});const h=[];this.interceptors.response.forEach(function(C){h.push(C.fulfilled,C.rejected)});let p,y=0,S;if(!c){const m=[_4.bind(this),void 0];for(m.unshift(...u),m.push(...h),S=m.length,p=Promise.resolve(n);y<S;)p=p.then(m[y++],m[y++]);return p}S=u.length;let x=n;for(;y<S;){const m=u[y++],C=u[y++];try{x=m(x)}catch(P){C.call(this,P);break}}try{p=_4.call(this,x)}catch(m){return Promise.reject(m)}for(y=0,S=h.length;y<S;)p=p.then(h[y++],h[y++]);return p}getUri(e){e=no(this.defaults,e);const n=U8(e.baseURL,e.url,e.allowAbsoluteUrls);return M8(n,e.params,e.paramsSerializer)}};z.forEach(["delete","get","head","options"],function(e){$s.prototype[e]=function(n,r){return this.request(no(r||{},{method:e,url:n,data:(r||{}).data}))}});z.forEach(["post","put","patch"],function(e){function n(r){return function(s,l,u){return this.request(no(u||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:l}))}}$s.prototype[e]=n(),$s.prototype[e+"Form"]=n(!0)});let kP=class V8{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const l=new Promise(u=>{r.subscribe(u),s=u}).then(i);return l.cancel=function(){r.unsubscribe(s)},l},e(function(s,l,u){r.reason||(r.reason=new Eu(s,l,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new V8(function(i){e=i}),cancel:e}}};function EP(t){return function(n){return t.apply(null,n)}}function PP(t){return z.isObject(t)&&t.isAxiosError===!0}const zg={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(zg).forEach(([t,e])=>{zg[e]=t});function W8(t){const e=new $s(t),n=k8($s.prototype.request,e);return z.extend(n,$s.prototype,e,{allOwnKeys:!0}),z.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return W8(no(t,i))},n}const nt=W8(ku);nt.Axios=$s;nt.CanceledError=Eu;nt.CancelToken=kP;nt.isCancel=D8;nt.VERSION=H8;nt.toFormData=Sh;nt.AxiosError=pe;nt.Cancel=nt.CanceledError;nt.all=function(e){return Promise.all(e)};nt.spread=EP;nt.isAxiosError=PP;nt.mergeConfig=no;nt.AxiosHeaders=kn;nt.formToJSON=t=>I8(z.isHTMLForm(t)?new FormData(t):t);nt.getAdapter=G8.getAdapter;nt.HttpStatusCode=zg;nt.default=nt;const{Axios:CL,AxiosError:kL,CanceledError:EL,isCancel:PL,CancelToken:NL,VERSION:RL,all:TL,Cancel:OL,isAxiosError:bL,spread:LL,toFormData:FL,AxiosHeaders:AL,HttpStatusCode:ML,formToJSON:IL,getAdapter:DL,mergeConfig:jL}=nt,K8=rm(t=>({user:null,token:localStorage.getItem("creabook_token"),isAuthenticated:!!localStorage.getItem("creabook_token"),setAuth:(e,n)=>{localStorage.setItem("creabook_token",n),t({user:e,token:n,isAuthenticated:!0})},logout:async()=>{const e=localStorage.getItem("creabook_token");if(e)try{await nt.post("/api/auth/logout",{},{headers:{Authorization:`Bearer ${e}`}})}catch{}localStorage.removeItem("creabook_token"),t({user:null,token:null,isAuthenticated:!1})},checkAuth:async()=>{const e=localStorage.getItem("creabook_token");if(e)try{const n=await nt.get("/api/auth/me",{headers:{Authorization:`Bearer ${e}`}});t({user:n.data.user,token:e,isAuthenticated:!0})}catch{localStorage.removeItem("creabook_token"),t({user:null,token:null,isAuthenticated:!1})}}}));function NP({isOpen:t,onClose:e}){const[n,r]=V.useState(!0),[i,s]=V.useState(""),[l,u]=V.useState(""),[c,h]=V.useState(""),[p,y]=V.useState(""),[S,x]=V.useState(!1),{t:m}=nm(),{setAuth:C}=K8();if(!t)return null;const P=async E=>{var k,v;E.preventDefault(),y(""),x(!0);try{const _=n?"/api/auth/login":"/api/auth/register",R=n?{email:i,password:c}:{email:i,password:c,name:l},b=await nt.post(_,R);C(b.data.user,b.data.token),e()}catch(_){y(((v=(k=_.response)==null?void 0:k.data)==null?void 0:v.error)||"Authentication failed")}finally{x(!1)}};return N.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:N.jsxs("div",{className:"bg-white rounded-xl shadow-xl w-full max-w-md overflow-hidden relative",children:[N.jsx("button",{onClick:e,className:"absolute top-4 right-4 text-gray-400 flex items-center justify-center hover:bg-gray-100 rounded-lg p-2",children:N.jsx(BC,{size:20})}),N.jsxs("div",{className:"p-6",children:[N.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-6 text-center",children:m(n?"auth.welcomeBack":"auth.createAccount")}),p&&N.jsx("div",{className:"bg-red-50 text-red-600 p-3 rounded-lg mb-4 text-sm",children:p}),N.jsxs("form",{onSubmit:P,className:"space-y-4",children:[!n&&N.jsxs("div",{children:[N.jsx("label",{className:"label",children:m("auth.name")}),N.jsx("input",{type:"text",value:l,onChange:E=>u(E.target.value),className:"input",placeholder:m("auth.name")})]}),N.jsxs("div",{children:[N.jsx("label",{className:"label",children:m("auth.email")}),N.jsx("input",{type:"email",value:i,onChange:E=>s(E.target.value),required:!0,className:"input",placeholder:"you@example.com"})]}),N.jsxs("div",{children:[N.jsx("label",{className:"label",children:m("auth.password")}),N.jsx("input",{type:"password",value:c,onChange:E=>h(E.target.value),required:!0,className:"input",placeholder:"••••••••"})]}),N.jsx("button",{type:"submit",disabled:S,className:"btn-primary w-full py-2.5 mt-2",children:m(S?"auth.pleaseWait":n?"auth.login":"auth.signUp")})]}),N.jsxs("div",{className:"mt-6 text-center text-sm text-gray-500",children:[m(n?"auth.dontHaveAccount":"auth.alreadyHaveAccount"),N.jsx("button",{type:"button",onClick:()=>{r(!n),y("")},className:"text-primary-600 font-semibold hover:underline",children:m(n?"auth.signUp":"auth.login")})]})]})]})})}function RP({covers:t,onSelect:e,onDelete:n}){return t.length===0?N.jsxs("div",{className:"card text-center py-12",children:[N.jsx(tm,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),N.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"No covers yet"}),N.jsx("p",{className:"text-gray-500 mt-2",children:"Upload a cover image or generate one with AI to get started"})]}):N.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:t.map(r=>N.jsxs("div",{className:"card p-0 overflow-hidden group hover:shadow-lg transition-shadow",children:[N.jsxs("div",{className:"aspect-[2/3] relative bg-gray-100",children:[N.jsx("img",{src:r.url,alt:r.filename,className:"w-full h-full object-cover"}),N.jsxs("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2",children:[N.jsx("button",{onClick:()=>e(r.url),className:"p-2 bg-white rounded-lg hover:bg-gray-100 transition-colors",title:"Edit",children:N.jsx(FC,{className:"w-5 h-5 text-gray-700"})}),N.jsx("button",{onClick:()=>{const i=document.createElement("a");i.href=r.url,i.download=r.filename,i.click()},className:"p-2 bg-white rounded-lg hover:bg-gray-100 transition-colors",title:"Download",children:N.jsx(c8,{className:"w-5 h-5 text-gray-700"})}),N.jsx("button",{onClick:()=>n(r.id),className:"p-2 bg-red-500 rounded-lg hover:bg-red-600 transition-colors",title:"Delete",children:N.jsx(zC,{className:"w-5 h-5 text-white"})})]})]}),N.jsxs("div",{className:"p-3",children:[N.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:r.filename}),N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:new Date(r.createdAt).toLocaleDateString()})]})]},r.id))})}var $8={exports:{}},wh={},Wd={},ke={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t._registerNode=t.Konva=t.glob=void 0;const e=Math.PI/180;function n(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}t.glob=typeof py<"u"?py:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},t.Konva={_global:t.glob,version:"9.3.22",isBrowser:n(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return t.Konva.angleDeg?i*e:i},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return t.Konva.DD.isDragging},isTransforming(){var i;return(i=t.Konva.Transformer)===null||i===void 0?void 0:i.isTransforming()},isDragReady(){return!!t.Konva.DD.node},releaseCanvasOnDestroy:!0,document:t.glob.document,_injectGlobal(i){t.glob.Konva=i}};const r=i=>{t.Konva[i.prototype.getClassName()]=i};t._registerNode=r,t.Konva._injectGlobal(t.Konva)})(ke);var ct={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Util=t.Transform=void 0;const e=ke;class n{constructor(_=[1,0,0,1,0,0]){this.dirty=!1,this.m=_&&_.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new n(this.m)}copyInto(_){_.m[0]=this.m[0],_.m[1]=this.m[1],_.m[2]=this.m[2],_.m[3]=this.m[3],_.m[4]=this.m[4],_.m[5]=this.m[5]}point(_){const R=this.m;return{x:R[0]*_.x+R[2]*_.y+R[4],y:R[1]*_.x+R[3]*_.y+R[5]}}translate(_,R){return this.m[4]+=this.m[0]*_+this.m[2]*R,this.m[5]+=this.m[1]*_+this.m[3]*R,this}scale(_,R){return this.m[0]*=_,this.m[1]*=_,this.m[2]*=R,this.m[3]*=R,this}rotate(_){const R=Math.cos(_),b=Math.sin(_),A=this.m[0]*R+this.m[2]*b,O=this.m[1]*R+this.m[3]*b,I=this.m[0]*-b+this.m[2]*R,L=this.m[1]*-b+this.m[3]*R;return this.m[0]=A,this.m[1]=O,this.m[2]=I,this.m[3]=L,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(_,R){const b=this.m[0]+this.m[2]*R,A=this.m[1]+this.m[3]*R,O=this.m[2]+this.m[0]*_,I=this.m[3]+this.m[1]*_;return this.m[0]=b,this.m[1]=A,this.m[2]=O,this.m[3]=I,this}multiply(_){const R=this.m[0]*_.m[0]+this.m[2]*_.m[1],b=this.m[1]*_.m[0]+this.m[3]*_.m[1],A=this.m[0]*_.m[2]+this.m[2]*_.m[3],O=this.m[1]*_.m[2]+this.m[3]*_.m[3],I=this.m[0]*_.m[4]+this.m[2]*_.m[5]+this.m[4],L=this.m[1]*_.m[4]+this.m[3]*_.m[5]+this.m[5];return this.m[0]=R,this.m[1]=b,this.m[2]=A,this.m[3]=O,this.m[4]=I,this.m[5]=L,this}invert(){const _=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),R=this.m[3]*_,b=-this.m[1]*_,A=-this.m[2]*_,O=this.m[0]*_,I=_*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),L=_*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=R,this.m[1]=b,this.m[2]=A,this.m[3]=O,this.m[4]=I,this.m[5]=L,this}getMatrix(){return this.m}decompose(){const _=this.m[0],R=this.m[1],b=this.m[2],A=this.m[3],O=this.m[4],I=this.m[5],L=_*A-R*b,H={x:O,y:I,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(_!=0||R!=0){const B=Math.sqrt(_*_+R*R);H.rotation=R>0?Math.acos(_/B):-Math.acos(_/B),H.scaleX=B,H.scaleY=L/B,H.skewX=(_*b+R*A)/L,H.skewY=0}else if(b!=0||A!=0){const B=Math.sqrt(b*b+A*A);H.rotation=Math.PI/2-(A>0?Math.acos(-b/B):-Math.acos(b/B)),H.scaleX=L/B,H.scaleY=B,H.skewX=0,H.skewY=(_*b+R*A)/L}return H.rotation=t.Util._getRotation(H.rotation),H}}t.Transform=n;const r="[object Array]",i="[object Number]",s="[object String]",l="[object Boolean]",u=Math.PI/180,c=180/Math.PI,h="#",p="",y="0",S="Konva warning: ",x="Konva error: ",m="rgb(",C={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},P=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let E=[];const k=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(v){setTimeout(v,60)};t.Util={_isElement(v){return!!(v&&v.nodeType==1)},_isFunction(v){return!!(v&&v.constructor&&v.call&&v.apply)},_isPlainObject(v){return!!v&&v.constructor===Object},_isArray(v){return Object.prototype.toString.call(v)===r},_isNumber(v){return Object.prototype.toString.call(v)===i&&!isNaN(v)&&isFinite(v)},_isString(v){return Object.prototype.toString.call(v)===s},_isBoolean(v){return Object.prototype.toString.call(v)===l},isObject(v){return v instanceof Object},isValidSelector(v){if(typeof v!="string")return!1;const _=v[0];return _==="#"||_==="."||_===_.toUpperCase()},_sign(v){return v===0||v>0?1:-1},requestAnimFrame(v){E.push(v),E.length===1&&k(function(){const _=E;E=[],_.forEach(function(R){R()})})},createCanvasElement(){const v=document.createElement("canvas");try{v.style=v.style||{}}catch{}return v},createImageElement(){return document.createElement("img")},_isInDocument(v){for(;v=v.parentNode;)if(v==document)return!0;return!1},_urlToImage(v,_){const R=t.Util.createImageElement();R.onload=function(){_(R)},R.src=v},_rgbToHex(v,_,R){return((1<<24)+(v<<16)+(_<<8)+R).toString(16).slice(1)},_hexToRgb(v){v=v.replace(h,p);const _=parseInt(v,16);return{r:_>>16&255,g:_>>8&255,b:_&255}},getRandomColor(){let v=(Math.random()*16777215<<0).toString(16);for(;v.length<6;)v=y+v;return h+v},getRGB(v){let _;return v in C?(_=C[v],{r:_[0],g:_[1],b:_[2]}):v[0]===h?this._hexToRgb(v.substring(1)):v.substr(0,4)===m?(_=P.exec(v.replace(/ /g,"")),{r:parseInt(_[1],10),g:parseInt(_[2],10),b:parseInt(_[3],10)}):{r:0,g:0,b:0}},colorToRGBA(v){return v=v||"black",t.Util._namedColorToRBA(v)||t.Util._hex3ColorToRGBA(v)||t.Util._hex4ColorToRGBA(v)||t.Util._hex6ColorToRGBA(v)||t.Util._hex8ColorToRGBA(v)||t.Util._rgbColorToRGBA(v)||t.Util._rgbaColorToRGBA(v)||t.Util._hslColorToRGBA(v)},_namedColorToRBA(v){const _=C[v.toLowerCase()];return _?{r:_[0],g:_[1],b:_[2],a:1}:null},_rgbColorToRGBA(v){if(v.indexOf("rgb(")===0){v=v.match(/rgb\(([^)]+)\)/)[1];const _=v.split(/ *, */).map(Number);return{r:_[0],g:_[1],b:_[2],a:1}}},_rgbaColorToRGBA(v){if(v.indexOf("rgba(")===0){v=v.match(/rgba\(([^)]+)\)/)[1];const _=v.split(/ *, */).map((R,b)=>R.slice(-1)==="%"?b===3?parseInt(R)/100:parseInt(R)/100*255:Number(R));return{r:_[0],g:_[1],b:_[2],a:_[3]}}},_hex8ColorToRGBA(v){if(v[0]==="#"&&v.length===9)return{r:parseInt(v.slice(1,3),16),g:parseInt(v.slice(3,5),16),b:parseInt(v.slice(5,7),16),a:parseInt(v.slice(7,9),16)/255}},_hex6ColorToRGBA(v){if(v[0]==="#"&&v.length===7)return{r:parseInt(v.slice(1,3),16),g:parseInt(v.slice(3,5),16),b:parseInt(v.slice(5,7),16),a:1}},_hex4ColorToRGBA(v){if(v[0]==="#"&&v.length===5)return{r:parseInt(v[1]+v[1],16),g:parseInt(v[2]+v[2],16),b:parseInt(v[3]+v[3],16),a:parseInt(v[4]+v[4],16)/255}},_hex3ColorToRGBA(v){if(v[0]==="#"&&v.length===4)return{r:parseInt(v[1]+v[1],16),g:parseInt(v[2]+v[2],16),b:parseInt(v[3]+v[3],16),a:1}},_hslColorToRGBA(v){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(v)){const[_,...R]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(v),b=Number(R[0])/360,A=Number(R[1])/100,O=Number(R[2])/100;let I,L,H;if(A===0)return H=O*255,{r:Math.round(H),g:Math.round(H),b:Math.round(H),a:1};O<.5?I=O*(1+A):I=O+A-O*A;const B=2*O-I,$=[0,0,0];for(let q=0;q<3;q++)L=b+1/3*-(q-1),L<0&&L++,L>1&&L--,6*L<1?H=B+(I-B)*6*L:2*L<1?H=I:3*L<2?H=B+(I-B)*(2/3-L)*6:H=B,$[q]=H*255;return{r:Math.round($[0]),g:Math.round($[1]),b:Math.round($[2]),a:1}}},haveIntersection(v,_){return!(_.x>v.x+v.width||_.x+_.width<v.x||_.y>v.y+v.height||_.y+_.height<v.y)},cloneObject(v){const _={};for(const R in v)this._isPlainObject(v[R])?_[R]=this.cloneObject(v[R]):this._isArray(v[R])?_[R]=this.cloneArray(v[R]):_[R]=v[R];return _},cloneArray(v){return v.slice(0)},degToRad(v){return v*u},radToDeg(v){return v*c},_degToRad(v){return t.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),t.Util.degToRad(v)},_radToDeg(v){return t.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),t.Util.radToDeg(v)},_getRotation(v){return e.Konva.angleDeg?t.Util.radToDeg(v):v},_capitalize(v){return v.charAt(0).toUpperCase()+v.slice(1)},throw(v){throw new Error(x+v)},error(v){console.error(x+v)},warn(v){e.Konva.showWarnings&&console.warn(S+v)},each(v,_){for(const R in v)_(R,v[R])},_inRange(v,_,R){return _<=v&&v<R},_getProjectionToSegment(v,_,R,b,A,O){let I,L,H;const B=(v-R)*(v-R)+(_-b)*(_-b);if(B==0)I=v,L=_,H=(A-R)*(A-R)+(O-b)*(O-b);else{const $=((A-v)*(R-v)+(O-_)*(b-_))/B;$<0?(I=v,L=_,H=(v-A)*(v-A)+(_-O)*(_-O)):$>1?(I=R,L=b,H=(R-A)*(R-A)+(b-O)*(b-O)):(I=v+$*(R-v),L=_+$*(b-_),H=(I-A)*(I-A)+(L-O)*(L-O))}return[I,L,H]},_getProjectionToLine(v,_,R){const b=t.Util.cloneObject(v);let A=Number.MAX_VALUE;return _.forEach(function(O,I){if(!R&&I===_.length-1)return;const L=_[(I+1)%_.length],H=t.Util._getProjectionToSegment(O.x,O.y,L.x,L.y,v.x,v.y),B=H[0],$=H[1],q=H[2];q<A&&(b.x=B,b.y=$,A=q)}),b},_prepareArrayForTween(v,_,R){const b=[],A=[];if(v.length>_.length){const I=_;_=v,v=I}for(let I=0;I<v.length;I+=2)b.push({x:v[I],y:v[I+1]});for(let I=0;I<_.length;I+=2)A.push({x:_[I],y:_[I+1]});const O=[];return A.forEach(function(I){const L=t.Util._getProjectionToLine(I,b,R);O.push(L.x),O.push(L.y)}),O},_prepareToStringify(v){let _;v.visitedByCircularReferenceRemoval=!0;for(const R in v)if(v.hasOwnProperty(R)&&v[R]&&typeof v[R]=="object"){if(_=Object.getOwnPropertyDescriptor(v,R),v[R].visitedByCircularReferenceRemoval||t.Util._isElement(v[R]))if(_.configurable)delete v[R];else return null;else if(t.Util._prepareToStringify(v[R])===null)if(_.configurable)delete v[R];else return null}return delete v.visitedByCircularReferenceRemoval,v},_assign(v,_){for(const R in _)v[R]=_[R];return v},_getFirstPointerId(v){return v.touches?v.changedTouches[0].identifier:v.pointerId||999},releaseCanvas(...v){e.Konva.releaseCanvasOnDestroy&&v.forEach(_=>{_.width=0,_.height=0})},drawRoundedRectPath(v,_,R,b){let A=0,O=0,I=0,L=0;typeof b=="number"?A=O=I=L=Math.min(b,_/2,R/2):(A=Math.min(b[0]||0,_/2,R/2),O=Math.min(b[1]||0,_/2,R/2),L=Math.min(b[2]||0,_/2,R/2),I=Math.min(b[3]||0,_/2,R/2)),v.moveTo(A,0),v.lineTo(_-O,0),v.arc(_-O,O,O,Math.PI*3/2,0,!1),v.lineTo(_,R-L),v.arc(_-L,R-L,L,0,Math.PI/2,!1),v.lineTo(I,R),v.arc(I,R-I,I,Math.PI/2,Math.PI,!1),v.lineTo(0,A),v.arc(A,A,A,Math.PI,Math.PI*3/2,!1)}}})(ct);var rt={},pr={},ii={};Object.defineProperty(ii,"__esModule",{value:!0});ii.HitContext=ii.SceneContext=ii.Context=void 0;const Q8=ct,TP=ke;function OP(t){const e=[],n=t.length,r=Q8.Util;for(let i=0;i<n;i++){let s=t[i];r._isNumber(s)?s=Math.round(s*1e3)/1e3:r._isString(s)||(s=s+""),e.push(s)}return e}const k4=",",bP="(",LP=")",FP="([",AP="])",MP=";",IP="()",DP="=",E4=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],jP=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],UP=100;class _h{constructor(e){this.canvas=e,TP.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,n){let r=this.traceArr,i=r.length,s="",l,u,c,h;for(l=0;l<i;l++)u=r[l],c=u.method,c?(h=u.args,s+=c,e?s+=IP:Q8.Util._isArray(h[0])?s+=FP+h.join(k4)+AP:(n&&(h=h.map(p=>typeof p=="number"?Math.floor(p):p)),s+=bP+h.join(k4)+LP)):(s+=u.property,e||(s+=DP+u.val)),s+=MP;return s}clearTrace(){this.traceArr=[]}_trace(e){let n=this.traceArr,r;n.push(e),r=n.length,r>=UP&&n.shift()}reset(){const e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){const n=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(e){const n=e.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(e){const n=e.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(e){const n=e.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(e,n){this._context[e]=n}arc(e,n,r,i,s,l){this._context.arc(e,n,r,i,s,l)}arcTo(e,n,r,i,s){this._context.arcTo(e,n,r,i,s)}beginPath(){this._context.beginPath()}bezierCurveTo(e,n,r,i,s,l){this._context.bezierCurveTo(e,n,r,i,s,l)}clearRect(e,n,r,i){this._context.clearRect(e,n,r,i)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,n){const r=arguments;if(r.length===2)return this._context.createImageData(e,n);if(r.length===1)return this._context.createImageData(e)}createLinearGradient(e,n,r,i){return this._context.createLinearGradient(e,n,r,i)}createPattern(e,n){return this._context.createPattern(e,n)}createRadialGradient(e,n,r,i,s,l){return this._context.createRadialGradient(e,n,r,i,s,l)}drawImage(e,n,r,i,s,l,u,c,h){const p=arguments,y=this._context;p.length===3?y.drawImage(e,n,r):p.length===5?y.drawImage(e,n,r,i,s):p.length===9&&y.drawImage(e,n,r,i,s,l,u,c,h)}ellipse(e,n,r,i,s,l,u,c){this._context.ellipse(e,n,r,i,s,l,u,c)}isPointInPath(e,n,r,i){return r?this._context.isPointInPath(r,e,n,i):this._context.isPointInPath(e,n,i)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,n,r,i){this._context.fillRect(e,n,r,i)}strokeRect(e,n,r,i){this._context.strokeRect(e,n,r,i)}fillText(e,n,r,i){i?this._context.fillText(e,n,r,i):this._context.fillText(e,n,r)}measureText(e){return this._context.measureText(e)}getImageData(e,n,r,i){return this._context.getImageData(e,n,r,i)}lineTo(e,n){this._context.lineTo(e,n)}moveTo(e,n){this._context.moveTo(e,n)}rect(e,n,r,i){this._context.rect(e,n,r,i)}roundRect(e,n,r,i,s){this._context.roundRect(e,n,r,i,s)}putImageData(e,n,r){this._context.putImageData(e,n,r)}quadraticCurveTo(e,n,r,i){this._context.quadraticCurveTo(e,n,r,i)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,n){this._context.scale(e,n)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,n,r,i,s,l){this._context.setTransform(e,n,r,i,s,l)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,n,r,i){this._context.strokeText(e,n,r,i)}transform(e,n,r,i,s,l){this._context.transform(e,n,r,i,s,l)}translate(e,n){this._context.translate(e,n)}_enableTrace(){let e=this,n=E4.length,r=this.setAttr,i,s;const l=function(u){let c=e[u],h;e[u]=function(){return s=OP(Array.prototype.slice.call(arguments,0)),h=c.apply(e,arguments),e._trace({method:u,args:s}),h}};for(i=0;i<n;i++)l(E4[i]);e.setAttr=function(){r.apply(e,arguments);const u=arguments[0];let c=arguments[1];(u==="shadowOffsetX"||u==="shadowOffsetY"||u==="shadowBlur")&&(c=c/this.canvas.getPixelRatio()),e._trace({property:u,val:c})}}_applyGlobalCompositeOperation(e){const n=e.attrs.globalCompositeOperation;!n||n==="source-over"||this.setAttr("globalCompositeOperation",n)}}ii.Context=_h;jP.forEach(function(t){Object.defineProperty(_h.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class zP extends _h{constructor(e,{willReadFrequently:n=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(e){const n=e.fill();this.setAttr("fillStyle",n),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){const n=e._getLinearGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fillRadialGradient(e){const n=e._getRadialGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fill(e){const n=e.fill(),r=e.getFillPriority();if(n&&r==="color"){this._fillColor(e);return}const i=e.getFillPatternImage();if(i&&r==="pattern"){this._fillPattern(e);return}const s=e.getFillLinearGradientColorStops();if(s&&r==="linear-gradient"){this._fillLinearGradient(e);return}const l=e.getFillRadialGradientColorStops();if(l&&r==="radial-gradient"){this._fillRadialGradient(e);return}n?this._fillColor(e):i?this._fillPattern(e):s?this._fillLinearGradient(e):l&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const n=e.getStrokeLinearGradientStartPoint(),r=e.getStrokeLinearGradientEndPoint(),i=e.getStrokeLinearGradientColorStops(),s=this.createLinearGradient(n.x,n.y,r.x,r.y);if(i){for(let l=0;l<i.length;l+=2)s.addColorStop(i[l],i[l+1]);this.setAttr("strokeStyle",s)}}_stroke(e){const n=e.dash(),r=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!r){this.save();const s=this.getCanvas().getPixelRatio();this.setTransform(s,0,0,s,0,0)}this._applyLineCap(e),n&&e.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),r||this.restore()}}_applyShadow(e){var n,r,i;const s=(n=e.getShadowRGBA())!==null&&n!==void 0?n:"black",l=(r=e.getShadowBlur())!==null&&r!==void 0?r:5,u=(i=e.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},c=e.getAbsoluteScale(),h=this.canvas.getPixelRatio(),p=c.x*h,y=c.y*h;this.setAttr("shadowColor",s),this.setAttr("shadowBlur",l*Math.min(Math.abs(p),Math.abs(y))),this.setAttr("shadowOffsetX",u.x*p),this.setAttr("shadowOffsetY",u.y*y)}}ii.SceneContext=zP;class BP extends _h{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const n=e.getStrokeScaleEnabled();if(!n){this.save();const s=this.getCanvas().getPixelRatio();this.setTransform(s,0,0,s,0,0)}this._applyLineCap(e);const r=e.hitStrokeWidth(),i=r==="auto"?e.strokeWidth():r;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),n||this.restore()}}}ii.HitContext=BP;Object.defineProperty(pr,"__esModule",{value:!0});pr.HitCanvas=pr.SceneCanvas=pr.Canvas=void 0;const Kd=ct,q8=ii,Y8=ke;let Vc;function GP(){if(Vc)return Vc;const t=Kd.Util.createCanvasElement(),e=t.getContext("2d");return Vc=function(){const n=Y8.Konva._global.devicePixelRatio||1,r=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/r}(),Kd.Util.releaseCanvas(t),Vc}class um{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const r=(e||{}).pixelRatio||Y8.Konva.pixelRatio||GP();this.pixelRatio=r,this._canvas=Kd.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){const n=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,n){this.setWidth(e||0),this.setHeight(n||0)}toDataURL(e,n){try{return this._canvas.toDataURL(e,n)}catch{try{return this._canvas.toDataURL()}catch(i){return Kd.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}pr.Canvas=um;class HP extends um{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new q8.SceneContext(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}pr.SceneCanvas=HP;class VP extends um{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new q8.HitContext(this),this.setSize(e.width,e.height)}}pr.HitCanvas=VP;var Ch={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DD=void 0;const e=ke,n=ct;t.DD={get isDragging(){let r=!1;return t.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){let r;return t.DD._dragElements.forEach(i=>{r=i.node}),r},_dragElements:new Map,_drag(r){const i=[];t.DD._dragElements.forEach((s,l)=>{const{node:u}=s,c=u.getStage();c.setPointersPositions(r),s.pointerId===void 0&&(s.pointerId=n.Util._getFirstPointerId(r));const h=c._changedPointerPositions.find(p=>p.id===s.pointerId);if(h){if(s.dragStatus!=="dragging"){const p=u.dragDistance();if(Math.max(Math.abs(h.x-s.startPointerPos.x),Math.abs(h.y-s.startPointerPos.y))<p||(u.startDrag({evt:r}),!u.isDragging()))return}u._setDragPosition(r,s),i.push(u)}}),i.forEach(s=>{s.fire("dragmove",{type:"dragmove",target:s,evt:r},!0)})},_endDragBefore(r){const i=[];t.DD._dragElements.forEach(s=>{const{node:l}=s,u=l.getStage();if(r&&u.setPointersPositions(r),!u._changedPointerPositions.find(p=>p.id===s.pointerId))return;(s.dragStatus==="dragging"||s.dragStatus==="stopped")&&(t.DD.justDragged=!0,e.Konva._mouseListenClick=!1,e.Konva._touchListenClick=!1,e.Konva._pointerListenClick=!1,s.dragStatus="stopped");const h=s.node.getLayer()||s.node instanceof e.Konva.Stage&&s.node;h&&i.indexOf(h)===-1&&i.push(h)}),i.forEach(s=>{s.draw()})},_endDragAfter(r){t.DD._dragElements.forEach((i,s)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:r},!0),i.dragStatus!=="dragging"&&t.DD._dragElements.delete(s)})}},e.Konva.isBrowser&&(window.addEventListener("mouseup",t.DD._endDragBefore,!0),window.addEventListener("touchend",t.DD._endDragBefore,!0),window.addEventListener("touchcancel",t.DD._endDragBefore,!0),window.addEventListener("mousemove",t.DD._drag),window.addEventListener("touchmove",t.DD._drag),window.addEventListener("mouseup",t.DD._endDragAfter,!1),window.addEventListener("touchend",t.DD._endDragAfter,!1),window.addEventListener("touchcancel",t.DD._endDragAfter,!1))})(Ch);var Pe={},ge={};Object.defineProperty(ge,"__esModule",{value:!0});ge.RGBComponent=WP;ge.alphaComponent=KP;ge.getNumberValidator=$P;ge.getNumberOrArrayOfNumbersValidator=QP;ge.getNumberOrAutoValidator=qP;ge.getStringValidator=YP;ge.getStringOrGradientValidator=XP;ge.getFunctionValidator=JP;ge.getNumberArrayValidator=ZP;ge.getBooleanValidator=eN;ge.getComponentValidator=tN;const di=ke,ft=ct;function hi(t){return ft.Util._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||ft.Util._isBoolean(t)?t:Object.prototype.toString.call(t)}function WP(t){return t>255?255:t<0?0:Math.round(t)}function KP(t){return t>1?1:t<1e-4?1e-4:t}function $P(){if(di.Konva.isUnminified)return function(t,e){return ft.Util._isNumber(t)||ft.Util.warn(hi(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}function QP(t){if(di.Konva.isUnminified)return function(e,n){let r=ft.Util._isNumber(e),i=ft.Util._isArray(e)&&e.length==t;return!r&&!i&&ft.Util.warn(hi(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+t+")"),e}}function qP(){if(di.Konva.isUnminified)return function(t,e){return ft.Util._isNumber(t)||t==="auto"||ft.Util.warn(hi(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function YP(){if(di.Konva.isUnminified)return function(t,e){return ft.Util._isString(t)||ft.Util.warn(hi(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function XP(){if(di.Konva.isUnminified)return function(t,e){const n=ft.Util._isString(t),r=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return n||r||ft.Util.warn(hi(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function JP(){if(di.Konva.isUnminified)return function(t,e){return ft.Util._isFunction(t)||ft.Util.warn(hi(t)+' is a not valid value for "'+e+'" attribute. The value should be a function.'),t}}function ZP(){if(di.Konva.isUnminified)return function(t,e){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&t instanceof n||(ft.Util._isArray(t)?t.forEach(function(r){ft.Util._isNumber(r)||ft.Util.warn('"'+e+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):ft.Util.warn(hi(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}function eN(){if(di.Konva.isUnminified)return function(t,e){return t===!0||t===!1||ft.Util.warn(hi(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}function tN(t){if(di.Konva.isUnminified)return function(e,n){return e==null||ft.Util.isObject(e)||ft.Util.warn(hi(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+t),e}}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Factory=void 0;const e=ct,n=ge,r="get",i="set";t.Factory={addGetterSetter(s,l,u,c,h){t.Factory.addGetter(s,l,u),t.Factory.addSetter(s,l,c,h),t.Factory.addOverloadedGetterSetter(s,l)},addGetter(s,l,u){const c=r+e.Util._capitalize(l);s.prototype[c]=s.prototype[c]||function(){const h=this.attrs[l];return h===void 0?u:h}},addSetter(s,l,u,c){const h=i+e.Util._capitalize(l);s.prototype[h]||t.Factory.overWriteSetter(s,l,u,c)},overWriteSetter(s,l,u,c){const h=i+e.Util._capitalize(l);s.prototype[h]=function(p){return u&&p!==void 0&&p!==null&&(p=u.call(this,p,l)),this._setAttr(l,p),c&&c.call(this),this}},addComponentsGetterSetter(s,l,u,c,h){const p=u.length,y=e.Util._capitalize,S=r+y(l),x=i+y(l);s.prototype[S]=function(){const C={};for(let P=0;P<p;P++){const E=u[P];C[E]=this.getAttr(l+y(E))}return C};const m=(0,n.getComponentValidator)(u);s.prototype[x]=function(C){const P=this.attrs[l];c&&(C=c.call(this,C,l)),m&&m.call(this,C,l);for(const E in C)C.hasOwnProperty(E)&&this._setAttr(l+y(E),C[E]);return C||u.forEach(E=>{this._setAttr(l+y(E),void 0)}),this._fireChangeEvent(l,P,C),h&&h.call(this),this},t.Factory.addOverloadedGetterSetter(s,l)},addOverloadedGetterSetter(s,l){const u=e.Util._capitalize(l),c=i+u,h=r+u;s.prototype[l]=function(){return arguments.length?(this[c](arguments[0]),this):this[h]()}},addDeprecatedGetterSetter(s,l,u,c){e.Util.error("Adding deprecated "+l);const h=r+e.Util._capitalize(l),p=l+" property is deprecated and will be removed soon. Look at Konva change log for more information.";s.prototype[h]=function(){e.Util.error(p);const y=this.attrs[l];return y===void 0?u:y},t.Factory.addSetter(s,l,c,function(){e.Util.error(p)}),t.Factory.addOverloadedGetterSetter(s,l)},backCompat(s,l){e.Util.each(l,function(u,c){const h=s.prototype[c],p=r+e.Util._capitalize(u),y=i+e.Util._capitalize(u);function S(){h.apply(this,arguments),e.Util.error('"'+u+'" method is deprecated and will be removed soon. Use ""'+c+'" instead.')}s.prototype[u]=S,s.prototype[p]=S,s.prototype[y]=S})},afterSetFilter(){this._filterUpToDate=!1}}})(Pe);Object.defineProperty(rt,"__esModule",{value:!0});rt.Node=void 0;const bo=pr,Vn=Ch,Pu=Pe,Ri=ke,Re=ct,yt=ge,hd="absoluteOpacity",Wc="allEventListeners",Qr="absoluteTransform",P4="absoluteScale",Ps="canvas",nN="Change",rN="children",iN="konva",Bg="listening",sN="mouseenter",oN="mouseleave",aN="pointerenter",lN="pointerleave",uN="touchenter",cN="touchleave",N4="set",R4="Shape",fd=" ",T4="stage",Oi="transform",dN="Stage",Gg="visible",hN=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(fd);let fN=1;class ye{constructor(e){this._id=fN++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===Oi||e===Qr)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,n){let r=this._cache.get(e);return(r===void 0||(e===Oi||e===Qr)&&r.dirty===!0)&&(r=n.call(this),this._cache.set(e,r)),r}_calculate(e,n,r){if(!this._attachedDepsListeners.get(e)){const i=n.map(s=>s+"Change.konva").join(fd);this.on(i,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,r)}_getCanvasCache(){return this._cache.get(Ps)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===Qr&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Ps)){const{scene:e,filter:n,hit:r,buffer:i}=this._cache.get(Ps);Re.Util.releaseCanvas(e,n,r,i),this._cache.delete(Ps)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){const n=e||{};let r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let i=Math.ceil(n.width||r.width),s=Math.ceil(n.height||r.height),l=n.pixelRatio,u=n.x===void 0?Math.floor(r.x):n.x,c=n.y===void 0?Math.floor(r.y):n.y,h=n.offset||0,p=n.drawBorder||!1,y=n.hitCanvasPixelRatio||1;if(!i||!s){Re.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const S=Math.abs(Math.round(r.x)-u)>.5?1:0,x=Math.abs(Math.round(r.y)-c)>.5?1:0;i+=h*2+S,s+=h*2+x,u-=h,c-=h;const m=new bo.SceneCanvas({pixelRatio:l,width:i,height:s}),C=new bo.SceneCanvas({pixelRatio:l,width:0,height:0,willReadFrequently:!0}),P=new bo.HitCanvas({pixelRatio:y,width:i,height:s}),E=m.getContext(),k=P.getContext(),v=new bo.SceneCanvas({width:m.width/m.pixelRatio+Math.abs(u),height:m.height/m.pixelRatio+Math.abs(c),pixelRatio:m.pixelRatio}),_=v.getContext();return P.isCache=!0,m.isCache=!0,this._cache.delete(Ps),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(m.getContext()._context.imageSmoothingEnabled=!1,C.getContext()._context.imageSmoothingEnabled=!1),E.save(),k.save(),_.save(),E.translate(-u,-c),k.translate(-u,-c),_.translate(-u,-c),v.x=u,v.y=c,this._isUnderCache=!0,this._clearSelfAndDescendantCache(hd),this._clearSelfAndDescendantCache(P4),this.drawScene(m,this,v),this.drawHit(P,this),this._isUnderCache=!1,E.restore(),k.restore(),p&&(E.save(),E.beginPath(),E.rect(0,0,i,s),E.closePath(),E.setAttr("strokeStyle","red"),E.setAttr("lineWidth",5),E.stroke(),E.restore()),this._cache.set(Ps,{scene:m,filter:C,hit:P,buffer:v,x:u,y:c}),this._requestDraw(),this}isCached(){return this._cache.has(Ps)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,n){const r=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}];let i=1/0,s=1/0,l=-1/0,u=-1/0;const c=this.getAbsoluteTransform(n);return r.forEach(function(h){const p=c.point(h);i===void 0&&(i=l=p.x,s=u=p.y),i=Math.min(i,p.x),s=Math.min(s,p.y),l=Math.max(l,p.x),u=Math.max(u,p.y)}),{x:i,y:s,width:l-i,height:u-s}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();e.translate(n.x,n.y);const r=this._getCachedSceneCanvas(),i=r.pixelRatio;e.drawImage(r._canvas,0,0,r.width/i,r.height/i),e.restore()}_drawCachedHitCanvas(e){const n=this._getCanvasCache(),r=n.hit;e.save(),e.translate(n.x,n.y),e.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,s=i.getContext(),l,u,c,h;if(e){if(!this._filterUpToDate){const p=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(l=e.length,s.clear(),s.drawImage(r._canvas,0,0,r.getWidth()/p,r.getHeight()/p),u=s.getImageData(0,0,i.getWidth(),i.getHeight()),c=0;c<l;c++){if(h=e[c],typeof h!="function"){Re.Util.error("Filter should be type of function, but got "+typeof h+" instead. Please check correct filters");continue}h.call(this,u),s.putImageData(u,0,0)}}catch(y){Re.Util.error("Unable to apply filter. "+y.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return i}return r}on(e,n){if(this._cache&&this._cache.delete(Wc),arguments.length===3)return this._delegate.apply(this,arguments);const r=e.split(fd);for(let i=0;i<r.length;i++){const l=r[i].split("."),u=l[0],c=l[1]||"";this.eventListeners[u]||(this.eventListeners[u]=[]),this.eventListeners[u].push({name:c,handler:n})}return this}off(e,n){let r=(e||"").split(fd),i=r.length,s,l,u,c,h,p;if(this._cache&&this._cache.delete(Wc),!e)for(l in this.eventListeners)this._off(l);for(s=0;s<i;s++)if(u=r[s],c=u.split("."),h=c[0],p=c[1],h)this.eventListeners[h]&&this._off(h,p,n);else for(l in this.eventListeners)this._off(l,p,n);return this}dispatchEvent(e){const n={target:this,type:e.type,evt:e};return this.fire(e.type,n),this}addEventListener(e,n){return this.on(e,function(r){n.call(this,r.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,n,r){const i=this;this.on(e,function(s){const l=s.target.findAncestors(n,!0,i);for(let u=0;u<l.length;u++)s=Re.Util.cloneObject(s),s.currentTarget=l[u],r.call(l[u],s)})}remove(){return this.isDragging()&&this.stopDrag(),Vn.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(Qr),this._clearSelfAndDescendantCache(hd),this._clearSelfAndDescendantCache(P4),this._clearSelfAndDescendantCache(T4),this._clearSelfAndDescendantCache(Gg),this._clearSelfAndDescendantCache(Bg)}_remove(){this._clearCaches();const e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){const n="get"+Re.Util._capitalize(e);return Re.Util._isFunction(this[n])?this[n]():this.attrs[e]}getAncestors(){let e=this.getParent(),n=[];for(;e;)n.push(e),e=e.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let n,r;if(!e)return this;for(n in e)n!==rN&&(r=N4+Re.Util._capitalize(n),Re.Util._isFunction(this[r])?this[r](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(Bg,this._isListening)}_isListening(e){if(!this.listening())return!1;const r=this.getParent();return r&&r!==e&&this!==e?r._isListening(e):!0}isVisible(){return this._getCache(Gg,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const r=this.getParent();return r&&r!==e&&this!==e?r._isVisible(e):!0}shouldDrawHit(e,n=!1){if(e)return this._isVisible(e)&&this._isListening(e);const r=this.getLayer();let i=!1;Vn.DD._dragElements.forEach(l=>{l.dragStatus==="dragging"&&(l.node.nodeType==="Stage"||l.node.getLayer()===r)&&(i=!0)});const s=!n&&!Ri.Konva.hitOnDragEnabled&&(i||Ri.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!s}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),n=this,r=0,i,s,l,u;function c(p){for(i=[],s=p.length,l=0;l<s;l++)u=p[l],r++,u.nodeType!==R4&&(i=i.concat(u.getChildren().slice())),u._id===n._id&&(l=s);i.length>0&&i[0].getDepth()<=e&&c(i)}const h=this.getStage();return n.nodeType!==dN&&h&&c(h.getChildren()),r}getDepth(){let e=0,n=this.parent;for(;n;)e++,n=n.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(Oi),this._clearSelfAndDescendantCache(Qr)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;const n=e.getPointerPosition();if(!n)return null;const r=this.getAbsoluteTransform().copy();return r.invert(),r.point(n)}getAbsolutePosition(e){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!e&&(e=!0);const i=this.getAbsoluteTransform(e).getMatrix(),s=new Re.Transform,l=this.offset();return s.m=i.slice(),s.translate(l.x,l.y),s.getTranslation()}setAbsolutePosition(e){const{x:n,y:r,...i}=this._clearTransform();this.attrs.x=n,this.attrs.y=r,this._clearCache(Oi);const s=this._getAbsoluteTransform().copy();return s.invert(),s.translate(e.x,e.y),e={x:this.attrs.x+s.getTranslation().x,y:this.attrs.y+s.getTranslation().y},this._setTransform(i),this.setPosition({x:e.x,y:e.y}),this._clearCache(Oi),this._clearSelfAndDescendantCache(Qr),this}_setTransform(e){let n;for(n in e)this.attrs[n]=e[n]}_clearTransform(){const e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){let n=e.x,r=e.y,i=this.x(),s=this.y();return n!==void 0&&(i+=n),r!==void 0&&(s+=r),this.setPosition({x:i,y:s}),this}_eachAncestorReverse(e,n){let r=[],i=this.getParent(),s,l;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(s=r.length,l=0;l<s;l++)e(r[l])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return Re.Util.warn("Node has no parent. moveToTop function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return Re.Util.warn("Node has no parent. moveUp function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return Re.Util.warn("Node has no parent. moveDown function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return Re.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return Re.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&Re.Util.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(hd,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity();const n=this.getParent();return n&&!n._isUnderCache&&(e*=n.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),n,r,i,s,l;const u={attrs:{},className:this.getClassName()};for(n in e)r=e[n],l=Re.Util.isObject(r)&&!Re.Util._isPlainObject(r)&&!Re.Util._isArray(r),!l&&(i=typeof this[n]=="function"&&this[n],delete e[n],s=i?i.call(this):null,e[n]=r,s!==r&&(u.attrs[n]=r));return Re.Util._prepareToStringify(u)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,n,r){const i=[];n&&this._isMatch(e)&&i.push(this);let s=this.parent;for(;s;){if(s===r)return i;s._isMatch(e)&&i.push(s),s=s.parent}return i}isAncestorOf(e){return!1}findAncestor(e,n,r){return this.findAncestors(e,n,r)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);let n=e.replace(/ /g,"").split(","),r=n.length,i,s;for(i=0;i<r;i++)if(s=n[i],Re.Util.isValidSelector(s)||(Re.Util.warn('Selector "'+s+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),Re.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),Re.Util.warn("Konva is awesome, right?")),s.charAt(0)==="#"){if(this.id()===s.slice(1))return!0}else if(s.charAt(0)==="."){if(this.hasName(s.slice(1)))return!0}else if(this.className===s||this.nodeType===s)return!0;return!1}getLayer(){const e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(T4,this._getStage)}_getStage(){const e=this.getParent();return e?e.getStage():null}fire(e,n={},r){return n.target=n.target||this,r?this._fireAndBubble(e,n):this._fire(e,n),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(Qr,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let n;if(e)return n=new Re.Transform,this._eachAncestorReverse(function(r){const i=r.transformsEnabled();i==="all"?n.multiply(r.getTransform()):i==="position"&&n.translate(r.x()-r.offsetX(),r.y()-r.offsetY())},e),n;{n=this._cache.get(Qr)||new Re.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();const r=this.transformsEnabled();if(r==="all")n.multiply(this.getTransform());else if(r==="position"){const i=this.attrs.x||0,s=this.attrs.y||0,l=this.attrs.offsetX||0,u=this.attrs.offsetY||0;n.translate(i-l,s-u)}return n.dirty=!1,n}}getAbsoluteScale(e){let n=this;for(;n;)n._isUnderCache&&(e=n),n=n.getParent();const i=this.getAbsoluteTransform(e).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(Oi,this._getTransform)}_getTransform(){var e,n;const r=this._cache.get(Oi)||new Re.Transform;r.reset();const i=this.x(),s=this.y(),l=Ri.Konva.getAngle(this.rotation()),u=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,c=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,h=this.attrs.skewX||0,p=this.attrs.skewY||0,y=this.attrs.offsetX||0,S=this.attrs.offsetY||0;return(i!==0||s!==0)&&r.translate(i,s),l!==0&&r.rotate(l),(h!==0||p!==0)&&r.skew(h,p),(u!==1||c!==1)&&r.scale(u,c),(y!==0||S!==0)&&r.translate(-1*y,-1*S),r.dirty=!1,r}clone(e){let n=Re.Util.cloneObject(this.attrs),r,i,s,l,u;for(r in e)n[r]=e[r];const c=new this.constructor(n);for(r in this.eventListeners)for(i=this.eventListeners[r],s=i.length,l=0;l<s;l++)u=i[l],u.name.indexOf(iN)<0&&(c.eventListeners[r]||(c.eventListeners[r]=[]),c.eventListeners[r].push(u));return c}_toKonvaCanvas(e){e=e||{};const n=this.getClientRect(),r=this.getStage(),i=e.x!==void 0?e.x:Math.floor(n.x),s=e.y!==void 0?e.y:Math.floor(n.y),l=e.pixelRatio||1,u=new bo.SceneCanvas({width:e.width||Math.ceil(n.width)||(r?r.width():0),height:e.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:l}),c=u.getContext(),h=new bo.SceneCanvas({width:u.width/u.pixelRatio+Math.abs(i),height:u.height/u.pixelRatio+Math.abs(s),pixelRatio:u.pixelRatio});return e.imageSmoothingEnabled===!1&&(c._context.imageSmoothingEnabled=!1),c.save(),(i||s)&&c.translate(-1*i,-1*s),this.drawScene(u,void 0,h),c.restore(),u}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};const n=e.mimeType||null,r=e.quality||null,i=this._toKonvaCanvas(e).toDataURL(n,r);return e.callback&&e.callback(i),i}toImage(e){return new Promise((n,r)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,Re.Util._urlToImage(this.toDataURL(e),function(s){n(s),i==null||i(s)})}catch(i){r(i)}})}toBlob(e){return new Promise((n,r)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,this.toCanvas(e).toBlob(s=>{n(s),i==null||i(s)},e==null?void 0:e.mimeType,e==null?void 0:e.quality)}catch(i){r(i)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Ri.Konva.dragDistance}_off(e,n,r){let i=this.eventListeners[e],s,l,u;for(s=0;s<i.length;s++)if(l=i[s].name,u=i[s].handler,(l!=="konva"||n==="konva")&&(!n||l===n)&&(!r||r===u)){if(i.splice(s,1),i.length===0){delete this.eventListeners[e];break}s--}}_fireChangeEvent(e,n,r){this._fire(e+nN,{oldVal:n,newVal:r})}addName(e){if(!this.hasName(e)){const n=this.name(),r=n?n+" "+e:e;this.name(r)}return this}hasName(e){if(!e)return!1;const n=this.name();return n?(n||"").split(/\s/g).indexOf(e)!==-1:!1}removeName(e){const n=(this.name()||"").split(/\s/g),r=n.indexOf(e);return r!==-1&&(n.splice(r,1),this.name(n.join(" "))),this}setAttr(e,n){const r=this[N4+Re.Util._capitalize(e)];return Re.Util._isFunction(r)?r.call(this,n):this._setAttr(e,n),this}_requestDraw(){if(Ri.Konva.autoDrawEnabled){const e=this.getLayer()||this.getStage();e==null||e.batchDraw()}}_setAttr(e,n){const r=this.attrs[e];r===n&&!Re.Util.isObject(n)||(n==null?delete this.attrs[e]:this.attrs[e]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(e,r,n),this._requestDraw())}_setComponentAttr(e,n,r){let i;r!==void 0&&(i=this.attrs[e],i||(this.attrs[e]=this.getAttr(e)),this.attrs[e][n]=r,this._fireChangeEvent(e,i,r))}_fireAndBubble(e,n,r){n&&this.nodeType===R4&&(n.target=this);const i=[sN,oN,aN,lN,uN,cN];if(!(i.indexOf(e)!==-1&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r))){this._fire(e,n);const l=i.indexOf(e)!==-1&&r&&r.isAncestorOf&&r.isAncestorOf(this)&&!r.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!l&&(r&&r.parent?this._fireAndBubble.call(this.parent,e,n,r):this._fireAndBubble.call(this.parent,e,n))}}_getProtoListeners(e){var n,r,i;const s=(n=this._cache.get(Wc))!==null&&n!==void 0?n:{};let l=s==null?void 0:s[e];if(l===void 0){l=[];let u=Object.getPrototypeOf(this);for(;u;){const c=(i=(r=u.eventListeners)===null||r===void 0?void 0:r[e])!==null&&i!==void 0?i:[];l.push(...c),u=Object.getPrototypeOf(u)}s[e]=l,this._cache.set(Wc,s)}return l}_fire(e,n){n=n||{},n.currentTarget=this,n.type=e;const r=this._getProtoListeners(e);if(r)for(let s=0;s<r.length;s++)r[s].handler.call(this,n);const i=this.eventListeners[e];if(i)for(let s=0;s<i.length;s++)i[s].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){const n=e?e.pointerId:void 0,r=this.getStage(),i=this.getAbsolutePosition();if(!r)return;const s=r._getPointerById(n)||r._changedPointerPositions[0]||i;Vn.DD._dragElements.set(this._id,{node:this,startPointerPos:s,offset:{x:s.x-i.x,y:s.y-i.y},dragStatus:"ready",pointerId:n})}startDrag(e,n=!0){Vn.DD._dragElements.has(this._id)||this._createDragElement(e);const r=Vn.DD._dragElements.get(this._id);r.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:e&&e.evt},n)}_setDragPosition(e,n){const r=this.getStage()._getPointerById(n.pointerId);if(!r)return;let i={x:r.x-n.offset.x,y:r.y-n.offset.y};const s=this.dragBoundFunc();if(s!==void 0){const l=s.call(this,i,e);l?i=l:Re.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}stopDrag(e){const n=Vn.DD._dragElements.get(this._id);n&&(n.dragStatus="stopped"),Vn.DD._endDragBefore(e),Vn.DD._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=Vn.DD._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){if(!(!(e.evt.button!==void 0)||Ri.Konva.dragButtons.indexOf(e.evt.button)>=0)||this.isDragging())return;let i=!1;Vn.DD._dragElements.forEach(s=>{this.isAncestorOf(s.node)&&(i=!0)}),i||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const n=Vn.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&Vn.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-e.x,y:-e.y,width:n.width()+2*e.x,height:n.height()+2*e.y};return Re.Util.haveIntersection(r,this.getClientRect())}static create(e,n){return Re.Util._isString(e)&&(e=JSON.parse(e)),this._createNode(e,n)}static _createNode(e,n){let r=ye.prototype.getClassName.call(e),i=e.children,s,l,u;n&&(e.attrs.container=n),Ri.Konva[r]||(Re.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const c=Ri.Konva[r];if(s=new c(e.attrs),i)for(l=i.length,u=0;u<l;u++)s.add(ye._createNode(i[u]));return s}}rt.Node=ye;ye.prototype.nodeType="Node";ye.prototype._attrsAffectingSize=[];ye.prototype.eventListeners={};ye.prototype.on.call(ye.prototype,hN,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(Oi),this._clearSelfAndDescendantCache(Qr)});ye.prototype.on.call(ye.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(Gg)});ye.prototype.on.call(ye.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(Bg)});ye.prototype.on.call(ye.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(hd)});const Ge=Pu.Factory.addGetterSetter;Ge(ye,"zIndex");Ge(ye,"absolutePosition");Ge(ye,"position");Ge(ye,"x",0,(0,yt.getNumberValidator)());Ge(ye,"y",0,(0,yt.getNumberValidator)());Ge(ye,"globalCompositeOperation","source-over",(0,yt.getStringValidator)());Ge(ye,"opacity",1,(0,yt.getNumberValidator)());Ge(ye,"name","",(0,yt.getStringValidator)());Ge(ye,"id","",(0,yt.getStringValidator)());Ge(ye,"rotation",0,(0,yt.getNumberValidator)());Pu.Factory.addComponentsGetterSetter(ye,"scale",["x","y"]);Ge(ye,"scaleX",1,(0,yt.getNumberValidator)());Ge(ye,"scaleY",1,(0,yt.getNumberValidator)());Pu.Factory.addComponentsGetterSetter(ye,"skew",["x","y"]);Ge(ye,"skewX",0,(0,yt.getNumberValidator)());Ge(ye,"skewY",0,(0,yt.getNumberValidator)());Pu.Factory.addComponentsGetterSetter(ye,"offset",["x","y"]);Ge(ye,"offsetX",0,(0,yt.getNumberValidator)());Ge(ye,"offsetY",0,(0,yt.getNumberValidator)());Ge(ye,"dragDistance",void 0,(0,yt.getNumberValidator)());Ge(ye,"width",0,(0,yt.getNumberValidator)());Ge(ye,"height",0,(0,yt.getNumberValidator)());Ge(ye,"listening",!0,(0,yt.getBooleanValidator)());Ge(ye,"preventDefault",!0,(0,yt.getBooleanValidator)());Ge(ye,"filters",void 0,function(t){return this._filterUpToDate=!1,t});Ge(ye,"visible",!0,(0,yt.getBooleanValidator)());Ge(ye,"transformsEnabled","all",(0,yt.getStringValidator)());Ge(ye,"size");Ge(ye,"dragBoundFunc");Ge(ye,"draggable",!1,(0,yt.getBooleanValidator)());Pu.Factory.backCompat(ye,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var oo={};Object.defineProperty(oo,"__esModule",{value:!0});oo.Container=void 0;const La=Pe,h0=rt,kh=ge;class ao extends h0.Node{constructor(){super(...arguments),this.children=[]}getChildren(e){const n=this.children||[];return e?n.filter(e):n}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let r=0;r<e.length;r++)this.add(e[r]);return this}const n=e[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){const n=this._generalFind(e,!0);return n.length>0?n[0]:void 0}_generalFind(e,n){const r=[];return this._descendants(i=>{const s=i._isMatch(e);return s&&r.push(i),!!(s&&n)}),r}_descendants(e){let n=!1;const r=this.getChildren();for(const i of r){if(n=e(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(e),n))return!0}return!1}toObject(){const e=h0.Node.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(n=>{e.children.push(n.toObject())}),e}isAncestorOf(e){let n=e.getParent();for(;n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(e){const n=h0.Node.prototype.clone.call(this,e);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(e){const n=[];return this.find("Shape").forEach(r=>{r.isVisible()&&r.intersects(e)&&n.push(r)}),n}_clearSelfAndDescendantCache(e){var n;super._clearSelfAndDescendantCache(e),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(e,n,r){const i=this.getLayer(),s=e||i&&i.getCanvas(),l=s&&s.getContext(),u=this._getCanvasCache(),c=u&&u.scene,h=s&&s.isCache;if(!this.isVisible()&&!h)return this;if(c){l.save();const p=this.getAbsoluteTransform(n).getMatrix();l.transform(p[0],p[1],p[2],p[3],p[4],p[5]),this._drawCachedSceneCanvas(l),l.restore()}else this._drawChildren("drawScene",s,n,r);return this}drawHit(e,n){if(!this.shouldDrawHit(n))return this;const r=this.getLayer(),i=e||r&&r.hitCanvas,s=i&&i.getContext(),l=this._getCanvasCache();if(l&&l.hit){s.save();const c=this.getAbsoluteTransform(n).getMatrix();s.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedHitCanvas(s),s.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(e,n,r,i){var s;const l=n&&n.getContext(),u=this.clipWidth(),c=this.clipHeight(),h=this.clipFunc(),p=typeof u=="number"&&typeof c=="number"||h,y=r===this;if(p){l.save();const x=this.getAbsoluteTransform(r);let m=x.getMatrix();l.transform(m[0],m[1],m[2],m[3],m[4],m[5]),l.beginPath();let C;if(h)C=h.call(this,l,this);else{const P=this.clipX(),E=this.clipY();l.rect(P||0,E||0,u,c)}l.clip.apply(l,C),m=x.copy().invert().getMatrix(),l.transform(m[0],m[1],m[2],m[3],m[4],m[5])}const S=!y&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";S&&(l.save(),l._applyGlobalCompositeOperation(this)),(s=this.children)===null||s===void 0||s.forEach(function(x){x[e](n,r,i)}),S&&l.restore(),p&&l.restore()}getClientRect(e={}){var n;const r=e.skipTransform,i=e.relativeTo;let s,l,u,c,h={x:1/0,y:1/0,width:0,height:0};const p=this;(n=this.children)===null||n===void 0||n.forEach(function(x){if(!x.visible())return;const m=x.getClientRect({relativeTo:p,skipShadow:e.skipShadow,skipStroke:e.skipStroke});m.width===0&&m.height===0||(s===void 0?(s=m.x,l=m.y,u=m.x+m.width,c=m.y+m.height):(s=Math.min(s,m.x),l=Math.min(l,m.y),u=Math.max(u,m.x+m.width),c=Math.max(c,m.y+m.height)))});const y=this.find("Shape");let S=!1;for(let x=0;x<y.length;x++)if(y[x]._isVisible(this)){S=!0;break}return S&&s!==void 0?h={x:s,y:l,width:u-s,height:c-l}:h={x:0,y:0,width:0,height:0},r?h:this._transformedRect(h,i)}}oo.Container=ao;La.Factory.addComponentsGetterSetter(ao,"clip",["x","y","width","height"]);La.Factory.addGetterSetter(ao,"clipX",void 0,(0,kh.getNumberValidator)());La.Factory.addGetterSetter(ao,"clipY",void 0,(0,kh.getNumberValidator)());La.Factory.addGetterSetter(ao,"clipWidth",void 0,(0,kh.getNumberValidator)());La.Factory.addGetterSetter(ao,"clipHeight",void 0,(0,kh.getNumberValidator)());La.Factory.addGetterSetter(ao,"clipFunc");var X8={},ls={};Object.defineProperty(ls,"__esModule",{value:!0});ls.getCapturedShape=gN;ls.createEvent=cm;ls.hasPointerCapture=mN;ls.setPointerCapture=yN;ls.releaseCapture=Z8;const pN=ke,ou=new Map,J8=pN.Konva._global.PointerEvent!==void 0;function gN(t){return ou.get(t)}function cm(t){return{evt:t,pointerId:t.pointerId}}function mN(t,e){return ou.get(t)===e}function yN(t,e){Z8(t),e.getStage()&&(ou.set(t,e),J8&&e._fire("gotpointercapture",cm(new PointerEvent("gotpointercapture"))))}function Z8(t,e){const n=ou.get(t);if(!n)return;const r=n.getStage();r&&r.content,ou.delete(t),J8&&n._fire("lostpointercapture",cm(new PointerEvent("lostpointercapture")))}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Stage=t.stages=void 0;const e=ct,n=Pe,r=oo,i=ke,s=pr,l=Ch,u=ke,c=ls,h="Stage",p="string",y="px",S="mouseout",x="mouseleave",m="mouseover",C="mouseenter",P="mousemove",E="mousedown",k="mouseup",v="pointermove",_="pointerdown",R="pointerup",b="pointercancel",A="lostpointercapture",O="pointerout",I="pointerleave",L="pointerover",H="pointerenter",B="contextmenu",$="touchstart",q="touchend",Q="touchmove",re="touchcancel",he="wheel",W=5,te=[[C,"_pointerenter"],[E,"_pointerdown"],[P,"_pointermove"],[k,"_pointerup"],[x,"_pointerleave"],[$,"_pointerdown"],[Q,"_pointermove"],[q,"_pointerup"],[re,"_pointercancel"],[m,"_pointerover"],[he,"_wheel"],[B,"_contextmenu"],[_,"_pointerdown"],[v,"_pointermove"],[R,"_pointerup"],[b,"_pointercancel"],[I,"_pointerleave"],[A,"_lostpointercapture"]],Z={mouse:{[O]:S,[I]:x,[L]:m,[H]:C,[v]:P,[_]:E,[R]:k,[b]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[O]:"touchout",[I]:"touchleave",[L]:"touchover",[H]:"touchenter",[v]:Q,[_]:$,[R]:q,[b]:re,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[O]:O,[I]:I,[L]:L,[H]:H,[v]:v,[_]:_,[R]:R,[b]:b,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},Y=$e=>$e.indexOf("pointer")>=0?"pointer":$e.indexOf("touch")>=0?"touch":"mouse",ie=$e=>{const D=Y($e);if(D==="pointer")return i.Konva.pointerEventsEnabled&&Z.pointer;if(D==="touch")return Z.touch;if(D==="mouse")return Z.mouse};function xe($e={}){return($e.clipFunc||$e.clipWidth||$e.clipHeight)&&e.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),$e}const Ke="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";t.stages=[];class it extends r.Container{constructor(D){super(xe(D)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),t.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{xe(this.attrs)}),this._checkVisibility()}_validateAdd(D){const X=D.getType()==="Layer",ce=D.getType()==="FastLayer";X||ce||e.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const D=this.visible()?"":"none";this.content.style.display=D}setContainer(D){if(typeof D===p){let X;if(D.charAt(0)==="."){const ce=D.slice(1);D=document.getElementsByClassName(ce)[0]}else D.charAt(0)!=="#"?X=D:X=D.slice(1),D=document.getElementById(X);if(!D)throw"Can not find container in document with id "+X}return this._setAttr("container",D),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),D.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const D=this.children,X=D.length;for(let ce=0;ce<X;ce++)D[ce].clear();return this}clone(D){return D||(D={}),D.container=typeof document<"u"&&document.createElement("div"),r.Container.prototype.clone.call(this,D)}destroy(){super.destroy();const D=this.content;D&&e.Util._isInDocument(D)&&this.container().removeChild(D);const X=t.stages.indexOf(this);return X>-1&&t.stages.splice(X,1),e.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const D=this._pointerPositions[0]||this._changedPointerPositions[0];return D?{x:D.x,y:D.y}:(e.Util.warn(Ke),null)}_getPointerById(D){return this._pointerPositions.find(X=>X.id===D)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(D){D=D||{},D.x=D.x||0,D.y=D.y||0,D.width=D.width||this.width(),D.height=D.height||this.height();const X=new s.SceneCanvas({width:D.width,height:D.height,pixelRatio:D.pixelRatio||1}),ce=X.getContext()._context,De=this.children;return(D.x||D.y)&&ce.translate(-1*D.x,-1*D.y),De.forEach(function(we){if(!we.isVisible())return;const He=we._toKonvaCanvas(D);ce.drawImage(He._canvas,D.x,D.y,He.getWidth()/He.getPixelRatio(),He.getHeight()/He.getPixelRatio())}),X}getIntersection(D){if(!D)return null;const X=this.children,ce=X.length,De=ce-1;for(let we=De;we>=0;we--){const He=X[we].getIntersection(D);if(He)return He}return null}_resizeDOM(){const D=this.width(),X=this.height();this.content&&(this.content.style.width=D+y,this.content.style.height=X+y),this.bufferCanvas.setSize(D,X),this.bufferHitCanvas.setSize(D,X),this.children.forEach(ce=>{ce.setSize({width:D,height:X}),ce.draw()})}add(D,...X){if(arguments.length>1){for(let De=0;De<arguments.length;De++)this.add(arguments[De]);return this}super.add(D);const ce=this.children.length;return ce>W&&e.Util.warn("The stage has "+ce+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),D.setSize({width:this.width(),height:this.height()}),D.draw(),i.Konva.isBrowser&&this.content.appendChild(D.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(D){return c.hasPointerCapture(D,this)}setPointerCapture(D){c.setPointerCapture(D,this)}releaseCapture(D){c.releaseCapture(D,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&te.forEach(([D,X])=>{this.content.addEventListener(D,ce=>{this[X](ce)},{passive:!1})})}_pointerenter(D){this.setPointersPositions(D);const X=ie(D.type);X&&this._fire(X.pointerenter,{evt:D,target:this,currentTarget:this})}_pointerover(D){this.setPointersPositions(D);const X=ie(D.type);X&&this._fire(X.pointerover,{evt:D,target:this,currentTarget:this})}_getTargetShape(D){let X=this[D+"targetShape"];return X&&!X.getStage()&&(X=null),X}_pointerleave(D){const X=ie(D.type),ce=Y(D.type);if(!X)return;this.setPointersPositions(D);const De=this._getTargetShape(ce),we=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;De&&we?(De._fireAndBubble(X.pointerout,{evt:D}),De._fireAndBubble(X.pointerleave,{evt:D}),this._fire(X.pointerleave,{evt:D,target:this,currentTarget:this}),this[ce+"targetShape"]=null):we&&(this._fire(X.pointerleave,{evt:D,target:this,currentTarget:this}),this._fire(X.pointerout,{evt:D,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(D){const X=ie(D.type),ce=Y(D.type);if(!X)return;this.setPointersPositions(D);let De=!1;this._changedPointerPositions.forEach(we=>{const He=this.getIntersection(we);if(l.DD.justDragged=!1,i.Konva["_"+ce+"ListenClick"]=!0,!He||!He.isListening()){this[ce+"ClickStartShape"]=void 0;return}i.Konva.capturePointerEventsEnabled&&He.setPointerCapture(we.id),this[ce+"ClickStartShape"]=He,He._fireAndBubble(X.pointerdown,{evt:D,pointerId:we.id}),De=!0;const Qe=D.type.indexOf("touch")>=0;He.preventDefault()&&D.cancelable&&Qe&&D.preventDefault()}),De||this._fire(X.pointerdown,{evt:D,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(D){const X=ie(D.type),ce=Y(D.type);if(!X||(i.Konva.isDragging()&&l.DD.node.preventDefault()&&D.cancelable&&D.preventDefault(),this.setPointersPositions(D),!(!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled)))return;const we={};let He=!1;const Qe=this._getTargetShape(ce);this._changedPointerPositions.forEach(vr=>{const ze=c.getCapturedShape(vr.id)||this.getIntersection(vr),gi=vr.id,Zn={evt:D,pointerId:gi},mi=Qe!==ze;if(mi&&Qe&&(Qe._fireAndBubble(X.pointerout,{...Zn},ze),Qe._fireAndBubble(X.pointerleave,{...Zn},ze)),ze){if(we[ze._id])return;we[ze._id]=!0}ze&&ze.isListening()?(He=!0,mi&&(ze._fireAndBubble(X.pointerover,{...Zn},Qe),ze._fireAndBubble(X.pointerenter,{...Zn},Qe),this[ce+"targetShape"]=ze),ze._fireAndBubble(X.pointermove,{...Zn})):Qe&&(this._fire(X.pointerover,{evt:D,target:this,currentTarget:this,pointerId:gi}),this[ce+"targetShape"]=null)}),He||this._fire(X.pointermove,{evt:D,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(D){const X=ie(D.type),ce=Y(D.type);if(!X)return;this.setPointersPositions(D);const De=this[ce+"ClickStartShape"],we=this[ce+"ClickEndShape"],He={};let Qe=!1;this._changedPointerPositions.forEach(vr=>{const ze=c.getCapturedShape(vr.id)||this.getIntersection(vr);if(ze){if(ze.releaseCapture(vr.id),He[ze._id])return;He[ze._id]=!0}const gi=vr.id,Zn={evt:D,pointerId:gi};let mi=!1;i.Konva["_"+ce+"InDblClickWindow"]?(mi=!0,clearTimeout(this[ce+"DblTimeout"])):l.DD.justDragged||(i.Konva["_"+ce+"InDblClickWindow"]=!0,clearTimeout(this[ce+"DblTimeout"])),this[ce+"DblTimeout"]=setTimeout(function(){i.Konva["_"+ce+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),ze&&ze.isListening()?(Qe=!0,this[ce+"ClickEndShape"]=ze,ze._fireAndBubble(X.pointerup,{...Zn}),i.Konva["_"+ce+"ListenClick"]&&De&&De===ze&&(ze._fireAndBubble(X.pointerclick,{...Zn}),mi&&we&&we===ze&&ze._fireAndBubble(X.pointerdblclick,{...Zn}))):(this[ce+"ClickEndShape"]=null,i.Konva["_"+ce+"ListenClick"]&&this._fire(X.pointerclick,{evt:D,target:this,currentTarget:this,pointerId:gi}),mi&&this._fire(X.pointerdblclick,{evt:D,target:this,currentTarget:this,pointerId:gi}))}),Qe||this._fire(X.pointerup,{evt:D,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+ce+"ListenClick"]=!1,D.cancelable&&ce!=="touch"&&ce!=="pointer"&&D.preventDefault()}_contextmenu(D){this.setPointersPositions(D);const X=this.getIntersection(this.getPointerPosition());X&&X.isListening()?X._fireAndBubble(B,{evt:D}):this._fire(B,{evt:D,target:this,currentTarget:this})}_wheel(D){this.setPointersPositions(D);const X=this.getIntersection(this.getPointerPosition());X&&X.isListening()?X._fireAndBubble(he,{evt:D}):this._fire(he,{evt:D,target:this,currentTarget:this})}_pointercancel(D){this.setPointersPositions(D);const X=c.getCapturedShape(D.pointerId)||this.getIntersection(this.getPointerPosition());X&&X._fireAndBubble(R,c.createEvent(D)),c.releaseCapture(D.pointerId)}_lostpointercapture(D){c.releaseCapture(D.pointerId)}setPointersPositions(D){const X=this._getContentPosition();let ce=null,De=null;D=D||window.event,D.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(D.touches,we=>{this._pointerPositions.push({id:we.identifier,x:(we.clientX-X.left)/X.scaleX,y:(we.clientY-X.top)/X.scaleY})}),Array.prototype.forEach.call(D.changedTouches||D.touches,we=>{this._changedPointerPositions.push({id:we.identifier,x:(we.clientX-X.left)/X.scaleX,y:(we.clientY-X.top)/X.scaleY})})):(ce=(D.clientX-X.left)/X.scaleX,De=(D.clientY-X.top)/X.scaleY,this.pointerPos={x:ce,y:De},this._pointerPositions=[{x:ce,y:De,id:e.Util._getFirstPointerId(D)}],this._changedPointerPositions=[{x:ce,y:De,id:e.Util._getFirstPointerId(D)}])}_setPointerPosition(D){e.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(D)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const D=this.content.getBoundingClientRect();return{top:D.top,left:D.left,scaleX:D.width/this.content.clientWidth||1,scaleY:D.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new s.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new s.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!i.Konva.isBrowser)return;const D=this.container();if(!D)throw"Stage has no container. A container is required.";D.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),D.appendChild(this.content),this._resizeDOM()}cache(){return e.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(D){D.batchDraw()}),this}}t.Stage=it,it.prototype.nodeType=h,(0,u._registerNode)(it),n.Factory.addGetterSetter(it,"container"),i.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{t.stages.forEach($e=>{$e.batchDraw()})})})(X8);var Nu={},Rt={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Shape=t.shapes=void 0;const e=ke,n=ct,r=Pe,i=rt,s=ge,l=ke,u=ls,c="hasShadow",h="shadowRGBA",p="patternImage",y="linearGradient",S="radialGradient";let x;function m(){return x||(x=n.Util.createCanvasElement().getContext("2d"),x)}t.shapes={};function C(I){const L=this.attrs.fillRule;L?I.fill(L):I.fill()}function P(I){I.stroke()}function E(I){const L=this.attrs.fillRule;L?I.fill(L):I.fill()}function k(I){I.stroke()}function v(){this._clearCache(c)}function _(){this._clearCache(h)}function R(){this._clearCache(p)}function b(){this._clearCache(y)}function A(){this._clearCache(S)}class O extends i.Node{constructor(L){super(L);let H;for(;H=n.Util.getRandomColor(),!(H&&!(H in t.shapes)););this.colorKey=H,t.shapes[H]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(c,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(p,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const H=m().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(H&&H.setTransform){const B=new n.Transform;B.translate(this.fillPatternX(),this.fillPatternY()),B.rotate(e.Konva.getAngle(this.fillPatternRotation())),B.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),B.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const $=B.getMatrix(),q=typeof DOMMatrix>"u"?{a:$[0],b:$[1],c:$[2],d:$[3],e:$[4],f:$[5]}:new DOMMatrix($);H.setTransform(q)}return H}}_getLinearGradient(){return this._getCache(y,this.__getLinearGradient)}__getLinearGradient(){const L=this.fillLinearGradientColorStops();if(L){const H=m(),B=this.fillLinearGradientStartPoint(),$=this.fillLinearGradientEndPoint(),q=H.createLinearGradient(B.x,B.y,$.x,$.y);for(let Q=0;Q<L.length;Q+=2)q.addColorStop(L[Q],L[Q+1]);return q}}_getRadialGradient(){return this._getCache(S,this.__getRadialGradient)}__getRadialGradient(){const L=this.fillRadialGradientColorStops();if(L){const H=m(),B=this.fillRadialGradientStartPoint(),$=this.fillRadialGradientEndPoint(),q=H.createRadialGradient(B.x,B.y,this.fillRadialGradientStartRadius(),$.x,$.y,this.fillRadialGradientEndRadius());for(let Q=0;Q<L.length;Q+=2)q.addColorStop(L[Q],L[Q+1]);return q}}getShadowRGBA(){return this._getCache(h,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const L=n.Util.colorToRGBA(this.shadowColor());if(L)return"rgba("+L.r+","+L.g+","+L.b+","+L.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const L=this.hitStrokeWidth();return L==="auto"?this.hasStroke():this.strokeEnabled()&&!!L}intersects(L){const H=this.getStage();if(!H)return!1;const B=H.bufferHitCanvas;return B.getContext().clear(),this.drawHit(B,void 0,!0),B.context.getImageData(Math.round(L.x),Math.round(L.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete t.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(L){var H;if(!((H=this.attrs.perfectDrawEnabled)!==null&&H!==void 0?H:!0))return!1;const $=L||this.hasFill(),q=this.hasStroke(),Q=this.getAbsoluteOpacity()!==1;if($&&q&&Q)return!0;const re=this.hasShadow(),he=this.shadowForStrokeEnabled();return!!($&&q&&re&&he)}setStrokeHitEnabled(L){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),L?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const L=this.size();return{x:this._centroid?-L.width/2:0,y:this._centroid?-L.height/2:0,width:L.width,height:L.height}}getClientRect(L={}){let H=!1,B=this.getParent();for(;B;){if(B.isCached()){H=!0;break}B=B.getParent()}const $=L.skipTransform,q=L.relativeTo||H&&this.getStage()||void 0,Q=this.getSelfRect(),he=!L.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,W=Q.width+he,te=Q.height+he,Z=!L.skipShadow&&this.hasShadow(),Y=Z?this.shadowOffsetX():0,ie=Z?this.shadowOffsetY():0,xe=W+Math.abs(Y),Ke=te+Math.abs(ie),it=Z&&this.shadowBlur()||0,$e=xe+it*2,D=Ke+it*2,X={width:$e,height:D,x:-(he/2+it)+Math.min(Y,0)+Q.x,y:-(he/2+it)+Math.min(ie,0)+Q.y};return $?X:this._transformedRect(X,q)}drawScene(L,H,B){const $=this.getLayer(),q=L||$.getCanvas(),Q=q.getContext(),re=this._getCanvasCache(),he=this.getSceneFunc(),W=this.hasShadow();let te;const Z=H===this;if(!this.isVisible()&&!Z)return this;if(re){Q.save();const Y=this.getAbsoluteTransform(H).getMatrix();return Q.transform(Y[0],Y[1],Y[2],Y[3],Y[4],Y[5]),this._drawCachedSceneCanvas(Q),Q.restore(),this}if(!he)return this;if(Q.save(),this._useBufferCanvas()){te=this.getStage();const Y=B||te.bufferCanvas,ie=Y.getContext();ie.clear(),ie.save(),ie._applyLineJoin(this);const xe=this.getAbsoluteTransform(H).getMatrix();ie.transform(xe[0],xe[1],xe[2],xe[3],xe[4],xe[5]),he.call(this,ie,this),ie.restore();const Ke=Y.pixelRatio;W&&Q._applyShadow(this),Q._applyOpacity(this),Q._applyGlobalCompositeOperation(this),Q.drawImage(Y._canvas,Y.x||0,Y.y||0,Y.width/Ke,Y.height/Ke)}else{if(Q._applyLineJoin(this),!Z){const Y=this.getAbsoluteTransform(H).getMatrix();Q.transform(Y[0],Y[1],Y[2],Y[3],Y[4],Y[5]),Q._applyOpacity(this),Q._applyGlobalCompositeOperation(this)}W&&Q._applyShadow(this),he.call(this,Q,this)}return Q.restore(),this}drawHit(L,H,B=!1){if(!this.shouldDrawHit(H,B))return this;const $=this.getLayer(),q=L||$.hitCanvas,Q=q&&q.getContext(),re=this.hitFunc()||this.sceneFunc(),he=this._getCanvasCache(),W=he&&he.hit;if(this.colorKey||n.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),W){Q.save();const Z=this.getAbsoluteTransform(H).getMatrix();return Q.transform(Z[0],Z[1],Z[2],Z[3],Z[4],Z[5]),this._drawCachedHitCanvas(Q),Q.restore(),this}if(!re)return this;if(Q.save(),Q._applyLineJoin(this),!(this===H)){const Z=this.getAbsoluteTransform(H).getMatrix();Q.transform(Z[0],Z[1],Z[2],Z[3],Z[4],Z[5])}return re.call(this,Q,this),Q.restore(),this}drawHitFromCache(L=0){const H=this._getCanvasCache(),B=this._getCachedSceneCanvas(),$=H.hit,q=$.getContext(),Q=$.getWidth(),re=$.getHeight();q.clear(),q.drawImage(B._canvas,0,0,Q,re);try{const he=q.getImageData(0,0,Q,re),W=he.data,te=W.length,Z=n.Util._hexToRgb(this.colorKey);for(let Y=0;Y<te;Y+=4)W[Y+3]>L?(W[Y]=Z.r,W[Y+1]=Z.g,W[Y+2]=Z.b,W[Y+3]=255):W[Y+3]=0;q.putImageData(he,0,0)}catch(he){n.Util.error("Unable to draw hit graph from cached scene canvas. "+he.message)}return this}hasPointerCapture(L){return u.hasPointerCapture(L,this)}setPointerCapture(L){u.setPointerCapture(L,this)}releaseCapture(L){u.releaseCapture(L,this)}}t.Shape=O,O.prototype._fillFunc=C,O.prototype._strokeFunc=P,O.prototype._fillFuncHit=E,O.prototype._strokeFuncHit=k,O.prototype._centroid=!1,O.prototype.nodeType="Shape",(0,l._registerNode)(O),O.prototype.eventListeners={},O.prototype.on.call(O.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",v),O.prototype.on.call(O.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",_),O.prototype.on.call(O.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",R),O.prototype.on.call(O.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",b),O.prototype.on.call(O.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",A),r.Factory.addGetterSetter(O,"stroke",void 0,(0,s.getStringOrGradientValidator)()),r.Factory.addGetterSetter(O,"strokeWidth",2,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(O,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(O,"hitStrokeWidth","auto",(0,s.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(O,"strokeHitEnabled",!0,(0,s.getBooleanValidator)()),r.Factory.addGetterSetter(O,"perfectDrawEnabled",!0,(0,s.getBooleanValidator)()),r.Factory.addGetterSetter(O,"shadowForStrokeEnabled",!0,(0,s.getBooleanValidator)()),r.Factory.addGetterSetter(O,"lineJoin"),r.Factory.addGetterSetter(O,"lineCap"),r.Factory.addGetterSetter(O,"sceneFunc"),r.Factory.addGetterSetter(O,"hitFunc"),r.Factory.addGetterSetter(O,"dash"),r.Factory.addGetterSetter(O,"dashOffset",0,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(O,"shadowColor",void 0,(0,s.getStringValidator)()),r.Factory.addGetterSetter(O,"shadowBlur",0,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(O,"shadowOpacity",1,(0,s.getNumberValidator)()),r.Factory.addComponentsGetterSetter(O,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(O,"shadowOffsetX",0,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(O,"shadowOffsetY",0,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(O,"fillPatternImage"),r.Factory.addGetterSetter(O,"fill",void 0,(0,s.getStringOrGradientValidator)()),r.Factory.addGetterSetter(O,"fillPatternX",0,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(O,"fillPatternY",0,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(O,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(O,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(O,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(O,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(O,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(O,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(O,"fillEnabled",!0),r.Factory.addGetterSetter(O,"strokeEnabled",!0),r.Factory.addGetterSetter(O,"shadowEnabled",!0),r.Factory.addGetterSetter(O,"dashEnabled",!0),r.Factory.addGetterSetter(O,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(O,"fillPriority","color"),r.Factory.addComponentsGetterSetter(O,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(O,"fillPatternOffsetX",0,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(O,"fillPatternOffsetY",0,(0,s.getNumberValidator)()),r.Factory.addComponentsGetterSetter(O,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(O,"fillPatternScaleX",1,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(O,"fillPatternScaleY",1,(0,s.getNumberValidator)()),r.Factory.addComponentsGetterSetter(O,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(O,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(O,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(O,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(O,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(O,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(O,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(O,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(O,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(O,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(O,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(O,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(O,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(O,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(O,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(O,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(O,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(O,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(O,"fillPatternRotation",0),r.Factory.addGetterSetter(O,"fillRule",void 0,(0,s.getStringValidator)()),r.Factory.backCompat(O,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(Rt);Object.defineProperty(Nu,"__esModule",{value:!0});Nu.Layer=void 0;const Kr=ct,f0=oo,Lo=rt,dm=Pe,O4=pr,vN=ge,SN=Rt,xN=ke,wN="#",_N="beforeDraw",CN="draw",eS=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],kN=eS.length;let Fa=class extends f0.Container{constructor(e){super(e),this.canvas=new O4.SceneCanvas,this.hitCanvas=new O4.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);const n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),e<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[e+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Lo.Node.prototype.moveToTop.call(this);const e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!Lo.Node.prototype.moveUp.call(this))return!1;const n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(Lo.Node.prototype.moveDown.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Lo.Node.prototype.moveToBottom.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const e=this.getNativeCanvasElement();return Lo.Node.prototype.remove.call(this),e&&e.parentNode&&Kr.Util._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:n}){return this.canvas.setSize(e,n),this.hitCanvas.setSize(e,n),this._setSmoothEnabled(),this}_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&Kr.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e=e||{},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),Lo.Node.prototype._toKonvaCanvas.call(this,e)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){Kr.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){Kr.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,Kr.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let n=1,r=!1;for(;;){for(let i=0;i<kN;i++){const s=eS[i],l=this._getIntersection({x:e.x+s.x*n,y:e.y+s.y*n}),u=l.shape;if(u)return u;if(r=!!l.antialiased,!l.antialiased)break}if(r)n+=1;else return null}}_getIntersection(e){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(e.x*n),Math.round(e.y*n),1,1).data,i=r[3];if(i===255){const s=Kr.Util._rgbToHex(r[0],r[1],r[2]),l=SN.shapes[wN+s];return l?{shape:l}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(e,n,r){const i=this.getLayer(),s=e||i&&i.getCanvas();return this._fire(_N,{node:this}),this.clearBeforeDraw()&&s.getContext().clear(),f0.Container.prototype.drawScene.call(this,s,n,r),this._fire(CN,{node:this}),this}drawHit(e,n){const r=this.getLayer(),i=e||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),f0.Container.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){Kr.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return Kr.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return Kr.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Nu.Layer=Fa;Fa.prototype.nodeType="Layer";(0,xN._registerNode)(Fa);dm.Factory.addGetterSetter(Fa,"imageSmoothingEnabled",!0);dm.Factory.addGetterSetter(Fa,"clearBeforeDraw",!0);dm.Factory.addGetterSetter(Fa,"hitGraphEnabled",!0,(0,vN.getBooleanValidator)());var Eh={};Object.defineProperty(Eh,"__esModule",{value:!0});Eh.FastLayer=void 0;const EN=ct,PN=Nu,NN=ke;class hm extends PN.Layer{constructor(e){super(e),this.listening(!1),EN.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Eh.FastLayer=hm;hm.prototype.nodeType="FastLayer";(0,NN._registerNode)(hm);var Aa={};Object.defineProperty(Aa,"__esModule",{value:!0});Aa.Group=void 0;const RN=ct,TN=oo,ON=ke;class fm extends TN.Container{_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&RN.Util.throw("You may only add groups and shapes to groups.")}}Aa.Group=fm;fm.prototype.nodeType="Group";(0,ON._registerNode)(fm);var Ma={};Object.defineProperty(Ma,"__esModule",{value:!0});Ma.Animation=void 0;const p0=ke,b4=ct,g0=function(){return p0.glob.performance&&p0.glob.performance.now?function(){return p0.glob.performance.now()}:function(){return new Date().getTime()}}();class Fr{constructor(e,n){this.id=Fr.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:g0(),frameRate:0},this.func=e,this.setLayers(n)}setLayers(e){let n=[];return e&&(n=Array.isArray(e)?e:[e]),this.layers=n,this}getLayers(){return this.layers}addLayer(e){const n=this.layers,r=n.length;for(let i=0;i<r;i++)if(n[i]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){const n=Fr.animations,r=n.length;for(let i=0;i<r;i++)if(n[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=g0(),Fr._addAnimation(this),this}stop(){return Fr._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){const n=e.id,r=this.animations,i=r.length;for(let s=0;s<i;s++)if(r[s].id===n){this.animations.splice(s,1);break}}static _runFrames(){const e={},n=this.animations;for(let r=0;r<n.length;r++){const i=n[r],s=i.layers,l=i.func;i._updateFrameObject(g0());const u=s.length;let c;if(l?c=l.call(i,i.frame)!==!1:c=!0,!!c)for(let h=0;h<u;h++){const p=s[h];p._id!==void 0&&(e[p._id]=p)}}for(const r in e)e.hasOwnProperty(r)&&e[r].batchDraw()}static _animationLoop(){const e=Fr;e.animations.length?(e._runFrames(),b4.Util.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,b4.Util.requestAnimFrame(this._animationLoop))}}Ma.Animation=Fr;Fr.animations=[];Fr.animIdCounter=0;Fr.animRunning=!1;var tS={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Easings=t.Tween=void 0;const e=ct,n=Ma,r=rt,i=ke,s={node:1,duration:1,easing:1,onFinish:1,yoyo:1},l=1,u=2,c=3,h=["fill","stroke","shadowColor"];let p=0;class y{constructor(m,C,P,E,k,v,_){this.prop=m,this.propFunc=C,this.begin=E,this._pos=E,this.duration=v,this._change=0,this.prevPos=0,this.yoyo=_,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=P,this._change=k-this.begin,this.pause()}fire(m){const C=this[m];C&&C()}setTime(m){m>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():m<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=m,this.update())}getTime(){return this._time}setPosition(m){this.prevPos=this._pos,this.propFunc(m),this._pos=m}getPosition(m){return m===void 0&&(m=this._time),this.func(m,this.begin,this._change,this.duration)}play(){this.state=u,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=c,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(m){this.pause(),this._time=m,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const m=this.getTimer()-this._startTime;this.state===u?this.setTime(m):this.state===c&&this.setTime(this.duration-m)}pause(){this.state=l,this.fire("onPause")}getTimer(){return new Date().getTime()}}class S{constructor(m){const C=this,P=m.node,E=P._id,k=m.easing||t.Easings.Linear,v=!!m.yoyo;let _,R;typeof m.duration>"u"?_=.3:m.duration===0?_=.001:_=m.duration,this.node=P,this._id=p++;const b=P.getLayer()||(P instanceof i.Konva.Stage?P.getLayers():null);b||e.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new n.Animation(function(){C.tween.onEnterFrame()},b),this.tween=new y(R,function(A){C._tweenFunc(A)},k,0,1,_*1e3,v),this._addListeners(),S.attrs[E]||(S.attrs[E]={}),S.attrs[E][this._id]||(S.attrs[E][this._id]={}),S.tweens[E]||(S.tweens[E]={});for(R in m)s[R]===void 0&&this._addAttr(R,m[R]);this.reset(),this.onFinish=m.onFinish,this.onReset=m.onReset,this.onUpdate=m.onUpdate}_addAttr(m,C){const P=this.node,E=P._id;let k,v,_,R,b;const A=S.tweens[E][m];A&&delete S.attrs[E][A][m];let O=P.getAttr(m);if(e.Util._isArray(C))if(k=[],v=Math.max(C.length,O.length),m==="points"&&C.length!==O.length&&(C.length>O.length?(R=O,O=e.Util._prepareArrayForTween(O,C,P.closed())):(_=C,C=e.Util._prepareArrayForTween(C,O,P.closed()))),m.indexOf("fill")===0)for(let I=0;I<v;I++)if(I%2===0)k.push(C[I]-O[I]);else{const L=e.Util.colorToRGBA(O[I]);b=e.Util.colorToRGBA(C[I]),O[I]=L,k.push({r:b.r-L.r,g:b.g-L.g,b:b.b-L.b,a:b.a-L.a})}else for(let I=0;I<v;I++)k.push(C[I]-O[I]);else h.indexOf(m)!==-1?(O=e.Util.colorToRGBA(O),b=e.Util.colorToRGBA(C),k={r:b.r-O.r,g:b.g-O.g,b:b.b-O.b,a:b.a-O.a}):k=C-O;S.attrs[E][this._id][m]={start:O,diff:k,end:C,trueEnd:_,trueStart:R},S.tweens[E][m]=this._id}_tweenFunc(m){const C=this.node,P=S.attrs[C._id][this._id];let E,k,v,_,R,b,A,O;for(E in P){if(k=P[E],v=k.start,_=k.diff,O=k.end,e.Util._isArray(v))if(R=[],A=Math.max(v.length,O.length),E.indexOf("fill")===0)for(b=0;b<A;b++)b%2===0?R.push((v[b]||0)+_[b]*m):R.push("rgba("+Math.round(v[b].r+_[b].r*m)+","+Math.round(v[b].g+_[b].g*m)+","+Math.round(v[b].b+_[b].b*m)+","+(v[b].a+_[b].a*m)+")");else for(b=0;b<A;b++)R.push((v[b]||0)+_[b]*m);else h.indexOf(E)!==-1?R="rgba("+Math.round(v.r+_.r*m)+","+Math.round(v.g+_.g*m)+","+Math.round(v.b+_.b*m)+","+(v.a+_.a*m)+")":R=v+_*m;C.setAttr(E,R)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const m=this.node,C=S.attrs[m._id][this._id];C.points&&C.points.trueEnd&&m.setAttr("points",C.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const m=this.node,C=S.attrs[m._id][this._id];C.points&&C.points.trueStart&&m.points(C.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(m){return this.tween.seek(m*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const m=this.node._id,C=this._id,P=S.tweens[m];this.pause(),this.anim&&this.anim.stop();for(const E in P)delete S.tweens[m][E];delete S.attrs[m][C],S.tweens[m]&&(Object.keys(S.tweens[m]).length===0&&delete S.tweens[m],Object.keys(S.attrs[m]).length===0&&delete S.attrs[m])}}t.Tween=S,S.attrs={},S.tweens={},r.Node.prototype.to=function(x){const m=x.onFinish;x.node=this,x.onFinish=function(){this.destroy(),m&&m()},new S(x).play()},t.Easings={BackEaseIn(x,m,C,P){return C*(x/=P)*x*((1.70158+1)*x-1.70158)+m},BackEaseOut(x,m,C,P){return C*((x=x/P-1)*x*((1.70158+1)*x+1.70158)+1)+m},BackEaseInOut(x,m,C,P){let E=1.70158;return(x/=P/2)<1?C/2*(x*x*(((E*=1.525)+1)*x-E))+m:C/2*((x-=2)*x*(((E*=1.525)+1)*x+E)+2)+m},ElasticEaseIn(x,m,C,P,E,k){let v=0;return x===0?m:(x/=P)===1?m+C:(k||(k=P*.3),!E||E<Math.abs(C)?(E=C,v=k/4):v=k/(2*Math.PI)*Math.asin(C/E),-(E*Math.pow(2,10*(x-=1))*Math.sin((x*P-v)*(2*Math.PI)/k))+m)},ElasticEaseOut(x,m,C,P,E,k){let v=0;return x===0?m:(x/=P)===1?m+C:(k||(k=P*.3),!E||E<Math.abs(C)?(E=C,v=k/4):v=k/(2*Math.PI)*Math.asin(C/E),E*Math.pow(2,-10*x)*Math.sin((x*P-v)*(2*Math.PI)/k)+C+m)},ElasticEaseInOut(x,m,C,P,E,k){let v=0;return x===0?m:(x/=P/2)===2?m+C:(k||(k=P*(.3*1.5)),!E||E<Math.abs(C)?(E=C,v=k/4):v=k/(2*Math.PI)*Math.asin(C/E),x<1?-.5*(E*Math.pow(2,10*(x-=1))*Math.sin((x*P-v)*(2*Math.PI)/k))+m:E*Math.pow(2,-10*(x-=1))*Math.sin((x*P-v)*(2*Math.PI)/k)*.5+C+m)},BounceEaseOut(x,m,C,P){return(x/=P)<1/2.75?C*(7.5625*x*x)+m:x<2/2.75?C*(7.5625*(x-=1.5/2.75)*x+.75)+m:x<2.5/2.75?C*(7.5625*(x-=2.25/2.75)*x+.9375)+m:C*(7.5625*(x-=2.625/2.75)*x+.984375)+m},BounceEaseIn(x,m,C,P){return C-t.Easings.BounceEaseOut(P-x,0,C,P)+m},BounceEaseInOut(x,m,C,P){return x<P/2?t.Easings.BounceEaseIn(x*2,0,C,P)*.5+m:t.Easings.BounceEaseOut(x*2-P,0,C,P)*.5+C*.5+m},EaseIn(x,m,C,P){return C*(x/=P)*x+m},EaseOut(x,m,C,P){return-C*(x/=P)*(x-2)+m},EaseInOut(x,m,C,P){return(x/=P/2)<1?C/2*x*x+m:-C/2*(--x*(x-2)-1)+m},StrongEaseIn(x,m,C,P){return C*(x/=P)*x*x*x*x+m},StrongEaseOut(x,m,C,P){return C*((x=x/P-1)*x*x*x*x+1)+m},StrongEaseInOut(x,m,C,P){return(x/=P/2)<1?C/2*x*x*x*x*x+m:C/2*((x-=2)*x*x*x*x+2)+m},Linear(x,m,C,P){return C*x/P+m}}})(tS);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;const e=ke,n=ct,r=rt,i=oo,s=X8,l=Nu,u=Eh,c=Aa,h=Ch,p=Rt,y=Ma,S=tS,x=ii,m=pr;t.Konva=n.Util._assign(e.Konva,{Util:n.Util,Transform:n.Transform,Node:r.Node,Container:i.Container,Stage:s.Stage,stages:s.stages,Layer:l.Layer,FastLayer:u.FastLayer,Group:c.Group,DD:h.DD,Shape:p.Shape,shapes:p.shapes,Animation:y.Animation,Tween:S.Tween,Easings:S.Easings,Context:x.Context,Canvas:m.Canvas}),t.default=t.Konva})(Wd);var Ph={};Object.defineProperty(Ph,"__esModule",{value:!0});Ph.Arc=void 0;const Nh=Pe,bN=Rt,L4=ke,Rh=ge,LN=ke;class fi extends bN.Shape{_sceneFunc(e){const n=L4.Konva.getAngle(this.angle()),r=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,n,r),e.arc(0,0,this.innerRadius(),n,0,!r),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),n=this.outerRadius(),r=this.clockwise(),i=L4.Konva.getAngle(r?360-this.angle():this.angle()),s=Math.cos(Math.min(i,Math.PI)),l=1,u=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),c=Math.sin(Math.min(i,Math.PI/2)),h=s*(s>0?e:n),p=l*n,y=u*(u>0?e:n),S=c*(c>0?n:e);return{x:h,y:r?-1*S:y,width:p-h,height:S-y}}}Ph.Arc=fi;fi.prototype._centroid=!0;fi.prototype.className="Arc";fi.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];(0,LN._registerNode)(fi);Nh.Factory.addGetterSetter(fi,"innerRadius",0,(0,Rh.getNumberValidator)());Nh.Factory.addGetterSetter(fi,"outerRadius",0,(0,Rh.getNumberValidator)());Nh.Factory.addGetterSetter(fi,"angle",0,(0,Rh.getNumberValidator)());Nh.Factory.addGetterSetter(fi,"clockwise",!1,(0,Rh.getBooleanValidator)());var Th={},Ru={};Object.defineProperty(Ru,"__esModule",{value:!0});Ru.Line=void 0;const Oh=Pe,FN=ke,AN=Rt,nS=ge;function Hg(t,e,n,r,i,s,l){const u=Math.sqrt(Math.pow(n-t,2)+Math.pow(r-e,2)),c=Math.sqrt(Math.pow(i-n,2)+Math.pow(s-r,2)),h=l*u/(u+c),p=l*c/(u+c),y=n-h*(i-t),S=r-h*(s-e),x=n+p*(i-t),m=r+p*(s-e);return[y,S,x,m]}function F4(t,e){const n=t.length,r=[];for(let i=2;i<n-2;i+=2){const s=Hg(t[i-2],t[i-1],t[i],t[i+1],t[i+2],t[i+3],e);isNaN(s[0])||(r.push(s[0]),r.push(s[1]),r.push(t[i]),r.push(t[i+1]),r.push(s[2]),r.push(s[3]))}return r}class us extends AN.Shape{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){const n=this.points(),r=n.length,i=this.tension(),s=this.closed(),l=this.bezier();if(!r)return;let u=0;if(e.beginPath(),e.moveTo(n[0],n[1]),i!==0&&r>4){const c=this.getTensionPoints(),h=c.length;for(u=s?0:4,s||e.quadraticCurveTo(c[0],c[1],c[2],c[3]);u<h-2;)e.bezierCurveTo(c[u++],c[u++],c[u++],c[u++],c[u++],c[u++]);s||e.quadraticCurveTo(c[h-2],c[h-1],n[r-2],n[r-1])}else if(l)for(u=2;u<r;)e.bezierCurveTo(n[u++],n[u++],n[u++],n[u++],n[u++],n[u++]);else for(u=2;u<r;u+=2)e.lineTo(n[u],n[u+1]);s?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():F4(this.points(),this.tension())}_getTensionPointsClosed(){const e=this.points(),n=e.length,r=this.tension(),i=Hg(e[n-2],e[n-1],e[0],e[1],e[2],e[3],r),s=Hg(e[n-4],e[n-3],e[n-2],e[n-1],e[0],e[1],r),l=F4(e,r);return[i[2],i[3]].concat(l).concat([s[0],s[1],e[n-2],e[n-1],s[2],s[3],i[0],i[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:e=this.points();let n=e[0],r=e[0],i=e[1],s=e[1],l,u;for(let c=0;c<e.length/2;c++)l=e[c*2],u=e[c*2+1],n=Math.min(n,l),r=Math.max(r,l),i=Math.min(i,u),s=Math.max(s,u);return{x:n,y:i,width:r-n,height:s-i}}}Ru.Line=us;us.prototype.className="Line";us.prototype._attrsAffectingSize=["points","bezier","tension"];(0,FN._registerNode)(us);Oh.Factory.addGetterSetter(us,"closed",!1);Oh.Factory.addGetterSetter(us,"bezier",!1);Oh.Factory.addGetterSetter(us,"tension",0,(0,nS.getNumberValidator)());Oh.Factory.addGetterSetter(us,"points",[],(0,nS.getNumberArrayValidator)());var Ia={},rS={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.t2length=t.getQuadraticArcLength=t.getCubicArcLength=t.binomialCoefficients=t.cValues=t.tValues=void 0,t.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],t.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],t.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const e=(l,u,c)=>{let h,p;const S=c/2;h=0;for(let x=0;x<20;x++)p=S*t.tValues[20][x]+S,h+=t.cValues[20][x]*r(l,u,p);return S*h};t.getCubicArcLength=e;const n=(l,u,c)=>{c===void 0&&(c=1);const h=l[0]-2*l[1]+l[2],p=u[0]-2*u[1]+u[2],y=2*l[1]-2*l[0],S=2*u[1]-2*u[0],x=4*(h*h+p*p),m=4*(h*y+p*S),C=y*y+S*S;if(x===0)return c*Math.sqrt(Math.pow(l[2]-l[0],2)+Math.pow(u[2]-u[0],2));const P=m/(2*x),E=C/x,k=c+P,v=E-P*P,_=k*k+v>0?Math.sqrt(k*k+v):0,R=P*P+v>0?Math.sqrt(P*P+v):0,b=P+Math.sqrt(P*P+v)!==0?v*Math.log(Math.abs((k+_)/(P+R))):0;return Math.sqrt(x)/2*(k*_-P*R+b)};t.getQuadraticArcLength=n;function r(l,u,c){const h=i(1,c,l),p=i(1,c,u),y=h*h+p*p;return Math.sqrt(y)}const i=(l,u,c)=>{const h=c.length-1;let p,y;if(h===0)return 0;if(l===0){y=0;for(let S=0;S<=h;S++)y+=t.binomialCoefficients[h][S]*Math.pow(1-u,h-S)*Math.pow(u,S)*c[S];return y}else{p=new Array(h);for(let S=0;S<h;S++)p[S]=h*(c[S+1]-c[S]);return i(l-1,u,p)}},s=(l,u,c)=>{let h=1,p=l/u,y=(l-c(p))/u,S=0;for(;h>.001;){const x=c(p+y),m=Math.abs(l-x)/u;if(m<h)h=m,p+=y;else{const C=c(p-y),P=Math.abs(l-C)/u;P<h?(h=P,p-=y):y/=2}if(S++,S>500)break}return p};t.t2length=s})(rS);Object.defineProperty(Ia,"__esModule",{value:!0});Ia.Path=void 0;const MN=Pe,IN=ke,DN=Rt,Fo=rS;class kt extends DN.Shape{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=kt.parsePathData(this.data()),this.pathLength=kt.getPathLength(this.dataArray)}_sceneFunc(e){const n=this.dataArray;e.beginPath();let r=!1;for(let i=0;i<n.length;i++){const s=n[i].command,l=n[i].points;switch(s){case"L":e.lineTo(l[0],l[1]);break;case"M":e.moveTo(l[0],l[1]);break;case"C":e.bezierCurveTo(l[0],l[1],l[2],l[3],l[4],l[5]);break;case"Q":e.quadraticCurveTo(l[0],l[1],l[2],l[3]);break;case"A":const u=l[0],c=l[1],h=l[2],p=l[3],y=l[4],S=l[5],x=l[6],m=l[7],C=h>p?h:p,P=h>p?1:h/p,E=h>p?p/h:1;e.translate(u,c),e.rotate(x),e.scale(P,E),e.arc(0,0,C,y,y+S,1-m),e.scale(1/P,1/E),e.rotate(-x),e.translate(-u,-c);break;case"z":r=!0,e.closePath();break}}!r&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let e=[];this.dataArray.forEach(function(c){if(c.command==="A"){const h=c.points[4],p=c.points[5],y=c.points[4]+p;let S=Math.PI/180;if(Math.abs(h-y)<S&&(S=Math.abs(h-y)),p<0)for(let x=h-S;x>y;x-=S){const m=kt.getPointOnEllipticalArc(c.points[0],c.points[1],c.points[2],c.points[3],x,0);e.push(m.x,m.y)}else for(let x=h+S;x<y;x+=S){const m=kt.getPointOnEllipticalArc(c.points[0],c.points[1],c.points[2],c.points[3],x,0);e.push(m.x,m.y)}}else if(c.command==="C")for(let h=0;h<=1;h+=.01){const p=kt.getPointOnCubicBezier(h,c.start.x,c.start.y,c.points[0],c.points[1],c.points[2],c.points[3],c.points[4],c.points[5]);e.push(p.x,p.y)}else e=e.concat(c.points)});let n=e[0],r=e[0],i=e[1],s=e[1],l,u;for(let c=0;c<e.length/2;c++)l=e[c*2],u=e[c*2+1],isNaN(l)||(n=Math.min(n,l),r=Math.max(r,l)),isNaN(u)||(i=Math.min(i,u),s=Math.max(s,u));return{x:n,y:i,width:r-n,height:s-i}}getLength(){return this.pathLength}getPointAtLength(e){return kt.getPointAtLengthOfDataArray(e,this.dataArray)}static getLineLength(e,n,r,i){return Math.sqrt((r-e)*(r-e)+(i-n)*(i-n))}static getPathLength(e){let n=0;for(let r=0;r<e.length;++r)n+=e[r].pathLength;return n}static getPointAtLengthOfDataArray(e,n){let r,i=0,s=n.length;if(!s)return null;for(;i<s&&e>n[i].pathLength;)e-=n[i].pathLength,++i;if(i===s)return r=n[i-1].points.slice(-2),{x:r[0],y:r[1]};if(e<.01)return n[i].command==="M"?(r=n[i].points.slice(0,2),{x:r[0],y:r[1]}):{x:n[i].start.x,y:n[i].start.y};const l=n[i],u=l.points;switch(l.command){case"L":return kt.getPointOnLine(e,l.start.x,l.start.y,u[0],u[1]);case"C":return kt.getPointOnCubicBezier((0,Fo.t2length)(e,kt.getPathLength(n),C=>(0,Fo.getCubicArcLength)([l.start.x,u[0],u[2],u[4]],[l.start.y,u[1],u[3],u[5]],C)),l.start.x,l.start.y,u[0],u[1],u[2],u[3],u[4],u[5]);case"Q":return kt.getPointOnQuadraticBezier((0,Fo.t2length)(e,kt.getPathLength(n),C=>(0,Fo.getQuadraticArcLength)([l.start.x,u[0],u[2]],[l.start.y,u[1],u[3]],C)),l.start.x,l.start.y,u[0],u[1],u[2],u[3]);case"A":const c=u[0],h=u[1],p=u[2],y=u[3],S=u[5],x=u[6];let m=u[4];return m+=S*e/l.pathLength,kt.getPointOnEllipticalArc(c,h,p,y,m,x)}return null}static getPointOnLine(e,n,r,i,s,l,u){l=l??n,u=u??r;const c=this.getLineLength(n,r,i,s);if(c<1e-10)return{x:n,y:r};if(i===n)return{x:l,y:u+(s>r?e:-e)};const h=(s-r)/(i-n),p=Math.sqrt(e*e/(1+h*h))*(i<n?-1:1),y=h*p;if(Math.abs(u-r-h*(l-n))<1e-10)return{x:l+p,y:u+y};const S=((l-n)*(i-n)+(u-r)*(s-r))/(c*c),x=n+S*(i-n),m=r+S*(s-r),C=this.getLineLength(l,u,x,m),P=Math.sqrt(e*e-C*C),E=Math.sqrt(P*P/(1+h*h))*(i<n?-1:1),k=h*E;return{x:x+E,y:m+k}}static getPointOnCubicBezier(e,n,r,i,s,l,u,c,h){function p(P){return P*P*P}function y(P){return 3*P*P*(1-P)}function S(P){return 3*P*(1-P)*(1-P)}function x(P){return(1-P)*(1-P)*(1-P)}const m=c*p(e)+l*y(e)+i*S(e)+n*x(e),C=h*p(e)+u*y(e)+s*S(e)+r*x(e);return{x:m,y:C}}static getPointOnQuadraticBezier(e,n,r,i,s,l,u){function c(x){return x*x}function h(x){return 2*x*(1-x)}function p(x){return(1-x)*(1-x)}const y=l*c(e)+i*h(e)+n*p(e),S=u*c(e)+s*h(e)+r*p(e);return{x:y,y:S}}static getPointOnEllipticalArc(e,n,r,i,s,l){const u=Math.cos(l),c=Math.sin(l),h={x:r*Math.cos(s),y:i*Math.sin(s)};return{x:e+(h.x*u-h.y*c),y:n+(h.x*c+h.y*u)}}static parsePathData(e){if(!e)return[];let n=e;const r=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(let y=0;y<r.length;y++)n=n.replace(new RegExp(r[y],"g"),"|"+r[y]);const i=n.split("|"),s=[],l=[];let u=0,c=0;const h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let p;for(let y=1;y<i.length;y++){let S=i[y],x=S.charAt(0);for(S=S.slice(1),l.length=0;p=h.exec(S);)l.push(p[0]);const m=[];for(let C=0,P=l.length;C<P;C++){if(l[C]==="00"){m.push(0,0);continue}const E=parseFloat(l[C]);isNaN(E)?m.push(0):m.push(E)}for(;m.length>0&&!isNaN(m[0]);){let C="",P=[];const E=u,k=c;let v,_,R,b,A,O,I,L,H,B;switch(x){case"l":u+=m.shift(),c+=m.shift(),C="L",P.push(u,c);break;case"L":u=m.shift(),c=m.shift(),P.push(u,c);break;case"m":const $=m.shift(),q=m.shift();if(u+=$,c+=q,C="M",s.length>2&&s[s.length-1].command==="z"){for(let Q=s.length-2;Q>=0;Q--)if(s[Q].command==="M"){u=s[Q].points[0]+$,c=s[Q].points[1]+q;break}}P.push(u,c),x="l";break;case"M":u=m.shift(),c=m.shift(),C="M",P.push(u,c),x="L";break;case"h":u+=m.shift(),C="L",P.push(u,c);break;case"H":u=m.shift(),C="L",P.push(u,c);break;case"v":c+=m.shift(),C="L",P.push(u,c);break;case"V":c=m.shift(),C="L",P.push(u,c);break;case"C":P.push(m.shift(),m.shift(),m.shift(),m.shift()),u=m.shift(),c=m.shift(),P.push(u,c);break;case"c":P.push(u+m.shift(),c+m.shift(),u+m.shift(),c+m.shift()),u+=m.shift(),c+=m.shift(),C="C",P.push(u,c);break;case"S":_=u,R=c,v=s[s.length-1],v.command==="C"&&(_=u+(u-v.points[2]),R=c+(c-v.points[3])),P.push(_,R,m.shift(),m.shift()),u=m.shift(),c=m.shift(),C="C",P.push(u,c);break;case"s":_=u,R=c,v=s[s.length-1],v.command==="C"&&(_=u+(u-v.points[2]),R=c+(c-v.points[3])),P.push(_,R,u+m.shift(),c+m.shift()),u+=m.shift(),c+=m.shift(),C="C",P.push(u,c);break;case"Q":P.push(m.shift(),m.shift()),u=m.shift(),c=m.shift(),P.push(u,c);break;case"q":P.push(u+m.shift(),c+m.shift()),u+=m.shift(),c+=m.shift(),C="Q",P.push(u,c);break;case"T":_=u,R=c,v=s[s.length-1],v.command==="Q"&&(_=u+(u-v.points[0]),R=c+(c-v.points[1])),u=m.shift(),c=m.shift(),C="Q",P.push(_,R,u,c);break;case"t":_=u,R=c,v=s[s.length-1],v.command==="Q"&&(_=u+(u-v.points[0]),R=c+(c-v.points[1])),u+=m.shift(),c+=m.shift(),C="Q",P.push(_,R,u,c);break;case"A":b=m.shift(),A=m.shift(),O=m.shift(),I=m.shift(),L=m.shift(),H=u,B=c,u=m.shift(),c=m.shift(),C="A",P=this.convertEndpointToCenterParameterization(H,B,u,c,I,L,b,A,O);break;case"a":b=m.shift(),A=m.shift(),O=m.shift(),I=m.shift(),L=m.shift(),H=u,B=c,u+=m.shift(),c+=m.shift(),C="A",P=this.convertEndpointToCenterParameterization(H,B,u,c,I,L,b,A,O);break}s.push({command:C||x,points:P,start:{x:E,y:k},pathLength:this.calcLength(E,k,C||x,P)})}(x==="z"||x==="Z")&&s.push({command:"z",points:[],start:void 0,pathLength:0})}return s}static calcLength(e,n,r,i){let s,l,u,c;const h=kt;switch(r){case"L":return h.getLineLength(e,n,i[0],i[1]);case"C":return(0,Fo.getCubicArcLength)([e,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return(0,Fo.getQuadraticArcLength)([e,i[0],i[2]],[n,i[1],i[3]],1);case"A":s=0;const p=i[4],y=i[5],S=i[4]+y;let x=Math.PI/180;if(Math.abs(p-S)<x&&(x=Math.abs(p-S)),l=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],p,0),y<0)for(c=p-x;c>S;c-=x)u=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],c,0),s+=h.getLineLength(l.x,l.y,u.x,u.y),l=u;else for(c=p+x;c<S;c+=x)u=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],c,0),s+=h.getLineLength(l.x,l.y,u.x,u.y),l=u;return u=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],S,0),s+=h.getLineLength(l.x,l.y,u.x,u.y),s}return 0}static convertEndpointToCenterParameterization(e,n,r,i,s,l,u,c,h){const p=h*(Math.PI/180),y=Math.cos(p)*(e-r)/2+Math.sin(p)*(n-i)/2,S=-1*Math.sin(p)*(e-r)/2+Math.cos(p)*(n-i)/2,x=y*y/(u*u)+S*S/(c*c);x>1&&(u*=Math.sqrt(x),c*=Math.sqrt(x));let m=Math.sqrt((u*u*(c*c)-u*u*(S*S)-c*c*(y*y))/(u*u*(S*S)+c*c*(y*y)));s===l&&(m*=-1),isNaN(m)&&(m=0);const C=m*u*S/c,P=m*-c*y/u,E=(e+r)/2+Math.cos(p)*C-Math.sin(p)*P,k=(n+i)/2+Math.sin(p)*C+Math.cos(p)*P,v=function(L){return Math.sqrt(L[0]*L[0]+L[1]*L[1])},_=function(L,H){return(L[0]*H[0]+L[1]*H[1])/(v(L)*v(H))},R=function(L,H){return(L[0]*H[1]<L[1]*H[0]?-1:1)*Math.acos(_(L,H))},b=R([1,0],[(y-C)/u,(S-P)/c]),A=[(y-C)/u,(S-P)/c],O=[(-1*y-C)/u,(-1*S-P)/c];let I=R(A,O);return _(A,O)<=-1&&(I=Math.PI),_(A,O)>=1&&(I=0),l===0&&I>0&&(I=I-2*Math.PI),l===1&&I<0&&(I=I+2*Math.PI),[E,k,u,c,b,I,p,l]}}Ia.Path=kt;kt.prototype.className="Path";kt.prototype._attrsAffectingSize=["data"];(0,IN._registerNode)(kt);MN.Factory.addGetterSetter(kt,"data");Object.defineProperty(Th,"__esModule",{value:!0});Th.Arrow=void 0;const bh=Pe,jN=Ru,iS=ge,UN=ke,A4=Ia;class lo extends jN.Line{_sceneFunc(e){super._sceneFunc(e);const n=Math.PI*2,r=this.points();let i=r;const s=this.tension()!==0&&r.length>4;s&&(i=this.getTensionPoints());const l=this.pointerLength(),u=r.length;let c,h;if(s){const S=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[u-2],r[u-1]],x=A4.Path.calcLength(i[i.length-4],i[i.length-3],"C",S),m=A4.Path.getPointOnQuadraticBezier(Math.min(1,1-l/x),S[0],S[1],S[2],S[3],S[4],S[5]);c=r[u-2]-m.x,h=r[u-1]-m.y}else c=r[u-2]-r[u-4],h=r[u-1]-r[u-3];const p=(Math.atan2(h,c)+n)%n,y=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(r[u-2],r[u-1]),e.rotate(p),e.moveTo(0,0),e.lineTo(-l,y/2),e.lineTo(-l,-y/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(r[0],r[1]),s?(c=(i[0]+i[2])/2-r[0],h=(i[1]+i[3])/2-r[1]):(c=r[2]-r[0],h=r[3]-r[1]),e.rotate((Math.atan2(-h,-c)+n)%n),e.moveTo(0,0),e.lineTo(-l,y/2),e.lineTo(-l,-y/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){const n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),n=this.pointerWidth()/2;return{x:e.x,y:e.y-n,width:e.width,height:e.height+n*2}}}Th.Arrow=lo;lo.prototype.className="Arrow";(0,UN._registerNode)(lo);bh.Factory.addGetterSetter(lo,"pointerLength",10,(0,iS.getNumberValidator)());bh.Factory.addGetterSetter(lo,"pointerWidth",10,(0,iS.getNumberValidator)());bh.Factory.addGetterSetter(lo,"pointerAtBeginning",!1);bh.Factory.addGetterSetter(lo,"pointerAtEnding",!0);var Lh={};Object.defineProperty(Lh,"__esModule",{value:!0});Lh.Circle=void 0;const zN=Pe,BN=Rt,GN=ge,HN=ke;class Da extends BN.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}Lh.Circle=Da;Da.prototype._centroid=!0;Da.prototype.className="Circle";Da.prototype._attrsAffectingSize=["radius"];(0,HN._registerNode)(Da);zN.Factory.addGetterSetter(Da,"radius",0,(0,GN.getNumberValidator)());var Fh={};Object.defineProperty(Fh,"__esModule",{value:!0});Fh.Ellipse=void 0;const pm=Pe,VN=Rt,sS=ge,WN=ke;class cs extends VN.Shape{_sceneFunc(e){const n=this.radiusX(),r=this.radiusY();e.beginPath(),e.save(),n!==r&&e.scale(1,r/n),e.arc(0,0,n,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}Fh.Ellipse=cs;cs.prototype.className="Ellipse";cs.prototype._centroid=!0;cs.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,WN._registerNode)(cs);pm.Factory.addComponentsGetterSetter(cs,"radius",["x","y"]);pm.Factory.addGetterSetter(cs,"radiusX",0,(0,sS.getNumberValidator)());pm.Factory.addGetterSetter(cs,"radiusY",0,(0,sS.getNumberValidator)());var Ah={};Object.defineProperty(Ah,"__esModule",{value:!0});Ah.Image=void 0;const m0=ct,uo=Pe,KN=Rt,$N=ke,Tu=ge;let Dr=class oS extends KN.Shape{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",n=>{this._removeImageLoad(n.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",this._loadListener)}_removeImageLoad(e){e&&e.removeEventListener&&e.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const e=!!this.cornerRadius(),n=this.hasShadow();return e&&n?!0:super._useBufferCanvas(!0)}_sceneFunc(e){const n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),s=this.attrs.image;let l;if(s){const u=this.attrs.cropWidth,c=this.attrs.cropHeight;u&&c?l=[s,this.cropX(),this.cropY(),u,c,0,0,n,r]:l=[s,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(e.beginPath(),i?m0.Util.drawRoundedRectPath(e,n,r,i):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)),s&&(i&&e.clip(),e.drawImage.apply(e,l))}_hitFunc(e){const n=this.width(),r=this.height(),i=this.cornerRadius();e.beginPath(),i?m0.Util.drawRoundedRectPath(e,n,r,i):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,n;return(e=this.attrs.width)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var e,n;return(e=this.attrs.height)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(e,n,r=null){const i=m0.Util.createImageElement();i.onload=function(){const s=new oS({image:i});n(s)},i.onerror=r,i.crossOrigin="Anonymous",i.src=e}};Ah.Image=Dr;Dr.prototype.className="Image";(0,$N._registerNode)(Dr);uo.Factory.addGetterSetter(Dr,"cornerRadius",0,(0,Tu.getNumberOrArrayOfNumbersValidator)(4));uo.Factory.addGetterSetter(Dr,"image");uo.Factory.addComponentsGetterSetter(Dr,"crop",["x","y","width","height"]);uo.Factory.addGetterSetter(Dr,"cropX",0,(0,Tu.getNumberValidator)());uo.Factory.addGetterSetter(Dr,"cropY",0,(0,Tu.getNumberValidator)());uo.Factory.addGetterSetter(Dr,"cropWidth",0,(0,Tu.getNumberValidator)());uo.Factory.addGetterSetter(Dr,"cropHeight",0,(0,Tu.getNumberValidator)());var Ca={};Object.defineProperty(Ca,"__esModule",{value:!0});Ca.Tag=Ca.Label=void 0;const Mh=Pe,QN=Rt,qN=Aa,gm=ge,aS=ke,lS=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],YN="Change.konva",XN="none",Vg="up",Wg="right",Kg="down",$g="left",JN=lS.length;class mm extends qN.Group{constructor(e){super(e),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){let n=this,r;const i=function(){n._sync()};for(r=0;r<JN;r++)e.on(lS[r]+YN,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),n=this.getTag(),r,i,s,l,u,c,h;if(e&&n){switch(r=e.width(),i=e.height(),s=n.pointerDirection(),l=n.pointerWidth(),h=n.pointerHeight(),u=0,c=0,s){case Vg:u=r/2,c=-1*h;break;case Wg:u=r+l,c=i/2;break;case Kg:u=r/2,c=i+h;break;case $g:u=-1*l,c=i/2;break}n.setAttrs({x:-1*u,y:-1*c,width:r,height:i}),e.setAttrs({x:-1*u,y:-1*c})}}}Ca.Label=mm;mm.prototype.className="Label";(0,aS._registerNode)(mm);class co extends QN.Shape{_sceneFunc(e){const n=this.width(),r=this.height(),i=this.pointerDirection(),s=this.pointerWidth(),l=this.pointerHeight(),u=this.cornerRadius();let c=0,h=0,p=0,y=0;typeof u=="number"?c=h=p=y=Math.min(u,n/2,r/2):(c=Math.min(u[0]||0,n/2,r/2),h=Math.min(u[1]||0,n/2,r/2),y=Math.min(u[2]||0,n/2,r/2),p=Math.min(u[3]||0,n/2,r/2)),e.beginPath(),e.moveTo(c,0),i===Vg&&(e.lineTo((n-s)/2,0),e.lineTo(n/2,-1*l),e.lineTo((n+s)/2,0)),e.lineTo(n-h,0),e.arc(n-h,h,h,Math.PI*3/2,0,!1),i===Wg&&(e.lineTo(n,(r-l)/2),e.lineTo(n+s,r/2),e.lineTo(n,(r+l)/2)),e.lineTo(n,r-y),e.arc(n-y,r-y,y,0,Math.PI/2,!1),i===Kg&&(e.lineTo((n+s)/2,r),e.lineTo(n/2,r+l),e.lineTo((n-s)/2,r)),e.lineTo(p,r),e.arc(p,r-p,p,Math.PI/2,Math.PI,!1),i===$g&&(e.lineTo(0,(r+l)/2),e.lineTo(-1*s,r/2),e.lineTo(0,(r-l)/2)),e.lineTo(0,c),e.arc(c,c,c,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=0,n=0,r=this.pointerWidth(),i=this.pointerHeight(),s=this.pointerDirection(),l=this.width(),u=this.height();return s===Vg?(n-=i,u+=i):s===Kg?u+=i:s===$g?(e-=r*1.5,l+=r):s===Wg&&(l+=r*1.5),{x:e,y:n,width:l,height:u}}}Ca.Tag=co;co.prototype.className="Tag";(0,aS._registerNode)(co);Mh.Factory.addGetterSetter(co,"pointerDirection",XN);Mh.Factory.addGetterSetter(co,"pointerWidth",0,(0,gm.getNumberValidator)());Mh.Factory.addGetterSetter(co,"pointerHeight",0,(0,gm.getNumberValidator)());Mh.Factory.addGetterSetter(co,"cornerRadius",0,(0,gm.getNumberOrArrayOfNumbersValidator)(4));var Ou={};Object.defineProperty(Ou,"__esModule",{value:!0});Ou.Rect=void 0;const ZN=Pe,eR=Rt,tR=ke,nR=ct,rR=ge;let Ih=class extends eR.Shape{_sceneFunc(e){const n=this.cornerRadius(),r=this.width(),i=this.height();e.beginPath(),n?nR.Util.drawRoundedRectPath(e,r,i,n):e.rect(0,0,r,i),e.closePath(),e.fillStrokeShape(this)}};Ou.Rect=Ih;Ih.prototype.className="Rect";(0,tR._registerNode)(Ih);ZN.Factory.addGetterSetter(Ih,"cornerRadius",0,(0,rR.getNumberOrArrayOfNumbersValidator)(4));var Dh={};Object.defineProperty(Dh,"__esModule",{value:!0});Dh.RegularPolygon=void 0;const uS=Pe,iR=Rt,cS=ge,sR=ke;class ho extends iR.Shape{_sceneFunc(e){const n=this._getPoints();e.beginPath(),e.moveTo(n[0].x,n[0].y);for(let r=1;r<n.length;r++)e.lineTo(n[r].x,n[r].y);e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,n=this.attrs.radius||0,r=[];for(let i=0;i<e;i++)r.push({x:n*Math.sin(i*2*Math.PI/e),y:-1*n*Math.cos(i*2*Math.PI/e)});return r}getSelfRect(){const e=this._getPoints();let n=e[0].x,r=e[0].y,i=e[0].x,s=e[0].y;return e.forEach(l=>{n=Math.min(n,l.x),r=Math.max(r,l.x),i=Math.min(i,l.y),s=Math.max(s,l.y)}),{x:n,y:i,width:r-n,height:s-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Dh.RegularPolygon=ho;ho.prototype.className="RegularPolygon";ho.prototype._centroid=!0;ho.prototype._attrsAffectingSize=["radius"];(0,sR._registerNode)(ho);uS.Factory.addGetterSetter(ho,"radius",0,(0,cS.getNumberValidator)());uS.Factory.addGetterSetter(ho,"sides",0,(0,cS.getNumberValidator)());var jh={};Object.defineProperty(jh,"__esModule",{value:!0});jh.Ring=void 0;const dS=Pe,oR=Rt,hS=ge,aR=ke,M4=Math.PI*2;class fo extends oR.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,M4,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),M4,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}jh.Ring=fo;fo.prototype.className="Ring";fo.prototype._centroid=!0;fo.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,aR._registerNode)(fo);dS.Factory.addGetterSetter(fo,"innerRadius",0,(0,hS.getNumberValidator)());dS.Factory.addGetterSetter(fo,"outerRadius",0,(0,hS.getNumberValidator)());var Uh={};Object.defineProperty(Uh,"__esModule",{value:!0});Uh.Sprite=void 0;const po=Pe,lR=Rt,uR=Ma,fS=ge,cR=ke;class jr extends lR.Shape{constructor(e){super(e),this._updated=!0,this.anim=new uR.Animation(()=>{const n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){const n=this.animation(),r=this.frameIndex(),i=r*4,s=this.animations()[n],l=this.frameOffsets(),u=s[i+0],c=s[i+1],h=s[i+2],p=s[i+3],y=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,h,p),e.closePath(),e.fillStrokeShape(this)),y)if(l){const S=l[n],x=r*2;e.drawImage(y,u,c,h,p,S[x+0],S[x+1],h,p)}else e.drawImage(y,u,c,h,p,0,0,h,p)}_hitFunc(e){const n=this.animation(),r=this.frameIndex(),i=r*4,s=this.animations()[n],l=this.frameOffsets(),u=s[i+2],c=s[i+3];if(e.beginPath(),l){const h=l[n],p=r*2;e.rect(h[p+0],h[p+1],u,c)}else e.rect(0,0,u,c);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const e=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],s=i.length/4;e<s-1?this.frameIndex(e+1):this.frameIndex(0)}}Uh.Sprite=jr;jr.prototype.className="Sprite";(0,cR._registerNode)(jr);po.Factory.addGetterSetter(jr,"animation");po.Factory.addGetterSetter(jr,"animations");po.Factory.addGetterSetter(jr,"frameOffsets");po.Factory.addGetterSetter(jr,"image");po.Factory.addGetterSetter(jr,"frameIndex",0,(0,fS.getNumberValidator)());po.Factory.addGetterSetter(jr,"frameRate",17,(0,fS.getNumberValidator)());po.Factory.backCompat(jr,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var zh={};Object.defineProperty(zh,"__esModule",{value:!0});zh.Star=void 0;const ym=Pe,dR=Rt,vm=ge,hR=ke;class ds extends dR.Shape{_sceneFunc(e){const n=this.innerRadius(),r=this.outerRadius(),i=this.numPoints();e.beginPath(),e.moveTo(0,0-r);for(let s=1;s<i*2;s++){const l=s%2===0?r:n,u=l*Math.sin(s*Math.PI/i),c=-1*l*Math.cos(s*Math.PI/i);e.lineTo(u,c)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}zh.Star=ds;ds.prototype.className="Star";ds.prototype._centroid=!0;ds.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,hR._registerNode)(ds);ym.Factory.addGetterSetter(ds,"numPoints",5,(0,vm.getNumberValidator)());ym.Factory.addGetterSetter(ds,"innerRadius",0,(0,vm.getNumberValidator)());ym.Factory.addGetterSetter(ds,"outerRadius",0,(0,vm.getNumberValidator)());var ja={};Object.defineProperty(ja,"__esModule",{value:!0});ja.Text=void 0;ja.stringToArray=Ts;const Qg=ct,en=Pe,fR=Rt,y0=ke,hs=ge,pR=ke;function Ts(t){return[...t].reduce((e,n,r,i)=>{if(new RegExp("\\p{Emoji}","u").test(n)){const s=i[r+1];s&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(s)?(e.push(n+s),i[r+1]=""):e.push(n)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(n+(i[r+1]||""))?e.push(n+i[r+1]):r>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(n)?e[e.length-1]+=n:n&&e.push(n);return e},[])}const Ao="auto",gR="center",pS="inherit",ml="justify",mR="Change.konva",yR="2d",I4="-",gS="left",vR="text",SR="Text",xR="top",wR="bottom",D4="middle",mS="normal",_R="px ",Kc=" ",CR="right",j4="rtl",kR="word",ER="char",U4="none",v0="…",yS=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],PR=yS.length;function NR(t){return t.split(",").map(e=>{e=e.trim();const n=e.indexOf(" ")>=0,r=e.indexOf('"')>=0||e.indexOf("'")>=0;return n&&!r&&(e=`"${e}"`),e}).join(", ")}let $c;function S0(){return $c||($c=Qg.Util.createCanvasElement().getContext(yR),$c)}function RR(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function TR(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function OR(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}let pt=class extends fR.Shape{constructor(e){super(OR(e)),this._partialTextX=0,this._partialTextY=0;for(let n=0;n<PR;n++)this.on(yS[n]+mR,this._setTextData);this._setTextData()}_sceneFunc(e){const n=this.textArr,r=n.length;if(!this.text())return;let i=this.padding(),s=this.fontSize(),l=this.lineHeight()*s,u=this.verticalAlign(),c=this.direction(),h=0,p=this.align(),y=this.getWidth(),S=this.letterSpacing(),x=this.fill(),m=this.textDecoration(),C=m.indexOf("underline")!==-1,P=m.indexOf("line-through")!==-1,E;c=c===pS?e.direction:c;let k=l/2,v=D4;if(y0.Konva._fixTextRendering){const _=this.measureSize("M");v="alphabetic",k=(_.fontBoundingBoxAscent-_.fontBoundingBoxDescent)/2+l/2}for(c===j4&&e.setAttr("direction",c),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",v),e.setAttr("textAlign",gS),u===D4?h=(this.getHeight()-r*l-i*2)/2:u===wR&&(h=this.getHeight()-r*l-i*2),e.translate(i,h+i),E=0;E<r;E++){let _=0,R=0;const b=n[E],A=b.text,O=b.width,I=b.lastInParagraph;if(e.save(),p===CR?_+=y-O-i*2:p===gR&&(_+=(y-O-i*2)/2),C){e.save(),e.beginPath();const L=y0.Konva._fixTextRendering?Math.round(s/4):Math.round(s/2),H=_,B=k+R+L;e.moveTo(H,B);const $=p===ml&&!I?y-i*2:O;e.lineTo(H+Math.round($),B),e.lineWidth=s/15;const q=this._getLinearGradient();e.strokeStyle=q||x,e.stroke(),e.restore()}if(P){e.save(),e.beginPath();const L=y0.Konva._fixTextRendering?-Math.round(s/4):0;e.moveTo(_,k+R+L);const H=p===ml&&!I?y-i*2:O;e.lineTo(_+Math.round(H),k+R+L),e.lineWidth=s/15;const B=this._getLinearGradient();e.strokeStyle=B||x,e.stroke(),e.restore()}if(c!==j4&&(S!==0||p===ml)){const L=A.split(" ").length-1,H=Ts(A);for(let B=0;B<H.length;B++){const $=H[B];$===" "&&!I&&p===ml&&(_+=(y-i*2-O)/L),this._partialTextX=_,this._partialTextY=k+R,this._partialText=$,e.fillStrokeShape(this),_+=this.measureSize($).width+S}}else S!==0&&e.setAttr("letterSpacing",`${S}px`),this._partialTextX=_,this._partialTextY=k+R,this._partialText=A,e.fillStrokeShape(this);e.restore(),r>1&&(k+=l)}}_hitFunc(e){const n=this.getWidth(),r=this.getHeight();e.beginPath(),e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}setText(e){const n=Qg.Util._isString(e)?e:e==null?"":e+"";return this._setAttr(vR,n),this}getWidth(){return this.attrs.width===Ao||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===Ao||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return Qg.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var n,r,i,s,l,u,c,h,p,y,S;let x=S0(),m=this.fontSize(),C;x.save(),x.font=this._getContextFont(),C=x.measureText(e),x.restore();const P=m/100;return{actualBoundingBoxAscent:(n=C.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*P,actualBoundingBoxDescent:(r=C.actualBoundingBoxDescent)!==null&&r!==void 0?r:0,actualBoundingBoxLeft:(i=C.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*P,actualBoundingBoxRight:(s=C.actualBoundingBoxRight)!==null&&s!==void 0?s:75.732421875*P,alphabeticBaseline:(l=C.alphabeticBaseline)!==null&&l!==void 0?l:0,emHeightAscent:(u=C.emHeightAscent)!==null&&u!==void 0?u:100*P,emHeightDescent:(c=C.emHeightDescent)!==null&&c!==void 0?c:-20*P,fontBoundingBoxAscent:(h=C.fontBoundingBoxAscent)!==null&&h!==void 0?h:91*P,fontBoundingBoxDescent:(p=C.fontBoundingBoxDescent)!==null&&p!==void 0?p:21*P,hangingBaseline:(y=C.hangingBaseline)!==null&&y!==void 0?y:72.80000305175781*P,ideographicBaseline:(S=C.ideographicBaseline)!==null&&S!==void 0?S:-21*P,width:C.width,height:m}}_getContextFont(){return this.fontStyle()+Kc+this.fontVariant()+Kc+(this.fontSize()+_R)+NR(this.fontFamily())}_addTextLine(e){this.align()===ml&&(e=e.trim());const r=this._getTextWidth(e);return this.textArr.push({text:e,width:r,lastInParagraph:!1})}_getTextWidth(e){const n=this.letterSpacing(),r=e.length;return S0().measureText(e).width+n*r}_setTextData(){let e=this.text().split(`
`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,s=this.attrs.width,l=this.attrs.height,u=s!==Ao&&s!==void 0,c=l!==Ao&&l!==void 0,h=this.padding(),p=s-h*2,y=l-h*2,S=0,x=this.wrap(),m=x!==U4,C=x!==ER&&m,P=this.ellipsis();this.textArr=[],S0().font=this._getContextFont();const E=P?this._getTextWidth(v0):0;for(let k=0,v=e.length;k<v;++k){let _=e[k],R=this._getTextWidth(_);if(u&&R>p)for(;_.length>0;){let b=0,A=Ts(_).length,O="",I=0;for(;b<A;){const L=b+A>>>1,H=Ts(_),B=H.slice(0,L+1).join(""),$=this._getTextWidth(B);(P&&c&&S+i>y?$+E:$)<=p?(b=L+1,O=B,I=$):A=L}if(O){if(C){const B=Ts(_),$=Ts(O),q=B[$.length],Q=q===Kc||q===I4;let re;if(Q&&I<=p)re=$.length;else{const he=$.lastIndexOf(Kc),W=$.lastIndexOf(I4);re=Math.max(he,W)+1}re>0&&(b=re,O=B.slice(0,b).join(""),I=this._getTextWidth(O))}if(O=O.trimRight(),this._addTextLine(O),r=Math.max(r,I),S+=i,this._shouldHandleEllipsis(S)){this._tryToAddEllipsisToLastLine();break}if(_=Ts(_).slice(b).join("").trimLeft(),_.length>0&&(R=this._getTextWidth(_),R<=p)){this._addTextLine(_),S+=i,r=Math.max(r,R);break}}else break}else this._addTextLine(_),S+=i,r=Math.max(r,R),this._shouldHandleEllipsis(S)&&k<v-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),c&&S+i>y)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(e){const n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,s=i!==Ao&&i!==void 0,l=this.padding(),u=i-l*2;return!(this.wrap()!==U4)||s&&e+r>u}_tryToAddEllipsisToLastLine(){const e=this.attrs.width,n=e!==Ao&&e!==void 0,r=this.padding(),i=e-r*2,s=this.ellipsis(),l=this.textArr[this.textArr.length-1];!l||!s||(n&&(this._getTextWidth(l.text+v0)<i||(l.text=l.text.slice(0,l.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(l.text+v0))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const e=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,n=this.hasShadow();return e&&n?!0:super._useBufferCanvas()}};ja.Text=pt;pt.prototype._fillFunc=RR;pt.prototype._strokeFunc=TR;pt.prototype.className=SR;pt.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,pR._registerNode)(pt);en.Factory.overWriteSetter(pt,"width",(0,hs.getNumberOrAutoValidator)());en.Factory.overWriteSetter(pt,"height",(0,hs.getNumberOrAutoValidator)());en.Factory.addGetterSetter(pt,"direction",pS);en.Factory.addGetterSetter(pt,"fontFamily","Arial");en.Factory.addGetterSetter(pt,"fontSize",12,(0,hs.getNumberValidator)());en.Factory.addGetterSetter(pt,"fontStyle",mS);en.Factory.addGetterSetter(pt,"fontVariant",mS);en.Factory.addGetterSetter(pt,"padding",0,(0,hs.getNumberValidator)());en.Factory.addGetterSetter(pt,"align",gS);en.Factory.addGetterSetter(pt,"verticalAlign",xR);en.Factory.addGetterSetter(pt,"lineHeight",1,(0,hs.getNumberValidator)());en.Factory.addGetterSetter(pt,"wrap",kR);en.Factory.addGetterSetter(pt,"ellipsis",!1,(0,hs.getBooleanValidator)());en.Factory.addGetterSetter(pt,"letterSpacing",0,(0,hs.getNumberValidator)());en.Factory.addGetterSetter(pt,"text","",(0,hs.getStringValidator)());en.Factory.addGetterSetter(pt,"textDecoration","");var Bh={};Object.defineProperty(Bh,"__esModule",{value:!0});Bh.TextPath=void 0;const x0=ct,yr=Pe,bR=Rt,yl=Ia,w0=ja,vS=ge,LR=ke,FR="",SS="normal";function xS(t){t.fillText(this.partialText,0,0)}function wS(t){t.strokeText(this.partialText,0,0)}class Tt extends bR.Shape{constructor(e){super(e),this.dummyCanvas=x0.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return yl.Path.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const n=this.pathLength;return e-1>n?null:yl.Path.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=yl.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();const n=this.textDecoration(),r=this.fill(),i=this.fontSize(),s=this.glyphInfo;n==="underline"&&e.beginPath();for(let l=0;l<s.length;l++){e.save();const u=s[l].p0;e.translate(u.x,u.y),e.rotate(s[l].rotation),this.partialText=s[l].text,e.fillStrokeShape(this),n==="underline"&&(l===0&&e.moveTo(0,i/2+1),e.lineTo(i,i/2+1)),e.restore()}n==="underline"&&(e.strokeStyle=r,e.lineWidth=i/20,e.stroke()),e.restore()}_hitFunc(e){e.beginPath();const n=this.glyphInfo;if(n.length>=1){const r=n[0].p0;e.moveTo(r.x,r.y)}for(let r=0;r<n.length;r++){const i=n[r].p1;e.lineTo(i.x,i.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return x0.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return w0.Text.prototype.setText.call(this,e)}_getContextFont(){return w0.Text.prototype._getContextFont.call(this)}_getTextSize(e){const r=this.dummyCanvas.getContext("2d");r.save(),r.font=this._getContextFont();const i=r.measureText(e);return r.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:e,height:n}=this._getTextSize(this.attrs.text);if(this.textWidth=e,this.textHeight=n,this.glyphInfo=[],!this.attrs.data)return null;const r=this.letterSpacing(),i=this.align(),s=this.kerningFunc(),l=Math.max(this.textWidth+((this.attrs.text||"").length-1)*r,0);let u=0;i==="center"&&(u=Math.max(0,this.pathLength/2-l/2)),i==="right"&&(u=Math.max(0,this.pathLength-l));const c=(0,w0.stringToArray)(this.text());let h=u;for(let p=0;p<c.length;p++){const y=this._getPointAtLength(h);if(!y)return;let S=this._getTextSize(c[p]).width+r;if(c[p]===" "&&i==="justify"){const k=this.text().split(" ").length-1;S+=(this.pathLength-l)/k}const x=this._getPointAtLength(h+S);if(!x)return;const m=yl.Path.getLineLength(y.x,y.y,x.x,x.y);let C=0;if(s)try{C=s(c[p-1],c[p])*this.fontSize()}catch{C=0}y.x+=C,x.x+=C,this.textWidth+=C;const P=yl.Path.getPointOnLine(C+m/2,y.x,y.y,x.x,x.y),E=Math.atan2(x.y-y.y,x.x-y.x);this.glyphInfo.push({transposeX:P.x,transposeY:P.y,text:c[p],rotation:E,p0:y,p1:x}),h+=S}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const e=[];this.glyphInfo.forEach(function(h){e.push(h.p0.x),e.push(h.p0.y),e.push(h.p1.x),e.push(h.p1.y)});let n=e[0]||0,r=e[0]||0,i=e[1]||0,s=e[1]||0,l,u;for(let h=0;h<e.length/2;h++)l=e[h*2],u=e[h*2+1],n=Math.min(n,l),r=Math.max(r,l),i=Math.min(i,u),s=Math.max(s,u);const c=this.fontSize();return{x:n-c/2,y:i-c/2,width:r-n+c,height:s-i+c}}destroy(){return x0.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}Bh.TextPath=Tt;Tt.prototype._fillFunc=xS;Tt.prototype._strokeFunc=wS;Tt.prototype._fillFuncHit=xS;Tt.prototype._strokeFuncHit=wS;Tt.prototype.className="TextPath";Tt.prototype._attrsAffectingSize=["text","fontSize","data"];(0,LR._registerNode)(Tt);yr.Factory.addGetterSetter(Tt,"data");yr.Factory.addGetterSetter(Tt,"fontFamily","Arial");yr.Factory.addGetterSetter(Tt,"fontSize",12,(0,vS.getNumberValidator)());yr.Factory.addGetterSetter(Tt,"fontStyle",SS);yr.Factory.addGetterSetter(Tt,"align","left");yr.Factory.addGetterSetter(Tt,"letterSpacing",0,(0,vS.getNumberValidator)());yr.Factory.addGetterSetter(Tt,"textBaseline","middle");yr.Factory.addGetterSetter(Tt,"fontVariant",SS);yr.Factory.addGetterSetter(Tt,"text",FR);yr.Factory.addGetterSetter(Tt,"textDecoration","");yr.Factory.addGetterSetter(Tt,"kerningFunc",void 0);var Gh={};Object.defineProperty(Gh,"__esModule",{value:!0});Gh.Transformer=void 0;const Ue=ct,Me=Pe,z4=rt,AR=Rt,MR=Ou,B4=Aa,ar=ke,fs=ge,IR=ke,_S="tr-konva",DR=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(t=>t+`.${_S}`).join(" "),G4="nodesRect",jR=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],UR={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},zR="ontouchstart"in ar.Konva._global;function BR(t,e,n){if(t==="rotater")return n;e+=Ue.Util.degToRad(UR[t]||0);const r=(Ue.Util.radToDeg(e)%360+360)%360;return Ue.Util._inRange(r,315+22.5,360)||Ue.Util._inRange(r,0,22.5)?"ns-resize":Ue.Util._inRange(r,45-22.5,45+22.5)?"nesw-resize":Ue.Util._inRange(r,90-22.5,90+22.5)?"ew-resize":Ue.Util._inRange(r,135-22.5,135+22.5)?"nwse-resize":Ue.Util._inRange(r,180-22.5,180+22.5)?"ns-resize":Ue.Util._inRange(r,225-22.5,225+22.5)?"nesw-resize":Ue.Util._inRange(r,270-22.5,270+22.5)?"ew-resize":Ue.Util._inRange(r,315-22.5,315+22.5)?"nwse-resize":(Ue.Util.error("Transformer has unknown angle for cursor detection: "+r),"pointer")}const $d=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function GR(t){return{x:t.x+t.width/2*Math.cos(t.rotation)+t.height/2*Math.sin(-t.rotation),y:t.y+t.height/2*Math.cos(t.rotation)+t.width/2*Math.sin(t.rotation)}}function CS(t,e,n){const r=n.x+(t.x-n.x)*Math.cos(e)-(t.y-n.y)*Math.sin(e),i=n.y+(t.x-n.x)*Math.sin(e)+(t.y-n.y)*Math.cos(e);return{...t,rotation:t.rotation+e,x:r,y:i}}function HR(t,e){const n=GR(t);return CS(t,e,n)}function VR(t,e,n){let r=e;for(let i=0;i<t.length;i++){const s=ar.Konva.getAngle(t[i]),l=Math.abs(s-e)%(Math.PI*2);Math.min(l,Math.PI*2-l)<n&&(r=s)}return r}let qg=0,Oe=class extends B4.Group{constructor(e){super(e),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(DR,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return Ue.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return _S+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const n=e.filter(i=>i.isAncestorOf(this)?(Ue.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=e=n,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const s=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(i._attrsAffectingSize.length){const l=i._attrsAffectingSize.map(u=>u+"Change."+this._getEventNamespace()).join(" ");i.on(l,s)}i.on(jR.map(l=>l+`.${this._getEventNamespace()}`).join(" "),s),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,s),this._proxyDrag(i)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let n;e.on(`dragstart.${this._getEventNamespace()}`,r=>{n=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(r,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=e.getAbsolutePosition(),s=i.x-n.x,l=i.y-n.y;this.nodes().forEach(u=>{if(u===e||u.isDragging())return;const c=u.getAbsolutePosition();u.setAbsolutePosition({x:c.x+s,y:c.y+l}),u.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(G4),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(G4,this.__getNodeRect)}__getNodeShape(e,n=this.rotation(),r){const i=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),s=e.getAbsoluteScale(r),l=e.getAbsolutePosition(r),u=i.x*s.x-e.offsetX()*s.x,c=i.y*s.y-e.offsetY()*s.y,h=(ar.Konva.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),p={x:l.x+u*Math.cos(h)+c*Math.sin(-h),y:l.y+c*Math.cos(h)+u*Math.sin(h),width:i.width*s.x,height:i.height*s.y,rotation:h};return CS(p,-ar.Konva.getAngle(n),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const n=[];this.nodes().map(h=>{const p=h.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),y=[{x:p.x,y:p.y},{x:p.x+p.width,y:p.y},{x:p.x+p.width,y:p.y+p.height},{x:p.x,y:p.y+p.height}],S=h.getAbsoluteTransform();y.forEach(function(x){const m=S.point(x);n.push(m)})});const r=new Ue.Transform;r.rotate(-ar.Konva.getAngle(this.rotation()));let i=1/0,s=1/0,l=-1/0,u=-1/0;n.forEach(function(h){const p=r.point(h);i===void 0&&(i=l=p.x,s=u=p.y),i=Math.min(i,p.x),s=Math.min(s,p.y),l=Math.max(l,p.x),u=Math.max(u,p.y)}),r.invert();const c=r.point({x:i,y:s});return{x:c.x,y:c.y,width:l-i,height:u-s,rotation:ar.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),$d.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater")}_createAnchor(e){const n=new MR.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:zR?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{const i=ar.Konva.getAngle(this.rotation()),s=this.rotateAnchorCursor(),l=BR(e,i,s);n.getStage().content&&(n.getStage().content.style.cursor=l),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){const e=new AR.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(n,r){const i=r.getParent(),s=i.padding();n.beginPath(),n.rect(-s,-s,r.width()+s*2,r.height()+s*2),n.moveTo(r.width()/2,-s),i.rotateEnabled()&&i.rotateLineVisible()&&n.lineTo(r.width()/2,-i.rotateAnchorOffset()*Ue.Util._sign(r.height())-s),n.fillStrokeShape(r)},hitFunc:(n,r)=>{if(!this.shouldOverdrawWholeArea())return;const i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}});this.add(e),this._proxyDrag(e),e.on("dragstart",n=>{n.cancelBubble=!0}),e.on("dragmove",n=>{n.cancelBubble=!0}),e.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(" ")[0];const n=this._getNodeRect(),r=n.width,i=n.height,s=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/s),this.cos=Math.abs(r/s),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const l=e.target.getAbsolutePosition(),u=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:u.x-l.x,y:u.y-l.y},qg++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(c=>{c._fire("transformstart",{evt:e.evt,target:c})})}_handleMouseMove(e){let n,r,i;const s=this.findOne("."+this._movingAnchorName),l=s.getStage();l.setPointersPositions(e);const u=l.getPointerPosition();let c={x:u.x-this._anchorDragOffset.x,y:u.y-this._anchorDragOffset.y};const h=s.getAbsolutePosition();this.anchorDragBoundFunc()&&(c=this.anchorDragBoundFunc()(h,c,e)),s.setAbsolutePosition(c);const p=s.getAbsolutePosition();if(h.x===p.x&&h.y===p.y)return;if(this._movingAnchorName==="rotater"){const k=this._getNodeRect();n=s.x()-k.width/2,r=-s.y()+k.height/2;let v=Math.atan2(-r,n)+Math.PI/2;k.height<0&&(v-=Math.PI);const R=ar.Konva.getAngle(this.rotation())+v,b=ar.Konva.getAngle(this.rotationSnapTolerance()),O=VR(this.rotationSnaps(),R,b)-k.rotation,I=HR(k,O);this._fitNodesInto(I,e);return}const y=this.shiftBehavior();let S;y==="inverted"?S=this.keepRatio()&&!e.shiftKey:y==="none"?S=this.keepRatio():S=this.keepRatio()||e.shiftKey;let x=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(S){const k=x?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(k.x-s.x(),2)+Math.pow(k.y-s.y(),2));const v=this.findOne(".top-left").x()>k.x?-1:1,_=this.findOne(".top-left").y()>k.y?-1:1;n=i*this.cos*v,r=i*this.sin*_,this.findOne(".top-left").x(k.x-n),this.findOne(".top-left").y(k.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(s.y());else if(this._movingAnchorName==="top-right"){if(S){const k=x?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(s.x()-k.x,2)+Math.pow(k.y-s.y(),2));const v=this.findOne(".top-right").x()<k.x?-1:1,_=this.findOne(".top-right").y()>k.y?-1:1;n=i*this.cos*v,r=i*this.sin*_,this.findOne(".top-right").x(k.x+n),this.findOne(".top-right").y(k.y-r)}var m=s.position();this.findOne(".top-left").y(m.y),this.findOne(".bottom-right").x(m.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(s.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(s.x());else if(this._movingAnchorName==="bottom-left"){if(S){const k=x?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(k.x-s.x(),2)+Math.pow(s.y()-k.y,2));const v=k.x<s.x()?-1:1,_=s.y()<k.y?-1:1;n=i*this.cos*v,r=i*this.sin*_,s.x(k.x-n),s.y(k.y+r)}m=s.position(),this.findOne(".top-left").x(m.x),this.findOne(".bottom-right").y(m.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(s.y());else if(this._movingAnchorName==="bottom-right"){if(S){const k=x?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(s.x()-k.x,2)+Math.pow(s.y()-k.y,2));const v=this.findOne(".bottom-right").x()<k.x?-1:1,_=this.findOne(".bottom-right").y()<k.y?-1:1;n=i*this.cos*v,r=i*this.sin*_,this.findOne(".bottom-right").x(k.x+n),this.findOne(".bottom-right").y(k.y+r)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(x=this.centeredScaling()||e.altKey,x){const k=this.findOne(".top-left"),v=this.findOne(".bottom-right"),_=k.x(),R=k.y(),b=this.getWidth()-v.x(),A=this.getHeight()-v.y();v.move({x:-_,y:-R}),k.move({x:b,y:A})}const C=this.findOne(".top-left").getAbsolutePosition();n=C.x,r=C.y;const P=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),E=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:r,width:P,height:E,rotation:ar.Konva.getAngle(this.rotation())},e)}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){var n;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const r=this.getNode();qg--,this._fire("transformend",{evt:e,target:r}),(n=this.getLayer())===null||n===void 0||n.batchDraw(),r&&this._nodes.forEach(i=>{var s;i._fire("transformend",{evt:e,target:i}),(s=i.getLayer())===null||s===void 0||s.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,n){const r=this._getNodeRect(),i=1;if(Ue.Util._inRange(e.width,-this.padding()*2-i,i)){this.update();return}if(Ue.Util._inRange(e.height,-this.padding()*2-i,i)){this.update();return}const s=new Ue.Transform;if(s.rotate(ar.Konva.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const S=s.point({x:-this.padding()*2,y:0});e.x+=S.x,e.y+=S.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=S.x,this._anchorDragOffset.y-=S.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const S=s.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=S.x,this._anchorDragOffset.y-=S.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const S=s.point({x:0,y:-this.padding()*2});e.x+=S.x,e.y+=S.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=S.x,this._anchorDragOffset.y-=S.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const S=s.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=S.x,this._anchorDragOffset.y-=S.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const S=this.boundBoxFunc()(r,e);S?e=S:Ue.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const l=1e7,u=new Ue.Transform;u.translate(r.x,r.y),u.rotate(r.rotation),u.scale(r.width/l,r.height/l);const c=new Ue.Transform,h=e.width/l,p=e.height/l;this.flipEnabled()===!1?(c.translate(e.x,e.y),c.rotate(e.rotation),c.translate(e.width<0?e.width:0,e.height<0?e.height:0),c.scale(Math.abs(h),Math.abs(p))):(c.translate(e.x,e.y),c.rotate(e.rotation),c.scale(h,p));const y=c.multiply(u.invert());this._nodes.forEach(S=>{var x;const m=S.getParent().getAbsoluteTransform(),C=S.getTransform().copy();C.translate(S.offsetX(),S.offsetY());const P=new Ue.Transform;P.multiply(m.copy().invert()).multiply(y).multiply(m).multiply(C);const E=P.decompose();S.setAttrs(E),(x=S.getLayer())===null||x===void 0||x.batchDraw()}),this.rotation(Ue.Util._getRotation(e.rotation)),this._nodes.forEach(S=>{this._fire("transform",{evt:n,target:S}),S._fire("transform",{evt:n,target:S})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,n){this.findOne(e).setAttrs(n)}update(){var e;const n=this._getNodeRect();this.rotation(Ue.Util._getRotation(n.rotation));const r=n.width,i=n.height,s=this.enabledAnchors(),l=this.resizeEnabled(),u=this.padding(),c=this.anchorSize(),h=this.find("._anchor");h.forEach(y=>{y.setAttrs({width:c,height:c,offsetX:c/2,offsetY:c/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:c/2+u,offsetY:c/2+u,visible:l&&s.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:c/2+u,visible:l&&s.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:c/2-u,offsetY:c/2+u,visible:l&&s.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:c/2+u,visible:l&&s.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:c/2-u,visible:l&&s.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:c/2+u,offsetY:c/2-u,visible:l&&s.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:c/2-u,visible:l&&s.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:c/2-u,offsetY:c/2-u,visible:l&&s.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*Ue.Util._sign(i)-u,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const p=this.anchorStyleFunc();p&&h.forEach(y=>{p(y)}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),B4.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return z4.Node.prototype.toObject.call(this)}clone(e){return z4.Node.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};Gh.Transformer=Oe;Oe.isTransforming=()=>qg>0;function WR(t){return t instanceof Array||Ue.Util.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(e){$d.indexOf(e)===-1&&Ue.Util.warn("Unknown anchor name: "+e+". Available names are: "+$d.join(", "))}),t||[]}Oe.prototype.className="Transformer";(0,IR._registerNode)(Oe);Me.Factory.addGetterSetter(Oe,"enabledAnchors",$d,WR);Me.Factory.addGetterSetter(Oe,"flipEnabled",!0,(0,fs.getBooleanValidator)());Me.Factory.addGetterSetter(Oe,"resizeEnabled",!0);Me.Factory.addGetterSetter(Oe,"anchorSize",10,(0,fs.getNumberValidator)());Me.Factory.addGetterSetter(Oe,"rotateEnabled",!0);Me.Factory.addGetterSetter(Oe,"rotateLineVisible",!0);Me.Factory.addGetterSetter(Oe,"rotationSnaps",[]);Me.Factory.addGetterSetter(Oe,"rotateAnchorOffset",50,(0,fs.getNumberValidator)());Me.Factory.addGetterSetter(Oe,"rotateAnchorCursor","crosshair");Me.Factory.addGetterSetter(Oe,"rotationSnapTolerance",5,(0,fs.getNumberValidator)());Me.Factory.addGetterSetter(Oe,"borderEnabled",!0);Me.Factory.addGetterSetter(Oe,"anchorStroke","rgb(0, 161, 255)");Me.Factory.addGetterSetter(Oe,"anchorStrokeWidth",1,(0,fs.getNumberValidator)());Me.Factory.addGetterSetter(Oe,"anchorFill","white");Me.Factory.addGetterSetter(Oe,"anchorCornerRadius",0,(0,fs.getNumberValidator)());Me.Factory.addGetterSetter(Oe,"borderStroke","rgb(0, 161, 255)");Me.Factory.addGetterSetter(Oe,"borderStrokeWidth",1,(0,fs.getNumberValidator)());Me.Factory.addGetterSetter(Oe,"borderDash");Me.Factory.addGetterSetter(Oe,"keepRatio",!0);Me.Factory.addGetterSetter(Oe,"shiftBehavior","default");Me.Factory.addGetterSetter(Oe,"centeredScaling",!1);Me.Factory.addGetterSetter(Oe,"ignoreStroke",!1);Me.Factory.addGetterSetter(Oe,"padding",0,(0,fs.getNumberValidator)());Me.Factory.addGetterSetter(Oe,"nodes");Me.Factory.addGetterSetter(Oe,"node");Me.Factory.addGetterSetter(Oe,"boundBoxFunc");Me.Factory.addGetterSetter(Oe,"anchorDragBoundFunc");Me.Factory.addGetterSetter(Oe,"anchorStyleFunc");Me.Factory.addGetterSetter(Oe,"shouldOverdrawWholeArea",!1);Me.Factory.addGetterSetter(Oe,"useSingleNodeRotation",!0);Me.Factory.backCompat(Oe,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Hh={};Object.defineProperty(Hh,"__esModule",{value:!0});Hh.Wedge=void 0;const Vh=Pe,KR=Rt,$R=ke,kS=ge,QR=ke;class pi extends KR.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,$R.Konva.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Hh.Wedge=pi;pi.prototype.className="Wedge";pi.prototype._centroid=!0;pi.prototype._attrsAffectingSize=["radius"];(0,QR._registerNode)(pi);Vh.Factory.addGetterSetter(pi,"radius",0,(0,kS.getNumberValidator)());Vh.Factory.addGetterSetter(pi,"angle",0,(0,kS.getNumberValidator)());Vh.Factory.addGetterSetter(pi,"clockwise",!1);Vh.Factory.backCompat(pi,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var Wh={};Object.defineProperty(Wh,"__esModule",{value:!0});Wh.Blur=void 0;const H4=Pe,qR=rt,YR=ge;function V4(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const XR=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],JR=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function ZR(t,e){const n=t.data,r=t.width,i=t.height;let s,l,u,c,h,p,y,S,x,m,C,P,E,k,v,_,R,b,A,O;const I=e+e+1,L=r-1,H=i-1,B=e+1,$=B*(B+1)/2,q=new V4,Q=XR[e],re=JR[e];let he=null,W=q,te=null,Z=null;for(let Y=1;Y<I;Y++)W=W.next=new V4,Y===B&&(he=W);W.next=q,u=l=0;for(let Y=0;Y<i;Y++){P=E=k=v=c=h=p=y=0,S=B*(_=n[l]),x=B*(R=n[l+1]),m=B*(b=n[l+2]),C=B*(A=n[l+3]),c+=$*_,h+=$*R,p+=$*b,y+=$*A,W=q;for(let ie=0;ie<B;ie++)W.r=_,W.g=R,W.b=b,W.a=A,W=W.next;for(let ie=1;ie<B;ie++)s=l+((L<ie?L:ie)<<2),c+=(W.r=_=n[s])*(O=B-ie),h+=(W.g=R=n[s+1])*O,p+=(W.b=b=n[s+2])*O,y+=(W.a=A=n[s+3])*O,P+=_,E+=R,k+=b,v+=A,W=W.next;te=q,Z=he;for(let ie=0;ie<r;ie++)n[l+3]=A=y*Q>>re,A!==0?(A=255/A,n[l]=(c*Q>>re)*A,n[l+1]=(h*Q>>re)*A,n[l+2]=(p*Q>>re)*A):n[l]=n[l+1]=n[l+2]=0,c-=S,h-=x,p-=m,y-=C,S-=te.r,x-=te.g,m-=te.b,C-=te.a,s=u+((s=ie+e+1)<L?s:L)<<2,P+=te.r=n[s],E+=te.g=n[s+1],k+=te.b=n[s+2],v+=te.a=n[s+3],c+=P,h+=E,p+=k,y+=v,te=te.next,S+=_=Z.r,x+=R=Z.g,m+=b=Z.b,C+=A=Z.a,P-=_,E-=R,k-=b,v-=A,Z=Z.next,l+=4;u+=r}for(let Y=0;Y<r;Y++){E=k=v=P=h=p=y=c=0,l=Y<<2,S=B*(_=n[l]),x=B*(R=n[l+1]),m=B*(b=n[l+2]),C=B*(A=n[l+3]),c+=$*_,h+=$*R,p+=$*b,y+=$*A,W=q;for(let xe=0;xe<B;xe++)W.r=_,W.g=R,W.b=b,W.a=A,W=W.next;let ie=r;for(let xe=1;xe<=e;xe++)l=ie+Y<<2,c+=(W.r=_=n[l])*(O=B-xe),h+=(W.g=R=n[l+1])*O,p+=(W.b=b=n[l+2])*O,y+=(W.a=A=n[l+3])*O,P+=_,E+=R,k+=b,v+=A,W=W.next,xe<H&&(ie+=r);l=Y,te=q,Z=he;for(let xe=0;xe<i;xe++)s=l<<2,n[s+3]=A=y*Q>>re,A>0?(A=255/A,n[s]=(c*Q>>re)*A,n[s+1]=(h*Q>>re)*A,n[s+2]=(p*Q>>re)*A):n[s]=n[s+1]=n[s+2]=0,c-=S,h-=x,p-=m,y-=C,S-=te.r,x-=te.g,m-=te.b,C-=te.a,s=Y+((s=xe+B)<H?s:H)*r<<2,c+=P+=te.r=n[s],h+=E+=te.g=n[s+1],p+=k+=te.b=n[s+2],y+=v+=te.a=n[s+3],te=te.next,S+=_=Z.r,x+=R=Z.g,m+=b=Z.b,C+=A=Z.a,P-=_,E-=R,k-=b,v-=A,Z=Z.next,l+=r}}const eT=function(e){const n=Math.round(this.blurRadius());n>0&&ZR(e,n)};Wh.Blur=eT;H4.Factory.addGetterSetter(qR.Node,"blurRadius",0,(0,YR.getNumberValidator)(),H4.Factory.afterSetFilter);var Kh={};Object.defineProperty(Kh,"__esModule",{value:!0});Kh.Brighten=void 0;const W4=Pe,tT=rt,nT=ge,rT=function(t){const e=this.brightness()*255,n=t.data,r=n.length;for(let i=0;i<r;i+=4)n[i]+=e,n[i+1]+=e,n[i+2]+=e};Kh.Brighten=rT;W4.Factory.addGetterSetter(tT.Node,"brightness",0,(0,nT.getNumberValidator)(),W4.Factory.afterSetFilter);var $h={};Object.defineProperty($h,"__esModule",{value:!0});$h.Contrast=void 0;const K4=Pe,iT=rt,sT=ge,oT=function(t){const e=Math.pow((this.contrast()+100)/100,2),n=t.data,r=n.length;let i=150,s=150,l=150;for(let u=0;u<r;u+=4)i=n[u],s=n[u+1],l=n[u+2],i/=255,i-=.5,i*=e,i+=.5,i*=255,s/=255,s-=.5,s*=e,s+=.5,s*=255,l/=255,l-=.5,l*=e,l+=.5,l*=255,i=i<0?0:i>255?255:i,s=s<0?0:s>255?255:s,l=l<0?0:l>255?255:l,n[u]=i,n[u+1]=s,n[u+2]=l};$h.Contrast=oT;K4.Factory.addGetterSetter(iT.Node,"contrast",0,(0,sT.getNumberValidator)(),K4.Factory.afterSetFilter);var Qh={};Object.defineProperty(Qh,"__esModule",{value:!0});Qh.Emboss=void 0;const is=Pe,qh=rt,aT=ct,ES=ge,lT=function(t){const e=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),s=t.data,l=t.width,u=t.height,c=l*4;let h=0,p=0,y=u;switch(r){case"top-left":h=-1,p=-1;break;case"top":h=-1,p=0;break;case"top-right":h=-1,p=1;break;case"right":h=0,p=1;break;case"bottom-right":h=1,p=1;break;case"bottom":h=1,p=0;break;case"bottom-left":h=1,p=-1;break;case"left":h=0,p=-1;break;default:aT.Util.error("Unknown emboss direction: "+r)}do{const S=(y-1)*c;let x=h;y+x<1&&(x=0),y+x>u&&(x=0);const m=(y-1+x)*l*4;let C=l;do{const P=S+(C-1)*4;let E=p;C+E<1&&(E=0),C+E>l&&(E=0);const k=m+(C-1+E)*4,v=s[P]-s[k],_=s[P+1]-s[k+1],R=s[P+2]-s[k+2];let b=v;const A=b>0?b:-b,O=_>0?_:-_,I=R>0?R:-R;if(O>A&&(b=_),I>A&&(b=R),b*=e,i){const L=s[P]+b,H=s[P+1]+b,B=s[P+2]+b;s[P]=L>255?255:L<0?0:L,s[P+1]=H>255?255:H<0?0:H,s[P+2]=B>255?255:B<0?0:B}else{let L=n-b;L<0?L=0:L>255&&(L=255),s[P]=s[P+1]=s[P+2]=L}}while(--C)}while(--y)};Qh.Emboss=lT;is.Factory.addGetterSetter(qh.Node,"embossStrength",.5,(0,ES.getNumberValidator)(),is.Factory.afterSetFilter);is.Factory.addGetterSetter(qh.Node,"embossWhiteLevel",.5,(0,ES.getNumberValidator)(),is.Factory.afterSetFilter);is.Factory.addGetterSetter(qh.Node,"embossDirection","top-left",void 0,is.Factory.afterSetFilter);is.Factory.addGetterSetter(qh.Node,"embossBlend",!1,void 0,is.Factory.afterSetFilter);var Yh={};Object.defineProperty(Yh,"__esModule",{value:!0});Yh.Enhance=void 0;const $4=Pe,uT=rt,cT=ge;function _0(t,e,n,r,i){const s=n-e,l=i-r;if(s===0)return r+l/2;if(l===0)return r;let u=(t-e)/s;return u=l*u+r,u}const dT=function(t){const e=t.data,n=e.length;let r=e[0],i=r,s,l=e[1],u=l,c,h=e[2],p=h,y;const S=this.enhance();if(S===0)return;for(let v=0;v<n;v+=4)s=e[v+0],s<r?r=s:s>i&&(i=s),c=e[v+1],c<l?l=c:c>u&&(u=c),y=e[v+2],y<h?h=y:y>p&&(p=y);i===r&&(i=255,r=0),u===l&&(u=255,l=0),p===h&&(p=255,h=0);let x,m,C,P,E,k;if(S>0)x=i+S*(255-i),m=r-S*(r-0),C=u+S*(255-u),P=l-S*(l-0),E=p+S*(255-p),k=h-S*(h-0);else{const v=(i+r)*.5;x=i+S*(i-v),m=r+S*(r-v);const _=(u+l)*.5;C=u+S*(u-_),P=l+S*(l-_);const R=(p+h)*.5;E=p+S*(p-R),k=h+S*(h-R)}for(let v=0;v<n;v+=4)e[v+0]=_0(e[v+0],r,i,m,x),e[v+1]=_0(e[v+1],l,u,P,C),e[v+2]=_0(e[v+2],h,p,k,E)};Yh.Enhance=dT;$4.Factory.addGetterSetter(uT.Node,"enhance",0,(0,cT.getNumberValidator)(),$4.Factory.afterSetFilter);var Xh={};Object.defineProperty(Xh,"__esModule",{value:!0});Xh.Grayscale=void 0;const hT=function(t){const e=t.data,n=e.length;for(let r=0;r<n;r+=4){const i=.34*e[r]+.5*e[r+1]+.16*e[r+2];e[r]=i,e[r+1]=i,e[r+2]=i}};Xh.Grayscale=hT;var Jh={};Object.defineProperty(Jh,"__esModule",{value:!0});Jh.HSL=void 0;const ka=Pe,Sm=rt,xm=ge;ka.Factory.addGetterSetter(Sm.Node,"hue",0,(0,xm.getNumberValidator)(),ka.Factory.afterSetFilter);ka.Factory.addGetterSetter(Sm.Node,"saturation",0,(0,xm.getNumberValidator)(),ka.Factory.afterSetFilter);ka.Factory.addGetterSetter(Sm.Node,"luminance",0,(0,xm.getNumberValidator)(),ka.Factory.afterSetFilter);const fT=function(t){const e=t.data,n=e.length,r=1,i=Math.pow(2,this.saturation()),s=Math.abs(this.hue()+360)%360,l=this.luminance()*127,u=r*i*Math.cos(s*Math.PI/180),c=r*i*Math.sin(s*Math.PI/180),h=.299*r+.701*u+.167*c,p=.587*r-.587*u+.33*c,y=.114*r-.114*u-.497*c,S=.299*r-.299*u-.328*c,x=.587*r+.413*u+.035*c,m=.114*r-.114*u+.293*c,C=.299*r-.3*u+1.25*c,P=.587*r-.586*u-1.05*c,E=.114*r+.886*u-.2*c;let k,v,_,R;for(let b=0;b<n;b+=4)k=e[b+0],v=e[b+1],_=e[b+2],R=e[b+3],e[b+0]=h*k+p*v+y*_+l,e[b+1]=S*k+x*v+m*_+l,e[b+2]=C*k+P*v+E*_+l,e[b+3]=R};Jh.HSL=fT;var Zh={};Object.defineProperty(Zh,"__esModule",{value:!0});Zh.HSV=void 0;const Ea=Pe,wm=rt,_m=ge,pT=function(t){const e=t.data,n=e.length,r=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),s=Math.abs(this.hue()+360)%360,l=r*i*Math.cos(s*Math.PI/180),u=r*i*Math.sin(s*Math.PI/180),c=.299*r+.701*l+.167*u,h=.587*r-.587*l+.33*u,p=.114*r-.114*l-.497*u,y=.299*r-.299*l-.328*u,S=.587*r+.413*l+.035*u,x=.114*r-.114*l+.293*u,m=.299*r-.3*l+1.25*u,C=.587*r-.586*l-1.05*u,P=.114*r+.886*l-.2*u;for(let E=0;E<n;E+=4){const k=e[E+0],v=e[E+1],_=e[E+2],R=e[E+3];e[E+0]=c*k+h*v+p*_,e[E+1]=y*k+S*v+x*_,e[E+2]=m*k+C*v+P*_,e[E+3]=R}};Zh.HSV=pT;Ea.Factory.addGetterSetter(wm.Node,"hue",0,(0,_m.getNumberValidator)(),Ea.Factory.afterSetFilter);Ea.Factory.addGetterSetter(wm.Node,"saturation",0,(0,_m.getNumberValidator)(),Ea.Factory.afterSetFilter);Ea.Factory.addGetterSetter(wm.Node,"value",0,(0,_m.getNumberValidator)(),Ea.Factory.afterSetFilter);var ef={};Object.defineProperty(ef,"__esModule",{value:!0});ef.Invert=void 0;const gT=function(t){const e=t.data,n=e.length;for(let r=0;r<n;r+=4)e[r]=255-e[r],e[r+1]=255-e[r+1],e[r+2]=255-e[r+2]};ef.Invert=gT;var tf={};Object.defineProperty(tf,"__esModule",{value:!0});tf.Kaleidoscope=void 0;const Qd=Pe,PS=rt,Q4=ct,NS=ge,mT=function(t,e,n){const r=t.data,i=e.data,s=t.width,l=t.height,u=n.polarCenterX||s/2,c=n.polarCenterY||l/2;let h=Math.sqrt(u*u+c*c),p=s-u,y=l-c;const S=Math.sqrt(p*p+y*y);h=S>h?S:h;const x=l,m=s,C=360/m*Math.PI/180;for(let P=0;P<m;P+=1){const E=Math.sin(P*C),k=Math.cos(P*C);for(let v=0;v<x;v+=1){p=Math.floor(u+h*v/x*k),y=Math.floor(c+h*v/x*E);let _=(y*s+p)*4;const R=r[_+0],b=r[_+1],A=r[_+2],O=r[_+3];_=(P+v*s)*4,i[_+0]=R,i[_+1]=b,i[_+2]=A,i[_+3]=O}}},yT=function(t,e,n){const r=t.data,i=e.data,s=t.width,l=t.height,u=n.polarCenterX||s/2,c=n.polarCenterY||l/2;let h=Math.sqrt(u*u+c*c),p=s-u,y=l-c;const S=Math.sqrt(p*p+y*y);h=S>h?S:h;const x=l,m=s,C=0;let P,E;for(p=0;p<s;p+=1)for(y=0;y<l;y+=1){const k=p-u,v=y-c,_=Math.sqrt(k*k+v*v)*x/h;let R=(Math.atan2(v,k)*180/Math.PI+360+C)%360;R=R*m/360,P=Math.floor(R),E=Math.floor(_);let b=(E*s+P)*4;const A=r[b+0],O=r[b+1],I=r[b+2],L=r[b+3];b=(y*s+p)*4,i[b+0]=A,i[b+1]=O,i[b+2]=I,i[b+3]=L}},vT=function(t){const e=t.width,n=t.height;let r,i,s,l,u,c,h,p,y,S,x=Math.round(this.kaleidoscopePower());const m=Math.round(this.kaleidoscopeAngle()),C=Math.floor(e*(m%360)/360);if(x<1)return;const P=Q4.Util.createCanvasElement();P.width=e,P.height=n;const E=P.getContext("2d").getImageData(0,0,e,n);Q4.Util.releaseCanvas(P),mT(t,E,{polarCenterX:e/2,polarCenterY:n/2});let k=e/Math.pow(2,x);for(;k<=8;)k=k*2,x-=1;k=Math.ceil(k);let v=k,_=0,R=v,b=1;for(C+k>e&&(_=v,R=0,b=-1),i=0;i<n;i+=1)for(r=_;r!==R;r+=b)s=Math.round(r+C)%e,y=(e*i+s)*4,u=E.data[y+0],c=E.data[y+1],h=E.data[y+2],p=E.data[y+3],S=(e*i+r)*4,E.data[S+0]=u,E.data[S+1]=c,E.data[S+2]=h,E.data[S+3]=p;for(i=0;i<n;i+=1)for(v=Math.floor(k),l=0;l<x;l+=1){for(r=0;r<v+1;r+=1)y=(e*i+r)*4,u=E.data[y+0],c=E.data[y+1],h=E.data[y+2],p=E.data[y+3],S=(e*i+v*2-r-1)*4,E.data[S+0]=u,E.data[S+1]=c,E.data[S+2]=h,E.data[S+3]=p;v*=2}yT(E,t,{})};tf.Kaleidoscope=vT;Qd.Factory.addGetterSetter(PS.Node,"kaleidoscopePower",2,(0,NS.getNumberValidator)(),Qd.Factory.afterSetFilter);Qd.Factory.addGetterSetter(PS.Node,"kaleidoscopeAngle",0,(0,NS.getNumberValidator)(),Qd.Factory.afterSetFilter);var nf={};Object.defineProperty(nf,"__esModule",{value:!0});nf.Mask=void 0;const q4=Pe,ST=rt,xT=ge;function Qc(t,e,n){let r=(n*t.width+e)*4;const i=[];return i.push(t.data[r++],t.data[r++],t.data[r++],t.data[r++]),i}function vl(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}function wT(t){const e=[0,0,0];for(let n=0;n<t.length;n++)e[0]+=t[n][0],e[1]+=t[n][1],e[2]+=t[n][2];return e[0]/=t.length,e[1]/=t.length,e[2]/=t.length,e}function _T(t,e){const n=Qc(t,0,0),r=Qc(t,t.width-1,0),i=Qc(t,0,t.height-1),s=Qc(t,t.width-1,t.height-1),l=e||10;if(vl(n,r)<l&&vl(r,s)<l&&vl(s,i)<l&&vl(i,n)<l){const u=wT([r,n,s,i]),c=[];for(let h=0;h<t.width*t.height;h++){const p=vl(u,[t.data[h*4],t.data[h*4+1],t.data[h*4+2]]);c[h]=p<l?0:255}return c}}function CT(t,e){for(let n=0;n<t.width*t.height;n++)t.data[4*n+3]=e[n]}function kT(t,e,n){const r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),s=Math.floor(i/2),l=[];for(let u=0;u<n;u++)for(let c=0;c<e;c++){const h=u*e+c;let p=0;for(let y=0;y<i;y++)for(let S=0;S<i;S++){const x=u+y-s,m=c+S-s;if(x>=0&&x<n&&m>=0&&m<e){const C=x*e+m,P=r[y*i+S];p+=t[C]*P}}l[h]=p===255*8?255:0}return l}function ET(t,e,n){const r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),s=Math.floor(i/2),l=[];for(let u=0;u<n;u++)for(let c=0;c<e;c++){const h=u*e+c;let p=0;for(let y=0;y<i;y++)for(let S=0;S<i;S++){const x=u+y-s,m=c+S-s;if(x>=0&&x<n&&m>=0&&m<e){const C=x*e+m,P=r[y*i+S];p+=t[C]*P}}l[h]=p>=255*4?255:0}return l}function PT(t,e,n){const r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),s=Math.floor(i/2),l=[];for(let u=0;u<n;u++)for(let c=0;c<e;c++){const h=u*e+c;let p=0;for(let y=0;y<i;y++)for(let S=0;S<i;S++){const x=u+y-s,m=c+S-s;if(x>=0&&x<n&&m>=0&&m<e){const C=x*e+m,P=r[y*i+S];p+=t[C]*P}}l[h]=p}return l}const NT=function(t){const e=this.threshold();let n=_T(t,e);return n&&(n=kT(n,t.width,t.height),n=ET(n,t.width,t.height),n=PT(n,t.width,t.height),CT(t,n)),t};nf.Mask=NT;q4.Factory.addGetterSetter(ST.Node,"threshold",0,(0,xT.getNumberValidator)(),q4.Factory.afterSetFilter);var rf={};Object.defineProperty(rf,"__esModule",{value:!0});rf.Noise=void 0;const Y4=Pe,RT=rt,TT=ge,OT=function(t){const e=this.noise()*255,n=t.data,r=n.length,i=e/2;for(let s=0;s<r;s+=4)n[s+0]+=i-2*i*Math.random(),n[s+1]+=i-2*i*Math.random(),n[s+2]+=i-2*i*Math.random()};rf.Noise=OT;Y4.Factory.addGetterSetter(RT.Node,"noise",.2,(0,TT.getNumberValidator)(),Y4.Factory.afterSetFilter);var sf={};Object.defineProperty(sf,"__esModule",{value:!0});sf.Pixelate=void 0;const X4=Pe,bT=ct,LT=rt,FT=ge,AT=function(t){let e=Math.ceil(this.pixelSize()),n=t.width,r=t.height,i=Math.ceil(n/e),s=Math.ceil(r/e),l=t.data;if(e<=0){bT.Util.error("pixelSize value can not be <= 0");return}for(let u=0;u<i;u+=1)for(let c=0;c<s;c+=1){let h=0,p=0,y=0,S=0;const x=u*e,m=x+e,C=c*e,P=C+e;let E=0;for(let k=x;k<m;k+=1)if(!(k>=n))for(let v=C;v<P;v+=1){if(v>=r)continue;const _=(n*v+k)*4;h+=l[_+0],p+=l[_+1],y+=l[_+2],S+=l[_+3],E+=1}h=h/E,p=p/E,y=y/E,S=S/E;for(let k=x;k<m;k+=1)if(!(k>=n))for(let v=C;v<P;v+=1){if(v>=r)continue;const _=(n*v+k)*4;l[_+0]=h,l[_+1]=p,l[_+2]=y,l[_+3]=S}}};sf.Pixelate=AT;X4.Factory.addGetterSetter(LT.Node,"pixelSize",8,(0,FT.getNumberValidator)(),X4.Factory.afterSetFilter);var of={};Object.defineProperty(of,"__esModule",{value:!0});of.Posterize=void 0;const J4=Pe,MT=rt,IT=ge,DT=function(t){const e=Math.round(this.levels()*254)+1,n=t.data,r=n.length,i=255/e;for(let s=0;s<r;s+=1)n[s]=Math.floor(n[s]/i)*i};of.Posterize=DT;J4.Factory.addGetterSetter(MT.Node,"levels",.5,(0,IT.getNumberValidator)(),J4.Factory.afterSetFilter);var af={};Object.defineProperty(af,"__esModule",{value:!0});af.RGB=void 0;const qd=Pe,Cm=rt,jT=ge,UT=function(t){const e=t.data,n=e.length,r=this.red(),i=this.green(),s=this.blue();for(let l=0;l<n;l+=4){const u=(.34*e[l]+.5*e[l+1]+.16*e[l+2])/255;e[l]=u*r,e[l+1]=u*i,e[l+2]=u*s,e[l+3]=e[l+3]}};af.RGB=UT;qd.Factory.addGetterSetter(Cm.Node,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});qd.Factory.addGetterSetter(Cm.Node,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});qd.Factory.addGetterSetter(Cm.Node,"blue",0,jT.RGBComponent,qd.Factory.afterSetFilter);var lf={};Object.defineProperty(lf,"__esModule",{value:!0});lf.RGBA=void 0;const au=Pe,uf=rt,zT=ge,BT=function(t){const e=t.data,n=e.length,r=this.red(),i=this.green(),s=this.blue(),l=this.alpha();for(let u=0;u<n;u+=4){const c=1-l;e[u]=r*l+e[u]*c,e[u+1]=i*l+e[u+1]*c,e[u+2]=s*l+e[u+2]*c}};lf.RGBA=BT;au.Factory.addGetterSetter(uf.Node,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});au.Factory.addGetterSetter(uf.Node,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});au.Factory.addGetterSetter(uf.Node,"blue",0,zT.RGBComponent,au.Factory.afterSetFilter);au.Factory.addGetterSetter(uf.Node,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});var cf={};Object.defineProperty(cf,"__esModule",{value:!0});cf.Sepia=void 0;const GT=function(t){const e=t.data,n=e.length;for(let r=0;r<n;r+=4){const i=e[r+0],s=e[r+1],l=e[r+2];e[r+0]=Math.min(255,i*.393+s*.769+l*.189),e[r+1]=Math.min(255,i*.349+s*.686+l*.168),e[r+2]=Math.min(255,i*.272+s*.534+l*.131)}};cf.Sepia=GT;var df={};Object.defineProperty(df,"__esModule",{value:!0});df.Solarize=void 0;const HT=function(t){const e=t.data,n=t.width,r=t.height,i=n*4;let s=r;do{const l=(s-1)*i;let u=n;do{const c=l+(u-1)*4;let h=e[c],p=e[c+1],y=e[c+2];h>127&&(h=255-h),p>127&&(p=255-p),y>127&&(y=255-y),e[c]=h,e[c+1]=p,e[c+2]=y}while(--u)}while(--s)};df.Solarize=HT;var hf={};Object.defineProperty(hf,"__esModule",{value:!0});hf.Threshold=void 0;const Z4=Pe,VT=rt,WT=ge,KT=function(t){const e=this.threshold()*255,n=t.data,r=n.length;for(let i=0;i<r;i+=1)n[i]=n[i]<e?0:255};hf.Threshold=KT;Z4.Factory.addGetterSetter(VT.Node,"threshold",.5,(0,WT.getNumberValidator)(),Z4.Factory.afterSetFilter);Object.defineProperty(wh,"__esModule",{value:!0});wh.Konva=void 0;const e3=Wd,$T=Ph,QT=Th,qT=Lh,YT=Fh,XT=Ah,t3=Ca,JT=Ru,ZT=Ia,eO=Ou,tO=Dh,nO=jh,rO=Uh,iO=zh,sO=ja,oO=Bh,aO=Gh,lO=Hh,uO=Wh,cO=Kh,dO=$h,hO=Qh,fO=Yh,pO=Xh,gO=Jh,mO=Zh,yO=ef,vO=tf,SO=nf,xO=rf,wO=sf,_O=of,CO=af,kO=lf,EO=cf,PO=df,NO=hf;wh.Konva=e3.Konva.Util._assign(e3.Konva,{Arc:$T.Arc,Arrow:QT.Arrow,Circle:qT.Circle,Ellipse:YT.Ellipse,Image:XT.Image,Label:t3.Label,Tag:t3.Tag,Line:JT.Line,Path:ZT.Path,Rect:eO.Rect,RegularPolygon:tO.RegularPolygon,Ring:nO.Ring,Sprite:rO.Sprite,Star:iO.Star,Text:sO.Text,TextPath:oO.TextPath,Transformer:aO.Transformer,Wedge:lO.Wedge,Filters:{Blur:uO.Blur,Brighten:cO.Brighten,Contrast:dO.Contrast,Emboss:hO.Emboss,Enhance:fO.Enhance,Grayscale:pO.Grayscale,HSL:gO.HSL,HSV:mO.HSV,Invert:yO.Invert,Kaleidoscope:vO.Kaleidoscope,Mask:SO.Mask,Noise:xO.Noise,Pixelate:wO.Pixelate,Posterize:_O.Posterize,RGB:CO.RGB,RGBA:kO.RGBA,Sepia:EO.Sepia,Solarize:PO.Solarize,Threshold:NO.Threshold}});var RO=$8.exports;Object.defineProperty(RO,"__esModule",{value:!0});const TO=wh;$8.exports=TO.Konva;var Yg={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;var n=Wd;Object.defineProperty(e,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=Wd;t.exports=r.Konva})(Yg,Yg.exports);var OO=Yg.exports;const lu=Yd(OO);var RS={exports:{}};/**
* @license React
* react-reconciler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var bO=function(e){var n={},r=V,i=Pl,s=Object.assign;function l(o){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+o,d=1;d<arguments.length;d++)a+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+o+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,c=Symbol.for("react.element"),h=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),m=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),_=Symbol.for("react.offscreen"),R=Symbol.iterator;function b(o){return o===null||typeof o!="object"?null:(o=R&&o[R]||o["@@iterator"],typeof o=="function"?o:null)}function A(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case p:return"Fragment";case h:return"Portal";case S:return"Profiler";case y:return"StrictMode";case P:return"Suspense";case E:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case m:return(o.displayName||"Context")+".Consumer";case x:return(o._context.displayName||"Context")+".Provider";case C:var a=o.render;return o=o.displayName,o||(o=a.displayName||a.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case k:return a=o.displayName||null,a!==null?a:A(o.type)||"Memo";case v:a=o._payload,o=o._init;try{return A(o(a))}catch{}}return null}function O(o){var a=o.type;switch(o.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=a.render,o=o.displayName||o.name||"",a.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return A(a);case 8:return a===y?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function I(o){var a=o,d=o;if(o.alternate)for(;a.return;)a=a.return;else{o=a;do a=o,a.flags&4098&&(d=a.return),o=a.return;while(o)}return a.tag===3?d:null}function L(o){if(I(o)!==o)throw Error(l(188))}function H(o){var a=o.alternate;if(!a){if(a=I(o),a===null)throw Error(l(188));return a!==o?null:o}for(var d=o,f=a;;){var g=d.return;if(g===null)break;var w=g.alternate;if(w===null){if(f=g.return,f!==null){d=f;continue}break}if(g.child===w.child){for(w=g.child;w;){if(w===d)return L(g),o;if(w===f)return L(g),a;w=w.sibling}throw Error(l(188))}if(d.return!==f.return)d=g,f=w;else{for(var T=!1,M=g.child;M;){if(M===d){T=!0,d=g,f=w;break}if(M===f){T=!0,f=g,d=w;break}M=M.sibling}if(!T){for(M=w.child;M;){if(M===d){T=!0,d=w,f=g;break}if(M===f){T=!0,f=w,d=g;break}M=M.sibling}if(!T)throw Error(l(189))}}if(d.alternate!==f)throw Error(l(190))}if(d.tag!==3)throw Error(l(188));return d.stateNode.current===d?o:a}function B(o){return o=H(o),o!==null?$(o):null}function $(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var a=$(o);if(a!==null)return a;o=o.sibling}return null}function q(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){if(o.tag!==4){var a=q(o);if(a!==null)return a}o=o.sibling}return null}var Q=Array.isArray,re=e.getPublicInstance,he=e.getRootHostContext,W=e.getChildHostContext,te=e.prepareForCommit,Z=e.resetAfterCommit,Y=e.createInstance,ie=e.appendInitialChild,xe=e.finalizeInitialChildren,Ke=e.prepareUpdate,it=e.shouldSetTextContent,$e=e.createTextInstance,D=e.scheduleTimeout,X=e.cancelTimeout,ce=e.noTimeout,De=e.isPrimaryRenderer,we=e.supportsMutation,He=e.supportsPersistence,Qe=e.supportsHydration,vr=e.getInstanceFromNode,ze=e.preparePortalMount,gi=e.getCurrentEventPriority,Zn=e.detachDeletedInstance,mi=e.supportsMicrotasks,zS=e.scheduleMicrotask,Ua=e.supportsTestSelectors,BS=e.findFiberRoot,GS=e.getBoundingRect,HS=e.getTextContent,za=e.isHiddenSubtree,VS=e.matchAccessibilityRole,WS=e.setFocusIfFocusable,KS=e.setupIntersectionObserver,$S=e.appendChild,QS=e.appendChildToContainer,qS=e.commitTextUpdate,YS=e.commitMount,XS=e.commitUpdate,JS=e.insertBefore,ZS=e.insertInContainerBefore,ex=e.removeChild,tx=e.removeChildFromContainer,Pm=e.resetTextContent,nx=e.hideInstance,rx=e.hideTextInstance,ix=e.unhideInstance,sx=e.unhideTextInstance,ox=e.clearContainer,ax=e.cloneInstance,Nm=e.createContainerChildSet,Rm=e.appendChildToContainerChildSet,lx=e.finalizeContainerChildren,mf=e.replaceContainerChildren,Tm=e.cloneHiddenInstance,Om=e.cloneHiddenTextInstance,ux=e.canHydrateInstance,cx=e.canHydrateTextInstance,dx=e.canHydrateSuspenseInstance,bm=e.isSuspenseInstancePending,yf=e.isSuspenseInstanceFallback,hx=e.getSuspenseInstanceFallbackErrorDetails,fx=e.registerSuspenseInstanceRetry,bu=e.getNextHydratableSibling,px=e.getFirstHydratableChild,gx=e.getFirstHydratableChildWithinContainer,mx=e.getFirstHydratableChildWithinSuspenseInstance,yx=e.hydrateInstance,vx=e.hydrateTextInstance,Sx=e.hydrateSuspenseInstance,xx=e.getNextHydratableInstanceAfterSuspenseInstance,wx=e.commitHydratedContainer,_x=e.commitHydratedSuspenseInstance,Cx=e.clearSuspenseBoundary,kx=e.clearSuspenseBoundaryFromContainer,Ex=e.shouldDeleteUnhydratedTailInstances,Px=e.didNotMatchHydratedContainerTextInstance,Nx=e.didNotMatchHydratedTextInstance,vf;function Ba(o){if(vf===void 0)try{throw Error()}catch(d){var a=d.stack.trim().match(/\n( *(at )?)/);vf=a&&a[1]||""}return`
`+vf+o}var Sf=!1;function xf(o,a){if(!o||Sf)return"";Sf=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(ee){var f=ee}Reflect.construct(o,[],a)}else{try{a.call()}catch(ee){f=ee}o.call(a.prototype)}else{try{throw Error()}catch(ee){f=ee}o()}}catch(ee){if(ee&&f&&typeof ee.stack=="string"){for(var g=ee.stack.split(`
`),w=f.stack.split(`
`),T=g.length-1,M=w.length-1;1<=T&&0<=M&&g[T]!==w[M];)M--;for(;1<=T&&0<=M;T--,M--)if(g[T]!==w[M]){if(T!==1||M!==1)do if(T--,M--,0>M||g[T]!==w[M]){var G=`
`+g[T].replace(" at new "," at ");return o.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",o.displayName)),G}while(1<=T&&0<=M);break}}}finally{Sf=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?Ba(o):""}var Rx=Object.prototype.hasOwnProperty,wf=[],mo=-1;function yi(o){return{current:o}}function qe(o){0>mo||(o.current=wf[mo],wf[mo]=null,mo--)}function Ve(o,a){mo++,wf[mo]=o.current,o.current=a}var vi={},Ht=yi(vi),cn=yi(!1),gs=vi;function yo(o,a){var d=o.type.contextTypes;if(!d)return vi;var f=o.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===a)return f.__reactInternalMemoizedMaskedChildContext;var g={},w;for(w in d)g[w]=a[w];return f&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=a,o.__reactInternalMemoizedMaskedChildContext=g),g}function dn(o){return o=o.childContextTypes,o!=null}function Lu(){qe(cn),qe(Ht)}function Lm(o,a,d){if(Ht.current!==vi)throw Error(l(168));Ve(Ht,a),Ve(cn,d)}function Fm(o,a,d){var f=o.stateNode;if(a=a.childContextTypes,typeof f.getChildContext!="function")return d;f=f.getChildContext();for(var g in f)if(!(g in a))throw Error(l(108,O(o)||"Unknown",g));return s({},d,f)}function Fu(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||vi,gs=Ht.current,Ve(Ht,o),Ve(cn,cn.current),!0}function Am(o,a,d){var f=o.stateNode;if(!f)throw Error(l(169));d?(o=Fm(o,a,gs),f.__reactInternalMemoizedMergedChildContext=o,qe(cn),qe(Ht),Ve(Ht,o)):qe(cn),Ve(cn,d)}var er=Math.clz32?Math.clz32:bx,Tx=Math.log,Ox=Math.LN2;function bx(o){return o>>>=0,o===0?32:31-(Tx(o)/Ox|0)|0}var Au=64,Mu=4194304;function Ga(o){switch(o&-o){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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function Iu(o,a){var d=o.pendingLanes;if(d===0)return 0;var f=0,g=o.suspendedLanes,w=o.pingedLanes,T=d&268435455;if(T!==0){var M=T&~g;M!==0?f=Ga(M):(w&=T,w!==0&&(f=Ga(w)))}else T=d&~g,T!==0?f=Ga(T):w!==0&&(f=Ga(w));if(f===0)return 0;if(a!==0&&a!==f&&!(a&g)&&(g=f&-f,w=a&-a,g>=w||g===16&&(w&4194240)!==0))return a;if(f&4&&(f|=d&16),a=o.entangledLanes,a!==0)for(o=o.entanglements,a&=f;0<a;)d=31-er(a),g=1<<d,f|=o[d],a&=~g;return f}function Lx(o,a){switch(o){case 1:case 2:case 4:return a+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fx(o,a){for(var d=o.suspendedLanes,f=o.pingedLanes,g=o.expirationTimes,w=o.pendingLanes;0<w;){var T=31-er(w),M=1<<T,G=g[T];G===-1?(!(M&d)||M&f)&&(g[T]=Lx(M,a)):G<=a&&(o.expiredLanes|=M),w&=~M}}function _f(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Mm(){var o=Au;return Au<<=1,!(Au&4194240)&&(Au=64),o}function Cf(o){for(var a=[],d=0;31>d;d++)a.push(o);return a}function Ha(o,a,d){o.pendingLanes|=a,a!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,a=31-er(a),o[a]=d}function Ax(o,a){var d=o.pendingLanes&~a;o.pendingLanes=a,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=a,o.mutableReadLanes&=a,o.entangledLanes&=a,a=o.entanglements;var f=o.eventTimes;for(o=o.expirationTimes;0<d;){var g=31-er(d),w=1<<g;a[g]=0,f[g]=-1,o[g]=-1,d&=~w}}function kf(o,a){var d=o.entangledLanes|=a;for(o=o.entanglements;d;){var f=31-er(d),g=1<<f;g&a|o[f]&a&&(o[f]|=a),d&=~g}}var Le=0;function Im(o){return o&=-o,1<o?4<o?o&268435455?16:536870912:4:1}var Ef=i.unstable_scheduleCallback,Dm=i.unstable_cancelCallback,Mx=i.unstable_shouldYield,Ix=i.unstable_requestPaint,Ot=i.unstable_now,Pf=i.unstable_ImmediatePriority,Dx=i.unstable_UserBlockingPriority,Nf=i.unstable_NormalPriority,jx=i.unstable_IdlePriority,Du=null,Sr=null;function Ux(o){if(Sr&&typeof Sr.onCommitFiberRoot=="function")try{Sr.onCommitFiberRoot(Du,o,void 0,(o.current.flags&128)===128)}catch{}}function zx(o,a){return o===a&&(o!==0||1/o===1/a)||o!==o&&a!==a}var tr=typeof Object.is=="function"?Object.is:zx,Ur=null,ju=!1,Rf=!1;function jm(o){Ur===null?Ur=[o]:Ur.push(o)}function Bx(o){ju=!0,jm(o)}function xr(){if(!Rf&&Ur!==null){Rf=!0;var o=0,a=Le;try{var d=Ur;for(Le=1;o<d.length;o++){var f=d[o];do f=f(!0);while(f!==null)}Ur=null,ju=!1}catch(g){throw Ur!==null&&(Ur=Ur.slice(o+1)),Ef(Pf,xr),g}finally{Le=a,Rf=!1}}return null}var vo=[],So=0,Uu=null,zu=0,Mn=[],In=0,ms=null,zr=1,Br="";function ys(o,a){vo[So++]=zu,vo[So++]=Uu,Uu=o,zu=a}function Um(o,a,d){Mn[In++]=zr,Mn[In++]=Br,Mn[In++]=ms,ms=o;var f=zr;o=Br;var g=32-er(f)-1;f&=~(1<<g),d+=1;var w=32-er(a)+g;if(30<w){var T=g-g%5;w=(f&(1<<T)-1).toString(32),f>>=T,g-=T,zr=1<<32-er(a)+g|d<<g|f,Br=w+o}else zr=1<<w|d<<g|f,Br=o}function Tf(o){o.return!==null&&(ys(o,1),Um(o,1,0))}function Of(o){for(;o===Uu;)Uu=vo[--So],vo[So]=null,zu=vo[--So],vo[So]=null;for(;o===ms;)ms=Mn[--In],Mn[In]=null,Br=Mn[--In],Mn[In]=null,zr=Mn[--In],Mn[In]=null}var En=null,Dn=null,Ze=!1,Va=!1,nr=null;function zm(o,a){var d=Gn(5,null,null,0);d.elementType="DELETED",d.stateNode=a,d.return=o,a=o.deletions,a===null?(o.deletions=[d],o.flags|=16):a.push(d)}function Bm(o,a){switch(o.tag){case 5:return a=ux(a,o.type,o.pendingProps),a!==null?(o.stateNode=a,En=o,Dn=px(a),!0):!1;case 6:return a=cx(a,o.pendingProps),a!==null?(o.stateNode=a,En=o,Dn=null,!0):!1;case 13:if(a=dx(a),a!==null){var d=ms!==null?{id:zr,overflow:Br}:null;return o.memoizedState={dehydrated:a,treeContext:d,retryLane:1073741824},d=Gn(18,null,null,0),d.stateNode=a,d.return=o,o.child=d,En=o,Dn=null,!0}return!1;default:return!1}}function bf(o){return(o.mode&1)!==0&&(o.flags&128)===0}function Lf(o){if(Ze){var a=Dn;if(a){var d=a;if(!Bm(o,a)){if(bf(o))throw Error(l(418));a=bu(d);var f=En;a&&Bm(o,a)?zm(f,d):(o.flags=o.flags&-4097|2,Ze=!1,En=o)}}else{if(bf(o))throw Error(l(418));o.flags=o.flags&-4097|2,Ze=!1,En=o}}}function Gm(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;En=o}function Bu(o){if(!Qe||o!==En)return!1;if(!Ze)return Gm(o),Ze=!0,!1;if(o.tag!==3&&(o.tag!==5||Ex(o.type)&&!it(o.type,o.memoizedProps))){var a=Dn;if(a){if(bf(o))throw Hm(),Error(l(418));for(;a;)zm(o,a),a=bu(a)}}if(Gm(o),o.tag===13){if(!Qe)throw Error(l(316));if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(l(317));Dn=xx(o)}else Dn=En?bu(o.stateNode):null;return!0}function Hm(){for(var o=Dn;o;)o=bu(o)}function xo(){Qe&&(Dn=En=null,Va=Ze=!1)}function Ff(o){nr===null?nr=[o]:nr.push(o)}var Gx=u.ReactCurrentBatchConfig;function Gu(o,a){if(tr(o,a))return!0;if(typeof o!="object"||o===null||typeof a!="object"||a===null)return!1;var d=Object.keys(o),f=Object.keys(a);if(d.length!==f.length)return!1;for(f=0;f<d.length;f++){var g=d[f];if(!Rx.call(a,g)||!tr(o[g],a[g]))return!1}return!0}function Hx(o){switch(o.tag){case 5:return Ba(o.type);case 16:return Ba("Lazy");case 13:return Ba("Suspense");case 19:return Ba("SuspenseList");case 0:case 2:case 15:return o=xf(o.type,!1),o;case 11:return o=xf(o.type.render,!1),o;case 1:return o=xf(o.type,!0),o;default:return""}}function Wa(o,a,d){if(o=d.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(l(309));var f=d.stateNode}if(!f)throw Error(l(147,o));var g=f,w=""+o;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===w?a.ref:(a=function(T){var M=g.refs;T===null?delete M[w]:M[w]=T},a._stringRef=w,a)}if(typeof o!="string")throw Error(l(284));if(!d._owner)throw Error(l(290,o))}return o}function Hu(o,a){throw o=Object.prototype.toString.call(a),Error(l(31,o==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":o))}function Vm(o){var a=o._init;return a(o._payload)}function Wm(o){function a(U,j){if(o){var K=U.deletions;K===null?(U.deletions=[j],U.flags|=16):K.push(j)}}function d(U,j){if(!o)return null;for(;j!==null;)a(U,j),j=j.sibling;return null}function f(U,j){for(U=new Map;j!==null;)j.key!==null?U.set(j.key,j):U.set(j.index,j),j=j.sibling;return U}function g(U,j){return U=Ei(U,j),U.index=0,U.sibling=null,U}function w(U,j,K){return U.index=K,o?(K=U.alternate,K!==null?(K=K.index,K<j?(U.flags|=2,j):K):(U.flags|=2,j)):(U.flags|=1048576,j)}function T(U){return o&&U.alternate===null&&(U.flags|=2),U}function M(U,j,K,oe){return j===null||j.tag!==6?(j=Rp(K,U.mode,oe),j.return=U,j):(j=g(j,K),j.return=U,j)}function G(U,j,K,oe){var fe=K.type;return fe===p?ue(U,j,K.props.children,oe,K.key):j!==null&&(j.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===v&&Vm(fe)===j.type)?(oe=g(j,K.props),oe.ref=Wa(U,j,K),oe.return=U,oe):(oe=xc(K.type,K.key,K.props,null,U.mode,oe),oe.ref=Wa(U,j,K),oe.return=U,oe)}function ee(U,j,K,oe){return j===null||j.tag!==4||j.stateNode.containerInfo!==K.containerInfo||j.stateNode.implementation!==K.implementation?(j=Tp(K,U.mode,oe),j.return=U,j):(j=g(j,K.children||[]),j.return=U,j)}function ue(U,j,K,oe,fe){return j===null||j.tag!==7?(j=ks(K,U.mode,oe,fe),j.return=U,j):(j=g(j,K),j.return=U,j)}function ve(U,j,K){if(typeof j=="string"&&j!==""||typeof j=="number")return j=Rp(""+j,U.mode,K),j.return=U,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case c:return K=xc(j.type,j.key,j.props,null,U.mode,K),K.ref=Wa(U,null,j),K.return=U,K;case h:return j=Tp(j,U.mode,K),j.return=U,j;case v:var oe=j._init;return ve(U,oe(j._payload),K)}if(Q(j)||b(j))return j=ks(j,U.mode,K,null),j.return=U,j;Hu(U,j)}return null}function se(U,j,K,oe){var fe=j!==null?j.key:null;if(typeof K=="string"&&K!==""||typeof K=="number")return fe!==null?null:M(U,j,""+K,oe);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case c:return K.key===fe?G(U,j,K,oe):null;case h:return K.key===fe?ee(U,j,K,oe):null;case v:return fe=K._init,se(U,j,fe(K._payload),oe)}if(Q(K)||b(K))return fe!==null?null:ue(U,j,K,oe,null);Hu(U,K)}return null}function Ye(U,j,K,oe,fe){if(typeof oe=="string"&&oe!==""||typeof oe=="number")return U=U.get(K)||null,M(j,U,""+oe,fe);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case c:return U=U.get(oe.key===null?K:oe.key)||null,G(j,U,oe,fe);case h:return U=U.get(oe.key===null?K:oe.key)||null,ee(j,U,oe,fe);case v:var Ce=oe._init;return Ye(U,j,K,Ce(oe._payload),fe)}if(Q(oe)||b(oe))return U=U.get(K)||null,ue(j,U,oe,fe,null);Hu(j,oe)}return null}function Be(U,j,K,oe){for(var fe=null,Ce=null,Se=j,Fe=j=0,Ft=null;Se!==null&&Fe<K.length;Fe++){Se.index>Fe?(Ft=Se,Se=null):Ft=Se.sibling;var Ae=se(U,Se,K[Fe],oe);if(Ae===null){Se===null&&(Se=Ft);break}o&&Se&&Ae.alternate===null&&a(U,Se),j=w(Ae,j,Fe),Ce===null?fe=Ae:Ce.sibling=Ae,Ce=Ae,Se=Ft}if(Fe===K.length)return d(U,Se),Ze&&ys(U,Fe),fe;if(Se===null){for(;Fe<K.length;Fe++)Se=ve(U,K[Fe],oe),Se!==null&&(j=w(Se,j,Fe),Ce===null?fe=Se:Ce.sibling=Se,Ce=Se);return Ze&&ys(U,Fe),fe}for(Se=f(U,Se);Fe<K.length;Fe++)Ft=Ye(Se,U,Fe,K[Fe],oe),Ft!==null&&(o&&Ft.alternate!==null&&Se.delete(Ft.key===null?Fe:Ft.key),j=w(Ft,j,Fe),Ce===null?fe=Ft:Ce.sibling=Ft,Ce=Ft);return o&&Se.forEach(function(Pi){return a(U,Pi)}),Ze&&ys(U,Fe),fe}function gn(U,j,K,oe){var fe=b(K);if(typeof fe!="function")throw Error(l(150));if(K=fe.call(K),K==null)throw Error(l(151));for(var Ce=fe=null,Se=j,Fe=j=0,Ft=null,Ae=K.next();Se!==null&&!Ae.done;Fe++,Ae=K.next()){Se.index>Fe?(Ft=Se,Se=null):Ft=Se.sibling;var Pi=se(U,Se,Ae.value,oe);if(Pi===null){Se===null&&(Se=Ft);break}o&&Se&&Pi.alternate===null&&a(U,Se),j=w(Pi,j,Fe),Ce===null?fe=Pi:Ce.sibling=Pi,Ce=Pi,Se=Ft}if(Ae.done)return d(U,Se),Ze&&ys(U,Fe),fe;if(Se===null){for(;!Ae.done;Fe++,Ae=K.next())Ae=ve(U,Ae.value,oe),Ae!==null&&(j=w(Ae,j,Fe),Ce===null?fe=Ae:Ce.sibling=Ae,Ce=Ae);return Ze&&ys(U,Fe),fe}for(Se=f(U,Se);!Ae.done;Fe++,Ae=K.next())Ae=Ye(Se,U,Fe,Ae.value,oe),Ae!==null&&(o&&Ae.alternate!==null&&Se.delete(Ae.key===null?Fe:Ae.key),j=w(Ae,j,Fe),Ce===null?fe=Ae:Ce.sibling=Ae,Ce=Ae);return o&&Se.forEach(function(S9){return a(U,S9)}),Ze&&ys(U,Fe),fe}function Wr(U,j,K,oe){if(typeof K=="object"&&K!==null&&K.type===p&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case c:e:{for(var fe=K.key,Ce=j;Ce!==null;){if(Ce.key===fe){if(fe=K.type,fe===p){if(Ce.tag===7){d(U,Ce.sibling),j=g(Ce,K.props.children),j.return=U,U=j;break e}}else if(Ce.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===v&&Vm(fe)===Ce.type){d(U,Ce.sibling),j=g(Ce,K.props),j.ref=Wa(U,Ce,K),j.return=U,U=j;break e}d(U,Ce);break}else a(U,Ce);Ce=Ce.sibling}K.type===p?(j=ks(K.props.children,U.mode,oe,K.key),j.return=U,U=j):(oe=xc(K.type,K.key,K.props,null,U.mode,oe),oe.ref=Wa(U,j,K),oe.return=U,U=oe)}return T(U);case h:e:{for(Ce=K.key;j!==null;){if(j.key===Ce)if(j.tag===4&&j.stateNode.containerInfo===K.containerInfo&&j.stateNode.implementation===K.implementation){d(U,j.sibling),j=g(j,K.children||[]),j.return=U,U=j;break e}else{d(U,j);break}else a(U,j);j=j.sibling}j=Tp(K,U.mode,oe),j.return=U,U=j}return T(U);case v:return Ce=K._init,Wr(U,j,Ce(K._payload),oe)}if(Q(K))return Be(U,j,K,oe);if(b(K))return gn(U,j,K,oe);Hu(U,K)}return typeof K=="string"&&K!==""||typeof K=="number"?(K=""+K,j!==null&&j.tag===6?(d(U,j.sibling),j=g(j,K),j.return=U,U=j):(d(U,j),j=Rp(K,U.mode,oe),j.return=U,U=j),T(U)):d(U,j)}return Wr}var wo=Wm(!0),Km=Wm(!1),Vu=yi(null),Wu=null,_o=null,Af=null;function Mf(){Af=_o=Wu=null}function $m(o,a,d){De?(Ve(Vu,a._currentValue),a._currentValue=d):(Ve(Vu,a._currentValue2),a._currentValue2=d)}function If(o){var a=Vu.current;qe(Vu),De?o._currentValue=a:o._currentValue2=a}function Df(o,a,d){for(;o!==null;){var f=o.alternate;if((o.childLanes&a)!==a?(o.childLanes|=a,f!==null&&(f.childLanes|=a)):f!==null&&(f.childLanes&a)!==a&&(f.childLanes|=a),o===d)break;o=o.return}}function Co(o,a){Wu=o,Af=_o=null,o=o.dependencies,o!==null&&o.firstContext!==null&&(o.lanes&a&&(hn=!0),o.firstContext=null)}function jn(o){var a=De?o._currentValue:o._currentValue2;if(Af!==o)if(o={context:o,memoizedValue:a,next:null},_o===null){if(Wu===null)throw Error(l(308));_o=o,Wu.dependencies={lanes:0,firstContext:o}}else _o=_o.next=o;return a}var vs=null;function jf(o){vs===null?vs=[o]:vs.push(o)}function Qm(o,a,d,f){var g=a.interleaved;return g===null?(d.next=d,jf(a)):(d.next=g.next,g.next=d),a.interleaved=d,wr(o,f)}function wr(o,a){o.lanes|=a;var d=o.alternate;for(d!==null&&(d.lanes|=a),d=o,o=o.return;o!==null;)o.childLanes|=a,d=o.alternate,d!==null&&(d.childLanes|=a),d=o,o=o.return;return d.tag===3?d.stateNode:null}var Si=!1;function Uf(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qm(o,a){o=o.updateQueue,a.updateQueue===o&&(a.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function Gr(o,a){return{eventTime:o,lane:a,tag:0,payload:null,callback:null,next:null}}function xi(o,a,d){var f=o.updateQueue;if(f===null)return null;if(f=f.shared,Ee&2){var g=f.pending;return g===null?a.next=a:(a.next=g.next,g.next=a),f.pending=a,wr(o,d)}return g=f.interleaved,g===null?(a.next=a,jf(f)):(a.next=g.next,g.next=a),f.interleaved=a,wr(o,d)}function Ku(o,a,d){if(a=a.updateQueue,a!==null&&(a=a.shared,(d&4194240)!==0)){var f=a.lanes;f&=o.pendingLanes,d|=f,a.lanes=d,kf(o,d)}}function Ym(o,a){var d=o.updateQueue,f=o.alternate;if(f!==null&&(f=f.updateQueue,d===f)){var g=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var T={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};w===null?g=w=T:w=w.next=T,d=d.next}while(d!==null);w===null?g=w=a:w=w.next=a}else g=w=a;d={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:w,shared:f.shared,effects:f.effects},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=a:o.next=a,d.lastBaseUpdate=a}function $u(o,a,d,f){var g=o.updateQueue;Si=!1;var w=g.firstBaseUpdate,T=g.lastBaseUpdate,M=g.shared.pending;if(M!==null){g.shared.pending=null;var G=M,ee=G.next;G.next=null,T===null?w=ee:T.next=ee,T=G;var ue=o.alternate;ue!==null&&(ue=ue.updateQueue,M=ue.lastBaseUpdate,M!==T&&(M===null?ue.firstBaseUpdate=ee:M.next=ee,ue.lastBaseUpdate=G))}if(w!==null){var ve=g.baseState;T=0,ue=ee=G=null,M=w;do{var se=M.lane,Ye=M.eventTime;if((f&se)===se){ue!==null&&(ue=ue.next={eventTime:Ye,lane:0,tag:M.tag,payload:M.payload,callback:M.callback,next:null});e:{var Be=o,gn=M;switch(se=a,Ye=d,gn.tag){case 1:if(Be=gn.payload,typeof Be=="function"){ve=Be.call(Ye,ve,se);break e}ve=Be;break e;case 3:Be.flags=Be.flags&-65537|128;case 0:if(Be=gn.payload,se=typeof Be=="function"?Be.call(Ye,ve,se):Be,se==null)break e;ve=s({},ve,se);break e;case 2:Si=!0}}M.callback!==null&&M.lane!==0&&(o.flags|=64,se=g.effects,se===null?g.effects=[M]:se.push(M))}else Ye={eventTime:Ye,lane:se,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ue===null?(ee=ue=Ye,G=ve):ue=ue.next=Ye,T|=se;if(M=M.next,M===null){if(M=g.shared.pending,M===null)break;se=M,M=se.next,se.next=null,g.lastBaseUpdate=se,g.shared.pending=null}}while(!0);if(ue===null&&(G=ve),g.baseState=G,g.firstBaseUpdate=ee,g.lastBaseUpdate=ue,a=g.shared.interleaved,a!==null){g=a;do T|=g.lane,g=g.next;while(g!==a)}else w===null&&(g.shared.lanes=0);xs|=T,o.lanes=T,o.memoizedState=ve}}function Xm(o,a,d){if(o=a.effects,a.effects=null,o!==null)for(a=0;a<o.length;a++){var f=o[a],g=f.callback;if(g!==null){if(f.callback=null,f=d,typeof g!="function")throw Error(l(191,g));g.call(f)}}}var Ka={},Un=yi(Ka),$a=yi(Ka),ko=yi(Ka);function _r(o){if(o===Ka)throw Error(l(174));return o}function zf(o,a){Ve(ko,a),Ve($a,o),Ve(Un,Ka),o=he(a),qe(Un),Ve(Un,o)}function Eo(){qe(Un),qe($a),qe(ko)}function Jm(o){var a=_r(ko.current),d=_r(Un.current);a=W(d,o.type,a),d!==a&&(Ve($a,o),Ve(Un,a))}function Bf(o){$a.current===o&&(qe(Un),qe($a))}var st=yi(0);function Qu(o){for(var a=o;a!==null;){if(a.tag===13){var d=a.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||bm(d)||yf(d)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if(a.flags&128)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Gf=[];function Hf(){for(var o=0;o<Gf.length;o++){var a=Gf[o];De?a._workInProgressVersionPrimary=null:a._workInProgressVersionSecondary=null}Gf.length=0}var qu=u.ReactCurrentDispatcher,Vf=u.ReactCurrentBatchConfig,Ss=0,ot=null,_t=null,bt=null,Yu=!1,Qa=!1,qa=0,Vx=0;function Vt(){throw Error(l(321))}function Wf(o,a){if(a===null)return!1;for(var d=0;d<a.length&&d<o.length;d++)if(!tr(o[d],a[d]))return!1;return!0}function Kf(o,a,d,f,g,w){if(Ss=w,ot=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,qu.current=o===null||o.memoizedState===null?Qx:qx,o=d(f,g),Qa){w=0;do{if(Qa=!1,qa=0,25<=w)throw Error(l(301));w+=1,bt=_t=null,a.updateQueue=null,qu.current=Yx,o=d(f,g)}while(Qa)}if(qu.current=Zu,a=_t!==null&&_t.next!==null,Ss=0,bt=_t=ot=null,Yu=!1,a)throw Error(l(300));return o}function $f(){var o=qa!==0;return qa=0,o}function Cr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?ot.memoizedState=bt=o:bt=bt.next=o,bt}function zn(){if(_t===null){var o=ot.alternate;o=o!==null?o.memoizedState:null}else o=_t.next;var a=bt===null?ot.memoizedState:bt.next;if(a!==null)bt=a,_t=o;else{if(o===null)throw Error(l(310));_t=o,o={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},bt===null?ot.memoizedState=bt=o:bt=bt.next=o}return bt}function Ya(o,a){return typeof a=="function"?a(o):a}function Qf(o){var a=zn(),d=a.queue;if(d===null)throw Error(l(311));d.lastRenderedReducer=o;var f=_t,g=f.baseQueue,w=d.pending;if(w!==null){if(g!==null){var T=g.next;g.next=w.next,w.next=T}f.baseQueue=g=w,d.pending=null}if(g!==null){w=g.next,f=f.baseState;var M=T=null,G=null,ee=w;do{var ue=ee.lane;if((Ss&ue)===ue)G!==null&&(G=G.next={lane:0,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),f=ee.hasEagerState?ee.eagerState:o(f,ee.action);else{var ve={lane:ue,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null};G===null?(M=G=ve,T=f):G=G.next=ve,ot.lanes|=ue,xs|=ue}ee=ee.next}while(ee!==null&&ee!==w);G===null?T=f:G.next=M,tr(f,a.memoizedState)||(hn=!0),a.memoizedState=f,a.baseState=T,a.baseQueue=G,d.lastRenderedState=f}if(o=d.interleaved,o!==null){g=o;do w=g.lane,ot.lanes|=w,xs|=w,g=g.next;while(g!==o)}else g===null&&(d.lanes=0);return[a.memoizedState,d.dispatch]}function qf(o){var a=zn(),d=a.queue;if(d===null)throw Error(l(311));d.lastRenderedReducer=o;var f=d.dispatch,g=d.pending,w=a.memoizedState;if(g!==null){d.pending=null;var T=g=g.next;do w=o(w,T.action),T=T.next;while(T!==g);tr(w,a.memoizedState)||(hn=!0),a.memoizedState=w,a.baseQueue===null&&(a.baseState=w),d.lastRenderedState=w}return[w,f]}function Zm(){}function e2(o,a){var d=ot,f=zn(),g=a(),w=!tr(f.memoizedState,g);if(w&&(f.memoizedState=g,hn=!0),f=f.queue,Yf(r2.bind(null,d,f,o),[o]),f.getSnapshot!==a||w||bt!==null&&bt.memoizedState.tag&1){if(d.flags|=2048,Xa(9,n2.bind(null,d,f,g,a),void 0,null),Lt===null)throw Error(l(349));Ss&30||t2(d,a,g)}return g}function t2(o,a,d){o.flags|=16384,o={getSnapshot:a,value:d},a=ot.updateQueue,a===null?(a={lastEffect:null,stores:null},ot.updateQueue=a,a.stores=[o]):(d=a.stores,d===null?a.stores=[o]:d.push(o))}function n2(o,a,d,f){a.value=d,a.getSnapshot=f,i2(a)&&s2(o)}function r2(o,a,d){return d(function(){i2(a)&&s2(o)})}function i2(o){var a=o.getSnapshot;o=o.value;try{var d=a();return!tr(o,d)}catch{return!0}}function s2(o){var a=wr(o,1);a!==null&&Bn(a,o,1,-1)}function o2(o){var a=Cr();return typeof o=="function"&&(o=o()),a.memoizedState=a.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ya,lastRenderedState:o},a.queue=o,o=o.dispatch=$x.bind(null,ot,o),[a.memoizedState,o]}function Xa(o,a,d,f){return o={tag:o,create:a,destroy:d,deps:f,next:null},a=ot.updateQueue,a===null?(a={lastEffect:null,stores:null},ot.updateQueue=a,a.lastEffect=o.next=o):(d=a.lastEffect,d===null?a.lastEffect=o.next=o:(f=d.next,d.next=o,o.next=f,a.lastEffect=o)),o}function a2(){return zn().memoizedState}function Xu(o,a,d,f){var g=Cr();ot.flags|=o,g.memoizedState=Xa(1|a,d,void 0,f===void 0?null:f)}function Ju(o,a,d,f){var g=zn();f=f===void 0?null:f;var w=void 0;if(_t!==null){var T=_t.memoizedState;if(w=T.destroy,f!==null&&Wf(f,T.deps)){g.memoizedState=Xa(a,d,w,f);return}}ot.flags|=o,g.memoizedState=Xa(1|a,d,w,f)}function l2(o,a){return Xu(8390656,8,o,a)}function Yf(o,a){return Ju(2048,8,o,a)}function u2(o,a){return Ju(4,2,o,a)}function c2(o,a){return Ju(4,4,o,a)}function d2(o,a){if(typeof a=="function")return o=o(),a(o),function(){a(null)};if(a!=null)return o=o(),a.current=o,function(){a.current=null}}function h2(o,a,d){return d=d!=null?d.concat([o]):null,Ju(4,4,d2.bind(null,a,o),d)}function Xf(){}function f2(o,a){var d=zn();a=a===void 0?null:a;var f=d.memoizedState;return f!==null&&a!==null&&Wf(a,f[1])?f[0]:(d.memoizedState=[o,a],o)}function p2(o,a){var d=zn();a=a===void 0?null:a;var f=d.memoizedState;return f!==null&&a!==null&&Wf(a,f[1])?f[0]:(o=o(),d.memoizedState=[o,a],o)}function g2(o,a,d){return Ss&21?(tr(d,a)||(d=Mm(),ot.lanes|=d,xs|=d,o.baseState=!0),a):(o.baseState&&(o.baseState=!1,hn=!0),o.memoizedState=d)}function Wx(o,a){var d=Le;Le=d!==0&&4>d?d:4,o(!0);var f=Vf.transition;Vf.transition={};try{o(!1),a()}finally{Le=d,Vf.transition=f}}function m2(){return zn().memoizedState}function Kx(o,a,d){var f=Ci(o);if(d={lane:f,action:d,hasEagerState:!1,eagerState:null,next:null},y2(o))v2(a,d);else if(d=Qm(o,a,d,f),d!==null){var g=$t();Bn(d,o,f,g),S2(d,a,f)}}function $x(o,a,d){var f=Ci(o),g={lane:f,action:d,hasEagerState:!1,eagerState:null,next:null};if(y2(o))v2(a,g);else{var w=o.alternate;if(o.lanes===0&&(w===null||w.lanes===0)&&(w=a.lastRenderedReducer,w!==null))try{var T=a.lastRenderedState,M=w(T,d);if(g.hasEagerState=!0,g.eagerState=M,tr(M,T)){var G=a.interleaved;G===null?(g.next=g,jf(a)):(g.next=G.next,G.next=g),a.interleaved=g;return}}catch{}finally{}d=Qm(o,a,g,f),d!==null&&(g=$t(),Bn(d,o,f,g),S2(d,a,f))}}function y2(o){var a=o.alternate;return o===ot||a!==null&&a===ot}function v2(o,a){Qa=Yu=!0;var d=o.pending;d===null?a.next=a:(a.next=d.next,d.next=a),o.pending=a}function S2(o,a,d){if(d&4194240){var f=a.lanes;f&=o.pendingLanes,d|=f,a.lanes=d,kf(o,d)}}var Zu={readContext:jn,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useInsertionEffect:Vt,useLayoutEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useMutableSource:Vt,useSyncExternalStore:Vt,useId:Vt,unstable_isNewReconciler:!1},Qx={readContext:jn,useCallback:function(o,a){return Cr().memoizedState=[o,a===void 0?null:a],o},useContext:jn,useEffect:l2,useImperativeHandle:function(o,a,d){return d=d!=null?d.concat([o]):null,Xu(4194308,4,d2.bind(null,a,o),d)},useLayoutEffect:function(o,a){return Xu(4194308,4,o,a)},useInsertionEffect:function(o,a){return Xu(4,2,o,a)},useMemo:function(o,a){var d=Cr();return a=a===void 0?null:a,o=o(),d.memoizedState=[o,a],o},useReducer:function(o,a,d){var f=Cr();return a=d!==void 0?d(a):a,f.memoizedState=f.baseState=a,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:a},f.queue=o,o=o.dispatch=Kx.bind(null,ot,o),[f.memoizedState,o]},useRef:function(o){var a=Cr();return o={current:o},a.memoizedState=o},useState:o2,useDebugValue:Xf,useDeferredValue:function(o){return Cr().memoizedState=o},useTransition:function(){var o=o2(!1),a=o[0];return o=Wx.bind(null,o[1]),Cr().memoizedState=o,[a,o]},useMutableSource:function(){},useSyncExternalStore:function(o,a,d){var f=ot,g=Cr();if(Ze){if(d===void 0)throw Error(l(407));d=d()}else{if(d=a(),Lt===null)throw Error(l(349));Ss&30||t2(f,a,d)}g.memoizedState=d;var w={value:d,getSnapshot:a};return g.queue=w,l2(r2.bind(null,f,w,o),[o]),f.flags|=2048,Xa(9,n2.bind(null,f,w,d,a),void 0,null),d},useId:function(){var o=Cr(),a=Lt.identifierPrefix;if(Ze){var d=Br,f=zr;d=(f&~(1<<32-er(f)-1)).toString(32)+d,a=":"+a+"R"+d,d=qa++,0<d&&(a+="H"+d.toString(32)),a+=":"}else d=Vx++,a=":"+a+"r"+d.toString(32)+":";return o.memoizedState=a},unstable_isNewReconciler:!1},qx={readContext:jn,useCallback:f2,useContext:jn,useEffect:Yf,useImperativeHandle:h2,useInsertionEffect:u2,useLayoutEffect:c2,useMemo:p2,useReducer:Qf,useRef:a2,useState:function(){return Qf(Ya)},useDebugValue:Xf,useDeferredValue:function(o){var a=zn();return g2(a,_t.memoizedState,o)},useTransition:function(){var o=Qf(Ya)[0],a=zn().memoizedState;return[o,a]},useMutableSource:Zm,useSyncExternalStore:e2,useId:m2,unstable_isNewReconciler:!1},Yx={readContext:jn,useCallback:f2,useContext:jn,useEffect:Yf,useImperativeHandle:h2,useInsertionEffect:u2,useLayoutEffect:c2,useMemo:p2,useReducer:qf,useRef:a2,useState:function(){return qf(Ya)},useDebugValue:Xf,useDeferredValue:function(o){var a=zn();return _t===null?a.memoizedState=o:g2(a,_t.memoizedState,o)},useTransition:function(){var o=qf(Ya)[0],a=zn().memoizedState;return[o,a]},useMutableSource:Zm,useSyncExternalStore:e2,useId:m2,unstable_isNewReconciler:!1};function rr(o,a){if(o&&o.defaultProps){a=s({},a),o=o.defaultProps;for(var d in o)a[d]===void 0&&(a[d]=o[d]);return a}return a}function Jf(o,a,d,f){a=o.memoizedState,d=d(f,a),d=d==null?a:s({},a,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var ec={isMounted:function(o){return(o=o._reactInternals)?I(o)===o:!1},enqueueSetState:function(o,a,d){o=o._reactInternals;var f=$t(),g=Ci(o),w=Gr(f,g);w.payload=a,d!=null&&(w.callback=d),a=xi(o,w,g),a!==null&&(Bn(a,o,g,f),Ku(a,o,g))},enqueueReplaceState:function(o,a,d){o=o._reactInternals;var f=$t(),g=Ci(o),w=Gr(f,g);w.tag=1,w.payload=a,d!=null&&(w.callback=d),a=xi(o,w,g),a!==null&&(Bn(a,o,g,f),Ku(a,o,g))},enqueueForceUpdate:function(o,a){o=o._reactInternals;var d=$t(),f=Ci(o),g=Gr(d,f);g.tag=2,a!=null&&(g.callback=a),a=xi(o,g,f),a!==null&&(Bn(a,o,f,d),Ku(a,o,f))}};function x2(o,a,d,f,g,w,T){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(f,w,T):a.prototype&&a.prototype.isPureReactComponent?!Gu(d,f)||!Gu(g,w):!0}function w2(o,a,d){var f=!1,g=vi,w=a.contextType;return typeof w=="object"&&w!==null?w=jn(w):(g=dn(a)?gs:Ht.current,f=a.contextTypes,w=(f=f!=null)?yo(o,g):vi),a=new a(d,w),o.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=ec,o.stateNode=a,a._reactInternals=o,f&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=g,o.__reactInternalMemoizedMaskedChildContext=w),a}function _2(o,a,d,f){o=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(d,f),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(d,f),a.state!==o&&ec.enqueueReplaceState(a,a.state,null)}function Zf(o,a,d,f){var g=o.stateNode;g.props=d,g.state=o.memoizedState,g.refs={},Uf(o);var w=a.contextType;typeof w=="object"&&w!==null?g.context=jn(w):(w=dn(a)?gs:Ht.current,g.context=yo(o,w)),g.state=o.memoizedState,w=a.getDerivedStateFromProps,typeof w=="function"&&(Jf(o,a,w,d),g.state=o.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(a=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),a!==g.state&&ec.enqueueReplaceState(g,g.state,null),$u(o,d,g,f),g.state=o.memoizedState),typeof g.componentDidMount=="function"&&(o.flags|=4194308)}function Po(o,a){try{var d="",f=a;do d+=Hx(f),f=f.return;while(f);var g=d}catch(w){g=`
Error generating stack: `+w.message+`
`+w.stack}return{value:o,source:a,stack:g,digest:null}}function ep(o,a,d){return{value:o,source:null,stack:d??null,digest:a??null}}function tp(o,a){try{console.error(a.value)}catch(d){setTimeout(function(){throw d})}}var Xx=typeof WeakMap=="function"?WeakMap:Map;function C2(o,a,d){d=Gr(-1,d),d.tag=3,d.payload={element:null};var f=a.value;return d.callback=function(){pc||(pc=!0,wp=f),tp(o,a)},d}function k2(o,a,d){d=Gr(-1,d),d.tag=3;var f=o.type.getDerivedStateFromError;if(typeof f=="function"){var g=a.value;d.payload=function(){return f(g)},d.callback=function(){tp(o,a)}}var w=o.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(d.callback=function(){tp(o,a),typeof f!="function"&&(wi===null?wi=new Set([this]):wi.add(this));var T=a.stack;this.componentDidCatch(a.value,{componentStack:T!==null?T:""})}),d}function E2(o,a,d){var f=o.pingCache;if(f===null){f=o.pingCache=new Xx;var g=new Set;f.set(a,g)}else g=f.get(a),g===void 0&&(g=new Set,f.set(a,g));g.has(d)||(g.add(d),o=d9.bind(null,o,a,d),a.then(o,o))}function P2(o){do{var a;if((a=o.tag===13)&&(a=o.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return o;o=o.return}while(o!==null);return null}function N2(o,a,d,f,g){return o.mode&1?(o.flags|=65536,o.lanes=g,o):(o===a?o.flags|=65536:(o.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(a=Gr(-1,1),a.tag=2,xi(d,a,1))),d.lanes|=1),o)}var Jx=u.ReactCurrentOwner,hn=!1;function tn(o,a,d,f){a.child=o===null?Km(a,null,d,f):wo(a,o.child,d,f)}function R2(o,a,d,f,g){d=d.render;var w=a.ref;return Co(a,g),f=Kf(o,a,d,f,w,g),d=$f(),o!==null&&!hn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~g,Hr(o,a,g)):(Ze&&d&&Tf(a),a.flags|=1,tn(o,a,f,g),a.child)}function T2(o,a,d,f,g){if(o===null){var w=d.type;return typeof w=="function"&&!Np(w)&&w.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(a.tag=15,a.type=w,O2(o,a,w,f,g)):(o=xc(d.type,null,f,a,a.mode,g),o.ref=a.ref,o.return=a,a.child=o)}if(w=o.child,!(o.lanes&g)){var T=w.memoizedProps;if(d=d.compare,d=d!==null?d:Gu,d(T,f)&&o.ref===a.ref)return Hr(o,a,g)}return a.flags|=1,o=Ei(w,f),o.ref=a.ref,o.return=a,a.child=o}function O2(o,a,d,f,g){if(o!==null){var w=o.memoizedProps;if(Gu(w,f)&&o.ref===a.ref)if(hn=!1,a.pendingProps=f=w,(o.lanes&g)!==0)o.flags&131072&&(hn=!0);else return a.lanes=o.lanes,Hr(o,a,g)}return np(o,a,d,f,g)}function b2(o,a,d){var f=a.pendingProps,g=f.children,w=o!==null?o.memoizedState:null;if(f.mode==="hidden")if(!(a.mode&1))a.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ve(Ro,Pn),Pn|=d;else{if(!(d&1073741824))return o=w!==null?w.baseLanes|d:d,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:o,cachePool:null,transitions:null},a.updateQueue=null,Ve(Ro,Pn),Pn|=o,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=w!==null?w.baseLanes:d,Ve(Ro,Pn),Pn|=f}else w!==null?(f=w.baseLanes|d,a.memoizedState=null):f=d,Ve(Ro,Pn),Pn|=f;return tn(o,a,g,d),a.child}function L2(o,a){var d=a.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(a.flags|=512,a.flags|=2097152)}function np(o,a,d,f,g){var w=dn(d)?gs:Ht.current;return w=yo(a,w),Co(a,g),d=Kf(o,a,d,f,w,g),f=$f(),o!==null&&!hn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~g,Hr(o,a,g)):(Ze&&f&&Tf(a),a.flags|=1,tn(o,a,d,g),a.child)}function F2(o,a,d,f,g){if(dn(d)){var w=!0;Fu(a)}else w=!1;if(Co(a,g),a.stateNode===null)nc(o,a),w2(a,d,f),Zf(a,d,f,g),f=!0;else if(o===null){var T=a.stateNode,M=a.memoizedProps;T.props=M;var G=T.context,ee=d.contextType;typeof ee=="object"&&ee!==null?ee=jn(ee):(ee=dn(d)?gs:Ht.current,ee=yo(a,ee));var ue=d.getDerivedStateFromProps,ve=typeof ue=="function"||typeof T.getSnapshotBeforeUpdate=="function";ve||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(M!==f||G!==ee)&&_2(a,T,f,ee),Si=!1;var se=a.memoizedState;T.state=se,$u(a,f,T,g),G=a.memoizedState,M!==f||se!==G||cn.current||Si?(typeof ue=="function"&&(Jf(a,d,ue,f),G=a.memoizedState),(M=Si||x2(a,d,M,f,se,G,ee))?(ve||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(a.flags|=4194308)):(typeof T.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=f,a.memoizedState=G),T.props=f,T.state=G,T.context=ee,f=M):(typeof T.componentDidMount=="function"&&(a.flags|=4194308),f=!1)}else{T=a.stateNode,qm(o,a),M=a.memoizedProps,ee=a.type===a.elementType?M:rr(a.type,M),T.props=ee,ve=a.pendingProps,se=T.context,G=d.contextType,typeof G=="object"&&G!==null?G=jn(G):(G=dn(d)?gs:Ht.current,G=yo(a,G));var Ye=d.getDerivedStateFromProps;(ue=typeof Ye=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(M!==ve||se!==G)&&_2(a,T,f,G),Si=!1,se=a.memoizedState,T.state=se,$u(a,f,T,g);var Be=a.memoizedState;M!==ve||se!==Be||cn.current||Si?(typeof Ye=="function"&&(Jf(a,d,Ye,f),Be=a.memoizedState),(ee=Si||x2(a,d,ee,f,se,Be,G)||!1)?(ue||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(f,Be,G),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(f,Be,G)),typeof T.componentDidUpdate=="function"&&(a.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof T.componentDidUpdate!="function"||M===o.memoizedProps&&se===o.memoizedState||(a.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||M===o.memoizedProps&&se===o.memoizedState||(a.flags|=1024),a.memoizedProps=f,a.memoizedState=Be),T.props=f,T.state=Be,T.context=G,f=ee):(typeof T.componentDidUpdate!="function"||M===o.memoizedProps&&se===o.memoizedState||(a.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||M===o.memoizedProps&&se===o.memoizedState||(a.flags|=1024),f=!1)}return rp(o,a,d,f,w,g)}function rp(o,a,d,f,g,w){L2(o,a);var T=(a.flags&128)!==0;if(!f&&!T)return g&&Am(a,d,!1),Hr(o,a,w);f=a.stateNode,Jx.current=a;var M=T&&typeof d.getDerivedStateFromError!="function"?null:f.render();return a.flags|=1,o!==null&&T?(a.child=wo(a,o.child,null,w),a.child=wo(a,null,M,w)):tn(o,a,M,w),a.memoizedState=f.state,g&&Am(a,d,!0),a.child}function A2(o){var a=o.stateNode;a.pendingContext?Lm(o,a.pendingContext,a.pendingContext!==a.context):a.context&&Lm(o,a.context,!1),zf(o,a.containerInfo)}function M2(o,a,d,f,g){return xo(),Ff(g),a.flags|=256,tn(o,a,d,f),a.child}var ip={dehydrated:null,treeContext:null,retryLane:0};function sp(o){return{baseLanes:o,cachePool:null,transitions:null}}function I2(o,a,d){var f=a.pendingProps,g=st.current,w=!1,T=(a.flags&128)!==0,M;if((M=T)||(M=o!==null&&o.memoizedState===null?!1:(g&2)!==0),M?(w=!0,a.flags&=-129):(o===null||o.memoizedState!==null)&&(g|=1),Ve(st,g&1),o===null)return Lf(a),o=a.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?(a.mode&1?yf(o)?a.lanes=8:a.lanes=1073741824:a.lanes=1,null):(T=f.children,o=f.fallback,w?(f=a.mode,w=a.child,T={mode:"hidden",children:T},!(f&1)&&w!==null?(w.childLanes=0,w.pendingProps=T):w=wc(T,f,0,null),o=ks(o,f,d,null),w.return=a,o.return=a,w.sibling=o,a.child=w,a.child.memoizedState=sp(d),a.memoizedState=ip,o):op(a,T));if(g=o.memoizedState,g!==null&&(M=g.dehydrated,M!==null))return Zx(o,a,T,f,M,g,d);if(w){w=f.fallback,T=a.mode,g=o.child,M=g.sibling;var G={mode:"hidden",children:f.children};return!(T&1)&&a.child!==g?(f=a.child,f.childLanes=0,f.pendingProps=G,a.deletions=null):(f=Ei(g,G),f.subtreeFlags=g.subtreeFlags&14680064),M!==null?w=Ei(M,w):(w=ks(w,T,d,null),w.flags|=2),w.return=a,f.return=a,f.sibling=w,a.child=f,f=w,w=a.child,T=o.child.memoizedState,T=T===null?sp(d):{baseLanes:T.baseLanes|d,cachePool:null,transitions:T.transitions},w.memoizedState=T,w.childLanes=o.childLanes&~d,a.memoizedState=ip,f}return w=o.child,o=w.sibling,f=Ei(w,{mode:"visible",children:f.children}),!(a.mode&1)&&(f.lanes=d),f.return=a,f.sibling=null,o!==null&&(d=a.deletions,d===null?(a.deletions=[o],a.flags|=16):d.push(o)),a.child=f,a.memoizedState=null,f}function op(o,a){return a=wc({mode:"visible",children:a},o.mode,0,null),a.return=o,o.child=a}function tc(o,a,d,f){return f!==null&&Ff(f),wo(a,o.child,null,d),o=op(a,a.pendingProps.children),o.flags|=2,a.memoizedState=null,o}function Zx(o,a,d,f,g,w,T){if(d)return a.flags&256?(a.flags&=-257,f=ep(Error(l(422))),tc(o,a,T,f)):a.memoizedState!==null?(a.child=o.child,a.flags|=128,null):(w=f.fallback,g=a.mode,f=wc({mode:"visible",children:f.children},g,0,null),w=ks(w,g,T,null),w.flags|=2,f.return=a,w.return=a,f.sibling=w,a.child=f,a.mode&1&&wo(a,o.child,null,T),a.child.memoizedState=sp(T),a.memoizedState=ip,w);if(!(a.mode&1))return tc(o,a,T,null);if(yf(g))return f=hx(g).digest,w=Error(l(419)),f=ep(w,f,void 0),tc(o,a,T,f);if(d=(T&o.childLanes)!==0,hn||d){if(f=Lt,f!==null){switch(T&-T){case 4:g=2;break;case 16:g=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:g=32;break;case 536870912:g=268435456;break;default:g=0}g=g&(f.suspendedLanes|T)?0:g,g!==0&&g!==w.retryLane&&(w.retryLane=g,wr(o,g),Bn(f,o,g,-1))}return Pp(),f=ep(Error(l(421))),tc(o,a,T,f)}return bm(g)?(a.flags|=128,a.child=o.child,a=h9.bind(null,o),fx(g,a),null):(o=w.treeContext,Qe&&(Dn=mx(g),En=a,Ze=!0,nr=null,Va=!1,o!==null&&(Mn[In++]=zr,Mn[In++]=Br,Mn[In++]=ms,zr=o.id,Br=o.overflow,ms=a)),a=op(a,f.children),a.flags|=4096,a)}function D2(o,a,d){o.lanes|=a;var f=o.alternate;f!==null&&(f.lanes|=a),Df(o.return,a,d)}function ap(o,a,d,f,g){var w=o.memoizedState;w===null?o.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:f,tail:d,tailMode:g}:(w.isBackwards=a,w.rendering=null,w.renderingStartTime=0,w.last=f,w.tail=d,w.tailMode=g)}function j2(o,a,d){var f=a.pendingProps,g=f.revealOrder,w=f.tail;if(tn(o,a,f.children,d),f=st.current,f&2)f=f&1|2,a.flags|=128;else{if(o!==null&&o.flags&128)e:for(o=a.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&D2(o,d,a);else if(o.tag===19)D2(o,d,a);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}f&=1}if(Ve(st,f),!(a.mode&1))a.memoizedState=null;else switch(g){case"forwards":for(d=a.child,g=null;d!==null;)o=d.alternate,o!==null&&Qu(o)===null&&(g=d),d=d.sibling;d=g,d===null?(g=a.child,a.child=null):(g=d.sibling,d.sibling=null),ap(a,!1,g,d,w);break;case"backwards":for(d=null,g=a.child,a.child=null;g!==null;){if(o=g.alternate,o!==null&&Qu(o)===null){a.child=g;break}o=g.sibling,g.sibling=d,d=g,g=o}ap(a,!0,d,null,w);break;case"together":ap(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function nc(o,a){!(a.mode&1)&&o!==null&&(o.alternate=null,a.alternate=null,a.flags|=2)}function Hr(o,a,d){if(o!==null&&(a.dependencies=o.dependencies),xs|=a.lanes,!(d&a.childLanes))return null;if(o!==null&&a.child!==o.child)throw Error(l(153));if(a.child!==null){for(o=a.child,d=Ei(o,o.pendingProps),a.child=d,d.return=a;o.sibling!==null;)o=o.sibling,d=d.sibling=Ei(o,o.pendingProps),d.return=a;d.sibling=null}return a.child}function e9(o,a,d){switch(a.tag){case 3:A2(a),xo();break;case 5:Jm(a);break;case 1:dn(a.type)&&Fu(a);break;case 4:zf(a,a.stateNode.containerInfo);break;case 10:$m(a,a.type._context,a.memoizedProps.value);break;case 13:var f=a.memoizedState;if(f!==null)return f.dehydrated!==null?(Ve(st,st.current&1),a.flags|=128,null):d&a.child.childLanes?I2(o,a,d):(Ve(st,st.current&1),o=Hr(o,a,d),o!==null?o.sibling:null);Ve(st,st.current&1);break;case 19:if(f=(d&a.childLanes)!==0,o.flags&128){if(f)return j2(o,a,d);a.flags|=128}var g=a.memoizedState;if(g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),Ve(st,st.current),f)break;return null;case 22:case 23:return a.lanes=0,b2(o,a,d)}return Hr(o,a,d)}function kr(o){o.flags|=4}function U2(o,a){if(o!==null&&o.child===a.child)return!0;if(a.flags&16)return!1;for(o=a.child;o!==null;){if(o.flags&12854||o.subtreeFlags&12854)return!1;o=o.sibling}return!0}var Ja,Za,rc,ic;if(we)Ja=function(o,a){for(var d=a.child;d!==null;){if(d.tag===5||d.tag===6)ie(o,d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===a)break;for(;d.sibling===null;){if(d.return===null||d.return===a)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Za=function(){},rc=function(o,a,d,f,g){if(o=o.memoizedProps,o!==f){var w=a.stateNode,T=_r(Un.current);d=Ke(w,d,o,f,g,T),(a.updateQueue=d)&&kr(a)}},ic=function(o,a,d,f){d!==f&&kr(a)};else if(He){Ja=function(o,a,d,f){for(var g=a.child;g!==null;){if(g.tag===5){var w=g.stateNode;d&&f&&(w=Tm(w,g.type,g.memoizedProps,g)),ie(o,w)}else if(g.tag===6)w=g.stateNode,d&&f&&(w=Om(w,g.memoizedProps,g)),ie(o,w);else if(g.tag!==4){if(g.tag===22&&g.memoizedState!==null)w=g.child,w!==null&&(w.return=g),Ja(o,g,!0,!0);else if(g.child!==null){g.child.return=g,g=g.child;continue}}if(g===a)break;for(;g.sibling===null;){if(g.return===null||g.return===a)return;g=g.return}g.sibling.return=g.return,g=g.sibling}};var z2=function(o,a,d,f){for(var g=a.child;g!==null;){if(g.tag===5){var w=g.stateNode;d&&f&&(w=Tm(w,g.type,g.memoizedProps,g)),Rm(o,w)}else if(g.tag===6)w=g.stateNode,d&&f&&(w=Om(w,g.memoizedProps,g)),Rm(o,w);else if(g.tag!==4){if(g.tag===22&&g.memoizedState!==null)w=g.child,w!==null&&(w.return=g),z2(o,g,!0,!0);else if(g.child!==null){g.child.return=g,g=g.child;continue}}if(g===a)break;for(;g.sibling===null;){if(g.return===null||g.return===a)return;g=g.return}g.sibling.return=g.return,g=g.sibling}};Za=function(o,a){var d=a.stateNode;if(!U2(o,a)){o=d.containerInfo;var f=Nm(o);z2(f,a,!1,!1),d.pendingChildren=f,kr(a),lx(o,f)}},rc=function(o,a,d,f,g){var w=o.stateNode,T=o.memoizedProps;if((o=U2(o,a))&&T===f)a.stateNode=w;else{var M=a.stateNode,G=_r(Un.current),ee=null;T!==f&&(ee=Ke(M,d,T,f,g,G)),o&&ee===null?a.stateNode=w:(w=ax(w,ee,d,T,f,a,o,M),xe(w,d,f,g,G)&&kr(a),a.stateNode=w,o?kr(a):Ja(w,a,!1,!1))}},ic=function(o,a,d,f){d!==f?(o=_r(ko.current),d=_r(Un.current),a.stateNode=$e(f,o,d,a),kr(a)):a.stateNode=o.stateNode}}else Za=function(){},rc=function(){},ic=function(){};function el(o,a){if(!Ze)switch(o.tailMode){case"hidden":a=o.tail;for(var d=null;a!==null;)a.alternate!==null&&(d=a),a=a.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var f=null;d!==null;)d.alternate!==null&&(f=d),d=d.sibling;f===null?a||o.tail===null?o.tail=null:o.tail.sibling=null:f.sibling=null}}function Wt(o){var a=o.alternate!==null&&o.alternate.child===o.child,d=0,f=0;if(a)for(var g=o.child;g!==null;)d|=g.lanes|g.childLanes,f|=g.subtreeFlags&14680064,f|=g.flags&14680064,g.return=o,g=g.sibling;else for(g=o.child;g!==null;)d|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=o,g=g.sibling;return o.subtreeFlags|=f,o.childLanes=d,a}function t9(o,a,d){var f=a.pendingProps;switch(Of(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(a),null;case 1:return dn(a.type)&&Lu(),Wt(a),null;case 3:return d=a.stateNode,Eo(),qe(cn),qe(Ht),Hf(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(o===null||o.child===null)&&(Bu(a)?kr(a):o===null||o.memoizedState.isDehydrated&&!(a.flags&256)||(a.flags|=1024,nr!==null&&(kp(nr),nr=null))),Za(o,a),Wt(a),null;case 5:Bf(a),d=_r(ko.current);var g=a.type;if(o!==null&&a.stateNode!=null)rc(o,a,g,f,d),o.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!f){if(a.stateNode===null)throw Error(l(166));return Wt(a),null}if(o=_r(Un.current),Bu(a)){if(!Qe)throw Error(l(175));o=yx(a.stateNode,a.type,a.memoizedProps,d,o,a,!Va),a.updateQueue=o,o!==null&&kr(a)}else{var w=Y(g,f,d,o,a);Ja(w,a,!1,!1),a.stateNode=w,xe(w,g,f,d,o)&&kr(a)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return Wt(a),null;case 6:if(o&&a.stateNode!=null)ic(o,a,o.memoizedProps,f);else{if(typeof f!="string"&&a.stateNode===null)throw Error(l(166));if(o=_r(ko.current),d=_r(Un.current),Bu(a)){if(!Qe)throw Error(l(176));if(o=a.stateNode,d=a.memoizedProps,(f=vx(o,d,a,!Va))&&(g=En,g!==null))switch(g.tag){case 3:Px(g.stateNode.containerInfo,o,d,(g.mode&1)!==0);break;case 5:Nx(g.type,g.memoizedProps,g.stateNode,o,d,(g.mode&1)!==0)}f&&kr(a)}else a.stateNode=$e(f,o,d,a)}return Wt(a),null;case 13:if(qe(st),f=a.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Ze&&Dn!==null&&a.mode&1&&!(a.flags&128))Hm(),xo(),a.flags|=98560,g=!1;else if(g=Bu(a),f!==null&&f.dehydrated!==null){if(o===null){if(!g)throw Error(l(318));if(!Qe)throw Error(l(344));if(g=a.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(l(317));Sx(g,a)}else xo(),!(a.flags&128)&&(a.memoizedState=null),a.flags|=4;Wt(a),g=!1}else nr!==null&&(kp(nr),nr=null),g=!0;if(!g)return a.flags&65536?a:null}return a.flags&128?(a.lanes=d,a):(d=f!==null,d!==(o!==null&&o.memoizedState!==null)&&d&&(a.child.flags|=8192,a.mode&1&&(o===null||st.current&1?Ct===0&&(Ct=3):Pp())),a.updateQueue!==null&&(a.flags|=4),Wt(a),null);case 4:return Eo(),Za(o,a),o===null&&ze(a.stateNode.containerInfo),Wt(a),null;case 10:return If(a.type._context),Wt(a),null;case 17:return dn(a.type)&&Lu(),Wt(a),null;case 19:if(qe(st),g=a.memoizedState,g===null)return Wt(a),null;if(f=(a.flags&128)!==0,w=g.rendering,w===null)if(f)el(g,!1);else{if(Ct!==0||o!==null&&o.flags&128)for(o=a.child;o!==null;){if(w=Qu(o),w!==null){for(a.flags|=128,el(g,!1),o=w.updateQueue,o!==null&&(a.updateQueue=o,a.flags|=4),a.subtreeFlags=0,o=d,d=a.child;d!==null;)f=d,g=o,f.flags&=14680066,w=f.alternate,w===null?(f.childLanes=0,f.lanes=g,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=w.childLanes,f.lanes=w.lanes,f.child=w.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=w.memoizedProps,f.memoizedState=w.memoizedState,f.updateQueue=w.updateQueue,f.type=w.type,g=w.dependencies,f.dependencies=g===null?null:{lanes:g.lanes,firstContext:g.firstContext}),d=d.sibling;return Ve(st,st.current&1|2),a.child}o=o.sibling}g.tail!==null&&Ot()>xp&&(a.flags|=128,f=!0,el(g,!1),a.lanes=4194304)}else{if(!f)if(o=Qu(w),o!==null){if(a.flags|=128,f=!0,o=o.updateQueue,o!==null&&(a.updateQueue=o,a.flags|=4),el(g,!0),g.tail===null&&g.tailMode==="hidden"&&!w.alternate&&!Ze)return Wt(a),null}else 2*Ot()-g.renderingStartTime>xp&&d!==1073741824&&(a.flags|=128,f=!0,el(g,!1),a.lanes=4194304);g.isBackwards?(w.sibling=a.child,a.child=w):(o=g.last,o!==null?o.sibling=w:a.child=w,g.last=w)}return g.tail!==null?(a=g.tail,g.rendering=a,g.tail=a.sibling,g.renderingStartTime=Ot(),a.sibling=null,o=st.current,Ve(st,f?o&1|2:o&1),a):(Wt(a),null);case 22:case 23:return Ep(),d=a.memoizedState!==null,o!==null&&o.memoizedState!==null!==d&&(a.flags|=8192),d&&a.mode&1?Pn&1073741824&&(Wt(a),we&&a.subtreeFlags&6&&(a.flags|=8192)):Wt(a),null;case 24:return null;case 25:return null}throw Error(l(156,a.tag))}function n9(o,a){switch(Of(a),a.tag){case 1:return dn(a.type)&&Lu(),o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 3:return Eo(),qe(cn),qe(Ht),Hf(),o=a.flags,o&65536&&!(o&128)?(a.flags=o&-65537|128,a):null;case 5:return Bf(a),null;case 13:if(qe(st),o=a.memoizedState,o!==null&&o.dehydrated!==null){if(a.alternate===null)throw Error(l(340));xo()}return o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 19:return qe(st),null;case 4:return Eo(),null;case 10:return If(a.type._context),null;case 22:case 23:return Ep(),null;case 24:return null;default:return null}}var sc=!1,Kt=!1,r9=typeof WeakSet=="function"?WeakSet:Set,ae=null;function No(o,a){var d=o.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(f){et(o,a,f)}else d.current=null}function lp(o,a,d){try{d()}catch(f){et(o,a,f)}}var B2=!1;function i9(o,a){for(te(o.containerInfo),ae=a;ae!==null;)if(o=ae,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,ae=a;else for(;ae!==null;){o=ae;try{var d=o.alternate;if(o.flags&1024)switch(o.tag){case 0:case 11:case 15:break;case 1:if(d!==null){var f=d.memoizedProps,g=d.memoizedState,w=o.stateNode,T=w.getSnapshotBeforeUpdate(o.elementType===o.type?f:rr(o.type,f),g);w.__reactInternalSnapshotBeforeUpdate=T}break;case 3:we&&ox(o.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(M){et(o,o.return,M)}if(a=o.sibling,a!==null){a.return=o.return,ae=a;break}ae=o.return}return d=B2,B2=!1,d}function tl(o,a,d){var f=a.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var g=f=f.next;do{if((g.tag&o)===o){var w=g.destroy;g.destroy=void 0,w!==void 0&&lp(a,d,w)}g=g.next}while(g!==f)}}function oc(o,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var d=a=a.next;do{if((d.tag&o)===o){var f=d.create;d.destroy=f()}d=d.next}while(d!==a)}}function up(o){var a=o.ref;if(a!==null){var d=o.stateNode;switch(o.tag){case 5:o=re(d);break;default:o=d}typeof a=="function"?a(o):a.current=o}}function G2(o){var a=o.alternate;a!==null&&(o.alternate=null,G2(a)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(a=o.stateNode,a!==null&&Zn(a)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function H2(o){return o.tag===5||o.tag===3||o.tag===4}function V2(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||H2(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function cp(o,a,d){var f=o.tag;if(f===5||f===6)o=o.stateNode,a?ZS(d,o,a):QS(d,o);else if(f!==4&&(o=o.child,o!==null))for(cp(o,a,d),o=o.sibling;o!==null;)cp(o,a,d),o=o.sibling}function dp(o,a,d){var f=o.tag;if(f===5||f===6)o=o.stateNode,a?JS(d,o,a):$S(d,o);else if(f!==4&&(o=o.child,o!==null))for(dp(o,a,d),o=o.sibling;o!==null;)dp(o,a,d),o=o.sibling}var jt=null,ir=!1;function Er(o,a,d){for(d=d.child;d!==null;)hp(o,a,d),d=d.sibling}function hp(o,a,d){if(Sr&&typeof Sr.onCommitFiberUnmount=="function")try{Sr.onCommitFiberUnmount(Du,d)}catch{}switch(d.tag){case 5:Kt||No(d,a);case 6:if(we){var f=jt,g=ir;jt=null,Er(o,a,d),jt=f,ir=g,jt!==null&&(ir?tx(jt,d.stateNode):ex(jt,d.stateNode))}else Er(o,a,d);break;case 18:we&&jt!==null&&(ir?kx(jt,d.stateNode):Cx(jt,d.stateNode));break;case 4:we?(f=jt,g=ir,jt=d.stateNode.containerInfo,ir=!0,Er(o,a,d),jt=f,ir=g):(He&&(f=d.stateNode.containerInfo,g=Nm(f),mf(f,g)),Er(o,a,d));break;case 0:case 11:case 14:case 15:if(!Kt&&(f=d.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){g=f=f.next;do{var w=g,T=w.destroy;w=w.tag,T!==void 0&&(w&2||w&4)&&lp(d,a,T),g=g.next}while(g!==f)}Er(o,a,d);break;case 1:if(!Kt&&(No(d,a),f=d.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=d.memoizedProps,f.state=d.memoizedState,f.componentWillUnmount()}catch(M){et(d,a,M)}Er(o,a,d);break;case 21:Er(o,a,d);break;case 22:d.mode&1?(Kt=(f=Kt)||d.memoizedState!==null,Er(o,a,d),Kt=f):Er(o,a,d);break;default:Er(o,a,d)}}function W2(o){var a=o.updateQueue;if(a!==null){o.updateQueue=null;var d=o.stateNode;d===null&&(d=o.stateNode=new r9),a.forEach(function(f){var g=f9.bind(null,o,f);d.has(f)||(d.add(f),f.then(g,g))})}}function sr(o,a){var d=a.deletions;if(d!==null)for(var f=0;f<d.length;f++){var g=d[f];try{var w=o,T=a;if(we){var M=T;e:for(;M!==null;){switch(M.tag){case 5:jt=M.stateNode,ir=!1;break e;case 3:jt=M.stateNode.containerInfo,ir=!0;break e;case 4:jt=M.stateNode.containerInfo,ir=!0;break e}M=M.return}if(jt===null)throw Error(l(160));hp(w,T,g),jt=null,ir=!1}else hp(w,T,g);var G=g.alternate;G!==null&&(G.return=null),g.return=null}catch(ee){et(g,a,ee)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)K2(a,o),a=a.sibling}function K2(o,a){var d=o.alternate,f=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(sr(a,o),Pr(o),f&4){try{tl(3,o,o.return),oc(3,o)}catch(se){et(o,o.return,se)}try{tl(5,o,o.return)}catch(se){et(o,o.return,se)}}break;case 1:sr(a,o),Pr(o),f&512&&d!==null&&No(d,d.return);break;case 5:if(sr(a,o),Pr(o),f&512&&d!==null&&No(d,d.return),we){if(o.flags&32){var g=o.stateNode;try{Pm(g)}catch(se){et(o,o.return,se)}}if(f&4&&(g=o.stateNode,g!=null)){var w=o.memoizedProps;if(d=d!==null?d.memoizedProps:w,f=o.type,a=o.updateQueue,o.updateQueue=null,a!==null)try{XS(g,a,f,d,w,o)}catch(se){et(o,o.return,se)}}}break;case 6:if(sr(a,o),Pr(o),f&4&&we){if(o.stateNode===null)throw Error(l(162));g=o.stateNode,w=o.memoizedProps,d=d!==null?d.memoizedProps:w;try{qS(g,d,w)}catch(se){et(o,o.return,se)}}break;case 3:if(sr(a,o),Pr(o),f&4){if(we&&Qe&&d!==null&&d.memoizedState.isDehydrated)try{wx(a.containerInfo)}catch(se){et(o,o.return,se)}if(He){g=a.containerInfo,w=a.pendingChildren;try{mf(g,w)}catch(se){et(o,o.return,se)}}}break;case 4:if(sr(a,o),Pr(o),f&4&&He){w=o.stateNode,g=w.containerInfo,w=w.pendingChildren;try{mf(g,w)}catch(se){et(o,o.return,se)}}break;case 13:sr(a,o),Pr(o),g=o.child,g.flags&8192&&(w=g.memoizedState!==null,g.stateNode.isHidden=w,!w||g.alternate!==null&&g.alternate.memoizedState!==null||(Sp=Ot())),f&4&&W2(o);break;case 22:var T=d!==null&&d.memoizedState!==null;if(o.mode&1?(Kt=(d=Kt)||T,sr(a,o),Kt=d):sr(a,o),Pr(o),f&8192){if(d=o.memoizedState!==null,(o.stateNode.isHidden=d)&&!T&&o.mode&1)for(ae=o,f=o.child;f!==null;){for(a=ae=f;ae!==null;){T=ae;var M=T.child;switch(T.tag){case 0:case 11:case 14:case 15:tl(4,T,T.return);break;case 1:No(T,T.return);var G=T.stateNode;if(typeof G.componentWillUnmount=="function"){var ee=T,ue=T.return;try{var ve=ee;G.props=ve.memoizedProps,G.state=ve.memoizedState,G.componentWillUnmount()}catch(se){et(ee,ue,se)}}break;case 5:No(T,T.return);break;case 22:if(T.memoizedState!==null){q2(a);continue}}M!==null?(M.return=T,ae=M):q2(a)}f=f.sibling}if(we){e:if(f=null,we)for(a=o;;){if(a.tag===5){if(f===null){f=a;try{g=a.stateNode,d?nx(g):ix(a.stateNode,a.memoizedProps)}catch(se){et(o,o.return,se)}}}else if(a.tag===6){if(f===null)try{w=a.stateNode,d?rx(w):sx(w,a.memoizedProps)}catch(se){et(o,o.return,se)}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===o)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;f===a&&(f=null),a=a.return}f===a&&(f=null),a.sibling.return=a.return,a=a.sibling}}}break;case 19:sr(a,o),Pr(o),f&4&&W2(o);break;case 21:break;default:sr(a,o),Pr(o)}}function Pr(o){var a=o.flags;if(a&2){try{if(we){e:{for(var d=o.return;d!==null;){if(H2(d)){var f=d;break e}d=d.return}throw Error(l(160))}switch(f.tag){case 5:var g=f.stateNode;f.flags&32&&(Pm(g),f.flags&=-33);var w=V2(o);dp(o,w,g);break;case 3:case 4:var T=f.stateNode.containerInfo,M=V2(o);cp(o,M,T);break;default:throw Error(l(161))}}}catch(G){et(o,o.return,G)}o.flags&=-3}a&4096&&(o.flags&=-4097)}function s9(o,a,d){ae=o,$2(o)}function $2(o,a,d){for(var f=(o.mode&1)!==0;ae!==null;){var g=ae,w=g.child;if(g.tag===22&&f){var T=g.memoizedState!==null||sc;if(!T){var M=g.alternate,G=M!==null&&M.memoizedState!==null||Kt;M=sc;var ee=Kt;if(sc=T,(Kt=G)&&!ee)for(ae=g;ae!==null;)T=ae,G=T.child,T.tag===22&&T.memoizedState!==null?Y2(g):G!==null?(G.return=T,ae=G):Y2(g);for(;w!==null;)ae=w,$2(w),w=w.sibling;ae=g,sc=M,Kt=ee}Q2(o)}else g.subtreeFlags&8772&&w!==null?(w.return=g,ae=w):Q2(o)}}function Q2(o){for(;ae!==null;){var a=ae;if(a.flags&8772){var d=a.alternate;try{if(a.flags&8772)switch(a.tag){case 0:case 11:case 15:Kt||oc(5,a);break;case 1:var f=a.stateNode;if(a.flags&4&&!Kt)if(d===null)f.componentDidMount();else{var g=a.elementType===a.type?d.memoizedProps:rr(a.type,d.memoizedProps);f.componentDidUpdate(g,d.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var w=a.updateQueue;w!==null&&Xm(a,w,f);break;case 3:var T=a.updateQueue;if(T!==null){if(d=null,a.child!==null)switch(a.child.tag){case 5:d=re(a.child.stateNode);break;case 1:d=a.child.stateNode}Xm(a,T,d)}break;case 5:var M=a.stateNode;d===null&&a.flags&4&&YS(M,a.type,a.memoizedProps,a);break;case 6:break;case 4:break;case 12:break;case 13:if(Qe&&a.memoizedState===null){var G=a.alternate;if(G!==null){var ee=G.memoizedState;if(ee!==null){var ue=ee.dehydrated;ue!==null&&_x(ue)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(l(163))}Kt||a.flags&512&&up(a)}catch(ve){et(a,a.return,ve)}}if(a===o){ae=null;break}if(d=a.sibling,d!==null){d.return=a.return,ae=d;break}ae=a.return}}function q2(o){for(;ae!==null;){var a=ae;if(a===o){ae=null;break}var d=a.sibling;if(d!==null){d.return=a.return,ae=d;break}ae=a.return}}function Y2(o){for(;ae!==null;){var a=ae;try{switch(a.tag){case 0:case 11:case 15:var d=a.return;try{oc(4,a)}catch(G){et(a,d,G)}break;case 1:var f=a.stateNode;if(typeof f.componentDidMount=="function"){var g=a.return;try{f.componentDidMount()}catch(G){et(a,g,G)}}var w=a.return;try{up(a)}catch(G){et(a,w,G)}break;case 5:var T=a.return;try{up(a)}catch(G){et(a,T,G)}}}catch(G){et(a,a.return,G)}if(a===o){ae=null;break}var M=a.sibling;if(M!==null){M.return=a.return,ae=M;break}ae=a.return}}var ac=0,lc=1,uc=2,cc=3,dc=4;if(typeof Symbol=="function"&&Symbol.for){var nl=Symbol.for;ac=nl("selector.component"),lc=nl("selector.has_pseudo_class"),uc=nl("selector.role"),cc=nl("selector.test_id"),dc=nl("selector.text")}function fp(o){var a=vr(o);if(a!=null){if(typeof a.memoizedProps["data-testname"]!="string")throw Error(l(364));return a}if(o=BS(o),o===null)throw Error(l(362));return o.stateNode.current}function pp(o,a){switch(a.$$typeof){case ac:if(o.type===a.value)return!0;break;case lc:e:{a=a.value,o=[o,0];for(var d=0;d<o.length;){var f=o[d++],g=o[d++],w=a[g];if(f.tag!==5||!za(f)){for(;w!=null&&pp(f,w);)g++,w=a[g];if(g===a.length){a=!0;break e}else for(f=f.child;f!==null;)o.push(f,g),f=f.sibling}}a=!1}return a;case uc:if(o.tag===5&&VS(o.stateNode,a.value))return!0;break;case dc:if((o.tag===5||o.tag===6)&&(o=HS(o),o!==null&&0<=o.indexOf(a.value)))return!0;break;case cc:if(o.tag===5&&(o=o.memoizedProps["data-testname"],typeof o=="string"&&o.toLowerCase()===a.value.toLowerCase()))return!0;break;default:throw Error(l(365))}return!1}function gp(o){switch(o.$$typeof){case ac:return"<"+(A(o.value)||"Unknown")+">";case lc:return":has("+(gp(o)||"")+")";case uc:return'[role="'+o.value+'"]';case dc:return'"'+o.value+'"';case cc:return'[data-testname="'+o.value+'"]';default:throw Error(l(365))}}function X2(o,a){var d=[];o=[o,0];for(var f=0;f<o.length;){var g=o[f++],w=o[f++],T=a[w];if(g.tag!==5||!za(g)){for(;T!=null&&pp(g,T);)w++,T=a[w];if(w===a.length)d.push(g);else for(g=g.child;g!==null;)o.push(g,w),g=g.sibling}}return d}function mp(o,a){if(!Ua)throw Error(l(363));o=fp(o),o=X2(o,a),a=[],o=Array.from(o);for(var d=0;d<o.length;){var f=o[d++];if(f.tag===5)za(f)||a.push(f.stateNode);else for(f=f.child;f!==null;)o.push(f),f=f.sibling}return a}var o9=Math.ceil,hc=u.ReactCurrentDispatcher,yp=u.ReactCurrentOwner,gt=u.ReactCurrentBatchConfig,Ee=0,Lt=null,vt=null,Ut=0,Pn=0,Ro=yi(0),Ct=0,rl=null,xs=0,fc=0,vp=0,il=null,fn=null,Sp=0,xp=1/0,Vr=null;function To(){xp=Ot()+500}var pc=!1,wp=null,wi=null,gc=!1,_i=null,mc=0,sl=0,_p=null,yc=-1,vc=0;function $t(){return Ee&6?Ot():yc!==-1?yc:yc=Ot()}function Ci(o){return o.mode&1?Ee&2&&Ut!==0?Ut&-Ut:Gx.transition!==null?(vc===0&&(vc=Mm()),vc):(o=Le,o!==0?o:gi()):1}function Bn(o,a,d,f){if(50<sl)throw sl=0,_p=null,Error(l(185));Ha(o,d,f),(!(Ee&2)||o!==Lt)&&(o===Lt&&(!(Ee&2)&&(fc|=d),Ct===4&&ki(o,Ut)),pn(o,f),d===1&&Ee===0&&!(a.mode&1)&&(To(),ju&&xr()))}function pn(o,a){var d=o.callbackNode;Fx(o,a);var f=Iu(o,o===Lt?Ut:0);if(f===0)d!==null&&Dm(d),o.callbackNode=null,o.callbackPriority=0;else if(a=f&-f,o.callbackPriority!==a){if(d!=null&&Dm(d),a===1)o.tag===0?Bx(Z2.bind(null,o)):jm(Z2.bind(null,o)),mi?zS(function(){!(Ee&6)&&xr()}):Ef(Pf,xr),d=null;else{switch(Im(f)){case 1:d=Pf;break;case 4:d=Dx;break;case 16:d=Nf;break;case 536870912:d=jx;break;default:d=Nf}d=ly(d,J2.bind(null,o))}o.callbackPriority=a,o.callbackNode=d}}function J2(o,a){if(yc=-1,vc=0,Ee&6)throw Error(l(327));var d=o.callbackNode;if(Cs()&&o.callbackNode!==d)return null;var f=Iu(o,o===Lt?Ut:0);if(f===0)return null;if(f&30||f&o.expiredLanes||a)a=Sc(o,f);else{a=f;var g=Ee;Ee|=2;var w=ny();(Lt!==o||Ut!==a)&&(Vr=null,To(),ws(o,a));do try{u9();break}catch(M){ty(o,M)}while(!0);Mf(),hc.current=w,Ee=g,vt!==null?a=0:(Lt=null,Ut=0,a=Ct)}if(a!==0){if(a===2&&(g=_f(o),g!==0&&(f=g,a=Cp(o,g))),a===1)throw d=rl,ws(o,0),ki(o,f),pn(o,Ot()),d;if(a===6)ki(o,f);else{if(g=o.current.alternate,!(f&30)&&!a9(g)&&(a=Sc(o,f),a===2&&(w=_f(o),w!==0&&(f=w,a=Cp(o,w))),a===1))throw d=rl,ws(o,0),ki(o,f),pn(o,Ot()),d;switch(o.finishedWork=g,o.finishedLanes=f,a){case 0:case 1:throw Error(l(345));case 2:_s(o,fn,Vr);break;case 3:if(ki(o,f),(f&130023424)===f&&(a=Sp+500-Ot(),10<a)){if(Iu(o,0)!==0)break;if(g=o.suspendedLanes,(g&f)!==f){$t(),o.pingedLanes|=o.suspendedLanes&g;break}o.timeoutHandle=D(_s.bind(null,o,fn,Vr),a);break}_s(o,fn,Vr);break;case 4:if(ki(o,f),(f&4194240)===f)break;for(a=o.eventTimes,g=-1;0<f;){var T=31-er(f);w=1<<T,T=a[T],T>g&&(g=T),f&=~w}if(f=g,f=Ot()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*o9(f/1960))-f,10<f){o.timeoutHandle=D(_s.bind(null,o,fn,Vr),f);break}_s(o,fn,Vr);break;case 5:_s(o,fn,Vr);break;default:throw Error(l(329))}}}return pn(o,Ot()),o.callbackNode===d?J2.bind(null,o):null}function Cp(o,a){var d=il;return o.current.memoizedState.isDehydrated&&(ws(o,a).flags|=256),o=Sc(o,a),o!==2&&(a=fn,fn=d,a!==null&&kp(a)),o}function kp(o){fn===null?fn=o:fn.push.apply(fn,o)}function a9(o){for(var a=o;;){if(a.flags&16384){var d=a.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var f=0;f<d.length;f++){var g=d[f],w=g.getSnapshot;g=g.value;try{if(!tr(w(),g))return!1}catch{return!1}}}if(d=a.child,a.subtreeFlags&16384&&d!==null)d.return=a,a=d;else{if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function ki(o,a){for(a&=~vp,a&=~fc,o.suspendedLanes|=a,o.pingedLanes&=~a,o=o.expirationTimes;0<a;){var d=31-er(a),f=1<<d;o[d]=-1,a&=~f}}function Z2(o){if(Ee&6)throw Error(l(327));Cs();var a=Iu(o,0);if(!(a&1))return pn(o,Ot()),null;var d=Sc(o,a);if(o.tag!==0&&d===2){var f=_f(o);f!==0&&(a=f,d=Cp(o,f))}if(d===1)throw d=rl,ws(o,0),ki(o,a),pn(o,Ot()),d;if(d===6)throw Error(l(345));return o.finishedWork=o.current.alternate,o.finishedLanes=a,_s(o,fn,Vr),pn(o,Ot()),null}function ey(o){_i!==null&&_i.tag===0&&!(Ee&6)&&Cs();var a=Ee;Ee|=1;var d=gt.transition,f=Le;try{if(gt.transition=null,Le=1,o)return o()}finally{Le=f,gt.transition=d,Ee=a,!(Ee&6)&&xr()}}function Ep(){Pn=Ro.current,qe(Ro)}function ws(o,a){o.finishedWork=null,o.finishedLanes=0;var d=o.timeoutHandle;if(d!==ce&&(o.timeoutHandle=ce,X(d)),vt!==null)for(d=vt.return;d!==null;){var f=d;switch(Of(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&Lu();break;case 3:Eo(),qe(cn),qe(Ht),Hf();break;case 5:Bf(f);break;case 4:Eo();break;case 13:qe(st);break;case 19:qe(st);break;case 10:If(f.type._context);break;case 22:case 23:Ep()}d=d.return}if(Lt=o,vt=o=Ei(o.current,null),Ut=Pn=a,Ct=0,rl=null,vp=fc=xs=0,fn=il=null,vs!==null){for(a=0;a<vs.length;a++)if(d=vs[a],f=d.interleaved,f!==null){d.interleaved=null;var g=f.next,w=d.pending;if(w!==null){var T=w.next;w.next=g,f.next=T}d.pending=f}vs=null}return o}function ty(o,a){do{var d=vt;try{if(Mf(),qu.current=Zu,Yu){for(var f=ot.memoizedState;f!==null;){var g=f.queue;g!==null&&(g.pending=null),f=f.next}Yu=!1}if(Ss=0,bt=_t=ot=null,Qa=!1,qa=0,yp.current=null,d===null||d.return===null){Ct=1,rl=a,vt=null;break}e:{var w=o,T=d.return,M=d,G=a;if(a=Ut,M.flags|=32768,G!==null&&typeof G=="object"&&typeof G.then=="function"){var ee=G,ue=M,ve=ue.tag;if(!(ue.mode&1)&&(ve===0||ve===11||ve===15)){var se=ue.alternate;se?(ue.updateQueue=se.updateQueue,ue.memoizedState=se.memoizedState,ue.lanes=se.lanes):(ue.updateQueue=null,ue.memoizedState=null)}var Ye=P2(T);if(Ye!==null){Ye.flags&=-257,N2(Ye,T,M,w,a),Ye.mode&1&&E2(w,ee,a),a=Ye,G=ee;var Be=a.updateQueue;if(Be===null){var gn=new Set;gn.add(G),a.updateQueue=gn}else Be.add(G);break e}else{if(!(a&1)){E2(w,ee,a),Pp();break e}G=Error(l(426))}}else if(Ze&&M.mode&1){var Wr=P2(T);if(Wr!==null){!(Wr.flags&65536)&&(Wr.flags|=256),N2(Wr,T,M,w,a),Ff(Po(G,M));break e}}w=G=Po(G,M),Ct!==4&&(Ct=2),il===null?il=[w]:il.push(w),w=T;do{switch(w.tag){case 3:w.flags|=65536,a&=-a,w.lanes|=a;var U=C2(w,G,a);Ym(w,U);break e;case 1:M=G;var j=w.type,K=w.stateNode;if(!(w.flags&128)&&(typeof j.getDerivedStateFromError=="function"||K!==null&&typeof K.componentDidCatch=="function"&&(wi===null||!wi.has(K)))){w.flags|=65536,a&=-a,w.lanes|=a;var oe=k2(w,M,a);Ym(w,oe);break e}}w=w.return}while(w!==null)}iy(d)}catch(fe){a=fe,vt===d&&d!==null&&(vt=d=d.return);continue}break}while(!0)}function ny(){var o=hc.current;return hc.current=Zu,o===null?Zu:o}function Pp(){(Ct===0||Ct===3||Ct===2)&&(Ct=4),Lt===null||!(xs&268435455)&&!(fc&268435455)||ki(Lt,Ut)}function Sc(o,a){var d=Ee;Ee|=2;var f=ny();(Lt!==o||Ut!==a)&&(Vr=null,ws(o,a));do try{l9();break}catch(g){ty(o,g)}while(!0);if(Mf(),Ee=d,hc.current=f,vt!==null)throw Error(l(261));return Lt=null,Ut=0,Ct}function l9(){for(;vt!==null;)ry(vt)}function u9(){for(;vt!==null&&!Mx();)ry(vt)}function ry(o){var a=ay(o.alternate,o,Pn);o.memoizedProps=o.pendingProps,a===null?iy(o):vt=a,yp.current=null}function iy(o){var a=o;do{var d=a.alternate;if(o=a.return,a.flags&32768){if(d=n9(d,a),d!==null){d.flags&=32767,vt=d;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{Ct=6,vt=null;return}}else if(d=t9(d,a,Pn),d!==null){vt=d;return}if(a=a.sibling,a!==null){vt=a;return}vt=a=o}while(a!==null);Ct===0&&(Ct=5)}function _s(o,a,d){var f=Le,g=gt.transition;try{gt.transition=null,Le=1,c9(o,a,d,f)}finally{gt.transition=g,Le=f}return null}function c9(o,a,d,f){do Cs();while(_i!==null);if(Ee&6)throw Error(l(327));d=o.finishedWork;var g=o.finishedLanes;if(d===null)return null;if(o.finishedWork=null,o.finishedLanes=0,d===o.current)throw Error(l(177));o.callbackNode=null,o.callbackPriority=0;var w=d.lanes|d.childLanes;if(Ax(o,w),o===Lt&&(vt=Lt=null,Ut=0),!(d.subtreeFlags&2064)&&!(d.flags&2064)||gc||(gc=!0,ly(Nf,function(){return Cs(),null})),w=(d.flags&15990)!==0,d.subtreeFlags&15990||w){w=gt.transition,gt.transition=null;var T=Le;Le=1;var M=Ee;Ee|=4,yp.current=null,i9(o,d),K2(d,o),Z(o.containerInfo),o.current=d,s9(d),Ix(),Ee=M,Le=T,gt.transition=w}else o.current=d;if(gc&&(gc=!1,_i=o,mc=g),w=o.pendingLanes,w===0&&(wi=null),Ux(d.stateNode),pn(o,Ot()),a!==null)for(f=o.onRecoverableError,d=0;d<a.length;d++)g=a[d],f(g.value,{componentStack:g.stack,digest:g.digest});if(pc)throw pc=!1,o=wp,wp=null,o;return mc&1&&o.tag!==0&&Cs(),w=o.pendingLanes,w&1?o===_p?sl++:(sl=0,_p=o):sl=0,xr(),null}function Cs(){if(_i!==null){var o=Im(mc),a=gt.transition,d=Le;try{if(gt.transition=null,Le=16>o?16:o,_i===null)var f=!1;else{if(o=_i,_i=null,mc=0,Ee&6)throw Error(l(331));var g=Ee;for(Ee|=4,ae=o.current;ae!==null;){var w=ae,T=w.child;if(ae.flags&16){var M=w.deletions;if(M!==null){for(var G=0;G<M.length;G++){var ee=M[G];for(ae=ee;ae!==null;){var ue=ae;switch(ue.tag){case 0:case 11:case 15:tl(8,ue,w)}var ve=ue.child;if(ve!==null)ve.return=ue,ae=ve;else for(;ae!==null;){ue=ae;var se=ue.sibling,Ye=ue.return;if(G2(ue),ue===ee){ae=null;break}if(se!==null){se.return=Ye,ae=se;break}ae=Ye}}}var Be=w.alternate;if(Be!==null){var gn=Be.child;if(gn!==null){Be.child=null;do{var Wr=gn.sibling;gn.sibling=null,gn=Wr}while(gn!==null)}}ae=w}}if(w.subtreeFlags&2064&&T!==null)T.return=w,ae=T;else e:for(;ae!==null;){if(w=ae,w.flags&2048)switch(w.tag){case 0:case 11:case 15:tl(9,w,w.return)}var U=w.sibling;if(U!==null){U.return=w.return,ae=U;break e}ae=w.return}}var j=o.current;for(ae=j;ae!==null;){T=ae;var K=T.child;if(T.subtreeFlags&2064&&K!==null)K.return=T,ae=K;else e:for(T=j;ae!==null;){if(M=ae,M.flags&2048)try{switch(M.tag){case 0:case 11:case 15:oc(9,M)}}catch(fe){et(M,M.return,fe)}if(M===T){ae=null;break e}var oe=M.sibling;if(oe!==null){oe.return=M.return,ae=oe;break e}ae=M.return}}if(Ee=g,xr(),Sr&&typeof Sr.onPostCommitFiberRoot=="function")try{Sr.onPostCommitFiberRoot(Du,o)}catch{}f=!0}return f}finally{Le=d,gt.transition=a}}return!1}function sy(o,a,d){a=Po(d,a),a=C2(o,a,1),o=xi(o,a,1),a=$t(),o!==null&&(Ha(o,1,a),pn(o,a))}function et(o,a,d){if(o.tag===3)sy(o,o,d);else for(;a!==null;){if(a.tag===3){sy(a,o,d);break}else if(a.tag===1){var f=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(wi===null||!wi.has(f))){o=Po(d,o),o=k2(a,o,1),a=xi(a,o,1),o=$t(),a!==null&&(Ha(a,1,o),pn(a,o));break}}a=a.return}}function d9(o,a,d){var f=o.pingCache;f!==null&&f.delete(a),a=$t(),o.pingedLanes|=o.suspendedLanes&d,Lt===o&&(Ut&d)===d&&(Ct===4||Ct===3&&(Ut&130023424)===Ut&&500>Ot()-Sp?ws(o,0):vp|=d),pn(o,a)}function oy(o,a){a===0&&(o.mode&1?(a=Mu,Mu<<=1,!(Mu&130023424)&&(Mu=4194304)):a=1);var d=$t();o=wr(o,a),o!==null&&(Ha(o,a,d),pn(o,d))}function h9(o){var a=o.memoizedState,d=0;a!==null&&(d=a.retryLane),oy(o,d)}function f9(o,a){var d=0;switch(o.tag){case 13:var f=o.stateNode,g=o.memoizedState;g!==null&&(d=g.retryLane);break;case 19:f=o.stateNode;break;default:throw Error(l(314))}f!==null&&f.delete(a),oy(o,d)}var ay;ay=function(o,a,d){if(o!==null)if(o.memoizedProps!==a.pendingProps||cn.current)hn=!0;else{if(!(o.lanes&d)&&!(a.flags&128))return hn=!1,e9(o,a,d);hn=!!(o.flags&131072)}else hn=!1,Ze&&a.flags&1048576&&Um(a,zu,a.index);switch(a.lanes=0,a.tag){case 2:var f=a.type;nc(o,a),o=a.pendingProps;var g=yo(a,Ht.current);Co(a,d),g=Kf(null,a,f,o,g,d);var w=$f();return a.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,dn(f)?(w=!0,Fu(a)):w=!1,a.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Uf(a),g.updater=ec,a.stateNode=g,g._reactInternals=a,Zf(a,f,o,d),a=rp(null,a,f,!0,w,d)):(a.tag=0,Ze&&w&&Tf(a),tn(null,a,g,d),a=a.child),a;case 16:f=a.elementType;e:{switch(nc(o,a),o=a.pendingProps,g=f._init,f=g(f._payload),a.type=f,g=a.tag=g9(f),o=rr(f,o),g){case 0:a=np(null,a,f,o,d);break e;case 1:a=F2(null,a,f,o,d);break e;case 11:a=R2(null,a,f,o,d);break e;case 14:a=T2(null,a,f,rr(f.type,o),d);break e}throw Error(l(306,f,""))}return a;case 0:return f=a.type,g=a.pendingProps,g=a.elementType===f?g:rr(f,g),np(o,a,f,g,d);case 1:return f=a.type,g=a.pendingProps,g=a.elementType===f?g:rr(f,g),F2(o,a,f,g,d);case 3:e:{if(A2(a),o===null)throw Error(l(387));f=a.pendingProps,w=a.memoizedState,g=w.element,qm(o,a),$u(a,f,null,d);var T=a.memoizedState;if(f=T.element,Qe&&w.isDehydrated)if(w={element:f,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},a.updateQueue.baseState=w,a.memoizedState=w,a.flags&256){g=Po(Error(l(423)),a),a=M2(o,a,f,d,g);break e}else if(f!==g){g=Po(Error(l(424)),a),a=M2(o,a,f,d,g);break e}else for(Qe&&(Dn=gx(a.stateNode.containerInfo),En=a,Ze=!0,nr=null,Va=!1),d=Km(a,null,f,d),a.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(xo(),f===g){a=Hr(o,a,d);break e}tn(o,a,f,d)}a=a.child}return a;case 5:return Jm(a),o===null&&Lf(a),f=a.type,g=a.pendingProps,w=o!==null?o.memoizedProps:null,T=g.children,it(f,g)?T=null:w!==null&&it(f,w)&&(a.flags|=32),L2(o,a),tn(o,a,T,d),a.child;case 6:return o===null&&Lf(a),null;case 13:return I2(o,a,d);case 4:return zf(a,a.stateNode.containerInfo),f=a.pendingProps,o===null?a.child=wo(a,null,f,d):tn(o,a,f,d),a.child;case 11:return f=a.type,g=a.pendingProps,g=a.elementType===f?g:rr(f,g),R2(o,a,f,g,d);case 7:return tn(o,a,a.pendingProps,d),a.child;case 8:return tn(o,a,a.pendingProps.children,d),a.child;case 12:return tn(o,a,a.pendingProps.children,d),a.child;case 10:e:{if(f=a.type._context,g=a.pendingProps,w=a.memoizedProps,T=g.value,$m(a,f,T),w!==null)if(tr(w.value,T)){if(w.children===g.children&&!cn.current){a=Hr(o,a,d);break e}}else for(w=a.child,w!==null&&(w.return=a);w!==null;){var M=w.dependencies;if(M!==null){T=w.child;for(var G=M.firstContext;G!==null;){if(G.context===f){if(w.tag===1){G=Gr(-1,d&-d),G.tag=2;var ee=w.updateQueue;if(ee!==null){ee=ee.shared;var ue=ee.pending;ue===null?G.next=G:(G.next=ue.next,ue.next=G),ee.pending=G}}w.lanes|=d,G=w.alternate,G!==null&&(G.lanes|=d),Df(w.return,d,a),M.lanes|=d;break}G=G.next}}else if(w.tag===10)T=w.type===a.type?null:w.child;else if(w.tag===18){if(T=w.return,T===null)throw Error(l(341));T.lanes|=d,M=T.alternate,M!==null&&(M.lanes|=d),Df(T,d,a),T=w.sibling}else T=w.child;if(T!==null)T.return=w;else for(T=w;T!==null;){if(T===a){T=null;break}if(w=T.sibling,w!==null){w.return=T.return,T=w;break}T=T.return}w=T}tn(o,a,g.children,d),a=a.child}return a;case 9:return g=a.type,f=a.pendingProps.children,Co(a,d),g=jn(g),f=f(g),a.flags|=1,tn(o,a,f,d),a.child;case 14:return f=a.type,g=rr(f,a.pendingProps),g=rr(f.type,g),T2(o,a,f,g,d);case 15:return O2(o,a,a.type,a.pendingProps,d);case 17:return f=a.type,g=a.pendingProps,g=a.elementType===f?g:rr(f,g),nc(o,a),a.tag=1,dn(f)?(o=!0,Fu(a)):o=!1,Co(a,d),w2(a,f,g),Zf(a,f,g,d),rp(null,a,f,!0,o,d);case 19:return j2(o,a,d);case 22:return b2(o,a,d)}throw Error(l(156,a.tag))};function ly(o,a){return Ef(o,a)}function p9(o,a,d,f){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gn(o,a,d,f){return new p9(o,a,d,f)}function Np(o){return o=o.prototype,!(!o||!o.isReactComponent)}function g9(o){if(typeof o=="function")return Np(o)?1:0;if(o!=null){if(o=o.$$typeof,o===C)return 11;if(o===k)return 14}return 2}function Ei(o,a){var d=o.alternate;return d===null?(d=Gn(o.tag,a,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=a,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&14680064,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,a=o.dependencies,d.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d}function xc(o,a,d,f,g,w){var T=2;if(f=o,typeof o=="function")Np(o)&&(T=1);else if(typeof o=="string")T=5;else e:switch(o){case p:return ks(d.children,g,w,a);case y:T=8,g|=8;break;case S:return o=Gn(12,d,a,g|2),o.elementType=S,o.lanes=w,o;case P:return o=Gn(13,d,a,g),o.elementType=P,o.lanes=w,o;case E:return o=Gn(19,d,a,g),o.elementType=E,o.lanes=w,o;case _:return wc(d,g,w,a);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case x:T=10;break e;case m:T=9;break e;case C:T=11;break e;case k:T=14;break e;case v:T=16,f=null;break e}throw Error(l(130,o==null?o:typeof o,""))}return a=Gn(T,d,a,g),a.elementType=o,a.type=f,a.lanes=w,a}function ks(o,a,d,f){return o=Gn(7,o,f,a),o.lanes=d,o}function wc(o,a,d,f){return o=Gn(22,o,f,a),o.elementType=_,o.lanes=d,o.stateNode={isHidden:!1},o}function Rp(o,a,d){return o=Gn(6,o,null,a),o.lanes=d,o}function Tp(o,a,d){return a=Gn(4,o.children!==null?o.children:[],o.key,a),a.lanes=d,a.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},a}function m9(o,a,d,f,g){this.tag=a,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ce,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Cf(0),this.expirationTimes=Cf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Cf(0),this.identifierPrefix=f,this.onRecoverableError=g,Qe&&(this.mutableSourceEagerHydrationData=null)}function uy(o,a,d,f,g,w,T,M,G){return o=new m9(o,a,d,M,G),a===1?(a=1,w===!0&&(a|=8)):a=0,w=Gn(3,null,null,a),o.current=w,w.stateNode=o,w.memoizedState={element:f,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},Uf(w),o}function cy(o){if(!o)return vi;o=o._reactInternals;e:{if(I(o)!==o||o.tag!==1)throw Error(l(170));var a=o;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(dn(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(l(171))}if(o.tag===1){var d=o.type;if(dn(d))return Fm(o,d,a)}return a}function dy(o){var a=o._reactInternals;if(a===void 0)throw typeof o.render=="function"?Error(l(188)):(o=Object.keys(o).join(","),Error(l(268,o)));return o=B(a),o===null?null:o.stateNode}function hy(o,a){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<a?d:a}}function _c(o,a){hy(o,a),(o=o.alternate)&&hy(o,a)}function y9(o){return o=B(o),o===null?null:o.stateNode}function v9(){return null}return n.attemptContinuousHydration=function(o){if(o.tag===13){var a=wr(o,134217728);if(a!==null){var d=$t();Bn(a,o,134217728,d)}_c(o,134217728)}},n.attemptDiscreteHydration=function(o){if(o.tag===13){var a=wr(o,1);if(a!==null){var d=$t();Bn(a,o,1,d)}_c(o,1)}},n.attemptHydrationAtCurrentPriority=function(o){if(o.tag===13){var a=Ci(o),d=wr(o,a);if(d!==null){var f=$t();Bn(d,o,a,f)}_c(o,a)}},n.attemptSynchronousHydration=function(o){switch(o.tag){case 3:var a=o.stateNode;if(a.current.memoizedState.isDehydrated){var d=Ga(a.pendingLanes);d!==0&&(kf(a,d|1),pn(a,Ot()),!(Ee&6)&&(To(),xr()))}break;case 13:ey(function(){var f=wr(o,1);if(f!==null){var g=$t();Bn(f,o,1,g)}}),_c(o,1)}},n.batchedUpdates=function(o,a){var d=Ee;Ee|=1;try{return o(a)}finally{Ee=d,Ee===0&&(To(),ju&&xr())}},n.createComponentSelector=function(o){return{$$typeof:ac,value:o}},n.createContainer=function(o,a,d,f,g,w,T){return uy(o,a,!1,null,d,f,g,w,T)},n.createHasPseudoClassSelector=function(o){return{$$typeof:lc,value:o}},n.createHydrationContainer=function(o,a,d,f,g,w,T,M,G){return o=uy(d,f,!0,o,g,w,T,M,G),o.context=cy(null),d=o.current,f=$t(),g=Ci(d),w=Gr(f,g),w.callback=a??null,xi(d,w,g),o.current.lanes=g,Ha(o,g,f),pn(o,f),o},n.createPortal=function(o,a,d){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:f==null?null:""+f,children:o,containerInfo:a,implementation:d}},n.createRoleSelector=function(o){return{$$typeof:uc,value:o}},n.createTestNameSelector=function(o){return{$$typeof:cc,value:o}},n.createTextSelector=function(o){return{$$typeof:dc,value:o}},n.deferredUpdates=function(o){var a=Le,d=gt.transition;try{return gt.transition=null,Le=16,o()}finally{Le=a,gt.transition=d}},n.discreteUpdates=function(o,a,d,f,g){var w=Le,T=gt.transition;try{return gt.transition=null,Le=1,o(a,d,f,g)}finally{Le=w,gt.transition=T,Ee===0&&To()}},n.findAllNodes=mp,n.findBoundingRects=function(o,a){if(!Ua)throw Error(l(363));a=mp(o,a),o=[];for(var d=0;d<a.length;d++)o.push(GS(a[d]));for(a=o.length-1;0<a;a--){d=o[a];for(var f=d.x,g=f+d.width,w=d.y,T=w+d.height,M=a-1;0<=M;M--)if(a!==M){var G=o[M],ee=G.x,ue=ee+G.width,ve=G.y,se=ve+G.height;if(f>=ee&&w>=ve&&g<=ue&&T<=se){o.splice(a,1);break}else if(f!==ee||d.width!==G.width||se<w||ve>T){if(!(w!==ve||d.height!==G.height||ue<f||ee>g)){ee>f&&(G.width+=ee-f,G.x=f),ue<g&&(G.width=g-ee),o.splice(a,1);break}}else{ve>w&&(G.height+=ve-w,G.y=w),se<T&&(G.height=T-ve),o.splice(a,1);break}}}return o},n.findHostInstance=dy,n.findHostInstanceWithNoPortals=function(o){return o=H(o),o=o!==null?q(o):null,o===null?null:o.stateNode},n.findHostInstanceWithWarning=function(o){return dy(o)},n.flushControlled=function(o){var a=Ee;Ee|=1;var d=gt.transition,f=Le;try{gt.transition=null,Le=1,o()}finally{Le=f,gt.transition=d,Ee=a,Ee===0&&(To(),xr())}},n.flushPassiveEffects=Cs,n.flushSync=ey,n.focusWithin=function(o,a){if(!Ua)throw Error(l(363));for(o=fp(o),a=X2(o,a),a=Array.from(a),o=0;o<a.length;){var d=a[o++];if(!za(d)){if(d.tag===5&&WS(d.stateNode))return!0;for(d=d.child;d!==null;)a.push(d),d=d.sibling}}return!1},n.getCurrentUpdatePriority=function(){return Le},n.getFindAllNodesFailureDescription=function(o,a){if(!Ua)throw Error(l(363));var d=0,f=[];o=[fp(o),0];for(var g=0;g<o.length;){var w=o[g++],T=o[g++],M=a[T];if((w.tag!==5||!za(w))&&(pp(w,M)&&(f.push(gp(M)),T++,T>d&&(d=T)),T<a.length))for(w=w.child;w!==null;)o.push(w,T),w=w.sibling}if(d<a.length){for(o=[];d<a.length;d++)o.push(gp(a[d]));return`findAllNodes was able to match part of the selector:
`+(f.join(" > ")+`
No matching component was found for:
`)+o.join(" > ")}return null},n.getPublicRootInstance=function(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return re(o.child.stateNode);default:return o.child.stateNode}},n.injectIntoDevTools=function(o){if(o={bundleType:o.bundleType,version:o.version,rendererPackageName:o.rendererPackageName,rendererConfig:o.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:u.ReactCurrentDispatcher,findHostInstanceByFiber:y9,findFiberByHostInstance:o.findFiberByHostInstance||v9,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")o=!1;else{var a=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a.isDisabled||!a.supportsFiber)o=!0;else{try{Du=a.inject(o),Sr=a}catch{}o=!!a.checkDCE}}return o},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(o,a,d,f){if(!Ua)throw Error(l(363));o=mp(o,a);var g=KS(o,d,f).disconnect;return{disconnect:function(){g()}}},n.registerMutableSourceForHydration=function(o,a){var d=a._getVersion;d=d(a._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[a,d]:o.mutableSourceEagerHydrationData.push(a,d)},n.runWithPriority=function(o,a){var d=Le;try{return Le=o,a()}finally{Le=d}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(o,a,d,f){var g=a.current,w=$t(),T=Ci(g);return d=cy(d),a.context===null?a.context=d:a.pendingContext=d,a=Gr(w,T),a.payload={element:o},f=f===void 0?null:f,f!==null&&(a.callback=f),o=xi(g,a,T),o!==null&&(Bn(o,g,T,w),Ku(o,g,T)),T},n};RS.exports=bO;var LO=RS.exports;const FO=Yd(LO);var TS={exports:{}},go={};/**
* @license React
* react-reconciler-constants.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/go.ConcurrentRoot=1;go.ContinuousEventPriority=4;go.DefaultEventPriority=16;go.DiscreteEventPriority=1;go.IdleEventPriority=536870912;go.LegacyRoot=0;TS.exports=go;var OS=TS.exports;const n3={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let r3=!1,i3=!1;const km=".react-konva-event",AO=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
Position of a node will be changed during drag&drop, so you should update state of the react app as well.
Consider to add onDragMove or onDragEnd events.
For more info see: https://github.com/konvajs/react-konva/issues/256
`,MO=`ReactKonva: You are using "zIndex" attribute for a Konva node.
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
For more info see: https://github.com/konvajs/react-konva/issues/194
`,IO={};function ff(t,e,n=IO){if(!r3&&"zIndex"in e&&(console.warn(MO),r3=!0),!i3&&e.draggable){var r=e.x!==void 0||e.y!==void 0,i=e.onDragEnd||e.onDragMove;r&&!i&&(console.warn(AO),i3=!0)}for(var s in n)if(!n3[s]){var l=s.slice(0,2)==="on",u=n[s]!==e[s];if(l&&u){var c=s.substr(2).toLowerCase();c.substr(0,7)==="content"&&(c="content"+c.substr(7,1).toUpperCase()+c.substr(8)),t.off(c,n[s])}var h=!e.hasOwnProperty(s);h&&t.setAttr(s,void 0)}var p=e._useStrictMode,y={},S=!1;const x={};for(var s in e)if(!n3[s]){var l=s.slice(0,2)==="on",m=n[s]!==e[s];if(l&&m){var c=s.substr(2).toLowerCase();c.substr(0,7)==="content"&&(c="content"+c.substr(7,1).toUpperCase()+c.substr(8)),e[s]&&(x[c]=e[s])}!l&&(e[s]!==n[s]||p&&e[s]!==t.getAttr(s))&&(S=!0,y[s]=e[s])}S&&(t.setAttrs(y),ps(t));for(var c in x)t.on(c+km,x[c])}function ps(t){if(!ke.Konva.autoDrawEnabled){var e=t.getLayer()||t.getStage();e&&e.batchDraw()}}const bS={},DO={};lu.Node.prototype._applyProps=ff;function jO(t,e){if(typeof e=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${e}`);return}t.add(e),ps(t)}function UO(t,e,n){let r=lu[t];r||(console.error(`Konva has no node with the type ${t}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${t}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=lu.Group);const i={},s={};for(var l in e){var u=l.slice(0,2)==="on";u?s[l]=e[l]:i[l]=e[l]}const c=new r(i);return ff(c,s),c}function zO(t,e,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${t}"`)}function BO(t,e,n){return!1}function GO(t){return t}function HO(){return null}function VO(){return null}function WO(t,e,n,r){return DO}function KO(){}function $O(t){}function QO(t,e){return!1}function qO(){return bS}function YO(){return bS}const XO=setTimeout,JO=clearTimeout,ZO=-1;function eb(t,e){return!1}const tb=!1,nb=!0,rb=!0;function ib(t,e){e.parent===t?e.moveToTop():t.add(e),ps(t)}function sb(t,e){e.parent===t?e.moveToTop():t.add(e),ps(t)}function LS(t,e,n){e._remove(),t.add(e),e.setZIndex(n.getZIndex()),ps(t)}function ob(t,e,n){LS(t,e,n)}function ab(t,e){e.destroy(),e.off(km),ps(t)}function lb(t,e){e.destroy(),e.off(km),ps(t)}function ub(t,e,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function cb(t,e,n){}function db(t,e,n,r,i){ff(t,i,r)}function hb(t){t.hide(),ps(t)}function fb(t){}function pb(t,e){(e.visible==null||e.visible)&&t.show()}function gb(t,e){}function mb(t){}function yb(){}const vb=()=>OS.DefaultEventPriority,Sb=Object.freeze(Object.defineProperty({__proto__:null,appendChild:ib,appendChildToContainer:sb,appendInitialChild:jO,cancelTimeout:JO,clearContainer:mb,commitMount:cb,commitTextUpdate:ub,commitUpdate:db,createInstance:UO,createTextInstance:zO,detachDeletedInstance:yb,finalizeInitialChildren:BO,getChildHostContext:YO,getCurrentEventPriority:vb,getPublicInstance:GO,getRootHostContext:qO,hideInstance:hb,hideTextInstance:fb,idlePriority:Pl.unstable_IdlePriority,insertBefore:LS,insertInContainerBefore:ob,isPrimaryRenderer:tb,noTimeout:ZO,now:Pl.unstable_now,prepareForCommit:HO,preparePortalMount:VO,prepareUpdate:WO,removeChild:ab,removeChildFromContainer:lb,resetAfterCommit:KO,resetTextContent:$O,run:Pl.unstable_runWithPriority,scheduleTimeout:XO,shouldDeprioritizeSubtree:QO,shouldSetTextContent:eb,supportsMutation:rb,unhideInstance:pb,unhideTextInstance:gb,warnsIfNotActing:nb},Symbol.toStringTag,{value:"Module"}));var xb=Object.defineProperty,wb=Object.defineProperties,_b=Object.getOwnPropertyDescriptors,s3=Object.getOwnPropertySymbols,Cb=Object.prototype.hasOwnProperty,kb=Object.prototype.propertyIsEnumerable,o3=(t,e,n)=>e in t?xb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,a3=(t,e)=>{for(var n in e||(e={}))Cb.call(e,n)&&o3(t,n,e[n]);if(s3)for(var n of s3(e))kb.call(e,n)&&o3(t,n,e[n]);return t},Eb=(t,e)=>wb(t,_b(e)),l3,u3;typeof window<"u"&&((l3=window.document)!=null&&l3.createElement||((u3=window.navigator)==null?void 0:u3.product)==="ReactNative")?V.useLayoutEffect:V.useEffect;function FS(t,e,n){if(!t)return;if(n(t)===!0)return t;let r=t.child;for(;r;){const i=FS(r,e,n);if(i)return i;r=r.sibling}}function AS(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const c3=console.error;console.error=function(){const t=[...arguments].join("");if(t!=null&&t.startsWith("Warning:")&&t.includes("useContext")){console.error=c3;return}return c3.apply(this,arguments)};const Em=AS(V.createContext(null));class MS extends V.Component{render(){return V.createElement(Em.Provider,{value:this._reactInternals},this.props.children)}}function Pb(){const t=V.useContext(Em);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=V.useId();return V.useMemo(()=>{for(const r of[t,t==null?void 0:t.alternate]){if(!r)continue;const i=FS(r,!1,s=>{let l=s.memoizedState;for(;l;){if(l.memoizedState===e)return!0;l=l.next}});if(i)return i}},[t,e])}function Nb(){const t=Pb(),[e]=V.useState(()=>new Map);e.clear();let n=t;for(;n;){if(n.type&&typeof n.type=="object"){const i=n.type._context===void 0&&n.type.Provider===n.type?n.type:n.type._context;i&&i!==Em&&!e.has(i)&&e.set(i,V.useContext(AS(i)))}n=n.return}return e}function Rb(){const t=Nb();return V.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>r=>V.createElement(e,null,V.createElement(n.Provider,Eb(a3({},r),{value:t.get(n)}))),e=>V.createElement(MS,a3({},e))),[t])}function Tb(t){const e=Mt.useRef({});return Mt.useLayoutEffect(()=>{e.current=t}),Mt.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const Ob=t=>{const e=Mt.useRef(null),n=Mt.useRef(null),r=Mt.useRef(null),i=Tb(t),s=Rb(),l=u=>{const{forwardedRef:c}=t;c&&(typeof c=="function"?c(u):c.current=u)};return Mt.useLayoutEffect(()=>(n.current=new lu.Stage({width:t.width,height:t.height,container:e.current}),l(n.current),r.current=El.createContainer(n.current,OS.LegacyRoot,!1,null),El.updateContainer(Mt.createElement(s,{},t.children),r.current),()=>{lu.isBrowser&&(l(null),El.updateContainer(null,r.current,null),n.current.destroy())}),[]),Mt.useLayoutEffect(()=>{l(n.current),ff(n.current,t,i),El.updateContainer(Mt.createElement(s,{},t.children),r.current,null)}),Mt.createElement("div",{ref:e,id:t.id,accessKey:t.accessKey,className:t.className,role:t.role,style:t.style,tabIndex:t.tabIndex,title:t.title})},bb="Layer",Lb="Rect",Fb="Image",Ab="Text",Mb="Transformer",El=FO(Sb);El.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:Mt.version,rendererPackageName:"react-konva"});const Ib=Mt.forwardRef((t,e)=>Mt.createElement(MS,{},Mt.createElement(Ob,{...t,forwardedRef:e}))),IS=rm(t=>({covers:[],activeCover:null,selectedLayer:null,addCover:e=>t(n=>({covers:[e,...n.covers],activeCover:e})),updateCover:(e,n)=>t(r=>{var i;return{covers:r.covers.map(s=>s.id===e?{...s,...n,updatedAt:new Date}:s),activeCover:((i=r.activeCover)==null?void 0:i.id)===e?{...r.activeCover,...n,updatedAt:new Date}:r.activeCover}}),deleteCover:e=>t(n=>{var r;return{covers:n.covers.filter(i=>i.id!==e),activeCover:((r=n.activeCover)==null?void 0:r.id)===e?null:n.activeCover}}),setActiveCover:e=>t({activeCover:e,selectedLayer:null}),setSelectedLayer:e=>t({selectedLayer:e}),addLayer:e=>t(n=>{if(!n.activeCover)return n;const r={...n.activeCover,layers:[...n.activeCover.layers,e],updatedAt:new Date};return{activeCover:r,covers:n.covers.map(i=>i.id===n.activeCover.id?r:i)}}),updateLayer:(e,n)=>t(r=>{if(!r.activeCover)return r;const i={...r.activeCover,layers:r.activeCover.layers.map(s=>s.id===e?{...s,...n}:s),updatedAt:new Date};return{activeCover:i,covers:r.covers.map(s=>s.id===r.activeCover.id?i:s)}}),deleteLayer:e=>t(n=>{if(!n.activeCover)return n;const r={...n.activeCover,layers:n.activeCover.layers.filter(i=>i.id!==e),updatedAt:new Date};return{activeCover:r,covers:n.covers.map(i=>i.id===n.activeCover.id?r:i),selectedLayer:n.selectedLayer===e?null:n.selectedLayer}})})),Db=({url:t,width:e,height:n})=>{const[r,i]=V.useState(null);return V.useEffect(()=>{const s=new window.Image;s.crossOrigin="Anonymous",s.src=t,s.onload=()=>{i(s)}},[t]),r?N.jsx(Fb,{image:r,x:0,y:0,width:e,height:n}):null},d3=[{name:"Roboto",label:"Modern (Roboto)"},{name:"Montserrat",label:"Minimalist (Montserrat)"},{name:"Playfair Display",label:"Elegant (Playfair Display)"},{name:"Bebas Neue",label:"Bold (Bebas Neue)"},{name:"Pacifico",label:"Playful (Pacifico)"},{name:"Georgia",label:"Classic (Georgia)"},{name:"Arial",label:"Standard (Arial)"}];function jb(){var v,_;const{activeCover:t,addLayer:e,updateLayer:n,deleteLayer:r,selectedLayer:i,setSelectedLayer:s}=IS(),l=V.useRef(null),[u,c]=V.useState(.5),[h,p]=V.useState("title"),[y,S]=V.useState(""),[x,m]=V.useState("Roboto");if(!t)return N.jsx("div",{className:"card text-center py-12",children:N.jsx("p",{className:"text-gray-500",children:"Select a cover from the gallery to edit"})});const C=()=>{if(!y.trim())return;const R={id:`text-${Date.now()}`,type:"text",x:t.width/2,y:t.height/2,content:y,fontSize:h==="title"?72:36,fontFamily:x,fill:h==="title"?"#ffffff":"#f0f0f0",rotation:0,opacity:1};e(R),S("")},P=()=>{const R=l.current;if(R){const b=R.toDataURL({pixelRatio:2}),A=document.createElement("a");A.download=`${t.title.replace(/\s+/g,"-")}-cover.png`,A.href=b,A.click()}},E=800,k=t.height/t.width*E;return N.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[N.jsxs("div",{className:"lg:col-span-3 card p-4 bg-gray-100",children:[N.jsxs("div",{className:"flex items-center justify-between mb-4",children:[N.jsxs("h3",{className:"font-semibold text-gray-900",children:["Editing: ",t.title]}),N.jsx("div",{className:"flex items-center gap-2",children:N.jsxs("button",{onClick:P,className:"btn-primary flex items-center gap-2",children:[N.jsx(c8,{className:"w-4 h-4"}),"Export"]})})]}),N.jsx("div",{className:"bg-white rounded-lg shadow-sm overflow-hidden flex items-center justify-center p-4",children:N.jsx(Ib,{ref:l,width:E,height:k,scaleX:u,scaleY:u,children:N.jsxs(bb,{children:[N.jsx(Lb,{x:0,y:0,width:t.width,height:t.height,fill:t.backgroundColor}),t.backgroundImage&&N.jsx(Db,{url:t.backgroundImage,width:t.width,height:t.height}),t.layers.map(R=>N.jsx(Ab,{id:R.id,x:R.x,y:R.y,text:R.content,fontSize:R.fontSize,fontFamily:R.fontFamily,fill:R.fill,rotation:R.rotation,opacity:R.opacity,draggable:!0,onClick:()=>s(R.id),onTap:()=>s(R.id)},R.id)),i&&N.jsx(Mb,{nodes:t.layers.filter(R=>R.id===i).map(R=>document.getElementById(R.id))})]})})}),N.jsxs("div",{className:"mt-4 flex items-center justify-center gap-4",children:[N.jsx("button",{onClick:()=>c(Math.max(.2,u-.1)),className:"btn-secondary px-3",children:"-"}),N.jsxs("span",{className:"text-sm text-gray-600",children:[Math.round(u*100),"%"]}),N.jsx("button",{onClick:()=>c(Math.min(1,u+.1)),className:"btn-secondary px-3",children:"+"})]})]}),N.jsxs("div",{className:"space-y-4",children:[N.jsxs("div",{className:"card",children:[N.jsxs("h4",{className:"font-medium text-gray-900 mb-4 flex items-center gap-2",children:[N.jsx(ld,{className:"w-4 h-4"}),"Add Text"]}),N.jsxs("div",{className:"space-y-3",children:[N.jsxs("div",{children:[N.jsx("label",{className:"label",children:"Text Type"}),N.jsxs("div",{className:"flex gap-2",children:[N.jsx("button",{onClick:()=>p("title"),className:`flex-1 py-2 rounded-lg text-sm font-medium transition-colors ${h==="title"?"bg-primary-100 text-primary-700":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:"Title"}),N.jsx("button",{onClick:()=>p("author"),className:`flex-1 py-2 rounded-lg text-sm font-medium transition-colors ${h==="author"?"bg-primary-100 text-primary-700":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:"Author"})]})]}),N.jsxs("div",{children:[N.jsx("label",{className:"label",children:"Font"}),N.jsx("select",{value:x,onChange:R=>m(R.target.value),className:"input",children:d3.map(R=>N.jsx("option",{value:R.name,children:R.label},R.name))})]}),N.jsxs("div",{children:[N.jsx("label",{className:"label",children:"Text Content"}),N.jsx("input",{type:"text",value:y,onChange:R=>S(R.target.value),placeholder:h==="title"?"Book Title":"Author Name",className:"input",onKeyPress:R=>R.key==="Enter"&&C()})]}),N.jsx("button",{onClick:C,disabled:!y.trim(),className:"btn-primary w-full",children:"Add Text Layer"})]})]}),i&&((v=t.layers.find(R=>R.id===i))==null?void 0:v.type)==="text"&&N.jsxs("div",{className:"card",children:[N.jsxs("h4",{className:"font-medium text-gray-900 mb-4 flex items-center gap-2",children:[N.jsx(ld,{className:"w-4 h-4"}),"Edit Selected Text"]}),N.jsx("div",{className:"space-y-3",children:N.jsxs("div",{children:[N.jsx("label",{className:"label",children:"Font"}),N.jsx("select",{value:((_=t.layers.find(R=>R.id===i))==null?void 0:_.fontFamily)||"Roboto",onChange:R=>n(i,{fontFamily:R.target.value}),className:"input",children:d3.map(R=>N.jsx("option",{value:R.name,children:R.label},R.name))})]})})]}),N.jsxs("div",{className:"card",children:[N.jsx("h4",{className:"font-medium text-gray-900 mb-4",children:"Layers"}),t.layers.length===0?N.jsx("p",{className:"text-sm text-gray-500",children:"No layers yet"}):N.jsx("div",{className:"space-y-2",children:t.layers.map((R,b)=>{var A;return N.jsxs("div",{className:`flex items-center justify-between p-2 rounded-lg border cursor-pointer transition-colors ${i===R.id?"border-primary-500 bg-primary-50":"border-gray-200 hover:bg-gray-50"}`,onClick:()=>s(R.id),children:[N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx(ld,{className:"w-4 h-4 text-gray-400"}),N.jsx("span",{className:"text-sm truncate max-w-[150px]",children:((A=R.content)==null?void 0:A.substring(0,20))||`Layer ${b+1}`})]}),N.jsx("button",{onClick:O=>{O.stopPropagation(),r(R.id)},className:"p-1 hover:bg-red-100 rounded",children:N.jsx("svg",{className:"w-4 h-4 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},R.id)})})]}),N.jsxs("div",{className:"card",children:[N.jsx("h4",{className:"font-medium text-gray-900 mb-4",children:"Cover Info"}),N.jsxs("div",{className:"space-y-2 text-sm",children:[N.jsxs("div",{className:"flex justify-between",children:[N.jsx("span",{className:"text-gray-500",children:"Dimensions"}),N.jsxs("span",{className:"text-gray-900",children:[t.width," x ",t.height]})]}),N.jsxs("div",{className:"flex justify-between",children:[N.jsx("span",{className:"text-gray-500",children:"Layers"}),N.jsx("span",{className:"text-gray-900",children:t.layers.length})]})]})]})]})]})}const Tn=nt.create({baseURL:"/api",headers:{"Content-Type":"application/json"}});Tn.interceptors.request.use(t=>{const e=localStorage.getItem("i18nextLng")||"en";return t.data&&typeof t.data=="object"&&!(t.data instanceof FormData)?t.data.language=e:t.data instanceof FormData&&t.data.append("language",e),t.headers["Accept-Language"]=e,t});const C0={getAll:()=>Tn.get("/covers"),upload:t=>{const e=new FormData;return e.append("image",t),Tn.post("/covers/upload",e,{headers:{"Content-Type":"multipart/form-data"}})},delete:t=>Tn.delete(`/covers/${t}`),process:(t,e)=>{const n=new FormData;return n.append("image",t),e&&Object.entries(e).forEach(([r,i])=>{n.append(r,i)}),Tn.post("/covers/process",n,{headers:{"Content-Type":"multipart/form-data"}})},generate:(t,e)=>Tn.post("/covers/generate",{prompt:t,genre:e})},pf={getGenres:()=>Tn.get("/books/genres"),getGenre:t=>Tn.get(`/books/genres/${t}`),generateOutline:(t,e,n)=>Tn.post("/books/outline",{genre:t,idea:e,title:n}),generateChapter:(t,e,n,r)=>Tn.post("/books/chapter",{genre:t,chapterTitle:e,chapterSummary:n,previousContent:r}),expand:(t,e)=>Tn.post("/books/expand",{text:t,instruction:e}),generateCharacters:(t,e)=>Tn.post("/books/characters",{genre:t,storyIdea:e}),generatePlot:(t,e,n)=>Tn.post("/books/plot",{genre:t,currentPlot:e,issue:n})};function Ub(){const[t,e]=V.useState("gallery"),{activeCover:n,setActiveCover:r}=IS(),i=em(),{data:s}=u8({queryKey:["covers"],queryFn:async()=>(await C0.getAll()).data.covers}),l=PC({mutationFn:async h=>(await C0.generate(h)).data,onSuccess:()=>{i.invalidateQueries({queryKey:["covers"]}),e("gallery")}}),u=h=>{l.mutate(h)},c=h=>{const p={id:`cover-${Date.now()}`,title:"New Book",author:"Author Name",backgroundImage:h,backgroundColor:"#ffffff",width:1600,height:2400,layers:[],createdAt:new Date,updatedAt:new Date};r(p),e("editor")};return N.jsxs("div",{className:"space-y-6",children:[N.jsxs("div",{className:"flex items-center justify-between",children:[N.jsxs("div",{children:[N.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Cover Designer"}),N.jsx("p",{className:"text-gray-500 mt-1",children:"Design stunning book covers with AI or manual editing"})]}),N.jsxs("div",{className:"flex bg-white rounded-lg p-1 border border-gray-200",children:[N.jsxs("button",{onClick:()=>e("gallery"),className:`flex items-center gap-2 px-4 py-2 rounded-md transition-colors ${t==="gallery"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,children:[N.jsx(tm,{className:"w-4 h-4"}),"Gallery"]}),N.jsxs("button",{onClick:()=>e("editor"),className:`flex items-center gap-2 px-4 py-2 rounded-md transition-colors ${t==="editor"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,children:[N.jsx(ld,{className:"w-4 h-4"}),"Editor"]}),N.jsxs("button",{onClick:()=>e("ai"),className:`flex items-center gap-2 px-4 py-2 rounded-md transition-colors ${t==="ai"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,children:[N.jsx(eo,{className:"w-4 h-4"}),"AI Generate"]})]})]}),t==="gallery"&&N.jsx(RP,{covers:s||[],onSelect:c,onDelete:h=>{C0.delete(h).then(()=>{i.invalidateQueries({queryKey:["covers"]})})}}),t==="editor"&&n&&N.jsx(jb,{}),t==="ai"&&N.jsx(zb,{onGenerate:u,isGenerating:l.isPending})]})}function zb({onGenerate:t,isGenerating:e}){const[n,r]=V.useState(""),[i,s]=V.useState("modern"),l=[{id:"modern",name:"Modern",icon:""},{id:"minimal",name:"Minimalist",icon:"🎯"},{id:"vintage",name:"Vintage",icon:"📜"},{id:"bold",name:"Bold",icon:"🔥"},{id:"elegant",name:"Elegant",icon:"💎"},{id:"playful",name:"Playful",icon:"🎨"}],u=[{genre:"Mystery",prompt:"A mysterious book cover with dark shadows, silhouette of a detective, foggy street scene, noir atmosphere"},{genre:"Romance",prompt:"A romantic book cover with soft pastel colors, couple silhouette at sunset, dreamy and emotional"},{genre:"Fantasy",prompt:"An epic fantasy book cover with magical elements, dragon, castle in the background, mystical glowing effects"},{genre:"Sci-Fi",prompt:"A futuristic sci-fi book cover with spaceships, neon lights, cyberpunk city, high-tech atmosphere"},{genre:"Self-Help",prompt:"A clean self-help book cover with inspiring imagery, mountain peak or sunrise, professional and motivating"}],c=p=>{r(p)},h=()=>{if(n.trim()){const p=`${n}, ${i} style, professional book cover design, high quality, detailed`;t(p)}};return N.jsx("div",{className:"card space-y-6",children:N.jsxs("div",{children:[N.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"AI Cover Generator"}),N.jsxs("div",{className:"mb-6",children:[N.jsx("label",{className:"label",children:"Select Style"}),N.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 mt-2",children:l.map(p=>N.jsxs("button",{onClick:()=>s(p.id),className:`p-3 rounded-lg border text-center transition-colors ${i===p.id?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-200 hover:border-gray-300"}`,children:[N.jsx("span",{className:"text-xl",children:p.icon}),N.jsx("p",{className:"text-xs mt-1",children:p.name})]},p.id))})]}),N.jsxs("div",{className:"mb-6",children:[N.jsx("label",{className:"label",children:"Describe Your Cover"}),N.jsx("textarea",{value:n,onChange:p=>r(p.target.value),placeholder:"Describe the book cover you want to generate... e.g., 'A mysterious forest with glowing eyes in the darkness'",className:"input min-h-[120px] resize-y"})]}),N.jsxs("div",{className:"mb-6",children:[N.jsx("label",{className:"label",children:"Quick Presets by Genre"}),N.jsx("div",{className:"grid gap-2 mt-2",children:u.map(p=>N.jsxs("button",{onClick:()=>c(p.prompt),className:"text-left px-4 py-2 rounded-lg border border-gray-200 hover:border-primary-300 hover:bg-primary-50 transition-colors",children:[N.jsx("span",{className:"font-medium",children:p.genre}),N.jsx("p",{className:"text-sm text-gray-500 truncate",children:p.prompt})]},p.genre))})]}),N.jsxs("button",{onClick:h,disabled:!n.trim()||e,className:"btn-primary w-full py-3 flex items-center justify-center gap-2",children:[N.jsx(eo,{className:"w-5 h-5"}),e?"Generating...":"Generate Cover"]})]})})}function Bb({genres:t,onSelect:e}){const[n,r]=V.useState(""),[i,s]=V.useState(""),[l,u]=V.useState(""),c=h=>{h.preventDefault(),n&&l.trim()&&e(n,l.trim(),i.trim())};return N.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[N.jsx("div",{className:"lg:col-span-2",children:N.jsxs("div",{className:"card",children:[N.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2",children:[N.jsx(zd,{className:"w-5 h-5"}),"Select Your Genre"]}),N.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:t.map(h=>N.jsxs("button",{onClick:()=>r(h.id),className:`p-4 rounded-xl border-2 text-left transition-all ${n===h.id?"border-primary-500 bg-primary-50 shadow-md":"border-gray-200 hover:border-gray-300 hover:bg-gray-50"}`,children:[N.jsx("span",{className:"text-2xl mb-2 block",children:h.icon}),N.jsx("h4",{className:"font-medium text-gray-900",children:h.name}),N.jsx("p",{className:"text-xs text-gray-500 mt-1 line-clamp-2",children:h.description})]},h.id))})]})}),N.jsx("div",{children:N.jsxs("div",{className:"card sticky top-6",children:[N.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2",children:[N.jsx(d8,{className:"w-5 h-5"}),"Book Details"]}),N.jsxs("form",{onSubmit:c,className:"space-y-4",children:[N.jsxs("div",{children:[N.jsx("label",{className:"label",children:"Book Title (optional)"}),N.jsx("input",{type:"text",value:i,onChange:h=>s(h.target.value),placeholder:"My Amazing Book",className:"input"})]}),N.jsxs("div",{children:[N.jsxs("label",{className:"label",children:["Core Idea ",N.jsx("span",{className:"text-red-500",children:"*"})]}),N.jsx("textarea",{value:l,onChange:h=>u(h.target.value),placeholder:"Describe your book idea... What's the story about? Who are the main characters? What conflict drives the narrative?",className:"input min-h-[150px] resize-y",required:!0})]}),N.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-3",children:N.jsxs("p",{className:"text-xs text-amber-700",children:[N.jsx("strong",{children:"Tip:"})," The more details you provide, the better the AI can generate your outline and content."]})}),N.jsx("button",{type:"submit",disabled:!n||!l.trim(),className:"btn-primary w-full py-3",children:"Generate Outline"})]})]})})]})}const gf=rm(t=>({books:[],activeBook:null,isGenerating:!1,generationProgress:0,addBook:e=>t(n=>({books:[e,...n.books],activeBook:e})),updateBook:(e,n)=>t(r=>{var i;return{books:r.books.map(s=>s.id===e?{...s,...n,updatedAt:new Date}:s),activeBook:((i=r.activeBook)==null?void 0:i.id)===e?{...r.activeBook,...n,updatedAt:new Date}:r.activeBook}}),deleteBook:e=>t(n=>{var r;return{books:n.books.filter(i=>i.id!==e),activeBook:((r=n.activeBook)==null?void 0:r.id)===e?null:n.activeBook}}),setActiveBook:e=>t({activeBook:e}),setOutline:e=>t(n=>{if(!n.activeBook)return n;const r={...n.activeBook,outline:e,updatedAt:new Date};return{activeBook:r,books:n.books.map(i=>i.id===n.activeBook.id?r:i)}}),addCharacter:e=>t(n=>{if(!n.activeBook)return n;const r={...n.activeBook,characters:[...n.activeBook.characters,e],updatedAt:new Date};return{activeBook:r,books:n.books.map(i=>i.id===n.activeBook.id?r:i)}}),updateChapterContent:(e,n)=>t(r=>{if(!r.activeBook||!r.activeBook.outline)return r;const i={...r.activeBook.outline,chapters:r.activeBook.outline.chapters.map(l=>l.number===e?{...l,content:n,isGenerated:!0}:l)},s={...r.activeBook,outline:i,updatedAt:new Date};return{activeBook:s,books:r.books.map(l=>l.id===r.activeBook.id?s:l)}}),setCurrentChapter:e=>t(n=>n.activeBook?{activeBook:{...n.activeBook,currentChapter:e}}:n),setCoverForBook:e=>t(n=>{if(!n.activeBook)return n;const r={...n.activeBook,coverId:e,updatedAt:new Date};return{activeBook:r,books:n.books.map(i=>i.id===n.activeBook.id?r:i)}}),setIsGenerating:e=>t({isGenerating:e}),setGenerationProgress:e=>t({generationProgress:e})}));function Gb({book:t,onComplete:e}){var h;const{activeBook:n}=gf(),[r,i]=V.useState(!1),[s,l]=V.useState(""),u=n==null?void 0:n.outline,c=async()=>{var p,y;i(!0),l("");try{const x=(await pf.generateOutline(t.genre,t.idea,t.title)).data.outline;e(x)}catch(S){l(((y=(p=S.response)==null?void 0:p.data)==null?void 0:y.error)||"Failed to generate outline")}finally{i(!1)}};return N.jsxs("div",{className:"space-y-6",children:[N.jsx("div",{className:"card bg-gradient-to-r from-primary-50 to-accent-50",children:N.jsxs("div",{className:"flex items-start justify-between",children:[N.jsxs("div",{children:[N.jsx("h3",{className:"font-semibold text-gray-900",children:t.title||"Untitled Book"}),N.jsxs("p",{className:"text-sm text-gray-600 mt-1 capitalize",children:["Genre: ",t.genre]}),N.jsx("p",{className:"text-sm text-gray-500 mt-2 line-clamp-2",children:t.idea})]}),!u&&N.jsx("button",{onClick:c,disabled:r,className:"btn-primary flex items-center gap-2",children:r?N.jsxs(N.Fragment,{children:[N.jsx(IC,{className:"w-4 h-4 animate-spin"}),"Generating..."]}):N.jsxs(N.Fragment,{children:[N.jsx(eo,{className:"w-4 h-4"}),"Generate Outline"]})})]})}),s&&N.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:N.jsx("p",{className:"text-red-700",children:s})}),u&&N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[N.jsx(TC,{className:"w-5 h-5 text-green-500"}),N.jsxs("h3",{className:"text-lg font-semibold text-gray-900",children:["Generated Outline: ",u.title||t.title]})]}),u.logline&&N.jsxs("div",{className:"mb-6 pb-6 border-b border-gray-200",children:[N.jsx("h4",{className:"text-sm font-medium text-gray-500 mb-2",children:"Logline"}),N.jsx("p",{className:"text-gray-900 italic",children:u.logline})]}),N.jsxs("div",{children:[N.jsx("h4",{className:"text-sm font-medium text-gray-500 mb-4",children:"Chapter Outline"}),N.jsx("div",{className:"space-y-3",children:(h=u.chapters)==null?void 0:h.map((p,y)=>N.jsx("div",{className:"border border-gray-200 rounded-lg p-4 hover:border-primary-300 transition-colors",children:N.jsxs("div",{className:"flex items-start gap-3",children:[N.jsx("span",{className:"flex-shrink-0 w-8 h-8 bg-primary-100 text-primary-700 rounded-full flex items-center justify-center text-sm font-medium",children:p.number||y+1}),N.jsxs("div",{className:"flex-1",children:[N.jsx("h5",{className:"font-medium text-gray-900",children:p.title||`Chapter ${p.number||y+1}`}),N.jsx("p",{className:"text-sm text-gray-600 mt-1",children:p.summary||"No summary available"})]})]})},y))})]}),N.jsx("div",{className:"mt-6 flex items-center justify-end gap-3",children:N.jsx("p",{className:"text-sm text-gray-500",children:"Ready to start writing! Navigate to the Write tab to begin."})})]}),!u&&!r&&N.jsxs("div",{className:"card text-center py-12",children:[N.jsx(eo,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),N.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Ready to Generate"}),N.jsx("p",{className:"text-gray-500 mt-2 max-w-md mx-auto",children:'Click "Generate Outline" to create a detailed chapter outline based on your genre and book idea. The AI will create a structure following genre-specific patterns.'})]})]})}function Hb(){const{activeBook:t,updateChapterContent:e,setCurrentChapter:n}=gf(),[r,i]=V.useState(!1),[s,l]=V.useState(!1);if(!t||!t.outline)return N.jsx("div",{className:"card text-center py-12",children:N.jsx("p",{className:"text-gray-500",children:"Generate an outline first to start writing your book."})});const u=t.outline.chapters.find(S=>S.number===t.currentChapter),c=()=>{t.currentChapter>1&&n(t.currentChapter-1)},h=()=>{const S=t.outline.chapters.length;t.currentChapter<S&&n(t.currentChapter+1)},p=async()=>{var S;if(!(!u||!t)){i(!0);try{const x=(S=t.outline)==null?void 0:S.chapters.find(C=>C.number===t.currentChapter-1),m=await pf.generateChapter(t.genre,u.title,u.summary,x==null?void 0:x.content);e(t.currentChapter,m.data.content)}catch(x){console.error("Failed to generate chapter:",x)}finally{i(!1)}}},y=async()=>{alert("Expand feature coming soon!")};return N.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[N.jsxs("div",{className:"space-y-4",children:[N.jsxs("div",{className:"card",children:[N.jsx("h3",{className:"font-semibold text-gray-900 mb-4",children:"Chapters"}),N.jsx("div",{className:"space-y-2",children:t.outline.chapters.map(S=>N.jsx("button",{onClick:()=>n(S.number),className:`w-full text-left p-3 rounded-lg transition-colors ${S.number===t.currentChapter?"bg-primary-100 text-primary-700":"hover:bg-gray-50"}`,children:N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("span",{className:"flex-shrink-0 w-6 h-6 bg-white rounded-full flex items-center justify-center text-xs font-medium border",children:S.number}),N.jsxs("div",{className:"flex-1 min-w-0",children:[N.jsx("p",{className:"text-sm font-medium truncate",children:S.title}),S.content&&N.jsx("span",{className:"text-xs text-green-600",children:"✓ Written"})]})]})},S.number))})]}),N.jsxs("div",{className:"card",children:[N.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Chapter Summary"}),N.jsx("p",{className:"text-sm text-gray-600",children:u==null?void 0:u.summary})]})]}),N.jsx("div",{className:"lg:col-span-3",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"flex items-center justify-between mb-6 pb-4 border-b border-gray-200",children:[N.jsxs("div",{className:"flex items-center gap-4",children:[N.jsx("button",{onClick:c,disabled:t.currentChapter<=1,className:"p-2 rounded-lg hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed",children:N.jsx(OC,{className:"w-5 h-5"})}),N.jsxs("div",{children:[N.jsx("h2",{className:"text-xl font-bold text-gray-900",children:u==null?void 0:u.title}),N.jsxs("p",{className:"text-sm text-gray-500",children:["Chapter ",t.currentChapter," of ",t.outline.chapters.length]})]}),N.jsx("button",{onClick:h,disabled:t.currentChapter>=t.outline.chapters.length,className:"p-2 rounded-lg hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed",children:N.jsx(bC,{className:"w-5 h-5"})})]}),N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsxs("button",{onClick:()=>l(!s),className:"btn-secondary flex items-center gap-2",children:[N.jsx(d8,{className:"w-4 h-4"}),"AI Assist"]}),N.jsxs("button",{onClick:p,disabled:r||!u,className:"btn-primary flex items-center gap-2",children:[N.jsx(eo,{className:"w-4 h-4"}),r?"Generating...":"Generate Chapter"]})]})]}),s&&N.jsxs("div",{className:"mb-6 bg-gradient-to-r from-accent-50 to-primary-50 rounded-lg p-4 border border-accent-200",children:[N.jsx("h4",{className:"font-medium text-gray-900 mb-3",children:"AI Writing Assistant"}),N.jsxs("div",{className:"flex flex-wrap gap-2",children:[N.jsx("button",{onClick:y,className:"text-sm px-3 py-1.5 bg-white rounded-lg border border-gray-200 hover:border-accent-300 transition-colors",children:"✨ Expand this section"}),N.jsx("button",{className:"text-sm px-3 py-1.5 bg-white rounded-lg border border-gray-200 hover:border-accent-300 transition-colors",children:"📝 Improve prose"}),N.jsx("button",{className:"text-sm px-3 py-1.5 bg-white rounded-lg border border-gray-200 hover:border-accent-300 transition-colors",children:"💡 Add description"}),N.jsx("button",{className:"text-sm px-3 py-1.5 bg-white rounded-lg border border-gray-200 hover:border-accent-300 transition-colors",children:"🔄 Rewrite paragraph"})]})]}),N.jsx("div",{className:"min-h-[500px]",children:u!=null&&u.content?N.jsx("textarea",{value:u.content,onChange:S=>e(t.currentChapter,S.target.value),className:"w-full h-[600px] p-6 font-serif text-lg leading-relaxed border-0 focus:ring-0 resize-y outline-none",placeholder:"Start writing or use AI to generate this chapter..."}):N.jsx("div",{className:"h-[500px] flex items-center justify-center text-gray-400",children:N.jsxs("div",{className:"text-center",children:[N.jsx(eo,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),N.jsx("p",{children:'Click "Generate Chapter" to create content with AI'}),N.jsx("p",{className:"text-sm mt-1",children:"Or start writing manually"})]})})}),N.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-200 flex items-center justify-between text-sm text-gray-500",children:[N.jsxs("span",{children:[u!=null&&u.content?u.content.split(/\s+/).length:0," ","words"]}),N.jsxs("span",{children:["Last updated:"," ",new Date(t.updatedAt).toLocaleDateString()]})]})]})})]})}function Vb(){const[t,e]=V.useState("genre"),{activeBook:n,setActiveBook:r,setOutline:i}=gf(),{data:s}=u8({queryKey:["genres"],queryFn:async()=>(await pf.getGenres()).data.genres}),l=(c,h,p)=>{const y={id:`book-${Date.now()}`,title:p,genre:c,idea:h,outline:null,characters:[],currentChapter:1,createdAt:new Date,updatedAt:new Date};r(y),e("outline")},u=c=>{n&&c&&(i(c),e("editor"))};return N.jsxs("div",{className:"space-y-6",children:[N.jsxs("div",{className:"flex items-center justify-between",children:[N.jsxs("div",{children:[N.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Book Generator"}),N.jsx("p",{className:"text-gray-500 mt-1",children:"Generate book ideas and write with AI assistance"})]}),N.jsxs("div",{className:"flex bg-white rounded-lg p-1 border border-gray-200",children:[N.jsxs("button",{onClick:()=>e("genre"),className:`flex items-center gap-2 px-4 py-2 rounded-md transition-colors ${t==="genre"||!n?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,disabled:!n&&t!=="genre",children:[N.jsx(zd,{className:"w-4 h-4"}),N.jsx("span",{className:"hidden sm:inline",children:"Genre"})]}),N.jsxs("button",{onClick:()=>e("outline"),disabled:!n,className:`flex items-center gap-2 px-4 py-2 rounded-md transition-colors ${t==="outline"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100 disabled:opacity-50"}`,children:[N.jsx(AC,{className:"w-4 h-4"}),N.jsx("span",{className:"hidden sm:inline",children:"Outline"})]}),N.jsxs("button",{onClick:()=>e("editor"),disabled:!n,className:`flex items-center gap-2 px-4 py-2 rounded-md transition-colors ${t==="editor"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,children:[N.jsx(DC,{className:"w-4 h-4"}),N.jsx("span",{className:"hidden sm:inline",children:"Write"})]}),N.jsxs("button",{onClick:()=>e("characters"),disabled:!n,className:`flex items-center gap-2 px-4 py-2 rounded-md transition-colors ${t==="characters"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,children:[N.jsx(h8,{className:"w-4 h-4"}),N.jsx("span",{className:"hidden sm:inline",children:"Characters"})]})]})]}),t==="genre"&&N.jsx(Bb,{genres:s||[],onSelect:l}),t==="outline"&&n&&N.jsx(Gb,{book:n,onComplete:u}),t==="editor"&&n&&N.jsx(Hb,{}),t==="characters"&&n&&N.jsx(Wb,{})]})}function Wb(){const{activeBook:t,addCharacter:e}=gf(),[n,r]=V.useState(!1),i=async()=>{if(t){r(!0);try{const l=(await pf.generateCharacters(t.genre,t.idea)).data.characters;Array.isArray(l)&&l.forEach(u=>{e({name:u.name||"Unknown",role:u.role||"Supporting",traits:u.traits||[],motivation:u.motivation||"",backstory:u.backstory||""})})}catch(s){console.error("Failed to generate characters:",s)}finally{r(!1)}}};return t?N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"flex items-center justify-between mb-6",children:[N.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Character Development"}),N.jsxs("button",{onClick:i,disabled:n,className:"btn-primary flex items-center gap-2",children:[N.jsx(eo,{className:"w-4 h-4"}),n?"Generating...":"Generate Characters"]})]}),t.characters.length===0?N.jsxs("div",{className:"text-center py-8",children:[N.jsx(h8,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),N.jsx("p",{className:"text-gray-500",children:'No characters yet. Click "Generate Characters" to create AI-suggested characters.'})]}):N.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.characters.map((s,l)=>{var u;return N.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 hover:border-primary-300 transition-colors",children:[N.jsxs("div",{className:"flex items-start justify-between mb-2",children:[N.jsx("h4",{className:"font-semibold text-gray-900",children:s.name}),N.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${s.role==="protagonist"?"bg-green-100 text-green-700":s.role==="antagonist"?"bg-red-100 text-red-700":"bg-gray-100 text-gray-600"}`,children:s.role})]}),N.jsxs("div",{className:"space-y-2 text-sm",children:[N.jsxs("div",{children:[N.jsx("span",{className:"text-gray-500",children:"Traits:"}),N.jsx("p",{className:"text-gray-700",children:((u=s.traits)==null?void 0:u.join(", "))||"N/A"})]}),N.jsxs("div",{children:[N.jsx("span",{className:"text-gray-500",children:"Motivation:"}),N.jsx("p",{className:"text-gray-700",children:s.motivation||"N/A"})]})]})]},l)})})]}):null}function Kb(){const[t]=V.useState("gpt-4o-mini"),[e]=V.useState("stable-diffusion-v1-6"),{t:n,i18n:r}=nm(),i=l=>{r.changeLanguage(l.target.value)},s=()=>{alert("Cloud AI models are configured automatically!")};return N.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[N.jsxs("div",{children:[N.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:n("settings.title")}),N.jsx("p",{className:"text-gray-500 mt-1",children:"Cloud AI configuration and application preferences"})]}),N.jsxs("div",{className:"card",children:[N.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2",children:[N.jsx(MC,{className:"w-5 h-5"}),n("settings.language")]}),N.jsx("div",{className:"space-y-4",children:N.jsxs("div",{children:[N.jsx("label",{className:"label",children:n("settings.languageSelect")}),N.jsxs("select",{value:r.language,onChange:i,className:"input bg-white",children:[N.jsx("option",{value:"en",children:n("settings.english")}),N.jsx("option",{value:"es",children:n("settings.spanish")})]})]})})]}),N.jsxs("div",{className:"card",children:[N.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2",children:[N.jsx(LC,{className:"w-5 h-5"}),"Cloud AI Settings"]}),N.jsxs("div",{className:"space-y-4",children:[N.jsxs("div",{children:[N.jsx("label",{className:"label",children:"Text Generation Model"}),N.jsx("select",{value:t,disabled:!0,className:"input bg-gray-100",children:N.jsx("option",{value:"gpt-4o-mini",children:"OpenAI GPT-4o Mini (via OpenRouter)"})}),N.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Used for book outlines, chapters, and text generation (free tier)"})]}),N.jsxs("div",{children:[N.jsx("label",{className:"label",children:"Image Generation Model"}),N.jsx("select",{value:e,disabled:!0,className:"input bg-gray-100",children:N.jsx("option",{value:"stable-diffusion-v1-6",children:"Stability AI Stable Diffusion v1.6"})}),N.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Used for AI book cover generation (free credits available)"})]})]})]}),N.jsxs("div",{className:"card bg-blue-50 border-blue-200",children:[N.jsx("h3",{className:"font-medium text-blue-900 mb-2",children:"API Key Setup"}),N.jsx("p",{className:"text-sm text-blue-700 mb-3",children:"Configure your API key in the server/.env file:"}),N.jsx("code",{className:"block bg-white rounded p-3 text-sm font-mono text-blue-800",children:"OPENROUTER_API_KEY=your_openrouter_api_key_here"}),N.jsxs("p",{className:"text-sm text-blue-700 mt-2",children:["Get a free API key from: ",N.jsx("a",{href:"https://openrouter.ai/keys",className:"underline",target:"_blank",rel:"noopener noreferrer",children:"OpenRouter"})]})]}),N.jsx("div",{className:"flex justify-end",children:N.jsxs("button",{onClick:s,className:"btn-primary flex items-center gap-2",children:[N.jsx(jC,{className:"w-4 h-4"}),"Save Settings"]})})]})}function $b(){const{t}=nm(),{user:e,isAuthenticated:n,logout:r,checkAuth:i}=K8(),[s,l]=V.useState(!1);return V.useEffect(()=>{i()},[]),N.jsxs("div",{className:"min-h-screen bg-gray-50",children:[N.jsx("header",{className:"bg-white border-b border-gray-200 sticky top-0 z-50",children:N.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:N.jsxs("div",{className:"flex items-center justify-between h-16",children:[N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-primary-500 to-accent-500 rounded-lg flex items-center justify-center",children:N.jsx(zd,{className:"w-5 h-5 text-white"})}),N.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"CreaBook"})]}),N.jsxs("nav",{className:"flex items-center gap-1",children:[N.jsxs("a",{href:"/covers",className:"flex items-center gap-2 px-4 py-2 rounded-lg text-gray-600 hover:bg-gray-100 transition-colors",children:[N.jsx(tm,{className:"w-5 h-5"}),N.jsx("span",{className:"hidden sm:inline",children:t("nav.coverDesigner")})]}),N.jsxs("a",{href:"/books",className:"flex items-center gap-2 px-4 py-2 rounded-lg text-gray-600 hover:bg-gray-100 transition-colors",children:[N.jsx(zd,{className:"w-5 h-5"}),N.jsx("span",{className:"hidden sm:inline",children:t("nav.bookGenerator")})]}),(e==null?void 0:e.role)==="ADMIN"&&N.jsxs("a",{href:"/settings",className:"flex items-center gap-2 px-4 py-2 rounded-lg text-gray-600 hover:bg-gray-100 transition-colors",children:[N.jsx(UC,{className:"w-5 h-5"}),N.jsx("span",{className:"hidden sm:inline",children:t("nav.settings")})]}),N.jsx("div",{className:"w-px h-6 bg-gray-200 mx-2"}),n?N.jsxs("div",{className:"flex items-center gap-4 ml-2",children:[N.jsx("span",{className:"text-sm font-medium text-gray-700",children:(e==null?void 0:e.name)||(e==null?void 0:e.email)}),N.jsx("button",{onClick:r,className:"text-sm text-red-600 hover:text-red-700 font-medium",children:t("nav.logout")})]}):N.jsx("button",{onClick:()=>l(!0),className:"btn-primary ml-2 py-2",children:t("nav.loginRegister")})]})]})})}),N.jsx("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:N.jsxs(U_,{children:[N.jsx(Cl,{path:"/",element:N.jsx(D_,{to:"/covers",replace:!0})}),N.jsx(Cl,{path:"/covers",element:N.jsx(Ub,{})}),N.jsx(Cl,{path:"/books",element:N.jsx(Vb,{})}),N.jsx(Cl,{path:"/settings",element:N.jsx(Kb,{})})]})}),N.jsx(NP,{isOpen:s,onClose:()=>l(!1)})]})}const{slice:Qb,forEach:qb}=[];function Yb(t){return qb.call(Qb.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}function Xb(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(t))}const h3=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Jb=function(t,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(e);let s=`${t}=${i}`;if(r.maxAge>0){const l=r.maxAge-0;if(Number.isNaN(l))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(l)}`}if(r.domain){if(!h3.test(r.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${r.domain}`}if(r.path){if(!h3.test(r.path))throw new TypeError("option path is invalid");s+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(s+="; HttpOnly"),r.secure&&(s+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(s+="; Partitioned"),s},f3={create(t,e,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=Jb(t,e,i)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let i=n[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return i.substring(e.length,i.length)}return null},remove(t,e){this.create(t,"",-1,e)}};var Zb={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return f3.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:s}=e;n&&typeof document<"u"&&f3.create(n,t,r,i,s)}},eL={name:"querystring",lookup(t){var r;let{lookupQuerystring:e}=t,n;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const l=i.substring(1).split("&");for(let u=0;u<l.length;u++){const c=l[u].indexOf("=");c>0&&l[u].substring(0,c)===e&&(n=l[u].substring(c+1))}}return n}},tL={name:"hash",lookup(t){var i;let{lookupHash:e,lookupFromHashIndex:n}=t,r;if(typeof window<"u"){const{hash:s}=window.location;if(s&&s.length>2){const l=s.substring(1);if(e){const u=l.split("&");for(let c=0;c<u.length;c++){const h=u[c].indexOf("=");h>0&&u[c].substring(0,h)===e&&(r=u[c].substring(h+1))}}if(r)return r;if(!r&&n>-1){const u=s.match(/\/([a-zA-Z-]*)/g);return Array.isArray(u)?(i=u[typeof n=="number"?n:0])==null?void 0:i.replace("/",""):void 0}}}return r}};let Mo=null;const p3=()=>{if(Mo!==null)return Mo;try{if(Mo=typeof window<"u"&&window.localStorage!==null,!Mo)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Mo=!1}return Mo};var nL={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&p3())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&p3()&&window.localStorage.setItem(n,t)}};let Io=null;const g3=()=>{if(Io!==null)return Io;try{if(Io=typeof window<"u"&&window.sessionStorage!==null,!Io)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Io=!1}return Io};var rL={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&g3())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&g3()&&window.sessionStorage.setItem(n,t)}},iL={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let s=0;s<n.length;s++)e.push(n[s]);r&&e.push(r),i&&e.push(i)}return e.length>0?e:void 0}},sL={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},oL={name:"path",lookup(t){var i;let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(i=n[typeof e=="number"?e:0])==null?void 0:i.replace("/",""):void 0}},aL={name:"subdomain",lookup(t){var i,s;let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window<"u"&&((s=(i=window.location)==null?void 0:i.hostname)==null?void 0:s.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let DS=!1;try{document.cookie,DS=!0}catch{}const jS=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];DS||jS.splice(1,1);const lL=()=>({order:jS,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class US{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=Yb(n,this.options||{},lL()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Zb),this.addDetector(eL),this.addDetector(nL),this.addDetector(rL),this.addDetector(iL),this.addDetector(sL),this.addDetector(oL),this.addDetector(aL),this.addDetector(tL)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return e.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.filter(r=>r!=null&&!Xb(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}US.type="languageDetector";const uL={coverDesigner:"Cover Designer",bookGenerator:"Book Generator",settings:"Settings",loginRegister:"Login / Register",logout:"Logout"},cL={welcomeBack:"Welcome Back",createAccount:"Create an Account",name:"Name",email:"Email",password:"Password",login:"Login",signUp:"Sign Up",pleaseWait:"Please wait...",dontHaveAccount:"Don't have an account? ",alreadyHaveAccount:"Already have an account? "},dL={title:"Settings",language:"Language",languageSelect:"Select your preferred language",english:"English",spanish:"Español"},hL={nav:uL,auth:cL,settings:dL},fL={coverDesigner:"Diseñador de Portadas",bookGenerator:"Generador de Libros",settings:"Ajustes",loginRegister:"Entrar / Registrarse",logout:"Cerrar Sesión"},pL={welcomeBack:"Bienvenido de nuevo",createAccount:"Crea una cuenta",name:"Nombre",email:"Correo electrónico",password:"Contraseña",login:"Entrar",signUp:"Registrarse",pleaseWait:"Por favor espera...",dontHaveAccount:"¿No tienes una cuenta? ",alreadyHaveAccount:"¿Ya tienes una cuenta? "},gL={title:"Ajustes",language:"Idioma",languageSelect:"Selecciona tu idioma preferido",english:"Inglés",spanish:"Español"},mL={nav:fL,auth:pL,settings:gL};un.use(US).use(vk).init({resources:{en:{translation:hL},es:{translation:mL}},fallbackLng:"en",interpolation:{escapeValue:!1}});const yL=new fC({defaultOptions:{queries:{staleTime:5*60*1e3,retry:1}}});k0.createRoot(document.getElementById("root")).render(N.jsx(Mt.StrictMode,{children:N.jsx(pC,{client:yL,children:N.jsx(G_,{children:N.jsx($b,{})})})}));