react-pro-messenger 1.0.21 → 1.0.24

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,8 +1,8 @@
1
- (function(de,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):(de=typeof globalThis<"u"?globalThis:de||self,v(de.ReactProMessenger={},de.React,de.ReactDOM))})(this,function(de,v,$e){"use strict";var Od=Object.defineProperty;var Ld=(de,v,$e)=>v in de?Od(de,v,{enumerable:!0,configurable:!0,writable:!0,value:$e}):de[v]=$e;var De=(de,v,$e)=>(Ld(de,typeof v!="symbol"?v+"":v,$e),$e);function ra(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 tn=ra(v);var g={exports:{}},ct={};var _r;function sa(){if(_r)return ct;_r=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(l,a,c){var u,f={},h=null,m=null;c!==void 0&&(h=""+c),a.key!==void 0&&(h=""+a.key),a.ref!==void 0&&(m=a.ref);for(u in a)r.call(a,u)&&!i.hasOwnProperty(u)&&(f[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)f[u]===void 0&&(f[u]=a[u]);return{$$typeof:t,type:l,key:h,ref:m,props:f,_owner:s.current}}return ct.Fragment=n,ct.jsx=o,ct.jsxs=o,ct}var ft={};var Ir;function ia(){return Ir||(Ir=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"),l=Symbol.for("react.context"),a=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"),x=Symbol.iterator,y="@@iterator";function P(d){if(d===null||typeof d!="object")return null;var w=x&&d[x]||d[y];return typeof w=="function"?w:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(d){{for(var w=arguments.length,A=new Array(w>1?w-1:0),L=1;L<w;L++)A[L-1]=arguments[L];C("error",d,A)}}function C(d,w,A){{var L=b.ReactDebugCurrentFrame,X=L.getStackAddendum();X!==""&&(w+="%s",A=A.concat([X]));var ee=A.map(function(q){return String(q)});ee.unshift("Warning: "+w),Function.prototype.apply.call(console[d],console,ee)}}var D=!1,p=!1,M=!1,U=!1,R=!1,Q;Q=Symbol.for("react.module.reference");function Y(d){return!!(typeof d=="string"||typeof d=="function"||d===r||d===i||R||d===s||d===c||d===u||U||d===m||D||p||M||typeof d=="object"&&d!==null&&(d.$$typeof===h||d.$$typeof===f||d.$$typeof===o||d.$$typeof===l||d.$$typeof===a||d.$$typeof===Q||d.getModuleId!==void 0))}function ae(d,w,A){var L=d.displayName;if(L)return L;var X=w.displayName||w.name||"";return X!==""?A+"("+X+")":A}function Te(d){return d.displayName||"Context"}function ce(d){if(d==null)return null;if(typeof d.tag=="number"&&S("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 l:var w=d;return Te(w)+".Consumer";case o:var A=d;return Te(A._context)+".Provider";case a:return ae(d,d.render,"ForwardRef");case f:var L=d.displayName||null;return L!==null?L:ce(d.type)||"Memo";case h:{var X=d,ee=X._payload,q=X._init;try{return ce(q(ee))}catch{return null}}}return null}var se=Object.assign,ve=0,I,O,k,le,T,E,_;function F(){}F.__reactDisabledLog=!0;function N(){{if(ve===0){I=console.log,O=console.info,k=console.warn,le=console.error,T=console.group,E=console.groupCollapsed,_=console.groupEnd;var d={configurable:!0,enumerable:!0,value:F,writable:!0};Object.defineProperties(console,{info:d,log:d,warn:d,error:d,group:d,groupCollapsed:d,groupEnd:d})}ve++}}function G(){{if(ve--,ve===0){var d={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:se({},d,{value:I}),info:se({},d,{value:O}),warn:se({},d,{value:k}),error:se({},d,{value:le}),group:se({},d,{value:T}),groupCollapsed:se({},d,{value:E}),groupEnd:se({},d,{value:_})})}ve<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var B=b.ReactCurrentDispatcher,$;function W(d,w,A){{if($===void 0)try{throw Error()}catch(X){var L=X.stack.trim().match(/\n( *(at )?)/);$=L&&L[1]||""}return`
2
- `+$+d}}var H=!1,z;{var ge=typeof WeakMap=="function"?WeakMap:Map;z=new ge}function j(d,w){if(!d||H)return"";{var A=z.get(d);if(A!==void 0)return A}var L;H=!0;var X=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ee;ee=B.current,B.current=null,N();try{if(w){var q=function(){throw Error()};if(Object.defineProperty(q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(q,[])}catch(Oe){L=Oe}Reflect.construct(d,[],q)}else{try{q.call()}catch(Oe){L=Oe}d.call(q.prototype)}}else{try{throw Error()}catch(Oe){L=Oe}d()}}catch(Oe){if(Oe&&L&&typeof Oe.stack=="string"){for(var K=Oe.stack.split(`
1
+ (function(de,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):(de=typeof globalThis<"u"?globalThis:de||self,v(de.ReactProMessenger={},de.React,de.ReactDOM))})(this,function(de,v,$e){"use strict";var Od=Object.defineProperty;var Ld=(de,v,$e)=>v in de?Od(de,v,{enumerable:!0,configurable:!0,writable:!0,value:$e}):de[v]=$e;var De=(de,v,$e)=>(Ld(de,typeof v!="symbol"?v+"":v,$e),$e);function ra(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 tn=ra(v);var g={exports:{}},ct={};var _r;function sa(){if(_r)return ct;_r=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(l,a,c){var u,f={},h=null,m=null;c!==void 0&&(h=""+c),a.key!==void 0&&(h=""+a.key),a.ref!==void 0&&(m=a.ref);for(u in a)r.call(a,u)&&!i.hasOwnProperty(u)&&(f[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)f[u]===void 0&&(f[u]=a[u]);return{$$typeof:t,type:l,key:h,ref:m,props:f,_owner:s.current}}return ct.Fragment=n,ct.jsx=o,ct.jsxs=o,ct}var ft={};var Ir;function ia(){return Ir||(Ir=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"),l=Symbol.for("react.context"),a=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"),x=Symbol.iterator,y="@@iterator";function P(d){if(d===null||typeof d!="object")return null;var w=x&&d[x]||d[y];return typeof w=="function"?w:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(d){{for(var w=arguments.length,A=new Array(w>1?w-1:0),L=1;L<w;L++)A[L-1]=arguments[L];C("error",d,A)}}function C(d,w,A){{var L=b.ReactDebugCurrentFrame,X=L.getStackAddendum();X!==""&&(w+="%s",A=A.concat([X]));var ee=A.map(function(q){return String(q)});ee.unshift("Warning: "+w),Function.prototype.apply.call(console[d],console,ee)}}var D=!1,p=!1,M=!1,B=!1,R=!1,Q;Q=Symbol.for("react.module.reference");function Y(d){return!!(typeof d=="string"||typeof d=="function"||d===r||d===i||R||d===s||d===c||d===u||B||d===m||D||p||M||typeof d=="object"&&d!==null&&(d.$$typeof===h||d.$$typeof===f||d.$$typeof===o||d.$$typeof===l||d.$$typeof===a||d.$$typeof===Q||d.getModuleId!==void 0))}function ae(d,w,A){var L=d.displayName;if(L)return L;var X=w.displayName||w.name||"";return X!==""?A+"("+X+")":A}function Te(d){return d.displayName||"Context"}function ce(d){if(d==null)return null;if(typeof d.tag=="number"&&S("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 l:var w=d;return Te(w)+".Consumer";case o:var A=d;return Te(A._context)+".Provider";case a:return ae(d,d.render,"ForwardRef");case f:var L=d.displayName||null;return L!==null?L:ce(d.type)||"Memo";case h:{var X=d,ee=X._payload,q=X._init;try{return ce(q(ee))}catch{return null}}}return null}var se=Object.assign,ve=0,I,O,k,le,T,E,_;function F(){}F.__reactDisabledLog=!0;function N(){{if(ve===0){I=console.log,O=console.info,k=console.warn,le=console.error,T=console.group,E=console.groupCollapsed,_=console.groupEnd;var d={configurable:!0,enumerable:!0,value:F,writable:!0};Object.defineProperties(console,{info:d,log:d,warn:d,error:d,group:d,groupCollapsed:d,groupEnd:d})}ve++}}function G(){{if(ve--,ve===0){var d={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:se({},d,{value:I}),info:se({},d,{value:O}),warn:se({},d,{value:k}),error:se({},d,{value:le}),group:se({},d,{value:T}),groupCollapsed:se({},d,{value:E}),groupEnd:se({},d,{value:_})})}ve<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var $=b.ReactCurrentDispatcher,U;function W(d,w,A){{if(U===void 0)try{throw Error()}catch(X){var L=X.stack.trim().match(/\n( *(at )?)/);U=L&&L[1]||""}return`
2
+ `+U+d}}var H=!1,z;{var ge=typeof WeakMap=="function"?WeakMap:Map;z=new ge}function j(d,w){if(!d||H)return"";{var A=z.get(d);if(A!==void 0)return A}var L;H=!0;var X=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ee;ee=$.current,$.current=null,N();try{if(w){var q=function(){throw Error()};if(Object.defineProperty(q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(q,[])}catch(Oe){L=Oe}Reflect.construct(d,[],q)}else{try{q.call()}catch(Oe){L=Oe}d.call(q.prototype)}}else{try{throw Error()}catch(Oe){L=Oe}d()}}catch(Oe){if(Oe&&L&&typeof Oe.stack=="string"){for(var K=Oe.stack.split(`
3
3
  `),xe=L.stack.split(`
4
4
  `),oe=K.length-1,ue=xe.length-1;oe>=1&&ue>=0&&K[oe]!==xe[ue];)ue--;for(;oe>=1&&ue>=0;oe--,ue--)if(K[oe]!==xe[ue]){if(oe!==1||ue!==1)do if(oe--,ue--,ue<0||K[oe]!==xe[ue]){var Ce=`
5
- `+K[oe].replace(" at new "," at ");return d.displayName&&Ce.includes("<anonymous>")&&(Ce=Ce.replace("<anonymous>",d.displayName)),typeof d=="function"&&z.set(d,Ce),Ce}while(oe>=1&&ue>=0);break}}}finally{H=!1,B.current=ee,G(),Error.prepareStackTrace=X}var ut=d?d.displayName||d.name:"",na=ut?W(ut):"";return typeof d=="function"&&z.set(d,na),na}function Se(d,w,A){return j(d,!1)}function at(d){var w=d.prototype;return!!(w&&w.isReactComponent)}function qe(d,w,A){if(d==null)return"";if(typeof d=="function")return j(d,at(d));if(typeof d=="string")return W(d);switch(d){case c:return W("Suspense");case u:return W("SuspenseList")}if(typeof d=="object")switch(d.$$typeof){case a:return Se(d.render);case f:return qe(d.type,w,A);case h:{var L=d,X=L._payload,ee=L._init;try{return qe(ee(X),w,A)}catch{}}}return""}var Qt=Object.prototype.hasOwnProperty,zo={},Yo=b.ReactDebugCurrentFrame;function en(d){if(d){var w=d._owner,A=qe(d.type,d._source,w?w.type:null);Yo.setExtraStackFrame(A)}else Yo.setExtraStackFrame(null)}function hd(d,w,A,L,X){{var ee=Function.call.bind(Qt);for(var q in d)if(ee(d,q)){var K=void 0;try{if(typeof d[q]!="function"){var xe=Error((L||"React class")+": "+A+" type `"+q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof d[q]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw xe.name="Invariant Violation",xe}K=d[q](w,q,L,A,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(oe){K=oe}K&&!(K instanceof Error)&&(en(X),S("%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).",L||"React class",A,q,typeof K),en(null)),K instanceof Error&&!(K.message in zo)&&(zo[K.message]=!0,en(X),S("Failed %s type: %s",A,K.message),en(null))}}}var pd=Array.isArray;function Rr(d){return pd(d)}function md(d){{var w=typeof Symbol=="function"&&Symbol.toStringTag,A=w&&d[Symbol.toStringTag]||d.constructor.name||"Object";return A}}function gd(d){try{return Ko(d),!1}catch{return!0}}function Ko(d){return""+d}function Go(d){if(gd(d))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",md(d)),Ko(d)}var Vt=b.ReactCurrentOwner,yd={key:!0,ref:!0,__self:!0,__source:!0},qo,Ho,Vr;Vr={};function vd(d){if(Qt.call(d,"ref")){var w=Object.getOwnPropertyDescriptor(d,"ref").get;if(w&&w.isReactWarning)return!1}return d.ref!==void 0}function xd(d){if(Qt.call(d,"key")){var w=Object.getOwnPropertyDescriptor(d,"key").get;if(w&&w.isReactWarning)return!1}return d.key!==void 0}function bd(d,w){if(typeof d.ref=="string"&&Vt.current&&w&&Vt.current.stateNode!==w){var A=ce(Vt.current.type);Vr[A]||(S('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',ce(Vt.current.type),d.ref),Vr[A]=!0)}}function Td(d,w){{var A=function(){qo||(qo=!0,S("%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)",w))};A.isReactWarning=!0,Object.defineProperty(d,"key",{get:A,configurable:!0})}}function wd(d,w){{var A=function(){Ho||(Ho=!0,S("%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)",w))};A.isReactWarning=!0,Object.defineProperty(d,"ref",{get:A,configurable:!0})}}var Pd=function(d,w,A,L,X,ee,q){var K={$$typeof:t,type:d,key:w,ref:A,props:q,_owner:ee};return K._store={},Object.defineProperty(K._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(K,"_self",{configurable:!1,enumerable:!1,writable:!1,value:L}),Object.defineProperty(K,"_source",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.freeze&&(Object.freeze(K.props),Object.freeze(K)),K};function Sd(d,w,A,L,X){{var ee,q={},K=null,xe=null;A!==void 0&&(Go(A),K=""+A),xd(w)&&(Go(w.key),K=""+w.key),vd(w)&&(xe=w.ref,bd(w,X));for(ee in w)Qt.call(w,ee)&&!yd.hasOwnProperty(ee)&&(q[ee]=w[ee]);if(d&&d.defaultProps){var oe=d.defaultProps;for(ee in oe)q[ee]===void 0&&(q[ee]=oe[ee])}if(K||xe){var ue=typeof d=="function"?d.displayName||d.name||"Unknown":d;K&&Td(q,ue),xe&&wd(q,ue)}return Pd(d,K,xe,X,L,Vt.current,q)}}var Or=b.ReactCurrentOwner,Xo=b.ReactDebugCurrentFrame;function lt(d){if(d){var w=d._owner,A=qe(d.type,d._source,w?w.type:null);Xo.setExtraStackFrame(A)}else Xo.setExtraStackFrame(null)}var Lr;Lr=!1;function kr(d){return typeof d=="object"&&d!==null&&d.$$typeof===t}function Zo(){{if(Or.current){var d=ce(Or.current.type);if(d)return`
5
+ `+K[oe].replace(" at new "," at ");return d.displayName&&Ce.includes("<anonymous>")&&(Ce=Ce.replace("<anonymous>",d.displayName)),typeof d=="function"&&z.set(d,Ce),Ce}while(oe>=1&&ue>=0);break}}}finally{H=!1,$.current=ee,G(),Error.prepareStackTrace=X}var ut=d?d.displayName||d.name:"",na=ut?W(ut):"";return typeof d=="function"&&z.set(d,na),na}function Se(d,w,A){return j(d,!1)}function at(d){var w=d.prototype;return!!(w&&w.isReactComponent)}function qe(d,w,A){if(d==null)return"";if(typeof d=="function")return j(d,at(d));if(typeof d=="string")return W(d);switch(d){case c:return W("Suspense");case u:return W("SuspenseList")}if(typeof d=="object")switch(d.$$typeof){case a:return Se(d.render);case f:return qe(d.type,w,A);case h:{var L=d,X=L._payload,ee=L._init;try{return qe(ee(X),w,A)}catch{}}}return""}var Qt=Object.prototype.hasOwnProperty,zo={},Yo=b.ReactDebugCurrentFrame;function en(d){if(d){var w=d._owner,A=qe(d.type,d._source,w?w.type:null);Yo.setExtraStackFrame(A)}else Yo.setExtraStackFrame(null)}function hd(d,w,A,L,X){{var ee=Function.call.bind(Qt);for(var q in d)if(ee(d,q)){var K=void 0;try{if(typeof d[q]!="function"){var xe=Error((L||"React class")+": "+A+" type `"+q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof d[q]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw xe.name="Invariant Violation",xe}K=d[q](w,q,L,A,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(oe){K=oe}K&&!(K instanceof Error)&&(en(X),S("%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).",L||"React class",A,q,typeof K),en(null)),K instanceof Error&&!(K.message in zo)&&(zo[K.message]=!0,en(X),S("Failed %s type: %s",A,K.message),en(null))}}}var pd=Array.isArray;function Rr(d){return pd(d)}function md(d){{var w=typeof Symbol=="function"&&Symbol.toStringTag,A=w&&d[Symbol.toStringTag]||d.constructor.name||"Object";return A}}function gd(d){try{return Ko(d),!1}catch{return!0}}function Ko(d){return""+d}function Go(d){if(gd(d))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",md(d)),Ko(d)}var Vt=b.ReactCurrentOwner,yd={key:!0,ref:!0,__self:!0,__source:!0},qo,Ho,Vr;Vr={};function vd(d){if(Qt.call(d,"ref")){var w=Object.getOwnPropertyDescriptor(d,"ref").get;if(w&&w.isReactWarning)return!1}return d.ref!==void 0}function xd(d){if(Qt.call(d,"key")){var w=Object.getOwnPropertyDescriptor(d,"key").get;if(w&&w.isReactWarning)return!1}return d.key!==void 0}function bd(d,w){if(typeof d.ref=="string"&&Vt.current&&w&&Vt.current.stateNode!==w){var A=ce(Vt.current.type);Vr[A]||(S('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',ce(Vt.current.type),d.ref),Vr[A]=!0)}}function Td(d,w){{var A=function(){qo||(qo=!0,S("%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)",w))};A.isReactWarning=!0,Object.defineProperty(d,"key",{get:A,configurable:!0})}}function wd(d,w){{var A=function(){Ho||(Ho=!0,S("%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)",w))};A.isReactWarning=!0,Object.defineProperty(d,"ref",{get:A,configurable:!0})}}var Pd=function(d,w,A,L,X,ee,q){var K={$$typeof:t,type:d,key:w,ref:A,props:q,_owner:ee};return K._store={},Object.defineProperty(K._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(K,"_self",{configurable:!1,enumerable:!1,writable:!1,value:L}),Object.defineProperty(K,"_source",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.freeze&&(Object.freeze(K.props),Object.freeze(K)),K};function Sd(d,w,A,L,X){{var ee,q={},K=null,xe=null;A!==void 0&&(Go(A),K=""+A),xd(w)&&(Go(w.key),K=""+w.key),vd(w)&&(xe=w.ref,bd(w,X));for(ee in w)Qt.call(w,ee)&&!yd.hasOwnProperty(ee)&&(q[ee]=w[ee]);if(d&&d.defaultProps){var oe=d.defaultProps;for(ee in oe)q[ee]===void 0&&(q[ee]=oe[ee])}if(K||xe){var ue=typeof d=="function"?d.displayName||d.name||"Unknown":d;K&&Td(q,ue),xe&&wd(q,ue)}return Pd(d,K,xe,X,L,Vt.current,q)}}var Or=b.ReactCurrentOwner,Xo=b.ReactDebugCurrentFrame;function lt(d){if(d){var w=d._owner,A=qe(d.type,d._source,w?w.type:null);Xo.setExtraStackFrame(A)}else Xo.setExtraStackFrame(null)}var Lr;Lr=!1;function kr(d){return typeof d=="object"&&d!==null&&d.$$typeof===t}function Zo(){{if(Or.current){var d=ce(Or.current.type);if(d)return`
6
6
 
7
7
  Check the render method of \``+d+"`."}return""}}function Cd(d){{if(d!==void 0){var w=d.fileName.replace(/^.*[\\\/]/,""),A=d.lineNumber;return`
8
8
 
@@ -16,6 +16,6 @@ Check the top-level render call using <`+A+">.")}return w}}function Qo(d,w){{if(
16
16
  ${h}px !important;
17
17
  top: ${c}px !important;
18
18
  }
19
- `),()=>{document.head.removeChild(m)}},[t]),g.exports.jsx(aa,{isPresent:t,childRef:s,sizeRef:i,children:tn.cloneElement(e,{ref:s})})}const ua=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l})=>{const a=rn(ca),c=v.useId(),u=v.useCallback(h=>{a.set(h,!0);for(const m of a.values())if(!m)return;r&&r()},[a,r]),f=v.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:h=>(a.set(h,!1),()=>a.delete(h))}),i?[Math.random(),u]:[n,u]);return v.useMemo(()=>{a.forEach((h,m)=>a.set(m,!1))},[n]),tn.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),o==="popLayout"&&(e=g.exports.jsx(la,{isPresent:n,anchorX:l,children:e})),g.exports.jsx(Lt.Provider,{value:f,children:e})};function ca(){return new Map}function Fr(e=!0){const t=v.useContext(Lt);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 kt=e=>e.key||"";function Nr(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const on=typeof window<"u",Br=on?v.useLayoutEffect:v.useEffect,$r=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left"})=>{const[a,c]=Fr(o),u=v.useMemo(()=>Nr(e),[e]),f=o&&!a?[]:u.map(kt),h=v.useRef(!0),m=v.useRef(u),x=rn(()=>new Map),[y,P]=v.useState(u),[b,S]=v.useState(u);Br(()=>{h.current=!1,m.current=u;for(let p=0;p<b.length;p++){const M=kt(b[p]);f.includes(M)?x.delete(M):x.get(M)!==!0&&x.set(M,!1)}},[b,f.length,f.join("-")]);const C=[];if(u!==y){let p=[...u];for(let M=0;M<b.length;M++){const U=b[M],R=kt(U);f.includes(R)||(p.splice(M,0,U),C.push(U))}return i==="wait"&&C.length&&(p=C),S(Nr(p)),P(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(nn);return g.exports.jsx(g.exports.Fragment,{children:b.map(p=>{const M=kt(p),U=o&&!a?!1:u===b||f.includes(M),R=()=>{if(x.has(M))x.set(M,!0);else return;let Q=!0;x.forEach(Y=>{Y||(Q=!1)}),Q&&(D==null||D(),S(m.current),o&&(c==null||c()),r&&r())};return g.exports.jsx(ua,{isPresent:U,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,onExitComplete:U?void 0:R,anchorX:l,children:p},M)})})},be=e=>e;let He=be,Le=be;process.env.NODE_ENV!=="production"&&(He=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Le=(e,t)=>{if(!e)throw new Error(t)});function an(e){let t;return()=>(t===void 0&&(t=e()),t)}const Xe=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Ae=e=>e*1e3,Re=e=>e/1e3,Ur={skipAnimations:!1,useManualTiming:!1},_t=["read","resolveKeyframes","update","preRender","render","postRender"],ke={value:null,addProjectionMetrics:null};function fa(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},a=0;function c(f){o.has(f)&&(u.schedule(f),e()),a++,f(l)}const u={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(l=f,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),t&&ke.value&&ke.value.frameloop[t].push(a),a=0,n.clear(),s=!1,i&&(i=!1,u.process(f))}};return u}const da=40;function Wr(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=_t.reduce((b,S)=>(b[S]=fa(i,t?S:void 0),b),{}),{read:l,resolveKeyframes:a,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,da),1),s.timestamp=b,s.isProcessing=!0,l.process(s),a.process(s),c.process(s),u.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(m))},x=()=>{n=!0,r=!0,s.isProcessing||e(m)};return{schedule:_t.reduce((b,S)=>{const C=o[S];return b[S]=(D,p=!1,M=!1)=>(n||x(),C.schedule(D,p,M)),b},{}),cancel:b=>{for(let S=0;S<_t.length;S++)o[_t[S]].cancel(b)},state:s,steps:o}}const{schedule:te,cancel:_e,state:he,steps:ln}=Wr(typeof requestAnimationFrame<"u"?requestAnimationFrame:be,!0),zr=v.createContext({strict:!1}),Yr={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"]},Ze={};for(const e in Yr)Ze[e]={isEnabled:t=>Yr[e].some(n=>!!t[n])};function ha(e){for(const t in e)Ze[t]={...Ze[t],...e[t]}}const pa=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 It(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||pa.has(e)}let Kr=e=>!It(e);function ma(e){e&&(Kr=t=>t.startsWith("on")?!It(t):e(t))}try{ma(require("@emotion/is-prop-valid").default)}catch{}function ga(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Kr(s)||n===!0&&It(s)||!t&&!It(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Gr=new Set;function Ft(e,t,n){e||Gr.has(t)||(console.warn(t),n&&console.warn(n),Gr.add(t))}function ya(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 Nt=v.createContext({});function Bt(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function dt(e){return typeof e=="string"||Array.isArray(e)}const un=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],cn=["initial",...un];function $t(e){return Bt(e.animate)||cn.some(t=>dt(e[t]))}function qr(e){return Boolean($t(e)||e.variants)}function va(e,t){if($t(e)){const{initial:n,animate:r}=e;return{initial:n===!1||dt(n)?n:void 0,animate:dt(r)?r:void 0}}return e.inherit!==!1?t:{}}function xa(e){const{initial:t,animate:n}=va(e,v.useContext(Nt));return v.useMemo(()=>({initial:t,animate:n}),[Hr(t),Hr(n)])}function Hr(e){return Array.isArray(e)?e.join(" "):e}const ba=Symbol.for("motionComponentSymbol");function Je(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ta(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):Je(n)&&(n.current=r))},[t])}const fn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Xr="data-"+fn("framerAppearId"),{schedule:dn,cancel:Id}=Wr(queueMicrotask,!1),Zr=v.createContext({});function wa(e,t,n,r,s){var i,o;const{visualElement:l}=v.useContext(Nt),a=v.useContext(zr),c=v.useContext(Lt),u=v.useContext(sn).reducedMotion,f=v.useRef(null);r=r||a.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=f.current,m=v.useContext(Zr);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&Pa(f.current,n,s,m);const x=v.useRef(!1);v.useInsertionEffect(()=>{h&&x.current&&h.update(n,c)});const y=n[Xr],P=v.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 Br(()=>{h&&(x.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),dn.render(h.render),P.current&&h.animationState&&h.animationState.animateChanges())}),v.useEffect(()=>{h&&(!P.current&&h.animationState&&h.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,y)}),P.current=!1))}),h}function Pa(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:a,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Jr(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:Boolean(o)||l&&Je(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:a,layoutRoot:c})}function Jr(e){if(e)return e.options.allowProjection!==!1?e.projection:Jr(e.parent)}function Sa({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,o;e&&ha(e);function l(c,u){let f;const h={...v.useContext(sn),...c,layoutId:Ca(c)},{isStatic:m}=h,x=xa(c),y=r(c,m);if(!m&&on){Ea(h,e);const P=Aa(h);f=P.MeasureLayout,x.visualElement=wa(s,y,h,t,P.ProjectionNode)}return g.exports.jsxs(Nt.Provider,{value:x,children:[f&&x.visualElement?g.exports.jsx(f,{visualElement:x.visualElement,...h}):null,n(s,c,Ta(y,x.visualElement,u),y,m,x.visualElement)]})}l.displayName=`motion.${typeof s=="string"?s:`create(${(o=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&o!==void 0?o:""})`}`;const a=v.forwardRef(l);return a[ba]=s,a}function Ca({layoutId:e}){const t=v.useContext(nn).id;return t&&e!==void 0?t+"-"+e:e}function Ea(e,t){const n=v.useContext(zr).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?He(!1,r):Le(!1,r)}}function Aa(e){const{drag:t,layout:n}=Ze;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 Qr=e=>t=>typeof t=="string"&&t.startsWith(e),hn=Qr("--"),ja=Qr("var(--"),pn=e=>ja(e)?Ma.test(e.split("/*")[0].trim()):!1,Ma=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ht={};function Da(e){for(const t in e)ht[t]=e[t],hn(t)&&(ht[t].isCSSVariable=!0)}const Qe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ue=new Set(Qe);function es(e,{layout:t,layoutId:n}){return Ue.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ht[e]||e==="opacity")}const pe=e=>Boolean(e&&e.getVelocity),ts=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ve=(e,t,n)=>n>t?t:n<e?e:n,et={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},pt={...et,transform:e=>Ve(0,1,e)},Ut={...et,default:1},mt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ie=mt("deg"),je=mt("%"),V=mt("px"),Ra=mt("vh"),Va=mt("vw"),ns={...je,parse:e=>je.parse(e)/100,transform:e=>je.transform(e*100)},Oa={borderWidth:V,borderTopWidth:V,borderRightWidth:V,borderBottomWidth:V,borderLeftWidth:V,borderRadius:V,radius:V,borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,width:V,maxWidth:V,height:V,maxHeight:V,top:V,right:V,bottom:V,left:V,padding:V,paddingTop:V,paddingRight:V,paddingBottom:V,paddingLeft:V,margin:V,marginTop:V,marginRight:V,marginBottom:V,marginLeft:V,backgroundPositionX:V,backgroundPositionY:V},La={rotate:Ie,rotateX:Ie,rotateY:Ie,rotateZ:Ie,scale:Ut,scaleX:Ut,scaleY:Ut,scaleZ:Ut,skew:Ie,skewX:Ie,skewY:Ie,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,transformPerspective:V,opacity:pt,originX:ns,originY:ns,originZ:V},rs={...et,transform:Math.round},mn={...Oa,...La,zIndex:rs,size:V,fillOpacity:pt,strokeOpacity:pt,numOctaves:rs},ka={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_a=Qe.length;function Ia(e,t,n){let r="",s=!0;for(let i=0;i<_a;i++){const o=Qe[i],l=e[o];if(l===void 0)continue;let a=!0;if(typeof l=="number"?a=l===(o.startsWith("scale")?1:0):a=parseFloat(l)===0,!a||n){const c=ts(l,mn[o]);if(!a){s=!1;const u=ka[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function gn(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,l=!1;for(const a in t){const c=t[a];if(Ue.has(a)){o=!0;continue}else if(hn(a)){s[a]=c;continue}else{const u=ts(c,mn[a]);a.startsWith("origin")?(l=!0,i[a]=u):r[a]=u}}if(t.transform||(o||n?r.transform=Ia(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:a="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${a} ${c} ${u}`}}const yn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ss(e,t,n){for(const r in t)!pe(t[r])&&!es(r,n)&&(e[r]=t[r])}function Fa({transformTemplate:e},t){return v.useMemo(()=>{const n=yn();return gn(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Na(e,t){const n=e.style||{},r={};return ss(r,n,e),Object.assign(r,Fa(e,t)),r}function Ba(e,t){const n={},r=Na(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 $a=["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 vn(e){return typeof e!="string"||e.includes("-")?!1:!!($a.indexOf(e)>-1||/[A-Z]/u.test(e))}const Ua={offset:"stroke-dashoffset",array:"stroke-dasharray"},Wa={offset:"strokeDashoffset",array:"strokeDasharray"};function za(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?Ua:Wa;e[i.offset]=V.transform(-r);const o=V.transform(t),l=V.transform(n);e[i.array]=`${o} ${l}`}function is(e,t,n){return typeof e=="string"?e:V.transform(t+n*e)}function Ya(e,t,n){const r=is(t,e.x,e.width),s=is(n,e.y,e.height);return`${r} ${s}`}function xn(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:l=1,pathOffset:a=0,...c},u,f){if(gn(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:x}=e;h.transform&&(x&&(m.transform=h.transform),delete h.transform),x&&(s!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=Ya(x,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&&za(h,o,l,a,!1)}const os=()=>({...yn(),attrs:{}}),bn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ka(e,t,n,r){const s=v.useMemo(()=>{const i=os();return xn(i,t,bn(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};ss(i,e.style,e),s.style={...i,...s.style}}return s}function Ga(e=!1){return(n,r,s,{latestValues:i},o)=>{const a=(vn(n)?Ka:Ba)(r,i,o,n),c=ga(r,typeof n=="string",e),u=n!==v.Fragment?{...c,...a,ref:s}:{},{children:f}=r,h=v.useMemo(()=>pe(f)?f.get():f,[f]);return v.createElement(n,{...u,children:h})}}function as(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Tn(e,t,n,r){if(typeof t=="function"){const[s,i]=as(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]=as(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const wn=e=>Array.isArray(e),qa=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),Ha=e=>wn(e)?e[e.length-1]||0:e;function Wt(e){const t=pe(e)?e.get():e;return qa(t)?t.toValue():t}function Xa({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const o={latestValues:Za(r,s,i,e),renderState:t()};return n&&(o.onMount=l=>n({props:r,current:l,...o}),o.onUpdate=l=>n(l)),o}const ls=e=>(t,n)=>{const r=v.useContext(Nt),s=v.useContext(Lt),i=()=>Xa(e,t,r,s);return n?i():rn(i)};function Za(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=Wt(i[h]);let{initial:o,animate:l}=e;const a=$t(e),c=qr(e);t&&c&&!a&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?l:o;if(f&&typeof f!="boolean"&&!Bt(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const x=Tn(e,h[m]);if(x){const{transitionEnd:y,transition:P,...b}=x;for(const S in b){let C=b[S];if(Array.isArray(C)){const D=u?C.length-1:0;C=C[D]}C!==null&&(s[S]=C)}for(const S in y)s[S]=y[S]}}}return s}function Pn(e,t,n){var r;const{style:s}=e,i={};for(const o in s)(pe(s[o])||t.style&&pe(t.style[o])||es(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 Ja={useVisualState:ls({scrapeMotionValuesFromProps:Pn,createRenderState:yn})};function us(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 cs(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 fs=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 ds(e,t,n,r){cs(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(fs.has(s)?s:fn(s),t.attrs[s])}function hs(e,t,n){const r=Pn(e,t,n);for(const s in e)if(pe(e[s])||pe(t[s])){const i=Qe.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}const ps=["x","y","width","height","cx","cy","r"],Qa={useVisualState:ls({scrapeMotionValuesFromProps:hs,createRenderState:os,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in s)if(Ue.has(l)){i=!0;break}}if(!i)return;let o=!t;if(t)for(let l=0;l<ps.length;l++){const a=ps[l];e[a]!==t[a]&&(o=!0)}o&&te.read(()=>{us(n,r),te.render(()=>{xn(r,s,bn(n.tagName),e.transformTemplate),ds(n,r)})})}})};function el(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...vn(r)?Qa:Ja,preloadedFeatures:e,useRender:Ga(s),createVisualElement:t,Component:r};return Sa(o)}}function gt(e,t,n){const r=e.getProps();return Tn(r,t,n!==void 0?n:r.custom,e)}const tl=an(()=>window.ScrollTimeline!==void 0);class nl{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(tl()&&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 rl extends nl{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Sn(e,t){return e?e[t]||e.default||e:void 0}const Cn=2e4;function ms(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Cn;)t+=n,r=e.next(t);return t>=Cn?1/0:t}function En(e){return typeof e=="function"}function gs(e,t){e.timeline=t,e.onfinish=null}const An=e=>Array.isArray(e)&&typeof e[0]=="number",sl={linearEasing:void 0};function il(e,t){const n=an(e);return()=>{var r;return(r=sl[t])!==null&&r!==void 0?r:n()}}const zt=il(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ys=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=e(Xe(0,s-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function vs(e){return Boolean(typeof e=="function"&&zt()||!e||typeof e=="string"&&(e in jn||zt())||An(e)||Array.isArray(e)&&e.every(vs))}const yt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,jn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yt([0,.65,.55,1]),circOut:yt([.55,0,1,.45]),backIn:yt([.31,.01,.66,-.59]),backOut:yt([.33,1.53,.69,.99])};function xs(e,t){if(e)return typeof e=="function"&&zt()?ys(e,t):An(e)?yt(e):Array.isArray(e)?e.map(n=>xs(n,t)||jn.easeOut):jn[e]}const Ee={x:!1,y:!1};function bs(){return Ee.x||Ee.y}function ol(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 Ts(e,t){const n=ol(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function ws(e){return!(e.pointerType==="touch"||bs())}function al(e,t,n={}){const[r,s,i]=Ts(e,n),o=l=>{if(!ws(l))return;const{target:a}=l,c=t(a,l);if(typeof c!="function"||!a)return;const u=f=>{ws(f)&&(c(f),a.removeEventListener("pointerleave",u))};a.addEventListener("pointerleave",u,s)};return r.forEach(l=>{l.addEventListener("pointerenter",o,s)}),i}function Yt(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 Ps=(e,t)=>t?e===t?!0:Ps(e,t.parentElement):!1,Mn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,ll=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ul(e){return ll.has(e.tagName)||e.tabIndex!==-1}const vt=new WeakSet;function Ss(e){return t=>{t.key==="Enter"&&e(t)}}function Dn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const cl=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Ss(()=>{if(vt.has(n))return;Dn(n,"down");const s=Ss(()=>{Dn(n,"up")}),i=()=>Dn(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 Cs(e){return Mn(e)&&!bs()}function fl(e,t,n={}){const[r,s,i]=Ts(e,n),o=l=>{const a=l.currentTarget;if(!a||!Cs(l)||vt.has(a))return;vt.add(a),Yt(l,"set");const c=t(a,l),u=(m,x)=>{a.removeEventListener("pointerup",f),a.removeEventListener("pointercancel",h),Yt(m,"release"),!(!Cs(m)||!vt.has(a))&&(vt.delete(a),typeof c=="function"&&c(m,{success:x}))},f=m=>{(m.isTrusted?dl(m,a instanceof Element?a.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?u(m,!1):u(m,!(a instanceof Element)||Ps(a,m.target))},h=m=>{u(m,!1)};a.addEventListener("pointerup",f,s),a.addEventListener("pointercancel",h,s),a.addEventListener("lostpointercapture",h,s)};return r.forEach(l=>{l=n.useGlobalTarget?window:l;let a=!1;l instanceof HTMLElement&&(a=!0,!ul(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0)),l.addEventListener("pointerdown",o,s),a&&l.addEventListener("focus",c=>cl(c,s),s)}),i}function dl(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function hl(e){return e==="x"||e==="y"?Ee[e]?null:(Ee[e]=!0,()=>{Ee[e]=!1}):Ee.x||Ee.y?null:(Ee.x=Ee.y=!0,()=>{Ee.x=Ee.y=!1})}const Es=new Set(["width","height","top","left","right","bottom",...Qe]);let Kt;function pl(){Kt=void 0}const Me={now:()=>(Kt===void 0&&Me.set(he.isProcessing||Ur.useManualTiming?he.timestamp:performance.now()),Kt),set:e=>{Kt=e,queueMicrotask(pl)}};function Rn(e,t){e.indexOf(t)===-1&&e.push(t)}function Vn(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class On{constructor(){this.subscriptions=[]}add(t){return Rn(this.subscriptions,t),()=>Vn(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 As(e,t){return t?e*(1e3/t):0}const js=30,ml=e=>!isNaN(parseFloat(e));class gl{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Me.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=Me.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ml(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 On);const r=this.events[t].add(n);return t==="change"?()=>{r(),te.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=Me.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>js)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,js);return As(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 xt(e,t){return new gl(e,t)}function yl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,xt(n))}function vl(e,t){const n=gt(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=Ha(i[o]);yl(e,o,l)}}function xl(e){return Boolean(pe(e)&&e.add)}function Ln(e,t){const n=e.getValue("willChange");if(xl(n))return n.add(t)}function Ms(e){return e.props[Xr]}const bl={current:!1},Ds=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Tl=1e-7,wl=12;function Pl(e,t,n,r,s){let i,o,l=0;do o=t+(n-t)/2,i=Ds(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>Tl&&++l<wl);return o}function bt(e,t,n,r){if(e===t&&n===r)return be;const s=i=>Pl(i,0,1,e,n);return i=>i===0||i===1?i:Ds(s(i),t,r)}const Rs=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Vs=e=>t=>1-e(1-t),Os=bt(.33,1.53,.69,.99),kn=Vs(Os),Ls=Rs(kn),ks=e=>(e*=2)<1?.5*kn(e):.5*(2-Math.pow(2,-10*(e-1))),_n=e=>1-Math.sin(Math.acos(e)),_s=Vs(_n),Is=Rs(_n),Fs=e=>/^0[^.\s]+$/u.test(e);function Sl(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Fs(e):!0}const Tt=e=>Math.round(e*1e5)/1e5,In=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Cl(e){return e==null}const El=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Fn=(e,t)=>n=>Boolean(typeof n=="string"&&El.test(n)&&n.startsWith(e)||t&&!Cl(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ns=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(In);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Al=e=>Ve(0,255,e),Nn={...et,transform:e=>Math.round(Al(e))},We={test:Fn("rgb","red"),parse:Ns("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Nn.transform(e)+", "+Nn.transform(t)+", "+Nn.transform(n)+", "+Tt(pt.transform(r))+")"};function jl(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 Bn={test:Fn("#"),parse:jl,transform:We.transform},tt={test:Fn("hsl","hue"),parse:Ns("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+je.transform(Tt(t))+", "+je.transform(Tt(n))+", "+Tt(pt.transform(r))+")"},me={test:e=>We.test(e)||Bn.test(e)||tt.test(e),parse:e=>We.test(e)?We.parse(e):tt.test(e)?tt.parse(e):Bn.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?We.transform(e):tt.transform(e)},Ml=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Dl(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(In))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Ml))===null||n===void 0?void 0:n.length)||0)>0}const Bs="number",$s="color",Rl="var",Vl="var(",Us="${}",Ol=/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 wt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=t.replace(Ol,a=>(me.test(a)?(r.color.push(i),s.push($s),n.push(me.parse(a))):a.startsWith(Vl)?(r.var.push(i),s.push(Rl),n.push(a)):(r.number.push(i),s.push(Bs),n.push(parseFloat(a))),++i,Us)).split(Us);return{values:n,split:l,indexes:r,types:s}}function Ws(e){return wt(e).values}function zs(e){const{split:t,types:n}=wt(e),r=t.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],s[o]!==void 0){const l=n[o];l===Bs?i+=Tt(s[o]):l===$s?i+=me.transform(s[o]):i+=s[o]}return i}}const Ll=e=>typeof e=="number"?0:e;function kl(e){const t=Ws(e);return zs(e)(t.map(Ll))}const Fe={test:Dl,parse:Ws,createTransformer:zs,getAnimatableNone:kl},_l=new Set(["brightness","contrast","saturate","opacity"]);function Il(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(In)||[];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 Fl=/\b([a-z-]*)\(.*?\)/gu,$n={...Fe,getAnimatableNone:e=>{const t=e.match(Fl);return t?t.map(Il).join(" "):e}},Nl={...mn,color:me,backgroundColor:me,outlineColor:me,fill:me,stroke:me,borderColor:me,borderTopColor:me,borderRightColor:me,borderBottomColor:me,borderLeftColor:me,filter:$n,WebkitFilter:$n},Un=e=>Nl[e];function Ys(e,t){let n=Un(e);return n!==$n&&(n=Fe),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Bl=new Set(["auto","none","0"]);function $l(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!Bl.has(i)&&wt(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=Ys(n,s)}const Ks=e=>e===et||e===V,Gs=(e,t)=>parseFloat(e.split(", ")[t]),qs=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Gs(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Gs(i[1],e):0}},Ul=new Set(["x","y","z"]),Wl=Qe.filter(e=>!Ul.has(e));function zl(e){const t=[];return Wl.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const nt={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:qs(4,13),y:qs(5,14)};nt.translateX=nt.x,nt.translateY=nt.y;const ze=new Set;let Wn=!1,zn=!1;function Hs(){if(zn){const e=Array.from(ze).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=zl(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 l;(l=r.getValue(i))===null||l===void 0||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}zn=!1,Wn=!1,ze.forEach(e=>e.complete()),ze.clear()}function Xs(){ze.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zn=!0)})}function Yl(){Xs(),Hs()}class Yn{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?(ze.add(this),Wn||(Wn=!0,te.read(Xs),te.resolveKeyframes(Hs))):(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(),l=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const a=r.readValue(n,l);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=l),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),ze.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ze.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Zs=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Kl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Gl(e){const t=Kl.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const ql=4;function Js(e,t,n=1){Le(n<=ql,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,s]=Gl(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return Zs(o)?parseFloat(o):o}return pn(s)?Js(s,t,n+1):s}const Qs=e=>t=>t.test(e),ei=[et,V,je,Ie,Va,Ra,{test:e=>e==="auto",parse:e=>e}],ti=e=>ei.find(Qs(e));class ni extends Yn{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 a=0;a<t.length;a++){let c=t[a];if(typeof c=="string"&&(c=c.trim(),pn(c))){const u=Js(c,n.current);u!==void 0&&(t[a]=u),a===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Es.has(r)||t.length!==2)return;const[s,i]=t,o=ti(s),l=ti(i);if(o!==l)if(Ks(o)&&Ks(l))for(let a=0;a<t.length;a++){const c=t[a];typeof c=="string"&&(t[a]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)Sl(t[s])&&r.push(s);r.length&&$l(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=nt[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,l=s[o];s[o]=nt[r](n.measureViewportBox(),window.getComputedStyle(n.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([a,c])=>{n.getValue(a).set(c)}),this.resolveNoneKeyframes()}}const ri=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Fe.test(e)||e==="0")&&!e.startsWith("url("));function Hl(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 Xl(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=ri(s,t),l=ri(i,t);return He(o===l,`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||!l?!1:Hl(e)||(n==="spring"||En(n))&&r}const Zl=e=>e!==null;function Gt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(Zl),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const Jl=40;class si{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Me.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Jl?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Yl(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Me.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:l,onUpdate:a,isGenerator:c}=this.options;if(!c&&!Xl(t,r,s,i))if(o)this.options.duration=0;else{a&&a(Gt(t,this.options,n)),l&&l(),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 Pt={layout:0,mainThread:0,waapi:0},ne=(e,t,n)=>e+(t-e)*n;function Kn(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 Ql({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 l=n<.5?n*(1+t):n+t-n*t,a=2*n-l;s=Kn(a,l,e+1/3),i=Kn(a,l,e),o=Kn(a,l,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 Gn=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},eu=[Bn,We,tt],tu=e=>eu.find(t=>t.test(e));function ii(e){const t=tu(e);if(He(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===tt&&(n=Ql(n)),n}const oi=(e,t)=>{const n=ii(e),r=ii(t);if(!n||!r)return qt(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=ne(n.alpha,r.alpha,i),We.transform(s))},nu=(e,t)=>n=>t(e(n)),St=(...e)=>e.reduce(nu),qn=new Set(["none","hidden"]);function ru(e,t){return qn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function su(e,t){return n=>ne(e,t,n)}function Hn(e){return typeof e=="number"?su:typeof e=="string"?pn(e)?qt:me.test(e)?oi:au:Array.isArray(e)?ai:typeof e=="object"?me.test(e)?oi:iu:qt}function ai(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Hn(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function iu(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Hn(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function ou(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],l=e.indexes[o][s[o]],a=(n=e.values[l])!==null&&n!==void 0?n:0;r[i]=a,s[o]++}return r}const au=(e,t)=>{const n=Fe.createTransformer(t),r=wt(e),s=wt(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?ru(e,t):St(ai(ou(r,s),s.values),n):(He(!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 li(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ne(e,t,n):Hn(e)(e,t)}const lu=5;function ui(e,t,n){const r=Math.max(t-lu,0);return As(n-e(r),t-r)}const re={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},Xn=.001;function uu({duration:e=re.duration,bounce:t=re.bounce,velocity:n=re.velocity,mass:r=re.mass}){let s,i;He(e<=Ae(re.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=Ve(re.minDamping,re.maxDamping,o),e=Ve(re.minDuration,re.maxDuration,Re(e)),o<1?(s=c=>{const u=c*o,f=u*e,h=u-n,m=Zn(c,o),x=Math.exp(-f);return Xn-h/m*x},i=c=>{const f=c*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(c,2)*e,x=Math.exp(-f),y=Zn(Math.pow(c,2),o);return(-s(c)+Xn>0?-1:1)*((h-m)*x)/y}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Xn+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const l=5/e,a=fu(s,i,l);if(e=Ae(e),isNaN(a))return{stiffness:re.stiffness,damping:re.damping,duration:e};{const c=Math.pow(a,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const cu=12;function fu(e,t,n){let r=n;for(let s=1;s<cu;s++)r=r-e(r)/t(r);return r}function Zn(e,t){return e*Math.sqrt(1-t*t)}const du=["duration","bounce"],hu=["stiffness","damping","mass"];function ci(e,t){return t.some(n=>e[n]!==void 0)}function pu(e){let t={velocity:re.velocity,stiffness:re.stiffness,damping:re.damping,mass:re.mass,isResolvedFromDuration:!1,...e};if(!ci(e,hu)&&ci(e,du))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Ve(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:re.mass,stiffness:s,damping:i}}else{const n=uu(e);t={...t,...n,mass:re.mass},t.isResolvedFromDuration=!0}return t}function fi(e=re.visualDuration,t=re.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],l={done:!1,value:i},{stiffness:a,damping:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:m}=pu({...n,velocity:-Re(n.velocity||0)}),x=h||0,y=c/(2*Math.sqrt(a*u)),P=o-i,b=Re(Math.sqrt(a/u)),S=Math.abs(P)<5;r||(r=S?re.restSpeed.granular:re.restSpeed.default),s||(s=S?re.restDelta.granular:re.restDelta.default);let C;if(y<1){const p=Zn(b,y);C=M=>{const U=Math.exp(-y*b*M);return o-U*((x+y*b*P)/p*Math.sin(p*M)+P*Math.cos(p*M))}}else if(y===1)C=p=>o-Math.exp(-b*p)*(P+(x+b*P)*p);else{const p=b*Math.sqrt(y*y-1);C=M=>{const U=Math.exp(-y*b*M),R=Math.min(p*M,300);return o-U*((x+y*b*P)*Math.sinh(R)+p*P*Math.cosh(R))/p}}const D={calculatedDuration:m&&f||null,next:p=>{const M=C(p);if(m)l.done=p>=f;else{let U=0;y<1&&(U=p===0?Ae(x):ui(C,p,M));const R=Math.abs(U)<=r,Q=Math.abs(o-M)<=s;l.done=R&&Q}return l.value=l.done?o:M,l},toString:()=>{const p=Math.min(ms(D),Cn),M=ys(U=>D.next(p*U).value,p,30);return p+"ms "+M}};return D}function di({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:a,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},m=R=>l!==void 0&&R<l||a!==void 0&&R>a,x=R=>l===void 0?a:a===void 0||Math.abs(l-R)<Math.abs(a-R)?l:a;let y=n*t;const P=f+y,b=o===void 0?P:o(P);b!==P&&(y=b-f);const S=R=>-y*Math.exp(-R/r),C=R=>b+S(R),D=R=>{const Q=S(R),Y=C(R);h.done=Math.abs(Q)<=c,h.value=h.done?b:Y};let p,M;const U=R=>{m(h.value)&&(p=R,M=fi({keyframes:[h.value,x(h.value)],velocity:ui(C,R,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return U(0),{calculatedDuration:null,next:R=>{let Q=!1;return!M&&p===void 0&&(Q=!0,D(R),U(R)),p!==void 0&&R>=p?M.next(R-p):(!Q&&D(R),h)}}}const mu=bt(.42,0,1,1),gu=bt(0,0,.58,1),hi=bt(.42,0,.58,1),yu=e=>Array.isArray(e)&&typeof e[0]!="number",pi={linear:be,easeIn:mu,easeInOut:hi,easeOut:gu,circIn:_n,circInOut:Is,circOut:_s,backIn:kn,backInOut:Ls,backOut:Os,anticipate:ks},mi=e=>{if(An(e)){Le(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,s]=e;return bt(t,n,r,s)}else if(typeof e=="string")return Le(pi[e]!==void 0,`Invalid easing type '${e}'`),pi[e];return e};function vu(e,t,n){const r=[],s=n||li,i=e.length-1;for(let o=0;o<i;o++){let l=s(e[o],e[o+1]);if(t){const a=Array.isArray(t)?t[o]||be:t;l=St(a,l)}r.push(l)}return r}function xu(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Le(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 l=vu(t,r,s),a=l.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(a>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=Xe(e[f],e[f+1],u);return l[f](h)};return n?u=>c(Ve(e[0],e[i-1],u)):c}function bu(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Xe(0,t,r);e.push(ne(n,1,s))}}function Tu(e){const t=[0];return bu(t,e.length-1),t}function wu(e,t){return e.map(n=>n*t)}function Pu(e,t){return e.map(()=>t||hi).splice(0,e.length-1)}function Ct({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=yu(r)?r.map(mi):mi(r),i={done:!1,value:t[0]},o=wu(n&&n.length===t.length?n:Tu(t),e),l=xu(o,t,{ease:Array.isArray(s)?s:Pu(t,s)});return{calculatedDuration:e,next:a=>(i.value=l(a),i.done=a>=e,i)}}const Su=e=>{const t=({timestamp:n})=>e(n);return{start:()=>te.update(t,!0),stop:()=>_e(t),now:()=>he.isProcessing?he.timestamp:Me.now()}},Cu={decay:di,inertia:di,tween:Ct,keyframes:Ct,spring:fi},Eu=e=>e/100;class Jn extends si{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:a}=this.options;a&&a()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,o=(s==null?void 0:s.KeyframeResolver)||Yn,l=(a,c)=>this.onKeyframesResolved(a,c);this.resolver=new o(i,l,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,l=En(n)?n:Cu[n]||Ct;let a,c;process.env.NODE_ENV!=="production"&&l!==Ct&&Le(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),l!==Ct&&typeof t[0]!="number"&&(a=St(Eu,li(t[0],t[1])),t=[0,100]);const u=l({...this.options,keyframes:t});i==="mirror"&&(c=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=ms(u));const{calculatedDuration:f}=u,h=f+s,m=h*(r+1)-s;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:a,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:l,keyframes:a,calculatedDuration:c,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:m,repeatType:x,repeatDelay:y,onUpdate:P}=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),S=this.speed>=0?b<0:b>u;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let C=this.currentTime,D=i;if(m){const R=Math.min(this.currentTime,u)/f;let Q=Math.floor(R),Y=R%1;!Y&&R>=1&&(Y=1),Y===1&&Q--,Q=Math.min(Q,m+1),Boolean(Q%2)&&(x==="reverse"?(Y=1-Y,y&&(Y-=y/f)):x==="mirror"&&(D=o)),C=Ve(0,1,Y)*f}const p=S?{done:!1,value:a[0]}:D.next(C);l&&(p.value=l(p.value));let{done:M}=p;!S&&c!==null&&(M=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const U=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return U&&s!==void 0&&(p.value=Gt(a,this.options,s)),P&&P(p.value),U&&this.finish(),p}get duration(){const{resolved:t}=this;return t?Re(t.calculatedDuration):0}get time(){return Re(this.currentTime)}set time(t){t=Ae(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=Re(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Su,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 Au=new Set(["opacity","clipPath","filter","transform"]);function ju(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeInOut",times:a}={}){const c={[t]:n};a&&(c.offset=a);const u=xs(l,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 Mu=an(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Ht=10,Du=2e4;function Ru(e){return En(e.type)||e.type==="spring"||!vs(e.ease)}function Vu(e,t){const n=new Jn({...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<Du;)r=n.sample(i),s.push(r.value),i+=Ht;return{times:void 0,keyframes:s,duration:i-Ht,ease:"linear"}}const gi={anticipate:ks,backInOut:Ls,circInOut:Is};function Ou(e){return e in gi}class yi extends si{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:i}=this.options;this.resolver=new ni(i,(o,l)=>this.onKeyframesResolved(o,l),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:o,motionValue:l,name:a,startTime:c}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&zt()&&Ou(i)&&(i=gi[i]),Ru(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:x,...y}=this.options,P=Vu(t,y);t=P.keyframes,t.length===1&&(t[1]=t[0]),r=P.duration,s=P.times,i=P.ease,o="keyframes"}const u=ju(l.owner.current,a,t,{...this.options,duration:r,times:s,ease:i});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(gs(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;l.set(Gt(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 Re(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Re(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Ae(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 be;const{animation:r}=n;gs(r,t)}return be}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:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:f,element:h,...m}=this.options,x=new Jn({...m,keyframes:r,duration:s,type:i,ease:o,times:l,isGenerator:!0}),y=Ae(this.time);c.setWithVelocity(x.sample(y-Ht).value,x.sample(y).value,Ht)}const{onStop:a}=this.options;a&&a(),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:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:c}=n.owner.getProps();return Mu()&&r&&Au.has(r)&&!a&&!c&&!s&&i!=="mirror"&&o!==0&&l!=="inertia"}}const Lu={type:"spring",stiffness:500,damping:25,restSpeed:10},ku=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),_u={type:"keyframes",duration:.8},Iu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fu=(e,{keyframes:t})=>t.length>2?_u:Ue.has(e)?e.startsWith("scale")?ku(t[1]):Lu:Iu;function Nu({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:l,from:a,elapsed:c,...u}){return!!Object.keys(u).length}const Qn=(e,t,n,r={},s,i)=>o=>{const l=Sn(r,e)||{},a=l.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Ae(a);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-c,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:s};Nu(l)||(u={...u,...Fu(e,u)}),u.duration&&(u.duration=Ae(u.duration)),u.repeatDelay&&(u.repeatDelay=Ae(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)),(bl.current||Ur.skipAnimations)&&(f=!0,u.duration=0,u.delay=0),f&&!i&&t.get()!==void 0){const h=Gt(u.keyframes,l);if(h!==void 0)return te.update(()=>{u.onUpdate(h),u.onComplete()}),new rl([])}return!i&&yi.supports(u)?new yi(u):new Jn(u)};function Bu({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function vi(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...a}=t;r&&(o=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const f in a){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),m=a[f];if(m===void 0||u&&Bu(u,f))continue;const x={delay:n,...Sn(o||{},f)};let y=!1;if(window.MotionHandoffAnimation){const b=Ms(e);if(b){const S=window.MotionHandoffAnimation(b,f,te);S!==null&&(x.startTime=S,y=!0)}}Ln(e,f),h.start(Qn(f,h,m,e.shouldReduceMotion&&Es.has(f)?{type:!1}:x,e,y));const P=h.animation;P&&c.push(P)}return l&&Promise.all(c).then(()=>{te.update(()=>{l&&vl(e,l)})}),c}function er(e,t,n={}){var r;const s=gt(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(vi(e,s,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=i;return $u(e,t,u+c,f,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[o,l]:[l,o];return c().then(()=>u())}else return Promise.all([o(),l(n.delay)])}function $u(e,t,n=0,r=0,s=1,i){const o=[],l=(e.variantChildren.size-1)*r,a=s===1?(c=0)=>c*r:(c=0)=>l-c*r;return Array.from(e.variantChildren).sort(Uu).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(er(c,t,{...i,delay:n+a(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function Uu(e,t){return e.sortNodePosition(t)}function Wu(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>er(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=er(e,t,n);else{const s=typeof t=="function"?gt(e,t,n.custom):t;r=Promise.all(vi(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function xi(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 zu=cn.length;function bi(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?bi(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<zu;n++){const r=cn[n],s=e.props[r];(dt(s)||s===!1)&&(t[r]=s)}return t}const Yu=[...un].reverse(),Ku=un.length;function Gu(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Wu(e,n,r)))}function qu(e){let t=Gu(e),n=Ti(),r=!0;const s=a=>(c,u)=>{var f;const h=gt(e,u,a==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:x,...y}=h;c={...c,...y,...x}}return c};function i(a){t=a(e)}function o(a){const{props:c}=e,u=bi(e.parent)||{},f=[],h=new Set;let m={},x=1/0;for(let P=0;P<Ku;P++){const b=Yu[P],S=n[b],C=c[b]!==void 0?c[b]:u[b],D=dt(C),p=b===a?S.isActive:null;p===!1&&(x=P);let M=C===u[b]&&C!==c[b]&&D;if(M&&r&&e.manuallyAnimateOnMount&&(M=!1),S.protectedKeys={...m},!S.isActive&&p===null||!C&&!S.prevProp||Bt(C)||typeof C=="boolean")continue;const U=Hu(S.prevProp,C);let R=U||b===a&&S.isActive&&!M&&D||P>x&&D,Q=!1;const Y=Array.isArray(C)?C:[C];let ae=Y.reduce(s(b),{});p===!1&&(ae={});const{prevResolvedValues:Te={}}=S,ce={...Te,...ae},se=O=>{R=!0,h.has(O)&&(Q=!0,h.delete(O)),S.needsAnimating[O]=!0;const k=e.getValue(O);k&&(k.liveStyle=!1)};for(const O in ce){const k=ae[O],le=Te[O];if(m.hasOwnProperty(O))continue;let T=!1;wn(k)&&wn(le)?T=!xi(k,le):T=k!==le,T?k!=null?se(O):h.add(O):k!==void 0&&h.has(O)?se(O):S.protectedKeys[O]=!0}S.prevProp=C,S.prevResolvedValues=ae,S.isActive&&(m={...m,...ae}),r&&e.blockInitialAnimation&&(R=!1),R&&(!(M&&U)||Q)&&f.push(...Y.map(O=>({animation:O,options:{type:b}})))}if(h.size){const P={};if(typeof c.initial!="boolean"){const b=gt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);b&&b.transition&&(P.transition=b.transition)}h.forEach(b=>{const S=e.getBaseTarget(b),C=e.getValue(b);C&&(C.liveStyle=!0),P[b]=S??null}),f.push({animation:P})}let y=Boolean(f.length);return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function l(a,c){var u;if(n[a].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(a,c)}),n[a].isActive=c;const f=o(a);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Ti(),r=!0}}}function Hu(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!xi(t,e):!1}function Ye(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ti(){return{animate:Ye(!0),whileInView:Ye(),whileHover:Ye(),whileTap:Ye(),whileDrag:Ye(),whileFocus:Ye(),exit:Ye()}}class Ne{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Xu extends Ne{constructor(t){super(t),t.animationState||(t.animationState=qu(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Bt(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 Zu=0;class Ju extends Ne{constructor(){super(...arguments),this.id=Zu++}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 Qu={animation:{Feature:Xu},exit:{Feature:Ju}};function Et(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function At(e){return{point:{x:e.pageX,y:e.pageY}}}const ec=e=>t=>Mn(t)&&e(t,At(t));function rt(e,t,n,r){return Et(e,t,ec(n),r)}function wi({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function tc({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function nc(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 Pi=1e-4,rc=1-Pi,sc=1+Pi,Si=.01,ic=0-Si,oc=0+Si;function ye(e){return e.max-e.min}function ac(e,t,n){return Math.abs(e-t)<=n}function Ci(e,t,n,r=.5){e.origin=r,e.originPoint=ne(t.min,t.max,e.origin),e.scale=ye(n)/ye(t),e.translate=ne(n.min,n.max,e.origin)-e.originPoint,(e.scale>=rc&&e.scale<=sc||isNaN(e.scale))&&(e.scale=1),(e.translate>=ic&&e.translate<=oc||isNaN(e.translate))&&(e.translate=0)}function jt(e,t,n,r){Ci(e.x,t.x,n.x,r?r.originX:void 0),Ci(e.y,t.y,n.y,r?r.originY:void 0)}function Ei(e,t,n){e.min=n.min+t.min,e.max=e.min+ye(t)}function lc(e,t,n){Ei(e.x,t.x,n.x),Ei(e.y,t.y,n.y)}function Ai(e,t,n){e.min=t.min-n.min,e.max=e.min+ye(t)}function Mt(e,t,n){Ai(e.x,t.x,n.x),Ai(e.y,t.y,n.y)}const ji=()=>({translate:0,scale:1,origin:0,originPoint:0}),st=()=>({x:ji(),y:ji()}),Mi=()=>({min:0,max:0}),ie=()=>({x:Mi(),y:Mi()});function we(e){return[e("x"),e("y")]}function tr(e){return e===void 0||e===1}function nr({scale:e,scaleX:t,scaleY:n}){return!tr(e)||!tr(t)||!tr(n)}function Ke(e){return nr(e)||Di(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Di(e){return Ri(e.x)||Ri(e.y)}function Ri(e){return e&&e!=="0%"}function Xt(e,t,n){const r=e-n,s=t*r;return n+s}function Vi(e,t,n,r,s){return s!==void 0&&(e=Xt(e,s,r)),Xt(e,n,r)+t}function rr(e,t=0,n=1,r,s){e.min=Vi(e.min,t,n,r,s),e.max=Vi(e.max,t,n,r,s)}function Oi(e,{x:t,y:n}){rr(e.x,t.translate,t.scale,t.originPoint),rr(e.y,n.translate,n.scale,n.originPoint)}const Li=.999999999999,ki=1.0000000000001;function uc(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let l=0;l<s;l++){i=n[l],o=i.projectionDelta;const{visualElement:a}=i.options;a&&a.props.style&&a.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&ot(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Oi(e,o)),r&&Ke(i.latestValues)&&ot(e,i.latestValues))}t.x<ki&&t.x>Li&&(t.x=1),t.y<ki&&t.y>Li&&(t.y=1)}function it(e,t){e.min=e.min+t,e.max=e.max+t}function _i(e,t,n,r,s=.5){const i=ne(e.min,e.max,s);rr(e,t,n,i,r)}function ot(e,t){_i(e.x,t.x,t.scaleX,t.scale,t.originX),_i(e.y,t.y,t.scaleY,t.scale,t.originY)}function Ii(e,t){return wi(nc(e.getBoundingClientRect(),t))}function cc(e,t,n){const r=Ii(e,n),{scroll:s}=t;return s&&(it(r.x,s.offset.x),it(r.y,s.offset.y)),r}const Fi=(e,t)=>Math.abs(e-t);function fc(e,t){const n=Fi(e.x,t.x),r=Fi(e.y,t.y);return Math.sqrt(n**2+r**2)}class Ni{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=ir(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=fc(u.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:m}=u,{timestamp:x}=he;this.history.push({...m,timestamp:x});const{onStart:y,onMove:P}=this.handlers;f||(y&&y(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),P&&P(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=sr(f,this.transformPagePoint),te.update(this.updatePoint,!0)},this.handlePointerUp=(u,f)=>{Yt(u,"release"),this.end();const{onEnd:h,onSessionEnd:m,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ir(u.type==="pointercancel"||u.type==="lostpointercapture"?this.lastMoveEventInfo:sr(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,y),m&&m(u,y)},!Mn(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r;const i=At(t),o=sr(i,this.transformPagePoint),{point:l}=o,{timestamp:a}=he;this.history=[{...l,timestamp:a}];const{onSessionStart:c}=n;c&&c(t,ir(o,this.history)),Yt(t,"set"),this.removeListeners=St(rt(t.currentTarget,"pointermove",this.handlePointerMove),rt(t.currentTarget,"pointerup",this.handlePointerUp),rt(t.currentTarget,"pointercancel",this.handlePointerUp),rt(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),_e(this.updatePoint)}}function sr(e,t){return t?{point:t(e.point)}:e}function Bi(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ir({point:e},t){return{point:e,delta:Bi(e,$i(t)),offset:Bi(e,dc(t)),velocity:hc(t,.1)}}function dc(e){return e[0]}function $i(e){return e[e.length-1]}function hc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=$i(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Ae(t)));)n--;if(!r)return{x:0,y:0};const i=Re(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 pc(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ne(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ne(n,e,r.max):Math.min(e,n)),e}function Ui(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 mc(e,{top:t,left:n,bottom:r,right:s}){return{x:Ui(e.x,n,s),y:Ui(e.y,t,r)}}function Wi(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 gc(e,t){return{x:Wi(e.x,t.x),y:Wi(e.y,t.y)}}function yc(e,t){let n=.5;const r=ye(e),s=ye(t);return s>r?n=Xe(t.min,t.max-r,e.min):r>s&&(n=Xe(e.min,e.max-s,t.min)),Ve(0,1,n)}function vc(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 or=.35;function xc(e=or){return e===!1?e=0:e===!0&&(e=or),{x:zi(e,"left","right"),y:zi(e,"top","bottom")}}function zi(e,t,n){return{min:Yi(e,t),max:Yi(e,n)}}function Yi(e,t){return typeof e=="number"?e:e[t]||0}const bc=new WeakMap;class Tc{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=ie(),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(At(u).point)},i=(u,f)=>{const{drag:h,dragPropagation:m,onDragStart:x}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=hl(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),we(P=>{let b=this.getAxisMotionValue(P).get()||0;if(je.test(b)){const{projection:S}=this.visualElement;if(S&&S.layout){const C=S.layout.layoutBox[P];C&&(b=ye(C)*(parseFloat(b)/100))}}this.originPoint[P]=b}),x&&te.postRender(()=>x(u,f)),Ln(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(u,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:x,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:P}=f;if(m&&this.currentDirection===null){this.currentDirection=wc(P),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",f.point,P),this.updateAxis("y",f.point,P),this.visualElement.render(),y&&y(u,f)},l=(u,f)=>this.stop(u,f),a=()=>we(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 Ni(t,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:l,resumeAnimation:a},{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&&te.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||!Zt(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=pc(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&&Je(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=mc(s.layoutBox,n):this.constraints=!1,this.elastic=xc(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&we(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=vc(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Je(t))return!1;const r=t.current;Le(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=cc(r,s.root,this.visualElement.getTransformPagePoint());let o=gc(s.layout.layoutBox,i);if(n){const l=n(tc(o));this.hasMutatedConstraints=!!l,l&&(o=wi(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),a=this.constraints||{},c=we(u=>{if(!Zt(u,n,this.currentDirection))return;let f=a&&a[u]||{};o&&(f={min:0,max:0});const h=s?200:1e6,m=s?40:1e7,x={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,x)});return Promise.all(c).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ln(this.visualElement,t),r.start(Qn(t,r,0,n,this.visualElement,!1))}stopAnimation(){we(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){we(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){we(n=>{const{drag:r}=this.getProps();if(!Zt(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n];i.set(t[n]-ne(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Je(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};we(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const a=l.get();s[o]=yc({min:a,max:a},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(),we(o=>{if(!Zt(o,t,null))return;const l=this.getAxisMotionValue(o),{min:a,max:c}=this.constraints[o];l.set(ne(a,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;bc.set(this.visualElement,this);const t=this.visualElement.current,n=rt(t,"pointerdown",a=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(a)}),r=()=>{const{dragConstraints:a}=this.getProps();Je(a)&&a.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),te.read(r);const o=Et(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:a,hasLayoutChanged:c})=>{this.isDragging&&c&&(we(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=a[u].translate,f.set(f.get()+a[u].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=or,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function Zt(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function wc(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Pc extends Ne{constructor(t){super(t),this.removeGroupControls=be,this.removeListeners=be,this.controls=new Tc(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||be}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ki=e=>(t,n)=>{e&&te.postRender(()=>e(t,n))};class Sc extends Ne{constructor(){super(...arguments),this.removePointerDownListener=be}onPointerDown(t){this.session=new Ni(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Ki(t),onStart:Ki(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&te.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=rt(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 Jt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Gi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Dt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(V.test(e))e=parseFloat(e);else return e;const n=Gi(e,t.target.x),r=Gi(e,t.target.y);return`${n}% ${r}%`}},Cc={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Fe.parse(e);if(s.length>5)return r;const i=Fe.createTransformer(e),o=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,a=n.y.scale*t.y;s[0+o]/=l,s[1+o]/=a;const c=ne(l,a,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}};class Ec extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;Da(Ac),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()})),Jt.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()||te.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),dn.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 qi(e){const[t,n]=Fr(),r=v.useContext(nn);return g.exports.jsx(Ec,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(Zr),isPresent:t,safeToRemove:n})}const Ac={borderRadius:{...Dt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Dt,borderTopRightRadius:Dt,borderBottomLeftRadius:Dt,borderBottomRightRadius:Dt,boxShadow:Cc};function jc(e,t,n){const r=pe(e)?e:xt(e);return r.start(Qn("",r,t,n)),r.animation}function Mc(e){return e instanceof SVGElement&&e.tagName!=="svg"}const Dc=(e,t)=>e.depth-t.depth;class Rc{constructor(){this.children=[],this.isDirty=!1}add(t){Rn(this.children,t),this.isDirty=!0}remove(t){Vn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Dc),this.isDirty=!1,this.children.forEach(t)}}function Vc(e,t){const n=Me.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(_e(r),e(i-t))};return te.read(r,!0),()=>_e(r)}const Hi=["TopLeft","TopRight","BottomLeft","BottomRight"],Oc=Hi.length,Xi=e=>typeof e=="string"?parseFloat(e):e,Zi=e=>typeof e=="number"||V.test(e);function Lc(e,t,n,r,s,i){s?(e.opacity=ne(0,n.opacity!==void 0?n.opacity:1,kc(r)),e.opacityExit=ne(t.opacity!==void 0?t.opacity:1,0,_c(r))):i&&(e.opacity=ne(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Oc;o++){const l=`border${Hi[o]}Radius`;let a=Ji(t,l),c=Ji(n,l);if(a===void 0&&c===void 0)continue;a||(a=0),c||(c=0),a===0||c===0||Zi(a)===Zi(c)?(e[l]=Math.max(ne(Xi(a),Xi(c),r),0),(je.test(c)||je.test(a))&&(e[l]+="%")):e[l]=c}(t.rotate||n.rotate)&&(e.rotate=ne(t.rotate||0,n.rotate||0,r))}function Ji(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const kc=Qi(0,.5,_s),_c=Qi(.5,.95,be);function Qi(e,t,n){return r=>r<e?0:r>t?1:n(Xe(e,t,r))}function eo(e,t){e.min=t.min,e.max=t.max}function Pe(e,t){eo(e.x,t.x),eo(e.y,t.y)}function to(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function no(e,t,n,r,s){return e-=t,e=Xt(e,1/n,r),s!==void 0&&(e=Xt(e,1/s,r)),e}function Ic(e,t=0,n=1,r=.5,s,i=e,o=e){if(je.test(t)&&(t=parseFloat(t),t=ne(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=ne(i.min,i.max,r);e===i&&(l-=t),e.min=no(e.min,t,n,l,s),e.max=no(e.max,t,n,l,s)}function ro(e,t,[n,r,s],i,o){Ic(e,t[n],t[r],t[s],t.scale,i,o)}const Fc=["x","scaleX","originX"],Nc=["y","scaleY","originY"];function so(e,t,n,r){ro(e.x,t,Fc,n?n.x:void 0,r?r.x:void 0),ro(e.y,t,Nc,n?n.y:void 0,r?r.y:void 0)}function io(e){return e.translate===0&&e.scale===1}function oo(e){return io(e.x)&&io(e.y)}function ao(e,t){return e.min===t.min&&e.max===t.max}function Bc(e,t){return ao(e.x,t.x)&&ao(e.y,t.y)}function lo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function uo(e,t){return lo(e.x,t.x)&&lo(e.y,t.y)}function co(e){return ye(e.x)/ye(e.y)}function fo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class $c{constructor(){this.members=[]}add(t){Rn(this.members,t),t.scheduleRender()}remove(t){if(Vn(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 Uc(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:x}=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) `),x&&(r+=`skewY(${x}deg) `)}const l=e.x.scale*t.x,a=e.y.scale*t.y;return(l!==1||a!==1)&&(r+=`scale(${l}, ${a})`),r||"none"}const Ge={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ar=["","X","Y","Z"],Wc={visibility:"hidden"},ho=1e3;let zc=0;function lr(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function po(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ms(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",te,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&po(r)}function mo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=zc++,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,ke.value&&(Ge.nodes=Ge.calculatedTargetDeltas=Ge.calculatedProjections=0),this.nodes.forEach(Gc),this.nodes.forEach(Jc),this.nodes.forEach(Qc),this.nodes.forEach(qc),ke.addProjectionMetrics&&ke.addProjectionMetrics(Ge)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let a=0;a<this.path.length;a++)this.path[a].shouldResetTransform=!0;this.root===this&&(this.nodes=new Rc)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new On),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const a=this.eventHandlers.get(o);a&&a.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Mc(o),this.instance=o;const{layoutId:a,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),l&&(c||a)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Vc(h,250),Jt.hasAnimatedSinceResize&&(Jt.hasAnimatedSinceResize=!1,this.nodes.forEach(yo))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||sf,{onLayoutAnimationStart:P,onLayoutAnimationComplete:b}=u.getProps(),S=!this.targetLayout||!uo(this.targetLayout,x),C=!h&&m;if(this.options.layoutRoot||this.resumeFrom||C||h&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,C);const D={...Sn(y,"layout"),onPlay:P,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D)}else h||yo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}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(ef),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&&po(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:l,layout:a}=this.options;if(l===void 0&&!a)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(go);return}this.isUpdating||this.nodes.forEach(Xc),this.isUpdating=!1,this.nodes.forEach(Zc),this.nodes.forEach(Yc),this.nodes.forEach(Kc),this.clearAllSnapshots();const l=Me.now();he.delta=Ve(0,1e3/60,l-he.timestamp),he.timestamp=l,he.isProcessing=!0,ln.update.process(he),ln.preRender.process(he),ln.render.process(he),he.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,dn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Hc),this.sharedNodes.forEach(tf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,te.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){te.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ye(this.snapshot.measuredBox.x)&&!ye(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 a=0;a<this.path.length;a++)this.path[a].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ie(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l){const a=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:a,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:a}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!oo(this.projectionDelta),a=this.getTransformTemplate(),c=a?a(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(l||Ke(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let a=this.removeElementScroll(l);return o&&(a=this.removeTransform(a)),of(a),{animationId:this.root.animationId,measuredBox:l,layoutBox:a,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:l}=this.options;if(!l)return ie();const a=l.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(af))){const{scroll:u}=this.root;u&&(it(a.x,u.offset.x),it(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=ie();if(Pe(a,o),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return a;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&&Pe(a,o),it(a.x,f.offset.x),it(a.y,f.offset.y))}return a}applyTransform(o,l=!1){const a=ie();Pe(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ot(a,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ke(u.latestValues)&&ot(a,u.latestValues)}return Ke(this.latestValues)&&ot(a,this.latestValues),a}removeTransform(o){const l=ie();Pe(l,o);for(let a=0;a<this.path.length;a++){const c=this.path[a];if(!c.instance||!Ke(c.latestValues))continue;nr(c.latestValues)&&c.updateSnapshot();const u=ie(),f=c.measurePageBox();Pe(u,f),so(l,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Ke(this.latestValues)&&so(l,this.latestValues),l}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!==he.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var l;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=Boolean(this.resumingFrom)||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=he.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ie(),this.relativeTargetOrigin=ie(),Mt(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=ie(),this.targetWithTransforms=ie()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),lc(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),Oi(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=ie(),this.relativeTargetOrigin=ie(),Mt(this.relativeTargetOrigin,this.target,m.target),Pe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ke.value&&Ge.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||nr(this.parent.latestValues)||Di(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 l=this.getLead(),a=Boolean(this.resumingFrom)||this!==l;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===he.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;Pe(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;uc(this.layoutCorrected,this.treeScale,this.path,a),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=ie());const{target:x}=l;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(to(this.prevProjectionDelta.x,this.projectionDelta.x),to(this.prevProjectionDelta.y,this.projectionDelta.y)),jt(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!fo(this.projectionDelta.x,this.prevProjectionDelta.x)||!fo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x)),ke.value&&Ge.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=st(),this.projectionDelta=st(),this.projectionDeltaWithTransform=st()}setAnimationOrigin(o,l=!1){const a=this.snapshot,c=a?a.latestValues:{},u={...this.latestValues},f=st();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const h=ie(),m=a?a.source:void 0,x=this.layout?this.layout.source:void 0,y=m!==x,P=this.getStack(),b=!P||P.members.length<=1,S=Boolean(y&&!b&&this.options.crossfade===!0&&!this.path.some(rf));this.animationProgress=0;let C;this.mixTargetDelta=D=>{const p=D/1e3;vo(f.x,o.x,p),vo(f.y,o.y,p),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Mt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),nf(this.relativeTarget,this.relativeTargetOrigin,h,p),C&&Bc(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=ie()),Pe(C,this.relativeTarget)),y&&(this.animationValues=u,Lc(u,c,this.latestValues,p,S,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=p},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=te.update(()=>{Jt.hasAnimatedSinceResize=!0,Pt.layout++,this.currentAnimation=jc(0,ho,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},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(ho),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:a,layout:c,latestValues:u}=o;if(!(!l||!a||!c)){if(this!==o&&this.layout&&c&&Po(this.options.animationType,this.layout.layoutBox,c.layoutBox)){a=this.target||ie();const f=ye(this.layout.layoutBox.x);a.x.min=o.target.x.min,a.x.max=a.x.min+f;const h=ye(this.layout.layoutBox.y);a.y.min=o.target.y.min,a.y.max=a.y.min+h}Pe(l,a),ot(l,u),jt(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new $c),this.sharedNodes.get(o).add(l);const c=l.options.initialPromotionConfig;l.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(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:l,preserveFollowOpacity:a}={}){const c=this.getStack();c&&c.promote(this,a),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:a}=o;if((a.z||a.rotate||a.rotateX||a.rotateY||a.rotateZ||a.skewX||a.skewY)&&(l=!0),!l)return;const c={};a.z&&lr("z",o,c,this.animationValues);for(let u=0;u<ar.length;u++)lr(`rotate${ar[u]}`,o,c,this.animationValues),lr(`skew${ar[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 l,a;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Wc;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Wt(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 y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=Wt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Ke(this.latestValues)&&(y.transform=u?u({},""):"none",this.hasProjected=!1),y}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=Uc(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:m,y:x}=this.projectionDelta;c.transformOrigin=`${m.origin*100}% ${x.origin*100}% 0`,f.animationValues?c.opacity=f===this?(a=(l=h.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&a!==void 0?a: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 y in ht){if(h[y]===void 0)continue;const{correct:P,applyTo:b,isCSSVariable:S}=ht[y],C=c.transform==="none"?h[y]:P(h[y],f);if(b){const D=b.length;for(let p=0;p<D;p++)c[b[p]]=C}else S?this.options.visualElement.renderState.vars[y]=C:c[y]=C}return this.options.layoutId&&(c.pointerEvents=f===this?Wt(o==null?void 0:o.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(go),this.root.sharedNodes.clear()}}}function Yc(e){e.updateLayout()}function Kc(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"?we(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=ye(h);h.min=r[f].min,h.max=h.min+m}):Po(i,n.layoutBox,r)&&we(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=ye(r[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const l=st();jt(l,r,n.layoutBox);const a=st();o?jt(a,e.applyTransform(s,!0),n.measuredBox):jt(a,r,n.layoutBox);const c=!oo(l);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const x=ie();Mt(x,n.layoutBox,h.layoutBox);const y=ie();Mt(y,r,m.layoutBox),uo(x,y)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=x,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:a,layoutDelta:l,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Gc(e){ke.value&&Ge.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 qc(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Hc(e){e.clearSnapshot()}function go(e){e.clearMeasurements()}function Xc(e){e.isLayoutDirty=!1}function Zc(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function yo(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Jc(e){e.resolveTargetDelta()}function Qc(e){e.calcProjection()}function ef(e){e.resetSkewAndRotation()}function tf(e){e.removeLeadSnapshot()}function vo(e,t,n){e.translate=ne(t.translate,0,n),e.scale=ne(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function xo(e,t,n,r){e.min=ne(t.min,n.min,r),e.max=ne(t.max,n.max,r)}function nf(e,t,n,r){xo(e.x,t.x,n.x,r),xo(e.y,t.y,n.y,r)}function rf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const sf={duration:.45,ease:[.4,0,.1,1]},bo=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),To=bo("applewebkit/")&&!bo("chrome/")?Math.round:be;function wo(e){e.min=To(e.min),e.max=To(e.max)}function of(e){wo(e.x),wo(e.y)}function Po(e,t,n){return e==="position"||e==="preserve-aspect"&&!ac(co(t),co(n),.2)}function af(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const lf=mo({attachResizeListener:(e,t)=>Et(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ur={current:void 0},So=mo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ur.current){const e=new lf({});e.mount(window),e.setOptions({layoutScroll:!0}),ur.current=e}return ur.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),uf={pan:{Feature:Sc},drag:{Feature:Pc,ProjectionNode:So,MeasureLayout:qi}};function Co(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&&te.postRender(()=>i(t,At(t)))}class cf extends Ne{mount(){const{current:t}=this.node;t&&(this.unmount=al(t,(n,r)=>(Co(this.node,r,"Start"),s=>Co(this.node,s,"End"))))}unmount(){}}class ff extends Ne{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=St(Et(this.node.current,"focus",()=>this.onFocus()),Et(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Eo(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&&te.postRender(()=>i(t,At(t)))}class df extends Ne{mount(){const{current:t}=this.node;t&&(this.unmount=fl(t,(n,r)=>(Eo(this.node,r,"Start"),(s,{success:i})=>Eo(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const cr=new WeakMap,fr=new WeakMap,hf=e=>{const t=cr.get(e.target);t&&t(e)},pf=e=>{e.forEach(hf)};function mf({root:e,...t}){const n=e||document;fr.has(n)||fr.set(n,{});const r=fr.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(pf,{root:e,...t})),r[s]}function gf(e,t,n){const r=mf(t);return cr.set(e,n),r.observe(e),()=>{cr.delete(e),r.unobserve(e)}}const yf={some:0,all:1};class vf extends Ne{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:yf[s]},l=a=>{const{isIntersecting:c}=a;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(a)};return gf(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(xf(t,n))&&this.startObserver()}unmount(){}}function xf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const bf={inView:{Feature:vf},tap:{Feature:df},focus:{Feature:ff},hover:{Feature:cf}},Tf={layout:{ProjectionNode:So,MeasureLayout:qi}},dr={current:null},Ao={current:!1};function wf(){if(Ao.current=!0,!!on)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>dr.current=e.matches;e.addListener(t),t()}else dr.current=!1}const Pf=[...ei,me,Fe],Sf=e=>Pf.find(Qs(e)),Cf=new WeakMap;function Ef(e,t,n){for(const r in t){const s=t[r],i=n[r];if(pe(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(pe(i))e.addValue(r,xt(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,xt(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const jo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Af{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Yn,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=Me.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,te.render(this.render,!1,!0))};const{latestValues:a,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=l,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=$t(n),this.isVariantNode=qr(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 x=h[m];a[m]!==void 0&&pe(x)&&x.set(a[m],!1)}}mount(t){this.current=t,Cf.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)),Ao.current||wf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:dr.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(),_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=Ue.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&te.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 Ze){const n=Ze[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):ie()}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<jo.length;r++){const s=jo[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=Ef(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=xt(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"&&(Zs(s)||Fs(s))?s=parseFloat(s):!Sf(s)&&Fe.test(n)&&(s=Ys(t,n)),this.setBaseTarget(t,pe(s)?s.get():s)),pe(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=Tn(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&&!pe(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 On),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Mo extends Af{constructor(){super(...arguments),this.KeyframeResolver=ni}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;pe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function jf(e){return window.getComputedStyle(e)}class Mf extends Mo{constructor(){super(...arguments),this.type="html",this.renderInstance=cs}readValueFromInstance(t,n){if(Ue.has(n)){const r=Un(n);return r&&r.default||0}else{const r=jf(t),s=(hn(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Ii(t,n)}build(t,n,r){gn(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Pn(t,n,r)}}class Df extends Mo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ie,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&us(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ue.has(n)){const r=Un(n);return r&&r.default||0}return n=fs.has(n)?n:fn(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return hs(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&te.postRender(this.updateDimensions)}build(t,n,r){xn(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){ds(t,n,r,s)}mount(t){this.isSVGTag=bn(t.tagName),super.mount(t)}}const Rf=(e,t)=>vn(e)?new Df(t):new Mf(t,{allowProjection:e!==v.Fragment}),Vf=el({...Qu,...bf,...uf,...Tf},Rf),hr=ya(Vf),Of=({isOpen:e,onClose:t,onConfirm:n,header:r,question:s})=>e?g.exports.jsx("div",{id:"default-modal",tabIndex:-1,"aria-hidden":"true",className:"fixed top-0 right-0 left-0 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:g.exports.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:g.exports.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[g.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:[g.exports.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[r," "]}),g.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:[g.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:g.exports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),g.exports.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),g.exports.jsx("div",{className:"p-4 md:p-5 space-y-4",children:g.exports.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[s," "]})}),g.exports.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[g.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 "}),g.exports.jsx("button",{onClick:t,type:"button",className:"py-2.5 px-5 ms-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,Lf=({items:e,isVisible:t,position:n,messageId:r,isCurrentUserMessage:s})=>{const i=v.useRef(null),[o,l]=v.useState(!1);return v.useEffect(()=>(i.current||(i.current=document.createElement("div"),i.current.style.zIndex="1500",i.current.style.position="fixed",document.body.appendChild(i.current)),l(!0),()=>{i.current&&!t&&(document.body.removeChild(i.current),i.current=null)}),[t]),!i.current||!o?null:$e.createPortal(g.exports.jsx($r,{children:t&&g.exports.jsx(hr.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",style:{top:n.y,left:n.x},children:e.map((a,c)=>a!=null&&a.onlyCurrentUserMessage&&!s?null:g.exports.jsxs("button",{className:"cursor-pointer flex items-center gap-2 w-full rounded-md text-left px-2 py-1 hover:bg-gray-200",onClick:()=>a.onClick(r),children:[v.cloneElement(a.icon,{className:"text-black",size:18}),g.exports.jsx("span",{className:"ml-2 text-black",children:a.name})]},c))})}),i.current)},kf=()=>g.exports.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:g.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=()=>g.exports.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:g.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"})}),Do=()=>g.exports.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:g.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"})}),pr=e=>g.exports.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...e,children:g.exports.jsxs("g",{fill:"none",children:[g.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"}),g.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"}),g.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"}),g.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"})]})}),If=({onSendMessage:e,onSendVoice:t,onFileSend:n,dynamicSymbolAssignments:r})=>{const[s,i]=v.useState(""),[o,l]=v.useState(!1),[a,c]=v.useState(0),[u,f]=v.useState(null),[h,m]=v.useState(null),[x,y]=v.useState(0),P=v.useRef(null),b=v.useRef([]),S=v.useRef(null),C=v.useRef(null),D=v.useRef(null),[p,M]=v.useState(!1),U=I=>{const O=I.target.value;i(O);const k=O.match(/(\S+)$/);if(k){const le=k[0];if(u){const T=k[0].split(u)[1];m(T)}r!=null&&r.some(T=>T.symbol===le)&&f(le)}else f(null)},R=(I,O)=>{i(k=>k+O+" "),f(null),C.current.focus()},Q=()=>{s.trim()!==""&&(e(s),i(""),f(null))},Y=async()=>{l(!0),c(0),b.current=[],S.current=setInterval(()=>{c(k=>k+1)},1e3);const I=await navigator.mediaDevices.getUserMedia({audio:!0}),O=new MediaRecorder(I);P.current=O,O.ondataavailable=k=>{k.data.size>0&&b.current.push(k.data)},O.onstop=()=>{clearInterval(S.current);const k=new Blob(b.current,{type:"audio/mp3"}),le=URL.createObjectURL(k);t(le),l(!1)},O.start()},ae=()=>{var I;(I=P.current)==null||I.stop()},Te=()=>{var I;(I=D.current)==null||I.click()},ce=I=>{var k;const O=(k=I.target.files)==null?void 0:k[0];O&&n(O)},se=I=>{const O=Math.floor(I/60),k=I%60;return`${O.toString().padStart(2,"0")}:${k.toString().padStart(2,"0")}`},ve=I=>{const{scrollTop:O,scrollHeight:k,clientHeight:le}=I.currentTarget;if(O>x){if(O+le>=k-1){const E=r==null?void 0:r.find(_=>_.symbol===u);E&&(E!=null&&E.updatePageNumber)&&(M(!0),E==null||E.updatePageNumber(E.pagNumber+1),y(O),setTimeout(()=>{M(!1)},500))}}else y(O)};return g.exports.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[o?g.exports.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[g.exports.jsx("span",{className:"text-blue-400 font-bold flex-1",children:se(a)}),g.exports.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:ae,children:g.exports.jsx(Do,{})})]}):g.exports.jsxs(g.exports.Fragment,{children:[g.exports.jsxs("div",{className:"w-[90%] relative ",children:[g.exports.jsx("div",{onClick:Te,className:"cursor-pointer absolute right-4 top-[11px]",children:g.exports.jsx(kf,{})}),g.exports.jsx("input",{type:"file",ref:D,style:{display:"none"},onChange:ce}),g.exports.jsx("input",{type:"text",ref:C,className:"w-full bg-white flex-1 p-2 pl-4 border border-gray-300 outline-none rounded-tl-3xl rounded-tr-2xl rounded-bl-3xl ",placeholder:"Type a message...",value:s,onChange:U,onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),Q())}}),g.exports.jsx(pr,{className:"rotate-180 absolute -right-[11.4px] top-5"})]}),g.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:s?Q:Y,children:s?g.exports.jsx(Do,{}):g.exports.jsx(_f,{})})]}),u&&g.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:ve,children:[g.exports.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[g.exports.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",g.exports.jsx("span",{className:"text-blue-500",children:u})]}),g.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>f(null),children:"✕"})]}),g.exports.jsxs("div",{className:"space-y-2",children:[r?r.filter(I=>I.symbol===u).map(I=>{var le;const{component:O,lists:k}=I;return O?h?(le=k==null?void 0:k.filter(T=>T==null?void 0:T.name.includes(h)))==null?void 0:le.map((T,E)=>g.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:g.exports.jsx(O,{listsProps:T,onClick:(_,F)=>R(_,F)})},E)):k==null?void 0:k.map((T,E)=>g.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:g.exports.jsx(O,{listsProps:T,onClick:(_,F)=>R(_,F)})},E)):null}):null,g.exports.jsx("div",{className:"h-8",children:p&&"Loading more items..."})]})]})]})};var Be=(e=>(e[e.File=0]="File",e[e.Voice=1]="Voice",e[e.Video=2]="Video",e[e.Image=3]="Image",e))(Be||{});const Ro=({fileName:e,fileSize:t,format:n,src:r})=>{const s=()=>({rar:g.exports.jsx("p",{className:"p-2 text-green-500 font-bold",children:n}),zip:g.exports.jsx("p",{className:"p-2 text-blue-500 font-bold",children:n}),pdf:g.exports.jsx("p",{className:"p-2 text-red-500 font-bold",children:n}),doc:g.exports.jsx("p",{className:"p-2 text-blue-400 font-bold",children:n}),vid:g.exports.jsx("p",{className:"p-2 text-orange-400 font-bold",children:n}),"":g.exports.jsx("p",{className:"p-2 text-black font-bold",children:n})})[n||""],i=o=>o>1048576?(o/1048576).toFixed(1)+" MB":(o/1024).toFixed(1)+" KB";return g.exports.jsxs("div",{className:"flex items-center rounded-lg",children:[g.exports.jsx("div",{className:"mr-3 relative border border-green-950 rounded-md p-3",children:s()}),g.exports.jsxs("div",{className:"flex flex-col flex-grow",children:[g.exports.jsx("a",{href:r,download:e,className:"text-gray-900 font-medium hover:underline",children:e}),g.exports.jsx("span",{className:"text-gray-600 text-sm",children:i(t)})]}),g.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"})]})},Ff=e=>g.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:g.exports.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),Nf=e=>g.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:[g.exports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),g.exports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let Rt=null;const Bf=({src:e,className:t})=>{const[n,r]=v.useState(!1),[s,i]=v.useState(0),o=v.useRef(null);v.useEffect(()=>{const a=o.current;if(!a)return;const c=()=>{i(a.currentTime/a.duration*100)},u=()=>r(!0),f=()=>r(!1),h=()=>{r(!1),i(0)};return a.addEventListener("timeupdate",c),a.addEventListener("play",u),a.addEventListener("pause",f),a.addEventListener("ended",h),()=>{a.removeEventListener("timeupdate",c),a.removeEventListener("play",u),a.removeEventListener("pause",f),a.removeEventListener("ended",h)}},[]);const l=()=>{const a=o.current;a&&(n?a.pause():(Rt&&Rt!==a&&(Rt.pause(),Rt.currentTime=0),a.play(),Rt=a))};return g.exports.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${t}`,children:[g.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:l,children:n?g.exports.jsx(Nf,{}):g.exports.jsx(Ff,{})}),g.exports.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:g.exports.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${s}%`}})}),g.exports.jsx("audio",{ref:o,src:e})]})},$f=({attachment:e,attachmentType:t})=>e?t===Be.Voice?g.exports.jsx("div",{className:"w-full",children:g.exports.jsx(Bf,{src:e})}):t===Be.Image?g.exports.jsx("div",{className:"w-full",children:g.exports.jsx("img",{src:e})}):t===Be.File?g.exports.jsx("div",{className:"w-full mt-1",children:g.exports.jsx(Ro,{fileName:"productivity",fileSize:23e3,format:"rar",src:e})}):t===Be.Video?g.exports.jsx("div",{className:"w-full mt-1",children:g.exports.jsx(Ro,{fileName:"productivity",fileSize:23e3,format:"rar",src:e})}):null:null,Uf=({message:e,showUserProfile:t,handleContextMenu:n,media:r})=>{var s,i,o,l,a;return g.exports.jsxs(g.exports.Fragment,{children:[t?g.exports.jsx("img",{src:e.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,g.exports.jsxs(hr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:c=>n(c,e),className:`relative ${r?"w-3/4":"w-fit max-w-3/4"}flex flex-col gap-1 md:max-w-[400px] p-2 pt-5 rounded-lg bg-green-200`,children:[g.exports.jsx("span",{className:"absolute top-1 text-xs text-orange-700",children:(s=e.user)!=null&&s.fullName&&((o=(i=e.user)==null?void 0:i.fullName)==null?void 0:o.length)>16?(l=e.user)==null?void 0:l.firstName:(a=e.user)==null?void 0:a.fullName}),r||null,g.exports.jsx("span",{children:e.text}),g.exports.jsx("div",{className:"w-full flex gap- items-center justify-end",children:g.exports.jsx("span",{className:"text-[10px]",children:new Date(e.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(e.createdDate).toLocaleTimeString().split(":")[1]})}),g.exports.jsx(pr,{className:"fill-blue-200 -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 [&>g>path]:fill-green-200"})]})]})},Wf=()=>g.exports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.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"}),g.exports.jsx("path",{"fill-rule":"evenodd","clip-rule":"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"})]}),Vo=({size:e=24,color:t="text-current",className:n})=>g.exports.jsx("div",{className:` ${n} animate-spin inline-flex items-center justify-center`,children:g.exports.jsxs("svg",{width:e,height:e,viewBox:"0 0 36 36",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[g.exports.jsx("defs",{children:g.exports.jsxs("linearGradient",{x1:"0%",y1:"100%",x2:"100%",y2:"100%",id:"linearGradient-1",children:[g.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0",offset:"0%"}),g.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0.50",offset:"39.9430698%"}),g.exports.jsx("stop",{stopColor:"currentColor",offset:"100%"})]})}),g.exports.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[g.exports.jsx("rect",{fillOpacity:"0.01",fill:"none",x:"0",y:"0",width:"36",height:"36"}),g.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"})]})]})}),zf=({handleContextMenu:e,media:t,message:n})=>g.exports.jsxs(hr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:r=>e(r,n),className:`relative self-end ${t?"w-3/4":"max-w-3/4"} flex flex-col justify-center md:max-w-[400px] p-2 rounded-lg bg-blue-200`,children:[t||null,g.exports.jsx("span",{children:n.text}),g.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[g.exports.jsx("span",{className:"text-[10px]",children:new Date(n.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(n.createdDate).toLocaleTimeString().split(":")[1]}),n.isSending?g.exports.jsx(Vo,{size:13,color:"text-black"}):g.exports.jsx(Wf,{})]}),g.exports.jsx(pr,{className:"fill-blue-200 rotate-180 absolute -right-2 bottom-0 [&>g>path]:fill-blue-200"})]});var fe={exports:{}},mr={exports:{}},Z={};var Oo;function Yf(){if(Oo)return Z;Oo=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,l=e?Symbol.for("react.context"):60110,a=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,x=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,P=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function C(p){if(typeof p=="object"&&p!==null){var M=p.$$typeof;switch(M){case t:switch(p=p.type,p){case a:case c:case r:case i:case s:case f:return p;default:switch(p=p&&p.$$typeof,p){case l:case u:case x:case m:case o:return p;default:return M}}case n:return M}}}function D(p){return C(p)===c}return Z.AsyncMode=a,Z.ConcurrentMode=c,Z.ContextConsumer=l,Z.ContextProvider=o,Z.Element=t,Z.ForwardRef=u,Z.Fragment=r,Z.Lazy=x,Z.Memo=m,Z.Portal=n,Z.Profiler=i,Z.StrictMode=s,Z.Suspense=f,Z.isAsyncMode=function(p){return D(p)||C(p)===a},Z.isConcurrentMode=D,Z.isContextConsumer=function(p){return C(p)===l},Z.isContextProvider=function(p){return C(p)===o},Z.isElement=function(p){return typeof p=="object"&&p!==null&&p.$$typeof===t},Z.isForwardRef=function(p){return C(p)===u},Z.isFragment=function(p){return C(p)===r},Z.isLazy=function(p){return C(p)===x},Z.isMemo=function(p){return C(p)===m},Z.isPortal=function(p){return C(p)===n},Z.isProfiler=function(p){return C(p)===i},Z.isStrictMode=function(p){return C(p)===s},Z.isSuspense=function(p){return C(p)===f},Z.isValidElementType=function(p){return typeof p=="string"||typeof p=="function"||p===r||p===c||p===i||p===s||p===f||p===h||typeof p=="object"&&p!==null&&(p.$$typeof===x||p.$$typeof===m||p.$$typeof===o||p.$$typeof===l||p.$$typeof===u||p.$$typeof===P||p.$$typeof===b||p.$$typeof===S||p.$$typeof===y)},Z.typeOf=C,Z}var J={};var Lo;function Kf(){return Lo||(Lo=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,l=e?Symbol.for("react.context"):60110,a=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,x=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,P=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function C(j){return typeof j=="string"||typeof j=="function"||j===r||j===c||j===i||j===s||j===f||j===h||typeof j=="object"&&j!==null&&(j.$$typeof===x||j.$$typeof===m||j.$$typeof===o||j.$$typeof===l||j.$$typeof===u||j.$$typeof===P||j.$$typeof===b||j.$$typeof===S||j.$$typeof===y)}function D(j){if(typeof j=="object"&&j!==null){var Se=j.$$typeof;switch(Se){case t:var at=j.type;switch(at){case a:case c:case r:case i:case s:case f:return at;default:var qe=at&&at.$$typeof;switch(qe){case l:case u:case x:case m:case o:return qe;default:return Se}}case n:return Se}}}var p=a,M=c,U=l,R=o,Q=t,Y=u,ae=r,Te=x,ce=m,se=n,ve=i,I=s,O=f,k=!1;function le(j){return k||(k=!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)||D(j)===a}function T(j){return D(j)===c}function E(j){return D(j)===l}function _(j){return D(j)===o}function F(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function N(j){return D(j)===u}function G(j){return D(j)===r}function B(j){return D(j)===x}function $(j){return D(j)===m}function W(j){return D(j)===n}function H(j){return D(j)===i}function z(j){return D(j)===s}function ge(j){return D(j)===f}J.AsyncMode=p,J.ConcurrentMode=M,J.ContextConsumer=U,J.ContextProvider=R,J.Element=Q,J.ForwardRef=Y,J.Fragment=ae,J.Lazy=Te,J.Memo=ce,J.Portal=se,J.Profiler=ve,J.StrictMode=I,J.Suspense=O,J.isAsyncMode=le,J.isConcurrentMode=T,J.isContextConsumer=E,J.isContextProvider=_,J.isElement=F,J.isForwardRef=N,J.isFragment=G,J.isLazy=B,J.isMemo=$,J.isPortal=W,J.isProfiler=H,J.isStrictMode=z,J.isSuspense=ge,J.isValidElementType=C,J.typeOf=D}()),J}var ko;function _o(){return ko||(ko=1,function(e){process.env.NODE_ENV==="production"?e.exports=Yf():e.exports=Kf()}(mr)),mr.exports}var gr,Io;function Gf(){if(Io)return gr;Io=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={},l=0;l<10;l++)o["_"+String.fromCharCode(l)]=l;var a=Object.getOwnPropertyNames(o).map(function(u){return o[u]});if(a.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 gr=s()?Object.assign:function(i,o){for(var l,a=r(i),c,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var f in l)t.call(l,f)&&(a[f]=l[f]);if(e){c=e(l);for(var h=0;h<c.length;h++)n.call(l,c[h])&&(a[c[h]]=l[c[h]])}}return a},gr}var yr,Fo;function vr(){if(Fo)return yr;Fo=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return yr=e,yr}var xr,No;function Bo(){return No||(No=1,xr=Function.call.bind(Object.prototype.hasOwnProperty)),xr}var br,$o;function qf(){if($o)return br;$o=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=vr(),n={},r=Bo();e=function(i){var o="Warning: "+i;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(i,o,l,a,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((a||"React class")+": "+l+" 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,a,l,null,t)}catch(x){f=x}if(f&&!(f instanceof Error)&&e((a||"React class")+": type specification of "+l+" `"+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 "+l+" type: "+f.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},br=s,br}var Tr,Uo;function Hf(){if(Uo)return Tr;Uo=1;var e=_o(),t=Gf(),n=vr(),r=Bo(),s=qf(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(l){var a="Warning: "+l;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}});function o(){return null}return Tr=function(l,a){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(T){var E=T&&(c&&T[c]||T[u]);if(typeof E=="function")return E}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:S(),arrayOf:C,element:D(),elementType:p(),instanceOf:M,node:Y(),objectOf:R,oneOf:U,oneOfType:Q,shape:Te,exact:ce};function x(T,E){return T===E?T!==0||1/T===1/E:T!==T&&E!==E}function y(T,E){this.message=T,this.data=E&&typeof E=="object"?E:{},this.stack=""}y.prototype=Error.prototype;function P(T){if(process.env.NODE_ENV!=="production")var E={},_=0;function F(G,B,$,W,H,z,ge){if(W=W||h,z=z||$,ge!==n){if(a){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 Se=W+":"+$;!E[Se]&&_<3&&(i("You are manually calling a React.PropTypes validation function for the `"+z+"` prop on `"+W+"`. 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."),E[Se]=!0,_++)}}return B[$]==null?G?B[$]===null?new y("The "+H+" `"+z+"` is marked as required "+("in `"+W+"`, but its value is `null`.")):new y("The "+H+" `"+z+"` is marked as required in "+("`"+W+"`, but its value is `undefined`.")):null:T(B,$,W,H,z)}var N=F.bind(null,!1);return N.isRequired=F.bind(null,!0),N}function b(T){function E(_,F,N,G,B,$){var W=_[F],H=I(W);if(H!==T){var z=O(W);return new y("Invalid "+G+" `"+B+"` of type "+("`"+z+"` supplied to `"+N+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return P(E)}function S(){return P(o)}function C(T){function E(_,F,N,G,B){if(typeof T!="function")return new y("Property `"+B+"` of component `"+N+"` has invalid PropType notation inside arrayOf.");var $=_[F];if(!Array.isArray($)){var W=I($);return new y("Invalid "+G+" `"+B+"` of type "+("`"+W+"` supplied to `"+N+"`, expected an array."))}for(var H=0;H<$.length;H++){var z=T($,H,N,G,B+"["+H+"]",n);if(z instanceof Error)return z}return null}return P(E)}function D(){function T(E,_,F,N,G){var B=E[_];if(!l(B)){var $=I(B);return new y("Invalid "+N+" `"+G+"` of type "+("`"+$+"` supplied to `"+F+"`, expected a single ReactElement."))}return null}return P(T)}function p(){function T(E,_,F,N,G){var B=E[_];if(!e.isValidElementType(B)){var $=I(B);return new y("Invalid "+N+" `"+G+"` of type "+("`"+$+"` supplied to `"+F+"`, expected a single ReactElement type."))}return null}return P(T)}function M(T){function E(_,F,N,G,B){if(!(_[F]instanceof T)){var $=T.name||h,W=le(_[F]);return new y("Invalid "+G+" `"+B+"` of type "+("`"+W+"` supplied to `"+N+"`, expected ")+("instance of `"+$+"`."))}return null}return P(E)}function U(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 E(_,F,N,G,B){for(var $=_[F],W=0;W<T.length;W++)if(x($,T[W]))return null;var H=JSON.stringify(T,function(ge,j){var Se=O(j);return Se==="symbol"?String(j):j});return new y("Invalid "+G+" `"+B+"` of value `"+String($)+"` "+("supplied to `"+N+"`, expected one of "+H+"."))}return P(E)}function R(T){function E(_,F,N,G,B){if(typeof T!="function")return new y("Property `"+B+"` of component `"+N+"` has invalid PropType notation inside objectOf.");var $=_[F],W=I($);if(W!=="object")return new y("Invalid "+G+" `"+B+"` of type "+("`"+W+"` supplied to `"+N+"`, expected an object."));for(var H in $)if(r($,H)){var z=T($,H,N,G,B+"."+H,n);if(z instanceof Error)return z}return null}return P(E)}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 E=0;E<T.length;E++){var _=T[E];if(typeof _!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+k(_)+" at index "+E+"."),o}function F(N,G,B,$,W){for(var H=[],z=0;z<T.length;z++){var ge=T[z],j=ge(N,G,B,$,W,n);if(j==null)return null;j.data&&r(j.data,"expectedType")&&H.push(j.data.expectedType)}var Se=H.length>0?", expected one of type ["+H.join(", ")+"]":"";return new y("Invalid "+$+" `"+W+"` supplied to "+("`"+B+"`"+Se+"."))}return P(F)}function Y(){function T(E,_,F,N,G){return se(E[_])?null:new y("Invalid "+N+" `"+G+"` supplied to "+("`"+F+"`, expected a ReactNode."))}return P(T)}function ae(T,E,_,F,N){return new y((T||"React class")+": "+E+" type `"+_+"."+F+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function Te(T){function E(_,F,N,G,B){var $=_[F],W=I($);if(W!=="object")return new y("Invalid "+G+" `"+B+"` of type `"+W+"` "+("supplied to `"+N+"`, expected `object`."));for(var H in T){var z=T[H];if(typeof z!="function")return ae(N,G,B,H,O(z));var ge=z($,H,N,G,B+"."+H,n);if(ge)return ge}return null}return P(E)}function ce(T){function E(_,F,N,G,B){var $=_[F],W=I($);if(W!=="object")return new y("Invalid "+G+" `"+B+"` of type `"+W+"` "+("supplied to `"+N+"`, expected `object`."));var H=t({},_[F],T);for(var z in H){var ge=T[z];if(r(T,z)&&typeof ge!="function")return ae(N,G,B,z,O(ge));if(!ge)return new y("Invalid "+G+" `"+B+"` key `"+z+"` supplied to `"+N+"`.\nBad object: "+JSON.stringify(_[F],null," ")+`
20
- Valid keys: `+JSON.stringify(Object.keys(T),null," "));var j=ge($,z,N,G,B+"."+z,n);if(j)return j}return null}return P(E)}function se(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(se);if(T===null||l(T))return!0;var E=f(T);if(E){var _=E.call(T),F;if(E!==T.entries){for(;!(F=_.next()).done;)if(!se(F.value))return!1}else for(;!(F=_.next()).done;){var N=F.value;if(N&&!se(N[1]))return!1}}else return!1;return!0;default:return!1}}function ve(T,E){return T==="symbol"?!0:E?E["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&E instanceof Symbol:!1}function I(T){var E=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":ve(E,T)?"symbol":E}function O(T){if(typeof T>"u"||T===null)return""+T;var E=I(T);if(E==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return E}function k(T){var E=O(T);switch(E){case"array":case"object":return"an "+E;case"boolean":case"date":case"regexp":return"a "+E;default:return E}}function le(T){return!T.constructor||!T.constructor.name?h:T.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},Tr}var wr,Wo;function Xf(){if(Wo)return wr;Wo=1;var e=vr();function t(){}function n(){}return n.resetWarningCache=t,wr=function(){function r(o,l,a,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},wr}if(process.env.NODE_ENV!=="production"){var Zf=_o(),Jf=!0;fe.exports=Hf()(Zf.isElement,Jf)}else fe.exports=Xf()();function Pr(){return Pr=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},Pr.apply(this,arguments)}function Qf(e,t){if(e==null)return{};var n=ed(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 ed(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 Sr=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=Qf(e,["color","size"]);return v.createElement("svg",Pr({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"}))});Sr.propTypes={color:fe.exports.string,size:fe.exports.oneOfType([fe.exports.string,fe.exports.number])},Sr.displayName="Check";const td=Sr;function Cr(){return Cr=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},Cr.apply(this,arguments)}function nd(e,t){if(e==null)return{};var n=rd(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 rd(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 Er=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=nd(e,["color","size"]);return v.createElement("svg",Cr({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"}))});Er.propTypes={color:fe.exports.string,size:fe.exports.oneOfType([fe.exports.string,fe.exports.number])},Er.displayName="Copy";const sd=Er;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 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 jr=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",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),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"}))});jr.propTypes={color:fe.exports.string,size:fe.exports.oneOfType([fe.exports.string,fe.exports.number])},jr.displayName="Edit";const ad=jr;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 ld(e,t){if(e==null)return{};var n=ud(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 ud(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",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:"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"}))});Dr.propTypes={color:fe.exports.string,size:fe.exports.oneOfType([fe.exports.string,fe.exports.number])},Dr.displayName="Trash";const cd=Dr,fd=({user:e,messages:t,updateMessages:n,onMessageSent:r,onEditMessage:s,onDeleteMessage:i})=>{const o=v.useRef(null),[l,a]=v.useState(!1),[c,u]=v.useState(null),[f,h]=v.useState(null),m=()=>{setTimeout(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},100)};v.useEffect(()=>{const p=()=>{h(null)};return window.addEventListener("scroll",p,!0),()=>{window.removeEventListener("scroll",p,!0)}},[h]);const x=(p,M)=>{p.preventDefault();const U=window.scrollX,R=window.scrollY;h({x:p.clientX+U,y:p.clientY+R,message:M})},y=()=>{h(null)},P=p=>{const M=new Ot({id:new Date().toString(),text:p,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,M]),r(M),m()},b=p=>{const M=new Ot({id:new Date().toString(),text:"",attachment:p,attachmentType:Be.Voice,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,M]),r(M),m()},S=p=>{const M=URL.createObjectURL(p),U=new Ot({id:new Date().toString(),text:"",attachment:M,attachmentType:Be.File,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,U]),r(U),m()};return{handleDeleteConfirmation:()=>{c&&(i(c),u(null)),a(!1)},handleCloseContextMenu:y,contextMenuItems:[{name:"Edit",icon:g.exports.jsx(ad,{className:"text-gray-600"}),onlyCurrentUserMessage:!0,onClick:p=>{console.log("Edit clicked"),y(),s(p)}},{name:"Delete",icon:g.exports.jsx(cd,{className:"text-red-600"}),onlyCurrentUserMessage:!0,onClick:p=>{u(p),a(!0),y()}},{name:"Select",icon:g.exports.jsx(td,{className:"text-green-600"}),onClick:()=>{console.log("Select clicked"),y()}},{name:"Copy",icon:g.exports.jsx(sd,{className:"text-blue-600"}),onClick:()=>{console.log("Copy clicked"),y()}}],handleSendFile:S,handleSendVoice:b,handleSendMessage:P,handleContextMenu:x,isModalOpen:l,contextMenu:f,chatRef:o,setIsModalOpen:a}},dd=({width:e="400px",height:t="600px",isLoadingChat:n,className:r,style:s,messages:i,user:o,updateMessages:l,onMessageSent:a,onDeleteMessage:c,onEditMessage:u,dynamicSymbolAssignments:f,backgroundImage:h})=>{var R,Q;const{handleDeleteConfirmation:m,handleCloseContextMenu:x,handleSendFile:y,handleSendVoice:P,handleSendMessage:b,handleContextMenu:S,contextMenuItems:C,isModalOpen:D,contextMenu:p,chatRef:M,setIsModalOpen:U}=fd({user:o,messages:i,updateMessages:l,onMessageSent:a,onEditMessage:u,onDeleteMessage:c});return g.exports.jsxs("div",{className:`flex flex-col !bg-cover ${r}`,style:{width:e,height:t,background:"url("+h+")",...s},onClick:x,children:[g.exports.jsx("div",{ref:M,className:`flex flex-col gap-2 flex-1 p-3 pb-16 ${p?"overflow-hidden pr-[22px]":"overflow-y-scroll"}`,children:n?g.exports.jsx(Vo,{className:"mt-3",size:27,color:"text-gray-800"}):g.exports.jsx($r,{children:i.map((Y,ae)=>{var se,ve,I;const Te=Y!=null&&Y.attachment?g.exports.jsx($f,{attachment:Y.attachment,attachmentType:Y==null?void 0:Y.attachmentType},ae):null;if(Y.isRightSided)return g.exports.jsx(zf,{media:Te,handleContextMenu:S,message:Y},ae);const ce=((ve=(se=i[ae-1])==null?void 0:se.user)==null?void 0:ve.id)!==((I=Y==null?void 0:Y.user)==null?void 0:I.id);return g.exports.jsx(Uf,{showUserProfile:ce,media:Te,handleContextMenu:S,message:Y},ae)})})}),g.exports.jsx(Of,{isOpen:D,onClose:()=>U(!1),onConfirm:m,header:"Confirm Delete",question:"Are you sure you want to delete this message?"}),p&&((R=p==null?void 0:p.message)!=null&&R.id)?g.exports.jsx(Lf,{items:C,isVisible:Boolean(p),messageId:String(p==null?void 0:p.message.id),isCurrentUserMessage:((Q=p==null?void 0:p.message)==null?void 0:Q.user.id)===o.id,position:{x:p==null?void 0:p.x,y:p==null?void 0:p.y}}):null,g.exports.jsx(If,{onSendVoice:P,onSendMessage:b,onFileSend:y,dynamicSymbolAssignments:f})]})};de.AttachmentTypeEnum=Be,de.Button=oa,de.Chat=dd,de.MessageEntity=Ot,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});
19
+ `),()=>{document.head.removeChild(m)}},[t]),g.exports.jsx(aa,{isPresent:t,childRef:s,sizeRef:i,children:tn.cloneElement(e,{ref:s})})}const ua=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l})=>{const a=rn(ca),c=v.useId(),u=v.useCallback(h=>{a.set(h,!0);for(const m of a.values())if(!m)return;r&&r()},[a,r]),f=v.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:h=>(a.set(h,!1),()=>a.delete(h))}),i?[Math.random(),u]:[n,u]);return v.useMemo(()=>{a.forEach((h,m)=>a.set(m,!1))},[n]),tn.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),o==="popLayout"&&(e=g.exports.jsx(la,{isPresent:n,anchorX:l,children:e})),g.exports.jsx(Lt.Provider,{value:f,children:e})};function ca(){return new Map}function Fr(e=!0){const t=v.useContext(Lt);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 kt=e=>e.key||"";function Nr(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const on=typeof window<"u",Br=on?v.useLayoutEffect:v.useEffect,$r=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left"})=>{const[a,c]=Fr(o),u=v.useMemo(()=>Nr(e),[e]),f=o&&!a?[]:u.map(kt),h=v.useRef(!0),m=v.useRef(u),x=rn(()=>new Map),[y,P]=v.useState(u),[b,S]=v.useState(u);Br(()=>{h.current=!1,m.current=u;for(let p=0;p<b.length;p++){const M=kt(b[p]);f.includes(M)?x.delete(M):x.get(M)!==!0&&x.set(M,!1)}},[b,f.length,f.join("-")]);const C=[];if(u!==y){let p=[...u];for(let M=0;M<b.length;M++){const B=b[M],R=kt(B);f.includes(R)||(p.splice(M,0,B),C.push(B))}return i==="wait"&&C.length&&(p=C),S(Nr(p)),P(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(nn);return g.exports.jsx(g.exports.Fragment,{children:b.map(p=>{const M=kt(p),B=o&&!a?!1:u===b||f.includes(M),R=()=>{if(x.has(M))x.set(M,!0);else return;let Q=!0;x.forEach(Y=>{Y||(Q=!1)}),Q&&(D==null||D(),S(m.current),o&&(c==null||c()),r&&r())};return g.exports.jsx(ua,{isPresent:B,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,onExitComplete:B?void 0:R,anchorX:l,children:p},M)})})},be=e=>e;let He=be,Le=be;process.env.NODE_ENV!=="production"&&(He=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Le=(e,t)=>{if(!e)throw new Error(t)});function an(e){let t;return()=>(t===void 0&&(t=e()),t)}const Xe=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Ae=e=>e*1e3,Re=e=>e/1e3,Ur={skipAnimations:!1,useManualTiming:!1},_t=["read","resolveKeyframes","update","preRender","render","postRender"],ke={value:null,addProjectionMetrics:null};function fa(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},a=0;function c(f){o.has(f)&&(u.schedule(f),e()),a++,f(l)}const u={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(l=f,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),t&&ke.value&&ke.value.frameloop[t].push(a),a=0,n.clear(),s=!1,i&&(i=!1,u.process(f))}};return u}const da=40;function Wr(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=_t.reduce((b,S)=>(b[S]=fa(i,t?S:void 0),b),{}),{read:l,resolveKeyframes:a,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,da),1),s.timestamp=b,s.isProcessing=!0,l.process(s),a.process(s),c.process(s),u.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(m))},x=()=>{n=!0,r=!0,s.isProcessing||e(m)};return{schedule:_t.reduce((b,S)=>{const C=o[S];return b[S]=(D,p=!1,M=!1)=>(n||x(),C.schedule(D,p,M)),b},{}),cancel:b=>{for(let S=0;S<_t.length;S++)o[_t[S]].cancel(b)},state:s,steps:o}}const{schedule:te,cancel:_e,state:he,steps:ln}=Wr(typeof requestAnimationFrame<"u"?requestAnimationFrame:be,!0),zr=v.createContext({strict:!1}),Yr={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"]},Ze={};for(const e in Yr)Ze[e]={isEnabled:t=>Yr[e].some(n=>!!t[n])};function ha(e){for(const t in e)Ze[t]={...Ze[t],...e[t]}}const pa=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 It(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||pa.has(e)}let Kr=e=>!It(e);function ma(e){e&&(Kr=t=>t.startsWith("on")?!It(t):e(t))}try{ma(require("@emotion/is-prop-valid").default)}catch{}function ga(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Kr(s)||n===!0&&It(s)||!t&&!It(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Gr=new Set;function Ft(e,t,n){e||Gr.has(t)||(console.warn(t),n&&console.warn(n),Gr.add(t))}function ya(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 Nt=v.createContext({});function Bt(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function dt(e){return typeof e=="string"||Array.isArray(e)}const un=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],cn=["initial",...un];function $t(e){return Bt(e.animate)||cn.some(t=>dt(e[t]))}function qr(e){return Boolean($t(e)||e.variants)}function va(e,t){if($t(e)){const{initial:n,animate:r}=e;return{initial:n===!1||dt(n)?n:void 0,animate:dt(r)?r:void 0}}return e.inherit!==!1?t:{}}function xa(e){const{initial:t,animate:n}=va(e,v.useContext(Nt));return v.useMemo(()=>({initial:t,animate:n}),[Hr(t),Hr(n)])}function Hr(e){return Array.isArray(e)?e.join(" "):e}const ba=Symbol.for("motionComponentSymbol");function Je(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ta(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):Je(n)&&(n.current=r))},[t])}const fn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Xr="data-"+fn("framerAppearId"),{schedule:dn,cancel:Id}=Wr(queueMicrotask,!1),Zr=v.createContext({});function wa(e,t,n,r,s){var i,o;const{visualElement:l}=v.useContext(Nt),a=v.useContext(zr),c=v.useContext(Lt),u=v.useContext(sn).reducedMotion,f=v.useRef(null);r=r||a.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=f.current,m=v.useContext(Zr);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&Pa(f.current,n,s,m);const x=v.useRef(!1);v.useInsertionEffect(()=>{h&&x.current&&h.update(n,c)});const y=n[Xr],P=v.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 Br(()=>{h&&(x.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),dn.render(h.render),P.current&&h.animationState&&h.animationState.animateChanges())}),v.useEffect(()=>{h&&(!P.current&&h.animationState&&h.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,y)}),P.current=!1))}),h}function Pa(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:a,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Jr(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:Boolean(o)||l&&Je(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:a,layoutRoot:c})}function Jr(e){if(e)return e.options.allowProjection!==!1?e.projection:Jr(e.parent)}function Sa({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,o;e&&ha(e);function l(c,u){let f;const h={...v.useContext(sn),...c,layoutId:Ca(c)},{isStatic:m}=h,x=xa(c),y=r(c,m);if(!m&&on){Ea(h,e);const P=Aa(h);f=P.MeasureLayout,x.visualElement=wa(s,y,h,t,P.ProjectionNode)}return g.exports.jsxs(Nt.Provider,{value:x,children:[f&&x.visualElement?g.exports.jsx(f,{visualElement:x.visualElement,...h}):null,n(s,c,Ta(y,x.visualElement,u),y,m,x.visualElement)]})}l.displayName=`motion.${typeof s=="string"?s:`create(${(o=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&o!==void 0?o:""})`}`;const a=v.forwardRef(l);return a[ba]=s,a}function Ca({layoutId:e}){const t=v.useContext(nn).id;return t&&e!==void 0?t+"-"+e:e}function Ea(e,t){const n=v.useContext(zr).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?He(!1,r):Le(!1,r)}}function Aa(e){const{drag:t,layout:n}=Ze;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 Qr=e=>t=>typeof t=="string"&&t.startsWith(e),hn=Qr("--"),ja=Qr("var(--"),pn=e=>ja(e)?Ma.test(e.split("/*")[0].trim()):!1,Ma=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ht={};function Da(e){for(const t in e)ht[t]=e[t],hn(t)&&(ht[t].isCSSVariable=!0)}const Qe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ue=new Set(Qe);function es(e,{layout:t,layoutId:n}){return Ue.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ht[e]||e==="opacity")}const pe=e=>Boolean(e&&e.getVelocity),ts=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ve=(e,t,n)=>n>t?t:n<e?e:n,et={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},pt={...et,transform:e=>Ve(0,1,e)},Ut={...et,default:1},mt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ie=mt("deg"),je=mt("%"),V=mt("px"),Ra=mt("vh"),Va=mt("vw"),ns={...je,parse:e=>je.parse(e)/100,transform:e=>je.transform(e*100)},Oa={borderWidth:V,borderTopWidth:V,borderRightWidth:V,borderBottomWidth:V,borderLeftWidth:V,borderRadius:V,radius:V,borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,width:V,maxWidth:V,height:V,maxHeight:V,top:V,right:V,bottom:V,left:V,padding:V,paddingTop:V,paddingRight:V,paddingBottom:V,paddingLeft:V,margin:V,marginTop:V,marginRight:V,marginBottom:V,marginLeft:V,backgroundPositionX:V,backgroundPositionY:V},La={rotate:Ie,rotateX:Ie,rotateY:Ie,rotateZ:Ie,scale:Ut,scaleX:Ut,scaleY:Ut,scaleZ:Ut,skew:Ie,skewX:Ie,skewY:Ie,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,transformPerspective:V,opacity:pt,originX:ns,originY:ns,originZ:V},rs={...et,transform:Math.round},mn={...Oa,...La,zIndex:rs,size:V,fillOpacity:pt,strokeOpacity:pt,numOctaves:rs},ka={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_a=Qe.length;function Ia(e,t,n){let r="",s=!0;for(let i=0;i<_a;i++){const o=Qe[i],l=e[o];if(l===void 0)continue;let a=!0;if(typeof l=="number"?a=l===(o.startsWith("scale")?1:0):a=parseFloat(l)===0,!a||n){const c=ts(l,mn[o]);if(!a){s=!1;const u=ka[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function gn(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,l=!1;for(const a in t){const c=t[a];if(Ue.has(a)){o=!0;continue}else if(hn(a)){s[a]=c;continue}else{const u=ts(c,mn[a]);a.startsWith("origin")?(l=!0,i[a]=u):r[a]=u}}if(t.transform||(o||n?r.transform=Ia(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:a="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${a} ${c} ${u}`}}const yn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ss(e,t,n){for(const r in t)!pe(t[r])&&!es(r,n)&&(e[r]=t[r])}function Fa({transformTemplate:e},t){return v.useMemo(()=>{const n=yn();return gn(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Na(e,t){const n=e.style||{},r={};return ss(r,n,e),Object.assign(r,Fa(e,t)),r}function Ba(e,t){const n={},r=Na(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 $a=["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 vn(e){return typeof e!="string"||e.includes("-")?!1:!!($a.indexOf(e)>-1||/[A-Z]/u.test(e))}const Ua={offset:"stroke-dashoffset",array:"stroke-dasharray"},Wa={offset:"strokeDashoffset",array:"strokeDasharray"};function za(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?Ua:Wa;e[i.offset]=V.transform(-r);const o=V.transform(t),l=V.transform(n);e[i.array]=`${o} ${l}`}function is(e,t,n){return typeof e=="string"?e:V.transform(t+n*e)}function Ya(e,t,n){const r=is(t,e.x,e.width),s=is(n,e.y,e.height);return`${r} ${s}`}function xn(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:l=1,pathOffset:a=0,...c},u,f){if(gn(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:x}=e;h.transform&&(x&&(m.transform=h.transform),delete h.transform),x&&(s!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=Ya(x,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&&za(h,o,l,a,!1)}const os=()=>({...yn(),attrs:{}}),bn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ka(e,t,n,r){const s=v.useMemo(()=>{const i=os();return xn(i,t,bn(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};ss(i,e.style,e),s.style={...i,...s.style}}return s}function Ga(e=!1){return(n,r,s,{latestValues:i},o)=>{const a=(vn(n)?Ka:Ba)(r,i,o,n),c=ga(r,typeof n=="string",e),u=n!==v.Fragment?{...c,...a,ref:s}:{},{children:f}=r,h=v.useMemo(()=>pe(f)?f.get():f,[f]);return v.createElement(n,{...u,children:h})}}function as(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Tn(e,t,n,r){if(typeof t=="function"){const[s,i]=as(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]=as(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const wn=e=>Array.isArray(e),qa=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),Ha=e=>wn(e)?e[e.length-1]||0:e;function Wt(e){const t=pe(e)?e.get():e;return qa(t)?t.toValue():t}function Xa({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const o={latestValues:Za(r,s,i,e),renderState:t()};return n&&(o.onMount=l=>n({props:r,current:l,...o}),o.onUpdate=l=>n(l)),o}const ls=e=>(t,n)=>{const r=v.useContext(Nt),s=v.useContext(Lt),i=()=>Xa(e,t,r,s);return n?i():rn(i)};function Za(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=Wt(i[h]);let{initial:o,animate:l}=e;const a=$t(e),c=qr(e);t&&c&&!a&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?l:o;if(f&&typeof f!="boolean"&&!Bt(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const x=Tn(e,h[m]);if(x){const{transitionEnd:y,transition:P,...b}=x;for(const S in b){let C=b[S];if(Array.isArray(C)){const D=u?C.length-1:0;C=C[D]}C!==null&&(s[S]=C)}for(const S in y)s[S]=y[S]}}}return s}function Pn(e,t,n){var r;const{style:s}=e,i={};for(const o in s)(pe(s[o])||t.style&&pe(t.style[o])||es(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 Ja={useVisualState:ls({scrapeMotionValuesFromProps:Pn,createRenderState:yn})};function us(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 cs(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 fs=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 ds(e,t,n,r){cs(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(fs.has(s)?s:fn(s),t.attrs[s])}function hs(e,t,n){const r=Pn(e,t,n);for(const s in e)if(pe(e[s])||pe(t[s])){const i=Qe.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}const ps=["x","y","width","height","cx","cy","r"],Qa={useVisualState:ls({scrapeMotionValuesFromProps:hs,createRenderState:os,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in s)if(Ue.has(l)){i=!0;break}}if(!i)return;let o=!t;if(t)for(let l=0;l<ps.length;l++){const a=ps[l];e[a]!==t[a]&&(o=!0)}o&&te.read(()=>{us(n,r),te.render(()=>{xn(r,s,bn(n.tagName),e.transformTemplate),ds(n,r)})})}})};function el(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...vn(r)?Qa:Ja,preloadedFeatures:e,useRender:Ga(s),createVisualElement:t,Component:r};return Sa(o)}}function gt(e,t,n){const r=e.getProps();return Tn(r,t,n!==void 0?n:r.custom,e)}const tl=an(()=>window.ScrollTimeline!==void 0);class nl{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(tl()&&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 rl extends nl{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Sn(e,t){return e?e[t]||e.default||e:void 0}const Cn=2e4;function ms(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Cn;)t+=n,r=e.next(t);return t>=Cn?1/0:t}function En(e){return typeof e=="function"}function gs(e,t){e.timeline=t,e.onfinish=null}const An=e=>Array.isArray(e)&&typeof e[0]=="number",sl={linearEasing:void 0};function il(e,t){const n=an(e);return()=>{var r;return(r=sl[t])!==null&&r!==void 0?r:n()}}const zt=il(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ys=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=e(Xe(0,s-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function vs(e){return Boolean(typeof e=="function"&&zt()||!e||typeof e=="string"&&(e in jn||zt())||An(e)||Array.isArray(e)&&e.every(vs))}const yt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,jn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yt([0,.65,.55,1]),circOut:yt([.55,0,1,.45]),backIn:yt([.31,.01,.66,-.59]),backOut:yt([.33,1.53,.69,.99])};function xs(e,t){if(e)return typeof e=="function"&&zt()?ys(e,t):An(e)?yt(e):Array.isArray(e)?e.map(n=>xs(n,t)||jn.easeOut):jn[e]}const Ee={x:!1,y:!1};function bs(){return Ee.x||Ee.y}function ol(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 Ts(e,t){const n=ol(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function ws(e){return!(e.pointerType==="touch"||bs())}function al(e,t,n={}){const[r,s,i]=Ts(e,n),o=l=>{if(!ws(l))return;const{target:a}=l,c=t(a,l);if(typeof c!="function"||!a)return;const u=f=>{ws(f)&&(c(f),a.removeEventListener("pointerleave",u))};a.addEventListener("pointerleave",u,s)};return r.forEach(l=>{l.addEventListener("pointerenter",o,s)}),i}function Yt(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 Ps=(e,t)=>t?e===t?!0:Ps(e,t.parentElement):!1,Mn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,ll=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ul(e){return ll.has(e.tagName)||e.tabIndex!==-1}const vt=new WeakSet;function Ss(e){return t=>{t.key==="Enter"&&e(t)}}function Dn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const cl=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Ss(()=>{if(vt.has(n))return;Dn(n,"down");const s=Ss(()=>{Dn(n,"up")}),i=()=>Dn(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 Cs(e){return Mn(e)&&!bs()}function fl(e,t,n={}){const[r,s,i]=Ts(e,n),o=l=>{const a=l.currentTarget;if(!a||!Cs(l)||vt.has(a))return;vt.add(a),Yt(l,"set");const c=t(a,l),u=(m,x)=>{a.removeEventListener("pointerup",f),a.removeEventListener("pointercancel",h),Yt(m,"release"),!(!Cs(m)||!vt.has(a))&&(vt.delete(a),typeof c=="function"&&c(m,{success:x}))},f=m=>{(m.isTrusted?dl(m,a instanceof Element?a.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?u(m,!1):u(m,!(a instanceof Element)||Ps(a,m.target))},h=m=>{u(m,!1)};a.addEventListener("pointerup",f,s),a.addEventListener("pointercancel",h,s),a.addEventListener("lostpointercapture",h,s)};return r.forEach(l=>{l=n.useGlobalTarget?window:l;let a=!1;l instanceof HTMLElement&&(a=!0,!ul(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0)),l.addEventListener("pointerdown",o,s),a&&l.addEventListener("focus",c=>cl(c,s),s)}),i}function dl(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function hl(e){return e==="x"||e==="y"?Ee[e]?null:(Ee[e]=!0,()=>{Ee[e]=!1}):Ee.x||Ee.y?null:(Ee.x=Ee.y=!0,()=>{Ee.x=Ee.y=!1})}const Es=new Set(["width","height","top","left","right","bottom",...Qe]);let Kt;function pl(){Kt=void 0}const Me={now:()=>(Kt===void 0&&Me.set(he.isProcessing||Ur.useManualTiming?he.timestamp:performance.now()),Kt),set:e=>{Kt=e,queueMicrotask(pl)}};function Rn(e,t){e.indexOf(t)===-1&&e.push(t)}function Vn(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class On{constructor(){this.subscriptions=[]}add(t){return Rn(this.subscriptions,t),()=>Vn(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 As(e,t){return t?e*(1e3/t):0}const js=30,ml=e=>!isNaN(parseFloat(e));class gl{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Me.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=Me.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ml(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 On);const r=this.events[t].add(n);return t==="change"?()=>{r(),te.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=Me.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>js)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,js);return As(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 xt(e,t){return new gl(e,t)}function yl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,xt(n))}function vl(e,t){const n=gt(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=Ha(i[o]);yl(e,o,l)}}function xl(e){return Boolean(pe(e)&&e.add)}function Ln(e,t){const n=e.getValue("willChange");if(xl(n))return n.add(t)}function Ms(e){return e.props[Xr]}const bl={current:!1},Ds=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Tl=1e-7,wl=12;function Pl(e,t,n,r,s){let i,o,l=0;do o=t+(n-t)/2,i=Ds(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>Tl&&++l<wl);return o}function bt(e,t,n,r){if(e===t&&n===r)return be;const s=i=>Pl(i,0,1,e,n);return i=>i===0||i===1?i:Ds(s(i),t,r)}const Rs=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Vs=e=>t=>1-e(1-t),Os=bt(.33,1.53,.69,.99),kn=Vs(Os),Ls=Rs(kn),ks=e=>(e*=2)<1?.5*kn(e):.5*(2-Math.pow(2,-10*(e-1))),_n=e=>1-Math.sin(Math.acos(e)),_s=Vs(_n),Is=Rs(_n),Fs=e=>/^0[^.\s]+$/u.test(e);function Sl(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Fs(e):!0}const Tt=e=>Math.round(e*1e5)/1e5,In=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Cl(e){return e==null}const El=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Fn=(e,t)=>n=>Boolean(typeof n=="string"&&El.test(n)&&n.startsWith(e)||t&&!Cl(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ns=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(In);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Al=e=>Ve(0,255,e),Nn={...et,transform:e=>Math.round(Al(e))},We={test:Fn("rgb","red"),parse:Ns("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Nn.transform(e)+", "+Nn.transform(t)+", "+Nn.transform(n)+", "+Tt(pt.transform(r))+")"};function jl(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 Bn={test:Fn("#"),parse:jl,transform:We.transform},tt={test:Fn("hsl","hue"),parse:Ns("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+je.transform(Tt(t))+", "+je.transform(Tt(n))+", "+Tt(pt.transform(r))+")"},me={test:e=>We.test(e)||Bn.test(e)||tt.test(e),parse:e=>We.test(e)?We.parse(e):tt.test(e)?tt.parse(e):Bn.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?We.transform(e):tt.transform(e)},Ml=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Dl(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(In))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Ml))===null||n===void 0?void 0:n.length)||0)>0}const Bs="number",$s="color",Rl="var",Vl="var(",Us="${}",Ol=/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 wt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=t.replace(Ol,a=>(me.test(a)?(r.color.push(i),s.push($s),n.push(me.parse(a))):a.startsWith(Vl)?(r.var.push(i),s.push(Rl),n.push(a)):(r.number.push(i),s.push(Bs),n.push(parseFloat(a))),++i,Us)).split(Us);return{values:n,split:l,indexes:r,types:s}}function Ws(e){return wt(e).values}function zs(e){const{split:t,types:n}=wt(e),r=t.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],s[o]!==void 0){const l=n[o];l===Bs?i+=Tt(s[o]):l===$s?i+=me.transform(s[o]):i+=s[o]}return i}}const Ll=e=>typeof e=="number"?0:e;function kl(e){const t=Ws(e);return zs(e)(t.map(Ll))}const Fe={test:Dl,parse:Ws,createTransformer:zs,getAnimatableNone:kl},_l=new Set(["brightness","contrast","saturate","opacity"]);function Il(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(In)||[];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 Fl=/\b([a-z-]*)\(.*?\)/gu,$n={...Fe,getAnimatableNone:e=>{const t=e.match(Fl);return t?t.map(Il).join(" "):e}},Nl={...mn,color:me,backgroundColor:me,outlineColor:me,fill:me,stroke:me,borderColor:me,borderTopColor:me,borderRightColor:me,borderBottomColor:me,borderLeftColor:me,filter:$n,WebkitFilter:$n},Un=e=>Nl[e];function Ys(e,t){let n=Un(e);return n!==$n&&(n=Fe),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Bl=new Set(["auto","none","0"]);function $l(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!Bl.has(i)&&wt(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=Ys(n,s)}const Ks=e=>e===et||e===V,Gs=(e,t)=>parseFloat(e.split(", ")[t]),qs=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Gs(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Gs(i[1],e):0}},Ul=new Set(["x","y","z"]),Wl=Qe.filter(e=>!Ul.has(e));function zl(e){const t=[];return Wl.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const nt={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:qs(4,13),y:qs(5,14)};nt.translateX=nt.x,nt.translateY=nt.y;const ze=new Set;let Wn=!1,zn=!1;function Hs(){if(zn){const e=Array.from(ze).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=zl(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 l;(l=r.getValue(i))===null||l===void 0||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}zn=!1,Wn=!1,ze.forEach(e=>e.complete()),ze.clear()}function Xs(){ze.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zn=!0)})}function Yl(){Xs(),Hs()}class Yn{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?(ze.add(this),Wn||(Wn=!0,te.read(Xs),te.resolveKeyframes(Hs))):(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(),l=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const a=r.readValue(n,l);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=l),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),ze.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ze.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Zs=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Kl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Gl(e){const t=Kl.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const ql=4;function Js(e,t,n=1){Le(n<=ql,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,s]=Gl(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return Zs(o)?parseFloat(o):o}return pn(s)?Js(s,t,n+1):s}const Qs=e=>t=>t.test(e),ei=[et,V,je,Ie,Va,Ra,{test:e=>e==="auto",parse:e=>e}],ti=e=>ei.find(Qs(e));class ni extends Yn{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 a=0;a<t.length;a++){let c=t[a];if(typeof c=="string"&&(c=c.trim(),pn(c))){const u=Js(c,n.current);u!==void 0&&(t[a]=u),a===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Es.has(r)||t.length!==2)return;const[s,i]=t,o=ti(s),l=ti(i);if(o!==l)if(Ks(o)&&Ks(l))for(let a=0;a<t.length;a++){const c=t[a];typeof c=="string"&&(t[a]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)Sl(t[s])&&r.push(s);r.length&&$l(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=nt[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,l=s[o];s[o]=nt[r](n.measureViewportBox(),window.getComputedStyle(n.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([a,c])=>{n.getValue(a).set(c)}),this.resolveNoneKeyframes()}}const ri=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Fe.test(e)||e==="0")&&!e.startsWith("url("));function Hl(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 Xl(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=ri(s,t),l=ri(i,t);return He(o===l,`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||!l?!1:Hl(e)||(n==="spring"||En(n))&&r}const Zl=e=>e!==null;function Gt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(Zl),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const Jl=40;class si{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Me.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Jl?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Yl(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Me.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:l,onUpdate:a,isGenerator:c}=this.options;if(!c&&!Xl(t,r,s,i))if(o)this.options.duration=0;else{a&&a(Gt(t,this.options,n)),l&&l(),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 Pt={layout:0,mainThread:0,waapi:0},ne=(e,t,n)=>e+(t-e)*n;function Kn(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 Ql({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 l=n<.5?n*(1+t):n+t-n*t,a=2*n-l;s=Kn(a,l,e+1/3),i=Kn(a,l,e),o=Kn(a,l,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 Gn=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},eu=[Bn,We,tt],tu=e=>eu.find(t=>t.test(e));function ii(e){const t=tu(e);if(He(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===tt&&(n=Ql(n)),n}const oi=(e,t)=>{const n=ii(e),r=ii(t);if(!n||!r)return qt(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=ne(n.alpha,r.alpha,i),We.transform(s))},nu=(e,t)=>n=>t(e(n)),St=(...e)=>e.reduce(nu),qn=new Set(["none","hidden"]);function ru(e,t){return qn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function su(e,t){return n=>ne(e,t,n)}function Hn(e){return typeof e=="number"?su:typeof e=="string"?pn(e)?qt:me.test(e)?oi:au:Array.isArray(e)?ai:typeof e=="object"?me.test(e)?oi:iu:qt}function ai(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Hn(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function iu(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Hn(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function ou(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],l=e.indexes[o][s[o]],a=(n=e.values[l])!==null&&n!==void 0?n:0;r[i]=a,s[o]++}return r}const au=(e,t)=>{const n=Fe.createTransformer(t),r=wt(e),s=wt(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?ru(e,t):St(ai(ou(r,s),s.values),n):(He(!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 li(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ne(e,t,n):Hn(e)(e,t)}const lu=5;function ui(e,t,n){const r=Math.max(t-lu,0);return As(n-e(r),t-r)}const re={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},Xn=.001;function uu({duration:e=re.duration,bounce:t=re.bounce,velocity:n=re.velocity,mass:r=re.mass}){let s,i;He(e<=Ae(re.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=Ve(re.minDamping,re.maxDamping,o),e=Ve(re.minDuration,re.maxDuration,Re(e)),o<1?(s=c=>{const u=c*o,f=u*e,h=u-n,m=Zn(c,o),x=Math.exp(-f);return Xn-h/m*x},i=c=>{const f=c*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(c,2)*e,x=Math.exp(-f),y=Zn(Math.pow(c,2),o);return(-s(c)+Xn>0?-1:1)*((h-m)*x)/y}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Xn+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const l=5/e,a=fu(s,i,l);if(e=Ae(e),isNaN(a))return{stiffness:re.stiffness,damping:re.damping,duration:e};{const c=Math.pow(a,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const cu=12;function fu(e,t,n){let r=n;for(let s=1;s<cu;s++)r=r-e(r)/t(r);return r}function Zn(e,t){return e*Math.sqrt(1-t*t)}const du=["duration","bounce"],hu=["stiffness","damping","mass"];function ci(e,t){return t.some(n=>e[n]!==void 0)}function pu(e){let t={velocity:re.velocity,stiffness:re.stiffness,damping:re.damping,mass:re.mass,isResolvedFromDuration:!1,...e};if(!ci(e,hu)&&ci(e,du))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Ve(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:re.mass,stiffness:s,damping:i}}else{const n=uu(e);t={...t,...n,mass:re.mass},t.isResolvedFromDuration=!0}return t}function fi(e=re.visualDuration,t=re.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],l={done:!1,value:i},{stiffness:a,damping:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:m}=pu({...n,velocity:-Re(n.velocity||0)}),x=h||0,y=c/(2*Math.sqrt(a*u)),P=o-i,b=Re(Math.sqrt(a/u)),S=Math.abs(P)<5;r||(r=S?re.restSpeed.granular:re.restSpeed.default),s||(s=S?re.restDelta.granular:re.restDelta.default);let C;if(y<1){const p=Zn(b,y);C=M=>{const B=Math.exp(-y*b*M);return o-B*((x+y*b*P)/p*Math.sin(p*M)+P*Math.cos(p*M))}}else if(y===1)C=p=>o-Math.exp(-b*p)*(P+(x+b*P)*p);else{const p=b*Math.sqrt(y*y-1);C=M=>{const B=Math.exp(-y*b*M),R=Math.min(p*M,300);return o-B*((x+y*b*P)*Math.sinh(R)+p*P*Math.cosh(R))/p}}const D={calculatedDuration:m&&f||null,next:p=>{const M=C(p);if(m)l.done=p>=f;else{let B=0;y<1&&(B=p===0?Ae(x):ui(C,p,M));const R=Math.abs(B)<=r,Q=Math.abs(o-M)<=s;l.done=R&&Q}return l.value=l.done?o:M,l},toString:()=>{const p=Math.min(ms(D),Cn),M=ys(B=>D.next(p*B).value,p,30);return p+"ms "+M}};return D}function di({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:a,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},m=R=>l!==void 0&&R<l||a!==void 0&&R>a,x=R=>l===void 0?a:a===void 0||Math.abs(l-R)<Math.abs(a-R)?l:a;let y=n*t;const P=f+y,b=o===void 0?P:o(P);b!==P&&(y=b-f);const S=R=>-y*Math.exp(-R/r),C=R=>b+S(R),D=R=>{const Q=S(R),Y=C(R);h.done=Math.abs(Q)<=c,h.value=h.done?b:Y};let p,M;const B=R=>{m(h.value)&&(p=R,M=fi({keyframes:[h.value,x(h.value)],velocity:ui(C,R,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return B(0),{calculatedDuration:null,next:R=>{let Q=!1;return!M&&p===void 0&&(Q=!0,D(R),B(R)),p!==void 0&&R>=p?M.next(R-p):(!Q&&D(R),h)}}}const mu=bt(.42,0,1,1),gu=bt(0,0,.58,1),hi=bt(.42,0,.58,1),yu=e=>Array.isArray(e)&&typeof e[0]!="number",pi={linear:be,easeIn:mu,easeInOut:hi,easeOut:gu,circIn:_n,circInOut:Is,circOut:_s,backIn:kn,backInOut:Ls,backOut:Os,anticipate:ks},mi=e=>{if(An(e)){Le(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,s]=e;return bt(t,n,r,s)}else if(typeof e=="string")return Le(pi[e]!==void 0,`Invalid easing type '${e}'`),pi[e];return e};function vu(e,t,n){const r=[],s=n||li,i=e.length-1;for(let o=0;o<i;o++){let l=s(e[o],e[o+1]);if(t){const a=Array.isArray(t)?t[o]||be:t;l=St(a,l)}r.push(l)}return r}function xu(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Le(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 l=vu(t,r,s),a=l.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(a>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=Xe(e[f],e[f+1],u);return l[f](h)};return n?u=>c(Ve(e[0],e[i-1],u)):c}function bu(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Xe(0,t,r);e.push(ne(n,1,s))}}function Tu(e){const t=[0];return bu(t,e.length-1),t}function wu(e,t){return e.map(n=>n*t)}function Pu(e,t){return e.map(()=>t||hi).splice(0,e.length-1)}function Ct({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=yu(r)?r.map(mi):mi(r),i={done:!1,value:t[0]},o=wu(n&&n.length===t.length?n:Tu(t),e),l=xu(o,t,{ease:Array.isArray(s)?s:Pu(t,s)});return{calculatedDuration:e,next:a=>(i.value=l(a),i.done=a>=e,i)}}const Su=e=>{const t=({timestamp:n})=>e(n);return{start:()=>te.update(t,!0),stop:()=>_e(t),now:()=>he.isProcessing?he.timestamp:Me.now()}},Cu={decay:di,inertia:di,tween:Ct,keyframes:Ct,spring:fi},Eu=e=>e/100;class Jn extends si{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:a}=this.options;a&&a()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,o=(s==null?void 0:s.KeyframeResolver)||Yn,l=(a,c)=>this.onKeyframesResolved(a,c);this.resolver=new o(i,l,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,l=En(n)?n:Cu[n]||Ct;let a,c;process.env.NODE_ENV!=="production"&&l!==Ct&&Le(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),l!==Ct&&typeof t[0]!="number"&&(a=St(Eu,li(t[0],t[1])),t=[0,100]);const u=l({...this.options,keyframes:t});i==="mirror"&&(c=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=ms(u));const{calculatedDuration:f}=u,h=f+s,m=h*(r+1)-s;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:a,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:l,keyframes:a,calculatedDuration:c,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:m,repeatType:x,repeatDelay:y,onUpdate:P}=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),S=this.speed>=0?b<0:b>u;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let C=this.currentTime,D=i;if(m){const R=Math.min(this.currentTime,u)/f;let Q=Math.floor(R),Y=R%1;!Y&&R>=1&&(Y=1),Y===1&&Q--,Q=Math.min(Q,m+1),Boolean(Q%2)&&(x==="reverse"?(Y=1-Y,y&&(Y-=y/f)):x==="mirror"&&(D=o)),C=Ve(0,1,Y)*f}const p=S?{done:!1,value:a[0]}:D.next(C);l&&(p.value=l(p.value));let{done:M}=p;!S&&c!==null&&(M=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const B=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return B&&s!==void 0&&(p.value=Gt(a,this.options,s)),P&&P(p.value),B&&this.finish(),p}get duration(){const{resolved:t}=this;return t?Re(t.calculatedDuration):0}get time(){return Re(this.currentTime)}set time(t){t=Ae(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=Re(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Su,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 Au=new Set(["opacity","clipPath","filter","transform"]);function ju(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeInOut",times:a}={}){const c={[t]:n};a&&(c.offset=a);const u=xs(l,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 Mu=an(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Ht=10,Du=2e4;function Ru(e){return En(e.type)||e.type==="spring"||!vs(e.ease)}function Vu(e,t){const n=new Jn({...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<Du;)r=n.sample(i),s.push(r.value),i+=Ht;return{times:void 0,keyframes:s,duration:i-Ht,ease:"linear"}}const gi={anticipate:ks,backInOut:Ls,circInOut:Is};function Ou(e){return e in gi}class yi extends si{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:i}=this.options;this.resolver=new ni(i,(o,l)=>this.onKeyframesResolved(o,l),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:o,motionValue:l,name:a,startTime:c}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&zt()&&Ou(i)&&(i=gi[i]),Ru(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:x,...y}=this.options,P=Vu(t,y);t=P.keyframes,t.length===1&&(t[1]=t[0]),r=P.duration,s=P.times,i=P.ease,o="keyframes"}const u=ju(l.owner.current,a,t,{...this.options,duration:r,times:s,ease:i});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(gs(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;l.set(Gt(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 Re(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Re(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Ae(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 be;const{animation:r}=n;gs(r,t)}return be}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:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:f,element:h,...m}=this.options,x=new Jn({...m,keyframes:r,duration:s,type:i,ease:o,times:l,isGenerator:!0}),y=Ae(this.time);c.setWithVelocity(x.sample(y-Ht).value,x.sample(y).value,Ht)}const{onStop:a}=this.options;a&&a(),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:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:c}=n.owner.getProps();return Mu()&&r&&Au.has(r)&&!a&&!c&&!s&&i!=="mirror"&&o!==0&&l!=="inertia"}}const Lu={type:"spring",stiffness:500,damping:25,restSpeed:10},ku=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),_u={type:"keyframes",duration:.8},Iu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fu=(e,{keyframes:t})=>t.length>2?_u:Ue.has(e)?e.startsWith("scale")?ku(t[1]):Lu:Iu;function Nu({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:l,from:a,elapsed:c,...u}){return!!Object.keys(u).length}const Qn=(e,t,n,r={},s,i)=>o=>{const l=Sn(r,e)||{},a=l.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Ae(a);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-c,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:s};Nu(l)||(u={...u,...Fu(e,u)}),u.duration&&(u.duration=Ae(u.duration)),u.repeatDelay&&(u.repeatDelay=Ae(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)),(bl.current||Ur.skipAnimations)&&(f=!0,u.duration=0,u.delay=0),f&&!i&&t.get()!==void 0){const h=Gt(u.keyframes,l);if(h!==void 0)return te.update(()=>{u.onUpdate(h),u.onComplete()}),new rl([])}return!i&&yi.supports(u)?new yi(u):new Jn(u)};function Bu({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function vi(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...a}=t;r&&(o=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const f in a){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),m=a[f];if(m===void 0||u&&Bu(u,f))continue;const x={delay:n,...Sn(o||{},f)};let y=!1;if(window.MotionHandoffAnimation){const b=Ms(e);if(b){const S=window.MotionHandoffAnimation(b,f,te);S!==null&&(x.startTime=S,y=!0)}}Ln(e,f),h.start(Qn(f,h,m,e.shouldReduceMotion&&Es.has(f)?{type:!1}:x,e,y));const P=h.animation;P&&c.push(P)}return l&&Promise.all(c).then(()=>{te.update(()=>{l&&vl(e,l)})}),c}function er(e,t,n={}){var r;const s=gt(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(vi(e,s,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=i;return $u(e,t,u+c,f,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[o,l]:[l,o];return c().then(()=>u())}else return Promise.all([o(),l(n.delay)])}function $u(e,t,n=0,r=0,s=1,i){const o=[],l=(e.variantChildren.size-1)*r,a=s===1?(c=0)=>c*r:(c=0)=>l-c*r;return Array.from(e.variantChildren).sort(Uu).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(er(c,t,{...i,delay:n+a(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function Uu(e,t){return e.sortNodePosition(t)}function Wu(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>er(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=er(e,t,n);else{const s=typeof t=="function"?gt(e,t,n.custom):t;r=Promise.all(vi(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function xi(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 zu=cn.length;function bi(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?bi(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<zu;n++){const r=cn[n],s=e.props[r];(dt(s)||s===!1)&&(t[r]=s)}return t}const Yu=[...un].reverse(),Ku=un.length;function Gu(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Wu(e,n,r)))}function qu(e){let t=Gu(e),n=Ti(),r=!0;const s=a=>(c,u)=>{var f;const h=gt(e,u,a==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:x,...y}=h;c={...c,...y,...x}}return c};function i(a){t=a(e)}function o(a){const{props:c}=e,u=bi(e.parent)||{},f=[],h=new Set;let m={},x=1/0;for(let P=0;P<Ku;P++){const b=Yu[P],S=n[b],C=c[b]!==void 0?c[b]:u[b],D=dt(C),p=b===a?S.isActive:null;p===!1&&(x=P);let M=C===u[b]&&C!==c[b]&&D;if(M&&r&&e.manuallyAnimateOnMount&&(M=!1),S.protectedKeys={...m},!S.isActive&&p===null||!C&&!S.prevProp||Bt(C)||typeof C=="boolean")continue;const B=Hu(S.prevProp,C);let R=B||b===a&&S.isActive&&!M&&D||P>x&&D,Q=!1;const Y=Array.isArray(C)?C:[C];let ae=Y.reduce(s(b),{});p===!1&&(ae={});const{prevResolvedValues:Te={}}=S,ce={...Te,...ae},se=O=>{R=!0,h.has(O)&&(Q=!0,h.delete(O)),S.needsAnimating[O]=!0;const k=e.getValue(O);k&&(k.liveStyle=!1)};for(const O in ce){const k=ae[O],le=Te[O];if(m.hasOwnProperty(O))continue;let T=!1;wn(k)&&wn(le)?T=!xi(k,le):T=k!==le,T?k!=null?se(O):h.add(O):k!==void 0&&h.has(O)?se(O):S.protectedKeys[O]=!0}S.prevProp=C,S.prevResolvedValues=ae,S.isActive&&(m={...m,...ae}),r&&e.blockInitialAnimation&&(R=!1),R&&(!(M&&B)||Q)&&f.push(...Y.map(O=>({animation:O,options:{type:b}})))}if(h.size){const P={};if(typeof c.initial!="boolean"){const b=gt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);b&&b.transition&&(P.transition=b.transition)}h.forEach(b=>{const S=e.getBaseTarget(b),C=e.getValue(b);C&&(C.liveStyle=!0),P[b]=S??null}),f.push({animation:P})}let y=Boolean(f.length);return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function l(a,c){var u;if(n[a].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(a,c)}),n[a].isActive=c;const f=o(a);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Ti(),r=!0}}}function Hu(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!xi(t,e):!1}function Ye(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ti(){return{animate:Ye(!0),whileInView:Ye(),whileHover:Ye(),whileTap:Ye(),whileDrag:Ye(),whileFocus:Ye(),exit:Ye()}}class Ne{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Xu extends Ne{constructor(t){super(t),t.animationState||(t.animationState=qu(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Bt(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 Zu=0;class Ju extends Ne{constructor(){super(...arguments),this.id=Zu++}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 Qu={animation:{Feature:Xu},exit:{Feature:Ju}};function Et(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function At(e){return{point:{x:e.pageX,y:e.pageY}}}const ec=e=>t=>Mn(t)&&e(t,At(t));function rt(e,t,n,r){return Et(e,t,ec(n),r)}function wi({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function tc({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function nc(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 Pi=1e-4,rc=1-Pi,sc=1+Pi,Si=.01,ic=0-Si,oc=0+Si;function ye(e){return e.max-e.min}function ac(e,t,n){return Math.abs(e-t)<=n}function Ci(e,t,n,r=.5){e.origin=r,e.originPoint=ne(t.min,t.max,e.origin),e.scale=ye(n)/ye(t),e.translate=ne(n.min,n.max,e.origin)-e.originPoint,(e.scale>=rc&&e.scale<=sc||isNaN(e.scale))&&(e.scale=1),(e.translate>=ic&&e.translate<=oc||isNaN(e.translate))&&(e.translate=0)}function jt(e,t,n,r){Ci(e.x,t.x,n.x,r?r.originX:void 0),Ci(e.y,t.y,n.y,r?r.originY:void 0)}function Ei(e,t,n){e.min=n.min+t.min,e.max=e.min+ye(t)}function lc(e,t,n){Ei(e.x,t.x,n.x),Ei(e.y,t.y,n.y)}function Ai(e,t,n){e.min=t.min-n.min,e.max=e.min+ye(t)}function Mt(e,t,n){Ai(e.x,t.x,n.x),Ai(e.y,t.y,n.y)}const ji=()=>({translate:0,scale:1,origin:0,originPoint:0}),st=()=>({x:ji(),y:ji()}),Mi=()=>({min:0,max:0}),ie=()=>({x:Mi(),y:Mi()});function we(e){return[e("x"),e("y")]}function tr(e){return e===void 0||e===1}function nr({scale:e,scaleX:t,scaleY:n}){return!tr(e)||!tr(t)||!tr(n)}function Ke(e){return nr(e)||Di(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Di(e){return Ri(e.x)||Ri(e.y)}function Ri(e){return e&&e!=="0%"}function Xt(e,t,n){const r=e-n,s=t*r;return n+s}function Vi(e,t,n,r,s){return s!==void 0&&(e=Xt(e,s,r)),Xt(e,n,r)+t}function rr(e,t=0,n=1,r,s){e.min=Vi(e.min,t,n,r,s),e.max=Vi(e.max,t,n,r,s)}function Oi(e,{x:t,y:n}){rr(e.x,t.translate,t.scale,t.originPoint),rr(e.y,n.translate,n.scale,n.originPoint)}const Li=.999999999999,ki=1.0000000000001;function uc(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let l=0;l<s;l++){i=n[l],o=i.projectionDelta;const{visualElement:a}=i.options;a&&a.props.style&&a.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&ot(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Oi(e,o)),r&&Ke(i.latestValues)&&ot(e,i.latestValues))}t.x<ki&&t.x>Li&&(t.x=1),t.y<ki&&t.y>Li&&(t.y=1)}function it(e,t){e.min=e.min+t,e.max=e.max+t}function _i(e,t,n,r,s=.5){const i=ne(e.min,e.max,s);rr(e,t,n,i,r)}function ot(e,t){_i(e.x,t.x,t.scaleX,t.scale,t.originX),_i(e.y,t.y,t.scaleY,t.scale,t.originY)}function Ii(e,t){return wi(nc(e.getBoundingClientRect(),t))}function cc(e,t,n){const r=Ii(e,n),{scroll:s}=t;return s&&(it(r.x,s.offset.x),it(r.y,s.offset.y)),r}const Fi=(e,t)=>Math.abs(e-t);function fc(e,t){const n=Fi(e.x,t.x),r=Fi(e.y,t.y);return Math.sqrt(n**2+r**2)}class Ni{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=ir(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=fc(u.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:m}=u,{timestamp:x}=he;this.history.push({...m,timestamp:x});const{onStart:y,onMove:P}=this.handlers;f||(y&&y(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),P&&P(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=sr(f,this.transformPagePoint),te.update(this.updatePoint,!0)},this.handlePointerUp=(u,f)=>{Yt(u,"release"),this.end();const{onEnd:h,onSessionEnd:m,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ir(u.type==="pointercancel"||u.type==="lostpointercapture"?this.lastMoveEventInfo:sr(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,y),m&&m(u,y)},!Mn(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r;const i=At(t),o=sr(i,this.transformPagePoint),{point:l}=o,{timestamp:a}=he;this.history=[{...l,timestamp:a}];const{onSessionStart:c}=n;c&&c(t,ir(o,this.history)),Yt(t,"set"),this.removeListeners=St(rt(t.currentTarget,"pointermove",this.handlePointerMove),rt(t.currentTarget,"pointerup",this.handlePointerUp),rt(t.currentTarget,"pointercancel",this.handlePointerUp),rt(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),_e(this.updatePoint)}}function sr(e,t){return t?{point:t(e.point)}:e}function Bi(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ir({point:e},t){return{point:e,delta:Bi(e,$i(t)),offset:Bi(e,dc(t)),velocity:hc(t,.1)}}function dc(e){return e[0]}function $i(e){return e[e.length-1]}function hc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=$i(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Ae(t)));)n--;if(!r)return{x:0,y:0};const i=Re(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 pc(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ne(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ne(n,e,r.max):Math.min(e,n)),e}function Ui(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 mc(e,{top:t,left:n,bottom:r,right:s}){return{x:Ui(e.x,n,s),y:Ui(e.y,t,r)}}function Wi(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 gc(e,t){return{x:Wi(e.x,t.x),y:Wi(e.y,t.y)}}function yc(e,t){let n=.5;const r=ye(e),s=ye(t);return s>r?n=Xe(t.min,t.max-r,e.min):r>s&&(n=Xe(e.min,e.max-s,t.min)),Ve(0,1,n)}function vc(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 or=.35;function xc(e=or){return e===!1?e=0:e===!0&&(e=or),{x:zi(e,"left","right"),y:zi(e,"top","bottom")}}function zi(e,t,n){return{min:Yi(e,t),max:Yi(e,n)}}function Yi(e,t){return typeof e=="number"?e:e[t]||0}const bc=new WeakMap;class Tc{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=ie(),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(At(u).point)},i=(u,f)=>{const{drag:h,dragPropagation:m,onDragStart:x}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=hl(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),we(P=>{let b=this.getAxisMotionValue(P).get()||0;if(je.test(b)){const{projection:S}=this.visualElement;if(S&&S.layout){const C=S.layout.layoutBox[P];C&&(b=ye(C)*(parseFloat(b)/100))}}this.originPoint[P]=b}),x&&te.postRender(()=>x(u,f)),Ln(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(u,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:x,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:P}=f;if(m&&this.currentDirection===null){this.currentDirection=wc(P),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",f.point,P),this.updateAxis("y",f.point,P),this.visualElement.render(),y&&y(u,f)},l=(u,f)=>this.stop(u,f),a=()=>we(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 Ni(t,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:l,resumeAnimation:a},{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&&te.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||!Zt(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=pc(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&&Je(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=mc(s.layoutBox,n):this.constraints=!1,this.elastic=xc(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&we(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=vc(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Je(t))return!1;const r=t.current;Le(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=cc(r,s.root,this.visualElement.getTransformPagePoint());let o=gc(s.layout.layoutBox,i);if(n){const l=n(tc(o));this.hasMutatedConstraints=!!l,l&&(o=wi(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),a=this.constraints||{},c=we(u=>{if(!Zt(u,n,this.currentDirection))return;let f=a&&a[u]||{};o&&(f={min:0,max:0});const h=s?200:1e6,m=s?40:1e7,x={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,x)});return Promise.all(c).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ln(this.visualElement,t),r.start(Qn(t,r,0,n,this.visualElement,!1))}stopAnimation(){we(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){we(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){we(n=>{const{drag:r}=this.getProps();if(!Zt(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n];i.set(t[n]-ne(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Je(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};we(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const a=l.get();s[o]=yc({min:a,max:a},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(),we(o=>{if(!Zt(o,t,null))return;const l=this.getAxisMotionValue(o),{min:a,max:c}=this.constraints[o];l.set(ne(a,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;bc.set(this.visualElement,this);const t=this.visualElement.current,n=rt(t,"pointerdown",a=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(a)}),r=()=>{const{dragConstraints:a}=this.getProps();Je(a)&&a.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),te.read(r);const o=Et(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:a,hasLayoutChanged:c})=>{this.isDragging&&c&&(we(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=a[u].translate,f.set(f.get()+a[u].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=or,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function Zt(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function wc(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Pc extends Ne{constructor(t){super(t),this.removeGroupControls=be,this.removeListeners=be,this.controls=new Tc(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||be}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ki=e=>(t,n)=>{e&&te.postRender(()=>e(t,n))};class Sc extends Ne{constructor(){super(...arguments),this.removePointerDownListener=be}onPointerDown(t){this.session=new Ni(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Ki(t),onStart:Ki(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&te.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=rt(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 Jt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Gi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Dt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(V.test(e))e=parseFloat(e);else return e;const n=Gi(e,t.target.x),r=Gi(e,t.target.y);return`${n}% ${r}%`}},Cc={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Fe.parse(e);if(s.length>5)return r;const i=Fe.createTransformer(e),o=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,a=n.y.scale*t.y;s[0+o]/=l,s[1+o]/=a;const c=ne(l,a,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}};class Ec extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;Da(Ac),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()})),Jt.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()||te.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),dn.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 qi(e){const[t,n]=Fr(),r=v.useContext(nn);return g.exports.jsx(Ec,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(Zr),isPresent:t,safeToRemove:n})}const Ac={borderRadius:{...Dt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Dt,borderTopRightRadius:Dt,borderBottomLeftRadius:Dt,borderBottomRightRadius:Dt,boxShadow:Cc};function jc(e,t,n){const r=pe(e)?e:xt(e);return r.start(Qn("",r,t,n)),r.animation}function Mc(e){return e instanceof SVGElement&&e.tagName!=="svg"}const Dc=(e,t)=>e.depth-t.depth;class Rc{constructor(){this.children=[],this.isDirty=!1}add(t){Rn(this.children,t),this.isDirty=!0}remove(t){Vn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Dc),this.isDirty=!1,this.children.forEach(t)}}function Vc(e,t){const n=Me.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(_e(r),e(i-t))};return te.read(r,!0),()=>_e(r)}const Hi=["TopLeft","TopRight","BottomLeft","BottomRight"],Oc=Hi.length,Xi=e=>typeof e=="string"?parseFloat(e):e,Zi=e=>typeof e=="number"||V.test(e);function Lc(e,t,n,r,s,i){s?(e.opacity=ne(0,n.opacity!==void 0?n.opacity:1,kc(r)),e.opacityExit=ne(t.opacity!==void 0?t.opacity:1,0,_c(r))):i&&(e.opacity=ne(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Oc;o++){const l=`border${Hi[o]}Radius`;let a=Ji(t,l),c=Ji(n,l);if(a===void 0&&c===void 0)continue;a||(a=0),c||(c=0),a===0||c===0||Zi(a)===Zi(c)?(e[l]=Math.max(ne(Xi(a),Xi(c),r),0),(je.test(c)||je.test(a))&&(e[l]+="%")):e[l]=c}(t.rotate||n.rotate)&&(e.rotate=ne(t.rotate||0,n.rotate||0,r))}function Ji(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const kc=Qi(0,.5,_s),_c=Qi(.5,.95,be);function Qi(e,t,n){return r=>r<e?0:r>t?1:n(Xe(e,t,r))}function eo(e,t){e.min=t.min,e.max=t.max}function Pe(e,t){eo(e.x,t.x),eo(e.y,t.y)}function to(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function no(e,t,n,r,s){return e-=t,e=Xt(e,1/n,r),s!==void 0&&(e=Xt(e,1/s,r)),e}function Ic(e,t=0,n=1,r=.5,s,i=e,o=e){if(je.test(t)&&(t=parseFloat(t),t=ne(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=ne(i.min,i.max,r);e===i&&(l-=t),e.min=no(e.min,t,n,l,s),e.max=no(e.max,t,n,l,s)}function ro(e,t,[n,r,s],i,o){Ic(e,t[n],t[r],t[s],t.scale,i,o)}const Fc=["x","scaleX","originX"],Nc=["y","scaleY","originY"];function so(e,t,n,r){ro(e.x,t,Fc,n?n.x:void 0,r?r.x:void 0),ro(e.y,t,Nc,n?n.y:void 0,r?r.y:void 0)}function io(e){return e.translate===0&&e.scale===1}function oo(e){return io(e.x)&&io(e.y)}function ao(e,t){return e.min===t.min&&e.max===t.max}function Bc(e,t){return ao(e.x,t.x)&&ao(e.y,t.y)}function lo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function uo(e,t){return lo(e.x,t.x)&&lo(e.y,t.y)}function co(e){return ye(e.x)/ye(e.y)}function fo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class $c{constructor(){this.members=[]}add(t){Rn(this.members,t),t.scheduleRender()}remove(t){if(Vn(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 Uc(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:x}=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) `),x&&(r+=`skewY(${x}deg) `)}const l=e.x.scale*t.x,a=e.y.scale*t.y;return(l!==1||a!==1)&&(r+=`scale(${l}, ${a})`),r||"none"}const Ge={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ar=["","X","Y","Z"],Wc={visibility:"hidden"},ho=1e3;let zc=0;function lr(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function po(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ms(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",te,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&po(r)}function mo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=zc++,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,ke.value&&(Ge.nodes=Ge.calculatedTargetDeltas=Ge.calculatedProjections=0),this.nodes.forEach(Gc),this.nodes.forEach(Jc),this.nodes.forEach(Qc),this.nodes.forEach(qc),ke.addProjectionMetrics&&ke.addProjectionMetrics(Ge)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let a=0;a<this.path.length;a++)this.path[a].shouldResetTransform=!0;this.root===this&&(this.nodes=new Rc)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new On),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const a=this.eventHandlers.get(o);a&&a.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Mc(o),this.instance=o;const{layoutId:a,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),l&&(c||a)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Vc(h,250),Jt.hasAnimatedSinceResize&&(Jt.hasAnimatedSinceResize=!1,this.nodes.forEach(yo))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||sf,{onLayoutAnimationStart:P,onLayoutAnimationComplete:b}=u.getProps(),S=!this.targetLayout||!uo(this.targetLayout,x),C=!h&&m;if(this.options.layoutRoot||this.resumeFrom||C||h&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,C);const D={...Sn(y,"layout"),onPlay:P,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D)}else h||yo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}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(ef),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&&po(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:l,layout:a}=this.options;if(l===void 0&&!a)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(go);return}this.isUpdating||this.nodes.forEach(Xc),this.isUpdating=!1,this.nodes.forEach(Zc),this.nodes.forEach(Yc),this.nodes.forEach(Kc),this.clearAllSnapshots();const l=Me.now();he.delta=Ve(0,1e3/60,l-he.timestamp),he.timestamp=l,he.isProcessing=!0,ln.update.process(he),ln.preRender.process(he),ln.render.process(he),he.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,dn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Hc),this.sharedNodes.forEach(tf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,te.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){te.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ye(this.snapshot.measuredBox.x)&&!ye(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 a=0;a<this.path.length;a++)this.path[a].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ie(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l){const a=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:a,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:a}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!oo(this.projectionDelta),a=this.getTransformTemplate(),c=a?a(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(l||Ke(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let a=this.removeElementScroll(l);return o&&(a=this.removeTransform(a)),of(a),{animationId:this.root.animationId,measuredBox:l,layoutBox:a,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:l}=this.options;if(!l)return ie();const a=l.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(af))){const{scroll:u}=this.root;u&&(it(a.x,u.offset.x),it(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=ie();if(Pe(a,o),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return a;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&&Pe(a,o),it(a.x,f.offset.x),it(a.y,f.offset.y))}return a}applyTransform(o,l=!1){const a=ie();Pe(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ot(a,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ke(u.latestValues)&&ot(a,u.latestValues)}return Ke(this.latestValues)&&ot(a,this.latestValues),a}removeTransform(o){const l=ie();Pe(l,o);for(let a=0;a<this.path.length;a++){const c=this.path[a];if(!c.instance||!Ke(c.latestValues))continue;nr(c.latestValues)&&c.updateSnapshot();const u=ie(),f=c.measurePageBox();Pe(u,f),so(l,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Ke(this.latestValues)&&so(l,this.latestValues),l}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!==he.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var l;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=Boolean(this.resumingFrom)||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=he.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ie(),this.relativeTargetOrigin=ie(),Mt(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=ie(),this.targetWithTransforms=ie()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),lc(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),Oi(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=ie(),this.relativeTargetOrigin=ie(),Mt(this.relativeTargetOrigin,this.target,m.target),Pe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ke.value&&Ge.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||nr(this.parent.latestValues)||Di(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 l=this.getLead(),a=Boolean(this.resumingFrom)||this!==l;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===he.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;Pe(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;uc(this.layoutCorrected,this.treeScale,this.path,a),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=ie());const{target:x}=l;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(to(this.prevProjectionDelta.x,this.projectionDelta.x),to(this.prevProjectionDelta.y,this.projectionDelta.y)),jt(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!fo(this.projectionDelta.x,this.prevProjectionDelta.x)||!fo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x)),ke.value&&Ge.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=st(),this.projectionDelta=st(),this.projectionDeltaWithTransform=st()}setAnimationOrigin(o,l=!1){const a=this.snapshot,c=a?a.latestValues:{},u={...this.latestValues},f=st();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const h=ie(),m=a?a.source:void 0,x=this.layout?this.layout.source:void 0,y=m!==x,P=this.getStack(),b=!P||P.members.length<=1,S=Boolean(y&&!b&&this.options.crossfade===!0&&!this.path.some(rf));this.animationProgress=0;let C;this.mixTargetDelta=D=>{const p=D/1e3;vo(f.x,o.x,p),vo(f.y,o.y,p),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Mt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),nf(this.relativeTarget,this.relativeTargetOrigin,h,p),C&&Bc(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=ie()),Pe(C,this.relativeTarget)),y&&(this.animationValues=u,Lc(u,c,this.latestValues,p,S,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=p},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=te.update(()=>{Jt.hasAnimatedSinceResize=!0,Pt.layout++,this.currentAnimation=jc(0,ho,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},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(ho),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:a,layout:c,latestValues:u}=o;if(!(!l||!a||!c)){if(this!==o&&this.layout&&c&&Po(this.options.animationType,this.layout.layoutBox,c.layoutBox)){a=this.target||ie();const f=ye(this.layout.layoutBox.x);a.x.min=o.target.x.min,a.x.max=a.x.min+f;const h=ye(this.layout.layoutBox.y);a.y.min=o.target.y.min,a.y.max=a.y.min+h}Pe(l,a),ot(l,u),jt(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new $c),this.sharedNodes.get(o).add(l);const c=l.options.initialPromotionConfig;l.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(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:l,preserveFollowOpacity:a}={}){const c=this.getStack();c&&c.promote(this,a),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:a}=o;if((a.z||a.rotate||a.rotateX||a.rotateY||a.rotateZ||a.skewX||a.skewY)&&(l=!0),!l)return;const c={};a.z&&lr("z",o,c,this.animationValues);for(let u=0;u<ar.length;u++)lr(`rotate${ar[u]}`,o,c,this.animationValues),lr(`skew${ar[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 l,a;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Wc;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Wt(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 y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=Wt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Ke(this.latestValues)&&(y.transform=u?u({},""):"none",this.hasProjected=!1),y}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=Uc(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:m,y:x}=this.projectionDelta;c.transformOrigin=`${m.origin*100}% ${x.origin*100}% 0`,f.animationValues?c.opacity=f===this?(a=(l=h.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&a!==void 0?a: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 y in ht){if(h[y]===void 0)continue;const{correct:P,applyTo:b,isCSSVariable:S}=ht[y],C=c.transform==="none"?h[y]:P(h[y],f);if(b){const D=b.length;for(let p=0;p<D;p++)c[b[p]]=C}else S?this.options.visualElement.renderState.vars[y]=C:c[y]=C}return this.options.layoutId&&(c.pointerEvents=f===this?Wt(o==null?void 0:o.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(go),this.root.sharedNodes.clear()}}}function Yc(e){e.updateLayout()}function Kc(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"?we(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=ye(h);h.min=r[f].min,h.max=h.min+m}):Po(i,n.layoutBox,r)&&we(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=ye(r[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const l=st();jt(l,r,n.layoutBox);const a=st();o?jt(a,e.applyTransform(s,!0),n.measuredBox):jt(a,r,n.layoutBox);const c=!oo(l);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const x=ie();Mt(x,n.layoutBox,h.layoutBox);const y=ie();Mt(y,r,m.layoutBox),uo(x,y)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=x,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:a,layoutDelta:l,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Gc(e){ke.value&&Ge.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 qc(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Hc(e){e.clearSnapshot()}function go(e){e.clearMeasurements()}function Xc(e){e.isLayoutDirty=!1}function Zc(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function yo(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Jc(e){e.resolveTargetDelta()}function Qc(e){e.calcProjection()}function ef(e){e.resetSkewAndRotation()}function tf(e){e.removeLeadSnapshot()}function vo(e,t,n){e.translate=ne(t.translate,0,n),e.scale=ne(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function xo(e,t,n,r){e.min=ne(t.min,n.min,r),e.max=ne(t.max,n.max,r)}function nf(e,t,n,r){xo(e.x,t.x,n.x,r),xo(e.y,t.y,n.y,r)}function rf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const sf={duration:.45,ease:[.4,0,.1,1]},bo=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),To=bo("applewebkit/")&&!bo("chrome/")?Math.round:be;function wo(e){e.min=To(e.min),e.max=To(e.max)}function of(e){wo(e.x),wo(e.y)}function Po(e,t,n){return e==="position"||e==="preserve-aspect"&&!ac(co(t),co(n),.2)}function af(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const lf=mo({attachResizeListener:(e,t)=>Et(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ur={current:void 0},So=mo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ur.current){const e=new lf({});e.mount(window),e.setOptions({layoutScroll:!0}),ur.current=e}return ur.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),uf={pan:{Feature:Sc},drag:{Feature:Pc,ProjectionNode:So,MeasureLayout:qi}};function Co(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&&te.postRender(()=>i(t,At(t)))}class cf extends Ne{mount(){const{current:t}=this.node;t&&(this.unmount=al(t,(n,r)=>(Co(this.node,r,"Start"),s=>Co(this.node,s,"End"))))}unmount(){}}class ff extends Ne{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=St(Et(this.node.current,"focus",()=>this.onFocus()),Et(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Eo(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&&te.postRender(()=>i(t,At(t)))}class df extends Ne{mount(){const{current:t}=this.node;t&&(this.unmount=fl(t,(n,r)=>(Eo(this.node,r,"Start"),(s,{success:i})=>Eo(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const cr=new WeakMap,fr=new WeakMap,hf=e=>{const t=cr.get(e.target);t&&t(e)},pf=e=>{e.forEach(hf)};function mf({root:e,...t}){const n=e||document;fr.has(n)||fr.set(n,{});const r=fr.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(pf,{root:e,...t})),r[s]}function gf(e,t,n){const r=mf(t);return cr.set(e,n),r.observe(e),()=>{cr.delete(e),r.unobserve(e)}}const yf={some:0,all:1};class vf extends Ne{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:yf[s]},l=a=>{const{isIntersecting:c}=a;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(a)};return gf(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(xf(t,n))&&this.startObserver()}unmount(){}}function xf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const bf={inView:{Feature:vf},tap:{Feature:df},focus:{Feature:ff},hover:{Feature:cf}},Tf={layout:{ProjectionNode:So,MeasureLayout:qi}},dr={current:null},Ao={current:!1};function wf(){if(Ao.current=!0,!!on)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>dr.current=e.matches;e.addListener(t),t()}else dr.current=!1}const Pf=[...ei,me,Fe],Sf=e=>Pf.find(Qs(e)),Cf=new WeakMap;function Ef(e,t,n){for(const r in t){const s=t[r],i=n[r];if(pe(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(pe(i))e.addValue(r,xt(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,xt(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const jo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Af{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Yn,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=Me.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,te.render(this.render,!1,!0))};const{latestValues:a,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=l,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=$t(n),this.isVariantNode=qr(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 x=h[m];a[m]!==void 0&&pe(x)&&x.set(a[m],!1)}}mount(t){this.current=t,Cf.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)),Ao.current||wf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:dr.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(),_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=Ue.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&te.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 Ze){const n=Ze[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):ie()}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<jo.length;r++){const s=jo[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=Ef(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=xt(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"&&(Zs(s)||Fs(s))?s=parseFloat(s):!Sf(s)&&Fe.test(n)&&(s=Ys(t,n)),this.setBaseTarget(t,pe(s)?s.get():s)),pe(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=Tn(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&&!pe(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 On),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Mo extends Af{constructor(){super(...arguments),this.KeyframeResolver=ni}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;pe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function jf(e){return window.getComputedStyle(e)}class Mf extends Mo{constructor(){super(...arguments),this.type="html",this.renderInstance=cs}readValueFromInstance(t,n){if(Ue.has(n)){const r=Un(n);return r&&r.default||0}else{const r=jf(t),s=(hn(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Ii(t,n)}build(t,n,r){gn(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Pn(t,n,r)}}class Df extends Mo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ie,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&us(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ue.has(n)){const r=Un(n);return r&&r.default||0}return n=fs.has(n)?n:fn(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return hs(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&te.postRender(this.updateDimensions)}build(t,n,r){xn(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){ds(t,n,r,s)}mount(t){this.isSVGTag=bn(t.tagName),super.mount(t)}}const Rf=(e,t)=>vn(e)?new Df(t):new Mf(t,{allowProjection:e!==v.Fragment}),Vf=el({...Qu,...bf,...uf,...Tf},Rf),hr=ya(Vf),Of=({isOpen:e,onClose:t,onConfirm:n,header:r,question:s})=>e?g.exports.jsx("div",{id:"default-modal",tabIndex:-1,"aria-hidden":"true",className:"fixed top-0 right-0 left-0 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:g.exports.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:g.exports.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[g.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:[g.exports.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[r," "]}),g.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:[g.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:g.exports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),g.exports.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),g.exports.jsx("div",{className:"p-4 md:p-5 space-y-4",children:g.exports.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[s," "]})}),g.exports.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[g.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 "}),g.exports.jsx("button",{onClick:t,type:"button",className:"py-2.5 px-5 ms-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,Lf=({items:e,isVisible:t,position:n,messageId:r,isCurrentUserMessage:s})=>{const i=v.useRef(null),[o,l]=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)),l(!0),()=>{i.current&&!t&&(document.body.removeChild(i.current),i.current=null)}),[t]),!i.current||!o?null:$e.createPortal(g.exports.jsx($r,{children:t&&g.exports.jsx(hr.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((a,c)=>a!=null&&a.onlyCurrentUserMessage&&!s?null:g.exports.jsxs("button",{disabled:a==null?void 0:a.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:()=>a.onClick(r),children:[v.cloneElement(a.icon,{className:"text-black",size:18}),g.exports.jsx("span",{className:"ml-2 text-black",children:a.name})]},c))})}),i.current)},kf=()=>g.exports.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:g.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=()=>g.exports.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:g.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"})}),Do=()=>g.exports.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:g.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"})}),pr=e=>g.exports.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...e,children:g.exports.jsxs("g",{fill:"none",children:[g.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"}),g.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"}),g.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"}),g.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"})]})}),If=({onSendMessage:e,onSendVoice:t,onFileSend:n,dynamicSymbolAssignments:r})=>{const[s,i]=v.useState(""),[o,l]=v.useState(!1),[a,c]=v.useState(0),[u,f]=v.useState(null),[h,m]=v.useState(null),[x,y]=v.useState(0),P=v.useRef(null),b=v.useRef([]),S=v.useRef(null),C=v.useRef(null),D=v.useRef(null),[p,M]=v.useState(!1),B=I=>{const O=I.target.value;i(O);const k=O.match(/(\S+)$/);if(k){const le=k[0];if(u){const T=k[0].split(u)[1];m(T)}r!=null&&r.some(T=>T.symbol===le)&&f(le)}else f(null)},R=(I,O)=>{i(k=>k+O+" "),f(null),C.current.focus()},Q=()=>{s.trim()!==""&&(e(s),i(""),f(null))},Y=async()=>{l(!0),c(0),b.current=[],S.current=setInterval(()=>{c(k=>k+1)},1e3);const I=await navigator.mediaDevices.getUserMedia({audio:!0}),O=new MediaRecorder(I);P.current=O,O.ondataavailable=k=>{k.data.size>0&&b.current.push(k.data)},O.onstop=()=>{clearInterval(S.current);const k=new Blob(b.current,{type:"audio/mp3"}),le=URL.createObjectURL(k);t(le),l(!1)},O.start()},ae=()=>{var I;(I=P.current)==null||I.stop()},Te=()=>{var I;(I=D.current)==null||I.click()},ce=I=>{var k;const O=(k=I.target.files)==null?void 0:k[0];O&&n(O)},se=I=>{const O=Math.floor(I/60),k=I%60;return`${O.toString().padStart(2,"0")}:${k.toString().padStart(2,"0")}`},ve=I=>{const{scrollTop:O,scrollHeight:k,clientHeight:le}=I.currentTarget;if(O>x){if(O+le>=k-1){const E=r==null?void 0:r.find(_=>_.symbol===u);E&&(E!=null&&E.updatePageNumber)&&(M(!0),E==null||E.updatePageNumber(E.pagNumber+1),y(O),setTimeout(()=>{M(!1)},500))}}else y(O)};return g.exports.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[o?g.exports.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[g.exports.jsx("span",{className:"text-blue-400 font-bold flex-1",children:se(a)}),g.exports.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:ae,children:g.exports.jsx(Do,{})})]}):g.exports.jsxs(g.exports.Fragment,{children:[g.exports.jsxs("div",{className:"w-[90%] relative ",children:[g.exports.jsx("div",{onClick:Te,className:"cursor-pointer absolute right-4 top-[11px]",children:g.exports.jsx(kf,{})}),g.exports.jsx("input",{type:"file",ref:D,style:{display:"none"},onChange:ce}),g.exports.jsx("input",{type:"text",ref:C,className:"w-full bg-white flex-1 p-2 pl-4 border border-gray-300 outline-none rounded-tl-3xl rounded-tr-2xl rounded-bl-3xl ",placeholder:"Type a message...",value:s,onChange:B,onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),Q())}}),g.exports.jsx(pr,{className:"rotate-180 absolute -right-[11.4px] top-5"})]}),g.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:s?Q:Y,children:s?g.exports.jsx(Do,{}):g.exports.jsx(_f,{})})]}),u&&g.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:ve,children:[g.exports.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[g.exports.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",g.exports.jsx("span",{className:"text-blue-500",children:u})]}),g.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>f(null),children:"✕"})]}),g.exports.jsxs("div",{className:"space-y-2",children:[r?r.filter(I=>I.symbol===u).map(I=>{var le;const{component:O,lists:k}=I;return O?h?(le=k==null?void 0:k.filter(T=>T==null?void 0:T.name.includes(h)))==null?void 0:le.map((T,E)=>g.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:g.exports.jsx(O,{listsProps:T,onClick:(_,F)=>R(_,F)})},E)):k==null?void 0:k.map((T,E)=>g.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:g.exports.jsx(O,{listsProps:T,onClick:(_,F)=>R(_,F)})},E)):null}):null,g.exports.jsx("div",{className:"h-8",children:p&&"Loading more items..."})]})]})]})};var Be=(e=>(e[e.File=0]="File",e[e.Voice=1]="Voice",e[e.Video=2]="Video",e[e.Image=3]="Image",e))(Be||{});const Ro=({fileName:e,fileSize:t,format:n,src:r})=>{const s=()=>({rar:g.exports.jsx("p",{className:"p-2 text-green-500 font-bold",children:n}),zip:g.exports.jsx("p",{className:"p-2 text-blue-500 font-bold",children:n}),pdf:g.exports.jsx("p",{className:"p-2 text-red-500 font-bold",children:n}),doc:g.exports.jsx("p",{className:"p-2 text-blue-400 font-bold",children:n}),vid:g.exports.jsx("p",{className:"p-2 text-orange-400 font-bold",children:n}),"":g.exports.jsx("p",{className:"p-2 text-black font-bold",children:n})})[n||""],i=o=>o>1048576?(o/1048576).toFixed(1)+" MB":(o/1024).toFixed(1)+" KB";return g.exports.jsxs("div",{className:"flex items-center rounded-lg",children:[g.exports.jsx("div",{className:"mr-3 relative border border-green-950 rounded-md p-3",children:s()}),g.exports.jsxs("div",{className:"flex flex-col flex-grow",children:[g.exports.jsx("a",{href:r,download:e,className:"text-gray-900 font-medium hover:underline",children:e}),g.exports.jsx("span",{className:"text-gray-600 text-sm",children:i(t)})]}),g.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"})]})},Ff=e=>g.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:g.exports.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),Nf=e=>g.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:[g.exports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),g.exports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let Rt=null;const Bf=({src:e,className:t})=>{const[n,r]=v.useState(!1),[s,i]=v.useState(0),o=v.useRef(null);v.useEffect(()=>{const a=o.current;if(!a)return;const c=()=>{i(a.currentTime/a.duration*100)},u=()=>r(!0),f=()=>r(!1),h=()=>{r(!1),i(0)};return a.addEventListener("timeupdate",c),a.addEventListener("play",u),a.addEventListener("pause",f),a.addEventListener("ended",h),()=>{a.removeEventListener("timeupdate",c),a.removeEventListener("play",u),a.removeEventListener("pause",f),a.removeEventListener("ended",h)}},[]);const l=()=>{const a=o.current;a&&(n?a.pause():(Rt&&Rt!==a&&(Rt.pause(),Rt.currentTime=0),a.play(),Rt=a))};return g.exports.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${t}`,children:[g.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:l,children:n?g.exports.jsx(Nf,{}):g.exports.jsx(Ff,{})}),g.exports.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:g.exports.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${s}%`}})}),g.exports.jsx("audio",{ref:o,src:e})]})},$f=({attachment:e,attachmentType:t})=>e?t===Be.Voice?g.exports.jsx("div",{className:"w-full",children:g.exports.jsx(Bf,{src:e})}):t===Be.Image?g.exports.jsx("div",{className:"w-full",children:g.exports.jsx("img",{src:e})}):t===Be.File?g.exports.jsx("div",{className:"w-full mt-1",children:g.exports.jsx(Ro,{fileName:"productivity",fileSize:23e3,format:"rar",src:e})}):t===Be.Video?g.exports.jsx("div",{className:"w-full mt-1",children:g.exports.jsx(Ro,{fileName:"productivity",fileSize:23e3,format:"rar",src:e})}):null:null,Uf=({message:e,showUserProfile:t,handleContextMenu:n,media:r})=>{var s,i,o,l,a;return g.exports.jsxs(g.exports.Fragment,{children:[t?g.exports.jsx("img",{src:e.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,g.exports.jsxs(hr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:c=>n(c,e),className:`relative ${r?"w-3/4":"w-fit max-w-3/4"}flex flex-col gap-1 md:max-w-[400px] p-2 pt-5 rounded-lg bg-green-200`,children:[g.exports.jsx("span",{className:"absolute top-1 text-xs text-orange-700",children:(s=e.user)!=null&&s.fullName&&((o=(i=e.user)==null?void 0:i.fullName)==null?void 0:o.length)>16?(l=e.user)==null?void 0:l.firstName:(a=e.user)==null?void 0:a.fullName}),r||null,g.exports.jsx("span",{children:e.text}),g.exports.jsx("div",{className:"w-full flex gap- items-center justify-end",children:g.exports.jsx("span",{className:"text-[10px]",children:new Date(e.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(e.createdDate).toLocaleTimeString().split(":")[1]})}),g.exports.jsx(pr,{className:"fill-blue-200 -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 [&>g>path]:fill-green-200"})]})]})},Wf=()=>g.exports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.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"}),g.exports.jsx("path",{"fill-rule":"evenodd","clip-rule":"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"})]}),Vo=({size:e=24,color:t="text-current",className:n})=>g.exports.jsx("div",{className:` ${n} animate-spin inline-flex items-center justify-center`,children:g.exports.jsxs("svg",{width:e,height:e,viewBox:"0 0 36 36",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[g.exports.jsx("defs",{children:g.exports.jsxs("linearGradient",{x1:"0%",y1:"100%",x2:"100%",y2:"100%",id:"linearGradient-1",children:[g.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0",offset:"0%"}),g.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0.50",offset:"39.9430698%"}),g.exports.jsx("stop",{stopColor:"currentColor",offset:"100%"})]})}),g.exports.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[g.exports.jsx("rect",{fillOpacity:"0.01",fill:"none",x:"0",y:"0",width:"36",height:"36"}),g.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"})]})]})}),zf=({handleContextMenu:e,media:t,message:n})=>g.exports.jsxs(hr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:r=>e(r,n),className:`relative self-end ${t?"w-3/4":"max-w-3/4"} flex flex-col justify-center md:max-w-[400px] p-2 rounded-lg bg-blue-200`,children:[t||null,g.exports.jsx("span",{children:n.text}),g.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[g.exports.jsx("span",{className:"text-[10px]",children:new Date(n.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(n.createdDate).toLocaleTimeString().split(":")[1]}),n.isSending?g.exports.jsx(Vo,{size:13,color:"text-black"}):g.exports.jsx(Wf,{})]}),g.exports.jsx(pr,{className:"fill-blue-200 rotate-180 absolute -right-2 bottom-0 [&>g>path]:fill-blue-200"})]});var fe={exports:{}},mr={exports:{}},Z={};var Oo;function Yf(){if(Oo)return Z;Oo=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,l=e?Symbol.for("react.context"):60110,a=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,x=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,P=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function C(p){if(typeof p=="object"&&p!==null){var M=p.$$typeof;switch(M){case t:switch(p=p.type,p){case a:case c:case r:case i:case s:case f:return p;default:switch(p=p&&p.$$typeof,p){case l:case u:case x:case m:case o:return p;default:return M}}case n:return M}}}function D(p){return C(p)===c}return Z.AsyncMode=a,Z.ConcurrentMode=c,Z.ContextConsumer=l,Z.ContextProvider=o,Z.Element=t,Z.ForwardRef=u,Z.Fragment=r,Z.Lazy=x,Z.Memo=m,Z.Portal=n,Z.Profiler=i,Z.StrictMode=s,Z.Suspense=f,Z.isAsyncMode=function(p){return D(p)||C(p)===a},Z.isConcurrentMode=D,Z.isContextConsumer=function(p){return C(p)===l},Z.isContextProvider=function(p){return C(p)===o},Z.isElement=function(p){return typeof p=="object"&&p!==null&&p.$$typeof===t},Z.isForwardRef=function(p){return C(p)===u},Z.isFragment=function(p){return C(p)===r},Z.isLazy=function(p){return C(p)===x},Z.isMemo=function(p){return C(p)===m},Z.isPortal=function(p){return C(p)===n},Z.isProfiler=function(p){return C(p)===i},Z.isStrictMode=function(p){return C(p)===s},Z.isSuspense=function(p){return C(p)===f},Z.isValidElementType=function(p){return typeof p=="string"||typeof p=="function"||p===r||p===c||p===i||p===s||p===f||p===h||typeof p=="object"&&p!==null&&(p.$$typeof===x||p.$$typeof===m||p.$$typeof===o||p.$$typeof===l||p.$$typeof===u||p.$$typeof===P||p.$$typeof===b||p.$$typeof===S||p.$$typeof===y)},Z.typeOf=C,Z}var J={};var Lo;function Kf(){return Lo||(Lo=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,l=e?Symbol.for("react.context"):60110,a=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,x=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,P=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function C(j){return typeof j=="string"||typeof j=="function"||j===r||j===c||j===i||j===s||j===f||j===h||typeof j=="object"&&j!==null&&(j.$$typeof===x||j.$$typeof===m||j.$$typeof===o||j.$$typeof===l||j.$$typeof===u||j.$$typeof===P||j.$$typeof===b||j.$$typeof===S||j.$$typeof===y)}function D(j){if(typeof j=="object"&&j!==null){var Se=j.$$typeof;switch(Se){case t:var at=j.type;switch(at){case a:case c:case r:case i:case s:case f:return at;default:var qe=at&&at.$$typeof;switch(qe){case l:case u:case x:case m:case o:return qe;default:return Se}}case n:return Se}}}var p=a,M=c,B=l,R=o,Q=t,Y=u,ae=r,Te=x,ce=m,se=n,ve=i,I=s,O=f,k=!1;function le(j){return k||(k=!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)||D(j)===a}function T(j){return D(j)===c}function E(j){return D(j)===l}function _(j){return D(j)===o}function F(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function N(j){return D(j)===u}function G(j){return D(j)===r}function $(j){return D(j)===x}function U(j){return D(j)===m}function W(j){return D(j)===n}function H(j){return D(j)===i}function z(j){return D(j)===s}function ge(j){return D(j)===f}J.AsyncMode=p,J.ConcurrentMode=M,J.ContextConsumer=B,J.ContextProvider=R,J.Element=Q,J.ForwardRef=Y,J.Fragment=ae,J.Lazy=Te,J.Memo=ce,J.Portal=se,J.Profiler=ve,J.StrictMode=I,J.Suspense=O,J.isAsyncMode=le,J.isConcurrentMode=T,J.isContextConsumer=E,J.isContextProvider=_,J.isElement=F,J.isForwardRef=N,J.isFragment=G,J.isLazy=$,J.isMemo=U,J.isPortal=W,J.isProfiler=H,J.isStrictMode=z,J.isSuspense=ge,J.isValidElementType=C,J.typeOf=D}()),J}var ko;function _o(){return ko||(ko=1,function(e){process.env.NODE_ENV==="production"?e.exports=Yf():e.exports=Kf()}(mr)),mr.exports}var gr,Io;function Gf(){if(Io)return gr;Io=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={},l=0;l<10;l++)o["_"+String.fromCharCode(l)]=l;var a=Object.getOwnPropertyNames(o).map(function(u){return o[u]});if(a.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 gr=s()?Object.assign:function(i,o){for(var l,a=r(i),c,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var f in l)t.call(l,f)&&(a[f]=l[f]);if(e){c=e(l);for(var h=0;h<c.length;h++)n.call(l,c[h])&&(a[c[h]]=l[c[h]])}}return a},gr}var yr,Fo;function vr(){if(Fo)return yr;Fo=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return yr=e,yr}var xr,No;function Bo(){return No||(No=1,xr=Function.call.bind(Object.prototype.hasOwnProperty)),xr}var br,$o;function qf(){if($o)return br;$o=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=vr(),n={},r=Bo();e=function(i){var o="Warning: "+i;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(i,o,l,a,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((a||"React class")+": "+l+" 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,a,l,null,t)}catch(x){f=x}if(f&&!(f instanceof Error)&&e((a||"React class")+": type specification of "+l+" `"+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 "+l+" type: "+f.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},br=s,br}var Tr,Uo;function Hf(){if(Uo)return Tr;Uo=1;var e=_o(),t=Gf(),n=vr(),r=Bo(),s=qf(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(l){var a="Warning: "+l;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}});function o(){return null}return Tr=function(l,a){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(T){var E=T&&(c&&T[c]||T[u]);if(typeof E=="function")return E}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:S(),arrayOf:C,element:D(),elementType:p(),instanceOf:M,node:Y(),objectOf:R,oneOf:B,oneOfType:Q,shape:Te,exact:ce};function x(T,E){return T===E?T!==0||1/T===1/E:T!==T&&E!==E}function y(T,E){this.message=T,this.data=E&&typeof E=="object"?E:{},this.stack=""}y.prototype=Error.prototype;function P(T){if(process.env.NODE_ENV!=="production")var E={},_=0;function F(G,$,U,W,H,z,ge){if(W=W||h,z=z||U,ge!==n){if(a){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 Se=W+":"+U;!E[Se]&&_<3&&(i("You are manually calling a React.PropTypes validation function for the `"+z+"` prop on `"+W+"`. 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."),E[Se]=!0,_++)}}return $[U]==null?G?$[U]===null?new y("The "+H+" `"+z+"` is marked as required "+("in `"+W+"`, but its value is `null`.")):new y("The "+H+" `"+z+"` is marked as required in "+("`"+W+"`, but its value is `undefined`.")):null:T($,U,W,H,z)}var N=F.bind(null,!1);return N.isRequired=F.bind(null,!0),N}function b(T){function E(_,F,N,G,$,U){var W=_[F],H=I(W);if(H!==T){var z=O(W);return new y("Invalid "+G+" `"+$+"` of type "+("`"+z+"` supplied to `"+N+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return P(E)}function S(){return P(o)}function C(T){function E(_,F,N,G,$){if(typeof T!="function")return new y("Property `"+$+"` of component `"+N+"` has invalid PropType notation inside arrayOf.");var U=_[F];if(!Array.isArray(U)){var W=I(U);return new y("Invalid "+G+" `"+$+"` of type "+("`"+W+"` supplied to `"+N+"`, expected an array."))}for(var H=0;H<U.length;H++){var z=T(U,H,N,G,$+"["+H+"]",n);if(z instanceof Error)return z}return null}return P(E)}function D(){function T(E,_,F,N,G){var $=E[_];if(!l($)){var U=I($);return new y("Invalid "+N+" `"+G+"` of type "+("`"+U+"` supplied to `"+F+"`, expected a single ReactElement."))}return null}return P(T)}function p(){function T(E,_,F,N,G){var $=E[_];if(!e.isValidElementType($)){var U=I($);return new y("Invalid "+N+" `"+G+"` of type "+("`"+U+"` supplied to `"+F+"`, expected a single ReactElement type."))}return null}return P(T)}function M(T){function E(_,F,N,G,$){if(!(_[F]instanceof T)){var U=T.name||h,W=le(_[F]);return new y("Invalid "+G+" `"+$+"` of type "+("`"+W+"` supplied to `"+N+"`, expected ")+("instance of `"+U+"`."))}return null}return P(E)}function B(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 E(_,F,N,G,$){for(var U=_[F],W=0;W<T.length;W++)if(x(U,T[W]))return null;var H=JSON.stringify(T,function(ge,j){var Se=O(j);return Se==="symbol"?String(j):j});return new y("Invalid "+G+" `"+$+"` of value `"+String(U)+"` "+("supplied to `"+N+"`, expected one of "+H+"."))}return P(E)}function R(T){function E(_,F,N,G,$){if(typeof T!="function")return new y("Property `"+$+"` of component `"+N+"` has invalid PropType notation inside objectOf.");var U=_[F],W=I(U);if(W!=="object")return new y("Invalid "+G+" `"+$+"` of type "+("`"+W+"` supplied to `"+N+"`, expected an object."));for(var H in U)if(r(U,H)){var z=T(U,H,N,G,$+"."+H,n);if(z instanceof Error)return z}return null}return P(E)}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 E=0;E<T.length;E++){var _=T[E];if(typeof _!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+k(_)+" at index "+E+"."),o}function F(N,G,$,U,W){for(var H=[],z=0;z<T.length;z++){var ge=T[z],j=ge(N,G,$,U,W,n);if(j==null)return null;j.data&&r(j.data,"expectedType")&&H.push(j.data.expectedType)}var Se=H.length>0?", expected one of type ["+H.join(", ")+"]":"";return new y("Invalid "+U+" `"+W+"` supplied to "+("`"+$+"`"+Se+"."))}return P(F)}function Y(){function T(E,_,F,N,G){return se(E[_])?null:new y("Invalid "+N+" `"+G+"` supplied to "+("`"+F+"`, expected a ReactNode."))}return P(T)}function ae(T,E,_,F,N){return new y((T||"React class")+": "+E+" type `"+_+"."+F+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function Te(T){function E(_,F,N,G,$){var U=_[F],W=I(U);if(W!=="object")return new y("Invalid "+G+" `"+$+"` of type `"+W+"` "+("supplied to `"+N+"`, expected `object`."));for(var H in T){var z=T[H];if(typeof z!="function")return ae(N,G,$,H,O(z));var ge=z(U,H,N,G,$+"."+H,n);if(ge)return ge}return null}return P(E)}function ce(T){function E(_,F,N,G,$){var U=_[F],W=I(U);if(W!=="object")return new y("Invalid "+G+" `"+$+"` of type `"+W+"` "+("supplied to `"+N+"`, expected `object`."));var H=t({},_[F],T);for(var z in H){var ge=T[z];if(r(T,z)&&typeof ge!="function")return ae(N,G,$,z,O(ge));if(!ge)return new y("Invalid "+G+" `"+$+"` key `"+z+"` supplied to `"+N+"`.\nBad object: "+JSON.stringify(_[F],null," ")+`
20
+ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var j=ge(U,z,N,G,$+"."+z,n);if(j)return j}return null}return P(E)}function se(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(se);if(T===null||l(T))return!0;var E=f(T);if(E){var _=E.call(T),F;if(E!==T.entries){for(;!(F=_.next()).done;)if(!se(F.value))return!1}else for(;!(F=_.next()).done;){var N=F.value;if(N&&!se(N[1]))return!1}}else return!1;return!0;default:return!1}}function ve(T,E){return T==="symbol"?!0:E?E["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&E instanceof Symbol:!1}function I(T){var E=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":ve(E,T)?"symbol":E}function O(T){if(typeof T>"u"||T===null)return""+T;var E=I(T);if(E==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return E}function k(T){var E=O(T);switch(E){case"array":case"object":return"an "+E;case"boolean":case"date":case"regexp":return"a "+E;default:return E}}function le(T){return!T.constructor||!T.constructor.name?h:T.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},Tr}var wr,Wo;function Xf(){if(Wo)return wr;Wo=1;var e=vr();function t(){}function n(){}return n.resetWarningCache=t,wr=function(){function r(o,l,a,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},wr}if(process.env.NODE_ENV!=="production"){var Zf=_o(),Jf=!0;fe.exports=Hf()(Zf.isElement,Jf)}else fe.exports=Xf()();function Pr(){return Pr=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},Pr.apply(this,arguments)}function Qf(e,t){if(e==null)return{};var n=ed(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 ed(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 Sr=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=Qf(e,["color","size"]);return v.createElement("svg",Pr({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"}))});Sr.propTypes={color:fe.exports.string,size:fe.exports.oneOfType([fe.exports.string,fe.exports.number])},Sr.displayName="Check";const td=Sr;function Cr(){return Cr=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},Cr.apply(this,arguments)}function nd(e,t){if(e==null)return{};var n=rd(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 rd(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 Er=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=nd(e,["color","size"]);return v.createElement("svg",Cr({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"}))});Er.propTypes={color:fe.exports.string,size:fe.exports.oneOfType([fe.exports.string,fe.exports.number])},Er.displayName="Copy";const sd=Er;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 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 jr=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",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),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"}))});jr.propTypes={color:fe.exports.string,size:fe.exports.oneOfType([fe.exports.string,fe.exports.number])},jr.displayName="Edit";const ad=jr;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 ld(e,t){if(e==null)return{};var n=ud(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 ud(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",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:"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"}))});Dr.propTypes={color:fe.exports.string,size:fe.exports.oneOfType([fe.exports.string,fe.exports.number])},Dr.displayName="Trash";const cd=Dr,fd=({user:e,messages:t,updateMessages:n,onMessageSent:r,onEditMessage:s,onDeleteMessage:i})=>{const o=v.useRef(null),[l,a]=v.useState(!1),[c,u]=v.useState(null),[f,h]=v.useState(null),m=()=>{setTimeout(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},100)};v.useEffect(()=>{const p=()=>{h(null)};return window.addEventListener("scroll",p,!0),()=>{window.removeEventListener("scroll",p,!0)}},[h]);const x=(p,M)=>{p.preventDefault();const B=window.scrollX,R=window.scrollY;h({x:p.clientX+B,y:p.clientY+R,message:M})},y=()=>{h(null)},P=p=>{const M=new Ot({id:new Date().toString(),text:p,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,M]),r(M),m()},b=p=>{const M=new Ot({id:new Date().toString(),text:"",attachment:p,attachmentType:Be.Voice,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,M]),r(M),m()},S=p=>{const M=URL.createObjectURL(p),B=new Ot({id:new Date().toString(),text:"",attachment:M,attachmentType:Be.File,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,B]),r(B),m()};return{handleDeleteConfirmation:()=>{c&&(i(c),u(null)),a(!1)},handleCloseContextMenu:y,contextMenuItems:[{name:"Edit",icon:g.exports.jsx(ad,{className:"text-gray-600"}),onlyCurrentUserMessage:!0,onClick:p=>{console.log("Edit clicked"),y(),s(p)}},{name:"Delete",icon:g.exports.jsx(cd,{className:"text-red-600"}),onlyCurrentUserMessage:!0,onClick:p=>{u(p),a(!0),y()}},{name:"Select",icon:g.exports.jsx(td,{className:"text-green-600"}),disabled:!0,onClick:()=>{console.log("Select clicked"),y()}},{name:"Copy",icon:g.exports.jsx(sd,{className:"text-blue-600"}),onClick:p=>{const M=t.find(B=>B.id===p);M&&navigator.clipboard.writeText(M.text),y()}}],handleSendFile:S,handleSendVoice:b,handleSendMessage:P,handleContextMenu:x,isModalOpen:l,contextMenu:f,chatRef:o,setIsModalOpen:a}},dd=({width:e="400px",height:t="600px",isLoadingChat:n,className:r,style:s,messages:i,user:o,updateMessages:l,onMessageSent:a,onDeleteMessage:c,onEditMessage:u,dynamicSymbolAssignments:f,backgroundImage:h})=>{var R,Q;const{handleDeleteConfirmation:m,handleCloseContextMenu:x,handleSendFile:y,handleSendVoice:P,handleSendMessage:b,handleContextMenu:S,contextMenuItems:C,isModalOpen:D,contextMenu:p,chatRef:M,setIsModalOpen:B}=fd({user:o,messages:i,updateMessages:l,onMessageSent:a,onEditMessage:u,onDeleteMessage:c});return g.exports.jsxs("div",{className:`flex flex-col !bg-cover ${r}`,style:{width:e,height:t,background:"url("+h+")",...s},onClick:x,children:[g.exports.jsx("div",{ref:M,className:`flex flex-col gap-2 flex-1 p-3 pb-16 ${p?"overflow-hidden pr-[22px]":"overflow-y-scroll"}`,children:n?g.exports.jsx(Vo,{className:"mt-3",size:27,color:"text-gray-800"}):g.exports.jsx($r,{children:i.map((Y,ae)=>{var se,ve,I;const Te=Y!=null&&Y.attachment?g.exports.jsx($f,{attachment:Y.attachment,attachmentType:Y==null?void 0:Y.attachmentType},ae):null;if(Y.isRightSided)return g.exports.jsx(zf,{media:Te,handleContextMenu:S,message:Y},ae);const ce=((ve=(se=i[ae-1])==null?void 0:se.user)==null?void 0:ve.id)!==((I=Y==null?void 0:Y.user)==null?void 0:I.id);return g.exports.jsx(Uf,{showUserProfile:ce,media:Te,handleContextMenu:S,message:Y},ae)})})}),g.exports.jsx(Of,{isOpen:D,onClose:()=>B(!1),onConfirm:m,header:"Confirm Delete",question:"Are you sure you want to delete this message?"}),p&&((R=p==null?void 0:p.message)!=null&&R.id)?g.exports.jsx(Lf,{items:C,isVisible:Boolean(p),messageId:String(p==null?void 0:p.message.id),isCurrentUserMessage:((Q=p==null?void 0:p.message)==null?void 0:Q.user.id)===o.id,position:{x:p==null?void 0:p.x,y:p==null?void 0:p.y}}):null,g.exports.jsx(If,{onSendVoice:P,onSendMessage:b,onFileSend:y,dynamicSymbolAssignments:f})]})};de.AttachmentTypeEnum=Be,de.Button=oa,de.Chat=dd,de.MessageEntity=Ot,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});
21
21
  //# sourceMappingURL=index.umd.js.map