1import{o as e}from"./chunk-CMxvf4Kt.js";import{n as t,t as n}from"./jsx-runtime-SsSjplwM.js";import{a as r,c as i,s as a}from"./react-intl-Cop388b4.js";import{b as o}from"./prop-types-BTvjt2rf.js";import{Q as s,rt as c}from"./poll-quu7nqu0.js";import{Hr as l,jr as u}from"./render-CHiIZYnD.js";import{c as d}from"./react-router-BzQH59UT.js";import{o as f}from"./typed_functions-CyAHd4bl.js";import{a as p,cn as m,mn as h}from"./status_quoted-CwxV3dOE.js";import{n as g,r as _,t as v}from"./modal_shell-C8vtrk6G.js";import{s as y}from"./form_fields-D59m7r6R.js";var b=e(t()),x={heading:`_collections_components_share_modal__heading`,preview:`_collections_components_share_modal__preview`,actions:`_collections_components_share_modal__actions`,shareButtonWrapper:`_collections_components_share_modal__shareButtonWrapper`,closeButtonDesktop:`_collections_components_share_modal__closeButtonDesktop`,closeButtonMobile:`_collections_components_share_modal__closeButtonMobile`},S=n(),C=a({shareTextOwn:{id:`collection.share_template_own`,defaultMessage:`Check out my new collection:`},shareTextOther:{id:`collection.share_template_other`,defaultMessage:`Check out this cool collection:`}}),w=({collection:e,onClose:t})=>{let n=i(),a=f(),w=!!d().state?.newCollection,T=e.account_id===o,E=e.url,D=(0,b.useCallback)(()=>{navigator.share({url:E})},[E]),O=(0,b.useCallback)(()=>{let e=T?n.formatMessage(C.shareTextOwn):n.formatMessage(C.shareTextOther);e+=`\n\n${E}`,t(),a(u(e)),a(l())},[t,E,a,n,T]);return(0,S.jsxs)(v,{children:[(0,S.jsxs)(_,{children:[(0,S.jsx)(h,{as:`h1`,className:x.heading,children:w?(0,S.jsx)(r,{id:`collection.share_modal.title_new`,defaultMessage:`Share your new collection!`}):(0,S.jsx)(r,{id:`collection.share_modal.title`,defaultMessage:`Share collection`})}),(0,S.jsx)(s,{title:n.formatMessage({id:`lightbox.close`,defaultMessage:`Close`}),iconComponent:c,icon:`close`,className:x.closeButtonDesktop,onClick:t}),(0,S.jsx)(`div`,{className:x.preview,children:(0,S.jsx)(p,{collection:e,headingLevel:`h2`})}),(0,S.jsx)(y,{label:n.formatMessage({id:`collection.share_modal.share_link_label`,defaultMessage:`Share link`}),value:E})]}),(0,S.jsxs)(g,{className:x.actions,children:[(0,S.jsxs)(`div`,{className:x.shareButtonWrapper,children:[(0,S.jsx)(m,{secondary:!0,onClick:O,children:(0,S.jsx)(r,{id:`collection.share_modal.share_via_post`,defaultMessage:`Post on Mastodon`})}),`share`in navigator&&(0,S.jsx)(m,{secondary:!0,onClick:D,children:(0,S.jsx)(r,{id:`collection.share_modal.share_via_system`,defaultMessage:`Share toâ¦`})})]}),(0,S.jsx)(m,{plain:!0,onClick:t,className:x.closeButtonMobile,children:(0,S.jsx)(r,{id:`lightbox.close`,defaultMessage:`Close`})})]})]})};export{w as CollectionShareModal}; 2//# sourceMappingURL=share_modal-BU70NBiJ.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.