All files / dist/assets index-M5SqRN2t.js

0% Statements 0/15375
0% Branches 0/15644
0% Functions 0/4411
0% Lines 0/73

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function a(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(l){if(l.ep)return;l.ep=!0;const u=a(l);fetch(l.href,u)}})();var bu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vp={exports:{}},cu={};/**
 * @license React
 * react-jsx-runtime.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 X0;function TT(){if(X0)return cu;X0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(i,l,u){var f=null;if(u!==void 0&&(f=""+u),l.key!==void 0&&(f=""+l.key),"key"in l){u={};for(var p in l)p!=="key"&&(u[p]=l[p])}else u=l;return l=u.ref,{$$typeof:e,type:i,key:f,ref:l!==void 0?l:null,props:u}}return cu.Fragment=n,cu.jsx=a,cu.jsxs=a,cu}var Q0;function AT(){return Q0||(Q0=1,vp.exports=TT()),vp.exports}var R=AT(),bp={exports:{}},We={};/**
 * @license React
 * react.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 W0;function RT(){if(W0)return We;W0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),w=Symbol.iterator;function _(V){return V===null||typeof V!="object"?null:(V=w&&V[w]||V["@@iterator"],typeof V=="function"?V:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,j={};function N(V,k,G){this.props=V,this.context=k,this.refs=j,this.updater=G||O}N.prototype.isReactComponent={},N.prototype.setState=function(V,k){if(typeof V!="object"&&typeof V!="function"&&V!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,V,k,"setState")},N.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function P(){}P.prototype=N.prototype;function H(V,k,G){this.props=V,this.context=k,this.refs=j,this.updater=G||O}var L=H.prototype=new P;L.constructor=H,A(L,N.prototype),L.isPureReactComponent=!0;var ae=Array.isArray,ee={H:null,A:null,T:null,S:null,V:null},fe=Object.prototype.hasOwnProperty;function ue(V,k,G,I,ce,Te){return G=Te.ref,{$$typeof:e,type:V,key:k,ref:G!==void 0?G:null,props:Te}}function le(V,k){return ue(V.type,k,void 0,void 0,void 0,V.props)}function Oe(V){return typeof V=="object"&&V!==null&&V.$$typeof===e}function Be(V){var k={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(G){return k[G]})}var Xe=/\/+/g;function it(V,k){return typeof V=="object"&&V!==null&&V.key!=null?Be(""+V.key):k.toString(36)}function Ht(){}function pn(V){switch(V.status){case"fulfilled":return V.value;case"rejected":throw V.reason;default:switch(typeof V.status=="string"?V.then(Ht,Ht):(V.status="pending",V.then(function(k){V.status==="pending"&&(V.status="fulfilled",V.value=k)},function(k){V.status==="pending"&&(V.status="rejected",V.reason=k)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function ut(V,k,G,I,ce){var Te=typeof V;(Te==="undefined"||Te==="boolean")&&(V=null);var _e=!1;if(V===null)_e=!0;else switch(Te){case"bigint":case"string":case"number":_e=!0;break;case"object":switch(V.$$typeof){case e:case n:_e=!0;break;case v:return _e=V._init,ut(_e(V._payload),k,G,I,ce)}}if(_e)return ce=ce(V),_e=I===""?"."+it(V,0):I,ae(ce)?(G="",_e!=null&&(G=_e.replace(Xe,"$&/")+"/"),ut(ce,k,G,"",function(je){return je})):ce!=null&&(Oe(ce)&&(ce=le(ce,G+(ce.key==null||V&&V.key===ce.key?"":(""+ce.key).replace(Xe,"$&/")+"/")+_e)),k.push(ce)),1;_e=0;var Le=I===""?".":I+":";if(ae(V))for(var ze=0;ze<V.length;ze++)I=V[ze],Te=Le+it(I,ze),_e+=ut(I,k,G,Te,ce);else if(ze=_(V),typeof ze=="function")for(V=ze.call(V),ze=0;!(I=V.next()).done;)I=I.value,Te=Le+it(I,ze++),_e+=ut(I,k,G,Te,ce);else if(Te==="object"){if(typeof V.then=="function")return ut(pn(V),k,G,I,ce);throw k=String(V),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return _e}function de(V,k,G){if(V==null)return V;var I=[],ce=0;return ut(V,I,"","",function(Te){return k.call(G,Te,ce++)}),I}function be(V){if(V._status===-1){var k=V._result;k=k(),k.then(function(G){(V._status===0||V._status===-1)&&(V._status=1,V._result=G)},function(G){(V._status===0||V._status===-1)&&(V._status=2,V._result=G)}),V._status===-1&&(V._status=0,V._result=k)}if(V._status===1)return V._result.default;throw V._result}var Me=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof V=="object"&&V!==null&&typeof V.message=="string"?String(V.message):String(V),error:V});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",V);return}console.error(V)};function Ke(){}return We.Children={map:de,forEach:function(V,k,G){de(V,function(){k.apply(this,arguments)},G)},count:function(V){var k=0;return de(V,function(){k++}),k},toArray:function(V){return de(V,function(k){return k})||[]},only:function(V){if(!Oe(V))throw Error("React.Children.only expected to receive a single React element child.");return V}},We.Component=N,We.Fragment=a,We.Profiler=l,We.PureComponent=H,We.StrictMode=i,We.Suspense=y,We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ee,We.__COMPILER_RUNTIME={__proto__:null,c:function(V){return ee.H.useMemoCache(V)}},We.cache=function(V){return function(){return V.apply(null,arguments)}},We.cloneElement=function(V,k,G){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var I=A({},V.props),ce=V.key,Te=void 0;if(k!=null)for(_e in k.ref!==void 0&&(Te=void 0),k.key!==void 0&&(ce=""+k.key),k)!fe.call(k,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&k.ref===void 0||(I[_e]=k[_e]);var _e=arguments.length-2;if(_e===1)I.children=G;else if(1<_e){for(var Le=Array(_e),ze=0;ze<_e;ze++)Le[ze]=arguments[ze+2];I.children=Le}return ue(V.type,ce,void 0,void 0,Te,I)},We.createContext=function(V){return V={$$typeof:f,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:u,_context:V},V},We.createElement=function(V,k,G){var I,ce={},Te=null;if(k!=null)for(I in k.key!==void 0&&(Te=""+k.key),k)fe.call(k,I)&&I!=="key"&&I!=="__self"&&I!=="__source"&&(ce[I]=k[I]);var _e=arguments.length-2;if(_e===1)ce.children=G;else if(1<_e){for(var Le=Array(_e),ze=0;ze<_e;ze++)Le[ze]=arguments[ze+2];ce.children=Le}if(V&&V.defaultProps)for(I in _e=V.defaultProps,_e)ce[I]===void 0&&(ce[I]=_e[I]);return ue(V,Te,void 0,void 0,null,ce)},We.createRef=function(){return{current:null}},We.forwardRef=function(V){return{$$typeof:p,render:V}},We.isValidElement=Oe,We.lazy=function(V){return{$$typeof:v,_payload:{_status:-1,_result:V},_init:be}},We.memo=function(V,k){return{$$typeof:g,type:V,compare:k===void 0?null:k}},We.startTransition=function(V){var k=ee.T,G={};ee.T=G;try{var I=V(),ce=ee.S;ce!==null&&ce(G,I),typeof I=="object"&&I!==null&&typeof I.then=="function"&&I.then(Ke,Me)}catch(Te){Me(Te)}finally{ee.T=k}},We.unstable_useCacheRefresh=function(){return ee.H.useCacheRefresh()},We.use=function(V){return ee.H.use(V)},We.useActionState=function(V,k,G){return ee.H.useActionState(V,k,G)},We.useCallback=function(V,k){return ee.H.useCallback(V,k)},We.useContext=function(V){return ee.H.useContext(V)},We.useDebugValue=function(){},We.useDeferredValue=function(V,k){return ee.H.useDeferredValue(V,k)},We.useEffect=function(V,k,G){var I=ee.H;if(typeof G=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return I.useEffect(V,k)},We.useId=function(){return ee.H.useId()},We.useImperativeHandle=function(V,k,G){return ee.H.useImperativeHandle(V,k,G)},We.useInsertionEffect=function(V,k){return ee.H.useInsertionEffect(V,k)},We.useLayoutEffect=function(V,k){return ee.H.useLayoutEffect(V,k)},We.useMemo=function(V,k){return ee.H.useMemo(V,k)},We.useOptimistic=function(V,k){return ee.H.useOptimistic(V,k)},We.useReducer=function(V,k,G){return ee.H.useReducer(V,k,G)},We.useRef=function(V){return ee.H.useRef(V)},We.useState=function(V){return ee.H.useState(V)},We.useSyncExternalStore=function(V,k,G){return ee.H.useSyncExternalStore(V,k,G)},We.useTransition=function(){return ee.H.useTransition()},We.version="19.1.1",We}var J0;function ld(){return J0||(J0=1,bp.exports=RT()),bp.exports}var D=ld();const ct=Cx(D);var xp={exports:{}},fu={},wp={exports:{}},Sp={};/**
 * @license React
 * scheduler.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 eb;function CT(){return eb||(eb=1,(function(e){function n(de,be){var Me=de.length;de.push(be);e:for(;0<Me;){var Ke=Me-1>>>1,V=de[Ke];if(0<l(V,be))de[Ke]=be,de[Me]=V,Me=Ke;else break e}}function a(de){return de.length===0?null:de[0]}function i(de){if(de.length===0)return null;var be=de[0],Me=de.pop();if(Me!==be){de[0]=Me;e:for(var Ke=0,V=de.length,k=V>>>1;Ke<k;){var G=2*(Ke+1)-1,I=de[G],ce=G+1,Te=de[ce];if(0>l(I,Me))ce<V&&0>l(Te,I)?(de[Ke]=Te,de[ce]=Me,Ke=ce):(de[Ke]=I,de[G]=Me,Ke=G);else if(ce<V&&0>l(Te,Me))de[Ke]=Te,de[ce]=Me,Ke=ce;else break e}}return be}function l(de,be){var Me=de.sortIndex-be.sortIndex;return Me!==0?Me:de.id-be.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();e.unstable_now=function(){return f.now()-p}}var y=[],g=[],v=1,w=null,_=3,O=!1,A=!1,j=!1,N=!1,P=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function ae(de){for(var be=a(g);be!==null;){if(be.callback===null)i(g);else if(be.startTime<=de)i(g),be.sortIndex=be.expirationTime,n(y,be);else break;be=a(g)}}function ee(de){if(j=!1,ae(de),!A)if(a(y)!==null)A=!0,fe||(fe=!0,it());else{var be=a(g);be!==null&&ut(ee,be.startTime-de)}}var fe=!1,ue=-1,le=5,Oe=-1;function Be(){return N?!0:!(e.unstable_now()-Oe<le)}function Xe(){if(N=!1,fe){var de=e.unstable_now();Oe=de;var be=!0;try{e:{A=!1,j&&(j=!1,H(ue),ue=-1),O=!0;var Me=_;try{t:{for(ae(de),w=a(y);w!==null&&!(w.expirationTime>de&&Be());){var Ke=w.callback;if(typeof Ke=="function"){w.callback=null,_=w.priorityLevel;var V=Ke(w.expirationTime<=de);if(de=e.unstable_now(),typeof V=="function"){w.callback=V,ae(de),be=!0;break t}w===a(y)&&i(y),ae(de)}else i(y);w=a(y)}if(w!==null)be=!0;else{var k=a(g);k!==null&&ut(ee,k.startTime-de),be=!1}}break e}finally{w=null,_=Me,O=!1}be=void 0}}finally{be?it():fe=!1}}}var it;if(typeof L=="function")it=function(){L(Xe)};else if(typeof MessageChannel<"u"){var Ht=new MessageChannel,pn=Ht.port2;Ht.port1.onmessage=Xe,it=function(){pn.postMessage(null)}}else it=function(){P(Xe,0)};function ut(de,be){ue=P(function(){de(e.unstable_now())},be)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(de){de.callback=null},e.unstable_forceFrameRate=function(de){0>de||125<de?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<de?Math.floor(1e3/de):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(de){switch(_){case 1:case 2:case 3:var be=3;break;default:be=_}var Me=_;_=be;try{return de()}finally{_=Me}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(de,be){switch(de){case 1:case 2:case 3:case 4:case 5:break;default:de=3}var Me=_;_=de;try{return be()}finally{_=Me}},e.unstable_scheduleCallback=function(de,be,Me){var Ke=e.unstable_now();switch(typeof Me=="object"&&Me!==null?(Me=Me.delay,Me=typeof Me=="number"&&0<Me?Ke+Me:Ke):Me=Ke,de){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=Me+V,de={id:v++,callback:be,priorityLevel:de,startTime:Me,expirationTime:V,sortIndex:-1},Me>Ke?(de.sortIndex=Me,n(g,de),a(y)===null&&de===a(g)&&(j?(H(ue),ue=-1):j=!0,ut(ee,Me-Ke))):(de.sortIndex=V,n(y,de),A||O||(A=!0,fe||(fe=!0,it()))),de},e.unstable_shouldYield=Be,e.unstable_wrapCallback=function(de){var be=_;return function(){var Me=_;_=be;try{return de.apply(this,arguments)}finally{_=Me}}}})(Sp)),Sp}var tb;function OT(){return tb||(tb=1,wp.exports=CT()),wp.exports}var Ep={exports:{}},Nn={};/**
 * @license React
 * react-dom.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 nb;function DT(){if(nb)return Nn;nb=1;var e=ld();function n(y){var g="https://react.dev/errors/"+y;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)g+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+y+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var i={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},l=Symbol.for("react.portal");function u(y,g,v){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:w==null?null:""+w,children:y,containerInfo:g,implementation:v}}var f=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(y,g){if(y==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Nn.createPortal=function(y,g){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(n(299));return u(y,g,null,v)},Nn.flushSync=function(y){var g=f.T,v=i.p;try{if(f.T=null,i.p=2,y)return y()}finally{f.T=g,i.p=v,i.d.f()}},Nn.preconnect=function(y,g){typeof y=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,i.d.C(y,g))},Nn.prefetchDNS=function(y){typeof y=="string"&&i.d.D(y)},Nn.preinit=function(y,g){if(typeof y=="string"&&g&&typeof g.as=="string"){var v=g.as,w=p(v,g.crossOrigin),_=typeof g.integrity=="string"?g.integrity:void 0,O=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;v==="style"?i.d.S(y,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:w,integrity:_,fetchPriority:O}):v==="script"&&i.d.X(y,{crossOrigin:w,integrity:_,fetchPriority:O,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Nn.preinitModule=function(y,g){if(typeof y=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var v=p(g.as,g.crossOrigin);i.d.M(y,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&i.d.M(y)},Nn.preload=function(y,g){if(typeof y=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var v=g.as,w=p(v,g.crossOrigin);i.d.L(y,v,{crossOrigin:w,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Nn.preloadModule=function(y,g){if(typeof y=="string")if(g){var v=p(g.as,g.crossOrigin);i.d.m(y,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else i.d.m(y)},Nn.requestFormReset=function(y){i.d.r(y)},Nn.unstable_batchedUpdates=function(y,g){return y(g)},Nn.useFormState=function(y,g,v){return f.H.useFormState(y,g,v)},Nn.useFormStatus=function(){return f.H.useHostTransitionStatus()},Nn.version="19.1.1",Nn}var rb;function jT(){if(rb)return Ep.exports;rb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Ep.exports=DT(),Ep.exports}/**
 * @license React
 * react-dom-client.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 ab;function MT(){if(ab)return fu;ab=1;var e=OT(),n=ld(),a=jT();function i(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)r+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){var r=t,o=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(o=r.return),t=r.return;while(t)}return r.tag===3?o:null}function f(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function p(t){if(u(t)!==t)throw Error(i(188))}function y(t){var r=t.alternate;if(!r){if(r=u(t),r===null)throw Error(i(188));return r!==t?null:t}for(var o=t,s=r;;){var d=o.return;if(d===null)break;var m=d.alternate;if(m===null){if(s=d.return,s!==null){o=s;continue}break}if(d.child===m.child){for(m=d.child;m;){if(m===o)return p(d),t;if(m===s)return p(d),r;m=m.sibling}throw Error(i(188))}if(o.return!==s.return)o=d,s=m;else{for(var E=!1,C=d.child;C;){if(C===o){E=!0,o=d,s=m;break}if(C===s){E=!0,s=d,o=m;break}C=C.sibling}if(!E){for(C=m.child;C;){if(C===o){E=!0,o=m,s=d;break}if(C===s){E=!0,s=m,o=d;break}C=C.sibling}if(!E)throw Error(i(189))}}if(o.alternate!==s)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?t:r}function g(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=g(t),r!==null)return r;t=t.sibling}return null}var v=Object.assign,w=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),H=Symbol.for("react.consumer"),L=Symbol.for("react.context"),ae=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),fe=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),Oe=Symbol.for("react.activity"),Be=Symbol.for("react.memo_cache_sentinel"),Xe=Symbol.iterator;function it(t){return t===null||typeof t!="object"?null:(t=Xe&&t[Xe]||t["@@iterator"],typeof t=="function"?t:null)}var Ht=Symbol.for("react.client.reference");function pn(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ht?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case A:return"Fragment";case N:return"Profiler";case j:return"StrictMode";case ee:return"Suspense";case fe:return"SuspenseList";case Oe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case O:return"Portal";case L:return(t.displayName||"Context")+".Provider";case H:return(t._context.displayName||"Context")+".Consumer";case ae:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ue:return r=t.displayName||null,r!==null?r:pn(t.type)||"Memo";case le:r=t._payload,t=t._init;try{return pn(t(r))}catch{}}return null}var ut=Array.isArray,de=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,be=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Me={pending:!1,data:null,method:null,action:null},Ke=[],V=-1;function k(t){return{current:t}}function G(t){0>V||(t.current=Ke[V],Ke[V]=null,V--)}function I(t,r){V++,Ke[V]=t.current,t.current=r}var ce=k(null),Te=k(null),_e=k(null),Le=k(null);function ze(t,r){switch(I(_e,r),I(Te,t),I(ce,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?_0(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=_0(r),t=T0(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}G(ce),I(ce,t)}function je(){G(ce),G(Te),G(_e)}function mn(t){t.memoizedState!==null&&I(Le,t);var r=ce.current,o=T0(r,t.type);r!==o&&(I(Te,t),I(ce,o))}function zt(t){Te.current===t&&(G(ce),G(Te)),Le.current===t&&(G(Le),iu._currentValue=Me)}var $e=Object.prototype.hasOwnProperty,Ft=e.unstable_scheduleCallback,ft=e.unstable_cancelCallback,En=e.unstable_shouldYield,nr=e.unstable_requestPaint,st=e.unstable_now,$r=e.unstable_getCurrentPriorityLevel,qr=e.unstable_ImmediatePriority,Yn=e.unstable_UserBlockingPriority,ln=e.unstable_NormalPriority,Ln=e.unstable_LowPriority,Dr=e.unstable_IdlePriority,Yo=e.log,va=e.unstable_setDisableYieldValue,un=null,St=null;function Mn(t){if(typeof Yo=="function"&&va(t),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(un,t)}catch{}}var Pt=Math.clz32?Math.clz32:jr,ba=Math.log,Zr=Math.LN2;function jr(t){return t>>>=0,t===0?32:31-(ba(t)/Zr|0)|0}var Mr=256,Kr=4194304;function yn(t){var r=t&42;if(r!==0)return r;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:return 64;case 128:return 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&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ke(t,r,o){var s=t.pendingLanes;if(s===0)return 0;var d=0,m=t.suspendedLanes,E=t.pingedLanes;t=t.warmLanes;var C=s&134217727;return C!==0?(s=C&~m,s!==0?d=yn(s):(E&=C,E!==0?d=yn(E):o||(o=C&~t,o!==0&&(d=yn(o))))):(C=s&~m,C!==0?d=yn(C):E!==0?d=yn(E):o||(o=s&~t,o!==0&&(d=yn(o)))),d===0?0:r!==0&&r!==d&&(r&m)===0&&(m=d&-d,o=r&-r,m>=o||m===32&&(o&4194048)!==0)?r:d}function kr(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function xa(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32: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 r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zi(){var t=Mr;return Mr<<=1,(Mr&4194048)===0&&(Mr=256),t}function De(){var t=Kr;return Kr<<=1,(Kr&62914560)===0&&(Kr=4194304),t}function Ki(t){for(var r=[],o=0;31>o;o++)r.push(t);return r}function ni(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function tl(t,r,o,s,d,m){var E=t.pendingLanes;t.pendingLanes=o,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=o,t.entangledLanes&=o,t.errorRecoveryDisabledLanes&=o,t.shellSuspendCounter=0;var C=t.entanglements,B=t.expirationTimes,re=t.hiddenUpdates;for(o=E&~o;0<o;){var pe=31-Pt(o),ge=1<<pe;C[pe]=0,B[pe]=-1;var oe=re[pe];if(oe!==null)for(re[pe]=null,pe=0;pe<oe.length;pe++){var se=oe[pe];se!==null&&(se.lane&=-536870913)}o&=~ge}s!==0&&nl(t,s,0),m!==0&&d===0&&t.tag!==0&&(t.suspendedLanes|=m&~(E&~r))}function nl(t,r,o){t.pendingLanes|=r,t.suspendedLanes&=~r;var s=31-Pt(r);t.entangledLanes|=r,t.entanglements[s]=t.entanglements[s]|1073741824|o&4194090}function Fo(t,r){var o=t.entangledLanes|=r;for(t=t.entanglements;o;){var s=31-Pt(o),d=1<<s;d&r|t[s]&r&&(t[s]|=r),o&=~d}}function rl(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function al(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function wa(){var t=be.p;return t!==0?t:(t=window.event,t===void 0?32:q0(t.type))}function ri(t,r){var o=be.p;try{return be.p=t,r()}finally{be.p=o}}var mr=Math.random().toString(36).slice(2),Gt="__reactFiber$"+mr,Je="__reactProps$"+mr,Ct="__reactContainer$"+mr,il="__reactEvents$"+mr,Go="__reactListeners$"+mr,Xo="__reactHandles$"+mr,Yi="__reactResources$"+mr,Fi="__reactMarker$"+mr;function yr(t){delete t[Gt],delete t[Je],delete t[il],delete t[Go],delete t[Xo]}function rr(t){var r=t[Gt];if(r)return r;for(var o=t.parentNode;o;){if(r=o[Ct]||o[Gt]){if(o=r.alternate,r.child!==null||o!==null&&o.child!==null)for(t=O0(t);t!==null;){if(o=t[Gt])return o;t=O0(t)}return r}t=o,o=t.parentNode}return null}function Bn(t){if(t=t[Gt]||t[Ct]){var r=t.tag;if(r===5||r===6||r===13||r===26||r===27||r===3)return t}return null}function Yr(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(i(33))}function ai(t){var r=t[Yi];return r||(r=t[Yi]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Et(t){t[Fi]=!0}var ol=new Set,Fr={};function Gr(t,r){Xr(t,r),Xr(t+"Capture",r)}function Xr(t,r){for(Fr[t]=r,t=0;t<r.length;t++)ol.add(r[t])}var Lt=RegExp("^[: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]*$"),Qr={},gr={};function ac(t){return $e.call(gr,t)?!0:$e.call(Qr,t)?!1:Lt.test(t)?gr[t]=!0:(Qr[t]=!0,!1)}function Nr(t,r,o){if(ac(r))if(o===null)t.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var s=r.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+o)}}function Sa(t,r,o){if(o===null)t.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+o)}}function ar(t,r,o,s){if(s===null)t.removeAttribute(o);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(o);return}t.setAttributeNS(r,o,""+s)}}var Gi,Wr;function Ea(t){if(Gi===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);Gi=r&&r[1]||"",Wr=-1<o.stack.indexOf(`
    at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Gi+t+Wr}var ii=!1;function Qo(t,r){if(!t||ii)return"";ii=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(r){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(se){var oe=se}Reflect.construct(t,[],ge)}else{try{ge.call()}catch(se){oe=se}t.call(ge.prototype)}}else{try{throw Error()}catch(se){oe=se}(ge=t())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(se){if(se&&oe&&typeof se.stack=="string")return[se.stack,oe.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=s.DetermineComponentFrameRoot(),E=m[0],C=m[1];if(E&&C){var B=E.split(`
`),re=C.split(`
`);for(d=s=0;s<B.length&&!B[s].includes("DetermineComponentFrameRoot");)s++;for(;d<re.length&&!re[d].includes("DetermineComponentFrameRoot");)d++;if(s===B.length||d===re.length)for(s=B.length-1,d=re.length-1;1<=s&&0<=d&&B[s]!==re[d];)d--;for(;1<=s&&0<=d;s--,d--)if(B[s]!==re[d]){if(s!==1||d!==1)do if(s--,d--,0>d||B[s]!==re[d]){var pe=`
`+B[s].replace(" at new "," at ");return t.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",t.displayName)),pe}while(1<=s&&0<=d);break}}}finally{ii=!1,Error.prepareStackTrace=o}return(o=t?t.displayName||t.name:"")?Ea(o):""}function nt(t){switch(t.tag){case 26:case 27:case 5:return Ea(t.type);case 16:return Ea("Lazy");case 13:return Ea("Suspense");case 19:return Ea("SuspenseList");case 0:case 15:return Qo(t.type,!1);case 11:return Qo(t.type.render,!1);case 1:return Qo(t.type,!0);case 31:return Ea("Activity");default:return""}}function sl(t){try{var r="";do r+=nt(t),t=t.return;while(t);return r}catch(o){return`
Error generating stack: `+o.message+`
`+o.stack}}function Un(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Xi(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Qi(t){var r=Xi(t)?"checked":"value",o=Object.getOwnPropertyDescriptor(t.constructor.prototype,r),s=""+t[r];if(!t.hasOwnProperty(r)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var d=o.get,m=o.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return d.call(this)},set:function(E){s=""+E,m.call(this,E)}}),Object.defineProperty(t,r,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(E){s=""+E},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Wi(t){t._valueTracker||(t._valueTracker=Qi(t))}function ll(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var o=r.getValue(),s="";return t&&(s=Xi(t)?t.checked?"true":"false":t.value),t=s,t!==o?(r.setValue(t),!0):!1}function Ji(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}}var gt=/[\n"\\]/g;function gn(t){return t.replace(gt,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function _a(t,r,o,s,d,m,E,C){t.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?t.type=E:t.removeAttribute("type"),r!=null?E==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Un(r)):t.value!==""+Un(r)&&(t.value=""+Un(r)):E!=="submit"&&E!=="reset"||t.removeAttribute("value"),r!=null?eo(t,E,Un(r)):o!=null?eo(t,E,Un(o)):s!=null&&t.removeAttribute("value"),d==null&&m!=null&&(t.defaultChecked=!!m),d!=null&&(t.checked=d&&typeof d!="function"&&typeof d!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.name=""+Un(C):t.removeAttribute("name")}function Ta(t,r,o,s,d,m,E,C){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),r!=null||o!=null){if(!(m!=="submit"&&m!=="reset"||r!=null))return;o=o!=null?""+Un(o):"",r=r!=null?""+Un(r):o,C||r===t.value||(t.value=r),t.defaultValue=r}s=s??d,s=typeof s!="function"&&typeof s!="symbol"&&!!s,t.checked=C?t.checked:!!s,t.defaultChecked=!!s,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(t.name=E)}function eo(t,r,o){r==="number"&&Ji(t.ownerDocument)===t||t.defaultValue===""+o||(t.defaultValue=""+o)}function Jr(t,r,o,s){if(t=t.options,r){r={};for(var d=0;d<o.length;d++)r["$"+o[d]]=!0;for(o=0;o<t.length;o++)d=r.hasOwnProperty("$"+t[o].value),t[o].selected!==d&&(t[o].selected=d),d&&s&&(t[o].defaultSelected=!0)}else{for(o=""+Un(o),r=null,d=0;d<t.length;d++){if(t[d].value===o){t[d].selected=!0,s&&(t[d].defaultSelected=!0);return}r!==null||t[d].disabled||(r=t[d])}r!==null&&(r.selected=!0)}}function to(t,r,o){if(r!=null&&(r=""+Un(r),r!==t.value&&(t.value=r),o==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=o!=null?""+Un(o):""}function ul(t,r,o,s){if(r==null){if(s!=null){if(o!=null)throw Error(i(92));if(ut(s)){if(1<s.length)throw Error(i(93));s=s[0]}o=s}o==null&&(o=""),r=o}o=Un(r),t.defaultValue=o,s=t.textContent,s===o&&s!==""&&s!==null&&(t.value=s)}function zr(t,r){if(r){var o=t.firstChild;if(o&&o===t.lastChild&&o.nodeType===3){o.nodeValue=r;return}}t.textContent=r}var ic=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function oc(t,r,o){var s=r.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?s?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":s?t.setProperty(r,o):typeof o!="number"||o===0||ic.has(r)?r==="float"?t.cssFloat=o:t[r]=(""+o).trim():t[r]=o+"px"}function ot(t,r,o){if(r!=null&&typeof r!="object")throw Error(i(62));if(t=t.style,o!=null){for(var s in o)!o.hasOwnProperty(s)||r!=null&&r.hasOwnProperty(s)||(s.indexOf("--")===0?t.setProperty(s,""):s==="float"?t.cssFloat="":t[s]="");for(var d in r)s=r[d],r.hasOwnProperty(d)&&o[d]!==s&&oc(t,d,s)}else for(var m in r)r.hasOwnProperty(m)&&oc(t,m,r[m])}function Wo(t){if(t.indexOf("-")===-1)return!1;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 Dd=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),jd=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function vn(t){return jd.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var ea=null;function oi(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Vn=null,Aa=null;function cl(t){var r=Bn(t);if(r&&(t=r.stateNode)){var o=t[Je]||null;e:switch(t=r.stateNode,r.type){case"input":if(_a(t,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),r=o.name,o.type==="radio"&&r!=null){for(o=t;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+gn(""+r)+'"][type="radio"]'),r=0;r<o.length;r++){var s=o[r];if(s!==t&&s.form===t.form){var d=s[Je]||null;if(!d)throw Error(i(90));_a(s,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(r=0;r<o.length;r++)s=o[r],s.form===t.form&&ll(s)}break e;case"textarea":to(t,o.value,o.defaultValue);break e;case"select":r=o.value,r!=null&&Jr(t,!!o.multiple,r,!1)}}}var $t=!1;function ir(t,r,o){if($t)return t(r,o);$t=!0;try{var s=t(r);return s}finally{if($t=!1,(Vn!==null||Aa!==null)&&(Xc(),Vn&&(r=Vn,t=Aa,Aa=Vn=null,cl(r),t)))for(r=0;r<t.length;r++)cl(t[r])}}function Pr(t,r){var o=t.stateNode;if(o===null)return null;var s=o[Je]||null;if(s===null)return null;o=s[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(t=t.type,s=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!s;break e;default:t=!1}if(t)return null;if(o&&typeof o!="function")throw Error(i(231,r,typeof o));return o}var In=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),no=!1;if(In)try{var Fn={};Object.defineProperty(Fn,"passive",{get:function(){no=!0}}),window.addEventListener("test",Fn,Fn),window.removeEventListener("test",Fn,Fn)}catch{no=!1}var ta=null,Gn=null,si=null;function fl(){if(si)return si;var t,r=Gn,o=r.length,s,d="value"in ta?ta.value:ta.textContent,m=d.length;for(t=0;t<o&&r[t]===d[t];t++);var E=o-t;for(s=1;s<=E&&r[o-s]===d[m-s];s++);return si=d.slice(t,1<s?1-s:void 0)}function li(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function na(){return!0}function Jo(){return!1}function _n(t){function r(o,s,d,m,E){this._reactName=o,this._targetInst=d,this.type=s,this.nativeEvent=m,this.target=E,this.currentTarget=null;for(var C in t)t.hasOwnProperty(C)&&(o=t[C],this[C]=o?o(m):m[C]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?na:Jo,this.isPropagationStopped=Jo,this}return v(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=na)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=na)},persist:function(){},isPersistent:na}),r}var Ra={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ra=_n(Ra),ro=v({},Ra,{view:0,detail:0}),Md=_n(ro),ui,ci,Ca,es=v({},ro,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tn,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!==Ca&&(Ca&&t.type==="mousemove"?(ui=t.screenX-Ca.screenX,ci=t.screenY-Ca.screenY):ci=ui=0,Ca=t),ui)},movementY:function(t){return"movementY"in t?t.movementY:ci}}),sc=_n(es),kd=v({},es,{dataTransfer:0}),dl=_n(kd),hl=v({},ro,{relatedTarget:0}),ts=_n(hl),ns=v({},Ra,{animationName:0,elapsedTime:0,pseudoElement:0}),rs=_n(ns),as=v({},Ra,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),lc=_n(as),Nd=v({},Ra,{data:0}),Oa=_n(Nd),pl={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ml={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"},yl={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gl(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=yl[t])?!!r[t]:!1}function tn(){return gl}var ao=v({},ro,{key:function(t){if(t.key){var r=pl[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=li(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?ml[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tn,charCode:function(t){return t.type==="keypress"?li(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?li(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),io=_n(ao),uc=v({},es,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),oo=_n(uc),cc=v({},ro,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tn}),fc=_n(cc),is=v({},Ra,{propertyName:0,elapsedTime:0,pseudoElement:0}),vl=_n(is),Da=v({},es,{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}),bl=_n(Da),xl=v({},Ra,{newState:0,oldState:0}),os=_n(xl),wl=[9,13,27,32],ss=In&&"CompositionEvent"in window,so=null;In&&"documentMode"in document&&(so=document.documentMode);var Sl=In&&"TextEvent"in window&&!so,lo=In&&(!ss||so&&8<so&&11>=so),dc=" ",ls=!1;function us(t,r){switch(t){case"keyup":return wl.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hc(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ja=!1;function zd(t,r){switch(t){case"compositionend":return hc(r);case"keypress":return r.which!==32?null:(ls=!0,dc);case"textInput":return t=r.data,t===dc&&ls?null:t;default:return null}}function pc(t,r){if(ja)return t==="compositionend"||!ss&&us(t,r)?(t=fl(),si=Gn=ta=null,ja=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return lo&&r.locale!=="ko"?null:r.data;default:return null}}var mc={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 yc(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!mc[t.type]:r==="textarea"}function El(t,r,o,s){Vn?Aa?Aa.push(s):Aa=[s]:Vn=s,r=nf(r,"onChange"),0<r.length&&(o=new ra("onChange","change",null,o,s),t.push({event:o,listeners:r}))}var Ma=null,fi=null;function gc(t){b0(t,0)}function cs(t){var r=Yr(t);if(ll(r))return t}function vc(t,r){if(t==="change")return r}var bc=!1;if(In){var di;if(In){var or="oninput"in document;if(!or){var jt=document.createElement("div");jt.setAttribute("oninput","return;"),or=typeof jt.oninput=="function"}di=or}else di=!1;bc=di&&(!document.documentMode||9<document.documentMode)}function uo(){Ma&&(Ma.detachEvent("onpropertychange",Hn),fi=Ma=null)}function Hn(t){if(t.propertyName==="value"&&cs(fi)){var r=[];El(r,fi,t,oi(t)),ir(gc,r)}}function Pd(t,r,o){t==="focusin"?(uo(),Ma=r,fi=o,Ma.attachEvent("onpropertychange",Hn)):t==="focusout"&&uo()}function _l(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return cs(fi)}function xc(t,r){if(t==="click")return cs(r)}function ka(t,r){if(t==="input"||t==="change")return cs(r)}function Tl(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var nn=typeof Object.is=="function"?Object.is:Tl;function Xn(t,r){if(nn(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var o=Object.keys(t),s=Object.keys(r);if(o.length!==s.length)return!1;for(s=0;s<o.length;s++){var d=o[s];if(!$e.call(r,d)||!nn(t[d],r[d]))return!1}return!0}function Al(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function c(t,r){var o=Al(t);t=0;for(var s;o;){if(o.nodeType===3){if(s=t+o.textContent.length,t<=r&&s>=r)return{node:o,offset:r-t};t=s}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Al(o)}}function h(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?h(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function b(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Ji(t.document);r instanceof t.HTMLIFrameElement;){try{var o=typeof r.contentWindow.location.href=="string"}catch{o=!1}if(o)t=r.contentWindow;else break;r=Ji(t.document)}return r}function x(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var S=In&&"documentMode"in document&&11>=document.documentMode,T=null,M=null,z=null,$=!1;function q(t,r,o){var s=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;$||T==null||T!==Ji(s)||(s=T,"selectionStart"in s&&x(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),z&&Xn(z,s)||(z=s,s=nf(M,"onSelect"),0<s.length&&(r=new ra("onSelect","select",null,r,o),t.push({event:r,listeners:s}),r.target=T)))}function X(t,r){var o={};return o[t.toLowerCase()]=r.toLowerCase(),o["Webkit"+t]="webkit"+r,o["Moz"+t]="moz"+r,o}var U={animationend:X("Animation","AnimationEnd"),animationiteration:X("Animation","AnimationIteration"),animationstart:X("Animation","AnimationStart"),transitionrun:X("Transition","TransitionRun"),transitionstart:X("Transition","TransitionStart"),transitioncancel:X("Transition","TransitionCancel"),transitionend:X("Transition","TransitionEnd")},J={},Z={};In&&(Z=document.createElement("div").style,"AnimationEvent"in window||(delete U.animationend.animation,delete U.animationiteration.animation,delete U.animationstart.animation),"TransitionEvent"in window||delete U.transitionend.transition);function Y(t){if(J[t])return J[t];if(!U[t])return t;var r=U[t],o;for(o in r)if(r.hasOwnProperty(o)&&o in Z)return J[t]=r[o];return t}var F=Y("animationend"),Q=Y("animationiteration"),te=Y("animationstart"),ie=Y("transitionrun"),he=Y("transitionstart"),ye=Y("transitioncancel"),Ee=Y("transitionend"),Ae=new Map,we="abort auxClick beforeToggle 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(" ");we.push("scrollEnd");function xe(t,r){Ae.set(t,r),Gr(r,[t])}var Re=new WeakMap;function Se(t,r){if(typeof t=="object"&&t!==null){var o=Re.get(t);return o!==void 0?o:(r={value:t,source:r,stack:sl(r)},Re.set(t,r),r)}return{value:t,source:r,stack:sl(r)}}var Ce=[],He=0,Fe=0;function Ge(){for(var t=He,r=Fe=He=0;r<t;){var o=Ce[r];Ce[r++]=null;var s=Ce[r];Ce[r++]=null;var d=Ce[r];Ce[r++]=null;var m=Ce[r];if(Ce[r++]=null,s!==null&&d!==null){var E=s.pending;E===null?d.next=d:(d.next=E.next,E.next=d),s.pending=d}m!==0&&cn(o,d,m)}}function bn(t,r,o,s){Ce[He++]=t,Ce[He++]=r,Ce[He++]=o,Ce[He++]=s,Fe|=s,t.lanes|=s,t=t.alternate,t!==null&&(t.lanes|=s)}function Ye(t,r,o,s){return bn(t,r,o,s),Na(t)}function Bt(t,r){return bn(t,null,null,r),Na(t)}function cn(t,r,o){t.lanes|=o;var s=t.alternate;s!==null&&(s.lanes|=o);for(var d=!1,m=t.return;m!==null;)m.childLanes|=o,s=m.alternate,s!==null&&(s.childLanes|=o),m.tag===22&&(t=m.stateNode,t===null||t._visibility&1||(d=!0)),t=m,m=m.return;return t.tag===3?(m=t.stateNode,d&&r!==null&&(d=31-Pt(o),t=m.hiddenUpdates,s=t[d],s===null?t[d]=[r]:s.push(r),r.lane=o|536870912),m):null}function Na(t){if(50<Ql)throw Ql=0,Hh=null,Error(i(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var qt={};function za(t,r,o,s){this.tag=t,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tn(t,r,o,s){return new za(t,r,o,s)}function Ld(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Pa(t,r){var o=t.alternate;return o===null?(o=Tn(t.tag,r,t.key,t.mode),o.elementType=t.elementType,o.type=t.type,o.stateNode=t.stateNode,o.alternate=t,t.alternate=o):(o.pendingProps=r,o.type=t.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=t.flags&65011712,o.childLanes=t.childLanes,o.lanes=t.lanes,o.child=t.child,o.memoizedProps=t.memoizedProps,o.memoizedState=t.memoizedState,o.updateQueue=t.updateQueue,r=t.dependencies,o.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},o.sibling=t.sibling,o.index=t.index,o.ref=t.ref,o.refCleanup=t.refCleanup,o}function ag(t,r){t.flags&=65011714;var o=t.alternate;return o===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=o.childLanes,t.lanes=o.lanes,t.child=o.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=o.memoizedProps,t.memoizedState=o.memoizedState,t.updateQueue=o.updateQueue,t.type=o.type,r=o.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function wc(t,r,o,s,d,m){var E=0;if(s=t,typeof t=="function")Ld(t)&&(E=1);else if(typeof t=="string")E=dT(t,o,ce.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Oe:return t=Tn(31,o,r,d),t.elementType=Oe,t.lanes=m,t;case A:return co(o.children,d,m,r);case j:E=8,d|=24;break;case N:return t=Tn(12,o,r,d|2),t.elementType=N,t.lanes=m,t;case ee:return t=Tn(13,o,r,d),t.elementType=ee,t.lanes=m,t;case fe:return t=Tn(19,o,r,d),t.elementType=fe,t.lanes=m,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case P:case L:E=10;break e;case H:E=9;break e;case ae:E=11;break e;case ue:E=14;break e;case le:E=16,s=null;break e}E=29,o=Error(i(130,t===null?"null":typeof t,"")),s=null}return r=Tn(E,o,r,d),r.elementType=t,r.type=s,r.lanes=m,r}function co(t,r,o,s){return t=Tn(7,t,s,r),t.lanes=o,t}function Bd(t,r,o){return t=Tn(6,t,null,r),t.lanes=o,t}function Ud(t,r,o){return r=Tn(4,t.children!==null?t.children:[],t.key,r),r.lanes=o,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var fs=[],ds=0,Sc=null,Ec=0,vr=[],br=0,fo=null,La=1,Ba="";function ho(t,r){fs[ds++]=Ec,fs[ds++]=Sc,Sc=t,Ec=r}function ig(t,r,o){vr[br++]=La,vr[br++]=Ba,vr[br++]=fo,fo=t;var s=La;t=Ba;var d=32-Pt(s)-1;s&=~(1<<d),o+=1;var m=32-Pt(r)+d;if(30<m){var E=d-d%5;m=(s&(1<<E)-1).toString(32),s>>=E,d-=E,La=1<<32-Pt(r)+d|o<<d|s,Ba=m+t}else La=1<<m|o<<d|s,Ba=t}function Vd(t){t.return!==null&&(ho(t,1),ig(t,1,0))}function Id(t){for(;t===Sc;)Sc=fs[--ds],fs[ds]=null,Ec=fs[--ds],fs[ds]=null;for(;t===fo;)fo=vr[--br],vr[br]=null,Ba=vr[--br],vr[br]=null,La=vr[--br],vr[br]=null}var $n=null,Zt=null,ht=!1,po=null,aa=!1,Hd=Error(i(519));function mo(t){var r=Error(i(418,""));throw Ol(Se(r,t)),Hd}function og(t){var r=t.stateNode,o=t.type,s=t.memoizedProps;switch(r[Gt]=t,r[Je]=s,o){case"dialog":at("cancel",r),at("close",r);break;case"iframe":case"object":case"embed":at("load",r);break;case"video":case"audio":for(o=0;o<Jl.length;o++)at(Jl[o],r);break;case"source":at("error",r);break;case"img":case"image":case"link":at("error",r),at("load",r);break;case"details":at("toggle",r);break;case"input":at("invalid",r),Ta(r,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0),Wi(r);break;case"select":at("invalid",r);break;case"textarea":at("invalid",r),ul(r,s.value,s.defaultValue,s.children),Wi(r)}o=s.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||r.textContent===""+o||s.suppressHydrationWarning===!0||E0(r.textContent,o)?(s.popover!=null&&(at("beforetoggle",r),at("toggle",r)),s.onScroll!=null&&at("scroll",r),s.onScrollEnd!=null&&at("scrollend",r),s.onClick!=null&&(r.onclick=rf),r=!0):r=!1,r||mo(t)}function sg(t){for($n=t.return;$n;)switch($n.tag){case 5:case 13:aa=!1;return;case 27:case 3:aa=!0;return;default:$n=$n.return}}function Rl(t){if(t!==$n)return!1;if(!ht)return sg(t),ht=!0,!1;var r=t.tag,o;if((o=r!==3&&r!==27)&&((o=r===5)&&(o=t.type,o=!(o!=="form"&&o!=="button")||ap(t.type,t.memoizedProps)),o=!o),o&&Zt&&mo(t),sg(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));e:{for(t=t.nextSibling,r=0;t;){if(t.nodeType===8)if(o=t.data,o==="/$"){if(r===0){Zt=Br(t.nextSibling);break e}r--}else o!=="$"&&o!=="$!"&&o!=="$?"||r++;t=t.nextSibling}Zt=null}}else r===27?(r=Zt,Ci(t.type)?(t=lp,lp=null,Zt=t):Zt=r):Zt=$n?Br(t.stateNode.nextSibling):null;return!0}function Cl(){Zt=$n=null,ht=!1}function lg(){var t=po;return t!==null&&(Jn===null?Jn=t:Jn.push.apply(Jn,t),po=null),t}function Ol(t){po===null?po=[t]:po.push(t)}var $d=k(null),yo=null,Ua=null;function hi(t,r,o){I($d,r._currentValue),r._currentValue=o}function Va(t){t._currentValue=$d.current,G($d)}function qd(t,r,o){for(;t!==null;){var s=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,s!==null&&(s.childLanes|=r)):s!==null&&(s.childLanes&r)!==r&&(s.childLanes|=r),t===o)break;t=t.return}}function Zd(t,r,o,s){var d=t.child;for(d!==null&&(d.return=t);d!==null;){var m=d.dependencies;if(m!==null){var E=d.child;m=m.firstContext;e:for(;m!==null;){var C=m;m=d;for(var B=0;B<r.length;B++)if(C.context===r[B]){m.lanes|=o,C=m.alternate,C!==null&&(C.lanes|=o),qd(m.return,o,t),s||(E=null);break e}m=C.next}}else if(d.tag===18){if(E=d.return,E===null)throw Error(i(341));E.lanes|=o,m=E.alternate,m!==null&&(m.lanes|=o),qd(E,o,t),E=null}else E=d.child;if(E!==null)E.return=d;else for(E=d;E!==null;){if(E===t){E=null;break}if(d=E.sibling,d!==null){d.return=E.return,E=d;break}E=E.return}d=E}}function Dl(t,r,o,s){t=null;for(var d=r,m=!1;d!==null;){if(!m){if((d.flags&524288)!==0)m=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var E=d.alternate;if(E===null)throw Error(i(387));if(E=E.memoizedProps,E!==null){var C=d.type;nn(d.pendingProps.value,E.value)||(t!==null?t.push(C):t=[C])}}else if(d===Le.current){if(E=d.alternate,E===null)throw Error(i(387));E.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(t!==null?t.push(iu):t=[iu])}d=d.return}t!==null&&Zd(r,t,o,s),r.flags|=262144}function _c(t){for(t=t.firstContext;t!==null;){if(!nn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function go(t){yo=t,Ua=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function kn(t){return ug(yo,t)}function Tc(t,r){return yo===null&&go(t),ug(t,r)}function ug(t,r){var o=r._currentValue;if(r={context:r,memoizedValue:o,next:null},Ua===null){if(t===null)throw Error(i(308));Ua=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else Ua=Ua.next=r;return o}var f_=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(o,s){t.push(s)}};this.abort=function(){r.aborted=!0,t.forEach(function(o){return o()})}},d_=e.unstable_scheduleCallback,h_=e.unstable_NormalPriority,fn={$$typeof:L,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Kd(){return{controller:new f_,data:new Map,refCount:0}}function jl(t){t.refCount--,t.refCount===0&&d_(h_,function(){t.controller.abort()})}var Ml=null,Yd=0,hs=0,ps=null;function p_(t,r){if(Ml===null){var o=Ml=[];Yd=0,hs=Gh(),ps={status:"pending",value:void 0,then:function(s){o.push(s)}}}return Yd++,r.then(cg,cg),r}function cg(){if(--Yd===0&&Ml!==null){ps!==null&&(ps.status="fulfilled");var t=Ml;Ml=null,hs=0,ps=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function m_(t,r){var o=[],s={status:"pending",value:null,reason:null,then:function(d){o.push(d)}};return t.then(function(){s.status="fulfilled",s.value=r;for(var d=0;d<o.length;d++)(0,o[d])(r)},function(d){for(s.status="rejected",s.reason=d,d=0;d<o.length;d++)(0,o[d])(void 0)}),s}var fg=de.S;de.S=function(t,r){typeof r=="object"&&r!==null&&typeof r.then=="function"&&p_(t,r),fg!==null&&fg(t,r)};var vo=k(null);function Fd(){var t=vo.current;return t!==null?t:At.pooledCache}function Ac(t,r){r===null?I(vo,vo.current):I(vo,r.pool)}function dg(){var t=Fd();return t===null?null:{parent:fn._currentValue,pool:t}}var kl=Error(i(460)),hg=Error(i(474)),Rc=Error(i(542)),Gd={then:function(){}};function pg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Cc(){}function mg(t,r,o){switch(o=t[o],o===void 0?t.push(r):o!==r&&(r.then(Cc,Cc),r=o),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,gg(t),t;default:if(typeof r.status=="string")r.then(Cc,Cc);else{if(t=At,t!==null&&100<t.shellSuspendCounter)throw Error(i(482));t=r,t.status="pending",t.then(function(s){if(r.status==="pending"){var d=r;d.status="fulfilled",d.value=s}},function(s){if(r.status==="pending"){var d=r;d.status="rejected",d.reason=s}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,gg(t),t}throw Nl=r,kl}}var Nl=null;function yg(){if(Nl===null)throw Error(i(459));var t=Nl;return Nl=null,t}function gg(t){if(t===kl||t===Rc)throw Error(i(483))}var pi=!1;function Xd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qd(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function mi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function yi(t,r,o){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,(mt&2)!==0){var d=s.pending;return d===null?r.next=r:(r.next=d.next,d.next=r),s.pending=r,r=Na(t),cn(t,null,o),r}return bn(t,s,r,o),Na(t)}function zl(t,r,o){if(r=r.updateQueue,r!==null&&(r=r.shared,(o&4194048)!==0)){var s=r.lanes;s&=t.pendingLanes,o|=s,r.lanes=o,Fo(t,o)}}function Wd(t,r){var o=t.updateQueue,s=t.alternate;if(s!==null&&(s=s.updateQueue,o===s)){var d=null,m=null;if(o=o.firstBaseUpdate,o!==null){do{var E={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};m===null?d=m=E:m=m.next=E,o=o.next}while(o!==null);m===null?d=m=r:m=m.next=r}else d=m=r;o={baseState:s.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:s.shared,callbacks:s.callbacks},t.updateQueue=o;return}t=o.lastBaseUpdate,t===null?o.firstBaseUpdate=r:t.next=r,o.lastBaseUpdate=r}var Jd=!1;function Pl(){if(Jd){var t=ps;if(t!==null)throw t}}function Ll(t,r,o,s){Jd=!1;var d=t.updateQueue;pi=!1;var m=d.firstBaseUpdate,E=d.lastBaseUpdate,C=d.shared.pending;if(C!==null){d.shared.pending=null;var B=C,re=B.next;B.next=null,E===null?m=re:E.next=re,E=B;var pe=t.alternate;pe!==null&&(pe=pe.updateQueue,C=pe.lastBaseUpdate,C!==E&&(C===null?pe.firstBaseUpdate=re:C.next=re,pe.lastBaseUpdate=B))}if(m!==null){var ge=d.baseState;E=0,pe=re=B=null,C=m;do{var oe=C.lane&-536870913,se=oe!==C.lane;if(se?(lt&oe)===oe:(s&oe)===oe){oe!==0&&oe===hs&&(Jd=!0),pe!==null&&(pe=pe.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var qe=t,Ve=C;oe=r;var xt=o;switch(Ve.tag){case 1:if(qe=Ve.payload,typeof qe=="function"){ge=qe.call(xt,ge,oe);break e}ge=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=Ve.payload,oe=typeof qe=="function"?qe.call(xt,ge,oe):qe,oe==null)break e;ge=v({},ge,oe);break e;case 2:pi=!0}}oe=C.callback,oe!==null&&(t.flags|=64,se&&(t.flags|=8192),se=d.callbacks,se===null?d.callbacks=[oe]:se.push(oe))}else se={lane:oe,tag:C.tag,payload:C.payload,callback:C.callback,next:null},pe===null?(re=pe=se,B=ge):pe=pe.next=se,E|=oe;if(C=C.next,C===null){if(C=d.shared.pending,C===null)break;se=C,C=se.next,se.next=null,d.lastBaseUpdate=se,d.shared.pending=null}}while(!0);pe===null&&(B=ge),d.baseState=B,d.firstBaseUpdate=re,d.lastBaseUpdate=pe,m===null&&(d.shared.lanes=0),_i|=E,t.lanes=E,t.memoizedState=ge}}function vg(t,r){if(typeof t!="function")throw Error(i(191,t));t.call(r)}function bg(t,r){var o=t.callbacks;if(o!==null)for(t.callbacks=null,t=0;t<o.length;t++)vg(o[t],r)}var ms=k(null),Oc=k(0);function xg(t,r){t=Ya,I(Oc,t),I(ms,r),Ya=t|r.baseLanes}function eh(){I(Oc,Ya),I(ms,ms.current)}function th(){Ya=Oc.current,G(ms),G(Oc)}var gi=0,et=null,vt=null,rn=null,Dc=!1,ys=!1,bo=!1,jc=0,Bl=0,gs=null,y_=0;function Xt(){throw Error(i(321))}function nh(t,r){if(r===null)return!1;for(var o=0;o<r.length&&o<t.length;o++)if(!nn(t[o],r[o]))return!1;return!0}function rh(t,r,o,s,d,m){return gi=m,et=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,de.H=t===null||t.memoizedState===null?rv:av,bo=!1,m=o(s,d),bo=!1,ys&&(m=Sg(r,o,s,d)),wg(t),m}function wg(t){de.H=Lc;var r=vt!==null&&vt.next!==null;if(gi=0,rn=vt=et=null,Dc=!1,Bl=0,gs=null,r)throw Error(i(300));t===null||xn||(t=t.dependencies,t!==null&&_c(t)&&(xn=!0))}function Sg(t,r,o,s){et=t;var d=0;do{if(ys&&(gs=null),Bl=0,ys=!1,25<=d)throw Error(i(301));if(d+=1,rn=vt=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}de.H=E_,m=r(o,s)}while(ys);return m}function g_(){var t=de.H,r=t.useState()[0];return r=typeof r.then=="function"?Ul(r):r,t=t.useState()[0],(vt!==null?vt.memoizedState:null)!==t&&(et.flags|=1024),r}function ah(){var t=jc!==0;return jc=0,t}function ih(t,r,o){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~o}function oh(t){if(Dc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Dc=!1}gi=0,rn=vt=et=null,ys=!1,Bl=jc=0,gs=null}function Qn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?et.memoizedState=rn=t:rn=rn.next=t,rn}function an(){if(vt===null){var t=et.alternate;t=t!==null?t.memoizedState:null}else t=vt.next;var r=rn===null?et.memoizedState:rn.next;if(r!==null)rn=r,vt=t;else{if(t===null)throw et.alternate===null?Error(i(467)):Error(i(310));vt=t,t={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},rn===null?et.memoizedState=rn=t:rn=rn.next=t}return rn}function sh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ul(t){var r=Bl;return Bl+=1,gs===null&&(gs=[]),t=mg(gs,t,r),r=et,(rn===null?r.memoizedState:rn.next)===null&&(r=r.alternate,de.H=r===null||r.memoizedState===null?rv:av),t}function Mc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ul(t);if(t.$$typeof===L)return kn(t)}throw Error(i(438,String(t)))}function lh(t){var r=null,o=et.updateQueue;if(o!==null&&(r=o.memoCache),r==null){var s=et.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(r={data:s.data.map(function(d){return d.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),o===null&&(o=sh(),et.updateQueue=o),o.memoCache=r,o=r.data[r.index],o===void 0)for(o=r.data[r.index]=Array(t),s=0;s<t;s++)o[s]=Be;return r.index++,o}function Ia(t,r){return typeof r=="function"?r(t):r}function kc(t){var r=an();return uh(r,vt,t)}function uh(t,r,o){var s=t.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=o;var d=t.baseQueue,m=s.pending;if(m!==null){if(d!==null){var E=d.next;d.next=m.next,m.next=E}r.baseQueue=d=m,s.pending=null}if(m=t.baseState,d===null)t.memoizedState=m;else{r=d.next;var C=E=null,B=null,re=r,pe=!1;do{var ge=re.lane&-536870913;if(ge!==re.lane?(lt&ge)===ge:(gi&ge)===ge){var oe=re.revertLane;if(oe===0)B!==null&&(B=B.next={lane:0,revertLane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),ge===hs&&(pe=!0);else if((gi&oe)===oe){re=re.next,oe===hs&&(pe=!0);continue}else ge={lane:0,revertLane:re.revertLane,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},B===null?(C=B=ge,E=m):B=B.next=ge,et.lanes|=oe,_i|=oe;ge=re.action,bo&&o(m,ge),m=re.hasEagerState?re.eagerState:o(m,ge)}else oe={lane:ge,revertLane:re.revertLane,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},B===null?(C=B=oe,E=m):B=B.next=oe,et.lanes|=ge,_i|=ge;re=re.next}while(re!==null&&re!==r);if(B===null?E=m:B.next=C,!nn(m,t.memoizedState)&&(xn=!0,pe&&(o=ps,o!==null)))throw o;t.memoizedState=m,t.baseState=E,t.baseQueue=B,s.lastRenderedState=m}return d===null&&(s.lanes=0),[t.memoizedState,s.dispatch]}function ch(t){var r=an(),o=r.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=t;var s=o.dispatch,d=o.pending,m=r.memoizedState;if(d!==null){o.pending=null;var E=d=d.next;do m=t(m,E.action),E=E.next;while(E!==d);nn(m,r.memoizedState)||(xn=!0),r.memoizedState=m,r.baseQueue===null&&(r.baseState=m),o.lastRenderedState=m}return[m,s]}function Eg(t,r,o){var s=et,d=an(),m=ht;if(m){if(o===void 0)throw Error(i(407));o=o()}else o=r();var E=!nn((vt||d).memoizedState,o);E&&(d.memoizedState=o,xn=!0),d=d.queue;var C=Ag.bind(null,s,d,t);if(Vl(2048,8,C,[t]),d.getSnapshot!==r||E||rn!==null&&rn.memoizedState.tag&1){if(s.flags|=2048,vs(9,Nc(),Tg.bind(null,s,d,o,r),null),At===null)throw Error(i(349));m||(gi&124)!==0||_g(s,r,o)}return o}function _g(t,r,o){t.flags|=16384,t={getSnapshot:r,value:o},r=et.updateQueue,r===null?(r=sh(),et.updateQueue=r,r.stores=[t]):(o=r.stores,o===null?r.stores=[t]:o.push(t))}function Tg(t,r,o,s){r.value=o,r.getSnapshot=s,Rg(r)&&Cg(t)}function Ag(t,r,o){return o(function(){Rg(r)&&Cg(t)})}function Rg(t){var r=t.getSnapshot;t=t.value;try{var o=r();return!nn(t,o)}catch{return!0}}function Cg(t){var r=Bt(t,2);r!==null&&fr(r,t,2)}function fh(t){var r=Qn();if(typeof t=="function"){var o=t;if(t=o(),bo){Mn(!0);try{o()}finally{Mn(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:t},r}function Og(t,r,o,s){return t.baseState=o,uh(t,vt,typeof s=="function"?s:Ia)}function v_(t,r,o,s,d){if(Pc(t))throw Error(i(485));if(t=r.action,t!==null){var m={payload:d,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){m.listeners.push(E)}};de.T!==null?o(!0):m.isTransition=!1,s(m),o=r.pending,o===null?(m.next=r.pending=m,Dg(r,m)):(m.next=o.next,r.pending=o.next=m)}}function Dg(t,r){var o=r.action,s=r.payload,d=t.state;if(r.isTransition){var m=de.T,E={};de.T=E;try{var C=o(d,s),B=de.S;B!==null&&B(E,C),jg(t,r,C)}catch(re){dh(t,r,re)}finally{de.T=m}}else try{m=o(d,s),jg(t,r,m)}catch(re){dh(t,r,re)}}function jg(t,r,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(s){Mg(t,r,s)},function(s){return dh(t,r,s)}):Mg(t,r,o)}function Mg(t,r,o){r.status="fulfilled",r.value=o,kg(r),t.state=o,r=t.pending,r!==null&&(o=r.next,o===r?t.pending=null:(o=o.next,r.next=o,Dg(t,o)))}function dh(t,r,o){var s=t.pending;if(t.pending=null,s!==null){s=s.next;do r.status="rejected",r.reason=o,kg(r),r=r.next;while(r!==s)}t.action=null}function kg(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function Ng(t,r){return r}function zg(t,r){if(ht){var o=At.formState;if(o!==null){e:{var s=et;if(ht){if(Zt){t:{for(var d=Zt,m=aa;d.nodeType!==8;){if(!m){d=null;break t}if(d=Br(d.nextSibling),d===null){d=null;break t}}m=d.data,d=m==="F!"||m==="F"?d:null}if(d){Zt=Br(d.nextSibling),s=d.data==="F!";break e}}mo(s)}s=!1}s&&(r=o[0])}}return o=Qn(),o.memoizedState=o.baseState=r,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ng,lastRenderedState:r},o.queue=s,o=ev.bind(null,et,s),s.dispatch=o,s=fh(!1),m=gh.bind(null,et,!1,s.queue),s=Qn(),d={state:r,dispatch:null,action:t,pending:null},s.queue=d,o=v_.bind(null,et,d,m,o),d.dispatch=o,s.memoizedState=t,[r,o,!1]}function Pg(t){var r=an();return Lg(r,vt,t)}function Lg(t,r,o){if(r=uh(t,r,Ng)[0],t=kc(Ia)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var s=Ul(r)}catch(E){throw E===kl?Rc:E}else s=r;r=an();var d=r.queue,m=d.dispatch;return o!==r.memoizedState&&(et.flags|=2048,vs(9,Nc(),b_.bind(null,d,o),null)),[s,m,t]}function b_(t,r){t.action=r}function Bg(t){var r=an(),o=vt;if(o!==null)return Lg(r,o,t);an(),r=r.memoizedState,o=an();var s=o.queue.dispatch;return o.memoizedState=t,[r,s,!1]}function vs(t,r,o,s){return t={tag:t,create:o,deps:s,inst:r,next:null},r=et.updateQueue,r===null&&(r=sh(),et.updateQueue=r),o=r.lastEffect,o===null?r.lastEffect=t.next=t:(s=o.next,o.next=t,t.next=s,r.lastEffect=t),t}function Nc(){return{destroy:void 0,resource:void 0}}function Ug(){return an().memoizedState}function zc(t,r,o,s){var d=Qn();s=s===void 0?null:s,et.flags|=t,d.memoizedState=vs(1|r,Nc(),o,s)}function Vl(t,r,o,s){var d=an();s=s===void 0?null:s;var m=d.memoizedState.inst;vt!==null&&s!==null&&nh(s,vt.memoizedState.deps)?d.memoizedState=vs(r,m,o,s):(et.flags|=t,d.memoizedState=vs(1|r,m,o,s))}function Vg(t,r){zc(8390656,8,t,r)}function Ig(t,r){Vl(2048,8,t,r)}function Hg(t,r){return Vl(4,2,t,r)}function $g(t,r){return Vl(4,4,t,r)}function qg(t,r){if(typeof r=="function"){t=t();var o=r(t);return function(){typeof o=="function"?o():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function Zg(t,r,o){o=o!=null?o.concat([t]):null,Vl(4,4,qg.bind(null,r,t),o)}function hh(){}function Kg(t,r){var o=an();r=r===void 0?null:r;var s=o.memoizedState;return r!==null&&nh(r,s[1])?s[0]:(o.memoizedState=[t,r],t)}function Yg(t,r){var o=an();r=r===void 0?null:r;var s=o.memoizedState;if(r!==null&&nh(r,s[1]))return s[0];if(s=t(),bo){Mn(!0);try{t()}finally{Mn(!1)}}return o.memoizedState=[s,r],s}function ph(t,r,o){return o===void 0||(gi&1073741824)!==0?t.memoizedState=r:(t.memoizedState=o,t=Xv(),et.lanes|=t,_i|=t,o)}function Fg(t,r,o,s){return nn(o,r)?o:ms.current!==null?(t=ph(t,o,s),nn(t,r)||(xn=!0),t):(gi&42)===0?(xn=!0,t.memoizedState=o):(t=Xv(),et.lanes|=t,_i|=t,r)}function Gg(t,r,o,s,d){var m=be.p;be.p=m!==0&&8>m?m:8;var E=de.T,C={};de.T=C,gh(t,!1,r,o);try{var B=d(),re=de.S;if(re!==null&&re(C,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var pe=m_(B,s);Il(t,r,pe,cr(t))}else Il(t,r,s,cr(t))}catch(ge){Il(t,r,{then:function(){},status:"rejected",reason:ge},cr())}finally{be.p=m,de.T=E}}function x_(){}function mh(t,r,o,s){if(t.tag!==5)throw Error(i(476));var d=Xg(t).queue;Gg(t,d,r,Me,o===null?x_:function(){return Qg(t),o(s)})}function Xg(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Me,baseState:Me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:Me},next:null};var o={};return r.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:o},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function Qg(t){var r=Xg(t).next.queue;Il(t,r,{},cr())}function yh(){return kn(iu)}function Wg(){return an().memoizedState}function Jg(){return an().memoizedState}function w_(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var o=cr();t=mi(o);var s=yi(r,t,o);s!==null&&(fr(s,r,o),zl(s,r,o)),r={cache:Kd()},t.payload=r;return}r=r.return}}function S_(t,r,o){var s=cr();o={lane:s,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},Pc(t)?tv(r,o):(o=Ye(t,r,o,s),o!==null&&(fr(o,t,s),nv(o,r,s)))}function ev(t,r,o){var s=cr();Il(t,r,o,s)}function Il(t,r,o,s){var d={lane:s,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(Pc(t))tv(r,d);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=r.lastRenderedReducer,m!==null))try{var E=r.lastRenderedState,C=m(E,o);if(d.hasEagerState=!0,d.eagerState=C,nn(C,E))return bn(t,r,d,0),At===null&&Ge(),!1}catch{}finally{}if(o=Ye(t,r,d,s),o!==null)return fr(o,t,s),nv(o,r,s),!0}return!1}function gh(t,r,o,s){if(s={lane:2,revertLane:Gh(),action:s,hasEagerState:!1,eagerState:null,next:null},Pc(t)){if(r)throw Error(i(479))}else r=Ye(t,o,s,2),r!==null&&fr(r,t,2)}function Pc(t){var r=t.alternate;return t===et||r!==null&&r===et}function tv(t,r){ys=Dc=!0;var o=t.pending;o===null?r.next=r:(r.next=o.next,o.next=r),t.pending=r}function nv(t,r,o){if((o&4194048)!==0){var s=r.lanes;s&=t.pendingLanes,o|=s,r.lanes=o,Fo(t,o)}}var Lc={readContext:kn,use:Mc,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useLayoutEffect:Xt,useInsertionEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useSyncExternalStore:Xt,useId:Xt,useHostTransitionStatus:Xt,useFormState:Xt,useActionState:Xt,useOptimistic:Xt,useMemoCache:Xt,useCacheRefresh:Xt},rv={readContext:kn,use:Mc,useCallback:function(t,r){return Qn().memoizedState=[t,r===void 0?null:r],t},useContext:kn,useEffect:Vg,useImperativeHandle:function(t,r,o){o=o!=null?o.concat([t]):null,zc(4194308,4,qg.bind(null,r,t),o)},useLayoutEffect:function(t,r){return zc(4194308,4,t,r)},useInsertionEffect:function(t,r){zc(4,2,t,r)},useMemo:function(t,r){var o=Qn();r=r===void 0?null:r;var s=t();if(bo){Mn(!0);try{t()}finally{Mn(!1)}}return o.memoizedState=[s,r],s},useReducer:function(t,r,o){var s=Qn();if(o!==void 0){var d=o(r);if(bo){Mn(!0);try{o(r)}finally{Mn(!1)}}}else d=r;return s.memoizedState=s.baseState=d,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:d},s.queue=t,t=t.dispatch=S_.bind(null,et,t),[s.memoizedState,t]},useRef:function(t){var r=Qn();return t={current:t},r.memoizedState=t},useState:function(t){t=fh(t);var r=t.queue,o=ev.bind(null,et,r);return r.dispatch=o,[t.memoizedState,o]},useDebugValue:hh,useDeferredValue:function(t,r){var o=Qn();return ph(o,t,r)},useTransition:function(){var t=fh(!1);return t=Gg.bind(null,et,t.queue,!0,!1),Qn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,o){var s=et,d=Qn();if(ht){if(o===void 0)throw Error(i(407));o=o()}else{if(o=r(),At===null)throw Error(i(349));(lt&124)!==0||_g(s,r,o)}d.memoizedState=o;var m={value:o,getSnapshot:r};return d.queue=m,Vg(Ag.bind(null,s,m,t),[t]),s.flags|=2048,vs(9,Nc(),Tg.bind(null,s,m,o,r),null),o},useId:function(){var t=Qn(),r=At.identifierPrefix;if(ht){var o=Ba,s=La;o=(s&~(1<<32-Pt(s)-1)).toString(32)+o,r="«"+r+"R"+o,o=jc++,0<o&&(r+="H"+o.toString(32)),r+="»"}else o=y_++,r="«"+r+"r"+o.toString(32)+"»";return t.memoizedState=r},useHostTransitionStatus:yh,useFormState:zg,useActionState:zg,useOptimistic:function(t){var r=Qn();r.memoizedState=r.baseState=t;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=o,r=gh.bind(null,et,!0,o),o.dispatch=r,[t,r]},useMemoCache:lh,useCacheRefresh:function(){return Qn().memoizedState=w_.bind(null,et)}},av={readContext:kn,use:Mc,useCallback:Kg,useContext:kn,useEffect:Ig,useImperativeHandle:Zg,useInsertionEffect:Hg,useLayoutEffect:$g,useMemo:Yg,useReducer:kc,useRef:Ug,useState:function(){return kc(Ia)},useDebugValue:hh,useDeferredValue:function(t,r){var o=an();return Fg(o,vt.memoizedState,t,r)},useTransition:function(){var t=kc(Ia)[0],r=an().memoizedState;return[typeof t=="boolean"?t:Ul(t),r]},useSyncExternalStore:Eg,useId:Wg,useHostTransitionStatus:yh,useFormState:Pg,useActionState:Pg,useOptimistic:function(t,r){var o=an();return Og(o,vt,t,r)},useMemoCache:lh,useCacheRefresh:Jg},E_={readContext:kn,use:Mc,useCallback:Kg,useContext:kn,useEffect:Ig,useImperativeHandle:Zg,useInsertionEffect:Hg,useLayoutEffect:$g,useMemo:Yg,useReducer:ch,useRef:Ug,useState:function(){return ch(Ia)},useDebugValue:hh,useDeferredValue:function(t,r){var o=an();return vt===null?ph(o,t,r):Fg(o,vt.memoizedState,t,r)},useTransition:function(){var t=ch(Ia)[0],r=an().memoizedState;return[typeof t=="boolean"?t:Ul(t),r]},useSyncExternalStore:Eg,useId:Wg,useHostTransitionStatus:yh,useFormState:Bg,useActionState:Bg,useOptimistic:function(t,r){var o=an();return vt!==null?Og(o,vt,t,r):(o.baseState=t,[t,o.queue.dispatch])},useMemoCache:lh,useCacheRefresh:Jg},bs=null,Hl=0;function Bc(t){var r=Hl;return Hl+=1,bs===null&&(bs=[]),mg(bs,t,r)}function $l(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function Uc(t,r){throw r.$$typeof===w?Error(i(525)):(t=Object.prototype.toString.call(r),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function iv(t){var r=t._init;return r(t._payload)}function ov(t){function r(W,K){if(t){var ne=W.deletions;ne===null?(W.deletions=[K],W.flags|=16):ne.push(K)}}function o(W,K){if(!t)return null;for(;K!==null;)r(W,K),K=K.sibling;return null}function s(W){for(var K=new Map;W!==null;)W.key!==null?K.set(W.key,W):K.set(W.index,W),W=W.sibling;return K}function d(W,K){return W=Pa(W,K),W.index=0,W.sibling=null,W}function m(W,K,ne){return W.index=ne,t?(ne=W.alternate,ne!==null?(ne=ne.index,ne<K?(W.flags|=67108866,K):ne):(W.flags|=67108866,K)):(W.flags|=1048576,K)}function E(W){return t&&W.alternate===null&&(W.flags|=67108866),W}function C(W,K,ne,me){return K===null||K.tag!==6?(K=Bd(ne,W.mode,me),K.return=W,K):(K=d(K,ne),K.return=W,K)}function B(W,K,ne,me){var Ne=ne.type;return Ne===A?pe(W,K,ne.props.children,me,ne.key):K!==null&&(K.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===le&&iv(Ne)===K.type)?(K=d(K,ne.props),$l(K,ne),K.return=W,K):(K=wc(ne.type,ne.key,ne.props,null,W.mode,me),$l(K,ne),K.return=W,K)}function re(W,K,ne,me){return K===null||K.tag!==4||K.stateNode.containerInfo!==ne.containerInfo||K.stateNode.implementation!==ne.implementation?(K=Ud(ne,W.mode,me),K.return=W,K):(K=d(K,ne.children||[]),K.return=W,K)}function pe(W,K,ne,me,Ne){return K===null||K.tag!==7?(K=co(ne,W.mode,me,Ne),K.return=W,K):(K=d(K,ne),K.return=W,K)}function ge(W,K,ne){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=Bd(""+K,W.mode,ne),K.return=W,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case _:return ne=wc(K.type,K.key,K.props,null,W.mode,ne),$l(ne,K),ne.return=W,ne;case O:return K=Ud(K,W.mode,ne),K.return=W,K;case le:var me=K._init;return K=me(K._payload),ge(W,K,ne)}if(ut(K)||it(K))return K=co(K,W.mode,ne,null),K.return=W,K;if(typeof K.then=="function")return ge(W,Bc(K),ne);if(K.$$typeof===L)return ge(W,Tc(W,K),ne);Uc(W,K)}return null}function oe(W,K,ne,me){var Ne=K!==null?K.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Ne!==null?null:C(W,K,""+ne,me);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case _:return ne.key===Ne?B(W,K,ne,me):null;case O:return ne.key===Ne?re(W,K,ne,me):null;case le:return Ne=ne._init,ne=Ne(ne._payload),oe(W,K,ne,me)}if(ut(ne)||it(ne))return Ne!==null?null:pe(W,K,ne,me,null);if(typeof ne.then=="function")return oe(W,K,Bc(ne),me);if(ne.$$typeof===L)return oe(W,K,Tc(W,ne),me);Uc(W,ne)}return null}function se(W,K,ne,me,Ne){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return W=W.get(ne)||null,C(K,W,""+me,Ne);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case _:return W=W.get(me.key===null?ne:me.key)||null,B(K,W,me,Ne);case O:return W=W.get(me.key===null?ne:me.key)||null,re(K,W,me,Ne);case le:var tt=me._init;return me=tt(me._payload),se(W,K,ne,me,Ne)}if(ut(me)||it(me))return W=W.get(ne)||null,pe(K,W,me,Ne,null);if(typeof me.then=="function")return se(W,K,ne,Bc(me),Ne);if(me.$$typeof===L)return se(W,K,ne,Tc(K,me),Ne);Uc(K,me)}return null}function qe(W,K,ne,me){for(var Ne=null,tt=null,Pe=K,Ie=K=0,Sn=null;Pe!==null&&Ie<ne.length;Ie++){Pe.index>Ie?(Sn=Pe,Pe=null):Sn=Pe.sibling;var dt=oe(W,Pe,ne[Ie],me);if(dt===null){Pe===null&&(Pe=Sn);break}t&&Pe&&dt.alternate===null&&r(W,Pe),K=m(dt,K,Ie),tt===null?Ne=dt:tt.sibling=dt,tt=dt,Pe=Sn}if(Ie===ne.length)return o(W,Pe),ht&&ho(W,Ie),Ne;if(Pe===null){for(;Ie<ne.length;Ie++)Pe=ge(W,ne[Ie],me),Pe!==null&&(K=m(Pe,K,Ie),tt===null?Ne=Pe:tt.sibling=Pe,tt=Pe);return ht&&ho(W,Ie),Ne}for(Pe=s(Pe);Ie<ne.length;Ie++)Sn=se(Pe,W,Ie,ne[Ie],me),Sn!==null&&(t&&Sn.alternate!==null&&Pe.delete(Sn.key===null?Ie:Sn.key),K=m(Sn,K,Ie),tt===null?Ne=Sn:tt.sibling=Sn,tt=Sn);return t&&Pe.forEach(function(ki){return r(W,ki)}),ht&&ho(W,Ie),Ne}function Ve(W,K,ne,me){if(ne==null)throw Error(i(151));for(var Ne=null,tt=null,Pe=K,Ie=K=0,Sn=null,dt=ne.next();Pe!==null&&!dt.done;Ie++,dt=ne.next()){Pe.index>Ie?(Sn=Pe,Pe=null):Sn=Pe.sibling;var ki=oe(W,Pe,dt.value,me);if(ki===null){Pe===null&&(Pe=Sn);break}t&&Pe&&ki.alternate===null&&r(W,Pe),K=m(ki,K,Ie),tt===null?Ne=ki:tt.sibling=ki,tt=ki,Pe=Sn}if(dt.done)return o(W,Pe),ht&&ho(W,Ie),Ne;if(Pe===null){for(;!dt.done;Ie++,dt=ne.next())dt=ge(W,dt.value,me),dt!==null&&(K=m(dt,K,Ie),tt===null?Ne=dt:tt.sibling=dt,tt=dt);return ht&&ho(W,Ie),Ne}for(Pe=s(Pe);!dt.done;Ie++,dt=ne.next())dt=se(Pe,W,Ie,dt.value,me),dt!==null&&(t&&dt.alternate!==null&&Pe.delete(dt.key===null?Ie:dt.key),K=m(dt,K,Ie),tt===null?Ne=dt:tt.sibling=dt,tt=dt);return t&&Pe.forEach(function(_T){return r(W,_T)}),ht&&ho(W,Ie),Ne}function xt(W,K,ne,me){if(typeof ne=="object"&&ne!==null&&ne.type===A&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case _:e:{for(var Ne=ne.key;K!==null;){if(K.key===Ne){if(Ne=ne.type,Ne===A){if(K.tag===7){o(W,K.sibling),me=d(K,ne.props.children),me.return=W,W=me;break e}}else if(K.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===le&&iv(Ne)===K.type){o(W,K.sibling),me=d(K,ne.props),$l(me,ne),me.return=W,W=me;break e}o(W,K);break}else r(W,K);K=K.sibling}ne.type===A?(me=co(ne.props.children,W.mode,me,ne.key),me.return=W,W=me):(me=wc(ne.type,ne.key,ne.props,null,W.mode,me),$l(me,ne),me.return=W,W=me)}return E(W);case O:e:{for(Ne=ne.key;K!==null;){if(K.key===Ne)if(K.tag===4&&K.stateNode.containerInfo===ne.containerInfo&&K.stateNode.implementation===ne.implementation){o(W,K.sibling),me=d(K,ne.children||[]),me.return=W,W=me;break e}else{o(W,K);break}else r(W,K);K=K.sibling}me=Ud(ne,W.mode,me),me.return=W,W=me}return E(W);case le:return Ne=ne._init,ne=Ne(ne._payload),xt(W,K,ne,me)}if(ut(ne))return qe(W,K,ne,me);if(it(ne)){if(Ne=it(ne),typeof Ne!="function")throw Error(i(150));return ne=Ne.call(ne),Ve(W,K,ne,me)}if(typeof ne.then=="function")return xt(W,K,Bc(ne),me);if(ne.$$typeof===L)return xt(W,K,Tc(W,ne),me);Uc(W,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,K!==null&&K.tag===6?(o(W,K.sibling),me=d(K,ne),me.return=W,W=me):(o(W,K),me=Bd(ne,W.mode,me),me.return=W,W=me),E(W)):o(W,K)}return function(W,K,ne,me){try{Hl=0;var Ne=xt(W,K,ne,me);return bs=null,Ne}catch(Pe){if(Pe===kl||Pe===Rc)throw Pe;var tt=Tn(29,Pe,null,W.mode);return tt.lanes=me,tt.return=W,tt}finally{}}}var xs=ov(!0),sv=ov(!1),xr=k(null),ia=null;function vi(t){var r=t.alternate;I(dn,dn.current&1),I(xr,t),ia===null&&(r===null||ms.current!==null||r.memoizedState!==null)&&(ia=t)}function lv(t){if(t.tag===22){if(I(dn,dn.current),I(xr,t),ia===null){var r=t.alternate;r!==null&&r.memoizedState!==null&&(ia=t)}}else bi()}function bi(){I(dn,dn.current),I(xr,xr.current)}function Ha(t){G(xr),ia===t&&(ia=null),G(dn)}var dn=k(0);function Vc(t){for(var r=t;r!==null;){if(r.tag===13){var o=r.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||sp(o)))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}function vh(t,r,o,s){r=t.memoizedState,o=o(s,r),o=o==null?r:v({},r,o),t.memoizedState=o,t.lanes===0&&(t.updateQueue.baseState=o)}var bh={enqueueSetState:function(t,r,o){t=t._reactInternals;var s=cr(),d=mi(s);d.payload=r,o!=null&&(d.callback=o),r=yi(t,d,s),r!==null&&(fr(r,t,s),zl(r,t,s))},enqueueReplaceState:function(t,r,o){t=t._reactInternals;var s=cr(),d=mi(s);d.tag=1,d.payload=r,o!=null&&(d.callback=o),r=yi(t,d,s),r!==null&&(fr(r,t,s),zl(r,t,s))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var o=cr(),s=mi(o);s.tag=2,r!=null&&(s.callback=r),r=yi(t,s,o),r!==null&&(fr(r,t,o),zl(r,t,o))}};function uv(t,r,o,s,d,m,E){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(s,m,E):r.prototype&&r.prototype.isPureReactComponent?!Xn(o,s)||!Xn(d,m):!0}function cv(t,r,o,s){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(o,s),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(o,s),r.state!==t&&bh.enqueueReplaceState(r,r.state,null)}function xo(t,r){var o=r;if("ref"in r){o={};for(var s in r)s!=="ref"&&(o[s]=r[s])}if(t=t.defaultProps){o===r&&(o=v({},o));for(var d in t)o[d]===void 0&&(o[d]=t[d])}return o}var Ic=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function fv(t){Ic(t)}function dv(t){console.error(t)}function hv(t){Ic(t)}function Hc(t,r){try{var o=t.onUncaughtError;o(r.value,{componentStack:r.stack})}catch(s){setTimeout(function(){throw s})}}function pv(t,r,o){try{var s=t.onCaughtError;s(o.value,{componentStack:o.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function xh(t,r,o){return o=mi(o),o.tag=3,o.payload={element:null},o.callback=function(){Hc(t,r)},o}function mv(t){return t=mi(t),t.tag=3,t}function yv(t,r,o,s){var d=o.type.getDerivedStateFromError;if(typeof d=="function"){var m=s.value;t.payload=function(){return d(m)},t.callback=function(){pv(r,o,s)}}var E=o.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(t.callback=function(){pv(r,o,s),typeof d!="function"&&(Ti===null?Ti=new Set([this]):Ti.add(this));var C=s.stack;this.componentDidCatch(s.value,{componentStack:C!==null?C:""})})}function __(t,r,o,s,d){if(o.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(r=o.alternate,r!==null&&Dl(r,o,d,!0),o=xr.current,o!==null){switch(o.tag){case 13:return ia===null?qh():o.alternate===null&&Kt===0&&(Kt=3),o.flags&=-257,o.flags|=65536,o.lanes=d,s===Gd?o.flags|=16384:(r=o.updateQueue,r===null?o.updateQueue=new Set([s]):r.add(s),Kh(t,s,d)),!1;case 22:return o.flags|=65536,s===Gd?o.flags|=16384:(r=o.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([s])},o.updateQueue=r):(o=r.retryQueue,o===null?r.retryQueue=new Set([s]):o.add(s)),Kh(t,s,d)),!1}throw Error(i(435,o.tag))}return Kh(t,s,d),qh(),!1}if(ht)return r=xr.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=d,s!==Hd&&(t=Error(i(422),{cause:s}),Ol(Se(t,o)))):(s!==Hd&&(r=Error(i(423),{cause:s}),Ol(Se(r,o))),t=t.current.alternate,t.flags|=65536,d&=-d,t.lanes|=d,s=Se(s,o),d=xh(t.stateNode,s,d),Wd(t,d),Kt!==4&&(Kt=2)),!1;var m=Error(i(520),{cause:s});if(m=Se(m,o),Xl===null?Xl=[m]:Xl.push(m),Kt!==4&&(Kt=2),r===null)return!0;s=Se(s,o),o=r;do{switch(o.tag){case 3:return o.flags|=65536,t=d&-d,o.lanes|=t,t=xh(o.stateNode,s,t),Wd(o,t),!1;case 1:if(r=o.type,m=o.stateNode,(o.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Ti===null||!Ti.has(m))))return o.flags|=65536,d&=-d,o.lanes|=d,d=mv(d),yv(d,t,o,s),Wd(o,d),!1}o=o.return}while(o!==null);return!1}var gv=Error(i(461)),xn=!1;function An(t,r,o,s){r.child=t===null?sv(r,null,o,s):xs(r,t.child,o,s)}function vv(t,r,o,s,d){o=o.render;var m=r.ref;if("ref"in s){var E={};for(var C in s)C!=="ref"&&(E[C]=s[C])}else E=s;return go(r),s=rh(t,r,o,E,m,d),C=ah(),t!==null&&!xn?(ih(t,r,d),$a(t,r,d)):(ht&&C&&Vd(r),r.flags|=1,An(t,r,s,d),r.child)}function bv(t,r,o,s,d){if(t===null){var m=o.type;return typeof m=="function"&&!Ld(m)&&m.defaultProps===void 0&&o.compare===null?(r.tag=15,r.type=m,xv(t,r,m,s,d)):(t=wc(o.type,null,s,r,r.mode,d),t.ref=r.ref,t.return=r,r.child=t)}if(m=t.child,!Ch(t,d)){var E=m.memoizedProps;if(o=o.compare,o=o!==null?o:Xn,o(E,s)&&t.ref===r.ref)return $a(t,r,d)}return r.flags|=1,t=Pa(m,s),t.ref=r.ref,t.return=r,r.child=t}function xv(t,r,o,s,d){if(t!==null){var m=t.memoizedProps;if(Xn(m,s)&&t.ref===r.ref)if(xn=!1,r.pendingProps=s=m,Ch(t,d))(t.flags&131072)!==0&&(xn=!0);else return r.lanes=t.lanes,$a(t,r,d)}return wh(t,r,o,s,d)}function wv(t,r,o){var s=r.pendingProps,d=s.children,m=t!==null?t.memoizedState:null;if(s.mode==="hidden"){if((r.flags&128)!==0){if(s=m!==null?m.baseLanes|o:o,t!==null){for(d=r.child=t.child,m=0;d!==null;)m=m|d.lanes|d.childLanes,d=d.sibling;r.childLanes=m&~s}else r.childLanes=0,r.child=null;return Sv(t,r,s,o)}if((o&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ac(r,m!==null?m.cachePool:null),m!==null?xg(r,m):eh(),lv(r);else return r.lanes=r.childLanes=536870912,Sv(t,r,m!==null?m.baseLanes|o:o,o)}else m!==null?(Ac(r,m.cachePool),xg(r,m),bi(),r.memoizedState=null):(t!==null&&Ac(r,null),eh(),bi());return An(t,r,d,o),r.child}function Sv(t,r,o,s){var d=Fd();return d=d===null?null:{parent:fn._currentValue,pool:d},r.memoizedState={baseLanes:o,cachePool:d},t!==null&&Ac(r,null),eh(),lv(r),t!==null&&Dl(t,r,s,!0),null}function $c(t,r){var o=r.ref;if(o===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(i(284));(t===null||t.ref!==o)&&(r.flags|=4194816)}}function wh(t,r,o,s,d){return go(r),o=rh(t,r,o,s,void 0,d),s=ah(),t!==null&&!xn?(ih(t,r,d),$a(t,r,d)):(ht&&s&&Vd(r),r.flags|=1,An(t,r,o,d),r.child)}function Ev(t,r,o,s,d,m){return go(r),r.updateQueue=null,o=Sg(r,s,o,d),wg(t),s=ah(),t!==null&&!xn?(ih(t,r,m),$a(t,r,m)):(ht&&s&&Vd(r),r.flags|=1,An(t,r,o,m),r.child)}function _v(t,r,o,s,d){if(go(r),r.stateNode===null){var m=qt,E=o.contextType;typeof E=="object"&&E!==null&&(m=kn(E)),m=new o(s,m),r.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=bh,r.stateNode=m,m._reactInternals=r,m=r.stateNode,m.props=s,m.state=r.memoizedState,m.refs={},Xd(r),E=o.contextType,m.context=typeof E=="object"&&E!==null?kn(E):qt,m.state=r.memoizedState,E=o.getDerivedStateFromProps,typeof E=="function"&&(vh(r,o,E,s),m.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(E=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),E!==m.state&&bh.enqueueReplaceState(m,m.state,null),Ll(r,s,m,d),Pl(),m.state=r.memoizedState),typeof m.componentDidMount=="function"&&(r.flags|=4194308),s=!0}else if(t===null){m=r.stateNode;var C=r.memoizedProps,B=xo(o,C);m.props=B;var re=m.context,pe=o.contextType;E=qt,typeof pe=="object"&&pe!==null&&(E=kn(pe));var ge=o.getDerivedStateFromProps;pe=typeof ge=="function"||typeof m.getSnapshotBeforeUpdate=="function",C=r.pendingProps!==C,pe||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(C||re!==E)&&cv(r,m,s,E),pi=!1;var oe=r.memoizedState;m.state=oe,Ll(r,s,m,d),Pl(),re=r.memoizedState,C||oe!==re||pi?(typeof ge=="function"&&(vh(r,o,ge,s),re=r.memoizedState),(B=pi||uv(r,o,B,s,oe,re,E))?(pe||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(r.flags|=4194308)):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=s,r.memoizedState=re),m.props=s,m.state=re,m.context=E,s=B):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),s=!1)}else{m=r.stateNode,Qd(t,r),E=r.memoizedProps,pe=xo(o,E),m.props=pe,ge=r.pendingProps,oe=m.context,re=o.contextType,B=qt,typeof re=="object"&&re!==null&&(B=kn(re)),C=o.getDerivedStateFromProps,(re=typeof C=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(E!==ge||oe!==B)&&cv(r,m,s,B),pi=!1,oe=r.memoizedState,m.state=oe,Ll(r,s,m,d),Pl();var se=r.memoizedState;E!==ge||oe!==se||pi||t!==null&&t.dependencies!==null&&_c(t.dependencies)?(typeof C=="function"&&(vh(r,o,C,s),se=r.memoizedState),(pe=pi||uv(r,o,pe,s,oe,se,B)||t!==null&&t.dependencies!==null&&_c(t.dependencies))?(re||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(s,se,B),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(s,se,B)),typeof m.componentDidUpdate=="function"&&(r.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof m.componentDidUpdate!="function"||E===t.memoizedProps&&oe===t.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||E===t.memoizedProps&&oe===t.memoizedState||(r.flags|=1024),r.memoizedProps=s,r.memoizedState=se),m.props=s,m.state=se,m.context=B,s=pe):(typeof m.componentDidUpdate!="function"||E===t.memoizedProps&&oe===t.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||E===t.memoizedProps&&oe===t.memoizedState||(r.flags|=1024),s=!1)}return m=s,$c(t,r),s=(r.flags&128)!==0,m||s?(m=r.stateNode,o=s&&typeof o.getDerivedStateFromError!="function"?null:m.render(),r.flags|=1,t!==null&&s?(r.child=xs(r,t.child,null,d),r.child=xs(r,null,o,d)):An(t,r,o,d),r.memoizedState=m.state,t=r.child):t=$a(t,r,d),t}function Tv(t,r,o,s){return Cl(),r.flags|=256,An(t,r,o,s),r.child}var Sh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Eh(t){return{baseLanes:t,cachePool:dg()}}function _h(t,r,o){return t=t!==null?t.childLanes&~o:0,r&&(t|=wr),t}function Av(t,r,o){var s=r.pendingProps,d=!1,m=(r.flags&128)!==0,E;if((E=m)||(E=t!==null&&t.memoizedState===null?!1:(dn.current&2)!==0),E&&(d=!0,r.flags&=-129),E=(r.flags&32)!==0,r.flags&=-33,t===null){if(ht){if(d?vi(r):bi(),ht){var C=Zt,B;if(B=C){e:{for(B=C,C=aa;B.nodeType!==8;){if(!C){C=null;break e}if(B=Br(B.nextSibling),B===null){C=null;break e}}C=B}C!==null?(r.memoizedState={dehydrated:C,treeContext:fo!==null?{id:La,overflow:Ba}:null,retryLane:536870912,hydrationErrors:null},B=Tn(18,null,null,0),B.stateNode=C,B.return=r,r.child=B,$n=r,Zt=null,B=!0):B=!1}B||mo(r)}if(C=r.memoizedState,C!==null&&(C=C.dehydrated,C!==null))return sp(C)?r.lanes=32:r.lanes=536870912,null;Ha(r)}return C=s.children,s=s.fallback,d?(bi(),d=r.mode,C=qc({mode:"hidden",children:C},d),s=co(s,d,o,null),C.return=r,s.return=r,C.sibling=s,r.child=C,d=r.child,d.memoizedState=Eh(o),d.childLanes=_h(t,E,o),r.memoizedState=Sh,s):(vi(r),Th(r,C))}if(B=t.memoizedState,B!==null&&(C=B.dehydrated,C!==null)){if(m)r.flags&256?(vi(r),r.flags&=-257,r=Ah(t,r,o)):r.memoizedState!==null?(bi(),r.child=t.child,r.flags|=128,r=null):(bi(),d=s.fallback,C=r.mode,s=qc({mode:"visible",children:s.children},C),d=co(d,C,o,null),d.flags|=2,s.return=r,d.return=r,s.sibling=d,r.child=s,xs(r,t.child,null,o),s=r.child,s.memoizedState=Eh(o),s.childLanes=_h(t,E,o),r.memoizedState=Sh,r=d);else if(vi(r),sp(C)){if(E=C.nextSibling&&C.nextSibling.dataset,E)var re=E.dgst;E=re,s=Error(i(419)),s.stack="",s.digest=E,Ol({value:s,source:null,stack:null}),r=Ah(t,r,o)}else if(xn||Dl(t,r,o,!1),E=(o&t.childLanes)!==0,xn||E){if(E=At,E!==null&&(s=o&-o,s=(s&42)!==0?1:rl(s),s=(s&(E.suspendedLanes|o))!==0?0:s,s!==0&&s!==B.retryLane))throw B.retryLane=s,Bt(t,s),fr(E,t,s),gv;C.data==="$?"||qh(),r=Ah(t,r,o)}else C.data==="$?"?(r.flags|=192,r.child=t.child,r=null):(t=B.treeContext,Zt=Br(C.nextSibling),$n=r,ht=!0,po=null,aa=!1,t!==null&&(vr[br++]=La,vr[br++]=Ba,vr[br++]=fo,La=t.id,Ba=t.overflow,fo=r),r=Th(r,s.children),r.flags|=4096);return r}return d?(bi(),d=s.fallback,C=r.mode,B=t.child,re=B.sibling,s=Pa(B,{mode:"hidden",children:s.children}),s.subtreeFlags=B.subtreeFlags&65011712,re!==null?d=Pa(re,d):(d=co(d,C,o,null),d.flags|=2),d.return=r,s.return=r,s.sibling=d,r.child=s,s=d,d=r.child,C=t.child.memoizedState,C===null?C=Eh(o):(B=C.cachePool,B!==null?(re=fn._currentValue,B=B.parent!==re?{parent:re,pool:re}:B):B=dg(),C={baseLanes:C.baseLanes|o,cachePool:B}),d.memoizedState=C,d.childLanes=_h(t,E,o),r.memoizedState=Sh,s):(vi(r),o=t.child,t=o.sibling,o=Pa(o,{mode:"visible",children:s.children}),o.return=r,o.sibling=null,t!==null&&(E=r.deletions,E===null?(r.deletions=[t],r.flags|=16):E.push(t)),r.child=o,r.memoizedState=null,o)}function Th(t,r){return r=qc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function qc(t,r){return t=Tn(22,t,null,r),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function Ah(t,r,o){return xs(r,t.child,null,o),t=Th(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function Rv(t,r,o){t.lanes|=r;var s=t.alternate;s!==null&&(s.lanes|=r),qd(t.return,r,o)}function Rh(t,r,o,s,d){var m=t.memoizedState;m===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:s,tail:o,tailMode:d}:(m.isBackwards=r,m.rendering=null,m.renderingStartTime=0,m.last=s,m.tail=o,m.tailMode=d)}function Cv(t,r,o){var s=r.pendingProps,d=s.revealOrder,m=s.tail;if(An(t,r,s.children,o),s=dn.current,(s&2)!==0)s=s&1|2,r.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Rv(t,o,r);else if(t.tag===19)Rv(t,o,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}s&=1}switch(I(dn,s),d){case"forwards":for(o=r.child,d=null;o!==null;)t=o.alternate,t!==null&&Vc(t)===null&&(d=o),o=o.sibling;o=d,o===null?(d=r.child,r.child=null):(d=o.sibling,o.sibling=null),Rh(r,!1,d,o,m);break;case"backwards":for(o=null,d=r.child,r.child=null;d!==null;){if(t=d.alternate,t!==null&&Vc(t)===null){r.child=d;break}t=d.sibling,d.sibling=o,o=d,d=t}Rh(r,!0,o,null,m);break;case"together":Rh(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function $a(t,r,o){if(t!==null&&(r.dependencies=t.dependencies),_i|=r.lanes,(o&r.childLanes)===0)if(t!==null){if(Dl(t,r,o,!1),(o&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(i(153));if(r.child!==null){for(t=r.child,o=Pa(t,t.pendingProps),r.child=o,o.return=r;t.sibling!==null;)t=t.sibling,o=o.sibling=Pa(t,t.pendingProps),o.return=r;o.sibling=null}return r.child}function Ch(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&_c(t)))}function T_(t,r,o){switch(r.tag){case 3:ze(r,r.stateNode.containerInfo),hi(r,fn,t.memoizedState.cache),Cl();break;case 27:case 5:mn(r);break;case 4:ze(r,r.stateNode.containerInfo);break;case 10:hi(r,r.type,r.memoizedProps.value);break;case 13:var s=r.memoizedState;if(s!==null)return s.dehydrated!==null?(vi(r),r.flags|=128,null):(o&r.child.childLanes)!==0?Av(t,r,o):(vi(r),t=$a(t,r,o),t!==null?t.sibling:null);vi(r);break;case 19:var d=(t.flags&128)!==0;if(s=(o&r.childLanes)!==0,s||(Dl(t,r,o,!1),s=(o&r.childLanes)!==0),d){if(s)return Cv(t,r,o);r.flags|=128}if(d=r.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),I(dn,dn.current),s)break;return null;case 22:case 23:return r.lanes=0,wv(t,r,o);case 24:hi(r,fn,t.memoizedState.cache)}return $a(t,r,o)}function Ov(t,r,o){if(t!==null)if(t.memoizedProps!==r.pendingProps)xn=!0;else{if(!Ch(t,o)&&(r.flags&128)===0)return xn=!1,T_(t,r,o);xn=(t.flags&131072)!==0}else xn=!1,ht&&(r.flags&1048576)!==0&&ig(r,Ec,r.index);switch(r.lanes=0,r.tag){case 16:e:{t=r.pendingProps;var s=r.elementType,d=s._init;if(s=d(s._payload),r.type=s,typeof s=="function")Ld(s)?(t=xo(s,t),r.tag=1,r=_v(null,r,s,t,o)):(r.tag=0,r=wh(null,r,s,t,o));else{if(s!=null){if(d=s.$$typeof,d===ae){r.tag=11,r=vv(null,r,s,t,o);break e}else if(d===ue){r.tag=14,r=bv(null,r,s,t,o);break e}}throw r=pn(s)||s,Error(i(306,r,""))}}return r;case 0:return wh(t,r,r.type,r.pendingProps,o);case 1:return s=r.type,d=xo(s,r.pendingProps),_v(t,r,s,d,o);case 3:e:{if(ze(r,r.stateNode.containerInfo),t===null)throw Error(i(387));s=r.pendingProps;var m=r.memoizedState;d=m.element,Qd(t,r),Ll(r,s,null,o);var E=r.memoizedState;if(s=E.cache,hi(r,fn,s),s!==m.cache&&Zd(r,[fn],o,!0),Pl(),s=E.element,m.isDehydrated)if(m={element:s,isDehydrated:!1,cache:E.cache},r.updateQueue.baseState=m,r.memoizedState=m,r.flags&256){r=Tv(t,r,s,o);break e}else if(s!==d){d=Se(Error(i(424)),r),Ol(d),r=Tv(t,r,s,o);break e}else{switch(t=r.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Zt=Br(t.firstChild),$n=r,ht=!0,po=null,aa=!0,o=sv(r,null,s,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(Cl(),s===d){r=$a(t,r,o);break e}An(t,r,s,o)}r=r.child}return r;case 26:return $c(t,r),t===null?(o=k0(r.type,null,r.pendingProps,null))?r.memoizedState=o:ht||(o=r.type,t=r.pendingProps,s=af(_e.current).createElement(o),s[Gt]=r,s[Je]=t,Cn(s,o,t),Et(s),r.stateNode=s):r.memoizedState=k0(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return mn(r),t===null&&ht&&(s=r.stateNode=D0(r.type,r.pendingProps,_e.current),$n=r,aa=!0,d=Zt,Ci(r.type)?(lp=d,Zt=Br(s.firstChild)):Zt=d),An(t,r,r.pendingProps.children,o),$c(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&ht&&((d=s=Zt)&&(s=J_(s,r.type,r.pendingProps,aa),s!==null?(r.stateNode=s,$n=r,Zt=Br(s.firstChild),aa=!1,d=!0):d=!1),d||mo(r)),mn(r),d=r.type,m=r.pendingProps,E=t!==null?t.memoizedProps:null,s=m.children,ap(d,m)?s=null:E!==null&&ap(d,E)&&(r.flags|=32),r.memoizedState!==null&&(d=rh(t,r,g_,null,null,o),iu._currentValue=d),$c(t,r),An(t,r,s,o),r.child;case 6:return t===null&&ht&&((t=o=Zt)&&(o=eT(o,r.pendingProps,aa),o!==null?(r.stateNode=o,$n=r,Zt=null,t=!0):t=!1),t||mo(r)),null;case 13:return Av(t,r,o);case 4:return ze(r,r.stateNode.containerInfo),s=r.pendingProps,t===null?r.child=xs(r,null,s,o):An(t,r,s,o),r.child;case 11:return vv(t,r,r.type,r.pendingProps,o);case 7:return An(t,r,r.pendingProps,o),r.child;case 8:return An(t,r,r.pendingProps.children,o),r.child;case 12:return An(t,r,r.pendingProps.children,o),r.child;case 10:return s=r.pendingProps,hi(r,r.type,s.value),An(t,r,s.children,o),r.child;case 9:return d=r.type._context,s=r.pendingProps.children,go(r),d=kn(d),s=s(d),r.flags|=1,An(t,r,s,o),r.child;case 14:return bv(t,r,r.type,r.pendingProps,o);case 15:return xv(t,r,r.type,r.pendingProps,o);case 19:return Cv(t,r,o);case 31:return s=r.pendingProps,o=r.mode,s={mode:s.mode,children:s.children},t===null?(o=qc(s,o),o.ref=r.ref,r.child=o,o.return=r,r=o):(o=Pa(t.child,s),o.ref=r.ref,r.child=o,o.return=r,r=o),r;case 22:return wv(t,r,o);case 24:return go(r),s=kn(fn),t===null?(d=Fd(),d===null&&(d=At,m=Kd(),d.pooledCache=m,m.refCount++,m!==null&&(d.pooledCacheLanes|=o),d=m),r.memoizedState={parent:s,cache:d},Xd(r),hi(r,fn,d)):((t.lanes&o)!==0&&(Qd(t,r),Ll(r,null,null,o),Pl()),d=t.memoizedState,m=r.memoizedState,d.parent!==s?(d={parent:s,cache:s},r.memoizedState=d,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=d),hi(r,fn,s)):(s=m.cache,hi(r,fn,s),s!==d.cache&&Zd(r,[fn],o,!0))),An(t,r,r.pendingProps.children,o),r.child;case 29:throw r.pendingProps}throw Error(i(156,r.tag))}function qa(t){t.flags|=4}function Dv(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!B0(r)){if(r=xr.current,r!==null&&((lt&4194048)===lt?ia!==null:(lt&62914560)!==lt&&(lt&536870912)===0||r!==ia))throw Nl=Gd,hg;t.flags|=8192}}function Zc(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?De():536870912,t.lanes|=r,_s|=r)}function ql(t,r){if(!ht)switch(t.tailMode){case"hidden":r=t.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?t.tail=null:o.sibling=null;break;case"collapsed":o=t.tail;for(var s=null;o!==null;)o.alternate!==null&&(s=o),o=o.sibling;s===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:s.sibling=null}}function Ut(t){var r=t.alternate!==null&&t.alternate.child===t.child,o=0,s=0;if(r)for(var d=t.child;d!==null;)o|=d.lanes|d.childLanes,s|=d.subtreeFlags&65011712,s|=d.flags&65011712,d.return=t,d=d.sibling;else for(d=t.child;d!==null;)o|=d.lanes|d.childLanes,s|=d.subtreeFlags,s|=d.flags,d.return=t,d=d.sibling;return t.subtreeFlags|=s,t.childLanes=o,r}function A_(t,r,o){var s=r.pendingProps;switch(Id(r),r.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ut(r),null;case 1:return Ut(r),null;case 3:return o=r.stateNode,s=null,t!==null&&(s=t.memoizedState.cache),r.memoizedState.cache!==s&&(r.flags|=2048),Va(fn),je(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(t===null||t.child===null)&&(Rl(r)?qa(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,lg())),Ut(r),null;case 26:return o=r.memoizedState,t===null?(qa(r),o!==null?(Ut(r),Dv(r,o)):(Ut(r),r.flags&=-16777217)):o?o!==t.memoizedState?(qa(r),Ut(r),Dv(r,o)):(Ut(r),r.flags&=-16777217):(t.memoizedProps!==s&&qa(r),Ut(r),r.flags&=-16777217),null;case 27:zt(r),o=_e.current;var d=r.type;if(t!==null&&r.stateNode!=null)t.memoizedProps!==s&&qa(r);else{if(!s){if(r.stateNode===null)throw Error(i(166));return Ut(r),null}t=ce.current,Rl(r)?og(r):(t=D0(d,s,o),r.stateNode=t,qa(r))}return Ut(r),null;case 5:if(zt(r),o=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==s&&qa(r);else{if(!s){if(r.stateNode===null)throw Error(i(166));return Ut(r),null}if(t=ce.current,Rl(r))og(r);else{switch(d=af(_e.current),t){case 1:t=d.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:t=d.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":t=d.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":t=d.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":t=d.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof s.is=="string"?d.createElement("select",{is:s.is}):d.createElement("select"),s.multiple?t.multiple=!0:s.size&&(t.size=s.size);break;default:t=typeof s.is=="string"?d.createElement(o,{is:s.is}):d.createElement(o)}}t[Gt]=r,t[Je]=s;e:for(d=r.child;d!==null;){if(d.tag===5||d.tag===6)t.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===r)break e;for(;d.sibling===null;){if(d.return===null||d.return===r)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}r.stateNode=t;e:switch(Cn(t,o,s),o){case"button":case"input":case"select":case"textarea":t=!!s.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&qa(r)}}return Ut(r),r.flags&=-16777217,null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==s&&qa(r);else{if(typeof s!="string"&&r.stateNode===null)throw Error(i(166));if(t=_e.current,Rl(r)){if(t=r.stateNode,o=r.memoizedProps,s=null,d=$n,d!==null)switch(d.tag){case 27:case 5:s=d.memoizedProps}t[Gt]=r,t=!!(t.nodeValue===o||s!==null&&s.suppressHydrationWarning===!0||E0(t.nodeValue,o)),t||mo(r)}else t=af(t).createTextNode(s),t[Gt]=r,r.stateNode=t}return Ut(r),null;case 13:if(s=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(d=Rl(r),s!==null&&s.dehydrated!==null){if(t===null){if(!d)throw Error(i(318));if(d=r.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(i(317));d[Gt]=r}else Cl(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Ut(r),d=!1}else d=lg(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=d),d=!0;if(!d)return r.flags&256?(Ha(r),r):(Ha(r),null)}if(Ha(r),(r.flags&128)!==0)return r.lanes=o,r;if(o=s!==null,t=t!==null&&t.memoizedState!==null,o){s=r.child,d=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(d=s.alternate.memoizedState.cachePool.pool);var m=null;s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),m!==d&&(s.flags|=2048)}return o!==t&&o&&(r.child.flags|=8192),Zc(r,r.updateQueue),Ut(r),null;case 4:return je(),t===null&&Jh(r.stateNode.containerInfo),Ut(r),null;case 10:return Va(r.type),Ut(r),null;case 19:if(G(dn),d=r.memoizedState,d===null)return Ut(r),null;if(s=(r.flags&128)!==0,m=d.rendering,m===null)if(s)ql(d,!1);else{if(Kt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(m=Vc(t),m!==null){for(r.flags|=128,ql(d,!1),t=m.updateQueue,r.updateQueue=t,Zc(r,t),r.subtreeFlags=0,t=o,o=r.child;o!==null;)ag(o,t),o=o.sibling;return I(dn,dn.current&1|2),r.child}t=t.sibling}d.tail!==null&&st()>Fc&&(r.flags|=128,s=!0,ql(d,!1),r.lanes=4194304)}else{if(!s)if(t=Vc(m),t!==null){if(r.flags|=128,s=!0,t=t.updateQueue,r.updateQueue=t,Zc(r,t),ql(d,!0),d.tail===null&&d.tailMode==="hidden"&&!m.alternate&&!ht)return Ut(r),null}else 2*st()-d.renderingStartTime>Fc&&o!==536870912&&(r.flags|=128,s=!0,ql(d,!1),r.lanes=4194304);d.isBackwards?(m.sibling=r.child,r.child=m):(t=d.last,t!==null?t.sibling=m:r.child=m,d.last=m)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=st(),r.sibling=null,t=dn.current,I(dn,s?t&1|2:t&1),r):(Ut(r),null);case 22:case 23:return Ha(r),th(),s=r.memoizedState!==null,t!==null?t.memoizedState!==null!==s&&(r.flags|=8192):s&&(r.flags|=8192),s?(o&536870912)!==0&&(r.flags&128)===0&&(Ut(r),r.subtreeFlags&6&&(r.flags|=8192)):Ut(r),o=r.updateQueue,o!==null&&Zc(r,o.retryQueue),o=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),s=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),s!==o&&(r.flags|=2048),t!==null&&G(vo),null;case 24:return o=null,t!==null&&(o=t.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),Va(fn),Ut(r),null;case 25:return null;case 30:return null}throw Error(i(156,r.tag))}function R_(t,r){switch(Id(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Va(fn),je(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return zt(r),null;case 13:if(Ha(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(i(340));Cl()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return G(dn),null;case 4:return je(),null;case 10:return Va(r.type),null;case 22:case 23:return Ha(r),th(),t!==null&&G(vo),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Va(fn),null;case 25:return null;default:return null}}function jv(t,r){switch(Id(r),r.tag){case 3:Va(fn),je();break;case 26:case 27:case 5:zt(r);break;case 4:je();break;case 13:Ha(r);break;case 19:G(dn);break;case 10:Va(r.type);break;case 22:case 23:Ha(r),th(),t!==null&&G(vo);break;case 24:Va(fn)}}function Zl(t,r){try{var o=r.updateQueue,s=o!==null?o.lastEffect:null;if(s!==null){var d=s.next;o=d;do{if((o.tag&t)===t){s=void 0;var m=o.create,E=o.inst;s=m(),E.destroy=s}o=o.next}while(o!==d)}}catch(C){_t(r,r.return,C)}}function xi(t,r,o){try{var s=r.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var m=d.next;s=m;do{if((s.tag&t)===t){var E=s.inst,C=E.destroy;if(C!==void 0){E.destroy=void 0,d=r;var B=o,re=C;try{re()}catch(pe){_t(d,B,pe)}}}s=s.next}while(s!==m)}}catch(pe){_t(r,r.return,pe)}}function Mv(t){var r=t.updateQueue;if(r!==null){var o=t.stateNode;try{bg(r,o)}catch(s){_t(t,t.return,s)}}}function kv(t,r,o){o.props=xo(t.type,t.memoizedProps),o.state=t.memoizedState;try{o.componentWillUnmount()}catch(s){_t(t,r,s)}}function Kl(t,r){try{var o=t.ref;if(o!==null){switch(t.tag){case 26:case 27:case 5:var s=t.stateNode;break;case 30:s=t.stateNode;break;default:s=t.stateNode}typeof o=="function"?t.refCleanup=o(s):o.current=s}}catch(d){_t(t,r,d)}}function oa(t,r){var o=t.ref,s=t.refCleanup;if(o!==null)if(typeof s=="function")try{s()}catch(d){_t(t,r,d)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(d){_t(t,r,d)}else o.current=null}function Nv(t){var r=t.type,o=t.memoizedProps,s=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":o.autoFocus&&s.focus();break e;case"img":o.src?s.src=o.src:o.srcSet&&(s.srcset=o.srcSet)}}catch(d){_t(t,t.return,d)}}function Oh(t,r,o){try{var s=t.stateNode;F_(s,t.type,o,r),s[Je]=r}catch(d){_t(t,t.return,d)}}function zv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ci(t.type)||t.tag===4}function Dh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||zv(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.tag===27&&Ci(t.type)||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 jh(t,r,o){var s=t.tag;if(s===5||s===6)t=t.stateNode,r?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(t,r):(r=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,r.appendChild(t),o=o._reactRootContainer,o!=null||r.onclick!==null||(r.onclick=rf));else if(s!==4&&(s===27&&Ci(t.type)&&(o=t.stateNode,r=null),t=t.child,t!==null))for(jh(t,r,o),t=t.sibling;t!==null;)jh(t,r,o),t=t.sibling}function Kc(t,r,o){var s=t.tag;if(s===5||s===6)t=t.stateNode,r?o.insertBefore(t,r):o.appendChild(t);else if(s!==4&&(s===27&&Ci(t.type)&&(o=t.stateNode),t=t.child,t!==null))for(Kc(t,r,o),t=t.sibling;t!==null;)Kc(t,r,o),t=t.sibling}function Pv(t){var r=t.stateNode,o=t.memoizedProps;try{for(var s=t.type,d=r.attributes;d.length;)r.removeAttributeNode(d[0]);Cn(r,s,o),r[Gt]=t,r[Je]=o}catch(m){_t(t,t.return,m)}}var Za=!1,Qt=!1,Mh=!1,Lv=typeof WeakSet=="function"?WeakSet:Set,wn=null;function C_(t,r){if(t=t.containerInfo,np=ff,t=b(t),x(t)){if("selectionStart"in t)var o={start:t.selectionStart,end:t.selectionEnd};else e:{o=(o=t.ownerDocument)&&o.defaultView||window;var s=o.getSelection&&o.getSelection();if(s&&s.rangeCount!==0){o=s.anchorNode;var d=s.anchorOffset,m=s.focusNode;s=s.focusOffset;try{o.nodeType,m.nodeType}catch{o=null;break e}var E=0,C=-1,B=-1,re=0,pe=0,ge=t,oe=null;t:for(;;){for(var se;ge!==o||d!==0&&ge.nodeType!==3||(C=E+d),ge!==m||s!==0&&ge.nodeType!==3||(B=E+s),ge.nodeType===3&&(E+=ge.nodeValue.length),(se=ge.firstChild)!==null;)oe=ge,ge=se;for(;;){if(ge===t)break t;if(oe===o&&++re===d&&(C=E),oe===m&&++pe===s&&(B=E),(se=ge.nextSibling)!==null)break;ge=oe,oe=ge.parentNode}ge=se}o=C===-1||B===-1?null:{start:C,end:B}}else o=null}o=o||{start:0,end:0}}else o=null;for(rp={focusedElem:t,selectionRange:o},ff=!1,wn=r;wn!==null;)if(r=wn,t=r.child,(r.subtreeFlags&1024)!==0&&t!==null)t.return=r,wn=t;else for(;wn!==null;){switch(r=wn,m=r.alternate,t=r.flags,r.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&m!==null){t=void 0,o=r,d=m.memoizedProps,m=m.memoizedState,s=o.stateNode;try{var qe=xo(o.type,d,o.elementType===o.type);t=s.getSnapshotBeforeUpdate(qe,m),s.__reactInternalSnapshotBeforeUpdate=t}catch(Ve){_t(o,o.return,Ve)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,o=t.nodeType,o===9)op(t);else if(o===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":op(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(i(163))}if(t=r.sibling,t!==null){t.return=r.return,wn=t;break}wn=r.return}}function Bv(t,r,o){var s=o.flags;switch(o.tag){case 0:case 11:case 15:wi(t,o),s&4&&Zl(5,o);break;case 1:if(wi(t,o),s&4)if(t=o.stateNode,r===null)try{t.componentDidMount()}catch(E){_t(o,o.return,E)}else{var d=xo(o.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(d,r,t.__reactInternalSnapshotBeforeUpdate)}catch(E){_t(o,o.return,E)}}s&64&&Mv(o),s&512&&Kl(o,o.return);break;case 3:if(wi(t,o),s&64&&(t=o.updateQueue,t!==null)){if(r=null,o.child!==null)switch(o.child.tag){case 27:case 5:r=o.child.stateNode;break;case 1:r=o.child.stateNode}try{bg(t,r)}catch(E){_t(o,o.return,E)}}break;case 27:r===null&&s&4&&Pv(o);case 26:case 5:wi(t,o),r===null&&s&4&&Nv(o),s&512&&Kl(o,o.return);break;case 12:wi(t,o);break;case 13:wi(t,o),s&4&&Iv(t,o),s&64&&(t=o.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(o=L_.bind(null,o),tT(t,o))));break;case 22:if(s=o.memoizedState!==null||Za,!s){r=r!==null&&r.memoizedState!==null||Qt,d=Za;var m=Qt;Za=s,(Qt=r)&&!m?Si(t,o,(o.subtreeFlags&8772)!==0):wi(t,o),Za=d,Qt=m}break;case 30:break;default:wi(t,o)}}function Uv(t){var r=t.alternate;r!==null&&(t.alternate=null,Uv(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&yr(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Mt=null,Wn=!1;function Ka(t,r,o){for(o=o.child;o!==null;)Vv(t,r,o),o=o.sibling}function Vv(t,r,o){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(un,o)}catch{}switch(o.tag){case 26:Qt||oa(o,r),Ka(t,r,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Qt||oa(o,r);var s=Mt,d=Wn;Ci(o.type)&&(Mt=o.stateNode,Wn=!1),Ka(t,r,o),tu(o.stateNode),Mt=s,Wn=d;break;case 5:Qt||oa(o,r);case 6:if(s=Mt,d=Wn,Mt=null,Ka(t,r,o),Mt=s,Wn=d,Mt!==null)if(Wn)try{(Mt.nodeType===9?Mt.body:Mt.nodeName==="HTML"?Mt.ownerDocument.body:Mt).removeChild(o.stateNode)}catch(m){_t(o,r,m)}else try{Mt.removeChild(o.stateNode)}catch(m){_t(o,r,m)}break;case 18:Mt!==null&&(Wn?(t=Mt,C0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,o.stateNode),uu(t)):C0(Mt,o.stateNode));break;case 4:s=Mt,d=Wn,Mt=o.stateNode.containerInfo,Wn=!0,Ka(t,r,o),Mt=s,Wn=d;break;case 0:case 11:case 14:case 15:Qt||xi(2,o,r),Qt||xi(4,o,r),Ka(t,r,o);break;case 1:Qt||(oa(o,r),s=o.stateNode,typeof s.componentWillUnmount=="function"&&kv(o,r,s)),Ka(t,r,o);break;case 21:Ka(t,r,o);break;case 22:Qt=(s=Qt)||o.memoizedState!==null,Ka(t,r,o),Qt=s;break;default:Ka(t,r,o)}}function Iv(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{uu(t)}catch(o){_t(r,r.return,o)}}function O_(t){switch(t.tag){case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new Lv),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new Lv),r;default:throw Error(i(435,t.tag))}}function kh(t,r){var o=O_(t);r.forEach(function(s){var d=B_.bind(null,t,s);o.has(s)||(o.add(s),s.then(d,d))})}function sr(t,r){var o=r.deletions;if(o!==null)for(var s=0;s<o.length;s++){var d=o[s],m=t,E=r,C=E;e:for(;C!==null;){switch(C.tag){case 27:if(Ci(C.type)){Mt=C.stateNode,Wn=!1;break e}break;case 5:Mt=C.stateNode,Wn=!1;break e;case 3:case 4:Mt=C.stateNode.containerInfo,Wn=!0;break e}C=C.return}if(Mt===null)throw Error(i(160));Vv(m,E,d),Mt=null,Wn=!1,m=d.alternate,m!==null&&(m.return=null),d.return=null}if(r.subtreeFlags&13878)for(r=r.child;r!==null;)Hv(r,t),r=r.sibling}var Lr=null;function Hv(t,r){var o=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:sr(r,t),lr(t),s&4&&(xi(3,t,t.return),Zl(3,t),xi(5,t,t.return));break;case 1:sr(r,t),lr(t),s&512&&(Qt||o===null||oa(o,o.return)),s&64&&Za&&(t=t.updateQueue,t!==null&&(s=t.callbacks,s!==null&&(o=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=o===null?s:o.concat(s))));break;case 26:var d=Lr;if(sr(r,t),lr(t),s&512&&(Qt||o===null||oa(o,o.return)),s&4){var m=o!==null?o.memoizedState:null;if(s=t.memoizedState,o===null)if(s===null)if(t.stateNode===null){e:{s=t.type,o=t.memoizedProps,d=d.ownerDocument||d;t:switch(s){case"title":m=d.getElementsByTagName("title")[0],(!m||m[Fi]||m[Gt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=d.createElement(s),d.head.insertBefore(m,d.querySelector("head > title"))),Cn(m,s,o),m[Gt]=t,Et(m),s=m;break e;case"link":var E=P0("link","href",d).get(s+(o.href||""));if(E){for(var C=0;C<E.length;C++)if(m=E[C],m.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&m.getAttribute("rel")===(o.rel==null?null:o.rel)&&m.getAttribute("title")===(o.title==null?null:o.title)&&m.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){E.splice(C,1);break t}}m=d.createElement(s),Cn(m,s,o),d.head.appendChild(m);break;case"meta":if(E=P0("meta","content",d).get(s+(o.content||""))){for(C=0;C<E.length;C++)if(m=E[C],m.getAttribute("content")===(o.content==null?null:""+o.content)&&m.getAttribute("name")===(o.name==null?null:o.name)&&m.getAttribute("property")===(o.property==null?null:o.property)&&m.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&m.getAttribute("charset")===(o.charSet==null?null:o.charSet)){E.splice(C,1);break t}}m=d.createElement(s),Cn(m,s,o),d.head.appendChild(m);break;default:throw Error(i(468,s))}m[Gt]=t,Et(m),s=m}t.stateNode=s}else L0(d,t.type,t.stateNode);else t.stateNode=z0(d,s,t.memoizedProps);else m!==s?(m===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):m.count--,s===null?L0(d,t.type,t.stateNode):z0(d,s,t.memoizedProps)):s===null&&t.stateNode!==null&&Oh(t,t.memoizedProps,o.memoizedProps)}break;case 27:sr(r,t),lr(t),s&512&&(Qt||o===null||oa(o,o.return)),o!==null&&s&4&&Oh(t,t.memoizedProps,o.memoizedProps);break;case 5:if(sr(r,t),lr(t),s&512&&(Qt||o===null||oa(o,o.return)),t.flags&32){d=t.stateNode;try{zr(d,"")}catch(se){_t(t,t.return,se)}}s&4&&t.stateNode!=null&&(d=t.memoizedProps,Oh(t,d,o!==null?o.memoizedProps:d)),s&1024&&(Mh=!0);break;case 6:if(sr(r,t),lr(t),s&4){if(t.stateNode===null)throw Error(i(162));s=t.memoizedProps,o=t.stateNode;try{o.nodeValue=s}catch(se){_t(t,t.return,se)}}break;case 3:if(lf=null,d=Lr,Lr=of(r.containerInfo),sr(r,t),Lr=d,lr(t),s&4&&o!==null&&o.memoizedState.isDehydrated)try{uu(r.containerInfo)}catch(se){_t(t,t.return,se)}Mh&&(Mh=!1,$v(t));break;case 4:s=Lr,Lr=of(t.stateNode.containerInfo),sr(r,t),lr(t),Lr=s;break;case 12:sr(r,t),lr(t);break;case 13:sr(r,t),lr(t),t.child.flags&8192&&t.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Uh=st()),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,kh(t,s)));break;case 22:d=t.memoizedState!==null;var B=o!==null&&o.memoizedState!==null,re=Za,pe=Qt;if(Za=re||d,Qt=pe||B,sr(r,t),Qt=pe,Za=re,lr(t),s&8192)e:for(r=t.stateNode,r._visibility=d?r._visibility&-2:r._visibility|1,d&&(o===null||B||Za||Qt||wo(t)),o=null,r=t;;){if(r.tag===5||r.tag===26){if(o===null){B=o=r;try{if(m=B.stateNode,d)E=m.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{C=B.stateNode;var ge=B.memoizedProps.style,oe=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;C.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(se){_t(B,B.return,se)}}}else if(r.tag===6){if(o===null){B=r;try{B.stateNode.nodeValue=d?"":B.memoizedProps}catch(se){_t(B,B.return,se)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;o===r&&(o=null),r=r.return}o===r&&(o=null),r.sibling.return=r.return,r=r.sibling}s&4&&(s=t.updateQueue,s!==null&&(o=s.retryQueue,o!==null&&(s.retryQueue=null,kh(t,o))));break;case 19:sr(r,t),lr(t),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,kh(t,s)));break;case 30:break;case 21:break;default:sr(r,t),lr(t)}}function lr(t){var r=t.flags;if(r&2){try{for(var o,s=t.return;s!==null;){if(zv(s)){o=s;break}s=s.return}if(o==null)throw Error(i(160));switch(o.tag){case 27:var d=o.stateNode,m=Dh(t);Kc(t,m,d);break;case 5:var E=o.stateNode;o.flags&32&&(zr(E,""),o.flags&=-33);var C=Dh(t);Kc(t,C,E);break;case 3:case 4:var B=o.stateNode.containerInfo,re=Dh(t);jh(t,re,B);break;default:throw Error(i(161))}}catch(pe){_t(t,t.return,pe)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function $v(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;$v(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function wi(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Bv(t,r.alternate,r),r=r.sibling}function wo(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:xi(4,r,r.return),wo(r);break;case 1:oa(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&kv(r,r.return,o),wo(r);break;case 27:tu(r.stateNode);case 26:case 5:oa(r,r.return),wo(r);break;case 22:r.memoizedState===null&&wo(r);break;case 30:wo(r);break;default:wo(r)}t=t.sibling}}function Si(t,r,o){for(o=o&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var s=r.alternate,d=t,m=r,E=m.flags;switch(m.tag){case 0:case 11:case 15:Si(d,m,o),Zl(4,m);break;case 1:if(Si(d,m,o),s=m,d=s.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(re){_t(s,s.return,re)}if(s=m,d=s.updateQueue,d!==null){var C=s.stateNode;try{var B=d.shared.hiddenCallbacks;if(B!==null)for(d.shared.hiddenCallbacks=null,d=0;d<B.length;d++)vg(B[d],C)}catch(re){_t(s,s.return,re)}}o&&E&64&&Mv(m),Kl(m,m.return);break;case 27:Pv(m);case 26:case 5:Si(d,m,o),o&&s===null&&E&4&&Nv(m),Kl(m,m.return);break;case 12:Si(d,m,o);break;case 13:Si(d,m,o),o&&E&4&&Iv(d,m);break;case 22:m.memoizedState===null&&Si(d,m,o),Kl(m,m.return);break;case 30:break;default:Si(d,m,o)}r=r.sibling}}function Nh(t,r){var o=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==o&&(t!=null&&t.refCount++,o!=null&&jl(o))}function zh(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&jl(t))}function sa(t,r,o,s){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)qv(t,r,o,s),r=r.sibling}function qv(t,r,o,s){var d=r.flags;switch(r.tag){case 0:case 11:case 15:sa(t,r,o,s),d&2048&&Zl(9,r);break;case 1:sa(t,r,o,s);break;case 3:sa(t,r,o,s),d&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&jl(t)));break;case 12:if(d&2048){sa(t,r,o,s),t=r.stateNode;try{var m=r.memoizedProps,E=m.id,C=m.onPostCommit;typeof C=="function"&&C(E,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(B){_t(r,r.return,B)}}else sa(t,r,o,s);break;case 13:sa(t,r,o,s);break;case 23:break;case 22:m=r.stateNode,E=r.alternate,r.memoizedState!==null?m._visibility&2?sa(t,r,o,s):Yl(t,r):m._visibility&2?sa(t,r,o,s):(m._visibility|=2,ws(t,r,o,s,(r.subtreeFlags&10256)!==0)),d&2048&&Nh(E,r);break;case 24:sa(t,r,o,s),d&2048&&zh(r.alternate,r);break;default:sa(t,r,o,s)}}function ws(t,r,o,s,d){for(d=d&&(r.subtreeFlags&10256)!==0,r=r.child;r!==null;){var m=t,E=r,C=o,B=s,re=E.flags;switch(E.tag){case 0:case 11:case 15:ws(m,E,C,B,d),Zl(8,E);break;case 23:break;case 22:var pe=E.stateNode;E.memoizedState!==null?pe._visibility&2?ws(m,E,C,B,d):Yl(m,E):(pe._visibility|=2,ws(m,E,C,B,d)),d&&re&2048&&Nh(E.alternate,E);break;case 24:ws(m,E,C,B,d),d&&re&2048&&zh(E.alternate,E);break;default:ws(m,E,C,B,d)}r=r.sibling}}function Yl(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var o=t,s=r,d=s.flags;switch(s.tag){case 22:Yl(o,s),d&2048&&Nh(s.alternate,s);break;case 24:Yl(o,s),d&2048&&zh(s.alternate,s);break;default:Yl(o,s)}r=r.sibling}}var Fl=8192;function Ss(t){if(t.subtreeFlags&Fl)for(t=t.child;t!==null;)Zv(t),t=t.sibling}function Zv(t){switch(t.tag){case 26:Ss(t),t.flags&Fl&&t.memoizedState!==null&&pT(Lr,t.memoizedState,t.memoizedProps);break;case 5:Ss(t);break;case 3:case 4:var r=Lr;Lr=of(t.stateNode.containerInfo),Ss(t),Lr=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=Fl,Fl=16777216,Ss(t),Fl=r):Ss(t));break;default:Ss(t)}}function Kv(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function Gl(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var s=r[o];wn=s,Fv(s,t)}Kv(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Yv(t),t=t.sibling}function Yv(t){switch(t.tag){case 0:case 11:case 15:Gl(t),t.flags&2048&&xi(9,t,t.return);break;case 3:Gl(t);break;case 12:Gl(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Yc(t)):Gl(t);break;default:Gl(t)}}function Yc(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var s=r[o];wn=s,Fv(s,t)}Kv(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:xi(8,r,r.return),Yc(r);break;case 22:o=r.stateNode,o._visibility&2&&(o._visibility&=-3,Yc(r));break;default:Yc(r)}t=t.sibling}}function Fv(t,r){for(;wn!==null;){var o=wn;switch(o.tag){case 0:case 11:case 15:xi(8,o,r);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var s=o.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:jl(o.memoizedState.cache)}if(s=o.child,s!==null)s.return=o,wn=s;else e:for(o=t;wn!==null;){s=wn;var d=s.sibling,m=s.return;if(Uv(s),s===o){wn=null;break e}if(d!==null){d.return=m,wn=d;break e}wn=m}}}var D_={getCacheForType:function(t){var r=kn(fn),o=r.data.get(t);return o===void 0&&(o=t(),r.data.set(t,o)),o}},j_=typeof WeakMap=="function"?WeakMap:Map,mt=0,At=null,rt=null,lt=0,yt=0,ur=null,Ei=!1,Es=!1,Ph=!1,Ya=0,Kt=0,_i=0,So=0,Lh=0,wr=0,_s=0,Xl=null,Jn=null,Bh=!1,Uh=0,Fc=1/0,Gc=null,Ti=null,Rn=0,Ai=null,Ts=null,As=0,Vh=0,Ih=null,Gv=null,Ql=0,Hh=null;function cr(){if((mt&2)!==0&&lt!==0)return lt&-lt;if(de.T!==null){var t=hs;return t!==0?t:Gh()}return wa()}function Xv(){wr===0&&(wr=(lt&536870912)===0||ht?Zi():536870912);var t=xr.current;return t!==null&&(t.flags|=32),wr}function fr(t,r,o){(t===At&&(yt===2||yt===9)||t.cancelPendingCommit!==null)&&(Rs(t,0),Ri(t,lt,wr,!1)),ni(t,o),((mt&2)===0||t!==At)&&(t===At&&((mt&2)===0&&(So|=o),Kt===4&&Ri(t,lt,wr,!1)),la(t))}function Qv(t,r,o){if((mt&6)!==0)throw Error(i(327));var s=!o&&(r&124)===0&&(r&t.expiredLanes)===0||kr(t,r),d=s?N_(t,r):Zh(t,r,!0),m=s;do{if(d===0){Es&&!s&&Ri(t,r,0,!1);break}else{if(o=t.current.alternate,m&&!M_(o)){d=Zh(t,r,!1),m=!1;continue}if(d===2){if(m=r,t.errorRecoveryDisabledLanes&m)var E=0;else E=t.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){r=E;e:{var C=t;d=Xl;var B=C.current.memoizedState.isDehydrated;if(B&&(Rs(C,E).flags|=256),E=Zh(C,E,!1),E!==2){if(Ph&&!B){C.errorRecoveryDisabledLanes|=m,So|=m,d=4;break e}m=Jn,Jn=d,m!==null&&(Jn===null?Jn=m:Jn.push.apply(Jn,m))}d=E}if(m=!1,d!==2)continue}}if(d===1){Rs(t,0),Ri(t,r,0,!0);break}e:{switch(s=t,m=d,m){case 0:case 1:throw Error(i(345));case 4:if((r&4194048)!==r)break;case 6:Ri(s,r,wr,!Ei);break e;case 2:Jn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((r&62914560)===r&&(d=Uh+300-st(),10<d)){if(Ri(s,r,wr,!Ei),ke(s,0,!0)!==0)break e;s.timeoutHandle=A0(Wv.bind(null,s,o,Jn,Gc,Bh,r,wr,So,_s,Ei,m,2,-0,0),d);break e}Wv(s,o,Jn,Gc,Bh,r,wr,So,_s,Ei,m,0,-0,0)}}break}while(!0);la(t)}function Wv(t,r,o,s,d,m,E,C,B,re,pe,ge,oe,se){if(t.timeoutHandle=-1,ge=r.subtreeFlags,(ge&8192||(ge&16785408)===16785408)&&(au={stylesheets:null,count:0,unsuspend:hT},Zv(r),ge=mT(),ge!==null)){t.cancelPendingCommit=ge(i0.bind(null,t,r,m,o,s,d,E,C,B,pe,1,oe,se)),Ri(t,m,E,!re);return}i0(t,r,m,o,s,d,E,C,B)}function M_(t){for(var r=t;;){var o=r.tag;if((o===0||o===11||o===15)&&r.flags&16384&&(o=r.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var s=0;s<o.length;s++){var d=o[s],m=d.getSnapshot;d=d.value;try{if(!nn(m(),d))return!1}catch{return!1}}if(o=r.child,r.subtreeFlags&16384&&o!==null)o.return=r,r=o;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Ri(t,r,o,s){r&=~Lh,r&=~So,t.suspendedLanes|=r,t.pingedLanes&=~r,s&&(t.warmLanes|=r),s=t.expirationTimes;for(var d=r;0<d;){var m=31-Pt(d),E=1<<m;s[m]=-1,d&=~E}o!==0&&nl(t,o,r)}function Xc(){return(mt&6)===0?(Wl(0),!1):!0}function $h(){if(rt!==null){if(yt===0)var t=rt.return;else t=rt,Ua=yo=null,oh(t),bs=null,Hl=0,t=rt;for(;t!==null;)jv(t.alternate,t),t=t.return;rt=null}}function Rs(t,r){var o=t.timeoutHandle;o!==-1&&(t.timeoutHandle=-1,X_(o)),o=t.cancelPendingCommit,o!==null&&(t.cancelPendingCommit=null,o()),$h(),At=t,rt=o=Pa(t.current,null),lt=r,yt=0,ur=null,Ei=!1,Es=kr(t,r),Ph=!1,_s=wr=Lh=So=_i=Kt=0,Jn=Xl=null,Bh=!1,(r&8)!==0&&(r|=r&32);var s=t.entangledLanes;if(s!==0)for(t=t.entanglements,s&=r;0<s;){var d=31-Pt(s),m=1<<d;r|=t[d],s&=~m}return Ya=r,Ge(),o}function Jv(t,r){et=null,de.H=Lc,r===kl||r===Rc?(r=yg(),yt=3):r===hg?(r=yg(),yt=4):yt=r===gv?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,ur=r,rt===null&&(Kt=1,Hc(t,Se(r,t.current)))}function e0(){var t=de.H;return de.H=Lc,t===null?Lc:t}function t0(){var t=de.A;return de.A=D_,t}function qh(){Kt=4,Ei||(lt&4194048)!==lt&&xr.current!==null||(Es=!0),(_i&134217727)===0&&(So&134217727)===0||At===null||Ri(At,lt,wr,!1)}function Zh(t,r,o){var s=mt;mt|=2;var d=e0(),m=t0();(At!==t||lt!==r)&&(Gc=null,Rs(t,r)),r=!1;var E=Kt;e:do try{if(yt!==0&&rt!==null){var C=rt,B=ur;switch(yt){case 8:$h(),E=6;break e;case 3:case 2:case 9:case 6:xr.current===null&&(r=!0);var re=yt;if(yt=0,ur=null,Cs(t,C,B,re),o&&Es){E=0;break e}break;default:re=yt,yt=0,ur=null,Cs(t,C,B,re)}}k_(),E=Kt;break}catch(pe){Jv(t,pe)}while(!0);return r&&t.shellSuspendCounter++,Ua=yo=null,mt=s,de.H=d,de.A=m,rt===null&&(At=null,lt=0,Ge()),E}function k_(){for(;rt!==null;)n0(rt)}function N_(t,r){var o=mt;mt|=2;var s=e0(),d=t0();At!==t||lt!==r?(Gc=null,Fc=st()+500,Rs(t,r)):Es=kr(t,r);e:do try{if(yt!==0&&rt!==null){r=rt;var m=ur;t:switch(yt){case 1:yt=0,ur=null,Cs(t,r,m,1);break;case 2:case 9:if(pg(m)){yt=0,ur=null,r0(r);break}r=function(){yt!==2&&yt!==9||At!==t||(yt=7),la(t)},m.then(r,r);break e;case 3:yt=7;break e;case 4:yt=5;break e;case 7:pg(m)?(yt=0,ur=null,r0(r)):(yt=0,ur=null,Cs(t,r,m,7));break;case 5:var E=null;switch(rt.tag){case 26:E=rt.memoizedState;case 5:case 27:var C=rt;if(!E||B0(E)){yt=0,ur=null;var B=C.sibling;if(B!==null)rt=B;else{var re=C.return;re!==null?(rt=re,Qc(re)):rt=null}break t}}yt=0,ur=null,Cs(t,r,m,5);break;case 6:yt=0,ur=null,Cs(t,r,m,6);break;case 8:$h(),Kt=6;break e;default:throw Error(i(462))}}z_();break}catch(pe){Jv(t,pe)}while(!0);return Ua=yo=null,de.H=s,de.A=d,mt=o,rt!==null?0:(At=null,lt=0,Ge(),Kt)}function z_(){for(;rt!==null&&!En();)n0(rt)}function n0(t){var r=Ov(t.alternate,t,Ya);t.memoizedProps=t.pendingProps,r===null?Qc(t):rt=r}function r0(t){var r=t,o=r.alternate;switch(r.tag){case 15:case 0:r=Ev(o,r,r.pendingProps,r.type,void 0,lt);break;case 11:r=Ev(o,r,r.pendingProps,r.type.render,r.ref,lt);break;case 5:oh(r);default:jv(o,r),r=rt=ag(r,Ya),r=Ov(o,r,Ya)}t.memoizedProps=t.pendingProps,r===null?Qc(t):rt=r}function Cs(t,r,o,s){Ua=yo=null,oh(r),bs=null,Hl=0;var d=r.return;try{if(__(t,d,r,o,lt)){Kt=1,Hc(t,Se(o,t.current)),rt=null;return}}catch(m){if(d!==null)throw rt=d,m;Kt=1,Hc(t,Se(o,t.current)),rt=null;return}r.flags&32768?(ht||s===1?t=!0:Es||(lt&536870912)!==0?t=!1:(Ei=t=!0,(s===2||s===9||s===3||s===6)&&(s=xr.current,s!==null&&s.tag===13&&(s.flags|=16384))),a0(r,t)):Qc(r)}function Qc(t){var r=t;do{if((r.flags&32768)!==0){a0(r,Ei);return}t=r.return;var o=A_(r.alternate,r,Ya);if(o!==null){rt=o;return}if(r=r.sibling,r!==null){rt=r;return}rt=r=t}while(r!==null);Kt===0&&(Kt=5)}function a0(t,r){do{var o=R_(t.alternate,t);if(o!==null){o.flags&=32767,rt=o;return}if(o=t.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!r&&(t=t.sibling,t!==null)){rt=t;return}rt=t=o}while(t!==null);Kt=6,rt=null}function i0(t,r,o,s,d,m,E,C,B){t.cancelPendingCommit=null;do Wc();while(Rn!==0);if((mt&6)!==0)throw Error(i(327));if(r!==null){if(r===t.current)throw Error(i(177));if(m=r.lanes|r.childLanes,m|=Fe,tl(t,o,m,E,C,B),t===At&&(rt=At=null,lt=0),Ts=r,Ai=t,As=o,Vh=m,Ih=d,Gv=s,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,U_(ln,function(){return c0(),null})):(t.callbackNode=null,t.callbackPriority=0),s=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||s){s=de.T,de.T=null,d=be.p,be.p=2,E=mt,mt|=4;try{C_(t,r,o)}finally{mt=E,be.p=d,de.T=s}}Rn=1,o0(),s0(),l0()}}function o0(){if(Rn===1){Rn=0;var t=Ai,r=Ts,o=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||o){o=de.T,de.T=null;var s=be.p;be.p=2;var d=mt;mt|=4;try{Hv(r,t);var m=rp,E=b(t.containerInfo),C=m.focusedElem,B=m.selectionRange;if(E!==C&&C&&C.ownerDocument&&h(C.ownerDocument.documentElement,C)){if(B!==null&&x(C)){var re=B.start,pe=B.end;if(pe===void 0&&(pe=re),"selectionStart"in C)C.selectionStart=re,C.selectionEnd=Math.min(pe,C.value.length);else{var ge=C.ownerDocument||document,oe=ge&&ge.defaultView||window;if(oe.getSelection){var se=oe.getSelection(),qe=C.textContent.length,Ve=Math.min(B.start,qe),xt=B.end===void 0?Ve:Math.min(B.end,qe);!se.extend&&Ve>xt&&(E=xt,xt=Ve,Ve=E);var W=c(C,Ve),K=c(C,xt);if(W&&K&&(se.rangeCount!==1||se.anchorNode!==W.node||se.anchorOffset!==W.offset||se.focusNode!==K.node||se.focusOffset!==K.offset)){var ne=ge.createRange();ne.setStart(W.node,W.offset),se.removeAllRanges(),Ve>xt?(se.addRange(ne),se.extend(K.node,K.offset)):(ne.setEnd(K.node,K.offset),se.addRange(ne))}}}}for(ge=[],se=C;se=se.parentNode;)se.nodeType===1&&ge.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<ge.length;C++){var me=ge[C];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}ff=!!np,rp=np=null}finally{mt=d,be.p=s,de.T=o}}t.current=r,Rn=2}}function s0(){if(Rn===2){Rn=0;var t=Ai,r=Ts,o=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||o){o=de.T,de.T=null;var s=be.p;be.p=2;var d=mt;mt|=4;try{Bv(t,r.alternate,r)}finally{mt=d,be.p=s,de.T=o}}Rn=3}}function l0(){if(Rn===4||Rn===3){Rn=0,nr();var t=Ai,r=Ts,o=As,s=Gv;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Rn=5:(Rn=0,Ts=Ai=null,u0(t,t.pendingLanes));var d=t.pendingLanes;if(d===0&&(Ti=null),al(o),r=r.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(un,r,void 0,(r.current.flags&128)===128)}catch{}if(s!==null){r=de.T,d=be.p,be.p=2,de.T=null;try{for(var m=t.onRecoverableError,E=0;E<s.length;E++){var C=s[E];m(C.value,{componentStack:C.stack})}}finally{de.T=r,be.p=d}}(As&3)!==0&&Wc(),la(t),d=t.pendingLanes,(o&4194090)!==0&&(d&42)!==0?t===Hh?Ql++:(Ql=0,Hh=t):Ql=0,Wl(0)}}function u0(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,jl(r)))}function Wc(t){return o0(),s0(),l0(),c0()}function c0(){if(Rn!==5)return!1;var t=Ai,r=Vh;Vh=0;var o=al(As),s=de.T,d=be.p;try{be.p=32>o?32:o,de.T=null,o=Ih,Ih=null;var m=Ai,E=As;if(Rn=0,Ts=Ai=null,As=0,(mt&6)!==0)throw Error(i(331));var C=mt;if(mt|=4,Yv(m.current),qv(m,m.current,E,o),mt=C,Wl(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(un,m)}catch{}return!0}finally{be.p=d,de.T=s,u0(t,r)}}function f0(t,r,o){r=Se(o,r),r=xh(t.stateNode,r,2),t=yi(t,r,2),t!==null&&(ni(t,2),la(t))}function _t(t,r,o){if(t.tag===3)f0(t,t,o);else for(;r!==null;){if(r.tag===3){f0(r,t,o);break}else if(r.tag===1){var s=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ti===null||!Ti.has(s))){t=Se(o,t),o=mv(2),s=yi(r,o,2),s!==null&&(yv(o,s,r,t),ni(s,2),la(s));break}}r=r.return}}function Kh(t,r,o){var s=t.pingCache;if(s===null){s=t.pingCache=new j_;var d=new Set;s.set(r,d)}else d=s.get(r),d===void 0&&(d=new Set,s.set(r,d));d.has(o)||(Ph=!0,d.add(o),t=P_.bind(null,t,r,o),r.then(t,t))}function P_(t,r,o){var s=t.pingCache;s!==null&&s.delete(r),t.pingedLanes|=t.suspendedLanes&o,t.warmLanes&=~o,At===t&&(lt&o)===o&&(Kt===4||Kt===3&&(lt&62914560)===lt&&300>st()-Uh?(mt&2)===0&&Rs(t,0):Lh|=o,_s===lt&&(_s=0)),la(t)}function d0(t,r){r===0&&(r=De()),t=Bt(t,r),t!==null&&(ni(t,r),la(t))}function L_(t){var r=t.memoizedState,o=0;r!==null&&(o=r.retryLane),d0(t,o)}function B_(t,r){var o=0;switch(t.tag){case 13:var s=t.stateNode,d=t.memoizedState;d!==null&&(o=d.retryLane);break;case 19:s=t.stateNode;break;case 22:s=t.stateNode._retryCache;break;default:throw Error(i(314))}s!==null&&s.delete(r),d0(t,o)}function U_(t,r){return Ft(t,r)}var Jc=null,Os=null,Yh=!1,ef=!1,Fh=!1,Eo=0;function la(t){t!==Os&&t.next===null&&(Os===null?Jc=Os=t:Os=Os.next=t),ef=!0,Yh||(Yh=!0,I_())}function Wl(t,r){if(!Fh&&ef){Fh=!0;do for(var o=!1,s=Jc;s!==null;){if(t!==0){var d=s.pendingLanes;if(d===0)var m=0;else{var E=s.suspendedLanes,C=s.pingedLanes;m=(1<<31-Pt(42|t)+1)-1,m&=d&~(E&~C),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(o=!0,y0(s,m))}else m=lt,m=ke(s,s===At?m:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(m&3)===0||kr(s,m)||(o=!0,y0(s,m));s=s.next}while(o);Fh=!1}}function V_(){h0()}function h0(){ef=Yh=!1;var t=0;Eo!==0&&(G_()&&(t=Eo),Eo=0);for(var r=st(),o=null,s=Jc;s!==null;){var d=s.next,m=p0(s,r);m===0?(s.next=null,o===null?Jc=d:o.next=d,d===null&&(Os=o)):(o=s,(t!==0||(m&3)!==0)&&(ef=!0)),s=d}Wl(t)}function p0(t,r){for(var o=t.suspendedLanes,s=t.pingedLanes,d=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var E=31-Pt(m),C=1<<E,B=d[E];B===-1?((C&o)===0||(C&s)!==0)&&(d[E]=xa(C,r)):B<=r&&(t.expiredLanes|=C),m&=~C}if(r=At,o=lt,o=ke(t,t===r?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),s=t.callbackNode,o===0||t===r&&(yt===2||yt===9)||t.cancelPendingCommit!==null)return s!==null&&s!==null&&ft(s),t.callbackNode=null,t.callbackPriority=0;if((o&3)===0||kr(t,o)){if(r=o&-o,r===t.callbackPriority)return r;switch(s!==null&&ft(s),al(o)){case 2:case 8:o=Yn;break;case 32:o=ln;break;case 268435456:o=Dr;break;default:o=ln}return s=m0.bind(null,t),o=Ft(o,s),t.callbackPriority=r,t.callbackNode=o,r}return s!==null&&s!==null&&ft(s),t.callbackPriority=2,t.callbackNode=null,2}function m0(t,r){if(Rn!==0&&Rn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var o=t.callbackNode;if(Wc()&&t.callbackNode!==o)return null;var s=lt;return s=ke(t,t===At?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),s===0?null:(Qv(t,s,r),p0(t,st()),t.callbackNode!=null&&t.callbackNode===o?m0.bind(null,t):null)}function y0(t,r){if(Wc())return null;Qv(t,r,!0)}function I_(){Q_(function(){(mt&6)!==0?Ft(qr,V_):h0()})}function Gh(){return Eo===0&&(Eo=Zi()),Eo}function g0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:vn(""+t)}function v0(t,r){var o=r.ownerDocument.createElement("input");return o.name=r.name,o.value=r.value,t.id&&o.setAttribute("form",t.id),r.parentNode.insertBefore(o,r),t=new FormData(t),o.parentNode.removeChild(o),t}function H_(t,r,o,s,d){if(r==="submit"&&o&&o.stateNode===d){var m=g0((d[Je]||null).action),E=s.submitter;E&&(r=(r=E[Je]||null)?g0(r.formAction):E.getAttribute("formAction"),r!==null&&(m=r,E=null));var C=new ra("action","action",null,s,d);t.push({event:C,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Eo!==0){var B=E?v0(d,E):new FormData(d);mh(o,{pending:!0,data:B,method:d.method,action:m},null,B)}}else typeof m=="function"&&(C.preventDefault(),B=E?v0(d,E):new FormData(d),mh(o,{pending:!0,data:B,method:d.method,action:m},m,B))},currentTarget:d}]})}}for(var Xh=0;Xh<we.length;Xh++){var Qh=we[Xh],$_=Qh.toLowerCase(),q_=Qh[0].toUpperCase()+Qh.slice(1);xe($_,"on"+q_)}xe(F,"onAnimationEnd"),xe(Q,"onAnimationIteration"),xe(te,"onAnimationStart"),xe("dblclick","onDoubleClick"),xe("focusin","onFocus"),xe("focusout","onBlur"),xe(ie,"onTransitionRun"),xe(he,"onTransitionStart"),xe(ye,"onTransitionCancel"),xe(Ee,"onTransitionEnd"),Xr("onMouseEnter",["mouseout","mouseover"]),Xr("onMouseLeave",["mouseout","mouseover"]),Xr("onPointerEnter",["pointerout","pointerover"]),Xr("onPointerLeave",["pointerout","pointerover"]),Gr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Gr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Gr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Gr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Gr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Gr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jl="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(" "),Z_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jl));function b0(t,r){r=(r&4)!==0;for(var o=0;o<t.length;o++){var s=t[o],d=s.event;s=s.listeners;e:{var m=void 0;if(r)for(var E=s.length-1;0<=E;E--){var C=s[E],B=C.instance,re=C.currentTarget;if(C=C.listener,B!==m&&d.isPropagationStopped())break e;m=C,d.currentTarget=re;try{m(d)}catch(pe){Ic(pe)}d.currentTarget=null,m=B}else for(E=0;E<s.length;E++){if(C=s[E],B=C.instance,re=C.currentTarget,C=C.listener,B!==m&&d.isPropagationStopped())break e;m=C,d.currentTarget=re;try{m(d)}catch(pe){Ic(pe)}d.currentTarget=null,m=B}}}}function at(t,r){var o=r[il];o===void 0&&(o=r[il]=new Set);var s=t+"__bubble";o.has(s)||(x0(r,t,2,!1),o.add(s))}function Wh(t,r,o){var s=0;r&&(s|=4),x0(o,t,s,r)}var tf="_reactListening"+Math.random().toString(36).slice(2);function Jh(t){if(!t[tf]){t[tf]=!0,ol.forEach(function(o){o!=="selectionchange"&&(Z_.has(o)||Wh(o,!1,t),Wh(o,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[tf]||(r[tf]=!0,Wh("selectionchange",!1,r))}}function x0(t,r,o,s){switch(q0(r)){case 2:var d=vT;break;case 8:d=bT;break;default:d=hp}o=d.bind(null,r,o,t),d=void 0,!no||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(d=!0),s?d!==void 0?t.addEventListener(r,o,{capture:!0,passive:d}):t.addEventListener(r,o,!0):d!==void 0?t.addEventListener(r,o,{passive:d}):t.addEventListener(r,o,!1)}function ep(t,r,o,s,d){var m=s;if((r&1)===0&&(r&2)===0&&s!==null)e:for(;;){if(s===null)return;var E=s.tag;if(E===3||E===4){var C=s.stateNode.containerInfo;if(C===d)break;if(E===4)for(E=s.return;E!==null;){var B=E.tag;if((B===3||B===4)&&E.stateNode.containerInfo===d)return;E=E.return}for(;C!==null;){if(E=rr(C),E===null)return;if(B=E.tag,B===5||B===6||B===26||B===27){s=m=E;continue e}C=C.parentNode}}s=s.return}ir(function(){var re=m,pe=oi(o),ge=[];e:{var oe=Ae.get(t);if(oe!==void 0){var se=ra,qe=t;switch(t){case"keypress":if(li(o)===0)break e;case"keydown":case"keyup":se=io;break;case"focusin":qe="focus",se=ts;break;case"focusout":qe="blur",se=ts;break;case"beforeblur":case"afterblur":se=ts;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=sc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=dl;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=fc;break;case F:case Q:case te:se=rs;break;case Ee:se=vl;break;case"scroll":case"scrollend":se=Md;break;case"wheel":se=bl;break;case"copy":case"cut":case"paste":se=lc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=oo;break;case"toggle":case"beforetoggle":se=os}var Ve=(r&4)!==0,xt=!Ve&&(t==="scroll"||t==="scrollend"),W=Ve?oe!==null?oe+"Capture":null:oe;Ve=[];for(var K=re,ne;K!==null;){var me=K;if(ne=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ne===null||W===null||(me=Pr(K,W),me!=null&&Ve.push(eu(K,me,ne))),xt)break;K=K.return}0<Ve.length&&(oe=new se(oe,qe,null,o,pe),ge.push({event:oe,listeners:Ve}))}}if((r&7)===0){e:{if(oe=t==="mouseover"||t==="pointerover",se=t==="mouseout"||t==="pointerout",oe&&o!==ea&&(qe=o.relatedTarget||o.fromElement)&&(rr(qe)||qe[Ct]))break e;if((se||oe)&&(oe=pe.window===pe?pe:(oe=pe.ownerDocument)?oe.defaultView||oe.parentWindow:window,se?(qe=o.relatedTarget||o.toElement,se=re,qe=qe?rr(qe):null,qe!==null&&(xt=u(qe),Ve=qe.tag,qe!==xt||Ve!==5&&Ve!==27&&Ve!==6)&&(qe=null)):(se=null,qe=re),se!==qe)){if(Ve=sc,me="onMouseLeave",W="onMouseEnter",K="mouse",(t==="pointerout"||t==="pointerover")&&(Ve=oo,me="onPointerLeave",W="onPointerEnter",K="pointer"),xt=se==null?oe:Yr(se),ne=qe==null?oe:Yr(qe),oe=new Ve(me,K+"leave",se,o,pe),oe.target=xt,oe.relatedTarget=ne,me=null,rr(pe)===re&&(Ve=new Ve(W,K+"enter",qe,o,pe),Ve.target=ne,Ve.relatedTarget=xt,me=Ve),xt=me,se&&qe)t:{for(Ve=se,W=qe,K=0,ne=Ve;ne;ne=Ds(ne))K++;for(ne=0,me=W;me;me=Ds(me))ne++;for(;0<K-ne;)Ve=Ds(Ve),K--;for(;0<ne-K;)W=Ds(W),ne--;for(;K--;){if(Ve===W||W!==null&&Ve===W.alternate)break t;Ve=Ds(Ve),W=Ds(W)}Ve=null}else Ve=null;se!==null&&w0(ge,oe,se,Ve,!1),qe!==null&&xt!==null&&w0(ge,xt,qe,Ve,!0)}}e:{if(oe=re?Yr(re):window,se=oe.nodeName&&oe.nodeName.toLowerCase(),se==="select"||se==="input"&&oe.type==="file")var Ne=vc;else if(yc(oe))if(bc)Ne=ka;else{Ne=_l;var tt=Pd}else se=oe.nodeName,!se||se.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?re&&Wo(re.elementType)&&(Ne=vc):Ne=xc;if(Ne&&(Ne=Ne(t,re))){El(ge,Ne,o,pe);break e}tt&&tt(t,oe,re),t==="focusout"&&re&&oe.type==="number"&&re.memoizedProps.value!=null&&eo(oe,"number",oe.value)}switch(tt=re?Yr(re):window,t){case"focusin":(yc(tt)||tt.contentEditable==="true")&&(T=tt,M=re,z=null);break;case"focusout":z=M=T=null;break;case"mousedown":$=!0;break;case"contextmenu":case"mouseup":case"dragend":$=!1,q(ge,o,pe);break;case"selectionchange":if(S)break;case"keydown":case"keyup":q(ge,o,pe)}var Pe;if(ss)e:{switch(t){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else ja?us(t,o)&&(Ie="onCompositionEnd"):t==="keydown"&&o.keyCode===229&&(Ie="onCompositionStart");Ie&&(lo&&o.locale!=="ko"&&(ja||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&ja&&(Pe=fl()):(ta=pe,Gn="value"in ta?ta.value:ta.textContent,ja=!0)),tt=nf(re,Ie),0<tt.length&&(Ie=new Oa(Ie,t,null,o,pe),ge.push({event:Ie,listeners:tt}),Pe?Ie.data=Pe:(Pe=hc(o),Pe!==null&&(Ie.data=Pe)))),(Pe=Sl?zd(t,o):pc(t,o))&&(Ie=nf(re,"onBeforeInput"),0<Ie.length&&(tt=new Oa("onBeforeInput","beforeinput",null,o,pe),ge.push({event:tt,listeners:Ie}),tt.data=Pe)),H_(ge,t,re,o,pe)}b0(ge,r)})}function eu(t,r,o){return{instance:t,listener:r,currentTarget:o}}function nf(t,r){for(var o=r+"Capture",s=[];t!==null;){var d=t,m=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||m===null||(d=Pr(t,o),d!=null&&s.unshift(eu(t,d,m)),d=Pr(t,r),d!=null&&s.push(eu(t,d,m))),t.tag===3)return s;t=t.return}return[]}function Ds(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function w0(t,r,o,s,d){for(var m=r._reactName,E=[];o!==null&&o!==s;){var C=o,B=C.alternate,re=C.stateNode;if(C=C.tag,B!==null&&B===s)break;C!==5&&C!==26&&C!==27||re===null||(B=re,d?(re=Pr(o,m),re!=null&&E.unshift(eu(o,re,B))):d||(re=Pr(o,m),re!=null&&E.push(eu(o,re,B)))),o=o.return}E.length!==0&&t.push({event:r,listeners:E})}var K_=/\r\n?/g,Y_=/\u0000|\uFFFD/g;function S0(t){return(typeof t=="string"?t:""+t).replace(K_,`
`).replace(Y_,"")}function E0(t,r){return r=S0(r),S0(t)===r}function rf(){}function bt(t,r,o,s,d,m){switch(o){case"children":typeof s=="string"?r==="body"||r==="textarea"&&s===""||zr(t,s):(typeof s=="number"||typeof s=="bigint")&&r!=="body"&&zr(t,""+s);break;case"className":Sa(t,"class",s);break;case"tabIndex":Sa(t,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Sa(t,o,s);break;case"style":ot(t,s,m);break;case"data":if(r!=="object"){Sa(t,"data",s);break}case"src":case"href":if(s===""&&(r!=="a"||o!=="href")){t.removeAttribute(o);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){t.removeAttribute(o);break}s=vn(""+s),t.setAttribute(o,s);break;case"action":case"formAction":if(typeof s=="function"){t.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(o==="formAction"?(r!=="input"&&bt(t,r,"name",d.name,d,null),bt(t,r,"formEncType",d.formEncType,d,null),bt(t,r,"formMethod",d.formMethod,d,null),bt(t,r,"formTarget",d.formTarget,d,null)):(bt(t,r,"encType",d.encType,d,null),bt(t,r,"method",d.method,d,null),bt(t,r,"target",d.target,d,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){t.removeAttribute(o);break}s=vn(""+s),t.setAttribute(o,s);break;case"onClick":s!=null&&(t.onclick=rf);break;case"onScroll":s!=null&&at("scroll",t);break;case"onScrollEnd":s!=null&&at("scrollend",t);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(o=s.__html,o!=null){if(d.children!=null)throw Error(i(60));t.innerHTML=o}}break;case"multiple":t.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":t.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){t.removeAttribute("xlink:href");break}o=vn(""+s),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?t.setAttribute(o,""+s):t.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?t.setAttribute(o,""):t.removeAttribute(o);break;case"capture":case"download":s===!0?t.setAttribute(o,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?t.setAttribute(o,s):t.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?t.setAttribute(o,s):t.removeAttribute(o);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?t.removeAttribute(o):t.setAttribute(o,s);break;case"popover":at("beforetoggle",t),at("toggle",t),Nr(t,"popover",s);break;case"xlinkActuate":ar(t,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ar(t,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ar(t,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ar(t,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ar(t,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ar(t,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ar(t,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ar(t,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ar(t,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Nr(t,"is",s);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=Dd.get(o)||o,Nr(t,o,s))}}function tp(t,r,o,s,d,m){switch(o){case"style":ot(t,s,m);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(o=s.__html,o!=null){if(d.children!=null)throw Error(i(60));t.innerHTML=o}}break;case"children":typeof s=="string"?zr(t,s):(typeof s=="number"||typeof s=="bigint")&&zr(t,""+s);break;case"onScroll":s!=null&&at("scroll",t);break;case"onScrollEnd":s!=null&&at("scrollend",t);break;case"onClick":s!=null&&(t.onclick=rf);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fr.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(d=o.endsWith("Capture"),r=o.slice(2,d?o.length-7:void 0),m=t[Je]||null,m=m!=null?m[o]:null,typeof m=="function"&&t.removeEventListener(r,m,d),typeof s=="function")){typeof m!="function"&&m!==null&&(o in t?t[o]=null:t.hasAttribute(o)&&t.removeAttribute(o)),t.addEventListener(r,s,d);break e}o in t?t[o]=s:s===!0?t.setAttribute(o,""):Nr(t,o,s)}}}function Cn(t,r,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":at("error",t),at("load",t);var s=!1,d=!1,m;for(m in o)if(o.hasOwnProperty(m)){var E=o[m];if(E!=null)switch(m){case"src":s=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:bt(t,r,m,E,o,null)}}d&&bt(t,r,"srcSet",o.srcSet,o,null),s&&bt(t,r,"src",o.src,o,null);return;case"input":at("invalid",t);var C=m=E=d=null,B=null,re=null;for(s in o)if(o.hasOwnProperty(s)){var pe=o[s];if(pe!=null)switch(s){case"name":d=pe;break;case"type":E=pe;break;case"checked":B=pe;break;case"defaultChecked":re=pe;break;case"value":m=pe;break;case"defaultValue":C=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(i(137,r));break;default:bt(t,r,s,pe,o,null)}}Ta(t,m,C,B,re,E,d,!1),Wi(t);return;case"select":at("invalid",t),s=E=m=null;for(d in o)if(o.hasOwnProperty(d)&&(C=o[d],C!=null))switch(d){case"value":m=C;break;case"defaultValue":E=C;break;case"multiple":s=C;default:bt(t,r,d,C,o,null)}r=m,o=E,t.multiple=!!s,r!=null?Jr(t,!!s,r,!1):o!=null&&Jr(t,!!s,o,!0);return;case"textarea":at("invalid",t),m=d=s=null;for(E in o)if(o.hasOwnProperty(E)&&(C=o[E],C!=null))switch(E){case"value":s=C;break;case"defaultValue":d=C;break;case"children":m=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(i(91));break;default:bt(t,r,E,C,o,null)}ul(t,s,d,m),Wi(t);return;case"option":for(B in o)if(o.hasOwnProperty(B)&&(s=o[B],s!=null))switch(B){case"selected":t.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:bt(t,r,B,s,o,null)}return;case"dialog":at("beforetoggle",t),at("toggle",t),at("cancel",t),at("close",t);break;case"iframe":case"object":at("load",t);break;case"video":case"audio":for(s=0;s<Jl.length;s++)at(Jl[s],t);break;case"image":at("error",t),at("load",t);break;case"details":at("toggle",t);break;case"embed":case"source":case"link":at("error",t),at("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in o)if(o.hasOwnProperty(re)&&(s=o[re],s!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:bt(t,r,re,s,o,null)}return;default:if(Wo(r)){for(pe in o)o.hasOwnProperty(pe)&&(s=o[pe],s!==void 0&&tp(t,r,pe,s,o,void 0));return}}for(C in o)o.hasOwnProperty(C)&&(s=o[C],s!=null&&bt(t,r,C,s,o,null))}function F_(t,r,o,s){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,m=null,E=null,C=null,B=null,re=null,pe=null;for(se in o){var ge=o[se];if(o.hasOwnProperty(se)&&ge!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":B=ge;default:s.hasOwnProperty(se)||bt(t,r,se,null,s,ge)}}for(var oe in s){var se=s[oe];if(ge=o[oe],s.hasOwnProperty(oe)&&(se!=null||ge!=null))switch(oe){case"type":m=se;break;case"name":d=se;break;case"checked":re=se;break;case"defaultChecked":pe=se;break;case"value":E=se;break;case"defaultValue":C=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(i(137,r));break;default:se!==ge&&bt(t,r,oe,se,s,ge)}}_a(t,E,C,B,re,pe,m,d);return;case"select":se=E=C=oe=null;for(m in o)if(B=o[m],o.hasOwnProperty(m)&&B!=null)switch(m){case"value":break;case"multiple":se=B;default:s.hasOwnProperty(m)||bt(t,r,m,null,s,B)}for(d in s)if(m=s[d],B=o[d],s.hasOwnProperty(d)&&(m!=null||B!=null))switch(d){case"value":oe=m;break;case"defaultValue":C=m;break;case"multiple":E=m;default:m!==B&&bt(t,r,d,m,s,B)}r=C,o=E,s=se,oe!=null?Jr(t,!!o,oe,!1):!!s!=!!o&&(r!=null?Jr(t,!!o,r,!0):Jr(t,!!o,o?[]:"",!1));return;case"textarea":se=oe=null;for(C in o)if(d=o[C],o.hasOwnProperty(C)&&d!=null&&!s.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:bt(t,r,C,null,s,d)}for(E in s)if(d=s[E],m=o[E],s.hasOwnProperty(E)&&(d!=null||m!=null))switch(E){case"value":oe=d;break;case"defaultValue":se=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(i(91));break;default:d!==m&&bt(t,r,E,d,s,m)}to(t,oe,se);return;case"option":for(var qe in o)if(oe=o[qe],o.hasOwnProperty(qe)&&oe!=null&&!s.hasOwnProperty(qe))switch(qe){case"selected":t.selected=!1;break;default:bt(t,r,qe,null,s,oe)}for(B in s)if(oe=s[B],se=o[B],s.hasOwnProperty(B)&&oe!==se&&(oe!=null||se!=null))switch(B){case"selected":t.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:bt(t,r,B,oe,s,se)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ve in o)oe=o[Ve],o.hasOwnProperty(Ve)&&oe!=null&&!s.hasOwnProperty(Ve)&&bt(t,r,Ve,null,s,oe);for(re in s)if(oe=s[re],se=o[re],s.hasOwnProperty(re)&&oe!==se&&(oe!=null||se!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(i(137,r));break;default:bt(t,r,re,oe,s,se)}return;default:if(Wo(r)){for(var xt in o)oe=o[xt],o.hasOwnProperty(xt)&&oe!==void 0&&!s.hasOwnProperty(xt)&&tp(t,r,xt,void 0,s,oe);for(pe in s)oe=s[pe],se=o[pe],!s.hasOwnProperty(pe)||oe===se||oe===void 0&&se===void 0||tp(t,r,pe,oe,s,se);return}}for(var W in o)oe=o[W],o.hasOwnProperty(W)&&oe!=null&&!s.hasOwnProperty(W)&&bt(t,r,W,null,s,oe);for(ge in s)oe=s[ge],se=o[ge],!s.hasOwnProperty(ge)||oe===se||oe==null&&se==null||bt(t,r,ge,oe,s,se)}var np=null,rp=null;function af(t){return t.nodeType===9?t:t.ownerDocument}function _0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function T0(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function ap(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var ip=null;function G_(){var t=window.event;return t&&t.type==="popstate"?t===ip?!1:(ip=t,!0):(ip=null,!1)}var A0=typeof setTimeout=="function"?setTimeout:void 0,X_=typeof clearTimeout=="function"?clearTimeout:void 0,R0=typeof Promise=="function"?Promise:void 0,Q_=typeof queueMicrotask=="function"?queueMicrotask:typeof R0<"u"?function(t){return R0.resolve(null).then(t).catch(W_)}:A0;function W_(t){setTimeout(function(){throw t})}function Ci(t){return t==="head"}function C0(t,r){var o=r,s=0,d=0;do{var m=o.nextSibling;if(t.removeChild(o),m&&m.nodeType===8)if(o=m.data,o==="/$"){if(0<s&&8>s){o=s;var E=t.ownerDocument;if(o&1&&tu(E.documentElement),o&2&&tu(E.body),o&4)for(o=E.head,tu(o),E=o.firstChild;E;){var C=E.nextSibling,B=E.nodeName;E[Fi]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&E.rel.toLowerCase()==="stylesheet"||o.removeChild(E),E=C}}if(d===0){t.removeChild(m),uu(r);return}d--}else o==="$"||o==="$?"||o==="$!"?d++:s=o.charCodeAt(0)-48;else s=0;o=m}while(o);uu(r)}function op(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var o=r;switch(r=r.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":op(o),yr(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}t.removeChild(o)}}function J_(t,r,o,s){for(;t.nodeType===1;){var d=o;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!s&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(s){if(!t[Fi])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(m=t.getAttribute("rel"),m==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(m!==d.rel||t.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||t.getAttribute("title")!==(d.title==null?null:d.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(m=t.getAttribute("src"),(m!==(d.src==null?null:d.src)||t.getAttribute("type")!==(d.type==null?null:d.type)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&m&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var m=d.name==null?null:""+d.name;if(d.type==="hidden"&&t.getAttribute("name")===m)return t}else return t;if(t=Br(t.nextSibling),t===null)break}return null}function eT(t,r,o){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!o||(t=Br(t.nextSibling),t===null))return null;return t}function sp(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function tT(t,r){var o=t.ownerDocument;if(t.data!=="$?"||o.readyState==="complete")r();else{var s=function(){r(),o.removeEventListener("DOMContentLoaded",s)};o.addEventListener("DOMContentLoaded",s),t._reactRetry=s}}function Br(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="F!"||r==="F")break;if(r==="/$")return null}}return t}var lp=null;function O0(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var o=t.data;if(o==="$"||o==="$!"||o==="$?"){if(r===0)return t;r--}else o==="/$"&&r++}t=t.previousSibling}return null}function D0(t,r,o){switch(r=af(o),t){case"html":if(t=r.documentElement,!t)throw Error(i(452));return t;case"head":if(t=r.head,!t)throw Error(i(453));return t;case"body":if(t=r.body,!t)throw Error(i(454));return t;default:throw Error(i(451))}}function tu(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);yr(t)}var Sr=new Map,j0=new Set;function of(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Fa=be.d;be.d={f:nT,r:rT,D:aT,C:iT,L:oT,m:sT,X:uT,S:lT,M:cT};function nT(){var t=Fa.f(),r=Xc();return t||r}function rT(t){var r=Bn(t);r!==null&&r.tag===5&&r.type==="form"?Qg(r):Fa.r(t)}var js=typeof document>"u"?null:document;function M0(t,r,o){var s=js;if(s&&typeof r=="string"&&r){var d=gn(r);d='link[rel="'+t+'"][href="'+d+'"]',typeof o=="string"&&(d+='[crossorigin="'+o+'"]'),j0.has(d)||(j0.add(d),t={rel:t,crossOrigin:o,href:r},s.querySelector(d)===null&&(r=s.createElement("link"),Cn(r,"link",t),Et(r),s.head.appendChild(r)))}}function aT(t){Fa.D(t),M0("dns-prefetch",t,null)}function iT(t,r){Fa.C(t,r),M0("preconnect",t,r)}function oT(t,r,o){Fa.L(t,r,o);var s=js;if(s&&t&&r){var d='link[rel="preload"][as="'+gn(r)+'"]';r==="image"&&o&&o.imageSrcSet?(d+='[imagesrcset="'+gn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(d+='[imagesizes="'+gn(o.imageSizes)+'"]')):d+='[href="'+gn(t)+'"]';var m=d;switch(r){case"style":m=Ms(t);break;case"script":m=ks(t)}Sr.has(m)||(t=v({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:t,as:r},o),Sr.set(m,t),s.querySelector(d)!==null||r==="style"&&s.querySelector(nu(m))||r==="script"&&s.querySelector(ru(m))||(r=s.createElement("link"),Cn(r,"link",t),Et(r),s.head.appendChild(r)))}}function sT(t,r){Fa.m(t,r);var o=js;if(o&&t){var s=r&&typeof r.as=="string"?r.as:"script",d='link[rel="modulepreload"][as="'+gn(s)+'"][href="'+gn(t)+'"]',m=d;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=ks(t)}if(!Sr.has(m)&&(t=v({rel:"modulepreload",href:t},r),Sr.set(m,t),o.querySelector(d)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(ru(m)))return}s=o.createElement("link"),Cn(s,"link",t),Et(s),o.head.appendChild(s)}}}function lT(t,r,o){Fa.S(t,r,o);var s=js;if(s&&t){var d=ai(s).hoistableStyles,m=Ms(t);r=r||"default";var E=d.get(m);if(!E){var C={loading:0,preload:null};if(E=s.querySelector(nu(m)))C.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":r},o),(o=Sr.get(m))&&up(t,o);var B=E=s.createElement("link");Et(B),Cn(B,"link",t),B._p=new Promise(function(re,pe){B.onload=re,B.onerror=pe}),B.addEventListener("load",function(){C.loading|=1}),B.addEventListener("error",function(){C.loading|=2}),C.loading|=4,sf(E,r,s)}E={type:"stylesheet",instance:E,count:1,state:C},d.set(m,E)}}}function uT(t,r){Fa.X(t,r);var o=js;if(o&&t){var s=ai(o).hoistableScripts,d=ks(t),m=s.get(d);m||(m=o.querySelector(ru(d)),m||(t=v({src:t,async:!0},r),(r=Sr.get(d))&&cp(t,r),m=o.createElement("script"),Et(m),Cn(m,"link",t),o.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},s.set(d,m))}}function cT(t,r){Fa.M(t,r);var o=js;if(o&&t){var s=ai(o).hoistableScripts,d=ks(t),m=s.get(d);m||(m=o.querySelector(ru(d)),m||(t=v({src:t,async:!0,type:"module"},r),(r=Sr.get(d))&&cp(t,r),m=o.createElement("script"),Et(m),Cn(m,"link",t),o.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},s.set(d,m))}}function k0(t,r,o,s){var d=(d=_e.current)?of(d):null;if(!d)throw Error(i(446));switch(t){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(r=Ms(o.href),o=ai(d).hoistableStyles,s=o.get(r),s||(s={type:"style",instance:null,count:0,state:null},o.set(r,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){t=Ms(o.href);var m=ai(d).hoistableStyles,E=m.get(t);if(E||(d=d.ownerDocument||d,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,E),(m=d.querySelector(nu(t)))&&!m._p&&(E.instance=m,E.state.loading=5),Sr.has(t)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Sr.set(t,o),m||fT(d,t,o,E.state))),r&&s===null)throw Error(i(528,""));return E}if(r&&s!==null)throw Error(i(529,""));return null;case"script":return r=o.async,o=o.src,typeof o=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=ks(o),o=ai(d).hoistableScripts,s=o.get(r),s||(s={type:"script",instance:null,count:0,state:null},o.set(r,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,t))}}function Ms(t){return'href="'+gn(t)+'"'}function nu(t){return'link[rel="stylesheet"]['+t+"]"}function N0(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function fT(t,r,o,s){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?s.loading=1:(r=t.createElement("link"),s.preload=r,r.addEventListener("load",function(){return s.loading|=1}),r.addEventListener("error",function(){return s.loading|=2}),Cn(r,"link",o),Et(r),t.head.appendChild(r))}function ks(t){return'[src="'+gn(t)+'"]'}function ru(t){return"script[async]"+t}function z0(t,r,o){if(r.count++,r.instance===null)switch(r.type){case"style":var s=t.querySelector('style[data-href~="'+gn(o.href)+'"]');if(s)return r.instance=s,Et(s),s;var d=v({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return s=(t.ownerDocument||t).createElement("style"),Et(s),Cn(s,"style",d),sf(s,o.precedence,t),r.instance=s;case"stylesheet":d=Ms(o.href);var m=t.querySelector(nu(d));if(m)return r.state.loading|=4,r.instance=m,Et(m),m;s=N0(o),(d=Sr.get(d))&&up(s,d),m=(t.ownerDocument||t).createElement("link"),Et(m);var E=m;return E._p=new Promise(function(C,B){E.onload=C,E.onerror=B}),Cn(m,"link",s),r.state.loading|=4,sf(m,o.precedence,t),r.instance=m;case"script":return m=ks(o.src),(d=t.querySelector(ru(m)))?(r.instance=d,Et(d),d):(s=o,(d=Sr.get(m))&&(s=v({},o),cp(s,d)),t=t.ownerDocument||t,d=t.createElement("script"),Et(d),Cn(d,"link",s),t.head.appendChild(d),r.instance=d);case"void":return null;default:throw Error(i(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(s=r.instance,r.state.loading|=4,sf(s,o.precedence,t));return r.instance}function sf(t,r,o){for(var s=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=s.length?s[s.length-1]:null,m=d,E=0;E<s.length;E++){var C=s[E];if(C.dataset.precedence===r)m=C;else if(m!==d)break}m?m.parentNode.insertBefore(t,m.nextSibling):(r=o.nodeType===9?o.head:o,r.insertBefore(t,r.firstChild))}function up(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function cp(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var lf=null;function P0(t,r,o){if(lf===null){var s=new Map,d=lf=new Map;d.set(o,s)}else d=lf,s=d.get(o),s||(s=new Map,d.set(o,s));if(s.has(t))return s;for(s.set(t,null),o=o.getElementsByTagName(t),d=0;d<o.length;d++){var m=o[d];if(!(m[Fi]||m[Gt]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var E=m.getAttribute(r)||"";E=t+E;var C=s.get(E);C?C.push(m):s.set(E,[m])}}return s}function L0(t,r,o){t=t.ownerDocument||t,t.head.insertBefore(o,r==="title"?t.querySelector("head > title"):null)}function dT(t,r,o){if(o===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return t=r.disabled,typeof r.precedence=="string"&&t==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function B0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var au=null;function hT(){}function pT(t,r,o){if(au===null)throw Error(i(475));var s=au;if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var d=Ms(o.href),m=t.querySelector(nu(d));if(m){t=m._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(s.count++,s=uf.bind(s),t.then(s,s)),r.state.loading|=4,r.instance=m,Et(m);return}m=t.ownerDocument||t,o=N0(o),(d=Sr.get(d))&&up(o,d),m=m.createElement("link"),Et(m);var E=m;E._p=new Promise(function(C,B){E.onload=C,E.onerror=B}),Cn(m,"link",o),r.instance=m}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(s.count++,r=uf.bind(s),t.addEventListener("load",r),t.addEventListener("error",r))}}function mT(){if(au===null)throw Error(i(475));var t=au;return t.stylesheets&&t.count===0&&fp(t,t.stylesheets),0<t.count?function(r){var o=setTimeout(function(){if(t.stylesheets&&fp(t,t.stylesheets),t.unsuspend){var s=t.unsuspend;t.unsuspend=null,s()}},6e4);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(o)}}:null}function uf(){if(this.count--,this.count===0){if(this.stylesheets)fp(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var cf=null;function fp(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,cf=new Map,r.forEach(yT,t),cf=null,uf.call(t))}function yT(t,r){if(!(r.state.loading&4)){var o=cf.get(t);if(o)var s=o.get(null);else{o=new Map,cf.set(t,o);for(var d=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<d.length;m++){var E=d[m];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(o.set(E.dataset.precedence,E),s=E)}s&&o.set(null,s)}d=r.instance,E=d.getAttribute("data-precedence"),m=o.get(E)||s,m===s&&o.set(null,d),o.set(E,d),this.count++,s=uf.bind(this),d.addEventListener("load",s),d.addEventListener("error",s),m?m.parentNode.insertBefore(d,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(d,t.firstChild)),r.state.loading|=4}}var iu={$$typeof:L,Provider:null,Consumer:null,_currentValue:Me,_currentValue2:Me,_threadCount:0};function gT(t,r,o,s,d,m,E,C){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ki(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ki(0),this.hiddenUpdates=Ki(null),this.identifierPrefix=s,this.onUncaughtError=d,this.onCaughtError=m,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function U0(t,r,o,s,d,m,E,C,B,re,pe,ge){return t=new gT(t,r,o,E,C,B,re,ge),r=1,m===!0&&(r|=24),m=Tn(3,null,null,r),t.current=m,m.stateNode=t,r=Kd(),r.refCount++,t.pooledCache=r,r.refCount++,m.memoizedState={element:s,isDehydrated:o,cache:r},Xd(m),t}function V0(t){return t?(t=qt,t):qt}function I0(t,r,o,s,d,m){d=V0(d),s.context===null?s.context=d:s.pendingContext=d,s=mi(r),s.payload={element:o},m=m===void 0?null:m,m!==null&&(s.callback=m),o=yi(t,s,r),o!==null&&(fr(o,t,r),zl(o,t,r))}function H0(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var o=t.retryLane;t.retryLane=o!==0&&o<r?o:r}}function dp(t,r){H0(t,r),(t=t.alternate)&&H0(t,r)}function $0(t){if(t.tag===13){var r=Bt(t,67108864);r!==null&&fr(r,t,67108864),dp(t,67108864)}}var ff=!0;function vT(t,r,o,s){var d=de.T;de.T=null;var m=be.p;try{be.p=2,hp(t,r,o,s)}finally{be.p=m,de.T=d}}function bT(t,r,o,s){var d=de.T;de.T=null;var m=be.p;try{be.p=8,hp(t,r,o,s)}finally{be.p=m,de.T=d}}function hp(t,r,o,s){if(ff){var d=pp(s);if(d===null)ep(t,r,s,df,o),Z0(t,s);else if(wT(d,t,r,o,s))s.stopPropagation();else if(Z0(t,s),r&4&&-1<xT.indexOf(t)){for(;d!==null;){var m=Bn(d);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var E=yn(m.pendingLanes);if(E!==0){var C=m;for(C.pendingLanes|=2,C.entangledLanes|=2;E;){var B=1<<31-Pt(E);C.entanglements[1]|=B,E&=~B}la(m),(mt&6)===0&&(Fc=st()+500,Wl(0))}}break;case 13:C=Bt(m,2),C!==null&&fr(C,m,2),Xc(),dp(m,2)}if(m=pp(s),m===null&&ep(t,r,s,df,o),m===d)break;d=m}d!==null&&s.stopPropagation()}else ep(t,r,s,null,o)}}function pp(t){return t=oi(t),mp(t)}var df=null;function mp(t){if(df=null,t=rr(t),t!==null){var r=u(t);if(r===null)t=null;else{var o=r.tag;if(o===13){if(t=f(r),t!==null)return t;t=null}else if(o===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return df=t,null}function q0(t){switch(t){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch($r()){case qr:return 2;case Yn:return 8;case ln:case Ln:return 32;case Dr:return 268435456;default:return 32}default:return 32}}var yp=!1,Oi=null,Di=null,ji=null,ou=new Map,su=new Map,Mi=[],xT="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".split(" ");function Z0(t,r){switch(t){case"focusin":case"focusout":Oi=null;break;case"dragenter":case"dragleave":Di=null;break;case"mouseover":case"mouseout":ji=null;break;case"pointerover":case"pointerout":ou.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":su.delete(r.pointerId)}}function lu(t,r,o,s,d,m){return t===null||t.nativeEvent!==m?(t={blockedOn:r,domEventName:o,eventSystemFlags:s,nativeEvent:m,targetContainers:[d]},r!==null&&(r=Bn(r),r!==null&&$0(r)),t):(t.eventSystemFlags|=s,r=t.targetContainers,d!==null&&r.indexOf(d)===-1&&r.push(d),t)}function wT(t,r,o,s,d){switch(r){case"focusin":return Oi=lu(Oi,t,r,o,s,d),!0;case"dragenter":return Di=lu(Di,t,r,o,s,d),!0;case"mouseover":return ji=lu(ji,t,r,o,s,d),!0;case"pointerover":var m=d.pointerId;return ou.set(m,lu(ou.get(m)||null,t,r,o,s,d)),!0;case"gotpointercapture":return m=d.pointerId,su.set(m,lu(su.get(m)||null,t,r,o,s,d)),!0}return!1}function K0(t){var r=rr(t.target);if(r!==null){var o=u(r);if(o!==null){if(r=o.tag,r===13){if(r=f(o),r!==null){t.blockedOn=r,ri(t.priority,function(){if(o.tag===13){var s=cr();s=rl(s);var d=Bt(o,s);d!==null&&fr(d,o,s),dp(o,s)}});return}}else if(r===3&&o.stateNode.current.memoizedState.isDehydrated){t.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}t.blockedOn=null}function hf(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var o=pp(t.nativeEvent);if(o===null){o=t.nativeEvent;var s=new o.constructor(o.type,o);ea=s,o.target.dispatchEvent(s),ea=null}else return r=Bn(o),r!==null&&$0(r),t.blockedOn=o,!1;r.shift()}return!0}function Y0(t,r,o){hf(t)&&o.delete(r)}function ST(){yp=!1,Oi!==null&&hf(Oi)&&(Oi=null),Di!==null&&hf(Di)&&(Di=null),ji!==null&&hf(ji)&&(ji=null),ou.forEach(Y0),su.forEach(Y0)}function pf(t,r){t.blockedOn===r&&(t.blockedOn=null,yp||(yp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ST)))}var mf=null;function F0(t){mf!==t&&(mf=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){mf===t&&(mf=null);for(var r=0;r<t.length;r+=3){var o=t[r],s=t[r+1],d=t[r+2];if(typeof s!="function"){if(mp(s||o)===null)continue;break}var m=Bn(o);m!==null&&(t.splice(r,3),r-=3,mh(m,{pending:!0,data:d,method:o.method,action:s},s,d))}}))}function uu(t){function r(B){return pf(B,t)}Oi!==null&&pf(Oi,t),Di!==null&&pf(Di,t),ji!==null&&pf(ji,t),ou.forEach(r),su.forEach(r);for(var o=0;o<Mi.length;o++){var s=Mi[o];s.blockedOn===t&&(s.blockedOn=null)}for(;0<Mi.length&&(o=Mi[0],o.blockedOn===null);)K0(o),o.blockedOn===null&&Mi.shift();if(o=(t.ownerDocument||t).$$reactFormReplay,o!=null)for(s=0;s<o.length;s+=3){var d=o[s],m=o[s+1],E=d[Je]||null;if(typeof m=="function")E||F0(o);else if(E){var C=null;if(m&&m.hasAttribute("formAction")){if(d=m,E=m[Je]||null)C=E.formAction;else if(mp(d)!==null)continue}else C=E.action;typeof C=="function"?o[s+1]=C:(o.splice(s,3),s-=3),F0(o)}}}function gp(t){this._internalRoot=t}yf.prototype.render=gp.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(i(409));var o=r.current,s=cr();I0(o,s,t,r,null,null)},yf.prototype.unmount=gp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;I0(t.current,2,null,t,null,null),Xc(),r[Ct]=null}};function yf(t){this._internalRoot=t}yf.prototype.unstable_scheduleHydration=function(t){if(t){var r=wa();t={blockedOn:null,target:t,priority:r};for(var o=0;o<Mi.length&&r!==0&&r<Mi[o].priority;o++);Mi.splice(o,0,t),o===0&&K0(t)}};var G0=n.version;if(G0!=="19.1.1")throw Error(i(527,G0,"19.1.1"));be.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=y(r),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var ET={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:de,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gf.isDisabled&&gf.supportsFiber)try{un=gf.inject(ET),St=gf}catch{}}return fu.createRoot=function(t,r){if(!l(t))throw Error(i(299));var o=!1,s="",d=fv,m=dv,E=hv,C=null;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(s=r.identifierPrefix),r.onUncaughtError!==void 0&&(d=r.onUncaughtError),r.onCaughtError!==void 0&&(m=r.onCaughtError),r.onRecoverableError!==void 0&&(E=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(C=r.unstable_transitionCallbacks)),r=U0(t,1,!1,null,null,o,s,d,m,E,C,null),t[Ct]=r.current,Jh(t),new gp(r)},fu.hydrateRoot=function(t,r,o){if(!l(t))throw Error(i(299));var s=!1,d="",m=fv,E=dv,C=hv,B=null,re=null;return o!=null&&(o.unstable_strictMode===!0&&(s=!0),o.identifierPrefix!==void 0&&(d=o.identifierPrefix),o.onUncaughtError!==void 0&&(m=o.onUncaughtError),o.onCaughtError!==void 0&&(E=o.onCaughtError),o.onRecoverableError!==void 0&&(C=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(B=o.unstable_transitionCallbacks),o.formState!==void 0&&(re=o.formState)),r=U0(t,1,!0,r,o??null,s,d,m,E,C,B,re),r.context=V0(null),o=r.current,s=cr(),s=rl(s),d=mi(s),d.callback=null,yi(o,d,s),o=s,r.current.lanes=o,ni(r,o),la(r),t[Ct]=r.current,Jh(t),new yf(r)},fu.version="19.1.1",fu}var ib;function kT(){if(ib)return xp.exports;ib=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),xp.exports=MT(),xp.exports}var NT=kT(),_p={exports:{}},Tp={};/**
 * @license React
 * use-sync-external-store-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 ob;function zT(){if(ob)return Tp;ob=1;var e=ld();function n(y,g){return y===g&&(y!==0||1/y===1/g)||y!==y&&g!==g}var a=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,l=e.useRef,u=e.useEffect,f=e.useMemo,p=e.useDebugValue;return Tp.useSyncExternalStoreWithSelector=function(y,g,v,w,_){var O=l(null);if(O.current===null){var A={hasValue:!1,value:null};O.current=A}else A=O.current;O=f(function(){function N(ee){if(!P){if(P=!0,H=ee,ee=w(ee),_!==void 0&&A.hasValue){var fe=A.value;if(_(fe,ee))return L=fe}return L=ee}if(fe=L,a(H,ee))return fe;var ue=w(ee);return _!==void 0&&_(fe,ue)?(H=ee,fe):(H=ee,L=ue)}var P=!1,H,L,ae=v===void 0?null:v;return[function(){return N(g())},ae===null?void 0:function(){return N(ae())}]},[g,v,w,_]);var j=i(y,O[0],O[1]);return u(function(){A.hasValue=!0,A.value=j},[j]),p(j),j},Tp}var sb;function PT(){return sb||(sb=1,_p.exports=zT()),_p.exports}var LT=PT();function BT(e){e()}function UT(){let e=null,n=null;return{clear(){e=null,n=null},notify(){BT(()=>{let a=e;for(;a;)a.callback(),a=a.next})},get(){const a=[];let i=e;for(;i;)a.push(i),i=i.next;return a},subscribe(a){let i=!0;const l=n={callback:a,next:null,prev:n};return l.prev?l.prev.next=l:e=l,function(){!i||e===null||(i=!1,l.next?l.next.prev=l.prev:n=l.prev,l.prev?l.prev.next=l.next:e=l.next)}}}}var lb={notify(){},get:()=>[]};function VT(e,n){let a,i=lb,l=0,u=!1;function f(j){v();const N=i.subscribe(j);let P=!1;return()=>{P||(P=!0,N(),w())}}function p(){i.notify()}function y(){A.onStateChange&&A.onStateChange()}function g(){return u}function v(){l++,a||(a=e.subscribe(y),i=UT())}function w(){l--,a&&l===0&&(a(),a=void 0,i.clear(),i=lb)}function _(){u||(u=!0,v())}function O(){u&&(u=!1,w())}const A={addNestedSub:f,notifyNestedSubs:p,handleChangeWrapper:y,isSubscribed:g,trySubscribe:_,tryUnsubscribe:O,getListeners:()=>i};return A}var IT=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",HT=IT(),$T=()=>typeof navigator<"u"&&navigator.product==="ReactNative",qT=$T(),ZT=()=>HT||qT?D.useLayoutEffect:D.useEffect,KT=ZT(),YT=Symbol.for("react-redux-context"),FT=typeof globalThis<"u"?globalThis:{};function GT(){if(!D.createContext)return{};const e=FT[YT]??=new Map;let n=e.get(D.createContext);return n||(n=D.createContext(null),e.set(D.createContext,n)),n}var Ui=GT();function XT(e){const{children:n,context:a,serverState:i,store:l}=e,u=D.useMemo(()=>{const y=VT(l);return{store:l,subscription:y,getServerState:i?()=>i:void 0}},[l,i]),f=D.useMemo(()=>l.getState(),[l]);KT(()=>{const{subscription:y}=u;return y.onStateChange=y.notifyNestedSubs,y.trySubscribe(),f!==l.getState()&&y.notifyNestedSubs(),()=>{y.tryUnsubscribe(),y.onStateChange=void 0}},[u,f]);const p=a||Ui;return D.createElement(p.Provider,{value:u},n)}var QT=XT;function Im(e=Ui){return function(){return D.useContext(e)}}var Ox=Im();function Dx(e=Ui){const n=e===Ui?Ox:Im(e),a=()=>{const{store:i}=n();return i};return Object.assign(a,{withTypes:()=>a}),a}var WT=Dx();function JT(e=Ui){const n=e===Ui?WT:Dx(e),a=()=>n().dispatch;return Object.assign(a,{withTypes:()=>a}),a}var eA=JT(),tA=(e,n)=>e===n;function nA(e=Ui){const n=e===Ui?Ox:Im(e),a=(i,l={})=>{const{equalityFn:u=tA}=typeof l=="function"?{equalityFn:l}:l,f=n(),{store:p,subscription:y,getServerState:g}=f;D.useRef(!0);const v=D.useCallback({[i.name](_){return i(_)}}[i.name],[i]),w=LT.useSyncExternalStoreWithSelector(y.addNestedSub,p.getState,g||p.getState,v,u);return D.useDebugValue(w),w};return Object.assign(a,{withTypes:()=>a}),a}var rA=nA();/**
 * react-router v7.9.4
 *
 * 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
 */var ub="popstate";function aA(e={}){function n(i,l){let{pathname:u,search:f,hash:p}=i.location;return tm("",{pathname:u,search:f,hash:p},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function a(i,l){return typeof l=="string"?l:Mu(l)}return oA(n,a,null,e)}function Vt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function pa(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function iA(){return Math.random().toString(36).substring(2,10)}function cb(e,n){return{usr:e.state,key:e.key,idx:n}}function tm(e,n,a=null,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?Xs(n):n,state:a,key:n&&n.key||i||iA()}}function Mu({pathname:e="/",search:n="",hash:a=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function Xs(e){let n={};if(e){let a=e.indexOf("#");a>=0&&(n.hash=e.substring(a),e=e.substring(0,a));let i=e.indexOf("?");i>=0&&(n.search=e.substring(i),e=e.substring(0,i)),e&&(n.pathname=e)}return n}function oA(e,n,a,i={}){let{window:l=document.defaultView,v5Compat:u=!1}=i,f=l.history,p="POP",y=null,g=v();g==null&&(g=0,f.replaceState({...f.state,idx:g},""));function v(){return(f.state||{idx:null}).idx}function w(){p="POP";let N=v(),P=N==null?null:N-g;g=N,y&&y({action:p,location:j.location,delta:P})}function _(N,P){p="PUSH";let H=tm(j.location,N,P);g=v()+1;let L=cb(H,g),ae=j.createHref(H);try{f.pushState(L,"",ae)}catch(ee){if(ee instanceof DOMException&&ee.name==="DataCloneError")throw ee;l.location.assign(ae)}u&&y&&y({action:p,location:j.location,delta:1})}function O(N,P){p="REPLACE";let H=tm(j.location,N,P);g=v();let L=cb(H,g),ae=j.createHref(H);f.replaceState(L,"",ae),u&&y&&y({action:p,location:j.location,delta:0})}function A(N){return sA(N)}let j={get action(){return p},get location(){return e(l,f)},listen(N){if(y)throw new Error("A history only accepts one active listener");return l.addEventListener(ub,w),y=N,()=>{l.removeEventListener(ub,w),y=null}},createHref(N){return n(l,N)},createURL:A,encodeLocation(N){let P=A(N);return{pathname:P.pathname,search:P.search,hash:P.hash}},push:_,replace:O,go(N){return f.go(N)}};return j}function sA(e,n=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),Vt(a,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:Mu(e);return i=i.replace(/ $/,"%20"),!n&&i.startsWith("//")&&(i=a+i),new URL(i,a)}function jx(e,n,a="/"){return lA(e,n,a,!1)}function lA(e,n,a,i){let l=typeof n=="string"?Xs(n):n,u=Qa(l.pathname||"/",a);if(u==null)return null;let f=Mx(e);uA(f);let p=null;for(let y=0;p==null&&y<f.length;++y){let g=xA(u);p=vA(f[y],g,i)}return p}function Mx(e,n=[],a=[],i="",l=!1){let u=(f,p,y=l,g)=>{let v={relativePath:g===void 0?f.path||"":g,caseSensitive:f.caseSensitive===!0,childrenIndex:p,route:f};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(i)&&y)return;Vt(v.relativePath.startsWith(i),`Absolute route path "${v.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(i.length)}let w=Ga([i,v.relativePath]),_=a.concat(v);f.children&&f.children.length>0&&(Vt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${w}".`),Mx(f.children,n,_,w,y)),!(f.path==null&&!f.index)&&n.push({path:w,score:yA(w,f.index),routesMeta:_})};return e.forEach((f,p)=>{if(f.path===""||!f.path?.includes("?"))u(f,p);else for(let y of kx(f.path))u(f,p,!0,y)}),n}function kx(e){let n=e.split("/");if(n.length===0)return[];let[a,...i]=n,l=a.endsWith("?"),u=a.replace(/\?$/,"");if(i.length===0)return l?[u,""]:[u];let f=kx(i.join("/")),p=[];return p.push(...f.map(y=>y===""?u:[u,y].join("/"))),l&&p.push(...f),p.map(y=>e.startsWith("/")&&y===""?"/":y)}function uA(e){e.sort((n,a)=>n.score!==a.score?a.score-n.score:gA(n.routesMeta.map(i=>i.childrenIndex),a.routesMeta.map(i=>i.childrenIndex)))}var cA=/^:[\w-]+$/,fA=3,dA=2,hA=1,pA=10,mA=-2,fb=e=>e==="*";function yA(e,n){let a=e.split("/"),i=a.length;return a.some(fb)&&(i+=mA),n&&(i+=dA),a.filter(l=>!fb(l)).reduce((l,u)=>l+(cA.test(u)?fA:u===""?hA:pA),i)}function gA(e,n){return e.length===n.length&&e.slice(0,-1).every((i,l)=>i===n[l])?e[e.length-1]-n[n.length-1]:0}function vA(e,n,a=!1){let{routesMeta:i}=e,l={},u="/",f=[];for(let p=0;p<i.length;++p){let y=i[p],g=p===i.length-1,v=u==="/"?n:n.slice(u.length)||"/",w=qf({path:y.relativePath,caseSensitive:y.caseSensitive,end:g},v),_=y.route;if(!w&&g&&a&&!i[i.length-1].route.index&&(w=qf({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},v)),!w)return null;Object.assign(l,w.params),f.push({params:l,pathname:Ga([u,w.pathname]),pathnameBase:_A(Ga([u,w.pathnameBase])),route:_}),w.pathnameBase!=="/"&&(u=Ga([u,w.pathnameBase]))}return f}function qf(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,i]=bA(e.path,e.caseSensitive,e.end),l=n.match(a);if(!l)return null;let u=l[0],f=u.replace(/(.)\/+$/,"$1"),p=l.slice(1);return{params:i.reduce((g,{paramName:v,isOptional:w},_)=>{if(v==="*"){let A=p[_]||"";f=u.slice(0,u.length-A.length).replace(/(.)\/+$/,"$1")}const O=p[_];return w&&!O?g[v]=void 0:g[v]=(O||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:f,pattern:e}}function bA(e,n=!1,a=!0){pa(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let i=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,y)=>(i.push({paramName:p,isOptional:y!=null}),y?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,n?void 0:"i"),i]}function xA(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return pa(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function Qa(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let a=n.endsWith("/")?n.length-1:n.length,i=e.charAt(a);return i&&i!=="/"?null:e.slice(a)||"/"}function wA(e,n="/"){let{pathname:a,search:i="",hash:l=""}=typeof e=="string"?Xs(e):e;return{pathname:a?a.startsWith("/")?a:SA(a,n):n,search:TA(i),hash:AA(l)}}function SA(e,n){let a=n.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?a.length>1&&a.pop():l!=="."&&a.push(l)}),a.length>1?a.join("/"):"/"}function Ap(e,n,a,i){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(i)}].  Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function EA(e){return e.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function Nx(e){let n=EA(e);return n.map((a,i)=>i===n.length-1?a.pathname:a.pathnameBase)}function zx(e,n,a,i=!1){let l;typeof e=="string"?l=Xs(e):(l={...e},Vt(!l.pathname||!l.pathname.includes("?"),Ap("?","pathname","search",l)),Vt(!l.pathname||!l.pathname.includes("#"),Ap("#","pathname","hash",l)),Vt(!l.search||!l.search.includes("#"),Ap("#","search","hash",l)));let u=e===""||l.pathname==="",f=u?"/":l.pathname,p;if(f==null)p=a;else{let w=n.length-1;if(!i&&f.startsWith("..")){let _=f.split("/");for(;_[0]==="..";)_.shift(),w-=1;l.pathname=_.join("/")}p=w>=0?n[w]:"/"}let y=wA(l,p),g=f&&f!=="/"&&f.endsWith("/"),v=(u||f===".")&&a.endsWith("/");return!y.pathname.endsWith("/")&&(g||v)&&(y.pathname+="/"),y}var Ga=e=>e.join("/").replace(/\/\/+/g,"/"),_A=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),TA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,AA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function RA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Px=["POST","PUT","PATCH","DELETE"];new Set(Px);var CA=["GET",...Px];new Set(CA);var Qs=D.createContext(null);Qs.displayName="DataRouter";var ud=D.createContext(null);ud.displayName="DataRouterState";D.createContext(!1);var Lx=D.createContext({isTransitioning:!1});Lx.displayName="ViewTransition";var OA=D.createContext(new Map);OA.displayName="Fetchers";var DA=D.createContext(null);DA.displayName="Await";var ya=D.createContext(null);ya.displayName="Navigation";var Ku=D.createContext(null);Ku.displayName="Location";var ga=D.createContext({outlet:null,matches:[],isDataRoute:!1});ga.displayName="Route";var Hm=D.createContext(null);Hm.displayName="RouteError";function jA(e,{relative:n}={}){Vt(Yu(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:i}=D.useContext(ya),{hash:l,pathname:u,search:f}=Gu(e,{relative:n}),p=u;return a!=="/"&&(p=u==="/"?a:Ga([a,u])),i.createHref({pathname:p,search:f,hash:l})}function Yu(){return D.useContext(Ku)!=null}function Ii(){return Vt(Yu(),"useLocation() may be used only in the context of a <Router> component."),D.useContext(Ku).location}var Bx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ux(e){D.useContext(ya).static||D.useLayoutEffect(e)}function Fu(){let{isDataRoute:e}=D.useContext(ga);return e?ZA():MA()}function MA(){Vt(Yu(),"useNavigate() may be used only in the context of a <Router> component.");let e=D.useContext(Qs),{basename:n,navigator:a}=D.useContext(ya),{matches:i}=D.useContext(ga),{pathname:l}=Ii(),u=JSON.stringify(Nx(i)),f=D.useRef(!1);return Ux(()=>{f.current=!0}),D.useCallback((y,g={})=>{if(pa(f.current,Bx),!f.current)return;if(typeof y=="number"){a.go(y);return}let v=zx(y,JSON.parse(u),l,g.relative==="path");e==null&&n!=="/"&&(v.pathname=v.pathname==="/"?n:Ga([n,v.pathname])),(g.replace?a.replace:a.push)(v,g.state,g)},[n,a,u,l,e])}D.createContext(null);function kA(){let{matches:e}=D.useContext(ga),n=e[e.length-1];return n?n.params:{}}function Gu(e,{relative:n}={}){let{matches:a}=D.useContext(ga),{pathname:i}=Ii(),l=JSON.stringify(Nx(a));return D.useMemo(()=>zx(e,JSON.parse(l),i,n==="path"),[e,l,i,n])}function NA(e,n){return Vx(e,n)}function Vx(e,n,a,i,l){Vt(Yu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=D.useContext(ya),{matches:f}=D.useContext(ga),p=f[f.length-1],y=p?p.params:{},g=p?p.pathname:"/",v=p?p.pathnameBase:"/",w=p&&p.route;{let H=w&&w.path||"";Ix(g,!w||H.endsWith("*")||H.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${H}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
 
Please change the parent <Route path="${H}"> to <Route path="${H==="/"?"*":`${H}/*`}">.`)}let _=Ii(),O;if(n){let H=typeof n=="string"?Xs(n):n;Vt(v==="/"||H.pathname?.startsWith(v),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${v}" but pathname "${H.pathname}" was given in the \`location\` prop.`),O=H}else O=_;let A=O.pathname||"/",j=A;if(v!=="/"){let H=v.replace(/^\//,"").split("/");j="/"+A.replace(/^\//,"").split("/").slice(H.length).join("/")}let N=jx(e,{pathname:j});pa(w||N!=null,`No routes matched location "${O.pathname}${O.search}${O.hash}" `),pa(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${O.pathname}${O.search}${O.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let P=UA(N&&N.map(H=>Object.assign({},H,{params:Object.assign({},y,H.params),pathname:Ga([v,u.encodeLocation?u.encodeLocation(H.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathname]),pathnameBase:H.pathnameBase==="/"?v:Ga([v,u.encodeLocation?u.encodeLocation(H.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathnameBase])})),f,a,i,l);return n&&P?D.createElement(Ku.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...O},navigationType:"POP"}},P):P}function zA(){let e=qA(),n=RA(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:i},u={padding:"2px 4px",backgroundColor:i},f=null;return console.error("Error handled by React Router default ErrorBoundary:",e),f=D.createElement(D.Fragment,null,D.createElement("p",null,"💿 Hey developer 👋"),D.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",D.createElement("code",{style:u},"ErrorBoundary")," or"," ",D.createElement("code",{style:u},"errorElement")," prop on your route.")),D.createElement(D.Fragment,null,D.createElement("h2",null,"Unexpected Application Error!"),D.createElement("h3",{style:{fontStyle:"italic"}},n),a?D.createElement("pre",{style:l},a):null,f)}var PA=D.createElement(zA,null),LA=class extends D.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){this.props.unstable_onError?this.props.unstable_onError(e,n):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?D.createElement(ga.Provider,{value:this.props.routeContext},D.createElement(Hm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function BA({routeContext:e,match:n,children:a}){let i=D.useContext(Qs);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),D.createElement(ga.Provider,{value:e},a)}function UA(e,n=[],a=null,i=null,l=null){if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(n.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let u=e,f=a?.errors;if(f!=null){let g=u.findIndex(v=>v.route.id&&f?.[v.route.id]!==void 0);Vt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),u=u.slice(0,Math.min(u.length,g+1))}let p=!1,y=-1;if(a)for(let g=0;g<u.length;g++){let v=u[g];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(y=g),v.route.id){let{loaderData:w,errors:_}=a,O=v.route.loader&&!w.hasOwnProperty(v.route.id)&&(!_||_[v.route.id]===void 0);if(v.route.lazy||O){p=!0,y>=0?u=u.slice(0,y+1):u=[u[0]];break}}}return u.reduceRight((g,v,w)=>{let _,O=!1,A=null,j=null;a&&(_=f&&v.route.id?f[v.route.id]:void 0,A=v.route.errorElement||PA,p&&(y<0&&w===0?(Ix("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),O=!0,j=null):y===w&&(O=!0,j=v.route.hydrateFallbackElement||null)));let N=n.concat(u.slice(0,w+1)),P=()=>{let H;return _?H=A:O?H=j:v.route.Component?H=D.createElement(v.route.Component,null):v.route.element?H=v.route.element:H=g,D.createElement(BA,{match:v,routeContext:{outlet:g,matches:N,isDataRoute:a!=null},children:H})};return a&&(v.route.ErrorBoundary||v.route.errorElement||w===0)?D.createElement(LA,{location:a.location,revalidation:a.revalidation,component:A,error:_,children:P(),routeContext:{outlet:null,matches:N,isDataRoute:!0},unstable_onError:i}):P()},null)}function $m(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function VA(e){let n=D.useContext(Qs);return Vt(n,$m(e)),n}function IA(e){let n=D.useContext(ud);return Vt(n,$m(e)),n}function HA(e){let n=D.useContext(ga);return Vt(n,$m(e)),n}function qm(e){let n=HA(e),a=n.matches[n.matches.length-1];return Vt(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function $A(){return qm("useRouteId")}function qA(){let e=D.useContext(Hm),n=IA("useRouteError"),a=qm("useRouteError");return e!==void 0?e:n.errors?.[a]}function ZA(){let{router:e}=VA("useNavigate"),n=qm("useNavigate"),a=D.useRef(!1);return Ux(()=>{a.current=!0}),D.useCallback(async(l,u={})=>{pa(a.current,Bx),a.current&&(typeof l=="number"?e.navigate(l):await e.navigate(l,{fromRouteId:n,...u}))},[e,n])}var db={};function Ix(e,n,a){!n&&!db[e]&&(db[e]=!0,pa(!1,a))}D.memo(KA);function KA({routes:e,future:n,state:a,unstable_onError:i}){return Vx(e,void 0,a,i,n)}function nm(e){Vt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function YA({basename:e="/",children:n=null,location:a,navigationType:i="POP",navigator:l,static:u=!1}){Vt(!Yu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),p=D.useMemo(()=>({basename:f,navigator:l,static:u,future:{}}),[f,l,u]);typeof a=="string"&&(a=Xs(a));let{pathname:y="/",search:g="",hash:v="",state:w=null,key:_="default"}=a,O=D.useMemo(()=>{let A=Qa(y,f);return A==null?null:{location:{pathname:A,search:g,hash:v,state:w,key:_},navigationType:i}},[f,y,g,v,w,_,i]);return pa(O!=null,`<Router basename="${f}"> is not able to match the URL "${y}${g}${v}" because it does not start with the basename, so the <Router> won't render anything.`),O==null?null:D.createElement(ya.Provider,{value:p},D.createElement(Ku.Provider,{children:n,value:O}))}function FA({children:e,location:n}){return NA(rm(e),n)}function rm(e,n=[]){let a=[];return D.Children.forEach(e,(i,l)=>{if(!D.isValidElement(i))return;let u=[...n,l];if(i.type===D.Fragment){a.push.apply(a,rm(i.props.children,u));return}Vt(i.type===nm,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Vt(!i.props.index||!i.props.children,"An index route cannot have child routes.");let f={id:i.props.id||u.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(f.children=rm(i.props.children,u)),a.push(f)}),a}var zf="get",Pf="application/x-www-form-urlencoded";function cd(e){return e!=null&&typeof e.tagName=="string"}function GA(e){return cd(e)&&e.tagName.toLowerCase()==="button"}function XA(e){return cd(e)&&e.tagName.toLowerCase()==="form"}function QA(e){return cd(e)&&e.tagName.toLowerCase()==="input"}function WA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function JA(e,n){return e.button===0&&(!n||n==="_self")&&!WA(e)}var vf=null;function e2(){if(vf===null)try{new FormData(document.createElement("form"),0),vf=!1}catch{vf=!0}return vf}var t2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Rp(e){return e!=null&&!t2.has(e)?(pa(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Pf}"`),null):e}function n2(e,n){let a,i,l,u,f;if(XA(e)){let p=e.getAttribute("action");i=p?Qa(p,n):null,a=e.getAttribute("method")||zf,l=Rp(e.getAttribute("enctype"))||Pf,u=new FormData(e)}else if(GA(e)||QA(e)&&(e.type==="submit"||e.type==="image")){let p=e.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=e.getAttribute("formaction")||p.getAttribute("action");if(i=y?Qa(y,n):null,a=e.getAttribute("formmethod")||p.getAttribute("method")||zf,l=Rp(e.getAttribute("formenctype"))||Rp(p.getAttribute("enctype"))||Pf,u=new FormData(p,e),!e2()){let{name:g,type:v,value:w}=e;if(v==="image"){let _=g?`${g}.`:"";u.append(`${_}x`,"0"),u.append(`${_}y`,"0")}else g&&u.append(g,w)}}else{if(cd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=zf,i=null,l=Pf,f=e}return u&&l==="text/plain"&&(f=u,u=void 0),{action:i,method:a.toLowerCase(),encType:l,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Zm(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function r2(e,n,a){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return i.pathname==="/"?i.pathname=`_root.${a}`:n&&Qa(i.pathname,n)==="/"?i.pathname=`${n.replace(/\/$/,"")}/_root.${a}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${a}`,i}async function a2(e,n){if(e.id in n)return n[e.id];try{let a=await import(e.module);return n[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function i2(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function o2(e,n,a){let i=await Promise.all(e.map(async l=>{let u=n.routes[l.route.id];if(u){let f=await a2(u,a);return f.links?f.links():[]}return[]}));return c2(i.flat(1).filter(i2).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function hb(e,n,a,i,l,u){let f=(y,g)=>a[g]?y.route.id!==a[g].route.id:!0,p=(y,g)=>a[g].pathname!==y.pathname||a[g].route.path?.endsWith("*")&&a[g].params["*"]!==y.params["*"];return u==="assets"?n.filter((y,g)=>f(y,g)||p(y,g)):u==="data"?n.filter((y,g)=>{let v=i.routes[y.route.id];if(!v||!v.hasLoader)return!1;if(f(y,g)||p(y,g))return!0;if(y.route.shouldRevalidate){let w=y.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:a[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function s2(e,n,{includeHydrateFallback:a}={}){return l2(e.map(i=>{let l=n.routes[i.route.id];if(!l)return[];let u=[l.module];return l.clientActionModule&&(u=u.concat(l.clientActionModule)),l.clientLoaderModule&&(u=u.concat(l.clientLoaderModule)),a&&l.hydrateFallbackModule&&(u=u.concat(l.hydrateFallbackModule)),l.imports&&(u=u.concat(l.imports)),u}).flat(1))}function l2(e){return[...new Set(e)]}function u2(e){let n={},a=Object.keys(e).sort();for(let i of a)n[i]=e[i];return n}function c2(e,n){let a=new Set;return new Set(n),e.reduce((i,l)=>{let u=JSON.stringify(u2(l));return a.has(u)||(a.add(u),i.push({key:u,link:l})),i},[])}function Hx(){let e=D.useContext(Qs);return Zm(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function f2(){let e=D.useContext(ud);return Zm(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Km=D.createContext(void 0);Km.displayName="FrameworkContext";function $x(){let e=D.useContext(Km);return Zm(e,"You must render this element inside a <HydratedRouter> element"),e}function d2(e,n){let a=D.useContext(Km),[i,l]=D.useState(!1),[u,f]=D.useState(!1),{onFocus:p,onBlur:y,onMouseEnter:g,onMouseLeave:v,onTouchStart:w}=n,_=D.useRef(null);D.useEffect(()=>{if(e==="render"&&f(!0),e==="viewport"){let j=P=>{P.forEach(H=>{f(H.isIntersecting)})},N=new IntersectionObserver(j,{threshold:.5});return _.current&&N.observe(_.current),()=>{N.disconnect()}}},[e]),D.useEffect(()=>{if(i){let j=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(j)}}},[i]);let O=()=>{l(!0)},A=()=>{l(!1),f(!1)};return a?e!=="intent"?[u,_,{}]:[u,_,{onFocus:du(p,O),onBlur:du(y,A),onMouseEnter:du(g,O),onMouseLeave:du(v,A),onTouchStart:du(w,O)}]:[!1,_,{}]}function du(e,n){return a=>{e&&e(a),a.defaultPrevented||n(a)}}function h2({page:e,...n}){let{router:a}=Hx(),i=D.useMemo(()=>jx(a.routes,e,a.basename),[a.routes,e,a.basename]);return i?D.createElement(m2,{page:e,matches:i,...n}):null}function p2(e){let{manifest:n,routeModules:a}=$x(),[i,l]=D.useState([]);return D.useEffect(()=>{let u=!1;return o2(e,n,a).then(f=>{u||l(f)}),()=>{u=!0}},[e,n,a]),i}function m2({page:e,matches:n,...a}){let i=Ii(),{manifest:l,routeModules:u}=$x(),{basename:f}=Hx(),{loaderData:p,matches:y}=f2(),g=D.useMemo(()=>hb(e,n,y,l,i,"data"),[e,n,y,l,i]),v=D.useMemo(()=>hb(e,n,y,l,i,"assets"),[e,n,y,l,i]),w=D.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let A=new Set,j=!1;if(n.forEach(P=>{let H=l.routes[P.route.id];!H||!H.hasLoader||(!g.some(L=>L.route.id===P.route.id)&&P.route.id in p&&u[P.route.id]?.shouldRevalidate||H.hasClientLoader?j=!0:A.add(P.route.id))}),A.size===0)return[];let N=r2(e,f,"data");return j&&A.size>0&&N.searchParams.set("_routes",n.filter(P=>A.has(P.route.id)).map(P=>P.route.id).join(",")),[N.pathname+N.search]},[f,p,i,l,g,n,e,u]),_=D.useMemo(()=>s2(v,l),[v,l]),O=p2(v);return D.createElement(D.Fragment,null,w.map(A=>D.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...a})),_.map(A=>D.createElement("link",{key:A,rel:"modulepreload",href:A,...a})),O.map(({key:A,link:j})=>D.createElement("link",{key:A,nonce:a.nonce,...j})))}function y2(...e){return n=>{e.forEach(a=>{typeof a=="function"?a(n):a!=null&&(a.current=n)})}}var qx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{qx&&(window.__reactRouterVersion="7.9.4")}catch{}function g2({basename:e,children:n,window:a}){let i=D.useRef();i.current==null&&(i.current=aA({window:a,v5Compat:!0}));let l=i.current,[u,f]=D.useState({action:l.action,location:l.location}),p=D.useCallback(y=>{D.startTransition(()=>f(y))},[f]);return D.useLayoutEffect(()=>l.listen(p),[l,p]),D.createElement(YA,{basename:e,children:n,location:u.location,navigationType:u.action,navigator:l})}var Zx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kx=D.forwardRef(function({onClick:n,discover:a="render",prefetch:i="none",relative:l,reloadDocument:u,replace:f,state:p,target:y,to:g,preventScrollReset:v,viewTransition:w,..._},O){let{basename:A}=D.useContext(ya),j=typeof g=="string"&&Zx.test(g),N,P=!1;if(typeof g=="string"&&j&&(N=g,qx))try{let Oe=new URL(window.location.href),Be=g.startsWith("//")?new URL(Oe.protocol+g):new URL(g),Xe=Qa(Be.pathname,A);Be.origin===Oe.origin&&Xe!=null?g=Xe+Be.search+Be.hash:P=!0}catch{pa(!1,`<Link to="${g}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let H=jA(g,{relative:l}),[L,ae,ee]=d2(i,_),fe=w2(g,{replace:f,state:p,target:y,preventScrollReset:v,relative:l,viewTransition:w});function ue(Oe){n&&n(Oe),Oe.defaultPrevented||fe(Oe)}let le=D.createElement("a",{..._,...ee,href:N||H,onClick:P||u?n:ue,ref:y2(O,ae),target:y,"data-discover":!j&&a==="render"?"true":void 0});return L&&!j?D.createElement(D.Fragment,null,le,D.createElement(h2,{page:H})):le});Kx.displayName="Link";var v2=D.forwardRef(function({"aria-current":n="page",caseSensitive:a=!1,className:i="",end:l=!1,style:u,to:f,viewTransition:p,children:y,...g},v){let w=Gu(f,{relative:g.relative}),_=Ii(),O=D.useContext(ud),{navigator:A,basename:j}=D.useContext(ya),N=O!=null&&A2(w)&&p===!0,P=A.encodeLocation?A.encodeLocation(w).pathname:w.pathname,H=_.pathname,L=O&&O.navigation&&O.navigation.location?O.navigation.location.pathname:null;a||(H=H.toLowerCase(),L=L?L.toLowerCase():null,P=P.toLowerCase()),L&&j&&(L=Qa(L,j)||L);const ae=P!=="/"&&P.endsWith("/")?P.length-1:P.length;let ee=H===P||!l&&H.startsWith(P)&&H.charAt(ae)==="/",fe=L!=null&&(L===P||!l&&L.startsWith(P)&&L.charAt(P.length)==="/"),ue={isActive:ee,isPending:fe,isTransitioning:N},le=ee?n:void 0,Oe;typeof i=="function"?Oe=i(ue):Oe=[i,ee?"active":null,fe?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let Be=typeof u=="function"?u(ue):u;return D.createElement(Kx,{...g,"aria-current":le,className:Oe,ref:v,style:Be,to:f,viewTransition:p},typeof y=="function"?y(ue):y)});v2.displayName="NavLink";var b2=D.forwardRef(({discover:e="render",fetcherKey:n,navigate:a,reloadDocument:i,replace:l,state:u,method:f=zf,action:p,onSubmit:y,relative:g,preventScrollReset:v,viewTransition:w,..._},O)=>{let A=_2(),j=T2(p,{relative:g}),N=f.toLowerCase()==="get"?"get":"post",P=typeof p=="string"&&Zx.test(p),H=L=>{if(y&&y(L),L.defaultPrevented)return;L.preventDefault();let ae=L.nativeEvent.submitter,ee=ae?.getAttribute("formmethod")||f;A(ae||L.currentTarget,{fetcherKey:n,method:ee,navigate:a,replace:l,state:u,relative:g,preventScrollReset:v,viewTransition:w})};return D.createElement("form",{ref:O,method:N,action:j,onSubmit:i?y:H,..._,"data-discover":!P&&e==="render"?"true":void 0})});b2.displayName="Form";function x2(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Yx(e){let n=D.useContext(Qs);return Vt(n,x2(e)),n}function w2(e,{target:n,replace:a,state:i,preventScrollReset:l,relative:u,viewTransition:f}={}){let p=Fu(),y=Ii(),g=Gu(e,{relative:u});return D.useCallback(v=>{if(JA(v,n)){v.preventDefault();let w=a!==void 0?a:Mu(y)===Mu(g);p(e,{replace:w,state:i,preventScrollReset:l,relative:u,viewTransition:f})}},[y,p,g,a,i,n,e,l,u,f])}var S2=0,E2=()=>`__${String(++S2)}__`;function _2(){let{router:e}=Yx("useSubmit"),{basename:n}=D.useContext(ya),a=$A();return D.useCallback(async(i,l={})=>{let{action:u,method:f,encType:p,formData:y,body:g}=n2(i,n);if(l.navigate===!1){let v=l.fetcherKey||E2();await e.fetch(v,a,l.action||u,{preventScrollReset:l.preventScrollReset,formData:y,body:g,formMethod:l.method||f,formEncType:l.encType||p,flushSync:l.flushSync})}else await e.navigate(l.action||u,{preventScrollReset:l.preventScrollReset,formData:y,body:g,formMethod:l.method||f,formEncType:l.encType||p,replace:l.replace,state:l.state,fromRouteId:a,flushSync:l.flushSync,viewTransition:l.viewTransition})},[e,n,a])}function T2(e,{relative:n}={}){let{basename:a}=D.useContext(ya),i=D.useContext(ga);Vt(i,"useFormAction must be used inside a RouteContext");let[l]=i.matches.slice(-1),u={...Gu(e||".",{relative:n})},f=Ii();if(e==null){u.search=f.search;let p=new URLSearchParams(u.search),y=p.getAll("index");if(y.some(v=>v==="")){p.delete("index"),y.filter(w=>w).forEach(w=>p.append("index",w));let v=p.toString();u.search=v?`?${v}`:""}}return(!e||e===".")&&l.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(u.pathname=u.pathname==="/"?a:Ga([a,u.pathname])),Mu(u)}function A2(e,{relative:n}={}){let a=D.useContext(Lx);Vt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Yx("useViewTransitionState"),l=Gu(e,{relative:n});if(!a.isTransitioning)return!1;let u=Qa(a.currentLocation.pathname,i)||a.currentLocation.pathname,f=Qa(a.nextLocation.pathname,i)||a.nextLocation.pathname;return qf(l.pathname,f)!=null||qf(l.pathname,u)!=null}const Lf={IDLE:"idle",PENDING:"pending",SUCCEEDED:"succeeded"},qn={ERROR_ACTION:"Error during an action",ERROR_VALIDATION:"Validation failed",ERROR_PROJECT_NOT_FOUND:e=>`Project "${e}" not found in local database`,NAME_EMPTY:"Project name is required",NAME_REQUEST:"Project name must be 25 characters or less",NAME_DUPLICATE:"A project with this name already exists",NOT_FOUND_AFTER_UPDATE:"Project not found after update",UNEXPECTED_SERVER_ERROR:"Unexpected server error",CANVAS_REQUIRED_WIDTH_MIN:"Canvas width must be at least 100px",CANVAS_REQUIRED_WIDTH_MAX:"Canvas width cannot exceed 4000px",CANVAS_REQUIRED_HEIGHT_MIN:"Canvas height must be at least 100px",CANVAS_REQUIRED_HEIGHT_MAX:"Canvas height cannot exceed 4000px"},ku={HOME:"/",EDITOR:"/project",EDITOR_BY_ID:e=>`/project/${e}`},fd=[1,2,4,8,12,20],Ym=["#111827","#EF4444","#F59E0B","#10B981","#3B82F6","#8B5CF6","#EC4899","#F3F4F6"],Ns={FETCH_ALL:"/fetchAll",FETCH_BY_PARAM:"/fetchByParam",CREATE_ONE:"/createOne",UPDATE_ONE:"/updateOne",DELETE_ONE:"/deleteOne"},Xu={SET_ACTIVE_ID:"layers/setActiveId",SET_CURRENT_PROJECT:"layers/setCurrentProject",UPDATE_SNAPSHOT:"layers/updateSnapshot",REPLACE_FROM_SNAPSHOT:"layers/replaceSnapshot",LAYER_INIT_BASE:"layers/ensureInitialLayer"},Fx={LOAD_HISTORY_FROM_DB:"history/loadFromDB",APPLY_SNAPSHOT:"history/applyCurrentSnapshot"},Fm={PROJECTS_CLEAR_ALL:"projects/clearAll",PROJECT_UPSET:"projects/upsertProject",PROJECT_SET_ACTIVE_ID:"projects/setActiveProjectId"},R2={LOAD_PROJECT_DATA:"editor/loadProjectData"},Ar={IDLE:"idle",PENDING:"pending",SUCCEEDED:"succeeded",FAILED:"failed"},zn={NAME:e=>`Layer ${e}`,CREATED:e=>`Created layer: ${e}`,DELETED:e=>`Deleted layer: ${e}`,UPDATED:e=>`Updated layer: ${e}`,OPACITY_ADJUSTED:e=>`Adjusted opacity (${e})`,RENAMED:e=>`Renamed layer → “${e}”`,REORDERED:"Reordered:",REORDERED_LAYERS:"Reordered layers",RESTORED_LAYER:"Restored Layer",REORDER_LABEL_BELOW:(e,n)=>`“${e}” below “${n}”`,REORDER_LABEL_ABOVE:(e,n)=>`“${e}” above “${n}”`,REORDER_LABEL_SWAP:(e,n)=>`Reordered: “${e}” ↔ “${n}”`,CREATE_BASE_LAYER:e=>`Created base layer "${e}"`,ERROR_ACTION:"Error during a layer action",ERROR_VALIDATION:"Validation failed",NAME_EMPTY:"Layer name is required",NOT_FOUND_AFTER_UPDATE:"Layer not found after update",ERROR_FETCH_BY_PROJECT:"Failed to load layers for the selected project.",TABLE_NAME:"layers",NEW_LAYER:"Layer"},Gm={INITIAL_NAME:"Layer 1",UNTITLED_PROJECT:"Untitled"},C2={LAYER_NOT_FOUND:e=>`Layer with id ${e} not found after update`},dr={PROJECTS:"projects",HISTORY:"history",LAYERS:"layers",EDITOR:"editor",ACTIVE_PROJECT:"activeProject"},Pn={BRUSH:"brush",LINE:"line",SHAPE:"shape",ERASER:"eraser"},am={RECT:"rect",CIRCLE:"circle"},Ir={PROJECT_ID:"projectId",ID:"id",STATE_PROJECT_ID:"state.projectId",TIMESTAMP:"timestamp",Z_INDEX:"zIndex",NAME:"name",UPDATED_AT:"updatedAt"},Dt={SHOW_GRID:"Show Grid",HIDE_GRID:"Hide Grid",DRAW_RECTANGLE:"Draw rectangle",SNAPSHOT:"Snapshot",APPLY_SNAPSHOT:"Applied snapshot",NAME:e=>`Action ${e}`,LAYERS:"Layers",HISTORY:"History",SHAPE_TOOL:"Shape",LINE_TOOL:"Line",LINE_TOOL_SUB:"Thickness & Color",ERASER_TOOL:"Eraser",ERASER_TOOL_SIZE:"Size",BRUSH_TOOL:"Brush",BRUSH_TOOL_SUB:"Size & Color",MODAL_CREATE:"Create new project",MODAL_CREATE_BUTTON:"Create",MODAL_DELETE_BUTTON:"Delete",MODAL_DELETE:"Delete project",MODAL_UPDATE:"Update project name",MODAL_UPDATE_BUTTON:"Update",LAYER_SHOW:"Show layer",LAYER_HIDE:"Hide layer"},O2={brush:"Draw brush",line:"Draw line",shape:"Draw shape",eraser:"Erase"},pb={rect:"Draw rectangle",circle:"Draw circle"};/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const D2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),j2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,a,i)=>i?i.toUpperCase():a.toLowerCase()),mb=e=>{const n=j2(e);return n.charAt(0).toUpperCase()+n.slice(1)},Gx=(...e)=>e.filter((n,a,i)=>!!n&&n.trim()!==""&&i.indexOf(n)===a).join(" ").trim(),M2=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var k2={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.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const N2=D.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:l="",children:u,iconNode:f,...p},y)=>D.createElement("svg",{ref:y,...k2,width:n,height:n,stroke:e,strokeWidth:i?Number(a)*24/Number(n):a,className:Gx("lucide",l),...!u&&!M2(p)&&{"aria-hidden":"true"},...p},[...f.map(([g,v])=>D.createElement(g,v)),...Array.isArray(u)?u:[u]]));/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wt=(e,n)=>{const a=D.forwardRef(({className:i,...l},u)=>D.createElement(N2,{ref:u,iconNode:n,className:Gx(`lucide-${D2(mb(e))}`,`lucide-${e}`,i),...l}));return a.displayName=mb(e),a};/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const z2=[["path",{d:"m11 10 3 3",key:"fzmg1i"}],["path",{d:"M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z",key:"p4q2r7"}],["path",{d:"M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031",key:"wy6l02"}]],Xx=wt("brush",z2);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const P2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Qx=wt("circle",P2);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const L2=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],B2=wt("ellipsis-vertical",L2);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const U2=[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]],Wx=wt("eraser",U2);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const V2=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],I2=wt("eye-off",V2);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const H2=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],$2=wt("eye",H2);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const q2=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],Z2=wt("file-plus",q2);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const K2=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Y2=wt("folder-open",K2);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const F2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],G2=wt("grid-3x3",F2);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const X2=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],Q2=wt("hand",X2);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const W2=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],J2=wt("history",W2);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eR=[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19 3 3v-5.5",key:"9ldu5r"}],["path",{d:"m17 22 3-3",key:"1nkfve"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],tR=wt("image-down",eR);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nR=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],rR=wt("layers",nR);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aR=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],iR=wt("maximize-2",aR);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oR=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],sR=wt("minimize-2",oR);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lR=[["path",{d:"M5 12h14",key:"1ays0h"}]],uR=wt("minus",lR);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cR=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],fR=wt("pen-line",cR);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dR=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],hR=wt("pencil",dR);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],mR=wt("plus",pR);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yR=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],Jx=wt("redo-2",yR);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gR=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],vR=wt("save",gR);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bR=[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]],xR=wt("shuffle",bR);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wR=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],SR=wt("slash",wR);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ER=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],_R=wt("sliders-horizontal",ER);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],AR=wt("square-plus",TR);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Xm=wt("square",RR);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CR=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ew=wt("trash-2",CR);/**
 * @license lucide-react v0.548.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const OR=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],tw=wt("undo-2",OR),Tt={BRUSH:"brush",LINE:"line",SHAPE_RECT:"shape-rect",SHAPE_CIRCLE:"shape-circle",ERASER:"eraser",EDIT:"edit",TRASH:"trash",SHUFFLE:"shuffle",SLIDERS:"sliders",PLUS_SQUARE:"plus-square"},DR={[Tt.BRUSH]:Xx,[Tt.ERASER]:Wx,[Tt.LINE]:uR,[Tt.SHAPE_RECT]:Xm,[Tt.SHAPE_CIRCLE]:Qx,[Tt.EDIT]:fR,[Tt.TRASH]:ew,[Tt.SHUFFLE]:xR,[Tt.SLIDERS]:_R,[Tt.PLUS_SQUARE]:AR},yb={[Tt.BRUSH]:"text-indigo-500 bg-indigo-100",[Tt.ERASER]:"text-rose-500 bg-rose-100",[Tt.LINE]:"text-emerald-500 bg-emerald-100",[Tt.SHAPE_RECT]:"text-violet-500 bg-violet-100",[Tt.SHAPE_CIRCLE]:"text-violet-500 bg-violet-100",[Tt.PLUS_SQUARE]:"text-emerald-600 bg-emerald-100",[Tt.TRASH]:"text-rose-600 bg-rose-100",[Tt.EDIT]:"text-blue-600 bg-blue-100",[Tt.SHUFFLE]:"text-indigo-600 bg-indigo-100",[Tt.SLIDERS]:"text-amber-600 bg-amber-100",DEFAULT:"text-gray-500 bg-gray-100"};function jR(e,n,a){if(a)return a;switch(e){case"brush":return Tt.BRUSH;case"eraser":return Tt.ERASER;case"line":return Tt.LINE;case"shape":return n==="circle"?Tt.SHAPE_CIRCLE:Tt.SHAPE_RECT;default:return Tt.EDIT}}const Ni={FILE:{NEW:{label:"New Project",icon:Z2},SAVE:{label:"Save Project",icon:vR},EXPORT:{label:"Export PNG",icon:tR}},PROJECTS:{OPEN_ALL:{label:"All Projects",icon:Y2}}},bf={NEW:"text-emerald-600",SAVE:"text-blue-600",EXPORT:"text-amber-600",OPEN_ALL:"text-purple-600"},MR=e=>`FPS:   ${e}`,kR=e=>`Frame: ${e} ms`,NR=e=>`Max:   ${e.toFixed(2)} ms`,zR=e=>`Lost:  ${e}`,Qm=D.createContext({});function $o(e){const n=D.useRef(null);return n.current===null&&(n.current=e()),n.current}const Wm=typeof window<"u",Jm=Wm?D.useLayoutEffect:D.useEffect,dd=D.createContext(null);function ey(e,n){e.indexOf(n)===-1&&e.push(n)}function ty(e,n){const a=e.indexOf(n);a>-1&&e.splice(a,1)}function PR([...e],n,a){const i=n<0?e.length+n:n;if(i>=0&&i<e.length){const l=a<0?e.length+a:a,[u]=e.splice(n,1);e.splice(l,0,u)}return e}const Wa=(e,n,a)=>a>n?n:a<e?e:a;let ny=()=>{};const Ja={},nw=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function rw(e){return typeof e=="object"&&e!==null}const aw=e=>/^0[^.\s]+$/u.test(e);function ry(e){let n;return()=>(n===void 0&&(n=e()),n)}const Cr=e=>e,LR=(e,n)=>a=>n(e(a)),Qu=(...e)=>e.reduce(LR),Nu=(e,n,a)=>{const i=n-e;return i===0?1:(a-e)/i};class ay{constructor(){this.subscriptions=[]}add(n){return ey(this.subscriptions,n),()=>ty(this.subscriptions,n)}notify(n,a,i){const l=this.subscriptions.length;if(l)if(l===1)this.subscriptions[0](n,a,i);else for(let u=0;u<l;u++){const f=this.subscriptions[u];f&&f(n,a,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const da=e=>e*1e3,Rr=e=>e/1e3;function iw(e,n){return n?e*(1e3/n):0}const ow=(e,n,a)=>(((1-3*a+3*n)*e+(3*a-6*n))*e+3*n)*e,BR=1e-7,UR=12;function VR(e,n,a,i,l){let u,f,p=0;do f=n+(a-n)/2,u=ow(f,i,l)-e,u>0?a=f:n=f;while(Math.abs(u)>BR&&++p<UR);return f}function Wu(e,n,a,i){if(e===n&&a===i)return Cr;const l=u=>VR(u,0,1,e,a);return u=>u===0||u===1?u:ow(l(u),n,i)}const sw=e=>n=>n<=.5?e(2*n)/2:(2-e(2*(1-n)))/2,lw=e=>n=>1-e(1-n),uw=Wu(.33,1.53,.69,.99),iy=lw(uw),cw=sw(iy),fw=e=>(e*=2)<1?.5*iy(e):.5*(2-Math.pow(2,-10*(e-1))),oy=e=>1-Math.sin(Math.acos(e)),dw=lw(oy),hw=sw(oy),IR=Wu(.42,0,1,1),HR=Wu(0,0,.58,1),pw=Wu(.42,0,.58,1),$R=e=>Array.isArray(e)&&typeof e[0]!="number",mw=e=>Array.isArray(e)&&typeof e[0]=="number",qR={linear:Cr,easeIn:IR,easeInOut:pw,easeOut:HR,circIn:oy,circInOut:hw,circOut:dw,backIn:iy,backInOut:cw,backOut:uw,anticipate:fw},ZR=e=>typeof e=="string",gb=e=>{if(mw(e)){ny(e.length===4);const[n,a,i,l]=e;return Wu(n,a,i,l)}else if(ZR(e))return qR[e];return e},xf=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function KR(e,n){let a=new Set,i=new Set,l=!1,u=!1;const f=new WeakSet;let p={delta:0,timestamp:0,isProcessing:!1};function y(v){f.has(v)&&(g.schedule(v),e()),v(p)}const g={schedule:(v,w=!1,_=!1)=>{const A=_&&l?a:i;return w&&f.add(v),A.has(v)||A.add(v),v},cancel:v=>{i.delete(v),f.delete(v)},process:v=>{if(p=v,l){u=!0;return}l=!0,[a,i]=[i,a],a.forEach(y),a.clear(),l=!1,u&&(u=!1,g.process(v))}};return g}const YR=40;function yw(e,n){let a=!1,i=!0;const l={delta:0,timestamp:0,isProcessing:!1},u=()=>a=!0,f=xf.reduce((L,ae)=>(L[ae]=KR(u),L),{}),{setup:p,read:y,resolveKeyframes:g,preUpdate:v,update:w,preRender:_,render:O,postRender:A}=f,j=()=>{const L=Ja.useManualTiming?l.timestamp:performance.now();a=!1,Ja.useManualTiming||(l.delta=i?1e3/60:Math.max(Math.min(L-l.timestamp,YR),1)),l.timestamp=L,l.isProcessing=!0,p.process(l),y.process(l),g.process(l),v.process(l),w.process(l),_.process(l),O.process(l),A.process(l),l.isProcessing=!1,a&&n&&(i=!1,e(j))},N=()=>{a=!0,i=!0,l.isProcessing||e(j)};return{schedule:xf.reduce((L,ae)=>{const ee=f[ae];return L[ae]=(fe,ue=!1,le=!1)=>(a||N(),ee.schedule(fe,ue,le)),L},{}),cancel:L=>{for(let ae=0;ae<xf.length;ae++)f[xf[ae]].cancel(L)},state:l,steps:f}}const{schedule:Ot,cancel:ei,state:Dn,steps:Cp}=yw(typeof requestAnimationFrame<"u"?requestAnimationFrame:Cr,!0);let Bf;function FR(){Bf=void 0}const er={now:()=>(Bf===void 0&&er.set(Dn.isProcessing||Ja.useManualTiming?Dn.timestamp:performance.now()),Bf),set:e=>{Bf=e,queueMicrotask(FR)}},gw=e=>n=>typeof n=="string"&&n.startsWith(e),sy=gw("--"),GR=gw("var(--"),ly=e=>GR(e)?XR.test(e.split("/*")[0].trim()):!1,XR=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ws={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},zu={...Ws,transform:e=>Wa(0,1,e)},wf={...Ws,default:1},_u=e=>Math.round(e*1e5)/1e5,uy=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function QR(e){return e==null}const WR=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,cy=(e,n)=>a=>!!(typeof a=="string"&&WR.test(a)&&a.startsWith(e)||n&&!QR(a)&&Object.prototype.hasOwnProperty.call(a,n)),vw=(e,n,a)=>i=>{if(typeof i!="string")return i;const[l,u,f,p]=i.match(uy);return{[e]:parseFloat(l),[n]:parseFloat(u),[a]:parseFloat(f),alpha:p!==void 0?parseFloat(p):1}},JR=e=>Wa(0,255,e),Op={...Ws,transform:e=>Math.round(JR(e))},Do={test:cy("rgb","red"),parse:vw("red","green","blue"),transform:({red:e,green:n,blue:a,alpha:i=1})=>"rgba("+Op.transform(e)+", "+Op.transform(n)+", "+Op.transform(a)+", "+_u(zu.transform(i))+")"};function eC(e){let n="",a="",i="",l="";return e.length>5?(n=e.substring(1,3),a=e.substring(3,5),i=e.substring(5,7),l=e.substring(7,9)):(n=e.substring(1,2),a=e.substring(2,3),i=e.substring(3,4),l=e.substring(4,5),n+=n,a+=a,i+=i,l+=l),{red:parseInt(n,16),green:parseInt(a,16),blue:parseInt(i,16),alpha:l?parseInt(l,16)/255:1}}const im={test:cy("#"),parse:eC,transform:Do.transform},Ju=e=>({test:n=>typeof n=="string"&&n.endsWith(e)&&n.split(" ").length===1,parse:parseFloat,transform:n=>`${n}${e}`}),zi=Ju("deg"),ha=Ju("%"),Ze=Ju("px"),tC=Ju("vh"),nC=Ju("vw"),vb={...ha,parse:e=>ha.parse(e)/100,transform:e=>ha.transform(e*100)},zs={test:cy("hsl","hue"),parse:vw("hue","saturation","lightness"),transform:({hue:e,saturation:n,lightness:a,alpha:i=1})=>"hsla("+Math.round(e)+", "+ha.transform(_u(n))+", "+ha.transform(_u(a))+", "+_u(zu.transform(i))+")"},on={test:e=>Do.test(e)||im.test(e)||zs.test(e),parse:e=>Do.test(e)?Do.parse(e):zs.test(e)?zs.parse(e):im.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Do.transform(e):zs.transform(e),getAnimatableNone:e=>{const n=on.parse(e);return n.alpha=0,on.transform(n)}},rC=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function aC(e){return isNaN(e)&&typeof e=="string"&&(e.match(uy)?.length||0)+(e.match(rC)?.length||0)>0}const bw="number",xw="color",iC="var",oC="var(",bb="${}",sC=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Pu(e){const n=e.toString(),a=[],i={color:[],number:[],var:[]},l=[];let u=0;const p=n.replace(sC,y=>(on.test(y)?(i.color.push(u),l.push(xw),a.push(on.parse(y))):y.startsWith(oC)?(i.var.push(u),l.push(iC),a.push(y)):(i.number.push(u),l.push(bw),a.push(parseFloat(y))),++u,bb)).split(bb);return{values:a,split:p,indexes:i,types:l}}function ww(e){return Pu(e).values}function Sw(e){const{split:n,types:a}=Pu(e),i=n.length;return l=>{let u="";for(let f=0;f<i;f++)if(u+=n[f],l[f]!==void 0){const p=a[f];p===bw?u+=_u(l[f]):p===xw?u+=on.transform(l[f]):u+=l[f]}return u}}const lC=e=>typeof e=="number"?0:on.test(e)?on.getAnimatableNone(e):e;function uC(e){const n=ww(e);return Sw(e)(n.map(lC))}const Vi={test:aC,parse:ww,createTransformer:Sw,getAnimatableNone:uC};function Dp(e,n,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+(n-e)*6*a:a<1/2?n:a<2/3?e+(n-e)*(2/3-a)*6:e}function cC({hue:e,saturation:n,lightness:a,alpha:i}){e/=360,n/=100,a/=100;let l=0,u=0,f=0;if(!n)l=u=f=a;else{const p=a<.5?a*(1+n):a+n-a*n,y=2*a-p;l=Dp(y,p,e+1/3),u=Dp(y,p,e),f=Dp(y,p,e-1/3)}return{red:Math.round(l*255),green:Math.round(u*255),blue:Math.round(f*255),alpha:i}}function Zf(e,n){return a=>a>0?n:e}const kt=(e,n,a)=>e+(n-e)*a,jp=(e,n,a)=>{const i=e*e,l=a*(n*n-i)+i;return l<0?0:Math.sqrt(l)},fC=[im,Do,zs],dC=e=>fC.find(n=>n.test(e));function xb(e){const n=dC(e);if(!n)return!1;let a=n.parse(e);return n===zs&&(a=cC(a)),a}const wb=(e,n)=>{const a=xb(e),i=xb(n);if(!a||!i)return Zf(e,n);const l={...a};return u=>(l.red=jp(a.red,i.red,u),l.green=jp(a.green,i.green,u),l.blue=jp(a.blue,i.blue,u),l.alpha=kt(a.alpha,i.alpha,u),Do.transform(l))},om=new Set(["none","hidden"]);function hC(e,n){return om.has(e)?a=>a<=0?e:n:a=>a>=1?n:e}function pC(e,n){return a=>kt(e,n,a)}function fy(e){return typeof e=="number"?pC:typeof e=="string"?ly(e)?Zf:on.test(e)?wb:gC:Array.isArray(e)?Ew:typeof e=="object"?on.test(e)?wb:mC:Zf}function Ew(e,n){const a=[...e],i=a.length,l=e.map((u,f)=>fy(u)(u,n[f]));return u=>{for(let f=0;f<i;f++)a[f]=l[f](u);return a}}function mC(e,n){const a={...e,...n},i={};for(const l in a)e[l]!==void 0&&n[l]!==void 0&&(i[l]=fy(e[l])(e[l],n[l]));return l=>{for(const u in i)a[u]=i[u](l);return a}}function yC(e,n){const a=[],i={color:0,var:0,number:0};for(let l=0;l<n.values.length;l++){const u=n.types[l],f=e.indexes[u][i[u]],p=e.values[f]??0;a[l]=p,i[u]++}return a}const gC=(e,n)=>{const a=Vi.createTransformer(n),i=Pu(e),l=Pu(n);return i.indexes.var.length===l.indexes.var.length&&i.indexes.color.length===l.indexes.color.length&&i.indexes.number.length>=l.indexes.number.length?om.has(e)&&!l.values.length||om.has(n)&&!i.values.length?hC(e,n):Qu(Ew(yC(i,l),l.values),a):Zf(e,n)};function _w(e,n,a){return typeof e=="number"&&typeof n=="number"&&typeof a=="number"?kt(e,n,a):fy(e)(e,n)}const vC=e=>{const n=({timestamp:a})=>e(a);return{start:(a=!0)=>Ot.update(n,a),stop:()=>ei(n),now:()=>Dn.isProcessing?Dn.timestamp:er.now()}},Tw=(e,n,a=10)=>{let i="";const l=Math.max(Math.round(n/a),2);for(let u=0;u<l;u++)i+=Math.round(e(u/(l-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Kf=2e4;function dy(e){let n=0;const a=50;let i=e.next(n);for(;!i.done&&n<Kf;)n+=a,i=e.next(n);return n>=Kf?1/0:n}function bC(e,n=100,a){const i=a({...e,keyframes:[0,n]}),l=Math.min(dy(i),Kf);return{type:"keyframes",ease:u=>i.next(l*u).value/n,duration:Rr(l)}}const xC=5;function Aw(e,n,a){const i=Math.max(n-xC,0);return iw(a-e(i),n-i)}const Yt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Mp=.001;function wC({duration:e=Yt.duration,bounce:n=Yt.bounce,velocity:a=Yt.velocity,mass:i=Yt.mass}){let l,u,f=1-n;f=Wa(Yt.minDamping,Yt.maxDamping,f),e=Wa(Yt.minDuration,Yt.maxDuration,Rr(e)),f<1?(l=g=>{const v=g*f,w=v*e,_=v-a,O=sm(g,f),A=Math.exp(-w);return Mp-_/O*A},u=g=>{const w=g*f*e,_=w*a+a,O=Math.pow(f,2)*Math.pow(g,2)*e,A=Math.exp(-w),j=sm(Math.pow(g,2),f);return(-l(g)+Mp>0?-1:1)*((_-O)*A)/j}):(l=g=>{const v=Math.exp(-g*e),w=(g-a)*e+1;return-Mp+v*w},u=g=>{const v=Math.exp(-g*e),w=(a-g)*(e*e);return v*w});const p=5/e,y=EC(l,u,p);if(e=da(e),isNaN(y))return{stiffness:Yt.stiffness,damping:Yt.damping,duration:e};{const g=Math.pow(y,2)*i;return{stiffness:g,damping:f*2*Math.sqrt(i*g),duration:e}}}const SC=12;function EC(e,n,a){let i=a;for(let l=1;l<SC;l++)i=i-e(i)/n(i);return i}function sm(e,n){return e*Math.sqrt(1-n*n)}const _C=["duration","bounce"],TC=["stiffness","damping","mass"];function Sb(e,n){return n.some(a=>e[a]!==void 0)}function AC(e){let n={velocity:Yt.velocity,stiffness:Yt.stiffness,damping:Yt.damping,mass:Yt.mass,isResolvedFromDuration:!1,...e};if(!Sb(e,TC)&&Sb(e,_C))if(e.visualDuration){const a=e.visualDuration,i=2*Math.PI/(a*1.2),l=i*i,u=2*Wa(.05,1,1-(e.bounce||0))*Math.sqrt(l);n={...n,mass:Yt.mass,stiffness:l,damping:u}}else{const a=wC(e);n={...n,...a,mass:Yt.mass},n.isResolvedFromDuration=!0}return n}function Yf(e=Yt.visualDuration,n=Yt.bounce){const a=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:n}:e;let{restSpeed:i,restDelta:l}=a;const u=a.keyframes[0],f=a.keyframes[a.keyframes.length-1],p={done:!1,value:u},{stiffness:y,damping:g,mass:v,duration:w,velocity:_,isResolvedFromDuration:O}=AC({...a,velocity:-Rr(a.velocity||0)}),A=_||0,j=g/(2*Math.sqrt(y*v)),N=f-u,P=Rr(Math.sqrt(y/v)),H=Math.abs(N)<5;i||(i=H?Yt.restSpeed.granular:Yt.restSpeed.default),l||(l=H?Yt.restDelta.granular:Yt.restDelta.default);let L;if(j<1){const ee=sm(P,j);L=fe=>{const ue=Math.exp(-j*P*fe);return f-ue*((A+j*P*N)/ee*Math.sin(ee*fe)+N*Math.cos(ee*fe))}}else if(j===1)L=ee=>f-Math.exp(-P*ee)*(N+(A+P*N)*ee);else{const ee=P*Math.sqrt(j*j-1);L=fe=>{const ue=Math.exp(-j*P*fe),le=Math.min(ee*fe,300);return f-ue*((A+j*P*N)*Math.sinh(le)+ee*N*Math.cosh(le))/ee}}const ae={calculatedDuration:O&&w||null,next:ee=>{const fe=L(ee);if(O)p.done=ee>=w;else{let ue=ee===0?A:0;j<1&&(ue=ee===0?da(A):Aw(L,ee,fe));const le=Math.abs(ue)<=i,Oe=Math.abs(f-fe)<=l;p.done=le&&Oe}return p.value=p.done?f:fe,p},toString:()=>{const ee=Math.min(dy(ae),Kf),fe=Tw(ue=>ae.next(ee*ue).value,ee,30);return ee+"ms "+fe},toTransition:()=>{}};return ae}Yf.applyToOptions=e=>{const n=bC(e,100,Yf);return e.ease=n.ease,e.duration=da(n.duration),e.type="keyframes",e};function lm({keyframes:e,velocity:n=0,power:a=.8,timeConstant:i=325,bounceDamping:l=10,bounceStiffness:u=500,modifyTarget:f,min:p,max:y,restDelta:g=.5,restSpeed:v}){const w=e[0],_={done:!1,value:w},O=le=>p!==void 0&&le<p||y!==void 0&&le>y,A=le=>p===void 0?y:y===void 0||Math.abs(p-le)<Math.abs(y-le)?p:y;let j=a*n;const N=w+j,P=f===void 0?N:f(N);P!==N&&(j=P-w);const H=le=>-j*Math.exp(-le/i),L=le=>P+H(le),ae=le=>{const Oe=H(le),Be=L(le);_.done=Math.abs(Oe)<=g,_.value=_.done?P:Be};let ee,fe;const ue=le=>{O(_.value)&&(ee=le,fe=Yf({keyframes:[_.value,A(_.value)],velocity:Aw(L,le,_.value),damping:l,stiffness:u,restDelta:g,restSpeed:v}))};return ue(0),{calculatedDuration:null,next:le=>{let Oe=!1;return!fe&&ee===void 0&&(Oe=!0,ae(le),ue(le)),ee!==void 0&&le>=ee?fe.next(le-ee):(!Oe&&ae(le),_)}}}function RC(e,n,a){const i=[],l=a||Ja.mix||_w,u=e.length-1;for(let f=0;f<u;f++){let p=l(e[f],e[f+1]);if(n){const y=Array.isArray(n)?n[f]||Cr:n;p=Qu(y,p)}i.push(p)}return i}function Rw(e,n,{clamp:a=!0,ease:i,mixer:l}={}){const u=e.length;if(ny(u===n.length),u===1)return()=>n[0];if(u===2&&n[0]===n[1])return()=>n[1];const f=e[0]===e[1];e[0]>e[u-1]&&(e=[...e].reverse(),n=[...n].reverse());const p=RC(n,i,l),y=p.length,g=v=>{if(f&&v<e[0])return n[0];let w=0;if(y>1)for(;w<e.length-2&&!(v<e[w+1]);w++);const _=Nu(e[w],e[w+1],v);return p[w](_)};return a?v=>g(Wa(e[0],e[u-1],v)):g}function CC(e,n){const a=e[e.length-1];for(let i=1;i<=n;i++){const l=Nu(0,n,i);e.push(kt(a,1,l))}}function OC(e){const n=[0];return CC(n,e.length-1),n}function DC(e,n){return e.map(a=>a*n)}function jC(e,n){return e.map(()=>n||pw).splice(0,e.length-1)}function Tu({duration:e=300,keyframes:n,times:a,ease:i="easeInOut"}){const l=$R(i)?i.map(gb):gb(i),u={done:!1,value:n[0]},f=DC(a&&a.length===n.length?a:OC(n),e),p=Rw(f,n,{ease:Array.isArray(l)?l:jC(n,l)});return{calculatedDuration:e,next:y=>(u.value=p(y),u.done=y>=e,u)}}const MC=e=>e!==null;function hy(e,{repeat:n,repeatType:a="loop"},i,l=1){const u=e.filter(MC),p=l<0||n&&a!=="loop"&&n%2===1?0:u.length-1;return!p||i===void 0?u[p]:i}const kC={decay:lm,inertia:lm,tween:Tu,keyframes:Tu,spring:Yf};function Cw(e){typeof e.type=="string"&&(e.type=kC[e.type])}class py{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(n=>{this.resolve=n})}notifyFinished(){this.resolve()}then(n,a){return this.finished.then(n,a)}}const NC=e=>e/100;class my extends py{constructor(n){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:a}=this.options;a&&a.updatedAt!==er.now()&&this.tick(er.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=n,this.initAnimation(),this.play(),n.autoplay===!1&&this.pause()}initAnimation(){const{options:n}=this;Cw(n);const{type:a=Tu,repeat:i=0,repeatDelay:l=0,repeatType:u,velocity:f=0}=n;let{keyframes:p}=n;const y=a||Tu;y!==Tu&&typeof p[0]!="number"&&(this.mixKeyframes=Qu(NC,_w(p[0],p[1])),p=[0,100]);const g=y({...n,keyframes:p});u==="mirror"&&(this.mirroredGenerator=y({...n,keyframes:[...p].reverse(),velocity:-f})),g.calculatedDuration===null&&(g.calculatedDuration=dy(g));const{calculatedDuration:v}=g;this.calculatedDuration=v,this.resolvedDuration=v+l,this.totalDuration=this.resolvedDuration*(i+1)-l,this.generator=g}updateTime(n){const a=Math.round(n-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=a}tick(n,a=!1){const{generator:i,totalDuration:l,mixKeyframes:u,mirroredGenerator:f,resolvedDuration:p,calculatedDuration:y}=this;if(this.startTime===null)return i.next(0);const{delay:g=0,keyframes:v,repeat:w,repeatType:_,repeatDelay:O,type:A,onUpdate:j,finalKeyframe:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,n):this.speed<0&&(this.startTime=Math.min(n-l/this.speed,this.startTime)),a?this.currentTime=n:this.updateTime(n);const P=this.currentTime-g*(this.playbackSpeed>=0?1:-1),H=this.playbackSpeed>=0?P<0:P>l;this.currentTime=Math.max(P,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=l);let L=this.currentTime,ae=i;if(w){const le=Math.min(this.currentTime,l)/p;let Oe=Math.floor(le),Be=le%1;!Be&&le>=1&&(Be=1),Be===1&&Oe--,Oe=Math.min(Oe,w+1),!!(Oe%2)&&(_==="reverse"?(Be=1-Be,O&&(Be-=O/p)):_==="mirror"&&(ae=f)),L=Wa(0,1,Be)*p}const ee=H?{done:!1,value:v[0]}:ae.next(L);u&&(ee.value=u(ee.value));let{done:fe}=ee;!H&&y!==null&&(fe=this.playbackSpeed>=0?this.currentTime>=l:this.currentTime<=0);const ue=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&fe);return ue&&A!==lm&&(ee.value=hy(v,this.options,N,this.speed)),j&&j(ee.value),ue&&this.finish(),ee}then(n,a){return this.finished.then(n,a)}get duration(){return Rr(this.calculatedDuration)}get iterationDuration(){const{delay:n=0}=this.options||{};return this.duration+Rr(n)}get time(){return Rr(this.currentTime)}set time(n){n=da(n),this.currentTime=n,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=n:this.driver&&(this.startTime=this.driver.now()-n/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(n){this.updateTime(er.now());const a=this.playbackSpeed!==n;this.playbackSpeed=n,a&&(this.time=Rr(this.currentTime))}play(){if(this.isStopped)return;const{driver:n=vC,startTime:a}=this.options;this.driver||(this.driver=n(l=>this.tick(l))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=a??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(er.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(n){return this.startTime=0,this.tick(n,!0)}attachTimeline(n){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),n.observe(this)}}function zC(e){for(let n=1;n<e.length;n++)e[n]??(e[n]=e[n-1])}const jo=e=>e*180/Math.PI,um=e=>{const n=jo(Math.atan2(e[1],e[0]));return cm(n)},PC={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:um,rotateZ:um,skewX:e=>jo(Math.atan(e[1])),skewY:e=>jo(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},cm=e=>(e=e%360,e<0&&(e+=360),e),Eb=um,_b=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Tb=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),LC={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:_b,scaleY:Tb,scale:e=>(_b(e)+Tb(e))/2,rotateX:e=>cm(jo(Math.atan2(e[6],e[5]))),rotateY:e=>cm(jo(Math.atan2(-e[2],e[0]))),rotateZ:Eb,rotate:Eb,skewX:e=>jo(Math.atan(e[4])),skewY:e=>jo(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function fm(e){return e.includes("scale")?1:0}function dm(e,n){if(!e||e==="none")return fm(n);const a=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,l;if(a)i=LC,l=a;else{const p=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=PC,l=p}if(!l)return fm(n);const u=i[n],f=l[1].split(",").map(UC);return typeof u=="function"?u(f):f[u]}const BC=(e,n)=>{const{transform:a="none"}=getComputedStyle(e);return dm(a,n)};function UC(e){return parseFloat(e.trim())}const Js=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],el=new Set(Js),Ab=e=>e===Ws||e===Ze,VC=new Set(["x","y","z"]),IC=Js.filter(e=>!VC.has(e));function HC(e){const n=[];return IC.forEach(a=>{const i=e.getValue(a);i!==void 0&&(n.push([a,i.get()]),i.set(a.startsWith("scale")?1:0))}),n}const ko={width:({x:e},{paddingLeft:n="0",paddingRight:a="0"})=>e.max-e.min-parseFloat(n)-parseFloat(a),height:({y:e},{paddingTop:n="0",paddingBottom:a="0"})=>e.max-e.min-parseFloat(n)-parseFloat(a),top:(e,{top:n})=>parseFloat(n),left:(e,{left:n})=>parseFloat(n),bottom:({y:e},{top:n})=>parseFloat(n)+(e.max-e.min),right:({x:e},{left:n})=>parseFloat(n)+(e.max-e.min),x:(e,{transform:n})=>dm(n,"x"),y:(e,{transform:n})=>dm(n,"y")};ko.translateX=ko.x;ko.translateY=ko.y;const No=new Set;let hm=!1,pm=!1,mm=!1;function Ow(){if(pm){const e=Array.from(No).filter(i=>i.needsMeasurement),n=new Set(e.map(i=>i.element)),a=new Map;n.forEach(i=>{const l=HC(i);l.length&&(a.set(i,l),i.render())}),e.forEach(i=>i.measureInitialState()),n.forEach(i=>{i.render();const l=a.get(i);l&&l.forEach(([u,f])=>{i.getValue(u)?.set(f)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}pm=!1,hm=!1,No.forEach(e=>e.complete(mm)),No.clear()}function Dw(){No.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(pm=!0)})}function $C(){mm=!0,Dw(),Ow(),mm=!1}class yy{constructor(n,a,i,l,u,f=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...n],this.onComplete=a,this.name=i,this.motionValue=l,this.element=u,this.isAsync=f}scheduleResolve(){this.state="scheduled",this.isAsync?(No.add(this),hm||(hm=!0,Ot.read(Dw),Ot.resolveKeyframes(Ow))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:n,name:a,element:i,motionValue:l}=this;if(n[0]===null){const u=l?.get(),f=n[n.length-1];if(u!==void 0)n[0]=u;else if(i&&a){const p=i.readValue(a,f);p!=null&&(n[0]=p)}n[0]===void 0&&(n[0]=f),l&&u===void 0&&l.set(n[0])}zC(n)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(n=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,n),No.delete(this)}cancel(){this.state==="scheduled"&&(No.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const qC=e=>e.startsWith("--");function ZC(e,n,a){qC(n)?e.style.setProperty(n,a):e.style[n]=a}const KC=ry(()=>window.ScrollTimeline!==void 0),YC={};function FC(e,n){const a=ry(e);return()=>YC[n]??a()}const jw=FC(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),xu=([e,n,a,i])=>`cubic-bezier(${e}, ${n}, ${a}, ${i})`,Rb={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xu([0,.65,.55,1]),circOut:xu([.55,0,1,.45]),backIn:xu([.31,.01,.66,-.59]),backOut:xu([.33,1.53,.69,.99])};function Mw(e,n){if(e)return typeof e=="function"?jw()?Tw(e,n):"ease-out":mw(e)?xu(e):Array.isArray(e)?e.map(a=>Mw(a,n)||Rb.easeOut):Rb[e]}function GC(e,n,a,{delay:i=0,duration:l=300,repeat:u=0,repeatType:f="loop",ease:p="easeOut",times:y}={},g=void 0){const v={[n]:a};y&&(v.offset=y);const w=Mw(p,l);Array.isArray(w)&&(v.easing=w);const _={delay:i,duration:l,easing:Array.isArray(w)?"linear":w,fill:"both",iterations:u+1,direction:f==="reverse"?"alternate":"normal"};return g&&(_.pseudoElement=g),e.animate(v,_)}function kw(e){return typeof e=="function"&&"applyToOptions"in e}function XC({type:e,...n}){return kw(e)&&jw()?e.applyToOptions(n):(n.duration??(n.duration=300),n.ease??(n.ease="easeOut"),n)}class QC extends py{constructor(n){if(super(),this.finishedTime=null,this.isStopped=!1,!n)return;const{element:a,name:i,keyframes:l,pseudoElement:u,allowFlatten:f=!1,finalKeyframe:p,onComplete:y}=n;this.isPseudoElement=!!u,this.allowFlatten=f,this.options=n,ny(typeof n.type!="string");const g=XC(n);this.animation=GC(a,i,l,g,u),g.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const v=hy(l,this.options,p,this.speed);this.updateMotionValue?this.updateMotionValue(v):ZC(a,i,v),this.animation.cancel()}y?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:n}=this;n==="idle"||n==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const n=this.animation.effect?.getComputedTiming?.().duration||0;return Rr(Number(n))}get iterationDuration(){const{delay:n=0}=this.options||{};return this.duration+Rr(n)}get time(){return Rr(Number(this.animation.currentTime)||0)}set time(n){this.finishedTime=null,this.animation.currentTime=da(n)}get speed(){return this.animation.playbackRate}set speed(n){n<0&&(this.finishedTime=null),this.animation.playbackRate=n}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(n){this.animation.startTime=n}attachTimeline({timeline:n,observe:a}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,n&&KC()?(this.animation.timeline=n,Cr):a(this)}}const Nw={anticipate:fw,backInOut:cw,circInOut:hw};function WC(e){return e in Nw}function JC(e){typeof e.ease=="string"&&WC(e.ease)&&(e.ease=Nw[e.ease])}const Cb=10;class eO extends QC{constructor(n){JC(n),Cw(n),super(n),n.startTime&&(this.startTime=n.startTime),this.options=n}updateMotionValue(n){const{motionValue:a,onUpdate:i,onComplete:l,element:u,...f}=this.options;if(!a)return;if(n!==void 0){a.set(n);return}const p=new my({...f,autoplay:!1}),y=da(this.finishedTime??this.time);a.setWithVelocity(p.sample(y-Cb).value,p.sample(y).value,Cb),p.stop()}}const Ob=(e,n)=>n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Vi.test(e)||e==="0")&&!e.startsWith("url("));function tO(e){const n=e[0];if(e.length===1)return!0;for(let a=0;a<e.length;a++)if(e[a]!==n)return!0}function nO(e,n,a,i){const l=e[0];if(l===null)return!1;if(n==="display"||n==="visibility")return!0;const u=e[e.length-1],f=Ob(l,n),p=Ob(u,n);return!f||!p?!1:tO(e)||(a==="spring"||kw(a))&&i}function ym(e){e.duration=0,e.type="keyframes"}const rO=new Set(["opacity","clipPath","filter","transform"]),aO=ry(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function iO(e){const{motionValue:n,name:a,repeatDelay:i,repeatType:l,damping:u,type:f}=e;if(!(n?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:y,transformTemplate:g}=n.owner.getProps();return aO()&&a&&rO.has(a)&&(a!=="transform"||!g)&&!y&&!i&&l!=="mirror"&&u!==0&&f!=="inertia"}const oO=40;class sO extends py{constructor({autoplay:n=!0,delay:a=0,type:i="keyframes",repeat:l=0,repeatDelay:u=0,repeatType:f="loop",keyframes:p,name:y,motionValue:g,element:v,...w}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=er.now();const _={autoplay:n,delay:a,type:i,repeat:l,repeatDelay:u,repeatType:f,name:y,motionValue:g,element:v,...w},O=v?.KeyframeResolver||yy;this.keyframeResolver=new O(p,(A,j,N)=>this.onKeyframesResolved(A,j,_,!N),y,g,v),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(n,a,i,l){this.keyframeResolver=void 0;const{name:u,type:f,velocity:p,delay:y,isHandoff:g,onUpdate:v}=i;this.resolvedAt=er.now(),nO(n,u,f,p)||((Ja.instantAnimations||!y)&&v?.(hy(n,i,a)),n[0]=n[n.length-1],ym(i),i.repeat=0);const _={startTime:l?this.resolvedAt?this.resolvedAt-this.createdAt>oO?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:a,...i,keyframes:n},O=!g&&iO(_)?new eO({..._,element:_.motionValue.owner.current}):new my(_);O.finished.then(()=>this.notifyFinished()).catch(Cr),this.pendingTimeline&&(this.stopTimeline=O.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=O}get finished(){return this._animation?this.animation.finished:this._finished}then(n,a){return this.finished.finally(n).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),$C()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(n){this.animation.time=n}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(n){this.animation.speed=n}get startTime(){return this.animation.startTime}attachTimeline(n){return this._animation?this.stopTimeline=this.animation.attachTimeline(n):this.pendingTimeline=n,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const lO=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function uO(e){const n=lO.exec(e);if(!n)return[,];const[,a,i,l]=n;return[`--${a??i}`,l]}function zw(e,n,a=1){const[i,l]=uO(e);if(!i)return;const u=window.getComputedStyle(n).getPropertyValue(i);if(u){const f=u.trim();return nw(f)?parseFloat(f):f}return ly(l)?zw(l,n,a+1):l}function gy(e,n){return e?.[n]??e?.default??e}const Pw=new Set(["width","height","top","left","right","bottom",...Js]),cO={test:e=>e==="auto",parse:e=>e},Lw=e=>n=>n.test(e),Bw=[Ws,Ze,ha,zi,nC,tC,cO],Db=e=>Bw.find(Lw(e));function fO(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||aw(e):!0}const dO=new Set(["brightness","contrast","saturate","opacity"]);function hO(e){const[n,a]=e.slice(0,-1).split("(");if(n==="drop-shadow")return e;const[i]=a.match(uy)||[];if(!i)return e;const l=a.replace(i,"");let u=dO.has(n)?1:0;return i!==a&&(u*=100),n+"("+u+l+")"}const pO=/\b([a-z-]*)\(.*?\)/gu,gm={...Vi,getAnimatableNone:e=>{const n=e.match(pO);return n?n.map(hO).join(" "):e}},jb={...Ws,transform:Math.round},mO={rotate:zi,rotateX:zi,rotateY:zi,rotateZ:zi,scale:wf,scaleX:wf,scaleY:wf,scaleZ:wf,skew:zi,skewX:zi,skewY:zi,distance:Ze,translateX:Ze,translateY:Ze,translateZ:Ze,x:Ze,y:Ze,z:Ze,perspective:Ze,transformPerspective:Ze,opacity:zu,originX:vb,originY:vb,originZ:Ze},vy={borderWidth:Ze,borderTopWidth:Ze,borderRightWidth:Ze,borderBottomWidth:Ze,borderLeftWidth:Ze,borderRadius:Ze,radius:Ze,borderTopLeftRadius:Ze,borderTopRightRadius:Ze,borderBottomRightRadius:Ze,borderBottomLeftRadius:Ze,width:Ze,maxWidth:Ze,height:Ze,maxHeight:Ze,top:Ze,right:Ze,bottom:Ze,left:Ze,padding:Ze,paddingTop:Ze,paddingRight:Ze,paddingBottom:Ze,paddingLeft:Ze,margin:Ze,marginTop:Ze,marginRight:Ze,marginBottom:Ze,marginLeft:Ze,backgroundPositionX:Ze,backgroundPositionY:Ze,...mO,zIndex:jb,fillOpacity:zu,strokeOpacity:zu,numOctaves:jb},yO={...vy,color:on,backgroundColor:on,outlineColor:on,fill:on,stroke:on,borderColor:on,borderTopColor:on,borderRightColor:on,borderBottomColor:on,borderLeftColor:on,filter:gm,WebkitFilter:gm},Uw=e=>yO[e];function Vw(e,n){let a=Uw(e);return a!==gm&&(a=Vi),a.getAnimatableNone?a.getAnimatableNone(n):void 0}const gO=new Set(["auto","none","0"]);function vO(e,n,a){let i=0,l;for(;i<e.length&&!l;){const u=e[i];typeof u=="string"&&!gO.has(u)&&Pu(u).values.length&&(l=e[i]),i++}if(l&&a)for(const u of n)e[u]=Vw(a,l)}class bO extends yy{constructor(n,a,i,l,u){super(n,a,i,l,u,!0)}readKeyframes(){const{unresolvedKeyframes:n,element:a,name:i}=this;if(!a||!a.current)return;super.readKeyframes();for(let y=0;y<n.length;y++){let g=n[y];if(typeof g=="string"&&(g=g.trim(),ly(g))){const v=zw(g,a.current);v!==void 0&&(n[y]=v),y===n.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!Pw.has(i)||n.length!==2)return;const[l,u]=n,f=Db(l),p=Db(u);if(f!==p)if(Ab(f)&&Ab(p))for(let y=0;y<n.length;y++){const g=n[y];typeof g=="string"&&(n[y]=parseFloat(g))}else ko[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:n,name:a}=this,i=[];for(let l=0;l<n.length;l++)(n[l]===null||fO(n[l]))&&i.push(l);i.length&&vO(n,i,a)}measureInitialState(){const{element:n,unresolvedKeyframes:a,name:i}=this;if(!n||!n.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ko[i](n.measureViewportBox(),window.getComputedStyle(n.current)),a[0]=this.measuredOrigin;const l=a[a.length-1];l!==void 0&&n.getValue(i,l).jump(l,!1)}measureEndState(){const{element:n,name:a,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const l=n.getValue(a);l&&l.jump(this.measuredOrigin,!1);const u=i.length-1,f=i[u];i[u]=ko[a](n.measureViewportBox(),window.getComputedStyle(n.current)),f!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=f),this.removedTransforms?.length&&this.removedTransforms.forEach(([p,y])=>{n.getValue(p).set(y)}),this.resolveNoneKeyframes()}}function xO(e,n,a){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;const l=a?.[e]??i.querySelectorAll(e);return l?Array.from(l):[]}return Array.from(e)}const Iw=(e,n)=>n&&typeof e=="number"?n.transform(e):e;function Hw(e){return rw(e)&&"offsetHeight"in e}const Mb=30,wO=e=>!isNaN(parseFloat(e)),Au={current:void 0};class SO{constructor(n,a={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const l=er.now();if(this.updatedAt!==l&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const u of this.dependents)u.dirty()},this.hasAnimated=!1,this.setCurrent(n),this.owner=a.owner}setCurrent(n){this.current=n,this.updatedAt=er.now(),this.canTrackVelocity===null&&n!==void 0&&(this.canTrackVelocity=wO(this.current))}setPrevFrameValue(n=this.current){this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt}onChange(n){return this.on("change",n)}on(n,a){this.events[n]||(this.events[n]=new ay);const i=this.events[n].add(a);return n==="change"?()=>{i(),Ot.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const n in this.events)this.events[n].clear()}attach(n,a){this.passiveEffect=n,this.stopPassiveEffect=a}set(n){this.passiveEffect?this.passiveEffect(n,this.updateAndNotify):this.updateAndNotify(n)}setWithVelocity(n,a,i){this.set(a),this.prev=void 0,this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt-i}jump(n,a=!0){this.updateAndNotify(n),this.prev=n,this.prevUpdatedAt=this.prevFrameValue=void 0,a&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(n){this.dependents||(this.dependents=new Set),this.dependents.add(n)}removeDependent(n){this.dependents&&this.dependents.delete(n)}get(){return Au.current&&Au.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const n=er.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||n-this.updatedAt>Mb)return 0;const a=Math.min(this.updatedAt-this.prevUpdatedAt,Mb);return iw(parseFloat(this.current)-parseFloat(this.prevFrameValue),a)}start(n){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.animation=n(a),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Bo(e,n){return new SO(e,n)}const{schedule:by}=yw(queueMicrotask,!1),Ur={x:!1,y:!1};function $w(){return Ur.x||Ur.y}function EO(e){return e==="x"||e==="y"?Ur[e]?null:(Ur[e]=!0,()=>{Ur[e]=!1}):Ur.x||Ur.y?null:(Ur.x=Ur.y=!0,()=>{Ur.x=Ur.y=!1})}function qw(e,n){const a=xO(e),i=new AbortController,l={passive:!0,...n,signal:i.signal};return[a,l,()=>i.abort()]}function kb(e){return!(e.pointerType==="touch"||$w())}function _O(e,n,a={}){const[i,l,u]=qw(e,a),f=p=>{if(!kb(p))return;const{target:y}=p,g=n(y,p);if(typeof g!="function"||!y)return;const v=w=>{kb(w)&&(g(w),y.removeEventListener("pointerleave",v))};y.addEventListener("pointerleave",v,l)};return i.forEach(p=>{p.addEventListener("pointerenter",f,l)}),u}const Zw=(e,n)=>n?e===n?!0:Zw(e,n.parentElement):!1,xy=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,TO=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function AO(e){return TO.has(e.tagName)||e.tabIndex!==-1}const Uf=new WeakSet;function Nb(e){return n=>{n.key==="Enter"&&e(n)}}function kp(e,n){e.dispatchEvent(new PointerEvent("pointer"+n,{isPrimary:!0,bubbles:!0}))}const RO=(e,n)=>{const a=e.currentTarget;if(!a)return;const i=Nb(()=>{if(Uf.has(a))return;kp(a,"down");const l=Nb(()=>{kp(a,"up")}),u=()=>kp(a,"cancel");a.addEventListener("keyup",l,n),a.addEventListener("blur",u,n)});a.addEventListener("keydown",i,n),a.addEventListener("blur",()=>a.removeEventListener("keydown",i),n)};function zb(e){return xy(e)&&!$w()}function CO(e,n,a={}){const[i,l,u]=qw(e,a),f=p=>{const y=p.currentTarget;if(!zb(p))return;Uf.add(y);const g=n(y,p),v=(O,A)=>{window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",_),Uf.has(y)&&Uf.delete(y),zb(O)&&typeof g=="function"&&g(O,{success:A})},w=O=>{v(O,y===window||y===document||a.useGlobalTarget||Zw(y,O.target))},_=O=>{v(O,!1)};window.addEventListener("pointerup",w,l),window.addEventListener("pointercancel",_,l)};return i.forEach(p=>{(a.useGlobalTarget?window:p).addEventListener("pointerdown",f,l),Hw(p)&&(p.addEventListener("focus",g=>RO(g,l)),!AO(p)&&!p.hasAttribute("tabindex")&&(p.tabIndex=0))}),u}function Kw(e){return rw(e)&&"ownerSVGElement"in e}function OO(e){return Kw(e)&&e.tagName==="svg"}function DO(...e){const n=!Array.isArray(e[0]),a=n?0:-1,i=e[0+a],l=e[1+a],u=e[2+a],f=e[3+a],p=Rw(l,u,f);return n?p(i):p}const jn=e=>!!(e&&e.getVelocity),jO=[...Bw,on,Vi],MO=e=>jO.find(Lw(e)),hd=D.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Pb(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function kO(...e){return n=>{let a=!1;const i=e.map(l=>{const u=Pb(l,n);return!a&&typeof u=="function"&&(a=!0),u});if(a)return()=>{for(let l=0;l<i.length;l++){const u=i[l];typeof u=="function"?u():Pb(e[l],null)}}}}function NO(...e){return D.useCallback(kO(...e),e)}class zO extends D.Component{getSnapshotBeforeUpdate(n){const a=this.props.childRef.current;if(a&&n.isPresent&&!this.props.isPresent){const i=a.offsetParent,l=Hw(i)&&i.offsetWidth||0,u=this.props.sizeRef.current;u.height=a.offsetHeight||0,u.width=a.offsetWidth||0,u.top=a.offsetTop,u.left=a.offsetLeft,u.right=l-u.width-u.left}return null}componentDidUpdate(){}render(){return this.props.children}}function PO({children:e,isPresent:n,anchorX:a,root:i}){const l=D.useId(),u=D.useRef(null),f=D.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:p}=D.useContext(hd),y=NO(u,e?.ref);return D.useInsertionEffect(()=>{const{width:g,height:v,top:w,left:_,right:O}=f.current;if(n||!u.current||!g||!v)return;const A=a==="left"?`left: ${_}`:`right: ${O}`;u.current.dataset.motionPopId=l;const j=document.createElement("style");p&&(j.nonce=p);const N=i??document.head;return N.appendChild(j),j.sheet&&j.sheet.insertRule(`
          [data-motion-pop-id="${l}"] {
            position: absolute !important;
            width: ${g}px !important;
            height: ${v}px !important;
            ${A}px !important;
            top: ${w}px !important;
          }
        `),()=>{N.contains(j)&&N.removeChild(j)}},[n]),R.jsx(zO,{isPresent:n,childRef:u,sizeRef:f,children:D.cloneElement(e,{ref:y})})}const LO=({children:e,initial:n,isPresent:a,onExitComplete:i,custom:l,presenceAffectsLayout:u,mode:f,anchorX:p,root:y})=>{const g=$o(BO),v=D.useId();let w=!0,_=D.useMemo(()=>(w=!1,{id:v,initial:n,isPresent:a,custom:l,onExitComplete:O=>{g.set(O,!0);for(const A of g.values())if(!A)return;i&&i()},register:O=>(g.set(O,!1),()=>g.delete(O))}),[a,g,i]);return u&&w&&(_={..._}),D.useMemo(()=>{g.forEach((O,A)=>g.set(A,!1))},[a]),D.useEffect(()=>{!a&&!g.size&&i&&i()},[a]),f==="popLayout"&&(e=R.jsx(PO,{isPresent:a,anchorX:p,root:y,children:e})),R.jsx(dd.Provider,{value:_,children:e})};function BO(){return new Map}function Yw(e=!0){const n=D.useContext(dd);if(n===null)return[!0,null];const{isPresent:a,onExitComplete:i,register:l}=n,u=D.useId();D.useEffect(()=>{if(e)return l(u)},[e]);const f=D.useCallback(()=>e&&i&&i(u),[u,i,e]);return!a&&i?[!1,f]:[!0]}const Sf=e=>e.key||"";function Lb(e){const n=[];return D.Children.forEach(e,a=>{D.isValidElement(a)&&n.push(a)}),n}const Hr=({children:e,custom:n,initial:a=!0,onExitComplete:i,presenceAffectsLayout:l=!0,mode:u="sync",propagate:f=!1,anchorX:p="left",root:y})=>{const[g,v]=Yw(f),w=D.useMemo(()=>Lb(e),[e]),_=f&&!g?[]:w.map(Sf),O=D.useRef(!0),A=D.useRef(w),j=$o(()=>new Map),[N,P]=D.useState(w),[H,L]=D.useState(w);Jm(()=>{O.current=!1,A.current=w;for(let fe=0;fe<H.length;fe++){const ue=Sf(H[fe]);_.includes(ue)?j.delete(ue):j.get(ue)!==!0&&j.set(ue,!1)}},[H,_.length,_.join("-")]);const ae=[];if(w!==N){let fe=[...w];for(let ue=0;ue<H.length;ue++){const le=H[ue],Oe=Sf(le);_.includes(Oe)||(fe.splice(ue,0,le),ae.push(le))}return u==="wait"&&ae.length&&(fe=ae),L(Lb(fe)),P(w),null}const{forceRender:ee}=D.useContext(Qm);return R.jsx(R.Fragment,{children:H.map(fe=>{const ue=Sf(fe),le=f&&!g?!1:w===H||_.includes(ue),Oe=()=>{if(j.has(ue))j.set(ue,!0);else return;let Be=!0;j.forEach(Xe=>{Xe||(Be=!1)}),Be&&(ee?.(),L(A.current),f&&v?.(),i&&i())};return R.jsx(LO,{isPresent:le,initial:!O.current||a?void 0:!1,custom:n,presenceAffectsLayout:l,mode:u,root:y,onExitComplete:le?void 0:Oe,anchorX:p,children:fe},ue)})})},Fw=D.createContext({strict:!1}),Bb={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Fs={};for(const e in Bb)Fs[e]={isEnabled:n=>Bb[e].some(a=>!!n[a])};function UO(e){for(const n in e)Fs[n]={...Fs[n],...e[n]}}const VO=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Ff(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||VO.has(e)}let Gw=e=>!Ff(e);function IO(e){typeof e=="function"&&(Gw=n=>n.startsWith("on")?!Ff(n):e(n))}try{IO(require("@emotion/is-prop-valid").default)}catch{}function HO(e,n,a){const i={};for(const l in e)l==="values"&&typeof e.values=="object"||(Gw(l)||a===!0&&Ff(l)||!n&&!Ff(l)||e.draggable&&l.startsWith("onDrag"))&&(i[l]=e[l]);return i}const pd=D.createContext({});function md(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Lu(e){return typeof e=="string"||Array.isArray(e)}const wy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Sy=["initial",...wy];function yd(e){return md(e.animate)||Sy.some(n=>Lu(e[n]))}function Xw(e){return!!(yd(e)||e.variants)}function $O(e,n){if(yd(e)){const{initial:a,animate:i}=e;return{initial:a===!1||Lu(a)?a:void 0,animate:Lu(i)?i:void 0}}return e.inherit!==!1?n:{}}function qO(e){const{initial:n,animate:a}=$O(e,D.useContext(pd));return D.useMemo(()=>({initial:n,animate:a}),[Ub(n),Ub(a)])}function Ub(e){return Array.isArray(e)?e.join(" "):e}const Bu={};function ZO(e){for(const n in e)Bu[n]=e[n],sy(n)&&(Bu[n].isCSSVariable=!0)}function Qw(e,{layout:n,layoutId:a}){return el.has(e)||e.startsWith("origin")||(n||a!==void 0)&&(!!Bu[e]||e==="opacity")}const KO={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},YO=Js.length;function FO(e,n,a){let i="",l=!0;for(let u=0;u<YO;u++){const f=Js[u],p=e[f];if(p===void 0)continue;let y=!0;if(typeof p=="number"?y=p===(f.startsWith("scale")?1:0):y=parseFloat(p)===0,!y||a){const g=Iw(p,vy[f]);if(!y){l=!1;const v=KO[f]||f;i+=`${v}(${g}) `}a&&(n[f]=g)}}return i=i.trim(),a?i=a(n,l?"":i):l&&(i="none"),i}function Ey(e,n,a){const{style:i,vars:l,transformOrigin:u}=e;let f=!1,p=!1;for(const y in n){const g=n[y];if(el.has(y)){f=!0;continue}else if(sy(y)){l[y]=g;continue}else{const v=Iw(g,vy[y]);y.startsWith("origin")?(p=!0,u[y]=v):i[y]=v}}if(n.transform||(f||a?i.transform=FO(n,e.transform,a):i.transform&&(i.transform="none")),p){const{originX:y="50%",originY:g="50%",originZ:v=0}=u;i.transformOrigin=`${y} ${g} ${v}`}}const _y=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ww(e,n,a){for(const i in n)!jn(n[i])&&!Qw(i,a)&&(e[i]=n[i])}function GO({transformTemplate:e},n){return D.useMemo(()=>{const a=_y();return Ey(a,n,e),Object.assign({},a.vars,a.style)},[n])}function XO(e,n){const a=e.style||{},i={};return Ww(i,a,e),Object.assign(i,GO(e,n)),i}function QO(e,n){const a={},i=XO(e,n);return e.drag&&e.dragListener!==!1&&(a.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(a.tabIndex=0),a.style=i,a}const WO={offset:"stroke-dashoffset",array:"stroke-dasharray"},JO={offset:"strokeDashoffset",array:"strokeDasharray"};function eD(e,n,a=1,i=0,l=!0){e.pathLength=1;const u=l?WO:JO;e[u.offset]=Ze.transform(-i);const f=Ze.transform(n),p=Ze.transform(a);e[u.array]=`${f} ${p}`}function Jw(e,{attrX:n,attrY:a,attrScale:i,pathLength:l,pathSpacing:u=1,pathOffset:f=0,...p},y,g,v){if(Ey(e,p,g),y){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:w,style:_}=e;w.transform&&(_.transform=w.transform,delete w.transform),(_.transform||w.transformOrigin)&&(_.transformOrigin=w.transformOrigin??"50% 50%",delete w.transformOrigin),_.transform&&(_.transformBox=v?.transformBox??"fill-box",delete w.transformBox),n!==void 0&&(w.x=n),a!==void 0&&(w.y=a),i!==void 0&&(w.scale=i),l!==void 0&&eD(w,l,u,f,!1)}const eS=()=>({..._y(),attrs:{}}),tS=e=>typeof e=="string"&&e.toLowerCase()==="svg";function tD(e,n,a,i){const l=D.useMemo(()=>{const u=eS();return Jw(u,n,tS(i),e.transformTemplate,e.style),{...u.attrs,style:{...u.style}}},[n]);if(e.style){const u={};Ww(u,e.style,e),l.style={...u,...l.style}}return l}const nD=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ty(e){return typeof e!="string"||e.includes("-")?!1:!!(nD.indexOf(e)>-1||/[A-Z]/u.test(e))}function rD(e,n,a,{latestValues:i},l,u=!1){const p=(Ty(e)?tD:QO)(n,i,l,e),y=HO(n,typeof e=="string",u),g=e!==D.Fragment?{...y,...p,ref:a}:{},{children:v}=n,w=D.useMemo(()=>jn(v)?v.get():v,[v]);return D.createElement(e,{...g,children:w})}function Vb(e){const n=[{},{}];return e?.values.forEach((a,i)=>{n[0][i]=a.get(),n[1][i]=a.getVelocity()}),n}function Ay(e,n,a,i){if(typeof n=="function"){const[l,u]=Vb(i);n=n(a!==void 0?a:e.custom,l,u)}if(typeof n=="string"&&(n=e.variants&&e.variants[n]),typeof n=="function"){const[l,u]=Vb(i);n=n(a!==void 0?a:e.custom,l,u)}return n}function Vf(e){return jn(e)?e.get():e}function aD({scrapeMotionValuesFromProps:e,createRenderState:n},a,i,l){return{latestValues:iD(a,i,l,e),renderState:n()}}function iD(e,n,a,i){const l={},u=i(e,{});for(const _ in u)l[_]=Vf(u[_]);let{initial:f,animate:p}=e;const y=yd(e),g=Xw(e);n&&g&&!y&&e.inherit!==!1&&(f===void 0&&(f=n.initial),p===void 0&&(p=n.animate));let v=a?a.initial===!1:!1;v=v||f===!1;const w=v?p:f;if(w&&typeof w!="boolean"&&!md(w)){const _=Array.isArray(w)?w:[w];for(let O=0;O<_.length;O++){const A=Ay(e,_[O]);if(A){const{transitionEnd:j,transition:N,...P}=A;for(const H in P){let L=P[H];if(Array.isArray(L)){const ae=v?L.length-1:0;L=L[ae]}L!==null&&(l[H]=L)}for(const H in j)l[H]=j[H]}}}return l}const nS=e=>(n,a)=>{const i=D.useContext(pd),l=D.useContext(dd),u=()=>aD(e,n,i,l);return a?u():$o(u)};function Ry(e,n,a){const{style:i}=e,l={};for(const u in i)(jn(i[u])||n.style&&jn(n.style[u])||Qw(u,e)||a?.getValue(u)?.liveStyle!==void 0)&&(l[u]=i[u]);return l}const oD=nS({scrapeMotionValuesFromProps:Ry,createRenderState:_y});function rS(e,n,a){const i=Ry(e,n,a);for(const l in e)if(jn(e[l])||jn(n[l])){const u=Js.indexOf(l)!==-1?"attr"+l.charAt(0).toUpperCase()+l.substring(1):l;i[u]=e[l]}return i}const sD=nS({scrapeMotionValuesFromProps:rS,createRenderState:eS}),lD=Symbol.for("motionComponentSymbol");function Ps(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function uD(e,n,a){return D.useCallback(i=>{i&&e.onMount&&e.onMount(i),n&&(i?n.mount(i):n.unmount()),a&&(typeof a=="function"?a(i):Ps(a)&&(a.current=i))},[n])}const Cy=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),cD="framerAppearId",aS="data-"+Cy(cD),iS=D.createContext({});function fD(e,n,a,i,l){const{visualElement:u}=D.useContext(pd),f=D.useContext(Fw),p=D.useContext(dd),y=D.useContext(hd).reducedMotion,g=D.useRef(null);i=i||f.renderer,!g.current&&i&&(g.current=i(e,{visualState:n,parent:u,props:a,presenceContext:p,blockInitialAnimation:p?p.initial===!1:!1,reducedMotionConfig:y}));const v=g.current,w=D.useContext(iS);v&&!v.projection&&l&&(v.type==="html"||v.type==="svg")&&dD(g.current,a,l,w);const _=D.useRef(!1);D.useInsertionEffect(()=>{v&&_.current&&v.update(a,p)});const O=a[aS],A=D.useRef(!!O&&!window.MotionHandoffIsComplete?.(O)&&window.MotionHasOptimisedAnimation?.(O));return Jm(()=>{v&&(_.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),A.current&&v.animationState&&v.animationState.animateChanges())}),D.useEffect(()=>{v&&(!A.current&&v.animationState&&v.animationState.animateChanges(),A.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(O)}),A.current=!1),v.enteringChildren=void 0)}),v}function dD(e,n,a,i){const{layoutId:l,layout:u,drag:f,dragConstraints:p,layoutScroll:y,layoutRoot:g,layoutCrossfade:v}=n;e.projection=new a(e.latestValues,n["data-framer-portal-id"]?void 0:oS(e.parent)),e.projection.setOptions({layoutId:l,layout:u,alwaysMeasureLayout:!!f||p&&Ps(p),visualElement:e,animationType:typeof u=="string"?u:"both",initialPromotionConfig:i,crossfade:v,layoutScroll:y,layoutRoot:g})}function oS(e){if(e)return e.options.allowProjection!==!1?e.projection:oS(e.parent)}function Np(e,{forwardMotionProps:n=!1}={},a,i){a&&UO(a);const l=Ty(e)?sD:oD;function u(p,y){let g;const v={...D.useContext(hd),...p,layoutId:hD(p)},{isStatic:w}=v,_=qO(p),O=l(p,w);if(!w&&Wm){pD();const A=mD(v);g=A.MeasureLayout,_.visualElement=fD(e,O,v,i,A.ProjectionNode)}return R.jsxs(pd.Provider,{value:_,children:[g&&_.visualElement?R.jsx(g,{visualElement:_.visualElement,...v}):null,rD(e,p,uD(O,_.visualElement,y),O,w,n)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const f=D.forwardRef(u);return f[lD]=e,f}function hD({layoutId:e}){const n=D.useContext(Qm).id;return n&&e!==void 0?n+"-"+e:e}function pD(e,n){D.useContext(Fw).strict}function mD(e){const{drag:n,layout:a}=Fs;if(!n&&!a)return{};const i={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function yD(e,n){if(typeof Proxy>"u")return Np;const a=new Map,i=(u,f)=>Np(u,f,e,n),l=(u,f)=>i(u,f);return new Proxy(l,{get:(u,f)=>f==="create"?i:(a.has(f)||a.set(f,Np(f,void 0,e,n)),a.get(f))})}function sS({top:e,left:n,right:a,bottom:i}){return{x:{min:n,max:a},y:{min:e,max:i}}}function gD({x:e,y:n}){return{top:n.min,right:e.max,bottom:n.max,left:e.min}}function vD(e,n){if(!n)return e;const a=n({x:e.left,y:e.top}),i=n({x:e.right,y:e.bottom});return{top:a.y,left:a.x,bottom:i.y,right:i.x}}function zp(e){return e===void 0||e===1}function vm({scale:e,scaleX:n,scaleY:a}){return!zp(e)||!zp(n)||!zp(a)}function Ro(e){return vm(e)||lS(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function lS(e){return Ib(e.x)||Ib(e.y)}function Ib(e){return e&&e!=="0%"}function Gf(e,n,a){const i=e-a,l=n*i;return a+l}function Hb(e,n,a,i,l){return l!==void 0&&(e=Gf(e,l,i)),Gf(e,a,i)+n}function bm(e,n=0,a=1,i,l){e.min=Hb(e.min,n,a,i,l),e.max=Hb(e.max,n,a,i,l)}function uS(e,{x:n,y:a}){bm(e.x,n.translate,n.scale,n.originPoint),bm(e.y,a.translate,a.scale,a.originPoint)}const $b=.999999999999,qb=1.0000000000001;function bD(e,n,a,i=!1){const l=a.length;if(!l)return;n.x=n.y=1;let u,f;for(let p=0;p<l;p++){u=a[p],f=u.projectionDelta;const{visualElement:y}=u.options;y&&y.props.style&&y.props.style.display==="contents"||(i&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Bs(e,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),f&&(n.x*=f.x.scale,n.y*=f.y.scale,uS(e,f)),i&&Ro(u.latestValues)&&Bs(e,u.latestValues))}n.x<qb&&n.x>$b&&(n.x=1),n.y<qb&&n.y>$b&&(n.y=1)}function Ls(e,n){e.min=e.min+n,e.max=e.max+n}function Zb(e,n,a,i,l=.5){const u=kt(e.min,e.max,l);bm(e,n,a,u,i)}function Bs(e,n){Zb(e.x,n.x,n.scaleX,n.scale,n.originX),Zb(e.y,n.y,n.scaleY,n.scale,n.originY)}function cS(e,n){return sS(vD(e.getBoundingClientRect(),n))}function xD(e,n,a){const i=cS(e,a),{scroll:l}=n;return l&&(Ls(i.x,l.offset.x),Ls(i.y,l.offset.y)),i}const Kb=()=>({translate:0,scale:1,origin:0,originPoint:0}),Us=()=>({x:Kb(),y:Kb()}),Yb=()=>({min:0,max:0}),Wt=()=>({x:Yb(),y:Yb()}),xm={current:null},fS={current:!1};function wD(){if(fS.current=!0,!!Wm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),n=()=>xm.current=e.matches;e.addEventListener("change",n),n()}else xm.current=!1}const SD=new WeakMap;function ED(e,n,a){for(const i in n){const l=n[i],u=a[i];if(jn(l))e.addValue(i,l);else if(jn(u))e.addValue(i,Bo(l,{owner:e}));else if(u!==l)if(e.hasValue(i)){const f=e.getValue(i);f.liveStyle===!0?f.jump(l):f.hasAnimated||f.set(l)}else{const f=e.getStaticValue(i);e.addValue(i,Bo(f!==void 0?f:l,{owner:e}))}}for(const i in a)n[i]===void 0&&e.removeValue(i);return n}const Fb=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class _D{scrapeMotionValuesFromProps(n,a,i){return{}}constructor({parent:n,props:a,presenceContext:i,reducedMotionConfig:l,blockInitialAnimation:u,visualState:f},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=yy,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const _=er.now();this.renderScheduledAt<_&&(this.renderScheduledAt=_,Ot.render(this.render,!1,!0))};const{latestValues:y,renderState:g}=f;this.latestValues=y,this.baseTarget={...y},this.initialValues=a.initial?{...y}:{},this.renderState=g,this.parent=n,this.props=a,this.presenceContext=i,this.depth=n?n.depth+1:0,this.reducedMotionConfig=l,this.options=p,this.blockInitialAnimation=!!u,this.isControllingVariants=yd(a),this.isVariantNode=Xw(a),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(n&&n.current);const{willChange:v,...w}=this.scrapeMotionValuesFromProps(a,{},this);for(const _ in w){const O=w[_];y[_]!==void 0&&jn(O)&&O.set(y[_])}}mount(n){this.current=n,SD.set(n,this),this.projection&&!this.projection.instance&&this.projection.mount(n),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((a,i)=>this.bindToMotionValue(i,a)),fS.current||wD(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:xm.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ei(this.notifyUpdate),ei(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const a=this.features[n];a&&(a.unmount(),a.isMounted=!1)}this.current=null}addChild(n){this.children.add(n),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(n)}removeChild(n){this.children.delete(n),this.enteringChildren&&this.enteringChildren.delete(n)}bindToMotionValue(n,a){this.valueSubscriptions.has(n)&&this.valueSubscriptions.get(n)();const i=el.has(n);i&&this.onBindTransform&&this.onBindTransform();const l=a.on("change",f=>{this.latestValues[n]=f,this.props.onUpdate&&Ot.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let u;window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,n,a)),this.valueSubscriptions.set(n,()=>{l(),u&&u(),a.owner&&a.stop()})}sortNodePosition(n){return!this.current||!this.sortInstanceNodePosition||this.type!==n.type?0:this.sortInstanceNodePosition(this.current,n.current)}updateFeatures(){let n="animation";for(n in Fs){const a=Fs[n];if(!a)continue;const{isEnabled:i,Feature:l}=a;if(!this.features[n]&&l&&i(this.props)&&(this.features[n]=new l(this)),this.features[n]){const u=this.features[n];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Wt()}getStaticValue(n){return this.latestValues[n]}setStaticValue(n,a){this.latestValues[n]=a}update(n,a){(n.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=n,this.prevPresenceContext=this.presenceContext,this.presenceContext=a;for(let i=0;i<Fb.length;i++){const l=Fb[i];this.propEventSubscriptions[l]&&(this.propEventSubscriptions[l](),delete this.propEventSubscriptions[l]);const u="on"+l,f=n[u];f&&(this.propEventSubscriptions[l]=this.on(l,f))}this.prevMotionValues=ED(this,this.scrapeMotionValuesFromProps(n,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(n){return this.props.variants?this.props.variants[n]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(n){const a=this.getClosestVariantNode();if(a)return a.variantChildren&&a.variantChildren.add(n),()=>a.variantChildren.delete(n)}addValue(n,a){const i=this.values.get(n);a!==i&&(i&&this.removeValue(n),this.bindToMotionValue(n,a),this.values.set(n,a),this.latestValues[n]=a.get())}removeValue(n){this.values.delete(n);const a=this.valueSubscriptions.get(n);a&&(a(),this.valueSubscriptions.delete(n)),delete this.latestValues[n],this.removeValueFromRenderState(n,this.renderState)}hasValue(n){return this.values.has(n)}getValue(n,a){if(this.props.values&&this.props.values[n])return this.props.values[n];let i=this.values.get(n);return i===void 0&&a!==void 0&&(i=Bo(a===null?void 0:a,{owner:this}),this.addValue(n,i)),i}readValue(n,a){let i=this.latestValues[n]!==void 0||!this.current?this.latestValues[n]:this.getBaseTargetFromProps(this.props,n)??this.readValueFromInstance(this.current,n,this.options);return i!=null&&(typeof i=="string"&&(nw(i)||aw(i))?i=parseFloat(i):!MO(i)&&Vi.test(a)&&(i=Vw(n,a)),this.setBaseTarget(n,jn(i)?i.get():i)),jn(i)?i.get():i}setBaseTarget(n,a){this.baseTarget[n]=a}getBaseTarget(n){const{initial:a}=this.props;let i;if(typeof a=="string"||typeof a=="object"){const u=Ay(this.props,a,this.presenceContext?.custom);u&&(i=u[n])}if(a&&i!==void 0)return i;const l=this.getBaseTargetFromProps(this.props,n);return l!==void 0&&!jn(l)?l:this.initialValues[n]!==void 0&&i===void 0?void 0:this.baseTarget[n]}on(n,a){return this.events[n]||(this.events[n]=new ay),this.events[n].add(a)}notify(n,...a){this.events[n]&&this.events[n].notify(...a)}scheduleRenderMicrotask(){by.render(this.render)}}class dS extends _D{constructor(){super(...arguments),this.KeyframeResolver=bO}sortInstanceNodePosition(n,a){return n.compareDocumentPosition(a)&2?1:-1}getBaseTargetFromProps(n,a){return n.style?n.style[a]:void 0}removeValueFromRenderState(n,{vars:a,style:i}){delete a[n],delete i[n]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:n}=this.props;jn(n)&&(this.childSubscription=n.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}}function hS(e,{style:n,vars:a},i,l){const u=e.style;let f;for(f in n)u[f]=n[f];l?.applyProjectionStyles(u,i);for(f in a)u.setProperty(f,a[f])}function TD(e){return window.getComputedStyle(e)}class AD extends dS{constructor(){super(...arguments),this.type="html",this.renderInstance=hS}readValueFromInstance(n,a){if(el.has(a))return this.projection?.isProjecting?fm(a):BC(n,a);{const i=TD(n),l=(sy(a)?i.getPropertyValue(a):i[a])||0;return typeof l=="string"?l.trim():l}}measureInstanceViewportBox(n,{transformPagePoint:a}){return cS(n,a)}build(n,a,i){Ey(n,a,i.transformTemplate)}scrapeMotionValuesFromProps(n,a,i){return Ry(n,a,i)}}const pS=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function RD(e,n,a,i){hS(e,n,void 0,i);for(const l in n.attrs)e.setAttribute(pS.has(l)?l:Cy(l),n.attrs[l])}class CD extends dS{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Wt}getBaseTargetFromProps(n,a){return n[a]}readValueFromInstance(n,a){if(el.has(a)){const i=Uw(a);return i&&i.default||0}return a=pS.has(a)?a:Cy(a),n.getAttribute(a)}scrapeMotionValuesFromProps(n,a,i){return rS(n,a,i)}build(n,a,i){Jw(n,a,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(n,a,i,l){RD(n,a,i,l)}mount(n){this.isSVGTag=tS(n.tagName),super.mount(n)}}const OD=(e,n)=>Ty(e)?new CD(n):new AD(n,{allowProjection:e!==D.Fragment});function qs(e,n,a){const i=e.getProps();return Ay(i,n,a!==void 0?a:i.custom,e)}const wm=e=>Array.isArray(e);function DD(e,n,a){e.hasValue(n)?e.getValue(n).set(a):e.addValue(n,Bo(a))}function jD(e){return wm(e)?e[e.length-1]||0:e}function MD(e,n){const a=qs(e,n);let{transitionEnd:i={},transition:l={},...u}=a||{};u={...u,...i};for(const f in u){const p=jD(u[f]);DD(e,f,p)}}function kD(e){return!!(jn(e)&&e.add)}function Sm(e,n){const a=e.getValue("willChange");if(kD(a))return a.add(n);if(!a&&Ja.WillChange){const i=new Ja.WillChange("auto");e.addValue("willChange",i),i.add(n)}}function mS(e){return e.props[aS]}const ND=e=>e!==null;function zD(e,{repeat:n,repeatType:a="loop"},i){const l=e.filter(ND),u=n&&a!=="loop"&&n%2===1?0:l.length-1;return l[u]}const PD={type:"spring",stiffness:500,damping:25,restSpeed:10},LD=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),BD={type:"keyframes",duration:.8},UD={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},VD=(e,{keyframes:n})=>n.length>2?BD:el.has(e)?e.startsWith("scale")?LD(n[1]):PD:UD;function ID({when:e,delay:n,delayChildren:a,staggerChildren:i,staggerDirection:l,repeat:u,repeatType:f,repeatDelay:p,from:y,elapsed:g,...v}){return!!Object.keys(v).length}const Oy=(e,n,a,i={},l,u)=>f=>{const p=gy(i,e)||{},y=p.delay||i.delay||0;let{elapsed:g=0}=i;g=g-da(y);const v={keyframes:Array.isArray(a)?a:[null,a],ease:"easeOut",velocity:n.getVelocity(),...p,delay:-g,onUpdate:_=>{n.set(_),p.onUpdate&&p.onUpdate(_)},onComplete:()=>{f(),p.onComplete&&p.onComplete()},name:e,motionValue:n,element:u?void 0:l};ID(p)||Object.assign(v,VD(e,v)),v.duration&&(v.duration=da(v.duration)),v.repeatDelay&&(v.repeatDelay=da(v.repeatDelay)),v.from!==void 0&&(v.keyframes[0]=v.from);let w=!1;if((v.type===!1||v.duration===0&&!v.repeatDelay)&&(ym(v),v.delay===0&&(w=!0)),(Ja.instantAnimations||Ja.skipAnimations)&&(w=!0,ym(v),v.delay=0),v.allowFlatten=!p.type&&!p.ease,w&&!u&&n.get()!==void 0){const _=zD(v.keyframes,p);if(_!==void 0){Ot.update(()=>{v.onUpdate(_),v.onComplete()});return}}return p.isSync?new my(v):new sO(v)};function HD({protectedKeys:e,needsAnimating:n},a){const i=e.hasOwnProperty(a)&&n[a]!==!0;return n[a]=!1,i}function yS(e,n,{delay:a=0,transitionOverride:i,type:l}={}){let{transition:u=e.getDefaultTransition(),transitionEnd:f,...p}=n;i&&(u=i);const y=[],g=l&&e.animationState&&e.animationState.getState()[l];for(const v in p){const w=e.getValue(v,e.latestValues[v]??null),_=p[v];if(_===void 0||g&&HD(g,v))continue;const O={delay:a,...gy(u||{},v)},A=w.get();if(A!==void 0&&!w.isAnimating&&!Array.isArray(_)&&_===A&&!O.velocity)continue;let j=!1;if(window.MotionHandoffAnimation){const P=mS(e);if(P){const H=window.MotionHandoffAnimation(P,v,Ot);H!==null&&(O.startTime=H,j=!0)}}Sm(e,v),w.start(Oy(v,w,_,e.shouldReduceMotion&&Pw.has(v)?{type:!1}:O,e,j));const N=w.animation;N&&y.push(N)}return f&&Promise.all(y).then(()=>{Ot.update(()=>{f&&MD(e,f)})}),y}function gS(e,n,a,i=0,l=1){const u=Array.from(e).sort((g,v)=>g.sortNodePosition(v)).indexOf(n),f=e.size,p=(f-1)*i;return typeof a=="function"?a(u,f):l===1?u*i:p-u*i}function Em(e,n,a={}){const i=qs(e,n,a.type==="exit"?e.presenceContext?.custom:void 0);let{transition:l=e.getDefaultTransition()||{}}=i||{};a.transitionOverride&&(l=a.transitionOverride);const u=i?()=>Promise.all(yS(e,i,a)):()=>Promise.resolve(),f=e.variantChildren&&e.variantChildren.size?(y=0)=>{const{delayChildren:g=0,staggerChildren:v,staggerDirection:w}=l;return $D(e,n,y,g,v,w,a)}:()=>Promise.resolve(),{when:p}=l;if(p){const[y,g]=p==="beforeChildren"?[u,f]:[f,u];return y().then(()=>g())}else return Promise.all([u(),f(a.delay)])}function $D(e,n,a=0,i=0,l=0,u=1,f){const p=[];for(const y of e.variantChildren)y.notify("AnimationStart",n),p.push(Em(y,n,{...f,delay:a+(typeof i=="function"?0:i)+gS(e.variantChildren,y,i,l,u)}).then(()=>y.notify("AnimationComplete",n)));return Promise.all(p)}function qD(e,n,a={}){e.notify("AnimationStart",n);let i;if(Array.isArray(n)){const l=n.map(u=>Em(e,u,a));i=Promise.all(l)}else if(typeof n=="string")i=Em(e,n,a);else{const l=typeof n=="function"?qs(e,n,a.custom):n;i=Promise.all(yS(e,l,a))}return i.then(()=>{e.notify("AnimationComplete",n)})}function vS(e,n){if(!Array.isArray(n))return!1;const a=n.length;if(a!==e.length)return!1;for(let i=0;i<a;i++)if(n[i]!==e[i])return!1;return!0}const ZD=Sy.length;function bS(e){if(!e)return;if(!e.isControllingVariants){const a=e.parent?bS(e.parent)||{}:{};return e.props.initial!==void 0&&(a.initial=e.props.initial),a}const n={};for(let a=0;a<ZD;a++){const i=Sy[a],l=e.props[i];(Lu(l)||l===!1)&&(n[i]=l)}return n}const KD=[...wy].reverse(),YD=wy.length;function FD(e){return n=>Promise.all(n.map(({animation:a,options:i})=>qD(e,a,i)))}function GD(e){let n=FD(e),a=Gb(),i=!0;const l=y=>(g,v)=>{const w=qs(e,v,y==="exit"?e.presenceContext?.custom:void 0);if(w){const{transition:_,transitionEnd:O,...A}=w;g={...g,...A,...O}}return g};function u(y){n=y(e)}function f(y){const{props:g}=e,v=bS(e.parent)||{},w=[],_=new Set;let O={},A=1/0;for(let N=0;N<YD;N++){const P=KD[N],H=a[P],L=g[P]!==void 0?g[P]:v[P],ae=Lu(L),ee=P===y?H.isActive:null;ee===!1&&(A=N);let fe=L===v[P]&&L!==g[P]&&ae;if(fe&&i&&e.manuallyAnimateOnMount&&(fe=!1),H.protectedKeys={...O},!H.isActive&&ee===null||!L&&!H.prevProp||md(L)||typeof L=="boolean")continue;const ue=XD(H.prevProp,L);let le=ue||P===y&&H.isActive&&!fe&&ae||N>A&&ae,Oe=!1;const Be=Array.isArray(L)?L:[L];let Xe=Be.reduce(l(P),{});ee===!1&&(Xe={});const{prevResolvedValues:it={}}=H,Ht={...it,...Xe},pn=be=>{le=!0,_.has(be)&&(Oe=!0,_.delete(be)),H.needsAnimating[be]=!0;const Me=e.getValue(be);Me&&(Me.liveStyle=!1)};for(const be in Ht){const Me=Xe[be],Ke=it[be];if(O.hasOwnProperty(be))continue;let V=!1;wm(Me)&&wm(Ke)?V=!vS(Me,Ke):V=Me!==Ke,V?Me!=null?pn(be):_.add(be):Me!==void 0&&_.has(be)?pn(be):H.protectedKeys[be]=!0}H.prevProp=L,H.prevResolvedValues=Xe,H.isActive&&(O={...O,...Xe}),i&&e.blockInitialAnimation&&(le=!1);const ut=fe&&ue;le&&(!ut||Oe)&&w.push(...Be.map(be=>{const Me={type:P};if(typeof be=="string"&&i&&!ut&&e.manuallyAnimateOnMount&&e.parent){const{parent:Ke}=e,V=qs(Ke,be);if(Ke.enteringChildren&&V){const{delayChildren:k}=V.transition||{};Me.delay=gS(Ke.enteringChildren,e,k)}}return{animation:be,options:Me}}))}if(_.size){const N={};if(typeof g.initial!="boolean"){const P=qs(e,Array.isArray(g.initial)?g.initial[0]:g.initial);P&&P.transition&&(N.transition=P.transition)}_.forEach(P=>{const H=e.getBaseTarget(P),L=e.getValue(P);L&&(L.liveStyle=!0),N[P]=H??null}),w.push({animation:N})}let j=!!w.length;return i&&(g.initial===!1||g.initial===g.animate)&&!e.manuallyAnimateOnMount&&(j=!1),i=!1,j?n(w):Promise.resolve()}function p(y,g){if(a[y].isActive===g)return Promise.resolve();e.variantChildren?.forEach(w=>w.animationState?.setActive(y,g)),a[y].isActive=g;const v=f(y);for(const w in a)a[w].protectedKeys={};return v}return{animateChanges:f,setActive:p,setAnimateFunction:u,getState:()=>a,reset:()=>{a=Gb()}}}function XD(e,n){return typeof n=="string"?n!==e:Array.isArray(n)?!vS(n,e):!1}function _o(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Gb(){return{animate:_o(!0),whileInView:_o(),whileHover:_o(),whileTap:_o(),whileDrag:_o(),whileFocus:_o(),exit:_o()}}class Hi{constructor(n){this.isMounted=!1,this.node=n}update(){}}class QD extends Hi{constructor(n){super(n),n.animationState||(n.animationState=GD(n))}updateAnimationControlsSubscription(){const{animate:n}=this.node.getProps();md(n)&&(this.unmountControls=n.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:n}=this.node.getProps(),{animate:a}=this.node.prevProps||{};n!==a&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let WD=0;class JD extends Hi{constructor(){super(...arguments),this.id=WD++}update(){if(!this.node.presenceContext)return;const{isPresent:n,onExitComplete:a}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||n===i)return;const l=this.node.animationState.setActive("exit",!n);a&&!n&&l.then(()=>{a(this.id)})}mount(){const{register:n,onExitComplete:a}=this.node.presenceContext||{};a&&a(this.id),n&&(this.unmount=n(this.id))}unmount(){}}const ej={animation:{Feature:QD},exit:{Feature:JD}};function Uu(e,n,a,i={passive:!0}){return e.addEventListener(n,a,i),()=>e.removeEventListener(n,a)}function ec(e){return{point:{x:e.pageX,y:e.pageY}}}const tj=e=>n=>xy(n)&&e(n,ec(n));function Ru(e,n,a,i){return Uu(e,n,tj(a),i)}const xS=1e-4,nj=1-xS,rj=1+xS,wS=.01,aj=0-wS,ij=0+wS;function Zn(e){return e.max-e.min}function oj(e,n,a){return Math.abs(e-n)<=a}function Xb(e,n,a,i=.5){e.origin=i,e.originPoint=kt(n.min,n.max,e.origin),e.scale=Zn(a)/Zn(n),e.translate=kt(a.min,a.max,e.origin)-e.originPoint,(e.scale>=nj&&e.scale<=rj||isNaN(e.scale))&&(e.scale=1),(e.translate>=aj&&e.translate<=ij||isNaN(e.translate))&&(e.translate=0)}function Cu(e,n,a,i){Xb(e.x,n.x,a.x,i?i.originX:void 0),Xb(e.y,n.y,a.y,i?i.originY:void 0)}function Qb(e,n,a){e.min=a.min+n.min,e.max=e.min+Zn(n)}function sj(e,n,a){Qb(e.x,n.x,a.x),Qb(e.y,n.y,a.y)}function Wb(e,n,a){e.min=n.min-a.min,e.max=e.min+Zn(n)}function Ou(e,n,a){Wb(e.x,n.x,a.x),Wb(e.y,n.y,a.y)}function _r(e){return[e("x"),e("y")]}const SS=({current:e})=>e?e.ownerDocument.defaultView:null,Jb=(e,n)=>Math.abs(e-n);function lj(e,n){const a=Jb(e.x,n.x),i=Jb(e.y,n.y);return Math.sqrt(a**2+i**2)}class ES{constructor(n,a,{transformPagePoint:i,contextWindow:l=window,dragSnapToOrigin:u=!1,distanceThreshold:f=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=Lp(this.lastMoveEventInfo,this.history),O=this.startEvent!==null,A=lj(_.offset,{x:0,y:0})>=this.distanceThreshold;if(!O&&!A)return;const{point:j}=_,{timestamp:N}=Dn;this.history.push({...j,timestamp:N});const{onStart:P,onMove:H}=this.handlers;O||(P&&P(this.lastMoveEvent,_),this.startEvent=this.lastMoveEvent),H&&H(this.lastMoveEvent,_)},this.handlePointerMove=(_,O)=>{this.lastMoveEvent=_,this.lastMoveEventInfo=Pp(O,this.transformPagePoint),Ot.update(this.updatePoint,!0)},this.handlePointerUp=(_,O)=>{this.end();const{onEnd:A,onSessionEnd:j,resumeAnimation:N}=this.handlers;if(this.dragSnapToOrigin&&N&&N(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const P=Lp(_.type==="pointercancel"?this.lastMoveEventInfo:Pp(O,this.transformPagePoint),this.history);this.startEvent&&A&&A(_,P),j&&j(_,P)},!xy(n))return;this.dragSnapToOrigin=u,this.handlers=a,this.transformPagePoint=i,this.distanceThreshold=f,this.contextWindow=l||window;const p=ec(n),y=Pp(p,this.transformPagePoint),{point:g}=y,{timestamp:v}=Dn;this.history=[{...g,timestamp:v}];const{onSessionStart:w}=a;w&&w(n,Lp(y,this.history)),this.removeListeners=Qu(Ru(this.contextWindow,"pointermove",this.handlePointerMove),Ru(this.contextWindow,"pointerup",this.handlePointerUp),Ru(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(n){this.handlers=n}end(){this.removeListeners&&this.removeListeners(),ei(this.updatePoint)}}function Pp(e,n){return n?{point:n(e.point)}:e}function e1(e,n){return{x:e.x-n.x,y:e.y-n.y}}function Lp({point:e},n){return{point:e,delta:e1(e,_S(n)),offset:e1(e,uj(n)),velocity:cj(n,.1)}}function uj(e){return e[0]}function _S(e){return e[e.length-1]}function cj(e,n){if(e.length<2)return{x:0,y:0};let a=e.length-1,i=null;const l=_S(e);for(;a>=0&&(i=e[a],!(l.timestamp-i.timestamp>da(n)));)a--;if(!i)return{x:0,y:0};const u=Rr(l.timestamp-i.timestamp);if(u===0)return{x:0,y:0};const f={x:(l.x-i.x)/u,y:(l.y-i.y)/u};return f.x===1/0&&(f.x=0),f.y===1/0&&(f.y=0),f}function fj(e,{min:n,max:a},i){return n!==void 0&&e<n?e=i?kt(n,e,i.min):Math.max(e,n):a!==void 0&&e>a&&(e=i?kt(a,e,i.max):Math.min(e,a)),e}function t1(e,n,a){return{min:n!==void 0?e.min+n:void 0,max:a!==void 0?e.max+a-(e.max-e.min):void 0}}function dj(e,{top:n,left:a,bottom:i,right:l}){return{x:t1(e.x,a,l),y:t1(e.y,n,i)}}function n1(e,n){let a=n.min-e.min,i=n.max-e.max;return n.max-n.min<e.max-e.min&&([a,i]=[i,a]),{min:a,max:i}}function hj(e,n){return{x:n1(e.x,n.x),y:n1(e.y,n.y)}}function pj(e,n){let a=.5;const i=Zn(e),l=Zn(n);return l>i?a=Nu(n.min,n.max-i,e.min):i>l&&(a=Nu(e.min,e.max-l,n.min)),Wa(0,1,a)}function mj(e,n){const a={};return n.min!==void 0&&(a.min=n.min-e.min),n.max!==void 0&&(a.max=n.max-e.min),a}const _m=.35;function yj(e=_m){return e===!1?e=0:e===!0&&(e=_m),{x:r1(e,"left","right"),y:r1(e,"top","bottom")}}function r1(e,n,a){return{min:a1(e,n),max:a1(e,a)}}function a1(e,n){return typeof e=="number"?e:e[n]||0}const gj=new WeakMap;class vj{constructor(n){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Wt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=n}start(n,{snapToCursor:a=!1,distanceThreshold:i}={}){const{presenceContext:l}=this.visualElement;if(l&&l.isPresent===!1)return;const u=w=>{const{dragSnapToOrigin:_}=this.getProps();_?this.pauseAnimation():this.stopAnimation(),a&&this.snapToCursor(ec(w).point)},f=(w,_)=>{const{drag:O,dragPropagation:A,onDragStart:j}=this.getProps();if(O&&!A&&(this.openDragLock&&this.openDragLock(),this.openDragLock=EO(O),!this.openDragLock))return;this.latestPointerEvent=w,this.latestPanInfo=_,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),_r(P=>{let H=this.getAxisMotionValue(P).get()||0;if(ha.test(H)){const{projection:L}=this.visualElement;if(L&&L.layout){const ae=L.layout.layoutBox[P];ae&&(H=Zn(ae)*(parseFloat(H)/100))}}this.originPoint[P]=H}),j&&Ot.postRender(()=>j(w,_)),Sm(this.visualElement,"transform");const{animationState:N}=this.visualElement;N&&N.setActive("whileDrag",!0)},p=(w,_)=>{this.latestPointerEvent=w,this.latestPanInfo=_;const{dragPropagation:O,dragDirectionLock:A,onDirectionLock:j,onDrag:N}=this.getProps();if(!O&&!this.openDragLock)return;const{offset:P}=_;if(A&&this.currentDirection===null){this.currentDirection=bj(P),this.currentDirection!==null&&j&&j(this.currentDirection);return}this.updateAxis("x",_.point,P),this.updateAxis("y",_.point,P),this.visualElement.render(),N&&N(w,_)},y=(w,_)=>{this.latestPointerEvent=w,this.latestPanInfo=_,this.stop(w,_),this.latestPointerEvent=null,this.latestPanInfo=null},g=()=>_r(w=>this.getAnimationState(w)==="paused"&&this.getAxisMotionValue(w).animation?.play()),{dragSnapToOrigin:v}=this.getProps();this.panSession=new ES(n,{onSessionStart:u,onStart:f,onMove:p,onSessionEnd:y,resumeAnimation:g},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:v,distanceThreshold:i,contextWindow:SS(this.visualElement)})}stop(n,a){const i=n||this.latestPointerEvent,l=a||this.latestPanInfo,u=this.isDragging;if(this.cancel(),!u||!l||!i)return;const{velocity:f}=l;this.startAnimation(f);const{onDragEnd:p}=this.getProps();p&&Ot.postRender(()=>p(i,l))}cancel(){this.isDragging=!1;const{projection:n,animationState:a}=this.visualElement;n&&(n.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),a&&a.setActive("whileDrag",!1)}updateAxis(n,a,i){const{drag:l}=this.getProps();if(!i||!Ef(n,l,this.currentDirection))return;const u=this.getAxisMotionValue(n);let f=this.originPoint[n]+i[n];this.constraints&&this.constraints[n]&&(f=fj(f,this.constraints[n],this.elastic[n])),u.set(f)}resolveConstraints(){const{dragConstraints:n,dragElastic:a}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,l=this.constraints;n&&Ps(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=dj(i.layoutBox,n):this.constraints=!1,this.elastic=yj(a),l!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&_r(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=mj(i.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:n,onMeasureDragConstraints:a}=this.getProps();if(!n||!Ps(n))return!1;const i=n.current,{projection:l}=this.visualElement;if(!l||!l.layout)return!1;const u=xD(i,l.root,this.visualElement.getTransformPagePoint());let f=hj(l.layout.layoutBox,u);if(a){const p=a(gD(f));this.hasMutatedConstraints=!!p,p&&(f=sS(p))}return f}startAnimation(n){const{drag:a,dragMomentum:i,dragElastic:l,dragTransition:u,dragSnapToOrigin:f,onDragTransitionEnd:p}=this.getProps(),y=this.constraints||{},g=_r(v=>{if(!Ef(v,a,this.currentDirection))return;let w=y&&y[v]||{};f&&(w={min:0,max:0});const _=l?200:1e6,O=l?40:1e7,A={type:"inertia",velocity:i?n[v]:0,bounceStiffness:_,bounceDamping:O,timeConstant:750,restDelta:1,restSpeed:10,...u,...w};return this.startAxisValueAnimation(v,A)});return Promise.all(g).then(p)}startAxisValueAnimation(n,a){const i=this.getAxisMotionValue(n);return Sm(this.visualElement,n),i.start(Oy(n,i,0,a,this.visualElement,!1))}stopAnimation(){_r(n=>this.getAxisMotionValue(n).stop())}pauseAnimation(){_r(n=>this.getAxisMotionValue(n).animation?.pause())}getAnimationState(n){return this.getAxisMotionValue(n).animation?.state}getAxisMotionValue(n){const a=`_drag${n.toUpperCase()}`,i=this.visualElement.getProps(),l=i[a];return l||this.visualElement.getValue(n,(i.initial?i.initial[n]:void 0)||0)}snapToCursor(n){_r(a=>{const{drag:i}=this.getProps();if(!Ef(a,i,this.currentDirection))return;const{projection:l}=this.visualElement,u=this.getAxisMotionValue(a);if(l&&l.layout){const{min:f,max:p}=l.layout.layoutBox[a];u.set(n[a]-kt(f,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:n,dragConstraints:a}=this.getProps(),{projection:i}=this.visualElement;if(!Ps(a)||!i||!this.constraints)return;this.stopAnimation();const l={x:0,y:0};_r(f=>{const p=this.getAxisMotionValue(f);if(p&&this.constraints!==!1){const y=p.get();l[f]=pj({min:y,max:y},this.constraints[f])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),_r(f=>{if(!Ef(f,n,null))return;const p=this.getAxisMotionValue(f),{min:y,max:g}=this.constraints[f];p.set(kt(y,g,l[f]))})}addListeners(){if(!this.visualElement.current)return;gj.set(this.visualElement,this);const n=this.visualElement.current,a=Ru(n,"pointerdown",y=>{const{drag:g,dragListener:v=!0}=this.getProps();g&&v&&this.start(y)}),i=()=>{const{dragConstraints:y}=this.getProps();Ps(y)&&y.current&&(this.constraints=this.resolveRefConstraints())},{projection:l}=this.visualElement,u=l.addEventListener("measure",i);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),Ot.read(i);const f=Uu(window,"resize",()=>this.scalePositionWithinConstraints()),p=l.addEventListener("didUpdate",(({delta:y,hasLayoutChanged:g})=>{this.isDragging&&g&&(_r(v=>{const w=this.getAxisMotionValue(v);w&&(this.originPoint[v]+=y[v].translate,w.set(w.get()+y[v].translate))}),this.visualElement.render())}));return()=>{f(),a(),u(),p&&p()}}getProps(){const n=this.visualElement.getProps(),{drag:a=!1,dragDirectionLock:i=!1,dragPropagation:l=!1,dragConstraints:u=!1,dragElastic:f=_m,dragMomentum:p=!0}=n;return{...n,drag:a,dragDirectionLock:i,dragPropagation:l,dragConstraints:u,dragElastic:f,dragMomentum:p}}}function Ef(e,n,a){return(n===!0||n===e)&&(a===null||a===e)}function bj(e,n=10){let a=null;return Math.abs(e.y)>n?a="y":Math.abs(e.x)>n&&(a="x"),a}class xj extends Hi{constructor(n){super(n),this.removeGroupControls=Cr,this.removeListeners=Cr,this.controls=new vj(n)}mount(){const{dragControls:n}=this.node.getProps();n&&(this.removeGroupControls=n.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Cr}unmount(){this.removeGroupControls(),this.removeListeners()}}const i1=e=>(n,a)=>{e&&Ot.postRender(()=>e(n,a))};class wj extends Hi{constructor(){super(...arguments),this.removePointerDownListener=Cr}onPointerDown(n){this.session=new ES(n,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:SS(this.node)})}createPanHandlers(){const{onPanSessionStart:n,onPanStart:a,onPan:i,onPanEnd:l}=this.node.getProps();return{onSessionStart:i1(n),onStart:i1(a),onMove:i,onEnd:(u,f)=>{delete this.session,l&&Ot.postRender(()=>l(u,f))}}}mount(){this.removePointerDownListener=Ru(this.node.current,"pointerdown",n=>this.onPointerDown(n))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const If={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function o1(e,n){return n.max===n.min?0:e/(n.max-n.min)*100}const hu={correct:(e,n)=>{if(!n.target)return e;if(typeof e=="string")if(Ze.test(e))e=parseFloat(e);else return e;const a=o1(e,n.target.x),i=o1(e,n.target.y);return`${a}% ${i}%`}},Sj={correct:(e,{treeScale:n,projectionDelta:a})=>{const i=e,l=Vi.parse(e);if(l.length>5)return i;const u=Vi.createTransformer(e),f=typeof l[0]!="number"?1:0,p=a.x.scale*n.x,y=a.y.scale*n.y;l[0+f]/=p,l[1+f]/=y;const g=kt(p,y,.5);return typeof l[2+f]=="number"&&(l[2+f]/=g),typeof l[3+f]=="number"&&(l[3+f]/=g),u(l)}};let Bp=!1;class Ej extends D.Component{componentDidMount(){const{visualElement:n,layoutGroup:a,switchLayoutGroup:i,layoutId:l}=this.props,{projection:u}=n;ZO(_j),u&&(a.group&&a.group.add(u),i&&i.register&&l&&i.register(u),Bp&&u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),If.hasEverUpdated=!0}getSnapshotBeforeUpdate(n){const{layoutDependency:a,visualElement:i,drag:l,isPresent:u}=this.props,{projection:f}=i;return f&&(f.isPresent=u,Bp=!0,l||n.layoutDependency!==a||a===void 0||n.isPresent!==u?f.willUpdate():this.safeToRemove(),n.isPresent!==u&&(u?f.promote():f.relegate()||Ot.postRender(()=>{const p=f.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:n}=this.props.visualElement;n&&(n.root.didUpdate(),by.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:n,layoutGroup:a,switchLayoutGroup:i}=this.props,{projection:l}=n;Bp=!0,l&&(l.scheduleCheckAfterUnmount(),a&&a.group&&a.group.remove(l),i&&i.deregister&&i.deregister(l))}safeToRemove(){const{safeToRemove:n}=this.props;n&&n()}render(){return null}}function TS(e){const[n,a]=Yw(),i=D.useContext(Qm);return R.jsx(Ej,{...e,layoutGroup:i,switchLayoutGroup:D.useContext(iS),isPresent:n,safeToRemove:a})}const _j={borderRadius:{...hu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:hu,borderTopRightRadius:hu,borderBottomLeftRadius:hu,borderBottomRightRadius:hu,boxShadow:Sj};function Tj(e,n,a){const i=jn(e)?e:Bo(e);return i.start(Oy("",i,n,a)),i.animation}const Aj=(e,n)=>e.depth-n.depth;class Rj{constructor(){this.children=[],this.isDirty=!1}add(n){ey(this.children,n),this.isDirty=!0}remove(n){ty(this.children,n),this.isDirty=!0}forEach(n){this.isDirty&&this.children.sort(Aj),this.isDirty=!1,this.children.forEach(n)}}function Cj(e,n){const a=er.now(),i=({timestamp:l})=>{const u=l-a;u>=n&&(ei(i),e(u-n))};return Ot.setup(i,!0),()=>ei(i)}const AS=["TopLeft","TopRight","BottomLeft","BottomRight"],Oj=AS.length,s1=e=>typeof e=="string"?parseFloat(e):e,l1=e=>typeof e=="number"||Ze.test(e);function Dj(e,n,a,i,l,u){l?(e.opacity=kt(0,a.opacity??1,jj(i)),e.opacityExit=kt(n.opacity??1,0,Mj(i))):u&&(e.opacity=kt(n.opacity??1,a.opacity??1,i));for(let f=0;f<Oj;f++){const p=`border${AS[f]}Radius`;let y=u1(n,p),g=u1(a,p);if(y===void 0&&g===void 0)continue;y||(y=0),g||(g=0),y===0||g===0||l1(y)===l1(g)?(e[p]=Math.max(kt(s1(y),s1(g),i),0),(ha.test(g)||ha.test(y))&&(e[p]+="%")):e[p]=g}(n.rotate||a.rotate)&&(e.rotate=kt(n.rotate||0,a.rotate||0,i))}function u1(e,n){return e[n]!==void 0?e[n]:e.borderRadius}const jj=RS(0,.5,dw),Mj=RS(.5,.95,Cr);function RS(e,n,a){return i=>i<e?0:i>n?1:a(Nu(e,n,i))}function c1(e,n){e.min=n.min,e.max=n.max}function Er(e,n){c1(e.x,n.x),c1(e.y,n.y)}function f1(e,n){e.translate=n.translate,e.scale=n.scale,e.originPoint=n.originPoint,e.origin=n.origin}function d1(e,n,a,i,l){return e-=n,e=Gf(e,1/a,i),l!==void 0&&(e=Gf(e,1/l,i)),e}function kj(e,n=0,a=1,i=.5,l,u=e,f=e){if(ha.test(n)&&(n=parseFloat(n),n=kt(f.min,f.max,n/100)-f.min),typeof n!="number")return;let p=kt(u.min,u.max,i);e===u&&(p-=n),e.min=d1(e.min,n,a,p,l),e.max=d1(e.max,n,a,p,l)}function h1(e,n,[a,i,l],u,f){kj(e,n[a],n[i],n[l],n.scale,u,f)}const Nj=["x","scaleX","originX"],zj=["y","scaleY","originY"];function p1(e,n,a,i){h1(e.x,n,Nj,a?a.x:void 0,i?i.x:void 0),h1(e.y,n,zj,a?a.y:void 0,i?i.y:void 0)}function m1(e){return e.translate===0&&e.scale===1}function CS(e){return m1(e.x)&&m1(e.y)}function y1(e,n){return e.min===n.min&&e.max===n.max}function Pj(e,n){return y1(e.x,n.x)&&y1(e.y,n.y)}function g1(e,n){return Math.round(e.min)===Math.round(n.min)&&Math.round(e.max)===Math.round(n.max)}function OS(e,n){return g1(e.x,n.x)&&g1(e.y,n.y)}function v1(e){return Zn(e.x)/Zn(e.y)}function b1(e,n){return e.translate===n.translate&&e.scale===n.scale&&e.originPoint===n.originPoint}class Lj{constructor(){this.members=[]}add(n){ey(this.members,n),n.scheduleRender()}remove(n){if(ty(this.members,n),n===this.prevLead&&(this.prevLead=void 0),n===this.lead){const a=this.members[this.members.length-1];a&&this.promote(a)}}relegate(n){const a=this.members.findIndex(l=>n===l);if(a===0)return!1;let i;for(let l=a;l>=0;l--){const u=this.members[l];if(u.isPresent!==!1){i=u;break}}return i?(this.promote(i),!0):!1}promote(n,a){const i=this.lead;if(n!==i&&(this.prevLead=i,this.lead=n,n.show(),i)){i.instance&&i.scheduleRender(),n.scheduleRender(),n.resumeFrom=i,a&&(n.resumeFrom.preserveOpacity=!0),i.snapshot&&(n.snapshot=i.snapshot,n.snapshot.latestValues=i.animationValues||i.latestValues),n.root&&n.root.isUpdating&&(n.isLayoutDirty=!0);const{crossfade:l}=n.options;l===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(n=>{const{options:a,resumingFrom:i}=n;a.onExitComplete&&a.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(n=>{n.instance&&n.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Bj(e,n,a){let i="";const l=e.x.translate/n.x,u=e.y.translate/n.y,f=a?.z||0;if((l||u||f)&&(i=`translate3d(${l}px, ${u}px, ${f}px) `),(n.x!==1||n.y!==1)&&(i+=`scale(${1/n.x}, ${1/n.y}) `),a){const{transformPerspective:g,rotate:v,rotateX:w,rotateY:_,skewX:O,skewY:A}=a;g&&(i=`perspective(${g}px) ${i}`),v&&(i+=`rotate(${v}deg) `),w&&(i+=`rotateX(${w}deg) `),_&&(i+=`rotateY(${_}deg) `),O&&(i+=`skewX(${O}deg) `),A&&(i+=`skewY(${A}deg) `)}const p=e.x.scale*n.x,y=e.y.scale*n.y;return(p!==1||y!==1)&&(i+=`scale(${p}, ${y})`),i||"none"}const Up=["","X","Y","Z"],Uj=1e3;let Vj=0;function Vp(e,n,a,i){const{latestValues:l}=n;l[e]&&(a[e]=l[e],n.setStaticValue(e,0),i&&(i[e]=0))}function DS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:n}=e.options;if(!n)return;const a=mS(n);if(window.MotionHasOptimisedAnimation(a,"transform")){const{layout:l,layoutId:u}=e.options;window.MotionCancelOptimisedAnimation(a,"transform",Ot,!(l||u))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&DS(i)}function jS({attachResizeListener:e,defaultParent:n,measureScroll:a,checkIsScrollRoot:i,resetTransform:l}){return class{constructor(f={},p=n?.()){this.id=Vj++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach($j),this.nodes.forEach(Yj),this.nodes.forEach(Fj),this.nodes.forEach(qj)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=f,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let y=0;y<this.path.length;y++)this.path[y].shouldResetTransform=!0;this.root===this&&(this.nodes=new Rj)}addEventListener(f,p){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new ay),this.eventHandlers.get(f).add(p)}notifyListeners(f,...p){const y=this.eventHandlers.get(f);y&&y.notify(...p)}hasListeners(f){return this.eventHandlers.has(f)}mount(f){if(this.instance)return;this.isSVG=Kw(f)&&!OO(f),this.instance=f;const{layoutId:p,layout:y,visualElement:g}=this.options;if(g&&!g.current&&g.mount(f),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(y||p)&&(this.isLayoutDirty=!0),e){let v,w=0;const _=()=>this.root.updateBlockedByResize=!1;Ot.read(()=>{w=window.innerWidth}),e(f,()=>{const O=window.innerWidth;O!==w&&(w=O,this.root.updateBlockedByResize=!0,v&&v(),v=Cj(_,250),If.hasAnimatedSinceResize&&(If.hasAnimatedSinceResize=!1,this.nodes.forEach(S1)))})}p&&this.root.registerSharedNode(p,this),this.options.animate!==!1&&g&&(p||y)&&this.addEventListener("didUpdate",({delta:v,hasLayoutChanged:w,hasRelativeLayoutChanged:_,layout:O})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const A=this.options.transition||g.getDefaultTransition()||Jj,{onLayoutAnimationStart:j,onLayoutAnimationComplete:N}=g.getProps(),P=!this.targetLayout||!OS(this.targetLayout,O),H=!w&&_;if(this.options.layoutRoot||this.resumeFrom||H||w&&(P||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const L={...gy(A,"layout"),onPlay:j,onComplete:N};(g.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L),this.setAnimationOrigin(v,H)}else w||S1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=O})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const f=this.getStack();f&&f.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ei(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Gj),this.animationId++)}getTransformTemplate(){const{visualElement:f}=this.options;return f&&f.getProps().transformTemplate}willUpdate(f=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&DS(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v<this.path.length;v++){const w=this.path[v];w.shouldResetTransform=!0,w.updateScroll("snapshot"),w.options.layoutRoot&&w.willUpdate(!1)}const{layoutId:p,layout:y}=this.options;if(p===void 0&&!y)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),f&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(x1);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(w1);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Kj),this.nodes.forEach(Ij),this.nodes.forEach(Hj)):this.nodes.forEach(w1),this.clearAllSnapshots();const p=er.now();Dn.delta=Wa(0,1e3/60,p-Dn.timestamp),Dn.timestamp=p,Dn.isProcessing=!0,Cp.update.process(Dn),Cp.preRender.process(Dn),Cp.render.process(Dn),Dn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,by.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Zj),this.sharedNodes.forEach(Xj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ot.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ot.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Zn(this.snapshot.measuredBox.x)&&!Zn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let y=0;y<this.path.length;y++)this.path[y].updateScroll();const f=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Wt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,f?f.layoutBox:void 0)}updateScroll(f="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===f&&(p=!1),p&&this.instance){const y=i(this.instance);this.scroll={animationId:this.root.animationId,phase:f,isRoot:y,offset:a(this.instance),wasRoot:this.scroll?this.scroll.isRoot:y}}}resetTransform(){if(!l)return;const f=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!CS(this.projectionDelta),y=this.getTransformTemplate(),g=y?y(this.latestValues,""):void 0,v=g!==this.prevTransformTemplateValue;f&&this.instance&&(p||Ro(this.latestValues)||v)&&(l(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(f=!0){const p=this.measurePageBox();let y=this.removeElementScroll(p);return f&&(y=this.removeTransform(y)),eM(y),{animationId:this.root.animationId,measuredBox:p,layoutBox:y,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:f}=this.options;if(!f)return Wt();const p=f.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(tM))){const{scroll:g}=this.root;g&&(Ls(p.x,g.offset.x),Ls(p.y,g.offset.y))}return p}removeElementScroll(f){const p=Wt();if(Er(p,f),this.scroll?.wasRoot)return p;for(let y=0;y<this.path.length;y++){const g=this.path[y],{scroll:v,options:w}=g;g!==this.root&&v&&w.layoutScroll&&(v.wasRoot&&Er(p,f),Ls(p.x,v.offset.x),Ls(p.y,v.offset.y))}return p}applyTransform(f,p=!1){const y=Wt();Er(y,f);for(let g=0;g<this.path.length;g++){const v=this.path[g];!p&&v.options.layoutScroll&&v.scroll&&v!==v.root&&Bs(y,{x:-v.scroll.offset.x,y:-v.scroll.offset.y}),Ro(v.latestValues)&&Bs(y,v.latestValues)}return Ro(this.latestValues)&&Bs(y,this.latestValues),y}removeTransform(f){const p=Wt();Er(p,f);for(let y=0;y<this.path.length;y++){const g=this.path[y];if(!g.instance||!Ro(g.latestValues))continue;vm(g.latestValues)&&g.updateSnapshot();const v=Wt(),w=g.measurePageBox();Er(v,w),p1(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,v)}return Ro(this.latestValues)&&p1(p,this.latestValues),p}setTargetDelta(f){this.targetDelta=f,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(f){this.options={...this.options,...f,crossfade:f.crossfade!==void 0?f.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Dn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(f=!1){const p=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=p.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=p.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=p.isSharedProjectionDirty);const y=!!this.resumingFrom||this!==p;if(!(f||y&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:v,layoutId:w}=this.options;if(!(!this.layout||!(v||w))){if(this.resolvedRelativeTargetAt=Dn.timestamp,!this.targetDelta&&!this.relativeTarget){const _=this.getClosestProjectingParent();_&&_.layout&&this.animationProgress!==1?(this.relativeParent=_,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Wt(),this.relativeTargetOrigin=Wt(),Ou(this.relativeTargetOrigin,this.layout.layoutBox,_.layout.layoutBox),Er(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Wt(),this.targetWithTransforms=Wt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),sj(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Er(this.target,this.layout.layoutBox),uS(this.target,this.targetDelta)):Er(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const _=this.getClosestProjectingParent();_&&!!_.resumingFrom==!!this.resumingFrom&&!_.options.layoutScroll&&_.target&&this.animationProgress!==1?(this.relativeParent=_,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Wt(),this.relativeTargetOrigin=Wt(),Ou(this.relativeTargetOrigin,this.target,_.target),Er(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||vm(this.parent.latestValues)||lS(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const f=this.getLead(),p=!!this.resumingFrom||this!==f;let y=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(y=!1),p&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(y=!1),this.resolvedRelativeTargetAt===Dn.timestamp&&(y=!1),y)return;const{layout:g,layoutId:v}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(g||v))return;Er(this.layoutCorrected,this.layout.layoutBox);const w=this.treeScale.x,_=this.treeScale.y;bD(this.layoutCorrected,this.treeScale,this.path,p),f.layout&&!f.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(f.target=f.layout.layoutBox,f.targetWithTransforms=Wt());const{target:O}=f;if(!O){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(f1(this.prevProjectionDelta.x,this.projectionDelta.x),f1(this.prevProjectionDelta.y,this.projectionDelta.y)),Cu(this.projectionDelta,this.layoutCorrected,O,this.latestValues),(this.treeScale.x!==w||this.treeScale.y!==_||!b1(this.projectionDelta.x,this.prevProjectionDelta.x)||!b1(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",O))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(f=!0){if(this.options.visualElement?.scheduleRender(),f){const p=this.getStack();p&&p.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Us(),this.projectionDelta=Us(),this.projectionDeltaWithTransform=Us()}setAnimationOrigin(f,p=!1){const y=this.snapshot,g=y?y.latestValues:{},v={...this.latestValues},w=Us();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const _=Wt(),O=y?y.source:void 0,A=this.layout?this.layout.source:void 0,j=O!==A,N=this.getStack(),P=!N||N.members.length<=1,H=!!(j&&!P&&this.options.crossfade===!0&&!this.path.some(Wj));this.animationProgress=0;let L;this.mixTargetDelta=ae=>{const ee=ae/1e3;E1(w.x,f.x,ee),E1(w.y,f.y,ee),this.setTargetDelta(w),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ou(_,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Qj(this.relativeTarget,this.relativeTargetOrigin,_,ee),L&&Pj(this.relativeTarget,L)&&(this.isProjectionDirty=!1),L||(L=Wt()),Er(L,this.relativeTarget)),j&&(this.animationValues=v,Dj(v,g,this.latestValues,ee,H,P)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=ee},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(f){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ei(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ot.update(()=>{If.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Bo(0)),this.currentAnimation=Tj(this.motionValue,[0,1e3],{...f,velocity:0,isSync:!0,onUpdate:p=>{this.mixTargetDelta(p),f.onUpdate&&f.onUpdate(p)},onStop:()=>{},onComplete:()=>{f.onComplete&&f.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const f=this.getStack();f&&f.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Uj),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const f=this.getLead();let{targetWithTransforms:p,target:y,layout:g,latestValues:v}=f;if(!(!p||!y||!g)){if(this!==f&&this.layout&&g&&MS(this.options.animationType,this.layout.layoutBox,g.layoutBox)){y=this.target||Wt();const w=Zn(this.layout.layoutBox.x);y.x.min=f.target.x.min,y.x.max=y.x.min+w;const _=Zn(this.layout.layoutBox.y);y.y.min=f.target.y.min,y.y.max=y.y.min+_}Er(p,y),Bs(p,v),Cu(this.projectionDeltaWithTransform,this.layoutCorrected,p,v)}}registerSharedNode(f,p){this.sharedNodes.has(f)||this.sharedNodes.set(f,new Lj),this.sharedNodes.get(f).add(p);const g=p.options.initialPromotionConfig;p.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(p):void 0})}isLead(){const f=this.getStack();return f?f.lead===this:!0}getLead(){const{layoutId:f}=this.options;return f?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:f}=this.options;return f?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:f}=this.options;if(f)return this.root.sharedNodes.get(f)}promote({needsReset:f,transition:p,preserveFollowOpacity:y}={}){const g=this.getStack();g&&g.promote(this,y),f&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const f=this.getStack();return f?f.relegate(this):!1}resetSkewAndRotation(){const{visualElement:f}=this.options;if(!f)return;let p=!1;const{latestValues:y}=f;if((y.z||y.rotate||y.rotateX||y.rotateY||y.rotateZ||y.skewX||y.skewY)&&(p=!0),!p)return;const g={};y.z&&Vp("z",f,g,this.animationValues);for(let v=0;v<Up.length;v++)Vp(`rotate${Up[v]}`,f,g,this.animationValues),Vp(`skew${Up[v]}`,f,g,this.animationValues);f.render();for(const v in g)f.setStaticValue(v,g[v]),this.animationValues&&(this.animationValues[v]=g[v]);f.scheduleRender()}applyProjectionStyles(f,p){if(!this.instance||this.isSVG)return;if(!this.isVisible){f.visibility="hidden";return}const y=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,f.visibility="",f.opacity="",f.pointerEvents=Vf(p?.pointerEvents)||"",f.transform=y?y(this.latestValues,""):"none";return}const g=this.getLead();if(!this.projectionDelta||!this.layout||!g.target){this.options.layoutId&&(f.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,f.pointerEvents=Vf(p?.pointerEvents)||""),this.hasProjected&&!Ro(this.latestValues)&&(f.transform=y?y({},""):"none",this.hasProjected=!1);return}f.visibility="";const v=g.animationValues||g.latestValues;this.applyTransformsToTarget();let w=Bj(this.projectionDeltaWithTransform,this.treeScale,v);y&&(w=y(v,w)),f.transform=w;const{x:_,y:O}=this.projectionDelta;f.transformOrigin=`${_.origin*100}% ${O.origin*100}% 0`,g.animationValues?f.opacity=g===this?v.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:v.opacityExit:f.opacity=g===this?v.opacity!==void 0?v.opacity:"":v.opacityExit!==void 0?v.opacityExit:0;for(const A in Bu){if(v[A]===void 0)continue;const{correct:j,applyTo:N,isCSSVariable:P}=Bu[A],H=w==="none"?v[A]:j(v[A],g);if(N){const L=N.length;for(let ae=0;ae<L;ae++)f[N[ae]]=H}else P?this.options.visualElement.renderState.vars[A]=H:f[A]=H}this.options.layoutId&&(f.pointerEvents=g===this?Vf(p?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(f=>f.currentAnimation?.stop()),this.root.nodes.forEach(x1),this.root.sharedNodes.clear()}}}function Ij(e){e.updateLayout()}function Hj(e){const n=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:a,measuredBox:i}=e.layout,{animationType:l}=e.options,u=n.source!==e.layout.source;l==="size"?_r(v=>{const w=u?n.measuredBox[v]:n.layoutBox[v],_=Zn(w);w.min=a[v].min,w.max=w.min+_}):MS(l,n.layoutBox,a)&&_r(v=>{const w=u?n.measuredBox[v]:n.layoutBox[v],_=Zn(a[v]);w.max=w.min+_,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[v].max=e.relativeTarget[v].min+_)});const f=Us();Cu(f,a,n.layoutBox);const p=Us();u?Cu(p,e.applyTransform(i,!0),n.measuredBox):Cu(p,a,n.layoutBox);const y=!CS(f);let g=!1;if(!e.resumeFrom){const v=e.getClosestProjectingParent();if(v&&!v.resumeFrom){const{snapshot:w,layout:_}=v;if(w&&_){const O=Wt();Ou(O,n.layoutBox,w.layoutBox);const A=Wt();Ou(A,a,_.layoutBox),OS(O,A)||(g=!0),v.options.layoutRoot&&(e.relativeTarget=A,e.relativeTargetOrigin=O,e.relativeParent=v)}}}e.notifyListeners("didUpdate",{layout:a,snapshot:n,delta:p,layoutDelta:f,hasLayoutChanged:y,hasRelativeLayoutChanged:g})}else if(e.isLead()){const{onExitComplete:a}=e.options;a&&a()}e.options.transition=void 0}function $j(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function qj(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Zj(e){e.clearSnapshot()}function x1(e){e.clearMeasurements()}function w1(e){e.isLayoutDirty=!1}function Kj(e){const{visualElement:n}=e.options;n&&n.getProps().onBeforeLayoutMeasure&&n.notify("BeforeLayoutMeasure"),e.resetTransform()}function S1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Yj(e){e.resolveTargetDelta()}function Fj(e){e.calcProjection()}function Gj(e){e.resetSkewAndRotation()}function Xj(e){e.removeLeadSnapshot()}function E1(e,n,a){e.translate=kt(n.translate,0,a),e.scale=kt(n.scale,1,a),e.origin=n.origin,e.originPoint=n.originPoint}function _1(e,n,a,i){e.min=kt(n.min,a.min,i),e.max=kt(n.max,a.max,i)}function Qj(e,n,a,i){_1(e.x,n.x,a.x,i),_1(e.y,n.y,a.y,i)}function Wj(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Jj={duration:.45,ease:[.4,0,.1,1]},T1=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),A1=T1("applewebkit/")&&!T1("chrome/")?Math.round:Cr;function R1(e){e.min=A1(e.min),e.max=A1(e.max)}function eM(e){R1(e.x),R1(e.y)}function MS(e,n,a){return e==="position"||e==="preserve-aspect"&&!oj(v1(n),v1(a),.2)}function tM(e){return e!==e.root&&e.scroll?.wasRoot}const nM=jS({attachResizeListener:(e,n)=>Uu(e,"resize",n),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ip={current:void 0},kS=jS({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ip.current){const e=new nM({});e.mount(window),e.setOptions({layoutScroll:!0}),Ip.current=e}return Ip.current},resetTransform:(e,n)=>{e.style.transform=n!==void 0?n:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),rM={pan:{Feature:wj},drag:{Feature:xj,ProjectionNode:kS,MeasureLayout:TS}};function C1(e,n,a){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",a==="Start");const l="onHover"+a,u=i[l];u&&Ot.postRender(()=>u(n,ec(n)))}class aM extends Hi{mount(){const{current:n}=this.node;n&&(this.unmount=_O(n,(a,i)=>(C1(this.node,i,"Start"),l=>C1(this.node,l,"End"))))}unmount(){}}class iM extends Hi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let n=!1;try{n=this.node.current.matches(":focus-visible")}catch{n=!0}!n||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Qu(Uu(this.node.current,"focus",()=>this.onFocus()),Uu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function O1(e,n,a){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",a==="Start");const l="onTap"+(a==="End"?"":a),u=i[l];u&&Ot.postRender(()=>u(n,ec(n)))}class oM extends Hi{mount(){const{current:n}=this.node;n&&(this.unmount=CO(n,(a,i)=>(O1(this.node,i,"Start"),(l,{success:u})=>O1(this.node,l,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Tm=new WeakMap,Hp=new WeakMap,sM=e=>{const n=Tm.get(e.target);n&&n(e)},lM=e=>{e.forEach(sM)};function uM({root:e,...n}){const a=e||document;Hp.has(a)||Hp.set(a,{});const i=Hp.get(a),l=JSON.stringify(n);return i[l]||(i[l]=new IntersectionObserver(lM,{root:e,...n})),i[l]}function cM(e,n,a){const i=uM(n);return Tm.set(e,a),i.observe(e),()=>{Tm.delete(e),i.unobserve(e)}}const fM={some:0,all:1};class dM extends Hi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:n={}}=this.node.getProps(),{root:a,margin:i,amount:l="some",once:u}=n,f={root:a?a.current:void 0,rootMargin:i,threshold:typeof l=="number"?l:fM[l]},p=y=>{const{isIntersecting:g}=y;if(this.isInView===g||(this.isInView=g,u&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:v,onViewportLeave:w}=this.node.getProps(),_=g?v:w;_&&_(y)};return cM(this.node.current,f,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:n,prevProps:a}=this.node;["amount","margin","root"].some(hM(n,a))&&this.startObserver()}unmount(){}}function hM({viewport:e={}},{viewport:n={}}={}){return a=>e[a]!==n[a]}const pM={inView:{Feature:dM},tap:{Feature:oM},focus:{Feature:iM},hover:{Feature:aM}},mM={layout:{ProjectionNode:kS,MeasureLayout:TS}},yM={...ej,...pM,...rM,...mM},Qe=yD(yM,OD);function NS(e){const n=$o(()=>Bo(e)),{isStatic:a}=D.useContext(hd);if(a){const[,i]=D.useState(e);D.useEffect(()=>n.on("change",i),[])}return n}function zS(e,n){const a=NS(n()),i=()=>a.set(n());return i(),Jm(()=>{const l=()=>Ot.preRender(i,!1,!0),u=e.map(f=>f.on("change",l));return()=>{u.forEach(f=>f()),ei(i)}}),a}function gM(e){Au.current=[],e();const n=zS(Au.current,e);return Au.current=void 0,n}function vM(e,n,a,i){if(typeof e=="function")return gM(e);const l=typeof n=="function"?n:DO(n,a,i);return Array.isArray(e)?D1(e,l):D1([e],([u])=>l(u))}function D1(e,n){const a=$o(()=>[]);return zS(e,()=>{a.length=0;const i=e.length;for(let l=0;l<i;l++)a[l]=e[l].get();return n(a)})}const PS=D.createContext(null);function bM(e,n,a,i){if(!i)return e;const l=e.findIndex(v=>v.value===n);if(l===-1)return e;const u=i>0?1:-1,f=e[l+u];if(!f)return e;const p=e[l],y=f.layout,g=kt(y.min,y.max,.5);return u===1&&p.layout.max+a>g||u===-1&&p.layout.min+a<g?PR(e,l,l+u):e}function xM({children:e,as:n="ul",axis:a="y",onReorder:i,values:l,...u},f){const p=$o(()=>Qe[n]),y=[],g=D.useRef(!1),v={axis:a,registerItem:(w,_)=>{const O=y.findIndex(A=>w===A.value);O!==-1?y[O].layout=_[a]:y.push({value:w,layout:_[a]}),y.sort(EM)},updateOrder:(w,_,O)=>{if(g.current)return;const A=bM(y,w,_,O);y!==A&&(g.current=!0,i(A.map(SM).filter(j=>l.indexOf(j)!==-1)))}};return D.useEffect(()=>{g.current=!1}),R.jsx(p,{...u,ref:f,ignoreStrict:!0,children:R.jsx(PS.Provider,{value:v,children:e})})}const wM=D.forwardRef(xM);function SM(e){return e.value}function EM(e,n){return e.layout.min-n.layout.min}function j1(e,n=0){return jn(e)?e:NS(n)}function _M({children:e,style:n={},value:a,as:i="li",onDrag:l,layout:u=!0,...f},p){const y=$o(()=>Qe[i]),g=D.useContext(PS),v={x:j1(n.x),y:j1(n.y)},w=vM([v.x,v.y],([j,N])=>j||N?1:"unset"),{axis:_,registerItem:O,updateOrder:A}=g;return R.jsx(y,{drag:_,...f,dragSnapToOrigin:!0,style:{...n,x:v.x,y:v.y,zIndex:w},layout:u,onDrag:(j,N)=>{const{velocity:P}=N;P[_]&&A(a,v[_].get(),P[_]),l&&l(j,N)},onLayoutMeasure:j=>O(a,j),ref:p,ignoreStrict:!0,children:e})}const TM=D.forwardRef(_M),AM="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Uo=(e=21)=>{let n="",a=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=AM[a[e]&63];return n};var Hf={exports:{}},RM=Hf.exports,M1;function CM(){return M1||(M1=1,(function(e,n){(function(a,i){e.exports=i()})(RM,function(){var a=function(c,h){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,x){b.__proto__=x}||function(b,x){for(var S in x)Object.prototype.hasOwnProperty.call(x,S)&&(b[S]=x[S])})(c,h)},i=function(){return(i=Object.assign||function(c){for(var h,b=1,x=arguments.length;b<x;b++)for(var S in h=arguments[b])Object.prototype.hasOwnProperty.call(h,S)&&(c[S]=h[S]);return c}).apply(this,arguments)};function l(c,h,b){for(var x,S=0,T=h.length;S<T;S++)!x&&S in h||((x=x||Array.prototype.slice.call(h,0,S))[S]=h[S]);return c.concat(x||Array.prototype.slice.call(h))}var u=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:bu,f=Object.keys,p=Array.isArray;function y(c,h){return typeof h!="object"||f(h).forEach(function(b){c[b]=h[b]}),c}typeof Promise>"u"||u.Promise||(u.Promise=Promise);var g=Object.getPrototypeOf,v={}.hasOwnProperty;function w(c,h){return v.call(c,h)}function _(c,h){typeof h=="function"&&(h=h(g(c))),(typeof Reflect>"u"?f:Reflect.ownKeys)(h).forEach(function(b){A(c,b,h[b])})}var O=Object.defineProperty;function A(c,h,b,x){O(c,h,y(b&&w(b,"get")&&typeof b.get=="function"?{get:b.get,set:b.set,configurable:!0}:{value:b,configurable:!0,writable:!0},x))}function j(c){return{from:function(h){return c.prototype=Object.create(h.prototype),A(c.prototype,"constructor",c),{extend:_.bind(null,c.prototype)}}}}var N=Object.getOwnPropertyDescriptor,P=[].slice;function H(c,h,b){return P.call(c,h,b)}function L(c,h){return h(c)}function ae(c){if(!c)throw new Error("Assertion Failed")}function ee(c){u.setImmediate?setImmediate(c):setTimeout(c,0)}function fe(c,h){if(typeof h=="string"&&w(c,h))return c[h];if(!h)return c;if(typeof h!="string"){for(var b=[],x=0,S=h.length;x<S;++x){var T=fe(c,h[x]);b.push(T)}return b}var M=h.indexOf(".");if(M!==-1){var z=c[h.substr(0,M)];return z==null?void 0:fe(z,h.substr(M+1))}}function ue(c,h,b){if(c&&h!==void 0&&!("isFrozen"in Object&&Object.isFrozen(c)))if(typeof h!="string"&&"length"in h){ae(typeof b!="string"&&"length"in b);for(var x=0,S=h.length;x<S;++x)ue(c,h[x],b[x])}else{var T,M,z=h.indexOf(".");z!==-1?(T=h.substr(0,z),(M=h.substr(z+1))===""?b===void 0?p(c)&&!isNaN(parseInt(T))?c.splice(T,1):delete c[T]:c[T]=b:ue(z=!(z=c[T])||!w(c,T)?c[T]={}:z,M,b)):b===void 0?p(c)&&!isNaN(parseInt(h))?c.splice(h,1):delete c[h]:c[h]=b}}function le(c){var h,b={};for(h in c)w(c,h)&&(b[h]=c[h]);return b}var Oe=[].concat;function Be(c){return Oe.apply([],c)}var un="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Be([8,16,32,64].map(function(c){return["Int","Uint","Float"].map(function(h){return h+c+"Array"})}))).filter(function(c){return u[c]}),Xe=new Set(un.map(function(c){return u[c]})),it=null;function Ht(c){return it=new WeakMap,c=(function h(b){if(!b||typeof b!="object")return b;var x=it.get(b);if(x)return x;if(p(b)){x=[],it.set(b,x);for(var S=0,T=b.length;S<T;++S)x.push(h(b[S]))}else if(Xe.has(b.constructor))x=b;else{var M,z=g(b);for(M in x=z===Object.prototype?{}:Object.create(z),it.set(b,x),b)w(b,M)&&(x[M]=h(b[M]))}return x})(c),it=null,c}var pn={}.toString;function ut(c){return pn.call(c).slice(8,-1)}var de=typeof Symbol<"u"?Symbol.iterator:"@@iterator",be=typeof de=="symbol"?function(c){var h;return c!=null&&(h=c[de])&&h.apply(c)}:function(){return null};function Me(c,h){return h=c.indexOf(h),0<=h&&c.splice(h,1),0<=h}var Ke={};function V(c){var h,b,x,S;if(arguments.length===1){if(p(c))return c.slice();if(this===Ke&&typeof c=="string")return[c];if(S=be(c)){for(b=[];!(x=S.next()).done;)b.push(x.value);return b}if(c==null)return[c];if(typeof(h=c.length)!="number")return[c];for(b=new Array(h);h--;)b[h]=c[h];return b}for(h=arguments.length,b=new Array(h);h--;)b[h]=arguments[h];return b}var k=typeof Symbol<"u"?function(c){return c[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},va=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Hn=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(va),G={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function I(c,h){this.name=c,this.message=h}function ce(c,h){return c+". Errors: "+Object.keys(h).map(function(b){return h[b].toString()}).filter(function(b,x,S){return S.indexOf(b)===x}).join(`
`)}function Te(c,h,b,x){this.failures=h,this.failedKeys=x,this.successCount=b,this.message=ce(c,h)}function _e(c,h){this.name="BulkError",this.failures=Object.keys(h).map(function(b){return h[b]}),this.failuresByPos=h,this.message=ce(c,this.failures)}j(I).from(Error).extend({toString:function(){return this.name+": "+this.message}}),j(Te).from(I),j(_e).from(I);var Le=Hn.reduce(function(c,h){return c[h]=h+"Error",c},{}),ze=I,je=Hn.reduce(function(c,h){var b=h+"Error";function x(S,T){this.name=b,S?typeof S=="string"?(this.message="".concat(S).concat(T?`
 `+T:""),this.inner=T||null):typeof S=="object"&&(this.message="".concat(S.name," ").concat(S.message),this.inner=S):(this.message=G[h]||b,this.inner=null)}return j(x).from(ze),c[h]=x,c},{});je.Syntax=SyntaxError,je.Type=TypeError,je.Range=RangeError;var mn=va.reduce(function(c,h){return c[h+"Error"]=je[h],c},{}),zt=Hn.reduce(function(c,h){return["Syntax","Type","Range"].indexOf(h)===-1&&(c[h+"Error"]=je[h]),c},{});function $e(){}function Ft(c){return c}function ft(c,h){return c==null||c===Ft?h:function(b){return h(c(b))}}function En(c,h){return function(){c.apply(this,arguments),h.apply(this,arguments)}}function nr(c,h){return c===$e?h:function(){var b=c.apply(this,arguments);b!==void 0&&(arguments[0]=b);var x=this.onsuccess,S=this.onerror;this.onsuccess=null,this.onerror=null;var T=h.apply(this,arguments);return x&&(this.onsuccess=this.onsuccess?En(x,this.onsuccess):x),S&&(this.onerror=this.onerror?En(S,this.onerror):S),T!==void 0?T:b}}function st(c,h){return c===$e?h:function(){c.apply(this,arguments);var b=this.onsuccess,x=this.onerror;this.onsuccess=this.onerror=null,h.apply(this,arguments),b&&(this.onsuccess=this.onsuccess?En(b,this.onsuccess):b),x&&(this.onerror=this.onerror?En(x,this.onerror):x)}}function $r(c,h){return c===$e?h:function(b){var x=c.apply(this,arguments);y(b,x);var S=this.onsuccess,T=this.onerror;return this.onsuccess=null,this.onerror=null,b=h.apply(this,arguments),S&&(this.onsuccess=this.onsuccess?En(S,this.onsuccess):S),T&&(this.onerror=this.onerror?En(T,this.onerror):T),x===void 0?b===void 0?void 0:b:y(x,b)}}function qr(c,h){return c===$e?h:function(){return h.apply(this,arguments)!==!1&&c.apply(this,arguments)}}function Yn(c,h){return c===$e?h:function(){var b=c.apply(this,arguments);if(b&&typeof b.then=="function"){for(var x=this,S=arguments.length,T=new Array(S);S--;)T[S]=arguments[S];return b.then(function(){return h.apply(x,T)})}return h.apply(this,arguments)}}zt.ModifyError=Te,zt.DexieError=I,zt.BulkError=_e;var ln=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Ln(c){ln=c}var Dr={},Yo=100,un=typeof Promise>"u"?[]:(function(){var c=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[c,g(c),c];var h=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[h,g(h),c]})(),va=un[0],Hn=un[1],un=un[2],Hn=Hn&&Hn.then,St=va&&va.constructor,Mn=!!un,Pt=function(c,h){kr.push([c,h]),Zr&&(queueMicrotask(al),Zr=!1)},ba=!0,Zr=!0,jr=[],Mr=[],Kr=Ft,yn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:$e,pgp:!1,env:{},finalize:$e},ke=yn,kr=[],xa=0,Zi=[];function De(c){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var h=this._PSD=ke;if(typeof c!="function"){if(c!==Dr)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&tl(this,this._value))}this._state=null,this._value=null,++h.ref,(function b(x,S){try{S(function(T){if(x._state===null){if(T===x)throw new TypeError("A promise cannot be resolved with itself.");var M=x._lib&&wa();T&&typeof T.then=="function"?b(x,function(z,$){T instanceof De?T._then(z,$):T.then(z,$)}):(x._state=!0,x._value=T,nl(x)),M&&ri()}},tl.bind(null,x))}catch(T){tl(x,T)}})(this,c)}var Ki={get:function(){var c=ke,h=Yi;function b(x,S){var T=this,M=!c.global&&(c!==ke||h!==Yi),z=M&&!Bn(),$=new De(function(q,X){Fo(T,new ni(Gr(x,c,M,z),Gr(S,c,M,z),q,X,c))});return this._consoleTask&&($._consoleTask=this._consoleTask),$}return b.prototype=Dr,b},set:function(c){A(this,"then",c&&c.prototype===Dr?Ki:{get:function(){return c},set:Ki.set})}};function ni(c,h,b,x,S){this.onFulfilled=typeof c=="function"?c:null,this.onRejected=typeof h=="function"?h:null,this.resolve=b,this.reject=x,this.psd=S}function tl(c,h){var b,x;Mr.push(h),c._state===null&&(b=c._lib&&wa(),h=Kr(h),c._state=!1,c._value=h,x=c,jr.some(function(S){return S._value===x._value})||jr.push(x),nl(c),b&&ri())}function nl(c){var h=c._listeners;c._listeners=[];for(var b=0,x=h.length;b<x;++b)Fo(c,h[b]);var S=c._PSD;--S.ref||S.finalize(),xa===0&&(++xa,Pt(function(){--xa==0&&mr()},[]))}function Fo(c,h){if(c._state!==null){var b=c._state?h.onFulfilled:h.onRejected;if(b===null)return(c._state?h.resolve:h.reject)(c._value);++h.psd.ref,++xa,Pt(rl,[b,c,h])}else c._listeners.push(h)}function rl(c,h,b){try{var x,S=h._value;!h._state&&Mr.length&&(Mr=[]),x=ln&&h._consoleTask?h._consoleTask.run(function(){return c(S)}):c(S),h._state||Mr.indexOf(S)!==-1||(function(T){for(var M=jr.length;M;)if(jr[--M]._value===T._value)return jr.splice(M,1)})(h),b.resolve(x)}catch(T){b.reject(T)}finally{--xa==0&&mr(),--b.psd.ref||b.psd.finalize()}}function al(){Fr(yn,function(){wa()&&ri()})}function wa(){var c=ba;return Zr=ba=!1,c}function ri(){var c,h,b;do for(;0<kr.length;)for(c=kr,kr=[],b=c.length,h=0;h<b;++h){var x=c[h];x[0].apply(null,x[1])}while(0<kr.length);Zr=ba=!0}function mr(){var c=jr;jr=[],c.forEach(function(x){x._PSD.onunhandled.call(null,x._value,x)});for(var h=Zi.slice(0),b=h.length;b;)h[--b]()}function Gt(c){return new De(Dr,!1,c)}function Je(c,h){var b=ke;return function(){var x=wa(),S=ke;try{return Et(b,!0),c.apply(this,arguments)}catch(T){h&&h(T)}finally{Et(S,!1),x&&ri()}}}_(De.prototype,{then:Ki,_then:function(c,h){Fo(this,new ni(null,null,c,h,ke))},catch:function(c){if(arguments.length===1)return this.then(null,c);var h=c,b=arguments[1];return typeof h=="function"?this.then(null,function(x){return(x instanceof h?b:Gt)(x)}):this.then(null,function(x){return(x&&x.name===h?b:Gt)(x)})},finally:function(c){return this.then(function(h){return De.resolve(c()).then(function(){return h})},function(h){return De.resolve(c()).then(function(){return Gt(h)})})},timeout:function(c,h){var b=this;return c<1/0?new De(function(x,S){var T=setTimeout(function(){return S(new je.Timeout(h))},c);b.then(x,S).finally(clearTimeout.bind(null,T))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&A(De.prototype,Symbol.toStringTag,"Dexie.Promise"),yn.env=ol(),_(De,{all:function(){var c=V.apply(null,arguments).map(Yr);return new De(function(h,b){c.length===0&&h([]);var x=c.length;c.forEach(function(S,T){return De.resolve(S).then(function(M){c[T]=M,--x||h(c)},b)})})},resolve:function(c){return c instanceof De?c:c&&typeof c.then=="function"?new De(function(h,b){c.then(h,b)}):new De(Dr,!0,c)},reject:Gt,race:function(){var c=V.apply(null,arguments).map(Yr);return new De(function(h,b){c.map(function(x){return De.resolve(x).then(h,b)})})},PSD:{get:function(){return ke},set:function(c){return ke=c}},totalEchoes:{get:function(){return Yi}},newPSD:yr,usePSD:Fr,scheduler:{get:function(){return Pt},set:function(c){Pt=c}},rejectionMapper:{get:function(){return Kr},set:function(c){Kr=c}},follow:function(c,h){return new De(function(b,x){return yr(function(S,T){var M=ke;M.unhandleds=[],M.onunhandled=T,M.finalize=En(function(){var z,$=this;z=function(){$.unhandleds.length===0?S():T($.unhandleds[0])},Zi.push(function q(){z(),Zi.splice(Zi.indexOf(q),1)}),++xa,Pt(function(){--xa==0&&mr()},[])},M.finalize),c()},h,b,x)})}}),St&&(St.allSettled&&A(De,"allSettled",function(){var c=V.apply(null,arguments).map(Yr);return new De(function(h){c.length===0&&h([]);var b=c.length,x=new Array(b);c.forEach(function(S,T){return De.resolve(S).then(function(M){return x[T]={status:"fulfilled",value:M}},function(M){return x[T]={status:"rejected",reason:M}}).then(function(){return--b||h(x)})})})}),St.any&&typeof AggregateError<"u"&&A(De,"any",function(){var c=V.apply(null,arguments).map(Yr);return new De(function(h,b){c.length===0&&b(new AggregateError([]));var x=c.length,S=new Array(x);c.forEach(function(T,M){return De.resolve(T).then(function(z){return h(z)},function(z){S[M]=z,--x||b(new AggregateError(S))})})})}),St.withResolvers&&(De.withResolvers=St.withResolvers));var Ct={awaits:0,echoes:0,id:0},il=0,Go=[],Xo=0,Yi=0,Fi=0;function yr(c,h,b,x){var S=ke,T=Object.create(S);return T.parent=S,T.ref=0,T.global=!1,T.id=++Fi,yn.env,T.env=Mn?{Promise:De,PromiseProp:{value:De,configurable:!0,writable:!0},all:De.all,race:De.race,allSettled:De.allSettled,any:De.any,resolve:De.resolve,reject:De.reject}:{},h&&y(T,h),++S.ref,T.finalize=function(){--this.parent.ref||this.parent.finalize()},x=Fr(T,c,b,x),T.ref===0&&T.finalize(),x}function rr(){return Ct.id||(Ct.id=++il),++Ct.awaits,Ct.echoes+=Yo,Ct.id}function Bn(){return!!Ct.awaits&&(--Ct.awaits==0&&(Ct.id=0),Ct.echoes=Ct.awaits*Yo,!0)}function Yr(c){return Ct.echoes&&c&&c.constructor===St?(rr(),c.then(function(h){return Bn(),h},function(h){return Bn(),Lt(h)})):c}function ai(){var c=Go[Go.length-1];Go.pop(),Et(c,!1)}function Et(c,h){var b,x=ke;(h?!Ct.echoes||Xo++&&c===ke:!Xo||--Xo&&c===ke)||queueMicrotask(h?(function(S){++Yi,Ct.echoes&&--Ct.echoes!=0||(Ct.echoes=Ct.awaits=Ct.id=0),Go.push(ke),Et(S,!0)}).bind(null,c):ai),c!==ke&&(ke=c,x===yn&&(yn.env=ol()),Mn&&(b=yn.env.Promise,h=c.env,(x.global||c.global)&&(Object.defineProperty(u,"Promise",h.PromiseProp),b.all=h.all,b.race=h.race,b.resolve=h.resolve,b.reject=h.reject,h.allSettled&&(b.allSettled=h.allSettled),h.any&&(b.any=h.any))))}function ol(){var c=u.Promise;return Mn?{Promise:c,PromiseProp:Object.getOwnPropertyDescriptor(u,"Promise"),all:c.all,race:c.race,allSettled:c.allSettled,any:c.any,resolve:c.resolve,reject:c.reject}:{}}function Fr(c,h,b,x,S){var T=ke;try{return Et(c,!0),h(b,x,S)}finally{Et(T,!1)}}function Gr(c,h,b,x){return typeof c!="function"?c:function(){var S=ke;b&&rr(),Et(h,!0);try{return c.apply(this,arguments)}finally{Et(S,!1),x&&queueMicrotask(Bn)}}}function Xr(c){Promise===St&&Ct.echoes===0?Xo===0?c():enqueueNativeMicroTask(c):setTimeout(c,0)}(""+Hn).indexOf("[native code]")===-1&&(rr=Bn=$e);var Lt=De.reject,Qr="￿",gr="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",ac="String expected.",Nr=[],Sa="__dbnames",ar="readonly",Gi="readwrite";function Wr(c,h){return c?h?function(){return c.apply(this,arguments)&&h.apply(this,arguments)}:c:h}var Ea={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ii(c){return typeof c!="string"||/\./.test(c)?function(h){return h}:function(h){return h[c]===void 0&&c in h&&delete(h=Ht(h))[c],h}}function Qo(){throw je.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function nt(c,h){try{var b=sl(c),x=sl(h);if(b!==x)return b==="Array"?1:x==="Array"?-1:b==="binary"?1:x==="binary"?-1:b==="string"?1:x==="string"?-1:b==="Date"?1:x!=="Date"?NaN:-1;switch(b){case"number":case"Date":case"string":return h<c?1:c<h?-1:0;case"binary":return(function(S,T){for(var M=S.length,z=T.length,$=M<z?M:z,q=0;q<$;++q)if(S[q]!==T[q])return S[q]<T[q]?-1:1;return M===z?0:M<z?-1:1})(Un(c),Un(h));case"Array":return(function(S,T){for(var M=S.length,z=T.length,$=M<z?M:z,q=0;q<$;++q){var X=nt(S[q],T[q]);if(X!==0)return X}return M===z?0:M<z?-1:1})(c,h)}}catch{}return NaN}function sl(c){var h=typeof c;return h!="object"?h:ArrayBuffer.isView(c)?"binary":(c=ut(c),c==="ArrayBuffer"?"binary":c)}function Un(c){return c instanceof Uint8Array?c:ArrayBuffer.isView(c)?new Uint8Array(c.buffer,c.byteOffset,c.byteLength):new Uint8Array(c)}function Xi(c,h,b){var x=c.schema.yProps;return x?(h&&0<b.numFailures&&(h=h.filter(function(S,T){return!b.failures[T]})),Promise.all(x.map(function(S){return S=S.updatesTable,h?c.db.table(S).where("k").anyOf(h).delete():c.db.table(S).clear()})).then(function(){return b})):b}var Qi=(Wi.prototype.execute=function(c){var h=this["@@propmod"];if(h.add!==void 0){var b=h.add;if(p(b))return l(l([],p(c)?c:[],!0),b).sort();if(typeof b=="number")return(Number(c)||0)+b;if(typeof b=="bigint")try{return BigInt(c)+b}catch{return BigInt(0)+b}throw new TypeError("Invalid term ".concat(b))}if(h.remove!==void 0){var x=h.remove;if(p(x))return p(c)?c.filter(function(S){return!x.includes(S)}).sort():[];if(typeof x=="number")return Number(c)-x;if(typeof x=="bigint")try{return BigInt(c)-x}catch{return BigInt(0)-x}throw new TypeError("Invalid subtrahend ".concat(x))}return b=(b=h.replacePrefix)===null||b===void 0?void 0:b[0],b&&typeof c=="string"&&c.startsWith(b)?h.replacePrefix[1]+c.substring(b.length):c},Wi);function Wi(c){this["@@propmod"]=c}function ll(c,h){for(var b=f(h),x=b.length,S=!1,T=0;T<x;++T){var M=b[T],z=h[M],$=fe(c,M);z instanceof Qi?(ue(c,M,z.execute($)),S=!0):$!==z&&(ue(c,M,z),S=!0)}return S}var Ji=(gt.prototype._trans=function(c,h,b){var x=this._tx||ke.trans,S=this.name,T=ln&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(c==="readonly"?"read":"write"," ").concat(this.name));function M(q,X,U){if(!U.schema[S])throw new je.NotFound("Table "+S+" not part of transaction");return h(U.idbtrans,U)}var z=wa();try{var $=x&&x.db._novip===this.db._novip?x===ke.trans?x._promise(c,M,b):yr(function(){return x._promise(c,M,b)},{trans:x,transless:ke.transless||ke}):(function q(X,U,J,Z){if(X.idbdb&&(X._state.openComplete||ke.letThrough||X._vip)){var Y=X._createTransaction(U,J,X._dbSchema);try{Y.create(),X._state.PR1398_maxLoop=3}catch(F){return F.name===Le.InvalidState&&X.isOpen()&&0<--X._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),X.close({disableAutoOpen:!1}),X.open().then(function(){return q(X,U,J,Z)})):Lt(F)}return Y._promise(U,function(F,Q){return yr(function(){return ke.trans=Y,Z(F,Q,Y)})}).then(function(F){if(U==="readwrite")try{Y.idbtrans.commit()}catch{}return U==="readonly"?F:Y._completion.then(function(){return F})})}if(X._state.openComplete)return Lt(new je.DatabaseClosed(X._state.dbOpenError));if(!X._state.isBeingOpened){if(!X._state.autoOpen)return Lt(new je.DatabaseClosed);X.open().catch($e)}return X._state.dbReadyPromise.then(function(){return q(X,U,J,Z)})})(this.db,c,[this.name],M);return T&&($._consoleTask=T,$=$.catch(function(q){return console.trace(q),Lt(q)})),$}finally{z&&ri()}},gt.prototype.get=function(c,h){var b=this;return c&&c.constructor===Object?this.where(c).first(h):c==null?Lt(new je.Type("Invalid argument to Table.get()")):this._trans("readonly",function(x){return b.core.get({trans:x,key:c}).then(function(S){return b.hook.reading.fire(S)})}).then(h)},gt.prototype.where=function(c){if(typeof c=="string")return new this.db.WhereClause(this,c);if(p(c))return new this.db.WhereClause(this,"[".concat(c.join("+"),"]"));var h=f(c);if(h.length===1)return this.where(h[0]).equals(c[h[0]]);var b=this.schema.indexes.concat(this.schema.primKey).filter(function(z){if(z.compound&&h.every(function(q){return 0<=z.keyPath.indexOf(q)})){for(var $=0;$<h.length;++$)if(h.indexOf(z.keyPath[$])===-1)return!1;return!0}return!1}).sort(function(z,$){return z.keyPath.length-$.keyPath.length})[0];if(b&&this.db._maxKey!==Qr){var T=b.keyPath.slice(0,h.length);return this.where(T).equals(T.map(function($){return c[$]}))}!b&&ln&&console.warn("The query ".concat(JSON.stringify(c)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(h.join("+"),"]"));var x=this.schema.idxByName;function S(z,$){return nt(z,$)===0}var M=h.reduce(function(U,$){var q=U[0],X=U[1],U=x[$],J=c[$];return[q||U,q||!U?Wr(X,U&&U.multi?function(Z){return Z=fe(Z,$),p(Z)&&Z.some(function(Y){return S(J,Y)})}:function(Z){return S(J,fe(Z,$))}):X]},[null,null]),T=M[0],M=M[1];return T?this.where(T.name).equals(c[T.keyPath]).filter(M):b?this.filter(M):this.where(h).equals("")},gt.prototype.filter=function(c){return this.toCollection().and(c)},gt.prototype.count=function(c){return this.toCollection().count(c)},gt.prototype.offset=function(c){return this.toCollection().offset(c)},gt.prototype.limit=function(c){return this.toCollection().limit(c)},gt.prototype.each=function(c){return this.toCollection().each(c)},gt.prototype.toArray=function(c){return this.toCollection().toArray(c)},gt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},gt.prototype.orderBy=function(c){return new this.db.Collection(new this.db.WhereClause(this,p(c)?"[".concat(c.join("+"),"]"):c))},gt.prototype.reverse=function(){return this.toCollection().reverse()},gt.prototype.mapToClass=function(c){var h,b=this.db,x=this.name;function S(){return h!==null&&h.apply(this,arguments)||this}(this.schema.mappedClass=c).prototype instanceof Qo&&((function($,q){if(typeof q!="function"&&q!==null)throw new TypeError("Class extends value "+String(q)+" is not a constructor or null");function X(){this.constructor=$}a($,q),$.prototype=q===null?Object.create(q):(X.prototype=q.prototype,new X)})(S,h=c),Object.defineProperty(S.prototype,"db",{get:function(){return b},enumerable:!1,configurable:!0}),S.prototype.table=function(){return x},c=S);for(var T=new Set,M=c.prototype;M;M=g(M))Object.getOwnPropertyNames(M).forEach(function($){return T.add($)});function z($){if(!$)return $;var q,X=Object.create(c.prototype);for(q in $)if(!T.has(q))try{X[q]=$[q]}catch{}return X}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=z,this.hook("reading",z),c},gt.prototype.defineClass=function(){return this.mapToClass(function(c){y(this,c)})},gt.prototype.add=function(c,h){var b=this,x=this.schema.primKey,S=x.auto,T=x.keyPath,M=c;return T&&S&&(M=ii(T)(c)),this._trans("readwrite",function(z){return b.core.mutate({trans:z,type:"add",keys:h!=null?[h]:null,values:[M]})}).then(function(z){return z.numFailures?De.reject(z.failures[0]):z.lastResult}).then(function(z){if(T)try{ue(c,T,z)}catch{}return z})},gt.prototype.upsert=function(c,h){var b=this,x=this.schema.primKey.keyPath;return this._trans("readwrite",function(S){return b.core.get({trans:S,key:c}).then(function(T){var M=T??{};return ll(M,h),x&&ue(M,x,c),b.core.mutate({trans:S,type:"put",values:[M],keys:[c],upsert:!0,updates:{keys:[c],changeSpecs:[h]}}).then(function(z){return z.numFailures?De.reject(z.failures[0]):!!T})})})},gt.prototype.update=function(c,h){return typeof c!="object"||p(c)?this.where(":id").equals(c).modify(h):(c=fe(c,this.schema.primKey.keyPath),c===void 0?Lt(new je.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(c).modify(h))},gt.prototype.put=function(c,h){var b=this,x=this.schema.primKey,S=x.auto,T=x.keyPath,M=c;return T&&S&&(M=ii(T)(c)),this._trans("readwrite",function(z){return b.core.mutate({trans:z,type:"put",values:[M],keys:h!=null?[h]:null})}).then(function(z){return z.numFailures?De.reject(z.failures[0]):z.lastResult}).then(function(z){if(T)try{ue(c,T,z)}catch{}return z})},gt.prototype.delete=function(c){var h=this;return this._trans("readwrite",function(b){return h.core.mutate({trans:b,type:"delete",keys:[c]}).then(function(x){return Xi(h,[c],x)}).then(function(x){return x.numFailures?De.reject(x.failures[0]):void 0})})},gt.prototype.clear=function(){var c=this;return this._trans("readwrite",function(h){return c.core.mutate({trans:h,type:"deleteRange",range:Ea}).then(function(b){return Xi(c,null,b)})}).then(function(h){return h.numFailures?De.reject(h.failures[0]):void 0})},gt.prototype.bulkGet=function(c){var h=this;return this._trans("readonly",function(b){return h.core.getMany({keys:c,trans:b}).then(function(x){return x.map(function(S){return h.hook.reading.fire(S)})})})},gt.prototype.bulkAdd=function(c,h,b){var x=this,S=Array.isArray(h)?h:void 0,T=(b=b||(S?void 0:h))?b.allKeys:void 0;return this._trans("readwrite",function(M){var q=x.schema.primKey,z=q.auto,q=q.keyPath;if(q&&S)throw new je.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(S&&S.length!==c.length)throw new je.InvalidArgument("Arguments objects and keys must have the same length");var $=c.length,q=q&&z?c.map(ii(q)):c;return x.core.mutate({trans:M,type:"add",keys:S,values:q,wantResults:T}).then(function(Y){var U=Y.numFailures,J=Y.results,Z=Y.lastResult,Y=Y.failures;if(U===0)return T?J:Z;throw new _e("".concat(x.name,".bulkAdd(): ").concat(U," of ").concat($," operations failed"),Y)})})},gt.prototype.bulkPut=function(c,h,b){var x=this,S=Array.isArray(h)?h:void 0,T=(b=b||(S?void 0:h))?b.allKeys:void 0;return this._trans("readwrite",function(M){var q=x.schema.primKey,z=q.auto,q=q.keyPath;if(q&&S)throw new je.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(S&&S.length!==c.length)throw new je.InvalidArgument("Arguments objects and keys must have the same length");var $=c.length,q=q&&z?c.map(ii(q)):c;return x.core.mutate({trans:M,type:"put",keys:S,values:q,wantResults:T}).then(function(Y){var U=Y.numFailures,J=Y.results,Z=Y.lastResult,Y=Y.failures;if(U===0)return T?J:Z;throw new _e("".concat(x.name,".bulkPut(): ").concat(U," of ").concat($," operations failed"),Y)})})},gt.prototype.bulkUpdate=function(c){var h=this,b=this.core,x=c.map(function(M){return M.key}),S=c.map(function(M){return M.changes}),T=[];return this._trans("readwrite",function(M){return b.getMany({trans:M,keys:x,cache:"clone"}).then(function(z){var $=[],q=[];c.forEach(function(U,J){var Z=U.key,Y=U.changes,F=z[J];if(F){for(var Q=0,te=Object.keys(Y);Q<te.length;Q++){var ie=te[Q],he=Y[ie];if(ie===h.schema.primKey.keyPath){if(nt(he,Z)!==0)throw new je.Constraint("Cannot update primary key in bulkUpdate()")}else ue(F,ie,he)}T.push(J),$.push(Z),q.push(F)}});var X=$.length;return b.mutate({trans:M,type:"put",keys:$,values:q,updates:{keys:x,changeSpecs:S}}).then(function(U){var J=U.numFailures,Z=U.failures;if(J===0)return X;for(var Y=0,F=Object.keys(Z);Y<F.length;Y++){var Q,te=F[Y],ie=T[Number(te)];ie!=null&&(Q=Z[te],delete Z[te],Z[ie]=Q)}throw new _e("".concat(h.name,".bulkUpdate(): ").concat(J," of ").concat(X," operations failed"),Z)})})})},gt.prototype.bulkDelete=function(c){var h=this,b=c.length;return this._trans("readwrite",function(x){return h.core.mutate({trans:x,type:"delete",keys:c}).then(function(S){return Xi(h,c,S)})}).then(function(M){var S=M.numFailures,T=M.lastResult,M=M.failures;if(S===0)return T;throw new _e("".concat(h.name,".bulkDelete(): ").concat(S," of ").concat(b," operations failed"),M)})},gt);function gt(){}function gn(c){function h(M,z){if(z){for(var $=arguments.length,q=new Array($-1);--$;)q[$-1]=arguments[$];return b[M].subscribe.apply(null,q),c}if(typeof M=="string")return b[M]}var b={};h.addEventType=T;for(var x=1,S=arguments.length;x<S;++x)T(arguments[x]);return h;function T(M,z,$){if(typeof M!="object"){var q;z=z||qr;var X={subscribers:[],fire:$=$||$e,subscribe:function(U){X.subscribers.indexOf(U)===-1&&(X.subscribers.push(U),X.fire=z(X.fire,U))},unsubscribe:function(U){X.subscribers=X.subscribers.filter(function(J){return J!==U}),X.fire=X.subscribers.reduce(z,$)}};return b[M]=h[M]=X}f(q=M).forEach(function(U){var J=q[U];if(p(J))T(U,q[U][0],q[U][1]);else{if(J!=="asap")throw new je.InvalidArgument("Invalid event config");var Z=T(U,Ft,function(){for(var Y=arguments.length,F=new Array(Y);Y--;)F[Y]=arguments[Y];Z.subscribers.forEach(function(Q){ee(function(){Q.apply(null,F)})})})}})}}function _a(c,h){return j(h).from({prototype:c}),h}function Ta(c,h){return!(c.filter||c.algorithm||c.or)&&(h?c.justLimit:!c.replayFilter)}function eo(c,h){c.filter=Wr(c.filter,h)}function Jr(c,h,b){var x=c.replayFilter;c.replayFilter=x?function(){return Wr(x(),h())}:h,c.justLimit=b&&!x}function to(c,h){if(c.isPrimKey)return h.primaryKey;var b=h.getIndexByKeyPath(c.index);if(!b)throw new je.Schema("KeyPath "+c.index+" on object store "+h.name+" is not indexed");return b}function ul(c,h,b){var x=to(c,h.schema);return h.openCursor({trans:b,values:!c.keysOnly,reverse:c.dir==="prev",unique:!!c.unique,query:{index:x,range:c.range}})}function zr(c,h,b,x){var S=c.replayFilter?Wr(c.filter,c.replayFilter()):c.filter;if(c.or){var T={},M=function(z,$,q){var X,U;S&&!S($,q,function(J){return $.stop(J)},function(J){return $.fail(J)})||((U=""+(X=$.primaryKey))=="[object ArrayBuffer]"&&(U=""+new Uint8Array(X)),w(T,U)||(T[U]=!0,h(z,$,q)))};return Promise.all([c.or._iterate(M,b),ic(ul(c,x,b),c.algorithm,M,!c.keysOnly&&c.valueMapper)])}return ic(ul(c,x,b),Wr(c.algorithm,S),h,!c.keysOnly&&c.valueMapper)}function ic(c,h,b,x){var S=Je(x?function(T,M,z){return b(x(T),M,z)}:b);return c.then(function(T){if(T)return T.start(function(){var M=function(){return T.continue()};h&&!h(T,function(z){return M=z},function(z){T.stop(z),M=$e},function(z){T.fail(z),M=$e})||S(T.value,T,function(z){return M=z}),M()})})}var oc=(ot.prototype._read=function(c,h){var b=this._ctx;return b.error?b.table._trans(null,Lt.bind(null,b.error)):b.table._trans("readonly",c).then(h)},ot.prototype._write=function(c){var h=this._ctx;return h.error?h.table._trans(null,Lt.bind(null,h.error)):h.table._trans("readwrite",c,"locked")},ot.prototype._addAlgorithm=function(c){var h=this._ctx;h.algorithm=Wr(h.algorithm,c)},ot.prototype._iterate=function(c,h){return zr(this._ctx,c,h,this._ctx.table.core)},ot.prototype.clone=function(c){var h=Object.create(this.constructor.prototype),b=Object.create(this._ctx);return c&&y(b,c),h._ctx=b,h},ot.prototype.raw=function(){return this._ctx.valueMapper=null,this},ot.prototype.each=function(c){var h=this._ctx;return this._read(function(b){return zr(h,c,b,h.table.core)})},ot.prototype.count=function(c){var h=this;return this._read(function(b){var x=h._ctx,S=x.table.core;if(Ta(x,!0))return S.count({trans:b,query:{index:to(x,S.schema),range:x.range}}).then(function(M){return Math.min(M,x.limit)});var T=0;return zr(x,function(){return++T,!1},b,S).then(function(){return T})}).then(c)},ot.prototype.sortBy=function(c,h){var b=c.split(".").reverse(),x=b[0],S=b.length-1;function T($,q){return q?T($[b[q]],q-1):$[x]}var M=this._ctx.dir==="next"?1:-1;function z($,q){return nt(T($,S),T(q,S))*M}return this.toArray(function($){return $.sort(z)}).then(h)},ot.prototype.toArray=function(c){var h=this;return this._read(function(b){var x=h._ctx;if(x.dir==="next"&&Ta(x,!0)&&0<x.limit){var S=x.valueMapper,T=to(x,x.table.core.schema);return x.table.core.query({trans:b,limit:x.limit,values:!0,query:{index:T,range:x.range}}).then(function(z){return z=z.result,S?z.map(S):z})}var M=[];return zr(x,function(z){return M.push(z)},b,x.table.core).then(function(){return M})},c)},ot.prototype.offset=function(c){var h=this._ctx;return c<=0||(h.offset+=c,Ta(h)?Jr(h,function(){var b=c;return function(x,S){return b===0||(b===1?--b:S(function(){x.advance(b),b=0}),!1)}}):Jr(h,function(){var b=c;return function(){return--b<0}})),this},ot.prototype.limit=function(c){return this._ctx.limit=Math.min(this._ctx.limit,c),Jr(this._ctx,function(){var h=c;return function(b,x,S){return--h<=0&&x(S),0<=h}},!0),this},ot.prototype.until=function(c,h){return eo(this._ctx,function(b,x,S){return!c(b.value)||(x(S),h)}),this},ot.prototype.first=function(c){return this.limit(1).toArray(function(h){return h[0]}).then(c)},ot.prototype.last=function(c){return this.reverse().first(c)},ot.prototype.filter=function(c){var h;return eo(this._ctx,function(b){return c(b.value)}),(h=this._ctx).isMatch=Wr(h.isMatch,c),this},ot.prototype.and=function(c){return this.filter(c)},ot.prototype.or=function(c){return new this.db.WhereClause(this._ctx.table,c,this)},ot.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},ot.prototype.desc=function(){return this.reverse()},ot.prototype.eachKey=function(c){var h=this._ctx;return h.keysOnly=!h.isMatch,this.each(function(b,x){c(x.key,x)})},ot.prototype.eachUniqueKey=function(c){return this._ctx.unique="unique",this.eachKey(c)},ot.prototype.eachPrimaryKey=function(c){var h=this._ctx;return h.keysOnly=!h.isMatch,this.each(function(b,x){c(x.primaryKey,x)})},ot.prototype.keys=function(c){var h=this._ctx;h.keysOnly=!h.isMatch;var b=[];return this.each(function(x,S){b.push(S.key)}).then(function(){return b}).then(c)},ot.prototype.primaryKeys=function(c){var h=this._ctx;if(h.dir==="next"&&Ta(h,!0)&&0<h.limit)return this._read(function(x){var S=to(h,h.table.core.schema);return h.table.core.query({trans:x,values:!1,limit:h.limit,query:{index:S,range:h.range}})}).then(function(x){return x.result}).then(c);h.keysOnly=!h.isMatch;var b=[];return this.each(function(x,S){b.push(S.primaryKey)}).then(function(){return b}).then(c)},ot.prototype.uniqueKeys=function(c){return this._ctx.unique="unique",this.keys(c)},ot.prototype.firstKey=function(c){return this.limit(1).keys(function(h){return h[0]}).then(c)},ot.prototype.lastKey=function(c){return this.reverse().firstKey(c)},ot.prototype.distinct=function(){var c=this._ctx,c=c.index&&c.table.schema.idxByName[c.index];if(!c||!c.multi)return this;var h={};return eo(this._ctx,function(S){var x=S.primaryKey.toString(),S=w(h,x);return h[x]=!0,!S}),this},ot.prototype.modify=function(c){var h=this,b=this._ctx;return this._write(function(x){var S=typeof c=="function"?c:function(F){return ll(F,c)},T=b.table.core,q=T.schema.primaryKey,M=q.outbound,z=q.extractKey,$=200,q=h.db._options.modifyChunkSize;q&&($=typeof q=="object"?q[T.name]||q["*"]||200:q);function X(F,ie){var te=ie.failures,ie=ie.numFailures;J+=F-ie;for(var he=0,ye=f(te);he<ye.length;he++){var Ee=ye[he];U.push(te[Ee])}}var U=[],J=0,Z=[],Y=c===Wo;return h.clone().primaryKeys().then(function(F){function Q(ie){var he=Math.min($,F.length-ie),ye=F.slice(ie,ie+he);return(Y?Promise.resolve([]):T.getMany({trans:x,keys:ye,cache:"immutable"})).then(function(Ee){var Ae=[],we=[],xe=M?[]:null,Re=Y?ye:[];if(!Y)for(var Se=0;Se<he;++Se){var Ce=Ee[Se],He={value:Ht(Ce),primKey:F[ie+Se]};S.call(He,He.value,He)!==!1&&(He.value==null?Re.push(F[ie+Se]):M||nt(z(Ce),z(He.value))===0?(we.push(He.value),M&&xe.push(F[ie+Se])):(Re.push(F[ie+Se]),Ae.push(He.value)))}return Promise.resolve(0<Ae.length&&T.mutate({trans:x,type:"add",values:Ae}).then(function(Fe){for(var Ge in Fe.failures)Re.splice(parseInt(Ge),1);X(Ae.length,Fe)})).then(function(){return(0<we.length||te&&typeof c=="object")&&T.mutate({trans:x,type:"put",keys:xe,values:we,criteria:te,changeSpec:typeof c!="function"&&c,isAdditionalChunk:0<ie}).then(function(Fe){return X(we.length,Fe)})}).then(function(){return(0<Re.length||te&&Y)&&T.mutate({trans:x,type:"delete",keys:Re,criteria:te,isAdditionalChunk:0<ie}).then(function(Fe){return Xi(b.table,Re,Fe)}).then(function(Fe){return X(Re.length,Fe)})}).then(function(){return F.length>ie+he&&Q(ie+$)})})}var te=Ta(b)&&b.limit===1/0&&(typeof c!="function"||Y)&&{index:b.index,range:b.range};return Q(0).then(function(){if(0<U.length)throw new Te("Error modifying one or more objects",U,J,Z);return F.length})})})},ot.prototype.delete=function(){var c=this._ctx,h=c.range;return!Ta(c)||c.table.schema.yProps||!c.isPrimKey&&h.type!==3?this.modify(Wo):this._write(function(b){var x=c.table.core.schema.primaryKey,S=h;return c.table.core.count({trans:b,query:{index:x,range:S}}).then(function(T){return c.table.core.mutate({trans:b,type:"deleteRange",range:S}).then(function($){var z=$.failures,$=$.numFailures;if($)throw new Te("Could not delete some values",Object.keys(z).map(function(q){return z[q]}),T-$);return T-$})})})},ot);function ot(){}var Wo=function(c,h){return h.value=null};function Dd(c,h){return c<h?-1:c===h?0:1}function jd(c,h){return h<c?-1:c===h?0:1}function vn(c,h,b){return c=c instanceof cl?new c.Collection(c):c,c._ctx.error=new(b||TypeError)(h),c}function ea(c){return new c.Collection(c,function(){return Aa("")}).limit(0)}function oi(c,h,b,x){var S,T,M,z,$,q,X,U=b.length;if(!b.every(function(Y){return typeof Y=="string"}))return vn(c,ac);function J(Y){S=Y==="next"?function(Q){return Q.toUpperCase()}:function(Q){return Q.toLowerCase()},T=Y==="next"?function(Q){return Q.toLowerCase()}:function(Q){return Q.toUpperCase()},M=Y==="next"?Dd:jd;var F=b.map(function(Q){return{lower:T(Q),upper:S(Q)}}).sort(function(Q,te){return M(Q.lower,te.lower)});z=F.map(function(Q){return Q.upper}),$=F.map(function(Q){return Q.lower}),X=(q=Y)==="next"?"":x}J("next"),c=new c.Collection(c,function(){return Vn(z[0],$[U-1]+x)}),c._ondirectionchange=function(Y){J(Y)};var Z=0;return c._addAlgorithm(function(Y,F,Q){var te=Y.key;if(typeof te!="string")return!1;var ie=T(te);if(h(ie,$,Z))return!0;for(var he=null,ye=Z;ye<U;++ye){var Ee=(function(Ae,we,xe,Re,Se,Ce){for(var He=Math.min(Ae.length,Re.length),Fe=-1,Ge=0;Ge<He;++Ge){var bn=we[Ge];if(bn!==Re[Ge])return Se(Ae[Ge],xe[Ge])<0?Ae.substr(0,Ge)+xe[Ge]+xe.substr(Ge+1):Se(Ae[Ge],Re[Ge])<0?Ae.substr(0,Ge)+Re[Ge]+xe.substr(Ge+1):0<=Fe?Ae.substr(0,Fe)+we[Fe]+xe.substr(Fe+1):null;Se(Ae[Ge],bn)<0&&(Fe=Ge)}return He<Re.length&&Ce==="next"?Ae+xe.substr(Ae.length):He<Ae.length&&Ce==="prev"?Ae.substr(0,xe.length):Fe<0?null:Ae.substr(0,Fe)+Re[Fe]+xe.substr(Fe+1)})(te,ie,z[ye],$[ye],M,q);Ee===null&&he===null?Z=ye+1:(he===null||0<M(he,Ee))&&(he=Ee)}return F(he!==null?function(){Y.continue(he+X)}:Q),!1}),c}function Vn(c,h,b,x){return{type:2,lower:c,upper:h,lowerOpen:b,upperOpen:x}}function Aa(c){return{type:1,lower:c,upper:c}}var cl=(Object.defineProperty($t.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),$t.prototype.between=function(c,h,b,x){b=b!==!1,x=x===!0;try{return 0<this._cmp(c,h)||this._cmp(c,h)===0&&(b||x)&&(!b||!x)?ea(this):new this.Collection(this,function(){return Vn(c,h,!b,!x)})}catch{return vn(this,gr)}},$t.prototype.equals=function(c){return c==null?vn(this,gr):new this.Collection(this,function(){return Aa(c)})},$t.prototype.above=function(c){return c==null?vn(this,gr):new this.Collection(this,function(){return Vn(c,void 0,!0)})},$t.prototype.aboveOrEqual=function(c){return c==null?vn(this,gr):new this.Collection(this,function(){return Vn(c,void 0,!1)})},$t.prototype.below=function(c){return c==null?vn(this,gr):new this.Collection(this,function(){return Vn(void 0,c,!1,!0)})},$t.prototype.belowOrEqual=function(c){return c==null?vn(this,gr):new this.Collection(this,function(){return Vn(void 0,c)})},$t.prototype.startsWith=function(c){return typeof c!="string"?vn(this,ac):this.between(c,c+Qr,!0,!0)},$t.prototype.startsWithIgnoreCase=function(c){return c===""?this.startsWith(c):oi(this,function(h,b){return h.indexOf(b[0])===0},[c],Qr)},$t.prototype.equalsIgnoreCase=function(c){return oi(this,function(h,b){return h===b[0]},[c],"")},$t.prototype.anyOfIgnoreCase=function(){var c=V.apply(Ke,arguments);return c.length===0?ea(this):oi(this,function(h,b){return b.indexOf(h)!==-1},c,"")},$t.prototype.startsWithAnyOfIgnoreCase=function(){var c=V.apply(Ke,arguments);return c.length===0?ea(this):oi(this,function(h,b){return b.some(function(x){return h.indexOf(x)===0})},c,Qr)},$t.prototype.anyOf=function(){var c=this,h=V.apply(Ke,arguments),b=this._cmp;try{h.sort(b)}catch{return vn(this,gr)}if(h.length===0)return ea(this);var x=new this.Collection(this,function(){return Vn(h[0],h[h.length-1])});x._ondirectionchange=function(T){b=T==="next"?c._ascending:c._descending,h.sort(b)};var S=0;return x._addAlgorithm(function(T,M,z){for(var $=T.key;0<b($,h[S]);)if(++S===h.length)return M(z),!1;return b($,h[S])===0||(M(function(){T.continue(h[S])}),!1)}),x},$t.prototype.notEqual=function(c){return this.inAnyRange([[-1/0,c],[c,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},$t.prototype.noneOf=function(){var c=V.apply(Ke,arguments);if(c.length===0)return new this.Collection(this);try{c.sort(this._ascending)}catch{return vn(this,gr)}var h=c.reduce(function(b,x){return b?b.concat([[b[b.length-1][1],x]]):[[-1/0,x]]},null);return h.push([c[c.length-1],this.db._maxKey]),this.inAnyRange(h,{includeLowers:!1,includeUppers:!1})},$t.prototype.inAnyRange=function(te,h){var b=this,x=this._cmp,S=this._ascending,T=this._descending,M=this._min,z=this._max;if(te.length===0)return ea(this);if(!te.every(function(ie){return ie[0]!==void 0&&ie[1]!==void 0&&S(ie[0],ie[1])<=0}))return vn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",je.InvalidArgument);var $=!h||h.includeLowers!==!1,q=h&&h.includeUppers===!0,X,U=S;function J(ie,he){return U(ie[0],he[0])}try{(X=te.reduce(function(ie,he){for(var ye=0,Ee=ie.length;ye<Ee;++ye){var Ae=ie[ye];if(x(he[0],Ae[1])<0&&0<x(he[1],Ae[0])){Ae[0]=M(Ae[0],he[0]),Ae[1]=z(Ae[1],he[1]);break}}return ye===Ee&&ie.push(he),ie},[])).sort(J)}catch{return vn(this,gr)}var Z=0,Y=q?function(ie){return 0<S(ie,X[Z][1])}:function(ie){return 0<=S(ie,X[Z][1])},F=$?function(ie){return 0<T(ie,X[Z][0])}:function(ie){return 0<=T(ie,X[Z][0])},Q=Y,te=new this.Collection(this,function(){return Vn(X[0][0],X[X.length-1][1],!$,!q)});return te._ondirectionchange=function(ie){U=ie==="next"?(Q=Y,S):(Q=F,T),X.sort(J)},te._addAlgorithm(function(ie,he,ye){for(var Ee,Ae=ie.key;Q(Ae);)if(++Z===X.length)return he(ye),!1;return!Y(Ee=Ae)&&!F(Ee)||(b._cmp(Ae,X[Z][1])===0||b._cmp(Ae,X[Z][0])===0||he(function(){U===S?ie.continue(X[Z][0]):ie.continue(X[Z][1])}),!1)}),te},$t.prototype.startsWithAnyOf=function(){var c=V.apply(Ke,arguments);return c.every(function(h){return typeof h=="string"})?c.length===0?ea(this):this.inAnyRange(c.map(function(h){return[h,h+Qr]})):vn(this,"startsWithAnyOf() only works with strings")},$t);function $t(){}function ir(c){return Je(function(h){return Pr(h),c(h.target.error),!1})}function Pr(c){c.stopPropagation&&c.stopPropagation(),c.preventDefault&&c.preventDefault()}var In="storagemutated",no="x-storagemutated-1",Fn=gn(null,In),ta=(Gn.prototype._lock=function(){return ae(!ke.global),++this._reculock,this._reculock!==1||ke.global||(ke.lockOwnerFor=this),this},Gn.prototype._unlock=function(){if(ae(!ke.global),--this._reculock==0)for(ke.global||(ke.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var c=this._blockedFuncs.shift();try{Fr(c[1],c[0])}catch{}}return this},Gn.prototype._locked=function(){return this._reculock&&ke.lockOwnerFor!==this},Gn.prototype.create=function(c){var h=this;if(!this.mode)return this;var b=this.db.idbdb,x=this.db._state.dbOpenError;if(ae(!this.idbtrans),!c&&!b)switch(x&&x.name){case"DatabaseClosedError":throw new je.DatabaseClosed(x);case"MissingAPIError":throw new je.MissingAPI(x.message,x);default:throw new je.OpenFailed(x)}if(!this.active)throw new je.TransactionInactive;return ae(this._completion._state===null),(c=this.idbtrans=c||(this.db.core||b).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Je(function(S){Pr(S),h._reject(c.error)}),c.onabort=Je(function(S){Pr(S),h.active&&h._reject(new je.Abort(c.error)),h.active=!1,h.on("abort").fire(S)}),c.oncomplete=Je(function(){h.active=!1,h._resolve(),"mutatedParts"in c&&Fn.storagemutated.fire(c.mutatedParts)}),this},Gn.prototype._promise=function(c,h,b){var x=this;if(c==="readwrite"&&this.mode!=="readwrite")return Lt(new je.ReadOnly("Transaction is readonly"));if(!this.active)return Lt(new je.TransactionInactive);if(this._locked())return new De(function(T,M){x._blockedFuncs.push([function(){x._promise(c,h,b).then(T,M)},ke])});if(b)return yr(function(){var T=new De(function(M,z){x._lock();var $=h(M,z,x);$&&$.then&&$.then(M,z)});return T.finally(function(){return x._unlock()}),T._lib=!0,T});var S=new De(function(T,M){var z=h(T,M,x);z&&z.then&&z.then(T,M)});return S._lib=!0,S},Gn.prototype._root=function(){return this.parent?this.parent._root():this},Gn.prototype.waitFor=function(c){var h,b=this._root(),x=De.resolve(c);b._waitingFor?b._waitingFor=b._waitingFor.then(function(){return x}):(b._waitingFor=x,b._waitingQueue=[],h=b.idbtrans.objectStore(b.storeNames[0]),(function T(){for(++b._spinCount;b._waitingQueue.length;)b._waitingQueue.shift()();b._waitingFor&&(h.get(-1/0).onsuccess=T)})());var S=b._waitingFor;return new De(function(T,M){x.then(function(z){return b._waitingQueue.push(Je(T.bind(null,z)))},function(z){return b._waitingQueue.push(Je(M.bind(null,z)))}).finally(function(){b._waitingFor===S&&(b._waitingFor=null)})})},Gn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new je.Abort))},Gn.prototype.table=function(c){var h=this._memoizedTables||(this._memoizedTables={});if(w(h,c))return h[c];var b=this.schema[c];if(!b)throw new je.NotFound("Table "+c+" not part of transaction");return b=new this.db.Table(c,b,this),b.core=this.db.core.table(c),h[c]=b},Gn);function Gn(){}function si(c,h,b,x,S,T,M,z){return{name:c,keyPath:h,unique:b,multi:x,auto:S,compound:T,src:(b&&!M?"&":"")+(x?"*":"")+(S?"++":"")+fl(h),type:z}}function fl(c){return typeof c=="string"?c:c?"["+[].join.call(c,"+")+"]":""}function li(c,h,b){return{name:c,primKey:h,indexes:b,mappedClass:null,idxByName:(x=function(S){return[S.name,S]},b.reduce(function(S,T,M){return M=x(T,M),M&&(S[M[0]]=M[1]),S},{}))};var x}var na=function(c){try{return c.only([[]]),na=function(){return[[]]},[[]]}catch{return na=function(){return Qr},Qr}};function Jo(c){return c==null?function(){}:typeof c=="string"?(h=c).split(".").length===1?function(b){return b[h]}:function(b){return fe(b,h)}:function(b){return fe(b,c)};var h}function _n(c){return[].slice.call(c)}var Ra=0;function ra(c){return c==null?":id":typeof c=="string"?c:"[".concat(c.join("+"),"]")}function ro(c,h,$){function x(Q){if(Q.type===3)return null;if(Q.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var Z=Q.lower,Y=Q.upper,F=Q.lowerOpen,Q=Q.upperOpen;return Z===void 0?Y===void 0?null:h.upperBound(Y,!!Q):Y===void 0?h.lowerBound(Z,!!F):h.bound(Z,Y,!!F,!!Q)}function S(J){var Z,Y=J.name;return{name:Y,schema:J,mutate:function(F){var Q=F.trans,te=F.type,ie=F.keys,he=F.values,ye=F.range;return new Promise(function(Ee,Ae){Ee=Je(Ee);var we=Q.objectStore(Y),xe=we.keyPath==null,Re=te==="put"||te==="add";if(!Re&&te!=="delete"&&te!=="deleteRange")throw new Error("Invalid operation type: "+te);var Se,Ce=(ie||he||{length:1}).length;if(ie&&he&&ie.length!==he.length)throw new Error("Given keys array must have same length as given values array.");if(Ce===0)return Ee({numFailures:0,failures:{},results:[],lastResult:void 0});function He(qt){++bn,Pr(qt)}var Fe=[],Ge=[],bn=0;if(te==="deleteRange"){if(ye.type===4)return Ee({numFailures:bn,failures:Ge,results:[],lastResult:void 0});ye.type===3?Fe.push(Se=we.clear()):Fe.push(Se=we.delete(x(ye)))}else{var xe=Re?xe?[he,ie]:[he,null]:[ie,null],Ye=xe[0],Bt=xe[1];if(Re)for(var cn=0;cn<Ce;++cn)Fe.push(Se=Bt&&Bt[cn]!==void 0?we[te](Ye[cn],Bt[cn]):we[te](Ye[cn])),Se.onerror=He;else for(cn=0;cn<Ce;++cn)Fe.push(Se=we[te](Ye[cn])),Se.onerror=He}function Na(qt){qt=qt.target.result,Fe.forEach(function(za,Tn){return za.error!=null&&(Ge[Tn]=za.error)}),Ee({numFailures:bn,failures:Ge,results:te==="delete"?ie:Fe.map(function(za){return za.result}),lastResult:qt})}Se.onerror=function(qt){He(qt),Na(qt)},Se.onsuccess=Na})},getMany:function(F){var Q=F.trans,te=F.keys;return new Promise(function(ie,he){ie=Je(ie);for(var ye,Ee=Q.objectStore(Y),Ae=te.length,we=new Array(Ae),xe=0,Re=0,Se=function(Fe){Fe=Fe.target,we[Fe._pos]=Fe.result,++Re===xe&&ie(we)},Ce=ir(he),He=0;He<Ae;++He)te[He]!=null&&((ye=Ee.get(te[He]))._pos=He,ye.onsuccess=Se,ye.onerror=Ce,++xe);xe===0&&ie(we)})},get:function(F){var Q=F.trans,te=F.key;return new Promise(function(ie,he){ie=Je(ie);var ye=Q.objectStore(Y).get(te);ye.onsuccess=function(Ee){return ie(Ee.target.result)},ye.onerror=ir(he)})},query:(Z=q,function(F){return new Promise(function(Q,te){Q=Je(Q);var ie,he,ye,xe=F.trans,Ee=F.values,Ae=F.limit,Se=F.query,we=Ae===1/0?void 0:Ae,Re=Se.index,Se=Se.range,xe=xe.objectStore(Y),Re=Re.isPrimaryKey?xe:xe.index(Re.name),Se=x(Se);if(Ae===0)return Q({result:[]});Z?((we=Ee?Re.getAll(Se,we):Re.getAllKeys(Se,we)).onsuccess=function(Ce){return Q({result:Ce.target.result})},we.onerror=ir(te)):(ie=0,he=!Ee&&"openKeyCursor"in Re?Re.openKeyCursor(Se):Re.openCursor(Se),ye=[],he.onsuccess=function(Ce){var He=he.result;return He?(ye.push(Ee?He.value:He.primaryKey),++ie===Ae?Q({result:ye}):void He.continue()):Q({result:ye})},he.onerror=ir(te))})}),openCursor:function(F){var Q=F.trans,te=F.values,ie=F.query,he=F.reverse,ye=F.unique;return new Promise(function(Ee,Ae){Ee=Je(Ee);var Re=ie.index,we=ie.range,xe=Q.objectStore(Y),xe=Re.isPrimaryKey?xe:xe.index(Re.name),Re=he?ye?"prevunique":"prev":ye?"nextunique":"next",Se=!te&&"openKeyCursor"in xe?xe.openKeyCursor(x(we),Re):xe.openCursor(x(we),Re);Se.onerror=ir(Ae),Se.onsuccess=Je(function(Ce){var He,Fe,Ge,bn,Ye=Se.result;Ye?(Ye.___id=++Ra,Ye.done=!1,He=Ye.continue.bind(Ye),Fe=(Fe=Ye.continuePrimaryKey)&&Fe.bind(Ye),Ge=Ye.advance.bind(Ye),bn=function(){throw new Error("Cursor not stopped")},Ye.trans=Q,Ye.stop=Ye.continue=Ye.continuePrimaryKey=Ye.advance=function(){throw new Error("Cursor not started")},Ye.fail=Je(Ae),Ye.next=function(){var Bt=this,cn=1;return this.start(function(){return cn--?Bt.continue():Bt.stop()}).then(function(){return Bt})},Ye.start=function(Bt){function cn(){if(Se.result)try{Bt()}catch(qt){Ye.fail(qt)}else Ye.done=!0,Ye.start=function(){throw new Error("Cursor behind last entry")},Ye.stop()}var Na=new Promise(function(qt,za){qt=Je(qt),Se.onerror=ir(za),Ye.fail=za,Ye.stop=function(Tn){Ye.stop=Ye.continue=Ye.continuePrimaryKey=Ye.advance=bn,qt(Tn)}});return Se.onsuccess=Je(function(qt){Se.onsuccess=cn,cn()}),Ye.continue=He,Ye.continuePrimaryKey=Fe,Ye.advance=Ge,cn(),Na},Ee(Ye)):Ee(null)},Ae)})},count:function(F){var Q=F.query,te=F.trans,ie=Q.index,he=Q.range;return new Promise(function(ye,Ee){var Ae=te.objectStore(Y),we=ie.isPrimaryKey?Ae:Ae.index(ie.name),Ae=x(he),we=Ae?we.count(Ae):we.count();we.onsuccess=Je(function(xe){return ye(xe.target.result)}),we.onerror=ir(Ee)})}}}var T,M,z,X=(M=$,z=_n((T=c).objectStoreNames),{schema:{name:T.name,tables:z.map(function(J){return M.objectStore(J)}).map(function(J){var Z=J.keyPath,Q=J.autoIncrement,Y=p(Z),F={},Q={name:J.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:Z==null,compound:Y,keyPath:Z,autoIncrement:Q,unique:!0,extractKey:Jo(Z)},indexes:_n(J.indexNames).map(function(te){return J.index(te)}).map(function(ye){var ie=ye.name,he=ye.unique,Ee=ye.multiEntry,ye=ye.keyPath,Ee={name:ie,compound:p(ye),keyPath:ye,unique:he,multiEntry:Ee,extractKey:Jo(ye)};return F[ra(ye)]=Ee}),getIndexByKeyPath:function(te){return F[ra(te)]}};return F[":id"]=Q.primaryKey,Z!=null&&(F[ra(Z)]=Q.primaryKey),Q})},hasGetAll:0<z.length&&"getAll"in M.objectStore(z[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),$=X.schema,q=X.hasGetAll,X=$.tables.map(S),U={};return X.forEach(function(J){return U[J.name]=J}),{stack:"dbcore",transaction:c.transaction.bind(c),table:function(J){if(!U[J])throw new Error("Table '".concat(J,"' not found"));return U[J]},MIN_KEY:-1/0,MAX_KEY:na(h),schema:$}}function Md(c,h,b,x){var S=b.IDBKeyRange;return b.indexedDB,{dbcore:(x=ro(h,S,x),c.dbcore.reduce(function(T,M){return M=M.create,i(i({},T),M(T))},x))}}function ui(c,x){var b=x.db,x=Md(c._middlewares,b,c._deps,x);c.core=x.dbcore,c.tables.forEach(function(S){var T=S.name;c.core.schema.tables.some(function(M){return M.name===T})&&(S.core=c.core.table(T),c[T]instanceof c.Table&&(c[T].core=S.core))})}function ci(c,h,b,x){b.forEach(function(S){var T=x[S];h.forEach(function(M){var z=(function $(q,X){return N(q,X)||(q=g(q))&&$(q,X)})(M,S);(!z||"value"in z&&z.value===void 0)&&(M===c.Transaction.prototype||M instanceof c.Transaction?A(M,S,{get:function(){return this.table(S)},set:function($){O(this,S,{value:$,writable:!0,configurable:!0,enumerable:!0})}}):M[S]=new c.Table(S,T))})})}function Ca(c,h){h.forEach(function(b){for(var x in b)b[x]instanceof c.Table&&delete b[x]})}function es(c,h){return c._cfg.version-h._cfg.version}function sc(c,h,b,x){var S=c._dbSchema;b.objectStoreNames.contains("$meta")&&!S.$meta&&(S.$meta=li("$meta",lc("")[0],[]),c._storeNames.push("$meta"));var T=c._createTransaction("readwrite",c._storeNames,S);T.create(b),T._completion.catch(x);var M=T._reject.bind(T),z=ke.transless||ke;yr(function(){return ke.trans=T,ke.transless=z,h!==0?(ui(c,b),q=h,(($=T).storeNames.includes("$meta")?$.table("$meta").get("version").then(function(X){return X??q}):De.resolve(q)).then(function(X){return J=X,Z=T,Y=b,F=[],X=(U=c)._versions,Q=U._dbSchema=rs(0,U.idbdb,Y),(X=X.filter(function(te){return te._cfg.version>=J})).length!==0?(X.forEach(function(te){F.push(function(){var ie=Q,he=te._cfg.dbschema;as(U,ie,Y),as(U,he,Y),Q=U._dbSchema=he;var ye=dl(ie,he);ye.add.forEach(function(Re){hl(Y,Re[0],Re[1].primKey,Re[1].indexes)}),ye.change.forEach(function(Re){if(Re.recreate)throw new je.Upgrade("Not yet support for changing primary key");var Se=Y.objectStore(Re.name);Re.add.forEach(function(Ce){return ns(Se,Ce)}),Re.change.forEach(function(Ce){Se.deleteIndex(Ce.name),ns(Se,Ce)}),Re.del.forEach(function(Ce){return Se.deleteIndex(Ce)})});var Ee=te._cfg.contentUpgrade;if(Ee&&te._cfg.version>J){ui(U,Y),Z._memoizedTables={};var Ae=le(he);ye.del.forEach(function(Re){Ae[Re]=ie[Re]}),Ca(U,[U.Transaction.prototype]),ci(U,[U.Transaction.prototype],f(Ae),Ae),Z.schema=Ae;var we,xe=k(Ee);return xe&&rr(),ye=De.follow(function(){var Re;(we=Ee(Z))&&xe&&(Re=Bn.bind(null,null),we.then(Re,Re))}),we&&typeof we.then=="function"?De.resolve(we):ye.then(function(){return we})}}),F.push(function(ie){var he,ye,Ee=te._cfg.dbschema;he=Ee,ye=ie,[].slice.call(ye.db.objectStoreNames).forEach(function(Ae){return he[Ae]==null&&ye.db.deleteObjectStore(Ae)}),Ca(U,[U.Transaction.prototype]),ci(U,[U.Transaction.prototype],U._storeNames,U._dbSchema),Z.schema=U._dbSchema}),F.push(function(ie){U.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(U.idbdb.version/10)===te._cfg.version?(U.idbdb.deleteObjectStore("$meta"),delete U._dbSchema.$meta,U._storeNames=U._storeNames.filter(function(he){return he!=="$meta"})):ie.objectStore("$meta").put(te._cfg.version,"version"))})}),(function te(){return F.length?De.resolve(F.shift()(Z.idbtrans)).then(te):De.resolve()})().then(function(){ts(Q,Y)})):De.resolve();var U,J,Z,Y,F,Q}).catch(M)):(f(S).forEach(function(X){hl(b,X,S[X].primKey,S[X].indexes)}),ui(c,b),void De.follow(function(){return c.on.populate.fire(T)}).catch(M));var $,q})}function kd(c,h){ts(c._dbSchema,h),h.db.version%10!=0||h.objectStoreNames.contains("$meta")||h.db.createObjectStore("$meta").add(Math.ceil(h.db.version/10-1),"version");var b=rs(0,c.idbdb,h);as(c,c._dbSchema,h);for(var x=0,S=dl(b,c._dbSchema).change;x<S.length;x++){var T=(function(M){if(M.change.length||M.recreate)return console.warn("Unable to patch indexes of table ".concat(M.name," because it has changes on the type of index or primary key.")),{value:void 0};var z=h.objectStore(M.name);M.add.forEach(function($){ln&&console.debug("Dexie upgrade patch: Creating missing index ".concat(M.name,".").concat($.src)),ns(z,$)})})(S[x]);if(typeof T=="object")return T.value}}function dl(c,h){var b,x={del:[],add:[],change:[]};for(b in c)h[b]||x.del.push(b);for(b in h){var S=c[b],T=h[b];if(S){var M={name:b,def:T,recreate:!1,del:[],add:[],change:[]};if(""+(S.primKey.keyPath||"")!=""+(T.primKey.keyPath||"")||S.primKey.auto!==T.primKey.auto)M.recreate=!0,x.change.push(M);else{var z=S.idxByName,$=T.idxByName,q=void 0;for(q in z)$[q]||M.del.push(q);for(q in $){var X=z[q],U=$[q];X?X.src!==U.src&&M.change.push(U):M.add.push(U)}(0<M.del.length||0<M.add.length||0<M.change.length)&&x.change.push(M)}}else x.add.push([b,T])}return x}function hl(c,h,b,x){var S=c.db.createObjectStore(h,b.keyPath?{keyPath:b.keyPath,autoIncrement:b.auto}:{autoIncrement:b.auto});return x.forEach(function(T){return ns(S,T)}),S}function ts(c,h){f(c).forEach(function(b){h.db.objectStoreNames.contains(b)||(ln&&console.debug("Dexie: Creating missing table",b),hl(h,b,c[b].primKey,c[b].indexes))})}function ns(c,h){c.createIndex(h.name,h.keyPath,{unique:h.unique,multiEntry:h.multi})}function rs(c,h,b){var x={};return H(h.objectStoreNames,0).forEach(function(S){for(var T=b.objectStore(S),M=si(fl(q=T.keyPath),q||"",!0,!1,!!T.autoIncrement,q&&typeof q!="string",!0),z=[],$=0;$<T.indexNames.length;++$){var X=T.index(T.indexNames[$]),q=X.keyPath,X=si(X.name,q,!!X.unique,!!X.multiEntry,!1,q&&typeof q!="string",!1);z.push(X)}x[S]=li(S,M,z)}),x}function as(c,h,b){for(var x=b.db.objectStoreNames,S=0;S<x.length;++S){var T=x[S],M=b.objectStore(T);c._hasGetAll="getAll"in M;for(var z=0;z<M.indexNames.length;++z){var $=M.indexNames[z],q=M.index($).keyPath,X=typeof q=="string"?q:"["+H(q).join("+")+"]";!h[T]||(q=h[T].idxByName[X])&&(q.name=$,delete h[T].idxByName[X],h[T].idxByName[$]=q)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&u.WorkerGlobalScope&&u instanceof u.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(c._hasGetAll=!1)}function lc(c){return c.split(",").map(function(h,b){var T=h.split(":"),x=(S=T[1])===null||S===void 0?void 0:S.trim(),S=(h=T[0].trim()).replace(/([&*]|\+\+)/g,""),T=/^\[/.test(S)?S.match(/^\[(.*)\]$/)[1].split("+"):S;return si(S,T||null,/\&/.test(h),/\*/.test(h),/\+\+/.test(h),p(T),b===0,x)})}var Nd=(Oa.prototype._createTableSchema=li,Oa.prototype._parseIndexSyntax=lc,Oa.prototype._parseStoresSpec=function(c,h){var b=this;f(c).forEach(function(x){if(c[x]!==null){var S=b._parseIndexSyntax(c[x]),T=S.shift();if(!T)throw new je.Schema("Invalid schema for table "+x+": "+c[x]);if(T.unique=!0,T.multi)throw new je.Schema("Primary key cannot be multiEntry*");S.forEach(function(M){if(M.auto)throw new je.Schema("Only primary key can be marked as autoIncrement (++)");if(!M.keyPath)throw new je.Schema("Index must have a name and cannot be an empty string")}),S=b._createTableSchema(x,T,S),h[x]=S}})},Oa.prototype.stores=function(b){var h=this.db;this._cfg.storesSource=this._cfg.storesSource?y(this._cfg.storesSource,b):b;var b=h._versions,x={},S={};return b.forEach(function(T){y(x,T._cfg.storesSource),S=T._cfg.dbschema={},T._parseStoresSpec(x,S)}),h._dbSchema=S,Ca(h,[h._allTables,h,h.Transaction.prototype]),ci(h,[h._allTables,h,h.Transaction.prototype,this._cfg.tables],f(S),S),h._storeNames=f(S),this},Oa.prototype.upgrade=function(c){return this._cfg.contentUpgrade=Yn(this._cfg.contentUpgrade||$e,c),this},Oa);function Oa(){}function pl(c,h){var b=c._dbNamesDB;return b||(b=c._dbNamesDB=new or(Sa,{addons:[],indexedDB:c,IDBKeyRange:h})).version(1).stores({dbnames:"name"}),b.table("dbnames")}function ml(c){return c&&typeof c.databases=="function"}function yl(c){return yr(function(){return ke.letThrough=!0,c()})}function gl(c){return!("from"in c)}var tn=function(c,h){if(!this){var b=new tn;return c&&"d"in c&&y(b,c),b}y(this,arguments.length?{d:1,from:c,to:1<arguments.length?h:c}:{d:0})};function ao(c,h,b){var x=nt(h,b);if(!isNaN(x)){if(0<x)throw RangeError();if(gl(c))return y(c,{from:h,to:b,d:1});var S=c.l,x=c.r;if(nt(b,c.from)<0)return S?ao(S,h,b):c.l={from:h,to:b,d:1,l:null,r:null},cc(c);if(0<nt(h,c.to))return x?ao(x,h,b):c.r={from:h,to:b,d:1,l:null,r:null},cc(c);nt(h,c.from)<0&&(c.from=h,c.l=null,c.d=x?x.d+1:1),0<nt(b,c.to)&&(c.to=b,c.r=null,c.d=c.l?c.l.d+1:1),b=!c.r,S&&!c.l&&io(c,S),x&&b&&io(c,x)}}function io(c,h){gl(h)||(function b(x,$){var T=$.from,M=$.to,z=$.l,$=$.r;ao(x,T,M),z&&b(x,z),$&&b(x,$)})(c,h)}function uc(c,h){var b=oo(h),x=b.next();if(x.done)return!1;for(var S=x.value,T=oo(c),M=T.next(S.from),z=M.value;!x.done&&!M.done;){if(nt(z.from,S.to)<=0&&0<=nt(z.to,S.from))return!0;nt(S.from,z.from)<0?S=(x=b.next(z.from)).value:z=(M=T.next(S.from)).value}return!1}function oo(c){var h=gl(c)?null:{s:0,n:c};return{next:function(b){for(var x=0<arguments.length;h;)switch(h.s){case 0:if(h.s=1,x)for(;h.n.l&&nt(b,h.n.from)<0;)h={up:h,n:h.n.l,s:1};else for(;h.n.l;)h={up:h,n:h.n.l,s:1};case 1:if(h.s=2,!x||nt(b,h.n.to)<=0)return{value:h.n,done:!1};case 2:if(h.n.r){h.s=3,h={up:h,n:h.n.r,s:0};continue}case 3:h=h.up}return{done:!0}}}}function cc(c){var h,b,x=(((h=c.r)===null||h===void 0?void 0:h.d)||0)-(((b=c.l)===null||b===void 0?void 0:b.d)||0),S=1<x?"r":x<-1?"l":"";S&&(h=S=="r"?"l":"r",b=i({},c),x=c[S],c.from=x.from,c.to=x.to,c[S]=x[S],b[S]=x[h],(c[h]=b).d=fc(b)),c.d=fc(c)}function fc(b){var h=b.r,b=b.l;return(h?b?Math.max(h.d,b.d):h.d:b?b.d:0)+1}function is(c,h){return f(h).forEach(function(b){c[b]?io(c[b],h[b]):c[b]=(function x(S){var T,M,z={};for(T in S)w(S,T)&&(M=S[T],z[T]=!M||typeof M!="object"||Xe.has(M.constructor)?M:x(M));return z})(h[b])}),c}function vl(c,h){return c.all||h.all||Object.keys(c).some(function(b){return h[b]&&uc(h[b],c[b])})}_(tn.prototype,((Hn={add:function(c){return io(this,c),this},addKey:function(c){return ao(this,c,c),this},addKeys:function(c){var h=this;return c.forEach(function(b){return ao(h,b,b)}),this},hasKey:function(c){var h=oo(this).next(c).value;return h&&nt(h.from,c)<=0&&0<=nt(h.to,c)}})[de]=function(){return oo(this)},Hn));var Da={},bl={},xl=!1;function os(c){is(bl,c),xl||(xl=!0,setTimeout(function(){xl=!1,wl(bl,!(bl={}))},0))}function wl(c,h){h===void 0&&(h=!1);var b=new Set;if(c.all)for(var x=0,S=Object.values(Da);x<S.length;x++)ss(M=S[x],c,b,h);else for(var T in c){var M,z=/^idb\:\/\/(.*)\/(.*)\//.exec(T);z&&(T=z[1],z=z[2],(M=Da["idb://".concat(T,"/").concat(z)])&&ss(M,c,b,h))}b.forEach(function($){return $()})}function ss(c,h,b,x){for(var S=[],T=0,M=Object.entries(c.queries.query);T<M.length;T++){for(var z=M[T],$=z[0],q=[],X=0,U=z[1];X<U.length;X++){var J=U[X];vl(h,J.obsSet)?J.subscribers.forEach(function(Q){return b.add(Q)}):x&&q.push(J)}x&&S.push([$,q])}if(x)for(var Z=0,Y=S;Z<Y.length;Z++){var F=Y[Z],$=F[0],q=F[1];c.queries.query[$]=q}}function so(c){var h=c._state,b=c._deps.indexedDB;if(h.isBeingOpened||c.idbdb)return h.dbReadyPromise.then(function(){return h.dbOpenError?Lt(h.dbOpenError):c});h.isBeingOpened=!0,h.dbOpenError=null,h.openComplete=!1;var x=h.openCanceller,S=Math.round(10*c.verno),T=!1;function M(){if(h.openCanceller!==x)throw new je.DatabaseClosed("db.open() was cancelled")}function z(){return new De(function(J,Z){if(M(),!b)throw new je.MissingAPI;var Y=c.name,F=h.autoSchema||!S?b.open(Y):b.open(Y,S);if(!F)throw new je.MissingAPI;F.onerror=ir(Z),F.onblocked=Je(c._fireOnBlocked),F.onupgradeneeded=Je(function(Q){var te;X=F.transaction,h.autoSchema&&!c._options.allowEmptyDB?(F.onerror=Pr,X.abort(),F.result.close(),(te=b.deleteDatabase(Y)).onsuccess=te.onerror=Je(function(){Z(new je.NoSuchDatabase("Database ".concat(Y," doesnt exist")))})):(X.onerror=ir(Z),Q=Q.oldVersion>Math.pow(2,62)?0:Q.oldVersion,U=Q<1,c.idbdb=F.result,T&&kd(c,X),sc(c,Q/10,X,Z))},Z),F.onsuccess=Je(function(){X=null;var Q,te,ie,he,ye,Ee=c.idbdb=F.result,Ae=H(Ee.objectStoreNames);if(0<Ae.length)try{var we=Ee.transaction((he=Ae).length===1?he[0]:he,"readonly");if(h.autoSchema)te=Ee,ie=we,(Q=c).verno=te.version/10,ie=Q._dbSchema=rs(0,te,ie),Q._storeNames=H(te.objectStoreNames,0),ci(Q,[Q._allTables],f(ie),ie);else if(as(c,c._dbSchema,we),((ye=dl(rs(0,(ye=c).idbdb,we),ye._dbSchema)).add.length||ye.change.some(function(xe){return xe.add.length||xe.change.length}))&&!T)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),Ee.close(),S=Ee.version+1,T=!0,J(z());ui(c,we)}catch{}Nr.push(c),Ee.onversionchange=Je(function(xe){h.vcFired=!0,c.on("versionchange").fire(xe)}),Ee.onclose=Je(function(){c.close({disableAutoOpen:!1})}),U&&(ye=c._deps,we=Y,Ee=ye.indexedDB,ye=ye.IDBKeyRange,ml(Ee)||we===Sa||pl(Ee,ye).put({name:we}).catch($e)),J()},Z)}).catch(function(J){switch(J?.name){case"UnknownError":if(0<h.PR1398_maxLoop)return h.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),z();break;case"VersionError":if(0<S)return S=0,z()}return De.reject(J)})}var $,q=h.dbReadyResolve,X=null,U=!1;return De.race([x,(typeof navigator>"u"?De.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(J){function Z(){return indexedDB.databases().finally(J)}$=setInterval(Z,100),Z()}).finally(function(){return clearInterval($)}):Promise.resolve()).then(z)]).then(function(){return M(),h.onReadyBeingFired=[],De.resolve(yl(function(){return c.on.ready.fire(c.vip)})).then(function J(){if(0<h.onReadyBeingFired.length){var Z=h.onReadyBeingFired.reduce(Yn,$e);return h.onReadyBeingFired=[],De.resolve(yl(function(){return Z(c.vip)})).then(J)}})}).finally(function(){h.openCanceller===x&&(h.onReadyBeingFired=null,h.isBeingOpened=!1)}).catch(function(J){h.dbOpenError=J;try{X&&X.abort()}catch{}return x===h.openCanceller&&c._close(),Lt(J)}).finally(function(){h.openComplete=!0,q()}).then(function(){var J;return U&&(J={},c.tables.forEach(function(Z){Z.schema.indexes.forEach(function(Y){Y.name&&(J["idb://".concat(c.name,"/").concat(Z.name,"/").concat(Y.name)]=new tn(-1/0,[[[]]]))}),J["idb://".concat(c.name,"/").concat(Z.name,"/")]=J["idb://".concat(c.name,"/").concat(Z.name,"/:dels")]=new tn(-1/0,[[[]]])}),Fn(In).fire(J),wl(J,!0)),c})}function Sl(c){function h(T){return c.next(T)}var b=S(h),x=S(function(T){return c.throw(T)});function S(T){return function($){var z=T($),$=z.value;return z.done?$:$&&typeof $.then=="function"?$.then(b,x):p($)?Promise.all($).then(b,x):b($)}}return S(h)()}function lo(c,h,b){for(var x=p(c)?c.slice():[c],S=0;S<b;++S)x.push(h);return x}var dc={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(c){return i(i({},c),{table:function(h){var b=c.table(h),x=b.schema,S={},T=[];function M(U,J,Z){var Y=ra(U),F=S[Y]=S[Y]||[],Q=U==null?0:typeof U=="string"?1:U.length,te=0<J,te=i(i({},Z),{name:te?"".concat(Y,"(virtual-from:").concat(Z.name,")"):Z.name,lowLevelIndex:Z,isVirtual:te,keyTail:J,keyLength:Q,extractKey:Jo(U),unique:!te&&Z.unique});return F.push(te),te.isPrimaryKey||T.push(te),1<Q&&M(Q===2?U[0]:U.slice(0,Q-1),J+1,Z),F.sort(function(ie,he){return ie.keyTail-he.keyTail}),te}h=M(x.primaryKey.keyPath,0,x.primaryKey),S[":id"]=[h];for(var z=0,$=x.indexes;z<$.length;z++){var q=$[z];M(q.keyPath,0,q)}function X(U){var J,Z=U.query.index;return Z.isVirtual?i(i({},U),{query:{index:Z.lowLevelIndex,range:(J=U.query.range,Z=Z.keyTail,{type:J.type===1?2:J.type,lower:lo(J.lower,J.lowerOpen?c.MAX_KEY:c.MIN_KEY,Z),lowerOpen:!0,upper:lo(J.upper,J.upperOpen?c.MIN_KEY:c.MAX_KEY,Z),upperOpen:!0})}}):U}return i(i({},b),{schema:i(i({},x),{primaryKey:h,indexes:T,getIndexByKeyPath:function(U){return(U=S[ra(U)])&&U[0]}}),count:function(U){return b.count(X(U))},query:function(U){return b.query(X(U))},openCursor:function(U){var J=U.query.index,Z=J.keyTail,Y=J.isVirtual,F=J.keyLength;return Y?b.openCursor(X(U)).then(function(te){return te&&Q(te)}):b.openCursor(U);function Q(te){return Object.create(te,{continue:{value:function(ie){ie!=null?te.continue(lo(ie,U.reverse?c.MAX_KEY:c.MIN_KEY,Z)):U.unique?te.continue(te.key.slice(0,F).concat(U.reverse?c.MIN_KEY:c.MAX_KEY,Z)):te.continue()}},continuePrimaryKey:{value:function(ie,he){te.continuePrimaryKey(lo(ie,c.MAX_KEY,Z),he)}},primaryKey:{get:function(){return te.primaryKey}},key:{get:function(){var ie=te.key;return F===1?ie[0]:ie.slice(0,F)}},value:{get:function(){return te.value}}})}}})}})}};function ls(c,h,b,x){return b=b||{},x=x||"",f(c).forEach(function(S){var T,M,z;w(h,S)?(T=c[S],M=h[S],typeof T=="object"&&typeof M=="object"&&T&&M?(z=ut(T))!==ut(M)?b[x+S]=h[S]:z==="Object"?ls(T,M,b,x+S+"."):T!==M&&(b[x+S]=h[S]):T!==M&&(b[x+S]=h[S])):b[x+S]=void 0}),f(h).forEach(function(S){w(c,S)||(b[x+S]=h[S])}),b}function us(c,h){return h.type==="delete"?h.keys:h.keys||h.values.map(c.extractKey)}var hc={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(c){return i(i({},c),{table:function(h){var b=c.table(h),x=b.schema.primaryKey;return i(i({},b),{mutate:function(S){var T=ke.trans,M=T.table(h).hook,z=M.deleting,$=M.creating,q=M.updating;switch(S.type){case"add":if($.fire===$e)break;return T._promise("readwrite",function(){return X(S)},!0);case"put":if($.fire===$e&&q.fire===$e)break;return T._promise("readwrite",function(){return X(S)},!0);case"delete":if(z.fire===$e)break;return T._promise("readwrite",function(){return X(S)},!0);case"deleteRange":if(z.fire===$e)break;return T._promise("readwrite",function(){return(function U(J,Z,Y){return b.query({trans:J,values:!1,query:{index:x,range:Z},limit:Y}).then(function(F){var Q=F.result;return X({type:"delete",keys:Q,trans:J}).then(function(te){return 0<te.numFailures?Promise.reject(te.failures[0]):Q.length<Y?{failures:[],numFailures:0,lastResult:void 0}:U(J,i(i({},Z),{lower:Q[Q.length-1],lowerOpen:!0}),Y)})})})(S.trans,S.range,1e4)},!0)}return b.mutate(S);function X(U){var J,Z,Y,F=ke.trans,Q=U.keys||us(x,U);if(!Q)throw new Error("Keys missing");return(U=U.type==="add"||U.type==="put"?i(i({},U),{keys:Q}):i({},U)).type!=="delete"&&(U.values=l([],U.values)),U.keys&&(U.keys=l([],U.keys)),J=b,Y=Q,((Z=U).type==="add"?Promise.resolve([]):J.getMany({trans:Z.trans,keys:Y,cache:"immutable"})).then(function(te){var ie=Q.map(function(he,ye){var Ee,Ae,we,xe=te[ye],Re={onerror:null,onsuccess:null};return U.type==="delete"?z.fire.call(Re,he,xe,F):U.type==="add"||xe===void 0?(Ee=$.fire.call(Re,he,U.values[ye],F),he==null&&Ee!=null&&(U.keys[ye]=he=Ee,x.outbound||ue(U.values[ye],x.keyPath,he))):(Ee=ls(xe,U.values[ye]),(Ae=q.fire.call(Re,Ee,he,xe,F))&&(we=U.values[ye],Object.keys(Ae).forEach(function(Se){w(we,Se)?we[Se]=Ae[Se]:ue(we,Se,Ae[Se])}))),Re});return b.mutate(U).then(function(he){for(var ye=he.failures,Ee=he.results,Ae=he.numFailures,he=he.lastResult,we=0;we<Q.length;++we){var xe=(Ee||Q)[we],Re=ie[we];xe==null?Re.onerror&&Re.onerror(ye[we]):Re.onsuccess&&Re.onsuccess(U.type==="put"&&te[we]?U.values[we]:xe)}return{failures:ye,results:Ee,numFailures:Ae,lastResult:he}}).catch(function(he){return ie.forEach(function(ye){return ye.onerror&&ye.onerror(he)}),Promise.reject(he)})})}}})}})}};function ja(c,h,b){try{if(!h||h.keys.length<c.length)return null;for(var x=[],S=0,T=0;S<h.keys.length&&T<c.length;++S)nt(h.keys[S],c[T])===0&&(x.push(b?Ht(h.values[S]):h.values[S]),++T);return x.length===c.length?x:null}catch{return null}}var zd={stack:"dbcore",level:-1,create:function(c){return{table:function(h){var b=c.table(h);return i(i({},b),{getMany:function(x){if(!x.cache)return b.getMany(x);var S=ja(x.keys,x.trans._cache,x.cache==="clone");return S?De.resolve(S):b.getMany(x).then(function(T){return x.trans._cache={keys:x.keys,values:x.cache==="clone"?Ht(T):T},T})},mutate:function(x){return x.type!=="add"&&(x.trans._cache=null),b.mutate(x)}})}}}};function pc(c,h){return c.trans.mode==="readonly"&&!!c.subscr&&!c.trans.explicit&&c.trans.db._options.cache!=="disabled"&&!h.schema.primaryKey.outbound}function mc(c,h){switch(c){case"query":return h.values&&!h.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var yc={stack:"dbcore",level:0,name:"Observability",create:function(c){var h=c.schema.name,b=new tn(c.MIN_KEY,c.MAX_KEY);return i(i({},c),{transaction:function(x,S,T){if(ke.subscr&&S!=="readonly")throw new je.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(ke.querier));return c.transaction(x,S,T)},table:function(x){var S=c.table(x),T=S.schema,M=T.primaryKey,U=T.indexes,z=M.extractKey,$=M.outbound,q=M.autoIncrement&&U.filter(function(Z){return Z.compound&&Z.keyPath.includes(M.keyPath)}),X=i(i({},S),{mutate:function(Z){function Y(Se){return Se="idb://".concat(h,"/").concat(x,"/").concat(Se),he[Se]||(he[Se]=new tn)}var F,Q,te,ie=Z.trans,he=Z.mutatedParts||(Z.mutatedParts={}),ye=Y(""),Ee=Y(":dels"),Ae=Z.type,Re=Z.type==="deleteRange"?[Z.range]:Z.type==="delete"?[Z.keys]:Z.values.length<50?[us(M,Z).filter(function(Se){return Se}),Z.values]:[],we=Re[0],xe=Re[1],Re=Z.trans._cache;return p(we)?(ye.addKeys(we),(Re=Ae==="delete"||we.length===xe.length?ja(we,Re):null)||Ee.addKeys(we),(Re||xe)&&(F=Y,Q=Re,te=xe,T.indexes.forEach(function(Se){var Ce=F(Se.name||"");function He(Ge){return Ge!=null?Se.extractKey(Ge):null}function Fe(Ge){return Se.multiEntry&&p(Ge)?Ge.forEach(function(bn){return Ce.addKey(bn)}):Ce.addKey(Ge)}(Q||te).forEach(function(Ge,Bt){var Ye=Q&&He(Q[Bt]),Bt=te&&He(te[Bt]);nt(Ye,Bt)!==0&&(Ye!=null&&Fe(Ye),Bt!=null&&Fe(Bt))})}))):we?(xe={from:(xe=we.lower)!==null&&xe!==void 0?xe:c.MIN_KEY,to:(xe=we.upper)!==null&&xe!==void 0?xe:c.MAX_KEY},Ee.add(xe),ye.add(xe)):(ye.add(b),Ee.add(b),T.indexes.forEach(function(Se){return Y(Se.name).add(b)})),S.mutate(Z).then(function(Se){return!we||Z.type!=="add"&&Z.type!=="put"||(ye.addKeys(Se.results),q&&q.forEach(function(Ce){for(var He=Z.values.map(function(Ye){return Ce.extractKey(Ye)}),Fe=Ce.keyPath.findIndex(function(Ye){return Ye===M.keyPath}),Ge=0,bn=Se.results.length;Ge<bn;++Ge)He[Ge][Fe]=Se.results[Ge];Y(Ce.name).addKeys(He)})),ie.mutatedParts=is(ie.mutatedParts||{},he),Se})}}),U=function(Y){var F=Y.query,Y=F.index,F=F.range;return[Y,new tn((Y=F.lower)!==null&&Y!==void 0?Y:c.MIN_KEY,(F=F.upper)!==null&&F!==void 0?F:c.MAX_KEY)]},J={get:function(Z){return[M,new tn(Z.key)]},getMany:function(Z){return[M,new tn().addKeys(Z.keys)]},count:U,query:U,openCursor:U};return f(J).forEach(function(Z){X[Z]=function(Y){var F=ke.subscr,Q=!!F,te=pc(ke,S)&&mc(Z,Y)?Y.obsSet={}:F;if(Q){var ie=function(xe){return xe="idb://".concat(h,"/").concat(x,"/").concat(xe),te[xe]||(te[xe]=new tn)},he=ie(""),ye=ie(":dels"),F=J[Z](Y),Q=F[0],F=F[1];if((Z==="query"&&Q.isPrimaryKey&&!Y.values?ye:ie(Q.name||"")).add(F),!Q.isPrimaryKey){if(Z!=="count"){var Ee=Z==="query"&&$&&Y.values&&S.query(i(i({},Y),{values:!1}));return S[Z].apply(this,arguments).then(function(xe){if(Z==="query"){if($&&Y.values)return Ee.then(function(He){return He=He.result,he.addKeys(He),xe});var Re=Y.values?xe.result.map(z):xe.result;(Y.values?he:ye).addKeys(Re)}else if(Z==="openCursor"){var Se=xe,Ce=Y.values;return Se&&Object.create(Se,{key:{get:function(){return ye.addKey(Se.primaryKey),Se.key}},primaryKey:{get:function(){var He=Se.primaryKey;return ye.addKey(He),He}},value:{get:function(){return Ce&&he.addKey(Se.primaryKey),Se.value}}})}return xe})}ye.add(b)}}return S[Z].apply(this,arguments)}}),X}})}};function El(c,h,b){if(b.numFailures===0)return h;if(h.type==="deleteRange")return null;var x=h.keys?h.keys.length:"values"in h&&h.values?h.values.length:1;return b.numFailures===x?null:(h=i({},h),p(h.keys)&&(h.keys=h.keys.filter(function(S,T){return!(T in b.failures)})),"values"in h&&p(h.values)&&(h.values=h.values.filter(function(S,T){return!(T in b.failures)})),h)}function Ma(c,h){return b=c,((x=h).lower===void 0||(x.lowerOpen?0<nt(b,x.lower):0<=nt(b,x.lower)))&&(c=c,(h=h).upper===void 0||(h.upperOpen?nt(c,h.upper)<0:nt(c,h.upper)<=0));var b,x}function fi(c,h,J,x,S,T){if(!J||J.length===0)return c;var M=h.query.index,z=M.multiEntry,$=h.query.range,q=x.schema.primaryKey.extractKey,X=M.extractKey,U=(M.lowLevelIndex||M).extractKey,J=J.reduce(function(Z,Y){var F=Z,Q=[];if(Y.type==="add"||Y.type==="put")for(var te=new tn,ie=Y.values.length-1;0<=ie;--ie){var he,ye=Y.values[ie],Ee=q(ye);te.hasKey(Ee)||(he=X(ye),(z&&p(he)?he.some(function(Se){return Ma(Se,$)}):Ma(he,$))&&(te.addKey(Ee),Q.push(ye)))}switch(Y.type){case"add":var Ae=new tn().addKeys(h.values?Z.map(function(Ce){return q(Ce)}):Z),F=Z.concat(h.values?Q.filter(function(Ce){return Ce=q(Ce),!Ae.hasKey(Ce)&&(Ae.addKey(Ce),!0)}):Q.map(function(Ce){return q(Ce)}).filter(function(Ce){return!Ae.hasKey(Ce)&&(Ae.addKey(Ce),!0)}));break;case"put":var we=new tn().addKeys(Y.values.map(function(Ce){return q(Ce)}));F=Z.filter(function(Ce){return!we.hasKey(h.values?q(Ce):Ce)}).concat(h.values?Q:Q.map(function(Ce){return q(Ce)}));break;case"delete":var xe=new tn().addKeys(Y.keys);F=Z.filter(function(Ce){return!xe.hasKey(h.values?q(Ce):Ce)});break;case"deleteRange":var Re=Y.range;F=Z.filter(function(Ce){return!Ma(q(Ce),Re)})}return F},c);return J===c?c:(J.sort(function(Z,Y){return nt(U(Z),U(Y))||nt(q(Z),q(Y))}),h.limit&&h.limit<1/0&&(J.length>h.limit?J.length=h.limit:c.length===h.limit&&J.length<h.limit&&(S.dirty=!0)),T?Object.freeze(J):J)}function gc(c,h){return nt(c.lower,h.lower)===0&&nt(c.upper,h.upper)===0&&!!c.lowerOpen==!!h.lowerOpen&&!!c.upperOpen==!!h.upperOpen}function cs(c,h){return(function(b,x,S,T){if(b===void 0)return x!==void 0?-1:0;if(x===void 0)return 1;if((x=nt(b,x))===0){if(S&&T)return 0;if(S)return 1;if(T)return-1}return x})(c.lower,h.lower,c.lowerOpen,h.lowerOpen)<=0&&0<=(function(b,x,S,T){if(b===void 0)return x!==void 0?1:0;if(x===void 0)return-1;if((x=nt(b,x))===0){if(S&&T)return 0;if(S)return-1;if(T)return 1}return x})(c.upper,h.upper,c.upperOpen,h.upperOpen)}function vc(c,h,b,x){c.subscribers.add(b),x.addEventListener("abort",function(){var S,T;c.subscribers.delete(b),c.subscribers.size===0&&(S=c,T=h,setTimeout(function(){S.subscribers.size===0&&Me(T,S)},3e3))})}var bc={stack:"dbcore",level:0,name:"Cache",create:function(c){var h=c.schema.name;return i(i({},c),{transaction:function(b,x,S){var T,M,z=c.transaction(b,x,S);return x==="readwrite"&&(M=(T=new AbortController).signal,S=function($){return function(){if(T.abort(),x==="readwrite"){for(var q=new Set,X=0,U=b;X<U.length;X++){var J=U[X],Z=Da["idb://".concat(h,"/").concat(J)];if(Z){var Y=c.table(J),F=Z.optimisticOps.filter(function(Ce){return Ce.trans===z});if(z._explicit&&$&&z.mutatedParts)for(var Q=0,te=Object.values(Z.queries.query);Q<te.length;Q++)for(var ie=0,he=(Ae=te[Q]).slice();ie<he.length;ie++)vl((we=he[ie]).obsSet,z.mutatedParts)&&(Me(Ae,we),we.subscribers.forEach(function(Ce){return q.add(Ce)}));else if(0<F.length){Z.optimisticOps=Z.optimisticOps.filter(function(Ce){return Ce.trans!==z});for(var ye=0,Ee=Object.values(Z.queries.query);ye<Ee.length;ye++)for(var Ae,we,xe,Re=0,Se=(Ae=Ee[ye]).slice();Re<Se.length;Re++)(we=Se[Re]).res!=null&&z.mutatedParts&&($&&!we.dirty?(xe=Object.isFrozen(we.res),xe=fi(we.res,we.req,F,Y,we,xe),we.dirty?(Me(Ae,we),we.subscribers.forEach(function(Ce){return q.add(Ce)})):xe!==we.res&&(we.res=xe,we.promise=De.resolve({result:xe}))):(we.dirty&&Me(Ae,we),we.subscribers.forEach(function(Ce){return q.add(Ce)})))}}}q.forEach(function(Ce){return Ce()})}}},z.addEventListener("abort",S(!1),{signal:M}),z.addEventListener("error",S(!1),{signal:M}),z.addEventListener("complete",S(!0),{signal:M})),z},table:function(b){var x=c.table(b),S=x.schema.primaryKey;return i(i({},x),{mutate:function(T){var M=ke.trans;if(S.outbound||M.db._options.cache==="disabled"||M.explicit||M.idbtrans.mode!=="readwrite")return x.mutate(T);var z=Da["idb://".concat(h,"/").concat(b)];return z?(M=x.mutate(T),T.type!=="add"&&T.type!=="put"||!(50<=T.values.length||us(S,T).some(function($){return $==null}))?(z.optimisticOps.push(T),T.mutatedParts&&os(T.mutatedParts),M.then(function($){0<$.numFailures&&(Me(z.optimisticOps,T),($=El(0,T,$))&&z.optimisticOps.push($),T.mutatedParts&&os(T.mutatedParts))}),M.catch(function(){Me(z.optimisticOps,T),T.mutatedParts&&os(T.mutatedParts)})):M.then(function($){var q=El(0,i(i({},T),{values:T.values.map(function(X,U){var J;return $.failures[U]?X:(X=(J=S.keyPath)!==null&&J!==void 0&&J.includes(".")?Ht(X):i({},X),ue(X,S.keyPath,$.results[U]),X)})}),$);z.optimisticOps.push(q),queueMicrotask(function(){return T.mutatedParts&&os(T.mutatedParts)})}),M):x.mutate(T)},query:function(T){if(!pc(ke,x)||!mc("query",T))return x.query(T);var M=((q=ke.trans)===null||q===void 0?void 0:q.db._options.cache)==="immutable",U=ke,z=U.requery,$=U.signal,q=(function(Y,F,Q,te){var ie=Da["idb://".concat(Y,"/").concat(F)];if(!ie)return[];if(!(F=ie.queries[Q]))return[null,!1,ie,null];var he=F[(te.query?te.query.index.name:null)||""];if(!he)return[null,!1,ie,null];switch(Q){case"query":var ye=he.find(function(Ee){return Ee.req.limit===te.limit&&Ee.req.values===te.values&&gc(Ee.req.query.range,te.query.range)});return ye?[ye,!0,ie,he]:[he.find(function(Ee){return("limit"in Ee.req?Ee.req.limit:1/0)>=te.limit&&(!te.values||Ee.req.values)&&cs(Ee.req.query.range,te.query.range)}),!1,ie,he];case"count":return ye=he.find(function(Ee){return gc(Ee.req.query.range,te.query.range)}),[ye,!!ye,ie,he]}})(h,b,"query",T),X=q[0],U=q[1],J=q[2],Z=q[3];return X&&U?X.obsSet=T.obsSet:(U=x.query(T).then(function(Y){var F=Y.result;if(X&&(X.res=F),M){for(var Q=0,te=F.length;Q<te;++Q)Object.freeze(F[Q]);Object.freeze(F)}else Y.result=Ht(F);return Y}).catch(function(Y){return Z&&X&&Me(Z,X),Promise.reject(Y)}),X={obsSet:T.obsSet,promise:U,subscribers:new Set,type:"query",req:T,dirty:!1},Z?Z.push(X):(Z=[X],(J=J||(Da["idb://".concat(h,"/").concat(b)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[T.query.index.name||""]=Z)),vc(X,Z,z,$),X.promise.then(function(Y){return{result:fi(Y.result,T,J?.optimisticOps,x,X,M)}})}})}})}};function di(c,h){return new Proxy(c,{get:function(b,x,S){return x==="db"?h:Reflect.get(b,x,S)}})}var or=(jt.prototype.version=function(c){if(isNaN(c)||c<.1)throw new je.Type("Given version is not a positive number");if(c=Math.round(10*c)/10,this.idbdb||this._state.isBeingOpened)throw new je.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,c);var h=this._versions,b=h.filter(function(x){return x._cfg.version===c})[0];return b||(b=new this.Version(c),h.push(b),h.sort(es),b.stores({}),this._state.autoSchema=!1,b)},jt.prototype._whenReady=function(c){var h=this;return this.idbdb&&(this._state.openComplete||ke.letThrough||this._vip)?c():new De(function(b,x){if(h._state.openComplete)return x(new je.DatabaseClosed(h._state.dbOpenError));if(!h._state.isBeingOpened){if(!h._state.autoOpen)return void x(new je.DatabaseClosed);h.open().catch($e)}h._state.dbReadyPromise.then(b,x)}).then(c)},jt.prototype.use=function(c){var h=c.stack,b=c.create,x=c.level,S=c.name;return S&&this.unuse({stack:h,name:S}),c=this._middlewares[h]||(this._middlewares[h]=[]),c.push({stack:h,create:b,level:x??10,name:S}),c.sort(function(T,M){return T.level-M.level}),this},jt.prototype.unuse=function(c){var h=c.stack,b=c.name,x=c.create;return h&&this._middlewares[h]&&(this._middlewares[h]=this._middlewares[h].filter(function(S){return x?S.create!==x:!!b&&S.name!==b})),this},jt.prototype.open=function(){var c=this;return Fr(yn,function(){return so(c)})},jt.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var c=this._state,h=Nr.indexOf(this);if(0<=h&&Nr.splice(h,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}c.isBeingOpened||(c.dbReadyPromise=new De(function(b){c.dbReadyResolve=b}),c.openCanceller=new De(function(b,x){c.cancelOpen=x}))},jt.prototype.close=function(b){var h=(b===void 0?{disableAutoOpen:!0}:b).disableAutoOpen,b=this._state;h?(b.isBeingOpened&&b.cancelOpen(new je.DatabaseClosed),this._close(),b.autoOpen=!1,b.dbOpenError=new je.DatabaseClosed):(this._close(),b.autoOpen=this._options.autoOpen||b.isBeingOpened,b.openComplete=!1,b.dbOpenError=null)},jt.prototype.delete=function(c){var h=this;c===void 0&&(c={disableAutoOpen:!0});var b=0<arguments.length&&typeof arguments[0]!="object",x=this._state;return new De(function(S,T){function M(){h.close(c);var z=h._deps.indexedDB.deleteDatabase(h.name);z.onsuccess=Je(function(){var $,q,X;$=h._deps,q=h.name,X=$.indexedDB,$=$.IDBKeyRange,ml(X)||q===Sa||pl(X,$).delete(q).catch($e),S()}),z.onerror=ir(T),z.onblocked=h._fireOnBlocked}if(b)throw new je.InvalidArgument("Invalid closeOptions argument to db.delete()");x.isBeingOpened?x.dbReadyPromise.then(M):M()})},jt.prototype.backendDB=function(){return this.idbdb},jt.prototype.isOpen=function(){return this.idbdb!==null},jt.prototype.hasBeenClosed=function(){var c=this._state.dbOpenError;return c&&c.name==="DatabaseClosed"},jt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},jt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(jt.prototype,"tables",{get:function(){var c=this;return f(this._allTables).map(function(h){return c._allTables[h]})},enumerable:!1,configurable:!0}),jt.prototype.transaction=function(){var c=(function(h,b,x){var S=arguments.length;if(S<2)throw new je.InvalidArgument("Too few arguments");for(var T=new Array(S-1);--S;)T[S-1]=arguments[S];return x=T.pop(),[h,Be(T),x]}).apply(this,arguments);return this._transaction.apply(this,c)},jt.prototype._transaction=function(c,h,b){var x=this,S=ke.trans;S&&S.db===this&&c.indexOf("!")===-1||(S=null);var T,M,z=c.indexOf("?")!==-1;c=c.replace("!","").replace("?","");try{if(M=h.map(function(q){if(q=q instanceof x.Table?q.name:q,typeof q!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return q}),c=="r"||c===ar)T=ar;else{if(c!="rw"&&c!=Gi)throw new je.InvalidArgument("Invalid transaction mode: "+c);T=Gi}if(S){if(S.mode===ar&&T===Gi){if(!z)throw new je.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");S=null}S&&M.forEach(function(q){if(S&&S.storeNames.indexOf(q)===-1){if(!z)throw new je.SubTransaction("Table "+q+" not included in parent transaction.");S=null}}),z&&S&&!S.active&&(S=null)}}catch(q){return S?S._promise(null,function(X,U){U(q)}):Lt(q)}var $=(function q(X,U,J,Z,Y){return De.resolve().then(function(){var F=ke.transless||ke,Q=X._createTransaction(U,J,X._dbSchema,Z);if(Q.explicit=!0,F={trans:Q,transless:F},Z)Q.idbtrans=Z.idbtrans;else try{Q.create(),Q.idbtrans._explicit=!0,X._state.PR1398_maxLoop=3}catch(he){return he.name===Le.InvalidState&&X.isOpen()&&0<--X._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),X.close({disableAutoOpen:!1}),X.open().then(function(){return q(X,U,J,null,Y)})):Lt(he)}var te,ie=k(Y);return ie&&rr(),F=De.follow(function(){var he;(te=Y.call(Q,Q))&&(ie?(he=Bn.bind(null,null),te.then(he,he)):typeof te.next=="function"&&typeof te.throw=="function"&&(te=Sl(te)))},F),(te&&typeof te.then=="function"?De.resolve(te).then(function(he){return Q.active?he:Lt(new je.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):F.then(function(){return te})).then(function(he){return Z&&Q._resolve(),Q._completion.then(function(){return he})}).catch(function(he){return Q._reject(he),Lt(he)})})}).bind(null,this,T,M,S,b);return S?S._promise(T,$,"lock"):ke.trans?Fr(ke.transless,function(){return x._whenReady($)}):this._whenReady($)},jt.prototype.table=function(c){if(!w(this._allTables,c))throw new je.InvalidTable("Table ".concat(c," does not exist"));return this._allTables[c]},jt);function jt(c,h){var b=this;this._middlewares={},this.verno=0;var x=jt.dependencies;this._options=h=i({addons:jt.addons,autoOpen:!0,indexedDB:x.indexedDB,IDBKeyRange:x.IDBKeyRange,cache:"cloned"},h),this._deps={indexedDB:h.indexedDB,IDBKeyRange:h.IDBKeyRange},x=h.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var S,T,M,z,$,q={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:$e,dbReadyPromise:null,cancelOpen:$e,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:h.autoOpen};q.dbReadyPromise=new De(function(U){q.dbReadyResolve=U}),q.openCanceller=new De(function(U,J){q.cancelOpen=J}),this._state=q,this.name=c,this.on=gn(this,"populate","blocked","versionchange","close",{ready:[Yn,$e]}),this.once=function(U,J){var Z=function(){for(var Y=[],F=0;F<arguments.length;F++)Y[F]=arguments[F];b.on(U).unsubscribe(Z),J.apply(b,Y)};return b.on(U,Z)},this.on.ready.subscribe=L(this.on.ready.subscribe,function(U){return function(J,Z){jt.vip(function(){var Y,F=b._state;F.openComplete?(F.dbOpenError||De.resolve().then(J),Z&&U(J)):F.onReadyBeingFired?(F.onReadyBeingFired.push(J),Z&&U(J)):(U(J),Y=b,Z||U(function Q(){Y.on.ready.unsubscribe(J),Y.on.ready.unsubscribe(Q)}))})}}),this.Collection=(S=this,_a(oc.prototype,function(te,Q){this.db=S;var Z=Ea,Y=null;if(Q)try{Z=Q()}catch(ie){Y=ie}var F=te._ctx,Q=F.table,te=Q.hook.reading.fire;this._ctx={table:Q,index:F.index,isPrimKey:!F.index||Q.schema.primKey.keyPath&&F.index===Q.schema.primKey.name,range:Z,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:Y,or:F.or,valueMapper:te!==Ft?te:null}})),this.Table=(T=this,_a(Ji.prototype,function(U,J,Z){this.db=T,this._tx=Z,this.name=U,this.schema=J,this.hook=T._allTables[U]?T._allTables[U].hook:gn(null,{creating:[nr,$e],reading:[ft,Ft],updating:[$r,$e],deleting:[st,$e]})})),this.Transaction=(M=this,_a(ta.prototype,function(U,J,Z,Y,F){var Q=this;U!=="readonly"&&J.forEach(function(te){te=(te=Z[te])===null||te===void 0?void 0:te.yProps,te&&(J=J.concat(te.map(function(ie){return ie.updatesTable})))}),this.db=M,this.mode=U,this.storeNames=J,this.schema=Z,this.chromeTransactionDurability=Y,this.idbtrans=null,this.on=gn(this,"complete","error","abort"),this.parent=F||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new De(function(te,ie){Q._resolve=te,Q._reject=ie}),this._completion.then(function(){Q.active=!1,Q.on.complete.fire()},function(te){var ie=Q.active;return Q.active=!1,Q.on.error.fire(te),Q.parent?Q.parent._reject(te):ie&&Q.idbtrans&&Q.idbtrans.abort(),Lt(te)})})),this.Version=(z=this,_a(Nd.prototype,function(U){this.db=z,this._cfg={version:U,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=($=this,_a(cl.prototype,function(U,J,Z){if(this.db=$,this._ctx={table:U,index:J===":id"?null:J,or:Z},this._cmp=this._ascending=nt,this._descending=function(Y,F){return nt(F,Y)},this._max=function(Y,F){return 0<nt(Y,F)?Y:F},this._min=function(Y,F){return nt(Y,F)<0?Y:F},this._IDBKeyRange=$._deps.IDBKeyRange,!this._IDBKeyRange)throw new je.MissingAPI})),this.on("versionchange",function(U){0<U.newVersion?console.warn("Another connection wants to upgrade database '".concat(b.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(b.name,"'. Closing db now to resume the delete request.")),b.close({disableAutoOpen:!1})}),this.on("blocked",function(U){!U.newVersion||U.newVersion<U.oldVersion?console.warn("Dexie.delete('".concat(b.name,"') was blocked")):console.warn("Upgrade '".concat(b.name,"' blocked by other connection holding version ").concat(U.oldVersion/10))}),this._maxKey=na(h.IDBKeyRange),this._createTransaction=function(U,J,Z,Y){return new b.Transaction(U,J,Z,b._options.chromeTransactionDurability,Y)},this._fireOnBlocked=function(U){b.on("blocked").fire(U),Nr.filter(function(J){return J.name===b.name&&J!==b&&!J._state.vcFired}).map(function(J){return J.on("versionchange").fire(U)})},this.use(zd),this.use(bc),this.use(yc),this.use(dc),this.use(hc);var X=new Proxy(this,{get:function(U,J,Z){if(J==="_vip")return!0;if(J==="table")return function(F){return di(b.table(F),X)};var Y=Reflect.get(U,J,Z);return Y instanceof Ji?di(Y,X):J==="tables"?Y.map(function(F){return di(F,X)}):J==="_createTransaction"?function(){return di(Y.apply(this,arguments),X)}:Y}});this.vip=X,x.forEach(function(U){return U(b)})}var uo,Hn=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Pd=(_l.prototype.subscribe=function(c,h,b){return this._subscribe(c&&typeof c!="function"?c:{next:c,error:h,complete:b})},_l.prototype[Hn]=function(){return this},_l);function _l(c){this._subscribe=c}try{uo={indexedDB:u.indexedDB||u.mozIndexedDB||u.webkitIndexedDB||u.msIndexedDB,IDBKeyRange:u.IDBKeyRange||u.webkitIDBKeyRange}}catch{uo={indexedDB:null,IDBKeyRange:null}}function xc(c){var h,b=!1,x=new Pd(function(S){var T=k(c),M,z=!1,$={},q={},X={get closed(){return z},unsubscribe:function(){z||(z=!0,M&&M.abort(),U&&Fn.storagemutated.unsubscribe(Z))}};S.start&&S.start(X);var U=!1,J=function(){return Xr(Y)},Z=function(F){is($,F),vl(q,$)&&J()},Y=function(){var F,Q,te;!z&&uo.indexedDB&&($={},F={},M&&M.abort(),M=new AbortController,te=(function(ie){var he=wa();try{T&&rr();var ye=yr(c,ie);return ye=T?ye.finally(Bn):ye}finally{he&&ri()}})(Q={subscr:F,signal:M.signal,requery:J,querier:c,trans:null}),Promise.resolve(te).then(function(ie){b=!0,h=ie,z||Q.signal.aborted||($={},(function(he){for(var ye in he)if(w(he,ye))return;return 1})(q=F)||U||(Fn(In,Z),U=!0),Xr(function(){return!z&&S.next&&S.next(ie)}))},function(ie){b=!1,["DatabaseClosedError","AbortError"].includes(ie?.name)||z||Xr(function(){z||S.error&&S.error(ie)})}))};return setTimeout(J,0),X});return x.hasValue=function(){return b},x.getValue=function(){return h},x}var ka=or;function Tl(c){var h=Xn;try{Xn=!0,Fn.storagemutated.fire(c),wl(c,!0)}finally{Xn=h}}_(ka,i(i({},zt),{delete:function(c){return new ka(c,{addons:[]}).delete()},exists:function(c){return new ka(c,{addons:[]}).open().then(function(h){return h.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(c){try{return h=ka.dependencies,b=h.indexedDB,h=h.IDBKeyRange,(ml(b)?Promise.resolve(b.databases()).then(function(x){return x.map(function(S){return S.name}).filter(function(S){return S!==Sa})}):pl(b,h).toCollection().primaryKeys()).then(c)}catch{return Lt(new je.MissingAPI)}var h,b},defineClass:function(){return function(c){y(this,c)}},ignoreTransaction:function(c){return ke.trans?Fr(ke.transless,c):c()},vip:yl,async:function(c){return function(){try{var h=Sl(c.apply(this,arguments));return h&&typeof h.then=="function"?h:De.resolve(h)}catch(b){return Lt(b)}}},spawn:function(c,h,b){try{var x=Sl(c.apply(b,h||[]));return x&&typeof x.then=="function"?x:De.resolve(x)}catch(S){return Lt(S)}},currentTransaction:{get:function(){return ke.trans||null}},waitFor:function(c,h){return h=De.resolve(typeof c=="function"?ka.ignoreTransaction(c):c).timeout(h||6e4),ke.trans?ke.trans.waitFor(h):h},Promise:De,debug:{get:function(){return ln},set:function(c){Ln(c)}},derive:j,extend:y,props:_,override:L,Events:gn,on:Fn,liveQuery:xc,extendObservabilitySet:is,getByKeyPath:fe,setByKeyPath:ue,delByKeyPath:function(c,h){typeof h=="string"?ue(c,h,void 0):"length"in h&&[].map.call(h,function(b){ue(c,b,void 0)})},shallowClone:le,deepClone:Ht,getObjectDiff:ls,cmp:nt,asap:ee,minKey:-1/0,addons:[],connections:Nr,errnames:Le,dependencies:uo,cache:Da,semVer:"4.2.1",version:"4.2.1".split(".").map(function(c){return parseInt(c)}).reduce(function(c,h,b){return c+h/Math.pow(10,2*b)})})),ka.maxKey=na(ka.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Fn(In,function(c){Xn||(c=new CustomEvent(no,{detail:c}),Xn=!0,dispatchEvent(c),Xn=!1)}),addEventListener(no,function(c){c=c.detail,Xn||Tl(c)}));var nn,Xn=!1,Al=function(){};return typeof BroadcastChannel<"u"&&((Al=function(){(nn=new BroadcastChannel(no)).onmessage=function(c){return c.data&&Tl(c.data)}})(),typeof nn.unref=="function"&&nn.unref(),Fn(In,function(c){Xn||nn.postMessage(c)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(c){if(!or.disableBfCache&&c.persisted){ln&&console.debug("Dexie: handling persisted pagehide"),nn?.close();for(var h=0,b=Nr;h<b.length;h++)b[h].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(c){!or.disableBfCache&&c.persisted&&(ln&&console.debug("Dexie: handling persisted pageshow"),Al(),Tl({all:new tn(-1/0,[[]])}))})),De.rejectionMapper=function(c,h){return!c||c instanceof I||c instanceof TypeError||c instanceof SyntaxError||!c.name||!mn[c.name]?c:(h=new mn[c.name](h||c.message,c),"stack"in c&&A(h,"stack",{get:function(){return this.inner.stack}}),h)},Ln(ln),i(or,Object.freeze({__proto__:null,Dexie:or,liveQuery:xc,Entity:Qo,cmp:nt,PropModification:Qi,replacePrefix:function(c,h){return new Qi({replacePrefix:[c,h]})},add:function(c){return new Qi({add:c})},remove:function(c){return new Qi({remove:c})},default:or,RangeSet:tn,mergeRanges:io,rangesOverlap:uc}),{default:or}),or})})(Hf)),Hf.exports}var OM=CM();const Am=Cx(OM),k1=Symbol.for("Dexie"),Vu=globalThis[k1]||(globalThis[k1]=Am);if(Am.semVer!==Vu.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Am.semVer} and ${Vu.semVer}`);const{liveQuery:G6,mergeRanges:X6,rangesOverlap:Q6,RangeSet:W6,cmp:J6,Entity:eB,PropModification:tB,replacePrefix:nB,add:rB,remove:aB,DexieYProvider:iB}=Vu;class DM extends Vu{projects;layers;viewStates;history;activeProject;constructor(){super("EditorDB"),this.version(1).stores({projects:"id, name, createdAt, updatedAt"}),this.version(2).stores({projects:"id, name, width, height, createdAt, updatedAt"}).upgrade(async n=>{await n.table("projects").toCollection().modify(i=>{i.width===void 0&&(i.width=800),i.height===void 0&&(i.height=600)})}),this.version(3).stores({layers:"id, projectId, name, zIndex, visible, opacity, createdAt, updatedAt, snapshot"}),this.version(4).stores({viewStates:"projectId"}),this.version(5).stores({history:"id, timestamp, state.projectId"}),this.version(6).stores({activeProject:"id, projectId"}),this.projects=this.table("projects"),this.layers=this.table("layers"),this.viewStates=this.table("viewStates"),this.history=this.table("history"),this.activeProject=this.table("activeProject")}}const fa=new DM,ua={async getById(e){return To.get(e)},async getAllByProject(e){return To.where(`${Ir.PROJECT_ID}`).equals(e).sortBy(`${Ir.Z_INDEX}`)},async getMaxZIndex(e){const n=await To.where(`${Ir.PROJECT_ID}`).equals(e).toArray();return n.length?Math.max(...n.map(a=>a.zIndex)):0},async add(e){await To.put(e)},async update(e,n){await To.update(e,n)},async remove(e){await To.delete(e)},async removeByProject(e){await To.where(`${Ir.PROJECT_ID}`).equals(e).delete()}},To=fa.layers,Oo={async add(e){await pu.put(e)},async getByProject(e){return pu.where(`${Ir.STATE_PROJECT_ID}`).equals(e).sortBy(`${Ir.TIMESTAMP}`)},async deleteById(e){await pu.where(Ir.ID).equals(e).delete()},async deleteAfterIndex(e,n){const i=(await this.getByProject(e)).slice(n+1);i.length!==0&&await Promise.all(i.map(l=>this.deleteById(l.id)))},async clearByProject(e){await pu.where(`${Ir.STATE_PROJECT_ID}`).equals(e).delete()},async clearAll(){await pu.clear()}},pu=fa.table(`${dr.HISTORY}`),Ao=fa.projects,Tr={async getAll(){return Ao.orderBy(Ir.UPDATED_AT).reverse().toArray()},async getById(e){return Ao.get(e)},async exists(e){return!!await Ao.get(e)},async findByName(e){return Ao.where(Ir.NAME).equalsIgnoreCase(e).first()},async add(e){await Ao.put(e)},async update(e,n){await Ao.update(e,n)},async remove(e){await Ao.delete(e)}},Mo={async getProjects(){return Tr.getAll()},async createProject(e){const n=e.name.trim();if(!n)throw new Error(qn.NAME_EMPTY);if(await Tr.findByName(n))throw new Error(qn.NAME_DUPLICATE);const i={id:Uo(),name:n,width:e.width??800,height:e.height??600,createdAt:Date.now(),updatedAt:Date.now()};return await Tr.add(i),i},async updateProject(e){const{id:n,changes:a}=e;await Tr.update(n,{...a,updatedAt:Date.now()});const i=await Tr.getById(n);if(!i)throw new Error(qn.NOT_FOUND_AFTER_UPDATE);return i},async deleteWithRelations(e){return await fa.transaction("rw",fa.projects,fa.layers,fa.viewStates,fa.history,async()=>{await Tr.remove(e),await ua.removeByProject(e),await fa.viewStates.where(Ir.PROJECT_ID).equals(e).delete(),await Oo.clearByProject(e)}),e},async clearAll(){const e=await Tr.getAll();for(const n of e)await this.deleteWithRelations(n.id)},async getById(e){return Tr.getById(e)},async exists(e){return Tr.exists(e)},async findByName(e){return Tr.findByName(e)}};function On(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var jM=typeof Symbol=="function"&&Symbol.observable||"@@observable",N1=jM,$p=()=>Math.random().toString(36).substring(7).split("").join("."),MM={INIT:`@@redux/INIT${$p()}`,REPLACE:`@@redux/REPLACE${$p()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${$p()}`},Xf=MM;function Dy(e){if(typeof e!="object"||e===null)return!1;let n=e;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n||Object.getPrototypeOf(e)===null}function LS(e,n,a){if(typeof e!="function")throw new Error(On(2));if(typeof n=="function"&&typeof a=="function"||typeof a=="function"&&typeof arguments[3]=="function")throw new Error(On(0));if(typeof n=="function"&&typeof a>"u"&&(a=n,n=void 0),typeof a<"u"){if(typeof a!="function")throw new Error(On(1));return a(LS)(e,n)}let i=e,l=n,u=new Map,f=u,p=0,y=!1;function g(){f===u&&(f=new Map,u.forEach((N,P)=>{f.set(P,N)}))}function v(){if(y)throw new Error(On(3));return l}function w(N){if(typeof N!="function")throw new Error(On(4));if(y)throw new Error(On(5));let P=!0;g();const H=p++;return f.set(H,N),function(){if(P){if(y)throw new Error(On(6));P=!1,g(),f.delete(H),u=null}}}function _(N){if(!Dy(N))throw new Error(On(7));if(typeof N.type>"u")throw new Error(On(8));if(typeof N.type!="string")throw new Error(On(17));if(y)throw new Error(On(9));try{y=!0,l=i(l,N)}finally{y=!1}return(u=f).forEach(H=>{H()}),N}function O(N){if(typeof N!="function")throw new Error(On(10));i=N,_({type:Xf.REPLACE})}function A(){const N=w;return{subscribe(P){if(typeof P!="object"||P===null)throw new Error(On(11));function H(){const ae=P;ae.next&&ae.next(v())}return H(),{unsubscribe:N(H)}},[N1](){return this}}}return _({type:Xf.INIT}),{dispatch:_,subscribe:w,getState:v,replaceReducer:O,[N1]:A}}function kM(e){Object.keys(e).forEach(n=>{const a=e[n];if(typeof a(void 0,{type:Xf.INIT})>"u")throw new Error(On(12));if(typeof a(void 0,{type:Xf.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(On(13))})}function NM(e){const n=Object.keys(e),a={};for(let u=0;u<n.length;u++){const f=n[u];typeof e[f]=="function"&&(a[f]=e[f])}const i=Object.keys(a);let l;try{kM(a)}catch(u){l=u}return function(f={},p){if(l)throw l;let y=!1;const g={};for(let v=0;v<i.length;v++){const w=i[v],_=a[w],O=f[w],A=_(O,p);if(typeof A>"u")throw p&&p.type,new Error(On(14));g[w]=A,y=y||A!==O}return y=y||i.length!==Object.keys(f).length,y?g:f}}function Qf(...e){return e.length===0?n=>n:e.length===1?e[0]:e.reduce((n,a)=>(...i)=>n(a(...i)))}function zM(...e){return n=>(a,i)=>{const l=n(a,i);let u=()=>{throw new Error(On(15))};const f={getState:l.getState,dispatch:(y,...g)=>u(y,...g)},p=e.map(y=>y(f));return u=Qf(...p)(l.dispatch),{...l,dispatch:u}}}function jy(e){return Dy(e)&&"type"in e&&typeof e.type=="string"}var BS=Symbol.for("immer-nothing"),z1=Symbol.for("immer-draftable"),pr=Symbol.for("immer-state");function Vr(e,...n){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Gs=Object.getPrototypeOf;function ma(e){return!!e&&!!e[pr]}function ti(e){return e?US(e)||Array.isArray(e)||!!e[z1]||!!e.constructor?.[z1]||tc(e)||vd(e):!1}var PM=Object.prototype.constructor.toString();function US(e){if(!e||typeof e!="object")return!1;const n=Gs(e);if(n===null)return!0;const a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object?!0:typeof a=="function"&&Function.toString.call(a)===PM}function Wf(e,n){gd(e)===0?Reflect.ownKeys(e).forEach(a=>{n(a,e[a],e)}):e.forEach((a,i)=>n(i,a,e))}function gd(e){const n=e[pr];return n?n.type_:Array.isArray(e)?1:tc(e)?2:vd(e)?3:0}function Rm(e,n){return gd(e)===2?e.has(n):Object.prototype.hasOwnProperty.call(e,n)}function VS(e,n,a){const i=gd(e);i===2?e.set(n,a):i===3?e.add(a):e[n]=a}function LM(e,n){return e===n?e!==0||1/e===1/n:e!==e&&n!==n}function tc(e){return e instanceof Map}function vd(e){return e instanceof Set}function Co(e){return e.copy_||e.base_}function Cm(e,n){if(tc(e))return new Map(e);if(vd(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const a=US(e);if(n===!0||n==="class_only"&&!a){const i=Object.getOwnPropertyDescriptors(e);delete i[pr];let l=Reflect.ownKeys(i);for(let u=0;u<l.length;u++){const f=l[u],p=i[f];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(i[f]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[f]})}return Object.create(Gs(e),i)}else{const i=Gs(e);if(i!==null&&a)return{...e};const l=Object.create(i);return Object.assign(l,e)}}function My(e,n=!1){return bd(e)||ma(e)||!ti(e)||(gd(e)>1&&Object.defineProperties(e,{set:{value:_f},add:{value:_f},clear:{value:_f},delete:{value:_f}}),Object.freeze(e),n&&Object.values(e).forEach(a=>My(a,!0))),e}function _f(){Vr(2)}function bd(e){return Object.isFrozen(e)}var BM={};function Vo(e){const n=BM[e];return n||Vr(0,e),n}var Iu;function IS(){return Iu}function UM(e,n){return{drafts_:[],parent_:e,immer_:n,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function P1(e,n){n&&(Vo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=n)}function Om(e){Dm(e),e.drafts_.forEach(VM),e.drafts_=null}function Dm(e){e===Iu&&(Iu=e.parent_)}function L1(e){return Iu=UM(Iu,e)}function VM(e){const n=e[pr];n.type_===0||n.type_===1?n.revoke_():n.revoked_=!0}function B1(e,n){n.unfinalizedDrafts_=n.drafts_.length;const a=n.drafts_[0];return e!==void 0&&e!==a?(a[pr].modified_&&(Om(n),Vr(4)),ti(e)&&(e=Jf(n,e),n.parent_||ed(n,e)),n.patches_&&Vo("Patches").generateReplacementPatches_(a[pr].base_,e,n.patches_,n.inversePatches_)):e=Jf(n,a,[]),Om(n),n.patches_&&n.patchListener_(n.patches_,n.inversePatches_),e!==BS?e:void 0}function Jf(e,n,a){if(bd(n))return n;const i=n[pr];if(!i)return Wf(n,(l,u)=>U1(e,i,n,l,u,a)),n;if(i.scope_!==e)return n;if(!i.modified_)return ed(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const l=i.copy_;let u=l,f=!1;i.type_===3&&(u=new Set(l),l.clear(),f=!0),Wf(u,(p,y)=>U1(e,i,l,p,y,a,f)),ed(e,l,!1),a&&e.patches_&&Vo("Patches").generatePatches_(i,a,e.patches_,e.inversePatches_)}return i.copy_}function U1(e,n,a,i,l,u,f){if(ma(l)){const p=u&&n&&n.type_!==3&&!Rm(n.assigned_,i)?u.concat(i):void 0,y=Jf(e,l,p);if(VS(a,i,y),ma(y))e.canAutoFreeze_=!1;else return}else f&&a.add(l);if(ti(l)&&!bd(l)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Jf(e,l),(!n||!n.scope_.parent_)&&typeof i!="symbol"&&(tc(a)?a.has(i):Object.prototype.propertyIsEnumerable.call(a,i))&&ed(e,l)}}function ed(e,n,a=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&My(n,a)}function IM(e,n){const a=Array.isArray(e),i={type_:a?1:0,scope_:n?n.scope_:IS(),modified_:!1,finalized_:!1,assigned_:{},parent_:n,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let l=i,u=ky;a&&(l=[i],u=Hu);const{revoke:f,proxy:p}=Proxy.revocable(l,u);return i.draft_=p,i.revoke_=f,p}var ky={get(e,n){if(n===pr)return e;const a=Co(e);if(!Rm(a,n))return HM(e,a,n);const i=a[n];return e.finalized_||!ti(i)?i:i===qp(e.base_,n)?(Zp(e),e.copy_[n]=Mm(i,e)):i},has(e,n){return n in Co(e)},ownKeys(e){return Reflect.ownKeys(Co(e))},set(e,n,a){const i=HS(Co(e),n);if(i?.set)return i.set.call(e.draft_,a),!0;if(!e.modified_){const l=qp(Co(e),n),u=l?.[pr];if(u&&u.base_===a)return e.copy_[n]=a,e.assigned_[n]=!1,!0;if(LM(a,l)&&(a!==void 0||Rm(e.base_,n)))return!0;Zp(e),jm(e)}return e.copy_[n]===a&&(a!==void 0||n in e.copy_)||Number.isNaN(a)&&Number.isNaN(e.copy_[n])||(e.copy_[n]=a,e.assigned_[n]=!0),!0},deleteProperty(e,n){return qp(e.base_,n)!==void 0||n in e.base_?(e.assigned_[n]=!1,Zp(e),jm(e)):delete e.assigned_[n],e.copy_&&delete e.copy_[n],!0},getOwnPropertyDescriptor(e,n){const a=Co(e),i=Reflect.getOwnPropertyDescriptor(a,n);return i&&{writable:!0,configurable:e.type_!==1||n!=="length",enumerable:i.enumerable,value:a[n]}},defineProperty(){Vr(11)},getPrototypeOf(e){return Gs(e.base_)},setPrototypeOf(){Vr(12)}},Hu={};Wf(ky,(e,n)=>{Hu[e]=function(){return arguments[0]=arguments[0][0],n.apply(this,arguments)}});Hu.deleteProperty=function(e,n){return Hu.set.call(this,e,n,void 0)};Hu.set=function(e,n,a){return ky.set.call(this,e[0],n,a,e[0])};function qp(e,n){const a=e[pr];return(a?Co(a):e)[n]}function HM(e,n,a){const i=HS(n,a);return i?"value"in i?i.value:i.get?.call(e.draft_):void 0}function HS(e,n){if(!(n in e))return;let a=Gs(e);for(;a;){const i=Object.getOwnPropertyDescriptor(a,n);if(i)return i;a=Gs(a)}}function jm(e){e.modified_||(e.modified_=!0,e.parent_&&jm(e.parent_))}function Zp(e){e.copy_||(e.copy_=Cm(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var $M=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(n,a,i)=>{if(typeof n=="function"&&typeof a!="function"){const u=a;a=n;const f=this;return function(y=u,...g){return f.produce(y,v=>a.call(this,v,...g))}}typeof a!="function"&&Vr(6),i!==void 0&&typeof i!="function"&&Vr(7);let l;if(ti(n)){const u=L1(this),f=Mm(n,void 0);let p=!0;try{l=a(f),p=!1}finally{p?Om(u):Dm(u)}return P1(u,i),B1(l,u)}else if(!n||typeof n!="object"){if(l=a(n),l===void 0&&(l=n),l===BS&&(l=void 0),this.autoFreeze_&&My(l,!0),i){const u=[],f=[];Vo("Patches").generateReplacementPatches_(n,l,u,f),i(u,f)}return l}else Vr(1,n)},this.produceWithPatches=(n,a)=>{if(typeof n=="function")return(f,...p)=>this.produceWithPatches(f,y=>n(y,...p));let i,l;return[this.produce(n,a,(f,p)=>{i=f,l=p}),i,l]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ti(e)||Vr(8),ma(e)&&(e=Ny(e));const n=L1(this),a=Mm(e,void 0);return a[pr].isManual_=!0,Dm(n),a}finishDraft(e,n){const a=e&&e[pr];(!a||!a.isManual_)&&Vr(9);const{scope_:i}=a;return P1(i,n),B1(void 0,i)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,n){let a;for(a=n.length-1;a>=0;a--){const l=n[a];if(l.path.length===0&&l.op==="replace"){e=l.value;break}}a>-1&&(n=n.slice(a+1));const i=Vo("Patches").applyPatches_;return ma(e)?i(e,n):this.produce(e,l=>i(l,n))}};function Mm(e,n){const a=tc(e)?Vo("MapSet").proxyMap_(e,n):vd(e)?Vo("MapSet").proxySet_(e,n):IM(e,n);return(n?n.scope_:IS()).drafts_.push(a),a}function Ny(e){return ma(e)||Vr(10,e),$S(e)}function $S(e){if(!ti(e)||bd(e))return e;const n=e[pr];let a;if(n){if(!n.modified_)return n.base_;n.finalized_=!0,a=Cm(e,n.scope_.immer_.useStrictShallowCopy_)}else a=Cm(e,!0);return Wf(a,(i,l)=>{VS(a,i,$S(l))}),n&&(n.finalized_=!1),a}var qM=new $M,zy=qM.produce;function ZM(e,n=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(n)}function KM(e,n=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(n)}function YM(e,n="expected all items to be functions, instead received the following types: "){if(!e.every(a=>typeof a=="function")){const a=e.map(i=>typeof i=="function"?`function ${i.name||"unnamed"}()`:typeof i).join(", ");throw new TypeError(`${n}[${a}]`)}}var V1=e=>Array.isArray(e)?e:[e];function FM(e){const n=Array.isArray(e[0])?e[0]:e;return YM(n,"createSelector expects all input-selectors to be functions, but received the following types: "),n}function GM(e,n){const a=[],{length:i}=e;for(let l=0;l<i;l++)a.push(e[l].apply(null,n));return a}var XM=class{constructor(e){this.value=e}deref(){return this.value}},QM=typeof WeakRef<"u"?WeakRef:XM,WM=0,I1=1;function Tf(){return{s:WM,v:void 0,o:null,p:null}}function Py(e,n={}){let a=Tf();const{resultEqualityCheck:i}=n;let l,u=0;function f(){let p=a;const{length:y}=arguments;for(let w=0,_=y;w<_;w++){const O=arguments[w];if(typeof O=="function"||typeof O=="object"&&O!==null){let A=p.o;A===null&&(p.o=A=new WeakMap);const j=A.get(O);j===void 0?(p=Tf(),A.set(O,p)):p=j}else{let A=p.p;A===null&&(p.p=A=new Map);const j=A.get(O);j===void 0?(p=Tf(),A.set(O,p)):p=j}}const g=p;let v;if(p.s===I1)v=p.v;else if(v=e.apply(null,arguments),u++,i){const w=l?.deref?.()??l;w!=null&&i(w,v)&&(v=w,u!==0&&u--),l=typeof v=="object"&&v!==null||typeof v=="function"?new QM(v):v}return g.s=I1,g.v=v,v}return f.clearCache=()=>{a=Tf(),f.resetResultsCount()},f.resultsCount=()=>u,f.resetResultsCount=()=>{u=0},f}function qS(e,...n){const a=typeof e=="function"?{memoize:e,memoizeOptions:n}:e,i=(...l)=>{let u=0,f=0,p,y={},g=l.pop();typeof g=="object"&&(y=g,g=l.pop()),ZM(g,`createSelector expects an output function after the inputs, but received: [${typeof g}]`);const v={...a,...y},{memoize:w,memoizeOptions:_=[],argsMemoize:O=Py,argsMemoizeOptions:A=[]}=v,j=V1(_),N=V1(A),P=FM(l),H=w(function(){return u++,g.apply(null,arguments)},...j),L=O(function(){f++;const ee=GM(P,arguments);return p=H.apply(null,ee),p},...N);return Object.assign(L,{resultFunc:g,memoizedResultFunc:H,dependencies:P,dependencyRecomputations:()=>f,resetDependencyRecomputations:()=>{f=0},lastResult:()=>p,recomputations:()=>u,resetRecomputations:()=>{u=0},memoize:w,argsMemoize:O})};return Object.assign(i,{withTypes:()=>i}),i}var Zs=qS(Py),JM=Object.assign((e,n=Zs)=>{KM(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const a=Object.keys(e),i=a.map(u=>e[u]);return n(i,(...u)=>u.reduce((f,p,y)=>(f[a[y]]=p,f),{}))},{withTypes:()=>JM});function ZS(e){return({dispatch:a,getState:i})=>l=>u=>typeof u=="function"?u(a,i,e):l(u)}var ek=ZS(),tk=ZS,nk=(...e)=>{const n=qS(...e),a=Object.assign((...i)=>{const l=n(...i),u=(f,...p)=>l(ma(f)?Ny(f):f,...p);return Object.assign(u,l),u},{withTypes:()=>a});return a},rk=nk(Py),ak=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Qf:Qf.apply(null,arguments)},ik=e=>e&&typeof e.match=="function";function Kn(e,n){function a(...i){if(n){let l=n(...i);if(!l)throw new Error(hr(0));return{type:e,payload:l.payload,..."meta"in l&&{meta:l.meta},..."error"in l&&{error:l.error}}}return{type:e,payload:i[0]}}return a.toString=()=>`${e}`,a.type=e,a.match=i=>jy(i)&&i.type===e,a}function ok(e){return jy(e)&&Object.keys(e).every(sk)}function sk(e){return["type","payload","error","meta"].indexOf(e)>-1}var KS=class wu extends Array{constructor(...n){super(...n),Object.setPrototypeOf(this,wu.prototype)}static get[Symbol.species](){return wu}concat(...n){return super.concat.apply(this,n)}prepend(...n){return n.length===1&&Array.isArray(n[0])?new wu(...n[0].concat(this)):new wu(...n.concat(this))}};function H1(e){return ti(e)?zy(e,()=>{}):e}function Af(e,n,a){return e.has(n)?e.get(n):e.set(n,a(n)).get(n)}function lk(e){return typeof e=="boolean"}var uk=()=>function(n){const{thunk:a=!0,immutableCheck:i=!0,serializableCheck:l=!0,actionCreatorCheck:u=!0}=n??{};let f=new KS;return a&&(lk(a)?f.push(ek):f.push(tk(a.extraArgument))),f},ck="RTK_autoBatch",$1=e=>n=>{setTimeout(n,e)},fk=(e={type:"raf"})=>n=>(...a)=>{const i=n(...a);let l=!0,u=!1,f=!1;const p=new Set,y=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:$1(10):e.type==="callback"?e.queueNotification:$1(e.timeout),g=()=>{f=!1,u&&(u=!1,p.forEach(v=>v()))};return Object.assign({},i,{subscribe(v){const w=()=>l&&v(),_=i.subscribe(w);return p.add(v),()=>{_(),p.delete(v)}},dispatch(v){try{return l=!v?.meta?.[ck],u=!l,u&&(f||(f=!0,y(g))),i.dispatch(v)}finally{l=!0}}})},dk=e=>function(a){const{autoBatch:i=!0}=a??{};let l=new KS(e);return i&&l.push(fk(typeof i=="object"?i:void 0)),l};function hk(e){const n=uk(),{reducer:a=void 0,middleware:i,devTools:l=!0,preloadedState:u=void 0,enhancers:f=void 0}=e||{};let p;if(typeof a=="function")p=a;else if(Dy(a))p=NM(a);else throw new Error(hr(1));let y;typeof i=="function"?y=i(n):y=n();let g=Qf;l&&(g=ak({trace:!1,...typeof l=="object"&&l}));const v=zM(...y),w=dk(v);let _=typeof f=="function"?f(w):w();const O=g(..._);return LS(p,u,O)}function YS(e){const n={},a=[];let i;const l={addCase(u,f){const p=typeof u=="string"?u:u.type;if(!p)throw new Error(hr(28));if(p in n)throw new Error(hr(29));return n[p]=f,l},addAsyncThunk(u,f){return f.pending&&(n[u.pending.type]=f.pending),f.rejected&&(n[u.rejected.type]=f.rejected),f.fulfilled&&(n[u.fulfilled.type]=f.fulfilled),f.settled&&a.push({matcher:u.settled,reducer:f.settled}),l},addMatcher(u,f){return a.push({matcher:u,reducer:f}),l},addDefaultCase(u){return i=u,l}};return e(l),[n,a,i]}function pk(e){return typeof e=="function"}function mk(e,n){let[a,i,l]=YS(n),u;if(pk(e))u=()=>H1(e());else{const p=H1(e);u=()=>p}function f(p=u(),y){let g=[a[y.type],...i.filter(({matcher:v})=>v(y)).map(({reducer:v})=>v)];return g.filter(v=>!!v).length===0&&(g=[l]),g.reduce((v,w)=>{if(w)if(ma(v)){const O=w(v,y);return O===void 0?v:O}else{if(ti(v))return zy(v,_=>w(_,y));{const _=w(v,y);if(_===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return _}}return v},p)}return f.getInitialState=u,f}var yk=(e,n)=>ik(e)?e.match(n):e(n);function gk(...e){return n=>e.some(a=>yk(a,n))}var vk="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",FS=(e=21)=>{let n="",a=e;for(;a--;)n+=vk[Math.random()*64|0];return n},bk=["name","message","stack","code"],Kp=class{constructor(e,n){this.payload=e,this.meta=n}_type},q1=class{constructor(e,n){this.payload=e,this.meta=n}_type},xk=e=>{if(typeof e=="object"&&e!==null){const n={};for(const a of bk)typeof e[a]=="string"&&(n[a]=e[a]);return n}return{message:String(e)}},Z1="External signal was aborted",$i=(()=>{function e(n,a,i){const l=Kn(n+"/fulfilled",(y,g,v,w)=>({payload:y,meta:{...w||{},arg:v,requestId:g,requestStatus:"fulfilled"}})),u=Kn(n+"/pending",(y,g,v)=>({payload:void 0,meta:{...v||{},arg:g,requestId:y,requestStatus:"pending"}})),f=Kn(n+"/rejected",(y,g,v,w,_)=>({payload:w,error:(i&&i.serializeError||xk)(y||"Rejected"),meta:{..._||{},arg:v,requestId:g,rejectedWithValue:!!w,requestStatus:"rejected",aborted:y?.name==="AbortError",condition:y?.name==="ConditionError"}}));function p(y,{signal:g}={}){return(v,w,_)=>{const O=i?.idGenerator?i.idGenerator(y):FS(),A=new AbortController;let j,N;function P(L){N=L,A.abort()}g&&(g.aborted?P(Z1):g.addEventListener("abort",()=>P(Z1),{once:!0}));const H=(async function(){let L;try{let ee=i?.condition?.(y,{getState:w,extra:_});if(Sk(ee)&&(ee=await ee),ee===!1||A.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const fe=new Promise((ue,le)=>{j=()=>{le({name:"AbortError",message:N||"Aborted"})},A.signal.addEventListener("abort",j)});v(u(O,y,i?.getPendingMeta?.({requestId:O,arg:y},{getState:w,extra:_}))),L=await Promise.race([fe,Promise.resolve(a(y,{dispatch:v,getState:w,extra:_,requestId:O,signal:A.signal,abort:P,rejectWithValue:(ue,le)=>new Kp(ue,le),fulfillWithValue:(ue,le)=>new q1(ue,le)})).then(ue=>{if(ue instanceof Kp)throw ue;return ue instanceof q1?l(ue.payload,O,y,ue.meta):l(ue,O,y)})])}catch(ee){L=ee instanceof Kp?f(null,O,y,ee.payload,ee.meta):f(ee,O,y)}finally{j&&A.signal.removeEventListener("abort",j)}return i&&!i.dispatchConditionRejection&&f.match(L)&&L.meta.condition||v(L),L})();return Object.assign(H,{abort:P,requestId:O,arg:y,unwrap(){return H.then(wk)}})}}return Object.assign(p,{pending:u,rejected:f,fulfilled:l,settled:gk(f,l),typePrefix:n})}return e.withTypes=()=>e,e})();function wk(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Sk(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Ek=Symbol.for("rtk-slice-createasyncthunk");function _k(e,n){return`${e}/${n}`}function Tk({creators:e}={}){const n=e?.asyncThunk?.[Ek];return function(i){const{name:l,reducerPath:u=l}=i;if(!l)throw new Error(hr(11));const f=(typeof i.reducers=="function"?i.reducers(Rk()):i.reducers)||{},p=Object.keys(f),y={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},g={addCase(L,ae){const ee=typeof L=="string"?L:L.type;if(!ee)throw new Error(hr(12));if(ee in y.sliceCaseReducersByType)throw new Error(hr(13));return y.sliceCaseReducersByType[ee]=ae,g},addMatcher(L,ae){return y.sliceMatchers.push({matcher:L,reducer:ae}),g},exposeAction(L,ae){return y.actionCreators[L]=ae,g},exposeCaseReducer(L,ae){return y.sliceCaseReducersByName[L]=ae,g}};p.forEach(L=>{const ae=f[L],ee={reducerName:L,type:_k(l,L),createNotation:typeof i.reducers=="function"};Ok(ae)?jk(ee,ae,g,n):Ck(ee,ae,g)});function v(){const[L={},ae=[],ee=void 0]=typeof i.extraReducers=="function"?YS(i.extraReducers):[i.extraReducers],fe={...L,...y.sliceCaseReducersByType};return mk(i.initialState,ue=>{for(let le in fe)ue.addCase(le,fe[le]);for(let le of y.sliceMatchers)ue.addMatcher(le.matcher,le.reducer);for(let le of ae)ue.addMatcher(le.matcher,le.reducer);ee&&ue.addDefaultCase(ee)})}const w=L=>L,_=new Map,O=new WeakMap;let A;function j(L,ae){return A||(A=v()),A(L,ae)}function N(){return A||(A=v()),A.getInitialState()}function P(L,ae=!1){function ee(ue){let le=ue[L];return typeof le>"u"&&ae&&(le=Af(O,ee,N)),le}function fe(ue=w){const le=Af(_,ae,()=>new WeakMap);return Af(le,ue,()=>{const Oe={};for(const[Be,Xe]of Object.entries(i.selectors??{}))Oe[Be]=Ak(Xe,ue,()=>Af(O,ue,N),ae);return Oe})}return{reducerPath:L,getSelectors:fe,get selectors(){return fe(ee)},selectSlice:ee}}const H={name:l,reducer:j,actions:y.actionCreators,caseReducers:y.sliceCaseReducersByName,getInitialState:N,...P(u),injectInto(L,{reducerPath:ae,...ee}={}){const fe=ae??u;return L.inject({reducerPath:fe,reducer:j},ee),{...H,...P(fe,!0)}}};return H}}function Ak(e,n,a,i){function l(u,...f){let p=n(u);return typeof p>"u"&&i&&(p=a()),e(p,...f)}return l.unwrapped=e,l}var qo=Tk();function Rk(){function e(n,a){return{_reducerDefinitionType:"asyncThunk",payloadCreator:n,...a}}return e.withTypes=()=>e,{reducer(n){return Object.assign({[n.name](...a){return n(...a)}}[n.name],{_reducerDefinitionType:"reducer"})},preparedReducer(n,a){return{_reducerDefinitionType:"reducerWithPrepare",prepare:n,reducer:a}},asyncThunk:e}}function Ck({type:e,reducerName:n,createNotation:a},i,l){let u,f;if("reducer"in i){if(a&&!Dk(i))throw new Error(hr(17));u=i.reducer,f=i.prepare}else u=i;l.addCase(e,u).exposeCaseReducer(n,u).exposeAction(n,f?Kn(e,f):Kn(e))}function Ok(e){return e._reducerDefinitionType==="asyncThunk"}function Dk(e){return e._reducerDefinitionType==="reducerWithPrepare"}function jk({type:e,reducerName:n},a,i,l){if(!l)throw new Error(hr(18));const{payloadCreator:u,fulfilled:f,pending:p,rejected:y,settled:g,options:v}=a,w=l(e,u,v);i.exposeAction(n,w),f&&i.addCase(w.fulfilled,f),p&&i.addCase(w.pending,p),y&&i.addCase(w.rejected,y),g&&i.addMatcher(w.settled,g),i.exposeCaseReducer(n,{fulfilled:f||Rf,pending:p||Rf,rejected:y||Rf,settled:g||Rf})}function Rf(){}function Mk(){return{ids:[],entities:{}}}function kk(e){function n(a={},i){const l=Object.assign(Mk(),a);return i?e.setAll(l,i):l}return{getInitialState:n}}function Nk(){function e(n,a={}){const{createSelector:i=rk}=a,l=w=>w.ids,u=w=>w.entities,f=i(l,u,(w,_)=>w.map(O=>_[O])),p=(w,_)=>_,y=(w,_)=>w[_],g=i(l,w=>w.length);if(!n)return{selectIds:l,selectEntities:u,selectAll:f,selectTotal:g,selectById:i(u,p,y)};const v=i(n,u);return{selectIds:i(n,l),selectEntities:v,selectAll:i(n,f),selectTotal:i(n,g),selectById:i(v,p,y)}}return{getSelectors:e}}var zk=ma;function Pk(e){const n=Jt((a,i)=>e(i));return function(i){return n(i,void 0)}}function Jt(e){return function(a,i){function l(f){return ok(f)}const u=f=>{l(i)?e(i.payload,f):e(i,f)};return zk(a)?(u(a),a):zy(a,u)}}function Vs(e,n){return n(e)}function zo(e){return Array.isArray(e)||(e=Object.values(e)),e}function $f(e){return ma(e)?Ny(e):e}function GS(e,n,a){e=zo(e);const i=$f(a.ids),l=new Set(i),u=[],f=new Set([]),p=[];for(const y of e){const g=Vs(y,n);l.has(g)||f.has(g)?p.push({id:g,changes:y}):(f.add(g),u.push(y))}return[u,p,i]}function XS(e){function n(A,j){const N=Vs(A,e);N in j.entities||(j.ids.push(N),j.entities[N]=A)}function a(A,j){A=zo(A);for(const N of A)n(N,j)}function i(A,j){const N=Vs(A,e);N in j.entities||j.ids.push(N),j.entities[N]=A}function l(A,j){A=zo(A);for(const N of A)i(N,j)}function u(A,j){A=zo(A),j.ids=[],j.entities={},a(A,j)}function f(A,j){return p([A],j)}function p(A,j){let N=!1;A.forEach(P=>{P in j.entities&&(delete j.entities[P],N=!0)}),N&&(j.ids=j.ids.filter(P=>P in j.entities))}function y(A){Object.assign(A,{ids:[],entities:{}})}function g(A,j,N){const P=N.entities[j.id];if(P===void 0)return!1;const H=Object.assign({},P,j.changes),L=Vs(H,e),ae=L!==j.id;return ae&&(A[j.id]=L,delete N.entities[j.id]),N.entities[L]=H,ae}function v(A,j){return w([A],j)}function w(A,j){const N={},P={};A.forEach(L=>{L.id in j.entities&&(P[L.id]={id:L.id,changes:{...P[L.id]?.changes,...L.changes}})}),A=Object.values(P),A.length>0&&A.filter(ae=>g(N,ae,j)).length>0&&(j.ids=Object.values(j.entities).map(ae=>Vs(ae,e)))}function _(A,j){return O([A],j)}function O(A,j){const[N,P]=GS(A,e,j);a(N,j),w(P,j)}return{removeAll:Pk(y),addOne:Jt(n),addMany:Jt(a),setOne:Jt(i),setMany:Jt(l),setAll:Jt(u),updateOne:Jt(v),updateMany:Jt(w),upsertOne:Jt(_),upsertMany:Jt(O),removeOne:Jt(f),removeMany:Jt(p)}}function Lk(e,n,a){let i=0,l=e.length;for(;i<l;){let u=i+l>>>1;const f=e[u];a(n,f)>=0?i=u+1:l=u}return i}function Bk(e,n,a){const i=Lk(e,n,a);return e.splice(i,0,n),e}function Uk(e,n){const{removeOne:a,removeMany:i,removeAll:l}=XS(e);function u(N,P){return f([N],P)}function f(N,P,H){N=zo(N);const L=new Set(H??$f(P.ids)),ae=N.filter(ee=>!L.has(Vs(ee,e)));ae.length!==0&&j(P,ae)}function p(N,P){return y([N],P)}function y(N,P){if(N=zo(N),N.length!==0){for(const H of N)delete P.entities[e(H)];j(P,N)}}function g(N,P){N=zo(N),P.entities={},P.ids=[],f(N,P,[])}function v(N,P){return w([N],P)}function w(N,P){let H=!1,L=!1;for(let ae of N){const ee=P.entities[ae.id];if(!ee)continue;H=!0,Object.assign(ee,ae.changes);const fe=e(ee);if(ae.id!==fe){L=!0,delete P.entities[ae.id];const ue=P.ids.indexOf(ae.id);P.ids[ue]=fe,P.entities[fe]=ee}}H&&j(P,[],H,L)}function _(N,P){return O([N],P)}function O(N,P){const[H,L,ae]=GS(N,e,P);H.length&&f(H,P,ae),L.length&&w(L,P)}function A(N,P){if(N.length!==P.length)return!1;for(let H=0;H<N.length;H++)if(N[H]!==P[H])return!1;return!0}const j=(N,P,H,L)=>{const ae=$f(N.entities),ee=$f(N.ids),fe=N.entities;let ue=ee;L&&(ue=new Set(ee));let le=[];for(const Xe of ue){const it=ae[Xe];it&&le.push(it)}const Oe=le.length===0;for(const Xe of P)fe[e(Xe)]=Xe,Oe||Bk(le,Xe,n);Oe?le=P.slice().sort(n):H&&le.sort(n);const Be=le.map(e);A(ee,Be)||(N.ids=Be)};return{removeOne:a,removeMany:i,removeAll:l,addOne:Jt(u),updateOne:Jt(v),upsertOne:Jt(_),setOne:Jt(p),setMany:Jt(y),setAll:Jt(g),addMany:Jt(f),updateMany:Jt(w),upsertMany:Jt(O)}}function Vk(e={}){const{selectId:n,sortComparer:a}={sortComparer:!1,selectId:f=>f.id,...e},i=a?Uk(n,a):XS(n),l=kk(i),u=Nk();return{selectId:n,sortComparer:a,...l,...u,...i}}var Ik="task",QS="listener",WS="completed",Ly="cancelled",Hk=`task-${Ly}`,$k=`task-${WS}`,km=`${QS}-${Ly}`,qk=`${QS}-${WS}`,xd=class{constructor(e){this.code=e,this.message=`${Ik} ${Ly} (reason: ${e})`}name="TaskAbortError";message},By=(e,n)=>{if(typeof e!="function")throw new TypeError(hr(32))},td=()=>{},JS=(e,n=td)=>(e.catch(n),e),eE=(e,n)=>(e.addEventListener("abort",n,{once:!0}),()=>e.removeEventListener("abort",n)),Po=(e,n)=>{const a=e.signal;a.aborted||("reason"in a||Object.defineProperty(a,"reason",{enumerable:!0,value:n,configurable:!0,writable:!0}),e.abort(n))},Lo=e=>{if(e.aborted){const{reason:n}=e;throw new xd(n)}};function tE(e,n){let a=td;return new Promise((i,l)=>{const u=()=>l(new xd(e.reason));if(e.aborted){u();return}a=eE(e,u),n.finally(()=>a()).then(i,l)}).finally(()=>{a=td})}var Zk=async(e,n)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(a){return{status:a instanceof xd?"cancelled":"rejected",error:a}}finally{n?.()}},nd=e=>n=>JS(tE(e,n).then(a=>(Lo(e),a))),nE=e=>{const n=nd(e);return a=>n(new Promise(i=>setTimeout(i,a)))},{assign:Ks}=Object,K1={},wd="listenerMiddleware",Kk=(e,n)=>{const a=i=>eE(e,()=>Po(i,e.reason));return(i,l)=>{By(i);const u=new AbortController;a(u);const f=Zk(async()=>{Lo(e),Lo(u.signal);const p=await i({pause:nd(u.signal),delay:nE(u.signal),signal:u.signal});return Lo(u.signal),p},()=>Po(u,$k));return l?.autoJoin&&n.push(f.catch(td)),{result:nd(e)(f),cancel(){Po(u,Hk)}}}},Yk=(e,n)=>{const a=async(i,l)=>{Lo(n);let u=()=>{};const p=[new Promise((y,g)=>{let v=e({predicate:i,effect:(w,_)=>{_.unsubscribe(),y([w,_.getState(),_.getOriginalState()])}});u=()=>{v(),g()}})];l!=null&&p.push(new Promise(y=>setTimeout(y,l,null)));try{const y=await tE(n,Promise.race(p));return Lo(n),y}finally{u()}};return(i,l)=>JS(a(i,l))},rE=e=>{let{type:n,actionCreator:a,matcher:i,predicate:l,effect:u}=e;if(n)l=Kn(n).match;else if(a)n=a.type,l=a.match;else if(i)l=i;else if(!l)throw new Error(hr(21));return By(u),{predicate:l,type:n,effect:u}},aE=Ks(e=>{const{type:n,predicate:a,effect:i}=rE(e);return{id:FS(),effect:i,type:n,predicate:a,pending:new Set,unsubscribe:()=>{throw new Error(hr(22))}}},{withTypes:()=>aE}),Y1=(e,n)=>{const{type:a,effect:i,predicate:l}=rE(n);return Array.from(e.values()).find(u=>(typeof a=="string"?u.type===a:u.predicate===l)&&u.effect===i)},Nm=e=>{e.pending.forEach(n=>{Po(n,km)})},Fk=e=>()=>{e.forEach(Nm),e.clear()},F1=(e,n,a)=>{try{e(n,a)}catch(i){setTimeout(()=>{throw i},0)}},iE=Ks(Kn(`${wd}/add`),{withTypes:()=>iE}),Gk=Kn(`${wd}/removeAll`),oE=Ks(Kn(`${wd}/remove`),{withTypes:()=>oE}),Xk=(...e)=>{console.error(`${wd}/error`,...e)},Qk=(e={})=>{const n=new Map,{extra:a,onError:i=Xk}=e;By(i);const l=v=>(v.unsubscribe=()=>n.delete(v.id),n.set(v.id,v),w=>{v.unsubscribe(),w?.cancelActive&&Nm(v)}),u=v=>{const w=Y1(n,v)??aE(v);return l(w)};Ks(u,{withTypes:()=>u});const f=v=>{const w=Y1(n,v);return w&&(w.unsubscribe(),v.cancelActive&&Nm(w)),!!w};Ks(f,{withTypes:()=>f});const p=async(v,w,_,O)=>{const A=new AbortController,j=Yk(u,A.signal),N=[];try{v.pending.add(A),await Promise.resolve(v.effect(w,Ks({},_,{getOriginalState:O,condition:(P,H)=>j(P,H).then(Boolean),take:j,delay:nE(A.signal),pause:nd(A.signal),extra:a,signal:A.signal,fork:Kk(A.signal,N),unsubscribe:v.unsubscribe,subscribe:()=>{n.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((P,H,L)=>{P!==A&&(Po(P,km),L.delete(P))})},cancel:()=>{Po(A,km),v.pending.delete(A)},throwIfCancelled:()=>{Lo(A.signal)}})))}catch(P){P instanceof xd||F1(i,P,{raisedBy:"effect"})}finally{await Promise.all(N),Po(A,qk),v.pending.delete(A)}},y=Fk(n);return{middleware:v=>w=>_=>{if(!jy(_))return w(_);if(iE.match(_))return u(_.payload);if(Gk.match(_)){y();return}if(oE.match(_))return f(_.payload);let O=v.getState();const A=()=>{if(O===K1)throw new Error(hr(23));return O};let j;try{if(j=w(_),n.size>0){const N=v.getState(),P=Array.from(n.values());for(const H of P){let L=!1;try{L=H.predicate(_,N,O)}catch(ae){L=!1,F1(i,ae,{raisedBy:"predicate"})}L&&p(H,_,v,A)}}}finally{O=K1}return j},startListening:u,stopListening:f,clearListeners:y}};function hr(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}function sE(e){const{name:n,fetchAll:a,fetchByParam:i,createOne:l,updateOne:u,deleteOne:f,sortComparer:p}=e,y=Vk({sortComparer:p}),g=$i(`${n}/noop`,async()=>[]),v=a?mu(`${n}${Ns.FETCH_ALL}`,a):g,w=i?mu(`${n}${Ns.FETCH_BY_PARAM}`,async H=>{const L=await i(H);return{param:H,data:L}}):g,_=mu(`${n}${Ns.CREATE_ONE}`,l),O=mu(`${n}${Ns.UPDATE_ONE}`,u),A=mu(`${n}${Ns.DELETE_ONE}`,async H=>(await f(H),H)),j=y.getInitialState({loading:Ar.IDLE,error:null}),N=qo({name:n,initialState:j,reducers:{clearError(H){H.error=null},reset:()=>j},extraReducers:H=>{const L=le=>{le.loading=Ar.PENDING,le.error=null},ae=(le,Oe)=>{le.loading=Ar.FAILED,le.error=Oe.payload??Oe.error.message??qn.ERROR_ACTION},ee=le=>{le.loading=Ar.SUCCEEDED,le.error=null},fe=(le,Oe)=>{le&&H.addCase(le.fulfilled,(Be,Xe)=>{Oe(Be,Xe.payload),ee(Be)})};fe(v,(le,Oe)=>y.setAll(le,Oe)),fe(w,(le,Oe)=>y.setAll(le,Oe.data)),fe(_,(le,Oe)=>y.addOne(le,Oe)),fe(O,(le,Oe)=>y.upsertOne(le,Oe)),fe(A,(le,Oe)=>y.removeOne(le,Oe)),[v,w,_,O,A].filter(le=>le!==void 0).forEach(le=>{H.addMatcher(le.pending.match,L).addMatcher(le.rejected.match,ae)})}});function P(H){const L=y.getSelectors(H),ae=Zs([L.selectAll,(ue,le)=>le.trim().toLowerCase()],(ue,le)=>le?ue.filter(Oe=>(Oe.name??"").toLowerCase().includes(le)):ue),ee=Zs([H],ue=>ue.loading===Ar.PENDING),fe=Zs([H],ue=>ue.error);return{...L,selectByName:ae,selectIsLoading:ee,selectError:fe}}return{reducer:N.reducer,actions:N.actions,adapter:y,thunks:{fetchAllThunk:v,fetchByParamThunk:w,createOneThunk:_,updateOneThunk:O,deleteOneThunk:A},makeSelectors:P}}const Wk=e=>e instanceof Error?e.message:qn.ERROR_ACTION,mu=(e,n)=>$i(e,async(a,{rejectWithValue:i})=>{try{return await n(a)}catch(l){return i(Wk(l))}}),{reducer:lE,adapter:uE,thunks:{fetchAllThunk:cE,createOneThunk:Jk,updateOneThunk:eN,deleteOneThunk:fE}}=sE({name:dr.PROJECTS,fetchAll:Mo.getProjects,createOne:Mo.createProject,updateOne:Mo.updateProject,deleteOne:async e=>(await Mo.deleteWithRelations(e),e),sortComparer:(e,n)=>n.updatedAt-e.updatedAt}),Yp=$i(Fm.PROJECTS_CLEAR_ALL,async(e,{dispatch:n})=>{await Mo.clearAll(),await n(cE())}),tN={...lE(void 0,{type:"@@INIT"}),activeId:null},Du=Kn(Fm.PROJECT_SET_ACTIVE_ID),Uy=Kn(Fm.PROJECT_UPSET);function nN(e=tN,n){if(Du.match(n))return{...e,activeId:n.payload};if(Uy.match(n))return{...uE.upsertOne(e,n.payload),activeId:e.activeId};let a=lE(e,n);if(fE.fulfilled.match(n)){const i=n.payload;a.activeId===i&&(a={...a,activeId:null})}return Yp.pending.match(n)?{...a,loading:Ar.PENDING}:Yp.fulfilled.match(n)?{...a,activeId:null,loading:Ar.SUCCEEDED}:Yp.rejected.match(n)?{...a,loading:Ar.FAILED}:a}const rd={...uE.getSelectors(e=>e.projects),selectLoading:e=>e.projects.loading,selectActiveProject:e=>e.projects.entities[e.projects.activeId??""]??null},G1={stack:[],currentIndex:-1,isPreview:!1},dE=qo({name:dr.HISTORY,initialState:G1,reducers:{pushState(e,n){e.stack=[...e.stack.slice(0,e.currentIndex+1),n.payload],e.currentIndex=e.stack.length-1,e.isPreview=!1},undo(e){e.currentIndex>0&&e.currentIndex--,e.isPreview=!0},redo(e){e.currentIndex<e.stack.length-1&&e.currentIndex++,e.isPreview=!0},jumpTo(e,n){const a=n.payload;a>=0&&a<e.stack.length&&(e.currentIndex=a,e.isPreview=!0)},setPreview(e,n){e.isPreview=n.payload},resetHistory(){return G1}}}),{pushState:Pi,undo:Vy,redo:Iy,jumpTo:hE,resetHistory:Hy,setPreview:$u}=dE.actions,rN=dE.reducer,Xa={async saveEntry(e){await Oo.add(e)},async loadByProject(e){return Oo.getByProject(e)},async deleteAfterIndex(e,n){await Oo.deleteAfterIndex(e,n)},async resetProject(e){await Oo.clearByProject(e)},async resetAll(){await Oo.clearAll()}},Li={async getLayers(e){return ua.getAllByProject(e)},async createLayer({projectId:e,name:n}){const a=await ua.getAllByProject(e),l=(a.length>0?Math.max(...a.map(p=>p.zIndex)):-1)+1;let u=1;for(const p of a){const y=p.name.match(/(\d+)$/);if(y){const g=parseInt(y[1],10);g>=u&&(u=g+1)}}const f={id:Uo(),projectId:e,name:n?.trim()||`${zn.NAME(u)}`,visible:!0,opacity:1,zIndex:l,createdAt:Date.now(),updatedAt:Date.now(),snapshot:""};return await ua.add(f),f},async updateLayer(e){const{id:n,changes:a}=e;await ua.update(n,{...a,updatedAt:Date.now()});const i=await ua.getById(n);if(!i)throw new Error(`${C2.LAYER_NOT_FOUND(n)}`);return i},async deleteLayer(e){return await ua.remove(e),e},async ensureBaseLayer(e,n=`${Gm.INITIAL_NAME}`){return(await ua.getAllByProject(e)).length>0?null:this.createLayer({projectId:e,name:n})},async replaceAll(e,n){await ua.removeByProject(e),await Vu.waitFor(Promise.resolve());for(const a of n)await ua.add({id:a.id,projectId:e,name:a.name,visible:a.visible,opacity:a.opacity,zIndex:a.zIndex,snapshot:a.snapshot,createdAt:Date.now(),updatedAt:Date.now()})}},{reducer:pE,adapter:ca,thunks:{createOneThunk:$y,updateOneThunk:Is,deleteOneThunk:qy}}=sE({name:`${dr.LAYERS}`,fetchAll:async()=>{throw new Error(zn.ERROR_FETCH_BY_PROJECT)},createOne:Li.createLayer,updateOne:Li.updateLayer,deleteOne:Li.deleteLayer,sortComparer:(e,n)=>n.zIndex-e.zIndex}),ju=$i(`${dr.LAYERS}${Ns.FETCH_BY_PARAM}`,async e=>{try{const n=await Li.getLayers(e);return{projectId:e,layers:n}}catch{throw new Error(zn.ERROR_FETCH_BY_PROJECT)}}),aN=pE(void 0,{type:"@@INIT"}),iN={...aN,activeId:null,projectId:null},Zy=Kn(Xu.SET_ACTIVE_ID),oN=Kn(Xu.SET_CURRENT_PROJECT),sN=Kn(Xu.UPDATE_SNAPSHOT),mE=Kn(Xu.REPLACE_FROM_SNAPSHOT);function lN(e=iN,n){const a=pE(e,n);switch(!0){case Zy.match(n):return{...a,activeId:n.payload};case sN.match(n):{const{id:i,changes:l}=n.payload;if(a.entities[i])return ca.updateOne(a,{id:i,changes:l});{const f={id:i,projectId:a.projectId??"unknown",name:zn.RESTORED_LAYER,visible:l.visible??!0,opacity:l.opacity??1,zIndex:l.zIndex??0,snapshot:l.snapshot??"",createdAt:Date.now(),updatedAt:Date.now()};return ca.addOne(a,f)}}case oN.match(n):return{...ca.removeAll(a),activeId:null,projectId:n.payload};case ju.pending.match(n):return{...a,loading:Ar.PENDING,error:null};case ju.fulfilled.match(n):{const{projectId:i,layers:l}=n.payload,u=ca.setAll(a,l),f=l.length>0?l[0].id:null;return{...u,projectId:i,activeId:f,loading:Ar.SUCCEEDED,error:null}}case ju.rejected.match(n):return{...a,loading:Ar.FAILED,error:n.error.message??zn.ERROR_FETCH_BY_PROJECT};case $y.fulfilled.match(n):{const i=n.payload;return{...ca.addOne(a,i),activeId:i.id}}case qy.fulfilled.match(n):{const i=n.payload,l=ca.removeOne(a,i);if(a.activeId===i){const u=ca.getSelectors().selectAll(l),f=u.length?u.reduce((p,y)=>p.zIndex>y.zIndex?p:y):null;return{...l,activeId:f?f.id:null}}return l}case mE.match(n):{const{projectId:i,layers:l}=n.payload;let u=ca.removeAll(a);u={...u,projectId:i,activeId:null};const f=Date.now(),p=l.map((v,w)=>({id:v.id??Uo(),projectId:i,name:v.name??zn.NAME(w+1),visible:v.visible??!0,opacity:v.opacity??1,zIndex:v.zIndex??w,snapshot:v.snapshot??"",createdAt:f,updatedAt:f})),y=ca.setAll(u,p),g=p.length?p[0].id:null;return{...y,activeId:g,loading:Ar.SUCCEEDED,error:null}}default:return a}}async function uN(e,n,a,i){for(const l of e){const u=n(l.id);if(!u)continue;const f=u.getContext("2d",{willReadFrequently:!0});if(f&&(f.clearRect(0,0,a,i),l.snapshot)){const p=new Image;p.src=l.snapshot,await new Promise(y=>p.onload=y),f.drawImage(p,0,0)}}}function cN(e,n){return e===Pn.SHAPE?n===am.CIRCLE?pb.circle:pb.rect:e?O2[e]:Dt.SNAPSHOT}var fN=typeof global=="object"&&global&&global.Object===Object&&global,dN=typeof self=="object"&&self&&self.Object===Object&&self,yE=fN||dN||Function("return this")(),ad=yE.Symbol,gE=Object.prototype,hN=gE.hasOwnProperty,pN=gE.toString,yu=ad?ad.toStringTag:void 0;function mN(e){var n=hN.call(e,yu),a=e[yu];try{e[yu]=void 0;var i=!0}catch{}var l=pN.call(e);return i&&(n?e[yu]=a:delete e[yu]),l}var yN=Object.prototype,gN=yN.toString;function vN(e){return gN.call(e)}var bN="[object Null]",xN="[object Undefined]",X1=ad?ad.toStringTag:void 0;function wN(e){return e==null?e===void 0?xN:bN:X1&&X1 in Object(e)?mN(e):vN(e)}function SN(e){return e!=null&&typeof e=="object"}var EN="[object Symbol]";function _N(e){return typeof e=="symbol"||SN(e)&&wN(e)==EN}var TN=/\s/;function AN(e){for(var n=e.length;n--&&TN.test(e.charAt(n)););return n}var RN=/^\s+/;function CN(e){return e&&e.slice(0,AN(e)+1).replace(RN,"")}function zm(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var Q1=NaN,ON=/^[-+]0x[0-9a-f]+$/i,DN=/^0b[01]+$/i,jN=/^0o[0-7]+$/i,MN=parseInt;function W1(e){if(typeof e=="number")return e;if(_N(e))return Q1;if(zm(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=zm(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=CN(e);var a=DN.test(e);return a||jN.test(e)?MN(e.slice(2),a?2:8):ON.test(e)?Q1:+e}var Fp=function(){return yE.Date.now()},kN="Expected a function",NN=Math.max,zN=Math.min;function PN(e,n,a){var i,l,u,f,p,y,g=0,v=!1,w=!1,_=!0;if(typeof e!="function")throw new TypeError(kN);n=W1(n)||0,zm(a)&&(v=!!a.leading,w="maxWait"in a,u=w?NN(W1(a.maxWait)||0,n):u,_="trailing"in a?!!a.trailing:_);function O(fe){var ue=i,le=l;return i=l=void 0,g=fe,f=e.apply(le,ue),f}function A(fe){return g=fe,p=setTimeout(P,n),v?O(fe):f}function j(fe){var ue=fe-y,le=fe-g,Oe=n-ue;return w?zN(Oe,u-le):Oe}function N(fe){var ue=fe-y,le=fe-g;return y===void 0||ue>=n||ue<0||w&&le>=u}function P(){var fe=Fp();if(N(fe))return H(fe);p=setTimeout(P,j(fe))}function H(fe){return p=void 0,_&&i?O(fe):(i=l=void 0,f)}function L(){p!==void 0&&clearTimeout(p),g=0,i=y=l=p=void 0}function ae(){return p===void 0?f:H(Fp())}function ee(){var fe=Fp(),ue=N(fe);if(i=arguments,l=this,y=fe,ue){if(p===void 0)return A(y);if(w)return clearTimeout(p),p=setTimeout(P,n),O(y)}return p===void 0&&(p=setTimeout(P,n)),f}return ee.cancel=L,ee.flush=ae,ee}const Pm=ca.getSelectors(e=>e.layers),LN=Pm.selectAll,vE=()=>Zs([LN,(e,n)=>n],(e,n)=>e.filter(a=>a.projectId===n)),Hs={...Pm,selectLoading:e=>e.layers.loading,selectError:e=>e.layers.error,selectActiveLayer:Zs([e=>e.layers.activeId,e=>e.layers.entities],(e,n)=>e?n[e]??null:null),selectByProject:(e,n)=>Pm.selectAll(e).filter(a=>a.projectId===n)};let Su=null;const Gp=PN(async(e,n)=>{n.dispatch(Pi(e)),await Xa.saveEntry(e),Su=null},700);function BN(e){const n=i=>{const l=i.projects.activeId??"unknown",u=Hs.selectAll(i),{viewport:f,activeTool:p}=i.editor;return{projectId:l,activeTool:p,viewport:f,layers:u.map(y=>({id:y.id,name:y.name,visible:y.visible,opacity:y.opacity,zIndex:y.zIndex,snapshot:y.snapshot}))}},a=(i,l,u)=>({id:Uo(),label:i,state:n(l),timestamp:Date.now(),icon:u});try{e({actionCreator:$y.fulfilled,effect:async(i,l)=>{const u=i.payload,f=a(`${zn.CREATED(u.name)}`,l.getState(),"plus-square");l.dispatch(Pi(f)),await Xa.saveEntry(f)}}),e({actionCreator:qy.pending,effect:async(i,l)=>{const u=l.getState(),f=i.meta.arg,p=Hs.selectAll(u).find(g=>g.id===f);if(!p)return;const y=a(`${zn.DELETED(p.name)}`,u,"trash");l.dispatch(Pi(y)),await Xa.saveEntry(y)}}),e({actionCreator:Is.fulfilled,effect:async(i,l)=>{const u=i.payload,{changes:f}=i.meta.arg,p=l.getState();if("snapshot"in f){const w=p.editor.activeTool,_=w===Pn.SHAPE?p.shape.type:void 0,O=cN(w,_),A={id:Uo(),label:O,state:{projectId:p.projects.activeId??u.projectId??"unknown",activeTool:w,viewport:p.editor.viewport,layers:Hs.selectAll(p).map(j=>({id:j.id,name:j.name,visible:j.visible,opacity:j.opacity,zIndex:j.zIndex,snapshot:j.snapshot}))},timestamp:Date.now(),toolType:w??void 0,...w===Pn.SHAPE&&_?{shapeType:_}:{}};l.dispatch(Pi(A)),await Xa.saveEntry(A);return}if("visible"in f&&Object.keys(f).length===1)return;let y=`${zn.UPDATED(u.name)}`,g="edit";if("opacity"in f&&(y=`${zn.OPACITY_ADJUSTED(u.name)}`,g="sliders"),"name"in f&&(y=`${zn.RENAMED(u.name)}`,g="edit"),"zIndex"in f){const w=[...Hs.selectAll(p)].sort((j,N)=>j.zIndex-N.zIndex),_=w.findIndex(j=>j.id===u.id),O=w[_+1],A=w[_-1];O&&A?y=`${zn.REORDER_LABEL_SWAP(A.name,O.name)}`:O?y=`${zn.REORDER_LABEL_ABOVE(u.name,O.name)}`:A?y=`${zn.REORDER_LABEL_BELOW(u.name,A.name)}`:y=`${zn.REORDERED_LAYERS}`,g="shuffle"}const v=a(y,p,g);Su&&Su.label===y&&Su.id===u.id?(Gp.cancel(),await Gp(v,{dispatch:l.dispatch})):(Su={id:u.id,label:y},await Gp(v,{dispatch:l.dispatch}))}})}catch(i){throw i}}const UN=$i(`${Xu.LAYER_INIT_BASE}`,async(e,{dispatch:n})=>{const a=await Li.ensureBaseLayer(e,`${Gm.INITIAL_NAME}`);if(await n(ju(e)).unwrap(),a){n(Zy(a.id));const i={id:Uo(),label:`${zn.CREATE_BASE_LAYER(a.name)}`,timestamp:Date.now(),toolType:Pn.BRUSH,state:{projectId:e,layers:[{id:a.id,name:a.name,visible:a.visible,opacity:a.opacity,zIndex:a.zIndex,snapshot:a.snapshot}],activeTool:null,viewport:{scale:1,offsetX:0,offsetY:0}}};await Oo.add(i)}});function VN(e,n,a,i){const l=D.useRef(new Map),u=D.useRef(new Map),f=D.useMemo(()=>y=>g=>{if(!g)return;l.current.set(y,g),g.width!==a&&(g.width=a),g.height!==i&&(g.height=i);const v=e.find(w=>w.id===y);if(v?.snapshot){const w=new Image;w.src=v.snapshot,w.onload=()=>g.getContext("2d",{willReadFrequently:!0})?.drawImage(w,0,0),u.current.set(y,v.snapshot)}},[e,a,i]);return D.useEffect(()=>{for(const y of l.current.values())y.width!==a&&(y.width=a),y.height!==i&&(y.height=i)},[a,i]),D.useEffect(()=>{u.current=new Map},[n]),D.useEffect(()=>{const y=new Map(l.current),g=new Map(u.current);return()=>{for(const[v,w]of y.entries()){const _=w.toDataURL("image/png"),O=g.get(v);_!==O&&Li.getLayers(n).then(A=>{if(A.some(j=>j.id===v))return Li.updateLayer({id:v,changes:{snapshot:_}})}).catch(()=>{})}}},[n]),{bindCanvasRef:f,getCanvas:y=>l.current.get(y)??null}}async function Ky(e,n){const{projectId:a,layers:i}=e;n.dispatch(mE({projectId:a,layers:i.map(g=>({id:g.id,name:g.name,visible:g.visible,opacity:g.opacity,zIndex:g.zIndex,snapshot:g.snapshot}))})),await Li.replaceAll(a,i);const u=n.getState().projects.entities[a];if(!u)return;const{width:f,height:p}=u;await new Promise(g=>requestAnimationFrame(()=>g())),await uN(i,g=>document.getElementById(`layer-canvas-${g}`),f,p)}const IN=$i(`${Fx.LOAD_HISTORY_FROM_DB}`,async(e,{dispatch:n,getState:a})=>{const l=a().projects.activeId;if(!l)return;const u=await Xa.loadByProject(l);n(Hy());for(const f of u){const y=!!f.toolType?f.icon:f.icon??Tt.EDIT,g={...f,icon:y};n(Pi(g))}}),bE=$i(`${Fx.APPLY_SNAPSHOT}`,async(e,{dispatch:n,getState:a})=>{const{history:i}=a(),l=i.stack[i.currentIndex];if(!l)return;const u=l.state.projectId;await Ky(l.state,{dispatch:n,getState:a}),await Xa.deleteAfterIndex(u,i.currentIndex),n(Hy());const f=i.stack.slice(0,i.currentIndex+1);for(const y of f)n(Pi(y)),await Xa.saveEntry(y);const p={id:Uo(),label:Dt.APPLY_SNAPSHOT,state:l.state,timestamp:Date.now(),icon:"edit"};n(Pi(p)),await Xa.saveEntry(p),n($u(!1))}),HN=e=>e.history,$N=e=>e.history.currentIndex>0,qN=e=>{const{stack:n,currentIndex:a}=e.history;return a<n.length-1},Yy=e=>e.history.isPreview,xE=$i(`${R2.LOAD_PROJECT_DATA}`,async(e,{dispatch:n,getState:a})=>{const i=await Tr.getById(e);if(!i)throw new Error(`${qn.ERROR_PROJECT_NOT_FOUND(e)}`);n(Uy(i)),n(Hy()),await n(UN(e)).unwrap(),await n(IN(e)).unwrap();const u=a().history.stack;if(u.length>0){const f=u[u.length-1];f?.state&&await Ky(f.state,{dispatch:n,getState:a})}}),Xp=fa.table(`${dr.ACTIVE_PROJECT}`),Cf={async get(){return(await Xp.get("active"))?.projectId??null},async set(e){await Xp.put({id:"active",projectId:e})},async clear(){await Xp.delete("active")}};let gu=null,Qp=!1;const Fy={async getActiveProjectId(){return Cf.get()},async setActiveProject(e,n){n&&(await Cf.set(n),e(Du(n)))},async clearActiveProject(e){await Cf.clear(),e(Du(null))},isRestoring(){return Qp},async restoreIntoEditor(e,n){return gu||(gu=(async()=>{Qp=!0;try{const a=n||await this.getActiveProjectId();return a?await Tr.exists(a)?(e(Du(a)),await e(xE(a)).unwrap(),n&&await Cf.set(a),a):(n||await this.clearActiveProject(e),null):null}finally{gu=null,Qp=!1}})(),gu)}};let Of=null;function ZN(e){e({actionCreator:Du,effect:async(n,a)=>{const i=n.payload;if(!i){Of=null;return}if(!Fy.isRestoring()&&Of!==i){Of=i;try{a.cancelActiveListeners?.(),await a.dispatch(xE(i))}finally{Of=null}}}})}async function KN(e,n){if(!n)return;const a=await wE(),i=await Mo.updateProject({id:n.id,changes:{snapshot:a}});e(Uy(i))}async function wE(){const e=Array.from(document.querySelectorAll("[data-layer-id], #draw-canvas"));if(e.length===0)return"";const n=e[0],a=document.createElement("canvas");a.width=n.width,a.height=n.height;const i=a.getContext("2d",{willReadFrequently:!0,alpha:!0});i.fillStyle=window.getComputedStyle(document.body).backgroundColor||"#ffffff",i.fillRect(0,0,a.width,a.height);for(const l of e)i.drawImage(l,0,0);return a.toDataURL("image/png")}async function YN(e){if(!e)return;const n=await wE(),a=`${e.name}.png`;if(typeof window.showSaveFilePicker=="function"){const f=await(await window.showSaveFilePicker.bind(window)({suggestedName:a,types:[{description:"PNG Image",accept:{"image/png":[".png"]}}]})).createWritable(),p=await(await fetch(n)).blob();await f.write(p),await f.close();return}const i=document.createElement("a");i.href=n,i.download=a,i.click()}const en=eA,pt=rA;function ve(e,n,a){function i(p,y){var g;Object.defineProperty(p,"_zod",{value:p._zod??{},enumerable:!1}),(g=p._zod).traits??(g.traits=new Set),p._zod.traits.add(e),n(p,y);for(const v in f.prototype)v in p||Object.defineProperty(p,v,{value:f.prototype[v].bind(p)});p._zod.constr=f,p._zod.def=y}const l=a?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function f(p){var y;const g=a?.Parent?new u:this;i(g,p),(y=g._zod).deferred??(y.deferred=[]);for(const v of g._zod.deferred)v();return g}return Object.defineProperty(f,"init",{value:i}),Object.defineProperty(f,Symbol.hasInstance,{value:p=>a?.Parent&&p instanceof a.Parent?!0:p?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}class Ys extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class SE extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const EE={};function Io(e){return EE}function FN(e){const n=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,l])=>n.indexOf(+i)===-1).map(([i,l])=>l)}function Lm(e,n){return typeof n=="bigint"?n.toString():n}function Gy(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Xy(e){return e==null}function Qy(e){const n=e.startsWith("^")?1:0,a=e.endsWith("$")?e.length-1:e.length;return e.slice(n,a)}function GN(e,n){const a=(e.toString().split(".")[1]||"").length,i=n.toString();let l=(i.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(i)){const y=i.match(/\d?e-(\d?)/);y?.[1]&&(l=Number.parseInt(y[1]))}const u=a>l?a:l,f=Number.parseInt(e.toFixed(u).replace(".","")),p=Number.parseInt(n.toFixed(u).replace(".",""));return f%p/10**u}const J1=Symbol("evaluating");function Rt(e,n,a){let i;Object.defineProperty(e,n,{get(){if(i!==J1)return i===void 0&&(i=J1,i=a()),i},set(l){Object.defineProperty(e,n,{value:l})},configurable:!0})}function Zo(e,n,a){Object.defineProperty(e,n,{value:a,writable:!0,enumerable:!0,configurable:!0})}function Ko(...e){const n={};for(const a of e){const i=Object.getOwnPropertyDescriptors(a);Object.assign(n,i)}return Object.defineProperties({},n)}function ex(e){return JSON.stringify(e)}const _E="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function id(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const XN=Gy(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function qu(e){if(id(e)===!1)return!1;const n=e.constructor;if(n===void 0)return!0;const a=n.prototype;return!(id(a)===!1||Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")===!1)}function TE(e){return qu(e)?{...e}:Array.isArray(e)?[...e]:e}const QN=new Set(["string","number","symbol"]);function Sd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qi(e,n,a){const i=new e._zod.constr(n??e._zod.def);return(!n||a?.parent)&&(i._zod.parent=e),i}function Ue(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function WN(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const JN={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ez(e,n){const a=e._zod.def,i=Ko(e._zod.def,{get shape(){const l={};for(const u in n){if(!(u in a.shape))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(l[u]=a.shape[u])}return Zo(this,"shape",l),l},checks:[]});return qi(e,i)}function tz(e,n){const a=e._zod.def,i=Ko(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const u in n){if(!(u in a.shape))throw new Error(`Unrecognized key: "${u}"`);n[u]&&delete l[u]}return Zo(this,"shape",l),l},checks:[]});return qi(e,i)}function nz(e,n){if(!qu(n))throw new Error("Invalid input to extend: expected a plain object");const a=e._zod.def.checks;if(a&&a.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const l=Ko(e._zod.def,{get shape(){const u={...e._zod.def.shape,...n};return Zo(this,"shape",u),u},checks:[]});return qi(e,l)}function rz(e,n){if(!qu(n))throw new Error("Invalid input to safeExtend: expected a plain object");const a={...e._zod.def,get shape(){const i={...e._zod.def.shape,...n};return Zo(this,"shape",i),i},checks:e._zod.def.checks};return qi(e,a)}function az(e,n){const a=Ko(e._zod.def,{get shape(){const i={...e._zod.def.shape,...n._zod.def.shape};return Zo(this,"shape",i),i},get catchall(){return n._zod.def.catchall},checks:[]});return qi(e,a)}function iz(e,n,a){const i=Ko(n._zod.def,{get shape(){const l=n._zod.def.shape,u={...l};if(a)for(const f in a){if(!(f in l))throw new Error(`Unrecognized key: "${f}"`);a[f]&&(u[f]=e?new e({type:"optional",innerType:l[f]}):l[f])}else for(const f in l)u[f]=e?new e({type:"optional",innerType:l[f]}):l[f];return Zo(this,"shape",u),u},checks:[]});return qi(n,i)}function oz(e,n,a){const i=Ko(n._zod.def,{get shape(){const l=n._zod.def.shape,u={...l};if(a)for(const f in a){if(!(f in u))throw new Error(`Unrecognized key: "${f}"`);a[f]&&(u[f]=new e({type:"nonoptional",innerType:l[f]}))}else for(const f in l)u[f]=new e({type:"nonoptional",innerType:l[f]});return Zo(this,"shape",u),u},checks:[]});return qi(n,i)}function $s(e,n=0){if(e.aborted===!0)return!0;for(let a=n;a<e.issues.length;a++)if(e.issues[a]?.continue!==!0)return!0;return!1}function AE(e,n){return n.map(a=>{var i;return(i=a).path??(i.path=[]),a.path.unshift(e),a})}function Df(e){return typeof e=="string"?e:e?.message}function Ho(e,n,a){const i={...e,path:e.path??[]};if(!e.message){const l=Df(e.inst?._zod.def?.error?.(e))??Df(n?.error?.(e))??Df(a.customError?.(e))??Df(a.localeError?.(e))??"Invalid input";i.message=l}return delete i.inst,delete i.continue,n?.reportInput||delete i.input,i}function Wy(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Zu(...e){const[n,a,i]=e;return typeof n=="string"?{message:n,code:"custom",input:a,inst:i}:{...n}}const RE=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,Lm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},CE=ve("$ZodError",RE),OE=ve("$ZodError",RE,{Parent:Error});function sz(e,n=a=>a.message){const a={},i=[];for(const l of e.issues)l.path.length>0?(a[l.path[0]]=a[l.path[0]]||[],a[l.path[0]].push(n(l))):i.push(n(l));return{formErrors:i,fieldErrors:a}}function lz(e,n=a=>a.message){const a={_errors:[]},i=l=>{for(const u of l.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(f=>i({issues:f}));else if(u.code==="invalid_key")i({issues:u.issues});else if(u.code==="invalid_element")i({issues:u.issues});else if(u.path.length===0)a._errors.push(n(u));else{let f=a,p=0;for(;p<u.path.length;){const y=u.path[p];p===u.path.length-1?(f[y]=f[y]||{_errors:[]},f[y]._errors.push(n(u))):f[y]=f[y]||{_errors:[]},f=f[y],p++}}};return i(e),a}const Jy=e=>(n,a,i,l)=>{const u=i?Object.assign(i,{async:!1}):{async:!1},f=n._zod.run({value:a,issues:[]},u);if(f instanceof Promise)throw new Ys;if(f.issues.length){const p=new(l?.Err??e)(f.issues.map(y=>Ho(y,u,Io())));throw _E(p,l?.callee),p}return f.value},eg=e=>async(n,a,i,l)=>{const u=i?Object.assign(i,{async:!0}):{async:!0};let f=n._zod.run({value:a,issues:[]},u);if(f instanceof Promise&&(f=await f),f.issues.length){const p=new(l?.Err??e)(f.issues.map(y=>Ho(y,u,Io())));throw _E(p,l?.callee),p}return f.value},Ed=e=>(n,a,i)=>{const l=i?{...i,async:!1}:{async:!1},u=n._zod.run({value:a,issues:[]},l);if(u instanceof Promise)throw new Ys;return u.issues.length?{success:!1,error:new(e??CE)(u.issues.map(f=>Ho(f,l,Io())))}:{success:!0,data:u.value}},uz=Ed(OE),_d=e=>async(n,a,i)=>{const l=i?Object.assign(i,{async:!0}):{async:!0};let u=n._zod.run({value:a,issues:[]},l);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(f=>Ho(f,l,Io())))}:{success:!0,data:u.value}},cz=_d(OE),fz=e=>(n,a,i)=>{const l=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Jy(e)(n,a,l)},dz=e=>(n,a,i)=>Jy(e)(n,a,i),hz=e=>async(n,a,i)=>{const l=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return eg(e)(n,a,l)},pz=e=>async(n,a,i)=>eg(e)(n,a,i),mz=e=>(n,a,i)=>{const l=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Ed(e)(n,a,l)},yz=e=>(n,a,i)=>Ed(e)(n,a,i),gz=e=>async(n,a,i)=>{const l=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return _d(e)(n,a,l)},vz=e=>async(n,a,i)=>_d(e)(n,a,i),bz=/^[cC][^\s-]{8,}$/,xz=/^[0-9a-z]+$/,wz=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Sz=/^[0-9a-vA-V]{20}$/,Ez=/^[A-Za-z0-9]{27}$/,_z=/^[a-zA-Z0-9_-]{21}$/,Tz=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Az=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,tx=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Rz=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Cz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Oz(){return new RegExp(Cz,"u")}const Dz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,jz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Mz=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,kz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Nz=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,DE=/^[A-Za-z0-9_-]*$/,zz=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Pz=/^\+(?:[0-9]){6,14}[0-9]$/,jE="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Lz=new RegExp(`^${jE}$`);function ME(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Bz(e){return new RegExp(`^${ME(e)}$`)}function Uz(e){const n=ME({precision:e.precision}),a=["Z"];e.local&&a.push(""),e.offset&&a.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${n}(?:${a.join("|")})`;return new RegExp(`^${jE}T(?:${i})$`)}const Vz=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},Iz=/^-?\d+$/,Hz=/^-?\d+(?:\.\d+)?/,$z=/^[^A-Z]*$/,qz=/^[^a-z]*$/,tr=ve("$ZodCheck",(e,n)=>{var a;e._zod??(e._zod={}),e._zod.def=n,(a=e._zod).onattach??(a.onattach=[])}),kE={number:"number",bigint:"bigint",object:"date"},NE=ve("$ZodCheckLessThan",(e,n)=>{tr.init(e,n);const a=kE[typeof n.value];e._zod.onattach.push(i=>{const l=i._zod.bag,u=(n.inclusive?l.maximum:l.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<u&&(n.inclusive?l.maximum=n.value:l.exclusiveMaximum=n.value)}),e._zod.check=i=>{(n.inclusive?i.value<=n.value:i.value<n.value)||i.issues.push({origin:a,code:"too_big",maximum:n.value,input:i.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),zE=ve("$ZodCheckGreaterThan",(e,n)=>{tr.init(e,n);const a=kE[typeof n.value];e._zod.onattach.push(i=>{const l=i._zod.bag,u=(n.inclusive?l.minimum:l.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>u&&(n.inclusive?l.minimum=n.value:l.exclusiveMinimum=n.value)}),e._zod.check=i=>{(n.inclusive?i.value>=n.value:i.value>n.value)||i.issues.push({origin:a,code:"too_small",minimum:n.value,input:i.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Zz=ve("$ZodCheckMultipleOf",(e,n)=>{tr.init(e,n),e._zod.onattach.push(a=>{var i;(i=a._zod.bag).multipleOf??(i.multipleOf=n.value)}),e._zod.check=a=>{if(typeof a.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof a.value=="bigint"?a.value%n.value===BigInt(0):GN(a.value,n.value)===0)||a.issues.push({origin:typeof a.value,code:"not_multiple_of",divisor:n.value,input:a.value,inst:e,continue:!n.abort})}}),Kz=ve("$ZodCheckNumberFormat",(e,n)=>{tr.init(e,n),n.format=n.format||"float64";const a=n.format?.includes("int"),i=a?"int":"number",[l,u]=JN[n.format];e._zod.onattach.push(f=>{const p=f._zod.bag;p.format=n.format,p.minimum=l,p.maximum=u,a&&(p.pattern=Iz)}),e._zod.check=f=>{const p=f.value;if(a){if(!Number.isInteger(p)){f.issues.push({expected:i,format:n.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?f.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!n.abort}):f.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!n.abort});return}}p<l&&f.issues.push({origin:"number",input:p,code:"too_small",minimum:l,inclusive:!0,inst:e,continue:!n.abort}),p>u&&f.issues.push({origin:"number",input:p,code:"too_big",maximum:u,inst:e})}}),Yz=ve("$ZodCheckMaxLength",(e,n)=>{var a;tr.init(e,n),(a=e._zod.def).when??(a.when=i=>{const l=i.value;return!Xy(l)&&l.length!==void 0}),e._zod.onattach.push(i=>{const l=i._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<l&&(i._zod.bag.maximum=n.maximum)}),e._zod.check=i=>{const l=i.value;if(l.length<=n.maximum)return;const f=Wy(l);i.issues.push({origin:f,code:"too_big",maximum:n.maximum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),Fz=ve("$ZodCheckMinLength",(e,n)=>{var a;tr.init(e,n),(a=e._zod.def).when??(a.when=i=>{const l=i.value;return!Xy(l)&&l.length!==void 0}),e._zod.onattach.push(i=>{const l=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>l&&(i._zod.bag.minimum=n.minimum)}),e._zod.check=i=>{const l=i.value;if(l.length>=n.minimum)return;const f=Wy(l);i.issues.push({origin:f,code:"too_small",minimum:n.minimum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),Gz=ve("$ZodCheckLengthEquals",(e,n)=>{var a;tr.init(e,n),(a=e._zod.def).when??(a.when=i=>{const l=i.value;return!Xy(l)&&l.length!==void 0}),e._zod.onattach.push(i=>{const l=i._zod.bag;l.minimum=n.length,l.maximum=n.length,l.length=n.length}),e._zod.check=i=>{const l=i.value,u=l.length;if(u===n.length)return;const f=Wy(l),p=u>n.length;i.issues.push({origin:f,...p?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!n.abort})}}),Td=ve("$ZodCheckStringFormat",(e,n)=>{var a,i;tr.init(e,n),e._zod.onattach.push(l=>{const u=l._zod.bag;u.format=n.format,n.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(n.pattern))}),n.pattern?(a=e._zod).check??(a.check=l=>{n.pattern.lastIndex=0,!n.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:n.format,input:l.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(i=e._zod).check??(i.check=()=>{})}),Xz=ve("$ZodCheckRegex",(e,n)=>{Td.init(e,n),e._zod.check=a=>{n.pattern.lastIndex=0,!n.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:"regex",input:a.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),Qz=ve("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=$z),Td.init(e,n)}),Wz=ve("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=qz),Td.init(e,n)}),Jz=ve("$ZodCheckIncludes",(e,n)=>{tr.init(e,n);const a=Sd(n.includes),i=new RegExp(typeof n.position=="number"?`^.{${n.position}}${a}`:a);n.pattern=i,e._zod.onattach.push(l=>{const u=l._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(i)}),e._zod.check=l=>{l.value.includes(n.includes,n.position)||l.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:l.value,inst:e,continue:!n.abort})}}),e4=ve("$ZodCheckStartsWith",(e,n)=>{tr.init(e,n);const a=new RegExp(`^${Sd(n.prefix)}.*`);n.pattern??(n.pattern=a),e._zod.onattach.push(i=>{const l=i._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(a)}),e._zod.check=i=>{i.value.startsWith(n.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:i.value,inst:e,continue:!n.abort})}}),t4=ve("$ZodCheckEndsWith",(e,n)=>{tr.init(e,n);const a=new RegExp(`.*${Sd(n.suffix)}$`);n.pattern??(n.pattern=a),e._zod.onattach.push(i=>{const l=i._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(a)}),e._zod.check=i=>{i.value.endsWith(n.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:i.value,inst:e,continue:!n.abort})}}),n4=ve("$ZodCheckOverwrite",(e,n)=>{tr.init(e,n),e._zod.check=a=>{a.value=n.tx(a.value)}});class r4{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const i=n.split(`
`).filter(f=>f),l=Math.min(...i.map(f=>f.length-f.trimStart().length)),u=i.map(f=>f.slice(l)).map(f=>" ".repeat(this.indent*2)+f);for(const f of u)this.content.push(f)}compile(){const n=Function,a=this?.args,l=[...(this?.content??[""]).map(u=>`  ${u}`)];return new n(...a,l.join(`
`))}}const a4={major:4,minor:1,patch:12},sn=ve("$ZodType",(e,n)=>{var a;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=a4;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const l of i)for(const u of l._zod.onattach)u(e);if(i.length===0)(a=e._zod).deferred??(a.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const l=(f,p,y)=>{let g=$s(f),v;for(const w of p){if(w._zod.def.when){if(!w._zod.def.when(f))continue}else if(g)continue;const _=f.issues.length,O=w._zod.check(f);if(O instanceof Promise&&y?.async===!1)throw new Ys;if(v||O instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await O,f.issues.length!==_&&(g||(g=$s(f,_)))});else{if(f.issues.length===_)continue;g||(g=$s(f,_))}}return v?v.then(()=>f):f},u=(f,p,y)=>{if($s(f))return f.aborted=!0,f;const g=l(p,i,y);if(g instanceof Promise){if(y.async===!1)throw new Ys;return g.then(v=>e._zod.parse(v,y))}return e._zod.parse(g,y)};e._zod.run=(f,p)=>{if(p.skipChecks)return e._zod.parse(f,p);if(p.direction==="backward"){const g=e._zod.parse({value:f.value,issues:[]},{...p,skipChecks:!0});return g instanceof Promise?g.then(v=>u(v,f,p)):u(g,f,p)}const y=e._zod.parse(f,p);if(y instanceof Promise){if(p.async===!1)throw new Ys;return y.then(g=>l(g,i,p))}return l(y,i,p)}}e["~standard"]={validate:l=>{try{const u=uz(e,l);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return cz(e,l).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},vendor:"zod",version:1}}),tg=ve("$ZodString",(e,n)=>{sn.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Vz(e._zod.bag),e._zod.parse=(a,i)=>{if(n.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),Nt=ve("$ZodStringFormat",(e,n)=>{Td.init(e,n),tg.init(e,n)}),i4=ve("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=Az),Nt.init(e,n)}),o4=ve("$ZodUUID",(e,n)=>{if(n.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(i===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=tx(i))}else n.pattern??(n.pattern=tx());Nt.init(e,n)}),s4=ve("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=Rz),Nt.init(e,n)}),l4=ve("$ZodURL",(e,n)=>{Nt.init(e,n),e._zod.check=a=>{try{const i=a.value.trim(),l=new URL(i);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(l.hostname)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:zz.source,input:a.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:a.value,inst:e,continue:!n.abort})),n.normalize?a.value=l.href:a.value=i;return}catch{a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:e,continue:!n.abort})}}}),u4=ve("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=Oz()),Nt.init(e,n)}),c4=ve("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=_z),Nt.init(e,n)}),f4=ve("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=bz),Nt.init(e,n)}),d4=ve("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=xz),Nt.init(e,n)}),h4=ve("$ZodULID",(e,n)=>{n.pattern??(n.pattern=wz),Nt.init(e,n)}),p4=ve("$ZodXID",(e,n)=>{n.pattern??(n.pattern=Sz),Nt.init(e,n)}),m4=ve("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=Ez),Nt.init(e,n)}),y4=ve("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=Uz(n)),Nt.init(e,n)}),g4=ve("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=Lz),Nt.init(e,n)}),v4=ve("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=Bz(n)),Nt.init(e,n)}),b4=ve("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=Tz),Nt.init(e,n)}),x4=ve("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=Dz),Nt.init(e,n),e._zod.onattach.push(a=>{const i=a._zod.bag;i.format="ipv4"})}),w4=ve("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=jz),Nt.init(e,n),e._zod.onattach.push(a=>{const i=a._zod.bag;i.format="ipv6"}),e._zod.check=a=>{try{new URL(`http://[${a.value}]`)}catch{a.issues.push({code:"invalid_format",format:"ipv6",input:a.value,inst:e,continue:!n.abort})}}}),S4=ve("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=Mz),Nt.init(e,n)}),E4=ve("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=kz),Nt.init(e,n),e._zod.check=a=>{const i=a.value.split("/");try{if(i.length!==2)throw new Error;const[l,u]=i;if(!u)throw new Error;const f=Number(u);if(`${f}`!==u)throw new Error;if(f<0||f>128)throw new Error;new URL(`http://[${l}]`)}catch{a.issues.push({code:"invalid_format",format:"cidrv6",input:a.value,inst:e,continue:!n.abort})}}});function PE(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const _4=ve("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=Nz),Nt.init(e,n),e._zod.onattach.push(a=>{a._zod.bag.contentEncoding="base64"}),e._zod.check=a=>{PE(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:e,continue:!n.abort})}});function T4(e){if(!DE.test(e))return!1;const n=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),a=n.padEnd(Math.ceil(n.length/4)*4,"=");return PE(a)}const A4=ve("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=DE),Nt.init(e,n),e._zod.onattach.push(a=>{a._zod.bag.contentEncoding="base64url"}),e._zod.check=a=>{T4(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:e,continue:!n.abort})}}),R4=ve("$ZodE164",(e,n)=>{n.pattern??(n.pattern=Pz),Nt.init(e,n)});function C4(e,n=null){try{const a=e.split(".");if(a.length!==3)return!1;const[i]=a;if(!i)return!1;const l=JSON.parse(atob(i));return!("typ"in l&&l?.typ!=="JWT"||!l.alg||n&&(!("alg"in l)||l.alg!==n))}catch{return!1}}const O4=ve("$ZodJWT",(e,n)=>{Nt.init(e,n),e._zod.check=a=>{C4(a.value,n.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:e,continue:!n.abort})}}),LE=ve("$ZodNumber",(e,n)=>{sn.init(e,n),e._zod.pattern=e._zod.bag.pattern??Hz,e._zod.parse=(a,i)=>{if(n.coerce)try{a.value=Number(a.value)}catch{}const l=a.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return a;const u=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:"Infinity":void 0;return a.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...u?{received:u}:{}}),a}}),D4=ve("$ZodNumber",(e,n)=>{Kz.init(e,n),LE.init(e,n)}),j4=ve("$ZodUnknown",(e,n)=>{sn.init(e,n),e._zod.parse=a=>a}),M4=ve("$ZodNever",(e,n)=>{sn.init(e,n),e._zod.parse=(a,i)=>(a.issues.push({expected:"never",code:"invalid_type",input:a.value,inst:e}),a)});function nx(e,n,a){e.issues.length&&n.issues.push(...AE(a,e.issues)),n.value[a]=e.value}const k4=ve("$ZodArray",(e,n)=>{sn.init(e,n),e._zod.parse=(a,i)=>{const l=a.value;if(!Array.isArray(l))return a.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),a;a.value=Array(l.length);const u=[];for(let f=0;f<l.length;f++){const p=l[f],y=n.element._zod.run({value:p,issues:[]},i);y instanceof Promise?u.push(y.then(g=>nx(g,a,f))):nx(y,a,f)}return u.length?Promise.all(u).then(()=>a):a}});function od(e,n,a,i){e.issues.length&&n.issues.push(...AE(a,e.issues)),e.value===void 0?a in i&&(n.value[a]=void 0):n.value[a]=e.value}function BE(e){const n=Object.keys(e.shape);for(const i of n)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const a=WN(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(a)}}function UE(e,n,a,i,l,u){const f=[],p=l.keySet,y=l.catchall._zod,g=y.def.type;for(const v of Object.keys(n)){if(p.has(v))continue;if(g==="never"){f.push(v);continue}const w=y.run({value:n[v],issues:[]},i);w instanceof Promise?e.push(w.then(_=>od(_,a,v,n))):od(w,a,v,n)}return f.length&&a.issues.push({code:"unrecognized_keys",keys:f,input:n,inst:u}),e.length?Promise.all(e).then(()=>a):a}const N4=ve("$ZodObject",(e,n)=>{if(sn.init(e,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){const p=n.shape;Object.defineProperty(n,"shape",{get:()=>{const y={...p};return Object.defineProperty(n,"shape",{value:y}),y}})}const i=Gy(()=>BE(n));Rt(e._zod,"propValues",()=>{const p=n.shape,y={};for(const g in p){const v=p[g]._zod;if(v.values){y[g]??(y[g]=new Set);for(const w of v.values)y[g].add(w)}}return y});const l=id,u=n.catchall;let f;e._zod.parse=(p,y)=>{f??(f=i.value);const g=p.value;if(!l(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p;p.value={};const v=[],w=f.shape;for(const _ of f.keys){const A=w[_]._zod.run({value:g[_],issues:[]},y);A instanceof Promise?v.push(A.then(j=>od(j,p,_,g))):od(A,p,_,g)}return u?UE(v,g,p,y,i.value,e):v.length?Promise.all(v).then(()=>p):p}}),z4=ve("$ZodObjectJIT",(e,n)=>{N4.init(e,n);const a=e._zod.parse,i=Gy(()=>BE(n)),l=_=>{const O=new r4(["shape","payload","ctx"]),A=i.value,j=L=>{const ae=ex(L);return`shape[${ae}]._zod.run({ value: input[${ae}], issues: [] }, ctx)`};O.write("const input = payload.value;");const N=Object.create(null);let P=0;for(const L of A.keys)N[L]=`key_${P++}`;O.write("const newResult = {};");for(const L of A.keys){const ae=N[L],ee=ex(L);O.write(`const ${ae} = ${j(L)};`),O.write(`
        if (${ae}.issues.length) {
          payload.issues = payload.issues.concat(${ae}.issues.map(iss => ({
            ...iss,
            path: iss.path ? [${ee}, ...iss.path] : [${ee}]
          })));
        }
        
        
        if (${ae}.value === undefined) {
          if (${ee} in input) {
            newResult[${ee}] = undefined;
          }
        } else {
          newResult[${ee}] = ${ae}.value;
        }
        
      `)}O.write("payload.value = newResult;"),O.write("return payload;");const H=O.compile();return(L,ae)=>H(_,L,ae)};let u;const f=id,p=!EE.jitless,g=p&&XN.value,v=n.catchall;let w;e._zod.parse=(_,O)=>{w??(w=i.value);const A=_.value;return f(A)?p&&g&&O?.async===!1&&O.jitless!==!0?(u||(u=l(n.shape)),_=u(_,O),v?UE([],A,_,O,w,e):_):a(_,O):(_.issues.push({expected:"object",code:"invalid_type",input:A,inst:e}),_)}});function rx(e,n,a,i){for(const u of e)if(u.issues.length===0)return n.value=u.value,n;const l=e.filter(u=>!$s(u));return l.length===1?(n.value=l[0].value,l[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:a,errors:e.map(u=>u.issues.map(f=>Ho(f,i,Io())))}),n)}const P4=ve("$ZodUnion",(e,n)=>{sn.init(e,n),Rt(e._zod,"optin",()=>n.options.some(l=>l._zod.optin==="optional")?"optional":void 0),Rt(e._zod,"optout",()=>n.options.some(l=>l._zod.optout==="optional")?"optional":void 0),Rt(e._zod,"values",()=>{if(n.options.every(l=>l._zod.values))return new Set(n.options.flatMap(l=>Array.from(l._zod.values)))}),Rt(e._zod,"pattern",()=>{if(n.options.every(l=>l._zod.pattern)){const l=n.options.map(u=>u._zod.pattern);return new RegExp(`^(${l.map(u=>Qy(u.source)).join("|")})$`)}});const a=n.options.length===1,i=n.options[0]._zod.run;e._zod.parse=(l,u)=>{if(a)return i(l,u);let f=!1;const p=[];for(const y of n.options){const g=y._zod.run({value:l.value,issues:[]},u);if(g instanceof Promise)p.push(g),f=!0;else{if(g.issues.length===0)return g;p.push(g)}}return f?Promise.all(p).then(y=>rx(y,l,e,u)):rx(p,l,e,u)}}),L4=ve("$ZodIntersection",(e,n)=>{sn.init(e,n),e._zod.parse=(a,i)=>{const l=a.value,u=n.left._zod.run({value:l,issues:[]},i),f=n.right._zod.run({value:l,issues:[]},i);return u instanceof Promise||f instanceof Promise?Promise.all([u,f]).then(([y,g])=>ax(a,y,g)):ax(a,u,f)}});function Bm(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(qu(e)&&qu(n)){const a=Object.keys(n),i=Object.keys(e).filter(u=>a.indexOf(u)!==-1),l={...e,...n};for(const u of i){const f=Bm(e[u],n[u]);if(!f.valid)return{valid:!1,mergeErrorPath:[u,...f.mergeErrorPath]};l[u]=f.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let i=0;i<e.length;i++){const l=e[i],u=n[i],f=Bm(l,u);if(!f.valid)return{valid:!1,mergeErrorPath:[i,...f.mergeErrorPath]};a.push(f.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}function ax(e,n,a){if(n.issues.length&&e.issues.push(...n.issues),a.issues.length&&e.issues.push(...a.issues),$s(e))return e;const i=Bm(n.value,a.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const B4=ve("$ZodEnum",(e,n)=>{sn.init(e,n);const a=FN(n.entries),i=new Set(a);e._zod.values=i,e._zod.pattern=new RegExp(`^(${a.filter(l=>QN.has(typeof l)).map(l=>typeof l=="string"?Sd(l):l.toString()).join("|")})$`),e._zod.parse=(l,u)=>{const f=l.value;return i.has(f)||l.issues.push({code:"invalid_value",values:a,input:f,inst:e}),l}}),U4=ve("$ZodTransform",(e,n)=>{sn.init(e,n),e._zod.parse=(a,i)=>{if(i.direction==="backward")throw new SE(e.constructor.name);const l=n.transform(a.value,a);if(i.async)return(l instanceof Promise?l:Promise.resolve(l)).then(f=>(a.value=f,a));if(l instanceof Promise)throw new Ys;return a.value=l,a}});function ix(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const V4=ve("$ZodOptional",(e,n)=>{sn.init(e,n),e._zod.optin="optional",e._zod.optout="optional",Rt(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),Rt(e._zod,"pattern",()=>{const a=n.innerType._zod.pattern;return a?new RegExp(`^(${Qy(a.source)})?$`):void 0}),e._zod.parse=(a,i)=>{if(n.innerType._zod.optin==="optional"){const l=n.innerType._zod.run(a,i);return l instanceof Promise?l.then(u=>ix(u,a.value)):ix(l,a.value)}return a.value===void 0?a:n.innerType._zod.run(a,i)}}),I4=ve("$ZodNullable",(e,n)=>{sn.init(e,n),Rt(e._zod,"optin",()=>n.innerType._zod.optin),Rt(e._zod,"optout",()=>n.innerType._zod.optout),Rt(e._zod,"pattern",()=>{const a=n.innerType._zod.pattern;return a?new RegExp(`^(${Qy(a.source)}|null)$`):void 0}),Rt(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(a,i)=>a.value===null?a:n.innerType._zod.run(a,i)}),H4=ve("$ZodDefault",(e,n)=>{sn.init(e,n),e._zod.optin="optional",Rt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(a,i)=>{if(i.direction==="backward")return n.innerType._zod.run(a,i);if(a.value===void 0)return a.value=n.defaultValue,a;const l=n.innerType._zod.run(a,i);return l instanceof Promise?l.then(u=>ox(u,n)):ox(l,n)}});function ox(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const $4=ve("$ZodPrefault",(e,n)=>{sn.init(e,n),e._zod.optin="optional",Rt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(a,i)=>(i.direction==="backward"||a.value===void 0&&(a.value=n.defaultValue),n.innerType._zod.run(a,i))}),q4=ve("$ZodNonOptional",(e,n)=>{sn.init(e,n),Rt(e._zod,"values",()=>{const a=n.innerType._zod.values;return a?new Set([...a].filter(i=>i!==void 0)):void 0}),e._zod.parse=(a,i)=>{const l=n.innerType._zod.run(a,i);return l instanceof Promise?l.then(u=>sx(u,e)):sx(l,e)}});function sx(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const Z4=ve("$ZodCatch",(e,n)=>{sn.init(e,n),Rt(e._zod,"optin",()=>n.innerType._zod.optin),Rt(e._zod,"optout",()=>n.innerType._zod.optout),Rt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(a,i)=>{if(i.direction==="backward")return n.innerType._zod.run(a,i);const l=n.innerType._zod.run(a,i);return l instanceof Promise?l.then(u=>(a.value=u.value,u.issues.length&&(a.value=n.catchValue({...a,error:{issues:u.issues.map(f=>Ho(f,i,Io()))},input:a.value}),a.issues=[]),a)):(a.value=l.value,l.issues.length&&(a.value=n.catchValue({...a,error:{issues:l.issues.map(u=>Ho(u,i,Io()))},input:a.value}),a.issues=[]),a)}}),K4=ve("$ZodPipe",(e,n)=>{sn.init(e,n),Rt(e._zod,"values",()=>n.in._zod.values),Rt(e._zod,"optin",()=>n.in._zod.optin),Rt(e._zod,"optout",()=>n.out._zod.optout),Rt(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(a,i)=>{if(i.direction==="backward"){const u=n.out._zod.run(a,i);return u instanceof Promise?u.then(f=>jf(f,n.in,i)):jf(u,n.in,i)}const l=n.in._zod.run(a,i);return l instanceof Promise?l.then(u=>jf(u,n.out,i)):jf(l,n.out,i)}});function jf(e,n,a){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},a)}const Y4=ve("$ZodReadonly",(e,n)=>{sn.init(e,n),Rt(e._zod,"propValues",()=>n.innerType._zod.propValues),Rt(e._zod,"values",()=>n.innerType._zod.values),Rt(e._zod,"optin",()=>n.innerType._zod.optin),Rt(e._zod,"optout",()=>n.innerType._zod.optout),e._zod.parse=(a,i)=>{if(i.direction==="backward")return n.innerType._zod.run(a,i);const l=n.innerType._zod.run(a,i);return l instanceof Promise?l.then(lx):lx(l)}});function lx(e){return e.value=Object.freeze(e.value),e}const F4=ve("$ZodCustom",(e,n)=>{tr.init(e,n),sn.init(e,n),e._zod.parse=(a,i)=>a,e._zod.check=a=>{const i=a.value,l=n.fn(i);if(l instanceof Promise)return l.then(u=>ux(u,a,i,e));ux(l,a,i,e)}});function ux(e,n,a,i){if(!e){const l={code:"custom",input:a,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(l.params=i._zod.def.params),n.issues.push(Zu(l))}}class G4{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...a){const i=a[0];if(this._map.set(n,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,n)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const a=this._map.get(n);return a&&typeof a=="object"&&"id"in a&&this._idmap.delete(a.id),this._map.delete(n),this}get(n){const a=n._zod.parent;if(a){const i={...this.get(a)??{}};delete i.id;const l={...i,...this._map.get(n)};return Object.keys(l).length?l:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function X4(){return new G4}const Mf=X4();function Q4(e,n){return new e({type:"string",...Ue(n)})}function W4(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ue(n)})}function cx(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ue(n)})}function J4(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ue(n)})}function eP(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ue(n)})}function tP(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ue(n)})}function nP(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ue(n)})}function rP(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ue(n)})}function aP(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ue(n)})}function iP(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ue(n)})}function oP(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ue(n)})}function sP(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ue(n)})}function lP(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ue(n)})}function uP(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ue(n)})}function cP(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ue(n)})}function fP(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ue(n)})}function dP(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ue(n)})}function hP(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ue(n)})}function pP(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ue(n)})}function mP(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ue(n)})}function yP(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ue(n)})}function gP(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ue(n)})}function vP(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ue(n)})}function bP(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ue(n)})}function xP(e,n){return new e({type:"string",format:"date",check:"string_format",...Ue(n)})}function wP(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ue(n)})}function SP(e,n){return new e({type:"string",format:"duration",check:"string_format",...Ue(n)})}function EP(e,n){return new e({type:"number",checks:[],...Ue(n)})}function _P(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ue(n)})}function TP(e){return new e({type:"unknown"})}function AP(e,n){return new e({type:"never",...Ue(n)})}function fx(e,n){return new NE({check:"less_than",...Ue(n),value:e,inclusive:!1})}function Wp(e,n){return new NE({check:"less_than",...Ue(n),value:e,inclusive:!0})}function dx(e,n){return new zE({check:"greater_than",...Ue(n),value:e,inclusive:!1})}function Jp(e,n){return new zE({check:"greater_than",...Ue(n),value:e,inclusive:!0})}function hx(e,n){return new Zz({check:"multiple_of",...Ue(n),value:e})}function VE(e,n){return new Yz({check:"max_length",...Ue(n),maximum:e})}function sd(e,n){return new Fz({check:"min_length",...Ue(n),minimum:e})}function IE(e,n){return new Gz({check:"length_equals",...Ue(n),length:e})}function RP(e,n){return new Xz({check:"string_format",format:"regex",...Ue(n),pattern:e})}function CP(e){return new Qz({check:"string_format",format:"lowercase",...Ue(e)})}function OP(e){return new Wz({check:"string_format",format:"uppercase",...Ue(e)})}function DP(e,n){return new Jz({check:"string_format",format:"includes",...Ue(n),includes:e})}function jP(e,n){return new e4({check:"string_format",format:"starts_with",...Ue(n),prefix:e})}function MP(e,n){return new t4({check:"string_format",format:"ends_with",...Ue(n),suffix:e})}function nc(e){return new n4({check:"overwrite",tx:e})}function kP(e){return nc(n=>n.normalize(e))}function NP(){return nc(e=>e.trim())}function zP(){return nc(e=>e.toLowerCase())}function PP(){return nc(e=>e.toUpperCase())}function LP(e,n,a){return new e({type:"array",element:n,...Ue(a)})}function BP(e,n,a){return new e({type:"custom",check:"custom",fn:n,...Ue(a)})}function UP(e){const n=VP(a=>(a.addIssue=i=>{if(typeof i=="string")a.issues.push(Zu(i,a.value,n._zod.def));else{const l=i;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=a.value),l.inst??(l.inst=n),l.continue??(l.continue=!n._zod.def.abort),a.issues.push(Zu(l))}},e(a.value,a)));return n}function VP(e,n){const a=new tr({check:"custom",...Ue(n)});return a._zod.check=e,a}const IP=ve("ZodISODateTime",(e,n)=>{y4.init(e,n),It.init(e,n)});function HP(e){return bP(IP,e)}const $P=ve("ZodISODate",(e,n)=>{g4.init(e,n),It.init(e,n)});function qP(e){return xP($P,e)}const ZP=ve("ZodISOTime",(e,n)=>{v4.init(e,n),It.init(e,n)});function KP(e){return wP(ZP,e)}const YP=ve("ZodISODuration",(e,n)=>{b4.init(e,n),It.init(e,n)});function FP(e){return SP(YP,e)}const GP=(e,n)=>{CE.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:a=>lz(e,a)},flatten:{value:a=>sz(e,a)},addIssue:{value:a=>{e.issues.push(a),e.message=JSON.stringify(e.issues,Lm,2)}},addIssues:{value:a=>{e.issues.push(...a),e.message=JSON.stringify(e.issues,Lm,2)}},isEmpty:{get(){return e.issues.length===0}}})},Or=ve("ZodError",GP,{Parent:Error}),XP=Jy(Or),QP=eg(Or),WP=Ed(Or),JP=_d(Or),e3=fz(Or),t3=dz(Or),n3=hz(Or),r3=pz(Or),a3=mz(Or),i3=yz(Or),o3=gz(Or),s3=vz(Or),hn=ve("ZodType",(e,n)=>(sn.init(e,n),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...a)=>e.clone(Ko(n,{checks:[...n.checks??[],...a.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]})),e.clone=(a,i)=>qi(e,a,i),e.brand=()=>e,e.register=((a,i)=>(a.add(e,i),e)),e.parse=(a,i)=>XP(e,a,i,{callee:e.parse}),e.safeParse=(a,i)=>WP(e,a,i),e.parseAsync=async(a,i)=>QP(e,a,i,{callee:e.parseAsync}),e.safeParseAsync=async(a,i)=>JP(e,a,i),e.spa=e.safeParseAsync,e.encode=(a,i)=>e3(e,a,i),e.decode=(a,i)=>t3(e,a,i),e.encodeAsync=async(a,i)=>n3(e,a,i),e.decodeAsync=async(a,i)=>r3(e,a,i),e.safeEncode=(a,i)=>a3(e,a,i),e.safeDecode=(a,i)=>i3(e,a,i),e.safeEncodeAsync=async(a,i)=>o3(e,a,i),e.safeDecodeAsync=async(a,i)=>s3(e,a,i),e.refine=(a,i)=>e.check(eL(a,i)),e.superRefine=a=>e.check(tL(a)),e.overwrite=a=>e.check(nc(a)),e.optional=()=>gx(e),e.nullable=()=>vx(e),e.nullish=()=>gx(vx(e)),e.nonoptional=a=>Y3(e,a),e.array=()=>k3(e),e.or=a=>L3([e,a]),e.and=a=>U3(e,a),e.transform=a=>Vm(e,qE(a)),e.default=a=>q3(e,a),e.prefault=a=>K3(e,a),e.catch=a=>G3(e,a),e.pipe=a=>Vm(e,a),e.readonly=()=>W3(e),e.describe=a=>{const i=e.clone();return Mf.add(i,{description:a}),i},Object.defineProperty(e,"description",{get(){return Mf.get(e)?.description},configurable:!0}),e.meta=(...a)=>{if(a.length===0)return Mf.get(e);const i=e.clone();return Mf.add(i,a[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),HE=ve("_ZodString",(e,n)=>{tg.init(e,n),hn.init(e,n);const a=e._zod.bag;e.format=a.format??null,e.minLength=a.minimum??null,e.maxLength=a.maximum??null,e.regex=(...i)=>e.check(RP(...i)),e.includes=(...i)=>e.check(DP(...i)),e.startsWith=(...i)=>e.check(jP(...i)),e.endsWith=(...i)=>e.check(MP(...i)),e.min=(...i)=>e.check(sd(...i)),e.max=(...i)=>e.check(VE(...i)),e.length=(...i)=>e.check(IE(...i)),e.nonempty=(...i)=>e.check(sd(1,...i)),e.lowercase=i=>e.check(CP(i)),e.uppercase=i=>e.check(OP(i)),e.trim=()=>e.check(NP()),e.normalize=(...i)=>e.check(kP(...i)),e.toLowerCase=()=>e.check(zP()),e.toUpperCase=()=>e.check(PP())}),l3=ve("ZodString",(e,n)=>{tg.init(e,n),HE.init(e,n),e.email=a=>e.check(W4(c3,a)),e.url=a=>e.check(rP(f3,a)),e.jwt=a=>e.check(vP(A3,a)),e.emoji=a=>e.check(aP(d3,a)),e.guid=a=>e.check(cx(px,a)),e.uuid=a=>e.check(J4(kf,a)),e.uuidv4=a=>e.check(eP(kf,a)),e.uuidv6=a=>e.check(tP(kf,a)),e.uuidv7=a=>e.check(nP(kf,a)),e.nanoid=a=>e.check(iP(h3,a)),e.guid=a=>e.check(cx(px,a)),e.cuid=a=>e.check(oP(p3,a)),e.cuid2=a=>e.check(sP(m3,a)),e.ulid=a=>e.check(lP(y3,a)),e.base64=a=>e.check(mP(E3,a)),e.base64url=a=>e.check(yP(_3,a)),e.xid=a=>e.check(uP(g3,a)),e.ksuid=a=>e.check(cP(v3,a)),e.ipv4=a=>e.check(fP(b3,a)),e.ipv6=a=>e.check(dP(x3,a)),e.cidrv4=a=>e.check(hP(w3,a)),e.cidrv6=a=>e.check(pP(S3,a)),e.e164=a=>e.check(gP(T3,a)),e.datetime=a=>e.check(HP(a)),e.date=a=>e.check(qP(a)),e.time=a=>e.check(KP(a)),e.duration=a=>e.check(FP(a))});function u3(e){return Q4(l3,e)}const It=ve("ZodStringFormat",(e,n)=>{Nt.init(e,n),HE.init(e,n)}),c3=ve("ZodEmail",(e,n)=>{s4.init(e,n),It.init(e,n)}),px=ve("ZodGUID",(e,n)=>{i4.init(e,n),It.init(e,n)}),kf=ve("ZodUUID",(e,n)=>{o4.init(e,n),It.init(e,n)}),f3=ve("ZodURL",(e,n)=>{l4.init(e,n),It.init(e,n)}),d3=ve("ZodEmoji",(e,n)=>{u4.init(e,n),It.init(e,n)}),h3=ve("ZodNanoID",(e,n)=>{c4.init(e,n),It.init(e,n)}),p3=ve("ZodCUID",(e,n)=>{f4.init(e,n),It.init(e,n)}),m3=ve("ZodCUID2",(e,n)=>{d4.init(e,n),It.init(e,n)}),y3=ve("ZodULID",(e,n)=>{h4.init(e,n),It.init(e,n)}),g3=ve("ZodXID",(e,n)=>{p4.init(e,n),It.init(e,n)}),v3=ve("ZodKSUID",(e,n)=>{m4.init(e,n),It.init(e,n)}),b3=ve("ZodIPv4",(e,n)=>{x4.init(e,n),It.init(e,n)}),x3=ve("ZodIPv6",(e,n)=>{w4.init(e,n),It.init(e,n)}),w3=ve("ZodCIDRv4",(e,n)=>{S4.init(e,n),It.init(e,n)}),S3=ve("ZodCIDRv6",(e,n)=>{E4.init(e,n),It.init(e,n)}),E3=ve("ZodBase64",(e,n)=>{_4.init(e,n),It.init(e,n)}),_3=ve("ZodBase64URL",(e,n)=>{A4.init(e,n),It.init(e,n)}),T3=ve("ZodE164",(e,n)=>{R4.init(e,n),It.init(e,n)}),A3=ve("ZodJWT",(e,n)=>{O4.init(e,n),It.init(e,n)}),$E=ve("ZodNumber",(e,n)=>{LE.init(e,n),hn.init(e,n),e.gt=(i,l)=>e.check(dx(i,l)),e.gte=(i,l)=>e.check(Jp(i,l)),e.min=(i,l)=>e.check(Jp(i,l)),e.lt=(i,l)=>e.check(fx(i,l)),e.lte=(i,l)=>e.check(Wp(i,l)),e.max=(i,l)=>e.check(Wp(i,l)),e.int=i=>e.check(mx(i)),e.safe=i=>e.check(mx(i)),e.positive=i=>e.check(dx(0,i)),e.nonnegative=i=>e.check(Jp(0,i)),e.negative=i=>e.check(fx(0,i)),e.nonpositive=i=>e.check(Wp(0,i)),e.multipleOf=(i,l)=>e.check(hx(i,l)),e.step=(i,l)=>e.check(hx(i,l)),e.finite=()=>e;const a=e._zod.bag;e.minValue=Math.max(a.minimum??Number.NEGATIVE_INFINITY,a.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(a.maximum??Number.POSITIVE_INFINITY,a.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(a.format??"").includes("int")||Number.isSafeInteger(a.multipleOf??.5),e.isFinite=!0,e.format=a.format??null});function R3(e){return EP($E,e)}const C3=ve("ZodNumberFormat",(e,n)=>{D4.init(e,n),$E.init(e,n)});function mx(e){return _P(C3,e)}const O3=ve("ZodUnknown",(e,n)=>{j4.init(e,n),hn.init(e,n)});function yx(){return TP(O3)}const D3=ve("ZodNever",(e,n)=>{M4.init(e,n),hn.init(e,n)});function j3(e){return AP(D3,e)}const M3=ve("ZodArray",(e,n)=>{k4.init(e,n),hn.init(e,n),e.element=n.element,e.min=(a,i)=>e.check(sd(a,i)),e.nonempty=a=>e.check(sd(1,a)),e.max=(a,i)=>e.check(VE(a,i)),e.length=(a,i)=>e.check(IE(a,i)),e.unwrap=()=>e.element});function k3(e,n){return LP(M3,e,n)}const N3=ve("ZodObject",(e,n)=>{z4.init(e,n),hn.init(e,n),Rt(e,"shape",()=>n.shape),e.keyof=()=>V3(Object.keys(e._zod.def.shape)),e.catchall=a=>e.clone({...e._zod.def,catchall:a}),e.passthrough=()=>e.clone({...e._zod.def,catchall:yx()}),e.loose=()=>e.clone({...e._zod.def,catchall:yx()}),e.strict=()=>e.clone({...e._zod.def,catchall:j3()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=a=>nz(e,a),e.safeExtend=a=>rz(e,a),e.merge=a=>az(e,a),e.pick=a=>ez(e,a),e.omit=a=>tz(e,a),e.partial=(...a)=>iz(ZE,e,a[0]),e.required=(...a)=>oz(KE,e,a[0])});function z3(e,n){const a={type:"object",shape:e??{},...Ue(n)};return new N3(a)}const P3=ve("ZodUnion",(e,n)=>{P4.init(e,n),hn.init(e,n),e.options=n.options});function L3(e,n){return new P3({type:"union",options:e,...Ue(n)})}const B3=ve("ZodIntersection",(e,n)=>{L4.init(e,n),hn.init(e,n)});function U3(e,n){return new B3({type:"intersection",left:e,right:n})}const Um=ve("ZodEnum",(e,n)=>{B4.init(e,n),hn.init(e,n),e.enum=n.entries,e.options=Object.values(n.entries);const a=new Set(Object.keys(n.entries));e.extract=(i,l)=>{const u={};for(const f of i)if(a.has(f))u[f]=n.entries[f];else throw new Error(`Key ${f} not found in enum`);return new Um({...n,checks:[],...Ue(l),entries:u})},e.exclude=(i,l)=>{const u={...n.entries};for(const f of i)if(a.has(f))delete u[f];else throw new Error(`Key ${f} not found in enum`);return new Um({...n,checks:[],...Ue(l),entries:u})}});function V3(e,n){const a=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Um({type:"enum",entries:a,...Ue(n)})}const I3=ve("ZodTransform",(e,n)=>{U4.init(e,n),hn.init(e,n),e._zod.parse=(a,i)=>{if(i.direction==="backward")throw new SE(e.constructor.name);a.addIssue=u=>{if(typeof u=="string")a.issues.push(Zu(u,a.value,n));else{const f=u;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=a.value),f.inst??(f.inst=e),a.issues.push(Zu(f))}};const l=n.transform(a.value,a);return l instanceof Promise?l.then(u=>(a.value=u,a)):(a.value=l,a)}});function qE(e){return new I3({type:"transform",transform:e})}const ZE=ve("ZodOptional",(e,n)=>{V4.init(e,n),hn.init(e,n),e.unwrap=()=>e._zod.def.innerType});function gx(e){return new ZE({type:"optional",innerType:e})}const H3=ve("ZodNullable",(e,n)=>{I4.init(e,n),hn.init(e,n),e.unwrap=()=>e._zod.def.innerType});function vx(e){return new H3({type:"nullable",innerType:e})}const $3=ve("ZodDefault",(e,n)=>{H4.init(e,n),hn.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function q3(e,n){return new $3({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():TE(n)}})}const Z3=ve("ZodPrefault",(e,n)=>{$4.init(e,n),hn.init(e,n),e.unwrap=()=>e._zod.def.innerType});function K3(e,n){return new Z3({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():TE(n)}})}const KE=ve("ZodNonOptional",(e,n)=>{q4.init(e,n),hn.init(e,n),e.unwrap=()=>e._zod.def.innerType});function Y3(e,n){return new KE({type:"nonoptional",innerType:e,...Ue(n)})}const F3=ve("ZodCatch",(e,n)=>{Z4.init(e,n),hn.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function G3(e,n){return new F3({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const X3=ve("ZodPipe",(e,n)=>{K4.init(e,n),hn.init(e,n),e.in=n.in,e.out=n.out});function Vm(e,n){return new X3({type:"pipe",in:e,out:n})}const Q3=ve("ZodReadonly",(e,n)=>{Y4.init(e,n),hn.init(e,n),e.unwrap=()=>e._zod.def.innerType});function W3(e){return new Q3({type:"readonly",innerType:e})}const J3=ve("ZodCustom",(e,n)=>{F4.init(e,n),hn.init(e,n)});function eL(e,n={}){return BP(J3,e,n)}function tL(e){return UP(e)}function nL(e,n){return Vm(qE(e),n)}const bx=e=>nL(n=>typeof n=="string"?/^\d+$/.test(n)?/^0\d+/.test(n)?NaN:Number(n):NaN:n,R3().min(100,e==="width"?qn.CANVAS_REQUIRED_WIDTH_MIN:qn.CANVAS_REQUIRED_HEIGHT_MIN).max(4e3,e==="width"?qn.CANVAS_REQUIRED_WIDTH_MAX:qn.CANVAS_REQUIRED_HEIGHT_MAX)),rL=z3({name:u3().min(1,qn.NAME_EMPTY).max(25,qn.NAME_REQUEST),width:bx("width"),height:bx("height")});function aL({children:e,"data-testid":n}){return R.jsx("div",{role:"dialog","aria-modal":"true","data-testid":n,className:"fixed inset-0 bg-black/40 backdrop-blur-sm flex items-center justify-center z-50",children:e})}function iL({title:e,children:n,"data-testid":a,onSubmit:i}){return R.jsxs(Qe.form,{noValidate:!0,"data-testid":a,initial:{opacity:0,scale:.92,y:15},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:15},transition:{duration:.25,ease:"easeOut"},onSubmit:i,className:"relative bg-gradient-to-br from-white to-gray-50 border border-gray-200 rounded-2xl p-8 shadow-xl w-[420px] space-y-6",children:[R.jsxs("div",{className:"flex flex-col items-start",children:[R.jsx("h2",{className:"text-[22px] font-semibold text-gray-900 tracking-tight",children:e}),R.jsx("div",{className:"w-10 border-t-2 border-indigo-500 mt-2"})]}),n]})}function xx(e){e.key==="Enter"&&e.preventDefault()}function Bi(e,n,a){const i=n.getBoundingClientRect(),l=(e.clientX-i.left)/i.width,u=(e.clientY-i.top)/i.height,f=a?.dpr??1;return{x:l*n.width/f,y:u*n.height/f}}function oL({showInput:e,showCanvasInputs:n,customContent:a,name:i,width:l,height:u,error:f,setName:p,setWidth:y,setHeight:g}){return e?R.jsxs("div",{className:"space-y-4",children:[R.jsxs("div",{className:"space-y-2",children:[R.jsx("label",{htmlFor:"project-name",className:"block text-sm font-medium text-gray-600",children:"Project name"}),R.jsx("input",{id:"project-name",type:"text",value:i,"data-testid":"project-input",placeholder:"Enter project name",onChange:v=>p(v.target.value),className:`border border-gray-300 rounded-lg px-4 py-2.5 w-full text-gray-800 bg-white/80
							   focus:ring-2 focus:ring-indigo-500 focus:shadow-[0_0_8px_rgba(99,102,241,0.25)]
							   outline-none transition`})]}),n&&R.jsxs("div",{className:"flex gap-4",children:[R.jsxs("div",{className:"flex-1",children:[R.jsx("label",{className:"block text-sm font-medium text-gray-600",children:"Width (px)"}),R.jsx("input",{type:"number",value:l,onKeyDown:xx,onChange:v=>y(Number(v.target.value)),"data-testid":"canvas-width",className:"border border-gray-300 rounded-lg px-3 py-2 w-full text-gray-800 bg-white/80 focus:ring-2 focus:ring-indigo-500 outline-none transition"})]}),R.jsxs("div",{className:"flex-1",children:[R.jsx("label",{className:"block text-sm font-medium text-gray-600",children:"Height (px)"}),R.jsx("input",{type:"number",onKeyDown:xx,value:u,onChange:v=>g(Number(v.target.value)),"data-testid":"canvas-height",className:"border border-gray-300 rounded-lg px-3 py-2 w-full text-gray-800 bg-white/80 focus:ring-2 focus:ring-indigo-500 outline-none transition"})]})]}),f&&R.jsx("p",{role:"alert",className:"text-red-500 text-sm mt-1",children:f})]}):R.jsx("div",{className:"text-gray-700 text-sm",children:a})}function sL({onClose:e,buttonLabel:n,loading:a,showInput:i=!0}){return R.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-100",children:[R.jsx(Qe.button,{type:"button",whileHover:{y:-1},whileTap:{scale:.97},onClick:e,className:`rounded-full px-4 py-1.5 text-sm font-medium text-gray-600
						   hover:text-gray-800 hover:bg-gray-100
						   transition focus:outline-none`,children:"Cancel"}),R.jsx(Qe.button,{type:"submit","data-testid":"project-submit",whileHover:{y:-1},whileTap:{scale:.97},disabled:a,className:`rounded-full px-5 py-1.5 text-sm font-semibold text-white transition-all shadow-sm focus:outline-none ${i?"bg-indigo-600 hover:bg-indigo-700 active:bg-indigo-800":"bg-rose-600 hover:bg-rose-700 active:bg-rose-800"} focus:ring-2 focus:ring-indigo-400 disabled:opacity-70`,children:a?`${n}ing...`:n})]})}function ng({title:e,buttonLabel:n,onClose:a,onSubmitAction:i,initialValue:l="",buildArgs:u,showInput:f=!0,showCanvasInputs:p=!1,customContent:y,"data-testid":g}){const v=en(),[w,_]=D.useState(l),[O,A]=D.useState(800),[j,N]=D.useState(600),[P,H]=D.useState(!1),[L,ae]=D.useState(null);async function ee(fe){if(fe.preventDefault(),ae(null),f||p){const ue=rL.safeParse({name:w,width:O,height:j});if(!ue.success){ae(ue.error.issues[0]?.message??qn.ERROR_VALIDATION);return}}try{H(!0),await i(v,u(w,O,j)),a()}catch(ue){const le=(ue instanceof Error?ue.message:"")||"";ae(le.includes("exists")?qn.NAME_DUPLICATE:qn.UNEXPECTED_SERVER_ERROR)}finally{H(!1)}}return R.jsx(aL,{"data-testid":g,children:R.jsxs(iL,{onSubmit:ee,"data-testid":"project-form",title:e,children:[R.jsx(oL,{showInput:f,showCanvasInputs:p,customContent:y,name:w,width:O,height:j,error:L,setName:_,setWidth:A,setHeight:N}),R.jsx(sL,{onClose:a,buttonLabel:n,loading:P,showInput:f})]})})}const Nf=ct.memo(function({label:n,icon:a,color:i,onClick:l,testId:u}){const[f,p]=D.useState(!1),g={indigo:{text:"text-indigo-600 hover:text-indigo-700",bg:"from-indigo-400/20 to-indigo-500/20"},rose:{text:"text-rose-600 hover:text-rose-700",bg:"from-rose-400/20 to-rose-500/20"}}[i];return R.jsxs(Qe.button,{"aria-label":`${n.toLowerCase()} project`,"data-testid":u,whileHover:{scale:1.05},whileTap:{scale:.96},onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),onClick:l,className:`relative group flex items-center gap-1 px-3 py-1.5 text-sm font-medium rounded-md overflow-hidden cursor-pointer transition-all duration-300 focus:outline-none ${g.text}`,children:[R.jsxs("span",{className:"relative z-10 flex items-center gap-1",children:[n,R.jsx(Hr,{children:f&&a})]}),R.jsx("span",{className:`absolute inset-0 bg-gradient-to-r ${g.bg} opacity-0 group-hover:opacity-60 blur-md transition-opacity rounded-md`})]})}),wx=ct.memo(function({date:n}){const a=n.getHours(),i=n.getMinutes(),l=a%12*30+i*.5,u=i*6;return R.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",className:"w-5 h-5 text-indigo-500 flex-shrink-0","aria-hidden":"true",children:[R.jsx("circle",{cx:"12",cy:"12",r:"9"}),R.jsx("line",{x1:"12",y1:"12",x2:12+3.5*Math.sin(Math.PI/180*l),y2:12-3.5*Math.cos(Math.PI/180*l)}),R.jsx("line",{x1:"12",y1:"12",x2:12+5.5*Math.sin(Math.PI/180*u),y2:12-5.5*Math.cos(Math.PI/180*u)})]})}),lL=ct.memo(function({createdAt:n,updatedAt:a}){const i=f=>{const p=new Date(f);return{date:p.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),time:p.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}),raw:p}},l=i(n),u=i(a);return R.jsxs("div",{className:"space-y-2 text-xs text-gray-500",children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx(wx,{date:l.raw}),R.jsxs("p",{children:[R.jsx("span",{className:"font-medium text-gray-800",children:"Created:"})," ",l.date," ",R.jsxs("span",{className:"text-gray-400",children:["• ",l.time]})]})]}),R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx(wx,{date:u.raw}),R.jsxs("p",{children:[R.jsx("span",{className:"font-medium text-gray-800",children:"Updated:"})," ",u.date," ",R.jsxs("span",{className:"text-gray-400",children:["• ",u.time]})]})]})]})}),uL=()=>R.jsxs(Qe.svg,{initial:{opacity:0,x:-4},animate:{opacity:1,x:0},exit:{opacity:0,x:-4},transition:{duration:.15},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-4 h-4 text-indigo-500 drop-shadow-sm",children:[R.jsx("path",{d:"M12 20h9"}),R.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4Z"})]},"pencil"),cL=()=>R.jsxs(Qe.svg,{initial:{opacity:0,x:-4},animate:{opacity:1,x:0},exit:{opacity:0,x:-4},transition:{duration:.15},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-4 h-4 text-indigo-500 drop-shadow-sm",children:[R.jsx("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),R.jsx("path",{d:"M5 12v8a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H9l-4-4z"})]},"open"),fL=()=>R.jsxs(Qe.svg,{initial:{opacity:0,x:-3,rotate:-15},animate:{opacity:1,x:0,rotate:0},exit:{opacity:0,x:-3,rotate:15},transition:{duration:.25,ease:"easeOut"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-4 h-4 text-rose-500 drop-shadow-sm",children:[R.jsx("polyline",{points:"3 6 5 6 21 6"}),R.jsx("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6m3-3h8a1 1 0 0 1 1 1v2H7V4a1 1 0 0 1 1-1z"})]},"trash"),dL=()=>R.jsx(Qe.svg,{initial:{opacity:0,x:-4},animate:{opacity:1,x:0},exit:{opacity:0,x:-4},transition:{duration:.15},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-4 h-4 text-indigo-500 drop-shadow-sm",children:R.jsx("path",{d:"M5 13l4 4L19 7"})},"check"),hL=ct.memo(function({project:n,onEditClick:a,onDeleteClick:i,"data-testid":l="project-card"}){const u=Fu(),f=en(),[p,y]=D.useState(!1),[g,v]=D.useState(!1),[w,_]=D.useState(!1),O=()=>{v(!0),setTimeout(()=>{v(!1),_(!0),y(!0)},400)},A=async()=>{if(!n?.id){O();return}try{if(!await Mo.getById(n.id)){O();return}await Fy.setActiveProject(f,n.id),u(ku.EDITOR_BY_ID(n.id))}catch{O()}},j=()=>{y(!1),setTimeout(()=>_(!1),600)};return R.jsxs("div",{className:"relative w-full max-w-[280px] h-[200px] perspective-[1000px]","data-testid":l,children:[R.jsx(Qe.div,{animate:g?{x:[-4,4,-3,3,-2,2,0]}:p?{rotateY:180}:{rotateY:0},transition:{duration:g?.4:.6,ease:"easeInOut"},className:"absolute w-full h-full backface-hidden",children:R.jsxs("div",{className:"bg-gradient-to-br from-white to-gray-50 border border-gray-200 shadow-sm hover:shadow-md rounded-2xl p-5 flex flex-col justify-between transition-all duration-200 w-full h-full",children:[R.jsxs("div",{children:[R.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-3 truncate",children:n?.name??"Unknown project"}),R.jsx("div",{className:"w-10 border-t border-indigo-500 mb-4"}),n&&R.jsx(lL,{createdAt:n.createdAt,updatedAt:n.updatedAt})]}),R.jsxs("div",{className:"flex justify-between items-center mt-5",children:[R.jsx(Nf,{label:"Open",testId:`open-button-${n?.id??"unknown"}`,color:"indigo",onClick:A,icon:R.jsx(cL,{})}),R.jsx(Nf,{label:"Update",testId:`update-button-${n?.id??"unknown"}`,color:"indigo",onClick:()=>n&&a?.(n),icon:R.jsx(uL,{})}),R.jsx(Nf,{label:"Delete",testId:`delete-button-${n?.id??"unknown"}`,color:"rose",onClick:()=>n&&i?.(n),icon:R.jsx(fL,{})})]})]})}),w&&R.jsx(Qe.div,{initial:{rotateY:180},animate:{rotateY:p?0:180},transition:{duration:.6},className:"absolute w-full h-full backface-hidden [transform:rotateY(180deg)]",children:R.jsxs("div",{className:"flex flex-col justify-center items-center bg-rose-50 border border-rose-200 rounded-2xl w-full h-full text-center p-4",children:[R.jsxs("p",{className:"text-rose-600 font-semibold mb-3",children:["Project ",n?.name??"Unknown"," not found"]}),R.jsx(Nf,{label:"OK",testId:`ok-button-${n?.id??"unknown"}`,color:"rose",onClick:j,icon:R.jsx(dL,{})})]})})]})});function pL(e,n){const a=Fu(),i=D.useRef(!1),[l,u]=D.useState(!0);return D.useEffect(()=>{if(i.current)return;i.current=!0,(async()=>{if(!await Fy.restoreIntoEditor(e,n)){a(ku.HOME,{state:{noProject:!0}});return}u(!1)})().then(p=>p)},[e,n,a]),l}function YE(e,n,a){D.useEffect(()=>{if(!e)return;const i=setTimeout(a,n);return()=>clearTimeout(i)},[e,n,a])}function mL({show:e,onHide:n}){return YE(e,2e3,n),R.jsx(Hr,{children:e&&R.jsx(Qe.div,{initial:{y:-60,opacity:0},animate:{y:0,opacity:1},exit:{y:-60,opacity:0},transition:{duration:.4,ease:"easeOut"},className:`
                        fixed left-1/2 top-4 -translate-x-1/2 z-[2000]
                        px-6 py-3 rounded-xl shadow-lg backdrop-blur-md
                        bg-rose-500/90 text-white font-medium
                        dark:bg-rose-400/90
                    `,children:"Project not found"})})}function yL({show:e,onHide:n}){return YE(e,2e3,n),R.jsx(Hr,{children:e&&R.jsx(Qe.div,{initial:{y:-60,opacity:0},animate:{y:0,opacity:1},exit:{y:-60,opacity:0},transition:{duration:.4,ease:"easeOut"},className:`
                        fixed left-1/2 top-4 -translate-x-1/2 z-[9999]
                        px-6 py-3 rounded-xl shadow-lg backdrop-blur-md
                        bg-rose-500/90 text-white font-medium
						dark:bg-emerald-400/90
					`,children:"Project saved successfully"})})}const FE=({onClose:e})=>R.jsx(ng,{"data-testid":"create-modal",title:Dt.MODAL_CREATE,buttonLabel:Dt.MODAL_CREATE_BUTTON,onClose:e,showCanvasInputs:!0,buildArgs:(n,a,i)=>({name:n,width:a,height:i}),onSubmitAction:async(n,a)=>{await n(Jk(a)).unwrap()}});function gL({type:e,shapeType:n,iconName:a,className:i}){const l=jR(e,n,a),u=DR[l],f=yb[l]??yb.DEFAULT;return R.jsx("div",{className:"p-1 rounded","data-testid":"tool-icon",children:R.jsx(u,{className:`${i||"w-4 h-4"} ${f}`})})}function vL({children:e,position:n="left"}){const a=n==="bottom",i=`
    fixed z-40 flex
    ${a?"bottom-4 left-1/2 -translate-x-1/2 flex-row":"top-1/2 left-4 -translate-y-1/2 flex-col"}
    items-center gap-3 rounded-2xl border border-gray-200 bg-white/90 shadow-xl backdrop-blur-sm
    ${a?"px-4 py-2 min-w-[200px] min-h-[56px]":"px-2 py-4 w-[60px] min-h-[300px]"}
  `;return R.jsx(Hr,{children:R.jsx(Qe.div,{role:"toolbar",className:i,initial:{opacity:0,x:a?0:-20,y:a?10:0},animate:{opacity:1,x:0,y:0},exit:{opacity:0,x:a?0:-20,y:a?10:0},transition:{duration:.25,ease:"easeOut"},children:e})})}const Ad=ct.memo(function({icon:n,label:a,active:i,onClick:l,...u}){return R.jsxs(Qe.button,{whileHover:{scale:1.1},whileTap:{scale:.95},onClick:l,"aria-label":a,...u,className:`relative flex items-center justify-center w-10 h-10 rounded-full transition-all ${i?"bg-indigo-100 text-indigo-600":"hover:bg-gray-100 text-gray-700"}`,children:[n,i&&R.jsx(Qe.div,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},transition:{duration:.2},className:"absolute inset-0 rounded-full border-2 border-indigo-500"})]})}),Rd=D.memo(function({title:n,subtitle:a,values:i,colors:l,selectedValue:u,selectedColor:f="#6B7280",onValueChange:p,onColorChange:y,position:g="bottom-44",children:v}){const w=Array.isArray(l)&&l.length>0;return R.jsxs("div",{className:`fixed left-20 ${g} z-40 w-[320px] rounded-2xl border border-gray-200 bg-white shadow-xl p-3 backdrop-blur-sm`,children:[R.jsxs("header",{className:"flex items-center justify-between mb-2",children:[R.jsx("span",{className:"text-sm font-medium text-gray-700",children:n}),R.jsx("span",{className:"text-xs text-gray-400",children:a})]}),R.jsx(AL,{values:i,selectedValue:u,selectedColor:f,onChange:p,dataPrefix:n.toLowerCase()}),w&&R.jsxs(R.Fragment,{children:[R.jsx("hr",{className:"my-3 h-px bg-gray-100"}),R.jsx(RL,{colors:l,selectedColor:f,onChange:y,dataPrefix:n.toLowerCase()})]}),v&&R.jsx("div",{className:"mt-3",children:v})]})}),vu=ct.memo(function({label:n,Icon:a,onClick:i,active:l=!1,testId:u}){return R.jsxs(Qe.button,{whileHover:{scale:1.08},whileTap:{scale:.92},onClick:i,"data-testid":u,className:`relative flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium
				transition-all select-none focus:outline-none border border-transparent
				${l?"text-white bg-indigo-600 shadow-[0_0_10px_rgba(99,102,241,0.6)]":"text-gray-200 bg-gray-700/60 hover:bg-gray-600/80"}`,children:[a&&R.jsx(a,{className:"w-4 h-4"}),R.jsx("span",{children:n}),l&&R.jsx(Qe.span,{layoutId:"glow",className:"absolute inset-0 rounded-md bg-indigo-500/40 blur-md",animate:{opacity:[.5,.8,.5]},transition:{duration:2.5,repeat:1/0,ease:"easeInOut"}})]})}),bL=ct.memo(function(){const n=en();return R.jsx(Qe.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>n(bE()),className:"bg-blue-600 hover:bg-blue-700 text-white text-sm px-3 py-1 rounded cursor-pointer shadow",children:"Apply snapshot"})}),xL=ct.memo(function(){const n=en();return R.jsx(Qe.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>n($u(!1)),className:"text-sm text-gray-700 hover:underline cursor-pointer",children:"Exit preview"})}),wL=ct.memo(function(){const n=en();return R.jsx(Qe.button,{whileHover:{scale:1.04},whileTap:{scale:.96},onClick:()=>n($u(!1)),className:"flex-1 border border-gray-300 hover:bg-gray-50 text-sm py-1 rounded cursor-pointer",children:"Exit"})}),SL=ct.memo(function(){const n=en();return R.jsx(Qe.button,{whileHover:{scale:1.04},whileTap:{scale:.96},onClick:()=>n(bE()),className:"flex-1 bg-blue-600 hover:bg-blue-700 text-white text-sm py-1 rounded cursor-pointer shadow-sm",children:"Apply snapshot"})}),EL=ct.memo(function({label:n,IconComponent:a,onClick:i,divider:l,colorClass:u="text-gray-700"}){return l?R.jsx("div",{className:"my-2 h-[1px] bg-gray-200 mx-2"}):R.jsxs("button",{onClick:i,className:`
				w-full flex items-center gap-2
				px-3 py-1.5 text-left text-sm
				hover:bg-gray-100 transition
				text-gray-800 cursor-pointer
			`,children:[a&&R.jsx(a,{className:`w-4 h-4 ${u}`,strokeWidth:2}),n]})}),_L=ct.memo(function({label:n,onClick:a,isActive:i}){return R.jsx("button",{onClick:a,className:`
				text-sm font-medium capitalize
				transition cursor-pointer select-none
				${i?"text-indigo-600":"hover:text-indigo-600 text-gray-800"}
			`,children:n})}),TL=ct.memo(function({type:n,selected:a,icon:i,label:l,onSelect:u}){return R.jsx(Qe.button,{type:"button",onClick:()=>u(n),whileHover:{scale:1.1},whileTap:{scale:.95},className:`flex items-center justify-center w-8 h-8 rounded-md border transition-all ${a?"border-indigo-500 bg-indigo-50 text-indigo-600 shadow-sm":"border-gray-200 text-gray-500 hover:bg-gray-100"}`,"aria-label":l,"data-testid":`shape-type-${n}`,children:i})}),GE=ct.memo(function({testId:n,selected:a,onClick:i,children:l,className:u=""}){return R.jsx("button",{"data-testid":n,onClick:i,className:`relative grid place-items-center rounded-full border border-gray-200 bg-white p-1
                hover:bg-gray-50 transition shrink-0
                ${a?"ring-2 ring-offset-1 ring-indigo-400":""}
                ${u}`,children:l})}),AL=({values:e,selectedValue:n,selectedColor:a,onChange:i,dataPrefix:l="tool"})=>R.jsx("div",{className:"flex items-center gap-2 overflow-x-auto py-2 min-h-[64px] pl-3 pr-2 scroll-px-2",children:e.map(u=>R.jsx(GE,{testId:`${l}-value-${u}`,selected:u===n,onClick:()=>i(u),children:R.jsx("span",{className:"block rounded-full",style:{width:u*2+4,height:u*2+4,background:a}})},u))}),RL=({colors:e,selectedColor:n,onChange:a,dataPrefix:i="tool"})=>R.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.map(l=>R.jsx(GE,{testId:`${i}-color-${l}`,selected:l===n,onClick:()=>a(l),className:"h-8 w-8 rounded-full p-0",children:R.jsx("span",{className:"block h-full w-full rounded-full",style:{background:l,borderColor:"rgba(0,0,0,0.06)",borderWidth:1,borderStyle:"solid"}})},l)),R.jsxs("label",{className:"relative h-8 w-8 rounded-full border border-gray-200 grid place-items-center cursor-pointer",children:[R.jsx("input",{type:"color","data-testid":`${i}-input-color`,value:n,onChange:l=>a(l.target.value),className:"absolute inset-0 opacity-0 cursor-pointer"}),R.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",children:R.jsx("circle",{cx:"12",cy:"12",r:"8",fill:"none",stroke:"currentColor"})})]})]});function CL(){return R.jsxs("div",{className:"flex gap-2 mt-2",children:[R.jsx(XE,{}),R.jsx(QE,{})]})}function XE(){const e=en(),n=pt(qN);return R.jsx("button",{onClick:()=>e(Iy()),disabled:!n,className:`p-2 rounded transition-colors ${n?"bg-gray-100 hover:bg-gray-200":"bg-gray-50 text-gray-400 cursor-not-allowed"}`,"aria-label":"Redo",title:"Redo (Ctrl+Shift+Z)",children:R.jsx(Jx,{className:"w-4 h-4"})})}function QE(){const e=en(),n=pt($N);return R.jsx("button",{onClick:()=>e(Vy()),disabled:!n,className:`p-2 rounded transition-colors ${n?"bg-gray-100 hover:bg-gray-200":"bg-gray-50 text-gray-400 cursor-not-allowed"}`,"aria-label":"Undo",title:"Undo (Ctrl+Z)",children:R.jsx(tw,{className:"w-4 h-4"})})}const OL=ct.memo(function({open:n}){const a=en(),i=pt(HN),l=pt(Yy);return n?!i||!Array.isArray(i.stack)?R.jsx("div",{className:"p-2 text-red-500",children:"History load error"}):R.jsxs(Qe.aside,{initial:{x:"100%",opacity:0},animate:{x:0,opacity:1},exit:{x:"100%",opacity:0},transition:{type:"spring",stiffness:220,damping:25},className:"fixed top-0 right-16 bottom-16 w-72 border-l border-gray-200 bg-white/90 backdrop-blur-sm shadow-xl p-3 flex flex-col gap-3 z-40",children:[R.jsx("header",{className:"flex items-center justify-between",children:R.jsxs("h3",{className:"text-sm font-semibold text-gray-800",children:["History"," ",l&&R.jsx("span",{className:"text-amber-600 ml-1",children:"(Preview)"})]})}),R.jsxs("div",{className:"flex gap-2",children:[R.jsx(QE,{}),R.jsx(XE,{})]}),l&&R.jsxs(Qe.div,{initial:{opacity:0,y:-6},animate:{opacity:1,y:0},className:"flex flex-col gap-2",children:[R.jsxs("div",{className:"flex items-center gap-1 text-xs text-gray-500",children:[R.jsx(Q2,{className:"w-4 h-4 text-amber-600 animate-bounce"}),R.jsx("span",{children:"Click to confirm or exit preview"})]}),R.jsxs("div",{className:"flex gap-2",children:[R.jsx(SL,{}),R.jsx(wL,{})]})]}),R.jsx("ul",{className:"flex-1 overflow-y-auto border-t border-gray-100 mt-2 space-y-1",children:R.jsx(Hr,{initial:!1,children:i.stack.map((u,f)=>{const p=f===i.currentIndex,{icon:y,toolType:g,shapeType:v}=u;return R.jsxs(Qe.li,{layout:!0,initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.25},onClick:()=>a(hE(f)),className:`cursor-pointer text-sm flex items-center gap-2 px-2 py-1.5 rounded-md truncate transition-all ${p?"bg-amber-100 text-amber-700 font-medium":"hover:bg-gray-50 text-gray-700"}`,title:u.label,children:[R.jsx(gL,{type:g??null,shapeType:v,iconName:y}),R.jsx("span",{className:"truncate",children:u.label||Dt.NAME(f+1)})]},u.id)})})})]}):null}),DL=ct.memo(function(){return pt(Yy)?R.jsxs("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 bg-amber-100 border border-amber-300 text-amber-800 px-4 py-2 rounded shadow-md z-[9999] flex items-center gap-4",children:[R.jsx("span",{className:"font-medium",children:"Viewing historical snapshot"}),R.jsx(bL,{}),R.jsx(xL,{})]}):null});function jL({active:e,onSelect:n}){const a=[{key:dr.LAYERS,label:Dt.LAYERS,icon:rR,color:"bg-indigo-600"},{key:dr.HISTORY,label:Dt.HISTORY,icon:J2,color:"bg-amber-600"}],i=l=>n(e===l?null:l);return R.jsx("aside",{className:"fixed top-12 right-0 bottom-16 w-16 flex flex-col items-center justify-start gap-4 py-6 bg-gray-900 text-white shadow-2xl border-l border-gray-800 z-50",children:a.map(({key:l,label:u,icon:f,color:p})=>{const y=e===l;return R.jsxs(Qe.button,{onClick:()=>i(l),whileHover:{scale:1.1},whileTap:{scale:.95},className:`relative w-10 h-10 flex items-center justify-center rounded-md transition-colors duration-200 ${y?`${p} shadow-lg`:"bg-gray-700 hover:bg-gray-600"}`,title:u,"aria-pressed":y,children:[R.jsx(f,{className:"w-5 h-5"}),y&&R.jsx(Qe.span,{layoutId:"sidebar-active-indicator",className:"absolute inset-0 rounded-md ring-2 ring-white/30",transition:{type:"spring",stiffness:300,damping:25}})]},l)})})}function ML({scale:e,offsetX:n,offsetY:a,onUndo:i,onRedo:l,onReset:u,onFit:f,onToggleGrid:p,showGrid:y}){return R.jsxs(Qe.footer,{className:`
		fixed bottom-0 left-0 right-0 h-16
		bg-gray-900 text-white
		flex items-center justify-between px-6
		border-t border-gray-800
		shadow-[0_-6px_12px_-2px_rgba(0,0,0,0.6)]
		will-change-[box-shadow]
		z-50
	`,initial:{y:80},animate:{y:0},transition:{type:"spring",stiffness:200,damping:20},children:[R.jsxs("div",{className:"text-xs text-gray-400",children:["Zoom: ",(e*100).toFixed(0),"% | Offset: ",n,", ",a]}),R.jsxs("div",{className:"flex gap-3 items-center",children:[R.jsx(vu,{label:"Undo",Icon:tw,onClick:i,testId:"undo-button-testid"}),R.jsx(vu,{label:"Redo",Icon:Jx,onClick:l,testId:"redo-button-testid"}),R.jsx(vu,{label:"Fit",Icon:iR,onClick:f,testId:"fit-button-testid"}),R.jsx(vu,{label:"Reset",Icon:sR,onClick:u,testId:"reset-button-testid"}),R.jsx(vu,{label:y?Dt.HIDE_GRID:Dt.SHOW_GRID,Icon:G2,onClick:p,active:y,testId:"grid-button-testid"})]})]})}const rc=e=>e.editor.activeTool,Cd=e=>e.editor.paletteOpen,em={viewport:{scale:1,offsetX:0,offsetY:0},activeTool:null,paletteOpen:!1},WE=qo({name:dr.EDITOR,initialState:em,reducers:{setScale(e,n){e.viewport.scale=Math.max(.1,Math.min(10,n.payload))},setOffset(e,n){e.viewport.offsetX=n.payload.x,e.viewport.offsetY=n.payload.y},resetViewport(e){e.viewport=em.viewport},setActiveTool(e,n){e.activeTool===n.payload?e.paletteOpen=!e.paletteOpen:(e.activeTool=n.payload,e.paletteOpen=!0)},resetEditorState:()=>em}}),{setScale:oB,setOffset:sB,resetViewport:lB,setActiveTool:Od,resetEditorState:uB}=WE.actions,kL=WE.reducer,NL=ct.memo(function(){const n=en(),a=pt(rc),i=pt(Cd),l=a===Pn.BRUSH,u=()=>{n(Od(Pn.BRUSH))};return R.jsxs(R.Fragment,{children:[R.jsx(Ad,{"data-testid":"brush-tool-button",icon:R.jsx(Xx,{className:"w-5 h-5"}),label:Dt.BRUSH_TOOL,active:l,onClick:u}),l&&i&&R.jsx(UL,{})]})});function zL(e){const{color:n,size:a}=pt(e_),i=D.useRef(!1),l=D.useRef(null),u=D.useRef(null),f=D.useRef(null),p=1,y=D.useCallback(O=>{const A=e.current;return A?Bi(O,A,{dpr:p}):{x:0,y:0}},[e]),g=D.useCallback(()=>{const O=e.current;if(!i.current||!O){f.current=null;return}const A=O.getContext("2d",{willReadFrequently:!0});if(!A||!l.current||!u.current){f.current=window.requestAnimationFrame(g);return}A.strokeStyle=n,A.lineWidth=a,A.lineCap="round",A.lineJoin="round";const j=l.current,N=u.current;A.beginPath(),A.moveTo(j.x,j.y),A.lineTo(N.x,N.y),A.stroke(),l.current=N,u.current=null,f.current=window.requestAnimationFrame(g)},[e,n,a]),v=O=>{if(!e.current)return;const A=e.current;A&&(l.current=y(O),i.current=!0,A.setPointerCapture(O.pointerId),f.current||(f.current=window.requestAnimationFrame(g)))},w=D.useCallback(O=>{i.current&&(u.current=y(O))},[y]),_=O=>{i.current=!1,l.current=null,u.current=null;const A=e.current;A&&A.hasPointerCapture(O.pointerId)&&A.releasePointerCapture(O.pointerId)};return D.useEffect(()=>()=>{f.current!==null&&window.cancelAnimationFrame(f.current)},[]),{onPointerDown:v,onPointerMove:w,onPointerUp:_}}const Sx={color:"#1F2937",size:4},JE=qo({name:Pn.BRUSH,initialState:Sx,reducers:{setBrushColor(e,n){e.color=n.payload},setBrushSize(e,n){e.size=n.payload},resetBrushState:()=>Sx}}),{setBrushColor:PL,setBrushSize:LL,resetBrushState:cB}=JE.actions,BL=JE.reducer,UL=ct.memo(function(){const n=en(),{color:a,size:i}=pt(e_);return R.jsx(Rd,{title:Dt.BRUSH_TOOL,subtitle:Dt.BRUSH_TOOL_SUB,values:fd,colors:Ym,selectedValue:i,selectedColor:a,onValueChange:l=>n(LL(l)),onColorChange:l=>n(PL(l)),position:"bottom-19"})}),e_=e=>e.brush;function VL(e,n){const a=Math.atan2(n,e),i=Math.PI/4,l=Math.round(a/i)*i,u=Math.hypot(e,n);return{dx:Math.cos(l)*u,dy:Math.sin(l)*u}}function Ex(e,n,a){let i=n.x-e.x,l=n.y-e.y;return a&&(i!==0||l!==0)&&({dx:i,dy:l}=VL(i,l)),{x1:e.x,y1:e.y,x2:e.x+i,y2:e.y+l}}const IL=ct.memo(function(){const n=en(),a=pt(rc),i=pt(Cd),l=a===Pn.LINE,u=()=>{n(Od(Pn.LINE))};return R.jsxs(R.Fragment,{children:[R.jsx(Ad,{"data-testid":"line-tool-button",icon:R.jsx(SR,{className:"w-5 h-5"}),label:Dt.LINE_TOOL,active:l,onClick:u}),l&&i&&R.jsx(ZL,{})]})}),_x={active:!1,color:"#000000",thickness:2},t_=qo({name:Pn.LINE,initialState:_x,reducers:{setLineColor(e,n){e.color=n.payload},setLineThickness(e,n){e.thickness=n.payload},resetLineState:()=>_x}}),{setLineColor:HL,setLineThickness:$L,resetLineState:fB}=t_.actions,qL=t_.reducer,ZL=ct.memo(function(){const n=en(),{color:a,thickness:i}=pt(n_);return R.jsx(Rd,{title:Dt.LINE_TOOL,subtitle:Dt.LINE_TOOL_SUB,values:fd,colors:Ym,selectedValue:i,selectedColor:a,onValueChange:l=>n($L(l)),onColorChange:l=>n(HL(l)),position:"bottom-19"})});function KL(e){const{color:n,thickness:a}=pt(n_),i=D.useRef(null),l=D.useRef(null),u=D.useRef(!1),f=D.useRef(null),p=D.useRef(null),y=1;D.useEffect(()=>{const A=j=>{u.current=j.shiftKey};return window.addEventListener("keydown",A),window.addEventListener("keyup",A),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",A)}},[]);const g=D.useCallback(A=>{const j=parseInt(A.slice(1,3),16),N=parseInt(A.slice(3,5),16),P=parseInt(A.slice(5,7),16),H=L=>Math.min(255,Math.round(L+(255-L)*.4));return`rgba(${H(j)}, ${H(N)}, ${H(P)}, 0.7)`},[]),v=D.useCallback(()=>{const A=e.current;if(!A){p.current=null;return}const j=A.getContext("2d",{willReadFrequently:!0});if(!j){p.current=null;return}if(!i.current||!l.current||!f.current){p.current=window.requestAnimationFrame(v);return}j.putImageData(f.current,0,0);const{x1:N,y1:P,x2:H,y2:L}=Ex(i.current,l.current,u.current);j.strokeStyle=g(n),j.lineWidth=a,j.lineCap="round",j.setLineDash([4,4]),j.beginPath(),j.moveTo(N,P),j.lineTo(H,L),j.stroke(),j.setLineDash([]),p.current=window.requestAnimationFrame(v)},[e,n,a,g]),w=A=>{const j=e.current;if(!j)return;const N=j.getContext("2d",{willReadFrequently:!0});N&&(i.current=Bi(A,j,{dpr:y}),l.current=null,f.current=N.getImageData(0,0,j.width,j.height),p.current||(p.current=window.requestAnimationFrame(v)))},_=A=>{const j=e.current;!j||!i.current||(l.current=Bi(A,j,{dpr:y}))},O=A=>{const j=e.current;if(!j||!i.current)return;const N=j.getContext("2d",{willReadFrequently:!0});if(!N)return;const P=Bi(A,j,{dpr:y}),{x1:H,y1:L,x2:ae,y2:ee}=Ex(i.current,P,u.current);N.strokeStyle=n,N.lineWidth=a,N.lineCap="round",N.beginPath(),N.moveTo(H,L),N.lineTo(ae,ee),N.stroke(),i.current=null,l.current=null,f.current=null,p.current!==null&&(window.cancelAnimationFrame(p.current),p.current=null)};return D.useEffect(()=>()=>{p.current!==null&&window.cancelAnimationFrame(p.current)},[]),{onPointerDown:w,onPointerMove:_,onPointerUp:O}}const n_=e=>e.line,Tx={active:!1,type:"rect",fill:"#ffffff",stroke:"#000000",thickness:2},r_=qo({name:Pn.SHAPE,initialState:Tx,reducers:{setShapeType(e,n){e.type=n.payload},setShapeFill(e,n){e.fill=n.payload},setShapeStroke(e,n){e.stroke=n.payload},setShapeThickness(e,n){e.thickness=n.payload},resetShapeState:()=>Tx}}),{setShapeType:YL,setShapeFill:FL,setShapeStroke:GL,setShapeThickness:XL,resetShapeState:dB}=r_.actions,QL=r_.reducer,a_=e=>e.shape,WL=ct.memo(function(){const n=en(),a=pt(rc),i=pt(Cd),l=a===Pn.SHAPE;return R.jsxs(R.Fragment,{children:[R.jsx(Ad,{"data-testid":"shape-tool-button",icon:R.jsx(Xm,{className:"w-5 h-5"}),label:Dt.SHAPE_TOOL,active:l,onClick:()=>n(Od(Pn.SHAPE))}),l&&i&&R.jsx(e6,{})]})}),JL=[{type:"rect",icon:R.jsx(Xm,{className:"w-5 h-5"}),label:"Rectangle"},{type:"circle",icon:R.jsx(Qx,{className:"w-5 h-5"}),label:"Circle"}],e6=ct.memo(function(){const n=en(),{type:a,fill:i,stroke:l,thickness:u}=pt(a_),f=D.useCallback(v=>{n(YL(v))},[n]),p=v=>{n(FL(v.target.value))},y=v=>{n(GL(v))},g=v=>{n(XL(v))};return R.jsx(Rd,{title:"Shape Tool",subtitle:"Fill / Stroke / Type",values:fd,colors:Ym,selectedValue:u,selectedColor:l,onValueChange:g,onColorChange:y,position:"bottom-8",children:R.jsxs("div",{className:"flex items-center justify-between gap-3",children:[R.jsx("div",{className:"flex items-center gap-2",children:JL.map(({type:v,icon:w,label:_})=>R.jsx(TL,{type:v,icon:w,label:_,selected:a===v,onSelect:f},v))}),R.jsx("input",{type:"color",value:i,onChange:p,className:"w-8 h-8 rounded-md border border-gray-200 cursor-pointer","data-testid":"shape-fill-color"})]})})});function t6(e){const{type:n,fill:a,stroke:i,thickness:l}=pt(a_),u=D.useRef(null),f=D.useRef(null),p=1,y=D.useCallback(w=>{const _=e.current;if(!_)return;const O=_.getContext("2d",{willReadFrequently:!0});O&&(u.current=Bi(w,_,{dpr:p}),f.current=O.getImageData(0,0,_.width,_.height))},[e]),g=D.useCallback(w=>{if(!e.current||!f.current||!u.current)return;const _=e.current;if(!_||!f.current||!u.current)return;const O=_.getContext("2d",{willReadFrequently:!0});if(!O)return;O.putImageData(f.current,0,0);const A=u.current,j=Bi(w,_,{dpr:p}),N=Math.min(A.x,j.x),P=Math.min(A.y,j.y),H=Math.abs(A.x-j.x),L=Math.abs(A.y-j.y);if(O.fillStyle=a,O.strokeStyle=i,O.lineWidth=l,O.beginPath(),n===am.RECT)O.rect(N,P,H,L);else if(n===am.CIRCLE){const ae=Math.sqrt(H*H+L*L)/2,ee=(A.x+j.x)/2,fe=(A.y+j.y)/2;O.arc(ee,fe,ae,0,Math.PI*2)}a&&O.fill(),i&&l>0&&O.stroke()},[e,a,i,l,n]),v=D.useCallback(w=>{if(!e.current||!u.current)return;const _=e.current;!_||!u.current||!_.getContext("2d",{willReadFrequently:!0})||(g(w),f.current=null,u.current=null)},[e,g]);return{onPointerDown:y,onPointerMove:g,onPointerUp:v}}const Ax={active:!1,size:8},i_=qo({name:Pn.ERASER,initialState:Ax,reducers:{setEraserSize(e,n){e.size=n.payload},resetEraserState:()=>Ax}}),{setEraserSize:n6,resetEraserState:hB}=i_.actions,r6=i_.reducer;function a6(){const e=en(),n=pt(o_);return R.jsx(Rd,{title:Dt.ERASER_TOOL,subtitle:Dt.ERASER_TOOL_SIZE,values:fd,selectedValue:n,onValueChange:a=>e(n6(a)),position:"bottom-43","data-testid-prefix":"eraser"})}function i6(){const e=en(),n=pt(rc),a=pt(Cd),i=n===Pn.ERASER,l=()=>{e(Od(Pn.ERASER))};return R.jsxs(R.Fragment,{children:[R.jsx(Ad,{"data-testid":"eraser-tool-button",icon:R.jsx(Wx,{className:"w-5 h-5"}),label:Dt.ERASER_TOOL,active:i,onClick:l}),i&&a&&R.jsx(a6,{})]})}function o6(e){const n=pt(o_),a=D.useRef(!1),i=D.useRef(null),l=window.devicePixelRatio??1;D.useEffect(()=>{const g=e();if(!g)return;g.style.cursor="none";const v=g.getContext("2d");if(!v)return;const w=O=>{if(!g)return;const A=g.getBoundingClientRect(),j=O.clientX-A.left,N=O.clientY-A.top;v.save(),v.clearRect(0,0,g.width,g.height),v.beginPath(),v.arc(j,N,n*l/2,0,Math.PI*2),v.strokeStyle="rgba(59,130,246,0.8)",v.lineWidth=1.2*l,v.stroke(),v.restore()},_=()=>{if(!g)return;g.getContext("2d")?.clearRect(0,0,g.width,g.height)};return g.addEventListener("mousemove",w),g.addEventListener("mouseleave",_),()=>{g.removeEventListener("mousemove",w),g.removeEventListener("mouseleave",_),g.style.cursor="crosshair"}},[e,n,l]);const u=D.useCallback((g,v,w)=>{g.save(),g.globalCompositeOperation="destination-out",g.lineCap="round",g.lineJoin="round",g.lineWidth=n,g.lineWidth=n,g.beginPath(),g.moveTo(v.x,v.y),g.lineTo(w.x,w.y),g.stroke(),g.restore()},[n]);return{onPointerDown:g=>{const v=e();if(!v)return;const w=v.getContext("2d");if(!w)return;const _=Bi(g,v,{dpr:l});a.current=!0,i.current=_,u(w,_,_)},onPointerMove:g=>{if(!a.current)return;const v=e();if(!v)return;const w=v.getContext("2d");if(!w||!i.current)return;const _=Bi(g,v,{dpr:l});u(w,i.current,_),i.current=_},onPointerUp:()=>{a.current=!1,i.current=null}}}const o_=e=>e.eraser.size;function s6(e,n,a){const i=D.useRef(null),l=D.useRef(1),u=D.useRef(0),f=D.useRef(0),[p,y]=D.useState(!1),[g,v]=D.useState(!0),w=D.useCallback(()=>{a?.({scale:l.current,offsetX:u.current,offsetY:f.current})},[a]),_=D.useCallback(()=>{const L=i.current;L&&(L.style.transform=`translate(${u.current}px, ${f.current}px) scale(${l.current})`,L.style.transformOrigin="center",w())},[w]),O=D.useCallback(L=>{L.button===1&&(L.preventDefault(),y(!0))},[]),A=D.useCallback(L=>{p&&(u.current+=L.movementX,f.current+=L.movementY,_())},[_,p]),j=D.useCallback(()=>{y(!1)},[]),N=D.useCallback(L=>{if(!L.ctrlKey)return;L.cancelable&&L.preventDefault();const ae=L.deltaY>0?.9:1.1;l.current*=ae,_()},[_]),P=D.useCallback(()=>{const L=i.current;if(!L)return;const ae=L.parentElement;if(!ae)return;const ee=ae.getBoundingClientRect(),fe=64,ue=ee.width-fe*2,le=ee.height-fe*2,Oe=ue/e,Be=le/n;l.current=Math.min(Oe,Be),u.current=0,f.current=0,_()},[_,e,n]),H=D.useCallback(()=>{l.current=1,u.current=0,f.current=0,_()},[_]);return{containerRef:i,isPanning:p,showGrid:g,setShowGrid:v,onMouseDown:O,onMouseMove:A,onMouseUp:j,onWheel:N,handleFit:P,handleReset:H}}const s_=D.forwardRef(({width:e,height:n,onPointerDown:a,onPointerMove:i,onPointerUp:l,isPanning:u,"data-testid":f="draw-canvas"},p)=>{const y=u?"grabbing":"crosshair";return R.jsx("canvas",{ref:p,role:"presentation",width:e,height:n,className:"absolute inset-0",style:{zIndex:10,cursor:y},onPointerDown:a,onPointerMove:i,onPointerUp:l,"data-testid":f})});s_.displayName="DrawCanvas";const l_=D.forwardRef(({width:e,height:n,showGrid:a,background:i="#ffffff"},l)=>{const u=D.useRef(null),f=D.useRef(null);return D.useImperativeHandle(l,()=>u.current,[]),D.useEffect(()=>{const p=document.createElement("canvas");p.width=e,p.height=n,f.current=p;const y=p.getContext("2d");if(!y)return;y.fillStyle=i,y.fillRect(0,0,e,n);const g=20,v=100;y.strokeStyle="#e5e7eb",y.lineWidth=1;for(let w=0;w<=e;w+=g)y.beginPath(),y.moveTo(w,0),y.lineTo(w,n),y.stroke();for(let w=0;w<=n;w+=g)y.beginPath(),y.moveTo(0,w),y.lineTo(e,w),y.stroke();y.fillStyle="#9ca3af",y.font="10px sans-serif",y.textBaseline="top";for(let w=0;w<=e;w+=v)y.fillText(String(w),w+2,2);for(let w=v;w<=n;w+=v)y.fillText(String(w),2,w+2)},[e,n,i]),D.useEffect(()=>{const p=u.current,y=f.current;if(!p||!y)return;const g=p.getContext("2d");g&&(g.clearRect(0,0,e,n),a?g.drawImage(y,0,0):(g.fillStyle=i,g.fillRect(0,0,e,n)))},[a,e,n,i]),R.jsx("canvas",{ref:u,width:e,height:n,className:"absolute inset-0 pointer-events-none","data-testid":"grid-canvas"})});l_.displayName="GridCanvas";const l6=({layers:e,width:n,height:a,bindCanvasRef:i,activeLayerId:l})=>R.jsx(R.Fragment,{children:e.map(u=>{const f=u.id===l;return R.jsx("canvas",{id:`layer-canvas-${u.id}`,"data-layer-id":u.id,ref:i(u.id),width:n,height:a,style:{position:"absolute",inset:0,opacity:u.visible?u.opacity:0,pointerEvents:"none",boxShadow:f?"0 0 10px 3px rgba(59,130,246,0.5)":"none",backgroundColor:"transparent",zIndex:u.zIndex,transition:"box-shadow 0.25s ease-in-out"}},u.id)})}),u6=ct.memo(function({projectId:n,width:a,height:i,onViewportUpdate:l}){const u=en(),f=D.useRef(!1),p=pt(rc),y=D.useMemo(vE,[]),g=pt(k=>y(k,n)),v=D.useMemo(()=>[...g].sort((k,G)=>k.zIndex-G.zIndex),[g]),w=pt(Hs.selectActiveLayer),[_,O]=D.useState({scale:1,offsetX:0,offsetY:0}),{containerRef:A,isPanning:j,showGrid:N,setShowGrid:P,onMouseDown:H,onMouseMove:L,onMouseUp:ae,onWheel:ee,handleFit:fe,handleReset:ue}=s6(a,i,k=>{O(k)}),le=D.useCallback(()=>{P(k=>!k)},[P]);D.useEffect(()=>{l&&l({scale:_.scale,offsetX:_.offsetX,offsetY:_.offsetY,showGrid:N,handleFit:fe,handleReset:ue,toggleGrid:le})},[l,_,N,fe,ue,le]);const{bindCanvasRef:Oe,getCanvas:Be}=VN(v,n,a,i),Xe=D.useRef(null),it=zL(Xe),Ht=KL(Xe),pn=t6(Xe),ut=o6(()=>w?Be(w.id):null),de=D.useMemo(()=>({brush:it,line:Ht,shape:pn,eraser:ut}),[it,Ht,pn,ut]),be=p?de[p]:void 0,Me=D.useCallback(k=>{f.current=!1,be?.onPointerDown?.(k)},[be]),Ke=D.useCallback(k=>{be?.onPointerMove?.(k),f.current=!0},[be]),V=D.useCallback(async k=>{if(be?.onPointerUp?.(k),!f.current||!w||!p)return;const G=Be(w.id),I=Xe.current;if(G&&I){G.getContext("2d")?.drawImage(I,0,0),I.getContext("2d",{willReadFrequently:!0,alpha:!0})?.clearRect(0,0,a,i);const Te=G.toDataURL("image/png");await u(Is({id:w.id,changes:{snapshot:Te}})).unwrap()}},[be,w,p,u,Be,a,i]);return R.jsxs("div",{"data-testid":"viewport-container",className:"relative w-full h-full bg-gray-100 dark:bg-gray-900 flex items-center justify-center select-none overflow-hidden",onMouseDown:H,onMouseMove:L,onMouseUp:ae,onWheel:ee,children:[R.jsxs("div",{ref:A,style:{width:a,height:i,position:"relative",border:"1px solid rgba(0, 0, 0, 0.2)",background:"#ffffff"},children:[R.jsx(l_,{width:a,height:i,showGrid:N}),R.jsx(l6,{layers:v,width:a,height:i,bindCanvasRef:Oe,activeLayerId:w?.id??null}),R.jsx(s_,{ref:Xe,width:a,height:i,onPointerDown:Me,onPointerMove:Ke,onPointerUp:V,isPanning:j})]}),R.jsxs(vL,{position:"left",children:[R.jsx(NL,{}),R.jsx(IL,{}),R.jsx(WL,{}),R.jsx(i6,{}),R.jsx(CL,{})]})]})});function c6(){const e=document.createElement("div");e.style.position="fixed",e.style.left="12px",e.style.bottom="80px",e.style.background="rgba(0,0,0,0.55)",e.style.color="lime",e.style.fontFamily="monospace",e.style.fontSize="12px",e.style.padding="6px 10px",e.style.borderRadius="6px",e.style.zIndex="99999",e.style.pointerEvents="none",e.style.whiteSpace="pre",e.style.lineHeight="1.3",document.body.appendChild(e);let n=performance.now(),a=0,i=0,l=0,u=0,f=0;function p(y){a++;const g=y-n;g>=1e3&&(i=a,l=+(g/a).toFixed(2),f=Math.max(f,l),u=l>16.6?u+1:u,a=0,n=y,e.textContent=[MR(i),kR(l),NR(f),zR(u)].join(`
`)),requestAnimationFrame(p)}requestAnimationFrame(p)}const f6=ct.memo(function({layerId:n,isVisible:a,onToggle:i}){return R.jsx("button",{onClick:l=>{l.stopPropagation(),i(n,a)},className:"w-8 h-8 flex items-center justify-center rounded hover:bg-gray-100","aria-label":a?Dt.LAYER_HIDE:Dt.LAYER_SHOW,children:a?R.jsx($2,{className:"w-4 h-4"}):R.jsx(I2,{className:"w-4 h-4"})})}),d6=ct.memo(function({layerId:n,layerName:a,isEditing:i,onRenameSubmit:l}){const u=y=>y.stopPropagation(),f=y=>{y.preventDefault();const v=y.target.elements.namedItem("name");l(n,v.value).then(w=>w)},p=y=>{l(n,y.currentTarget.value).then(g=>g)};return R.jsx("div",{className:"min-w-0",children:i?R.jsx("form",{onSubmit:f,children:R.jsx("input",{name:"name",autoFocus:!0,defaultValue:a,onClick:u,onBlur:p,className:"w-44 text-sm px-1 py-0.5 rounded border border-indigo-300"})}):R.jsx("div",{className:"truncate text-sm",title:a,children:a})})}),h6=ct.memo(function({layerId:n,isMenuOpen:a,setOpenMenuId:i,onRenameClick:l,onDeleteClick:u}){const f=D.useRef(null);D.useEffect(()=>{if(!a)return;const y=g=>{f.current&&(f.current.contains(g.target)||i(null))};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[a,i]);const p=y=>{y.stopPropagation(),i(a?null:n)};return R.jsxs("div",{className:"relative",ref:f,children:[R.jsx("button",{onClick:p,className:"w-8 h-8 flex items-center justify-center rounded hover:bg-gray-100","aria-label":"Layer options menu","data-testid":"layer-menu-btn",children:R.jsx(B2,{className:"w-4 h-4"})}),R.jsx(Hr,{children:a&&R.jsxs(Qe.div,{onMouseLeave:()=>i(null),initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"absolute right-0 mt-2 w-40 rounded-md border border-gray-200 bg-white shadow-md z-10 origin-top-right",role:"menu",children:[R.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm hover:bg-gray-50",onClick:l,children:[R.jsx(hR,{className:"w-4 h-4 text-gray-600"}),"Rename"]}),R.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-rose-600 hover:bg-rose-50",onClick:u,children:[R.jsx(ew,{className:"w-4 h-4"}),"Delete"]})]})})]})}),p6=ct.memo(function({layer:n,isActive:a,isEditing:i,openMenuId:l,onSetActive:u,onToggleVisibility:f,onRenameSubmit:p,onDelete:y,setLocalNameId:g,setOpenMenuId:v,disabled:w}){const _=l===n.id,O=()=>{g(n.id),v(null)},A=()=>{y(n.id)};return R.jsxs("div",{className:`group relative flex items-center justify-between gap-2 px-2 py-1.5 rounded-md border
			${a?"border-indigo-400 bg-indigo-50":"border-transparent hover:bg-gray-50"}
			${w?"opacity-50 cursor-not-allowed pointer-events-none":""}`,onClick:()=>!w&&u(n.id),children:[R.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[R.jsx(f6,{layerId:n.id,isVisible:n.visible,onToggle:f}),R.jsx(d6,{layerId:n.id,layerName:n.name,isEditing:i,onRenameSubmit:p})]}),R.jsx(h6,{layerId:n.id,isMenuOpen:_,setOpenMenuId:v,onRenameClick:O,onDeleteClick:A})]})}),m6=ct.memo(function({onCreate:n,disabled:a}){const[i,l]=D.useState(!1);return R.jsxs("button",{onClick:()=>!a&&n(),disabled:a,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:`
                relative text-sm font-medium text-indigo-600
                flex items-center gap-2 self-start mt-1
                px-3 py-2 rounded-md border border-indigo-200 bg-indigo-50/70
                hover:bg-indigo-100 hover:border-indigo-300 transition-all
            `,children:[R.jsx(Hr,{mode:"wait",children:i&&R.jsx(Qe.span,{initial:{opacity:0,rotate:-90,x:-6,scale:.8},animate:{opacity:1,rotate:0,x:0,scale:1},exit:{opacity:0,rotate:90,x:-6,scale:.8},transition:{duration:.25},className:"flex items-center justify-center",children:R.jsx(mR,{className:"w-4 h-4 text-indigo-600"})},"plus")}),R.jsx("span",{children:"Add Layer"})]})}),y6=ct.memo(function({activeLayer:n,onOpacityChange:a}){const i=n??void 0,l=i?.opacity??1;return R.jsxs("div",{className:"flex items-center gap-3",children:[R.jsx("label",{className:"text-xs text-gray-600 w-20",children:"Opacity"}),R.jsx("div",{className:"relative flex-1",children:R.jsx("input",{type:"range",min:0,max:1,step:.01,disabled:!i,value:l,onChange:u=>{i&&a(i.id,Number(u.target.value))},className:`
                       w-full h-1.5 rounded-lg appearance-none cursor-pointer
                       bg-gray-200 accent-indigo-600
                       disabled:opacity-50
                       /* Custom styles for the thumb (slider handle) in Webkit and Firefox for a progressive look */
                       [&::-webkit-slider-thumb]:appearance-none
                       [&::-webkit-slider-thumb]:h-3
                       [&::-webkit-slider-thumb]:w-3
                       [&::-webkit-slider-thumb]:rounded-full
                       [&::-webkit-slider-thumb]:bg-indigo-600
                       [&::-webkit-slider-thumb]:shadow-md
                       [&::-webkit-slider-thumb]:border-2
                       [&::-webkit-slider-thumb]:border-white
 
                       [&::-moz-range-thumb]:h-3
                       [&::-moz-range-thumb]:w-3
                       [&::-moz-range-thumb]:rounded-full
                       [&::-moz-range-thumb]:bg-indigo-600
                       [&::-moz-range-thumb]:border-2
                       [&::-moz-range-thumb]:border-white
                    `,style:{background:`linear-gradient(to right, #4f46e5 ${l*100}%, #e5e7eb ${l*100}%)`}})}),R.jsxs("span",{className:"w-10 text-right text-xs tabular-nums",children:[Math.round(l*100),"%"]})]})});var Eu={exports:{}},g6=Eu.exports,Rx;function v6(){return Rx||(Rx=1,(function(e,n){(function(a,i){i(n)})(g6,function(a){function i(k,G){k.super_=G,k.prototype=Object.create(G.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}})}function l(k,G){Object.defineProperty(this,"kind",{value:k,enumerable:!0}),G&&G.length&&Object.defineProperty(this,"path",{value:G,enumerable:!0})}function u(k,G,I){u.super_.call(this,"E",k),Object.defineProperty(this,"lhs",{value:G,enumerable:!0}),Object.defineProperty(this,"rhs",{value:I,enumerable:!0})}function f(k,G){f.super_.call(this,"N",k),Object.defineProperty(this,"rhs",{value:G,enumerable:!0})}function p(k,G){p.super_.call(this,"D",k),Object.defineProperty(this,"lhs",{value:G,enumerable:!0})}function y(k,G,I){y.super_.call(this,"A",k),Object.defineProperty(this,"index",{value:G,enumerable:!0}),Object.defineProperty(this,"item",{value:I,enumerable:!0})}function g(k,G,I){var ce=k.slice(G+1||k.length);return k.length=G<0?k.length+G:G,k.push.apply(k,ce),k}function v(k){var G=typeof k>"u"?"undefined":ut(k);return G!=="object"?G:k===Math?"math":k===null?"null":Array.isArray(k)?"array":Object.prototype.toString.call(k)==="[object Date]"?"date":typeof k.toString=="function"&&/^\/.*\//.test(k.toString())?"regexp":"object"}function w(k,G,I,ce,Te,_e,Le){Te=Te||[],Le=Le||[];var ze=Te.slice(0);if(typeof _e<"u"){if(ce){if(typeof ce=="function"&&ce(ze,_e))return;if((typeof ce>"u"?"undefined":ut(ce))==="object"){if(ce.prefilter&&ce.prefilter(ze,_e))return;if(ce.normalize){var je=ce.normalize(ze,_e,k,G);je&&(k=je[0],G=je[1])}}}ze.push(_e)}v(k)==="regexp"&&v(G)==="regexp"&&(k=k.toString(),G=G.toString());var mn=typeof k>"u"?"undefined":ut(k),zt=typeof G>"u"?"undefined":ut(G),$e=mn!=="undefined"||Le&&Le[Le.length-1].lhs&&Le[Le.length-1].lhs.hasOwnProperty(_e),Ft=zt!=="undefined"||Le&&Le[Le.length-1].rhs&&Le[Le.length-1].rhs.hasOwnProperty(_e);if(!$e&&Ft)I(new f(ze,G));else if(!Ft&&$e)I(new p(ze,k));else if(v(k)!==v(G))I(new u(ze,k,G));else if(v(k)==="date"&&k-G!==0)I(new u(ze,k,G));else if(mn==="object"&&k!==null&&G!==null)if(Le.filter(function(st){return st.lhs===k}).length)k!==G&&I(new u(ze,k,G));else{if(Le.push({lhs:k,rhs:G}),Array.isArray(k)){var ft;for(k.length,ft=0;ft<k.length;ft++)ft>=G.length?I(new y(ze,ft,new p(void 0,k[ft]))):w(k[ft],G[ft],I,ce,ze,ft,Le);for(;ft<G.length;)I(new y(ze,ft,new f(void 0,G[ft++])))}else{var En=Object.keys(k),nr=Object.keys(G);En.forEach(function(st,$r){var qr=nr.indexOf(st);qr>=0?(w(k[st],G[st],I,ce,ze,st,Le),nr=g(nr,qr)):w(k[st],void 0,I,ce,ze,st,Le)}),nr.forEach(function(st){w(void 0,G[st],I,ce,ze,st,Le)})}Le.length=Le.length-1}else k!==G&&(mn==="number"&&isNaN(k)&&isNaN(G)||I(new u(ze,k,G)))}function _(k,G,I,ce){return ce=ce||[],w(k,G,function(Te){Te&&ce.push(Te)},I),ce.length?ce:void 0}function O(k,G,I){if(I.path&&I.path.length){var ce,Te=k[G],_e=I.path.length-1;for(ce=0;ce<_e;ce++)Te=Te[I.path[ce]];switch(I.kind){case"A":O(Te[I.path[ce]],I.index,I.item);break;case"D":delete Te[I.path[ce]];break;case"E":case"N":Te[I.path[ce]]=I.rhs}}else switch(I.kind){case"A":O(k[G],I.index,I.item);break;case"D":k=g(k,G);break;case"E":case"N":k[G]=I.rhs}return k}function A(k,G,I){if(k&&G&&I&&I.kind){for(var ce=k,Te=-1,_e=I.path?I.path.length-1:0;++Te<_e;)typeof ce[I.path[Te]]>"u"&&(ce[I.path[Te]]=typeof I.path[Te]=="number"?[]:{}),ce=ce[I.path[Te]];switch(I.kind){case"A":O(I.path?ce[I.path[Te]]:ce,I.index,I.item);break;case"D":delete ce[I.path[Te]];break;case"E":case"N":ce[I.path[Te]]=I.rhs}}}function j(k,G,I){if(I.path&&I.path.length){var ce,Te=k[G],_e=I.path.length-1;for(ce=0;ce<_e;ce++)Te=Te[I.path[ce]];switch(I.kind){case"A":j(Te[I.path[ce]],I.index,I.item);break;case"D":Te[I.path[ce]]=I.lhs;break;case"E":Te[I.path[ce]]=I.lhs;break;case"N":delete Te[I.path[ce]]}}else switch(I.kind){case"A":j(k[G],I.index,I.item);break;case"D":k[G]=I.lhs;break;case"E":k[G]=I.lhs;break;case"N":k=g(k,G)}return k}function N(k,G,I){if(k&&G&&I&&I.kind){var ce,Te,_e=k;for(Te=I.path.length-1,ce=0;ce<Te;ce++)typeof _e[I.path[ce]]>"u"&&(_e[I.path[ce]]={}),_e=_e[I.path[ce]];switch(I.kind){case"A":j(_e[I.path[ce]],I.index,I.item);break;case"D":_e[I.path[ce]]=I.lhs;break;case"E":_e[I.path[ce]]=I.lhs;break;case"N":delete _e[I.path[ce]]}}}function P(k,G,I){if(k&&G){var ce=function(Te){I&&!I(k,G,Te)||A(k,G,Te)};w(k,G,ce)}}function H(k){return"color: "+Me[k].color+"; font-weight: bold"}function L(k){var G=k.kind,I=k.path,ce=k.lhs,Te=k.rhs,_e=k.index,Le=k.item;switch(G){case"E":return[I.join("."),ce,"→",Te];case"N":return[I.join("."),Te];case"D":return[I.join(".")];case"A":return[I.join(".")+"["+_e+"]",Le];default:return[]}}function ae(k,G,I,ce){var Te=_(k,G);try{ce?I.groupCollapsed("diff"):I.group("diff")}catch{I.log("diff")}Te?Te.forEach(function(_e){var Le=_e.kind,ze=L(_e);I.log.apply(I,["%c "+Me[Le].text,H(Le)].concat(de(ze)))}):I.log("—— no diff ——");try{I.groupEnd()}catch{I.log("—— diff end —— ")}}function ee(k,G,I,ce){switch(typeof k>"u"?"undefined":ut(k)){case"object":return typeof k[ce]=="function"?k[ce].apply(k,de(I)):k[ce];case"function":return k(G);default:return k}}function fe(k){var G=k.timestamp,I=k.duration;return function(ce,Te,_e){var Le=["action"];return Le.push("%c"+String(ce.type)),G&&Le.push("%c@ "+Te),I&&Le.push("%c(in "+_e.toFixed(2)+" ms)"),Le.join(" ")}}function ue(k,G){var I=G.logger,ce=G.actionTransformer,Te=G.titleFormatter,_e=Te===void 0?fe(G):Te,Le=G.collapsed,ze=G.colors,je=G.level,mn=G.diff,zt=typeof G.titleFormatter>"u";k.forEach(function($e,Ft){var ft=$e.started,En=$e.startedTime,nr=$e.action,st=$e.prevState,$r=$e.error,qr=$e.took,Yn=$e.nextState,ln=k[Ft+1];ln&&(Yn=ln.prevState,qr=ln.started-ft);var Ln=ce(nr),Dr=typeof Le=="function"?Le(function(){return Yn},nr,$e):Le,Yo=Ht(En),va=ze.title?"color: "+ze.title(Ln)+";":"",un=["color: gray; font-weight: lighter;"];un.push(va),G.timestamp&&un.push("color: gray; font-weight: lighter;"),G.duration&&un.push("color: gray; font-weight: lighter;");var St=_e(Ln,Yo,qr);try{Dr?ze.title&&zt?I.groupCollapsed.apply(I,["%c "+St].concat(un)):I.groupCollapsed(St):ze.title&&zt?I.group.apply(I,["%c "+St].concat(un)):I.group(St)}catch{I.log(St)}var Mn=ee(je,Ln,[st],"prevState"),Pt=ee(je,Ln,[Ln],"action"),ba=ee(je,Ln,[$r,st],"error"),Zr=ee(je,Ln,[Yn],"nextState");if(Mn)if(ze.prevState){var jr="color: "+ze.prevState(st)+"; font-weight: bold";I[Mn]("%c prev state",jr,st)}else I[Mn]("prev state",st);if(Pt)if(ze.action){var Mr="color: "+ze.action(Ln)+"; font-weight: bold";I[Pt]("%c action    ",Mr,Ln)}else I[Pt]("action    ",Ln);if($r&&ba)if(ze.error){var Kr="color: "+ze.error($r,st)+"; font-weight: bold;";I[ba]("%c error     ",Kr,$r)}else I[ba]("error     ",$r);if(Zr)if(ze.nextState){var yn="color: "+ze.nextState(Yn)+"; font-weight: bold";I[Zr]("%c next state",yn,Yn)}else I[Zr]("next state",Yn);mn&&ae(st,Yn,I,Dr);try{I.groupEnd()}catch{I.log("—— log end ——")}})}function le(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},G=Object.assign({},Ke,k),I=G.logger,ce=G.stateTransformer,Te=G.errorTransformer,_e=G.predicate,Le=G.logErrors,ze=G.diffPredicate;if(typeof I>"u")return function(){return function(mn){return function(zt){return mn(zt)}}};if(k.getState&&k.dispatch)return console.error(`[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware:
// Logger with default options
import { logger } from 'redux-logger'
const store = createStore(
  reducer,
  applyMiddleware(logger)
)
// Or you can create your own logger with custom options http://bit.ly/redux-logger-options
import createLogger from 'redux-logger'
const logger = createLogger({
  // ...options
});
const store = createStore(
  reducer,
  applyMiddleware(logger)
)
`),function(){return function(mn){return function(zt){return mn(zt)}}};var je=[];return function(mn){var zt=mn.getState;return function($e){return function(Ft){if(typeof _e=="function"&&!_e(zt,Ft))return $e(Ft);var ft={};je.push(ft),ft.started=pn.now(),ft.startedTime=new Date,ft.prevState=ce(zt()),ft.action=Ft;var En=void 0;if(Le)try{En=$e(Ft)}catch(st){ft.error=Te(st)}else En=$e(Ft);ft.took=pn.now()-ft.started,ft.nextState=ce(zt());var nr=G.diff&&typeof ze=="function"?ze(zt,Ft):G.diff;if(ue(je,Object.assign({},G,{diff:nr})),je.length=0,ft.error)throw ft.error;return En}}}}var Oe,Be,Xe=function(k,G){return new Array(G+1).join(k)},it=function(k,G){return Xe("0",G-k.toString().length)+k},Ht=function(k){return it(k.getHours(),2)+":"+it(k.getMinutes(),2)+":"+it(k.getSeconds(),2)+"."+it(k.getMilliseconds(),3)},pn=typeof performance<"u"&&performance!==null&&typeof performance.now=="function"?performance:Date,ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(k){return typeof k}:function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},de=function(k){if(Array.isArray(k)){for(var G=0,I=Array(k.length);G<k.length;G++)I[G]=k[G];return I}return Array.from(k)},be=[];Oe=(typeof bu>"u"?"undefined":ut(bu))==="object"&&bu?bu:typeof window<"u"?window:{},Be=Oe.DeepDiff,Be&&be.push(function(){typeof Be<"u"&&Oe.DeepDiff===_&&(Oe.DeepDiff=Be,Be=void 0)}),i(u,l),i(f,l),i(p,l),i(y,l),Object.defineProperties(_,{diff:{value:_,enumerable:!0},observableDiff:{value:w,enumerable:!0},applyDiff:{value:P,enumerable:!0},applyChange:{value:A,enumerable:!0},revertChange:{value:N,enumerable:!0},isConflict:{value:function(){return typeof Be<"u"},enumerable:!0},noConflict:{value:function(){return be&&(be.forEach(function(k){k()}),be=null),_},enumerable:!0}});var Me={E:{color:"#2196F3",text:"CHANGED:"},N:{color:"#4CAF50",text:"ADDED:"},D:{color:"#F44336",text:"DELETED:"},A:{color:"#2196F3",text:"ARRAY:"}},Ke={level:"log",logger:console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(k){return k},actionTransformer:function(k){return k},errorTransformer:function(k){return k},colors:{title:function(){return"inherit"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}},diff:!1,diffPredicate:void 0,transformer:void 0},V=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},G=k.dispatch,I=k.getState;return typeof G=="function"||typeof I=="function"?le()({dispatch:G,getState:I}):void console.error(`
[redux-logger v3] BREAKING CHANGE
[redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings.
[redux-logger v3] Change
[redux-logger v3] import createLogger from 'redux-logger'
[redux-logger v3] to
[redux-logger v3] import { createLogger } from 'redux-logger'
`)};a.defaults=Ke,a.createLogger=le,a.logger=V,a.default=V,Object.defineProperty(a,"__esModule",{value:!0})})})(Eu,Eu.exports)),Eu.exports}v6();const u_=Qk();function b6(e){e({actionCreator:Pi,effect:async a=>{await Xa.saveEntry(a.payload)}});const n=async a=>{const{stack:i,currentIndex:l}=a.getState().history,u=i[l];u?.state&&(a.dispatch($u(!0)),await Ky(u.state,a),l===i.length-1&&a.dispatch($u(!1)))};e({actionCreator:Vy,effect:async(a,i)=>n(i)}),e({actionCreator:Iy,effect:async(a,i)=>n(i)}),e({actionCreator:hE,effect:async(a,i)=>n(i)})}const c_=hk({reducer:{projects:nN,layers:lN,editor:kL,brush:BL,line:qL,shape:QL,eraser:r6,history:rN},middleware:e=>e().prepend(u_.middleware),devTools:!1}),rg=u_.startListening.withTypes();b6(rg);ZN(rg);BN(rg);const x6=ct.memo(function({projectId:n,open:a}){const i=en(),l=D.useMemo(vE,[n]),u=pt(A=>l(A,n)).slice().sort((A,j)=>j.zIndex-A.zIndex),f=pt(Hs.selectActiveLayer),p=pt(Yy),[y,g]=D.useState(null),[v,w]=D.useState(null);if(D.useEffect(()=>{if(!a||p)return;const A=c_.getState();Object.keys(A.layers.entities).length===0&&i(ju(n))},[i,n,a,p]),!a)return null;const _=A=>{p||A.forEach((j,N)=>{const P=A.length-1-N;j.zIndex!==P&&i(Is({id:j.id,changes:{zIndex:P}}))})},O={onCreate:()=>{p||i($y({projectId:n}))},onDelete:A=>{p||(i(qy(A)),w(null))},onOpacityChange:(A,j)=>{p||i(Is({id:A,changes:{opacity:j}}))},onSetActive:A=>i(Zy(A)),onToggleVisibility:(A,j)=>{p||i(Is({id:A,changes:{visible:!j}}))},onRenameSubmit:async(A,j)=>{p||(g(null),await i(Is({id:A,changes:{name:j.trim()||`${Gm.UNTITLED_PROJECT}`}})))}};return R.jsxs(Qe.aside,{initial:{x:"100%",opacity:0},animate:{x:0,opacity:1},exit:{x:"100%",opacity:0},transition:{type:"spring",stiffness:220,damping:25},className:"fixed top-0 right-16 bottom-16 w-72 border-l border-gray-200 bg-white/90 backdrop-blur-sm shadow-xl p-3 flex flex-col gap-3 z-40",children:[R.jsx("header",{className:"flex items-center justify-between",children:R.jsxs("h3",{className:"text-sm font-semibold text-gray-800",children:["Layers"," ",p&&R.jsx("span",{className:"text-amber-600 ml-1",children:"(Preview)"})]})}),R.jsx(y6,{activeLayer:f,onOpacityChange:O.onOpacityChange}),R.jsx(m6,{onCreate:O.onCreate,disabled:p}),R.jsx(wM,{axis:"y",values:u,onReorder:_,children:u.map(A=>R.jsx(TM,{value:A,children:R.jsx(p6,{layer:A,isActive:f?.id===A.id,isEditing:y===A.id,openMenuId:v,onSetActive:O.onSetActive,onToggleVisibility:O.onToggleVisibility,onRenameSubmit:O.onRenameSubmit,onDelete:O.onDelete,setLocalNameId:g,setOpenMenuId:w,disabled:p})},A.id))})]})}),w6=["file","projects"];function S6({onNewProject:e,onSaveProject:n,onExportPng:a}){const[i,l]=D.useState(null),u=Fu(),f=w=>l(_=>_===w?null:w),p=w=>R.jsx(Hr,{children:R.jsx(Qe.div,{initial:{opacity:0,y:-8,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.94},transition:{duration:.18,ease:[.22,1.2,.36,1]},onMouseLeave:()=>l(null),className:`
				absolute top-full left-0 mt-1 w-52 py-2
				bg-white border border-gray-200 shadow-xl rounded-md
				z-[9999]
			`,children:w.map((_,O)=>R.jsx(EL,{label:_.label,IconComponent:_.icon,colorClass:_.colorClass,onClick:()=>{l(null),_.onClick()},divider:_.divider},O))})}),y=[{label:Ni.FILE.NEW.label,icon:Ni.FILE.NEW.icon,colorClass:bf.NEW,onClick:e},{divider:!0,label:"",onClick:()=>{}},{label:Ni.FILE.SAVE.label,icon:Ni.FILE.SAVE.icon,colorClass:bf.SAVE,onClick:n},{label:Ni.FILE.EXPORT.label,icon:Ni.FILE.EXPORT.icon,colorClass:bf.EXPORT,onClick:a}],g=[{label:Ni.PROJECTS.OPEN_ALL.label,icon:Ni.PROJECTS.OPEN_ALL.icon,colorClass:bf.OPEN_ALL,onClick:()=>u(ku.HOME)}],v={file:y,projects:g};return R.jsx("div",{className:`
				fixed top-0 left-0 right-0 h-10
				bg-white/80 backdrop-blur-sm border-b border-gray-200
				flex items-center gap-6 px-4 z-[9999] shadow-sm
				select-none
			`,children:w6.map(w=>R.jsxs("div",{className:"relative cursor-pointer",tabIndex:0,onBlur:_=>{_.currentTarget.contains(_.relatedTarget)||l(null)},children:[R.jsx(_L,{label:w,isActive:i===w,onClick:()=>f(w)}),i===w&&p(v[w])]},w))})}const E6=()=>R.jsx("div",{className:"absolute bottom-0 left-0 w-full h-14 border-t border-gray-200 dark:border-gray-700 bg-gray-50/70 dark:bg-gray-800/70 flex items-center justify-center space-x-6",children:Array.from({length:5}).map((e,n)=>R.jsx("div",{className:"w-8 h-8 rounded-md bg-gray-200 dark:bg-gray-700 animate-pulse"},n))}),_6=()=>R.jsx("div",{className:"flex-1 flex items-center justify-center",children:R.jsx(Qe.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.4},className:"relative w-[70%] h-[75%] rounded-2xl border border-gray-300 dark:border-gray-700 bg-white/70 dark:bg-gray-800/60 shadow-lg overflow-hidden",children:R.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-gray-200 via-gray-100 to-gray-200 dark:from-gray-700 dark:via-gray-800 dark:to-gray-700 animate-pulse"})})}),T6=()=>R.jsx("div",{className:"absolute top-1/2 left-4 -translate-y-1/2 flex flex-col gap-3",children:Array.from({length:5}).map((e,n)=>R.jsx("div",{className:"w-12 h-12 rounded-xl bg-gray-200/70 dark:bg-gray-700/70 animate-pulse"},n))}),A6=()=>R.jsx("div",{className:"absolute right-0 top-0 h-full w-60 border-l border-gray-200 dark:border-gray-700 bg-gray-50/70 dark:bg-gray-800/70",children:R.jsx("div",{className:"p-4 space-y-3 animate-pulse",children:Array.from({length:4}).map((e,n)=>R.jsx("div",{className:"h-6 w-full rounded-md bg-gray-200 dark:bg-gray-700"},n))})}),R6=()=>R.jsxs("div",{className:"relative h-screen w-screen flex bg-gray-100 dark:bg-gray-900 overflow-hidden",children:[R.jsx(T6,{}),R.jsx(_6,{}),R.jsx(A6,{}),R.jsx(E6,{})]}),C6=()=>{const e=en(),n=kA(),a=pt(rd.selectActiveProject),i=pL(e,n.id),[l,u]=D.useState(null),[f,p]=D.useState({scale:1,offsetX:0,offsetY:0,showGrid:!0,handleFit:()=>{},handleReset:()=>{},toggleGrid:()=>{}}),[y,g]=D.useState(!1),[v,w]=D.useState(!1);return D.useEffect(()=>{c6()},[]),i?R.jsx(R6,{}):a?R.jsxs("div",{className:"relative h-screen w-screen bg-gray-50 dark:bg-gray-950 overflow-hidden pt-12",children:[R.jsx(S6,{onNewProject:()=>g(!0),onSaveProject:async()=>{await KN(e,a),w(!0)},onExportPng:()=>YN(a)}),R.jsx(u6,{projectId:a.id,width:a.width,height:a.height,onViewportUpdate:p}),R.jsx(DL,{}),R.jsx(jL,{active:l,onSelect:u}),R.jsxs(Hr,{children:[l===dr.LAYERS&&R.jsx(x6,{open:!0,projectId:a.id},dr.LAYERS),l===dr.HISTORY&&R.jsx(OL,{open:!0},dr.HISTORY)]}),R.jsx(ML,{scale:f.scale,offsetX:f.offsetX,offsetY:f.offsetY,onUndo:()=>e(Vy()),onRedo:()=>e(Iy()),onFit:f.handleFit,onReset:f.handleReset,onToggleGrid:f.toggleGrid,showGrid:f.showGrid}),y&&R.jsx(FE,{onClose:()=>g(!1)}),R.jsx(yL,{show:v,onHide:()=>w(!1)})]}):null},O6=({children:e,onNewProject:n})=>{const[a,i]=D.useState(!1);return R.jsxs("div",{className:"min-h-screen flex flex-col bg-gradient-to-b from-gray-50 to-gray-100",children:[R.jsx("header",{className:"sticky top-0 z-10 backdrop-blur-md bg-white/70 border-b border-gray-200",children:R.jsxs("div",{className:"max-w-7xl mx-auto flex items-center justify-between px-6 py-4",children:[R.jsx("h1",{className:"text-2xl font-bold text-gray-800 tracking-tight select-none",children:"My Projects"}),R.jsxs(Qe.button,{whileHover:{scale:1.05},whileTap:{scale:.96},onClick:n,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),className:`relative group flex items-center gap-2 px-6 py-3 rounded-full
								   bg-indigo-600 text-white font-semibold tracking-tight
								   overflow-hidden cursor-pointer shadow-md
								   transition-all duration-300 hover:shadow-[0_0_25px_rgba(99,102,241,0.5)]
								   focus:outline-none select-none`,children:[R.jsx("span",{className:`absolute -inset-[6px] rounded-full bg-gradient-to-r
									   from-indigo-500 via-purple-500 to-indigo-400
									   opacity-40 group-hover:opacity-80 blur-2xl
									   animate-[energy_3.5s_ease-in-out_infinite]
									   transition-opacity`}),R.jsx("span",{className:"absolute inset-0 rounded-full bg-indigo-600/90 group-hover:bg-indigo-700 transition-colors duration-200"}),R.jsxs("span",{className:"relative flex items-center gap-2 z-10",children:["New Project",R.jsx(Hr,{children:a&&R.jsx(Qe.svg,{initial:{opacity:0,x:-4,rotate:-90},animate:{opacity:1,x:0,rotate:0},exit:{opacity:0,x:-4,rotate:90},transition:{duration:.25},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2.2,stroke:"currentColor",className:"w-5 h-5 text-white drop-shadow-sm",children:R.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})},"plus")})]})]})]})}),R.jsx("main",{className:"flex-1 w-full max-w-7xl mx-auto px-6 py-10",children:e})]})};function D6(e,n=300){const[a,i]=D.useState(e);return D.useEffect(()=>{let l=null,u=!0;return e?i(!0):l=setTimeout(()=>{u&&i(!1)},n),()=>{u=!1,l&&clearTimeout(l)}},[e,n]),a}function j6(e){const n=en(),a=pt(rd.selectLoading);D.useEffect(()=>{!e&&a===Lf.IDLE&&n(cE())},[n,e,a])}const M6=({projectId:e,initialName:n,onClose:a})=>R.jsx(ng,{"data-testid":"update-modal",title:Dt.MODAL_UPDATE,buttonLabel:Dt.MODAL_UPDATE_BUTTON,onClose:a,initialValue:n,buildArgs:i=>({id:e,changes:{name:i}}),onSubmitAction:async(i,l)=>{await i(eN(l)).unwrap()}}),k6=({projectId:e,projectName:n,onClose:a})=>R.jsx(ng,{"data-testid":"delete-modal",title:Dt.MODAL_DELETE,buttonLabel:Dt.MODAL_DELETE_BUTTON,onClose:a,showInput:!1,customContent:R.jsxs("div",{className:"space-y-1",children:[R.jsxs("p",{children:["Are you sure you want to delete project"," ",R.jsxs("span",{className:"font-semibold text-gray-900",children:["“",n,"”"]}),"?"]}),R.jsx("p",{children:"This action cannot be undone."})]}),buildArgs:()=>({id:e}),onSubmitAction:async(i,l)=>{await i(fE(l.id)).unwrap()}}),N6={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},z6="grid gap-6 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 justify-items-center";function P6(e,n,a){return R.jsx("div",{className:"w-full max-w-[280px]",children:R.jsx(hL,{project:e,"data-testid":"project-card",onEditClick:n,onDeleteClick:a})},e.id||e.name)}const L6=({projects:e})=>{const[n,a]=D.useState(null),[i,l]=D.useState(null),u=()=>a(null),f=()=>l(null),p=e;return R.jsxs("div",{className:"relative min-h-[400px]","data-testid":"project-list",children:[R.jsx(Hr,{mode:"wait",children:R.jsx(Qe.div,{...N6,transition:{duration:.4},className:z6,children:p.map(y=>P6(y,a,l))},"cards")}),n&&R.jsx(M6,{projectId:n.id,initialName:n.name,onClose:u}),i&&R.jsx(k6,{projectId:i.id,projectName:i.name,onClose:f})]})},B6=ct.memo(L6),U6=e=>R.jsx(Qe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex flex-col items-center justify-center h-[60vh] text-center text-gray-500",...e,children:R.jsxs("div",{className:"bg-gray-100 p-8 rounded-xl shadow-inner max-w-sm",children:[R.jsx("p",{className:"text-lg font-medium mb-3",children:"No projects yet"}),R.jsx("p",{className:"text-sm mb-6",children:"Start by creating your first project to begin editing."})]})}),V6=()=>R.jsx("div",{className:"relative min-h-[400px]","data-testid":"project-list",children:R.jsx(Qe.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.3},children:R.jsx(U6,{"data-testid":"empty-state"})},"empty")}),I6=ct.memo(V6),H6=()=>R.jsx("div",{className:"relative min-h-[400px]","data-testid":"project-list",children:R.jsx(Qe.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.4},className:"grid gap-6 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 justify-items-center",children:Array.from({length:12}).map((e,n)=>R.jsx("div",{className:"w-full max-w-[280px]",children:R.jsx(Z6,{"data-testid":"skeleton"})},n))},"skeletons")}),$6=ct.memo(H6),q6=()=>{const e=pt(rd.selectAll),n=pt(rd.selectLoading);j6(e.length);const a=D6(n===Lf.PENDING),i=e.length===0&&(n===Lf.IDLE||n===Lf.SUCCEEDED);return a?R.jsx($6,{}):i?R.jsx(I6,{}):R.jsx(B6,{projects:e})},Z6=e=>R.jsxs(Qe.div,{className:"relative bg-gray-200 rounded-lg shadow p-4 space-y-3 overflow-hidden",role:"status",...e,children:[R.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-gray-200 via-gray-100 to-gray-200 animate-shimmer"}),R.jsx("div",{className:"relative h-5 bg-gray-300 rounded w-3/4"}),R.jsx("div",{className:"relative h-4 bg-gray-300 rounded w-full"}),R.jsx("div",{className:"relative h-4 bg-gray-300 rounded w-5/6"})]});function K6(){const[e,n]=D.useState(!1),a=Ii(),i=Fu(),[l,u]=D.useState(!1);return D.useEffect(()=>{a.state?.noProject&&(u(!0),i(a.pathname,{replace:!0}))},[a.pathname,a.state,i]),R.jsxs(O6,{onNewProject:()=>n(!0),children:[R.jsx(mL,{show:l,onHide:()=>u(!1)}),R.jsx(q6,{}),e&&R.jsx(FE,{onClose:()=>n(!1)})]})}const Y6=()=>R.jsx(g2,{basename:"/editor",children:R.jsxs(FA,{children:[R.jsx(nm,{path:ku.HOME,element:R.jsx(K6,{})}),R.jsx(nm,{path:`${ku.EDITOR}/:id`,element:R.jsx(C6,{})})]})});NT.createRoot(document.getElementById("root")).render(R.jsx(D.StrictMode,{children:R.jsx(QT,{store:c_,children:R.jsx(Y6,{})})}));