universal-adaptive-bars 0.0.6 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
- (function(Zt,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],M):(Zt=typeof globalThis<"u"?globalThis:Zt||self,M(Zt.SmartBarChart={},Zt.React))})(this,(function(Zt,M){"use strict";var vn={exports:{}},Ne={};var Ir;function Xu(){if(Ir)return Ne;Ir=1;var t=M,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,u,c){var l,f={},d=null,m=null;c!==void 0&&(d=""+c),u.key!==void 0&&(d=""+u.key),u.ref!==void 0&&(m=u.ref);for(l in u)i.call(u,l)&&!o.hasOwnProperty(l)&&(f[l]=u[l]);if(a&&a.defaultProps)for(l in u=a.defaultProps,u)f[l]===void 0&&(f[l]=u[l]);return{$$typeof:e,type:a,key:d,ref:m,props:f,_owner:r.current}}return Ne.Fragment=n,Ne.jsx=s,Ne.jsxs=s,Ne}var _e={};var Nr;function Ju(){return Nr||(Nr=1,process.env.NODE_ENV!=="production"&&(function(){var t=M,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),p=Symbol.iterator,g="@@iterator";function b(h){if(h===null||typeof h!="object")return null;var T=p&&h[p]||h[g];return typeof T=="function"?T:null}var y=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(h){{for(var T=arguments.length,E=new Array(T>1?T-1:0),R=1;R<T;R++)E[R-1]=arguments[R];x("error",h,E)}}function x(h,T,E){{var R=y.ReactDebugCurrentFrame,L=R.getStackAddendum();L!==""&&(T+="%s",E=E.concat([L]));var $=E.map(function(N){return String(N)});$.unshift("Warning: "+T),Function.prototype.apply.call(console[h],console,$)}}var C=!1,S=!1,V=!1,_=!1,A=!1,B;B=Symbol.for("react.module.reference");function Z(h){return!!(typeof h=="string"||typeof h=="function"||h===i||h===o||A||h===r||h===c||h===l||_||h===m||C||S||V||typeof h=="object"&&h!==null&&(h.$$typeof===d||h.$$typeof===f||h.$$typeof===s||h.$$typeof===a||h.$$typeof===u||h.$$typeof===B||h.getModuleId!==void 0))}function O(h,T,E){var R=h.displayName;if(R)return R;var L=T.displayName||T.name||"";return L!==""?E+"("+L+")":E}function at(h){return h.displayName||"Context"}function W(h){if(h==null)return null;if(typeof h.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case i:return"Fragment";case n:return"Portal";case o:return"Profiler";case r:return"StrictMode";case c:return"Suspense";case l:return"SuspenseList"}if(typeof h=="object")switch(h.$$typeof){case a:var T=h;return at(T)+".Consumer";case s:var E=h;return at(E._context)+".Provider";case u:return O(h,h.render,"ForwardRef");case f:var R=h.displayName||null;return R!==null?R:W(h.type)||"Memo";case d:{var L=h,$=L._payload,N=L._init;try{return W(N($))}catch{return null}}}return null}var U=Object.assign,nt=0,mt,F,q,z,Ct,Ae,qn;function Ht(){}Ht.__reactDisabledLog=!0;function Kt(){{if(nt===0){mt=console.log,F=console.info,q=console.warn,z=console.error,Ct=console.group,Ae=console.groupCollapsed,qn=console.groupEnd;var h={configurable:!0,enumerable:!0,value:Ht,writable:!0};Object.defineProperties(console,{info:h,log:h,warn:h,error:h,group:h,groupCollapsed:h,groupEnd:h})}nt++}}function qt(){{if(nt--,nt===0){var h={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U({},h,{value:mt}),info:U({},h,{value:F}),warn:U({},h,{value:q}),error:U({},h,{value:z}),group:U({},h,{value:Ct}),groupCollapsed:U({},h,{value:Ae}),groupEnd:U({},h,{value:qn})})}nt<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var De=y.ReactCurrentDispatcher,_t;function ut(h,T,E){{if(_t===void 0)try{throw Error()}catch(L){var R=L.stack.trim().match(/\n( *(at )?)/);_t=R&&R[1]||""}return`
2
- `+_t+h}}var zt=!1,kt;{var kr=typeof WeakMap=="function"?WeakMap:Map;kt=new kr}function zn(h,T){if(!h||zt)return"";{var E=kt.get(h);if(E!==void 0)return E}var R;zt=!0;var L=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var $;$=De.current,De.current=null,Kt();try{if(T){var N=function(){throw Error()};if(Object.defineProperty(N.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(N,[])}catch(jt){R=jt}Reflect.construct(h,[],N)}else{try{N.call()}catch(jt){R=jt}h.call(N.prototype)}}else{try{throw Error()}catch(jt){R=jt}h()}}catch(jt){if(jt&&R&&typeof jt.stack=="string"){for(var I=jt.stack.split(`
3
- `),ft=R.stack.split(`
4
- `),X=I.length-1,Q=ft.length-1;X>=1&&Q>=0&&I[X]!==ft[Q];)Q--;for(;X>=1&&Q>=0;X--,Q--)if(I[X]!==ft[Q]){if(X!==1||Q!==1)do if(X--,Q--,Q<0||I[X]!==ft[Q]){var bt=`
5
- `+I[X].replace(" at new "," at ");return h.displayName&&bt.includes("<anonymous>")&&(bt=bt.replace("<anonymous>",h.displayName)),typeof h=="function"&&kt.set(h,bt),bt}while(X>=1&&Q>=0);break}}}finally{zt=!1,De.current=$,qt(),Error.prepareStackTrace=L}var Ie=h?h.displayName||h.name:"",zu=Ie?ut(Ie):"";return typeof h=="function"&&kt.set(h,zu),zu}function Rr(h,T,E){return zn(h,!1)}function ln(h){var T=h.prototype;return!!(T&&T.isReactComponent)}function Xt(h,T,E){if(h==null)return"";if(typeof h=="function")return zn(h,ln(h));if(typeof h=="string")return ut(h);switch(h){case c:return ut("Suspense");case l:return ut("SuspenseList")}if(typeof h=="object")switch(h.$$typeof){case u:return Rr(h.render);case f:return Xt(h.type,T,E);case d:{var R=h,L=R._payload,$=R._init;try{return Xt($(L),T,E)}catch{}}}return""}var ke=Object.prototype.hasOwnProperty,fn={},dn=y.ReactDebugCurrentFrame;function Re(h){if(h){var T=h._owner,E=Xt(h.type,h._source,T?T.type:null);dn.setExtraStackFrame(E)}else dn.setExtraStackFrame(null)}function hn(h,T,E,R,L){{var $=Function.call.bind(ke);for(var N in h)if($(h,N)){var I=void 0;try{if(typeof h[N]!="function"){var ft=Error((R||"React class")+": "+E+" type `"+N+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof h[N]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ft.name="Invariant Violation",ft}I=h[N](T,N,R,E,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(X){I=X}I&&!(I instanceof Error)&&(Re(L),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",R||"React class",E,N,typeof I),Re(null)),I instanceof Error&&!(I.message in fn)&&(fn[I.message]=!0,Re(L),w("Failed %s type: %s",E,I.message),Re(null))}}}var Or=Array.isArray;function mn(h){return Or(h)}function Xn(h){{var T=typeof Symbol=="function"&&Symbol.toStringTag,E=T&&h[Symbol.toStringTag]||h.constructor.name||"Object";return E}}function Jn(h){try{return pn(h),!1}catch{return!0}}function pn(h){return""+h}function v(h){if(Jn(h))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Xn(h)),pn(h)}var k=y.ReactCurrentOwner,K={key:!0,ref:!0,__self:!0,__source:!0},it,xt;function Pt(h){if(ke.call(h,"ref")){var T=Object.getOwnPropertyDescriptor(h,"ref").get;if(T&&T.isReactWarning)return!1}return h.ref!==void 0}function Jt(h){if(ke.call(h,"key")){var T=Object.getOwnPropertyDescriptor(h,"key").get;if(T&&T.isReactWarning)return!1}return h.key!==void 0}function Rt(h,T){typeof h.ref=="string"&&k.current}function ce(h,T){{var E=function(){it||(it=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",T))};E.isReactWarning=!0,Object.defineProperty(h,"key",{get:E,configurable:!0})}}function Ot(h,T){{var E=function(){xt||(xt=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",T))};E.isReactWarning=!0,Object.defineProperty(h,"ref",{get:E,configurable:!0})}}var Zn=function(h,T,E,R,L,$,N){var I={$$typeof:e,type:h,key:T,ref:E,props:N,_owner:$};return I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(I,"_self",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.defineProperty(I,"_source",{configurable:!1,enumerable:!1,writable:!1,value:L}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I};function gn(h,T,E,R,L){{var $,N={},I=null,ft=null;E!==void 0&&(v(E),I=""+E),Jt(T)&&(v(T.key),I=""+T.key),Pt(T)&&(ft=T.ref,Rt(T,L));for($ in T)ke.call(T,$)&&!K.hasOwnProperty($)&&(N[$]=T[$]);if(h&&h.defaultProps){var X=h.defaultProps;for($ in X)N[$]===void 0&&(N[$]=X[$])}if(I||ft){var Q=typeof h=="function"?h.displayName||h.name||"Unknown":h;I&&ce(N,Q),ft&&Ot(N,Q)}return Zn(h,I,ft,L,R,k.current,N)}}var Oe=y.ReactCurrentOwner,yn=y.ReactDebugCurrentFrame;function Lt(h){if(h){var T=h._owner,E=Xt(h.type,h._source,T?T.type:null);yn.setExtraStackFrame(E)}else yn.setExtraStackFrame(null)}var Ve;Ve=!1;function Qn(h){return typeof h=="object"&&h!==null&&h.$$typeof===e}function ti(){{if(Oe.current){var h=W(Oe.current.type);if(h)return`
1
+ (function(se,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],C):(se=typeof globalThis<"u"?globalThis:se||self,C(se.SmartBarChart={},se.React))})(this,(function(se,C){"use strict";var Pn={exports:{}},He={};var Kr;function oc(){if(Kr)return He;Kr=1;var t=C,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,u,c){var l,f={},d=null,m=null;c!==void 0&&(d=""+c),u.key!==void 0&&(d=""+u.key),u.ref!==void 0&&(m=u.ref);for(l in u)i.call(u,l)&&!o.hasOwnProperty(l)&&(f[l]=u[l]);if(a&&a.defaultProps)for(l in u=a.defaultProps,u)f[l]===void 0&&(f[l]=u[l]);return{$$typeof:e,type:a,key:d,ref:m,props:f,_owner:r.current}}return He.Fragment=n,He.jsx=s,He.jsxs=s,He}var Ge={};var qr;function ac(){return qr||(qr=1,process.env.NODE_ENV!=="production"&&(function(){var t=C,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),p=Symbol.iterator,T="@@iterator";function x(h){if(h===null||typeof h!="object")return null;var b=p&&h[p]||h[T];return typeof b=="function"?b:null}var y=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(h){{for(var b=arguments.length,M=new Array(b>1?b-1:0),O=1;O<b;O++)M[O-1]=arguments[O];w("error",h,M)}}function w(h,b,M){{var O=y.ReactDebugCurrentFrame,F=O.getStackAddendum();F!==""&&(b+="%s",M=M.concat([F]));var H=M.map(function(N){return String(N)});H.unshift("Warning: "+b),Function.prototype.apply.call(console[h],console,H)}}var S=!1,E=!1,V=!1,L=!1,D=!1,B;B=Symbol.for("react.module.reference");function Z(h){return!!(typeof h=="string"||typeof h=="function"||h===i||h===o||D||h===r||h===c||h===l||L||h===m||S||E||V||typeof h=="object"&&h!==null&&(h.$$typeof===d||h.$$typeof===f||h.$$typeof===s||h.$$typeof===a||h.$$typeof===u||h.$$typeof===B||h.getModuleId!==void 0))}function R(h,b,M){var O=h.displayName;if(O)return O;var F=b.displayName||b.name||"";return F!==""?M+"("+F+")":M}function Q(h){return h.displayName||"Context"}function j(h){if(h==null)return null;if(typeof h.tag=="number"&&v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case i:return"Fragment";case n:return"Portal";case o:return"Profiler";case r:return"StrictMode";case c:return"Suspense";case l:return"SuspenseList"}if(typeof h=="object")switch(h.$$typeof){case a:var b=h;return Q(b)+".Consumer";case s:var M=h;return Q(M._context)+".Provider";case u:return R(h,h.render,"ForwardRef");case f:var O=h.displayName||null;return O!==null?O:j(h.type)||"Memo";case d:{var F=h,H=F._payload,N=F._init;try{return j(N(H))}catch{return null}}}return null}var X=Object.assign,gt=0,Et,W,J,U,at,_t,ri;function si(){}si.__reactDisabledLog=!0;function Yr(){{if(gt===0){Et=console.log,W=console.info,J=console.warn,U=console.error,at=console.group,_t=console.groupCollapsed,ri=console.groupEnd;var h={configurable:!0,enumerable:!0,value:si,writable:!0};Object.defineProperties(console,{info:h,log:h,warn:h,error:h,group:h,groupCollapsed:h,groupEnd:h})}gt++}}function Hr(){{if(gt--,gt===0){var h={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:X({},h,{value:Et}),info:X({},h,{value:W}),warn:X({},h,{value:J}),error:X({},h,{value:U}),group:X({},h,{value:at}),groupCollapsed:X({},h,{value:_t}),groupEnd:X({},h,{value:ri})})}gt<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var bn=y.ReactCurrentDispatcher,wn;function Lt(h,b,M){{if(wn===void 0)try{throw Error()}catch(F){var O=F.stack.trim().match(/\n( *(at )?)/);wn=O&&O[1]||""}return`
2
+ `+wn+h}}var jt=!1,vt;{var oi=typeof WeakMap=="function"?WeakMap:Map;vt=new oi}function Mt(h,b){if(!h||jt)return"";{var M=vt.get(h);if(M!==void 0)return M}var O;jt=!0;var F=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var H;H=bn.current,bn.current=null,Yr();try{if(b){var N=function(){throw Error()};if(Object.defineProperty(N.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(N,[])}catch(Kt){O=Kt}Reflect.construct(h,[],N)}else{try{N.call()}catch(Kt){O=Kt}h.call(N.prototype)}}else{try{throw Error()}catch(Kt){O=Kt}h()}}catch(Kt){if(Kt&&O&&typeof Kt.stack=="string"){for(var I=Kt.stack.split(`
3
+ `),ht=O.stack.split(`
4
+ `),tt=I.length-1,nt=ht.length-1;tt>=1&&nt>=0&&I[tt]!==ht[nt];)nt--;for(;tt>=1&&nt>=0;tt--,nt--)if(I[tt]!==ht[nt]){if(tt!==1||nt!==1)do if(tt--,nt--,nt<0||I[tt]!==ht[nt]){var At=`
5
+ `+I[tt].replace(" at new "," at ");return h.displayName&&At.includes("<anonymous>")&&(At=At.replace("<anonymous>",h.displayName)),typeof h=="function"&&vt.set(h,At),At}while(tt>=1&&nt>=0);break}}}finally{jt=!1,bn.current=H,Hr(),Error.prepareStackTrace=F}var Ye=h?h.displayName||h.name:"",sc=Ye?Lt(Ye):"";return typeof h=="function"&&vt.set(h,sc),sc}function ft(h,b,M){return Mt(h,!1)}function _(h){var b=h.prototype;return!!(b&&b.isReactComponent)}function Ft(h,b,M){if(h==null)return"";if(typeof h=="function")return Mt(h,_(h));if(typeof h=="string")return Lt(h);switch(h){case c:return Lt("Suspense");case l:return Lt("SuspenseList")}if(typeof h=="object")switch(h.$$typeof){case u:return ft(h.render);case f:return Ft(h.type,b,M);case d:{var O=h,F=O._payload,H=O._init;try{return Ft(H(F),b,M)}catch{}}}return""}var xt=Object.prototype.hasOwnProperty,ai={},ui=y.ReactDebugCurrentFrame;function je(h){if(h){var b=h._owner,M=Ft(h.type,h._source,b?b.type:null);ui.setExtraStackFrame(M)}else ui.setExtraStackFrame(null)}function Tn(h,b,M,O,F){{var H=Function.call.bind(xt);for(var N in h)if(H(h,N)){var I=void 0;try{if(typeof h[N]!="function"){var ht=Error((O||"React class")+": "+M+" type `"+N+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof h[N]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ht.name="Invariant Violation",ht}I=h[N](b,N,O,M,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(tt){I=tt}I&&!(I instanceof Error)&&(je(F),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",O||"React class",M,N,typeof I),je(null)),I instanceof Error&&!(I.message in ai)&&(ai[I.message]=!0,je(F),v("Failed %s type: %s",M,I.message),je(null))}}}var Sn=Array.isArray;function En(h){return Sn(h)}function ci(h){{var b=typeof Symbol=="function"&&Symbol.toStringTag,M=b&&h[Symbol.toStringTag]||h.constructor.name||"Object";return M}}function li(h){try{return fi(h),!1}catch{return!0}}function fi(h){return""+h}function Fe(h){if(li(h))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ci(h)),fi(h)}var di=y.ReactCurrentOwner,Gr={key:!0,ref:!0,__self:!0,__source:!0},Mn,Cn;function hi(h){if(xt.call(h,"ref")){var b=Object.getOwnPropertyDescriptor(h,"ref").get;if(b&&b.isReactWarning)return!1}return h.ref!==void 0}function g(h){if(xt.call(h,"key")){var b=Object.getOwnPropertyDescriptor(h,"key").get;if(b&&b.isReactWarning)return!1}return h.key!==void 0}function A(h,b){typeof h.ref=="string"&&di.current}function Y(h,b){{var M=function(){Mn||(Mn=!0,v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",b))};M.isReactWarning=!0,Object.defineProperty(h,"key",{get:M,configurable:!0})}}function st(h,b){{var M=function(){Cn||(Cn=!0,v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",b))};M.isReactWarning=!0,Object.defineProperty(h,"ref",{get:M,configurable:!0})}}var bt=function(h,b,M,O,F,H,N){var I={$$typeof:e,type:h,key:b,ref:M,props:N,_owner:H};return I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(I,"_self",{configurable:!1,enumerable:!1,writable:!1,value:O}),Object.defineProperty(I,"_source",{configurable:!1,enumerable:!1,writable:!1,value:F}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I};function Ut(h,b,M,O,F){{var H,N={},I=null,ht=null;M!==void 0&&(Fe(M),I=""+M),g(b)&&(Fe(b.key),I=""+b.key),hi(b)&&(ht=b.ref,A(b,F));for(H in b)xt.call(b,H)&&!Gr.hasOwnProperty(H)&&(N[H]=b[H]);if(h&&h.defaultProps){var tt=h.defaultProps;for(H in tt)N[H]===void 0&&(N[H]=tt[H])}if(I||ht){var nt=typeof h=="function"?h.displayName||h.name||"Unknown":h;I&&Y(N,nt),ht&&st(N,nt)}return bt(h,I,ht,F,O,di.current,N)}}var Ct=y.ReactCurrentOwner,Vt=y.ReactDebugCurrentFrame;function Pt(h){if(h){var b=h._owner,M=Ft(h.type,h._source,b?b.type:null);Vt.setExtraStackFrame(M)}else Vt.setExtraStackFrame(null)}var Yt;Yt=!1;function ee(h){return typeof h=="object"&&h!==null&&h.$$typeof===e}function ge(){{if(Ct.current){var h=j(Ct.current.type);if(h)return`
6
6
 
7
- Check the render method of \``+h+"`."}return""}}function Vr(h){return""}var Gu={};function _g(h){{var T=ti();if(!T){var E=typeof h=="string"?h:h.displayName||h.name;E&&(T=`
7
+ Check the render method of \``+h+"`."}return""}}function $e(h){return""}var Be={};function Ht(h){{var b=ge();if(!b){var M=typeof h=="string"?h:h.displayName||h.name;M&&(b=`
8
8
 
9
- Check the top-level render call using <`+E+">.")}return T}}function Hu(h,T){{if(!h._store||h._store.validated||h.key!=null)return;h._store.validated=!0;var E=_g(T);if(Gu[E])return;Gu[E]=!0;var R="";h&&h._owner&&h._owner!==Oe.current&&(R=" It was passed a child from "+W(h._owner.type)+"."),Lt(h),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',E,R),Lt(null)}}function Ku(h,T){{if(typeof h!="object")return;if(mn(h))for(var E=0;E<h.length;E++){var R=h[E];Qn(R)&&Hu(R,T)}else if(Qn(h))h._store&&(h._store.validated=!0);else if(h){var L=b(h);if(typeof L=="function"&&L!==h.entries)for(var $=L.call(h),N;!(N=$.next()).done;)Qn(N.value)&&Hu(N.value,T)}}}function Lg(h){{var T=h.type;if(T==null||typeof T=="string")return;var E;if(typeof T=="function")E=T.propTypes;else if(typeof T=="object"&&(T.$$typeof===u||T.$$typeof===f))E=T.propTypes;else return;if(E){var R=W(T);hn(E,h.props,"prop",R,h)}else if(T.PropTypes!==void 0&&!Ve){Ve=!0;var L=W(T);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",L||"Unknown")}typeof T.getDefaultProps=="function"&&!T.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function jg(h){{for(var T=Object.keys(h.props),E=0;E<T.length;E++){var R=T[E];if(R!=="children"&&R!=="key"){Lt(h),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",R),Lt(null);break}}h.ref!==null&&(Lt(h),w("Invalid attribute `ref` supplied to `React.Fragment`."),Lt(null))}}function qu(h,T,E,R,L,$){{var N=Z(h);if(!N){var I="";(h===void 0||typeof h=="object"&&h!==null&&Object.keys(h).length===0)&&(I+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ft=Vr();ft?I+=ft:I+=ti();var X;h===null?X="null":mn(h)?X="array":h!==void 0&&h.$$typeof===e?(X="<"+(W(h.type)||"Unknown")+" />",I=" Did you accidentally export a JSX literal instead of a component?"):X=typeof h,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",X,I)}var Q=gn(h,T,E,L,$);if(Q==null)return Q;if(N){var bt=T.children;if(bt!==void 0)if(R)if(mn(bt)){for(var Ie=0;Ie<bt.length;Ie++)Ku(bt[Ie],h);Object.freeze&&Object.freeze(bt)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ku(bt,h)}return h===i?jg(Q):Lg(Q),Q}}function Fg(h,T,E){return qu(h,T,E,!0)}function $g(h,T,E){return qu(h,T,E,!1)}var Bg=$g,Wg=Fg;_e.Fragment=i,_e.jsx=Bg,_e.jsxs=Wg})()),_e}var _r;function Zu(){return _r||(_r=1,process.env.NODE_ENV==="production"?vn.exports=Xu():vn.exports=Ju()),vn.exports}var P=Zu();function xn(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Qu(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Lr(t){let e,n,i;t.length!==2?(e=xn,n=(a,u)=>xn(t(a),u),i=(a,u)=>t(a)-u):(e=t===xn||t===Qu?t:tc,n=t,i=t);function r(a,u,c=0,l=a.length){if(c<l){if(e(u,u)!==0)return l;do{const f=c+l>>>1;n(a[f],u)<0?c=f+1:l=f}while(c<l)}return c}function o(a,u,c=0,l=a.length){if(c<l){if(e(u,u)!==0)return l;do{const f=c+l>>>1;n(a[f],u)<=0?c=f+1:l=f}while(c<l)}return c}function s(a,u,c=0,l=a.length){const f=r(a,u,c,l-1);return f>c&&i(a[f-1],u)>-i(a[f],u)?f-1:f}return{left:r,center:s,right:o}}function tc(){return 0}function ec(t){return t===null?NaN:+t}const nc=Lr(xn).right;Lr(ec).center;class jr extends Map{constructor(e,n=sc){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[i,r]of e)this.set(i,r)}get(e){return super.get(Fr(this,e))}has(e){return super.has(Fr(this,e))}set(e,n){return super.set(ic(this,e),n)}delete(e){return super.delete(rc(this,e))}}function Fr({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function ic({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}function rc({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t.delete(i)),n}function sc(t){return t!==null&&typeof t=="object"?t.valueOf():t}const oc=Math.sqrt(50),ac=Math.sqrt(10),uc=Math.sqrt(2);function bn(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),s=o>=oc?10:o>=ac?5:o>=uc?2:1;let a,u,c;return r<0?(c=Math.pow(10,-r)/s,a=Math.round(t*c),u=Math.round(e*c),a/c<t&&++a,u/c>e&&--u,c=-c):(c=Math.pow(10,r)*s,a=Math.round(t/c),u=Math.round(e/c),a*c<t&&++a,u*c>e&&--u),u<a&&.5<=n&&n<2?bn(t,e,n*2):[a,u,c]}function cc(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const i=e<t,[r,o,s]=i?bn(e,t,n):bn(t,e,n);if(!(o>=r))return[];const a=o-r+1,u=new Array(a);if(i)if(s<0)for(let c=0;c<a;++c)u[c]=(o-c)/-s;else for(let c=0;c<a;++c)u[c]=(o-c)*s;else if(s<0)for(let c=0;c<a;++c)u[c]=(r+c)/-s;else for(let c=0;c<a;++c)u[c]=(r+c)*s;return u}function ei(t,e,n){return e=+e,t=+t,n=+n,bn(t,e,n)[2]}function lc(t,e,n){e=+e,t=+t,n=+n;const i=e<t,r=i?ei(e,t,n):ei(t,e,n);return(i?-1:1)*(r<0?1/-r:r)}function fc(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(r);++i<r;)o[i]=t+i*n;return o}function ni(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const $r=Symbol("implicit");function Br(){var t=new jr,e=[],n=[],i=$r;function r(o){let s=t.get(o);if(s===void 0){if(i!==$r)return i;t.set(o,s=e.push(o)-1)}return n[s%n.length]}return r.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new jr;for(const s of o)t.has(s)||t.set(s,e.push(s)-1);return r},r.range=function(o){return arguments.length?(n=Array.from(o),r):n.slice()},r.unknown=function(o){return arguments.length?(i=o,r):i},r.copy=function(){return Br(e,n).unknown(i)},ni.apply(r,arguments),r}function Wr(){var t=Br().unknown(void 0),e=t.domain,n=t.range,i=0,r=1,o,s,a=!1,u=0,c=0,l=.5;delete t.unknown;function f(){var d=e().length,m=r<i,p=m?r:i,g=m?i:r;o=(g-p)/Math.max(1,d-u+c*2),a&&(o=Math.floor(o)),p+=(g-p-o*(d-u))*l,s=o*(1-u),a&&(p=Math.round(p),s=Math.round(s));var b=fc(d).map(function(y){return p+o*y});return n(m?b.reverse():b)}return t.domain=function(d){return arguments.length?(e(d),f()):e()},t.range=function(d){return arguments.length?([i,r]=d,i=+i,r=+r,f()):[i,r]},t.rangeRound=function(d){return[i,r]=d,i=+i,r=+r,a=!0,f()},t.bandwidth=function(){return s},t.step=function(){return o},t.round=function(d){return arguments.length?(a=!!d,f()):a},t.padding=function(d){return arguments.length?(u=Math.min(1,c=+d),f()):u},t.paddingInner=function(d){return arguments.length?(u=Math.min(1,d),f()):u},t.paddingOuter=function(d){return arguments.length?(c=+d,f()):c},t.align=function(d){return arguments.length?(l=Math.max(0,Math.min(1,d)),f()):l},t.copy=function(){return Wr(e(),[i,r]).round(a).paddingInner(u).paddingOuter(c).align(l)},ni.apply(f(),arguments)}function ii(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ur(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Le(){}var je=.7,wn=1/je,le="\\s*([+-]?\\d+)\\s*",Fe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",At="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dc=/^#([0-9a-f]{3,8})$/,hc=new RegExp(`^rgb\\(${le},${le},${le}\\)$`),mc=new RegExp(`^rgb\\(${At},${At},${At}\\)$`),pc=new RegExp(`^rgba\\(${le},${le},${le},${Fe}\\)$`),gc=new RegExp(`^rgba\\(${At},${At},${At},${Fe}\\)$`),yc=new RegExp(`^hsl\\(${Fe},${At},${At}\\)$`),vc=new RegExp(`^hsla\\(${Fe},${At},${At},${Fe}\\)$`),Yr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ii(Le,$e,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Gr,formatHex:Gr,formatHex8:xc,formatHsl:bc,formatRgb:Hr,toString:Hr});function Gr(){return this.rgb().formatHex()}function xc(){return this.rgb().formatHex8()}function bc(){return Jr(this).formatHsl()}function Hr(){return this.rgb().formatRgb()}function $e(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=dc.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Kr(e):n===3?new dt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Tn(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Tn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=hc.exec(t))?new dt(e[1],e[2],e[3],1):(e=mc.exec(t))?new dt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=pc.exec(t))?Tn(e[1],e[2],e[3],e[4]):(e=gc.exec(t))?Tn(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=yc.exec(t))?Xr(e[1],e[2]/100,e[3]/100,1):(e=vc.exec(t))?Xr(e[1],e[2]/100,e[3]/100,e[4]):Yr.hasOwnProperty(t)?Kr(Yr[t]):t==="transparent"?new dt(NaN,NaN,NaN,0):null}function Kr(t){return new dt(t>>16&255,t>>8&255,t&255,1)}function Tn(t,e,n,i){return i<=0&&(t=e=n=NaN),new dt(t,e,n,i)}function wc(t){return t instanceof Le||(t=$e(t)),t?(t=t.rgb(),new dt(t.r,t.g,t.b,t.opacity)):new dt}function ri(t,e,n,i){return arguments.length===1?wc(t):new dt(t,e,n,i??1)}function dt(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}ii(dt,ri,Ur(Le,{brighter(t){return t=t==null?wn:Math.pow(wn,t),new dt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?je:Math.pow(je,t),new dt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new dt(Qt(this.r),Qt(this.g),Qt(this.b),Sn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:qr,formatHex:qr,formatHex8:Tc,formatRgb:zr,toString:zr}));function qr(){return`#${te(this.r)}${te(this.g)}${te(this.b)}`}function Tc(){return`#${te(this.r)}${te(this.g)}${te(this.b)}${te((isNaN(this.opacity)?1:this.opacity)*255)}`}function zr(){const t=Sn(this.opacity);return`${t===1?"rgb(":"rgba("}${Qt(this.r)}, ${Qt(this.g)}, ${Qt(this.b)}${t===1?")":`, ${t})`}`}function Sn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Qt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function te(t){return t=Qt(t),(t<16?"0":"")+t.toString(16)}function Xr(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new wt(t,e,n,i)}function Jr(t){if(t instanceof wt)return new wt(t.h,t.s,t.l,t.opacity);if(t instanceof Le||(t=$e(t)),!t)return new wt;if(t instanceof wt)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),s=NaN,a=o-r,u=(o+r)/2;return a?(e===o?s=(n-i)/a+(n<i)*6:n===o?s=(i-e)/a+2:s=(e-n)/a+4,a/=u<.5?o+r:2-o-r,s*=60):a=u>0&&u<1?0:s,new wt(s,a,u,t.opacity)}function Sc(t,e,n,i){return arguments.length===1?Jr(t):new wt(t,e,n,i??1)}function wt(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}ii(wt,Sc,Ur(Le,{brighter(t){return t=t==null?wn:Math.pow(wn,t),new wt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?je:Math.pow(je,t),new wt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new dt(si(t>=240?t-240:t+120,r,i),si(t,r,i),si(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new wt(Zr(this.h),En(this.s),En(this.l),Sn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Sn(this.opacity);return`${t===1?"hsl(":"hsla("}${Zr(this.h)}, ${En(this.s)*100}%, ${En(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Zr(t){return t=(t||0)%360,t<0?t+360:t}function En(t){return Math.max(0,Math.min(1,t||0))}function si(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const oi=t=>()=>t;function Ec(t,e){return function(n){return t+n*e}}function Mc(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function Cc(t){return(t=+t)==1?Qr:function(e,n){return n-e?Mc(e,n,t):oi(isNaN(e)?n:e)}}function Qr(t,e){var n=e-t;return n?Ec(t,n):oi(isNaN(t)?e:t)}const ts=(function t(e){var n=Cc(e);function i(r,o){var s=n((r=ri(r)).r,(o=ri(o)).r),a=n(r.g,o.g),u=n(r.b,o.b),c=Qr(r.opacity,o.opacity);return function(l){return r.r=s(l),r.g=a(l),r.b=u(l),r.opacity=c(l),r+""}}return i.gamma=t,i})(1);function Pc(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,i=e.slice(),r;return function(o){for(r=0;r<n;++r)i[r]=t[r]*(1-o)+e[r]*o;return i}}function Ac(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Dc(t,e){var n=e?e.length:0,i=t?Math.min(n,t.length):0,r=new Array(i),o=new Array(n),s;for(s=0;s<i;++s)r[s]=ci(t[s],e[s]);for(;s<n;++s)o[s]=e[s];return function(a){for(s=0;s<i;++s)o[s]=r[s](a);return o}}function kc(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function Mn(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Rc(t,e){var n={},i={},r;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in t?n[r]=ci(t[r],e[r]):i[r]=e[r];return function(o){for(r in n)i[r]=n[r](o);return i}}var ai=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ui=new RegExp(ai.source,"g");function Oc(t){return function(){return t}}function Vc(t){return function(e){return t(e)+""}}function Ic(t,e){var n=ai.lastIndex=ui.lastIndex=0,i,r,o,s=-1,a=[],u=[];for(t=t+"",e=e+"";(i=ai.exec(t))&&(r=ui.exec(e));)(o=r.index)>n&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(i=i[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,u.push({i:s,x:Mn(i,r)})),n=ui.lastIndex;return n<e.length&&(o=e.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?u[0]?Vc(u[0].x):Oc(e):(e=u.length,function(c){for(var l=0,f;l<e;++l)a[(f=u[l]).i]=f.x(c);return a.join("")})}function ci(t,e){var n=typeof e,i;return e==null||n==="boolean"?oi(e):(n==="number"?Mn:n==="string"?(i=$e(e))?(e=i,ts):Ic:e instanceof $e?ts:e instanceof Date?kc:Ac(e)?Pc:Array.isArray(e)?Dc:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Rc:Mn)(t,e)}function Nc(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function _c(t){return function(){return t}}function Lc(t){return+t}var es=[0,1];function fe(t){return t}function li(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:_c(isNaN(e)?NaN:.5)}function jc(t,e){var n;return t>e&&(n=t,t=e,e=n),function(i){return Math.max(t,Math.min(e,i))}}function Fc(t,e,n){var i=t[0],r=t[1],o=e[0],s=e[1];return r<i?(i=li(r,i),o=n(s,o)):(i=li(i,r),o=n(o,s)),function(a){return o(i(a))}}function $c(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),o=new Array(i),s=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<i;)r[s]=li(t[s],t[s+1]),o[s]=n(e[s],e[s+1]);return function(a){var u=nc(t,a,1,i)-1;return o[u](r[u](a))}}function Bc(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Wc(){var t=es,e=es,n=ci,i,r,o,s=fe,a,u,c;function l(){var d=Math.min(t.length,e.length);return s!==fe&&(s=jc(t[0],t[d-1])),a=d>2?$c:Fc,u=c=null,f}function f(d){return d==null||isNaN(d=+d)?o:(u||(u=a(t.map(i),e,n)))(i(s(d)))}return f.invert=function(d){return s(r((c||(c=a(e,t.map(i),Mn)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,Lc),l()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),l()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),n=Nc,l()},f.clamp=function(d){return arguments.length?(s=d?!0:fe,l()):s!==fe},f.interpolate=function(d){return arguments.length?(n=d,l()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,m){return i=d,r=m,l()}}function Uc(){return Wc()(fe,fe)}function Yc(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Cn(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function de(t){return t=Cn(Math.abs(t)),t?t[1]:NaN}function Gc(t,e){return function(n,i){for(var r=n.length,o=[],s=0,a=t[0],u=0;r>0&&a>0&&(u+a+1>i&&(a=Math.max(1,i-u)),o.push(n.substring(r-=a,r+a)),!((u+=a+1)>i));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}function Hc(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Kc=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Pn(t){if(!(e=Kc.exec(t)))throw new Error("invalid format: "+t);var e;return new fi({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Pn.prototype=fi.prototype;function fi(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}fi.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function qc(t){t:for(var e=t.length,n=1,i=-1,r;n<e;++n)switch(t[n]){case".":i=r=n;break;case"0":i===0&&(i=n),r=n;break;default:if(!+t[n])break t;i>0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(r+1):t}var ns;function zc(t,e){var n=Cn(t,e);if(!n)return t+"";var i=n[0],r=n[1],o=r-(ns=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+Cn(t,Math.max(0,e+o-1))[0]}function is(t,e){var n=Cn(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const rs={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Yc,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>is(t*100,e),r:is,s:zc,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function ss(t){return t}var os=Array.prototype.map,as=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Xc(t){var e=t.grouping===void 0||t.thousands===void 0?ss:Gc(os.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",r=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?ss:Hc(os.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function c(f){f=Pn(f);var d=f.fill,m=f.align,p=f.sign,g=f.symbol,b=f.zero,y=f.width,w=f.comma,x=f.precision,C=f.trim,S=f.type;S==="n"?(w=!0,S="g"):rs[S]||(x===void 0&&(x=12),C=!0,S="g"),(b||d==="0"&&m==="=")&&(b=!0,d="0",m="=");var V=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",_=g==="$"?i:/[%p]/.test(S)?s:"",A=rs[S],B=/[defgprs%]/.test(S);x=x===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function Z(O){var at=V,W=_,U,nt,mt;if(S==="c")W=A(O)+W,O="";else{O=+O;var F=O<0||1/O<0;if(O=isNaN(O)?u:A(Math.abs(O),x),C&&(O=qc(O)),F&&+O==0&&p!=="+"&&(F=!1),at=(F?p==="("?p:a:p==="-"||p==="("?"":p)+at,W=(S==="s"?as[8+ns/3]:"")+W+(F&&p==="("?")":""),B){for(U=-1,nt=O.length;++U<nt;)if(mt=O.charCodeAt(U),48>mt||mt>57){W=(mt===46?r+O.slice(U+1):O.slice(U))+W,O=O.slice(0,U);break}}}w&&!b&&(O=e(O,1/0));var q=at.length+O.length+W.length,z=q<y?new Array(y-q+1).join(d):"";switch(w&&b&&(O=e(z+O,z.length?y-W.length:1/0),z=""),m){case"<":O=at+O+W+z;break;case"=":O=at+z+O+W;break;case"^":O=z.slice(0,q=z.length>>1)+at+O+W+z.slice(q);break;default:O=z+at+O+W;break}return o(O)}return Z.toString=function(){return f+""},Z}function l(f,d){var m=c((f=Pn(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(de(d)/3)))*3,g=Math.pow(10,-p),b=as[8+p/3];return function(y){return m(g*y)+b}}return{format:c,formatPrefix:l}}var An,us,cs;Jc({thousands:",",grouping:[3],currency:["$",""]});function Jc(t){return An=Xc(t),us=An.format,cs=An.formatPrefix,An}function Zc(t){return Math.max(0,-de(Math.abs(t)))}function Qc(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(de(e)/3)))*3-de(Math.abs(t)))}function tl(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,de(e)-de(t))+1}function el(t,e,n,i){var r=lc(t,e,n),o;switch(i=Pn(i??",f"),i.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return i.precision==null&&!isNaN(o=Qc(r,s))&&(i.precision=o),cs(i,s)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(o=tl(r,Math.max(Math.abs(t),Math.abs(e))))&&(i.precision=o-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(o=Zc(r))&&(i.precision=o-(i.type==="%")*2);break}}return us(i)}function nl(t){var e=t.domain;return t.ticks=function(n){var i=e();return cc(i[0],i[i.length-1],n??10)},t.tickFormat=function(n,i){var r=e();return el(r[0],r[r.length-1],n??10,i)},t.nice=function(n){n==null&&(n=10);var i=e(),r=0,o=i.length-1,s=i[r],a=i[o],u,c,l=10;for(a<s&&(c=s,s=a,a=c,c=r,r=o,o=c);l-- >0;){if(c=ei(s,a,n),c===u)return i[r]=s,i[o]=a,e(i);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;u=c}return t},t}function ls(){var t=Uc();return t.copy=function(){return Bc(t,ls())},ni.apply(t,arguments),nl(t)}const fs=6048e5,il=864e5,ds=6e4,hs=36e5,ms=Symbol.for("constructDateFrom");function pt(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&ms in t?t[ms](e):t instanceof Date?new t.constructor(e):new Date(e)}function tt(t,e){return pt(e||t,t)}function ps(t,e,n){const i=tt(t,n?.in);return isNaN(e)?pt(t,NaN):(e&&i.setDate(i.getDate()+e),i)}function rl(t,e,n){const i=tt(t,n?.in);if(isNaN(e))return pt(t,NaN);if(!e)return i;const r=i.getDate(),o=pt(t,i.getTime());o.setMonth(i.getMonth()+e+1,0);const s=o.getDate();return r>=s?o:(i.setFullYear(o.getFullYear(),o.getMonth(),r),i)}let sl={};function Be(){return sl}function Tt(t,e){const n=Be(),i=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=tt(t,e?.in),o=r.getDay(),s=(o<i?7:0)+o-i;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}function Dn(t,e){return Tt(t,{...e,weekStartsOn:1})}function gs(t,e){const n=tt(t,e?.in),i=n.getFullYear(),r=pt(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const o=Dn(r),s=pt(n,0);s.setFullYear(i,0,4),s.setHours(0,0,0,0);const a=Dn(s);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function ys(t){const e=tt(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function vs(t,...e){const n=pt.bind(null,e.find(i=>typeof i=="object"));return e.map(n)}function xs(t,e){const n=tt(t,e?.in);return n.setHours(0,0,0,0),n}function ol(t,e,n){const[i,r]=vs(n?.in,t,e),o=xs(i),s=xs(r),a=+o-ys(o),u=+s-ys(s);return Math.round((a-u)/il)}function al(t,e){const n=gs(t,e),i=pt(t,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Dn(i)}function bs(t,e,n){return ps(t,e*7,n)}function ul(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function ws(t){return!(!ul(t)&&typeof t!="number"||isNaN(+tt(t)))}function cl(t,e){const n=tt(t,e?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function ll(t,e){const[n,i]=vs(t,e.start,e.end);return{start:n,end:i}}function fl(t,e){const{start:n,end:i}=ll(e?.in,t);let r=+n>+i;const o=Tt(r?i:n,e),s=Tt(r?n:i,e);o.setHours(15),s.setHours(15);const a=+s.getTime();let u=o,c=1;const l=[];for(;+u<=a;)u.setHours(0),l.push(pt(n,u)),u=bs(u,c),u.setHours(15);return r?l.reverse():l}function dl(t,e){const n=tt(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function hl(t,e){const n=tt(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Ts(t,e){const n=Be(),i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=tt(t,e?.in),o=r.getDay(),s=(o<i?-7:0)+6-(o-i);return r.setDate(r.getDate()+s),r.setHours(23,59,59,999),r}const ml={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},pl=(t,e,n)=>{let i;const r=ml[t];return typeof r=="string"?i=r:e===1?i=r.one:i=r.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function di(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const gl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},yl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},vl={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xl={date:di({formats:gl,defaultWidth:"full"}),time:di({formats:yl,defaultWidth:"full"}),dateTime:di({formats:vl,defaultWidth:"full"})},bl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},wl=(t,e,n,i)=>bl[t];function We(t){return(e,n)=>{const i=n?.context?String(n.context):"standalone";let r;if(i==="formatting"&&t.formattingValues){const s=t.defaultFormattingWidth||t.defaultWidth,a=n?.width?String(n.width):s;r=t.formattingValues[a]||t.formattingValues[s]}else{const s=t.defaultWidth,a=n?.width?String(n.width):t.defaultWidth;r=t.values[a]||t.values[s]}const o=t.argumentCallback?t.argumentCallback(e):e;return r[o]}}const Tl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Sl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},El={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ml={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Cl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Pl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Al={ordinalNumber:(t,e)=>{const n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:We({values:Tl,defaultWidth:"wide"}),quarter:We({values:Sl,defaultWidth:"wide",argumentCallback:t=>t-1}),month:We({values:El,defaultWidth:"wide"}),day:We({values:Ml,defaultWidth:"wide"}),dayPeriod:We({values:Cl,defaultWidth:"wide",formattingValues:Pl,defaultFormattingWidth:"wide"})};function Ue(t){return(e,n={})=>{const i=n.width,r=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],o=e.match(r);if(!o)return null;const s=o[0],a=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(a)?kl(a,f=>f.test(s)):Dl(a,f=>f.test(s));let c;c=t.valueCallback?t.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c;const l=e.slice(s.length);return{value:c,rest:l}}}function Dl(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function kl(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Rl(t){return(e,n={})=>{const i=e.match(t.matchPattern);if(!i)return null;const r=i[0],o=e.match(t.parsePattern);if(!o)return null;let s=t.valueCallback?t.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;const a=e.slice(r.length);return{value:s,rest:a}}}const Ol=/^(\d+)(th|st|nd|rd)?/i,Vl=/\d+/i,Il={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Nl={any:[/^b/i,/^(a|c)/i]},_l={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ll={any:[/1/i,/2/i,/3/i,/4/i]},jl={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Fl={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},$l={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Bl={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Wl={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ul={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Yl={ordinalNumber:Rl({matchPattern:Ol,parsePattern:Vl,valueCallback:t=>parseInt(t,10)}),era:Ue({matchPatterns:Il,defaultMatchWidth:"wide",parsePatterns:Nl,defaultParseWidth:"any"}),quarter:Ue({matchPatterns:_l,defaultMatchWidth:"wide",parsePatterns:Ll,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Ue({matchPatterns:jl,defaultMatchWidth:"wide",parsePatterns:Fl,defaultParseWidth:"any"}),day:Ue({matchPatterns:$l,defaultMatchWidth:"wide",parsePatterns:Bl,defaultParseWidth:"any"}),dayPeriod:Ue({matchPatterns:Wl,defaultMatchWidth:"any",parsePatterns:Ul,defaultParseWidth:"any"})},Gl={code:"en-US",formatDistance:pl,formatLong:xl,formatRelative:wl,localize:Al,match:Yl,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Hl(t,e){const n=tt(t,e?.in);return ol(n,hl(n))+1}function Kl(t,e){const n=tt(t,e?.in),i=+Dn(n)-+al(n);return Math.round(i/fs)+1}function Ss(t,e){const n=tt(t,e?.in),i=n.getFullYear(),r=Be(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=pt(e?.in||t,0);s.setFullYear(i+1,0,o),s.setHours(0,0,0,0);const a=Tt(s,e),u=pt(e?.in||t,0);u.setFullYear(i,0,o),u.setHours(0,0,0,0);const c=Tt(u,e);return+n>=+a?i+1:+n>=+c?i:i-1}function ql(t,e){const n=Be(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Ss(t,e),o=pt(e?.in||t,0);return o.setFullYear(r,0,i),o.setHours(0,0,0,0),Tt(o,e)}function zl(t,e){const n=tt(t,e?.in),i=+Tt(n,e)-+ql(n,e);return Math.round(i/fs)+1}function j(t,e){const n=t<0?"-":"",i=Math.abs(t).toString().padStart(e,"0");return n+i}const Ft={y(t,e){const n=t.getFullYear(),i=n>0?n:1-n;return j(e==="yy"?i%100:i,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):j(n+1,2)},d(t,e){return j(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(t,e){return j(t.getHours()%12||12,e.length)},H(t,e){return j(t.getHours(),e.length)},m(t,e){return j(t.getMinutes(),e.length)},s(t,e){return j(t.getSeconds(),e.length)},S(t,e){const n=e.length,i=t.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return j(r,e.length)}},he={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Es={G:function(t,e,n){const i=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const i=t.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return Ft.y(t,e)},Y:function(t,e,n,i){const r=Ss(t,i),o=r>0?r:1-r;if(e==="YY"){const s=o%100;return j(s,2)}return e==="Yo"?n.ordinalNumber(o,{unit:"year"}):j(o,e.length)},R:function(t,e){const n=gs(t);return j(n,e.length)},u:function(t,e){const n=t.getFullYear();return j(n,e.length)},Q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return j(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return j(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){const i=t.getMonth();switch(e){case"M":case"MM":return Ft.M(t,e);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,n){const i=t.getMonth();switch(e){case"L":return String(i+1);case"LL":return j(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){const r=zl(t,i);return e==="wo"?n.ordinalNumber(r,{unit:"week"}):j(r,e.length)},I:function(t,e,n){const i=Kl(t);return e==="Io"?n.ordinalNumber(i,{unit:"week"}):j(i,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Ft.d(t,e)},D:function(t,e,n){const i=Hl(t);return e==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):j(i,e.length)},E:function(t,e,n){const i=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){const r=t.getDay(),o=(r-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return j(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){const r=t.getDay(),o=(r-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return j(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,n){const i=t.getDay(),r=i===0?7:i;switch(e){case"i":return String(r);case"ii":return j(r,e.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const i=t.getHours();let r;switch(i===12?r=he.noon:i===0?r=he.midnight:r=i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){const i=t.getHours();let r;switch(i>=17?r=he.evening:i>=12?r=he.afternoon:i>=4?r=he.morning:r=he.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let i=t.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Ft.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Ft.H(t,e)},K:function(t,e,n){const i=t.getHours()%12;return e==="Ko"?n.ordinalNumber(i,{unit:"hour"}):j(i,e.length)},k:function(t,e,n){let i=t.getHours();return i===0&&(i=24),e==="ko"?n.ordinalNumber(i,{unit:"hour"}):j(i,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Ft.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Ft.s(t,e)},S:function(t,e){return Ft.S(t,e)},X:function(t,e,n){const i=t.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Cs(i);case"XXXX":case"XX":return ee(i);default:return ee(i,":")}},x:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"x":return Cs(i);case"xxxx":case"xx":return ee(i);default:return ee(i,":")}},O:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ms(i,":");default:return"GMT"+ee(i,":")}},z:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ms(i,":");default:return"GMT"+ee(i,":")}},t:function(t,e,n){const i=Math.trunc(+t/1e3);return j(i,e.length)},T:function(t,e,n){return j(+t,e.length)}};function Ms(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),r=Math.trunc(i/60),o=i%60;return o===0?n+String(r):n+String(r)+e+j(o,2)}function Cs(t,e){return t%60===0?(t>0?"-":"+")+j(Math.abs(t)/60,2):ee(t,e)}function ee(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),r=j(Math.trunc(i/60),2),o=j(i%60,2);return n+r+e+o}const Ps=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},As=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Xl={p:As,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return Ps(t,e);let o;switch(i){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",Ps(i,e)).replace("{{time}}",As(r,e))}},Jl=/^D+$/,Zl=/^Y+$/,Ql=["D","DD","YY","YYYY"];function tf(t){return Jl.test(t)}function ef(t){return Zl.test(t)}function nf(t,e,n){const i=rf(t,e,n);if(console.warn(i),Ql.includes(t))throw new RangeError(i)}function rf(t,e,n){const i=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const sf=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,of=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,af=/^'([^]*?)'?$/,uf=/''/g,cf=/[a-zA-Z]/;function ct(t,e,n){const i=Be(),r=i.locale??Gl,o=i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=tt(t,n?.in);if(!ws(a))throw new RangeError("Invalid time value");let u=e.match(of).map(l=>{const f=l[0];if(f==="p"||f==="P"){const d=Xl[f];return d(l,r.formatLong)}return l}).join("").match(sf).map(l=>{if(l==="''")return{isToken:!1,value:"'"};const f=l[0];if(f==="'")return{isToken:!1,value:lf(l)};if(Es[f])return{isToken:!0,value:l};if(f.match(cf))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:l}});r.localize.preprocessor&&(u=r.localize.preprocessor(a,u));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:r};return u.map(l=>{if(!l.isToken)return l.value;const f=l.value;(ef(f)||tf(f))&&nf(f,e,String(t));const d=Es[f[0]];return d(a,f,r.localize,c)}).join("")}function lf(t){const e=t.match(af);return e?e[1].replace(uf,"'"):t}function ff(t,e){return tt(t,e?.in).getFullYear()}function df(t,e){const n=()=>pt(e?.in,NaN),r=gf(t);let o;if(r.date){const c=yf(r.date,2);o=vf(c.restDateString,c.year)}if(!o||isNaN(+o))return n();const s=+o;let a=0,u;if(r.time&&(a=xf(r.time),isNaN(a)))return n();if(r.timezone){if(u=bf(r.timezone),isNaN(u))return n()}else{const c=new Date(s+a),l=tt(0,e?.in);return l.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),l.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),l}return tt(s+a+u,e?.in)}const kn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},hf=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,mf=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,pf=/^([+-])(\d{2})(?::?(\d{2}))?$/;function gf(t){const e={},n=t.split(kn.dateTimeDelimiter);let i;if(n.length>2)return e;if(/:/.test(n[0])?i=n[0]:(e.date=n[0],i=n[1],kn.timeZoneDelimiter.test(e.date)&&(e.date=t.split(kn.timeZoneDelimiter)[0],i=t.substr(e.date.length,t.length))),i){const r=kn.timezone.exec(i);r?(e.time=i.replace(r[1],""),e.timezone=r[1]):e.time=i}return e}function yf(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),i=t.match(n);if(!i)return{year:NaN,restDateString:""};const r=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:o===null?r:o*100,restDateString:t.slice((i[1]||i[2]).length)}}function vf(t,e){if(e===null)return new Date(NaN);const n=t.match(hf);if(!n)return new Date(NaN);const i=!!n[4],r=Ye(n[1]),o=Ye(n[2])-1,s=Ye(n[3]),a=Ye(n[4]),u=Ye(n[5])-1;if(i)return Mf(e,a,u)?wf(e,a,u):new Date(NaN);{const c=new Date(0);return!Sf(e,o,s)||!Ef(e,r)?new Date(NaN):(c.setUTCFullYear(e,o,Math.max(r,s)),c)}}function Ye(t){return t?parseInt(t):1}function xf(t){const e=t.match(mf);if(!e)return NaN;const n=hi(e[1]),i=hi(e[2]),r=hi(e[3]);return Cf(n,i,r)?n*hs+i*ds+r*1e3:NaN}function hi(t){return t&&parseFloat(t.replace(",","."))||0}function bf(t){if(t==="Z")return 0;const e=t.match(pf);if(!e)return 0;const n=e[1]==="+"?-1:1,i=parseInt(e[2]),r=e[3]&&parseInt(e[3])||0;return Pf(i,r)?n*(i*hs+r*ds):NaN}function wf(t,e,n){const i=new Date(0);i.setUTCFullYear(t,0,4);const r=i.getUTCDay()||7,o=(e-1)*7+n+1-r;return i.setUTCDate(i.getUTCDate()+o),i}const Tf=[31,null,31,30,31,30,31,31,30,31,30,31];function Ds(t){return t%400===0||t%4===0&&t%100!==0}function Sf(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(Tf[e]||(Ds(t)?29:28))}function Ef(t,e){return e>=1&&e<=(Ds(t)?366:365)}function Mf(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function Cf(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function Pf(t,e){return e>=0&&e<=59}const Af=["#6366f1","#8b5cf6","#ec4899","#10b981","#f59e0b","#3b82f6","#ef4444"],Df=({data:t,view:e,dataKeys:n,colors:i=Af})=>M.useMemo(()=>{if(!t||t.length===0)return[];const s=t.map((c,l)=>{const f=c[n.date],d=f instanceof Date?f:df(f);let m=0,p=[];return Array.isArray(n.value)?n.value.forEach((g,b)=>{const y=Number(c[g])||0;m+=y,p.push({key:g,value:y,color:i[b%i.length]})}):m=Number(c[n.value])||0,{id:c.id||`item-${l}`,label:c[n.label]||"",value:m,stackedValues:p.length>0?p:void 0,date:ws(d)?d:new Date,color:p.length===0?i[0]:void 0}}).sort((c,l)=>c.date.getTime()-l.date.getTime()),a=(c,l)=>c.reduce((f,d)=>{const m=l(d);return(f[m]=f[m]||[]).push(d),f},{});let u=[];if(e==="day"){const c=a(s,l=>ct(l.date,"yyyy-MM-dd"));u=Object.entries(c).map(([l,f])=>{const d=f,m=d[0],p=d.reduce((b,y)=>b+y.value,0);let g=[];if(m.stackedValues){const b=new Map;d.forEach(y=>{y.stackedValues?.forEach(w=>{const x=b.get(w.key)||0;b.set(w.key,x+w.value)})}),g=Array.from(b.entries()).map(([y,w],x)=>({key:y,value:w,color:i[x%i.length]}))}return{...m,id:l,label:ct(m.date,"E dd"),value:p,stackedValues:g.length>0?g:void 0}})}else if(e==="week"){const c=a(s,l=>ct(Tt(l.date),"yyyy-MM-dd"));u=Object.entries(c).map(([l,f])=>{const d=f,m=d[0],p=d.reduce((x,C)=>x+C.value,0);let g=[];if(m.stackedValues){const x=new Map;d.forEach(C=>{C.stackedValues?.forEach(S=>{const V=x.get(S.key)||0;x.set(S.key,V+S.value)})}),g=Array.from(x.entries()).map(([C,S],V)=>({key:C,value:S,color:i[V%i.length]}))}const b=Tt(m.date),y=Ts(m.date),w=`${ct(b,"MMM dd")}-${ct(y,"MMM dd")}`;return{...m,id:l,label:w,value:p,stackedValues:g.length>0?g:void 0}})}else if(e==="month"){const c=a(s,l=>ct(dl(l.date),"yyyy-MM"));u=Object.entries(c).map(([l,f])=>{const d=f,m=d[0],p=d.reduce((b,y)=>b+y.value,0);let g=[];if(m.stackedValues){const b=new Map;d.forEach(y=>{y.stackedValues?.forEach(w=>{const x=b.get(w.key)||0;b.set(w.key,x+w.value)})}),g=Array.from(b.entries()).map(([y,w],x)=>({key:y,value:w,color:i[x%i.length]}))}return{...m,id:l,label:ct(m.date,"MMM yy"),value:p,stackedValues:g.length>0?g:void 0}})}else if(e==="year"){const c=a(s,l=>ct(l.date,"yyyy"));u=Object.entries(c).map(([l,f])=>{const d=f,m=d[0],p=d.reduce((b,y)=>b+y.value,0);let g=[];if(m.stackedValues){const b=new Map;d.forEach(y=>{y.stackedValues?.forEach(w=>{const x=b.get(w.key)||0;b.set(w.key,x+w.value)})}),g=Array.from(b.entries()).map(([y,w],x)=>({key:y,value:w,color:i[x%i.length]}))}return{...m,id:l,label:l,value:p,stackedValues:g.length>0?g:void 0}})}else u=s;return u},[t,e,n,i]),ks=M.createContext({});function kf(t){const e=M.useRef(null);return e.current===null&&(e.current=t()),e.current}const mi=typeof window<"u",Rf=mi?M.useLayoutEffect:M.useEffect,pi=M.createContext(null);function gi(t,e){t.indexOf(e)===-1&&t.push(e)}function yi(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Vt=(t,e,n)=>n>e?e:n<t?t:n;function vi(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let me=()=>{},It=()=>{};process.env.NODE_ENV!=="production"&&(me=(t,e,n)=>{!t&&typeof console<"u"&&console.warn(vi(e,n))},It=(t,e,n)=>{if(!t)throw new Error(vi(e,n))});const Nt={},Rs=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Os(t){return typeof t=="object"&&t!==null}const Vs=t=>/^0[^.\s]+$/u.test(t);function xi(t){let e;return()=>(e===void 0&&(e=t()),e)}const gt=t=>t,Of=(t,e)=>n=>e(t(n)),Ge=(...t)=>t.reduce(Of),He=(t,e,n)=>{const i=e-t;return i===0?1:(n-t)/i};class bi{constructor(){this.subscriptions=[]}add(e){return gi(this.subscriptions,e),()=>yi(this.subscriptions,e)}notify(e,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,n,i);else for(let o=0;o<r;o++){const s=this.subscriptions[o];s&&s(e,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const St=t=>t*1e3,yt=t=>t/1e3;function Is(t,e){return e?t*(1e3/e):0}const Ns=new Set;function wi(t,e,n){t||Ns.has(e)||(console.warn(vi(e,n)),Ns.add(e))}const _s=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Vf=1e-7,If=12;function Nf(t,e,n,i,r){let o,s,a=0;do s=e+(n-e)/2,o=_s(s,i,r)-t,o>0?n=s:e=s;while(Math.abs(o)>Vf&&++a<If);return s}function Ke(t,e,n,i){if(t===e&&n===i)return gt;const r=o=>Nf(o,0,1,t,n);return o=>o===0||o===1?o:_s(r(o),e,i)}const Ls=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,js=t=>e=>1-t(1-e),Fs=Ke(.33,1.53,.69,.99),Ti=js(Fs),$s=Ls(Ti),Bs=t=>(t*=2)<1?.5*Ti(t):.5*(2-Math.pow(2,-10*(t-1))),Si=t=>1-Math.sin(Math.acos(t)),Ws=js(Si),Us=Ls(Si),_f=Ke(.42,0,1,1),Lf=Ke(0,0,.58,1),Ys=Ke(.42,0,.58,1),jf=t=>Array.isArray(t)&&typeof t[0]!="number",Gs=t=>Array.isArray(t)&&typeof t[0]=="number",Hs={linear:gt,easeIn:_f,easeInOut:Ys,easeOut:Lf,circIn:Si,circInOut:Us,circOut:Ws,backIn:Ti,backInOut:$s,backOut:Fs,anticipate:Bs},Ff=t=>typeof t=="string",Ks=t=>{if(Gs(t)){It(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,i,r]=t;return Ke(e,n,i,r)}else if(Ff(t))return It(Hs[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),Hs[t];return t},Rn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function $f(t,e){let n=new Set,i=new Set,r=!1,o=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(l){s.has(l)&&(c.schedule(l),t()),l(a)}const c={schedule:(l,f=!1,d=!1)=>{const p=d&&r?n:i;return f&&s.add(l),p.has(l)||p.add(l),l},cancel:l=>{i.delete(l),s.delete(l)},process:l=>{if(a=l,r){o=!0;return}r=!0,[n,i]=[i,n],n.forEach(u),n.clear(),r=!1,o&&(o=!1,c.process(l))}};return c}const Bf=40;function qs(t,e){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=Rn.reduce((x,C)=>(x[C]=$f(o),x),{}),{setup:a,read:u,resolveKeyframes:c,preUpdate:l,update:f,preRender:d,render:m,postRender:p}=s,g=()=>{const x=Nt.useManualTiming?r.timestamp:performance.now();n=!1,Nt.useManualTiming||(r.delta=i?1e3/60:Math.max(Math.min(x-r.timestamp,Bf),1)),r.timestamp=x,r.isProcessing=!0,a.process(r),u.process(r),c.process(r),l.process(r),f.process(r),d.process(r),m.process(r),p.process(r),r.isProcessing=!1,n&&e&&(i=!1,t(g))},b=()=>{n=!0,i=!0,r.isProcessing||t(g)};return{schedule:Rn.reduce((x,C)=>{const S=s[C];return x[C]=(V,_=!1,A=!1)=>(n||b(),S.schedule(V,_,A)),x},{}),cancel:x=>{for(let C=0;C<Rn.length;C++)s[Rn[C]].cancel(x)},state:r,steps:s}}const{schedule:Y,cancel:$t,state:rt,steps:Ei}=qs(typeof requestAnimationFrame<"u"?requestAnimationFrame:gt,!0);let On;function Wf(){On=void 0}const ht={now:()=>(On===void 0&&ht.set(rt.isProcessing||Nt.useManualTiming?rt.timestamp:performance.now()),On),set:t=>{On=t,queueMicrotask(Wf)}},zs=t=>e=>typeof e=="string"&&e.startsWith(t),Xs=zs("--"),Uf=zs("var(--"),Mi=t=>Uf(t)?Yf.test(t.split("/*")[0].trim()):!1,Yf=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,pe={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},qe={...pe,transform:t=>Vt(0,1,t)},Vn={...pe,default:1},ze=t=>Math.round(t*1e5)/1e5,Ci=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Gf(t){return t==null}const Hf=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Pi=(t,e)=>n=>!!(typeof n=="string"&&Hf.test(n)&&n.startsWith(t)||e&&!Gf(n)&&Object.prototype.hasOwnProperty.call(n,e)),Js=(t,e,n)=>i=>{if(typeof i!="string")return i;const[r,o,s,a]=i.match(Ci);return{[t]:parseFloat(r),[e]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},Kf=t=>Vt(0,255,t),Ai={...pe,transform:t=>Math.round(Kf(t))},ne={test:Pi("rgb","red"),parse:Js("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Ai.transform(t)+", "+Ai.transform(e)+", "+Ai.transform(n)+", "+ze(qe.transform(i))+")"};function qf(t){let e="",n="",i="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const Di={test:Pi("#"),parse:qf,transform:ne.transform},Xe=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Bt=Xe("deg"),Dt=Xe("%"),D=Xe("px"),zf=Xe("vh"),Xf=Xe("vw"),Zs={...Dt,parse:t=>Dt.parse(t)/100,transform:t=>Dt.transform(t*100)},ge={test:Pi("hsl","hue"),parse:Js("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Dt.transform(ze(e))+", "+Dt.transform(ze(n))+", "+ze(qe.transform(i))+")"},J={test:t=>ne.test(t)||Di.test(t)||ge.test(t),parse:t=>ne.test(t)?ne.parse(t):ge.test(t)?ge.parse(t):Di.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ne.transform(t):ge.transform(t),getAnimatableNone:t=>{const e=J.parse(t);return e.alpha=0,J.transform(e)}},Jf=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Zf(t){return isNaN(t)&&typeof t=="string"&&(t.match(Ci)?.length||0)+(t.match(Jf)?.length||0)>0}const Qs="number",to="color",Qf="var",td="var(",eo="${}",ed=/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 Je(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},r=[];let o=0;const a=e.replace(ed,u=>(J.test(u)?(i.color.push(o),r.push(to),n.push(J.parse(u))):u.startsWith(td)?(i.var.push(o),r.push(Qf),n.push(u)):(i.number.push(o),r.push(Qs),n.push(parseFloat(u))),++o,eo)).split(eo);return{values:n,split:a,indexes:i,types:r}}function no(t){return Je(t).values}function io(t){const{split:e,types:n}=Je(t),i=e.length;return r=>{let o="";for(let s=0;s<i;s++)if(o+=e[s],r[s]!==void 0){const a=n[s];a===Qs?o+=ze(r[s]):a===to?o+=J.transform(r[s]):o+=r[s]}return o}}const nd=t=>typeof t=="number"?0:J.test(t)?J.getAnimatableNone(t):t;function id(t){const e=no(t);return io(t)(e.map(nd))}const Wt={test:Zf,parse:no,createTransformer:io,getAnimatableNone:id};function ki(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function rd({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,e/=100,n/=100;let r=0,o=0,s=0;if(!e)r=o=s=n;else{const a=n<.5?n*(1+e):n+e-n*e,u=2*n-a;r=ki(u,a,t+1/3),o=ki(u,a,t),s=ki(u,a,t-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:i}}function In(t,e){return n=>n>0?e:t}const G=(t,e,n)=>t+(e-t)*n,Ri=(t,e,n)=>{const i=t*t,r=n*(e*e-i)+i;return r<0?0:Math.sqrt(r)},sd=[Di,ne,ge],od=t=>sd.find(e=>e.test(t));function ro(t){const e=od(t);if(me(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===ge&&(n=rd(n)),n}const so=(t,e)=>{const n=ro(t),i=ro(e);if(!n||!i)return In(t,e);const r={...n};return o=>(r.red=Ri(n.red,i.red,o),r.green=Ri(n.green,i.green,o),r.blue=Ri(n.blue,i.blue,o),r.alpha=G(n.alpha,i.alpha,o),ne.transform(r))},Oi=new Set(["none","hidden"]);function ad(t,e){return Oi.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function ud(t,e){return n=>G(t,e,n)}function Vi(t){return typeof t=="number"?ud:typeof t=="string"?Mi(t)?In:J.test(t)?so:fd:Array.isArray(t)?oo:typeof t=="object"?J.test(t)?so:cd:In}function oo(t,e){const n=[...t],i=n.length,r=t.map((o,s)=>Vi(o)(o,e[s]));return o=>{for(let s=0;s<i;s++)n[s]=r[s](o);return n}}function cd(t,e){const n={...t,...e},i={};for(const r in n)t[r]!==void 0&&e[r]!==void 0&&(i[r]=Vi(t[r])(t[r],e[r]));return r=>{for(const o in i)n[o]=i[o](r);return n}}function ld(t,e){const n=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],s=t.indexes[o][i[o]],a=t.values[s]??0;n[r]=a,i[o]++}return n}const fd=(t,e)=>{const n=Wt.createTransformer(e),i=Je(t),r=Je(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Oi.has(t)&&!r.values.length||Oi.has(e)&&!i.values.length?ad(t,e):Ge(oo(ld(i,r),r.values),n):(me(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),In(t,e))};function ao(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?G(t,e,n):Vi(t)(t,e)}const dd=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Y.update(e,n),stop:()=>$t(e),now:()=>rt.isProcessing?rt.timestamp:ht.now()}},uo=(t,e,n=10)=>{let i="";const r=Math.max(Math.round(e/n),2);for(let o=0;o<r;o++)i+=Math.round(t(o/(r-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Nn=2e4;function Ii(t){let e=0;const n=50;let i=t.next(e);for(;!i.done&&e<Nn;)e+=n,i=t.next(e);return e>=Nn?1/0:e}function hd(t,e=100,n){const i=n({...t,keyframes:[0,e]}),r=Math.min(Ii(i),Nn);return{type:"keyframes",ease:o=>i.next(r*o).value/e,duration:yt(r)}}const md=5;function co(t,e,n){const i=Math.max(e-md,0);return Is(n-t(i),e-i)}const H={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},Ni=.001;function pd({duration:t=H.duration,bounce:e=H.bounce,velocity:n=H.velocity,mass:i=H.mass}){let r,o;me(t<=St(H.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-e;s=Vt(H.minDamping,H.maxDamping,s),t=Vt(H.minDuration,H.maxDuration,yt(t)),s<1?(r=c=>{const l=c*s,f=l*t,d=l-n,m=_i(c,s),p=Math.exp(-f);return Ni-d/m*p},o=c=>{const f=c*s*t,d=f*n+n,m=Math.pow(s,2)*Math.pow(c,2)*t,p=Math.exp(-f),g=_i(Math.pow(c,2),s);return(-r(c)+Ni>0?-1:1)*((d-m)*p)/g}):(r=c=>{const l=Math.exp(-c*t),f=(c-n)*t+1;return-Ni+l*f},o=c=>{const l=Math.exp(-c*t),f=(n-c)*(t*t);return l*f});const a=5/t,u=yd(r,o,a);if(t=St(t),isNaN(u))return{stiffness:H.stiffness,damping:H.damping,duration:t};{const c=Math.pow(u,2)*i;return{stiffness:c,damping:s*2*Math.sqrt(i*c),duration:t}}}const gd=12;function yd(t,e,n){let i=n;for(let r=1;r<gd;r++)i=i-t(i)/e(i);return i}function _i(t,e){return t*Math.sqrt(1-e*e)}const vd=["duration","bounce"],xd=["stiffness","damping","mass"];function lo(t,e){return e.some(n=>t[n]!==void 0)}function bd(t){let e={velocity:H.velocity,stiffness:H.stiffness,damping:H.damping,mass:H.mass,isResolvedFromDuration:!1,...t};if(!lo(t,xd)&&lo(t,vd))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,o=2*Vt(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:H.mass,stiffness:r,damping:o}}else{const n=pd(t);e={...e,...n,mass:H.mass},e.isResolvedFromDuration=!0}return e}function _n(t=H.visualDuration,e=H.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:r}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:u,damping:c,mass:l,duration:f,velocity:d,isResolvedFromDuration:m}=bd({...n,velocity:-yt(n.velocity||0)}),p=d||0,g=c/(2*Math.sqrt(u*l)),b=s-o,y=yt(Math.sqrt(u/l)),w=Math.abs(b)<5;i||(i=w?H.restSpeed.granular:H.restSpeed.default),r||(r=w?H.restDelta.granular:H.restDelta.default);let x;if(g<1){const S=_i(y,g);x=V=>{const _=Math.exp(-g*y*V);return s-_*((p+g*y*b)/S*Math.sin(S*V)+b*Math.cos(S*V))}}else if(g===1)x=S=>s-Math.exp(-y*S)*(b+(p+y*b)*S);else{const S=y*Math.sqrt(g*g-1);x=V=>{const _=Math.exp(-g*y*V),A=Math.min(S*V,300);return s-_*((p+g*y*b)*Math.sinh(A)+S*b*Math.cosh(A))/S}}const C={calculatedDuration:m&&f||null,next:S=>{const V=x(S);if(m)a.done=S>=f;else{let _=S===0?p:0;g<1&&(_=S===0?St(p):co(x,S,V));const A=Math.abs(_)<=i,B=Math.abs(s-V)<=r;a.done=A&&B}return a.value=a.done?s:V,a},toString:()=>{const S=Math.min(Ii(C),Nn),V=uo(_=>C.next(S*_).value,S,30);return S+"ms "+V},toTransition:()=>{}};return C}_n.applyToOptions=t=>{const e=hd(t,100,_n);return t.ease=e.ease,t.duration=St(e.duration),t.type="keyframes",t};function Li({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:u,restDelta:c=.5,restSpeed:l}){const f=t[0],d={done:!1,value:f},m=A=>a!==void 0&&A<a||u!==void 0&&A>u,p=A=>a===void 0?u:u===void 0||Math.abs(a-A)<Math.abs(u-A)?a:u;let g=n*e;const b=f+g,y=s===void 0?b:s(b);y!==b&&(g=y-f);const w=A=>-g*Math.exp(-A/i),x=A=>y+w(A),C=A=>{const B=w(A),Z=x(A);d.done=Math.abs(B)<=c,d.value=d.done?y:Z};let S,V;const _=A=>{m(d.value)&&(S=A,V=_n({keyframes:[d.value,p(d.value)],velocity:co(x,A,d.value),damping:r,stiffness:o,restDelta:c,restSpeed:l}))};return _(0),{calculatedDuration:null,next:A=>{let B=!1;return!V&&S===void 0&&(B=!0,C(A),_(A)),S!==void 0&&A>=S?V.next(A-S):(!B&&C(A),d)}}}function wd(t,e,n){const i=[],r=n||Nt.mix||ao,o=t.length-1;for(let s=0;s<o;s++){let a=r(t[s],t[s+1]);if(e){const u=Array.isArray(e)?e[s]||gt:e;a=Ge(u,a)}i.push(a)}return i}function Td(t,e,{clamp:n=!0,ease:i,mixer:r}={}){const o=t.length;if(It(o===e.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const s=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=wd(e,i,r),u=a.length,c=l=>{if(s&&l<t[0])return e[0];let f=0;if(u>1)for(;f<t.length-2&&!(l<t[f+1]);f++);const d=He(t[f],t[f+1],l);return a[f](d)};return n?l=>c(Vt(t[0],t[o-1],l)):c}function Sd(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const r=He(0,e,i);t.push(G(n,1,r))}}function Ed(t){const e=[0];return Sd(e,t.length-1),e}function Md(t,e){return t.map(n=>n*e)}function Cd(t,e){return t.map(()=>e||Ys).splice(0,t.length-1)}function ye({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const r=jf(i)?i.map(Ks):Ks(i),o={done:!1,value:e[0]},s=Md(n&&n.length===e.length?n:Ed(e),t),a=Td(s,e,{ease:Array.isArray(r)?r:Cd(e,r)});return{calculatedDuration:t,next:u=>(o.value=a(u),o.done=u>=t,o)}}const Pd=t=>t!==null;function ji(t,{repeat:e,repeatType:n="loop"},i,r=1){const o=t.filter(Pd),a=r<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!a||i===void 0?o[a]:i}const Ad={decay:Li,inertia:Li,tween:ye,keyframes:ye,spring:_n};function fo(t){typeof t.type=="string"&&(t.type=Ad[t.type])}class Fi{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Dd=t=>t/100;class $i extends Fi{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==ht.now()&&this.tick(ht.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;fo(e);const{type:n=ye,repeat:i=0,repeatDelay:r=0,repeatType:o,velocity:s=0}=e;let{keyframes:a}=e;const u=n||ye;process.env.NODE_ENV!=="production"&&u!==ye&&It(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),u!==ye&&typeof a[0]!="number"&&(this.mixKeyframes=Ge(Dd,ao(a[0],a[1])),a=[0,100]);const c=u({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=Ii(c));const{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(i+1)-r,this.generator=c}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:i,totalDuration:r,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return i.next(0);const{delay:c=0,keyframes:l,repeat:f,repeatType:d,repeatDelay:m,type:p,onUpdate:g,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?y<0:y>r;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let x=this.currentTime,C=i;if(f){const A=Math.min(this.currentTime,r)/a;let B=Math.floor(A),Z=A%1;!Z&&A>=1&&(Z=1),Z===1&&B--,B=Math.min(B,f+1),B%2&&(d==="reverse"?(Z=1-Z,m&&(Z-=m/a)):d==="mirror"&&(C=s)),x=Vt(0,1,Z)*a}const S=w?{done:!1,value:l[0]}:C.next(x);o&&(S.value=o(S.value));let{done:V}=S;!w&&u!==null&&(V=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return _&&p!==Li&&(S.value=ji(l,this.options,b,this.speed)),g&&g(S.value),_&&this.finish(),S}then(e,n){return this.finished.then(e,n)}get duration(){return yt(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+yt(e)}get time(){return yt(this.currentTime)}set time(e){e=St(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(ht.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=yt(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=dd,startTime:n}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),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=n??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(ht.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(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function kd(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ie=t=>t*180/Math.PI,Bi=t=>{const e=ie(Math.atan2(t[1],t[0]));return Wi(e)},Rd={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Bi,rotateZ:Bi,skewX:t=>ie(Math.atan(t[1])),skewY:t=>ie(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Wi=t=>(t=t%360,t<0&&(t+=360),t),ho=Bi,mo=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),po=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Od={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:mo,scaleY:po,scale:t=>(mo(t)+po(t))/2,rotateX:t=>Wi(ie(Math.atan2(t[6],t[5]))),rotateY:t=>Wi(ie(Math.atan2(-t[2],t[0]))),rotateZ:ho,rotate:ho,skewX:t=>ie(Math.atan(t[4])),skewY:t=>ie(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ui(t){return t.includes("scale")?1:0}function Yi(t,e){if(!t||t==="none")return Ui(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,r;if(n)i=Od,r=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Rd,r=a}if(!r)return Ui(e);const o=i[e],s=r[1].split(",").map(Id);return typeof o=="function"?o(s):s[o]}const Vd=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Yi(n,e)};function Id(t){return parseFloat(t.trim())}const ve=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xe=new Set(ve),go=t=>t===pe||t===D,Nd=new Set(["x","y","z"]),_d=ve.filter(t=>!Nd.has(t));function Ld(t){const e=[];return _d.forEach(n=>{const i=t.getValue(n);i!==void 0&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}const re={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Yi(e,"x"),y:(t,{transform:e})=>Yi(e,"y")};re.translateX=re.x,re.translateY=re.y;const se=new Set;let Gi=!1,Hi=!1,Ki=!1;function yo(){if(Hi){const t=Array.from(se).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),n=new Map;e.forEach(i=>{const r=Ld(i);r.length&&(n.set(i,r),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([o,s])=>{i.getValue(o)?.set(s)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Hi=!1,Gi=!1,se.forEach(t=>t.complete(Ki)),se.clear()}function vo(){se.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Hi=!0)})}function jd(){Ki=!0,vo(),yo(),Ki=!1}class qi{constructor(e,n,i,r,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=i,this.motionValue=r,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(se.add(this),Gi||(Gi=!0,Y.read(vo),Y.resolveKeyframes(yo))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:i,motionValue:r}=this;if(e[0]===null){const o=r?.get(),s=e[e.length-1];if(o!==void 0)e[0]=o;else if(i&&n){const a=i.readValue(n,s);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=s),r&&o===void 0&&r.set(e[0])}kd(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),se.delete(this)}cancel(){this.state==="scheduled"&&(se.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Fd=t=>t.startsWith("--");function $d(t,e,n){Fd(e)?t.style.setProperty(e,n):t.style[e]=n}const Bd=xi(()=>window.ScrollTimeline!==void 0),Wd={};function Ud(t,e){const n=xi(t);return()=>Wd[e]??n()}const xo=Ud(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ze=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,bo={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ze([0,.65,.55,1]),circOut:Ze([.55,0,1,.45]),backIn:Ze([.31,.01,.66,-.59]),backOut:Ze([.33,1.53,.69,.99])};function wo(t,e){if(t)return typeof t=="function"?xo()?uo(t,e):"ease-out":Gs(t)?Ze(t):Array.isArray(t)?t.map(n=>wo(n,e)||bo.easeOut):bo[t]}function Yd(t,e,n,{delay:i=0,duration:r=300,repeat:o=0,repeatType:s="loop",ease:a="easeOut",times:u}={},c=void 0){const l={[e]:n};u&&(l.offset=u);const f=wo(a,r);Array.isArray(f)&&(l.easing=f);const d={delay:i,duration:r,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(l,d)}function To(t){return typeof t=="function"&&"applyToOptions"in t}function Gd({type:t,...e}){return To(t)&&xo()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Hd extends Fi{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:i,keyframes:r,pseudoElement:o,allowFlatten:s=!1,finalKeyframe:a,onComplete:u}=e;this.isPseudoElement=!!o,this.allowFlatten=s,this.options=e,It(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=Gd(e);this.animation=Yd(n,i,r,c,o),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const l=ji(r,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(l):$d(n,i,l),this.animation.cancel()}u?.(),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:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return yt(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+yt(e)}get time(){return yt(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=St(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Bd()?(this.animation.timeline=e,gt):n(this)}}const So={anticipate:Bs,backInOut:$s,circInOut:Us};function Kd(t){return t in So}function qd(t){typeof t.ease=="string"&&Kd(t.ease)&&(t.ease=So[t.ease])}const Eo=10;class zd extends Hd{constructor(e){qd(e),fo(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:i,onComplete:r,element:o,...s}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new $i({...s,autoplay:!1}),u=St(this.finishedTime??this.time);n.setWithVelocity(a.sample(u-Eo).value,a.sample(u).value,Eo),a.stop()}}const Mo=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Wt.test(t)||t==="0")&&!t.startsWith("url("));function Xd(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Jd(t,e,n,i){const r=t[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],s=Mo(r,e),a=Mo(o,e);return me(s===a,`You are trying to animate ${e} from "${r}" to "${o}". "${s?o:r}" is not an animatable value.`,"value-not-animatable"),!s||!a?!1:Xd(t)||(n==="spring"||To(n))&&i}function zi(t){t.duration=0,t.type="keyframes"}const Zd=new Set(["opacity","clipPath","filter","transform"]),Qd=xi(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function th(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:r,damping:o,type:s}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:c}=e.owner.getProps();return Qd()&&n&&Zd.has(n)&&(n!=="transform"||!c)&&!u&&!i&&r!=="mirror"&&o!==0&&s!=="inertia"}const eh=40;class nh extends Fi{constructor({autoplay:e=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:s="loop",keyframes:a,name:u,motionValue:c,element:l,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ht.now();const d={autoplay:e,delay:n,type:i,repeat:r,repeatDelay:o,repeatType:s,name:u,motionValue:c,element:l,...f},m=l?.KeyframeResolver||qi;this.keyframeResolver=new m(a,(p,g,b)=>this.onKeyframesResolved(p,g,d,!b),u,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,r){this.keyframeResolver=void 0;const{name:o,type:s,velocity:a,delay:u,isHandoff:c,onUpdate:l}=i;this.resolvedAt=ht.now(),Jd(e,o,s,a)||((Nt.instantAnimations||!u)&&l?.(ji(e,i,n)),e[0]=e[e.length-1],zi(i),i.repeat=0);const d={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>eh?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},m=!c&&th(d)?new zd({...d,element:d.motionValue.owner.current}):new $i(d);m.finished.then(()=>this.notifyFinished()).catch(gt),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),jd()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const ih=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function rh(t){const e=ih.exec(t);if(!e)return[,];const[,n,i,r]=e;return[`--${n??i}`,r]}const sh=4;function Co(t,e,n=1){It(n<=sh,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,r]=rh(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const s=o.trim();return Rs(s)?parseFloat(s):s}return Mi(r)?Co(r,e,n+1):r}function Xi(t,e){return t?.[e]??t?.default??t}const Po=new Set(["width","height","top","left","right","bottom",...ve]),oh={test:t=>t==="auto",parse:t=>t},Ao=t=>e=>e.test(t),Do=[pe,D,Dt,Bt,Xf,zf,oh],ko=t=>Do.find(Ao(t));function ah(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Vs(t):!0}const uh=new Set(["brightness","contrast","saturate","opacity"]);function ch(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=n.match(Ci)||[];if(!i)return t;const r=n.replace(i,"");let o=uh.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+r+")"}const lh=/\b([a-z-]*)\(.*?\)/gu,Ji={...Wt,getAnimatableNone:t=>{const e=t.match(lh);return e?e.map(ch).join(" "):t}},Ro={...pe,transform:Math.round},Zi={borderWidth:D,borderTopWidth:D,borderRightWidth:D,borderBottomWidth:D,borderLeftWidth:D,borderRadius:D,radius:D,borderTopLeftRadius:D,borderTopRightRadius:D,borderBottomRightRadius:D,borderBottomLeftRadius:D,width:D,maxWidth:D,height:D,maxHeight:D,top:D,right:D,bottom:D,left:D,padding:D,paddingTop:D,paddingRight:D,paddingBottom:D,paddingLeft:D,margin:D,marginTop:D,marginRight:D,marginBottom:D,marginLeft:D,backgroundPositionX:D,backgroundPositionY:D,...{rotate:Bt,rotateX:Bt,rotateY:Bt,rotateZ:Bt,scale:Vn,scaleX:Vn,scaleY:Vn,scaleZ:Vn,skew:Bt,skewX:Bt,skewY:Bt,distance:D,translateX:D,translateY:D,translateZ:D,x:D,y:D,z:D,perspective:D,transformPerspective:D,opacity:qe,originX:Zs,originY:Zs,originZ:D},zIndex:Ro,fillOpacity:qe,strokeOpacity:qe,numOctaves:Ro},fh={...Zi,color:J,backgroundColor:J,outlineColor:J,fill:J,stroke:J,borderColor:J,borderTopColor:J,borderRightColor:J,borderBottomColor:J,borderLeftColor:J,filter:Ji,WebkitFilter:Ji},Oo=t=>fh[t];function Vo(t,e){let n=Oo(t);return n!==Ji&&(n=Wt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const dh=new Set(["auto","none","0"]);function hh(t,e,n){let i=0,r;for(;i<t.length&&!r;){const o=t[i];typeof o=="string"&&!dh.has(o)&&Je(o).values.length&&(r=t[i]),i++}if(r&&n)for(const o of e)t[o]=Vo(n,r)}class mh extends qi{constructor(e,n,i,r,o){super(e,n,i,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let c=e[u];if(typeof c=="string"&&(c=c.trim(),Mi(c))){const l=Co(c,n.current);l!==void 0&&(e[u]=l),u===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Po.has(i)||e.length!==2)return;const[r,o]=e,s=ko(r),a=ko(o);if(s!==a)if(go(s)&&go(a))for(let u=0;u<e.length;u++){const c=e[u];typeof c=="string"&&(e[u]=parseFloat(c))}else re[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,i=[];for(let r=0;r<e.length;r++)(e[r]===null||ah(e[r]))&&i.push(r);i.length&&hh(e,i,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=re[i](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&e.getValue(i,r).jump(r,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,s=i[o];i[o]=re[n](e.measureViewportBox(),window.getComputedStyle(e.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,u])=>{e.getValue(a).set(u)}),this.resolveNoneKeyframes()}}function ph(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let i=document;const r=n?.[t]??i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}const Io=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function gh(t){return Os(t)&&"offsetHeight"in t}const No=30,yh=t=>!isNaN(parseFloat(t));class vh{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const r=ht.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=ht.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=yh(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&wi(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new bi);const i=this.events[e].add(n);return e==="change"?()=>{i(),Y.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ht.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>No)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,No);return Is(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),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 be(t,e){return new vh(t,e)}const{schedule:Qi}=qs(queueMicrotask,!1),Et={x:!1,y:!1};function _o(){return Et.x||Et.y}function xh(t){return t==="x"||t==="y"?Et[t]?null:(Et[t]=!0,()=>{Et[t]=!1}):Et.x||Et.y?null:(Et.x=Et.y=!0,()=>{Et.x=Et.y=!1})}function Lo(t,e){const n=ph(t),i=new AbortController,r={passive:!0,...e,signal:i.signal};return[n,r,()=>i.abort()]}function jo(t){return!(t.pointerType==="touch"||_o())}function bh(t,e,n={}){const[i,r,o]=Lo(t,n),s=a=>{if(!jo(a))return;const{target:u}=a,c=e(u,a);if(typeof c!="function"||!u)return;const l=f=>{jo(f)&&(c(f),u.removeEventListener("pointerleave",l))};u.addEventListener("pointerleave",l,r)};return i.forEach(a=>{a.addEventListener("pointerenter",s,r)}),o}const Fo=(t,e)=>e?t===e?!0:Fo(t,e.parentElement):!1,tr=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,wh=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Th(t){return wh.has(t.tagName)||t.tabIndex!==-1}const Ln=new WeakSet;function $o(t){return e=>{e.key==="Enter"&&t(e)}}function er(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Sh=(t,e)=>{const n=t.currentTarget;if(!n)return;const i=$o(()=>{if(Ln.has(n))return;er(n,"down");const r=$o(()=>{er(n,"up")}),o=()=>er(n,"cancel");n.addEventListener("keyup",r,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function Bo(t){return tr(t)&&!_o()}function Eh(t,e,n={}){const[i,r,o]=Lo(t,n),s=a=>{const u=a.currentTarget;if(!Bo(a))return;Ln.add(u);const c=e(u,a),l=(m,p)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),Ln.has(u)&&Ln.delete(u),Bo(m)&&typeof c=="function"&&c(m,{success:p})},f=m=>{l(m,u===window||u===document||n.useGlobalTarget||Fo(u,m.target))},d=m=>{l(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",d,r)};return i.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,r),gh(a)&&(a.addEventListener("focus",c=>Sh(c,r)),!Th(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function Wo(t){return Os(t)&&"ownerSVGElement"in t}function Mh(t){return Wo(t)&&t.tagName==="svg"}const st=t=>!!(t&&t.getVelocity),Ch=[...Do,J,Wt],Ph=t=>Ch.find(Ao(t)),Uo=M.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ah(t=!0){const e=M.useContext(pi);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=e,o=M.useId();M.useEffect(()=>{if(t)return r(o)},[t]);const s=M.useCallback(()=>t&&i&&i(o),[o,i,t]);return!n&&i?[!1,s]:[!0]}const Yo=M.createContext({strict:!1}),Go={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"]},we={};for(const t in Go)we[t]={isEnabled:e=>Go[t].some(n=>!!e[n])};function Dh(t){for(const e in t)we[e]={...we[e],...t[e]}}const kh=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 jn(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||kh.has(t)}let Ho=t=>!jn(t);function Rh(t){typeof t=="function"&&(Ho=e=>e.startsWith("on")?!jn(e):t(e))}try{Rh(require("@emotion/is-prop-valid").default)}catch{}function Oh(t,e,n){const i={};for(const r in t)r==="values"&&typeof t.values=="object"||(Ho(r)||n===!0&&jn(r)||!e&&!jn(r)||t.draggable&&r.startsWith("onDrag"))&&(i[r]=t[r]);return i}const Fn=M.createContext({});function $n(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Qe(t){return typeof t=="string"||Array.isArray(t)}const nr=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ir=["initial",...nr];function Bn(t){return $n(t.animate)||ir.some(e=>Qe(t[e]))}function Ko(t){return!!(Bn(t)||t.variants)}function Vh(t,e){if(Bn(t)){const{initial:n,animate:i}=t;return{initial:n===!1||Qe(n)?n:void 0,animate:Qe(i)?i:void 0}}return t.inherit!==!1?e:{}}function Ih(t){const{initial:e,animate:n}=Vh(t,M.useContext(Fn));return M.useMemo(()=>({initial:e,animate:n}),[qo(e),qo(n)])}function qo(t){return Array.isArray(t)?t.join(" "):t}function zo(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const tn={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(D.test(t))t=parseFloat(t);else return t;const n=zo(t,e.target.x),i=zo(t,e.target.y);return`${n}% ${i}%`}},Nh={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,r=Wt.parse(t);if(r.length>5)return i;const o=Wt.createTransformer(t),s=typeof r[0]!="number"?1:0,a=n.x.scale*e.x,u=n.y.scale*e.y;r[0+s]/=a,r[1+s]/=u;const c=G(a,u,.5);return typeof r[2+s]=="number"&&(r[2+s]/=c),typeof r[3+s]=="number"&&(r[3+s]/=c),o(r)}},rr={borderRadius:{...tn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:tn,borderTopRightRadius:tn,borderBottomLeftRadius:tn,borderBottomRightRadius:tn,boxShadow:Nh};function Xo(t,{layout:e,layoutId:n}){return xe.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!rr[t]||t==="opacity")}const _h={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Lh=ve.length;function jh(t,e,n){let i="",r=!0;for(let o=0;o<Lh;o++){const s=ve[o],a=t[s];if(a===void 0)continue;let u=!0;if(typeof a=="number"?u=a===(s.startsWith("scale")?1:0):u=parseFloat(a)===0,!u||n){const c=Io(a,Zi[s]);if(!u){r=!1;const l=_h[s]||s;i+=`${l}(${c}) `}n&&(e[s]=c)}}return i=i.trim(),n?i=n(e,r?"":i):r&&(i="none"),i}function sr(t,e,n){const{style:i,vars:r,transformOrigin:o}=t;let s=!1,a=!1;for(const u in e){const c=e[u];if(xe.has(u)){s=!0;continue}else if(Xs(u)){r[u]=c;continue}else{const l=Io(c,Zi[u]);u.startsWith("origin")?(a=!0,o[u]=l):i[u]=l}}if(e.transform||(s||n?i.transform=jh(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:u="50%",originY:c="50%",originZ:l=0}=o;i.transformOrigin=`${u} ${c} ${l}`}}const or=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Jo(t,e,n){for(const i in e)!st(e[i])&&!Xo(i,n)&&(t[i]=e[i])}function Fh({transformTemplate:t},e){return M.useMemo(()=>{const n=or();return sr(n,e,t),Object.assign({},n.vars,n.style)},[e])}function $h(t,e){const n=t.style||{},i={};return Jo(i,n,t),Object.assign(i,Fh(t,e)),i}function Bh(t,e){const n={},i=$h(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const Wh={offset:"stroke-dashoffset",array:"stroke-dasharray"},Uh={offset:"strokeDashoffset",array:"strokeDasharray"};function Yh(t,e,n=1,i=0,r=!0){t.pathLength=1;const o=r?Wh:Uh;t[o.offset]=D.transform(-i);const s=D.transform(e),a=D.transform(n);t[o.array]=`${s} ${a}`}function Zo(t,{attrX:e,attrY:n,attrScale:i,pathLength:r,pathSpacing:o=1,pathOffset:s=0,...a},u,c,l){if(sr(t,a,c),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:d}=t;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=l?.transformBox??"fill-box",delete f.transformBox),e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),i!==void 0&&(f.scale=i),r!==void 0&&Yh(f,r,o,s,!1)}const Qo=()=>({...or(),attrs:{}}),ta=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Gh(t,e,n,i){const r=M.useMemo(()=>{const o=Qo();return Zo(o,e,ta(i),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};Jo(o,t.style,t),r.style={...o,...r.style}}return r}const Hh=["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 ar(t){return typeof t!="string"||t.includes("-")?!1:!!(Hh.indexOf(t)>-1||/[A-Z]/u.test(t))}function Kh(t,e,n,{latestValues:i},r,o=!1){const a=(ar(t)?Gh:Bh)(e,i,r,t),u=Oh(e,typeof t=="string",o),c=t!==M.Fragment?{...u,...a,ref:n}:{},{children:l}=e,f=M.useMemo(()=>st(l)?l.get():l,[l]);return M.createElement(t,{...c,children:f})}function ea(t){const e=[{},{}];return t?.values.forEach((n,i)=>{e[0][i]=n.get(),e[1][i]=n.getVelocity()}),e}function ur(t,e,n,i){if(typeof e=="function"){const[r,o]=ea(i);e=e(n!==void 0?n:t.custom,r,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[r,o]=ea(i);e=e(n!==void 0?n:t.custom,r,o)}return e}function Wn(t){return st(t)?t.get():t}function qh({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,r){return{latestValues:zh(n,i,r,t),renderState:e()}}function zh(t,e,n,i){const r={},o=i(t,{});for(const d in o)r[d]=Wn(o[d]);let{initial:s,animate:a}=t;const u=Bn(t),c=Ko(t);e&&c&&!u&&t.inherit!==!1&&(s===void 0&&(s=e.initial),a===void 0&&(a=e.animate));let l=n?n.initial===!1:!1;l=l||s===!1;const f=l?a:s;if(f&&typeof f!="boolean"&&!$n(f)){const d=Array.isArray(f)?f:[f];for(let m=0;m<d.length;m++){const p=ur(t,d[m]);if(p){const{transitionEnd:g,transition:b,...y}=p;for(const w in y){let x=y[w];if(Array.isArray(x)){const C=l?x.length-1:0;x=x[C]}x!==null&&(r[w]=x)}for(const w in g)r[w]=g[w]}}}return r}const na=t=>(e,n)=>{const i=M.useContext(Fn),r=M.useContext(pi),o=()=>qh(t,e,i,r);return n?o():kf(o)};function cr(t,e,n){const{style:i}=t,r={};for(const o in i)(st(i[o])||e.style&&st(e.style[o])||Xo(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=i[o]);return r}const Xh=na({scrapeMotionValuesFromProps:cr,createRenderState:or});function ia(t,e,n){const i=cr(t,e,n);for(const r in t)if(st(t[r])||st(e[r])){const o=ve.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[o]=t[r]}return i}const Jh=na({scrapeMotionValuesFromProps:ia,createRenderState:Qo}),Zh=Symbol.for("motionComponentSymbol");function Te(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Qh(t,e,n){return M.useCallback(i=>{i&&t.onMount&&t.onMount(i),e&&(i?e.mount(i):e.unmount()),n&&(typeof n=="function"?n(i):Te(n)&&(n.current=i))},[e])}const lr=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ra="data-"+lr("framerAppearId"),sa=M.createContext({});function tm(t,e,n,i,r){const{visualElement:o}=M.useContext(Fn),s=M.useContext(Yo),a=M.useContext(pi),u=M.useContext(Uo).reducedMotion,c=M.useRef(null);i=i||s.renderer,!c.current&&i&&(c.current=i(t,{visualState:e,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:u}));const l=c.current,f=M.useContext(sa);l&&!l.projection&&r&&(l.type==="html"||l.type==="svg")&&em(c.current,n,r,f);const d=M.useRef(!1);M.useInsertionEffect(()=>{l&&d.current&&l.update(n,a)});const m=n[ra],p=M.useRef(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return Rf(()=>{l&&(d.current=!0,window.MotionIsMounted=!0,l.updateFeatures(),l.scheduleRenderMicrotask(),p.current&&l.animationState&&l.animationState.animateChanges())}),M.useEffect(()=>{l&&(!p.current&&l.animationState&&l.animationState.animateChanges(),p.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(m)}),p.current=!1),l.enteringChildren=void 0)}),l}function em(t,e,n,i){const{layoutId:r,layout:o,drag:s,dragConstraints:a,layoutScroll:u,layoutRoot:c,layoutCrossfade:l}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:oa(t.parent)),t.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!s||a&&Te(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:l,layoutScroll:u,layoutRoot:c})}function oa(t){if(t)return t.options.allowProjection!==!1?t.projection:oa(t.parent)}function fr(t,{forwardMotionProps:e=!1}={},n,i){n&&Dh(n);const r=ar(t)?Jh:Xh;function o(a,u){let c;const l={...M.useContext(Uo),...a,layoutId:nm(a)},{isStatic:f}=l,d=Ih(a),m=r(a,f);if(!f&&mi){im(l,n);const p=rm(l);c=p.MeasureLayout,d.visualElement=tm(t,m,l,i,p.ProjectionNode)}return P.jsxs(Fn.Provider,{value:d,children:[c&&d.visualElement?P.jsx(c,{visualElement:d.visualElement,...l}):null,Kh(t,a,Qh(m,d.visualElement,u),m,f,e)]})}o.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const s=M.forwardRef(o);return s[Zh]=t,s}function nm({layoutId:t}){const e=M.useContext(ks).id;return e&&t!==void 0?e+"-"+t:t}function im(t,e){const n=M.useContext(Yo).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const i="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?me(!1,i,"lazy-strict-mode"):It(!1,i,"lazy-strict-mode")}}function rm(t){const{drag:e,layout:n}=we;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function sm(t,e){if(typeof Proxy>"u")return fr;const n=new Map,i=(o,s)=>fr(o,s,t,e),r=(o,s)=>(process.env.NODE_ENV!=="production"&&wi(!1,"motion() is deprecated. Use motion.create() instead."),i(o,s));return new Proxy(r,{get:(o,s)=>s==="create"?i:(n.has(s)||n.set(s,fr(s,void 0,t,e)),n.get(s))})}function aa({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function om({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function am(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function dr(t){return t===void 0||t===1}function hr({scale:t,scaleX:e,scaleY:n}){return!dr(t)||!dr(e)||!dr(n)}function oe(t){return hr(t)||ua(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function ua(t){return ca(t.x)||ca(t.y)}function ca(t){return t&&t!=="0%"}function Un(t,e,n){const i=t-n,r=e*i;return n+r}function la(t,e,n,i,r){return r!==void 0&&(t=Un(t,r,i)),Un(t,n,i)+e}function mr(t,e=0,n=1,i,r){t.min=la(t.min,e,n,i,r),t.max=la(t.max,e,n,i,r)}function fa(t,{x:e,y:n}){mr(t.x,e.translate,e.scale,e.originPoint),mr(t.y,n.translate,n.scale,n.originPoint)}const da=.999999999999,ha=1.0000000000001;function um(t,e,n,i=!1){const r=n.length;if(!r)return;e.x=e.y=1;let o,s;for(let a=0;a<r;a++){o=n[a],s=o.projectionDelta;const{visualElement:u}=o.options;u&&u.props.style&&u.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Ee(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(e.x*=s.x.scale,e.y*=s.y.scale,fa(t,s)),i&&oe(o.latestValues)&&Ee(t,o.latestValues))}e.x<ha&&e.x>da&&(e.x=1),e.y<ha&&e.y>da&&(e.y=1)}function Se(t,e){t.min=t.min+e,t.max=t.max+e}function ma(t,e,n,i,r=.5){const o=G(t.min,t.max,r);mr(t,e,n,o,i)}function Ee(t,e){ma(t.x,e.x,e.scaleX,e.scale,e.originX),ma(t.y,e.y,e.scaleY,e.scale,e.originY)}function pa(t,e){return aa(am(t.getBoundingClientRect(),e))}function cm(t,e,n){const i=pa(t,n),{scroll:r}=e;return r&&(Se(i.x,r.offset.x),Se(i.y,r.offset.y)),i}const ga=()=>({translate:0,scale:1,origin:0,originPoint:0}),Me=()=>({x:ga(),y:ga()}),ya=()=>({min:0,max:0}),et=()=>({x:ya(),y:ya()}),pr={current:null},va={current:!1};function lm(){if(va.current=!0,!!mi)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>pr.current=t.matches;t.addEventListener("change",e),e()}else pr.current=!1}const fm=new WeakMap;function dm(t,e,n){for(const i in e){const r=e[i],o=n[i];if(st(r))t.addValue(i,r);else if(st(o))t.addValue(i,be(r,{owner:t}));else if(o!==r)if(t.hasValue(i)){const s=t.getValue(i);s.liveStyle===!0?s.jump(r):s.hasAnimated||s.set(r)}else{const s=t.getStaticValue(i);t.addValue(i,be(s!==void 0?s:r,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const xa=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class hm{scrapeMotionValuesFromProps(e,n,i){return{}}constructor({parent:e,props:n,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:o,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=qi,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 d=ht.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,Y.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=s;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Bn(n),this.isVariantNode=Ko(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:l,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const m=f[d];u[d]!==void 0&&st(m)&&m.set(u[d])}}mount(e){this.current=e,fm.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),va.current||lm(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:pr.current,process.env.NODE_ENV!=="production"&&wi(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),$t(this.notifyUpdate),$t(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const i=xe.has(e);i&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",s=>{this.latestValues[e]=s,this.props.onUpdate&&Y.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{r(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in we){const n=we[e];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[e]&&r&&i(this.props)&&(this.features[e]=new r(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):et()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<xa.length;i++){const r=xa[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const o="on"+r,s=e[o];s&&(this.propEventSubscriptions[r]=this.on(r,s))}this.prevMotionValues=dm(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const i=this.values.get(e);n!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&n!==void 0&&(i=be(n===null?void 0:n,{owner:this}),this.addValue(e,i)),i}readValue(e,n){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Rs(i)||Vs(i))?i=parseFloat(i):!Ph(i)&&Wt.test(n)&&(i=Vo(e,n)),this.setBaseTarget(e,st(i)?i.get():i)),st(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=ur(this.props,n,this.presenceContext?.custom);o&&(i=o[e])}if(n&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!st(r)?r:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new bi),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Qi.render(this.render)}}class ba extends hm{constructor(){super(...arguments),this.KeyframeResolver=mh}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:i}){delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;st(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function wa(t,{style:e,vars:n},i,r){const o=t.style;let s;for(s in e)o[s]=e[s];r?.applyProjectionStyles(o,i);for(s in n)o.setProperty(s,n[s])}function mm(t){return window.getComputedStyle(t)}class pm extends ba{constructor(){super(...arguments),this.type="html",this.renderInstance=wa}readValueFromInstance(e,n){if(xe.has(n))return this.projection?.isProjecting?Ui(n):Vd(e,n);{const i=mm(e),r=(Xs(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return pa(e,n)}build(e,n,i){sr(e,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,i){return cr(e,n,i)}}const Ta=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 gm(t,e,n,i){wa(t,e,void 0,i);for(const r in e.attrs)t.setAttribute(Ta.has(r)?r:lr(r),e.attrs[r])}class ym extends ba{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=et}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(xe.has(n)){const i=Oo(n);return i&&i.default||0}return n=Ta.has(n)?n:lr(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,i){return ia(e,n,i)}build(e,n,i){Zo(e,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,n,i,r){gm(e,n,i,r)}mount(e){this.isSVGTag=ta(e.tagName),super.mount(e)}}const vm=(t,e)=>ar(t)?new ym(e):new pm(e,{allowProjection:t!==M.Fragment});function Ce(t,e,n){const i=t.getProps();return ur(i,e,n!==void 0?n:i.custom,t)}const gr=t=>Array.isArray(t);function xm(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,be(n))}function bm(t){return gr(t)?t[t.length-1]||0:t}function wm(t,e){const n=Ce(t,e);let{transitionEnd:i={},transition:r={},...o}=n||{};o={...o,...i};for(const s in o){const a=bm(o[s]);xm(t,s,a)}}function Tm(t){return!!(st(t)&&t.add)}function yr(t,e){const n=t.getValue("willChange");if(Tm(n))return n.add(e);if(!n&&Nt.WillChange){const i=new Nt.WillChange("auto");t.addValue("willChange",i),i.add(e)}}function Sa(t){return t.props[ra]}const Sm=t=>t!==null;function Em(t,{repeat:e,repeatType:n="loop"},i){const r=t.filter(Sm),o=e&&n!=="loop"&&e%2===1?0:r.length-1;return r[o]}const Mm={type:"spring",stiffness:500,damping:25,restSpeed:10},Cm=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Pm={type:"keyframes",duration:.8},Am={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Dm=(t,{keyframes:e})=>e.length>2?Pm:xe.has(t)?t.startsWith("scale")?Cm(e[1]):Mm:Am;function km({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:o,repeatType:s,repeatDelay:a,from:u,elapsed:c,...l}){return!!Object.keys(l).length}const vr=(t,e,n,i={},r,o)=>s=>{const a=Xi(i,t)||{},u=a.delay||i.delay||0;let{elapsed:c=0}=i;c=c-St(u);const l={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:r};km(a)||Object.assign(l,Dm(t,l)),l.duration&&(l.duration=St(l.duration)),l.repeatDelay&&(l.repeatDelay=St(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let f=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(zi(l),l.delay===0&&(f=!0)),(Nt.instantAnimations||Nt.skipAnimations)&&(f=!0,zi(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,f&&!o&&e.get()!==void 0){const d=Em(l.keyframes,a);if(d!==void 0){Y.update(()=>{l.onUpdate(d),l.onComplete()});return}}return a.isSync?new $i(l):new nh(l)};function Rm({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,i}function Ea(t,e,{delay:n=0,transitionOverride:i,type:r}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:s,...a}=e;i&&(o=i);const u=[],c=r&&t.animationState&&t.animationState.getState()[r];for(const l in a){const f=t.getValue(l,t.latestValues[l]??null),d=a[l];if(d===void 0||c&&Rm(c,l))continue;const m={delay:n,...Xi(o||{},l)},p=f.get();if(p!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===p&&!m.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const y=Sa(t);if(y){const w=window.MotionHandoffAnimation(y,l,Y);w!==null&&(m.startTime=w,g=!0)}}yr(t,l),f.start(vr(l,f,d,t.shouldReduceMotion&&Po.has(l)?{type:!1}:m,t,g));const b=f.animation;b&&u.push(b)}return s&&Promise.all(u).then(()=>{Y.update(()=>{s&&wm(t,s)})}),u}function Ma(t,e,n,i=0,r=1){const o=Array.from(t).sort((c,l)=>c.sortNodePosition(l)).indexOf(e),s=t.size,a=(s-1)*i;return typeof n=="function"?n(o,s):r===1?o*i:a-o*i}function xr(t,e,n={}){const i=Ce(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const o=i?()=>Promise.all(Ea(t,i,n)):()=>Promise.resolve(),s=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:l,staggerDirection:f}=r;return Om(t,e,u,c,l,f,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[u,c]=a==="beforeChildren"?[o,s]:[s,o];return u().then(()=>c())}else return Promise.all([o(),s(n.delay)])}function Om(t,e,n=0,i=0,r=0,o=1,s){const a=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),a.push(xr(u,e,{...s,delay:n+(typeof i=="function"?0:i)+Ma(t.variantChildren,u,i,r,o)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(a)}function Vm(t,e,n={}){t.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(o=>xr(t,o,n));i=Promise.all(r)}else if(typeof e=="string")i=xr(t,e,n);else{const r=typeof e=="function"?Ce(t,e,n.custom):e;i=Promise.all(Ea(t,r,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}function Ca(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const Im=ir.length;function Pa(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Pa(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Im;n++){const i=ir[n],r=t.props[i];(Qe(r)||r===!1)&&(e[i]=r)}return e}const Nm=[...nr].reverse(),_m=nr.length;function Lm(t){return e=>Promise.all(e.map(({animation:n,options:i})=>Vm(t,n,i)))}function jm(t){let e=Lm(t),n=Aa(),i=!0;const r=u=>(c,l)=>{const f=Ce(t,l,u==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:m,...p}=f;c={...c,...p,...m}}return c};function o(u){e=u(t)}function s(u){const{props:c}=t,l=Pa(t.parent)||{},f=[],d=new Set;let m={},p=1/0;for(let b=0;b<_m;b++){const y=Nm[b],w=n[y],x=c[y]!==void 0?c[y]:l[y],C=Qe(x),S=y===u?w.isActive:null;S===!1&&(p=b);let V=x===l[y]&&x!==c[y]&&C;if(V&&i&&t.manuallyAnimateOnMount&&(V=!1),w.protectedKeys={...m},!w.isActive&&S===null||!x&&!w.prevProp||$n(x)||typeof x=="boolean")continue;const _=Fm(w.prevProp,x);let A=_||y===u&&w.isActive&&!V&&C||b>p&&C,B=!1;const Z=Array.isArray(x)?x:[x];let O=Z.reduce(r(y),{});S===!1&&(O={});const{prevResolvedValues:at={}}=w,W={...at,...O},U=F=>{A=!0,d.has(F)&&(B=!0,d.delete(F)),w.needsAnimating[F]=!0;const q=t.getValue(F);q&&(q.liveStyle=!1)};for(const F in W){const q=O[F],z=at[F];if(m.hasOwnProperty(F))continue;let Ct=!1;gr(q)&&gr(z)?Ct=!Ca(q,z):Ct=q!==z,Ct?q!=null?U(F):d.add(F):q!==void 0&&d.has(F)?U(F):w.protectedKeys[F]=!0}w.prevProp=x,w.prevResolvedValues=O,w.isActive&&(m={...m,...O}),i&&t.blockInitialAnimation&&(A=!1);const nt=V&&_;A&&(!nt||B)&&f.push(...Z.map(F=>{const q={type:y};if(typeof F=="string"&&i&&!nt&&t.manuallyAnimateOnMount&&t.parent){const{parent:z}=t,Ct=Ce(z,F);if(z.enteringChildren&&Ct){const{delayChildren:Ae}=Ct.transition||{};q.delay=Ma(z.enteringChildren,t,Ae)}}return{animation:F,options:q}}))}if(d.size){const b={};if(typeof c.initial!="boolean"){const y=Ce(t,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(b.transition=y.transition)}d.forEach(y=>{const w=t.getBaseTarget(y),x=t.getValue(y);x&&(x.liveStyle=!0),b[y]=w??null}),f.push({animation:b})}let g=!!f.length;return i&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(g=!1),i=!1,g?e(f):Promise.resolve()}function a(u,c){if(n[u].isActive===c)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(u,c)),n[u].isActive=c;const l=s(u);for(const f in n)n[f].protectedKeys={};return l}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Aa()}}}function Fm(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Ca(e,t):!1}function ae(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Aa(){return{animate:ae(!0),whileInView:ae(),whileHover:ae(),whileTap:ae(),whileDrag:ae(),whileFocus:ae(),exit:ae()}}class Ut{constructor(e){this.isMounted=!1,this.node=e}update(){}}class $m extends Ut{constructor(e){super(e),e.animationState||(e.animationState=jm(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();$n(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Bm=0;class Wm extends Ut{constructor(){super(...arguments),this.id=Bm++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const r=this.node.animationState.setActive("exit",!e);n&&!e&&r.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Um={animation:{Feature:$m},exit:{Feature:Wm}};function en(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function nn(t){return{point:{x:t.pageX,y:t.pageY}}}const Ym=t=>e=>tr(e)&&t(e,nn(e));function rn(t,e,n,i){return en(t,e,Ym(n),i)}const Da=1e-4,Gm=1-Da,Hm=1+Da,ka=.01,Km=0-ka,qm=0+ka;function lt(t){return t.max-t.min}function zm(t,e,n){return Math.abs(t-e)<=n}function Ra(t,e,n,i=.5){t.origin=i,t.originPoint=G(e.min,e.max,t.origin),t.scale=lt(n)/lt(e),t.translate=G(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Gm&&t.scale<=Hm||isNaN(t.scale))&&(t.scale=1),(t.translate>=Km&&t.translate<=qm||isNaN(t.translate))&&(t.translate=0)}function sn(t,e,n,i){Ra(t.x,e.x,n.x,i?i.originX:void 0),Ra(t.y,e.y,n.y,i?i.originY:void 0)}function Oa(t,e,n){t.min=n.min+e.min,t.max=t.min+lt(e)}function Xm(t,e,n){Oa(t.x,e.x,n.x),Oa(t.y,e.y,n.y)}function Va(t,e,n){t.min=e.min-n.min,t.max=t.min+lt(e)}function Yn(t,e,n){Va(t.x,e.x,n.x),Va(t.y,e.y,n.y)}function vt(t){return[t("x"),t("y")]}const Ia=({current:t})=>t?t.ownerDocument.defaultView:null,Na=(t,e)=>Math.abs(t-e);function Jm(t,e){const n=Na(t.x,e.x),i=Na(t.y,e.y);return Math.sqrt(n**2+i**2)}class _a{constructor(e,n,{transformPagePoint:i,contextWindow:r=window,dragSnapToOrigin:o=!1,distanceThreshold:s=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 d=wr(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,p=Jm(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!p)return;const{point:g}=d,{timestamp:b}=rt;this.history.push({...g,timestamp:b});const{onStart:y,onMove:w}=this.handlers;m||(y&&y(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,d)},this.handlePointerMove=(d,m)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=br(m,this.transformPagePoint),Y.update(this.updatePoint,!0)},this.handlePointerUp=(d,m)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=wr(d.type==="pointercancel"?this.lastMoveEventInfo:br(m,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,y),g&&g(d,y)},!tr(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=s,this.contextWindow=r||window;const a=nn(e),u=br(a,this.transformPagePoint),{point:c}=u,{timestamp:l}=rt;this.history=[{...c,timestamp:l}];const{onSessionStart:f}=n;f&&f(e,wr(u,this.history)),this.removeListeners=Ge(rn(this.contextWindow,"pointermove",this.handlePointerMove),rn(this.contextWindow,"pointerup",this.handlePointerUp),rn(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),$t(this.updatePoint)}}function br(t,e){return e?{point:e(t.point)}:t}function La(t,e){return{x:t.x-e.x,y:t.y-e.y}}function wr({point:t},e){return{point:t,delta:La(t,ja(e)),offset:La(t,Zm(e)),velocity:Qm(e,.1)}}function Zm(t){return t[0]}function ja(t){return t[t.length-1]}function Qm(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const r=ja(t);for(;n>=0&&(i=t[n],!(r.timestamp-i.timestamp>St(e)));)n--;if(!i)return{x:0,y:0};const o=yt(r.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const s={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function tp(t,{min:e,max:n},i){return e!==void 0&&t<e?t=i?G(e,t,i.min):Math.max(t,e):n!==void 0&&t>n&&(t=i?G(n,t,i.max):Math.min(t,n)),t}function Fa(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function ep(t,{top:e,left:n,bottom:i,right:r}){return{x:Fa(t.x,n,r),y:Fa(t.y,e,i)}}function $a(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}function np(t,e){return{x:$a(t.x,e.x),y:$a(t.y,e.y)}}function ip(t,e){let n=.5;const i=lt(t),r=lt(e);return r>i?n=He(e.min,e.max-i,t.min):i>r&&(n=He(t.min,t.max-r,e.min)),Vt(0,1,n)}function rp(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Tr=.35;function sp(t=Tr){return t===!1?t=0:t===!0&&(t=Tr),{x:Ba(t,"left","right"),y:Ba(t,"top","bottom")}}function Ba(t,e,n){return{min:Wa(t,e),max:Wa(t,n)}}function Wa(t,e){return typeof t=="number"?t:t[e]||0}const op=new WeakMap;class ap{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=et(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=f=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(nn(f).point)},s=(f,d)=>{const{drag:m,dragPropagation:p,onDragStart:g}=this.getProps();if(m&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=xh(m),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),vt(y=>{let w=this.getAxisMotionValue(y).get()||0;if(Dt.test(w)){const{projection:x}=this.visualElement;if(x&&x.layout){const C=x.layout.layoutBox[y];C&&(w=lt(C)*(parseFloat(w)/100))}}this.originPoint[y]=w}),g&&Y.postRender(()=>g(f,d)),yr(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d;const{dragPropagation:m,dragDirectionLock:p,onDirectionLock:g,onDrag:b}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:y}=d;if(p&&this.currentDirection===null){this.currentDirection=up(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",d.point,y),this.updateAxis("y",d.point,y),this.visualElement.render(),b&&b(f,d)},u=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d,this.stop(f,d),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>vt(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:l}=this.getProps();this.panSession=new _a(e,{onSessionStart:o,onStart:s,onMove:a,onSessionEnd:u,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:i,contextWindow:Ia(this.visualElement)})}stop(e,n){const i=e||this.latestPointerEvent,r=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!r||!i)return;const{velocity:s}=r;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&Y.postRender(()=>a(i,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,i){const{drag:r}=this.getProps();if(!i||!Gn(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let s=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(s=tp(s,this.constraints[e],this.elastic[e])),o.set(s)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Te(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=ep(i.layoutBox,e):this.constraints=!1,this.elastic=sp(n),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&vt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=rp(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Te(e))return!1;const i=e.current;It(i!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=cm(i,r.root,this.visualElement.getTransformPagePoint());let s=np(r.layout.layoutBox,o);if(n){const a=n(om(s));this.hasMutatedConstraints=!!a,a&&(s=aa(a))}return s}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),u=this.constraints||{},c=vt(l=>{if(!Gn(l,n,this.currentDirection))return;let f=u&&u[l]||{};s&&(f={min:0,max:0});const d=r?200:1e6,m=r?40:1e7,p={type:"inertia",velocity:i?e[l]:0,bounceStiffness:d,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(l,p)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return yr(this.visualElement,e),i.start(vr(e,i,0,n,this.visualElement,!1))}stopAnimation(){vt(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){vt(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){vt(n=>{const{drag:i}=this.getProps();if(!Gn(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(n);if(r&&r.layout){const{min:s,max:a}=r.layout.layoutBox[n];o.set(e[n]-G(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Te(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};vt(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const u=a.get();r[s]=ip({min:u,max:u},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),vt(s=>{if(!Gn(s,e,null))return;const a=this.getAxisMotionValue(s),{min:u,max:c}=this.constraints[s];a.set(G(u,c,r[s]))})}addListeners(){if(!this.visualElement.current)return;op.set(this.visualElement,this);const e=this.visualElement.current,n=rn(e,"pointerdown",u=>{const{drag:c,dragListener:l=!0}=this.getProps();c&&l&&this.start(u)}),i=()=>{const{dragConstraints:u}=this.getProps();Te(u)&&u.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Y.read(i);const s=en(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:c})=>{this.isDragging&&c&&(vt(l=>{const f=this.getAxisMotionValue(l);f&&(this.originPoint[l]+=u[l].translate,f.set(f.get()+u[l].translate))}),this.visualElement.render())}));return()=>{s(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:s=Tr,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function Gn(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function up(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class cp extends Ut{constructor(e){super(e),this.removeGroupControls=gt,this.removeListeners=gt,this.controls=new ap(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||gt}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ua=t=>(e,n)=>{t&&Y.postRender(()=>t(e,n))};class lp extends Ut{constructor(){super(...arguments),this.removePointerDownListener=gt}onPointerDown(e){this.session=new _a(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ia(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:Ua(e),onStart:Ua(n),onMove:i,onEnd:(o,s)=>{delete this.session,r&&Y.postRender(()=>r(o,s))}}}mount(){this.removePointerDownListener=rn(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Hn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Sr=!1;class fp extends M.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:o}=e;o&&(n.group&&n.group.add(o),i&&i.register&&r&&i.register(o),Sr&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Hn.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:r,isPresent:o}=this.props,{projection:s}=i;return s&&(s.isPresent=o,Sr=!0,r||e.layoutDependency!==n||n===void 0||e.isPresent!==o?s.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?s.promote():s.relegate()||Y.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Qi.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=e;Sr=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Ya(t){const[e,n]=Ah(),i=M.useContext(ks);return P.jsx(fp,{...t,layoutGroup:i,switchLayoutGroup:M.useContext(sa),isPresent:e,safeToRemove:n})}function dp(t,e,n){const i=st(t)?t:be(t);return i.start(vr("",i,e,n)),i.animation}const hp=(t,e)=>t.depth-e.depth;class mp{constructor(){this.children=[],this.isDirty=!1}add(e){gi(this.children,e),this.isDirty=!0}remove(e){yi(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(hp),this.isDirty=!1,this.children.forEach(e)}}function pp(t,e){const n=ht.now(),i=({timestamp:r})=>{const o=r-n;o>=e&&($t(i),t(o-e))};return Y.setup(i,!0),()=>$t(i)}const Ga=["TopLeft","TopRight","BottomLeft","BottomRight"],gp=Ga.length,Ha=t=>typeof t=="string"?parseFloat(t):t,Ka=t=>typeof t=="number"||D.test(t);function yp(t,e,n,i,r,o){r?(t.opacity=G(0,n.opacity??1,vp(i)),t.opacityExit=G(e.opacity??1,0,xp(i))):o&&(t.opacity=G(e.opacity??1,n.opacity??1,i));for(let s=0;s<gp;s++){const a=`border${Ga[s]}Radius`;let u=qa(e,a),c=qa(n,a);if(u===void 0&&c===void 0)continue;u||(u=0),c||(c=0),u===0||c===0||Ka(u)===Ka(c)?(t[a]=Math.max(G(Ha(u),Ha(c),i),0),(Dt.test(c)||Dt.test(u))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=G(e.rotate||0,n.rotate||0,i))}function qa(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const vp=za(0,.5,Ws),xp=za(.5,.95,gt);function za(t,e,n){return i=>i<t?0:i>e?1:n(He(t,e,i))}function Xa(t,e){t.min=e.min,t.max=e.max}function Mt(t,e){Xa(t.x,e.x),Xa(t.y,e.y)}function Ja(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Za(t,e,n,i,r){return t-=e,t=Un(t,1/n,i),r!==void 0&&(t=Un(t,1/r,i)),t}function bp(t,e=0,n=1,i=.5,r,o=t,s=t){if(Dt.test(e)&&(e=parseFloat(e),e=G(s.min,s.max,e/100)-s.min),typeof e!="number")return;let a=G(o.min,o.max,i);t===o&&(a-=e),t.min=Za(t.min,e,n,a,r),t.max=Za(t.max,e,n,a,r)}function Qa(t,e,[n,i,r],o,s){bp(t,e[n],e[i],e[r],e.scale,o,s)}const wp=["x","scaleX","originX"],Tp=["y","scaleY","originY"];function tu(t,e,n,i){Qa(t.x,e,wp,n?n.x:void 0,i?i.x:void 0),Qa(t.y,e,Tp,n?n.y:void 0,i?i.y:void 0)}function eu(t){return t.translate===0&&t.scale===1}function nu(t){return eu(t.x)&&eu(t.y)}function iu(t,e){return t.min===e.min&&t.max===e.max}function Sp(t,e){return iu(t.x,e.x)&&iu(t.y,e.y)}function ru(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function su(t,e){return ru(t.x,e.x)&&ru(t.y,e.y)}function ou(t){return lt(t.x)/lt(t.y)}function au(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Ep{constructor(){this.members=[]}add(e){gi(this.members,e),e.scheduleRender()}remove(e){if(yi(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(r=>e===r);if(n===0)return!1;let i;for(let r=n;r>=0;r--){const o=this.members[r];if(o.isPresent!==!1){i=o;break}}return i?(this.promote(i),!0):!1}promote(e,n){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,n&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:i}=e;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Mp(t,e,n){let i="";const r=t.x.translate/e.x,o=t.y.translate/e.y,s=n?.z||0;if((r||o||s)&&(i=`translate3d(${r}px, ${o}px, ${s}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:l,rotateX:f,rotateY:d,skewX:m,skewY:p}=n;c&&(i=`perspective(${c}px) ${i}`),l&&(i+=`rotate(${l}deg) `),f&&(i+=`rotateX(${f}deg) `),d&&(i+=`rotateY(${d}deg) `),m&&(i+=`skewX(${m}deg) `),p&&(i+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,u=t.y.scale*e.y;return(a!==1||u!==1)&&(i+=`scale(${a}, ${u})`),i||"none"}const Er=["","X","Y","Z"],Cp=1e3;let Pp=0;function Mr(t,e,n,i){const{latestValues:r}=e;r[t]&&(n[t]=r[t],e.setStaticValue(t,0),i&&(i[t]=0))}function uu(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Sa(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Y,!(r||o))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&uu(i)}function cu({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(s={},a=e?.()){this.id=Pp++,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.layoutVersion=0,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(kp),this.nodes.forEach(Ip),this.nodes.forEach(Np),this.nodes.forEach(Rp)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new mp)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new bi),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const u=this.eventHandlers.get(s);u&&u.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=Wo(s)&&!Mh(s),this.instance=s;const{layoutId:a,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||a)&&(this.isLayoutDirty=!0),t){let l,f=0;const d=()=>this.root.updateBlockedByResize=!1;Y.read(()=>{f=window.innerWidth}),t(s,()=>{const m=window.innerWidth;m!==f&&(f=m,this.root.updateBlockedByResize=!0,l&&l(),l=pp(d,250),Hn.hasAnimatedSinceResize&&(Hn.hasAnimatedSinceResize=!1,this.nodes.forEach(du)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||u)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||c.getDefaultTransition()||$p,{onLayoutAnimationStart:g,onLayoutAnimationComplete:b}=c.getProps(),y=!this.targetLayout||!su(this.targetLayout,m),w=!f&&d;if(this.options.layoutRoot||this.resumeFrom||w||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...Xi(p,"layout"),onPlay:g,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(l,w)}else f||du(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),$t(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(_p),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&uu(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){const f=this.path[l];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:u}=this.options;if(a===void 0&&!u)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(lu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(fu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Vp),this.nodes.forEach(Ap),this.nodes.forEach(Dp)):this.nodes.forEach(fu),this.clearAllSnapshots();const a=ht.now();rt.delta=Vt(0,1e3/60,a-rt.timestamp),rt.timestamp=a,rt.isProcessing=!0,Ei.update.process(rt),Ei.preRender.process(rt),Ei.render.process(rt),rt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Qi.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Op),this.sharedNodes.forEach(Lp)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Y.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Y.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!lt(this.snapshot.measuredBox.x)&&!lt(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 u=0;u<this.path.length;u++)this.path[u].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=et(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const u=i(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!r)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!nu(this.projectionDelta),u=this.getTransformTemplate(),c=u?u(this.latestValues,""):void 0,l=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||oe(this.latestValues)||l)&&(r(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let u=this.removeElementScroll(a);return s&&(u=this.removeTransform(u)),Bp(u),{animationId:this.root.animationId,measuredBox:a,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return et();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Wp))){const{scroll:c}=this.root;c&&(Se(a.x,c.offset.x),Se(a.y,c.offset.y))}return a}removeElementScroll(s){const a=et();if(Mt(a,s),this.scroll?.wasRoot)return a;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:l,options:f}=c;c!==this.root&&l&&f.layoutScroll&&(l.wasRoot&&Mt(a,s),Se(a.x,l.offset.x),Se(a.y,l.offset.y))}return a}applyTransform(s,a=!1){const u=et();Mt(u,s);for(let c=0;c<this.path.length;c++){const l=this.path[c];!a&&l.options.layoutScroll&&l.scroll&&l!==l.root&&Ee(u,{x:-l.scroll.offset.x,y:-l.scroll.offset.y}),oe(l.latestValues)&&Ee(u,l.latestValues)}return oe(this.latestValues)&&Ee(u,this.latestValues),u}removeTransform(s){const a=et();Mt(a,s);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!c.instance||!oe(c.latestValues))continue;hr(c.latestValues)&&c.updateSnapshot();const l=et(),f=c.measurePageBox();Mt(l,f),tu(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,l)}return oe(this.latestValues)&&tu(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.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!==rt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==a;if(!(s||u&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:l,layoutId:f}=this.options;if(!this.layout||!(l||f))return;this.resolvedRelativeTargetAt=rt.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=et(),this.targetWithTransforms=et()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Xm(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Mt(this.target,this.layout.layoutBox),fa(this.target,this.targetDelta)):Mt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||hr(this.parent.latestValues)||ua(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,a,u){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=et(),this.relativeTargetOrigin=et(),Yn(this.relativeTargetOrigin,a,u),Mt(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const s=this.getLead(),a=!!this.resumingFrom||this!==s;let u=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(u=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===rt.timestamp&&(u=!1),u)return;const{layout:c,layoutId:l}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||l))return;Mt(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;um(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=et());const{target:m}=s;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ja(this.prevProjectionDelta.x,this.projectionDelta.x),Ja(this.prevProjectionDelta.y,this.projectionDelta.y)),sn(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!au(this.projectionDelta.x,this.prevProjectionDelta.x)||!au(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Me(),this.projectionDelta=Me(),this.projectionDeltaWithTransform=Me()}setAnimationOrigin(s,a=!1){const u=this.snapshot,c=u?u.latestValues:{},l={...this.latestValues},f=Me();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=et(),m=u?u.source:void 0,p=this.layout?this.layout.source:void 0,g=m!==p,b=this.getStack(),y=!b||b.members.length<=1,w=!!(g&&!y&&this.options.crossfade===!0&&!this.path.some(Fp));this.animationProgress=0;let x;this.mixTargetDelta=C=>{const S=C/1e3;hu(f.x,s.x,S),hu(f.y,s.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Yn(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),jp(this.relativeTarget,this.relativeTargetOrigin,d,S),x&&Sp(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=et()),Mt(x,this.relativeTarget)),g&&(this.animationValues=l,yp(l,c,this.latestValues,S,w,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&($t(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Y.update(()=>{Hn.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=be(0)),this.currentAnimation=dp(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Cp),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:u,layout:c,latestValues:l}=s;if(!(!a||!u||!c)){if(this!==s&&this.layout&&c&&vu(this.options.animationType,this.layout.layoutBox,c.layoutBox)){u=this.target||et();const f=lt(this.layout.layoutBox.x);u.x.min=s.target.x.min,u.x.max=u.x.min+f;const d=lt(this.layout.layoutBox.y);u.y.min=s.target.y.min,u.y.max=u.y.min+d}Mt(a,u),Ee(a,l),sn(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Ep),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:u}={}){const c=this.getStack();c&&c.promote(this,u),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:u}=s;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(a=!0),!a)return;const c={};u.z&&Mr("z",s,c,this.animationValues);for(let l=0;l<Er.length;l++)Mr(`rotate${Er[l]}`,s,c,this.animationValues),Mr(`skew${Er[l]}`,s,c,this.animationValues);s.render();for(const l in c)s.setStaticValue(l,c[l]),this.animationValues&&(this.animationValues[l]=c[l]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=Wn(a?.pointerEvents)||"",s.transform=u?u(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=Wn(a?.pointerEvents)||""),this.hasProjected&&!oe(this.latestValues)&&(s.transform=u?u({},""):"none",this.hasProjected=!1);return}s.visibility="";const l=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=Mp(this.projectionDeltaWithTransform,this.treeScale,l);u&&(f=u(l,f)),s.transform=f;const{x:d,y:m}=this.projectionDelta;s.transformOrigin=`${d.origin*100}% ${m.origin*100}% 0`,c.animationValues?s.opacity=c===this?l.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:s.opacity=c===this?l.opacity!==void 0?l.opacity:"":l.opacityExit!==void 0?l.opacityExit:0;for(const p in rr){if(l[p]===void 0)continue;const{correct:g,applyTo:b,isCSSVariable:y}=rr[p],w=f==="none"?l[p]:g(l[p],c);if(b){const x=b.length;for(let C=0;C<x;C++)s[b[C]]=w}else y?this.options.visualElement.renderState.vars[p]=w:s[p]=w}this.options.layoutId&&(s.pointerEvents=c===this?Wn(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(lu),this.root.sharedNodes.clear()}}}function Ap(t){t.updateLayout()}function Dp(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:r}=t.options,o=e.source!==t.layout.source;r==="size"?vt(l=>{const f=o?e.measuredBox[l]:e.layoutBox[l],d=lt(f);f.min=n[l].min,f.max=f.min+d}):vu(r,e.layoutBox,n)&&vt(l=>{const f=o?e.measuredBox[l]:e.layoutBox[l],d=lt(n[l]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[l].max=t.relativeTarget[l].min+d)});const s=Me();sn(s,n,e.layoutBox);const a=Me();o?sn(a,t.applyTransform(i,!0),e.measuredBox):sn(a,n,e.layoutBox);const u=!nu(s);let c=!1;if(!t.resumeFrom){const l=t.getClosestProjectingParent();if(l&&!l.resumeFrom){const{snapshot:f,layout:d}=l;if(f&&d){const m=et();Yn(m,e.layoutBox,f.layoutBox);const p=et();Yn(p,n,d.layoutBox),su(m,p)||(c=!0),l.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=m,t.relativeParent=l)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:s,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function kp(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Rp(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Op(t){t.clearSnapshot()}function lu(t){t.clearMeasurements()}function fu(t){t.isLayoutDirty=!1}function Vp(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function du(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Ip(t){t.resolveTargetDelta()}function Np(t){t.calcProjection()}function _p(t){t.resetSkewAndRotation()}function Lp(t){t.removeLeadSnapshot()}function hu(t,e,n){t.translate=G(e.translate,0,n),t.scale=G(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function mu(t,e,n,i){t.min=G(e.min,n.min,i),t.max=G(e.max,n.max,i)}function jp(t,e,n,i){mu(t.x,e.x,n.x,i),mu(t.y,e.y,n.y,i)}function Fp(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const $p={duration:.45,ease:[.4,0,.1,1]},pu=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),gu=pu("applewebkit/")&&!pu("chrome/")?Math.round:gt;function yu(t){t.min=gu(t.min),t.max=gu(t.max)}function Bp(t){yu(t.x),yu(t.y)}function vu(t,e,n){return t==="position"||t==="preserve-aspect"&&!zm(ou(e),ou(n),.2)}function Wp(t){return t!==t.root&&t.scroll?.wasRoot}const Up=cu({attachResizeListener:(t,e)=>en(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Cr={current:void 0},xu=cu({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Cr.current){const t=new Up({});t.mount(window),t.setOptions({layoutScroll:!0}),Cr.current=t}return Cr.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Yp={pan:{Feature:lp},drag:{Feature:cp,ProjectionNode:xu,MeasureLayout:Ya}};function bu(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,o=i[r];o&&Y.postRender(()=>o(e,nn(e)))}class Gp extends Ut{mount(){const{current:e}=this.node;e&&(this.unmount=bh(e,(n,i)=>(bu(this.node,i,"Start"),r=>bu(this.node,r,"End"))))}unmount(){}}class Hp extends Ut{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=Ge(en(this.node.current,"focus",()=>this.onFocus()),en(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function wu(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),o=i[r];o&&Y.postRender(()=>o(e,nn(e)))}class Kp extends Ut{mount(){const{current:e}=this.node;e&&(this.unmount=Eh(e,(n,i)=>(wu(this.node,i,"Start"),(r,{success:o})=>wu(this.node,r,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Pr=new WeakMap,Ar=new WeakMap,qp=t=>{const e=Pr.get(t.target);e&&e(t)},zp=t=>{t.forEach(qp)};function Xp({root:t,...e}){const n=t||document;Ar.has(n)||Ar.set(n,{});const i=Ar.get(n),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(zp,{root:t,...e})),i[r]}function Jp(t,e,n){const i=Xp(e);return Pr.set(t,n),i.observe(t),()=>{Pr.delete(t),i.unobserve(t)}}const Zp={some:0,all:1};class Qp extends Ut{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:o}=e,s={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:Zp[r]},a=u=>{const{isIntersecting:c}=u;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:l,onViewportLeave:f}=this.node.getProps(),d=c?l:f;d&&d(u)};return Jp(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(tg(e,n))&&this.startObserver()}unmount(){}}function tg({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const eg={...Um,...{inView:{Feature:Qp},tap:{Feature:Kp},focus:{Feature:Hp},hover:{Feature:Gp}},...Yp,...{layout:{ProjectionNode:xu,MeasureLayout:Ya}}},ng=sm(eg,vm),ig=({x:t,y:e,width:n,height:i,data:r,onClick:o,onHover:s,isActive:a,isDimmed:u,style:c,...l})=>{const f=M.useMemo(()=>r.isPrediction?"#8e44ad":a?"#e74c3c":r.color||"#3498db",[r,a]);return P.jsx(ng.rect,{initial:{height:0,y:e+i,x:t},animate:{height:i,y:e,x:t},transition:{type:"spring",stiffness:300,damping:30},width:n,fill:f,rx:4,ry:4,className:"cursor-pointer hover:opacity-80",onClick:()=>o?.(r),onMouseEnter:()=>s?.(r),onMouseLeave:()=>s?.(null),style:{opacity:u?.3:r.isPrediction?.7:1,stroke:a?"#c0392b":"none",strokeWidth:a?2:0,...c},...l})};var Tu;(function(t){t.STRING="string",t.NUMBER="number",t.INTEGER="integer",t.BOOLEAN="boolean",t.ARRAY="array",t.OBJECT="object"})(Tu||(Tu={}));var Su;(function(t){t.LANGUAGE_UNSPECIFIED="language_unspecified",t.PYTHON="python"})(Su||(Su={}));var Eu;(function(t){t.OUTCOME_UNSPECIFIED="outcome_unspecified",t.OUTCOME_OK="outcome_ok",t.OUTCOME_FAILED="outcome_failed",t.OUTCOME_DEADLINE_EXCEEDED="outcome_deadline_exceeded"})(Eu||(Eu={}));const Mu=["user","model","function","system"];var Cu;(function(t){t.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",t.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",t.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",t.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",t.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",t.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY"})(Cu||(Cu={}));var Pu;(function(t){t.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE"})(Pu||(Pu={}));var Au;(function(t){t.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",t.NEGLIGIBLE="NEGLIGIBLE",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(Au||(Au={}));var Du;(function(t){t.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",t.SAFETY="SAFETY",t.OTHER="OTHER"})(Du||(Du={}));var on;(function(t){t.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",t.STOP="STOP",t.MAX_TOKENS="MAX_TOKENS",t.SAFETY="SAFETY",t.RECITATION="RECITATION",t.LANGUAGE="LANGUAGE",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.SPII="SPII",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t.OTHER="OTHER"})(on||(on={}));var ku;(function(t){t.TASK_TYPE_UNSPECIFIED="TASK_TYPE_UNSPECIFIED",t.RETRIEVAL_QUERY="RETRIEVAL_QUERY",t.RETRIEVAL_DOCUMENT="RETRIEVAL_DOCUMENT",t.SEMANTIC_SIMILARITY="SEMANTIC_SIMILARITY",t.CLASSIFICATION="CLASSIFICATION",t.CLUSTERING="CLUSTERING"})(ku||(ku={}));var Ru;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.AUTO="AUTO",t.ANY="ANY",t.NONE="NONE"})(Ru||(Ru={}));var Ou;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.MODE_DYNAMIC="MODE_DYNAMIC"})(Ou||(Ou={}));class ot extends Error{constructor(e){super(`[GoogleGenerativeAI Error]: ${e}`)}}class Pe extends ot{constructor(e,n){super(e),this.response=n}}class Vu extends ot{constructor(e,n,i,r){super(e),this.status=n,this.statusText=i,this.errorDetails=r}}class Yt extends ot{}class Iu extends ot{}const rg="https://generativelanguage.googleapis.com",sg="v1beta",og="0.24.1",ag="genai-js";var ue;(function(t){t.GENERATE_CONTENT="generateContent",t.STREAM_GENERATE_CONTENT="streamGenerateContent",t.COUNT_TOKENS="countTokens",t.EMBED_CONTENT="embedContent",t.BATCH_EMBED_CONTENTS="batchEmbedContents"})(ue||(ue={}));class ug{constructor(e,n,i,r,o){this.model=e,this.task=n,this.apiKey=i,this.stream=r,this.requestOptions=o}toString(){var e,n;const i=((e=this.requestOptions)===null||e===void 0?void 0:e.apiVersion)||sg;let o=`${((n=this.requestOptions)===null||n===void 0?void 0:n.baseUrl)||rg}/${i}/${this.model}:${this.task}`;return this.stream&&(o+="?alt=sse"),o}}function cg(t){const e=[];return t?.apiClient&&e.push(t.apiClient),e.push(`${ag}/${og}`),e.join(" ")}async function lg(t){var e;const n=new Headers;n.append("Content-Type","application/json"),n.append("x-goog-api-client",cg(t.requestOptions)),n.append("x-goog-api-key",t.apiKey);let i=(e=t.requestOptions)===null||e===void 0?void 0:e.customHeaders;if(i){if(!(i instanceof Headers))try{i=new Headers(i)}catch(r){throw new Yt(`unable to convert customHeaders value ${JSON.stringify(i)} to Headers: ${r.message}`)}for(const[r,o]of i.entries()){if(r==="x-goog-api-key")throw new Yt(`Cannot set reserved header name ${r}`);if(r==="x-goog-api-client")throw new Yt(`Header name ${r} can only be set using the apiClient field`);n.append(r,o)}}return n}async function fg(t,e,n,i,r,o){const s=new ug(t,e,n,i,o);return{url:s.toString(),fetchOptions:Object.assign(Object.assign({},pg(o)),{method:"POST",headers:await lg(s),body:r})}}async function an(t,e,n,i,r,o={},s=fetch){const{url:a,fetchOptions:u}=await fg(t,e,n,i,r,o);return dg(a,u,s)}async function dg(t,e,n=fetch){let i;try{i=await n(t,e)}catch(r){hg(r,t)}return i.ok||await mg(i,t),i}function hg(t,e){let n=t;throw n.name==="AbortError"?(n=new Iu(`Request aborted when fetching ${e.toString()}: ${t.message}`),n.stack=t.stack):t instanceof Vu||t instanceof Yt||(n=new ot(`Error fetching from ${e.toString()}: ${t.message}`),n.stack=t.stack),n}async function mg(t,e){let n="",i;try{const r=await t.json();n=r.error.message,r.error.details&&(n+=` ${JSON.stringify(r.error.details)}`,i=r.error.details)}catch{}throw new Vu(`Error fetching from ${e.toString()}: [${t.status} ${t.statusText}] ${n}`,t.status,t.statusText,i)}function pg(t){const e={};if(t?.signal!==void 0||t?.timeout>=0){const n=new AbortController;t?.timeout>=0&&setTimeout(()=>n.abort(),t.timeout),t?.signal&&t.signal.addEventListener("abort",()=>{n.abort()}),e.signal=n.signal}return e}function Dr(t){return t.text=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning text from the first candidate only. Access response.candidates directly to use the other candidates.`),Kn(t.candidates[0]))throw new Pe(`${Gt(t)}`,t);return gg(t)}else if(t.promptFeedback)throw new Pe(`Text not available. ${Gt(t)}`,t);return""},t.functionCall=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),Kn(t.candidates[0]))throw new Pe(`${Gt(t)}`,t);return console.warn("response.functionCall() is deprecated. Use response.functionCalls() instead."),Nu(t)[0]}else if(t.promptFeedback)throw new Pe(`Function call not available. ${Gt(t)}`,t)},t.functionCalls=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),Kn(t.candidates[0]))throw new Pe(`${Gt(t)}`,t);return Nu(t)}else if(t.promptFeedback)throw new Pe(`Function call not available. ${Gt(t)}`,t)},t}function gg(t){var e,n,i,r;const o=[];if(!((n=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||n===void 0)&&n.parts)for(const s of(r=(i=t.candidates)===null||i===void 0?void 0:i[0].content)===null||r===void 0?void 0:r.parts)s.text&&o.push(s.text),s.executableCode&&o.push("\n```"+s.executableCode.language+`
10
- `+s.executableCode.code+"\n```\n"),s.codeExecutionResult&&o.push("\n```\n"+s.codeExecutionResult.output+"\n```\n");return o.length>0?o.join(""):""}function Nu(t){var e,n,i,r;const o=[];if(!((n=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||n===void 0)&&n.parts)for(const s of(r=(i=t.candidates)===null||i===void 0?void 0:i[0].content)===null||r===void 0?void 0:r.parts)s.functionCall&&o.push(s.functionCall);if(o.length>0)return o}const yg=[on.RECITATION,on.SAFETY,on.LANGUAGE];function Kn(t){return!!t.finishReason&&yg.includes(t.finishReason)}function Gt(t){var e,n,i;let r="";if((!t.candidates||t.candidates.length===0)&&t.promptFeedback)r+="Response was blocked",!((e=t.promptFeedback)===null||e===void 0)&&e.blockReason&&(r+=` due to ${t.promptFeedback.blockReason}`),!((n=t.promptFeedback)===null||n===void 0)&&n.blockReasonMessage&&(r+=`: ${t.promptFeedback.blockReasonMessage}`);else if(!((i=t.candidates)===null||i===void 0)&&i[0]){const o=t.candidates[0];Kn(o)&&(r+=`Candidate was blocked due to ${o.finishReason}`,o.finishMessage&&(r+=`: ${o.finishMessage}`))}return r}function un(t){return this instanceof un?(this.v=t,this):new un(t)}function vg(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(t,e||[]),r,o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(d){i[d]&&(r[d]=function(m){return new Promise(function(p,g){o.push([d,m,p,g])>1||a(d,m)})})}function a(d,m){try{u(i[d](m))}catch(p){f(o[0][3],p)}}function u(d){d.value instanceof un?Promise.resolve(d.value.v).then(c,l):f(o[0][2],d)}function c(d){a("next",d)}function l(d){a("throw",d)}function f(d,m){d(m),o.shift(),o.length&&a(o[0][0],o[0][1])}}typeof SuppressedError=="function"&&SuppressedError;const _u=/^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/;function xg(t){const e=t.body.pipeThrough(new TextDecoderStream("utf8",{fatal:!0})),n=Tg(e),[i,r]=n.tee();return{stream:wg(i),response:bg(r)}}async function bg(t){const e=[],n=t.getReader();for(;;){const{done:i,value:r}=await n.read();if(i)return Dr(Sg(e));e.push(r)}}function wg(t){return vg(this,arguments,function*(){const n=t.getReader();for(;;){const{value:i,done:r}=yield un(n.read());if(r)break;yield yield un(Dr(i))}})}function Tg(t){const e=t.getReader();return new ReadableStream({start(i){let r="";return o();function o(){return e.read().then(({value:s,done:a})=>{if(a){if(r.trim()){i.error(new ot("Failed to parse stream"));return}i.close();return}r+=s;let u=r.match(_u),c;for(;u;){try{c=JSON.parse(u[1])}catch{i.error(new ot(`Error parsing JSON response: "${u[1]}"`));return}i.enqueue(c),r=r.substring(u[0].length),u=r.match(_u)}return o()}).catch(s=>{let a=s;throw a.stack=s.stack,a.name==="AbortError"?a=new Iu("Request aborted when reading from the stream"):a=new ot("Error reading from the stream"),a})}}})}function Sg(t){const e=t[t.length-1],n={promptFeedback:e?.promptFeedback};for(const i of t){if(i.candidates){let r=0;for(const o of i.candidates)if(n.candidates||(n.candidates=[]),n.candidates[r]||(n.candidates[r]={index:r}),n.candidates[r].citationMetadata=o.citationMetadata,n.candidates[r].groundingMetadata=o.groundingMetadata,n.candidates[r].finishReason=o.finishReason,n.candidates[r].finishMessage=o.finishMessage,n.candidates[r].safetyRatings=o.safetyRatings,o.content&&o.content.parts){n.candidates[r].content||(n.candidates[r].content={role:o.content.role||"user",parts:[]});const s={};for(const a of o.content.parts)a.text&&(s.text=a.text),a.functionCall&&(s.functionCall=a.functionCall),a.executableCode&&(s.executableCode=a.executableCode),a.codeExecutionResult&&(s.codeExecutionResult=a.codeExecutionResult),Object.keys(s).length===0&&(s.text=""),n.candidates[r].content.parts.push(s)}r++}i.usageMetadata&&(n.usageMetadata=i.usageMetadata)}return n}async function Lu(t,e,n,i){const r=await an(e,ue.STREAM_GENERATE_CONTENT,t,!0,JSON.stringify(n),i);return xg(r)}async function ju(t,e,n,i){const o=await(await an(e,ue.GENERATE_CONTENT,t,!1,JSON.stringify(n),i)).json();return{response:Dr(o)}}function Fu(t){if(t!=null){if(typeof t=="string")return{role:"system",parts:[{text:t}]};if(t.text)return{role:"system",parts:[t]};if(t.parts)return t.role?t:{role:"system",parts:t.parts}}}function cn(t){let e=[];if(typeof t=="string")e=[{text:t}];else for(const n of t)typeof n=="string"?e.push({text:n}):e.push(n);return Eg(e)}function Eg(t){const e={role:"user",parts:[]},n={role:"function",parts:[]};let i=!1,r=!1;for(const o of t)"functionResponse"in o?(n.parts.push(o),r=!0):(e.parts.push(o),i=!0);if(i&&r)throw new ot("Within a single message, FunctionResponse cannot be mixed with other type of part in the request for sending chat message.");if(!i&&!r)throw new ot("No content is provided for sending chat message.");return i?e:n}function Mg(t,e){var n;let i={model:e?.model,generationConfig:e?.generationConfig,safetySettings:e?.safetySettings,tools:e?.tools,toolConfig:e?.toolConfig,systemInstruction:e?.systemInstruction,cachedContent:(n=e?.cachedContent)===null||n===void 0?void 0:n.name,contents:[]};const r=t.generateContentRequest!=null;if(t.contents){if(r)throw new Yt("CountTokensRequest must have one of contents or generateContentRequest, not both.");i.contents=t.contents}else if(r)i=Object.assign(Object.assign({},i),t.generateContentRequest);else{const o=cn(t);i.contents=[o]}return{generateContentRequest:i}}function $u(t){let e;return t.contents?e=t:e={contents:[cn(t)]},t.systemInstruction&&(e.systemInstruction=Fu(t.systemInstruction)),e}function Cg(t){return typeof t=="string"||Array.isArray(t)?{content:cn(t)}:t}const Bu=["text","inlineData","functionCall","functionResponse","executableCode","codeExecutionResult"],Pg={user:["text","inlineData"],function:["functionResponse"],model:["text","functionCall","executableCode","codeExecutionResult"],system:["text"]};function Ag(t){let e=!1;for(const n of t){const{role:i,parts:r}=n;if(!e&&i!=="user")throw new ot(`First content should be with role 'user', got ${i}`);if(!Mu.includes(i))throw new ot(`Each item should include role field. Got ${i} but valid roles are: ${JSON.stringify(Mu)}`);if(!Array.isArray(r))throw new ot("Content should have 'parts' property with an array of Parts");if(r.length===0)throw new ot("Each Content should have at least one part");const o={text:0,inlineData:0,functionCall:0,functionResponse:0,fileData:0,executableCode:0,codeExecutionResult:0};for(const a of r)for(const u of Bu)u in a&&(o[u]+=1);const s=Pg[i];for(const a of Bu)if(!s.includes(a)&&o[a]>0)throw new ot(`Content with role '${i}' can't contain '${a}' part`);e=!0}}function Wu(t){var e;if(t.candidates===void 0||t.candidates.length===0)return!1;const n=(e=t.candidates[0])===null||e===void 0?void 0:e.content;if(n===void 0||n.parts===void 0||n.parts.length===0)return!1;for(const i of n.parts)if(i===void 0||Object.keys(i).length===0||i.text!==void 0&&i.text==="")return!1;return!0}const Uu="SILENT_ERROR";class Dg{constructor(e,n,i,r={}){this.model=n,this.params=i,this._requestOptions=r,this._history=[],this._sendPromise=Promise.resolve(),this._apiKey=e,i?.history&&(Ag(i.history),this._history=i.history)}async getHistory(){return await this._sendPromise,this._history}async sendMessage(e,n={}){var i,r,o,s,a,u;await this._sendPromise;const c=cn(e),l={safetySettings:(i=this.params)===null||i===void 0?void 0:i.safetySettings,generationConfig:(r=this.params)===null||r===void 0?void 0:r.generationConfig,tools:(o=this.params)===null||o===void 0?void 0:o.tools,toolConfig:(s=this.params)===null||s===void 0?void 0:s.toolConfig,systemInstruction:(a=this.params)===null||a===void 0?void 0:a.systemInstruction,cachedContent:(u=this.params)===null||u===void 0?void 0:u.cachedContent,contents:[...this._history,c]},f=Object.assign(Object.assign({},this._requestOptions),n);let d;return this._sendPromise=this._sendPromise.then(()=>ju(this._apiKey,this.model,l,f)).then(m=>{var p;if(Wu(m.response)){this._history.push(c);const g=Object.assign({parts:[],role:"model"},(p=m.response.candidates)===null||p===void 0?void 0:p[0].content);this._history.push(g)}else{const g=Gt(m.response);g&&console.warn(`sendMessage() was unsuccessful. ${g}. Inspect response object for details.`)}d=m}).catch(m=>{throw this._sendPromise=Promise.resolve(),m}),await this._sendPromise,d}async sendMessageStream(e,n={}){var i,r,o,s,a,u;await this._sendPromise;const c=cn(e),l={safetySettings:(i=this.params)===null||i===void 0?void 0:i.safetySettings,generationConfig:(r=this.params)===null||r===void 0?void 0:r.generationConfig,tools:(o=this.params)===null||o===void 0?void 0:o.tools,toolConfig:(s=this.params)===null||s===void 0?void 0:s.toolConfig,systemInstruction:(a=this.params)===null||a===void 0?void 0:a.systemInstruction,cachedContent:(u=this.params)===null||u===void 0?void 0:u.cachedContent,contents:[...this._history,c]},f=Object.assign(Object.assign({},this._requestOptions),n),d=Lu(this._apiKey,this.model,l,f);return this._sendPromise=this._sendPromise.then(()=>d).catch(m=>{throw new Error(Uu)}).then(m=>m.response).then(m=>{if(Wu(m)){this._history.push(c);const p=Object.assign({},m.candidates[0].content);p.role||(p.role="model"),this._history.push(p)}else{const p=Gt(m);p&&console.warn(`sendMessageStream() was unsuccessful. ${p}. Inspect response object for details.`)}}).catch(m=>{m.message!==Uu&&console.error(m)}),d}}async function kg(t,e,n,i){return(await an(e,ue.COUNT_TOKENS,t,!1,JSON.stringify(n),i)).json()}async function Rg(t,e,n,i){return(await an(e,ue.EMBED_CONTENT,t,!1,JSON.stringify(n),i)).json()}async function Og(t,e,n,i){const r=n.requests.map(s=>Object.assign(Object.assign({},s),{model:e}));return(await an(e,ue.BATCH_EMBED_CONTENTS,t,!1,JSON.stringify({requests:r}),i)).json()}class Yu{constructor(e,n,i={}){this.apiKey=e,this._requestOptions=i,n.model.includes("/")?this.model=n.model:this.model=`models/${n.model}`,this.generationConfig=n.generationConfig||{},this.safetySettings=n.safetySettings||[],this.tools=n.tools,this.toolConfig=n.toolConfig,this.systemInstruction=Fu(n.systemInstruction),this.cachedContent=n.cachedContent}async generateContent(e,n={}){var i;const r=$u(e),o=Object.assign(Object.assign({},this._requestOptions),n);return ju(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(i=this.cachedContent)===null||i===void 0?void 0:i.name},r),o)}async generateContentStream(e,n={}){var i;const r=$u(e),o=Object.assign(Object.assign({},this._requestOptions),n);return Lu(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(i=this.cachedContent)===null||i===void 0?void 0:i.name},r),o)}startChat(e){var n;return new Dg(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(n=this.cachedContent)===null||n===void 0?void 0:n.name},e),this._requestOptions)}async countTokens(e,n={}){const i=Mg(e,{model:this.model,generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:this.cachedContent}),r=Object.assign(Object.assign({},this._requestOptions),n);return kg(this.apiKey,this.model,i,r)}async embedContent(e,n={}){const i=Cg(e),r=Object.assign(Object.assign({},this._requestOptions),n);return Rg(this.apiKey,this.model,i,r)}async batchEmbedContents(e,n={}){const i=Object.assign(Object.assign({},this._requestOptions),n);return Og(this.apiKey,this.model,e,i)}}class Vg{constructor(e){this.apiKey=e}getGenerativeModel(e,n){if(!e.model)throw new ot("Must provide a model name. Example: genai.getGenerativeModel({ model: 'my-model-name' })");return new Yu(this.apiKey,e,n)}getGenerativeModelFromCachedContent(e,n,i){if(!e.name)throw new Yt("Cached content must contain a `name` field.");if(!e.model)throw new Yt("Cached content must contain a `model` field.");const r=["model","systemInstruction"];for(const s of r)if(n?.[s]&&e[s]&&n?.[s]!==e[s]){if(s==="model"){const a=n.model.startsWith("models/")?n.model.replace("models/",""):n.model,u=e.model.startsWith("models/")?e.model.replace("models/",""):e.model;if(a===u)continue}throw new Yt(`Different value for "${s}" specified in modelParams (${n[s]}) and cachedContent (${e[s]})`)}const o=Object.assign(Object.assign({},n),{model:e.model,tools:e.tools,toolConfig:e.toolConfig,systemInstruction:e.systemInstruction,cachedContent:e});return new Yu(this.apiKey,o,i)}}class Ig{genAI;model;constructor(e,n="gemini-1.5-flash"){this.genAI=new Vg(e),this.model=this.genAI.getGenerativeModel({model:n})}async predictNext(e,n=3,i="month"){if(e.length===0)return[];const r=`
9
+ Check the top-level render call using <`+M+">.")}return b}}function ye(h,b){{if(!h._store||h._store.validated||h.key!=null)return;h._store.validated=!0;var M=Ht(b);if(Be[M])return;Be[M]=!0;var O="";h&&h._owner&&h._owner!==Ct.current&&(O=" It was passed a child from "+j(h._owner.type)+"."),Pt(h),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',M,O),Pt(null)}}function We(h,b){{if(typeof h!="object")return;if(En(h))for(var M=0;M<h.length;M++){var O=h[M];ee(O)&&ye(O,b)}else if(ee(h))h._store&&(h._store.validated=!0);else if(h){var F=x(h);if(typeof F=="function"&&F!==h.entries)for(var H=F.call(h),N;!(N=H.next()).done;)ee(N.value)&&ye(N.value,b)}}}function Gt(h){{var b=h.type;if(b==null||typeof b=="string")return;var M;if(typeof b=="function")M=b.propTypes;else if(typeof b=="object"&&(b.$$typeof===u||b.$$typeof===f))M=b.propTypes;else return;if(M){var O=j(b);Tn(M,h.props,"prop",O,h)}else if(b.PropTypes!==void 0&&!Yt){Yt=!0;var F=j(b);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",F||"Unknown")}typeof b.getDefaultProps=="function"&&!b.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ne(h){{for(var b=Object.keys(h.props),M=0;M<b.length;M++){var O=b[M];if(O!=="children"&&O!=="key"){Pt(h),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",O),Pt(null);break}}h.ref!==null&&(Pt(h),v("Invalid attribute `ref` supplied to `React.Fragment`."),Pt(null))}}function ie(h,b,M,O,F,H){{var N=Z(h);if(!N){var I="";(h===void 0||typeof h=="object"&&h!==null&&Object.keys(h).length===0)&&(I+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ht=$e();ht?I+=ht:I+=ge();var tt;h===null?tt="null":En(h)?tt="array":h!==void 0&&h.$$typeof===e?(tt="<"+(j(h.type)||"Unknown")+" />",I=" Did you accidentally export a JSX literal instead of a component?"):tt=typeof h,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",tt,I)}var nt=Ut(h,b,M,F,H);if(nt==null)return nt;if(N){var At=b.children;if(At!==void 0)if(O)if(En(At)){for(var Ye=0;Ye<At.length;Ye++)We(At[Ye],h);Object.freeze&&Object.freeze(At)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else We(At,h)}return h===i?ne(nt):Gt(nt),nt}}function re(h,b,M){return ie(h,b,M,!0)}function ve(h,b,M){return ie(h,b,M,!1)}var xe=ve,Ue=re;Ge.Fragment=i,Ge.jsx=xe,Ge.jsxs=Ue})()),Ge}var zr;function uc(){return zr||(zr=1,process.env.NODE_ENV==="production"?Pn.exports=oc():Pn.exports=ac()),Pn.exports}var P=uc();function An(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function cc(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Xr(t){let e,n,i;t.length!==2?(e=An,n=(a,u)=>An(t(a),u),i=(a,u)=>t(a)-u):(e=t===An||t===cc?t:lc,n=t,i=t);function r(a,u,c=0,l=a.length){if(c<l){if(e(u,u)!==0)return l;do{const f=c+l>>>1;n(a[f],u)<0?c=f+1:l=f}while(c<l)}return c}function o(a,u,c=0,l=a.length){if(c<l){if(e(u,u)!==0)return l;do{const f=c+l>>>1;n(a[f],u)<=0?c=f+1:l=f}while(c<l)}return c}function s(a,u,c=0,l=a.length){const f=r(a,u,c,l-1);return f>c&&i(a[f-1],u)>-i(a[f],u)?f-1:f}return{left:r,center:s,right:o}}function lc(){return 0}function fc(t){return t===null?NaN:+t}const dc=Xr(An).right;Xr(fc).center;class Jr extends Map{constructor(e,n=pc){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[i,r]of e)this.set(i,r)}get(e){return super.get(Zr(this,e))}has(e){return super.has(Zr(this,e))}set(e,n){return super.set(hc(this,e),n)}delete(e){return super.delete(mc(this,e))}}function Zr({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function hc({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}function mc({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t.delete(i)),n}function pc(t){return t!==null&&typeof t=="object"?t.valueOf():t}const gc=Math.sqrt(50),yc=Math.sqrt(10),vc=Math.sqrt(2);function Dn(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),s=o>=gc?10:o>=yc?5:o>=vc?2:1;let a,u,c;return r<0?(c=Math.pow(10,-r)/s,a=Math.round(t*c),u=Math.round(e*c),a/c<t&&++a,u/c>e&&--u,c=-c):(c=Math.pow(10,r)*s,a=Math.round(t/c),u=Math.round(e/c),a*c<t&&++a,u*c>e&&--u),u<a&&.5<=n&&n<2?Dn(t,e,n*2):[a,u,c]}function xc(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const i=e<t,[r,o,s]=i?Dn(e,t,n):Dn(t,e,n);if(!(o>=r))return[];const a=o-r+1,u=new Array(a);if(i)if(s<0)for(let c=0;c<a;++c)u[c]=(o-c)/-s;else for(let c=0;c<a;++c)u[c]=(o-c)*s;else if(s<0)for(let c=0;c<a;++c)u[c]=(r+c)/-s;else for(let c=0;c<a;++c)u[c]=(r+c)*s;return u}function mi(t,e,n){return e=+e,t=+t,n=+n,Dn(t,e,n)[2]}function bc(t,e,n){e=+e,t=+t,n=+n;const i=e<t,r=i?mi(e,t,n):mi(t,e,n);return(i?-1:1)*(r<0?1/-r:r)}function wc(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(r);++i<r;)o[i]=t+i*n;return o}function pi(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const Qr=Symbol("implicit");function ts(){var t=new Jr,e=[],n=[],i=Qr;function r(o){let s=t.get(o);if(s===void 0){if(i!==Qr)return i;t.set(o,s=e.push(o)-1)}return n[s%n.length]}return r.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new Jr;for(const s of o)t.has(s)||t.set(s,e.push(s)-1);return r},r.range=function(o){return arguments.length?(n=Array.from(o),r):n.slice()},r.unknown=function(o){return arguments.length?(i=o,r):i},r.copy=function(){return ts(e,n).unknown(i)},pi.apply(r,arguments),r}function es(){var t=ts().unknown(void 0),e=t.domain,n=t.range,i=0,r=1,o,s,a=!1,u=0,c=0,l=.5;delete t.unknown;function f(){var d=e().length,m=r<i,p=m?r:i,T=m?i:r;o=(T-p)/Math.max(1,d-u+c*2),a&&(o=Math.floor(o)),p+=(T-p-o*(d-u))*l,s=o*(1-u),a&&(p=Math.round(p),s=Math.round(s));var x=wc(d).map(function(y){return p+o*y});return n(m?x.reverse():x)}return t.domain=function(d){return arguments.length?(e(d),f()):e()},t.range=function(d){return arguments.length?([i,r]=d,i=+i,r=+r,f()):[i,r]},t.rangeRound=function(d){return[i,r]=d,i=+i,r=+r,a=!0,f()},t.bandwidth=function(){return s},t.step=function(){return o},t.round=function(d){return arguments.length?(a=!!d,f()):a},t.padding=function(d){return arguments.length?(u=Math.min(1,c=+d),f()):u},t.paddingInner=function(d){return arguments.length?(u=Math.min(1,d),f()):u},t.paddingOuter=function(d){return arguments.length?(c=+d,f()):c},t.align=function(d){return arguments.length?(l=Math.max(0,Math.min(1,d)),f()):l},t.copy=function(){return es(e(),[i,r]).round(a).paddingInner(u).paddingOuter(c).align(l)},pi.apply(f(),arguments)}function gi(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ns(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Ke(){}var qe=.7,kn=1/qe,be="\\s*([+-]?\\d+)\\s*",ze="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",It="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Tc=/^#([0-9a-f]{3,8})$/,Sc=new RegExp(`^rgb\\(${be},${be},${be}\\)$`),Ec=new RegExp(`^rgb\\(${It},${It},${It}\\)$`),Mc=new RegExp(`^rgba\\(${be},${be},${be},${ze}\\)$`),Cc=new RegExp(`^rgba\\(${It},${It},${It},${ze}\\)$`),Pc=new RegExp(`^hsl\\(${ze},${It},${It}\\)$`),Ac=new RegExp(`^hsla\\(${ze},${It},${It},${ze}\\)$`),is={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};gi(Ke,Xe,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:rs,formatHex:rs,formatHex8:Dc,formatHsl:kc,formatRgb:ss,toString:ss});function rs(){return this.rgb().formatHex()}function Dc(){return this.rgb().formatHex8()}function kc(){return ls(this).formatHsl()}function ss(){return this.rgb().formatRgb()}function Xe(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Tc.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?os(e):n===3?new mt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?On(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?On(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Sc.exec(t))?new mt(e[1],e[2],e[3],1):(e=Ec.exec(t))?new mt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Mc.exec(t))?On(e[1],e[2],e[3],e[4]):(e=Cc.exec(t))?On(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Pc.exec(t))?cs(e[1],e[2]/100,e[3]/100,1):(e=Ac.exec(t))?cs(e[1],e[2]/100,e[3]/100,e[4]):is.hasOwnProperty(t)?os(is[t]):t==="transparent"?new mt(NaN,NaN,NaN,0):null}function os(t){return new mt(t>>16&255,t>>8&255,t&255,1)}function On(t,e,n,i){return i<=0&&(t=e=n=NaN),new mt(t,e,n,i)}function Oc(t){return t instanceof Ke||(t=Xe(t)),t?(t=t.rgb(),new mt(t.r,t.g,t.b,t.opacity)):new mt}function yi(t,e,n,i){return arguments.length===1?Oc(t):new mt(t,e,n,i??1)}function mt(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}gi(mt,yi,ns(Ke,{brighter(t){return t=t==null?kn:Math.pow(kn,t),new mt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?qe:Math.pow(qe,t),new mt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new mt(oe(this.r),oe(this.g),oe(this.b),Rn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:as,formatHex:as,formatHex8:Rc,formatRgb:us,toString:us}));function as(){return`#${ae(this.r)}${ae(this.g)}${ae(this.b)}`}function Rc(){return`#${ae(this.r)}${ae(this.g)}${ae(this.b)}${ae((isNaN(this.opacity)?1:this.opacity)*255)}`}function us(){const t=Rn(this.opacity);return`${t===1?"rgb(":"rgba("}${oe(this.r)}, ${oe(this.g)}, ${oe(this.b)}${t===1?")":`, ${t})`}`}function Rn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function oe(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ae(t){return t=oe(t),(t<16?"0":"")+t.toString(16)}function cs(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Dt(t,e,n,i)}function ls(t){if(t instanceof Dt)return new Dt(t.h,t.s,t.l,t.opacity);if(t instanceof Ke||(t=Xe(t)),!t)return new Dt;if(t instanceof Dt)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),s=NaN,a=o-r,u=(o+r)/2;return a?(e===o?s=(n-i)/a+(n<i)*6:n===o?s=(i-e)/a+2:s=(e-n)/a+4,a/=u<.5?o+r:2-o-r,s*=60):a=u>0&&u<1?0:s,new Dt(s,a,u,t.opacity)}function Vc(t,e,n,i){return arguments.length===1?ls(t):new Dt(t,e,n,i??1)}function Dt(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}gi(Dt,Vc,ns(Ke,{brighter(t){return t=t==null?kn:Math.pow(kn,t),new Dt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?qe:Math.pow(qe,t),new Dt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new mt(vi(t>=240?t-240:t+120,r,i),vi(t,r,i),vi(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Dt(fs(this.h),Vn(this.s),Vn(this.l),Rn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Rn(this.opacity);return`${t===1?"hsl(":"hsla("}${fs(this.h)}, ${Vn(this.s)*100}%, ${Vn(this.l)*100}%${t===1?")":`, ${t})`}`}}));function fs(t){return t=(t||0)%360,t<0?t+360:t}function Vn(t){return Math.max(0,Math.min(1,t||0))}function vi(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const xi=t=>()=>t;function Ic(t,e){return function(n){return t+n*e}}function Nc(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function _c(t){return(t=+t)==1?ds:function(e,n){return n-e?Nc(e,n,t):xi(isNaN(e)?n:e)}}function ds(t,e){var n=e-t;return n?Ic(t,n):xi(isNaN(t)?e:t)}const hs=(function t(e){var n=_c(e);function i(r,o){var s=n((r=yi(r)).r,(o=yi(o)).r),a=n(r.g,o.g),u=n(r.b,o.b),c=ds(r.opacity,o.opacity);return function(l){return r.r=s(l),r.g=a(l),r.b=u(l),r.opacity=c(l),r+""}}return i.gamma=t,i})(1);function Lc(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,i=e.slice(),r;return function(o){for(r=0;r<n;++r)i[r]=t[r]*(1-o)+e[r]*o;return i}}function jc(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Fc(t,e){var n=e?e.length:0,i=t?Math.min(n,t.length):0,r=new Array(i),o=new Array(n),s;for(s=0;s<i;++s)r[s]=Ti(t[s],e[s]);for(;s<n;++s)o[s]=e[s];return function(a){for(s=0;s<i;++s)o[s]=r[s](a);return o}}function $c(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function In(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Bc(t,e){var n={},i={},r;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in t?n[r]=Ti(t[r],e[r]):i[r]=e[r];return function(o){for(r in n)i[r]=n[r](o);return i}}var bi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wi=new RegExp(bi.source,"g");function Wc(t){return function(){return t}}function Uc(t){return function(e){return t(e)+""}}function Yc(t,e){var n=bi.lastIndex=wi.lastIndex=0,i,r,o,s=-1,a=[],u=[];for(t=t+"",e=e+"";(i=bi.exec(t))&&(r=wi.exec(e));)(o=r.index)>n&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(i=i[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,u.push({i:s,x:In(i,r)})),n=wi.lastIndex;return n<e.length&&(o=e.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?u[0]?Uc(u[0].x):Wc(e):(e=u.length,function(c){for(var l=0,f;l<e;++l)a[(f=u[l]).i]=f.x(c);return a.join("")})}function Ti(t,e){var n=typeof e,i;return e==null||n==="boolean"?xi(e):(n==="number"?In:n==="string"?(i=Xe(e))?(e=i,hs):Yc:e instanceof Xe?hs:e instanceof Date?$c:jc(e)?Lc:Array.isArray(e)?Fc:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Bc:In)(t,e)}function Hc(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Gc(t){return function(){return t}}function Kc(t){return+t}var ms=[0,1];function we(t){return t}function Si(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Gc(isNaN(e)?NaN:.5)}function qc(t,e){var n;return t>e&&(n=t,t=e,e=n),function(i){return Math.max(t,Math.min(e,i))}}function zc(t,e,n){var i=t[0],r=t[1],o=e[0],s=e[1];return r<i?(i=Si(r,i),o=n(s,o)):(i=Si(i,r),o=n(o,s)),function(a){return o(i(a))}}function Xc(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),o=new Array(i),s=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<i;)r[s]=Si(t[s],t[s+1]),o[s]=n(e[s],e[s+1]);return function(a){var u=dc(t,a,1,i)-1;return o[u](r[u](a))}}function Jc(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Zc(){var t=ms,e=ms,n=Ti,i,r,o,s=we,a,u,c;function l(){var d=Math.min(t.length,e.length);return s!==we&&(s=qc(t[0],t[d-1])),a=d>2?Xc:zc,u=c=null,f}function f(d){return d==null||isNaN(d=+d)?o:(u||(u=a(t.map(i),e,n)))(i(s(d)))}return f.invert=function(d){return s(r((c||(c=a(e,t.map(i),In)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,Kc),l()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),l()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),n=Hc,l()},f.clamp=function(d){return arguments.length?(s=d?!0:we,l()):s!==we},f.interpolate=function(d){return arguments.length?(n=d,l()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,m){return i=d,r=m,l()}}function Qc(){return Zc()(we,we)}function tl(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Nn(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function Te(t){return t=Nn(Math.abs(t)),t?t[1]:NaN}function el(t,e){return function(n,i){for(var r=n.length,o=[],s=0,a=t[0],u=0;r>0&&a>0&&(u+a+1>i&&(a=Math.max(1,i-u)),o.push(n.substring(r-=a,r+a)),!((u+=a+1)>i));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}function nl(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var il=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function _n(t){if(!(e=il.exec(t)))throw new Error("invalid format: "+t);var e;return new Ei({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}_n.prototype=Ei.prototype;function Ei(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Ei.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function rl(t){t:for(var e=t.length,n=1,i=-1,r;n<e;++n)switch(t[n]){case".":i=r=n;break;case"0":i===0&&(i=n),r=n;break;default:if(!+t[n])break t;i>0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(r+1):t}var ps;function sl(t,e){var n=Nn(t,e);if(!n)return t+"";var i=n[0],r=n[1],o=r-(ps=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+Nn(t,Math.max(0,e+o-1))[0]}function gs(t,e){var n=Nn(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const ys={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:tl,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>gs(t*100,e),r:gs,s:sl,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function vs(t){return t}var xs=Array.prototype.map,bs=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ol(t){var e=t.grouping===void 0||t.thousands===void 0?vs:el(xs.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",r=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?vs:nl(xs.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function c(f){f=_n(f);var d=f.fill,m=f.align,p=f.sign,T=f.symbol,x=f.zero,y=f.width,v=f.comma,w=f.precision,S=f.trim,E=f.type;E==="n"?(v=!0,E="g"):ys[E]||(w===void 0&&(w=12),S=!0,E="g"),(x||d==="0"&&m==="=")&&(x=!0,d="0",m="=");var V=T==="$"?n:T==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():"",L=T==="$"?i:/[%p]/.test(E)?s:"",D=ys[E],B=/[defgprs%]/.test(E);w=w===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function Z(R){var Q=V,j=L,X,gt,Et;if(E==="c")j=D(R)+j,R="";else{R=+R;var W=R<0||1/R<0;if(R=isNaN(R)?u:D(Math.abs(R),w),S&&(R=rl(R)),W&&+R==0&&p!=="+"&&(W=!1),Q=(W?p==="("?p:a:p==="-"||p==="("?"":p)+Q,j=(E==="s"?bs[8+ps/3]:"")+j+(W&&p==="("?")":""),B){for(X=-1,gt=R.length;++X<gt;)if(Et=R.charCodeAt(X),48>Et||Et>57){j=(Et===46?r+R.slice(X+1):R.slice(X))+j,R=R.slice(0,X);break}}}v&&!x&&(R=e(R,1/0));var J=Q.length+R.length+j.length,U=J<y?new Array(y-J+1).join(d):"";switch(v&&x&&(R=e(U+R,U.length?y-j.length:1/0),U=""),m){case"<":R=Q+R+j+U;break;case"=":R=Q+U+R+j;break;case"^":R=U.slice(0,J=U.length>>1)+Q+R+j+U.slice(J);break;default:R=U+Q+R+j;break}return o(R)}return Z.toString=function(){return f+""},Z}function l(f,d){var m=c((f=_n(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Te(d)/3)))*3,T=Math.pow(10,-p),x=bs[8+p/3];return function(y){return m(T*y)+x}}return{format:c,formatPrefix:l}}var Ln,ws,Ts;al({thousands:",",grouping:[3],currency:["$",""]});function al(t){return Ln=ol(t),ws=Ln.format,Ts=Ln.formatPrefix,Ln}function ul(t){return Math.max(0,-Te(Math.abs(t)))}function cl(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Te(e)/3)))*3-Te(Math.abs(t)))}function ll(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Te(e)-Te(t))+1}function fl(t,e,n,i){var r=bc(t,e,n),o;switch(i=_n(i??",f"),i.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return i.precision==null&&!isNaN(o=cl(r,s))&&(i.precision=o),Ts(i,s)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(o=ll(r,Math.max(Math.abs(t),Math.abs(e))))&&(i.precision=o-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(o=ul(r))&&(i.precision=o-(i.type==="%")*2);break}}return ws(i)}function dl(t){var e=t.domain;return t.ticks=function(n){var i=e();return xc(i[0],i[i.length-1],n??10)},t.tickFormat=function(n,i){var r=e();return fl(r[0],r[r.length-1],n??10,i)},t.nice=function(n){n==null&&(n=10);var i=e(),r=0,o=i.length-1,s=i[r],a=i[o],u,c,l=10;for(a<s&&(c=s,s=a,a=c,c=r,r=o,o=c);l-- >0;){if(c=mi(s,a,n),c===u)return i[r]=s,i[o]=a,e(i);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;u=c}return t},t}function Ss(){var t=Qc();return t.copy=function(){return Jc(t,Ss())},pi.apply(t,arguments),dl(t)}const Es=6048e5,hl=864e5,Ms=6e4,Cs=36e5,Ps=Symbol.for("constructDateFrom");function ut(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Ps in t?t[Ps](e):t instanceof Date?new t.constructor(e):new Date(e)}function it(t,e){return ut(e||t,t)}function As(t,e,n){const i=it(t,n?.in);return isNaN(e)?ut(t,NaN):(e&&i.setDate(i.getDate()+e),i)}function ml(t,e,n){const i=it(t,n?.in);if(isNaN(e))return ut(t,NaN);if(!e)return i;const r=i.getDate(),o=ut(t,i.getTime());o.setMonth(i.getMonth()+e+1,0);const s=o.getDate();return r>=s?o:(i.setFullYear(o.getFullYear(),o.getMonth(),r),i)}let pl={};function Je(){return pl}function yt(t,e){const n=Je(),i=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=it(t,e?.in),o=r.getDay(),s=(o<i?7:0)+o-i;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}function jn(t,e){return yt(t,{...e,weekStartsOn:1})}function Ds(t,e){const n=it(t,e?.in),i=n.getFullYear(),r=ut(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const o=jn(r),s=ut(n,0);s.setFullYear(i,0,4),s.setHours(0,0,0,0);const a=jn(s);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function ks(t){const e=it(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Os(t,...e){const n=ut.bind(null,e.find(i=>typeof i=="object"));return e.map(n)}function Rs(t,e){const n=it(t,e?.in);return n.setHours(0,0,0,0),n}function gl(t,e,n){const[i,r]=Os(n?.in,t,e),o=Rs(i),s=Rs(r),a=+o-ks(o),u=+s-ks(s);return Math.round((a-u)/hl)}function yl(t,e){const n=Ds(t,e),i=ut(t,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),jn(i)}function Vs(t,e,n){return As(t,e*7,n)}function vl(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Is(t){return!(!vl(t)&&typeof t!="number"||isNaN(+it(t)))}function xl(t,e){const n=it(t,e?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function Fn(t,e){const[n,i]=Os(t,e.start,e.end);return{start:n,end:i}}function bl(t,e){const{start:n,end:i}=Fn(e?.in,t);let r=+n>+i;const o=r?+n:+i,s=r?i:n;s.setHours(0,0,0,0);let a=1;const u=[];for(;+s<=o;)u.push(ut(n,s)),s.setDate(s.getDate()+a),s.setHours(0,0,0,0);return r?u.reverse():u}function wl(t,e){const{start:n,end:i}=Fn(e?.in,t);let r=+n>+i;const o=r?+n:+i,s=r?i:n;s.setHours(0,0,0,0),s.setDate(1);let a=1;const u=[];for(;+s<=o;)u.push(ut(n,s)),s.setMonth(s.getMonth()+a);return r?u.reverse():u}function Ns(t,e){const{start:n,end:i}=Fn(e?.in,t);let r=+n>+i;const o=yt(r?i:n,e),s=yt(r?n:i,e);o.setHours(15),s.setHours(15);const a=+s.getTime();let u=o,c=1;const l=[];for(;+u<=a;)u.setHours(0),l.push(ut(n,u)),u=Vs(u,c),u.setHours(15);return r?l.reverse():l}function _s(t,e){const n=it(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Tl(t,e){const n=it(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Sl(t,e){const{start:n,end:i}=Fn(e?.in,t);let r=+n>+i;const o=r?+n:+i,s=r?i:n;s.setHours(0,0,0,0),s.setMonth(0,1);let a=1;const u=[];for(;+s<=o;)u.push(ut(n,s)),s.setFullYear(s.getFullYear()+a);return r?u.reverse():u}function Mi(t,e){const n=Je(),i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=it(t,e?.in),o=r.getDay(),s=(o<i?-7:0)+6-(o-i);return r.setDate(r.getDate()+s),r.setHours(23,59,59,999),r}const El={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ml=(t,e,n)=>{let i;const r=El[t];return typeof r=="string"?i=r:e===1?i=r.one:i=r.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Ci(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Cl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Pl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Al={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Dl={date:Ci({formats:Cl,defaultWidth:"full"}),time:Ci({formats:Pl,defaultWidth:"full"}),dateTime:Ci({formats:Al,defaultWidth:"full"})},kl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ol=(t,e,n,i)=>kl[t];function Ze(t){return(e,n)=>{const i=n?.context?String(n.context):"standalone";let r;if(i==="formatting"&&t.formattingValues){const s=t.defaultFormattingWidth||t.defaultWidth,a=n?.width?String(n.width):s;r=t.formattingValues[a]||t.formattingValues[s]}else{const s=t.defaultWidth,a=n?.width?String(n.width):t.defaultWidth;r=t.values[a]||t.values[s]}const o=t.argumentCallback?t.argumentCallback(e):e;return r[o]}}const Rl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Vl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Il={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Nl={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},_l={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ll={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},jl={ordinalNumber:(t,e)=>{const n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Ze({values:Rl,defaultWidth:"wide"}),quarter:Ze({values:Vl,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Ze({values:Il,defaultWidth:"wide"}),day:Ze({values:Nl,defaultWidth:"wide"}),dayPeriod:Ze({values:_l,defaultWidth:"wide",formattingValues:Ll,defaultFormattingWidth:"wide"})};function Qe(t){return(e,n={})=>{const i=n.width,r=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],o=e.match(r);if(!o)return null;const s=o[0],a=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(a)?$l(a,f=>f.test(s)):Fl(a,f=>f.test(s));let c;c=t.valueCallback?t.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c;const l=e.slice(s.length);return{value:c,rest:l}}}function Fl(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function $l(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Bl(t){return(e,n={})=>{const i=e.match(t.matchPattern);if(!i)return null;const r=i[0],o=e.match(t.parsePattern);if(!o)return null;let s=t.valueCallback?t.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;const a=e.slice(r.length);return{value:s,rest:a}}}const Wl=/^(\d+)(th|st|nd|rd)?/i,Ul=/\d+/i,Yl={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Hl={any:[/^b/i,/^(a|c)/i]},Gl={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Kl={any:[/1/i,/2/i,/3/i,/4/i]},ql={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},zl={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Xl={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Jl={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Zl={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ql={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},tf={ordinalNumber:Bl({matchPattern:Wl,parsePattern:Ul,valueCallback:t=>parseInt(t,10)}),era:Qe({matchPatterns:Yl,defaultMatchWidth:"wide",parsePatterns:Hl,defaultParseWidth:"any"}),quarter:Qe({matchPatterns:Gl,defaultMatchWidth:"wide",parsePatterns:Kl,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Qe({matchPatterns:ql,defaultMatchWidth:"wide",parsePatterns:zl,defaultParseWidth:"any"}),day:Qe({matchPatterns:Xl,defaultMatchWidth:"wide",parsePatterns:Jl,defaultParseWidth:"any"}),dayPeriod:Qe({matchPatterns:Zl,defaultMatchWidth:"any",parsePatterns:Ql,defaultParseWidth:"any"})},ef={code:"en-US",formatDistance:Ml,formatLong:Dl,formatRelative:Ol,localize:jl,match:tf,options:{weekStartsOn:0,firstWeekContainsDate:1}};function nf(t,e){const n=it(t,e?.in);return gl(n,Tl(n))+1}function rf(t,e){const n=it(t,e?.in),i=+jn(n)-+yl(n);return Math.round(i/Es)+1}function Ls(t,e){const n=it(t,e?.in),i=n.getFullYear(),r=Je(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=ut(e?.in||t,0);s.setFullYear(i+1,0,o),s.setHours(0,0,0,0);const a=yt(s,e),u=ut(e?.in||t,0);u.setFullYear(i,0,o),u.setHours(0,0,0,0);const c=yt(u,e);return+n>=+a?i+1:+n>=+c?i:i-1}function sf(t,e){const n=Je(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Ls(t,e),o=ut(e?.in||t,0);return o.setFullYear(r,0,i),o.setHours(0,0,0,0),yt(o,e)}function of(t,e){const n=it(t,e?.in),i=+yt(n,e)-+sf(n,e);return Math.round(i/Es)+1}function $(t,e){const n=t<0?"-":"",i=Math.abs(t).toString().padStart(e,"0");return n+i}const qt={y(t,e){const n=t.getFullYear(),i=n>0?n:1-n;return $(e==="yy"?i%100:i,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):$(n+1,2)},d(t,e){return $(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(t,e){return $(t.getHours()%12||12,e.length)},H(t,e){return $(t.getHours(),e.length)},m(t,e){return $(t.getMinutes(),e.length)},s(t,e){return $(t.getSeconds(),e.length)},S(t,e){const n=e.length,i=t.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return $(r,e.length)}},Se={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},js={G:function(t,e,n){const i=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const i=t.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return qt.y(t,e)},Y:function(t,e,n,i){const r=Ls(t,i),o=r>0?r:1-r;if(e==="YY"){const s=o%100;return $(s,2)}return e==="Yo"?n.ordinalNumber(o,{unit:"year"}):$(o,e.length)},R:function(t,e){const n=Ds(t);return $(n,e.length)},u:function(t,e){const n=t.getFullYear();return $(n,e.length)},Q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return $(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return $(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){const i=t.getMonth();switch(e){case"M":case"MM":return qt.M(t,e);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,n){const i=t.getMonth();switch(e){case"L":return String(i+1);case"LL":return $(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){const r=of(t,i);return e==="wo"?n.ordinalNumber(r,{unit:"week"}):$(r,e.length)},I:function(t,e,n){const i=rf(t);return e==="Io"?n.ordinalNumber(i,{unit:"week"}):$(i,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):qt.d(t,e)},D:function(t,e,n){const i=nf(t);return e==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):$(i,e.length)},E:function(t,e,n){const i=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){const r=t.getDay(),o=(r-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return $(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){const r=t.getDay(),o=(r-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return $(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,n){const i=t.getDay(),r=i===0?7:i;switch(e){case"i":return String(r);case"ii":return $(r,e.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const i=t.getHours();let r;switch(i===12?r=Se.noon:i===0?r=Se.midnight:r=i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){const i=t.getHours();let r;switch(i>=17?r=Se.evening:i>=12?r=Se.afternoon:i>=4?r=Se.morning:r=Se.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let i=t.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return qt.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):qt.H(t,e)},K:function(t,e,n){const i=t.getHours()%12;return e==="Ko"?n.ordinalNumber(i,{unit:"hour"}):$(i,e.length)},k:function(t,e,n){let i=t.getHours();return i===0&&(i=24),e==="ko"?n.ordinalNumber(i,{unit:"hour"}):$(i,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):qt.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):qt.s(t,e)},S:function(t,e){return qt.S(t,e)},X:function(t,e,n){const i=t.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return $s(i);case"XXXX":case"XX":return ue(i);default:return ue(i,":")}},x:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"x":return $s(i);case"xxxx":case"xx":return ue(i);default:return ue(i,":")}},O:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Fs(i,":");default:return"GMT"+ue(i,":")}},z:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Fs(i,":");default:return"GMT"+ue(i,":")}},t:function(t,e,n){const i=Math.trunc(+t/1e3);return $(i,e.length)},T:function(t,e,n){return $(+t,e.length)}};function Fs(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),r=Math.trunc(i/60),o=i%60;return o===0?n+String(r):n+String(r)+e+$(o,2)}function $s(t,e){return t%60===0?(t>0?"-":"+")+$(Math.abs(t)/60,2):ue(t,e)}function ue(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),r=$(Math.trunc(i/60),2),o=$(i%60,2);return n+r+e+o}const Bs=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Ws=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},af={p:Ws,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return Bs(t,e);let o;switch(i){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",Bs(i,e)).replace("{{time}}",Ws(r,e))}},uf=/^D+$/,cf=/^Y+$/,lf=["D","DD","YY","YYYY"];function ff(t){return uf.test(t)}function df(t){return cf.test(t)}function hf(t,e,n){const i=mf(t,e,n);if(console.warn(i),lf.includes(t))throw new RangeError(i)}function mf(t,e,n){const i=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const pf=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,gf=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,yf=/^'([^]*?)'?$/,vf=/''/g,xf=/[a-zA-Z]/;function G(t,e,n){const i=Je(),r=i.locale??ef,o=i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=it(t,n?.in);if(!Is(a))throw new RangeError("Invalid time value");let u=e.match(gf).map(l=>{const f=l[0];if(f==="p"||f==="P"){const d=af[f];return d(l,r.formatLong)}return l}).join("").match(pf).map(l=>{if(l==="''")return{isToken:!1,value:"'"};const f=l[0];if(f==="'")return{isToken:!1,value:bf(l)};if(js[f])return{isToken:!0,value:l};if(f.match(xf))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:l}});r.localize.preprocessor&&(u=r.localize.preprocessor(a,u));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:r};return u.map(l=>{if(!l.isToken)return l.value;const f=l.value;(df(f)||ff(f))&&hf(f,e,String(t));const d=js[f[0]];return d(a,f,r.localize,c)}).join("")}function bf(t){const e=t.match(yf);return e?e[1].replace(vf,"'"):t}function wf(t,e){return it(t,e?.in).getFullYear()}function Tf(t,e){const n=()=>ut(e?.in,NaN),r=Cf(t);let o;if(r.date){const c=Pf(r.date,2);o=Af(c.restDateString,c.year)}if(!o||isNaN(+o))return n();const s=+o;let a=0,u;if(r.time&&(a=Df(r.time),isNaN(a)))return n();if(r.timezone){if(u=kf(r.timezone),isNaN(u))return n()}else{const c=new Date(s+a),l=it(0,e?.in);return l.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),l.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),l}return it(s+a+u,e?.in)}const $n={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Sf=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ef=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Mf=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Cf(t){const e={},n=t.split($n.dateTimeDelimiter);let i;if(n.length>2)return e;if(/:/.test(n[0])?i=n[0]:(e.date=n[0],i=n[1],$n.timeZoneDelimiter.test(e.date)&&(e.date=t.split($n.timeZoneDelimiter)[0],i=t.substr(e.date.length,t.length))),i){const r=$n.timezone.exec(i);r?(e.time=i.replace(r[1],""),e.timezone=r[1]):e.time=i}return e}function Pf(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),i=t.match(n);if(!i)return{year:NaN,restDateString:""};const r=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:o===null?r:o*100,restDateString:t.slice((i[1]||i[2]).length)}}function Af(t,e){if(e===null)return new Date(NaN);const n=t.match(Sf);if(!n)return new Date(NaN);const i=!!n[4],r=tn(n[1]),o=tn(n[2])-1,s=tn(n[3]),a=tn(n[4]),u=tn(n[5])-1;if(i)return Nf(e,a,u)?Of(e,a,u):new Date(NaN);{const c=new Date(0);return!Vf(e,o,s)||!If(e,r)?new Date(NaN):(c.setUTCFullYear(e,o,Math.max(r,s)),c)}}function tn(t){return t?parseInt(t):1}function Df(t){const e=t.match(Ef);if(!e)return NaN;const n=Pi(e[1]),i=Pi(e[2]),r=Pi(e[3]);return _f(n,i,r)?n*Cs+i*Ms+r*1e3:NaN}function Pi(t){return t&&parseFloat(t.replace(",","."))||0}function kf(t){if(t==="Z")return 0;const e=t.match(Mf);if(!e)return 0;const n=e[1]==="+"?-1:1,i=parseInt(e[2]),r=e[3]&&parseInt(e[3])||0;return Lf(i,r)?n*(i*Cs+r*Ms):NaN}function Of(t,e,n){const i=new Date(0);i.setUTCFullYear(t,0,4);const r=i.getUTCDay()||7,o=(e-1)*7+n+1-r;return i.setUTCDate(i.getUTCDate()+o),i}const Rf=[31,null,31,30,31,30,31,31,30,31,30,31];function Us(t){return t%400===0||t%4===0&&t%100!==0}function Vf(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(Rf[e]||(Us(t)?29:28))}function If(t,e){return e>=1&&e<=(Us(t)?366:365)}function Nf(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function _f(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function Lf(t,e){return e>=0&&e<=59}const jf=["#6366f1","#8b5cf6","#ec4899","#10b981","#f59e0b","#3b82f6","#ef4444"],Ff=({data:t,view:e,dataKeys:n,colors:i=jf,missingDataStrategy:r="skip"})=>C.useMemo(()=>{if(!t||t.length===0)return[];const a=t.map((l,f)=>{const d=l[n.date],m=d instanceof Date?d:Tf(d);let p=0,T=[];return Array.isArray(n.value)?n.value.forEach((x,y)=>{const v=Number(l[x])||0;p+=v,T.push({key:x,value:v,color:i[y%i.length]})}):p=Number(l[n.value])||0,{id:l.id||`item-${f}`,label:l[n.label]||"",value:p,stackedValues:T.length>0?T:void 0,date:Is(m)?m:new Date,color:T.length===0?i[0]:void 0}}).sort((l,f)=>l.date.getTime()-f.date.getTime()),u=(l,f)=>l.reduce((d,m)=>{const p=f(m);return(d[p]=d[p]||[]).push(m),d},{});let c=[];if(e==="day"){const l=u(a,f=>G(f.date,"yyyy-MM-dd"));c=Object.entries(l).map(([f,d])=>{const m=d,p=m[0],T=m.reduce((y,v)=>y+v.value,0);let x=[];if(p.stackedValues){const y=new Map;m.forEach(v=>{v.stackedValues?.forEach(w=>{const S=y.get(w.key)||0;y.set(w.key,S+w.value)})}),x=Array.from(y.entries()).map(([v,w],S)=>({key:v,value:w,color:i[S%i.length]}))}return{...p,id:f,label:G(p.date,"E dd"),value:T,stackedValues:x.length>0?x:void 0}})}else if(e==="week"){const l=u(a,f=>G(yt(f.date),"yyyy-MM-dd"));c=Object.entries(l).map(([f,d])=>{const m=d,p=m[0],T=m.reduce((S,E)=>S+E.value,0);let x=[];if(p.stackedValues){const S=new Map;m.forEach(E=>{E.stackedValues?.forEach(V=>{const L=S.get(V.key)||0;S.set(V.key,L+V.value)})}),x=Array.from(S.entries()).map(([E,V],L)=>({key:E,value:V,color:i[L%i.length]}))}const y=yt(p.date),v=Mi(p.date),w=`${G(y,"MMM dd")}-${G(v,"MMM dd")}`;return{...p,id:f,label:w,value:T,stackedValues:x.length>0?x:void 0}})}else if(e==="month"){const l=u(a,f=>G(_s(f.date),"yyyy-MM"));c=Object.entries(l).map(([f,d])=>{const m=d,p=m[0],T=m.reduce((y,v)=>y+v.value,0);let x=[];if(p.stackedValues){const y=new Map;m.forEach(v=>{v.stackedValues?.forEach(w=>{const S=y.get(w.key)||0;y.set(w.key,S+w.value)})}),x=Array.from(y.entries()).map(([v,w],S)=>({key:v,value:w,color:i[S%i.length]}))}return{...p,id:f,label:G(p.date,"MMM yy"),value:T,stackedValues:x.length>0?x:void 0}})}else if(e==="year"){const l=u(a,f=>G(f.date,"yyyy"));c=Object.entries(l).map(([f,d])=>{const m=d,p=m[0],T=m.reduce((y,v)=>y+v.value,0);let x=[];if(p.stackedValues){const y=new Map;m.forEach(v=>{v.stackedValues?.forEach(w=>{const S=y.get(w.key)||0;y.set(w.key,S+w.value)})}),x=Array.from(y.entries()).map(([v,w],S)=>({key:v,value:w,color:i[S%i.length]}))}return{...p,id:f,label:f,value:T,stackedValues:x.length>0?x:void 0}})}else c=a;if(r==="zero"&&c.length>0){const l=c[0].date,f=c[c.length-1].date;let d=[];e==="day"?d=bl({start:l,end:f}):e==="week"?d=Ns({start:l,end:f}):e==="month"?d=wl({start:l,end:f}):e==="year"&&(d=Sl({start:l,end:f}));const m=new Map(c.map(p=>[p.id,p]));c=d.map((p,T)=>{let x="";if(e==="day"?x=G(p,"yyyy-MM-dd"):e==="week"?x=G(yt(p),"yyyy-MM-dd"):e==="month"?x=G(_s(p),"yyyy-MM"):e==="year"&&(x=G(p,"yyyy")),m.has(x))return m.get(x);let y="";if(e==="day")y=G(p,"E dd");else if(e==="week"){const v=yt(p),w=Mi(p);y=`${G(v,"MMM dd")}-${G(w,"MMM dd")}`}else e==="month"?y=G(p,"MMM yy"):e==="year"&&(y=G(p,"yyyy"));return{id:x,label:y,value:0,date:p,color:i[0]}})}return c},[t,e,n,i,r]),Ys=C.createContext({});function $f(t){const e=C.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ai=typeof window<"u",Bf=Ai?C.useLayoutEffect:C.useEffect,Di=C.createContext(null);function ki(t,e){t.indexOf(e)===-1&&t.push(e)}function Oi(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const $t=(t,e,n)=>n>e?e:n<t?t:n;function Ri(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let Ee=()=>{},Bt=()=>{};process.env.NODE_ENV!=="production"&&(Ee=(t,e,n)=>{!t&&typeof console<"u"&&console.warn(Ri(e,n))},Bt=(t,e,n)=>{if(!t)throw new Error(Ri(e,n))});const Wt={},Hs=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Gs(t){return typeof t=="object"&&t!==null}const Ks=t=>/^0[^.\s]+$/u.test(t);function Vi(t){let e;return()=>(e===void 0&&(e=t()),e)}const wt=t=>t,Wf=(t,e)=>n=>e(t(n)),en=(...t)=>t.reduce(Wf),nn=(t,e,n)=>{const i=e-t;return i===0?1:(n-t)/i};class Ii{constructor(){this.subscriptions=[]}add(e){return ki(this.subscriptions,e),()=>Oi(this.subscriptions,e)}notify(e,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,n,i);else for(let o=0;o<r;o++){const s=this.subscriptions[o];s&&s(e,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const kt=t=>t*1e3,Tt=t=>t/1e3;function qs(t,e){return e?t*(1e3/e):0}const zs=new Set;function Ni(t,e,n){t||zs.has(e)||(console.warn(Ri(e,n)),zs.add(e))}const Xs=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Uf=1e-7,Yf=12;function Hf(t,e,n,i,r){let o,s,a=0;do s=e+(n-e)/2,o=Xs(s,i,r)-t,o>0?n=s:e=s;while(Math.abs(o)>Uf&&++a<Yf);return s}function rn(t,e,n,i){if(t===e&&n===i)return wt;const r=o=>Hf(o,0,1,t,n);return o=>o===0||o===1?o:Xs(r(o),e,i)}const Js=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Zs=t=>e=>1-t(1-e),Qs=rn(.33,1.53,.69,.99),_i=Zs(Qs),to=Js(_i),eo=t=>(t*=2)<1?.5*_i(t):.5*(2-Math.pow(2,-10*(t-1))),Li=t=>1-Math.sin(Math.acos(t)),no=Zs(Li),io=Js(Li),Gf=rn(.42,0,1,1),Kf=rn(0,0,.58,1),ro=rn(.42,0,.58,1),qf=t=>Array.isArray(t)&&typeof t[0]!="number",so=t=>Array.isArray(t)&&typeof t[0]=="number",oo={linear:wt,easeIn:Gf,easeInOut:ro,easeOut:Kf,circIn:Li,circInOut:io,circOut:no,backIn:_i,backInOut:to,backOut:Qs,anticipate:eo},zf=t=>typeof t=="string",ao=t=>{if(so(t)){Bt(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,i,r]=t;return rn(e,n,i,r)}else if(zf(t))return Bt(oo[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),oo[t];return t},Bn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Xf(t,e){let n=new Set,i=new Set,r=!1,o=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(l){s.has(l)&&(c.schedule(l),t()),l(a)}const c={schedule:(l,f=!1,d=!1)=>{const p=d&&r?n:i;return f&&s.add(l),p.has(l)||p.add(l),l},cancel:l=>{i.delete(l),s.delete(l)},process:l=>{if(a=l,r){o=!0;return}r=!0,[n,i]=[i,n],n.forEach(u),n.clear(),r=!1,o&&(o=!1,c.process(l))}};return c}const Jf=40;function uo(t,e){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=Bn.reduce((w,S)=>(w[S]=Xf(o),w),{}),{setup:a,read:u,resolveKeyframes:c,preUpdate:l,update:f,preRender:d,render:m,postRender:p}=s,T=()=>{const w=Wt.useManualTiming?r.timestamp:performance.now();n=!1,Wt.useManualTiming||(r.delta=i?1e3/60:Math.max(Math.min(w-r.timestamp,Jf),1)),r.timestamp=w,r.isProcessing=!0,a.process(r),u.process(r),c.process(r),l.process(r),f.process(r),d.process(r),m.process(r),p.process(r),r.isProcessing=!1,n&&e&&(i=!1,t(T))},x=()=>{n=!0,i=!0,r.isProcessing||t(T)};return{schedule:Bn.reduce((w,S)=>{const E=s[S];return w[S]=(V,L=!1,D=!1)=>(n||x(),E.schedule(V,L,D)),w},{}),cancel:w=>{for(let S=0;S<Bn.length;S++)s[Bn[S]].cancel(w)},state:r,steps:s}}const{schedule:K,cancel:zt,state:ot,steps:ji}=uo(typeof requestAnimationFrame<"u"?requestAnimationFrame:wt,!0);let Wn;function Zf(){Wn=void 0}const pt={now:()=>(Wn===void 0&&pt.set(ot.isProcessing||Wt.useManualTiming?ot.timestamp:performance.now()),Wn),set:t=>{Wn=t,queueMicrotask(Zf)}},co=t=>e=>typeof e=="string"&&e.startsWith(t),lo=co("--"),Qf=co("var(--"),Fi=t=>Qf(t)?td.test(t.split("/*")[0].trim()):!1,td=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Me={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},sn={...Me,transform:t=>$t(0,1,t)},Un={...Me,default:1},on=t=>Math.round(t*1e5)/1e5,$i=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ed(t){return t==null}const nd=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bi=(t,e)=>n=>!!(typeof n=="string"&&nd.test(n)&&n.startsWith(t)||e&&!ed(n)&&Object.prototype.hasOwnProperty.call(n,e)),fo=(t,e,n)=>i=>{if(typeof i!="string")return i;const[r,o,s,a]=i.match($i);return{[t]:parseFloat(r),[e]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},id=t=>$t(0,255,t),Wi={...Me,transform:t=>Math.round(id(t))},ce={test:Bi("rgb","red"),parse:fo("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Wi.transform(t)+", "+Wi.transform(e)+", "+Wi.transform(n)+", "+on(sn.transform(i))+")"};function rd(t){let e="",n="",i="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const Ui={test:Bi("#"),parse:rd,transform:ce.transform},an=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Xt=an("deg"),Nt=an("%"),k=an("px"),sd=an("vh"),od=an("vw"),ho={...Nt,parse:t=>Nt.parse(t)/100,transform:t=>Nt.transform(t*100)},Ce={test:Bi("hsl","hue"),parse:fo("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Nt.transform(on(e))+", "+Nt.transform(on(n))+", "+on(sn.transform(i))+")"},et={test:t=>ce.test(t)||Ui.test(t)||Ce.test(t),parse:t=>ce.test(t)?ce.parse(t):Ce.test(t)?Ce.parse(t):Ui.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ce.transform(t):Ce.transform(t),getAnimatableNone:t=>{const e=et.parse(t);return e.alpha=0,et.transform(e)}},ad=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ud(t){return isNaN(t)&&typeof t=="string"&&(t.match($i)?.length||0)+(t.match(ad)?.length||0)>0}const mo="number",po="color",cd="var",ld="var(",go="${}",fd=/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 un(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},r=[];let o=0;const a=e.replace(fd,u=>(et.test(u)?(i.color.push(o),r.push(po),n.push(et.parse(u))):u.startsWith(ld)?(i.var.push(o),r.push(cd),n.push(u)):(i.number.push(o),r.push(mo),n.push(parseFloat(u))),++o,go)).split(go);return{values:n,split:a,indexes:i,types:r}}function yo(t){return un(t).values}function vo(t){const{split:e,types:n}=un(t),i=e.length;return r=>{let o="";for(let s=0;s<i;s++)if(o+=e[s],r[s]!==void 0){const a=n[s];a===mo?o+=on(r[s]):a===po?o+=et.transform(r[s]):o+=r[s]}return o}}const dd=t=>typeof t=="number"?0:et.test(t)?et.getAnimatableNone(t):t;function hd(t){const e=yo(t);return vo(t)(e.map(dd))}const Jt={test:ud,parse:yo,createTransformer:vo,getAnimatableNone:hd};function Yi(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function md({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,e/=100,n/=100;let r=0,o=0,s=0;if(!e)r=o=s=n;else{const a=n<.5?n*(1+e):n+e-n*e,u=2*n-a;r=Yi(u,a,t+1/3),o=Yi(u,a,t),s=Yi(u,a,t-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:i}}function Yn(t,e){return n=>n>0?e:t}const q=(t,e,n)=>t+(e-t)*n,Hi=(t,e,n)=>{const i=t*t,r=n*(e*e-i)+i;return r<0?0:Math.sqrt(r)},pd=[Ui,ce,Ce],gd=t=>pd.find(e=>e.test(t));function xo(t){const e=gd(t);if(Ee(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===Ce&&(n=md(n)),n}const bo=(t,e)=>{const n=xo(t),i=xo(e);if(!n||!i)return Yn(t,e);const r={...n};return o=>(r.red=Hi(n.red,i.red,o),r.green=Hi(n.green,i.green,o),r.blue=Hi(n.blue,i.blue,o),r.alpha=q(n.alpha,i.alpha,o),ce.transform(r))},Gi=new Set(["none","hidden"]);function yd(t,e){return Gi.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function vd(t,e){return n=>q(t,e,n)}function Ki(t){return typeof t=="number"?vd:typeof t=="string"?Fi(t)?Yn:et.test(t)?bo:wd:Array.isArray(t)?wo:typeof t=="object"?et.test(t)?bo:xd:Yn}function wo(t,e){const n=[...t],i=n.length,r=t.map((o,s)=>Ki(o)(o,e[s]));return o=>{for(let s=0;s<i;s++)n[s]=r[s](o);return n}}function xd(t,e){const n={...t,...e},i={};for(const r in n)t[r]!==void 0&&e[r]!==void 0&&(i[r]=Ki(t[r])(t[r],e[r]));return r=>{for(const o in i)n[o]=i[o](r);return n}}function bd(t,e){const n=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],s=t.indexes[o][i[o]],a=t.values[s]??0;n[r]=a,i[o]++}return n}const wd=(t,e)=>{const n=Jt.createTransformer(e),i=un(t),r=un(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Gi.has(t)&&!r.values.length||Gi.has(e)&&!i.values.length?yd(t,e):en(wo(bd(i,r),r.values),n):(Ee(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Yn(t,e))};function To(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?q(t,e,n):Ki(t)(t,e)}const Td=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>K.update(e,n),stop:()=>zt(e),now:()=>ot.isProcessing?ot.timestamp:pt.now()}},So=(t,e,n=10)=>{let i="";const r=Math.max(Math.round(e/n),2);for(let o=0;o<r;o++)i+=Math.round(t(o/(r-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Hn=2e4;function qi(t){let e=0;const n=50;let i=t.next(e);for(;!i.done&&e<Hn;)e+=n,i=t.next(e);return e>=Hn?1/0:e}function Sd(t,e=100,n){const i=n({...t,keyframes:[0,e]}),r=Math.min(qi(i),Hn);return{type:"keyframes",ease:o=>i.next(r*o).value/e,duration:Tt(r)}}const Ed=5;function Eo(t,e,n){const i=Math.max(e-Ed,0);return qs(n-t(i),e-i)}const z={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},zi=.001;function Md({duration:t=z.duration,bounce:e=z.bounce,velocity:n=z.velocity,mass:i=z.mass}){let r,o;Ee(t<=kt(z.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-e;s=$t(z.minDamping,z.maxDamping,s),t=$t(z.minDuration,z.maxDuration,Tt(t)),s<1?(r=c=>{const l=c*s,f=l*t,d=l-n,m=Xi(c,s),p=Math.exp(-f);return zi-d/m*p},o=c=>{const f=c*s*t,d=f*n+n,m=Math.pow(s,2)*Math.pow(c,2)*t,p=Math.exp(-f),T=Xi(Math.pow(c,2),s);return(-r(c)+zi>0?-1:1)*((d-m)*p)/T}):(r=c=>{const l=Math.exp(-c*t),f=(c-n)*t+1;return-zi+l*f},o=c=>{const l=Math.exp(-c*t),f=(n-c)*(t*t);return l*f});const a=5/t,u=Pd(r,o,a);if(t=kt(t),isNaN(u))return{stiffness:z.stiffness,damping:z.damping,duration:t};{const c=Math.pow(u,2)*i;return{stiffness:c,damping:s*2*Math.sqrt(i*c),duration:t}}}const Cd=12;function Pd(t,e,n){let i=n;for(let r=1;r<Cd;r++)i=i-t(i)/e(i);return i}function Xi(t,e){return t*Math.sqrt(1-e*e)}const Ad=["duration","bounce"],Dd=["stiffness","damping","mass"];function Mo(t,e){return e.some(n=>t[n]!==void 0)}function kd(t){let e={velocity:z.velocity,stiffness:z.stiffness,damping:z.damping,mass:z.mass,isResolvedFromDuration:!1,...t};if(!Mo(t,Dd)&&Mo(t,Ad))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,o=2*$t(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:z.mass,stiffness:r,damping:o}}else{const n=Md(t);e={...e,...n,mass:z.mass},e.isResolvedFromDuration=!0}return e}function Gn(t=z.visualDuration,e=z.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:r}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:u,damping:c,mass:l,duration:f,velocity:d,isResolvedFromDuration:m}=kd({...n,velocity:-Tt(n.velocity||0)}),p=d||0,T=c/(2*Math.sqrt(u*l)),x=s-o,y=Tt(Math.sqrt(u/l)),v=Math.abs(x)<5;i||(i=v?z.restSpeed.granular:z.restSpeed.default),r||(r=v?z.restDelta.granular:z.restDelta.default);let w;if(T<1){const E=Xi(y,T);w=V=>{const L=Math.exp(-T*y*V);return s-L*((p+T*y*x)/E*Math.sin(E*V)+x*Math.cos(E*V))}}else if(T===1)w=E=>s-Math.exp(-y*E)*(x+(p+y*x)*E);else{const E=y*Math.sqrt(T*T-1);w=V=>{const L=Math.exp(-T*y*V),D=Math.min(E*V,300);return s-L*((p+T*y*x)*Math.sinh(D)+E*x*Math.cosh(D))/E}}const S={calculatedDuration:m&&f||null,next:E=>{const V=w(E);if(m)a.done=E>=f;else{let L=E===0?p:0;T<1&&(L=E===0?kt(p):Eo(w,E,V));const D=Math.abs(L)<=i,B=Math.abs(s-V)<=r;a.done=D&&B}return a.value=a.done?s:V,a},toString:()=>{const E=Math.min(qi(S),Hn),V=So(L=>S.next(E*L).value,E,30);return E+"ms "+V},toTransition:()=>{}};return S}Gn.applyToOptions=t=>{const e=Sd(t,100,Gn);return t.ease=e.ease,t.duration=kt(e.duration),t.type="keyframes",t};function Ji({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:u,restDelta:c=.5,restSpeed:l}){const f=t[0],d={done:!1,value:f},m=D=>a!==void 0&&D<a||u!==void 0&&D>u,p=D=>a===void 0?u:u===void 0||Math.abs(a-D)<Math.abs(u-D)?a:u;let T=n*e;const x=f+T,y=s===void 0?x:s(x);y!==x&&(T=y-f);const v=D=>-T*Math.exp(-D/i),w=D=>y+v(D),S=D=>{const B=v(D),Z=w(D);d.done=Math.abs(B)<=c,d.value=d.done?y:Z};let E,V;const L=D=>{m(d.value)&&(E=D,V=Gn({keyframes:[d.value,p(d.value)],velocity:Eo(w,D,d.value),damping:r,stiffness:o,restDelta:c,restSpeed:l}))};return L(0),{calculatedDuration:null,next:D=>{let B=!1;return!V&&E===void 0&&(B=!0,S(D),L(D)),E!==void 0&&D>=E?V.next(D-E):(!B&&S(D),d)}}}function Od(t,e,n){const i=[],r=n||Wt.mix||To,o=t.length-1;for(let s=0;s<o;s++){let a=r(t[s],t[s+1]);if(e){const u=Array.isArray(e)?e[s]||wt:e;a=en(u,a)}i.push(a)}return i}function Rd(t,e,{clamp:n=!0,ease:i,mixer:r}={}){const o=t.length;if(Bt(o===e.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const s=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Od(e,i,r),u=a.length,c=l=>{if(s&&l<t[0])return e[0];let f=0;if(u>1)for(;f<t.length-2&&!(l<t[f+1]);f++);const d=nn(t[f],t[f+1],l);return a[f](d)};return n?l=>c($t(t[0],t[o-1],l)):c}function Vd(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const r=nn(0,e,i);t.push(q(n,1,r))}}function Id(t){const e=[0];return Vd(e,t.length-1),e}function Nd(t,e){return t.map(n=>n*e)}function _d(t,e){return t.map(()=>e||ro).splice(0,t.length-1)}function Pe({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const r=qf(i)?i.map(ao):ao(i),o={done:!1,value:e[0]},s=Nd(n&&n.length===e.length?n:Id(e),t),a=Rd(s,e,{ease:Array.isArray(r)?r:_d(e,r)});return{calculatedDuration:t,next:u=>(o.value=a(u),o.done=u>=t,o)}}const Ld=t=>t!==null;function Zi(t,{repeat:e,repeatType:n="loop"},i,r=1){const o=t.filter(Ld),a=r<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!a||i===void 0?o[a]:i}const jd={decay:Ji,inertia:Ji,tween:Pe,keyframes:Pe,spring:Gn};function Co(t){typeof t.type=="string"&&(t.type=jd[t.type])}class Qi{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Fd=t=>t/100;class tr extends Qi{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==pt.now()&&this.tick(pt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Co(e);const{type:n=Pe,repeat:i=0,repeatDelay:r=0,repeatType:o,velocity:s=0}=e;let{keyframes:a}=e;const u=n||Pe;process.env.NODE_ENV!=="production"&&u!==Pe&&Bt(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),u!==Pe&&typeof a[0]!="number"&&(this.mixKeyframes=en(Fd,To(a[0],a[1])),a=[0,100]);const c=u({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=qi(c));const{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(i+1)-r,this.generator=c}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:i,totalDuration:r,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return i.next(0);const{delay:c=0,keyframes:l,repeat:f,repeatType:d,repeatDelay:m,type:p,onUpdate:T,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>r;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let w=this.currentTime,S=i;if(f){const D=Math.min(this.currentTime,r)/a;let B=Math.floor(D),Z=D%1;!Z&&D>=1&&(Z=1),Z===1&&B--,B=Math.min(B,f+1),B%2&&(d==="reverse"?(Z=1-Z,m&&(Z-=m/a)):d==="mirror"&&(S=s)),w=$t(0,1,Z)*a}const E=v?{done:!1,value:l[0]}:S.next(w);o&&(E.value=o(E.value));let{done:V}=E;!v&&u!==null&&(V=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return L&&p!==Ji&&(E.value=Zi(l,this.options,x,this.speed)),T&&T(E.value),L&&this.finish(),E}then(e,n){return this.finished.then(e,n)}get duration(){return Tt(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Tt(e)}get time(){return Tt(this.currentTime)}set time(e){e=kt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(pt.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=Tt(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=Td,startTime:n}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),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=n??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(pt.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(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function $d(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const le=t=>t*180/Math.PI,er=t=>{const e=le(Math.atan2(t[1],t[0]));return nr(e)},Bd={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:er,rotateZ:er,skewX:t=>le(Math.atan(t[1])),skewY:t=>le(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},nr=t=>(t=t%360,t<0&&(t+=360),t),Po=er,Ao=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Do=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Wd={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ao,scaleY:Do,scale:t=>(Ao(t)+Do(t))/2,rotateX:t=>nr(le(Math.atan2(t[6],t[5]))),rotateY:t=>nr(le(Math.atan2(-t[2],t[0]))),rotateZ:Po,rotate:Po,skewX:t=>le(Math.atan(t[4])),skewY:t=>le(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ir(t){return t.includes("scale")?1:0}function rr(t,e){if(!t||t==="none")return ir(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,r;if(n)i=Wd,r=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Bd,r=a}if(!r)return ir(e);const o=i[e],s=r[1].split(",").map(Yd);return typeof o=="function"?o(s):s[o]}const Ud=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return rr(n,e)};function Yd(t){return parseFloat(t.trim())}const Ae=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],De=new Set(Ae),ko=t=>t===Me||t===k,Hd=new Set(["x","y","z"]),Gd=Ae.filter(t=>!Hd.has(t));function Kd(t){const e=[];return Gd.forEach(n=>{const i=t.getValue(n);i!==void 0&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}const fe={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>rr(e,"x"),y:(t,{transform:e})=>rr(e,"y")};fe.translateX=fe.x,fe.translateY=fe.y;const de=new Set;let sr=!1,or=!1,ar=!1;function Oo(){if(or){const t=Array.from(de).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),n=new Map;e.forEach(i=>{const r=Kd(i);r.length&&(n.set(i,r),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([o,s])=>{i.getValue(o)?.set(s)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}or=!1,sr=!1,de.forEach(t=>t.complete(ar)),de.clear()}function Ro(){de.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(or=!0)})}function qd(){ar=!0,Ro(),Oo(),ar=!1}class ur{constructor(e,n,i,r,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=i,this.motionValue=r,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(de.add(this),sr||(sr=!0,K.read(Ro),K.resolveKeyframes(Oo))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:i,motionValue:r}=this;if(e[0]===null){const o=r?.get(),s=e[e.length-1];if(o!==void 0)e[0]=o;else if(i&&n){const a=i.readValue(n,s);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=s),r&&o===void 0&&r.set(e[0])}$d(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),de.delete(this)}cancel(){this.state==="scheduled"&&(de.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const zd=t=>t.startsWith("--");function Xd(t,e,n){zd(e)?t.style.setProperty(e,n):t.style[e]=n}const Jd=Vi(()=>window.ScrollTimeline!==void 0),Zd={};function Qd(t,e){const n=Vi(t);return()=>Zd[e]??n()}const Vo=Qd(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),cn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Io={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cn([0,.65,.55,1]),circOut:cn([.55,0,1,.45]),backIn:cn([.31,.01,.66,-.59]),backOut:cn([.33,1.53,.69,.99])};function No(t,e){if(t)return typeof t=="function"?Vo()?So(t,e):"ease-out":so(t)?cn(t):Array.isArray(t)?t.map(n=>No(n,e)||Io.easeOut):Io[t]}function th(t,e,n,{delay:i=0,duration:r=300,repeat:o=0,repeatType:s="loop",ease:a="easeOut",times:u}={},c=void 0){const l={[e]:n};u&&(l.offset=u);const f=No(a,r);Array.isArray(f)&&(l.easing=f);const d={delay:i,duration:r,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(l,d)}function _o(t){return typeof t=="function"&&"applyToOptions"in t}function eh({type:t,...e}){return _o(t)&&Vo()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class nh extends Qi{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:i,keyframes:r,pseudoElement:o,allowFlatten:s=!1,finalKeyframe:a,onComplete:u}=e;this.isPseudoElement=!!o,this.allowFlatten=s,this.options=e,Bt(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=eh(e);this.animation=th(n,i,r,c,o),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const l=Zi(r,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(l):Xd(n,i,l),this.animation.cancel()}u?.(),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:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return Tt(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Tt(e)}get time(){return Tt(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=kt(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Jd()?(this.animation.timeline=e,wt):n(this)}}const Lo={anticipate:eo,backInOut:to,circInOut:io};function ih(t){return t in Lo}function rh(t){typeof t.ease=="string"&&ih(t.ease)&&(t.ease=Lo[t.ease])}const jo=10;class sh extends nh{constructor(e){rh(e),Co(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:i,onComplete:r,element:o,...s}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new tr({...s,autoplay:!1}),u=kt(this.finishedTime??this.time);n.setWithVelocity(a.sample(u-jo).value,a.sample(u).value,jo),a.stop()}}const Fo=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Jt.test(t)||t==="0")&&!t.startsWith("url("));function oh(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function ah(t,e,n,i){const r=t[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],s=Fo(r,e),a=Fo(o,e);return Ee(s===a,`You are trying to animate ${e} from "${r}" to "${o}". "${s?o:r}" is not an animatable value.`,"value-not-animatable"),!s||!a?!1:oh(t)||(n==="spring"||_o(n))&&i}function cr(t){t.duration=0,t.type="keyframes"}const uh=new Set(["opacity","clipPath","filter","transform"]),ch=Vi(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function lh(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:r,damping:o,type:s}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:c}=e.owner.getProps();return ch()&&n&&uh.has(n)&&(n!=="transform"||!c)&&!u&&!i&&r!=="mirror"&&o!==0&&s!=="inertia"}const fh=40;class dh extends Qi{constructor({autoplay:e=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:s="loop",keyframes:a,name:u,motionValue:c,element:l,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=pt.now();const d={autoplay:e,delay:n,type:i,repeat:r,repeatDelay:o,repeatType:s,name:u,motionValue:c,element:l,...f},m=l?.KeyframeResolver||ur;this.keyframeResolver=new m(a,(p,T,x)=>this.onKeyframesResolved(p,T,d,!x),u,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,r){this.keyframeResolver=void 0;const{name:o,type:s,velocity:a,delay:u,isHandoff:c,onUpdate:l}=i;this.resolvedAt=pt.now(),ah(e,o,s,a)||((Wt.instantAnimations||!u)&&l?.(Zi(e,i,n)),e[0]=e[e.length-1],cr(i),i.repeat=0);const d={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>fh?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},m=!c&&lh(d)?new sh({...d,element:d.motionValue.owner.current}):new tr(d);m.finished.then(()=>this.notifyFinished()).catch(wt),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),qd()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const hh=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function mh(t){const e=hh.exec(t);if(!e)return[,];const[,n,i,r]=e;return[`--${n??i}`,r]}const ph=4;function $o(t,e,n=1){Bt(n<=ph,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,r]=mh(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const s=o.trim();return Hs(s)?parseFloat(s):s}return Fi(r)?$o(r,e,n+1):r}function lr(t,e){return t?.[e]??t?.default??t}const Bo=new Set(["width","height","top","left","right","bottom",...Ae]),gh={test:t=>t==="auto",parse:t=>t},Wo=t=>e=>e.test(t),Uo=[Me,k,Nt,Xt,od,sd,gh],Yo=t=>Uo.find(Wo(t));function yh(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Ks(t):!0}const vh=new Set(["brightness","contrast","saturate","opacity"]);function xh(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=n.match($i)||[];if(!i)return t;const r=n.replace(i,"");let o=vh.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+r+")"}const bh=/\b([a-z-]*)\(.*?\)/gu,fr={...Jt,getAnimatableNone:t=>{const e=t.match(bh);return e?e.map(xh).join(" "):t}},Ho={...Me,transform:Math.round},dr={borderWidth:k,borderTopWidth:k,borderRightWidth:k,borderBottomWidth:k,borderLeftWidth:k,borderRadius:k,radius:k,borderTopLeftRadius:k,borderTopRightRadius:k,borderBottomRightRadius:k,borderBottomLeftRadius:k,width:k,maxWidth:k,height:k,maxHeight:k,top:k,right:k,bottom:k,left:k,padding:k,paddingTop:k,paddingRight:k,paddingBottom:k,paddingLeft:k,margin:k,marginTop:k,marginRight:k,marginBottom:k,marginLeft:k,backgroundPositionX:k,backgroundPositionY:k,...{rotate:Xt,rotateX:Xt,rotateY:Xt,rotateZ:Xt,scale:Un,scaleX:Un,scaleY:Un,scaleZ:Un,skew:Xt,skewX:Xt,skewY:Xt,distance:k,translateX:k,translateY:k,translateZ:k,x:k,y:k,z:k,perspective:k,transformPerspective:k,opacity:sn,originX:ho,originY:ho,originZ:k},zIndex:Ho,fillOpacity:sn,strokeOpacity:sn,numOctaves:Ho},wh={...dr,color:et,backgroundColor:et,outlineColor:et,fill:et,stroke:et,borderColor:et,borderTopColor:et,borderRightColor:et,borderBottomColor:et,borderLeftColor:et,filter:fr,WebkitFilter:fr},Go=t=>wh[t];function Ko(t,e){let n=Go(t);return n!==fr&&(n=Jt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Th=new Set(["auto","none","0"]);function Sh(t,e,n){let i=0,r;for(;i<t.length&&!r;){const o=t[i];typeof o=="string"&&!Th.has(o)&&un(o).values.length&&(r=t[i]),i++}if(r&&n)for(const o of e)t[o]=Ko(n,r)}class Eh extends ur{constructor(e,n,i,r,o){super(e,n,i,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let c=e[u];if(typeof c=="string"&&(c=c.trim(),Fi(c))){const l=$o(c,n.current);l!==void 0&&(e[u]=l),u===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Bo.has(i)||e.length!==2)return;const[r,o]=e,s=Yo(r),a=Yo(o);if(s!==a)if(ko(s)&&ko(a))for(let u=0;u<e.length;u++){const c=e[u];typeof c=="string"&&(e[u]=parseFloat(c))}else fe[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,i=[];for(let r=0;r<e.length;r++)(e[r]===null||yh(e[r]))&&i.push(r);i.length&&Sh(e,i,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=fe[i](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&e.getValue(i,r).jump(r,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,s=i[o];i[o]=fe[n](e.measureViewportBox(),window.getComputedStyle(e.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,u])=>{e.getValue(a).set(u)}),this.resolveNoneKeyframes()}}function Mh(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let i=document;const r=n?.[t]??i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}const qo=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Ch(t){return Gs(t)&&"offsetHeight"in t}const zo=30,Ph=t=>!isNaN(parseFloat(t));class Ah{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const r=pt.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=pt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Ph(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&Ni(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Ii);const i=this.events[e].add(n);return e==="change"?()=>{i(),K.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=pt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>zo)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,zo);return qs(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),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 ke(t,e){return new Ah(t,e)}const{schedule:hr}=uo(queueMicrotask,!1),Ot={x:!1,y:!1};function Xo(){return Ot.x||Ot.y}function Dh(t){return t==="x"||t==="y"?Ot[t]?null:(Ot[t]=!0,()=>{Ot[t]=!1}):Ot.x||Ot.y?null:(Ot.x=Ot.y=!0,()=>{Ot.x=Ot.y=!1})}function Jo(t,e){const n=Mh(t),i=new AbortController,r={passive:!0,...e,signal:i.signal};return[n,r,()=>i.abort()]}function Zo(t){return!(t.pointerType==="touch"||Xo())}function kh(t,e,n={}){const[i,r,o]=Jo(t,n),s=a=>{if(!Zo(a))return;const{target:u}=a,c=e(u,a);if(typeof c!="function"||!u)return;const l=f=>{Zo(f)&&(c(f),u.removeEventListener("pointerleave",l))};u.addEventListener("pointerleave",l,r)};return i.forEach(a=>{a.addEventListener("pointerenter",s,r)}),o}const Qo=(t,e)=>e?t===e?!0:Qo(t,e.parentElement):!1,mr=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Oh=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Rh(t){return Oh.has(t.tagName)||t.tabIndex!==-1}const Kn=new WeakSet;function ta(t){return e=>{e.key==="Enter"&&t(e)}}function pr(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Vh=(t,e)=>{const n=t.currentTarget;if(!n)return;const i=ta(()=>{if(Kn.has(n))return;pr(n,"down");const r=ta(()=>{pr(n,"up")}),o=()=>pr(n,"cancel");n.addEventListener("keyup",r,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function ea(t){return mr(t)&&!Xo()}function Ih(t,e,n={}){const[i,r,o]=Jo(t,n),s=a=>{const u=a.currentTarget;if(!ea(a))return;Kn.add(u);const c=e(u,a),l=(m,p)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),Kn.has(u)&&Kn.delete(u),ea(m)&&typeof c=="function"&&c(m,{success:p})},f=m=>{l(m,u===window||u===document||n.useGlobalTarget||Qo(u,m.target))},d=m=>{l(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",d,r)};return i.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,r),Ch(a)&&(a.addEventListener("focus",c=>Vh(c,r)),!Rh(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function na(t){return Gs(t)&&"ownerSVGElement"in t}function Nh(t){return na(t)&&t.tagName==="svg"}const ct=t=>!!(t&&t.getVelocity),_h=[...Uo,et,Jt],Lh=t=>_h.find(Wo(t)),ia=C.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function jh(t=!0){const e=C.useContext(Di);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=e,o=C.useId();C.useEffect(()=>{if(t)return r(o)},[t]);const s=C.useCallback(()=>t&&i&&i(o),[o,i,t]);return!n&&i?[!1,s]:[!0]}const ra=C.createContext({strict:!1}),sa={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"]},Oe={};for(const t in sa)Oe[t]={isEnabled:e=>sa[t].some(n=>!!e[n])};function Fh(t){for(const e in t)Oe[e]={...Oe[e],...t[e]}}const $h=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 qn(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||$h.has(t)}let oa=t=>!qn(t);function Bh(t){typeof t=="function"&&(oa=e=>e.startsWith("on")?!qn(e):t(e))}try{Bh(require("@emotion/is-prop-valid").default)}catch{}function Wh(t,e,n){const i={};for(const r in t)r==="values"&&typeof t.values=="object"||(oa(r)||n===!0&&qn(r)||!e&&!qn(r)||t.draggable&&r.startsWith("onDrag"))&&(i[r]=t[r]);return i}const zn=C.createContext({});function Xn(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function ln(t){return typeof t=="string"||Array.isArray(t)}const gr=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],yr=["initial",...gr];function Jn(t){return Xn(t.animate)||yr.some(e=>ln(t[e]))}function aa(t){return!!(Jn(t)||t.variants)}function Uh(t,e){if(Jn(t)){const{initial:n,animate:i}=t;return{initial:n===!1||ln(n)?n:void 0,animate:ln(i)?i:void 0}}return t.inherit!==!1?e:{}}function Yh(t){const{initial:e,animate:n}=Uh(t,C.useContext(zn));return C.useMemo(()=>({initial:e,animate:n}),[ua(e),ua(n)])}function ua(t){return Array.isArray(t)?t.join(" "):t}function ca(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const fn={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(k.test(t))t=parseFloat(t);else return t;const n=ca(t,e.target.x),i=ca(t,e.target.y);return`${n}% ${i}%`}},Hh={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,r=Jt.parse(t);if(r.length>5)return i;const o=Jt.createTransformer(t),s=typeof r[0]!="number"?1:0,a=n.x.scale*e.x,u=n.y.scale*e.y;r[0+s]/=a,r[1+s]/=u;const c=q(a,u,.5);return typeof r[2+s]=="number"&&(r[2+s]/=c),typeof r[3+s]=="number"&&(r[3+s]/=c),o(r)}},vr={borderRadius:{...fn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fn,borderTopRightRadius:fn,borderBottomLeftRadius:fn,borderBottomRightRadius:fn,boxShadow:Hh};function la(t,{layout:e,layoutId:n}){return De.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!vr[t]||t==="opacity")}const Gh={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Kh=Ae.length;function qh(t,e,n){let i="",r=!0;for(let o=0;o<Kh;o++){const s=Ae[o],a=t[s];if(a===void 0)continue;let u=!0;if(typeof a=="number"?u=a===(s.startsWith("scale")?1:0):u=parseFloat(a)===0,!u||n){const c=qo(a,dr[s]);if(!u){r=!1;const l=Gh[s]||s;i+=`${l}(${c}) `}n&&(e[s]=c)}}return i=i.trim(),n?i=n(e,r?"":i):r&&(i="none"),i}function xr(t,e,n){const{style:i,vars:r,transformOrigin:o}=t;let s=!1,a=!1;for(const u in e){const c=e[u];if(De.has(u)){s=!0;continue}else if(lo(u)){r[u]=c;continue}else{const l=qo(c,dr[u]);u.startsWith("origin")?(a=!0,o[u]=l):i[u]=l}}if(e.transform||(s||n?i.transform=qh(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:u="50%",originY:c="50%",originZ:l=0}=o;i.transformOrigin=`${u} ${c} ${l}`}}const br=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function fa(t,e,n){for(const i in e)!ct(e[i])&&!la(i,n)&&(t[i]=e[i])}function zh({transformTemplate:t},e){return C.useMemo(()=>{const n=br();return xr(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Xh(t,e){const n=t.style||{},i={};return fa(i,n,t),Object.assign(i,zh(t,e)),i}function Jh(t,e){const n={},i=Xh(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const Zh={offset:"stroke-dashoffset",array:"stroke-dasharray"},Qh={offset:"strokeDashoffset",array:"strokeDasharray"};function tm(t,e,n=1,i=0,r=!0){t.pathLength=1;const o=r?Zh:Qh;t[o.offset]=k.transform(-i);const s=k.transform(e),a=k.transform(n);t[o.array]=`${s} ${a}`}function da(t,{attrX:e,attrY:n,attrScale:i,pathLength:r,pathSpacing:o=1,pathOffset:s=0,...a},u,c,l){if(xr(t,a,c),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:d}=t;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=l?.transformBox??"fill-box",delete f.transformBox),e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),i!==void 0&&(f.scale=i),r!==void 0&&tm(f,r,o,s,!1)}const ha=()=>({...br(),attrs:{}}),ma=t=>typeof t=="string"&&t.toLowerCase()==="svg";function em(t,e,n,i){const r=C.useMemo(()=>{const o=ha();return da(o,e,ma(i),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};fa(o,t.style,t),r.style={...o,...r.style}}return r}const nm=["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 wr(t){return typeof t!="string"||t.includes("-")?!1:!!(nm.indexOf(t)>-1||/[A-Z]/u.test(t))}function im(t,e,n,{latestValues:i},r,o=!1){const a=(wr(t)?em:Jh)(e,i,r,t),u=Wh(e,typeof t=="string",o),c=t!==C.Fragment?{...u,...a,ref:n}:{},{children:l}=e,f=C.useMemo(()=>ct(l)?l.get():l,[l]);return C.createElement(t,{...c,children:f})}function pa(t){const e=[{},{}];return t?.values.forEach((n,i)=>{e[0][i]=n.get(),e[1][i]=n.getVelocity()}),e}function Tr(t,e,n,i){if(typeof e=="function"){const[r,o]=pa(i);e=e(n!==void 0?n:t.custom,r,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[r,o]=pa(i);e=e(n!==void 0?n:t.custom,r,o)}return e}function Zn(t){return ct(t)?t.get():t}function rm({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,r){return{latestValues:sm(n,i,r,t),renderState:e()}}function sm(t,e,n,i){const r={},o=i(t,{});for(const d in o)r[d]=Zn(o[d]);let{initial:s,animate:a}=t;const u=Jn(t),c=aa(t);e&&c&&!u&&t.inherit!==!1&&(s===void 0&&(s=e.initial),a===void 0&&(a=e.animate));let l=n?n.initial===!1:!1;l=l||s===!1;const f=l?a:s;if(f&&typeof f!="boolean"&&!Xn(f)){const d=Array.isArray(f)?f:[f];for(let m=0;m<d.length;m++){const p=Tr(t,d[m]);if(p){const{transitionEnd:T,transition:x,...y}=p;for(const v in y){let w=y[v];if(Array.isArray(w)){const S=l?w.length-1:0;w=w[S]}w!==null&&(r[v]=w)}for(const v in T)r[v]=T[v]}}}return r}const ga=t=>(e,n)=>{const i=C.useContext(zn),r=C.useContext(Di),o=()=>rm(t,e,i,r);return n?o():$f(o)};function Sr(t,e,n){const{style:i}=t,r={};for(const o in i)(ct(i[o])||e.style&&ct(e.style[o])||la(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=i[o]);return r}const om=ga({scrapeMotionValuesFromProps:Sr,createRenderState:br});function ya(t,e,n){const i=Sr(t,e,n);for(const r in t)if(ct(t[r])||ct(e[r])){const o=Ae.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[o]=t[r]}return i}const am=ga({scrapeMotionValuesFromProps:ya,createRenderState:ha}),um=Symbol.for("motionComponentSymbol");function Re(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function cm(t,e,n){return C.useCallback(i=>{i&&t.onMount&&t.onMount(i),e&&(i?e.mount(i):e.unmount()),n&&(typeof n=="function"?n(i):Re(n)&&(n.current=i))},[e])}const Er=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),va="data-"+Er("framerAppearId"),xa=C.createContext({});function lm(t,e,n,i,r){const{visualElement:o}=C.useContext(zn),s=C.useContext(ra),a=C.useContext(Di),u=C.useContext(ia).reducedMotion,c=C.useRef(null);i=i||s.renderer,!c.current&&i&&(c.current=i(t,{visualState:e,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:u}));const l=c.current,f=C.useContext(xa);l&&!l.projection&&r&&(l.type==="html"||l.type==="svg")&&fm(c.current,n,r,f);const d=C.useRef(!1);C.useInsertionEffect(()=>{l&&d.current&&l.update(n,a)});const m=n[va],p=C.useRef(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return Bf(()=>{l&&(d.current=!0,window.MotionIsMounted=!0,l.updateFeatures(),l.scheduleRenderMicrotask(),p.current&&l.animationState&&l.animationState.animateChanges())}),C.useEffect(()=>{l&&(!p.current&&l.animationState&&l.animationState.animateChanges(),p.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(m)}),p.current=!1),l.enteringChildren=void 0)}),l}function fm(t,e,n,i){const{layoutId:r,layout:o,drag:s,dragConstraints:a,layoutScroll:u,layoutRoot:c,layoutCrossfade:l}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:ba(t.parent)),t.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!s||a&&Re(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:l,layoutScroll:u,layoutRoot:c})}function ba(t){if(t)return t.options.allowProjection!==!1?t.projection:ba(t.parent)}function Mr(t,{forwardMotionProps:e=!1}={},n,i){n&&Fh(n);const r=wr(t)?am:om;function o(a,u){let c;const l={...C.useContext(ia),...a,layoutId:dm(a)},{isStatic:f}=l,d=Yh(a),m=r(a,f);if(!f&&Ai){hm(l,n);const p=mm(l);c=p.MeasureLayout,d.visualElement=lm(t,m,l,i,p.ProjectionNode)}return P.jsxs(zn.Provider,{value:d,children:[c&&d.visualElement?P.jsx(c,{visualElement:d.visualElement,...l}):null,im(t,a,cm(m,d.visualElement,u),m,f,e)]})}o.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const s=C.forwardRef(o);return s[um]=t,s}function dm({layoutId:t}){const e=C.useContext(Ys).id;return e&&t!==void 0?e+"-"+t:t}function hm(t,e){const n=C.useContext(ra).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const i="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?Ee(!1,i,"lazy-strict-mode"):Bt(!1,i,"lazy-strict-mode")}}function mm(t){const{drag:e,layout:n}=Oe;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function pm(t,e){if(typeof Proxy>"u")return Mr;const n=new Map,i=(o,s)=>Mr(o,s,t,e),r=(o,s)=>(process.env.NODE_ENV!=="production"&&Ni(!1,"motion() is deprecated. Use motion.create() instead."),i(o,s));return new Proxy(r,{get:(o,s)=>s==="create"?i:(n.has(s)||n.set(s,Mr(s,void 0,t,e)),n.get(s))})}function wa({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function gm({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function ym(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function Cr(t){return t===void 0||t===1}function Pr({scale:t,scaleX:e,scaleY:n}){return!Cr(t)||!Cr(e)||!Cr(n)}function he(t){return Pr(t)||Ta(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ta(t){return Sa(t.x)||Sa(t.y)}function Sa(t){return t&&t!=="0%"}function Qn(t,e,n){const i=t-n,r=e*i;return n+r}function Ea(t,e,n,i,r){return r!==void 0&&(t=Qn(t,r,i)),Qn(t,n,i)+e}function Ar(t,e=0,n=1,i,r){t.min=Ea(t.min,e,n,i,r),t.max=Ea(t.max,e,n,i,r)}function Ma(t,{x:e,y:n}){Ar(t.x,e.translate,e.scale,e.originPoint),Ar(t.y,n.translate,n.scale,n.originPoint)}const Ca=.999999999999,Pa=1.0000000000001;function vm(t,e,n,i=!1){const r=n.length;if(!r)return;e.x=e.y=1;let o,s;for(let a=0;a<r;a++){o=n[a],s=o.projectionDelta;const{visualElement:u}=o.options;u&&u.props.style&&u.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Ie(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(e.x*=s.x.scale,e.y*=s.y.scale,Ma(t,s)),i&&he(o.latestValues)&&Ie(t,o.latestValues))}e.x<Pa&&e.x>Ca&&(e.x=1),e.y<Pa&&e.y>Ca&&(e.y=1)}function Ve(t,e){t.min=t.min+e,t.max=t.max+e}function Aa(t,e,n,i,r=.5){const o=q(t.min,t.max,r);Ar(t,e,n,o,i)}function Ie(t,e){Aa(t.x,e.x,e.scaleX,e.scale,e.originX),Aa(t.y,e.y,e.scaleY,e.scale,e.originY)}function Da(t,e){return wa(ym(t.getBoundingClientRect(),e))}function xm(t,e,n){const i=Da(t,n),{scroll:r}=e;return r&&(Ve(i.x,r.offset.x),Ve(i.y,r.offset.y)),i}const ka=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ne=()=>({x:ka(),y:ka()}),Oa=()=>({min:0,max:0}),rt=()=>({x:Oa(),y:Oa()}),Dr={current:null},Ra={current:!1};function bm(){if(Ra.current=!0,!!Ai)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Dr.current=t.matches;t.addEventListener("change",e),e()}else Dr.current=!1}const wm=new WeakMap;function Tm(t,e,n){for(const i in e){const r=e[i],o=n[i];if(ct(r))t.addValue(i,r);else if(ct(o))t.addValue(i,ke(r,{owner:t}));else if(o!==r)if(t.hasValue(i)){const s=t.getValue(i);s.liveStyle===!0?s.jump(r):s.hasAnimated||s.set(r)}else{const s=t.getStaticValue(i);t.addValue(i,ke(s!==void 0?s:r,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const Va=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Sm{scrapeMotionValuesFromProps(e,n,i){return{}}constructor({parent:e,props:n,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:o,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ur,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 d=pt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,K.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=s;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Jn(n),this.isVariantNode=aa(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:l,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const m=f[d];u[d]!==void 0&&ct(m)&&m.set(u[d])}}mount(e){this.current=e,wm.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),Ra.current||bm(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Dr.current,process.env.NODE_ENV!=="production"&&Ni(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),zt(this.notifyUpdate),zt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const i=De.has(e);i&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",s=>{this.latestValues[e]=s,this.props.onUpdate&&K.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{r(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Oe){const n=Oe[e];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[e]&&r&&i(this.props)&&(this.features[e]=new r(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):rt()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<Va.length;i++){const r=Va[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const o="on"+r,s=e[o];s&&(this.propEventSubscriptions[r]=this.on(r,s))}this.prevMotionValues=Tm(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const i=this.values.get(e);n!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&n!==void 0&&(i=ke(n===null?void 0:n,{owner:this}),this.addValue(e,i)),i}readValue(e,n){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Hs(i)||Ks(i))?i=parseFloat(i):!Lh(i)&&Jt.test(n)&&(i=Ko(e,n)),this.setBaseTarget(e,ct(i)?i.get():i)),ct(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=Tr(this.props,n,this.presenceContext?.custom);o&&(i=o[e])}if(n&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!ct(r)?r:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Ii),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){hr.render(this.render)}}class Ia extends Sm{constructor(){super(...arguments),this.KeyframeResolver=Eh}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:i}){delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ct(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Na(t,{style:e,vars:n},i,r){const o=t.style;let s;for(s in e)o[s]=e[s];r?.applyProjectionStyles(o,i);for(s in n)o.setProperty(s,n[s])}function Em(t){return window.getComputedStyle(t)}class Mm extends Ia{constructor(){super(...arguments),this.type="html",this.renderInstance=Na}readValueFromInstance(e,n){if(De.has(n))return this.projection?.isProjecting?ir(n):Ud(e,n);{const i=Em(e),r=(lo(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Da(e,n)}build(e,n,i){xr(e,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,i){return Sr(e,n,i)}}const _a=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 Cm(t,e,n,i){Na(t,e,void 0,i);for(const r in e.attrs)t.setAttribute(_a.has(r)?r:Er(r),e.attrs[r])}class Pm extends Ia{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=rt}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(De.has(n)){const i=Go(n);return i&&i.default||0}return n=_a.has(n)?n:Er(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,i){return ya(e,n,i)}build(e,n,i){da(e,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,n,i,r){Cm(e,n,i,r)}mount(e){this.isSVGTag=ma(e.tagName),super.mount(e)}}const Am=(t,e)=>wr(t)?new Pm(e):new Mm(e,{allowProjection:t!==C.Fragment});function _e(t,e,n){const i=t.getProps();return Tr(i,e,n!==void 0?n:i.custom,t)}const kr=t=>Array.isArray(t);function Dm(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ke(n))}function km(t){return kr(t)?t[t.length-1]||0:t}function Om(t,e){const n=_e(t,e);let{transitionEnd:i={},transition:r={},...o}=n||{};o={...o,...i};for(const s in o){const a=km(o[s]);Dm(t,s,a)}}function Rm(t){return!!(ct(t)&&t.add)}function Or(t,e){const n=t.getValue("willChange");if(Rm(n))return n.add(e);if(!n&&Wt.WillChange){const i=new Wt.WillChange("auto");t.addValue("willChange",i),i.add(e)}}function La(t){return t.props[va]}const Vm=t=>t!==null;function Im(t,{repeat:e,repeatType:n="loop"},i){const r=t.filter(Vm),o=e&&n!=="loop"&&e%2===1?0:r.length-1;return r[o]}const Nm={type:"spring",stiffness:500,damping:25,restSpeed:10},_m=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Lm={type:"keyframes",duration:.8},jm={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fm=(t,{keyframes:e})=>e.length>2?Lm:De.has(t)?t.startsWith("scale")?_m(e[1]):Nm:jm;function $m({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:o,repeatType:s,repeatDelay:a,from:u,elapsed:c,...l}){return!!Object.keys(l).length}const Rr=(t,e,n,i={},r,o)=>s=>{const a=lr(i,t)||{},u=a.delay||i.delay||0;let{elapsed:c=0}=i;c=c-kt(u);const l={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:r};$m(a)||Object.assign(l,Fm(t,l)),l.duration&&(l.duration=kt(l.duration)),l.repeatDelay&&(l.repeatDelay=kt(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let f=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(cr(l),l.delay===0&&(f=!0)),(Wt.instantAnimations||Wt.skipAnimations)&&(f=!0,cr(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,f&&!o&&e.get()!==void 0){const d=Im(l.keyframes,a);if(d!==void 0){K.update(()=>{l.onUpdate(d),l.onComplete()});return}}return a.isSync?new tr(l):new dh(l)};function Bm({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,i}function ja(t,e,{delay:n=0,transitionOverride:i,type:r}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:s,...a}=e;i&&(o=i);const u=[],c=r&&t.animationState&&t.animationState.getState()[r];for(const l in a){const f=t.getValue(l,t.latestValues[l]??null),d=a[l];if(d===void 0||c&&Bm(c,l))continue;const m={delay:n,...lr(o||{},l)},p=f.get();if(p!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===p&&!m.velocity)continue;let T=!1;if(window.MotionHandoffAnimation){const y=La(t);if(y){const v=window.MotionHandoffAnimation(y,l,K);v!==null&&(m.startTime=v,T=!0)}}Or(t,l),f.start(Rr(l,f,d,t.shouldReduceMotion&&Bo.has(l)?{type:!1}:m,t,T));const x=f.animation;x&&u.push(x)}return s&&Promise.all(u).then(()=>{K.update(()=>{s&&Om(t,s)})}),u}function Fa(t,e,n,i=0,r=1){const o=Array.from(t).sort((c,l)=>c.sortNodePosition(l)).indexOf(e),s=t.size,a=(s-1)*i;return typeof n=="function"?n(o,s):r===1?o*i:a-o*i}function Vr(t,e,n={}){const i=_e(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const o=i?()=>Promise.all(ja(t,i,n)):()=>Promise.resolve(),s=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:l,staggerDirection:f}=r;return Wm(t,e,u,c,l,f,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[u,c]=a==="beforeChildren"?[o,s]:[s,o];return u().then(()=>c())}else return Promise.all([o(),s(n.delay)])}function Wm(t,e,n=0,i=0,r=0,o=1,s){const a=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),a.push(Vr(u,e,{...s,delay:n+(typeof i=="function"?0:i)+Fa(t.variantChildren,u,i,r,o)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(a)}function Um(t,e,n={}){t.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(o=>Vr(t,o,n));i=Promise.all(r)}else if(typeof e=="string")i=Vr(t,e,n);else{const r=typeof e=="function"?_e(t,e,n.custom):e;i=Promise.all(ja(t,r,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}function $a(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const Ym=yr.length;function Ba(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Ba(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Ym;n++){const i=yr[n],r=t.props[i];(ln(r)||r===!1)&&(e[i]=r)}return e}const Hm=[...gr].reverse(),Gm=gr.length;function Km(t){return e=>Promise.all(e.map(({animation:n,options:i})=>Um(t,n,i)))}function qm(t){let e=Km(t),n=Wa(),i=!0;const r=u=>(c,l)=>{const f=_e(t,l,u==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:m,...p}=f;c={...c,...p,...m}}return c};function o(u){e=u(t)}function s(u){const{props:c}=t,l=Ba(t.parent)||{},f=[],d=new Set;let m={},p=1/0;for(let x=0;x<Gm;x++){const y=Hm[x],v=n[y],w=c[y]!==void 0?c[y]:l[y],S=ln(w),E=y===u?v.isActive:null;E===!1&&(p=x);let V=w===l[y]&&w!==c[y]&&S;if(V&&i&&t.manuallyAnimateOnMount&&(V=!1),v.protectedKeys={...m},!v.isActive&&E===null||!w&&!v.prevProp||Xn(w)||typeof w=="boolean")continue;const L=zm(v.prevProp,w);let D=L||y===u&&v.isActive&&!V&&S||x>p&&S,B=!1;const Z=Array.isArray(w)?w:[w];let R=Z.reduce(r(y),{});E===!1&&(R={});const{prevResolvedValues:Q={}}=v,j={...Q,...R},X=W=>{D=!0,d.has(W)&&(B=!0,d.delete(W)),v.needsAnimating[W]=!0;const J=t.getValue(W);J&&(J.liveStyle=!1)};for(const W in j){const J=R[W],U=Q[W];if(m.hasOwnProperty(W))continue;let at=!1;kr(J)&&kr(U)?at=!$a(J,U):at=J!==U,at?J!=null?X(W):d.add(W):J!==void 0&&d.has(W)?X(W):v.protectedKeys[W]=!0}v.prevProp=w,v.prevResolvedValues=R,v.isActive&&(m={...m,...R}),i&&t.blockInitialAnimation&&(D=!1);const gt=V&&L;D&&(!gt||B)&&f.push(...Z.map(W=>{const J={type:y};if(typeof W=="string"&&i&&!gt&&t.manuallyAnimateOnMount&&t.parent){const{parent:U}=t,at=_e(U,W);if(U.enteringChildren&&at){const{delayChildren:_t}=at.transition||{};J.delay=Fa(U.enteringChildren,t,_t)}}return{animation:W,options:J}}))}if(d.size){const x={};if(typeof c.initial!="boolean"){const y=_e(t,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(x.transition=y.transition)}d.forEach(y=>{const v=t.getBaseTarget(y),w=t.getValue(y);w&&(w.liveStyle=!0),x[y]=v??null}),f.push({animation:x})}let T=!!f.length;return i&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(T=!1),i=!1,T?e(f):Promise.resolve()}function a(u,c){if(n[u].isActive===c)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(u,c)),n[u].isActive=c;const l=s(u);for(const f in n)n[f].protectedKeys={};return l}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Wa()}}}function zm(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!$a(e,t):!1}function me(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Wa(){return{animate:me(!0),whileInView:me(),whileHover:me(),whileTap:me(),whileDrag:me(),whileFocus:me(),exit:me()}}class Zt{constructor(e){this.isMounted=!1,this.node=e}update(){}}class Xm extends Zt{constructor(e){super(e),e.animationState||(e.animationState=qm(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Xn(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Jm=0;class Zm extends Zt{constructor(){super(...arguments),this.id=Jm++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const r=this.node.animationState.setActive("exit",!e);n&&!e&&r.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Qm={animation:{Feature:Xm},exit:{Feature:Zm}};function dn(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function hn(t){return{point:{x:t.pageX,y:t.pageY}}}const tp=t=>e=>mr(e)&&t(e,hn(e));function mn(t,e,n,i){return dn(t,e,tp(n),i)}const Ua=1e-4,ep=1-Ua,np=1+Ua,Ya=.01,ip=0-Ya,rp=0+Ya;function dt(t){return t.max-t.min}function sp(t,e,n){return Math.abs(t-e)<=n}function Ha(t,e,n,i=.5){t.origin=i,t.originPoint=q(e.min,e.max,t.origin),t.scale=dt(n)/dt(e),t.translate=q(n.min,n.max,t.origin)-t.originPoint,(t.scale>=ep&&t.scale<=np||isNaN(t.scale))&&(t.scale=1),(t.translate>=ip&&t.translate<=rp||isNaN(t.translate))&&(t.translate=0)}function pn(t,e,n,i){Ha(t.x,e.x,n.x,i?i.originX:void 0),Ha(t.y,e.y,n.y,i?i.originY:void 0)}function Ga(t,e,n){t.min=n.min+e.min,t.max=t.min+dt(e)}function op(t,e,n){Ga(t.x,e.x,n.x),Ga(t.y,e.y,n.y)}function Ka(t,e,n){t.min=e.min-n.min,t.max=t.min+dt(e)}function ti(t,e,n){Ka(t.x,e.x,n.x),Ka(t.y,e.y,n.y)}function St(t){return[t("x"),t("y")]}const qa=({current:t})=>t?t.ownerDocument.defaultView:null,za=(t,e)=>Math.abs(t-e);function ap(t,e){const n=za(t.x,e.x),i=za(t.y,e.y);return Math.sqrt(n**2+i**2)}class Xa{constructor(e,n,{transformPagePoint:i,contextWindow:r=window,dragSnapToOrigin:o=!1,distanceThreshold:s=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 d=Nr(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,p=ap(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!p)return;const{point:T}=d,{timestamp:x}=ot;this.history.push({...T,timestamp:x});const{onStart:y,onMove:v}=this.handlers;m||(y&&y(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,m)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Ir(m,this.transformPagePoint),K.update(this.updatePoint,!0)},this.handlePointerUp=(d,m)=>{this.end();const{onEnd:p,onSessionEnd:T,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=Nr(d.type==="pointercancel"?this.lastMoveEventInfo:Ir(m,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,y),T&&T(d,y)},!mr(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=s,this.contextWindow=r||window;const a=hn(e),u=Ir(a,this.transformPagePoint),{point:c}=u,{timestamp:l}=ot;this.history=[{...c,timestamp:l}];const{onSessionStart:f}=n;f&&f(e,Nr(u,this.history)),this.removeListeners=en(mn(this.contextWindow,"pointermove",this.handlePointerMove),mn(this.contextWindow,"pointerup",this.handlePointerUp),mn(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),zt(this.updatePoint)}}function Ir(t,e){return e?{point:e(t.point)}:t}function Ja(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Nr({point:t},e){return{point:t,delta:Ja(t,Za(e)),offset:Ja(t,up(e)),velocity:cp(e,.1)}}function up(t){return t[0]}function Za(t){return t[t.length-1]}function cp(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const r=Za(t);for(;n>=0&&(i=t[n],!(r.timestamp-i.timestamp>kt(e)));)n--;if(!i)return{x:0,y:0};const o=Tt(r.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const s={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function lp(t,{min:e,max:n},i){return e!==void 0&&t<e?t=i?q(e,t,i.min):Math.max(t,e):n!==void 0&&t>n&&(t=i?q(n,t,i.max):Math.min(t,n)),t}function Qa(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function fp(t,{top:e,left:n,bottom:i,right:r}){return{x:Qa(t.x,n,r),y:Qa(t.y,e,i)}}function tu(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}function dp(t,e){return{x:tu(t.x,e.x),y:tu(t.y,e.y)}}function hp(t,e){let n=.5;const i=dt(t),r=dt(e);return r>i?n=nn(e.min,e.max-i,t.min):i>r&&(n=nn(t.min,t.max-r,e.min)),$t(0,1,n)}function mp(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const _r=.35;function pp(t=_r){return t===!1?t=0:t===!0&&(t=_r),{x:eu(t,"left","right"),y:eu(t,"top","bottom")}}function eu(t,e,n){return{min:nu(t,e),max:nu(t,n)}}function nu(t,e){return typeof t=="number"?t:t[e]||0}const gp=new WeakMap;class yp{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=rt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=f=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(hn(f).point)},s=(f,d)=>{const{drag:m,dragPropagation:p,onDragStart:T}=this.getProps();if(m&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Dh(m),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),St(y=>{let v=this.getAxisMotionValue(y).get()||0;if(Nt.test(v)){const{projection:w}=this.visualElement;if(w&&w.layout){const S=w.layout.layoutBox[y];S&&(v=dt(S)*(parseFloat(v)/100))}}this.originPoint[y]=v}),T&&K.postRender(()=>T(f,d)),Or(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d;const{dragPropagation:m,dragDirectionLock:p,onDirectionLock:T,onDrag:x}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:y}=d;if(p&&this.currentDirection===null){this.currentDirection=vp(y),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",d.point,y),this.updateAxis("y",d.point,y),this.visualElement.render(),x&&x(f,d)},u=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d,this.stop(f,d),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>St(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:l}=this.getProps();this.panSession=new Xa(e,{onSessionStart:o,onStart:s,onMove:a,onSessionEnd:u,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:i,contextWindow:qa(this.visualElement)})}stop(e,n){const i=e||this.latestPointerEvent,r=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!r||!i)return;const{velocity:s}=r;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&K.postRender(()=>a(i,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,i){const{drag:r}=this.getProps();if(!i||!ei(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let s=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(s=lp(s,this.constraints[e],this.elastic[e])),o.set(s)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Re(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=fp(i.layoutBox,e):this.constraints=!1,this.elastic=pp(n),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&St(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=mp(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Re(e))return!1;const i=e.current;Bt(i!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=xm(i,r.root,this.visualElement.getTransformPagePoint());let s=dp(r.layout.layoutBox,o);if(n){const a=n(gm(s));this.hasMutatedConstraints=!!a,a&&(s=wa(a))}return s}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),u=this.constraints||{},c=St(l=>{if(!ei(l,n,this.currentDirection))return;let f=u&&u[l]||{};s&&(f={min:0,max:0});const d=r?200:1e6,m=r?40:1e7,p={type:"inertia",velocity:i?e[l]:0,bounceStiffness:d,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(l,p)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return Or(this.visualElement,e),i.start(Rr(e,i,0,n,this.visualElement,!1))}stopAnimation(){St(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){St(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){St(n=>{const{drag:i}=this.getProps();if(!ei(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(n);if(r&&r.layout){const{min:s,max:a}=r.layout.layoutBox[n];o.set(e[n]-q(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Re(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};St(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const u=a.get();r[s]=hp({min:u,max:u},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),St(s=>{if(!ei(s,e,null))return;const a=this.getAxisMotionValue(s),{min:u,max:c}=this.constraints[s];a.set(q(u,c,r[s]))})}addListeners(){if(!this.visualElement.current)return;gp.set(this.visualElement,this);const e=this.visualElement.current,n=mn(e,"pointerdown",u=>{const{drag:c,dragListener:l=!0}=this.getProps();c&&l&&this.start(u)}),i=()=>{const{dragConstraints:u}=this.getProps();Re(u)&&u.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),K.read(i);const s=dn(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:c})=>{this.isDragging&&c&&(St(l=>{const f=this.getAxisMotionValue(l);f&&(this.originPoint[l]+=u[l].translate,f.set(f.get()+u[l].translate))}),this.visualElement.render())}));return()=>{s(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:s=_r,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function ei(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function vp(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class xp extends Zt{constructor(e){super(e),this.removeGroupControls=wt,this.removeListeners=wt,this.controls=new yp(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||wt}unmount(){this.removeGroupControls(),this.removeListeners()}}const iu=t=>(e,n)=>{t&&K.postRender(()=>t(e,n))};class bp extends Zt{constructor(){super(...arguments),this.removePointerDownListener=wt}onPointerDown(e){this.session=new Xa(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:qa(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:iu(e),onStart:iu(n),onMove:i,onEnd:(o,s)=>{delete this.session,r&&K.postRender(()=>r(o,s))}}}mount(){this.removePointerDownListener=mn(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ni={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Lr=!1;class wp extends C.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:o}=e;o&&(n.group&&n.group.add(o),i&&i.register&&r&&i.register(o),Lr&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),ni.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:r,isPresent:o}=this.props,{projection:s}=i;return s&&(s.isPresent=o,Lr=!0,r||e.layoutDependency!==n||n===void 0||e.isPresent!==o?s.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?s.promote():s.relegate()||K.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),hr.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=e;Lr=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function ru(t){const[e,n]=jh(),i=C.useContext(Ys);return P.jsx(wp,{...t,layoutGroup:i,switchLayoutGroup:C.useContext(xa),isPresent:e,safeToRemove:n})}function Tp(t,e,n){const i=ct(t)?t:ke(t);return i.start(Rr("",i,e,n)),i.animation}const Sp=(t,e)=>t.depth-e.depth;class Ep{constructor(){this.children=[],this.isDirty=!1}add(e){ki(this.children,e),this.isDirty=!0}remove(e){Oi(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Sp),this.isDirty=!1,this.children.forEach(e)}}function Mp(t,e){const n=pt.now(),i=({timestamp:r})=>{const o=r-n;o>=e&&(zt(i),t(o-e))};return K.setup(i,!0),()=>zt(i)}const su=["TopLeft","TopRight","BottomLeft","BottomRight"],Cp=su.length,ou=t=>typeof t=="string"?parseFloat(t):t,au=t=>typeof t=="number"||k.test(t);function Pp(t,e,n,i,r,o){r?(t.opacity=q(0,n.opacity??1,Ap(i)),t.opacityExit=q(e.opacity??1,0,Dp(i))):o&&(t.opacity=q(e.opacity??1,n.opacity??1,i));for(let s=0;s<Cp;s++){const a=`border${su[s]}Radius`;let u=uu(e,a),c=uu(n,a);if(u===void 0&&c===void 0)continue;u||(u=0),c||(c=0),u===0||c===0||au(u)===au(c)?(t[a]=Math.max(q(ou(u),ou(c),i),0),(Nt.test(c)||Nt.test(u))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=q(e.rotate||0,n.rotate||0,i))}function uu(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Ap=cu(0,.5,no),Dp=cu(.5,.95,wt);function cu(t,e,n){return i=>i<t?0:i>e?1:n(nn(t,e,i))}function lu(t,e){t.min=e.min,t.max=e.max}function Rt(t,e){lu(t.x,e.x),lu(t.y,e.y)}function fu(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function du(t,e,n,i,r){return t-=e,t=Qn(t,1/n,i),r!==void 0&&(t=Qn(t,1/r,i)),t}function kp(t,e=0,n=1,i=.5,r,o=t,s=t){if(Nt.test(e)&&(e=parseFloat(e),e=q(s.min,s.max,e/100)-s.min),typeof e!="number")return;let a=q(o.min,o.max,i);t===o&&(a-=e),t.min=du(t.min,e,n,a,r),t.max=du(t.max,e,n,a,r)}function hu(t,e,[n,i,r],o,s){kp(t,e[n],e[i],e[r],e.scale,o,s)}const Op=["x","scaleX","originX"],Rp=["y","scaleY","originY"];function mu(t,e,n,i){hu(t.x,e,Op,n?n.x:void 0,i?i.x:void 0),hu(t.y,e,Rp,n?n.y:void 0,i?i.y:void 0)}function pu(t){return t.translate===0&&t.scale===1}function gu(t){return pu(t.x)&&pu(t.y)}function yu(t,e){return t.min===e.min&&t.max===e.max}function Vp(t,e){return yu(t.x,e.x)&&yu(t.y,e.y)}function vu(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function xu(t,e){return vu(t.x,e.x)&&vu(t.y,e.y)}function bu(t){return dt(t.x)/dt(t.y)}function wu(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Ip{constructor(){this.members=[]}add(e){ki(this.members,e),e.scheduleRender()}remove(e){if(Oi(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(r=>e===r);if(n===0)return!1;let i;for(let r=n;r>=0;r--){const o=this.members[r];if(o.isPresent!==!1){i=o;break}}return i?(this.promote(i),!0):!1}promote(e,n){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,n&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:i}=e;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Np(t,e,n){let i="";const r=t.x.translate/e.x,o=t.y.translate/e.y,s=n?.z||0;if((r||o||s)&&(i=`translate3d(${r}px, ${o}px, ${s}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:l,rotateX:f,rotateY:d,skewX:m,skewY:p}=n;c&&(i=`perspective(${c}px) ${i}`),l&&(i+=`rotate(${l}deg) `),f&&(i+=`rotateX(${f}deg) `),d&&(i+=`rotateY(${d}deg) `),m&&(i+=`skewX(${m}deg) `),p&&(i+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,u=t.y.scale*e.y;return(a!==1||u!==1)&&(i+=`scale(${a}, ${u})`),i||"none"}const jr=["","X","Y","Z"],_p=1e3;let Lp=0;function Fr(t,e,n,i){const{latestValues:r}=e;r[t]&&(n[t]=r[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Tu(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=La(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",K,!(r||o))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Tu(i)}function Su({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(s={},a=e?.()){this.id=Lp++,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.layoutVersion=0,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($p),this.nodes.forEach(Yp),this.nodes.forEach(Hp),this.nodes.forEach(Bp)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ep)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Ii),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const u=this.eventHandlers.get(s);u&&u.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=na(s)&&!Nh(s),this.instance=s;const{layoutId:a,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||a)&&(this.isLayoutDirty=!0),t){let l,f=0;const d=()=>this.root.updateBlockedByResize=!1;K.read(()=>{f=window.innerWidth}),t(s,()=>{const m=window.innerWidth;m!==f&&(f=m,this.root.updateBlockedByResize=!0,l&&l(),l=Mp(d,250),ni.hasAnimatedSinceResize&&(ni.hasAnimatedSinceResize=!1,this.nodes.forEach(Cu)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||u)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||c.getDefaultTransition()||Xp,{onLayoutAnimationStart:T,onLayoutAnimationComplete:x}=c.getProps(),y=!this.targetLayout||!xu(this.targetLayout,m),v=!f&&d;if(this.options.layoutRoot||this.resumeFrom||v||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...lr(p,"layout"),onPlay:T,onComplete:x};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(l,v)}else f||Cu(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),zt(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(Gp),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Tu(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){const f=this.path[l];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:u}=this.options;if(a===void 0&&!u)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Eu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Mu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Up),this.nodes.forEach(jp),this.nodes.forEach(Fp)):this.nodes.forEach(Mu),this.clearAllSnapshots();const a=pt.now();ot.delta=$t(0,1e3/60,a-ot.timestamp),ot.timestamp=a,ot.isProcessing=!0,ji.update.process(ot),ji.preRender.process(ot),ji.render.process(ot),ot.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,hr.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Wp),this.sharedNodes.forEach(Kp)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,K.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){K.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!dt(this.snapshot.measuredBox.x)&&!dt(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 u=0;u<this.path.length;u++)this.path[u].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=rt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const u=i(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!r)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!gu(this.projectionDelta),u=this.getTransformTemplate(),c=u?u(this.latestValues,""):void 0,l=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||he(this.latestValues)||l)&&(r(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let u=this.removeElementScroll(a);return s&&(u=this.removeTransform(u)),Jp(u),{animationId:this.root.animationId,measuredBox:a,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return rt();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Zp))){const{scroll:c}=this.root;c&&(Ve(a.x,c.offset.x),Ve(a.y,c.offset.y))}return a}removeElementScroll(s){const a=rt();if(Rt(a,s),this.scroll?.wasRoot)return a;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:l,options:f}=c;c!==this.root&&l&&f.layoutScroll&&(l.wasRoot&&Rt(a,s),Ve(a.x,l.offset.x),Ve(a.y,l.offset.y))}return a}applyTransform(s,a=!1){const u=rt();Rt(u,s);for(let c=0;c<this.path.length;c++){const l=this.path[c];!a&&l.options.layoutScroll&&l.scroll&&l!==l.root&&Ie(u,{x:-l.scroll.offset.x,y:-l.scroll.offset.y}),he(l.latestValues)&&Ie(u,l.latestValues)}return he(this.latestValues)&&Ie(u,this.latestValues),u}removeTransform(s){const a=rt();Rt(a,s);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!c.instance||!he(c.latestValues))continue;Pr(c.latestValues)&&c.updateSnapshot();const l=rt(),f=c.measurePageBox();Rt(l,f),mu(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,l)}return he(this.latestValues)&&mu(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.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!==ot.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==a;if(!(s||u&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:l,layoutId:f}=this.options;if(!this.layout||!(l||f))return;this.resolvedRelativeTargetAt=ot.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=rt(),this.targetWithTransforms=rt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),op(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Rt(this.target,this.layout.layoutBox),Ma(this.target,this.targetDelta)):Rt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Pr(this.parent.latestValues)||Ta(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,a,u){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=rt(),this.relativeTargetOrigin=rt(),ti(this.relativeTargetOrigin,a,u),Rt(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const s=this.getLead(),a=!!this.resumingFrom||this!==s;let u=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(u=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===ot.timestamp&&(u=!1),u)return;const{layout:c,layoutId:l}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||l))return;Rt(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;vm(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=rt());const{target:m}=s;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fu(this.prevProjectionDelta.x,this.projectionDelta.x),fu(this.prevProjectionDelta.y,this.projectionDelta.y)),pn(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!wu(this.projectionDelta.x,this.prevProjectionDelta.x)||!wu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ne(),this.projectionDelta=Ne(),this.projectionDeltaWithTransform=Ne()}setAnimationOrigin(s,a=!1){const u=this.snapshot,c=u?u.latestValues:{},l={...this.latestValues},f=Ne();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=rt(),m=u?u.source:void 0,p=this.layout?this.layout.source:void 0,T=m!==p,x=this.getStack(),y=!x||x.members.length<=1,v=!!(T&&!y&&this.options.crossfade===!0&&!this.path.some(zp));this.animationProgress=0;let w;this.mixTargetDelta=S=>{const E=S/1e3;Pu(f.x,s.x,E),Pu(f.y,s.y,E),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ti(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),qp(this.relativeTarget,this.relativeTargetOrigin,d,E),w&&Vp(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=rt()),Rt(w,this.relativeTarget)),T&&(this.animationValues=l,Pp(l,c,this.latestValues,E,v,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(zt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=K.update(()=>{ni.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ke(0)),this.currentAnimation=Tp(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(_p),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:u,layout:c,latestValues:l}=s;if(!(!a||!u||!c)){if(this!==s&&this.layout&&c&&Ru(this.options.animationType,this.layout.layoutBox,c.layoutBox)){u=this.target||rt();const f=dt(this.layout.layoutBox.x);u.x.min=s.target.x.min,u.x.max=u.x.min+f;const d=dt(this.layout.layoutBox.y);u.y.min=s.target.y.min,u.y.max=u.y.min+d}Rt(a,u),Ie(a,l),pn(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Ip),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:u}={}){const c=this.getStack();c&&c.promote(this,u),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:u}=s;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(a=!0),!a)return;const c={};u.z&&Fr("z",s,c,this.animationValues);for(let l=0;l<jr.length;l++)Fr(`rotate${jr[l]}`,s,c,this.animationValues),Fr(`skew${jr[l]}`,s,c,this.animationValues);s.render();for(const l in c)s.setStaticValue(l,c[l]),this.animationValues&&(this.animationValues[l]=c[l]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=Zn(a?.pointerEvents)||"",s.transform=u?u(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=Zn(a?.pointerEvents)||""),this.hasProjected&&!he(this.latestValues)&&(s.transform=u?u({},""):"none",this.hasProjected=!1);return}s.visibility="";const l=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=Np(this.projectionDeltaWithTransform,this.treeScale,l);u&&(f=u(l,f)),s.transform=f;const{x:d,y:m}=this.projectionDelta;s.transformOrigin=`${d.origin*100}% ${m.origin*100}% 0`,c.animationValues?s.opacity=c===this?l.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:s.opacity=c===this?l.opacity!==void 0?l.opacity:"":l.opacityExit!==void 0?l.opacityExit:0;for(const p in vr){if(l[p]===void 0)continue;const{correct:T,applyTo:x,isCSSVariable:y}=vr[p],v=f==="none"?l[p]:T(l[p],c);if(x){const w=x.length;for(let S=0;S<w;S++)s[x[S]]=v}else y?this.options.visualElement.renderState.vars[p]=v:s[p]=v}this.options.layoutId&&(s.pointerEvents=c===this?Zn(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(Eu),this.root.sharedNodes.clear()}}}function jp(t){t.updateLayout()}function Fp(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:r}=t.options,o=e.source!==t.layout.source;r==="size"?St(l=>{const f=o?e.measuredBox[l]:e.layoutBox[l],d=dt(f);f.min=n[l].min,f.max=f.min+d}):Ru(r,e.layoutBox,n)&&St(l=>{const f=o?e.measuredBox[l]:e.layoutBox[l],d=dt(n[l]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[l].max=t.relativeTarget[l].min+d)});const s=Ne();pn(s,n,e.layoutBox);const a=Ne();o?pn(a,t.applyTransform(i,!0),e.measuredBox):pn(a,n,e.layoutBox);const u=!gu(s);let c=!1;if(!t.resumeFrom){const l=t.getClosestProjectingParent();if(l&&!l.resumeFrom){const{snapshot:f,layout:d}=l;if(f&&d){const m=rt();ti(m,e.layoutBox,f.layoutBox);const p=rt();ti(p,n,d.layoutBox),xu(m,p)||(c=!0),l.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=m,t.relativeParent=l)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:s,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function $p(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Bp(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Wp(t){t.clearSnapshot()}function Eu(t){t.clearMeasurements()}function Mu(t){t.isLayoutDirty=!1}function Up(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Cu(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Yp(t){t.resolveTargetDelta()}function Hp(t){t.calcProjection()}function Gp(t){t.resetSkewAndRotation()}function Kp(t){t.removeLeadSnapshot()}function Pu(t,e,n){t.translate=q(e.translate,0,n),t.scale=q(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Au(t,e,n,i){t.min=q(e.min,n.min,i),t.max=q(e.max,n.max,i)}function qp(t,e,n,i){Au(t.x,e.x,n.x,i),Au(t.y,e.y,n.y,i)}function zp(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Xp={duration:.45,ease:[.4,0,.1,1]},Du=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ku=Du("applewebkit/")&&!Du("chrome/")?Math.round:wt;function Ou(t){t.min=ku(t.min),t.max=ku(t.max)}function Jp(t){Ou(t.x),Ou(t.y)}function Ru(t,e,n){return t==="position"||t==="preserve-aspect"&&!sp(bu(e),bu(n),.2)}function Zp(t){return t!==t.root&&t.scroll?.wasRoot}const Qp=Su({attachResizeListener:(t,e)=>dn(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),$r={current:void 0},Vu=Su({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!$r.current){const t=new Qp({});t.mount(window),t.setOptions({layoutScroll:!0}),$r.current=t}return $r.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),tg={pan:{Feature:bp},drag:{Feature:xp,ProjectionNode:Vu,MeasureLayout:ru}};function Iu(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,o=i[r];o&&K.postRender(()=>o(e,hn(e)))}class eg extends Zt{mount(){const{current:e}=this.node;e&&(this.unmount=kh(e,(n,i)=>(Iu(this.node,i,"Start"),r=>Iu(this.node,r,"End"))))}unmount(){}}class ng extends Zt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=en(dn(this.node.current,"focus",()=>this.onFocus()),dn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Nu(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),o=i[r];o&&K.postRender(()=>o(e,hn(e)))}class ig extends Zt{mount(){const{current:e}=this.node;e&&(this.unmount=Ih(e,(n,i)=>(Nu(this.node,i,"Start"),(r,{success:o})=>Nu(this.node,r,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Br=new WeakMap,Wr=new WeakMap,rg=t=>{const e=Br.get(t.target);e&&e(t)},sg=t=>{t.forEach(rg)};function og({root:t,...e}){const n=t||document;Wr.has(n)||Wr.set(n,{});const i=Wr.get(n),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(sg,{root:t,...e})),i[r]}function ag(t,e,n){const i=og(e);return Br.set(t,n),i.observe(t),()=>{Br.delete(t),i.unobserve(t)}}const ug={some:0,all:1};class cg extends Zt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:o}=e,s={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:ug[r]},a=u=>{const{isIntersecting:c}=u;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:l,onViewportLeave:f}=this.node.getProps(),d=c?l:f;d&&d(u)};return ag(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(lg(e,n))&&this.startObserver()}unmount(){}}function lg({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const fg={...Qm,...{inView:{Feature:cg},tap:{Feature:ig},focus:{Feature:ng},hover:{Feature:eg}},...tg,...{layout:{ProjectionNode:Vu,MeasureLayout:ru}}},dg=pm(fg,Am),hg=({x:t,y:e,width:n,height:i,data:r,onClick:o,onHover:s,isActive:a,isDimmed:u,style:c,...l})=>{const f=C.useMemo(()=>r.isPrediction?"#8e44ad":a?"#e74c3c":r.color||"#3498db",[r,a]);return P.jsx(dg.rect,{initial:{height:0,y:e+i,x:t},animate:{height:i,y:e,x:t},transition:{type:"spring",stiffness:300,damping:30},width:n,fill:f,rx:4,ry:4,className:"cursor-pointer hover:opacity-80",onClick:()=>o?.(r),onMouseEnter:()=>s?.(r),onMouseLeave:()=>s?.(null),style:{opacity:u?.3:r.isPrediction?.7:1,stroke:a?"#c0392b":"none",strokeWidth:a?2:0,...c},...l})};var _u;(function(t){t.STRING="string",t.NUMBER="number",t.INTEGER="integer",t.BOOLEAN="boolean",t.ARRAY="array",t.OBJECT="object"})(_u||(_u={}));var Lu;(function(t){t.LANGUAGE_UNSPECIFIED="language_unspecified",t.PYTHON="python"})(Lu||(Lu={}));var ju;(function(t){t.OUTCOME_UNSPECIFIED="outcome_unspecified",t.OUTCOME_OK="outcome_ok",t.OUTCOME_FAILED="outcome_failed",t.OUTCOME_DEADLINE_EXCEEDED="outcome_deadline_exceeded"})(ju||(ju={}));const Fu=["user","model","function","system"];var $u;(function(t){t.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",t.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",t.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",t.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",t.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",t.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY"})($u||($u={}));var Bu;(function(t){t.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE"})(Bu||(Bu={}));var Wu;(function(t){t.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",t.NEGLIGIBLE="NEGLIGIBLE",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(Wu||(Wu={}));var Uu;(function(t){t.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",t.SAFETY="SAFETY",t.OTHER="OTHER"})(Uu||(Uu={}));var gn;(function(t){t.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",t.STOP="STOP",t.MAX_TOKENS="MAX_TOKENS",t.SAFETY="SAFETY",t.RECITATION="RECITATION",t.LANGUAGE="LANGUAGE",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.SPII="SPII",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t.OTHER="OTHER"})(gn||(gn={}));var Yu;(function(t){t.TASK_TYPE_UNSPECIFIED="TASK_TYPE_UNSPECIFIED",t.RETRIEVAL_QUERY="RETRIEVAL_QUERY",t.RETRIEVAL_DOCUMENT="RETRIEVAL_DOCUMENT",t.SEMANTIC_SIMILARITY="SEMANTIC_SIMILARITY",t.CLASSIFICATION="CLASSIFICATION",t.CLUSTERING="CLUSTERING"})(Yu||(Yu={}));var Hu;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.AUTO="AUTO",t.ANY="ANY",t.NONE="NONE"})(Hu||(Hu={}));var Gu;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.MODE_DYNAMIC="MODE_DYNAMIC"})(Gu||(Gu={}));class lt extends Error{constructor(e){super(`[GoogleGenerativeAI Error]: ${e}`)}}class Le extends lt{constructor(e,n){super(e),this.response=n}}class Ku extends lt{constructor(e,n,i,r){super(e),this.status=n,this.statusText=i,this.errorDetails=r}}class Qt extends lt{}class qu extends lt{}const mg="https://generativelanguage.googleapis.com",pg="v1beta",gg="0.24.1",yg="genai-js";var pe;(function(t){t.GENERATE_CONTENT="generateContent",t.STREAM_GENERATE_CONTENT="streamGenerateContent",t.COUNT_TOKENS="countTokens",t.EMBED_CONTENT="embedContent",t.BATCH_EMBED_CONTENTS="batchEmbedContents"})(pe||(pe={}));class vg{constructor(e,n,i,r,o){this.model=e,this.task=n,this.apiKey=i,this.stream=r,this.requestOptions=o}toString(){var e,n;const i=((e=this.requestOptions)===null||e===void 0?void 0:e.apiVersion)||pg;let o=`${((n=this.requestOptions)===null||n===void 0?void 0:n.baseUrl)||mg}/${i}/${this.model}:${this.task}`;return this.stream&&(o+="?alt=sse"),o}}function xg(t){const e=[];return t?.apiClient&&e.push(t.apiClient),e.push(`${yg}/${gg}`),e.join(" ")}async function bg(t){var e;const n=new Headers;n.append("Content-Type","application/json"),n.append("x-goog-api-client",xg(t.requestOptions)),n.append("x-goog-api-key",t.apiKey);let i=(e=t.requestOptions)===null||e===void 0?void 0:e.customHeaders;if(i){if(!(i instanceof Headers))try{i=new Headers(i)}catch(r){throw new Qt(`unable to convert customHeaders value ${JSON.stringify(i)} to Headers: ${r.message}`)}for(const[r,o]of i.entries()){if(r==="x-goog-api-key")throw new Qt(`Cannot set reserved header name ${r}`);if(r==="x-goog-api-client")throw new Qt(`Header name ${r} can only be set using the apiClient field`);n.append(r,o)}}return n}async function wg(t,e,n,i,r,o){const s=new vg(t,e,n,i,o);return{url:s.toString(),fetchOptions:Object.assign(Object.assign({},Mg(o)),{method:"POST",headers:await bg(s),body:r})}}async function yn(t,e,n,i,r,o={},s=fetch){const{url:a,fetchOptions:u}=await wg(t,e,n,i,r,o);return Tg(a,u,s)}async function Tg(t,e,n=fetch){let i;try{i=await n(t,e)}catch(r){Sg(r,t)}return i.ok||await Eg(i,t),i}function Sg(t,e){let n=t;throw n.name==="AbortError"?(n=new qu(`Request aborted when fetching ${e.toString()}: ${t.message}`),n.stack=t.stack):t instanceof Ku||t instanceof Qt||(n=new lt(`Error fetching from ${e.toString()}: ${t.message}`),n.stack=t.stack),n}async function Eg(t,e){let n="",i;try{const r=await t.json();n=r.error.message,r.error.details&&(n+=` ${JSON.stringify(r.error.details)}`,i=r.error.details)}catch{}throw new Ku(`Error fetching from ${e.toString()}: [${t.status} ${t.statusText}] ${n}`,t.status,t.statusText,i)}function Mg(t){const e={};if(t?.signal!==void 0||t?.timeout>=0){const n=new AbortController;t?.timeout>=0&&setTimeout(()=>n.abort(),t.timeout),t?.signal&&t.signal.addEventListener("abort",()=>{n.abort()}),e.signal=n.signal}return e}function Ur(t){return t.text=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning text from the first candidate only. Access response.candidates directly to use the other candidates.`),ii(t.candidates[0]))throw new Le(`${te(t)}`,t);return Cg(t)}else if(t.promptFeedback)throw new Le(`Text not available. ${te(t)}`,t);return""},t.functionCall=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),ii(t.candidates[0]))throw new Le(`${te(t)}`,t);return console.warn("response.functionCall() is deprecated. Use response.functionCalls() instead."),zu(t)[0]}else if(t.promptFeedback)throw new Le(`Function call not available. ${te(t)}`,t)},t.functionCalls=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),ii(t.candidates[0]))throw new Le(`${te(t)}`,t);return zu(t)}else if(t.promptFeedback)throw new Le(`Function call not available. ${te(t)}`,t)},t}function Cg(t){var e,n,i,r;const o=[];if(!((n=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||n===void 0)&&n.parts)for(const s of(r=(i=t.candidates)===null||i===void 0?void 0:i[0].content)===null||r===void 0?void 0:r.parts)s.text&&o.push(s.text),s.executableCode&&o.push("\n```"+s.executableCode.language+`
10
+ `+s.executableCode.code+"\n```\n"),s.codeExecutionResult&&o.push("\n```\n"+s.codeExecutionResult.output+"\n```\n");return o.length>0?o.join(""):""}function zu(t){var e,n,i,r;const o=[];if(!((n=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||n===void 0)&&n.parts)for(const s of(r=(i=t.candidates)===null||i===void 0?void 0:i[0].content)===null||r===void 0?void 0:r.parts)s.functionCall&&o.push(s.functionCall);if(o.length>0)return o}const Pg=[gn.RECITATION,gn.SAFETY,gn.LANGUAGE];function ii(t){return!!t.finishReason&&Pg.includes(t.finishReason)}function te(t){var e,n,i;let r="";if((!t.candidates||t.candidates.length===0)&&t.promptFeedback)r+="Response was blocked",!((e=t.promptFeedback)===null||e===void 0)&&e.blockReason&&(r+=` due to ${t.promptFeedback.blockReason}`),!((n=t.promptFeedback)===null||n===void 0)&&n.blockReasonMessage&&(r+=`: ${t.promptFeedback.blockReasonMessage}`);else if(!((i=t.candidates)===null||i===void 0)&&i[0]){const o=t.candidates[0];ii(o)&&(r+=`Candidate was blocked due to ${o.finishReason}`,o.finishMessage&&(r+=`: ${o.finishMessage}`))}return r}function vn(t){return this instanceof vn?(this.v=t,this):new vn(t)}function Ag(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(t,e||[]),r,o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(d){i[d]&&(r[d]=function(m){return new Promise(function(p,T){o.push([d,m,p,T])>1||a(d,m)})})}function a(d,m){try{u(i[d](m))}catch(p){f(o[0][3],p)}}function u(d){d.value instanceof vn?Promise.resolve(d.value.v).then(c,l):f(o[0][2],d)}function c(d){a("next",d)}function l(d){a("throw",d)}function f(d,m){d(m),o.shift(),o.length&&a(o[0][0],o[0][1])}}typeof SuppressedError=="function"&&SuppressedError;const Xu=/^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/;function Dg(t){const e=t.body.pipeThrough(new TextDecoderStream("utf8",{fatal:!0})),n=Rg(e),[i,r]=n.tee();return{stream:Og(i),response:kg(r)}}async function kg(t){const e=[],n=t.getReader();for(;;){const{done:i,value:r}=await n.read();if(i)return Ur(Vg(e));e.push(r)}}function Og(t){return Ag(this,arguments,function*(){const n=t.getReader();for(;;){const{value:i,done:r}=yield vn(n.read());if(r)break;yield yield vn(Ur(i))}})}function Rg(t){const e=t.getReader();return new ReadableStream({start(i){let r="";return o();function o(){return e.read().then(({value:s,done:a})=>{if(a){if(r.trim()){i.error(new lt("Failed to parse stream"));return}i.close();return}r+=s;let u=r.match(Xu),c;for(;u;){try{c=JSON.parse(u[1])}catch{i.error(new lt(`Error parsing JSON response: "${u[1]}"`));return}i.enqueue(c),r=r.substring(u[0].length),u=r.match(Xu)}return o()}).catch(s=>{let a=s;throw a.stack=s.stack,a.name==="AbortError"?a=new qu("Request aborted when reading from the stream"):a=new lt("Error reading from the stream"),a})}}})}function Vg(t){const e=t[t.length-1],n={promptFeedback:e?.promptFeedback};for(const i of t){if(i.candidates){let r=0;for(const o of i.candidates)if(n.candidates||(n.candidates=[]),n.candidates[r]||(n.candidates[r]={index:r}),n.candidates[r].citationMetadata=o.citationMetadata,n.candidates[r].groundingMetadata=o.groundingMetadata,n.candidates[r].finishReason=o.finishReason,n.candidates[r].finishMessage=o.finishMessage,n.candidates[r].safetyRatings=o.safetyRatings,o.content&&o.content.parts){n.candidates[r].content||(n.candidates[r].content={role:o.content.role||"user",parts:[]});const s={};for(const a of o.content.parts)a.text&&(s.text=a.text),a.functionCall&&(s.functionCall=a.functionCall),a.executableCode&&(s.executableCode=a.executableCode),a.codeExecutionResult&&(s.codeExecutionResult=a.codeExecutionResult),Object.keys(s).length===0&&(s.text=""),n.candidates[r].content.parts.push(s)}r++}i.usageMetadata&&(n.usageMetadata=i.usageMetadata)}return n}async function Ju(t,e,n,i){const r=await yn(e,pe.STREAM_GENERATE_CONTENT,t,!0,JSON.stringify(n),i);return Dg(r)}async function Zu(t,e,n,i){const o=await(await yn(e,pe.GENERATE_CONTENT,t,!1,JSON.stringify(n),i)).json();return{response:Ur(o)}}function Qu(t){if(t!=null){if(typeof t=="string")return{role:"system",parts:[{text:t}]};if(t.text)return{role:"system",parts:[t]};if(t.parts)return t.role?t:{role:"system",parts:t.parts}}}function xn(t){let e=[];if(typeof t=="string")e=[{text:t}];else for(const n of t)typeof n=="string"?e.push({text:n}):e.push(n);return Ig(e)}function Ig(t){const e={role:"user",parts:[]},n={role:"function",parts:[]};let i=!1,r=!1;for(const o of t)"functionResponse"in o?(n.parts.push(o),r=!0):(e.parts.push(o),i=!0);if(i&&r)throw new lt("Within a single message, FunctionResponse cannot be mixed with other type of part in the request for sending chat message.");if(!i&&!r)throw new lt("No content is provided for sending chat message.");return i?e:n}function Ng(t,e){var n;let i={model:e?.model,generationConfig:e?.generationConfig,safetySettings:e?.safetySettings,tools:e?.tools,toolConfig:e?.toolConfig,systemInstruction:e?.systemInstruction,cachedContent:(n=e?.cachedContent)===null||n===void 0?void 0:n.name,contents:[]};const r=t.generateContentRequest!=null;if(t.contents){if(r)throw new Qt("CountTokensRequest must have one of contents or generateContentRequest, not both.");i.contents=t.contents}else if(r)i=Object.assign(Object.assign({},i),t.generateContentRequest);else{const o=xn(t);i.contents=[o]}return{generateContentRequest:i}}function tc(t){let e;return t.contents?e=t:e={contents:[xn(t)]},t.systemInstruction&&(e.systemInstruction=Qu(t.systemInstruction)),e}function _g(t){return typeof t=="string"||Array.isArray(t)?{content:xn(t)}:t}const ec=["text","inlineData","functionCall","functionResponse","executableCode","codeExecutionResult"],Lg={user:["text","inlineData"],function:["functionResponse"],model:["text","functionCall","executableCode","codeExecutionResult"],system:["text"]};function jg(t){let e=!1;for(const n of t){const{role:i,parts:r}=n;if(!e&&i!=="user")throw new lt(`First content should be with role 'user', got ${i}`);if(!Fu.includes(i))throw new lt(`Each item should include role field. Got ${i} but valid roles are: ${JSON.stringify(Fu)}`);if(!Array.isArray(r))throw new lt("Content should have 'parts' property with an array of Parts");if(r.length===0)throw new lt("Each Content should have at least one part");const o={text:0,inlineData:0,functionCall:0,functionResponse:0,fileData:0,executableCode:0,codeExecutionResult:0};for(const a of r)for(const u of ec)u in a&&(o[u]+=1);const s=Lg[i];for(const a of ec)if(!s.includes(a)&&o[a]>0)throw new lt(`Content with role '${i}' can't contain '${a}' part`);e=!0}}function nc(t){var e;if(t.candidates===void 0||t.candidates.length===0)return!1;const n=(e=t.candidates[0])===null||e===void 0?void 0:e.content;if(n===void 0||n.parts===void 0||n.parts.length===0)return!1;for(const i of n.parts)if(i===void 0||Object.keys(i).length===0||i.text!==void 0&&i.text==="")return!1;return!0}const ic="SILENT_ERROR";class Fg{constructor(e,n,i,r={}){this.model=n,this.params=i,this._requestOptions=r,this._history=[],this._sendPromise=Promise.resolve(),this._apiKey=e,i?.history&&(jg(i.history),this._history=i.history)}async getHistory(){return await this._sendPromise,this._history}async sendMessage(e,n={}){var i,r,o,s,a,u;await this._sendPromise;const c=xn(e),l={safetySettings:(i=this.params)===null||i===void 0?void 0:i.safetySettings,generationConfig:(r=this.params)===null||r===void 0?void 0:r.generationConfig,tools:(o=this.params)===null||o===void 0?void 0:o.tools,toolConfig:(s=this.params)===null||s===void 0?void 0:s.toolConfig,systemInstruction:(a=this.params)===null||a===void 0?void 0:a.systemInstruction,cachedContent:(u=this.params)===null||u===void 0?void 0:u.cachedContent,contents:[...this._history,c]},f=Object.assign(Object.assign({},this._requestOptions),n);let d;return this._sendPromise=this._sendPromise.then(()=>Zu(this._apiKey,this.model,l,f)).then(m=>{var p;if(nc(m.response)){this._history.push(c);const T=Object.assign({parts:[],role:"model"},(p=m.response.candidates)===null||p===void 0?void 0:p[0].content);this._history.push(T)}else{const T=te(m.response);T&&console.warn(`sendMessage() was unsuccessful. ${T}. Inspect response object for details.`)}d=m}).catch(m=>{throw this._sendPromise=Promise.resolve(),m}),await this._sendPromise,d}async sendMessageStream(e,n={}){var i,r,o,s,a,u;await this._sendPromise;const c=xn(e),l={safetySettings:(i=this.params)===null||i===void 0?void 0:i.safetySettings,generationConfig:(r=this.params)===null||r===void 0?void 0:r.generationConfig,tools:(o=this.params)===null||o===void 0?void 0:o.tools,toolConfig:(s=this.params)===null||s===void 0?void 0:s.toolConfig,systemInstruction:(a=this.params)===null||a===void 0?void 0:a.systemInstruction,cachedContent:(u=this.params)===null||u===void 0?void 0:u.cachedContent,contents:[...this._history,c]},f=Object.assign(Object.assign({},this._requestOptions),n),d=Ju(this._apiKey,this.model,l,f);return this._sendPromise=this._sendPromise.then(()=>d).catch(m=>{throw new Error(ic)}).then(m=>m.response).then(m=>{if(nc(m)){this._history.push(c);const p=Object.assign({},m.candidates[0].content);p.role||(p.role="model"),this._history.push(p)}else{const p=te(m);p&&console.warn(`sendMessageStream() was unsuccessful. ${p}. Inspect response object for details.`)}}).catch(m=>{m.message!==ic&&console.error(m)}),d}}async function $g(t,e,n,i){return(await yn(e,pe.COUNT_TOKENS,t,!1,JSON.stringify(n),i)).json()}async function Bg(t,e,n,i){return(await yn(e,pe.EMBED_CONTENT,t,!1,JSON.stringify(n),i)).json()}async function Wg(t,e,n,i){const r=n.requests.map(s=>Object.assign(Object.assign({},s),{model:e}));return(await yn(e,pe.BATCH_EMBED_CONTENTS,t,!1,JSON.stringify({requests:r}),i)).json()}class rc{constructor(e,n,i={}){this.apiKey=e,this._requestOptions=i,n.model.includes("/")?this.model=n.model:this.model=`models/${n.model}`,this.generationConfig=n.generationConfig||{},this.safetySettings=n.safetySettings||[],this.tools=n.tools,this.toolConfig=n.toolConfig,this.systemInstruction=Qu(n.systemInstruction),this.cachedContent=n.cachedContent}async generateContent(e,n={}){var i;const r=tc(e),o=Object.assign(Object.assign({},this._requestOptions),n);return Zu(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(i=this.cachedContent)===null||i===void 0?void 0:i.name},r),o)}async generateContentStream(e,n={}){var i;const r=tc(e),o=Object.assign(Object.assign({},this._requestOptions),n);return Ju(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(i=this.cachedContent)===null||i===void 0?void 0:i.name},r),o)}startChat(e){var n;return new Fg(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(n=this.cachedContent)===null||n===void 0?void 0:n.name},e),this._requestOptions)}async countTokens(e,n={}){const i=Ng(e,{model:this.model,generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:this.cachedContent}),r=Object.assign(Object.assign({},this._requestOptions),n);return $g(this.apiKey,this.model,i,r)}async embedContent(e,n={}){const i=_g(e),r=Object.assign(Object.assign({},this._requestOptions),n);return Bg(this.apiKey,this.model,i,r)}async batchEmbedContents(e,n={}){const i=Object.assign(Object.assign({},this._requestOptions),n);return Wg(this.apiKey,this.model,e,i)}}class Ug{constructor(e){this.apiKey=e}getGenerativeModel(e,n){if(!e.model)throw new lt("Must provide a model name. Example: genai.getGenerativeModel({ model: 'my-model-name' })");return new rc(this.apiKey,e,n)}getGenerativeModelFromCachedContent(e,n,i){if(!e.name)throw new Qt("Cached content must contain a `name` field.");if(!e.model)throw new Qt("Cached content must contain a `model` field.");const r=["model","systemInstruction"];for(const s of r)if(n?.[s]&&e[s]&&n?.[s]!==e[s]){if(s==="model"){const a=n.model.startsWith("models/")?n.model.replace("models/",""):n.model,u=e.model.startsWith("models/")?e.model.replace("models/",""):e.model;if(a===u)continue}throw new Qt(`Different value for "${s}" specified in modelParams (${n[s]}) and cachedContent (${e[s]})`)}const o=Object.assign(Object.assign({},n),{model:e.model,tools:e.tools,toolConfig:e.toolConfig,systemInstruction:e.systemInstruction,cachedContent:e});return new rc(this.apiKey,o,i)}}class Yg{genAI;model;constructor(e,n="gemini-1.5-flash"){this.genAI=new Ug(e),this.model=this.genAI.getGenerativeModel({model:n})}async predictNext(e,n=3,i="month"){if(e.length===0)return[];const r=`
11
11
  I have a time series data:
12
12
  ${e.map(o=>`${o.label}: ${o.value}`).join(`
13
13
  `)}
@@ -15,20 +15,20 @@ Check the top-level render call using <`+E+">.")}return T}}function Hu(h,T){{if(
15
15
  Predict the next ${n} values based on the trend.
16
16
  Return ONLY a JSON array of numbers. Example: [10, 12, 15].
17
17
  Do not include any explanation or markdown formatting.
18
- `;try{const u=(await(await this.model.generateContent(r)).response).text().replace(/```json/g,"").replace(/```/g,"").trim(),c=JSON.parse(u),f=e[e.length-1].date;return c.map((d,m)=>{let p=f;i==="day"?p=ps(f,m+1):i==="week"?p=bs(f,m+1):i==="month"&&(p=rl(f,m+1));let g="";return i==="day"?g=ct(p,"eee dd"):i==="week"?g=`W${m+1}`:i==="month"?g=ct(p,"MMM"):g=ct(p,"yyyy"),{id:`prediction-${m}`,label:g,value:d,date:p,isPrediction:!0,color:"#8e44ad"}})}catch(o){return console.error("Gemini Prediction Failed",o),[]}}async analyze(e){const n=`
18
+ `;try{const u=(await(await this.model.generateContent(r)).response).text().replace(/```json/g,"").replace(/```/g,"").trim(),c=JSON.parse(u),f=e[e.length-1].date;return c.map((d,m)=>{let p=f;i==="day"?p=As(f,m+1):i==="week"?p=Vs(f,m+1):i==="month"&&(p=ml(f,m+1));let T="";return i==="day"?T=G(p,"eee dd"):i==="week"?T=`W${m+1}`:i==="month"?T=G(p,"MMM"):T=G(p,"yyyy"),{id:`prediction-${m}`,label:T,value:d,date:p,isPrediction:!0,color:"#8e44ad"}})}catch(o){return console.error("Gemini Prediction Failed",o),[]}}async analyze(e){const n=`
19
19
  Analyze the following data trend:
20
20
  ${e.map(i=>`${i.label}: ${i.value}`).join(", ")}
21
21
 
22
22
  Provide a short, insightful summary (max 2 sentences).
23
- `;try{return(await this.model.generateContent(n)).response.text()}catch(i){return console.error("Gemini Analysis Failed",i),"Analysis unavailable."}}}const Ng=({data:t,view:e="month",variant:n="default",dataKeys:i={date:"date",value:"value",label:"label"},geminiConfig:r,colors:o,axisLabels:s,onViewChange:a,height:u=400,width:c="100%",className:l="",theme:f})=>{const d=(v,k,K,it,xt,Pt)=>{const Jt=Pt.tl?xt:0,Rt=Pt.tr?xt:0,ce=Pt.bl?xt:0,Ot=Pt.br?xt:0;return`
24
- M ${v+Jt} ${k}
25
- L ${v+K-Rt} ${k}
26
- Q ${v+K} ${k} ${v+K} ${k+Rt}
27
- L ${v+K} ${k+it-Ot}
28
- Q ${v+K} ${k+it} ${v+K-Ot} ${k+it}
29
- L ${v+ce} ${k+it}
30
- Q ${v} ${k+it} ${v} ${k+it-ce}
31
- L ${v} ${k+Jt}
32
- Q ${v} ${k} ${v+Jt} ${k}
23
+ `;try{return(await this.model.generateContent(n)).response.text()}catch(i){return console.error("Gemini Analysis Failed",i),"Analysis unavailable."}}}const Hg=({data:t,view:e="month",variant:n="default",layout:i="vertical",missingDataStrategy:r="skip",valueFormatter:o=y=>String(y),annotations:s=[],dataKeys:a={date:"date",value:"value",label:"label"},geminiConfig:u,colors:c,axisLabels:l,onViewChange:f,renderTooltip:d,height:m=400,width:p="100%",className:T="",theme:x})=>{const y=(g,A,Y,st,bt,Ut)=>{const Ct=Ut.tl?bt:0,Vt=Ut.tr?bt:0,Pt=Ut.bl?bt:0,Yt=Ut.br?bt:0;return`
24
+ M ${g+Ct} ${A}
25
+ L ${g+Y-Vt} ${A}
26
+ Q ${g+Y} ${A} ${g+Y} ${A+Vt}
27
+ L ${g+Y} ${A+st-Yt}
28
+ Q ${g+Y} ${A+st} ${g+Y-Yt} ${A+st}
29
+ L ${g+Pt} ${A+st}
30
+ Q ${g} ${A+st} ${g} ${A+st-Pt}
31
+ L ${g} ${A+Ct}
32
+ Q ${g} ${A} ${g+Ct} ${A}
33
33
  Z
34
- `},[m,p]=M.useState({year:null,month:null,weekStartDate:null}),[g,b]=M.useState({year:null,month:null,weekStartDate:null}),[y,w]=M.useState(!1),[x,C]=M.useState("year"),S=M.useMemo(()=>i,[i.date,i.label,Array.isArray(i.value)?i.value.join(","):i.value]),V=M.useMemo(()=>{const v=new Set(t.map(k=>ff(new Date(k[S.date]))));return Array.from(v).sort((k,K)=>K-k)},[t,S.date]),_=Df({data:t,view:e,dataKeys:S,colors:o}),[A,B]=M.useState(null),[Z,O]=M.useState([]),[at,W]=M.useState(!1),U=e==="month"?12:7,[nt,mt]=M.useState(0);M.useEffect(()=>{mt(0),O([]),e==="month"?(p(v=>v.month!==null||v.weekStartDate!==null?{...v,month:null,weekStartDate:null}:v),C("year")):e==="week"&&(p(v=>v.weekStartDate!==null?{...v,weekStartDate:null}:v),C("month"))},[e]),M.useEffect(()=>{if(!m.year&&!m.weekStartDate&&m.month===null)return;O([]);let v=null;if(m.weekStartDate?v=m.weekStartDate:m.month!==null&&m.year?v=new Date(m.year,m.month,1):m.year&&(v=new Date(m.year,0,1)),v&&_.length>0){const k=_.findIndex(K=>K.date.getTime()>=v.getTime());if(k!==-1){const K=_.length,it=Math.max(0,K-U-k);mt(it)}}},[m,_,U]);const F=v=>{b({year:v,month:null,weekStartDate:null}),C("month")},q=v=>{b(k=>({...k,month:v,weekStartDate:null})),C("week")},z=v=>{b(k=>({...k,weekStartDate:v}))},Ct=()=>{p(g),w(!1);let v;g.weekStartDate?v="day":g.month!==null?v="week":g.year!==null&&(v="month"),v&&a?.(v)},Ae=()=>{b(m),C(m.year?m.month!==null?"week":"month":"year"),w(!0)},qn=()=>{b({year:null,month:null,weekStartDate:null}),C("year")},Ht=M.useMemo(()=>[..._,...Z],[_,Z]),Kt=M.useMemo(()=>{const v=Ht.length,k=Math.max(0,v-U-nt),K=Math.min(v,v-nt);return Ht.slice(k,K)},[Ht,nt,U]),qt={top:40,right:20,bottom:40,left:40},De=800,_t=De-qt.left-qt.right,ut=(typeof u=="number"?u:400)-qt.top-qt.bottom,zt=M.useMemo(()=>Wr().domain(Kt.map(v=>v.id)).range([0,_t]).padding(.3),[Kt,_t]),kt=M.useMemo(()=>{const v=Math.max(...Kt.map(k=>k.value),0);return ls().domain([0,v*1.1]).range([ut,0])},[Kt,ut]),kr=async()=>{if(r?.apiKey){W(!0);try{const v=new Ig(r.apiKey,r.model),k=_.slice(-U),K=await v.predictNext(k,3,e);O(K),mt(0)}catch(v){console.error(v)}finally{W(!1)}}},zn=()=>{nt>0&&mt(v=>Math.max(0,v-1))},Rr=()=>{Ht.length>U+nt&&mt(v=>v+1)},ln=Ht.length>U+nt,Xt=nt>0,ke=f?.background||"#fff",fn=f?.bar?.radius??4,dn=f?.bar?.opacity??1,Re=f?.bar?.maxWidth??60,hn=f?.grid?.stroke||"#eee",Or=f?.grid?.strokeDasharray||"4 4",mn=f?.grid?.visible!==!1,Xn=f?.axis?.labelColor||"#9ca3af",Jn=f?.axis?.tickColor||"#9ca3af",pn=f?.axis?.fontSize||10;return P.jsxs("div",{className:`smart-bar-chart-wrapper ${l}`,style:{width:c,display:"flex",flexDirection:"column",gap:10,fontFamily:"sans-serif",background:ke,padding:16,borderRadius:12,position:"relative"},children:[P.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",height:40},children:[P.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",marginRight:10},children:A?P.jsxs(P.Fragment,{children:[P.jsx("div",{style:{fontSize:14,fontWeight:"bold"},children:A.label}),P.jsxs("div",{style:{fontSize:12,color:"#666"},children:["Total: ",A.value]})]}):P.jsx("div",{style:{fontSize:12,color:"#999"},children:"Detailed Info Area"})}),r&&P.jsx("button",{onClick:kr,disabled:at,style:{fontSize:10,padding:"6px 12px",cursor:"pointer",background:"#6366f1",color:"white",border:"none",borderRadius:4,fontWeight:"bold"},children:at?"Running...":"Predict AI"}),P.jsx("button",{onClick:()=>y?w(!1):Ae(),style:{marginLeft:10,padding:6,cursor:"pointer",background:"#fff",border:"1px solid #ddd",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center"},children:P.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#666",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[P.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),P.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),P.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),P.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),y&&P.jsxs("div",{style:{position:"absolute",top:60,left:"50%",transform:"translateX(-50%)",width:260,background:"#fff",border:"1px solid #e0e0e0",borderRadius:12,boxShadow:"0 10px 25px rgba(0,0,0,0.15)",zIndex:30,padding:16,fontFamily:"sans-serif"},children:[P.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:16,alignItems:"center"},children:[x!=="year"&&P.jsx("button",{onClick:()=>{x==="week"?(C("month"),b(v=>({...v,weekStartDate:null}))):(C("year"),b(v=>({...v,month:null,weekStartDate:null})))},style:{background:"none",border:"none",cursor:"pointer",fontSize:13,color:"#6366f1",fontWeight:600},children:"< Back"}),P.jsx("div",{style:{fontSize:14,fontWeight:"bold",color:"#1f2937",flex:1,textAlign:x!=="year"?"center":"left"},children:x==="year"?"Select Year":x==="month"?`${g.year}`:`${ct(new Date(g.year,g.month,1),"MMM yyyy")}`}),P.jsx("button",{onClick:()=>{qn()},style:{background:"none",border:"none",cursor:"pointer",fontSize:12,color:"#ef4444"},children:"Reset"})]}),P.jsxs("div",{style:{display:"grid",gridTemplateColumns:x==="week"?"1fr":"repeat(3, 1fr)",gap:8},children:[x==="year"&&V.map(v=>P.jsx("button",{onClick:()=>F(v),style:{padding:"8px 4px",fontSize:13,border:"1px solid",borderColor:g.year===v?"#6366f1":"#eee",borderRadius:6,background:g.year===v?"#e0e7ff":"#fff",color:g.year===v?"#4338ca":"#374151",cursor:"pointer",transition:"all 0.2s"},children:v},v)),x==="month"&&Array.from({length:12}).map((v,k)=>P.jsx("button",{onClick:()=>q(k),style:{padding:"8px 4px",fontSize:13,border:"1px solid",borderColor:g.month===k?"#6366f1":"#eee",borderRadius:6,background:g.month===k?"#e0e7ff":"#fff",color:g.month===k?"#4338ca":"#374151",cursor:"pointer",transition:"all 0.2s"},children:ct(new Date(2e3,k,1),"MMM")},k)),x==="week"&&g.year&&g.month!==null&&fl({start:new Date(g.year,g.month,1),end:cl(new Date(g.year,g.month,1))}).map((v,k)=>{const K=Ts(v),it=`${ct(v,"d")} - ${ct(K,"d MMM")}`;return P.jsxs("button",{onClick:()=>z(v),style:{padding:"8px 12px",fontSize:13,border:"1px solid",borderColor:g.weekStartDate?.getTime()===v.getTime()?"#6366f1":"#eee",borderRadius:6,background:"#fff",color:"#374151",cursor:"pointer",transition:"all 0.2s",textAlign:"left"},children:["Week ",k+1,": ",it]},v.toISOString())})]}),P.jsxs("div",{style:{display:"flex",gap:8,marginTop:16},children:[P.jsx("button",{onClick:Ct,style:{flex:1,padding:"8px",background:"#6366f1",color:"#fff",border:"none",borderRadius:6,fontSize:13,fontWeight:"bold",cursor:"pointer"},children:"Confirm"}),P.jsx("button",{onClick:()=>w(!1),style:{flex:1,padding:"8px",background:"#f3f4f6",color:"#374151",border:"none",borderRadius:6,fontSize:13,fontWeight:"bold",cursor:"pointer"},children:"Cancel"})]})]})]}),P.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[P.jsx("button",{onClick:Rr,disabled:!ln,style:{flexShrink:0,width:40,height:40,borderRadius:"50%",border:"1px solid #ddd",background:"#fff",cursor:ln?"pointer":"default",opacity:ln?1:.3,display:"flex",alignItems:"center",justifyContent:"center",fontSize:18,color:"#333",marginRight:10},children:"<"}),P.jsx("div",{style:{flexGrow:1,height:typeof u=="number"?u:400,position:"relative"},children:P.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${De} ${typeof u=="number"?u:400}`,preserveAspectRatio:"none",style:{overflow:"visible"},role:"img","aria-label":"Bar chart showing data over time",children:P.jsxs("g",{transform:`translate(${qt.left},${qt.top})`,children:[mn&&kt.ticks(5).map(v=>P.jsxs("g",{transform:`translate(0, ${kt(v)})`,children:[P.jsx("line",{x1:0,x2:_t,stroke:hn,strokeDasharray:Or}),P.jsx("text",{x:-10,y:4,textAnchor:"end",fontSize:pn,fill:Jn,children:v})]},`y-tick-${v}`)),P.jsx("line",{x1:0,y1:ut,x2:_t,y2:ut,stroke:hn}),P.jsx("line",{x1:0,y1:0,x2:0,y2:ut,stroke:hn}),s?.y&&P.jsx("text",{x:-30,y:ut/2,transform:`rotate(-90, -30, ${ut/2})`,textAnchor:"middle",fill:Xn,fontSize:12,children:s.y}),s?.x&&P.jsx("text",{x:_t/2,y:ut+35,textAnchor:"middle",fill:Xn,fontSize:12,children:s.x}),Kt.map(v=>{const k=zt(v.id),K=zt.bandwidth(),it=Math.min(K,Re),xt=k+(K-it)/2,Pt=kt(v.value),Jt=ut-Pt;if(k===void 0)return null;const Rt=A?.id===v.id,ce=A!==null&&!Rt;if(n==="stacked"&&v.stackedValues){let Ot=ut;return P.jsxs("g",{onMouseEnter:()=>B(v),onMouseLeave:()=>B(null),onClick:()=>B(A===v?null:v),style:{opacity:ce?.3:1,transition:"opacity 0.3s"},children:[v.stackedValues.map((Zn,gn)=>{const Oe=Math.abs(kt(Zn.value)-kt(0)),yn=Ot-Oe,Lt=gn===v.stackedValues.length-1,Ve=gn===0,ti=d(xt,yn,it,Oe,fn,{tl:Lt,tr:Lt,bl:Ve,br:Ve}),Vr=P.jsx("path",{d:ti,fill:Zn.color,opacity:dn,stroke:Rt?"#fff":"none",strokeWidth:Rt?1:0},`${v.id}-${gn}`);return Ot=yn,Vr}),P.jsx("rect",{x:xt,y:Pt,width:it,height:Jt,fill:"transparent"})]},v.id)}return P.jsxs("g",{children:[P.jsx(ig,{x:xt,y:Pt,width:it,height:Jt,data:v,isActive:Rt,isDimmed:ce,onHover:B,onClick:Ot=>{B(Ot===A?null:Ot)},style:{rx:fn,fillOpacity:dn},"aria-label":`${v.label}: ${v.value}`,role:"graphics-symbol"}),Rt&&P.jsx("text",{x:xt+it/2,y:Pt-5,textAnchor:"middle",fill:"#333",fontSize:12,fontWeight:"bold",pointerEvents:"none",children:v.value})]},v.id)}),Kt.map(v=>{const k=zt(v.id);return k===void 0?null:P.jsx("text",{x:k+zt.bandwidth()/2,y:ut+15,textAnchor:"middle",fill:Jn,fontSize:pn,children:v.label},`label-${v.id}`)})]})})}),P.jsx("button",{onClick:zn,disabled:!Xt,style:{flexShrink:0,width:40,height:40,borderRadius:"50%",border:"1px solid #ddd",background:"#fff",cursor:Xt?"pointer":"default",opacity:Xt?1:.3,display:"flex",alignItems:"center",justifyContent:"center",fontSize:18,color:"#333",marginLeft:10},children:">"})]})]})};Zt.SmartBarChart=Ng,Object.defineProperty(Zt,Symbol.toStringTag,{value:"Module"})}));
34
+ `},[v,w]=C.useState({year:null,month:null,weekStartDate:null}),[S,E]=C.useState({year:null,month:null,weekStartDate:null}),[V,L]=C.useState(!1),[D,B]=C.useState("year"),Z=C.useMemo(()=>a,[a.date,a.label,Array.isArray(a.value)?a.value.join(","):a.value]),R=C.useMemo(()=>{const g=new Set(t.map(A=>wf(new Date(A[Z.date]))));return Array.from(g).sort((A,Y)=>Y-A)},[t,Z.date]),Q=Ff({data:t,view:e,dataKeys:Z,colors:c,missingDataStrategy:r}),[j,X]=C.useState(null),[gt,Et]=C.useState([]),[W,J]=C.useState(!1),U=e==="month"?12:7,[at,_t]=C.useState(0);C.useEffect(()=>{_t(0),Et([]),e==="month"?(w(g=>g.month!==null||g.weekStartDate!==null?{...g,month:null,weekStartDate:null}:g),B("year")):e==="week"&&(w(g=>g.weekStartDate!==null?{...g,weekStartDate:null}:g),B("month"))},[e]),C.useEffect(()=>{if(!v.year&&!v.weekStartDate&&v.month===null)return;Et([]);let g=null;if(v.weekStartDate?g=v.weekStartDate:v.month!==null&&v.year?g=new Date(v.year,v.month,1):v.year&&(g=new Date(v.year,0,1)),g&&Q.length>0){const A=Q.findIndex(Y=>Y.date.getTime()>=g.getTime());if(A!==-1){const Y=Q.length,st=Math.max(0,Y-U-A);_t(st)}}},[v,Q,U]);const ri=g=>{E({year:g,month:null,weekStartDate:null}),B("month")},si=g=>{E(A=>({...A,month:g,weekStartDate:null})),B("week")},Yr=g=>{E(A=>({...A,weekStartDate:g}))},Hr=()=>{w(S),L(!1);let g;S.weekStartDate?g="day":S.month!==null?g="week":S.year!==null&&(g="month"),g&&f?.(g)},bn=()=>{E(v),B(v.year?v.month!==null?"week":"month":"year"),L(!0)},wn=()=>{E({year:null,month:null,weekStartDate:null}),B("year")},Lt=C.useMemo(()=>[...Q,...gt],[Q,gt]),jt=C.useMemo(()=>{const g=Lt.length,A=Math.max(0,g-U-at),Y=Math.min(g,g-at);return Lt.slice(A,Y)},[Lt,at,U]),vt={top:40,right:20,bottom:40,left:40},oi=800,Mt=oi-vt.left-vt.right,ft=(typeof m=="number"?m:400)-vt.top-vt.bottom,_=i==="horizontal",Ft=C.useMemo(()=>es().domain(jt.map(g=>g.id)).range(_?[0,ft]:[0,Mt]).padding(.3),[jt,Mt,ft,_]),xt=C.useMemo(()=>{const g=Math.max(...jt.map(A=>A.value),0);return Ss().domain([0,g*1.1]).range(_?[0,Mt]:[ft,0])},[jt,Mt,ft,_]),ai=async()=>{if(u?.apiKey){J(!0);try{const g=new Yg(u.apiKey,u.model),A=Q.slice(-U),Y=await g.predictNext(A,3,e);Et(Y),_t(0)}catch(g){console.error(g)}finally{J(!1)}}},ui=()=>{at>0&&_t(g=>Math.max(0,g-1))},je=()=>{Lt.length>U+at&&_t(g=>g+1)},Tn=Lt.length>U+at,Sn=at>0,En=x?.background||"#fff",ci=x?.bar?.radius??4,li=x?.bar?.opacity??1,fi=x?.bar?.maxWidth??60,Fe=x?.grid?.stroke||"#eee",di=x?.grid?.strokeDasharray||"4 4",Gr=x?.grid?.visible!==!1,Mn=x?.axis?.labelColor||"#9ca3af",Cn=x?.axis?.tickColor||"#9ca3af",hi=x?.axis?.fontSize||10;return P.jsxs("div",{className:`smart-bar-chart-wrapper ${T}`,style:{width:p,display:"flex",flexDirection:"column",gap:10,fontFamily:"sans-serif",background:En,padding:16,borderRadius:12,position:"relative"},children:[P.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",height:40},children:[P.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",marginRight:10},children:j?P.jsxs(P.Fragment,{children:[P.jsx("div",{style:{fontSize:14,fontWeight:"bold"},children:j.label}),P.jsxs("div",{style:{fontSize:12,color:"#666"},children:["Total: ",j.value]})]}):P.jsx("div",{style:{fontSize:12,color:"#999"},children:"Detailed Info Area"})}),u&&P.jsx("button",{onClick:ai,disabled:W,style:{fontSize:10,padding:"6px 12px",cursor:"pointer",background:"#6366f1",color:"white",border:"none",borderRadius:4,fontWeight:"bold"},children:W?"Running...":"Predict AI"}),P.jsx("button",{onClick:()=>V?L(!1):bn(),style:{marginLeft:10,padding:6,cursor:"pointer",background:"#fff",border:"1px solid #ddd",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center"},children:P.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#666",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[P.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),P.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),P.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),P.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),V&&P.jsxs("div",{style:{position:"absolute",top:60,left:"50%",transform:"translateX(-50%)",width:260,background:"#fff",border:"1px solid #e0e0e0",borderRadius:12,boxShadow:"0 10px 25px rgba(0,0,0,0.15)",zIndex:30,padding:16,fontFamily:"sans-serif"},children:[P.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:16,alignItems:"center"},children:[D!=="year"&&P.jsx("button",{onClick:()=>{D==="week"?(B("month"),E(g=>({...g,weekStartDate:null}))):(B("year"),E(g=>({...g,month:null,weekStartDate:null})))},style:{background:"none",border:"none",cursor:"pointer",fontSize:13,color:"#6366f1",fontWeight:600},children:"< Back"}),P.jsx("div",{style:{fontSize:14,fontWeight:"bold",color:"#1f2937",flex:1,textAlign:D!=="year"?"center":"left"},children:D==="year"?"Select Year":D==="month"?`${S.year}`:`${G(new Date(S.year,S.month,1),"MMM yyyy")}`}),P.jsx("button",{onClick:()=>{wn()},style:{background:"none",border:"none",cursor:"pointer",fontSize:12,color:"#ef4444"},children:"Reset"})]}),P.jsxs("div",{style:{display:"grid",gridTemplateColumns:D==="week"?"1fr":"repeat(3, 1fr)",gap:8},children:[D==="year"&&R.map(g=>P.jsx("button",{onClick:()=>ri(g),style:{padding:"8px 4px",fontSize:13,border:"1px solid",borderColor:S.year===g?"#6366f1":"#eee",borderRadius:6,background:S.year===g?"#e0e7ff":"#fff",color:S.year===g?"#4338ca":"#374151",cursor:"pointer",transition:"all 0.2s"},children:g},g)),D==="month"&&Array.from({length:12}).map((g,A)=>P.jsx("button",{onClick:()=>si(A),style:{padding:"8px 4px",fontSize:13,border:"1px solid",borderColor:S.month===A?"#6366f1":"#eee",borderRadius:6,background:S.month===A?"#e0e7ff":"#fff",color:S.month===A?"#4338ca":"#374151",cursor:"pointer",transition:"all 0.2s"},children:G(new Date(2e3,A,1),"MMM")},A)),D==="week"&&S.year&&S.month!==null&&Ns({start:new Date(S.year,S.month,1),end:xl(new Date(S.year,S.month,1))}).map((g,A)=>{const Y=Mi(g),st=`${G(g,"d")} - ${G(Y,"d MMM")}`;return P.jsxs("button",{onClick:()=>Yr(g),style:{padding:"8px 12px",fontSize:13,border:"1px solid",borderColor:S.weekStartDate?.getTime()===g.getTime()?"#6366f1":"#eee",borderRadius:6,background:"#fff",color:"#374151",cursor:"pointer",transition:"all 0.2s",textAlign:"left"},children:["Week ",A+1,": ",st]},g.toISOString())})]}),P.jsxs("div",{style:{display:"flex",gap:8,marginTop:16},children:[P.jsx("button",{onClick:Hr,style:{flex:1,padding:"8px",background:"#6366f1",color:"#fff",border:"none",borderRadius:6,fontSize:13,fontWeight:"bold",cursor:"pointer"},children:"Confirm"}),P.jsx("button",{onClick:()=>L(!1),style:{flex:1,padding:"8px",background:"#f3f4f6",color:"#374151",border:"none",borderRadius:6,fontSize:13,fontWeight:"bold",cursor:"pointer"},children:"Cancel"})]})]})]}),P.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[P.jsx("button",{onClick:je,disabled:!Tn,style:{flexShrink:0,width:40,height:40,borderRadius:"50%",border:"1px solid #ddd",background:"#fff",cursor:Tn?"pointer":"default",opacity:Tn?1:.3,display:"flex",alignItems:"center",justifyContent:"center",fontSize:18,color:"#333",marginRight:10},children:"<"}),P.jsxs("div",{style:{flexGrow:1,height:typeof m=="number"?m:400,position:"relative"},children:[P.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${oi} ${typeof m=="number"?m:400}`,preserveAspectRatio:"none",style:{overflow:"visible"},role:"img","aria-label":"Bar chart showing data over time",children:P.jsxs("g",{transform:`translate(${vt.left},${vt.top})`,children:[Gr&&xt.ticks(5).map(g=>{const A=xt(g);return P.jsxs("g",{transform:_?`translate(${A}, 0)`:`translate(0, ${A})`,children:[P.jsx("line",{x1:0,y1:0,x2:_?0:Mt,y2:_?ft:0,stroke:Fe,strokeDasharray:di}),P.jsx("text",{x:_?0:-10,y:_?ft+15:4,textAnchor:_?"middle":"end",fontSize:hi,fill:Cn,children:o(g)})]},`val-tick-${g}`)}),s.map((g,A)=>{const Y=xt(g.value);return isNaN(Y)?null:P.jsxs("g",{transform:_?`translate(${Y}, 0)`:`translate(0, ${Y})`,children:[P.jsx("line",{x1:0,y1:0,x2:_?0:Mt,y2:_?ft:0,stroke:g.color||"#ef4444",strokeDasharray:g.strokeDasharray||"4 4",strokeWidth:2}),g.label&&P.jsx("text",{x:_?0:Mt,y:-5,textAnchor:_?"middle":"end",fill:g.color||"#ef4444",fontSize:10,fontWeight:"bold",children:g.label})]},`annotation-${A}`)}),P.jsx("line",{x1:0,y1:ft,x2:Mt,y2:ft,stroke:Fe}),P.jsx("line",{x1:0,y1:0,x2:0,y2:ft,stroke:Fe}),l?.y&&P.jsx("text",{x:-30,y:ft/2,transform:`rotate(-90, -30, ${ft/2})`,textAnchor:"middle",fill:Mn,fontSize:12,children:l.y}),l?.x&&P.jsx("text",{x:Mt/2,y:ft+35,textAnchor:"middle",fill:Mn,fontSize:12,children:l.x}),jt.map(g=>{const A=Ft(g.id),Y=Ft.bandwidth(),st=Math.min(Y,fi),bt=A+(Y-st)/2,Ut=xt(g.value),Ct=xt(0);if(A===void 0)return null;const Vt=j?.id===g.id,Pt=j!==null&&!Vt,Yt=Math.abs(Ct-Ut),ee=_?Ct:bt,ge=_?bt:Ut,$e=_?Yt:st,Be=_?st:Yt;if((n==="stacked"||n==="grouped")&&g.stackedValues){let Ht=Ct;const ye=st/g.stackedValues.length;return P.jsxs("g",{onMouseEnter:()=>X(g),onMouseLeave:()=>X(null),onClick:()=>X(j===g?null:g),style:{opacity:Pt?.3:1,transition:"opacity 0.3s"},children:[g.stackedValues.map((We,Gt)=>{const ne=Math.abs(xt(We.value)-xt(0));let ie,re,ve,xe,Ue={tl:!1,tr:!1,bl:!1,br:!1};if(n==="stacked")if(_){ie=Ht,re=bt,ve=ne,xe=st;const b=Gt===0,M=Gt===g.stackedValues.length-1;Ue={tl:b,bl:b,tr:M,br:M},Ht+=ne}else{xe=ne,re=Ht-ne,ie=bt,ve=st;const b=Gt===g.stackedValues.length-1,M=Gt===0;Ue={tl:b,tr:b,bl:M,br:M},Ht=re}else _?(ie=Ct,re=bt+Gt*ye,ve=ne,xe=ye):(ie=bt+Gt*ye,re=xt(We.value),ve=ye,xe=ne),Ue={tl:!_,tr:!0,bl:_,br:_};const h=y(ie,re,ve,xe,ci,Ue);return P.jsx("path",{d:h,fill:We.color,opacity:li,stroke:Vt?"#fff":"none",strokeWidth:Vt?1:0},`${g.id}-${Gt}`)}),P.jsx("rect",{x:ee,y:ge,width:$e,height:Be,fill:"transparent"})]},g.id)}return P.jsxs("g",{children:[P.jsx(hg,{x:ee,y:ge,width:$e,height:Be,data:g,isActive:Vt,isDimmed:Pt,onHover:X,onClick:Ht=>{X(Ht===j?null:Ht)},style:{rx:ci,fillOpacity:li},"aria-label":`${g.label}: ${g.value}`,role:"graphics-symbol"}),Vt&&P.jsx("text",{x:_?ee+$e+10:ee+$e/2,y:_?ge+Be/2+4:ge-5,textAnchor:_?"start":"middle",fill:"#333",fontSize:12,fontWeight:"bold",pointerEvents:"none",children:o(g.value)})]},g.id)}),jt.map(g=>{const A=Ft(g.id);return A===void 0?null:P.jsx("text",{x:_?-10:A+Ft.bandwidth()/2,y:_?A+Ft.bandwidth()/2+4:ft+15,textAnchor:_?"end":"middle",fill:Cn,fontSize:hi,children:g.label},`label-${g.id}`)})]})}),d&&j&&P.jsx("div",{style:{position:"absolute",top:vt.top,right:vt.right+20,pointerEvents:"none",zIndex:10},children:d(j)})]}),P.jsx("button",{onClick:ui,disabled:!Sn,style:{flexShrink:0,width:40,height:40,borderRadius:"50%",border:"1px solid #ddd",background:"#fff",cursor:Sn?"pointer":"default",opacity:Sn?1:.3,display:"flex",alignItems:"center",justifyContent:"center",fontSize:18,color:"#333",marginLeft:10},children:">"})]})]})};se.SmartBarChart=Hg,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})}));