react-pro-messenger 1.0.4 → 1.0.5

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,50 +1,49 @@
1
- (function(G,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("framer-motion")):typeof define=="function"&&define.amd?define(["exports","react","framer-motion"],g):(G=typeof globalThis<"u"?globalThis:G||self,g(G.ReactProMessenger={},G.React,G.framerMotion))})(this,function(G,g,ce){"use strict";var Zr=Object.defineProperty;var Hr=(G,g,ce)=>g in G?Zr(G,g,{enumerable:!0,configurable:!0,writable:!0,value:ce}):G[g]=ce;var pe=(G,g,ce)=>Hr(G,typeof g!="symbol"?g+"":g,ce);class Ee{constructor({id:l,text:i,createdDate:t,attachment:a,attachmentType:o,user:d,isRightSided:y,symbols:h}){pe(this,"id","0");pe(this,"text","");pe(this,"createdDate","");pe(this,"attachment","");pe(this,"attachmentType");pe(this,"user",{id:""});pe(this,"isRightSided",!1);pe(this,"symbols");this.id=l,this.text=i,this.createdDate=t,this.attachment=a,this.attachmentType=o,this.user=d,this.isRightSided=y,this.symbols=h}}function dr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Te={exports:{}},be={};/**
1
+ (function(re,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("framer-motion")):typeof define=="function"&&define.amd?define(["exports","react","framer-motion"],m):(re=typeof globalThis<"u"?globalThis:re||self,m(re.ReactProMessenger={},re.React,re.framerMotion))})(this,function(re,m,pe){"use strict";var Lt=Object.defineProperty;var Nt=(re,m,pe)=>m in re?Lt(re,m,{enumerable:!0,configurable:!0,writable:!0,value:pe}):re[m]=pe;var ye=(re,m,pe)=>Nt(re,typeof m!="symbol"?m+"":m,pe);class Oe{constructor({id:l,text:o,createdDate:t,attachment:a,attachmentType:i,user:h,isRightSided:g,symbols:p}){ye(this,"id","0");ye(this,"text","");ye(this,"createdDate","");ye(this,"attachment","");ye(this,"attachmentType");ye(this,"user",{id:""});ye(this,"isRightSided",!1);ye(this,"symbols");this.id=l,this.text=o,this.createdDate=t,this.attachment=a,this.attachmentType=i,this.user=h,this.isRightSided=g,this.symbols=p}}function Rr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var _e={exports:{}},je={};/**
2
2
  * @license React
3
- * react-jsx-runtime.production.js
3
+ * react-jsx-runtime.production.min.js
4
4
  *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Ue;function pr(){if(Ue)return be;Ue=1;var r=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function i(t,a,o){var d=null;if(o!==void 0&&(d=""+o),a.key!==void 0&&(d=""+a.key),"key"in a){o={};for(var y in a)y!=="key"&&(o[y]=a[y])}else o=a;return a=o.ref,{$$typeof:r,type:t,key:d,ref:a!==void 0?a:null,props:o}}return be.Fragment=l,be.jsx=i,be.jsxs=i,be}var we={};/**
9
+ */var Qe;function kr(){if(Qe)return je;Qe=1;var r=m,l=Symbol.for("react.element"),o=Symbol.for("react.fragment"),t=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function h(g,p,x){var y,b={},P=null,F=null;x!==void 0&&(P=""+x),p.key!==void 0&&(P=""+p.key),p.ref!==void 0&&(F=p.ref);for(y in p)t.call(p,y)&&!i.hasOwnProperty(y)&&(b[y]=p[y]);if(g&&g.defaultProps)for(y in p=g.defaultProps,p)b[y]===void 0&&(b[y]=p[y]);return{$$typeof:l,type:g,key:P,ref:F,props:b,_owner:a.current}}return je.Fragment=o,je.jsx=h,je.jsxs=h,je}var Ee={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Be;function vr(){return Be||(Be=1,process.env.NODE_ENV!=="production"&&function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===M?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case c:return"Portal";case U:return"Profiler";case J:return"StrictMode";case ae:return"Suspense";case se:return"SuspenseList"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case le:return(e.displayName||"Context")+".Provider";case ne:return(e._context.displayName||"Context")+".Consumer";case ie:var p=e.render;return e=e.displayName,e||(e=p.displayName||p.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ee:return p=e.displayName||null,p!==null?p:r(e.type)||"Memo";case ue:p=e._payload,e=e._init;try{return r(e(p))}catch{}}return null}function l(e){return""+e}function i(e){try{l(e);var p=!1}catch{p=!0}if(p){p=console;var v=p.error,I=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return v.call(p,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",I),l(e)}}function t(){}function a(){if(x===0){k=console.log,T=console.info,O=console.warn,R=console.error,$=console.group,N=console.groupCollapsed,X=console.groupEnd;var e={configurable:!0,enumerable:!0,value:t,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}x++}function o(){if(x--,x===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:u({},e,{value:k}),info:u({},e,{value:T}),warn:u({},e,{value:O}),error:u({},e,{value:R}),group:u({},e,{value:$}),groupCollapsed:u({},e,{value:N}),groupEnd:u({},e,{value:X})})}0>x&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function d(e){if(f===void 0)try{throw Error()}catch(v){var p=v.stack.trim().match(/\n( *(at )?)/);f=p&&p[1]||"",oe=-1<v.stack.indexOf(`
18
- at`)?" (<anonymous>)":-1<v.stack.indexOf("@")?"@unknown:0:0":""}return`
19
- `+f+e+oe}function y(e,p){if(!e||he)return"";var v=me.get(e);if(v!==void 0)return v;he=!0,v=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var I=null;I=H.H,H.H=null,a();try{var Q={DetermineComponentFrameRoot:function(){try{if(p){var ye=function(){throw Error()};if(Object.defineProperty(ye.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ye,[])}catch(de){var _e=de}Reflect.construct(e,[],ye)}else{try{ye.call()}catch(de){_e=de}e.call(ye.prototype)}}else{try{throw Error()}catch(de){_e=de}(ye=e())&&typeof ye.catch=="function"&&ye.catch(function(){})}}catch(de){if(de&&_e&&typeof de.stack=="string")return[de.stack,_e.stack]}return[null,null]}};Q.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var B=Object.getOwnPropertyDescriptor(Q.DetermineComponentFrameRoot,"name");B&&B.configurable&&Object.defineProperty(Q.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=Q.DetermineComponentFrameRoot(),fe=S[0],xe=S[1];if(fe&&xe){var re=fe.split(`
20
- `),ge=xe.split(`
21
- `);for(S=B=0;B<re.length&&!re[B].includes("DetermineComponentFrameRoot");)B++;for(;S<ge.length&&!ge[S].includes("DetermineComponentFrameRoot");)S++;if(B===re.length||S===ge.length)for(B=re.length-1,S=ge.length-1;1<=B&&0<=S&&re[B]!==ge[S];)S--;for(;1<=B&&0<=S;B--,S--)if(re[B]!==ge[S]){if(B!==1||S!==1)do if(B--,S--,0>S||re[B]!==ge[S]){var Ce=`
22
- `+re[B].replace(" at new "," at ");return e.displayName&&Ce.includes("<anonymous>")&&(Ce=Ce.replace("<anonymous>",e.displayName)),typeof e=="function"&&me.set(e,Ce),Ce}while(1<=B&&0<=S);break}}}finally{he=!1,H.H=I,o(),Error.prepareStackTrace=v}return re=(re=e?e.displayName||e.name:"")?d(re):"",typeof e=="function"&&me.set(e,re),re}function h(e){if(e==null)return"";if(typeof e=="function"){var p=e.prototype;return y(e,!(!p||!p.isReactComponent))}if(typeof e=="string")return d(e);switch(e){case ae:return d("Suspense");case se:return d("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case ie:return e=y(e.render,!1),e;case ee:return h(e.type);case ue:p=e._payload,e=e._init;try{return h(e(p))}catch{}}return""}function w(){var e=H.A;return e===null?null:e.getOwner()}function m(e){if(s.call(e,"key")){var p=Object.getOwnPropertyDescriptor(e,"key").get;if(p&&p.isReactWarning)return!1}return e.key!==void 0}function C(e,p){function v(){lr||(lr=!0,console.error("%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://react.dev/link/special-props)",p))}v.isReactWarning=!0,Object.defineProperty(e,"key",{get:v,configurable:!0})}function A(){var e=r(this.type);return cr[e]||(cr[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function W(e,p,v,I,Q,B){return v=B.ref,e={$$typeof:q,type:e,key:p,props:B,_owner:Q},(v!==void 0?v:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:A}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function Z(e,p,v,I,Q,B){if(typeof e=="string"||typeof e=="function"||e===V||e===U||e===J||e===ae||e===se||e===_||typeof e=="object"&&e!==null&&(e.$$typeof===ue||e.$$typeof===ee||e.$$typeof===le||e.$$typeof===ne||e.$$typeof===ie||e.$$typeof===j||e.getModuleId!==void 0)){var S=p.children;if(S!==void 0)if(I)if(b(S)){for(I=0;I<S.length;I++)P(S[I],e);Object.freeze&&Object.freeze(S)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else P(S,e)}else S="",(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(S+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),e===null?I="null":b(e)?I="array":e!==void 0&&e.$$typeof===q?(I="<"+(r(e.type)||"Unknown")+" />",S=" Did you accidentally export a JSX literal instead of a component?"):I=typeof e,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",I,S);if(s.call(p,"key")){S=r(e);var fe=Object.keys(p).filter(function(re){return re!=="key"});I=0<fe.length?"{key: someKey, "+fe.join(": ..., ")+": ...}":"{key: someKey}",ur[S+I]||(fe=0<fe.length?"{"+fe.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var er;function Lr(){return er||(er=1,process.env.NODE_ENV!=="production"&&function(){var r=m,l=Symbol.for("react.element"),o=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),g=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),F=Symbol.for("react.offscreen"),H=Symbol.iterator,N="@@iterator";function B(e){if(e===null||typeof e!="object")return null;var u=H&&e[H]||e[N];return typeof u=="function"?u:null}var U=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function z(e){{for(var u=arguments.length,v=new Array(u>1?u-1:0),w=1;w<u;w++)v[w-1]=arguments[w];E("error",e,v)}}function E(e,u,v){{var w=U.ReactDebugCurrentFrame,V=w.getStackAddendum();V!==""&&(u+="%s",v=v.concat([V]));var q=v.map(function($){return String($)});q.unshift("Warning: "+u),Function.prototype.apply.call(console[e],console,q)}}var Z=!1,c=!1,J=!1,ne=!1,K=!1,se;se=Symbol.for("react.module.reference");function ve(e){return!!(typeof e=="string"||typeof e=="function"||e===t||e===i||K||e===a||e===x||e===y||ne||e===F||Z||c||J||typeof e=="object"&&e!==null&&(e.$$typeof===P||e.$$typeof===b||e.$$typeof===h||e.$$typeof===g||e.$$typeof===p||e.$$typeof===se||e.getModuleId!==void 0))}function he(e,u,v){var w=e.displayName;if(w)return w;var V=u.displayName||u.name||"";return V!==""?v+"("+V+")":v}function fe(e){return e.displayName||"Context"}function ee(e){if(e==null)return null;if(typeof e.tag=="number"&&z("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case t:return"Fragment";case o:return"Portal";case i:return"Profiler";case a:return"StrictMode";case x:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case g:var u=e;return fe(u)+".Consumer";case h:var v=e;return fe(v._context)+".Provider";case p:return he(e,e.render,"ForwardRef");case b:var w=e.displayName||null;return w!==null?w:ee(e.type)||"Memo";case P:{var V=e,q=V._payload,$=V._init;try{return ee($(q))}catch{return null}}}return null}var Q=Object.assign,de=0,_,I,M,oe,s,f,C;function j(){}j.__reactDisabledLog=!0;function T(){{if(de===0){_=console.log,I=console.info,M=console.warn,oe=console.error,s=console.group,f=console.groupCollapsed,C=console.groupEnd;var e={configurable:!0,enumerable:!0,value:j,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}de++}}function D(){{if(de--,de===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Q({},e,{value:_}),info:Q({},e,{value:I}),warn:Q({},e,{value:M}),error:Q({},e,{value:oe}),group:Q({},e,{value:s}),groupCollapsed:Q({},e,{value:f}),groupEnd:Q({},e,{value:C})})}de<0&&z("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var S=U.ReactCurrentDispatcher,O;function R(e,u,v){{if(O===void 0)try{throw Error()}catch(V){var w=V.stack.trim().match(/\n( *(at )?)/);O=w&&w[1]||""}return`
18
+ `+O+e}}var A=!1,k;{var ie=typeof WeakMap=="function"?WeakMap:Map;k=new ie}function d(e,u){if(!e||A)return"";{var v=k.get(e);if(v!==void 0)return v}var w;A=!0;var V=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var q;q=S.current,S.current=null,T();try{if(u){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(le){w=le}Reflect.construct(e,[],$)}else{try{$.call()}catch(le){w=le}e.call($.prototype)}}else{try{throw Error()}catch(le){w=le}e()}}catch(le){if(le&&w&&typeof le.stack=="string"){for(var L=le.stack.split(`
19
+ `),ae=w.stack.split(`
20
+ `),X=L.length-1,G=ae.length-1;X>=1&&G>=0&&L[X]!==ae[G];)G--;for(;X>=1&&G>=0;X--,G--)if(L[X]!==ae[G]){if(X!==1||G!==1)do if(X--,G--,G<0||L[X]!==ae[G]){var ce=`
21
+ `+L[X].replace(" at new "," at ");return e.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",e.displayName)),typeof e=="function"&&k.set(e,ce),ce}while(X>=1&&G>=0);break}}}finally{A=!1,S.current=q,D(),Error.prepareStackTrace=V}var Ce=e?e.displayName||e.name:"",be=Ce?R(Ce):"";return typeof e=="function"&&k.set(e,be),be}function ue(e,u,v){return d(e,!1)}function xe(e){var u=e.prototype;return!!(u&&u.isReactComponent)}function me(e,u,v){if(e==null)return"";if(typeof e=="function")return d(e,xe(e));if(typeof e=="string")return R(e);switch(e){case x:return R("Suspense");case y:return R("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case p:return ue(e.render);case b:return me(e.type,u,v);case P:{var w=e,V=w._payload,q=w._init;try{return me(q(V),u,v)}catch{}}}return""}var Se=Object.prototype.hasOwnProperty,yr={},gr=U.ReactDebugCurrentFrame;function ke(e){if(e){var u=e._owner,v=me(e.type,e._source,u?u.type:null);gr.setExtraStackFrame(v)}else gr.setExtraStackFrame(null)}function ct(e,u,v,w,V){{var q=Function.call.bind(Se);for(var $ in e)if(q(e,$)){var L=void 0;try{if(typeof e[$]!="function"){var ae=Error((w||"React class")+": "+v+" type `"+$+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[$]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ae.name="Invariant Violation",ae}L=e[$](u,$,w,v,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(X){L=X}L&&!(L instanceof Error)&&(ke(V),z("%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).",w||"React class",v,$,typeof L),ke(null)),L instanceof Error&&!(L.message in yr)&&(yr[L.message]=!0,ke(V),z("Failed %s type: %s",v,L.message),ke(null))}}}var ft=Array.isArray;function Je(e){return ft(e)}function dt(e){{var u=typeof Symbol=="function"&&Symbol.toStringTag,v=u&&e[Symbol.toStringTag]||e.constructor.name||"Object";return v}}function pt(e){try{return mr(e),!1}catch{return!0}}function mr(e){return""+e}function br(e){if(pt(e))return z("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dt(e)),mr(e)}var xr=U.ReactCurrentOwner,vt={key:!0,ref:!0,__self:!0,__source:!0},wr,Cr;function ht(e){if(Se.call(e,"ref")){var u=Object.getOwnPropertyDescriptor(e,"ref").get;if(u&&u.isReactWarning)return!1}return e.ref!==void 0}function yt(e){if(Se.call(e,"key")){var u=Object.getOwnPropertyDescriptor(e,"key").get;if(u&&u.isReactWarning)return!1}return e.key!==void 0}function gt(e,u){typeof e.ref=="string"&&xr.current}function mt(e,u){{var v=function(){wr||(wr=!0,z("%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)",u))};v.isReactWarning=!0,Object.defineProperty(e,"key",{get:v,configurable:!0})}}function bt(e,u){{var v=function(){Cr||(Cr=!0,z("%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)",u))};v.isReactWarning=!0,Object.defineProperty(e,"ref",{get:v,configurable:!0})}}var xt=function(e,u,v,w,V,q,$){var L={$$typeof:l,type:e,key:u,ref:v,props:$,_owner:q};return L._store={},Object.defineProperty(L._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(L,"_self",{configurable:!1,enumerable:!1,writable:!1,value:w}),Object.defineProperty(L,"_source",{configurable:!1,enumerable:!1,writable:!1,value:V}),Object.freeze&&(Object.freeze(L.props),Object.freeze(L)),L};function wt(e,u,v,w,V){{var q,$={},L=null,ae=null;v!==void 0&&(br(v),L=""+v),yt(u)&&(br(u.key),L=""+u.key),ht(u)&&(ae=u.ref,gt(u,V));for(q in u)Se.call(u,q)&&!vt.hasOwnProperty(q)&&($[q]=u[q]);if(e&&e.defaultProps){var X=e.defaultProps;for(q in X)$[q]===void 0&&($[q]=X[q])}if(L||ae){var G=typeof e=="function"?e.displayName||e.name||"Unknown":e;L&&mt($,G),ae&&bt($,G)}return xt(e,L,ae,V,w,xr.current,$)}}var He=U.ReactCurrentOwner,jr=U.ReactDebugCurrentFrame;function we(e){if(e){var u=e._owner,v=me(e.type,e._source,u?u.type:null);jr.setExtraStackFrame(v)}else jr.setExtraStackFrame(null)}var Ke;Ke=!1;function Xe(e){return typeof e=="object"&&e!==null&&e.$$typeof===l}function Er(){{if(He.current){var e=ee(He.current.type);if(e)return`
22
+
23
+ Check the render method of \``+e+"`."}return""}}function Ct(e){return""}var Tr={};function jt(e){{var u=Er();if(!u){var v=typeof e=="string"?e:e.displayName||e.name;v&&(u=`
24
+
25
+ Check the top-level render call using <`+v+">.")}return u}}function Sr(e,u){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var v=jt(u);if(Tr[v])return;Tr[v]=!0;var w="";e&&e._owner&&e._owner!==He.current&&(w=" It was passed a child from "+ee(e._owner.type)+"."),we(e),z('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',v,w),we(null)}}function Or(e,u){{if(typeof e!="object")return;if(Je(e))for(var v=0;v<e.length;v++){var w=e[v];Xe(w)&&Sr(w,u)}else if(Xe(e))e._store&&(e._store.validated=!0);else if(e){var V=B(e);if(typeof V=="function"&&V!==e.entries)for(var q=V.call(e),$;!($=q.next()).done;)Xe($.value)&&Sr($.value,u)}}}function Et(e){{var u=e.type;if(u==null||typeof u=="string")return;var v;if(typeof u=="function")v=u.propTypes;else if(typeof u=="object"&&(u.$$typeof===p||u.$$typeof===b))v=u.propTypes;else return;if(v){var w=ee(u);ct(v,e.props,"prop",w,e)}else if(u.PropTypes!==void 0&&!Ke){Ke=!0;var V=ee(u);z("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",V||"Unknown")}typeof u.getDefaultProps=="function"&&!u.getDefaultProps.isReactClassApproved&&z("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tt(e){{for(var u=Object.keys(e.props),v=0;v<u.length;v++){var w=u[v];if(w!=="children"&&w!=="key"){we(e),z("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",w),we(null);break}}e.ref!==null&&(we(e),z("Invalid attribute `ref` supplied to `React.Fragment`."),we(null))}}var _r={};function Pr(e,u,v,w,V,q){{var $=ve(e);if(!$){var L="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(L+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ae=Ct();ae?L+=ae:L+=Er();var X;e===null?X="null":Je(e)?X="array":e!==void 0&&e.$$typeof===l?(X="<"+(ee(e.type)||"Unknown")+" />",L=" Did you accidentally export a JSX literal instead of a component?"):X=typeof e,z("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",X,L)}var G=wt(e,u,v,V,q);if(G==null)return G;if($){var ce=u.children;if(ce!==void 0)if(w)if(Je(ce)){for(var Ce=0;Ce<ce.length;Ce++)Or(ce[Ce],e);Object.freeze&&Object.freeze(ce)}else z("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Or(ce,e)}if(Se.call(u,"key")){var be=ee(e),le=Object.keys(u).filter(function(kt){return kt!=="key"}),Ge=le.length>0?"{key: someKey, "+le.join(": ..., ")+": ...}":"{key: someKey}";if(!_r[be+Ge]){var Rt=le.length>0?"{"+le.join(": ..., ")+": ...}":"{}";z(`A props object containing a "key" prop is being spread into JSX:
23
26
  let props = %s;
24
27
  <%s {...props} />
25
28
  React keys must be passed directly to JSX without using spread:
26
29
  let props = %s;
27
- <%s key={someKey} {...props} />`,I,S,fe,S),ur[S+I]=!0)}if(S=null,v!==void 0&&(i(v),S=""+v),m(p)&&(i(p.key),S=""+p.key),"key"in p){v={};for(var xe in p)xe!=="key"&&(v[xe]=p[xe])}else v=p;return S&&C(v,typeof e=="function"?e.displayName||e.name||"Unknown":e),W(e,S,B,Q,w(),v)}function P(e,p){if(typeof e=="object"&&e&&e.$$typeof!==Br){if(b(e))for(var v=0;v<e.length;v++){var I=e[v];D(I)&&F(I,p)}else if(D(e))e._store&&(e._store.validated=1);else if(e===null||typeof e!="object"?v=null:(v=L&&e[L]||e["@@iterator"],v=typeof v=="function"?v:null),typeof v=="function"&&v!==e.entries&&(v=v.call(e),v!==e))for(;!(e=v.next()).done;)D(e.value)&&F(e.value,p)}}function D(e){return typeof e=="object"&&e!==null&&e.$$typeof===q}function F(e,p){if(e._store&&!e._store.validated&&e.key==null&&(e._store.validated=1,p=te(p),!fr[p])){fr[p]=!0;var v="";e&&e._owner!=null&&e._owner!==w()&&(v=null,typeof e._owner.tag=="number"?v=r(e._owner.type):typeof e._owner.name=="string"&&(v=e._owner.name),v=" It was passed a child from "+v+".");var I=H.getCurrentStack;H.getCurrentStack=function(){var Q=h(e.type);return I&&(Q+=I()||""),Q},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',p,v),H.getCurrentStack=I}}function te(e){var p="",v=w();return v&&(v=r(v.type))&&(p=`
28
-
29
- Check the render method of \``+v+"`."),p||(e=r(e))&&(p=`
30
-
31
- Check the top-level render call using <`+e+">."),p}var E=g,q=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),J=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),ne=Symbol.for("react.consumer"),le=Symbol.for("react.context"),ie=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),ue=Symbol.for("react.lazy"),_=Symbol.for("react.offscreen"),L=Symbol.iterator,M=Symbol.for("react.client.reference"),H=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,s=Object.prototype.hasOwnProperty,u=Object.assign,j=Symbol.for("react.client.reference"),b=Array.isArray,x=0,k,T,O,R,$,N,X;t.__reactDisabledLog=!0;var f,oe,he=!1,me=new(typeof WeakMap=="function"?WeakMap:Map),Br=Symbol.for("react.client.reference"),lr,cr={},ur={},fr={};we.Fragment=V,we.jsx=function(e,p,v,I,Q){return Z(e,p,v,!1,I,Q)},we.jsxs=function(e,p,v,I,Q){return Z(e,p,v,!0,I,Q)}}()),we}var Ze;function hr(){return Ze||(Ze=1,process.env.NODE_ENV==="production"?Te.exports=pr():Te.exports=vr()),Te.exports}var n=hr();const yr=({isOpen:r,onClose:l,onConfirm:i,header:t,question:a})=>r?n.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:n.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:n.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[n.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:[n.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[t," "]}),n.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:l,children:[n.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:n.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),n.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),n.jsx("div",{className:"p-4 md:p-5 space-y-4",children:n.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[a," "]})}),n.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[n.jsx("button",{onClick:()=>{i(),l()},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 "}),n.jsx("button",{onClick:l,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,gr=({items:r,isVisible:l,position:i,messageId:t,isCurrentUserMessage:a})=>n.jsx(ce.AnimatePresence,{children:l&&n.jsx(ce.motion.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-20 bg-white shadow-lg rounded-md p-2 px-1 w-42",style:{top:i.y,left:i.x},children:r.map((o,d)=>o!=null&&o.onlyCurrentUserMessage&&!a?null:n.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:()=>o.onClick(t),children:[g.cloneElement(o.icon,{className:"text-black",size:18})," ",n.jsx("span",{className:"ml-2 text-black",children:o.name})]},d))})}),mr=()=>n.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.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"})}),xr=()=>n.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.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"})}),He=()=>n.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.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"})}),Pe=r=>n.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...r,children:n.jsxs("g",{fill:"none",children:[n.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"}),n.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"}),n.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"}),n.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"})]})}),br=({onSendMessage:r,onSendVoice:l,onFileSend:i,dynamicSymbolAssignments:t})=>{const[a,o]=g.useState(""),[d,y]=g.useState(!1),[h,w]=g.useState(0),[m,C]=g.useState(null),[A,W]=g.useState(null),[Z,P]=g.useState(0),D=g.useRef(null),F=g.useRef([]),te=g.useRef(null),E=g.useRef(null),q=g.useRef(null),[c,V]=g.useState(!1),J=_=>{const L=_.target.value;o(L);const M=L.match(/(\S+)$/);if(M){const H=M[0];if(m){const s=M[0].split(m)[1];W(s)}t!=null&&t.some(s=>s.symbol===H)&&C(H)}else C(null)},U=(_,L)=>{o(M=>M+L+" "),C(null),E.current.focus()},ne=()=>{a.trim()!==""&&(r(a),o(""),C(null))},le=async()=>{y(!0),w(0),F.current=[],te.current=setInterval(()=>{w(M=>M+1)},1e3);const _=await navigator.mediaDevices.getUserMedia({audio:!0}),L=new MediaRecorder(_);D.current=L,L.ondataavailable=M=>{M.data.size>0&&F.current.push(M.data)},L.onstop=()=>{clearInterval(te.current);const M=new Blob(F.current,{type:"audio/mp3"}),H=URL.createObjectURL(M);l(H),y(!1)},L.start()},ie=()=>{var _;(_=D.current)==null||_.stop()},ae=()=>{var _;(_=q.current)==null||_.click()},se=_=>{var M;const L=(M=_.target.files)==null?void 0:M[0];L&&i(L)},ee=_=>{const L=Math.floor(_/60),M=_%60;return`${L.toString().padStart(2,"0")}:${M.toString().padStart(2,"0")}`},ue=_=>{const{scrollTop:L,scrollHeight:M,clientHeight:H}=_.currentTarget;if(L>Z){if(L+H>=M-1){const u=t==null?void 0:t.find(j=>j.symbol===m);u&&(u!=null&&u.updatePageNumber)&&(V(!0),u==null||u.updatePageNumber(u.pagNumber+1),P(L),setTimeout(()=>{V(!1)},500))}}else P(L)};return n.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[d?n.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[n.jsx("span",{className:"text-blue-400 font-bold flex-1",children:ee(h)}),n.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:ie,children:n.jsx(He,{})})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"w-[90%] relative ",children:[n.jsx("div",{onClick:ae,className:"cursor-pointer absolute right-4 top-[11px]",children:n.jsx(mr,{})}),n.jsx("input",{type:"file",ref:q,style:{display:"none"},onChange:se}),n.jsx("input",{type:"text",ref:E,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:a,onChange:J,onKeyDown:_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),ne())}}),n.jsx(Pe,{className:"rotate-180 absolute -right-[11.4px] top-5"})]}),n.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:a?ne:le,children:a?n.jsx(He,{}):n.jsx(xr,{})})]}),m&&n.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:ue,children:[n.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[n.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",n.jsx("span",{className:"text-blue-500",children:m})]}),n.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>C(null),children:"✕"})]}),n.jsxs("div",{className:"space-y-2",children:[t?t.filter(_=>_.symbol===m).map(_=>{var H;const{component:L,lists:M}=_;return L?A?(H=M==null?void 0:M.filter(s=>s==null?void 0:s.name.includes(A)))==null?void 0:H.map((s,u)=>n.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:n.jsx(L,{listsProps:s,onClick:(j,b)=>U(j,b)})},u)):M==null?void 0:M.map((s,u)=>n.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:n.jsx(L,{listsProps:s,onClick:(j,b)=>U(j,b)})},u)):null}):null,n.jsx("div",{className:"h-8",children:c&&"Loading more items..."})]})]})]})};var ve=(r=>(r[r.File=0]="File",r[r.Voice=1]="Voice",r[r.Video=2]="Video",r[r.Image=3]="Image",r))(ve||{});const Je=({fileName:r,fileSize:l,format:i,src:t})=>{const a=()=>({rar:n.jsx("p",{className:"p-2 text-green-500 font-bold",children:i}),zip:n.jsx("p",{className:"p-2 text-blue-500 font-bold",children:i}),pdf:n.jsx("p",{className:"p-2 text-red-500 font-bold",children:i}),doc:n.jsx("p",{className:"p-2 text-blue-400 font-bold",children:i}),vid:n.jsx("p",{className:"p-2 text-orange-400 font-bold",children:i}),"":n.jsx("p",{className:"p-2 text-black font-bold",children:i})})[i||""],o=d=>d>1048576?(d/1048576).toFixed(1)+" MB":(d/1024).toFixed(1)+" KB";return n.jsxs("div",{className:"flex items-center rounded-lg",children:[n.jsx("div",{className:"mr-3 relative border border-green-950 rounded-md p-3",children:a()}),n.jsxs("div",{className:"flex flex-col flex-grow",children:[n.jsx("a",{href:t,download:r,className:"text-gray-900 font-medium hover:underline",children:r}),n.jsx("span",{className:"text-gray-600 text-sm",children:o(l)})]}),n.jsx("a",{href:t,download:r,className:"ml-2 bg-green-500 text-white px-2 py-1 text-sm rounded hover:bg-green-600",children:"Download"})]})},wr=r=>n.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",...r,children:n.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),jr=r=>n.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",...r,children:[n.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),n.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let je=null;const Cr=({src:r,className:l})=>{const[i,t]=g.useState(!1),[a,o]=g.useState(0),d=g.useRef(null);g.useEffect(()=>{const h=d.current;if(!h)return;const w=()=>{o(h.currentTime/h.duration*100)},m=()=>t(!0),C=()=>t(!1),A=()=>{t(!1),o(0)};return h.addEventListener("timeupdate",w),h.addEventListener("play",m),h.addEventListener("pause",C),h.addEventListener("ended",A),()=>{h.removeEventListener("timeupdate",w),h.removeEventListener("play",m),h.removeEventListener("pause",C),h.removeEventListener("ended",A)}},[]);const y=()=>{const h=d.current;h&&(i?h.pause():(je&&je!==h&&(je.pause(),je.currentTime=0),h.play(),je=h))};return n.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${l}`,children:[n.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:y,children:i?n.jsx(jr,{}):n.jsx(wr,{})}),n.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${a}%`}})}),n.jsx("audio",{ref:d,src:r})]})},Er=({attachment:r,attachmentType:l})=>{if(r)return l===ve.Voice?n.jsx("div",{className:"w-full",children:n.jsx(Cr,{src:r})}):l===ve.Image?n.jsx("div",{className:"w-full",children:n.jsx("img",{src:r})}):l===ve.File?n.jsx("div",{className:"w-full mt-1",children:n.jsx(Je,{fileName:"productivity",fileSize:23e3,format:"rar",src:r})}):l===ve.Video?n.jsx("div",{className:"w-full mt-1",children:n.jsx(Je,{fileName:"productivity",fileSize:23e3,format:"rar",src:r})}):null},Tr=({message:r,showUserProfile:l,handleContextMenu:i,media:t})=>{var a,o,d,y,h;return n.jsxs(n.Fragment,{children:[l?n.jsx("img",{src:r.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,n.jsxs(ce.motion.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:w=>i(w,r),className:`relative ${t?"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:[n.jsx("span",{className:"absolute top-1 text-xs text-orange-700",children:(a=r.user)!=null&&a.fullName&&((d=(o=r.user)==null?void 0:o.fullName)==null?void 0:d.length)>16?(y=r.user)==null?void 0:y.firstName:(h=r.user)==null?void 0:h.fullName}),t||null,n.jsx("span",{children:r.text}),n.jsx("div",{className:"w-full flex gap- items-center justify-end",children:n.jsx("span",{className:"text-[10px]",children:new Date(r.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(r.createdDate).toLocaleTimeString().split(":")[1]})}),n.jsx(Pe,{className:"fill-blue-200 -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 [&>g>path]:fill-green-200"})]})]})},Sr=()=>n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.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"}),n.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"})]}),Or=({handleContextMenu:r,media:l,message:i})=>n.jsxs(ce.motion.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:t=>r(t,i),className:`relative self-end ${l?"w-3/4":"max-w-3/4"} flex flex-col justify-center md:max-w-[400px] p-2 rounded-lg bg-blue-200`,children:[l||null,n.jsx("span",{children:i.text}),n.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[n.jsx("span",{className:"text-[10px]",children:new Date(i.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(i.createdDate).toLocaleTimeString().split(":")[1]}),n.jsx(Sr,{})]}),n.jsx(Pe,{className:"fill-blue-200 rotate-180 absolute -right-2 bottom-0 [&>g>path]:fill-blue-200"})]});var Se={exports:{}},Oe={exports:{}},Y={};/** @license React v16.13.1
30
+ <%s key={someKey} {...props} />`,Ge,be,Rt,be),_r[be+Ge]=!0}}return e===t?Tt(G):Et(G),G}}function St(e,u,v){return Pr(e,u,v,!0)}function Ot(e,u,v){return Pr(e,u,v,!1)}var _t=Ot,Pt=St;Ee.Fragment=t,Ee.jsx=_t,Ee.jsxs=Pt}()),Ee}var rr;function Nr(){return rr||(rr=1,process.env.NODE_ENV==="production"?_e.exports=kr():_e.exports=Lr()),_e.exports}var n=Nr();const Ir=({isOpen:r,onClose:l,onConfirm:o,header:t,question:a})=>r?n.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:n.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:n.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[n.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:[n.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[t," "]}),n.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:l,children:[n.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:n.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),n.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),n.jsx("div",{className:"p-4 md:p-5 space-y-4",children:n.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[a," "]})}),n.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[n.jsx("button",{onClick:()=>{o(),l()},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 "}),n.jsx("button",{onClick:l,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,Mr=({items:r,isVisible:l,position:o,messageId:t,isCurrentUserMessage:a})=>n.jsx(pe.AnimatePresence,{children:l&&n.jsx(pe.motion.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-20 bg-white shadow-lg rounded-md p-2 px-1 w-42",style:{top:o.y,left:o.x},children:r.map((i,h)=>i!=null&&i.onlyCurrentUserMessage&&!a?null:n.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:()=>i.onClick(t),children:[m.cloneElement(i.icon,{className:"text-black",size:18})," ",n.jsx("span",{className:"ml-2 text-black",children:i.name})]},h))})}),Dr=()=>n.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.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"})}),$r=()=>n.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.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"})}),tr=()=>n.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.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"})}),Le=r=>n.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...r,children:n.jsxs("g",{fill:"none",children:[n.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"}),n.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"}),n.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"}),n.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"})]})}),Ar=({onSendMessage:r,onSendVoice:l,onFileSend:o,dynamicSymbolAssignments:t})=>{const[a,i]=m.useState(""),[h,g]=m.useState(!1),[p,x]=m.useState(0),[y,b]=m.useState(null),[P,F]=m.useState(null),[H,N]=m.useState(0),B=m.useRef(null),U=m.useRef([]),z=m.useRef(null),E=m.useRef(null),Z=m.useRef(null),[c,J]=m.useState(!1),ne=_=>{const I=_.target.value;i(I);const M=I.match(/(\S+)$/);if(M){const oe=M[0];if(y){const s=M[0].split(y)[1];F(s)}t!=null&&t.some(s=>s.symbol===oe)&&b(oe)}else b(null)},K=(_,I)=>{i(M=>M+I+" "),b(null),E.current.focus()},se=()=>{a.trim()!==""&&(r(a),i(""),b(null))},ve=async()=>{g(!0),x(0),U.current=[],z.current=setInterval(()=>{x(M=>M+1)},1e3);const _=await navigator.mediaDevices.getUserMedia({audio:!0}),I=new MediaRecorder(_);B.current=I,I.ondataavailable=M=>{M.data.size>0&&U.current.push(M.data)},I.onstop=()=>{clearInterval(z.current);const M=new Blob(U.current,{type:"audio/mp3"}),oe=URL.createObjectURL(M);l(oe),g(!1)},I.start()},he=()=>{var _;(_=B.current)==null||_.stop()},fe=()=>{var _;(_=Z.current)==null||_.click()},ee=_=>{var M;const I=(M=_.target.files)==null?void 0:M[0];I&&o(I)},Q=_=>{const I=Math.floor(_/60),M=_%60;return`${I.toString().padStart(2,"0")}:${M.toString().padStart(2,"0")}`},de=_=>{const{scrollTop:I,scrollHeight:M,clientHeight:oe}=_.currentTarget;if(I>H){if(I+oe>=M-1){const f=t==null?void 0:t.find(C=>C.symbol===y);f&&(f!=null&&f.updatePageNumber)&&(J(!0),f==null||f.updatePageNumber(f.pagNumber+1),N(I),setTimeout(()=>{J(!1)},500))}}else N(I)};return n.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[h?n.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[n.jsx("span",{className:"text-blue-400 font-bold flex-1",children:Q(p)}),n.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:he,children:n.jsx(tr,{})})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"w-[90%] relative ",children:[n.jsx("div",{onClick:fe,className:"cursor-pointer absolute right-4 top-[11px]",children:n.jsx(Dr,{})}),n.jsx("input",{type:"file",ref:Z,style:{display:"none"},onChange:ee}),n.jsx("input",{type:"text",ref:E,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:a,onChange:ne,onKeyDown:_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),se())}}),n.jsx(Le,{className:"rotate-180 absolute -right-[11.4px] top-5"})]}),n.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:a?se:ve,children:a?n.jsx(tr,{}):n.jsx($r,{})})]}),y&&n.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:de,children:[n.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[n.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",n.jsx("span",{className:"text-blue-500",children:y})]}),n.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>b(null),children:"✕"})]}),n.jsxs("div",{className:"space-y-2",children:[t?t.filter(_=>_.symbol===y).map(_=>{var oe;const{component:I,lists:M}=_;return I?P?(oe=M==null?void 0:M.filter(s=>s==null?void 0:s.name.includes(P)))==null?void 0:oe.map((s,f)=>n.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:n.jsx(I,{listsProps:s,onClick:(C,j)=>K(C,j)})},f)):M==null?void 0:M.map((s,f)=>n.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:n.jsx(I,{listsProps:s,onClick:(C,j)=>K(C,j)})},f)):null}):null,n.jsx("div",{className:"h-8",children:c&&"Loading more items..."})]})]})]})};var ge=(r=>(r[r.File=0]="File",r[r.Voice=1]="Voice",r[r.Video=2]="Video",r[r.Image=3]="Image",r))(ge||{});const nr=({fileName:r,fileSize:l,format:o,src:t})=>{const a=()=>({rar:n.jsx("p",{className:"p-2 text-green-500 font-bold",children:o}),zip:n.jsx("p",{className:"p-2 text-blue-500 font-bold",children:o}),pdf:n.jsx("p",{className:"p-2 text-red-500 font-bold",children:o}),doc:n.jsx("p",{className:"p-2 text-blue-400 font-bold",children:o}),vid:n.jsx("p",{className:"p-2 text-orange-400 font-bold",children:o}),"":n.jsx("p",{className:"p-2 text-black font-bold",children:o})})[o||""],i=h=>h>1048576?(h/1048576).toFixed(1)+" MB":(h/1024).toFixed(1)+" KB";return n.jsxs("div",{className:"flex items-center rounded-lg",children:[n.jsx("div",{className:"mr-3 relative border border-green-950 rounded-md p-3",children:a()}),n.jsxs("div",{className:"flex flex-col flex-grow",children:[n.jsx("a",{href:t,download:r,className:"text-gray-900 font-medium hover:underline",children:r}),n.jsx("span",{className:"text-gray-600 text-sm",children:i(l)})]}),n.jsx("a",{href:t,download:r,className:"ml-2 bg-green-500 text-white px-2 py-1 text-sm rounded hover:bg-green-600",children:"Download"})]})},Fr=r=>n.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",...r,children:n.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),Wr=r=>n.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",...r,children:[n.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),n.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let Te=null;const Yr=({src:r,className:l})=>{const[o,t]=m.useState(!1),[a,i]=m.useState(0),h=m.useRef(null);m.useEffect(()=>{const p=h.current;if(!p)return;const x=()=>{i(p.currentTime/p.duration*100)},y=()=>t(!0),b=()=>t(!1),P=()=>{t(!1),i(0)};return p.addEventListener("timeupdate",x),p.addEventListener("play",y),p.addEventListener("pause",b),p.addEventListener("ended",P),()=>{p.removeEventListener("timeupdate",x),p.removeEventListener("play",y),p.removeEventListener("pause",b),p.removeEventListener("ended",P)}},[]);const g=()=>{const p=h.current;p&&(o?p.pause():(Te&&Te!==p&&(Te.pause(),Te.currentTime=0),p.play(),Te=p))};return n.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${l}`,children:[n.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:g,children:o?n.jsx(Wr,{}):n.jsx(Fr,{})}),n.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${a}%`}})}),n.jsx("audio",{ref:h,src:r})]})},Vr=({attachment:r,attachmentType:l})=>{if(r)return l===ge.Voice?n.jsx("div",{className:"w-full",children:n.jsx(Yr,{src:r})}):l===ge.Image?n.jsx("div",{className:"w-full",children:n.jsx("img",{src:r})}):l===ge.File?n.jsx("div",{className:"w-full mt-1",children:n.jsx(nr,{fileName:"productivity",fileSize:23e3,format:"rar",src:r})}):l===ge.Video?n.jsx("div",{className:"w-full mt-1",children:n.jsx(nr,{fileName:"productivity",fileSize:23e3,format:"rar",src:r})}):null},zr=({message:r,showUserProfile:l,handleContextMenu:o,media:t})=>{var a,i,h,g,p;return n.jsxs(n.Fragment,{children:[l?n.jsx("img",{src:r.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,n.jsxs(pe.motion.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:x=>o(x,r),className:`relative ${t?"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:[n.jsx("span",{className:"absolute top-1 text-xs text-orange-700",children:(a=r.user)!=null&&a.fullName&&((h=(i=r.user)==null?void 0:i.fullName)==null?void 0:h.length)>16?(g=r.user)==null?void 0:g.firstName:(p=r.user)==null?void 0:p.fullName}),t||null,n.jsx("span",{children:r.text}),n.jsx("div",{className:"w-full flex gap- items-center justify-end",children:n.jsx("span",{className:"text-[10px]",children:new Date(r.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(r.createdDate).toLocaleTimeString().split(":")[1]})}),n.jsx(Le,{className:"fill-blue-200 -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 [&>g>path]:fill-green-200"})]})]})},Ur=()=>n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.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"}),n.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"})]}),qr=({handleContextMenu:r,media:l,message:o})=>n.jsxs(pe.motion.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:t=>r(t,o),className:`relative self-end ${l?"w-3/4":"max-w-3/4"} flex flex-col justify-center md:max-w-[400px] p-2 rounded-lg bg-blue-200`,children:[l||null,n.jsx("span",{children:o.text}),n.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[n.jsx("span",{className:"text-[10px]",children:new Date(o.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(o.createdDate).toLocaleTimeString().split(":")[1]}),n.jsx(Ur,{})]}),n.jsx(Le,{className:"fill-blue-200 rotate-180 absolute -right-2 bottom-0 [&>g>path]:fill-blue-200"})]});var Pe={exports:{}},Re={exports:{}},W={};/** @license React v16.13.1
32
31
  * react-is.production.min.js
33
32
  *
34
33
  * Copyright (c) Facebook, Inc. and its affiliates.
35
34
  *
36
35
  * This source code is licensed under the MIT license found in the
37
36
  * LICENSE file in the root directory of this source tree.
38
- */var Xe;function _r(){if(Xe)return Y;Xe=1;var r=typeof Symbol=="function"&&Symbol.for,l=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,t=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,o=r?Symbol.for("react.profiler"):60114,d=r?Symbol.for("react.provider"):60109,y=r?Symbol.for("react.context"):60110,h=r?Symbol.for("react.async_mode"):60111,w=r?Symbol.for("react.concurrent_mode"):60111,m=r?Symbol.for("react.forward_ref"):60112,C=r?Symbol.for("react.suspense"):60113,A=r?Symbol.for("react.suspense_list"):60120,W=r?Symbol.for("react.memo"):60115,Z=r?Symbol.for("react.lazy"):60116,P=r?Symbol.for("react.block"):60121,D=r?Symbol.for("react.fundamental"):60117,F=r?Symbol.for("react.responder"):60118,te=r?Symbol.for("react.scope"):60119;function E(c){if(typeof c=="object"&&c!==null){var V=c.$$typeof;switch(V){case l:switch(c=c.type,c){case h:case w:case t:case o:case a:case C:return c;default:switch(c=c&&c.$$typeof,c){case y:case m:case Z:case W:case d:return c;default:return V}}case i:return V}}}function q(c){return E(c)===w}return Y.AsyncMode=h,Y.ConcurrentMode=w,Y.ContextConsumer=y,Y.ContextProvider=d,Y.Element=l,Y.ForwardRef=m,Y.Fragment=t,Y.Lazy=Z,Y.Memo=W,Y.Portal=i,Y.Profiler=o,Y.StrictMode=a,Y.Suspense=C,Y.isAsyncMode=function(c){return q(c)||E(c)===h},Y.isConcurrentMode=q,Y.isContextConsumer=function(c){return E(c)===y},Y.isContextProvider=function(c){return E(c)===d},Y.isElement=function(c){return typeof c=="object"&&c!==null&&c.$$typeof===l},Y.isForwardRef=function(c){return E(c)===m},Y.isFragment=function(c){return E(c)===t},Y.isLazy=function(c){return E(c)===Z},Y.isMemo=function(c){return E(c)===W},Y.isPortal=function(c){return E(c)===i},Y.isProfiler=function(c){return E(c)===o},Y.isStrictMode=function(c){return E(c)===a},Y.isSuspense=function(c){return E(c)===C},Y.isValidElementType=function(c){return typeof c=="string"||typeof c=="function"||c===t||c===w||c===o||c===a||c===C||c===A||typeof c=="object"&&c!==null&&(c.$$typeof===Z||c.$$typeof===W||c.$$typeof===d||c.$$typeof===y||c.$$typeof===m||c.$$typeof===D||c.$$typeof===F||c.$$typeof===te||c.$$typeof===P)},Y.typeOf=E,Y}var z={};/** @license React v16.13.1
37
+ */var or;function Br(){if(or)return W;or=1;var r=typeof Symbol=="function"&&Symbol.for,l=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,t=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,i=r?Symbol.for("react.profiler"):60114,h=r?Symbol.for("react.provider"):60109,g=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.async_mode"):60111,x=r?Symbol.for("react.concurrent_mode"):60111,y=r?Symbol.for("react.forward_ref"):60112,b=r?Symbol.for("react.suspense"):60113,P=r?Symbol.for("react.suspense_list"):60120,F=r?Symbol.for("react.memo"):60115,H=r?Symbol.for("react.lazy"):60116,N=r?Symbol.for("react.block"):60121,B=r?Symbol.for("react.fundamental"):60117,U=r?Symbol.for("react.responder"):60118,z=r?Symbol.for("react.scope"):60119;function E(c){if(typeof c=="object"&&c!==null){var J=c.$$typeof;switch(J){case l:switch(c=c.type,c){case p:case x:case t:case i:case a:case b:return c;default:switch(c=c&&c.$$typeof,c){case g:case y:case H:case F:case h:return c;default:return J}}case o:return J}}}function Z(c){return E(c)===x}return W.AsyncMode=p,W.ConcurrentMode=x,W.ContextConsumer=g,W.ContextProvider=h,W.Element=l,W.ForwardRef=y,W.Fragment=t,W.Lazy=H,W.Memo=F,W.Portal=o,W.Profiler=i,W.StrictMode=a,W.Suspense=b,W.isAsyncMode=function(c){return Z(c)||E(c)===p},W.isConcurrentMode=Z,W.isContextConsumer=function(c){return E(c)===g},W.isContextProvider=function(c){return E(c)===h},W.isElement=function(c){return typeof c=="object"&&c!==null&&c.$$typeof===l},W.isForwardRef=function(c){return E(c)===y},W.isFragment=function(c){return E(c)===t},W.isLazy=function(c){return E(c)===H},W.isMemo=function(c){return E(c)===F},W.isPortal=function(c){return E(c)===o},W.isProfiler=function(c){return E(c)===i},W.isStrictMode=function(c){return E(c)===a},W.isSuspense=function(c){return E(c)===b},W.isValidElementType=function(c){return typeof c=="string"||typeof c=="function"||c===t||c===x||c===i||c===a||c===b||c===P||typeof c=="object"&&c!==null&&(c.$$typeof===H||c.$$typeof===F||c.$$typeof===h||c.$$typeof===g||c.$$typeof===y||c.$$typeof===B||c.$$typeof===U||c.$$typeof===z||c.$$typeof===N)},W.typeOf=E,W}var Y={};/** @license React v16.13.1
39
38
  * react-is.development.js
40
39
  *
41
40
  * Copyright (c) Facebook, Inc. and its affiliates.
42
41
  *
43
42
  * This source code is licensed under the MIT license found in the
44
43
  * LICENSE file in the root directory of this source tree.
45
- */var Ge;function Pr(){return Ge||(Ge=1,process.env.NODE_ENV!=="production"&&function(){var r=typeof Symbol=="function"&&Symbol.for,l=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,t=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,o=r?Symbol.for("react.profiler"):60114,d=r?Symbol.for("react.provider"):60109,y=r?Symbol.for("react.context"):60110,h=r?Symbol.for("react.async_mode"):60111,w=r?Symbol.for("react.concurrent_mode"):60111,m=r?Symbol.for("react.forward_ref"):60112,C=r?Symbol.for("react.suspense"):60113,A=r?Symbol.for("react.suspense_list"):60120,W=r?Symbol.for("react.memo"):60115,Z=r?Symbol.for("react.lazy"):60116,P=r?Symbol.for("react.block"):60121,D=r?Symbol.for("react.fundamental"):60117,F=r?Symbol.for("react.responder"):60118,te=r?Symbol.for("react.scope"):60119;function E(f){return typeof f=="string"||typeof f=="function"||f===t||f===w||f===o||f===a||f===C||f===A||typeof f=="object"&&f!==null&&(f.$$typeof===Z||f.$$typeof===W||f.$$typeof===d||f.$$typeof===y||f.$$typeof===m||f.$$typeof===D||f.$$typeof===F||f.$$typeof===te||f.$$typeof===P)}function q(f){if(typeof f=="object"&&f!==null){var oe=f.$$typeof;switch(oe){case l:var he=f.type;switch(he){case h:case w:case t:case o:case a:case C:return he;default:var me=he&&he.$$typeof;switch(me){case y:case m:case Z:case W:case d:return me;default:return oe}}case i:return oe}}}var c=h,V=w,J=y,U=d,ne=l,le=m,ie=t,ae=Z,se=W,ee=i,ue=o,_=a,L=C,M=!1;function H(f){return M||(M=!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.")),s(f)||q(f)===h}function s(f){return q(f)===w}function u(f){return q(f)===y}function j(f){return q(f)===d}function b(f){return typeof f=="object"&&f!==null&&f.$$typeof===l}function x(f){return q(f)===m}function k(f){return q(f)===t}function T(f){return q(f)===Z}function O(f){return q(f)===W}function R(f){return q(f)===i}function $(f){return q(f)===o}function N(f){return q(f)===a}function X(f){return q(f)===C}z.AsyncMode=c,z.ConcurrentMode=V,z.ContextConsumer=J,z.ContextProvider=U,z.Element=ne,z.ForwardRef=le,z.Fragment=ie,z.Lazy=ae,z.Memo=se,z.Portal=ee,z.Profiler=ue,z.StrictMode=_,z.Suspense=L,z.isAsyncMode=H,z.isConcurrentMode=s,z.isContextConsumer=u,z.isContextProvider=j,z.isElement=b,z.isForwardRef=x,z.isFragment=k,z.isLazy=T,z.isMemo=O,z.isPortal=R,z.isProfiler=$,z.isStrictMode=N,z.isSuspense=X,z.isValidElementType=E,z.typeOf=q}()),z}var Ke;function Qe(){return Ke||(Ke=1,process.env.NODE_ENV==="production"?Oe.exports=_r():Oe.exports=Pr()),Oe.exports}/*
44
+ */var ir;function Zr(){return ir||(ir=1,process.env.NODE_ENV!=="production"&&function(){var r=typeof Symbol=="function"&&Symbol.for,l=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,t=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,i=r?Symbol.for("react.profiler"):60114,h=r?Symbol.for("react.provider"):60109,g=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.async_mode"):60111,x=r?Symbol.for("react.concurrent_mode"):60111,y=r?Symbol.for("react.forward_ref"):60112,b=r?Symbol.for("react.suspense"):60113,P=r?Symbol.for("react.suspense_list"):60120,F=r?Symbol.for("react.memo"):60115,H=r?Symbol.for("react.lazy"):60116,N=r?Symbol.for("react.block"):60121,B=r?Symbol.for("react.fundamental"):60117,U=r?Symbol.for("react.responder"):60118,z=r?Symbol.for("react.scope"):60119;function E(d){return typeof d=="string"||typeof d=="function"||d===t||d===x||d===i||d===a||d===b||d===P||typeof d=="object"&&d!==null&&(d.$$typeof===H||d.$$typeof===F||d.$$typeof===h||d.$$typeof===g||d.$$typeof===y||d.$$typeof===B||d.$$typeof===U||d.$$typeof===z||d.$$typeof===N)}function Z(d){if(typeof d=="object"&&d!==null){var ue=d.$$typeof;switch(ue){case l:var xe=d.type;switch(xe){case p:case x:case t:case i:case a:case b:return xe;default:var me=xe&&xe.$$typeof;switch(me){case g:case y:case H:case F:case h:return me;default:return ue}}case o:return ue}}}var c=p,J=x,ne=g,K=h,se=l,ve=y,he=t,fe=H,ee=F,Q=o,de=i,_=a,I=b,M=!1;function oe(d){return M||(M=!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.")),s(d)||Z(d)===p}function s(d){return Z(d)===x}function f(d){return Z(d)===g}function C(d){return Z(d)===h}function j(d){return typeof d=="object"&&d!==null&&d.$$typeof===l}function T(d){return Z(d)===y}function D(d){return Z(d)===t}function S(d){return Z(d)===H}function O(d){return Z(d)===F}function R(d){return Z(d)===o}function A(d){return Z(d)===i}function k(d){return Z(d)===a}function ie(d){return Z(d)===b}Y.AsyncMode=c,Y.ConcurrentMode=J,Y.ContextConsumer=ne,Y.ContextProvider=K,Y.Element=se,Y.ForwardRef=ve,Y.Fragment=he,Y.Lazy=fe,Y.Memo=ee,Y.Portal=Q,Y.Profiler=de,Y.StrictMode=_,Y.Suspense=I,Y.isAsyncMode=oe,Y.isConcurrentMode=s,Y.isContextConsumer=f,Y.isContextProvider=C,Y.isElement=j,Y.isForwardRef=T,Y.isFragment=D,Y.isLazy=S,Y.isMemo=O,Y.isPortal=R,Y.isProfiler=A,Y.isStrictMode=k,Y.isSuspense=ie,Y.isValidElementType=E,Y.typeOf=Z}()),Y}var ar;function sr(){return ar||(ar=1,process.env.NODE_ENV==="production"?Re.exports=Br():Re.exports=Zr()),Re.exports}/*
46
45
  object-assign
47
46
  (c) Sindre Sorhus
48
47
  @license MIT
49
- */var ke,er;function kr(){if(er)return ke;er=1;var r=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function t(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function a(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var d={},y=0;y<10;y++)d["_"+String.fromCharCode(y)]=y;var h=Object.getOwnPropertyNames(d).map(function(m){return d[m]});if(h.join("")!=="0123456789")return!1;var w={};return"abcdefghijklmnopqrst".split("").forEach(function(m){w[m]=m}),Object.keys(Object.assign({},w)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ke=a()?Object.assign:function(o,d){for(var y,h=t(o),w,m=1;m<arguments.length;m++){y=Object(arguments[m]);for(var C in y)l.call(y,C)&&(h[C]=y[C]);if(r){w=r(y);for(var A=0;A<w.length;A++)i.call(y,w[A])&&(h[w[A]]=y[w[A]])}}return h},ke}var Re,rr;function Ne(){if(rr)return Re;rr=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Re=r,Re}var Le,tr;function nr(){return tr||(tr=1,Le=Function.call.bind(Object.prototype.hasOwnProperty)),Le}var Me,or;function Rr(){if(or)return Me;or=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var l=Ne(),i={},t=nr();r=function(o){var d="Warning: "+o;typeof console<"u"&&console.error(d);try{throw new Error(d)}catch{}}}function a(o,d,y,h,w){if(process.env.NODE_ENV!=="production"){for(var m in o)if(t(o,m)){var C;try{if(typeof o[m]!="function"){var A=Error((h||"React class")+": "+y+" type `"+m+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[m]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw A.name="Invariant Violation",A}C=o[m](d,m,h,y,null,l)}catch(Z){C=Z}if(C&&!(C instanceof Error)&&r((h||"React class")+": type specification of "+y+" `"+m+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof C+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),C instanceof Error&&!(C.message in i)){i[C.message]=!0;var W=w?w():"";r("Failed "+y+" type: "+C.message+(W??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(i={})},Me=a,Me}var Ae,ir;function Nr(){if(ir)return Ae;ir=1;var r=Qe(),l=kr(),i=Ne(),t=nr(),a=Rr(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(y){var h="Warning: "+y;typeof console<"u"&&console.error(h);try{throw new Error(h)}catch{}});function d(){return null}return Ae=function(y,h){var w=typeof Symbol=="function"&&Symbol.iterator,m="@@iterator";function C(s){var u=s&&(w&&s[w]||s[m]);if(typeof u=="function")return u}var A="<<anonymous>>",W={array:F("array"),bigint:F("bigint"),bool:F("boolean"),func:F("function"),number:F("number"),object:F("object"),string:F("string"),symbol:F("symbol"),any:te(),arrayOf:E,element:q(),elementType:c(),instanceOf:V,node:le(),objectOf:U,oneOf:J,oneOfType:ne,shape:ae,exact:se};function Z(s,u){return s===u?s!==0||1/s===1/u:s!==s&&u!==u}function P(s,u){this.message=s,this.data=u&&typeof u=="object"?u:{},this.stack=""}P.prototype=Error.prototype;function D(s){if(process.env.NODE_ENV!=="production")var u={},j=0;function b(k,T,O,R,$,N,X){if(R=R||A,N=N||O,X!==i){if(h){var f=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 f.name="Invariant Violation",f}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var oe=R+":"+O;!u[oe]&&j<3&&(o("You are manually calling a React.PropTypes validation function for the `"+N+"` prop on `"+R+"`. 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."),u[oe]=!0,j++)}}return T[O]==null?k?T[O]===null?new P("The "+$+" `"+N+"` is marked as required "+("in `"+R+"`, but its value is `null`.")):new P("The "+$+" `"+N+"` is marked as required in "+("`"+R+"`, but its value is `undefined`.")):null:s(T,O,R,$,N)}var x=b.bind(null,!1);return x.isRequired=b.bind(null,!0),x}function F(s){function u(j,b,x,k,T,O){var R=j[b],$=_(R);if($!==s){var N=L(R);return new P("Invalid "+k+" `"+T+"` of type "+("`"+N+"` supplied to `"+x+"`, expected ")+("`"+s+"`."),{expectedType:s})}return null}return D(u)}function te(){return D(d)}function E(s){function u(j,b,x,k,T){if(typeof s!="function")return new P("Property `"+T+"` of component `"+x+"` has invalid PropType notation inside arrayOf.");var O=j[b];if(!Array.isArray(O)){var R=_(O);return new P("Invalid "+k+" `"+T+"` of type "+("`"+R+"` supplied to `"+x+"`, expected an array."))}for(var $=0;$<O.length;$++){var N=s(O,$,x,k,T+"["+$+"]",i);if(N instanceof Error)return N}return null}return D(u)}function q(){function s(u,j,b,x,k){var T=u[j];if(!y(T)){var O=_(T);return new P("Invalid "+x+" `"+k+"` of type "+("`"+O+"` supplied to `"+b+"`, expected a single ReactElement."))}return null}return D(s)}function c(){function s(u,j,b,x,k){var T=u[j];if(!r.isValidElementType(T)){var O=_(T);return new P("Invalid "+x+" `"+k+"` of type "+("`"+O+"` supplied to `"+b+"`, expected a single ReactElement type."))}return null}return D(s)}function V(s){function u(j,b,x,k,T){if(!(j[b]instanceof s)){var O=s.name||A,R=H(j[b]);return new P("Invalid "+k+" `"+T+"` of type "+("`"+R+"` supplied to `"+x+"`, expected ")+("instance of `"+O+"`."))}return null}return D(u)}function J(s){if(!Array.isArray(s))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("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])."):o("Invalid argument supplied to oneOf, expected an array.")),d;function u(j,b,x,k,T){for(var O=j[b],R=0;R<s.length;R++)if(Z(O,s[R]))return null;var $=JSON.stringify(s,function(X,f){var oe=L(f);return oe==="symbol"?String(f):f});return new P("Invalid "+k+" `"+T+"` of value `"+String(O)+"` "+("supplied to `"+x+"`, expected one of "+$+"."))}return D(u)}function U(s){function u(j,b,x,k,T){if(typeof s!="function")return new P("Property `"+T+"` of component `"+x+"` has invalid PropType notation inside objectOf.");var O=j[b],R=_(O);if(R!=="object")return new P("Invalid "+k+" `"+T+"` of type "+("`"+R+"` supplied to `"+x+"`, expected an object."));for(var $ in O)if(t(O,$)){var N=s(O,$,x,k,T+"."+$,i);if(N instanceof Error)return N}return null}return D(u)}function ne(s){if(!Array.isArray(s))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),d;for(var u=0;u<s.length;u++){var j=s[u];if(typeof j!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+M(j)+" at index "+u+"."),d}function b(x,k,T,O,R){for(var $=[],N=0;N<s.length;N++){var X=s[N],f=X(x,k,T,O,R,i);if(f==null)return null;f.data&&t(f.data,"expectedType")&&$.push(f.data.expectedType)}var oe=$.length>0?", expected one of type ["+$.join(", ")+"]":"";return new P("Invalid "+O+" `"+R+"` supplied to "+("`"+T+"`"+oe+"."))}return D(b)}function le(){function s(u,j,b,x,k){return ee(u[j])?null:new P("Invalid "+x+" `"+k+"` supplied to "+("`"+b+"`, expected a ReactNode."))}return D(s)}function ie(s,u,j,b,x){return new P((s||"React class")+": "+u+" type `"+j+"."+b+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+x+"`.")}function ae(s){function u(j,b,x,k,T){var O=j[b],R=_(O);if(R!=="object")return new P("Invalid "+k+" `"+T+"` of type `"+R+"` "+("supplied to `"+x+"`, expected `object`."));for(var $ in s){var N=s[$];if(typeof N!="function")return ie(x,k,T,$,L(N));var X=N(O,$,x,k,T+"."+$,i);if(X)return X}return null}return D(u)}function se(s){function u(j,b,x,k,T){var O=j[b],R=_(O);if(R!=="object")return new P("Invalid "+k+" `"+T+"` of type `"+R+"` "+("supplied to `"+x+"`, expected `object`."));var $=l({},j[b],s);for(var N in $){var X=s[N];if(t(s,N)&&typeof X!="function")return ie(x,k,T,N,L(X));if(!X)return new P("Invalid "+k+" `"+T+"` key `"+N+"` supplied to `"+x+"`.\nBad object: "+JSON.stringify(j[b],null," ")+`
50
- Valid keys: `+JSON.stringify(Object.keys(s),null," "));var f=X(O,N,x,k,T+"."+N,i);if(f)return f}return null}return D(u)}function ee(s){switch(typeof s){case"number":case"string":case"undefined":return!0;case"boolean":return!s;case"object":if(Array.isArray(s))return s.every(ee);if(s===null||y(s))return!0;var u=C(s);if(u){var j=u.call(s),b;if(u!==s.entries){for(;!(b=j.next()).done;)if(!ee(b.value))return!1}else for(;!(b=j.next()).done;){var x=b.value;if(x&&!ee(x[1]))return!1}}else return!1;return!0;default:return!1}}function ue(s,u){return s==="symbol"?!0:u?u["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&u instanceof Symbol:!1}function _(s){var u=typeof s;return Array.isArray(s)?"array":s instanceof RegExp?"object":ue(u,s)?"symbol":u}function L(s){if(typeof s>"u"||s===null)return""+s;var u=_(s);if(u==="object"){if(s instanceof Date)return"date";if(s instanceof RegExp)return"regexp"}return u}function M(s){var u=L(s);switch(u){case"array":case"object":return"an "+u;case"boolean":case"date":case"regexp":return"a "+u;default:return u}}function H(s){return!s.constructor||!s.constructor.name?A:s.constructor.name}return W.checkPropTypes=a,W.resetWarningCache=a.resetWarningCache,W.PropTypes=W,W},Ae}var $e,ar;function Lr(){if(ar)return $e;ar=1;var r=Ne();function l(){}function i(){}return i.resetWarningCache=l,$e=function(){function t(d,y,h,w,m,C){if(C!==r){var A=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 A.name="Invariant Violation",A}}t.isRequired=t;function a(){return t}var o={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:a,element:t,elementType:t,instanceOf:a,node:t,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:i,resetWarningCache:l};return o.PropTypes=o,o},$e}var sr;function Mr(){if(sr)return Se.exports;if(sr=1,process.env.NODE_ENV!=="production"){var r=Qe(),l=!0;Se.exports=Nr()(r.isElement,l)}else Se.exports=Lr()();return Se.exports}var Ar=Mr();const K=dr(Ar);function Ie(){return Ie=Object.assign||function(r){for(var l=1;l<arguments.length;l++){var i=arguments[l];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(r[t]=i[t])}return r},Ie.apply(this,arguments)}function $r(r,l){if(r==null)return{};var i=Ir(r,l),t,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(a=0;a<o.length;a++)t=o[a],!(l.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}function Ir(r,l){if(r==null)return{};var i={},t=Object.keys(r),a,o;for(o=0;o<t.length;o++)a=t[o],!(l.indexOf(a)>=0)&&(i[a]=r[a]);return i}var Ye=g.forwardRef(function(r,l){var i=r.color,t=i===void 0?"currentColor":i,a=r.size,o=a===void 0?24:a,d=$r(r,["color","size"]);return g.createElement("svg",Ie({ref:l,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},d),g.createElement("polyline",{points:"20 6 9 17 4 12"}))});Ye.propTypes={color:K.string,size:K.oneOfType([K.string,K.number])},Ye.displayName="Check";function ze(){return ze=Object.assign||function(r){for(var l=1;l<arguments.length;l++){var i=arguments[l];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(r[t]=i[t])}return r},ze.apply(this,arguments)}function Yr(r,l){if(r==null)return{};var i=zr(r,l),t,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(a=0;a<o.length;a++)t=o[a],!(l.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}function zr(r,l){if(r==null)return{};var i={},t=Object.keys(r),a,o;for(o=0;o<t.length;o++)a=t[o],!(l.indexOf(a)>=0)&&(i[a]=r[a]);return i}var We=g.forwardRef(function(r,l){var i=r.color,t=i===void 0?"currentColor":i,a=r.size,o=a===void 0?24:a,d=Yr(r,["color","size"]);return g.createElement("svg",ze({ref:l,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},d),g.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),g.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))});We.propTypes={color:K.string,size:K.oneOfType([K.string,K.number])},We.displayName="Copy";function De(){return De=Object.assign||function(r){for(var l=1;l<arguments.length;l++){var i=arguments[l];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(r[t]=i[t])}return r},De.apply(this,arguments)}function Wr(r,l){if(r==null)return{};var i=Dr(r,l),t,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(a=0;a<o.length;a++)t=o[a],!(l.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}function Dr(r,l){if(r==null)return{};var i={},t=Object.keys(r),a,o;for(o=0;o<t.length;o++)a=t[o],!(l.indexOf(a)>=0)&&(i[a]=r[a]);return i}var qe=g.forwardRef(function(r,l){var i=r.color,t=i===void 0?"currentColor":i,a=r.size,o=a===void 0?24:a,d=Wr(r,["color","size"]);return g.createElement("svg",De({ref:l,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},d),g.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),g.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});qe.propTypes={color:K.string,size:K.oneOfType([K.string,K.number])},qe.displayName="Edit";function Ve(){return Ve=Object.assign||function(r){for(var l=1;l<arguments.length;l++){var i=arguments[l];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(r[t]=i[t])}return r},Ve.apply(this,arguments)}function qr(r,l){if(r==null)return{};var i=Vr(r,l),t,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(a=0;a<o.length;a++)t=o[a],!(l.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}function Vr(r,l){if(r==null)return{};var i={},t=Object.keys(r),a,o;for(o=0;o<t.length;o++)a=t[o],!(l.indexOf(a)>=0)&&(i[a]=r[a]);return i}var Fe=g.forwardRef(function(r,l){var i=r.color,t=i===void 0?"currentColor":i,a=r.size,o=a===void 0?24:a,d=qr(r,["color","size"]);return g.createElement("svg",Ve({ref:l,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},d),g.createElement("polyline",{points:"3 6 5 6 21 6"}),g.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"}))});Fe.propTypes={color:K.string,size:K.oneOfType([K.string,K.number])},Fe.displayName="Trash";const Fr=({user:r,messages:l,updateMessages:i,onMessageSent:t,onEditMessage:a,onDeleteMessage:o})=>{const d=g.useRef(null),[y,h]=g.useState(!1),[w,m]=g.useState(null),[C,A]=g.useState(null),W=()=>{setTimeout(()=>{d.current&&(d.current.scrollTop=d.current.scrollHeight)},100)},Z=(c,V)=>{if(c.preventDefault(),!d.current)return;const J=d.current.getBoundingClientRect();A({x:c.clientX-J.left,y:c.clientY-J.top,message:V})},P=()=>{A(null)},D=c=>{const V=new Ee({id:new Date().toString(),text:c,user:r,isRightSided:!0,createdDate:new Date().toString()});i([...l,V]),t(V),W()},F=c=>{const V=new Ee({id:new Date().toString(),text:"",attachment:c,attachmentType:ve.Voice,user:r,isRightSided:!0,createdDate:new Date().toString()});i([...l,V]),t(V),W()},te=c=>{const V=URL.createObjectURL(c),J=new Ee({id:new Date().toString(),text:"",attachment:V,attachmentType:ve.File,user:r,isRightSided:!0,createdDate:new Date().toString()});i([...l,J]),t(J),W()};return{handleDeleteConfirmation:()=>{w&&(o(w),m(null)),h(!1)},handleCloseContextMenu:P,contextMenuItems:[{name:"Edit",icon:n.jsx(qe,{className:"text-gray-600"}),onlyCurrentUserMessage:!0,onClick:c=>{console.log("Edit clicked"),P(),a(c)}},{name:"Delete",icon:n.jsx(Fe,{className:"text-red-600"}),onlyCurrentUserMessage:!0,onClick:c=>{m(c),h(!0),P()}},{name:"Select",icon:n.jsx(Ye,{className:"text-green-600"}),onClick:()=>{console.log("Select clicked"),P()}},{name:"Copy",icon:n.jsx(We,{className:"text-blue-600"}),onClick:()=>{console.log("Copy clicked"),P()}}],handleSendFile:te,handleSendVoice:F,handleSendMessage:D,handleContextMenu:Z,isModalOpen:y,contextMenu:C,chatRef:d,setIsModalOpen:h}},Ur=({width:r="400px",height:l="600px",className:i,style:t,messages:a,user:o,updateMessages:d,onMessageSent:y,onDeleteMessage:h,onEditMessage:w,dynamicSymbolAssignments:m})=>{var V,J;const{handleDeleteConfirmation:C,handleCloseContextMenu:A,handleSendFile:W,handleSendVoice:Z,handleSendMessage:P,handleContextMenu:D,contextMenuItems:F,isModalOpen:te,contextMenu:E,chatRef:q,setIsModalOpen:c}=Fr({user:o,messages:a,updateMessages:d,onMessageSent:y,onEditMessage:w,onDeleteMessage:h});return n.jsxs("div",{className:`flex flex-col !bg-cover ${i}`,style:{width:r,height:l,background:"url(./chat-bg-1.jpg)",...t},onClick:A,children:[n.jsx("div",{ref:q,className:`flex flex-col gap-2 flex-1 p-3 pb-16 ${E?"overflow-hidden pr-[22px]":"overflow-y-scroll"}`,children:n.jsx(ce.AnimatePresence,{children:a.map((U,ne)=>{var ae,se,ee;const le=U!=null&&U.attachment?n.jsx(Er,{attachment:U.attachment,attachmentType:U==null?void 0:U.attachmentType},ne):null;if(U.isRightSided)return n.jsx(Or,{media:le,handleContextMenu:D,message:U},ne);const ie=((se=(ae=a[ne-1])==null?void 0:ae.user)==null?void 0:se.id)!==((ee=U==null?void 0:U.user)==null?void 0:ee.id);return n.jsx(Tr,{showUserProfile:ie,media:le,handleContextMenu:D,message:U},ne)})})}),n.jsx(yr,{isOpen:te,onClose:()=>c(!1),onConfirm:C,header:"Confirm Delete",question:"Are you sure you want to delete this message?"}),E&&((V=E==null?void 0:E.message)!=null&&V.id)?n.jsx(gr,{items:F,isVisible:!!E,messageId:String(E==null?void 0:E.message.id),isCurrentUserMessage:((J=E==null?void 0:E.message)==null?void 0:J.user.id)===o.id,position:{x:E==null?void 0:E.x,y:E==null?void 0:E.y}}):null,n.jsx(br,{onSendVoice:Z,onSendMessage:P,onFileSend:W,dynamicSymbolAssignments:m})]})};G.AttachmentTypeEnum=ve,G.Chat=Ur,G.MessageEntity=Ee,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})});
48
+ */var Ne,lr;function Jr(){if(lr)return Ne;lr=1;var r=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function t(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function a(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var h={},g=0;g<10;g++)h["_"+String.fromCharCode(g)]=g;var p=Object.getOwnPropertyNames(h).map(function(y){return h[y]});if(p.join("")!=="0123456789")return!1;var x={};return"abcdefghijklmnopqrst".split("").forEach(function(y){x[y]=y}),Object.keys(Object.assign({},x)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Ne=a()?Object.assign:function(i,h){for(var g,p=t(i),x,y=1;y<arguments.length;y++){g=Object(arguments[y]);for(var b in g)l.call(g,b)&&(p[b]=g[b]);if(r){x=r(g);for(var P=0;P<x.length;P++)o.call(g,x[P])&&(p[x[P]]=g[x[P]])}}return p},Ne}var Ie,ur;function Me(){if(ur)return Ie;ur=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ie=r,Ie}var De,cr;function fr(){return cr||(cr=1,De=Function.call.bind(Object.prototype.hasOwnProperty)),De}var $e,dr;function Hr(){if(dr)return $e;dr=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var l=Me(),o={},t=fr();r=function(i){var h="Warning: "+i;typeof console<"u"&&console.error(h);try{throw new Error(h)}catch{}}}function a(i,h,g,p,x){if(process.env.NODE_ENV!=="production"){for(var y in i)if(t(i,y)){var b;try{if(typeof i[y]!="function"){var P=Error((p||"React class")+": "+g+" type `"+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw P.name="Invariant Violation",P}b=i[y](h,y,p,g,null,l)}catch(H){b=H}if(b&&!(b instanceof Error)&&r((p||"React class")+": type specification of "+g+" `"+y+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof b+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),b instanceof Error&&!(b.message in o)){o[b.message]=!0;var F=x?x():"";r("Failed "+g+" type: "+b.message+(F??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(o={})},$e=a,$e}var Ae,pr;function Kr(){if(pr)return Ae;pr=1;var r=sr(),l=Jr(),o=Me(),t=fr(),a=Hr(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(g){var p="Warning: "+g;typeof console<"u"&&console.error(p);try{throw new Error(p)}catch{}});function h(){return null}return Ae=function(g,p){var x=typeof Symbol=="function"&&Symbol.iterator,y="@@iterator";function b(s){var f=s&&(x&&s[x]||s[y]);if(typeof f=="function")return f}var P="<<anonymous>>",F={array:U("array"),bigint:U("bigint"),bool:U("boolean"),func:U("function"),number:U("number"),object:U("object"),string:U("string"),symbol:U("symbol"),any:z(),arrayOf:E,element:Z(),elementType:c(),instanceOf:J,node:ve(),objectOf:K,oneOf:ne,oneOfType:se,shape:fe,exact:ee};function H(s,f){return s===f?s!==0||1/s===1/f:s!==s&&f!==f}function N(s,f){this.message=s,this.data=f&&typeof f=="object"?f:{},this.stack=""}N.prototype=Error.prototype;function B(s){if(process.env.NODE_ENV!=="production")var f={},C=0;function j(D,S,O,R,A,k,ie){if(R=R||P,k=k||O,ie!==o){if(p){var d=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 d.name="Invariant Violation",d}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ue=R+":"+O;!f[ue]&&C<3&&(i("You are manually calling a React.PropTypes validation function for the `"+k+"` prop on `"+R+"`. 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."),f[ue]=!0,C++)}}return S[O]==null?D?S[O]===null?new N("The "+A+" `"+k+"` is marked as required "+("in `"+R+"`, but its value is `null`.")):new N("The "+A+" `"+k+"` is marked as required in "+("`"+R+"`, but its value is `undefined`.")):null:s(S,O,R,A,k)}var T=j.bind(null,!1);return T.isRequired=j.bind(null,!0),T}function U(s){function f(C,j,T,D,S,O){var R=C[j],A=_(R);if(A!==s){var k=I(R);return new N("Invalid "+D+" `"+S+"` of type "+("`"+k+"` supplied to `"+T+"`, expected ")+("`"+s+"`."),{expectedType:s})}return null}return B(f)}function z(){return B(h)}function E(s){function f(C,j,T,D,S){if(typeof s!="function")return new N("Property `"+S+"` of component `"+T+"` has invalid PropType notation inside arrayOf.");var O=C[j];if(!Array.isArray(O)){var R=_(O);return new N("Invalid "+D+" `"+S+"` of type "+("`"+R+"` supplied to `"+T+"`, expected an array."))}for(var A=0;A<O.length;A++){var k=s(O,A,T,D,S+"["+A+"]",o);if(k instanceof Error)return k}return null}return B(f)}function Z(){function s(f,C,j,T,D){var S=f[C];if(!g(S)){var O=_(S);return new N("Invalid "+T+" `"+D+"` of type "+("`"+O+"` supplied to `"+j+"`, expected a single ReactElement."))}return null}return B(s)}function c(){function s(f,C,j,T,D){var S=f[C];if(!r.isValidElementType(S)){var O=_(S);return new N("Invalid "+T+" `"+D+"` of type "+("`"+O+"` supplied to `"+j+"`, expected a single ReactElement type."))}return null}return B(s)}function J(s){function f(C,j,T,D,S){if(!(C[j]instanceof s)){var O=s.name||P,R=oe(C[j]);return new N("Invalid "+D+" `"+S+"` of type "+("`"+R+"` supplied to `"+T+"`, expected ")+("instance of `"+O+"`."))}return null}return B(f)}function ne(s){if(!Array.isArray(s))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.")),h;function f(C,j,T,D,S){for(var O=C[j],R=0;R<s.length;R++)if(H(O,s[R]))return null;var A=JSON.stringify(s,function(ie,d){var ue=I(d);return ue==="symbol"?String(d):d});return new N("Invalid "+D+" `"+S+"` of value `"+String(O)+"` "+("supplied to `"+T+"`, expected one of "+A+"."))}return B(f)}function K(s){function f(C,j,T,D,S){if(typeof s!="function")return new N("Property `"+S+"` of component `"+T+"` has invalid PropType notation inside objectOf.");var O=C[j],R=_(O);if(R!=="object")return new N("Invalid "+D+" `"+S+"` of type "+("`"+R+"` supplied to `"+T+"`, expected an object."));for(var A in O)if(t(O,A)){var k=s(O,A,T,D,S+"."+A,o);if(k instanceof Error)return k}return null}return B(f)}function se(s){if(!Array.isArray(s))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),h;for(var f=0;f<s.length;f++){var C=s[f];if(typeof C!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+M(C)+" at index "+f+"."),h}function j(T,D,S,O,R){for(var A=[],k=0;k<s.length;k++){var ie=s[k],d=ie(T,D,S,O,R,o);if(d==null)return null;d.data&&t(d.data,"expectedType")&&A.push(d.data.expectedType)}var ue=A.length>0?", expected one of type ["+A.join(", ")+"]":"";return new N("Invalid "+O+" `"+R+"` supplied to "+("`"+S+"`"+ue+"."))}return B(j)}function ve(){function s(f,C,j,T,D){return Q(f[C])?null:new N("Invalid "+T+" `"+D+"` supplied to "+("`"+j+"`, expected a ReactNode."))}return B(s)}function he(s,f,C,j,T){return new N((s||"React class")+": "+f+" type `"+C+"."+j+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+T+"`.")}function fe(s){function f(C,j,T,D,S){var O=C[j],R=_(O);if(R!=="object")return new N("Invalid "+D+" `"+S+"` of type `"+R+"` "+("supplied to `"+T+"`, expected `object`."));for(var A in s){var k=s[A];if(typeof k!="function")return he(T,D,S,A,I(k));var ie=k(O,A,T,D,S+"."+A,o);if(ie)return ie}return null}return B(f)}function ee(s){function f(C,j,T,D,S){var O=C[j],R=_(O);if(R!=="object")return new N("Invalid "+D+" `"+S+"` of type `"+R+"` "+("supplied to `"+T+"`, expected `object`."));var A=l({},C[j],s);for(var k in A){var ie=s[k];if(t(s,k)&&typeof ie!="function")return he(T,D,S,k,I(ie));if(!ie)return new N("Invalid "+D+" `"+S+"` key `"+k+"` supplied to `"+T+"`.\nBad object: "+JSON.stringify(C[j],null," ")+`
49
+ Valid keys: `+JSON.stringify(Object.keys(s),null," "));var d=ie(O,k,T,D,S+"."+k,o);if(d)return d}return null}return B(f)}function Q(s){switch(typeof s){case"number":case"string":case"undefined":return!0;case"boolean":return!s;case"object":if(Array.isArray(s))return s.every(Q);if(s===null||g(s))return!0;var f=b(s);if(f){var C=f.call(s),j;if(f!==s.entries){for(;!(j=C.next()).done;)if(!Q(j.value))return!1}else for(;!(j=C.next()).done;){var T=j.value;if(T&&!Q(T[1]))return!1}}else return!1;return!0;default:return!1}}function de(s,f){return s==="symbol"?!0:f?f["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&f instanceof Symbol:!1}function _(s){var f=typeof s;return Array.isArray(s)?"array":s instanceof RegExp?"object":de(f,s)?"symbol":f}function I(s){if(typeof s>"u"||s===null)return""+s;var f=_(s);if(f==="object"){if(s instanceof Date)return"date";if(s instanceof RegExp)return"regexp"}return f}function M(s){var f=I(s);switch(f){case"array":case"object":return"an "+f;case"boolean":case"date":case"regexp":return"a "+f;default:return f}}function oe(s){return!s.constructor||!s.constructor.name?P:s.constructor.name}return F.checkPropTypes=a,F.resetWarningCache=a.resetWarningCache,F.PropTypes=F,F},Ae}var Fe,vr;function Xr(){if(vr)return Fe;vr=1;var r=Me();function l(){}function o(){}return o.resetWarningCache=l,Fe=function(){function t(h,g,p,x,y,b){if(b!==r){var P=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 P.name="Invariant Violation",P}}t.isRequired=t;function a(){return t}var i={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:a,element:t,elementType:t,instanceOf:a,node:t,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:o,resetWarningCache:l};return i.PropTypes=i,i},Fe}var hr;function Gr(){if(hr)return Pe.exports;if(hr=1,process.env.NODE_ENV!=="production"){var r=sr(),l=!0;Pe.exports=Kr()(r.isElement,l)}else Pe.exports=Xr()();return Pe.exports}var Qr=Gr();const te=Rr(Qr);function We(){return We=Object.assign||function(r){for(var l=1;l<arguments.length;l++){var o=arguments[l];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(r[t]=o[t])}return r},We.apply(this,arguments)}function et(r,l){if(r==null)return{};var o=rt(r,l),t,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(a=0;a<i.length;a++)t=i[a],!(l.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(o[t]=r[t])}return o}function rt(r,l){if(r==null)return{};var o={},t=Object.keys(r),a,i;for(i=0;i<t.length;i++)a=t[i],!(l.indexOf(a)>=0)&&(o[a]=r[a]);return o}var Ye=m.forwardRef(function(r,l){var o=r.color,t=o===void 0?"currentColor":o,a=r.size,i=a===void 0?24:a,h=et(r,["color","size"]);return m.createElement("svg",We({ref:l,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h),m.createElement("polyline",{points:"20 6 9 17 4 12"}))});Ye.propTypes={color:te.string,size:te.oneOfType([te.string,te.number])},Ye.displayName="Check";function Ve(){return Ve=Object.assign||function(r){for(var l=1;l<arguments.length;l++){var o=arguments[l];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(r[t]=o[t])}return r},Ve.apply(this,arguments)}function tt(r,l){if(r==null)return{};var o=nt(r,l),t,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(a=0;a<i.length;a++)t=i[a],!(l.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(o[t]=r[t])}return o}function nt(r,l){if(r==null)return{};var o={},t=Object.keys(r),a,i;for(i=0;i<t.length;i++)a=t[i],!(l.indexOf(a)>=0)&&(o[a]=r[a]);return o}var ze=m.forwardRef(function(r,l){var o=r.color,t=o===void 0?"currentColor":o,a=r.size,i=a===void 0?24:a,h=tt(r,["color","size"]);return m.createElement("svg",Ve({ref:l,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h),m.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),m.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))});ze.propTypes={color:te.string,size:te.oneOfType([te.string,te.number])},ze.displayName="Copy";function Ue(){return Ue=Object.assign||function(r){for(var l=1;l<arguments.length;l++){var o=arguments[l];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(r[t]=o[t])}return r},Ue.apply(this,arguments)}function ot(r,l){if(r==null)return{};var o=it(r,l),t,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(a=0;a<i.length;a++)t=i[a],!(l.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(o[t]=r[t])}return o}function it(r,l){if(r==null)return{};var o={},t=Object.keys(r),a,i;for(i=0;i<t.length;i++)a=t[i],!(l.indexOf(a)>=0)&&(o[a]=r[a]);return o}var qe=m.forwardRef(function(r,l){var o=r.color,t=o===void 0?"currentColor":o,a=r.size,i=a===void 0?24:a,h=ot(r,["color","size"]);return m.createElement("svg",Ue({ref:l,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h),m.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),m.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});qe.propTypes={color:te.string,size:te.oneOfType([te.string,te.number])},qe.displayName="Edit";function Be(){return Be=Object.assign||function(r){for(var l=1;l<arguments.length;l++){var o=arguments[l];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(r[t]=o[t])}return r},Be.apply(this,arguments)}function at(r,l){if(r==null)return{};var o=st(r,l),t,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(a=0;a<i.length;a++)t=i[a],!(l.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(o[t]=r[t])}return o}function st(r,l){if(r==null)return{};var o={},t=Object.keys(r),a,i;for(i=0;i<t.length;i++)a=t[i],!(l.indexOf(a)>=0)&&(o[a]=r[a]);return o}var Ze=m.forwardRef(function(r,l){var o=r.color,t=o===void 0?"currentColor":o,a=r.size,i=a===void 0?24:a,h=at(r,["color","size"]);return m.createElement("svg",Be({ref:l,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h),m.createElement("polyline",{points:"3 6 5 6 21 6"}),m.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"}))});Ze.propTypes={color:te.string,size:te.oneOfType([te.string,te.number])},Ze.displayName="Trash";const lt=({user:r,messages:l,updateMessages:o,onMessageSent:t,onEditMessage:a,onDeleteMessage:i})=>{const h=m.useRef(null),[g,p]=m.useState(!1),[x,y]=m.useState(null),[b,P]=m.useState(null),F=()=>{setTimeout(()=>{h.current&&(h.current.scrollTop=h.current.scrollHeight)},100)},H=(c,J)=>{if(c.preventDefault(),!h.current)return;const ne=h.current.getBoundingClientRect();P({x:c.clientX-ne.left,y:c.clientY-ne.top,message:J})},N=()=>{P(null)},B=c=>{const J=new Oe({id:new Date().toString(),text:c,user:r,isRightSided:!0,createdDate:new Date().toString()});o([...l,J]),t(J),F()},U=c=>{const J=new Oe({id:new Date().toString(),text:"",attachment:c,attachmentType:ge.Voice,user:r,isRightSided:!0,createdDate:new Date().toString()});o([...l,J]),t(J),F()},z=c=>{const J=URL.createObjectURL(c),ne=new Oe({id:new Date().toString(),text:"",attachment:J,attachmentType:ge.File,user:r,isRightSided:!0,createdDate:new Date().toString()});o([...l,ne]),t(ne),F()};return{handleDeleteConfirmation:()=>{x&&(i(x),y(null)),p(!1)},handleCloseContextMenu:N,contextMenuItems:[{name:"Edit",icon:n.jsx(qe,{className:"text-gray-600"}),onlyCurrentUserMessage:!0,onClick:c=>{console.log("Edit clicked"),N(),a(c)}},{name:"Delete",icon:n.jsx(Ze,{className:"text-red-600"}),onlyCurrentUserMessage:!0,onClick:c=>{y(c),p(!0),N()}},{name:"Select",icon:n.jsx(Ye,{className:"text-green-600"}),onClick:()=>{console.log("Select clicked"),N()}},{name:"Copy",icon:n.jsx(ze,{className:"text-blue-600"}),onClick:()=>{console.log("Copy clicked"),N()}}],handleSendFile:z,handleSendVoice:U,handleSendMessage:B,handleContextMenu:H,isModalOpen:g,contextMenu:b,chatRef:h,setIsModalOpen:p}},ut=({width:r="400px",height:l="600px",className:o,style:t,messages:a,user:i,updateMessages:h,onMessageSent:g,onDeleteMessage:p,onEditMessage:x,dynamicSymbolAssignments:y})=>{var J,ne;const{handleDeleteConfirmation:b,handleCloseContextMenu:P,handleSendFile:F,handleSendVoice:H,handleSendMessage:N,handleContextMenu:B,contextMenuItems:U,isModalOpen:z,contextMenu:E,chatRef:Z,setIsModalOpen:c}=lt({user:i,messages:a,updateMessages:h,onMessageSent:g,onEditMessage:x,onDeleteMessage:p});return n.jsxs("div",{className:`flex flex-col !bg-cover ${o}`,style:{width:r,height:l,background:"url(./chat-bg-1.jpg)",...t},onClick:P,children:[n.jsx("div",{ref:Z,className:`flex flex-col gap-2 flex-1 p-3 pb-16 ${E?"overflow-hidden pr-[22px]":"overflow-y-scroll"}`,children:n.jsx(pe.AnimatePresence,{children:a.map((K,se)=>{var fe,ee,Q;const ve=K!=null&&K.attachment?n.jsx(Vr,{attachment:K.attachment,attachmentType:K==null?void 0:K.attachmentType},se):null;if(K.isRightSided)return n.jsx(qr,{media:ve,handleContextMenu:B,message:K},se);const he=((ee=(fe=a[se-1])==null?void 0:fe.user)==null?void 0:ee.id)!==((Q=K==null?void 0:K.user)==null?void 0:Q.id);return n.jsx(zr,{showUserProfile:he,media:ve,handleContextMenu:B,message:K},se)})})}),n.jsx(Ir,{isOpen:z,onClose:()=>c(!1),onConfirm:b,header:"Confirm Delete",question:"Are you sure you want to delete this message?"}),E&&((J=E==null?void 0:E.message)!=null&&J.id)?n.jsx(Mr,{items:U,isVisible:!!E,messageId:String(E==null?void 0:E.message.id),isCurrentUserMessage:((ne=E==null?void 0:E.message)==null?void 0:ne.user.id)===i.id,position:{x:E==null?void 0:E.x,y:E==null?void 0:E.y}}):null,n.jsx(Ar,{onSendVoice:H,onSendMessage:N,onFileSend:F,dynamicSymbolAssignments:y})]})};re.AttachmentTypeEnum=ge,re.Chat=ut,re.MessageEntity=Oe,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-pro-messenger",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Telegram-style chat component for React",
5
5
  "type": "module",
6
6
  "main": "dist/index.umd.js",
@@ -17,8 +17,8 @@
17
17
  "lint": "eslint ."
18
18
  },
19
19
  "peerDependencies": {
20
- "react": "^18.0.0 || ^19.0.0",
21
- "react-dom": "^18.0.0 || ^19.0.0",
20
+ "react": "^18.2.0",
21
+ "react-dom": "^18.2.0",
22
22
  "framer-motion": "^12.0.0"
23
23
  },
24
24
  "devDependencies": {
@@ -31,7 +31,7 @@
31
31
  "vite": "^6.1.0",
32
32
  "jest": "^29.7.0",
33
33
  "@types/jest": "^29.5.12",
34
- "react-test-renderer": "^19.0.0"
34
+ "react-test-renderer": "^18.2.0"
35
35
  },
36
36
  "keywords": [
37
37
  "react",