element-web-synapse01pim.gr.jp

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

4896.js (27890B)


      1 "use strict";(self.webpackChunkelement_web=self.webpackChunkelement_web||[]).push([[4896],{"./src/components/views/location/LocationButton.tsx"(e,t,o){o.r(t),o.d(t,{default:()=>me});var n=o("../../node_modules/.pnpm/react@19.2.7/node_modules/react/index.js"),s=o("../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"),r=o.n(s),i=o("../../node_modules/.pnpm/react@19.2.7/node_modules/react/jsx-runtime.js");function a(e,t){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 24 24",ref:t,...e,children:(0,i.jsx)("path",{d:"M12 19.35q3.05-2.8 4.525-5.088Q18 11.976 18 10.2q0-2.725-1.738-4.462Q14.526 4 12 4T7.738 5.737Q6 7.476 6 10.2q0 1.775 1.475 4.063Q8.95 16.549 12 19.35m0 1.975a2.1 2.1 0 0 1-.7-.125 1.8 1.8 0 0 1-.625-.375A39 39 0 0 1 7.8 17.9q-1.25-1.425-2.087-2.762-.838-1.338-1.275-2.575Q4 11.325 4 10.2q0-3.75 2.412-5.975T12 2t5.587 2.225T20 10.2q0 1.125-.437 2.363-.438 1.237-1.275 2.574A22 22 0 0 1 16.2 17.9a39 39 0 0 1-2.875 2.925 1.8 1.8 0 0 1-.625.375 2.1 2.1 0 0 1-.7.125M12 12q.825 0 1.412-.588Q14 10.826 14 10t-.588-1.412A1.93 1.93 0 0 0 12 8q-.825 0-1.412.588A1.93 1.93 0 0 0 10 10q0 .825.588 1.412Q11.175 12 12 12"})})}a.displayName="LocationPinIcon";const l=(0,n.forwardRef)(a);var c=o("./src/languageHandler.tsx"),m=o("./src/components/views/rooms/CollapsibleButton.tsx"),d=o("./src/components/structures/ContextMenu.tsx"),u=o("./src/components/views/rooms/MessageComposerButtons.tsx"),p=o("../../node_modules/.pnpm/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/extends.js"),_=o("./src/contexts/MatrixClientContext.tsx"),h=o("../../node_modules/.pnpm/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/defineProperty.js"),v=o("../../node_modules/.pnpm/maplibre-gl@5.24.0/node_modules/maplibre-gl/dist/maplibre-gl.js"),g=o.n(v),x=o("../../node_modules/.pnpm/matrix-js-sdk@41.9.0/node_modules/matrix-js-sdk/src/logger.ts"),b=o("../../node_modules/.pnpm/matrix-js-sdk@41.9.0/node_modules/matrix-js-sdk/src/matrix.ts"),k=o("./src/Modal.tsx"),w=o("./src/utils/WellKnownUtils.ts"),E=o("./src/utils/beacon/index.ts"),y=o("./src/utils/location/index.ts"),C=o("./src/components/views/dialogs/ErrorDialog.tsx"),f=o("./src/components/views/elements/AccessibleButton.tsx"),A=o("./src/components/views/location/MapError.tsx"),M=o("./src/DateUtils.ts"),j=o("./src/components/views/elements/Dropdown.tsx");const S={fifteenMins:9e5,oneHour:36e5,eightHours:288e5},L=S.fifteenMins,N=e=>(0,c._t)("location_sharing|live_share_button",{duration:(0,M.a3)(e)}),T=({timeout:e,onChange:t})=>{const o=Object.values(S).map(e=>({key:e.toString(),duration:e,label:N(e)}));Object.values(S).includes(e)||o.push({key:e.toString(),duration:e,label:N(e)});return n.createElement(j.A,{id:"live-duration",label:N(e),value:e.toString(),onOptionChange:e=>{t(+e)},className:"mx_LiveDurationDropdown"},o.map(({key:e,label:t})=>n.createElement("div",{key:e},t)))};var B=o("./src/components/views/dialogs/QuestionDialog.tsx"),P=o("./src/SdkConfig.ts"),R=o("./src/stores/OwnBeaconStore.ts"),I=o("./src/utils/local-room.ts");let F=function(e){return e.Own="Own",e.Pin="Pin",e.Live="Live",e}({});const O=(e,t,o)=>{const{modalParams:n,errorMessage:s}="M_FORBIDDEN"===e.errcode?(e=>{const t=e===F.Live?"Insufficient permissions to start sharing your live location":"Insufficient permissions to send your location";return{modalParams:{title:(0,c._t)("location_sharing|error_no_perms_title"),description:(0,c._t)("location_sharing|error_no_perms_description"),button:(0,c._t)("action|ok"),hasCancelButton:!1,onFinished:()=>{}},errorMessage:t}})(o):((e,t)=>{const o=e===F.Live?"We couldn't start sharing your live location":"We couldn't send your location";return{modalParams:{title:(0,c._t)("location_sharing|error_send_title"),description:(0,c._t)("location_sharing|error_send_description",{brand:P.A.get().brand}),button:(0,c._t)("action|try_again"),cancelButton:(0,c._t)("action|cancel"),onFinished:e=>{e&&t()}},errorMessage:o}})(o,t);x.vF.error(s,e),k.Ay.createDialog(B.A,n)};var D=o("./src/components/views/location/Marker.tsx");const U=e=>e===F.Own||e===F.Live;class q extends n.Component{constructor(e){super(e),(0,h.A)(this,"map",void 0),(0,h.A)(this,"geolocate",void 0),(0,h.A)(this,"marker",void 0),(0,h.A)(this,"getMarkerId",()=>"mx_MLocationPicker_marker"),(0,h.A)(this,"addMarkerToMap",()=>{var e;this.marker=new(g().Marker)({element:null!==(e=document.getElementById(this.getMarkerId()))&&void 0!==e?e:void 0,anchor:"bottom",offset:[0,-1]}).setLngLat(new(g().LngLat)(0,0)).addTo(this.map)}),(0,h.A)(this,"updateStyleUrl",e=>{var t;const o=null===(t=(0,w.XP)(e))||void 0===t?void 0:t.map_style_url;var n;o&&(null===(n=this.map)||void 0===n||n.setStyle(o))}),(0,h.A)(this,"onGeolocate",e=>{var t;this.marker||this.addMarkerToMap(),this.setState({position:(0,E.v9)(e)}),null===(t=this.marker)||void 0===t||t.setLngLat(new(g().LngLat)(e.coords.longitude,e.coords.latitude))}),(0,h.A)(this,"onClick",e=>{var t;this.marker||this.addMarkerToMap(),null===(t=this.marker)||void 0===t||t.setLngLat(e.lngLat),this.setState({position:{timestamp:Date.now(),latitude:e.lngLat.lat,longitude:e.lngLat.lng}})}),(0,h.A)(this,"onGeolocateError",e=>{var t;(x.vF.error("Could not fetch location",e),U(this.props.shareType)&&(this.props.onFinished(),k.Ay.createDialog(C.A,{title:(0,c._t)("location_sharing|error_fetch_location"),description:(0,y.Ff)(e.code)})),this.geolocate)&&(null===(t=this.map)||void 0===t||t.removeControl(this.geolocate))}),(0,h.A)(this,"onTimeoutChange",e=>{this.setState({timeout:e})}),(0,h.A)(this,"onOk",()=>{const{timeout:e,position:t}=this.state;this.props.onChoose(t?{uri:(0,E.mt)(t),timestamp:t.timestamp,timeout:e}:{timeout:e}),this.props.onFinished()}),this.state={position:void 0,timeout:L,error:void 0}}componentDidMount(){this.context.on(b.ClientEvent.ClientWellKnown,this.updateStyleUrl);try{if(this.map=new(g().Map)({container:"mx_LocationPicker_map",style:(0,y.M0)(this.context),center:[0,0],zoom:1}),this.geolocate=new(g().GeolocateControl)({positionOptions:{enableHighAccuracy:!0},trackUserLocation:!1}),this.map.addControl(this.geolocate),this.map.on("error",e=>{x.vF.error("Failed to load map: check map_style_url in config.json has a valid URL and API key",e.error),this.setState({error:y.$X.MapStyleUrlNotReachable})}),this.map.on("load",()=>{var e;null===(e=this.geolocate)||void 0===e||e.trigger()}),this.geolocate.on("error",this.onGeolocateError),U(this.props.shareType)&&this.geolocate.on("geolocate",this.onGeolocate),this.props.shareType===F.Pin){const e=new(g().NavigationControl)({showCompass:!1,showZoom:!0});this.map.addControl(e,"bottom-right"),this.map.on("click",this.onClick)}}catch(e){x.vF.error("Failed to render map",e);const t=null==e?void 0:e.message;let o;o=t===y.$X.MapStyleUrlNotConfigured?y.$X.MapStyleUrlNotConfigured:t.includes("Failed to initialize WebGL")?y.$X.WebGLNotEnabled:y.$X.Default,this.setState({error:o})}}componentWillUnmount(){var e,t,o;null===(e=this.geolocate)||void 0===e||e.off("error",this.onGeolocateError),null===(t=this.geolocate)||void 0===t||t.off("geolocate",this.onGeolocate),null===(o=this.map)||void 0===o||o.off("click",this.onClick),this.context.off(b.ClientEvent.ClientWellKnown,this.updateStyleUrl)}render(){return this.state.error?n.createElement("div",{className:"mx_LocationPicker mx_LocationPicker_hasError"},n.createElement(A.p,{error:this.state.error,onFinished:this.props.onFinished})):n.createElement("div",{className:"mx_LocationPicker"},n.createElement("div",{id:"mx_LocationPicker_map"}),this.props.shareType===F.Pin&&n.createElement("div",{className:"mx_LocationPicker_pinText"},n.createElement("span",null,this.state.position?(0,c._t)("location_sharing|click_move_pin"):(0,c._t)("location_sharing|click_drop_pin"))),n.createElement("div",{className:"mx_LocationPicker_footer"},n.createElement("form",{onSubmit:this.onOk},this.props.shareType===F.Live&&n.createElement(T,{onChange:this.onTimeoutChange,timeout:this.state.timeout}),n.createElement(f.A,{type:"submit",element:"button",kind:"primary",className:"mx_LocationPicker_submitButton",disabled:!this.state.position,onClick:this.onOk},(0,c._t)("location_sharing|share_button")))),n.createElement("div",{id:this.getMarkerId()},!!this.marker&&n.createElement(D.A,{roomMember:U(this.props.shareType)?this.props.sender:void 0,useMemberColor:this.props.shareType===F.Live})))}}(0,h.A)(q,"contextType",_.Ay);const H=q;var z=o("./src/settings/SettingsStore.ts"),V=o("../../node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/close.js"),$=o("../../node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/chevron-left.js");const G=({onBack:e,onCancel:t,displayBack:o})=>n.createElement("div",{className:"mx_ShareDialogButtons"},o&&n.createElement(f.A,{className:"mx_ShareDialogButtons_button left","aria-label":(0,c._t)("action|back"),onClick:e,element:"button"},n.createElement($.A,{className:"mx_ShareDialogButtons_button-icon"})),n.createElement(f.A,{className:"mx_ShareDialogButtons_button right","aria-label":(0,c._t)("action|close"),onClick:t,element:"button"},n.createElement(V.A,{className:"mx_ShareDialogButtons_button-icon"})));var W=o("../../node_modules/.pnpm/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),J=o("../../node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/location-pin-solid.js"),Q=o("./src/stores/OwnProfileStore.ts"),X=o("./src/components/views/avatars/BaseAvatar.tsx"),Z=o("./src/components/views/typography/Heading.tsx"),Y=o("./src/components/views/beacon/StyledLiveBeaconIcon.tsx");const K=["onClick","label","shareType"],ee=()=>{var e,t;const o=(0,n.useContext)(_.Ay).getSafeUserId(),s=null!==(e=Q.V.instance.displayName)&&void 0!==e?e:void 0,r="36px",i=null!==(t=Q.V.instance.getHttpAvatarUrl(parseInt(r,10)))&&void 0!==t?t:void 0;return n.createElement("div",{className:`mx_ShareType_option-icon ${F.Own}`},n.createElement(X.A,{idName:o,name:s,url:i,size:r}))},te=e=>{let{onClick:t,label:o,shareType:s}=e,r=(0,W.A)(e,K);return n.createElement(f.A,(0,p.A)({element:"button",className:"mx_ShareType_option",onClick:null!=t?t:null},r),s===F.Own&&n.createElement(ee,null),s===F.Pin&&n.createElement(J.A,{className:`mx_ShareType_option-icon ${F.Pin}`}),s===F.Live&&n.createElement(Y.A,{className:`mx_ShareType_option-icon ${F.Live}`}),o)},oe=({setShareType:e,enabledShareTypes:t})=>{const o={[F.Own]:(0,c._t)("location_sharing|share_type_own"),[F.Live]:(0,c._t)("location_sharing|share_type_live"),[F.Pin]:(0,c._t)("location_sharing|share_type_pin")};return n.createElement("div",{className:"mx_ShareType"},n.createElement(J.A,{className:"mx_ShareType_badge"}),n.createElement(Z.A,{className:"mx_ShareType_heading",size:"3"},(0,c._t)("location_sharing|share_type_prompt")),n.createElement("div",{className:"mx_ShareType_wrapper_options"},t.map(t=>n.createElement(te,{key:t,onClick:()=>e(t),label:o[t],shareType:t}))))};var ne=o("../../node_modules/.pnpm/@vector-im+compound-web@9.7.1_@fontsource+inconsolata@5.2.8_@fontsource+inter@5.2.8_@ty_d0b9248e7924d8975cc2a582ba698967/node_modules/@vector-im/compound-web/dist/components/Form/index.js"),se=o("../../node_modules/.pnpm/@vector-im+compound-web@9.7.1_@fontsource+inconsolata@5.2.8_@fontsource+inter@5.2.8_@ty_d0b9248e7924d8975cc2a582ba698967/node_modules/@vector-im/compound-web/dist/components/Form/Controls/SettingsToggle/SettingsToggle.js"),re=o("../../node_modules/.pnpm/@vector-im+compound-web@9.7.1_@fontsource+inconsolata@5.2.8_@fontsource+inter@5.2.8_@ty_d0b9248e7924d8975cc2a582ba698967/node_modules/@vector-im/compound-web/dist/components/Button/Button.js");const ie=({onSubmit:e})=>{const[t,o]=(0,n.useState)(!1),s=(0,n.useCallback)(e=>o(e.target.checked),[o]),r=(0,n.useCallback)(o=>{o.preventDefault(),o.stopPropagation(),t&&e()},[t,e]);return n.createElement("div",{className:"mx_EnableLiveShare"},n.createElement(Y.A,{className:"mx_EnableLiveShare_icon"}),n.createElement(Z.A,{className:"mx_EnableLiveShare_heading",size:"3"},(0,c._t)("location_sharing|live_enable_heading")),n.createElement("p",{className:"mx_EnableLiveShare_description"},(0,c._t)("location_sharing|live_enable_description")),n.createElement(ne.lV.Root,{onSubmit:r},n.createElement(se.I,{name:"enable-live-share-toggle",checked:t,onChange:s,label:(0,c._t)("location_sharing|live_toggle_label")}),n.createElement(re.$,{className:"mx_EnableLiveShare_button",kind:"primary",disabled:!t},(0,c._t)("action|ok"))))};var ae=o("./src/hooks/useSettings.ts"),le=o("./src/settings/SettingLevel.ts");const ce=({menuPosition:e,onFinished:t,sender:o,roomId:s,openMenu:r,relation:i})=>{const a=(0,n.useContext)(_.Ay),l=(e=>{const t=[F.Own];return e||t.push(F.Live),t.push(F.Pin),t})(i),m=(0,ae.ny)("feature_location_share_live"),u=l.length>1,[h,v]=(0,n.useState)(u?void 0:F.Own),g=Q.V.instance.displayName,x=a.getSafeUserId(),k=h===F.Live?((e,t,o,n)=>async({timeout:e})=>{const s=(0,c._t)("location_sharing|live_description",{displayName:o});try{await R.g.instance.createLiveBeacon(t,b.ContentHelpers.makeBeaconInfoContent(null!=e?e:3e5,!0,s,b.LocationAssetType.Self))}catch(e){O(e,n,F.Live)}})(0,s,g||x,r):((e,t,o,n,s)=>async({uri:r,timestamp:i})=>{if(r)try{const s=(null==n?void 0:n.rel_type)===b.THREAD_RELATION_TYPE.name&&(null==n?void 0:n.event_id)||null,a=o===F.Pin?b.LocationAssetType.Pin:b.LocationAssetType.Self,l=b.ContentHelpers.makeLocationContent(void 0,r,i,void 0,a);await(0,I.Y)(t,t=>e.sendMessage(t,s,l),e)}catch(e){O(e,s,o)}})(a,s,null!=h?h:F.Own,i,r),w=h===F.Live&&!m;return n.createElement(d.Ay,(0,p.A)({},e,{onFinished:t,managed:!1}),n.createElement("div",{className:"mx_LocationShareMenu"},w&&n.createElement(ie,{onSubmit:()=>{z.A.setValue("feature_location_share_live",null,le.p.DEVICE,!0)}}),!w&&!!h&&n.createElement(H,{sender:o,shareType:h,onChoose:k,onFinished:t}),!h&&n.createElement(oe,{setShareType:v,enabledShareTypes:l}),n.createElement(G,{displayBack:!!h&&u,onBack:()=>v(void 0),onCancel:t})))},me=({roomId:e,sender:t,menuPosition:o,relation:s})=>{const i=(0,n.useContext)(u.Z),[a,p,_,h]=(0,d.EF)(),v=e=>{h(e),null==i||i()};let g=null;if(a){var x;const r=null!==(x=null!=o?o:p.current&&(0,d.qv)(p.current.getBoundingClientRect()))&&void 0!==x?x:{};g=n.createElement(ce,{menuPosition:r,onFinished:v,sender:t,roomId:e,openMenu:_,relation:s})}const b=r()("mx_MessageComposer_button",{mx_MessageComposer_button_highlight:a});return n.createElement(n.Fragment,null,n.createElement(m.J,{className:b,onClick:_,title:(0,c._t)("common|location"),inputRef:p},n.createElement(l,null)),g)}},"./src/components/views/location/Marker.tsx"(e,t,o){o.d(t,{A:()=>m});var n=o("../../node_modules/.pnpm/react@19.2.7/node_modules/react/index.js"),s=o("../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"),r=o.n(s),i=o("../../node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/location-pin-solid.js"),a=o("./src/utils/FormattingUtils.ts"),l=o("./src/components/views/avatars/MemberAvatar.tsx");const c=({tooltip:e,children:t})=>{const[o,s]=(0,n.useState)(!1);if(!e)return n.createElement(n.Fragment,null,t);return n.createElement("div",{onMouseEnter:()=>s(!0),onClick:e=>{e.stopPropagation(),s(!o)},onMouseLeave:()=>s(!1)},t,o&&e)},m=({id:e,roomMember:t,useMemberColor:o,tooltip:s,ref:m})=>{const d=o&&t?(0,a.yJ)(t.userId):"";return n.createElement("div",{ref:m,id:e,className:r()("mx_Marker",d,{mx_Marker_defaultColor:!d})},n.createElement(c,{tooltip:s},n.createElement("div",{className:"mx_Marker_border"},t?n.createElement(l.A,{member:t,size:"36px",viewUserOnClick:!1,hideTitle:!!s}):n.createElement(i.A,{className:"mx_Marker_icon"}))))}},"./src/components/views/rooms/CollapsibleButton.tsx"(e,t,o){o.d(t,{J:()=>m});var n=o("../../node_modules/.pnpm/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/extends.js"),s=o("../../node_modules/.pnpm/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),r=o("../../node_modules/.pnpm/react@19.2.7/node_modules/react/index.js"),i=o("./src/components/views/elements/AccessibleButton.tsx"),a=o("./src/components/views/rooms/MessageComposerButtons.tsx"),l=o("./src/components/views/context_menus/IconizedContextMenu.tsx");const c=["title","children","className","inputRef"],m=e=>{let{title:t,children:o,className:m,inputRef:d}=e,u=(0,s.A)(e,c);return!!(0,r.useContext)(a.Z)?r.createElement(l.R$,(0,n.A)({},u,{icon:o,label:t,inputRef:d})):r.createElement(i.A,(0,n.A)({},u,{title:t,className:m,ref:d}),o)}},"./src/components/views/rooms/EmojiButton.tsx"(e,t,o){o.d(t,{h:()=>p});var n=o("../../node_modules/.pnpm/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/extends.js"),s=o("../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"),r=o.n(s),i=o("../../node_modules/.pnpm/react@19.2.7/node_modules/react/index.js"),a=o("../../node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/reaction.js"),l=o("./src/languageHandler.tsx"),c=o("./src/components/structures/ContextMenu.tsx"),m=o("./src/components/views/emojipicker/EmojiPicker.tsx"),d=o("./src/components/views/rooms/CollapsibleButton.tsx"),u=o("./src/components/views/rooms/MessageComposerButtons.tsx");function p({addEmoji:e,menuPosition:t,className:o}){const s=(0,i.useContext)(u.Z),[p,_,h,v]=(0,c.EF)();let g=null;if(p&&_.current){const o=null!=t?t:(0,c.qv)(_.current.getBoundingClientRect()),r=()=>{v(),null==s||s()};g=i.createElement(c.Ay,(0,n.A)({},o,{onFinished:r,managed:!1,focusLock:!0}),i.createElement(m.Ay,{onChoose:e,onFinished:r}))}const x=r()("mx_EmojiButton",o,{mx_EmojiButton_highlight:p});return i.createElement(i.Fragment,null,i.createElement(d.J,{className:x,onClick:h,title:(0,l._t)("common|emoji"),inputRef:_},i.createElement(a.A,null)),g)}},"./src/components/views/rooms/MessageComposerButtons.tsx"(e,t,o){o.d(t,{A:()=>O,Z:()=>L});var n=o("../../node_modules/.pnpm/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/defineProperty.js"),s=o("../../node_modules/.pnpm/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/extends.js"),r=o("../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"),i=o.n(r),a=o("../../node_modules/.pnpm/matrix-js-sdk@41.9.0/node_modules/matrix-js-sdk/src/matrix.ts"),l=o("../../node_modules/.pnpm/react@19.2.7/node_modules/react/index.js"),c=o("../../node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/mic-on.js"),m=o("../../node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/overflow-horizontal.js"),d=o("../../node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/polls.js"),u=o("../../node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/sticker.js"),p=o("../../node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/text-formatting.js"),_=o("../../packages/shared-components/dist/element-web-shared-components.js"),h=o("./src/languageHandler.tsx"),v=o("./src/components/views/rooms/CollapsibleButton.tsx"),g=o("./src/components/views/dialogs/ErrorDialog.tsx"),x=o("./src/components/views/location/index.tsx"),b=o("./src/Modal.tsx"),k=o("./src/components/views/elements/PollCreateDialog.tsx"),w=o("./src/MatrixClientPeg.ts"),E=o("./src/contexts/MatrixClientContext.tsx"),y=o("./src/components/views/context_menus/IconizedContextMenu.tsx"),C=o("./src/components/views/rooms/EmojiButton.tsx"),f=o("./src/utils/arrays.ts"),A=o("./src/hooks/useSettings.ts"),M=o("./src/components/views/elements/AccessibleButton.tsx"),j=o("./src/contexts/ScopedRoomContext.tsx"),S=o("./src/viewmodels/room/RoomUploadViewModel.tsx");const L=(0,l.createContext)(null);function N(e){return l.createElement(C.h,{key:"emoji_button",addEmoji:e.addEmoji,menuPosition:e.menuPosition,className:"mx_MessageComposer_button"})}function T(e){return e.showStickersButton?l.createElement(v.J,{id:"stickersButton",key:"controls_stickers",className:"mx_MessageComposer_button",onClick:()=>e.setStickerPickerOpen(!e.isStickerPickerOpen),title:e.isStickerPickerOpen?(0,h._t)("composer|close_sticker_picker"):(0,h._t)("common|sticker")},l.createElement(u.A,null)):null}function B(e,t){return t?null:l.createElement(v.J,{key:"voice_message_send",className:"mx_MessageComposer_button",onClick:e.onRecordStartEndClick,title:(0,h._t)("composer|voice_message_button")},l.createElement(c.A,null))}function P(e,t){return l.createElement(R,{key:"polls",room:e,relation:t})}class R extends l.PureComponent{constructor(...e){super(...e),(0,n.A)(this,"onCreateClick",()=>{var e;null===(e=this.context)||void 0===e||e.call(this);if(this.props.room.currentState.maySendEvent(a.M_POLL_START.name,w.J.safeGet().getSafeUserId())){var t;const e=(null===(t=this.props.relation)||void 0===t?void 0:t.rel_type)===a.THREAD_RELATION_TYPE.name?this.props.relation.event_id:void 0;b.Ay.createDialog(k.A,{room:this.props.room,threadId:e},"mx_CompoundDialog",!1,!0)}else b.Ay.createDialog(g.A,{title:(0,h._t)("composer|poll_button_no_perms_title"),description:(0,h._t)("composer|poll_button_no_perms_description")})})}render(){var e;return(null===(e=this.props.relation)||void 0===e?void 0:e.rel_type)===a.THREAD_RELATION_TYPE.name?null:l.createElement(v.J,{className:"mx_MessageComposer_button",onClick:this.onCreateClick,title:(0,h._t)("composer|poll_button")},l.createElement(d.A,null))}}function I(e,t,o){const n=t.getMember(o.getSafeUserId());return e.showLocationButton&&n?l.createElement(x.Uo,{key:"location",roomId:t.roomId,relation:e.relation,sender:n,menuPosition:e.menuPosition}):null}function F({isRichTextEnabled:e,onClick:t}){const o=e?(0,h._t)("composer|mode_plain"):(0,h._t)("composer|mode_rich_text");return l.createElement(v.J,{className:"mx_MessageComposer_button",onClick:t,title:o},l.createElement(p.A,null))}(0,n.A)(R,"contextType",L);const O=e=>{const t=(0,l.useContext)(E.Ay),o=(0,S.ug)(),n=(0,_.ifm)(o),{room:r,narrow:a}=(0,j.ME)("room","narrow"),c=(0,A.ti)("feature_wysiwyg_composer");if(!t||!r||e.haveRecording)return null;let d,u;a?(d=[c?l.createElement(F,{key:"composerModeButton",isRichTextEnabled:e.isRichTextEnabled,onClick:e.onComposerModeClick}):N(e)],u=[n.options.map(({type:e,icon:t,label:n})=>l.createElement(y.R$,{onClick:()=>o.onUploadOptionSelected(e),icon:t&&l.createElement(t,null),label:n,key:e})),T(e),B(e,a),e.showPollsButton?P(r,e.relation):null,I(e,r,t)]):(d=[c?l.createElement(F,{key:"composerModeButton",isRichTextEnabled:e.isRichTextEnabled,onClick:e.onComposerModeClick}):N(e),l.createElement(_.s5p,{key:"upload",vm:o})],u=[T(e),B(e,a),e.showPollsButton?P(r,e.relation):null,I(e,r,t)]),d=(0,f.Bo)(d),u=(0,f.Bo)(u);const p=i()({mx_MessageComposer_button:!0,mx_MessageComposer_buttonMenu:!0,mx_MessageComposer_closeButtonMenu:e.isMenuOpen});return l.createElement(l.Fragment,null,d,u.length>0&&l.createElement(M.A,{className:p,onClick:e.toggleButtonMenu,title:(0,h._t)("quick_settings|sidebar_settings")},l.createElement(m.A,null)),e.isMenuOpen&&l.createElement(y.Ay,(0,s.A)({onFinished:e.toggleButtonMenu},e.menuPosition,{wrapperClassName:"mx_MessageComposer_Menu",compact:!0}),l.createElement(L.Provider,{value:e.toggleButtonMenu},l.createElement(y.tx,null,u))))}},"../../node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/mic-on.js"(e,t,o){o.d(t,{A:()=>i});var n=o("../../node_modules/.pnpm/react@19.2.7/node_modules/react/index.js"),s=o("../../node_modules/.pnpm/react@19.2.7/node_modules/react/jsx-runtime.js");function r(e,t){return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 24 24",ref:t,...e,children:[(0,s.jsx)("path",{d:"M6 12a1 1 0 1 0-2 0 8 8 0 0 0 7 7.938V21a1 1 0 1 0 2 0v-1.062A8 8 0 0 0 20 12a1 1 0 1 0-2 0 6 6 0 0 1-12 0"}),(0,s.jsx)("path",{fillRule:"evenodd",d:"M14 12V6a2 2 0 1 0-4 0v6a2 2 0 1 0 4 0M12 2a4 4 0 0 0-4 4v6a4 4 0 0 0 8 0V6a4 4 0 0 0-4-4",clipRule:"evenodd"})]})}r.displayName="MicOnIcon";const i=(0,n.forwardRef)(r)},"../../node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/reaction.js"(e,t,o){o.d(t,{A:()=>i});var n=o("../../node_modules/.pnpm/react@19.2.7/node_modules/react/index.js"),s=o("../../node_modules/.pnpm/react@19.2.7/node_modules/react/jsx-runtime.js");function r(e,t){return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 24 24",ref:t,...e,children:[(0,s.jsx)("path",{d:"M15.536 15.536a1 1 0 0 0-1.415-1.415 3 3 0 0 1-2.12.879 3 3 0 0 1-2.122-.879 1 1 0 1 0-1.414 1.415A5 5 0 0 0 12 17c1.38 0 2.632-.56 3.536-1.464M10 10.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m5.5 1.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3"}),(0,s.jsx)("path",{d:"M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10m-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0"})]})}r.displayName="ReactionIcon";const i=(0,n.forwardRef)(r)},"../../node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/sticker.js"(e,t,o){o.d(t,{A:()=>i});var n=o("../../node_modules/.pnpm/react@19.2.7/node_modules/react/index.js"),s=o("../../node_modules/.pnpm/react@19.2.7/node_modules/react/jsx-runtime.js");function r(e,t){return(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 24 24",ref:t,...e,children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M17 2a5 5 0 0 1 5 4.999v5.335a5 5 0 0 1-1.58 3.647l-4.978 4.667A5 5 0 0 1 12.023 22H7l-.258-.007A5 5 0 0 1 2 17V7a5 5 0 0 1 5-5zM7 4a3 3 0 0 0-3 3v10a3 3 0 0 0 2.999 3H12v-4a4 4 0 0 1 4-4h4V6.999A3 3 0 0 0 17 4zm9 10a2 2 0 0 0-2 2v3.251l.074-.062 4.978-4.666q.252-.238.441-.523z",clipRule:"evenodd"})})}r.displayName="StickerIcon";const i=(0,n.forwardRef)(r)},"../../node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/text-formatting.js"(e,t,o){o.d(t,{A:()=>i});var n=o("../../node_modules/.pnpm/react@19.2.7/node_modules/react/index.js"),s=o("../../node_modules/.pnpm/react@19.2.7/node_modules/react/jsx-runtime.js");function r(e,t){return(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 24 24",ref:t,...e,children:(0,s.jsx)("path",{d:"M6 19a.97.97 0 0 1-.713-.288A.97.97 0 0 1 5 18q0-.424.287-.712A.97.97 0 0 1 6 17h12q.424 0 .712.288.288.287.288.712 0 .424-.288.712A.97.97 0 0 1 18 19zm1.35-5.2 3.425-9.2a.9.9 0 0 1 .338-.437A.93.93 0 0 1 11.65 4h.7q.3 0 .537.162.238.163.338.438l3.425 9.225q.15.425-.1.8a.8.8 0 0 1-.7.375.9.9 0 0 1-.512-.162A.9.9 0 0 1 15 14.4l-.75-2.2H9.8L9 14.425a.84.84 0 0 1-.325.425q-.225.15-.5.15a.84.84 0 0 1-.738-.387.82.82 0 0 1-.087-.813m3-3.2h3.3l-1.6-4.55h-.1z"})})}r.displayName="TextFormattingIcon";const i=(0,n.forwardRef)(r)}}]);
      2 //# sourceMappingURL=4896.js.map