Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 832
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
var je=Object.defineProperty;var ye=(t,s,a)=>s in t?je(t,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[s]=a;var N=(t,s,a)=>ye(t,typeof s!="symbol"?s+"":s,a);import{j as e,_ as W}from"./client-wT6vtYO_.js";import{u as x,r as l,d as h}from"./index-BdTwX--g.js";import{c as I}from"./index-DizoKcfL.js";import{a as C,u as j,a0 as Ne,i as O,a1 as Te,a2 as we,I as Y,O as Ie,a3 as ke,a4 as Ee,a5 as Ae,d as Re,a6 as Z,h as Q,V as ie,c as le,a7 as X,a8 as Se,a9 as Pe,aa as Le,ab as De,ac as Fe,ad as Oe,ae as Be,af as re,ag as Ue,b as $e,p as He,q as z,ah as J}from"./useSelectableClick-DSv4aXzQ.js";import{H as qe}from"./Helmet-BPcSXOin.js";import{G as Ve,g as de,F as ce,Z as Ge,M as Ye,a as Ke}from"./media_modal-Bdm5cOSE.js";import{i as We}from"./react-textarea-autosize.browser.esm-BstEnzvw.js";import{d as Ze,a as Qe,P as Xe}from"./compose_form_container-FkPryyNu.js";import{B as k}from"./index-IjR2JCxi.js";import{L as me}from"./loading_indicator-CoYIRvVm.js";import{S as $}from"./skeleton-D9NbTYr9.js";import{I as ze,J as Je,Q as et,U as tt,V as st,W as at,X as ot,Y as nt,Z as it,_ as lt,$ as rt,a0 as dt,a1 as ct,a2 as mt,a3 as ut,a4 as gt,a5 as ft}from"./content_warning-KGK9SYUe.js";import{m as ee}from"./initial_state-CaZA8Ule.js";import{b as pt}from"./index-DgPXgYyr.js";import{M as p}from"./message-UFwkQlnu.js";import{L as ht,c as _t,P as w}from"./short_number-w3W5phxu.js";import{E as xt}from"./embedded_status-Cqxh-ngY.js";import{a as Mt}from"./api-BktM5Ego.js";import{S as Ct}from"./close-BsPe8EbX.js";import{G as vt}from"./gif-BypJKgpt.js";const H=(t,s,a)=>typeof s=="object"?t.formatMessage(s,a):s,bt=({alert:{key:t,title:s,message:a,values:o,action:n,onClick:i},dismissAfter:d})=>{const r=j(),c=x(),[u,g]=l.useState(!1);return l.useEffect(()=>{const m=setTimeout(()=>{g(!0)},1);return()=>{clearTimeout(m)}},[]),l.useEffect(()=>{const m=setTimeout(()=>{g(!1),setTimeout(()=>{r(Ne({key:t}))},500)},d);return()=>{clearTimeout(m)}},[r,g,t,d]),e.jsx("div",{className:I("notification-bar",{"notification-bar-active":u}),children:e.jsxs("div",{className:"notification-bar-wrapper",children:[s&&e.jsx("span",{className:"notification-bar-title",children:H(c,s,o)}),e.jsx("span",{className:"notification-bar-message",children:H(c,a,o)}),n&&e.jsx("button",{className:"notification-bar-action",onClick:i,children:H(c,n,o)})]})})},ks=()=>{const t=C(s=>s.alerts);return t.length===0?null:e.jsx("div",{className:"notification-list",children:t.map((s,a)=>e.jsx(bt,{alert:s,dismissAfter:5e3+a*1e3},s.key))})},jt="BUNDLE_FETCH_REQUEST",yt="BUNDLE_FETCH_SUCCESS",Nt="BUNDLE_FETCH_FAIL";function Tt(t){return{type:jt,skipLoading:t}}function wt(t){return{type:yt,skipLoading:t}}function It(t,s){return{type:Nt,error:t,skipLoading:s}}const kt=t=>({onFetch(){t(Tt())},onFetchSuccess(){t(wt())},onFetchFail(s){t(It(s))}}),Et=O(null,kt)(ze),At=(t,s)=>({loading:t.get("loadingBar")[s.scope||"default"]}),Es=O(At)(Te.WrappedComponent),Rt=t=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...t},l.createElement("path",{d:"M424-320q0-81 14.5-116.5T500-514q41-36 62.5-62.5T584-637q0-41-27.5-68T480-732q-51 0-77.5 31T365-638l-103-44q21-64 77-111t141-47q105 0 161.5 58.5T698-641q0 50-21.5 85.5T609-475q-49 47-59.5 71.5T539-320H424Zm56 240q-33 0-56.5-23.5T400-160q0-33 23.5-56.5T480-240q33 0 56.5 23.5T560-160q0 33-23.5 56.5T480-80Z"})),St=h({help:{id:"info_button.label",defaultMessage:"Help"}}),Pt=()=>{const t=x(),[s,a]=l.useState(!1),o=l.useRef(null),n=l.useId(),i=l.useCallback(()=>{a(!s)},[s,a]),[d,r]=we(i);return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:I("help-button",{active:s}),ref:o,onClick:i,"aria-expanded":s,"aria-controls":n,"aria-label":t.formatMessage(St.help),children:e.jsx(Y,{id:"",icon:Rt})}),e.jsx(Ie,{show:s,rootClose:!0,placement:"top",onHide:i,offset:[5,5],target:o,children:({props:c})=>e.jsx("div",{...c,className:"dialog-modal__popout prose dropdown-animation",role:"region",id:n,onMouseDown:d,onMouseUp:r,children:e.jsx(p,{id:"info_button.what_is_alt_text",defaultMessage:`What is alt text?
Alt text provides image descriptions for people with vision impairments, low-bandwidth connections, or those seeking extra context.
You can improve accessibility and understanding for everyone by writing clear, concise, and objective alt text.
- Capture important elements
- Summarize text in images
- Use regular sentence structure
- Avoid redundant information
- Focus on trends and key findings in complex visuals (like diagrams or maps)
`,values:{h1:u=>e.jsx("h1",{children:u}),p:u=>e.jsx("p",{children:u}),ul:u=>e.jsx("ul",{children:u}),li:u=>e.jsx("li",{children:u})}})})})]})},D=h({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…"},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"}}),te=1500,Lt=({children:t,onSelectFile:s,mimeTypes:a})=>{const o=l.useRef(null),n=l.useCallback(()=>{var d;(d=o.current)==null||d.click()},[]),i=l.useCallback(d=>{var c;const r=(c=d.target.files)==null?void 0:c[0];r&&s(r)},[s]);return e.jsxs("label",{children:[e.jsx(k,{onClick:n,children:t}),e.jsx("input",{id:"upload-modal__thumbnail",ref:o,type:"file",accept:a,onChange:i,style:{display:"none"}})]})},Dt=({mediaId:t,position:s,onPositionChange:a})=>{const o=l.useRef(!1),n=l.useRef(null),[i,d]=s,r=Re({to:{left:`${i*100}%`,top:`${d*100}%`},immediate:o.current}),c=C(M=>M.compose.get("media_attachments").find(v=>v.get("id")===t)),u=C(M=>ee?M.accounts.get(ee):void 0),[g,m]=l.useState(!1),b=l.useCallback(M=>{n.current=M},[]),_=l.useCallback(M=>{if(M.button!==0)return;const v=A=>{const{x:R,y:P}=Z(n.current,A);o.current=!0,a([R,P])},T=()=>{m(!1),o.current=!1,document.removeEventListener("mouseup",T),document.removeEventListener("mousemove",v)},{x:B,y:E}=Z(n.current,M.nativeEvent);m(!0),a([B,E]),document.addEventListener("mouseup",T),document.addEventListener("mousemove",v)},[m,a]);return c?c.get("type")==="image"?e.jsxs("div",{className:I("focal-point",{dragging:g}),children:[e.jsx("img",{ref:b,draggable:!1,src:c.get("url"),alt:"",role:"presentation",onMouseDown:_}),e.jsx(Q.div,{className:"focal-point__reticle",style:r})]}):c.get("type")==="gifv"?e.jsxs("div",{className:I("focal-point",{dragging:g}),children:[e.jsx(Ve,{ref:b,src:c.get("url"),alt:"",onMouseDown:_}),e.jsx(Q.div,{className:"focal-point__reticle",style:r})]}):c.get("type")==="video"?e.jsx(ie,{preview:c.get("preview_url"),frameRate:c.getIn(["meta","original","frame_rate"]),aspectRatio:`${c.getIn(["meta","original","width"])} / ${c.getIn(["meta","original","height"])}`,blurhash:c.get("blurhash"),src:c.get("url"),detailed:!0,editable:!0}):c.get("type")==="audio"?e.jsx(le,{src:c.get("url"),poster:c.get("preview_url")??(u==null?void 0:u.avatar_static),duration:c.getIn(["meta","original","duration"],0),backgroundColor:c.getIn(["meta","colors","background"]),foregroundColor:c.getIn(["meta","colors","foreground"]),accentColor:c.getIn(["meta","colors","accent"]),editable:!0}):null:null},ue=l.forwardRef(({mediaId:t,previousDescription:s,previousPosition:a,onClose:o},n)=>{const i=x(),d=j(),r=C(f=>f.compose.get("media_attachments").find(U=>U.get("id")===t)),c=C(f=>f.compose.get("language")),u=(r==null?void 0:r.getIn(["meta","focus","x"],0))??0,g=(r==null?void 0:r.getIn(["meta","focus","y"],0))??0,[m,b]=l.useState(s??(r==null?void 0:r.get("description"))??""),[_,M]=l.useState(a??[u/2+.5,g/-2+.5]),[v,T]=l.useState(!1),[B,E]=l.useState(!1),A=l.useRef(!!(s||a)),R=r==null?void 0:r.get("type"),P=Ze.length(m)<=te,pe=l.useCallback(f=>{b(f.target.value),A.current=!0},[b]),he=l.useCallback(f=>{d(ke(t,f))},[d,t]),_e=l.useCallback(f=>{M(f),A.current=!0},[M]),L=l.useCallback(()=>{E(!0),d(Ee({id:t,description:m,focus:`${((_[0]-.5)*2).toFixed(2)},${((_[1]-.5)*-2).toFixed(2)}`})).then(()=>(E(!1),A.current=!1,o(),"")).catch(f=>{E(!1),d(Ae(f))})},[d,E,t,o,_,m]),xe=l.useCallback(f=>{(f.ctrlKey||f.metaKey)&&f.key==="Enter"&&(f.preventDefault(),P&&L())},[L,P]),Me=l.useCallback(()=>{T(!0),Je().then(async({createWorker:f})=>{const[U,Ce]=await Promise.all([W(()=>import("./worker.min-CsIQe9T3.js"),[]),W(()=>import("./tesseract-core.wasm-B2697XUV.js"),[])]),K=await f("eng",1,{workerPath:U.default,corePath:Ce.default,langPath:`${pt}/ocr/lang-data`,cacheMethod:"write"}),ve=URL.createObjectURL(r==null?void 0:r.get("file")),be=await K.recognize(ve);return b(be.data.text),T(!1),await K.terminate(),""}).catch(()=>{T(!1)})},[b,T,r]);return l.useImperativeHandle(n,()=>({getCloseConfirmationMessage:()=>A.current?{message:i.formatMessage(D.discardMessage),confirm:i.formatMessage(D.discardConfirm),props:{previousDescription:m,previousPosition:_}}:null}),[i,m,_]),e.jsxs("div",{className:"modal-root__modal dialog-modal",children:[e.jsxs("div",{className:"dialog-modal__header",children:[e.jsx(k,{onClick:L,disabled:!P,children:B?e.jsx(me,{}):e.jsx(p,{id:"alt_text_modal.done",defaultMessage:"Done"})}),e.jsx("span",{className:"dialog-modal__header__title",children:e.jsx(p,{id:"alt_text_modal.add_alt_text",defaultMessage:"Add alt text"})}),e.jsx(k,{secondary:!0,onClick:o,children:e.jsx(p,{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(Dt,{mediaId:t,position:_,onPositionChange:_e}),(R==="audio"||R==="video")&&e.jsx(Lt,{onSelectFile:he,mimeTypes:"image/jpeg,image/png,image/gif,image/heic,image/heif,image/webp,image/avif",children:e.jsx(p,{id:"alt_text_modal.change_thumbnail",defaultMessage:"Change thumbnail"})})]}),e.jsx("form",{className:"dialog-modal__content__form simple_form",onSubmit:L,children:e.jsxs("div",{className:"input",children:[e.jsxs("div",{className:"label_input",children:[e.jsx(We,{id:"description",value:v?" ":m,onChange:pe,onKeyUp:xe,lang:c,placeholder:i.formatMessage(R==="audio"?D.placeholderHearing:D.placeholderVisual),minRows:3,disabled:v}),v&&e.jsxs("div",{className:"label_input__loading-indicator",children:[e.jsx($,{width:"100%"}),e.jsx($,{width:"100%"}),e.jsx($,{width:"61%"})]})]}),e.jsxs("div",{className:"input__toolbar",children:[e.jsx(Qe,{max:te,text:v?"":m}),e.jsx("div",{className:"spacer"}),e.jsx("button",{className:"link-button",onClick:Me,disabled:R!=="image"||v,children:e.jsx(p,{id:"alt_text_modal.add_text_from_image",defaultMessage:"Add text from image"})}),e.jsx(Pt,{})]})]})})]})]})});ue.displayName="AltTextModal";const Ft=({actions:t,onClick:s})=>e.jsx("div",{className:"modal-root__modal actions-modal",children:e.jsx("ul",{children:t.map((a,o)=>{if(a===null)return e.jsx("li",{className:"dropdown-menu__separator"},`sep-${o}`);const{text:n,dangerous:i}=a;let d;return et(a)?d=e.jsx("button",{onClick:s,"data-index":o,children:n}):tt(a)?d=e.jsx("a",{href:a.href,target:a.target??"_target","data-method":a.method,rel:"noopener",onClick:s,"data-index":o,children:n}):d=e.jsx(ht,{to:a.to,onClick:s,"data-index":o,children:n}),e.jsx("li",{className:I({"dropdown-menu__item--dangerous":i}),children:d},`${n}-${o}`)})})}),Ot=({media:t,statusId:s,options:a,onClose:o,onChangeBackgroundColor:n})=>{const i=C(g=>g.statuses.get(s)),d=i==null?void 0:i.get("account"),r=C(g=>{var m;return d?(m=g.accounts.get(d))==null?void 0:m.avatar_static:void 0});l.useEffect(()=>{const g=de(t.get("blurhash"));return n(g??{r:255,g:255,b:255}),()=>{n(null)}},[t,n]);const c=(i==null?void 0:i.getIn(["translation","language"]))??(i==null?void 0:i.get("language")),u=t.getIn(["translation","description"])??t.get("description");return e.jsxs("div",{className:"modal-root__modal audio-modal",children:[e.jsx("div",{className:"audio-modal__container",children:e.jsx(le,{src:t.get("url"),alt:u,lang:c,poster:t.get("preview_url")??r,duration:t.getIn(["meta","original","duration"],0),backgroundColor:t.getIn(["meta","colors","background"]),foregroundColor:t.getIn(["meta","colors","foreground"]),accentColor:t.getIn(["meta","colors","accent"]),startPlaying:a.autoPlay})}),e.jsx("div",{className:"media-modal__overlay",children:i&&e.jsx(ce,{statusId:i.get("id"),withOpenButton:!0,onClose:o})})]})},se=h({cancel_reblog:{id:"status.cancel_reblog_private",defaultMessage:"Unboost"},reblog:{id:"status.reblog",defaultMessage:"Boost"}}),Bt=({status:t,onReblog:s,onClose:a})=>{const o=x(),n=C(_=>_.compose.get("default_privacy")),i=t.get("id"),d=t.get("visibility"),[r,c]=l.useState(d==="private"?"private":n),u=l.useCallback(_=>{c(_)},[]),g=l.useCallback(()=>{s(t,r),a()},[a,s,t,r]),m=l.useCallback(()=>{a()},[a]),b=l.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(Y,{icon:X,id:"retweet"})}),e.jsxs("div",{children:[e.jsx("h1",{children:t.get("reblogged")?e.jsx(p,{id:"boost_modal.undo_reblog",defaultMessage:"Unboost post?"}):e.jsx(p,{id:"boost_modal.reblog",defaultMessage:"Boost post?"})}),e.jsx("div",{children:e.jsx(p,{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(Y,{id:"retweet",icon:X})]})}})})]})]}),e.jsx("div",{className:"safety-action-modal__status",children:e.jsx(xt,{statusId:i})})]}),e.jsx("div",{className:I("safety-action-modal__bottom"),children:e.jsxs("div",{className:"safety-action-modal__actions",children:[!t.get("reblogged")&&e.jsx(Xe,{noDirect:!0,value:r,container:b,onChange:u,disabled:d==="private"}),e.jsx("div",{className:"spacer"}),e.jsx("button",{onClick:m,className:"link-button",children:e.jsx(p,{id:"confirmation_modal.cancel",defaultMessage:"Cancel"})}),e.jsx(k,{onClick:g,text:o.formatMessage(t.get("reblogged")?se.cancel_reblog:se.reblog),autoFocus:!0})]})})]})},y=({title:t,message:s,confirm:a,cancel:o,onClose:n,onConfirm:i,secondary:d,onSecondary:r,closeWhenConfirm:c=!0})=>{const u=l.useCallback(()=>{c&&n(),i()},[n,i,c]),g=l.useCallback(()=>{n(),r==null||r()},[n,r]),m=l.useCallback(()=>{n()},[n]);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:t}),e.jsx("p",{children:s})]})}),e.jsx("div",{className:"safety-action-modal__bottom",children:e.jsxs("div",{className:"safety-action-modal__actions",children:[e.jsx("button",{onClick:m,className:"link-button",children:o??e.jsx(p,{id:"confirmation_modal.cancel",defaultMessage:"Cancel"})}),d&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"spacer"}),e.jsx("button",{onClick:g,className:"link-button",children:d})]}),e.jsx(k,{onClick:u,autoFocus:!0,children:a})]})})]})},S=h({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"}}),Ut=({statusId:t,withRedraft:s,onClose:a})=>{const o=x(),n=j(),i=l.useCallback(()=>{n(Se(t,s))},[n,t,s]);return e.jsx(y,{title:o.formatMessage(s?S.deleteAndRedraftTitle:S.deleteTitle),message:o.formatMessage(s?S.deleteAndRedraftMessage:S.deleteMessage),confirm:o.formatMessage(s?S.deleteAndRedraftConfirm:S.deleteConfirm),onConfirm:i,onClose:a})},q=h({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"}}),$t=({listId:t,columnId:s,onClose:a})=>{const o=x(),n=j(),i=_t(),d=l.useCallback(()=>{n(Pe(t)),s?n(Le(s)):i.push("/lists")},[n,i,s,t]);return e.jsx(y,{title:o.formatMessage(q.deleteListTitle),message:o.formatMessage(q.deleteListMessage),confirm:o.formatMessage(q.deleteListConfirm),onConfirm:d,onClose:a})},Ht=h({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"}}),qt=h({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"}}),Vt=h({confirm:{id:"confirmations.discard_draft.confirm",defaultMessage:"Discard and continue"}}),ge=({onConfirm:t,onClose:s})=>{const a=x(),n=C(i=>!!i.compose.get("id"))?Ht:qt;return e.jsx(y,{title:a.formatMessage(n.title),message:a.formatMessage(n.message),cancel:a.formatMessage(n.cancel),confirm:a.formatMessage(Vt.confirm),onConfirm:t,onClose:s})},Gt=({status:t,onClose:s})=>{const a=j(),o=l.useCallback(()=>{a(Fe(t))},[a,t]);return e.jsx(ge,{onConfirm:o,onClose:s})},Yt=({statusId:t,onClose:s})=>{const a=j(),o=l.useCallback(()=>{a(De(t))},[a,t]);return e.jsx(ge,{onConfirm:o,onClose:s})},ae=h({unfollowTitle:{id:"confirmations.unfollow.title",defaultMessage:"Unfollow user?"},unfollowConfirm:{id:"confirmations.unfollow.confirm",defaultMessage:"Unfollow"}}),Kt=({account:t,onClose:s})=>{const a=x(),o=j(),n=l.useCallback(()=>{o(Oe(t.id))},[o,t.id]);return e.jsx(y,{title:a.formatMessage(ae.unfollowTitle),message:e.jsx(p,{id:"confirmations.unfollow.message",defaultMessage:"Are you sure you want to unfollow {name}?",values:{name:e.jsxs("strong",{children:["@",t.acct]})}}),confirm:a.formatMessage(ae.unfollowConfirm),onConfirm:n,onClose:s})},V=h({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"}}),Wt=({onClose:t})=>{const s=x(),a=j(),o=l.useCallback(()=>{a(Be())},[a]);return e.jsx(y,{title:s.formatMessage(V.clearTitle),message:s.formatMessage(V.clearMessage),confirm:s.formatMessage(V.clearConfirm),onConfirm:o,onClose:t})};async function Zt(){try{const t=await Mt(!1).delete("/auth/sign_out",{headers:{Accept:"application/json"},withCredentials:!0});t.status===200&&t.data.redirect_to?window.location.href=t.data.redirect_to:console.error("Failed to log out, got an unexpected non-redirect response from the server",t)}catch(t){console.error("Failed to log out, response was an error",t)}}const G=h({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"}}),Qt=({onClose:t})=>{const s=x(),a=l.useCallback(()=>{Zt()},[]);return e.jsx(y,{title:s.formatMessage(G.logoutTitle),message:s.formatMessage(G.logoutMessage),confirm:s.formatMessage(G.logoutConfirm),onConfirm:a,onClose:t})},oe=h({title:{id:"confirmations.follow_to_list.title",defaultMessage:"Follow user?"},confirm:{id:"confirmations.follow_to_list.confirm",defaultMessage:"Follow and add to list"}}),Xt=({accountId:t,onConfirm:s,onClose:a})=>{const o=x(),n=C(i=>i.accounts.get(t));return e.jsx(y,{title:o.formatMessage(oe.title),message:e.jsx(p,{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:["@",n==null?void 0:n.acct]})}}),confirm:o.formatMessage(oe.confirm),onConfirm:s,onClose:a})},F=h({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."},secondary:{id:"confirmations.missing_alt_text.secondary",defaultMessage:"Post anyway"}}),zt=({onClose:t})=>{const s=x(),a=j(),o=C(d=>{var r;return(r=d.compose.get("media_attachments").find(c=>["image","gifv"].includes(c.get("type"))&&(c.get("description")??"").length===0))==null?void 0:r.get("id")}),n=l.useCallback(()=>{a(re({modalType:"FOCAL_POINT",modalProps:{mediaId:o}}))},[a,o]),i=l.useCallback(()=>{a(Ue())},[a]);return e.jsx(y,{title:s.formatMessage(F.title),message:s.formatMessage(F.message),confirm:s.formatMessage(F.confirm),secondary:s.formatMessage(F.secondary),onConfirm:n,onSecondary:i,onClose:t})},Jt=h({close:{id:"lightbox.close",defaultMessage:"Close"}}),es=({src:t,alt:s,onClose:a})=>{const o=x(),[n,i]=l.useState(!1),d=l.useCallback(()=>{i(c=>!c)},[i]),r=I("media-modal__navigation",{"media-modal__navigation--hidden":n});return e.jsxs("div",{className:"modal-root__modal media-modal",children:[e.jsx("div",{className:"media-modal__closer",role:"presentation",onClick:a,children:e.jsx(Ge,{src:t,width:400,height:400,alt:s,onClick:d})}),e.jsx("div",{className:r,children:e.jsx("div",{className:"media-modal__buttons",children:e.jsx($e,{className:"media-modal__close",title:o.formatMessage(Jt.close),icon:"times",iconComponent:Ct,onClick:a})})})]})},ne=({loading:t,onClose:s,onRetry:a})=>{const o=l.useCallback(()=>{s(void 0,!1)},[s]),n=l.useCallback(()=>{a&&a()},[a]);return e.jsx("div",{className:"modal-root__modal modal-placeholder","aria-busy":t,children:t?e.jsx(me,{}):e.jsxs("div",{className:"modal-placeholder__error",children:[e.jsx(vt,{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(p,{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(k,{onClick:n,children:e.jsx(p,{id:"bundle_modal_error.retry",defaultMessage:"Try again"})}),e.jsx(k,{onClick:o,className:"button button-tertiary",children:e.jsx(p,{id:"bundle_modal_error.close",defaultMessage:"Close"})})]})]})]})})},ts=(t,{statusId:s})=>({status:t.getIn(["statuses",s])});class fe extends He{componentDidMount(){const{media:s,onChangeBackgroundColor:a}=this.props,o=de(s.get("blurhash"));o&&a(o)}componentWillUnmount(){this.props.onChangeBackgroundColor(null)}render(){const{media:s,status:a,onClose:o}=this.props,n=this.props.options||{},i=a.getIn(["translation","language"])||a.get("language"),d=s.getIn(["translation","description"])||s.get("description");return e.jsxs("div",{className:"modal-root__modal video-modal",children:[e.jsx("div",{className:"video-modal__container",children:e.jsx(ie,{preview:s.get("preview_url"),frameRate:s.getIn(["meta","original","frame_rate"]),aspectRatio:`${s.getIn(["meta","original","width"])} / ${s.getIn(["meta","original","height"])}`,blurhash:s.get("blurhash"),src:s.get("url"),startTime:n.startTime,startPlaying:n.autoPlay,startVolume:n.defaultVolume,onCloseVideo:o,autoFocus:!0,detailed:!0,alt:d,lang:i})}),e.jsx("div",{className:"media-modal__overlay",children:a&&e.jsx(ce,{statusId:a.get("id"),withOpenButton:!0,onClose:o})})]})}}N(fe,"propTypes",{media:z.map.isRequired,statusId:w.string,status:z.map,options:w.shape({startTime:w.number,autoPlay:w.bool,defaultVolume:w.number}),onClose:w.func.isRequired,onChangeBackgroundColor:w.func.isRequired});const ss=O(ts,null,null,{forwardRef:!0})(fe),as={MEDIA:()=>Promise.resolve({default:Ke}),VIDEO:()=>Promise.resolve({default:ss}),AUDIO:()=>Promise.resolve({default:Ot}),IMAGE:()=>Promise.resolve({default:es}),BOOST:()=>Promise.resolve({default:Bt}),CONFIRM:()=>Promise.resolve({default:y}),CONFIRM_DELETE_STATUS:()=>Promise.resolve({default:Ut}),CONFIRM_DELETE_LIST:()=>Promise.resolve({default:$t}),CONFIRM_REPLY:()=>Promise.resolve({default:Gt}),CONFIRM_EDIT_STATUS:()=>Promise.resolve({default:Yt}),CONFIRM_UNFOLLOW:()=>Promise.resolve({default:Kt}),CONFIRM_CLEAR_NOTIFICATIONS:()=>Promise.resolve({default:Wt}),CONFIRM_LOG_OUT:()=>Promise.resolve({default:Qt}),CONFIRM_FOLLOW_TO_LIST:()=>Promise.resolve({default:Xt}),CONFIRM_MISSING_ALT_TEXT:()=>Promise.resolve({default:zt}),MUTE:ft,BLOCK:gt,DOMAIN_BLOCK:ut,REPORT:mt,ACTIONS:()=>Promise.resolve({default:Ft}),EMBED:ct,FOCAL_POINT:()=>Promise.resolve({default:ue}),LIST_ADDER:dt,COMPARE_HISTORY:rt,FILTER:lt,SUBSCRIBED_LANGUAGES:it,INTERACTION:nt,CLOSED_REGISTRATIONS:ot,IGNORE_NOTIFICATIONS:at,ANNUAL_REPORT:st};class os extends l.PureComponent{constructor(){super(...arguments);N(this,"state",{backgroundColor:null});N(this,"setBackgroundColor",a=>{this.setState({backgroundColor:a})});N(this,"renderLoading",()=>{const{onClose:a}=this.props;return e.jsx(ne,{loading:!0,onClose:a})});N(this,"renderError",a=>{const{onClose:o}=this.props;return e.jsx(ne,{...a,onClose:o})});N(this,"handleClose",(a=!1)=>{var i,d;const{onClose:o}=this.props,n=(d=(i=this._modal)==null?void 0:i.getCloseConfirmationMessage)==null?void 0:d.call(i);o(n,a)});N(this,"setModalRef",a=>{this._modal=a})}render(){const{type:a,props:o,ignoreFocus:n}=this.props,{backgroundColor:i}=this.state,d=!!a;return e.jsx(Ye,{backgroundColor:i,onClose:this.handleClose,ignoreFocus:n,children:d&&e.jsxs(e.Fragment,{children:[e.jsx(Et,{fetchComponent:as[a],loading:this.renderLoading,error:this.renderError,renderDelay:200,children:r=>e.jsx(r,{...o,onChangeBackgroundColor:this.setBackgroundColor,onClose:this.handleClose,ref:this.setModalRef})}),e.jsx(qe,{children:e.jsx("meta",{name:"robots",content:"noindex"})})]})})}}const ns={},is=t=>({ignoreFocus:t.getIn(["modal","ignoreFocus"]),type:t.getIn(["modal","stack",0,"modalType"],null),props:t.getIn(["modal","stack",0,"modalProps"],ns)}),ls=t=>({onClose(s,a=!1){t(s?re({previousModalProps:s.props,modalType:"CONFIRM",modalProps:{message:s.message,confirm:s.confirm,onConfirm:()=>t(J({modalType:void 0,ignoreFocus:{ignoreFocus:a}}))}}):J({modalType:void 0,ignoreFocus:{ignoreFocus:a}}))}}),As=O(is,ls)(os);export{ks as A,Et as B,Es as L,As as M};
//# sourceMappingURL=modal_container-DwVKsC1W.js.map