movius-chats 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("react-native"),r=require("twrnc"),o=require("react-native-svg"),i=require("react-native-gesture-handler"),l=require("react-native-reanimated"),a=require("react-native-video");function s(e,t){this.v=e,this.k=t}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n,r,o,i,l){try{var a=e[i](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,o)}function A(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function l(e){c(i,r,o,l,a,"next",e)}function a(e){c(i,r,o,l,a,"throw",e)}l(void 0)}))}}function d(e,t,n){return t=h(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,p()?Reflect.construct(t,n||[],h(e).constructor):t.apply(e,n))}function C(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,R(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,t,n){return(t=R(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function x(){
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("react-native"),r=require("twrnc"),o=require("react-native-svg"),i=require("react-native-gesture-handler"),l=require("react-native-reanimated"),a=require("react-native-video");function s(e,t){this.v=e,this.k=t}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n,r,o,i,l){try{var a=e[i](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,o)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function l(e){c(i,r,o,l,a,"next",e)}function a(e){c(i,r,o,l,a,"throw",e)}l(void 0)}))}}function d(e,t,n){return t=f(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,p()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function C(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,R(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t,n){return(t=R(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function x(){
2
2
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
3
- var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof a?r:a,u=Object.create(s.prototype);return k(u,"_invoke",function(n,r,o){var i,a,s,u=0,c=o||[],A=!1,d={p:0,n:0,v:e,a:C,f:C.bind(e,4),d:function(t,n){return i=t,a=0,s=e,d.n=n,l}};function C(n,r){for(a=n,s=r,t=0;!A&&u&&!o&&t<c.length;t++){var o,i=c[t],C=d.p,v=i[2];n>3?(o=v===r)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=C&&((o=n<2&&C<i[1])?(a=0,d.v=r,d.n=i[1]):C<v&&(o=n<3||i[0]>r||r>v)&&(i[4]=n,i[5]=r,d.n=v,a=0))}if(o||n>1)return l;throw A=!0,r}return function(o,c,v){if(u>1)throw TypeError("Generator is already running");for(A&&1===c&&C(c,v),a=c,s=v;(t=a<2?e:s)||!A;){i||(a?a<3?(a>1&&(d.n=-1),C(a,s)):d.n=s:d.v=s);try{if(u=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(A=d.n<0)?s:n.call(r,d))!==l)break}catch(t){i=e,a=1,s=t}finally{u=1}}return{value:t,done:A}}}(n,o,i),!0),u}var l={};function a(){}function s(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(k(t={},r,(function(){return this})),t),A=u.prototype=a.prototype=Object.create(c);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,k(e,o,"GeneratorFunction")),e.prototype=Object.create(A),e}return s.prototype=u,k(A,"constructor",u),k(u,"constructor",s),s.displayName="GeneratorFunction",k(u,o,"GeneratorFunction"),k(A),k(A,o,"Generator"),k(A,r,(function(){return this})),k(A,"toString",(function(){return"[object Generator]"})),(x=function(){return{w:i,m:d}})()}function b(e,t,n,r,o){var i=w(e,t,n,r,o);return i.next().then((function(e){return e.done?e.value:i.next()}))}function w(e,t,n,r,o){return new S(x().w(e,t,n,r),o||Promise)}function S(e,t){function n(r,o,i,l){try{var a=e[r](o),u=a.value;return u instanceof s?t.resolve(u.v).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){a.value=e,i(a)}),(function(e){return n("throw",e,i,l)}))}catch(e){l(e)}}var r;this.next||(k(S.prototype),k(S.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),k(this,"_invoke",(function(e,o,i){function l(){return new t((function(t,r){n(e,i,t,r)}))}return r=r?r.then(l,l):l()}),!0)}function k(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}k=function(e,t,n,r){function i(t,n){k(e,t,(function(e){return this._invoke(t,n,e)}))}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},k(e,t,n,r)}function E(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}}function j(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function M(e,t){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},M(e,t)}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,l,a=[],s=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(s=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw o}}return a}}(e,t)||O(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function T(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||O(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function O(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function _(){var e=x(),t=e.m(_),n=(Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__).constructor;function r(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===n||"GeneratorFunction"===(t.displayName||t.name))}var o={throw:1,return:2,break:3,continue:3};function i(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,o[e],t)},delegateYield:function(e,o,i){return t.resultName=o,n(r.d,j(e),i)},finish:function(e){return n(r.f,e)}},n=function(e,n,o){r.p=t.prev,r.n=t.next;try{return e(n,o)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(_=function(){return{wrap:function(t,n,r,o){return e.w(i(t),n,r,o&&o.reverse())},isGeneratorFunction:r,mark:e.m,awrap:function(e,t){return new s(e,t)},AsyncIterator:S,async:function(e,t,n,o,l){return(r(t)?w:b)(i(e),t,n,o,l)},keys:E,values:j}})()}var G=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 48 48",children:e.jsx(o.Path,{fill:r,fillRule:"evenodd",stroke:r,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",d:"M8 9.115c0-1.82 2.235-2.694 3.47-1.356l29.432 31.884c1.182 1.282.273 3.357-1.47 3.357H10a2 2 0 0 1-2-2z",clipRule:"evenodd"})})},F=["children"],D=t.createContext(void 0),V=function(n){var r=n.children,o=g(n,F),i=I(t.useState(null),2),l=i[0],a=i[1],s=I(t.useState(!1),2),u=s[0],c=s[1],A=I(t.useState(null),2),d=A[0],C=A[1],v=I(t.useState(null),2),f=v[0],h=v[1],p=I(t.useState(null),2),m=p[0],x=p[1],b=I(t.useState(!1),2),w=b[0],S=b[1],k=I(t.useState([]),2),E=k[0],j=k[1],M=I(t.useState(null),2),P=M[0],R=M[1],O=t.useCallback((function(e,t){a({items:e,initialIndex:t});var n=e[t];c("video"===(null==n?void 0:n.kind))}),[]),_=t.useCallback((function(){a(null),c(!1)}),[]),G=o.onSelectionChange,V=t.useCallback((function(e){null==G||G(e)}),[G]),L=t.useCallback((function(e){var t;C(e),R(null),null===(t=o.onReplyMessage)||void 0===t||t.call(o,e)}),[o]),K=t.useCallback((function(){C(null)}),[]),B=t.useCallback((function(e,t){x(null!=t?t:null),h(e)}),[]),U=t.useCallback((function(){h(null),x(null)}),[]),H=t.useCallback((function(e){S(!0);var t=e?[e.id]:[];j(t),V(t)}),[V]),N=t.useCallback((function(){S(!1),j([]),V([])}),[V]),W=t.useCallback((function(e){j((function(t){var n=t.includes(e.id)?t.filter((function(t){return t!==e.id})):[].concat(T(t),[e.id]);return V(n),0===n.length&&S(!1),n}))}),[V]),z=t.useCallback((function(e){return E.includes(e)}),[E]),Y=t.useCallback((function(e){R(e),C(null)}),[]),Q=t.useCallback((function(){R(null)}),[]);return e.jsx(D.Provider,{value:y(y({},o),{},{mediaViewerGallery:l,setMediaViewerGallery:O,clearMediaViewerGallery:_,isVideoPlaying:u,setIsVideoPlaying:c,replyTarget:d,startReply:L,cancelReply:K,actionSheetMessage:f,actionAnchor:m,openActionSheet:B,closeActionSheet:U,selectionMode:w,selectedIds:E,enterSelectionMode:H,exitSelectionMode:N,toggleSelection:W,isSelected:z,editingMessage:P,startEdit:Y,cancelEdit:Q}),children:r})},L=function(){var e=t.useContext(D);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e};function K(e){return null==e?void 0:e.colors}function B(e,t){var n,r,o,i,l=K(e),a=t?null!==(n=null==l?void 0:l.sentMediaTimestampBackground)&&void 0!==n?n:"rgba(0,0,0,0.45)":null!==(r=null==l?void 0:l.receivedMediaTimestampBackground)&&void 0!==r?r:"rgba(0,0,0,0.45)",s=t?null==e||null===(o=e.messageStyle)||void 0===o?void 0:o.sentMediaTimestampContainerStyle:null==e||null===(i=e.messageStyle)||void 0===i?void 0:i.receivedMediaTimestampContainerStyle;return y(y({},{paddingHorizontal:8,paddingVertical:4,borderRadius:6}),{},{backgroundColor:a},s)}function U(e,t){var n,r,o=K(e);return t?null!==(r=null==o?void 0:o.sentFileAttachmentBackground)&&void 0!==r?r:"rgba(255, 255, 255, 0.15)":null!==(n=null==o?void 0:o.receivedFileAttachmentBackground)&&void 0!==n?n:"rgba(0, 0, 0, 0.08)"}function H(e,t){var n,r,o=K(e);return t?null!==(r=null==o?void 0:o.sentFileAttachmentTextColor)&&void 0!==r?r:"#ffffff":null!==(n=null==o?void 0:o.receivedFileAttachmentTextColor)&&void 0!==n?n:"#1f2937"}function N(e,t){var n,r,o=K(e);return t?null!==(r=null==o?void 0:o.sentFileAttachmentSubtitleColor)&&void 0!==r?r:"rgba(255,255,255,0.7)":null!==(n=null==o?void 0:o.receivedFileAttachmentSubtitleColor)&&void 0!==n?n:"rgba(31,41,55,0.65)"}function W(e,t){var n,r,o=K(e);return t?null!==(r=null==o?void 0:o.sentAudioSpeedTextColor)&&void 0!==r?r:"#ffffff":null!==(n=null==o?void 0:o.receivedAudioSpeedTextColor)&&void 0!==n?n:"#e5e7eb"}function z(e,t){var n=K(e);return t?null==n?void 0:n.sentMessageTextColor:null==n?void 0:n.receivedMessageTextColor}function Y(e,t){var n=K(e);return t?null==n?void 0:n.sentBubbleBackgroundColor:null==n?void 0:n.receivedBubbleBackgroundColor}function Q(e){if(e.mediaItems&&e.mediaItems.length>0)return e.mediaItems;var t=[];return e.image&&t.push({uri:e.image,kind:"image"}),e.video&&t.push({uri:e.video,kind:"video"}),t}var X="ios"===n.Platform.OS?"h-6 w-6":"w-6 h-6";function J(e,t){return t?[e,{fontFamily:t}]:e}var q,$,Z,ee=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:"m11.336 5.479l-3.973 3.53C5.795 10.405 5.011 11.102 5.011 12s.784 1.596 2.352 2.99l3.973 3.53c.716.637 1.074.956 1.369.823s.295-.611.295-1.57v-2.344c3.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:"M8.461 4.5L3.245 9.344a3.897 3.897 0 0 0 .126 5.823L8.46 19.5",opacity:".5"})]})})},te={code:"function SwipeableMessageTsx1(e){const{isCurrentUser,swipeThreshold,translateX,direction,triggered,runOnJS,triggerReply}=this.__closure;const t=e.translationX;if(isCurrentUser&&t<0||!isCurrentUser&&t>0){const abs=Math.abs(t);const resisted=abs<=swipeThreshold?abs:swipeThreshold+(abs-swipeThreshold)*0.35;translateX.value=direction*resisted;if(abs>=swipeThreshold&&triggered.value===0){triggered.value=1;runOnJS(triggerReply)();}}else{translateX.value=0;}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx",sourceMap:'{"version":3,"names":["SwipeableMessageTsx1","e","isCurrentUser","swipeThreshold","translateX","direction","triggered","runOnJS","triggerReply","__closure","t","translationX","abs","Math","resisted","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx"],"mappings":"AAoBmB,QAAC,CAAAA,oBAAKA,CAAAC,CAAA,QAAAC,aAAA,CAAAC,cAAA,CAAAC,UAAA,CAAAC,SAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,YAAA,OAAAC,SAAA,CAEjB,KAAM,CAAAC,CAAC,CAAGT,CAAC,CAACU,YAAY,CAExB,GAAKT,aAAa,EAAIQ,CAAC,CAAG,CAAC,EAAM,CAACR,aAAa,EAAIQ,CAAC,CAAG,CAAE,CAAE,CAEvD,KAAM,CAAAE,GAAG,CAAGC,IAAI,CAACD,GAAG,CAACF,CAAC,CAAC,CACvB,KAAM,CAAAI,QAAQ,CAAGF,GAAG,EAAIT,cAAc,CAChCS,GAAG,CACHT,cAAc,CAAG,CAACS,GAAG,CAAGT,cAAc,EAAI,IAAI,CACpDC,UAAU,CAACW,KAAK,CAAGV,SAAS,CAAGS,QAAQ,CACvC,GAAIF,GAAG,EAAIT,cAAc,EAAIG,SAAS,CAACS,KAAK,GAAK,CAAC,CAAE,CAChDT,SAAS,CAACS,KAAK,CAAG,CAAC,CACnBR,OAAO,CAACC,YAAY,CAAC,CAAC,CAAC,CAC3B,CACJ,CAAC,IACI,CACDJ,UAAU,CAACW,KAAK,CAAG,CAAC,CACxB,CACJ","ignoreList":[]}',version:"3.16.7"},ne={code:"function SwipeableMessageTsx2(){const{translateX,withSpring,triggered,withTiming}=this.__closure;translateX.value=withSpring(0,{damping:20,stiffness:220});triggered.value=withTiming(0,{duration:200});}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx",sourceMap:'{"version":3,"names":["SwipeableMessageTsx2","translateX","withSpring","triggered","withTiming","__closure","value","damping","stiffness","duration"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx"],"mappings":"AAwCe,SAAAA,oBAAMA,CAAA,QAAAC,UAAA,CAAAC,UAAA,CAAAC,SAAA,CAAAC,UAAA,OAAAC,SAAA,CAEbJ,UAAU,CAACK,KAAK,CAAGJ,UAAU,CAAC,CAAC,CAAE,CAAEK,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CACjEL,SAAS,CAACG,KAAK,CAAGF,UAAU,CAAC,CAAC,CAAE,CAAEK,QAAQ,CAAE,GAAI,CAAC,CAAC,CACtD","ignoreList":[]}',version:"3.16.7"},re={code:"function SwipeableMessageTsx3(){const{translateX,withSpring,triggered,withTiming}=this.__closure;translateX.value=withSpring(0,{damping:20,stiffness:220});triggered.value=withTiming(0,{duration:200});}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx",sourceMap:'{"version":3,"names":["SwipeableMessageTsx3","translateX","withSpring","triggered","withTiming","__closure","value","damping","stiffness","duration"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx"],"mappings":"AA6CoB,SAAAA,oBAAMA,CAAA,QAAAC,UAAA,CAAAC,UAAA,CAAAC,SAAA,CAAAC,UAAA,OAAAC,SAAA,CAElBJ,UAAU,CAACK,KAAK,CAAGJ,UAAU,CAAC,CAAC,CAAE,CAAEK,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CACjEL,SAAS,CAACG,KAAK,CAAGF,UAAU,CAAC,CAAC,CAAE,CAAEK,QAAQ,CAAE,GAAI,CAAC,CAAC,CACtD","ignoreList":[]}',version:"3.16.7"},oe={code:"function SwipeableMessageTsx4(){const{translateX}=this.__closure;return{transform:[{translateX:translateX.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx",sourceMap:'{"version":3,"names":["SwipeableMessageTsx4","translateX","__closure","transform","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx"],"mappings":"AAkDyC,SAAAA,qBAAA,QAAAC,UAAA,OAAAC,SAAA,OAAO,CACxCC,SAAS,CAAE,CAAC,CAAEF,UAAU,CAAEA,UAAU,CAACG,KAAM,CAAC,CAChD,CAAC","ignoreList":[]}',version:"3.16.7"},ie={code:"function SwipeableMessageTsx5(){const{translateX,interpolate,swipeThreshold,Extrapolation}=this.__closure;const abs=Math.abs(translateX.value);const opacity=interpolate(abs,[0,swipeThreshold*0.4,swipeThreshold],[0,0.6,1],Extrapolation.CLAMP);const scale=interpolate(abs,[0,swipeThreshold],[0.6,1],Extrapolation.CLAMP);return{opacity:opacity,transform:[{scale:scale}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx",sourceMap:'{"version":3,"names":["SwipeableMessageTsx5","translateX","interpolate","swipeThreshold","Extrapolation","__closure","abs","Math","value","opacity","CLAMP","scale","transform"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx"],"mappings":"AAqDuC,SAAAA,oBAAMA,CAAA,QAAAC,UAAA,CAAAC,WAAA,CAAAC,cAAA,CAAAC,aAAA,OAAAC,SAAA,CACrC,KAAM,CAAAC,GAAG,CAAGC,IAAI,CAACD,GAAG,CAACL,UAAU,CAACO,KAAK,CAAC,CACtC,KAAM,CAAAC,OAAO,CAAGP,WAAW,CAACI,GAAG,CAAE,CAAC,CAAC,CAAEH,cAAc,CAAG,GAAG,CAAEA,cAAc,CAAC,CAAE,CAAC,CAAC,CAAE,GAAG,CAAE,CAAC,CAAC,CAAEC,aAAa,CAACM,KAAK,CAAC,CAC7G,KAAM,CAAAC,KAAK,CAAGT,WAAW,CAACI,GAAG,CAAE,CAAC,CAAC,CAAEH,cAAc,CAAC,CAAE,CAAC,GAAG,CAAE,CAAC,CAAC,CAAEC,aAAa,CAACM,KAAK,CAAC,CAClF,MAAO,CACHD,OAAO,CAAPA,OAAO,CACPG,SAAS,CAAE,CAAC,CAAED,KAAA,CAAAA,KAAM,CAAC,CACzB,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},le=function(t){var o,a,s=t.isCurrentUser,u=t.enabled,c=t.swipeThreshold,A=t.onReply,d=t.iconColor,C=void 0===d?"rgba(255,255,255,0.95)":d,v=t.iconBackground,f=void 0===v?"rgba(0,0,0,0.35)":v,h=t.iconSize,p=t.children,m=null!=h?h:36,y=l.useSharedValue(0),g=l.useSharedValue(0),x=s?-1:1,b=function(){A()},w=i.Gesture.Pan().enabled(u).activeOffsetX(s?[-12,9999]:[-9999,12]).failOffsetY([-12,12]).onUpdate((o=[new global.Error,-8,-27],a=function(e){var t=e.translationX;if(s&&t<0||!s&&t>0){var n=Math.abs(t),r=n<=c?n:c+.35*(n-c);y.value=x*r,n>=c&&0===g.value&&(g.value=1,l.runOnJS(b)())}else y.value=0},a.__closure={isCurrentUser:s,swipeThreshold:c,translateX:y,direction:x,triggered:g,runOnJS:l.runOnJS,triggerReply:b},a.__workletHash=0x92540fbdb51,a.__initData=te,a.__stackDetails=o,a)).onEnd(function(){var e=[new global.Error,-5,-27],t=function(){y.value=l.withSpring(0,{damping:20,stiffness:220}),g.value=l.withTiming(0,{duration:200})};return t.__closure={translateX:y,withSpring:l.withSpring,triggered:g,withTiming:l.withTiming},t.__workletHash=5306063376371,t.__initData=ne,t.__stackDetails=e,t}()).onFinalize(function(){var e=[new global.Error,-5,-27],t=function(){y.value=l.withSpring(0,{damping:20,stiffness:220}),g.value=l.withTiming(0,{duration:200})};return t.__closure={translateX:y,withSpring:l.withSpring,triggered:g,withTiming:l.withTiming},t.__workletHash=9186301204082,t.__initData=re,t.__stackDetails=e,t}()),S=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{translateX:y.value}]}};return t.__closure={translateX:y},t.__workletHash=1792634838444,t.__initData=oe,t.__stackDetails=e,t}()),k=l.useAnimatedStyle(function(){var e=[new global.Error,-5,-27],t=function(){var e=Math.abs(y.value);return{opacity:l.interpolate(e,[0,.4*c,c],[0,.6,1],l.Extrapolation.CLAMP),transform:[{scale:l.interpolate(e,[0,c],[.6,1],l.Extrapolation.CLAMP)}]}};return t.__closure={translateX:y,interpolate:l.interpolate,swipeThreshold:c,Extrapolation:l.Extrapolation},t.__workletHash=6245144246615,t.__initData=ie,t.__stackDetails=e,t}());return u?e.jsxs(n.View,{style:r(q||(q=P(["relative"]))),children:[e.jsx(l.View,{pointerEvents:"none",style:[r($||($=P(["absolute top-0 bottom-0 items-center justify-center"]))),s?{right:8}:{left:8},k],children:e.jsx(n.View,{style:[r(Z||(Z=P(["rounded-full items-center justify-center"]))),{width:m,height:m,backgroundColor:f}],children:e.jsx(ee,{style:{width:.55*m,height:.55*m},color:C})})}),e.jsx(i.GestureDetector,{gesture:w,children:e.jsx(l.View,{style:S,children:p})})]}):e.jsx(e.Fragment,{children:p})};function ae(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var se,ue={exports:{}},ce={exports:{}},Ae={};var de,Ce,ve,fe,he,pe,me,ye,ge,xe,be,we,Se,ke,Ee,je={};
3
+ var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof a?r:a,A=Object.create(s.prototype);return k(A,"_invoke",function(n,r,o){var i,a,s,A=0,c=o||[],u=!1,d={p:0,n:0,v:e,a:C,f:C.bind(e,4),d:function(t,n){return i=t,a=0,s=e,d.n=n,l}};function C(n,r){for(a=n,s=r,t=0;!u&&A&&!o&&t<c.length;t++){var o,i=c[t],C=d.p,v=i[2];n>3?(o=v===r)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=C&&((o=n<2&&C<i[1])?(a=0,d.v=r,d.n=i[1]):C<v&&(o=n<3||i[0]>r||r>v)&&(i[4]=n,i[5]=r,d.n=v,a=0))}if(o||n>1)return l;throw u=!0,r}return function(o,c,v){if(A>1)throw TypeError("Generator is already running");for(u&&1===c&&C(c,v),a=c,s=v;(t=a<2?e:s)||!u;){i||(a?a<3?(a>1&&(d.n=-1),C(a,s)):d.n=s:d.v=s);try{if(A=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(u=d.n<0)?s:n.call(r,d))!==l)break}catch(t){i=e,a=1,s=t}finally{A=1}}return{value:t,done:u}}}(n,o,i),!0),A}var l={};function a(){}function s(){}function A(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(k(t={},r,(function(){return this})),t),u=A.prototype=a.prototype=Object.create(c);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,A):(e.__proto__=A,k(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=A,k(u,"constructor",A),k(A,"constructor",s),s.displayName="GeneratorFunction",k(A,o,"GeneratorFunction"),k(u),k(u,o,"Generator"),k(u,r,(function(){return this})),k(u,"toString",(function(){return"[object Generator]"})),(x=function(){return{w:i,m:d}})()}function b(e,t,n,r,o){var i=w(e,t,n,r,o);return i.next().then((function(e){return e.done?e.value:i.next()}))}function w(e,t,n,r,o){return new S(x().w(e,t,n,r),o||Promise)}function S(e,t){function n(r,o,i,l){try{var a=e[r](o),A=a.value;return A instanceof s?t.resolve(A.v).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(A).then((function(e){a.value=e,i(a)}),(function(e){return n("throw",e,i,l)}))}catch(e){l(e)}}var r;this.next||(k(S.prototype),k(S.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),k(this,"_invoke",(function(e,o,i){function l(){return new t((function(t,r){n(e,i,t,r)}))}return r=r?r.then(l,l):l()}),!0)}function k(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}k=function(e,t,n,r){function i(t,n){k(e,t,(function(e){return this._invoke(t,n,e)}))}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},k(e,t,n,r)}function E(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}}function j(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function I(e,t){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},I(e,t)}function M(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,l,a=[],s=!0,A=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(s=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){A=!0,o=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(A)throw o}}return a}}(e,t)||O(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function T(e){return function(e){if(Array.isArray(e))return A(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||O(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function O(e,t){if(e){if("string"==typeof e)return A(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}function _(){var e=x(),t=e.m(_),n=(Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__).constructor;function r(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===n||"GeneratorFunction"===(t.displayName||t.name))}var o={throw:1,return:2,break:3,continue:3};function i(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,o[e],t)},delegateYield:function(e,o,i){return t.resultName=o,n(r.d,j(e),i)},finish:function(e){return n(r.f,e)}},n=function(e,n,o){r.p=t.prev,r.n=t.next;try{return e(n,o)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(_=function(){return{wrap:function(t,n,r,o){return e.w(i(t),n,r,o&&o.reverse())},isGeneratorFunction:r,mark:e.m,awrap:function(e,t){return new s(e,t)},AsyncIterator:S,async:function(e,t,n,o,l){return(r(t)?w:b)(i(e),t,n,o,l)},keys:E,values:j}})()}var G=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 48 48",children:e.jsx(o.Path,{fill:r,fillRule:"evenodd",stroke:r,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",d:"M8 9.115c0-1.82 2.235-2.694 3.47-1.356l29.432 31.884c1.182 1.282.273 3.357-1.47 3.357H10a2 2 0 0 1-2-2z",clipRule:"evenodd"})})},F=["children"],V=t.createContext(void 0),D=function(n){var r=n.children,o=g(n,F),i=M(t.useState(null),2),l=i[0],a=i[1],s=M(t.useState(!1),2),A=s[0],c=s[1],u=M(t.useState(null),2),d=u[0],C=u[1],v=M(t.useState(null),2),h=v[0],f=v[1],p=M(t.useState(null),2),m=p[0],x=p[1],b=M(t.useState(!1),2),w=b[0],S=b[1],k=M(t.useState([]),2),E=k[0],j=k[1],I=M(t.useState(null),2),P=I[0],R=I[1],O=t.useCallback((function(e,t){a({items:e,initialIndex:t});var n=e[t];c("video"===(null==n?void 0:n.kind))}),[]),_=t.useCallback((function(){a(null),c(!1)}),[]),G=o.onSelectionChange,D=t.useCallback((function(e){null==G||G(e)}),[G]),K=t.useCallback((function(e){var t;C(e),R(null),null===(t=o.onReplyMessage)||void 0===t||t.call(o,e)}),[o]),L=t.useCallback((function(){C(null)}),[]),B=t.useCallback((function(e,t){x(null!=t?t:null),f(e)}),[]),U=t.useCallback((function(){f(null),x(null)}),[]),H=t.useCallback((function(e){S(!0);var t=e?[e.id]:[];j(t),D(t)}),[D]),N=t.useCallback((function(){S(!1),j([]),D([])}),[D]),W=t.useCallback((function(e){j((function(t){var n=t.includes(e.id)?t.filter((function(t){return t!==e.id})):[].concat(T(t),[e.id]);return D(n),0===n.length&&S(!1),n}))}),[D]),Y=t.useCallback((function(e){return E.includes(e)}),[E]),z=t.useCallback((function(e){R(e),C(null)}),[]),Q=t.useCallback((function(){R(null)}),[]);return e.jsx(V.Provider,{value:y(y({},o),{},{mediaViewerGallery:l,setMediaViewerGallery:O,clearMediaViewerGallery:_,isVideoPlaying:A,setIsVideoPlaying:c,replyTarget:d,startReply:K,cancelReply:L,actionSheetMessage:h,actionAnchor:m,openActionSheet:B,closeActionSheet:U,selectionMode:w,selectedIds:E,enterSelectionMode:H,exitSelectionMode:N,toggleSelection:W,isSelected:Y,editingMessage:P,startEdit:z,cancelEdit:Q}),children:r})},K=function(){var e=t.useContext(V);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e};function L(e){return null==e?void 0:e.colors}function B(e,t){var n,r,o,i,l=L(e),a=t?null!==(n=null==l?void 0:l.sentMediaTimestampBackground)&&void 0!==n?n:"rgba(0,0,0,0.45)":null!==(r=null==l?void 0:l.receivedMediaTimestampBackground)&&void 0!==r?r:"rgba(0,0,0,0.45)",s=t?null==e||null===(o=e.messageStyle)||void 0===o?void 0:o.sentMediaTimestampContainerStyle:null==e||null===(i=e.messageStyle)||void 0===i?void 0:i.receivedMediaTimestampContainerStyle;return y(y({},{paddingHorizontal:8,paddingVertical:4,borderRadius:6}),{},{backgroundColor:a},s)}function U(e,t){var n,r,o=L(e);return t?null!==(r=null==o?void 0:o.sentFileAttachmentBackground)&&void 0!==r?r:"rgba(255, 255, 255, 0.15)":null!==(n=null==o?void 0:o.receivedFileAttachmentBackground)&&void 0!==n?n:"rgba(0, 0, 0, 0.08)"}function H(e,t){var n,r,o=L(e);return t?null!==(r=null==o?void 0:o.sentFileAttachmentTextColor)&&void 0!==r?r:"#ffffff":null!==(n=null==o?void 0:o.receivedFileAttachmentTextColor)&&void 0!==n?n:"#1f2937"}function N(e,t){var n,r,o=L(e);return t?null!==(r=null==o?void 0:o.sentFileAttachmentSubtitleColor)&&void 0!==r?r:"rgba(255,255,255,0.7)":null!==(n=null==o?void 0:o.receivedFileAttachmentSubtitleColor)&&void 0!==n?n:"rgba(31,41,55,0.65)"}function W(e,t){var n,r,o=L(e);return t?null!==(r=null==o?void 0:o.sentAudioSpeedTextColor)&&void 0!==r?r:"#ffffff":null!==(n=null==o?void 0:o.receivedAudioSpeedTextColor)&&void 0!==n?n:"#e5e7eb"}function Y(e,t){var n=L(e);return t?null==n?void 0:n.sentMessageTextColor:null==n?void 0:n.receivedMessageTextColor}function z(e,t){var n=L(e);return t?null==n?void 0:n.sentBubbleBackgroundColor:null==n?void 0:n.receivedBubbleBackgroundColor}function Q(e){if(e.mediaItems&&e.mediaItems.length>0)return e.mediaItems;var t=[];return e.image&&t.push({uri:e.image,kind:"image"}),e.video&&t.push({uri:e.video,kind:"video"}),t}var X="ios"===n.Platform.OS?"h-6 w-6":"w-6 h-6";function J(e,t){return t?[e,{fontFamily:t}]:e}var q,$,Z,ee=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:"m11.336 5.479l-3.973 3.53C5.795 10.405 5.011 11.102 5.011 12s.784 1.596 2.352 2.99l3.973 3.53c.716.637 1.074.956 1.369.823s.295-.611.295-1.57v-2.344c3.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:"M8.461 4.5L3.245 9.344a3.897 3.897 0 0 0 .126 5.823L8.46 19.5",opacity:".5"})]})})},te={code:"function SwipeableMessageTsx1(e){const{isCurrentUser,swipeThreshold,translateX,direction,triggered,runOnJS,triggerReply}=this.__closure;const t=e.translationX;if(isCurrentUser&&t<0||!isCurrentUser&&t>0){const abs=Math.abs(t);const resisted=abs<=swipeThreshold?abs:swipeThreshold+(abs-swipeThreshold)*0.35;translateX.value=direction*resisted;if(abs>=swipeThreshold&&triggered.value===0){triggered.value=1;runOnJS(triggerReply)();}}else{translateX.value=0;}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx",sourceMap:'{"version":3,"names":["SwipeableMessageTsx1","e","isCurrentUser","swipeThreshold","translateX","direction","triggered","runOnJS","triggerReply","__closure","t","translationX","abs","Math","resisted","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx"],"mappings":"AAoBmB,QAAC,CAAAA,oBAAKA,CAAAC,CAAA,QAAAC,aAAA,CAAAC,cAAA,CAAAC,UAAA,CAAAC,SAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,YAAA,OAAAC,SAAA,CAEjB,KAAM,CAAAC,CAAC,CAAGT,CAAC,CAACU,YAAY,CAExB,GAAKT,aAAa,EAAIQ,CAAC,CAAG,CAAC,EAAM,CAACR,aAAa,EAAIQ,CAAC,CAAG,CAAE,CAAE,CAEvD,KAAM,CAAAE,GAAG,CAAGC,IAAI,CAACD,GAAG,CAACF,CAAC,CAAC,CACvB,KAAM,CAAAI,QAAQ,CAAGF,GAAG,EAAIT,cAAc,CAChCS,GAAG,CACHT,cAAc,CAAG,CAACS,GAAG,CAAGT,cAAc,EAAI,IAAI,CACpDC,UAAU,CAACW,KAAK,CAAGV,SAAS,CAAGS,QAAQ,CACvC,GAAIF,GAAG,EAAIT,cAAc,EAAIG,SAAS,CAACS,KAAK,GAAK,CAAC,CAAE,CAChDT,SAAS,CAACS,KAAK,CAAG,CAAC,CACnBR,OAAO,CAACC,YAAY,CAAC,CAAC,CAAC,CAC3B,CACJ,CAAC,IACI,CACDJ,UAAU,CAACW,KAAK,CAAG,CAAC,CACxB,CACJ","ignoreList":[]}',version:"3.16.7"},ne={code:"function SwipeableMessageTsx2(){const{translateX,withSpring,triggered,withTiming}=this.__closure;translateX.value=withSpring(0,{damping:20,stiffness:220});triggered.value=withTiming(0,{duration:200});}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx",sourceMap:'{"version":3,"names":["SwipeableMessageTsx2","translateX","withSpring","triggered","withTiming","__closure","value","damping","stiffness","duration"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx"],"mappings":"AAwCe,SAAAA,oBAAMA,CAAA,QAAAC,UAAA,CAAAC,UAAA,CAAAC,SAAA,CAAAC,UAAA,OAAAC,SAAA,CAEbJ,UAAU,CAACK,KAAK,CAAGJ,UAAU,CAAC,CAAC,CAAE,CAAEK,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CACjEL,SAAS,CAACG,KAAK,CAAGF,UAAU,CAAC,CAAC,CAAE,CAAEK,QAAQ,CAAE,GAAI,CAAC,CAAC,CACtD","ignoreList":[]}',version:"3.16.7"},re={code:"function SwipeableMessageTsx3(){const{translateX,withSpring,triggered,withTiming}=this.__closure;translateX.value=withSpring(0,{damping:20,stiffness:220});triggered.value=withTiming(0,{duration:200});}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx",sourceMap:'{"version":3,"names":["SwipeableMessageTsx3","translateX","withSpring","triggered","withTiming","__closure","value","damping","stiffness","duration"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx"],"mappings":"AA6CoB,SAAAA,oBAAMA,CAAA,QAAAC,UAAA,CAAAC,UAAA,CAAAC,SAAA,CAAAC,UAAA,OAAAC,SAAA,CAElBJ,UAAU,CAACK,KAAK,CAAGJ,UAAU,CAAC,CAAC,CAAE,CAAEK,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CACjEL,SAAS,CAACG,KAAK,CAAGF,UAAU,CAAC,CAAC,CAAE,CAAEK,QAAQ,CAAE,GAAI,CAAC,CAAC,CACtD","ignoreList":[]}',version:"3.16.7"},oe={code:"function SwipeableMessageTsx4(){const{translateX}=this.__closure;return{transform:[{translateX:translateX.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx",sourceMap:'{"version":3,"names":["SwipeableMessageTsx4","translateX","__closure","transform","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx"],"mappings":"AAkDyC,SAAAA,qBAAA,QAAAC,UAAA,OAAAC,SAAA,OAAO,CACxCC,SAAS,CAAE,CAAC,CAAEF,UAAU,CAAEA,UAAU,CAACG,KAAM,CAAC,CAChD,CAAC","ignoreList":[]}',version:"3.16.7"},ie={code:"function SwipeableMessageTsx5(){const{translateX,interpolate,swipeThreshold,Extrapolation}=this.__closure;const abs=Math.abs(translateX.value);const opacity=interpolate(abs,[0,swipeThreshold*0.4,swipeThreshold],[0,0.6,1],Extrapolation.CLAMP);const scale=interpolate(abs,[0,swipeThreshold],[0.6,1],Extrapolation.CLAMP);return{opacity:opacity,transform:[{scale:scale}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx",sourceMap:'{"version":3,"names":["SwipeableMessageTsx5","translateX","interpolate","swipeThreshold","Extrapolation","__closure","abs","Math","value","opacity","CLAMP","scale","transform"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx"],"mappings":"AAqDuC,SAAAA,oBAAMA,CAAA,QAAAC,UAAA,CAAAC,WAAA,CAAAC,cAAA,CAAAC,aAAA,OAAAC,SAAA,CACrC,KAAM,CAAAC,GAAG,CAAGC,IAAI,CAACD,GAAG,CAACL,UAAU,CAACO,KAAK,CAAC,CACtC,KAAM,CAAAC,OAAO,CAAGP,WAAW,CAACI,GAAG,CAAE,CAAC,CAAC,CAAEH,cAAc,CAAG,GAAG,CAAEA,cAAc,CAAC,CAAE,CAAC,CAAC,CAAE,GAAG,CAAE,CAAC,CAAC,CAAEC,aAAa,CAACM,KAAK,CAAC,CAC7G,KAAM,CAAAC,KAAK,CAAGT,WAAW,CAACI,GAAG,CAAE,CAAC,CAAC,CAAEH,cAAc,CAAC,CAAE,CAAC,GAAG,CAAE,CAAC,CAAC,CAAEC,aAAa,CAACM,KAAK,CAAC,CAClF,MAAO,CACHD,OAAO,CAAPA,OAAO,CACPG,SAAS,CAAE,CAAC,CAAED,KAAA,CAAAA,KAAM,CAAC,CACzB,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},le=function(t){var o,a,s=t.isCurrentUser,A=t.enabled,c=t.swipeThreshold,u=t.onReply,d=t.iconColor,C=void 0===d?"rgba(255,255,255,0.95)":d,v=t.iconBackground,h=void 0===v?"rgba(0,0,0,0.35)":v,f=t.iconSize,p=t.children,m=null!=f?f:36,y=l.useSharedValue(0),g=l.useSharedValue(0),x=s?-1:1,b=function(){u()},w=i.Gesture.Pan().enabled(A).activeOffsetX(s?[-12,9999]:[-9999,12]).failOffsetY([-12,12]).onUpdate((o=[new global.Error,-8,-27],a=function(e){var t=e.translationX;if(s&&t<0||!s&&t>0){var n=Math.abs(t),r=n<=c?n:c+.35*(n-c);y.value=x*r,n>=c&&0===g.value&&(g.value=1,l.runOnJS(b)())}else y.value=0},a.__closure={isCurrentUser:s,swipeThreshold:c,translateX:y,direction:x,triggered:g,runOnJS:l.runOnJS,triggerReply:b},a.__workletHash=0x92540fbdb51,a.__initData=te,a.__stackDetails=o,a)).onEnd(function(){var e=[new global.Error,-5,-27],t=function(){y.value=l.withSpring(0,{damping:20,stiffness:220}),g.value=l.withTiming(0,{duration:200})};return t.__closure={translateX:y,withSpring:l.withSpring,triggered:g,withTiming:l.withTiming},t.__workletHash=5306063376371,t.__initData=ne,t.__stackDetails=e,t}()).onFinalize(function(){var e=[new global.Error,-5,-27],t=function(){y.value=l.withSpring(0,{damping:20,stiffness:220}),g.value=l.withTiming(0,{duration:200})};return t.__closure={translateX:y,withSpring:l.withSpring,triggered:g,withTiming:l.withTiming},t.__workletHash=9186301204082,t.__initData=re,t.__stackDetails=e,t}()),S=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{translateX:y.value}]}};return t.__closure={translateX:y},t.__workletHash=1792634838444,t.__initData=oe,t.__stackDetails=e,t}()),k=l.useAnimatedStyle(function(){var e=[new global.Error,-5,-27],t=function(){var e=Math.abs(y.value);return{opacity:l.interpolate(e,[0,.4*c,c],[0,.6,1],l.Extrapolation.CLAMP),transform:[{scale:l.interpolate(e,[0,c],[.6,1],l.Extrapolation.CLAMP)}]}};return t.__closure={translateX:y,interpolate:l.interpolate,swipeThreshold:c,Extrapolation:l.Extrapolation},t.__workletHash=6245144246615,t.__initData=ie,t.__stackDetails=e,t}());return A?e.jsxs(n.View,{style:r(q||(q=P(["relative"]))),children:[e.jsx(l.View,{pointerEvents:"none",style:[r($||($=P(["absolute top-0 bottom-0 items-center justify-center"]))),s?{right:8}:{left:8},k],children:e.jsx(n.View,{style:[r(Z||(Z=P(["rounded-full items-center justify-center"]))),{width:m,height:m,backgroundColor:h}],children:e.jsx(ee,{style:{width:.55*m,height:.55*m},color:C})})}),e.jsx(i.GestureDetector,{gesture:w,children:e.jsx(l.View,{style:S,children:p})})]}):e.jsx(e.Fragment,{children:p})};function ae(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var se,Ae={exports:{}},ce={exports:{}},ue={};var de,Ce,ve,he,fe,pe,me,ye,ge,xe,be,we,Se,ke,Ee,je={};
4
4
  /** @license React v16.13.1
5
5
  * react-is.development.js
6
6
  *
@@ -8,10 +8,10 @@ var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toS
8
8
  *
9
9
  * This source code is licensed under the MIT license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
- */function Me(){return Ce||(Ce=1,"production"===process.env.NODE_ENV?ce.exports=function(){if(se)return Ae;se=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,A=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,C=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,p=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function y(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:switch(e=e.type){case s:case u:case r:case i:case o:case A:return e;default:switch(e=e&&e.$$typeof){case a:case c:case v:case C:case l:return e;default:return d}}case n:return d}}}function g(e){return y(e)===u}return Ae.AsyncMode=s,Ae.ConcurrentMode=u,Ae.ContextConsumer=a,Ae.ContextProvider=l,Ae.Element=t,Ae.ForwardRef=c,Ae.Fragment=r,Ae.Lazy=v,Ae.Memo=C,Ae.Portal=n,Ae.Profiler=i,Ae.StrictMode=o,Ae.Suspense=A,Ae.isAsyncMode=function(e){return g(e)||y(e)===s},Ae.isConcurrentMode=g,Ae.isContextConsumer=function(e){return y(e)===a},Ae.isContextProvider=function(e){return y(e)===l},Ae.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Ae.isForwardRef=function(e){return y(e)===c},Ae.isFragment=function(e){return y(e)===r},Ae.isLazy=function(e){return y(e)===v},Ae.isMemo=function(e){return y(e)===C},Ae.isPortal=function(e){return y(e)===n},Ae.isProfiler=function(e){return y(e)===i},Ae.isStrictMode=function(e){return y(e)===o},Ae.isSuspense=function(e){return y(e)===A},Ae.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===u||e===i||e===o||e===A||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===C||e.$$typeof===l||e.$$typeof===a||e.$$typeof===c||e.$$typeof===h||e.$$typeof===p||e.$$typeof===m||e.$$typeof===f)},Ae.typeOf=y,Ae}():ce.exports=(de||(de=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,A=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,C=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,p=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function y(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:var f=e.type;switch(f){case s:case u:case r:case i:case o:case A:return f;default:var h=f&&f.$$typeof;switch(h){case a:case c:case v:case C:case l:return h;default:return d}}case n:return d}}}var g=s,x=u,b=a,w=l,S=t,k=c,E=r,j=v,M=C,I=n,P=i,T=o,R=A,O=!1;function _(e){return y(e)===u}je.AsyncMode=g,je.ConcurrentMode=x,je.ContextConsumer=b,je.ContextProvider=w,je.Element=S,je.ForwardRef=k,je.Fragment=E,je.Lazy=j,je.Memo=M,je.Portal=I,je.Profiler=P,je.StrictMode=T,je.Suspense=R,je.isAsyncMode=function(e){return O||(O=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),_(e)||y(e)===s},je.isConcurrentMode=_,je.isContextConsumer=function(e){return y(e)===a},je.isContextProvider=function(e){return y(e)===l},je.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},je.isForwardRef=function(e){return y(e)===c},je.isFragment=function(e){return y(e)===r},je.isLazy=function(e){return y(e)===v},je.isMemo=function(e){return y(e)===C},je.isPortal=function(e){return y(e)===n},je.isProfiler=function(e){return y(e)===i},je.isStrictMode=function(e){return y(e)===o},je.isSuspense=function(e){return y(e)===A},je.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===u||e===i||e===o||e===A||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===C||e.$$typeof===l||e.$$typeof===a||e.$$typeof===c||e.$$typeof===h||e.$$typeof===p||e.$$typeof===m||e.$$typeof===f)},je.typeOf=y}()),je)),ce.exports}
11
+ */function Ie(){return Ce||(Ce=1,"production"===process.env.NODE_ENV?ce.exports=function(){if(se)return ue;se=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,A=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,C=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,f=e?Symbol.for("react.fundamental"):60117,p=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function y(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:switch(e=e.type){case s:case A:case r:case i:case o:case u:return e;default:switch(e=e&&e.$$typeof){case a:case c:case v:case C:case l:return e;default:return d}}case n:return d}}}function g(e){return y(e)===A}return ue.AsyncMode=s,ue.ConcurrentMode=A,ue.ContextConsumer=a,ue.ContextProvider=l,ue.Element=t,ue.ForwardRef=c,ue.Fragment=r,ue.Lazy=v,ue.Memo=C,ue.Portal=n,ue.Profiler=i,ue.StrictMode=o,ue.Suspense=u,ue.isAsyncMode=function(e){return g(e)||y(e)===s},ue.isConcurrentMode=g,ue.isContextConsumer=function(e){return y(e)===a},ue.isContextProvider=function(e){return y(e)===l},ue.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},ue.isForwardRef=function(e){return y(e)===c},ue.isFragment=function(e){return y(e)===r},ue.isLazy=function(e){return y(e)===v},ue.isMemo=function(e){return y(e)===C},ue.isPortal=function(e){return y(e)===n},ue.isProfiler=function(e){return y(e)===i},ue.isStrictMode=function(e){return y(e)===o},ue.isSuspense=function(e){return y(e)===u},ue.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===A||e===i||e===o||e===u||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===C||e.$$typeof===l||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===p||e.$$typeof===m||e.$$typeof===h)},ue.typeOf=y,ue}():ce.exports=(de||(de=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,A=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,C=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,f=e?Symbol.for("react.fundamental"):60117,p=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function y(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:var h=e.type;switch(h){case s:case A:case r:case i:case o:case u:return h;default:var f=h&&h.$$typeof;switch(f){case a:case c:case v:case C:case l:return f;default:return d}}case n:return d}}}var g=s,x=A,b=a,w=l,S=t,k=c,E=r,j=v,I=C,M=n,P=i,T=o,R=u,O=!1;function _(e){return y(e)===A}je.AsyncMode=g,je.ConcurrentMode=x,je.ContextConsumer=b,je.ContextProvider=w,je.Element=S,je.ForwardRef=k,je.Fragment=E,je.Lazy=j,je.Memo=I,je.Portal=M,je.Profiler=P,je.StrictMode=T,je.Suspense=R,je.isAsyncMode=function(e){return O||(O=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),_(e)||y(e)===s},je.isConcurrentMode=_,je.isContextConsumer=function(e){return y(e)===a},je.isContextProvider=function(e){return y(e)===l},je.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},je.isForwardRef=function(e){return y(e)===c},je.isFragment=function(e){return y(e)===r},je.isLazy=function(e){return y(e)===v},je.isMemo=function(e){return y(e)===C},je.isPortal=function(e){return y(e)===n},je.isProfiler=function(e){return y(e)===i},je.isStrictMode=function(e){return y(e)===o},je.isSuspense=function(e){return y(e)===u},je.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===A||e===i||e===o||e===u||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===C||e.$$typeof===l||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===p||e.$$typeof===m||e.$$typeof===h)},je.typeOf=y}()),je)),ce.exports}
12
12
  /*
13
13
  object-assign
14
14
  (c) Sindre Sorhus
15
15
  @license MIT
16
- */function Ie(){if(fe)return ve;fe=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 u in i=Object(arguments[s]))t.call(i,u)&&(a[u]=i[u]);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 he;pe=1;return he="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 Re(){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 u in o)if(r(o,u)){var c;try{if("function"!=typeof o[u]){var A=Error((a||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw A.name="Invariant Violation",A}c=o[u](i,u,a,l,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((a||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof 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 Oe(){if(we)return be;we=1;var e=Me(),t=Ie(),n=Pe(),r=Te(),o=Re(),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 u="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",A={array:f("array"),bigint:f("bigint"),bool:f("boolean"),func:f("function"),number:f("number"),object:f("object"),string:f("string"),symbol:f("symbol"),any: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 u=e(a,s,o,i,l+"["+s+"]",n);if(u instanceof Error)return u}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],u=m(s);if("object"!==u)return new C("Invalid "+l+" `"+a+"` of type `"+u+"` supplied to `"+i+"`, expected an object.");for(var c in s)if(r(s,c)){var A=e(s,c,i,l,a+"."+c,n);if(A instanceof Error)return A}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=[],u=0;u<e.length;u++){var c=(0,e[u])(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 u in e){var c=e[u];if("function"!=typeof c)return h(o,i,l,u,y(c));var A=c(a,u,o,i,l+"."+u,n);if(A)return A}return null}))},exact:function(e){return v((function(o,i,l,a,s){var u=o[i],c=m(u);if("object"!==c)return new C("Invalid "+a+" `"+s+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var A=t({},o[i],e);for(var d in A){var v=e[d];if(r(e,d)&&"function"!=typeof v)return h(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 f=v(u,d,l,a,s+"."+d,n);if(f)return f}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,u,A,d,v){if(u=u||c,d=d||a,v!==n){if(s){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var h=u+":"+a;!t[h]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+u+"`. 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[h]=!0,r++)}}return null==l[a]?o?null===l[a]?new C("The "+A+" `"+d+"` is marked as required in `"+u+"`, but its value is `null`."):new C("The "+A+" `"+d+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(l,a,u,A,d)}var l=o.bind(null,!1);return l.isRequired=o.bind(null,!0),l}function f(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 h(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&&(u&&e[u]||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,A.checkPropTypes=o,A.resetWarningCache=o.resetWarningCache,A.PropTypes=A,A},be}function _e(){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 ue.exports;if(Ee=1,"production"!==process.env.NODE_ENV){var e=Me();ue.exports=Oe()(e.isElement,true)}else ue.exports=_e()();return ue.exports}var Fe=ae(Ge()),De=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,u=0;for(n.pattern.lastIndex=0;s&&(o=n.pattern.exec(s));){var c=s.substr(0,o.index);if(u=o.index,++l>i)break;a.push({children:c}),a.push(e.getMatchedPart(n,o[0],o,u)),s=s.substr(o.index+o[0].length),u+=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})}}])}(),Ve=["type"],Le=["style"],Ke=["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&&M(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,Ve);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 De(this.props.children,this.getPatterns()).parse().map((function(r,o){var i=t.props.style,l=r.style,a=g(r,Le);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,Ke);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 ze(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 Ye(e,t,n){var r,o,i,l,a,s=We(e,n),u=null==e?void 0:e.colors;return t?null!==(l=null!==(a=s.sentSenderNameColor)&&void 0!==a?a:null==u?void 0:u.sentMessageTextColor)&&void 0!==l?l:"rgba(255,255,255,0.95)":null!==(r=null!==(o=null!==(i=s.receivedSenderNameColor)&&void 0!==i?i:null==u?void 0:u.sentBubbleBackgroundColor)&&void 0!==o?o:null==u?void 0:u.sentMessageTailColor)&&void 0!==r?r:"#22c55e"}function Qe(e,t,n){var r,o,i,l,a,s,u=We(e,n);return t?null!==(l=null!==(a=u.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=u.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),ut=function(n){var r=n.children,o=I(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)},At=[1,1.5,2],dt=42;function Ct(t){var o,i,l,a,s,u=t.isPlaying,c=t.playbackRate,A=t.onCycleSpeed,d=t.senderAvatar,C=t.senderName,v=t.isCurrentUser,f=t.theme;return u?e.jsx(n.Pressable,{onPress:A,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==f||null===(o=f.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(f,v)},null==f||null===(i=f.messageStyle)||void 0===i?void 0:i.audioSpeedTextStyle],null==f?void 0:f.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==f||null===(l=f.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==f?void 0:f.fontFamily),children:(a=C,s=null==a?void 0:a.trim(),s?s.charAt(0).toUpperCase():"?")})})}var vt,ft,ht,pt,mt,yt,gt,xt,bt,wt,St,kt,Et,jt,Mt=function(o){var i,l,s=o.audioUrl,u=o.audioId,c=o.isVideoPlaying,A=o.isCurrentUser,d=o.senderAvatar,C=o.senderName,v=o.reserveStatusSpace,f=void 0===v||v,h=o.onLongPress,p=L(),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=I(t.useState(!1),2),M=j[0],T=j[1],R=I(t.useState(0),2),O=R[0],_=R[1],G=I(t.useState(0),2),F=G[0],D=G[1],V=I(t.useState(1),2),B=V[0],U=V[1],H=t.useRef(!1),N=t.useRef(0),W=t.useRef(null),z=t.useRef(0),Y=t.useRef(0),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]),X=function(e,t){var n,r,o,i,l=K(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,A),q=X.inactive,$=X.active,Z=function(e,t){var n,r,o,i,l=K(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,A),ee=function(e,t){var n,r,o=K(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,A),te=function(e,t){var n,r,o=K(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,A),ne=M&&!(c||!!S&&S!==u),re=F>0?O/F:0,oe=t.useCallback((function(e){D(e.duration)}),[]),ie=t.useCallback((function(e){var t=e.currentTime;H.current||Date.now()<Y.current||_(t)}),[]),le=t.useCallback((function(){var e;T(!1),_(0),null===(e=E.current)||void 0===e||e.seek(0),k(null)}),[k]),ae=t.useCallback((function(){Y.current=0}),[]),se=t.useCallback((function(){ne?(T(!1),k(null)):(k(u),T(!0))}),[ne,u,k]),ue=t.useCallback((function(){U((function(e){var t=At.indexOf(e),n=At[(t+1)%At.length];return null!=n?n:1}))}),[]),ce=t.useCallback((function(e){var t,n=N.current;if(!(n<=0||F<=0)){var r=Math.max(0,Math.min(e/n,1))*F;_(r),Y.current=Date.now()+3e3,null===(t=E.current)||void 0===t||t.seek(r)}}),[F]),Ae=t.useMemo((function(){return n.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onStartShouldSetPanResponderCapture:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponderCapture:function(){return!0},onPanResponderGrant:function(e,t){H.current=!0,ce(t.x0-z.current)},onPanResponderMove:function(e,t){ce(t.moveX-z.current)},onPanResponderRelease:function(){H.current=!1},onPanResponderTerminate:function(){H.current=!1}})}),[ce]),de=e.jsx(n.Pressable,{onPress:se,onLongPress:h,delayLongPress:250,hitSlop:8,style:r(et||(et=P(["shrink-0 px-0.5"]))),children:ne?x?e.jsx(x,{}):e.jsx(lt,{style:r.style("h-6 w-6"),color:te}):g?e.jsx(g,{}):e.jsx(at,{style:r.style("h-6 w-6"),color:ee})}),Ce=e.jsx(Ct,{isPlaying:ne,playbackRate:B,onCycleSpeed:ue,senderAvatar:d,senderName:C,isCurrentUser:A,theme:m}),ve=e.jsx(n.View,{ref:W,style:[r(tt||(tt=P(["flex-1 min-w-0"]))),{height:36}],onLayout:function(){var e;null===(e=W.current)||void 0===e||e.measure((function(e,t,n,r,o){z.current=o,N.current=n}))},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]},Ae.panHandlers),{},{children:Q.map((function(t,r){var o,i=(r+.5)/50<=re;return e.jsx(n.View,{style:[{flex:1,marginHorizontal:.5,height:Math.max(3,Math.round(36*t)),borderRadius:2,backgroundColor:i?$:q},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"]))),f&&b&&r(rt||(rt=P(["pb-4"])))],children:[e.jsx(a,{ref:E,source:{uri:s},paused:!ne,rate:B,playInBackground:!1,playWhenInactive:!1,onLoad:oe,onProgress:ie,onEnd:le,onSeek:ae,style:{width:0,height:0},progressUpdateInterval:80}),e.jsx(n.View,{style:r(ot||(ot=P(["flex-row items-center gap-1.5"]))),children:A?e.jsxs(e.Fragment,{children:[Ce,de,ve]}):e.jsxs(e.Fragment,{children:[de,ve,Ce]})}),e.jsx(n.Text,{style:J([r(it||(it=P(["text-[11px] mt-1"]))),{color:Z,paddingLeft:A?82:34},null==m||null===(l=m.messageStyle)||void 0===l?void 0:l.audioDurationStyle],null==m?void 0:m.fontFamily),children:ct(ne?O:F>0?F:O)})]})},It=t.memo(Mt),Pt=function(t){var o=t.reply,i=t.fontFamily,l=t.replyStyle,a=t.backgroundColor,s=t.senderNameColor,u=t.previewTextColor,c=t.thumbnailSize,A=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),f=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),h=!!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(ft||(ft=P(["flex-1 flex-row items-center px-3 py-2"]))),children:[e.jsxs(n.View,{style:r(ht||(ht=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:u},null==l?void 0:l.previewText],i),children:v&&!o.preview?"".concat(v," ").concat(f):f})]}),h&&e.jsx(n.Image,{source:{uri:o.thumbnailUri},style:[r(yt||(yt=P(["ml-2"]))),{width:A,height:A,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 u=s.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e.jsx(n.Animated.View,{style:a?{transform:[{rotate:u}]}: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"})})})},Rt=320,Ot=Rt,_t=Math.round(176),Gt=Rt-_t-2,Ft=Math.round(159),Dt=function(o){var i,l=o.uri,s=o.cellStyle,u=o.roundedStyle,c=L(),A=c.theme,d=c.CustomPlayIcon,C=t.useRef(null),v=I(t.useState(0),2),f=v[0],h=v[1],p=I(t.useState(!0),2),m=p[0],y=p[1],g=I(t.useState(!1),2),x=g[0],b=g[1];return e.jsxs(n.View,{style:[s,u],pointerEvents:"none",children:[e.jsx(a,{source:{uri:l},ref:C,paused:!0,muted:!0,playInBackground:!1,playWhenInactive:!1,pointerEvents:"none",style:[u,{width:"100%",height:"100%"}],resizeMode:"cover",onLoadStart:function(){y(!0),b(!1)},onLoad:function(e){h(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"]))),u],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==A||null===(i=A.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:Vt(f)})})]}),x&&e.jsx(n.View,{style:[r(St||(St=P(["absolute inset-0 items-center justify-center bg-red-500/50"]))),u],children:e.jsx(n.Text,{style:J(r(kt||(kt=P(["text-white text-xs"]))),null==A?void 0:A.fontFamily),children:"Video"})})]})};function Vt(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 Lt,Kt,Bt,Ut,Ht,Nt,Wt,zt,Yt,Qt,Xt,Jt,qt,$t,Zt,en,tn,nn,rn,on,ln,an,sn,un,cn,An,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 u={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(Dt,{uri:c.uri,cellStyle:{width:s,height:320},roundedStyle:{borderRadius:8}})})}if(2===o.length){var A=(s-2)/2;return e.jsx(n.View,{style:{width:s,height:Ot,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:A,height:Ot},children:"image"===t.kind?e.jsx(n.Image,{source:{uri:t.uri},style:[u,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Dt,{uri:t.uri,cellStyle:{width:A,height:Ot},roundedStyle:u})},"".concat(t.uri,"-").concat(r))}))})}if(3===o.length){var d=o[0],C=o[1],v=o[2],f=(s-2)/2;return e.jsxs(n.View,{style:{width:s,height:Rt,marginVertical:8,gap:2},children:[e.jsx(n.Pressable,{onPress:function(){return i(o,0)},onLongPress:l,delayLongPress:250,style:{width:s,height:_t},children:"image"===d.kind?e.jsx(n.Image,{source:{uri:d.uri},style:[u,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Dt,{uri:d.uri,cellStyle:{width:s,height:_t},roundedStyle:u})}),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:f,height:Gt},children:"image"===C.kind?e.jsx(n.Image,{source:{uri:C.uri},style:[u,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Dt,{uri:C.uri,cellStyle:{width:f,height:Gt},roundedStyle:u})},"".concat(C.uri,"-1")),e.jsx(n.Pressable,{onPress:function(){return i(o,2)},onLongPress:l,delayLongPress:250,style:{width:f,height:Gt},children:"image"===v.kind?e.jsx(n.Image,{source:{uri:v.uri},style:[u,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Dt,{uri:v.uri,cellStyle:{width:f,height:Gt},roundedStyle:u})},"".concat(v.uri,"-2"))]})]})}var h=(s-2)/2,p=o.length-4,m=o.slice(0,4);return e.jsx(n.View,{style:{width:s,height:Rt,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:h,height:Ft,position:"relative"},children:["image"===t.kind?e.jsx(n.Image,{source:{uri:t.uri},style:[u,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Dt,{uri:t.uri,cellStyle:{width:h,height:Ft},roundedStyle:u}),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))}))})},fn=function(o){var i,l,a,s,u,c=o.message,A=o.onGalleryOpen,d=o.isVideoPlaying,C=o.isCurrentUser,v=o.onLongPress,f=L(),h=f.theme,p=f.showMessageStatus,m=f.onFileAttachmentPress,g=f.replyUI,x=f.replyStyle,b=f.renderInlineReply,w=f.selectionMode,S=f.toggleSelection,k=We(h,g),E=y(y({},null==h||null===(i=h.reply)||void 0===i?void 0:i.styles),x),j=t.useMemo((function(){return Q(c)}),[c]),M=c.replyTo?b?b(c.replyTo,C):e.jsx(Pt,{reply:c.replyTo,fontFamily:null==h?void 0:h.fontFamily,replyStyle:E,backgroundColor:ze(h,C,k),senderNameColor:Ye(h,C,k),previewTextColor:Qe(h,C,k),thumbnailSize:k.thumbnailSize,defaultSenderName:k.defaultReplySenderName}):null;return e.jsxs(n.View,{children:[M,j.length>0&&e.jsx(vn,{items:j,onOpenGallery:A,onLongPress:v}),(null!==(l=c.fileAttachments)&&void 0!==l?l:[]).map((function(t,o){var i,l,a,s,u,A;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(Lt||(Lt=P(["my-1.5 py-2 px-3 rounded-lg max-w-[220px]"]))),{backgroundColor:U(h,C)},C?null==h||null===(i=h.messageStyle)||void 0===i?void 0:i.sentFileAttachmentStyle:null==h||null===(l=h.messageStyle)||void 0===l?void 0:l.receivedFileAttachmentStyle],children:[e.jsxs(n.Text,{style:J([r(Kt||(Kt=P(["text-xs font-semibold"]))),{color:H(h,C)},C?null==h||null===(a=h.messageStyle)||void 0===a?void 0:a.sentFileAttachmentTextStyle:null==h||null===(s=h.messageStyle)||void 0===s?void 0:s.receivedFileAttachmentTextStyle],null==h?void 0:h.fontFamily),numberOfLines:2,children:["📎 ",t.name]}),e.jsx(n.Text,{style:J([r(Bt||(Bt=P(["text-[10px] mt-0.5"]))),{color:N(h,C)},C?null==h||null===(u=h.messageStyle)||void 0===u?void 0:u.sentFileAttachmentSubtitleStyle:null==h||null===(A=h.messageStyle)||void 0===A?void 0:A.receivedFileAttachmentSubtitleStyle],null==h?void 0:h.fontFamily),children:t.type})]},"".concat(t.uri,"-").concat(o))})),c.audio&&e.jsx(It,{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==h||null===(a=h.messageStyle)||void 0===a?void 0:a.sentTextStyle:null==h||null===(s=h.messageStyle)||void 0===s?void 0:s.receivedTextStyle,z(h,C)?{color:z(h,C)}:void 0],null==h?void 0:h.fontFamily),parse:[{type:"url",style:y({color:"blue",textDecorationLine:"underline"},(u=null==h?void 0:h.fontFamily,u?{fontFamily:u}:void 0)),onPress:function(e){return n.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:c.text})]})},hn=t.memo(fn),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,u=t.status,c=t.isCurrentUser,A=t.hasText,d=t.hasAudio,C=t.hasGalleryMedia,v=t.hasFileAttachments,f=t.edited,h=L(),p=h.theme,m=h.showMessageStatus,y=h.editedLabel,g=h.editedTextStyle,x=C&&!A&&!d,b=(C||v)&&!A&&!d,w=x?"#ffffff":b?function(e,t){var n,r,o=K(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=K(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"]))),A?r(zt||(zt=P(["justify-end pb-1 ml-4"]))):d?r(Yt||(Yt=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:[f&&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"===u&&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"===u&&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"===u&&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,u,c,A,d,C,v,f,h,p,m,g=o.message,x=o.isCurrentUser,b=o.isFirstInSequence,w=o.onLongPress,S=o.staticMode,k=void 0!==S&&S,E=L(),j=E.theme,M=E.showAvatars,I=E.showUserNames,T=E.showBubbleTail,R=E.setMediaViewerGallery,O=E.isVideoPlaying,_=E.replyProps,F=E.startReply,D=E.selectionMode,V=E.isSelected,K=E.toggleSelection,B=E.selectionUI,U=y(y({},null==j?void 0:j.selection),B),H=t.useRef(null),N=(null===(i=null==_?void 0:_.enableReply)||void 0===i||i)&&!D&&!k,W=null!==(l=null==_?void 0:_.swipeThreshold)&&void 0!==l?l:60,z=Q(g),X=(null!==(a=null===(s=g.fileAttachments)||void 0===s?void 0:s.length)&&void 0!==a?a:0)>0&&0===z.length&&!g.text&&!g.audio,q=V(g.id),$=t.useCallback((function(){var e;k||(D?K(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,D,K,g,w,x,b]),Z=t.useCallback((function(){D&&K(g)}),[D,K,g]),ee=t.useCallback((function(e,t){D?K(g):R(e,t)}),[D,K,g,R]),te=null==U?void 0:U.rowBackgroundColor,ne=(null==j||null===(u=j.colors)||void 0===u?void 0:u.sentBubbleBackgroundColor)||(null==j||null===(c=j.colors)||void 0===c?void 0:c.sentMessageTailColor)||"#22c55e",re=te||function(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,")")}}if(e.startsWith("rgb("))return e.replace("rgb(","rgba(").replace(")",", ".concat(t,")"));return e}(ne,.12),oe=[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},Y(j,x)?{backgroundColor:Y(j,x)}:{}),x?null==j||null===(A=j.bubbleStyle)||void 0===A?void 0:A.sent:null==j||null===(d=j.bubbleStyle)||void 0===d?void 0:d.received)],ie=e.jsxs(e.Fragment,{children:[!x&&b&&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:g.senderAvatar?e.jsx(n.Image,{source:{uri:g.senderAvatar},style:[r(un||(un=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===(f=g.senderName)||void 0===f?void 0:f.charAt(0)})}),I&&g.senderName&&e.jsx(n.Text,{style:J([r(An||(An=P(["text-sm text-black font-semibold mt-1 capitalize"]))),null==j||null===(h=j.bubbleStyle)||void 0===h?void 0:h.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(hn,{message:g,isCurrentUser:x,isFirstInSequence:b,onGalleryOpen:ee,isVideoPlaying:O,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:z.length>0&&!g.text,hasFileAttachments:X})]});if(k)return e.jsx(n.View,{style:oe,children:ie});var ae=e.jsx(n.Pressable,{ref:H,onLongPress:$,onPress:Z,delayLongPress:250,style:oe,children:ie}),se=null==_?void 0:_.swipe,ue=e.jsx(le,{isCurrentUser:x,enabled:N,swipeThreshold:W,onReply:function(){return F(g)},iconColor:null==se?void 0:se.iconColor,iconBackground:null==se?void 0:se.iconBackground,iconSize:null==se?void 0:se.iconSize,children:ae});return e.jsxs(n.Pressable,{onPress:Z,onLongPress:$,delayLongPress:250,style:r(dn||(dn=P(["w-full"]))),children:[D&&q&&e.jsx(n.View,{pointerEvents:"none",style:[r(Cn||(Cn=P(["absolute inset-0"]))),{backgroundColor:re,zIndex:10}]}),ue]})};var bn=t.memo(xn),wn=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"})]})})},Sn=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"})]})},kn=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"})]})})},En=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"})]})})},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",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"})})},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:"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 Pn(){return Tn.apply(this,arguments)}function Tn(){return(Tn=A(_().mark((function e(){var t;return _().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 Rn,On,_n,Gn,Fn,Dn,Vn,Ln,Kn,Bn,Un,Hn,Nn,Wn,zn,Yn,Qn,Xn,Jn,qn,$n,Zn,er="ios"===n.Platform.OS?50:48,tr="#FFFFFF",nr="#E9EDEF",rr=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"})})},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",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"})]})})},ir=function(t){var n=t.width,o=t.bottomOffset,i=t.background,a=t.lockColor,s=t.chevronColor,u=t.lockIconSize,c=t.pillAnimatedStyle,A=t.chevronAnimatedStyle,d=t.styleOverride,C=t.renderLockIcon;return e.jsxs(l.View,{style:[r(Rn||(Rn=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(or,{style:{width:u,height:u},color:a}),e.jsx(l.View,{style:A,children:e.jsx(rr,{style:{width:14,height:14},color:s})})]})},lr=function(t){var o=t.isHold,a=t.duration,s=t.composedGesture,u=t.micWrapperStyle,c=t.slideTextAnimatedStyle,A=t.lockPillAnimatedStyle,d=t.chevronAnimatedStyle,C=t.primaryColor,v=t.microphoneColor,f=t.timerColor,h=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,M=t.sendButtonBackgroundColor,I=t.sendButtonIconColor,T=t.headerSlot,R=t.renderInputPill,O=t.renderMicIcon,_=t.renderSendIcon,G=t.renderArrowIcon,F=t.renderLockIcon,D=t.containerStyleOverride,V=t.timerTextStyle,L=t.slideTextStyleOverride,K=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(On||(On=P(["flex-row items-end gap-2 relative"]))),D],pointerEvents:"box-none",children:[o?e.jsxs(n.View,{style:[r(_n||(_n=P(["flex-1 rounded-3xl overflow-hidden"]))),H],children:[T,e.jsxs(n.View,{style:r(Gn||(Gn=P(["flex-row items-center px-4 flex-1 min-h-[48px]"]))),children:[e.jsx(n.Text,{style:J([r(Fn||(Fn=P(["text-base font-semibold"]))),{color:f,minWidth:42},V],U),numberOfLines:1,children:ct(a)}),e.jsxs(l.View,{style:[r(Dn||(Dn=P(["flex-1 flex-row items-center justify-center gap-1.5"]))),c],children:[G?G():e.jsx(n.Text,{style:J([r(Vn||(Vn=P(["text-base leading-none"]))),{color:h,marginTop:-2}],U),children:"‹"}),e.jsx(n.Text,{style:J([r(Ln||(Ln=P(["text-sm"]))),{color:h},L],U),children:"Slide to cancel"})]})]})]}):null==R?void 0:R(),e.jsxs(n.View,{style:[r(Kn||(Kn=P(["relative items-center justify-center"]))),{height:w,width:w}],children:[k&&o&&e.jsx(ir,{width:S-8,bottomOffset:S+6,background:m,lockColor:y,chevronColor:g,lockIconSize:b,pillAnimatedStyle:A,chevronAnimatedStyle:d,styleOverride:K,renderLockIcon:F}),E&&!o?e.jsx(n.Pressable,{onPress:j,style:[r(Bn||(Bn=P(["items-center justify-center rounded-full"]))),{height:S,width:S,backgroundColor:null!=M?M:C},B],accessibilityRole:"button",accessibilityLabel:"Send",children:_?_():e.jsx(In,{style:{width:x,height:x},color:null!=I?I:v})}):e.jsx(i.GestureDetector,{gesture:s,children:e.jsx(l.View,{style:[r(Un||(Un=P(["items-center justify-center rounded-full"]))),N,B,u],accessibilityRole:"button",accessibilityLabel:"Tap to record. Long-press and slide left to cancel or up to lock.",children:O?O():e.jsx(jn,{style:{width:x+6,height:x+6},color:v})})})]})]})},ar=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"})]})})},sr=function(t){var o=t.color,i=t.tick,l=t.count;return e.jsx(n.View,{style:r(Hn||(Hn=P(["flex-row items-center justify-between h-6"]))),children:Array.from({length:l}).map((function(t,n){return e.jsx(cr,{index:n,total:l,color:o,tick:i},n)}))})},ur={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"},cr=function(t){var n,o,i=t.index,a=t.total,s=t.color,u=t.tick,c=l.useAnimatedStyle((n=[new global.Error,-4,-27],(o=function(){var e=u.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:u,index:i,total:a},o.__workletHash=4276075972187,o.__initData=ur,o.__stackDetails=n,o));return e.jsx(l.View,{style:[r(Nn||(Nn=P(["mx-px rounded-full"]))),{width:2,backgroundColor:s},c]})},Ar=function(t){var o=t.duration,a=t.isPaused,s=t.composedGesture,u=t.micWrapperStyle,c=t.pausePulseStyle,A=t.recDotStyle,d=t.waveTick,C=t.onCancelPress,v=t.onTogglePause,f=t.backgroundColor,h=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,M=t.renderPauseIcon,I=t.renderPlayIcon,T=t.renderSendIcon,R=t.renderWaveform,O=t.containerStyleOverride,_=t.barStyleOverride,G=t.timerTextStyle,F=t.waveformStyle,D=t.trashButtonStyle,V=t.sendButtonStyle,L=t.fontFamily,K={minHeight:w+50,backgroundColor:f},B={height:x,width:x,backgroundColor:g};return e.jsxs(n.View,{style:[r(Wn||(Wn=P(["w-full rounded-2xl px-4 py-2.5"]))),K,O,_],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(Yn||(Yn=P(["w-1.5 h-1.5 rounded-full"]))),{backgroundColor:y},A]}),e.jsx(n.Text,{style:J([r(Qn||(Qn=P(["text-base font-semibold"]))),{color:h,minWidth:42},G],L),numberOfLines:1,children:ct(o)}),k&&e.jsx(n.View,{style:[r(Xn||(Xn=P(["flex-1"]))),F],children:R?R():e.jsx(sr,{color:p,tick:d,count:S})})]}),e.jsxs(n.View,{style:r(Jn||(Jn=P(["flex-row items-center justify-between mt-1"]))),children:[e.jsx(n.Pressable,{onPress:C,hitSlop:12,style:[r(qn||(qn=P(["items-center justify-center rounded-full"]))),{width:x,height:x},D],accessibilityRole:"button",accessibilityLabel:"Delete recording",children:j?j():e.jsx(ar,{style:r.style("w-6 h-6"),color:m})}),e.jsx(n.Pressable,{onPress:v,hitSlop:12,style:r($n||($n=P(["items-center justify-center px-4"]))),accessibilityRole:"button",accessibilityLabel:a?"Resume recording":"Pause recording",children:a?I?I():e.jsx(at,{style:r.style("w-7 h-7"),color:y}):e.jsx(l.View,{style:c,children:M?M():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(Zn||(Zn=P(["items-center justify-center rounded-full"]))),B,V,u],accessibilityRole:"button",accessibilityLabel:"Send recording",children:T?T():e.jsx(In,{style:{width:b,height:b},color:"#FFFFFF"})})})]})]})};function dr(){n.Vibration.vibrate(15)}var Cr={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"},vr={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"},hr={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"},pr={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"},mr={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"},yr={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"},gr={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"},xr={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"},br={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"},wr={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 Sr=function(n){var r=n.primaryColor,o=void 0===r?"#16A34A":r,a=n.backgroundColor,s=void 0===a?"#0B141A":a,u=n.holdPillBackground,c=void 0===u?"#1F2C33":u,A=n.timerColor,d=void 0===A?tr:A,C=n.microphoneColor,v=void 0===C?tr:C,f=n.lockColor,h=void 0===f?nr:f,p=n.waveformColor,m=void 0===p?nr: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,M=n.inputBarHeight,P=void 0===M?er:M,T=n.micSize,R=n.holdMicScale,O=void 0===R?1.18:R,_=n.iconSize,G=void 0===_?22:_,F=n.lockIconSize,D=void 0===F?18:F,V=n.enableLockRecording,L=void 0===V||V,K=n.enableSlideToCancel,B=void 0===K||K,U=n.enableWaveform,H=void 0===U||U,N=n.lockSlideDistance,W=void 0===N?70:N,z=n.cancelSlideDistance,Y=void 0===z?90:z,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,ue=n.renderWaveform,ce=n.containerStyle,Ae=n.barStyle,de=n.timerTextStyle,Ce=n.slideTextStyle,ve=n.waveformStyle,fe=n.lockPillStyle,he=n.trashButtonStyle,pe=n.sendButtonStyle,me=n.fontFamily,ye=null!=T?T:P,ge=null!=w?w:h,xe=function(e){var n=e.cancelSlideDistance,r=e.lockSlideDistance,o=e.enableLockRecording,a=e.enableSlideToCancel,s=e.holdMicScale,u=e.onRecordingStart,c=e.onRecordingStop,A=e.onSend,d=e.onDelete,C=e.onLock,v=e.onCancel,f=e.onPauseRecording,h=e.onResumeRecording,p=e.onStateChange,m=-Math.abs(n),y=-Math.abs(r),g=m-30,x=y-20,b=I(t.useState("IDLE"),2),w=b[0],S=b[1],k=I(t.useState(0),2),E=k[0],j=k[1],M=I(t.useState(!1),2),P=M[0],T=M[1],R=t.useRef("IDLE"),O=t.useRef(!1);t.useEffect((function(){R.current=w}),[w]),t.useEffect((function(){O.current=P}),[P]);var _=t.useRef(p);_.current=p,t.useEffect((function(){var e;null===(e=_.current)||void 0===e||e.call(_,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),D=l.useSharedValue(y),V=l.useSharedValue(g),L=l.useSharedValue(x),K=l.useSharedValue(o?1:0),B=l.useSharedValue(a?1:0);t.useEffect((function(){F.value=m,D.value=y,V.value=g,L.value=x,K.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),z=l.useSharedValue(0),Y=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(){Y.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(u);te.current=u;var ne=t.useRef(c);ne.current=c;var re=t.useRef(A);re.current=A;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(f);ae.current=f;var se=t.useRef(h);se.current=h;var ue=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,z.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,z.value=0,S("IDLE")}),[]),Ae=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=R.current;if("IDLE"===e)return S("RECORDING_TAP"),void ue();"RECORDING_TAP"!==e&&"LOCKED_RECORDING"!==e||Ae()}),[ue,Ae]),Ce=t.useCallback((function(){"IDLE"===R.current&&(S("RECORDING_HOLD"),ue())}),[ue]),ve=t.useCallback((function(){var e;"RECORDING_HOLD"===R.current&&(dr(),S("LOCKED_RECORDING"),W.value=l.withSpring(0,{damping:18,stiffness:220}),z.value=l.withSpring(0,{damping:18,stiffness:220}),null===(e=ie.current)||void 0===e||e.call(ie))}),[]),fe=t.useCallback((function(){var e,t,n,r=R.current;"RECORDING_HOLD"!==r&&"RECORDING_TAP"!==r&&"LOCKED_RECORDING"!==r||(dr(),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]),he=t.useCallback((function(){"RECORDING_HOLD"===R.current&&Ae()}),[Ae]),pe=t.useCallback((function(){var e,t,n=!O.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(he);ge.current=he;var xe=t.useRef(ve);xe.current=ve;var be=t.useRef(fe);be.current=fe;var we,Se,ke=function(){return me.current()},Ee=function(){return ye.current()},je=function(){return ge.current()},Me=function(){return xe.current()},Ie=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=Cr,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=vr,t.__stackDetails=e,t}()).onUpdate(function(){var e=[new global.Error,-16,-27],t=function(e){if(2===G.value){var t=Math.max(V.value,Math.min(0,e.translationX)),n=Math.max(L.value,Math.min(0,e.translationY)),r=Math.abs(n)>Math.abs(t);W.value=r?0:t,z.value=r?n:0,r&&1===K.value&&0===ee.value&&n<=D.value&&(ee.value=1,l.runOnJS(Me)()),!r&&1===B.value&&0===Z.value&&t<=F.value&&(Z.value=1,l.runOnJS(Ie)())}};return t.__closure={stateShared:G,STATE_HOLD:2,maxLeftShared:V,maxUpShared:L,translateX:W,translateY:z,enableLockShared:K,lockFiredShared:ee,lockThresholdShared:D,runOnJS:l.runOnJS,fireLock:Me,enableCancelShared:B,cancelFiredShared:Z,cancelThresholdShared:F,fireCancel:Ie},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===K.value&&z.value<-12?(ee.value=1,void l.runOnJS(Me)()):void l.runOnJS(je)()};return t.__closure={lockFiredShared:ee,cancelFiredShared:Z,enableLockShared:K,translateY:z,LOCK_ON_RELEASE_DELTA:12,runOnJS:l.runOnJS,fireLock:Me,fireHoldEnd:je},t.__workletHash=8222992215978,t.__initData=hr,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}),z.value=l.withSpring(0,{damping:18,stiffness:220}))};return t.__closure={lockFiredShared:ee,cancelFiredShared:Z,translateX:W,withSpring:l.withSpring,translateY:z},t.__workletHash=0xb56825c4eba,t.__initData=pr,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?z.value:0},{scale:Y.value}]}}).__closure={stateShared:G,STATE_HOLD:2,translateX:W,translateY:z,micScale:Y},Se.__workletHash=0x92736c307cb,Se.__initData=mr,Se.__stackDetails=we,Se)),Re=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=yr,t.__stackDetails=e,t}()),Oe=l.useAnimatedStyle(function(){var e=[new global.Error,-5,-27],t=function(){var e=l.interpolate(z.value,[0,D.value],[0,1],l.Extrapolation.CLAMP);return{transform:[{translateY:l.interpolate(e,[0,1],[0,-22])}]}};return t.__closure={interpolate:l.interpolate,translateY:z,lockThresholdShared:D,Extrapolation:l.Extrapolation},t.__workletHash=5669890750044,t.__initData=gr,t.__stackDetails=e,t}()),_e=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=xr,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=br,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=wr,t.__stackDetails=e,t}());return{state:w,duration:E,isPaused:P,composedGesture:Pe,waveTick:q,micWrapperStyle:Te,slideTextAnimatedStyle:Re,lockPillAnimatedStyle:Oe,chevronAnimatedStyle:_e,pausePulseStyle:Ge,recDotStyle:Fe,triggerCancel:fe,togglePause:pe}}({cancelSlideDistance:Y,lockSlideDistance:W,enableLockRecording:L,enableSlideToCancel:B,holdMicScale:O,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(Ar,{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:ue,containerStyleOverride:ce,barStyleOverride:Ae,timerTextStyle:de,waveformStyle:ve,trashButtonStyle:he,sendButtonStyle:pe,fontFamily:me}):e.jsx(lr,{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:h,chevronColor:ge,iconSize:G,lockIconSize:D,inputBarHeight:P,micSize:ye,enableLockRecording:L,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:fe,sendButtonStyle:pe,fontFamily:me})},kr=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"})]})},Er=function(t){var r=t.fileName,o=t.style,i=L().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)})},jr=t.memo(Er);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 Ir,Pr,Tr,Rr,Or,_r,Gr,Fr,Dr,Vr,Lr,Kr,Br,Ur,Hr,Nr,Wr,zr,Yr,Qr,Xr,Jr,qr,$r,Zr,eo,to,no,ro,oo,io,lo,ao,so,uo,co=function(t){var r,o=t.previews,i=t.closePreview,l=t.onRemoveItem,s=t.CustomFileIcon,u=t.CustomImagePreview,c=t.CustomVideoPreview,A=t.inputHeight,d=L(),C=d.theme,v=d.setMediaViewerGallery,f=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/"))})),h=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&&u?e.jsx(u,{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!=A?A: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===f.length)return null;if(1===f.length){var t=f[0];return t?e.jsxs(n.Pressable,{onPress:function(){return m(0)},style:{position:"relative"},children:[y(t),g(t.uri)]}):null}var r=f.slice(0,3),o=f.length>3?f.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(f).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))}))})}(),h.length>0&&e.jsx(n.ScrollView,{scrollEnabled:h.length>3,style:{maxHeight:232},showsVerticalScrollIndicator:h.length>3,contentContainerStyle:{gap:8},nestedScrollEnabled:!0,children:h.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(kr,{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(jr,{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(co),Co="ios"===n.Platform.OS?32:30,vo="ios"===n.Platform.OS?50:48,fo=function(o){var i,l,a,s,u,c,d,C,v,f,h,p,m,g,x,b,w,S,k,E,j=o.onSendMessage,M=o.onTypingStart,T=o.onTypingEnd,R=o.onAttachmentPress,O=o.onCameraPress,G=o.onAudioRecordStart,F=o.onAudioRecordEnd,D=o.CustomEmojiIcon,V=o.CustomAttachmentIcon,K=o.CustomCameraIcon,B=o.CustomSendIcon,U=o.CustomMicrophoneIcon,H=o.CustomFileIcon,N=o.CustomImagePreview,W=o.CustomVideoPreview,z=I(t.useState(""),2),Y=z[0],Q=z[1],q=I(t.useState({height:Co,isMultiline:!1}),2),$=q[0],Z=q[1],ee=t.useRef(null),te=L(),ne=te.theme,re=te.currentUserId,oe=te.showEmojiButton,ie=te.showAttachmentsButton,le=te.showCameraButton,ae=te.showVoiceRecordButton,se=te.placeholder,ue=te.previewData,ce=te.previewItems,Ae=te.closePreview,de=te.onRemovePreviewItem,Ce=te.CustomVoiceRecorder,ve=te.replyTarget,fe=te.cancelReply,he=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),Me=function(e,t){var n;return null!==(n=We(e,t).inputPreviewBackground)&&void 0!==n?n:"rgba(0, 0, 0, 0.08)"}(ne,Ee),Ie=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)",Re=null!==(u=Ee.thumbnailSize)&&void 0!==u?u:32,Oe=t.useRef(null);t.useEffect((function(){var e;we&&we.id!==Oe.current?(Oe.current=we.id,Q(null!==(e=we.text)&&void 0!==e?e:""),Z({height:Co,isMultiline:!1}),requestAnimationFrame((function(){var e;return null===(e=ee.current)||void 0===e?void 0:e.focus()}))):we||(Oe.current=null)}),[we]);var _e,Ge=t.useMemo((function(){return null!=ce&&ce.length?ce:ue?[ue]:[]}),[ce,ue]),Fe=Ge.length>0,De=null==ne||null===(c=ne.sizes)||void 0===c?void 0:c.inputIconSize,Ve=function(e){if("number"==typeof e&&e>0)return{width:e,height:e};var t="string"==typeof e&&e.trim().length>0?e.trim():X;return r.style(t)}(De),Le="number"==typeof(_e=De)&&_e>0?_e:24,Ke=0===Y.trim().length&&!$.isMultiline,Be=Math.max(0,(vo-Le)/2),Ue=Ke?{paddingTop:Be,paddingBottom:Be}:{paddingBottom:Be},He=!!we,Ne=t.useCallback((function(){Z({height:Co,isMultiline:!1})}),[]),ze=t.useCallback((function(e){Q(e),0===e.length&&Ne()}),[Ne]),Ye=t.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,Co),118),n=t>Co;Z({height:n?t:Co,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=Y.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&&fe())}),[Y,j,re,Fe,Ne,ve,Qe,fe,we,ke,Se]);t.useEffect((function(){Y.trim()?null==M||M():null==T||T()}),[Y,M,T]);var Je=!!Y.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=I(t.useState("idle"),2),a=l[0],s=l[1],u=I(t.useState(0),2),c=u[0],d=u[1],C=t.useRef(null),v=t.useRef(null),f=t.useRef(0),h=t.useRef(i);h.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(){f.current+=1,d(f.current),f.current>=m.current&&e()}),1e3)}),[y]),x=t.useCallback(A(_().mark((function e(){var t,n;return _().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,Pn();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,f.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(A(_().mark((function e(){return _().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(A(_().mark((function e(){return _().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(A(_().mark((function e(){var t,n,r,o,i;return _().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=f.current,f.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=h.current)||void 0===r||r.call(h,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(A(_().mark((function e(){var t,n,r,o;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=C.current,y(),C.current=null,f.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(A(_().mark((function e(){var t;return _().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&&fe());case 4:case"end":return e.stop()}}),e)}))),[j,re,ve,Qe,fe]),lt=t.useCallback((function(){rt.current.cancelRecording()}),[]),at=t.useCallback((function(){rt.current.pauseRecording()}),[]),st=t.useCallback((function(){rt.current.resumeRecording()}),[]),ut=(null==ne||null===(v=ne.inputStyles)||void 0===v||null===(v=v.sendButtonStyle)||void 0===v?void 0:v.backgroundColor)||(null==ne||null===(f=ne.colors)||void 0===f?void 0:f.sentBubbleBackgroundColor)||(null==ne||null===(h=ne.colors)||void 0===h?void 0:h.sentMessageTailColor)||"#22c55e",ct=(null==ne||null===(p=ne.colors)||void 0===p?void 0:p.sendIconsColor)||ut,At=null!==(m=$e.recordingSendButtonBackground)&&void 0!==m?m:ut,dt=$e.recordingBackground,Ct=null!==(g=$e.timerColor)&&void 0!==g?g:ct,vt=null!==(x=$e.longPressMicColor)&&void 0!==x?x:ct,ft=null!==(b=$e.waveformColor)&&void 0!==b?b:ct,ht={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(ht):null,mt=null===(w=null==he?void 0:he.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 u=null===(t=ve.mediaItems)||void 0===t?void 0:t[0],c=null!==(o=ve.image)&&void 0!==o?o:"image"===(null==u?void 0:u.kind)||"video"===(null==u?void 0:u.kind)?u.uri:void 0,A="";return ve.text?A=ve.text:ve.audio?A="🎤 Audio message":ve.video||"video"===(null==u?void 0:u.kind)?A="🎥 Video":ve.image||"image"===(null==u?void 0:u.kind)?A="📷 Photo":(null!==(i=ve.fileAttachments)&&void 0!==i?i:[]).length&&(A="📎 ".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(Ir||(Ir=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.inputPreviewContainer,null==je?void 0:je.container],children:[e.jsxs(n.View,{style:r(Pr||(Pr=P(["flex-1 mr-2"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(Tr||(Tr=P(["text-[13px] font-semibold"]))),{color:Ee.previewSenderNameColor||ut},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==he?void 0:he.previewMaxLines)&&void 0!==s?s:1,style:J([r(Rr||(Rr=P(["text-[12.5px] mt-0.5"]))),{color:Te},null==je?void 0:je.previewText],null==ne?void 0:ne.fontFamily),children:A})]}),c&&e.jsx(n.Image,{source:{uri:c},style:[{width:Re,height:Re,borderRadius:4,marginRight:6},null==je?void 0:je.thumbnail],resizeMode:"cover"}),e.jsx(n.Pressable,{onPress:fe,hitSlop:10,style:[r(Or||(Or=P(["w-7 h-7 items-center justify-center"]))),null==je?void 0:je.closeButton],children:xe?e.jsx(xe,{}):e.jsx(Sn,{color:Pe})})]})}),[yt,ve,null==he?void 0:he.previewMaxLines,je,Ee,null==ne?void 0:ne.fontFamily,ut,Me,Te,Re,Pe,xe,fe]),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],u=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(_r||(_r=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.recordingPreviewContainer],children:[e.jsxs(n.View,{style:r(Gr||(Gr=P(["flex-1 mr-2"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(Fr||(Fr=P(["text-[13px] font-semibold"]))),{color:Ee.previewSenderNameColor||ut}],null==ne?void 0:ne.fontFamily),children:ve.senderName||Ee.defaultReplySenderName||"You"}),e.jsx(n.Text,{numberOfLines:1,style:J([r(Dr||(Dr=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})]}),u&&e.jsx(n.Image,{source:{uri:u},style:[{width:Re-2,height:Re-2,borderRadius:4,marginRight:6},null==je?void 0:je.thumbnail],resizeMode:"cover"}),e.jsx(n.Pressable,{onPress:fe,hitSlop:10,style:[r(Vr||(Vr=P(["w-7 h-7 items-center justify-center"]))),null==je?void 0:je.closeButton],children:xe?e.jsx(xe,{}):e.jsx(Sn,{color:Pe})})]})}),[yt,ve,ct,null==ne?void 0:ne.fontFamily,Ie,je,Ee,Re,Pe,xe,fe]),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:Me||"rgba(0, 0, 0, 0.08)",minHeight:40},null==je?void 0:je.editPreviewContainer],children:[e.jsx(n.View,{style:r(Kr||(Kr=P(["mr-2.5"]))),children:be?e.jsx(be,{}):e.jsx(kn,{style:{width:16,height:16},color:ut})}),e.jsxs(n.View,{style:r(Br||(Br=P(["flex-1 mr-2"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(Ur||(Ur=P(["text-[13px] font-semibold"]))),{color:ut}],null==ne?void 0:ne.fontFamily),children:Ee.editChipTitle||"Edit message"}),e.jsx(n.Text,{numberOfLines:1,style:J([r(Hr||(Hr=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(Nr||(Nr=P(["w-7 h-7 items-center justify-center"]))),null==je?void 0:je.closeButton],children:xe?e.jsx(xe,{}):e.jsx(Sn,{color:Pe})})]}):null}),[gt,we,ge,je,Ee,ut,null==ne?void 0:ne.fontFamily,Me,Te,Pe,xe,be,Se,Ne]),kt=Ke&&!xt,Et=t.useCallback((function(){var t,o,i,l,a,s;return e.jsxs(n.View,{style:[r(Wr||(Wr=P(["flex-1 flex-col bg-white overflow-hidden"]))),{minHeight:vo,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:vo,alignItems:Ke?"center":"flex-end"}],children:[oe&&e.jsx(n.View,{style:Ue,children:e.jsx(n.Pressable,{children:D?e.jsx(D,{}):e.jsx(En,{style:Ve,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:Y,onChangeText:ze,placeholder:se||"Message",style:J([r(Yr||(Yr=P(["bg-transparent flex-1 pl-2"]))),"ios"===n.Platform.OS?r(Qr||(Qr=P(["text-[17px]"]))):r(Xr||(Xr=P(["text-[16px]"]))),{minHeight:Co,maxHeight:118,paddingVertical:Ke?0:8,marginVertical:Ke?(vo-Co)/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&&Y.length>0?"top":"center",onContentSizeChange:Ye}),!He&&e.jsxs(n.View,{style:[r(Jr||(Jr=P(["flex-row items-center gap-4"]))),Ue],children:[ie&&e.jsx(n.Pressable,{onPress:R,children:V?e.jsx(V,{}):e.jsx(Mn,{style:Ve,color:(null==ne||null===(a=ne.colors)||void 0===a?void 0:a.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),le&&!Y.trim()&&e.jsx(n.Pressable,{onPress:O,children:K?e.jsx(K,{}):e.jsx(wn,{style:Ve,color:(null==ne||null===(s=ne.colors)||void 0===s?void 0:s.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]})]})}),[kt,Ke,He,Y,$.isMultiline,Ue,ze,Ye,se,oe,ie,le,R,O,D,V,K,Ve,ne,bt,St]),jt=t.useCallback((function(){var t;return e.jsx(n.Pressable,{onPress:Xe,style:[r(qr||(qr=P(["rounded-full justify-center items-center"]))),y({height:vo,width:vo,backgroundColor:ut},null==ne||null===(t=ne.inputStyles)||void 0===t?void 0:t.sendButtonStyle)],children:B?e.jsx(B,{}):e.jsx(In,{style:r.style("h-6 w-6"),color:ct})})}),[Xe,ut,ct,null==ne||null===(S=ne.inputStyles)||void 0===S?void 0:S.sendButtonStyle,B]),Mt=ae&&!pt&&!He,It=ve&&mt&&!He&&ye?ye(ve,fe):null,Pt={inputBarHeight:vo,primaryColor:At,backgroundColor:dt,timerColor:Ct,microphoneColor:vt,waveformColor:ft,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:ut,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($r||($r=P(["w-full px-2"]))),children:[It,Fe&&e.jsx(Ao,{previews:Ge,closePreview:Ae,onRemoveItem:de,CustomFileIcon:H,CustomImagePreview:N,CustomVideoPreview:W,inputHeight:$.height}),e.jsx(n.View,{style:[r(Zr||(Zr=P(["w-full"]))),null==ne||null===(E=ne.inputStyles)||void 0===E?void 0:E.inputSectionContainerStyle],children:Mt?e.jsx(Sr,y({},Pt)):e.jsxs(n.View,{style:r(eo||(eo=P(["flex-row items-end gap-2"]))),children:[Et(),Je||!ae?jt():pt?e.jsx(n.View,{style:{height:vo,width:vo,justifyContent:"center",alignItems:"center"},children:U?e.jsx(U,{}):e.jsx(jn,{style:r.style("h-8 w-8"),color:ct})}):jt()]})}),pt]})},ho=t.memo(fo),po=function(t){var o,i,l,a,s,u,c,A,d,C,v,f=t.label,h=t.variant,p=void 0===h?"inline":h,m=t.theme,y=t.fontFamily,g=t.renderCustom;if(g)return e.jsx(e.Fragment,{children:g(f)});var x="sticky"===p,b=x?null!==(o=null!==(i=null==m?void 0:m.stickyBackgroundColor)&&void 0!==i?i:null==m?void 0:m.backgroundColor)&&void 0!==o?o:"rgba(0, 0, 0, 0.55)":null!==(l=null==m?void 0:m.backgroundColor)&&void 0!==l?l:"rgba(0, 0, 0, 0.55)",w=x?null!==(a=null!==(s=null==m?void 0:m.stickyTextColor)&&void 0!==s?s:null==m?void 0:m.textColor)&&void 0!==a?a:"#FFFFFF":null!==(u=null==m?void 0:m.textColor)&&void 0!==u?u:"#FFFFFF",S=null!==(c=null==m?void 0:m.fontSize)&&void 0!==c?c:12,k=null!==(A=null==m?void 0:m.borderRadius)&&void 0!==A?A:8,E=null!==(d=null==m?void 0:m.paddingHorizontal)&&void 0!==d?d:12,j=null!==(C=null==m?void 0:m.paddingVertical)&&void 0!==C?C:4,M=x?0:null!==(v=null==m?void 0:m.marginVertical)&&void 0!==v?v:8,I=!1!==(null==m?void 0:m.stickyShadow),T=[{backgroundColor:b,borderRadius:k,paddingHorizontal:E,paddingVertical:j},x&&I&&n.Platform.select({ios:{shadowColor:"#000",shadowOffset:{width:0,height:1},shadowOpacity:.18,shadowRadius:2},android:{elevation:3},default:{}})],R=e.jsx(n.View,{style:T,children:e.jsx(n.Text,{style:J([{color:w,fontSize:S,textAlign:"center"}],y),children:f})});return x?R:e.jsx(n.View,{style:[r(to||(to=P(["items-center justify-center w-full"]))),{marginVertical:M}],pointerEvents:"none",children:R})},mo=t.memo(po);function yo(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 go,xo,bo,wo,So=function(o){var i,l=o.gallery,a=o.onClose,s=L(),u=s.theme,c=s.setIsVideoPlaying,A=t.useRef(null),d=null!==(i=null==l?void 0:l.initialIndex)&&void 0!==i?i:0,C=I(t.useState(d),2),v=C[0],f=C[1],h=n.useWindowDimensions(),p=h.width,m=h.height;t.useEffect((function(){if(null!=l&&l.items.length){var e=l.initialIndex;f(e);var t=l.items[e];c("video"===(null==t?void 0:t.kind)),requestAnimationFrame((function(){try{var t;null===(t=A.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);f(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(no||(no=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(yo,{style:r(oo||(oo=P(["h-8 w-8"])))})}),l.items.length>1&&e.jsx(n.View,{style:r(io||(io=P(["absolute top-14 left-0 right-0 z-10 items-center"]))),children:e.jsxs(n.Text,{style:J(r(lo||(lo=P(["text-white/90 text-sm bg-black/40 px-3 py-1 rounded-full"]))),null==u?void 0:u.fontFamily),children:[v+1," / ",l.items.length]})}),e.jsx(n.FlatList,{ref:A,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=A.current)||void 0===e||e.scrollToIndex({index:t,animated:!1})}),100)},renderItem:function(t){var n=t.item,r=t.index;return e.jsx(ko,{item:n,width:p,height:m,isActive:r===v,autoPlayVideo:r===d&&"video"===n.kind})}})]})}):null},ko=function(o){var i=o.item,l=o.width,s=o.height,u=o.isActive,c=o.autoPlayVideo,A=L().theme,d=t.useRef(null),C=I(t.useState("video"===i.kind),2),v=C[0],f=C[1],h=I(t.useState(!1),2),p=h[0],m=h[1],y="video"===i.kind&&u&&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(){f(!0),m(!1)},onLoad:function(){return f(!1)},onBuffer:function(e){var t=e.isBuffering;return f(t)},onError:function(){m(!0),f(!1)}}),v&&e.jsx(n.View,{style:r(ao||(ao=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(so||(so=P(["absolute inset-0 items-center justify-center px-6"]))),children:e.jsx(n.Text,{style:J(r(uo||(uo=P(["text-white font-semibold"]))),null==A?void 0:A.fontFamily),children:"Failed to load video"})})]})},Eo=t.memo(So),jo=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},Mo=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"})]})})},Io=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"})]})})},Po=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"})]})})},To={reply:"Reply",copy:"Copy",edit:"Edit",delete:"Delete",forward:"Forward",select:"Select"},Ro={reply:ee,copy:Mo,edit:kn,delete:ar,forward:Io,select:Po};function Oo(e,t){var n;return y(y({},null==e||null===(n=e.messageActions)||void 0===n?void 0:n.ui),t)}function _o(e,t){var n;return y(y({},null==e||null===(n=e.messageActions)||void 0===n?void 0:n.labels),t)}function Go(e,t){var n;return y(y(y({},Ro),null==e||null===(n=e.messageActions)||void 0===n?void 0:n.icons),t)}var Fo,Do,Vo,Lo,Ko=function(o){var i,l,a,s,u,c,A,d,C,v,f=o.message,h=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 Oo(void 0,x)}),[x]),j=t.useMemo((function(){return _o(void 0,b)}),[b]),M=t.useMemo((function(){return Go(void 0,w)}),[w]),I=t.useMemo((function(){return f?function(e,t,n,r,o){var i,l,a,s,u,c,A,d=y(y({},To),n),C=Go(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:Io},{id:"copy",label:d.copy,Icon:null!==(s=C.copy)&&void 0!==s?s:Mo},{id:"edit",label:d.edit,Icon:null!==(u=C.edit)&&void 0!==u?u:kn},{id:"select",label:d.select,Icon:null!==(c=C.select)&&void 0!==c?c:Po},{id:"delete",label:d.delete,Icon:null!==(A=C.delete)&&void 0!==A?A:ar,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}}))}(f,g,j,M,null==h?void 0:h.isCurrentUser):[]}),[f,g,j,M,h]),T=null!==(i=E.width)&&void 0!==i?i:200,R=null!==(l=E.borderRadius)&&void 0!==l?l:12,O=null!==(a=E.backgroundColor)&&void 0!==a?a:"#FFFFFF",_=null!==(s=E.textColor)&&void 0!==s?s:"#111827",G=null!==(u=E.iconColor)&&void 0!==u?u:_,F=null!==(c=E.destructiveColor)&&void 0!==c?c:"#EF4444",D=null!==(A=E.scrimColor)&&void 0!==A?A:"rgba(0,0,0,0.60)",V=null!==(d=E.rowHeight)&&void 0!==d?d:36,L=null!==(C=E.iconSize)&&void 0!==C?C:16,K=null!==(v=E.liftedBubblePaddingHorizontal)&&void 0!==v?v:8,B=t.useMemo((function(){return h?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)}}(h,T,V,I.length):null}),[h,T,V,I.length]);if(!f||!h)return null;var U=Math.max(0,h.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(go||(go=P(["flex-1"]))),{backgroundColor:D},E.scrimPressableStyle],children:[e.jsx(n.View,{pointerEvents:"none",style:[{position:"absolute",top:U,left:0,right:0,paddingHorizontal:K}],children:e.jsx(bn,{message:f,isCurrentUser:h.isCurrentUser,isFirstInSequence:h.isFirstInSequence,staticMode:!0})}),B&&e.jsx(n.Pressable,{onPress:function(){},style:[r(xo||(xo=P(["absolute overflow-hidden"]))),{width:T,borderRadius:R,backgroundColor:O,top:B.top,left:B.left,shadowColor:"#000",shadowOpacity:.18,shadowRadius:16,shadowOffset:{width:0,height:6},elevation:6},E.menuStyle],children:I.map((function(t){var o=t.destructive?F:_,i=t.destructive?F:G;return e.jsxs(n.Pressable,{onPress:function(){return k(t.id,f)},android_ripple:{color:"rgba(0,0,0,0.06)"},style:[r(bo||(bo=P(["flex-row items-center px-3"]))),{height:V},E.rowStyle],children:[e.jsx(n.View,{style:{width:L,height:L,marginRight:10},children:e.jsx(t.Icon,{style:{width:L,height:L},color:i})}),e.jsx(n.Text,{style:J([r(wo||(wo=P(["text-[13px] font-medium"]))),{color:o},E.rowTextStyle],S),children:t.label})]},t.id)}))})]})})};var Bo,Uo,Ho,No,Wo,zo,Yo,Qo,Xo,Jo,qo,$o,Zo,ei,ti=function(t){var o,i,l,a,s,u=t.typingUsers,c=t.currentUserId,A=L(),d=A.theme,C=A.showAvatars,v=A.renderCustomTyping,f=A.showBubbleTail,h=A.typingText,p=u.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(Yo||(Yo=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(Qo||(Qo=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(Xo||(Xo=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(Jo||(Jo=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(qo||(qo=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($o||($o=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]})})]}),f&&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(Zo||(Zo=P(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(n.Text,{style:J([r(ei||(ei=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!=h?h:"Typing..."})})]})};var ni,ri,oi,ii,li,ai,si,ui,ci,Ai,di,Ci=["showDateSeparators"];function vi(){try{var e,t;if("ios"===n.Platform.OS){var r,o,i,l,a=null===(r=n.NativeModules.SettingsManager)||void 0===r?void 0:r.settings;return null!==(o=null!==(i=null==a?void 0:a.AppleLocale)&&void 0!==i?i:null==a||null===(l=a.AppleLanguages)||void 0===l?void 0:l[0])&&void 0!==o?o:"en-GB"}return null!==(e=null===(t=n.NativeModules.I18nManager)||void 0===t?void 0:t.localeIdentifier)&&void 0!==e?e:"en-GB"}catch(e){return"en-GB"}}function fi(e){var t=new Date(e);return t.setHours(0,0,0,0),t}function hi(e){var t=fi(e);return"".concat(t.getFullYear(),"-").concat(String(t.getMonth()+1).padStart(2,"0"),"-").concat(String(t.getDate()).padStart(2,"0"))}function pi(e,t){var n=fi(e).getTime(),r=fi(t).getTime();return Math.round((n-r)/864e5)}function mi(e){if(null==e)return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;var t=new Date(e);return Number.isNaN(t.getTime())?null:t}function yi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.locale,r=t.weekdayLabelMaxDays,o=void 0===r?6:r,i=t.formatDateSeparatorLabel,l=t.referenceDate,a=void 0===l?new Date:l;if(i)return i(e);var s=pi(a,e);return 0===s?"Today":1===s?"Yesterday":s>=2&&s<=o?e.toLocaleDateString(n,{weekday:"long"}):e.toLocaleDateString(n,{day:"numeric",month:"long",year:"numeric"})}function gi(e,t,n){var r=mi(e.createdAt);return r?{date:r,dayKey:hi(r)}:(__DEV__&&!n.has(e.id)&&(n.add(e.id),console.warn('[movius-chats] Message "'.concat(e.id,'" is missing a valid createdAt; grouping under today.'))),{date:t,dayKey:hi(t)})}function xi(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.showDateSeparators,o=void 0===r||r,i=g(n,Ci);if(!o)return e.map((function(e){return{type:"message",message:e,id:e.id}}));var l,a=null!==(t=i.referenceDate)&&void 0!==t?t:new Date,s=new Set,u=[],c=null,A=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=O(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==n.return||n.return()}finally{if(a)throw i}}}}(e);try{for(A.s();!(l=A.n()).done;){var d=l.value,C=gi(d,a,s),v=C.date,f=C.dayKey;null!==c&&f!==c&&u.push({type:"dateSeparator",id:"date-sep-".concat(f),label:yi(v,y(y({},i),{},{referenceDate:a})),dayKey:f,date:v}),u.push({type:"message",message:d,id:d.id}),c=f}}catch(e){A.e(e)}finally{A.f()}return u}function bi(e,t){var n=e[t];if(!n||"message"!==n.type)return!1;var r=function(e,t){for(var n=t+1;n>=0&&n<e.length;n+=1){var r=e[n];if(r&&"message"===r.type)return r.message}return null}(e,t);return null===r||r.senderId!==n.message.senderId}function wi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.filter((function(e){return!1!==e.isViewable&&null!=e.index&&e.index>=0&&e.index<t.length}));if(0===r.length)return null;var o=Math.max.apply(Math,T(r.map((function(e){return e.index})))),i=t[o];return i?function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("dateSeparator"===e.type)return e.label;var r=null!==(t=n.referenceDate)&&void 0!==t?t:new Date,o=mi(e.message.createdAt);return yi(null!=o?o:r,y(y({},n),{},{referenceDate:r}))}(i,n):null}var Si,ki,Ei,ji,Mi,Ii,Pi,Ti,Ri,Oi={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"},_i={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"},Gi=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(Ai||(Ai=P(["flex-row items-center justify-between h-6"]))),children:Array.from({length:a}).map((function(t,n){return e.jsx(Di,{index:n,total:a,tick:s,color:i},n)}))})},Fi={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"},Di=function(t){var n,o,i=t.index,a=t.total,s=t.tick,u=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=Fi,o.__stackDetails=n,o));return e.jsx(l.View,{style:[r(di||(di=P(["mx-px rounded-full"]))),{width:2,backgroundColor:u},c]})};function Vi(){n.Vibration.vibrate(15)}var Li,Ki,Bi,Ui,Hi,Ni,Wi,zi,Yi,Qi,Xi,Ji,qi,$i,Zi,el={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"},tl={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"},nl={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"},rl={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"},ol={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"},il={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"},ll={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"},al=function(){var o,i,l=L(),a=l.messages,s=l.currentUserId,u=l.onMessageLongPress,c=l.mediaViewerGallery,A=l.clearMediaViewerGallery,d=l.typingUsers,C=l.onSendMessage,v=l.onTypingStart,f=l.onTypingEnd,h=l.onAttachmentPress,p=l.onAudioRecordEnd,m=l.onAudioRecordStart,g=l.onCameraPress,x=l.renderCustomInput,b=l.CustomEmojiIcon,w=l.CustomAttachmentIcon,S=l.CustomCameraIcon,k=l.CustomMicrophoneIcon,E=l.CustomSendIcon,j=l.CustomFileIcon,M=l.CustomImagePreview,T=l.CustomVideoPreview,R=l.keyboardVerticalOffset,O=void 0===R?0:R,_=l.disableKeyboardAvoiding,G=void 0!==_&&_,F=l.startReply,D=l.actionSheetMessage,V=l.actionAnchor,K=l.openActionSheet,B=l.closeActionSheet,U=l.messageActionProps,H=l.messageActionUI,N=l.messageActionLabels,W=l.messageActionIcons,z=l.renderMessageActions,Y=l.onCopyMessage,Q=l.onDeleteMessage,X=l.onForwardMessage,J=l.onEndReached,q=l.onEndReachedThreshold,$=void 0===q?.5:q,Z=l.isLoadingMoreMessages,ee=void 0!==Z&&Z,te=l.renderLoadingMoreIndicator,ne=l.loadingMoreIndicatorContainerStyle,re=l.loadingMoreIndicatorText,oe=l.loadingMoreIndicatorTextStyle,ie=l.loadingMoreIndicatorColor,le=l.loadingMoreIndicatorSize,ae=void 0===le?"small":le,se=l.showDateSeparators,ue=void 0===se||se,ce=l.showStickyDateHeader,Ae=void 0===ce||ce,de=l.formatDateSeparatorLabel,Ce=l.weekdayLabelMaxDays,ve=void 0===Ce?6:Ce,fe=l.dateSeparatorLocale,he=l.renderDateSeparator,pe=l.renderStickyDateHeader,me=l.stickyHeaderVisibilityThreshold,ye=void 0===me?20:me,ge=l.startEdit,xe=l.enterSelectionMode,be=l.theme,we=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=I(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}(!G),Se=t.useMemo((function(){return Oo(be,H)}),[be,H]),ke=t.useMemo((function(){return _o(be,N)}),[be,N]),Ee=t.useMemo((function(){return Go(be,W)}),[be,W]),je=null!=fe?fe:vi(),Me=t.useMemo((function(){return{locale:je,weekdayLabelMaxDays:ve,formatDateSeparatorLabel:de}}),[je,ve,de]),Ie=t.useMemo((function(){return xi(a,y({showDateSeparators:ue},Me))}),[a,ue,Me]),Pe=t.useRef(Ie);Pe.current=Ie;var Te=t.useRef(Me);Te.current=Me;var Re=t.useRef(null),Oe=I(t.useState(null),2),_e=Oe[0],Ge=Oe[1],Fe=t.useRef(ue);Fe.current=ue;var De=t.useRef(Ae);De.current=Ae;var Ve=t.useMemo((function(){return{itemVisiblePercentThreshold:ye}}),[ye]),Le=t.useRef((function(e){var t=e.viewableItems;if(Fe.current&&De.current){var n=wi(t.map((function(e){return{index:e.index,item:e.item,isViewable:e.isViewable}})),Pe.current,Te.current);n!==Re.current&&(Re.current=n,Ge(n))}})).current;t.useEffect((function(){ue&&Ae||(Re.current=null,Ge(null))}),[ue,Ae]);var Ke=t.useCallback((function(e,t){u?u(e):K(e,t)}),[u,K]),Be=t.useCallback((function(e,t){switch(B(),e){case"reply":F(t);break;case"copy":Y?Y(t):jo(t);break;case"edit":ge(t);break;case"delete":null==Q||Q(t);break;case"forward":null==X||X(t);break;case"select":xe(t)}}),[B,F,Y,Q,X,ge,xe]),Ue=x?x():e.jsx(ho,{onSendMessage:C,onTypingStart:v,onTypingEnd:f,onAttachmentPress:h,onAudioRecordEnd:p,onAudioRecordStart:m,onCameraPress:g,CustomEmojiIcon:b,CustomAttachmentIcon:w,CustomCameraIcon:S,CustomMicrophoneIcon:k,CustomSendIcon:E,CustomFileIcon:j,CustomImagePreview:M,CustomVideoPreview:T}),He=D?z?z(D,B,null!=V?V:void 0):e.jsx(Ko,{message:D,anchor:V,visible:!0,onClose:B,flags:U,ui:Se,labels:ke,icons:Ee,fontFamily:null==be?void 0:be.fontFamily,onAction:Be}):null,Ne=te?te():ee?e.jsxs(n.View,{style:[r(zi||(zi=P(["items-center justify-center py-3"]))),ne],children:[e.jsx(n.ActivityIndicator,{size:ae,color:ie}),re?e.jsx(n.Text,{style:[r(Yi||(Yi=P(["mt-2 text-xs"]))),oe],children:re}):null]}):null,We=e.jsxs(n.View,{style:r(Qi||(Qi=P(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(n.FlatList,{style:r(Xi||(Xi=P(["flex-1"]))),data:Ie,keyExtractor:function(e){return e.id},renderItem:function(t){var n=t.item,r=t.index;return"dateSeparator"===n.type?e.jsx(mo,{label:n.label,variant:"inline",theme:null==be?void 0:be.dateSeparator,fontFamily:null==be?void 0:be.fontFamily,renderCustom:he}):e.jsx(bn,{message:n.message,isCurrentUser:n.message.senderId===s,onLongPress:function(e){return Ke(n.message,e)},isFirstInSequence:bi(Ie,r)})},ListHeaderComponent:e.jsx(ti,{typingUsers:d||[],currentUserId:s}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive",onEndReached:J,onEndReachedThreshold:$,onViewableItemsChanged:Le,viewabilityConfig:Ve,ListFooterComponent:Ne?e.jsx(e.Fragment,{children:Ne}):null}),ue&&Ae&&_e?e.jsx(n.View,{pointerEvents:"none",style:[r(Ji||(Ji=P(["absolute left-0 right-0 items-center z-10"]))),{top:null!==(o=null==be||null===(i=be.dateSeparator)||void 0===i?void 0:i.stickyTopOffset)&&void 0!==o?o:8}],children:e.jsx(mo,{label:_e,variant:"sticky",theme:null==be?void 0:be.dateSeparator,fontFamily:null==be?void 0:be.fontFamily,renderCustom:null!=pe?pe:he})}):null,e.jsx(n.View,{style:!G&&we>0?{marginBottom:we}:void 0,children:Ue}),e.jsx(Eo,{gallery:c,onClose:A}),He]});return G?e.jsx(n.View,{style:r(qi||(qi=P(["flex-1"]))),children:We}):"android"===n.Platform.OS?e.jsx(n.View,{style:r($i||($i=P(["flex-1"]))),children:We}):e.jsx(n.KeyboardAvoidingView,{style:r(Zi||(Zi=P(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:O,children:We})};exports.InlineReply=Pt,exports.LongPressOverlay=Ko,exports.MessageActionsPopover=function(o){var i,l,a,s,u,c,A,d=o.message,C=o.anchor,v=o.visible,f=o.onClose,h=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:Io},{id:"copy",label:"Copy",Icon:Mo},{id:"edit",label:"Edit",Icon:kn},{id:"select",label:"Select",Icon:Po},{id:"delete",label:"Delete",Icon:ar,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,h):[]}),[d,h]),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!==(u=null==p?void 0:p.iconColor)&&void 0!==u?u:S,E=null!==(c=null==p?void 0:p.destructiveColor)&&void 0!==c?c:"#EF4444",j=null!==(A=null==p?void 0:p.backdropColor)&&void 0!==A?A:"rgba(0,0,0,0.18)",M=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:f,statusBarTranslucent:!0,children:e.jsx(n.Pressable,{onPress:f,style:[r(Fo||(Fo=P(["flex-1"]))),{backgroundColor:j}],children:e.jsx(n.Pressable,{onPress:function(){},style:[r(Do||(Do=P(["absolute overflow-hidden"]))),{width:x,borderRadius:b,backgroundColor:w,top:M.top,left:M.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(Vo||(Vo=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(Lo||(Lo=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,u=t.backgroundColor,c=void 0===u?"#1f2937":u,A=t.textColor,d=void 0===A?"#FFFFFF":A,C=t.iconColor,v=void 0===C?"#FFFFFF":C,f=t.destructiveColor,h=void 0===f?"#ef4444":f,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:Mo},{id:"edit",label:"Edit",Icon:kn},{id:"forward",label:"Forward",Icon:Io},{id:"delete",label:"Delete",Icon:ar,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(Bo||(Bo=P(["flex-1 bg-black/50 justify-end"]))),children:[e.jsx(n.Pressable,{onPress:function(){},style:[r(Uo||(Uo=P(["mx-3 mb-6 rounded-2xl overflow-hidden"]))),{backgroundColor:c}],children:g.map((function(t,i){var l=t.destructive?h:d,a=t.destructive?h:v;return e.jsxs(n.Pressable,{onPress:function(){y(t.id,o)},style:[r(Ho||(Ho=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(No||(No=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(Wo||(Wo=P(["mx-3 mb-3 rounded-2xl py-4 items-center"]))),{backgroundColor:c}],children:e.jsx(n.Text,{style:J([r(zo||(zo=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,u=t.fontFamily,c=t.accentColor,A=void 0===c?"#22c55e":c,d=t.closeIconColor,C=void 0===d?"rgba(0,0,0,0.5)":d,v=t.backgroundColor,f=void 0===v?"#FFFFFF":v,h=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(Li||(Li=P(["flex-row items-stretch mx-2 mb-1 rounded-xl overflow-hidden"]))),{backgroundColor:f,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(Ki||(Ki=P(["w-[3px] self-stretch"]))),{backgroundColor:A},null==s?void 0:s.replyBar]}),e.jsxs(n.View,{style:r(Bi||(Bi=P(["flex-1 flex-row items-center pl-3 pr-2 py-2"]))),children:[e.jsxs(n.View,{style:r(Ui||(Ui=P(["flex-1 mr-2"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(Hi||(Hi=P(["text-[14px] font-semibold"]))),{color:null!=h?h:A},null==s?void 0:s.senderName],u),children:m}),e.jsx(n.Text,{numberOfLines:a,style:J([r(Ni||(Ni=P(["text-[13px] mt-0.5"]))),{color:null!=p?p:"rgba(0,0,0,0.55)"},null==s?void 0:s.previewText],u),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(Wi||(Wi=P(["w-7 h-7 items-center justify-center"]))),children:e.jsx(Sn,{color:C})})]})]})},exports.SelectIcon=Po,exports.SwipeableMessage=le,exports.VoiceRecorder=function(o){var i=o.primaryColor,a=void 0===i?"#16A34A":i,s=o.backgroundColor,u=void 0===s?"#0B141A":s,c=o.waveformColor,A=void 0===c?"#E9EDEF":c,d=o.timerColor,C=void 0===d?"#FFFFFF":d,v=o.sendButtonColor,f=o.deleteIconColor,h=void 0===f?"#8696A0":f,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,M=o.renderPlayIcon,T=o.renderWaveform,R=o.onSend,O=o.onDelete,_=o.onPause,G=o.onResume,F=I(t.useState(0),2),D=F[0],V=F[1],L=I(t.useState(!1),2),K=L[0],B=L[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(!K){var e=setInterval((function(){V((Date.now()-U.current-H.current)/1e3)}),250);return function(){return clearInterval(e)}}}),[K]);var W=l.useSharedValue(1),z=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),z.value=l.withRepeat(l.withSequence(l.withTiming(.3,{duration:600}),l.withTiming(1,{duration:600})),-1,!1)}),[]);var Y,Q,X=l.useAnimatedStyle((Y=[new global.Error,-3,-27],(Q=function(){return{opacity:K?1:W.value}}).__closure={isPaused:K,pauseOpacity:W},Q.__workletHash=0xf63a8f6d95,Q.__initData=Oi,Q.__stackDetails=Y,Q)),J=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{opacity:z.value}};return t.__closure={recBlink:z},t.__workletHash=6095431465582,t.__initData=_i,t.__stackDetails=e,t}()),q={backgroundColor:u,borderTopLeftRadius:g,borderTopRightRadius:g},$=null!=v?v:a;return e.jsxs(n.View,{style:[r(ni||(ni=P(["w-full px-4 py-2.5"]))),q],children:[e.jsxs(n.View,{style:r(ri||(ri=P(["flex-row items-center gap-3 px-1 pt-1.5 pb-2"]))),children:[e.jsx(l.View,{style:[r(oi||(oi=P(["w-1.5 h-1.5 rounded-full"]))),{backgroundColor:m},J]}),e.jsx(n.Text,{style:[r(ii||(ii=P(["text-base font-semibold"]))),{color:C,minWidth:42}],numberOfLines:1,children:ct(D)}),e.jsx(n.View,{style:r(li||(li=P(["flex-1"]))),children:T?T():e.jsx(Gi,{color:A,count:S})})]}),e.jsxs(n.View,{style:r(ai||(ai=P(["flex-row items-center justify-between mt-1"]))),children:[e.jsx(n.Pressable,{onPress:O,hitSlop:12,style:[r(si||(si=P(["items-center justify-center rounded-full"]))),{width:b,height:b}],accessibilityRole:"button",accessibilityLabel:"Delete recording",children:k?k():e.jsx(ar,{style:r.style("w-6 h-6"),color:h})}),e.jsx(n.Pressable,{onPress:function(){B((function(e){var t=!e;return t?(N.current=Date.now(),null==_||_()):(H.current+=Date.now()-N.current,N.current=0,null==G||G()),t}))},hitSlop:12,style:r(ui||(ui=P(["items-center justify-center px-4"]))),accessibilityRole:"button",accessibilityLabel:K?"Resume recording":"Pause recording",children:K?M?M():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:R,hitSlop:6,accessibilityRole:"button",accessibilityLabel:"Send recording",style:[r(ci||(ci=P(["items-center justify-center rounded-full"]))),{width:b,height:b,backgroundColor:$}],children:E?E():e.jsx(In,{style:r.style("w-6 h-6"),color:"#FFFFFF"})})]})]})},exports.VoiceRecorderFlow=Sr,exports.VoiceRecordingGesture=function(o){var a=o.primaryColor,s=void 0===a?"#16A34A":a,u=o.backgroundColor,c=void 0===u?"#1F2C33":u,A=o.timerColor,d=void 0===A?"#FFFFFF":A,C=o.microphoneColor,v=void 0===C?"#FFFFFF":C,f=o.lockColor,h=void 0===f?"#E9EDEF":f,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,M=o.onLock,T=null!=w?w:b,R=I(t.useState(0),2),O=R[0],_=R[1],G=t.useRef(Date.now());t.useEffect((function(){G.current=Date.now();var e=setInterval((function(){_((Date.now()-G.current)/1e3)}),250);return function(){return clearInterval(e)}}),[]);var F=l.useSharedValue(0),D=l.useSharedValue(0),V=l.useSharedValue(0),L=l.useSharedValue(1),K=l.useSharedValue(0),B=l.useSharedValue(0),U=l.useSharedValue(0);t.useEffect((function(){V.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),L.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),K.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(M);N.current=M;var W,z,Y=function(){var e;Vi(),null===(e=H.current)||void 0===e||e.call(H)},Q=function(){var e;Vi(),null===(e=N.current)||void 0===e||e.call(N)},X=i.Gesture.Pan().minDistance(0).onBegin((W=[new global.Error,-5,-27],z=function(){B.value=0,U.value=0,F.value=0,D.value=0},z.__closure={cancelFired:B,lockFired:U,dragX:F,dragY:D},z.__workletHash=9031413480896,z.__initData=el,z.__stackDetails=W,z)).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,D.value=n,0===U.value&&n<=-70&&(U.value=1,l.runOnJS(Q)()),0===B.value&&t<=-90&&(B.value=1,l.runOnJS(Y)())};return t.__closure={dragX:F,dragY:D,lockFired:U,LOCK_THRESHOLD:70,runOnJS:l.runOnJS,fireLock:Q,cancelFired:B,CANCEL_THRESHOLD:90,fireCancel:Y},t.__workletHash=0xac60b03bef6,t.__initData=tl,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}),D.value=l.withSpring(0,{damping:18,stiffness:220}))};return t.__closure={lockFired:U,cancelFired:B,dragX:F,withSpring:l.withSpring,dragY:D},t.__workletHash=0x962b8aa90f5,t.__initData=nl,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+V.value}],opacity:1-e}};return t.__closure={dragX:F,CANCEL_THRESHOLD:90,arrowPulse:V},t.__workletHash=2609121094002,t.__initData=rl,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,-D.value/70));return{transform:[{translateY:l.interpolate(e,[0,1],[0,-22])}]}};return t.__closure={dragY:D,LOCK_THRESHOLD:70,interpolate:l.interpolate},t.__workletHash=2770335161610,t.__initData=ol,t.__stackDetails=e,t}()),$=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{translateY:K.value}]}};return t.__closure={chevronPulse:K},t.__workletHash=0xe2617d14eaa,t.__initData=il,t.__stackDetails=e,t}()),Z=l.useAnimatedStyle(function(){var e=[new global.Error,-4,-27],t=function(){return{transform:[{translateX:F.value},{translateY:D.value},{scale:L.value}]}};return t.__closure={dragX:F,dragY:D,micPulse:L},t.__workletHash=0xa3ed9ad56cd,t.__initData=ll,t.__stackDetails=e,t}());return e.jsxs(n.View,{style:r(Si||(Si=P(["w-full flex-row items-end gap-2 relative"]))),pointerEvents:"box-none",children:[e.jsxs(n.View,{style:[r(ki||(ki=P(["flex-1 flex-row items-center px-4 rounded-3xl"]))),{minHeight:b,backgroundColor:c}],children:[e.jsx(n.Text,{style:[r(Ei||(Ei=P(["text-base font-semibold"]))),{color:d,minWidth:42}],numberOfLines:1,children:ct(O)}),e.jsxs(l.View,{style:[r(ji||(ji=P(["flex-1 flex-row items-center justify-center gap-1.5"]))),J],children:[E?E():e.jsx(n.Text,{style:[r(Mi||(Mi=P(["text-base leading-none"]))),{color:g,marginTop:-2}],children:"‹"}),e.jsx(n.Text,{style:[r(Ii||(Ii=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(Ti||(Ti=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(or,{style:{width:18,height:18},color:h}),e.jsx(l.View,{style:$,children:e.jsx(rr,{style:{width:14,height:14},color:h})})]}),e.jsx(i.GestureDetector,{gesture:X,children:e.jsx(l.View,{style:[r(Ri||(Ri=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(jn,{style:{width:26,height:26},color:v})})})]})]})},exports.buildChatListItems=xi,exports.default=function(t){return e.jsx(ut,{children:e.jsx(V,y(y({},t),{},{children:e.jsx(al,{})}))})},exports.diffCalendarDays=pi,exports.formatDateSeparatorLabel=yi,exports.getDayKey=hi,exports.getDefaultDateSeparatorLocale=vi,exports.parseMessageDate=mi,exports.truncateToLocalMidnight=fi,exports.tryCopyMessage=jo;
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 Re(){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 Oe(){if(we)return be;we=1;var e=Ie(),t=Me(),n=Pe(),r=Te(),o=Re(),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 _e(){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=Oe()(e.isElement,true)}else Ae.exports=_e()();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})}}])}(),De=["type"],Ke=["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,De);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,Ke);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=K(),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],R=M(t.useState(0),2),O=R[0],_=R[1],G=M(t.useState(0),2),F=G[0],V=G[1],D=M(t.useState(1),2),B=D[0],U=D[1],H=t.useRef(!1),N=t.useRef(0),W=t.useRef(null),Y=t.useRef(0),z=t.useRef(0),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]),X=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),q=X.inactive,$=X.active,Z=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),ee=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),te=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),ne=I&&!(c||!!S&&S!==A),re=F>0?O/F:0,oe=t.useCallback((function(e){V(e.duration)}),[]),ie=t.useCallback((function(e){var t=e.currentTime;H.current||Date.now()<z.current||_(t)}),[]),le=t.useCallback((function(){var e;T(!1),_(0),null===(e=E.current)||void 0===e||e.seek(0),k(null)}),[k]),ae=t.useCallback((function(){z.current=0}),[]),se=t.useCallback((function(){ne?(T(!1),k(null)):(k(A),T(!0))}),[ne,A,k]),Ae=t.useCallback((function(){U((function(e){var t=ut.indexOf(e),n=ut[(t+1)%ut.length];return null!=n?n:1}))}),[]),ce=t.useCallback((function(e){var t,n=N.current;if(!(n<=0||F<=0)){var r=Math.max(0,Math.min(e/n,1))*F;_(r),z.current=Date.now()+3e3,null===(t=E.current)||void 0===t||t.seek(r)}}),[F]),ue=t.useMemo((function(){return n.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onStartShouldSetPanResponderCapture:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponderCapture:function(){return!0},onPanResponderGrant:function(e,t){H.current=!0,ce(t.x0-Y.current)},onPanResponderMove:function(e,t){ce(t.moveX-Y.current)},onPanResponderRelease:function(){H.current=!1},onPanResponderTerminate:function(){H.current=!1}})}),[ce]),de=e.jsx(n.Pressable,{onPress:se,onLongPress:f,delayLongPress:250,hitSlop:8,style:r(et||(et=P(["shrink-0 px-0.5"]))),children:ne?x?e.jsx(x,{}):e.jsx(lt,{style:r.style("h-6 w-6"),color:te}):g?e.jsx(g,{}):e.jsx(at,{style:r.style("h-6 w-6"),color:ee})}),Ce=e.jsx(Ct,{isPlaying:ne,playbackRate:B,onCycleSpeed:Ae,senderAvatar:d,senderName:C,isCurrentUser:u,theme:m}),ve=e.jsx(n.View,{ref:W,style:[r(tt||(tt=P(["flex-1 min-w-0"]))),{height:36}],onLayout:function(){var e;null===(e=W.current)||void 0===e||e.measure((function(e,t,n,r,o){Y.current=o,N.current=n}))},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]},ue.panHandlers),{},{children:Q.map((function(t,r){var o,i=(r+.5)/50<=re;return e.jsx(n.View,{style:[{flex:1,marginHorizontal:.5,height:Math.max(3,Math.round(36*t)),borderRadius:2,backgroundColor:i?$:q},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:!ne,rate:B,playInBackground:!1,playWhenInactive:!1,onLoad:oe,onProgress:ie,onEnd:le,onSeek:ae,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:[Ce,de,ve]}):e.jsxs(e.Fragment,{children:[de,ve,Ce]})}),e.jsx(n.Text,{style:J([r(it||(it=P(["text-[11px] mt-1"]))),{color:Z,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(ne?O:F>0?F:O)})]})},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"})})})},Rt=320,Ot=Rt,_t=Math.round(176),Gt=Rt-_t-2,Ft=Math.round(159),Vt=function(o){var i,l=o.uri,s=o.cellStyle,A=o.roundedStyle,c=K(),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:Dt(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 Dt(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 Kt,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:Ot,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:Ot},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:Ot},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:Rt,marginVertical:8,gap:2},children:[e.jsx(n.Pressable,{onPress:function(){return i(o,0)},onLongPress:l,delayLongPress:250,style:{width:s,height:_t},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:_t},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:Rt,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=K(),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(Kt||(Kt=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=K(),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=K(),j=E.theme,I=E.showAvatars,M=E.showUserNames,T=E.showBubbleTail,R=E.setMediaViewerGallery,O=E.isVideoPlaying,_=E.replyProps,F=E.startReply,V=E.selectionMode,D=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==_?void 0:_.enableReply)||void 0===i||i)&&!V&&!k,W=null!==(l=null==_?void 0:_.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=D(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):R(e,t)}),[V,L,g,R]),te=null==U?void 0:U.rowBackgroundColor,ne=(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",re=te||function(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,")")}}if(e.startsWith("rgb("))return e.replace("rgb(","rgba(").replace(")",", ".concat(t,")"));return e}(ne,.12),oe=[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)],ie=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:O,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})]});if(k)return e.jsx(n.View,{style:oe,children:ie});var ae=e.jsx(n.Pressable,{ref:H,onLongPress:$,onPress:Z,delayLongPress:250,style:oe,children:ie}),se=null==_?void 0:_.swipe,Ae=e.jsx(le,{isCurrentUser:x,enabled:N,swipeThreshold:W,onReply:function(){return F(g)},iconColor:null==se?void 0:se.iconColor,iconBackground:null==se?void 0:se.iconBackground,iconSize:null==se?void 0:se.iconSize,children:ae});return e.jsxs(n.Pressable,{onPress:Z,onLongPress:$,delayLongPress:250,style:r(dn||(dn=P(["w-full"]))),children:[V&&q&&e.jsx(n.View,{pointerEvents:"none",style:[r(Cn||(Cn=P(["absolute inset-0"]))),{backgroundColor:re,zIndex:10}]}),Ae]})};var bn=t.memo(xn),wn=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"})]})})},Sn=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"})]})},kn=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"})]})})},En=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"})]})})},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",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"})]})})},In=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"})})},Mn=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 Pn(){return Tn.apply(this,arguments)}function Tn(){return(Tn=u(_().mark((function e(){var t;return _().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 Rn,On,_n,Gn,Fn,Vn,Dn,Kn,Ln,Bn,Un,Hn,Nn,Wn,Yn,zn,Qn,Xn,Jn,qn,$n,Zn,er="ios"===n.Platform.OS?50:48,tr="#FFFFFF",nr="#E9EDEF",rr=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"})})},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",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"})]})})},ir=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(Rn||(Rn=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(or,{style:{width:A,height:A},color:a}),e.jsx(l.View,{style:u,children:e.jsx(rr,{style:{width:14,height:14},color:s})})]})},lr=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,R=t.renderInputPill,O=t.renderMicIcon,_=t.renderSendIcon,G=t.renderArrowIcon,F=t.renderLockIcon,V=t.containerStyleOverride,D=t.timerTextStyle,K=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(On||(On=P(["flex-row items-end gap-2 relative"]))),V],pointerEvents:"box-none",children:[o?e.jsxs(n.View,{style:[r(_n||(_n=P(["flex-1 rounded-3xl overflow-hidden"]))),H],children:[T,e.jsxs(n.View,{style:r(Gn||(Gn=P(["flex-row items-center px-4 flex-1 min-h-[48px]"]))),children:[e.jsx(n.Text,{style:J([r(Fn||(Fn=P(["text-base font-semibold"]))),{color:h,minWidth:42},D],U),numberOfLines:1,children:ct(a)}),e.jsxs(l.View,{style:[r(Vn||(Vn=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(Kn||(Kn=P(["text-sm"]))),{color:f},K],U),children:"Slide to cancel"})]})]})]}):null==R?void 0:R(),e.jsxs(n.View,{style:[r(Ln||(Ln=P(["relative items-center justify-center"]))),{height:w,width:w}],children:[k&&o&&e.jsx(ir,{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(Bn||(Bn=P(["items-center justify-center rounded-full"]))),{height:S,width:S,backgroundColor:null!=I?I:C},B],accessibilityRole:"button",accessibilityLabel:"Send",children:_?_():e.jsx(Mn,{style:{width:x,height:x},color:null!=M?M:v})}):e.jsx(i.GestureDetector,{gesture:s,children:e.jsx(l.View,{style:[r(Un||(Un=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:O?O():e.jsx(jn,{style:{width:x+6,height:x+6},color:v})})})]})]})},ar=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"})]})})},sr=function(t){var o=t.color,i=t.tick,l=t.count;return e.jsx(n.View,{style:r(Hn||(Hn=P(["flex-row items-center justify-between h-6"]))),children:Array.from({length:l}).map((function(t,n){return e.jsx(cr,{index:n,total:l,color:o,tick:i},n)}))})},Ar={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"},cr=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=Ar,o.__stackDetails=n,o));return e.jsx(l.View,{style:[r(Nn||(Nn=P(["mx-px rounded-full"]))),{width:2,backgroundColor:s},c]})},ur=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,R=t.renderWaveform,O=t.containerStyleOverride,_=t.barStyleOverride,G=t.timerTextStyle,F=t.waveformStyle,V=t.trashButtonStyle,D=t.sendButtonStyle,K=t.fontFamily,L={minHeight:w+50,backgroundColor:h},B={height:x,width:x,backgroundColor:g};return e.jsxs(n.View,{style:[r(Wn||(Wn=P(["w-full rounded-2xl px-4 py-2.5"]))),L,O,_],children:[E,e.jsxs(n.View,{style:r(Yn||(Yn=P(["flex-row items-center gap-3 px-1 pt-1.5 pb-2"]))),children:[e.jsx(l.View,{style:[r(zn||(zn=P(["w-1.5 h-1.5 rounded-full"]))),{backgroundColor:y},u]}),e.jsx(n.Text,{style:J([r(Qn||(Qn=P(["text-base font-semibold"]))),{color:f,minWidth:42},G],K),numberOfLines:1,children:ct(o)}),k&&e.jsx(n.View,{style:[r(Xn||(Xn=P(["flex-1"]))),F],children:R?R():e.jsx(sr,{color:p,tick:d,count:S})})]}),e.jsxs(n.View,{style:r(Jn||(Jn=P(["flex-row items-center justify-between mt-1"]))),children:[e.jsx(n.Pressable,{onPress:C,hitSlop:12,style:[r(qn||(qn=P(["items-center justify-center rounded-full"]))),{width:x,height:x},V],accessibilityRole:"button",accessibilityLabel:"Delete recording",children:j?j():e.jsx(ar,{style:r.style("w-6 h-6"),color:m})}),e.jsx(n.Pressable,{onPress:v,hitSlop:12,style:r($n||($n=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(Zn||(Zn=P(["items-center justify-center rounded-full"]))),B,D,A],accessibilityRole:"button",accessibilityLabel:"Send recording",children:T?T():e.jsx(Mn,{style:{width:b,height:b},color:"#FFFFFF"})})})]})]})};function dr(){n.Vibration.vibrate(15)}var Cr={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"},vr={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"},hr={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"},fr={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"},pr={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"},mr={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"},yr={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"},gr={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"},xr={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"},br={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"},wr={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 Sr=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?tr:u,C=n.microphoneColor,v=void 0===C?tr:C,h=n.lockColor,f=void 0===h?nr:h,p=n.waveformColor,m=void 0===p?nr: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?er:I,T=n.micSize,R=n.holdMicScale,O=void 0===R?1.18:R,_=n.iconSize,G=void 0===_?22:_,F=n.lockIconSize,V=void 0===F?18:F,D=n.enableLockRecording,K=void 0===D||D,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],R=t.useRef("IDLE"),O=t.useRef(!1);t.useEffect((function(){R.current=w}),[w]),t.useEffect((function(){O.current=P}),[P]);var _=t.useRef(p);_.current=p,t.useEffect((function(){var e;null===(e=_.current)||void 0===e||e.call(_,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),D=l.useSharedValue(g),K=l.useSharedValue(x),L=l.useSharedValue(o?1:0),B=l.useSharedValue(a?1:0);t.useEffect((function(){F.value=m,V.value=y,D.value=g,K.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=R.current;if("IDLE"===e)return S("RECORDING_TAP"),void Ae();"RECORDING_TAP"!==e&&"LOCKED_RECORDING"!==e||ue()}),[Ae,ue]),Ce=t.useCallback((function(){"IDLE"===R.current&&(S("RECORDING_HOLD"),Ae())}),[Ae]),ve=t.useCallback((function(){var e;"RECORDING_HOLD"===R.current&&(dr(),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=R.current;"RECORDING_HOLD"!==r&&"RECORDING_TAP"!==r&&"LOCKED_RECORDING"!==r||(dr(),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"===R.current&&ue()}),[ue]),pe=t.useCallback((function(){var e,t,n=!O.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=Cr,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=vr,t.__stackDetails=e,t}()).onUpdate(function(){var e=[new global.Error,-16,-27],t=function(e){if(2===G.value){var t=Math.max(D.value,Math.min(0,e.translationX)),n=Math.max(K.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:D,maxUpShared:K,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=hr,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=fr,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=pr,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=mr,Se.__stackDetails=we,Se)),Re=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=yr,t.__stackDetails=e,t}()),Oe=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=gr,t.__stackDetails=e,t}()),_e=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=xr,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=br,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=wr,t.__stackDetails=e,t}());return{state:w,duration:E,isPaused:P,composedGesture:Pe,waveTick:q,micWrapperStyle:Te,slideTextAnimatedStyle:Re,lockPillAnimatedStyle:Oe,chevronAnimatedStyle:_e,pausePulseStyle:Ge,recDotStyle:Fe,triggerCancel:he,togglePause:pe}}({cancelSlideDistance:z,lockSlideDistance:W,enableLockRecording:K,enableSlideToCancel:B,holdMicScale:O,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(ur,{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(lr,{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:K,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})},kr=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"})]})},Er=function(t){var r=t.fileName,o=t.style,i=K().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)})},jr=t.memo(Er);function Ir(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 Mr,Pr,Tr,Rr,Or,_r,Gr,Fr,Vr,Dr,Kr,Lr,Br,Ur,Hr,Nr,Wr,Yr,zr,Qr,Xr,Jr,qr,$r,Zr,eo,to,no,ro,oo,io,lo,ao,so,Ao=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=K(),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=Ir(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=Ir(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(kr,{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(jr,{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)}))})]})})},co=t.memo(Ao),uo="ios"===n.Platform.OS?32:30,Co="ios"===n.Platform.OS?50:48,vo=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,R=o.onAttachmentPress,O=o.onCameraPress,G=o.onAudioRecordStart,F=o.onAudioRecordEnd,V=o.CustomEmojiIcon,D=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:uo,isMultiline:!1}),2),$=q[0],Z=q[1],ee=t.useRef(null),te=K(),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)",Re=null!==(A=Ee.thumbnailSize)&&void 0!==A?A:32,Oe=t.useRef(null);t.useEffect((function(){var e;we&&we.id!==Oe.current?(Oe.current=we.id,Q(null!==(e=we.text)&&void 0!==e?e:""),Z({height:uo,isMultiline:!1}),requestAnimationFrame((function(){var e;return null===(e=ee.current)||void 0===e?void 0:e.focus()}))):we||(Oe.current=null)}),[we]);var _e,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,De=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),Ke="number"==typeof(_e=Ve)&&_e>0?_e:24,Le=0===z.trim().length&&!$.isMultiline,Be=Math.max(0,(Co-Ke)/2),Ue=Le?{paddingTop:Be,paddingBottom:Be}:{paddingBottom:Be},He=!!we,Ne=t.useCallback((function(){Z({height:uo,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,uo),118),n=t>uo;Z({height:n?t:uo,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(_().mark((function e(){var t,n;return _().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,Pn();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(_().mark((function e(){return _().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(_().mark((function e(){return _().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(_().mark((function e(){var t,n,r,o,i;return _().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(_().mark((function e(){var t,n,r,o;return _().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(_().mark((function e(){var t;return _().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(Mr||(Mr=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(Pr||(Pr=P(["flex-1 mr-2"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(Tr||(Tr=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(Rr||(Rr=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:Re,height:Re,borderRadius:4,marginRight:6},null==je?void 0:je.thumbnail],resizeMode:"cover"}),e.jsx(n.Pressable,{onPress:he,hitSlop:10,style:[r(Or||(Or=P(["w-7 h-7 items-center justify-center"]))),null==je?void 0:je.closeButton],children:xe?e.jsx(xe,{}):e.jsx(Sn,{color:Pe})})]})}),[yt,ve,null==fe?void 0:fe.previewMaxLines,je,Ee,null==ne?void 0:ne.fontFamily,At,Ie,Te,Re,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(_r||(_r=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(Gr||(Gr=P(["flex-1 mr-2"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(Fr||(Fr=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(Vr||(Vr=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:Re-2,height:Re-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(Sn,{color:Pe})})]})}),[yt,ve,ct,null==ne?void 0:ne.fontFamily,Me,je,Ee,Re,Pe,xe,he]),St=t.useMemo((function(){return gt&&we?ge?ge(we,(function(){Se(),Q(""),Ne()})):e.jsxs(n.View,{style:[r(Kr||(Kr=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(Lr||(Lr=P(["mr-2.5"]))),children:be?e.jsx(be,{}):e.jsx(kn,{style:{width:16,height:16},color:At})}),e.jsxs(n.View,{style:r(Br||(Br=P(["flex-1 mr-2"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(Ur||(Ur=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(Hr||(Hr=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(Nr||(Nr=P(["w-7 h-7 items-center justify-center"]))),null==je?void 0:je.closeButton],children:xe?e.jsx(xe,{}):e.jsx(Sn,{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(Wr||(Wr=P(["flex-1 flex-col bg-white overflow-hidden"]))),{minHeight:Co,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(Yr||(Yr=P(["flex-row px-3.5"]))),{minHeight:Co,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(En,{style:De,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(zr||(zr=P(["bg-transparent flex-1 pl-2"]))),"ios"===n.Platform.OS?r(Qr||(Qr=P(["text-[17px]"]))):r(Xr||(Xr=P(["text-[16px]"]))),{minHeight:uo,maxHeight:118,paddingVertical:Le?0:8,marginVertical:Le?(Co-uo)/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(Jr||(Jr=P(["flex-row items-center gap-4"]))),Ue],children:[ie&&e.jsx(n.Pressable,{onPress:R,children:D?e.jsx(D,{}):e.jsx(In,{style:De,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:O,children:L?e.jsx(L,{}):e.jsx(wn,{style:De,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,R,O,V,D,L,De,ne,bt,St]),jt=t.useCallback((function(){var t;return e.jsx(n.Pressable,{onPress:Xe,style:[r(qr||(qr=P(["rounded-full justify-center items-center"]))),y({height:Co,width:Co,backgroundColor:At},null==ne||null===(t=ne.inputStyles)||void 0===t?void 0:t.sendButtonStyle)],children:B?e.jsx(B,{}):e.jsx(Mn,{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:Co,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($r||($r=P(["w-full px-2"]))),children:[Mt,Fe&&e.jsx(co,{previews:Ge,closePreview:ue,onRemoveItem:de,CustomFileIcon:H,CustomImagePreview:N,CustomVideoPreview:W,inputHeight:$.height}),e.jsx(n.View,{style:[r(Zr||(Zr=P(["w-full"]))),null==ne||null===(E=ne.inputStyles)||void 0===E?void 0:E.inputSectionContainerStyle],children:It?e.jsx(Sr,y({},Pt)):e.jsxs(n.View,{style:r(eo||(eo=P(["flex-row items-end gap-2"]))),children:[Et(),Je||!ae?jt():pt?e.jsx(n.View,{style:{height:Co,width:Co,justifyContent:"center",alignItems:"center"},children:U?e.jsx(U,{}):e.jsx(jn,{style:r.style("h-8 w-8"),color:ct})}):jt()]})}),pt]})},ho=t.memo(vo);function fo(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 po,mo,yo,go,xo=function(o){var i,l=o.gallery,a=o.onClose,s=K(),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(to||(to=P(["flex-1 bg-black"]))),{width:p,height:m}],children:[e.jsx(n.Pressable,{onPress:y,style:r(no||(no=P(["absolute right-4 top-12 z-20 p-2 rounded-full bg-slate-100/70"]))),children:e.jsx(fo,{style:r(ro||(ro=P(["h-8 w-8"])))})}),l.items.length>1&&e.jsx(n.View,{style:r(oo||(oo=P(["absolute top-14 left-0 right-0 z-10 items-center"]))),children:e.jsxs(n.Text,{style:J(r(io||(io=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(bo,{item:n,width:p,height:m,isActive:r===v,autoPlayVideo:r===d&&"video"===n.kind})}})]})}):null},bo=function(o){var i=o.item,l=o.width,s=o.height,A=o.isActive,c=o.autoPlayVideo,u=K().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(lo||(lo=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(ao||(ao=P(["absolute inset-0 items-center justify-center px-6"]))),children:e.jsx(n.Text,{style:J(r(so||(so=P(["text-white font-semibold"]))),null==u?void 0:u.fontFamily),children:"Failed to load video"})})]})},wo=t.memo(xo),So=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},ko=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"})]})})},Eo=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"})]})})},jo=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"})]})})},Io={reply:"Reply",copy:"Copy",edit:"Edit",delete:"Delete",forward:"Forward",select:"Select"},Mo={reply:ee,copy:ko,edit:kn,delete:ar,forward:Eo,select:jo};function Po(e,t){var n;return y(y({},null==e||null===(n=e.messageActions)||void 0===n?void 0:n.ui),t)}function To(e,t){var n;return y(y({},null==e||null===(n=e.messageActions)||void 0===n?void 0:n.labels),t)}function Ro(e,t){var n;return y(y(y({},Mo),null==e||null===(n=e.messageActions)||void 0===n?void 0:n.icons),t)}var Oo,_o,Go,Fo,Vo=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 Po(void 0,x)}),[x]),j=t.useMemo((function(){return To(void 0,b)}),[b]),I=t.useMemo((function(){return Ro(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({},Io),n),C=Ro(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:Eo},{id:"copy",label:d.copy,Icon:null!==(s=C.copy)&&void 0!==s?s:ko},{id:"edit",label:d.edit,Icon:null!==(A=C.edit)&&void 0!==A?A:kn},{id:"select",label:d.select,Icon:null!==(c=C.select)&&void 0!==c?c:jo},{id:"delete",label:d.delete,Icon:null!==(u=C.delete)&&void 0!==u?u:ar,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,R=null!==(l=E.borderRadius)&&void 0!==l?l:12,O=null!==(a=E.backgroundColor)&&void 0!==a?a:"#FFFFFF",_=null!==(s=E.textColor)&&void 0!==s?s:"#111827",G=null!==(A=E.iconColor)&&void 0!==A?A:_,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)",D=null!==(d=E.rowHeight)&&void 0!==d?d:36,K=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,D,M.length):null}),[f,T,D,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(po||(po=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(bn,{message:h,isCurrentUser:f.isCurrentUser,isFirstInSequence:f.isFirstInSequence,staticMode:!0})}),B&&e.jsx(n.Pressable,{onPress:function(){},style:[r(mo||(mo=P(["absolute overflow-hidden"]))),{width:T,borderRadius:R,backgroundColor:O,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:_,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(yo||(yo=P(["flex-row items-center px-3"]))),{height:D},E.rowStyle],children:[e.jsx(n.View,{style:{width:K,height:K,marginRight:10},children:e.jsx(t.Icon,{style:{width:K,height:K},color:i})}),e.jsx(n.Text,{style:J([r(go||(go=P(["text-[13px] font-medium"]))),{color:o},E.rowTextStyle],S),children:t.label})]},t.id)}))})]})})};var Do,Ko,Lo,Bo,Uo,Ho,No,Wo,Yo,zo,Qo,Xo,Jo,qo,$o,Zo,ei,ti,ni,ri,oi,ii,li,ai,si,Ai=function(t){var o,i,l,a,s,A=t.typingUsers,c=t.currentUserId,u=K(),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(No||(No=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(Wo||(Wo=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(Yo||(Yo=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(zo||(zo=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(Qo||(Qo=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(Xo||(Xo=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(Jo||(Jo=P(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(n.Text,{style:J([r(qo||(qo=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 ci,ui,di,Ci,vi,hi,fi,pi,mi,yi={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"},gi={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"},xi=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(ai||(ai=P(["flex-row items-center justify-between h-6"]))),children:Array.from({length:a}).map((function(t,n){return e.jsx(wi,{index:n,total:a,tick:s,color:i},n)}))})},bi={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"},wi=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=bi,o.__stackDetails=n,o));return e.jsx(l.View,{style:[r(si||(si=P(["mx-px rounded-full"]))),{width:2,backgroundColor:A},c]})};function Si(){n.Vibration.vibrate(15)}var ki,Ei,ji,Ii,Mi,Pi,Ti,Ri,Oi,_i,Gi,Fi,Vi,Di,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"},Li={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"},Bi={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"},Ui={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"},Hi={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"},Ni={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"},Wi={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"},Yi=function(){var o=K(),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,R=void 0!==T&&T,O=o.startReply,_=o.actionSheetMessage,G=o.actionAnchor,F=o.openActionSheet,V=o.closeActionSheet,D=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.onEndReached,Q=o.onEndReachedThreshold,X=void 0===Q?.5:Q,J=o.isLoadingMoreMessages,q=void 0!==J&&J,$=o.renderLoadingMoreIndicator,Z=o.loadingMoreIndicatorContainerStyle,ee=o.loadingMoreIndicatorText,te=o.loadingMoreIndicatorTextStyle,ne=o.loadingMoreIndicatorColor,re=o.loadingMoreIndicatorSize,oe=void 0===re?"small":re,ie=o.startEdit,le=o.enterSelectionMode,ae=o.theme,se=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}(!R),Ae=t.useMemo((function(){return Po(ae,L)}),[ae,L]),ce=t.useMemo((function(){return To(ae,B)}),[ae,B]),ue=t.useMemo((function(){return Ro(ae,U)}),[ae,U]),de=t.useCallback((function(e,t){a?a(e):F(e,t)}),[a,F]),Ce=t.useCallback((function(e,t){switch(V(),e){case"reply":O(t);break;case"copy":N?N(t):So(t);break;case"edit":ie(t);break;case"delete":null==W||W(t);break;case"forward":null==Y||Y(t);break;case"select":le(t)}}),[V,O,N,W,Y,ie,le]),ve=m?m():e.jsx(ho,{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}),he=_?H?H(_,V,null!=G?G:void 0):e.jsx(Vo,{message:_,anchor:G,visible:!0,onClose:V,flags:D,ui:Ae,labels:ce,icons:ue,fontFamily:null==ae?void 0:ae.fontFamily,onAction:Ce}):null,fe=$?$():q?e.jsxs(n.View,{style:[r(Ri||(Ri=P(["items-center justify-center py-3"]))),Z],children:[e.jsx(n.ActivityIndicator,{size:oe,color:ne}),ee?e.jsx(n.Text,{style:[r(Oi||(Oi=P(["mt-2 text-xs"]))),te],children:ee}):null]}):null,pe=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(Gi||(Gi=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(bn,{message:r,isCurrentUser:r.senderId===l,onLongPress:function(e){return de(r,e)},isFirstInSequence:o===i.length-1||(null===(n=i[o+1])||void 0===n?void 0:n.senderId)!==r.senderId})},ListHeaderComponent:e.jsx(Ai,{typingUsers:c||[],currentUserId:l}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive",onEndReached:z,onEndReachedThreshold:X,ListFooterComponent:fe?e.jsx(e.Fragment,{children:fe}):null}),e.jsx(n.View,{style:!R&&se>0?{marginBottom:se}:void 0,children:ve}),e.jsx(wo,{gallery:s,onClose:A}),he]});return R?e.jsx(n.View,{style:r(Fi||(Fi=P(["flex-1"]))),children:pe}):"android"===n.Platform.OS?e.jsx(n.View,{style:r(Vi||(Vi=P(["flex-1"]))),children:pe}):e.jsx(n.KeyboardAvoidingView,{style:r(Di||(Di=P(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:I,children:pe})};exports.InlineReply=Pt,exports.LongPressOverlay=Vo,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:Eo},{id:"copy",label:"Copy",Icon:ko},{id:"edit",label:"Edit",Icon:kn},{id:"select",label:"Select",Icon:jo},{id:"delete",label:"Delete",Icon:ar,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(Oo||(Oo=P(["flex-1"]))),{backgroundColor:j}],children:e.jsx(n.Pressable,{onPress:function(){},style:[r(_o||(_o=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(Go||(Go=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(Fo||(Fo=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:ko},{id:"edit",label:"Edit",Icon:kn},{id:"forward",label:"Forward",Icon:Eo},{id:"delete",label:"Delete",Icon:ar,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(Do||(Do=P(["flex-1 bg-black/50 justify-end"]))),children:[e.jsx(n.Pressable,{onPress:function(){},style:[r(Ko||(Ko=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(Lo||(Lo=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(Bo||(Bo=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(Uo||(Uo=P(["mx-3 mb-3 rounded-2xl py-4 items-center"]))),{backgroundColor:c}],children:e.jsx(n.Text,{style:J([r(Ho||(Ho=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(ki||(ki=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(Ei||(Ei=P(["w-[3px] self-stretch"]))),{backgroundColor:u},null==s?void 0:s.replyBar]}),e.jsxs(n.View,{style:r(ji||(ji=P(["flex-1 flex-row items-center pl-3 pr-2 py-2"]))),children:[e.jsxs(n.View,{style:r(Ii||(Ii=P(["flex-1 mr-2"]))),children:[e.jsx(n.Text,{numberOfLines:1,style:J([r(Mi||(Mi=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(Pi||(Pi=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(Ti||(Ti=P(["w-7 h-7 items-center justify-center"]))),children:e.jsx(Sn,{color:C})})]})]})},exports.SelectIcon=jo,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,R=o.onSend,O=o.onDelete,_=o.onPause,G=o.onResume,F=M(t.useState(0),2),V=F[0],D=F[1],K=M(t.useState(!1),2),L=K[0],B=K[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(){D((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=yi,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=gi,t.__stackDetails=e,t}()),q={backgroundColor:A,borderTopLeftRadius:g,borderTopRightRadius:g},$=null!=v?v:a;return e.jsxs(n.View,{style:[r($o||($o=P(["w-full px-4 py-2.5"]))),q],children:[e.jsxs(n.View,{style:r(Zo||(Zo=P(["flex-row items-center gap-3 px-1 pt-1.5 pb-2"]))),children:[e.jsx(l.View,{style:[r(ei||(ei=P(["w-1.5 h-1.5 rounded-full"]))),{backgroundColor:m},J]}),e.jsx(n.Text,{style:[r(ti||(ti=P(["text-base font-semibold"]))),{color:C,minWidth:42}],numberOfLines:1,children:ct(V)}),e.jsx(n.View,{style:r(ni||(ni=P(["flex-1"]))),children:T?T():e.jsx(xi,{color:u,count:S})})]}),e.jsxs(n.View,{style:r(ri||(ri=P(["flex-row items-center justify-between mt-1"]))),children:[e.jsx(n.Pressable,{onPress:O,hitSlop:12,style:[r(oi||(oi=P(["items-center justify-center rounded-full"]))),{width:b,height:b}],accessibilityRole:"button",accessibilityLabel:"Delete recording",children:k?k():e.jsx(ar,{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==_||_()):(H.current+=Date.now()-N.current,N.current=0,null==G||G()),t}))},hitSlop:12,style:r(ii||(ii=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:R,hitSlop:6,accessibilityRole:"button",accessibilityLabel:"Send recording",style:[r(li||(li=P(["items-center justify-center rounded-full"]))),{width:b,height:b,backgroundColor:$}],children:E?E():e.jsx(Mn,{style:r.style("w-6 h-6"),color:"#FFFFFF"})})]})]})},exports.VoiceRecorderFlow=Sr,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,R=M(t.useState(0),2),O=R[0],_=R[1],G=t.useRef(Date.now());t.useEffect((function(){G.current=Date.now();var e=setInterval((function(){_((Date.now()-G.current)/1e3)}),250);return function(){return clearInterval(e)}}),[]);var F=l.useSharedValue(0),V=l.useSharedValue(0),D=l.useSharedValue(0),K=l.useSharedValue(1),L=l.useSharedValue(0),B=l.useSharedValue(0),U=l.useSharedValue(0);t.useEffect((function(){D.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),K.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;Si(),null===(e=H.current)||void 0===e||e.call(H)},Q=function(){var e;Si(),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=Li,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=Bi,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+D.value}],opacity:1-e}};return t.__closure={dragX:F,CANCEL_THRESHOLD:90,arrowPulse:D},t.__workletHash=2609121094002,t.__initData=Ui,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=Hi,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=Ni,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:K.value}]}};return t.__closure={dragX:F,dragY:V,micPulse:K},t.__workletHash=0xa3ed9ad56cd,t.__initData=Wi,t.__stackDetails=e,t}());return e.jsxs(n.View,{style:r(ci||(ci=P(["w-full flex-row items-end gap-2 relative"]))),pointerEvents:"box-none",children:[e.jsxs(n.View,{style:[r(ui||(ui=P(["flex-1 flex-row items-center px-4 rounded-3xl"]))),{minHeight:b,backgroundColor:c}],children:[e.jsx(n.Text,{style:[r(di||(di=P(["text-base font-semibold"]))),{color:d,minWidth:42}],numberOfLines:1,children:ct(O)}),e.jsxs(l.View,{style:[r(Ci||(Ci=P(["flex-1 flex-row items-center justify-center gap-1.5"]))),J],children:[E?E():e.jsx(n.Text,{style:[r(vi||(vi=P(["text-base leading-none"]))),{color:g,marginTop:-2}],children:"‹"}),e.jsx(n.Text,{style:[r(hi||(hi=P(["text-sm"]))),{color:g}],children:"Slide to cancel"})]})]}),e.jsxs(n.View,{style:[r(fi||(fi=P(["relative items-center justify-center"]))),{height:b,width:b}],children:[e.jsxs(l.View,{style:[r(pi||(pi=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(or,{style:{width:18,height:18},color:f}),e.jsx(l.View,{style:$,children:e.jsx(rr,{style:{width:14,height:14},color:f})})]}),e.jsx(i.GestureDetector,{gesture:X,children:e.jsx(l.View,{style:[r(mi||(mi=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(jn,{style:{width:26,height:26},color:v})})})]})]})},exports.default=function(t){return e.jsx(At,{children:e.jsx(D,y(y({},t),{},{children:e.jsx(Yi,{})}))})},exports.tryCopyMessage=So;
17
17
  //# sourceMappingURL=index.js.map