movius-chats 1.3.10 → 1.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{Platform as r,PanResponder as o,View as i,Pressable as l,Text as a,Animated as u,Easing as s,useWindowDimensions as c,Image as d,Linking as f,ScrollView as y,TextInput as p,Modal as h,FlatList as v,Keyboard as m,KeyboardAvoidingView as g}from"react-native";import b from"twrnc";import w,{useState as x,createContext as S,useContext as C,useRef as P,useEffect as I,useMemo as O,useCallback as A}from"react";import k,{Path as M,Svg as j,G as E,Circle as T,Ellipse as R,Line as _}from"react-native-svg";import z,{useSharedValue as V,withSpring as N,useAnimatedStyle as $}from"react-native-reanimated";import F from"react-native-sound";import L from"react-native-video";function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function B(e,t,n){return t=U(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,G()?Reflect.construct(t,n||[],U(e).constructor):t.apply(e,n))}function W(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ee(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function H(e,t,n){return(t=ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U(e){return U=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},U(e)}function G(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(G=function(){return!!e})()}function Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach((function(t){H(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Z(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Q(e,t){return Q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Q(e,t)}function J(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,l,a=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(s)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ee(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}var te=function(t){var n=t.style,r=t.color;return e(k,{style:n,viewBox:"0 0 48 48",children:e(M,{fill:r,fillRule:"evenodd",stroke:r,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",d:"M8 9.115c0-1.82 2.235-2.694 3.47-1.356l29.432 31.884c1.182 1.282.273 3.357-1.47 3.357H10a2 2 0 0 1-2-2z",clipRule:"evenodd"})})},ne=["children"],re=S(void 0),oe=function(t){var n=t.children,r=Z(t,ne),o=J(x(null),2),i=o[0],l=o[1],a=J(x(!1),2),u=a[0],s=a[1];return e(re.Provider,{value:X(X({},r),{},{mediaViewerGallery:i,setMediaViewerGallery:function(e,t){l({items:e,initialIndex:t});var n=e[t];s("video"===(null==n?void 0:n.kind))},clearMediaViewerGallery:function(){l(null),s(!1)},isVideoPlaying:u,setIsVideoPlaying:s}),children:n})},ie=function(){var e=C(re);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e};function le(e){if(e.mediaItems&&e.mediaItems.length>0)return e.mediaItems;var t=[];return e.image&&t.push({uri:e.image,kind:"image"}),e.video&&t.push({uri:e.video,kind:"video"}),t}var ae="ios"===r.OS?"h-6 w-6":"w-6 h-6";function ue(e,t){return t?[e,{fontFamily:t}]:e}var se,ce,de,fe,ye,pe,he,ve,me,ge,be,we,xe,Se,Ce,Pe=function(t){var n=t.style,r=t.color;return e(k,{style:n,viewBox:"0 0 15 15",children:e(M,{fill:r,fillRule:"evenodd",d:"M6.05 2.75a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0zm4 0a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0z",clipRule:"evenodd"})})},Ie=function(t){var n=t.style,r=t.color;return e(k,{style:n,viewBox:"0 0 24 24",children:e(M,{fill:r,d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})},Oe=S(void 0),Ae=function(t){var n=t.children,r=J(x(null),2),o=r[0],i=r[1];return e(Oe.Provider,{value:{currentlyPlayingId:o,setCurrentlyPlayingId:i},children:n})},ke={code:"function AudioPlayerTsx1(){const{knobPosition}=this.__closure;return{transform:[{translateX:knobPosition.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx",sourceMap:'{"version":3,"names":["AudioPlayerTsx1","knobPosition","__closure","transform","translateX","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx"],"mappings":"AAiH2C,SAAAA,eAAMA,CAAA,QAAAC,YAAA,OAAAC,SAAA,CACzC,MAAO,CACHC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAClD,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},Me=function(n){var r,u,s,c,d,f,y,p=n.audioUrl,h=n.audioId,v=n.isVideoPlaying,m=ie(),g=m.theme,w=m.CustomPlayIcon,S=m.CustomPauseIcon,O=function(){var e=C(Oe);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),A=O.currentlyPlayingId,k=O.setCurrentlyPlayingId,M=J(x(null),2),j=M[0],E=M[1],T=J(x(!1),2),R=T[0],_=T[1],L=J(x(0),2),D=L[0],B=L[1],W=J(x(0),2),q=W[0],H=W[1],U=J(x(!1),2),G=U[0],Y=U[1],Z=P(null),Q=P(0),ee=P(0),te=P(0),ne=V(0);I((function(){var e=!0,t=new F(p,"",(function(n){!n&&e&&H(t.getDuration())}));return E(t),function(){e=!1,t&&(t.pause(),t.release())}}),[p]),I((function(){A&&A!==h&&R&&j&&(j.pause(),_(!1),B(0),ne.value=0)}),[A,h,R,j]),I((function(){var e;return R&&j&&!G&&(e=setInterval((function(){j.getCurrentTime((function(e){if("number"==typeof e&&!isNaN(e)&&(B(e),Q.current>0&&q>0)){var t=e/q*Q.current;isNaN(t)||(ne.value=N(t,{damping:15,stiffness:100}))}}))}),100)),function(){e&&clearInterval(e)}}),[R,j,G,q]);var re,oe,le,ae,ve,me=o.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){Y(!0),te.current=e.nativeEvent.pageX-ne.value},onPanResponderMove:function(e){if(Q.current>0){var t=e.nativeEvent.pageX-te.current,n=Math.max(0,Math.min(t,Q.current));ne.value=n;var r=n/Q.current*q;isNaN(r)||B(r)}},onPanResponderRelease:function(){if(Y(!1),j&&Q.current>0){var e=ne.value/Q.current*q;isNaN(e)||j.setCurrentTime(e)}},onPanResponderTerminate:function(){Y(!1)}}),ge=$((re=[new global.Error,-2,-27],(oe=function(){return{transform:[{translateX:ne.value}]}}).__closure={knobPosition:ne},oe.__workletHash=1935336866997,oe.__initData=ke,oe.__stackDetails=re,oe));return I((function(){v&&R&&j&&j.pause((function(){_(!1),k(null)}))}),[v]),t(i,{style:b(se||(se=K(["rounded-lg w-56"]))),children:[t(i,{style:b(ce||(ce=K(["flex-row items-center gap-2 px-2 pt-2"]))),children:[e(l,{onPress:function(){j&&(R?j.pause((function(){_(!1),k(null)})):(k(h),j.play((function(e){e&&(_(!1),B(0),ne.value=N(0),k(null))})),_(!0)))},style:[b(de||(de=K(["bg-black/40 rounded-full p-2"]))),null==g||null===(r=g.messageStyle)||void 0===r?void 0:r.audioPlayButtonStyle],children:R?S?e(S,{}):e(Pe,{style:b.style("h-6 w-6"),color:(null==g||null===(u=g.colors)||void 0===u?void 0:u.audioPauseIconColor)||"white"}):w?e(w,{}):e(Ie,{style:b.style("h-6 w-6"),color:(null==g||null===(s=g.colors)||void 0===s?void 0:s.audioPlayIconColor)||"white"})}),t(i,{ref:Z,onLayout:function(e){var t,n=e.nativeEvent.layout.width;Q.current=n,null===(t=Z.current)||void 0===t||t.measure((function(e,t,n,r,o){ee.current=o}))},style:[b(fe||(fe=K(["relative h-1 bg-zinc-400 rounded overflow-visible w-[75%]"]))),null==g||null===(c=g.messageStyle)||void 0===c?void 0:c.progressBarStyle],children:[e(i,{style:[b(ye||(ye=K(["absolute h-full bg-slate-200"]))),{width:"".concat(q>0?D/q*100:0,"%")},null==g||null===(d=g.messageStyle)||void 0===d?void 0:d.activeProgressBarStyle]}),e(z.View,X(X({},me.panHandlers),{},{style:[ge,{position:"absolute",top:-6,width:16,height:16,borderRadius:8,backgroundColor:"white",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:3.84,elevation:5},X({},null==g||null===(f=g.messageStyle)||void 0===f?void 0:f.audioKnobStyle)]}))]})]}),e(i,{style:b(pe||(pe=K(["px-4 py-1"]))),children:e(a,{style:ue([b(he||(he=K(["text-xs text-gray-500"]))),null==g||null===(y=g.messageStyle)||void 0===y?void 0:y.audioDurationStyle],null==g?void 0:g.fontFamily),children:isNaN(D)?"0:00":(le=D,ae=Math.floor(le/60),ve=Math.floor(le%60),"".concat(ae,":").concat(ve<10?"0":"").concat(ve))})})]})},je=w.memo(Me),Ee=function(t){var n=t.style,r=t.spinning,o=void 0!==r&&r,i=P(new u.Value(0)).current;I((function(){o&&u.loop(u.timing(i,{toValue:1,duration:1e3,easing:s.linear,useNativeDriver:!0})).start()}),[o]);var l=i.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e(u.View,{style:o?{transform:[{rotate:l}]}:void 0,children:e(k,{style:n,viewBox:"0 0 1024 1024",children:e(M,{d:"M988 548c-19.9 0-36-16.1-36-36c0-59.4-11.6-117-34.6-171.3a440.5 440.5 0 0 0-94.3-139.9a437.7 437.7 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150s83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3c.1 19.9-16 36-35.9 36",fill:"white"})})})},Te=320,Re=Te,_e=Math.round(176),ze=Te-_e-2,Ve=Math.round(159),Ne=function(r){var o,l=r.uri,u=r.cellStyle,s=r.roundedStyle,c=ie(),d=c.theme,f=c.CustomPlayIcon,y=w.useRef(null),p=J(w.useState(0),2),h=p[0],v=p[1],m=J(w.useState(!0),2),g=m[0],x=m[1],S=J(w.useState(!1),2),C=S[0],P=S[1];return t(i,{style:[u,s],children:[e(L,{source:{uri:l},ref:y,paused:!0,muted:!0,style:[s,{width:"100%",height:"100%"}],resizeMode:"cover",onLoadStart:function(){x(!0),P(!1)},onLoad:function(e){v(e.duration),x(!1)},onError:function(){P(!0),x(!1)}}),g&&e(i,{style:[b(ve||(ve=K(["absolute inset-0 items-center justify-center bg-black/40"]))),s],children:e(Ee,{style:b.style("h-8 w-8"),spinning:!0})}),!g&&!C&&t(n,{children:[e(i,{style:b(me||(me=K(["pointer-events-none absolute inset-0 items-center justify-center"]))),children:f?e(f,{}):e(Ie,{style:b.style("h-10 w-10"),color:(null==d||null===(o=d.colors)||void 0===o?void 0:o.audioPlayIconColor)||"white"})}),e(i,{style:b(ge||(ge=K(["pointer-events-none absolute bottom-1 left-1 bg-black/50 px-1.5 py-0.5 rounded"]))),children:e(a,{style:b(be||(be=K(["text-white text-[10px] font-semibold"]))),children:$e(h)})})]}),C&&e(i,{style:[b(we||(we=K(["absolute inset-0 items-center justify-center bg-red-500/50"]))),s],children:e(a,{style:ue(b(xe||(xe=K(["text-white text-xs"]))),null==d?void 0:d.fontFamily),children:"Video"})})]})};function $e(e){if(!e||Number.isNaN(e))return"0:00";var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n.toString().padStart(2,"0"))}var Fe=function(n){var r=n.items,o=n.onOpenGallery,u=c().width,s=Math.min(240,.72*u);if(0===r.length)return null;var f={borderRadius:6,overflow:"hidden"};if(1===r.length){var y=r[0];return e(l,{onPress:function(){return o(r,0)},style:{width:s,height:320,marginVertical:8},children:"image"===y.kind?e(d,{source:{uri:y.uri},style:{width:"100%",height:"100%",borderRadius:8},resizeMode:"cover"}):e(Ne,{uri:y.uri,cellStyle:{width:s,height:320},roundedStyle:{borderRadius:8}})})}if(2===r.length){var p=(s-2)/2;return e(i,{style:{width:s,height:Re,flexDirection:"row",gap:2,marginVertical:8},children:r.slice(0,2).map((function(t,n){return e(l,{onPress:function(){return o(r,n)},style:{width:p,height:Re},children:"image"===t.kind?e(d,{source:{uri:t.uri},style:[f,{width:"100%",height:"100%"}],resizeMode:"cover"}):e(Ne,{uri:t.uri,cellStyle:{width:p,height:Re},roundedStyle:f})},"".concat(t.uri,"-").concat(n))}))})}if(3===r.length){var h=r[0],v=r[1],m=r[2],g=(s-2)/2;return t(i,{style:{width:s,height:Te,marginVertical:8,gap:2},children:[e(l,{onPress:function(){return o(r,0)},style:{width:s,height:_e},children:"image"===h.kind?e(d,{source:{uri:h.uri},style:[f,{width:"100%",height:"100%"}],resizeMode:"cover"}):e(Ne,{uri:h.uri,cellStyle:{width:s,height:_e},roundedStyle:f})}),t(i,{style:{flexDirection:"row",gap:2,height:ze},children:[e(l,{onPress:function(){return o(r,1)},style:{width:g,height:ze},children:"image"===v.kind?e(d,{source:{uri:v.uri},style:[f,{width:"100%",height:"100%"}],resizeMode:"cover"}):e(Ne,{uri:v.uri,cellStyle:{width:g,height:ze},roundedStyle:f})},"".concat(v.uri,"-1")),e(l,{onPress:function(){return o(r,2)},style:{width:g,height:ze},children:"image"===m.kind?e(d,{source:{uri:m.uri},style:[f,{width:"100%",height:"100%"}],resizeMode:"cover"}):e(Ne,{uri:m.uri,cellStyle:{width:g,height:ze},roundedStyle:f})},"".concat(m.uri,"-2"))]})]})}var w=(s-2)/2,x=r.length-4,S=r.slice(0,4);return e(i,{style:{width:s,height:Te,flexWrap:"wrap",flexDirection:"row",gap:2,marginVertical:8},children:S.map((function(n,u){return t(l,{onPress:function(){return o(r,u)},style:{width:w,height:Ve,position:"relative"},children:["image"===n.kind?e(d,{source:{uri:n.uri},style:[f,{width:"100%",height:"100%"}],resizeMode:"cover"}):e(Ne,{uri:n.uri,cellStyle:{width:w,height:Ve},roundedStyle:f}),3===u&&x>0&&e(i,{style:b(Se||(Se=K(["absolute inset-0 bg-black/55 items-center justify-center"]))),children:t(a,{style:b(Ce||(Ce=K(["text-white text-lg font-bold"]))),children:["+",x]})})]},"".concat(n.uri,"-").concat(u))}))})};function Le(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var De,Be={exports:{}},We={exports:{}},qe={};var He,Ue,Ge,Ye,Xe,Ze,Qe,Je,Ke,et,tt,nt,rt,ot,it,lt={};
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{Platform as r,Image as o,PanResponder as i,View as l,Pressable as a,Text as u,Animated as s,Easing as c,useWindowDimensions as d,Linking as f,ScrollView as y,TextInput as p,Modal as h,FlatList as v,Keyboard as m,KeyboardAvoidingView as g}from"react-native";import b from"twrnc";import w,{useState as x,createContext as S,useContext as C,useRef as P,useEffect as I,useMemo as O,useCallback as A}from"react";import k,{Path as M,Svg as j,G as E,Circle as T,Ellipse as R,Line as _}from"react-native-svg";import z,{useSharedValue as V,withSpring as N,useAnimatedStyle as $}from"react-native-reanimated";import F from"react-native-sound";import L from"react-native-video";function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function B(e,t,n){return t=U(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,G()?Reflect.construct(t,n||[],U(e).constructor):t.apply(e,n))}function W(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ee(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function H(e,t,n){return(t=ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U(e){return U=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},U(e)}function G(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(G=function(){return!!e})()}function Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach((function(t){H(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Z(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function J(e,t){return J=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},J(e,t)}function Q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,l,a=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(s)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ee(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}var te=function(t){var n=t.style,r=t.color;return e(k,{style:n,viewBox:"0 0 48 48",children:e(M,{fill:r,fillRule:"evenodd",stroke:r,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",d:"M8 9.115c0-1.82 2.235-2.694 3.47-1.356l29.432 31.884c1.182 1.282.273 3.357-1.47 3.357H10a2 2 0 0 1-2-2z",clipRule:"evenodd"})})},ne=["children"],re=S(void 0),oe=function(t){var n=t.children,r=Z(t,ne),o=Q(x(null),2),i=o[0],l=o[1],a=Q(x(!1),2),u=a[0],s=a[1];return e(re.Provider,{value:X(X({},r),{},{mediaViewerGallery:i,setMediaViewerGallery:function(e,t){l({items:e,initialIndex:t});var n=e[t];s("video"===(null==n?void 0:n.kind))},clearMediaViewerGallery:function(){l(null),s(!1)},isVideoPlaying:u,setIsVideoPlaying:s}),children:n})},ie=function(){var e=C(re);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e};function le(e){if(e.mediaItems&&e.mediaItems.length>0)return e.mediaItems;var t=[];return e.image&&t.push({uri:e.image,kind:"image"}),e.video&&t.push({uri:e.video,kind:"video"}),t}var ae="ios"===r.OS?"h-6 w-6":"w-6 h-6";function ue(e,t){return t?[e,{fontFamily:t}]:e}var se,ce,de,fe,ye,pe,he,ve=function(t){var n=t.style,r=t.color;return e(k,{style:n,viewBox:"0 0 15 15",children:e(M,{fill:r,fillRule:"evenodd",d:"M6.05 2.75a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0zm4 0a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0z",clipRule:"evenodd"})})},me=function(t){var n=t.style,r=t.color;return e(k,{style:n,viewBox:"0 0 24 24",children:e(M,{fill:r,d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})},ge=S(void 0),be=function(t){var n=t.children,r=Q(x(null),2),o=r[0],i=r[1];return e(ge.Provider,{value:{currentlyPlayingId:o,setCurrentlyPlayingId:i},children:n})};try{var we=require("react-native/Libraries/Image/resolveAssetSource");if("function"!=typeof we){var xe=o.resolveAssetSource.bind(o);Object.keys(we).forEach((function(e){try{we[e]=xe[e]}catch(e){}})),Object.defineProperty(we,"__esModule",{value:!1,configurable:!0}),global.__moviusRAS=xe}}catch(e){}var Se,Ce,Pe,Ie,Oe,Ae,ke,Me,je={code:"function AudioPlayerTsx1(){const{knobPosition}=this.__closure;return{transform:[{translateX:knobPosition.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx",sourceMap:'{"version":3,"names":["AudioPlayerTsx1","knobPosition","__closure","transform","translateX","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx"],"mappings":"AAoJ2C,SAAAA,eAAMA,CAAA,QAAAC,YAAA,OAAAC,SAAA,CACzC,MAAO,CACHC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAClD,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},Ee=function(n){var r,o,s,c,d,f,y,p=n.audioUrl,h=n.audioId,v=n.isVideoPlaying,m=ie(),g=m.theme,w=m.CustomPlayIcon,S=m.CustomPauseIcon,O=function(){var e=C(ge);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),A=O.currentlyPlayingId,k=O.setCurrentlyPlayingId,M=Q(x(null),2),j=M[0],E=M[1],T=Q(x(!1),2),R=T[0],_=T[1],L=Q(x(0),2),D=L[0],B=L[1],W=Q(x(0),2),q=W[0],H=W[1],U=Q(x(!1),2),G=U[0],Y=U[1],Z=P(null),J=P(0),ee=P(0),te=P(0),ne=V(0);I((function(){var e=!0,t=null;try{t=new F(p,"",(function(n){!n&&e&&t&&H(t.getDuration())})),E(t)}catch(e){console.warn("[movius-chats] AudioPlayer: Could not initialize react-native-sound.\nRun `npx expo run:android` (or ios) after a fresh install to apply the resolveAssetSource compatibility patch automatically.")}return function(){e=!1,t&&(t.pause(),t.release())}}),[p]),I((function(){A&&A!==h&&R&&j&&(j.pause(),_(!1),B(0),ne.value=0)}),[A,h,R,j]),I((function(){var e;return R&&j&&!G&&(e=setInterval((function(){j.getCurrentTime((function(e){if("number"==typeof e&&!isNaN(e)&&(B(e),J.current>0&&q>0)){var t=e/q*J.current;isNaN(t)||(ne.value=N(t,{damping:15,stiffness:100}))}}))}),100)),function(){e&&clearInterval(e)}}),[R,j,G,q]);var re,oe,le,ae,be,we=i.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){Y(!0),te.current=e.nativeEvent.pageX-ne.value},onPanResponderMove:function(e){if(J.current>0){var t=e.nativeEvent.pageX-te.current,n=Math.max(0,Math.min(t,J.current));ne.value=n;var r=n/J.current*q;isNaN(r)||B(r)}},onPanResponderRelease:function(){if(Y(!1),j&&J.current>0){var e=ne.value/J.current*q;isNaN(e)||j.setCurrentTime(e)}},onPanResponderTerminate:function(){Y(!1)}}),xe=$((re=[new global.Error,-2,-27],(oe=function(){return{transform:[{translateX:ne.value}]}}).__closure={knobPosition:ne},oe.__workletHash=1935336866997,oe.__initData=je,oe.__stackDetails=re,oe));return I((function(){v&&R&&j&&j.pause((function(){_(!1),k(null)}))}),[v]),t(l,{style:b(se||(se=K(["rounded-lg w-56"]))),children:[t(l,{style:b(ce||(ce=K(["flex-row items-center gap-2 px-2 pt-2"]))),children:[e(a,{onPress:function(){j&&(R?j.pause((function(){_(!1),k(null)})):(k(h),j.play((function(e){e&&(_(!1),B(0),ne.value=N(0),k(null))})),_(!0)))},style:[b(de||(de=K(["bg-black/40 rounded-full p-2"]))),null==g||null===(r=g.messageStyle)||void 0===r?void 0:r.audioPlayButtonStyle],children:R?S?e(S,{}):e(ve,{style:b.style("h-6 w-6"),color:(null==g||null===(o=g.colors)||void 0===o?void 0:o.audioPauseIconColor)||"white"}):w?e(w,{}):e(me,{style:b.style("h-6 w-6"),color:(null==g||null===(s=g.colors)||void 0===s?void 0:s.audioPlayIconColor)||"white"})}),t(l,{ref:Z,onLayout:function(e){var t,n=e.nativeEvent.layout.width;J.current=n,null===(t=Z.current)||void 0===t||t.measure((function(e,t,n,r,o){ee.current=o}))},style:[b(fe||(fe=K(["relative h-1 bg-zinc-400 rounded overflow-visible w-[75%]"]))),null==g||null===(c=g.messageStyle)||void 0===c?void 0:c.progressBarStyle],children:[e(l,{style:[b(ye||(ye=K(["absolute h-full bg-slate-200"]))),{width:"".concat(q>0?D/q*100:0,"%")},null==g||null===(d=g.messageStyle)||void 0===d?void 0:d.activeProgressBarStyle]}),e(z.View,X(X({},we.panHandlers),{},{style:[xe,{position:"absolute",top:-6,width:16,height:16,borderRadius:8,backgroundColor:"white",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:3.84,elevation:5},X({},null==g||null===(f=g.messageStyle)||void 0===f?void 0:f.audioKnobStyle)]}))]})]}),e(l,{style:b(pe||(pe=K(["px-4 py-1"]))),children:e(u,{style:ue([b(he||(he=K(["text-xs text-gray-500"]))),null==g||null===(y=g.messageStyle)||void 0===y?void 0:y.audioDurationStyle],null==g?void 0:g.fontFamily),children:isNaN(D)?"0:00":(le=D,ae=Math.floor(le/60),be=Math.floor(le%60),"".concat(ae,":").concat(be<10?"0":"").concat(be))})})]})},Te=w.memo(Ee),Re=function(t){var n=t.style,r=t.spinning,o=void 0!==r&&r,i=P(new s.Value(0)).current;I((function(){o&&s.loop(s.timing(i,{toValue:1,duration:1e3,easing:c.linear,useNativeDriver:!0})).start()}),[o]);var l=i.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e(s.View,{style:o?{transform:[{rotate:l}]}:void 0,children:e(k,{style:n,viewBox:"0 0 1024 1024",children:e(M,{d:"M988 548c-19.9 0-36-16.1-36-36c0-59.4-11.6-117-34.6-171.3a440.5 440.5 0 0 0-94.3-139.9a437.7 437.7 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150s83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3c.1 19.9-16 36-35.9 36",fill:"white"})})})},_e=320,ze=_e,Ve=Math.round(176),Ne=_e-Ve-2,$e=Math.round(159),Fe=function(r){var o,i=r.uri,a=r.cellStyle,s=r.roundedStyle,c=ie(),d=c.theme,f=c.CustomPlayIcon,y=w.useRef(null),p=Q(w.useState(0),2),h=p[0],v=p[1],m=Q(w.useState(!0),2),g=m[0],x=m[1],S=Q(w.useState(!1),2),C=S[0],P=S[1];return t(l,{style:[a,s],children:[e(L,{source:{uri:i},ref:y,paused:!0,muted:!0,style:[s,{width:"100%",height:"100%"}],resizeMode:"cover",onLoadStart:function(){x(!0),P(!1)},onLoad:function(e){v(e.duration),x(!1)},onError:function(){P(!0),x(!1)}}),g&&e(l,{style:[b(Se||(Se=K(["absolute inset-0 items-center justify-center bg-black/40"]))),s],children:e(Re,{style:b.style("h-8 w-8"),spinning:!0})}),!g&&!C&&t(n,{children:[e(l,{style:b(Ce||(Ce=K(["pointer-events-none absolute inset-0 items-center justify-center"]))),children:f?e(f,{}):e(me,{style:b.style("h-10 w-10"),color:(null==d||null===(o=d.colors)||void 0===o?void 0:o.audioPlayIconColor)||"white"})}),e(l,{style:b(Pe||(Pe=K(["pointer-events-none absolute bottom-1 left-1 bg-black/50 px-1.5 py-0.5 rounded"]))),children:e(u,{style:b(Ie||(Ie=K(["text-white text-[10px] font-semibold"]))),children:Le(h)})})]}),C&&e(l,{style:[b(Oe||(Oe=K(["absolute inset-0 items-center justify-center bg-red-500/50"]))),s],children:e(u,{style:ue(b(Ae||(Ae=K(["text-white text-xs"]))),null==d?void 0:d.fontFamily),children:"Video"})})]})};function Le(e){if(!e||Number.isNaN(e))return"0:00";var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n.toString().padStart(2,"0"))}var De=function(n){var r=n.items,i=n.onOpenGallery,s=d().width,c=Math.min(240,.72*s);if(0===r.length)return null;var f={borderRadius:6,overflow:"hidden"};if(1===r.length){var y=r[0];return e(a,{onPress:function(){return i(r,0)},style:{width:c,height:320,marginVertical:8},children:"image"===y.kind?e(o,{source:{uri:y.uri},style:{width:"100%",height:"100%",borderRadius:8},resizeMode:"cover"}):e(Fe,{uri:y.uri,cellStyle:{width:c,height:320},roundedStyle:{borderRadius:8}})})}if(2===r.length){var p=(c-2)/2;return e(l,{style:{width:c,height:ze,flexDirection:"row",gap:2,marginVertical:8},children:r.slice(0,2).map((function(t,n){return e(a,{onPress:function(){return i(r,n)},style:{width:p,height:ze},children:"image"===t.kind?e(o,{source:{uri:t.uri},style:[f,{width:"100%",height:"100%"}],resizeMode:"cover"}):e(Fe,{uri:t.uri,cellStyle:{width:p,height:ze},roundedStyle:f})},"".concat(t.uri,"-").concat(n))}))})}if(3===r.length){var h=r[0],v=r[1],m=r[2],g=(c-2)/2;return t(l,{style:{width:c,height:_e,marginVertical:8,gap:2},children:[e(a,{onPress:function(){return i(r,0)},style:{width:c,height:Ve},children:"image"===h.kind?e(o,{source:{uri:h.uri},style:[f,{width:"100%",height:"100%"}],resizeMode:"cover"}):e(Fe,{uri:h.uri,cellStyle:{width:c,height:Ve},roundedStyle:f})}),t(l,{style:{flexDirection:"row",gap:2,height:Ne},children:[e(a,{onPress:function(){return i(r,1)},style:{width:g,height:Ne},children:"image"===v.kind?e(o,{source:{uri:v.uri},style:[f,{width:"100%",height:"100%"}],resizeMode:"cover"}):e(Fe,{uri:v.uri,cellStyle:{width:g,height:Ne},roundedStyle:f})},"".concat(v.uri,"-1")),e(a,{onPress:function(){return i(r,2)},style:{width:g,height:Ne},children:"image"===m.kind?e(o,{source:{uri:m.uri},style:[f,{width:"100%",height:"100%"}],resizeMode:"cover"}):e(Fe,{uri:m.uri,cellStyle:{width:g,height:Ne},roundedStyle:f})},"".concat(m.uri,"-2"))]})]})}var w=(c-2)/2,x=r.length-4,S=r.slice(0,4);return e(l,{style:{width:c,height:_e,flexWrap:"wrap",flexDirection:"row",gap:2,marginVertical:8},children:S.map((function(n,s){return t(a,{onPress:function(){return i(r,s)},style:{width:w,height:$e,position:"relative"},children:["image"===n.kind?e(o,{source:{uri:n.uri},style:[f,{width:"100%",height:"100%"}],resizeMode:"cover"}):e(Fe,{uri:n.uri,cellStyle:{width:w,height:$e},roundedStyle:f}),3===s&&x>0&&e(l,{style:b(ke||(ke=K(["absolute inset-0 bg-black/55 items-center justify-center"]))),children:t(u,{style:b(Me||(Me=K(["text-white text-lg font-bold"]))),children:["+",x]})})]},"".concat(n.uri,"-").concat(s))}))})};function Be(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var We,qe={exports:{}},He={exports:{}},Ue={};var Ge,Ye,Xe,Ze,Je,Qe,Ke,et,tt,nt,rt,ot,it,lt,at,ut={};
2
2
  /** @license React v16.13.1
3
3
  * react-is.development.js
4
4
  *
@@ -6,10 +6,10 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{Platform
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
- */function at(){return Ue||(Ue=1,"production"===process.env.NODE_ENV?We.exports=function(){if(De)return qe;De=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case u:case s:case r:case i:case o:case d:return e;default:switch(e=e&&e.$$typeof){case a:case c:case p:case y:case l:return e;default:return f}}case n:return f}}}function w(e){return b(e)===s}return qe.AsyncMode=u,qe.ConcurrentMode=s,qe.ContextConsumer=a,qe.ContextProvider=l,qe.Element=t,qe.ForwardRef=c,qe.Fragment=r,qe.Lazy=p,qe.Memo=y,qe.Portal=n,qe.Profiler=i,qe.StrictMode=o,qe.Suspense=d,qe.isAsyncMode=function(e){return w(e)||b(e)===u},qe.isConcurrentMode=w,qe.isContextConsumer=function(e){return b(e)===a},qe.isContextProvider=function(e){return b(e)===l},qe.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},qe.isForwardRef=function(e){return b(e)===c},qe.isFragment=function(e){return b(e)===r},qe.isLazy=function(e){return b(e)===p},qe.isMemo=function(e){return b(e)===y},qe.isPortal=function(e){return b(e)===n},qe.isProfiler=function(e){return b(e)===i},qe.isStrictMode=function(e){return b(e)===o},qe.isSuspense=function(e){return b(e)===d},qe.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===s||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===y||e.$$typeof===l||e.$$typeof===a||e.$$typeof===c||e.$$typeof===v||e.$$typeof===m||e.$$typeof===g||e.$$typeof===h)},qe.typeOf=b,qe}():We.exports=(He||(He=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var h=e.type;switch(h){case u:case s:case r:case i:case o:case d:return h;default:var v=h&&h.$$typeof;switch(v){case a:case c:case p:case y:case l:return v;default:return f}}case n:return f}}}var w=u,x=s,S=a,C=l,P=t,I=c,O=r,A=p,k=y,M=n,j=i,E=o,T=d,R=!1;function _(e){return b(e)===s}lt.AsyncMode=w,lt.ConcurrentMode=x,lt.ContextConsumer=S,lt.ContextProvider=C,lt.Element=P,lt.ForwardRef=I,lt.Fragment=O,lt.Lazy=A,lt.Memo=k,lt.Portal=M,lt.Profiler=j,lt.StrictMode=E,lt.Suspense=T,lt.isAsyncMode=function(e){return R||(R=!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.")),_(e)||b(e)===u},lt.isConcurrentMode=_,lt.isContextConsumer=function(e){return b(e)===a},lt.isContextProvider=function(e){return b(e)===l},lt.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},lt.isForwardRef=function(e){return b(e)===c},lt.isFragment=function(e){return b(e)===r},lt.isLazy=function(e){return b(e)===p},lt.isMemo=function(e){return b(e)===y},lt.isPortal=function(e){return b(e)===n},lt.isProfiler=function(e){return b(e)===i},lt.isStrictMode=function(e){return b(e)===o},lt.isSuspense=function(e){return b(e)===d},lt.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===s||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===y||e.$$typeof===l||e.$$typeof===a||e.$$typeof===c||e.$$typeof===v||e.$$typeof===m||e.$$typeof===g||e.$$typeof===h)},lt.typeOf=b}()),lt)),We.exports}
9
+ */function st(){return Ye||(Ye=1,"production"===process.env.NODE_ENV?He.exports=function(){if(We)return Ue;We=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case u:case s:case r:case i:case o:case d:return e;default:switch(e=e&&e.$$typeof){case a:case c:case p:case y:case l:return e;default:return f}}case n:return f}}}function w(e){return b(e)===s}return Ue.AsyncMode=u,Ue.ConcurrentMode=s,Ue.ContextConsumer=a,Ue.ContextProvider=l,Ue.Element=t,Ue.ForwardRef=c,Ue.Fragment=r,Ue.Lazy=p,Ue.Memo=y,Ue.Portal=n,Ue.Profiler=i,Ue.StrictMode=o,Ue.Suspense=d,Ue.isAsyncMode=function(e){return w(e)||b(e)===u},Ue.isConcurrentMode=w,Ue.isContextConsumer=function(e){return b(e)===a},Ue.isContextProvider=function(e){return b(e)===l},Ue.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Ue.isForwardRef=function(e){return b(e)===c},Ue.isFragment=function(e){return b(e)===r},Ue.isLazy=function(e){return b(e)===p},Ue.isMemo=function(e){return b(e)===y},Ue.isPortal=function(e){return b(e)===n},Ue.isProfiler=function(e){return b(e)===i},Ue.isStrictMode=function(e){return b(e)===o},Ue.isSuspense=function(e){return b(e)===d},Ue.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===s||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===y||e.$$typeof===l||e.$$typeof===a||e.$$typeof===c||e.$$typeof===v||e.$$typeof===m||e.$$typeof===g||e.$$typeof===h)},Ue.typeOf=b,Ue}():He.exports=(Ge||(Ge=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var h=e.type;switch(h){case u:case s:case r:case i:case o:case d:return h;default:var v=h&&h.$$typeof;switch(v){case a:case c:case p:case y:case l:return v;default:return f}}case n:return f}}}var w=u,x=s,S=a,C=l,P=t,I=c,O=r,A=p,k=y,M=n,j=i,E=o,T=d,R=!1;function _(e){return b(e)===s}ut.AsyncMode=w,ut.ConcurrentMode=x,ut.ContextConsumer=S,ut.ContextProvider=C,ut.Element=P,ut.ForwardRef=I,ut.Fragment=O,ut.Lazy=A,ut.Memo=k,ut.Portal=M,ut.Profiler=j,ut.StrictMode=E,ut.Suspense=T,ut.isAsyncMode=function(e){return R||(R=!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.")),_(e)||b(e)===u},ut.isConcurrentMode=_,ut.isContextConsumer=function(e){return b(e)===a},ut.isContextProvider=function(e){return b(e)===l},ut.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},ut.isForwardRef=function(e){return b(e)===c},ut.isFragment=function(e){return b(e)===r},ut.isLazy=function(e){return b(e)===p},ut.isMemo=function(e){return b(e)===y},ut.isPortal=function(e){return b(e)===n},ut.isProfiler=function(e){return b(e)===i},ut.isStrictMode=function(e){return b(e)===o},ut.isSuspense=function(e){return b(e)===d},ut.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===s||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===y||e.$$typeof===l||e.$$typeof===a||e.$$typeof===c||e.$$typeof===v||e.$$typeof===m||e.$$typeof===g||e.$$typeof===h)},ut.typeOf=b}()),ut)),He.exports}
10
10
  /*
11
11
  object-assign
12
12
  (c) Sindre Sorhus
13
13
  @license MIT
14
- */function ut(){if(Ye)return Ge;Ye=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return Ge=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,o){for(var i,l,a=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),u=1;u<arguments.length;u++){for(var s in i=Object(arguments[u]))t.call(i,s)&&(a[s]=i[s]);if(e){l=e(i);for(var c=0;c<l.length;c++)n.call(i,l[c])&&(a[l[c]]=i[l[c]])}}return a},Ge}function st(){if(Ze)return Xe;Ze=1;return Xe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function ct(){return Je?Qe:(Je=1,Qe=Function.call.bind(Object.prototype.hasOwnProperty))}function dt(){if(et)return Ke;et=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=st(),n={},r=ct();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,l,a,u){if("production"!==process.env.NODE_ENV)for(var s in o)if(r(o,s)){var c;try{if("function"!=typeof o[s]){var d=Error((a||"React class")+": "+l+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}c=o[s](i,s,a,l,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((a||"React class")+": type specification of "+l+" `"+s+"` 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 n)){n[c.message]=!0;var f=u?u():"";e("Failed "+l+" type: "+c.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},Ke=o}function ft(){if(nt)return tt;nt=1;var e=at(),t=ut(),n=st(),r=ct(),o=dt(),i=function(){};function l(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),tt=function(a,u){var s="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",d={array:h("array"),bigint:h("bigint"),bool:h("boolean"),func:h("function"),number:h("number"),object:h("object"),string:h("string"),symbol:h("symbol"),any:p(l),arrayOf:function(e){return p((function(t,r,o,i,l){if("function"!=typeof e)return new y("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[r];if(!Array.isArray(a))return new y("Invalid "+i+" `"+l+"` of type `"+g(a)+"` supplied to `"+o+"`, expected an array.");for(var u=0;u<a.length;u++){var s=e(a,u,o,i,l+"["+u+"]",n);if(s instanceof Error)return s}return null}))},element:p((function(e,t,n,r,o){var i=e[t];return a(i)?null:new y("Invalid "+r+" `"+o+"` of type `"+g(i)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:p((function(t,n,r,o,i){var l=t[n];return e.isValidElementType(l)?null:new y("Invalid "+o+" `"+i+"` of type `"+g(l)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return p((function(t,n,r,o,i){if(!(t[n]instanceof e)){var l=e.name||c;return new y("Invalid "+o+" `"+i+"` of type `"+(((a=t[n]).constructor&&a.constructor.name?a.constructor.name:c)+"` supplied to `")+r+"`, expected instance of `"+l+"`.")}var a;return null}))},node:p((function(e,t,n,r,o){return m(e[t])?null:new y("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return p((function(t,o,i,l,a){if("function"!=typeof e)return new y("Property `"+a+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var u=t[o],s=g(u);if("object"!==s)return new y("Invalid "+l+" `"+a+"` of type `"+s+"` supplied to `"+i+"`, expected an object.");for(var c in u)if(r(u,c)){var d=e(u,c,i,l,a+"."+c,n);if(d instanceof Error)return d}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"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]).":"Invalid argument supplied to oneOf, expected an array."),l;return p((function(t,n,r,o,i){for(var l=t[n],a=0;a<e.length;a++)if(f(l,e[a]))return null;var u=JSON.stringify(e,(function(e,t){return"symbol"===b(t)?String(t):t}));return new y("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+r+"`, expected one of "+u+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(o)+" at index "+t+"."),l}return p((function(t,o,i,l,a){for(var u=[],s=0;s<e.length;s++){var c=(0,e[s])(t,o,i,l,a,n);if(null==c)return null;c.data&&r(c.data,"expectedType")&&u.push(c.data.expectedType)}return new y("Invalid "+l+" `"+a+"` supplied to `"+i+"`"+(u.length>0?", expected one of type ["+u.join(", ")+"]":"")+".")}))},shape:function(e){return p((function(t,r,o,i,l){var a=t[r],u=g(a);if("object"!==u)return new y("Invalid "+i+" `"+l+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");for(var s in e){var c=e[s];if("function"!=typeof c)return v(o,i,l,s,b(c));var d=c(a,s,o,i,l+"."+s,n);if(d)return d}return null}))},exact:function(e){return p((function(o,i,l,a,u){var s=o[i],c=g(s);if("object"!==c)return new y("Invalid "+a+" `"+u+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var d=t({},o[i],e);for(var f in d){var p=e[f];if(r(e,f)&&"function"!=typeof p)return v(l,a,u,f,b(p));if(!p)return new y("Invalid "+a+" `"+u+"` key `"+f+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=p(s,f,l,a,u+"."+f,n);if(h)return h}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function y(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function p(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,l,a,s,d,f,p){if(s=s||c,f=f||a,p!==n){if(u){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var v=s+":"+a;!t[v]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+s+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[v]=!0,r++)}}return null==l[a]?o?null===l[a]?new y("The "+d+" `"+f+"` is marked as required in `"+s+"`, but its value is `null`."):new y("The "+d+" `"+f+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(l,a,s,d,f)}var l=o.bind(null,!1);return l.isRequired=o.bind(null,!0),l}function h(e){return p((function(t,n,r,o,i,l){var a=t[n];return g(a)!==e?new y("Invalid "+o+" `"+i+"` of type `"+b(a)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function v(e,t,n,r,o){return new y((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||a(e))return!0;var t=function(e){var t=e&&(s&&e[s]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!m(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function g(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=g(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function w(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return y.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},tt}function yt(){if(ot)return rt;ot=1;var e=st();function t(){}function n(){}return n.resetWarningCache=t,rt=function(){function r(t,n,r,o,i,l){if(l!==e){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}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}function pt(){if(it)return Be.exports;if(it=1,"production"!==process.env.NODE_ENV){var e=at();Be.exports=ft()(e.isElement,true)}else Be.exports=yt()();return Be.exports}var ht,vt,mt,gt,bt,wt,xt,St=Le(pt()),Ct=function(){return q((function e(t,n){W(this,e),this.text=t,this.patterns=n||[]}),[{key:"parse",value:function(){var e=this,t=[{children:this.text}];return this.patterns.forEach((function(n){var r=[],o=n.nonExhaustiveModeMaxMatchCount||0,i=Math.min(Math.max(Number.isInteger(o)?o:0,0)||Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=0;t.forEach((function(t){if(t._matched)r.push(t);else{var o,a=[],u=t.children,s=0;for(n.pattern.lastIndex=0;u&&(o=n.pattern.exec(u));){var c=u.substr(0,o.index);if(s=o.index,++l>i)break;a.push({children:c}),a.push(e.getMatchedPart(n,o[0],o,s)),u=u.substr(o.index+o[0].length),s+=o[0].length-1,n.pattern.lastIndex=0}a.push({children:u}),r.push.apply(r,a)}})),t=r})),t.forEach((function(e){return delete e._matched})),t.filter((function(e){return!!e.children}))}},{key:"getMatchedPart",value:function(e,t,n,r){var o={};Object.keys(e).forEach((function(n){"pattern"!==n&&"renderText"!==n&&"nonExhaustiveModeMaxMatchCount"!==n&&("function"==typeof e[n]?o[n]=function(){return e[n](t,r)}:o[n]=e[n])}));var i=t;return e.renderText&&"function"==typeof e.renderText&&(i=e.renderText(t,n)),X(X({},o),{},{children:i,_matched:!0})}}])}(),Pt=["type"],It=["style"],Ot=["parse","childrenProps"],At={url:/(https?:\/\/|www\.)[-a-zA-Z0-9@:%._\+~#=]{1,256}\.(xn--)?[a-z0-9-]{2,20}\b([-a-zA-Z0-9@:%_\+\[\],.~#?&\/=]*[-a-zA-Z0-9@:%_\+\]~#?&\/=])*/i,phone:/[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,7}/,email:/\S+@\S+\.\S+/},kt=St.shape(X(X({},a.propTypes),{},{type:St.oneOf(Object.keys(At)).isRequired,nonExhaustiveMaxMatchCount:St.number})),Mt=St.shape(X(X({},a.propTypes),{},{pattern:St.oneOfType([St.string,St.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:St.number})),jt=function(){function t(){return W(this,t),B(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Q(e,t)}(t,w.Component),q(t,[{key:"setNativeProps",value:function(e){this._root.setNativeProps(e)}},{key:"getPatterns",value:function(){return this.props.parse.map((function(e){var t=e.type,n=Z(e,Pt);if(t){if(!At[t])throw new Error("".concat(e.type," is not a supported type"));n.pattern=At[t]}return n}))}},{key:"getParsedText",value:function(){var t=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new Ct(this.props.children,this.getPatterns()).parse().map((function(n,r){var o=t.props.style,i=n.style,l=Z(n,It);return e(a,X(X({style:[o,i]},t.props.childrenProps),l),"parsedText-".concat(r))})):this.props.children}},{key:"render",value:function(){var t=this,n=X({},this.props);n.parse,n.childrenProps;var r=Z(n,Ot);return e(a,X(X({ref:function(e){return t._root=e}},r),{},{children:this.getParsedText()}))}}])}();jt.displayName="ParsedText",jt.propTypes=X(X({},a.propTypes),{},{parse:St.arrayOf(St.oneOfType([kt,Mt])),childrenProps:St.shape(a.propTypes)}),jt.defaultProps={parse:null,childrenProps:{}};var Et,Tt,Rt,_t,zt,Vt,Nt,$t,Ft,Lt,Dt,Bt,Wt,qt,Ht,Ut,Gt,Yt,Xt=function(n){var r,o,u,s,c=n.message,d=n.onGalleryOpen,y=n.isVideoPlaying,p=n.isCurrentUser,h=ie(),v=h.theme,m=h.showMessageStatus,g=h.onFileAttachmentPress,w=O((function(){return le(c)}),[c]);return t(i,{children:[w.length>0&&e(Fe,{items:w,onOpenGallery:d}),(null!==(r=c.fileAttachments)&&void 0!==r?r:[]).map((function(n,r){return t(l,{onPress:function(){g?g(n):f.openURL(n.uri.startsWith("http")||n.uri.startsWith("file:")?n.uri:"file://".concat(n.uri))},style:b(ht||(ht=K(["my-1.5 py-2 px-3 rounded-lg bg-black/10 max-w-[220px]"]))),children:[t(a,{style:ue(b(vt||(vt=K(["text-xs font-semibold"]))),null==v?void 0:v.fontFamily),numberOfLines:2,children:["📎 ",n.name]}),e(a,{style:b(mt||(mt=K(["text-[10px] opacity-70 mt-0.5"]))),children:n.type})]},"".concat(n.uri,"-").concat(r))})),c.audio&&e(i,{style:b(gt||(gt=K(["my-2"]))),children:e(je,{audioUrl:c.audio,audioId:c.id,isVideoPlaying:y})}),c.text&&e(jt,{style:ue([b(bt||(bt=K(["pt-1"]))),b(m?wt||(wt=K(["pb-0"])):xt||(xt=K(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},p?null==v||null===(o=v.messageStyle)||void 0===o?void 0:o.sentTextStyle:null==v||null===(u=v.messageStyle)||void 0===u?void 0:u.receivedTextStyle],null==v?void 0:v.fontFamily),parse:[{type:"url",style:X({color:"blue",textDecorationLine:"underline"},(s=null==v?void 0:v.fontFamily,s?{fontFamily:s}:void 0)),onPress:function(e){return f.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:c.text})]})},Zt=w.memo(Xt),Qt=function(t){var n=t.style,r=t.fill;return e(k,{style:n,viewBox:"0 0 24 24",children:e(M,{fill:r,d:"M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z"})})},Jt=function(t){var n=t.style,r=t.fill;return e(k,{style:n,viewBox:"0 0 24 24",children:e(M,{d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z",fill:r})})},Kt=function(r){var o,l,u,s,c=r.time,d=r.status,f=r.isCurrentUser,y=r.hasText,p=r.hasAudio,h=r.hasGalleryMedia,v=r.hasFileAttachments,m=ie(),g=m.theme,w=m.showMessageStatus,x=(h||v)&&!y&&!p;return e(n,{children:w&&t(i,{style:[b(Et||(Et=K(["flex-row items-center"]))),b(y?Tt||(Tt=K(["justify-end pb-1 ml-4"])):p?Rt||(Rt=K(["absolute right-3 bottom-3"])):x?_t||(_t=K(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])):zt||(zt=K(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])))],children:[e(a,{style:ue([b(Vt||(Vt=K(["text-xs"]))),{color:y||p?(null==g||null===(o=g.colors)||void 0===o?void 0:o.timestamp)||"rgba(107, 114, 128, 0.7)":"white"}],null==g?void 0:g.fontFamily),children:c}),f&&t(i,{style:b(Nt||(Nt=K(["ml-1 flex-row items-center"]))),children:["sent"===d&&e(Jt,{style:b.style("h-4 w-4",{opacity:.7}),fill:(null==g||null===(l=g.colors)||void 0===l?void 0:l.sentIconColor)||"#6B7280"}),"delivered"===d&&e(Qt,{style:b.style("h-4 w-4",{opacity:.7}),fill:(null==g||null===(u=g.colors)||void 0===u?void 0:u.deliveredIconColor)||"#6B7280"}),"read"===d&&e(Qt,{style:b.style("h-4 w-4",{opacity:.9}),fill:(null==g||null===(s=g.colors)||void 0===s?void 0:s.readIconColor)||"#3B82F6"})]})]})})},en=w.memo(Kt),tn=function(r){var o,u,s,c,f,y,p,h,v,m,g=r.message,w=r.isCurrentUser,x=r.isFirstInSequence,S=r.onLongPress,C=ie(),P=C.theme,I=C.showAvatars,O=C.showUserNames,A=C.showBubbleTail,k=C.setMediaViewerGallery,M=C.isVideoPlaying,j=le(g),E=(null!==(o=null===(u=g.fileAttachments)||void 0===u?void 0:u.length)&&void 0!==o?o:0)>0&&0===j.length&&!g.text&&!g.audio;return t(l,{onLongPress:S,style:[b($t||($t=K(["px-2 my-1 max-w-[75%] relative"]))),b(w?Ft||(Ft=K(["self-end mr-3"])):Lt||(Lt=K(["self-start ml-9"]))),b(x?w?Dt||(Dt=K(["bg-green-500 rounded-tr-none"])):Bt||(Bt=K(["bg-white rounded-tl-none"])):w?Wt||(Wt=K(["bg-green-500"])):qt||(qt=K(["bg-white"]))),X({borderRadius:8},w?null==P||null===(s=P.bubbleStyle)||void 0===s?void 0:s.sent:null==P||null===(c=P.bubbleStyle)||void 0===c?void 0:c.received)],children:[!w&&x&&I&&t(n,{children:[e(i,{style:b(Ht||(Ht=K(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:g.senderAvatar?e(d,{source:{uri:g.senderAvatar},style:[b(Ut||(Ut=K(["w-full h-full rounded-full"]))),null==P||null===(f=P.bubbleStyle)||void 0===f?void 0:f.avatarImageStyle],resizeMode:"cover"}):e(a,{style:ue([b(Gt||(Gt=K(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==P||null===(y=P.bubbleStyle)||void 0===y?void 0:y.avatarTextStyle],null==P?void 0:P.fontFamily),children:null===(p=g.senderName)||void 0===p?void 0:p.charAt(0)})}),O&&g.senderName&&e(a,{style:ue([b(Yt||(Yt=K(["text-sm text-black font-semibold mt-1 capitalize"]))),null==P||null===(h=P.bubbleStyle)||void 0===h?void 0:h.userNameStyle],null==P?void 0:P.fontFamily),children:g.senderName})]}),x&&A&&e(te,{style:b.style("absolute -top-1 w-6 h-6 ",w?"-right-3.5 mt-[1.24px]":"-left-3.5 mt-[1.25px]",{transform:[{rotate:w?"90deg":"180deg"}]}),color:"".concat(w?(null==P||null===(v=P.colors)||void 0===v?void 0:v.sentMessageTailColor)||"rgba(34, 197, 94,1)":(null==P||null===(m=P.colors)||void 0===m?void 0:m.receivedMessageTailColor)||"white")}),e(Zt,{message:g,isCurrentUser:w,isFirstInSequence:x,onGalleryOpen:function(e,t){k(e,t)},isVideoPlaying:M}),e(en,{time:g.time,status:w?g.status:void 0,isCurrentUser:w,hasText:!!g.text,hasAudio:!!g.audio,hasGalleryMedia:j.length>0&&!g.text,hasFileAttachments:E})]})},nn=w.memo(tn),rn=function(n){var r=n.style,o=n.color;return e(j,{style:r,viewBox:"0 0 24 24",children:t(E,{fill:"none",strokeWidth:"1.5",stroke:o,children:[e(T,{cx:"12",cy:"13",r:"3"}),e(M,{d:"M9.778 21h4.444c3.121 0 4.682 0 5.803-.735a4.4 4.4 0 0 0 1.226-1.204c.749-1.1.749-2.633.749-5.697s0-4.597-.749-5.697a4.4 4.4 0 0 0-1.226-1.204c-.72-.473-1.622-.642-3.003-.702c-.659 0-1.226-.49-1.355-1.125A2.064 2.064 0 0 0 13.634 3h-3.268c-.988 0-1.839.685-2.033 1.636c-.129.635-.696 1.125-1.355 1.125c-1.38.06-2.282.23-3.003.702A4.4 4.4 0 0 0 2.75 7.667C2 8.767 2 10.299 2 13.364s0 4.596.749 5.697c.324.476.74.885 1.226 1.204C5.096 21 6.657 21 9.778 21Z"}),e(M,{strokeLinecap:"round",d:"M19 10h-1"})]})})},on=function(n){var r=n.style,o=n.color;return e(k,{style:r,viewBox:"0 0 24 24",children:t(E,{fill:"none",stroke:o,children:[e(M,{strokeLinecap:"round",strokeWidth:"1.5",d:"M8.913 15.934c1.258.315 2.685.315 4.122-.07s2.673-1.099 3.605-2.001"}),e(R,{cx:"14.509",cy:"9.774",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 14.51 9.774)"}),e(R,{cx:"8.714",cy:"11.328",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 8.714 11.328)"}),e(M,{strokeWidth:"1.5",d:"M3.204 14.357c-1.112-4.147-1.667-6.22-.724-7.853s3.016-2.19 7.163-3.3c4.147-1.112 6.22-1.667 7.853-.724s2.19 3.016 3.3 7.163c1.111 4.147 1.667 6.22.724 7.853s-3.016 2.19-7.163 3.3c-4.147 1.111-6.22 1.667-7.853.724s-2.19-3.016-3.3-7.163Z"}),e(M,{strokeWidth:"1.5",d:"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935"})]})})},ln=function(n){var r=n.style,o=n.color;return e(k,{style:r,viewBox:"0 0 24 24",children:t(E,{fill:"none",strokeWidth:"1.5",stroke:o,children:[e(M,{d:"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z"}),e(M,{strokeLinecap:"round",d:"M13.5 8H17m-3.5 3H17M7 8h2m-2 3h2m11-1v1a8 8 0 0 1-8 8m-8-9v1a8 8 0 0 0 8 8m0 0v3",opacity:".5"})]})})},an=function(t){var n=t.style,r=t.color;return e(k,{style:n,fill:r,viewBox:"0 0 24 24",children:e(M,{d:"M17.346 15.539q0 2.271-1.565 3.866T11.952 21t-3.838-1.595t-1.576-3.867v-8.73q0-1.587 1.092-2.697Q8.72 3 10.308 3t2.678 1.11t1.091 2.698v8.269q0 .88-.615 1.517q-.614.637-1.498.637t-1.52-.627t-.636-1.527V6.769h1v8.308q0 .479.327.816q.328.338.807.338t.807-.338t.328-.816V6.789q-.006-1.166-.802-1.977Q11.48 4 10.308 4q-1.163 0-1.966.821q-.804.821-.804 1.987v8.73q-.005 1.853 1.283 3.157Q10.11 20 11.96 20q1.823 0 3.1-1.305t1.287-3.156v-8.77h1z"})})},un=function(n){var r=n.style,o=n.color;return e(k,{style:r,viewBox:"0 0 24 24",children:t(E,{fill:"none",strokeWidth:"1.5",stroke:o,children:[e(M,{d:"m18.636 15.67l1.716-5.15c1.5-4.498 2.25-6.747 1.062-7.934s-3.436-.438-7.935 1.062L8.33 5.364C4.7 6.574 2.885 7.18 2.37 8.067a2.72 2.72 0 0 0 0 2.73c.515.888 2.33 1.493 5.96 2.704c.584.194.875.291 1.119.454c.236.158.439.361.597.597c.163.244.26.535.454 1.118c1.21 3.63 1.816 5.446 2.703 5.962a2.72 2.72 0 0 0 2.731 0c.887-.516 1.492-2.331 2.703-5.962Z"}),e(M,{strokeLinecap:"round",d:"m17.79 6.21l-4.211 4.165",opacity:".5"})]})})},sn=function(n){var r=n.style,o=n.fill,i=void 0===o?"currentColor":o;return t(k,{style:r,viewBox:"0 0 24 24",children:[e(M,{fill:i,d:"M13 4H6v16h12V9h-5z",opacity:".3"}),e(M,{fill:i,d:"m20 8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2zm-2 12H6V4h7v5h5z"})]})},cn=function(t){var n=t.fileName,r=t.style,o=ie().theme;return e(a,{numberOfLines:2,ellipsizeMode:"tail",style:ue([{fontSize:14,fontWeight:"600",color:"black"},r],null==o?void 0:o.fontFamily),children:function(e){var t=e.lastIndexOf(".");if(-1===t)return e;var n=e.slice(0,t),r=e.slice(t);return n.length>40?n.slice(0,40)+"..."+r:n+r}(n)})},dn=w.memo(cn);function fn(e){return e.filter((function(e){var t,n;return(null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))||(null===(n=e.type)||void 0===n?void 0:n.startsWith("video/"))})).map((function(e){return{uri:e.uri,kind:e.type.startsWith("video/")?"video":"image"}}))}var yn,pn,hn,vn,mn,gn,bn,wn,xn,Sn,Cn,Pn,In,On,An,kn,Mn=function(n){var r,o=n.previews,u=n.closePreview,s=n.onRemoveItem,c=n.CustomFileIcon,f=n.CustomImagePreview,p=n.CustomVideoPreview,h=n.inputHeight,v=ie(),m=v.theme,g=v.setMediaViewerGallery,b=o.filter((function(e){var t,n;return(null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))||(null===(n=e.type)||void 0===n?void 0:n.startsWith("video/"))})),w=o.filter((function(e){var t,n;return!(null!==(t=e.type)&&void 0!==t&&t.startsWith("image/")||null!==(n=e.type)&&void 0!==n&&n.startsWith("video/"))})),x=fn(o);if(0===o.length)return null;var S=function(e){0!==x.length&&g(x,e)},C=function(t){var n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:56,l=null===(n=t.type)||void 0===n?void 0:n.startsWith("image/"),a=null===(r=t.type)||void 0===r?void 0:r.startsWith("video/");return l&&f?e(f,{uri:t.uri}):a&&p?e(p,{uri:t.uri}):l?e(d,{source:{uri:t.uri},style:{width:o,height:o,borderRadius:12},resizeMode:"cover"}):a?e(i,{style:{width:o,height:o,borderRadius:12,overflow:"hidden"},children:e(L,{source:{uri:t.uri},style:{width:"100%",height:"100%"},resizeMode:"cover",muted:!0,repeat:!0,paused:!1})}):null},P=function(t,n){return e(l,{onPress:function(){return s?s(t):null==u?void 0:u()},style:{position:"absolute",zIndex:50,height:22,width:22,backgroundColor:"rgba(0,0,0,0.55)",right:-6,top:-6,borderRadius:11,justifyContent:"center",alignItems:"center",transform:n?[{rotate:n}]:void 0},children:e(a,{style:ue({fontSize:13,color:"white",fontWeight:"700",lineHeight:14},null==m?void 0:m.fontFamily),children:"×"})})};return e(i,{style:[{position:"absolute",bottom:(null!=h?h:0)+8,zIndex:20,borderRadius:12,maxWidth:"92%",alignSelf:"flex-start"},null==m||null===(r=m.filePreviewStyle)||void 0===r?void 0:r.root],children:t(i,{style:{gap:8},children:[function(){if(0===b.length)return null;if(1===b.length){var n=b[0];return n?t(l,{onPress:function(){return S(0)},style:{position:"relative"},children:[C(n),P(n.uri)]}):null}var r=b.slice(0,3),o=b.length>3?b.length-3:0;return e(i,{style:{flexDirection:"row",alignItems:"center",minHeight:68},children:r.map((function(n,u){var s=2===r.length?0===u?"-4deg":"4deg":0===u?"-10deg":1===u?"0deg":"10deg",c=2===r.length?0===u?"4deg":"-4deg":0===u?"10deg":1===u?"0deg":"-10deg";return e(l,{onPress:function(){var e=fn(b).findIndex((function(e){return e.uri===n.uri}));S(e>=0?e:0)},style:{marginLeft:0===u?0:-18,zIndex:u+1,transform:[{rotate:s}],position:"relative"},children:t(i,{style:{position:"relative"},children:[C(n),2===u&&o>0&&e(i,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:12,backgroundColor:"rgba(0,0,0,0.55)",alignItems:"center",justifyContent:"center"},children:t(a,{style:{color:"#fff",fontWeight:"700",fontSize:14},children:["+",o]})}),P(n.uri,c)]})},"".concat(n.uri,"-").concat(u))}))})}(),w.length>0&&e(y,{scrollEnabled:w.length>3,style:{maxHeight:232},showsVerticalScrollIndicator:w.length>3,contentContainerStyle:{gap:8},nestedScrollEnabled:!0,children:w.map((function(n,r){return function(n,r){var o,l,a,u;return t(i,{style:{position:"relative"},children:[t(i,{style:[{backgroundColor:"white",width:240,minHeight:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==m||null===(o=m.filePreviewStyle)||void 0===o?void 0:o.container],children:[e(i,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==m||null===(l=m.filePreviewStyle)||void 0===l?void 0:l.iconContainer],children:c?e(c,{}):e(sn,{style:{width:40,height:40},fill:"white"})}),e(i,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==m||null===(a=m.filePreviewStyle)||void 0===a?void 0:a.nameContainer],children:e(dn,{fileName:n.name||"File",style:null==m||null===(u=m.filePreviewStyle)||void 0===u?void 0:u.text})})]}),P(n.uri)]},"".concat(n.uri,"-").concat(r))}(n,r)}))})]})})},jn=w.memo(Mn),En="ios"===r.OS?32:30,Tn="ios"===r.OS?50:48,Rn="h-6 w-6",_n=function(n){var o,a,u,s,c,d,f,y,h,v,m,g,w,S=n.onSendMessage,C=n.onTypingStart,P=n.onTypingEnd,k=n.onAttachmentPress,M=n.onCameraPress,j=n.onAudioRecordStart,E=n.onAudioRecordEnd,T=n.CustomEmojiIcon,R=n.CustomAttachmentIcon,_=n.CustomCameraIcon,z=n.CustomSendIcon,V=n.CustomMicrophoneIcon,N=n.CustomFileIcon,$=n.CustomImagePreview,F=n.CustomVideoPreview,L=J(x(""),2),D=L[0],B=L[1],W=J(x(0),2),q=W[0],H=W[1],U=J(x({height:En,isMultiline:!1}),2),G=U[0],Y=U[1],Z=ie(),Q=Z.theme,ee=Z.currentUserId,te=Z.showEmojiButton,ne=Z.showAttachmentsButton,re=Z.showCameraButton,oe=Z.showVoiceRecordButton,le=Z.placeholder,se=Z.previewData,ce=Z.previewItems,de=Z.closePreview,fe=Z.onRemovePreviewItem,ye=O((function(){return null!=ce&&ce.length?ce:se?[se]:[]}),[ce,se]),pe=ye.length>0,he=null==Q||null===(o=Q.sizes)||void 0===o?void 0:o.inputIconSize,ve=function(e){if("number"==typeof e&&e>0)return{width:e,height:e};var t="string"==typeof e&&e.trim().length>0?e.trim():ae;return b.style(t)}(he),me="number"==typeof(w=he)&&w>0?w:24,ge=0===D.trim().length&&!G.isMultiline,be=Math.max(0,(Tn-me)/2),we=ge?{paddingTop:be,paddingBottom:be}:{paddingBottom:be},xe=A((function(){Y({height:En,isMultiline:!1}),H((function(e){return e+1}))}),[]),Se=A((function(e){B(e),0===e.length&&xe()}),[xe]),Ce=A((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,En),118),n=t>En;Y({height:n?t:En,isMultiline:n})}),[]),Pe=A((function(){var e=D.trim();(e||pe)&&(S({text:e,senderId:ee}),B(""),xe())}),[D,S,ee,pe,xe]);I((function(){D.trim()?null==C||C():null==P||P()}),[D,C,P]);var Ie=!!D.trim()||pe;return t(i,{style:b(yn||(yn=K(["w-full px-2"]))),children:[pe&&e(jn,{previews:ye,closePreview:de,onRemoveItem:fe,CustomFileIcon:N,CustomImagePreview:$,CustomVideoPreview:F,inputHeight:G.height}),t(i,{style:[b(pn||(pn=K(["flex-row items-end gap-2"]))),null==Q||null===(a=Q.inputStyles)||void 0===a?void 0:a.inputSectionContainerStyle],children:[t(i,{style:[b(hn||(hn=K(["flex-1 flex-row bg-white overflow-hidden px-3.5"]))),{minHeight:Tn,borderRadius:ge?9999:24,alignItems:ge?"center":"flex-end"},null==Q||null===(u=Q.inputStyles)||void 0===u?void 0:u.inputContainerStyle],children:[te&&e(i,{style:we,children:e(l,{children:T?e(T,{}):e(on,{style:ve,color:(null==Q||null===(s=Q.colors)||void 0===s?void 0:s.inputsIconsColor)||"rgba(0,0,0,0.7)"})})}),e(p,{value:D,onChangeText:Se,placeholder:le||"Message",style:ue([b(vn||(vn=K(["bg-transparent flex-1 pl-2"]))),"ios"===r.OS?b(mn||(mn=K(["text-[17px]"]))):b(gn||(gn=K(["text-[16px]"]))),{minHeight:En,maxHeight:118,paddingVertical:ge?0:8,marginVertical:ge?(Tn-En)/2:4},{color:(null==Q||null===(c=Q.colors)||void 0===c?void 0:c.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==Q?void 0:Q.fontFamily),placeholderTextColor:(null==Q||null===(d=Q.colors)||void 0===d?void 0:d.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:G.isMultiline&&D.length>0?"top":"center",onContentSizeChange:Ce},"chat-input-".concat(q)),t(i,{style:[b(bn||(bn=K(["flex-row items-center gap-4"]))),we],children:[ne&&e(l,{onPress:k,children:R?e(R,{}):e(an,{style:ve,color:(null==Q||null===(f=Q.colors)||void 0===f?void 0:f.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),re&&!D.trim()&&e(l,{onPress:M,children:_?e(_,{}):e(rn,{style:ve,color:(null==Q||null===(y=Q.colors)||void 0===y?void 0:y.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),e(l,{style:[b(wn||(wn=K(["p-2 rounded-full bg-green-600 justify-center items-center"]))),X({height:Tn,width:Tn},null==Q||null===(h=Q.inputStyles)||void 0===h?void 0:h.sendButtonStyle)],onPress:Ie?Pe:j,onLongPress:j,onPressOut:E,children:Ie?z?e(z,{}):e(un,{style:b.style(Rn),color:(null==Q||null===(v=Q.colors)||void 0===v?void 0:v.sendIconsColor)||"rgba(255,255,255,0.7)"}):oe?V?e(V,{}):e(ln,{style:b.style("h-8 w-8"),color:(null==Q||null===(m=Q.colors)||void 0===m?void 0:m.sendIconsColor)||"rgba(255,255,255,0.7)"}):z?e(z,{}):e(un,{style:b.style(Rn),color:(null==Q||null===(g=Q.colors)||void 0===g?void 0:g.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},zn=w.memo(_n);function Vn(n){var r=n.style;return t(j,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:b.style("h-6 w-6 text-black",r),children:[e(_,{x1:"18",y1:"6",x2:"6",y2:"18"}),e(_,{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var Nn,$n,Fn,Ln,Dn,Bn,Wn,qn,Hn,Un,Gn,Yn,Xn,Zn,Qn,Jn=function(n){var r=n.gallery,o=n.onClose,u=ie(),s=u.theme,d=u.setIsVideoPlaying,f=P(null),y=J(x(0),2),p=y[0],m=y[1],g=c(),w=g.width,S=g.height;I((function(){null!=r&&r.items.length&&(m(r.initialIndex),requestAnimationFrame((function(){try{var e;null===(e=f.current)||void 0===e||e.scrollToIndex({index:r.initialIndex,animated:!1})}catch(e){}})))}),[null==r?void 0:r.initialIndex,null==r?void 0:r.items]);var C=A((function(e){var t=Math.round(e.nativeEvent.contentOffset.x/w);m(t);var n=null==r?void 0:r.items[t];d("video"===(null==n?void 0:n.kind))}),[null==r?void 0:r.items,w,d]);return r&&0!==r.items.length?e(h,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:o,children:t(i,{style:[b(xn||(xn=K(["flex-1 bg-black"]))),{width:w,height:S}],children:[e(l,{onPress:o,style:b(Sn||(Sn=K(["absolute right-4 top-12 z-20 p-2 rounded-full bg-slate-100/70"]))),children:e(Vn,{style:b(Cn||(Cn=K(["h-8 w-8"])))})}),r.items.length>1&&e(i,{style:b(Pn||(Pn=K(["absolute top-14 left-0 right-0 z-10 items-center"]))),children:t(a,{style:ue(b(In||(In=K(["text-white/90 text-sm bg-black/40 px-3 py-1 rounded-full"]))),null==s?void 0:s.fontFamily),children:[p+1," / ",r.items.length]})}),e(v,{ref:f,data:r.items,horizontal:!0,pagingEnabled:!0,showsHorizontalScrollIndicator:!1,keyExtractor:function(e,t){return"".concat(e.uri,"-").concat(t)},initialScrollIndex:r.initialIndex,getItemLayout:function(e,t){return{length:w,offset:w*t,index:t}},onMomentumScrollEnd:C,onScrollToIndexFailed:function(e){var t=e.index;setTimeout((function(){var e;null===(e=f.current)||void 0===e||e.scrollToIndex({index:t,animated:!1})}),100)},renderItem:function(t){var n=t.item;return e(Kn,{item:n,width:w,height:S})}})]})}):null},Kn=function(n){var r=n.item,o=n.width,l=n.height,u=ie().theme,s=P(null),c=J(x("video"===r.kind),2),f=c[0],y=c[1],p=J(x(!1),2),h=p[0],v=p[1];return"image"===r.kind?e(i,{style:{width:o,height:l,justifyContent:"center"},children:e(d,{source:{uri:r.uri},style:{width:o,height:l},resizeMode:"contain"})}):t(i,{style:{width:o,height:l,justifyContent:"center",alignItems:"center",paddingHorizontal:16},children:[e(L,{source:{uri:r.uri},ref:s,controls:!0,shutterColor:"transparent",style:{width:o-32,height:.55*l,backgroundColor:"#000"},resizeMode:"contain",onLoadStart:function(){y(!0),v(!1)},onLoad:function(){return y(!1)},onBuffer:function(e){var t=e.isBuffering;return y(t)},onError:function(){v(!0),y(!1)}}),f&&e(i,{style:b(On||(On=K(["absolute inset-0 items-center justify-center"]))),children:e(Ee,{style:b.style("h-14 w-14"),spinning:!0})}),h&&e(i,{style:b(An||(An=K(["absolute inset-0 items-center justify-center px-6"]))),children:e(a,{style:ue(b(kn||(kn=K(["text-white font-semibold"]))),null==u?void 0:u.fontFamily),children:"Failed to load video"})})]})},er=w.memo(Jn),tr=function(n){var r,o,l,u,s=n.typingUsers,c=n.currentUserId,f=ie(),y=f.theme,p=f.showAvatars,h=f.renderCustomTyping,v=f.showBubbleTail,m=s.filter((function(e){return e.id!==c}));if(!m.length)return null;var g=m.slice(0,2),w=m.length-2;return t(i,{style:b(Nn||(Nn=K(["my-1 max-w-[75%] self-start flex-row"]))),children:[p&&t(i,{style:b($n||($n=K(["flex-row"]))),children:[g.map((function(t,n){var r,o,l;return e(i,{style:[b(Fn||(Fn=K(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:n>0?-10:0,zIndex:g.length+n}],children:t.avatar?e(d,{source:{uri:t.avatar},style:[b(Ln||(Ln=K(["w-full h-full object-cover rounded-full"]))),null==y||null===(r=y.bubbleStyle)||void 0===r?void 0:r.avatarImageStyle]}):e(a,{style:ue([b(Dn||(Dn=K(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==y||null===(o=y.bubbleStyle)||void 0===o?void 0:o.avatarTextStyle],null==y?void 0:y.fontFamily),children:null===(l=t.name)||void 0===l?void 0:l.charAt(0)})},t.id)})),w>0&&e(i,{style:[b(Bn||(Bn=K(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},X({},null==y||null===(r=y.bubbleStyle)||void 0===r?void 0:r.additionalTypingUsersContainerStyle)],children:t(a,{style:ue([b(Wn||(Wn=K(["text-white text-xs font-semibold"]))),null==y||null===(o=y.bubbleStyle)||void 0===o?void 0:o.additionalTypingUsersTextStyle],null==y?void 0:y.fontFamily),children:["+",w]})})]}),v&&e(te,{style:b.style("w-6 h-6 fill-white mt-[1.25px]",{transform:[{rotate:"180deg"},{translateX:6}]}),color:"".concat((null==y||null===(l=y.colors)||void 0===l?void 0:l.receivedMessageTailColor)||"white")}),e(i,{style:[b(qn||(qn=K(["px-2 my-1 bg-white rounded-tl-none rounded-lg"]))),null==y||null===(u=y.bubbleStyle)||void 0===u?void 0:u.typingContainerStyle],children:h?h():e(i,{style:b(Hn||(Hn=K(["flex-row items-center py-3 px-2 justify-center"]))),children:e(a,{style:ue(b(Un||(Un=K(["text-gray-600"]))),null==y?void 0:y.fontFamily),children:"Typing..."})})})]})};var nr=function(){var n=ie(),o=n.messages,l=n.currentUserId,a=n.onMessageLongPress,u=n.mediaViewerGallery,s=n.clearMediaViewerGallery,c=n.typingUsers,d=n.onSendMessage,f=n.onTypingStart,y=n.onTypingEnd,p=n.onAttachmentPress,h=n.onAudioRecordEnd,w=n.onAudioRecordStart,S=n.onCameraPress,C=n.renderCustomInput,P=n.CustomEmojiIcon,O=n.CustomAttachmentIcon,A=n.CustomCameraIcon,k=n.CustomMicrophoneIcon,M=n.CustomSendIcon,j=n.CustomFileIcon,E=n.CustomImagePreview,T=n.CustomVideoPreview,R=n.keyboardVerticalOffset,_=void 0===R?0:R,z=n.disableKeyboardAvoiding,V=void 0!==z&&z,N=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=J(x(0),2),n=t[0],o=t[1];return I((function(){if(e){var t="ios"===r.OS?"keyboardWillShow":"keyboardDidShow",n="ios"===r.OS?"keyboardWillHide":"keyboardDidHide",i=m.addListener(t,(function(e){o(e.endCoordinates.height)})),l=m.addListener(n,(function(){return o(0)}));return function(){i.remove(),l.remove()}}o(0)}),[e]),e?n:0}(!V),$=C?C():e(zn,{onSendMessage:d,onTypingStart:f,onTypingEnd:y,onAttachmentPress:p,onAudioRecordEnd:h,onAudioRecordStart:w,onCameraPress:S,CustomEmojiIcon:P,CustomAttachmentIcon:O,CustomCameraIcon:A,CustomMicrophoneIcon:k,CustomSendIcon:M,CustomFileIcon:j,CustomImagePreview:E,CustomVideoPreview:T}),F=t(i,{style:b(Gn||(Gn=K(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e(v,{style:b(Yn||(Yn=K(["flex-1"]))),data:o,keyExtractor:function(e){return e.id},renderItem:function(t){var n,r=t.item,i=t.index;return e(nn,{message:r,isCurrentUser:r.senderId===l,onLongPress:function(){return null==a?void 0:a(r)},isFirstInSequence:i===o.length-1||(null===(n=o[i+1])||void 0===n?void 0:n.senderId)!==r.senderId})},ListHeaderComponent:e(tr,{typingUsers:c||[],currentUserId:l}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e(i,{style:!V&&N>0?{marginBottom:N}:void 0,children:$}),e(er,{gallery:u,onClose:s})]});return V?e(i,{style:b(Xn||(Xn=K(["flex-1"]))),children:F}):"android"===r.OS?e(i,{style:b(Zn||(Zn=K(["flex-1"]))),children:F}):e(g,{style:b(Qn||(Qn=K(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:_,children:F})},rr=function(t){return e(Ae,{children:e(oe,X(X({},t),{},{children:e(nr,{})}))})};export{rr as default};
14
+ */function ct(){if(Ze)return Xe;Ze=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return Xe=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,o){for(var i,l,a=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),u=1;u<arguments.length;u++){for(var s in i=Object(arguments[u]))t.call(i,s)&&(a[s]=i[s]);if(e){l=e(i);for(var c=0;c<l.length;c++)n.call(i,l[c])&&(a[l[c]]=i[l[c]])}}return a},Xe}function dt(){if(Qe)return Je;Qe=1;return Je="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function ft(){return et?Ke:(et=1,Ke=Function.call.bind(Object.prototype.hasOwnProperty))}function yt(){if(nt)return tt;nt=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=dt(),n={},r=ft();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,l,a,u){if("production"!==process.env.NODE_ENV)for(var s in o)if(r(o,s)){var c;try{if("function"!=typeof o[s]){var d=Error((a||"React class")+": "+l+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}c=o[s](i,s,a,l,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((a||"React class")+": type specification of "+l+" `"+s+"` 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 n)){n[c.message]=!0;var f=u?u():"";e("Failed "+l+" type: "+c.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},tt=o}function pt(){if(ot)return rt;ot=1;var e=st(),t=ct(),n=dt(),r=ft(),o=yt(),i=function(){};function l(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),rt=function(a,u){var s="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",d={array:h("array"),bigint:h("bigint"),bool:h("boolean"),func:h("function"),number:h("number"),object:h("object"),string:h("string"),symbol:h("symbol"),any:p(l),arrayOf:function(e){return p((function(t,r,o,i,l){if("function"!=typeof e)return new y("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[r];if(!Array.isArray(a))return new y("Invalid "+i+" `"+l+"` of type `"+g(a)+"` supplied to `"+o+"`, expected an array.");for(var u=0;u<a.length;u++){var s=e(a,u,o,i,l+"["+u+"]",n);if(s instanceof Error)return s}return null}))},element:p((function(e,t,n,r,o){var i=e[t];return a(i)?null:new y("Invalid "+r+" `"+o+"` of type `"+g(i)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:p((function(t,n,r,o,i){var l=t[n];return e.isValidElementType(l)?null:new y("Invalid "+o+" `"+i+"` of type `"+g(l)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return p((function(t,n,r,o,i){if(!(t[n]instanceof e)){var l=e.name||c;return new y("Invalid "+o+" `"+i+"` of type `"+(((a=t[n]).constructor&&a.constructor.name?a.constructor.name:c)+"` supplied to `")+r+"`, expected instance of `"+l+"`.")}var a;return null}))},node:p((function(e,t,n,r,o){return m(e[t])?null:new y("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return p((function(t,o,i,l,a){if("function"!=typeof e)return new y("Property `"+a+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var u=t[o],s=g(u);if("object"!==s)return new y("Invalid "+l+" `"+a+"` of type `"+s+"` supplied to `"+i+"`, expected an object.");for(var c in u)if(r(u,c)){var d=e(u,c,i,l,a+"."+c,n);if(d instanceof Error)return d}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"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]).":"Invalid argument supplied to oneOf, expected an array."),l;return p((function(t,n,r,o,i){for(var l=t[n],a=0;a<e.length;a++)if(f(l,e[a]))return null;var u=JSON.stringify(e,(function(e,t){return"symbol"===b(t)?String(t):t}));return new y("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+r+"`, expected one of "+u+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(o)+" at index "+t+"."),l}return p((function(t,o,i,l,a){for(var u=[],s=0;s<e.length;s++){var c=(0,e[s])(t,o,i,l,a,n);if(null==c)return null;c.data&&r(c.data,"expectedType")&&u.push(c.data.expectedType)}return new y("Invalid "+l+" `"+a+"` supplied to `"+i+"`"+(u.length>0?", expected one of type ["+u.join(", ")+"]":"")+".")}))},shape:function(e){return p((function(t,r,o,i,l){var a=t[r],u=g(a);if("object"!==u)return new y("Invalid "+i+" `"+l+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");for(var s in e){var c=e[s];if("function"!=typeof c)return v(o,i,l,s,b(c));var d=c(a,s,o,i,l+"."+s,n);if(d)return d}return null}))},exact:function(e){return p((function(o,i,l,a,u){var s=o[i],c=g(s);if("object"!==c)return new y("Invalid "+a+" `"+u+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var d=t({},o[i],e);for(var f in d){var p=e[f];if(r(e,f)&&"function"!=typeof p)return v(l,a,u,f,b(p));if(!p)return new y("Invalid "+a+" `"+u+"` key `"+f+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=p(s,f,l,a,u+"."+f,n);if(h)return h}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function y(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function p(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,l,a,s,d,f,p){if(s=s||c,f=f||a,p!==n){if(u){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var v=s+":"+a;!t[v]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+s+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[v]=!0,r++)}}return null==l[a]?o?null===l[a]?new y("The "+d+" `"+f+"` is marked as required in `"+s+"`, but its value is `null`."):new y("The "+d+" `"+f+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(l,a,s,d,f)}var l=o.bind(null,!1);return l.isRequired=o.bind(null,!0),l}function h(e){return p((function(t,n,r,o,i,l){var a=t[n];return g(a)!==e?new y("Invalid "+o+" `"+i+"` of type `"+b(a)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function v(e,t,n,r,o){return new y((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||a(e))return!0;var t=function(e){var t=e&&(s&&e[s]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!m(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function g(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=g(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function w(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return y.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},rt}function ht(){if(lt)return it;lt=1;var e=dt();function t(){}function n(){}return n.resetWarningCache=t,it=function(){function r(t,n,r,o,i,l){if(l!==e){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}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}function vt(){if(at)return qe.exports;if(at=1,"production"!==process.env.NODE_ENV){var e=st();qe.exports=pt()(e.isElement,true)}else qe.exports=ht()();return qe.exports}var mt,gt,bt,wt,xt,St,Ct,Pt=Be(vt()),It=function(){return q((function e(t,n){W(this,e),this.text=t,this.patterns=n||[]}),[{key:"parse",value:function(){var e=this,t=[{children:this.text}];return this.patterns.forEach((function(n){var r=[],o=n.nonExhaustiveModeMaxMatchCount||0,i=Math.min(Math.max(Number.isInteger(o)?o:0,0)||Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=0;t.forEach((function(t){if(t._matched)r.push(t);else{var o,a=[],u=t.children,s=0;for(n.pattern.lastIndex=0;u&&(o=n.pattern.exec(u));){var c=u.substr(0,o.index);if(s=o.index,++l>i)break;a.push({children:c}),a.push(e.getMatchedPart(n,o[0],o,s)),u=u.substr(o.index+o[0].length),s+=o[0].length-1,n.pattern.lastIndex=0}a.push({children:u}),r.push.apply(r,a)}})),t=r})),t.forEach((function(e){return delete e._matched})),t.filter((function(e){return!!e.children}))}},{key:"getMatchedPart",value:function(e,t,n,r){var o={};Object.keys(e).forEach((function(n){"pattern"!==n&&"renderText"!==n&&"nonExhaustiveModeMaxMatchCount"!==n&&("function"==typeof e[n]?o[n]=function(){return e[n](t,r)}:o[n]=e[n])}));var i=t;return e.renderText&&"function"==typeof e.renderText&&(i=e.renderText(t,n)),X(X({},o),{},{children:i,_matched:!0})}}])}(),Ot=["type"],At=["style"],kt=["parse","childrenProps"],Mt={url:/(https?:\/\/|www\.)[-a-zA-Z0-9@:%._\+~#=]{1,256}\.(xn--)?[a-z0-9-]{2,20}\b([-a-zA-Z0-9@:%_\+\[\],.~#?&\/=]*[-a-zA-Z0-9@:%_\+\]~#?&\/=])*/i,phone:/[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,7}/,email:/\S+@\S+\.\S+/},jt=Pt.shape(X(X({},u.propTypes),{},{type:Pt.oneOf(Object.keys(Mt)).isRequired,nonExhaustiveMaxMatchCount:Pt.number})),Et=Pt.shape(X(X({},u.propTypes),{},{pattern:Pt.oneOfType([Pt.string,Pt.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:Pt.number})),Tt=function(){function t(){return W(this,t),B(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&J(e,t)}(t,w.Component),q(t,[{key:"setNativeProps",value:function(e){this._root.setNativeProps(e)}},{key:"getPatterns",value:function(){return this.props.parse.map((function(e){var t=e.type,n=Z(e,Ot);if(t){if(!Mt[t])throw new Error("".concat(e.type," is not a supported type"));n.pattern=Mt[t]}return n}))}},{key:"getParsedText",value:function(){var t=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new It(this.props.children,this.getPatterns()).parse().map((function(n,r){var o=t.props.style,i=n.style,l=Z(n,At);return e(u,X(X({style:[o,i]},t.props.childrenProps),l),"parsedText-".concat(r))})):this.props.children}},{key:"render",value:function(){var t=this,n=X({},this.props);n.parse,n.childrenProps;var r=Z(n,kt);return e(u,X(X({ref:function(e){return t._root=e}},r),{},{children:this.getParsedText()}))}}])}();Tt.displayName="ParsedText",Tt.propTypes=X(X({},u.propTypes),{},{parse:Pt.arrayOf(Pt.oneOfType([jt,Et])),childrenProps:Pt.shape(u.propTypes)}),Tt.defaultProps={parse:null,childrenProps:{}};var Rt,_t,zt,Vt,Nt,$t,Ft,Lt,Dt,Bt,Wt,qt,Ht,Ut,Gt,Yt,Xt,Zt,Jt=function(n){var r,o,i,s,c=n.message,d=n.onGalleryOpen,y=n.isVideoPlaying,p=n.isCurrentUser,h=ie(),v=h.theme,m=h.showMessageStatus,g=h.onFileAttachmentPress,w=O((function(){return le(c)}),[c]);return t(l,{children:[w.length>0&&e(De,{items:w,onOpenGallery:d}),(null!==(r=c.fileAttachments)&&void 0!==r?r:[]).map((function(n,r){return t(a,{onPress:function(){g?g(n):f.openURL(n.uri.startsWith("http")||n.uri.startsWith("file:")?n.uri:"file://".concat(n.uri))},style:b(mt||(mt=K(["my-1.5 py-2 px-3 rounded-lg bg-black/10 max-w-[220px]"]))),children:[t(u,{style:ue(b(gt||(gt=K(["text-xs font-semibold"]))),null==v?void 0:v.fontFamily),numberOfLines:2,children:["📎 ",n.name]}),e(u,{style:b(bt||(bt=K(["text-[10px] opacity-70 mt-0.5"]))),children:n.type})]},"".concat(n.uri,"-").concat(r))})),c.audio&&e(l,{style:b(wt||(wt=K(["my-2"]))),children:e(Te,{audioUrl:c.audio,audioId:c.id,isVideoPlaying:y})}),c.text&&e(Tt,{style:ue([b(xt||(xt=K(["pt-1"]))),b(m?St||(St=K(["pb-0"])):Ct||(Ct=K(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},p?null==v||null===(o=v.messageStyle)||void 0===o?void 0:o.sentTextStyle:null==v||null===(i=v.messageStyle)||void 0===i?void 0:i.receivedTextStyle],null==v?void 0:v.fontFamily),parse:[{type:"url",style:X({color:"blue",textDecorationLine:"underline"},(s=null==v?void 0:v.fontFamily,s?{fontFamily:s}:void 0)),onPress:function(e){return f.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:c.text})]})},Qt=w.memo(Jt),Kt=function(t){var n=t.style,r=t.fill;return e(k,{style:n,viewBox:"0 0 24 24",children:e(M,{fill:r,d:"M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z"})})},en=function(t){var n=t.style,r=t.fill;return e(k,{style:n,viewBox:"0 0 24 24",children:e(M,{d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z",fill:r})})},tn=function(r){var o,i,a,s,c=r.time,d=r.status,f=r.isCurrentUser,y=r.hasText,p=r.hasAudio,h=r.hasGalleryMedia,v=r.hasFileAttachments,m=ie(),g=m.theme,w=m.showMessageStatus,x=(h||v)&&!y&&!p;return e(n,{children:w&&t(l,{style:[b(Rt||(Rt=K(["flex-row items-center"]))),b(y?_t||(_t=K(["justify-end pb-1 ml-4"])):p?zt||(zt=K(["absolute right-3 bottom-3"])):x?Vt||(Vt=K(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])):Nt||(Nt=K(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])))],children:[e(u,{style:ue([b($t||($t=K(["text-xs"]))),{color:y||p?(null==g||null===(o=g.colors)||void 0===o?void 0:o.timestamp)||"rgba(107, 114, 128, 0.7)":"white"}],null==g?void 0:g.fontFamily),children:c}),f&&t(l,{style:b(Ft||(Ft=K(["ml-1 flex-row items-center"]))),children:["sent"===d&&e(en,{style:b.style("h-4 w-4",{opacity:.7}),fill:(null==g||null===(i=g.colors)||void 0===i?void 0:i.sentIconColor)||"#6B7280"}),"delivered"===d&&e(Kt,{style:b.style("h-4 w-4",{opacity:.7}),fill:(null==g||null===(a=g.colors)||void 0===a?void 0:a.deliveredIconColor)||"#6B7280"}),"read"===d&&e(Kt,{style:b.style("h-4 w-4",{opacity:.9}),fill:(null==g||null===(s=g.colors)||void 0===s?void 0:s.readIconColor)||"#3B82F6"})]})]})})},nn=w.memo(tn),rn=function(r){var i,s,c,d,f,y,p,h,v,m,g=r.message,w=r.isCurrentUser,x=r.isFirstInSequence,S=r.onLongPress,C=ie(),P=C.theme,I=C.showAvatars,O=C.showUserNames,A=C.showBubbleTail,k=C.setMediaViewerGallery,M=C.isVideoPlaying,j=le(g),E=(null!==(i=null===(s=g.fileAttachments)||void 0===s?void 0:s.length)&&void 0!==i?i:0)>0&&0===j.length&&!g.text&&!g.audio;return t(a,{onLongPress:S,style:[b(Lt||(Lt=K(["px-2 my-1 max-w-[75%] relative"]))),b(w?Dt||(Dt=K(["self-end mr-3"])):Bt||(Bt=K(["self-start ml-9"]))),b(x?w?Wt||(Wt=K(["bg-green-500 rounded-tr-none"])):qt||(qt=K(["bg-white rounded-tl-none"])):w?Ht||(Ht=K(["bg-green-500"])):Ut||(Ut=K(["bg-white"]))),X({borderRadius:8},w?null==P||null===(c=P.bubbleStyle)||void 0===c?void 0:c.sent:null==P||null===(d=P.bubbleStyle)||void 0===d?void 0:d.received)],children:[!w&&x&&I&&t(n,{children:[e(l,{style:b(Gt||(Gt=K(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:g.senderAvatar?e(o,{source:{uri:g.senderAvatar},style:[b(Yt||(Yt=K(["w-full h-full rounded-full"]))),null==P||null===(f=P.bubbleStyle)||void 0===f?void 0:f.avatarImageStyle],resizeMode:"cover"}):e(u,{style:ue([b(Xt||(Xt=K(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==P||null===(y=P.bubbleStyle)||void 0===y?void 0:y.avatarTextStyle],null==P?void 0:P.fontFamily),children:null===(p=g.senderName)||void 0===p?void 0:p.charAt(0)})}),O&&g.senderName&&e(u,{style:ue([b(Zt||(Zt=K(["text-sm text-black font-semibold mt-1 capitalize"]))),null==P||null===(h=P.bubbleStyle)||void 0===h?void 0:h.userNameStyle],null==P?void 0:P.fontFamily),children:g.senderName})]}),x&&A&&e(te,{style:b.style("absolute -top-1 w-6 h-6 ",w?"-right-3.5 mt-[1.24px]":"-left-3.5 mt-[1.25px]",{transform:[{rotate:w?"90deg":"180deg"}]}),color:"".concat(w?(null==P||null===(v=P.colors)||void 0===v?void 0:v.sentMessageTailColor)||"rgba(34, 197, 94,1)":(null==P||null===(m=P.colors)||void 0===m?void 0:m.receivedMessageTailColor)||"white")}),e(Qt,{message:g,isCurrentUser:w,isFirstInSequence:x,onGalleryOpen:function(e,t){k(e,t)},isVideoPlaying:M}),e(nn,{time:g.time,status:w?g.status:void 0,isCurrentUser:w,hasText:!!g.text,hasAudio:!!g.audio,hasGalleryMedia:j.length>0&&!g.text,hasFileAttachments:E})]})},on=w.memo(rn),ln=function(n){var r=n.style,o=n.color;return e(j,{style:r,viewBox:"0 0 24 24",children:t(E,{fill:"none",strokeWidth:"1.5",stroke:o,children:[e(T,{cx:"12",cy:"13",r:"3"}),e(M,{d:"M9.778 21h4.444c3.121 0 4.682 0 5.803-.735a4.4 4.4 0 0 0 1.226-1.204c.749-1.1.749-2.633.749-5.697s0-4.597-.749-5.697a4.4 4.4 0 0 0-1.226-1.204c-.72-.473-1.622-.642-3.003-.702c-.659 0-1.226-.49-1.355-1.125A2.064 2.064 0 0 0 13.634 3h-3.268c-.988 0-1.839.685-2.033 1.636c-.129.635-.696 1.125-1.355 1.125c-1.38.06-2.282.23-3.003.702A4.4 4.4 0 0 0 2.75 7.667C2 8.767 2 10.299 2 13.364s0 4.596.749 5.697c.324.476.74.885 1.226 1.204C5.096 21 6.657 21 9.778 21Z"}),e(M,{strokeLinecap:"round",d:"M19 10h-1"})]})})},an=function(n){var r=n.style,o=n.color;return e(k,{style:r,viewBox:"0 0 24 24",children:t(E,{fill:"none",stroke:o,children:[e(M,{strokeLinecap:"round",strokeWidth:"1.5",d:"M8.913 15.934c1.258.315 2.685.315 4.122-.07s2.673-1.099 3.605-2.001"}),e(R,{cx:"14.509",cy:"9.774",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 14.51 9.774)"}),e(R,{cx:"8.714",cy:"11.328",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 8.714 11.328)"}),e(M,{strokeWidth:"1.5",d:"M3.204 14.357c-1.112-4.147-1.667-6.22-.724-7.853s3.016-2.19 7.163-3.3c4.147-1.112 6.22-1.667 7.853-.724s2.19 3.016 3.3 7.163c1.111 4.147 1.667 6.22.724 7.853s-3.016 2.19-7.163 3.3c-4.147 1.111-6.22 1.667-7.853.724s-2.19-3.016-3.3-7.163Z"}),e(M,{strokeWidth:"1.5",d:"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935"})]})})},un=function(n){var r=n.style,o=n.color;return e(k,{style:r,viewBox:"0 0 24 24",children:t(E,{fill:"none",strokeWidth:"1.5",stroke:o,children:[e(M,{d:"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z"}),e(M,{strokeLinecap:"round",d:"M13.5 8H17m-3.5 3H17M7 8h2m-2 3h2m11-1v1a8 8 0 0 1-8 8m-8-9v1a8 8 0 0 0 8 8m0 0v3",opacity:".5"})]})})},sn=function(t){var n=t.style,r=t.color;return e(k,{style:n,fill:r,viewBox:"0 0 24 24",children:e(M,{d:"M17.346 15.539q0 2.271-1.565 3.866T11.952 21t-3.838-1.595t-1.576-3.867v-8.73q0-1.587 1.092-2.697Q8.72 3 10.308 3t2.678 1.11t1.091 2.698v8.269q0 .88-.615 1.517q-.614.637-1.498.637t-1.52-.627t-.636-1.527V6.769h1v8.308q0 .479.327.816q.328.338.807.338t.807-.338t.328-.816V6.789q-.006-1.166-.802-1.977Q11.48 4 10.308 4q-1.163 0-1.966.821q-.804.821-.804 1.987v8.73q-.005 1.853 1.283 3.157Q10.11 20 11.96 20q1.823 0 3.1-1.305t1.287-3.156v-8.77h1z"})})},cn=function(n){var r=n.style,o=n.color;return e(k,{style:r,viewBox:"0 0 24 24",children:t(E,{fill:"none",strokeWidth:"1.5",stroke:o,children:[e(M,{d:"m18.636 15.67l1.716-5.15c1.5-4.498 2.25-6.747 1.062-7.934s-3.436-.438-7.935 1.062L8.33 5.364C4.7 6.574 2.885 7.18 2.37 8.067a2.72 2.72 0 0 0 0 2.73c.515.888 2.33 1.493 5.96 2.704c.584.194.875.291 1.119.454c.236.158.439.361.597.597c.163.244.26.535.454 1.118c1.21 3.63 1.816 5.446 2.703 5.962a2.72 2.72 0 0 0 2.731 0c.887-.516 1.492-2.331 2.703-5.962Z"}),e(M,{strokeLinecap:"round",d:"m17.79 6.21l-4.211 4.165",opacity:".5"})]})})},dn=function(n){var r=n.style,o=n.fill,i=void 0===o?"currentColor":o;return t(k,{style:r,viewBox:"0 0 24 24",children:[e(M,{fill:i,d:"M13 4H6v16h12V9h-5z",opacity:".3"}),e(M,{fill:i,d:"m20 8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2zm-2 12H6V4h7v5h5z"})]})},fn=function(t){var n=t.fileName,r=t.style,o=ie().theme;return e(u,{numberOfLines:2,ellipsizeMode:"tail",style:ue([{fontSize:14,fontWeight:"600",color:"black"},r],null==o?void 0:o.fontFamily),children:function(e){var t=e.lastIndexOf(".");if(-1===t)return e;var n=e.slice(0,t),r=e.slice(t);return n.length>40?n.slice(0,40)+"..."+r:n+r}(n)})},yn=w.memo(fn);function pn(e){return e.filter((function(e){var t,n;return(null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))||(null===(n=e.type)||void 0===n?void 0:n.startsWith("video/"))})).map((function(e){return{uri:e.uri,kind:e.type.startsWith("video/")?"video":"image"}}))}var hn,vn,mn,gn,bn,wn,xn,Sn,Cn,Pn,In,On,An,kn,Mn,jn,En=function(n){var r,i=n.previews,s=n.closePreview,c=n.onRemoveItem,d=n.CustomFileIcon,f=n.CustomImagePreview,p=n.CustomVideoPreview,h=n.inputHeight,v=ie(),m=v.theme,g=v.setMediaViewerGallery,b=i.filter((function(e){var t,n;return(null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))||(null===(n=e.type)||void 0===n?void 0:n.startsWith("video/"))})),w=i.filter((function(e){var t,n;return!(null!==(t=e.type)&&void 0!==t&&t.startsWith("image/")||null!==(n=e.type)&&void 0!==n&&n.startsWith("video/"))})),x=pn(i);if(0===i.length)return null;var S=function(e){0!==x.length&&g(x,e)},C=function(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:56,a=null===(n=t.type)||void 0===n?void 0:n.startsWith("image/"),u=null===(r=t.type)||void 0===r?void 0:r.startsWith("video/");return a&&f?e(f,{uri:t.uri}):u&&p?e(p,{uri:t.uri}):a?e(o,{source:{uri:t.uri},style:{width:i,height:i,borderRadius:12},resizeMode:"cover"}):u?e(l,{style:{width:i,height:i,borderRadius:12,overflow:"hidden"},children:e(L,{source:{uri:t.uri},style:{width:"100%",height:"100%"},resizeMode:"cover",muted:!0,repeat:!0,paused:!1})}):null},P=function(t,n){return e(a,{onPress:function(){return c?c(t):null==s?void 0:s()},style:{position:"absolute",zIndex:50,height:22,width:22,backgroundColor:"rgba(0,0,0,0.55)",right:-6,top:-6,borderRadius:11,justifyContent:"center",alignItems:"center",transform:n?[{rotate:n}]:void 0},children:e(u,{style:ue({fontSize:13,color:"white",fontWeight:"700",lineHeight:14},null==m?void 0:m.fontFamily),children:"×"})})};return e(l,{style:[{position:"absolute",bottom:(null!=h?h:0)+8,zIndex:20,borderRadius:12,maxWidth:"92%",alignSelf:"flex-start"},null==m||null===(r=m.filePreviewStyle)||void 0===r?void 0:r.root],children:t(l,{style:{gap:8},children:[function(){if(0===b.length)return null;if(1===b.length){var n=b[0];return n?t(a,{onPress:function(){return S(0)},style:{position:"relative"},children:[C(n),P(n.uri)]}):null}var r=b.slice(0,3),o=b.length>3?b.length-3:0;return e(l,{style:{flexDirection:"row",alignItems:"center",minHeight:68},children:r.map((function(n,i){var s=2===r.length?0===i?"-4deg":"4deg":0===i?"-10deg":1===i?"0deg":"10deg",c=2===r.length?0===i?"4deg":"-4deg":0===i?"10deg":1===i?"0deg":"-10deg";return e(a,{onPress:function(){var e=pn(b).findIndex((function(e){return e.uri===n.uri}));S(e>=0?e:0)},style:{marginLeft:0===i?0:-18,zIndex:i+1,transform:[{rotate:s}],position:"relative"},children:t(l,{style:{position:"relative"},children:[C(n),2===i&&o>0&&e(l,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:12,backgroundColor:"rgba(0,0,0,0.55)",alignItems:"center",justifyContent:"center"},children:t(u,{style:{color:"#fff",fontWeight:"700",fontSize:14},children:["+",o]})}),P(n.uri,c)]})},"".concat(n.uri,"-").concat(i))}))})}(),w.length>0&&e(y,{scrollEnabled:w.length>3,style:{maxHeight:232},showsVerticalScrollIndicator:w.length>3,contentContainerStyle:{gap:8},nestedScrollEnabled:!0,children:w.map((function(n,r){return function(n,r){var o,i,a,u;return t(l,{style:{position:"relative"},children:[t(l,{style:[{backgroundColor:"white",width:240,minHeight:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==m||null===(o=m.filePreviewStyle)||void 0===o?void 0:o.container],children:[e(l,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==m||null===(i=m.filePreviewStyle)||void 0===i?void 0:i.iconContainer],children:d?e(d,{}):e(dn,{style:{width:40,height:40},fill:"white"})}),e(l,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==m||null===(a=m.filePreviewStyle)||void 0===a?void 0:a.nameContainer],children:e(yn,{fileName:n.name||"File",style:null==m||null===(u=m.filePreviewStyle)||void 0===u?void 0:u.text})})]}),P(n.uri)]},"".concat(n.uri,"-").concat(r))}(n,r)}))})]})})},Tn=w.memo(En),Rn="ios"===r.OS?32:30,_n="ios"===r.OS?50:48,zn="h-6 w-6",Vn=function(n){var o,i,u,s,c,d,f,y,h,v,m,g,w,S=n.onSendMessage,C=n.onTypingStart,P=n.onTypingEnd,k=n.onAttachmentPress,M=n.onCameraPress,j=n.onAudioRecordStart,E=n.onAudioRecordEnd,T=n.CustomEmojiIcon,R=n.CustomAttachmentIcon,_=n.CustomCameraIcon,z=n.CustomSendIcon,V=n.CustomMicrophoneIcon,N=n.CustomFileIcon,$=n.CustomImagePreview,F=n.CustomVideoPreview,L=Q(x(""),2),D=L[0],B=L[1],W=Q(x(0),2),q=W[0],H=W[1],U=Q(x({height:Rn,isMultiline:!1}),2),G=U[0],Y=U[1],Z=ie(),J=Z.theme,ee=Z.currentUserId,te=Z.showEmojiButton,ne=Z.showAttachmentsButton,re=Z.showCameraButton,oe=Z.showVoiceRecordButton,le=Z.placeholder,se=Z.previewData,ce=Z.previewItems,de=Z.closePreview,fe=Z.onRemovePreviewItem,ye=O((function(){return null!=ce&&ce.length?ce:se?[se]:[]}),[ce,se]),pe=ye.length>0,he=null==J||null===(o=J.sizes)||void 0===o?void 0:o.inputIconSize,ve=function(e){if("number"==typeof e&&e>0)return{width:e,height:e};var t="string"==typeof e&&e.trim().length>0?e.trim():ae;return b.style(t)}(he),me="number"==typeof(w=he)&&w>0?w:24,ge=0===D.trim().length&&!G.isMultiline,be=Math.max(0,(_n-me)/2),we=ge?{paddingTop:be,paddingBottom:be}:{paddingBottom:be},xe=A((function(){Y({height:Rn,isMultiline:!1}),H((function(e){return e+1}))}),[]),Se=A((function(e){B(e),0===e.length&&xe()}),[xe]),Ce=A((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,Rn),118),n=t>Rn;Y({height:n?t:Rn,isMultiline:n})}),[]),Pe=A((function(){var e=D.trim();(e||pe)&&(S({text:e,senderId:ee}),B(""),xe())}),[D,S,ee,pe,xe]);I((function(){D.trim()?null==C||C():null==P||P()}),[D,C,P]);var Ie=!!D.trim()||pe;return t(l,{style:b(hn||(hn=K(["w-full px-2"]))),children:[pe&&e(Tn,{previews:ye,closePreview:de,onRemoveItem:fe,CustomFileIcon:N,CustomImagePreview:$,CustomVideoPreview:F,inputHeight:G.height}),t(l,{style:[b(vn||(vn=K(["flex-row items-end gap-2"]))),null==J||null===(i=J.inputStyles)||void 0===i?void 0:i.inputSectionContainerStyle],children:[t(l,{style:[b(mn||(mn=K(["flex-1 flex-row bg-white overflow-hidden px-3.5"]))),{minHeight:_n,borderRadius:ge?9999:24,alignItems:ge?"center":"flex-end"},null==J||null===(u=J.inputStyles)||void 0===u?void 0:u.inputContainerStyle],children:[te&&e(l,{style:we,children:e(a,{children:T?e(T,{}):e(an,{style:ve,color:(null==J||null===(s=J.colors)||void 0===s?void 0:s.inputsIconsColor)||"rgba(0,0,0,0.7)"})})}),e(p,{value:D,onChangeText:Se,placeholder:le||"Message",style:ue([b(gn||(gn=K(["bg-transparent flex-1 pl-2"]))),"ios"===r.OS?b(bn||(bn=K(["text-[17px]"]))):b(wn||(wn=K(["text-[16px]"]))),{minHeight:Rn,maxHeight:118,paddingVertical:ge?0:8,marginVertical:ge?(_n-Rn)/2:4},{color:(null==J||null===(c=J.colors)||void 0===c?void 0:c.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==J?void 0:J.fontFamily),placeholderTextColor:(null==J||null===(d=J.colors)||void 0===d?void 0:d.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:G.isMultiline&&D.length>0?"top":"center",onContentSizeChange:Ce},"chat-input-".concat(q)),t(l,{style:[b(xn||(xn=K(["flex-row items-center gap-4"]))),we],children:[ne&&e(a,{onPress:k,children:R?e(R,{}):e(sn,{style:ve,color:(null==J||null===(f=J.colors)||void 0===f?void 0:f.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),re&&!D.trim()&&e(a,{onPress:M,children:_?e(_,{}):e(ln,{style:ve,color:(null==J||null===(y=J.colors)||void 0===y?void 0:y.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),e(a,{style:[b(Sn||(Sn=K(["p-2 rounded-full bg-green-600 justify-center items-center"]))),X({height:_n,width:_n},null==J||null===(h=J.inputStyles)||void 0===h?void 0:h.sendButtonStyle)],onPress:Ie?Pe:j,onLongPress:j,onPressOut:E,children:Ie?z?e(z,{}):e(cn,{style:b.style(zn),color:(null==J||null===(v=J.colors)||void 0===v?void 0:v.sendIconsColor)||"rgba(255,255,255,0.7)"}):oe?V?e(V,{}):e(un,{style:b.style("h-8 w-8"),color:(null==J||null===(m=J.colors)||void 0===m?void 0:m.sendIconsColor)||"rgba(255,255,255,0.7)"}):z?e(z,{}):e(cn,{style:b.style(zn),color:(null==J||null===(g=J.colors)||void 0===g?void 0:g.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},Nn=w.memo(Vn);function $n(n){var r=n.style;return t(j,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:b.style("h-6 w-6 text-black",r),children:[e(_,{x1:"18",y1:"6",x2:"6",y2:"18"}),e(_,{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var Fn,Ln,Dn,Bn,Wn,qn,Hn,Un,Gn,Yn,Xn,Zn,Jn,Qn,Kn,er=function(n){var r=n.gallery,o=n.onClose,i=ie(),s=i.theme,c=i.setIsVideoPlaying,f=P(null),y=Q(x(0),2),p=y[0],m=y[1],g=d(),w=g.width,S=g.height;I((function(){null!=r&&r.items.length&&(m(r.initialIndex),requestAnimationFrame((function(){try{var e;null===(e=f.current)||void 0===e||e.scrollToIndex({index:r.initialIndex,animated:!1})}catch(e){}})))}),[null==r?void 0:r.initialIndex,null==r?void 0:r.items]);var C=A((function(e){var t=Math.round(e.nativeEvent.contentOffset.x/w);m(t);var n=null==r?void 0:r.items[t];c("video"===(null==n?void 0:n.kind))}),[null==r?void 0:r.items,w,c]);return r&&0!==r.items.length?e(h,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:o,children:t(l,{style:[b(Cn||(Cn=K(["flex-1 bg-black"]))),{width:w,height:S}],children:[e(a,{onPress:o,style:b(Pn||(Pn=K(["absolute right-4 top-12 z-20 p-2 rounded-full bg-slate-100/70"]))),children:e($n,{style:b(In||(In=K(["h-8 w-8"])))})}),r.items.length>1&&e(l,{style:b(On||(On=K(["absolute top-14 left-0 right-0 z-10 items-center"]))),children:t(u,{style:ue(b(An||(An=K(["text-white/90 text-sm bg-black/40 px-3 py-1 rounded-full"]))),null==s?void 0:s.fontFamily),children:[p+1," / ",r.items.length]})}),e(v,{ref:f,data:r.items,horizontal:!0,pagingEnabled:!0,showsHorizontalScrollIndicator:!1,keyExtractor:function(e,t){return"".concat(e.uri,"-").concat(t)},initialScrollIndex:r.initialIndex,getItemLayout:function(e,t){return{length:w,offset:w*t,index:t}},onMomentumScrollEnd:C,onScrollToIndexFailed:function(e){var t=e.index;setTimeout((function(){var e;null===(e=f.current)||void 0===e||e.scrollToIndex({index:t,animated:!1})}),100)},renderItem:function(t){var n=t.item;return e(tr,{item:n,width:w,height:S})}})]})}):null},tr=function(n){var r=n.item,i=n.width,a=n.height,s=ie().theme,c=P(null),d=Q(x("video"===r.kind),2),f=d[0],y=d[1],p=Q(x(!1),2),h=p[0],v=p[1];return"image"===r.kind?e(l,{style:{width:i,height:a,justifyContent:"center"},children:e(o,{source:{uri:r.uri},style:{width:i,height:a},resizeMode:"contain"})}):t(l,{style:{width:i,height:a,justifyContent:"center",alignItems:"center",paddingHorizontal:16},children:[e(L,{source:{uri:r.uri},ref:c,controls:!0,shutterColor:"transparent",style:{width:i-32,height:.55*a,backgroundColor:"#000"},resizeMode:"contain",onLoadStart:function(){y(!0),v(!1)},onLoad:function(){return y(!1)},onBuffer:function(e){var t=e.isBuffering;return y(t)},onError:function(){v(!0),y(!1)}}),f&&e(l,{style:b(kn||(kn=K(["absolute inset-0 items-center justify-center"]))),children:e(Re,{style:b.style("h-14 w-14"),spinning:!0})}),h&&e(l,{style:b(Mn||(Mn=K(["absolute inset-0 items-center justify-center px-6"]))),children:e(u,{style:ue(b(jn||(jn=K(["text-white font-semibold"]))),null==s?void 0:s.fontFamily),children:"Failed to load video"})})]})},nr=w.memo(er),rr=function(n){var r,i,a,s,c=n.typingUsers,d=n.currentUserId,f=ie(),y=f.theme,p=f.showAvatars,h=f.renderCustomTyping,v=f.showBubbleTail,m=c.filter((function(e){return e.id!==d}));if(!m.length)return null;var g=m.slice(0,2),w=m.length-2;return t(l,{style:b(Fn||(Fn=K(["my-1 max-w-[75%] self-start flex-row"]))),children:[p&&t(l,{style:b(Ln||(Ln=K(["flex-row"]))),children:[g.map((function(t,n){var r,i,a;return e(l,{style:[b(Dn||(Dn=K(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:n>0?-10:0,zIndex:g.length+n}],children:t.avatar?e(o,{source:{uri:t.avatar},style:[b(Bn||(Bn=K(["w-full h-full object-cover rounded-full"]))),null==y||null===(r=y.bubbleStyle)||void 0===r?void 0:r.avatarImageStyle]}):e(u,{style:ue([b(Wn||(Wn=K(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==y||null===(i=y.bubbleStyle)||void 0===i?void 0:i.avatarTextStyle],null==y?void 0:y.fontFamily),children:null===(a=t.name)||void 0===a?void 0:a.charAt(0)})},t.id)})),w>0&&e(l,{style:[b(qn||(qn=K(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},X({},null==y||null===(r=y.bubbleStyle)||void 0===r?void 0:r.additionalTypingUsersContainerStyle)],children:t(u,{style:ue([b(Hn||(Hn=K(["text-white text-xs font-semibold"]))),null==y||null===(i=y.bubbleStyle)||void 0===i?void 0:i.additionalTypingUsersTextStyle],null==y?void 0:y.fontFamily),children:["+",w]})})]}),v&&e(te,{style:b.style("w-6 h-6 fill-white mt-[1.25px]",{transform:[{rotate:"180deg"},{translateX:6}]}),color:"".concat((null==y||null===(a=y.colors)||void 0===a?void 0:a.receivedMessageTailColor)||"white")}),e(l,{style:[b(Un||(Un=K(["px-2 my-1 bg-white rounded-tl-none rounded-lg"]))),null==y||null===(s=y.bubbleStyle)||void 0===s?void 0:s.typingContainerStyle],children:h?h():e(l,{style:b(Gn||(Gn=K(["flex-row items-center py-3 px-2 justify-center"]))),children:e(u,{style:ue(b(Yn||(Yn=K(["text-gray-600"]))),null==y?void 0:y.fontFamily),children:"Typing..."})})})]})};var or=function(){var n=ie(),o=n.messages,i=n.currentUserId,a=n.onMessageLongPress,u=n.mediaViewerGallery,s=n.clearMediaViewerGallery,c=n.typingUsers,d=n.onSendMessage,f=n.onTypingStart,y=n.onTypingEnd,p=n.onAttachmentPress,h=n.onAudioRecordEnd,w=n.onAudioRecordStart,S=n.onCameraPress,C=n.renderCustomInput,P=n.CustomEmojiIcon,O=n.CustomAttachmentIcon,A=n.CustomCameraIcon,k=n.CustomMicrophoneIcon,M=n.CustomSendIcon,j=n.CustomFileIcon,E=n.CustomImagePreview,T=n.CustomVideoPreview,R=n.keyboardVerticalOffset,_=void 0===R?0:R,z=n.disableKeyboardAvoiding,V=void 0!==z&&z,N=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Q(x(0),2),n=t[0],o=t[1];return I((function(){if(e){var t="ios"===r.OS?"keyboardWillShow":"keyboardDidShow",n="ios"===r.OS?"keyboardWillHide":"keyboardDidHide",i=m.addListener(t,(function(e){o(e.endCoordinates.height)})),l=m.addListener(n,(function(){return o(0)}));return function(){i.remove(),l.remove()}}o(0)}),[e]),e?n:0}(!V),$=C?C():e(Nn,{onSendMessage:d,onTypingStart:f,onTypingEnd:y,onAttachmentPress:p,onAudioRecordEnd:h,onAudioRecordStart:w,onCameraPress:S,CustomEmojiIcon:P,CustomAttachmentIcon:O,CustomCameraIcon:A,CustomMicrophoneIcon:k,CustomSendIcon:M,CustomFileIcon:j,CustomImagePreview:E,CustomVideoPreview:T}),F=t(l,{style:b(Xn||(Xn=K(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e(v,{style:b(Zn||(Zn=K(["flex-1"]))),data:o,keyExtractor:function(e){return e.id},renderItem:function(t){var n,r=t.item,l=t.index;return e(on,{message:r,isCurrentUser:r.senderId===i,onLongPress:function(){return null==a?void 0:a(r)},isFirstInSequence:l===o.length-1||(null===(n=o[l+1])||void 0===n?void 0:n.senderId)!==r.senderId})},ListHeaderComponent:e(rr,{typingUsers:c||[],currentUserId:i}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e(l,{style:!V&&N>0?{marginBottom:N}:void 0,children:$}),e(nr,{gallery:u,onClose:s})]});return V?e(l,{style:b(Jn||(Jn=K(["flex-1"]))),children:F}):"android"===r.OS?e(l,{style:b(Qn||(Qn=K(["flex-1"]))),children:F}):e(g,{style:b(Kn||(Kn=K(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:_,children:F})},ir=function(t){return e(be,{children:e(oe,X(X({},t),{},{children:e(or,{})}))})};export{ir as default};
15
15
  //# sourceMappingURL=index.js.map