react-pro-messenger 1.0.44 → 1.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.
package/dist/index.umd.js CHANGED
@@ -1,21 +1,21 @@
1
- (function(he,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],x):(he=typeof globalThis<"u"?globalThis:he||self,x(he.ReactProMessenger={},he.React,he.ReactDOM))})(this,function(he,x,Ue){"use strict";var Nd=Object.defineProperty;var Fd=(he,x,Ue)=>x in he?Nd(he,x,{enumerable:!0,configurable:!0,writable:!0,value:Ue}):he[x]=Ue;var we=(he,x,Ue)=>(Fd(he,typeof x!="symbol"?x+"":x,Ue),Ue);function ia(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const rn=ia(x);var p={exports:{}},dt={};var Fr;function oa(){if(Fr)return dt;Fr=1;var e=x,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(a,l,u){var c,f={},h=null,m=null;u!==void 0&&(h=""+u),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(m=l.ref);for(c in l)r.call(l,c)&&!i.hasOwnProperty(c)&&(f[c]=l[c]);if(a&&a.defaultProps)for(c in l=a.defaultProps,l)f[c]===void 0&&(f[c]=l[c]);return{$$typeof:t,type:a,key:h,ref:m,props:f,_owner:s.current}}return dt.Fragment=n,dt.jsx=o,dt.jsxs=o,dt}var ht={};var Br;function aa(){return Br||(Br=1,process.env.NODE_ENV!=="production"&&function(){var e=x,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),v=Symbol.iterator,y="@@iterator";function w(d){if(d===null||typeof d!="object")return null;var S=v&&d[v]||d[y];return typeof S=="function"?S:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(d){{for(var S=arguments.length,M=new Array(S>1?S-1:0),U=1;U<S;U++)M[U-1]=arguments[U];P("error",d,M)}}function P(d,S,M){{var U=b.ReactDebugCurrentFrame,X=U.getStackAddendum();X!==""&&(S+="%s",M=M.concat([X]));var te=M.map(function(G){return String(G)});te.unshift("Warning: "+S),Function.prototype.apply.call(console[d],console,te)}}var L=!1,g=!1,O=!1,Y=!1,R=!1,Q;Q=Symbol.for("react.module.reference");function F(d){return!!(typeof d=="string"||typeof d=="function"||d===r||d===i||R||d===s||d===u||d===c||Y||d===m||L||g||O||typeof d=="object"&&d!==null&&(d.$$typeof===h||d.$$typeof===f||d.$$typeof===o||d.$$typeof===a||d.$$typeof===l||d.$$typeof===Q||d.getModuleId!==void 0))}function I(d,S,M){var U=d.displayName;if(U)return U;var X=S.displayName||S.name||"";return X!==""?M+"("+X+")":M}function oe(d){return d.displayName||"Context"}function ee(d){if(d==null)return null;if(typeof d.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case s:return"StrictMode";case u:return"Suspense";case c:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case a:var S=d;return oe(S)+".Consumer";case o:var M=d;return oe(M._context)+".Provider";case l:return I(d,d.render,"ForwardRef");case f:var U=d.displayName||null;return U!==null?U:ee(d.type)||"Memo";case h:{var X=d,te=X._payload,G=X._init;try{return ee(G(te))}catch{return null}}}return null}var ae=Object.assign,Se=0,pe,q,le,K,T,V,z;function W(){}W.__reactDisabledLog=!0;function $(){{if(Se===0){pe=console.log,q=console.info,le=console.warn,K=console.error,T=console.group,V=console.groupCollapsed,z=console.groupEnd;var d={configurable:!0,enumerable:!0,value:W,writable:!0};Object.defineProperties(console,{info:d,log:d,warn:d,error:d,group:d,groupCollapsed:d,groupEnd:d})}Se++}}function D(){{if(Se--,Se===0){var d={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ae({},d,{value:pe}),info:ae({},d,{value:q}),warn:ae({},d,{value:le}),error:ae({},d,{value:K}),group:ae({},d,{value:T}),groupCollapsed:ae({},d,{value:V}),groupEnd:ae({},d,{value:z})})}Se<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var E=b.ReactCurrentDispatcher,A;function k(d,S,M){{if(A===void 0)try{throw Error()}catch(X){var U=X.stack.trim().match(/\n( *(at )?)/);A=U&&U[1]||""}return`
2
- `+A+d}}var B=!1,_;{var ce=typeof WeakMap=="function"?WeakMap:Map;_=new ce}function j(d,S){if(!d||B)return"";{var M=_.get(d);if(M!==void 0)return M}var U;B=!0;var X=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var te;te=E.current,E.current=null,$();try{if(S){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(ke){U=ke}Reflect.construct(d,[],G)}else{try{G.call()}catch(ke){U=ke}d.call(G.prototype)}}else{try{throw Error()}catch(ke){U=ke}d()}}catch(ke){if(ke&&U&&typeof ke.stack=="string"){for(var H=ke.stack.split(`
3
- `),be=U.stack.split(`
4
- `),fe=H.length-1,de=be.length-1;fe>=1&&de>=0&&H[fe]!==be[de];)de--;for(;fe>=1&&de>=0;fe--,de--)if(H[fe]!==be[de]){if(fe!==1||de!==1)do if(fe--,de--,de<0||H[fe]!==be[de]){var je=`
5
- `+H[fe].replace(" at new "," at ");return d.displayName&&je.includes("<anonymous>")&&(je=je.replace("<anonymous>",d.displayName)),typeof d=="function"&&_.set(d,je),je}while(fe>=1&&de>=0);break}}}finally{B=!1,E.current=te,D(),Error.prepareStackTrace=X}var ft=d?d.displayName||d.name:"",sa=ft?k(ft):"";return typeof d=="function"&&_.set(d,sa),sa}function Ee(d,S,M){return j(d,!1)}function ct(d){var S=d.prototype;return!!(S&&S.isReactComponent)}function Ge(d,S,M){if(d==null)return"";if(typeof d=="function")return j(d,ct(d));if(typeof d=="string")return k(d);switch(d){case u:return k("Suspense");case c:return k("SuspenseList")}if(typeof d=="object")switch(d.$$typeof){case l:return Ee(d.render);case f:return Ge(d.type,S,M);case h:{var U=d,X=U._payload,te=U._init;try{return Ge(te(X),S,M)}catch{}}}return""}var tn=Object.prototype.hasOwnProperty,Ko={},Ho=b.ReactDebugCurrentFrame;function nn(d){if(d){var S=d._owner,M=Ge(d.type,d._source,S?S.type:null);Ho.setExtraStackFrame(M)}else Ho.setExtraStackFrame(null)}function vd(d,S,M,U,X){{var te=Function.call.bind(tn);for(var G in d)if(te(d,G)){var H=void 0;try{if(typeof d[G]!="function"){var be=Error((U||"React class")+": "+M+" type `"+G+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof d[G]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw be.name="Invariant Violation",be}H=d[G](S,G,U,M,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(fe){H=fe}H&&!(H instanceof Error)&&(nn(X),C("%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).",U||"React class",M,G,typeof H),nn(null)),H instanceof Error&&!(H.message in Ko)&&(Ko[H.message]=!0,nn(X),C("Failed %s type: %s",M,H.message),nn(null))}}}var xd=Array.isArray;function Lr(d){return xd(d)}function bd(d){{var S=typeof Symbol=="function"&&Symbol.toStringTag,M=S&&d[Symbol.toStringTag]||d.constructor.name||"Object";return M}}function wd(d){try{return qo(d),!1}catch{return!0}}function qo(d){return""+d}function Go(d){if(wd(d))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",bd(d)),qo(d)}var Lt=b.ReactCurrentOwner,Td={key:!0,ref:!0,__self:!0,__source:!0},Xo,Zo,kr;kr={};function Sd(d){if(tn.call(d,"ref")){var S=Object.getOwnPropertyDescriptor(d,"ref").get;if(S&&S.isReactWarning)return!1}return d.ref!==void 0}function Cd(d){if(tn.call(d,"key")){var S=Object.getOwnPropertyDescriptor(d,"key").get;if(S&&S.isReactWarning)return!1}return d.key!==void 0}function Pd(d,S){if(typeof d.ref=="string"&&Lt.current&&S&&Lt.current.stateNode!==S){var M=ee(Lt.current.type);kr[M]||(C('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',ee(Lt.current.type),d.ref),kr[M]=!0)}}function Ed(d,S){{var M=function(){Xo||(Xo=!0,C("%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)",S))};M.isReactWarning=!0,Object.defineProperty(d,"key",{get:M,configurable:!0})}}function jd(d,S){{var M=function(){Zo||(Zo=!0,C("%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)",S))};M.isReactWarning=!0,Object.defineProperty(d,"ref",{get:M,configurable:!0})}}var Ad=function(d,S,M,U,X,te,G){var H={$$typeof:t,type:d,key:S,ref:M,props:G,_owner:te};return H._store={},Object.defineProperty(H._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(H,"_self",{configurable:!1,enumerable:!1,writable:!1,value:U}),Object.defineProperty(H,"_source",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.freeze&&(Object.freeze(H.props),Object.freeze(H)),H};function Md(d,S,M,U,X){{var te,G={},H=null,be=null;M!==void 0&&(Go(M),H=""+M),Cd(S)&&(Go(S.key),H=""+S.key),Sd(S)&&(be=S.ref,Pd(S,X));for(te in S)tn.call(S,te)&&!Td.hasOwnProperty(te)&&(G[te]=S[te]);if(d&&d.defaultProps){var fe=d.defaultProps;for(te in fe)G[te]===void 0&&(G[te]=fe[te])}if(H||be){var de=typeof d=="function"?d.displayName||d.name||"Unknown":d;H&&Ed(G,de),be&&jd(G,de)}return Ad(d,H,be,X,U,Lt.current,G)}}var _r=b.ReactCurrentOwner,Jo=b.ReactDebugCurrentFrame;function ut(d){if(d){var S=d._owner,M=Ge(d.type,d._source,S?S.type:null);Jo.setExtraStackFrame(M)}else Jo.setExtraStackFrame(null)}var Ir;Ir=!1;function Nr(d){return typeof d=="object"&&d!==null&&d.$$typeof===t}function Qo(){{if(_r.current){var d=ee(_r.current.type);if(d)return`
1
+ (function(pe,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],v):(pe=typeof globalThis<"u"?globalThis:pe||self,v(pe.ReactProMessenger={},pe.React,pe.ReactDOM))})(this,function(pe,v,Ke){"use strict";var Nd=Object.defineProperty;var Fd=(pe,v,Ke)=>v in pe?Nd(pe,v,{enumerable:!0,configurable:!0,writable:!0,value:Ke}):pe[v]=Ke;var Te=(pe,v,Ke)=>(Fd(pe,typeof v!="symbol"?v+"":v,Ke),Ke);function aa(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const an=aa(v);var p={exports:{}},mt={};var Ur;function la(){if(Ur)return mt;Ur=1;var e=v,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(a,l,c){var u,f={},h=null,m=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(m=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:h,ref:m,props:f,_owner:s.current}}return mt.Fragment=n,mt.jsx=o,mt.jsxs=o,mt}var gt={};var Wr;function ca(){return Wr||(Wr=1,process.env.NODE_ENV!=="production"&&function(){var e=v,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),y=Symbol.iterator,x="@@iterator";function S(d){if(d===null||typeof d!="object")return null;var C=y&&d[y]||d[x];return typeof C=="function"?C:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function P(d){{for(var C=arguments.length,R=new Array(C>1?C-1:0),F=1;F<C;F++)R[F-1]=arguments[F];j("error",d,R)}}function j(d,C,R){{var F=b.ReactDebugCurrentFrame,Z=F.getStackAddendum();Z!==""&&(C+="%s",R=R.concat([Z]));var re=R.map(function(G){return String(G)});re.unshift("Warning: "+C),Function.prototype.apply.call(console[d],console,re)}}var D=!1,g=!1,O=!1,Y=!1,k=!1,ee;ee=Symbol.for("react.module.reference");function M(d){return!!(typeof d=="string"||typeof d=="function"||d===r||d===i||k||d===s||d===c||d===u||Y||d===m||D||g||O||typeof d=="object"&&d!==null&&(d.$$typeof===h||d.$$typeof===f||d.$$typeof===o||d.$$typeof===a||d.$$typeof===l||d.$$typeof===ee||d.getModuleId!==void 0))}function q(d,C,R){var F=d.displayName;if(F)return F;var Z=C.displayName||C.name||"";return Z!==""?R+"("+Z+")":R}function ue(d){return d.displayName||"Context"}function W(d){if(d==null)return null;if(typeof d.tag=="number"&&P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case s:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case a:var C=d;return ue(C)+".Consumer";case o:var R=d;return ue(R._context)+".Provider";case l:return q(d,d.render,"ForwardRef");case f:var F=d.displayName||null;return F!==null?F:W(d.type)||"Memo";case h:{var Z=d,re=Z._payload,G=Z._init;try{return W(G(re))}catch{return null}}}return null}var le=Object.assign,ye=0,me,X,ce,ve,w,T,B;function $(){}$.__reactDisabledLog=!0;function I(){{if(ye===0){me=console.log,X=console.info,ce=console.warn,ve=console.error,w=console.group,T=console.groupCollapsed,B=console.groupEnd;var d={configurable:!0,enumerable:!0,value:$,writable:!0};Object.defineProperties(console,{info:d,log:d,warn:d,error:d,group:d,groupCollapsed:d,groupEnd:d})}ye++}}function K(){{if(ye--,ye===0){var d={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:le({},d,{value:me}),info:le({},d,{value:X}),warn:le({},d,{value:ce}),error:le({},d,{value:ve}),group:le({},d,{value:w}),groupCollapsed:le({},d,{value:T}),groupEnd:le({},d,{value:B})})}ye<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var N=b.ReactCurrentDispatcher,U;function z(d,C,R){{if(U===void 0)try{throw Error()}catch(Z){var F=Z.stack.trim().match(/\n( *(at )?)/);U=F&&F[1]||""}return`
2
+ `+U+d}}var A=!1,V;{var L=typeof WeakMap=="function"?WeakMap:Map;V=new L}function E(d,C){if(!d||A)return"";{var R=V.get(d);if(R!==void 0)return R}var F;A=!0;var Z=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var re;re=N.current,N.current=null,I();try{if(C){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(Ne){F=Ne}Reflect.construct(d,[],G)}else{try{G.call()}catch(Ne){F=Ne}d.call(G.prototype)}}else{try{throw Error()}catch(Ne){F=Ne}d()}}catch(Ne){if(Ne&&F&&typeof Ne.stack=="string"){for(var H=Ne.stack.split(`
3
+ `),Ee=F.stack.split(`
4
+ `),de=H.length-1,he=Ee.length-1;de>=1&&he>=0&&H[de]!==Ee[he];)he--;for(;de>=1&&he>=0;de--,he--)if(H[de]!==Ee[he]){if(de!==1||he!==1)do if(de--,he--,he<0||H[de]!==Ee[he]){var Re=`
5
+ `+H[de].replace(" at new "," at ");return d.displayName&&Re.includes("<anonymous>")&&(Re=Re.replace("<anonymous>",d.displayName)),typeof d=="function"&&V.set(d,Re),Re}while(de>=1&&he>=0);break}}}finally{A=!1,N.current=re,K(),Error.prepareStackTrace=Z}var pt=d?d.displayName||d.name:"",oa=pt?z(pt):"";return typeof d=="function"&&V.set(d,oa),oa}function ne(d,C,R){return E(d,!1)}function te(d){var C=d.prototype;return!!(C&&C.isReactComponent)}function xe(d,C,R){if(d==null)return"";if(typeof d=="function")return E(d,te(d));if(typeof d=="string")return z(d);switch(d){case c:return z("Suspense");case u:return z("SuspenseList")}if(typeof d=="object")switch(d.$$typeof){case l:return ne(d.render);case f:return xe(d.type,C,R);case h:{var F=d,Z=F._payload,re=F._init;try{return xe(re(Z),C,R)}catch{}}}return""}var we=Object.prototype.hasOwnProperty,dt={},on=b.ReactDebugCurrentFrame;function Qe(d){if(d){var C=d._owner,R=xe(d.type,d._source,C?C.type:null);on.setExtraStackFrame(R)}else on.setExtraStackFrame(null)}function Ye(d,C,R,F,Z){{var re=Function.call.bind(we);for(var G in d)if(re(d,G)){var H=void 0;try{if(typeof d[G]!="function"){var Ee=Error((F||"React class")+": "+R+" type `"+G+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof d[G]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ee.name="Invariant Violation",Ee}H=d[G](C,G,F,R,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(de){H=de}H&&!(H instanceof Error)&&(Qe(Z),P("%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).",F||"React class",R,G,typeof H),Qe(null)),H instanceof Error&&!(H.message in dt)&&(dt[H.message]=!0,Qe(Z),P("Failed %s type: %s",R,H.message),Qe(null))}}}var xd=Array.isArray;function Ir(d){return xd(d)}function bd(d){{var C=typeof Symbol=="function"&&Symbol.toStringTag,R=C&&d[Symbol.toStringTag]||d.constructor.name||"Object";return R}}function wd(d){try{return Xo(d),!1}catch{return!0}}function Xo(d){return""+d}function Zo(d){if(wd(d))return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",bd(d)),Xo(d)}var Nt=b.ReactCurrentOwner,Td={key:!0,ref:!0,__self:!0,__source:!0},Jo,Qo,Nr;Nr={};function Sd(d){if(we.call(d,"ref")){var C=Object.getOwnPropertyDescriptor(d,"ref").get;if(C&&C.isReactWarning)return!1}return d.ref!==void 0}function Cd(d){if(we.call(d,"key")){var C=Object.getOwnPropertyDescriptor(d,"key").get;if(C&&C.isReactWarning)return!1}return d.key!==void 0}function Pd(d,C){if(typeof d.ref=="string"&&Nt.current&&C&&Nt.current.stateNode!==C){var R=W(Nt.current.type);Nr[R]||(P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',W(Nt.current.type),d.ref),Nr[R]=!0)}}function Ed(d,C){{var R=function(){Jo||(Jo=!0,P("%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)",C))};R.isReactWarning=!0,Object.defineProperty(d,"key",{get:R,configurable:!0})}}function jd(d,C){{var R=function(){Qo||(Qo=!0,P("%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)",C))};R.isReactWarning=!0,Object.defineProperty(d,"ref",{get:R,configurable:!0})}}var Ad=function(d,C,R,F,Z,re,G){var H={$$typeof:t,type:d,key:C,ref:R,props:G,_owner:re};return H._store={},Object.defineProperty(H._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(H,"_self",{configurable:!1,enumerable:!1,writable:!1,value:F}),Object.defineProperty(H,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Z}),Object.freeze&&(Object.freeze(H.props),Object.freeze(H)),H};function Md(d,C,R,F,Z){{var re,G={},H=null,Ee=null;R!==void 0&&(Zo(R),H=""+R),Cd(C)&&(Zo(C.key),H=""+C.key),Sd(C)&&(Ee=C.ref,Pd(C,Z));for(re in C)we.call(C,re)&&!Td.hasOwnProperty(re)&&(G[re]=C[re]);if(d&&d.defaultProps){var de=d.defaultProps;for(re in de)G[re]===void 0&&(G[re]=de[re])}if(H||Ee){var he=typeof d=="function"?d.displayName||d.name||"Unknown":d;H&&Ed(G,he),Ee&&jd(G,he)}return Ad(d,H,Ee,Z,F,Nt.current,G)}}var Fr=b.ReactCurrentOwner,ea=b.ReactDebugCurrentFrame;function ht(d){if(d){var C=d._owner,R=xe(d.type,d._source,C?C.type:null);ea.setExtraStackFrame(R)}else ea.setExtraStackFrame(null)}var Br;Br=!1;function $r(d){return typeof d=="object"&&d!==null&&d.$$typeof===t}function ta(){{if(Fr.current){var d=W(Fr.current.type);if(d)return`
6
6
 
7
- Check the render method of \``+d+"`."}return""}}function Dd(d){{if(d!==void 0){var S=d.fileName.replace(/^.*[\\\/]/,""),M=d.lineNumber;return`
7
+ Check the render method of \``+d+"`."}return""}}function Rd(d){{if(d!==void 0){var C=d.fileName.replace(/^.*[\\\/]/,""),R=d.lineNumber;return`
8
8
 
9
- Check your code at `+S+":"+M+"."}return""}}var ea={};function Vd(d){{var S=Qo();if(!S){var M=typeof d=="string"?d:d.displayName||d.name;M&&(S=`
9
+ Check your code at `+C+":"+R+"."}return""}}var na={};function Vd(d){{var C=ta();if(!C){var R=typeof d=="string"?d:d.displayName||d.name;R&&(C=`
10
10
 
11
- Check the top-level render call using <`+M+">.")}return S}}function ta(d,S){{if(!d._store||d._store.validated||d.key!=null)return;d._store.validated=!0;var M=Vd(S);if(ea[M])return;ea[M]=!0;var U="";d&&d._owner&&d._owner!==_r.current&&(U=" It was passed a child from "+ee(d._owner.type)+"."),ut(d),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',M,U),ut(null)}}function na(d,S){{if(typeof d!="object")return;if(Lr(d))for(var M=0;M<d.length;M++){var U=d[M];Nr(U)&&ta(U,S)}else if(Nr(d))d._store&&(d._store.validated=!0);else if(d){var X=w(d);if(typeof X=="function"&&X!==d.entries)for(var te=X.call(d),G;!(G=te.next()).done;)Nr(G.value)&&ta(G.value,S)}}}function Rd(d){{var S=d.type;if(S==null||typeof S=="string")return;var M;if(typeof S=="function")M=S.propTypes;else if(typeof S=="object"&&(S.$$typeof===l||S.$$typeof===f))M=S.propTypes;else return;if(M){var U=ee(S);vd(M,d.props,"prop",U,d)}else if(S.PropTypes!==void 0&&!Ir){Ir=!0;var X=ee(S);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",X||"Unknown")}typeof S.getDefaultProps=="function"&&!S.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Od(d){{for(var S=Object.keys(d.props),M=0;M<S.length;M++){var U=S[M];if(U!=="children"&&U!=="key"){ut(d),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",U),ut(null);break}}d.ref!==null&&(ut(d),C("Invalid attribute `ref` supplied to `React.Fragment`."),ut(null))}}function ra(d,S,M,U,X,te){{var G=F(d);if(!G){var H="";(d===void 0||typeof d=="object"&&d!==null&&Object.keys(d).length===0)&&(H+=" 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 be=Dd(X);be?H+=be:H+=Qo();var fe;d===null?fe="null":Lr(d)?fe="array":d!==void 0&&d.$$typeof===t?(fe="<"+(ee(d.type)||"Unknown")+" />",H=" Did you accidentally export a JSX literal instead of a component?"):fe=typeof d,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",fe,H)}var de=Md(d,S,M,X,te);if(de==null)return de;if(G){var je=S.children;if(je!==void 0)if(U)if(Lr(je)){for(var ft=0;ft<je.length;ft++)na(je[ft],d);Object.freeze&&Object.freeze(je)}else C("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 na(je,d)}return d===r?Od(de):Rd(de),de}}function Ld(d,S,M){return ra(d,S,M,!0)}function kd(d,S,M){return ra(d,S,M,!1)}var _d=kd,Id=Ld;ht.Fragment=r,ht.jsx=_d,ht.jsxs=Id}()),ht}(function(e){process.env.NODE_ENV==="production"?e.exports=oa():e.exports=aa()})(p);const Bd="",la=()=>{const e=x.useCallback(()=>{console.log("Vite + React + TypeScript + Tailwind = ❤️")},[]);return p.exports.jsx("button",{onClick:e,className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded",children:"Vite is better than Webpack"})},ca=({symbol:e,onClick:t,item:n})=>p.exports.jsxs("div",{onClick:()=>{t(n.id,n.name)},className:"flex gap-2 justify-between, items-center",children:[p.exports.jsx("div",{children:e}),p.exports.jsx("div",{children:n.name})]});class Xe{constructor({id:t,text:n,createdDate:r,attachmentUrl:s,attachmentType:i,attachmentFormat:o,attachmentBlob:a,user:l,isRightSided:u,symbols:c,isSending:f,isEdited:h}){we(this,"id","0");we(this,"text","");we(this,"createdDate","");we(this,"attachmentUrl","");we(this,"attachmentBlob");we(this,"attachmentType");we(this,"attachmentFormat","");we(this,"user",{id:""});we(this,"isRightSided",!1);we(this,"symbols");we(this,"isSending");we(this,"isEdited");we(this,"updateId",t=>{this.id=t});we(this,"updateIsSending",t=>{this.isSending=t});this.id=t,this.text=n,this.createdDate=r,this.attachmentUrl=s,this.attachmentType=i,this.attachmentFormat=o,this.attachmentBlob=a,this.user=l,this.isRightSided=u,this.symbols=c,this.isSending=f,this.isEdited=h}}const sn=x.createContext({});function on(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const kt=x.createContext(null),an=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class ua extends rn.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=r instanceof HTMLElement&&r.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=s-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function fa({children:e,isPresent:t,anchorX:n}){const r=x.useId(),s=x.useRef(null),i=x.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=x.useContext(an);return x.useInsertionEffect(()=>{const{width:a,height:l,top:u,left:c,right:f}=i.current;if(t||!s.current||!a||!l)return;const h=n==="left"?`left: ${c}`:`right: ${f}`;s.current.dataset.motionPopId=r;const m=document.createElement("style");return o&&(m.nonce=o),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(`
11
+ Check the top-level render call using <`+R+">.")}return C}}function ra(d,C){{if(!d._store||d._store.validated||d.key!=null)return;d._store.validated=!0;var R=Vd(C);if(na[R])return;na[R]=!0;var F="";d&&d._owner&&d._owner!==Fr.current&&(F=" It was passed a child from "+W(d._owner.type)+"."),ht(d),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',R,F),ht(null)}}function sa(d,C){{if(typeof d!="object")return;if(Ir(d))for(var R=0;R<d.length;R++){var F=d[R];$r(F)&&ra(F,C)}else if($r(d))d._store&&(d._store.validated=!0);else if(d){var Z=S(d);if(typeof Z=="function"&&Z!==d.entries)for(var re=Z.call(d),G;!(G=re.next()).done;)$r(G.value)&&ra(G.value,C)}}}function Dd(d){{var C=d.type;if(C==null||typeof C=="string")return;var R;if(typeof C=="function")R=C.propTypes;else if(typeof C=="object"&&(C.$$typeof===l||C.$$typeof===f))R=C.propTypes;else return;if(R){var F=W(C);Ye(R,d.props,"prop",F,d)}else if(C.PropTypes!==void 0&&!Br){Br=!0;var Z=W(C);P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Z||"Unknown")}typeof C.getDefaultProps=="function"&&!C.getDefaultProps.isReactClassApproved&&P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Od(d){{for(var C=Object.keys(d.props),R=0;R<C.length;R++){var F=C[R];if(F!=="children"&&F!=="key"){ht(d),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",F),ht(null);break}}d.ref!==null&&(ht(d),P("Invalid attribute `ref` supplied to `React.Fragment`."),ht(null))}}function ia(d,C,R,F,Z,re){{var G=M(d);if(!G){var H="";(d===void 0||typeof d=="object"&&d!==null&&Object.keys(d).length===0)&&(H+=" 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 Ee=Rd(Z);Ee?H+=Ee:H+=ta();var de;d===null?de="null":Ir(d)?de="array":d!==void 0&&d.$$typeof===t?(de="<"+(W(d.type)||"Unknown")+" />",H=" Did you accidentally export a JSX literal instead of a component?"):de=typeof d,P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",de,H)}var he=Md(d,C,R,Z,re);if(he==null)return he;if(G){var Re=C.children;if(Re!==void 0)if(F)if(Ir(Re)){for(var pt=0;pt<Re.length;pt++)sa(Re[pt],d);Object.freeze&&Object.freeze(Re)}else P("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 sa(Re,d)}return d===r?Od(he):Dd(he),he}}function Ld(d,C,R){return ia(d,C,R,!0)}function kd(d,C,R){return ia(d,C,R,!1)}var _d=kd,Id=Ld;gt.Fragment=r,gt.jsx=_d,gt.jsxs=Id}()),gt}(function(e){process.env.NODE_ENV==="production"?e.exports=la():e.exports=ca()})(p);const Bd="",ua=()=>{const e=v.useCallback(()=>{console.log("Vite + React + TypeScript + Tailwind = ❤️")},[]);return p.exports.jsx("button",{onClick:e,className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded",children:"Vite is better than Webpack"})},fa=({symbol:e,onClick:t,item:n})=>p.exports.jsxs("div",{onClick:()=>{t(n.id,n.name)},className:"flex gap-2 justify-between, items-center",children:[p.exports.jsx("div",{children:e}),p.exports.jsx("div",{children:n.name})]});class yt{constructor({id:t,text:n,createdDate:r,attachmentUrl:s,attachmentType:i,attachmentFormat:o,attachmentBlob:a,attachmentName:l,attachmentSize:c,user:u,isRightSided:f,symbols:h,isSending:m,isEdited:y}){Te(this,"id","0");Te(this,"text","");Te(this,"createdDate","");Te(this,"attachmentUrl","");Te(this,"attachmentBlob");Te(this,"attachmentType");Te(this,"attachmentFormat","");Te(this,"attachmentName","");Te(this,"attachmentSize",0);Te(this,"user",{id:""});Te(this,"isRightSided",!1);Te(this,"symbols");Te(this,"isSending");Te(this,"isEdited");Te(this,"updateId",t=>{this.id=t});Te(this,"updateIsSending",t=>{this.isSending=t});this.id=t,this.text=n,this.createdDate=r,this.attachmentUrl=s,this.attachmentType=i,this.attachmentFormat=o,this.attachmentBlob=a,this.attachmentName=l,this.attachmentSize=c,this.user=u,this.isRightSided=f,this.symbols=h,this.isSending=m,this.isEdited=y}}const ln=v.createContext({});function cn(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}const Ft=v.createContext(null),un=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class da extends an.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=r instanceof HTMLElement&&r.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=s-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function ha({children:e,isPresent:t,anchorX:n}){const r=v.useId(),s=v.useRef(null),i=v.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=v.useContext(un);return v.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u,right:f}=i.current;if(t||!s.current||!a||!l)return;const h=n==="left"?`left: ${u}`:`right: ${f}`;s.current.dataset.motionPopId=r;const m=document.createElement("style");return o&&(m.nonce=o),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(`
12
12
  [data-motion-pop-id="${r}"] {
13
13
  position: absolute !important;
14
14
  width: ${a}px !important;
15
15
  height: ${l}px !important;
16
16
  ${h}px !important;
17
- top: ${u}px !important;
17
+ top: ${c}px !important;
18
18
  }
19
- `),()=>{document.head.removeChild(m)}},[t]),p.exports.jsx(ua,{isPresent:t,childRef:s,sizeRef:i,children:rn.cloneElement(e,{ref:s})})}const da=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a})=>{const l=on(ha),u=x.useId(),c=x.useCallback(h=>{l.set(h,!0);for(const m of l.values())if(!m)return;r&&r()},[l,r]),f=x.useMemo(()=>({id:u,initial:t,isPresent:n,custom:s,onExitComplete:c,register:h=>(l.set(h,!1),()=>l.delete(h))}),i?[Math.random(),c]:[n,c]);return x.useMemo(()=>{l.forEach((h,m)=>l.set(m,!1))},[n]),rn.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=p.exports.jsx(fa,{isPresent:n,anchorX:a,children:e})),p.exports.jsx(kt.Provider,{value:f,children:e})};function ha(){return new Map}function $r(e=!0){const t=x.useContext(kt);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=x.useId();x.useEffect(()=>{if(e)return s(i)},[e]);const o=x.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const _t=e=>e.key||"";function Ur(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const ln=typeof window<"u",Wr=ln?x.useLayoutEffect:x.useEffect,zr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,u]=$r(o),c=x.useMemo(()=>Ur(e),[e]),f=o&&!l?[]:c.map(_t),h=x.useRef(!0),m=x.useRef(c),v=on(()=>new Map),[y,w]=x.useState(c),[b,C]=x.useState(c);Wr(()=>{h.current=!1,m.current=c;for(let g=0;g<b.length;g++){const O=_t(b[g]);f.includes(O)?v.delete(O):v.get(O)!==!0&&v.set(O,!1)}},[b,f.length,f.join("-")]);const P=[];if(c!==y){let g=[...c];for(let O=0;O<b.length;O++){const Y=b[O],R=_t(Y);f.includes(R)||(g.splice(O,0,Y),P.push(Y))}return i==="wait"&&P.length&&(g=P),C(Ur(g)),w(c),null}process.env.NODE_ENV!=="production"&&i==="wait"&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:L}=x.useContext(sn);return p.exports.jsx(p.exports.Fragment,{children:b.map(g=>{const O=_t(g),Y=o&&!l?!1:c===b||f.includes(O),R=()=>{if(v.has(O))v.set(O,!0);else return;let Q=!0;v.forEach(F=>{F||(Q=!1)}),Q&&(L==null||L(),C(m.current),o&&(u==null||u()),r&&r())};return p.exports.jsx(da,{isPresent:Y,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,onExitComplete:Y?void 0:R,anchorX:a,children:g},O)})})},Te=e=>e;let Ze=Te,_e=Te;process.env.NODE_ENV!=="production"&&(Ze=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},_e=(e,t)=>{if(!e)throw new Error(t)});function cn(e){let t;return()=>(t===void 0&&(t=e()),t)}const Je=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Me=e=>e*1e3,Oe=e=>e/1e3,Yr={skipAnimations:!1,useManualTiming:!1},It=["read","resolveKeyframes","update","preRender","render","postRender"],Ie={value:null,addProjectionMetrics:null};function pa(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(f){o.has(f)&&(c.schedule(f),e()),l++,f(a)}const c={schedule:(f,h=!1,m=!1)=>{const y=m&&s?n:r;return h&&o.add(f),y.has(f)||y.add(f),f},cancel:f=>{r.delete(f),o.delete(f)},process:f=>{if(a=f,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(u),t&&Ie.value&&Ie.value.frameloop[t].push(l),l=0,n.clear(),s=!1,i&&(i=!1,c.process(f))}};return c}const ma=40;function Kr(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=It.reduce((b,C)=>(b[C]=pa(i,t?C:void 0),b),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:f,postRender:h}=o,m=()=>{const b=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(b-s.timestamp,ma),1),s.timestamp=b,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),c.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(m))},v=()=>{n=!0,r=!0,s.isProcessing||e(m)};return{schedule:It.reduce((b,C)=>{const P=o[C];return b[C]=(L,g=!1,O=!1)=>(n||v(),P.schedule(L,g,O)),b},{}),cancel:b=>{for(let C=0;C<It.length;C++)o[It[C]].cancel(b)},state:s,steps:o}}const{schedule:ne,cancel:Ne,state:ge,steps:un}=Kr(typeof requestAnimationFrame<"u"?requestAnimationFrame:Te,!0),Hr=x.createContext({strict:!1}),qr={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"]},Qe={};for(const e in qr)Qe[e]={isEnabled:t=>qr[e].some(n=>!!t[n])};function ga(e){for(const t in e)Qe[t]={...Qe[t],...e[t]}}const ya=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 Nt(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ya.has(e)}let Gr=e=>!Nt(e);function va(e){e&&(Gr=t=>t.startsWith("on")?!Nt(t):e(t))}try{va(require("@emotion/is-prop-valid").default)}catch{}function xa(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Gr(s)||n===!0&&Nt(s)||!t&&!Nt(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Xr=new Set;function Ft(e,t,n){e||Xr.has(t)||(console.warn(t),n&&console.warn(n),Xr.add(t))}function ba(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Ft(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const Bt=x.createContext({});function $t(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function pt(e){return typeof e=="string"||Array.isArray(e)}const fn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dn=["initial",...fn];function Ut(e){return $t(e.animate)||dn.some(t=>pt(e[t]))}function Zr(e){return Boolean(Ut(e)||e.variants)}function wa(e,t){if(Ut(e)){const{initial:n,animate:r}=e;return{initial:n===!1||pt(n)?n:void 0,animate:pt(r)?r:void 0}}return e.inherit!==!1?t:{}}function Ta(e){const{initial:t,animate:n}=wa(e,x.useContext(Bt));return x.useMemo(()=>({initial:t,animate:n}),[Jr(t),Jr(n)])}function Jr(e){return Array.isArray(e)?e.join(" "):e}const Sa=Symbol.for("motionComponentSymbol");function et(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ca(e,t,n){return x.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):et(n)&&(n.current=r))},[t])}const hn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Qr="data-"+hn("framerAppearId"),{schedule:pn,cancel:Ud}=Kr(queueMicrotask,!1),es=x.createContext({});function Pa(e,t,n,r,s){var i,o;const{visualElement:a}=x.useContext(Bt),l=x.useContext(Hr),u=x.useContext(kt),c=x.useContext(an).reducedMotion,f=x.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const h=f.current,m=x.useContext(es);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&Ea(f.current,n,s,m);const v=x.useRef(!1);x.useInsertionEffect(()=>{h&&v.current&&h.update(n,u)});const y=n[Qr],w=x.useRef(Boolean(y)&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,y))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,y)));return Wr(()=>{h&&(v.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),pn.render(h.render),w.current&&h.animationState&&h.animationState.animateChanges())}),x.useEffect(()=>{h&&(!w.current&&h.animationState&&h.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,y)}),w.current=!1))}),h}function Ea(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:ts(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:Boolean(o)||a&&et(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function ts(e){if(e)return e.options.allowProjection!==!1?e.projection:ts(e.parent)}function ja({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,o;e&&ga(e);function a(u,c){let f;const h={...x.useContext(an),...u,layoutId:Aa(u)},{isStatic:m}=h,v=Ta(u),y=r(u,m);if(!m&&ln){Ma(h,e);const w=Da(h);f=w.MeasureLayout,v.visualElement=Pa(s,y,h,t,w.ProjectionNode)}return p.exports.jsxs(Bt.Provider,{value:v,children:[f&&v.visualElement?p.exports.jsx(f,{visualElement:v.visualElement,...h}):null,n(s,u,Ca(y,v.visualElement,c),y,m,v.visualElement)]})}a.displayName=`motion.${typeof s=="string"?s:`create(${(o=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&o!==void 0?o:""})`}`;const l=x.forwardRef(a);return l[Sa]=s,l}function Aa({layoutId:e}){const t=x.useContext(sn).id;return t&&e!==void 0?t+"-"+e:e}function Ma(e,t){const n=x.useContext(Hr).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Ze(!1,r):_e(!1,r)}}function Da(e){const{drag:t,layout:n}=Qe;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const ns=e=>t=>typeof t=="string"&&t.startsWith(e),mn=ns("--"),Va=ns("var(--"),gn=e=>Va(e)?Ra.test(e.split("/*")[0].trim()):!1,Ra=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,mt={};function Oa(e){for(const t in e)mt[t]=e[t],mn(t)&&(mt[t].isCSSVariable=!0)}const tt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],We=new Set(tt);function rs(e,{layout:t,layoutId:n}){return We.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!mt[e]||e==="opacity")}const ye=e=>Boolean(e&&e.getVelocity),ss=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Le=(e,t,n)=>n>t?t:n<e?e:n,nt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},gt={...nt,transform:e=>Le(0,1,e)},Wt={...nt,default:1},yt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Fe=yt("deg"),De=yt("%"),N=yt("px"),La=yt("vh"),ka=yt("vw"),is={...De,parse:e=>De.parse(e)/100,transform:e=>De.transform(e*100)},_a={borderWidth:N,borderTopWidth:N,borderRightWidth:N,borderBottomWidth:N,borderLeftWidth:N,borderRadius:N,radius:N,borderTopLeftRadius:N,borderTopRightRadius:N,borderBottomRightRadius:N,borderBottomLeftRadius:N,width:N,maxWidth:N,height:N,maxHeight:N,top:N,right:N,bottom:N,left:N,padding:N,paddingTop:N,paddingRight:N,paddingBottom:N,paddingLeft:N,margin:N,marginTop:N,marginRight:N,marginBottom:N,marginLeft:N,backgroundPositionX:N,backgroundPositionY:N},Ia={rotate:Fe,rotateX:Fe,rotateY:Fe,rotateZ:Fe,scale:Wt,scaleX:Wt,scaleY:Wt,scaleZ:Wt,skew:Fe,skewX:Fe,skewY:Fe,distance:N,translateX:N,translateY:N,translateZ:N,x:N,y:N,z:N,perspective:N,transformPerspective:N,opacity:gt,originX:is,originY:is,originZ:N},os={...nt,transform:Math.round},yn={..._a,...Ia,zIndex:os,size:N,fillOpacity:gt,strokeOpacity:gt,numOctaves:os},Na={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Fa=tt.length;function Ba(e,t,n){let r="",s=!0;for(let i=0;i<Fa;i++){const o=tt[i],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=ss(a,yn[o]);if(!l){s=!1;const c=Na[o]||o;r+=`${c}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function vn(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const u=t[l];if(We.has(l)){o=!0;continue}else if(mn(l)){s[l]=u;continue}else{const c=ss(u,yn[l]);l.startsWith("origin")?(a=!0,i[l]=c):r[l]=c}}if(t.transform||(o||n?r.transform=Ba(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=i;r.transformOrigin=`${l} ${u} ${c}`}}const xn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function as(e,t,n){for(const r in t)!ye(t[r])&&!rs(r,n)&&(e[r]=t[r])}function $a({transformTemplate:e},t){return x.useMemo(()=>{const n=xn();return vn(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ua(e,t){const n=e.style||{},r={};return as(r,n,e),Object.assign(r,$a(e,t)),r}function Wa(e,t){const n={},r=Ua(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const za=["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 bn(e){return typeof e!="string"||e.includes("-")?!1:!!(za.indexOf(e)>-1||/[A-Z]/u.test(e))}const Ya={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ka={offset:"strokeDashoffset",array:"strokeDasharray"};function Ha(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?Ya:Ka;e[i.offset]=N.transform(-r);const o=N.transform(t),a=N.transform(n);e[i.array]=`${o} ${a}`}function ls(e,t,n){return typeof e=="string"?e:N.transform(t+n*e)}function qa(e,t,n){const r=ls(t,e.x,e.width),s=ls(n,e.y,e.height);return`${r} ${s}`}function wn(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,f){if(vn(e,u,f),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:v}=e;h.transform&&(v&&(m.transform=h.transform),delete h.transform),v&&(s!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=qa(v,s!==void 0?s:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Ha(h,o,a,l,!1)}const cs=()=>({...xn(),attrs:{}}),Tn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ga(e,t,n,r){const s=x.useMemo(()=>{const i=cs();return wn(i,t,Tn(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};as(i,e.style,e),s.style={...i,...s.style}}return s}function Xa(e=!1){return(n,r,s,{latestValues:i},o)=>{const l=(bn(n)?Ga:Wa)(r,i,o,n),u=xa(r,typeof n=="string",e),c=n!==x.Fragment?{...u,...l,ref:s}:{},{children:f}=r,h=x.useMemo(()=>ye(f)?f.get():f,[f]);return x.createElement(n,{...c,children:h})}}function us(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Sn(e,t,n,r){if(typeof t=="function"){const[s,i]=us(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=us(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const Cn=e=>Array.isArray(e),Za=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),Ja=e=>Cn(e)?e[e.length-1]||0:e;function zt(e){const t=ye(e)?e.get():e;return Za(t)?t.toValue():t}function Qa({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const o={latestValues:el(r,s,i,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const fs=e=>(t,n)=>{const r=x.useContext(Bt),s=x.useContext(kt),i=()=>Qa(e,t,r,s);return n?i():on(i)};function el(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=zt(i[h]);let{initial:o,animate:a}=e;const l=Ut(e),u=Zr(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const f=c?a:o;if(f&&typeof f!="boolean"&&!$t(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const v=Sn(e,h[m]);if(v){const{transitionEnd:y,transition:w,...b}=v;for(const C in b){let P=b[C];if(Array.isArray(P)){const L=c?P.length-1:0;P=P[L]}P!==null&&(s[C]=P)}for(const C in y)s[C]=y[C]}}}return s}function Pn(e,t,n){var r;const{style:s}=e,i={};for(const o in s)(ye(s[o])||t.style&&ye(t.style[o])||rs(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}const tl={useVisualState:fs({scrapeMotionValuesFromProps:Pn,createRenderState:xn})};function ds(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function hs(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const ps=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ms(e,t,n,r){hs(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(ps.has(s)?s:hn(s),t.attrs[s])}function gs(e,t,n){const r=Pn(e,t,n);for(const s in e)if(ye(e[s])||ye(t[s])){const i=tt.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}const ys=["x","y","width","height","cx","cy","r"],nl={useVisualState:fs({scrapeMotionValuesFromProps:gs,createRenderState:cs,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const a in s)if(We.has(a)){i=!0;break}}if(!i)return;let o=!t;if(t)for(let a=0;a<ys.length;a++){const l=ys[a];e[l]!==t[l]&&(o=!0)}o&&ne.read(()=>{ds(n,r),ne.render(()=>{wn(r,s,Tn(n.tagName),e.transformTemplate),ms(n,r)})})}})};function rl(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...bn(r)?nl:tl,preloadedFeatures:e,useRender:Xa(s),createVisualElement:t,Component:r};return ja(o)}}function vt(e,t,n){const r=e.getProps();return Sn(r,t,n!==void 0?n:r.custom,e)}const sl=cn(()=>window.ScrollTimeline!==void 0);class il{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(s=>{if(sl()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class ol extends il{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function En(e,t){return e?e[t]||e.default||e:void 0}const jn=2e4;function vs(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<jn;)t+=n,r=e.next(t);return t>=jn?1/0:t}function An(e){return typeof e=="function"}function xs(e,t){e.timeline=t,e.onfinish=null}const Mn=e=>Array.isArray(e)&&typeof e[0]=="number",al={linearEasing:void 0};function ll(e,t){const n=cn(e);return()=>{var r;return(r=al[t])!==null&&r!==void 0?r:n()}}const Yt=ll(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),bs=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=e(Je(0,s-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function ws(e){return Boolean(typeof e=="function"&&Yt()||!e||typeof e=="string"&&(e in Dn||Yt())||Mn(e)||Array.isArray(e)&&e.every(ws))}const xt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Dn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xt([0,.65,.55,1]),circOut:xt([.55,0,1,.45]),backIn:xt([.31,.01,.66,-.59]),backOut:xt([.33,1.53,.69,.99])};function Ts(e,t){if(e)return typeof e=="function"&&Yt()?bs(e,t):Mn(e)?xt(e):Array.isArray(e)?e.map(n=>Ts(n,t)||Dn.easeOut):Dn[e]}const Ae={x:!1,y:!1};function Ss(){return Ae.x||Ae.y}function cl(e,t,n){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;t&&(s=t.current);const i=(r=n==null?void 0:n[e])!==null&&r!==void 0?r:s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Cs(e,t){const n=cl(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Ps(e){return!(e.pointerType==="touch"||Ss())}function ul(e,t,n={}){const[r,s,i]=Cs(e,n),o=a=>{if(!Ps(a))return;const{target:l}=a,u=t(l,a);if(typeof u!="function"||!l)return;const c=f=>{Ps(f)&&(u(f),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,s)};return r.forEach(a=>{a.addEventListener("pointerenter",o,s)}),i}function Kt(e,t){const n=`${t}PointerCapture`;if(e.target instanceof Element&&n in e.target&&e.pointerId!==void 0)try{e.target[n](e.pointerId)}catch{}}const Es=(e,t)=>t?e===t?!0:Es(e,t.parentElement):!1,Vn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,fl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function dl(e){return fl.has(e.tagName)||e.tabIndex!==-1}const bt=new WeakSet;function js(e){return t=>{t.key==="Enter"&&e(t)}}function Rn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const hl=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=js(()=>{if(bt.has(n))return;Rn(n,"down");const s=js(()=>{Rn(n,"up")}),i=()=>Rn(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function As(e){return Vn(e)&&!Ss()}function pl(e,t,n={}){const[r,s,i]=Cs(e,n),o=a=>{const l=a.currentTarget;if(!l||!As(a)||bt.has(l))return;bt.add(l),Kt(a,"set");const u=t(l,a),c=(m,v)=>{l.removeEventListener("pointerup",f),l.removeEventListener("pointercancel",h),Kt(m,"release"),!(!As(m)||!bt.has(l))&&(bt.delete(l),typeof u=="function"&&u(m,{success:v}))},f=m=>{(m.isTrusted?ml(m,l instanceof Element?l.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?c(m,!1):c(m,!(l instanceof Element)||Es(l,m.target))},h=m=>{c(m,!1)};l.addEventListener("pointerup",f,s),l.addEventListener("pointercancel",h,s),l.addEventListener("lostpointercapture",h,s)};return r.forEach(a=>{a=n.useGlobalTarget?window:a;let l=!1;a instanceof HTMLElement&&(l=!0,!dl(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0)),a.addEventListener("pointerdown",o,s),l&&a.addEventListener("focus",u=>hl(u,s),s)}),i}function ml(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function gl(e){return e==="x"||e==="y"?Ae[e]?null:(Ae[e]=!0,()=>{Ae[e]=!1}):Ae.x||Ae.y?null:(Ae.x=Ae.y=!0,()=>{Ae.x=Ae.y=!1})}const Ms=new Set(["width","height","top","left","right","bottom",...tt]);let Ht;function yl(){Ht=void 0}const Ve={now:()=>(Ht===void 0&&Ve.set(ge.isProcessing||Yr.useManualTiming?ge.timestamp:performance.now()),Ht),set:e=>{Ht=e,queueMicrotask(yl)}};function On(e,t){e.indexOf(t)===-1&&e.push(t)}function Ln(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class kn{constructor(){this.subscriptions=[]}add(t){return On(this.subscriptions,t),()=>Ln(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Ds(e,t){return t?e*(1e3/t):0}const Vs=30,vl=e=>!isNaN(parseFloat(e));class xl{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Ve.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ve.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=vl(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ft(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new kn);const r=this.events[t].add(n);return t==="change"?()=>{r(),ne.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ve.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Vs)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Vs);return Ds(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function wt(e,t){return new xl(e,t)}function bl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,wt(n))}function wl(e,t){const n=vt(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=Ja(i[o]);bl(e,o,a)}}function Tl(e){return Boolean(ye(e)&&e.add)}function _n(e,t){const n=e.getValue("willChange");if(Tl(n))return n.add(t)}function Rs(e){return e.props[Qr]}const Sl={current:!1},Os=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Cl=1e-7,Pl=12;function El(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=Os(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>Cl&&++a<Pl);return o}function Tt(e,t,n,r){if(e===t&&n===r)return Te;const s=i=>El(i,0,1,e,n);return i=>i===0||i===1?i:Os(s(i),t,r)}const Ls=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ks=e=>t=>1-e(1-t),_s=Tt(.33,1.53,.69,.99),In=ks(_s),Is=Ls(In),Ns=e=>(e*=2)<1?.5*In(e):.5*(2-Math.pow(2,-10*(e-1))),Nn=e=>1-Math.sin(Math.acos(e)),Fs=ks(Nn),Bs=Ls(Nn),$s=e=>/^0[^.\s]+$/u.test(e);function jl(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||$s(e):!0}const St=e=>Math.round(e*1e5)/1e5,Fn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Al(e){return e==null}const Ml=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bn=(e,t)=>n=>Boolean(typeof n=="string"&&Ml.test(n)&&n.startsWith(e)||t&&!Al(n)&&Object.prototype.hasOwnProperty.call(n,t)),Us=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Fn);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Dl=e=>Le(0,255,e),$n={...nt,transform:e=>Math.round(Dl(e))},ze={test:Bn("rgb","red"),parse:Us("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+$n.transform(e)+", "+$n.transform(t)+", "+$n.transform(n)+", "+St(gt.transform(r))+")"};function Vl(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Un={test:Bn("#"),parse:Vl,transform:ze.transform},rt={test:Bn("hsl","hue"),parse:Us("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+De.transform(St(t))+", "+De.transform(St(n))+", "+St(gt.transform(r))+")"},ve={test:e=>ze.test(e)||Un.test(e)||rt.test(e),parse:e=>ze.test(e)?ze.parse(e):rt.test(e)?rt.parse(e):Un.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ze.transform(e):rt.transform(e)},Rl=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ol(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Fn))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Rl))===null||n===void 0?void 0:n.length)||0)>0}const Ws="number",zs="color",Ll="var",kl="var(",Ys="${}",_l=/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 Ct(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(_l,l=>(ve.test(l)?(r.color.push(i),s.push(zs),n.push(ve.parse(l))):l.startsWith(kl)?(r.var.push(i),s.push(Ll),n.push(l)):(r.number.push(i),s.push(Ws),n.push(parseFloat(l))),++i,Ys)).split(Ys);return{values:n,split:a,indexes:r,types:s}}function Ks(e){return Ct(e).values}function Hs(e){const{split:t,types:n}=Ct(e),r=t.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],s[o]!==void 0){const a=n[o];a===Ws?i+=St(s[o]):a===zs?i+=ve.transform(s[o]):i+=s[o]}return i}}const Il=e=>typeof e=="number"?0:e;function Nl(e){const t=Ks(e);return Hs(e)(t.map(Il))}const Be={test:Ol,parse:Ks,createTransformer:Hs,getAnimatableNone:Nl},Fl=new Set(["brightness","contrast","saturate","opacity"]);function Bl(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Fn)||[];if(!r)return e;const s=n.replace(r,"");let i=Fl.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const $l=/\b([a-z-]*)\(.*?\)/gu,Wn={...Be,getAnimatableNone:e=>{const t=e.match($l);return t?t.map(Bl).join(" "):e}},Ul={...yn,color:ve,backgroundColor:ve,outlineColor:ve,fill:ve,stroke:ve,borderColor:ve,borderTopColor:ve,borderRightColor:ve,borderBottomColor:ve,borderLeftColor:ve,filter:Wn,WebkitFilter:Wn},zn=e=>Ul[e];function qs(e,t){let n=zn(e);return n!==Wn&&(n=Be),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Wl=new Set(["auto","none","0"]);function zl(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!Wl.has(i)&&Ct(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=qs(n,s)}const Gs=e=>e===nt||e===N,Xs=(e,t)=>parseFloat(e.split(", ")[t]),Zs=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Xs(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Xs(i[1],e):0}},Yl=new Set(["x","y","z"]),Kl=tt.filter(e=>!Yl.has(e));function Hl(e){const t=[];return Kl.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const st={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Zs(4,13),y:Zs(5,14)};st.translateX=st.x,st.translateY=st.y;const Ye=new Set;let Yn=!1,Kn=!1;function Js(){if(Kn){const e=Array.from(Ye).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Hl(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))===null||a===void 0||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Kn=!1,Yn=!1,Ye.forEach(e=>e.complete()),Ye.clear()}function Qs(){Ye.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Kn=!0)})}function ql(){Qs(),Js()}class Hn{constructor(t,n,r,s,i,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ye.add(this),Yn||(Yn=!0,ne.read(Qs),ne.resolveKeyframes(Js))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const o=s==null?void 0:s.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),s&&o===void 0&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ye.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ye.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ei=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Gl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Xl(e){const t=Gl.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const Zl=4;function ti(e,t,n=1){_e(n<=Zl,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,s]=Xl(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return ei(o)?parseFloat(o):o}return gn(s)?ti(s,t,n+1):s}const ni=e=>t=>t.test(e),ri=[nt,N,De,Fe,ka,La,{test:e=>e==="auto",parse:e=>e}],si=e=>ri.find(ni(e));class ii extends Hn{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),gn(u))){const c=ti(u,n.current);c!==void 0&&(t[l]=c),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Ms.has(r)||t.length!==2)return;const[s,i]=t,o=si(s),a=si(i);if(o!==a)if(Gs(o)&&Gs(a))for(let l=0;l<t.length;l++){const u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)jl(t[s])&&r.push(s);r.length&&zl(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=st[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const i=n.getValue(r);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,a=s[o];s[o]=st[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const oi=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Be.test(e)||e==="0")&&!e.startsWith("url("));function Jl(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Ql(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=oi(s,t),a=oi(i,t);return Ze(o===a,`You are trying to animate ${t} from "${s}" to "${i}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${i} via the \`style\` property.`),!o||!a?!1:Jl(e)||(n==="spring"||An(n))&&r}const ec=e=>e!==null;function qt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(ec),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const tc=40;class ai{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ve.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>tc?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&ql(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ve.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Ql(t,r,s,i))if(o)this.options.duration=0;else{l&&l(qt(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const c=this.initPlayback(t,n);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Pt={layout:0,mainThread:0,waapi:0},re=(e,t,n)=>e+(t-e)*n;function qn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function nc({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=qn(l,a,e+1/3),i=qn(l,a,e),o=qn(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Gt(e,t){return n=>n>0?t:e}const Gn=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},rc=[Un,ze,rt],sc=e=>rc.find(t=>t.test(e));function li(e){const t=sc(e);if(Ze(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===rt&&(n=nc(n)),n}const ci=(e,t)=>{const n=li(e),r=li(t);if(!n||!r)return Gt(e,t);const s={...n};return i=>(s.red=Gn(n.red,r.red,i),s.green=Gn(n.green,r.green,i),s.blue=Gn(n.blue,r.blue,i),s.alpha=re(n.alpha,r.alpha,i),ze.transform(s))},ic=(e,t)=>n=>t(e(n)),Et=(...e)=>e.reduce(ic),Xn=new Set(["none","hidden"]);function oc(e,t){return Xn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ac(e,t){return n=>re(e,t,n)}function Zn(e){return typeof e=="number"?ac:typeof e=="string"?gn(e)?Gt:ve.test(e)?ci:uc:Array.isArray(e)?ui:typeof e=="object"?ve.test(e)?ci:lc:Gt}function ui(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Zn(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function lc(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Zn(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function cc(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],a=e.indexes[o][s[o]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[i]=l,s[o]++}return r}const uc=(e,t)=>{const n=Be.createTransformer(t),r=Ct(e),s=Ct(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Xn.has(e)&&!s.values.length||Xn.has(t)&&!r.values.length?oc(e,t):Et(ui(cc(r,s),s.values),n):(Ze(!0,`Complex values '${e}' and '${t}' 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.`),Gt(e,t))};function fi(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?re(e,t,n):Zn(e)(e,t)}const fc=5;function di(e,t,n){const r=Math.max(t-fc,0);return Ds(n-e(r),t-r)}const se={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},Jn=.001;function dc({duration:e=se.duration,bounce:t=se.bounce,velocity:n=se.velocity,mass:r=se.mass}){let s,i;Ze(e<=Me(se.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=Le(se.minDamping,se.maxDamping,o),e=Le(se.minDuration,se.maxDuration,Oe(e)),o<1?(s=u=>{const c=u*o,f=c*e,h=c-n,m=Qn(u,o),v=Math.exp(-f);return Jn-h/m*v},i=u=>{const f=u*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,v=Math.exp(-f),y=Qn(Math.pow(u,2),o);return(-s(u)+Jn>0?-1:1)*((h-m)*v)/y}):(s=u=>{const c=Math.exp(-u*e),f=(u-n)*e+1;return-Jn+c*f},i=u=>{const c=Math.exp(-u*e),f=(n-u)*(e*e);return c*f});const a=5/e,l=pc(s,i,a);if(e=Me(e),isNaN(l))return{stiffness:se.stiffness,damping:se.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const hc=12;function pc(e,t,n){let r=n;for(let s=1;s<hc;s++)r=r-e(r)/t(r);return r}function Qn(e,t){return e*Math.sqrt(1-t*t)}const mc=["duration","bounce"],gc=["stiffness","damping","mass"];function hi(e,t){return t.some(n=>e[n]!==void 0)}function yc(e){let t={velocity:se.velocity,stiffness:se.stiffness,damping:se.damping,mass:se.mass,isResolvedFromDuration:!1,...e};if(!hi(e,gc)&&hi(e,mc))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Le(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:se.mass,stiffness:s,damping:i}}else{const n=dc(e);t={...t,...n,mass:se.mass},t.isResolvedFromDuration=!0}return t}function pi(e=se.visualDuration,t=se.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:u,mass:c,duration:f,velocity:h,isResolvedFromDuration:m}=yc({...n,velocity:-Oe(n.velocity||0)}),v=h||0,y=u/(2*Math.sqrt(l*c)),w=o-i,b=Oe(Math.sqrt(l/c)),C=Math.abs(w)<5;r||(r=C?se.restSpeed.granular:se.restSpeed.default),s||(s=C?se.restDelta.granular:se.restDelta.default);let P;if(y<1){const g=Qn(b,y);P=O=>{const Y=Math.exp(-y*b*O);return o-Y*((v+y*b*w)/g*Math.sin(g*O)+w*Math.cos(g*O))}}else if(y===1)P=g=>o-Math.exp(-b*g)*(w+(v+b*w)*g);else{const g=b*Math.sqrt(y*y-1);P=O=>{const Y=Math.exp(-y*b*O),R=Math.min(g*O,300);return o-Y*((v+y*b*w)*Math.sinh(R)+g*w*Math.cosh(R))/g}}const L={calculatedDuration:m&&f||null,next:g=>{const O=P(g);if(m)a.done=g>=f;else{let Y=0;y<1&&(Y=g===0?Me(v):di(P,g,O));const R=Math.abs(Y)<=r,Q=Math.abs(o-O)<=s;a.done=R&&Q}return a.value=a.done?o:O,a},toString:()=>{const g=Math.min(vs(L),jn),O=bs(Y=>L.next(g*Y).value,g,30);return g+"ms "+O}};return L}function mi({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const f=e[0],h={done:!1,value:f},m=R=>a!==void 0&&R<a||l!==void 0&&R>l,v=R=>a===void 0?l:l===void 0||Math.abs(a-R)<Math.abs(l-R)?a:l;let y=n*t;const w=f+y,b=o===void 0?w:o(w);b!==w&&(y=b-f);const C=R=>-y*Math.exp(-R/r),P=R=>b+C(R),L=R=>{const Q=C(R),F=P(R);h.done=Math.abs(Q)<=u,h.value=h.done?b:F};let g,O;const Y=R=>{m(h.value)&&(g=R,O=pi({keyframes:[h.value,v(h.value)],velocity:di(P,R,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:c}))};return Y(0),{calculatedDuration:null,next:R=>{let Q=!1;return!O&&g===void 0&&(Q=!0,L(R),Y(R)),g!==void 0&&R>=g?O.next(R-g):(!Q&&L(R),h)}}}const vc=Tt(.42,0,1,1),xc=Tt(0,0,.58,1),gi=Tt(.42,0,.58,1),bc=e=>Array.isArray(e)&&typeof e[0]!="number",yi={linear:Te,easeIn:vc,easeInOut:gi,easeOut:xc,circIn:Nn,circInOut:Bs,circOut:Fs,backIn:In,backInOut:Is,backOut:_s,anticipate:Ns},vi=e=>{if(Mn(e)){_e(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,s]=e;return Tt(t,n,r,s)}else if(typeof e=="string")return _e(yi[e]!==void 0,`Invalid easing type '${e}'`),yi[e];return e};function wc(e,t,n){const r=[],s=n||fi,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Te:t;a=Et(l,a)}r.push(a)}return r}function Tc(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(_e(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=wc(t,r,s),l=a.length,u=c=>{if(o&&c<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(c<e[f+1]);f++);const h=Je(e[f],e[f+1],c);return a[f](h)};return n?c=>u(Le(e[0],e[i-1],c)):u}function Sc(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Je(0,t,r);e.push(re(n,1,s))}}function Cc(e){const t=[0];return Sc(t,e.length-1),t}function Pc(e,t){return e.map(n=>n*t)}function Ec(e,t){return e.map(()=>t||gi).splice(0,e.length-1)}function jt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=bc(r)?r.map(vi):vi(r),i={done:!1,value:t[0]},o=Pc(n&&n.length===t.length?n:Cc(t),e),a=Tc(o,t,{ease:Array.isArray(s)?s:Ec(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const jc=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ne.update(t,!0),stop:()=>Ne(t),now:()=>ge.isProcessing?ge.timestamp:Ve.now()}},Ac={decay:mi,inertia:mi,tween:jt,keyframes:jt,spring:pi},Mc=e=>e/100;class er extends ai{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,o=(s==null?void 0:s.KeyframeResolver)||Hn,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(i,a,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=this.options,a=An(n)?n:Ac[n]||jt;let l,u;process.env.NODE_ENV!=="production"&&a!==jt&&_e(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),a!==jt&&typeof t[0]!="number"&&(l=Et(Mc,fi(t[0],t[1])),t=[0,100]);const c=a({...this.options,keyframes:t});i==="mirror"&&(u=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=vs(c));const{calculatedDuration:f}=c,h=f+s,m=h*(r+1)-s;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;Pt.mainThread++,this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:R}=this.options;return{done:!0,value:R[R.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:m,repeatType:v,repeatDelay:y,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const b=this.currentTime-h*(this.speed>=0?1:-1),C=this.speed>=0?b<0:b>c;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let P=this.currentTime,L=i;if(m){const R=Math.min(this.currentTime,c)/f;let Q=Math.floor(R),F=R%1;!F&&R>=1&&(F=1),F===1&&Q--,Q=Math.min(Q,m+1),Boolean(Q%2)&&(v==="reverse"?(F=1-F,y&&(F-=y/f)):v==="mirror"&&(L=o)),P=Le(0,1,F)*f}const g=C?{done:!1,value:l[0]}:L.next(P);a&&(g.value=a(g.value));let{done:O}=g;!C&&u!==null&&(O=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const Y=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return Y&&s!==void 0&&(g.value=qt(l,this.options,s)),w&&w(g.value),Y&&this.finish(),g}get duration(){const{resolved:t}=this;return t?Oe(t.calculatedDuration):0}get time(){return Oe(this.currentTime)}set time(t){t=Me(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Oe(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=jc,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel(),Pt.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Dc=new Set(["opacity","clipPath","filter","transform"]);function Vc(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=Ts(a,s);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const Rc=cn(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Xt=10,Oc=2e4;function Lc(e){return An(e.type)||e.type==="spring"||!ws(e.ease)}function kc(e,t){const n=new er({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let i=0;for(;!r.done&&i<Oc;)r=n.sample(i),s.push(r.value),i+=Xt;return{times:void 0,keyframes:s,duration:i-Xt,ease:"linear"}}const xi={anticipate:Ns,backInOut:Is,circInOut:Bs};function _c(e){return e in xi}class bi extends ai{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:i}=this.options;this.resolver=new ii(i,(o,a)=>this.onKeyframesResolved(o,a),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof i=="string"&&Yt()&&_c(i)&&(i=xi[i]),Lc(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:v,...y}=this.options,w=kc(t,y);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,s=w.times,i=w.ease,o="keyframes"}const c=Vc(a.owner.current,l,t,{...this.options,duration:r,times:s,ease:i});return c.startTime=u??this.calcStartTime(),this.pendingTimeline?(xs(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:f}=this.options;a.set(qt(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:r,times:s,type:o,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Oe(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Oe(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Me(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Te;const{animation:r}=n;xs(r,t)}return Te}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:i,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:f,element:h,...m}=this.options,v=new er({...m,keyframes:r,duration:s,type:i,ease:o,times:a,isGenerator:!0}),y=Me(this.time);u.setWithVelocity(v.sample(y-Xt).value,v.sample(y).value,Xt)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:s,repeatType:i,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return Rc()&&r&&Dc.has(r)&&!l&&!u&&!s&&i!=="mirror"&&o!==0&&a!=="inertia"}}const Ic={type:"spring",stiffness:500,damping:25,restSpeed:10},Nc=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Fc={type:"keyframes",duration:.8},Bc={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$c=(e,{keyframes:t})=>t.length>2?Fc:We.has(e)?e.startsWith("scale")?Nc(t[1]):Ic:Bc;function Uc({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const tr=(e,t,n,r={},s,i)=>o=>{const a=En(r,e)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Me(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};Uc(a)||(c={...c,...$c(e,c)}),c.duration&&(c.duration=Me(c.duration)),c.repeatDelay&&(c.repeatDelay=Me(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(f=!0)),(Sl.current||Yr.skipAnimations)&&(f=!0,c.duration=0,c.delay=0),f&&!i&&t.get()!==void 0){const h=qt(c.keyframes,a);if(h!==void 0)return ne.update(()=>{c.onUpdate(h),c.onComplete()}),new ol([])}return!i&&bi.supports(c)?new bi(c):new er(c)};function Wc({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function wi(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(o=r);const u=[],c=s&&e.animationState&&e.animationState.getState()[s];for(const f in l){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),m=l[f];if(m===void 0||c&&Wc(c,f))continue;const v={delay:n,...En(o||{},f)};let y=!1;if(window.MotionHandoffAnimation){const b=Rs(e);if(b){const C=window.MotionHandoffAnimation(b,f,ne);C!==null&&(v.startTime=C,y=!0)}}_n(e,f),h.start(tr(f,h,m,e.shouldReduceMotion&&Ms.has(f)?{type:!1}:v,e,y));const w=h.animation;w&&u.push(w)}return a&&Promise.all(u).then(()=>{ne.update(()=>{a&&wl(e,a)})}),u}function nr(e,t,n={}){var r;const s=vt(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(wi(e,s,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:h}=i;return zc(e,t,c+u,f,h,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[u,c]=l==="beforeChildren"?[o,a]:[a,o];return u().then(()=>c())}else return Promise.all([o(),a(n.delay)])}function zc(e,t,n=0,r=0,s=1,i){const o=[],a=(e.variantChildren.size-1)*r,l=s===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(Yc).forEach((u,c)=>{u.notify("AnimationStart",t),o.push(nr(u,t,{...i,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function Yc(e,t){return e.sortNodePosition(t)}function Kc(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>nr(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=nr(e,t,n);else{const s=typeof t=="function"?vt(e,t,n.custom):t;r=Promise.all(wi(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Ti(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Hc=dn.length;function Si(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Si(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Hc;n++){const r=dn[n],s=e.props[r];(pt(s)||s===!1)&&(t[r]=s)}return t}const qc=[...fn].reverse(),Gc=fn.length;function Xc(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Kc(e,n,r)))}function Zc(e){let t=Xc(e),n=Ci(),r=!0;const s=l=>(u,c)=>{var f;const h=vt(e,c,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:v,...y}=h;u={...u,...y,...v}}return u};function i(l){t=l(e)}function o(l){const{props:u}=e,c=Si(e.parent)||{},f=[],h=new Set;let m={},v=1/0;for(let w=0;w<Gc;w++){const b=qc[w],C=n[b],P=u[b]!==void 0?u[b]:c[b],L=pt(P),g=b===l?C.isActive:null;g===!1&&(v=w);let O=P===c[b]&&P!==u[b]&&L;if(O&&r&&e.manuallyAnimateOnMount&&(O=!1),C.protectedKeys={...m},!C.isActive&&g===null||!P&&!C.prevProp||$t(P)||typeof P=="boolean")continue;const Y=Jc(C.prevProp,P);let R=Y||b===l&&C.isActive&&!O&&L||w>v&&L,Q=!1;const F=Array.isArray(P)?P:[P];let I=F.reduce(s(b),{});g===!1&&(I={});const{prevResolvedValues:oe={}}=C,ee={...oe,...I},ae=q=>{R=!0,h.has(q)&&(Q=!0,h.delete(q)),C.needsAnimating[q]=!0;const le=e.getValue(q);le&&(le.liveStyle=!1)};for(const q in ee){const le=I[q],K=oe[q];if(m.hasOwnProperty(q))continue;let T=!1;Cn(le)&&Cn(K)?T=!Ti(le,K):T=le!==K,T?le!=null?ae(q):h.add(q):le!==void 0&&h.has(q)?ae(q):C.protectedKeys[q]=!0}C.prevProp=P,C.prevResolvedValues=I,C.isActive&&(m={...m,...I}),r&&e.blockInitialAnimation&&(R=!1),R&&(!(O&&Y)||Q)&&f.push(...F.map(q=>({animation:q,options:{type:b}})))}if(h.size){const w={};if(typeof u.initial!="boolean"){const b=vt(e,Array.isArray(u.initial)?u.initial[0]:u.initial);b&&b.transition&&(w.transition=b.transition)}h.forEach(b=>{const C=e.getBaseTarget(b),P=e.getValue(b);P&&(P.liveStyle=!0),w[b]=C??null}),f.push({animation:w})}let y=Boolean(f.length);return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=e.variantChildren)===null||c===void 0||c.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(l,u)}),n[l].isActive=u;const f=o(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Ci(),r=!0}}}function Jc(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ti(t,e):!1}function Ke(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ci(){return{animate:Ke(!0),whileInView:Ke(),whileHover:Ke(),whileTap:Ke(),whileDrag:Ke(),whileFocus:Ke(),exit:Ke()}}class $e{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Qc extends $e{constructor(t){super(t),t.animationState||(t.animationState=Zc(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();$t(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let eu=0;class tu extends $e{constructor(){super(...arguments),this.id=eu++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const nu={animation:{Feature:Qc},exit:{Feature:tu}};function At(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Mt(e){return{point:{x:e.pageX,y:e.pageY}}}const ru=e=>t=>Vn(t)&&e(t,Mt(t));function it(e,t,n,r){return At(e,t,ru(n),r)}function Pi({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function su({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function iu(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Ei=1e-4,ou=1-Ei,au=1+Ei,ji=.01,lu=0-ji,cu=0+ji;function xe(e){return e.max-e.min}function uu(e,t,n){return Math.abs(e-t)<=n}function Ai(e,t,n,r=.5){e.origin=r,e.originPoint=re(t.min,t.max,e.origin),e.scale=xe(n)/xe(t),e.translate=re(n.min,n.max,e.origin)-e.originPoint,(e.scale>=ou&&e.scale<=au||isNaN(e.scale))&&(e.scale=1),(e.translate>=lu&&e.translate<=cu||isNaN(e.translate))&&(e.translate=0)}function Dt(e,t,n,r){Ai(e.x,t.x,n.x,r?r.originX:void 0),Ai(e.y,t.y,n.y,r?r.originY:void 0)}function Mi(e,t,n){e.min=n.min+t.min,e.max=e.min+xe(t)}function fu(e,t,n){Mi(e.x,t.x,n.x),Mi(e.y,t.y,n.y)}function Di(e,t,n){e.min=t.min-n.min,e.max=e.min+xe(t)}function Vt(e,t,n){Di(e.x,t.x,n.x),Di(e.y,t.y,n.y)}const Vi=()=>({translate:0,scale:1,origin:0,originPoint:0}),ot=()=>({x:Vi(),y:Vi()}),Ri=()=>({min:0,max:0}),ue=()=>({x:Ri(),y:Ri()});function Ce(e){return[e("x"),e("y")]}function rr(e){return e===void 0||e===1}function sr({scale:e,scaleX:t,scaleY:n}){return!rr(e)||!rr(t)||!rr(n)}function He(e){return sr(e)||Oi(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Oi(e){return Li(e.x)||Li(e.y)}function Li(e){return e&&e!=="0%"}function Zt(e,t,n){const r=e-n,s=t*r;return n+s}function ki(e,t,n,r,s){return s!==void 0&&(e=Zt(e,s,r)),Zt(e,n,r)+t}function ir(e,t=0,n=1,r,s){e.min=ki(e.min,t,n,r,s),e.max=ki(e.max,t,n,r,s)}function _i(e,{x:t,y:n}){ir(e.x,t.translate,t.scale,t.originPoint),ir(e.y,n.translate,n.scale,n.originPoint)}const Ii=.999999999999,Ni=1.0000000000001;function du(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&lt(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,_i(e,o)),r&&He(i.latestValues)&&lt(e,i.latestValues))}t.x<Ni&&t.x>Ii&&(t.x=1),t.y<Ni&&t.y>Ii&&(t.y=1)}function at(e,t){e.min=e.min+t,e.max=e.max+t}function Fi(e,t,n,r,s=.5){const i=re(e.min,e.max,s);ir(e,t,n,i,r)}function lt(e,t){Fi(e.x,t.x,t.scaleX,t.scale,t.originX),Fi(e.y,t.y,t.scaleY,t.scale,t.originY)}function Bi(e,t){return Pi(iu(e.getBoundingClientRect(),t))}function hu(e,t,n){const r=Bi(e,n),{scroll:s}=t;return s&&(at(r.x,s.offset.x),at(r.y,s.offset.y)),r}const $i=(e,t)=>Math.abs(e-t);function pu(e,t){const n=$i(e.x,t.x),r=$i(e.y,t.y);return Math.sqrt(n**2+r**2)}class Ui{constructor(t,n,{transformPagePoint:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const c=ar(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=pu(c.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:m}=c,{timestamp:v}=ge;this.history.push({...m,timestamp:v});const{onStart:y,onMove:w}=this.handlers;f||(y&&y(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{if(c.target instanceof Element&&c.target.hasPointerCapture&&c.pointerId!==void 0)try{if(!c.target.hasPointerCapture(c.pointerId))return}catch{}this.lastMoveEvent=c,this.lastMoveEventInfo=or(f,this.transformPagePoint),ne.update(this.updatePoint,!0)},this.handlePointerUp=(c,f)=>{Kt(c,"release"),this.end();const{onEnd:h,onSessionEnd:m,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ar(c.type==="pointercancel"||c.type==="lostpointercapture"?this.lastMoveEventInfo:or(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(c,y),m&&m(c,y)},!Vn(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r;const i=Mt(t),o=or(i,this.transformPagePoint),{point:a}=o,{timestamp:l}=ge;this.history=[{...a,timestamp:l}];const{onSessionStart:u}=n;u&&u(t,ar(o,this.history)),Kt(t,"set"),this.removeListeners=Et(it(t.currentTarget,"pointermove",this.handlePointerMove),it(t.currentTarget,"pointerup",this.handlePointerUp),it(t.currentTarget,"pointercancel",this.handlePointerUp),it(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ne(this.updatePoint)}}function or(e,t){return t?{point:t(e.point)}:e}function Wi(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ar({point:e},t){return{point:e,delta:Wi(e,zi(t)),offset:Wi(e,mu(t)),velocity:gu(t,.1)}}function mu(e){return e[0]}function zi(e){return e[e.length-1]}function gu(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=zi(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Me(t)));)n--;if(!r)return{x:0,y:0};const i=Oe(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function yu(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?re(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?re(n,e,r.max):Math.min(e,n)),e}function Yi(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function vu(e,{top:t,left:n,bottom:r,right:s}){return{x:Yi(e.x,n,s),y:Yi(e.y,t,r)}}function Ki(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function xu(e,t){return{x:Ki(e.x,t.x),y:Ki(e.y,t.y)}}function bu(e,t){let n=.5;const r=xe(e),s=xe(t);return s>r?n=Je(t.min,t.max-r,e.min):r>s&&(n=Je(e.min,e.max-s,t.min)),Le(0,1,n)}function wu(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const lr=.35;function Tu(e=lr){return e===!1?e=0:e===!0&&(e=lr),{x:Hi(e,"left","right"),y:Hi(e,"top","bottom")}}function Hi(e,t,n){return{min:qi(e,t),max:qi(e,n)}}function qi(e,t){return typeof e=="number"?e:e[t]||0}const Su=new WeakMap;class Cu{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ue(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=c=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Mt(c).point)},i=(c,f)=>{const{drag:h,dragPropagation:m,onDragStart:v}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=gl(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ce(w=>{let b=this.getAxisMotionValue(w).get()||0;if(De.test(b)){const{projection:C}=this.visualElement;if(C&&C.layout){const P=C.layout.layoutBox[w];P&&(b=xe(P)*(parseFloat(b)/100))}}this.originPoint[w]=b}),v&&ne.postRender(()=>v(c,f)),_n(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(c,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:v,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:w}=f;if(m&&this.currentDirection===null){this.currentDirection=Pu(w),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",f.point,w),this.updateAxis("y",f.point,w),this.visualElement.render(),y&&y(c,f)},a=(c,f)=>this.stop(c,f),l=()=>Ce(c=>{var f;return this.getAnimationState(c)==="paused"&&((f=this.getAxisMotionValue(c).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Ui(t,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&ne.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!Jt(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=yu(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&et(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=vu(s.layoutBox,n):this.constraints=!1,this.elastic=Tu(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Ce(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=wu(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!et(t))return!1;const r=t.current;_e(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=hu(r,s.root,this.visualElement.getTransformPagePoint());let o=xu(s.layout.layoutBox,i);if(n){const a=n(su(o));this.hasMutatedConstraints=!!a,a&&(o=Pi(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Ce(c=>{if(!Jt(c,n,this.currentDirection))return;let f=l&&l[c]||{};o&&(f={min:0,max:0});const h=s?200:1e6,m=s?40:1e7,v={type:"inertia",velocity:r?t[c]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(c,v)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return _n(this.visualElement,t),r.start(tr(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ce(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ce(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ce(n=>{const{drag:r}=this.getProps();if(!Jt(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];i.set(t[n]-re(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!et(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ce(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=bu({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ce(o=>{if(!Jt(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(re(l,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;Su.set(this.visualElement,this);const t=this.visualElement.current,n=it(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();et(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ne.read(r);const o=At(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ce(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=lr,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function Jt(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Pu(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Eu extends $e{constructor(t){super(t),this.removeGroupControls=Te,this.removeListeners=Te,this.controls=new Cu(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Te}unmount(){this.removeGroupControls(),this.removeListeners()}}const Gi=e=>(t,n)=>{e&&ne.postRender(()=>e(t,n))};class ju extends $e{constructor(){super(...arguments),this.removePointerDownListener=Te}onPointerDown(t){this.session=new Ui(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Gi(t),onStart:Gi(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&ne.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=it(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Qt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Xi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Rt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(N.test(e))e=parseFloat(e);else return e;const n=Xi(e,t.target.x),r=Xi(e,t.target.y);return`${n}% ${r}%`}},Au={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Be.parse(e);if(s.length>5)return r;const i=Be.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const u=re(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),i(s)}};class Mu extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;Oa(Du),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Qt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ne.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),pn.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Zi(e){const[t,n]=$r(),r=x.useContext(sn);return p.exports.jsx(Mu,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(es),isPresent:t,safeToRemove:n})}const Du={borderRadius:{...Rt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Rt,borderTopRightRadius:Rt,borderBottomLeftRadius:Rt,borderBottomRightRadius:Rt,boxShadow:Au};function Vu(e,t,n){const r=ye(e)?e:wt(e);return r.start(tr("",r,t,n)),r.animation}function Ru(e){return e instanceof SVGElement&&e.tagName!=="svg"}const Ou=(e,t)=>e.depth-t.depth;class Lu{constructor(){this.children=[],this.isDirty=!1}add(t){On(this.children,t),this.isDirty=!0}remove(t){Ln(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ou),this.isDirty=!1,this.children.forEach(t)}}function ku(e,t){const n=Ve.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Ne(r),e(i-t))};return ne.read(r,!0),()=>Ne(r)}const Ji=["TopLeft","TopRight","BottomLeft","BottomRight"],_u=Ji.length,Qi=e=>typeof e=="string"?parseFloat(e):e,eo=e=>typeof e=="number"||N.test(e);function Iu(e,t,n,r,s,i){s?(e.opacity=re(0,n.opacity!==void 0?n.opacity:1,Nu(r)),e.opacityExit=re(t.opacity!==void 0?t.opacity:1,0,Fu(r))):i&&(e.opacity=re(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<_u;o++){const a=`border${Ji[o]}Radius`;let l=to(t,a),u=to(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||eo(l)===eo(u)?(e[a]=Math.max(re(Qi(l),Qi(u),r),0),(De.test(u)||De.test(l))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=re(t.rotate||0,n.rotate||0,r))}function to(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Nu=no(0,.5,Fs),Fu=no(.5,.95,Te);function no(e,t,n){return r=>r<e?0:r>t?1:n(Je(e,t,r))}function ro(e,t){e.min=t.min,e.max=t.max}function Pe(e,t){ro(e.x,t.x),ro(e.y,t.y)}function so(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function io(e,t,n,r,s){return e-=t,e=Zt(e,1/n,r),s!==void 0&&(e=Zt(e,1/s,r)),e}function Bu(e,t=0,n=1,r=.5,s,i=e,o=e){if(De.test(t)&&(t=parseFloat(t),t=re(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=re(i.min,i.max,r);e===i&&(a-=t),e.min=io(e.min,t,n,a,s),e.max=io(e.max,t,n,a,s)}function oo(e,t,[n,r,s],i,o){Bu(e,t[n],t[r],t[s],t.scale,i,o)}const $u=["x","scaleX","originX"],Uu=["y","scaleY","originY"];function ao(e,t,n,r){oo(e.x,t,$u,n?n.x:void 0,r?r.x:void 0),oo(e.y,t,Uu,n?n.y:void 0,r?r.y:void 0)}function lo(e){return e.translate===0&&e.scale===1}function co(e){return lo(e.x)&&lo(e.y)}function uo(e,t){return e.min===t.min&&e.max===t.max}function Wu(e,t){return uo(e.x,t.x)&&uo(e.y,t.y)}function fo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ho(e,t){return fo(e.x,t.x)&&fo(e.y,t.y)}function po(e){return xe(e.x)/xe(e.y)}function mo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class zu{constructor(){this.members=[]}add(t){On(this.members,t),t.scheduleRender()}remove(t){if(Ln(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Yu(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:f,rotateY:h,skewX:m,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),v&&(r+=`skewY(${v}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const qe={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},cr=["","X","Y","Z"],Ku={visibility:"hidden"},go=1e3;let Hu=0;function ur(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function yo(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Rs(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ne,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&yo(r)}function vo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Hu++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Ie.value&&(qe.nodes=qe.calculatedTargetDeltas=qe.calculatedProjections=0),this.nodes.forEach(Xu),this.nodes.forEach(tf),this.nodes.forEach(nf),this.nodes.forEach(Zu),Ie.addProjectionMetrics&&Ie.addProjectionMetrics(qe)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,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 l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Lu)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new kn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Ru(o),this.instance=o;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=ku(h,250),Qt.hasAnimatedSinceResize&&(Qt.hasAnimatedSinceResize=!1,this.nodes.forEach(bo))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||c.getDefaultTransition()||lf,{onLayoutAnimationStart:w,onLayoutAnimationComplete:b}=c.getProps(),C=!this.targetLayout||!ho(this.targetLayout,v),P=!h&&m;if(this.options.layoutRoot||this.resumeFrom||P||h&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,P);const L={...En(y,"layout"),onPlay:w,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L)}else h||bo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ne(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(rf),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&yo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const f=this.path[c];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(xo);return}this.isUpdating||this.nodes.forEach(Qu),this.isUpdating=!1,this.nodes.forEach(ef),this.nodes.forEach(qu),this.nodes.forEach(Gu),this.clearAllSnapshots();const a=Ve.now();ge.delta=Le(0,1e3/60,a-ge.timestamp),ge.timestamp=a,ge.isProcessing=!0,un.update.process(ge),un.preRender.process(ge),un.render.process(ge),ge.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,pn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ju),this.sharedNodes.forEach(sf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ne.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ne.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!xe(this.snapshot.measuredBox.x)&&!xe(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ue(),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,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!co(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(a||He(this.latestValues)||c)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),cf(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return ue();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(uf))){const{scroll:c}=this.root;c&&(at(l.x,c.offset.x),at(l.y,c.offset.y))}return l}removeElementScroll(o){var a;const l=ue();if(Pe(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:f,options:h}=c;c!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Pe(l,o),at(l.x,f.offset.x),at(l.y,f.offset.y))}return l}applyTransform(o,a=!1){const l=ue();Pe(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&lt(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),He(c.latestValues)&&lt(l,c.latestValues)}return He(this.latestValues)&&lt(l,this.latestValues),l}removeTransform(o){const a=ue();Pe(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!He(u.latestValues))continue;sr(u.latestValues)&&u.updateSnapshot();const c=ue(),f=u.measurePageBox();Pe(c,f),ao(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return He(this.latestValues)&&ao(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.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!==ge.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=Boolean(this.resumingFrom)||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=ge.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ue(),this.relativeTargetOrigin=ue(),Vt(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),Pe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=ue(),this.targetWithTransforms=ue()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),fu(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Pe(this.target,this.layout.layoutBox),_i(this.target,this.targetDelta)):Pe(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&Boolean(m.resumingFrom)===Boolean(this.resumingFrom)&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ue(),this.relativeTargetOrigin=ue(),Vt(this.relativeTargetOrigin,this.target,m.target),Pe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ie.value&&qe.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||sr(this.parent.latestValues)||Oi(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=Boolean(this.resumingFrom)||this!==a;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===ge.timestamp&&(u=!1),u)return;const{layout:c,layoutId:f}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||f))return;Pe(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;du(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=ue());const{target:v}=a;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(so(this.prevProjectionDelta.x,this.projectionDelta.x),so(this.prevProjectionDelta.y,this.projectionDelta.y)),Dt(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!mo(this.projectionDelta.x,this.prevProjectionDelta.x)||!mo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),Ie.value&&qe.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ot(),this.projectionDelta=ot(),this.projectionDeltaWithTransform=ot()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},f=ot();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=ue(),m=l?l.source:void 0,v=this.layout?this.layout.source:void 0,y=m!==v,w=this.getStack(),b=!w||w.members.length<=1,C=Boolean(y&&!b&&this.options.crossfade===!0&&!this.path.some(af));this.animationProgress=0;let P;this.mixTargetDelta=L=>{const g=L/1e3;wo(f.x,o.x,g),wo(f.y,o.y,g),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Vt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),of(this.relativeTarget,this.relativeTargetOrigin,h,g),P&&Wu(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=ue()),Pe(P,this.relativeTarget)),y&&(this.animationValues=c,Iu(c,u,this.latestValues,g,C,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=g},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ne(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ne.update(()=>{Qt.hasAnimatedSinceResize=!0,Pt.layout++,this.currentAnimation=Vu(0,go,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{Pt.layout--},onComplete:()=>{Pt.layout--,o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(go),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&Eo(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||ue();const f=xe(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=xe(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Pe(a,l),lt(a,c),Dt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new zu),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&ur("z",o,u,this.animationValues);for(let c=0;c<cr.length;c++)ur(`rotate${cr[c]}`,o,u,this.animationValues),ur(`skew${cr[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Ku;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=zt(o==null?void 0:o.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=zt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!He(this.latestValues)&&(y.transform=c?c({},""):"none",this.hasProjected=!1),y}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),u.transform=Yu(this.projectionDeltaWithTransform,this.treeScale,h),c&&(u.transform=c(h,u.transform));const{x:m,y:v}=this.projectionDelta;u.transformOrigin=`${m.origin*100}% ${v.origin*100}% 0`,f.animationValues?u.opacity=f===this?(l=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:u.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const y in mt){if(h[y]===void 0)continue;const{correct:w,applyTo:b,isCSSVariable:C}=mt[y],P=u.transform==="none"?h[y]:w(h[y],f);if(b){const L=b.length;for(let g=0;g<L;g++)u[b[g]]=P}else C?this.options.visualElement.renderState.vars[y]=P:u[y]=P}return this.options.layoutId&&(u.pointerEvents=f===this?zt(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(xo),this.root.sharedNodes.clear()}}}function qu(e){e.updateLayout()}function Gu(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=n.source!==e.layout.source;i==="size"?Ce(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=xe(h);h.min=r[f].min,h.max=h.min+m}):Eo(i,n.layoutBox,r)&&Ce(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=xe(r[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const a=ot();Dt(a,r,n.layoutBox);const l=ot();o?Dt(l,e.applyTransform(s,!0),n.measuredBox):Dt(l,r,n.layoutBox);const u=!co(a);let c=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const v=ue();Vt(v,n.layoutBox,h.layoutBox);const y=ue();Vt(y,r,m.layoutBox),ho(v,y)||(c=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=v,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Xu(e){Ie.value&&qe.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Zu(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ju(e){e.clearSnapshot()}function xo(e){e.clearMeasurements()}function Qu(e){e.isLayoutDirty=!1}function ef(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function bo(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function tf(e){e.resolveTargetDelta()}function nf(e){e.calcProjection()}function rf(e){e.resetSkewAndRotation()}function sf(e){e.removeLeadSnapshot()}function wo(e,t,n){e.translate=re(t.translate,0,n),e.scale=re(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function To(e,t,n,r){e.min=re(t.min,n.min,r),e.max=re(t.max,n.max,r)}function of(e,t,n,r){To(e.x,t.x,n.x,r),To(e.y,t.y,n.y,r)}function af(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const lf={duration:.45,ease:[.4,0,.1,1]},So=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Co=So("applewebkit/")&&!So("chrome/")?Math.round:Te;function Po(e){e.min=Co(e.min),e.max=Co(e.max)}function cf(e){Po(e.x),Po(e.y)}function Eo(e,t,n){return e==="position"||e==="preserve-aspect"&&!uu(po(t),po(n),.2)}function uf(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const ff=vo({attachResizeListener:(e,t)=>At(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),fr={current:void 0},jo=vo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!fr.current){const e=new ff({});e.mount(window),e.setOptions({layoutScroll:!0}),fr.current=e}return fr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),df={pan:{Feature:ju},drag:{Feature:Eu,ProjectionNode:jo,MeasureLayout:Zi}};function Ao(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&ne.postRender(()=>i(t,Mt(t)))}class hf extends $e{mount(){const{current:t}=this.node;t&&(this.unmount=ul(t,(n,r)=>(Ao(this.node,r,"Start"),s=>Ao(this.node,s,"End"))))}unmount(){}}class pf extends $e{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Et(At(this.node.current,"focus",()=>this.onFocus()),At(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Mo(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&ne.postRender(()=>i(t,Mt(t)))}class mf extends $e{mount(){const{current:t}=this.node;t&&(this.unmount=pl(t,(n,r)=>(Mo(this.node,r,"Start"),(s,{success:i})=>Mo(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const dr=new WeakMap,hr=new WeakMap,gf=e=>{const t=dr.get(e.target);t&&t(e)},yf=e=>{e.forEach(gf)};function vf({root:e,...t}){const n=e||document;hr.has(n)||hr.set(n,{});const r=hr.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(yf,{root:e,...t})),r[s]}function xf(e,t,n){const r=vf(t);return dr.set(e,n),r.observe(e),()=>{dr.delete(e),r.unobserve(e)}}const bf={some:0,all:1};class wf extends $e{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:bf[s]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),h=u?c:f;h&&h(l)};return xf(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Tf(t,n))&&this.startObserver()}unmount(){}}function Tf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Sf={inView:{Feature:wf},tap:{Feature:mf},focus:{Feature:pf},hover:{Feature:hf}},Cf={layout:{ProjectionNode:jo,MeasureLayout:Zi}},pr={current:null},Do={current:!1};function Pf(){if(Do.current=!0,!!ln)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>pr.current=e.matches;e.addListener(t),t()}else pr.current=!1}const Ef=[...ri,ve,Be],jf=e=>Ef.find(ni(e)),Af=new WeakMap;function Mf(e,t,n){for(const r in t){const s=t[r],i=n[r];if(ye(s))e.addValue(r,s),process.env.NODE_ENV==="development"&&Ft(s.version==="12.4.7",`Attempting to mix Motion versions ${s.version} with 12.4.7 may not work as expected.`);else if(ye(i))e.addValue(r,wt(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,wt(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Vo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Df{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Hn,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 m=Ve.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ne.render(this.render,!1,!0))};const{latestValues:l,renderState:u,onUpdate:c}=o;this.onUpdate=c,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=Ut(n),this.isVariantNode=Zr(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const v=h[m];l[m]!==void 0&&ye(v)&&v.set(l[m],!1)}}mount(t){this.current=t,Af.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Do.current||Pf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:pr.current,process.env.NODE_ENV!=="production"&&Ft(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Ne(this.notifyUpdate),Ne(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=We.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&ne.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Qe){const n=Qe[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ue()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Vo.length;r++){const s=Vo[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=Mf(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=wt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(ei(s)||$s(s))?s=parseFloat(s):!jf(s)&&Be.test(n)&&(s=qs(t,n)),this.setBaseTarget(t,ye(s)?s.get():s)),ye(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=Sn(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[t])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ye(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new kn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Ro extends Df{constructor(){super(...arguments),this.KeyframeResolver=ii}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ye(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Vf(e){return window.getComputedStyle(e)}class Rf extends Ro{constructor(){super(...arguments),this.type="html",this.renderInstance=hs}readValueFromInstance(t,n){if(We.has(n)){const r=zn(n);return r&&r.default||0}else{const r=Vf(t),s=(mn(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Bi(t,n)}build(t,n,r){vn(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Pn(t,n,r)}}class Of extends Ro{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ue,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&ds(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(We.has(n)){const r=zn(n);return r&&r.default||0}return n=ps.has(n)?n:hn(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return gs(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&ne.postRender(this.updateDimensions)}build(t,n,r){wn(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){ms(t,n,r,s)}mount(t){this.isSVGTag=Tn(t.tagName),super.mount(t)}}const Lf=(e,t)=>bn(e)?new Of(t):new Rf(t,{allowProjection:e!==x.Fragment}),kf=rl({...nu,...Sf,...df,...Cf},Lf),mr=ba(kf),_f=({isOpen:e,onClose:t,onConfirm:n,header:r,question:s})=>e?p.exports.jsx("div",{id:"default-modal",tabIndex:-1,"aria-hidden":"true",className:"absolute z-10 w-full md:inset-0 h-full max-h-full overflow-y-auto overflow-x-hidden flex justify-center items-center bg-[rgb(0,0,0,0.6)]",children:p.exports.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:p.exports.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[p.exports.jsxs("div",{className:"flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600 border-gray-200",children:[p.exports.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[r," "]}),p.exports.jsxs("button",{type:"button",className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 inline-flex justify-center items-center",onClick:t,children:[p.exports.jsx("svg",{className:"w-3 h-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 14 14",children:p.exports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),p.exports.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),p.exports.jsx("div",{className:"p-4 md:p-5 space-y-4",children:p.exports.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[s," "]})}),p.exports.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[p.exports.jsx("button",{onClick:()=>{n(),t()},type:"button",className:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",children:"Yes "}),p.exports.jsx("button",{onClick:t,type:"button",className:"py-2.5 px-5 ml-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700",children:"Cancel"})]})]})})}):null,If=({items:e,isVisible:t,position:n,messageId:r,isCurrentUserMessage:s})=>{const i=x.useRef(null),[o,a]=x.useState(!1);return x.useEffect(()=>(i.current||(i.current=document.createElement("div"),i.current.style.zIndex="1500",i.current.style.position="fixed",i.current.style.top="0",i.current.style.left="0",i.current.style.width="100%",i.current.style.height="100%",i.current.style.pointerEvents="none",document.body.appendChild(i.current)),a(!0),()=>{i.current&&!t&&(document.body.removeChild(i.current),i.current=null)}),[t]),!i.current||!o?null:Ue.createPortal(p.exports.jsx(zr,{children:t&&p.exports.jsx(mr.div,{initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:-10},transition:{duration:.2,ease:"easeOut"},className:"absolute z-50 bg-white shadow-lg rounded-md p-2 px-1 w-42 pointer-events-auto",style:{top:n.y,left:n.x},children:e.map((l,u)=>l!=null&&l.onlyCurrentUserMessage&&!s?null:p.exports.jsxs("button",{disabled:l==null?void 0:l.disabled,className:"cursor-pointer flex items-center gap-2 w-full rounded-md text-left px-2 py-1 disabled:opacity-20 hover:bg-gray-200",onClick:()=>l.onClick(r),children:[x.cloneElement(l.icon,{className:"text-black",size:18}),p.exports.jsx("span",{className:"ml-2 text-black",children:l.name})]},u))})}),i.current)},Nf=(e,t)=>{if(!t.current)return 0;const n=window.getComputedStyle(t.current),r=parseInt(n.lineHeight,10)||20;return Math.ceil(t.current.scrollHeight/r)-1},Ff=e=>{const t=Math.floor(e/60),n=e%60;return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},Bf=()=>p.exports.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M9.77169 2.74358C12.1132 0.399998 15.9121 0.399998 18.2553 2.74314C20.5384 5.02621 20.5969 8.69142 18.4309 11.0454L18.2428 11.2427L9.44273 20.0409L9.40616 20.0712C7.94492 21.3879 5.69092 21.3432 4.28355 19.9358C2.96453 18.6168 2.84241 16.5541 3.9172 15.0974C3.94054 15.0521 3.96879 15.0083 4.002 14.9672L4.05556 14.9075L4.14247 14.8198L4.28355 14.6719L4.28647 14.6748L11.7222 7.22047C11.9881 6.95385 12.4047 6.92909 12.6986 7.14656L12.7829 7.21906C13.0495 7.48497 13.0742 7.9016 12.8568 8.19551L12.7843 8.27972L5.18966 15.8928C4.47202 16.7684 4.5219 18.0627 5.3393 18.8801C6.16836 19.7091 7.48801 19.7486 8.3638 18.9985L17.1965 10.1681C18.952 8.41041 18.952 5.56116 17.1946 3.8038C15.4922 2.10136 12.765 2.04816 10.9986 3.6442L10.8307 3.8038L10.8181 3.81812L1.28179 13.3544C0.988902 13.6473 0.514028 13.6473 0.221135 13.3544C-0.0451319 13.0882 -0.0693378 12.6715 0.148517 12.3779L0.221135 12.2938L9.77001 2.74314L9.77169 2.74358Z",fill:"#8A8A8A"})}),$f=()=>p.exports.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M13.25 9C13.6297 9 13.9435 9.28215 13.9932 9.64823L14 9.75V10.25C14 13.8094 11.245 16.7254 7.75098 16.9817L7.75 19.25C7.75 19.6642 7.41421 20 7 20C6.6203 20 6.30651 19.7178 6.25685 19.3518L6.25 19.25L6.25002 16.9818C2.83323 16.7316 0.122835 13.938 0.00406027 10.4863L0 10.25V9.75C0 9.33579 0.335786 9 0.75 9C1.1297 9 1.44349 9.28215 1.49315 9.64823L1.5 9.75V10.25C1.5 13.077 3.73445 15.3821 6.5336 15.4956L6.75 15.5H7.25C10.077 15.5 12.3821 13.2656 12.4956 10.4664L12.5 10.25V9.75C12.5 9.33579 12.8358 9 13.25 9ZM7 0C9.20914 0 11 1.79086 11 4V10C11 12.2091 9.20914 14 7 14C4.79086 14 3 12.2091 3 10V4C3 1.79086 4.79086 0 7 0ZM7 1.5C5.61929 1.5 4.5 2.61929 4.5 4V10C4.5 11.3807 5.61929 12.5 7 12.5C8.38071 12.5 9.5 11.3807 9.5 10V4C9.5 2.61929 8.38071 1.5 7 1.5Z",fill:"#fff"})}),gr=()=>p.exports.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M10.8147 10.1974L3.28344 11.4526C3.10705 11.482 2.95979 11.6034 2.89723 11.7709L0.299335 18.7283C0.0506615 19.3678 0.720085 19.9778 1.33375 19.671L19.3337 10.671C19.8865 10.3946 19.8865 9.60573 19.3337 9.32933L1.33375 0.329334C0.720085 0.0225017 0.0506615 0.632543 0.299335 1.27199L2.89723 8.22938C2.95979 8.39691 3.10705 8.51827 3.28344 8.54767L10.8147 9.80287C10.9236 9.82103 10.9972 9.92408 10.9791 10.033C10.965 10.1173 10.899 10.1834 10.8147 10.1974Z",fill:"#fff"})}),en=e=>p.exports.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...e,children:p.exports.jsxs("g",{fill:"none",children:[p.exports.jsx("path",{className:"background",fill:"#ffffff",d:"M8,1 L9,1 L9,20 L8,20 L8,18 C7.807,15.161 7.124,12.233 5.950,9.218 C5.046,6.893 3.504,4.733 1.325,2.738 L1.325,2.738 C0.917,2.365 0.89,1.732 1.263,1.325 C1.452,1.118 1.72,1 2,1 L8,1 Z"}),p.exports.jsx("path",{className:"fill-gray-200",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0 L9,0 L9,20 L7,20 L7,20 L7.002,18.068 C6.816,15.333 6.156,12.504 5.018,9.58 C4.172,7.406 2.72,5.371 0.649,3.475 C-0.165,2.729 -0.221,1.464 0.525,0.649 C0.904,0.236 1.439,0 2,0 Z"}),p.exports.jsx("path",{className:"border_2x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.5 L9,0.5 L9,20 L7.5,20 L7.5,20 L7.501,18.034 C7.312,15.247 6.64,12.369 5.484,9.399 C4.609,7.15 3.112,5.052 0.987,3.106 C0.376,2.547 0.334,1.598 0.894,0.987 C1.178,0.677 1.579,0.5 2,0.5 Z"}),p.exports.jsx("path",{className:"border_3x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.667 L9,0.667 L9,20 L7.667,20 L7.667,20 L7.668,18.023 C7.477,15.218 6.802,12.324 5.64,9.338 C4.755,7.064 3.243,4.946 1.1,2.983 C0.557,2.486 0.52,1.643 1.017,1.1 C1.269,0.824 1.626,0.667 2,0.667 Z"})]})}),Uf=({onSendMessage:e,onEditMessage:t,onSendVoice:n,onImageSend:r,onVideoSend:s,onFileSend:i,dynamicSymbolAssignments:o,messageToEdit:a,setMessageToEdit:l})=>{const[u,c]=x.useState(""),[f,h]=x.useState(!1),[m,v]=x.useState(0),[y,w]=x.useState(null),[b,C]=x.useState(null),[P,L]=x.useState(0),g=x.useRef(null),O=x.useRef([]),Y=x.useRef(null),R=x.useRef(null),Q=x.useRef(null),[F,I]=x.useState(!1),oe=150,ee=41.6;x.useEffect(()=>{const D=document.getElementById("static-display");D&&!D.textContent&&(a!=null&&a.text)&&(D.textContent=a==null?void 0:a.text)},[a==null?void 0:a.text]);const ae=D=>{const E=D.target.value;a?l(k=>k?new Xe({...k,text:E,isEdited:!0}):void 0):c(E);const A=E.match(/(\S+)$/);if(Se(A),console.log("numberOfLineBreaks",Nf(E,R)),R.current){const k=R.current.scrollHeight,B=Math.ceil(R.current.scrollHeight/k)-1;console.log(B),k>ee?k>oe?(R.current.style.height=`${oe}px`,R.current.style.overflowY="auto"):(R.current.style.height=`${k}px`,R.current.style.overflowY="hidden"):(console.log("buy"),R.current.style.height=`${ee}px`,R.current.style.overflowY="hidden")}},Se=D=>{if(D){const E=D[0];if(y){const A=D[0].split(y)[1];C(A)}o!=null&&o.some(A=>A.symbol===E)&&w(E)}else w(null),C(null)},pe=(D,E)=>{a?l(A=>A?new Xe({...A,text:A.text+E+" "}):void 0):c(A=>A+E+" "),w(null),C(null),R.current.focus()},q=()=>{if(a){if(a.text.trim()==="")return;t(a),l(void 0)}else{if(u.trim()==="")return;e(u),c("")}w(null),C(null),R.current&&(R.current.style.height=`${ee}px`)},le=async()=>{h(!0),v(0),O.current=[],Y.current=setInterval(()=>{v(A=>A+1)},1e3);const D=await navigator.mediaDevices.getUserMedia({audio:!0}),E=new MediaRecorder(D);g.current=E,E.ondataavailable=A=>{A.data.size>0&&O.current.push(A.data)},E.onstop=()=>{clearInterval(Y.current);const A=new Blob(O.current,{type:"audio/mp3"}),k=new File([A],"recording.mp3",{type:"audio/mp3"});n(k),h(!1)},E.start()},K=()=>{var D;(D=g.current)==null||D.stop()},T=D=>{const{scrollTop:E,scrollHeight:A,clientHeight:k}=D.currentTarget;if(E>P){if(E+k>=A-1){const _=o==null?void 0:o.find(ce=>ce.symbol===y);_&&(_!=null&&_.updatePageNumber)&&(I(!0),_==null||_.updatePageNumber(_.pagNumber+1),L(E),setTimeout(()=>{I(!1)},500))}}else L(E)},V=new Set(["jpeg","png","gif","webp","bmp","svg+xml","tiff","x-icon"]),z=new Set(["mp4","webm","ogg","mpeg","quicktime","x-msvideo","x-ms-wmv","3gpp","3gpp2"]),W=()=>{var D;(D=Q.current)==null||D.click()},$=D=>{var k,B;const E=(k=D.target.files)==null?void 0:k[0];if(!E)return;let A="";if(E.type){const _=E.type.split("/");_.length===2&&(A=_[1])}A||(A=((B=E.name.split(".").pop())==null?void 0:B.toLowerCase())||""),V.has(A)?r(E):z.has(A)?s(E):i(E)};return p.exports.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[f?p.exports.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[p.exports.jsx("span",{className:"text-blue-400 font-bold flex-1",children:Ff(m)}),p.exports.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:K,children:p.exports.jsx(gr,{})})]}):a?p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] relative h-10",children:[p.exports.jsxs("div",{className:" h-12 absolute bottom-10 w-full flex justify-between items-center px-2 border-t border-x border-gray-300 bg-white rounded-t-lg ",children:[p.exports.jsx("span",{id:"static-display",className:"text-gray-400 whitespace-nowrap truncate"}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700 -mt-4",onClick:()=>l(void 0),children:"✕"})]}),p.exports.jsx("textarea",{className:"w-full resize-none h-[41.6px] absolute bottom-0 bg-white flex-1 p-2 pl-4 border border-gray-300 outline-none rounded-bl-3xl ",placeholder:"Type a message...",value:a.text,onChange:ae,onKeyDown:D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),q())}}),p.exports.jsx(en,{className:"rotate-180 absolute -right-[11.4px] top-[18.4px]"})]}),p.exports.jsx("button",{className:"flex items-center justify-center cursor-pointer w-9 h-9 ml-2 p-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 transition",onClick:q,children:p.exports.jsx(gr,{})})]}):p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] h-10 relative ",children:[p.exports.jsx("div",{onClick:W,className:"cursor-pointer z-10 absolute right-4 top-[11px]",children:p.exports.jsx(Bf,{})}),p.exports.jsx("input",{type:"file",ref:Q,style:{display:"none"},onChange:$}),p.exports.jsx("textarea",{ref:R,className:"w-full absolute bottom-0 resize-none bg-white flex-1 p-2 pr-10 pl-4 border border-gray-300 outline-none rounded-tl-3xl rounded-tr-2xl rounded-bl-3xl ",style:{height:ee},placeholder:"Type a message...",value:u,onChange:ae,onKeyDown:D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),q())}}),p.exports.jsx(en,{className:"rotate-180 absolute -right-[11.4px] top-[18.4px]"})]}),p.exports.jsx("button",{className:"flex items-center justify-center cursor-pointer w-9 h-9 ml-2 p-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 transition",onClick:u?q:le,children:u?p.exports.jsx(gr,{}):p.exports.jsx($f,{})})]}),y&&p.exports.jsxs("div",{className:"absolute bottom-full left-0 w-full bg-white shadow-xl rounded-lg border border-gray-200 p-4 z-50 max-h-60 overflow-y-auto",onScroll:T,children:[p.exports.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[p.exports.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",p.exports.jsx("span",{className:"text-blue-500",children:y})]}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>w(null),children:"✕"})]}),p.exports.jsxs("div",{className:"space-y-2",children:[o?o.filter(D=>D.symbol===y).map(D=>{var k;const{component:E,lists:A}=D;return E?b?(k=A==null?void 0:A.filter(B=>B==null?void 0:B.name.includes(b)))==null?void 0:k.map((B,_)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(E,{listsProps:B,onClick:(ce,j)=>pe(ce,j)})},_)):A==null?void 0:A.map((B,_)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(E,{listsProps:B,onClick:(ce,j)=>pe(ce,j)})},_)):null}):null,p.exports.jsx("div",{className:"h-8",children:F&&"Loading more items..."})]})]})]})};var Re=(e=>(e[e.File=0]="File",e[e.Voice=1]="Voice",e[e.Video=2]="Video",e[e.Image=3]="Image",e))(Re||{}),ie=(e=>(e[e.Telegram=0]="Telegram",e[e.Simple=1]="Simple",e))(ie||{});const yr=({progress:e,size:t=100,strokeWidth:n=10,circleColor:r="#e0e0e0",progressColor:s="#3b82f6",animationDuration:i=1e3,showCancel:o=!1,onCancelClick:a,className:l})=>{const[u,c]=x.useState(0),f=(t-n)/2,h=2*Math.PI*f,m=h-u/100*h;return x.useEffect(()=>{const v=Date.now(),y=v+i,w=()=>{const b=Date.now(),P=Math.min(1,(b-v)/i)*e;c(P),b<y?requestAnimationFrame(w):c(e)};requestAnimationFrame(w)},[e,i]),p.exports.jsxs("div",{className:`relative flex items-center justify-center ${l}`,style:{width:t,height:t},children:[p.exports.jsxs("svg",{className:"absolute animate-[spin_2s_ease-in-out_infinite] ",width:t,height:t,children:[p.exports.jsx("circle",{cx:t/2,cy:t/2,r:f,fill:"transparent",stroke:r,strokeWidth:n}),p.exports.jsx("circle",{cx:t/2,cy:t/2,r:f,fill:"transparent",stroke:s,strokeWidth:n,strokeDasharray:h,strokeDashoffset:m,strokeLinecap:"round",transform:`rotate(-90 ${t/2} ${t/2})`,className:"transition-all ease-linear duration-1000"})]}),o?p.exports.jsx("button",{onClick:a,className:"absolute flex items-center justify-center w-8 h-8 rounded-full hover:bg-gray-200 transition-colors","aria-label":"Cancel",children:p.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:s,children:p.exports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}):p.exports.jsxs("span",{className:"absolute text-lg font-bold",style:{color:s},children:[Math.round(u),"%"]})]})},Oo=({fileName:e,fileSize:t,format:n,src:r,them:s,uploadProgres:i,onCancelClick:o})=>{const a=()=>{const u={rar:p.exports.jsx("p",{className:"p-2 text-green-500 font-bold",children:n}),zip:p.exports.jsx("p",{className:"p-2 text-blue-500 font-bold",children:n}),pdf:p.exports.jsx("p",{className:"p-2 text-red-500 font-bold",children:n}),doc:p.exports.jsx("p",{className:"p-2 text-blue-400 font-bold",children:n}),vid:p.exports.jsx("p",{className:"p-2 text-orange-400 font-bold",children:n}),txt:p.exports.jsx("p",{className:"p-2 text-purple-500 font-bold",children:n}),xls:p.exports.jsx("p",{className:"p-2 text-green-400 font-bold",children:n}),ppt:p.exports.jsx("p",{className:"p-2 text-yellow-500 font-bold",children:n}),png:p.exports.jsx("p",{className:"p-2 text-pink-500 font-bold",children:n}),jpg:p.exports.jsx("p",{className:"p-2 text-indigo-500 font-bold",children:n}),mp3:p.exports.jsx("p",{className:"p-2 text-teal-500 font-bold",children:n}),mp4:p.exports.jsx("p",{className:"p-2 text-gray-500 font-bold",children:n}),exe:p.exports.jsx("p",{className:"p-2 text-red-400 font-bold",children:n}),html:p.exports.jsx("p",{className:"p-2 text-orange-500 font-bold",children:n}),css:p.exports.jsx("p",{className:"p-2 text-blue-300 font-bold",children:n}),js:p.exports.jsx("p",{className:"p-2 text-yellow-400 font-bold",children:n}),json:p.exports.jsx("p",{className:"p-2 text-purple-400 font-bold",children:n}),xml:p.exports.jsx("p",{className:"p-2 text-green-300 font-bold",children:n}),svg:p.exports.jsx("p",{className:"p-2 text-pink-400 font-bold",children:n}),gif:p.exports.jsx("p",{className:"p-2 text-indigo-400 font-bold",children:n}),csv:p.exports.jsx("p",{className:"p-2 text-teal-400 font-bold",children:n}),sql:p.exports.jsx("p",{className:"p-2 text-gray-400 font-bold",children:n})};return n&&u[n]?u[n]:p.exports.jsx("p",{className:"p-2 text-black ",children:n??"UN"})},l=u=>u>1048576?(u/1048576).toFixed(1)+" MB":(u/1024).toFixed(1)+" KB";return p.exports.jsxs("div",{className:"flex items-center rounded-lg",children:[i?p.exports.jsx("div",{className:" w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3",children:p.exports.jsx(yr,{progress:(i==null?void 0:i.progres)??0,size:50,strokeWidth:4,showCancel:!0,onCancelClick:o,circleColor:"#ddd",progressColor:"#4caf50"})}):p.exports.jsx("div",{className:` border ${s===ie.Simple?" border-white ":s===ie.Telegram?" border-green-900":""} w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3`,children:a()}),p.exports.jsxs("div",{className:"flex flex-col flex-grow",children:[p.exports.jsx("a",{href:r,download:e,className:`${s===ie.Simple?"text-white":s===ie.Telegram?"text-gray-900":""} font-medium hover:underline`,children:e}),p.exports.jsx("span",{className:`${s===ie.Simple?"text-gray-800":s===ie.Telegram?"text-gray-900":""} text-sm`,children:l(t)})]}),p.exports.jsx("a",{href:r,download:e,className:"ml-2 bg-green-500 text-white px-2 py-1 text-sm rounded hover:bg-green-600",children:"Download"})]})},Wf=e=>p.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-play",...e,children:p.exports.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),zf=e=>p.exports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-pause",...e,children:[p.exports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),p.exports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let Ot=null;const Yf=({src:e,className:t,uploadProgres:n,onCancelClick:r})=>{const[s,i]=x.useState(!1),[o,a]=x.useState(0),l=x.useRef(null);x.useEffect(()=>{const c=l.current;if(!c)return;const f=()=>{a(c.currentTime/c.duration*100)},h=()=>i(!0),m=()=>i(!1),v=()=>{i(!1),a(0)};return c.addEventListener("timeupdate",f),c.addEventListener("play",h),c.addEventListener("pause",m),c.addEventListener("ended",v),()=>{c.removeEventListener("timeupdate",f),c.removeEventListener("play",h),c.removeEventListener("pause",m),c.removeEventListener("ended",v)}},[]);const u=()=>{const c=l.current;c&&(s?c.pause():(Ot&&Ot!==c&&(Ot.pause(),Ot.currentTime=0),c.play(),Ot=c))};return p.exports.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${t}`,children:[n?p.exports.jsx("div",{className:" w-9 h-9 mr-3 flex items-center justify-center relative rounded-md p-3",children:p.exports.jsx(yr,{progress:(n==null?void 0:n.progres)??0,size:50,strokeWidth:4,showCancel:!0,onCancelClick:r,circleColor:"#ddd",progressColor:"#4caf50"})}):p.exports.jsx("button",{className:"w-9 h-9 cursor-pointer flex items-center justify-center pl-[1.5px] bg-gray-700 rounded-full hover:bg-gray-600",onClick:u,children:s?p.exports.jsx(zf,{}):p.exports.jsx(Wf,{})}),p.exports.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:p.exports.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${o}%`}})}),p.exports.jsx("audio",{ref:l,src:e})]})},Kf=({attachmentUrl:e,attachmentType:t,attachmentFormat:n,them:r,uploadProgres:s,cancellationToken:i})=>e?t===Re.Voice?p.exports.jsx("div",{className:"w-full",children:p.exports.jsx(Yf,{onCancelClick:i,uploadProgres:s,src:e})}):t===Re.Image?p.exports.jsxs("div",{className:"relative w-full",children:[s?p.exports.jsx(yr,{progress:s==null?void 0:s.progres,size:50,strokeWidth:4,showCancel:!0,onCancelClick:i,circleColor:"#ddd",progressColor:"#286b2a",className:"!absolute z-[1] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"}):null,p.exports.jsx("img",{className:`transition-all ${s?"filter blur-lg":" blur-none"}`,src:e})]}):t===Re.File?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Oo,{fileName:"productivity",fileSize:23e3,format:n??"UN",src:e,uploadProgres:s,onCancelClick:i})}):t===Re.Video?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Oo,{fileName:"productivity",fileSize:23e3,format:n??"UN",src:e,uploadProgres:s,onCancelClick:i})}):null:null,Hf=({message:e,showUserProfile:t,handleContextMenu:n,media:r,them:s,maxWidth:i})=>{var o,a,l,u,c,f,h,m,v,y;return p.exports.jsxs(p.exports.Fragment,{children:[t?p.exports.jsx("img",{src:e.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,p.exports.jsxs(mr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:w=>n(w,e),className:`relative ${r?"w-3/4":i?"max-w-[400px] w-fit":"max-w-[75%] w-fit"} flex flex-col gap-1 break-words p-2 pt-5 rounded-lg ${s===ie.Simple?"bg-[#f8fbff]":s===ie.Telegram?"bg-blue-200 ":""} `,children:[p.exports.jsx("span",{title:(o=e.user)!=null&&o.fullName&&((l=(a=e.user)==null?void 0:a.fullName)==null?void 0:l.length)>16?(u=e.user)==null?void 0:u.firstName:(c=e.user)==null?void 0:c.fullName,className:"relative -top-3 h-4 -mb-3 overflow-y-visible text-xs text-orange-700 whitespace-nowrap truncate max-w-[100px] overflow-visible",children:(f=e.user)!=null&&f.fullName&&((m=(h=e.user)==null?void 0:h.fullName)==null?void 0:m.length)>16?(v=e.user)==null?void 0:v.firstName:(y=e.user)==null?void 0:y.fullName}),r||null,p.exports.jsx("span",{children:e.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(e.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(e.createdDate).toLocaleTimeString().split(":")[1]}),e.isEdited?p.exports.jsx("span",{className:`text-xs italic ${s===ie.Simple?"text-gray-700":s===ie.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(en,{className:` ${s===ie.Simple?"[&>g>path]:fill-[#f8fbff]":s===ie.Telegram?"[&>g>path]:fill-blue-200":""} -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 `})]})]})},qf=({className:e})=>p.exports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[p.exports.jsx("path",{d:"M11.6619 4.6478C11.8358 4.83691 11.8272 5.1347 11.6427 5.31294L4.36284 12.3463C4.14493 12.5568 3.80285 12.5503 3.59268 12.3317L1.13205 9.77168C0.954124 9.58658 0.956276 9.28866 1.13686 9.10628C1.31743 8.92389 1.60806 8.9261 1.78598 9.1112L3.99455 11.4089L11.013 4.62812C11.1975 4.44988 11.488 4.4587 11.6619 4.6478Z",fill:"gray"}),p.exports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.8759 4.64963C15.0492 4.83921 15.0399 5.13698 14.8549 5.31471L7.51066 12.3726C7.32572 12.5503 7.03524 12.5407 6.86185 12.3511C6.68847 12.1616 6.69784 11.8638 6.88278 11.6861L14.227 4.62818C14.412 4.45045 14.7025 4.46005 14.8759 4.64963Z",fill:"gray"})]}),Lo=({size:e=24,color:t="text-current",className:n})=>p.exports.jsx("div",{className:` ${n} animate-spin inline-flex items-center justify-center`,children:p.exports.jsxs("svg",{width:e,height:e,viewBox:"0 0 36 36",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[p.exports.jsx("defs",{children:p.exports.jsxs("linearGradient",{x1:"0%",y1:"100%",x2:"100%",y2:"100%",id:"linearGradient-1",children:[p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0",offset:"0%"}),p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0.50",offset:"39.9430698%"}),p.exports.jsx("stop",{stopColor:"currentColor",offset:"100%"})]})}),p.exports.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[p.exports.jsx("rect",{fillOpacity:"0.01",fill:"none",x:"0",y:"0",width:"36",height:"36"}),p.exports.jsx("path",{d:"M34,18 C34,9.163444 26.836556,2 18,2 C11.6597233,2 6.18078805,5.68784135 3.59122325,11.0354951",stroke:"url(#linearGradient-1)",strokeWidth:"4",strokeLinecap:"round"})]})]})}),Gf=({handleContextMenu:e,media:t,message:n,them:r,maxWidth:s})=>p.exports.jsxs(mr.div,{style:{background:"red !important"},initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:i=>e(i,n),className:`relative self-end ${t?"w-3/4":s?" max-w-[400px]":"max-w-[75%]"} flex flex-col justify-center break-words p-2 rounded-lg ${r===ie.Telegram?" bg-green-200":ie.Simple?" bg-[#4F46E5] text-white":""}`,children:[t||null,p.exports.jsx("span",{className:"",children:n.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(n.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(n.createdDate).toLocaleTimeString().split(":")[1]}),n.isSending?p.exports.jsx(Lo,{size:13,color:"text-black"}):p.exports.jsx(qf,{className:r===ie.Telegram?" ":ie.Simple?" [&>path]:fill-white":""}),n.isEdited?p.exports.jsx("span",{className:`text-xs italic ${r===ie.Simple?"text-gray-200":r===ie.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(en,{className:`fill-blue-200 rotate-180 absolute -right-2 bottom-0 ${r===ie.Telegram?"[&>g>path]:fill-green-200":ie.Simple?"[&>g>path]:fill-[#4F46E5]":""} `})]});var me={exports:{}},vr={exports:{}},Z={};var ko;function Xf(){if(ko)return Z;ko=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function P(g){if(typeof g=="object"&&g!==null){var O=g.$$typeof;switch(O){case t:switch(g=g.type,g){case l:case u:case r:case i:case s:case f:return g;default:switch(g=g&&g.$$typeof,g){case a:case c:case v:case m:case o:return g;default:return O}}case n:return O}}}function L(g){return P(g)===u}return Z.AsyncMode=l,Z.ConcurrentMode=u,Z.ContextConsumer=a,Z.ContextProvider=o,Z.Element=t,Z.ForwardRef=c,Z.Fragment=r,Z.Lazy=v,Z.Memo=m,Z.Portal=n,Z.Profiler=i,Z.StrictMode=s,Z.Suspense=f,Z.isAsyncMode=function(g){return L(g)||P(g)===l},Z.isConcurrentMode=L,Z.isContextConsumer=function(g){return P(g)===a},Z.isContextProvider=function(g){return P(g)===o},Z.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===t},Z.isForwardRef=function(g){return P(g)===c},Z.isFragment=function(g){return P(g)===r},Z.isLazy=function(g){return P(g)===v},Z.isMemo=function(g){return P(g)===m},Z.isPortal=function(g){return P(g)===n},Z.isProfiler=function(g){return P(g)===i},Z.isStrictMode=function(g){return P(g)===s},Z.isSuspense=function(g){return P(g)===f},Z.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===r||g===u||g===i||g===s||g===f||g===h||typeof g=="object"&&g!==null&&(g.$$typeof===v||g.$$typeof===m||g.$$typeof===o||g.$$typeof===a||g.$$typeof===c||g.$$typeof===w||g.$$typeof===b||g.$$typeof===C||g.$$typeof===y)},Z.typeOf=P,Z}var J={};var _o;function Zf(){return _o||(_o=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function P(j){return typeof j=="string"||typeof j=="function"||j===r||j===u||j===i||j===s||j===f||j===h||typeof j=="object"&&j!==null&&(j.$$typeof===v||j.$$typeof===m||j.$$typeof===o||j.$$typeof===a||j.$$typeof===c||j.$$typeof===w||j.$$typeof===b||j.$$typeof===C||j.$$typeof===y)}function L(j){if(typeof j=="object"&&j!==null){var Ee=j.$$typeof;switch(Ee){case t:var ct=j.type;switch(ct){case l:case u:case r:case i:case s:case f:return ct;default:var Ge=ct&&ct.$$typeof;switch(Ge){case a:case c:case v:case m:case o:return Ge;default:return Ee}}case n:return Ee}}}var g=l,O=u,Y=a,R=o,Q=t,F=c,I=r,oe=v,ee=m,ae=n,Se=i,pe=s,q=f,le=!1;function K(j){return le||(le=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),T(j)||L(j)===l}function T(j){return L(j)===u}function V(j){return L(j)===a}function z(j){return L(j)===o}function W(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function $(j){return L(j)===c}function D(j){return L(j)===r}function E(j){return L(j)===v}function A(j){return L(j)===m}function k(j){return L(j)===n}function B(j){return L(j)===i}function _(j){return L(j)===s}function ce(j){return L(j)===f}J.AsyncMode=g,J.ConcurrentMode=O,J.ContextConsumer=Y,J.ContextProvider=R,J.Element=Q,J.ForwardRef=F,J.Fragment=I,J.Lazy=oe,J.Memo=ee,J.Portal=ae,J.Profiler=Se,J.StrictMode=pe,J.Suspense=q,J.isAsyncMode=K,J.isConcurrentMode=T,J.isContextConsumer=V,J.isContextProvider=z,J.isElement=W,J.isForwardRef=$,J.isFragment=D,J.isLazy=E,J.isMemo=A,J.isPortal=k,J.isProfiler=B,J.isStrictMode=_,J.isSuspense=ce,J.isValidElementType=P,J.typeOf=L}()),J}var Io;function No(){return Io||(Io=1,function(e){process.env.NODE_ENV==="production"?e.exports=Xf():e.exports=Zf()}(vr)),vr.exports}var xr,Fo;function Jf(){if(Fo)return xr;Fo=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function s(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(c){return o[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return xr=s()?Object.assign:function(i,o){for(var a,l=r(i),u,c=1;c<arguments.length;c++){a=Object(arguments[c]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){u=e(a);for(var h=0;h<u.length;h++)n.call(a,u[h])&&(l[u[h]]=a[u[h]])}}return l},xr}var br,Bo;function wr(){if(Bo)return br;Bo=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return br=e,br}var Tr,$o;function Uo(){return $o||($o=1,Tr=Function.call.bind(Object.prototype.hasOwnProperty)),Tr}var Sr,Wo;function Qf(){if(Wo)return Sr;Wo=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=wr(),n={},r=Uo();e=function(i){var o="Warning: "+i;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(i,o,a,l,u){if(process.env.NODE_ENV!=="production"){for(var c in i)if(r(i,c)){var f;try{if(typeof i[c]!="function"){var h=Error((l||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=i[c](o,c,l,a,null,t)}catch(v){f=v}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var m=u?u():"";e("Failed "+a+" type: "+f.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Sr=s,Sr}var Cr,zo;function ed(){if(zo)return Cr;zo=1;var e=No(),t=Jf(),n=wr(),r=Uo(),s=Qf(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function o(){return null}return Cr=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function f(T){var V=T&&(u&&T[u]||T[c]);if(typeof V=="function")return V}var h="<<anonymous>>",m={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:C(),arrayOf:P,element:L(),elementType:g(),instanceOf:O,node:F(),objectOf:R,oneOf:Y,oneOfType:Q,shape:oe,exact:ee};function v(T,V){return T===V?T!==0||1/T===1/V:T!==T&&V!==V}function y(T,V){this.message=T,this.data=V&&typeof V=="object"?V:{},this.stack=""}y.prototype=Error.prototype;function w(T){if(process.env.NODE_ENV!=="production")var V={},z=0;function W(D,E,A,k,B,_,ce){if(k=k||h,_=_||A,ce!==n){if(l){var j=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw j.name="Invariant Violation",j}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ee=k+":"+A;!V[Ee]&&z<3&&(i("You are manually calling a React.PropTypes validation function for the `"+_+"` prop on `"+k+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),V[Ee]=!0,z++)}}return E[A]==null?D?E[A]===null?new y("The "+B+" `"+_+"` is marked as required "+("in `"+k+"`, but its value is `null`.")):new y("The "+B+" `"+_+"` is marked as required in "+("`"+k+"`, but its value is `undefined`.")):null:T(E,A,k,B,_)}var $=W.bind(null,!1);return $.isRequired=W.bind(null,!0),$}function b(T){function V(z,W,$,D,E,A){var k=z[W],B=pe(k);if(B!==T){var _=q(k);return new y("Invalid "+D+" `"+E+"` of type "+("`"+_+"` supplied to `"+$+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return w(V)}function C(){return w(o)}function P(T){function V(z,W,$,D,E){if(typeof T!="function")return new y("Property `"+E+"` of component `"+$+"` has invalid PropType notation inside arrayOf.");var A=z[W];if(!Array.isArray(A)){var k=pe(A);return new y("Invalid "+D+" `"+E+"` of type "+("`"+k+"` supplied to `"+$+"`, expected an array."))}for(var B=0;B<A.length;B++){var _=T(A,B,$,D,E+"["+B+"]",n);if(_ instanceof Error)return _}return null}return w(V)}function L(){function T(V,z,W,$,D){var E=V[z];if(!a(E)){var A=pe(E);return new y("Invalid "+$+" `"+D+"` of type "+("`"+A+"` supplied to `"+W+"`, expected a single ReactElement."))}return null}return w(T)}function g(){function T(V,z,W,$,D){var E=V[z];if(!e.isValidElementType(E)){var A=pe(E);return new y("Invalid "+$+" `"+D+"` of type "+("`"+A+"` supplied to `"+W+"`, expected a single ReactElement type."))}return null}return w(T)}function O(T){function V(z,W,$,D,E){if(!(z[W]instanceof T)){var A=T.name||h,k=K(z[W]);return new y("Invalid "+D+" `"+E+"` of type "+("`"+k+"` supplied to `"+$+"`, expected ")+("instance of `"+A+"`."))}return null}return w(V)}function Y(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),o;function V(z,W,$,D,E){for(var A=z[W],k=0;k<T.length;k++)if(v(A,T[k]))return null;var B=JSON.stringify(T,function(ce,j){var Ee=q(j);return Ee==="symbol"?String(j):j});return new y("Invalid "+D+" `"+E+"` of value `"+String(A)+"` "+("supplied to `"+$+"`, expected one of "+B+"."))}return w(V)}function R(T){function V(z,W,$,D,E){if(typeof T!="function")return new y("Property `"+E+"` of component `"+$+"` has invalid PropType notation inside objectOf.");var A=z[W],k=pe(A);if(k!=="object")return new y("Invalid "+D+" `"+E+"` of type "+("`"+k+"` supplied to `"+$+"`, expected an object."));for(var B in A)if(r(A,B)){var _=T(A,B,$,D,E+"."+B,n);if(_ instanceof Error)return _}return null}return w(V)}function Q(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var V=0;V<T.length;V++){var z=T[V];if(typeof z!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+le(z)+" at index "+V+"."),o}function W($,D,E,A,k){for(var B=[],_=0;_<T.length;_++){var ce=T[_],j=ce($,D,E,A,k,n);if(j==null)return null;j.data&&r(j.data,"expectedType")&&B.push(j.data.expectedType)}var Ee=B.length>0?", expected one of type ["+B.join(", ")+"]":"";return new y("Invalid "+A+" `"+k+"` supplied to "+("`"+E+"`"+Ee+"."))}return w(W)}function F(){function T(V,z,W,$,D){return ae(V[z])?null:new y("Invalid "+$+" `"+D+"` supplied to "+("`"+W+"`, expected a ReactNode."))}return w(T)}function I(T,V,z,W,$){return new y((T||"React class")+": "+V+" type `"+z+"."+W+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+$+"`.")}function oe(T){function V(z,W,$,D,E){var A=z[W],k=pe(A);if(k!=="object")return new y("Invalid "+D+" `"+E+"` of type `"+k+"` "+("supplied to `"+$+"`, expected `object`."));for(var B in T){var _=T[B];if(typeof _!="function")return I($,D,E,B,q(_));var ce=_(A,B,$,D,E+"."+B,n);if(ce)return ce}return null}return w(V)}function ee(T){function V(z,W,$,D,E){var A=z[W],k=pe(A);if(k!=="object")return new y("Invalid "+D+" `"+E+"` of type `"+k+"` "+("supplied to `"+$+"`, expected `object`."));var B=t({},z[W],T);for(var _ in B){var ce=T[_];if(r(T,_)&&typeof ce!="function")return I($,D,E,_,q(ce));if(!ce)return new y("Invalid "+D+" `"+E+"` key `"+_+"` supplied to `"+$+"`.\nBad object: "+JSON.stringify(z[W],null," ")+`
20
- Valid keys: `+JSON.stringify(Object.keys(T),null," "));var j=ce(A,_,$,D,E+"."+_,n);if(j)return j}return null}return w(V)}function ae(T){switch(typeof T){case"number":case"string":case"undefined":return!0;case"boolean":return!T;case"object":if(Array.isArray(T))return T.every(ae);if(T===null||a(T))return!0;var V=f(T);if(V){var z=V.call(T),W;if(V!==T.entries){for(;!(W=z.next()).done;)if(!ae(W.value))return!1}else for(;!(W=z.next()).done;){var $=W.value;if($&&!ae($[1]))return!1}}else return!1;return!0;default:return!1}}function Se(T,V){return T==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function pe(T){var V=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":Se(V,T)?"symbol":V}function q(T){if(typeof T>"u"||T===null)return""+T;var V=pe(T);if(V==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return V}function le(T){var V=q(T);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function K(T){return!T.constructor||!T.constructor.name?h:T.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},Cr}var Pr,Yo;function td(){if(Yo)return Pr;Yo=1;var e=wr();function t(){}function n(){}return n.resetWarningCache=t,Pr=function(){function r(o,a,l,u,c,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function s(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Pr}if(process.env.NODE_ENV!=="production"){var nd=No(),rd=!0;me.exports=ed()(nd.isElement,rd)}else me.exports=td()();function Er(){return Er=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Er.apply(this,arguments)}function sd(e,t){if(e==null)return{};var n=id(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function id(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var jr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=sd(e,["color","size"]);return x.createElement("svg",Er({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("polyline",{points:"20 6 9 17 4 12"}))});jr.propTypes={color:me.exports.string,size:me.exports.oneOfType([me.exports.string,me.exports.number])},jr.displayName="Check";const od=jr;function Ar(){return Ar=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ar.apply(this,arguments)}function ad(e,t){if(e==null)return{};var n=ld(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ld(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Mr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=ad(e,["color","size"]);return x.createElement("svg",Ar({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),x.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))});Mr.propTypes={color:me.exports.string,size:me.exports.oneOfType([me.exports.string,me.exports.number])},Mr.displayName="Copy";const cd=Mr;function Dr(){return Dr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dr.apply(this,arguments)}function ud(e,t){if(e==null)return{};var n=fd(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fd(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Vr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=ud(e,["color","size"]);return x.createElement("svg",Dr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),x.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});Vr.propTypes={color:me.exports.string,size:me.exports.oneOfType([me.exports.string,me.exports.number])},Vr.displayName="Edit";const dd=Vr;function Rr(){return Rr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rr.apply(this,arguments)}function hd(e,t){if(e==null)return{};var n=pd(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pd(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Or=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=hd(e,["color","size"]);return x.createElement("svg",Rr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("polyline",{points:"3 6 5 6 21 6"}),x.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}))});Or.propTypes={color:me.exports.string,size:me.exports.oneOfType([me.exports.string,me.exports.number])},Or.displayName="Trash";const md=Or,gd=({user:e,messages:t,updateMessages:n,onMessageSent:r,onEditMessage:s,isSendingDefultForNewMessage:i,isSendingDefultForEdited:o,onDeleteMessage:a})=>{const l=x.useRef(null),[u,c]=x.useState(!1),[f,h]=x.useState(null),[m,v]=x.useState(),[y,w]=x.useState(null),b=()=>{setTimeout(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},100)};x.useEffect(()=>{const F=()=>{w(null)};return window.addEventListener("scroll",F,!0),()=>{window.removeEventListener("scroll",F,!0)}},[w]);const C=(F,I)=>{F.preventDefault();const oe=window.scrollX,ee=window.scrollY;w({x:F.clientX+oe,y:F.clientY+ee,message:I})},P=()=>{w(null)},L=F=>{const I=new Xe({id:new Date().toString(),text:F,user:e,isRightSided:!0,isSending:i,createdDate:new Date().toString()});n([...t,I]),r(I),b()},g=F=>{n(t.map(I=>I.id===F.id?(F.updateIsSending(Boolean(o)),F):I)),s(F)},O=F=>{const I=URL.createObjectURL(F),oe=new Xe({id:new Date().toString(),text:"",attachmentUrl:I,attachmentType:Re.Voice,attachmentBlob:F,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,oe]),r(oe),b()},Y=(F,I)=>{const oe=URL.createObjectURL(F),ee=new Xe({id:new Date().toString(),text:"",attachmentUrl:oe,attachmentBlob:F,attachmentType:I,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,ee]),r(ee),b()};return{handleDeleteConfirmation:()=>{f&&(a(f),h(null)),c(!1)},handleCloseContextMenu:P,contextMenuItems:[{name:"Edit",icon:p.exports.jsx(dd,{className:"text-gray-600"}),onlyCurrentUserMessage:!0,onClick:F=>{v(t.find(I=>I.id===F)),P()}},{name:"Delete",icon:p.exports.jsx(md,{className:"text-red-600"}),onlyCurrentUserMessage:!0,onClick:F=>{h(F),c(!0),P()}},{name:"Select",icon:p.exports.jsx(od,{className:"text-green-600"}),disabled:!0,onClick:()=>{console.log("Select clicked"),P()}},{name:"Copy",icon:p.exports.jsx(cd,{className:"text-blue-600"}),onClick:F=>{const I=t.find(oe=>oe.id===F);I&&navigator.clipboard.writeText(I.text),P()}}],handleSendFile:Y,handleSendVoice:O,handleSendMessage:L,handleContextMenu:C,isModalOpen:u,contextMenu:y,chatRef:l,setIsModalOpen:c,messageToEdit:m,setMessageToEdit:v,handleEditMessage:g}},yd=({width:e="400px",height:t="600px",isLoadingChat:n,className:r,style:s,messages:i,user:o,updateMessages:a,onMessageSent:l,onDeleteMessage:u,onEditMessage:c,dynamicSymbolAssignments:f,isSendingDefultForNewMessage:h,isSendingDefultForEdited:m,backgroundImage:v,messageBubbleBiggerSize:y,uploadProgress:w,onUploadCancellationToken:b,them:C=ie.Telegram})=>{var q,le;const{handleDeleteConfirmation:P,handleCloseContextMenu:L,handleSendFile:g,handleSendVoice:O,handleSendMessage:Y,handleContextMenu:R,contextMenuItems:Q,isModalOpen:F,contextMenu:I,chatRef:oe,setIsModalOpen:ee,messageToEdit:ae,setMessageToEdit:Se,handleEditMessage:pe}=gd({user:o,messages:i,updateMessages:a,onMessageSent:l,onEditMessage:c,onDeleteMessage:u,isSendingDefultForNewMessage:h,isSendingDefultForEdited:m});return p.exports.jsxs("div",{className:`flex flex-col !bg-cover ${r}`,style:{width:e,height:t,background:"url("+v+")",...s},onClick:L,children:[p.exports.jsx("div",{ref:oe,className:`flex flex-col gap-2 flex-1 p-3 pb-16 ${I?"overflow-hidden pr-[22px]":"overflow-y-scroll"}`,children:n?p.exports.jsx(Lo,{className:"mt-3",size:27,color:"text-gray-800"}):p.exports.jsx(zr,{children:i.length>0?i.map((K,T)=>{var W,$,D;const V=K!=null&&K.attachmentUrl?p.exports.jsx(Kf,{attachmentUrl:K.attachmentUrl,attachmentType:K==null?void 0:K.attachmentType,attachmentFormat:K==null?void 0:K.attachmentFormat,uploadProgres:w==null?void 0:w.find(E=>E.messageId===K.id),cancellationToken:()=>b?b(K.id):null},T):null;if(K.isRightSided)return p.exports.jsx(Gf,{maxWidth:y,media:V,handleContextMenu:R,message:K,them:C},T);const z=(($=(W=i[T-1])==null?void 0:W.user)==null?void 0:$.id)!==((D=K==null?void 0:K.user)==null?void 0:D.id);return p.exports.jsx(Hf,{maxWidth:y,showUserProfile:z,media:V,handleContextMenu:R,message:K,them:C},T)}):null})}),p.exports.jsx(_f,{isOpen:F,onClose:()=>ee(!1),onConfirm:P,header:"Confirm Delete",question:"Are you sure you want to delete this message?"}),I&&((q=I==null?void 0:I.message)!=null&&q.id)?p.exports.jsx(If,{items:Q,isVisible:Boolean(I),messageId:String(I==null?void 0:I.message.id),isCurrentUserMessage:((le=I==null?void 0:I.message)==null?void 0:le.user.id)===o.id,position:{x:I==null?void 0:I.x,y:I==null?void 0:I.y}}):null,p.exports.jsx(Uf,{onSendVoice:O,onSendMessage:Y,onFileSend:K=>g(K,Re.File),onImageSend:K=>g(K,Re.Image),onVideoSend:K=>g(K,Re.Video),dynamicSymbolAssignments:f,messageToEdit:ae,setMessageToEdit:Se,onEditMessage:pe})]})};he.AttachmentTypeEnum=Re,he.Button=la,he.Chat=yd,he.ChatThemEntity=ie,he.MessageEntity=Xe,he.SymbolsListComponent=ca,Object.defineProperty(he,Symbol.toStringTag,{value:"Module"})});
19
+ `),()=>{document.head.removeChild(m)}},[t]),p.exports.jsx(da,{isPresent:t,childRef:s,sizeRef:i,children:an.cloneElement(e,{ref:s})})}const pa=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a})=>{const l=cn(ma),c=v.useId(),u=v.useCallback(h=>{l.set(h,!0);for(const m of l.values())if(!m)return;r&&r()},[l,r]),f=v.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:h=>(l.set(h,!1),()=>l.delete(h))}),i?[Math.random(),u]:[n,u]);return v.useMemo(()=>{l.forEach((h,m)=>l.set(m,!1))},[n]),an.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=p.exports.jsx(ha,{isPresent:n,anchorX:a,children:e})),p.exports.jsx(Ft.Provider,{value:f,children:e})};function ma(){return new Map}function zr(e=!0){const t=v.useContext(Ft);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=v.useId();v.useEffect(()=>{if(e)return s(i)},[e]);const o=v.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const Bt=e=>e.key||"";function Yr(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const fn=typeof window<"u",Kr=fn?v.useLayoutEffect:v.useEffect,Hr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,c]=zr(o),u=v.useMemo(()=>Yr(e),[e]),f=o&&!l?[]:u.map(Bt),h=v.useRef(!0),m=v.useRef(u),y=cn(()=>new Map),[x,S]=v.useState(u),[b,P]=v.useState(u);Kr(()=>{h.current=!1,m.current=u;for(let g=0;g<b.length;g++){const O=Bt(b[g]);f.includes(O)?y.delete(O):y.get(O)!==!0&&y.set(O,!1)}},[b,f.length,f.join("-")]);const j=[];if(u!==x){let g=[...u];for(let O=0;O<b.length;O++){const Y=b[O],k=Bt(Y);f.includes(k)||(g.splice(O,0,Y),j.push(Y))}return i==="wait"&&j.length&&(g=j),P(Yr(g)),S(u),null}process.env.NODE_ENV!=="production"&&i==="wait"&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:D}=v.useContext(ln);return p.exports.jsx(p.exports.Fragment,{children:b.map(g=>{const O=Bt(g),Y=o&&!l?!1:u===b||f.includes(O),k=()=>{if(y.has(O))y.set(O,!0);else return;let ee=!0;y.forEach(M=>{M||(ee=!1)}),ee&&(D==null||D(),P(m.current),o&&(c==null||c()),r&&r())};return p.exports.jsx(pa,{isPresent:Y,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,onExitComplete:Y?void 0:k,anchorX:a,children:g},O)})})},je=e=>e;let et=je,Fe=je;process.env.NODE_ENV!=="production"&&(et=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Fe=(e,t)=>{if(!e)throw new Error(t)});function dn(e){let t;return()=>(t===void 0&&(t=e()),t)}const tt=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},De=e=>e*1e3,_e=e=>e/1e3,qr={skipAnimations:!1,useManualTiming:!1},$t=["read","resolveKeyframes","update","preRender","render","postRender"],Be={value:null,addProjectionMetrics:null};function ga(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(f){o.has(f)&&(u.schedule(f),e()),l++,f(a)}const u={schedule:(f,h=!1,m=!1)=>{const x=m&&s?n:r;return h&&o.add(f),x.has(f)||x.add(f),f},cancel:f=>{r.delete(f),o.delete(f)},process:f=>{if(a=f,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),t&&Be.value&&Be.value.frameloop[t].push(l),l=0,n.clear(),s=!1,i&&(i=!1,u.process(f))}};return u}const ya=40;function Gr(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=$t.reduce((b,P)=>(b[P]=ga(i,t?P:void 0),b),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:f,postRender:h}=o,m=()=>{const b=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(b-s.timestamp,ya),1),s.timestamp=b,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(m))},y=()=>{n=!0,r=!0,s.isProcessing||e(m)};return{schedule:$t.reduce((b,P)=>{const j=o[P];return b[P]=(D,g=!1,O=!1)=>(n||y(),j.schedule(D,g,O)),b},{}),cancel:b=>{for(let P=0;P<$t.length;P++)o[$t[P]].cancel(b)},state:s,steps:o}}const{schedule:se,cancel:$e,state:be,steps:hn}=Gr(typeof requestAnimationFrame<"u"?requestAnimationFrame:je,!0),Xr=v.createContext({strict:!1}),Zr={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"]},nt={};for(const e in Zr)nt[e]={isEnabled:t=>Zr[e].some(n=>!!t[n])};function va(e){for(const t in e)nt[t]={...nt[t],...e[t]}}const xa=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 Ut(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||xa.has(e)}let Jr=e=>!Ut(e);function ba(e){e&&(Jr=t=>t.startsWith("on")?!Ut(t):e(t))}try{ba(require("@emotion/is-prop-valid").default)}catch{}function wa(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Jr(s)||n===!0&&Ut(s)||!t&&!Ut(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Qr=new Set;function Wt(e,t,n){e||Qr.has(t)||(console.warn(t),n&&console.warn(n),Qr.add(t))}function Ta(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Wt(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const zt=v.createContext({});function Yt(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function vt(e){return typeof e=="string"||Array.isArray(e)}const pn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],mn=["initial",...pn];function Kt(e){return Yt(e.animate)||mn.some(t=>vt(e[t]))}function es(e){return Boolean(Kt(e)||e.variants)}function Sa(e,t){if(Kt(e)){const{initial:n,animate:r}=e;return{initial:n===!1||vt(n)?n:void 0,animate:vt(r)?r:void 0}}return e.inherit!==!1?t:{}}function Ca(e){const{initial:t,animate:n}=Sa(e,v.useContext(zt));return v.useMemo(()=>({initial:t,animate:n}),[ts(t),ts(n)])}function ts(e){return Array.isArray(e)?e.join(" "):e}const Pa=Symbol.for("motionComponentSymbol");function rt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ea(e,t,n){return v.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):rt(n)&&(n.current=r))},[t])}const gn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ns="data-"+gn("framerAppearId"),{schedule:yn,cancel:Ud}=Gr(queueMicrotask,!1),rs=v.createContext({});function ja(e,t,n,r,s){var i,o;const{visualElement:a}=v.useContext(zt),l=v.useContext(Xr),c=v.useContext(Ft),u=v.useContext(un).reducedMotion,f=v.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=f.current,m=v.useContext(rs);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&Aa(f.current,n,s,m);const y=v.useRef(!1);v.useInsertionEffect(()=>{h&&y.current&&h.update(n,c)});const x=n[ns],S=v.useRef(Boolean(x)&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,x))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,x)));return Kr(()=>{h&&(y.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),yn.render(h.render),S.current&&h.animationState&&h.animationState.animateChanges())}),v.useEffect(()=>{h&&(!S.current&&h.animationState&&h.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,x)}),S.current=!1))}),h}function Aa(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:ss(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:Boolean(o)||a&&rt(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function ss(e){if(e)return e.options.allowProjection!==!1?e.projection:ss(e.parent)}function Ma({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,o;e&&va(e);function a(c,u){let f;const h={...v.useContext(un),...c,layoutId:Ra(c)},{isStatic:m}=h,y=Ca(c),x=r(c,m);if(!m&&fn){Va(h,e);const S=Da(h);f=S.MeasureLayout,y.visualElement=ja(s,x,h,t,S.ProjectionNode)}return p.exports.jsxs(zt.Provider,{value:y,children:[f&&y.visualElement?p.exports.jsx(f,{visualElement:y.visualElement,...h}):null,n(s,c,Ea(x,y.visualElement,u),x,m,y.visualElement)]})}a.displayName=`motion.${typeof s=="string"?s:`create(${(o=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&o!==void 0?o:""})`}`;const l=v.forwardRef(a);return l[Pa]=s,l}function Ra({layoutId:e}){const t=v.useContext(ln).id;return t&&e!==void 0?t+"-"+e:e}function Va(e,t){const n=v.useContext(Xr).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?et(!1,r):Fe(!1,r)}}function Da(e){const{drag:t,layout:n}=nt;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const is=e=>t=>typeof t=="string"&&t.startsWith(e),vn=is("--"),Oa=is("var(--"),xn=e=>Oa(e)?La.test(e.split("/*")[0].trim()):!1,La=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,xt={};function ka(e){for(const t in e)xt[t]=e[t],vn(t)&&(xt[t].isCSSVariable=!0)}const st=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],He=new Set(st);function os(e,{layout:t,layoutId:n}){return He.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!xt[e]||e==="opacity")}const Se=e=>Boolean(e&&e.getVelocity),as=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ie=(e,t,n)=>n>t?t:n<e?e:n,it={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},bt={...it,transform:e=>Ie(0,1,e)},Ht={...it,default:1},wt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ue=wt("deg"),Oe=wt("%"),_=wt("px"),_a=wt("vh"),Ia=wt("vw"),ls={...Oe,parse:e=>Oe.parse(e)/100,transform:e=>Oe.transform(e*100)},Na={borderWidth:_,borderTopWidth:_,borderRightWidth:_,borderBottomWidth:_,borderLeftWidth:_,borderRadius:_,radius:_,borderTopLeftRadius:_,borderTopRightRadius:_,borderBottomRightRadius:_,borderBottomLeftRadius:_,width:_,maxWidth:_,height:_,maxHeight:_,top:_,right:_,bottom:_,left:_,padding:_,paddingTop:_,paddingRight:_,paddingBottom:_,paddingLeft:_,margin:_,marginTop:_,marginRight:_,marginBottom:_,marginLeft:_,backgroundPositionX:_,backgroundPositionY:_},Fa={rotate:Ue,rotateX:Ue,rotateY:Ue,rotateZ:Ue,scale:Ht,scaleX:Ht,scaleY:Ht,scaleZ:Ht,skew:Ue,skewX:Ue,skewY:Ue,distance:_,translateX:_,translateY:_,translateZ:_,x:_,y:_,z:_,perspective:_,transformPerspective:_,opacity:bt,originX:ls,originY:ls,originZ:_},cs={...it,transform:Math.round},bn={...Na,...Fa,zIndex:cs,size:_,fillOpacity:bt,strokeOpacity:bt,numOctaves:cs},Ba={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$a=st.length;function Ua(e,t,n){let r="",s=!0;for(let i=0;i<$a;i++){const o=st[i],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=as(a,bn[o]);if(!l){s=!1;const u=Ba[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function wn(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(He.has(l)){o=!0;continue}else if(vn(l)){s[l]=c;continue}else{const u=as(c,bn[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=Ua(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const Tn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function us(e,t,n){for(const r in t)!Se(t[r])&&!os(r,n)&&(e[r]=t[r])}function Wa({transformTemplate:e},t){return v.useMemo(()=>{const n=Tn();return wn(n,t,e),Object.assign({},n.vars,n.style)},[t])}function za(e,t){const n=e.style||{},r={};return us(r,n,e),Object.assign(r,Wa(e,t)),r}function Ya(e,t){const n={},r=za(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Ka=["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 Sn(e){return typeof e!="string"||e.includes("-")?!1:!!(Ka.indexOf(e)>-1||/[A-Z]/u.test(e))}const Ha={offset:"stroke-dashoffset",array:"stroke-dasharray"},qa={offset:"strokeDashoffset",array:"strokeDasharray"};function Ga(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?Ha:qa;e[i.offset]=_.transform(-r);const o=_.transform(t),a=_.transform(n);e[i.array]=`${o} ${a}`}function fs(e,t,n){return typeof e=="string"?e:_.transform(t+n*e)}function Xa(e,t,n){const r=fs(t,e.x,e.width),s=fs(n,e.y,e.height);return`${r} ${s}`}function Cn(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,f){if(wn(e,c,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:y}=e;h.transform&&(y&&(m.transform=h.transform),delete h.transform),y&&(s!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=Xa(y,s!==void 0?s:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Ga(h,o,a,l,!1)}const ds=()=>({...Tn(),attrs:{}}),Pn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Za(e,t,n,r){const s=v.useMemo(()=>{const i=ds();return Cn(i,t,Pn(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};us(i,e.style,e),s.style={...i,...s.style}}return s}function Ja(e=!1){return(n,r,s,{latestValues:i},o)=>{const l=(Sn(n)?Za:Ya)(r,i,o,n),c=wa(r,typeof n=="string",e),u=n!==v.Fragment?{...c,...l,ref:s}:{},{children:f}=r,h=v.useMemo(()=>Se(f)?f.get():f,[f]);return v.createElement(n,{...u,children:h})}}function hs(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function En(e,t,n,r){if(typeof t=="function"){const[s,i]=hs(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=hs(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const jn=e=>Array.isArray(e),Qa=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),el=e=>jn(e)?e[e.length-1]||0:e;function qt(e){const t=Se(e)?e.get():e;return Qa(t)?t.toValue():t}function tl({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const o={latestValues:nl(r,s,i,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const ps=e=>(t,n)=>{const r=v.useContext(zt),s=v.useContext(Ft),i=()=>tl(e,t,r,s);return n?i():cn(i)};function nl(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=qt(i[h]);let{initial:o,animate:a}=e;const l=Kt(e),c=es(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?a:o;if(f&&typeof f!="boolean"&&!Yt(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const y=En(e,h[m]);if(y){const{transitionEnd:x,transition:S,...b}=y;for(const P in b){let j=b[P];if(Array.isArray(j)){const D=u?j.length-1:0;j=j[D]}j!==null&&(s[P]=j)}for(const P in x)s[P]=x[P]}}}return s}function An(e,t,n){var r;const{style:s}=e,i={};for(const o in s)(Se(s[o])||t.style&&Se(t.style[o])||os(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}const rl={useVisualState:ps({scrapeMotionValuesFromProps:An,createRenderState:Tn})};function ms(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function gs(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const ys=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 vs(e,t,n,r){gs(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(ys.has(s)?s:gn(s),t.attrs[s])}function xs(e,t,n){const r=An(e,t,n);for(const s in e)if(Se(e[s])||Se(t[s])){const i=st.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}const bs=["x","y","width","height","cx","cy","r"],sl={useVisualState:ps({scrapeMotionValuesFromProps:xs,createRenderState:ds,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const a in s)if(He.has(a)){i=!0;break}}if(!i)return;let o=!t;if(t)for(let a=0;a<bs.length;a++){const l=bs[a];e[l]!==t[l]&&(o=!0)}o&&se.read(()=>{ms(n,r),se.render(()=>{Cn(r,s,Pn(n.tagName),e.transformTemplate),vs(n,r)})})}})};function il(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...Sn(r)?sl:rl,preloadedFeatures:e,useRender:Ja(s),createVisualElement:t,Component:r};return Ma(o)}}function Tt(e,t,n){const r=e.getProps();return En(r,t,n!==void 0?n:r.custom,e)}const ol=dn(()=>window.ScrollTimeline!==void 0);class al{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(s=>{if(ol()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class ll extends al{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Mn(e,t){return e?e[t]||e.default||e:void 0}const Rn=2e4;function ws(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Rn;)t+=n,r=e.next(t);return t>=Rn?1/0:t}function Vn(e){return typeof e=="function"}function Ts(e,t){e.timeline=t,e.onfinish=null}const Dn=e=>Array.isArray(e)&&typeof e[0]=="number",cl={linearEasing:void 0};function ul(e,t){const n=dn(e);return()=>{var r;return(r=cl[t])!==null&&r!==void 0?r:n()}}const Gt=ul(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ss=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=e(tt(0,s-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function Cs(e){return Boolean(typeof e=="function"&&Gt()||!e||typeof e=="string"&&(e in On||Gt())||Dn(e)||Array.isArray(e)&&e.every(Cs))}const St=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,On={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:St([0,.65,.55,1]),circOut:St([.55,0,1,.45]),backIn:St([.31,.01,.66,-.59]),backOut:St([.33,1.53,.69,.99])};function Ps(e,t){if(e)return typeof e=="function"&&Gt()?Ss(e,t):Dn(e)?St(e):Array.isArray(e)?e.map(n=>Ps(n,t)||On.easeOut):On[e]}const Ve={x:!1,y:!1};function Es(){return Ve.x||Ve.y}function fl(e,t,n){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;t&&(s=t.current);const i=(r=n==null?void 0:n[e])!==null&&r!==void 0?r:s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function js(e,t){const n=fl(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function As(e){return!(e.pointerType==="touch"||Es())}function dl(e,t,n={}){const[r,s,i]=js(e,n),o=a=>{if(!As(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=f=>{As(f)&&(c(f),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,s)};return r.forEach(a=>{a.addEventListener("pointerenter",o,s)}),i}function Xt(e,t){const n=`${t}PointerCapture`;if(e.target instanceof Element&&n in e.target&&e.pointerId!==void 0)try{e.target[n](e.pointerId)}catch{}}const Ms=(e,t)=>t?e===t?!0:Ms(e,t.parentElement):!1,Ln=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,hl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function pl(e){return hl.has(e.tagName)||e.tabIndex!==-1}const Ct=new WeakSet;function Rs(e){return t=>{t.key==="Enter"&&e(t)}}function kn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const ml=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Rs(()=>{if(Ct.has(n))return;kn(n,"down");const s=Rs(()=>{kn(n,"up")}),i=()=>kn(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Vs(e){return Ln(e)&&!Es()}function gl(e,t,n={}){const[r,s,i]=js(e,n),o=a=>{const l=a.currentTarget;if(!l||!Vs(a)||Ct.has(l))return;Ct.add(l),Xt(a,"set");const c=t(l,a),u=(m,y)=>{l.removeEventListener("pointerup",f),l.removeEventListener("pointercancel",h),Xt(m,"release"),!(!Vs(m)||!Ct.has(l))&&(Ct.delete(l),typeof c=="function"&&c(m,{success:y}))},f=m=>{(m.isTrusted?yl(m,l instanceof Element?l.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?u(m,!1):u(m,!(l instanceof Element)||Ms(l,m.target))},h=m=>{u(m,!1)};l.addEventListener("pointerup",f,s),l.addEventListener("pointercancel",h,s),l.addEventListener("lostpointercapture",h,s)};return r.forEach(a=>{a=n.useGlobalTarget?window:a;let l=!1;a instanceof HTMLElement&&(l=!0,!pl(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0)),a.addEventListener("pointerdown",o,s),l&&a.addEventListener("focus",c=>ml(c,s),s)}),i}function yl(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function vl(e){return e==="x"||e==="y"?Ve[e]?null:(Ve[e]=!0,()=>{Ve[e]=!1}):Ve.x||Ve.y?null:(Ve.x=Ve.y=!0,()=>{Ve.x=Ve.y=!1})}const Ds=new Set(["width","height","top","left","right","bottom",...st]);let Zt;function xl(){Zt=void 0}const Le={now:()=>(Zt===void 0&&Le.set(be.isProcessing||qr.useManualTiming?be.timestamp:performance.now()),Zt),set:e=>{Zt=e,queueMicrotask(xl)}};function _n(e,t){e.indexOf(t)===-1&&e.push(t)}function In(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Nn{constructor(){this.subscriptions=[]}add(t){return _n(this.subscriptions,t),()=>In(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Os(e,t){return t?e*(1e3/t):0}const Ls=30,bl=e=>!isNaN(parseFloat(e));class wl{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Le.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Le.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=bl(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Wt(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Nn);const r=this.events[t].add(n);return t==="change"?()=>{r(),se.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Le.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Ls)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ls);return Os(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pt(e,t){return new wl(e,t)}function Tl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pt(n))}function Sl(e,t){const n=Tt(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=el(i[o]);Tl(e,o,a)}}function Cl(e){return Boolean(Se(e)&&e.add)}function Fn(e,t){const n=e.getValue("willChange");if(Cl(n))return n.add(t)}function ks(e){return e.props[ns]}const Pl={current:!1},_s=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,El=1e-7,jl=12;function Al(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=_s(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>El&&++a<jl);return o}function Et(e,t,n,r){if(e===t&&n===r)return je;const s=i=>Al(i,0,1,e,n);return i=>i===0||i===1?i:_s(s(i),t,r)}const Is=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ns=e=>t=>1-e(1-t),Fs=Et(.33,1.53,.69,.99),Bn=Ns(Fs),Bs=Is(Bn),$s=e=>(e*=2)<1?.5*Bn(e):.5*(2-Math.pow(2,-10*(e-1))),$n=e=>1-Math.sin(Math.acos(e)),Us=Ns($n),Ws=Is($n),zs=e=>/^0[^.\s]+$/u.test(e);function Ml(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||zs(e):!0}const jt=e=>Math.round(e*1e5)/1e5,Un=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Rl(e){return e==null}const Vl=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wn=(e,t)=>n=>Boolean(typeof n=="string"&&Vl.test(n)&&n.startsWith(e)||t&&!Rl(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ys=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Un);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Dl=e=>Ie(0,255,e),zn={...it,transform:e=>Math.round(Dl(e))},qe={test:Wn("rgb","red"),parse:Ys("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+zn.transform(e)+", "+zn.transform(t)+", "+zn.transform(n)+", "+jt(bt.transform(r))+")"};function Ol(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Yn={test:Wn("#"),parse:Ol,transform:qe.transform},ot={test:Wn("hsl","hue"),parse:Ys("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Oe.transform(jt(t))+", "+Oe.transform(jt(n))+", "+jt(bt.transform(r))+")"},Ce={test:e=>qe.test(e)||Yn.test(e)||ot.test(e),parse:e=>qe.test(e)?qe.parse(e):ot.test(e)?ot.parse(e):Yn.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?qe.transform(e):ot.transform(e)},Ll=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function kl(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Un))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Ll))===null||n===void 0?void 0:n.length)||0)>0}const Ks="number",Hs="color",_l="var",Il="var(",qs="${}",Nl=/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 At(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(Nl,l=>(Ce.test(l)?(r.color.push(i),s.push(Hs),n.push(Ce.parse(l))):l.startsWith(Il)?(r.var.push(i),s.push(_l),n.push(l)):(r.number.push(i),s.push(Ks),n.push(parseFloat(l))),++i,qs)).split(qs);return{values:n,split:a,indexes:r,types:s}}function Gs(e){return At(e).values}function Xs(e){const{split:t,types:n}=At(e),r=t.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],s[o]!==void 0){const a=n[o];a===Ks?i+=jt(s[o]):a===Hs?i+=Ce.transform(s[o]):i+=s[o]}return i}}const Fl=e=>typeof e=="number"?0:e;function Bl(e){const t=Gs(e);return Xs(e)(t.map(Fl))}const We={test:kl,parse:Gs,createTransformer:Xs,getAnimatableNone:Bl},$l=new Set(["brightness","contrast","saturate","opacity"]);function Ul(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Un)||[];if(!r)return e;const s=n.replace(r,"");let i=$l.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const Wl=/\b([a-z-]*)\(.*?\)/gu,Kn={...We,getAnimatableNone:e=>{const t=e.match(Wl);return t?t.map(Ul).join(" "):e}},zl={...bn,color:Ce,backgroundColor:Ce,outlineColor:Ce,fill:Ce,stroke:Ce,borderColor:Ce,borderTopColor:Ce,borderRightColor:Ce,borderBottomColor:Ce,borderLeftColor:Ce,filter:Kn,WebkitFilter:Kn},Hn=e=>zl[e];function Zs(e,t){let n=Hn(e);return n!==Kn&&(n=We),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Yl=new Set(["auto","none","0"]);function Kl(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!Yl.has(i)&&At(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=Zs(n,s)}const Js=e=>e===it||e===_,Qs=(e,t)=>parseFloat(e.split(", ")[t]),ei=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Qs(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Qs(i[1],e):0}},Hl=new Set(["x","y","z"]),ql=st.filter(e=>!Hl.has(e));function Gl(e){const t=[];return ql.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const at={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:ei(4,13),y:ei(5,14)};at.translateX=at.x,at.translateY=at.y;const Ge=new Set;let qn=!1,Gn=!1;function ti(){if(Gn){const e=Array.from(Ge).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Gl(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))===null||a===void 0||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Gn=!1,qn=!1,Ge.forEach(e=>e.complete()),Ge.clear()}function ni(){Ge.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Gn=!0)})}function Xl(){ni(),ti()}class Xn{constructor(t,n,r,s,i,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ge.add(this),qn||(qn=!0,se.read(ni),se.resolveKeyframes(ti))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const o=s==null?void 0:s.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),s&&o===void 0&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ge.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ge.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ri=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Zl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Jl(e){const t=Zl.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const Ql=4;function si(e,t,n=1){Fe(n<=Ql,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,s]=Jl(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return ri(o)?parseFloat(o):o}return xn(s)?si(s,t,n+1):s}const ii=e=>t=>t.test(e),oi=[it,_,Oe,Ue,Ia,_a,{test:e=>e==="auto",parse:e=>e}],ai=e=>oi.find(ii(e));class li extends Xn{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),xn(c))){const u=si(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Ds.has(r)||t.length!==2)return;const[s,i]=t,o=ai(s),a=ai(i);if(o!==a)if(Js(o)&&Js(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)Ml(t[s])&&r.push(s);r.length&&Kl(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=at[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const i=n.getValue(r);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,a=s[o];s[o]=at[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const ci=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(We.test(e)||e==="0")&&!e.startsWith("url("));function ec(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function tc(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=ci(s,t),a=ci(i,t);return et(o===a,`You are trying to animate ${t} from "${s}" to "${i}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${i} via the \`style\` property.`),!o||!a?!1:ec(e)||(n==="spring"||Vn(n))&&r}const nc=e=>e!==null;function Jt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(nc),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const rc=40;class ui{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Le.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>rc?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Xl(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Le.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!tc(t,r,s,i))if(o)this.options.duration=0;else{l&&l(Jt(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Mt={layout:0,mainThread:0,waapi:0},ie=(e,t,n)=>e+(t-e)*n;function Zn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function sc({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Zn(l,a,e+1/3),i=Zn(l,a,e),o=Zn(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Qt(e,t){return n=>n>0?t:e}const Jn=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},ic=[Yn,qe,ot],oc=e=>ic.find(t=>t.test(e));function fi(e){const t=oc(e);if(et(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===ot&&(n=sc(n)),n}const di=(e,t)=>{const n=fi(e),r=fi(t);if(!n||!r)return Qt(e,t);const s={...n};return i=>(s.red=Jn(n.red,r.red,i),s.green=Jn(n.green,r.green,i),s.blue=Jn(n.blue,r.blue,i),s.alpha=ie(n.alpha,r.alpha,i),qe.transform(s))},ac=(e,t)=>n=>t(e(n)),Rt=(...e)=>e.reduce(ac),Qn=new Set(["none","hidden"]);function lc(e,t){return Qn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function cc(e,t){return n=>ie(e,t,n)}function er(e){return typeof e=="number"?cc:typeof e=="string"?xn(e)?Qt:Ce.test(e)?di:dc:Array.isArray(e)?hi:typeof e=="object"?Ce.test(e)?di:uc:Qt}function hi(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>er(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function uc(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=er(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function fc(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],a=e.indexes[o][s[o]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[i]=l,s[o]++}return r}const dc=(e,t)=>{const n=We.createTransformer(t),r=At(e),s=At(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Qn.has(e)&&!s.values.length||Qn.has(t)&&!r.values.length?lc(e,t):Rt(hi(fc(r,s),s.values),n):(et(!0,`Complex values '${e}' and '${t}' 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.`),Qt(e,t))};function pi(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ie(e,t,n):er(e)(e,t)}const hc=5;function mi(e,t,n){const r=Math.max(t-hc,0);return Os(n-e(r),t-r)}const oe={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},tr=.001;function pc({duration:e=oe.duration,bounce:t=oe.bounce,velocity:n=oe.velocity,mass:r=oe.mass}){let s,i;et(e<=De(oe.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=Ie(oe.minDamping,oe.maxDamping,o),e=Ie(oe.minDuration,oe.maxDuration,_e(e)),o<1?(s=c=>{const u=c*o,f=u*e,h=u-n,m=nr(c,o),y=Math.exp(-f);return tr-h/m*y},i=c=>{const f=c*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(c,2)*e,y=Math.exp(-f),x=nr(Math.pow(c,2),o);return(-s(c)+tr>0?-1:1)*((h-m)*y)/x}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-tr+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=gc(s,i,a);if(e=De(e),isNaN(l))return{stiffness:oe.stiffness,damping:oe.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const mc=12;function gc(e,t,n){let r=n;for(let s=1;s<mc;s++)r=r-e(r)/t(r);return r}function nr(e,t){return e*Math.sqrt(1-t*t)}const yc=["duration","bounce"],vc=["stiffness","damping","mass"];function gi(e,t){return t.some(n=>e[n]!==void 0)}function xc(e){let t={velocity:oe.velocity,stiffness:oe.stiffness,damping:oe.damping,mass:oe.mass,isResolvedFromDuration:!1,...e};if(!gi(e,vc)&&gi(e,yc))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Ie(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:oe.mass,stiffness:s,damping:i}}else{const n=pc(e);t={...t,...n,mass:oe.mass},t.isResolvedFromDuration=!0}return t}function yi(e=oe.visualDuration,t=oe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:m}=xc({...n,velocity:-_e(n.velocity||0)}),y=h||0,x=c/(2*Math.sqrt(l*u)),S=o-i,b=_e(Math.sqrt(l/u)),P=Math.abs(S)<5;r||(r=P?oe.restSpeed.granular:oe.restSpeed.default),s||(s=P?oe.restDelta.granular:oe.restDelta.default);let j;if(x<1){const g=nr(b,x);j=O=>{const Y=Math.exp(-x*b*O);return o-Y*((y+x*b*S)/g*Math.sin(g*O)+S*Math.cos(g*O))}}else if(x===1)j=g=>o-Math.exp(-b*g)*(S+(y+b*S)*g);else{const g=b*Math.sqrt(x*x-1);j=O=>{const Y=Math.exp(-x*b*O),k=Math.min(g*O,300);return o-Y*((y+x*b*S)*Math.sinh(k)+g*S*Math.cosh(k))/g}}const D={calculatedDuration:m&&f||null,next:g=>{const O=j(g);if(m)a.done=g>=f;else{let Y=0;x<1&&(Y=g===0?De(y):mi(j,g,O));const k=Math.abs(Y)<=r,ee=Math.abs(o-O)<=s;a.done=k&&ee}return a.value=a.done?o:O,a},toString:()=>{const g=Math.min(ws(D),Rn),O=Ss(Y=>D.next(g*Y).value,g,30);return g+"ms "+O}};return D}function vi({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},m=k=>a!==void 0&&k<a||l!==void 0&&k>l,y=k=>a===void 0?l:l===void 0||Math.abs(a-k)<Math.abs(l-k)?a:l;let x=n*t;const S=f+x,b=o===void 0?S:o(S);b!==S&&(x=b-f);const P=k=>-x*Math.exp(-k/r),j=k=>b+P(k),D=k=>{const ee=P(k),M=j(k);h.done=Math.abs(ee)<=c,h.value=h.done?b:M};let g,O;const Y=k=>{m(h.value)&&(g=k,O=yi({keyframes:[h.value,y(h.value)],velocity:mi(j,k,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return Y(0),{calculatedDuration:null,next:k=>{let ee=!1;return!O&&g===void 0&&(ee=!0,D(k),Y(k)),g!==void 0&&k>=g?O.next(k-g):(!ee&&D(k),h)}}}const bc=Et(.42,0,1,1),wc=Et(0,0,.58,1),xi=Et(.42,0,.58,1),Tc=e=>Array.isArray(e)&&typeof e[0]!="number",bi={linear:je,easeIn:bc,easeInOut:xi,easeOut:wc,circIn:$n,circInOut:Ws,circOut:Us,backIn:Bn,backInOut:Bs,backOut:Fs,anticipate:$s},wi=e=>{if(Dn(e)){Fe(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,s]=e;return Et(t,n,r,s)}else if(typeof e=="string")return Fe(bi[e]!==void 0,`Invalid easing type '${e}'`),bi[e];return e};function Sc(e,t,n){const r=[],s=n||pi,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||je:t;a=Rt(l,a)}r.push(a)}return r}function Cc(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Fe(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Sc(t,r,s),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=tt(e[f],e[f+1],u);return a[f](h)};return n?u=>c(Ie(e[0],e[i-1],u)):c}function Pc(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=tt(0,t,r);e.push(ie(n,1,s))}}function Ec(e){const t=[0];return Pc(t,e.length-1),t}function jc(e,t){return e.map(n=>n*t)}function Ac(e,t){return e.map(()=>t||xi).splice(0,e.length-1)}function Vt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=Tc(r)?r.map(wi):wi(r),i={done:!1,value:t[0]},o=jc(n&&n.length===t.length?n:Ec(t),e),a=Cc(o,t,{ease:Array.isArray(s)?s:Ac(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const Mc=e=>{const t=({timestamp:n})=>e(n);return{start:()=>se.update(t,!0),stop:()=>$e(t),now:()=>be.isProcessing?be.timestamp:Le.now()}},Rc={decay:vi,inertia:vi,tween:Vt,keyframes:Vt,spring:yi},Vc=e=>e/100;class rr extends ui{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,o=(s==null?void 0:s.KeyframeResolver)||Xn,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(i,a,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=this.options,a=Vn(n)?n:Rc[n]||Vt;let l,c;process.env.NODE_ENV!=="production"&&a!==Vt&&Fe(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),a!==Vt&&typeof t[0]!="number"&&(l=Rt(Vc,pi(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});i==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=ws(u));const{calculatedDuration:f}=u,h=f+s,m=h*(r+1)-s;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;Mt.mainThread++,this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:k}=this.options;return{done:!0,value:k[k.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:m,repeatType:y,repeatDelay:x,onUpdate:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const b=this.currentTime-h*(this.speed>=0?1:-1),P=this.speed>=0?b<0:b>u;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let j=this.currentTime,D=i;if(m){const k=Math.min(this.currentTime,u)/f;let ee=Math.floor(k),M=k%1;!M&&k>=1&&(M=1),M===1&&ee--,ee=Math.min(ee,m+1),Boolean(ee%2)&&(y==="reverse"?(M=1-M,x&&(M-=x/f)):y==="mirror"&&(D=o)),j=Ie(0,1,M)*f}const g=P?{done:!1,value:l[0]}:D.next(j);a&&(g.value=a(g.value));let{done:O}=g;!P&&c!==null&&(O=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const Y=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return Y&&s!==void 0&&(g.value=Jt(l,this.options,s)),S&&S(g.value),Y&&this.finish(),g}get duration(){const{resolved:t}=this;return t?_e(t.calculatedDuration):0}get time(){return _e(this.currentTime)}set time(t){t=De(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=_e(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Mc,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel(),Mt.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Dc=new Set(["opacity","clipPath","filter","transform"]);function Oc(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=Ps(a,s);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const Lc=dn(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),en=10,kc=2e4;function _c(e){return Vn(e.type)||e.type==="spring"||!Cs(e.ease)}function Ic(e,t){const n=new rr({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let i=0;for(;!r.done&&i<kc;)r=n.sample(i),s.push(r.value),i+=en;return{times:void 0,keyframes:s,duration:i-en,ease:"linear"}}const Ti={anticipate:$s,backInOut:Bs,circInOut:Ws};function Nc(e){return e in Ti}class Si extends ui{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:i}=this.options;this.resolver=new li(i,(o,a)=>this.onKeyframesResolved(o,a),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof i=="string"&&Gt()&&Nc(i)&&(i=Ti[i]),_c(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:y,...x}=this.options,S=Ic(t,x);t=S.keyframes,t.length===1&&(t[1]=t[0]),r=S.duration,s=S.times,i=S.ease,o="keyframes"}const u=Oc(a.owner.current,l,t,{...this.options,duration:r,times:s,ease:i});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(Ts(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;a.set(Jt(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:s,type:o,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return _e(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return _e(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=De(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return je;const{animation:r}=n;Ts(r,t)}return je}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:i,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:f,element:h,...m}=this.options,y=new rr({...m,keyframes:r,duration:s,type:i,ease:o,times:a,isGenerator:!0}),x=De(this.time);c.setWithVelocity(y.sample(x-en).value,y.sample(x).value,en)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:s,repeatType:i,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return Lc()&&r&&Dc.has(r)&&!l&&!c&&!s&&i!=="mirror"&&o!==0&&a!=="inertia"}}const Fc={type:"spring",stiffness:500,damping:25,restSpeed:10},Bc=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),$c={type:"keyframes",duration:.8},Uc={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Wc=(e,{keyframes:t})=>t.length>2?$c:He.has(e)?e.startsWith("scale")?Bc(t[1]):Fc:Uc;function zc({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const sr=(e,t,n,r={},s,i)=>o=>{const a=Mn(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-De(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};zc(a)||(u={...u,...Wc(e,u)}),u.duration&&(u.duration=De(u.duration)),u.repeatDelay&&(u.repeatDelay=De(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(f=!0)),(Pl.current||qr.skipAnimations)&&(f=!0,u.duration=0,u.delay=0),f&&!i&&t.get()!==void 0){const h=Jt(u.keyframes,a);if(h!==void 0)return se.update(()=>{u.onUpdate(h),u.onComplete()}),new ll([])}return!i&&Si.supports(u)?new Si(u):new rr(u)};function Yc({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ci(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(o=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const f in l){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),m=l[f];if(m===void 0||u&&Yc(u,f))continue;const y={delay:n,...Mn(o||{},f)};let x=!1;if(window.MotionHandoffAnimation){const b=ks(e);if(b){const P=window.MotionHandoffAnimation(b,f,se);P!==null&&(y.startTime=P,x=!0)}}Fn(e,f),h.start(sr(f,h,m,e.shouldReduceMotion&&Ds.has(f)?{type:!1}:y,e,x));const S=h.animation;S&&c.push(S)}return a&&Promise.all(c).then(()=>{se.update(()=>{a&&Sl(e,a)})}),c}function ir(e,t,n={}){var r;const s=Tt(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(Ci(e,s,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=i;return Kc(e,t,u+c,f,h,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[c,u]=l==="beforeChildren"?[o,a]:[a,o];return c().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function Kc(e,t,n=0,r=0,s=1,i){const o=[],a=(e.variantChildren.size-1)*r,l=s===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(Hc).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(ir(c,t,{...i,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function Hc(e,t){return e.sortNodePosition(t)}function qc(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>ir(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=ir(e,t,n);else{const s=typeof t=="function"?Tt(e,t,n.custom):t;r=Promise.all(Ci(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Pi(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Gc=mn.length;function Ei(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ei(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Gc;n++){const r=mn[n],s=e.props[r];(vt(s)||s===!1)&&(t[r]=s)}return t}const Xc=[...pn].reverse(),Zc=pn.length;function Jc(e){return t=>Promise.all(t.map(({animation:n,options:r})=>qc(e,n,r)))}function Qc(e){let t=Jc(e),n=ji(),r=!0;const s=l=>(c,u)=>{var f;const h=Tt(e,u,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:y,...x}=h;c={...c,...x,...y}}return c};function i(l){t=l(e)}function o(l){const{props:c}=e,u=Ei(e.parent)||{},f=[],h=new Set;let m={},y=1/0;for(let S=0;S<Zc;S++){const b=Xc[S],P=n[b],j=c[b]!==void 0?c[b]:u[b],D=vt(j),g=b===l?P.isActive:null;g===!1&&(y=S);let O=j===u[b]&&j!==c[b]&&D;if(O&&r&&e.manuallyAnimateOnMount&&(O=!1),P.protectedKeys={...m},!P.isActive&&g===null||!j&&!P.prevProp||Yt(j)||typeof j=="boolean")continue;const Y=eu(P.prevProp,j);let k=Y||b===l&&P.isActive&&!O&&D||S>y&&D,ee=!1;const M=Array.isArray(j)?j:[j];let q=M.reduce(s(b),{});g===!1&&(q={});const{prevResolvedValues:ue={}}=P,W={...ue,...q},le=X=>{k=!0,h.has(X)&&(ee=!0,h.delete(X)),P.needsAnimating[X]=!0;const ce=e.getValue(X);ce&&(ce.liveStyle=!1)};for(const X in W){const ce=q[X],ve=ue[X];if(m.hasOwnProperty(X))continue;let w=!1;jn(ce)&&jn(ve)?w=!Pi(ce,ve):w=ce!==ve,w?ce!=null?le(X):h.add(X):ce!==void 0&&h.has(X)?le(X):P.protectedKeys[X]=!0}P.prevProp=j,P.prevResolvedValues=q,P.isActive&&(m={...m,...q}),r&&e.blockInitialAnimation&&(k=!1),k&&(!(O&&Y)||ee)&&f.push(...M.map(X=>({animation:X,options:{type:b}})))}if(h.size){const S={};if(typeof c.initial!="boolean"){const b=Tt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);b&&b.transition&&(S.transition=b.transition)}h.forEach(b=>{const P=e.getBaseTarget(b),j=e.getValue(b);j&&(j.liveStyle=!0),S[b]=P??null}),f.push({animation:S})}let x=Boolean(f.length);return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,x?t(f):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(l,c)}),n[l].isActive=c;const f=o(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=ji(),r=!0}}}function eu(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Pi(t,e):!1}function Xe(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ji(){return{animate:Xe(!0),whileInView:Xe(),whileHover:Xe(),whileTap:Xe(),whileDrag:Xe(),whileFocus:Xe(),exit:Xe()}}class ze{constructor(t){this.isMounted=!1,this.node=t}update(){}}class tu extends ze{constructor(t){super(t),t.animationState||(t.animationState=Qc(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Yt(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let nu=0;class ru extends ze{constructor(){super(...arguments),this.id=nu++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const su={animation:{Feature:tu},exit:{Feature:ru}};function Dt(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Ot(e){return{point:{x:e.pageX,y:e.pageY}}}const iu=e=>t=>Ln(t)&&e(t,Ot(t));function lt(e,t,n,r){return Dt(e,t,iu(n),r)}function Ai({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ou({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function au(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Mi=1e-4,lu=1-Mi,cu=1+Mi,Ri=.01,uu=0-Ri,fu=0+Ri;function Pe(e){return e.max-e.min}function du(e,t,n){return Math.abs(e-t)<=n}function Vi(e,t,n,r=.5){e.origin=r,e.originPoint=ie(t.min,t.max,e.origin),e.scale=Pe(n)/Pe(t),e.translate=ie(n.min,n.max,e.origin)-e.originPoint,(e.scale>=lu&&e.scale<=cu||isNaN(e.scale))&&(e.scale=1),(e.translate>=uu&&e.translate<=fu||isNaN(e.translate))&&(e.translate=0)}function Lt(e,t,n,r){Vi(e.x,t.x,n.x,r?r.originX:void 0),Vi(e.y,t.y,n.y,r?r.originY:void 0)}function Di(e,t,n){e.min=n.min+t.min,e.max=e.min+Pe(t)}function hu(e,t,n){Di(e.x,t.x,n.x),Di(e.y,t.y,n.y)}function Oi(e,t,n){e.min=t.min-n.min,e.max=e.min+Pe(t)}function kt(e,t,n){Oi(e.x,t.x,n.x),Oi(e.y,t.y,n.y)}const Li=()=>({translate:0,scale:1,origin:0,originPoint:0}),ct=()=>({x:Li(),y:Li()}),ki=()=>({min:0,max:0}),fe=()=>({x:ki(),y:ki()});function Ae(e){return[e("x"),e("y")]}function or(e){return e===void 0||e===1}function ar({scale:e,scaleX:t,scaleY:n}){return!or(e)||!or(t)||!or(n)}function Ze(e){return ar(e)||_i(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function _i(e){return Ii(e.x)||Ii(e.y)}function Ii(e){return e&&e!=="0%"}function tn(e,t,n){const r=e-n,s=t*r;return n+s}function Ni(e,t,n,r,s){return s!==void 0&&(e=tn(e,s,r)),tn(e,n,r)+t}function lr(e,t=0,n=1,r,s){e.min=Ni(e.min,t,n,r,s),e.max=Ni(e.max,t,n,r,s)}function Fi(e,{x:t,y:n}){lr(e.x,t.translate,t.scale,t.originPoint),lr(e.y,n.translate,n.scale,n.originPoint)}const Bi=.999999999999,$i=1.0000000000001;function pu(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&ft(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Fi(e,o)),r&&Ze(i.latestValues)&&ft(e,i.latestValues))}t.x<$i&&t.x>Bi&&(t.x=1),t.y<$i&&t.y>Bi&&(t.y=1)}function ut(e,t){e.min=e.min+t,e.max=e.max+t}function Ui(e,t,n,r,s=.5){const i=ie(e.min,e.max,s);lr(e,t,n,i,r)}function ft(e,t){Ui(e.x,t.x,t.scaleX,t.scale,t.originX),Ui(e.y,t.y,t.scaleY,t.scale,t.originY)}function Wi(e,t){return Ai(au(e.getBoundingClientRect(),t))}function mu(e,t,n){const r=Wi(e,n),{scroll:s}=t;return s&&(ut(r.x,s.offset.x),ut(r.y,s.offset.y)),r}const zi=(e,t)=>Math.abs(e-t);function gu(e,t){const n=zi(e.x,t.x),r=zi(e.y,t.y);return Math.sqrt(n**2+r**2)}class Yi{constructor(t,n,{transformPagePoint:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=ur(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=gu(u.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:m}=u,{timestamp:y}=be;this.history.push({...m,timestamp:y});const{onStart:x,onMove:S}=this.handlers;f||(x&&x(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,u)},this.handlePointerMove=(u,f)=>{if(u.target instanceof Element&&u.target.hasPointerCapture&&u.pointerId!==void 0)try{if(!u.target.hasPointerCapture(u.pointerId))return}catch{}this.lastMoveEvent=u,this.lastMoveEventInfo=cr(f,this.transformPagePoint),se.update(this.updatePoint,!0)},this.handlePointerUp=(u,f)=>{Xt(u,"release"),this.end();const{onEnd:h,onSessionEnd:m,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=ur(u.type==="pointercancel"||u.type==="lostpointercapture"?this.lastMoveEventInfo:cr(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,x),m&&m(u,x)},!Ln(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r;const i=Ot(t),o=cr(i,this.transformPagePoint),{point:a}=o,{timestamp:l}=be;this.history=[{...a,timestamp:l}];const{onSessionStart:c}=n;c&&c(t,ur(o,this.history)),Xt(t,"set"),this.removeListeners=Rt(lt(t.currentTarget,"pointermove",this.handlePointerMove),lt(t.currentTarget,"pointerup",this.handlePointerUp),lt(t.currentTarget,"pointercancel",this.handlePointerUp),lt(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),$e(this.updatePoint)}}function cr(e,t){return t?{point:t(e.point)}:e}function Ki(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ur({point:e},t){return{point:e,delta:Ki(e,Hi(t)),offset:Ki(e,yu(t)),velocity:vu(t,.1)}}function yu(e){return e[0]}function Hi(e){return e[e.length-1]}function vu(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=Hi(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>De(t)));)n--;if(!r)return{x:0,y:0};const i=_e(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function xu(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ie(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ie(n,e,r.max):Math.min(e,n)),e}function qi(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function bu(e,{top:t,left:n,bottom:r,right:s}){return{x:qi(e.x,n,s),y:qi(e.y,t,r)}}function Gi(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function wu(e,t){return{x:Gi(e.x,t.x),y:Gi(e.y,t.y)}}function Tu(e,t){let n=.5;const r=Pe(e),s=Pe(t);return s>r?n=tt(t.min,t.max-r,e.min):r>s&&(n=tt(e.min,e.max-s,t.min)),Ie(0,1,n)}function Su(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const fr=.35;function Cu(e=fr){return e===!1?e=0:e===!0&&(e=fr),{x:Xi(e,"left","right"),y:Xi(e,"top","bottom")}}function Xi(e,t,n){return{min:Zi(e,t),max:Zi(e,n)}}function Zi(e,t){return typeof e=="number"?e:e[t]||0}const Pu=new WeakMap;class Eu{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ot(u).point)},i=(u,f)=>{const{drag:h,dragPropagation:m,onDragStart:y}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=vl(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ae(S=>{let b=this.getAxisMotionValue(S).get()||0;if(Oe.test(b)){const{projection:P}=this.visualElement;if(P&&P.layout){const j=P.layout.layoutBox[S];j&&(b=Pe(j)*(parseFloat(b)/100))}}this.originPoint[S]=b}),y&&se.postRender(()=>y(u,f)),Fn(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},o=(u,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:y,onDrag:x}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:S}=f;if(m&&this.currentDirection===null){this.currentDirection=ju(S),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",f.point,S),this.updateAxis("y",f.point,S),this.visualElement.render(),x&&x(u,f)},a=(u,f)=>this.stop(u,f),l=()=>Ae(u=>{var f;return this.getAnimationState(u)==="paused"&&((f=this.getAxisMotionValue(u).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Yi(t,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&se.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!nn(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=xu(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&rt(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=bu(s.layoutBox,n):this.constraints=!1,this.elastic=Cu(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Ae(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Su(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!rt(t))return!1;const r=t.current;Fe(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=mu(r,s.root,this.visualElement.getTransformPagePoint());let o=wu(s.layout.layoutBox,i);if(n){const a=n(ou(o));this.hasMutatedConstraints=!!a,a&&(o=Ai(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Ae(u=>{if(!nn(u,n,this.currentDirection))return;let f=l&&l[u]||{};o&&(f={min:0,max:0});const h=s?200:1e6,m=s?40:1e7,y={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,y)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Fn(this.visualElement,t),r.start(sr(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ae(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ae(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ae(n=>{const{drag:r}=this.getProps();if(!nn(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];i.set(t[n]-ie(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!rt(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ae(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=Tu({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ae(o=>{if(!nn(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ie(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;Pu.set(this.visualElement,this);const t=this.visualElement.current,n=lt(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();rt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),se.read(r);const o=Dt(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Ae(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=fr,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function nn(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ju(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Au extends ze{constructor(t){super(t),this.removeGroupControls=je,this.removeListeners=je,this.controls=new Eu(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||je}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ji=e=>(t,n)=>{e&&se.postRender(()=>e(t,n))};class Mu extends ze{constructor(){super(...arguments),this.removePointerDownListener=je}onPointerDown(t){this.session=new Yi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Ji(t),onStart:Ji(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&se.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=lt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const rn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Qi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const _t={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_.test(e))e=parseFloat(e);else return e;const n=Qi(e,t.target.x),r=Qi(e,t.target.y);return`${n}% ${r}%`}},Ru={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=We.parse(e);if(s.length>5)return r;const i=We.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=ie(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}};class Vu extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;ka(Du),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),rn.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||se.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),yn.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function eo(e){const[t,n]=zr(),r=v.useContext(ln);return p.exports.jsx(Vu,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(rs),isPresent:t,safeToRemove:n})}const Du={borderRadius:{..._t,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:_t,borderTopRightRadius:_t,borderBottomLeftRadius:_t,borderBottomRightRadius:_t,boxShadow:Ru};function Ou(e,t,n){const r=Se(e)?e:Pt(e);return r.start(sr("",r,t,n)),r.animation}function Lu(e){return e instanceof SVGElement&&e.tagName!=="svg"}const ku=(e,t)=>e.depth-t.depth;class _u{constructor(){this.children=[],this.isDirty=!1}add(t){_n(this.children,t),this.isDirty=!0}remove(t){In(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ku),this.isDirty=!1,this.children.forEach(t)}}function Iu(e,t){const n=Le.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&($e(r),e(i-t))};return se.read(r,!0),()=>$e(r)}const to=["TopLeft","TopRight","BottomLeft","BottomRight"],Nu=to.length,no=e=>typeof e=="string"?parseFloat(e):e,ro=e=>typeof e=="number"||_.test(e);function Fu(e,t,n,r,s,i){s?(e.opacity=ie(0,n.opacity!==void 0?n.opacity:1,Bu(r)),e.opacityExit=ie(t.opacity!==void 0?t.opacity:1,0,$u(r))):i&&(e.opacity=ie(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Nu;o++){const a=`border${to[o]}Radius`;let l=so(t,a),c=so(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||ro(l)===ro(c)?(e[a]=Math.max(ie(no(l),no(c),r),0),(Oe.test(c)||Oe.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=ie(t.rotate||0,n.rotate||0,r))}function so(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Bu=io(0,.5,Us),$u=io(.5,.95,je);function io(e,t,n){return r=>r<e?0:r>t?1:n(tt(e,t,r))}function oo(e,t){e.min=t.min,e.max=t.max}function Me(e,t){oo(e.x,t.x),oo(e.y,t.y)}function ao(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function lo(e,t,n,r,s){return e-=t,e=tn(e,1/n,r),s!==void 0&&(e=tn(e,1/s,r)),e}function Uu(e,t=0,n=1,r=.5,s,i=e,o=e){if(Oe.test(t)&&(t=parseFloat(t),t=ie(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=ie(i.min,i.max,r);e===i&&(a-=t),e.min=lo(e.min,t,n,a,s),e.max=lo(e.max,t,n,a,s)}function co(e,t,[n,r,s],i,o){Uu(e,t[n],t[r],t[s],t.scale,i,o)}const Wu=["x","scaleX","originX"],zu=["y","scaleY","originY"];function uo(e,t,n,r){co(e.x,t,Wu,n?n.x:void 0,r?r.x:void 0),co(e.y,t,zu,n?n.y:void 0,r?r.y:void 0)}function fo(e){return e.translate===0&&e.scale===1}function ho(e){return fo(e.x)&&fo(e.y)}function po(e,t){return e.min===t.min&&e.max===t.max}function Yu(e,t){return po(e.x,t.x)&&po(e.y,t.y)}function mo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function go(e,t){return mo(e.x,t.x)&&mo(e.y,t.y)}function yo(e){return Pe(e.x)/Pe(e.y)}function vo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Ku{constructor(){this.members=[]}add(t){_n(this.members,t),t.scheduleRender()}remove(t){if(In(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Hu(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:h,skewX:m,skewY:y}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Je={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},dr=["","X","Y","Z"],qu={visibility:"hidden"},xo=1e3;let Gu=0;function hr(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function bo(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=ks(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",se,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&bo(r)}function wo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Gu++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Be.value&&(Je.nodes=Je.calculatedTargetDeltas=Je.calculatedProjections=0),this.nodes.forEach(Ju),this.nodes.forEach(rf),this.nodes.forEach(sf),this.nodes.forEach(Qu),Be.addProjectionMetrics&&Be.addProjectionMetrics(Je)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,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 l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new _u)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Nn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Lu(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Iu(h,250),rn.hasAnimatedSinceResize&&(rn.hasAnimatedSinceResize=!1,this.nodes.forEach(So))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||u.getDefaultTransition()||uf,{onLayoutAnimationStart:S,onLayoutAnimationComplete:b}=u.getProps(),P=!this.targetLayout||!go(this.targetLayout,y),j=!h&&m;if(this.options.layoutRoot||this.resumeFrom||j||h&&(P||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,j);const D={...Mn(x,"layout"),onPlay:S,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D)}else h||So(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,$e(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(of),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&bo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(To);return}this.isUpdating||this.nodes.forEach(tf),this.isUpdating=!1,this.nodes.forEach(nf),this.nodes.forEach(Xu),this.nodes.forEach(Zu),this.clearAllSnapshots();const a=Le.now();be.delta=Ie(0,1e3/60,a-be.timestamp),be.timestamp=a,be.isProcessing=!0,hn.update.process(be),hn.preRender.process(be),hn.render.process(be),be.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,yn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ef),this.sharedNodes.forEach(af)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,se.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){se.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Pe(this.snapshot.measuredBox.x)&&!Pe(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=fe(),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,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!ho(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(a||Ze(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),ff(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return fe();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(df))){const{scroll:u}=this.root;u&&(ut(l.x,u.offset.x),ut(l.y,u.offset.y))}return l}removeElementScroll(o){var a;const l=fe();if(Me(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Me(l,o),ut(l.x,f.offset.x),ut(l.y,f.offset.y))}return l}applyTransform(o,a=!1){const l=fe();Me(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ft(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ze(u.latestValues)&&ft(l,u.latestValues)}return Ze(this.latestValues)&&ft(l,this.latestValues),l}removeTransform(o){const a=fe();Me(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Ze(c.latestValues))continue;ar(c.latestValues)&&c.updateSnapshot();const u=fe(),f=c.measurePageBox();Me(u,f),uo(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Ze(this.latestValues)&&uo(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.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!==be.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=Boolean(this.resumingFrom)||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=be.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fe(),this.relativeTargetOrigin=fe(),kt(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),Me(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=fe(),this.targetWithTransforms=fe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),hu(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Me(this.target,this.layout.layoutBox),Fi(this.target,this.targetDelta)):Me(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&Boolean(m.resumingFrom)===Boolean(this.resumingFrom)&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fe(),this.relativeTargetOrigin=fe(),kt(this.relativeTargetOrigin,this.target,m.target),Me(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Be.value&&Je.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||ar(this.parent.latestValues)||_i(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=Boolean(this.resumingFrom)||this!==a;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===be.timestamp&&(c=!1),c)return;const{layout:u,layoutId:f}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||f))return;Me(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;pu(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=fe());const{target:y}=a;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ao(this.prevProjectionDelta.x,this.projectionDelta.x),ao(this.prevProjectionDelta.y,this.projectionDelta.y)),Lt(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!vo(this.projectionDelta.x,this.prevProjectionDelta.x)||!vo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y)),Be.value&&Je.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ct(),this.projectionDelta=ct(),this.projectionDeltaWithTransform=ct()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=ct();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=fe(),m=l?l.source:void 0,y=this.layout?this.layout.source:void 0,x=m!==y,S=this.getStack(),b=!S||S.members.length<=1,P=Boolean(x&&!b&&this.options.crossfade===!0&&!this.path.some(cf));this.animationProgress=0;let j;this.mixTargetDelta=D=>{const g=D/1e3;Co(f.x,o.x,g),Co(f.y,o.y,g),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(kt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),lf(this.relativeTarget,this.relativeTargetOrigin,h,g),j&&Yu(this.relativeTarget,j)&&(this.isProjectionDirty=!1),j||(j=fe()),Me(j,this.relativeTarget)),x&&(this.animationValues=u,Fu(u,c,this.latestValues,g,P,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=g},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&($e(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=se.update(()=>{rn.hasAnimatedSinceResize=!0,Mt.layout++,this.currentAnimation=Ou(0,xo,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{Mt.layout--},onComplete:()=>{Mt.layout--,o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(xo),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&Mo(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||fe();const f=Pe(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=Pe(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Me(a,l),ft(a,u),Lt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Ku),this.sharedNodes.get(o).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 o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&hr("z",o,c,this.animationValues);for(let u=0;u<dr.length;u++)hr(`rotate${dr[u]}`,o,c,this.animationValues),hr(`skew${dr[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return qu;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=qt(o==null?void 0:o.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const x={};return this.options.layoutId&&(x.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,x.pointerEvents=qt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Ze(this.latestValues)&&(x.transform=u?u({},""):"none",this.hasProjected=!1),x}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=Hu(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:m,y}=this.projectionDelta;c.transformOrigin=`${m.origin*100}% ${y.origin*100}% 0`,f.animationValues?c.opacity=f===this?(l=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:c.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const x in xt){if(h[x]===void 0)continue;const{correct:S,applyTo:b,isCSSVariable:P}=xt[x],j=c.transform==="none"?h[x]:S(h[x],f);if(b){const D=b.length;for(let g=0;g<D;g++)c[b[g]]=j}else P?this.options.visualElement.renderState.vars[x]=j:c[x]=j}return this.options.layoutId&&(c.pointerEvents=f===this?qt(o==null?void 0:o.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(To),this.root.sharedNodes.clear()}}}function Xu(e){e.updateLayout()}function Zu(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=n.source!==e.layout.source;i==="size"?Ae(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Pe(h);h.min=r[f].min,h.max=h.min+m}):Mo(i,n.layoutBox,r)&&Ae(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Pe(r[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const a=ct();Lt(a,r,n.layoutBox);const l=ct();o?Lt(l,e.applyTransform(s,!0),n.measuredBox):Lt(l,r,n.layoutBox);const c=!ho(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const y=fe();kt(y,n.layoutBox,h.layoutBox);const x=fe();kt(x,r,m.layoutBox),go(y,x)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=y,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Ju(e){Be.value&&Je.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Qu(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ef(e){e.clearSnapshot()}function To(e){e.clearMeasurements()}function tf(e){e.isLayoutDirty=!1}function nf(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function So(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rf(e){e.resolveTargetDelta()}function sf(e){e.calcProjection()}function of(e){e.resetSkewAndRotation()}function af(e){e.removeLeadSnapshot()}function Co(e,t,n){e.translate=ie(t.translate,0,n),e.scale=ie(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Po(e,t,n,r){e.min=ie(t.min,n.min,r),e.max=ie(t.max,n.max,r)}function lf(e,t,n,r){Po(e.x,t.x,n.x,r),Po(e.y,t.y,n.y,r)}function cf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const uf={duration:.45,ease:[.4,0,.1,1]},Eo=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),jo=Eo("applewebkit/")&&!Eo("chrome/")?Math.round:je;function Ao(e){e.min=jo(e.min),e.max=jo(e.max)}function ff(e){Ao(e.x),Ao(e.y)}function Mo(e,t,n){return e==="position"||e==="preserve-aspect"&&!du(yo(t),yo(n),.2)}function df(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const hf=wo({attachResizeListener:(e,t)=>Dt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pr={current:void 0},Ro=wo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!pr.current){const e=new hf({});e.mount(window),e.setOptions({layoutScroll:!0}),pr.current=e}return pr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),pf={pan:{Feature:Mu},drag:{Feature:Au,ProjectionNode:Ro,MeasureLayout:eo}};function Vo(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&se.postRender(()=>i(t,Ot(t)))}class mf extends ze{mount(){const{current:t}=this.node;t&&(this.unmount=dl(t,(n,r)=>(Vo(this.node,r,"Start"),s=>Vo(this.node,s,"End"))))}unmount(){}}class gf extends ze{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Rt(Dt(this.node.current,"focus",()=>this.onFocus()),Dt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Do(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&se.postRender(()=>i(t,Ot(t)))}class yf extends ze{mount(){const{current:t}=this.node;t&&(this.unmount=gl(t,(n,r)=>(Do(this.node,r,"Start"),(s,{success:i})=>Do(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const mr=new WeakMap,gr=new WeakMap,vf=e=>{const t=mr.get(e.target);t&&t(e)},xf=e=>{e.forEach(vf)};function bf({root:e,...t}){const n=e||document;gr.has(n)||gr.set(n,{});const r=gr.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(xf,{root:e,...t})),r[s]}function wf(e,t,n){const r=bf(t);return mr.set(e,n),r.observe(e),()=>{mr.delete(e),r.unobserve(e)}}const Tf={some:0,all:1};class Sf extends ze{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Tf[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),h=c?u:f;h&&h(l)};return wf(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Cf(t,n))&&this.startObserver()}unmount(){}}function Cf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Pf={inView:{Feature:Sf},tap:{Feature:yf},focus:{Feature:gf},hover:{Feature:mf}},Ef={layout:{ProjectionNode:Ro,MeasureLayout:eo}},yr={current:null},Oo={current:!1};function jf(){if(Oo.current=!0,!!fn)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>yr.current=e.matches;e.addListener(t),t()}else yr.current=!1}const Af=[...oi,Ce,We],Mf=e=>Af.find(ii(e)),Rf=new WeakMap;function Vf(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Se(s))e.addValue(r,s),process.env.NODE_ENV==="development"&&Wt(s.version==="12.4.7",`Attempting to mix Motion versions ${s.version} with 12.4.7 may not work as expected.`);else if(Se(i))e.addValue(r,Pt(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,Pt(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Lo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Df{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Xn,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 m=Le.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,se.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=Kt(n),this.isVariantNode=es(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const y=h[m];l[m]!==void 0&&Se(y)&&y.set(l[m],!1)}}mount(t){this.current=t,Rf.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Oo.current||jf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:yr.current,process.env.NODE_ENV!=="production"&&Wt(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),$e(this.notifyUpdate),$e(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=He.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&se.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in nt){const n=nt[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Lo.length;r++){const s=Lo[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=Vf(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Pt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(ri(s)||zs(s))?s=parseFloat(s):!Mf(s)&&We.test(n)&&(s=Zs(t,n)),this.setBaseTarget(t,Se(s)?s.get():s)),Se(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=En(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[t])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Se(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Nn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class ko extends Df{constructor(){super(...arguments),this.KeyframeResolver=li}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Se(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Of(e){return window.getComputedStyle(e)}class Lf extends ko{constructor(){super(...arguments),this.type="html",this.renderInstance=gs}readValueFromInstance(t,n){if(He.has(n)){const r=Hn(n);return r&&r.default||0}else{const r=Of(t),s=(vn(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Wi(t,n)}build(t,n,r){wn(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return An(t,n,r)}}class kf extends ko{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=fe,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&ms(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(He.has(n)){const r=Hn(n);return r&&r.default||0}return n=ys.has(n)?n:gn(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return xs(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&se.postRender(this.updateDimensions)}build(t,n,r){Cn(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){vs(t,n,r,s)}mount(t){this.isSVGTag=Pn(t.tagName),super.mount(t)}}const _f=(e,t)=>Sn(e)?new kf(t):new Lf(t,{allowProjection:e!==v.Fragment}),If=il({...su,...Pf,...pf,...Ef},_f),vr=Ta(If),Nf=({isOpen:e,onClose:t,onConfirm:n,header:r,question:s})=>e?p.exports.jsx("div",{id:"default-modal",tabIndex:-1,"aria-hidden":"true",className:"absolute z-10 w-full md:inset-0 h-full max-h-full overflow-y-auto overflow-x-hidden flex justify-center items-center bg-[rgb(0,0,0,0.6)]",children:p.exports.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:p.exports.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[p.exports.jsxs("div",{className:"flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600 border-gray-200",children:[p.exports.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[r," "]}),p.exports.jsxs("button",{type:"button",className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 inline-flex justify-center items-center",onClick:t,children:[p.exports.jsx("svg",{className:"w-3 h-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 14 14",children:p.exports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),p.exports.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),p.exports.jsx("div",{className:"p-4 md:p-5 space-y-4",children:p.exports.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[s," "]})}),p.exports.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[p.exports.jsx("button",{onClick:()=>{n(),t()},type:"button",className:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",children:"Yes "}),p.exports.jsx("button",{onClick:t,type:"button",className:"py-2.5 px-5 ml-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700",children:"Cancel"})]})]})})}):null,Ff=({items:e,isVisible:t,position:n,messageId:r,isCurrentUserMessage:s})=>{const i=v.useRef(null),[o,a]=v.useState(!1);return v.useEffect(()=>(i.current||(i.current=document.createElement("div"),i.current.style.zIndex="1500",i.current.style.position="fixed",i.current.style.top="0",i.current.style.left="0",i.current.style.width="100%",i.current.style.height="100%",i.current.style.pointerEvents="none",document.body.appendChild(i.current)),a(!0),()=>{i.current&&!t&&(document.body.removeChild(i.current),i.current=null)}),[t]),!i.current||!o?null:Ke.createPortal(p.exports.jsx(Hr,{children:t&&p.exports.jsx(vr.div,{initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:-10},transition:{duration:.2,ease:"easeOut"},className:"absolute z-50 bg-white shadow-lg rounded-md p-2 px-1 w-42 pointer-events-auto",style:{top:n.y,left:n.x},children:e.map((l,c)=>l!=null&&l.onlyCurrentUserMessage&&!s?null:p.exports.jsxs("button",{disabled:l==null?void 0:l.disabled,className:"cursor-pointer flex items-center gap-2 w-full rounded-md text-left px-2 py-1 disabled:opacity-20 hover:bg-gray-200",onClick:()=>l.onClick(r),children:[v.cloneElement(l.icon,{className:"text-black",size:18}),p.exports.jsx("span",{className:"ml-2 text-black",children:l.name})]},c))})}),i.current)},Bf=e=>{const t=Math.floor(e/60),n=e%60;return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},_o=e=>{const t=document.createElement("div");return t.innerHTML=e,t.querySelectorAll("span").forEach(n=>{const r=(n==null?void 0:n.textContent)&&"".replace(/\u00A0/g," ").trim().replace(/\s+/g,"-");r&&n.replaceWith(r)}),t.innerHTML.replace(/&nbsp;/g," ")},$f=()=>p.exports.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M9.77169 2.74358C12.1132 0.399998 15.9121 0.399998 18.2553 2.74314C20.5384 5.02621 20.5969 8.69142 18.4309 11.0454L18.2428 11.2427L9.44273 20.0409L9.40616 20.0712C7.94492 21.3879 5.69092 21.3432 4.28355 19.9358C2.96453 18.6168 2.84241 16.5541 3.9172 15.0974C3.94054 15.0521 3.96879 15.0083 4.002 14.9672L4.05556 14.9075L4.14247 14.8198L4.28355 14.6719L4.28647 14.6748L11.7222 7.22047C11.9881 6.95385 12.4047 6.92909 12.6986 7.14656L12.7829 7.21906C13.0495 7.48497 13.0742 7.9016 12.8568 8.19551L12.7843 8.27972L5.18966 15.8928C4.47202 16.7684 4.5219 18.0627 5.3393 18.8801C6.16836 19.7091 7.48801 19.7486 8.3638 18.9985L17.1965 10.1681C18.952 8.41041 18.952 5.56116 17.1946 3.8038C15.4922 2.10136 12.765 2.04816 10.9986 3.6442L10.8307 3.8038L10.8181 3.81812L1.28179 13.3544C0.988902 13.6473 0.514028 13.6473 0.221135 13.3544C-0.0451319 13.0882 -0.0693378 12.6715 0.148517 12.3779L0.221135 12.2938L9.77001 2.74314L9.77169 2.74358Z",fill:"#8A8A8A"})}),Uf=()=>p.exports.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M13.25 9C13.6297 9 13.9435 9.28215 13.9932 9.64823L14 9.75V10.25C14 13.8094 11.245 16.7254 7.75098 16.9817L7.75 19.25C7.75 19.6642 7.41421 20 7 20C6.6203 20 6.30651 19.7178 6.25685 19.3518L6.25 19.25L6.25002 16.9818C2.83323 16.7316 0.122835 13.938 0.00406027 10.4863L0 10.25V9.75C0 9.33579 0.335786 9 0.75 9C1.1297 9 1.44349 9.28215 1.49315 9.64823L1.5 9.75V10.25C1.5 13.077 3.73445 15.3821 6.5336 15.4956L6.75 15.5H7.25C10.077 15.5 12.3821 13.2656 12.4956 10.4664L12.5 10.25V9.75C12.5 9.33579 12.8358 9 13.25 9ZM7 0C9.20914 0 11 1.79086 11 4V10C11 12.2091 9.20914 14 7 14C4.79086 14 3 12.2091 3 10V4C3 1.79086 4.79086 0 7 0ZM7 1.5C5.61929 1.5 4.5 2.61929 4.5 4V10C4.5 11.3807 5.61929 12.5 7 12.5C8.38071 12.5 9.5 11.3807 9.5 10V4C9.5 2.61929 8.38071 1.5 7 1.5Z",fill:"#fff"})}),xr=()=>p.exports.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M10.8147 10.1974L3.28344 11.4526C3.10705 11.482 2.95979 11.6034 2.89723 11.7709L0.299335 18.7283C0.0506615 19.3678 0.720085 19.9778 1.33375 19.671L19.3337 10.671C19.8865 10.3946 19.8865 9.60573 19.3337 9.32933L1.33375 0.329334C0.720085 0.0225017 0.0506615 0.632543 0.299335 1.27199L2.89723 8.22938C2.95979 8.39691 3.10705 8.51827 3.28344 8.54767L10.8147 9.80287C10.9236 9.82103 10.9972 9.92408 10.9791 10.033C10.965 10.1173 10.899 10.1834 10.8147 10.1974Z",fill:"#fff"})}),sn=e=>p.exports.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...e,children:p.exports.jsxs("g",{fill:"none",children:[p.exports.jsx("path",{className:"background",fill:"#ffffff",d:"M8,1 L9,1 L9,20 L8,20 L8,18 C7.807,15.161 7.124,12.233 5.950,9.218 C5.046,6.893 3.504,4.733 1.325,2.738 L1.325,2.738 C0.917,2.365 0.89,1.732 1.263,1.325 C1.452,1.118 1.72,1 2,1 L8,1 Z"}),p.exports.jsx("path",{className:"fill-gray-200",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0 L9,0 L9,20 L7,20 L7,20 L7.002,18.068 C6.816,15.333 6.156,12.504 5.018,9.58 C4.172,7.406 2.72,5.371 0.649,3.475 C-0.165,2.729 -0.221,1.464 0.525,0.649 C0.904,0.236 1.439,0 2,0 Z"}),p.exports.jsx("path",{className:"border_2x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.5 L9,0.5 L9,20 L7.5,20 L7.5,20 L7.501,18.034 C7.312,15.247 6.64,12.369 5.484,9.399 C4.609,7.15 3.112,5.052 0.987,3.106 C0.376,2.547 0.334,1.598 0.894,0.987 C1.178,0.677 1.579,0.5 2,0.5 Z"}),p.exports.jsx("path",{className:"border_3x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.667 L9,0.667 L9,20 L7.667,20 L7.667,20 L7.668,18.023 C7.477,15.218 6.802,12.324 5.64,9.338 C4.755,7.064 3.243,4.946 1.1,2.983 C0.557,2.486 0.52,1.643 1.017,1.1 C1.269,0.824 1.626,0.667 2,0.667 Z"})]})}),Wf=({onSendMessage:e,onEditMessage:t,onSendVoice:n,onImageSend:r,onVideoSend:s,onFileSend:i,dynamicSymbolAssignments:o,onDynamicSymbolListSet:a,onDynamicSymbolListDelete:l,messageToEdit:c,setMessageToEdit:u})=>{const[f,h]=v.useState(""),[m,y]=v.useState(!1),[x,S]=v.useState(0),[b,P]=v.useState(null),[j,D]=v.useState(null),[g,O]=v.useState(0),Y=v.useRef(null),k=v.useRef([]),ee=v.useRef(null),M=v.useRef(null),q=v.useRef(null),[ue,W]=v.useState(!1),[le,ye]=v.useState([]),me=150,X=41.6;v.useEffect(()=>{const A=document.getElementById("static-display");A&&!A.textContent&&(c!=null&&c.text)&&(A.textContent=c==null?void 0:c.text)},[c==null?void 0:c.text]);const ce=A=>{c?u(L=>L?new yt({...L,text:A,isEdited:!0}):void 0):h(A);const V=A.match(/(\S+)$/);if(B(V),le.length>0){const L=Array.from(A.matchAll(/<span[^>]*id=["']([^"']+)["'][^>]*>/g)).map(E=>E[1]);ye(E=>(E.filter(te=>!L.includes(te)).forEach(te=>{const xe=te.charAt(0),we=te.slice(1);l==null||l(we,xe)}),L))}if(M.current){const L=M.current.scrollHeight;Math.ceil(M.current.scrollHeight/L)-1,L>X?L>me?(M.current.style.height=`${me}px`,M.current.style.overflowY="auto"):(M.current.style.height=`${L}px`,M.current.style.overflowY="hidden"):(M.current.style.height=`${X}px`,M.current.style.overflowY="hidden")}},ve=()=>{if(c){const A=_o(c.text);if(A.trim()==="")return;t({...c,text:A}),u(void 0)}else{const A=_o(f);if(A.trim()==="")return;e(A),h("")}P(null),D(null),M.current&&(M.current.style.height=`${X}px`,M.current.innerHTML="")},w=async()=>{y(!0),S(0),k.current=[],ee.current=setInterval(()=>{S(L=>L+1)},1e3);const A=await navigator.mediaDevices.getUserMedia({audio:!0}),V=new MediaRecorder(A);Y.current=V,V.ondataavailable=L=>{L.data.size>0&&k.current.push(L.data)},V.onstop=()=>{clearInterval(ee.current);const L=new Blob(k.current,{type:"audio/mp3"}),E=new File([L],"recording.mp3",{type:"audio/mp3"});n(E),y(!1)},V.start()},T=()=>{var A;(A=Y.current)==null||A.stop()},B=A=>{if(A){const V=A[0];if(b){const L=A[0].split(b)[1];D(L)}o!=null&&o.some(L=>L.symbol===V)&&P(V)}else P(null),D(null)},$=(A,V,L)=>{var Qe;if(!M.current)return;ye(Ye=>[...Ye,`${L+A}`]);let E=((Qe=M.current)==null?void 0:Qe.innerHTML)||"";const ne=E.match(/(\S+)$/);if(ne){const Ye=ne[0];E=E.slice(0,-Ye.length)}const te=`<span id="${L+A}" contentEditable="false" class="inline-flex items-center gap-1 px-2 pb-1 text-sm font-medium text-white bg-blue-500 rounded-full pointer-events-none select-none truncate max-w-[250px]">${L+V}</span>&nbsp;`;M.current.innerHTML=E+te;const xe=document.createTextNode("");M.current.appendChild(xe);const we=window.getSelection(),dt=document.createRange();dt.setStart(xe,0),dt.collapse(!0),we==null||we.removeAllRanges(),we==null||we.addRange(dt);const on=M.current.innerHTML;ce(on),a&&a(V,A,L),P(null),D(null),setTimeout(()=>{var Ye;(Ye=M.current)==null||Ye.focus()},0)},I=A=>{const{scrollTop:V,scrollHeight:L,clientHeight:E}=A.currentTarget;if(V>g){if(V+E>=L-1){const te=o==null?void 0:o.find(xe=>xe.symbol===b);te&&(te!=null&&te.updatePageNumber)&&(W(!0),te==null||te.updatePageNumber(te.pagNumber+1),O(V),setTimeout(()=>{W(!1)},500))}}else O(V)},K=new Set(["jpeg","png","gif","webp","bmp","svg+xml","tiff","x-icon"]),N=new Set(["mp4","webm","ogg","mpeg","quicktime","x-msvideo","x-ms-wmv","3gpp","3gpp2"]),U=()=>{var A;(A=q.current)==null||A.click()},z=A=>{var E,ne;const V=(E=A.target.files)==null?void 0:E[0];if(!V)return;let L="";if(V.type){const te=V.type.split("/");te.length===2&&(L=te[1])}L||(L=((ne=V.name.split(".").pop())==null?void 0:ne.toLowerCase())||""),K.has(L)?r(V):N.has(L)?s(V):i(V)};return p.exports.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[m?p.exports.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[p.exports.jsx("span",{className:"text-blue-400 font-bold flex-1",children:Bf(x)}),p.exports.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:T,children:p.exports.jsx(xr,{})})]}):c?p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] relative h-10",children:[p.exports.jsxs("div",{className:" h-12 absolute bottom-10 w-full flex justify-between items-center px-2 border-t border-x border-gray-300 bg-white rounded-t-lg ",children:[p.exports.jsx("span",{id:"static-display",className:"text-gray-400 whitespace-nowrap truncate"}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700 -mt-4",onClick:()=>u(void 0),children:"✕"})]}),p.exports.jsx("textarea",{className:"w-full resize-none h-[41.6px] absolute bottom-0 bg-white flex-1 p-2 pl-4 border border-gray-300 outline-none rounded-bl-3xl ",placeholder:"Type a message...",value:c.text,onChange:A=>ce(A.target.value),onKeyDown:A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),ve())}}),p.exports.jsx(sn,{className:"rotate-180 absolute -right-[11.4px] top-[18.4px]"})]}),p.exports.jsx("button",{className:"flex items-center justify-center cursor-pointer w-9 h-9 ml-2 p-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 transition",onClick:ve,children:p.exports.jsx(xr,{})})]}):p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] h-10 relative ",children:[p.exports.jsx("div",{onClick:U,className:"cursor-pointer z-10 absolute right-4 top-[11px]",children:p.exports.jsx($f,{})}),p.exports.jsx("input",{type:"file",ref:q,style:{display:"none"},onChange:z}),p.exports.jsx("div",{ref:M,contentEditable:!0,suppressContentEditableWarning:!0,className:"w-full absolute bottom-0 resize-none bg-white flex-1 p-2 pr-10 pl-4 border border-gray-300 outline-none rounded-tl-3xl rounded-tr-2xl rounded-bl-3xl overflow-hidden",style:{height:X},onInput:A=>ce(A.currentTarget.innerHTML),onKeyDown:A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),ve())}}),p.exports.jsx(sn,{className:"rotate-180 absolute -right-[11.4px] top-[18.4px]"})]}),p.exports.jsx("button",{className:"flex items-center justify-center cursor-pointer w-9 h-9 ml-2 p-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 transition",onClick:f?ve:w,children:f?p.exports.jsx(xr,{}):p.exports.jsx(Uf,{})})]}),b&&p.exports.jsxs("div",{className:"absolute bottom-full left-0 w-full bg-white shadow-xl rounded-lg border border-gray-200 p-4 z-50 max-h-60 overflow-y-auto",onScroll:I,children:[p.exports.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[p.exports.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",p.exports.jsx("span",{className:"text-blue-500",children:b})]}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>P(null),children:"✕"})]}),p.exports.jsxs("div",{className:"space-y-2",children:[o?o.filter(A=>A.symbol===b).map(A=>{var E;const{component:V,lists:L}=A;return V?j?(E=L==null?void 0:L.filter(ne=>ne==null?void 0:ne.name.includes(j)))==null?void 0:E.map((ne,te)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(V,{listsProps:ne,onClick:(xe,we)=>$(xe,we,b)})},te)):L==null?void 0:L.map((ne,te)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(V,{listsProps:ne,onClick:(xe,we)=>$(xe,we,b)})},te)):null}):null,p.exports.jsx("div",{className:"h-8",children:ue&&"Loading more items..."})]})]})]})};var ke=(e=>(e[e.File=0]="File",e[e.Voice=1]="Voice",e[e.Video=2]="Video",e[e.Image=3]="Image",e))(ke||{}),ae=(e=>(e[e.Telegram=0]="Telegram",e[e.Simple=1]="Simple",e))(ae||{});const br=({progress:e,size:t=100,strokeWidth:n=10,circleColor:r="#e0e0e0",progressColor:s="#3b82f6",animationDuration:i=1e3,showCancel:o=!1,onCancelClick:a,className:l})=>{const[c,u]=v.useState(0),f=(t-n)/2,h=2*Math.PI*f,m=h-c/100*h;return v.useEffect(()=>{const y=Date.now(),x=y+i,S=()=>{const b=Date.now(),j=Math.min(1,(b-y)/i)*e;u(j),b<x?requestAnimationFrame(S):u(e)};requestAnimationFrame(S)},[e,i]),p.exports.jsxs("div",{className:`relative flex items-center justify-center ${l}`,style:{width:t,height:t},children:[p.exports.jsxs("svg",{className:"absolute animate-[spin_2s_ease-in-out_infinite] ",width:t,height:t,children:[p.exports.jsx("circle",{cx:t/2,cy:t/2,r:f,fill:"transparent",stroke:r,strokeWidth:n}),p.exports.jsx("circle",{cx:t/2,cy:t/2,r:f,fill:"transparent",stroke:s,strokeWidth:n,strokeDasharray:h,strokeDashoffset:m,strokeLinecap:"round",transform:`rotate(-90 ${t/2} ${t/2})`,className:"transition-all ease-linear duration-1000"})]}),o?p.exports.jsx("button",{onClick:a,className:"absolute flex items-center justify-center w-8 h-8 rounded-full hover:bg-gray-200 transition-colors","aria-label":"Cancel",children:p.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:s,children:p.exports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}):p.exports.jsxs("span",{className:"absolute text-lg font-bold",style:{color:s},children:[Math.round(c),"%"]})]})},Io=({fileName:e,fileSize:t,format:n,src:r,them:s,uploadProgres:i,onCancelClick:o})=>{const a=()=>{const c={rar:p.exports.jsx("p",{className:"p-2 text-green-500 font-bold",children:n}),zip:p.exports.jsx("p",{className:"p-2 text-blue-500 font-bold",children:n}),pdf:p.exports.jsx("p",{className:"p-2 text-red-500 font-bold",children:n}),doc:p.exports.jsx("p",{className:"p-2 text-blue-400 font-bold",children:n}),vid:p.exports.jsx("p",{className:"p-2 text-orange-400 font-bold",children:n}),txt:p.exports.jsx("p",{className:"p-2 text-purple-500 font-bold",children:n}),xls:p.exports.jsx("p",{className:"p-2 text-green-400 font-bold",children:n}),ppt:p.exports.jsx("p",{className:"p-2 text-yellow-500 font-bold",children:n}),png:p.exports.jsx("p",{className:"p-2 text-pink-500 font-bold",children:n}),jpg:p.exports.jsx("p",{className:"p-2 text-indigo-500 font-bold",children:n}),mp3:p.exports.jsx("p",{className:"p-2 text-teal-500 font-bold",children:n}),mp4:p.exports.jsx("p",{className:"p-2 text-gray-500 font-bold",children:n}),exe:p.exports.jsx("p",{className:"p-2 text-red-400 font-bold",children:n}),html:p.exports.jsx("p",{className:"p-2 text-orange-500 font-bold",children:n}),css:p.exports.jsx("p",{className:"p-2 text-blue-300 font-bold",children:n}),js:p.exports.jsx("p",{className:"p-2 text-yellow-400 font-bold",children:n}),json:p.exports.jsx("p",{className:"p-2 text-purple-400 font-bold",children:n}),xml:p.exports.jsx("p",{className:"p-2 text-green-300 font-bold",children:n}),svg:p.exports.jsx("p",{className:"p-2 text-pink-400 font-bold",children:n}),gif:p.exports.jsx("p",{className:"p-2 text-indigo-400 font-bold",children:n}),csv:p.exports.jsx("p",{className:"p-2 text-teal-400 font-bold",children:n}),sql:p.exports.jsx("p",{className:"p-2 text-gray-400 font-bold",children:n})};return n&&c[n]?c[n]:p.exports.jsx("p",{className:"p-2 text-black ",children:n??"UN"})},l=c=>c>1073741824?(c/1073741824).toFixed(2)+" GB":c>1048576?(c/1048576).toFixed(1)+" MB":(c/1024).toFixed(1)+" KB";return p.exports.jsxs("div",{className:"flex items-center rounded-lg",children:[i?p.exports.jsx("div",{className:" w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3",children:p.exports.jsx(br,{progress:(i==null?void 0:i.progres)??0,size:50,strokeWidth:4,showCancel:!0,onCancelClick:o,circleColor:"#ddd",progressColor:"#4caf50"})}):p.exports.jsx("div",{className:` border ${s===ae.Simple?" border-white ":s===ae.Telegram?" border-green-900":""} w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3`,children:a()}),p.exports.jsxs("div",{className:"flex flex-col flex-grow",children:[p.exports.jsx("a",{href:r,download:e,className:`${s===ae.Simple?"text-white":s===ae.Telegram?"text-gray-900":""} font-medium text-sm hover:underline truncate max-w-[100px]`,title:e,children:e}),p.exports.jsx("span",{className:`${s===ae.Simple?"text-gray-800":s===ae.Telegram?"text-gray-900":""} text-sm`,children:l(t)})]}),p.exports.jsx("a",{href:r,download:e,className:"ml-2 bg-green-500 text-white px-2 py-1 text-sm rounded hover:bg-green-600",children:"Download"})]})},zf=e=>p.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-play",...e,children:p.exports.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),Yf=e=>p.exports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-pause",...e,children:[p.exports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),p.exports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let It=null;const Kf=({src:e,className:t,uploadProgres:n,onCancelClick:r})=>{const[s,i]=v.useState(!1),[o,a]=v.useState(0),l=v.useRef(null);v.useEffect(()=>{const u=l.current;if(!u)return;const f=()=>{a(u.currentTime/u.duration*100)},h=()=>i(!0),m=()=>i(!1),y=()=>{i(!1),a(0)};return u.addEventListener("timeupdate",f),u.addEventListener("play",h),u.addEventListener("pause",m),u.addEventListener("ended",y),()=>{u.removeEventListener("timeupdate",f),u.removeEventListener("play",h),u.removeEventListener("pause",m),u.removeEventListener("ended",y)}},[]);const c=()=>{const u=l.current;u&&(s?u.pause():(It&&It!==u&&(It.pause(),It.currentTime=0),u.play(),It=u))};return p.exports.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${t}`,children:[n?p.exports.jsx("div",{className:" w-9 h-9 mr-3 flex items-center justify-center relative rounded-md p-3",children:p.exports.jsx(br,{progress:(n==null?void 0:n.progres)??0,size:50,strokeWidth:4,showCancel:!0,onCancelClick:r,circleColor:"#ddd",progressColor:"#4caf50"})}):p.exports.jsx("button",{className:"w-9 h-9 cursor-pointer flex items-center justify-center pl-[1.5px] bg-gray-700 rounded-full hover:bg-gray-600",onClick:c,children:s?p.exports.jsx(Yf,{}):p.exports.jsx(zf,{})}),p.exports.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:p.exports.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${o}%`}})}),p.exports.jsx("audio",{ref:l,src:e})]})},Hf=({attachmentUrl:e,attachmentType:t,attachmentFormat:n,attachmentName:r,attachmentSize:s,them:i,uploadProgres:o,cancellationToken:a})=>{const l=r||"File",c=s||0;return e?t===ke.Voice?p.exports.jsx("div",{className:"w-full",children:p.exports.jsx(Kf,{onCancelClick:a,uploadProgres:o,src:e})}):t===ke.Image?p.exports.jsxs("div",{className:"relative w-full",children:[o?p.exports.jsx(br,{progress:o==null?void 0:o.progres,size:50,strokeWidth:4,showCancel:!0,onCancelClick:a,circleColor:"#ddd",progressColor:"#286b2a",className:"!absolute z-[1] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"}):null,p.exports.jsx("img",{className:`transition-all ${o?"filter blur-lg":" blur-none"}`,src:e})]}):t===ke.File?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Io,{fileName:l,fileSize:c,format:n??"UN",src:e,uploadProgres:o,onCancelClick:a})}):t===ke.Video?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Io,{fileName:l,fileSize:c,format:n??"UN",src:e,uploadProgres:o,onCancelClick:a})}):null:null},qf=({message:e,showUserProfile:t,handleContextMenu:n,media:r,them:s,maxWidth:i})=>{var o,a,l,c,u,f,h,m,y,x;return p.exports.jsxs(p.exports.Fragment,{children:[t?p.exports.jsx("img",{src:e.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,p.exports.jsxs(vr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:S=>n(S,e),className:`relative ${r?"w-3/4":i?"max-w-[400px] w-fit":"max-w-[75%] w-fit"} flex flex-col gap-1 break-words p-2 pt-5 rounded-lg ${s===ae.Simple?"bg-[#f8fbff]":s===ae.Telegram?"bg-blue-200 ":""} `,children:[p.exports.jsx("span",{title:(o=e.user)!=null&&o.fullName&&((l=(a=e.user)==null?void 0:a.fullName)==null?void 0:l.length)>16?(c=e.user)==null?void 0:c.firstName:(u=e.user)==null?void 0:u.fullName,className:"relative -top-3 h-4 -mb-3 overflow-y-visible text-xs text-orange-700 whitespace-nowrap truncate max-w-[100px] overflow-visible",children:(f=e.user)!=null&&f.fullName&&((m=(h=e.user)==null?void 0:h.fullName)==null?void 0:m.length)>16?(y=e.user)==null?void 0:y.firstName:(x=e.user)==null?void 0:x.fullName}),r||null,p.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e.text}}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(e.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(e.createdDate).toLocaleTimeString().split(":")[1]}),e.isEdited?p.exports.jsx("span",{className:`text-xs italic ${s===ae.Simple?"text-gray-700":s===ae.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(sn,{className:` ${s===ae.Simple?"[&>g>path]:fill-[#f8fbff]":s===ae.Telegram?"[&>g>path]:fill-blue-200":""} -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 `})]})]})},Gf=({className:e})=>p.exports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[p.exports.jsx("path",{d:"M11.6619 4.6478C11.8358 4.83691 11.8272 5.1347 11.6427 5.31294L4.36284 12.3463C4.14493 12.5568 3.80285 12.5503 3.59268 12.3317L1.13205 9.77168C0.954124 9.58658 0.956276 9.28866 1.13686 9.10628C1.31743 8.92389 1.60806 8.9261 1.78598 9.1112L3.99455 11.4089L11.013 4.62812C11.1975 4.44988 11.488 4.4587 11.6619 4.6478Z",fill:"gray"}),p.exports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.8759 4.64963C15.0492 4.83921 15.0399 5.13698 14.8549 5.31471L7.51066 12.3726C7.32572 12.5503 7.03524 12.5407 6.86185 12.3511C6.68847 12.1616 6.69784 11.8638 6.88278 11.6861L14.227 4.62818C14.412 4.45045 14.7025 4.46005 14.8759 4.64963Z",fill:"gray"})]}),No=({size:e=24,color:t="text-current",className:n})=>p.exports.jsx("div",{className:` ${n} animate-spin inline-flex items-center justify-center`,children:p.exports.jsxs("svg",{width:e,height:e,viewBox:"0 0 36 36",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[p.exports.jsx("defs",{children:p.exports.jsxs("linearGradient",{x1:"0%",y1:"100%",x2:"100%",y2:"100%",id:"linearGradient-1",children:[p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0",offset:"0%"}),p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0.50",offset:"39.9430698%"}),p.exports.jsx("stop",{stopColor:"currentColor",offset:"100%"})]})}),p.exports.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[p.exports.jsx("rect",{fillOpacity:"0.01",fill:"none",x:"0",y:"0",width:"36",height:"36"}),p.exports.jsx("path",{d:"M34,18 C34,9.163444 26.836556,2 18,2 C11.6597233,2 6.18078805,5.68784135 3.59122325,11.0354951",stroke:"url(#linearGradient-1)",strokeWidth:"4",strokeLinecap:"round"})]})]})}),Xf=({handleContextMenu:e,media:t,message:n,them:r,maxWidth:s})=>p.exports.jsxs(vr.div,{style:{background:"red !important"},initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:i=>e(i,n),className:`relative self-end ${t?"w-3/4":s?" max-w-[400px]":"max-w-[75%]"} flex flex-col justify-center break-words p-2 rounded-lg ${r===ae.Telegram?" bg-green-200":ae.Simple?" bg-[#4F46E5] text-white":""}`,children:[t||null,p.exports.jsx("span",{className:"",children:n.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(n.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(n.createdDate).toLocaleTimeString().split(":")[1]}),n.isSending?p.exports.jsx(No,{size:13,color:"text-black"}):p.exports.jsx(Gf,{className:r===ae.Telegram?" ":ae.Simple?" [&>path]:fill-white":""}),n.isEdited?p.exports.jsx("span",{className:`text-xs italic ${r===ae.Simple?"text-gray-200":r===ae.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(sn,{className:`fill-blue-200 rotate-180 absolute -right-2 bottom-0 ${r===ae.Telegram?"[&>g>path]:fill-green-200":ae.Simple?"[&>g>path]:fill-[#4F46E5]":""} `})]});var ge={exports:{}},wr={exports:{}},J={};var Fo;function Zf(){if(Fo)return J;Fo=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,P=e?Symbol.for("react.scope"):60119;function j(g){if(typeof g=="object"&&g!==null){var O=g.$$typeof;switch(O){case t:switch(g=g.type,g){case l:case c:case r:case i:case s:case f:return g;default:switch(g=g&&g.$$typeof,g){case a:case u:case y:case m:case o:return g;default:return O}}case n:return O}}}function D(g){return j(g)===c}return J.AsyncMode=l,J.ConcurrentMode=c,J.ContextConsumer=a,J.ContextProvider=o,J.Element=t,J.ForwardRef=u,J.Fragment=r,J.Lazy=y,J.Memo=m,J.Portal=n,J.Profiler=i,J.StrictMode=s,J.Suspense=f,J.isAsyncMode=function(g){return D(g)||j(g)===l},J.isConcurrentMode=D,J.isContextConsumer=function(g){return j(g)===a},J.isContextProvider=function(g){return j(g)===o},J.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===t},J.isForwardRef=function(g){return j(g)===u},J.isFragment=function(g){return j(g)===r},J.isLazy=function(g){return j(g)===y},J.isMemo=function(g){return j(g)===m},J.isPortal=function(g){return j(g)===n},J.isProfiler=function(g){return j(g)===i},J.isStrictMode=function(g){return j(g)===s},J.isSuspense=function(g){return j(g)===f},J.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===r||g===c||g===i||g===s||g===f||g===h||typeof g=="object"&&g!==null&&(g.$$typeof===y||g.$$typeof===m||g.$$typeof===o||g.$$typeof===a||g.$$typeof===u||g.$$typeof===S||g.$$typeof===b||g.$$typeof===P||g.$$typeof===x)},J.typeOf=j,J}var Q={};var Bo;function Jf(){return Bo||(Bo=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,P=e?Symbol.for("react.scope"):60119;function j(E){return typeof E=="string"||typeof E=="function"||E===r||E===c||E===i||E===s||E===f||E===h||typeof E=="object"&&E!==null&&(E.$$typeof===y||E.$$typeof===m||E.$$typeof===o||E.$$typeof===a||E.$$typeof===u||E.$$typeof===S||E.$$typeof===b||E.$$typeof===P||E.$$typeof===x)}function D(E){if(typeof E=="object"&&E!==null){var ne=E.$$typeof;switch(ne){case t:var te=E.type;switch(te){case l:case c:case r:case i:case s:case f:return te;default:var xe=te&&te.$$typeof;switch(xe){case a:case u:case y:case m:case o:return xe;default:return ne}}case n:return ne}}}var g=l,O=c,Y=a,k=o,ee=t,M=u,q=r,ue=y,W=m,le=n,ye=i,me=s,X=f,ce=!1;function ve(E){return ce||(ce=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),w(E)||D(E)===l}function w(E){return D(E)===c}function T(E){return D(E)===a}function B(E){return D(E)===o}function $(E){return typeof E=="object"&&E!==null&&E.$$typeof===t}function I(E){return D(E)===u}function K(E){return D(E)===r}function N(E){return D(E)===y}function U(E){return D(E)===m}function z(E){return D(E)===n}function A(E){return D(E)===i}function V(E){return D(E)===s}function L(E){return D(E)===f}Q.AsyncMode=g,Q.ConcurrentMode=O,Q.ContextConsumer=Y,Q.ContextProvider=k,Q.Element=ee,Q.ForwardRef=M,Q.Fragment=q,Q.Lazy=ue,Q.Memo=W,Q.Portal=le,Q.Profiler=ye,Q.StrictMode=me,Q.Suspense=X,Q.isAsyncMode=ve,Q.isConcurrentMode=w,Q.isContextConsumer=T,Q.isContextProvider=B,Q.isElement=$,Q.isForwardRef=I,Q.isFragment=K,Q.isLazy=N,Q.isMemo=U,Q.isPortal=z,Q.isProfiler=A,Q.isStrictMode=V,Q.isSuspense=L,Q.isValidElementType=j,Q.typeOf=D}()),Q}var $o;function Uo(){return $o||($o=1,function(e){process.env.NODE_ENV==="production"?e.exports=Zf():e.exports=Jf()}(wr)),wr.exports}var Tr,Wo;function Qf(){if(Wo)return Tr;Wo=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function s(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(u){return o[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Tr=s()?Object.assign:function(i,o){for(var a,l=r(i),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){c=e(a);for(var h=0;h<c.length;h++)n.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},Tr}var Sr,zo;function Cr(){if(zo)return Sr;zo=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Sr=e,Sr}var Pr,Yo;function Ko(){return Yo||(Yo=1,Pr=Function.call.bind(Object.prototype.hasOwnProperty)),Pr}var Er,Ho;function ed(){if(Ho)return Er;Ho=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Cr(),n={},r=Ko();e=function(i){var o="Warning: "+i;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(i,o,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var f;try{if(typeof i[u]!="function"){var h=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=i[u](o,u,l,a,null,t)}catch(y){f=y}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var m=c?c():"";e("Failed "+a+" type: "+f.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Er=s,Er}var jr,qo;function td(){if(qo)return jr;qo=1;var e=Uo(),t=Qf(),n=Cr(),r=Ko(),s=ed(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function o(){return null}return jr=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(w){var T=w&&(c&&w[c]||w[u]);if(typeof T=="function")return T}var h="<<anonymous>>",m={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:P(),arrayOf:j,element:D(),elementType:g(),instanceOf:O,node:M(),objectOf:k,oneOf:Y,oneOfType:ee,shape:ue,exact:W};function y(w,T){return w===T?w!==0||1/w===1/T:w!==w&&T!==T}function x(w,T){this.message=w,this.data=T&&typeof T=="object"?T:{},this.stack=""}x.prototype=Error.prototype;function S(w){if(process.env.NODE_ENV!=="production")var T={},B=0;function $(K,N,U,z,A,V,L){if(z=z||h,V=V||U,L!==n){if(l){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=z+":"+U;!T[ne]&&B<3&&(i("You are manually calling a React.PropTypes validation function for the `"+V+"` prop on `"+z+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),T[ne]=!0,B++)}}return N[U]==null?K?N[U]===null?new x("The "+A+" `"+V+"` is marked as required "+("in `"+z+"`, but its value is `null`.")):new x("The "+A+" `"+V+"` is marked as required in "+("`"+z+"`, but its value is `undefined`.")):null:w(N,U,z,A,V)}var I=$.bind(null,!1);return I.isRequired=$.bind(null,!0),I}function b(w){function T(B,$,I,K,N,U){var z=B[$],A=me(z);if(A!==w){var V=X(z);return new x("Invalid "+K+" `"+N+"` of type "+("`"+V+"` supplied to `"+I+"`, expected ")+("`"+w+"`."),{expectedType:w})}return null}return S(T)}function P(){return S(o)}function j(w){function T(B,$,I,K,N){if(typeof w!="function")return new x("Property `"+N+"` of component `"+I+"` has invalid PropType notation inside arrayOf.");var U=B[$];if(!Array.isArray(U)){var z=me(U);return new x("Invalid "+K+" `"+N+"` of type "+("`"+z+"` supplied to `"+I+"`, expected an array."))}for(var A=0;A<U.length;A++){var V=w(U,A,I,K,N+"["+A+"]",n);if(V instanceof Error)return V}return null}return S(T)}function D(){function w(T,B,$,I,K){var N=T[B];if(!a(N)){var U=me(N);return new x("Invalid "+I+" `"+K+"` of type "+("`"+U+"` supplied to `"+$+"`, expected a single ReactElement."))}return null}return S(w)}function g(){function w(T,B,$,I,K){var N=T[B];if(!e.isValidElementType(N)){var U=me(N);return new x("Invalid "+I+" `"+K+"` of type "+("`"+U+"` supplied to `"+$+"`, expected a single ReactElement type."))}return null}return S(w)}function O(w){function T(B,$,I,K,N){if(!(B[$]instanceof w)){var U=w.name||h,z=ve(B[$]);return new x("Invalid "+K+" `"+N+"` of type "+("`"+z+"` supplied to `"+I+"`, expected ")+("instance of `"+U+"`."))}return null}return S(T)}function Y(w){if(!Array.isArray(w))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),o;function T(B,$,I,K,N){for(var U=B[$],z=0;z<w.length;z++)if(y(U,w[z]))return null;var A=JSON.stringify(w,function(L,E){var ne=X(E);return ne==="symbol"?String(E):E});return new x("Invalid "+K+" `"+N+"` of value `"+String(U)+"` "+("supplied to `"+I+"`, expected one of "+A+"."))}return S(T)}function k(w){function T(B,$,I,K,N){if(typeof w!="function")return new x("Property `"+N+"` of component `"+I+"` has invalid PropType notation inside objectOf.");var U=B[$],z=me(U);if(z!=="object")return new x("Invalid "+K+" `"+N+"` of type "+("`"+z+"` supplied to `"+I+"`, expected an object."));for(var A in U)if(r(U,A)){var V=w(U,A,I,K,N+"."+A,n);if(V instanceof Error)return V}return null}return S(T)}function ee(w){if(!Array.isArray(w))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var T=0;T<w.length;T++){var B=w[T];if(typeof B!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ce(B)+" at index "+T+"."),o}function $(I,K,N,U,z){for(var A=[],V=0;V<w.length;V++){var L=w[V],E=L(I,K,N,U,z,n);if(E==null)return null;E.data&&r(E.data,"expectedType")&&A.push(E.data.expectedType)}var ne=A.length>0?", expected one of type ["+A.join(", ")+"]":"";return new x("Invalid "+U+" `"+z+"` supplied to "+("`"+N+"`"+ne+"."))}return S($)}function M(){function w(T,B,$,I,K){return le(T[B])?null:new x("Invalid "+I+" `"+K+"` supplied to "+("`"+$+"`, expected a ReactNode."))}return S(w)}function q(w,T,B,$,I){return new x((w||"React class")+": "+T+" type `"+B+"."+$+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+I+"`.")}function ue(w){function T(B,$,I,K,N){var U=B[$],z=me(U);if(z!=="object")return new x("Invalid "+K+" `"+N+"` of type `"+z+"` "+("supplied to `"+I+"`, expected `object`."));for(var A in w){var V=w[A];if(typeof V!="function")return q(I,K,N,A,X(V));var L=V(U,A,I,K,N+"."+A,n);if(L)return L}return null}return S(T)}function W(w){function T(B,$,I,K,N){var U=B[$],z=me(U);if(z!=="object")return new x("Invalid "+K+" `"+N+"` of type `"+z+"` "+("supplied to `"+I+"`, expected `object`."));var A=t({},B[$],w);for(var V in A){var L=w[V];if(r(w,V)&&typeof L!="function")return q(I,K,N,V,X(L));if(!L)return new x("Invalid "+K+" `"+N+"` key `"+V+"` supplied to `"+I+"`.\nBad object: "+JSON.stringify(B[$],null," ")+`
20
+ Valid keys: `+JSON.stringify(Object.keys(w),null," "));var E=L(U,V,I,K,N+"."+V,n);if(E)return E}return null}return S(T)}function le(w){switch(typeof w){case"number":case"string":case"undefined":return!0;case"boolean":return!w;case"object":if(Array.isArray(w))return w.every(le);if(w===null||a(w))return!0;var T=f(w);if(T){var B=T.call(w),$;if(T!==w.entries){for(;!($=B.next()).done;)if(!le($.value))return!1}else for(;!($=B.next()).done;){var I=$.value;if(I&&!le(I[1]))return!1}}else return!1;return!0;default:return!1}}function ye(w,T){return w==="symbol"?!0:T?T["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&T instanceof Symbol:!1}function me(w){var T=typeof w;return Array.isArray(w)?"array":w instanceof RegExp?"object":ye(T,w)?"symbol":T}function X(w){if(typeof w>"u"||w===null)return""+w;var T=me(w);if(T==="object"){if(w instanceof Date)return"date";if(w instanceof RegExp)return"regexp"}return T}function ce(w){var T=X(w);switch(T){case"array":case"object":return"an "+T;case"boolean":case"date":case"regexp":return"a "+T;default:return T}}function ve(w){return!w.constructor||!w.constructor.name?h:w.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},jr}var Ar,Go;function nd(){if(Go)return Ar;Go=1;var e=Cr();function t(){}function n(){}return n.resetWarningCache=t,Ar=function(){function r(o,a,l,c,u,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function s(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Ar}if(process.env.NODE_ENV!=="production"){var rd=Uo(),sd=!0;ge.exports=td()(rd.isElement,sd)}else ge.exports=nd()();function Mr(){return Mr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mr.apply(this,arguments)}function id(e,t){if(e==null)return{};var n=od(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function od(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Rr=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=id(e,["color","size"]);return v.createElement("svg",Mr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),v.createElement("polyline",{points:"20 6 9 17 4 12"}))});Rr.propTypes={color:ge.exports.string,size:ge.exports.oneOfType([ge.exports.string,ge.exports.number])},Rr.displayName="Check";const ad=Rr;function Vr(){return Vr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vr.apply(this,arguments)}function ld(e,t){if(e==null)return{};var n=cd(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cd(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Dr=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=ld(e,["color","size"]);return v.createElement("svg",Vr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),v.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),v.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))});Dr.propTypes={color:ge.exports.string,size:ge.exports.oneOfType([ge.exports.string,ge.exports.number])},Dr.displayName="Copy";const ud=Dr;function Or(){return Or=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Or.apply(this,arguments)}function fd(e,t){if(e==null)return{};var n=dd(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dd(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Lr=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=fd(e,["color","size"]);return v.createElement("svg",Or({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),v.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),v.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});Lr.propTypes={color:ge.exports.string,size:ge.exports.oneOfType([ge.exports.string,ge.exports.number])},Lr.displayName="Edit";const hd=Lr;function kr(){return kr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kr.apply(this,arguments)}function pd(e,t){if(e==null)return{};var n=md(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function md(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var _r=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=pd(e,["color","size"]);return v.createElement("svg",kr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),v.createElement("polyline",{points:"3 6 5 6 21 6"}),v.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}))});_r.propTypes={color:ge.exports.string,size:ge.exports.oneOfType([ge.exports.string,ge.exports.number])},_r.displayName="Trash";const gd=_r,yd=({user:e,messages:t,updateMessages:n,onMessageSent:r,onEditMessage:s,isSendingDefultForNewMessage:i,isSendingDefultForEdited:o,onDeleteMessage:a})=>{const l=v.useRef(null),[c,u]=v.useState(!1),[f,h]=v.useState(null),[m,y]=v.useState(),[x,S]=v.useState(null),b=()=>{setTimeout(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},100)};v.useEffect(()=>{const M=()=>{S(null)};return window.addEventListener("scroll",M,!0),()=>{window.removeEventListener("scroll",M,!0)}},[S]);const P=(M,q)=>{M.preventDefault();const ue=window.scrollX,W=window.scrollY;S({x:M.clientX+ue,y:M.clientY+W,message:q})},j=()=>{S(null)},D=M=>{const q=new yt({id:new Date().toString(),text:M,user:e,isRightSided:!0,isSending:i,createdDate:new Date().toString()});n([...t,q]),r(q),b()},g=M=>{n(t.map(q=>q.id===M.id?(M.updateIsSending(Boolean(o)),M):q)),s(M)},O=M=>{const q=URL.createObjectURL(M),ue=new yt({id:new Date().toString(),text:"",attachmentUrl:q,attachmentType:ke.Voice,attachmentBlob:M,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,ue]),r(ue),b()},Y=(M,q)=>{const ue=URL.createObjectURL(M),W=M instanceof File?M.name:"",le=M instanceof File?M.name.split(".").pop():"",ye=new yt({id:new Date().toString(),text:"",attachmentUrl:ue,attachmentBlob:M,attachmentType:q,attachmentFormat:le,attachmentName:W,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,ye]),r(ye),b()};return{handleDeleteConfirmation:()=>{f&&(a(f),h(null)),u(!1)},handleCloseContextMenu:j,contextMenuItems:[{name:"Edit",icon:p.exports.jsx(hd,{className:"text-gray-600"}),onlyCurrentUserMessage:!0,onClick:M=>{y(t.find(q=>q.id===M)),j()}},{name:"Delete",icon:p.exports.jsx(gd,{className:"text-red-600"}),onlyCurrentUserMessage:!0,onClick:M=>{h(M),u(!0),j()}},{name:"Select",icon:p.exports.jsx(ad,{className:"text-green-600"}),disabled:!0,onClick:()=>{console.log("Select clicked"),j()}},{name:"Copy",icon:p.exports.jsx(ud,{className:"text-blue-600"}),onClick:M=>{const q=t.find(ue=>ue.id===M);q&&navigator.clipboard.writeText(q.text),j()}}],handleSendFile:Y,handleSendVoice:O,handleSendMessage:D,handleContextMenu:P,isModalOpen:c,contextMenu:x,chatRef:l,setIsModalOpen:u,messageToEdit:m,setMessageToEdit:y,handleEditMessage:g}},vd=({width:e="400px",height:t="600px",isLoadingChat:n,className:r,style:s,messages:i,user:o,updateMessages:a,onMessageSent:l,onDeleteMessage:c,onEditMessage:u,dynamicSymbolAssignments:f,onDynamicSymbolListSet:h,onDynamicSymbolListDelete:m,isSendingDefultForNewMessage:y,isSendingDefultForEdited:x,backgroundImage:S,messageBubbleBiggerSize:b,uploadProgress:P,onUploadCancellationToken:j,them:D=ae.Telegram})=>{var ve,w;const{handleDeleteConfirmation:g,handleCloseContextMenu:O,handleSendFile:Y,handleSendVoice:k,handleSendMessage:ee,handleContextMenu:M,contextMenuItems:q,isModalOpen:ue,contextMenu:W,chatRef:le,setIsModalOpen:ye,messageToEdit:me,setMessageToEdit:X,handleEditMessage:ce}=yd({user:o,messages:i,updateMessages:a,onMessageSent:l,onEditMessage:u,onDeleteMessage:c,isSendingDefultForNewMessage:y,isSendingDefultForEdited:x});return p.exports.jsxs("div",{className:`flex flex-col !bg-cover ${r}`,style:{width:e,height:t,background:"url("+S+")",...s},onClick:O,children:[p.exports.jsx("div",{ref:le,className:`flex flex-col gap-2 flex-1 p-3 pb-16 ${W?"overflow-hidden pr-[22px]":"overflow-y-scroll"}`,children:n?p.exports.jsx(No,{className:"mt-3",size:27,color:"text-gray-800"}):p.exports.jsx(Hr,{children:i.length>0?i.map((T,B)=>{var K,N,U;const $=T!=null&&T.attachmentUrl?p.exports.jsx(Hf,{attachmentUrl:T.attachmentUrl,attachmentType:T==null?void 0:T.attachmentType,attachmentFormat:T==null?void 0:T.attachmentFormat,attachmentName:T==null?void 0:T.attachmentName,attachmentSize:T==null?void 0:T.attachmentSize,uploadProgres:P==null?void 0:P.find(z=>z.messageId===T.id),cancellationToken:()=>j?j(T.id):null},B):null;if(T.isRightSided)return p.exports.jsx(Xf,{maxWidth:b,media:$,handleContextMenu:M,message:T,them:D},B);const I=((N=(K=i[B-1])==null?void 0:K.user)==null?void 0:N.id)!==((U=T==null?void 0:T.user)==null?void 0:U.id);return p.exports.jsx(qf,{maxWidth:b,showUserProfile:I,media:$,handleContextMenu:M,message:T,them:D},B)}):null})}),p.exports.jsx(Nf,{isOpen:ue,onClose:()=>ye(!1),onConfirm:g,header:"Confirm Delete",question:"Are you sure you want to delete this message?"}),W&&((ve=W==null?void 0:W.message)!=null&&ve.id)?p.exports.jsx(Ff,{items:q,isVisible:Boolean(W),messageId:String(W==null?void 0:W.message.id),isCurrentUserMessage:((w=W==null?void 0:W.message)==null?void 0:w.user.id)===o.id,position:{x:W==null?void 0:W.x,y:W==null?void 0:W.y}}):null,p.exports.jsx(Wf,{onSendVoice:k,onSendMessage:ee,onFileSend:T=>Y(T,ke.File),onImageSend:T=>Y(T,ke.Image),onVideoSend:T=>Y(T,ke.Video),dynamicSymbolAssignments:f,onDynamicSymbolListSet:h,onDynamicSymbolListDelete:m,messageToEdit:me,setMessageToEdit:X,onEditMessage:ce})]})};pe.AttachmentTypeEnum=ke,pe.Button=ua,pe.Chat=vd,pe.ChatThemEntity=ae,pe.MessageEntity=yt,pe.SymbolsListComponent=fa,Object.defineProperty(pe,Symbol.toStringTag,{value:"Module"})});
21
21
  //# sourceMappingURL=index.umd.js.map