From 521afb534304f4b3eab797c047110937a60d7b2d Mon Sep 17 00:00:00 2001 From: Archos Date: Fri, 27 Jun 2025 13:49:13 +0200 Subject: [PATCH] =?UTF-8?q?P=C5=99id=C3=A1na=20nov=C3=A1=20verze=20Phanpy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/ScheduledAtField-CmVCdT4d.js | 192 ++++++++++++++++++++++++ assets/ScheduledAtField-CmVCdT4d.js.map | 1 + assets/ScheduledAtField-qAqa0B1Q.css | 1 + assets/compose-B6owzFkk.js | 25 +++ assets/compose-B6owzFkk.js.map | 1 + assets/compose-CeLas5FE.js | 2 + assets/compose-CeLas5FE.js.map | 1 + assets/locales/ar-SA-DNlTmfnf.js.map | 2 +- assets/locales/ca-ES-BKps-zmz.js.map | 2 +- assets/locales/cs-CZ-36fp692K.js.map | 2 +- assets/locales/de-DE-DQ-yj_7B.js.map | 2 +- assets/locales/eo-UY-CDIqdT3-.js.map | 2 +- assets/locales/es-ES-BtGZ9Ruk.js.map | 2 +- assets/locales/eu-ES-YbNAxHtm.js.map | 2 +- assets/locales/fa-IR-C1wBDuHc.js.map | 2 +- assets/locales/fi-FI-BZWIh8O6.js | 2 + assets/locales/fi-FI-BZWIh8O6.js.map | 1 + assets/locales/fr-FR-DuGY5o06.js.map | 2 +- assets/locales/gl-ES-BNR_P8bh.js.map | 2 +- assets/locales/he-IL-DNlTmfnf.js.map | 2 +- assets/locales/it-IT-Bh8tN8sm.js.map | 2 +- assets/locales/ja-JP-DNlTmfnf.js.map | 2 +- assets/locales/kab-wGE2gLZ_.js.map | 2 +- assets/locales/ko-KR-iTU72pNn.js.map | 2 +- assets/locales/lt-LT-DmXHaOOv.js.map | 2 +- assets/locales/nb-NO-DNlTmfnf.js.map | 2 +- assets/locales/nl-NL-DWv77wBq.js.map | 2 +- assets/locales/oc-FR-DNlTmfnf.js.map | 2 +- assets/locales/pl-PL-GA5d431I.js | 2 + assets/locales/pl-PL-GA5d431I.js.map | 1 + assets/locales/pt-BR-DDkDZLgP.js.map | 2 +- assets/locales/pt-PT-941LAnTR.js.map | 2 +- assets/locales/ru-RU-BAiK9eEr.js.map | 2 +- assets/locales/th-TH-DNlTmfnf.js.map | 2 +- assets/locales/tok-DNlTmfnf.js | 2 + assets/locales/tok-DNlTmfnf.js.map | 1 + assets/locales/tr-TR-DNlTmfnf.js.map | 2 +- assets/locales/uk-UA-BIAwIk5m.js.map | 2 +- assets/locales/zh-CN-Divd7jUY.js | 2 + assets/locales/zh-CN-Divd7jUY.js.map | 1 + assets/locales/zh-TW-DNlTmfnf.js.map | 2 +- assets/main-BP8RudbJ.css | 1 + assets/main-CkiDRZbR.js | 36 +++++ assets/main-CkiDRZbR.js.map | 1 + assets/polyfill-force-gTB1XdBs.js | 9 ++ assets/polyfill-force-gTB1XdBs.js.map | 1 + assets/useTitle-BXZj7pjQ.js | 46 ++++++ assets/useTitle-BXZj7pjQ.js.map | 1 + assets/useTitle-BhCmCZiZ.css | 7 + compose/index.html | 6 +- index.html | 12 +- version.json | 2 +- 52 files changed, 373 insertions(+), 36 deletions(-) create mode 100644 assets/ScheduledAtField-CmVCdT4d.js create mode 100644 assets/ScheduledAtField-CmVCdT4d.js.map create mode 100644 assets/ScheduledAtField-qAqa0B1Q.css create mode 100644 assets/compose-B6owzFkk.js create mode 100644 assets/compose-B6owzFkk.js.map create mode 100644 assets/compose-CeLas5FE.js create mode 100644 assets/compose-CeLas5FE.js.map create mode 100644 assets/locales/fi-FI-BZWIh8O6.js create mode 100644 assets/locales/fi-FI-BZWIh8O6.js.map create mode 100644 assets/locales/pl-PL-GA5d431I.js create mode 100644 assets/locales/pl-PL-GA5d431I.js.map create mode 100644 assets/locales/tok-DNlTmfnf.js create mode 100644 assets/locales/tok-DNlTmfnf.js.map create mode 100644 assets/locales/zh-CN-Divd7jUY.js create mode 100644 assets/locales/zh-CN-Divd7jUY.js.map create mode 100644 assets/main-BP8RudbJ.css create mode 100644 assets/main-CkiDRZbR.js create mode 100644 assets/main-CkiDRZbR.js.map create mode 100644 assets/polyfill-force-gTB1XdBs.js create mode 100644 assets/polyfill-force-gTB1XdBs.js.map create mode 100644 assets/useTitle-BXZj7pjQ.js create mode 100644 assets/useTitle-BXZj7pjQ.js.map create mode 100644 assets/useTitle-BhCmCZiZ.css diff --git a/assets/ScheduledAtField-CmVCdT4d.js b/assets/ScheduledAtField-CmVCdT4d.js new file mode 100644 index 0000000..ab1dd01 --- /dev/null +++ b/assets/ScheduledAtField-CmVCdT4d.js @@ -0,0 +1,192 @@ +import{ao as ye,W as zt,e as r,d as W,q as St,A as F,_ as Fe,y as Q,I as Tr,ap as $a,l as at,S as Se,h as ns,aq as Fa,ar as ao,as as Na,at as os,V as rs,k as B,M as on,$ as xt,G as Sn,z as Pt,s as j,a8 as k,au as Ba,x as za,n as Va,av as Ka,u as le,a as co,g as Ar,H as Ha,aw as Ua,ax as ja,T as P,ay as is,az as Wa,aA as ss,p as go,E as as,aB as Za,aC as Nt,aD as qa,aE as Ga,aF as jn,P as pe,c as Mn,t as Ya,b as Ee,a0 as cs,aG as Xa,aH as Qa,aI as Ja}from"./useTitle-BXZj7pjQ.js";const ls=["shift","alt","meta","mod","ctrl","control"],tc={esc:"escape",return:"enter",left:"arrowleft",right:"arrowright",up:"arrowup",down:"arrowdown",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function ke(t){return(tc[t.trim()]||t.trim()).toLowerCase().replace(/key|digit|numpad/,"")}function us(t){return ls.includes(t)}function Co(t,e=","){return t.toLowerCase().split(e)}function Lo(t,e="+",n=">",o=!1,i){let a=[],s=!1;t.includes(n)?(s=!0,a=t.toLocaleLowerCase().split(n).map(d=>ke(d))):a=t.toLocaleLowerCase().split(e).map(d=>ke(d));const c={alt:a.includes("alt"),ctrl:a.includes("ctrl")||a.includes("control"),shift:a.includes("shift"),meta:a.includes("meta"),mod:a.includes("mod"),useKey:o},l=a.filter(d=>!ls.includes(d));return{...c,keys:l,description:i,isSequence:s}}typeof document<"u"&&(document.addEventListener("keydown",t=>{t.code!==void 0&&ds([ke(t.code)])}),document.addEventListener("keyup",t=>{t.code!==void 0&&hs([ke(t.code)])})),typeof window<"u"&&(window.addEventListener("blur",()=>{fe.clear()}),window.addEventListener("contextmenu",()=>{setTimeout(()=>{fe.clear()},0)}));const fe=new Set;function kr(t){return Array.isArray(t)}function ec(t,e=","){return(kr(t)?t:t.split(e)).every(n=>fe.has(n.trim().toLowerCase()))}function ds(t){const e=Array.isArray(t)?t:[t];fe.has("meta")&&fe.forEach(n=>!us(n)&&fe.delete(n.toLowerCase())),e.forEach(n=>fe.add(n.toLowerCase()))}function hs(t){const e=Array.isArray(t)?t:[t];t==="meta"?fe.clear():e.forEach(n=>fe.delete(n.toLowerCase()))}function nc(t,e,n){(typeof n=="function"&&n(t,e)||n===!0)&&t.preventDefault()}function oc(t,e,n){return typeof n=="function"?n(t,e):n===!0||n===void 0}function rc(t){return fs(t,["input","textarea","select"])}function fs(t,e=!1){const{target:n,composed:o}=t;let i;return ic(n)&&o?i=t.composedPath()[0]&&t.composedPath()[0].tagName:i=n&&n.tagName,kr(e)?!!(i&&e&&e.some(a=>a.toLowerCase()===i.toLowerCase())):!!(i&&e&&e)}function ic(t){return!!t.tagName&&!t.tagName.startsWith("-")&&t.tagName.includes("-")}function sc(t,e){return t.length===0&&e?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):e?t.some(n=>e.includes(n))||t.includes("*"):!0}const ac=(t,e,n=!1)=>{const{alt:o,meta:i,mod:a,shift:s,ctrl:c,keys:l,useKey:d}=e,{code:h,key:u,ctrlKey:m,metaKey:f,shiftKey:p,altKey:v}=t,y=ke(h);if(d&&(l==null?void 0:l.length)===1&&l.includes(u))return!0;if(!(l!=null&&l.includes(y))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(y))return!1;if(!n){if(o!==v&&y!=="alt"||s!==p&&y!=="shift")return!1;if(a){if(!f&&!m)return!1}else if(i!==f&&y!=="meta"&&y!=="os"||c!==m&&y!=="ctrl"&&y!=="control")return!1}return l&&l.length===1&&l.includes(y)?!0:l?ec(l):!l},cc=ye(void 0),lc=()=>zt(cc);function ms(t,e){return t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).reduce((n,o)=>n&&ms(t[o],e[o]),!0):t===e}const uc=ye({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),dc=()=>zt(uc);function hc(t){const e=F(void 0);return ms(e.current,t)||(e.current=t),e.current}const ai=t=>{t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},fc=typeof window<"u"?Fe:Q;function Ze(t,e,n,o){const i=F(null),a=F(!1),s=n instanceof Array?o instanceof Array?void 0:o:n,c=kr(t)?t.join(s==null?void 0:s.delimiter):t,l=n instanceof Array?n:o instanceof Array?o:void 0,d=St(e,l??[]),h=F(d);l?h.current=d:h.current=e;const u=hc(s),{activeScopes:m}=dc(),f=lc();return fc(()=>{if((u==null?void 0:u.enabled)===!1||!sc(m,u==null?void 0:u.scopes))return;let p=[],v;const y=(T,_=!1)=>{var b;if(!(rc(T)&&!fs(T,u==null?void 0:u.enableOnFormTags))){if(i.current!==null){const x=i.current.getRootNode();if((x instanceof Document||x instanceof ShadowRoot)&&x.activeElement!==i.current&&!i.current.contains(x.activeElement)){ai(T);return}}(b=T.target)!=null&&b.isContentEditable&&!(u!=null&&u.enableOnContentEditable)||Co(c,u==null?void 0:u.delimiter).forEach(x=>{var D,C,S,N;if(x.includes((u==null?void 0:u.splitKey)??"+")&&x.includes((u==null?void 0:u.sequenceSplitKey)??">")){console.warn(`Hotkey ${x} contains both ${(u==null?void 0:u.splitKey)??"+"} and ${(u==null?void 0:u.sequenceSplitKey)??">"} which is not supported.`);return}const R=Lo(x,u==null?void 0:u.splitKey,u==null?void 0:u.sequenceSplitKey,u==null?void 0:u.useKey,u==null?void 0:u.description);if(R.isSequence){v=setTimeout(()=>{p=[]},(u==null?void 0:u.sequenceTimeoutMs)??1e3);const O=R.useKey?T.key:ke(T.code);if(us(O.toLowerCase()))return;p.push(O);const L=(D=R.keys)==null?void 0:D[p.length-1];if(O!==L){p=[],v&&clearTimeout(v);return}p.length===((C=R.keys)==null?void 0:C.length)&&(h.current(T,R),v&&clearTimeout(v),p=[])}else if(ac(T,R,u==null?void 0:u.ignoreModifiers)||(S=R.keys)!=null&&S.includes("*")){if((N=u==null?void 0:u.ignoreEventWhen)!=null&&N.call(u,T)||_&&a.current)return;if(nc(T,R,u==null?void 0:u.preventDefault),!oc(T,R,u==null?void 0:u.enabled)){ai(T);return}h.current(T,R),_||(a.current=!0)}})}},E=T=>{T.code!==void 0&&(ds(ke(T.code)),((u==null?void 0:u.keydown)===void 0&&(u==null?void 0:u.keyup)!==!0||u!=null&&u.keydown)&&y(T))},w=T=>{T.code!==void 0&&(hs(ke(T.code)),a.current=!1,u!=null&&u.keyup&&y(T,!0))},A=i.current||(s==null?void 0:s.document)||document;return A.addEventListener("keyup",w,s==null?void 0:s.eventListenerOptions),A.addEventListener("keydown",E,s==null?void 0:s.eventListenerOptions),f&&Co(c,u==null?void 0:u.delimiter).forEach(T=>f.addHotkey(Lo(T,u==null?void 0:u.splitKey,u==null?void 0:u.sequenceSplitKey,u==null?void 0:u.useKey,u==null?void 0:u.description))),()=>{A.removeEventListener("keyup",w,s==null?void 0:s.eventListenerOptions),A.removeEventListener("keydown",E,s==null?void 0:s.eventListenerOptions),f&&Co(c,u==null?void 0:u.delimiter).forEach(T=>f.removeHotkey(Lo(T,u==null?void 0:u.splitKey,u==null?void 0:u.sequenceSplitKey,u==null?void 0:u.useKey,u==null?void 0:u.description))),p=[],v&&clearTimeout(v)}},[c,u,m]),i}var oo={exports:{}};/*! + * Toastify js 1.12.0 + * https://github.com/apvarun/toastify-js + * @license MIT licensed + * + * Copyright (C) 2018 Varun A P + */var mc=oo.exports,ci;function pc(){return ci||(ci=1,function(t){(function(e,n){t.exports?t.exports=n():e.Toastify=n()})(mc,function(e){var n=function(s){return new n.lib.init(s)},o="1.12.0";n.defaults={oldestFirst:!0,text:"Toastify is awesome!",node:void 0,duration:3e3,selector:void 0,callback:function(){},destination:void 0,newWindow:!1,close:!1,gravity:"toastify-top",positionLeft:!1,position:"",backgroundColor:"",avatar:"",className:"",stopOnFocus:!0,onClick:function(){},offset:{x:0,y:0},escapeMarkup:!0,ariaLive:"polite",style:{background:""}},n.lib=n.prototype={toastify:o,constructor:n,init:function(s){return s||(s={}),this.options={},this.toastElement=null,this.options.text=s.text||n.defaults.text,this.options.node=s.node||n.defaults.node,this.options.duration=s.duration===0?0:s.duration||n.defaults.duration,this.options.selector=s.selector||n.defaults.selector,this.options.callback=s.callback||n.defaults.callback,this.options.destination=s.destination||n.defaults.destination,this.options.newWindow=s.newWindow||n.defaults.newWindow,this.options.close=s.close||n.defaults.close,this.options.gravity=s.gravity==="bottom"?"toastify-bottom":n.defaults.gravity,this.options.positionLeft=s.positionLeft||n.defaults.positionLeft,this.options.position=s.position||n.defaults.position,this.options.backgroundColor=s.backgroundColor||n.defaults.backgroundColor,this.options.avatar=s.avatar||n.defaults.avatar,this.options.className=s.className||n.defaults.className,this.options.stopOnFocus=s.stopOnFocus===void 0?n.defaults.stopOnFocus:s.stopOnFocus,this.options.onClick=s.onClick||n.defaults.onClick,this.options.offset=s.offset||n.defaults.offset,this.options.escapeMarkup=s.escapeMarkup!==void 0?s.escapeMarkup:n.defaults.escapeMarkup,this.options.ariaLive=s.ariaLive||n.defaults.ariaLive,this.options.style=s.style||n.defaults.style,s.backgroundColor&&(this.options.style.background=s.backgroundColor),this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var s=document.createElement("div");s.className="toastify on "+this.options.className,this.options.position?s.className+=" toastify-"+this.options.position:this.options.positionLeft===!0?(s.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):s.className+=" toastify-right",s.className+=" "+this.options.gravity,this.options.backgroundColor&&console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');for(var c in this.options.style)s.style[c]=this.options.style[c];if(this.options.ariaLive&&s.setAttribute("aria-live",this.options.ariaLive),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)s.appendChild(this.options.node);else if(this.options.escapeMarkup?s.innerText=this.options.text:s.innerHTML=this.options.text,this.options.avatar!==""){var l=document.createElement("img");l.src=this.options.avatar,l.className="toastify-avatar",this.options.position=="left"||this.options.positionLeft===!0?s.appendChild(l):s.insertAdjacentElement("afterbegin",l)}if(this.options.close===!0){var d=document.createElement("button");d.type="button",d.setAttribute("aria-label","Close"),d.className="toast-close",d.innerHTML="✖",d.addEventListener("click",(function(y){y.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}).bind(this));var h=window.innerWidth>0?window.innerWidth:screen.width;(this.options.position=="left"||this.options.positionLeft===!0)&&h>360?s.insertAdjacentElement("afterbegin",d):s.appendChild(d)}if(this.options.stopOnFocus&&this.options.duration>0){var u=this;s.addEventListener("mouseover",function(y){window.clearTimeout(s.timeOutValue)}),s.addEventListener("mouseleave",function(){s.timeOutValue=window.setTimeout(function(){u.removeElement(s)},u.options.duration)})}if(typeof this.options.destination<"u"&&s.addEventListener("click",(function(y){y.stopPropagation(),this.options.newWindow===!0?window.open(this.options.destination,"_blank"):window.location=this.options.destination}).bind(this)),typeof this.options.onClick=="function"&&typeof this.options.destination>"u"&&s.addEventListener("click",(function(y){y.stopPropagation(),this.options.onClick()}).bind(this)),typeof this.options.offset=="object"){var m=i("x",this.options),f=i("y",this.options),p=this.options.position=="left"?m:"-"+m,v=this.options.gravity=="toastify-top"?f:"-"+f;s.style.transform="translate("+p+","+v+")"}return s},showToast:function(){this.toastElement=this.buildToast();var s;if(typeof this.options.selector=="string"?s=document.getElementById(this.options.selector):this.options.selector instanceof HTMLElement||typeof ShadowRoot<"u"&&this.options.selector instanceof ShadowRoot?s=this.options.selector:s=document.body,!s)throw"Root element is not defined";var c=n.defaults.oldestFirst?s.firstChild:s.lastChild;return s.insertBefore(this.toastElement,c),n.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout((function(){this.removeElement(this.toastElement)}).bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(s){s.className=s.className.replace(" on",""),window.setTimeout((function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),s.parentNode&&s.parentNode.removeChild(s),this.options.callback.call(s),n.reposition()}).bind(this),400)}},n.reposition=function(){for(var s={top:15,bottom:15},c={top:15,bottom:15},l={top:15,bottom:15},d=document.getElementsByClassName("toastify"),h,u=0;u0?window.innerWidth:screen.width;p<=360?(d[u].style[h]=l[h]+"px",l[h]+=m+f):a(d[u],"toastify-left")===!0?(d[u].style[h]=s[h]+"px",s[h]+=m+f):(d[u].style[h]=c[h]+"px",c[h]+=m+f)}return this};function i(s,c){return c.offset[s]?isNaN(c.offset[s])?c.offset[s]:c.offset[s]+"px":"0px"}function a(s,c){return!s||typeof c!="string"?!1:!!(s.className&&s.className.trim().split(/\s+/gi).indexOf(c)>-1)}return n.lib.init.prototype=n.lib,n})}(oo)),oo.exports}var gc=pc();const vc=Tr(gc);window._showToast=Lt;function Lt(t){typeof t=="string"&&(t={text:t});const{onClick:e,delay:n,...o}=t,i=vc({className:`${e||t.destination?"shiny-pill":""}`,gravity:"bottom",position:"center",...o,onClick:()=>{e==null||e(i)}});return n?setTimeout(()=>{i.showToast()},n):i.showToast(),i}function Ev(t,e,n,o){const i=F(t);Q(()=>{i.current=t},[t,n]),Q(()=>{!o||e===null||e===!1||i.current()},[o]),Q(()=>{if(e===null||e===!1)return;const s=setInterval(()=>i.current(),e);return()=>clearInterval(s)},[e])}const Sr=t=>!!t&&t[0]==="o",or=$a,Cn=(t,e)=>t===!0||!!(t&&t[e]),qt=(t,e)=>typeof t=="function"?t(e):t,_c="_szhsinMenu",yc=t=>t[_c];const rn=(t,e)=>(e&&Object.keys(e).forEach(n=>{const o=t[n],i=e[n];typeof i=="function"&&o?t[n]=(...a)=>{i(...a),o(...a)}:t[n]=i}),t),bc=t=>{if(typeof t!="string")return{top:0,right:0,bottom:0,left:0};const e=t.trim().split(/\s+/,4).map(parseFloat),n=isNaN(e[0])?0:e[0],o=isNaN(e[1])?n:e[1];return{top:n,right:o,bottom:isNaN(e[2])?n:e[2],left:isNaN(e[3])?o:e[3]}},xo=t=>{for(;t;){if(t=t.parentNode,!t||t===document.body||!t.parentNode)return;const{overflow:e,overflowX:n,overflowY:o}=getComputedStyle(t);if(/auto|scroll|overlay|hidden/.test(e+o+n))return t}};function vo(t,e){return{"aria-disabled":t||void 0,tabIndex:e?0:-1}}function li(t,e){for(let n=0;nat(()=>{const i=e?`${t}__${e}`:t;let a=i;n&&Object.keys(n).forEach(c=>{const l=n[c];l&&(a+=` ${i}--${l===!0?c:`${c}-${l}`}`)});let s=typeof o=="function"?o(n):o;return typeof s=="string"&&(s=s.trim(),s&&(a+=` ${s}`)),a},[t,e,n,o]),wc="szh-menu-container",ae="szh-menu";const Ec="arrow",Cr="item",Tc="divider",Ac="header",kc="group",Sc="submenu";const ps=ye(),Lr=ye({}),lo=ye({}),xr=ye({}),Cc=ye({}),_o=ye({}),Bt=Object.freeze({ENTER:"Enter",ESC:"Escape",SPACE:" ",HOME:"Home",END:"End",LEFT:"ArrowLeft",RIGHT:"ArrowRight",UP:"ArrowUp",DOWN:"ArrowDown"}),Et=Object.freeze({RESET:0,SET:1,UNSET:2,INCREASE:3,DECREASE:4,FIRST:5,LAST:6,SET_INDEX:7}),Ln=Object.freeze({CLICK:"click",CANCEL:"cancel",BLUR:"blur",SCROLL:"scroll"}),qe=Object.freeze({FIRST:"first",LAST:"last"}),Lc=Object.freeze({entering:"opening",entered:"open",exiting:"closing",exited:"closed"}),ui="absolute",Ir="none",Dr="menuitem",rr={preventScroll:!0};const xc=({className:t,containerRef:e,containerProps:n,children:o,isOpen:i,theming:a,transition:s,onClose:c})=>{const l=Cn(s,"item");return r("div",{...rn({onKeyDown:({key:u})=>{switch(u){case Bt.ESC:qt(c,{key:u,reason:Ln.CANCEL});break}},onBlur:u=>{i&&!u.currentTarget.contains(u.relatedTarget)&&qt(c,{reason:Ln.BLUR})}},n),className:ce({block:wc,modifiers:at(()=>({theme:a,itemTransition:l}),[a,l]),className:t}),style:{position:"absolute",...n==null?void 0:n.style},ref:e,children:o})},Ic=()=>{let t,e=0;return{toggle:n=>{n?e++:e--,e=Math.max(e,0)},on:(n,o,i)=>{e?t||(t=setTimeout(()=>{t=0,o()},n)):i==null||i()},off:()=>{t&&(clearTimeout(t),t=0)}}},Dc=t=>{const[e,n]=W(),i=F({items:[],hoverIndex:-1,sorted:!1}).current,a=St((c,l)=>{const{items:d}=i;if(!c)i.items=[];else if(l)d.push(c);else{const h=d.indexOf(c);h>-1&&(d.splice(h,1),c.contains(document.activeElement)&&(t.current.focus(rr),n()))}i.hoverIndex=-1,i.sorted=!1},[i,t]),s=St((c,l,d)=>{const{items:h,hoverIndex:u}=i,m=()=>{if(i.sorted)return;const v=t.current.querySelectorAll(".szh-menu__item");h.sort((y,E)=>li(v,y)-li(v,E)),i.sorted=!0};let f=-1,p;switch(c){case Et.RESET:break;case Et.SET:p=l;break;case Et.UNSET:p=v=>v===l?void 0:v;break;case Et.FIRST:m(),f=0,p=h[f];break;case Et.LAST:m(),f=h.length-1,p=h[f];break;case Et.SET_INDEX:m(),f=d,p=h[f];break;case Et.INCREASE:m(),f=u,f<0&&(f=h.indexOf(l)),f++,f>=h.length&&(f=0),p=h[f];break;case Et.DECREASE:m(),f=u,f<0&&(f=h.indexOf(l)),f--,f<0&&(f=h.length-1),p=h[f];break;default:}p||(f=-1),n(p),i.hoverIndex=f},[t,i]);return{hoverItem:e,dispatch:s,updateItems:a}},di=(t,e)=>Math.round(t)===e?t:e,gs=t=>{const e=t.getBoundingClientRect();return e.width=di(e.width,t.offsetWidth),e.height=di(e.height,t.offsetHeight),e},Mc=(t,e,n,o)=>{const i=gs(e),a=t.getBoundingClientRect(),s=n===window?{left:0,top:0,right:document.documentElement.clientWidth,bottom:window.innerHeight}:n.getBoundingClientRect(),c=bc(o),l=p=>p+a.left-s.left-c.left,d=p=>p+a.left+i.width-s.right+c.right,h=p=>p+a.top-s.top-c.top,u=p=>p+a.top+i.height-s.bottom+c.bottom;return{menuRect:i,containerRect:a,getLeftOverflow:l,getRightOverflow:d,getTopOverflow:h,getBottomOverflow:u,confineHorizontally:p=>{let v=l(p);if(v<0)p-=v;else{const y=d(p);y>0&&(p-=y,v=l(p),v<0&&(p-=v))}return p},confineVertically:p=>{let v=h(p);if(v<0)p-=v;else{const y=u(p);y>0&&(p-=y,v=h(p),v<0&&(p-=v))}return p}}},Pc=({arrowRef:t,menuY:e,anchorRect:n,containerRect:o,menuRect:i})=>{let a=n.top-o.top-e+n.height/2;const s=t.current.offsetHeight*1.25;return a=Math.max(s,a),a=Math.min(a,i.height-s),a},Rc=({anchorRect:t,containerRect:e,menuRect:n,placeLeftorRightY:o,placeLeftX:i,placeRightX:a,getLeftOverflow:s,getRightOverflow:c,confineHorizontally:l,confineVertically:d,arrowRef:h,arrow:u,direction:m,position:f})=>{let p=m,v=o;f!=="initial"&&(v=d(v),f==="anchor"&&(v=Math.min(v,t.bottom-e.top),v=Math.max(v,t.top-e.top-n.height)));let y,E,w;return p==="left"?(y=i,f!=="initial"&&(E=s(y),E<0&&(w=c(a),(w<=0||-E>w)&&(y=a,p="right")))):(y=a,f!=="initial"&&(w=c(y),w>0&&(E=s(i),(E>=0||-E{let a=n.left-o.left-e+n.width/2;const s=t.current.offsetWidth*1.25;return a=Math.max(s,a),a=Math.min(a,i.width-s),a},$c=({anchorRect:t,containerRect:e,menuRect:n,placeToporBottomX:o,placeTopY:i,placeBottomY:a,getTopOverflow:s,getBottomOverflow:c,confineHorizontally:l,confineVertically:d,arrowRef:h,arrow:u,direction:m,position:f})=>{let p=m==="top"?"top":"bottom",v=o;f!=="initial"&&(v=l(v),f==="anchor"&&(v=Math.min(v,t.right-e.left),v=Math.max(v,t.left-e.left-n.width)));let y,E,w;return p==="top"?(y=i,f!=="initial"&&(E=s(y),E<0&&(w=c(a),(w<=0||-E>w)&&(y=a,p="bottom")))):(y=a,f!=="initial"&&(w=c(y),w>0&&(E=s(i),(E>=0||-E{const{menuRect:d,containerRect:h}=l,u=n==="left"||n==="right";let m=u?o:i,f=u?i:o;if(t){const _=c.current;u?m+=_.offsetWidth:f+=_.offsetHeight}const p=s.left-h.left-d.width-m,v=s.right-h.left+m,y=s.top-h.top-d.height-f,E=s.bottom-h.top+f;let w,A;e==="end"?(w=s.right-h.left-d.width,A=s.bottom-h.top-d.height):e==="center"?(w=s.left-h.left-(d.width-s.width)/2,A=s.top-h.top-(d.height-s.height)/2):(w=s.left-h.left,A=s.top-h.top),w+=m,A+=f;const T={...l,anchorRect:s,placeLeftX:p,placeRightX:v,placeLeftorRightY:A,placeTopY:y,placeBottomY:E,placeToporBottomX:w,arrowRef:c,arrow:t,direction:n,position:a};switch(n){case"left":case"right":return Rc(T);case"top":case"bottom":default:return $c(T)}},Ge=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?Fe:Q;function hi(t,e){typeof t=="function"?t(e):t.current=e}const sn=(t,e)=>at(()=>t?e?n=>{hi(t,n),hi(e,n)}:t:e,[t,e]),fi=-9999,vs=({ariaLabel:t,menuClassName:e,menuStyle:n,arrow:o,arrowProps:i={},anchorPoint:a,anchorRef:s,containerRef:c,containerProps:l,externalRef:d,parentScrollingRef:h,align:u="start",direction:m="bottom",position:f="auto",overflow:p="visible",setDownOverflow:v,repositionFlag:y,captureFocus:E=!0,state:w,endTransition:A,isDisabled:T,menuItemFocus:_,gap:b=0,shift:x=0,children:D,onClose:C,focusProps:S,...N})=>{const[R,O]=W({x:fi,y:fi}),[L,z]=W({}),[q,rt]=W(),[J,ot]=W(m),[tt]=W(Ic),[lt,et]=ns(V=>V+1,1),{transition:_t,boundingBoxRef:ft,boundingBoxPadding:It,rootMenuRef:H,rootAnchorRef:ut,scrollNodesRef:mt,reposition:Vt,viewScroll:yt,submenuCloseDelay:Ft}=zt(_o),{submenuCtx:Rt,reposSubmenu:bt=y}=zt(lo),Ot=F(),Kt=F(),Z=F(!1),{hoverItem:nt,dispatch:Dt,updateItems:pt}=Dc(Ot),Tt=Sr(w),dt=Cn(_t,"open"),ue=Cn(_t,"close"),ht=mt.current,Ht=V=>{switch(V.key){case Bt.HOME:Dt(Et.FIRST);break;case Bt.END:Dt(Et.LAST);break;case Bt.UP:Dt(Et.DECREASE,nt);break;case Bt.DOWN:Dt(Et.INCREASE,nt);break;case Bt.SPACE:V.target&&V.target.className.indexOf(ae)!==-1&&V.preventDefault();return;default:return}V.preventDefault(),V.stopPropagation()},K=()=>{w==="closing"&&rt(),qt(A)},Y=V=>{V.stopPropagation(),tt.on(Ft,()=>{Dt(Et.RESET),Ot.current.focus(rr)})},$=V=>{V.target===V.currentTarget&&tt.off()},X=St(V=>{var ln;const At=Ot.current,$t=c.current;if(!At||!$t)return;const Mt=s?(ln=s.current)==null?void 0:ln.getBoundingClientRect():a?{left:a.x,right:a.x,top:a.y,bottom:a.y,width:0,height:0}:null;if(!Mt)return;ht.menu||(ht.menu=(ft?ft.current:xo(H.current))||window);const wt=Mc($t,At,ht.menu,It);let{arrowX:it,arrowY:Le,x:Jt,y:xe,computedDirection:an}=Fc({arrow:o,align:u,direction:m,gap:b,shift:x,position:f,anchorRect:Mt,arrowRef:Kt,positionHelpers:wt});const{menuRect:Be}=wt,cn=Be.height;if(!V&&p!=="visible"){const{getTopOverflow:Rn,getBottomOverflow:ne}=wt;let we,Wt;const he=ne(xe);if(he>0)we=cn-he,Wt=he;else{const ze=Rn(xe);ze<0&&(we=cn+ze,Wt=0-ze,we>=0&&(xe-=ze))}we>=0&&rt({height:we,overflowAmt:Wt})}o&&z({x:it,y:Le}),O({x:Jt,y:xe}),ot(an)},[o,u,It,m,b,x,f,p,a,s,c,ft,H,ht]);Ge(()=>{Tt&&(X(),Z.current&&et()),Z.current=Tt},[Tt,X,bt]),Ge(()=>{q&&!v&&(Ot.current.scrollTop=0)},[q,v]),Ge(()=>pt,[pt]),Q(()=>{let{menu:V}=ht;if(!Tt||!V)return;if(V=V.addEventListener?V:window,!ht.anchors){ht.anchors=[];let wt=xo(ut&&ut.current);for(;wt&&wt!==V;)ht.anchors.push(wt),wt=xo(wt)}let At=yt;if(ht.anchors.length&&At==="initial"&&(At="auto"),At==="initial")return;const $t=()=>{At==="auto"?or(()=>X(!0)):qt(C,{reason:Ln.SCROLL})},Mt=ht.anchors.concat(yt!=="initial"?V:[]);return Mt.forEach(wt=>wt.addEventListener("scroll",$t)),()=>Mt.forEach(wt=>wt.removeEventListener("scroll",$t))},[ut,ht,Tt,C,yt,X]);const Qt=!!q&&q.overflowAmt>0;Q(()=>{if(Qt||!Tt||!h)return;const V=()=>or(X),At=h.current;return At.addEventListener("scroll",V),()=>At.removeEventListener("scroll",V)},[Tt,Qt,h,X]),Q(()=>{if(!Tt||typeof ResizeObserver!="function"||Vt==="initial")return;const V=[],At=new ResizeObserver(wt=>wt.forEach(({target:it})=>{V.indexOf(it)<0?V.push(it):Fa(()=>{X(),et()})})),$t={box:"border-box"};At.observe(Ot.current,$t);const Mt=s==null?void 0:s.current;return Mt&&At.observe(Mt,$t),()=>At.disconnect()},[Tt,Vt,s,X]),Q(()=>{if(!Tt){Dt(Et.RESET),ue||rt();return}const{position:V,alwaysUpdate:At}=_||{},$t=()=>{V===qe.FIRST?Dt(Et.FIRST):V===qe.LAST?Dt(Et.LAST):V>=-1&&Dt(Et.SET_INDEX,void 0,V)};if(At)$t();else if(E){const Mt=setTimeout(()=>{const wt=Ot.current;wt&&!wt.contains(document.activeElement)&&(wt.focus(rr),$t())},dt?170:100);return()=>clearTimeout(Mt)}},[Tt,dt,ue,E,_,Dt]);const gt=at(()=>({isParentOpen:Tt,submenuCtx:tt,dispatch:Dt,updateItems:pt}),[Tt,tt,Dt,pt]);let Ut,de;q&&(v?de=q.overflowAmt:Ut=q.height);const te=at(()=>({reposSubmenu:lt,submenuCtx:tt,overflow:p,overflowAmt:de,parentMenuRef:Ot,parentDir:J}),[lt,tt,p,de,J]),ee=Ut>=0?{maxHeight:Ut,overflow:p}:void 0,Ct=at(()=>({state:w,align:u,dir:J}),[w,u,J]),vt=at(()=>({dir:J}),[J]),jt=ce({block:ae,element:Ec,modifiers:vt,className:i.className}),Gt=r("ul",{role:"menu","aria-label":t,...vo(T),...rn({onPointerEnter:Rt==null?void 0:Rt.off,onPointerMove:Y,onPointerLeave:$,onKeyDown:Ht,onAnimationEnd:K},N),ref:sn(d,Ot),className:ce({block:ae,modifiers:Ct,className:e}),style:{...n,...ee,margin:0,display:w==="closed"?"none":void 0,position:ui,left:R.x,top:R.y},children:[o&&r("li",{"aria-hidden":!0,...i,className:jt,style:{display:"block",position:ui,left:L.x,top:L.y,...i.style},ref:Kt}),r(lo.Provider,{value:te,children:r(Lr.Provider,{value:gt,children:r(ps.Provider,{value:nt,children:qt(D,Ct)})})})]});return l?r(xc,{...l,isOpen:Tt,children:Gt}):Gt},_s=Se(function({"aria-label":e,className:n,containerProps:o,initialMounted:i,unmountOnClose:a,transition:s,transitionTimeout:c,boundingBoxRef:l,boundingBoxPadding:d,reposition:h="auto",submenuOpenDelay:u=300,submenuCloseDelay:m=150,viewScroll:f="initial",portal:p,theming:v,onItemClick:y,...E},w){const A=F(null),T=F({}),{anchorRef:_,state:b,onClose:x}=E,D=at(()=>({initialMounted:i,unmountOnClose:a,transition:s,transitionTimeout:c,boundingBoxRef:l,boundingBoxPadding:d,rootMenuRef:A,rootAnchorRef:_,scrollNodesRef:T,reposition:h,viewScroll:f,submenuOpenDelay:u,submenuCloseDelay:m}),[i,a,s,c,_,l,d,h,f,u,m]),C=at(()=>({handleClick(N,R){N.stopPropagation||qt(y,N);let O=N.keepOpen;O===void 0&&(O=R&&N.key===Bt.SPACE),O||qt(x,{value:N.value,key:N.key,reason:Ln.CLICK})},handleClose(N){qt(x,{key:N,reason:Ln.CLICK})}}),[y,x]);if(!b)return null;const S=r(_o.Provider,{value:D,children:r(xr.Provider,{value:C,children:r(vs,{...E,ariaLabel:e||"Menu",externalRef:w,containerRef:A,containerProps:{className:n,containerRef:A,containerProps:o,theming:v,transition:s,onClose:x}})})});return p===!0&&typeof document<"u"?ao(S,document.body):p?p.target?ao(S,p.target):p.stablePosition?null:S:S}),ir=0,sr=1,uo=2,ho=3,fo=4,Nc=5,ys=6,Bc=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],bs=t=>({_s:t,status:Bc[t],isEnter:tfo}),ar=t=>t?ys:Nc,zc=(t,e)=>{switch(t){case sr:case ir:return uo;case fo:case ho:return ar(e)}},Vc=t=>typeof t=="object"?[t.enter,t.exit]:[t,t],Kc=(t,e)=>setTimeout(()=>{isNaN(document.body.offsetTop)||t(e+1)},0),mi=(t,e,n,o,i)=>{clearTimeout(o.current);const a=bs(t);e(a),n.current=a,i&&i({current:a})},Hc=({enter:t=!0,exit:e=!0,preEnter:n,preExit:o,timeout:i,initialEntered:a,mountOnEnter:s,unmountOnExit:c,onStateChange:l}={})=>{const[d,h]=W(()=>bs(a?uo:ar(s))),u=F(d),m=F(),[f,p]=Vc(i),v=St(()=>{const E=zc(u.current._s,c);E&&mi(E,h,u,m,l)},[l,c]),y=St(E=>{const w=T=>{switch(mi(T,h,u,m,l),T){case sr:f>=0&&(m.current=setTimeout(v,f));break;case fo:p>=0&&(m.current=setTimeout(v,p));break;case ir:case ho:m.current=Kc(w,T);break}},A=u.current.isEnter;typeof E!="boolean"&&(E=!A),E?!A&&w(t?n?ir:sr:uo):A&&w(e?o?ho:fo:ar(c))},[v,l,t,e,n,o,f,p,c]);return[d,y,v]};const Uc=({initialOpen:t,initialMounted:e,unmountOnClose:n,transition:o,transitionTimeout:i=500,onMenuChange:a}={})=>{const s=Cn(o,"open"),c=Cn(o,"close"),[{status:l},d,h]=Hc({initialEntered:t,mountOnEnter:!e,unmountOnExit:n,timeout:i,enter:s,exit:c,onStateChange:St(({current:{isEnter:u,isResolved:m}})=>{!a||u&&s&&m||!u&&c&&m||a({open:u})},[a,s,c])});return[{state:Lc[l],endTransition:h},d]},ws=t=>{const[e,n]=Uc(t),[o,i]=W(),a=(s,c)=>{i({position:s,alwaysUpdate:c}),n(!0)};return[{menuItemFocus:o,...e},n,a]},jc=(t,e)=>{const[n]=W({});return{onMouseDown:()=>{n.v=t&&t!=="closed"},onClick:o=>n.v?n.v=!1:e(!0,o)}},Wc=parseInt(Na)<19,Zc=Se(function({"aria-label":e,captureFocus:n,initialOpen:o,menuButton:i,instanceRef:a,onMenuChange:s,...c},l){const[d,h,u]=ws({...c,onMenuChange:s}),{state:m}=d,f=Sr(m),p=F(null),v=jc(m,(_,b)=>u(b.detail?void 0:qe.FIRST)),y=St(_=>{h(!1),_.key&&p.current.focus()},[h]),E=_=>{switch(_.key){case Bt.UP:u(qe.LAST);break;case Bt.DOWN:u(qe.FIRST);break;default:return}_.preventDefault()},w=qt(i,{open:f});if(!w||!w.type)throw new Error("Menu requires a menuButton prop.");const A={...rn({onKeyDown:E,...v},w.props),ref:sn(Wc?w.ref:w.props.ref,p)};yc(w.type)==="MenuButton"&&(A.isOpen=f);const T=os(w,A);return rs(a,()=>({openMenu:u,closeMenu:()=>h(!1)})),r(B,{children:[T,r(_s,{...c,...d,"aria-label":e||(typeof w.props.children=="string"?w.props.children:"Menu"),anchorRef:p,ref:l,onClose:y})]})}),Mr=(t,e)=>{const n=on(e),o=Se((i,a)=>{const s=F(null);return r(n,{...i,itemRef:s,externalRef:a,isHovering:zt(ps)===s.current})});return o.displayName=`WithHovering(${t})`,o},Es=t=>{const[e,n]=W(!1);return Q(()=>{!t&&n(!1)},[t]),[e,()=>!e&&n(!0),()=>n(!1)]},Ts=(t,e,n)=>{Ge(()=>{if(t)return;const o=e.current;return n(o,!0),()=>{n(o)}},[t,e,n])},qc=Mr("SubMenu",function({"aria-label":e,className:n,disabled:o,direction:i,label:a,openTrigger:s,onMenuChange:c,isHovering:l,instanceRef:d,itemRef:h,captureFocus:u,repositionFlag:m,itemProps:f={},...p}){const v=zt(_o),{rootMenuRef:y,submenuOpenDelay:E,submenuCloseDelay:w}=v,{parentMenuRef:A,parentDir:T,overflow:_}=zt(lo),{isParentOpen:b,submenuCtx:x,dispatch:D,updateItems:C}=zt(Lr),S=_!=="visible",[N,R,O]=ws({...v,onMenuChange:c}),[L,z,q]=Es(l),{state:rt}=N,J=!!o,ot=Sr(rt),tt=F(null),[lt]=W({v:0}),et=()=>{x.off(),lt.v&&(clearTimeout(lt.v),lt.v=0)},_t=(...Z)=>{et(),ft(),!J&&O(...Z)},ft=()=>!l&&!J&&D(Et.SET,h.current),It=Z=>{ft(),s||(lt.v=setTimeout(()=>or(_t),Math.max(Z,0)))},H=Z=>{J||(Z.stopPropagation(),z(),!(lt.v||ot)&&x.on(w,()=>It(E-w),()=>It(E)))},ut=()=>{q(),et(),ot||D(Et.UNSET,h.current)},mt=Z=>{if(l)switch(Z.key){case Bt.ENTER:Z.preventDefault();case Bt.SPACE:case Bt.RIGHT:s!=="none"&&_t(qe.FIRST)}},Vt=Z=>{let nt=!1;switch(Z.key){case Bt.LEFT:ot&&(h.current.focus(),R(!1),nt=!0);break;case Bt.RIGHT:ot||(nt=!0);break}nt&&(Z.preventDefault(),Z.stopPropagation())};Ts(J,h,C),Q(()=>x.toggle(ot),[x,ot]),Q(()=>()=>{clearTimeout(lt.v),x.toggle(!1)},[lt,x]),Q(()=>{l&&b?h.current.focus():R(!1)},[l,b,R,h]),rs(d,()=>({openMenu:(...Z)=>{b&&_t(...Z)},closeMenu:()=>{ot&&(h.current.focus(),R(!1))}}));const yt=at(()=>({open:ot,hover:L||l,disabled:J,submenu:!0}),[ot,l,J,L]),{ref:Ft,className:Rt,...bt}=f,Ot=rn({onPointerEnter:x.off,onPointerMove:H,onPointerLeave:ut,onKeyDown:mt,onClick:()=>s!=="none"&&_t()},bt),Kt=()=>{const Z=r(vs,{...p,...N,ariaLabel:e||(typeof a=="string"?a:"Submenu"),anchorRef:h,containerRef:S?y:tt,direction:i||(T==="right"||T==="left"?T:"right"),parentScrollingRef:S&&A,isDisabled:J}),nt=y.current;return S&&nt?ao(Z,nt):Z};return r("li",{className:ce({block:ae,element:Sc,className:n}),style:{position:"relative"},role:Ir,ref:tt,onKeyDown:Vt,children:[r("div",{role:Dr,"aria-haspopup":!0,"aria-expanded":ot,...vo(J,l),...Ot,ref:sn(Ft,h),className:ce({block:ae,element:Cr,modifiers:yt,className:Rt}),children:at(()=>qt(a,yt),[a,yt])}),rt&&Kt()]})}),As=(t,e,n,o)=>{const[i,a,s]=Es(n),{submenuCloseDelay:c}=zt(_o),{isParentOpen:l,submenuCtx:d,dispatch:h,updateItems:u}=zt(Lr),m=()=>{!n&&!o&&h(Et.SET,t.current)},f=()=>{!o&&h(Et.UNSET,t.current)},p=E=>{n&&!E.currentTarget.contains(E.relatedTarget)&&f()},v=E=>{o||(E.stopPropagation(),a(),d.on(c,m,m))},y=(E,w)=>{s(),d.off(),!w&&f()};return Ts(o,t,u),Q(()=>{n&&l&&e.current&&e.current.focus()},[e,n,l]),{mouseOver:i,setHover:m,onBlur:p,onPointerMove:v,onPointerLeave:y}},kt=Mr("MenuItem",function({className:e,value:n,href:o,type:i,checked:a,disabled:s,children:c,onClick:l,isHovering:d,itemRef:h,externalRef:u,...m}){const f=!!s,{mouseOver:p,setHover:v,...y}=As(h,h,d,f),E=zt(xr),w=zt(Cc),A=i==="radio",T=i==="checkbox",_=!!o&&!f&&!A&&!T,b=A?w.value===n:T?!!a:!1,x=R=>{if(f){R.stopPropagation(),R.preventDefault();return}const O={value:n,syntheticEvent:R};R.key!==void 0&&(O.key=R.key),T&&(O.checked=!b),A&&(O.name=w.name),qt(l,O),A&&qt(w.onRadioChange,O),E.handleClick(O,T||A)},D=R=>{if(d)switch(R.key){case Bt.ENTER:R.preventDefault();case Bt.SPACE:_?h.current.click():x(R)}},C=at(()=>({type:i,disabled:f,hover:p||d,checked:b,anchor:_}),[i,f,p,d,b,_]),S=rn({...y,onPointerDown:v,onKeyDown:D,onClick:x},m),N={role:A?"menuitemradio":T?"menuitemcheckbox":Dr,"aria-checked":A||T?b:void 0,...vo(f,d),...S,ref:sn(u,h),className:ce({block:ae,element:Cr,modifiers:C,className:e}),children:at(()=>qt(c,C),[c,C])};return _?r("li",{role:Ir,children:r("a",{href:o,...N})}):r("li",{...N})}),Gc=Mr("FocusableItem",function({className:e,disabled:n,children:o,isHovering:i,itemRef:a,externalRef:s,...c}){const l=!!n,d=F(null),{mouseOver:h,setHover:u,onPointerLeave:m,...f}=As(a,d,i,l),{handleClose:p}=zt(xr),v=at(()=>({disabled:l,hover:h||i,focusable:!0}),[l,i,h]),y=at(()=>qt(o,{...v,ref:d,closeMenu:p}),[o,v,p]),E=rn({...f,onPointerLeave:w=>m(w,!0),onFocus:u},c);return r("li",{role:Dr,...vo(l),...E,ref:sn(s,a),className:ce({block:ae,element:Cr,modifiers:v,className:e}),children:y})}),mn=on(Se(function({className:e,...n},o){return r("li",{role:"separator",...n,ref:o,className:ce({block:ae,element:Tc,className:e})})})),Tv=on(Se(function({className:e,...n},o){return r("li",{role:Ir,...n,ref:o,className:ce({block:ae,element:Ac,className:e})})})),Av=Se(function({className:e,style:n,takeOverflow:o,...i},a){const s=F(null),[c,l]=W(),{overflow:d,overflowAmt:h}=zt(lo);return Ge(()=>{let u;o&&h>=0&&(u=gs(s.current).height-h,u<0&&(u=0)),l(u>=0?{maxHeight:u,overflow:d}:void 0)},[o,d,h]),Ge(()=>{c&&(s.current.scrollTop=0)},[c]),r("div",{...i,ref:sn(a,s),className:ce({block:ae,element:kc,className:e}),style:{...n,...c}})});var yn=(t=>(t.Mouse="mouse",t.Touch="touch",t.Pointer="pointer",t))(yn||{}),bn=(t=>(t.CancelledByMovement="cancelled-by-movement",t.CancelledByRelease="cancelled-by-release",t.CancelledOutsideElement="cancelled-outside-element",t))(bn||{});const Yc=["mousedown","mousemove","mouseup","mouseleave","mouseout"],Xc=["touchstart","touchmove","touchend","touchcancel"],Qc=["pointerdown","pointermove","pointerup","pointerleave","pointerout"];function Jc(t){return typeof t=="object"&&t!==null&&"pageX"in t&&typeof t.pageX=="number"&&"pageY"in t&&typeof t.pageY=="number"}function tl(t){var e;return Yc.includes((e=t==null?void 0:t.nativeEvent)==null?void 0:e.type)}function ks(t){var e;return Xc.includes((e=t==null?void 0:t.nativeEvent)==null?void 0:e.type)||"touches"in t}function el(t){const{nativeEvent:e}=t;return e?Qc.includes(e==null?void 0:e.type)||"pointerId"in e:!1}function Io(t){return tl(t)||ks(t)||el(t)}function pi(t){var e;const n=ks(t)?(e=t==null?void 0:t.touches)==null?void 0:e[0]:t;return Jc(n)?{x:n.pageX,y:n.pageY}:null}function nl(t){return{target:t.target,currentTarget:t.currentTarget,nativeEvent:t,persist:()=>{}}}function Ss(t,{threshold:e=400,captureEvent:n=!1,detect:o=yn.Pointer,cancelOnMovement:i=!1,cancelOutsideElement:a=!0,filterEvents:s,onStart:c,onMove:l,onFinish:d,onCancel:h}={}){const u=F(!1),m=F(!1),f=F(),p=F(),v=F(t),y=F(null),E=St(_=>b=>{m.current||Io(b)&&(s!==void 0&&!s(b)||(n&&b.persist(),c==null||c(b,{context:_}),y.current=pi(b),m.current=!0,f.current=b.currentTarget,p.current=setTimeout(()=>{v.current&&(v.current(b,{context:_}),u.current=!0)},e)))},[n,s,c,e]),w=St(_=>(b,x)=>{Io(b)&&m.current&&(y.current=null,n&&b.persist(),u.current?d==null||d(b,{context:_}):m.current&&(h==null||h(b,{context:_,reason:x??bn.CancelledByRelease})),u.current=!1,m.current=!1,p.current!==void 0&&clearTimeout(p.current))},[n,d,h]),A=St(_=>b=>{if(Io(b)&&(l==null||l(b,{context:_}),i!==!1&&y.current)){const x=pi(b);if(x){const D=i===!0?25:i,C={x:Math.abs(x.x-y.current.x),y:Math.abs(x.y-y.current.y)};(C.x>D||C.y>D)&&w(_)(b,bn.CancelledByMovement)}}},[w,i,l]),T=St(_=>{if(t===null)return{};switch(o){case yn.Mouse:{const b={onMouseDown:E(_),onMouseMove:A(_),onMouseUp:w(_)};return a&&(b.onMouseLeave=x=>{w(_)(x,bn.CancelledOutsideElement)}),b}case yn.Touch:return{onTouchStart:E(_),onTouchMove:A(_),onTouchEnd:w(_)};case yn.Pointer:{const b={onPointerDown:E(_),onPointerMove:A(_),onPointerUp:w(_)};return a&&(b.onPointerLeave=x=>w(_)(x,bn.CancelledOutsideElement)),b}}},[t,w,a,o,A,E]);return Q(()=>{function _(b){const x=nl(b);w()(x)}return window.addEventListener("mouseup",_),window.addEventListener("touchend",_),window.addEventListener("pointerup",_),()=>{window.removeEventListener("mouseup",_),window.removeEventListener("touchend",_),window.removeEventListener("pointerup",_)}},[w]),Q(()=>()=>{p.current!==void 0&&clearTimeout(p.current)},[]),Q(()=>{v.current=t},[t]),T}const ol=xt(()=>new Intl.DateTimeFormat().resolvedOptions().locale),rl=t=>{const{locale:e,dateYear:n,hideTime:o,formatOpts:i,forceOpts:a}=t||{},s=e.replace(/-[a-z]+$/i,""),c=Sn([s],[ol],e),l=new Date().getFullYear(),d=a||{year:n===l?void 0:"numeric",month:"short",day:"numeric",hour:o?void 0:"numeric",minute:o?void 0:"numeric",...i};try{return Intl.DateTimeFormat(c,d)}catch{}try{return Intl.DateTimeFormat(e,d)}catch{}return Intl.DateTimeFormat(void 0,d)},il=xt(rl);function xn(t,e){return t instanceof Date||(t=new Date(t)),il({dateYear:t.getFullYear(),locale:Pt.locale,...e}).format(t)}function sl(t){const e=URL.parse("./compose/",window.location),{width:n,height:o}=window.screen,i=Math.max(0,(n-600)/2),a=Math.max(0,(o-450)/2),s=Math.min(n,600),c=Math.min(o,450),l=(t==null?void 0:t.uid)||Math.random(),d=window.open(e,"compose"+l,`width=${s},height=${c},left=${i},top=${a}`);return d?d.__COMPOSE__=t:alert(Pt._({id:"4S86wI"})),d}const al=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function cl(){if(al){const t=document.createElement("input");t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.opacity="0",document.body.appendChild(t),t.focus(),setTimeout(()=>{document.body.removeChild(t)},500)}}const ll=document.documentElement,Wn=getComputedStyle(ll),ul=8;let Cs=[0,0,0,0];function Ls(){const t=Wn.getPropertyValue("--sai-top"),e=Wn.getPropertyValue("--sai-right"),n=Wn.getPropertyValue("--sai-bottom"),o=Wn.getPropertyValue("--sai-left");Cs=[Math.max(0,parseInt(t,10)),Math.max(0,parseInt(e,10)),Math.max(0,parseInt(n,10)),Math.max(0,parseInt(o,10))]}requestAnimationFrame(Ls);function xs(t=[]){return Cs.map((n,o)=>(n||ul)+(t[o]||0)).join(" ")}CSS.supports("top: env(safe-area-inset-top)")&&window.addEventListener("resize",Ls,{passive:!0});const gi=5e3;function Zn(t){if(t||(t=!0),j.showCompose){j.composerState.minimized?Lt({duration:gi,text:Pt._({id:"/4fHR1"})}):Lt({duration:gi,text:Pt._({id:"vvl08N"})});return}cl(),j.showCompose=t}const He=document.createElement("div");function dl(t,e){if(!t)return"";const{preProcess:n}=e||{};return He.innerHTML=t.replace(/<\/p>/g,`

+ +`).replace(/<\/li>/g,` +`),He.querySelectorAll("br").forEach(o=>{o.replaceWith(` +`)}),n==null||n(He),He.querySelectorAll(".invisible").forEach(o=>{o.remove()}),He.querySelectorAll(".ellipsis").forEach(o=>{o.append("...")}),He.innerText.replace(/[\r\n]{3,}/g,` + +`).trim()}const yo=xt(dl);function Is(t){var s;const{spoilerText:e,content:n,poll:o,mediaAttachments:i}=t;let a="";return e!=null&&e.trim()?a+=e:a+=yo(n),a=a.trim(),(s=o==null?void 0:o.options)!=null&&s.length&&(a+=` + +📊: +${o.options.map(c=>`${o.multiple?"▪️":"•"} ${c.title}`).join(` +`)}`),i!=null&&i.length&&(a+=" "+i.map(c=>({image:"🖼️",gifv:"🎞️",video:"📹",audio:"🎵",unknown:""})[c.type]||"").join("")),a}const Ds={x:()=>k(()=>import("./icons/close-line-Bfj902o4.js"),[],import.meta.url),heart:()=>k(()=>import("./icons/heart-line-vi3QqJTo.js"),[],import.meta.url),bookmark:()=>k(()=>import("./icons/bookmark-line-BMGZc_Mc.js"),[],import.meta.url),"check-circle":()=>k(()=>import("./icons/check-circle-line-CSlVj8QA.js"),[],import.meta.url),"x-circle":()=>k(()=>import("./icons/close-circle-line-DlCWcUwK.js"),[],import.meta.url),transfer:()=>k(()=>import("./icons/transfer-4-line-BHXBUumZ.js"),[],import.meta.url),rocket:()=>k(()=>import("./icons/rocket-line-B7gBxy4I.js"),[],import.meta.url),"arrow-left":{module:()=>k(()=>import("./icons/arrow-left-line-BGgZ0udH.js"),[],import.meta.url),rtl:!0},"arrow-right":{module:()=>k(()=>import("./icons/arrow-right-line-zKtS4vm5.js"),[],import.meta.url),rtl:!0},"arrow-up":()=>k(()=>import("./icons/arrow-up-line-Bow_AQZ6.js"),[],import.meta.url),"arrow-down":()=>k(()=>import("./icons/arrow-down-line-RSwsrALM.js"),[],import.meta.url),earth:()=>k(()=>import("./icons/earth-line-DW_CwNjP.js"),[],import.meta.url),lock:()=>k(()=>import("./icons/lock-line-BbTC1fux.js"),[],import.meta.url),unlock:()=>k(()=>import("./icons/unlock-line-CGrzBxul.js"),[],import.meta.url),"eye-close":()=>k(()=>import("./icons/eye-close-line-DQnawnJE.js"),[],import.meta.url),"eye-open":()=>k(()=>import("./icons/eye-2-line-Dvog5oyl.js"),[],import.meta.url),message:()=>k(()=>import("./icons/mail-line-Cadg2cpP.js"),[],import.meta.url),comment:{module:()=>k(()=>import("./icons/chat-3-line-C4e7R0Zy.js"),[],import.meta.url),rtl:!0},comment2:{module:()=>k(()=>import("./icons/comment-2-line-DfD-95ou.js"),[],import.meta.url),rtl:!0},home:()=>k(()=>import("./icons/home-3-line-BLD1YYP8.js"),[],import.meta.url),notification:()=>k(()=>import("./icons/notification-line-Cc2m6sh5.js"),[],import.meta.url),follow:()=>k(()=>import("./icons/user-follow-line-CsL-DB1N.js"),[],import.meta.url),"follow-add":()=>k(()=>import("./icons/user-add-line-DuegJyfy.js"),[],import.meta.url),poll:[()=>k(()=>import("./icons/chart-bar-line-W9BuvVdR.js"),[],import.meta.url),"90deg"],pencil:()=>k(()=>import("./icons/pencil-line-BwUdLENj.js"),[],import.meta.url),quill:()=>k(()=>import("./icons/quill-pen-line-oAx8SSeF.js"),[],import.meta.url),at:()=>k(()=>import("./icons/at-line-C4-OGRKX.js"),[],import.meta.url),attachment:()=>k(()=>import("./icons/attachment-line-C4ysC1zZ.js"),[],import.meta.url),upload:()=>k(()=>import("./icons/upload-3-line-BB2RA_2Z.js"),[],import.meta.url),gear:()=>k(()=>import("./icons/settings-3-line-BGrM7a5R.js"),[],import.meta.url),more:()=>k(()=>import("./icons/more-3-line-WfszpsFu.js"),[],import.meta.url),more2:()=>k(()=>import("./icons/more-1-fill-Cnnj9cLP.js"),[],import.meta.url),external:{module:()=>k(()=>import("./icons/external-link-line-BYXsdcMa.js"),[],import.meta.url),rtl:!0},popout:{module:()=>k(()=>import("./icons/external-link-line-BYXsdcMa.js"),[],import.meta.url),rtl:!0},popin:{module:()=>k(()=>import("./icons/external-link-line-BYXsdcMa.js"),[],import.meta.url),rotate:"180deg",rtl:!0},plus:()=>k(()=>import("./icons/add-circle-line-VUOz5dLS.js"),[],import.meta.url),"chevron-left":{module:()=>k(()=>import("./icons/left-line-8vYaPuok.js"),[],import.meta.url),rtl:!0},"chevron-right":{module:()=>k(()=>import("./icons/right-line-E80CeS1Q.js"),[],import.meta.url),rtl:!0},"chevron-down":()=>k(()=>import("./icons/down-line-PlS1iUy8.js"),[],import.meta.url),reply:{module:()=>k(()=>import("./icons/share-forward-line-DX1QbiUu.js"),[],import.meta.url),rotate:"180deg",flip:"horizontal",rtl:!0},thread:()=>k(()=>import("./icons/route-line-D10jSVCO.js"),[],import.meta.url),group:{module:()=>k(()=>import("./icons/group-line-Cw2Phg9p.js"),[],import.meta.url),rtl:!0},bot:()=>k(()=>import("./icons/android-2-line-C7qVwx2U.js"),[],import.meta.url),menu:()=>k(()=>import("./icons/rows-4-line-DIXu-DVG.js"),[],import.meta.url),list:{module:()=>k(()=>import("./icons/list-check-line-BaMf8v8i.js"),[],import.meta.url),rtl:!0},search:()=>k(()=>import("./icons/search-2-line-CoCbFBVR.js"),[],import.meta.url),hashtag:()=>k(()=>import("./icons/hashtag-line-Cml-0qv2.js"),[],import.meta.url),info:()=>k(()=>import("./icons/information-line-Dn255DD5.js"),[],import.meta.url),shortcut:()=>k(()=>import("./icons/lightning-line-cvW5NR-M.js"),[],import.meta.url),user:()=>k(()=>import("./icons/user-4-line-C89P3h09.js"),[],import.meta.url),following:()=>k(()=>import("./icons/walk-line-BZwRwcxJ.js"),[],import.meta.url),pin:()=>k(()=>import("./icons/pin-line-BqseDe3t.js"),[],import.meta.url),unpin:[()=>k(()=>import("./icons/pin-line-BqseDe3t.js"),[],import.meta.url),"180deg"],bus:()=>k(()=>import("./icons/bus-2-line-CfBaNBAi.js"),[],import.meta.url),link:()=>k(()=>import("./icons/link-2-line-SnIkQ_rZ.js"),[],import.meta.url),history:()=>k(()=>import("./icons/history-line-Bi2So-je.js"),[],import.meta.url),share:()=>k(()=>import("./icons/share-2-line-C2byQ30z.js"),[],import.meta.url),sparkles:()=>k(()=>import("./icons/sparkles-line-DWyRj8uB.js"),[],import.meta.url),sparkles2:()=>k(()=>import("./icons/sparkles-2-line-H731KO3v.js"),[],import.meta.url),exit:{module:()=>k(()=>import("./icons/exit-line-NjC63GxM.js"),[],import.meta.url),rtl:!0},translate:()=>k(()=>import("./icons/translate-line-cdOWN72F.js"),[],import.meta.url),play:()=>k(()=>import("./icons/play-fill-D1o3ePO2.js"),[],import.meta.url),trash:()=>k(()=>import("./icons/delete-2-line-C-lQIJNC.js"),[],import.meta.url),mute:{module:()=>k(()=>import("./icons/volume-mute-line-BluUkhVT.js"),[],import.meta.url),rtl:!0},unmute:{module:()=>k(()=>import("./icons/volume-line-dtC5ZFr8.js"),[],import.meta.url),rtl:!0},block:()=>k(()=>import("./icons/forbid-circle-line-f_JQE7a8.js"),[],import.meta.url),unblock:[()=>k(()=>import("./icons/forbid-circle-line-f_JQE7a8.js"),[],import.meta.url),"180deg"],flag:()=>k(()=>import("./icons/flag-1-line-sWzx_4o4.js"),[],import.meta.url),time:()=>k(()=>import("./icons/time-line-CHAmvUdg.js"),[],import.meta.url),refresh:()=>k(()=>import("./icons/refresh-2-line-B3CD5yz0.js"),[],import.meta.url),emoji2:()=>k(()=>import("./icons/emoji-2-line-DODV8bnC.js"),[],import.meta.url),filter:()=>k(()=>import("./icons/filter-2-line-DLBEPhKS.js"),[],import.meta.url),filters:()=>k(()=>import("./icons/filter-line-CuUlgBZU.js"),[],import.meta.url),chart:()=>k(()=>import("./icons/chart-line-line-noCpZUdN.js"),[],import.meta.url),react:()=>k(()=>import("./icons/react-line-C6TecPWI.js"),[],import.meta.url),layout4:{module:()=>k(()=>import("./icons/layout-4-line-BFFb1cPy.js"),[],import.meta.url),rtl:!0},layout5:()=>k(()=>import("./icons/layout-5-line-tauINoiF.js"),[],import.meta.url),announce:{module:()=>k(()=>import("./icons/announcement-line-BdsFnqjO.js"),[],import.meta.url),rtl:!0},alert:()=>k(()=>import("./icons/alert-line-CcwmWSBO.js"),[],import.meta.url),round:()=>k(()=>import("./icons/round-fill-CaZIeOWe.js"),[],import.meta.url),"arrow-up-circle":()=>k(()=>import("./icons/arrow-up-circle-line-SO68bPTf.js"),[],import.meta.url),"arrow-down-circle":()=>k(()=>import("./icons/arrow-down-circle-line-SfuiravZ.js"),[],import.meta.url),clipboard:{module:()=>k(()=>import("./icons/clipboard-line-CIOFpSsX.js"),[],import.meta.url),rtl:!0},"account-edit":()=>k(()=>import("./icons/user-edit-line-CC6Y-fJT.js"),[],import.meta.url),"account-warning":()=>k(()=>import("./icons/user-warning-line-BLfdr8Bj.js"),[],import.meta.url),"account-add":()=>k(()=>import("./icons/user-add-2-line-BbaxtCjf.js"),[],import.meta.url),keyboard:()=>k(()=>import("./icons/keyboard-line-BRd9ohM1.js"),[],import.meta.url),cloud:()=>k(()=>import("./icons/cloud-line-CCOdtB64.js"),[],import.meta.url),month:{module:()=>k(()=>import("./icons/calendar-month-line-DGpTEHfi.js"),[],import.meta.url),rtl:!0},media:()=>k(()=>import("./icons/photo-album-line-DkklX4P5.js"),[],import.meta.url),speak:()=>k(()=>import("./icons/radar-line-Dch2zZ5p.js"),[],import.meta.url),building:()=>k(()=>import("./icons/building-5-line-jPUf3HeC.js"),[],import.meta.url),history2:{module:()=>k(()=>import("./icons/history-2-line-C2uKqj-3.js"),[],import.meta.url),rtl:!0},document:()=>k(()=>import("./icons/document-line-ewA3UKpU.js"),[],import.meta.url),"arrows-right":{module:()=>k(()=>import("./icons/arrows-right-line-B7gMPCMB.js"),[],import.meta.url),rtl:!0},code:()=>k(()=>import("./icons/code-line-_8nrb8Yp.js"),[],import.meta.url),copy:()=>k(()=>import("./icons/copy-2-line-SBRewLs-.js"),[],import.meta.url),quote:{module:()=>k(()=>import("./icons/quote-left-line-D0CgS7V6.js"),[],import.meta.url),rtl:!0},settings:()=>k(()=>import("./icons/settings-6-line-3dTfr4F6.js"),[],import.meta.url),"heart-break":()=>k(()=>import("./icons/heart-crack-line-BlrTdexG.js"),[],import.meta.url),"user-x":()=>k(()=>import("./icons/user-x-line-Dahn1YZg.js"),[],import.meta.url),minimize:()=>k(()=>import("./icons/arrows-down-line-4JmRUmoO.js"),[],import.meta.url),celebrate:()=>k(()=>import("./icons/celebrate-line-CwClz8eZ.js"),[],import.meta.url),schedule:()=>k(()=>import("./icons/calendar-time-add-line-BwP_cVys.js"),[],import.meta.url),day:()=>k(()=>import("./icons/calendar-day-line-zQlj2fPr.js"),[],import.meta.url),camera:()=>k(()=>import("./icons/camera-line-DK82q_yA.js"),[],import.meta.url),endorsement:{module:()=>k(()=>import("./icons/user-star-line-jCNS7JD6.js"),[],import.meta.url),rtl:!0}},hl={xs:8,s:12,m:16,l:20,xl:24,xxl:32},vi={},fl=Ba(function({width:t,height:e,body:n,rotate:o,flip:i}){return r("svg",{viewBox:`0 0 ${t} ${e}`,dangerouslySetInnerHTML:{__html:n},style:{transform:`${o?`rotate(${o})`:""} ${i?"scaleX(-1)":""}`}})},{isShallowEqual:!0,maxSize:Object.keys(Ds).length,matchesArg:(t,e)=>t.icon===e.icon&&t.body===e.body});function M({icon:t,size:e="m",alt:n,title:o,class:i="",style:a={}}){if(!t)return null;const s=hl[e];let c=Ds[t];if(!c)return null;let l,d,h=!1;Array.isArray(c)?[c,l,d]=c:typeof c=="object"&&({rotate:l,flip:d,rtl:h}=c,c=c.module);const[u,m]=W(vi[t]),f=F(t);return Q(()=>{u&&f.current===t||((async()=>{const p=await c();m(p.default),vi[t]=p.default})(),f.current=t)},[t]),r("span",{class:`icon ${i} ${h?"rtl-flip":""}`,title:o||n,style:{width:`${s}px`,height:`${s}px`,...a},"data-icon":t,children:u&&r(fl,{icon:t,width:u.width,height:u.height,body:u.body,rotate:l,flip:d})})}const Qe=Se((t,e)=>{var c;let n;try{n=za()}catch{}let o=(location.hash||"").replace(/^#/,"").trim();o===""&&(o="/");const{to:i,...a}=t;if(o&&o!=="/"&&o.includes("?")){const l=URL.parse(o,location.origin);if((c=l==null?void 0:l.searchParams)!=null&&c.size){const d=Array.from(l.searchParams.entries()).map(([h,u])=>`${h}=${encodeURIComponent(u)}`).join("&");o=l.pathname+"?"+d}}const s=o===i||decodeURIComponent(o)===i;return r("a",{ref:e,href:`#${i}`,...a,class:`${t.class||""} ${s?"is-active":""}`,onClick:l=>{var d,h,u;(h=(d=l.currentTarget)==null?void 0:d.parentNode)!=null&&h.closest("a")&&l.stopPropagation(),n&&(j.prevLocation=n),(u=t.onClick)==null||u.call(t,l)}})});function _i(t){const{className:e,disabled:n,...o}=t;return r(Gc,{className:e,disabled:n,children:({ref:i,closeMenu:a})=>r(Qe,{...o,ref:i,onClick:({detail:s})=>a(s===0?"Enter":void 0)})})}function yi(t){if(t instanceof Date)return!isNaN(t.getTime());{const e=new Date(t);return!isNaN(e.getTime())}}const ml=xt(()=>new Intl.DateTimeFormat().resolvedOptions().locale),bi=xt((t,e={})=>{const n=t.replace(/-[a-z]+$/i,""),o=Sn([n],[ml()],t);try{return new Intl.DateTimeFormat(o,e)}catch{}try{return new Intl.DateTimeFormat(t,e)}catch{}return new Intl.DateTimeFormat(void 0,e)}),pl=xt(t=>new Intl.RelativeTimeFormat(t||void 0)),Je=60,tn=60*Je,Re=24*tn,gl=t=>{const e=pl(Pt.locale),n=(t.getTime()-Date.now())/1e3,o=Math.abs(n);return o{const e=(Date.now()-t.getTime())/1e3;return el+1,0),i=at(()=>new Date(t),[t]),[a,s,c]=at(()=>{if(!yi(i))return[""+(typeof t=="string"?t:""),"",""];let l;if(e==="micro"){const d=new Date;(d.getTime()-i.getTime())/1e3/Re<=1?l=vl(i):d.getFullYear()===i.getFullYear()?l=bi(Pt.locale,{year:void 0,month:"short",day:"numeric"}).format(i):l=bi(Pt.locale,{dateStyle:"short"}).format(i)}return l||(l=gl(i)),[l,i.toISOString(),i.toLocaleString()]},[i,e,n]);return Q(()=>{if(!yi(i))return;let l,d;function h(){d=requestAnimationFrame(()=>{o(),u()})}function u(){const m=(Date.now()-i.getTime())/1e3;m{clearTimeout(l),cancelAnimationFrame(d)}},[]),r("time",{datetime:s,title:c,children:a})}function _l(t){const e=F();return r(qc,{...t,instanceRef:e,itemProps:{onPointerMove:n=>{var o,i;n.pointerType==="touch"&&((i=(o=e.current)==null?void 0:o.openMenu)==null||i.call(o))},onPointerLeave:n=>{var o,i;n.pointerType==="touch"&&((i=(o=e.current)==null?void 0:o.openMenu)==null||i.call(o))},...t.itemProps}})}function yl(t,e=[]){!t||typeof t!="function"||Q(()=>{const n=new CloseWatcher;return n.addEventListener("close",t),()=>{n.destroy()}},e)}const bl=window.CloseWatcher?yl:()=>{},wl=document.getElementById("modal-container");function wi(){return getComputedStyle(document.documentElement).getPropertyValue("--backdrop-theme-color")}function cr({children:t,onClose:e,onClick:n,class:o,minimized:i}){if(!t)return null;const a=F();Q(()=>{let u=setTimeout(()=>{var f;const m=(f=a.current)==null?void 0:f.querySelector('[tabindex="-1"]');m&&m.focus()},100);return()=>clearTimeout(u)},[]);const s=window.CloseWatcher,c=Ze("esc",()=>{setTimeout(()=>{e==null||e()},0)},{enabled:!s&&!!e,keydown:!1,keyup:!0,useKey:!0,ignoreEventWhen:u=>u.metaKey||u.ctrlKey||u.altKey||u.shiftKey},[e]);bl(e,[e]),Q(()=>{const u=document.querySelectorAll(".deck-container");if(i){const m=u[u.length-1];m&&m.tabIndex===-1&&m.focus()}else t?u.forEach(m=>{m.setAttribute("inert","")}):u.forEach(m=>{m.removeAttribute("inert")});return()=>{u.forEach(m=>{m.removeAttribute("inert")})}},[t,i]);const l=F(),d=F();Fe(()=>{if(t&&!i)if(Va.local.get("theme")){const m=wi();l.current=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),l.current&&(d.current=l.current.content,l.current.content=m)}else{const m=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",f=wi();l.current=document.querySelector(`meta[name="theme-color"][media*="${m}"]`),l.current&&(d.current=l.current.content,l.current.content=f)}else l.current&&d.current&&(l.current.content=d.current);return()=>{l.current&&d.current&&(l.current.content=d.current)}},[t,i]);const h=r("div",{ref:u=>{var m;a.current=u,c.current=((m=u==null?void 0:u.querySelector)==null?void 0:m.call(u,'[tabindex="-1"]'))||u},className:o,onClick:u=>{n==null||n(u),u.target===u.currentTarget&&(e==null||e(u))},tabIndex:i?0:"-1",inert:i,onFocus:u=>{var m,f;try{if(u.target===u.currentTarget){const p=(m=a.current)==null?void 0:m.querySelector('[tabindex="-1"]'),v=!!p&&((f=getComputedStyle(p))==null?void 0:f.pointerEvents)!=="none";p&&v&&p.focus()}}catch{}},children:t});return ao(h,wl)}const Ei={s:16,m:20,l:24,xl:32,xxl:50,xxxl:64},pn={},wn=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"),ro=wn.getContext("2d",{willReadFrequently:!0});ro.imageSmoothingEnabled=!1;const El=/missing\.png$/;function Tl({url:t,staticUrl:e,size:n,alt:o="",squircle:i,...a}){n=Ei[n]||n||Ei.m;const s=F(),c=El.test(t);return r("picture",{ref:s,class:`avatar ${i?"squircle":""} ${pn[t]?"has-alpha":""}`,style:{width:n,height:n},title:o,...a,children:[!!e&&r("source",{srcset:e,media:"(prefers-reduced-motion: reduce)"}),!!t&&r("img",{src:t,width:n,height:n,alt:o,loading:"lazy",decoding:"async",fetchPriority:"low",crossOrigin:pn[t]===void 0&&!c?"anonymous":void 0,onError:l=>{l.target.crossOrigin&&(l.target.crossOrigin=null,l.target.src=t)},onLoad:l=>{s.current&&(s.current.dataset.loaded=!0),pn[t]===void 0&&(c||setTimeout(()=>{try{const{width:d,height:h}=l.target;wn.width!==d&&(wn.width=d),wn.height!==h&&(wn.height=h),ro.drawImage(l.target,0,0);const u=ro.getImageData(0,0,d,h),m=u.data.filter((f,p)=>p%4===3&&f<=128).length/(u.data.length/4)>.1;m&&s.current.classList.add("has-alpha"),pn[t]=m,ro.clearRect(0,0,d,h)}catch{pn[t]=!1}},1))}})]})}const ve=xt(Tl);let lr=!1;const Al=new MutationObserver(t=>{t.forEach(e=>{if(e.type==="attributes"){const{dir:n}=e.target;n==="rtl"?lr=!0:lr=!1}})});Al.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});function ur(){return lr}function kl(){const[t,e]=W({width:null,height:null});return Fe(()=>{const n=()=>{e({width:window.innerWidth,height:window.innerHeight})};return n(),window.addEventListener("resize",n,{passive:!0}),()=>{window.removeEventListener("resize",n)}},[]),t}function Ms(t){const{containerProps:e,instanceRef:n,align:o}=t,i=kl(),a=n!=null&&n.current?n:F(),s=ur()?o==="end"?"start":o==="start"?"end":o:o;return r(Zc,{boundingBoxPadding:xs(),repositionFlag:`${i.width}x${i.height}`,unmountOnClose:!0,...t,align:s,instanceRef:a,containerProps:{onClick:c=>{var l,d,h;c.target===c.currentTarget&&((d=(l=a.current)==null?void 0:l.closeMenu)==null||d.call(l)),(h=e==null?void 0:e.onClick)==null||h.call(e,c)},...e}})}function Do({subMenu:t=!1,confirm:e=!0,confirmLabel:n,menuItemClassName:o,menuFooter:i,menuExtras:a,...s}){const{children:c,onClick:l,...d}=s;return e?r(t?_l:Ms,{openTrigger:"clickOnly",direction:"bottom",overflow:"auto",gap:-8,shift:8,menuClassName:"menu-emphasized",...d,menuButton:t?void 0:c,label:t?c:void 0,children:[r(kt,{className:o,onClick:l,children:n}),a,i]}):t?r(kt,{...s}):l?Ka(c,{onClick:l}):c}function dr({staticUrl:t,alt:e,url:n}){return r("picture",{children:[t&&r("source",{srcset:t,media:"(prefers-reduced-motion: reduce)"}),r("img",{src:n,alt:e,class:"shortcode-emoji emoji",width:"16",height:"16",loading:"lazy",decoding:"async",fetchPriority:"low"},e||n)]})}const Sl=xt(t=>new RegExp(`:(${t.join("|")}):`,"g"));function Cl({text:t,emojis:e}){if(!t)return"";if(!(e!=null&&e.length)||t.indexOf(":")===-1)return t;const n=Sl(e.map(i=>i.shortcode));return t.split(n).map((i,a)=>{const s=e.find(c=>c.shortcode===i);if(s){const{url:c,staticUrl:l}=s;return r(dr,{staticUrl:l,alt:i,url:c},i+"-"+a)}return i})}const en=xt(Cl),Ll=xt(t=>{const e={sensitivity:"base"};try{return new Intl.Collator(t||void 0,e)}catch{return new Intl.Collator(void 0,e)}}),xl=/([^@]+)(@.+)/i,Il=/(\:(\w|\+|\-)+\:)(?=|[\!\.\?]|$)/g,Dl=/\s+/g,Ml=/[^a-z0-9@\.]/gi;function Pl({account:t,instance:e,showAvatar:n,showAcct:o,short:i,external:a,onClick:s}){const{i18n:c}=le();if(!t)return null;const{acct:l,avatar:d,avatarStatic:h,id:u,url:m,displayName:f,emojis:p,bot:v,username:y}=t,[E,w,A]=l.match(xl)||[,l];e||(e=co().instance);const T=y.toLowerCase().trim(),_=(f||"").toLowerCase().trim(),b=_.replace(Il,"").replace(Dl,""),x=b.replace(Ml,""),D=!i&&(T===_||T===b||T===x||Ll(c.locale).compare(T,b)===0)||x===l.toLowerCase();return r("a",{class:`name-text ${o?"show-acct":""} ${i?"short":""}`,href:m,target:a?"_blank":null,title:f?`${f} (${A?"":"@"}${l})`:`${A?"":"@"}${l}`,onClick:C=>{if(!a&&!C.shiftKey){if(C.preventDefault(),C.stopPropagation(),s)return s(C);if(C.metaKey||C.ctrlKey||C.shiftKey||C.which===2){const S=`#/${e}/a/${u}`;window.open(S,"_blank");return}j.showAccount={account:t,instance:e}}},children:[n&&r(B,{children:[r(ve,{url:h||d,squircle:v})," "]}),f&&!i?r(B,{children:[r("b",{dir:"auto",children:r(en,{text:f,emojis:p})}),!o&&!D&&r(B,{children:[" ",r("i",{class:"bidi-isolate",children:["@",y]})]})]}):i?r("i",{children:y}):r("b",{children:y}),o&&r(B,{children:[r("br",{}),r("i",{class:"bidi-isolate",children:[A?"":"@",w,!!A&&r("span",{class:"ib",children:A})]})]})]})}const Ae=xt(Pl),Rl="Аҧсшәа",Ol="Acèh",$l="Lëbacoli",Fl="Afár",Nl="Afrikaans",Bl="Shqip",zl="Dhalur",Vl="አማርኛ",Kl="العربية",Hl="Հայերեն",Ul="অসমীয়া",jl="Авар мацӀ",Wl="अवधी",Zl="Aymar aru",ql="Azərbaycanca",Gl="Basa Bali",Yl="بلوچی",Xl="Bamanankan",Ql="Baoulé",Jl="Башҡортса",tu="Euskara",eu="Batak Karo",nu="Batak Simalungun",ou="Batak Toba",ru="Беларуская",iu="Ichibemba",su="বাংলা",au="Betawi",cu="भोजपुरी",lu="Bikol",uu="Bosanski",du="Brezhoneg",hu="Български",fu="Буряад",mu="粵語",pu="Català",gu="Cebuano",vu="Chamoru",_u="Нохчийн мотт",yu="Chichewa",bu="Kapasen Chuuk",wu="Чӑвашла",Eu="Corsu",Tu="Qırımtatarca (Кирилл)",Au="Hrvatski",ku="Čeština",Su="Dansk",Cu="ދިވެހި",Lu="Thuɔŋjäŋ",xu="डोगरी",Iu="Dombe",Du="Nederlands",Mu="Jula",Pu="རྫོང་ཁ",Ru="English",Ou="Esperanto",$u="Eesti",Fu="Eʋegbe",Nu="Føroyskt",Bu="Vosa Vakaviti",zu="Tagalog",Vu="Suomi",Ku="Fon",Hu="Français",Uu="Frysk",ju="Furlan",Wu="Fulfulde",Zu="Gã",qu="Galego",Gu="ქართული",Yu="Deutsch",Xu="Ελληνικά",Qu="Avañe'ẽ",Ju="ગુજરાતી",td="Kreyòl ayisyen",ed="Hakha Chin",nd="Hausa",od="ʻŌlelo Hawaiʻi",rd="עברית",id="Hiligaynon",sd="हिन्दी",ad="Hmoob",cd="Magyar",ld="Hunsrik",ud="Iban",dd="Íslenska",hd="Igbo",fd="Iloko",md="Bahasa Indonesia",pd="ᐃᓄᒃᑎᑐᑦ",gd="Gaeilge",vd="Italiano",_d="Patwa",yd="日本語",bd="Basa Jawa",wd="Jinghpaw",Ed="Kalaallisut",Td="ಕನ್ನಡ",Ad="Kanuri",kd="Kapampangan",Sd="Қазақша",Cd="Khasi",Ld="ភាសាខ្មែរ",xd="Rukiga",Id="Kikongo",Dd="Kinyarwanda",Md="Kituba",Pd="Kokborok",Rd="Коми кыв",Od="कोंकणी",$d="한국어",Fd="Krio",Nd="Kurdî (Kurmancî)",Bd="کوردی (سۆرانی)",zd="Кыргызча",Vd="ລາວ",Kd="Latgaļu",Hd="Latina",Ud="Latviešu",jd="Ligure",Wd="Limburgs",Zd="Lingála",qd="Lietuvių",Gd="Lombard",Yd="Luganda",Xd="Dholuo",Qd="Lëtzebuergesch",Jd="Македонски",th="Madhurâ",eh="मैथिली",nh="Makassar",oh="Malagasy",rh="Bahasa Melayu",ih="മലയാളം",sh="Malti",ah="Mam",ch="Gaelg",lh="Te Reo Māori",uh="मराठी",dh="Kajin M̧ajeļ",hh="मारवाड़ी",fh="Kreol Morisien",mh="Олык марий",ph="Baso Minang",gh="Mizo ṭawng",vh="Монгол",_h="မြန်မာစာ",yh="Náhuatl",bh="isiNdebele",wh="नेपाली",Eh="Norsk",Th="Thok Nath",Ah="Occitan",kh="ଓଡ଼ିଆ",Sh="Afaan Oromoo",Ch="Ирон æвзаг",Lh="Pangasinan",xh="Papiamentu",Ih="پښتو",Dh="فارسی",Mh="Polski",Ph="Português (Brasil)",Rh="ਪੰਜਾਬੀ",Oh="Runa Simi",$h="Qʼeqchiʼ",Fh="Romani čhib",Nh="Română",Bh="Ikirundi",zh="Русский",Vh="Davvisámegiella",Kh="Gagana Samoa",Hh="Sängö",Uh="संस्कृतम्",jh="ᱥᱟᱱᱛᱟᱲᱤ",Wh="Gàidhlig",Zh="Sepedi",qh="Српски",Gh="Sesotho",Yh="Kreol seselwa",Xh="လိၵ်ႈတႆး",Qh="chiShona",Jh="Sicilianu",tf="Ślōnskŏ",ef="سنڌي",nf="සිංහල",of="Slovenčina",rf="Slovenščina",sf="Soomaali",af="Español",cf="Basa Sunda",lf="Susu",uf="Kiswahili",df="siSwati",hf="Svenska",ff="Reo Tahiti",mf="Тоҷикӣ",pf="ⵜⴰⵎⴰⵣⵉⵖⵜ",gf="தமிழ்",vf="Татарча",_f="తెలుగు",yf="Tetun",bf="ไทย",wf="བོད་ཡིག",Ef="ትግርኛ",Tf="Tiv",Af="Tok Pisin",kf="Lea fakatonga",Sf="Tshiluba",Cf="Xitsonga",Lf="Setswana",xf="ತುಳು",If="chiTumbuka",Df="Türkçe",Mf="Türkmençe",Pf="Тыва дыл",Rf="Akankasa",Of="Удмурт кыл",$f="Українська",Ff="اردو",Nf="ئۇيغۇرچە",Bf="Oʻzbekcha",zf="Tshivenḓa",Vf="Vèneto",Kf="Tiếng Việt",Hf="Winaray",Uf="Cymraeg",jf="Wolof",Wf="isiXhosa",Zf="Саха тыла",qf="ייִדיש",Gf="Yorùbá",Yf="Màaya T'àan",Xf="Didxazá",Qf="isiZulu",Mo={ab:Rl,ace:Ol,ach:$l,aa:Fl,af:Nl,sq:Bl,alz:zl,am:Vl,ar:Kl,hy:Hl,as:Ul,av:jl,awa:Wl,ay:Zl,az:ql,ban:Gl,bal:Yl,bm:Xl,bci:Ql,ba:Jl,eu:tu,btx:eu,bts:nu,bbc:ou,be:ru,bem:iu,bn:su,bew:au,bho:cu,bik:lu,bs:uu,br:du,bg:hu,bua:fu,yue:mu,ca:pu,ceb:gu,ch:vu,ce:_u,ny:yu,"zh-CN":"简体中文","zh-TW":"繁體中文",chk:bu,cv:wu,co:Eu,crh:Tu,"crh-Latn":"Qırımtatarca (Latin)",hr:Au,cs:ku,da:Su,"fa-AF":"درى",dv:Cu,din:Lu,doi:xu,dov:Iu,nl:Du,dyu:Mu,dz:Pu,en:Ru,eo:Ou,et:$u,ee:Fu,fo:Nu,fj:Bu,tl:zu,fi:Vu,fon:Ku,fr:Hu,"fr-CA":"Français (Canada)",fy:Uu,fur:ju,ff:Wu,gaa:Zu,gl:qu,ka:Gu,de:Yu,el:Xu,gn:Qu,gu:Ju,ht:td,cnh:ed,ha:nd,haw:od,iw:rd,hil:id,hi:sd,hmn:ad,hu:cd,hrx:ld,iba:ud,is:dd,ig:hd,ilo:fd,id:md,"iu-Latn":"Inuktitut (Latin)",iu:pd,ga:gd,it:vd,jam:_d,ja:yd,jw:bd,kac:wd,kl:Ed,kn:Td,kr:Ad,pam:kd,kk:Sd,kha:Cd,km:Ld,cgg:xd,kg:Id,rw:Dd,ktu:Md,trp:Pd,kv:Rd,gom:Od,ko:$d,kri:Fd,ku:Nd,ckb:Bd,ky:zd,lo:Vd,ltg:Kd,la:Hd,lv:Ud,lij:jd,li:Wd,ln:Zd,lt:qd,lmo:Gd,lg:Yd,luo:Xd,lb:Qd,mk:Jd,mad:th,mai:eh,mak:nh,mg:oh,ms:rh,"ms-Arab":"بهاس ملايو",ml:ih,mt:sh,mam:ah,gv:ch,mi:lh,mr:uh,mh:dh,mwr:hh,mfe:fh,chm:mh,"mni-Mtei":"ꯃꯤꯇꯩꯂꯣꯟ",min:ph,lus:gh,mn:vh,my:_h,nhe:yh,"ndc-ZW":"Ndau",nr:bh,new:"नेपाल भाषा",ne:wh,"bm-Nkoo":"ߒߞߏ",no:Eh,nus:Th,oc:Ah,or:kh,om:Sh,os:Ch,pag:Lh,pap:xh,ps:Ih,fa:Dh,pl:Mh,pt:Ph,"pt-PT":"Português (Portugal)",pa:Rh,"pa-Arab":"پنجابی",qu:Oh,kek:$h,rom:Fh,ro:Nh,rn:Bh,ru:zh,se:Vh,sm:Kh,sg:Hh,sa:Uh,"sat-Latn":"Santali (Latin)",sat:jh,gd:Wh,nso:Zh,sr:qh,st:Gh,crs:Yh,shn:Xh,sn:Qh,scn:Jh,szl:tf,sd:ef,si:nf,sk:of,sl:rf,so:sf,es:af,su:cf,sus:lf,sw:uf,ss:df,sv:hf,ty:ff,tg:mf,"ber-Latn":"Tamazight (Latin)",ber:pf,ta:gf,tt:vf,te:_f,tet:yf,th:bf,bo:wf,ti:Ef,tiv:Tf,tpi:Af,to:kf,lua:Sf,ts:Cf,tn:Lf,tcy:xf,tum:If,tr:Df,tk:Mf,tyv:Pf,ak:Rf,udm:Of,uk:$f,ur:Ff,ug:Nf,uz:Bf,ve:zf,vec:Vf,vi:Kf,war:Hf,cy:Uf,wo:jf,xh:Wf,sah:Zf,yi:qf,yo:Gf,yua:Yf,zap:Xf,zu:Qf},qn={"zh-YUE":"YUE",zh_HANT:"zh-Hant"},Po=xt(t=>new Intl.DisplayNames(t||void 0,{type:"language"}));function Jf(t){let e,n;typeof t=="object"&&({code:t,locale:e,fallback:n}=t);try{const o=Po(e||Pt.locale).of(t);if(o!==t)return o;if(!n){const i=Po(t).of(t);if(i!==t)return i;const a=Mo==null?void 0:Mo[e];if(a!==t)return a}return n||""}catch{if(qn[t])try{const i=Po(qn[e]||e||Pt.locale).of(qn[t]);return i!==qn[t]?i:n||""}catch{}return n||""}}const gn=xt(Jf),tm={auto:"Detect language",ab:"Abkhaz",ace:"Acehnese",ach:"Acholi",aa:"Afar",af:"Afrikaans",sq:"Albanian",alz:"Alur",am:"Amharic",ar:"Arabic",hy:"Armenian",as:"Assamese",av:"Avar",awa:"Awadhi",ay:"Aymara",az:"Azerbaijani",ban:"Balinese",bal:"Baluchi",bm:"Bambara",bci:"Baoulé",ba:"Bashkir",eu:"Basque",btx:"Batak Karo",bts:"Batak Simalungun",bbc:"Batak Toba",be:"Belarusian",bem:"Bemba",bn:"Bengali",bew:"Betawi",bho:"Bhojpuri",bik:"Bikol",bs:"Bosnian",br:"Breton",bg:"Bulgarian",bua:"Buryat",yue:"Cantonese",ca:"Catalan",ceb:"Cebuano",ch:"Chamorro",ce:"Chechen",ny:"Chichewa","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)",chk:"Chuukese",cv:"Chuvash",co:"Corsican",crh:"Crimean Tatar (Cyrillic)","crh-Latn":"Crimean Tatar (Latin)",hr:"Croatian",cs:"Czech",da:"Danish","fa-AF":"Dari",dv:"Dhivehi",din:"Dinka",doi:"Dogri",dov:"Dombe",nl:"Dutch",dyu:"Dyula",dz:"Dzongkha",en:"English",eo:"Esperanto",et:"Estonian",ee:"Ewe",fo:"Faroese",fj:"Fijian",tl:"Filipino",fi:"Finnish",fon:"Fon",fr:"French","fr-CA":"French (Canada)",fy:"Frisian",fur:"Friulian",ff:"Fulani",gaa:"Ga",gl:"Galician",ka:"Georgian",de:"German",el:"Greek",gn:"Guarani",gu:"Gujarati",ht:"Haitian Creole",cnh:"Hakha Chin",ha:"Hausa",haw:"Hawaiian",iw:"Hebrew",hil:"Hiligaynon",hi:"Hindi",hmn:"Hmong",hu:"Hungarian",hrx:"Hunsrik",iba:"Iban",is:"Icelandic",ig:"Igbo",ilo:"Ilocano",id:"Indonesian","iu-Latn":"Inuktut (Latin)",iu:"Inuktut (Syllabics)",ga:"Irish",it:"Italian",jam:"Jamaican Patois",ja:"Japanese",jw:"Javanese",kac:"Jingpo",kl:"Kalaallisut",kn:"Kannada",kr:"Kanuri",pam:"Kapampangan",kk:"Kazakh",kha:"Khasi",km:"Khmer",cgg:"Kiga",kg:"Kikongo",rw:"Kinyarwanda",ktu:"Kituba",trp:"Kokborok",kv:"Komi",gom:"Konkani",ko:"Korean",kri:"Krio",ku:"Kurdish (Kurmanji)",ckb:"Kurdish (Sorani)",ky:"Kyrgyz",lo:"Lao",ltg:"Latgalian",la:"Latin",lv:"Latvian",lij:"Ligurian",li:"Limburgish",ln:"Lingala",lt:"Lithuanian",lmo:"Lombard",lg:"Luganda",luo:"Luo",lb:"Luxembourgish",mk:"Macedonian",mad:"Madurese",mai:"Maithili",mak:"Makassar",mg:"Malagasy",ms:"Malay","ms-Arab":"Malay (Jawi)",ml:"Malayalam",mt:"Maltese",mam:"Mam",gv:"Manx",mi:"Maori",mr:"Marathi",mh:"Marshallese",mwr:"Marwadi",mfe:"Mauritian Creole",chm:"Meadow Mari","mni-Mtei":"Meiteilon (Manipuri)",min:"Minang",lus:"Mizo",mn:"Mongolian",my:"Myanmar (Burmese)",nhe:"Nahuatl (Eastern Huasteca)","ndc-ZW":"Ndau",nr:"Ndebele (South)",new:"Nepalbhasa (Newari)",ne:"Nepali","bm-Nkoo":"NKo",no:"Norwegian",nus:"Nuer",oc:"Occitan",or:"Odia (Oriya)",om:"Oromo",os:"Ossetian",pag:"Pangasinan",pap:"Papiamento",ps:"Pashto",fa:"Persian",pl:"Polish",pt:"Portuguese (Brazil)","pt-PT":"Portuguese (Portugal)",pa:"Punjabi (Gurmukhi)","pa-Arab":"Punjabi (Shahmukhi)",qu:"Quechua",kek:"Qʼeqchiʼ",rom:"Romani",ro:"Romanian",rn:"Rundi",ru:"Russian",se:"Sami (North)",sm:"Samoan",sg:"Sango",sa:"Sanskrit","sat-Latn":"Santali (Latin)",sat:"Santali (Ol Chiki)",gd:"Scots Gaelic",nso:"Sepedi",sr:"Serbian",st:"Sesotho",crs:"Seychellois Creole",shn:"Shan",sn:"Shona",scn:"Sicilian",szl:"Silesian",sd:"Sindhi",si:"Sinhala",sk:"Slovak",sl:"Slovenian",so:"Somali",es:"Spanish",su:"Sundanese",sus:"Susu",sw:"Swahili",ss:"Swati",sv:"Swedish",ty:"Tahitian",tg:"Tajik","ber-Latn":"Tamazight",ber:"Tamazight (Tifinagh)",ta:"Tamil",tt:"Tatar",te:"Telugu",tet:"Tetum",th:"Thai",bo:"Tibetan",ti:"Tigrinya",tiv:"Tiv",tpi:"Tok Pisin",to:"Tongan",lua:"Tshiluba",ts:"Tsonga",tn:"Tswana",tcy:"Tulu",tum:"Tumbuka",tr:"Turkish",tk:"Turkmen",tyv:"Tuvan",ak:"Twi",udm:"Udmurt",uk:"Ukrainian",ur:"Urdu",ug:"Uyghur",uz:"Uzbek",ve:"Venda",vec:"Venetian",vi:"Vietnamese",war:"Waray",cy:"Welsh",wo:"Wolof",xh:"Xhosa",sah:"Yakut",yi:"Yiddish",yo:"Yoruba",yua:"Yucatec Maya",zap:"Zapotec",zu:"Zulu"},em={ab:"Abkhaz",ace:"Acehnese",ach:"Acholi",aa:"Afar",af:"Afrikaans",sq:"Albanian",alz:"Alur",am:"Amharic",ar:"Arabic",hy:"Armenian",as:"Assamese",av:"Avar",awa:"Awadhi",ay:"Aymara",az:"Azerbaijani",ban:"Balinese",bal:"Baluchi",bm:"Bambara",bci:"Baoulé",ba:"Bashkir",eu:"Basque",btx:"Batak Karo",bts:"Batak Simalungun",bbc:"Batak Toba",be:"Belarusian",bem:"Bemba",bn:"Bengali",bew:"Betawi",bho:"Bhojpuri",bik:"Bikol",bs:"Bosnian",br:"Breton",bg:"Bulgarian",bua:"Buryat",yue:"Cantonese",ca:"Catalan",ceb:"Cebuano",ch:"Chamorro",ce:"Chechen",ny:"Chichewa","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)",chk:"Chuukese",cv:"Chuvash",co:"Corsican",crh:"Crimean Tatar (Cyrillic)","crh-Latn":"Crimean Tatar (Latin)",hr:"Croatian",cs:"Czech",da:"Danish","fa-AF":"Dari",dv:"Dhivehi",din:"Dinka",doi:"Dogri",dov:"Dombe",nl:"Dutch",dyu:"Dyula",dz:"Dzongkha",en:"English",eo:"Esperanto",et:"Estonian",ee:"Ewe",fo:"Faroese",fj:"Fijian",tl:"Filipino",fi:"Finnish",fon:"Fon",fr:"French","fr-CA":"French (Canada)",fy:"Frisian",fur:"Friulian",ff:"Fulani",gaa:"Ga",gl:"Galician",ka:"Georgian",de:"German",el:"Greek",gn:"Guarani",gu:"Gujarati",ht:"Haitian Creole",cnh:"Hakha Chin",ha:"Hausa",haw:"Hawaiian",iw:"Hebrew",hil:"Hiligaynon",hi:"Hindi",hmn:"Hmong",hu:"Hungarian",hrx:"Hunsrik",iba:"Iban",is:"Icelandic",ig:"Igbo",ilo:"Ilocano",id:"Indonesian","iu-Latn":"Inuktut (Latin)",iu:"Inuktut (Syllabics)",ga:"Irish",it:"Italian",jam:"Jamaican Patois",ja:"Japanese",jw:"Javanese",kac:"Jingpo",kl:"Kalaallisut",kn:"Kannada",kr:"Kanuri",pam:"Kapampangan",kk:"Kazakh",kha:"Khasi",km:"Khmer",cgg:"Kiga",kg:"Kikongo",rw:"Kinyarwanda",ktu:"Kituba",trp:"Kokborok",kv:"Komi",gom:"Konkani",ko:"Korean",kri:"Krio",ku:"Kurdish (Kurmanji)",ckb:"Kurdish (Sorani)",ky:"Kyrgyz",lo:"Lao",ltg:"Latgalian",la:"Latin",lv:"Latvian",lij:"Ligurian",li:"Limburgish",ln:"Lingala",lt:"Lithuanian",lmo:"Lombard",lg:"Luganda",luo:"Luo",lb:"Luxembourgish",mk:"Macedonian",mad:"Madurese",mai:"Maithili",mak:"Makassar",mg:"Malagasy",ms:"Malay","ms-Arab":"Malay (Jawi)",ml:"Malayalam",mt:"Maltese",mam:"Mam",gv:"Manx",mi:"Maori",mr:"Marathi",mh:"Marshallese",mwr:"Marwadi",mfe:"Mauritian Creole",chm:"Meadow Mari","mni-Mtei":"Meiteilon (Manipuri)",min:"Minang",lus:"Mizo",mn:"Mongolian",my:"Myanmar (Burmese)",nhe:"Nahuatl (Eastern Huasteca)","ndc-ZW":"Ndau",nr:"Ndebele (South)",new:"Nepalbhasa (Newari)",ne:"Nepali","bm-Nkoo":"NKo",no:"Norwegian",nus:"Nuer",oc:"Occitan",or:"Odia (Oriya)",om:"Oromo",os:"Ossetian",pag:"Pangasinan",pap:"Papiamento",ps:"Pashto",fa:"Persian",pl:"Polish",pt:"Portuguese (Brazil)","pt-PT":"Portuguese (Portugal)",pa:"Punjabi (Gurmukhi)","pa-Arab":"Punjabi (Shahmukhi)",qu:"Quechua",kek:"Qʼeqchiʼ",rom:"Romani",ro:"Romanian",rn:"Rundi",ru:"Russian",se:"Sami (North)",sm:"Samoan",sg:"Sango",sa:"Sanskrit","sat-Latn":"Santali (Latin)",sat:"Santali (Ol Chiki)",gd:"Scots Gaelic",nso:"Sepedi",sr:"Serbian",st:"Sesotho",crs:"Seychellois Creole",shn:"Shan",sn:"Shona",scn:"Sicilian",szl:"Silesian",sd:"Sindhi",si:"Sinhala",sk:"Slovak",sl:"Slovenian",so:"Somali",es:"Spanish",su:"Sundanese",sus:"Susu",sw:"Swahili",ss:"Swati",sv:"Swedish",ty:"Tahitian",tg:"Tajik","ber-Latn":"Tamazight",ber:"Tamazight (Tifinagh)",ta:"Tamil",tt:"Tatar",te:"Telugu",tet:"Tetum",th:"Thai",bo:"Tibetan",ti:"Tigrinya",tiv:"Tiv",tpi:"Tok Pisin",to:"Tongan",lua:"Tshiluba",ts:"Tsonga",tn:"Tswana",tcy:"Tulu",tum:"Tumbuka",tr:"Turkish",tk:"Turkmen",tyv:"Tuvan",ak:"Twi",udm:"Udmurt",uk:"Ukrainian",ur:"Urdu",ug:"Uyghur",uz:"Uzbek",ve:"Venda",vec:"Venetian",vi:"Vietnamese",war:"Waray",cy:"Welsh",wo:"Wolof",xh:"Xhosa",sah:"Yakut",yi:"Yiddish",yo:"Yoruba",yua:"Yucatec Maya",zap:"Zapotec",zu:"Zulu"},nm={},Ps={sl:tm,tl:em,al:nm},om=Object.entries(Ps.tl).map(([t,{name:e}])=>({code:t,name:e})),rm=xt(()=>[new Intl.DateTimeFormat().resolvedOptions().locale,...navigator.languages]),im=()=>Sn(rm(),om.map(t=>t.code.replace("_","-")),"en");function Rs(t=!1){if(t){const{contentTranslationTargetLanguage:e}=j.settings;if(e)return e}return im()}const Ti=["byte","kilobyte","megabyte","gigabyte","terabyte","petabyte"];function kv(t){const e=Math.min(Math.floor(Math.log2(t)/10),Ti.length-1),n=t/1024**e;return Pt.number(n,{style:"unit",unit:Ti[e],unitDisplay:"narrow",maximumFractionDigits:0})}const Ye=2147483647,re=36,Pr=1,In=26,sm=38,am=700,Os=72,$s=128,Fs="-",cm=/^xn--/,lm=/[^\0-\x7F]/,um=/[\x2E\u3002\uFF0E\uFF61]/g,dm={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Ro=re-Pr,ie=Math.floor,Oo=String.fromCharCode;function Te(t){throw new RangeError(dm[t])}function hm(t,e){const n=[];let o=t.length;for(;o--;)n[o]=e(t[o]);return n}function Ns(t,e){const n=t.split("@");let o="";n.length>1&&(o=n[0]+"@",t=n[1]),t=t.replace(um,".");const i=t.split("."),a=hm(i,e).join(".");return o+a}function Bs(t){const e=[];let n=0;const o=t.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...t),mm=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:re},Ai=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},zs=function(t,e,n){let o=0;for(t=n?ie(t/am):t>>1,t+=ie(t/e);t>Ro*In>>1;o+=re)t=ie(t/Ro);return ie(o+(Ro+1)*t/(t+sm))},Vs=function(t){const e=[],n=t.length;let o=0,i=$s,a=Os,s=t.lastIndexOf(Fs);s<0&&(s=0);for(let c=0;c=128&&Te("not-basic"),e.push(t.charCodeAt(c));for(let c=s>0?s+1:0;c=n&&Te("invalid-input");const m=mm(t.charCodeAt(c++));m>=re&&Te("invalid-input"),m>ie((Ye-o)/h)&&Te("overflow"),o+=m*h;const f=u<=a?Pr:u>=a+In?In:u-a;if(mie(Ye/p)&&Te("overflow"),h*=p}const d=e.length+1;a=zs(o-l,d,l==0),ie(o/d)>Ye-i&&Te("overflow"),i+=ie(o/d),o%=d,e.splice(o++,0,i)}return String.fromCodePoint(...e)},Ks=function(t){const e=[];t=Bs(t);const n=t.length;let o=$s,i=0,a=Os;for(const l of t)l<128&&e.push(Oo(l));const s=e.length;let c=s;for(s&&e.push(Fs);c=o&&hie((Ye-i)/d)&&Te("overflow"),i+=(l-o)*d,o=l;for(const h of t)if(hYe&&Te("overflow"),h===o){let u=i;for(let m=re;;m+=re){const f=m<=a?Pr:m>=a+In?In:m-a;if(u{const{shortcode:o,staticUrl:i,url:a}=n;t=t.replace(new RegExp(`:${o}:`,"g"),`:${o}:`)}),t):""}const Ue=document.createElement("div"),vm=["u-url","mention","hashtag"],_m=/[&<>]/g;function $o(t){return t.replace(_m,e=>({"&":"&","<":"<",">":">"})[e])}const ym=/{}}=e;let a=t;const s=Dm(a,o),c=ym.test(a),l=a.includes("```");if(c){const m=s.querySelectorAll('a:not([target="_blank"])');for(const p of m)p.setAttribute("target","_blank");const f=s.querySelectorAll("a[class]");for(const p of f)for(const v of p.classList)vm.includes(v)||p.classList.remove(v)}if(c){const m=s.querySelectorAll("a[href]");for(const f of m)bm.test(f.textContent.trim())&&(f.classList.add("has-url-text"),$m(f))}if(c){const m=s.querySelectorAll("a[href]"),f=[];for(const p of m){const v=p.innerText.trim(),y=p.querySelector("*");if(wm.test(v)){const[E,w,A]=v.split("@");y||(!f.some(([T])=>T===w)||f.some(([T,_])=>T===w&&_===A)?(p.innerHTML=`@${w}`,f.push([w,A])):p.innerHTML=`@${w}@${A}`),p.classList.add("mention")}Em.test(v)&&(y||(p.innerHTML=`#${v.slice(1)}`),p.classList.add("mention","hashtag"))}}let d;if(a.includes(":")&&(n!=null&&n.length)){d=No(s);for(const m of d){let f=$o(m.nodeValue);f=hr(f,n),Ue.innerHTML=f,m.replaceWith(...Ue.childNodes)}}if(l){const m=[...s.querySelectorAll("p")].filter(f=>Tm.test(f.innerText.trim()));for(const f of m){const p=document.createElement("pre");for(const v of f.querySelectorAll("br"))v.replaceWith(` +`);p.innerHTML=`${f.innerHTML.trim()}`,f.replaceWith(p)}}if(l){const f=[...s.querySelectorAll("p")].filter(p=>Am.test(p.innerText));for(const p of f){const v=[p];let y=!1,E=p;for(;E.nextElementSibling;){const w=E.nextElementSibling;if(w&&w.tagName==="P")if(km.test(w.innerText)){v.push(w),y=!0;break}else v.push(w);else break;E=w}if(y){const w=document.createElement("pre");for(const T of v)for(const _ of T.querySelectorAll("br"))_.replaceWith(` +`);const A=v.map(T=>T.innerHTML).join(` + +`);w.innerHTML=`${A}`,p.replaceWith(w);for(const T of v)T.remove()}}}if(a.includes("`")){d=No(s);for(const m of d){let f=$o(m.nodeValue);Sm.test(f)&&(f=f.replaceAll(Im,"$1")),Ue.innerHTML=f,m.replaceWith(...Ue.childNodes)}}if(Cm.test(a)){d=No(s,{rejectFilter:["A"]});for(const m of d){let f=$o(m.nodeValue);Lm.test(f)&&(f=f.replaceAll(xm,'$1')),Ue.innerHTML=f,m.replaceWith(...Ue.childNodes)}}if(a.includes("#")){let m=null;const f=[...s.querySelectorAll("p")].filter((p,v)=>{let y=0;for(let E=0;E3||y>1&&m&&v===m+1)return m=v,!0});if(f!=null&&f.length)for(const p of f)p.classList.add("hashtag-stuffing"),p.title=p.innerText}if(a.includes("i(s)),o?s:s.innerHTML}const Us=xt(Mm),Pm=["STYLE","IMG","VIDEO","AUDIO","AREA","MAP","TRACK","EMBED","IFRAME","OBJECT","PICTURE","PORTAL","SOURCE","SVG","MATH","CANVAS","NOSCRIPT","SCRIPT","INPUT","OPTION","TEXTAREA","SLOT","TEMPLATE"],Rm=Object.fromEntries(Pm.map(t=>[t,!0])),Om=/^(https?:\/\/(www\.)?|xmpp:)/,Fo=30;function $m(t){var e;if(!(!t||(e=t.querySelector)!=null&&e.call(t,"*")))try{const n=t.innerText.trim(),o=(n.match(Om)||[])[0]||"";if(!o)return;const i=n.slice(o.length,o.length+Fo),a=n.slice(o.length+Fo),s=n.slice(o.length).length>Fo;t.innerHTML=`${i}`}catch{}}function No(t,e={}){var s;const n=[],o=Object.assign({},Rm,(s=e.rejectFilter)==null?void 0:s.reduce((c,l)=>(c[l]=!0,c),{})),i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode(c){return o[c.parentNode.nodeName]?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}},!1);let a;for(;a=i.nextNode();)n.push(a);return n}function Fm(t){const{mentions:e=[],instance:n,previewMode:o,statusURL:i}=t||{};return a=>{var h,u;let{target:s}=a;if(s=s.closest("a"),!s||a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||a.which===2)return;const c=(h=s.previousSibling)==null?void 0:h.textContent,l=c==null?void 0:c.endsWith("@"),d=s.innerText.startsWith("@");if((s.classList.contains("u-url")||s.classList.contains("mention"))&&d||l&&!d){const m=(s.querySelector("span")||s).innerText.trim(),f=m.replace(/^@/,""),p=s.getAttribute("href"),v=e.find(y=>y.url===p)||e.find(y=>y.acct===f||y.username===f);if(v)a.preventDefault(),a.stopPropagation(),j.showAccount={account:v.acct,instance:n};else if(!/^http/i.test(m)){a.preventDefault(),a.stopPropagation();const y=s.getAttribute("href");j.showAccount={account:y,instance:n}}}else if(!o){const m=c==null?void 0:c.endsWith("#");if(s.classList.contains("hashtag")||m){a.preventDefault(),a.stopPropagation();const f=s.innerText.replace(/^#/,"").trim(),p=n?`#/${n}/t/${f}`:`#/t/${f}`;location.hash=p}else(u=j.unfurledLinks[s.href])!=null&&u.url&&i!==s.href&&(a.preventDefault(),a.stopPropagation(),j.prevLocation={pathname:location.hash.replace(/^#/,"")},location.hash=`#${j.unfurledLinks[s.href].url}`)}}}function Sv(t,e){return()=>Pt.number(t,{style:"unit",unit:e,unitDisplay:"long"})}async function Cv(t,e={}){if(!(t!=null&&t.length))return;const{masto:n}=co(),o=Ar(),i=t.reduce((a,s)=>(!a.includes(s.id)&&!e[s.id]&&s.id!==o&&a.push(s.id),a),[]);if(!i.length)return null;try{return(await n.v1.accounts.relationships.fetch({id:i})).reduce((c,l)=>(c[l.id]=l,c),{})}catch{return null}}function me(t){try{return Pt.number(t,{notation:"compact",roundingMode:"floor"})}catch{return t}}const Nm={"@mastodon/edit-media-attributes":">=4.1","@mastodon/list-exclusive":">=4.2","@gotosocial/list-exclusive":">=0.17","@mastodon/filtered-notifications":"~4.3 || >=4.3","@mastodon/fetch-multiple-statuses":"~4.3 || >=4.3","@mastodon/trending-link-posts":"~4.3 || >=4.3","@mastodon/annual-report":"~4.4 || >=4.4","@mastodon/endorsements":"~4.4 || >=4.4"},Bo=/pixelfed/i,oe=/^(?!.*pixelfed).*$/i,Bm=/pleroma/i,zm=/akkoma/i;const ki={"@mastodon/lists":oe,"@mastodon/filters":oe,"@mastodon/mentions":oe,"@mastodon/trending-hashtags":oe,"@mastodon/trending-links":oe,"@mastodon/post-bookmark":oe,"@mastodon/post-edit":oe,"@mastodon/profile-edit":oe,"@mastodon/profile-private-note":oe,"@mastodon/pinned-posts":oe,"@pixelfed/trending":Bo,"@pixelfed/home-include-reblogs":Bo,"@pixelfed/global-feed":Bo,"@pleroma/local-visibility-post":Bm,"@akkoma/local-visibility-post":zm},Gn={};function Yn(t){var e,n;try{let{version:o,domain:i}=Ha(),a=((n=(e=Ua())==null?void 0:e.software)==null?void 0:n.name)||"mastodon";a==="hometown"&&(a="mastodon");const s=`${i}-${t}`;if(Gn[s])return Gn[s];if(ki[t])return Gn[s]=ki[t].test(o);const c=Nm[t];if(!c)return!1;const d=t.match(/^@([a-z]+)\//)[1]===a.toLowerCase();return Gn[s]=d&&ja(o,c,{includePrerelease:!0,loose:!0})}catch{return!1}}function Lv({skeleton:t,account:e,avatarSize:n="xl",useAvatarStatic:o=!1,instance:i,external:a,internal:s,onClick:c,showActivity:l=!1,showStats:d=!1,accountInstance:h,hideDisplayName:u=!1,relationship:m={},excludeRelationshipAttrs:f=[]}){const{_:p}=le();if(t)return r("div",{class:"account-block skeleton",children:[r(ve,{size:n}),r("span",{children:[r("b",{children:"████████"}),r("br",{}),r("span",{class:"account-block-acct",children:"██████"})]})]});if(!e)return null;const{id:v,acct:y,avatar:E,avatarStatic:w,displayName:A,username:T,emojis:_,url:b,statusesCount:x,lastStatusAt:D,bot:C,fields:S,note:N,group:R,followersCount:O,createdAt:L,locked:z}=e;let[q,rt,J]=y.match(/([^@]+)(@.+)/i)||[,y];h&&(J=`@${h}`);const ot=S==null?void 0:S.find(et=>!!et.verifiedAt&&!!et.value),tt={};for(const et in m)f.includes(et)||(tt[et]=m[et]);const lt=tt.following||tt.followedBy||tt.requested;return r("a",{class:"account-block",href:b,target:a?"_blank":null,title:J?y:`@${y}`,onClick:et=>{if(!a){if(et.preventDefault(),c)return c(et);s?location.hash=`/${i}/a/${v}`:j.showAccount={account:e,instance:i}}},children:[r("div",{class:"avatar-container",children:r(ve,{url:o?w:E||w,staticUrl:o?void 0:w,size:n,squircle:C})}),r("span",{class:"account-block-content",children:[!u&&r(B,{children:A?r("b",{children:r(en,{text:A,emojis:_})}):r("b",{children:T})})," ",r("span",{class:"account-block-acct bidi-isolate",children:[J?"":"@",rt,r("wbr",{}),J,z&&r(B,{children:[" ",r(M,{icon:"lock",size:"s",alt:p({id:"G2fuEb"})})]})]}),l&&r("div",{class:"account-block-stats",children:[r(P,{id:"ajzDof",values:{0:me(x)}}),!!D&&r(B,{children:[" ","·"," ",r(P,{id:"f8bJ3C",values:{0:xn(D,{hideTime:!0})}})]})]}),d&&r("div",{class:"account-block-stats",children:[C&&r(B,{children:r("span",{class:"tag collapsed",children:[r(M,{icon:"bot"})," ",r(P,{id:"9Vdq+j"})]})}),!!R&&r(B,{children:r("span",{class:"tag collapsed",children:[r(M,{icon:"group"})," ",r(P,{id:"L8fEEm"})]})}),lt&&r("div",{class:"shazam-container-horizontal",children:r("div",{class:"shazam-container-inner",children:tt.following&&tt.followedBy?r("span",{class:"tag minimal",children:r(P,{id:"7oRLbi"})}):tt.requested?r("span",{class:"tag minimal",children:r(P,{id:"Yx0Ud8"})}):tt.following?r("span",{class:"tag minimal",children:r(P,{id:"y6sq5j"})}):tt.followedBy?r("span",{class:"tag minimal",children:r(P,{id:"p3UO/y"})}):null})},m.id),!!O&&r("span",{class:"ib",children:r(P,{id:"Mn1E9C",values:{followersCount:O}})}),!!ot&&r("span",{class:"verified-field",children:[r(M,{icon:"check-circle",size:"s",alt:p({id:"QDEWii"})})," ",r("span",{dangerouslySetInnerHTML:{__html:Us(ot.value,{emojis:_})}})]}),!C&&!R&&!lt&&!O&&!ot&&!!L&&r("span",{class:"created-at",children:r(P,{id:"PCcEFZ",values:{0:xn(L,{hideTime:!0})},components:{0:r("time",{datetime:L})}})})]})]})]})}var zo={},Vo,Si;function Vm(){if(Si)return Vo;Si=1;function t(e,n){typeof n=="boolean"&&(n={forever:n}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=n||{},this._maxRetryTime=n&&n.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return Vo=t,t.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},t.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},t.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var n=new Date().getTime();if(e&&n-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var o=this._timeouts.shift();if(o===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),o=this._cachedTimeouts.slice(-1);else return!1;var i=this;return this._timer=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},o),this._options.unref&&this._timer.unref(),!0},t.prototype.attempt=function(e,n){this._fn=e,n&&(n.timeout&&(this._operationTimeout=n.timeout),n.cb&&(this._operationTimeoutCb=n.cb));var o=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){o._operationTimeoutCb()},o._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},t.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},t.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},t.prototype.start=t.prototype.try,t.prototype.errors=function(){return this._errors},t.prototype.attempts=function(){return this._attempts},t.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},n=null,o=0,i=0;i=o&&(n=a,o=c)}return n},Vo}var Ci;function Km(){return Ci||(Ci=1,function(t){var e=Vm();t.operation=function(n){var o=t.timeouts(n);return new e(o,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},t.timeouts=function(n){if(n instanceof Array)return[].concat(n);var o={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var i in n)o[i]=n[i];if(o.minTimeout>o.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var a=[],s=0;sWm.call(t)==="[object Error]",qm=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed"]);function Gm(t){return t&&Zm(t)&&t.name==="TypeError"&&typeof t.message=="string"?t.message==="Load failed"?t.stack===void 0:qm.has(t.message):!1}class Ym extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}const xi=(t,e,n)=>{const o=n.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=o,t};async function Xm(t,e){return new Promise((n,o)=>{e={...e},e.onFailedAttempt??(e.onFailedAttempt=()=>{}),e.shouldRetry??(e.shouldRetry=()=>!0),e.retries??(e.retries=10);const i=jm.operation(e),a=()=>{var c;i.stop(),o((c=e.signal)==null?void 0:c.reason)};e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",a,{once:!0});const s=()=>{var c;(c=e.signal)==null||c.removeEventListener("abort",a),i.stop()};i.attempt(async c=>{try{const l=await t(c);s(),n(l)}catch(l){try{if(!(l instanceof Error))throw new TypeError(`Non-error was thrown: "${l}". You should only throw errors.`);if(l instanceof Ym)throw l.originalError;if(l instanceof TypeError&&!Gm(l))throw l;if(xi(l,c,e),await e.shouldRetry(l)||(i.stop(),o(l)),await e.onFailedAttempt(l),!i.retry(l))throw i.mainError()}catch(d){xi(d,c,e),s(),o(d)}}})})}const js="LanguageDetector"in self,Qm=js&&"Translator"in self;let Xe;js&&(async()=>{try{const t=await LanguageDetector.availability();if(t==="unavailable")return;t==="available"?Xe=await LanguageDetector.create():(Xe=await LanguageDetector.create({monitor(e){e.addEventListener("downloadprogress",n=>{})}}),await Xe.ready)}catch{}})();const Jm=async(t,e,n)=>{let o;const i=e;if(e==="auto")try{e=(await Xe.detect(t))[0].detectedLanguage,o=e}catch(s){return{error:s}}const a=`💬 BROWSER TRANSLATE ${t}`;console.groupCollapsed(a);try{const s=await Translator.availability({sourceLanguage:e,targetLanguage:n});if(s==="unavailable")return console.groupEnd(a),{error:`Unsupported language pair: ${e} -> ${n}`};let c;s==="available"?c=await Translator.create({sourceLanguage:e,targetLanguage:n}):(c=await Translator.create({sourceLanguage:e,targetLanguage:n,monitor(d){d.addEventListener("downloadprogress",h=>{})}}),await c.ready);const l=await c.translate(t);return console.groupEnd(a),{content:l,detectedSourceLanguage:o,provider:"browser"}}catch(s){return console.groupEnd(a),{error:s}}};var tp=Object.defineProperty,ep=(t,e,n)=>e in t?tp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Xn=(t,e,n)=>ep(t,typeof e!="symbol"?e+"":e,n),fr=new Map,Qn=new WeakMap,Ii=0,np=void 0;function op(t){return t?(Qn.has(t)||(Ii+=1,Qn.set(t,Ii.toString())),Qn.get(t)):"0"}function rp(t){return Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>`${e}_${e==="root"?op(t.root):t[e]}`).toString()}function ip(t){const e=rp(t);let n=fr.get(e);if(!n){const o=new Map;let i;const a=new IntersectionObserver(s=>{s.forEach(c=>{var l;const d=c.isIntersecting&&i.some(h=>c.intersectionRatio>=h);t.trackVisibility&&typeof c.isVisible>"u"&&(c.isVisible=d),(l=o.get(c.target))==null||l.forEach(h=>{h(d,c)})})},t);i=a.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:a,elements:o},fr.set(e,n)}return n}function Ws(t,e,n={},o=np){if(typeof window.IntersectionObserver>"u"&&o!==void 0){const l=t.getBoundingClientRect();return e(o,{isIntersecting:o,target:t,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:i,observer:a,elements:s}=ip(n),c=s.get(t)||[];return s.has(t)||s.set(t,c),c.push(e),a.observe(t),function(){c.splice(c.indexOf(e),1),c.length===0&&(s.delete(t),a.unobserve(t)),s.size===0&&(a.disconnect(),fr.delete(i))}}function sp(t){return typeof t.children!="function"}var xv=class extends is{constructor(t){super(t),Xn(this,"node",null),Xn(this,"_unobserveCb",null),Xn(this,"handleNode",e=>{this.node&&(this.unobserve(),!e&&!this.props.triggerOnce&&!this.props.skip&&this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=e||null,this.observeNode()}),Xn(this,"handleChange",(e,n)=>{e&&this.props.triggerOnce&&this.unobserve(),sp(this.props)||this.setState({inView:e,entry:n}),this.props.onChange&&this.props.onChange(e,n)}),this.state={inView:!!t.initialInView,entry:void 0}}componentDidMount(){this.unobserve(),this.observeNode()}componentDidUpdate(t){(t.rootMargin!==this.props.rootMargin||t.root!==this.props.root||t.threshold!==this.props.threshold||t.skip!==this.props.skip||t.trackVisibility!==this.props.trackVisibility||t.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve()}observeNode(){if(!this.node||this.props.skip)return;const{threshold:t,root:e,rootMargin:n,trackVisibility:o,delay:i,fallbackInView:a}=this.props;this._unobserveCb=Ws(this.node,this.handleChange,{threshold:t,root:e,rootMargin:n,trackVisibility:o,delay:i},a)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){const{children:t}=this.props;if(typeof t=="function"){const{inView:f,entry:p}=this.state;return t({inView:f,entry:p,ref:this.handleNode})}const{as:e,triggerOnce:n,threshold:o,root:i,rootMargin:a,onChange:s,skip:c,trackVisibility:l,delay:d,initialInView:h,fallbackInView:u,...m}=this.props;return Wa(e||"div",{ref:this.handleNode,...m},t)}};function ap({threshold:t,delay:e,trackVisibility:n,rootMargin:o,root:i,triggerOnce:a,skip:s,initialInView:c,fallbackInView:l,onChange:d}={}){var h;const[u,m]=W(null),f=F(d),[p,v]=W({inView:!!c,entry:void 0});f.current=d,Q(()=>{if(s||!u)return;let A;return A=Ws(u,(T,_)=>{v({inView:T,entry:_}),f.current&&f.current(T,_),_.isIntersecting&&a&&A&&(A(),A=void 0)},{root:i,rootMargin:o,threshold:t,trackVisibility:n,delay:e},l),()=>{A&&A()}},[Array.isArray(t)?t.toString():t,u,i,o,a,s,n,l,e]);const y=(h=p.entry)==null?void 0:h.target,E=F(void 0);!u&&y&&!a&&!s&&E.current!==y&&(E.current=y,v({inView:!!c,entry:void 0}));const w=[m,p.inView,p.entry];return w.ref=w[0],w.inView=w[1],w.entry=w[2],w}const Di=48,Ho={};function Zs({id:t,children:e}){const n=F(),o=!!Ho[t],[i,a]=W(!1),[s,c]=W(o||!1),{ref:l}=ap({root:null,rootMargin:`-${Di}px 0px 0px 0px`,trackVisibility:!0,delay:1e3,onChange:d=>{d&&(a(!0),t&&(Ho[t]=!0))},triggerOnce:!0,skip:s||i});return Q(()=>{if(!n.current)return;const d=n.current.getBoundingClientRect();d.bottom>Di&&(d.top({code:t,name:e})),{PHANPY_TRANSLANG_INSTANCES:Mi}=cp,En=Mi?Mi.split(/\s+/):[],qs=ss({limit:1,interval:2e3}),Gs=1e3*60*60;let Uo=0;function up(t,e,n){return Xm(()=>{let i=En[Uo];const a=t.length>2e3;let s;return a?s=fetch(`https://${i}/api/v1/translate`,{method:"POST",priority:"low",referrerPolicy:"no-referrer",headers:{"Content-Type":"application/json"},body:JSON.stringify({sl:e,tl:n,text:t})}):s=fetch(`https://${i}/api/v1/translate?sl=${encodeURIComponent(e)}&tl=${encodeURIComponent(n)}&text=${encodeURIComponent(t)}`,{priority:"low",referrerPolicy:"no-referrer"}),s.then(c=>{if(!c.ok)throw new Error(c.statusText);return c.json()}).then(c=>({provider:"translang",content:c.translated_text,detectedSourceLanguage:c.detected_language,pronunciation:c.pronunciation}))},{retries:3,onFailedAttempt:i=>{Uo=(Uo+1)%En.length}})}const Ys=go(up,{maxAge:Gs}),dp=go(qs(Ys),{maxAge:Gs}),hp=qs(Jm);function fp({forceTranslate:t,sourceLanguage:e,onTranslate:n,text:o="",mini:i,autoDetected:a}){const{_:s}=le(),c=Rs(!0),[l,d]=W("default"),[h,u]=W(null),[m,f]=W(null),[p,v]=W(null),y=F(),E=e?gn(e):null,w=gn(c),A=F("auto");n||(n=async(..._)=>{if(Qm){const b=await hp(..._);if(b&&!b.error)return b}return i?await dp(..._):await Ys(..._)});const T=async()=>{d("loading");try{const{content:_,detectedSourceLanguage:b,provider:x,error:D,...C}=await n(o,A.current,c);if(_){if(b){const S=gn(b);v(S)}if(x==="translang"){const S=C==null?void 0:C.pronunciation;S&&u(S)}f(_),d("default"),!i&&_.trim()!==o.trim()&&(y.current.open=!0,y.current.scrollIntoView({behavior:"smooth",block:"nearest"}))}else d("error")}catch{d("error")}};return Q(()=>{t&&T()},[t]),i?m&&m.trim()!==o.trim()&&p!==w?r(Zs,{children:r("div",{class:"status-translation-block-mini",children:[r(M,{icon:"translate",alt:s({id:"zVJKbG",values:{sourceLangText:E}})}),r("output",{lang:c,dir:"auto",title:h||"",children:m})]})}):null:r("div",{class:"status-translation-block",onClick:_=>{_.preventDefault()},children:r("details",{ref:y,children:[r("summary",{children:r("button",{type:"button",onClick:async _=>{_.preventDefault(),_.stopPropagation(),y.current.open=!y.current.open,l!=="loading"&&(m||T())},children:[r(M,{icon:"translate"})," ",r("span",{children:s(l==="loading"?{id:"Zxkt/v"}:e&&E&&!p?a?{id:"R20Yf9",values:{sourceLangText:E}}:{id:"h8zDAI",values:{sourceLangText:E}}:{id:"pi8x/S"})})]})}),r("div",{class:"translated-block",children:[r("div",{class:"translation-info insignificant",children:[r("select",{class:"translated-source-select",disabled:l==="loading",onChange:_=>{A.current=_.target.value,T()},children:lp.map(_=>{const b=gn({code:_.code,fallback:_.name}),x=gn({code:_.code,locale:_.code}),D=x&&b!==x;return r("option",{value:_.code,children:_.code==="auto"?s({id:"Bze3gr",values:{0:p??"…"}}):D?`${x} - ${b}`:b})})})," ",r("span",{children:["→ ",w]}),r(as,{abrupt:!0,hidden:l!=="loading"})]}),l==="error"?r("p",{class:"ui-state",children:r(P,{id:"m5LihO"})}):!!m&&r(B,{children:[r("output",{class:"translated-content",lang:c,dir:"auto",children:m}),!!h&&r("output",{class:"translated-pronunciation-content",tabIndex:-1,onClick:_=>{_.target.classList.toggle("expand")},children:h})]})]})]})})}const mp=En!=null&&En.length?fp:()=>null;function be(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Xs(t,e){let n;const o=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=be(i),n.then(a=>{a.onclose=()=>n=void 0},()=>{}),n};return(i,a)=>o().then(s=>a(s.transaction(e,i).objectStore(e)))}let jo;function Ne(){return jo||(jo=Xs("keyval-store","keyval")),jo}function pp(t,e=Ne()){return e("readonly",n=>be(n.get(t)))}function gp(t,e,n=Ne()){return n("readwrite",o=>(o.put(e,t),be(o.transaction)))}function vp(t,e=Ne()){return e("readonly",n=>Promise.all(t.map(o=>be(n.get(o)))))}function _p(t,e=Ne()){return e("readwrite",n=>(n.delete(t),be(n.transaction)))}function yp(t,e=Ne()){return e("readwrite",n=>(t.forEach(o=>n.delete(o)),be(n.transaction)))}function bp(t=Ne()){return t("readwrite",e=>(e.clear(),be(e.transaction)))}function wp(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},be(t.transaction)}function Ep(t=Ne()){return t("readonly",e=>{if(e.getAllKeys)return be(e.getAllKeys());const n=[];return wp(e,o=>n.push(o.key)).then(()=>n)})}function Pi(t,e){const n=Xs(t,e);return{set:(o,i)=>gp(o,i,n),get:o=>pp(o,n),getMany:o=>vp(o,n),del:o=>_p(o,n),delMany:o=>yp(o,n),clear:()=>bp(n),keys:()=>Ep(n)}}const Iv={drafts:Pi("drafts-db","drafts-store"),catchup:Pi("catchup-db","catchup-store")};class Zt extends HTMLElement{constructor(){super(),this.isIframeLoaded=!1,this.setupDom()}static get observedAttributes(){return["videoid","playlistid","videoplay","videotitle"]}connectedCallback(){this.addEventListener("pointerover",()=>Zt.warmConnections(this),{once:!0}),this.addEventListener("click",()=>this.addIframe())}get videoId(){return encodeURIComponent(this.getAttribute("videoid")||"")}set videoId(e){this.setAttribute("videoid",e)}get playlistId(){return encodeURIComponent(this.getAttribute("playlistid")||"")}set playlistId(e){this.setAttribute("playlistid",e)}get videoTitle(){return this.getAttribute("videotitle")||"Video"}set videoTitle(e){this.setAttribute("videotitle",e)}get videoPlay(){return this.getAttribute("videoplay")||"Play"}set videoPlay(e){this.setAttribute("videoplay",e)}get videoStartAt(){return this.getAttribute("videoStartAt")||"0"}get autoLoad(){return this.hasAttribute("autoload")}get autoPause(){return this.hasAttribute("autopause")}get noCookie(){return this.hasAttribute("nocookie")}get posterQuality(){return this.getAttribute("posterquality")||"hqdefault"}get posterLoading(){return this.getAttribute("posterloading")||"lazy"}get params(){return`start=${this.videoStartAt}&${this.getAttribute("params")}`}set params(e){this.setAttribute("params",e)}set posterQuality(e){this.setAttribute("posterquality",e)}get disableNoscript(){return this.hasAttribute("disablenoscript")}setupDom(){const e=this.attachShadow({mode:"open"});let n="";window.liteYouTubeNonce&&(n=`nonce="${window.liteYouTubeNonce}"`),e.innerHTML=` + +
+ + + + + + + + +
+ `,this.domRefFrame=e.querySelector("#frame"),this.domRefImg={fallback:e.querySelector("#fallbackPlaceholder"),webp:e.querySelector("#webpPlaceholder"),jpeg:e.querySelector("#jpegPlaceholder")},this.domRefPlayButton=e.querySelector("#playButton")}setupComponent(){this.shadowRoot.querySelector("slot[name=image]").assignedNodes().length===0&&this.initImagePlaceholder(),this.domRefPlayButton.setAttribute("aria-label",`${this.videoPlay}: ${this.videoTitle}`),this.setAttribute("title",`${this.videoPlay}: ${this.videoTitle}`),(this.autoLoad||this.isYouTubeShort()||this.autoPause)&&this.initIntersectionObserver(),this.disableNoscript||this.injectSearchNoScript()}attributeChangedCallback(e,n,o){n!==o&&(this.setupComponent(),this.domRefFrame.classList.contains("activated")&&(this.domRefFrame.classList.remove("activated"),this.shadowRoot.querySelector("iframe").remove(),this.isIframeLoaded=!1))}injectSearchNoScript(){const e=document.createElement("noscript");this.prepend(e),e.innerHTML=this.generateIframe()}generateIframe(e=!1){let n=e?0:1,o=this.autoPause?"&enablejsapi=1":"";const i=this.noCookie?"-nocookie":"";let a;return this.playlistId?a=`?listType=playlist&list=${this.playlistId}&`:a=`${this.videoId}?`,this.isYouTubeShort()&&(this.params=`loop=1&mute=1&modestbranding=1&playsinline=1&rel=0&enablejsapi=1&playlist=${this.videoId}`,n=1),` +`}addIframe(e=!1){if(!this.isIframeLoaded){const n=this.generateIframe(e);this.domRefFrame.insertAdjacentHTML("beforeend",n),this.domRefFrame.classList.add("activated"),this.isIframeLoaded=!0,this.attemptShortAutoPlay(),this.dispatchEvent(new CustomEvent("liteYoutubeIframeLoaded",{detail:{videoId:this.videoId},bubbles:!0,cancelable:!0}))}}initImagePlaceholder(){var e,n;this.testPosterImage(),this.domRefImg.fallback.setAttribute("aria-label",`${this.videoPlay}: ${this.videoTitle}`),(n=(e=this.domRefImg)==null?void 0:e.fallback)==null||n.setAttribute("alt",`${this.videoPlay}: ${this.videoTitle}`)}async testPosterImage(){setTimeout(()=>{const e=`https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`,n=new Image;n.fetchPriority="low",n.referrerPolicy="origin",n.src=e,n.onload=async o=>{const i=o.target;(i==null?void 0:i.naturalHeight)==90&&(i==null?void 0:i.naturalWidth)==120&&(this.posterQuality="hqdefault");const s=`https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`;this.domRefImg.webp.srcset=s;const c=`https://i.ytimg.com/vi/${this.videoId}/${this.posterQuality}.jpg`;this.domRefImg.fallback.loading=this.posterLoading,this.domRefImg.jpeg.srcset=c,this.domRefImg.fallback.src=c,this.domRefImg.fallback.loading=this.posterLoading}},100)}initIntersectionObserver(){const e={root:null,rootMargin:"0px",threshold:0};new IntersectionObserver((o,i)=>{o.forEach(a=>{a.isIntersecting&&!this.isIframeLoaded&&(Zt.warmConnections(this),this.addIframe(!0),i.unobserve(this))})},e).observe(this),this.autoPause&&new IntersectionObserver((i,a)=>{i.forEach(s=>{var c,l;s.intersectionRatio!==1&&((l=(c=this.shadowRoot.querySelector("iframe"))==null?void 0:c.contentWindow)==null||l.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*"))})},{threshold:1}).observe(this)}attemptShortAutoPlay(){this.isYouTubeShort()&&setTimeout(()=>{var e,n;(n=(e=this.shadowRoot.querySelector("iframe"))==null?void 0:e.contentWindow)==null||n.postMessage('{"event":"command","func":"playVideo","args":""}',"*")},2e3)}isYouTubeShort(){return this.getAttribute("short")===""&&window.matchMedia("(max-width: 40em)").matches}static addPrefetch(e,n){const o=document.createElement("link");o.rel=e,o.href=n,o.crossOrigin="true",document.head.append(o)}static warmConnections(e){Zt.isPreconnected||window.liteYouTubeIsPreconnected||(Zt.addPrefetch("preconnect","https://i.ytimg.com/"),Zt.addPrefetch("preconnect","https://s.ytimg.com"),e.noCookie?Zt.addPrefetch("preconnect","https://www.youtube-nocookie.com"):(Zt.addPrefetch("preconnect","https://www.youtube.com"),Zt.addPrefetch("preconnect","https://www.google.com"),Zt.addPrefetch("preconnect","https://googleads.g.doubleclick.net"),Zt.addPrefetch("preconnect","https://static.doubleclick.net")),Zt.isPreconnected=!0,window.liteYouTubeIsPreconnected=!0)}}Zt.isPreconnected=!1;customElements.define("lite-youtube",Zt);const Qs=new Uint8Array(128);for(let t=0;t<83;t++)Qs["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~".charCodeAt(t)]=t;const io=(t,e,n)=>{let o=0;for(;et>10.31475?Js(t/ea+.052132,2.4):t/ta,Wo=t=>~~(t>1227e-8?ea*Js(t,.416666)-13.025:t*ta+1),Tn=t=>(t<0?-1:1)*t*t,Ri=t=>{for(t+=Dn/2;t>Dn;)t-=Tp;const e=1.27323954*t-.405284735*Tn(t);return .225*(Tn(e)-e)+e};function Rr(t){const e=io(t,2,6);return[e>>16,e>>8&255,e&255]}function kp(t,e,n,o){const i=io(t,0,1),a=i%9+1,s=~~(i/9)+1,c=a*s;let l=0,d=0,h=0,u=0,m=0,f=0,p=0,v=0,y=0,E=0,w=0,A=0;const T=(io(t,1,2)+1)/13446*(o|1),_=new Float64Array(c*3),b=Rr(t);for(l=0;l<3;l++)_[l]=Ap(b[l]);for(l=1;l{const o=n.char||" ",i=n.count||2;let a=0;const s=[];return e.reverse().reduce((c,l)=>{s.length&&a&&s[a]&&s[a]===l.substring(1,s[a].length+1)&&(s.splice(a,1),a--);const h=[`${o.repeat(a?a*i:0)}${l}`,...c];return l.substring(0,2)==="n.trim().replace(/(^(\s|\t)+|(( |\t)+)$)/gm,"");return qo={mergeAttributesWithElements:n=>{const o=t(n).split(` +`),i=[];let a="";for(let s=0;s")){i.push(`${a}${c.slice(0,-2)} />`),a="";continue}if(c.endsWith(">")){i.push(`${a}${c.startsWith(">")||c.startsWith("<")?"":" "}${c}`),a="";continue}a+=a.length?` ${c}`:c}return i},removeEmptyLines:t},qo}var Go,Fi;function Lp(){if(Fi)return Go;Fi=1;const t=Sp(),{mergeAttributesWithElements:e}=Cp();return Go=(o,i={})=>{const a=e(o);return t(a,i)},Go}var xp=Lp();const Ip=Tr(xp);function Dp({poll:t,lang:e,readOnly:n,refresh:o=()=>{},votePoll:i=()=>{}}){const{_:a}=le(),[s,c]=W("default"),{expired:l,expiresAt:d,id:h,multiple:u,options:m,ownVotes:f,voted:p,votersCount:v,votesCount:y=0,emojis:E}=t,w=!!d&&new Date(d),A=u&&v||y;let T=0;A<=1e3?T=0:A<=1e4?T=1:A<=1e5&&(T=2);const[_,b]=W(!1),x=m.every(D=>D.votesCount!==null);return r("div",{lang:e,dir:"auto",class:`poll ${n?"read-only":""} ${s==="loading"?"loading":""}`,children:[_&&x||p||l?r(B,{children:[r("div",{class:"poll-options",children:m.map((D,C)=>{const{title:S,votesCount:N}=D,R=A?N/A:0,O=R?R.toLocaleString(Pt.locale||void 0,{style:"percent",maximumFractionDigits:T}):"0%",L=N>0&&N===Math.max(...m.map(z=>z.votesCount));return r("div",{class:`poll-option poll-result ${L?"poll-option-leading":""}`,style:{"--percentage":`${R*100}%`},children:[r("div",{class:"poll-option-title",children:[r("span",{children:r(en,{text:S,emojis:E})}),p&&f.includes(C)&&r(B,{children:[" ",r(M,{icon:"check-circle",alt:a({id:"IeO7us"})})]})]}),r("div",{class:"poll-option-votes",title:Pt._({id:"+syLpm",values:{optionVotesCount:N}}),children:O})]},`${C}-${S}-${N}`)})}),!l&&!p&&r("button",{class:"poll-vote-button plain2",disabled:s==="loading",onClick:D=>{D.preventDefault(),b(!1)},children:[r(M,{icon:"arrow-left",size:"s"})," ",r(P,{id:"L96xSt"})]})]}):r("form",{onSubmit:async D=>{D.preventDefault();const C=D.target,S=new FormData(C),N=[];S.forEach((R,O)=>{O==="poll"&&N.push(R)}),N.length&&(c("loading"),await i(N),c("default"))},children:[r("div",{class:"poll-options",children:m.map((D,C)=>{const{title:S}=D;return r("div",{class:"poll-option",children:r("label",{class:"poll-label",children:[r("input",{type:u?"checkbox":"radio",name:"poll",value:C,disabled:s==="loading",readOnly:n}),r("span",{class:"poll-option-title",children:r(en,{text:S,emojis:E})})]})})})}),!n&&r("button",{class:"poll-vote-button",type:"submit",disabled:s==="loading",children:r(P,{id:"lQXQKs"})})]}),r("p",{class:"poll-meta",children:[!l&&!n&&r("button",{type:"button",class:"plain small",disabled:s==="loading",onClick:D=>{D.preventDefault(),c("loading"),(async()=>(await o(),c("default")))()},title:a({id:"lCF0wC"}),children:r(M,{icon:"refresh",alt:a({id:"lCF0wC"})})}),!p&&!l&&!n&&x&&r("button",{type:"button",class:"plain small",disabled:s==="loading",onClick:D=>{D.preventDefault(),b(!_)},title:a(_?{id:"L96xSt"}:{id:"zCjei3"}),children:[r(M,{icon:_?"eye-open":"eye-close",alt:a(_?{id:"L96xSt"}:{id:"zCjei3"})})," "]}),!l&&!n&&" ",r(P,{id:"k7v0Rh",values:{0:me(y),1:me(y),votesCount:y},components:{0:r("span",{title:y}),1:r("span",{title:y})}}),!!v&&v!==y&&r(B,{children:[" ","•"," ",r(P,{id:"jf1i1L",values:{0:me(v),1:me(v),votersCount:v},components:{0:r("span",{title:v}),1:r("span",{title:v})}})]})," ","•"," ",l?w?r(P,{id:"5LwCCI",components:{0:r(ge,{datetime:w})}}):a({id:"237hSL"}):w?r(P,{id:"ooHDPY",components:{0:r(ge,{datetime:w})}}):a({id:"O2tNG0"})]})]})}const na=ye();function Mp(t,e){if(!(t!=null&&t.length))return!1;const n=t.filter(s=>{const{filter:c}=s,l=c.context.includes(e);return l?c.expiresAt?new Date(c.expiresAt)>new Date:l:!1});if(!n.length)return!1;if(n.some(s=>s.filter.filterAction==="hide"))return{action:"hide"};if(n.every(s=>s.filter.filterAction==="blur")){const s=n.map(c=>c.filter.title);return{action:"blur",titles:s,titlesStr:s.join(" • ")}}if(n.some(s=>!!s.filter.filterAction)){const s=n.map(c=>c.filter.title);return{action:"warn",titles:s,titlesStr:s.join(" • ")}}return!1}const Or=xt(Mp);function Pp(t,e,n){var s;const{filtered:o}=t;if(!(o!=null&&o.length)||n&&((s=t.account)==null?void 0:s.id)===n)return!0;const a=Or(o,e);return a?a.action!=="hide":!0}function Dv(t,e){if(!(t!=null&&t.length))return[];if(!e)return t;const n=Ar();return t.filter(o=>Pp(o,e,n))}function Ni(t){try{return Hs.toUnicode(URL.parse(t).hostname.replace(/^www\./,"").replace(/\/$/,""))}catch{return""}}const Yo=document.createElement("div");function Xo(t){return t?(Yo.innerHTML=t,Yo.querySelectorAll(".invisible").forEach(e=>{e.remove()}),Yo.innerText.length):0}const mr="speechSynthesis"in window;function Rp(t,e){if(mr)try{speechSynthesis.speaking&&speechSynthesis.cancel();const n=new SpeechSynthesisUtterance(t);e&&(n.lang=e),speechSynthesis.speak(n)}catch(n){alert(n)}}function Op(t,e,n,o){var i=this,a=F(null),s=F(0),c=F(0),l=F(null),d=F([]),h=F(),u=F(),m=F(t),f=F(!0);m.current=t;var p=typeof window<"u",v=!e&&e!==0&&p;if(typeof t!="function")throw new TypeError("Expected a function");e=+e||0;var y=!!(n=n||{}).leading,E=!("trailing"in n)||!!n.trailing,w="maxWait"in n,A="debounceOnServer"in n&&!!n.debounceOnServer,T=w?Math.max(+n.maxWait||0,e):null;Q(function(){return f.current=!0,function(){f.current=!1}},[]);var _=at(function(){var b=function(O){var L=d.current,z=h.current;return d.current=h.current=null,s.current=O,c.current=c.current||O,u.current=m.current.apply(z,L)},x=function(O,L){v&&cancelAnimationFrame(l.current),l.current=v?requestAnimationFrame(O):setTimeout(O,L)},D=function(O){if(!f.current)return!1;var L=O-a.current;return!a.current||L>=e||L<0||w&&O-s.current>=T},C=function(O){return l.current=null,E&&d.current?b(O):(d.current=h.current=null,u.current)},S=function O(){var L=Date.now();if(y&&c.current===s.current&&N(),D(L))return C(L);if(f.current){var z=e-(L-a.current),q=w?Math.min(z,T-(L-s.current)):z;x(O,q)}},N=function(){o&&o({})},R=function(){if(p||A){var O=Date.now(),L=D(O);if(d.current=[].slice.call(arguments),h.current=i,a.current=O,L){if(!l.current&&f.current)return s.current=a.current,x(S,e),y?b(a.current):u.current;if(w)return x(S,e),b(a.current)}return l.current||x(S,e),u.current}};return R.cancel=function(){l.current&&(v?cancelAnimationFrame(l.current):clearTimeout(l.current)),s.current=0,d.current=a.current=h.current=l.current=null},R.isPending=function(){return!!l.current},R.flush=function(){return l.current?C(Date.now()):u.current},R},[y,w,e,T,E,v,p,A,o]);return _}function $p(t,e,n){var o=n===void 0?{}:n,i=o.leading,a=o.trailing;return Op(t,e,{maxWait:e,leading:i===void 0||i,trailing:a===void 0||a})}function Fp(t,e){var n=F(null),o=F(null);o.current=e;var i=F(null);Q(function(){a()});var a=St(function(){var s=i.current,c=o.current,l=s||(c?c instanceof Element?c:c.current:null);n.current&&n.current.element===l&&n.current.subscriber===t||(n.current&&n.current.cleanup&&n.current.cleanup(),n.current={element:l,subscriber:t,cleanup:l?t(l):void 0})},[t]);return Q(function(){return function(){n.current&&n.current.cleanup&&(n.current.cleanup(),n.current=null)}},[]),St(function(s){i.current=s,a()},[a])}function Bi(t,e,n){return t[e]?t[e][0]?t[e][0][n]:t[e][n]:e==="contentBoxSize"?t.contentRect[n==="inlineSize"?"width":"height"]:void 0}function Np(t){t===void 0&&(t={});var e=t.onResize,n=F(void 0);n.current=e;var o=t.round||Math.round,i=F(),a=W({width:void 0,height:void 0}),s=a[0],c=a[1],l=F(!1);Q(function(){return l.current=!1,function(){l.current=!0}},[]);var d=F({width:void 0,height:void 0}),h=Fp(St(function(u){return(!i.current||i.current.box!==t.box||i.current.round!==o)&&(i.current={box:t.box,round:o,instance:new ResizeObserver(function(m){var f=m[0],p=t.box==="border-box"?"borderBoxSize":t.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",v=Bi(f,p,"inlineSize"),y=Bi(f,p,"blockSize"),E=v?o(v):void 0,w=y?o(y):void 0;if(d.current.width!==E||d.current.height!==w){var A={width:E,height:w};d.current.width=E,d.current.height=w,n.current?n.current(A):l.current||c(A)}})}),i.current.instance.observe(u,{box:t.box}),function(){i.current&&i.current.instance.unobserve(u)}},[t.box,o]),t.ref);return at(function(){return{ref:h,width:s.width,height:s.height}},[h,s.width,s.height])}function so({className:t="truncated"}={}){const e=F(),n=$p(({height:o})=>{if(e.current){const{scrollHeight:i}=e.current;let a=i>o;if(a){const{height:s,maxHeight:c}=getComputedStyle(e.current),l=parseInt(c||s,10);a=i>l}e.current.classList.toggle(t,a)}},300);return Np({ref:e,box:"border-box",onResize:n}),e}const An={public:"earth",unlisted:"group",private:"lock",direct:"message",local:"building"};var oa="kvfysmfp",ra="ufhsfnkm",Bp=".".concat(oa,"{overflow:hidden;touch-action:none}.").concat(ra,"{transform-origin: 0 0}"),zp=typeof window>"u",Vp=function(){return!zp&&("ontouchstart"in window||navigator.maxTouchPoints>0)};var Kp=function(t){var e=t.x,n=t.y,o=t.scale;return"scale3d(".concat(o,",").concat(o,", 1) translate3d(").concat(e,"px, ").concat(n,"px, 0)")};var Hp=Math.min,Up=Math.max;function zi(t){var e=t.containerDimension,n=t.childDimension,o=t.padding,i=t.centerContained,a=n-e;return a+2*o<=0&&i?[a/2,a/2]:[Hp(a+o,0)-o,Up(0,a+o)]}var Vi=function(t,e){return e?"".concat(t," ").concat(e):t},Jn=Math.abs,jp=Math.min,Wp=Math.sqrt,ia=typeof window>"u",Zp=ia?!1:/(Mac)/i.test(navigator.platform),je=function(t){return t==="drag"},vn=function(t){return t==="zoom"},qp=function(t){return Zp&&t.ctrlKey},_n=function(t){t.stopPropagation(),t.preventDefault()},Ki=function(t,e){var n=t.x-e.x,o=t.y-e.y;return Wp(n*n+o*o)},Gp=function(t,e){var n=Ki(t[0],t[1]),o=Ki(e[0],e[1]);return o/n},Yp=function(t,e){return t>e-.01&&te?e:n},tg=function(t){return!(t.ctrlKey||t.metaKey)},eg=function(t){if(t){var e=t.offsetWidth,n=t.offsetHeight;if(e&&n)return{width:e,height:n};var o=getComputedStyle(t),i=parseFloat(o.width),a=parseFloat(o.height);if(a&&i)return{width:i,height:a}}return{width:0,height:0}},ng=function(t,e){return{x:e.x-t.x,y:e.y-t.y}},og=function(t,e){return t.x===e.x&&t.y===e.y},Pe=function(){},eo={x:0,y:0},Ui=function(t){Za(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n._prevDragMovePoint=null,n._containerObserver=null,n._fingers=0,n._firstMove=!0,n._initialOffset=Nt({},eo),n._interaction=null,n._isDoubleTap=!1,n._isOffsetsSet=!1,n._lastDragPosition=null,n._lastScale=1,n._lastTouchStart=0,n._lastZoomCenter=null,n._listenMouseMove=!1,n._nthZoom=0,n._offset=Nt({},eo),n._startOffset=Nt({},eo),n._startTouches=null,n._updatePlaned=!1,n._wheelTimeOut=null,n._zoomFactor=1,n._initialZoomFactor=1,n._draggingPoint=Nt({},eo),n._ignoreNextClick=!1,n._containerRef=qa(),n._handleClick=function(o){n._ignoreNextClick&&(n._ignoreNextClick=!1,o.stopPropagation())},n._onResize=function(){var o;!((o=n._containerRef)===null||o===void 0)&&o.current&&(n._updateInitialZoomFactor(),n._setupOffsets(),n._update())},n._handlerOnTouchEnd=n._handlerIfEnable(function(o){n._fingers=o.touches.length,n.props.shouldCancelHandledTouchEndEvents&&(vn(n._interaction)||je(n._interaction)&&(n._startOffset.x!==n._offset.x||n._startOffset.y!==n._offset.y))&&_n(o),je(n._interaction)&&!n._enoughToDrag()&&n._handleClick(o),n._updateInteraction(o)}),n._handlerOnTouchStart=n._handlerIfEnable(function(o){n._firstMove=!0,n._fingers=o.touches.length,n._detectDoubleTap(o)}),n._handlerOnTouchMove=n._handlerIfEnable(function(o){n._isDoubleTap||(n._collectInertia(o),n._firstMove?(n._updateInteraction(o),n._interaction&&_n(o),n._startOffset=Nt({},n._offset),n._startTouches=to(o.touches)):(vn(n._interaction)?n._startTouches&&n._startTouches.length===2&&o.touches.length===2&&n._handleZoom(o,Gp(n._startTouches,to(o.touches))):je(n._interaction)&&n._handleDrag(o),n._interaction&&(_n(o),n._update())),n._firstMove=!1)}),n._handlerWheel=function(o){if(!n.props.shouldInterceptWheel(o)){_n(o);var i=o.pageX,a=o.pageY,s=o.deltaY,c=o.deltaMode,l=1;(qp(o)||c===1)&&(l=15);var d={touches:[{pageX:i,pageY:a}]},h=n._getOffsetByFirstTouch(d),u=s*l;n._stopAnimation(),n._scaleTo(n._zoomFactor-u/n.props.wheelScaleFactor,h),n._update(),clearTimeout(n._wheelTimeOut),n._wheelTimeOut=setTimeout(function(){return n._sanitize()},100)}},n._handlers=n.props.isTouch()?[["touchstart",n._handlerOnTouchStart],["touchend",n._handlerOnTouchEnd],["touchmove",n._handlerOnTouchMove]]:[["mousemove",n.simulate(n._handlerOnTouchMove),n.props._document],["mouseup",n.simulate(n._handlerOnTouchEnd),n.props._document],["mousedown",n.simulate(n._handlerOnTouchStart)],["click",n._handleClick],["wheel",n._handlerWheel]],n}return e.prototype._handleDragStart=function(n){this._ignoreNextClick=!0,this.props.onDragStart(),this._stopAnimation(),this._resetInertia(),this._lastDragPosition=null,this._hasInteraction=!0,this._draggingPoint=this._offset,this._handleDrag(n)},e.prototype._handleDrag=function(n){var o=this._getOffsetByFirstTouch(n);this._enoughToDrag()?this._drag(o,this._lastDragPosition):this._virtualDrag(o,this._lastDragPosition),this._offset=this._sanitizeOffset(this._offset),this._lastDragPosition=o},e.prototype._resetInertia=function(){this._velocity=null,this._prevDragMovePoint=null},e.prototype._realizeInertia=function(){var n=this,o=this.props,i=o.inertiaFriction,a=o.inertia;if(!(!a||!this._velocity)){var s=this._velocity,c=s.x,l=s.y;if(c||l){this._stopAnimation(),this._resetInertia();var d=function(){if(c*=i,l*=i,!c&&!l)return n._stopAnimation();var h=Nt({},n._offset);if(n._addOffset({x:c,y:l}),n._offset=n._sanitizeOffset(n._offset),og(h,n._offset))return n._stopAnimation();n._update({isAnimation:!0})};this._animate(d,{duration:9999})}}},e.prototype._collectInertia=function(n){var o=n.touches;if(this.props.inertia){var i=to(o)[0],a=this._prevDragMovePoint;a&&(this._velocity=ng(i,a)),this._prevDragMovePoint=i}},e.prototype._handleDragEnd=function(){this.props.onDragEnd(),this._end(),this._realizeInertia()},e.prototype._handleZoomStart=function(){this.props.onZoomStart(),this._stopAnimation(),this._lastScale=1,this._nthZoom=0,this._lastZoomCenter=null,this._hasInteraction=!0},e.prototype._handleZoom=function(n,o){var i=Jp(this._getOffsetTouches(n)),a=o/this._lastScale;this._lastScale=o,this._nthZoom+=1,this._nthZoom>3&&(this._scale(a,i),this._drag(i,this._lastZoomCenter),this.props.enforceBoundsDuringZoom&&(this._offset=this._sanitizeOffset(this._offset))),this._lastZoomCenter=i},e.prototype._handleZoomEnd=function(){this.props.onZoomEnd(),this._end()},e.prototype._handleDoubleTap=function(n){var o=this;if(!(this._hasInteraction||this.props.tapZoomFactor===0)){var i=this.props.doubleTapZoomOutOnMaxScale&&this._zoomFactor===this.props.maxZoom||this.props.doubleTapToggleZoom&&this._zoomFactor>1;this.props.onDoubleTap(),this._ignoreNextClick=!0;var a=this._zoomFactor+this.props.tapZoomFactor,s=this._zoomFactor,c=function(d){o._scaleTo(s+d*(a-s),l)},l=this._getOffsetByFirstTouch(n);this._isDoubleTap=!0,s>a&&(l=this._getCurrentZoomCenter()),i?this._zoomOutAnimation():this._animate(c)}},e.prototype._computeInitialOffset=function(){var n=this._getContainerRect(),o=this._getChildSize(),i=o.width,a=o.height,s=-Jn(i*this._getInitialZoomFactor()-n.width)/2,c=-Jn(a*this._getInitialZoomFactor()-n.height)/2;this._initialOffset={x:s,y:c}},e.prototype._resetOffset=function(){this._offset=Nt({},this._initialOffset)},e.prototype._setupOffsets=function(){this.props.setOffsetsOnce&&this._isOffsetsSet||(this._isOffsetsSet=!0,this._computeInitialOffset(),this._resetOffset())},e.prototype._sanitizeOffset=function(n){var o=this._getContainerRect(),i=this._getChildSize(),a=i.width,s=i.height,c=a*this._getInitialZoomFactor()*this._zoomFactor,l=s*this._getInitialZoomFactor()*this._zoomFactor,d=zi({containerDimension:o.width,childDimension:c,padding:this.props.horizontalPadding,centerContained:this.props.centerContained}),h=d[0],u=d[1],m=zi({containerDimension:o.height,childDimension:l,padding:this.props.verticalPadding,centerContained:this.props.centerContained}),f=m[0],p=m[1];return{x:Qo(h,u,n.x),y:Qo(f,p,n.y)}},e.prototype.alignCenter=function(n){var o=this,i=Nt({duration:250,animated:!0},n),a=i.x,s=i.y,c=i.scale,l=i.animated,d=i.duration,h=a*this._initialZoomFactor,u=s*this._initialZoomFactor,m=this._zoomFactor,f=Nt({},this._offset),p=this._getContainerRect(),v={x:p.width/2,y:p.height/2};if(this._zoomFactor=1,this._offset={x:-(v.x-h),y:-(v.y-u)},this._scaleTo(c,v),this._stopAnimation(),!l)return this._update();var y=this._zoomFactor-m,E={x:this._offset.x-f.x,y:this._offset.y-f.y};this._zoomFactor=m,this._offset=Nt({},f);var w=function(A){var T=f.x+E.x*A,_=f.y+E.y*A;o._zoomFactor=m+y*A,o._offset=o._sanitizeOffset({x:T,y:_}),o._update()};this._animate(w,{callback:function(){return o._sanitize()},duration:d})},e.prototype.scaleTo=function(n){var o=this,i=Nt({duration:250,animated:!0},n),a=i.x,s=i.y,c=i.scale,l=i.animated,d=i.duration,h=this._zoomFactor,u=Nt({},this._offset);if(this._zoomFactor=1,this._offset={x:0,y:0},this._scaleTo(c,{x:a,y:s}),this._stopAnimation(),!l)return this._update();var m=this._zoomFactor-h,f={x:this._offset.x-u.x,y:this._offset.y-u.y};this._zoomFactor=h,this._offset=Nt({},u);var p=function(v){var y=u.x+f.x*v,E=u.y+f.y*v;o._zoomFactor=h+m*v,o._offset={x:y,y:E},o._update()};this._animate(p,{callback:function(){return o._sanitize()},duration:d})},e.prototype._scaleTo=function(n,o){this._scale(n/this._zoomFactor,o),this._offset=this._sanitizeOffset(this._offset)},e.prototype._scale=function(n,o){n=this._scaleZoomFactor(n),this._addOffset({x:(n-1)*(o.x+this._offset.x),y:(n-1)*(o.y+this._offset.y)}),this.props.onZoomUpdate()},e.prototype._scaleZoomFactor=function(n){var o=this._zoomFactor;return this._zoomFactor*=n,this._zoomFactor=Qo(this.props.minZoom,this.props.maxZoom,this._zoomFactor),this._zoomFactor/o},e.prototype._canDrag=function(){return this.props.draggableUnZoomed||!Yp(this._zoomFactor,1)},e.prototype._drag=function(n,o){if(o){var i=-(n.y-o.y),a=-(n.x-o.x);this.props.lockDragAxis?Jn(a)>Jn(i)?this._addOffset({x:a,y:0}):this._addOffset({y:i,x:0}):this._addOffset({x:a,y:i}),this.props.onDragUpdate()}},e.prototype._virtualDrag=function(n,o){if(o){var i=-(n.y-o.y),a=-(n.x-o.x);this._draggingPoint={x:a+this._draggingPoint.x,y:i+this._draggingPoint.y}}},e.prototype._addOffset=function(n){var o=this._offset,i=o.x,a=o.y;this._offset={x:i+n.x,y:a+n.y}},e.prototype._sanitize=function(){this._zoomFactor=d?(n(1),i._stopAnimation(),l(),i._update()):(m=c(m),n(m),i._update({isAnimation:!0}),requestAnimationFrame(h))}};this._inAnimation=!0,requestAnimationFrame(h)},e.prototype._stopAnimation=function(){this._inAnimation=!1},e.prototype._end=function(){this._hasInteraction=!1,this._sanitize(),this._update()},e.prototype._getContainerRect=function(){var n=this._containerRef.current;return n.getBoundingClientRect()},e.prototype._getChildSize=function(){var n=this._containerRef.current;return eg(n==null?void 0:n.firstElementChild)},e.prototype._updateInitialZoomFactor=function(){var n=this._getContainerRect(),o=this._getChildSize(),i=n.width/o.width,a=n.height/o.height;this._initialZoomFactor=jp(i,a)},e.prototype._bindEvents=function(){var n=this,o=this._containerRef.current;window.ResizeObserver?(this._containerObserver=new ResizeObserver(this._onResize),this._containerObserver.observe(o)):window.addEventListener("resize",this._onResize),this._handlers.forEach(function(i){var a=i[0],s=i[1],c=i[2];(c||o).addEventListener(a,s,!0)}),Array.from(o.querySelectorAll("img")).forEach(function(i){return i.addEventListener("load",n._onResize)})},e.prototype._unSubscribe=function(){var n=this,o=this._containerRef.current;this._containerObserver&&(this._containerObserver.disconnect(),this._containerObserver=null),window.removeEventListener("resize",this._onResize),this._handlers.forEach(function(i){var a=i[0],s=i[1],c=i[2];(c||o).removeEventListener(a,s,!0)}),Array.from(o.querySelectorAll("img")).forEach(function(i){return i.removeEventListener("load",n._onResize)})},e.prototype._update=function(n){var o=this;if(!this._updatePlaned){var i=function(){var a=o._getInitialZoomFactor()*o._zoomFactor,s=-o._offset.x/a,c=-o._offset.y/a;o.props.onUpdate({scale:a,x:s,y:c})};if(n!=null&&n.isAnimation)return i();this._updatePlaned=!0,requestAnimationFrame(function(){o._updatePlaned=!1,i()})}},e.prototype._handlerIfEnable=function(n){var o=this;return function(){for(var i=[],a=0;ao?n-o:o-n},e.prototype._enoughToDrag=function(){return this._distanceBetweenNumbers(this._startOffset.x,this._draggingPoint.x)>5||this._distanceBetweenNumbers(this._startOffset.y,this._draggingPoint.y)>5},e.prototype._updateInteraction=function(n){var o=this._fingers;if(o===2)return this._setInteraction("zoom",n);if(o===1&&this._canDrag())return this._setInteraction("drag",n);this._setInteraction(null,n)},e.prototype._detectDoubleTap=function(n){var o=new Date().getTime();this._fingers>1&&(this._lastTouchStart=0),o-this._lastTouchStart<300?(_n(n),this._handleDoubleTap(n),vn(this._interaction)?this._handleZoomEnd():je(this._interaction)&&this._handleDragEnd()):this._isDoubleTap=!1,this._fingers===1&&(this._lastTouchStart=o)},e.prototype.simulate=function(n){var o=this;return function(i){var a=i.pageX,s=i.pageY,c=i.type,l=c==="mouseup",d=c==="mousedown";d&&(i.preventDefault(),o._listenMouseMove=!0),o._listenMouseMove&&(i.touches=l?[]:[{pageX:a,pageY:s}],n(i)),l&&(o._listenMouseMove=!1)}},e.prototype.componentDidMount=function(){this._bindEvents(),this._update()},e.prototype.componentWillUnmount=function(){this._stopAnimation(),this._unSubscribe()},e.prototype.render=function(){var n=this.props,o=n.children,i=n.containerProps,a=Ga.only(o),s=i||{};return jn.createElement(jn.Fragment,null,jn.createElement("style",null,Bp),jn.createElement("div",Nt({},s,{ref:this._containerRef,className:Vi(oa,s.className)}),os(a,{className:Vi(ra,a.props.className)})))},e.defaultProps={animationDuration:250,draggableUnZoomed:!0,enforceBoundsDuringZoom:!1,centerContained:!1,enabled:!0,inertia:!0,inertiaFriction:.96,horizontalPadding:0,isTouch:Vp,lockDragAxis:!1,maxZoom:5,minZoom:.5,onDoubleTap:Pe,onDragEnd:Pe,onDragStart:Pe,onDragUpdate:Pe,onZoomEnd:Pe,onZoomStart:Pe,onZoomUpdate:Pe,setOffsetsOnce:!1,shouldInterceptWheel:tg,shouldCancelHandledTouchEndEvents:!1,tapZoomFactor:1,verticalPadding:0,wheelScaleFactor:1500,zoomOutFactor:1.3,doubleTapZoomOutOnMaxScale:!1,doubleTapToggleZoom:!1,_document:ia?null:window.document},e}(is);if(0)var Mv,Pv,Rv,Ov,$v,Fv,Nv;function Jo(t){if(!t)return;let e=Math.floor(t/3600),n=Math.floor(t%3600/60),o=Math.round(t%60);return e===0?`${n}:${o.toString().padStart(2,"0")}`:`${e}:${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`}const rg=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),ig="ALT",tr=t=>{const{_:e}=le(),{alt:n,lang:o,index:i,...a}=t;return!n||!n.trim()?null:r("button",{type:"button",class:"alt-badge clickable",...a,onClick:s=>{s.stopPropagation(),s.preventDefault(),j.showMediaAlt={alt:n,lang:o}},title:e({id:"5gfDMm"}),children:[ig,!!i&&r("sup",{children:i})]})},sg=140,ag=280,sa=xt(t=>t!=null&&t.length?t.length>sg||/[\n\r].*[\n\r]/.test(t.trim()):!1);function cg({class:t="",media:e,to:n,lang:o,showOriginal:i,autoAnimate:a,showCaption:s,allowLongerCaption:c,altIndex:l,checkAspectRatio:d=!0,onClick:h}){let{id:u,blurhash:m,description:f,meta:p,previewRemoteUrl:v,previewUrl:y,remoteUrl:E,url:w,type:A}=e;/no\-preview\./i.test(y)&&(y=null);const T=lg(u||m||w),{original:_={},small:b,focus:x}=p||{},D=i?_==null?void 0:_.width:(b==null?void 0:b.width)||(_==null?void 0:_.width),C=i?_==null?void 0:_.height:(b==null?void 0:b.height)||(_==null?void 0:_.height),S=i?w:y||w,N=i?E:v||E,R=(b==null?void 0:b.width)&&(b==null?void 0:b.height),L=D&&C?D>C?"landscape":"portrait":null,z=m?Rr(m):null,q=F();let rt;if(x){const K=(x.x+1)/2*100,Y=(1-x.y)/2*100;rt=`${K.toFixed(0)}% ${Y.toFixed(0)}%`}const J=F(),ot=St(({x:K,y:Y,scale:$})=>{const{current:X}=J;if(X){const Qt=Kp({x:K,y:Y,scale:$});$===1?X.style.removeProperty("transform"):X.style.setProperty("transform",Qt),X.closest(".media-zoom").style.touchAction=$<=1.01?"pan-x":""}},[]),[tt,lt]=W(!1),et={enabled:tt,draggableUnZoomed:!1,inertiaFriction:.9,tapZoomFactor:2,doubleTapToggleZoom:!0,containerProps:{className:"media-zoom",style:{overflow:"visible"}},onUpdate:ot},[_t,ft]=W(!1),It=at(()=>n&&!_t?K=>r(Qe,{to:n,...K}):"div",[n,_t]),H=N?ji(N):null,ut=A==="unknown"&&H&&/\.(mp4|m4r|m4v|mov|webm)$/i.test(H.pathname),mt=A==="unknown"&&H&&/\.(mp3|ogg|wav|m4a|m4p|m4b)$/i.test(H.pathname),Vt=A==="image"||A==="unknown"&&y&&!ut&&!mt,yt=y&&/\.(mp4|m4r|m4v|mov|webm)$/i.test(ji(y).pathname),Ft=F(),[Rt,bt]=W(!1);Fe(()=>{if(!Vt||!i||!Ft.current)return;const{offsetWidth:K,offsetHeight:Y}=Ft.current,$=D{const{children:Y,...$}=K;return r("figure",{...$,children:[Y,r("figcaption",{class:"media-caption",lang:o,dir:"auto",onClick:X=>{X.preventDefault(),X.stopPropagation(),j.showMediaAlt={alt:f,lang:o}},children:f})]})}:B,[dt,ue]=W(void 0),ht=()=>window.matchMedia("(min-width: calc(40em + 350px))").matches?"large":"small",Ht=St(K=>{const Y=K.target.closest(".status-deck");if(i||ht()==="large"&&Y||!document.startViewTransition){h==null||h(K);return}const $=K.target.closest("[data-view-transition-name]")||K.target.querySelector("[data-view-transition-name]");$?h?h(K):(K.preventDefault(),$.style.viewTransitionName=T,document.startViewTransition(()=>{$.style.viewTransitionName="",location.hash=`#${n}`})):h==null||h(K)},[T,i,h]);if(Vt)return et.containerProps.style.display="inherit",Fe(()=>{rg&&i&&(async()=>{try{await fetch(S,{mode:"no-cors"}),J.current.src=S}catch{}})()},[S]),r(Tt,{children:[r(It,{ref:Ft,class:`media media-image ${t}`,onClick:Ht,"data-orientation":L,"data-has-alt":!pt||void 0,"data-has-natural-aspect-ratio":dt||void 0,style:i?{backgroundImage:`url(${y})`,"--bg-image":`url(${y})`,backgroundSize:Rt?`${D}px ${C}px`:void 0,...Z}:nt,children:i?r(Ui,{...et,children:r("img",{ref:J,src:S,alt:f,width:D,height:C,"data-orientation":L,loading:"eager",decoding:"sync",style:{"view-transition-name":T},onLoad:K=>{const Y=K.target,$=Y.closest(".media-image");$&&($.style.backgroundImage=`url(${Y.src})`,$.style.removeProperty("--bg-image")),Y.closest(".media-zoom").style.display="",lt(!0)},onError:K=>{const{src:Y}=K.target;Y===S&&N&&S!==N&&(K.target.src=N)}})}):r(B,{children:[r("img",{src:S,alt:pt?"":f,width:D,height:C,"data-orientation":L,loading:"lazy","data-view-transition-name":T,style:{objectPosition:rt||"center","--anim-duration":`${Math.min(Math.max(Math.max(D,C)/100,5),120)}s`},onLoad:K=>{K.target.dataset.loaded=!0;const Y=K.target.closest(".media");if(!R&&Y){const{naturalWidth:$,naturalHeight:X}=K.target;Y.dataset.orientation=$>X?"landscape":"portrait",Y.style.setProperty("--width",`${$}px`),Y.style.setProperty("--height",`${X}px`),Y.style.aspectRatio=`${$}/${X}`}if(d&&Y){const{clientWidth:$,clientHeight:X,naturalWidth:Qt,naturalHeight:gt}=K.target;if($&&X&&Qt&>)if(Qt<88||gt<88)Y.dataset.hasSmallDimension=!0;else{const de=gt*$/Qt;Math.abs(de-X)<5&&ue(!0)}}},onError:K=>{const{src:Y}=K.target;Y===S&&S!==N?K.target.src=N:ft(!0)}}),!pt&&r(tr,{alt:f,lang:o,index:l})]})}),_t&&r("div",{children:r("a",{href:E,class:"button plain6 small",target:"_blank",children:[r(M,{icon:"external"})," ",r("span",{children:r(P,{id:"9npOH9"})})]})})]});if(A==="gifv"||A==="video"||ut){const K=_.duration>0,Y=_.duration<31,$=A==="gifv"&&Y,X=_.duration<61,Qt=Jo(_.duration),gt=!i&&!a&&$,Ut=!i&&a&&$,de=_.duration>5,te=` + + `,ee=` + + `;return r(Tt,{children:r(It,{ref:Ft,class:`media ${t} media-${$?"gif":"video"} ${Ut?"media-contain":""} ${gt?"media-hover-animate":""}`,"data-orientation":L,"data-formatted-duration":i?void 0:Qt,"data-label":$&&!i&&!Ut?"GIF":void 0,"data-has-alt":!pt||void 0,style:!i&&nt,onClick:Ct=>{if(gt)try{q.current.pause()}catch{}Ht(Ct)},onMouseEnter:()=>{if(gt)try{q.current.play()}catch{}},onMouseLeave:()=>{if(gt)try{q.current.pause()}catch{}},onFocus:()=>{if(gt)try{q.current.play()}catch{}},onBlur:()=>{if(gt)try{q.current.pause()}catch{}},children:[i||Ut?$&&i?r(Ui,{...et,enabled:!0,children:r("div",{ref:J,dangerouslySetInnerHTML:{__html:te}})}):$?r("div",{class:"video-container",dangerouslySetInnerHTML:{__html:te}}):r("div",{class:"video-container",dangerouslySetInnerHTML:{__html:ee}}):$?r("video",{ref:q,src:w,poster:y,width:D,height:C,"data-orientation":L,"data-view-transition-name":T,preload:"auto",playsinline:!0,loop:!0,muted:!0,onTimeUpdate:de?Ct=>{const{target:vt}=Ct,jt=vt==null?void 0:vt.closest(".media-gif");if(jt){const Gt=vt.currentTime/vt.duration*100;jt.style.setProperty("--progress",`${Gt}%`)}}:void 0}):r(B,{children:[y&&!yt?r("img",{src:y,alt:pt?"":f,width:D,height:C,"data-orientation":L,loading:"lazy",decoding:"async","data-view-transition-name":T,onLoad:Ct=>{if(!R){const vt=Ct.target.closest(".media");if(vt){const{naturalHeight:jt,naturalWidth:Gt}=Ct.target;vt.dataset.orientation=Gt>jt?"landscape":"portrait",vt.style.setProperty("--width",`${Gt}px`),vt.style.setProperty("--height",`${jt}px`),vt.style.aspectRatio=`${Gt}/${jt}`}}}}):r("video",{src:w+"#t=0.1",width:D,height:C,"data-orientation":L,"data-view-transition-name":T,preload:"metadata",muted:!0,disablePictureInPicture:!0,onLoadedMetadata:Ct=>{if(!K){const{duration:vt}=Ct.target;if(vt){const jt=Jo(vt),Gt=Ct.target.closest(".media-video");Gt&&(Gt.dataset.formattedDuration=jt)}}}}),r("div",{class:"media-play",children:r(M,{icon:"play",size:"xl",alt:"▶"})})]}),!i&&!pt&&r(tr,{alt:f,lang:o,index:l})]})})}else if(A==="audio"||mt){const K=Jo(_.duration);return r(Tt,{children:r(It,{class:`media media-audio ${t}`,"data-formatted-duration":i?void 0:K,"data-has-alt":!pt||void 0,onClick:h,style:!i&&nt,children:[i?r("audio",{src:E||w,preload:"none",controls:!0,autoPlay:!0}):y?r("img",{src:y,alt:pt?"":f,width:D,height:C,"data-orientation":L,loading:"lazy",onError:Y=>{var $,X;try{(X=($=Y.target)==null?void 0:$.remove)==null||X.call($)}catch{}}}):null,!i&&r(B,{children:[r("div",{class:"media-play",children:r(M,{icon:"play",size:"xl",alt:"▶"})}),!pt&&r(tr,{alt:f,lang:o,index:l})]})]})})}}function ji(t){return URL.parse(t,location.origin)}function lg(t){let e=t.replace(/[^a-zA-Z0-9_-]/g,"-");return e.match(/^[0-9-]/)&&(e="vt-"+e),e}const pr=on(cg,(t,e)=>{const n=t.media||{},o=e.media||{};return(n==null?void 0:n.id)===(o==null?void 0:o.id)&&n.url===o.url&&t.to===e.to&&t.class===e.class}),ug=280,dg=140,hg=ss({limit:1,interval:1e3});function fg(t,e){return e.v1.accounts.$select(t).fetch()}const mg=go(hg(fg)),$e={public:{id:"7d1a0d"},local:{id:"d5zxa4"},unlisted:{id:"WDcQq9"},private:{id:"o34OrG"},direct:{id:"IV4QaU"}},pg=window.ontouchstart!==void 0&&/iPad|iPhone|iPod/.test(navigator.userAgent),gg=xt(t=>new Intl.RelativeTimeFormat(t||void 0)),Wi=80;function vg(t){var e;return(e=t==null?void 0:t.options)!=null&&e.length?`📊: +${t.options.map(n=>`- ${n.title}${n.votesCount>=0?` (${n.votesCount})`:""}`).join(` +`)}`:""}function er(t,e){const{maskCustomEmojis:n,maskURLs:o}=e||{},{spoilerText:i,poll:a,emojis:s}=t;let{content:c}=t;if(n&&(s!=null&&s.length)){const l=new RegExp(`:(${s.map(d=>d.shortcode).join("|")}):`,"g");c=c.replace(l,"⬚")}return(i?`${i} + +`:"")+yo(c,{preProcess:o&&(l=>{for(const d of l.querySelectorAll("a")){const h=d.innerText.trim();/^https?:\/\//i.test(h)&&d.replaceWith("«🔗»")}})})+vg(a)}function aa(t=[],e=document){for(const n of t)try{return e.querySelectorAll(n)}catch{}return[]}function _g(t,e){if(!t)return!1;if(e!=null&&e.length){const o=new RegExp(`:(${e.map(i=>i.shortcode).join("|")}):`,"g");t=t.replace(o,"")}return t=t.trim(),t?!!yo(t,{preProcess:o=>{for(const i of aa([".mention, pre, code, a:has(.invisible)",".mention, pre, code"],o))i.remove()}}):!1}function yg(t,e){if(e!=null&&e.length){const n=new RegExp(`:(${e.map(o=>o.shortcode).join("|")}):`,"g");t=t.replace(n,"")}return yo(t,{preProcess:n=>{for(const o of aa([".mention, .hashtag, pre, code, a:has(.invisible)",".mention, .hashtag, pre, code"],n))o.remove();for(const o of n.querySelectorAll("a")){const i=o.innerText.trim();(i.startsWith("https://")||i.startsWith("http://"))&&o.remove()}}})}const bg=/^http/i,Zi=({post:t,instance:e,previewMode:n})=>{const{content:o,emojis:i,language:a,mentions:s,url:c}=t,l=F();return Fe(()=>{if(!l.current)return;const d=Us(o,{emojis:i,returnDOM:!0});for(const h of d.querySelectorAll('a.u-url[target="_blank"]'))bg.test(h.innerText.trim())||h.removeAttribute("target");l.current.replaceChildren(d.cloneNode(!0))},[o,i==null?void 0:i.length]),r("div",{ref:l,lang:a,dir:"auto",class:"inner-content",onClick:Fm({mentions:s,instance:e,previewMode:n,statusURL:c})})},wg={s:"small",m:"medium",l:"large"},Eg=go(async t=>{if(t=t==null?void 0:t.trim(),(t==null?void 0:t.length)>500)return null;if(Xe){const i=await Xe.detect(t);console.groupCollapsed("💬 DETECTLANG BROWSER",i.slice(0,3).map(s=>s.detectedLanguage)),console.groupEnd();const a=i[0];if(a!=null&&a.detectedLanguage&&(a==null?void 0:a.confidence)>.5)return a.detectedLanguage}const{detectAll:e}=await k(async()=>{const{detectAll:i}=await import("./tinyld-light-CT4H0yPw.js");return{detectAll:i}},[],import.meta.url),n=e(t);console.groupCollapsed("💬 DETECTLANG TINYLD",n.slice(0,3).map(i=>i.lang)),console.groupEnd();const o=n[0];return o!=null&&o.lang&&(o==null?void 0:o.accuracy)>.5?o.lang:null}),kn={id:"8fZueG"},gr={},qi=(t,e=[])=>{if(!t)return!1;const n=Rs(!0),o=t!==n&&!Sn([t],[n])&&!e.find(i=>t===i||Sn([t],[i]));return o&&(gr[t+e]=!0),o},ca=xt(()=>Ar(),{maxAge:60*1e3});function nn({statusID:t,status:e,instance:n,size:o="m",contentTextWeight:i,readOnly:a,enableCommentHint:s,withinContext:c,skeleton:l,enableTranslate:d,forceTranslate:h,previewMode:u,allowFilters:m,onMediaClick:f,quoted:p,onStatusLinkClick:v=()=>{},showFollowedTags:y,allowContextMenu:E,showActionsBar:w,showReplyParent:A,mediaFirst:T}){var ni,oi,ri,ii,si;const{_,_:b,i18n:x}=le(),D=gg(x.locale);if(l)return r("div",{class:`status skeleton ${T?"status-media-first small":""}`,children:[!T&&r(ve,{size:"xxl"}),r("div",{class:"container",children:[r("div",{class:"meta",children:[(o==="s"||T)&&r(ve,{size:"m"})," ███ ████████"]}),r("div",{class:"content-container",children:[T&&r("div",{class:"media-first-container"}),r("div",{class:`content ${T?"media-first-content":""}`,children:r("p",{children:"████ ████████"})})]})]})]});const{masto:C,instance:S,authenticated:N}=co({instance:n}),{instance:R}=co(),O=S===R;let L=pe(t||(e==null?void 0:e.id),S);const z=Mn(j);if(e||(e=z.statuses[L]||z.statuses[t],L=pe(e==null?void 0:e.id,S)),!e)return null;const{account:{acct:q,avatar:rt,avatarStatic:J,id:ot,url:tt,displayName:lt,username:et,emojis:_t,bot:ft,group:It}={},id:H,repliesCount:ut,reblogged:mt,reblogsCount:Vt,favourited:yt,favouritesCount:Ft,bookmarked:Rt,poll:bt,muted:Ot,sensitive:Kt,spoilerText:Z,visibility:nt,language:Dt,editedAt:pt,filtered:Tt,card:dt,createdAt:ue,inReplyToId:ht,inReplyToAccountId:Ht,content:K,mentions:Y,mediaAttachments:$=[],reblog:X,uri:Qt,url:gt,emojis:Ut,tags:de,pinned:te,_deleted:ee,_pinned:Ct,emojiReactions:vt}=e,[jt,Gt]=W(null);Q(()=>{if(!K||Dt||jt)return;let g;return g=setTimeout(async()=>{let I=await Eg(yg(K,Ut));Gt(I)},1e3),()=>clearTimeout(g)},[K,Dt]);const V=Dt||jt,At=!!($!=null&&$.length);T&&At&&(o="s");const $t=ca(),Mt=at(()=>$t&&$t===ot,[ot,$t]),wt=zt(na),it=!Mt&&(!a&&!u||m)&&Or(Tt,wt);if((it==null?void 0:it.action)==="hide")return null;const Le=g=>{g.shiftKey};if((m||o!=="l")&&it&&it.action!=="blur")return r(Dg,{status:e,filterInfo:it,instance:S,containerProps:{onMouseEnter:Le},showFollowedTags:!0,quoted:p});const Jt=new Date(ue),xe=new Date(pt);let an=Y==null?void 0:Y.find(g=>g.id===Ht);!an&&Ht===H&&(an={url:tt,username:et,displayName:lt});const[Be,cn]=W(an);if(!c&&!Be&&Ht){const g=j.accounts[Ht];g?cn(g):mg(Ht,C).then(I=>{cn(I),j.accounts[I.id]=I}).catch(I=>{})}const ln=Ht===$t||(Y==null?void 0:Y.find(g=>g.id===$t)),Rn=Ya(),ne=!!Rn["reading:expand:spoilers"],we=((ni=Rn["reading:expand:media"])==null?void 0:ni.toLowerCase())||"default",Wt=u||ne||!!z.spoilers[H],he=u||we==="show_all"&&(it==null?void 0:it.action)!=="blur"||!!z.spoilersMedia[H];if(X)return It?r("div",{"data-state-post-id":L,class:"status-group",onMouseEnter:Le,children:[r("div",{class:"status-pre-meta",children:[r(M,{icon:"group",size:"l",alt:b({id:"L8fEEm"})})," ",r(Ae,{account:e.account,instance:S,showAvatar:!0})]}),r(nn,{status:t?null:X,statusID:t?X.id:null,instance:S,size:o,contentTextWeight:i,readOnly:a,mediaFirst:T})]}):r("div",{"data-state-post-id":L,class:"status-reblog",onMouseEnter:Le,children:[r("div",{class:"status-pre-meta",children:[r(M,{icon:"rocket",size:"l"})," ",r(P,{id:"DlhB4J",components:{0:r(Ae,{account:e.account,instance:S,showAvatar:!0}),1:r("span",{})}})]}),r(nn,{status:t?null:X,statusID:t?X.id:null,instance:S,size:o,contentTextWeight:i,readOnly:a,enableCommentHint:!0,mediaFirst:T})]});const ze=St(({children:g})=>r("div",{"data-state-post-id":L,class:"status-followed-tags",onMouseEnter:Le,children:[r("div",{class:"status-pre-meta",children:[r(M,{icon:"hashtag",size:"l"})," ",z.statusFollowedTags[L].slice(0,3).map(I=>r(Qe,{to:S?`/${S}/t/${I}`:`/t/${I}`,class:"status-followed-tag-item",children:I},I))]}),g]}),[L,S,z.statusFollowedTags[L]]),ba=y&&((oi=z.statusFollowedTags[L])!=null&&oi.length)?ze:B,ct=o==="l",[bo,wa]=W(h),{contentTranslation:wo,contentTranslationAutoInline:Fr}=z.settings;wo||(d=!1);const Nr=at(()=>{if(!wo||!Fr||a||c&&!ct||u||Z||Kt||bt||dt)return!1;const g=Xo(K);return g>0&&g<=dg},[wo,Fr,a,c,ct,u,Z,Kt,bt,dt,$,K]),[Eo,On]=W(!1),[Ea,To]=W(!1),Br=so(),zr=so(),Ta=so(),Ve=F(null),$n=b({id:"7jyUKe"}),Vr=St(()=>Math.max(Math.round((((Z==null?void 0:Z.length)||0)+Xo(K))/140)||1,1),[Z,K]),Kr=ue&&xn(Jt),Hr=pt&&xn(xe);let un=N&&nt!=="direct"&&nt!=="private";nt==="private"&&Mt&&(un=!0);const Fn=g=>{var I;if(!O||!N)return alert($n);(g!=null&&g.shiftKey||(I=g==null?void 0:g.syntheticEvent)!=null&&I.shiftKey)&&sl({replyToStatus:e})||Zn({replyToStatus:e})},Aa=at(()=>$.some(g=>{var I,G;return!((G=(I=g.description)==null?void 0:I.trim)!=null&&G.call(I))}),[$]),Ur=at(()=>Math.floor((new Date-Jt)/(1e3*60*60*24*30)),[Jt]),Ao=async()=>{if(!O||!N)return alert($n),!1;try{if(j.statuses[L]={...e,reblogged:!mt,reblogsCount:Vt+(mt?-1:1)},mt){const g=await C.v1.statuses.$select(H).unreblog();Ee(g,S)}else{const g=await C.v1.statuses.$select(H).reblog();Ee(g,S)}return!0}catch{return j.statuses[L]=e,!1}},jr=async()=>{if(!O||!N)return alert($n),!1;try{if(j.statuses[L]={...e,favourited:!yt,favouritesCount:Ft+(yt?-1:1)},yt){const g=await C.v1.statuses.$select(H).unfavourite();Ee(g,S)}else{const g=await C.v1.statuses.$select(H).favourite();Ee(g,S)}return!0}catch{return j.statuses[L]=e,!1}},ko=async()=>{try{const g=await jr();!ct&&g&&Lt(b(yt?{id:"sZvpIt",values:{0:et||q}}:{id:"yUngDO",values:{0:et||q}}))}catch{}},Wr=async()=>{if(Yn("@mastodon/post-bookmark")){if(!O||!N)return alert($n),!1;try{if(j.statuses[L]={...e,bookmarked:!Rt},Rt){const g=await C.v1.statuses.$select(H).unbookmark();Ee(g,S)}else{const g=await C.v1.statuses.$select(H).bookmark();Ee(g,S)}return!0}catch{return j.statuses[L]=e,!1}}},Zr=async()=>{try{const g=await Wr();!ct&&g&&Lt(b(Rt?{id:"lWQguj",values:{0:et||q}}:{id:"Fb2K8h",values:{0:et||q}}))}catch{}},dn=z.settings.contentTranslationHideLanguages||[],[Ie,qr]=W(()=>gr[V+dn]||qi(V,dn));Q(()=>{if(!V||Ie)return;if(!Ie&&gr[V+dn]){qr(!0);return}let g=setTimeout(()=>{const I=qi(V,dn);I&&qr(I)},1);return()=>clearTimeout(g)},[V,Ie,dn]);const Gr=F(),Yr=F();async function ka(g){var st,Yt,Ke,So;g&&(Gr.current=C.v1.statuses.$select(t).rebloggedBy.list({limit:Wi}).values(),Yr.current=C.v1.statuses.$select(t).favouritedBy.list({limit:Wi}).values());const[{value:I},{value:G}]=await Promise.allSettled([Gr.current.next(),Yr.current.next()]);if((st=I.value)!=null&&st.length||(Yt=G.value)!=null&&Yt.length){const De=[];return(Ke=I.value)!=null&&Ke.length&&De.push(...I.value.map(Me=>(Me._types=["reblog"],Me))),(So=G.value)!=null&&So.length&&De.push(...G.value.map(Me=>(Me._types=["favourite"],Me))),{value:De,done:I.done&&G.done}}return{value:[],done:!0}}const Sa=F(),Xr=["public","unlisted"].includes(nt),Ca=["public","unlisted","private"].includes(nt),Qr=Aa&&!mt?r("div",{class:"footer",children:[r(M,{icon:"alert"}),r(P,{id:"MB+wJL"})]}):Ur>=3&&r("div",{class:"footer",children:[r(M,{icon:"info"}),r("span",{children:r(P,{id:"dBme/4",values:{0:D.format(-Ur,"month")},components:{0:r("strong",{})}})})]}),Jr=r(B,{children:[!ct&&O&&r(B,{children:r("div",{class:"menu-control-group-horizontal status-menu",children:[r(kt,{onClick:Fn,children:[r(M,{icon:"comment"}),r("span",{children:ut>0?me(ut):b({id:"ImOQa9"})})]}),r(Do,{subMenu:!0,confirmLabel:r(B,{children:[r(M,{icon:"rocket"}),r("span",{children:b(mt?{id:"QzzGsY"}:{id:"kulphB"})})]}),className:`menu-reblog ${mt?"checked":""}`,menuExtras:r(kt,{onClick:()=>{Zn({draftStatus:{status:` +${gt}`}})},children:[r(M,{icon:"quote"}),r("span",{children:r(P,{id:"ZhhOwV"})})]}),menuFooter:Qr,disabled:!un,onClick:async()=>{try{const g=await Ao();!ct&&g&&Lt(b(mt?{id:"bpDheH",values:{0:et||q}}:{id:"dbNZdP",values:{0:et||q}}))}catch{}},children:[r(M,{icon:"rocket"}),r("span",{children:Vt>0?me(Vt):b(mt?{id:"QzzGsY"}:{id:"PiVIlD"})})]}),r(kt,{onClick:ko,className:`menu-favourite ${yt?"checked":""}`,children:[r(M,{icon:"heart"}),r("span",{children:Ft>0?me(Ft):b(yt?{id:"OcUmcH"}:{id:"W9FRBT"})})]}),Yn("@mastodon/post-bookmark")&&r(kt,{onClick:Zr,className:`menu-bookmark ${Rt?"checked":""}`,children:[r(M,{icon:"bookmark"}),r("span",{children:b(Rt?{id:"q8EQYI"}:{id:"PZlHt8"})})]})]})}),!ct&&O&&(ct||w)&&r(mn,{}),(ct||w)&&r(B,{children:r(kt,{onClick:()=>{j.showGenericAccounts={heading:b({id:"+XOeb+"}),fetchAccounts:ka,instance:S,showReactions:!0,postID:L}},children:[r(M,{icon:"react"}),r("span",{children:r(P,{id:"+XOeb+"})})]})}),(ct||!T&&(d||!V||Ie))&&r(mn,{}),!T&&(d||!V||Ie)&&r("div",{class:mr?"menu-horizontal":"",children:[d?r(kt,{disabled:bo,onClick:()=>wa(!0),children:[r(M,{icon:"translate"}),r("span",{children:r(P,{id:"pi8x/S"})})]}):r(_i,{to:`${S?`/${S}`:""}/s/${H}?translate=1`,children:[r(M,{icon:"translate"}),r("span",{children:r(P,{id:"pi8x/S"})})]}),mr&&r(kt,{onClick:()=>{try{const g=er(e);g&&Rp(g,V)}catch{}},children:[r(M,{icon:"speak"}),r("span",{children:r(P,{id:"yIBLq8"})})]})]}),ct&&r(kt,{onClick:()=>{try{const g=er(e);navigator.clipboard.writeText(g),Lt(b({id:"iSRQvy"}))}catch{Lt(b({id:"N1MyiN"}))}},children:[r(M,{icon:"clipboard"}),r("span",{children:r(P,{id:"iQgJaz"})})]}),(!ct&&O||d||!V||Ie)&&r(mn,{}),!ct&&r(B,{children:r(_i,{to:S?`/${S}/s/${H}`:`/s/${H}`,onClick:g=>{v(g,e)},children:[r(M,{icon:"arrows-right"}),r("small",{children:[r(P,{id:"8MkSAW",values:{0:et||q},components:{0:r("span",{class:"bidi-isolate"})}}),r("br",{}),r("span",{class:"more-insignificant",children:[_($e[nt])," • ",Kr]})]})]})}),!!pt&&r(B,{children:r(kt,{onClick:()=>{On(H)},children:[r(M,{icon:"history"}),r("small",{children:[r(P,{id:"QL+7Jw"}),r("br",{}),r("span",{class:"more-insignificant",children:r(P,{id:"DuJJm9",values:{editedDateText:Hr}})})]})]})}),r(kt,{href:gt,target:"_blank",children:[r(M,{icon:"external"}),r("small",{class:"menu-double-lines",style:{maxWidth:"16em"},children:xg(gt)})]}),r("div",{class:"menu-horizontal",children:[r(kt,{onClick:()=>{try{navigator.clipboard.writeText(gt),Lt(b({id:"edWbV6"}))}catch{Lt(b({id:"W1ewR0"}))}},children:[r(M,{icon:"link"}),r("span",{children:r(P,{id:"he3ygx"})})]}),Xr&&(navigator==null?void 0:navigator.share)&&((ri=navigator==null?void 0:navigator.canShare)==null?void 0:ri.call(navigator,{url:gt}))&&r(kt,{onClick:()=>{try{navigator.share({url:gt})}catch{alert(b({id:"TtG3Uh"}))}},children:[r(M,{icon:"share"}),r("span",{children:r(P,{id:"LFKLqp"})})]})]}),Xr&&ct&&r(kt,{onClick:()=>{To(!0)},children:[r(M,{icon:"code"}),r("span",{children:r(P,{id:"jdVwsS"})})]}),(Mt||ln)&&r(mn,{}),(Mt||ln)&&r(kt,{onClick:async()=>{try{const g=await C.v1.statuses.$select(H)[Ot?"unmute":"mute"]();Ee(g,S),Lt(b(Ot?{id:"Pm+5jw"}:{id:"ywB7JM"}))}catch{Lt(b(Ot?{id:"c6jxNY"}:{id:"8SN9kN"}))}},children:Ot?r(B,{children:[r(M,{icon:"unmute"}),r("span",{children:r(P,{id:"i51zUR"})})]}):r(B,{children:[r(M,{icon:"mute"}),r("span",{children:r(P,{id:"OiUYO5"})})]})}),Mt&&Ca&&r(kt,{onClick:async()=>{try{const g=await C.v1.statuses.$select(H)[te?"unpin":"pin"]();Ee(g,S),Lt(b(te?{id:"Yx809+"}:{id:"S6P6E+"}))}catch{Lt(b(te?{id:"A6cs15"}:{id:"vgUfWO"}))}},children:te?r(B,{children:[r(M,{icon:"unpin"}),r("span",{children:r(P,{id:"XQMQZw"})})]}):r(B,{children:[r(M,{icon:"pin"}),r("span",{children:r(P,{id:"lfHLsx"})})]})}),Mt&&r("div",{class:"menu-horizontal",children:[Yn("@mastodon/post-edit")&&r(kt,{onClick:()=>{Zn({editStatus:e})},children:[r(M,{icon:"pencil"}),r("span",{children:r(P,{id:"ePK91l"})})]}),ct&&r(Do,{subMenu:!0,confirmLabel:r(B,{children:[r(M,{icon:"trash"}),r("span",{children:r(P,{id:"FbPNuJ"})})]}),itemProps:{className:"danger"},menuItemClassName:"danger",onClick:()=>{(async()=>{try{await C.v1.statuses.$select(H).remove();const g=cs(H,S);g._deleted=!0,Lt(b({id:"KiyvHV"}))}catch{Lt(b({id:"Yb6p2q"}))}})()},children:[r(M,{icon:"trash"}),r("span",{children:r(P,{id:"Jb6/SB"})})]})]}),!Mt&&ct&&r(B,{children:[r(mn,{}),r(kt,{className:"danger",onClick:()=>{j.showReportModal={account:e.account,post:e}},children:[r(M,{icon:"flag"}),r("span",{children:r(P,{id:"7PQAMY"})})]})]})]}),ti=F(),[Nn,hn]=W(!1),[Bn,zn]=W({}),Vn=E||!ct&&!u&&!ee&&!p,La=Ss(pg&&Vn?g=>{var Yt;if(g.pointerType==="mouse")return;const{clientX:I,clientY:G}=((Yt=g.touches)==null?void 0:Yt[0])||g,st=g.target.closest("a");st&&Ve.current.contains(st)&&!st.getAttribute("href").startsWith("#")||(g.preventDefault(),zn({anchorPoint:{x:I,y:G},direction:"right"}),hn(!0))}:null,{threshold:600,captureEvent:!0,detect:"touch",cancelOnMovement:2}),Kn=!a&&!u&&!p,xa=Ze("r, shift+r",Fn,{enabled:Kn,useKey:!0,ignoreEventWhen:g=>g.metaKey||g.ctrlKey||g.altKey}),Ia=Ze("f, l",ko,{enabled:Kn,ignoreEventWhen:g=>g.metaKey||g.ctrlKey||g.altKey||g.shiftKey,useKey:!0}),Da=Ze("d",Zr,{enabled:Kn,useKey:!0,ignoreEventWhen:g=>g.metaKey||g.ctrlKey||g.altKey||g.shiftKey}),Ma=Ze("shift+b",g=>{g.shiftKey&&(async()=>{try{const I=await Ao();!ct&&I&&Lt(b(mt?{id:"bpDheH",values:{0:et||q}}:{id:"dbNZdP",values:{0:et||q}}))}catch{}})()},{enabled:Kn&&un,useKey:!0,ignoreEventWhen:g=>g.metaKey||g.ctrlKey||g.altKey}),Pa=Ze("x",g=>{const I=document.activeElement.closest(".status-link, .status-focus");if(I){const G=I.querySelector(".spoiler-button:not(.spoiling)");if(G)g.stopPropagation(),G.click();else{const st=I.querySelector(".spoiler-media-button:not(.spoiling)");st&&(g.stopPropagation(),st.click())}}},{useKey:!0,ignoreEventWhen:g=>g.metaKey||g.ctrlKey||g.altKey||g.shiftKey}),Hn=$.slice(0,ct?void 0:4),Un=$.length>1&&Hn.some(g=>!!g.description&&!sa(g.description)),Ra=at(()=>{if(!Un)return null;const g=[];return Hn.forEach((I,G)=>{if(!I.description)return;const st=g.findIndex(Yt=>Yt.media.description===I.description);st===-1?g.push({media:I,indices:[G]}):g[st].indices.push(G)}),g.map(({media:I,indices:G})=>r("div",{"data-caption-index":G.map(st=>st+1).join(" "),onClick:st=>{st.preventDefault(),st.stopPropagation(),j.showMediaAlt={alt:I.description,lang:V}},title:I.description,children:[r("sup",{children:G.map(st=>st+1).join(" ")})," ",I.description]},I.id))},[Un,Hn,V]),fn=at(()=>{var g;return!!ht&&Ht===((g=e.account)==null?void 0:g.id)||!!z.statusThreadNumber[L]},[ht,Ht,(ii=e.account)==null?void 0:ii.id,z.statusThreadNumber[L]]),Oa=at(()=>s&&!fn&&!c&&!ht&&nt==="public"&&ut>0,[s,fn,c,ht,ut,nt]),ei=at(()=>{if(dt||bt||Kt||Z||$!=null&&$.length||fn||c||ht||ut<=0||!/[???︖❓❔⁇⁈⁉¿‽؟]/.test(K))return!1;const G=Xo(K);if(G>0&&G<=ug)return!0},[dt,bt,Kt,Z,$,X,fn,c,ht,ut,K]);return r(ba,{children:[A&&!!(ht&&Ht)&&r(Ig,{sKey:L}),r("article",{"data-state-post-id":L,ref:g=>{var G;Ve.current=g;const I=((G=g==null?void 0:g.closest)==null?void 0:G.call(g,".timeline-item, .timeline-item-alt, .status-link, .status-focus"))||g;xa.current=I,Ia.current=I,Da.current=I,Ma.current=I,Pa.current=I},tabindex:"-1",class:`status ${!c&&ht&&Be?"status-reply-to":""} visibility-${nt} ${Ct?"status-pinned":""} ${wg[o]} ${ee?"status-deleted":""} ${p?"status-card":""} ${Nn?"status-menu-open":""} ${T&&At?"status-media-first":""}`,onMouseEnter:Le,onContextMenu:g=>{var st,Yt;if(!Vn||g.metaKey)return;const I=g.target.closest("a");if(I&&Ve.current.contains(I)&&!I.getAttribute("href").startsWith("#"))return;const G=(st=window.getSelection)==null?void 0:st.call(window);if(G.toString().length>0){const{anchorNode:Ke}=G;if((Yt=Ve.current)!=null&&Yt.contains(Ke))return}g.preventDefault(),zn({anchorPoint:{x:g.clientX,y:g.clientY},direction:"right"}),hn(!0)},...Vn?La():{},children:[Vn&&r(_s,{ref:ti,state:Nn?"open":void 0,...Bn,onClose:g=>{var I,G,st;hn(!1),(g==null?void 0:g.reason)==="click"&&((st=(G=(I=Ve.current)==null?void 0:I.closest("[tabindex]"))==null?void 0:G.focus)==null||st.call(G))},portal:{target:document.body},containerProps:{style:{zIndex:1001},onClick:()=>{var g,I;(I=(g=ti.current)==null?void 0:g.closeMenu)==null||I.call(g)}},overflow:"auto",boundingBoxPadding:xs(),unmountOnClose:!0,children:Jr}),w&&o!=="l"&&!u&&!a&&!ee&&!p&&r("div",{class:`status-actions ${Nn==="actions-bar"?"open":""}`,ref:Sa,children:[r(We,{size:"s",title:b({id:"ImOQa9"}),alt:b({id:"ImOQa9"}),class:"reply-button",icon:"comment",iconSize:"m",onClick:Fn}),r(We,{size:"s",checked:yt,title:[b({id:"W9FRBT"}),b({id:"OcUmcH"})],alt:[b({id:"W9FRBT"}),b({id:"8ab1sR"})],class:"favourite-button",icon:"heart",iconSize:"m",count:Ft,onClick:ko}),r("button",{type:"button",title:b({id:"2FYpfJ"}),class:"plain more-button",onClick:g=>{g.preventDefault(),g.stopPropagation(),zn({anchorRef:{current:g.currentTarget},align:"start",direction:"left",gap:0,shift:-8}),hn("actions-bar")},children:r(M,{icon:"more2",size:"m",alt:b({id:"2FYpfJ"})})})]}),o!=="l"&&r("div",{class:"status-badge",children:[mt&&r(M,{class:"reblog",icon:"rocket",size:"s",alt:b({id:"b7T5Zj"})}),yt&&r(M,{class:"favourite",icon:"heart",size:"s",alt:b({id:"8ab1sR"})}),Rt&&r(M,{class:"bookmark",icon:"bookmark",size:"s",alt:b({id:"1C/9Sa"})}),Ct&&r(M,{class:"pin",icon:"pin",size:"s",alt:b({id:"kNiQp6"})})]}),o!=="s"&&r("a",{href:tt,tabindex:"-1",title:`@${q}`,onClick:g=>{g.preventDefault(),g.stopPropagation(),j.showAccount={account:e.account,instance:S}},children:r(ve,{url:J||rt,size:"xxl",squircle:ft})}),r("div",{class:"container",children:[!!(e.account||ue)&&r("div",{class:"meta",children:[r("span",{class:"meta-name",children:r(Ae,{account:e.account,instance:S,showAvatar:o==="s",showAcct:ct})})," ",o!=="l"&&(ee?r("span",{class:"status-deleted-tag",children:r(P,{id:"vGjmyl"})}):gt&&!u&&!a&&!p?r(Qe,{to:S?`/${S}/s/${H}`:`/s/${H}`,onClick:g=>{g.metaKey||g.ctrlKey||g.shiftKey||g.altKey||g.which===2||(g.preventDefault(),g.stopPropagation(),v==null||v(g,e),zn({anchorRef:{current:g.currentTarget},align:"end",direction:"bottom",gap:4}),hn(!0))},class:`time ${Nn&&(Bn!=null&&Bn.anchorRef)?"is-open":""}`,children:[Oa&&!ei?r(M,{icon:"comment2",size:"s",alt:Pt._({id:"RXmXDR",values:{repliesCount:ut}})}):nt!=="public"&&nt!=="direct"&&r(M,{icon:An[nt],alt:_($e[nt]),size:"s"})," ",r(ge,{datetime:Jt,format:"micro"}),!u&&!a&&r(M,{icon:"more2",class:"more",alt:b({id:"2FYpfJ"})})]}):r("span",{class:"time",children:[nt!=="public"&&nt!=="direct"&&r(B,{children:[r(M,{icon:An[nt],alt:_($e[nt]),size:"s"})," "]}),r(ge,{datetime:Jt,format:"micro"})]}))]}),nt==="direct"&&r(B,{children:[r("div",{class:"status-direct-badge",children:r(P,{id:"IV4QaU"})})," "]}),!c&&r(B,{children:fn?r("div",{class:"status-thread-badge",children:[r(M,{icon:"thread",size:"s"}),r(P,{id:"lQ8zCz",values:{0:z.statusThreadNumber[L]?` ${z.statusThreadNumber[L]}/X`:""}})]}):!!ht&&!!Be&&(!!Z||!Y.find(g=>g.id===Ht))&&r("div",{class:"status-reply-badge",children:[r(M,{icon:"reply"})," ",r(Ae,{account:Be,instance:S,short:!0})]})}),r("div",{class:`content-container ${Z||Kt||(it==null?void 0:it.action)==="blur"?"has-spoiler":""} ${Wt?"show-spoiler":""} ${he?"show-media":""}`,"data-content-text-weight":i?Vr():null,style:(ct||i)&&{"--content-text-weight":Vr()},children:T&&At?r(B,{children:[(!!Z||!!Kt)&&!ne&&r(B,{children:[!!Z&&r("span",{class:"spoiler-content media-first-spoiler-content",lang:V,dir:"auto",ref:Br,"data-read-more":_(kn),children:[r(en,{text:Z,emojis:Ut})," "]}),r("button",{class:`light spoiler-button media-first-spoiler-button ${Wt?"spoiling":""}`,type:"button",onClick:g=>{g.preventDefault(),g.stopPropagation(),Wt?(delete j.spoilers[H],ne||delete j.spoilersMedia[H]):(j.spoilers[H]=!0,ne||(j.spoilersMedia[H]=!0))},children:[r(M,{icon:Wt?"eye-open":"eye-close"})," ",b(Wt?{id:"6lGV3K"}:{id:"lqBX03"})]})]}),r(Ag,{mediaAttachments:$,language:V,postID:H,instance:S}),!!K&&r("div",{class:"media-first-content content",ref:zr,children:r(Zi,{post:e,instance:S,previewMode:u})})]}):r(B,{children:[!!Z&&r(B,{children:[r("div",{class:"content spoiler-content",lang:V,dir:"auto",ref:Br,"data-read-more":_(kn),children:r("p",{children:r(en,{text:Z,emojis:Ut})})}),ne||u?r("div",{class:"spoiler-divider",children:[r(M,{icon:"eye-open"})," ",r(P,{id:"gnKo7f"})]}):r("button",{class:`light spoiler-button ${Wt?"spoiling":""}`,type:"button",onClick:g=>{g.preventDefault(),g.stopPropagation(),Wt?(delete j.spoilers[H],ne||delete j.spoilersMedia[H]):(j.spoilers[H]=!0,ne||(j.spoilersMedia[H]=!0))},children:[r(M,{icon:Wt?"eye-open":"eye-close"})," ",b(Wt?{id:"6lGV3K"}:{id:"lqBX03"})]})]}),!!K&&r("div",{class:"content",ref:zr,"data-read-more":_(kn),inert:Z&&!Wt?!0:void 0,children:[r(Zi,{post:e,instance:S,previewMode:u}),r(Mg,{id:H,instance:S,level:p})]}),!!bt&&r(Dp,{lang:V,poll:bt,readOnly:a||!O||!N,onUpdate:g=>{j.statuses[L].poll=g},refresh:()=>C.v1.polls.$select(bt.id).fetch().then(g=>{j.statuses[L].poll=g}).catch(g=>{}),votePoll:g=>C.v1.polls.$select(bt.id).votes.create({choices:g}).then(I=>{j.statuses[L].poll=I}).catch(I=>{})}),((d||Nr)&&_g(K,Ut)&&Ie||bo)&&r(mp,{forceTranslate:bo||Nr,mini:!ct&&!c,sourceLanguage:V,autoDetected:jt,text:er(e,{maskCustomEmojis:!0,maskURLs:!0})}),!u&&(Kt||(it==null?void 0:it.action)==="blur")&&!!$.length&&(we!=="show_all"||(it==null?void 0:it.action)==="blur")&&r("button",{class:`plain spoiler-media-button ${he?"spoiling":""}`,type:"button",hidden:!ne&&!!Z,onClick:g=>{g.preventDefault(),g.stopPropagation(),he?delete j.spoilersMedia[H]:j.spoilersMedia[H]=!0},children:[r(M,{icon:he?"eye-open":"eye-close"})," ",r("span",{children:[(it==null?void 0:it.action)==="blur"&&r("small",{children:[r(P,{id:"suKjh3",values:{0:it==null?void 0:it.titlesStr}}),r("br",{})]}),b(he?{id:"6lGV3K"}:{id:"9ZCilh"})]})]}),!!$.length&&($.length>1&&(ct||c&&o==="m")?r("div",{class:"media-large-container",children:$.map((g,I)=>r("div",{class:"media-container media-eq1",children:r(pr,{media:g,autoAnimate:!0,showCaption:!0,allowLongerCaption:!K||ct,lang:V,to:`/${S}/s/${H}?${c?"media":"media-only"}=${I+1}`,onClick:f?G=>f(G,I,g,e):void 0})},g.id))}):r(Tg,{lang:V,enabled:Un,captionChildren:Ra,children:r("div",{ref:Ta,class:`media-container media-eq${$.length} ${$.length>2?"media-gt2":""} ${$.length>4?"media-gt4":""}`,children:Hn.map((g,I)=>r(pr,{media:g,autoAnimate:ct,showCaption:$.length===1,allowLongerCaption:!K&&$.length===1,lang:V,altIndex:Un&&!!g.description&&I+1,to:`/${S}/s/${H}?${c?"media":"media-only"}=${I+1}`,onClick:f?G=>{f(G,I,g,e)}:void 0,checkAspectRatio:$.length===1},g.id))})})),!!dt&&/^https/i.test(dt==null?void 0:dt.url)&&!Kt&&!Z&&!bt&&!$.length&&!z.statusQuotes[L]&&r(Sg,{card:dt,selfReferential:(dt==null?void 0:dt.url)===e.url||(dt==null?void 0:dt.url)===e.uri,selfAuthor:(si=dt==null?void 0:dt.authors)==null?void 0:si.some(g=>{var I;return((I=g.account)==null?void 0:I.url)===tt}),instance:R})]})}),!ct&&ei&&r("div",{class:"content-comment-hint insignificant",children:[r(M,{icon:"comment2",alt:b({id:"N8UzTV"})})," ",ut]}),ct&&r(B,{children:[r("div",{class:"extra-meta",children:ee?r("span",{class:"status-deleted-tag",children:r(P,{id:"vGjmyl"})}):r(B,{children:[r("span",{children:_($e[nt])})," •"," ",r("a",{href:gt,target:"_blank",rel:"noopener",children:[new Date().getTime()-Jt.getTime()<864e5&&r(B,{children:[r(ge,{datetime:Jt,format:"micro"})," ","‒"," "]}),!!ue&&r("time",{class:"created",datetime:Jt.toISOString(),title:Jt.toLocaleString(),children:Kr})]}),pt&&r(B,{children:[" ","• ",r(M,{icon:"pencil",alt:b({id:"MRZxAn"})})," ",r("time",{tabIndex:"0",class:"edited",datetime:xe.toISOString(),onClick:()=>{On(H)},children:Hr})]})]})}),!!(vt!=null&&vt.length)&&r("div",{class:"emoji-reactions",children:vt.map(g=>{const{name:I,count:G,me:st,url:Yt,staticUrl:Ke}=g;if(Yt)return r("span",{class:`emoji-reaction tag ${st?"":"insignificant"}`,children:[r(dr,{alt:I,url:Yt,staticUrl:Ke})," ",G]});if(/^:.+?:$/.test(I)){const De=Ut.find(Me=>Me.shortcode===I.replace(/^:/,"").replace(/:$/,""));if(De)return r("span",{class:`emoji-reaction tag ${st?"":"insignificant"}`,children:[r(dr,{alt:I,url:De.url,staticUrl:De.staticUrl})," ",G]})}return r("span",{class:`emoji-reaction tag ${st?"":"insignificant"}`,children:[I," ",G]})})}),r("div",{class:`actions ${ee?"disabled":""}`,children:[r("div",{class:"action has-count",children:r(We,{title:b({id:"ImOQa9"}),alt:b({id:"VbyRUy"}),class:"reply-button",icon:"comment",count:ut,onClick:Fn})}),r("div",{class:"action has-count",children:r(Do,{disabled:!un,onClick:Ao,confirmLabel:r(B,{children:[r(M,{icon:"rocket"}),r("span",{children:b(mt?{id:"QzzGsY"}:{id:"kulphB"})})]}),menuExtras:r(kt,{onClick:()=>{Zn({draftStatus:{status:` +${gt}`}})},children:[r(M,{icon:"quote"}),r("span",{children:r(P,{id:"ZhhOwV"})})]}),menuFooter:Qr,children:r(We,{checked:mt,title:[b({id:"kulphB"}),b({id:"QzzGsY"})],alt:[b({id:"kulphB"}),b({id:"b7T5Zj"})],class:"reblog-button",icon:"rocket",count:Vt,disabled:!un})})}),r("div",{class:"action has-count",children:r(We,{checked:yt,title:[b({id:"W9FRBT"}),b({id:"OcUmcH"})],alt:[b({id:"W9FRBT"}),b({id:"8ab1sR"})],class:"favourite-button",icon:"heart",count:Ft,onClick:jr})}),Yn("@mastodon/post-bookmark")&&r("div",{class:"action",children:r(We,{checked:Rt,title:[b({id:"PZlHt8"}),b({id:"q8EQYI"})],alt:[b({id:"PZlHt8"}),b({id:"1C/9Sa"})],class:"bookmark-button",icon:"bookmark",onClick:Wr})}),r(Ms,{portal:{target:document.querySelector(".status-deck")||document.body},align:"end",gap:4,overflow:"auto",viewScroll:"close",menuButton:r("div",{class:"action",children:r("button",{type:"button",title:b({id:"2FYpfJ"}),class:"plain more-button",children:r(M,{icon:"more",size:"l",alt:b({id:"2FYpfJ"})})})}),children:[Jr," "]})]})]})]}),!!Eo&&r(cr,{onClick:g=>{g.target===g.currentTarget&&On(!1)},children:r(Cg,{statusID:Eo,instance:S,fetchStatusHistory:()=>C.v1.statuses.$select(Eo).history.list(),onClose:()=>{var g;On(!1),(g=Ve.current)==null||g.focus()}})}),!!Ea&&r(cr,{onClick:g=>{g.target===g.currentTarget&&To(!1)},children:r(Lg,{post:e,instance:S,onClose:()=>{To(!1)}})})]})]})}function Tg(t){const{enabled:e,children:n,lang:o,captionChildren:i}=t;return!e||!i?n:r("figure",{class:"media-figure-multiple",children:[n,r("figcaption",{lang:o,dir:"auto",children:i})]})}function Ag(t){const{mediaAttachments:e,language:n,postID:o,instance:i}=t,a=e.length>1,s=F(),[c,l]=W(0);return Q(()=>{let d=()=>{const{clientWidth:h,scrollLeft:u}=s.current,m=Math.round(Math.abs(u)/h);l(m)};return s.current&&s.current.addEventListener("scroll",d,{passive:!0}),()=>{s.current&&s.current.removeEventListener("scroll",d)}},[]),r(B,{children:[r("div",{class:"media-first-container",children:[r("div",{class:"media-first-carousel",ref:s,children:e.map((d,h)=>r("div",{class:"media-first-item",children:r(pr,{media:d,lang:n,to:`/${i}/s/${o}?media=${h+1}`})},d.id))}),a&&r("div",{class:"media-carousel-controls",children:[r("div",{class:"carousel-indexer",children:[c+1,"/",e.length]}),r("label",{class:"media-carousel-button",children:r("button",{type:"button",class:"carousel-button",hidden:c===0,onClick:d=>{d.preventDefault(),d.stopPropagation(),s.current.focus(),s.current.scrollTo({left:s.current.clientWidth*(c-1)*(ur()?-1:1),behavior:"smooth"})},children:r(M,{icon:"arrow-left"})})}),r("label",{class:"media-carousel-button",children:r("button",{type:"button",class:"carousel-button",hidden:c===e.length-1,onClick:d=>{d.preventDefault(),d.stopPropagation(),s.current.focus(),s.current.scrollTo({left:s.current.clientWidth*(c+1)*(ur()?-1:1),behavior:"smooth"})},children:r(M,{icon:"arrow-right"})})})]})]}),a&&r("div",{class:"media-carousel-dots",style:{"--dots-count":e.length},children:e.map((d,h)=>r("span",{class:`carousel-dot ${h===c?"active":""}`},d.id))})]})}function Gi(t){return["x.com","twitter.com","threads.net","bsky.app","bsky.brid.gy","fed.brid.gy"].includes(t)}function kg({authors:t,hidden:e,children:n}){var i,a;if(e||!((a=(i=t==null?void 0:t[0])==null?void 0:i.account)!=null&&a.id))return n;const o=t[0].account;return r("div",{class:"card-byline",children:[n,r("div",{class:"card-byline-author",children:[r(M,{icon:"link",size:"s"})," ",r("small",{children:r(P,{id:"4LHHK6",components:{0:r(Ae,{account:o,showAvatar:!0})}})})]})]})}function Sg({card:t,selfReferential:e,selfAuthor:n,instance:o}){var q;const i=Mn(j),{blurhash:a,title:s,description:c,html:l,providerName:d,providerUrl:h,authorName:u,authorUrl:m,width:f,height:p,image:v,imageDescription:y,url:E,type:w,embedUrl:A,language:T,publishedAt:_,authors:b}=t,x=s||d||u,C=f/p>=1.2?"large":"",[S,N]=W(null);if(Q(()=>{x&&v&&!e&&Xa(E)&&Qa(o,E).then(rt=>{if(!rt)return;const{id:J,url:ot}=rt;N("#"+ot)})},[x,v,e]),i.unfurledLinks[E])return null;const R=/`;\n }\n addIframe(isIntersectionObserver = false) {\n if (!this.isIframeLoaded) {\n const iframeHTML = this.generateIframe(isIntersectionObserver);\n this.domRefFrame.insertAdjacentHTML('beforeend', iframeHTML);\n this.domRefFrame.classList.add('activated');\n this.isIframeLoaded = true;\n this.attemptShortAutoPlay();\n this.dispatchEvent(new CustomEvent('liteYoutubeIframeLoaded', {\n detail: {\n videoId: this.videoId,\n },\n bubbles: true,\n cancelable: true,\n }));\n }\n }\n initImagePlaceholder() {\n this.testPosterImage();\n this.domRefImg.fallback.setAttribute('aria-label', `${this.videoPlay}: ${this.videoTitle}`);\n this.domRefImg?.fallback?.setAttribute('alt', `${this.videoPlay}: ${this.videoTitle}`);\n }\n async testPosterImage() {\n setTimeout(() => {\n const webpUrl = `https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`;\n const img = new Image();\n img.fetchPriority = 'low';\n img.referrerPolicy = 'origin';\n img.src = webpUrl;\n img.onload = async (e) => {\n const target = e.target;\n const noPoster = target?.naturalHeight == 90 && target?.naturalWidth == 120;\n if (noPoster) {\n this.posterQuality = 'hqdefault';\n }\n const posterUrlWebp = `https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`;\n this.domRefImg.webp.srcset = posterUrlWebp;\n const posterUrlJpeg = `https://i.ytimg.com/vi/${this.videoId}/${this.posterQuality}.jpg`;\n this.domRefImg.fallback.loading = this.posterLoading;\n this.domRefImg.jpeg.srcset = posterUrlJpeg;\n this.domRefImg.fallback.src = posterUrlJpeg;\n this.domRefImg.fallback.loading = this.posterLoading;\n };\n }, 100);\n }\n initIntersectionObserver() {\n const options = {\n root: null,\n rootMargin: '0px',\n threshold: 0,\n };\n const observer = new IntersectionObserver((entries, observer) => {\n entries.forEach(entry => {\n if (entry.isIntersecting && !this.isIframeLoaded) {\n LiteYTEmbed.warmConnections(this);\n this.addIframe(true);\n observer.unobserve(this);\n }\n });\n }, options);\n observer.observe(this);\n if (this.autoPause) {\n const windowPause = new IntersectionObserver((e, o) => {\n e.forEach(entry => {\n if (entry.intersectionRatio !== 1) {\n this.shadowRoot\n .querySelector('iframe')\n ?.contentWindow?.postMessage('{\"event\":\"command\",\"func\":\"pauseVideo\",\"args\":\"\"}', '*');\n }\n });\n }, { threshold: 1 });\n windowPause.observe(this);\n }\n }\n attemptShortAutoPlay() {\n if (this.isYouTubeShort()) {\n setTimeout(() => {\n this.shadowRoot\n .querySelector('iframe')\n ?.contentWindow?.postMessage('{\"event\":\"command\",\"func\":\"' + 'playVideo' + '\",\"args\":\"\"}', '*');\n }, 2000);\n }\n }\n isYouTubeShort() {\n return (this.getAttribute('short') === '' &&\n window.matchMedia('(max-width: 40em)').matches);\n }\n static addPrefetch(kind, url) {\n const linkElem = document.createElement('link');\n linkElem.rel = kind;\n linkElem.href = url;\n linkElem.crossOrigin = 'true';\n document.head.append(linkElem);\n }\n static warmConnections(context) {\n if (LiteYTEmbed.isPreconnected || window.liteYouTubeIsPreconnected)\n return;\n LiteYTEmbed.addPrefetch('preconnect', 'https://i.ytimg.com/');\n LiteYTEmbed.addPrefetch('preconnect', 'https://s.ytimg.com');\n if (!context.noCookie) {\n LiteYTEmbed.addPrefetch('preconnect', 'https://www.youtube.com');\n LiteYTEmbed.addPrefetch('preconnect', 'https://www.google.com');\n LiteYTEmbed.addPrefetch('preconnect', 'https://googleads.g.doubleclick.net');\n LiteYTEmbed.addPrefetch('preconnect', 'https://static.doubleclick.net');\n }\n else {\n LiteYTEmbed.addPrefetch('preconnect', 'https://www.youtube-nocookie.com');\n }\n LiteYTEmbed.isPreconnected = true;\n window.liteYouTubeIsPreconnected = true;\n }\n}\nLiteYTEmbed.isPreconnected = false;\ncustomElements.define('lite-youtube', LiteYTEmbed);\n//# sourceMappingURL=lite-youtube.js.map","const digitLookup = new Uint8Array(128);\nfor (let i = 0; i < 83; i++) {\n digitLookup[\n '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~'.charCodeAt(\n i,\n )\n ] = i;\n}\nconst decode83 = (str, start, end) => {\n let value = 0;\n while (start < end) {\n value *= 83;\n value += digitLookup[str.charCodeAt(start++)];\n }\n return value;\n};\n\nconst pow = Math.pow;\nconst PI = Math.PI;\nconst PI2 = PI * 2;\n\nconst d = 3294.6;\nconst e = 269.025;\nconst sRGBToLinear = (value) =>\n value > 10.31475 ? pow(value / e + 0.052132, 2.4) : value / d;\n\nconst linearTosRGB = (v) =>\n ~~(v > 0.00001227 ? e * pow(v, 0.416666) - 13.025 : v * d + 1);\n\nconst signSqr = (x) => (x < 0 ? -1 : 1) * x * x;\n\n/**\n * Fast approximate cosine implementation\n * Based on FTrig https://github.com/netcell/FTrig\n */\nconst fastCos = (x) => {\n x += PI / 2;\n while (x > PI) {\n x -= PI2;\n }\n const cos = 1.27323954 * x - 0.405284735 * signSqr(x);\n return 0.225 * (signSqr(cos) - cos) + cos;\n};\n\n/**\n * Extracts average color from BlurHash image\n * @param {string} blurHash BlurHash image string\n * @returns {[number, number, number]}\n */\nexport function getBlurHashAverageColor(blurHash) {\n const val = decode83(blurHash, 2, 6);\n return [val >> 16, (val >> 8) & 255, val & 255];\n}\n\n/**\n * Decodes BlurHash image\n * @param {string} blurHash BlurHash image string\n * @param {number} width Output image width\n * @param {number} height Output image height\n * @param {?number} punch\n * @returns {Uint8ClampedArray}\n */\nexport function decodeBlurHash(blurHash, width, height, punch) {\n const sizeFlag = decode83(blurHash, 0, 1);\n const numX = (sizeFlag % 9) + 1;\n const numY = ~~(sizeFlag / 9) + 1;\n const size = numX * numY;\n\n let i = 0,\n j = 0,\n x = 0,\n y = 0,\n r = 0,\n g = 0,\n b = 0,\n basis = 0,\n basisY = 0,\n colorIndex = 0,\n pixelIndex = 0,\n value = 0;\n\n const maximumValue = ((decode83(blurHash, 1, 2) + 1) / 13446) * (punch | 1);\n\n const colors = new Float64Array(size * 3);\n\n const averageColor = getBlurHashAverageColor(blurHash);\n for (i = 0; i < 3; i++) {\n colors[i] = sRGBToLinear(averageColor[i]);\n }\n\n for (i = 1; i < size; i++) {\n value = decode83(blurHash, 4 + i * 2, 6 + i * 2);\n colors[i * 3] = signSqr(~~(value / 361) - 9) * maximumValue;\n colors[i * 3 + 1] = signSqr((~~(value / 19) % 19) - 9) * maximumValue;\n colors[i * 3 + 2] = signSqr((value % 19) - 9) * maximumValue;\n }\n\n const cosinesY = new Float64Array(numY * height);\n const cosinesX = new Float64Array(numX * width);\n for (j = 0; j < numY; j++) {\n for (y = 0; y < height; y++) {\n cosinesY[j * height + y] = fastCos((PI * y * j) / height);\n }\n }\n for (i = 0; i < numX; i++) {\n for (x = 0; x < width; x++) {\n cosinesX[i * width + x] = fastCos((PI * x * i) / width);\n }\n }\n\n const bytesPerRow = width * 4;\n const pixels = new Uint8ClampedArray(bytesPerRow * height);\n\n for (y = 0; y < height; y++) {\n for (x = 0; x < width; x++) {\n r = g = b = 0;\n for (j = 0; j < numY; j++) {\n basisY = cosinesY[j * height + y];\n for (i = 0; i < numX; i++) {\n basis = cosinesX[i * width + x] * basisY;\n colorIndex = (i + j * numX) * 3;\n r += colors[colorIndex] * basis;\n g += colors[colorIndex + 1] * basis;\n b += colors[colorIndex + 2] * basis;\n }\n }\n\n pixelIndex = 4 * x + y * bytesPerRow;\n pixels[pixelIndex] = linearTosRGB(r);\n pixels[pixelIndex + 1] = linearTosRGB(g);\n pixels[pixelIndex + 2] = linearTosRGB(b);\n pixels[pixelIndex + 3] = 255; // alpha\n }\n }\n return pixels;\n}\n","/**\n * @param {string[]} splittedHtml\n * @param {{ char?: string; count?: number}} options\n * @returns {string}\n */\nconst addIndentation = (splittedHtml, options = {}) => {\n const char = options.char || ' '\n const count = options.count || 2\n\n let level = 0\n const opened = []\n\n return splittedHtml.reverse().reduce((indented, elTag) => {\n if (opened.length\n && level\n && opened[level]\n /* if current element tag is the same as previously opened one */\n && opened[level] === elTag.substring(1, opened[level].length + 1)\n ) {\n opened.splice(level, 1)\n level--\n }\n\n const indentation = char.repeat(level ? level * count : 0)\n\n const newIndented = [\n `${indentation}${elTag}`,\n ...indented,\n ]\n\n // if current element tag is closing tag\n // add it to opened elements\n if (elTag.substring(0, 2) === ' (\n // Replace\n // - 1 or more spaces or tabs at the start of line\n // - 1 or more spaces or tabs at the end of line\n // - empty lines\n // with empty string\n nonFormattedString.trim().replace(/(^(\\s|\\t)+|(( |\\t)+)$)/gm, '')\n)\n\n/**\n * @param {string} markup\n * @returns {string[]} Array of strings splitted on new lines without empty lines\n */\nconst mergeAttributesWithElements = (markup) => {\n const splittedMarkup = removeEmptyLines(markup).split('\\n')\n\n const mergedLines = []\n let currentElement = ''\n for (let i = 0; i < splittedMarkup.length; i += 1) {\n const line = splittedMarkup[i]\n\n // If line is closing element/tag separate closing tag from rest of the line with space\n if (line.endsWith('/>')) {\n mergedLines.push(`${currentElement}${line.slice(0, -2)} />`)\n currentElement = ''\n // eslint-disable-next-line no-continue\n continue\n }\n\n if (line.endsWith('>')) {\n mergedLines.push(`${currentElement}${\n line.startsWith('>') || line.startsWith('<') ? '' : ' '\n }${line}`)\n currentElement = ''\n // eslint-disable-next-line no-continue\n continue\n }\n\n currentElement += currentElement.length ? ` ${line}` : line\n }\n\n return mergedLines\n}\n\nmodule.exports = {\n mergeAttributesWithElements,\n removeEmptyLines,\n}\n","const addIndentation = require('./utils/addIndentation')\nconst { mergeAttributesWithElements } = require('./utils/toLines')\n\n/**\n * @param {string} markup\n * @param {{ char?: string; count?: number }} options\n * @returns {string}\n */\nconst prettify = (markup, options = {}) => {\n const splitted = mergeAttributesWithElements(markup)\n\n return addIndentation(splitted, options)\n}\n\nmodule.exports = prettify\n","import { i18n } from '@lingui/core';\nimport { plural } from '@lingui/core/macro';\nimport { Plural, Trans, useLingui } from '@lingui/react/macro';\nimport { useState } from 'preact/hooks';\n\nimport shortenNumber from '../utils/shorten-number';\n\nimport EmojiText from './emoji-text';\nimport Icon from './icon';\nimport RelativeTime from './relative-time';\n\nexport default function Poll({\n poll,\n lang,\n readOnly,\n refresh = () => {},\n votePoll = () => {},\n}) {\n const { t } = useLingui();\n const [uiState, setUIState] = useState('default');\n const {\n expired,\n expiresAt,\n id,\n multiple,\n options,\n ownVotes,\n voted,\n votersCount,\n votesCount = 0,\n emojis,\n } = poll;\n const expiresAtDate = !!expiresAt && new Date(expiresAt); // Update poll at point of expiry\n // NOTE: Disable this because setTimeout runs immediately if delay is too large\n // https://stackoverflow.com/a/56718027/20838\n // useEffect(() => {\n // let timeout;\n // if (!expired && expiresAtDate) {\n // const ms = expiresAtDate.getTime() - Date.now() + 1; // +1 to give it a little buffer\n // if (ms > 0) {\n // timeout = setTimeout(() => {\n // setUIState('loading');\n // (async () => {\n // // await refresh();\n // setUIState('default');\n // })();\n // }, ms);\n // }\n // }\n // return () => {\n // clearTimeout(timeout);\n // };\n // }, [expired, expiresAtDate]);\n\n const pollVotesCount = multiple ? votersCount || votesCount : votesCount;\n let roundPrecision = 0;\n\n if (pollVotesCount <= 1000) {\n roundPrecision = 0;\n } else if (pollVotesCount <= 10000) {\n roundPrecision = 1;\n } else if (pollVotesCount <= 100000) {\n roundPrecision = 2;\n }\n\n const [showResults, setShowResults] = useState(false);\n const optionsHaveVoteCounts = options.every((o) => o.votesCount !== null);\n\n return (\n \n {(showResults && optionsHaveVoteCounts) || voted || expired ? (\n <>\n
\n {options.map((option, i) => {\n const { title, votesCount: optionVotesCount } = option;\n const ratio = pollVotesCount\n ? optionVotesCount / pollVotesCount\n : 0;\n const percentage = ratio\n ? ratio.toLocaleString(i18n.locale || undefined, {\n style: 'percent',\n maximumFractionDigits: roundPrecision,\n })\n : '0%';\n\n const isLeading =\n optionVotesCount > 0 &&\n optionVotesCount ===\n Math.max(...options.map((o) => o.votesCount));\n return (\n \n
\n \n \n \n {voted && ownVotes.includes(i) && (\n <>\n {' '}\n \n \n )}\n
\n \n {percentage}\n
\n \n );\n })}\n \n {!expired && !voted && (\n {\n e.preventDefault();\n setShowResults(false);\n }}\n >\n Hide results\n \n )}\n \n ) : (\n {\n e.preventDefault();\n const form = e.target;\n const formData = new FormData(form);\n const choices = [];\n formData.forEach((value, key) => {\n if (key === 'poll') {\n choices.push(value);\n }\n });\n if (!choices.length) return;\n setUIState('loading');\n await votePoll(choices);\n setUIState('default');\n }}\n >\n
\n {options.map((option, i) => {\n const { title } = option;\n return (\n
\n \n
\n );\n })}\n
\n {!readOnly && (\n \n Vote\n \n )}\n \n )}\n

\n {!expired && !readOnly && (\n {\n e.preventDefault();\n setUIState('loading');\n\n (async () => {\n await refresh();\n setUIState('default');\n })();\n }}\n title={t`Refresh`}\n >\n \n \n )}\n {!voted && !expired && !readOnly && optionsHaveVoteCounts && (\n {\n e.preventDefault();\n setShowResults(!showResults);\n }}\n title={showResults ? t`Hide results` : t`Show results`}\n >\n {' '}\n \n )}\n {!expired && !readOnly && ' '}\n \n {shortenNumber(votesCount)} vote\n \n }\n other={\n \n {shortenNumber(votesCount)} votes\n \n }\n />\n {!!votersCount && votersCount !== votesCount && (\n <>\n {' '}\n •{' '}\n \n {shortenNumber(votersCount)}{' '}\n voter\n \n }\n other={\n \n {shortenNumber(votersCount)}{' '}\n voters\n \n }\n />\n \n )}{' '}\n •{' '}\n {expired ? (\n !!expiresAtDate ? (\n \n Ended \n \n ) : (\n t`Ended`\n )\n ) : !!expiresAtDate ? (\n \n Ending \n \n ) : (\n t`Ending`\n )}\n

\n \n );\n}\n","import { createContext } from 'preact';\n\nconst FilterContext = createContext();\nexport default FilterContext;\n","import mem from './mem';\nimport { getCurrentAccountID } from './store-utils';\n\nfunction _isFiltered(filtered, filterContext) {\n if (!filtered?.length) return false;\n const appliedFilters = filtered.filter((f) => {\n const { filter } = f;\n const hasContext = filter.context.includes(filterContext);\n if (!hasContext) return false;\n if (!filter.expiresAt) return hasContext;\n return new Date(filter.expiresAt) > new Date();\n });\n if (!appliedFilters.length) return false;\n const isHidden = appliedFilters.some((f) => f.filter.filterAction === 'hide');\n if (isHidden)\n return {\n action: 'hide',\n };\n const isBlur = appliedFilters.every((f) => f.filter.filterAction === 'blur');\n if (isBlur) {\n const filterTitles = appliedFilters.map((f) => f.filter.title);\n return {\n action: 'blur',\n titles: filterTitles,\n titlesStr: filterTitles.join(' • '),\n };\n }\n // const isWarn = appliedFilters.some((f) => f.filter.filterAction === 'warn');\n const isWarn = appliedFilters.some((f) => !!f.filter.filterAction);\n // Re: spec; unknown values for filter_action should be treated as warn.\n if (isWarn) {\n const filterTitles = appliedFilters.map((f) => f.filter.title);\n return {\n action: 'warn',\n titles: filterTitles,\n titlesStr: filterTitles.join(' • '),\n };\n }\n return false;\n}\nexport const isFiltered = mem(_isFiltered);\n\nexport function filteredItem(item, filterContext, currentAccountID) {\n const { filtered } = item;\n if (!filtered?.length) return true;\n const isSelf = currentAccountID && item.account?.id === currentAccountID;\n if (isSelf) return true;\n const filterState = isFiltered(filtered, filterContext);\n if (!filterState) return true;\n if (filterState.action === 'hide') return false;\n // item._filtered = filterState;\n return true;\n}\nexport function filteredItems(items, filterContext) {\n if (!items?.length) return [];\n if (!filterContext) return items;\n const currentAccountID = getCurrentAccountID();\n return items.filter((item) =>\n filteredItem(item, filterContext, currentAccountID),\n );\n}\n","import punycode from 'punycode/';\n\nexport default function getDomain(url) {\n try {\n return punycode.toUnicode(\n URL.parse(url)\n .hostname.replace(/^www\\./, '')\n .replace(/\\/$/, ''),\n );\n } catch (e) {\n return ''; // just give up\n }\n}\n","const div = document.createElement('div');\nexport default function htmlContentLength(html) {\n if (!html) return 0;\n div.innerHTML = html;\n // .invisible spans for links\n // e.g. https://mastodon.social\n div.querySelectorAll('.invisible').forEach((el) => {\n el.remove();\n });\n return div.innerText.length;\n}\n","export const supportsTTS = 'speechSynthesis' in window;\n\nexport function speak(text, lang) {\n if (!supportsTTS) return;\n try {\n if (speechSynthesis.speaking) {\n speechSynthesis.cancel();\n }\n const utterance = new SpeechSynthesisUtterance(text);\n if (lang) utterance.lang = lang;\n speechSynthesis.speak(utterance);\n } catch (e) {\n alert(e);\n }\n}\n","import{useRef as r,useEffect as n,useMemo as t,useState as e,useCallback as u}from\"react\";function c(e,u,c,i){var a=this,o=r(null),f=r(0),l=r(0),v=r(null),m=r([]),d=r(),g=r(),p=r(e),w=r(!0);p.current=e;var s=\"undefined\"!=typeof window,x=!u&&0!==u&&s;if(\"function\"!=typeof e)throw new TypeError(\"Expected a function\");u=+u||0;var h=!!(c=c||{}).leading,y=!(\"trailing\"in c)||!!c.trailing,F=\"maxWait\"in c,A=\"debounceOnServer\"in c&&!!c.debounceOnServer,D=F?Math.max(+c.maxWait||0,u):null;n(function(){return w.current=!0,function(){w.current=!1}},[]);var T=t(function(){var r=function(r){var n=m.current,t=d.current;return m.current=d.current=null,f.current=r,l.current=l.current||r,g.current=p.current.apply(t,n)},n=function(r,n){x&&cancelAnimationFrame(v.current),v.current=x?requestAnimationFrame(r):setTimeout(r,n)},t=function(r){if(!w.current)return!1;var n=r-o.current;return!o.current||n>=u||n<0||F&&r-f.current>=D},e=function(n){return v.current=null,y&&m.current?r(n):(m.current=d.current=null,g.current)},c=function r(){var c=Date.now();if(h&&l.current===f.current&&T(),t(c))return e(c);if(w.current){var i=u-(c-o.current),a=F?Math.min(i,D-(c-f.current)):i;n(r,a)}},T=function(){i&&i({})},W=function(){if(s||A){var e=Date.now(),i=t(e);if(m.current=[].slice.call(arguments),d.current=a,o.current=e,i){if(!v.current&&w.current)return f.current=o.current,n(c,u),h?r(o.current):g.current;if(F)return n(c,u),r(o.current)}return v.current||n(c,u),g.current}};return W.cancel=function(){v.current&&(x?cancelAnimationFrame(v.current):clearTimeout(v.current)),f.current=0,m.current=o.current=d.current=v.current=null},W.isPending=function(){return!!v.current},W.flush=function(){return v.current?e(Date.now()):g.current},W},[h,F,u,D,y,x,s,A,i]);return T}function i(r,n){return r===n}function a(n,t,a){var o=a&&a.equalityFn||i,f=r(n),l=e({})[1],v=c(u(function(r){f.current=r,l({})},[l]),t,a,l),m=r(n);return o(m.current,n)||(v(n),m.current=n),[f.current,v]}function o(r,n,t){var e=void 0===t?{}:t,u=e.leading,i=e.trailing;return c(r,n,{maxWait:n,leading:void 0===u||u,trailing:void 0===i||i})}export{a as useDebounce,c as useDebouncedCallback,o as useThrottledCallback};\n//# sourceMappingURL=index.module.js.map\n","import { useRef, useEffect, useCallback, useState, useMemo } from 'react';\n\n// This could've been more streamlined with internal state instead of abusing\n// refs to such extent, but then composing hooks and components could not opt out of unnecessary renders.\nfunction useResolvedElement(subscriber, refOrElement) {\n var lastReportRef = useRef(null);\n var refOrElementRef = useRef(null);\n refOrElementRef.current = refOrElement;\n var cbElementRef = useRef(null); // Calling re-evaluation after each render without using a dep array,\n // as the ref object's current value could've changed since the last render.\n\n useEffect(function () {\n evaluateSubscription();\n });\n var evaluateSubscription = useCallback(function () {\n var cbElement = cbElementRef.current;\n var refOrElement = refOrElementRef.current; // Ugly ternary. But smaller than an if-else block.\n\n var element = cbElement ? cbElement : refOrElement ? refOrElement instanceof Element ? refOrElement : refOrElement.current : null;\n\n if (lastReportRef.current && lastReportRef.current.element === element && lastReportRef.current.subscriber === subscriber) {\n return;\n }\n\n if (lastReportRef.current && lastReportRef.current.cleanup) {\n lastReportRef.current.cleanup();\n }\n\n lastReportRef.current = {\n element: element,\n subscriber: subscriber,\n // Only calling the subscriber, if there's an actual element to report.\n // Setting cleanup to undefined unless a subscriber returns one, as an existing cleanup function would've been just called.\n cleanup: element ? subscriber(element) : undefined\n };\n }, [subscriber]); // making sure we call the cleanup function on unmount\n\n useEffect(function () {\n return function () {\n if (lastReportRef.current && lastReportRef.current.cleanup) {\n lastReportRef.current.cleanup();\n lastReportRef.current = null;\n }\n };\n }, []);\n return useCallback(function (element) {\n cbElementRef.current = element;\n evaluateSubscription();\n }, [evaluateSubscription]);\n}\n\n// We're only using the first element of the size sequences, until future versions of the spec solidify on how\n// exactly it'll be used for fragments in multi-column scenarios:\n// From the spec:\n// > The box size properties are exposed as FrozenArray in order to support elements that have multiple fragments,\n// > which occur in multi-column scenarios. However the current definitions of content rect and border box do not\n// > mention how those boxes are affected by multi-column layout. In this spec, there will only be a single\n// > ResizeObserverSize returned in the FrozenArray, which will correspond to the dimensions of the first column.\n// > A future version of this spec will extend the returned FrozenArray to contain the per-fragment size information.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-entry-interface)\n//\n// Also, testing these new box options revealed that in both Chrome and FF everything is returned in the callback,\n// regardless of the \"box\" option.\n// The spec states the following on this:\n// > This does not have any impact on which box dimensions are returned to the defined callback when the event\n// > is fired, it solely defines which box the author wishes to observe layout changes on.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-interface)\n// I'm not exactly clear on what this means, especially when you consider a later section stating the following:\n// > This section is non-normative. An author may desire to observe more than one CSS box.\n// > In this case, author will need to use multiple ResizeObservers.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-interface)\n// Which is clearly not how current browser implementations behave, and seems to contradict the previous quote.\n// For this reason I decided to only return the requested size,\n// even though it seems we have access to results for all box types.\n// This also means that we get to keep the current api, being able to return a simple { width, height } pair,\n// regardless of box option.\nfunction extractSize(entry, boxProp, sizeType) {\n if (!entry[boxProp]) {\n if (boxProp === \"contentBoxSize\") {\n // The dimensions in `contentBoxSize` and `contentRect` are equivalent according to the spec.\n // See the 6th step in the description for the RO algorithm:\n // https://drafts.csswg.org/resize-observer/#create-and-populate-resizeobserverentry-h\n // > Set this.contentRect to logical this.contentBoxSize given target and observedBox of \"content-box\".\n // In real browser implementations of course these objects differ, but the width/height values should be equivalent.\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"];\n }\n\n return undefined;\n } // A couple bytes smaller than calling Array.isArray() and just as effective here.\n\n\n return entry[boxProp][0] ? entry[boxProp][0][sizeType] : // TS complains about this, because the RO entry type follows the spec and does not reflect Firefox's current\n // behaviour of returning objects instead of arrays for `borderBoxSize` and `contentBoxSize`.\n // @ts-ignore\n entry[boxProp][sizeType];\n}\n\nfunction useResizeObserver(opts) {\n if (opts === void 0) {\n opts = {};\n }\n\n // Saving the callback as a ref. With this, I don't need to put onResize in the\n // effect dep array, and just passing in an anonymous function without memoising\n // will not reinstantiate the hook's ResizeObserver.\n var onResize = opts.onResize;\n var onResizeRef = useRef(undefined);\n onResizeRef.current = onResize;\n var round = opts.round || Math.round; // Using a single instance throughout the hook's lifetime\n\n var resizeObserverRef = useRef();\n\n var _useState = useState({\n width: undefined,\n height: undefined\n }),\n size = _useState[0],\n setSize = _useState[1]; // In certain edge cases the RO might want to report a size change just after\n // the component unmounted.\n\n\n var didUnmount = useRef(false);\n useEffect(function () {\n didUnmount.current = false;\n return function () {\n didUnmount.current = true;\n };\n }, []); // Using a ref to track the previous width / height to avoid unnecessary renders.\n\n var previous = useRef({\n width: undefined,\n height: undefined\n }); // This block is kinda like a useEffect, only it's called whenever a new\n // element could be resolved based on the ref option. It also has a cleanup\n // function.\n\n var refCallback = useResolvedElement(useCallback(function (element) {\n // We only use a single Resize Observer instance, and we're instantiating it on demand, only once there's something to observe.\n // This instance is also recreated when the `box` option changes, so that a new observation is fired if there was a previously observed element with a different box option.\n if (!resizeObserverRef.current || resizeObserverRef.current.box !== opts.box || resizeObserverRef.current.round !== round) {\n resizeObserverRef.current = {\n box: opts.box,\n round: round,\n instance: new ResizeObserver(function (entries) {\n var entry = entries[0];\n var boxProp = opts.box === \"border-box\" ? \"borderBoxSize\" : opts.box === \"device-pixel-content-box\" ? \"devicePixelContentBoxSize\" : \"contentBoxSize\";\n var reportedWidth = extractSize(entry, boxProp, \"inlineSize\");\n var reportedHeight = extractSize(entry, boxProp, \"blockSize\");\n var newWidth = reportedWidth ? round(reportedWidth) : undefined;\n var newHeight = reportedHeight ? round(reportedHeight) : undefined;\n\n if (previous.current.width !== newWidth || previous.current.height !== newHeight) {\n var newSize = {\n width: newWidth,\n height: newHeight\n };\n previous.current.width = newWidth;\n previous.current.height = newHeight;\n\n if (onResizeRef.current) {\n onResizeRef.current(newSize);\n } else {\n if (!didUnmount.current) {\n setSize(newSize);\n }\n }\n }\n })\n };\n }\n\n resizeObserverRef.current.instance.observe(element, {\n box: opts.box\n });\n return function () {\n if (resizeObserverRef.current) {\n resizeObserverRef.current.instance.unobserve(element);\n }\n };\n }, [opts.box, round]), opts.ref);\n return useMemo(function () {\n return {\n ref: refCallback,\n width: size.width,\n height: size.height\n };\n }, [refCallback, size.width, size.height]);\n}\n\nexport { useResizeObserver as default };\n","import { useRef } from 'preact/hooks';\nimport { useThrottledCallback } from 'use-debounce';\nimport useResizeObserver from 'use-resize-observer';\n\nexport default function useTruncated({ className = 'truncated' } = {}) {\n const ref = useRef();\n const onResize = useThrottledCallback(({ height }) => {\n if (ref.current) {\n const { scrollHeight } = ref.current;\n let truncated = scrollHeight > height;\n if (truncated) {\n const { height: _height, maxHeight } = getComputedStyle(ref.current);\n const computedHeight = parseInt(maxHeight || _height, 10);\n truncated = scrollHeight > computedHeight;\n }\n ref.current.classList.toggle(className, truncated);\n }\n }, 300);\n useResizeObserver({\n ref,\n box: 'border-box',\n onResize,\n });\n return ref;\n}\n","export default {\n public: 'earth',\n unlisted: 'group',\n private: 'lock',\n direct: 'message',\n local: 'building',\n};\n","export var styleRoot = 'kvfysmfp';\nexport var styleChild = 'ufhsfnkm';\nexport var styles = \".\".concat(styleRoot, \"{overflow:hidden;touch-action:none}.\").concat(styleChild, \"{transform-origin: 0 0}\");\n","var isSsr = typeof window === 'undefined';\nexport var isTouch = function () {\n return !isSsr && ('ontouchstart' in window || navigator.maxTouchPoints > 0);\n};\nexport var make2dTransformValue = function (_a) {\n var x = _a.x, y = _a.y, scale = _a.scale;\n return \"scale(\".concat(scale, \") translate(\").concat(x, \"px, \").concat(y, \"px)\");\n};\nexport var make3dTransformValue = function (_a) {\n var x = _a.x, y = _a.y, scale = _a.scale;\n return \"scale3d(\".concat(scale, \",\").concat(scale, \", 1) translate3d(\").concat(x, \"px, \").concat(y, \"px, 0)\");\n};\nexport var hasTranslate3DSupport = function () {\n var css = !isSsr && window.CSS;\n return css && css.supports && css.supports('transform', 'translate3d(0,0,0)');\n};\n","var min = Math.min, max = Math.max;\nexport function getOffsetBounds(_a) {\n var containerDimension = _a.containerDimension, childDimension = _a.childDimension, padding = _a.padding, centerContained = _a.centerContained;\n var diff = childDimension - containerDimension;\n if (diff + 2 * padding <= 0 && centerContained) {\n return [diff / 2, diff / 2];\n }\n else {\n return [min(diff + padding, 0) - padding, max(0, diff + padding)];\n }\n}\n","import { __assign, __extends } from \"tslib\";\nimport React, { Component, createRef, Children, cloneElement } from 'react';\nimport { styleRoot, styleChild, styles } from './styles.css';\nimport { isTouch } from '../utils';\nimport { getOffsetBounds } from './getOffsetBounds';\nvar classnames = function (base, other) {\n return other ? \"\".concat(base, \" \").concat(other) : base;\n};\nvar abs = Math.abs, min = Math.min, sqrt = Math.sqrt;\nvar isSsr = typeof window === 'undefined';\nvar isMac = isSsr ? false : /(Mac)/i.test(navigator.platform);\nvar isDragInteraction = function (i) { return i === 'drag'; };\nvar isZoomInteraction = function (i) { return i === 'zoom'; };\nvar isZoomGesture = function (wheelEvent) { return isMac && wheelEvent.ctrlKey; };\nvar cancelEvent = function (event) {\n event.stopPropagation();\n event.preventDefault();\n};\nvar getDistance = function (a, b) {\n var x = a.x - b.x;\n var y = a.y - b.y;\n return sqrt(x * x + y * y);\n};\nvar calculateScale = function (startTouches, endTouches) {\n var startDistance = getDistance(startTouches[0], startTouches[1]);\n var endDistance = getDistance(endTouches[0], endTouches[1]);\n return endDistance / startDistance;\n};\nvar isCloseTo = function (value, expected) {\n return value > expected - 0.01 && value < expected + 0.01;\n};\nvar swing = function (p) { return -Math.cos(p * Math.PI) / 2 + 0.5; };\nvar getPointByPageCoordinates = function (touch) { return ({\n x: touch.pageX,\n y: touch.pageY,\n}); };\nvar getPageCoordinatesByTouches = function (touches) {\n return Array.from(touches).map(getPointByPageCoordinates);\n};\nvar sum = function (a, b) { return a + b; };\nvar getVectorAvg = function (vectors) { return ({\n x: vectors.map(function (_a) {\n var x = _a.x;\n return x;\n }).reduce(sum, 0) / vectors.length,\n y: vectors.map(function (_a) {\n var y = _a.y;\n return y;\n }).reduce(sum, 0) / vectors.length,\n}); };\nvar clamp = function (min, max, value) {\n return value < min ? min : value > max ? max : value;\n};\nvar shouldInterceptWheel = function (event) {\n return !(event.ctrlKey || event.metaKey);\n};\nvar getElementSize = function (element) {\n if (element) {\n var offsetWidth = element.offsetWidth, offsetHeight = element.offsetHeight;\n // Any DOMElement\n if (offsetWidth && offsetHeight) {\n return { width: offsetWidth, height: offsetHeight };\n }\n // Svg support\n var style = getComputedStyle(element);\n var width = parseFloat(style.width);\n var height = parseFloat(style.height);\n if (height && width) {\n return { width: width, height: height };\n }\n }\n return { width: 0, height: 0 };\n};\nvar calculateVelocity = function (startPoint, endPoint) { return ({\n x: endPoint.x - startPoint.x,\n y: endPoint.y - startPoint.y,\n}); };\nvar comparePoints = function (p1, p2) { return p1.x === p2.x && p1.y === p2.y; };\nvar noup = function () { };\nvar zeroPoint = { x: 0, y: 0 };\nvar PinchZoom = /** @class */ (function (_super) {\n __extends(PinchZoom, _super);\n function PinchZoom() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._prevDragMovePoint = null;\n _this._containerObserver = null;\n _this._fingers = 0;\n _this._firstMove = true;\n _this._initialOffset = __assign({}, zeroPoint);\n _this._interaction = null;\n _this._isDoubleTap = false;\n _this._isOffsetsSet = false;\n _this._lastDragPosition = null;\n _this._lastScale = 1;\n _this._lastTouchStart = 0;\n _this._lastZoomCenter = null;\n _this._listenMouseMove = false;\n _this._nthZoom = 0;\n _this._offset = __assign({}, zeroPoint);\n _this._startOffset = __assign({}, zeroPoint);\n _this._startTouches = null;\n _this._updatePlaned = false;\n _this._wheelTimeOut = null;\n _this._zoomFactor = 1;\n _this._initialZoomFactor = 1;\n _this._draggingPoint = __assign({}, zeroPoint);\n // It help reduce behavior difference between touch and mouse events\n _this._ignoreNextClick = false;\n // @ts-ignore\n _this._containerRef = createRef();\n _this._handleClick = function (clickEvent) {\n if (_this._ignoreNextClick) {\n _this._ignoreNextClick = false;\n clickEvent.stopPropagation();\n }\n };\n _this._onResize = function () {\n var _a;\n if ((_a = _this._containerRef) === null || _a === void 0 ? void 0 : _a.current) {\n _this._updateInitialZoomFactor();\n _this._setupOffsets();\n _this._update();\n }\n };\n _this._handlerOnTouchEnd = _this._handlerIfEnable(function (touchEndEvent) {\n _this._fingers = touchEndEvent.touches.length;\n if (_this.props.shouldCancelHandledTouchEndEvents &&\n (isZoomInteraction(_this._interaction) ||\n (isDragInteraction(_this._interaction) &&\n (_this._startOffset.x !== _this._offset.x ||\n _this._startOffset.y !== _this._offset.y)))) {\n cancelEvent(touchEndEvent);\n }\n if (isDragInteraction(_this._interaction) && !_this._enoughToDrag()) {\n _this._handleClick(touchEndEvent);\n }\n _this._updateInteraction(touchEndEvent);\n });\n _this._handlerOnTouchStart = _this._handlerIfEnable(function (touchStartEvent) {\n _this._firstMove = true;\n _this._fingers = touchStartEvent.touches.length;\n _this._detectDoubleTap(touchStartEvent);\n });\n _this._handlerOnTouchMove = _this._handlerIfEnable(function (touchMoveEvent) {\n if (_this._isDoubleTap) {\n return;\n }\n _this._collectInertia(touchMoveEvent);\n if (_this._firstMove) {\n _this._updateInteraction(touchMoveEvent);\n if (_this._interaction) {\n cancelEvent(touchMoveEvent);\n }\n _this._startOffset = __assign({}, _this._offset);\n _this._startTouches = getPageCoordinatesByTouches(touchMoveEvent.touches);\n }\n else {\n if (isZoomInteraction(_this._interaction)) {\n if (_this._startTouches &&\n _this._startTouches.length === 2 &&\n touchMoveEvent.touches.length === 2) {\n _this._handleZoom(touchMoveEvent, calculateScale(_this._startTouches, getPageCoordinatesByTouches(touchMoveEvent.touches)));\n }\n }\n else if (isDragInteraction(_this._interaction)) {\n _this._handleDrag(touchMoveEvent);\n }\n if (_this._interaction) {\n cancelEvent(touchMoveEvent);\n _this._update();\n }\n }\n _this._firstMove = false;\n });\n _this._handlerWheel = function (wheelEvent) {\n if (_this.props.shouldInterceptWheel(wheelEvent)) {\n return;\n }\n cancelEvent(wheelEvent);\n var pageX = wheelEvent.pageX, pageY = wheelEvent.pageY, deltaY = wheelEvent.deltaY, deltaMode = wheelEvent.deltaMode;\n var scaleDelta = 1;\n if (isZoomGesture(wheelEvent) || deltaMode === 1) {\n scaleDelta = 15;\n }\n var likeTouchEvent = {\n touches: [\n // @ts-ignore\n { pageX: pageX, pageY: pageY },\n ],\n };\n var center = _this._getOffsetByFirstTouch(likeTouchEvent);\n var dScale = deltaY * scaleDelta;\n _this._stopAnimation();\n _this._scaleTo(_this._zoomFactor - dScale / _this.props.wheelScaleFactor, center);\n _this._update();\n clearTimeout(\n // @ts-ignore\n _this._wheelTimeOut);\n _this._wheelTimeOut = setTimeout(function () { return _this._sanitize(); }, 100);\n };\n // @ts-ignore\n _this._handlers = _this.props.isTouch()\n ? [\n ['touchstart', _this._handlerOnTouchStart],\n ['touchend', _this._handlerOnTouchEnd],\n ['touchmove', _this._handlerOnTouchMove],\n ]\n : [\n [\n 'mousemove',\n _this.simulate(_this._handlerOnTouchMove),\n _this.props._document,\n ],\n [\n 'mouseup',\n _this.simulate(_this._handlerOnTouchEnd),\n _this.props._document,\n ],\n ['mousedown', _this.simulate(_this._handlerOnTouchStart)],\n ['click', _this._handleClick],\n ['wheel', _this._handlerWheel],\n ];\n return _this;\n }\n PinchZoom.prototype._handleDragStart = function (event) {\n this._ignoreNextClick = true;\n this.props.onDragStart();\n this._stopAnimation();\n this._resetInertia();\n this._lastDragPosition = null;\n this._hasInteraction = true;\n this._draggingPoint = this._offset;\n this._handleDrag(event);\n };\n PinchZoom.prototype._handleDrag = function (event) {\n var touch = this._getOffsetByFirstTouch(event);\n if (this._enoughToDrag()) {\n this._drag(touch, this._lastDragPosition);\n }\n else {\n this._virtualDrag(touch, this._lastDragPosition);\n }\n this._offset = this._sanitizeOffset(this._offset);\n this._lastDragPosition = touch;\n };\n PinchZoom.prototype._resetInertia = function () {\n this._velocity = null;\n this._prevDragMovePoint = null;\n };\n PinchZoom.prototype._realizeInertia = function () {\n var _this = this;\n var _a = this.props, inertiaFriction = _a.inertiaFriction, inertia = _a.inertia;\n if (!inertia || !this._velocity) {\n return;\n }\n var _b = this._velocity, x = _b.x, y = _b.y;\n if (x || y) {\n this._stopAnimation();\n this._resetInertia();\n var renderFrame = function () {\n x *= inertiaFriction;\n y *= inertiaFriction;\n if (!x && !y) {\n return _this._stopAnimation();\n }\n var prevOffset = __assign({}, _this._offset);\n _this._addOffset({ x: x, y: y });\n _this._offset = _this._sanitizeOffset(_this._offset);\n if (comparePoints(prevOffset, _this._offset)) {\n return _this._stopAnimation();\n }\n _this._update({ isAnimation: true });\n };\n this._animate(renderFrame, { duration: 9999 });\n }\n };\n PinchZoom.prototype._collectInertia = function (_a) {\n var touches = _a.touches;\n if (!this.props.inertia) {\n return;\n }\n var currentCoordinates = getPageCoordinatesByTouches(touches)[0];\n var prevPoint = this._prevDragMovePoint;\n if (prevPoint) {\n this._velocity = calculateVelocity(currentCoordinates, prevPoint);\n }\n this._prevDragMovePoint = currentCoordinates;\n };\n PinchZoom.prototype._handleDragEnd = function () {\n this.props.onDragEnd();\n this._end();\n this._realizeInertia();\n };\n PinchZoom.prototype._handleZoomStart = function () {\n this.props.onZoomStart();\n this._stopAnimation();\n this._lastScale = 1;\n this._nthZoom = 0;\n this._lastZoomCenter = null;\n this._hasInteraction = true;\n };\n PinchZoom.prototype._handleZoom = function (event, newScale) {\n var touchCenter = getVectorAvg(this._getOffsetTouches(event));\n var scale = newScale / this._lastScale;\n this._lastScale = newScale;\n // The first touch events are thrown away since they are not precise\n this._nthZoom += 1;\n if (this._nthZoom > 3) {\n this._scale(scale, touchCenter);\n this._drag(touchCenter, this._lastZoomCenter);\n if (this.props.enforceBoundsDuringZoom) {\n this._offset = this._sanitizeOffset(this._offset);\n }\n }\n this._lastZoomCenter = touchCenter;\n };\n PinchZoom.prototype._handleZoomEnd = function () {\n this.props.onZoomEnd();\n this._end();\n };\n PinchZoom.prototype._handleDoubleTap = function (event) {\n var _this = this;\n if (this._hasInteraction || this.props.tapZoomFactor === 0) {\n return;\n }\n var needZoomOut = (this.props.doubleTapZoomOutOnMaxScale &&\n this._zoomFactor === this.props.maxZoom) ||\n (this.props.doubleTapToggleZoom && this._zoomFactor > 1);\n this.props.onDoubleTap();\n this._ignoreNextClick = true;\n var zoomFactor = this._zoomFactor + this.props.tapZoomFactor;\n var startZoomFactor = this._zoomFactor;\n var updateProgress = function (progress) {\n _this._scaleTo(startZoomFactor + progress * (zoomFactor - startZoomFactor), center);\n };\n var center = this._getOffsetByFirstTouch(event);\n this._isDoubleTap = true;\n if (startZoomFactor > zoomFactor) {\n center = this._getCurrentZoomCenter();\n }\n needZoomOut ? this._zoomOutAnimation() : this._animate(updateProgress);\n };\n PinchZoom.prototype._computeInitialOffset = function () {\n var rect = this._getContainerRect();\n var _a = this._getChildSize(), width = _a.width, height = _a.height;\n var x = -abs(width * this._getInitialZoomFactor() - rect.width) / 2;\n var y = -abs(height * this._getInitialZoomFactor() - rect.height) / 2;\n this._initialOffset = { x: x, y: y };\n };\n PinchZoom.prototype._resetOffset = function () {\n this._offset = __assign({}, this._initialOffset);\n };\n PinchZoom.prototype._setupOffsets = function () {\n if (this.props.setOffsetsOnce && this._isOffsetsSet) {\n return;\n }\n this._isOffsetsSet = true;\n this._computeInitialOffset();\n this._resetOffset();\n };\n PinchZoom.prototype._sanitizeOffset = function (offset) {\n var rect = this._getContainerRect();\n var _a = this._getChildSize(), width = _a.width, height = _a.height;\n var elWidth = width * this._getInitialZoomFactor() * this._zoomFactor;\n var elHeight = height * this._getInitialZoomFactor() * this._zoomFactor;\n var _b = getOffsetBounds({\n containerDimension: rect.width,\n childDimension: elWidth,\n padding: this.props.horizontalPadding,\n centerContained: this.props.centerContained,\n }), minOffsetX = _b[0], maxOffsetX = _b[1];\n var _c = getOffsetBounds({\n containerDimension: rect.height,\n childDimension: elHeight,\n padding: this.props.verticalPadding,\n centerContained: this.props.centerContained,\n }), minOffsetY = _c[0], maxOffsetY = _c[1];\n return {\n x: clamp(minOffsetX, maxOffsetX, offset.x),\n y: clamp(minOffsetY, maxOffsetY, offset.y),\n };\n };\n PinchZoom.prototype.alignCenter = function (options) {\n var _this = this;\n var _a = __assign({ duration: 250, animated: true }, options), __x = _a.x, __y = _a.y, scale = _a.scale, animated = _a.animated, duration = _a.duration;\n // Bug-Fix: https://github.com/retyui/react-quick-pinch-zoom/issues/58\n var x = __x * this._initialZoomFactor;\n var y = __y * this._initialZoomFactor;\n var startZoomFactor = this._zoomFactor;\n var startOffset = __assign({}, this._offset);\n var rect = this._getContainerRect();\n var containerCenter = { x: rect.width / 2, y: rect.height / 2 };\n this._zoomFactor = 1;\n this._offset = { x: -(containerCenter.x - x), y: -(containerCenter.y - y) };\n this._scaleTo(scale, containerCenter);\n this._stopAnimation();\n if (!animated) {\n return this._update();\n }\n var diffZoomFactor = this._zoomFactor - startZoomFactor;\n var diffOffset = {\n x: this._offset.x - startOffset.x,\n y: this._offset.y - startOffset.y,\n };\n this._zoomFactor = startZoomFactor;\n this._offset = __assign({}, startOffset);\n var updateFrame = function (progress) {\n var x = startOffset.x + diffOffset.x * progress;\n var y = startOffset.y + diffOffset.y * progress;\n _this._zoomFactor = startZoomFactor + diffZoomFactor * progress;\n _this._offset = _this._sanitizeOffset({ x: x, y: y });\n _this._update();\n };\n this._animate(updateFrame, {\n callback: function () { return _this._sanitize(); },\n duration: duration,\n });\n };\n PinchZoom.prototype.scaleTo = function (options) {\n var _this = this;\n var _a = __assign({ duration: 250, animated: true }, options), x = _a.x, y = _a.y, scale = _a.scale, animated = _a.animated, duration = _a.duration;\n var startZoomFactor = this._zoomFactor;\n var startOffset = __assign({}, this._offset);\n this._zoomFactor = 1;\n this._offset = { x: 0, y: 0 };\n this._scaleTo(scale, { x: x, y: y });\n this._stopAnimation();\n if (!animated) {\n return this._update();\n }\n var diffZoomFactor = this._zoomFactor - startZoomFactor;\n var diffOffset = {\n x: this._offset.x - startOffset.x,\n y: this._offset.y - startOffset.y,\n };\n this._zoomFactor = startZoomFactor;\n this._offset = __assign({}, startOffset);\n var updateFrame = function (progress) {\n var x = startOffset.x + diffOffset.x * progress;\n var y = startOffset.y + diffOffset.y * progress;\n _this._zoomFactor = startZoomFactor + diffZoomFactor * progress;\n _this._offset = { x: x, y: y };\n _this._update();\n };\n this._animate(updateFrame, { callback: function () { return _this._sanitize(); }, duration: duration });\n };\n PinchZoom.prototype._scaleTo = function (zoomFactor, center) {\n this._scale(zoomFactor / this._zoomFactor, center);\n this._offset = this._sanitizeOffset(this._offset);\n };\n PinchZoom.prototype._scale = function (scale, center) {\n scale = this._scaleZoomFactor(scale);\n this._addOffset({\n x: (scale - 1) * (center.x + this._offset.x),\n y: (scale - 1) * (center.y + this._offset.y),\n });\n this.props.onZoomUpdate();\n };\n PinchZoom.prototype._scaleZoomFactor = function (scale) {\n var originalZoomFactor = this._zoomFactor;\n this._zoomFactor *= scale;\n this._zoomFactor = clamp(this.props.minZoom, this.props.maxZoom, this._zoomFactor);\n return this._zoomFactor / originalZoomFactor;\n };\n PinchZoom.prototype._canDrag = function () {\n return this.props.draggableUnZoomed || !isCloseTo(this._zoomFactor, 1);\n };\n PinchZoom.prototype._drag = function (center, lastCenter) {\n if (lastCenter) {\n var y = -(center.y - lastCenter.y);\n var x = -(center.x - lastCenter.x);\n if (!this.props.lockDragAxis) {\n this._addOffset({\n x: x,\n y: y,\n });\n }\n else {\n // lock scroll to position that was changed the most\n if (abs(x) > abs(y)) {\n this._addOffset({\n x: x,\n y: 0,\n });\n }\n else {\n this._addOffset({\n y: y,\n x: 0,\n });\n }\n }\n this.props.onDragUpdate();\n }\n };\n PinchZoom.prototype._virtualDrag = function (center, lastCenter) {\n if (lastCenter) {\n var y = -(center.y - lastCenter.y);\n var x = -(center.x - lastCenter.x);\n this._draggingPoint = {\n x: x + this._draggingPoint.x,\n y: y + this._draggingPoint.y,\n };\n }\n };\n PinchZoom.prototype._addOffset = function (offset) {\n var _a = this._offset, x = _a.x, y = _a.y;\n this._offset = {\n x: x + offset.x,\n y: y + offset.y,\n };\n };\n PinchZoom.prototype._sanitize = function () {\n if (this._zoomFactor < this.props.zoomOutFactor) {\n this._resetInertia();\n this._zoomOutAnimation();\n }\n else if (this._isInsaneOffset()) {\n this._sanitizeOffsetAnimation();\n }\n };\n PinchZoom.prototype._isInsaneOffset = function () {\n var offset = this._offset;\n var sanitizedOffset = this._sanitizeOffset(offset);\n return sanitizedOffset.x !== offset.x || sanitizedOffset.y !== offset.y;\n };\n PinchZoom.prototype._sanitizeOffsetAnimation = function () {\n var _this = this;\n var targetOffset = this._sanitizeOffset(this._offset);\n var startOffset = __assign({}, this._offset);\n var updateProgress = function (progress) {\n var x = startOffset.x + progress * (targetOffset.x - startOffset.x);\n var y = startOffset.y + progress * (targetOffset.y - startOffset.y);\n _this._offset = { x: x, y: y };\n _this._update();\n };\n this._animate(updateProgress);\n };\n PinchZoom.prototype._zoomOutAnimation = function () {\n var _this = this;\n if (this._zoomFactor === 1) {\n return;\n }\n var startZoomFactor = this._zoomFactor;\n var zoomFactor = 1;\n var center = this._getCurrentZoomCenter();\n var updateProgress = function (progress) {\n var scaleFactor = startZoomFactor + progress * (zoomFactor - startZoomFactor);\n _this._scaleTo(scaleFactor, center);\n };\n this._animate(updateProgress);\n };\n PinchZoom.prototype._getInitialZoomFactor = function () {\n return this._initialZoomFactor;\n };\n PinchZoom.prototype._getCurrentZoomCenter = function () {\n var _a = this._offset, x = _a.x, y = _a.y;\n var offsetLeft = x - this._initialOffset.x;\n var offsetTop = y - this._initialOffset.y;\n return {\n x: -1 * x - offsetLeft / (1 / this._zoomFactor - 1),\n y: -1 * y - offsetTop / (1 / this._zoomFactor - 1),\n };\n };\n PinchZoom.prototype._getOffsetByFirstTouch = function (event) {\n return this._getOffsetTouches(event)[0];\n };\n PinchZoom.prototype._getOffsetTouches = function (event) {\n var _document = this.props._document;\n var _html = _document.documentElement;\n var _body = _document.body;\n var _a = this._getContainerRect(), top = _a.top, left = _a.left;\n var scrollTop = _html.scrollTop || _body.scrollTop;\n var scrollLeft = _html.scrollLeft || _body.scrollLeft;\n var posTop = top + scrollTop;\n var posLeft = left + scrollLeft;\n return getPageCoordinatesByTouches(event.touches).map(function (_a) {\n var x = _a.x, y = _a.y;\n return ({\n x: x - posLeft,\n y: y - posTop,\n });\n });\n };\n PinchZoom.prototype._animate = function (frameFn, options) {\n var _this = this;\n var startTime = new Date().getTime();\n var _a = __assign({ timeFn: swing, callback: function () { }, duration: this.props.animationDuration }, options), timeFn = _a.timeFn, callback = _a.callback, duration = _a.duration;\n var renderFrame = function () {\n if (!_this._inAnimation) {\n return;\n }\n var frameTime = new Date().getTime() - startTime;\n var progress = frameTime / duration;\n if (frameTime >= duration) {\n frameFn(1);\n _this._stopAnimation();\n callback();\n _this._update();\n }\n else {\n progress = timeFn(progress);\n frameFn(progress);\n _this._update({ isAnimation: true });\n requestAnimationFrame(renderFrame);\n }\n };\n this._inAnimation = true;\n requestAnimationFrame(renderFrame);\n };\n PinchZoom.prototype._stopAnimation = function () {\n this._inAnimation = false;\n };\n PinchZoom.prototype._end = function () {\n this._hasInteraction = false;\n this._sanitize();\n this._update();\n };\n PinchZoom.prototype._getContainerRect = function () {\n var div = this._containerRef.current;\n return div.getBoundingClientRect();\n };\n PinchZoom.prototype._getChildSize = function () {\n var div = this._containerRef.current;\n return getElementSize(div === null || div === void 0 ? void 0 : div.firstElementChild);\n };\n PinchZoom.prototype._updateInitialZoomFactor = function () {\n var rect = this._getContainerRect();\n var size = this._getChildSize();\n var xZoomFactor = rect.width / size.width;\n var yZoomFactor = rect.height / size.height;\n this._initialZoomFactor = min(xZoomFactor, yZoomFactor);\n };\n PinchZoom.prototype._bindEvents = function () {\n var _this = this;\n var div = this._containerRef.current;\n if (window.ResizeObserver) {\n this._containerObserver = new ResizeObserver(this._onResize);\n this._containerObserver.observe(div);\n }\n else {\n window.addEventListener('resize', this._onResize);\n }\n this._handlers.forEach(function (_a) {\n var eventName = _a[0], fn = _a[1], target = _a[2];\n (target || div).addEventListener(eventName, fn, true);\n });\n Array.from(div.querySelectorAll('img')).forEach(function (img) {\n return img.addEventListener('load', _this._onResize);\n });\n };\n PinchZoom.prototype._unSubscribe = function () {\n var _this = this;\n var div = this._containerRef.current;\n if (this._containerObserver) {\n this._containerObserver.disconnect();\n this._containerObserver = null;\n }\n window.removeEventListener('resize', this._onResize);\n this._handlers.forEach(function (_a) {\n var eventName = _a[0], fn = _a[1], target = _a[2];\n (target || div).removeEventListener(eventName, fn, true);\n });\n Array.from(div.querySelectorAll('img')).forEach(function (img) {\n return img.removeEventListener('load', _this._onResize);\n });\n };\n PinchZoom.prototype._update = function (options) {\n var _this = this;\n if (this._updatePlaned) {\n return;\n }\n var updateFrame = function () {\n var scale = _this._getInitialZoomFactor() * _this._zoomFactor;\n var x = -_this._offset.x / scale;\n var y = -_this._offset.y / scale;\n _this.props.onUpdate({ scale: scale, x: x, y: y });\n };\n if (options === null || options === void 0 ? void 0 : options.isAnimation) {\n return updateFrame();\n }\n this._updatePlaned = true;\n requestAnimationFrame(function () {\n _this._updatePlaned = false;\n updateFrame();\n });\n };\n PinchZoom.prototype._handlerIfEnable = function (fn) {\n var _this = this;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (_this.props.enabled) {\n fn.apply(void 0, args);\n }\n };\n };\n PinchZoom.prototype._setInteraction = function (newInteraction, event) {\n var interaction = this._interaction;\n if (interaction !== newInteraction) {\n if (interaction && !newInteraction) {\n if (isZoomInteraction(interaction)) {\n this._handleZoomEnd();\n }\n else if (isDragInteraction(interaction)) {\n this._handleDragEnd();\n }\n }\n if (isZoomInteraction(newInteraction)) {\n this._handleZoomStart();\n }\n else if (isDragInteraction(newInteraction)) {\n this._handleDragStart(event);\n }\n }\n this._interaction = newInteraction;\n };\n PinchZoom.prototype._distanceBetweenNumbers = function (a, b) {\n return a > b ? a - b : b - a;\n };\n PinchZoom.prototype._enoughToDrag = function () {\n if (this._distanceBetweenNumbers(this._startOffset.x, this._draggingPoint.x) >\n 5 ||\n this._distanceBetweenNumbers(this._startOffset.y, this._draggingPoint.y) >\n 5)\n return true;\n return false;\n };\n PinchZoom.prototype._updateInteraction = function (event) {\n var fingers = this._fingers;\n if (fingers === 2) {\n return this._setInteraction('zoom', event);\n }\n if (fingers === 1 && this._canDrag()) {\n return this._setInteraction('drag', event);\n }\n this._setInteraction(null, event);\n };\n PinchZoom.prototype._detectDoubleTap = function (event) {\n var time = new Date().getTime();\n if (this._fingers > 1) {\n this._lastTouchStart = 0;\n }\n if (time - this._lastTouchStart < 300) {\n cancelEvent(event);\n this._handleDoubleTap(event);\n if (isZoomInteraction(this._interaction)) {\n this._handleZoomEnd();\n }\n else if (isDragInteraction(this._interaction)) {\n this._handleDragEnd();\n }\n }\n else {\n this._isDoubleTap = false;\n }\n if (this._fingers === 1) {\n this._lastTouchStart = time;\n }\n };\n PinchZoom.prototype.simulate = function (fn) {\n var _this = this;\n return function (mouseEvent) {\n var pageX = mouseEvent.pageX, pageY = mouseEvent.pageY, type = mouseEvent.type;\n var isEnd = type === 'mouseup';\n var isStart = type === 'mousedown';\n if (isStart) {\n mouseEvent.preventDefault();\n _this._listenMouseMove = true;\n }\n if (_this._listenMouseMove) {\n // @ts-ignore\n mouseEvent.touches = isEnd ? [] : [{ pageX: pageX, pageY: pageY }];\n fn(\n // @ts-ignore\n mouseEvent);\n }\n if (isEnd) {\n _this._listenMouseMove = false;\n }\n };\n };\n PinchZoom.prototype.componentDidMount = function () {\n this._bindEvents();\n this._update();\n };\n PinchZoom.prototype.componentWillUnmount = function () {\n this._stopAnimation();\n this._unSubscribe();\n };\n PinchZoom.prototype.render = function () {\n var _a = this.props, children = _a.children, containerProps = _a.containerProps;\n var child = Children.only(children);\n var props = containerProps || {};\n return (React.createElement(React.Fragment, null,\n React.createElement(\"style\", null, styles),\n React.createElement(\"div\", __assign({}, props, { ref: this._containerRef, className: classnames(styleRoot, props.className) }), cloneElement(child, {\n className: classnames(styleChild, child.props.className),\n }))));\n };\n PinchZoom.defaultProps = {\n animationDuration: 250,\n draggableUnZoomed: true,\n enforceBoundsDuringZoom: false,\n centerContained: false,\n enabled: true,\n inertia: true,\n inertiaFriction: 0.96,\n horizontalPadding: 0,\n isTouch: isTouch,\n lockDragAxis: false,\n maxZoom: 5,\n minZoom: 0.5,\n onDoubleTap: noup,\n onDragEnd: noup,\n onDragStart: noup,\n onDragUpdate: noup,\n onZoomEnd: noup,\n onZoomStart: noup,\n onZoomUpdate: noup,\n setOffsetsOnce: false,\n shouldInterceptWheel: shouldInterceptWheel,\n shouldCancelHandledTouchEndEvents: false,\n tapZoomFactor: 1,\n verticalPadding: 0,\n wheelScaleFactor: 1500,\n zoomOutFactor: 1.3,\n doubleTapZoomOutOnMaxScale: false,\n doubleTapToggleZoom: false,\n // @ts-expect-error\n _document: isSsr ? null : window.document,\n };\n return PinchZoom;\n}(Component));\nif (process.env.NODE_ENV !== 'production') {\n var _a = require('prop-types'), any = _a.any, element = _a.element, object = _a.object, number = _a.number, func = _a.func, bool = _a.bool;\n // @ts-ignore\n PinchZoom.propTypes = {\n children: element,\n containerProps: object,\n wheelScaleFactor: number,\n animationDuration: number,\n draggableUnZoomed: bool,\n enforceBoundsDuringZoom: bool,\n centerContained: bool,\n enabled: bool,\n horizontalPadding: number,\n lockDragAxis: bool,\n onUpdate: func.isRequired,\n maxZoom: number,\n minZoom: number,\n onDoubleTap: func,\n onDragEnd: func,\n onDragStart: func,\n onDragUpdate: func,\n onZoomEnd: func,\n onZoomStart: func,\n onZoomUpdate: func,\n setOffsetsOnce: bool,\n tapZoomFactor: number,\n verticalPadding: number,\n zoomOutFactor: number,\n doubleTapZoomOutOnMaxScale: bool,\n doubleTapToggleZoom: bool,\n isTouch: func,\n _document: any,\n };\n}\nexport default PinchZoom;\n","export default function formatDuration(time) {\n if (!time) return;\n let hours = Math.floor(time / 3600);\n let minutes = Math.floor((time % 3600) / 60);\n let seconds = Math.round(time % 60);\n\n if (hours === 0) {\n return `${minutes}:${seconds.toString().padStart(2, '0')}`;\n } else {\n return `${hours}:${minutes.toString().padStart(2, '0')}:${seconds\n .toString()\n .padStart(2, '0')}`;\n }\n}\n","import { Trans, useLingui } from '@lingui/react/macro';\nimport { getBlurHashAverageColor } from 'fast-blurhash';\nimport { Fragment } from 'preact';\nimport { memo } from 'preact/compat';\nimport {\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport QuickPinchZoom, { make3dTransformValue } from 'react-quick-pinch-zoom';\n\nimport formatDuration from '../utils/format-duration';\nimport mem from '../utils/mem';\nimport states from '../utils/states';\n\nimport Icon from './icon';\nimport Link from './link';\n\nconst isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); // https://stackoverflow.com/a/23522755\n\n/*\nMedia type\n===\nunknown = unsupported or unrecognized file type\nimage = Static image\ngifv = Looping, soundless animation\nvideo = Video clip\naudio = Audio track\n*/\n\nconst dataAltLabel = 'ALT';\nconst AltBadge = (props) => {\n const { t } = useLingui();\n const { alt, lang, index, ...rest } = props;\n if (!alt || !alt.trim()) return null;\n return (\n {\n e.stopPropagation();\n e.preventDefault();\n states.showMediaAlt = {\n alt,\n lang,\n };\n }}\n title={t`Media description`}\n >\n {dataAltLabel}\n {!!index && {index}}\n \n );\n};\n\nconst MEDIA_CAPTION_LIMIT = 140;\nconst MEDIA_CAPTION_LIMIT_LONGER = 280;\nexport const isMediaCaptionLong = mem((caption) =>\n caption?.length\n ? caption.length > MEDIA_CAPTION_LIMIT ||\n /[\\n\\r].*[\\n\\r]/.test(caption.trim())\n : false,\n);\n\nfunction Media({\n class: className = '',\n media,\n to,\n lang,\n showOriginal,\n autoAnimate,\n showCaption,\n allowLongerCaption,\n altIndex,\n checkAspectRatio = true,\n onClick,\n}) {\n let {\n id,\n blurhash,\n description,\n meta,\n previewRemoteUrl,\n previewUrl,\n remoteUrl,\n url,\n type,\n } = media;\n if (/no\\-preview\\./i.test(previewUrl)) {\n previewUrl = null;\n }\n const mediaVTN = getSafeViewTransitionName(id || blurhash || url);\n const { original = {}, small, focus } = meta || {};\n\n const width = showOriginal\n ? original?.width\n : small?.width || original?.width;\n const height = showOriginal\n ? original?.height\n : small?.height || original?.height;\n const mediaURL = showOriginal ? url : previewUrl || url;\n const remoteMediaURL = showOriginal\n ? remoteUrl\n : previewRemoteUrl || remoteUrl;\n const hasPreviewDimensions = small?.width && small?.height;\n const hasDimensions = width && height;\n const orientation = hasDimensions\n ? width > height\n ? 'landscape'\n : 'portrait'\n : null;\n\n const rgbAverageColor = blurhash ? getBlurHashAverageColor(blurhash) : null;\n\n const videoRef = useRef();\n\n let focalPosition;\n if (focus) {\n // Convert focal point to CSS background position\n // Formula from jquery-focuspoint\n // x = -1, y = 1 => 0% 0%\n // x = 0, y = 0 => 50% 50%\n // x = 1, y = -1 => 100% 100%\n const x = ((focus.x + 1) / 2) * 100;\n const y = ((1 - focus.y) / 2) * 100;\n focalPosition = `${x.toFixed(0)}% ${y.toFixed(0)}%`;\n }\n\n const mediaRef = useRef();\n const onUpdate = useCallback(({ x, y, scale }) => {\n const { current: media } = mediaRef;\n\n if (media) {\n const value = make3dTransformValue({ x, y, scale });\n\n if (scale === 1) {\n media.style.removeProperty('transform');\n } else {\n media.style.setProperty('transform', value);\n }\n\n media.closest('.media-zoom').style.touchAction =\n scale <= 1.01 ? 'pan-x' : '';\n }\n }, []);\n\n const [pinchZoomEnabled, setPinchZoomEnabled] = useState(false);\n const quickPinchZoomProps = {\n enabled: pinchZoomEnabled,\n draggableUnZoomed: false,\n inertiaFriction: 0.9,\n tapZoomFactor: 2,\n doubleTapToggleZoom: true,\n containerProps: {\n className: 'media-zoom',\n style: {\n overflow: 'visible',\n // width: 'inherit',\n // height: 'inherit',\n // justifyContent: 'inherit',\n // alignItems: 'inherit',\n // display: 'inherit',\n },\n },\n onUpdate,\n };\n\n const [mediaLoadError, setMediaLoadError] = useState(false);\n\n const Parent = useMemo(\n () =>\n to && !mediaLoadError ? (props) => : 'div',\n [to, mediaLoadError],\n );\n\n const remoteMediaURLObj = remoteMediaURL ? getURLObj(remoteMediaURL) : null;\n const isVideoMaybe =\n type === 'unknown' &&\n remoteMediaURLObj &&\n /\\.(mp4|m4r|m4v|mov|webm)$/i.test(remoteMediaURLObj.pathname);\n const isAudioMaybe =\n type === 'unknown' &&\n remoteMediaURLObj &&\n /\\.(mp3|ogg|wav|m4a|m4p|m4b)$/i.test(remoteMediaURLObj.pathname);\n const isImage =\n type === 'image' ||\n (type === 'unknown' && previewUrl && !isVideoMaybe && !isAudioMaybe);\n const isPreviewVideoMaybe =\n previewUrl &&\n /\\.(mp4|m4r|m4v|mov|webm)$/i.test(getURLObj(previewUrl).pathname);\n\n const parentRef = useRef();\n const [imageSmallerThanParent, setImageSmallerThanParent] = useState(false);\n useLayoutEffect(() => {\n if (!isImage) return;\n if (!showOriginal) return;\n if (!parentRef.current) return;\n const { offsetWidth, offsetHeight } = parentRef.current;\n const smaller = width < offsetWidth && height < offsetHeight;\n if (smaller) setImageSmallerThanParent(smaller);\n }, [width, height]);\n\n const maxAspectHeight =\n window.innerHeight * (orientation === 'portrait' ? 0.45 : 0.33);\n const maxHeight = orientation === 'portrait' ? 0 : 160;\n const averageColorStyle = {\n '--average-color': rgbAverageColor && `rgb(${rgbAverageColor.join(',')})`,\n };\n const mediaStyles =\n width && height\n ? {\n '--width': `${width}px`,\n '--height': `${height}px`,\n // Calculate '--aspectWidth' based on aspect ratio calculated from '--width' and '--height', max height has to be 160px\n '--aspectWidth': `${\n (width / height) * Math.max(maxHeight, maxAspectHeight)\n }px`,\n aspectRatio: `${width} / ${height}`,\n ...averageColorStyle,\n }\n : {\n ...averageColorStyle,\n };\n\n const longDesc = isMediaCaptionLong(description);\n let showInlineDesc =\n !!showCaption && !showOriginal && !!description && !longDesc;\n if (\n allowLongerCaption &&\n !showInlineDesc &&\n description?.length <= MEDIA_CAPTION_LIMIT_LONGER\n ) {\n showInlineDesc = true;\n }\n const Figure = !showInlineDesc\n ? Fragment\n : (props) => {\n const { children, ...restProps } = props;\n return (\n
\n {children}\n {\n e.preventDefault();\n e.stopPropagation();\n states.showMediaAlt = {\n alt: description,\n lang,\n };\n }}\n >\n {description}\n \n
\n );\n };\n\n const [hasNaturalAspectRatio, setHasNaturalAspectRatio] = useState(undefined);\n\n const postViewState = () =>\n window.matchMedia('(min-width: calc(40em + 350px))').matches\n ? 'large'\n : 'small';\n const interceptOnClick = useCallback(\n (e) => {\n const isOnPostPage = e.target.closest('.status-deck');\n if (\n showOriginal ||\n (postViewState() === 'large' && isOnPostPage) ||\n !document.startViewTransition\n ) {\n onClick?.(e);\n return;\n }\n const el =\n e.target.closest('[data-view-transition-name]') ||\n e.target.querySelector('[data-view-transition-name]');\n if (el) {\n // BUG: both link and onClick is triggered at the same time\n // Temporarily disable view transition if has onClick\n // Detecting preventDefault for an onClick has to happen before view transition but it's only possible after click, and this mean the link is already clicked even before we know it's default prevented.\n if (onClick) {\n onClick(e);\n } else {\n e.preventDefault();\n el.style.viewTransitionName = mediaVTN;\n document.startViewTransition(() => {\n el.style.viewTransitionName = '';\n location.hash = `#${to}`;\n });\n }\n } else {\n onClick?.(e);\n }\n },\n [mediaVTN, showOriginal, onClick],\n );\n\n if (isImage) {\n // Note: type: unknown might not have width/height\n quickPinchZoomProps.containerProps.style.display = 'inherit';\n\n useLayoutEffect(() => {\n if (!isSafari) return;\n if (!showOriginal) return;\n (async () => {\n try {\n await fetch(mediaURL, { mode: 'no-cors' });\n mediaRef.current.src = mediaURL;\n } catch (e) {\n // Ignore\n }\n })();\n }, [mediaURL]);\n\n return (\n
\n \n {showOriginal ? (\n \n {\n const el = e.target;\n const mediaImage = el.closest('.media-image');\n if (mediaImage) {\n mediaImage.style.backgroundImage = `url(${el.src})`;\n mediaImage.style.removeProperty('--bg-image');\n }\n el.closest('.media-zoom').style.display = '';\n setPinchZoomEnabled(true);\n }}\n onError={(e) => {\n const { src } = e.target;\n if (\n src === mediaURL &&\n remoteMediaURL &&\n mediaURL !== remoteMediaURL\n ) {\n e.target.src = remoteMediaURL;\n }\n }}\n />\n \n ) : (\n <>\n {\n // e.target.closest('.media-image').style.backgroundImage = '';\n e.target.dataset.loaded = true;\n const $media = e.target.closest('.media');\n if (!hasPreviewDimensions && $media) {\n const { naturalWidth, naturalHeight } = e.target;\n $media.dataset.orientation =\n naturalWidth > naturalHeight ? 'landscape' : 'portrait';\n $media.style.setProperty('--width', `${naturalWidth}px`);\n $media.style.setProperty('--height', `${naturalHeight}px`);\n $media.style.aspectRatio = `${naturalWidth}/${naturalHeight}`;\n }\n\n // Check natural aspect ratio vs display aspect ratio\n if (checkAspectRatio && $media) {\n const {\n clientWidth,\n clientHeight,\n naturalWidth,\n naturalHeight,\n } = e.target;\n if (\n clientWidth &&\n clientHeight &&\n naturalWidth &&\n naturalHeight\n ) {\n const minDimension = 88;\n if (\n naturalWidth < minDimension ||\n naturalHeight < minDimension\n ) {\n $media.dataset.hasSmallDimension = true;\n } else {\n const displayNaturalHeight =\n (naturalHeight * clientWidth) / naturalWidth;\n const almostSimilarHeight =\n Math.abs(displayNaturalHeight - clientHeight) < 5;\n\n if (almostSimilarHeight) {\n setHasNaturalAspectRatio(true);\n }\n }\n }\n }\n }}\n onError={(e) => {\n const { src } = e.target;\n if (src === mediaURL && mediaURL !== remoteMediaURL) {\n e.target.src = remoteMediaURL;\n } else {\n setMediaLoadError(true);\n }\n }}\n />\n {!showInlineDesc && (\n \n )}\n \n )}\n \n {mediaLoadError && (\n \n )}\n
\n );\n } else if (type === 'gifv' || type === 'video' || isVideoMaybe) {\n const hasDuration = original.duration > 0;\n const shortDuration = original.duration < 31;\n const isGIF = type === 'gifv' && shortDuration;\n // If GIF is too long, treat it as a video\n const loopable = original.duration < 61;\n const formattedDuration = formatDuration(original.duration);\n const hoverAnimate = !showOriginal && !autoAnimate && isGIF;\n const autoGIFAnimate = !showOriginal && autoAnimate && isGIF;\n const showProgress = original.duration > 5;\n\n // This string is only for autoplay + muted to work on Mobile Safari\n const gifHTML = `\n \n `;\n\n const videoHTML = `\n \n `;\n\n return (\n
\n {\n if (hoverAnimate) {\n try {\n videoRef.current.pause();\n } catch (e) {}\n }\n interceptOnClick(e);\n }}\n onMouseEnter={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.play();\n } catch (e) {}\n }\n }}\n onMouseLeave={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.pause();\n } catch (e) {}\n }\n }}\n onFocus={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.play();\n } catch (e) {}\n }\n }}\n onBlur={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.pause();\n } catch (e) {}\n }\n }}\n >\n {showOriginal || autoGIFAnimate ? (\n isGIF && showOriginal ? (\n \n \n \n ) : isGIF ? (\n \n ) : (\n \n )\n ) : isGIF ? (\n {\n const { target } = e;\n const container = target?.closest('.media-gif');\n if (container) {\n const percentage =\n (target.currentTime / target.duration) * 100;\n container.style.setProperty(\n '--progress',\n `${percentage}%`,\n );\n }\n }\n : undefined\n }\n />\n ) : (\n <>\n {previewUrl && !isPreviewVideoMaybe ? (\n {\n if (!hasPreviewDimensions) {\n const $media = e.target.closest('.media');\n if ($media) {\n const { naturalHeight, naturalWidth } = e.target;\n $media.dataset.orientation =\n naturalWidth > naturalHeight\n ? 'landscape'\n : 'portrait';\n $media.style.setProperty(\n '--width',\n `${naturalWidth}px`,\n );\n $media.style.setProperty(\n '--height',\n `${naturalHeight}px`,\n );\n $media.style.aspectRatio = `${naturalWidth}/${naturalHeight}`;\n }\n }\n }}\n />\n ) : (\n {\n if (!hasDuration) {\n const { duration } = e.target;\n if (duration) {\n const formattedDuration = formatDuration(duration);\n const container = e.target.closest('.media-video');\n if (container) {\n container.dataset.formattedDuration =\n formattedDuration;\n }\n }\n }\n }}\n />\n )}\n
\n \n
\n \n )}\n {!showOriginal && !showInlineDesc && (\n \n )}\n \n
\n );\n } else if (type === 'audio' || isAudioMaybe) {\n const formattedDuration = formatDuration(original.duration);\n return (\n
\n \n {showOriginal ? (\n
\n );\n }\n}\n\nfunction getURLObj(url) {\n // Fake base URL if url doesn't have https:// prefix\n return URL.parse(url, location.origin);\n}\n\nexport function getSafeViewTransitionName(inputString) {\n // Replace any character that is not a letter, number, hyphen, or underscore with a hyphen.\n let safeName = inputString.replace(/[^a-zA-Z0-9_-]/g, '-');\n\n // Ensure it starts with a letter, underscore, or two hyphens (to prevent starting with a number or single hyphen).\n // This covers edge cases where the original string might start with an invalid character after replacement.\n if (safeName.match(/^[0-9-]/)) {\n safeName = 'vt-' + safeName;\n }\n\n return safeName;\n}\n\nexport default memo(Media, (oldProps, newProps) => {\n const oldMedia = oldProps.media || {};\n const newMedia = newProps.media || {};\n\n return (\n oldMedia?.id === newMedia?.id &&\n oldMedia.url === newMedia.url &&\n oldProps.to === newProps.to &&\n oldProps.class === newProps.class\n );\n});\n","import './status.css';\nimport '@justinribeiro/lite-youtube';\n\nimport { msg, plural } from '@lingui/core/macro';\nimport { Trans, useLingui } from '@lingui/react/macro';\nimport {\n ControlledMenu,\n Menu,\n MenuDivider,\n MenuHeader,\n MenuItem,\n} from '@szhsin/react-menu';\nimport { decodeBlurHash, getBlurHashAverageColor } from 'fast-blurhash';\nimport { shallowEqual } from 'fast-equals';\nimport prettify from 'html-prettify';\nimport pThrottle from 'p-throttle';\nimport { Fragment } from 'preact';\nimport { forwardRef, memo } from 'preact/compat';\nimport {\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useHotkeys } from 'react-hotkeys-hook';\n// import { detectAll } from 'tinyld/light';\nimport { useLongPress } from 'use-long-press';\nimport { useSnapshot } from 'valtio';\n\nimport CustomEmoji from '../components/custom-emoji';\nimport EmojiText from '../components/emoji-text';\nimport LazyShazam from '../components/lazy-shazam';\nimport Loader from '../components/loader';\nimport MenuConfirm from '../components/menu-confirm';\nimport Menu2 from '../components/menu2';\nimport Modal from '../components/modal';\nimport NameText from '../components/name-text';\nimport Poll from '../components/poll';\nimport { api, getPreferences } from '../utils/api';\nimport { langDetector } from '../utils/browser-translator';\nimport emojifyText from '../utils/emojify-text';\nimport enhanceContent from '../utils/enhance-content';\nimport FilterContext from '../utils/filter-context';\nimport { isFiltered } from '../utils/filters';\nimport getDomain from '../utils/get-domain';\nimport getTranslateTargetLanguage from '../utils/get-translate-target-language';\nimport getHTMLText from '../utils/getHTMLText';\nimport handleContentLinks from '../utils/handle-content-links';\nimport htmlContentLength from '../utils/html-content-length';\nimport isRTL from '../utils/is-rtl';\nimport isMastodonLinkMaybe from '../utils/isMastodonLinkMaybe';\nimport localeMatch from '../utils/locale-match';\nimport mem from '../utils/mem';\nimport niceDateTime from '../utils/nice-date-time';\nimport openCompose from '../utils/open-compose';\nimport pmem from '../utils/pmem';\nimport safeBoundingBoxPadding from '../utils/safe-bounding-box-padding';\nimport shortenNumber from '../utils/shorten-number';\nimport showCompose from '../utils/show-compose';\nimport showToast from '../utils/show-toast';\nimport { speak, supportsTTS } from '../utils/speech';\nimport states, { getStatus, saveStatus, statusKey } from '../utils/states';\nimport statusPeek from '../utils/status-peek';\nimport store from '../utils/store';\nimport { getCurrentAccountID } from '../utils/store-utils';\nimport supports from '../utils/supports';\nimport unfurlMastodonLink from '../utils/unfurl-link';\nimport useTruncated from '../utils/useTruncated';\nimport visibilityIconsMap from '../utils/visibility-icons-map';\n\nimport Avatar from './avatar';\nimport Icon from './icon';\nimport Link from './link';\nimport Media, { isMediaCaptionLong } from './media';\nimport MenuLink from './menu-link';\nimport RelativeTime from './relative-time';\nimport TranslationBlock from './translation-block';\n\nconst SHOW_COMMENT_COUNT_LIMIT = 280;\nconst INLINE_TRANSLATE_LIMIT = 140;\n\nconst throttle = pThrottle({\n limit: 1,\n interval: 1000,\n});\nfunction fetchAccount(id, masto) {\n return masto.v1.accounts.$select(id).fetch();\n}\nconst memFetchAccount = pmem(throttle(fetchAccount));\n\nconst visibilityText = {\n public: msg`Public`,\n local: msg`Local`,\n unlisted: msg`Unlisted`,\n private: msg`Followers only`,\n direct: msg`Private mention`,\n};\n\nconst isIOS =\n window.ontouchstart !== undefined &&\n /iPad|iPhone|iPod/.test(navigator.userAgent);\n\nconst RTF = mem((locale) => new Intl.RelativeTimeFormat(locale || undefined));\n\nconst REACTIONS_LIMIT = 80;\n\nfunction getPollText(poll) {\n if (!poll?.options?.length) return '';\n return `📊:\\n${poll.options\n .map(\n (option) =>\n `- ${option.title}${\n option.votesCount >= 0 ? ` (${option.votesCount})` : ''\n }`,\n )\n .join('\\n')}`;\n}\nfunction getPostText(status, opts) {\n const { maskCustomEmojis, maskURLs } = opts || {};\n const { spoilerText, poll, emojis } = status;\n let { content } = status;\n if (maskCustomEmojis && emojis?.length) {\n const emojisRegex = new RegExp(\n `:(${emojis.map((e) => e.shortcode).join('|')}):`,\n 'g',\n );\n content = content.replace(emojisRegex, '⬚');\n }\n return (\n (spoilerText ? `${spoilerText}\\n\\n` : '') +\n getHTMLText(content, {\n preProcess:\n maskURLs &&\n ((dom) => {\n // Remove links that contains text that starts with https?://\n for (const a of dom.querySelectorAll('a')) {\n const text = a.innerText.trim();\n if (/^https?:\\/\\//i.test(text)) {\n a.replaceWith('«🔗»');\n }\n }\n }),\n }) +\n getPollText(poll)\n );\n}\n\nfunction forgivingQSA(selectors = [], dom = document) {\n // Run QSA for list of selectors\n // If a selector return invalid selector error, try the next one\n for (const selector of selectors) {\n try {\n return dom.querySelectorAll(selector);\n } catch (e) {}\n }\n return [];\n}\n\nfunction isTranslateble(content, emojis) {\n if (!content) return false;\n // Remove custom emojis\n if (emojis?.length) {\n const emojisRegex = new RegExp(\n `:(${emojis.map((e) => e.shortcode).join('|')}):`,\n 'g',\n );\n content = content.replace(emojisRegex, '');\n }\n content = content.trim();\n if (!content) return false;\n const text = getHTMLText(content, {\n preProcess: (dom) => {\n // Remove .mention, pre, code, a:has(.invisible)\n for (const a of forgivingQSA(\n ['.mention, pre, code, a:has(.invisible)', '.mention, pre, code'],\n dom,\n )) {\n a.remove();\n }\n },\n });\n return !!text;\n}\n\nfunction getHTMLTextForDetectLang(content, emojis) {\n if (emojis?.length) {\n const emojisRegex = new RegExp(\n `:(${emojis.map((e) => e.shortcode).join('|')}):`,\n 'g',\n );\n content = content.replace(emojisRegex, '');\n }\n\n return getHTMLText(content, {\n preProcess: (dom) => {\n // Remove anything that can skew the language detection\n\n // Remove .mention, .hashtag, pre, code, a:has(.invisible)\n for (const a of forgivingQSA(\n [\n '.mention, .hashtag, pre, code, a:has(.invisible)',\n '.mention, .hashtag, pre, code',\n ],\n dom,\n )) {\n a.remove();\n }\n\n // Remove links that contains text that starts with https?://\n for (const a of dom.querySelectorAll('a')) {\n const text = a.innerText.trim();\n if (text.startsWith('https://') || text.startsWith('http://')) {\n a.remove();\n }\n }\n },\n });\n}\n\nconst HTTP_REGEX = /^http/i;\nconst PostContent =\n /*memo(*/\n ({ post, instance, previewMode }) => {\n const { content, emojis, language, mentions, url } = post;\n\n const divRef = useRef();\n useLayoutEffect(() => {\n if (!divRef.current) return;\n const dom = enhanceContent(content, {\n emojis,\n returnDOM: true,\n });\n // Remove target=\"_blank\" from links\n for (const a of dom.querySelectorAll('a.u-url[target=\"_blank\"]')) {\n if (!HTTP_REGEX.test(a.innerText.trim())) {\n a.removeAttribute('target');\n }\n }\n divRef.current.replaceChildren(dom.cloneNode(true));\n }, [content, emojis?.length]);\n\n return (\n {\n // // Remove target=\"_blank\" from links\n // dom.querySelectorAll('a.u-url[target=\"_blank\"]').forEach((a) => {\n // if (!/http/i.test(a.innerText.trim())) {\n // a.removeAttribute('target');\n // }\n // });\n // },\n // }),\n // }}\n />\n );\n }; /*,\n (oldProps, newProps) => {\n const { post: oldPost } = oldProps;\n const { post: newPost } = newProps;\n return oldPost.content === newPost.content;\n },\n);*/\n\nconst SIZE_CLASS = {\n s: 'small',\n m: 'medium',\n l: 'large',\n};\n\nconst detectLang = pmem(async (text) => {\n text = text?.trim();\n\n // Ref: https://github.com/komodojp/tinyld/blob/develop/docs/benchmark.md\n // 500 should be enough for now, also the default max chars for Mastodon\n if (text?.length > 500) {\n return null;\n }\n\n if (langDetector) {\n const langs = await langDetector.detect(text);\n console.groupCollapsed(\n '💬 DETECTLANG BROWSER',\n langs.slice(0, 3).map((l) => l.detectedLanguage),\n );\n console.log(text, langs.slice(0, 3));\n console.groupEnd();\n const lang = langs[0];\n if (lang?.detectedLanguage && lang?.confidence > 0.5) {\n return lang.detectedLanguage;\n }\n }\n\n const { detectAll } = await import('tinyld/light');\n const langs = detectAll(text);\n console.groupCollapsed(\n '💬 DETECTLANG TINYLD',\n langs.slice(0, 3).map((l) => l.lang),\n );\n console.log(text, langs.slice(0, 3));\n console.groupEnd();\n const lang = langs[0];\n if (lang?.lang && lang?.accuracy > 0.5) {\n // If > 50% accurate, use it\n // It can be accurate if < 50% but better be safe\n // Though > 50% also can be inaccurate 🤷‍♂️\n return lang.lang;\n }\n return null;\n});\n\nconst readMoreText = msg`Read more →`;\n\n// All this work just to make sure this only lazy-run once\n// Because first run is slow due to intl-localematcher\nconst DIFFERENT_LANG_CHECK = {};\nconst checkDifferentLanguage = (\n language,\n contentTranslationHideLanguages = [],\n) => {\n if (!language) return false;\n const targetLanguage = getTranslateTargetLanguage(true);\n const different =\n language !== targetLanguage &&\n !localeMatch([language], [targetLanguage]) &&\n !contentTranslationHideLanguages.find(\n (l) => language === l || localeMatch([language], [l]),\n );\n if (different)\n DIFFERENT_LANG_CHECK[language + contentTranslationHideLanguages] = true;\n return different;\n};\n\nconst getCurrentAccID = mem(\n () => {\n return getCurrentAccountID();\n },\n {\n maxAge: 60 * 1000, // 1 minute\n },\n);\n\nfunction Status({\n statusID,\n status,\n instance: propInstance,\n size = 'm',\n contentTextWeight,\n readOnly,\n enableCommentHint,\n withinContext,\n skeleton,\n enableTranslate,\n forceTranslate: _forceTranslate,\n previewMode,\n allowFilters,\n onMediaClick,\n quoted,\n onStatusLinkClick = () => {},\n showFollowedTags,\n allowContextMenu,\n showActionsBar,\n showReplyParent,\n mediaFirst,\n}) {\n const { _, t, i18n } = useLingui();\n const rtf = RTF(i18n.locale);\n\n if (skeleton) {\n return (\n \n {!mediaFirst && }\n
\n
\n {(size === 's' || mediaFirst) && } ███ ████████\n
\n
\n {mediaFirst &&
}\n
\n

████ ████████

\n
\n
\n
\n
\n );\n }\n const { masto, instance, authenticated } = api({ instance: propInstance });\n const { instance: currentInstance } = api();\n const sameInstance = instance === currentInstance;\n\n let sKey = statusKey(statusID || status?.id, instance);\n const snapStates = useSnapshot(states);\n if (!status) {\n status = snapStates.statuses[sKey] || snapStates.statuses[statusID];\n sKey = statusKey(status?.id, instance);\n }\n if (!status) {\n return null;\n }\n\n const {\n account: {\n acct,\n avatar,\n avatarStatic,\n id: accountId,\n url: accountURL,\n displayName,\n username,\n emojis: accountEmojis,\n bot,\n group,\n } = {},\n id,\n repliesCount,\n reblogged,\n reblogsCount,\n favourited,\n favouritesCount,\n bookmarked,\n poll,\n muted,\n sensitive,\n spoilerText,\n visibility, // public, unlisted, private, direct\n language: _language,\n editedAt,\n filtered,\n card,\n createdAt,\n inReplyToId,\n inReplyToAccountId,\n content,\n mentions,\n mediaAttachments = [],\n reblog,\n uri,\n url,\n emojis,\n tags,\n pinned,\n // Non-API props\n _deleted,\n _pinned,\n // _filtered,\n // Non-Mastodon\n emojiReactions,\n } = status;\n\n const [languageAutoDetected, setLanguageAutoDetected] = useState(null);\n useEffect(() => {\n if (!content) return;\n if (_language) return;\n if (languageAutoDetected) return;\n let timer;\n timer = setTimeout(async () => {\n let detected = await detectLang(\n getHTMLTextForDetectLang(content, emojis),\n );\n setLanguageAutoDetected(detected);\n }, 1000);\n return () => clearTimeout(timer);\n }, [content, _language]);\n const language = _language || languageAutoDetected;\n\n // if (!mediaAttachments?.length) mediaFirst = false;\n const hasMediaAttachments = !!mediaAttachments?.length;\n if (mediaFirst && hasMediaAttachments) size = 's';\n\n const currentAccount = getCurrentAccID();\n const isSelf = useMemo(() => {\n return currentAccount && currentAccount === accountId;\n }, [accountId, currentAccount]);\n\n const filterContext = useContext(FilterContext);\n const filterInfo =\n !isSelf &&\n ((!readOnly && !previewMode) || allowFilters) &&\n isFiltered(filtered, filterContext);\n\n if (filterInfo?.action === 'hide') {\n return null;\n }\n\n console.debug('RENDER Status', id, status?.account?.displayName, quoted);\n\n const debugHover = (e) => {\n if (e.shiftKey) {\n console.log({\n ...status,\n });\n }\n };\n\n if (\n (allowFilters || size !== 'l') &&\n filterInfo &&\n filterInfo.action !== 'blur'\n ) {\n return (\n \n );\n }\n\n const createdAtDate = new Date(createdAt);\n const editedAtDate = new Date(editedAt);\n\n let inReplyToAccountRef = mentions?.find(\n (mention) => mention.id === inReplyToAccountId,\n );\n if (!inReplyToAccountRef && inReplyToAccountId === id) {\n inReplyToAccountRef = { url: accountURL, username, displayName };\n }\n const [inReplyToAccount, setInReplyToAccount] = useState(inReplyToAccountRef);\n if (!withinContext && !inReplyToAccount && inReplyToAccountId) {\n const account = states.accounts[inReplyToAccountId];\n if (account) {\n setInReplyToAccount(account);\n } else {\n memFetchAccount(inReplyToAccountId, masto)\n .then((account) => {\n setInReplyToAccount(account);\n states.accounts[account.id] = account;\n })\n .catch((e) => {});\n }\n }\n const mentionSelf =\n inReplyToAccountId === currentAccount ||\n mentions?.find((mention) => mention.id === currentAccount);\n\n const prefs = getPreferences();\n const readingExpandSpoilers = !!prefs['reading:expand:spoilers'];\n\n // default | show_all | hide_all\n // Ignore hide_all because it means hide *ALL* media including non-sensitive ones\n const readingExpandMedia =\n prefs['reading:expand:media']?.toLowerCase() || 'default';\n\n // FOR TESTING:\n // const readingExpandSpoilers = true;\n // const readingExpandMedia = 'show_all';\n const showSpoiler =\n previewMode || readingExpandSpoilers || !!snapStates.spoilers[id];\n const showSpoilerMedia =\n previewMode ||\n (readingExpandMedia === 'show_all' && filterInfo?.action !== 'blur') ||\n !!snapStates.spoilersMedia[id];\n\n if (reblog) {\n // If has statusID, means useItemID (cached in states)\n\n if (group) {\n return (\n \n
\n {' '}\n \n
\n \n \n );\n }\n\n return (\n \n
\n {' '}\n \n {' '}\n boosted\n \n
\n \n \n );\n }\n\n // Check followedTags\n const FollowedTagsParent = useCallback(\n ({ children }) => (\n \n
\n {' '}\n {snapStates.statusFollowedTags[sKey].slice(0, 3).map((tag) => (\n \n {tag}\n \n ))}\n
\n {children}\n \n ),\n [sKey, instance, snapStates.statusFollowedTags[sKey]],\n );\n const StatusParent =\n showFollowedTags && !!snapStates.statusFollowedTags[sKey]?.length\n ? FollowedTagsParent\n : Fragment;\n\n const isSizeLarge = size === 'l';\n\n const [forceTranslate, setForceTranslate] = useState(_forceTranslate);\n // const targetLanguage = getTranslateTargetLanguage(true);\n // const contentTranslationHideLanguages =\n // snapStates.settings.contentTranslationHideLanguages || [];\n const { contentTranslation, contentTranslationAutoInline } =\n snapStates.settings;\n if (!contentTranslation) enableTranslate = false;\n const inlineTranslate = useMemo(() => {\n if (\n !contentTranslation ||\n !contentTranslationAutoInline ||\n readOnly ||\n (withinContext && !isSizeLarge) ||\n previewMode ||\n spoilerText ||\n sensitive ||\n poll ||\n card /*||\n mediaAttachments?.length*/\n ) {\n return false;\n }\n const contentLength = htmlContentLength(content);\n return contentLength > 0 && contentLength <= INLINE_TRANSLATE_LIMIT;\n }, [\n contentTranslation,\n contentTranslationAutoInline,\n readOnly,\n withinContext,\n isSizeLarge,\n previewMode,\n spoilerText,\n sensitive,\n poll,\n card,\n mediaAttachments,\n content,\n ]);\n\n const [showEdited, setShowEdited] = useState(false);\n const [showEmbed, setShowEmbed] = useState(false);\n\n const spoilerContentRef = useTruncated();\n const contentRef = useTruncated();\n const mediaContainerRef = useTruncated();\n\n const statusRef = useRef(null);\n\n const unauthInteractionErrorMessage = t`Sorry, your current logged-in instance can't interact with this post from another instance.`;\n\n const textWeight = useCallback(\n () =>\n Math.max(\n Math.round(\n ((spoilerText?.length || 0) + htmlContentLength(content)) / 140,\n ) || 1,\n 1,\n ),\n [spoilerText, content],\n );\n\n const createdDateText = createdAt && niceDateTime(createdAtDate);\n const editedDateText = editedAt && niceDateTime(editedAtDate);\n\n // Can boost if:\n // - authenticated AND\n // - visibility != direct OR\n // - visibility = private AND isSelf\n let canBoost =\n authenticated && visibility !== 'direct' && visibility !== 'private';\n if (visibility === 'private' && isSelf) {\n canBoost = true;\n }\n\n const replyStatus = (e) => {\n if (!sameInstance || !authenticated) {\n return alert(unauthInteractionErrorMessage);\n }\n // syntheticEvent comes from MenuItem\n if (e?.shiftKey || e?.syntheticEvent?.shiftKey) {\n const newWin = openCompose({\n replyToStatus: status,\n });\n if (newWin) return;\n }\n showCompose({\n replyToStatus: status,\n });\n };\n\n // Check if media has no descriptions\n const mediaNoDesc = useMemo(() => {\n return mediaAttachments.some(\n (attachment) => !attachment.description?.trim?.(),\n );\n }, [mediaAttachments]);\n\n const statusMonthsAgo = useMemo(() => {\n return Math.floor(\n (new Date() - createdAtDate) / (1000 * 60 * 60 * 24 * 30),\n );\n }, [createdAtDate]);\n\n // const boostStatus = async () => {\n // if (!sameInstance || !authenticated) {\n // alert(unauthInteractionErrorMessage);\n // return false;\n // }\n // try {\n // if (!reblogged) {\n // let confirmText = 'Boost this post?';\n // if (mediaNoDesc) {\n // confirmText += '\\n\\n⚠️ Some media have no descriptions.';\n // }\n // const yes = confirm(confirmText);\n // if (!yes) {\n // return false;\n // }\n // }\n // // Optimistic\n // states.statuses[sKey] = {\n // ...status,\n // reblogged: !reblogged,\n // reblogsCount: reblogsCount + (reblogged ? -1 : 1),\n // };\n // if (reblogged) {\n // const newStatus = await masto.v1.statuses.$select(id).unreblog();\n // saveStatus(newStatus, instance);\n // return true;\n // } else {\n // const newStatus = await masto.v1.statuses.$select(id).reblog();\n // saveStatus(newStatus, instance);\n // return true;\n // }\n // } catch (e) {\n // console.error(e);\n // // Revert optimistism\n // states.statuses[sKey] = status;\n // return false;\n // }\n // };\n const confirmBoostStatus = async () => {\n if (!sameInstance || !authenticated) {\n alert(unauthInteractionErrorMessage);\n return false;\n }\n try {\n // Optimistic\n states.statuses[sKey] = {\n ...status,\n reblogged: !reblogged,\n reblogsCount: reblogsCount + (reblogged ? -1 : 1),\n };\n if (reblogged) {\n const newStatus = await masto.v1.statuses.$select(id).unreblog();\n saveStatus(newStatus, instance);\n } else {\n const newStatus = await masto.v1.statuses.$select(id).reblog();\n saveStatus(newStatus, instance);\n }\n return true;\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n return false;\n }\n };\n\n const favouriteStatus = async () => {\n if (!sameInstance || !authenticated) {\n alert(unauthInteractionErrorMessage);\n return false;\n }\n try {\n // Optimistic\n states.statuses[sKey] = {\n ...status,\n favourited: !favourited,\n favouritesCount: favouritesCount + (favourited ? -1 : 1),\n };\n if (favourited) {\n const newStatus = await masto.v1.statuses.$select(id).unfavourite();\n saveStatus(newStatus, instance);\n } else {\n const newStatus = await masto.v1.statuses.$select(id).favourite();\n saveStatus(newStatus, instance);\n }\n return true;\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n return false;\n }\n };\n const favouriteStatusNotify = async () => {\n try {\n const done = await favouriteStatus();\n if (!isSizeLarge && done) {\n showToast(\n favourited\n ? t`Unliked @${username || acct}'s post`\n : t`Liked @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n };\n\n const bookmarkStatus = async () => {\n if (!supports('@mastodon/post-bookmark')) return;\n if (!sameInstance || !authenticated) {\n alert(unauthInteractionErrorMessage);\n return false;\n }\n try {\n // Optimistic\n states.statuses[sKey] = {\n ...status,\n bookmarked: !bookmarked,\n };\n if (bookmarked) {\n const newStatus = await masto.v1.statuses.$select(id).unbookmark();\n saveStatus(newStatus, instance);\n } else {\n const newStatus = await masto.v1.statuses.$select(id).bookmark();\n saveStatus(newStatus, instance);\n }\n return true;\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n return false;\n }\n };\n const bookmarkStatusNotify = async () => {\n try {\n const done = await bookmarkStatus();\n if (!isSizeLarge && done) {\n showToast(\n bookmarked\n ? t`Unbookmarked @${username || acct}'s post`\n : t`Bookmarked @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n };\n\n // const differentLanguage =\n // !!language &&\n // language !== targetLanguage &&\n // !localeMatch([language], [targetLanguage]) &&\n // !contentTranslationHideLanguages.find(\n // (l) => language === l || localeMatch([language], [l]),\n // );\n const contentTranslationHideLanguages =\n snapStates.settings.contentTranslationHideLanguages || [];\n const [differentLanguage, setDifferentLanguage] = useState(\n () =>\n DIFFERENT_LANG_CHECK[language + contentTranslationHideLanguages] ||\n checkDifferentLanguage(language, contentTranslationHideLanguages),\n );\n useEffect(() => {\n if (!language || differentLanguage) {\n return;\n }\n if (\n !differentLanguage &&\n DIFFERENT_LANG_CHECK[language + contentTranslationHideLanguages]\n ) {\n setDifferentLanguage(true);\n return;\n }\n let timeout = setTimeout(() => {\n const different = checkDifferentLanguage(\n language,\n contentTranslationHideLanguages,\n );\n if (different) setDifferentLanguage(different);\n }, 1);\n return () => clearTimeout(timeout);\n }, [language, differentLanguage, contentTranslationHideLanguages]);\n\n const reblogIterator = useRef();\n const favouriteIterator = useRef();\n async function fetchBoostedLikedByAccounts(firstLoad) {\n if (firstLoad) {\n reblogIterator.current = masto.v1.statuses\n .$select(statusID)\n .rebloggedBy.list({\n limit: REACTIONS_LIMIT,\n })\n .values();\n favouriteIterator.current = masto.v1.statuses\n .$select(statusID)\n .favouritedBy.list({\n limit: REACTIONS_LIMIT,\n })\n .values();\n }\n const [{ value: reblogResults }, { value: favouriteResults }] =\n await Promise.allSettled([\n reblogIterator.current.next(),\n favouriteIterator.current.next(),\n ]);\n if (reblogResults.value?.length || favouriteResults.value?.length) {\n const accounts = [];\n if (reblogResults.value?.length) {\n accounts.push(\n ...reblogResults.value.map((a) => {\n a._types = ['reblog'];\n return a;\n }),\n );\n }\n if (favouriteResults.value?.length) {\n accounts.push(\n ...favouriteResults.value.map((a) => {\n a._types = ['favourite'];\n return a;\n }),\n );\n }\n return {\n value: accounts,\n done: reblogResults.done && favouriteResults.done,\n };\n }\n return {\n value: [],\n done: true,\n };\n }\n\n const actionsRef = useRef();\n const isPublic = ['public', 'unlisted'].includes(visibility);\n const isPinnable = ['public', 'unlisted', 'private'].includes(visibility);\n const menuFooter =\n mediaNoDesc && !reblogged ? (\n
\n \n Some media have no descriptions.\n
\n ) : (\n statusMonthsAgo >= 3 && (\n
\n \n \n \n Old post ({rtf.format(-statusMonthsAgo, 'month')}\n )\n \n \n
\n )\n );\n const StatusMenuItems = (\n <>\n {!isSizeLarge && sameInstance && (\n <>\n
\n \n \n \n {repliesCount > 0 ? shortenNumber(repliesCount) : t`Reply`}\n \n \n \n \n {reblogged ? t`Unboost` : t`Boost`}\n \n }\n className={`menu-reblog ${reblogged ? 'checked' : ''}`}\n menuExtras={\n {\n showCompose({\n draftStatus: {\n status: `\\n${url}`,\n },\n });\n }}\n >\n \n \n Quote\n \n \n }\n menuFooter={menuFooter}\n disabled={!canBoost}\n onClick={async () => {\n try {\n const done = await confirmBoostStatus();\n if (!isSizeLarge && done) {\n showToast(\n reblogged\n ? t`Unboosted @${username || acct}'s post`\n : t`Boosted @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n }}\n >\n \n \n {reblogsCount > 0\n ? shortenNumber(reblogsCount)\n : reblogged\n ? t`Unboost`\n : t`Boost…`}\n \n \n \n \n \n {favouritesCount > 0\n ? shortenNumber(favouritesCount)\n : favourited\n ? t`Unlike`\n : t`Like`}\n \n \n {supports('@mastodon/post-bookmark') && (\n \n \n {bookmarked ? t`Unbookmark` : t`Bookmark`}\n \n )}\n
\n \n )}\n {!isSizeLarge && sameInstance && (isSizeLarge || showActionsBar) && (\n \n )}\n {(isSizeLarge || showActionsBar) && (\n <>\n {\n states.showGenericAccounts = {\n heading: t`Boosted/Liked by…`,\n fetchAccounts: fetchBoostedLikedByAccounts,\n instance,\n showReactions: true,\n postID: sKey,\n };\n }}\n >\n \n \n Boosted/Liked by…\n \n \n \n )}\n {(isSizeLarge ||\n (!mediaFirst &&\n (enableTranslate || !language || differentLanguage))) && (\n \n )}\n {!mediaFirst && (enableTranslate || !language || differentLanguage) && (\n
\n {enableTranslate ? (\n setForceTranslate(true)}\n >\n \n \n Translate\n \n \n ) : (\n \n \n \n Translate\n \n \n )}\n {supportsTTS && (\n {\n try {\n const postText = getPostText(status);\n if (postText) {\n speak(postText, language);\n }\n } catch (error) {\n console.error('Failed to speak text:', error);\n }\n }}\n >\n \n \n Speak\n \n \n )}\n
\n )}\n {isSizeLarge && (\n {\n try {\n const postText = getPostText(status);\n navigator.clipboard.writeText(postText);\n showToast(t`Post text copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy post text`);\n }\n }}\n >\n \n \n Copy post text\n \n \n )}\n {((!isSizeLarge && sameInstance) ||\n enableTranslate ||\n !language ||\n differentLanguage) && }\n {!isSizeLarge && (\n <>\n {\n onStatusLinkClick(e, status);\n }}\n >\n \n \n \n View post by{' '}\n @{username || acct}\n \n
\n \n {_(visibilityText[visibility])} • {createdDateText}\n \n
\n \n \n )}\n {!!editedAt && (\n <>\n {\n setShowEdited(id);\n }}\n >\n \n \n Show Edit History\n
\n \n Edited: {editedDateText}\n \n
\n \n \n )}\n \n \n \n {nicePostURL(url)}\n \n \n
\n {\n // Copy url to clipboard\n try {\n navigator.clipboard.writeText(url);\n showToast(t`Link copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy link`);\n }\n }}\n >\n \n \n Copy\n \n \n {isPublic &&\n navigator?.share &&\n navigator?.canShare?.({\n url,\n }) && (\n {\n try {\n navigator.share({\n url,\n });\n } catch (e) {\n console.error(e);\n alert(t`Sharing doesn't seem to work.`);\n }\n }}\n >\n \n \n Share…\n \n \n )}\n
\n {isPublic && isSizeLarge && (\n {\n setShowEmbed(true);\n }}\n >\n \n \n Embed post\n \n \n )}\n {(isSelf || mentionSelf) && }\n {(isSelf || mentionSelf) && (\n {\n try {\n const newStatus = await masto.v1.statuses\n .$select(id)\n [muted ? 'unmute' : 'mute']();\n saveStatus(newStatus, instance);\n showToast(\n muted ? t`Conversation unmuted` : t`Conversation muted`,\n );\n } catch (e) {\n console.error(e);\n showToast(\n muted\n ? t`Unable to unmute conversation`\n : t`Unable to mute conversation`,\n );\n }\n }}\n >\n {muted ? (\n <>\n \n \n Unmute conversation\n \n \n ) : (\n <>\n \n \n Mute conversation\n \n \n )}\n \n )}\n {isSelf && isPinnable && (\n {\n try {\n const newStatus = await masto.v1.statuses\n .$select(id)\n [pinned ? 'unpin' : 'pin']();\n saveStatus(newStatus, instance);\n showToast(\n pinned\n ? t`Post unpinned from profile`\n : t`Post pinned to profile`,\n );\n } catch (e) {\n console.error(e);\n showToast(\n pinned ? t`Unable to unpin post` : t`Unable to pin post`,\n );\n }\n }}\n >\n {pinned ? (\n <>\n \n \n Unpin from profile\n \n \n ) : (\n <>\n \n \n Pin to profile\n \n \n )}\n \n )}\n {isSelf && (\n
\n {supports('@mastodon/post-edit') && (\n {\n showCompose({\n editStatus: status,\n });\n }}\n >\n \n \n Edit\n \n \n )}\n {isSizeLarge && (\n \n \n \n Delete this post?\n \n \n }\n itemProps={{\n className: 'danger',\n }}\n menuItemClassName=\"danger\"\n onClick={() => {\n // const yes = confirm('Delete this post?');\n // if (yes) {\n (async () => {\n try {\n await masto.v1.statuses.$select(id).remove();\n const cachedStatus = getStatus(id, instance);\n cachedStatus._deleted = true;\n showToast(t`Post deleted`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to delete post`);\n }\n })();\n // }\n }}\n >\n \n \n Delete…\n \n \n )}\n
\n )}\n {!isSelf && isSizeLarge && (\n <>\n \n {\n states.showReportModal = {\n account: status.account,\n post: status,\n };\n }}\n >\n \n \n Report post…\n \n \n \n )}\n \n );\n\n const contextMenuRef = useRef();\n const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);\n const [contextMenuProps, setContextMenuProps] = useState({});\n\n const showContextMenu =\n allowContextMenu || (!isSizeLarge && !previewMode && !_deleted && !quoted);\n\n // Only iOS/iPadOS browsers don't support contextmenu\n // Some comments report iPadOS might support contextmenu if a mouse is connected\n const bindLongPressContext = useLongPress(\n isIOS && showContextMenu\n ? (e) => {\n if (e.pointerType === 'mouse') return;\n // There's 'pen' too, but not sure if contextmenu event would trigger from a pen\n\n const { clientX, clientY } = e.touches?.[0] || e;\n // link detection copied from onContextMenu because here it works\n const link = e.target.closest('a');\n if (\n link &&\n statusRef.current.contains(link) &&\n !link.getAttribute('href').startsWith('#')\n )\n return;\n e.preventDefault();\n setContextMenuProps({\n anchorPoint: {\n x: clientX,\n y: clientY,\n },\n direction: 'right',\n });\n setIsContextMenuOpen(true);\n }\n : null,\n {\n threshold: 600,\n captureEvent: true,\n detect: 'touch',\n cancelOnMovement: 2, // true allows movement of up to 25 pixels\n },\n );\n\n const hotkeysEnabled = !readOnly && !previewMode && !quoted;\n const rRef = useHotkeys('r, shift+r', replyStatus, {\n enabled: hotkeysEnabled,\n useKey: true,\n ignoreEventWhen: (e) => e.metaKey || e.ctrlKey || e.altKey,\n });\n const fRef = useHotkeys('f, l', favouriteStatusNotify, {\n enabled: hotkeysEnabled,\n ignoreEventWhen: (e) => e.metaKey || e.ctrlKey || e.altKey || e.shiftKey,\n useKey: true,\n });\n const dRef = useHotkeys('d', bookmarkStatusNotify, {\n enabled: hotkeysEnabled,\n useKey: true,\n ignoreEventWhen: (e) => e.metaKey || e.ctrlKey || e.altKey || e.shiftKey,\n });\n const bRef = useHotkeys(\n 'shift+b',\n (e) => {\n // Need shiftKey check due to useKey: true\n if (!e.shiftKey) return;\n\n (async () => {\n try {\n const done = await confirmBoostStatus();\n if (!isSizeLarge && done) {\n showToast(\n reblogged\n ? t`Unboosted @${username || acct}'s post`\n : t`Boosted @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n })();\n },\n {\n enabled: hotkeysEnabled && canBoost,\n useKey: true,\n ignoreEventWhen: (e) => e.metaKey || e.ctrlKey || e.altKey,\n },\n );\n const xRef = useHotkeys(\n 'x',\n (e) => {\n const activeStatus = document.activeElement.closest(\n '.status-link, .status-focus',\n );\n if (activeStatus) {\n const spoilerButton = activeStatus.querySelector(\n '.spoiler-button:not(.spoiling)',\n );\n if (spoilerButton) {\n e.stopPropagation();\n spoilerButton.click();\n } else {\n const spoilerMediaButton = activeStatus.querySelector(\n '.spoiler-media-button:not(.spoiling)',\n );\n if (spoilerMediaButton) {\n e.stopPropagation();\n spoilerMediaButton.click();\n }\n }\n }\n },\n {\n useKey: true,\n ignoreEventWhen: (e) => e.metaKey || e.ctrlKey || e.altKey || e.shiftKey,\n },\n );\n\n const displayedMediaAttachments = mediaAttachments.slice(\n 0,\n isSizeLarge ? undefined : 4,\n );\n const showMultipleMediaCaptions =\n mediaAttachments.length > 1 &&\n displayedMediaAttachments.some(\n (media) => !!media.description && !isMediaCaptionLong(media.description),\n );\n const captionChildren = useMemo(() => {\n if (!showMultipleMediaCaptions) return null;\n const attachments = [];\n displayedMediaAttachments.forEach((media, i) => {\n if (!media.description) return;\n const index = attachments.findIndex(\n (attachment) => attachment.media.description === media.description,\n );\n if (index === -1) {\n attachments.push({\n media,\n indices: [i],\n });\n } else {\n attachments[index].indices.push(i);\n }\n });\n return attachments.map(({ media, indices }) => (\n i + 1).join(' ')}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n states.showMediaAlt = {\n alt: media.description,\n lang: language,\n };\n }}\n title={media.description}\n >\n {indices.map((i) => i + 1).join(' ')} {media.description}\n \n ));\n\n // return displayedMediaAttachments.map(\n // (media, i) =>\n // !!media.description && (\n // {\n // e.preventDefault();\n // e.stopPropagation();\n // states.showMediaAlt = {\n // alt: media.description,\n // lang: language,\n // };\n // }}\n // title={media.description}\n // >\n // {i + 1} {media.description}\n // \n // ),\n // );\n }, [showMultipleMediaCaptions, displayedMediaAttachments, language]);\n\n const isThread = useMemo(() => {\n return (\n (!!inReplyToId && inReplyToAccountId === status.account?.id) ||\n !!snapStates.statusThreadNumber[sKey]\n );\n }, [\n inReplyToId,\n inReplyToAccountId,\n status.account?.id,\n snapStates.statusThreadNumber[sKey],\n ]);\n\n const showCommentHint = useMemo(() => {\n return (\n enableCommentHint &&\n !isThread &&\n !withinContext &&\n !inReplyToId &&\n visibility === 'public' &&\n repliesCount > 0\n );\n }, [\n enableCommentHint,\n isThread,\n withinContext,\n inReplyToId,\n repliesCount,\n visibility,\n ]);\n const showCommentCount = useMemo(() => {\n if (\n card ||\n poll ||\n sensitive ||\n spoilerText ||\n mediaAttachments?.length ||\n isThread ||\n withinContext ||\n inReplyToId ||\n repliesCount <= 0\n ) {\n return false;\n }\n const questionRegex = /[???︖❓❔⁇⁈⁉¿‽؟]/;\n const containsQuestion = questionRegex.test(content);\n if (!containsQuestion) return false;\n const contentLength = htmlContentLength(content);\n if (contentLength > 0 && contentLength <= SHOW_COMMENT_COUNT_LIMIT) {\n return true;\n }\n }, [\n card,\n poll,\n sensitive,\n spoilerText,\n mediaAttachments,\n reblog,\n isThread,\n withinContext,\n inReplyToId,\n repliesCount,\n content,\n ]);\n\n return (\n \n {showReplyParent && !!(inReplyToId && inReplyToAccountId) && (\n \n )}\n {\n statusRef.current = node;\n // Use parent node if it's in focus\n // Use case: \n // When navigating (j/k), the is focused instead of \n // Hotkey binding doesn't bubble up thus this hack\n const nodeRef =\n node?.closest?.(\n '.timeline-item, .timeline-item-alt, .status-link, .status-focus',\n ) || node;\n rRef.current = nodeRef;\n fRef.current = nodeRef;\n dRef.current = nodeRef;\n bRef.current = nodeRef;\n xRef.current = nodeRef;\n }}\n tabindex=\"-1\"\n class={`status ${\n !withinContext && inReplyToId && inReplyToAccount\n ? 'status-reply-to'\n : ''\n } visibility-${visibility} ${_pinned ? 'status-pinned' : ''} ${\n SIZE_CLASS[size]\n } ${_deleted ? 'status-deleted' : ''} ${quoted ? 'status-card' : ''} ${\n isContextMenuOpen ? 'status-menu-open' : ''\n } ${mediaFirst && hasMediaAttachments ? 'status-media-first' : ''}`}\n onMouseEnter={debugHover}\n onContextMenu={(e) => {\n if (!showContextMenu) return;\n if (e.metaKey) return;\n // console.log('context menu', e);\n const link = e.target.closest('a');\n if (\n link &&\n statusRef.current.contains(link) &&\n !link.getAttribute('href').startsWith('#')\n )\n return;\n\n // If there's selected text, don't show custom context menu\n const selection = window.getSelection?.();\n if (selection.toString().length > 0) {\n const { anchorNode } = selection;\n if (statusRef.current?.contains(anchorNode)) {\n return;\n }\n }\n e.preventDefault();\n setContextMenuProps({\n anchorPoint: {\n x: e.clientX,\n y: e.clientY,\n },\n direction: 'right',\n });\n setIsContextMenuOpen(true);\n }}\n {...(showContextMenu ? bindLongPressContext() : {})}\n >\n {showContextMenu && (\n {\n setIsContextMenuOpen(false);\n // statusRef.current?.focus?.();\n if (e?.reason === 'click') {\n statusRef.current?.closest('[tabindex]')?.focus?.();\n }\n }}\n portal={{\n target: document.body,\n }}\n containerProps={{\n style: {\n // Higher than the backdrop\n zIndex: 1001,\n },\n onClick: () => {\n contextMenuRef.current?.closeMenu?.();\n },\n }}\n overflow=\"auto\"\n boundingBoxPadding={safeBoundingBoxPadding()}\n unmountOnClose\n >\n {StatusMenuItems}\n \n )}\n {showActionsBar &&\n size !== 'l' &&\n !previewMode &&\n !readOnly &&\n !_deleted &&\n !quoted && (\n \n \n \n {\n e.preventDefault();\n e.stopPropagation();\n setContextMenuProps({\n anchorRef: {\n current: e.currentTarget,\n },\n align: 'start',\n direction: 'left',\n gap: 0,\n shift: -8,\n });\n setIsContextMenuOpen('actions-bar');\n }}\n >\n \n \n \n )}\n {size !== 'l' && (\n
\n {reblogged && (\n \n )}\n {favourited && (\n \n )}\n {bookmarked && (\n \n )}\n {_pinned && (\n \n )}\n
\n )}\n {size !== 's' && (\n {\n e.preventDefault();\n e.stopPropagation();\n states.showAccount = {\n account: status.account,\n instance,\n };\n }}\n >\n \n
\n )}\n
\n {!!(status.account || createdAt) && (\n
\n \n \n \n {/* {inReplyToAccount && !withinContext && size !== 's' && (\n <>\n {' '}\n \n {' '}\n \n \n \n )} */}\n {/* */}{' '}\n {size !== 'l' &&\n (_deleted ? (\n \n Deleted\n \n ) : url && !previewMode && !readOnly && !quoted ? (\n {\n if (\n e.metaKey ||\n e.ctrlKey ||\n e.shiftKey ||\n e.altKey ||\n e.which === 2\n ) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n onStatusLinkClick?.(e, status);\n setContextMenuProps({\n anchorRef: {\n current: e.currentTarget,\n },\n align: 'end',\n direction: 'bottom',\n gap: 4,\n });\n setIsContextMenuOpen(true);\n }}\n class={`time ${\n isContextMenuOpen && contextMenuProps?.anchorRef\n ? 'is-open'\n : ''\n }`}\n >\n {showCommentHint && !showCommentCount ? (\n \n ) : (\n visibility !== 'public' &&\n visibility !== 'direct' && (\n \n )\n )}{' '}\n \n {!previewMode && !readOnly && (\n \n )}\n \n ) : (\n // {\n // if (e.target === e.currentTarget)\n // menuInstanceRef.current?.closeMenu?.();\n // },\n // }}\n // align=\"end\"\n // gap={4}\n // overflow=\"auto\"\n // viewScroll=\"close\"\n // boundingBoxPadding=\"8 8 8 8\"\n // unmountOnClose\n // menuButton={({ open }) => (\n // {\n // e.preventDefault();\n // e.stopPropagation();\n // onStatusLinkClick?.(e, status);\n // }}\n // class={`time ${open ? 'is-open' : ''}`}\n // >\n // {' '}\n // \n // \n // )}\n // >\n // {StatusMenuItems}\n // \n \n {visibility !== 'public' && visibility !== 'direct' && (\n <>\n {' '}\n \n )}\n \n \n ))}\n
\n )}\n {visibility === 'direct' && (\n <>\n
\n Private mention\n
{' '}\n \n )}\n {!withinContext && (\n <>\n {isThread ? (\n
\n \n \n Thread\n {snapStates.statusThreadNumber[sKey]\n ? ` ${snapStates.statusThreadNumber[sKey]}/X`\n : ''}\n \n
\n ) : (\n !!inReplyToId &&\n !!inReplyToAccount &&\n (!!spoilerText ||\n !mentions.find((mention) => {\n return mention.id === inReplyToAccountId;\n })) && (\n
\n {' '}\n \n
\n )\n )}\n \n )}\n \n {mediaFirst && hasMediaAttachments ? (\n <>\n {(!!spoilerText || !!sensitive) && !readingExpandSpoilers && (\n <>\n {!!spoilerText && (\n \n {' '}\n \n )}\n {\n e.preventDefault();\n e.stopPropagation();\n if (showSpoiler) {\n delete states.spoilers[id];\n if (!readingExpandSpoilers) {\n delete states.spoilersMedia[id];\n }\n } else {\n states.spoilers[id] = true;\n if (!readingExpandSpoilers) {\n states.spoilersMedia[id] = true;\n }\n }\n }}\n >\n {' '}\n {showSpoiler ? t`Show less` : t`Show content`}\n \n \n )}\n \n {!!content && (\n
\n \n
\n )}\n \n ) : (\n <>\n {!!spoilerText && (\n <>\n \n

\n \n

\n
\n {readingExpandSpoilers || previewMode ? (\n
\n Content warning\n
\n ) : (\n {\n e.preventDefault();\n e.stopPropagation();\n if (showSpoiler) {\n delete states.spoilers[id];\n if (!readingExpandSpoilers) {\n delete states.spoilersMedia[id];\n }\n } else {\n states.spoilers[id] = true;\n if (!readingExpandSpoilers) {\n states.spoilersMedia[id] = true;\n }\n }\n }}\n >\n {' '}\n {showSpoiler ? t`Show less` : t`Show content`}\n \n )}\n \n )}\n {!!content && (\n \n \n \n \n )}\n {!!poll && (\n {\n states.statuses[sKey].poll = newPoll;\n }}\n refresh={() => {\n return masto.v1.polls\n .$select(poll.id)\n .fetch()\n .then((pollResponse) => {\n states.statuses[sKey].poll = pollResponse;\n })\n .catch((e) => {}); // Silently fail\n }}\n votePoll={(choices) => {\n return masto.v1.polls\n .$select(poll.id)\n .votes.create({\n choices,\n })\n .then((pollResponse) => {\n states.statuses[sKey].poll = pollResponse;\n })\n .catch((e) => {}); // Silently fail\n }}\n />\n )}\n {(((enableTranslate || inlineTranslate) &&\n isTranslateble(content, emojis) &&\n differentLanguage) ||\n forceTranslate) && (\n \n )}\n {!previewMode &&\n (sensitive || filterInfo?.action === 'blur') &&\n !!mediaAttachments.length &&\n (readingExpandMedia !== 'show_all' ||\n filterInfo?.action === 'blur') && (\n
\n );\n}\n\nfunction MultipleMediaFigure(props) {\n const { enabled, children, lang, captionChildren } = props;\n if (!enabled || !captionChildren) return children;\n return (\n
\n {children}\n
\n {captionChildren}\n
\n
\n );\n}\n\nfunction MediaFirstContainer(props) {\n const { mediaAttachments, language, postID, instance } = props;\n const moreThanOne = mediaAttachments.length > 1;\n\n const carouselRef = useRef();\n const [currentIndex, setCurrentIndex] = useState(0);\n\n useEffect(() => {\n let handleScroll = () => {\n const { clientWidth, scrollLeft } = carouselRef.current;\n const index = Math.round(Math.abs(scrollLeft) / clientWidth);\n setCurrentIndex(index);\n };\n if (carouselRef.current) {\n carouselRef.current.addEventListener('scroll', handleScroll, {\n passive: true,\n });\n }\n return () => {\n if (carouselRef.current) {\n carouselRef.current.removeEventListener('scroll', handleScroll);\n }\n };\n }, []);\n\n return (\n <>\n
\n
\n {mediaAttachments.map((media, i) => (\n
\n \n
\n ))}\n
\n {moreThanOne && (\n \n )}\n
\n {moreThanOne && (\n \n {mediaAttachments.map((media, i) => (\n \n ))}\n \n )}\n \n );\n}\n\n// \"Post\": Quote post + card link preview combo\n// Assume all links from these domains are \"posts\"\n// Mastodon links are \"posts\" too but they are converted to real quote posts and there's too many domains to check\n// This is just \"Progressive Enhancement\"\nfunction isCardPost(domain) {\n return [\n 'x.com',\n 'twitter.com',\n 'threads.net',\n 'bsky.app',\n 'bsky.brid.gy',\n 'fed.brid.gy',\n ].includes(domain);\n}\n\nfunction Byline({ authors, hidden, children }) {\n if (hidden) return children;\n if (!authors?.[0]?.account?.id) return children;\n const author = authors[0].account;\n\n return (\n \n );\n}\n\nfunction Card({ card, selfReferential, selfAuthor, instance }) {\n const snapStates = useSnapshot(states);\n const {\n blurhash,\n title,\n description,\n html,\n providerName,\n providerUrl,\n authorName,\n authorUrl,\n width,\n height,\n image,\n imageDescription,\n url,\n type,\n embedUrl,\n language,\n publishedAt,\n authors,\n } = card;\n\n /* type\n link = Link OEmbed\n photo = Photo OEmbed\n video = Video OEmbed\n rich = iframe OEmbed. Not currently accepted, so won’t show up in practice.\n */\n\n const hasText = title || providerName || authorName;\n const isLandscape = width / height >= 1.2;\n const size = isLandscape ? 'large' : '';\n\n const [cardStatusURL, setCardStatusURL] = useState(null);\n // const [cardStatusID, setCardStatusID] = useState(null);\n useEffect(() => {\n if (hasText && image && !selfReferential && isMastodonLinkMaybe(url)) {\n unfurlMastodonLink(instance, url).then((result) => {\n if (!result) return;\n const { id, url } = result;\n setCardStatusURL('#' + url);\n\n // NOTE: This is for quote post\n // (async () => {\n // const { masto } = api({ instance });\n // const status = await masto.v1.statuses.$select(id).fetch();\n // saveStatus(status, instance);\n // setCardStatusID(id);\n // })();\n });\n }\n }, [hasText, image, selfReferential]);\n\n // if (cardStatusID) {\n // return (\n // \n // );\n // }\n\n if (snapStates.unfurledLinks[url]) return null;\n\n const hasIframeHTML = /