element-web-synapse01pim.gr.jp

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

9867.js (3861B)


      1 "use strict";(self.webpackChunkelement_web=self.webpackChunkelement_web||[]).push([[9867],{"./src/components/views/location/Marker.tsx"(e,o,t){t.d(o,{A:()=>m});var n=t("../../node_modules/.pnpm/react@19.2.7/node_modules/react/index.js"),r=t("../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"),a=t.n(r),l=t("../../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"),s=t("./src/utils/FormattingUtils.ts"),i=t("./src/components/views/avatars/MemberAvatar.tsx");const c=({tooltip:e,children:o})=>{const[t,r]=(0,n.useState)(!1);if(!e)return n.createElement(n.Fragment,null,o);return n.createElement("div",{onMouseEnter:()=>r(!0),onClick:e=>{e.stopPropagation(),r(!t)},onMouseLeave:()=>r(!1)},o,t&&e)},m=({id:e,roomMember:o,useMemberColor:t,tooltip:r,ref:m})=>{const d=t&&o?(0,s.yJ)(o.userId):"";return n.createElement("div",{ref:m,id:e,className:a()("mx_Marker",d,{mx_Marker_defaultColor:!d})},n.createElement(c,{tooltip:r},n.createElement("div",{className:"mx_Marker_border"},o?n.createElement(i.A,{member:o,size:"36px",viewUserOnClick:!1,hideTitle:!!r}):n.createElement(l.A,{className:"mx_Marker_icon"}))))}},"./src/components/views/location/SmartMarker.tsx"(e,o,t){t.r(o),t.d(o,{default:()=>s});var n=t("../../node_modules/.pnpm/react@19.2.7/node_modules/react/index.js"),r=t("./src/utils/location/index.ts"),a=t("./src/utils/location/map.ts"),l=t("./src/components/views/location/Marker.tsx");const s=({id:e,map:o,geoUri:t,roomMember:s,useMemberColor:i,tooltip:c})=>{const{onElementRef:m}=((e,o)=>{const[t,l]=(0,n.useState)(),s=(0,n.useCallback)(n=>{if(t||!n)return;const s=(0,r.XB)(o);if(s){const o=(0,a.h)(s,n);o.addTo(e),l(o)}},[t,o,e]);return(0,n.useEffect)(()=>{if(t){const e=(0,r.XB)(o);e&&t.setLngLat({lon:e.longitude,lat:e.latitude})}},[t,o]),(0,n.useEffect)(()=>()=>{t&&t.remove()},[t]),{marker:t,onElementRef:s}})(o,t);return n.createElement("span",null,n.createElement(l.A,{ref:m,id:e,roomMember:s,useMemberColor:i,tooltip:c}))}},"./src/utils/location/map.ts"(e,o,t){t.d(o,{h:()=>c,p:()=>i});var n=t("../../node_modules/.pnpm/maplibre-gl@5.24.0/node_modules/maplibre-gl/dist/maplibre-gl.js"),r=t("../../node_modules/.pnpm/matrix-js-sdk@41.9.0/node_modules/matrix-js-sdk/src/logger.ts"),a=t("./src/languageHandler.tsx"),l=t("./src/utils/location/findMapStyleUrl.ts"),s=t("./src/utils/location/LocationShareErrors.ts");const i=(e,o,t,i)=>{try{const c=(0,l.M)(e),m=new n.Map({container:t,style:c,zoom:15,interactive:o,attributionControl:!1,locale:{"AttributionControl.ToggleAttribution":(0,a._t)("location_sharing|toggle_attribution"),"AttributionControl.MapFeedback":(0,a._t)("location_sharing|map_feedback"),"FullscreenControl.Enter":(0,a._t)("action|enter_fullscreen"),"FullscreenControl.Exit":(0,a._t)("action|exit_fullscreeen"),"GeolocateControl.FindMyLocation":(0,a._t)("location_sharing|find_my_location"),"GeolocateControl.LocationNotAvailable":(0,a._t)("location_sharing|location_not_available"),"LogoControl.Title":(0,a._t)("location_sharing|mapbox_logo"),"NavigationControl.ResetBearing":(0,a._t)("location_sharing|reset_bearing"),"NavigationControl.ZoomIn":(0,a._t)("action|zoom_in"),"NavigationControl.ZoomOut":(0,a._t)("action|zoom_out")}});return m.addControl(new n.AttributionControl,"top-right"),m.on("error",e=>{r.vF.error("Failed to load map: check map_style_url in config.json has a valid URL and API key",e.error),null==i||i(new Error(s.$.MapStyleUrlNotReachable))}),m}catch(e){r.vF.error("Failed to render map",e);if((null==e?void 0:e.message).includes("Failed to initialize WebGL"))throw new Error(s.$.WebGLNotEnabled);throw e}},c=(e,o)=>new n.Marker({element:o,anchor:"bottom",offset:[0,-1]}).setLngLat({lon:e.longitude,lat:e.latitude})}}]);
      2 //# sourceMappingURL=9867.js.map