1var Pe=Object.defineProperty;var Be=(s,a,t)=>a in s?Pe(s,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[a]=t;var b=(s,a,t)=>Be(s,typeof a!="symbol"?a+"":a,t);import{j as e,_ as ne}from"./client-wT6vtYO_.js";import{u as N,r as g,d as j,i as Ue,g as Ce}from"./index-Bb-onfd8.js";import{c as O}from"./index-OpJcq1lp.js";import{g as E,f as L,dv as qe,J as He,I as B,dw as $e,dx as ze,z as Ge,dy as re,aL as ke,aK as Me,bj as Ve,dz as We,$ as Ke,bi as Ye,bq as Ze,cI as Xe,dA as Je,o as je,dB as Qe,X as z,c_ as et,dC as tt,av as le}from"./useSelectableClick-DkL15uqj.js";import{a as G,J as st,O as at,v as ot,w as ce,l as de,I as Se,f as oe,e as it,k as ue}from"./chevron_right-evgaV6VH.js";import{H as nt}from"./Helmet-DKoRQaQs.js";import{G as rt,g as Ne,F as Te,Z as lt,M as ct,a as dt}from"./media_modal-B1oC63jn.js";import{i as ut}from"./react-textarea-autosize.browser.esm-BLa6tJ4T.js";import{d as mt}from"./upload_file-AEm541PC.js";import{B as D}from"./index-DMhKkrZs.js";import{L as Ee}from"./loading_indicator-BUVBKBzG.js";import{S as J}from"./skeleton-Bbqd0I5b.js";import{a as ht,P as gt}from"./compose_form_container-Ge9hrdyy.js";import{B as ft,a5 as pt,a6 as vt,a7 as _t,f as bt,a8 as xt,a9 as yt,aa as wt,ab as Ct,ac as kt,ad as Mt,ae as jt,af as St,ag as Nt,ah as Tt,ai as Et,aj as Dt,ak as It,al as At}from"./backend_links-nT4d_jo0.js";import{m as me}from"./initial_state-BTmXMNXf.js";import{a as Ot}from"./index-C6FsFuz5.js";import{S as Lt}from"./question_mark-C1Akynso.js";import{M as y}from"./message-Cf7rvt4j.js";import{L as Rt,a as Ft,P as I}from"./react-router-dom-BRJWzr86.js";import{E as De}from"./embedded_status-BVkvjqxZ.js";import{a as Pt}from"./api-C_Bk9fzo.js";import{S as Bt}from"./manufacturing-B9ChHTBc.js";import{S as Ut}from"./settings-fill-BXtoTOIv.js";import{d as qt,b as Ht,c as $t}from"./_baseIteratee-CKr1ourg.js";import{S as zt}from"./delete-C7R9nnjc.js";import{S as Gt}from"./edit-Z44MycBi.js";import{S as Vt}from"./close-CYx-TYgR.js";import{G as Wt}from"./gif-R0vQdleb.js";const Q=(s,a,t)=>typeof a=="object"?s.formatMessage(a,t):a,Kt=({alert:{key:s,title:a,message:t,values:o,action:c,onClick:u},dismissAfter:d})=>{const l=L(),i=N(),[r,n]=g.useState(!1);return g.useEffect(()=>{const h=setTimeout(()=>{n(!0)},1);return()=>{clearTimeout(h)}},[]),g.useEffect(()=>{const h=setTimeout(()=>{n(!1),setTimeout(()=>{l(qe({key:s}))},500)},d);return()=>{clearTimeout(h)}},[l,n,s,d]),e.jsx("div",{className:O("notification-bar",{"notification-bar-active":r}),children:e.jsxs("div",{className:"notification-bar-wrapper",children:[a&&e.jsx("span",{className:"notification-bar-title",children:Q(i,a,o)}),e.jsx("span",{className:"notification-bar-message",children:Q(i,t,o)}),c&&e.jsx("button",{className:"notification-bar-action",onClick:u,children:Q(i,c,o)})]})})},Sa=()=>{const s=E(a=>a.alerts);return s.length===0?null:e.jsx("div",{className:"notification-list",children:s.map((a,t)=>e.jsx(Kt,{alert:a,dismissAfter:5e3+t*1e3},a.key))})},Yt="BUNDLE_FETCH_REQUEST",Zt="BUNDLE_FETCH_SUCCESS",Xt="BUNDLE_FETCH_FAIL";function Jt(s){return{type:Yt,skipLoading:s}}function Qt(s){return{type:Zt,skipLoading:s}}function es(s,a){return{type:Xt,error:s,skipLoading:a}}const ts=s=>({onFetch(){s(Jt())},onFetchSuccess(){s(Qt())},onFetchFail(a){s(es(a))}}),ss=G(null,ts)(ft),as=(s,a)=>({loading:s.get("loadingBar")[a.scope||"default"]}),Na=G(as)(st.WrappedComponent),os=j({help:{id:"info_button.label",defaultMessage:"Help"}}),is=()=>{const s=N(),[a,t]=g.useState(!1),o=g.useRef(null),c=g.useId(),u=g.useCallback(()=>{t(!a)},[a,t]),[d,l]=He(u);return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:O("help-button",{active:a}),ref:o,onClick:u,"aria-expanded":a,"aria-controls":c,"aria-label":s.formatMessage(os.help),children:e.jsx(B,{id:"",icon:Lt})}),e.jsx(at,{show:a,rootClose:!0,placement:"top",onHide:u,offset:[5,5],target:o,children:({props:i})=>e.jsx("div",{...i,className:"dialog-modal__popout prose dropdown-animation",role:"region",id:c,onMouseDown:d,onMouseUp:l,children:e.jsx(y,{id:"info_button.what_is_alt_text",defaultMessage:`<h1>What is alt text?</h1> 2 3 <p>Alt text provides image descriptions for people with vision impairments, low-bandwidth connections, or those seeking extra context.</p> 4 5 <p>You can improve accessibility and understanding for everyone by writing clear, concise, and objective alt text.</p> 6 7 <ul> 8 <li>Capture important elements</li> 9 <li>Summarize text in images</li> 10 <li>Use regular sentence structure</li> 11 <li>Avoid redundant information</li> 12 <li>Focus on trends and key findings in complex visuals (like diagrams or maps)</li> 13 </ul>`,values:{h1:r=>e.jsx("h1",{children:r}),p:r=>e.jsx("p",{children:r}),ul:r=>e.jsx("ul",{children:r}),li:r=>e.jsx("li",{children:r})}})})})]})},W=j({placeholderVisual:{id:"alt_text_modal.describe_for_people_with_visual_impairments",defaultMessage:"Describe this for people with visual impairmentsâ¦"},placeholderHearing:{id:"alt_text_modal.describe_for_people_with_hearing_impairments",defaultMessage:"Describe this for people with hearing impairmentsâ¦"}
13,discardMessage:{id:"confirmations.discard_edit_media.message",defaultMessage:"You have unsaved changes to the media description or preview, discard them anyway?"},discardConfirm:{id:"confirmations.discard_edit_media.confirm",defaultMessage:"Discard"}}),he=1500,ns=({children:s,onSelectFile:a,mimeTypes:t})=>{const o=g.useRef(null),c=g.useCallback(()=>{var d;(d=o.current)==null||d.click()},[]),u=g.useCallback(d=>{var i;const l=(i=d.target.files)==null?void 0:i[0];l&&a(l)},[a]);return e.jsxs("label",{children:[e.jsx(D,{onClick:c,children:s}),e.jsx("input",{id:"upload-modal__thumbnail",ref:o,type:"file",accept:t,onChange:u,style:{display:"none"}})]})},rs=({mediaId:s,position:a,onPositionChange:t})=>{const o=g.useRef(!1),c=g.useRef(null),[u,d]=a,l=ot({to:{left:`${u*100}%`,top:`${d*100}%`},immediate:o.current}),i=E(p=>p.compose.get("media_attachments").find(_=>_.get("id")===s)),r=E(p=>me?p.accounts.get(me):void 0),[n,h]=g.useState(!1),f=g.useCallback(p=>{c.current=p},[]),m=g.useCallback(p=>{if(p.button!==0)return;const _=k=>{const{x:S,y:M}=re(c.current,k);o.current=!0,t([S,M])},w=()=>{h(!1),o.current=!1,document.removeEventListener("mouseup",w),document.removeEventListener("mousemove",_)},{x:v,y:C}=re(c.current,p.nativeEvent);h(!0),t([v,C]),document.addEventListener("mouseup",w),document.addEventListener("mousemove",_)},[h,t]);return i?i.get("type")==="image"?e.jsxs("div",{className:O("focal-point",{dragging:n}),children:[e.jsx("img",{ref:f,draggable:!1,src:i.get("url"),alt:"",role:"presentation",onMouseDown:m}),e.jsx(ce.div,{className:"focal-point__reticle",style:l})]}):i.get("type")==="gifv"?e.jsxs("div",{className:O("focal-point",{dragging:n}),children:[e.jsx(rt,{ref:f,src:i.get("url"),alt:"",onMouseDown:m}),e.jsx(ce.div,{className:"focal-point__reticle",style:l})]}):i.get("type")==="video"?e.jsx(ke,{preview:i.get("preview_url"),frameRate:i.getIn(["meta","original","frame_rate"]),aspectRatio:`${i.getIn(["meta","original","width"])} / ${i.getIn(["meta","original","height"])}`,blurhash:i.get("blurhash"),src:i.get("url"),detailed:!0,editable:!0}):i.get("type")==="audio"?e.jsx(Me,{src:i.get("url"),poster:i.get("preview_url")??(r==null?void 0:r.avatar_static),duration:i.getIn(["meta","original","duration"],0),backgroundColor:i.getIn(["meta","colors","background"]),foregroundColor:i.getIn(["meta","colors","foreground"]),accentColor:i.getIn(["meta","colors","accent"]),editable:!0}):null:null},Ie=g.forwardRef(({mediaId:s,previousDescription:a,previousPosition:t,onClose:o},c)=>{const u=N(),d=L(),l=E(x=>x.compose.get("media_attachments").find(T=>T.get("id")===s)),i=E(x=>x.compose.get("language")),r=(l==null?void 0:l.getIn(["meta","focus","x"],0))??0,n=(l==null?void 0:l.getIn(["meta","focus","y"],0))??0,[h,f]=g.useState(a??(l==null?void 0:l.get("description"))??""),[m,p]=g.useState(t??[r/2+.5,n/-2+.5]),[_,w]=g.useState(!1),[v,C]=g.useState(!1),k=g.useRef(!!(a||t)),S=l==null?void 0:l.get("type"),M=mt.length(h)<=he,A=g.useCallback(x=>{f(x.target.value),k.current=!0},[f]),X=g.useCallback(x=>{d($e(s,x))},[d,s]),U=g.useCallback(x=>{p(x),k.current=!0},[p]),q=g.useCallback(()=>{C(!0),d(ze({id:s,description:h,focus:`${((m[0]-.5)*2).toFixed(2)},${((m[1]-.5)*-2).toFixed(2)}`})).then(()=>(C(!1),k.current=!1,o(),"")).catch(x=>{C(!1),d(Ge(x))})},[d,C,s,o,m,h]),V=g.useCallback(x=>{(x.ctrlKey||x.metaKey)&&x.key==="Enter"&&(x.preventDefault(),M&&q())},[q,M]),F=g.useCallback(()=>{w(!0),pt().then(async({createWorker:x})=>{const[T,H]=await Promise.all([ne(()=>import("./worker.min-CsIQe9T3.js"),[]),ne(()=>import("./tesseract-core.wasm-B2697XUV.js"),[])]),P=await x("eng",1,{workerPath:T.default,corePath:H.default,langPath:`${Ot}/ocr/lang-data`,cacheMethod:"write"}),Re=URL.createObjectURL(l==null?void 0:l.get("file")),Fe=await P.recognize(Re);return f(Fe.data.text),w(!1),await P.terminate(),""}).catch(()=>{w(!1)})},[f,w,l]);return g.useImperativeHandle(c,()=>({getCloseConfirmationMessage:()=>k.current?{message:u.formatMessage(W.discardMessage),confirm:u.formatMessage(W.discardConfirm),props:{previousDescription:h,previousPosition:m}}:null}),[u,h,m]),e.jsxs("div",{className:"modal-root__modal dialog-modal",children:[e.jsxs("div",{className:"dialog-modal__header",children:[e.jsx(D,{onClick:q,disabled:!M,children:v?e.jsx(Ee,{}):e.jsx(y,{id:"alt_text_modal.done",defaultMessage:"Done"})}),e.jsx("span",{className:"dialog-modal__header__title",children:e.jsx(y,{id:"alt_text_modal.add_alt_text",defaultMessage:"Add alt text"})}),e.jsx(D,{secondary:!0,onClick:o,children:e.jsx(y,{id:"alt_text_modal.cancel",defaultMessage:"Cancel"})})]}),e.jsxs("div",{className:"dialog-modal__content",children:[e.jsxs("div",{className:"dialog-modal__content__preview",children:[e.jsx(rs,{mediaId:s,position:m,onPositionChange:U}),(S==="audio"||S==="video")&&e.jsx(ns,{onSelectFile:X,mimeTypes:"image/jpeg,image/png,image/gif,image/heic,image/heif,image/webp,image/avif",children:e.jsx(y,{id:"alt_text_modal.change_thumbnail",defaultMessage:"Change thumbnail"})})]}),e.jsx("form",{className:"dialog-modal__content__form simple_form",onSubmit:q,children:e.jsxs("div",{className:"input",children:[e.jsxs("div",{className:"label_input",children:[e.jsx(ut,{id:"description",value:_?" ":h,onChange:A,onKeyUp:V,lang:i,placeholder:u.formatMessage(S==="audio"?W.placeholderHearing:W.placeholderVisual),minRows:3,disabled:_}),_&&e.jsxs("div",{className:"label_input__loading-indicator",children:[e.jsx(J,{width:"100%"}),e.jsx(J,{width:"100%"}),e.jsx(J,{width:"61%"})]})]}),e.jsxs("div",{className:"input__toolbar",children:[e.jsx(ht,{max:he,text:_?"":h}),e.jsx("div",{className:"spacer"}),e.jsx("button",{className:"link-button",onClick:F,disabled:S!=="image"||_,children:e.jsx(y,{id:"alt_text_modal.add_text_from_image",defaultMessage:"Add text from image"})}),e.jsx(is,{})]})]})})]})]})});Ie.displayName="AltTextModal";const ls=({actions:s,onClick:a})=>e.jsx("div",{className:"modal-root__modal actions-modal",children:e.jsx("ul",{children:s.map((t,o)=>{if(t===null)return e.jsx("li",{className:"dropdown-menu__separator"},`sep-${o}`);const{text:c,dangerous:u}=t;let d;return vt(t)?d=e.jsx("button",{onClick:a,"data-index":o,children:c}):_t(t)?d=e.jsx("a",{href:t.href,target:t.target??"_target","data-method":t.method,rel:"noopener",onClick:a,"data-index":o,children:c}):d=e.jsx(Rt,{to:t.to,onClick:a,"data-index":o,children:c}),e.jsx("li",{className:O({"dropdown-menu__item--dangerous":u}),children:d},`${c}-${o}`)})})}
13),cs=({media:s,statusId:a,options:t,onClose:o,onChangeBackgroundColor:c})=>{const u=E(n=>n.statuses.get(a)),d=u==null?void 0:u.get("account"),l=E(n=>{var h;return d?(h=n.accounts.get(d))==null?void 0:h.avatar_static:void 0});g.useEffect(()=>{const n=Ne(s.get("blurhash"));return c(n??{r:255,g:255,b:255}),()=>{c(null)}},[s,c]);const i=(u==null?void 0:u.getIn(["translation","language"]))??(u==null?void 0:u.get("language")),r=s.getIn(["translation","description"])??s.get("description");return e.jsxs("div",{className:"modal-root__modal audio-modal",children:[e.jsx("div",{className:"audio-modal__container",children:e.jsx(Me,{src:s.get("url"),alt:r,lang:i,poster:s.get("preview_url")??l,duration:s.getIn(["meta","original","duration"],0),backgroundColor:s.getIn(["meta","colors","background"]),foregroundColor:s.getIn(["meta","colors","foreground"]),accentColor:s.getIn(["meta","colors","accent"]),startPlaying:t.autoPlay})}),e.jsx("div",{className:"media-modal__overlay",children:u&&e.jsx(Te,{statusId:u.get("id"),withOpenButton:!0,onClose:o})})]})},ge=j({cancel_reblog:{id:"status.cancel_reblog_private",defaultMessage:"Unboost"},reblog:{id:"status.reblog",defaultMessage:"Boost"}}),ds=({status:s,onReblog:a,onClose:t,missingMediaDescription:o})=>{const c=N(),u=E(p=>
13p.compose.get("default_privacy")),d=s.get("id"),l=s.get("visibility"),[i,r]=g.useState(l==="private"?"private":u),n=g.useCallback(p=>{r(p)},[]),h=g.useCallback(()=>{a(s,i),t()},[t,a,s,i]),f=g.useCallback(()=>{t()},[t]),m=g.useCallback(()=>document.getElementsByClassName("modal-root__container")[0],[]);return e.jsxs("div",{className:"modal-root__modal safety-action-modal",children:[e.jsxs("div",{className:"safety-action-modal__top",children:[e.jsxs("div",{className:"safety-action-modal__header",children:[e.jsx("div",{className:"safety-action-modal__header__icon",children:e.jsx(B,{icon:de,id:"retweet"})}),e.jsxs("div",{children:[e.jsx("h1",{children:s.get("reblogged")?e.jsx(y,{id:"boost_modal.undo_reblog",defaultMessage:"Unboost post?"}):e.jsx(y,{id:"boost_modal.reblog",defaultMessage:"Boost post?"})}),e.jsx("div",{children:o?e.jsx(y,{id:"boost_modal.missing_description",defaultMessage:"This toot contains some media without description"}):e.jsx(y,{id:"boost_modal.combo",defaultMessage:"You can press {combo} to skip this next time",values:{combo:e.jsxs("span",{className:"hotkey-combination",children:[e.jsx("kbd",{children:"Shift"}),"+",e.jsx(B,{id:"retweet",icon:de})]})}})})]})]}),e.jsx("div",{className:"safety-action-modal__status",children:e.jsx(De,{statusId:d})})]}),e.jsx("div",{className:O("safety-action-modal__bottom"),children:e.jsxs("div",{className:"safety-action-modal__actions",children:[!s.get("reblogged")&&e.jsx(gt,{noDirect:!0,value:i,container:m,onChange:n,disabled:l==="private"}),e.jsx("div",{className:"spacer"}),e.jsx("button",{onClick:f,className:"link-button",children:e.jsx(y,{id:"confirmation_modal.cancel",defaultMessage:"Cancel"})}),e.jsx(D,{onClick:h,text:c.formatMessage(s.get("reblogged")?ge.cancel_reblog:ge.reblog),autoFocus:!0})]})})]})},R=({title:s,message:a,confirm:t,cancel:o,onClose:c,onConfirm:u,secondary:d,onSecondary:l,closeWhenConfirm:i=!0})=>{const r=g.useCallback(()=>{i&&c(),u()},[c,u,i]),n=g.useCallback(()=>{c(),l==null||l()},[c,l]),h=g.useCallback(()=>{c()},[c]);return e.jsxs("div",{className:"modal-root__modal safety-action-modal",children:[e.jsx("div",{className:"safety-action-modal__top",children:e.jsxs("div",{className:"safety-action-modal__confirmation",children:[e.jsx("h1",{children:s}),e.jsx("p",{children:a})]})}),e.jsx("div",{className:"safety-action-modal__bottom",children:e.jsxs("div",{className:"safety-action-modal__actions",children:[e.jsx("button",{onClick:h,className:"link-button",children:o??e.jsx(y,{id:"confirmation_modal.cancel",defaultMessage:"Cancel"})}),d&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"spacer"}),e.jsx("button",{onClick:n,className:"link-button",children:d})]}),e.jsx(D,{onClick:r,autoFocus:!0,children:t})]})})]})},$=j({deleteAndRedraftTitle:{id:"confirmations.redraft.title",defaultMessage:"Delete & redraft post?"},deleteAndRedraftMessage:{id:"confirmations.redraft.message",defaultMessage:"Are you sure you want to delete this status and re-draft it? Favorites and boosts will be lost, and replies to the original post will be orphaned."},deleteAndRedraftConfirm:{id:"confirmations.redraft.confirm",defaultMessage:"Delete & redraft"},deleteTitle:{id:"confirmations.delete.title",defaultMessage:"Delete post?"},deleteMessage:{id:"confirmations.delete.message",defaultMessage:"Are you sure you want to delete this status?"},deleteConfirm:{id:"confirmations.delete.confirm",defaultMessage:"Delete"}}),us=({statusId:s,withRedraft:a,onClose:t})=>{const o=N(),c=L(),u=g.useCallback(()=>{c(Ve(s,a))},[c,s,a]);return e.jsx(R,{title:o.formatMessage(a?$.deleteAndRedraftTitle:$.deleteTitle),message:o.formatMessage(a?$.deleteAndRedraftMessage:$.deleteMessage),confirm:o.formatMessage(a?$.deleteAndRedraftConfirm:$.deleteConfirm),onConfirm:u,onClose:t})},ee=j({deleteListTitle:{id:"confirmations.delete_list.title",defaultMessage:"Delete list?"},deleteListMessage:{id:"confirmations.delete_list.message",defaultMessage:"Are you sure you want to permanently delete this list?"},deleteListConfirm:{id:"confirmations.delete_list.confirm",defaultMessage:"Delete"}}),ms=({listId:s,columnId:a,onClose:t})=>{const o=N(),c=L(),u=Ft(),d=g.useCallback(()=>{c(We(s)),a?c(Ke(a)):u.push("/lists")}
13,[c,u,a,s]);return e.jsx(R,{title:o.formatMessage(ee.deleteListTitle),message:o.formatMessage(ee.deleteListMessage),confirm:o.formatMessage(ee.deleteListConfirm),onConfirm:d,onClose:t})},hs=j({title:{id:"confirmations.discard_draft.edit.title",defaultMessage:"Discard changes to your post?"},message:{id:"confirmations.discard_draft.edit.message",defaultMessage:"Continuing will discard any changes you have made to the post you are currently editing."},cancel:{id:"confirmations.discard_draft.edit.cancel",defaultMessage:"Resume editing"}}),gs=j({title:{id:"confirmations.discard_draft.post.title",defaultMessage:"Discard your draft post?"},message:{id:"confirmations.discard_draft.post.message",defaultMessage:"Continuing will discard the post you are currently composing."},cancel:{id:"confirmations.discard_draft.post.cancel",defaultMessage:"Resume draft"}}),fs=j({confirm:{id:"confirmations.discard_draft.confirm",defaultMessage:"Discard and continue"}}),Ae=({onConfirm:s,onClose:a})=>{const t=N(),c=E(u=>!!u.compose.get("id"))?hs:gs;return e.jsx(R,{title:t.formatMessage(c.title),message:t.formatMessage(c.message),cancel:t.formatMessage(c.cancel),confirm:t.formatMessage(fs.confirm),onConfirm:s,onClose:a})},ps=({status:s,onClose:a})=>{const t=L(),o=g.useCallback(()=>{t(Ze(s))},[t,s]);return e.jsx(Ae,{onConfirm:o,onClose:a})},vs=({statusId:s,onClose:a})=>{const t=L(),o=g.useCallback(()=>{t(Ye(s))},[t,s]);return e.jsx(Ae,{onConfirm:o,onClose:a})},fe=j({unfollowTitle:{id:"confirmations.unfollow.title",defaultMessage:"Unfollow user?"},unfollowConfirm:{id:"confirmations.unfollow.confirm",defaultMessage:"Unfollow"}}),_s=({account:s,onClose:a})=>{const t=N(),o=L(),c=g.useCallback(()=>{o(Xe(s.id))},[o,s.id]);return e.jsx(R,{title:t.formatMessage(fe.unfollowTitle),message:e.jsx(y,{id:"confirmations.unfollow.message",defaultMessage:"Are you sure you want to unfollow {name}?",values:{name:e.jsxs("strong",{children:["@",s.acct]})}}),confirm:t.formatMessage(fe.unfollowConfirm),onConfirm:c,onClose:a})},te=j({clearTitle:{id:"notifications.clear_title",defaultMessage:"Clear notifications?"},clearMessage:{id:"notifications.clear_confirmation",defaultMessage:"Are you sure you want to permanently clear all your notifications?"},clearConfirm:{id:"notifications.clear",defaultMessage:"Clear notifications"}}),bs=({onClose:s})=>{const a=N(),t=L(),o=g.useCallback(()=>{t(Je())},[t]);return e.jsx(R,{title:a.formatMessage(te.clearTitle),message:a.formatMessage(te.clearMessage),confirm:a.formatMessage(te.clearConfirm),onConfirm:o,onClose:s})};async function xs(){try{const s=await Pt(!1).delete("/auth/sign_out",{headers:{Accept:"application/json"},withCredentials:!0});s.status===200&&s.data.redirect_to?window.location.href=s.data.redirect_to:console.error("Failed to log out, got an unexpected non-redirect response from the server",s)}catch(s){console.error("Failed to log out, response was an error",s)}}const se=j({logoutTitle:{id:"confirmations.logout.title",defaultMessage:"Log out?"},logoutMessage:{id:"confirmations.logout.message",defaultMessage:"Are you sure you want to log out?"},logoutConfirm:{id:"confirmations.logout.confirm",defaultMessage:"Log out"}}),ys=({onClose:s})=>{const a=N(),t=g.useCallback(()=>{xs()},[]);return e.jsx(R,{title:a.formatMessage(se.logoutTitle),message:a.formatMessage(se.logoutMessage),confirm:a.formatMessage(se.logoutConfirm),onConfirm:t,onClose:s})},pe=j({title:{id:"confirmations.follow_to_list.title",defaultMessage:"Follow user?"},confirm:{id:"confirmations.follow_to_list.confirm",defaultMessage:"Follow and add to list"}}),ws=({accountId:s,onConfirm:a,onClose:t})=>{const o=N(),c=E(u=>u.accounts.get(s));return e.jsx(R,{title:o.formatMessage(pe.title),message:e.jsx(y,{id:"confirmations.follow_to_list.message",defaultMessage:"You need to be following {name} to add them to a list.",values:{name:e.jsxs("strong",{children:["@",c==null?void 0:c.acct]})}}),confirm:o.formatMessage(pe.confirm),onConfirm:a,onClose:t})},K=j({title:{id:"confirmations.missing_alt_text.title",defaultMessage:"Add alt text?"},confirm:{id:"confirmations.missing_alt_text.confirm",defaultMessage:"Add alt text"},message:{id:"confirmations.missing_alt_text.message",defaultMessage:"Your post contains media without alt text. Adding descriptions helps make your content accessible to more people."}
13,secondary:{id:"confirmations.missing_alt_text.secondary",defaultMessage:"Post anyway"}}),Cs=({onClose:s,overridePrivacy:a})=>{const t=N(),o=L(),c=E(l=>{var i;return(i=l.compose.get("media_attachments").find(r=>["image","gifv"].includes(r.get("type"))&&(r.get("description")??"").length===0))==null?void 0:i.get("id")}),u=g.useCallback(()=>{o(je({modalType:"FOCAL_POINT",modalProps:{mediaId:c}}))},[o,c]),d=g.useCallback(()=>{o(Qe(a))},[o,a]);return e.jsx(R,{title:t.formatMessage(K.title),message:t.formatMessage(K.message),confirm:t.formatMessage(K.confirm),secondary:t.formatMessage(K.secondary),onConfirm:u,onSecondary:d,onClose:s})},ks="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20viewBox='0%200%20216.41507%20232.00976'%20version='1.1'%20id='svg6'%20sodipodi:docname='logo_warn_glitch.svg'%20inkscape:version='1.1.2%20(0a00cf5339,%202022-02-04)'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3cdefs%20id='defs10'%20/%3e%3csodipodi:namedview%20id='namedview8'%20pagecolor='%23ffffff'%20bordercolor='%23666666'%20borderopacity='1.0'%20inkscape:pageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20showgrid='false'%20inkscape:zoom='1.7951831'%20inkscape:cx='-30.916067'%20inkscape:cy='90.241493'%20inkscape:window-width='1920'%20inkscape:window-height='1011'%20inkscape:window-x='0'%20inkscape:window-y='32'%20inkscape:window-maximized='1'%20inkscape:current-layer='svg6'%20/%3e%3cg%20id='g2025'%3e%3cpath%20d='M211.80683%20139.0875c-3.1825%2016.36625-28.4925%2034.2775-57.5625%2037.74875-15.16%201.80875-30.0825%203.47125-45.99875%202.74125-26.0275-1.1925-46.565-6.2125-46.565-6.2125%200%202.53375.15625%204.94625.46875%207.2025%203.38375%2025.68625%2025.47%2027.225%2046.3925%2027.9425%2021.115.7225%2039.91625-5.20625%2039.91625-5.20625l.86875%2019.09s-14.77%207.93125-41.08125%209.39c-14.50875.7975-32.52375-.365-53.50625-5.91875C9.23183%20213.82%201.40558%20165.31125.20808%20116.09125c-.36375-14.61375-.14-28.39375-.14-39.91875%200-50.33%2032.97625-65.0825%2032.97625-65.0825C49.67058%203.45375%2078.20308.2425%20107.86433%200h.72875c29.66125.2425%2058.21125%203.45375%2074.8375%2011.09%200%200%2032.97625%2014.7525%2032.97625%2065.0825%200%200%20.4125%2037.13375-4.6%2062.915'%20fill='%233088d4'%20id='path2'%20/%3e%3cpath%20d='m%20124.52893,137.75645%20c%200,9.01375%20-7.30875,16.32125%20-16.3225,16.32125%20-9.01375,0%20-16.32125,-7.3075%20-16.32125,-16.32125%200,-9.01375%207.3075,-16.3225%2016.32125,-16.3225%209.01375,0%2016.3225,7.30875%2016.3225,16.3225'%20fill='%23ffffff'%20id='path4'%20sodipodi:nodetypes='csssc'%20/%3e%3cpath%20id='path1121'%20d='m%20108.20703,25.453125%20c%20-9.013749,0%20-16.322264,7.308516%20-16.322264,16.322266%200,5.31808%202.555126,37.386806%206.492187,67.763669%204.100497,4.20028%2015.890147,3.77063%2019.660157,-0.01%203.9367,-30.375272%206.49219,-62.4364%206.49219,-67.753909%200,-9.01375%20-7.30852,-16.322266%20-16.32227,-16.322266%20z'%20style='fill:%23ffffff'%20sodipodi:nodetypes='ssccsss'%20/%3e%3c/g%3e%3c/svg%3e",ve=j({discardChanges:{id:"confirmations.deprecated_settings.confirm",defaultMessage:"Use Mastodon preferences"},user_setting_expand_spoilers:{id:"settings.enable_content_warnings_auto_unfold",defaultMessage:"Automatically unfold content-warnings"},user_setting_disable_swiping:{id:"settings.swipe_to_change_columns",defaultMessage:"Allow swiping to change columns (Mobile only)"}});class Ms extends g.PureComponent{constructor(){super(...arguments);b(this,"handleClick",()=>{this.props.onConfirm(),this.props.onClose()})}render(){const{settings:t,intl:o}=this.props;return e.jsxs("div",{className:"modal-root__modal confirmation-modal",children:[e.jsxs("div",{className:"confirmation-modal__container",children:[e.jsx("img",{src:ks,className:"modal-warning",alt:""}),e.jsx(y,{id:"confirmations.deprecated_settings.message",defaultMessage:"Some of the glitch-soc device-specific {app_settings} you are using have been replaced by Mastodon {preferences} and will be overriden:",values:{app_settings:e.jsxs("strong",{className:"deprecated-settings-label",children:[e.jsx(B,{id:"cogs",icon:Bt})," ",e.jsx(y,{id:"navigation_bar.app_settings",defaultMessage:"App settings"})]}),preferences:e.jsxs("strong",{className:"deprecated-settings-label",children:[e.jsx(B,{id:"cog",icon:Ut})," ",e.jsx(y,{id:"navigation_bar.preferences",defaultMessage:"Preferences"})]})}}),e.jsx("div",{className:"deprecated-settings-info",children:e.jsx("ul",{children:t.map(c=>e.jsx("li",{children:e.jsx("a",{href:bt(c),children:e.jsx(y,{...ve[c]})})},c))})})]}),e.jsx("div",{children:e.jsxs("div",{className:"confirmation-modal__action-bar",children:[e.jsx("div",{}),e.jsx(D,{text:o.formatMessage(ve.discardChanges),onClick:this.handleClick,autoFocus:!0})]})})]})}}const js=Ue(Ms);var Y={exports:{}},Z={},_e;function Ss(){if(_e)return Z;_e=1,Object.defineProperty(Z,"__esModule",{value:!0});var s=function(){function d(l,i){for(var r=0;r<i.length;r++){var n=i[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(l,n.key,n)}}
13return function(l,i,r){return i&&d(l.prototype,i),r&&d(l,r),l}}();function a(d,l){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:d}function t(d,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);d.prototype=Object.create(l&&l.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(d,l):d.__proto__=l)}function o(d,l){if(!(d instanceof l))throw new TypeError("Cannot call a class as a function")}var c=function(){function d(l,i){o(this,d),this._x=l,this._y=i}return s(d,[{key:"set",value:function(i,r){this._x=i,this._y=r}},{key:"x",get:function(){return this._x},set:function(i){this._x=i}},{key:"y",get:function(){return this._y},set:function(i){this._y=i}}]),d}(),u=function(d){t(l,d);function l(){o(this,l);var i=a(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,0,0));return i._down=!1,i._px=0,i._py=0,i}return s(l,[{key:"down",get:function(){return this._down},set:function(r){this._down=r}},{key:"x",get:function(){return this._x},set:function(r){this._x=r}},{key:"y",get:function(){return this._y},set:function(r){this._y=r}},{key:"px",get:function(){return this._px},set:function(r){this._px=r}},{key:"py",get:function(){return this._py},set:function(r){this._py=r}}]),l}(c);return Z.default=u,Z}var be;function Ns(){if(be)return Y.exports;be=1;var s=function(){function i(r,n){for(var h=0;h<n.length;h++){var f=n[h];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(r,f.key,f)}}return function(r,n,h){return n&&i(r.prototype,n),h&&i(r,h),r}}(),a=Ss(),t=o(a);function o(i){return i&&i.__esModule?i:{default:i}}
13function c(i){if(Array.isArray(i)){for(var r=0,n=Array(i.length);r<i.length;r++)n[r]=i[r];return n}else return Array.from(i)}function u(i,r){if(!(i instanceof r))throw new TypeError("Cannot call a class as a function")}var d=function(){function i(r,n,h,f){var m=this;if(u(this,i),!document)throw new Error("no DOM found");if(r instanceof window.Node&&r.tagName==="CANVAS")this.canvas=r;else if(typeof r=="string")this.canvas=document.querySelector(r);else throw new Error("can't look for canvas based on '"+r+"'");if(!this.canvas)throw new Error("canvas not found");this.canvas.width=n||500,this.canvas.height=h||500,this.canvas.style.cursor="crosshair",this.mouse=new t.default;var p=function(C){C.preventDefault();var k=m.canvas.getBoundingClientRect(),S=C.changedTouches&&C.changedTouches[0]||C,M=S.offsetX,A=S.offsetY;typeof M>"u"&&(M=S.clientX+document.documentElement.scrollLeft-k.left),typeof A>"u"&&(A=S.clientY+document.documentElement.scrollTop-k.top),m.mouse.down?(m.draw(M,A),!m._dirty&&(M!==m.mouse.x||A!==m.mouse.y)&&(m._dirty=!0,m.fireDirty())):(m.mouse.x=M,m.mouse.y=A)},_=function(C){if(C.preventDefault(),p(C),m._mode==="fill"){m.fill();return}m.mouse.px=m.mouse.x,m.mouse.py=m.mouse.y,m.mouse.down=!0,m.context.beginPath(),m.context.moveTo(m.mouse.px,m.mouse.py)},w=function(){m.mouse.down=!1,m.context.closePath()};this.canvas.addEventListener("mousemove",p),this.canvas.addEventListener("mousedown",_),document.addEventListener("mouseup",w),this.canvas.addEventListener("touchstart",_),this.canvas.addEventListener("touchend",w),this.canvas.addEventListener("touchmove",p),this.destroy=function(){m.clear(),m.canvas.removeEventListener("mousemove",p),m.canvas.removeEventListener("mousedown",_),document.removeEventListener("mouseup",w),m.canvas.removeEventListener("touchstart",_),m.canvas.removeEventListener("touchend",w),m.canvas.removeEventListener("touchmove",p)},this.context=this.canvas.getContext("2d"),this.context.globalCompositeOperation="source-over",this.context.globalAlpha=1,this.context.strokeStyle=f||"rgba(0,0,0,1)",this.context.lineCap="round",this.context.lineJoin="round",this.context.translate(.5,.5),this._filling=!1,this._fillStack=[],this.SMOOTHING_INIT=.85,this.WEIGHT_SPREAD=10,this._smoothing=this.SMOOTHING_INIT,this._maxWeight=12,this._thickness=2,this._targetThickness=2,this._weight=2,this._mode="draw",this._adaptive=!0}return s(i,[{key:"draw",value:function(n,h){var f=this.mouse,m=this.context,p=i.lineDistance(n,h,f.px,f.py),_=Math.min(.87,this._smoothing+(p-60)/3e3);f.x=n-(n-f.px)*_,f.y=h-(h-f.py)*_;var w=i.lineDistance(f.x,f.y,f.px,f.py);this._adaptive?(this._targetThickness=(w-1)/49*(this._maxWeight-this._weight)+this._weight,this._thickness>this._targetThickness?this._thickness-=.5:this._thickness<this._targetThickness&&(this._thickness+=.5),m.lineWidth=this._thickness):m.lineWidth=this._weight,m.quadraticCurveTo(f.px,f.py,f.x,f.y),m.stroke(),f.px=f.x,f.py=f.y}},{key:"fireDirty",value:function(){var n=document.createEvent("Event");n.initEvent("dirty",!0,!0),this.canvas.dispatchEvent(n)}},{key:"clear",value:function(){this.dirty&&(this._dirty=!1,this.fireDirty(),this.context.globalCompositeOperation==="destination-out"?(this.mode="draw",this.context.clearRect(-10,-10,this.canvas.width+20,this.canvas.height+20),this.mode="erase"):this.context.clearRect(-10,-10,this.canvas.width+20,this.canvas.height+20))}},{key:"toImage",value:function(){return this.canvas.toDataURL()}},{key:"fill",value:function(){var n=this,h=this.mouse,f=this.context,m=Array.prototype.slice.call(f.getImageData(h.x,h.y,1,1).data,0);this._filling?this._fillStack.push([h.x,h.y,m]):(this.canvas.style.cursor="progress",this._filling=!0,setTimeout(function(){n._floodFill(h.x,h.y,m)},100))}},{key:"_floodFill",value:function(n,h,f){var m=this,p=this.context,_=Math.floor(n),w=Math.floor(h),v=p.canvas.width,C=p.canvas.height,k=[[_,w]],S=i.hexToRgb(this.color),M=p.getImageData(0,0,p.canvas.width,p.canvas.height),A=Math.min(p.globalAlpha*10*255,255),X=i.colorPixel.apply(i,[M.data].concat(c(S),[f,A])),U=i.matchColor.apply(i,[M.data].concat(c(f))),q=i.matchColor.apply(i,[M.data].concat([].concat(c(S),[255])));if(q((w*p.canvas.width+_)*4)){this._filling=!1,setTimeout(function(){m.canvas.style.cursor="crosshair"},100);return}for(;k.length;){for(var V=k.pop(),F=V[0],x=V[1],T=(x*v+F)*4;x-->=0&&U(T);)T-=v*4;T+=v*4,++x;for(var H=!1,P=!1;x++<C-1&&U(T);)X(T),F>0&&(U(T-4)?H||(k.push([F-1,x]),H=!0):H&&(H=!1)),F<v-1&&(U(T+4)?P||(k.push([F+1,x]),P=!0):P&&(P=!1)),T+=v*4}p.putImageData(M,0,0),this._fillStack.length?this._floodFill.apply(this,c(this._fillStack.shift())):(this._filling=!1,setTimeout(function(){m.canvas.style.cursor="crosshair"},100))}},{key:"color",get:function(){return this.context.strokeStyle}
13,set:function(n){if(typeof n!="string")throw new Error("wrong argument type");this.context.strokeStyle=n}},{key:"weight",get:function(){return this._weight},set:function(n){if(typeof n!="number")throw new Error("wrong argument type");this._weight=n,this._thickness=n,this._targetThickness=n,this._maxWeight=n+this.WEIGHT_SPREAD}},{key:"adaptiveStroke",get:function(){return this._adaptive},set:function(n){this._adaptive=!!n}},{key:"mode",get:function(){return this._mode},set:function(n){if(typeof n!="string")throw new Error("wrong argument type");switch(n){case"erase":this._mode="erase",this.context.globalCompositeOperation="destination-out";break;case"fill":this._mode="fill",this.context.globalCompositeOperation="source-over";break;default:this._mode="draw",this.context.globalCompositeOperation="source-over";break}}},{key:"dirty",get:function(){return!!this._dirty}},{key:"smoothing",get:function(){return this._smoothing===this.SMOOTHING_INIT},set:function(n){if(typeof n!="boolean")throw new Error("wrong argument type");this._smoothing=n?this.SMOOTHING_INIT:0}},{key:"opacity",set:function(n){if(typeof n!="number")throw new Error("wrong argument type");n>=1?this.context.globalAlpha=1:this.context.globalAlpha=n/10}}],[{key:"lineDistance",value:function(n,h,f,m){var p=Math.pow(f-n,2),_=Math.pow(m-h,2);return Math.sqrt(p+_)}},{key:"hexToRgb",value:function(n){var h=n.match(/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);return[parseInt(h[1],16),parseInt(h[2],16),parseInt(h[3],16)]}},{key:"matchColor",value:function(n,h,f,m,p){return function(_){var w=n[_],v=n[_+1],C=n[_+2],k=n[_+3];return w===h&&v===f&&C===m&&k===p}}},{key:"colorPixel",value:function(n,h,f,m,p,_){var w=i.matchColor.apply(i,[n].concat(c(p)));return function(v){n[v]=h,n[v+1]=f,n[v+2]=m,n[v+3]=_,w(v+4)||(n[v+4]=n[v+4]*.01+h*.99,n[v+4+1]=n[v+4+1]*.01+f*.99,n[v+4+2]=n[v+4+2]*.01+m*.99,n[v+4+3]=n[v+4+3]*.01+_*.99),w(v-4)||(n[v-4]=n[v-4]*.01+h*.99,n[v-4+1]=n[v-4+1]*.01+f*.99,n[v-4+2]=n[v-4+2]*.01+m*.99,n[v-4+3]=n[v-4+3]*.01+_*.99)}}}]),i}();function l(i,r,n,h){return new d(i,r,n,h)}return Y.exports=l,Y.exports.Atrament=d,Y.exports}var Ts=Ns();const Es=Ce(Ts);var ae,xe;function Ds(){if(xe)return ae;xe=1;var s=qt(),a=Ht(),t=$t();function o(c,u){var d={};return u=t(u,3),a(c,function(l,i,r){s(d,i,u(l,i,r))}),d}return ae=o,ae}var Is=Ds();const As=Ce(Is),Os=s=>g.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...s},g.createElement("path",{d:"M346-140 100-386q-10-10-15-22t-5-25q0-13 5-25t15-22l230-229-106-106 62-65 400 400q10 10 14.5 22t4.5 25q0 13-4.5 25T686-386L440-140q-10 10-22 15t-25 5q-13 0-25-5t-22-15Zm47-506L179-432h428L393-646Zm399 526q-36 0-61-25.5T706-208q0-27 13.5-51t30.5-47l42-54 44 54q16 23 30 47t14 51q0 37-26 62.5T792-120Z"})),Ls=s=>g.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...s},g.createElement("path",{d:"M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"})),Rs=[["rgb( 0, 0, 0)","Black"],["rgb( 38, 38, 38)","Gray 15"],["rgb( 77, 77, 77)","Grey 30"],["rgb(128, 128, 128)","Grey 50"],["rgb(171, 171, 171)","Grey 67"],["rgb(217, 217, 217)","Grey 85"],["rgb(255, 255, 255)","White"],["rgb(128, 0, 0)","Maroon"],["rgb(209, 0, 0)","English-red"],["rgb(255, 54, 34)","Tomato"],["rgb(252, 60, 3)","Orange-red"],["rgb(255, 140, 105)","Salmon"],["rgb(252, 232, 32)","Cadium-yellow"],["rgb(243, 253, 37)","Lemon yellow"],["rgb(121, 5, 35)","Dark crimson"],["rgb(169, 32, 62)","Deep carmine"],["rgb(255, 140, 0)","Orange"],["rgb(255, 168, 18)","Dark tangerine"],["rgb(217, 144, 88)","Persian orange"],["rgb(194, 178, 128)","Sand"],["rgb(255, 229, 180)","Peach"],["rgb(100, 54, 46)","Bole"],["rgb(108, 41, 52)","Dark cordovan"],["rgb(163, 65, 44)","Chestnut"],["rgb(228, 136, 100)","Dark salmon"],["rgb(255, 195, 143)","Apricot"],["rgb(255, 219, 188)","Unbleached silk"],["rgb(242, 227, 198)","Straw"],["rgb( 53, 19, 13)","Bistre"],["rgb( 84, 42, 14)","Dark chocolate"],["rgb(102, 51, 43)","Burnt sienna"],["rgb(184, 66, 0)","Sienna"],["rgb(216, 153, 12)","Yellow ochre"],["rgb(210, 180, 140)","Tan"],["rgb(232, 204, 144)","Dark wheat"],["rgb( 0, 49, 83)","Prussian blue"],["rgb( 48, 69, 119)","Dark grey blue"],["rgb( 0, 71, 171)","Cobalt blue"],["rgb( 31, 11
137, 254)","Blue"],["rgb(120, 180, 255)","Bright french blue"],["rgb(171, 200, 255)","Bright steel blue"],["rgb(208, 231, 255)","Ice blue"],["rgb( 30, 51, 58)","Medium jungle green"],["rgb( 47, 79, 79)","Dark slate grey"],["rgb( 74, 104, 93)","Dark grullo green"],["rgb( 0, 128, 128)","Teal"],["rgb( 67, 170, 176)","Turquoise"],["rgb(109, 174, 199)","Cerulean frost"],["rgb(173, 217, 186)","Tiffany green"],["rgb( 22, 34, 29)","Gray-asparagus"],["rgb( 36, 48, 45)","Medium dark teal"],["rgb( 74, 104, 93)","Xanadu"],["rgb(119, 198, 121)","Mint"],["rgb(175, 205, 182)","Timberwolf"],["rgb(185, 245, 246)","Celeste"],["rgb(193, 255, 234)","Aquamarine"],["rgb( 29, 52, 35)","Cal Poly Pomona"],["rgb( 1, 68, 33)","Forest green"],["rgb( 42, 128, 0)","Napier green"],["rgb(128, 128, 0)","Olive"],["rgb( 65, 156, 105)","Sea green"],["rgb(189, 246, 29)","Green-yellow"],["rgb(231, 244, 134)","Bright chartreuse"],["rgb(138, 23, 137)","Purple"],["rgb( 78, 39, 138)","Violet"],["rgb(193, 75, 110)","Dark thulian pink"],["rgb(222, 49, 99)","Cerise"],["rgb(255, 20, 147)","Deep pink"],["rgb(255, 102, 204)","Rose pink"],["rgb(255, 203, 219)","Pink"],["rgb(255, 255, 255)","White"],["rgb(229, 17, 1)","RGB Red"],["rgb( 0, 255, 0)","RGB Green"],["rgb( 0, 0, 255)","RGB Blue"],["rgb( 0, 255, 255)","CMYK Cyan"],["rgb(255, 0, 255)","CMYK Magenta"],["rgb(255, 255, 0)","CMYK Yellow"]];let ie=[];for(let s=0;s<7;s++){for(let a=0;a<11;a++)ie.push(Rs[a*7+s]);ie.push(null)}function Fs(s,a){let t=s.split(","),o=t[0].match(/:(.*?);/)[1],c=atob(t[1]),u=c.length,d=new Uint8Array(u);for(;u--;)d[u]=c.charCodeAt(u);return new File([d],a,{type:o})}const ye={normal:[500,500,"Square 500"],tootbanner:[702,330,"Tootbanner"],s640x480:[640,480,"640Ã480 - 480p"],s800x600:[800,600,"800Ã600 - SVGA"],s720x480:[720,405,"720x405 - 16:9"]},Ps=s=>({options:s.getIn(["compose","doodle"])}),Bs=s=>({setOpt:a=>s(tt(a)),submit:a=>s(et([a]))});class Oe extends Se{constructor(){super(...arguments);b(this,"handleKeyUp",t=>{if(t.target.nodeName!=="INPUT"){if(t.key==="Delete"){t.preventDefault(),this.handleClearBtn();return}(t.key==="Backspace"||t.key==="z"&&(t.ctrlKey||t.metaKey))&&(t.preventDefault(),this.undo()),(t.key==="Control"||t.key==="Meta")&&(this.controlHeld=!1,this.swapped=!1),t.key==="Shift"&&(this.shiftHeld=!1,this.mode="draw")}});b(this,"handleKeyDown",t=>{(t.key==="Control"||t.key==="Meta")&&(this.controlHeld=!0,this.swapped=!0),t.key==="Shift"&&(this.shiftHeld=!0,this.mode="fill")});b(this,"setCanvasRef",t=>{this.canvas=t,t&&(t.addEventListener("dirty",()=>{this.saveUndo(),this.sketcher._dirty=!1}),t.addEventListener("click",()=>{this.mode==="fill"&&this.saveUndo()}),t.addEventListener("contextmenu",o=>{o.preventDefault()}),t.addEventListener("mousedown",o=>{o.button===2&&(this.swapped=!0)}),t.addEventListener("mouseup",o=>{o.button===2&&(this.swapped=this.controlHeld)}),this.initSketcher(t),this.mode="draw")});b(this,"onDoneButton",()=>{const t=this.sketcher.toImage(),o=Fs(t,"doodle.png");this.props.submit(o),this.props.onClose()});b(this,"onCancelButton",()=>{this.undos.length>1&&!confirm("Discard doodle? All changes will be lost!")||this.props.onClose()});b(this,"clearScreen",()=>{this.ctx.fillStyle=this.bg,this.ctx.fillRect(-1,-1,this.canvas.width+2,this.canvas.height+2),this.undos=[],this.doSaveUndo()});b(this,"undo",()=>{if(this.undos.length>1){this.undos.pop();const t=this.undos.pop();this.sketcher.clear(),this.ctx.putImageData(t,0,0),this.doSaveUndo()}});b(this,"doSaveUndo",()=>{this.undos.push(this.ctx.getImageData(0,0,this.canvas.width,this.canvas.height))});b(this,"saveUndo",it(()=>{this.doSaveUndo()},100));b(this,"onPaletteClick",t=>{const o=t.target.dataset.color;this.controlHeld?this.bg=o:this.fg=o,t.target.blur(),t.preventDefault()});b(this,"onPaletteRClick",t=>{this.bg=t.target.dataset.color,t.target.blur(),t.preventDefault()});b(this,"setModeDraw",t=>{this.mode="draw",t.target.blur()});
13b(this,"setModeFill",t=>{this.mode="fill",t.target.blur()});b(this,"tglSmooth",t=>{this.smoothing=!this.smoothing,t.target.blur()});b(this,"tglAdaptive",t=>{this.adaptiveStroke=!this.adaptiveStroke,t.target.blur()});b(this,"setWeight",t=>{this.weight=+t.target.value||1});b(this,"changeSize",t=>{let o=t.target.value;o!==this.oldSize&&(this.undos.length>1&&!confirm("Change canvas size? This will erase your current drawing!")||(this.size=o))});b(this,"handleClearBtn",()=>{this.undos.length>1&&!confirm("Clear canvas? This will erase your current drawing!")||this.clearScreen()})}get fg(){return this.props.options.get("fg")}set fg(t){this.props.setOpt({fg:t})}get bg(){return this.props.options.get("bg")}set bg(t){this.props.setOpt({bg:t})}get swapped(){return this.props.options.get("swapped")}set swapped(t){this.props.setOpt({swapped:t})}get mode(){return this.props.options.get("mode")}set mode(t){this.props.setOpt({mode:t})}get weight(){return this.props.options.get("weight")}set weight(t){this.props.setOpt({weight:t})}get opacity(){return this.props.options.get("opacity")}set opacity(t){this.props.setOpt({opacity:t})}get adaptiveStroke(){return this.props.options.get("adaptiveStroke")}set adaptiveStroke(t){this.props.setOpt({adaptiveStroke:t})}get smoothing(){return this.props.options.get("smoothing")}set smoothing(t){this.props.setOpt({smoothing:t})}get size(){return this.props.options.get("size")}set size(t){this.props.setOpt({size:t})}componentDidMount(){this.controlHeld=!1,this.shiftHeld=!1,this.swapped=!1,window.addEventListener("keyup",this.handleKeyUp,!1),window.addEventListener("keydown",this.handleKeyDown,!1)}componentWillUnmount(){window.removeEventListener("keyup",this.handleKeyUp,!1),window.removeEventListener("keydown",this.handleKeyDown,!1),this.sketcher&&this.sketcher.destroy()}initSketcher(t=null){const o=ye[this.size];this.sketcher&&this.sketcher.destroy(),this.sketcher=new Es(t||this.canvas,o[0],o[1]),t&&(this.ctx=this.sketcher.context,this.updateSketcherSettings()),this.clearScreen()}updateSketcherSettings(){this.sketcher&&(this.oldSize!==this.size&&this.initSketcher(),this.sketcher.color=this.swapped?this.bg:this.fg,this.sketcher.opacity=this.opacity,this.sketcher.weight=this.weight,this.sketcher.mode=this.mode,this.sketcher.smoothing=this.smoothing,this.sketcher.adaptiveStroke=this.adaptiveStroke,this.oldSize=this.size)}render(){return this.updateSketcherSettings(),e.jsxs("div",{className:"modal-root__modal doodle-modal",children:[e.jsx("div",{className:"doodle-modal__container",children:e.jsx("canvas",{ref:this.setCanvasRef})}),e.jsxs("div",{className:"doodle-modal__action-bar",children:[e.jsxs("div",{className:"doodle-toolbar",children:[e.jsx(D,{text:"Done",onClick:this.onDoneButton}),e.jsx(D,{text:"Cancel",onClick:this.onCancelButton})]}),e.jsx("div",{className:"filler"}),e.jsxs("div",{className:"doodle-toolbar with-inputs",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"dd_smoothing",children:"Smoothing"}),e.jsx("span",{className:"val",children:e.jsx("input",{type:"checkbox",id:"dd_smoothing",onChange:this.tglSmooth,checked:this.smoothing})})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"dd_adaptive",children:"Adaptive"}),e.jsx("span",{className:"val",children:e.jsx("input",{type:"checkbox",id:"dd_adaptive",onChange:this.tglAdaptive,checked:this.adaptiveStroke})})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"dd_weight",children:"Weight"}),e.jsx("span",{className:"val",children:e.jsx("input",{type:"number",min:1,id:"dd_weight",value:this.weight,onChange:this.setWeight})})]}),e.jsx("div",{children:e.jsx("select",{"aria-label":"Canvas size",onInput:this.changeSize,defaultValue:this.size,children:Object.values(As(ye,(t,o)=>e.jsx("option",{value:o,children:t[2]},o)))})})]}),e.jsxs("div",{className:"doodle-toolbar",children:[e.jsx(z,{icon:"pencil",iconComponent:Gt,title:"Draw",label:"Draw",onClick:this.setModeDraw,size:18,active:this.mode==="draw",inverted:!0}),e.jsx(z,{icon:"bath",iconComponent:Os,title:"Fill",label:"Fill",onClick:this.setModeFill,size:18,active:this.mode==="fill",inverted:!0}),e.jsx(z,{icon:"undo",iconComponent:Ls,title:"Undo",label:"Undo",onClick:this.undo,size:18,inverted:!0}),e.jsx(z,{icon:"trash",iconComponent:zt,title:"Clear",label:"Clear",onClick:this.handleClearBtn,size:18,inverted:!0})]}),e.jsx("div",{className:"doodle-palette",children:ie.map((t,o)=>t===null?e.jsx("br",{},o):e.jsx("button",{style:{backgroundColor:t[0]},onClick:this.onPaletteClick,onContextMenu:this.onPaletteRClick,"data-color":t[0],title:t[1],className:O({foreground:this.fg===t[0],background:this.bg===t[0]})},o))})]})]})}}b(Oe,"propTypes",{options:oe.map,onClose:I.func.isRequired,setOpt:I.func.isRequired,submit:I.func.isRequired});const Us=G(Ps,Bs)(Oe),qs=j({favourite:{id:"status.favourite",defaultMessage:"Favorite"}}),Hs=({status:s,onFavourite:a,onClose:t})=>{const o=N(),c=s.get("id"),u=g.useCallback(()=>{a(s),t()},[t,a,s]),d=g.useCallback(()=>{t()},[t]);return e.jsxs("div",{className:"modal-root__modal safety-action-modal",children:[e.jsxs("div",{className:"safety-action-modal__top",children:[e.jsxs("div",{className:"safety-action-modal__header",children:[e.jsx("div",{className:"safety-action-modal__header__icon",children:e.jsx(B,{icon:ue,id:"star"})}),e.jsxs("div",{children:[e.jsx("h1",{children:e.jsx(y,{id:"favourite_modal.favourite",defaultMessage:"Favourite post?"})}),e.jsx("div",{children:e.jsx(y,{id:"boost_modal.combo",defaultMessage:"You can press {combo} to skip this next time",values:{combo:e.jsxs("span",{className:"hotkey-combination",children:[e.jsx("kbd",{children:"Shift"}),"+",e.jsx(B,{id:"star",icon:ue})]})}})})]})]}),e.jsx("div",{className:"safety-action-modal__status",children:e.jsx(De,{statusId:c})})]}),e.jsx("div",{className:O("safety-action-modal__bottom"),children:e.jsxs("div",{className:"safety-action-modal__actions",children:[e.jsx("div",{className:"spacer"}),e.jsx("button",{onClick:d,className:"link-button",children:e.jsx(y,{id:"confirmation_modal.cancel",defaultMessage:"Cancel"})}),e.jsx(D,{onClick:u,text:o.formatMessage(qs.favourite),autoFocus:!0})]})})]})},$s=j({close:{id:"lightbox.close",defaultMessage:"Close"}}),zs=({src:s,alt:a,onClose:t})=>{const o=N(),[c,u]=g.useState(!1),d=g.useCallback(()=>{u(i=>!i)},[u]),l=O("media-modal__navigation",{"media-modal__navigation--hidden":c});return e.jsxs("div",{className:"modal-root__modal media-modal",children:[e.jsx("div",{className:"media-modal__closer",role:"presentation",onClick:t,children:e.jsx(lt,{src:s,width:400,height:400,alt:a,onClick:d})}),e.jsx("div",{className:l,children:e.jsx("div",{className:"media-modal__buttons",children:e.jsx(z,{className:"media-modal__close",title:o.formatMessage($s.close),icon:"times",iconComponent:Vt,onClick:t})})})]})},we=({loading:s,onClose:a,onRetry:t})=>{const o=g.useCallback(()=>{a(void 0,!1)},[a]),c=g.useCallback(()=>{t&&t()},[t]);return e.jsx("div",{className:"modal-root__modal modal-placeholder","aria-busy":s,children:s?e.jsx(Ee,{}):e.jsxs("div",{className:"modal-placeholder__error",children:[e.jsx(Wt,{src:"/oops.gif",staticSrc:"/oops.png",className:"modal-placeholder__error__image"}),e.jsxs("div",{className:"modal-placeholder__error__message",children:[e.jsx("p",{children:e.jsx(y,{id:"bundle_modal_error.message",defaultMessage:"Something went wrong while loading this screen."})}),e.jsxs("div",{className:"modal-placeholder__error__message__actions",children:[e.jsx(D,{onClick:c,children:e.jsx(y,{id:"bundle_modal_error.retry",defaultMessage:"Try again"})}),e.jsx(D,{onClick:o,className:"button button-tertiary",children:e.jsx(y,{id:"bundle_modal_error.close",defaultMessage:"Close"})})]})]})]})})},Gs=(s,{statusId:a})=>({status:s.getIn(["statuses",a])});class Le extends Se{componentDidMount(){const{media:a,onChangeBackgroun
13dColor:t}=this.props,o=Ne(a.get("blurhash"));o&&t(o)}componentWillUnmount(){this.props.onChangeBackgroundColor(null)}render(){const{media:a,status:t,onClose:o}=this.props,c=this.props.options||{},u=t.getIn(["translation","language"])||t.get("language"),d=a.getIn(["translation","description"])||a.get("description");return e.jsxs("div",{className:"modal-root__modal video-modal",children:[e.jsx("div",{className:"video-modal__container",children:e.jsx(ke,{preview:a.get("preview_url"),frameRate:a.getIn(["meta","original","frame_rate"]),blurhash:a.get("blurhash"),src:a.get("url"),startTime:c.startTime,startPlaying:c.autoPlay,startVolume:c.defaultVolume,onCloseVideo:o,autoFocus:!0,detailed:!0,alt:d,lang:u})}),e.jsx("div",{className:"media-modal__overlay",children:t&&e.jsx(Te,{statusId:t.get("id"),withOpenButton:!0,onClose:o})})]})}}b(Le,"propTypes",{media:oe.map.isRequired,statusId:I.string,status:oe.map,options:I.shape({startTime:I.number,autoPlay:I.bool,defaultVolume:I.number}),onClose:I.func.isRequired,onChangeBackgroundColor:I.func.isRequired});const Vs=G(Gs,null,null,{forwardRef:!0})(Le),Ws={MEDIA:()=>Promise.resolve({default:dt}),VIDEO:()=>Promise.resolve({default:Vs}),AUDIO:()=>Promise.resolve({default:cs}),IMAGE:()=>Promise.resolve({default:zs}),BOOST:()=>Promise.resolve({default:ds}),FAVOURITE:()=>Promise.resolve({default:Hs}),DOODLE:()=>Promise.resolve({default:Us}),CONFIRM:()=>Promise.resolve({default:R}),CONFIRM_DELETE_STATUS:()=>Promise.resolve({default:us}),CONFIRM_DELETE_LIST:()=>Promise.resolve({default:ms}),CONFIRM_REPLY:()=>Promise.resolve({default:ps}),CONFIRM_EDIT_STATUS:()=>Promise.resolve({default:vs}),CONFIRM_UNFOLLOW:()=>Promise.resolve({default:_s}),CONFIRM_CLEAR_NOTIFICATIONS:()=>Promise.resolve({default:bs}),CONFIRM_LOG_OUT:()=>Promise.resolve({default:ys}),CONFIRM_FOLLOW_TO_LIST:()=>Promise.resolve({default:ws}),CONFIRM_MISSING_ALT_TEXT:()=>Promise.resolve({default:Cs}),MUTE:At,BLOCK:It,DOMAIN_BLOCK:Dt,REPORT:Et,SETTINGS:Tt,DEPRECATED_SETTINGS:()=>Promise.resolve({default:js}),ACTIONS:()=>Promise.resolve({default:ls}),EMBED:Nt,FOCAL_POINT:()=>Promise.resolve({default:Ie}),LIST_ADDER:St,COMPARE_HISTORY:jt,FILTER:Mt,SUBSCRIBED_LANGUAGES:kt,INTERACTION:Ct,CLOSED_REGISTRATIONS:wt,IGNORE_NOTIFICATIONS:yt,ANNUAL_REPORT:xt};class Ks extends g.PureComponent{constructor(){super(...arguments);b(this,"state",{backgroundColor:null});b(this,"setBackgroundColor",t=>{this.setState({backgroundColor:t})});b(this,"renderLoading",()=>{const{onClose:t}=this.props;return e.jsx(we,{loading:!0,onClose:t})});b(this,"renderError",t=>{const{onClose:o}=this.props;return e.jsx(we,{...t,onClose:o})});b(this,"handleClose",(t=!1)=>{var u,d;const{onClose:o}=this.props,c=(d=(u=this._modal)==null?void 0:u.getCloseConfirmationMessage)==null?void 0:d.call(u);o(c,t)});b(this,"setModalRef",t=>{this._modal=t});b(this,"noop",()=>{})}render(){const{type:t,props:o,ignoreFocus:c}=this.props,{backgroundColor:u}=this.state,d=!!t;return e.jsx(ct,{backgroundColor:u,onClose:o&&o.noClose?this.noop:this.handleClose,noEsc:o?o.noEsc:!1,ignoreFocus:c,children:d&&e.jsxs(e.Fragment,{children:[e.jsx(ss,{fetchComponent:Ws[t],loading:this.renderLoading,error:this.renderError,renderDelay:200,children:l=>e.jsx(l,{...o,onChangeBackgroundColor:this.setBackgroundColor,onClose:this.handleClose,ref:this.setModalRef})}),e.jsx(nt,{children:e.jsx("meta",{name:"robots",content:"noindex"})})]})})}}const Ys={},Zs=s=>({ignoreFocus:s.getIn(["modal","ignoreFocus"]),type:s.getIn(["modal","stack",0,"modalType"],null),props:s.getIn(["modal","stack",0,"modalProps"],Ys)}),Xs=s=>({onClose(a,t=!1){s(a?je({previousModalProps:a.props,modalType:"CONFIRM",modalProps:{message:a.message,confirm:a.confirm,onConfirm:()=>s(le({modalType:void 0,ignoreFocus:{ignoreFocus:t}}))}}):le({modalType:void 0,ignoreFocus:{ignoreFocus:t}}))}}),Ta=G(Zs,Xs)(Ks);export{Sa as A,ss as B,Na as L,Ta as M}; 14//# sourceMappingURL=modal_container-DNg1zwRW.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.