27 lines
83 KiB
JavaScript
27 lines
83 KiB
JavaScript
|
var Kt=s=>{throw TypeError(s)};var vt=(s,t,n)=>t.has(s)||Kt("Cannot "+n);var T=(s,t,n)=>(vt(s,t,"read from private field"),n?n.call(s):t.get(s)),ce=(s,t,n)=>t.has(s)?Kt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,n),ge=(s,t,n,a)=>(vt(s,t,"write to private field"),a?a.call(s,n):t.set(s,n),n),Q=(s,t,n)=>(vt(s,t,"access private method"),n);import{z as _n,s as re,V as an,j as Ve,a as St,h as H,A as W,M as Ln,aE as on,d as Be,y as ne,x as An,aF as Sn,l as He,c as e,T as q,b as In,f as Ne,w as ct,i as fe,r as Bn,af as Tn,P as Mn,u as Rn,t as qt,C as rn}from"./useTitle-6CgMxXiB.js";import{j as ze,G as Dn,$ as $n,a as Oe,a9 as jn,y as Wt,u as Pn,aa as On,m as ln,b as Hn,I as N,B as Ut,i as nt,ab as Nn,c as cn,d as Ie,l as Et,M as it,s as Le,a5 as Kn,a1 as qn,r as Wn,Q as Un,Y as ut,p as et,z as Vn}from"./fuse-3cGZwVM1.js";class Gn{constructor(t,n,{tabInsertsSuggestions:a,defaultFirstOption:c}={}){this.input=t,this.list=n,this.tabInsertsSuggestions=a??!0,this.defaultFirstOption=c??!1,this.isComposing=!1,n.id||(n.id=`combobox-${Math.random().toString().slice(2,6)}`),this.ctrlBindings=!!navigator.userAgent.match(/Macintosh/),this.keyboardEventHandler=l=>Yn(l,this),this.compositionEventHandler=l=>Jn(l,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",n.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",Vt),this.indicateDefaultOption()}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",Vt)}indicateDefaultOption(){var t;this.defaultFirstOption&&((t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(bt)[0])===null||t===void 0||t.setAttribute("data-combobox-option-default","true"))}navigate(t=1){const n=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(bt)[0],a=Array.from(this.list.querySelectorAll('[role="option"]')).filter(bt),c=a.indexOf(n);if(c===a.length-1&&t===1||c===0&&t===-1){this.clearSelection(),this.input.focus();return}let l=t===1?0:a.length-1;if(n&&c>=0){const f=c+t;f>=0&&f<a.length&&(l=f)}const r=a[l];if(r)for(const f of a)f.removeAttribute("data-combobox-option-default"),r===f?(this.input.setAttribute("aria-activedescendant",r.id),r.setAttribute("aria-selected","true"),Xn(this.list,r)):f.removeAttribute("aria-selected")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.removeAttribute("aria-selected");this.indicateDefaultOption()}}function Yn(s,t){if(!(s.shiftKey||s.metaKey||s.altKey)&&!(!t.ctrlBindings&&s.ctrlKey)&&!t.isComposing)switch(s.key){case"Enter":Gt(t.input,t.list)&&s.preventDefault();break;case"Tab":t.tabInsertsSuggestions&&Gt(t.input,t.list)&&s.preventDefault();break;case"Escape":t.clearSelection();break;case"ArrowDown":t.navigate(1),s.preventDefault();break;case"ArrowUp":t.navigate(-1),s.preventDefault();break;case"n":t.ctrlBindings&&s.ctrlKey&&(t.navigate(1),s.preventDefault());break;case"p":t.ctrlBindings&&s.ctrl
|
|||
|
`,n-1)>r||s.lastIndexOf(".",n-1)>r)return}else if(s.lastIndexOf(" ",n-1)>r)return;const f=s[r-1];return f&&!ei.test(f)?void 0:{text:s.substring(r+t.length,n),position:r+t.length}}class ni extends HTMLElement{}class ii extends Event{constructor(){super("update")}}const xt=new WeakMap;var Ke,qe,We,ye,U,Ft,Se,Te,Me,Ct,Re,st,at,ot,Ue,Ae;const Bt=class Bt extends ni{constructor(){super(...arguments);ce(this,U);ce(this,Ke,new MutationObserver(()=>Q(this,U,at).call(this)));ce(this,qe,new ResizeObserver(()=>Q(this,U,st).call(this)));ce(this,We);ce(this,ye);ce(this,Te,0);ce(this,Me,0);ce(this,Re,!1);ce(this,Ue,()=>Q(this,U,ot).call(this));ce(this,Ae,n=>{Q(this,U,Se).call(this,a=>{(n.target===document||n.target===window||n.target instanceof Node&&n.target.contains(a))&&Q(this,U,st).call(this)})})}static for(n){let a=xt.get(n);return a||(a=new Bt,a.connect(n),xt.set(n,a)),a}connect(n){ge(this,We,new WeakRef(n)),ge(this,ye,document.createElement("div")),T(this,ye).style.position="absolute",T(this,ye).style.pointerEvents="none",n.after(T(this,ye)),T(this,ye).appendChild(this)}forceUpdate(){Q(this,U,at).call(this),Q(this,U,ot).call(this)}connectedCallback(){Q(this,U,Se).call(this,n=>{this.style.pointerEvents="none",this.style.userSelect="none",this.style.overflow="hidden",this.style.display="block",this.style.visibility="hidden",n instanceof HTMLTextAreaElement?(this.style.whiteSpace="pre-wrap",this.style.wordWrap="break-word"):(this.style.whiteSpace="nowrap",this.style.display="table-cell",this.style.verticalAlign="middle"),this.setAttribute("aria-hidden","true"),Q(this,U,at).call(this),Q(this,U,ot).call(this),T(this,Ke).observe(n,{attributeFilter:["style","dir"]}),T(this,qe).observe(n),document.addEventListener("scroll",T(this,Ae),{capture:!0}),window.addEventListener("resize",T(this,Ae),{capture:!0}),n.addEventListener("input",T(this,Ue),{capture:!0})})}disconnectedCallback(){var a;(a=T(this,ye))==null||a.remove(),T(this,Ke).disconnect(),T(this,qe).disconnect(),document.removeEventListener("scroll",T(this,Ae),{capture:!0}),window.removeEventListener("resize",T(this,Ae),{capture:!0});const n=T(this,U,Ft);n&&(n.removeEventListener("input",T(this,Ue),{capture:!0}),xt.delete(n))}};Ke=new WeakMap,qe=new WeakMap,We=new WeakMap,ye=new WeakMap,U=new WeakSet,Ft=function(){var n;return(n=T(this,We))==null?void 0:n.deref()},Se=function(n){const a=T(this,U,Ft);return a?n(a):this.remove()},Te=new WeakMap,Me=new WeakMap,Ct=function(){Q(this,U,Se).call(this,n=>{const a=window.getComputedStyle(n);this.style.height=a.height,this.style.width=a.width,n.clientHeight!==this.clientHeight&&(this.style.height=`calc(${a.height} + ${n.clientHeight-this.clientHeight}px)`),n.clientWidth!==this.clientWidth&&(this.style.width=`calc(${a.width} + ${n.clientWidth-this.clientWidth}px)`);const c=n.getBoundingClientRect(),l=this.getBoundingClientRect();ge(this,Te,T(this,Te)+c.left-l.left),ge(this,Me,T(this,Me)+c.top-l.top),this.style.transform=`translate(${T(this,Te)}px, ${T(this,Me)}px)`,this.scrollTop=n.scrollTop,this.scrollLeft=n.scrollLeft,this.dispatchEvent(new ii)})},Re=new WeakMap,st=function(){T(this,Re)||(ge(this,Re,!0),requestAnimationFrame(()=>{Q(this,U,Ct).call(this),ge(this,Re,!1)}))},at=function(){Q(this,U,Se).call(this,n=>{const a=window.getComputedStyle(n);for(const c of si)this.style[c]=a[c];Q(this,U,st).call(this)})},ot=function(){Q(this,U,Se).call(this,n=>{this.textContent=n.value,Q(this,U,Ct).call(this)})},Ue=new WeakMap,Ae=new WeakMap;let rt=Bt;const si=["direction","writingMode","unicodeBidi","textOrientation","boxSizing","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"];try{customElements.define("input-style-clone",rt)}catch(s){if(!(s instanceof DOMException&&s.name==="NotSupportedError"))throw s}var be,De,$e,ue,_t,un,Lt,Pe;const lt=c
|
|||
|
`)&&(A.current.selectionStart=0,A.current.selectionEnd=0),(k=A.current)==null||k.focus())},300)};ne(()=>{var o,d;if(t){const{spoilerText:k,visibility:p,language:S,sensitive:C}=t;k&&V.current&&(V.current.value=k);const x=[...new Set([t.account.acct,...t.mentions.map(F=>F.acct)])].filter(F=>F!==Z.acct);x.length>0&&(A.current.value=`${x.map(F=>`@${F}`).join(" ")} `,Ce()),we(),me(p==="public"&&se["posting:default:visibility"]?se["posting:default:visibility"].toLowerCase():p),B(S||((o=se["posting:default:language"])==null?void 0:o.toLowerCase())||_e),te(C&&!!k)}else if(n){const{visibility:k,language:p,sensitive:S,poll:C,mediaAttachments:I}=n,x=!!(C!=null&&C.options)&&{...C,options:C.options.map(F=>(F==null?void 0:F.title)||F),expiresIn:(C==null?void 0:C.expiresIn)||Qt(C.expiresAt)};z("loading"),(async()=>{var F;try{const O=await M.v1.statuses.$select(n.id).source.fetch(),{text:he,spoilerText:ve}=O;A.current.value=he,A.current.dataset.source=he,Ce(),we(),V.current.value=ve,me(k),B(p||((F=se["posting:default:language"])==null?void 0:F.toLowerCase())||_e),te(S),x&&le(x),G(I),z("default")}catch(O){alert((O==null?void 0:O.reason)||O),z("error")}})()}else we(),se["posting:default:visibility"]&&me(se["posting:default:visibility"].toLowerCase()),se["posting:default:language"]&&B(se["posting:default:language"].toLowerCase()),se["posting:default:sensitive"]&&te(!!se["posting:default:sensitive"]);if(a){const{status:k,spoilerText:p,visibility:S,language:C,sensitive:I,poll:x,mediaAttachments:F}=a,O=!!(x!=null&&x.options)&&{...x,options:x.options.map(he=>(he==null?void 0:he.title)||he),expiresIn:(x==null?void 0:x.expiresIn)||Qt(x.expiresAt)};A.current.value=k,Ce(),we(),p&&(V.current.value=p),S&&me(S),B(C||((d=se["posting:default:language"])==null?void 0:d.toLowerCase())||_e),I!==null&&te(I),O&&le(O),F&&G(F)}},[a,n,t]);const Tt=W(),Mt=r._({id:"hR9gtK"}),dt=()=>{const{value:o,dataset:d}=A.current;if(w==="loading")return!1;const k=(o||"").trim().replace(new RegExp("^\\p{White_Space}+|\\p{White_Space}+$","gu"),""),p=g.length>0;if(!k&&!p||g.length>0&&g.every(F=>F.id))return!0;const C=(t==null?void 0:t.account.id)===Z.id,I=t&&o.trim()===`@${t.account.acct}`;return!!(!C&&I||o===(d==null?void 0:d.source))},Ge=()=>dt()?!0:confirm(Mt);ne(()=>{const o=d=>{dt()||(d.preventDefault(),d.returnValue=Mt)};return window.addEventListener("beforeunload",o,{capture:!0}),()=>window.removeEventListener("beforeunload",o,{capture:!0})},[]);const gn=()=>{const{value:o}=A.current,{value:d}=V.current;return Zt(wi(o))+Zt(d)},ht=()=>{const o=gn();re.composerCharacterCount=o};ne(ht,[]);const Rt=window.CloseWatcher,pt=W(!1);Oe("esc",()=>{pt.current=!0},{enabled:!Rt,enableOnFormTags:!0}),Oe("esc",()=>{!c&&pt.current&&Ge()&&s(),pt.current=!1},{enabled:!Rt,enableOnFormTags:!0,keyup:!0,ignoreEventWhen:o=>{const d=document.querySelectorAll("#modal-container > *"),k=!!d,p=d.length===1&&d[0].querySelector("#compose-container");return k&&!p}}),jn(()=>{!c&&Ge()&&s()},[c,Ge,s]);const Dt=W({}),$t=()=>`${An()}#${R.current}`,mt=()=>{if(n||re.composerState.minimized)return;const o=$t(),d={key:o,replyTo:t?{id:t.id,account:{id:t.account.id,username:t.account.username,acct:t.account.acct}}:null,draftStatus:{uid:R.current,status:A.current.value,spoilerText:V.current.value,visibility:J,language:K,sensitive:X,poll:j,mediaAttachments:g}};!Sn(d,Dt.current)&&!dt()&&(Wt.drafts.set(o,{...d,state:"unsaved",updatedAt:Date.now()}).then(()=>{}).catch(k=>{}),Dt.current=structuredClone(d))};Pn(mt,5e3),ne(()=>(mt(),()=>{Wt.drafts.del($t())}),[]),ne(()=>{const o=k=>{const{items:p}=k.clipboardData||k.dataTransfer,S=[],C=[];for(let I=0;I<p.length;I++){const x=p[I];if(x.kind==="file"){const F=x.getAsFile();b!==void 0&&!b.includes(F.type)?C.push(F):S.push(F)}}if(C.length>0&&alert(r._({id:"rpXAF6",values:{0:C.length,1:C[0].name,2:L.format(C.map(I=>I.name))}})),S.length>0&&g.length>=u){alert(r._({id:"ctFhjs",values:{maxMediaAttachments:u}}));return}if(S.length>0){k.preventDefault(),k.stopPropagation();let I=S;if(u!==void 0){const F=u-g.length;if(I=I.slice(0,F),I.length<=0){alert(r._({id:"ctFhjs",values:{maxM
|
|||
|
<li role="option" data-value="${Ee(ae)}">
|
|||
|
<img src="${Ee(A)}" width="16" height="16" alt="" loading="lazy" />
|
|||
|
${Ee(ae)}
|
|||
|
</li>`}),ee+=`<li role="option" data-value="" data-more="${E}">${fe._({id:"24misb"})}</li>`,Fe.innerHTML=ee,P(Promise.resolve({matched:oe.length>0,fragment:Fe}));return}const Y={"@":"accounts","#":"hashtags"}[v];P(new Promise(oe=>{f({type:Y,q:E,limit:5}).then(pe=>{if(E!==w.current)return;const ae=pe[Y]||pe;let A="";ae.forEach(V=>{var G;const{name:J,avatarStatic:me,displayName:X,username:te,acct:K,emojis:B,history:D}=V,g=qn(X,B);if(K)A+=`
|
|||
|
<li role="option" data-value="${Ee(K)}">
|
|||
|
<span class="avatar">
|
|||
|
<img src="${Ee(me)}" width="16" height="16" alt="" loading="lazy" />
|
|||
|
</span>
|
|||
|
<span>
|
|||
|
<b>${g||te}</b>
|
|||
|
<br><span class="bidi-isolate">@${Ee(K)}</span>
|
|||
|
</span>
|
|||
|
</li>
|
|||
|
`;else{const j=(G=D==null?void 0:D.reduce)==null?void 0:G.call(D,(le,se)=>le+ +se.uses,0);A+=`
|
|||
|
<li role="option" data-value="${Ee(J)}">
|
|||
|
<span class="grow">#<b>${Ee(J)}</b></span>
|
|||
|
${j?`<span class="count">${Wn(j)}</span>`:""}
|
|||
|
</li>
|
|||
|
`}}),Y==="accounts"&&(A+=`<li role="option" data-value="" data-more="${E}">${fe._({id:"24misb"})}</li>`),Fe.innerHTML=A,oe({matched:ae.length>0,fragment:Fe})})}))},y.current.addEventListener("text-expander-change",h),u=b=>{const{key:v,item:P}=b.detail,{value:E,more:Y}=P.dataset;v===":"?(b.detail.value=E?`:${E}:`:"",Y&&(b.detail.continue=!0,setTimeout(()=>{_==null||_({name:"custom-emojis",defaultSearchTerm:Y})},300))):v==="@"?(b.detail.value=E?`@${E} `:"",Y&&(b.detail.continue=!0,setTimeout(()=>{_==null||_({name:"mention",defaultSearchTerm:Y})},300))):b.detail.value=`${v}${E}`},y.current.addEventListener("text-expander-value",u),m=b=>{const{input:v}=b.detail;if(l(v.value),t.current){const P=new Event("input",{bubbles:!0});t.current.dispatchEvent(P)}},y.current.addEventListener("text-expander-committed",m)),()=>{y.current&&(y.current.removeEventListener("text-expander-change",h),y.current.removeEventListener("text-expander-value",u),y.current.removeEventListener("text-expander-committed",m))}},[]),ne(()=>{const h=t.current;if(!h)return;new ResizeObserver(()=>{if(y.current){const{height:m}=h.getBoundingClientRect();y.current.style.height=m+"px"}}).observe(h)},[]);const z=W(0),R=W(),$=Un(h=>{var b;if(!R.current)return;if(z.current>3){R.current.innerHTML="",R.current=null,(b=$==null?void 0:$.cancel)==null||b.call($);return}let u,m;z.current<=3&&(u=Date.now()),R.current.innerHTML=Li(h,{maxCharacters:r})+`
|
|||
|
`,z.current<=3&&(m=Date.now()),u&&m&&m-u>50&&z.current++},500),Z=ut(()=>{var m,b;const h=(m=R.current)==null?void 0:m.cloneNode(!0);if(!h)return;h.querySelectorAll("mark").forEach(v=>{v.remove()});const u=(b=h.innerText)==null?void 0:b.trim();u&&(async()=>{const v=await Bi(u);v!=null&&v.length&&(_==null||_({name:"auto-detect-language",languages:v}))})()},2e3);return e("text-expander",{ref:y,keys:"@ # :",class:"compose-field-container",children:[e("textarea",{class:"compose-field",autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",rows:"6",cols:"50",...L,ref:t,name:"status",value:c,onKeyDown:h=>{const{key:u,target:m}=h;if(u==="Enter"&&!(h.ctrlKey||h.metaKey))try{const{value:b,selectionStart:v}=m,E=b.slice(0,v).split(`
|
|||
|
`).slice(-1)[0];if(E&&/^\s*(-|\d+\.)\s/.test(E)){const[Y,de,oe,ee,pe]=E.match(/^(\s*)(-|\d+\.)(\s+)(.+)?/)||[];if(pe){h.preventDefault();const[ae]=oe.match(/\d+/)||[],A=ae?`${+ae+1}.`:"-",V=`
|
|||
|
${de}${A}${ee}`;m.setRangeText(V,v,v);const J=v+V.length;m.setSelectionRange(J,J)}else{const ae=v-E.length;m.setRangeText("",ae,v)}tn(m),m.dispatchEvent(new Event("input"))}}catch{}R.current&&(R.current.scrollTop=m.scrollTop)},onInput:h=>{var b;const{target:u}=h,m=u.value.replace(/\u200b/g,"");l(m),tn(u),(b=s.onInput)==null||b.call(s,h),$(m),Z()},style:{width:"100%",height:"4em"},onScroll:h=>{if(R.current){const{scrollTop:u}=h.target;R.current.scrollTop=u}}}),e("div",{ref:R,class:"compose-highlight","aria-hidden":"true"})]})});function Mi({maxCharacters:s=500,hidden:t}){const a=Rn(re).composerCharacterCount,c=s-a;return t?e("span",{class:"char-counter",hidden:!0}):e("span",{class:"char-counter",title:`${c}/${s}`,style:{"--percentage":a/s*100},children:[e("meter",{class:`${c<=-10?"explode":c<=0?"danger":c<=20?"warning":""}`,value:a,max:s}),e("span",{class:"counter",children:c})]})}function nn(s,t,n,a){const c=Math.sqrt(t/s),l=Math.floor(n*c),r=Math.floor(a*c);return{newWidth:l,newHeight:r}}function Ri({attachment:s,disabled:t,lang:n,onDescriptionChange:a=()=>{},onRemove:c=()=>{}}){const{i18n:l}=Ve(),[r,f]=H("default"),_=nt("@mastodon/edit-media-attributes"),{type:L,id:M,file:y}=s,w=He(()=>y?URL.createObjectURL(y):s.url,[y,s.url]),z=!!(y!=null&&y.size),R=z?on():{},{mediaAttachments:{imageSizeLimit:$,imageMatrixLimit:Z,videoSizeLimit:ie,videoMatrixLimit:h,videoFrameRateLimit:u}={}}=R||{},[m,b]=H(()=>z?L.startsWith("image")&&$&&y.size>$?{type:"imageSizeLimit",details:{imageSize:y.size,imageSizeLimit:$}}:L.startsWith("video")&&ie&&y.size>ie?{type:"videoSizeLimit",details:{videoSize:y.size,videoSizeLimit:ie}}:null:null),[v,P]=H({});ne(()=>{!z||!Z||(v==null?void 0:v.matrix)>Z&&b({type:"imageMatrixLimit",details:{imageMatrix:v==null?void 0:v.matrix,imageMatrixLimit:Z,width:v==null?void 0:v.width,height:v==null?void 0:v.height}})},[v,Z,z]);const[E,Y]=H({});ne(()=>{!z||!h||(E==null?void 0:E.matrix)>h&&b({type:"videoMatrixLimit",details:{videoMatrix:E==null?void 0:E.matrix,videoMatrixLimit:h,width:E==null?void 0:E.width,height:E==null?void 0:E.height}})},[E,h,z]);const[de,oe]=H(s.description),[ee,pe]=L.split("/"),ae=ut(a,250);ne(()=>{ae(de)},[de,ae]);const[A,V]=H(!1),J=W(null);ne(()=>{let B;return A&&J.current&&(B=setTimeout(()=>{J.current.focus()},100)),()=>{clearTimeout(B)}},[A]);const me=e(Ne,{children:M&&!_?e("div",{class:"media-desc",children:[e("span",{class:"tag",children:e(q,{id:"3wG7HI"})}),e("p",{title:de,children:s.description||e("i",{children:"No description"})})]}):e("textarea",{ref:J,value:de||"",lang:n,placeholder:{image:l._({id:"Lh8B0N"}),video:l._({id:"mN4S+e"}),audio:l._({id:"ieZytw"})}[ee],autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",disabled:t||r==="loading",class:r==="loading"?"loading":"",maxlength:"1500",onInput:B=>{const{value:D}=B.target;oe(D)}})}),X=W(null);ne(()=>()=>{var B,D;(D=(B=X.current)==null?void 0:B.hideToast)==null||D.call(B)},[]);const te=W(null),K=B=>{const{type:D,details:g}=B;switch(D){case"imageSizeLimit":{const{imageSize:G,imageSizeLimit:j}=g;return l._({id:"d83/LB",values:{0:et(G),1:et(j)}})}case"imageMatrixLimit":{const{imageMatrix:G,imageMatrixLimit:j,width:le,height:se}=g,{newWidth:Ce,newHeight:we}=nn(G,j,le,se);return l._({id:"DuvOX/",values:{0:l.number(le),1:l.number(se),2:l.number(Ce),3:l.number(we)}})}case"videoSizeLimit":{const{videoSize:G,videoSizeLimit:j}=g;return l._({id:"d83/LB",values:{0:et(G),1:et(j)}})}case"videoMatrixLimit":{const{videoMatrix:G,videoMatrixLimit:j,width:le,height:se}=g,{newWidth:Ce,newHeight:we}=nn(G,j,le,se);return l._({id:"DuvOX/",values:{0:l.number(le),1:l.number(se),2:l.number(Ce),3:l.number(we)}})}case"videoFrameRateLimit":return l._({id:"S1fBwy"})}};return e(Ne,{children:[e("div",{class:"media-attachment",children:[e("div",{class:"media-preview",tabIndex:"0",onClick:()=>{V(!0)},children:ee==="image"?e("img",{src:w,alt:"",onLoad:B=>{if(!z)return;const{naturalWidth:D,naturalHeight:g}=B.target;P({matrix:D*g,width:D,height:g})}}):ee==="video"||ee==="gifv"?e("video",{src:w+"#t=0.1",playsinline:!0,muted:!0,disabl
|
|||
|
//# sourceMappingURL=compose-_xw4e_c5.js.map
|