movius-chats 1.5.13 → 1.5.14

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.
@@ -13,5 +13,5 @@ var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toS
13
13
  object-assign
14
14
  (c) Sindre Sorhus
15
15
  @license MIT
16
- */function Me(){if(he)return ve;he=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return ve=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),s=1;s<arguments.length;s++){for(var A in i=Object(arguments[s]))t.call(i,A)&&(a[A]=i[A]);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},ve}function Pe(){if(pe)return fe;pe=1;return fe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Te(){return ye?me:(ye=1,me=Function.call.bind(Object.prototype.hasOwnProperty))}function Oe(){if(xe)return ge;xe=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=Pe(),n={},r=Te();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,s){if("production"!==process.env.NODE_ENV)for(var A in o)if(r(o,A)){var c;try{if("function"!=typeof o[A]){var u=Error((a||"React class")+": "+l+" type `"+A+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[A]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}c=o[A](i,A,a,l,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((a||"React class")+": type specification of "+l+" `"+A+"` 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 d=s?s():"";e("Failed "+l+" type: "+c.message+(null!=d?d:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},ge=o}function _e(){if(we)return be;we=1;var e=Ie(),t=Me(),n=Pe(),r=Te(),o=Oe(),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){}}),be=function(a,s){var A="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",u={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:v(l),arrayOf:function(e){return v((function(t,r,o,i,l){if("function"!=typeof e)return new C("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[r];if(!Array.isArray(a))return new C("Invalid "+i+" `"+l+"` of type `"+m(a)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<a.length;s++){var A=e(a,s,o,i,l+"["+s+"]",n);if(A instanceof Error)return A}return null}))},element:v((function(e,t,n,r,o){var i=e[t];return a(i)?null:new C("Invalid "+r+" `"+o+"` of type `"+m(i)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:v((function(t,n,r,o,i){var l=t[n];return e.isValidElementType(l)?null:new C("Invalid "+o+" `"+i+"` of type `"+m(l)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return v((function(t,n,r,o,i){if(!(t[n]instanceof e)){var l=e.name||c;return new C("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:v((function(e,t,n,r,o){return p(e[t])?null:new C("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return v((function(t,o,i,l,a){if("function"!=typeof e)return new C("Property `"+a+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var s=t[o],A=m(s);if("object"!==A)return new C("Invalid "+l+" `"+a+"` of type `"+A+"` supplied to `"+i+"`, expected an object.");for(var c in s)if(r(s,c)){var u=e(s,c,i,l,a+"."+c,n);if(u instanceof Error)return u}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 v((function(t,n,r,o,i){for(var l=t[n],a=0;a<e.length;a++)if(d(l,e[a]))return null;var s=JSON.stringify(e,(function(e,t){return"symbol"===y(t)?String(t):t}));return new C("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+r+"`, expected one of "+s+".")}))},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 "+g(o)+" at index "+t+"."),l}return v((function(t,o,i,l,a){for(var s=[],A=0;A<e.length;A++){var c=(0,e[A])(t,o,i,l,a,n);if(null==c)return null;c.data&&r(c.data,"expectedType")&&s.push(c.data.expectedType)}return new C("Invalid "+l+" `"+a+"` supplied to `"+i+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")}))},shape:function(e){return v((function(t,r,o,i,l){var a=t[r],s=m(a);if("object"!==s)return new C("Invalid "+i+" `"+l+"` of type `"+s+"` supplied to `"+o+"`, expected `object`.");for(var A in e){var c=e[A];if("function"!=typeof c)return f(o,i,l,A,y(c));var u=c(a,A,o,i,l+"."+A,n);if(u)return u}return null}))},exact:function(e){return v((function(o,i,l,a,s){var A=o[i],c=m(A);if("object"!==c)return new C("Invalid "+a+" `"+s+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var u=t({},o[i],e);for(var d in u){var v=e[d];if(r(e,d)&&"function"!=typeof v)return f(l,a,s,d,y(v));if(!v)return new C("Invalid "+a+" `"+s+"` key `"+d+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=v(A,d,l,a,s+"."+d,n);if(h)return h}return null}))}};function d(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function C(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function v(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,l,a,A,u,d,v){if(A=A||c,d=d||a,v!==n){if(s){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 f=A+":"+a;!t[f]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+A+"`. 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[f]=!0,r++)}}return null==l[a]?o?null===l[a]?new C("The "+u+" `"+d+"` is marked as required in `"+A+"`, but its value is `null`."):new C("The "+u+" `"+d+"` is marked as required in `"+A+"`, but its value is `undefined`."):null:e(l,a,A,u,d)}var l=o.bind(null,!1);return l.isRequired=o.bind(null,!0),l}function h(e){return v((function(t,n,r,o,i,l){var a=t[n];return m(a)!==e?new C("Invalid "+o+" `"+i+"` of type `"+y(a)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function f(e,t,n,r,o){return new C((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function p(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(p);if(null===e||a(e))return!0;var t=function(e){var t=e&&(A&&e[A]||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(!p(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!p(o[1]))return!1}return!0;default:return!1}}function m(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 y(e){if(null==e)return""+e;var t=m(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function g(e){var t=y(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return C.prototype=Error.prototype,u.checkPropTypes=o,u.resetWarningCache=o.resetWarningCache,u.PropTypes=u,u},be}function Re(){if(ke)return Se;ke=1;var e=Pe();function t(){}function n(){}return n.resetWarningCache=t,Se=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 Ge(){if(Ee)return Ae.exports;if(Ee=1,"production"!==process.env.NODE_ENV){var e=Ie();Ae.exports=_e()(e.isElement,true)}else Ae.exports=Re()();return Ae.exports}var Fe=ae(Ge()),Ve=function(){return v((function e(t,n){C(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=[],s=t.children,A=0;for(n.pattern.lastIndex=0;s&&(o=n.pattern.exec(s));){var c=s.substr(0,o.index);if(A=o.index,++l>i)break;a.push({children:c}),a.push(e.getMatchedPart(n,o[0],o,A)),s=s.substr(o.index+o[0].length),A+=o[0].length-1,n.pattern.lastIndex=0}a.push({children:s}),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)),y(y({},o),{},{children:i,_matched:!0})}}])}(),Ke=["type"],De=["style"],Le=["parse","childrenProps"],Be={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+/},Ue=Fe.shape(y(y({},n.Text.propTypes),{},{type:Fe.oneOf(Object.keys(Be)).isRequired,nonExhaustiveMaxMatchCount:Fe.number})),He=Fe.shape(y(y({},n.Text.propTypes),{},{pattern:Fe.oneOfType([Fe.string,Fe.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:Fe.number})),Ne=function(){function r(){return C(this,r),d(this,r,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&&I(e,t)}(r,t.Component),v(r,[{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=g(e,Ke);if(t){if(!Be[t])throw new Error("".concat(e.type," is not a supported type"));n.pattern=Be[t]}return n}))}},{key:"getParsedText",value:function(){var t=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new Ve(this.props.children,this.getPatterns()).parse().map((function(r,o){var i=t.props.style,l=r.style,a=g(r,De);return e.jsx(n.Text,y(y({style:[i,l]},t.props.childrenProps),a),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var t=this,r=y({},this.props);r.parse,r.childrenProps;var o=g(r,Le);return e.jsx(n.Text,y(y({ref:function(e){return t._root=e}},o),{},{children:this.getParsedText()}))}}])}();function We(e,t){var n;return y(y({},null==e||null===(n=e.reply)||void 0===n?void 0:n.ui),t)}function Ye(e,t,n){var r,o,i=We(e,n);return t?null!==(o=i.sentInlineBackground)&&void 0!==o?o:U(e,!0):null!==(r=i.receivedInlineBackground)&&void 0!==r?r:U(e,!1)}function ze(e,t,n){var r,o,i,l,a,s=We(e,n),A=null==e?void 0:e.colors;return t?null!==(l=null!==(a=s.sentSenderNameColor)&&void 0!==a?a:null==A?void 0:A.sentMessageTextColor)&&void 0!==l?l:"rgba(255,255,255,0.95)":null!==(r=null!==(o=null!==(i=s.receivedSenderNameColor)&&void 0!==i?i:null==A?void 0:A.sentBubbleBackgroundColor)&&void 0!==o?o:null==A?void 0:A.sentMessageTailColor)&&void 0!==r?r:"#22c55e"}function Qe(e,t,n){var r,o,i,l,a,s,A=We(e,n);return t?null!==(l=null!==(a=A.sentPreviewTextColor)&&void 0!==a?a:null==e||null===(s=e.colors)||void 0===s?void 0:s.sentMessageTextColor)&&void 0!==l?l:"rgba(255,255,255,0.85)":null!==(r=null!==(o=A.receivedPreviewTextColor)&&void 0!==o?o:null==e||null===(i=e.colors)||void 0===i?void 0:i.receivedMessageTextColor)&&void 0!==r?r:"rgba(0,0,0,0.75)"}Ne.displayName="ParsedText",Ne.propTypes=y(y({},n.Text.propTypes),{},{parse:Fe.arrayOf(Fe.oneOfType([Ue,He])),childrenProps:Fe.shape(n.Text.propTypes)}),Ne.defaultProps={parse:null,childrenProps:{}};var Xe,Je,qe,$e,Ze,et,tt,nt,rt,ot,it,lt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 12 12",children:e.jsx(o.Path,{fill:"none",stroke:r,strokeLinecap:"round",strokeWidth:"2",d:"M4 2v8m4-8v8"})})},at=function(t){var n=t.style,r=t.color;return e.jsx(o,{viewBox:"0 0 24 24",style:n,children:e.jsxs(o.G,{fill:"none",fillRule:"evenodd",children:[e.jsx(o.Path,{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),e.jsx(o.Path,{fill:r,d:"M5.669 4.76a1.47 1.47 0 0 1 2.04-1.177c1.062.454 3.442 1.533 6.462 3.276c3.021 1.744 5.146 3.267 6.069 3.958c.788.591.79 1.763.001 2.356c-.914.687-3.013 2.19-6.07 3.956c-3.06 1.766-5.412 2.832-6.464 3.28c-.906.387-1.92-.2-2.038-1.177c-.138-1.142-.396-3.735-.396-7.237c0-3.5.257-6.092.396-7.235"})]})})},st=t.createContext(void 0),At=function(n){var r=n.children,o=M(t.useState(null),2),i=o[0],l=o[1];return e.jsx(st.Provider,{value:{currentlyPlayingId:i,setCurrentlyPlayingId:l},children:r})},ct=function(e){var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n<10?"0":"").concat(n)},ut=[1,1.5,2],dt=42;function Ct(t){var o,i,l,a,s,A=t.isPlaying,c=t.playbackRate,u=t.onCycleSpeed,d=t.senderAvatar,C=t.senderName,v=t.isCurrentUser,h=t.theme;return A?e.jsx(n.Pressable,{onPress:u,style:[r(Xe||(Xe=P(["rounded-full items-center justify-center"]))),{width:dt,height:dt,backgroundColor:v?"rgba(0,0,0,0.22)":"rgba(255,255,255,0.12)"},null==h||null===(o=h.messageStyle)||void 0===o?void 0:o.audioSpeedButtonStyle],children:e.jsx(n.Text,{style:J([r(Je||(Je=P(["text-xs font-semibold"]))),{color:W(h,v)},null==h||null===(i=h.messageStyle)||void 0===i?void 0:i.audioSpeedTextStyle],null==h?void 0:h.fontFamily),children:1===c?"1x":"".concat(c,"x")})}):d?e.jsx(n.Image,{source:{uri:d},style:[r(qe||(qe=P(["rounded-full"]))),{width:dt,height:dt},null==h||null===(l=h.bubbleStyle)||void 0===l?void 0:l.avatarImageStyle],resizeMode:"cover"}):e.jsx(n.View,{style:[r($e||($e=P(["rounded-full items-center justify-center"]))),{width:dt,height:dt,backgroundColor:v?"rgba(0,0,0,0.2)":"#9ca3af"}],children:e.jsx(n.Text,{style:J([r(Ze||(Ze=P(["text-base font-semibold capitalize"]))),{color:"#ffffff"}],null==h?void 0:h.fontFamily),children:(a=C,s=null==a?void 0:a.trim(),s?s.charAt(0).toUpperCase():"?")})})}var vt,ht,ft,pt,mt,yt,gt,xt,bt,wt,St,kt,Et,jt,It=function(o){var i,l,s=o.audioUrl,A=o.audioId,c=o.isVideoPlaying,u=o.isCurrentUser,d=o.senderAvatar,C=o.senderName,v=o.reserveStatusSpace,h=void 0===v||v,f=o.onLongPress,p=D(),m=p.theme,g=p.CustomPlayIcon,x=p.CustomPauseIcon,b=p.showMessageStatus,w=function(){var e=t.useContext(st);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),S=w.currentlyPlayingId,k=w.setCurrentlyPlayingId,E=t.useRef(null),j=M(t.useState(!1),2),I=j[0],T=j[1],O=M(t.useState(0),2),_=O[0],R=O[1],G=M(t.useState(0),2),F=G[0],V=G[1],K=M(t.useState(!1),2),B=K[0],U=K[1],H=M(t.useState(1),2),N=H[0],W=H[1],Y=M(t.useState(0),2),z=Y[0],Q=Y[1],X=t.useRef(null),q=t.useMemo((function(){return function(e,t){for(var n=5381,r=0;r<e.length;r++)n=(n<<5)+n+e.charCodeAt(r)|0;return Array.from({length:t},(function(e,t){return n=0|Math.imul(n^n>>>16,73244475+31337*t),n^=n>>>13,.18+Math.abs(n)%100/100*.82}))}(s,50)}),[s]),$=function(e,t){var n,r,o,i,l=L(e);return t?{inactive:null!==(o=null==l?void 0:l.sentAudioWaveformColor)&&void 0!==o?o:"rgba(255,255,255,0.35)",active:null!==(i=null==l?void 0:l.sentAudioWaveformActiveColor)&&void 0!==i?i:"rgba(255,255,255,0.95)"}:{inactive:null!==(n=null==l?void 0:l.receivedAudioWaveformColor)&&void 0!==n?n:"rgba(0,0,0,0.20)",active:null!==(r=null==l?void 0:l.receivedAudioWaveformActiveColor)&&void 0!==r?r:"rgba(0,0,0,0.60)"}}(m,u),Z=$.inactive,ee=$.active,te=function(e,t){var n,r,o,i,l=L(e);return t?null!==(o=null!==(i=null==l?void 0:l.sentAudioTimestampColor)&&void 0!==i?i:null==l?void 0:l.sentTimestampColor)&&void 0!==o?o:"rgba(255,255,255,0.75)":null!==(n=null!==(r=null==l?void 0:l.receivedAudioTimestampColor)&&void 0!==r?r:null==l?void 0:l.receivedTimestampColor)&&void 0!==n?n:"rgba(0,0,0,0.45)"}(m,u),ne=function(e,t){var n,r,o=L(e);return t?null!==(r=null==o?void 0:o.sentAudioPlayIconColor)&&void 0!==r?r:"#ffffff":null!==(n=null==o?void 0:o.receivedAudioPlayIconColor)&&void 0!==n?n:"#374151"}(m,u),re=function(e,t){var n,r,o=L(e);return t?null!==(r=null==o?void 0:o.sentAudioPauseIconColor)&&void 0!==r?r:"#ffffff":null!==(n=null==o?void 0:o.receivedAudioPauseIconColor)&&void 0!==n?n:"#374151"}(m,u),oe=I&&!(c||!!S&&S!==A),ie=F>0?_/F:0,le=t.useCallback((function(e){var t;(V(e.duration),null!==X.current)&&(null===(t=E.current)||void 0===t||t.seek(X.current),X.current=null)}),[]),ae=t.useCallback((function(e){var t=e.currentTime;B||R(t)}),[B]),se=t.useCallback((function(){var e;T(!1),R(0),null===(e=E.current)||void 0===e||e.seek(0),k(null)}),[k]),Ae=t.useCallback((function(){oe?(T(!1),k(null)):(k(A),T(!0))}),[oe,A,k]),ce=t.useCallback((function(){W((function(e){var t=ut.indexOf(e),n=ut[(t+1)%ut.length];return null!=n?n:1}))}),[]),ue=t.useCallback((function(e){var t=z;if(!(t<=0||F<=0)){var n,r=Math.max(0,Math.min(e/t,1))*F;if(R(r),F>0)null===(n=E.current)||void 0===n||n.seek(r);else X.current=r}}),[F,z]),de=t.useMemo((function(){return n.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){U(!0),ue(e.nativeEvent.locationX)},onPanResponderMove:function(e){return ue(e.nativeEvent.locationX)},onPanResponderRelease:function(){return U(!1)},onPanResponderTerminate:function(){return U(!1)}})}),[ue]),Ce=e.jsx(n.Pressable,{onPress:Ae,onLongPress:f,delayLongPress:250,hitSlop:8,style:r(et||(et=P(["shrink-0 px-0.5"]))),children:oe?x?e.jsx(x,{}):e.jsx(lt,{style:r.style("h-6 w-6"),color:re}):g?e.jsx(g,{}):e.jsx(at,{style:r.style("h-6 w-6"),color:ne})}),ve=e.jsx(Ct,{isPlaying:oe,playbackRate:N,onCycleSpeed:ce,senderAvatar:d,senderName:C,isCurrentUser:u,theme:m}),he=e.jsx(n.View,{style:[r(tt||(tt=P(["flex-1 min-w-0"]))),{height:36}],onLayout:function(e){return Q(e.nativeEvent.layout.width)},children:e.jsx(n.View,y(y({style:[{flex:1,flexDirection:"row",alignItems:"center"},null==m||null===(i=m.messageStyle)||void 0===i?void 0:i.progressBarStyle]},de.panHandlers),{},{children:q.map((function(t,r){var o,i=(r+.5)/50<=ie;return e.jsx(n.View,{style:[{flex:1,marginHorizontal:.5,height:Math.max(3,Math.round(36*t)),borderRadius:2,backgroundColor:i?ee:Z},i?null==m||null===(o=m.messageStyle)||void 0===o?void 0:o.activeProgressBarStyle:void 0]},r)}))}))});return e.jsxs(n.View,{style:[r(nt||(nt=P(["min-w-[240px] max-w-[280px] py-1.5 px-1"]))),h&&b&&r(rt||(rt=P(["pb-4"])))],children:[e.jsx(a,{ref:E,source:{uri:s},paused:!oe,rate:N,playInBackground:!1,playWhenInactive:!1,onLoad:le,onProgress:ae,onEnd:se,style:{width:0,height:0},progressUpdateInterval:80}),e.jsx(n.View,{style:r(ot||(ot=P(["flex-row items-center gap-1.5"]))),children:u?e.jsxs(e.Fragment,{children:[ve,Ce,he]}):e.jsxs(e.Fragment,{children:[Ce,he,ve]})}),e.jsx(n.Text,{style:J([r(it||(it=P(["text-[11px] mt-1"]))),{color:te,paddingLeft:u?82:34},null==m||null===(l=m.messageStyle)||void 0===l?void 0:l.audioDurationStyle],null==m?void 0:m.fontFamily),children:ct(oe?_:F>0?F:_)})]})},Mt=t.memo(It),Pt=function(t){var o=t.reply,i=t.fontFamily,l=t.replyStyle,a=t.backgroundColor,s=t.senderNameColor,A=t.previewTextColor,c=t.thumbnailSize,u=void 0===c?40:c,d=t.defaultSenderName,C=void 0===d?"Reply":d,v=function(e){switch(e){case"image":return"📷";case"video":return"🎥";case"audio":return"🎤";case"file":return"📎";default:return null}}(o.mediaKind),h=function(e){if(e.preview)return e.preview;switch(e.mediaKind){case"image":return"Photo";case"video":return"Video";case"audio":return"Audio message";case"file":return"File";default:return"Message"}}(o),f=!!o.thumbnailUri;return e.jsx(n.View,{style:[r(vt||(vt=P(["my-2 rounded-md overflow-hidden"]))),{backgroundColor:a,minHeight:48},null==l?void 0:l.inlineContainer,null==l?void 0:l.container],children:e.jsxs(n.View,{style:r(ht||(ht=P(["flex-1 flex-row items-center px-3 py-2"]))),children:[e.jsxs(n.View,{style:r(ft||(ft=P(["flex-1"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(pt||(pt=P(["text-[13px] font-semibold"]))),{color:s},null==l?void 0:l.senderName],i),children:o.senderName||C}),e.jsx(n.Text,{numberOfLines:2,style:J([r(mt||(mt=P(["text-[12.5px] mt-0.5"]))),{color:A},null==l?void 0:l.previewText],i),children:v&&!o.preview?"".concat(v," ").concat(h):h})]}),f&&e.jsx(n.Image,{source:{uri:o.thumbnailUri},style:[r(yt||(yt=P(["ml-2"]))),{width:u,height:u,borderRadius:4},null==l?void 0:l.thumbnail],resizeMode:"cover"})]})})},Tt=function(r){var i=r.style,l=r.spinning,a=void 0!==l&&l,s=t.useRef(new n.Animated.Value(0)).current;t.useEffect((function(){a&&n.Animated.loop(n.Animated.timing(s,{toValue:1,duration:1e3,easing:n.Easing.linear,useNativeDriver:!0})).start()}),[a]);var A=s.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e.jsx(n.Animated.View,{style:a?{transform:[{rotate:A}]}:void 0,children:e.jsx(o,{style:i,viewBox:"0 0 1024 1024",children:e.jsx(o.Path,{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"})})})},Ot=320,_t=Ot,Rt=Math.round(176),Gt=Ot-Rt-2,Ft=Math.round(159),Vt=function(o){var i,l=o.uri,s=o.cellStyle,A=o.roundedStyle,c=D(),u=c.theme,d=c.CustomPlayIcon,C=t.useRef(null),v=M(t.useState(0),2),h=v[0],f=v[1],p=M(t.useState(!0),2),m=p[0],y=p[1],g=M(t.useState(!1),2),x=g[0],b=g[1];return e.jsxs(n.View,{style:[s,A],pointerEvents:"none",children:[e.jsx(a,{source:{uri:l},ref:C,paused:!0,muted:!0,playInBackground:!1,playWhenInactive:!1,pointerEvents:"none",style:[A,{width:"100%",height:"100%"}],resizeMode:"cover",onLoadStart:function(){y(!0),b(!1)},onLoad:function(e){f(e.duration),y(!1)},onError:function(){b(!0),y(!1)}}),m&&e.jsx(n.View,{style:[r(gt||(gt=P(["absolute inset-0 items-center justify-center bg-black/40"]))),A],children:e.jsx(Tt,{style:r.style("h-8 w-8"),spinning:!0})}),!m&&!x&&e.jsxs(e.Fragment,{children:[e.jsx(n.View,{style:r(xt||(xt=P(["pointer-events-none absolute inset-0 items-center justify-center"]))),children:d?e.jsx(d,{}):e.jsx(at,{style:r.style("h-10 w-10"),color:(null==u||null===(i=u.colors)||void 0===i?void 0:i.videoPlayIconColor)||"white"})}),e.jsx(n.View,{style:r(bt||(bt=P(["pointer-events-none absolute bottom-1 left-1 bg-black/50 px-1.5 py-0.5 rounded"]))),children:e.jsx(n.Text,{style:r(wt||(wt=P(["text-white text-[10px] font-semibold"]))),children:Kt(h)})})]}),x&&e.jsx(n.View,{style:[r(St||(St=P(["absolute inset-0 items-center justify-center bg-red-500/50"]))),A],children:e.jsx(n.Text,{style:J(r(kt||(kt=P(["text-white text-xs"]))),null==u?void 0:u.fontFamily),children:"Video"})})]})};function Kt(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 Dt,Lt,Bt,Ut,Ht,Nt,Wt,Yt,zt,Qt,Xt,Jt,qt,$t,Zt,en,tn,nn,rn,on,ln,an,sn,An,cn,un,dn,Cn,vn=function(t){var o=t.items,i=t.onOpenGallery,l=t.onLongPress,a=n.useWindowDimensions().width,s=Math.min(240,.72*a);if(0===o.length)return null;var A={borderRadius:6,overflow:"hidden"};if(1===o.length){var c=o[0];return e.jsx(n.Pressable,{onPress:function(){return i(o,0)},onLongPress:l,delayLongPress:250,style:{width:s,height:320,marginVertical:8},children:"image"===c.kind?e.jsx(n.Image,{source:{uri:c.uri},style:{width:"100%",height:"100%",borderRadius:8},resizeMode:"cover"}):e.jsx(Vt,{uri:c.uri,cellStyle:{width:s,height:320},roundedStyle:{borderRadius:8}})})}if(2===o.length){var u=(s-2)/2;return e.jsx(n.View,{style:{width:s,height:_t,flexDirection:"row",gap:2,marginVertical:8},children:o.slice(0,2).map((function(t,r){return e.jsx(n.Pressable,{onPress:function(){return i(o,r)},onLongPress:l,delayLongPress:250,style:{width:u,height:_t},children:"image"===t.kind?e.jsx(n.Image,{source:{uri:t.uri},style:[A,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Vt,{uri:t.uri,cellStyle:{width:u,height:_t},roundedStyle:A})},"".concat(t.uri,"-").concat(r))}))})}if(3===o.length){var d=o[0],C=o[1],v=o[2],h=(s-2)/2;return e.jsxs(n.View,{style:{width:s,height:Ot,marginVertical:8,gap:2},children:[e.jsx(n.Pressable,{onPress:function(){return i(o,0)},onLongPress:l,delayLongPress:250,style:{width:s,height:Rt},children:"image"===d.kind?e.jsx(n.Image,{source:{uri:d.uri},style:[A,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Vt,{uri:d.uri,cellStyle:{width:s,height:Rt},roundedStyle:A})}),e.jsxs(n.View,{style:{flexDirection:"row",gap:2,height:Gt},children:[e.jsx(n.Pressable,{onPress:function(){return i(o,1)},onLongPress:l,delayLongPress:250,style:{width:h,height:Gt},children:"image"===C.kind?e.jsx(n.Image,{source:{uri:C.uri},style:[A,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Vt,{uri:C.uri,cellStyle:{width:h,height:Gt},roundedStyle:A})},"".concat(C.uri,"-1")),e.jsx(n.Pressable,{onPress:function(){return i(o,2)},onLongPress:l,delayLongPress:250,style:{width:h,height:Gt},children:"image"===v.kind?e.jsx(n.Image,{source:{uri:v.uri},style:[A,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Vt,{uri:v.uri,cellStyle:{width:h,height:Gt},roundedStyle:A})},"".concat(v.uri,"-2"))]})]})}var f=(s-2)/2,p=o.length-4,m=o.slice(0,4);return e.jsx(n.View,{style:{width:s,height:Ot,flexWrap:"wrap",flexDirection:"row",gap:2,marginVertical:8},children:m.map((function(t,a){return e.jsxs(n.Pressable,{onPress:function(){return i(o,a)},onLongPress:l,delayLongPress:250,style:{width:f,height:Ft,position:"relative"},children:["image"===t.kind?e.jsx(n.Image,{source:{uri:t.uri},style:[A,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Vt,{uri:t.uri,cellStyle:{width:f,height:Ft},roundedStyle:A}),3===a&&p>0&&e.jsx(n.View,{style:r(Et||(Et=P(["absolute inset-0 bg-black/55 items-center justify-center"]))),children:e.jsxs(n.Text,{style:r(jt||(jt=P(["text-white text-lg font-bold"]))),children:["+",p]})})]},"".concat(t.uri,"-").concat(a))}))})},hn=function(o){var i,l,a,s,A,c=o.message,u=o.onGalleryOpen,d=o.isVideoPlaying,C=o.isCurrentUser,v=o.onLongPress,h=D(),f=h.theme,p=h.showMessageStatus,m=h.onFileAttachmentPress,g=h.replyUI,x=h.replyStyle,b=h.renderInlineReply,w=h.selectionMode,S=h.toggleSelection,k=We(f,g),E=y(y({},null==f||null===(i=f.reply)||void 0===i?void 0:i.styles),x),j=t.useMemo((function(){return Q(c)}),[c]),I=c.replyTo?b?b(c.replyTo,C):e.jsx(Pt,{reply:c.replyTo,fontFamily:null==f?void 0:f.fontFamily,replyStyle:E,backgroundColor:Ye(f,C,k),senderNameColor:ze(f,C,k),previewTextColor:Qe(f,C,k),thumbnailSize:k.thumbnailSize,defaultSenderName:k.defaultReplySenderName}):null;return e.jsxs(n.View,{children:[I,j.length>0&&e.jsx(vn,{items:j,onOpenGallery:u,onLongPress:v}),(null!==(l=c.fileAttachments)&&void 0!==l?l:[]).map((function(t,o){var i,l,a,s,A,u;return e.jsxs(n.Pressable,{onPress:function(){w?S(c):m?m(t):n.Linking.openURL(t.uri.startsWith("http")||t.uri.startsWith("file:")?t.uri:"file://".concat(t.uri))},onLongPress:v,delayLongPress:250,style:[r(Dt||(Dt=P(["my-1.5 py-2 px-3 rounded-lg max-w-[220px]"]))),{backgroundColor:U(f,C)},C?null==f||null===(i=f.messageStyle)||void 0===i?void 0:i.sentFileAttachmentStyle:null==f||null===(l=f.messageStyle)||void 0===l?void 0:l.receivedFileAttachmentStyle],children:[e.jsxs(n.Text,{style:J([r(Lt||(Lt=P(["text-xs font-semibold"]))),{color:H(f,C)},C?null==f||null===(a=f.messageStyle)||void 0===a?void 0:a.sentFileAttachmentTextStyle:null==f||null===(s=f.messageStyle)||void 0===s?void 0:s.receivedFileAttachmentTextStyle],null==f?void 0:f.fontFamily),numberOfLines:2,children:["📎 ",t.name]}),e.jsx(n.Text,{style:J([r(Bt||(Bt=P(["text-[10px] mt-0.5"]))),{color:N(f,C)},C?null==f||null===(A=f.messageStyle)||void 0===A?void 0:A.sentFileAttachmentSubtitleStyle:null==f||null===(u=f.messageStyle)||void 0===u?void 0:u.receivedFileAttachmentSubtitleStyle],null==f?void 0:f.fontFamily),children:t.type})]},"".concat(t.uri,"-").concat(o))})),c.audio&&e.jsx(Mt,{audioUrl:c.audio,audioId:c.id,isVideoPlaying:d,isCurrentUser:C,senderAvatar:c.senderAvatar,senderName:c.senderName,reserveStatusSpace:!c.text,onLongPress:v}),c.text&&e.jsx(Ne,{style:J([r(Ut||(Ut=P(["pt-1"]))),r(p?Ht||(Ht=P(["pb-0"])):Nt||(Nt=P(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},C?null==f||null===(a=f.messageStyle)||void 0===a?void 0:a.sentTextStyle:null==f||null===(s=f.messageStyle)||void 0===s?void 0:s.receivedTextStyle,Y(f,C)?{color:Y(f,C)}:void 0],null==f?void 0:f.fontFamily),parse:[{type:"url",style:y({color:"blue",textDecorationLine:"underline"},(A=null==f?void 0:f.fontFamily,A?{fontFamily:A}:void 0)),onPress:function(e){return n.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:c.text})]})},fn=t.memo(hn),pn=function(t){var n=t.style,r=t.fill;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{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"})})},mn=function(t){var n=t.style,r=t.fill;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z",fill:r})})},yn=function(t){var o,i,l,a,s=t.time,A=t.status,c=t.isCurrentUser,u=t.hasText,d=t.hasAudio,C=t.hasGalleryMedia,v=t.hasFileAttachments,h=t.edited,f=D(),p=f.theme,m=f.showMessageStatus,y=f.editedLabel,g=f.editedTextStyle,x=C&&!u&&!d,b=(C||v)&&!u&&!d,w=x?"#ffffff":b?function(e,t){var n,r,o=L(e);return t?null!==(r=null==o?void 0:o.sentTimestampColor)&&void 0!==r?r:"rgba(255, 255, 255, 0.75)":null!==(n=null==o?void 0:o.receivedTimestampColor)&&void 0!==n?n:"rgba(107, 114, 128, 0.85)"}(p,c):function(e,t){var n,r,o=L(e);return t?null!==(r=null==o?void 0:o.sentTimestampColor)&&void 0!==r?r:"rgba(255, 255, 255, 0.75)":null!==(n=null==o?void 0:o.receivedTimestampColor)&&void 0!==n?n:"rgba(107, 114, 128, 0.85)"}(p,c),S=x||b?"rgba(255,255,255,0.85)":w;return e.jsx(e.Fragment,{children:m&&e.jsxs(n.View,{style:[r(Wt||(Wt=P(["flex-row items-center"]))),u?r(Yt||(Yt=P(["justify-end pb-1 ml-4"]))):d?r(zt||(zt=P(["absolute right-3 bottom-2"]))):b?[r(Qt||(Qt=P(["absolute right-3 bottom-4"]))),B(p,c)]:[r(Xt||(Xt=P(["absolute right-3 bottom-4"]))),B(p,c)]],children:[h&&e.jsx(n.Text,{style:J([r(Jt||(Jt=P(["text-[11px] mr-1.5"]))),{fontStyle:"italic",color:S,opacity:.85},null==p||null===(o=p.messageStyle)||void 0===o?void 0:o.editedTextStyle,g],null==p?void 0:p.fontFamily),children:null!=y?y:"edited"}),e.jsx(n.Text,{style:J([r(qt||(qt=P(["text-xs"]))),{color:w}],null==p?void 0:p.fontFamily),children:s}),c&&e.jsxs(n.View,{style:r($t||($t=P(["ml-1 flex-row items-center"]))),children:["sent"===A&&e.jsx(mn,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(i=p.colors)||void 0===i?void 0:i.sentIconColor)||"#6B7280"}),"delivered"===A&&e.jsx(pn,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(l=p.colors)||void 0===l?void 0:l.deliveredIconColor)||"#6B7280"}),"read"===A&&e.jsx(pn,{style:r.style("h-4 w-4",{opacity:.9}),fill:(null==p||null===(a=p.colors)||void 0===a?void 0:a.readIconColor)||"#3B82F6"})]})]})})},gn=t.memo(yn),xn=function(o){var i,l,a,s,A,c,u,d,C,v,h,f,p,m,g=o.message,x=o.isCurrentUser,b=o.isFirstInSequence,w=o.onLongPress,S=o.staticMode,k=void 0!==S&&S,E=D(),j=E.theme,I=E.showAvatars,M=E.showUserNames,T=E.showBubbleTail,O=E.setMediaViewerGallery,_=E.isVideoPlaying,R=E.replyProps,F=E.startReply,V=E.selectionMode,K=E.isSelected,L=E.toggleSelection,B=E.selectionUI,U=y(y({},null==j?void 0:j.selection),B),H=t.useRef(null),N=(null===(i=null==R?void 0:R.enableReply)||void 0===i||i)&&!V&&!k,W=null!==(l=null==R?void 0:R.swipeThreshold)&&void 0!==l?l:60,Y=Q(g),X=(null!==(a=null===(s=g.fileAttachments)||void 0===s?void 0:s.length)&&void 0!==a?a:0)>0&&0===Y.length&&!g.text&&!g.audio,q=K(g.id),$=t.useCallback((function(){var e;k||(V?L(g):null===(e=H.current)||void 0===e||e.measureInWindow((function(e,t,n,r){null==w||w({x:e,y:t,width:n,height:r,isCurrentUser:x,isFirstInSequence:b})})))}),[k,V,L,g,w,x,b]),Z=t.useCallback((function(){V&&L(g)}),[V,L,g]),ee=t.useCallback((function(e,t){V?L(g):O(e,t)}),[V,L,g,O]),te=null==U?void 0:U.rowBackgroundColor,ne=null==U?void 0:U.overlayColor,re=(null==j||null===(A=j.colors)||void 0===A?void 0:A.sentBubbleBackgroundColor)||(null==j||null===(c=j.colors)||void 0===c?void 0:c.sentMessageTailColor)||"#22c55e",oe=ne||bn(re,.32),ie=te||bn(re,.12),ae=[r(Zt||(Zt=P(["px-2 my-1 max-w-[75%] relative"]))),g.replyTo?r(en||(en=P(["w-[75%]"]))):null,r(x?tn||(tn=P(["self-end mr-3"])):nn||(nn=P(["self-start ml-9"]))),r(b?x?rn||(rn=P(["bg-green-500 rounded-tr-none"])):on||(on=P(["bg-white rounded-tl-none"])):x?ln||(ln=P(["bg-green-500"])):an||(an=P(["bg-white"]))),y(y({borderRadius:8},z(j,x)?{backgroundColor:z(j,x)}:{}),x?null==j||null===(u=j.bubbleStyle)||void 0===u?void 0:u.sent:null==j||null===(d=j.bubbleStyle)||void 0===d?void 0:d.received)],se=e.jsxs(e.Fragment,{children:[!x&&b&&I&&e.jsxs(e.Fragment,{children:[e.jsx(n.View,{style:r(sn||(sn=P(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:g.senderAvatar?e.jsx(n.Image,{source:{uri:g.senderAvatar},style:[r(An||(An=P(["w-full h-full rounded-full"]))),null==j||null===(C=j.bubbleStyle)||void 0===C?void 0:C.avatarImageStyle],resizeMode:"cover"}):e.jsx(n.Text,{style:J([r(cn||(cn=P(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==j||null===(v=j.bubbleStyle)||void 0===v?void 0:v.avatarTextStyle],null==j?void 0:j.fontFamily),children:null===(h=g.senderName)||void 0===h?void 0:h.charAt(0)})}),M&&g.senderName&&e.jsx(n.Text,{style:J([r(un||(un=P(["text-sm text-black font-semibold mt-1 capitalize"]))),null==j||null===(f=j.bubbleStyle)||void 0===f?void 0:f.userNameStyle],null==j?void 0:j.fontFamily),children:g.senderName})]}),b&&T&&e.jsx(G,{style:r.style("absolute w-6 h-6",x?"rotate-90 -right-3.5 mt-[1.24px] -top-1":"rotate-180 -left-3.5 mt-[1.5px] -top-[3px]"),color:x?(null==j||null===(p=j.colors)||void 0===p?void 0:p.sentMessageTailColor)||"rgba(34, 197, 94, 1)":(null==j||null===(m=j.colors)||void 0===m?void 0:m.receivedMessageTailColor)||"white"}),e.jsx(fn,{message:g,isCurrentUser:x,isFirstInSequence:b,onGalleryOpen:ee,isVideoPlaying:_,onLongPress:k?void 0:$}),e.jsx(gn,{time:g.time,edited:g.edited,status:x?g.status:void 0,isCurrentUser:x,hasText:!!g.text,hasAudio:!!g.audio,hasGalleryMedia:Y.length>0&&!g.text,hasFileAttachments:X}),!k&&V&&q&&e.jsx(n.View,{pointerEvents:"none",style:[r(dn||(dn=P(["absolute"]))),{top:-4,bottom:-4,left:b&&!x?-16:-4,right:b&&x?-16:-4,backgroundColor:oe,borderRadius:8}]})]});if(k)return e.jsx(n.View,{style:ae,children:se});var Ae=e.jsx(n.Pressable,{ref:H,onLongPress:$,onPress:Z,delayLongPress:250,style:ae,children:se}),ce=null==R?void 0:R.swipe,ue=e.jsx(le,{isCurrentUser:x,enabled:N,swipeThreshold:W,onReply:function(){return F(g)},iconColor:null==ce?void 0:ce.iconColor,iconBackground:null==ce?void 0:ce.iconBackground,iconSize:null==ce?void 0:ce.iconSize,children:Ae});return e.jsx(n.Pressable,{onPress:Z,onLongPress:$,delayLongPress:250,style:[r(Cn||(Cn=P(["w-full"]))),V&&q?{backgroundColor:ie}:null],children:ue})};function bn(e,t){if(e.startsWith("#")){var n=e.slice(1);if(3===n.length&&(n=n.split("").map((function(e){return e+e})).join("")),6===n.length){var r=parseInt(n.slice(0,2),16),o=parseInt(n.slice(2,4),16),i=parseInt(n.slice(4,6),16);return"rgba(".concat(r,", ").concat(o,", ").concat(i,", ").concat(t,")")}}return e.startsWith("rgb(")?e.replace("rgb(","rgba(").replace(")",", ".concat(t,")")):e}var wn=t.memo(xn),Sn=function(t){var n=t.style,r=t.color;return e.jsx(o.Svg,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,children:[e.jsx(o.Circle,{cx:"12",cy:"13",r:"3"}),e.jsx(o.Path,{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.jsx(o.Path,{strokeLinecap:"round",d:"M19 10h-1"})]})})},kn=function(t){var n=t.style,r=t.color;return e.jsxs(o,{width:14,height:14,viewBox:"0 0 24 24",style:n,children:[e.jsx(o.Line,{x1:"18",y1:"6",x2:"6",y2:"18",stroke:r,strokeWidth:2.5,strokeLinecap:"round"}),e.jsx(o.Line,{x1:"6",y1:"6",x2:"18",y2:"18",stroke:r,strokeWidth:2.5,strokeLinecap:"round"})]})},En=function(t){var n=t.style,r=t.color,i=void 0===r?"#FFFFFF":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:i,strokeWidth:"1.5",children:[e.jsx(o.Path,{d:"m15.287 3.152l-.927.927l-8.521 8.52c-.577.578-.866.867-1.114 1.185a6.6 6.6 0 0 0-.749 1.211c-.173.364-.302.752-.56 1.526l-1.094 3.281l-.268.802a1.06 1.06 0 0 0 1.342 1.342l.802-.268l3.281-1.094c.775-.258 1.162-.387 1.526-.56q.647-.308 1.211-.749c.318-.248.607-.537 1.184-1.114l8.521-8.521l.927-.927a3.932 3.932 0 0 0-5.561-5.561Z"}),e.jsx(o.Path,{d:"M14.36 4.078s.116 1.97 1.854 3.708s3.707 1.853 3.707 1.853M4.198 21.678l-1.876-1.876",opacity:".5"})]})})},jn=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:r,children:[e.jsx(o.Path,{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.jsx(o.Ellipse,{cx:"14.509",cy:"9.774",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 14.51 9.774)"}),e.jsx(o.Ellipse,{cx:"8.714",cy:"11.328",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 8.714 11.328)"}),e.jsx(o.Path,{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.jsx(o.Path,{strokeWidth:"1.5",d:"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935"})]})})},In=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,children:[e.jsx(o.Path,{d:"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z"}),e.jsx(o.Path,{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"})]})})},Mn=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,fill:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{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"})})},Pn=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,children:[e.jsx(o.Path,{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.jsx(o.Path,{strokeLinecap:"round",d:"m17.79 6.21l-4.211 4.165",opacity:".5"})]})})};function Tn(){return On.apply(this,arguments)}function On(){return(On=u(R().mark((function e(){var t;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("android"!==n.Platform.OS){e.next=11;break}return e.prev=1,e.next=4,n.PermissionsAndroid.request(n.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,{title:"Microphone Permission",message:"This app needs access to your microphone to record audio.",buttonPositive:"OK"});case 4:return t=e.sent,e.abrupt("return",t===n.PermissionsAndroid.RESULTS.GRANTED);case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",!1);case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}var _n,Rn,Gn,Fn,Vn,Kn,Dn,Ln,Bn,Un,Hn,Nn,Wn,Yn,zn,Qn,Xn,Jn,qn,$n,Zn,er,tr="ios"===n.Platform.OS?50:48,nr="#FFFFFF",rr="#E9EDEF",or=function(t){var n=t.style,r=t.color,i=void 0===r?"#6b7280":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",fill:"none",children:e.jsx(o.Path,{d:"M6 15l6-6 6 6",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},ir=function(t){var n=t.style,r=t.color,i=void 0===r?"#6b7280":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:i,strokeWidth:"1.5",children:[e.jsx(o.Path,{d:"M2 16c0-2.828 0-4.243.879-5.121C3.757 10 5.172 10 8 10h8c2.828 0 4.243 0 5.121.879C22 11.757 22 13.172 22 16s0 4.243-.879 5.121C20.243 22 18.828 22 16 22H8c-2.828 0-4.243 0-5.121-.879C2 20.243 2 18.828 2 16Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M6 10V8a6 6 0 1 1 12 0v2",opacity:".5"})]})})},lr=function(t){var n=t.width,o=t.bottomOffset,i=t.background,a=t.lockColor,s=t.chevronColor,A=t.lockIconSize,c=t.pillAnimatedStyle,u=t.chevronAnimatedStyle,d=t.styleOverride,C=t.renderLockIcon;return e.jsxs(l.View,{style:[r(_n||(_n=P(["absolute items-center justify-center rounded-2xl py-2.5"]))),{width:n,backgroundColor:i,bottom:o,gap:6},d,c],pointerEvents:"none",children:[C?C():e.jsx(ir,{style:{width:A,height:A},color:a}),e.jsx(l.View,{style:u,children:e.jsx(or,{style:{width:14,height:14},color:s})})]})},ar=function(t){var o=t.isHold,a=t.duration,s=t.composedGesture,A=t.micWrapperStyle,c=t.slideTextAnimatedStyle,u=t.lockPillAnimatedStyle,d=t.chevronAnimatedStyle,C=t.primaryColor,v=t.microphoneColor,h=t.timerColor,f=t.cancelTextColor,p=t.holdPillBackground,m=t.lockPillBackground,y=t.lockColor,g=t.chevronColor,x=t.iconSize,b=t.lockIconSize,w=t.inputBarHeight,S=t.micSize,k=t.enableLockRecording,E=t.showSendButton,j=t.onSendPress,I=t.sendButtonBackgroundColor,M=t.sendButtonIconColor,T=t.headerSlot,O=t.renderInputPill,_=t.renderMicIcon,R=t.renderSendIcon,G=t.renderArrowIcon,F=t.renderLockIcon,V=t.containerStyleOverride,K=t.timerTextStyle,D=t.slideTextStyleOverride,L=t.lockPillStyleOverride,B=t.sendButtonStyle,U=t.fontFamily,H={minHeight:w,backgroundColor:p},N={height:S,width:S,backgroundColor:C};return e.jsxs(n.View,{style:[r(Rn||(Rn=P(["flex-row items-end gap-2 relative"]))),V],pointerEvents:"box-none",children:[o?e.jsxs(n.View,{style:[r(Gn||(Gn=P(["flex-1 rounded-3xl overflow-hidden"]))),H],children:[T,e.jsxs(n.View,{style:r(Fn||(Fn=P(["flex-row items-center px-4 flex-1 min-h-[48px]"]))),children:[e.jsx(n.Text,{style:J([r(Vn||(Vn=P(["text-base font-semibold"]))),{color:h,minWidth:42},K],U),numberOfLines:1,children:ct(a)}),e.jsxs(l.View,{style:[r(Kn||(Kn=P(["flex-1 flex-row items-center justify-center gap-1.5"]))),c],children:[G?G():e.jsx(n.Text,{style:J([r(Dn||(Dn=P(["text-base leading-none"]))),{color:f,marginTop:-2}],U),children:"‹"}),e.jsx(n.Text,{style:J([r(Ln||(Ln=P(["text-sm"]))),{color:f},D],U),children:"Slide to cancel"})]})]})]}):null==O?void 0:O(),e.jsxs(n.View,{style:[r(Bn||(Bn=P(["relative items-center justify-center"]))),{height:w,width:w}],children:[k&&o&&e.jsx(lr,{width:S-8,bottomOffset:S+6,background:m,lockColor:y,chevronColor:g,lockIconSize:b,pillAnimatedStyle:u,chevronAnimatedStyle:d,styleOverride:L,renderLockIcon:F}),E&&!o?e.jsx(n.Pressable,{onPress:j,style:[r(Un||(Un=P(["items-center justify-center rounded-full"]))),{height:S,width:S,backgroundColor:null!=I?I:C},B],accessibilityRole:"button",accessibilityLabel:"Send",children:R?R():e.jsx(Pn,{style:{width:x,height:x},color:null!=M?M:v})}):e.jsx(i.GestureDetector,{gesture:s,children:e.jsx(l.View,{style:[r(Hn||(Hn=P(["items-center justify-center rounded-full"]))),N,B,A],accessibilityRole:"button",accessibilityLabel:"Tap to record. Long-press and slide left to cancel or up to lock.",children:_?_():e.jsx(In,{style:{width:x+6,height:x+6},color:v})})})]})]})},sr=function(t){var n=t.style,r=t.color,i=void 0===r?"#ef4444":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:i,strokeLinecap:"round",strokeWidth:"1.5",children:[e.jsx(o.Path,{d:"M9.17 4a3.001 3.001 0 0 1 5.66 0",opacity:".5"}),e.jsx(o.Path,{d:"M20.5 6h-17m15.333 2.5l-.46 6.9c-.177 2.654-.265 3.981-1.13 4.79s-2.195.81-4.856.81h-.774c-2.66 0-3.99 0-4.856-.81c-.865-.809-.953-2.136-1.13-4.79l-.46-6.9"}),e.jsx(o.Path,{d:"m9.5 11l.5 5m4.5-5l-.5 5",opacity:".5"})]})})},Ar=function(t){var o=t.color,i=t.tick,l=t.count;return e.jsx(n.View,{style:r(Nn||(Nn=P(["flex-row items-center justify-between h-6"]))),children:Array.from({length:l}).map((function(t,n){return e.jsx(ur,{index:n,total:l,color:o,tick:i},n)}))})},cr={code:'function WaveformTsx1(){const{tick,index,total}=this.__closure;const t=tick.value*Math.PI*2;const phase1=Math.sin(t*2+index*0.55);const phase2=Math.sin(t*4+index*1.3);const phase3=Math.sin(t*0.9+index*0.27);const combined=(phase1*0.55+phase2*0.3+phase3*0.4)*0.5+0.5;const edge=Math.sin(index/Math.max(1,total-1)*Math.PI);const amp=Math.max(0.18,Math.min(1,combined)*(0.35+0.65*edge));return{height:Math.round(amp*100)+"%"};}',location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/Waveform.tsx",sourceMap:'{"version":3,"names":["WaveformTsx1","tick","index","total","__closure","t","value","Math","PI","phase1","sin","phase2","phase3","combined","edge","max","amp","min","height","round"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/Waveform.tsx"],"mappings":"AAQ2C,SAAAA,YAAMA,CAAA,QAAAC,IAAA,CAAAC,KAAA,CAAAC,KAAA,OAAAC,SAAA,CAEzC,KAAM,CAAAC,CAAC,CAAGJ,IAAI,CAACK,KAAK,CAAGC,IAAI,CAACC,EAAE,CAAG,CAAC,CAClC,KAAM,CAAAC,MAAM,CAAGF,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,CAAC,CAAGH,KAAK,CAAG,IAAI,CAAC,CAC7C,KAAM,CAAAS,MAAM,CAAGJ,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,CAAC,CAAGH,KAAK,CAAG,GAAG,CAAC,CAC5C,KAAM,CAAAU,MAAM,CAAGL,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,GAAG,CAAGH,KAAK,CAAG,IAAI,CAAC,CAC/C,KAAM,CAAAW,QAAQ,CAAG,CAACJ,MAAM,CAAG,IAAI,CAAGE,MAAM,CAAG,GAAG,CAAGC,MAAM,CAAG,GAAG,EAAI,GAAG,CAAG,GAAG,CAC1E,KAAM,CAAAE,IAAI,CAAGP,IAAI,CAACG,GAAG,CAAER,KAAK,CAAGK,IAAI,CAACQ,GAAG,CAAC,CAAC,CAAEZ,KAAK,CAAG,CAAC,CAAC,CAAII,IAAI,CAACC,EAAE,CAAC,CACjE,KAAM,CAAAQ,GAAG,CAAGT,IAAI,CAACQ,GAAG,CAAC,IAAI,CAAER,IAAI,CAACU,GAAG,CAAC,CAAC,CAAEJ,QAAQ,CAAC,EAAI,IAAI,CAAG,IAAI,CAAGC,IAAI,CAAC,CAAC,CACxE,MAAO,CAAEI,MAAM,CAAKX,IAAI,CAACY,KAAK,CAACH,GAAG,CAAG,GAAG,CAAC,IAAI,CAAC,CAClD","ignoreList":[]}',version:"3.16.7"},ur=function(t){var n,o,i=t.index,a=t.total,s=t.color,A=t.tick,c=l.useAnimatedStyle((n=[new global.Error,-4,-27],(o=function(){var e=A.value*Math.PI*2,t=.5*(.55*Math.sin(2*e+.55*i)+.3*Math.sin(4*e+1.3*i)+.4*Math.sin(.9*e+.27*i))+.5,n=Math.sin(i/Math.max(1,a-1)*Math.PI),r=Math.max(.18,Math.min(1,t)*(.35+.65*n));return{height:"".concat(Math.round(100*r),"%")}}).__closure={tick:A,index:i,total:a},o.__workletHash=4276075972187,o.__initData=cr,o.__stackDetails=n,o));return e.jsx(l.View,{style:[r(Wn||(Wn=P(["mx-px rounded-full"]))),{width:2,backgroundColor:s},c]})},dr=function(t){var o=t.duration,a=t.isPaused,s=t.composedGesture,A=t.micWrapperStyle,c=t.pausePulseStyle,u=t.recDotStyle,d=t.waveTick,C=t.onCancelPress,v=t.onTogglePause,h=t.backgroundColor,f=t.timerColor,p=t.waveformColor,m=t.deleteIconColor,y=t.pauseIconColor,g=t.primaryColor,x=t.micSize,b=t.iconSize,w=t.inputBarHeight,S=t.waveCount,k=t.enableWaveform,E=t.headerSlot,j=t.renderDeleteIcon,I=t.renderPauseIcon,M=t.renderPlayIcon,T=t.renderSendIcon,O=t.renderWaveform,_=t.containerStyleOverride,R=t.barStyleOverride,G=t.timerTextStyle,F=t.waveformStyle,V=t.trashButtonStyle,K=t.sendButtonStyle,D=t.fontFamily,L={minHeight:w+50,backgroundColor:h},B={height:x,width:x,backgroundColor:g};return e.jsxs(n.View,{style:[r(Yn||(Yn=P(["w-full rounded-2xl px-4 py-2.5"]))),L,_,R],children:[E,e.jsxs(n.View,{style:r(zn||(zn=P(["flex-row items-center gap-3 px-1 pt-1.5 pb-2"]))),children:[e.jsx(l.View,{style:[r(Qn||(Qn=P(["w-1.5 h-1.5 rounded-full"]))),{backgroundColor:y},u]}),e.jsx(n.Text,{style:J([r(Xn||(Xn=P(["text-base font-semibold"]))),{color:f,minWidth:42},G],D),numberOfLines:1,children:ct(o)}),k&&e.jsx(n.View,{style:[r(Jn||(Jn=P(["flex-1"]))),F],children:O?O():e.jsx(Ar,{color:p,tick:d,count:S})})]}),e.jsxs(n.View,{style:r(qn||(qn=P(["flex-row items-center justify-between mt-1"]))),children:[e.jsx(n.Pressable,{onPress:C,hitSlop:12,style:[r($n||($n=P(["items-center justify-center rounded-full"]))),{width:x,height:x},V],accessibilityRole:"button",accessibilityLabel:"Delete recording",children:j?j():e.jsx(sr,{style:r.style("w-6 h-6"),color:m})}),e.jsx(n.Pressable,{onPress:v,hitSlop:12,style:r(Zn||(Zn=P(["items-center justify-center px-4"]))),accessibilityRole:"button",accessibilityLabel:a?"Resume recording":"Pause recording",children:a?M?M():e.jsx(at,{style:r.style("w-7 h-7"),color:y}):e.jsx(l.View,{style:c,children:I?I():e.jsx(lt,{style:r.style("w-7 h-7"),color:y})})}),e.jsx(i.GestureDetector,{gesture:s,children:e.jsx(l.View,{style:[r(er||(er=P(["items-center justify-center rounded-full"]))),B,K,A],accessibilityRole:"button",accessibilityLabel:"Send recording",children:T?T():e.jsx(Pn,{style:{width:b,height:b},color:"#FFFFFF"})})})]})]})};function Cr(){n.Vibration.vibrate(15)}var vr={code:"function useFlowControllerTs1(_e,success){const{runOnJS,fireQuickTap}=this.__closure;if(success)runOnJS(fireQuickTap)();}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs1","_e","success","runOnJS","fireQuickTap","__closure"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AA0OmB,QAAC,CAAAA,oBAAgBA,CAAAC,EAAA,CAAAC,OAAA,QAAAC,OAAA,CAAAC,YAAA,OAAAC,SAAA,CAExB,GAAIH,OAAO,CACPC,OAAO,CAACC,YAAY,CAAC,CAAC,CAAC,CAC/B","ignoreList":[]}',version:"3.16.7"},hr={code:"function useFlowControllerTs2(){const{runOnJS,fireHoldStart}=this.__closure;runOnJS(fireHoldStart)();}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs2","runOnJS","fireHoldStart","__closure"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAiPqB,SAAAA,oBAAMA,CAAA,QAAAC,OAAA,CAAAC,aAAA,OAAAC,SAAA,CAEfF,OAAO,CAACC,aAAa,CAAC,CAAC,CAAC,CAC5B","ignoreList":[]}',version:"3.16.7"},fr={code:"function useFlowControllerTs3(e){const{stateShared,STATE_HOLD,maxLeftShared,maxUpShared,translateX,translateY,enableLockShared,lockFiredShared,lockThresholdShared,runOnJS,fireLock,enableCancelShared,cancelFiredShared,cancelThresholdShared,fireCancel}=this.__closure;if(stateShared.value!==STATE_HOLD)return;const rawTx=Math.max(maxLeftShared.value,Math.min(0,e.translationX));const rawTy=Math.max(maxUpShared.value,Math.min(0,e.translationY));const dominantY=Math.abs(rawTy)>Math.abs(rawTx);translateX.value=dominantY?0:rawTx;translateY.value=dominantY?rawTy:0;if(dominantY&&enableLockShared.value===1&&lockFiredShared.value===0&&rawTy<=lockThresholdShared.value){lockFiredShared.value=1;runOnJS(fireLock)();}if(!dominantY&&enableCancelShared.value===1&&cancelFiredShared.value===0&&rawTx<=cancelThresholdShared.value){cancelFiredShared.value=1;runOnJS(fireCancel)();}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs3","e","stateShared","STATE_HOLD","maxLeftShared","maxUpShared","translateX","translateY","enableLockShared","lockFiredShared","lockThresholdShared","runOnJS","fireLock","enableCancelShared","cancelFiredShared","cancelThresholdShared","fireCancel","__closure","value","rawTx","Math","max","min","translationX","rawTy","translationY","dominantY","abs"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAqPuB,QAAC,CAAAA,oBAAKA,CAAAC,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,aAAA,CAAAC,WAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,gBAAA,CAAAC,eAAA,CAAAC,mBAAA,CAAAC,OAAA,CAAAC,QAAA,CAAAC,kBAAA,CAAAC,iBAAA,CAAAC,qBAAA,CAAAC,UAAA,OAAAC,SAAA,CAEjB,GAAIf,WAAW,CAACgB,KAAK,GAAKf,UAAU,CAChC,OACJ,KAAM,CAAAgB,KAAK,CAAGC,IAAI,CAACC,GAAG,CAACjB,aAAa,CAACc,KAAK,CAAEE,IAAI,CAACE,GAAG,CAAC,CAAC,CAAErB,CAAC,CAACsB,YAAY,CAAC,CAAC,CACxE,KAAM,CAAAC,KAAK,CAAGJ,IAAI,CAACC,GAAG,CAAChB,WAAW,CAACa,KAAK,CAAEE,IAAI,CAACE,GAAG,CAAC,CAAC,CAAErB,CAAC,CAACwB,YAAY,CAAC,CAAC,CACtE,KAAM,CAAAC,SAAS,CAAGN,IAAI,CAACO,GAAG,CAACH,KAAK,CAAC,CAAGJ,IAAI,CAACO,GAAG,CAACR,KAAK,CAAC,CAGnDb,UAAU,CAACY,KAAK,CAAGQ,SAAS,CAAG,CAAC,CAAGP,KAAK,CACxCZ,UAAU,CAACW,KAAK,CAAGQ,SAAS,CAAGF,KAAK,CAAG,CAAC,CACxC,GAAIE,SAAS,EACTlB,gBAAgB,CAACU,KAAK,GAAK,CAAC,EAC5BT,eAAe,CAACS,KAAK,GAAK,CAAC,EAC3BM,KAAK,EAAId,mBAAmB,CAACQ,KAAK,CAAE,CACpCT,eAAe,CAACS,KAAK,CAAG,CAAC,CACzBP,OAAO,CAACC,QAAQ,CAAC,CAAC,CAAC,CACvB,CACA,GAAI,CAACc,SAAS,EACVb,kBAAkB,CAACK,KAAK,GAAK,CAAC,EAC9BJ,iBAAiB,CAACI,KAAK,GAAK,CAAC,EAC7BC,KAAK,EAAIJ,qBAAqB,CAACG,KAAK,CAAE,CACtCJ,iBAAiB,CAACI,KAAK,CAAG,CAAC,CAC3BP,OAAO,CAACK,UAAU,CAAC,CAAC,CAAC,CACzB,CACJ","ignoreList":[]}',version:"3.16.7"},pr={code:"function useFlowControllerTs4(){const{lockFiredShared,cancelFiredShared,enableLockShared,translateY,LOCK_ON_RELEASE_DELTA,runOnJS,fireLock,fireHoldEnd}=this.__closure;if(lockFiredShared.value===1||cancelFiredShared.value===1)return;if(enableLockShared.value===1&&translateY.value<-LOCK_ON_RELEASE_DELTA){lockFiredShared.value=1;runOnJS(fireLock)();return;}runOnJS(fireHoldEnd)();}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs4","lockFiredShared","cancelFiredShared","enableLockShared","translateY","LOCK_ON_RELEASE_DELTA","runOnJS","fireLock","fireHoldEnd","__closure","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AA+QmB,SAAAA,oBAAMA,CAAA,QAAAC,eAAA,CAAAC,iBAAA,CAAAC,gBAAA,CAAAC,UAAA,CAAAC,qBAAA,CAAAC,OAAA,CAAAC,QAAA,CAAAC,WAAA,OAAAC,SAAA,CAEb,GAAIR,eAAe,CAACS,KAAK,GAAK,CAAC,EAC3BR,iBAAiB,CAACQ,KAAK,GAAK,CAAC,CAC7B,OACJ,GAAIP,gBAAgB,CAACO,KAAK,GAAK,CAAC,EAC5BN,UAAU,CAACM,KAAK,CAAG,CAACL,qBAAqB,CAAE,CAC3CJ,eAAe,CAACS,KAAK,CAAG,CAAC,CACzBJ,OAAO,CAACC,QAAQ,CAAC,CAAC,CAAC,CACnB,OACJ,CACAD,OAAO,CAACE,WAAW,CAAC,CAAC,CAAC,CAC1B","ignoreList":[]}',version:"3.16.7"},mr={code:"function useFlowControllerTs5(){const{lockFiredShared,cancelFiredShared,translateX,withSpring,translateY}=this.__closure;if(lockFiredShared.value===0&&cancelFiredShared.value===0){translateX.value=withSpring(0,{damping:18,stiffness:220});translateY.value=withSpring(0,{damping:18,stiffness:220});}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs5","lockFiredShared","cancelFiredShared","translateX","withSpring","translateY","__closure","value","damping","stiffness"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AA4RwB,SAAAA,oBAAMA,CAAA,QAAAC,eAAA,CAAAC,iBAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,UAAA,OAAAC,SAAA,CAElB,GAAIL,eAAe,CAACM,KAAK,GAAK,CAAC,EAAIL,iBAAiB,CAACK,KAAK,GAAK,CAAC,CAAE,CAC9DJ,UAAU,CAACI,KAAK,CAAGH,UAAU,CAAC,CAAC,CAAE,CAAEI,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CACjEJ,UAAU,CAACE,KAAK,CAAGH,UAAU,CAAC,CAAC,CAAE,CAAEI,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CACrE,CACJ","ignoreList":[]}',version:"3.16.7"},yr={code:"function useFlowControllerTs6(){const{stateShared,STATE_HOLD,translateX,translateY,micScale}=this.__closure;const isHold=stateShared.value===STATE_HOLD;return{transform:[{translateX:isHold?translateX.value:0},{translateY:isHold?translateY.value:0},{scale:micScale.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs6","stateShared","STATE_HOLD","translateX","translateY","micScale","__closure","isHold","value","transform","scale"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAsS6C,SAAAA,oBAAMA,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,QAAA,OAAAC,SAAA,CAC3C,KAAM,CAAAC,MAAM,CAAGN,WAAW,CAACO,KAAK,GAAKN,UAAU,CAC/C,MAAO,CACHO,SAAS,CAAE,CACP,CAAEN,UAAU,CAAEI,MAAM,CAAGJ,UAAU,CAACK,KAAK,CAAG,CAAE,CAAC,CAC7C,CAAEJ,UAAU,CAAEG,MAAM,CAAGH,UAAU,CAACI,KAAK,CAAG,CAAE,CAAC,CAC7C,CAAEE,KAAK,CAAEL,QAAQ,CAACG,KAAM,CAAC,CAEjC,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},gr={code:"function useFlowControllerTs7(){const{interpolate,translateX,cancelThresholdShared,Extrapolation,arrowPulse}=this.__closure;const opacity=interpolate(translateX.value,[0,cancelThresholdShared.value],[1,0],Extrapolation.CLAMP);return{opacity:opacity,transform:[{translateX:translateX.value*0.4+arrowPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs7","interpolate","translateX","cancelThresholdShared","Extrapolation","arrowPulse","__closure","opacity","value","CLAMP","transform"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAgToD,SAAAA,oBAAMA,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,qBAAA,CAAAC,aAAA,CAAAC,UAAA,OAAAC,SAAA,CAClD,KAAM,CAAAC,OAAO,CAAGN,WAAW,CAACC,UAAU,CAACM,KAAK,CAAE,CAAC,CAAC,CAAEL,qBAAqB,CAACK,KAAK,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAEJ,aAAa,CAACK,KAAK,CAAC,CAC5G,MAAO,CACHF,OAAO,CAAPA,OAAO,CACPG,SAAS,CAAE,CAAC,CAAER,UAAU,CAAEA,UAAU,CAACM,KAAK,CAAG,GAAG,CAAGH,UAAU,CAACG,KAAM,CAAC,CACzE,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},xr={code:"function useFlowControllerTs8(){const{interpolate,translateY,lockThresholdShared,Extrapolation}=this.__closure;const lockProgress=interpolate(translateY.value,[0,lockThresholdShared.value],[0,1],Extrapolation.CLAMP);return{transform:[{translateY:interpolate(lockProgress,[0,1],[0,-22])}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs8","interpolate","translateY","lockThresholdShared","Extrapolation","__closure","lockProgress","value","CLAMP","transform"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAuTmD,SAAAA,oBAAMA,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,mBAAA,CAAAC,aAAA,OAAAC,SAAA,CACjD,KAAM,CAAAC,YAAY,CAAGL,WAAW,CAACC,UAAU,CAACK,KAAK,CAAE,CAAC,CAAC,CAAEJ,mBAAmB,CAACI,KAAK,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAEH,aAAa,CAACI,KAAK,CAAC,CAC/G,MAAO,CACHC,SAAS,CAAE,CACP,CAAEP,UAAU,CAAED,WAAW,CAACK,YAAY,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC,CAAE,CAAC,CAEnE,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},br={code:"function useFlowControllerTs9(){const{chevronPulse}=this.__closure;return{transform:[{translateY:chevronPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs9","chevronPulse","__closure","transform","translateY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AA+TkD,SAAAA,qBAAA,QAAAC,YAAA,OAAAC,SAAA,OAAO,CACjDC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAClD,CAAC","ignoreList":[]}',version:"3.16.7"},wr={code:"function useFlowControllerTs10(){const{isPaused,pausePulse}=this.__closure;return{opacity:isPaused?1:pausePulse.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs10","isPaused","pausePulse","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAkU6C,SAAAA,sBAAA,QAAAC,QAAA,CAAAC,UAAA,OAAAC,SAAA,OAAO,CAC5CC,OAAO,CAAEH,QAAQ,CAAG,CAAC,CAAGC,UAAU,CAACG,KACvC,CAAC","ignoreList":[]}',version:"3.16.7"},Sr={code:"function useFlowControllerTs11(){const{recBlink}=this.__closure;return{opacity:recBlink.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs11","recBlink","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAqUyC,SAAAA,sBAAA,QAAAC,QAAA,OAAAC,SAAA,OAAO,CACxCC,OAAO,CAAEF,QAAQ,CAACG,KACtB,CAAC","ignoreList":[]}',version:"3.16.7"};var kr=function(n){var r=n.primaryColor,o=void 0===r?"#16A34A":r,a=n.backgroundColor,s=void 0===a?"#0B141A":a,A=n.holdPillBackground,c=void 0===A?"#1F2C33":A,u=n.timerColor,d=void 0===u?nr:u,C=n.microphoneColor,v=void 0===C?nr:C,h=n.lockColor,f=void 0===h?rr:h,p=n.waveformColor,m=void 0===p?rr:p,y=n.deleteIconColor,g=void 0===y?"#8696A0":y,x=n.cancelTextColor,b=void 0===x?"rgba(255,255,255,0.6)":x,w=n.chevronColor,S=n.pauseIconColor,k=void 0===S?"#F15C6D":S,E=n.lockPillBackground,j=void 0===E?"#1F2C33":E,I=n.inputBarHeight,P=void 0===I?tr:I,T=n.micSize,O=n.holdMicScale,_=void 0===O?1.18:O,R=n.iconSize,G=void 0===R?22:R,F=n.lockIconSize,V=void 0===F?18:F,K=n.enableLockRecording,D=void 0===K||K,L=n.enableSlideToCancel,B=void 0===L||L,U=n.enableWaveform,H=void 0===U||U,N=n.lockSlideDistance,W=void 0===N?70:N,Y=n.cancelSlideDistance,z=void 0===Y?90:Y,Q=n.waveCount,X=void 0===Q?32:Q,J=n.headerSlot,q=n.showSendButton,$=n.onSendPress,Z=n.sendButtonBackgroundColor,ee=n.sendButtonIconColor,te=n.renderInputPill,ne=n.renderMicIcon,re=n.renderSendIcon,oe=n.renderLockIcon,ie=n.renderArrowIcon,le=n.renderDeleteIcon,ae=n.renderPauseIcon,se=n.renderPlayIcon,Ae=n.renderWaveform,ce=n.containerStyle,ue=n.barStyle,de=n.timerTextStyle,Ce=n.slideTextStyle,ve=n.waveformStyle,he=n.lockPillStyle,fe=n.trashButtonStyle,pe=n.sendButtonStyle,me=n.fontFamily,ye=null!=T?T:P,ge=null!=w?w:f,xe=function(e){var n=e.cancelSlideDistance,r=e.lockSlideDistance,o=e.enableLockRecording,a=e.enableSlideToCancel,s=e.holdMicScale,A=e.onRecordingStart,c=e.onRecordingStop,u=e.onSend,d=e.onDelete,C=e.onLock,v=e.onCancel,h=e.onPauseRecording,f=e.onResumeRecording,p=e.onStateChange,m=-Math.abs(n),y=-Math.abs(r),g=m-30,x=y-20,b=M(t.useState("IDLE"),2),w=b[0],S=b[1],k=M(t.useState(0),2),E=k[0],j=k[1],I=M(t.useState(!1),2),P=I[0],T=I[1],O=t.useRef("IDLE"),_=t.useRef(!1);t.useEffect((function(){O.current=w}),[w]),t.useEffect((function(){_.current=P}),[P]);var R=t.useRef(p);R.current=p,t.useEffect((function(){var e;null===(e=R.current)||void 0===e||e.call(R,w)}),[w]);var G=l.useSharedValue(0);t.useEffect((function(){G.value=function(e){switch(e){case"IDLE":return 0;case"RECORDING_TAP":return 1;case"RECORDING_HOLD":return 2;case"LOCKED_RECORDING":return 3;case"SENDING":return 4;case"CANCELLED":return 5}}(w)}),[w]);var F=l.useSharedValue(m),V=l.useSharedValue(y),K=l.useSharedValue(g),D=l.useSharedValue(x),L=l.useSharedValue(o?1:0),B=l.useSharedValue(a?1:0);t.useEffect((function(){F.value=m,V.value=y,K.value=g,D.value=x,L.value=o?1:0,B.value=a?1:0}),[m,y,g,x,o,a]);var U=t.useRef(0),H=t.useRef(0),N=t.useRef(0),W=l.useSharedValue(0),Y=l.useSharedValue(0),z=l.useSharedValue(1),Q=l.useSharedValue(0),X=l.useSharedValue(0),J=l.useSharedValue(1),q=l.useSharedValue(0),$=l.useSharedValue(1),Z=l.useSharedValue(0),ee=l.useSharedValue(0);t.useEffect((function(){Q.value=l.withRepeat(l.withSequence(l.withTiming(-4,{duration:700,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:700,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),X.value=l.withRepeat(l.withSequence(l.withTiming(-4,{duration:600,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:600,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),J.value=l.withRepeat(l.withSequence(l.withTiming(.5,{duration:600,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(1,{duration:600,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),q.value=l.withRepeat(l.withTiming(1,{duration:4500,easing:l.Easing.linear}),-1,!1),$.value=l.withRepeat(l.withSequence(l.withTiming(.3,{duration:600}),l.withTiming(1,{duration:600})),-1,!1)}),[]),t.useEffect((function(){z.value="RECORDING_HOLD"===w?l.withSpring(s,{damping:14,stiffness:220}):l.withSpring(1,{damping:16,stiffness:220})}),[w,s]),t.useEffect((function(){if(("RECORDING_TAP"===w||"RECORDING_HOLD"===w||"LOCKED_RECORDING"===w)&&!P){var e=setInterval((function(){var e=Date.now()-U.current-H.current;j(e/1e3)}),250);return function(){return clearInterval(e)}}}),[w,P]);var te=t.useRef(A);te.current=A;var ne=t.useRef(c);ne.current=c;var re=t.useRef(u);re.current=u;var oe=t.useRef(d);oe.current=d;var ie=t.useRef(C);ie.current=C;var le=t.useRef(v);le.current=v;var ae=t.useRef(h);ae.current=h;var se=t.useRef(f);se.current=f;var Ae=t.useCallback((function(){var e;U.current=Date.now(),H.current=0,N.current=0,T(!1),j(0),Z.value=0,ee.value=0,W.value=0,Y.value=0,null===(e=te.current)||void 0===e||e.call(te)}),[]),ce=t.useCallback((function(){j(0),T(!1),H.current=0,N.current=0,W.value=0,Y.value=0,S("IDLE")}),[]),ue=t.useCallback((function(){var e,t,n=(Date.now()-U.current-H.current)/1e3;S("SENDING"),null===(e=ne.current)||void 0===e||e.call(ne),null===(t=re.current)||void 0===t||t.call(re,{duration:n}),ce()}),[ce]),de=t.useCallback((function(){var e=O.current;if("IDLE"===e)return S("RECORDING_TAP"),void Ae();"RECORDING_TAP"!==e&&"LOCKED_RECORDING"!==e||ue()}),[Ae,ue]),Ce=t.useCallback((function(){"IDLE"===O.current&&(S("RECORDING_HOLD"),Ae())}),[Ae]),ve=t.useCallback((function(){var e;"RECORDING_HOLD"===O.current&&(Cr(),S("LOCKED_RECORDING"),W.value=l.withSpring(0,{damping:18,stiffness:220}),Y.value=l.withSpring(0,{damping:18,stiffness:220}),null===(e=ie.current)||void 0===e||e.call(ie))}),[]),he=t.useCallback((function(){var e,t,n,r=O.current;"RECORDING_HOLD"!==r&&"RECORDING_TAP"!==r&&"LOCKED_RECORDING"!==r||(Cr(),S("CANCELLED"),null===(e=ne.current)||void 0===e||e.call(ne),null===(t=le.current)||void 0===t||t.call(le),null===(n=oe.current)||void 0===n||n.call(oe),ce())}),[ce]),fe=t.useCallback((function(){"RECORDING_HOLD"===O.current&&ue()}),[ue]),pe=t.useCallback((function(){var e,t,n=!_.current;n?(N.current=Date.now(),null===(e=ae.current)||void 0===e||e.call(ae)):(H.current+=Date.now()-N.current,N.current=0,null===(t=se.current)||void 0===t||t.call(se)),T(n)}),[]),me=t.useRef(de);me.current=de;var ye=t.useRef(Ce);ye.current=Ce;var ge=t.useRef(fe);ge.current=fe;var xe=t.useRef(ve);xe.current=ve;var be=t.useRef(he);be.current=he;var we,Se,ke=function(){return me.current()},Ee=function(){return ye.current()},je=function(){return ge.current()},Ie=function(){return xe.current()},Me=function(){return be.current()},Pe=t.useMemo((function(){var e,t,n=i.Gesture.Tap().maxDuration(210).onEnd((e=[new global.Error,-3,-27],(t=function(e,t){t&&l.runOnJS(ke)()}).__closure={runOnJS:l.runOnJS,fireQuickTap:ke},t.__workletHash=0xb640de2a90a,t.__initData=vr,t.__stackDetails=e,t)),r=i.Gesture.Pan().activateAfterLongPress(220).onStart(function(){var e=[new global.Error,-3,-27],t=function(){l.runOnJS(Ee)()};return t.__closure={runOnJS:l.runOnJS,fireHoldStart:Ee},t.__workletHash=3973713390129,t.__initData=hr,t.__stackDetails=e,t}()).onUpdate(function(){var e=[new global.Error,-16,-27],t=function(e){if(2===G.value){var t=Math.max(K.value,Math.min(0,e.translationX)),n=Math.max(D.value,Math.min(0,e.translationY)),r=Math.abs(n)>Math.abs(t);W.value=r?0:t,Y.value=r?n:0,r&&1===L.value&&0===ee.value&&n<=V.value&&(ee.value=1,l.runOnJS(Ie)()),!r&&1===B.value&&0===Z.value&&t<=F.value&&(Z.value=1,l.runOnJS(Me)())}};return t.__closure={stateShared:G,STATE_HOLD:2,maxLeftShared:K,maxUpShared:D,translateX:W,translateY:Y,enableLockShared:L,lockFiredShared:ee,lockThresholdShared:V,runOnJS:l.runOnJS,fireLock:Ie,enableCancelShared:B,cancelFiredShared:Z,cancelThresholdShared:F,fireCancel:Me},t.__workletHash=0xc932b7db4db,t.__initData=fr,t.__stackDetails=e,t}()).onEnd(function(){var e=[new global.Error,-9,-27],t=function(){if(1!==ee.value&&1!==Z.value)return 1===L.value&&Y.value<-12?(ee.value=1,void l.runOnJS(Ie)()):void l.runOnJS(je)()};return t.__closure={lockFiredShared:ee,cancelFiredShared:Z,enableLockShared:L,translateY:Y,LOCK_ON_RELEASE_DELTA:12,runOnJS:l.runOnJS,fireLock:Ie,fireHoldEnd:je},t.__workletHash=8222992215978,t.__initData=pr,t.__stackDetails=e,t}()).onFinalize(function(){var e=[new global.Error,-6,-27],t=function(){0===ee.value&&0===Z.value&&(W.value=l.withSpring(0,{damping:18,stiffness:220}),Y.value=l.withSpring(0,{damping:18,stiffness:220}))};return t.__closure={lockFiredShared:ee,cancelFiredShared:Z,translateX:W,withSpring:l.withSpring,translateY:Y},t.__workletHash=0xb56825c4eba,t.__initData=mr,t.__stackDetails=e,t}());return i.Gesture.Race(n,r)}),[]),Te=l.useAnimatedStyle((we=[new global.Error,-6,-27],(Se=function(){var e=2===G.value;return{transform:[{translateX:e?W.value:0},{translateY:e?Y.value:0},{scale:z.value}]}}).__closure={stateShared:G,STATE_HOLD:2,translateX:W,translateY:Y,micScale:z},Se.__workletHash=0x92736c307cb,Se.__initData=yr,Se.__stackDetails=we,Se)),Oe=l.useAnimatedStyle(function(){var e=[new global.Error,-6,-27],t=function(){return{opacity:l.interpolate(W.value,[0,F.value],[1,0],l.Extrapolation.CLAMP),transform:[{translateX:.4*W.value+Q.value}]}};return t.__closure={interpolate:l.interpolate,translateX:W,cancelThresholdShared:F,Extrapolation:l.Extrapolation,arrowPulse:Q},t.__workletHash=0xf2b5c2efb9e,t.__initData=gr,t.__stackDetails=e,t}()),_e=l.useAnimatedStyle(function(){var e=[new global.Error,-5,-27],t=function(){var e=l.interpolate(Y.value,[0,V.value],[0,1],l.Extrapolation.CLAMP);return{transform:[{translateY:l.interpolate(e,[0,1],[0,-22])}]}};return t.__closure={interpolate:l.interpolate,translateY:Y,lockThresholdShared:V,Extrapolation:l.Extrapolation},t.__workletHash=5669890750044,t.__initData=xr,t.__stackDetails=e,t}()),Re=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{translateY:X.value}]}};return t.__closure={chevronPulse:X},t.__workletHash=0xd07d519242c,t.__initData=br,t.__stackDetails=e,t}()),Ge=l.useAnimatedStyle(function(){var e=[new global.Error,-3,-27],t=function(){return{opacity:P?1:J.value}};return t.__closure={isPaused:P,pausePulse:J},t.__workletHash=0xea4d31d5a5c,t.__initData=wr,t.__stackDetails=e,t}()),Fe=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{opacity:$.value}};return t.__closure={recBlink:$},t.__workletHash=0xd511e0063a5,t.__initData=Sr,t.__stackDetails=e,t}());return{state:w,duration:E,isPaused:P,composedGesture:Pe,waveTick:q,micWrapperStyle:Te,slideTextAnimatedStyle:Oe,lockPillAnimatedStyle:_e,chevronAnimatedStyle:Re,pausePulseStyle:Ge,recDotStyle:Fe,triggerCancel:he,togglePause:pe}}({cancelSlideDistance:z,lockSlideDistance:W,enableLockRecording:D,enableSlideToCancel:B,holdMicScale:_,onRecordingStart:n.onRecordingStart,onRecordingStop:n.onRecordingStop,onSend:n.onSend,onDelete:n.onDelete,onLock:n.onLock,onCancel:n.onCancel,onPauseRecording:n.onPauseRecording,onResumeRecording:n.onResumeRecording,onStateChange:n.onStateChange});return"RECORDING_TAP"===xe.state||"LOCKED_RECORDING"===xe.state||"SENDING"===xe.state?e.jsx(dr,{duration:xe.duration,isPaused:xe.isPaused,composedGesture:xe.composedGesture,micWrapperStyle:xe.micWrapperStyle,pausePulseStyle:xe.pausePulseStyle,recDotStyle:xe.recDotStyle,waveTick:xe.waveTick,onCancelPress:xe.triggerCancel,onTogglePause:xe.togglePause,backgroundColor:s,timerColor:d,waveformColor:m,deleteIconColor:g,pauseIconColor:k,primaryColor:o,micSize:ye,iconSize:G,inputBarHeight:P,waveCount:X,enableWaveform:H,headerSlot:J,renderDeleteIcon:le,renderPauseIcon:ae,renderPlayIcon:se,renderSendIcon:re,renderWaveform:Ae,containerStyleOverride:ce,barStyleOverride:ue,timerTextStyle:de,waveformStyle:ve,trashButtonStyle:fe,sendButtonStyle:pe,fontFamily:me}):e.jsx(ar,{isHold:"RECORDING_HOLD"===xe.state,duration:xe.duration,composedGesture:xe.composedGesture,micWrapperStyle:xe.micWrapperStyle,slideTextAnimatedStyle:xe.slideTextAnimatedStyle,lockPillAnimatedStyle:xe.lockPillAnimatedStyle,chevronAnimatedStyle:xe.chevronAnimatedStyle,primaryColor:o,microphoneColor:v,timerColor:d,cancelTextColor:b,holdPillBackground:c,lockPillBackground:j,lockColor:f,chevronColor:ge,iconSize:G,lockIconSize:V,inputBarHeight:P,micSize:ye,enableLockRecording:D,headerSlot:J,showSendButton:q,onSendPress:$,sendButtonBackgroundColor:Z,sendButtonIconColor:ee,renderInputPill:te,renderMicIcon:ne,renderSendIcon:re,renderArrowIcon:ie,renderLockIcon:oe,containerStyleOverride:ce,timerTextStyle:de,slideTextStyleOverride:Ce,lockPillStyleOverride:he,sendButtonStyle:pe,fontFamily:me})},Er=function(t){var n=t.style,r=t.fill,i=void 0===r?"currentColor":r;return e.jsxs(o,{style:n,viewBox:"0 0 24 24",children:[e.jsx(o.Path,{fill:i,d:"M13 4H6v16h12V9h-5z",opacity:".3"}),e.jsx(o.Path,{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"})]})},jr=function(t){var r=t.fileName,o=t.style,i=D().theme;return e.jsx(n.Text,{numberOfLines:2,ellipsizeMode:"tail",style:J([{fontSize:14,fontWeight:"600",color:"black"},o],null==i?void 0:i.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}(r)})},Ir=t.memo(jr);function Mr(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 Pr,Tr,Or,_r,Rr,Gr,Fr,Vr,Kr,Dr,Lr,Br,Ur,Hr,Nr,Wr,Yr,zr,Qr,Xr,Jr,qr,$r,Zr,eo,to,no,ro,oo,io,lo=function(t){var r,o=t.previews,i=t.closePreview,l=t.onRemoveItem,s=t.CustomFileIcon,A=t.CustomImagePreview,c=t.CustomVideoPreview,u=t.inputHeight,d=D(),C=d.theme,v=d.setMediaViewerGallery,h=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/"))})),f=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/"))})),p=Mr(o);if(0===o.length)return null;var m=function(e){0!==p.length&&v(p,e)},y=function(t){var r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:56,l=null===(r=t.type)||void 0===r?void 0:r.startsWith("image/"),s=null===(o=t.type)||void 0===o?void 0:o.startsWith("video/");return l&&A?e.jsx(A,{uri:t.uri}):s&&c?e.jsx(c,{uri:t.uri}):l?e.jsx(n.Image,{source:{uri:t.uri},style:{width:i,height:i,borderRadius:12},resizeMode:"cover"}):s?e.jsx(n.View,{style:{width:i,height:i,borderRadius:12,overflow:"hidden"},children:e.jsx(a,{source:{uri:t.uri},style:{width:"100%",height:"100%"},resizeMode:"cover",muted:!0,repeat:!0,paused:!1,pointerEvents:"none",playInBackground:!1,playWhenInactive:!1})}):null},g=function(t,r){return e.jsx(n.Pressable,{onPress:function(){return l?l(t):null==i?void 0:i()},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:r?[{rotate:r}]:void 0},children:e.jsx(n.Text,{style:J({fontSize:13,color:"white",fontWeight:"700",lineHeight:14},null==C?void 0:C.fontFamily),children:"×"})})};return e.jsx(n.View,{style:[{position:"absolute",bottom:(null!=u?u:0)+8,zIndex:20,borderRadius:12,maxWidth:"92%",alignSelf:"flex-start"},null==C||null===(r=C.filePreviewStyle)||void 0===r?void 0:r.root],children:e.jsxs(n.View,{style:{gap:8},children:[function(){if(0===h.length)return null;if(1===h.length){var t=h[0];return t?e.jsxs(n.Pressable,{onPress:function(){return m(0)},style:{position:"relative"},children:[y(t),g(t.uri)]}):null}var r=h.slice(0,3),o=h.length>3?h.length-3:0;return e.jsx(n.View,{style:{flexDirection:"row",alignItems:"center",minHeight:68},children:r.map((function(t,i){var l=2===r.length?0===i?"-4deg":"4deg":0===i?"-10deg":1===i?"0deg":"10deg",a=2===r.length?0===i?"4deg":"-4deg":0===i?"10deg":1===i?"0deg":"-10deg";return e.jsx(n.Pressable,{onPress:function(){var e=Mr(h).findIndex((function(e){return e.uri===t.uri}));m(e>=0?e:0)},style:{marginLeft:0===i?0:-18,zIndex:i+1,transform:[{rotate:l}],position:"relative"},children:e.jsxs(n.View,{style:{position:"relative"},children:[y(t),2===i&&o>0&&e.jsx(n.View,{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:e.jsxs(n.Text,{style:{color:"#fff",fontWeight:"700",fontSize:14},children:["+",o]})}),g(t.uri,a)]})},"".concat(t.uri,"-").concat(i))}))})}(),f.length>0&&e.jsx(n.ScrollView,{scrollEnabled:f.length>3,style:{maxHeight:232},showsVerticalScrollIndicator:f.length>3,contentContainerStyle:{gap:8},nestedScrollEnabled:!0,children:f.map((function(t,r){return function(t,r){var o,i,l,a;return e.jsxs(n.View,{style:{position:"relative"},children:[e.jsxs(n.View,{style:[{backgroundColor:"white",width:240,minHeight:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==C||null===(o=C.filePreviewStyle)||void 0===o?void 0:o.container],children:[e.jsx(n.View,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==C||null===(i=C.filePreviewStyle)||void 0===i?void 0:i.iconContainer],children:s?e.jsx(s,{}):e.jsx(Er,{style:{width:40,height:40},fill:"white"})}),e.jsx(n.View,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==C||null===(l=C.filePreviewStyle)||void 0===l?void 0:l.nameContainer],children:e.jsx(Ir,{fileName:t.name||"File",style:null==C||null===(a=C.filePreviewStyle)||void 0===a?void 0:a.text})})]}),g(t.uri)]},"".concat(t.uri,"-").concat(r))}(t,r)}))})]})})},ao=t.memo(lo),so="ios"===n.Platform.OS?32:30,Ao="ios"===n.Platform.OS?50:48,co=function(o){var i,l,a,s,A,c,d,C,v,h,f,p,m,g,x,b,w,S,k,E,j=o.onSendMessage,I=o.onTypingStart,T=o.onTypingEnd,O=o.onAttachmentPress,_=o.onCameraPress,G=o.onAudioRecordStart,F=o.onAudioRecordEnd,V=o.CustomEmojiIcon,K=o.CustomAttachmentIcon,L=o.CustomCameraIcon,B=o.CustomSendIcon,U=o.CustomMicrophoneIcon,H=o.CustomFileIcon,N=o.CustomImagePreview,W=o.CustomVideoPreview,Y=M(t.useState(""),2),z=Y[0],Q=Y[1],q=M(t.useState({height:so,isMultiline:!1}),2),$=q[0],Z=q[1],ee=t.useRef(null),te=D(),ne=te.theme,re=te.currentUserId,oe=te.showEmojiButton,ie=te.showAttachmentsButton,le=te.showCameraButton,ae=te.showVoiceRecordButton,se=te.placeholder,Ae=te.previewData,ce=te.previewItems,ue=te.closePreview,de=te.onRemovePreviewItem,Ce=te.CustomVoiceRecorder,ve=te.replyTarget,he=te.cancelReply,fe=te.replyProps,pe=te.replyUI,me=te.replyStyle,ye=te.renderReplyPreview,ge=te.renderEditPreview,xe=te.CustomClosePreviewIcon,be=te.CustomEditPreviewIcon,we=te.editingMessage,Se=te.cancelEdit,ke=te.onEditMessage,Ee=We(ne,pe),je=y(y({},null==ne||null===(i=ne.reply)||void 0===i?void 0:i.styles),me),Ie=function(e,t){var n;return null!==(n=We(e,t).inputPreviewBackground)&&void 0!==n?n:"rgba(0, 0, 0, 0.08)"}(ne,Ee),Me=function(e,t){var n;return null!==(n=We(e,t).recordingPreviewBackground)&&void 0!==n?n:"rgba(0, 0, 0, 0.08)"}(ne,Ee),Pe=null!==(l=null!==(a=Ee.closeIconColor)&&void 0!==a?a:null==ne||null===(s=ne.colors)||void 0===s?void 0:s.inputsIconsColor)&&void 0!==l?l:"rgba(0,0,0,0.5)",Te=Ee.previewTextColor||"rgba(0,0,0,0.55)",Oe=null!==(A=Ee.thumbnailSize)&&void 0!==A?A:32,_e=t.useRef(null);t.useEffect((function(){var e;we&&we.id!==_e.current?(_e.current=we.id,Q(null!==(e=we.text)&&void 0!==e?e:""),Z({height:so,isMultiline:!1}),requestAnimationFrame((function(){var e;return null===(e=ee.current)||void 0===e?void 0:e.focus()}))):we||(_e.current=null)}),[we]);var Re,Ge=t.useMemo((function(){return null!=ce&&ce.length?ce:Ae?[Ae]:[]}),[ce,Ae]),Fe=Ge.length>0,Ve=null==ne||null===(c=ne.sizes)||void 0===c?void 0:c.inputIconSize,Ke=function(e){if("number"==typeof e&&e>0)return{width:e,height:e};var t="string"==typeof e&&e.trim().length>0?e.trim():X;return r.style(t)}(Ve),De="number"==typeof(Re=Ve)&&Re>0?Re:24,Le=0===z.trim().length&&!$.isMultiline,Be=Math.max(0,(Ao-De)/2),Ue=Le?{paddingTop:Be,paddingBottom:Be}:{paddingBottom:Be},He=!!we,Ne=t.useCallback((function(){Z({height:so,isMultiline:!1})}),[]),Ye=t.useCallback((function(e){Q(e),0===e.length&&Ne()}),[Ne]),ze=t.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,so),118),n=t>so;Z({height:n?t:so,isMultiline:n})}),[]),Qe=t.useCallback((function(){var e,t,n,r,o,i;if(ve){var l=null===(e=ve.mediaItems)||void 0===e?void 0:e[0];return{messageId:ve.id,senderName:ve.senderName,preview:null!==(t=ve.text)&&void 0!==t?t:ve.audio?"🎤 Audio message":ve.image?"📷 Photo":ve.video?"🎥 Video":null!==(n=ve.fileAttachments)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&n.name?"📎 ".concat(ve.fileAttachments[0].name):"",mediaKind:ve.audio?"audio":ve.video?"video":ve.image||(null!==(r=ve.mediaItems)&&void 0!==r?r:[]).some((function(e){return"image"===e.kind}))?"image":(null!==(o=ve.fileAttachments)&&void 0!==o?o:[]).length?"file":void 0,thumbnailUri:null!==(i=ve.image)&&void 0!==i?i:"image"===(null==l?void 0:l.kind)||"video"===(null==l?void 0:l.kind)?l.uri:void 0}}}),[ve]),Xe=t.useCallback((function(){var e=z.trim();if(we){if(!e)return;return null==ke||ke(we,e),Q(""),Ne(),void Se()}(e||Fe)&&(j(y({text:e,senderId:re},ve?{replyTo:Qe()}:{})),Q(""),Ne(),ve&&he())}),[z,j,re,Fe,Ne,ve,Qe,he,we,ke,Se]);t.useEffect((function(){z.trim()?null==I||I():null==T||T()}),[z,I,T]);var Je=!!z.trim()||Fe||He,qe=null==ne?void 0:ne.voiceRecorder,$e=null!==(d=null==qe?void 0:qe.ui)&&void 0!==d?d:{},Ze=null==qe?void 0:qe.styles,et=null==qe?void 0:qe.config,tt=t.useCallback((function(e){null==F||F(e)}),[F]),nt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.maxDuration,r=void 0===n?300:n,o=e.onRecordStart,i=e.onRecordEnd,l=M(t.useState("idle"),2),a=l[0],s=l[1],A=M(t.useState(0),2),c=A[0],d=A[1],C=t.useRef(null),v=t.useRef(null),h=t.useRef(0),f=t.useRef(i);f.current=i;var p=t.useRef(o);p.current=o;var m=t.useRef(r);m.current=r;var y=t.useCallback((function(){v.current&&(clearInterval(v.current),v.current=null)}),[]),g=t.useCallback((function(e){y(),v.current=setInterval((function(){h.current+=1,d(h.current),h.current>=m.current&&e()}),1e3)}),[y]),x=t.useCallback(u(R().mark((function e(){var t,n;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,t=require("react-native-audio-record").default,e.next=8;break;case 4:return e.prev=4,e.t0=e.catch(0),console.error("[movius-chats] Voice recording requires react-native-audio-record. Install it: yarn add react-native-audio-record"),e.abrupt("return");case 8:return e.next=10,Tn();case 10:if(e.sent){e.next=14;break}return console.warn("[movius-chats] Microphone permission denied."),e.abrupt("return");case 14:try{t.init({sampleRate:16e3,channels:1,bitsPerSample:16,audioSource:6,wavFile:"movius_rec_".concat(Date.now(),".wav")}),t.start(),C.current=t,h.current=0,d(0),s("recording"),g((function(){return k.current()})),null===(n=p.current)||void 0===n||n.call(p)}catch(e){console.warn("[movius-chats] Failed to start recording:",e)}case 15:case"end":return e.stop()}}),e,null,[[0,4]])}))),[g]),b=t.useCallback(u(R().mark((function e(){return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C.current){e.next=2;break}return e.abrupt("return");case 2:try{C.current.stop(),s("paused"),y()}catch(e){console.warn("[movius-chats] Failed to pause:",e)}case 3:case"end":return e.stop()}}),e)}))),[y]),w=t.useCallback(u(R().mark((function e(){return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C.current){e.next=2;break}return e.abrupt("return");case 2:try{C.current.start(),s("recording"),g((function(){return k.current()}))}catch(e){console.warn("[movius-chats] Failed to resume:",e)}case 3:case"end":return e.stop()}}),e)}))),[g]),S=t.useCallback(u(R().mark((function e(){var t,n,r,o,i;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=C.current){e.next=3;break}return e.abrupt("return",null);case 3:return y(),C.current=null,n=h.current,h.current=0,s("idle"),d(0),e.prev=9,e.next=12,t.stop();case 12:if(o=e.sent){e.next=15;break}return e.abrupt("return",null);case 15:return i={uri:o.startsWith("file://")?o:"file://".concat(o),duration:Math.max(1,n),mimeType:"audio/wav"},null===(r=f.current)||void 0===r||r.call(f,i),e.abrupt("return",i);case 20:return e.prev=20,e.t0=e.catch(9),console.warn("[movius-chats] Failed to stop recording:",e.t0),e.abrupt("return",null);case 24:case"end":return e.stop()}}),e,null,[[9,20]])}))),[y]),k=t.useRef(S);k.current=S;var E=t.useCallback((function(){return k.current()}),[]),j=t.useCallback(u(R().mark((function e(){var t,n,r,o;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=C.current,y(),C.current=null,h.current=0,s("idle"),d(0),!t){e.next=25;break}return e.prev=7,e.next=10,t.stop();case 10:if(!(n=e.sent)){e.next=21;break}return e.prev=12,r=require("react-native-fs"),o=n.startsWith("file://")?n.slice(7):n,e.next=17,r.unlink(o);case 17:e.next=21;break;case 19:e.prev=19,e.t0=e.catch(12);case 21:e.next=25;break;case 23:e.prev=23,e.t1=e.catch(7);case 25:case"end":return e.stop()}}),e,null,[[7,23],[12,19]])}))),[y]);return t.useEffect((function(){return function(){y();try{var e;null===(e=C.current)||void 0===e||e.stop()}catch(e){}}}),[y]),{status:a,duration:c,isRecording:"recording"===a,isPaused:"paused"===a,startRecording:x,pauseRecording:b,resumeRecording:w,stopRecording:E,cancelRecording:j}}({maxDuration:null!==(C=null==et?void 0:et.maxDuration)&&void 0!==C?C:300,onRecordStart:G,onRecordEnd:tt}),rt=t.useRef(nt);rt.current=nt;var ot=t.useCallback((function(){rt.current.startRecording()}),[]),it=t.useCallback(u(R().mark((function e(){var t;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,rt.current.stopRecording();case 2:(t=e.sent)&&(j(y({audio:t.uri,senderId:re},ve?{replyTo:Qe()}:{})),ve&&he());case 4:case"end":return e.stop()}}),e)}))),[j,re,ve,Qe,he]),lt=t.useCallback((function(){rt.current.cancelRecording()}),[]),at=t.useCallback((function(){rt.current.pauseRecording()}),[]),st=t.useCallback((function(){rt.current.resumeRecording()}),[]),At=(null==ne||null===(v=ne.inputStyles)||void 0===v||null===(v=v.sendButtonStyle)||void 0===v?void 0:v.backgroundColor)||(null==ne||null===(h=ne.colors)||void 0===h?void 0:h.sentBubbleBackgroundColor)||(null==ne||null===(f=ne.colors)||void 0===f?void 0:f.sentMessageTailColor)||"#22c55e",ct=(null==ne||null===(p=ne.colors)||void 0===p?void 0:p.sendIconsColor)||At,ut=null!==(m=$e.recordingSendButtonBackground)&&void 0!==m?m:At,dt=$e.recordingBackground,Ct=null!==(g=$e.timerColor)&&void 0!==g?g:ct,vt=null!==(x=$e.longPressMicColor)&&void 0!==x?x:ct,ht=null!==(b=$e.waveformColor)&&void 0!==b?b:ct,ft={isRecording:nt.isRecording,isPaused:nt.isPaused,duration:nt.duration,isLocked:!1,slideOffset:{x:0,y:0},waveformData:[],startRecording:nt.startRecording,stopRecording:nt.stopRecording,pauseRecording:nt.pauseRecording,resumeRecording:nt.resumeRecording,cancelRecording:nt.cancelRecording},pt=Ce?Ce(ft):null,mt=null===(w=null==fe?void 0:fe.enableReply)||void 0===w||w,yt=!!ve&&mt&&!He&&!ye,gt=He,xt=yt||gt,bt=t.useMemo((function(){var t,o,i,l,a,s;if(!yt||!ve)return null;var A=null===(t=ve.mediaItems)||void 0===t?void 0:t[0],c=null!==(o=ve.image)&&void 0!==o?o:"image"===(null==A?void 0:A.kind)||"video"===(null==A?void 0:A.kind)?A.uri:void 0,u="";return ve.text?u=ve.text:ve.audio?u="🎤 Audio message":ve.video||"video"===(null==A?void 0:A.kind)?u="🎥 Video":ve.image||"image"===(null==A?void 0:A.kind)?u="📷 Photo":(null!==(i=ve.fileAttachments)&&void 0!==i?i:[]).length&&(u="📎 ".concat(null!==(l=null===(a=ve.fileAttachments)||void 0===a||null===(a=a[0])||void 0===a?void 0:a.name)&&void 0!==l?l:"File")),e.jsxs(n.View,{style:[r(Pr||(Pr=P(["flex-row items-center m-2 rounded-md px-3 py-2"]))),{backgroundColor:Ie||"rgba(0, 0, 0, 0.08)",minHeight:40},null==je?void 0:je.inputPreviewContainer,null==je?void 0:je.container],children:[e.jsxs(n.View,{style:r(Tr||(Tr=P(["flex-1 mr-2"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(Or||(Or=P(["text-[13px] font-semibold"]))),{color:Ee.previewSenderNameColor||At},null==je?void 0:je.senderName],null==ne?void 0:ne.fontFamily),children:ve.senderName||Ee.defaultReplySenderName||"You"}),e.jsx(n.Text,{numberOfLines:null!==(s=null==fe?void 0:fe.previewMaxLines)&&void 0!==s?s:1,style:J([r(_r||(_r=P(["text-[12.5px] mt-0.5"]))),{color:Te},null==je?void 0:je.previewText],null==ne?void 0:ne.fontFamily),children:u})]}),c&&e.jsx(n.Image,{source:{uri:c},style:[{width:Oe,height:Oe,borderRadius:4,marginRight:6},null==je?void 0:je.thumbnail],resizeMode:"cover"}),e.jsx(n.Pressable,{onPress:he,hitSlop:10,style:[r(Rr||(Rr=P(["w-7 h-7 items-center justify-center"]))),null==je?void 0:je.closeButton],children:xe?e.jsx(xe,{}):e.jsx(kn,{color:Pe})})]})}),[yt,ve,null==fe?void 0:fe.previewMaxLines,je,Ee,null==ne?void 0:ne.fontFamily,At,Ie,Te,Oe,Pe,xe,he]),wt=t.useMemo((function(){var t,o,i,l,a;if(!yt||!ve)return null;var s=null===(t=ve.mediaItems)||void 0===t?void 0:t[0],A=null!==(o=ve.image)&&void 0!==o?o:"image"===(null==s?void 0:s.kind)||"video"===(null==s?void 0:s.kind)?s.uri:void 0,c="";return ve.text?c=ve.text:ve.audio?c="🎤 Audio message":ve.video||"video"===(null==s?void 0:s.kind)?c="🎥 Video":ve.image||"image"===(null==s?void 0:s.kind)?c="📷 Photo":(null!==(i=ve.fileAttachments)&&void 0!==i?i:[]).length&&(c="📎 ".concat(null!==(l=null===(a=ve.fileAttachments)||void 0===a||null===(a=a[0])||void 0===a?void 0:a.name)&&void 0!==l?l:"File")),e.jsxs(n.View,{style:[r(Gr||(Gr=P(["flex-row items-center m-2 rounded-md px-3 py-2"]))),{backgroundColor:Me||"rgba(0, 0, 0, 0.08)",minHeight:40},null==je?void 0:je.recordingPreviewContainer],children:[e.jsxs(n.View,{style:r(Fr||(Fr=P(["flex-1 mr-2"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(Vr||(Vr=P(["text-[13px] font-semibold"]))),{color:Ee.previewSenderNameColor||At}],null==ne?void 0:ne.fontFamily),children:ve.senderName||Ee.defaultReplySenderName||"You"}),e.jsx(n.Text,{numberOfLines:1,style:J([r(Kr||(Kr=P(["text-[12.5px] mt-0.5"]))),{color:Ee.previewTextColor||"rgba(0,0,0,0.55)"},null==je?void 0:je.previewText],null==ne?void 0:ne.fontFamily),children:c})]}),A&&e.jsx(n.Image,{source:{uri:A},style:[{width:Oe-2,height:Oe-2,borderRadius:4,marginRight:6},null==je?void 0:je.thumbnail],resizeMode:"cover"}),e.jsx(n.Pressable,{onPress:he,hitSlop:10,style:[r(Dr||(Dr=P(["w-7 h-7 items-center justify-center"]))),null==je?void 0:je.closeButton],children:xe?e.jsx(xe,{}):e.jsx(kn,{color:Pe})})]})}),[yt,ve,ct,null==ne?void 0:ne.fontFamily,Me,je,Ee,Oe,Pe,xe,he]),St=t.useMemo((function(){return gt&&we?ge?ge(we,(function(){Se(),Q(""),Ne()})):e.jsxs(n.View,{style:[r(Lr||(Lr=P(["flex-row items-center m-2 rounded-md px-3 py-2"]))),{backgroundColor:Ie||"rgba(0, 0, 0, 0.08)",minHeight:40},null==je?void 0:je.editPreviewContainer],children:[e.jsx(n.View,{style:r(Br||(Br=P(["mr-2.5"]))),children:be?e.jsx(be,{}):e.jsx(En,{style:{width:16,height:16},color:At})}),e.jsxs(n.View,{style:r(Ur||(Ur=P(["flex-1 mr-2"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(Hr||(Hr=P(["text-[13px] font-semibold"]))),{color:At}],null==ne?void 0:ne.fontFamily),children:Ee.editChipTitle||"Edit message"}),e.jsx(n.Text,{numberOfLines:1,style:J([r(Nr||(Nr=P(["text-[12.5px] mt-0.5"]))),{color:Te},null==je?void 0:je.previewText],null==ne?void 0:ne.fontFamily),children:we.text})]}),e.jsx(n.Pressable,{onPress:function(){Se(),Q(""),Ne()},hitSlop:10,style:[r(Wr||(Wr=P(["w-7 h-7 items-center justify-center"]))),null==je?void 0:je.closeButton],children:xe?e.jsx(xe,{}):e.jsx(kn,{color:Pe})})]}):null}),[gt,we,ge,je,Ee,At,null==ne?void 0:ne.fontFamily,Ie,Te,Pe,xe,be,Se,Ne]),kt=Le&&!xt,Et=t.useCallback((function(){var t,o,i,l,a,s;return e.jsxs(n.View,{style:[r(Yr||(Yr=P(["flex-1 flex-col bg-white overflow-hidden"]))),{minHeight:Ao,borderRadius:kt?9999:24},null==ne||null===(t=ne.inputStyles)||void 0===t?void 0:t.inputContainerStyle],children:[bt,St,e.jsxs(n.View,{style:[r(zr||(zr=P(["flex-row px-3.5"]))),{minHeight:Ao,alignItems:Le?"center":"flex-end"}],children:[oe&&e.jsx(n.View,{style:Ue,children:e.jsx(n.Pressable,{children:V?e.jsx(V,{}):e.jsx(jn,{style:Ke,color:(null==ne||null===(o=ne.colors)||void 0===o?void 0:o.inputsIconsColor)||"rgba(0,0,0,0.7)"})})}),e.jsx(n.TextInput,{ref:ee,value:z,onChangeText:Ye,placeholder:se||"Message",style:J([r(Qr||(Qr=P(["bg-transparent flex-1 pl-2"]))),"ios"===n.Platform.OS?r(Xr||(Xr=P(["text-[17px]"]))):r(Jr||(Jr=P(["text-[16px]"]))),{minHeight:so,maxHeight:118,paddingVertical:Le?0:8,marginVertical:Le?(Ao-so)/2:4},{color:(null==ne||null===(i=ne.colors)||void 0===i?void 0:i.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==ne?void 0:ne.fontFamily),placeholderTextColor:(null==ne||null===(l=ne.colors)||void 0===l?void 0:l.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:$.isMultiline&&z.length>0?"top":"center",onContentSizeChange:ze}),!He&&e.jsxs(n.View,{style:[r(qr||(qr=P(["flex-row items-center gap-4"]))),Ue],children:[ie&&e.jsx(n.Pressable,{onPress:O,children:K?e.jsx(K,{}):e.jsx(Mn,{style:Ke,color:(null==ne||null===(a=ne.colors)||void 0===a?void 0:a.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),le&&!z.trim()&&e.jsx(n.Pressable,{onPress:_,children:L?e.jsx(L,{}):e.jsx(Sn,{style:Ke,color:(null==ne||null===(s=ne.colors)||void 0===s?void 0:s.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]})]})}),[kt,Le,He,z,$.isMultiline,Ue,Ye,ze,se,oe,ie,le,O,_,V,K,L,Ke,ne,bt,St]),jt=t.useCallback((function(){var t;return e.jsx(n.Pressable,{onPress:Xe,style:[r($r||($r=P(["rounded-full justify-center items-center"]))),y({height:Ao,width:Ao,backgroundColor:At},null==ne||null===(t=ne.inputStyles)||void 0===t?void 0:t.sendButtonStyle)],children:B?e.jsx(B,{}):e.jsx(Pn,{style:r.style("h-6 w-6"),color:ct})})}),[Xe,At,ct,null==ne||null===(S=ne.inputStyles)||void 0===S?void 0:S.sendButtonStyle,B]),It=ae&&!pt&&!He,Mt=ve&&mt&&!He&&ye?ye(ve,he):null,Pt={inputBarHeight:Ao,primaryColor:ut,backgroundColor:dt,timerColor:Ct,microphoneColor:vt,waveformColor:ht,holdPillBackground:$e.holdPillBackground,cancelTextColor:$e.cancelTextColor,chevronColor:$e.chevronIconColor,lockColor:$e.lockIconColor,lockPillBackground:$e.lockPillBackground,deleteIconColor:$e.deleteIconColor,pauseIconColor:$e.pauseIconColor,iconSize:$e.iconSize,lockSlideDistance:$e.lockSlideDistance,waveCount:$e.waveformBarCount,enableLockRecording:null==et?void 0:et.enableLockRecording,enableSlideToCancel:null==et?void 0:et.enableSlideToCancel,enableWaveform:null==et?void 0:et.enableWaveform,timerTextStyle:null!==(k=$e.timerTextStyle)&&void 0!==k?k:null==Ze?void 0:Ze.timer,fontFamily:null==ne?void 0:ne.fontFamily,containerStyle:null==Ze?void 0:Ze.container,barStyle:null==Ze?void 0:Ze.bar,slideTextStyle:null==Ze?void 0:Ze.slideText,waveformStyle:null==Ze?void 0:Ze.waveform,lockPillStyle:null==Ze?void 0:Ze.lockPill,trashButtonStyle:null==Ze?void 0:Ze.trashButton,sendButtonStyle:null==Ze?void 0:Ze.sendButton,headerSlot:wt,showSendButton:Je,onSendPress:Xe,sendButtonBackgroundColor:At,sendButtonIconColor:ct,renderInputPill:Et,renderSendIcon:B?function(){return e.jsx(B,{})}:void 0,renderMicIcon:U?function(){return e.jsx(U,{})}:void 0,onRecordingStart:ot,onSend:it,onCancel:lt,onDelete:lt,onPauseRecording:at,onResumeRecording:st};return e.jsxs(n.View,{style:r(Zr||(Zr=P(["w-full px-2"]))),children:[Mt,Fe&&e.jsx(ao,{previews:Ge,closePreview:ue,onRemoveItem:de,CustomFileIcon:H,CustomImagePreview:N,CustomVideoPreview:W,inputHeight:$.height}),e.jsx(n.View,{style:[r(eo||(eo=P(["w-full"]))),null==ne||null===(E=ne.inputStyles)||void 0===E?void 0:E.inputSectionContainerStyle],children:It?e.jsx(kr,y({},Pt)):e.jsxs(n.View,{style:r(to||(to=P(["flex-row items-end gap-2"]))),children:[Et(),Je||!ae?jt():pt?e.jsx(n.View,{style:{height:Ao,width:Ao,justifyContent:"center",alignItems:"center"},children:U?e.jsx(U,{}):e.jsx(In,{style:r.style("h-8 w-8"),color:ct})}):jt()]})}),pt]})},uo=t.memo(co),Co=function(e){var t,n,r,o=null!==(t=null!==(n=e.text)&&void 0!==n?n:null===(r=e.fileAttachments)||void 0===r||null===(r=r[0])||void 0===r?void 0:r.name)&&void 0!==t?t:"";if(!o)return!1;try{var i,l=require("@react-native-clipboard/clipboard"),a=null!==(i=null==l?void 0:l.default)&&void 0!==i?i:l;if(null!=a&&a.setString)return a.setString(o),!0}catch(e){}try{var s,A=require("react-native");if(null!=A&&null!==(s=A.Clipboard)&&void 0!==s&&s.setString)return A.Clipboard.setString(o),!0}catch(e){}return!1},vo=function(t){var n=t.style,r=t.color,i=void 0===r?"#FFFFFF":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:i,strokeWidth:"1.5",children:[e.jsx(o.Path,{d:"M6 11c0-2.828 0-4.243.879-5.121C7.757 5 9.172 5 12 5h3c2.828 0 4.243 0 5.121.879C21 6.757 21 8.172 21 11v5c0 2.828 0 4.243-.879 5.121C19.243 22 17.828 22 15 22h-3c-2.828 0-4.243 0-5.121-.879C6 20.243 6 18.828 6 16z"}),e.jsx(o.Path,{d:"M6 19a3 3 0 0 1-3-3v-6c0-3.771 0-5.657 1.172-6.828S7.229 2 11 2h4a3 3 0 0 1 3 3",opacity:".5"})]})})},ho=function(t){var n=t.style,r=t.color,i=void 0===r?"#FFFFFF":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:i,strokeLinecap:"round",strokeWidth:"1.5",children:[e.jsx(o.Path,{strokeLinejoin:"round",d:"m12.664 5.479l3.973 3.53c1.568 1.395 2.353 2.092 2.353 2.99s-.785 1.596-2.353 2.99l-3.973 3.53c-.716.637-1.074.956-1.369.823S11 18.731 11 17.772v-2.344c-3.6 0-7.5 1.714-9 4.571c0-9.142 5.333-11.428 9-11.428V6.226c0-.958 0-1.437.295-1.57c.295-.132.653.186 1.37.823"}),e.jsx(o.Path,{d:"m15.539 4.5l5.216 4.844a3.897 3.897 0 0 1-.126 5.823l-5.09 4.333",opacity:".5"})]})})},fo=function(t){var n=t.style,r=t.color,i=void 0===r?"#FFFFFF":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:i,strokeLinecap:"round",strokeWidth:"1.5",children:[e.jsx(o.Path,{strokeLinejoin:"round",d:"m14 16l2.1 2.5l3.9-5"}),e.jsx(o.Path,{d:"M21 6H3m18 4H3m7 4H3m7 4H3",opacity:".5"})]})})},po={reply:"Reply",copy:"Copy",edit:"Edit",delete:"Delete",forward:"Forward",select:"Select"},mo={reply:ee,copy:vo,edit:En,delete:sr,forward:ho,select:fo};function yo(e,t){var n;return y(y({},null==e||null===(n=e.messageActions)||void 0===n?void 0:n.ui),t)}function go(e,t){var n;return y(y({},null==e||null===(n=e.messageActions)||void 0===n?void 0:n.labels),t)}function xo(e,t){var n;return y(y(y({},mo),null==e||null===(n=e.messageActions)||void 0===n?void 0:n.icons),t)}var bo,wo,So,ko,Eo=function(o){var i,l,a,s,A,c,u,d,C,v,h=o.message,f=o.anchor,p=o.visible,m=o.onClose,g=o.flags,x=o.ui,b=o.labels,w=o.icons,S=o.fontFamily,k=o.onAction,E=t.useMemo((function(){return yo(void 0,x)}),[x]),j=t.useMemo((function(){return go(void 0,b)}),[b]),I=t.useMemo((function(){return xo(void 0,w)}),[w]),M=t.useMemo((function(){return h?function(e,t,n,r,o){var i,l,a,s,A,c,u,d=y(y({},po),n),C=xo(void 0,r),v=!(null===(i=e.text)||void 0===i||!i.trim());return[{id:"reply",label:d.reply,Icon:null!==(l=C.reply)&&void 0!==l?l:ee},{id:"forward",label:d.forward,Icon:null!==(a=C.forward)&&void 0!==a?a:ho},{id:"copy",label:d.copy,Icon:null!==(s=C.copy)&&void 0!==s?s:vo},{id:"edit",label:d.edit,Icon:null!==(A=C.edit)&&void 0!==A?A:En},{id:"select",label:d.select,Icon:null!==(c=C.select)&&void 0!==c?c:fo},{id:"delete",label:d.delete,Icon:null!==(u=C.delete)&&void 0!==u?u:sr,destructive:!0}].filter((function(e){switch(e.id){case"reply":return!1!==(null==t?void 0:t.enableReply);case"copy":return!1!==(null==t?void 0:t.enableCopy)&&v;case"edit":return!1!==(null==t?void 0:t.enableEdit)&&v&&!!o;case"delete":return!1!==(null==t?void 0:t.enableDelete);case"forward":return!1!==(null==t?void 0:t.enableForward);case"select":return!1!==(null==t?void 0:t.enableSelect);default:return!0}}))}(h,g,j,I,null==f?void 0:f.isCurrentUser):[]}),[h,g,j,I,f]),T=null!==(i=E.width)&&void 0!==i?i:200,O=null!==(l=E.borderRadius)&&void 0!==l?l:12,_=null!==(a=E.backgroundColor)&&void 0!==a?a:"#FFFFFF",R=null!==(s=E.textColor)&&void 0!==s?s:"#111827",G=null!==(A=E.iconColor)&&void 0!==A?A:R,F=null!==(c=E.destructiveColor)&&void 0!==c?c:"#EF4444",V=null!==(u=E.scrimColor)&&void 0!==u?u:"rgba(0,0,0,0.55)",K=null!==(d=E.rowHeight)&&void 0!==d?d:36,D=null!==(C=E.iconSize)&&void 0!==C?C:16,L=null!==(v=E.liftedBubblePaddingHorizontal)&&void 0!==v?v:8,B=t.useMemo((function(){return f?function(e,t,r,o){var i,l=n.Dimensions.get("window"),a=r*o+12;return i=e.isCurrentUser?e.x+e.width-t:e.x,{left:i=Math.max(8,Math.min(i,l.width-t-8)),top:l.height-(e.y+e.height)>=a+8?e.y+e.height+8:Math.max(8,e.y-a-8)}}(f,T,K,M.length):null}),[f,T,K,M.length]);if(!h||!f)return null;var U=Math.max(0,f.y-4);return e.jsx(n.Modal,{visible:p,transparent:!0,animationType:"fade",onRequestClose:m,statusBarTranslucent:!0,children:e.jsxs(n.Pressable,{onPress:m,style:[r(no||(no=P(["flex-1"]))),{backgroundColor:V},E.scrimPressableStyle],children:[e.jsx(n.View,{pointerEvents:"none",style:[{position:"absolute",top:U,left:0,right:0,paddingHorizontal:L}],children:e.jsx(wn,{message:h,isCurrentUser:f.isCurrentUser,isFirstInSequence:f.isFirstInSequence,staticMode:!0})}),B&&e.jsx(n.Pressable,{onPress:function(){},style:[r(ro||(ro=P(["absolute overflow-hidden"]))),{width:T,borderRadius:O,backgroundColor:_,top:B.top,left:B.left,shadowColor:"#000",shadowOpacity:.18,shadowRadius:16,shadowOffset:{width:0,height:6},elevation:6},E.menuStyle],children:M.map((function(t){var o=t.destructive?F:R,i=t.destructive?F:G;return e.jsxs(n.Pressable,{onPress:function(){return k(t.id,h)},android_ripple:{color:"rgba(0,0,0,0.06)"},style:[r(oo||(oo=P(["flex-row items-center px-3"]))),{height:K},E.rowStyle],children:[e.jsx(n.View,{style:{width:D,height:D,marginRight:10},children:e.jsx(t.Icon,{style:{width:D,height:D},color:i})}),e.jsx(n.Text,{style:J([r(io||(io=P(["text-[13px] font-medium"]))),{color:o},E.rowTextStyle],S),children:t.label})]},t.id)}))})]})})};var jo,Io,Mo,Po,To,Oo,_o,Ro,Go,Fo,Vo,Ko,Do,Lo;function Bo(t){var n=t.style;return e.jsxs(o.Svg,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:r.style("h-6 w-6 text-black",n),children:[e.jsx(o.Line,{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx(o.Line,{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var Uo,Ho,No,Wo,Yo,zo,Qo,Xo,Jo,qo,$o,Zo,ei,ti,ni,ri,oi,ii,li,ai=function(o){var i,l=o.gallery,a=o.onClose,s=D(),A=s.theme,c=s.setIsVideoPlaying,u=t.useRef(null),d=null!==(i=null==l?void 0:l.initialIndex)&&void 0!==i?i:0,C=M(t.useState(d),2),v=C[0],h=C[1],f=n.useWindowDimensions(),p=f.width,m=f.height;t.useEffect((function(){if(null!=l&&l.items.length){var e=l.initialIndex;h(e);var t=l.items[e];c("video"===(null==t?void 0:t.kind)),requestAnimationFrame((function(){try{var t;null===(t=u.current)||void 0===t||t.scrollToIndex({index:e,animated:!1})}catch(e){}}))}}),[null==l?void 0:l.initialIndex,null==l?void 0:l.items,c]);var y=t.useCallback((function(){c(!1),a()}),[a,c]),g=t.useCallback((function(e){var t=Math.round(e.nativeEvent.contentOffset.x/p);h(t);var n=null==l?void 0:l.items[t];c("video"===(null==n?void 0:n.kind))}),[null==l?void 0:l.items,p,c]);return l&&0!==l.items.length?e.jsx(n.Modal,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:y,statusBarTranslucent:!0,children:e.jsxs(n.View,{style:[r(_o||(_o=P(["flex-1 bg-black"]))),{width:p,height:m}],children:[e.jsx(n.Pressable,{onPress:y,style:r(Ro||(Ro=P(["absolute right-4 top-12 z-20 p-2 rounded-full bg-slate-100/70"]))),children:e.jsx(Bo,{style:r(Go||(Go=P(["h-8 w-8"])))})}),l.items.length>1&&e.jsx(n.View,{style:r(Fo||(Fo=P(["absolute top-14 left-0 right-0 z-10 items-center"]))),children:e.jsxs(n.Text,{style:J(r(Vo||(Vo=P(["text-white/90 text-sm bg-black/40 px-3 py-1 rounded-full"]))),null==A?void 0:A.fontFamily),children:[v+1," / ",l.items.length]})}),e.jsx(n.FlatList,{ref:u,data:l.items,horizontal:!0,pagingEnabled:!0,showsHorizontalScrollIndicator:!1,keyExtractor:function(e,t){return"".concat(e.uri,"-").concat(t)},initialScrollIndex:l.initialIndex,extraData:v,getItemLayout:function(e,t){return{length:p,offset:p*t,index:t}},onMomentumScrollEnd:g,onScrollToIndexFailed:function(e){var t=e.index;setTimeout((function(){var e;null===(e=u.current)||void 0===e||e.scrollToIndex({index:t,animated:!1})}),100)},renderItem:function(t){var n=t.item,r=t.index;return e.jsx(si,{item:n,width:p,height:m,isActive:r===v,autoPlayVideo:r===d&&"video"===n.kind})}})]})}):null},si=function(o){var i=o.item,l=o.width,s=o.height,A=o.isActive,c=o.autoPlayVideo,u=D().theme,d=t.useRef(null),C=M(t.useState("video"===i.kind),2),v=C[0],h=C[1],f=M(t.useState(!1),2),p=f[0],m=f[1],y="video"===i.kind&&A&&c;return"image"===i.kind?e.jsx(n.View,{style:{width:l,height:s,justifyContent:"center"},children:e.jsx(n.Image,{source:{uri:i.uri},style:{width:l,height:s},resizeMode:"contain"})}):e.jsxs(n.View,{style:{width:l,height:s,justifyContent:"center",alignItems:"center",paddingHorizontal:16},children:[e.jsx(a,{source:{uri:i.uri},ref:d,controls:!0,paused:!y,shutterColor:"transparent",playInBackground:!1,playWhenInactive:!1,style:{width:l-32,height:.55*s,backgroundColor:"#000"},resizeMode:"contain",onLoadStart:function(){h(!0),m(!1)},onLoad:function(){return h(!1)},onBuffer:function(e){var t=e.isBuffering;return h(t)},onError:function(){m(!0),h(!1)}}),v&&e.jsx(n.View,{style:r(Ko||(Ko=P(["absolute inset-0 items-center justify-center"]))),pointerEvents:"none",children:e.jsx(Tt,{style:r.style("h-14 w-14"),spinning:!0})}),p&&e.jsx(n.View,{style:r(Do||(Do=P(["absolute inset-0 items-center justify-center px-6"]))),children:e.jsx(n.Text,{style:J(r(Lo||(Lo=P(["text-white font-semibold"]))),null==u?void 0:u.fontFamily),children:"Failed to load video"})})]})},Ai=t.memo(ai),ci=function(t){var o,i,l,a,s,A=t.typingUsers,c=t.currentUserId,u=D(),d=u.theme,C=u.showAvatars,v=u.renderCustomTyping,h=u.showBubbleTail,f=u.typingText,p=A.filter((function(e){return e.id!==c}));if(!p.length)return null;var m=p.slice(0,2),g=p.length-2,x=C?m.length+(g>0?1:0):0,b=x>0?24+14*Math.max(0,x-1):0,w=x>0?b+12:8,S=-(b+12);return e.jsxs(n.View,{style:[r(Uo||(Uo=P(["px-2 my-1 bg-white rounded-tl-none rounded-lg relative max-w-[75%] self-start"]))),{marginLeft:w},null==d||null===(o=d.bubbleStyle)||void 0===o?void 0:o.typingContainerStyle],children:[C&&x>0&&e.jsxs(n.View,{style:{position:"absolute",top:0,left:S,flexDirection:"row"},children:[m.map((function(t,o){var i,l,a;return e.jsx(n.View,{style:[r(Ho||(Ho=P(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:o>0?-10:0,zIndex:m.length+o}],children:t.avatar?e.jsx(n.Image,{source:{uri:t.avatar},style:[r(No||(No=P(["w-full h-full object-cover rounded-full"]))),null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.avatarImageStyle]}):e.jsx(n.Text,{style:J([r(Wo||(Wo=P(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==d||null===(l=d.bubbleStyle)||void 0===l?void 0:l.avatarTextStyle],null==d?void 0:d.fontFamily),children:null===(a=t.name)||void 0===a?void 0:a.charAt(0)})},t.id)})),g>0&&e.jsx(n.View,{style:[r(Yo||(Yo=P(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},y({},null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.additionalTypingUsersContainerStyle)],children:e.jsxs(n.Text,{style:J([r(zo||(zo=P(["text-white text-xs font-semibold"]))),null==d||null===(l=d.bubbleStyle)||void 0===l?void 0:l.additionalTypingUsersTextStyle],null==d?void 0:d.fontFamily),children:["+",g]})})]}),h&&e.jsx(G,{style:r.style("absolute -top-[3px] w-6 h-6 rotate-180 -left-3.5 mt-[1.5px]"),color:(null==d||null===(a=d.colors)||void 0===a?void 0:a.receivedMessageTailColor)||"white"}),v?v():e.jsx(n.View,{style:r(Qo||(Qo=P(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(n.Text,{style:J([r(Xo||(Xo=P(["text-gray-600"]))),null==d||null===(s=d.bubbleStyle)||void 0===s?void 0:s.typingTextStyle],null==d?void 0:d.fontFamily),children:null!=f?f:"Typing..."})})]})};var ui,di,Ci,vi,hi,fi,pi,mi,yi,gi={code:"function VoiceRecorderTsx1(){const{isPaused,pauseOpacity}=this.__closure;return{opacity:isPaused?1:pauseOpacity.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderTsx1","isPaused","pauseOpacity","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx"],"mappings":"AAiCgD,SAAAA,kBAAA,QAAAC,QAAA,CAAAC,YAAA,OAAAC,SAAA,OAAO,CAC/CC,OAAO,CAAEH,QAAQ,CAAG,CAAC,CAAGC,YAAY,CAACG,KACzC,CAAC","ignoreList":[]}',version:"3.16.7"},xi={code:"function VoiceRecorderTsx2(){const{recBlink}=this.__closure;return{opacity:recBlink.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderTsx2","recBlink","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx"],"mappings":"AAoCyC,SAAAA,kBAAA,QAAAC,QAAA,OAAAC,SAAA,OAAO,CACxCC,OAAO,CAAEF,QAAQ,CAACG,KACtB,CAAC","ignoreList":[]}',version:"3.16.7"},bi=function(o){var i=o.color,a=o.count,s=l.useSharedValue(0);return t.useEffect((function(){s.value=l.withRepeat(l.withTiming(1,{duration:4500,easing:l.Easing.linear}),-1,!1)}),[]),e.jsx(n.View,{style:r(ii||(ii=P(["flex-row items-center justify-between h-6"]))),children:Array.from({length:a}).map((function(t,n){return e.jsx(Si,{index:n,total:a,tick:s,color:i},n)}))})},wi={code:'function VoiceRecorderTsx3(){const{tick,index,total}=this.__closure;const t=tick.value*Math.PI*2;const phase1=Math.sin(t*2+index*0.55);const phase2=Math.sin(t*4+index*1.3);const phase3=Math.sin(t*0.9+index*0.27);const combined=(phase1*0.55+phase2*0.3+phase3*0.4)*0.5+0.5;const edge=Math.sin(index/Math.max(1,total-1)*Math.PI);const amp=Math.max(0.18,Math.min(1,combined)*(0.35+0.65*edge));return{height:Math.round(amp*100)+"%"};}',location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderTsx3","tick","index","total","__closure","t","value","Math","PI","phase1","sin","phase2","phase3","combined","edge","max","amp","min","height","round"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx"],"mappings":"AAuF2C,SAAAA,iBAAMA,CAAA,QAAAC,IAAA,CAAAC,KAAA,CAAAC,KAAA,OAAAC,SAAA,CAEzC,KAAM,CAAAC,CAAC,CAAGJ,IAAI,CAACK,KAAK,CAAGC,IAAI,CAACC,EAAE,CAAG,CAAC,CAClC,KAAM,CAAAC,MAAM,CAAGF,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,CAAC,CAAGH,KAAK,CAAG,IAAI,CAAC,CAC7C,KAAM,CAAAS,MAAM,CAAGJ,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,CAAC,CAAGH,KAAK,CAAG,GAAG,CAAC,CAC5C,KAAM,CAAAU,MAAM,CAAGL,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,GAAG,CAAGH,KAAK,CAAG,IAAI,CAAC,CAC/C,KAAM,CAAAW,QAAQ,CAAG,CAACJ,MAAM,CAAG,IAAI,CAAGE,MAAM,CAAG,GAAG,CAAGC,MAAM,CAAG,GAAG,EAAI,GAAG,CAAG,GAAG,CAC1E,KAAM,CAAAE,IAAI,CAAGP,IAAI,CAACG,GAAG,CAAER,KAAK,CAAGK,IAAI,CAACQ,GAAG,CAAC,CAAC,CAAEZ,KAAK,CAAG,CAAC,CAAC,CAAII,IAAI,CAACC,EAAE,CAAC,CACjE,KAAM,CAAAQ,GAAG,CAAGT,IAAI,CAACQ,GAAG,CAAC,IAAI,CAAER,IAAI,CAACU,GAAG,CAAC,CAAC,CAAEJ,QAAQ,CAAC,EAAI,IAAI,CAAG,IAAI,CAAGC,IAAI,CAAC,CAAC,CACxE,MAAO,CAAEI,MAAM,CAAKX,IAAI,CAACY,KAAK,CAACH,GAAG,CAAG,GAAG,CAAC,IAAI,CAAC,CAClD","ignoreList":[]}',version:"3.16.7"},Si=function(t){var n,o,i=t.index,a=t.total,s=t.tick,A=t.color,c=l.useAnimatedStyle((n=[new global.Error,-4,-27],(o=function(){var e=s.value*Math.PI*2,t=.5*(.55*Math.sin(2*e+.55*i)+.3*Math.sin(4*e+1.3*i)+.4*Math.sin(.9*e+.27*i))+.5,n=Math.sin(i/Math.max(1,a-1)*Math.PI),r=Math.max(.18,Math.min(1,t)*(.35+.65*n));return{height:"".concat(Math.round(100*r),"%")}}).__closure={tick:s,index:i,total:a},o.__workletHash=5267961911334,o.__initData=wi,o.__stackDetails=n,o));return e.jsx(l.View,{style:[r(li||(li=P(["mx-px rounded-full"]))),{width:2,backgroundColor:A},c]})};function ki(){n.Vibration.vibrate(15)}var Ei,ji,Ii,Mi,Pi,Ti,Oi,_i,Ri,Gi,Fi,Vi,Ki={code:"function VoiceRecordingGestureTsx1(){const{cancelFired,lockFired,dragX,dragY}=this.__closure;cancelFired.value=0;lockFired.value=0;dragX.value=0;dragY.value=0;}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx1","cancelFired","lockFired","dragX","dragY","__closure","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAoDiB,SAAAA,yBAAMA,CAAA,QAAAC,WAAA,CAAAC,SAAA,CAAAC,KAAA,CAAAC,KAAA,OAAAC,SAAA,CAEfJ,WAAW,CAACK,KAAK,CAAG,CAAC,CACrBJ,SAAS,CAACI,KAAK,CAAG,CAAC,CACnBH,KAAK,CAACG,KAAK,CAAG,CAAC,CACfF,KAAK,CAACE,KAAK,CAAG,CAAC,CACnB","ignoreList":[]}',version:"3.16.7"},Di={code:"function VoiceRecordingGestureTsx2(e){const{dragX,dragY,lockFired,LOCK_THRESHOLD,runOnJS,fireLock,cancelFired,CANCEL_THRESHOLD,fireCancel}=this.__closure;const x=Math.min(0,e.translationX);const y=Math.min(0,e.translationY);dragX.value=x;dragY.value=y;if(lockFired.value===0&&y<=-LOCK_THRESHOLD){lockFired.value=1;runOnJS(fireLock)();}if(cancelFired.value===0&&x<=-CANCEL_THRESHOLD){cancelFired.value=1;runOnJS(fireCancel)();}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx2","e","dragX","dragY","lockFired","LOCK_THRESHOLD","runOnJS","fireLock","cancelFired","CANCEL_THRESHOLD","fireCancel","__closure","x","Math","min","translationX","y","translationY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AA2DmB,QAAC,CAAAA,yBAAKA,CAAAC,CAAA,QAAAC,KAAA,CAAAC,KAAA,CAAAC,SAAA,CAAAC,cAAA,CAAAC,OAAA,CAAAC,QAAA,CAAAC,WAAA,CAAAC,gBAAA,CAAAC,UAAA,OAAAC,SAAA,CAEjB,KAAM,CAAAC,CAAC,CAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAEb,CAAC,CAACc,YAAY,CAAC,CACrC,KAAM,CAAAC,CAAC,CAAGH,IAAI,CAACC,GAAG,CAAC,CAAC,CAAEb,CAAC,CAACgB,YAAY,CAAC,CACrCf,KAAK,CAACgB,KAAK,CAAGN,CAAC,CACfT,KAAK,CAACe,KAAK,CAAGF,CAAC,CACf,GAAIZ,SAAS,CAACc,KAAK,GAAK,CAAC,EAAIF,CAAC,EAAI,CAACX,cAAc,CAAE,CAC/CD,SAAS,CAACc,KAAK,CAAG,CAAC,CACnBZ,OAAO,CAACC,QAAQ,CAAC,CAAC,CAAC,CACvB,CACA,GAAIC,WAAW,CAACU,KAAK,GAAK,CAAC,EAAIN,CAAC,EAAI,CAACH,gBAAgB,CAAE,CACnDD,WAAW,CAACU,KAAK,CAAG,CAAC,CACrBZ,OAAO,CAACI,UAAU,CAAC,CAAC,CAAC,CACzB,CACJ","ignoreList":[]}',version:"3.16.7"},Li={code:"function VoiceRecordingGestureTsx3(){const{lockFired,cancelFired,dragX,withSpring,dragY}=this.__closure;if(lockFired.value===0&&cancelFired.value===0){dragX.value=withSpring(0,{damping:18,stiffness:220});dragY.value=withSpring(0,{damping:18,stiffness:220});}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx3","lockFired","cancelFired","dragX","withSpring","dragY","__closure","value","damping","stiffness"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AA0EoB,SAAAA,yBAAMA,CAAA,QAAAC,SAAA,CAAAC,WAAA,CAAAC,KAAA,CAAAC,UAAA,CAAAC,KAAA,OAAAC,SAAA,CAElB,GAAIL,SAAS,CAACM,KAAK,GAAK,CAAC,EAAIL,WAAW,CAACK,KAAK,GAAK,CAAC,CAAE,CAClDJ,KAAK,CAACI,KAAK,CAAGH,UAAU,CAAC,CAAC,CAAE,CAAEI,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CAC5DJ,KAAK,CAACE,KAAK,CAAGH,UAAU,CAAC,CAAC,CAAE,CAAEI,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CAChE,CACJ","ignoreList":[]}',version:"3.16.7"},Bi={code:"function VoiceRecordingGestureTsx4(){const{dragX,CANCEL_THRESHOLD,arrowPulse}=this.__closure;const progress=Math.min(1,Math.abs(dragX.value)/CANCEL_THRESHOLD);return{transform:[{translateX:dragX.value*0.4+arrowPulse.value}],opacity:1-progress};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx4","dragX","CANCEL_THRESHOLD","arrowPulse","__closure","progress","Math","min","abs","value","transform","translateX","opacity"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAiF4C,SAAAA,yBAAMA,CAAA,QAAAC,KAAA,CAAAC,gBAAA,CAAAC,UAAA,OAAAC,SAAA,CAC1C,KAAM,CAAAC,QAAQ,CAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAED,IAAI,CAACE,GAAG,CAACP,KAAK,CAACQ,KAAK,CAAC,CAAGP,gBAAgB,CAAC,CACtE,MAAO,CACHQ,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEV,KAAK,CAACQ,KAAK,CAAG,GAAG,CAAGN,UAAU,CAACM,KAAM,CAAC,CAAC,CACjEG,OAAO,CAAE,CAAC,CAAGP,QACjB,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},Ui={code:"function VoiceRecordingGestureTsx5(){const{dragY,LOCK_THRESHOLD,interpolate}=this.__closure;const lockProgress=Math.min(1,Math.max(0,-dragY.value/LOCK_THRESHOLD));return{transform:[{translateY:interpolate(lockProgress,[0,1],[0,-22])}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx5","dragY","LOCK_THRESHOLD","interpolate","__closure","lockProgress","Math","min","max","value","transform","translateY"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAwF2C,SAAAA,yBAAMA,CAAA,QAAAC,KAAA,CAAAC,cAAA,CAAAC,WAAA,OAAAC,SAAA,CACzC,KAAM,CAAAC,YAAY,CAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAED,IAAI,CAACE,GAAG,CAAC,CAAC,CAAE,CAACP,KAAK,CAACQ,KAAK,CAAGP,cAAc,CAAC,CAAC,CAC5E,MAAO,CACHQ,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAER,WAAW,CAACE,YAAY,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC,CAAE,CAAC,CAC3E,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},Hi={code:"function VoiceRecordingGestureTsx6(){const{chevronPulse}=this.__closure;return{transform:[{translateY:chevronPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx6","chevronPulse","__closure","transform","translateY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AA8F0C,SAAAA,0BAAA,QAAAC,YAAA,OAAAC,SAAA,OAAO,CACzCC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAClD,CAAC","ignoreList":[]}',version:"3.16.7"},Ni={code:"function VoiceRecordingGestureTsx7(){const{dragX,dragY,micPulse}=this.__closure;return{transform:[{translateX:dragX.value},{translateY:dragY.value},{scale:micPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx7","dragX","dragY","micPulse","__closure","transform","translateX","value","translateY","scale"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAiGsC,SAAAA,0BAAA,QAAAC,KAAA,CAAAC,KAAA,CAAAC,QAAA,OAAAC,SAAA,OAAO,CACrCC,SAAS,CAAE,CACP,CAAEC,UAAU,CAAEL,KAAK,CAACM,KAAM,CAAC,CAC3B,CAAEC,UAAU,CAAEN,KAAK,CAACK,KAAM,CAAC,CAC3B,CAAEE,KAAK,CAAEN,QAAQ,CAACI,KAAM,CAAC,CAEjC,CAAC","ignoreList":[]}',version:"3.16.7"},Wi=function(){var o=D(),i=o.messages,l=o.currentUserId,a=o.onMessageLongPress,s=o.mediaViewerGallery,A=o.clearMediaViewerGallery,c=o.typingUsers,u=o.onSendMessage,d=o.onTypingStart,C=o.onTypingEnd,v=o.onAttachmentPress,h=o.onAudioRecordEnd,f=o.onAudioRecordStart,p=o.onCameraPress,m=o.renderCustomInput,y=o.CustomEmojiIcon,g=o.CustomAttachmentIcon,x=o.CustomCameraIcon,b=o.CustomMicrophoneIcon,w=o.CustomSendIcon,S=o.CustomFileIcon,k=o.CustomImagePreview,E=o.CustomVideoPreview,j=o.keyboardVerticalOffset,I=void 0===j?0:j,T=o.disableKeyboardAvoiding,O=void 0!==T&&T,_=o.startReply,R=o.actionSheetMessage,G=o.actionAnchor,F=o.openActionSheet,V=o.closeActionSheet,K=o.messageActionProps,L=o.messageActionUI,B=o.messageActionLabels,U=o.messageActionIcons,H=o.renderMessageActions,N=o.onCopyMessage,W=o.onDeleteMessage,Y=o.onForwardMessage,z=o.startEdit,Q=o.enterSelectionMode,X=o.theme,J=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=M(t.useState(0),2),o=r[0],i=r[1];return t.useEffect((function(){if(e){var t="ios"===n.Platform.OS?"keyboardWillShow":"keyboardDidShow",r="ios"===n.Platform.OS?"keyboardWillHide":"keyboardDidHide",o=n.Keyboard.addListener(t,(function(e){i(e.endCoordinates.height)})),l=n.Keyboard.addListener(r,(function(){return i(0)}));return function(){o.remove(),l.remove()}}i(0)}),[e]),e?o:0}(!O),q=t.useMemo((function(){return yo(X,L)}),[X,L]),$=t.useMemo((function(){return go(X,B)}),[X,B]),Z=t.useMemo((function(){return xo(X,U)}),[X,U]),ee=t.useCallback((function(e,t){a?a(e):F(e,t)}),[a,F]),te=t.useCallback((function(e,t){switch(V(),e){case"reply":_(t);break;case"copy":N?N(t):Co(t);break;case"edit":z(t);break;case"delete":null==W||W(t);break;case"forward":null==Y||Y(t);break;case"select":Q(t)}}),[V,_,N,W,Y,z,Q]),ne=m?m():e.jsx(uo,{onSendMessage:u,onTypingStart:d,onTypingEnd:C,onAttachmentPress:v,onAudioRecordEnd:h,onAudioRecordStart:f,onCameraPress:p,CustomEmojiIcon:y,CustomAttachmentIcon:g,CustomCameraIcon:x,CustomMicrophoneIcon:b,CustomSendIcon:w,CustomFileIcon:S,CustomImagePreview:k,CustomVideoPreview:E}),re=R?H?H(R,V,null!=G?G:void 0):e.jsx(Eo,{message:R,anchor:G,visible:!0,onClose:V,flags:K,ui:q,labels:$,icons:Z,fontFamily:null==X?void 0:X.fontFamily,onAction:te}):null,oe=e.jsxs(n.View,{style:r(_i||(_i=P(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(n.FlatList,{style:r(Ri||(Ri=P(["flex-1"]))),data:i,keyExtractor:function(e){return e.id},renderItem:function(t){var n,r=t.item,o=t.index;return e.jsx(wn,{message:r,isCurrentUser:r.senderId===l,onLongPress:function(e){return ee(r,e)},isFirstInSequence:o===i.length-1||(null===(n=i[o+1])||void 0===n?void 0:n.senderId)!==r.senderId})},ListHeaderComponent:e.jsx(ci,{typingUsers:c||[],currentUserId:l}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e.jsx(n.View,{style:!O&&J>0?{marginBottom:J}:void 0,children:ne}),e.jsx(Ai,{gallery:s,onClose:A}),re]});return O?e.jsx(n.View,{style:r(Gi||(Gi=P(["flex-1"]))),children:oe}):"android"===n.Platform.OS?e.jsx(n.View,{style:r(Fi||(Fi=P(["flex-1"]))),children:oe}):e.jsx(n.KeyboardAvoidingView,{style:r(Vi||(Vi=P(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:I,children:oe})};exports.InlineReply=Pt,exports.LongPressOverlay=Eo,exports.MessageActionsPopover=function(o){var i,l,a,s,A,c,u,d=o.message,C=o.anchor,v=o.visible,h=o.onClose,f=o.flags,p=o.ui,m=o.fontFamily,y=o.onAction,g=t.useMemo((function(){return d?function(e,t){var n,r=!(null===(n=e.text)||void 0===n||!n.trim());return[{id:"reply",label:"Reply",Icon:ee},{id:"forward",label:"Forward",Icon:ho},{id:"copy",label:"Copy",Icon:vo},{id:"edit",label:"Edit",Icon:En},{id:"select",label:"Select",Icon:fo},{id:"delete",label:"Delete",Icon:sr,destructive:!0}].filter((function(e){switch(e.id){case"reply":return!1!==(null==t?void 0:t.enableReply);case"copy":return!1!==(null==t?void 0:t.enableCopy)&&r;case"edit":return!1!==(null==t?void 0:t.enableEdit)&&r;case"delete":return!1!==(null==t?void 0:t.enableDelete);case"forward":return!1!==(null==t?void 0:t.enableForward);case"select":return!1!==(null==t?void 0:t.enableSelect);default:return!0}}))}(d,f):[]}),[d,f]),x=null!==(i=null==p?void 0:p.width)&&void 0!==i?i:200,b=null!==(l=null==p?void 0:p.borderRadius)&&void 0!==l?l:12,w=null!==(a=null==p?void 0:p.backgroundColor)&&void 0!==a?a:"#FFFFFF",S=null!==(s=null==p?void 0:p.textColor)&&void 0!==s?s:"#111827",k=null!==(A=null==p?void 0:p.iconColor)&&void 0!==A?A:S,E=null!==(c=null==p?void 0:p.destructiveColor)&&void 0!==c?c:"#EF4444",j=null!==(u=null==p?void 0:p.backdropColor)&&void 0!==u?u:"rgba(0,0,0,0.18)",I=t.useMemo((function(){return function(e,t,r,o){var i=n.Dimensions.get("window");if(!e)return{top:i.height/2-r*o/2,left:i.width/2-t/2};var l,a=r*o+12;return l=e.isCurrentUser?e.x+e.width-t:e.x,l=Math.max(8,Math.min(l,i.width-t-8)),{top:i.height-(e.y+e.height)>=a+8?e.y+e.height+6:Math.max(8,e.y-a-6),left:l}}(C,x,48,g.length)}),[C,x,g.length]);return d?e.jsx(n.Modal,{visible:v,transparent:!0,animationType:"fade",onRequestClose:h,statusBarTranslucent:!0,children:e.jsx(n.Pressable,{onPress:h,style:[r(bo||(bo=P(["flex-1"]))),{backgroundColor:j}],children:e.jsx(n.Pressable,{onPress:function(){},style:[r(wo||(wo=P(["absolute overflow-hidden"]))),{width:x,borderRadius:b,backgroundColor:w,top:I.top,left:I.left,shadowColor:"#000",shadowOpacity:.16,shadowRadius:16,shadowOffset:{width:0,height:6},elevation:6}],children:g.map((function(t){var o=t.destructive?E:S,i=t.destructive?E:k;return e.jsxs(n.Pressable,{onPress:function(){return y(t.id,d)},android_ripple:{color:"rgba(0,0,0,0.06)"},style:[r(So||(So=P(["flex-row items-center px-4"]))),{height:48},null==p?void 0:p.rowStyle],children:[e.jsx(n.View,{style:{width:22,height:22,marginRight:14},children:e.jsx(t.Icon,{style:{width:22,height:22},color:i})}),e.jsx(n.Text,{style:J([r(ko||(ko=P(["text-[15px] font-medium"]))),{color:o},null==p?void 0:p.rowTextStyle],m),children:t.label})]},t.id)}))})})}):null},exports.MessageActionsSheet=function(t){var o=t.message,i=t.visible,l=t.onClose,a=t.flags,s=t.fontFamily,A=t.backgroundColor,c=void 0===A?"#1f2937":A,u=t.textColor,d=void 0===u?"#FFFFFF":u,C=t.iconColor,v=void 0===C?"#FFFFFF":C,h=t.destructiveColor,f=void 0===h?"#ef4444":h,p=t.rowStyle,m=t.rowTextStyle,y=t.onAction;if(!o)return null;var g=function(e){return[{id:"reply",label:"Reply",Icon:ee},{id:"copy",label:"Copy",Icon:vo},{id:"edit",label:"Edit",Icon:En},{id:"forward",label:"Forward",Icon:ho},{id:"delete",label:"Delete",Icon:sr,destructive:!0}].filter((function(t){switch(t.id){case"reply":return!1!==(null==e?void 0:e.enableReply);case"copy":return!1!==(null==e?void 0:e.enableCopy);case"edit":return!1!==(null==e?void 0:e.enableEdit);case"delete":return!1!==(null==e?void 0:e.enableDelete);case"forward":return!1!==(null==e?void 0:e.enableForward);default:return!0}}))}(a);return e.jsx(n.Modal,{visible:i,transparent:!0,animationType:"fade",onRequestClose:l,statusBarTranslucent:!0,children:e.jsxs(n.Pressable,{onPress:l,style:r(jo||(jo=P(["flex-1 bg-black/50 justify-end"]))),children:[e.jsx(n.Pressable,{onPress:function(){},style:[r(Io||(Io=P(["mx-3 mb-6 rounded-2xl overflow-hidden"]))),{backgroundColor:c}],children:g.map((function(t,i){var l=t.destructive?f:d,a=t.destructive?f:v;return e.jsxs(n.Pressable,{onPress:function(){y(t.id,o)},style:[r(Mo||(Mo=P(["flex-row items-center justify-between px-5 py-4"]))),0!==i?{borderTopWidth:.5,borderTopColor:"rgba(255,255,255,0.08)"}:null,p],children:[e.jsx(n.Text,{style:J([r(Po||(Po=P(["text-[16px] font-medium"]))),{color:l},m],s),children:t.label}),e.jsx(n.View,{style:{width:22,height:22},children:e.jsx(t.Icon,{style:{width:22,height:22},color:a})})]},t.id)}))}),e.jsx(n.Pressable,{onPress:l,style:[r(To||(To=P(["mx-3 mb-3 rounded-2xl py-4 items-center"]))),{backgroundColor:c}],children:e.jsx(n.Text,{style:J([r(Oo||(Oo=P(["text-[16px] font-semibold"]))),{color:d}],s),children:"Cancel"})})]})})},exports.ReplyPreview=function(t){var o=t.message,i=t.onCancel,l=t.previewMaxLines,a=void 0===l?1:l,s=t.replyStyle,A=t.fontFamily,c=t.accentColor,u=void 0===c?"#22c55e":c,d=t.closeIconColor,C=void 0===d?"rgba(0,0,0,0.5)":d,v=t.backgroundColor,h=void 0===v?"#FFFFFF":v,f=t.senderNameColor,p=t.previewTextColor,m=o.senderName||"You",y=function(e){var t,n,r,o,i,l,a=null===(t=e.mediaItems)||void 0===t?void 0:t[0];return e.text?{text:e.text,thumbnail:null!==(r=e.image)&&void 0!==r?r:"image"===(null==a?void 0:a.kind)||"video"===(null==a?void 0:a.kind)?a.uri:void 0}:e.audio?{text:"🎤 Audio message"}:e.video?{text:"🎥 Video",thumbnail:e.video}:"video"===(null==a?void 0:a.kind)?{text:"🎥 Video",thumbnail:a.uri}:e.image||"image"===(null==a?void 0:a.kind)?{text:"📷 Photo",thumbnail:null!==(o=e.image)&&void 0!==o?o:null==a?void 0:a.uri}:(null!==(n=e.fileAttachments)&&void 0!==n?n:[]).length?{text:"📎 ".concat(null!==(i=null===(l=e.fileAttachments)||void 0===l||null===(l=l[0])||void 0===l?void 0:l.name)&&void 0!==i?i:"File")}:{text:"Message"}}(o),g=y.text,x=y.thumbnail;return e.jsxs(n.View,{style:[r(Ei||(Ei=P(["flex-row items-stretch mx-2 mb-1 rounded-xl overflow-hidden"]))),{backgroundColor:h,minHeight:56,shadowColor:"#000",shadowOpacity:.06,shadowRadius:4,shadowOffset:{width:0,height:1},elevation:1},null==s?void 0:s.container],children:[e.jsx(n.View,{style:[r(ji||(ji=P(["w-[3px] self-stretch"]))),{backgroundColor:u},null==s?void 0:s.replyBar]}),e.jsxs(n.View,{style:r(Ii||(Ii=P(["flex-1 flex-row items-center pl-3 pr-2 py-2"]))),children:[e.jsxs(n.View,{style:r(Mi||(Mi=P(["flex-1 mr-2"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(Pi||(Pi=P(["text-[14px] font-semibold"]))),{color:null!=f?f:u},null==s?void 0:s.senderName],A),children:m}),e.jsx(n.Text,{numberOfLines:a,style:J([r(Ti||(Ti=P(["text-[13px] mt-0.5"]))),{color:null!=p?p:"rgba(0,0,0,0.55)"},null==s?void 0:s.previewText],A),children:g})]}),x&&e.jsx(n.Image,{source:{uri:x},style:[{width:36,height:36,borderRadius:4,marginRight:6},null==s?void 0:s.thumbnail],resizeMode:"cover"}),e.jsx(n.Pressable,{onPress:i,hitSlop:10,style:r(Oi||(Oi=P(["w-7 h-7 items-center justify-center"]))),children:e.jsx(kn,{color:C})})]})]})},exports.SelectIcon=fo,exports.SwipeableMessage=le,exports.VoiceRecorder=function(o){var i=o.primaryColor,a=void 0===i?"#16A34A":i,s=o.backgroundColor,A=void 0===s?"#0B141A":s,c=o.waveformColor,u=void 0===c?"#E9EDEF":c,d=o.timerColor,C=void 0===d?"#FFFFFF":d,v=o.sendButtonColor,h=o.deleteIconColor,f=void 0===h?"#8696A0":h,p=o.pauseIconColor,m=void 0===p?"#F15C6D":p,y=o.borderRadius,g=void 0===y?16:y,x=o.sendButtonSize,b=void 0===x?50:x,w=o.waveCount,S=void 0===w?32:w,k=o.renderDeleteIcon,E=o.renderSendIcon,j=o.renderPauseIcon,I=o.renderPlayIcon,T=o.renderWaveform,O=o.onSend,_=o.onDelete,R=o.onPause,G=o.onResume,F=M(t.useState(0),2),V=F[0],K=F[1],D=M(t.useState(!1),2),L=D[0],B=D[1],U=t.useRef(Date.now()),H=t.useRef(0),N=t.useRef(0);t.useEffect((function(){U.current=Date.now()}),[]),t.useEffect((function(){if(!L){var e=setInterval((function(){K((Date.now()-U.current-H.current)/1e3)}),250);return function(){return clearInterval(e)}}}),[L]);var W=l.useSharedValue(1),Y=l.useSharedValue(1);t.useEffect((function(){W.value=l.withRepeat(l.withSequence(l.withTiming(.5,{duration:600,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(1,{duration:600,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),Y.value=l.withRepeat(l.withSequence(l.withTiming(.3,{duration:600}),l.withTiming(1,{duration:600})),-1,!1)}),[]);var z,Q,X=l.useAnimatedStyle((z=[new global.Error,-3,-27],(Q=function(){return{opacity:L?1:W.value}}).__closure={isPaused:L,pauseOpacity:W},Q.__workletHash=0xf63a8f6d95,Q.__initData=gi,Q.__stackDetails=z,Q)),J=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{opacity:Y.value}};return t.__closure={recBlink:Y},t.__workletHash=6095431465582,t.__initData=xi,t.__stackDetails=e,t}()),q={backgroundColor:A,borderTopLeftRadius:g,borderTopRightRadius:g},$=null!=v?v:a;return e.jsxs(n.View,{style:[r(Jo||(Jo=P(["w-full px-4 py-2.5"]))),q],children:[e.jsxs(n.View,{style:r(qo||(qo=P(["flex-row items-center gap-3 px-1 pt-1.5 pb-2"]))),children:[e.jsx(l.View,{style:[r($o||($o=P(["w-1.5 h-1.5 rounded-full"]))),{backgroundColor:m},J]}),e.jsx(n.Text,{style:[r(Zo||(Zo=P(["text-base font-semibold"]))),{color:C,minWidth:42}],numberOfLines:1,children:ct(V)}),e.jsx(n.View,{style:r(ei||(ei=P(["flex-1"]))),children:T?T():e.jsx(bi,{color:u,count:S})})]}),e.jsxs(n.View,{style:r(ti||(ti=P(["flex-row items-center justify-between mt-1"]))),children:[e.jsx(n.Pressable,{onPress:_,hitSlop:12,style:[r(ni||(ni=P(["items-center justify-center rounded-full"]))),{width:b,height:b}],accessibilityRole:"button",accessibilityLabel:"Delete recording",children:k?k():e.jsx(sr,{style:r.style("w-6 h-6"),color:f})}),e.jsx(n.Pressable,{onPress:function(){B((function(e){var t=!e;return t?(N.current=Date.now(),null==R||R()):(H.current+=Date.now()-N.current,N.current=0,null==G||G()),t}))},hitSlop:12,style:r(ri||(ri=P(["items-center justify-center px-4"]))),accessibilityRole:"button",accessibilityLabel:L?"Resume recording":"Pause recording",children:L?I?I():e.jsx(at,{style:r.style("w-7 h-7"),color:m}):e.jsx(l.View,{style:X,children:j?j():e.jsx(lt,{style:r.style("w-7 h-7"),color:m})})}),e.jsx(n.Pressable,{onPress:O,hitSlop:6,accessibilityRole:"button",accessibilityLabel:"Send recording",style:[r(oi||(oi=P(["items-center justify-center rounded-full"]))),{width:b,height:b,backgroundColor:$}],children:E?E():e.jsx(Pn,{style:r.style("w-6 h-6"),color:"#FFFFFF"})})]})]})},exports.VoiceRecorderFlow=kr,exports.VoiceRecordingGesture=function(o){var a=o.primaryColor,s=void 0===a?"#16A34A":a,A=o.backgroundColor,c=void 0===A?"#1F2C33":A,u=o.timerColor,d=void 0===u?"#FFFFFF":u,C=o.microphoneColor,v=void 0===C?"#FFFFFF":C,h=o.lockColor,f=void 0===h?"#E9EDEF":h,p=o.lockPillBackground,m=void 0===p?"#1F2C33":p,y=o.cancelTextColor,g=void 0===y?"rgba(255,255,255,0.6)":y,x=o.barHeight,b=void 0===x?48:x,w=o.micSize,S=o.renderMicIcon,k=o.renderLockIcon,E=o.renderArrowIcon,j=o.onCancel,I=o.onLock,T=null!=w?w:b,O=M(t.useState(0),2),_=O[0],R=O[1],G=t.useRef(Date.now());t.useEffect((function(){G.current=Date.now();var e=setInterval((function(){R((Date.now()-G.current)/1e3)}),250);return function(){return clearInterval(e)}}),[]);var F=l.useSharedValue(0),V=l.useSharedValue(0),K=l.useSharedValue(0),D=l.useSharedValue(1),L=l.useSharedValue(0),B=l.useSharedValue(0),U=l.useSharedValue(0);t.useEffect((function(){K.value=l.withRepeat(l.withSequence(l.withTiming(-4,{duration:700,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:700,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),D.value=l.withRepeat(l.withSequence(l.withTiming(1.18,{duration:700,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(1.12,{duration:700,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),L.value=l.withRepeat(l.withSequence(l.withTiming(-4,{duration:600,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:600,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1)}),[]);var H=t.useRef(j);H.current=j;var N=t.useRef(I);N.current=I;var W,Y,z=function(){var e;ki(),null===(e=H.current)||void 0===e||e.call(H)},Q=function(){var e;ki(),null===(e=N.current)||void 0===e||e.call(N)},X=i.Gesture.Pan().minDistance(0).onBegin((W=[new global.Error,-5,-27],Y=function(){B.value=0,U.value=0,F.value=0,V.value=0},Y.__closure={cancelFired:B,lockFired:U,dragX:F,dragY:V},Y.__workletHash=9031413480896,Y.__initData=Ki,Y.__stackDetails=W,Y)).onUpdate(function(){var e=[new global.Error,-10,-27],t=function(e){var t=Math.min(0,e.translationX),n=Math.min(0,e.translationY);F.value=t,V.value=n,0===U.value&&n<=-70&&(U.value=1,l.runOnJS(Q)()),0===B.value&&t<=-90&&(B.value=1,l.runOnJS(z)())};return t.__closure={dragX:F,dragY:V,lockFired:U,LOCK_THRESHOLD:70,runOnJS:l.runOnJS,fireLock:Q,cancelFired:B,CANCEL_THRESHOLD:90,fireCancel:z},t.__workletHash=0xac60b03bef6,t.__initData=Di,t.__stackDetails=e,t}()).onFinalize(function(){var e=[new global.Error,-6,-27],t=function(){0===U.value&&0===B.value&&(F.value=l.withSpring(0,{damping:18,stiffness:220}),V.value=l.withSpring(0,{damping:18,stiffness:220}))};return t.__closure={lockFired:U,cancelFired:B,dragX:F,withSpring:l.withSpring,dragY:V},t.__workletHash=0x962b8aa90f5,t.__initData=Li,t.__stackDetails=e,t}()),J=l.useAnimatedStyle(function(){var e=[new global.Error,-4,-27],t=function(){var e=Math.min(1,Math.abs(F.value)/90);return{transform:[{translateX:.4*F.value+K.value}],opacity:1-e}};return t.__closure={dragX:F,CANCEL_THRESHOLD:90,arrowPulse:K},t.__workletHash=2609121094002,t.__initData=Bi,t.__stackDetails=e,t}()),q=l.useAnimatedStyle(function(){var e=[new global.Error,-4,-27],t=function(){var e=Math.min(1,Math.max(0,-V.value/70));return{transform:[{translateY:l.interpolate(e,[0,1],[0,-22])}]}};return t.__closure={dragY:V,LOCK_THRESHOLD:70,interpolate:l.interpolate},t.__workletHash=2770335161610,t.__initData=Ui,t.__stackDetails=e,t}()),$=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{translateY:L.value}]}};return t.__closure={chevronPulse:L},t.__workletHash=0xe2617d14eaa,t.__initData=Hi,t.__stackDetails=e,t}()),Z=l.useAnimatedStyle(function(){var e=[new global.Error,-4,-27],t=function(){return{transform:[{translateX:F.value},{translateY:V.value},{scale:D.value}]}};return t.__closure={dragX:F,dragY:V,micPulse:D},t.__workletHash=0xa3ed9ad56cd,t.__initData=Ni,t.__stackDetails=e,t}());return e.jsxs(n.View,{style:r(ui||(ui=P(["w-full flex-row items-end gap-2 relative"]))),pointerEvents:"box-none",children:[e.jsxs(n.View,{style:[r(di||(di=P(["flex-1 flex-row items-center px-4 rounded-3xl"]))),{minHeight:b,backgroundColor:c}],children:[e.jsx(n.Text,{style:[r(Ci||(Ci=P(["text-base font-semibold"]))),{color:d,minWidth:42}],numberOfLines:1,children:ct(_)}),e.jsxs(l.View,{style:[r(vi||(vi=P(["flex-1 flex-row items-center justify-center gap-1.5"]))),J],children:[E?E():e.jsx(n.Text,{style:[r(hi||(hi=P(["text-base leading-none"]))),{color:g,marginTop:-2}],children:"‹"}),e.jsx(n.Text,{style:[r(fi||(fi=P(["text-sm"]))),{color:g}],children:"Slide to cancel"})]})]}),e.jsxs(n.View,{style:[r(pi||(pi=P(["relative items-center justify-center"]))),{height:b,width:b}],children:[e.jsxs(l.View,{style:[r(mi||(mi=P(["absolute items-center justify-center rounded-2xl py-2.5"]))),{width:T-8,backgroundColor:m,bottom:T+6,gap:6},q],pointerEvents:"none",children:[k?k():e.jsx(ir,{style:{width:18,height:18},color:f}),e.jsx(l.View,{style:$,children:e.jsx(or,{style:{width:14,height:14},color:f})})]}),e.jsx(i.GestureDetector,{gesture:X,children:e.jsx(l.View,{style:[r(yi||(yi=P(["items-center justify-center rounded-full"]))),{width:T,height:T,backgroundColor:s},Z],accessibilityRole:"button",accessibilityLabel:"Hold to record. Slide left to cancel, slide up to lock.",children:S?S():e.jsx(In,{style:{width:26,height:26},color:v})})})]})]})},exports.default=function(t){return e.jsx(At,{children:e.jsx(K,y(y({},t),{},{children:e.jsx(Wi,{})}))})},exports.tryCopyMessage=Co;
16
+ */function Me(){if(he)return ve;he=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return ve=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),s=1;s<arguments.length;s++){for(var A in i=Object(arguments[s]))t.call(i,A)&&(a[A]=i[A]);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},ve}function Pe(){if(pe)return fe;pe=1;return fe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Te(){return ye?me:(ye=1,me=Function.call.bind(Object.prototype.hasOwnProperty))}function Oe(){if(xe)return ge;xe=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=Pe(),n={},r=Te();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,s){if("production"!==process.env.NODE_ENV)for(var A in o)if(r(o,A)){var c;try{if("function"!=typeof o[A]){var u=Error((a||"React class")+": "+l+" type `"+A+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[A]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}c=o[A](i,A,a,l,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((a||"React class")+": type specification of "+l+" `"+A+"` 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 d=s?s():"";e("Failed "+l+" type: "+c.message+(null!=d?d:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},ge=o}function _e(){if(we)return be;we=1;var e=Ie(),t=Me(),n=Pe(),r=Te(),o=Oe(),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){}}),be=function(a,s){var A="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",u={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:v(l),arrayOf:function(e){return v((function(t,r,o,i,l){if("function"!=typeof e)return new C("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[r];if(!Array.isArray(a))return new C("Invalid "+i+" `"+l+"` of type `"+m(a)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<a.length;s++){var A=e(a,s,o,i,l+"["+s+"]",n);if(A instanceof Error)return A}return null}))},element:v((function(e,t,n,r,o){var i=e[t];return a(i)?null:new C("Invalid "+r+" `"+o+"` of type `"+m(i)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:v((function(t,n,r,o,i){var l=t[n];return e.isValidElementType(l)?null:new C("Invalid "+o+" `"+i+"` of type `"+m(l)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return v((function(t,n,r,o,i){if(!(t[n]instanceof e)){var l=e.name||c;return new C("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:v((function(e,t,n,r,o){return p(e[t])?null:new C("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return v((function(t,o,i,l,a){if("function"!=typeof e)return new C("Property `"+a+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var s=t[o],A=m(s);if("object"!==A)return new C("Invalid "+l+" `"+a+"` of type `"+A+"` supplied to `"+i+"`, expected an object.");for(var c in s)if(r(s,c)){var u=e(s,c,i,l,a+"."+c,n);if(u instanceof Error)return u}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 v((function(t,n,r,o,i){for(var l=t[n],a=0;a<e.length;a++)if(d(l,e[a]))return null;var s=JSON.stringify(e,(function(e,t){return"symbol"===y(t)?String(t):t}));return new C("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+r+"`, expected one of "+s+".")}))},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 "+g(o)+" at index "+t+"."),l}return v((function(t,o,i,l,a){for(var s=[],A=0;A<e.length;A++){var c=(0,e[A])(t,o,i,l,a,n);if(null==c)return null;c.data&&r(c.data,"expectedType")&&s.push(c.data.expectedType)}return new C("Invalid "+l+" `"+a+"` supplied to `"+i+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")}))},shape:function(e){return v((function(t,r,o,i,l){var a=t[r],s=m(a);if("object"!==s)return new C("Invalid "+i+" `"+l+"` of type `"+s+"` supplied to `"+o+"`, expected `object`.");for(var A in e){var c=e[A];if("function"!=typeof c)return f(o,i,l,A,y(c));var u=c(a,A,o,i,l+"."+A,n);if(u)return u}return null}))},exact:function(e){return v((function(o,i,l,a,s){var A=o[i],c=m(A);if("object"!==c)return new C("Invalid "+a+" `"+s+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var u=t({},o[i],e);for(var d in u){var v=e[d];if(r(e,d)&&"function"!=typeof v)return f(l,a,s,d,y(v));if(!v)return new C("Invalid "+a+" `"+s+"` key `"+d+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=v(A,d,l,a,s+"."+d,n);if(h)return h}return null}))}};function d(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function C(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function v(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,l,a,A,u,d,v){if(A=A||c,d=d||a,v!==n){if(s){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 f=A+":"+a;!t[f]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+A+"`. 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[f]=!0,r++)}}return null==l[a]?o?null===l[a]?new C("The "+u+" `"+d+"` is marked as required in `"+A+"`, but its value is `null`."):new C("The "+u+" `"+d+"` is marked as required in `"+A+"`, but its value is `undefined`."):null:e(l,a,A,u,d)}var l=o.bind(null,!1);return l.isRequired=o.bind(null,!0),l}function h(e){return v((function(t,n,r,o,i,l){var a=t[n];return m(a)!==e?new C("Invalid "+o+" `"+i+"` of type `"+y(a)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function f(e,t,n,r,o){return new C((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function p(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(p);if(null===e||a(e))return!0;var t=function(e){var t=e&&(A&&e[A]||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(!p(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!p(o[1]))return!1}return!0;default:return!1}}function m(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 y(e){if(null==e)return""+e;var t=m(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function g(e){var t=y(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return C.prototype=Error.prototype,u.checkPropTypes=o,u.resetWarningCache=o.resetWarningCache,u.PropTypes=u,u},be}function Re(){if(ke)return Se;ke=1;var e=Pe();function t(){}function n(){}return n.resetWarningCache=t,Se=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 Ge(){if(Ee)return Ae.exports;if(Ee=1,"production"!==process.env.NODE_ENV){var e=Ie();Ae.exports=_e()(e.isElement,true)}else Ae.exports=Re()();return Ae.exports}var Fe=ae(Ge()),Ve=function(){return v((function e(t,n){C(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=[],s=t.children,A=0;for(n.pattern.lastIndex=0;s&&(o=n.pattern.exec(s));){var c=s.substr(0,o.index);if(A=o.index,++l>i)break;a.push({children:c}),a.push(e.getMatchedPart(n,o[0],o,A)),s=s.substr(o.index+o[0].length),A+=o[0].length-1,n.pattern.lastIndex=0}a.push({children:s}),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)),y(y({},o),{},{children:i,_matched:!0})}}])}(),Ke=["type"],De=["style"],Le=["parse","childrenProps"],Be={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+/},Ue=Fe.shape(y(y({},n.Text.propTypes),{},{type:Fe.oneOf(Object.keys(Be)).isRequired,nonExhaustiveMaxMatchCount:Fe.number})),He=Fe.shape(y(y({},n.Text.propTypes),{},{pattern:Fe.oneOfType([Fe.string,Fe.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:Fe.number})),Ne=function(){function r(){return C(this,r),d(this,r,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&&I(e,t)}(r,t.Component),v(r,[{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=g(e,Ke);if(t){if(!Be[t])throw new Error("".concat(e.type," is not a supported type"));n.pattern=Be[t]}return n}))}},{key:"getParsedText",value:function(){var t=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new Ve(this.props.children,this.getPatterns()).parse().map((function(r,o){var i=t.props.style,l=r.style,a=g(r,De);return e.jsx(n.Text,y(y({style:[i,l]},t.props.childrenProps),a),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var t=this,r=y({},this.props);r.parse,r.childrenProps;var o=g(r,Le);return e.jsx(n.Text,y(y({ref:function(e){return t._root=e}},o),{},{children:this.getParsedText()}))}}])}();function We(e,t){var n;return y(y({},null==e||null===(n=e.reply)||void 0===n?void 0:n.ui),t)}function Ye(e,t,n){var r,o,i=We(e,n);return t?null!==(o=i.sentInlineBackground)&&void 0!==o?o:U(e,!0):null!==(r=i.receivedInlineBackground)&&void 0!==r?r:U(e,!1)}function ze(e,t,n){var r,o,i,l,a,s=We(e,n),A=null==e?void 0:e.colors;return t?null!==(l=null!==(a=s.sentSenderNameColor)&&void 0!==a?a:null==A?void 0:A.sentMessageTextColor)&&void 0!==l?l:"rgba(255,255,255,0.95)":null!==(r=null!==(o=null!==(i=s.receivedSenderNameColor)&&void 0!==i?i:null==A?void 0:A.sentBubbleBackgroundColor)&&void 0!==o?o:null==A?void 0:A.sentMessageTailColor)&&void 0!==r?r:"#22c55e"}function Qe(e,t,n){var r,o,i,l,a,s,A=We(e,n);return t?null!==(l=null!==(a=A.sentPreviewTextColor)&&void 0!==a?a:null==e||null===(s=e.colors)||void 0===s?void 0:s.sentMessageTextColor)&&void 0!==l?l:"rgba(255,255,255,0.85)":null!==(r=null!==(o=A.receivedPreviewTextColor)&&void 0!==o?o:null==e||null===(i=e.colors)||void 0===i?void 0:i.receivedMessageTextColor)&&void 0!==r?r:"rgba(0,0,0,0.75)"}Ne.displayName="ParsedText",Ne.propTypes=y(y({},n.Text.propTypes),{},{parse:Fe.arrayOf(Fe.oneOfType([Ue,He])),childrenProps:Fe.shape(n.Text.propTypes)}),Ne.defaultProps={parse:null,childrenProps:{}};var Xe,Je,qe,$e,Ze,et,tt,nt,rt,ot,it,lt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 12 12",children:e.jsx(o.Path,{fill:"none",stroke:r,strokeLinecap:"round",strokeWidth:"2",d:"M4 2v8m4-8v8"})})},at=function(t){var n=t.style,r=t.color;return e.jsx(o,{viewBox:"0 0 24 24",style:n,children:e.jsxs(o.G,{fill:"none",fillRule:"evenodd",children:[e.jsx(o.Path,{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),e.jsx(o.Path,{fill:r,d:"M5.669 4.76a1.47 1.47 0 0 1 2.04-1.177c1.062.454 3.442 1.533 6.462 3.276c3.021 1.744 5.146 3.267 6.069 3.958c.788.591.79 1.763.001 2.356c-.914.687-3.013 2.19-6.07 3.956c-3.06 1.766-5.412 2.832-6.464 3.28c-.906.387-1.92-.2-2.038-1.177c-.138-1.142-.396-3.735-.396-7.237c0-3.5.257-6.092.396-7.235"})]})})},st=t.createContext(void 0),At=function(n){var r=n.children,o=M(t.useState(null),2),i=o[0],l=o[1];return e.jsx(st.Provider,{value:{currentlyPlayingId:i,setCurrentlyPlayingId:l},children:r})},ct=function(e){var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n<10?"0":"").concat(n)},ut=[1,1.5,2],dt=42;function Ct(t){var o,i,l,a,s,A=t.isPlaying,c=t.playbackRate,u=t.onCycleSpeed,d=t.senderAvatar,C=t.senderName,v=t.isCurrentUser,h=t.theme;return A?e.jsx(n.Pressable,{onPress:u,style:[r(Xe||(Xe=P(["rounded-full items-center justify-center"]))),{width:dt,height:dt,backgroundColor:v?"rgba(0,0,0,0.22)":"rgba(255,255,255,0.12)"},null==h||null===(o=h.messageStyle)||void 0===o?void 0:o.audioSpeedButtonStyle],children:e.jsx(n.Text,{style:J([r(Je||(Je=P(["text-xs font-semibold"]))),{color:W(h,v)},null==h||null===(i=h.messageStyle)||void 0===i?void 0:i.audioSpeedTextStyle],null==h?void 0:h.fontFamily),children:1===c?"1x":"".concat(c,"x")})}):d?e.jsx(n.Image,{source:{uri:d},style:[r(qe||(qe=P(["rounded-full"]))),{width:dt,height:dt},null==h||null===(l=h.bubbleStyle)||void 0===l?void 0:l.avatarImageStyle],resizeMode:"cover"}):e.jsx(n.View,{style:[r($e||($e=P(["rounded-full items-center justify-center"]))),{width:dt,height:dt,backgroundColor:v?"rgba(0,0,0,0.2)":"#9ca3af"}],children:e.jsx(n.Text,{style:J([r(Ze||(Ze=P(["text-base font-semibold capitalize"]))),{color:"#ffffff"}],null==h?void 0:h.fontFamily),children:(a=C,s=null==a?void 0:a.trim(),s?s.charAt(0).toUpperCase():"?")})})}var vt,ht,ft,pt,mt,yt,gt,xt,bt,wt,St,kt,Et,jt,It=function(o){var i,l,s=o.audioUrl,A=o.audioId,c=o.isVideoPlaying,u=o.isCurrentUser,d=o.senderAvatar,C=o.senderName,v=o.reserveStatusSpace,h=void 0===v||v,f=o.onLongPress,p=D(),m=p.theme,g=p.CustomPlayIcon,x=p.CustomPauseIcon,b=p.showMessageStatus,w=function(){var e=t.useContext(st);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),S=w.currentlyPlayingId,k=w.setCurrentlyPlayingId,E=t.useRef(null),j=M(t.useState(!1),2),I=j[0],T=j[1],O=M(t.useState(0),2),_=O[0],R=O[1],G=M(t.useState(0),2),F=G[0],V=G[1],K=M(t.useState(!1),2),B=K[0],U=K[1],H=M(t.useState(1),2),N=H[0],W=H[1],Y=M(t.useState(0),2),z=Y[0],Q=Y[1],X=t.useRef(null),q=t.useMemo((function(){return function(e,t){for(var n=5381,r=0;r<e.length;r++)n=(n<<5)+n+e.charCodeAt(r)|0;return Array.from({length:t},(function(e,t){return n=0|Math.imul(n^n>>>16,73244475+31337*t),n^=n>>>13,.18+Math.abs(n)%100/100*.82}))}(s,50)}),[s]),$=function(e,t){var n,r,o,i,l=L(e);return t?{inactive:null!==(o=null==l?void 0:l.sentAudioWaveformColor)&&void 0!==o?o:"rgba(255,255,255,0.35)",active:null!==(i=null==l?void 0:l.sentAudioWaveformActiveColor)&&void 0!==i?i:"rgba(255,255,255,0.95)"}:{inactive:null!==(n=null==l?void 0:l.receivedAudioWaveformColor)&&void 0!==n?n:"rgba(0,0,0,0.20)",active:null!==(r=null==l?void 0:l.receivedAudioWaveformActiveColor)&&void 0!==r?r:"rgba(0,0,0,0.60)"}}(m,u),Z=$.inactive,ee=$.active,te=function(e,t){var n,r,o,i,l=L(e);return t?null!==(o=null!==(i=null==l?void 0:l.sentAudioTimestampColor)&&void 0!==i?i:null==l?void 0:l.sentTimestampColor)&&void 0!==o?o:"rgba(255,255,255,0.75)":null!==(n=null!==(r=null==l?void 0:l.receivedAudioTimestampColor)&&void 0!==r?r:null==l?void 0:l.receivedTimestampColor)&&void 0!==n?n:"rgba(0,0,0,0.45)"}(m,u),ne=function(e,t){var n,r,o=L(e);return t?null!==(r=null==o?void 0:o.sentAudioPlayIconColor)&&void 0!==r?r:"#ffffff":null!==(n=null==o?void 0:o.receivedAudioPlayIconColor)&&void 0!==n?n:"#374151"}(m,u),re=function(e,t){var n,r,o=L(e);return t?null!==(r=null==o?void 0:o.sentAudioPauseIconColor)&&void 0!==r?r:"#ffffff":null!==(n=null==o?void 0:o.receivedAudioPauseIconColor)&&void 0!==n?n:"#374151"}(m,u),oe=I&&!(c||!!S&&S!==A),ie=F>0?_/F:0,le=t.useCallback((function(e){var t;(V(e.duration),null!==X.current)&&(null===(t=E.current)||void 0===t||t.seek(X.current),X.current=null)}),[]),ae=t.useCallback((function(e){var t=e.currentTime;B||R(t)}),[B]),se=t.useCallback((function(){var e;T(!1),R(0),null===(e=E.current)||void 0===e||e.seek(0),k(null)}),[k]),Ae=t.useCallback((function(){oe?(T(!1),k(null)):(k(A),T(!0))}),[oe,A,k]),ce=t.useCallback((function(){W((function(e){var t=ut.indexOf(e),n=ut[(t+1)%ut.length];return null!=n?n:1}))}),[]),ue=t.useCallback((function(e){var t=z;if(!(t<=0||F<=0)){var n,r=Math.max(0,Math.min(e/t,1))*F;if(R(r),F>0)null===(n=E.current)||void 0===n||n.seek(r);else X.current=r}}),[F,z]),de=t.useMemo((function(){return n.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){U(!0),ue(e.nativeEvent.locationX)},onPanResponderMove:function(e){return ue(e.nativeEvent.locationX)},onPanResponderRelease:function(){return U(!1)},onPanResponderTerminate:function(){return U(!1)}})}),[ue]),Ce=e.jsx(n.Pressable,{onPress:Ae,onLongPress:f,delayLongPress:250,hitSlop:8,style:r(et||(et=P(["shrink-0 px-0.5"]))),children:oe?x?e.jsx(x,{}):e.jsx(lt,{style:r.style("h-6 w-6"),color:re}):g?e.jsx(g,{}):e.jsx(at,{style:r.style("h-6 w-6"),color:ne})}),ve=e.jsx(Ct,{isPlaying:oe,playbackRate:N,onCycleSpeed:ce,senderAvatar:d,senderName:C,isCurrentUser:u,theme:m}),he=e.jsx(n.View,{style:[r(tt||(tt=P(["flex-1 min-w-0"]))),{height:36}],onLayout:function(e){return Q(e.nativeEvent.layout.width)},children:e.jsx(n.View,y(y({style:[{flex:1,flexDirection:"row",alignItems:"center"},null==m||null===(i=m.messageStyle)||void 0===i?void 0:i.progressBarStyle]},de.panHandlers),{},{children:q.map((function(t,r){var o,i=(r+.5)/50<=ie;return e.jsx(n.View,{style:[{flex:1,marginHorizontal:.5,height:Math.max(3,Math.round(36*t)),borderRadius:2,backgroundColor:i?ee:Z},i?null==m||null===(o=m.messageStyle)||void 0===o?void 0:o.activeProgressBarStyle:void 0]},r)}))}))});return e.jsxs(n.View,{style:[r(nt||(nt=P(["min-w-[240px] max-w-[280px] py-1.5 px-1"]))),h&&b&&r(rt||(rt=P(["pb-4"])))],children:[e.jsx(a,{ref:E,source:{uri:s},paused:!oe,rate:N,playInBackground:!1,playWhenInactive:!1,onLoad:le,onProgress:ae,onEnd:se,style:{width:0,height:0},progressUpdateInterval:80}),e.jsx(n.View,{style:r(ot||(ot=P(["flex-row items-center gap-1.5"]))),children:u?e.jsxs(e.Fragment,{children:[ve,Ce,he]}):e.jsxs(e.Fragment,{children:[Ce,he,ve]})}),e.jsx(n.Text,{style:J([r(it||(it=P(["text-[11px] mt-1"]))),{color:te,paddingLeft:u?82:34},null==m||null===(l=m.messageStyle)||void 0===l?void 0:l.audioDurationStyle],null==m?void 0:m.fontFamily),children:ct(oe?_:F>0?F:_)})]})},Mt=t.memo(It),Pt=function(t){var o=t.reply,i=t.fontFamily,l=t.replyStyle,a=t.backgroundColor,s=t.senderNameColor,A=t.previewTextColor,c=t.thumbnailSize,u=void 0===c?40:c,d=t.defaultSenderName,C=void 0===d?"Reply":d,v=function(e){switch(e){case"image":return"📷";case"video":return"🎥";case"audio":return"🎤";case"file":return"📎";default:return null}}(o.mediaKind),h=function(e){if(e.preview)return e.preview;switch(e.mediaKind){case"image":return"Photo";case"video":return"Video";case"audio":return"Audio message";case"file":return"File";default:return"Message"}}(o),f=!!o.thumbnailUri;return e.jsx(n.View,{style:[r(vt||(vt=P(["my-2 rounded-md overflow-hidden"]))),{backgroundColor:a,minHeight:48},null==l?void 0:l.inlineContainer,null==l?void 0:l.container],children:e.jsxs(n.View,{style:r(ht||(ht=P(["flex-1 flex-row items-center px-3 py-2"]))),children:[e.jsxs(n.View,{style:r(ft||(ft=P(["flex-1"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(pt||(pt=P(["text-[13px] font-semibold"]))),{color:s},null==l?void 0:l.senderName],i),children:o.senderName||C}),e.jsx(n.Text,{numberOfLines:2,style:J([r(mt||(mt=P(["text-[12.5px] mt-0.5"]))),{color:A},null==l?void 0:l.previewText],i),children:v&&!o.preview?"".concat(v," ").concat(h):h})]}),f&&e.jsx(n.Image,{source:{uri:o.thumbnailUri},style:[r(yt||(yt=P(["ml-2"]))),{width:u,height:u,borderRadius:4},null==l?void 0:l.thumbnail],resizeMode:"cover"})]})})},Tt=function(r){var i=r.style,l=r.spinning,a=void 0!==l&&l,s=t.useRef(new n.Animated.Value(0)).current;t.useEffect((function(){a&&n.Animated.loop(n.Animated.timing(s,{toValue:1,duration:1e3,easing:n.Easing.linear,useNativeDriver:!0})).start()}),[a]);var A=s.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e.jsx(n.Animated.View,{style:a?{transform:[{rotate:A}]}:void 0,children:e.jsx(o,{style:i,viewBox:"0 0 1024 1024",children:e.jsx(o.Path,{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"})})})},Ot=320,_t=Ot,Rt=Math.round(176),Gt=Ot-Rt-2,Ft=Math.round(159),Vt=function(o){var i,l=o.uri,s=o.cellStyle,A=o.roundedStyle,c=D(),u=c.theme,d=c.CustomPlayIcon,C=t.useRef(null),v=M(t.useState(0),2),h=v[0],f=v[1],p=M(t.useState(!0),2),m=p[0],y=p[1],g=M(t.useState(!1),2),x=g[0],b=g[1];return e.jsxs(n.View,{style:[s,A],pointerEvents:"none",children:[e.jsx(a,{source:{uri:l},ref:C,paused:!0,muted:!0,playInBackground:!1,playWhenInactive:!1,pointerEvents:"none",style:[A,{width:"100%",height:"100%"}],resizeMode:"cover",onLoadStart:function(){y(!0),b(!1)},onLoad:function(e){f(e.duration),y(!1)},onError:function(){b(!0),y(!1)}}),m&&e.jsx(n.View,{style:[r(gt||(gt=P(["absolute inset-0 items-center justify-center bg-black/40"]))),A],children:e.jsx(Tt,{style:r.style("h-8 w-8"),spinning:!0})}),!m&&!x&&e.jsxs(e.Fragment,{children:[e.jsx(n.View,{style:r(xt||(xt=P(["pointer-events-none absolute inset-0 items-center justify-center"]))),children:d?e.jsx(d,{}):e.jsx(at,{style:r.style("h-10 w-10"),color:(null==u||null===(i=u.colors)||void 0===i?void 0:i.videoPlayIconColor)||"white"})}),e.jsx(n.View,{style:r(bt||(bt=P(["pointer-events-none absolute bottom-1 left-1 bg-black/50 px-1.5 py-0.5 rounded"]))),children:e.jsx(n.Text,{style:r(wt||(wt=P(["text-white text-[10px] font-semibold"]))),children:Kt(h)})})]}),x&&e.jsx(n.View,{style:[r(St||(St=P(["absolute inset-0 items-center justify-center bg-red-500/50"]))),A],children:e.jsx(n.Text,{style:J(r(kt||(kt=P(["text-white text-xs"]))),null==u?void 0:u.fontFamily),children:"Video"})})]})};function Kt(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 Dt,Lt,Bt,Ut,Ht,Nt,Wt,Yt,zt,Qt,Xt,Jt,qt,$t,Zt,en,tn,nn,rn,on,ln,an,sn,An,cn,un,dn,Cn,vn=function(t){var o=t.items,i=t.onOpenGallery,l=t.onLongPress,a=n.useWindowDimensions().width,s=Math.min(240,.72*a);if(0===o.length)return null;var A={borderRadius:6,overflow:"hidden"};if(1===o.length){var c=o[0];return e.jsx(n.Pressable,{onPress:function(){return i(o,0)},onLongPress:l,delayLongPress:250,style:{width:s,height:320,marginVertical:8},children:"image"===c.kind?e.jsx(n.Image,{source:{uri:c.uri},style:{width:"100%",height:"100%",borderRadius:8},resizeMode:"cover"}):e.jsx(Vt,{uri:c.uri,cellStyle:{width:s,height:320},roundedStyle:{borderRadius:8}})})}if(2===o.length){var u=(s-2)/2;return e.jsx(n.View,{style:{width:s,height:_t,flexDirection:"row",gap:2,marginVertical:8},children:o.slice(0,2).map((function(t,r){return e.jsx(n.Pressable,{onPress:function(){return i(o,r)},onLongPress:l,delayLongPress:250,style:{width:u,height:_t},children:"image"===t.kind?e.jsx(n.Image,{source:{uri:t.uri},style:[A,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Vt,{uri:t.uri,cellStyle:{width:u,height:_t},roundedStyle:A})},"".concat(t.uri,"-").concat(r))}))})}if(3===o.length){var d=o[0],C=o[1],v=o[2],h=(s-2)/2;return e.jsxs(n.View,{style:{width:s,height:Ot,marginVertical:8,gap:2},children:[e.jsx(n.Pressable,{onPress:function(){return i(o,0)},onLongPress:l,delayLongPress:250,style:{width:s,height:Rt},children:"image"===d.kind?e.jsx(n.Image,{source:{uri:d.uri},style:[A,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Vt,{uri:d.uri,cellStyle:{width:s,height:Rt},roundedStyle:A})}),e.jsxs(n.View,{style:{flexDirection:"row",gap:2,height:Gt},children:[e.jsx(n.Pressable,{onPress:function(){return i(o,1)},onLongPress:l,delayLongPress:250,style:{width:h,height:Gt},children:"image"===C.kind?e.jsx(n.Image,{source:{uri:C.uri},style:[A,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Vt,{uri:C.uri,cellStyle:{width:h,height:Gt},roundedStyle:A})},"".concat(C.uri,"-1")),e.jsx(n.Pressable,{onPress:function(){return i(o,2)},onLongPress:l,delayLongPress:250,style:{width:h,height:Gt},children:"image"===v.kind?e.jsx(n.Image,{source:{uri:v.uri},style:[A,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Vt,{uri:v.uri,cellStyle:{width:h,height:Gt},roundedStyle:A})},"".concat(v.uri,"-2"))]})]})}var f=(s-2)/2,p=o.length-4,m=o.slice(0,4);return e.jsx(n.View,{style:{width:s,height:Ot,flexWrap:"wrap",flexDirection:"row",gap:2,marginVertical:8},children:m.map((function(t,a){return e.jsxs(n.Pressable,{onPress:function(){return i(o,a)},onLongPress:l,delayLongPress:250,style:{width:f,height:Ft,position:"relative"},children:["image"===t.kind?e.jsx(n.Image,{source:{uri:t.uri},style:[A,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Vt,{uri:t.uri,cellStyle:{width:f,height:Ft},roundedStyle:A}),3===a&&p>0&&e.jsx(n.View,{style:r(Et||(Et=P(["absolute inset-0 bg-black/55 items-center justify-center"]))),children:e.jsxs(n.Text,{style:r(jt||(jt=P(["text-white text-lg font-bold"]))),children:["+",p]})})]},"".concat(t.uri,"-").concat(a))}))})},hn=function(o){var i,l,a,s,A,c=o.message,u=o.onGalleryOpen,d=o.isVideoPlaying,C=o.isCurrentUser,v=o.onLongPress,h=D(),f=h.theme,p=h.showMessageStatus,m=h.onFileAttachmentPress,g=h.replyUI,x=h.replyStyle,b=h.renderInlineReply,w=h.selectionMode,S=h.toggleSelection,k=We(f,g),E=y(y({},null==f||null===(i=f.reply)||void 0===i?void 0:i.styles),x),j=t.useMemo((function(){return Q(c)}),[c]),I=c.replyTo?b?b(c.replyTo,C):e.jsx(Pt,{reply:c.replyTo,fontFamily:null==f?void 0:f.fontFamily,replyStyle:E,backgroundColor:Ye(f,C,k),senderNameColor:ze(f,C,k),previewTextColor:Qe(f,C,k),thumbnailSize:k.thumbnailSize,defaultSenderName:k.defaultReplySenderName}):null;return e.jsxs(n.View,{children:[I,j.length>0&&e.jsx(vn,{items:j,onOpenGallery:u,onLongPress:v}),(null!==(l=c.fileAttachments)&&void 0!==l?l:[]).map((function(t,o){var i,l,a,s,A,u;return e.jsxs(n.Pressable,{onPress:function(){w?S(c):m?m(t):n.Linking.openURL(t.uri.startsWith("http")||t.uri.startsWith("file:")?t.uri:"file://".concat(t.uri))},onLongPress:v,delayLongPress:250,style:[r(Dt||(Dt=P(["my-1.5 py-2 px-3 rounded-lg max-w-[220px]"]))),{backgroundColor:U(f,C)},C?null==f||null===(i=f.messageStyle)||void 0===i?void 0:i.sentFileAttachmentStyle:null==f||null===(l=f.messageStyle)||void 0===l?void 0:l.receivedFileAttachmentStyle],children:[e.jsxs(n.Text,{style:J([r(Lt||(Lt=P(["text-xs font-semibold"]))),{color:H(f,C)},C?null==f||null===(a=f.messageStyle)||void 0===a?void 0:a.sentFileAttachmentTextStyle:null==f||null===(s=f.messageStyle)||void 0===s?void 0:s.receivedFileAttachmentTextStyle],null==f?void 0:f.fontFamily),numberOfLines:2,children:["📎 ",t.name]}),e.jsx(n.Text,{style:J([r(Bt||(Bt=P(["text-[10px] mt-0.5"]))),{color:N(f,C)},C?null==f||null===(A=f.messageStyle)||void 0===A?void 0:A.sentFileAttachmentSubtitleStyle:null==f||null===(u=f.messageStyle)||void 0===u?void 0:u.receivedFileAttachmentSubtitleStyle],null==f?void 0:f.fontFamily),children:t.type})]},"".concat(t.uri,"-").concat(o))})),c.audio&&e.jsx(Mt,{audioUrl:c.audio,audioId:c.id,isVideoPlaying:d,isCurrentUser:C,senderAvatar:c.senderAvatar,senderName:c.senderName,reserveStatusSpace:!c.text,onLongPress:v}),c.text&&e.jsx(Ne,{style:J([r(Ut||(Ut=P(["pt-1"]))),r(p?Ht||(Ht=P(["pb-0"])):Nt||(Nt=P(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},C?null==f||null===(a=f.messageStyle)||void 0===a?void 0:a.sentTextStyle:null==f||null===(s=f.messageStyle)||void 0===s?void 0:s.receivedTextStyle,Y(f,C)?{color:Y(f,C)}:void 0],null==f?void 0:f.fontFamily),parse:[{type:"url",style:y({color:"blue",textDecorationLine:"underline"},(A=null==f?void 0:f.fontFamily,A?{fontFamily:A}:void 0)),onPress:function(e){return n.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:c.text})]})},fn=t.memo(hn),pn=function(t){var n=t.style,r=t.fill;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{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"})})},mn=function(t){var n=t.style,r=t.fill;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z",fill:r})})},yn=function(t){var o,i,l,a,s=t.time,A=t.status,c=t.isCurrentUser,u=t.hasText,d=t.hasAudio,C=t.hasGalleryMedia,v=t.hasFileAttachments,h=t.edited,f=D(),p=f.theme,m=f.showMessageStatus,y=f.editedLabel,g=f.editedTextStyle,x=C&&!u&&!d,b=(C||v)&&!u&&!d,w=x?"#ffffff":b?function(e,t){var n,r,o=L(e);return t?null!==(r=null==o?void 0:o.sentTimestampColor)&&void 0!==r?r:"rgba(255, 255, 255, 0.75)":null!==(n=null==o?void 0:o.receivedTimestampColor)&&void 0!==n?n:"rgba(107, 114, 128, 0.85)"}(p,c):function(e,t){var n,r,o=L(e);return t?null!==(r=null==o?void 0:o.sentTimestampColor)&&void 0!==r?r:"rgba(255, 255, 255, 0.75)":null!==(n=null==o?void 0:o.receivedTimestampColor)&&void 0!==n?n:"rgba(107, 114, 128, 0.85)"}(p,c),S=x||b?"rgba(255,255,255,0.85)":w;return e.jsx(e.Fragment,{children:m&&e.jsxs(n.View,{style:[r(Wt||(Wt=P(["flex-row items-center"]))),u?r(Yt||(Yt=P(["justify-end pb-1 ml-4"]))):d?r(zt||(zt=P(["absolute right-3 bottom-2"]))):b?[r(Qt||(Qt=P(["absolute right-3 bottom-4"]))),B(p,c)]:[r(Xt||(Xt=P(["absolute right-3 bottom-4"]))),B(p,c)]],children:[h&&e.jsx(n.Text,{style:J([r(Jt||(Jt=P(["text-[11px] mr-1.5"]))),{fontStyle:"italic",color:S,opacity:.85},null==p||null===(o=p.messageStyle)||void 0===o?void 0:o.editedTextStyle,g],null==p?void 0:p.fontFamily),children:null!=y?y:"edited"}),e.jsx(n.Text,{style:J([r(qt||(qt=P(["text-xs"]))),{color:w}],null==p?void 0:p.fontFamily),children:s}),c&&e.jsxs(n.View,{style:r($t||($t=P(["ml-1 flex-row items-center"]))),children:["sent"===A&&e.jsx(mn,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(i=p.colors)||void 0===i?void 0:i.sentIconColor)||"#6B7280"}),"delivered"===A&&e.jsx(pn,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(l=p.colors)||void 0===l?void 0:l.deliveredIconColor)||"#6B7280"}),"read"===A&&e.jsx(pn,{style:r.style("h-4 w-4",{opacity:.9}),fill:(null==p||null===(a=p.colors)||void 0===a?void 0:a.readIconColor)||"#3B82F6"})]})]})})},gn=t.memo(yn),xn=function(o){var i,l,a,s,A,c,u,d,C,v,h,f,p,m,g,x=o.message,b=o.isCurrentUser,w=o.isFirstInSequence,S=o.onLongPress,k=o.staticMode,E=void 0!==k&&k,j=D(),I=j.theme,M=j.showAvatars,T=j.showUserNames,O=j.showBubbleTail,_=j.setMediaViewerGallery,R=j.isVideoPlaying,F=j.replyProps,V=j.startReply,K=j.selectionMode,L=j.isSelected,B=j.toggleSelection,U=j.selectionUI,H=y(y({},null==I?void 0:I.selection),U),N=t.useRef(null),W=(null===(i=null==F?void 0:F.enableReply)||void 0===i||i)&&!K&&!E,Y=null!==(l=null==F?void 0:F.swipeThreshold)&&void 0!==l?l:60,X=Q(x),q=(null!==(a=null===(s=x.fileAttachments)||void 0===s?void 0:s.length)&&void 0!==a?a:0)>0&&0===X.length&&!x.text&&!x.audio,$=L(x.id),Z=t.useCallback((function(){var e;E||(K?B(x):null===(e=N.current)||void 0===e||e.measureInWindow((function(e,t,n,r){null==S||S({x:e,y:t,width:n,height:r,isCurrentUser:b,isFirstInSequence:w})})))}),[E,K,B,x,S,b,w]),ee=t.useCallback((function(){K&&B(x)}),[K,B,x]),te=t.useCallback((function(e,t){K?B(x):_(e,t)}),[K,B,x,_]),ne=null==H?void 0:H.rowBackgroundColor,re=null==H?void 0:H.overlayColor,oe=(null==I||null===(A=I.colors)||void 0===A?void 0:A.sentBubbleBackgroundColor)||(null==I||null===(c=I.colors)||void 0===c?void 0:c.sentMessageTailColor)||"#22c55e",ie=re||bn(oe,.32),ae=ne||bn(oe,.12),se=[r(Zt||(Zt=P(["px-2 my-1 max-w-[75%] relative"]))),x.replyTo?r(en||(en=P(["w-[75%]"]))):null,r(b?tn||(tn=P(["self-end mr-3"])):nn||(nn=P(["self-start ml-9"]))),r(w?b?rn||(rn=P(["bg-green-500 rounded-tr-none"])):on||(on=P(["bg-white rounded-tl-none"])):b?ln||(ln=P(["bg-green-500"])):an||(an=P(["bg-white"]))),y(y({borderRadius:8},z(I,b)?{backgroundColor:z(I,b)}:{}),b?null==I||null===(u=I.bubbleStyle)||void 0===u?void 0:u.sent:null==I||null===(d=I.bubbleStyle)||void 0===d?void 0:d.received)],Ae=e.jsxs(e.Fragment,{children:[!b&&w&&M&&e.jsxs(e.Fragment,{children:[e.jsx(n.View,{style:r(sn||(sn=P(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:x.senderAvatar?e.jsx(n.Image,{source:{uri:x.senderAvatar},style:[r(An||(An=P(["w-full h-full rounded-full"]))),null==I||null===(C=I.bubbleStyle)||void 0===C?void 0:C.avatarImageStyle],resizeMode:"cover"}):e.jsx(n.Text,{style:J([r(cn||(cn=P(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==I||null===(v=I.bubbleStyle)||void 0===v?void 0:v.avatarTextStyle],null==I?void 0:I.fontFamily),children:null===(h=x.senderName)||void 0===h?void 0:h.charAt(0)})}),T&&x.senderName&&e.jsx(n.Text,{style:J([r(un||(un=P(["text-sm text-black font-semibold mt-1 capitalize"]))),null==I||null===(f=I.bubbleStyle)||void 0===f?void 0:f.userNameStyle],null==I?void 0:I.fontFamily),children:x.senderName})]}),w&&O&&e.jsx(G,{style:r.style("absolute w-6 h-6",b?"rotate-90 -right-3.5 mt-[1.24px] -top-1":"rotate-180 -left-3.5 mt-[1.5px] -top-[3px]"),color:b?(null==I||null===(p=I.colors)||void 0===p?void 0:p.sentMessageTailColor)||"rgba(34, 197, 94, 1)":(null==I||null===(m=I.colors)||void 0===m?void 0:m.receivedMessageTailColor)||"white"}),e.jsx(fn,{message:x,isCurrentUser:b,isFirstInSequence:w,onGalleryOpen:te,isVideoPlaying:R,onLongPress:E?void 0:Z}),e.jsx(gn,{time:x.time,edited:x.edited,status:b?x.status:void 0,isCurrentUser:b,hasText:!!x.text,hasAudio:!!x.audio,hasGalleryMedia:X.length>0&&!x.text,hasFileAttachments:q}),!E&&K&&$&&(g=b?{right:-14}:{left:-14},e.jsx(n.View,{pointerEvents:"none",style:[r(dn||(dn=P(["absolute inset-0"]))),{backgroundColor:ie,borderRadius:8},{top:-6},g]}))]});if(E)return e.jsx(n.View,{style:se,children:Ae});var ce=e.jsx(n.Pressable,{ref:N,onLongPress:Z,onPress:ee,delayLongPress:250,style:se,children:Ae}),ue=null==F?void 0:F.swipe,de=e.jsx(le,{isCurrentUser:b,enabled:W,swipeThreshold:Y,onReply:function(){return V(x)},iconColor:null==ue?void 0:ue.iconColor,iconBackground:null==ue?void 0:ue.iconBackground,iconSize:null==ue?void 0:ue.iconSize,children:ce});return e.jsx(n.Pressable,{onPress:ee,onLongPress:Z,delayLongPress:250,style:[r(Cn||(Cn=P(["w-full"]))),K&&$?{backgroundColor:ae}:null],children:de})};function bn(e,t){if(e.startsWith("#")){var n=e.slice(1);if(3===n.length&&(n=n.split("").map((function(e){return e+e})).join("")),6===n.length){var r=parseInt(n.slice(0,2),16),o=parseInt(n.slice(2,4),16),i=parseInt(n.slice(4,6),16);return"rgba(".concat(r,", ").concat(o,", ").concat(i,", ").concat(t,")")}}return e.startsWith("rgb(")?e.replace("rgb(","rgba(").replace(")",", ".concat(t,")")):e}var wn=t.memo(xn),Sn=function(t){var n=t.style,r=t.color;return e.jsx(o.Svg,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,children:[e.jsx(o.Circle,{cx:"12",cy:"13",r:"3"}),e.jsx(o.Path,{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.jsx(o.Path,{strokeLinecap:"round",d:"M19 10h-1"})]})})},kn=function(t){var n=t.style,r=t.color;return e.jsxs(o,{width:14,height:14,viewBox:"0 0 24 24",style:n,children:[e.jsx(o.Line,{x1:"18",y1:"6",x2:"6",y2:"18",stroke:r,strokeWidth:2.5,strokeLinecap:"round"}),e.jsx(o.Line,{x1:"6",y1:"6",x2:"18",y2:"18",stroke:r,strokeWidth:2.5,strokeLinecap:"round"})]})},En=function(t){var n=t.style,r=t.color,i=void 0===r?"#FFFFFF":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:i,strokeWidth:"1.5",children:[e.jsx(o.Path,{d:"m15.287 3.152l-.927.927l-8.521 8.52c-.577.578-.866.867-1.114 1.185a6.6 6.6 0 0 0-.749 1.211c-.173.364-.302.752-.56 1.526l-1.094 3.281l-.268.802a1.06 1.06 0 0 0 1.342 1.342l.802-.268l3.281-1.094c.775-.258 1.162-.387 1.526-.56q.647-.308 1.211-.749c.318-.248.607-.537 1.184-1.114l8.521-8.521l.927-.927a3.932 3.932 0 0 0-5.561-5.561Z"}),e.jsx(o.Path,{d:"M14.36 4.078s.116 1.97 1.854 3.708s3.707 1.853 3.707 1.853M4.198 21.678l-1.876-1.876",opacity:".5"})]})})},jn=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:r,children:[e.jsx(o.Path,{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.jsx(o.Ellipse,{cx:"14.509",cy:"9.774",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 14.51 9.774)"}),e.jsx(o.Ellipse,{cx:"8.714",cy:"11.328",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 8.714 11.328)"}),e.jsx(o.Path,{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.jsx(o.Path,{strokeWidth:"1.5",d:"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935"})]})})},In=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,children:[e.jsx(o.Path,{d:"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z"}),e.jsx(o.Path,{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"})]})})},Mn=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,fill:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{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"})})},Pn=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,children:[e.jsx(o.Path,{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.jsx(o.Path,{strokeLinecap:"round",d:"m17.79 6.21l-4.211 4.165",opacity:".5"})]})})};function Tn(){return On.apply(this,arguments)}function On(){return(On=u(R().mark((function e(){var t;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("android"!==n.Platform.OS){e.next=11;break}return e.prev=1,e.next=4,n.PermissionsAndroid.request(n.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,{title:"Microphone Permission",message:"This app needs access to your microphone to record audio.",buttonPositive:"OK"});case 4:return t=e.sent,e.abrupt("return",t===n.PermissionsAndroid.RESULTS.GRANTED);case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",!1);case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}var _n,Rn,Gn,Fn,Vn,Kn,Dn,Ln,Bn,Un,Hn,Nn,Wn,Yn,zn,Qn,Xn,Jn,qn,$n,Zn,er,tr="ios"===n.Platform.OS?50:48,nr="#FFFFFF",rr="#E9EDEF",or=function(t){var n=t.style,r=t.color,i=void 0===r?"#6b7280":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",fill:"none",children:e.jsx(o.Path,{d:"M6 15l6-6 6 6",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},ir=function(t){var n=t.style,r=t.color,i=void 0===r?"#6b7280":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:i,strokeWidth:"1.5",children:[e.jsx(o.Path,{d:"M2 16c0-2.828 0-4.243.879-5.121C3.757 10 5.172 10 8 10h8c2.828 0 4.243 0 5.121.879C22 11.757 22 13.172 22 16s0 4.243-.879 5.121C20.243 22 18.828 22 16 22H8c-2.828 0-4.243 0-5.121-.879C2 20.243 2 18.828 2 16Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M6 10V8a6 6 0 1 1 12 0v2",opacity:".5"})]})})},lr=function(t){var n=t.width,o=t.bottomOffset,i=t.background,a=t.lockColor,s=t.chevronColor,A=t.lockIconSize,c=t.pillAnimatedStyle,u=t.chevronAnimatedStyle,d=t.styleOverride,C=t.renderLockIcon;return e.jsxs(l.View,{style:[r(_n||(_n=P(["absolute items-center justify-center rounded-2xl py-2.5"]))),{width:n,backgroundColor:i,bottom:o,gap:6},d,c],pointerEvents:"none",children:[C?C():e.jsx(ir,{style:{width:A,height:A},color:a}),e.jsx(l.View,{style:u,children:e.jsx(or,{style:{width:14,height:14},color:s})})]})},ar=function(t){var o=t.isHold,a=t.duration,s=t.composedGesture,A=t.micWrapperStyle,c=t.slideTextAnimatedStyle,u=t.lockPillAnimatedStyle,d=t.chevronAnimatedStyle,C=t.primaryColor,v=t.microphoneColor,h=t.timerColor,f=t.cancelTextColor,p=t.holdPillBackground,m=t.lockPillBackground,y=t.lockColor,g=t.chevronColor,x=t.iconSize,b=t.lockIconSize,w=t.inputBarHeight,S=t.micSize,k=t.enableLockRecording,E=t.showSendButton,j=t.onSendPress,I=t.sendButtonBackgroundColor,M=t.sendButtonIconColor,T=t.headerSlot,O=t.renderInputPill,_=t.renderMicIcon,R=t.renderSendIcon,G=t.renderArrowIcon,F=t.renderLockIcon,V=t.containerStyleOverride,K=t.timerTextStyle,D=t.slideTextStyleOverride,L=t.lockPillStyleOverride,B=t.sendButtonStyle,U=t.fontFamily,H={minHeight:w,backgroundColor:p},N={height:S,width:S,backgroundColor:C};return e.jsxs(n.View,{style:[r(Rn||(Rn=P(["flex-row items-end gap-2 relative"]))),V],pointerEvents:"box-none",children:[o?e.jsxs(n.View,{style:[r(Gn||(Gn=P(["flex-1 rounded-3xl overflow-hidden"]))),H],children:[T,e.jsxs(n.View,{style:r(Fn||(Fn=P(["flex-row items-center px-4 flex-1 min-h-[48px]"]))),children:[e.jsx(n.Text,{style:J([r(Vn||(Vn=P(["text-base font-semibold"]))),{color:h,minWidth:42},K],U),numberOfLines:1,children:ct(a)}),e.jsxs(l.View,{style:[r(Kn||(Kn=P(["flex-1 flex-row items-center justify-center gap-1.5"]))),c],children:[G?G():e.jsx(n.Text,{style:J([r(Dn||(Dn=P(["text-base leading-none"]))),{color:f,marginTop:-2}],U),children:"‹"}),e.jsx(n.Text,{style:J([r(Ln||(Ln=P(["text-sm"]))),{color:f},D],U),children:"Slide to cancel"})]})]})]}):null==O?void 0:O(),e.jsxs(n.View,{style:[r(Bn||(Bn=P(["relative items-center justify-center"]))),{height:w,width:w}],children:[k&&o&&e.jsx(lr,{width:S-8,bottomOffset:S+6,background:m,lockColor:y,chevronColor:g,lockIconSize:b,pillAnimatedStyle:u,chevronAnimatedStyle:d,styleOverride:L,renderLockIcon:F}),E&&!o?e.jsx(n.Pressable,{onPress:j,style:[r(Un||(Un=P(["items-center justify-center rounded-full"]))),{height:S,width:S,backgroundColor:null!=I?I:C},B],accessibilityRole:"button",accessibilityLabel:"Send",children:R?R():e.jsx(Pn,{style:{width:x,height:x},color:null!=M?M:v})}):e.jsx(i.GestureDetector,{gesture:s,children:e.jsx(l.View,{style:[r(Hn||(Hn=P(["items-center justify-center rounded-full"]))),N,B,A],accessibilityRole:"button",accessibilityLabel:"Tap to record. Long-press and slide left to cancel or up to lock.",children:_?_():e.jsx(In,{style:{width:x+6,height:x+6},color:v})})})]})]})},sr=function(t){var n=t.style,r=t.color,i=void 0===r?"#ef4444":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:i,strokeLinecap:"round",strokeWidth:"1.5",children:[e.jsx(o.Path,{d:"M9.17 4a3.001 3.001 0 0 1 5.66 0",opacity:".5"}),e.jsx(o.Path,{d:"M20.5 6h-17m15.333 2.5l-.46 6.9c-.177 2.654-.265 3.981-1.13 4.79s-2.195.81-4.856.81h-.774c-2.66 0-3.99 0-4.856-.81c-.865-.809-.953-2.136-1.13-4.79l-.46-6.9"}),e.jsx(o.Path,{d:"m9.5 11l.5 5m4.5-5l-.5 5",opacity:".5"})]})})},Ar=function(t){var o=t.color,i=t.tick,l=t.count;return e.jsx(n.View,{style:r(Nn||(Nn=P(["flex-row items-center justify-between h-6"]))),children:Array.from({length:l}).map((function(t,n){return e.jsx(ur,{index:n,total:l,color:o,tick:i},n)}))})},cr={code:'function WaveformTsx1(){const{tick,index,total}=this.__closure;const t=tick.value*Math.PI*2;const phase1=Math.sin(t*2+index*0.55);const phase2=Math.sin(t*4+index*1.3);const phase3=Math.sin(t*0.9+index*0.27);const combined=(phase1*0.55+phase2*0.3+phase3*0.4)*0.5+0.5;const edge=Math.sin(index/Math.max(1,total-1)*Math.PI);const amp=Math.max(0.18,Math.min(1,combined)*(0.35+0.65*edge));return{height:Math.round(amp*100)+"%"};}',location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/Waveform.tsx",sourceMap:'{"version":3,"names":["WaveformTsx1","tick","index","total","__closure","t","value","Math","PI","phase1","sin","phase2","phase3","combined","edge","max","amp","min","height","round"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/Waveform.tsx"],"mappings":"AAQ2C,SAAAA,YAAMA,CAAA,QAAAC,IAAA,CAAAC,KAAA,CAAAC,KAAA,OAAAC,SAAA,CAEzC,KAAM,CAAAC,CAAC,CAAGJ,IAAI,CAACK,KAAK,CAAGC,IAAI,CAACC,EAAE,CAAG,CAAC,CAClC,KAAM,CAAAC,MAAM,CAAGF,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,CAAC,CAAGH,KAAK,CAAG,IAAI,CAAC,CAC7C,KAAM,CAAAS,MAAM,CAAGJ,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,CAAC,CAAGH,KAAK,CAAG,GAAG,CAAC,CAC5C,KAAM,CAAAU,MAAM,CAAGL,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,GAAG,CAAGH,KAAK,CAAG,IAAI,CAAC,CAC/C,KAAM,CAAAW,QAAQ,CAAG,CAACJ,MAAM,CAAG,IAAI,CAAGE,MAAM,CAAG,GAAG,CAAGC,MAAM,CAAG,GAAG,EAAI,GAAG,CAAG,GAAG,CAC1E,KAAM,CAAAE,IAAI,CAAGP,IAAI,CAACG,GAAG,CAAER,KAAK,CAAGK,IAAI,CAACQ,GAAG,CAAC,CAAC,CAAEZ,KAAK,CAAG,CAAC,CAAC,CAAII,IAAI,CAACC,EAAE,CAAC,CACjE,KAAM,CAAAQ,GAAG,CAAGT,IAAI,CAACQ,GAAG,CAAC,IAAI,CAAER,IAAI,CAACU,GAAG,CAAC,CAAC,CAAEJ,QAAQ,CAAC,EAAI,IAAI,CAAG,IAAI,CAAGC,IAAI,CAAC,CAAC,CACxE,MAAO,CAAEI,MAAM,CAAKX,IAAI,CAACY,KAAK,CAACH,GAAG,CAAG,GAAG,CAAC,IAAI,CAAC,CAClD","ignoreList":[]}',version:"3.16.7"},ur=function(t){var n,o,i=t.index,a=t.total,s=t.color,A=t.tick,c=l.useAnimatedStyle((n=[new global.Error,-4,-27],(o=function(){var e=A.value*Math.PI*2,t=.5*(.55*Math.sin(2*e+.55*i)+.3*Math.sin(4*e+1.3*i)+.4*Math.sin(.9*e+.27*i))+.5,n=Math.sin(i/Math.max(1,a-1)*Math.PI),r=Math.max(.18,Math.min(1,t)*(.35+.65*n));return{height:"".concat(Math.round(100*r),"%")}}).__closure={tick:A,index:i,total:a},o.__workletHash=4276075972187,o.__initData=cr,o.__stackDetails=n,o));return e.jsx(l.View,{style:[r(Wn||(Wn=P(["mx-px rounded-full"]))),{width:2,backgroundColor:s},c]})},dr=function(t){var o=t.duration,a=t.isPaused,s=t.composedGesture,A=t.micWrapperStyle,c=t.pausePulseStyle,u=t.recDotStyle,d=t.waveTick,C=t.onCancelPress,v=t.onTogglePause,h=t.backgroundColor,f=t.timerColor,p=t.waveformColor,m=t.deleteIconColor,y=t.pauseIconColor,g=t.primaryColor,x=t.micSize,b=t.iconSize,w=t.inputBarHeight,S=t.waveCount,k=t.enableWaveform,E=t.headerSlot,j=t.renderDeleteIcon,I=t.renderPauseIcon,M=t.renderPlayIcon,T=t.renderSendIcon,O=t.renderWaveform,_=t.containerStyleOverride,R=t.barStyleOverride,G=t.timerTextStyle,F=t.waveformStyle,V=t.trashButtonStyle,K=t.sendButtonStyle,D=t.fontFamily,L={minHeight:w+50,backgroundColor:h},B={height:x,width:x,backgroundColor:g};return e.jsxs(n.View,{style:[r(Yn||(Yn=P(["w-full rounded-2xl px-4 py-2.5"]))),L,_,R],children:[E,e.jsxs(n.View,{style:r(zn||(zn=P(["flex-row items-center gap-3 px-1 pt-1.5 pb-2"]))),children:[e.jsx(l.View,{style:[r(Qn||(Qn=P(["w-1.5 h-1.5 rounded-full"]))),{backgroundColor:y},u]}),e.jsx(n.Text,{style:J([r(Xn||(Xn=P(["text-base font-semibold"]))),{color:f,minWidth:42},G],D),numberOfLines:1,children:ct(o)}),k&&e.jsx(n.View,{style:[r(Jn||(Jn=P(["flex-1"]))),F],children:O?O():e.jsx(Ar,{color:p,tick:d,count:S})})]}),e.jsxs(n.View,{style:r(qn||(qn=P(["flex-row items-center justify-between mt-1"]))),children:[e.jsx(n.Pressable,{onPress:C,hitSlop:12,style:[r($n||($n=P(["items-center justify-center rounded-full"]))),{width:x,height:x},V],accessibilityRole:"button",accessibilityLabel:"Delete recording",children:j?j():e.jsx(sr,{style:r.style("w-6 h-6"),color:m})}),e.jsx(n.Pressable,{onPress:v,hitSlop:12,style:r(Zn||(Zn=P(["items-center justify-center px-4"]))),accessibilityRole:"button",accessibilityLabel:a?"Resume recording":"Pause recording",children:a?M?M():e.jsx(at,{style:r.style("w-7 h-7"),color:y}):e.jsx(l.View,{style:c,children:I?I():e.jsx(lt,{style:r.style("w-7 h-7"),color:y})})}),e.jsx(i.GestureDetector,{gesture:s,children:e.jsx(l.View,{style:[r(er||(er=P(["items-center justify-center rounded-full"]))),B,K,A],accessibilityRole:"button",accessibilityLabel:"Send recording",children:T?T():e.jsx(Pn,{style:{width:b,height:b},color:"#FFFFFF"})})})]})]})};function Cr(){n.Vibration.vibrate(15)}var vr={code:"function useFlowControllerTs1(_e,success){const{runOnJS,fireQuickTap}=this.__closure;if(success)runOnJS(fireQuickTap)();}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs1","_e","success","runOnJS","fireQuickTap","__closure"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AA0OmB,QAAC,CAAAA,oBAAgBA,CAAAC,EAAA,CAAAC,OAAA,QAAAC,OAAA,CAAAC,YAAA,OAAAC,SAAA,CAExB,GAAIH,OAAO,CACPC,OAAO,CAACC,YAAY,CAAC,CAAC,CAAC,CAC/B","ignoreList":[]}',version:"3.16.7"},hr={code:"function useFlowControllerTs2(){const{runOnJS,fireHoldStart}=this.__closure;runOnJS(fireHoldStart)();}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs2","runOnJS","fireHoldStart","__closure"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAiPqB,SAAAA,oBAAMA,CAAA,QAAAC,OAAA,CAAAC,aAAA,OAAAC,SAAA,CAEfF,OAAO,CAACC,aAAa,CAAC,CAAC,CAAC,CAC5B","ignoreList":[]}',version:"3.16.7"},fr={code:"function useFlowControllerTs3(e){const{stateShared,STATE_HOLD,maxLeftShared,maxUpShared,translateX,translateY,enableLockShared,lockFiredShared,lockThresholdShared,runOnJS,fireLock,enableCancelShared,cancelFiredShared,cancelThresholdShared,fireCancel}=this.__closure;if(stateShared.value!==STATE_HOLD)return;const rawTx=Math.max(maxLeftShared.value,Math.min(0,e.translationX));const rawTy=Math.max(maxUpShared.value,Math.min(0,e.translationY));const dominantY=Math.abs(rawTy)>Math.abs(rawTx);translateX.value=dominantY?0:rawTx;translateY.value=dominantY?rawTy:0;if(dominantY&&enableLockShared.value===1&&lockFiredShared.value===0&&rawTy<=lockThresholdShared.value){lockFiredShared.value=1;runOnJS(fireLock)();}if(!dominantY&&enableCancelShared.value===1&&cancelFiredShared.value===0&&rawTx<=cancelThresholdShared.value){cancelFiredShared.value=1;runOnJS(fireCancel)();}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs3","e","stateShared","STATE_HOLD","maxLeftShared","maxUpShared","translateX","translateY","enableLockShared","lockFiredShared","lockThresholdShared","runOnJS","fireLock","enableCancelShared","cancelFiredShared","cancelThresholdShared","fireCancel","__closure","value","rawTx","Math","max","min","translationX","rawTy","translationY","dominantY","abs"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAqPuB,QAAC,CAAAA,oBAAKA,CAAAC,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,aAAA,CAAAC,WAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,gBAAA,CAAAC,eAAA,CAAAC,mBAAA,CAAAC,OAAA,CAAAC,QAAA,CAAAC,kBAAA,CAAAC,iBAAA,CAAAC,qBAAA,CAAAC,UAAA,OAAAC,SAAA,CAEjB,GAAIf,WAAW,CAACgB,KAAK,GAAKf,UAAU,CAChC,OACJ,KAAM,CAAAgB,KAAK,CAAGC,IAAI,CAACC,GAAG,CAACjB,aAAa,CAACc,KAAK,CAAEE,IAAI,CAACE,GAAG,CAAC,CAAC,CAAErB,CAAC,CAACsB,YAAY,CAAC,CAAC,CACxE,KAAM,CAAAC,KAAK,CAAGJ,IAAI,CAACC,GAAG,CAAChB,WAAW,CAACa,KAAK,CAAEE,IAAI,CAACE,GAAG,CAAC,CAAC,CAAErB,CAAC,CAACwB,YAAY,CAAC,CAAC,CACtE,KAAM,CAAAC,SAAS,CAAGN,IAAI,CAACO,GAAG,CAACH,KAAK,CAAC,CAAGJ,IAAI,CAACO,GAAG,CAACR,KAAK,CAAC,CAGnDb,UAAU,CAACY,KAAK,CAAGQ,SAAS,CAAG,CAAC,CAAGP,KAAK,CACxCZ,UAAU,CAACW,KAAK,CAAGQ,SAAS,CAAGF,KAAK,CAAG,CAAC,CACxC,GAAIE,SAAS,EACTlB,gBAAgB,CAACU,KAAK,GAAK,CAAC,EAC5BT,eAAe,CAACS,KAAK,GAAK,CAAC,EAC3BM,KAAK,EAAId,mBAAmB,CAACQ,KAAK,CAAE,CACpCT,eAAe,CAACS,KAAK,CAAG,CAAC,CACzBP,OAAO,CAACC,QAAQ,CAAC,CAAC,CAAC,CACvB,CACA,GAAI,CAACc,SAAS,EACVb,kBAAkB,CAACK,KAAK,GAAK,CAAC,EAC9BJ,iBAAiB,CAACI,KAAK,GAAK,CAAC,EAC7BC,KAAK,EAAIJ,qBAAqB,CAACG,KAAK,CAAE,CACtCJ,iBAAiB,CAACI,KAAK,CAAG,CAAC,CAC3BP,OAAO,CAACK,UAAU,CAAC,CAAC,CAAC,CACzB,CACJ","ignoreList":[]}',version:"3.16.7"},pr={code:"function useFlowControllerTs4(){const{lockFiredShared,cancelFiredShared,enableLockShared,translateY,LOCK_ON_RELEASE_DELTA,runOnJS,fireLock,fireHoldEnd}=this.__closure;if(lockFiredShared.value===1||cancelFiredShared.value===1)return;if(enableLockShared.value===1&&translateY.value<-LOCK_ON_RELEASE_DELTA){lockFiredShared.value=1;runOnJS(fireLock)();return;}runOnJS(fireHoldEnd)();}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs4","lockFiredShared","cancelFiredShared","enableLockShared","translateY","LOCK_ON_RELEASE_DELTA","runOnJS","fireLock","fireHoldEnd","__closure","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AA+QmB,SAAAA,oBAAMA,CAAA,QAAAC,eAAA,CAAAC,iBAAA,CAAAC,gBAAA,CAAAC,UAAA,CAAAC,qBAAA,CAAAC,OAAA,CAAAC,QAAA,CAAAC,WAAA,OAAAC,SAAA,CAEb,GAAIR,eAAe,CAACS,KAAK,GAAK,CAAC,EAC3BR,iBAAiB,CAACQ,KAAK,GAAK,CAAC,CAC7B,OACJ,GAAIP,gBAAgB,CAACO,KAAK,GAAK,CAAC,EAC5BN,UAAU,CAACM,KAAK,CAAG,CAACL,qBAAqB,CAAE,CAC3CJ,eAAe,CAACS,KAAK,CAAG,CAAC,CACzBJ,OAAO,CAACC,QAAQ,CAAC,CAAC,CAAC,CACnB,OACJ,CACAD,OAAO,CAACE,WAAW,CAAC,CAAC,CAAC,CAC1B","ignoreList":[]}',version:"3.16.7"},mr={code:"function useFlowControllerTs5(){const{lockFiredShared,cancelFiredShared,translateX,withSpring,translateY}=this.__closure;if(lockFiredShared.value===0&&cancelFiredShared.value===0){translateX.value=withSpring(0,{damping:18,stiffness:220});translateY.value=withSpring(0,{damping:18,stiffness:220});}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs5","lockFiredShared","cancelFiredShared","translateX","withSpring","translateY","__closure","value","damping","stiffness"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AA4RwB,SAAAA,oBAAMA,CAAA,QAAAC,eAAA,CAAAC,iBAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,UAAA,OAAAC,SAAA,CAElB,GAAIL,eAAe,CAACM,KAAK,GAAK,CAAC,EAAIL,iBAAiB,CAACK,KAAK,GAAK,CAAC,CAAE,CAC9DJ,UAAU,CAACI,KAAK,CAAGH,UAAU,CAAC,CAAC,CAAE,CAAEI,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CACjEJ,UAAU,CAACE,KAAK,CAAGH,UAAU,CAAC,CAAC,CAAE,CAAEI,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CACrE,CACJ","ignoreList":[]}',version:"3.16.7"},yr={code:"function useFlowControllerTs6(){const{stateShared,STATE_HOLD,translateX,translateY,micScale}=this.__closure;const isHold=stateShared.value===STATE_HOLD;return{transform:[{translateX:isHold?translateX.value:0},{translateY:isHold?translateY.value:0},{scale:micScale.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs6","stateShared","STATE_HOLD","translateX","translateY","micScale","__closure","isHold","value","transform","scale"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAsS6C,SAAAA,oBAAMA,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,QAAA,OAAAC,SAAA,CAC3C,KAAM,CAAAC,MAAM,CAAGN,WAAW,CAACO,KAAK,GAAKN,UAAU,CAC/C,MAAO,CACHO,SAAS,CAAE,CACP,CAAEN,UAAU,CAAEI,MAAM,CAAGJ,UAAU,CAACK,KAAK,CAAG,CAAE,CAAC,CAC7C,CAAEJ,UAAU,CAAEG,MAAM,CAAGH,UAAU,CAACI,KAAK,CAAG,CAAE,CAAC,CAC7C,CAAEE,KAAK,CAAEL,QAAQ,CAACG,KAAM,CAAC,CAEjC,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},gr={code:"function useFlowControllerTs7(){const{interpolate,translateX,cancelThresholdShared,Extrapolation,arrowPulse}=this.__closure;const opacity=interpolate(translateX.value,[0,cancelThresholdShared.value],[1,0],Extrapolation.CLAMP);return{opacity:opacity,transform:[{translateX:translateX.value*0.4+arrowPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs7","interpolate","translateX","cancelThresholdShared","Extrapolation","arrowPulse","__closure","opacity","value","CLAMP","transform"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAgToD,SAAAA,oBAAMA,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,qBAAA,CAAAC,aAAA,CAAAC,UAAA,OAAAC,SAAA,CAClD,KAAM,CAAAC,OAAO,CAAGN,WAAW,CAACC,UAAU,CAACM,KAAK,CAAE,CAAC,CAAC,CAAEL,qBAAqB,CAACK,KAAK,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAEJ,aAAa,CAACK,KAAK,CAAC,CAC5G,MAAO,CACHF,OAAO,CAAPA,OAAO,CACPG,SAAS,CAAE,CAAC,CAAER,UAAU,CAAEA,UAAU,CAACM,KAAK,CAAG,GAAG,CAAGH,UAAU,CAACG,KAAM,CAAC,CACzE,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},xr={code:"function useFlowControllerTs8(){const{interpolate,translateY,lockThresholdShared,Extrapolation}=this.__closure;const lockProgress=interpolate(translateY.value,[0,lockThresholdShared.value],[0,1],Extrapolation.CLAMP);return{transform:[{translateY:interpolate(lockProgress,[0,1],[0,-22])}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs8","interpolate","translateY","lockThresholdShared","Extrapolation","__closure","lockProgress","value","CLAMP","transform"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAuTmD,SAAAA,oBAAMA,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,mBAAA,CAAAC,aAAA,OAAAC,SAAA,CACjD,KAAM,CAAAC,YAAY,CAAGL,WAAW,CAACC,UAAU,CAACK,KAAK,CAAE,CAAC,CAAC,CAAEJ,mBAAmB,CAACI,KAAK,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAEH,aAAa,CAACI,KAAK,CAAC,CAC/G,MAAO,CACHC,SAAS,CAAE,CACP,CAAEP,UAAU,CAAED,WAAW,CAACK,YAAY,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC,CAAE,CAAC,CAEnE,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},br={code:"function useFlowControllerTs9(){const{chevronPulse}=this.__closure;return{transform:[{translateY:chevronPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs9","chevronPulse","__closure","transform","translateY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AA+TkD,SAAAA,qBAAA,QAAAC,YAAA,OAAAC,SAAA,OAAO,CACjDC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAClD,CAAC","ignoreList":[]}',version:"3.16.7"},wr={code:"function useFlowControllerTs10(){const{isPaused,pausePulse}=this.__closure;return{opacity:isPaused?1:pausePulse.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs10","isPaused","pausePulse","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAkU6C,SAAAA,sBAAA,QAAAC,QAAA,CAAAC,UAAA,OAAAC,SAAA,OAAO,CAC5CC,OAAO,CAAEH,QAAQ,CAAG,CAAC,CAAGC,UAAU,CAACG,KACvC,CAAC","ignoreList":[]}',version:"3.16.7"},Sr={code:"function useFlowControllerTs11(){const{recBlink}=this.__closure;return{opacity:recBlink.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs11","recBlink","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAqUyC,SAAAA,sBAAA,QAAAC,QAAA,OAAAC,SAAA,OAAO,CACxCC,OAAO,CAAEF,QAAQ,CAACG,KACtB,CAAC","ignoreList":[]}',version:"3.16.7"};var kr=function(n){var r=n.primaryColor,o=void 0===r?"#16A34A":r,a=n.backgroundColor,s=void 0===a?"#0B141A":a,A=n.holdPillBackground,c=void 0===A?"#1F2C33":A,u=n.timerColor,d=void 0===u?nr:u,C=n.microphoneColor,v=void 0===C?nr:C,h=n.lockColor,f=void 0===h?rr:h,p=n.waveformColor,m=void 0===p?rr:p,y=n.deleteIconColor,g=void 0===y?"#8696A0":y,x=n.cancelTextColor,b=void 0===x?"rgba(255,255,255,0.6)":x,w=n.chevronColor,S=n.pauseIconColor,k=void 0===S?"#F15C6D":S,E=n.lockPillBackground,j=void 0===E?"#1F2C33":E,I=n.inputBarHeight,P=void 0===I?tr:I,T=n.micSize,O=n.holdMicScale,_=void 0===O?1.18:O,R=n.iconSize,G=void 0===R?22:R,F=n.lockIconSize,V=void 0===F?18:F,K=n.enableLockRecording,D=void 0===K||K,L=n.enableSlideToCancel,B=void 0===L||L,U=n.enableWaveform,H=void 0===U||U,N=n.lockSlideDistance,W=void 0===N?70:N,Y=n.cancelSlideDistance,z=void 0===Y?90:Y,Q=n.waveCount,X=void 0===Q?32:Q,J=n.headerSlot,q=n.showSendButton,$=n.onSendPress,Z=n.sendButtonBackgroundColor,ee=n.sendButtonIconColor,te=n.renderInputPill,ne=n.renderMicIcon,re=n.renderSendIcon,oe=n.renderLockIcon,ie=n.renderArrowIcon,le=n.renderDeleteIcon,ae=n.renderPauseIcon,se=n.renderPlayIcon,Ae=n.renderWaveform,ce=n.containerStyle,ue=n.barStyle,de=n.timerTextStyle,Ce=n.slideTextStyle,ve=n.waveformStyle,he=n.lockPillStyle,fe=n.trashButtonStyle,pe=n.sendButtonStyle,me=n.fontFamily,ye=null!=T?T:P,ge=null!=w?w:f,xe=function(e){var n=e.cancelSlideDistance,r=e.lockSlideDistance,o=e.enableLockRecording,a=e.enableSlideToCancel,s=e.holdMicScale,A=e.onRecordingStart,c=e.onRecordingStop,u=e.onSend,d=e.onDelete,C=e.onLock,v=e.onCancel,h=e.onPauseRecording,f=e.onResumeRecording,p=e.onStateChange,m=-Math.abs(n),y=-Math.abs(r),g=m-30,x=y-20,b=M(t.useState("IDLE"),2),w=b[0],S=b[1],k=M(t.useState(0),2),E=k[0],j=k[1],I=M(t.useState(!1),2),P=I[0],T=I[1],O=t.useRef("IDLE"),_=t.useRef(!1);t.useEffect((function(){O.current=w}),[w]),t.useEffect((function(){_.current=P}),[P]);var R=t.useRef(p);R.current=p,t.useEffect((function(){var e;null===(e=R.current)||void 0===e||e.call(R,w)}),[w]);var G=l.useSharedValue(0);t.useEffect((function(){G.value=function(e){switch(e){case"IDLE":return 0;case"RECORDING_TAP":return 1;case"RECORDING_HOLD":return 2;case"LOCKED_RECORDING":return 3;case"SENDING":return 4;case"CANCELLED":return 5}}(w)}),[w]);var F=l.useSharedValue(m),V=l.useSharedValue(y),K=l.useSharedValue(g),D=l.useSharedValue(x),L=l.useSharedValue(o?1:0),B=l.useSharedValue(a?1:0);t.useEffect((function(){F.value=m,V.value=y,K.value=g,D.value=x,L.value=o?1:0,B.value=a?1:0}),[m,y,g,x,o,a]);var U=t.useRef(0),H=t.useRef(0),N=t.useRef(0),W=l.useSharedValue(0),Y=l.useSharedValue(0),z=l.useSharedValue(1),Q=l.useSharedValue(0),X=l.useSharedValue(0),J=l.useSharedValue(1),q=l.useSharedValue(0),$=l.useSharedValue(1),Z=l.useSharedValue(0),ee=l.useSharedValue(0);t.useEffect((function(){Q.value=l.withRepeat(l.withSequence(l.withTiming(-4,{duration:700,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:700,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),X.value=l.withRepeat(l.withSequence(l.withTiming(-4,{duration:600,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:600,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),J.value=l.withRepeat(l.withSequence(l.withTiming(.5,{duration:600,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(1,{duration:600,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),q.value=l.withRepeat(l.withTiming(1,{duration:4500,easing:l.Easing.linear}),-1,!1),$.value=l.withRepeat(l.withSequence(l.withTiming(.3,{duration:600}),l.withTiming(1,{duration:600})),-1,!1)}),[]),t.useEffect((function(){z.value="RECORDING_HOLD"===w?l.withSpring(s,{damping:14,stiffness:220}):l.withSpring(1,{damping:16,stiffness:220})}),[w,s]),t.useEffect((function(){if(("RECORDING_TAP"===w||"RECORDING_HOLD"===w||"LOCKED_RECORDING"===w)&&!P){var e=setInterval((function(){var e=Date.now()-U.current-H.current;j(e/1e3)}),250);return function(){return clearInterval(e)}}}),[w,P]);var te=t.useRef(A);te.current=A;var ne=t.useRef(c);ne.current=c;var re=t.useRef(u);re.current=u;var oe=t.useRef(d);oe.current=d;var ie=t.useRef(C);ie.current=C;var le=t.useRef(v);le.current=v;var ae=t.useRef(h);ae.current=h;var se=t.useRef(f);se.current=f;var Ae=t.useCallback((function(){var e;U.current=Date.now(),H.current=0,N.current=0,T(!1),j(0),Z.value=0,ee.value=0,W.value=0,Y.value=0,null===(e=te.current)||void 0===e||e.call(te)}),[]),ce=t.useCallback((function(){j(0),T(!1),H.current=0,N.current=0,W.value=0,Y.value=0,S("IDLE")}),[]),ue=t.useCallback((function(){var e,t,n=(Date.now()-U.current-H.current)/1e3;S("SENDING"),null===(e=ne.current)||void 0===e||e.call(ne),null===(t=re.current)||void 0===t||t.call(re,{duration:n}),ce()}),[ce]),de=t.useCallback((function(){var e=O.current;if("IDLE"===e)return S("RECORDING_TAP"),void Ae();"RECORDING_TAP"!==e&&"LOCKED_RECORDING"!==e||ue()}),[Ae,ue]),Ce=t.useCallback((function(){"IDLE"===O.current&&(S("RECORDING_HOLD"),Ae())}),[Ae]),ve=t.useCallback((function(){var e;"RECORDING_HOLD"===O.current&&(Cr(),S("LOCKED_RECORDING"),W.value=l.withSpring(0,{damping:18,stiffness:220}),Y.value=l.withSpring(0,{damping:18,stiffness:220}),null===(e=ie.current)||void 0===e||e.call(ie))}),[]),he=t.useCallback((function(){var e,t,n,r=O.current;"RECORDING_HOLD"!==r&&"RECORDING_TAP"!==r&&"LOCKED_RECORDING"!==r||(Cr(),S("CANCELLED"),null===(e=ne.current)||void 0===e||e.call(ne),null===(t=le.current)||void 0===t||t.call(le),null===(n=oe.current)||void 0===n||n.call(oe),ce())}),[ce]),fe=t.useCallback((function(){"RECORDING_HOLD"===O.current&&ue()}),[ue]),pe=t.useCallback((function(){var e,t,n=!_.current;n?(N.current=Date.now(),null===(e=ae.current)||void 0===e||e.call(ae)):(H.current+=Date.now()-N.current,N.current=0,null===(t=se.current)||void 0===t||t.call(se)),T(n)}),[]),me=t.useRef(de);me.current=de;var ye=t.useRef(Ce);ye.current=Ce;var ge=t.useRef(fe);ge.current=fe;var xe=t.useRef(ve);xe.current=ve;var be=t.useRef(he);be.current=he;var we,Se,ke=function(){return me.current()},Ee=function(){return ye.current()},je=function(){return ge.current()},Ie=function(){return xe.current()},Me=function(){return be.current()},Pe=t.useMemo((function(){var e,t,n=i.Gesture.Tap().maxDuration(210).onEnd((e=[new global.Error,-3,-27],(t=function(e,t){t&&l.runOnJS(ke)()}).__closure={runOnJS:l.runOnJS,fireQuickTap:ke},t.__workletHash=0xb640de2a90a,t.__initData=vr,t.__stackDetails=e,t)),r=i.Gesture.Pan().activateAfterLongPress(220).onStart(function(){var e=[new global.Error,-3,-27],t=function(){l.runOnJS(Ee)()};return t.__closure={runOnJS:l.runOnJS,fireHoldStart:Ee},t.__workletHash=3973713390129,t.__initData=hr,t.__stackDetails=e,t}()).onUpdate(function(){var e=[new global.Error,-16,-27],t=function(e){if(2===G.value){var t=Math.max(K.value,Math.min(0,e.translationX)),n=Math.max(D.value,Math.min(0,e.translationY)),r=Math.abs(n)>Math.abs(t);W.value=r?0:t,Y.value=r?n:0,r&&1===L.value&&0===ee.value&&n<=V.value&&(ee.value=1,l.runOnJS(Ie)()),!r&&1===B.value&&0===Z.value&&t<=F.value&&(Z.value=1,l.runOnJS(Me)())}};return t.__closure={stateShared:G,STATE_HOLD:2,maxLeftShared:K,maxUpShared:D,translateX:W,translateY:Y,enableLockShared:L,lockFiredShared:ee,lockThresholdShared:V,runOnJS:l.runOnJS,fireLock:Ie,enableCancelShared:B,cancelFiredShared:Z,cancelThresholdShared:F,fireCancel:Me},t.__workletHash=0xc932b7db4db,t.__initData=fr,t.__stackDetails=e,t}()).onEnd(function(){var e=[new global.Error,-9,-27],t=function(){if(1!==ee.value&&1!==Z.value)return 1===L.value&&Y.value<-12?(ee.value=1,void l.runOnJS(Ie)()):void l.runOnJS(je)()};return t.__closure={lockFiredShared:ee,cancelFiredShared:Z,enableLockShared:L,translateY:Y,LOCK_ON_RELEASE_DELTA:12,runOnJS:l.runOnJS,fireLock:Ie,fireHoldEnd:je},t.__workletHash=8222992215978,t.__initData=pr,t.__stackDetails=e,t}()).onFinalize(function(){var e=[new global.Error,-6,-27],t=function(){0===ee.value&&0===Z.value&&(W.value=l.withSpring(0,{damping:18,stiffness:220}),Y.value=l.withSpring(0,{damping:18,stiffness:220}))};return t.__closure={lockFiredShared:ee,cancelFiredShared:Z,translateX:W,withSpring:l.withSpring,translateY:Y},t.__workletHash=0xb56825c4eba,t.__initData=mr,t.__stackDetails=e,t}());return i.Gesture.Race(n,r)}),[]),Te=l.useAnimatedStyle((we=[new global.Error,-6,-27],(Se=function(){var e=2===G.value;return{transform:[{translateX:e?W.value:0},{translateY:e?Y.value:0},{scale:z.value}]}}).__closure={stateShared:G,STATE_HOLD:2,translateX:W,translateY:Y,micScale:z},Se.__workletHash=0x92736c307cb,Se.__initData=yr,Se.__stackDetails=we,Se)),Oe=l.useAnimatedStyle(function(){var e=[new global.Error,-6,-27],t=function(){return{opacity:l.interpolate(W.value,[0,F.value],[1,0],l.Extrapolation.CLAMP),transform:[{translateX:.4*W.value+Q.value}]}};return t.__closure={interpolate:l.interpolate,translateX:W,cancelThresholdShared:F,Extrapolation:l.Extrapolation,arrowPulse:Q},t.__workletHash=0xf2b5c2efb9e,t.__initData=gr,t.__stackDetails=e,t}()),_e=l.useAnimatedStyle(function(){var e=[new global.Error,-5,-27],t=function(){var e=l.interpolate(Y.value,[0,V.value],[0,1],l.Extrapolation.CLAMP);return{transform:[{translateY:l.interpolate(e,[0,1],[0,-22])}]}};return t.__closure={interpolate:l.interpolate,translateY:Y,lockThresholdShared:V,Extrapolation:l.Extrapolation},t.__workletHash=5669890750044,t.__initData=xr,t.__stackDetails=e,t}()),Re=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{translateY:X.value}]}};return t.__closure={chevronPulse:X},t.__workletHash=0xd07d519242c,t.__initData=br,t.__stackDetails=e,t}()),Ge=l.useAnimatedStyle(function(){var e=[new global.Error,-3,-27],t=function(){return{opacity:P?1:J.value}};return t.__closure={isPaused:P,pausePulse:J},t.__workletHash=0xea4d31d5a5c,t.__initData=wr,t.__stackDetails=e,t}()),Fe=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{opacity:$.value}};return t.__closure={recBlink:$},t.__workletHash=0xd511e0063a5,t.__initData=Sr,t.__stackDetails=e,t}());return{state:w,duration:E,isPaused:P,composedGesture:Pe,waveTick:q,micWrapperStyle:Te,slideTextAnimatedStyle:Oe,lockPillAnimatedStyle:_e,chevronAnimatedStyle:Re,pausePulseStyle:Ge,recDotStyle:Fe,triggerCancel:he,togglePause:pe}}({cancelSlideDistance:z,lockSlideDistance:W,enableLockRecording:D,enableSlideToCancel:B,holdMicScale:_,onRecordingStart:n.onRecordingStart,onRecordingStop:n.onRecordingStop,onSend:n.onSend,onDelete:n.onDelete,onLock:n.onLock,onCancel:n.onCancel,onPauseRecording:n.onPauseRecording,onResumeRecording:n.onResumeRecording,onStateChange:n.onStateChange});return"RECORDING_TAP"===xe.state||"LOCKED_RECORDING"===xe.state||"SENDING"===xe.state?e.jsx(dr,{duration:xe.duration,isPaused:xe.isPaused,composedGesture:xe.composedGesture,micWrapperStyle:xe.micWrapperStyle,pausePulseStyle:xe.pausePulseStyle,recDotStyle:xe.recDotStyle,waveTick:xe.waveTick,onCancelPress:xe.triggerCancel,onTogglePause:xe.togglePause,backgroundColor:s,timerColor:d,waveformColor:m,deleteIconColor:g,pauseIconColor:k,primaryColor:o,micSize:ye,iconSize:G,inputBarHeight:P,waveCount:X,enableWaveform:H,headerSlot:J,renderDeleteIcon:le,renderPauseIcon:ae,renderPlayIcon:se,renderSendIcon:re,renderWaveform:Ae,containerStyleOverride:ce,barStyleOverride:ue,timerTextStyle:de,waveformStyle:ve,trashButtonStyle:fe,sendButtonStyle:pe,fontFamily:me}):e.jsx(ar,{isHold:"RECORDING_HOLD"===xe.state,duration:xe.duration,composedGesture:xe.composedGesture,micWrapperStyle:xe.micWrapperStyle,slideTextAnimatedStyle:xe.slideTextAnimatedStyle,lockPillAnimatedStyle:xe.lockPillAnimatedStyle,chevronAnimatedStyle:xe.chevronAnimatedStyle,primaryColor:o,microphoneColor:v,timerColor:d,cancelTextColor:b,holdPillBackground:c,lockPillBackground:j,lockColor:f,chevronColor:ge,iconSize:G,lockIconSize:V,inputBarHeight:P,micSize:ye,enableLockRecording:D,headerSlot:J,showSendButton:q,onSendPress:$,sendButtonBackgroundColor:Z,sendButtonIconColor:ee,renderInputPill:te,renderMicIcon:ne,renderSendIcon:re,renderArrowIcon:ie,renderLockIcon:oe,containerStyleOverride:ce,timerTextStyle:de,slideTextStyleOverride:Ce,lockPillStyleOverride:he,sendButtonStyle:pe,fontFamily:me})},Er=function(t){var n=t.style,r=t.fill,i=void 0===r?"currentColor":r;return e.jsxs(o,{style:n,viewBox:"0 0 24 24",children:[e.jsx(o.Path,{fill:i,d:"M13 4H6v16h12V9h-5z",opacity:".3"}),e.jsx(o.Path,{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"})]})},jr=function(t){var r=t.fileName,o=t.style,i=D().theme;return e.jsx(n.Text,{numberOfLines:2,ellipsizeMode:"tail",style:J([{fontSize:14,fontWeight:"600",color:"black"},o],null==i?void 0:i.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}(r)})},Ir=t.memo(jr);function Mr(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 Pr,Tr,Or,_r,Rr,Gr,Fr,Vr,Kr,Dr,Lr,Br,Ur,Hr,Nr,Wr,Yr,zr,Qr,Xr,Jr,qr,$r,Zr,eo,to,no,ro,oo,io,lo=function(t){var r,o=t.previews,i=t.closePreview,l=t.onRemoveItem,s=t.CustomFileIcon,A=t.CustomImagePreview,c=t.CustomVideoPreview,u=t.inputHeight,d=D(),C=d.theme,v=d.setMediaViewerGallery,h=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/"))})),f=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/"))})),p=Mr(o);if(0===o.length)return null;var m=function(e){0!==p.length&&v(p,e)},y=function(t){var r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:56,l=null===(r=t.type)||void 0===r?void 0:r.startsWith("image/"),s=null===(o=t.type)||void 0===o?void 0:o.startsWith("video/");return l&&A?e.jsx(A,{uri:t.uri}):s&&c?e.jsx(c,{uri:t.uri}):l?e.jsx(n.Image,{source:{uri:t.uri},style:{width:i,height:i,borderRadius:12},resizeMode:"cover"}):s?e.jsx(n.View,{style:{width:i,height:i,borderRadius:12,overflow:"hidden"},children:e.jsx(a,{source:{uri:t.uri},style:{width:"100%",height:"100%"},resizeMode:"cover",muted:!0,repeat:!0,paused:!1,pointerEvents:"none",playInBackground:!1,playWhenInactive:!1})}):null},g=function(t,r){return e.jsx(n.Pressable,{onPress:function(){return l?l(t):null==i?void 0:i()},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:r?[{rotate:r}]:void 0},children:e.jsx(n.Text,{style:J({fontSize:13,color:"white",fontWeight:"700",lineHeight:14},null==C?void 0:C.fontFamily),children:"×"})})};return e.jsx(n.View,{style:[{position:"absolute",bottom:(null!=u?u:0)+8,zIndex:20,borderRadius:12,maxWidth:"92%",alignSelf:"flex-start"},null==C||null===(r=C.filePreviewStyle)||void 0===r?void 0:r.root],children:e.jsxs(n.View,{style:{gap:8},children:[function(){if(0===h.length)return null;if(1===h.length){var t=h[0];return t?e.jsxs(n.Pressable,{onPress:function(){return m(0)},style:{position:"relative"},children:[y(t),g(t.uri)]}):null}var r=h.slice(0,3),o=h.length>3?h.length-3:0;return e.jsx(n.View,{style:{flexDirection:"row",alignItems:"center",minHeight:68},children:r.map((function(t,i){var l=2===r.length?0===i?"-4deg":"4deg":0===i?"-10deg":1===i?"0deg":"10deg",a=2===r.length?0===i?"4deg":"-4deg":0===i?"10deg":1===i?"0deg":"-10deg";return e.jsx(n.Pressable,{onPress:function(){var e=Mr(h).findIndex((function(e){return e.uri===t.uri}));m(e>=0?e:0)},style:{marginLeft:0===i?0:-18,zIndex:i+1,transform:[{rotate:l}],position:"relative"},children:e.jsxs(n.View,{style:{position:"relative"},children:[y(t),2===i&&o>0&&e.jsx(n.View,{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:e.jsxs(n.Text,{style:{color:"#fff",fontWeight:"700",fontSize:14},children:["+",o]})}),g(t.uri,a)]})},"".concat(t.uri,"-").concat(i))}))})}(),f.length>0&&e.jsx(n.ScrollView,{scrollEnabled:f.length>3,style:{maxHeight:232},showsVerticalScrollIndicator:f.length>3,contentContainerStyle:{gap:8},nestedScrollEnabled:!0,children:f.map((function(t,r){return function(t,r){var o,i,l,a;return e.jsxs(n.View,{style:{position:"relative"},children:[e.jsxs(n.View,{style:[{backgroundColor:"white",width:240,minHeight:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==C||null===(o=C.filePreviewStyle)||void 0===o?void 0:o.container],children:[e.jsx(n.View,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==C||null===(i=C.filePreviewStyle)||void 0===i?void 0:i.iconContainer],children:s?e.jsx(s,{}):e.jsx(Er,{style:{width:40,height:40},fill:"white"})}),e.jsx(n.View,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==C||null===(l=C.filePreviewStyle)||void 0===l?void 0:l.nameContainer],children:e.jsx(Ir,{fileName:t.name||"File",style:null==C||null===(a=C.filePreviewStyle)||void 0===a?void 0:a.text})})]}),g(t.uri)]},"".concat(t.uri,"-").concat(r))}(t,r)}))})]})})},ao=t.memo(lo),so="ios"===n.Platform.OS?32:30,Ao="ios"===n.Platform.OS?50:48,co=function(o){var i,l,a,s,A,c,d,C,v,h,f,p,m,g,x,b,w,S,k,E,j=o.onSendMessage,I=o.onTypingStart,T=o.onTypingEnd,O=o.onAttachmentPress,_=o.onCameraPress,G=o.onAudioRecordStart,F=o.onAudioRecordEnd,V=o.CustomEmojiIcon,K=o.CustomAttachmentIcon,L=o.CustomCameraIcon,B=o.CustomSendIcon,U=o.CustomMicrophoneIcon,H=o.CustomFileIcon,N=o.CustomImagePreview,W=o.CustomVideoPreview,Y=M(t.useState(""),2),z=Y[0],Q=Y[1],q=M(t.useState({height:so,isMultiline:!1}),2),$=q[0],Z=q[1],ee=t.useRef(null),te=D(),ne=te.theme,re=te.currentUserId,oe=te.showEmojiButton,ie=te.showAttachmentsButton,le=te.showCameraButton,ae=te.showVoiceRecordButton,se=te.placeholder,Ae=te.previewData,ce=te.previewItems,ue=te.closePreview,de=te.onRemovePreviewItem,Ce=te.CustomVoiceRecorder,ve=te.replyTarget,he=te.cancelReply,fe=te.replyProps,pe=te.replyUI,me=te.replyStyle,ye=te.renderReplyPreview,ge=te.renderEditPreview,xe=te.CustomClosePreviewIcon,be=te.CustomEditPreviewIcon,we=te.editingMessage,Se=te.cancelEdit,ke=te.onEditMessage,Ee=We(ne,pe),je=y(y({},null==ne||null===(i=ne.reply)||void 0===i?void 0:i.styles),me),Ie=function(e,t){var n;return null!==(n=We(e,t).inputPreviewBackground)&&void 0!==n?n:"rgba(0, 0, 0, 0.08)"}(ne,Ee),Me=function(e,t){var n;return null!==(n=We(e,t).recordingPreviewBackground)&&void 0!==n?n:"rgba(0, 0, 0, 0.08)"}(ne,Ee),Pe=null!==(l=null!==(a=Ee.closeIconColor)&&void 0!==a?a:null==ne||null===(s=ne.colors)||void 0===s?void 0:s.inputsIconsColor)&&void 0!==l?l:"rgba(0,0,0,0.5)",Te=Ee.previewTextColor||"rgba(0,0,0,0.55)",Oe=null!==(A=Ee.thumbnailSize)&&void 0!==A?A:32,_e=t.useRef(null);t.useEffect((function(){var e;we&&we.id!==_e.current?(_e.current=we.id,Q(null!==(e=we.text)&&void 0!==e?e:""),Z({height:so,isMultiline:!1}),requestAnimationFrame((function(){var e;return null===(e=ee.current)||void 0===e?void 0:e.focus()}))):we||(_e.current=null)}),[we]);var Re,Ge=t.useMemo((function(){return null!=ce&&ce.length?ce:Ae?[Ae]:[]}),[ce,Ae]),Fe=Ge.length>0,Ve=null==ne||null===(c=ne.sizes)||void 0===c?void 0:c.inputIconSize,Ke=function(e){if("number"==typeof e&&e>0)return{width:e,height:e};var t="string"==typeof e&&e.trim().length>0?e.trim():X;return r.style(t)}(Ve),De="number"==typeof(Re=Ve)&&Re>0?Re:24,Le=0===z.trim().length&&!$.isMultiline,Be=Math.max(0,(Ao-De)/2),Ue=Le?{paddingTop:Be,paddingBottom:Be}:{paddingBottom:Be},He=!!we,Ne=t.useCallback((function(){Z({height:so,isMultiline:!1})}),[]),Ye=t.useCallback((function(e){Q(e),0===e.length&&Ne()}),[Ne]),ze=t.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,so),118),n=t>so;Z({height:n?t:so,isMultiline:n})}),[]),Qe=t.useCallback((function(){var e,t,n,r,o,i;if(ve){var l=null===(e=ve.mediaItems)||void 0===e?void 0:e[0];return{messageId:ve.id,senderName:ve.senderName,preview:null!==(t=ve.text)&&void 0!==t?t:ve.audio?"🎤 Audio message":ve.image?"📷 Photo":ve.video?"🎥 Video":null!==(n=ve.fileAttachments)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&n.name?"📎 ".concat(ve.fileAttachments[0].name):"",mediaKind:ve.audio?"audio":ve.video?"video":ve.image||(null!==(r=ve.mediaItems)&&void 0!==r?r:[]).some((function(e){return"image"===e.kind}))?"image":(null!==(o=ve.fileAttachments)&&void 0!==o?o:[]).length?"file":void 0,thumbnailUri:null!==(i=ve.image)&&void 0!==i?i:"image"===(null==l?void 0:l.kind)||"video"===(null==l?void 0:l.kind)?l.uri:void 0}}}),[ve]),Xe=t.useCallback((function(){var e=z.trim();if(we){if(!e)return;return null==ke||ke(we,e),Q(""),Ne(),void Se()}(e||Fe)&&(j(y({text:e,senderId:re},ve?{replyTo:Qe()}:{})),Q(""),Ne(),ve&&he())}),[z,j,re,Fe,Ne,ve,Qe,he,we,ke,Se]);t.useEffect((function(){z.trim()?null==I||I():null==T||T()}),[z,I,T]);var Je=!!z.trim()||Fe||He,qe=null==ne?void 0:ne.voiceRecorder,$e=null!==(d=null==qe?void 0:qe.ui)&&void 0!==d?d:{},Ze=null==qe?void 0:qe.styles,et=null==qe?void 0:qe.config,tt=t.useCallback((function(e){null==F||F(e)}),[F]),nt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.maxDuration,r=void 0===n?300:n,o=e.onRecordStart,i=e.onRecordEnd,l=M(t.useState("idle"),2),a=l[0],s=l[1],A=M(t.useState(0),2),c=A[0],d=A[1],C=t.useRef(null),v=t.useRef(null),h=t.useRef(0),f=t.useRef(i);f.current=i;var p=t.useRef(o);p.current=o;var m=t.useRef(r);m.current=r;var y=t.useCallback((function(){v.current&&(clearInterval(v.current),v.current=null)}),[]),g=t.useCallback((function(e){y(),v.current=setInterval((function(){h.current+=1,d(h.current),h.current>=m.current&&e()}),1e3)}),[y]),x=t.useCallback(u(R().mark((function e(){var t,n;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,t=require("react-native-audio-record").default,e.next=8;break;case 4:return e.prev=4,e.t0=e.catch(0),console.error("[movius-chats] Voice recording requires react-native-audio-record. Install it: yarn add react-native-audio-record"),e.abrupt("return");case 8:return e.next=10,Tn();case 10:if(e.sent){e.next=14;break}return console.warn("[movius-chats] Microphone permission denied."),e.abrupt("return");case 14:try{t.init({sampleRate:16e3,channels:1,bitsPerSample:16,audioSource:6,wavFile:"movius_rec_".concat(Date.now(),".wav")}),t.start(),C.current=t,h.current=0,d(0),s("recording"),g((function(){return k.current()})),null===(n=p.current)||void 0===n||n.call(p)}catch(e){console.warn("[movius-chats] Failed to start recording:",e)}case 15:case"end":return e.stop()}}),e,null,[[0,4]])}))),[g]),b=t.useCallback(u(R().mark((function e(){return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C.current){e.next=2;break}return e.abrupt("return");case 2:try{C.current.stop(),s("paused"),y()}catch(e){console.warn("[movius-chats] Failed to pause:",e)}case 3:case"end":return e.stop()}}),e)}))),[y]),w=t.useCallback(u(R().mark((function e(){return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C.current){e.next=2;break}return e.abrupt("return");case 2:try{C.current.start(),s("recording"),g((function(){return k.current()}))}catch(e){console.warn("[movius-chats] Failed to resume:",e)}case 3:case"end":return e.stop()}}),e)}))),[g]),S=t.useCallback(u(R().mark((function e(){var t,n,r,o,i;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=C.current){e.next=3;break}return e.abrupt("return",null);case 3:return y(),C.current=null,n=h.current,h.current=0,s("idle"),d(0),e.prev=9,e.next=12,t.stop();case 12:if(o=e.sent){e.next=15;break}return e.abrupt("return",null);case 15:return i={uri:o.startsWith("file://")?o:"file://".concat(o),duration:Math.max(1,n),mimeType:"audio/wav"},null===(r=f.current)||void 0===r||r.call(f,i),e.abrupt("return",i);case 20:return e.prev=20,e.t0=e.catch(9),console.warn("[movius-chats] Failed to stop recording:",e.t0),e.abrupt("return",null);case 24:case"end":return e.stop()}}),e,null,[[9,20]])}))),[y]),k=t.useRef(S);k.current=S;var E=t.useCallback((function(){return k.current()}),[]),j=t.useCallback(u(R().mark((function e(){var t,n,r,o;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=C.current,y(),C.current=null,h.current=0,s("idle"),d(0),!t){e.next=25;break}return e.prev=7,e.next=10,t.stop();case 10:if(!(n=e.sent)){e.next=21;break}return e.prev=12,r=require("react-native-fs"),o=n.startsWith("file://")?n.slice(7):n,e.next=17,r.unlink(o);case 17:e.next=21;break;case 19:e.prev=19,e.t0=e.catch(12);case 21:e.next=25;break;case 23:e.prev=23,e.t1=e.catch(7);case 25:case"end":return e.stop()}}),e,null,[[7,23],[12,19]])}))),[y]);return t.useEffect((function(){return function(){y();try{var e;null===(e=C.current)||void 0===e||e.stop()}catch(e){}}}),[y]),{status:a,duration:c,isRecording:"recording"===a,isPaused:"paused"===a,startRecording:x,pauseRecording:b,resumeRecording:w,stopRecording:E,cancelRecording:j}}({maxDuration:null!==(C=null==et?void 0:et.maxDuration)&&void 0!==C?C:300,onRecordStart:G,onRecordEnd:tt}),rt=t.useRef(nt);rt.current=nt;var ot=t.useCallback((function(){rt.current.startRecording()}),[]),it=t.useCallback(u(R().mark((function e(){var t;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,rt.current.stopRecording();case 2:(t=e.sent)&&(j(y({audio:t.uri,senderId:re},ve?{replyTo:Qe()}:{})),ve&&he());case 4:case"end":return e.stop()}}),e)}))),[j,re,ve,Qe,he]),lt=t.useCallback((function(){rt.current.cancelRecording()}),[]),at=t.useCallback((function(){rt.current.pauseRecording()}),[]),st=t.useCallback((function(){rt.current.resumeRecording()}),[]),At=(null==ne||null===(v=ne.inputStyles)||void 0===v||null===(v=v.sendButtonStyle)||void 0===v?void 0:v.backgroundColor)||(null==ne||null===(h=ne.colors)||void 0===h?void 0:h.sentBubbleBackgroundColor)||(null==ne||null===(f=ne.colors)||void 0===f?void 0:f.sentMessageTailColor)||"#22c55e",ct=(null==ne||null===(p=ne.colors)||void 0===p?void 0:p.sendIconsColor)||At,ut=null!==(m=$e.recordingSendButtonBackground)&&void 0!==m?m:At,dt=$e.recordingBackground,Ct=null!==(g=$e.timerColor)&&void 0!==g?g:ct,vt=null!==(x=$e.longPressMicColor)&&void 0!==x?x:ct,ht=null!==(b=$e.waveformColor)&&void 0!==b?b:ct,ft={isRecording:nt.isRecording,isPaused:nt.isPaused,duration:nt.duration,isLocked:!1,slideOffset:{x:0,y:0},waveformData:[],startRecording:nt.startRecording,stopRecording:nt.stopRecording,pauseRecording:nt.pauseRecording,resumeRecording:nt.resumeRecording,cancelRecording:nt.cancelRecording},pt=Ce?Ce(ft):null,mt=null===(w=null==fe?void 0:fe.enableReply)||void 0===w||w,yt=!!ve&&mt&&!He&&!ye,gt=He,xt=yt||gt,bt=t.useMemo((function(){var t,o,i,l,a,s;if(!yt||!ve)return null;var A=null===(t=ve.mediaItems)||void 0===t?void 0:t[0],c=null!==(o=ve.image)&&void 0!==o?o:"image"===(null==A?void 0:A.kind)||"video"===(null==A?void 0:A.kind)?A.uri:void 0,u="";return ve.text?u=ve.text:ve.audio?u="🎤 Audio message":ve.video||"video"===(null==A?void 0:A.kind)?u="🎥 Video":ve.image||"image"===(null==A?void 0:A.kind)?u="📷 Photo":(null!==(i=ve.fileAttachments)&&void 0!==i?i:[]).length&&(u="📎 ".concat(null!==(l=null===(a=ve.fileAttachments)||void 0===a||null===(a=a[0])||void 0===a?void 0:a.name)&&void 0!==l?l:"File")),e.jsxs(n.View,{style:[r(Pr||(Pr=P(["flex-row items-center m-2 rounded-md px-3 py-2"]))),{backgroundColor:Ie||"rgba(0, 0, 0, 0.08)",minHeight:40},null==je?void 0:je.inputPreviewContainer,null==je?void 0:je.container],children:[e.jsxs(n.View,{style:r(Tr||(Tr=P(["flex-1 mr-2"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(Or||(Or=P(["text-[13px] font-semibold"]))),{color:Ee.previewSenderNameColor||At},null==je?void 0:je.senderName],null==ne?void 0:ne.fontFamily),children:ve.senderName||Ee.defaultReplySenderName||"You"}),e.jsx(n.Text,{numberOfLines:null!==(s=null==fe?void 0:fe.previewMaxLines)&&void 0!==s?s:1,style:J([r(_r||(_r=P(["text-[12.5px] mt-0.5"]))),{color:Te},null==je?void 0:je.previewText],null==ne?void 0:ne.fontFamily),children:u})]}),c&&e.jsx(n.Image,{source:{uri:c},style:[{width:Oe,height:Oe,borderRadius:4,marginRight:6},null==je?void 0:je.thumbnail],resizeMode:"cover"}),e.jsx(n.Pressable,{onPress:he,hitSlop:10,style:[r(Rr||(Rr=P(["w-7 h-7 items-center justify-center"]))),null==je?void 0:je.closeButton],children:xe?e.jsx(xe,{}):e.jsx(kn,{color:Pe})})]})}),[yt,ve,null==fe?void 0:fe.previewMaxLines,je,Ee,null==ne?void 0:ne.fontFamily,At,Ie,Te,Oe,Pe,xe,he]),wt=t.useMemo((function(){var t,o,i,l,a;if(!yt||!ve)return null;var s=null===(t=ve.mediaItems)||void 0===t?void 0:t[0],A=null!==(o=ve.image)&&void 0!==o?o:"image"===(null==s?void 0:s.kind)||"video"===(null==s?void 0:s.kind)?s.uri:void 0,c="";return ve.text?c=ve.text:ve.audio?c="🎤 Audio message":ve.video||"video"===(null==s?void 0:s.kind)?c="🎥 Video":ve.image||"image"===(null==s?void 0:s.kind)?c="📷 Photo":(null!==(i=ve.fileAttachments)&&void 0!==i?i:[]).length&&(c="📎 ".concat(null!==(l=null===(a=ve.fileAttachments)||void 0===a||null===(a=a[0])||void 0===a?void 0:a.name)&&void 0!==l?l:"File")),e.jsxs(n.View,{style:[r(Gr||(Gr=P(["flex-row items-center m-2 rounded-md px-3 py-2"]))),{backgroundColor:Me||"rgba(0, 0, 0, 0.08)",minHeight:40},null==je?void 0:je.recordingPreviewContainer],children:[e.jsxs(n.View,{style:r(Fr||(Fr=P(["flex-1 mr-2"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(Vr||(Vr=P(["text-[13px] font-semibold"]))),{color:Ee.previewSenderNameColor||At}],null==ne?void 0:ne.fontFamily),children:ve.senderName||Ee.defaultReplySenderName||"You"}),e.jsx(n.Text,{numberOfLines:1,style:J([r(Kr||(Kr=P(["text-[12.5px] mt-0.5"]))),{color:Ee.previewTextColor||"rgba(0,0,0,0.55)"},null==je?void 0:je.previewText],null==ne?void 0:ne.fontFamily),children:c})]}),A&&e.jsx(n.Image,{source:{uri:A},style:[{width:Oe-2,height:Oe-2,borderRadius:4,marginRight:6},null==je?void 0:je.thumbnail],resizeMode:"cover"}),e.jsx(n.Pressable,{onPress:he,hitSlop:10,style:[r(Dr||(Dr=P(["w-7 h-7 items-center justify-center"]))),null==je?void 0:je.closeButton],children:xe?e.jsx(xe,{}):e.jsx(kn,{color:Pe})})]})}),[yt,ve,ct,null==ne?void 0:ne.fontFamily,Me,je,Ee,Oe,Pe,xe,he]),St=t.useMemo((function(){return gt&&we?ge?ge(we,(function(){Se(),Q(""),Ne()})):e.jsxs(n.View,{style:[r(Lr||(Lr=P(["flex-row items-center m-2 rounded-md px-3 py-2"]))),{backgroundColor:Ie||"rgba(0, 0, 0, 0.08)",minHeight:40},null==je?void 0:je.editPreviewContainer],children:[e.jsx(n.View,{style:r(Br||(Br=P(["mr-2.5"]))),children:be?e.jsx(be,{}):e.jsx(En,{style:{width:16,height:16},color:At})}),e.jsxs(n.View,{style:r(Ur||(Ur=P(["flex-1 mr-2"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(Hr||(Hr=P(["text-[13px] font-semibold"]))),{color:At}],null==ne?void 0:ne.fontFamily),children:Ee.editChipTitle||"Edit message"}),e.jsx(n.Text,{numberOfLines:1,style:J([r(Nr||(Nr=P(["text-[12.5px] mt-0.5"]))),{color:Te},null==je?void 0:je.previewText],null==ne?void 0:ne.fontFamily),children:we.text})]}),e.jsx(n.Pressable,{onPress:function(){Se(),Q(""),Ne()},hitSlop:10,style:[r(Wr||(Wr=P(["w-7 h-7 items-center justify-center"]))),null==je?void 0:je.closeButton],children:xe?e.jsx(xe,{}):e.jsx(kn,{color:Pe})})]}):null}),[gt,we,ge,je,Ee,At,null==ne?void 0:ne.fontFamily,Ie,Te,Pe,xe,be,Se,Ne]),kt=Le&&!xt,Et=t.useCallback((function(){var t,o,i,l,a,s;return e.jsxs(n.View,{style:[r(Yr||(Yr=P(["flex-1 flex-col bg-white overflow-hidden"]))),{minHeight:Ao,borderRadius:kt?9999:24},null==ne||null===(t=ne.inputStyles)||void 0===t?void 0:t.inputContainerStyle],children:[bt,St,e.jsxs(n.View,{style:[r(zr||(zr=P(["flex-row px-3.5"]))),{minHeight:Ao,alignItems:Le?"center":"flex-end"}],children:[oe&&e.jsx(n.View,{style:Ue,children:e.jsx(n.Pressable,{children:V?e.jsx(V,{}):e.jsx(jn,{style:Ke,color:(null==ne||null===(o=ne.colors)||void 0===o?void 0:o.inputsIconsColor)||"rgba(0,0,0,0.7)"})})}),e.jsx(n.TextInput,{ref:ee,value:z,onChangeText:Ye,placeholder:se||"Message",style:J([r(Qr||(Qr=P(["bg-transparent flex-1 pl-2"]))),"ios"===n.Platform.OS?r(Xr||(Xr=P(["text-[17px]"]))):r(Jr||(Jr=P(["text-[16px]"]))),{minHeight:so,maxHeight:118,paddingVertical:Le?0:8,marginVertical:Le?(Ao-so)/2:4},{color:(null==ne||null===(i=ne.colors)||void 0===i?void 0:i.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==ne?void 0:ne.fontFamily),placeholderTextColor:(null==ne||null===(l=ne.colors)||void 0===l?void 0:l.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:$.isMultiline&&z.length>0?"top":"center",onContentSizeChange:ze}),!He&&e.jsxs(n.View,{style:[r(qr||(qr=P(["flex-row items-center gap-4"]))),Ue],children:[ie&&e.jsx(n.Pressable,{onPress:O,children:K?e.jsx(K,{}):e.jsx(Mn,{style:Ke,color:(null==ne||null===(a=ne.colors)||void 0===a?void 0:a.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),le&&!z.trim()&&e.jsx(n.Pressable,{onPress:_,children:L?e.jsx(L,{}):e.jsx(Sn,{style:Ke,color:(null==ne||null===(s=ne.colors)||void 0===s?void 0:s.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]})]})}),[kt,Le,He,z,$.isMultiline,Ue,Ye,ze,se,oe,ie,le,O,_,V,K,L,Ke,ne,bt,St]),jt=t.useCallback((function(){var t;return e.jsx(n.Pressable,{onPress:Xe,style:[r($r||($r=P(["rounded-full justify-center items-center"]))),y({height:Ao,width:Ao,backgroundColor:At},null==ne||null===(t=ne.inputStyles)||void 0===t?void 0:t.sendButtonStyle)],children:B?e.jsx(B,{}):e.jsx(Pn,{style:r.style("h-6 w-6"),color:ct})})}),[Xe,At,ct,null==ne||null===(S=ne.inputStyles)||void 0===S?void 0:S.sendButtonStyle,B]),It=ae&&!pt&&!He,Mt=ve&&mt&&!He&&ye?ye(ve,he):null,Pt={inputBarHeight:Ao,primaryColor:ut,backgroundColor:dt,timerColor:Ct,microphoneColor:vt,waveformColor:ht,holdPillBackground:$e.holdPillBackground,cancelTextColor:$e.cancelTextColor,chevronColor:$e.chevronIconColor,lockColor:$e.lockIconColor,lockPillBackground:$e.lockPillBackground,deleteIconColor:$e.deleteIconColor,pauseIconColor:$e.pauseIconColor,iconSize:$e.iconSize,lockSlideDistance:$e.lockSlideDistance,waveCount:$e.waveformBarCount,enableLockRecording:null==et?void 0:et.enableLockRecording,enableSlideToCancel:null==et?void 0:et.enableSlideToCancel,enableWaveform:null==et?void 0:et.enableWaveform,timerTextStyle:null!==(k=$e.timerTextStyle)&&void 0!==k?k:null==Ze?void 0:Ze.timer,fontFamily:null==ne?void 0:ne.fontFamily,containerStyle:null==Ze?void 0:Ze.container,barStyle:null==Ze?void 0:Ze.bar,slideTextStyle:null==Ze?void 0:Ze.slideText,waveformStyle:null==Ze?void 0:Ze.waveform,lockPillStyle:null==Ze?void 0:Ze.lockPill,trashButtonStyle:null==Ze?void 0:Ze.trashButton,sendButtonStyle:null==Ze?void 0:Ze.sendButton,headerSlot:wt,showSendButton:Je,onSendPress:Xe,sendButtonBackgroundColor:At,sendButtonIconColor:ct,renderInputPill:Et,renderSendIcon:B?function(){return e.jsx(B,{})}:void 0,renderMicIcon:U?function(){return e.jsx(U,{})}:void 0,onRecordingStart:ot,onSend:it,onCancel:lt,onDelete:lt,onPauseRecording:at,onResumeRecording:st};return e.jsxs(n.View,{style:r(Zr||(Zr=P(["w-full px-2"]))),children:[Mt,Fe&&e.jsx(ao,{previews:Ge,closePreview:ue,onRemoveItem:de,CustomFileIcon:H,CustomImagePreview:N,CustomVideoPreview:W,inputHeight:$.height}),e.jsx(n.View,{style:[r(eo||(eo=P(["w-full"]))),null==ne||null===(E=ne.inputStyles)||void 0===E?void 0:E.inputSectionContainerStyle],children:It?e.jsx(kr,y({},Pt)):e.jsxs(n.View,{style:r(to||(to=P(["flex-row items-end gap-2"]))),children:[Et(),Je||!ae?jt():pt?e.jsx(n.View,{style:{height:Ao,width:Ao,justifyContent:"center",alignItems:"center"},children:U?e.jsx(U,{}):e.jsx(In,{style:r.style("h-8 w-8"),color:ct})}):jt()]})}),pt]})},uo=t.memo(co),Co=function(e){var t,n,r,o=null!==(t=null!==(n=e.text)&&void 0!==n?n:null===(r=e.fileAttachments)||void 0===r||null===(r=r[0])||void 0===r?void 0:r.name)&&void 0!==t?t:"";if(!o)return!1;try{var i,l=require("@react-native-clipboard/clipboard"),a=null!==(i=null==l?void 0:l.default)&&void 0!==i?i:l;if(null!=a&&a.setString)return a.setString(o),!0}catch(e){}return!1},vo=function(t){var n=t.style,r=t.color,i=void 0===r?"#FFFFFF":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:i,strokeWidth:"1.5",children:[e.jsx(o.Path,{d:"M6 11c0-2.828 0-4.243.879-5.121C7.757 5 9.172 5 12 5h3c2.828 0 4.243 0 5.121.879C21 6.757 21 8.172 21 11v5c0 2.828 0 4.243-.879 5.121C19.243 22 17.828 22 15 22h-3c-2.828 0-4.243 0-5.121-.879C6 20.243 6 18.828 6 16z"}),e.jsx(o.Path,{d:"M6 19a3 3 0 0 1-3-3v-6c0-3.771 0-5.657 1.172-6.828S7.229 2 11 2h4a3 3 0 0 1 3 3",opacity:".5"})]})})},ho=function(t){var n=t.style,r=t.color,i=void 0===r?"#FFFFFF":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:i,strokeLinecap:"round",strokeWidth:"1.5",children:[e.jsx(o.Path,{strokeLinejoin:"round",d:"m12.664 5.479l3.973 3.53c1.568 1.395 2.353 2.092 2.353 2.99s-.785 1.596-2.353 2.99l-3.973 3.53c-.716.637-1.074.956-1.369.823S11 18.731 11 17.772v-2.344c-3.6 0-7.5 1.714-9 4.571c0-9.142 5.333-11.428 9-11.428V6.226c0-.958 0-1.437.295-1.57c.295-.132.653.186 1.37.823"}),e.jsx(o.Path,{d:"m15.539 4.5l5.216 4.844a3.897 3.897 0 0 1-.126 5.823l-5.09 4.333",opacity:".5"})]})})},fo=function(t){var n=t.style,r=t.color,i=void 0===r?"#FFFFFF":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:i,strokeLinecap:"round",strokeWidth:"1.5",children:[e.jsx(o.Path,{strokeLinejoin:"round",d:"m14 16l2.1 2.5l3.9-5"}),e.jsx(o.Path,{d:"M21 6H3m18 4H3m7 4H3m7 4H3",opacity:".5"})]})})},po={reply:"Reply",copy:"Copy",edit:"Edit",delete:"Delete",forward:"Forward",select:"Select"},mo={reply:ee,copy:vo,edit:En,delete:sr,forward:ho,select:fo};function yo(e,t){var n;return y(y({},null==e||null===(n=e.messageActions)||void 0===n?void 0:n.ui),t)}function go(e,t){var n;return y(y({},null==e||null===(n=e.messageActions)||void 0===n?void 0:n.labels),t)}function xo(e,t){var n;return y(y(y({},mo),null==e||null===(n=e.messageActions)||void 0===n?void 0:n.icons),t)}var bo,wo,So,ko,Eo=function(o){var i,l,a,s,A,c,u,d,C,v,h=o.message,f=o.anchor,p=o.visible,m=o.onClose,g=o.flags,x=o.ui,b=o.labels,w=o.icons,S=o.fontFamily,k=o.onAction,E=t.useMemo((function(){return yo(void 0,x)}),[x]),j=t.useMemo((function(){return go(void 0,b)}),[b]),I=t.useMemo((function(){return xo(void 0,w)}),[w]),M=t.useMemo((function(){return h?function(e,t,n,r,o){var i,l,a,s,A,c,u,d=y(y({},po),n),C=xo(void 0,r),v=!(null===(i=e.text)||void 0===i||!i.trim());return[{id:"reply",label:d.reply,Icon:null!==(l=C.reply)&&void 0!==l?l:ee},{id:"forward",label:d.forward,Icon:null!==(a=C.forward)&&void 0!==a?a:ho},{id:"copy",label:d.copy,Icon:null!==(s=C.copy)&&void 0!==s?s:vo},{id:"edit",label:d.edit,Icon:null!==(A=C.edit)&&void 0!==A?A:En},{id:"select",label:d.select,Icon:null!==(c=C.select)&&void 0!==c?c:fo},{id:"delete",label:d.delete,Icon:null!==(u=C.delete)&&void 0!==u?u:sr,destructive:!0}].filter((function(e){switch(e.id){case"reply":return!1!==(null==t?void 0:t.enableReply);case"copy":return!1!==(null==t?void 0:t.enableCopy)&&v;case"edit":return!1!==(null==t?void 0:t.enableEdit)&&v&&!!o;case"delete":return!1!==(null==t?void 0:t.enableDelete);case"forward":return!1!==(null==t?void 0:t.enableForward);case"select":return!1!==(null==t?void 0:t.enableSelect);default:return!0}}))}(h,g,j,I,null==f?void 0:f.isCurrentUser):[]}),[h,g,j,I,f]),T=null!==(i=E.width)&&void 0!==i?i:200,O=null!==(l=E.borderRadius)&&void 0!==l?l:12,_=null!==(a=E.backgroundColor)&&void 0!==a?a:"#FFFFFF",R=null!==(s=E.textColor)&&void 0!==s?s:"#111827",G=null!==(A=E.iconColor)&&void 0!==A?A:R,F=null!==(c=E.destructiveColor)&&void 0!==c?c:"#EF4444",V=null!==(u=E.scrimColor)&&void 0!==u?u:"rgba(0,0,0,0.60)",K=null!==(d=E.rowHeight)&&void 0!==d?d:36,D=null!==(C=E.iconSize)&&void 0!==C?C:16,L=null!==(v=E.liftedBubblePaddingHorizontal)&&void 0!==v?v:8,B=t.useMemo((function(){return f?function(e,t,r,o){var i,l=n.Dimensions.get("window"),a=r*o+12;return i=e.isCurrentUser?e.x+e.width-t:e.x,{left:i=Math.max(8,Math.min(i,l.width-t-8)),top:l.height-(e.y+e.height)>=a+8?e.y+e.height+8:Math.max(8,e.y-a-8)}}(f,T,K,M.length):null}),[f,T,K,M.length]);if(!h||!f)return null;var U=Math.max(0,f.y-4);return e.jsx(n.Modal,{visible:p,transparent:!0,animationType:"fade",onRequestClose:m,statusBarTranslucent:!0,children:e.jsxs(n.Pressable,{onPress:m,style:[r(no||(no=P(["flex-1 pt-10"]))),{backgroundColor:V},E.scrimPressableStyle],children:[e.jsx(n.View,{pointerEvents:"none",style:[{position:"absolute",top:U,left:0,right:0,paddingHorizontal:L}],children:e.jsx(wn,{message:h,isCurrentUser:f.isCurrentUser,isFirstInSequence:f.isFirstInSequence,staticMode:!0})}),B&&e.jsx(n.Pressable,{onPress:function(){},style:[r(ro||(ro=P(["absolute overflow-hidden"]))),{width:T,borderRadius:O,backgroundColor:_,top:B.top,left:B.left,shadowColor:"#000",shadowOpacity:.18,shadowRadius:16,shadowOffset:{width:0,height:6},elevation:6},E.menuStyle],children:M.map((function(t){var o=t.destructive?F:R,i=t.destructive?F:G;return e.jsxs(n.Pressable,{onPress:function(){return k(t.id,h)},android_ripple:{color:"rgba(0,0,0,0.06)"},style:[r(oo||(oo=P(["flex-row items-center px-3"]))),{height:K},E.rowStyle],children:[e.jsx(n.View,{style:{width:D,height:D,marginRight:10},children:e.jsx(t.Icon,{style:{width:D,height:D},color:i})}),e.jsx(n.Text,{style:J([r(io||(io=P(["text-[13px] font-medium"]))),{color:o},E.rowTextStyle],S),children:t.label})]},t.id)}))})]})})};var jo,Io,Mo,Po,To,Oo,_o,Ro,Go,Fo,Vo,Ko,Do,Lo;function Bo(t){var n=t.style;return e.jsxs(o.Svg,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:r.style("h-6 w-6 text-black",n),children:[e.jsx(o.Line,{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx(o.Line,{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var Uo,Ho,No,Wo,Yo,zo,Qo,Xo,Jo,qo,$o,Zo,ei,ti,ni,ri,oi,ii,li,ai=function(o){var i,l=o.gallery,a=o.onClose,s=D(),A=s.theme,c=s.setIsVideoPlaying,u=t.useRef(null),d=null!==(i=null==l?void 0:l.initialIndex)&&void 0!==i?i:0,C=M(t.useState(d),2),v=C[0],h=C[1],f=n.useWindowDimensions(),p=f.width,m=f.height;t.useEffect((function(){if(null!=l&&l.items.length){var e=l.initialIndex;h(e);var t=l.items[e];c("video"===(null==t?void 0:t.kind)),requestAnimationFrame((function(){try{var t;null===(t=u.current)||void 0===t||t.scrollToIndex({index:e,animated:!1})}catch(e){}}))}}),[null==l?void 0:l.initialIndex,null==l?void 0:l.items,c]);var y=t.useCallback((function(){c(!1),a()}),[a,c]),g=t.useCallback((function(e){var t=Math.round(e.nativeEvent.contentOffset.x/p);h(t);var n=null==l?void 0:l.items[t];c("video"===(null==n?void 0:n.kind))}),[null==l?void 0:l.items,p,c]);return l&&0!==l.items.length?e.jsx(n.Modal,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:y,statusBarTranslucent:!0,children:e.jsxs(n.View,{style:[r(_o||(_o=P(["flex-1 bg-black"]))),{width:p,height:m}],children:[e.jsx(n.Pressable,{onPress:y,style:r(Ro||(Ro=P(["absolute right-4 top-12 z-20 p-2 rounded-full bg-slate-100/70"]))),children:e.jsx(Bo,{style:r(Go||(Go=P(["h-8 w-8"])))})}),l.items.length>1&&e.jsx(n.View,{style:r(Fo||(Fo=P(["absolute top-14 left-0 right-0 z-10 items-center"]))),children:e.jsxs(n.Text,{style:J(r(Vo||(Vo=P(["text-white/90 text-sm bg-black/40 px-3 py-1 rounded-full"]))),null==A?void 0:A.fontFamily),children:[v+1," / ",l.items.length]})}),e.jsx(n.FlatList,{ref:u,data:l.items,horizontal:!0,pagingEnabled:!0,showsHorizontalScrollIndicator:!1,keyExtractor:function(e,t){return"".concat(e.uri,"-").concat(t)},initialScrollIndex:l.initialIndex,extraData:v,getItemLayout:function(e,t){return{length:p,offset:p*t,index:t}},onMomentumScrollEnd:g,onScrollToIndexFailed:function(e){var t=e.index;setTimeout((function(){var e;null===(e=u.current)||void 0===e||e.scrollToIndex({index:t,animated:!1})}),100)},renderItem:function(t){var n=t.item,r=t.index;return e.jsx(si,{item:n,width:p,height:m,isActive:r===v,autoPlayVideo:r===d&&"video"===n.kind})}})]})}):null},si=function(o){var i=o.item,l=o.width,s=o.height,A=o.isActive,c=o.autoPlayVideo,u=D().theme,d=t.useRef(null),C=M(t.useState("video"===i.kind),2),v=C[0],h=C[1],f=M(t.useState(!1),2),p=f[0],m=f[1],y="video"===i.kind&&A&&c;return"image"===i.kind?e.jsx(n.View,{style:{width:l,height:s,justifyContent:"center"},children:e.jsx(n.Image,{source:{uri:i.uri},style:{width:l,height:s},resizeMode:"contain"})}):e.jsxs(n.View,{style:{width:l,height:s,justifyContent:"center",alignItems:"center",paddingHorizontal:16},children:[e.jsx(a,{source:{uri:i.uri},ref:d,controls:!0,paused:!y,shutterColor:"transparent",playInBackground:!1,playWhenInactive:!1,style:{width:l-32,height:.55*s,backgroundColor:"#000"},resizeMode:"contain",onLoadStart:function(){h(!0),m(!1)},onLoad:function(){return h(!1)},onBuffer:function(e){var t=e.isBuffering;return h(t)},onError:function(){m(!0),h(!1)}}),v&&e.jsx(n.View,{style:r(Ko||(Ko=P(["absolute inset-0 items-center justify-center"]))),pointerEvents:"none",children:e.jsx(Tt,{style:r.style("h-14 w-14"),spinning:!0})}),p&&e.jsx(n.View,{style:r(Do||(Do=P(["absolute inset-0 items-center justify-center px-6"]))),children:e.jsx(n.Text,{style:J(r(Lo||(Lo=P(["text-white font-semibold"]))),null==u?void 0:u.fontFamily),children:"Failed to load video"})})]})},Ai=t.memo(ai),ci=function(t){var o,i,l,a,s,A=t.typingUsers,c=t.currentUserId,u=D(),d=u.theme,C=u.showAvatars,v=u.renderCustomTyping,h=u.showBubbleTail,f=u.typingText,p=A.filter((function(e){return e.id!==c}));if(!p.length)return null;var m=p.slice(0,2),g=p.length-2,x=C?m.length+(g>0?1:0):0,b=x>0?24+14*Math.max(0,x-1):0,w=x>0?b+12:8,S=-(b+12);return e.jsxs(n.View,{style:[r(Uo||(Uo=P(["px-2 my-1 bg-white rounded-tl-none rounded-lg relative max-w-[75%] self-start"]))),{marginLeft:w},null==d||null===(o=d.bubbleStyle)||void 0===o?void 0:o.typingContainerStyle],children:[C&&x>0&&e.jsxs(n.View,{style:{position:"absolute",top:0,left:S,flexDirection:"row"},children:[m.map((function(t,o){var i,l,a;return e.jsx(n.View,{style:[r(Ho||(Ho=P(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:o>0?-10:0,zIndex:m.length+o}],children:t.avatar?e.jsx(n.Image,{source:{uri:t.avatar},style:[r(No||(No=P(["w-full h-full object-cover rounded-full"]))),null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.avatarImageStyle]}):e.jsx(n.Text,{style:J([r(Wo||(Wo=P(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==d||null===(l=d.bubbleStyle)||void 0===l?void 0:l.avatarTextStyle],null==d?void 0:d.fontFamily),children:null===(a=t.name)||void 0===a?void 0:a.charAt(0)})},t.id)})),g>0&&e.jsx(n.View,{style:[r(Yo||(Yo=P(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},y({},null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.additionalTypingUsersContainerStyle)],children:e.jsxs(n.Text,{style:J([r(zo||(zo=P(["text-white text-xs font-semibold"]))),null==d||null===(l=d.bubbleStyle)||void 0===l?void 0:l.additionalTypingUsersTextStyle],null==d?void 0:d.fontFamily),children:["+",g]})})]}),h&&e.jsx(G,{style:r.style("absolute -top-[3px] w-6 h-6 rotate-180 -left-3.5 mt-[1.5px]"),color:(null==d||null===(a=d.colors)||void 0===a?void 0:a.receivedMessageTailColor)||"white"}),v?v():e.jsx(n.View,{style:r(Qo||(Qo=P(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(n.Text,{style:J([r(Xo||(Xo=P(["text-gray-600"]))),null==d||null===(s=d.bubbleStyle)||void 0===s?void 0:s.typingTextStyle],null==d?void 0:d.fontFamily),children:null!=f?f:"Typing..."})})]})};var ui,di,Ci,vi,hi,fi,pi,mi,yi,gi={code:"function VoiceRecorderTsx1(){const{isPaused,pauseOpacity}=this.__closure;return{opacity:isPaused?1:pauseOpacity.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderTsx1","isPaused","pauseOpacity","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx"],"mappings":"AAiCgD,SAAAA,kBAAA,QAAAC,QAAA,CAAAC,YAAA,OAAAC,SAAA,OAAO,CAC/CC,OAAO,CAAEH,QAAQ,CAAG,CAAC,CAAGC,YAAY,CAACG,KACzC,CAAC","ignoreList":[]}',version:"3.16.7"},xi={code:"function VoiceRecorderTsx2(){const{recBlink}=this.__closure;return{opacity:recBlink.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderTsx2","recBlink","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx"],"mappings":"AAoCyC,SAAAA,kBAAA,QAAAC,QAAA,OAAAC,SAAA,OAAO,CACxCC,OAAO,CAAEF,QAAQ,CAACG,KACtB,CAAC","ignoreList":[]}',version:"3.16.7"},bi=function(o){var i=o.color,a=o.count,s=l.useSharedValue(0);return t.useEffect((function(){s.value=l.withRepeat(l.withTiming(1,{duration:4500,easing:l.Easing.linear}),-1,!1)}),[]),e.jsx(n.View,{style:r(ii||(ii=P(["flex-row items-center justify-between h-6"]))),children:Array.from({length:a}).map((function(t,n){return e.jsx(Si,{index:n,total:a,tick:s,color:i},n)}))})},wi={code:'function VoiceRecorderTsx3(){const{tick,index,total}=this.__closure;const t=tick.value*Math.PI*2;const phase1=Math.sin(t*2+index*0.55);const phase2=Math.sin(t*4+index*1.3);const phase3=Math.sin(t*0.9+index*0.27);const combined=(phase1*0.55+phase2*0.3+phase3*0.4)*0.5+0.5;const edge=Math.sin(index/Math.max(1,total-1)*Math.PI);const amp=Math.max(0.18,Math.min(1,combined)*(0.35+0.65*edge));return{height:Math.round(amp*100)+"%"};}',location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderTsx3","tick","index","total","__closure","t","value","Math","PI","phase1","sin","phase2","phase3","combined","edge","max","amp","min","height","round"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx"],"mappings":"AAuF2C,SAAAA,iBAAMA,CAAA,QAAAC,IAAA,CAAAC,KAAA,CAAAC,KAAA,OAAAC,SAAA,CAEzC,KAAM,CAAAC,CAAC,CAAGJ,IAAI,CAACK,KAAK,CAAGC,IAAI,CAACC,EAAE,CAAG,CAAC,CAClC,KAAM,CAAAC,MAAM,CAAGF,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,CAAC,CAAGH,KAAK,CAAG,IAAI,CAAC,CAC7C,KAAM,CAAAS,MAAM,CAAGJ,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,CAAC,CAAGH,KAAK,CAAG,GAAG,CAAC,CAC5C,KAAM,CAAAU,MAAM,CAAGL,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,GAAG,CAAGH,KAAK,CAAG,IAAI,CAAC,CAC/C,KAAM,CAAAW,QAAQ,CAAG,CAACJ,MAAM,CAAG,IAAI,CAAGE,MAAM,CAAG,GAAG,CAAGC,MAAM,CAAG,GAAG,EAAI,GAAG,CAAG,GAAG,CAC1E,KAAM,CAAAE,IAAI,CAAGP,IAAI,CAACG,GAAG,CAAER,KAAK,CAAGK,IAAI,CAACQ,GAAG,CAAC,CAAC,CAAEZ,KAAK,CAAG,CAAC,CAAC,CAAII,IAAI,CAACC,EAAE,CAAC,CACjE,KAAM,CAAAQ,GAAG,CAAGT,IAAI,CAACQ,GAAG,CAAC,IAAI,CAAER,IAAI,CAACU,GAAG,CAAC,CAAC,CAAEJ,QAAQ,CAAC,EAAI,IAAI,CAAG,IAAI,CAAGC,IAAI,CAAC,CAAC,CACxE,MAAO,CAAEI,MAAM,CAAKX,IAAI,CAACY,KAAK,CAACH,GAAG,CAAG,GAAG,CAAC,IAAI,CAAC,CAClD","ignoreList":[]}',version:"3.16.7"},Si=function(t){var n,o,i=t.index,a=t.total,s=t.tick,A=t.color,c=l.useAnimatedStyle((n=[new global.Error,-4,-27],(o=function(){var e=s.value*Math.PI*2,t=.5*(.55*Math.sin(2*e+.55*i)+.3*Math.sin(4*e+1.3*i)+.4*Math.sin(.9*e+.27*i))+.5,n=Math.sin(i/Math.max(1,a-1)*Math.PI),r=Math.max(.18,Math.min(1,t)*(.35+.65*n));return{height:"".concat(Math.round(100*r),"%")}}).__closure={tick:s,index:i,total:a},o.__workletHash=5267961911334,o.__initData=wi,o.__stackDetails=n,o));return e.jsx(l.View,{style:[r(li||(li=P(["mx-px rounded-full"]))),{width:2,backgroundColor:A},c]})};function ki(){n.Vibration.vibrate(15)}var Ei,ji,Ii,Mi,Pi,Ti,Oi,_i,Ri,Gi,Fi,Vi,Ki={code:"function VoiceRecordingGestureTsx1(){const{cancelFired,lockFired,dragX,dragY}=this.__closure;cancelFired.value=0;lockFired.value=0;dragX.value=0;dragY.value=0;}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx1","cancelFired","lockFired","dragX","dragY","__closure","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAoDiB,SAAAA,yBAAMA,CAAA,QAAAC,WAAA,CAAAC,SAAA,CAAAC,KAAA,CAAAC,KAAA,OAAAC,SAAA,CAEfJ,WAAW,CAACK,KAAK,CAAG,CAAC,CACrBJ,SAAS,CAACI,KAAK,CAAG,CAAC,CACnBH,KAAK,CAACG,KAAK,CAAG,CAAC,CACfF,KAAK,CAACE,KAAK,CAAG,CAAC,CACnB","ignoreList":[]}',version:"3.16.7"},Di={code:"function VoiceRecordingGestureTsx2(e){const{dragX,dragY,lockFired,LOCK_THRESHOLD,runOnJS,fireLock,cancelFired,CANCEL_THRESHOLD,fireCancel}=this.__closure;const x=Math.min(0,e.translationX);const y=Math.min(0,e.translationY);dragX.value=x;dragY.value=y;if(lockFired.value===0&&y<=-LOCK_THRESHOLD){lockFired.value=1;runOnJS(fireLock)();}if(cancelFired.value===0&&x<=-CANCEL_THRESHOLD){cancelFired.value=1;runOnJS(fireCancel)();}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx2","e","dragX","dragY","lockFired","LOCK_THRESHOLD","runOnJS","fireLock","cancelFired","CANCEL_THRESHOLD","fireCancel","__closure","x","Math","min","translationX","y","translationY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AA2DmB,QAAC,CAAAA,yBAAKA,CAAAC,CAAA,QAAAC,KAAA,CAAAC,KAAA,CAAAC,SAAA,CAAAC,cAAA,CAAAC,OAAA,CAAAC,QAAA,CAAAC,WAAA,CAAAC,gBAAA,CAAAC,UAAA,OAAAC,SAAA,CAEjB,KAAM,CAAAC,CAAC,CAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAEb,CAAC,CAACc,YAAY,CAAC,CACrC,KAAM,CAAAC,CAAC,CAAGH,IAAI,CAACC,GAAG,CAAC,CAAC,CAAEb,CAAC,CAACgB,YAAY,CAAC,CACrCf,KAAK,CAACgB,KAAK,CAAGN,CAAC,CACfT,KAAK,CAACe,KAAK,CAAGF,CAAC,CACf,GAAIZ,SAAS,CAACc,KAAK,GAAK,CAAC,EAAIF,CAAC,EAAI,CAACX,cAAc,CAAE,CAC/CD,SAAS,CAACc,KAAK,CAAG,CAAC,CACnBZ,OAAO,CAACC,QAAQ,CAAC,CAAC,CAAC,CACvB,CACA,GAAIC,WAAW,CAACU,KAAK,GAAK,CAAC,EAAIN,CAAC,EAAI,CAACH,gBAAgB,CAAE,CACnDD,WAAW,CAACU,KAAK,CAAG,CAAC,CACrBZ,OAAO,CAACI,UAAU,CAAC,CAAC,CAAC,CACzB,CACJ","ignoreList":[]}',version:"3.16.7"},Li={code:"function VoiceRecordingGestureTsx3(){const{lockFired,cancelFired,dragX,withSpring,dragY}=this.__closure;if(lockFired.value===0&&cancelFired.value===0){dragX.value=withSpring(0,{damping:18,stiffness:220});dragY.value=withSpring(0,{damping:18,stiffness:220});}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx3","lockFired","cancelFired","dragX","withSpring","dragY","__closure","value","damping","stiffness"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AA0EoB,SAAAA,yBAAMA,CAAA,QAAAC,SAAA,CAAAC,WAAA,CAAAC,KAAA,CAAAC,UAAA,CAAAC,KAAA,OAAAC,SAAA,CAElB,GAAIL,SAAS,CAACM,KAAK,GAAK,CAAC,EAAIL,WAAW,CAACK,KAAK,GAAK,CAAC,CAAE,CAClDJ,KAAK,CAACI,KAAK,CAAGH,UAAU,CAAC,CAAC,CAAE,CAAEI,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CAC5DJ,KAAK,CAACE,KAAK,CAAGH,UAAU,CAAC,CAAC,CAAE,CAAEI,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CAChE,CACJ","ignoreList":[]}',version:"3.16.7"},Bi={code:"function VoiceRecordingGestureTsx4(){const{dragX,CANCEL_THRESHOLD,arrowPulse}=this.__closure;const progress=Math.min(1,Math.abs(dragX.value)/CANCEL_THRESHOLD);return{transform:[{translateX:dragX.value*0.4+arrowPulse.value}],opacity:1-progress};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx4","dragX","CANCEL_THRESHOLD","arrowPulse","__closure","progress","Math","min","abs","value","transform","translateX","opacity"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAiF4C,SAAAA,yBAAMA,CAAA,QAAAC,KAAA,CAAAC,gBAAA,CAAAC,UAAA,OAAAC,SAAA,CAC1C,KAAM,CAAAC,QAAQ,CAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAED,IAAI,CAACE,GAAG,CAACP,KAAK,CAACQ,KAAK,CAAC,CAAGP,gBAAgB,CAAC,CACtE,MAAO,CACHQ,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEV,KAAK,CAACQ,KAAK,CAAG,GAAG,CAAGN,UAAU,CAACM,KAAM,CAAC,CAAC,CACjEG,OAAO,CAAE,CAAC,CAAGP,QACjB,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},Ui={code:"function VoiceRecordingGestureTsx5(){const{dragY,LOCK_THRESHOLD,interpolate}=this.__closure;const lockProgress=Math.min(1,Math.max(0,-dragY.value/LOCK_THRESHOLD));return{transform:[{translateY:interpolate(lockProgress,[0,1],[0,-22])}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx5","dragY","LOCK_THRESHOLD","interpolate","__closure","lockProgress","Math","min","max","value","transform","translateY"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAwF2C,SAAAA,yBAAMA,CAAA,QAAAC,KAAA,CAAAC,cAAA,CAAAC,WAAA,OAAAC,SAAA,CACzC,KAAM,CAAAC,YAAY,CAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAED,IAAI,CAACE,GAAG,CAAC,CAAC,CAAE,CAACP,KAAK,CAACQ,KAAK,CAAGP,cAAc,CAAC,CAAC,CAC5E,MAAO,CACHQ,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAER,WAAW,CAACE,YAAY,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC,CAAE,CAAC,CAC3E,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},Hi={code:"function VoiceRecordingGestureTsx6(){const{chevronPulse}=this.__closure;return{transform:[{translateY:chevronPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx6","chevronPulse","__closure","transform","translateY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AA8F0C,SAAAA,0BAAA,QAAAC,YAAA,OAAAC,SAAA,OAAO,CACzCC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAClD,CAAC","ignoreList":[]}',version:"3.16.7"},Ni={code:"function VoiceRecordingGestureTsx7(){const{dragX,dragY,micPulse}=this.__closure;return{transform:[{translateX:dragX.value},{translateY:dragY.value},{scale:micPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx7","dragX","dragY","micPulse","__closure","transform","translateX","value","translateY","scale"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAiGsC,SAAAA,0BAAA,QAAAC,KAAA,CAAAC,KAAA,CAAAC,QAAA,OAAAC,SAAA,OAAO,CACrCC,SAAS,CAAE,CACP,CAAEC,UAAU,CAAEL,KAAK,CAACM,KAAM,CAAC,CAC3B,CAAEC,UAAU,CAAEN,KAAK,CAACK,KAAM,CAAC,CAC3B,CAAEE,KAAK,CAAEN,QAAQ,CAACI,KAAM,CAAC,CAEjC,CAAC","ignoreList":[]}',version:"3.16.7"},Wi=function(){var o=D(),i=o.messages,l=o.currentUserId,a=o.onMessageLongPress,s=o.mediaViewerGallery,A=o.clearMediaViewerGallery,c=o.typingUsers,u=o.onSendMessage,d=o.onTypingStart,C=o.onTypingEnd,v=o.onAttachmentPress,h=o.onAudioRecordEnd,f=o.onAudioRecordStart,p=o.onCameraPress,m=o.renderCustomInput,y=o.CustomEmojiIcon,g=o.CustomAttachmentIcon,x=o.CustomCameraIcon,b=o.CustomMicrophoneIcon,w=o.CustomSendIcon,S=o.CustomFileIcon,k=o.CustomImagePreview,E=o.CustomVideoPreview,j=o.keyboardVerticalOffset,I=void 0===j?0:j,T=o.disableKeyboardAvoiding,O=void 0!==T&&T,_=o.startReply,R=o.actionSheetMessage,G=o.actionAnchor,F=o.openActionSheet,V=o.closeActionSheet,K=o.messageActionProps,L=o.messageActionUI,B=o.messageActionLabels,U=o.messageActionIcons,H=o.renderMessageActions,N=o.onCopyMessage,W=o.onDeleteMessage,Y=o.onForwardMessage,z=o.startEdit,Q=o.enterSelectionMode,X=o.theme,J=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=M(t.useState(0),2),o=r[0],i=r[1];return t.useEffect((function(){if(e){var t="ios"===n.Platform.OS?"keyboardWillShow":"keyboardDidShow",r="ios"===n.Platform.OS?"keyboardWillHide":"keyboardDidHide",o=n.Keyboard.addListener(t,(function(e){i(e.endCoordinates.height)})),l=n.Keyboard.addListener(r,(function(){return i(0)}));return function(){o.remove(),l.remove()}}i(0)}),[e]),e?o:0}(!O),q=t.useMemo((function(){return yo(X,L)}),[X,L]),$=t.useMemo((function(){return go(X,B)}),[X,B]),Z=t.useMemo((function(){return xo(X,U)}),[X,U]),ee=t.useCallback((function(e,t){a?a(e):F(e,t)}),[a,F]),te=t.useCallback((function(e,t){switch(V(),e){case"reply":_(t);break;case"copy":N?N(t):Co(t);break;case"edit":z(t);break;case"delete":null==W||W(t);break;case"forward":null==Y||Y(t);break;case"select":Q(t)}}),[V,_,N,W,Y,z,Q]),ne=m?m():e.jsx(uo,{onSendMessage:u,onTypingStart:d,onTypingEnd:C,onAttachmentPress:v,onAudioRecordEnd:h,onAudioRecordStart:f,onCameraPress:p,CustomEmojiIcon:y,CustomAttachmentIcon:g,CustomCameraIcon:x,CustomMicrophoneIcon:b,CustomSendIcon:w,CustomFileIcon:S,CustomImagePreview:k,CustomVideoPreview:E}),re=R?H?H(R,V,null!=G?G:void 0):e.jsx(Eo,{message:R,anchor:G,visible:!0,onClose:V,flags:K,ui:q,labels:$,icons:Z,fontFamily:null==X?void 0:X.fontFamily,onAction:te}):null,oe=e.jsxs(n.View,{style:r(_i||(_i=P(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(n.FlatList,{style:r(Ri||(Ri=P(["flex-1"]))),data:i,keyExtractor:function(e){return e.id},renderItem:function(t){var n,r=t.item,o=t.index;return e.jsx(wn,{message:r,isCurrentUser:r.senderId===l,onLongPress:function(e){return ee(r,e)},isFirstInSequence:o===i.length-1||(null===(n=i[o+1])||void 0===n?void 0:n.senderId)!==r.senderId})},ListHeaderComponent:e.jsx(ci,{typingUsers:c||[],currentUserId:l}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e.jsx(n.View,{style:!O&&J>0?{marginBottom:J}:void 0,children:ne}),e.jsx(Ai,{gallery:s,onClose:A}),re]});return O?e.jsx(n.View,{style:r(Gi||(Gi=P(["flex-1"]))),children:oe}):"android"===n.Platform.OS?e.jsx(n.View,{style:r(Fi||(Fi=P(["flex-1"]))),children:oe}):e.jsx(n.KeyboardAvoidingView,{style:r(Vi||(Vi=P(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:I,children:oe})};exports.InlineReply=Pt,exports.LongPressOverlay=Eo,exports.MessageActionsPopover=function(o){var i,l,a,s,A,c,u,d=o.message,C=o.anchor,v=o.visible,h=o.onClose,f=o.flags,p=o.ui,m=o.fontFamily,y=o.onAction,g=t.useMemo((function(){return d?function(e,t){var n,r=!(null===(n=e.text)||void 0===n||!n.trim());return[{id:"reply",label:"Reply",Icon:ee},{id:"forward",label:"Forward",Icon:ho},{id:"copy",label:"Copy",Icon:vo},{id:"edit",label:"Edit",Icon:En},{id:"select",label:"Select",Icon:fo},{id:"delete",label:"Delete",Icon:sr,destructive:!0}].filter((function(e){switch(e.id){case"reply":return!1!==(null==t?void 0:t.enableReply);case"copy":return!1!==(null==t?void 0:t.enableCopy)&&r;case"edit":return!1!==(null==t?void 0:t.enableEdit)&&r;case"delete":return!1!==(null==t?void 0:t.enableDelete);case"forward":return!1!==(null==t?void 0:t.enableForward);case"select":return!1!==(null==t?void 0:t.enableSelect);default:return!0}}))}(d,f):[]}),[d,f]),x=null!==(i=null==p?void 0:p.width)&&void 0!==i?i:200,b=null!==(l=null==p?void 0:p.borderRadius)&&void 0!==l?l:12,w=null!==(a=null==p?void 0:p.backgroundColor)&&void 0!==a?a:"#FFFFFF",S=null!==(s=null==p?void 0:p.textColor)&&void 0!==s?s:"#111827",k=null!==(A=null==p?void 0:p.iconColor)&&void 0!==A?A:S,E=null!==(c=null==p?void 0:p.destructiveColor)&&void 0!==c?c:"#EF4444",j=null!==(u=null==p?void 0:p.backdropColor)&&void 0!==u?u:"rgba(0,0,0,0.18)",I=t.useMemo((function(){return function(e,t,r,o){var i=n.Dimensions.get("window");if(!e)return{top:i.height/2-r*o/2,left:i.width/2-t/2};var l,a=r*o+12;return l=e.isCurrentUser?e.x+e.width-t:e.x,l=Math.max(8,Math.min(l,i.width-t-8)),{top:i.height-(e.y+e.height)>=a+8?e.y+e.height+6:Math.max(8,e.y-a-6),left:l}}(C,x,48,g.length)}),[C,x,g.length]);return d?e.jsx(n.Modal,{visible:v,transparent:!0,animationType:"fade",onRequestClose:h,statusBarTranslucent:!0,children:e.jsx(n.Pressable,{onPress:h,style:[r(bo||(bo=P(["flex-1"]))),{backgroundColor:j}],children:e.jsx(n.Pressable,{onPress:function(){},style:[r(wo||(wo=P(["absolute overflow-hidden"]))),{width:x,borderRadius:b,backgroundColor:w,top:I.top,left:I.left,shadowColor:"#000",shadowOpacity:.16,shadowRadius:16,shadowOffset:{width:0,height:6},elevation:6}],children:g.map((function(t){var o=t.destructive?E:S,i=t.destructive?E:k;return e.jsxs(n.Pressable,{onPress:function(){return y(t.id,d)},android_ripple:{color:"rgba(0,0,0,0.06)"},style:[r(So||(So=P(["flex-row items-center px-4"]))),{height:48},null==p?void 0:p.rowStyle],children:[e.jsx(n.View,{style:{width:22,height:22,marginRight:14},children:e.jsx(t.Icon,{style:{width:22,height:22},color:i})}),e.jsx(n.Text,{style:J([r(ko||(ko=P(["text-[15px] font-medium"]))),{color:o},null==p?void 0:p.rowTextStyle],m),children:t.label})]},t.id)}))})})}):null},exports.MessageActionsSheet=function(t){var o=t.message,i=t.visible,l=t.onClose,a=t.flags,s=t.fontFamily,A=t.backgroundColor,c=void 0===A?"#1f2937":A,u=t.textColor,d=void 0===u?"#FFFFFF":u,C=t.iconColor,v=void 0===C?"#FFFFFF":C,h=t.destructiveColor,f=void 0===h?"#ef4444":h,p=t.rowStyle,m=t.rowTextStyle,y=t.onAction;if(!o)return null;var g=function(e){return[{id:"reply",label:"Reply",Icon:ee},{id:"copy",label:"Copy",Icon:vo},{id:"edit",label:"Edit",Icon:En},{id:"forward",label:"Forward",Icon:ho},{id:"delete",label:"Delete",Icon:sr,destructive:!0}].filter((function(t){switch(t.id){case"reply":return!1!==(null==e?void 0:e.enableReply);case"copy":return!1!==(null==e?void 0:e.enableCopy);case"edit":return!1!==(null==e?void 0:e.enableEdit);case"delete":return!1!==(null==e?void 0:e.enableDelete);case"forward":return!1!==(null==e?void 0:e.enableForward);default:return!0}}))}(a);return e.jsx(n.Modal,{visible:i,transparent:!0,animationType:"fade",onRequestClose:l,statusBarTranslucent:!0,children:e.jsxs(n.Pressable,{onPress:l,style:r(jo||(jo=P(["flex-1 bg-black/50 justify-end"]))),children:[e.jsx(n.Pressable,{onPress:function(){},style:[r(Io||(Io=P(["mx-3 mb-6 rounded-2xl overflow-hidden"]))),{backgroundColor:c}],children:g.map((function(t,i){var l=t.destructive?f:d,a=t.destructive?f:v;return e.jsxs(n.Pressable,{onPress:function(){y(t.id,o)},style:[r(Mo||(Mo=P(["flex-row items-center justify-between px-5 py-4"]))),0!==i?{borderTopWidth:.5,borderTopColor:"rgba(255,255,255,0.08)"}:null,p],children:[e.jsx(n.Text,{style:J([r(Po||(Po=P(["text-[16px] font-medium"]))),{color:l},m],s),children:t.label}),e.jsx(n.View,{style:{width:22,height:22},children:e.jsx(t.Icon,{style:{width:22,height:22},color:a})})]},t.id)}))}),e.jsx(n.Pressable,{onPress:l,style:[r(To||(To=P(["mx-3 mb-3 rounded-2xl py-4 items-center"]))),{backgroundColor:c}],children:e.jsx(n.Text,{style:J([r(Oo||(Oo=P(["text-[16px] font-semibold"]))),{color:d}],s),children:"Cancel"})})]})})},exports.ReplyPreview=function(t){var o=t.message,i=t.onCancel,l=t.previewMaxLines,a=void 0===l?1:l,s=t.replyStyle,A=t.fontFamily,c=t.accentColor,u=void 0===c?"#22c55e":c,d=t.closeIconColor,C=void 0===d?"rgba(0,0,0,0.5)":d,v=t.backgroundColor,h=void 0===v?"#FFFFFF":v,f=t.senderNameColor,p=t.previewTextColor,m=o.senderName||"You",y=function(e){var t,n,r,o,i,l,a=null===(t=e.mediaItems)||void 0===t?void 0:t[0];return e.text?{text:e.text,thumbnail:null!==(r=e.image)&&void 0!==r?r:"image"===(null==a?void 0:a.kind)||"video"===(null==a?void 0:a.kind)?a.uri:void 0}:e.audio?{text:"🎤 Audio message"}:e.video?{text:"🎥 Video",thumbnail:e.video}:"video"===(null==a?void 0:a.kind)?{text:"🎥 Video",thumbnail:a.uri}:e.image||"image"===(null==a?void 0:a.kind)?{text:"📷 Photo",thumbnail:null!==(o=e.image)&&void 0!==o?o:null==a?void 0:a.uri}:(null!==(n=e.fileAttachments)&&void 0!==n?n:[]).length?{text:"📎 ".concat(null!==(i=null===(l=e.fileAttachments)||void 0===l||null===(l=l[0])||void 0===l?void 0:l.name)&&void 0!==i?i:"File")}:{text:"Message"}}(o),g=y.text,x=y.thumbnail;return e.jsxs(n.View,{style:[r(Ei||(Ei=P(["flex-row items-stretch mx-2 mb-1 rounded-xl overflow-hidden"]))),{backgroundColor:h,minHeight:56,shadowColor:"#000",shadowOpacity:.06,shadowRadius:4,shadowOffset:{width:0,height:1},elevation:1},null==s?void 0:s.container],children:[e.jsx(n.View,{style:[r(ji||(ji=P(["w-[3px] self-stretch"]))),{backgroundColor:u},null==s?void 0:s.replyBar]}),e.jsxs(n.View,{style:r(Ii||(Ii=P(["flex-1 flex-row items-center pl-3 pr-2 py-2"]))),children:[e.jsxs(n.View,{style:r(Mi||(Mi=P(["flex-1 mr-2"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(Pi||(Pi=P(["text-[14px] font-semibold"]))),{color:null!=f?f:u},null==s?void 0:s.senderName],A),children:m}),e.jsx(n.Text,{numberOfLines:a,style:J([r(Ti||(Ti=P(["text-[13px] mt-0.5"]))),{color:null!=p?p:"rgba(0,0,0,0.55)"},null==s?void 0:s.previewText],A),children:g})]}),x&&e.jsx(n.Image,{source:{uri:x},style:[{width:36,height:36,borderRadius:4,marginRight:6},null==s?void 0:s.thumbnail],resizeMode:"cover"}),e.jsx(n.Pressable,{onPress:i,hitSlop:10,style:r(Oi||(Oi=P(["w-7 h-7 items-center justify-center"]))),children:e.jsx(kn,{color:C})})]})]})},exports.SelectIcon=fo,exports.SwipeableMessage=le,exports.VoiceRecorder=function(o){var i=o.primaryColor,a=void 0===i?"#16A34A":i,s=o.backgroundColor,A=void 0===s?"#0B141A":s,c=o.waveformColor,u=void 0===c?"#E9EDEF":c,d=o.timerColor,C=void 0===d?"#FFFFFF":d,v=o.sendButtonColor,h=o.deleteIconColor,f=void 0===h?"#8696A0":h,p=o.pauseIconColor,m=void 0===p?"#F15C6D":p,y=o.borderRadius,g=void 0===y?16:y,x=o.sendButtonSize,b=void 0===x?50:x,w=o.waveCount,S=void 0===w?32:w,k=o.renderDeleteIcon,E=o.renderSendIcon,j=o.renderPauseIcon,I=o.renderPlayIcon,T=o.renderWaveform,O=o.onSend,_=o.onDelete,R=o.onPause,G=o.onResume,F=M(t.useState(0),2),V=F[0],K=F[1],D=M(t.useState(!1),2),L=D[0],B=D[1],U=t.useRef(Date.now()),H=t.useRef(0),N=t.useRef(0);t.useEffect((function(){U.current=Date.now()}),[]),t.useEffect((function(){if(!L){var e=setInterval((function(){K((Date.now()-U.current-H.current)/1e3)}),250);return function(){return clearInterval(e)}}}),[L]);var W=l.useSharedValue(1),Y=l.useSharedValue(1);t.useEffect((function(){W.value=l.withRepeat(l.withSequence(l.withTiming(.5,{duration:600,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(1,{duration:600,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),Y.value=l.withRepeat(l.withSequence(l.withTiming(.3,{duration:600}),l.withTiming(1,{duration:600})),-1,!1)}),[]);var z,Q,X=l.useAnimatedStyle((z=[new global.Error,-3,-27],(Q=function(){return{opacity:L?1:W.value}}).__closure={isPaused:L,pauseOpacity:W},Q.__workletHash=0xf63a8f6d95,Q.__initData=gi,Q.__stackDetails=z,Q)),J=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{opacity:Y.value}};return t.__closure={recBlink:Y},t.__workletHash=6095431465582,t.__initData=xi,t.__stackDetails=e,t}()),q={backgroundColor:A,borderTopLeftRadius:g,borderTopRightRadius:g},$=null!=v?v:a;return e.jsxs(n.View,{style:[r(Jo||(Jo=P(["w-full px-4 py-2.5"]))),q],children:[e.jsxs(n.View,{style:r(qo||(qo=P(["flex-row items-center gap-3 px-1 pt-1.5 pb-2"]))),children:[e.jsx(l.View,{style:[r($o||($o=P(["w-1.5 h-1.5 rounded-full"]))),{backgroundColor:m},J]}),e.jsx(n.Text,{style:[r(Zo||(Zo=P(["text-base font-semibold"]))),{color:C,minWidth:42}],numberOfLines:1,children:ct(V)}),e.jsx(n.View,{style:r(ei||(ei=P(["flex-1"]))),children:T?T():e.jsx(bi,{color:u,count:S})})]}),e.jsxs(n.View,{style:r(ti||(ti=P(["flex-row items-center justify-between mt-1"]))),children:[e.jsx(n.Pressable,{onPress:_,hitSlop:12,style:[r(ni||(ni=P(["items-center justify-center rounded-full"]))),{width:b,height:b}],accessibilityRole:"button",accessibilityLabel:"Delete recording",children:k?k():e.jsx(sr,{style:r.style("w-6 h-6"),color:f})}),e.jsx(n.Pressable,{onPress:function(){B((function(e){var t=!e;return t?(N.current=Date.now(),null==R||R()):(H.current+=Date.now()-N.current,N.current=0,null==G||G()),t}))},hitSlop:12,style:r(ri||(ri=P(["items-center justify-center px-4"]))),accessibilityRole:"button",accessibilityLabel:L?"Resume recording":"Pause recording",children:L?I?I():e.jsx(at,{style:r.style("w-7 h-7"),color:m}):e.jsx(l.View,{style:X,children:j?j():e.jsx(lt,{style:r.style("w-7 h-7"),color:m})})}),e.jsx(n.Pressable,{onPress:O,hitSlop:6,accessibilityRole:"button",accessibilityLabel:"Send recording",style:[r(oi||(oi=P(["items-center justify-center rounded-full"]))),{width:b,height:b,backgroundColor:$}],children:E?E():e.jsx(Pn,{style:r.style("w-6 h-6"),color:"#FFFFFF"})})]})]})},exports.VoiceRecorderFlow=kr,exports.VoiceRecordingGesture=function(o){var a=o.primaryColor,s=void 0===a?"#16A34A":a,A=o.backgroundColor,c=void 0===A?"#1F2C33":A,u=o.timerColor,d=void 0===u?"#FFFFFF":u,C=o.microphoneColor,v=void 0===C?"#FFFFFF":C,h=o.lockColor,f=void 0===h?"#E9EDEF":h,p=o.lockPillBackground,m=void 0===p?"#1F2C33":p,y=o.cancelTextColor,g=void 0===y?"rgba(255,255,255,0.6)":y,x=o.barHeight,b=void 0===x?48:x,w=o.micSize,S=o.renderMicIcon,k=o.renderLockIcon,E=o.renderArrowIcon,j=o.onCancel,I=o.onLock,T=null!=w?w:b,O=M(t.useState(0),2),_=O[0],R=O[1],G=t.useRef(Date.now());t.useEffect((function(){G.current=Date.now();var e=setInterval((function(){R((Date.now()-G.current)/1e3)}),250);return function(){return clearInterval(e)}}),[]);var F=l.useSharedValue(0),V=l.useSharedValue(0),K=l.useSharedValue(0),D=l.useSharedValue(1),L=l.useSharedValue(0),B=l.useSharedValue(0),U=l.useSharedValue(0);t.useEffect((function(){K.value=l.withRepeat(l.withSequence(l.withTiming(-4,{duration:700,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:700,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),D.value=l.withRepeat(l.withSequence(l.withTiming(1.18,{duration:700,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(1.12,{duration:700,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),L.value=l.withRepeat(l.withSequence(l.withTiming(-4,{duration:600,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:600,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1)}),[]);var H=t.useRef(j);H.current=j;var N=t.useRef(I);N.current=I;var W,Y,z=function(){var e;ki(),null===(e=H.current)||void 0===e||e.call(H)},Q=function(){var e;ki(),null===(e=N.current)||void 0===e||e.call(N)},X=i.Gesture.Pan().minDistance(0).onBegin((W=[new global.Error,-5,-27],Y=function(){B.value=0,U.value=0,F.value=0,V.value=0},Y.__closure={cancelFired:B,lockFired:U,dragX:F,dragY:V},Y.__workletHash=9031413480896,Y.__initData=Ki,Y.__stackDetails=W,Y)).onUpdate(function(){var e=[new global.Error,-10,-27],t=function(e){var t=Math.min(0,e.translationX),n=Math.min(0,e.translationY);F.value=t,V.value=n,0===U.value&&n<=-70&&(U.value=1,l.runOnJS(Q)()),0===B.value&&t<=-90&&(B.value=1,l.runOnJS(z)())};return t.__closure={dragX:F,dragY:V,lockFired:U,LOCK_THRESHOLD:70,runOnJS:l.runOnJS,fireLock:Q,cancelFired:B,CANCEL_THRESHOLD:90,fireCancel:z},t.__workletHash=0xac60b03bef6,t.__initData=Di,t.__stackDetails=e,t}()).onFinalize(function(){var e=[new global.Error,-6,-27],t=function(){0===U.value&&0===B.value&&(F.value=l.withSpring(0,{damping:18,stiffness:220}),V.value=l.withSpring(0,{damping:18,stiffness:220}))};return t.__closure={lockFired:U,cancelFired:B,dragX:F,withSpring:l.withSpring,dragY:V},t.__workletHash=0x962b8aa90f5,t.__initData=Li,t.__stackDetails=e,t}()),J=l.useAnimatedStyle(function(){var e=[new global.Error,-4,-27],t=function(){var e=Math.min(1,Math.abs(F.value)/90);return{transform:[{translateX:.4*F.value+K.value}],opacity:1-e}};return t.__closure={dragX:F,CANCEL_THRESHOLD:90,arrowPulse:K},t.__workletHash=2609121094002,t.__initData=Bi,t.__stackDetails=e,t}()),q=l.useAnimatedStyle(function(){var e=[new global.Error,-4,-27],t=function(){var e=Math.min(1,Math.max(0,-V.value/70));return{transform:[{translateY:l.interpolate(e,[0,1],[0,-22])}]}};return t.__closure={dragY:V,LOCK_THRESHOLD:70,interpolate:l.interpolate},t.__workletHash=2770335161610,t.__initData=Ui,t.__stackDetails=e,t}()),$=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{translateY:L.value}]}};return t.__closure={chevronPulse:L},t.__workletHash=0xe2617d14eaa,t.__initData=Hi,t.__stackDetails=e,t}()),Z=l.useAnimatedStyle(function(){var e=[new global.Error,-4,-27],t=function(){return{transform:[{translateX:F.value},{translateY:V.value},{scale:D.value}]}};return t.__closure={dragX:F,dragY:V,micPulse:D},t.__workletHash=0xa3ed9ad56cd,t.__initData=Ni,t.__stackDetails=e,t}());return e.jsxs(n.View,{style:r(ui||(ui=P(["w-full flex-row items-end gap-2 relative"]))),pointerEvents:"box-none",children:[e.jsxs(n.View,{style:[r(di||(di=P(["flex-1 flex-row items-center px-4 rounded-3xl"]))),{minHeight:b,backgroundColor:c}],children:[e.jsx(n.Text,{style:[r(Ci||(Ci=P(["text-base font-semibold"]))),{color:d,minWidth:42}],numberOfLines:1,children:ct(_)}),e.jsxs(l.View,{style:[r(vi||(vi=P(["flex-1 flex-row items-center justify-center gap-1.5"]))),J],children:[E?E():e.jsx(n.Text,{style:[r(hi||(hi=P(["text-base leading-none"]))),{color:g,marginTop:-2}],children:"‹"}),e.jsx(n.Text,{style:[r(fi||(fi=P(["text-sm"]))),{color:g}],children:"Slide to cancel"})]})]}),e.jsxs(n.View,{style:[r(pi||(pi=P(["relative items-center justify-center"]))),{height:b,width:b}],children:[e.jsxs(l.View,{style:[r(mi||(mi=P(["absolute items-center justify-center rounded-2xl py-2.5"]))),{width:T-8,backgroundColor:m,bottom:T+6,gap:6},q],pointerEvents:"none",children:[k?k():e.jsx(ir,{style:{width:18,height:18},color:f}),e.jsx(l.View,{style:$,children:e.jsx(or,{style:{width:14,height:14},color:f})})]}),e.jsx(i.GestureDetector,{gesture:X,children:e.jsx(l.View,{style:[r(yi||(yi=P(["items-center justify-center rounded-full"]))),{width:T,height:T,backgroundColor:s},Z],accessibilityRole:"button",accessibilityLabel:"Hold to record. Slide left to cancel, slide up to lock.",children:S?S():e.jsx(In,{style:{width:26,height:26},color:v})})})]})]})},exports.default=function(t){return e.jsx(At,{children:e.jsx(K,y(y({},t),{},{children:e.jsx(Wi,{})}))})},exports.tryCopyMessage=Co;
17
17
  //# sourceMappingURL=index.js.map