1import{o as e,r as t}from"./chunk-CMxvf4Kt.js";import{n,t as r}from"./jsx-runtime-SsSjplwM.js";import{c as i,s as a}from"./react-intl-Cop388b4.js";import{b as o}from"./prop-types-BTvjt2rf.js";import{Pi as s,ki as c}from"./render-Ba_suDLt.js";import{R as l}from"./accounts_typed-CffUl1H7.js";import{o as u,s as d}from"./typed_functions-CyAHd4bl.js";import{T as f}from"./compose_form_container-oI5Bl-XP.js";var p=t({RevokeCollectionInclusionModal:()=>v,useConfirmRevoke:()=>_}),m=e(n()),h=r(),g=a({revokeCollectionInclusionTitle:{id:`confirmations.revoke_collection_inclusion.title`,defaultMessage:`Remove yourself from this collection?`},revokeCollectionInclusionMessage:{id:`confirmations.revoke_collection_inclusion.message`,defaultMessage:`The curator won't be able to re-add you to this collection for 24 hours. To prevent them from adding you to collections permanently, you can block them.`},revokeCollectionInclusionConfirm:{id:`confirmations.revoke_collection_inclusion.confirm`,defaultMessage:`Remove me`}});function _(e){let t=u(),{id:n,items:r=[]}=e??{},i=r.find(e=>e.account_id===o)?.id;return(0,m.useCallback)(()=>{t(c({modalType:`REVOKE_COLLECTION_INCLUSION`,modalProps:{collectionId:n,collectionItemId:i}}))},[t,n,i])}var v=({collectionId:e,collectionItemId:t,onClose:n})=>{let r=i(),a=u(),o=d(t=>t.collections.collections[e]?.name),c=(0,m.useCallback)(async()=>{try{await a(l({collectionId:e,itemId:t})).unwrap(),a(s({message:r.formatMessage({id:`collections.revoke_inclusion.confirmation`,defaultMessage:`You've been removed from "{collection}"`},{collection:o})}))}catch{a(s({message:r.formatMessage({id:`collections.revoke_inclusion.error`,defaultMessage:`There was an error, please try again later.`})}))}},[a,e,o,t,r]);return(0,h.jsx)(f,{title:r.formatMessage(g.revokeCollectionInclusionTitle),message:r.formatMessage(g.revokeCollectionInclusionMessage),confirm:r.formatMessage(g.revokeCollectionInclusionConfirm),onConfirm:c,onClose:n})};export{_ as n,p as t};
2//# sourceMappingURL=revoke_collection_inclusion_modal-aM-V9Yx0.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.