import{$t as e,A as t,At as n,Bt as r,C as i,D as a,Dt as o,E as s,Et as c,F as l,Ft as u,G as d,Gt as f,Ht as p,I as m,It as h,Jt as g,Kt as _,Lt as v,Nt as y,O as b,Ot as x,P as S,Pt as C,Q as w,Rt as T,S as E,Tt as D,Ut as O,Vt as k,W as ee,Wt as A,X as te,Xt as j,Yt as M,Zt as N,an as P,bt as ne,cn as re,d as F,dt as I,en as L,et as R,f as ie,ft as z,g as B,h as V,in as H,j as ae,jt as oe,k as se,kt as U,m as ce,nn as le,nt as ue,qt as de,tn as fe,ut as W,w as pe,y as me}from"./pwa-viewport-BRXXRfqX.js";import{t as he}from"./ICONS-CRflHj3Y.js";var ge=P(((e,t)=>{(function(e,n){typeof t==`object`&&t.exports?t.exports=n():e.Toastify=n()})(e,function(e){var t=function(e){return new t.lib.init(e)};t.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:``}},t.lib=t.prototype={toastify:`1.12.0`,constructor:t,init:function(e){return e||={},this.options={},this.toastElement=null,this.options.text=e.text||t.defaults.text,this.options.node=e.node||t.defaults.node,this.options.duration=e.duration===0?0:e.duration||t.defaults.duration,this.options.selector=e.selector||t.defaults.selector,this.options.callback=e.callback||t.defaults.callback,this.options.destination=e.destination||t.defaults.destination,this.options.newWindow=e.newWindow||t.defaults.newWindow,this.options.close=e.close||t.defaults.close,this.options.gravity=e.gravity===`bottom`?`toastify-bottom`:t.defaults.gravity,this.options.positionLeft=e.positionLeft||t.defaults.positionLeft,this.options.position=e.position||t.defaults.position,this.options.backgroundColor=e.backgroundColor||t.defaults.backgroundColor,this.options.avatar=e.avatar||t.defaults.avatar,this.options.className=e.className||t.defaults.className,this.options.stopOnFocus=e.stopOnFocus===void 0?t.defaults.stopOnFocus:e.stopOnFocus,this.options.onClick=e.onClick||t.defaults.onClick,this.options.offset=e.offset||t.defaults.offset,this.options.escapeMarkup=e.escapeMarkup===void 0?t.defaults.escapeMarkup:e.escapeMarkup,this.options.ariaLive=e.ariaLive||t.defaults.ariaLive,this.options.style=e.style||t.defaults.style,e.backgroundColor&&(this.options.style.background=e.backgroundColor),this},buildToast:function(){if(!this.options)throw`Toastify is not initialized`;var e=document.createElement(`div`);for(var t in e.className=`toastify on `+this.options.className,this.options.position?e.className+=` toastify-`+this.options.position:this.options.positionLeft===!0?(e.className+=` toastify-left`,console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):e.className+=` toastify-right`,e.className+=` `+this.options.gravity,this.options.backgroundColor&&console.warn(`DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.`),this.options.style)e.style[t]=this.options.style[t];if(this.options.ariaLive&&e.setAttribute(`aria-live`,this.options.ariaLive),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)e.appendChild(this.options.node);else if(this.options.escapeMarkup?e.innerText=this.options.text:e.innerHTML=this.options.text,this.options.avatar!==``){var r=document.createElement(`img`);r.src=this.options.avatar,r.className=`toastify-avatar`,this.options.position==`left`||this.options.positionLeft===!0?e.appendChild(r):e.insertAdjacentElement(`afterbegin`,r)}if(this.options.close===!0){var i=document.createElement(`button`);i.type=`button`,i.setAttribute(`aria-label`,`Close`),i.className=`toast-close`,i.innerHTML=`✖`,i.addEventListener(`click`,function(e){e.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}.bind(this));var a=window.innerWidth>0?window.innerWidth:screen.width;(this.options.position==`left`||this.options.positionLeft===!0)&&a>360?e.insertAdjacentElement(`afterbegin`,i):e.appendChild(i)}if(this.options.stopOnFocus&&this.options.duration>0){var o=this;e.addEventListener(`mouseover`,function(t){window.clearTimeout(e.timeOutValue)}),e.addEventListener(`mouseleave`,function(){e.timeOutValue=window.setTimeout(function(){o.removeElement(e)},o.options.duration)})}if(this.options.destination!==void 0&&e.addEventListener(`click`,function(e){e.stopPropagation(),this.options.newWindow===!0?window.open(this.options.destination,`_blank`):window.location=this.options.destination}.bind(this)),typeof this.options.onClick==`function`&&this.options.destination===void 0&&e.addEventListener(`click`,function(e){e.stopPropagation(),this.options.onClick()}.bind(this)),typeof this.options.offset==`object`){var s=n(`x`,this.options),c=n(`y`,this.options),l=this.options.position==`left`?s:`-`+s,u=this.options.gravity==`toastify-top`?c:`-`+c;e.style.transform=`translate(`+l+`,`+u+`)`}return e},showToast:function(){this.toastElement=this.buildToast();var e=typeof this.options.selector==`string`?document.getElementById(this.options.selector):this.options.selector instanceof HTMLElement||typeof ShadowRoot<`u`&&this.options.selector instanceof ShadowRoot?this.options.selector:document.body;if(!e)throw`Root element is not defined`;var n=t.defaults.oldestFirst?e.firstChild:e.lastChild;return e.insertBefore(this.toastElement,n),t.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(e){e.className=e.className.replace(` on`,``),window.setTimeout(function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),e.parentNode&&e.parentNode.removeChild(e),this.options.callback.call(e),t.reposition()}.bind(this),400)}},t.reposition=function(){for(var e={top:15,bottom:15},t={top:15,bottom:15},n={top:15,bottom:15},i=document.getElementsByClassName(`toastify`),a,o=0;o0?window.innerWidth:screen.width)<=360?(i[o].style[a]=n[a]+`px`,n[a]+=s+c):r(i[o],`toastify-left`)===!0?(i[o].style[a]=e[a]+`px`,e[a]+=s+c):(i[o].style[a]=t[a]+`px`,t[a]+=s+c)}return this};function n(e,t){return t.offset[e]?isNaN(t.offset[e])?t.offset[e]:t.offset[e]+`px`:`0px`}function r(e,t){return!e||typeof t!=`string`?!1:!!(e.className&&e.className.trim().split(/\s+/gi).indexOf(t)>-1)}return t.lib.init.prototype=t.lib,t})})),_e=[`shift`,`alt`,`meta`,`mod`,`ctrl`,`control`],ve={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 ye(e){return(ve[e.trim()]||e.trim()).toLowerCase().replace(/key|digit|numpad/,``)}function G(e){return _e.includes(e)}function be(e,t=`,`){return e.toLowerCase().split(t)}function xe(e,t=`+`,n=`>`,r=!1,i,a){let o=[],s=!1;e=e.trim(),e.includes(n)?(s=!0,o=e.toLocaleLowerCase().split(n).map(e=>ye(e))):o=e.toLocaleLowerCase().split(t).map(e=>ye(e));let c={alt:o.includes(`alt`),ctrl:o.includes(`ctrl`)||o.includes(`control`),shift:o.includes(`shift`),meta:o.includes(`meta`),mod:o.includes(`mod`),useKey:r},l=o.filter(e=>!_e.includes(e));return{...c,keys:l,description:i,isSequence:s,hotkey:e,metadata:a}}typeof document<`u`&&(document.addEventListener(`keydown`,e=>{e.code!==void 0&&we([ye(e.code)])}),document.addEventListener(`keyup`,e=>{e.code!==void 0&&Te([ye(e.code)])})),typeof window<`u`&&(window.addEventListener(`blur`,()=>{Se.clear()}),window.addEventListener(`contextmenu`,()=>{setTimeout(()=>{Se.clear()},0)}));var Se=new Set;function K(e){return Array.isArray(e)}function Ce(e,t=`,`){return(K(e)?e:e.split(t)).every(e=>Se.has(e.trim().toLowerCase()))}function we(e){let t=Array.isArray(e)?e:[e];Se.has(`meta`)&&Se.forEach(e=>{G(e)||Se.delete(e.toLowerCase())}),t.forEach(e=>{Se.add(e.toLowerCase())})}function Te(e){e===`meta`?Se.clear():(Array.isArray(e)?e:[e]).forEach(e=>{Se.delete(e.toLowerCase())})}function Ee(e,t,n){(typeof n==`function`&&n(e,t)||n===!0)&&e.preventDefault()}function De(e,t,n){return typeof n==`function`?n(e,t):n===!0||n===void 0}var Oe=[`input`,`textarea`,`select`,`searchbox`,`slider`,`spinbutton`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`textbox`];function ke(e){return Ae(e,Oe)}function Ae(e,t=!1){let{target:n,composed:r}=e,i,a;return je(n)&&r?(i=e.composedPath()[0]&&e.composedPath()[0].tagName,a=e.composedPath()[0]&&e.composedPath()[0].role):(i=n&&n.tagName,a=n&&n.role),K(t)?!!(i&&t&&t.some(e=>e.toLowerCase()===i.toLowerCase()||e===a)):!!(i&&t&&t)}function je(e){return!!e.tagName&&!e.tagName.startsWith(`-`)&&e.tagName.includes(`-`)}function Me(e,t){return e.length===0&&t?!1:t?e.some(e=>t.includes(e))||e.includes(`*`):!0}var Ne=(e,t,n=!1)=>{let{alt:r,meta:i,mod:a,shift:o,ctrl:s,keys:c,useKey:l}=t,{code:u,key:d,ctrlKey:f,metaKey:p,shiftKey:m,altKey:h}=e,g=ye(u);if(l&&c?.length===1&&c.includes(d.toLowerCase()))return!0;if(!c?.includes(g)&&![`ctrl`,`control`,`unknown`,`meta`,`alt`,`shift`,`os`].includes(g))return!1;if(!n){if(r!==h&&g!==`alt`||o!==m&&g!==`shift`)return!1;if(a){if(!p&&!f)return!1}else if(i!==p&&g!==`meta`&&g!==`os`||s!==f&&g!==`ctrl`&&g!==`control`)return!1}return c&&c.length===1&&c.includes(g)?!0:c&&c.length>0?c.includes(g)?Ce(c):!1:!c||c.length===0},Pe=fe(void 0),Fe=()=>de(Pe);function Ie(e,t){return e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce((n,r)=>n&&Ie(e[r],t[r]),!0):e===t}var Le=fe({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),Re=()=>de(Le);function ze(e){let t=r(void 0);return Ie(t.current,e)||(t.current=e),t.current}var Be=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},Ve=typeof window<`u`?O:g;function He(e,t,n,i){let a=r(null),o=r(!1),s=Array.isArray(n)?Array.isArray(i)?void 0:i:n,c=K(e)?e.join(s?.delimiter):e,l=Array.isArray(n)?n:Array.isArray(i)?i:void 0,u=_(t,l??[]),d=r(u);l?d.current=u:d.current=t;let f=ze(s),{activeScopes:p}=Re(),m=Fe();return Ve(()=>{if(f?.enabled===!1||!Me(p,f?.scopes))return;let e=[],t,n=(n,r=!1)=>{if(!(ke(n)&&!Ae(n,f?.enableOnFormTags))){if(a.current!==null){let e=a.current.getRootNode();if((e instanceof Document||e instanceof ShadowRoot)&&e.activeElement!==a.current&&!a.current.contains(e.activeElement)){Be(n);return}}n.target?.isContentEditable&&!f?.enableOnContentEditable||be(c,f?.delimiter).forEach(i=>{if(i.includes(f?.splitKey??`+`)&&i.includes(f?.sequenceSplitKey??`>`)){console.warn(`Hotkey ${i} contains both ${f?.splitKey??`+`} and ${f?.sequenceSplitKey??`>`} which is not supported.`);return}let a=xe(i,f?.splitKey,f?.sequenceSplitKey,f?.useKey,f?.description,f?.metadata);if(a.isSequence){t=setTimeout(()=>{e=[]},f?.sequenceTimeoutMs??1e3);let r=a.useKey?n.key:ye(n.code);if(G(r.toLowerCase()))return;if(e.push(r),r!==a.keys?.[e.length-1]){e=[],t&&clearTimeout(t);return}e.length===a.keys?.length&&(d.current(n,a),t&&clearTimeout(t),e=[])}else if(Ne(n,a,f?.ignoreModifiers)||a.keys?.includes(`*`)){if(f?.ignoreEventWhen?.(n)||r&&o.current)return;if(Ee(n,a,f?.preventDefault),!De(n,a,f?.enabled)){Be(n);return}d.current(n,a),r||(o.current=!0)}})}},r=e=>{e.code!==void 0&&(we(ye(e.code)),(f?.keydown===void 0&&f?.keyup!==!0||f?.keydown)&&n(e))},i=e=>{e.code!==void 0&&(Te(ye(e.code)),o.current=!1,f?.keyup&&n(e,!0))},l=a.current||s?.document||document;return l.addEventListener(`keyup`,i,s?.eventListenerOptions),l.addEventListener(`keydown`,r,s?.eventListenerOptions),m&&be(c,f?.delimiter).forEach(e=>{m.addHotkey(xe(e,f?.splitKey,f?.sequenceSplitKey,f?.useKey,f?.description,f?.metadata))}),()=>{l.removeEventListener(`keyup`,i,s?.eventListenerOptions),l.removeEventListener(`keydown`,r,s?.eventListenerOptions),m&&be(c,f?.delimiter).forEach(e=>{m.removeHotkey(xe(e,f?.splitKey,f?.sequenceSplitKey,f?.useKey,f?.description,f?.metadata))}),e=[],t&&clearTimeout(t)}},[c,f,p]),a}var Ue=re(ge(),1);window._showToast=q;function q(e){typeof e==`string`&&(e={text:e});let{onClick:t,delay:n,...r}=e,i=(0,Ue.default)({className:`${t||e.destination?`shiny-pill`:``}`,gravity:`bottom`,position:`center`,...r,onClick:()=>{t?.(i)}});return n?setTimeout(()=>{i.showToast()},n):i.showToast(),i}function We(e,t,n,i){let a=r(e);g(()=>{a.current=e},[e,n]),g(()=>{!i||t===null||t===!1||a.current()},[i]),g(()=>{if(t===null||t===!1)return;let e=setInterval(()=>a.current(),t);return()=>clearInterval(e)},[t])}var Ge=e=>!!e&&e[0]===`o`,J=y,Ke=(e,t)=>e===!0||!!(e&&e[t]),qe=(e,t)=>typeof e==`function`?e(t):e,Je=`_szhsinMenu`,Ye=e=>e[Je],Xe=(e,t)=>(t&&Object.keys(t).forEach(n=>{let r=e[n],i=t[n];typeof i==`function`&&r?e[n]=(...e)=>{i(...e),r(...e)}:e[n]=i}),e),Ze=e=>{if(typeof e!=`string`)return{top:0,right:0,bottom:0,left:0};let t=e.trim().split(/\s+/,4).map(parseFloat),n=isNaN(t[0])?0:t[0],r=isNaN(t[1])?n:t[1];return{top:n,right:r,bottom:isNaN(t[2])?n:t[2],left:isNaN(t[3])?r:t[3]}},Qe=e=>{for(;e;){if(e=e.parentNode,!e||e===document.body||!e.parentNode)return;let{overflow:t,overflowX:n,overflowY:r}=getComputedStyle(e);if(/auto|scroll|overlay|hidden/.test(t+r+n))return e}};function $e(e,t){return{"aria-disabled":e||void 0,tabIndex:t?0:-1}}function et(e,t){for(let n=0;np(()=>{let i=t?`${e}__${t}`:e,a=i;n&&Object.keys(n).forEach(e=>{let t=n[e];t&&(a+=` ${i}--${t===!0?e:`${e}-${t}`}`)});let o=typeof r==`function`?r(n):r;return typeof o==`string`&&(o=o.trim(),o&&(a+=` ${o}`)),a},[e,t,n,r]),nt=`szh-menu-container`,rt=`szh-menu`,it=`arrow`,at=`item`,ot=`divider`,st=`header`,ct=`group`,lt=`submenu`,ut=fe(),dt=fe({}),ft=fe({}),pt=fe({}),mt=fe({}),ht=fe({}),gt=Object.freeze({ENTER:`Enter`,ESC:`Escape`,SPACE:` `,HOME:`Home`,END:`End`,LEFT:`ArrowLeft`,RIGHT:`ArrowRight`,UP:`ArrowUp`,DOWN:`ArrowDown`}),Y=Object.freeze({RESET:0,SET:1,UNSET:2,INCREASE:3,DECREASE:4,FIRST:5,LAST:6,SET_INDEX:7}),_t=Object.freeze({CLICK:`click`,CANCEL:`cancel`,BLUR:`blur`,SCROLL:`scroll`}),vt=Object.freeze({FIRST:`first`,LAST:`last`}),yt=Object.freeze({entering:`opening`,entered:`open`,exiting:`closing`,exited:`closed`}),bt=`absolute`,xt=`none`,St=`menuitem`,Ct={preventScroll:!0},X=({className:e,containerRef:t,containerProps:n,children:r,isOpen:i,theming:a,transition:o,onClose:s})=>{let c=Ke(o,`item`);return M(`div`,{...Xe({onKeyDown:({key:e})=>{switch(e){case gt.ESC:qe(s,{key:e,reason:_t.CANCEL});break}},onBlur:e=>{i&&!e.currentTarget.contains(e.relatedTarget)&&qe(s,{reason:_t.BLUR})}},n),className:tt({block:nt,modifiers:p(()=>({theme:a,itemTransition:c}),[a,c]),className:e}),style:{position:`absolute`,...n?.style},ref:t,children:r})},wt=()=>{let e,t=0;return{toggle:e=>{e?t++:t--,t=Math.max(t,0)},on:(n,r,i)=>{t?e||=setTimeout(()=>{e=0,r()},n):i?.()},off:()=>{e&&=(clearTimeout(e),0)}}},Tt=e=>{let[t,n]=A(),i=r({items:[],hoverIndex:-1,sorted:!1}).current,a=_((t,r)=>{let{items:a}=i;if(!t)i.items=[];else if(r)a.push(t);else{let r=a.indexOf(t);r>-1&&(a.splice(r,1),t.contains(document.activeElement)&&(e.current.focus(Ct),n()))}i.hoverIndex=-1,i.sorted=!1},[i,e]);return{hoverItem:t,dispatch:_((t,r,a)=>{let{items:o,hoverIndex:s}=i,c=()=>{if(i.sorted)return;let t=e.current.querySelectorAll(`.szh-menu__item`);o.sort((e,n)=>et(t,e)-et(t,n)),i.sorted=!0},l=-1,u;switch(t){case Y.RESET:break;case Y.SET:u=r;break;case Y.UNSET:u=e=>e===r?void 0:e;break;case Y.FIRST:c(),l=0,u=o[l];break;case Y.LAST:c(),l=o.length-1,u=o[l];break;case Y.SET_INDEX:c(),l=a,u=o[l];break;case Y.INCREASE:c(),l=s,l<0&&(l=o.indexOf(r)),l++,l>=o.length&&(l=0),u=o[l];break;case Y.DECREASE:c(),l=s,l<0&&(l=o.indexOf(r)),l--,l<0&&(l=o.length-1),u=o[l];break;default:}u||(l=-1),n(u),i.hoverIndex=l},[e,i]),updateItems:a}},Et=(e,t)=>Math.round(e)===t?e:t,Dt=e=>{let t=e.getBoundingClientRect();return t.width=Et(t.width,e.offsetWidth),t.height=Et(t.height,e.offsetHeight),t},Ot=(e,t,n,r)=>{let i=Dt(t),a=e.getBoundingClientRect(),o=n===window?{left:0,top:0,right:document.documentElement.clientWidth,bottom:window.innerHeight}:n.getBoundingClientRect(),s=Ze(r),c=e=>e+a.left-o.left-s.left,l=e=>e+a.left+i.width-o.right+s.right,u=e=>e+a.top-o.top-s.top,d=e=>e+a.top+i.height-o.bottom+s.bottom;return{menuRect:i,containerRect:a,getLeftOverflow:c,getRightOverflow:l,getTopOverflow:u,getBottomOverflow:d,confineHorizontally:e=>{let t=c(e);if(t<0)e-=t;else{let n=l(e);n>0&&(e-=n,t=c(e),t<0&&(e-=t))}return e},confineVertically:e=>{let t=u(e);if(t<0)e-=t;else{let n=d(e);n>0&&(e-=n,t=u(e),t<0&&(e-=t))}return e}}},kt=({arrowRef:e,menuY:t,anchorRect:n,containerRect:r,menuRect:i})=>{let a=n.top-r.top-t+n.height/2,o=e.current.offsetHeight*1.25;return a=Math.max(o,a),a=Math.min(a,i.height-o),a},At=({anchorRect:e,containerRect:t,menuRect:n,placeLeftorRightY:r,placeLeftX:i,placeRightX:a,getLeftOverflow:o,getRightOverflow:s,confineHorizontally:c,confineVertically:l,arrowRef:u,arrow:d,direction:f,position:p})=>{let m=f,h=r;p!==`initial`&&(h=l(h),p===`anchor`&&(h=Math.min(h,e.bottom-t.top),h=Math.max(h,e.top-t.top-n.height)));let g,_,v;return m===`left`?(g=i,p!==`initial`&&(_=o(g),_<0&&(v=s(a),(v<=0||-_>v)&&(g=a,m=`right`)))):(g=a,p!==`initial`&&(v=s(g),v>0&&(_=o(i),(_>=0||-_{let a=n.left-r.left-t+n.width/2,o=e.current.offsetWidth*1.25;return a=Math.max(o,a),a=Math.min(a,i.width-o),a},Mt=({anchorRect:e,containerRect:t,menuRect:n,placeToporBottomX:r,placeTopY:i,placeBottomY:a,getTopOverflow:o,getBottomOverflow:s,confineHorizontally:c,confineVertically:l,arrowRef:u,arrow:d,direction:f,position:p})=>{let m=f===`top`?`top`:`bottom`,h=r;p!==`initial`&&(h=c(h),p===`anchor`&&(h=Math.min(h,e.right-t.left),h=Math.max(h,e.left-t.left-n.width)));let g,_,v;return m===`top`?(g=i,p!==`initial`&&(_=o(g),_<0&&(v=s(a),(v<=0||-_>v)&&(g=a,m=`bottom`)))):(g=a,p!==`initial`&&(v=s(g),v>0&&(_=o(i),(_>=0||-_{let{menuRect:l,containerRect:u}=c,d=n===`left`||n===`right`,f=d?r:i,p=d?i:r;if(e){let e=s.current;d?f+=e.offsetWidth:p+=e.offsetHeight}let m=o.left-u.left-l.width-f,h=o.right-u.left+f,g=o.top-u.top-l.height-p,_=o.bottom-u.top+p,v,y;t===`end`?(v=o.right-u.left-l.width,y=o.bottom-u.top-l.height):t===`center`?(v=o.left-u.left-(l.width-o.width)/2,y=o.top-u.top-(l.height-o.height)/2):(v=o.left-u.left,y=o.top-u.top),v+=f,y+=p;let b={...c,anchorRect:o,placeLeftX:m,placeRightX:h,placeLeftorRightY:y,placeTopY:g,placeBottomY:_,placeToporBottomX:v,arrowRef:s,arrow:e,direction:n,position:a};switch(n){case`left`:case`right`:return At(b);default:return Mt(b)}},Pt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?O:g;function Ft(e,t){typeof e==`function`?e(t):e.current=t}var It=(e,t)=>p(()=>e?t?n=>{Ft(e,n),Ft(t,n)}:e:t,[e,t]),Lt=-9999,Rt=({ariaLabel:e,menuClassName:t,menuStyle:n,arrow:i,arrowProps:a={},anchorPoint:o,anchorRef:s,containerRef:c,containerProps:l,externalRef:d,parentScrollingRef:m,align:h=`start`,direction:v=`bottom`,position:y=`auto`,overflow:b=`visible`,setDownOverflow:x,repositionFlag:S,captureFocus:C=!0,state:w,endTransition:T,isDisabled:E,menuItemFocus:D,gap:O=0,shift:k=0,children:ee,onClose:te,focusProps:j,...N})=>{let[P,ne]=A({x:Lt,y:Lt}),[re,F]=A({}),[I,L]=A(),[R,ie]=A(v),[z]=A(wt),[B,V]=f(e=>e+1,1),{transition:H,boundingBoxRef:ae,boundingBoxPadding:oe,rootMenuRef:se,rootAnchorRef:U,scrollNodesRef:ce,reposition:le,viewScroll:ue,submenuCloseDelay:fe}=de(ht),{submenuCtx:W,reposSubmenu:pe=S}=de(ft),me=r(),he=r(),ge=r(!1),{hoverItem:_e,dispatch:ve,updateItems:ye}=Tt(me),G=Ge(w),be=Ke(H,`open`),xe=Ke(H,`close`),Se=ce.current,K=e=>{switch(e.key){case gt.HOME:ve(Y.FIRST);break;case gt.END:ve(Y.LAST);break;case gt.UP:ve(Y.DECREASE,_e);break;case gt.DOWN:ve(Y.INCREASE,_e);break;case gt.SPACE:e.target&&e.target.className.indexOf(`szh-menu`)!==-1&&e.preventDefault();return;default:return}e.preventDefault(),e.stopPropagation()},Ce=()=>{w===`closing`&&L(),qe(T)},we=e=>{e.stopPropagation(),z.on(fe,()=>{ve(Y.RESET),me.current.focus(Ct)})},Te=e=>{e.target===e.currentTarget&&z.off()},Ee=_(e=>{let t=me.current,n=c.current;if(!t||!n)return;let r=s?s.current?.getBoundingClientRect():o?{left:o.x,right:o.x,top:o.y,bottom:o.y,width:0,height:0}:null;if(!r)return;Se.menu||=(ae?ae.current:Qe(se.current))||window;let a=Ot(n,t,Se.menu,oe),{arrowX:l,arrowY:u,x:d,y:f,computedDirection:p}=Nt({arrow:i,align:h,direction:v,gap:O,shift:k,position:y,anchorRect:r,arrowRef:he,positionHelpers:a}),{menuRect:m}=a,g=m.height;if(!e&&b!==`visible`){let{getTopOverflow:e,getBottomOverflow:t}=a,n,r,i=t(f);if(i>0)n=g-i,r=i;else{let t=e(f);t<0&&(n=g+t,r=0-t,n>=0&&(f-=t))}n>=0&&L({height:n,overflowAmt:r})}i&&F({x:l,y:u}),ne({x:d,y:f}),ie(p)},[i,h,oe,v,O,k,y,b,o,s,c,ae,se,Se]);Pt(()=>{G&&(Ee(),ge.current&&V()),ge.current=G},[G,Ee,pe]),Pt(()=>{I&&!x&&(me.current.scrollTop=0)},[I,x]),Pt(()=>ye,[ye]),g(()=>{let{menu:e}=Se;if(!G||!e)return;if(e=e.addEventListener?e:window,!Se.anchors){Se.anchors=[];let t=Qe(U&&U.current);for(;t&&t!==e;)Se.anchors.push(t),t=Qe(t)}let t=ue;if(Se.anchors.length&&t===`initial`&&(t=`auto`),t===`initial`)return;let n=()=>{t===`auto`?J(()=>Ee(!0)):qe(te,{reason:_t.SCROLL})},r=Se.anchors.concat(ue===`initial`?[]:e);return r.forEach(e=>e.addEventListener(`scroll`,n)),()=>r.forEach(e=>e.removeEventListener(`scroll`,n))},[U,Se,G,te,ue,Ee]);let De=!!I&&I.overflowAmt>0;g(()=>{if(De||!G||!m)return;let e=()=>J(Ee),t=m.current;return t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)},[G,De,m,Ee]),g(()=>{if(!G||typeof ResizeObserver!=`function`||le===`initial`)return;let e=[],t=new ResizeObserver(t=>t.forEach(({target:t})=>{e.indexOf(t)<0?e.push(t):u(()=>{Ee(),V()})})),n={box:`border-box`};t.observe(me.current,n);let r=s?.current;return r&&t.observe(r,n),()=>t.disconnect()},[G,le,s,Ee]),g(()=>{if(!G){ve(Y.RESET),xe||L();return}let{position:e,alwaysUpdate:t}=D||{},n=()=>{e===vt.FIRST?ve(Y.FIRST):e===vt.LAST?ve(Y.LAST):e>=-1&&ve(Y.SET_INDEX,void 0,e)};if(t)n();else if(C){let e=setTimeout(()=>{let e=me.current;e&&!e.contains(document.activeElement)&&(e.focus(Ct),n())},be?170:100);return()=>clearTimeout(e)}},[G,be,xe,C,D,ve]);let Oe=p(()=>({isParentOpen:G,submenuCtx:z,dispatch:ve,updateItems:ye}),[G,z,ve,ye]),ke,Ae;I&&(x?Ae=I.overflowAmt:ke=I.height);let je=p(()=>({reposSubmenu:B,submenuCtx:z,overflow:b,overflowAmt:Ae,parentMenuRef:me,parentDir:R}),[B,z,b,Ae,R]),Me=ke>=0?{maxHeight:ke,overflow:b}:void 0,Ne=p(()=>({state:w,align:h,dir:R}),[w,h,R]),Pe=tt({block:rt,element:it,modifiers:p(()=>({dir:R}),[R]),className:a.className}),Fe=M(`ul`,{role:`menu`,"aria-label":e,...$e(E),...Xe({onPointerEnter:W?.off,onPointerMove:we,onPointerLeave:Te,onKeyDown:K,onAnimationEnd:Ce},N),ref:It(d,me),className:tt({block:rt,modifiers:Ne,className:t}),style:{...n,...Me,margin:0,display:w===`closed`?`none`:void 0,position:bt,left:P.x,top:P.y},children:[i&&M(`li`,{"aria-hidden":!0,...a,className:Pe,style:{display:`block`,position:`absolute`,left:re.x,top:re.y,...a.style},ref:he}),M(ft.Provider,{value:je,children:M(dt.Provider,{value:Oe,children:M(ut.Provider,{value:_e,children:qe(ee,Ne)})})})]});return l?M(X,{...l,isOpen:G,children:Fe}):Fe},zt=x(function({"aria-label":e,className:t,containerProps:n,initialMounted:i,unmountOnClose:a,transition:s,transitionTimeout:c,boundingBoxRef:l,boundingBoxPadding:u,reposition:d=`auto`,submenuOpenDelay:f=300,submenuCloseDelay:m=150,viewScroll:h=`initial`,portal:g,theming:_,onItemClick:v,...y},b){let x=r(null),S=r({}),{anchorRef:C,state:w,onClose:T}=y,E=p(()=>({initialMounted:i,unmountOnClose:a,transition:s,transitionTimeout:c,boundingBoxRef:l,boundingBoxPadding:u,rootMenuRef:x,rootAnchorRef:C,scrollNodesRef:S,reposition:d,viewScroll:h,submenuOpenDelay:f,submenuCloseDelay:m}),[i,a,s,c,C,l,u,d,h,f,m]),D=p(()=>({handleClick(e,t){e.stopPropagation||qe(v,e);let n=e.keepOpen;n===void 0&&(n=t&&e.key===gt.SPACE),n||qe(T,{value:e.value,key:e.key,reason:_t.CLICK})},handleClose(e){qe(T,{key:e,reason:_t.CLICK})}}),[v,T]);if(!w)return null;let O=M(ht.Provider,{value:E,children:M(pt.Provider,{value:D,children:M(Rt,{...y,ariaLabel:e||`Menu`,externalRef:b,containerRef:x,containerProps:{className:t,containerRef:x,containerProps:n,theming:_,transition:s,onClose:T}})})});return g===!0&&typeof document<`u`?o(O,document.body):g?g.target?o(O,g.target):g.stablePosition?null:O:O}),Bt=5,Vt=6,Ht=[`preEnter`,`entering`,`entered`,`preExit`,`exiting`,`exited`,`unmounted`],Ut=e=>({_s:e,status:Ht[e],isEnter:e<3,isMounted:e!==Vt,isResolved:e===2||e>4}),Wt=e=>e?Vt:Bt,Gt=(e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return Wt(t)}},Kt=e=>typeof e==`object`?[e.enter,e.exit]:[e,e],qt=(...e)=>setTimeout(...e),Jt=(e,t)=>qt(()=>{isNaN(document.body.offsetTop)||e(t+1)},0),Yt=(e,t,n,r,i)=>{clearTimeout(r.current);let a=Ut(e);t(a),n.current=a,i&&i({current:a})},Xt=({enter:e=!0,exit:t=!0,preEnter:n,preExit:i,timeout:a,initialEntered:o,mountOnEnter:s,unmountOnExit:c,onStateChange:l}={})=>{let[u,d]=A(()=>Ut(o?2:Wt(s))),f=r(u),p=r(0),[m,h]=Kt(a),g=_(()=>{let e=Gt(f.current._s,c);e&&Yt(e,d,f,p,l)},[l,c]);return[u,_(r=>{let a=e=>{switch(Yt(e,d,f,p,l),e){case 1:m>=0&&(p.current=qt(g,m));break;case 4:h>=0&&(p.current=qt(g,h));break;case 0:case 3:p.current=Jt(a,e);break}},o=f.current.isEnter;typeof r!=`boolean`&&(r=!o),r?!o&&a(e?+!n:2):o&&a(t?i?3:4:Wt(c))},[g,l,e,t,n,i,m,h,c]),g]},Zt=({initialOpen:e,initialMounted:t,unmountOnClose:n,transition:r,transitionTimeout:i=500,onMenuChange:a}={})=>{let o=Ke(r,`open`),s=Ke(r,`close`),[{status:c},l,u]=Xt({initialEntered:e,mountOnEnter:!t,unmountOnExit:n,timeout:i,enter:o,exit:s,onStateChange:_(({current:{isEnter:e,isResolved:t}})=>{!a||e&&o&&t||!e&&s&&t||a({open:e})},[a,o,s])});return[{state:yt[c],endTransition:u},l]},Qt=e=>{let[t,n]=Zt(e),[r,i]=A(),a=(e,t)=>{i({position:e,alwaysUpdate:t}),n(!0)};return[{menuItemFocus:r,...t},n,a]},$t=(e,t)=>{let[n]=A({});return{onMouseDown:()=>{n.v=e&&e!==`closed`},onClick:e=>n.v?n.v=!1:t(!0,e)}},en=parseInt(C)<19,tn=x(function({"aria-label":t,captureFocus:n,initialOpen:i,menuButton:a,instanceRef:o,onMenuChange:s,...c},l){let[u,d,f]=Qt({...c,onMenuChange:s}),{state:p}=u,m=Ge(p),h=r(null),g=$t(p,(e,t)=>f(t.detail?void 0:vt.FIRST)),v=_(e=>{d(!1),e.key&&h.current.focus()},[d]),y=e=>{switch(e.key){case gt.UP:f(vt.LAST);break;case gt.DOWN:f(vt.FIRST);break;default:return}e.preventDefault()},b=qe(a,{open:m});if(!b||!b.type)throw Error(`Menu requires a menuButton prop.`);let x={...Xe({onKeyDown:y,...g},b.props),ref:It(en?b.ref:b.props.ref,h)};Ye(b.type)===`MenuButton`&&(x.isOpen=m);let S=T(b,x);return k(o,()=>({openMenu:f,closeMenu:()=>d(!1)})),M(e,{children:[S,M(zt,{...c,...u,"aria-label":t||(typeof b.props.children==`string`?b.props.children:`Menu`),anchorRef:h,ref:l,onClose:v})]})}),nn=(e,t)=>{let n=oe(t),i=x((e,t)=>{let i=r(null);return M(n,{...e,itemRef:i,externalRef:t,isHovering:de(ut)===i.current})});return i.displayName=`WithHovering(${e})`,i},rn=e=>{let[t,n]=A(!1);return g(()=>{!e&&n(!1)},[e]),[t,()=>!t&&n(!0),()=>n(!1)]},an=(e,t,n)=>{Pt(()=>{if(e)return;let r=t.current;return n(r,!0),()=>{n(r)}},[e,t,n])},on=nn(`SubMenu`,function({"aria-label":e,className:t,disabled:n,direction:i,label:a,openTrigger:s,onMenuChange:c,isHovering:l,instanceRef:u,itemRef:d,captureFocus:f,repositionFlag:m,itemProps:h={},portal:_=!1,...v}){let y=de(ht),{rootMenuRef:b,submenuOpenDelay:x,submenuCloseDelay:S}=y,{parentMenuRef:C,parentDir:w,overflow:T}=de(ft),{isParentOpen:E,submenuCtx:D,dispatch:O,updateItems:ee}=de(dt),te=_||T!==`visible`,[j,N,P]=Qt({...y,onMenuChange:c}),[ne,re,F]=rn(l),{state:I}=j,L=!!n,R=Ge(I),ie=r(null),[z]=A({v:0}),B=()=>{D.off(),z.v&&=(clearTimeout(z.v),0)},V=(...e)=>{B(),H(),!L&&P(...e)},H=()=>!l&&!L&&O(Y.SET,d.current),ae=e=>{H(),s||(z.v=setTimeout(()=>J(V),Math.max(e,0)))},oe=e=>{L||(e.stopPropagation(),re(),!(z.v||R)&&D.on(S,()=>ae(x-S),()=>ae(x)))},se=()=>{F(),B(),R||O(Y.UNSET,d.current)},U=e=>{if(l)switch(e.key){case gt.ENTER:e.preventDefault();case gt.SPACE:case gt.RIGHT:s!==`none`&&V(vt.FIRST)}},ce=e=>{let t=!1;switch(e.key){case gt.LEFT:R&&(d.current.focus(),N(!1),t=!0);break;case gt.RIGHT:R||(t=!0);break}t&&(e.preventDefault(),e.stopPropagation())};an(L,d,ee),g(()=>D.toggle(R),[D,R]),g(()=>()=>{clearTimeout(z.v),D.toggle(!1)},[z,D]),g(()=>{l&&E?d.current.focus():N(!1)},[l,E,N,d]),k(u,()=>({openMenu:(...e)=>{E&&V(...e)},closeMenu:()=>{R&&(d.current.focus(),N(!1))}}));let le=p(()=>({open:R,hover:ne||l,disabled:L,submenu:!0}),[R,l,L,ne]),{ref:ue,className:fe,...W}=h,pe=Xe({onPointerEnter:D.off,onPointerMove:oe,onPointerLeave:se,onKeyDown:U,onClick:()=>s!==`none`&&V()},W),me=()=>{let t=M(Rt,{...v,...j,ariaLabel:e||(typeof a==`string`?a:`Submenu`),anchorRef:d,containerRef:te?b:ie,direction:i||(w===`right`||w===`left`?w:`right`),parentScrollingRef:te&&C,isDisabled:L}),n=b.current;return te&&n?o(t,n):t};return M(`li`,{className:tt({block:rt,element:lt,className:t}),style:{position:`relative`},role:xt,ref:ie,onKeyDown:ce,children:[M(`div`,{role:St,"aria-haspopup":!0,"aria-expanded":R,...$e(L,l),...pe,ref:It(ue,d),className:tt({block:rt,element:at,modifiers:le,className:fe}),children:p(()=>qe(a,le),[a,le])}),I&&me()]})}),sn=(e,t,n,r)=>{let[i,a,o]=rn(n),{submenuCloseDelay:s}=de(ht),{isParentOpen:c,submenuCtx:l,dispatch:u,updateItems:d}=de(dt),f=()=>{!n&&!r&&u(Y.SET,e.current)},p=()=>{!r&&u(Y.UNSET,e.current)};return an(r,e,d),g(()=>{n&&c&&t.current&&t.current.focus()},[t,n,c]),{mouseOver:i,setHover:f,onBlur:e=>{n&&!e.currentTarget.contains(e.relatedTarget)&&p()},onPointerMove:e=>{r||(e.stopPropagation(),a(),l.on(s,f,f))},onPointerLeave:(e,t)=>{o(),l.off(),!t&&p()}}},Z=nn(`MenuItem`,function({className:e,value:t,href:n,type:r,checked:i,disabled:a,children:o,onClick:s,isHovering:c,itemRef:l,externalRef:u,...d}){let f=!!a,{mouseOver:m,setHover:h,...g}=sn(l,l,c,f),_=de(pt),v=de(mt),y=r===`radio`,b=r===`checkbox`,x=!!n&&!f&&!y&&!b,S=y?v.value===t:b?!!i:!1,C=e=>{if(f){e.stopPropagation(),e.preventDefault();return}let n={value:t,syntheticEvent:e};e.key!==void 0&&(n.key=e.key),b&&(n.checked=!S),y&&(n.name=v.name),qe(s,n),y&&qe(v.onRadioChange,n),_.handleClick(n,b||y)},w=e=>{if(c)switch(e.key){case gt.ENTER:e.preventDefault();case gt.SPACE:x?l.current.click():C(e)}},T=p(()=>({type:r,disabled:f,hover:m||c,checked:S,anchor:x}),[r,f,m,c,S,x]),E=Xe({...g,onPointerDown:h,onKeyDown:w,onClick:C},d),D={role:y?`menuitemradio`:b?`menuitemcheckbox`:St,"aria-checked":y||b?S:void 0,...$e(f,c),...E,ref:It(u,l),className:tt({block:rt,element:at,modifiers:T,className:e}),children:p(()=>qe(o,T),[o,T])};return x?M(`li`,{role:xt,children:M(`a`,{href:n,...D})}):M(`li`,{...D})}),cn=nn(`FocusableItem`,function({className:e,disabled:t,children:n,isHovering:i,itemRef:a,externalRef:o,...s}){let c=!!t,l=r(null),{mouseOver:u,setHover:d,onPointerLeave:f,...m}=sn(a,l,i,c),{handleClose:h}=de(pt),g=p(()=>({disabled:c,hover:u||i,focusable:!0}),[c,i,u]),_=p(()=>qe(n,{...g,ref:l,closeMenu:h}),[n,g,h]),v=Xe({...m,onPointerLeave:e=>f(e,!0),onFocus:d},s);return M(`li`,{role:St,...$e(c),...v,ref:It(o,a),className:tt({block:rt,element:at,modifiers:g,className:e}),children:_})}),ln=oe(x(function({className:e,...t},n){return M(`li`,{role:`separator`,...t,ref:n,className:tt({block:rt,element:ot,className:e})})})),un=oe(x(function({className:e,...t},n){return M(`li`,{role:xt,...t,ref:n,className:tt({block:rt,element:st,className:e})})})),dn=x(function({className:e,style:t,takeOverflow:n,...i},a){let o=r(null),[s,c]=A(),{overflow:l,overflowAmt:u}=de(ft);return Pt(()=>{let e;n&&u>=0&&(e=Dt(o.current).height-u,e<0&&(e=0)),c(e>=0?{maxHeight:e,overflow:l}:void 0)},[n,l,u]),Pt(()=>{s&&(o.current.scrollTop=0)},[s]),M(`div`,{...i,ref:It(a,o),className:tt({block:rt,element:ct,className:e}),style:{...t,...s}})}),fn=(e=>(e.Mouse=`mouse`,e.Touch=`touch`,e.Pointer=`pointer`,e))(fn||{}),pn=(e=>(e.CancelledByMovement=`cancelled-by-movement`,e.CancelledByRelease=`cancelled-by-release`,e.CancelledOutsideElement=`cancelled-outside-element`,e))(pn||{}),mn=[`mousedown`,`mousemove`,`mouseup`,`mouseleave`,`mouseout`],hn=[`touchstart`,`touchmove`,`touchend`,`touchcancel`],gn=[`pointerdown`,`pointermove`,`pointerup`,`pointerleave`,`pointerout`];function _n(e){return typeof e==`object`&&!!e&&`pageX`in e&&typeof e.pageX==`number`&&`pageY`in e&&typeof e.pageY==`number`}function vn(e){return mn.includes(e?.nativeEvent?.type)}function yn(e){return hn.includes(e?.nativeEvent?.type)||`touches`in e}function bn(e){let{nativeEvent:t}=e;return t?gn.includes(t?.type)||`pointerId`in t:!1}function xn(e){return vn(e)||yn(e)||bn(e)}function Sn(e){let t=yn(e)?e?.touches?.[0]:e;return _n(t)?{x:t.pageX,y:t.pageY}:null}function Cn(e){return{target:e.target,currentTarget:e.currentTarget,nativeEvent:e,persist:()=>{}}}function wn(e,{threshold:t=400,captureEvent:n=!1,detect:i=fn.Pointer,cancelOnMovement:a=!1,cancelOutsideElement:o=!0,filterEvents:s,onStart:c,onMove:l,onFinish:u,onCancel:d}={}){let f=r(!1),p=r(!1),m=r(),h=r(),v=r(e),y=r(null),b=_(e=>r=>{p.current||xn(r)&&(s!==void 0&&!s(r)||(n&&r.persist(),c?.(r,{context:e}),y.current=Sn(r),p.current=!0,m.current=r.currentTarget,h.current=setTimeout(()=>{v.current&&(v.current(r,{context:e}),f.current=!0)},t)))},[n,s,c,t]),x=_(e=>(t,r)=>{xn(t)&&p.current&&(y.current=null,n&&t.persist(),f.current?u?.(t,{context:e}):p.current&&d?.(t,{context:e,reason:r??pn.CancelledByRelease}),f.current=!1,p.current=!1,h.current!==void 0&&clearTimeout(h.current))},[n,u,d]),S=_(e=>t=>{if(xn(t)&&(l?.(t,{context:e}),a!==!1&&y.current)){let n=Sn(t);if(n){let r=a===!0?25:a,i={x:Math.abs(n.x-y.current.x),y:Math.abs(n.y-y.current.y)};(i.x>r||i.y>r)&&x(e)(t,pn.CancelledByMovement)}}},[x,a,l]),C=_(t=>{if(e===null)return{};switch(i){case fn.Mouse:{let e={onMouseDown:b(t),onMouseMove:S(t),onMouseUp:x(t)};return o&&(e.onMouseLeave=e=>{x(t)(e,pn.CancelledOutsideElement)}),e}case fn.Touch:return{onTouchStart:b(t),onTouchMove:S(t),onTouchEnd:x(t)};case fn.Pointer:{let e={onPointerDown:b(t),onPointerMove:S(t),onPointerUp:x(t)};return o&&(e.onPointerLeave=e=>x(t)(e,pn.CancelledOutsideElement)),e}}},[e,x,o,i,S,b]);return g(()=>{function e(e){let t=Cn(e);x()(t)}return window.addEventListener(`mouseup`,e),window.addEventListener(`touchend`,e),window.addEventListener(`pointerup`,e),()=>{window.removeEventListener(`mouseup`,e),window.removeEventListener(`touchend`,e),window.removeEventListener(`pointerup`,e)}},[x]),g(()=>()=>{h.current!==void 0&&clearTimeout(h.current)},[]),g(()=>{v.current=e},[e]),C}var Tn={success:{pattern:[{duration:30,intensity:.5},{delay:60,duration:40,intensity:1}]},warning:{pattern:[{duration:40,intensity:.8},{delay:100,duration:40,intensity:.6}]},error:{pattern:[{duration:40,intensity:.9},{delay:40,duration:40,intensity:.9},{delay:40,duration:40,intensity:.9}]},light:{pattern:[{duration:15,intensity:.4}]},medium:{pattern:[{duration:25,intensity:.7}]},heavy:{pattern:[{duration:35,intensity:1}]},soft:{pattern:[{duration:40,intensity:.5}]},rigid:{pattern:[{duration:10,intensity:1}]},selection:{pattern:[{duration:8,intensity:.3}]},nudge:{pattern:[{duration:80,intensity:.8},{delay:80,duration:50,intensity:.3}]},buzz:{pattern:[{duration:1e3,intensity:1}]}},En=16,Dn=184,On=1e3,kn=20;function An(e){if(typeof e==`number`)return{vibrations:[{duration:e}]};if(typeof e==`string`){let t=Tn[e];return t?{vibrations:t.pattern.map(e=>({...e}))}:(console.warn(`[web-haptics] Unknown preset: "${e}"`),null)}if(Array.isArray(e)){if(e.length===0)return{vibrations:[]};if(typeof e[0]==`number`){let t=e,n=[];for(let e=0;e0?t[e-1]:0;n.push({...r>0&&{delay:r},duration:t[e]})}return{vibrations:n}}return{vibrations:e.map(e=>({...e}))}}return{vibrations:e.pattern.map(e=>({...e}))}}function jn(e,t){if(t>=1)return[e];if(t<=0)return[];let n=Math.max(1,Math.round(kn*t)),r=kn-n,i=[],a=e;for(;a>=kn;)i.push(n),i.push(r),a-=kn;if(a>0){let e=Math.max(1,Math.round(a*t));i.push(e);let n=a-e;n>0&&i.push(n)}return i}function Mn(e,t){let n=[];for(let r=0;r0&&(n.length>0&&n.length%2==0?n[n.length-1]+=o:(n.length===0&&n.push(0),n.push(o)));let s=jn(i.duration,a);if(s.length===0){n.length>0&&n.length%2==0?n[n.length-1]+=i.duration:i.duration>0&&(n.push(0),n.push(i.duration));continue}for(let e of s)n.push(e)}return n}var Nn=0,Pn=new class e{hapticLabel=null;domInitialized=!1;instanceId;debug;showSwitch;rafId=null;patternResolve=null;audioCtx=null;audioFilter=null;audioGain=null;audioBuffer=null;constructor(e){this.instanceId=++Nn,this.debug=e?.debug??!1,this.showSwitch=e?.showSwitch??!1}static isSupported=typeof navigator<`u`&&typeof navigator.vibrate==`function`;async trigger(t=[{duration:25,intensity:.7}],n){let r=An(t);if(!r)return;let{vibrations:i}=r;if(i.length===0)return;let a=Math.max(0,Math.min(1,n?.intensity??.5));for(let e of i)if(e.duration>On&&(e.duration=On),!Number.isFinite(e.duration)||e.duration<0||e.delay!==void 0&&(!Number.isFinite(e.delay)||e.delay<0)){console.warn(`[web-haptics] Invalid vibration values. Durations and delays must be finite non-negative numbers.`);return}if(e.isSupported&&navigator.vibrate(Mn(i,a)),!e.isSupported||this.debug){if(this.ensureDOM(),!this.hapticLabel)return;this.debug&&await this.ensureAudio(),this.stopPattern();let e=(i[0]?.delay??0)===0;if(e&&(this.hapticLabel.click(),this.debug&&this.audioCtx)){let e=Math.max(0,Math.min(1,i[0].intensity??a));this.playClick(e)}await this.runPattern(i,a,e)}}cancel(){this.stopPattern(),e.isSupported&&navigator.vibrate(0)}destroy(){this.stopPattern(),this.hapticLabel&&(this.hapticLabel.remove(),this.hapticLabel=null,this.domInitialized=!1),this.audioCtx&&(this.audioCtx.close(),this.audioCtx=null,this.audioFilter=null,this.audioGain=null,this.audioBuffer=null)}setDebug(e){this.debug=e,!e&&this.audioCtx&&(this.audioCtx.close(),this.audioCtx=null,this.audioFilter=null,this.audioGain=null,this.audioBuffer=null)}setShowSwitch(e){if(this.showSwitch=e,this.hapticLabel){let t=this.hapticLabel.querySelector(`input`);this.hapticLabel.style.display=e?``:`none`,t&&(t.style.display=e?``:`none`)}}stopPattern(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.patternResolve?.(),this.patternResolve=null}runPattern(e,t,n){return new Promise(r=>{this.patternResolve=r;let i=[],a=0;for(let n of e){let e=Math.max(0,Math.min(1,n.intensity??t)),r=n.delay??0;r>0&&(a+=r,i.push({end:a,isOn:!1,intensity:0})),a+=n.duration,i.push({end:a,isOn:!0,intensity:e})}let o=a,s=0,c=-1,l=e=>{s===0&&(s=e);let t=e-s;if(t>=o){this.rafId=null,this.patternResolve=null,r();return}let a=i[0];for(let e of i)if(t=t&&(this.hapticLabel?.click(),this.debug&&this.audioCtx&&this.playClick(a.intensity),c=e)}this.rafId=requestAnimationFrame(l)};this.rafId=requestAnimationFrame(l)})}playClick(e){if(!this.audioCtx||!this.audioFilter||!this.audioGain||!this.audioBuffer)return;let t=this.audioBuffer.getChannelData(0);for(let e=0;ei.disconnect(),i.start()}async ensureAudio(){if(!this.audioCtx&&typeof AudioContext<`u`){this.audioCtx=new AudioContext,this.audioFilter=this.audioCtx.createBiquadFilter(),this.audioFilter.type=`bandpass`,this.audioFilter.frequency.value=4e3,this.audioFilter.Q.value=8,this.audioGain=this.audioCtx.createGain(),this.audioFilter.connect(this.audioGain),this.audioGain.connect(this.audioCtx.destination),this.audioBuffer=this.audioCtx.createBuffer(1,this.audioCtx.sampleRate*.004,this.audioCtx.sampleRate);let e=this.audioBuffer.getChannelData(0);for(let t=0;t`u`)return;let e=`web-haptics-${this.instanceId}`,t=document.createElement(`label`);t.setAttribute(`for`,e),t.textContent=`Haptic feedback`,t.style.position=`fixed`,t.style.bottom=`10px`,t.style.left=`10px`,t.style.padding=`5px 10px`,t.style.backgroundColor=`rgba(0, 0, 0, 0.7)`,t.style.color=`white`,t.style.fontFamily=`sans-serif`,t.style.fontSize=`14px`,t.style.borderRadius=`4px`,t.style.zIndex=`9999`,t.style.userSelect=`none`,this.hapticLabel=t;let n=document.createElement(`input`);n.type=`checkbox`,n.setAttribute(`switch`,``),n.id=e,n.style.all=`initial`,n.style.appearance=`auto`,this.showSwitch||(t.style.display=`none`,n.style.display=`none`),t.appendChild(n),document.body.appendChild(t),this.domInitialized=!0}},Fn=`dtflocale`;function In(){try{let e=ee.session.get(Fn);if(e)return e;let t=new Intl.DateTimeFormat().resolvedOptions().locale;return ee.session.set(Fn,t),t}catch{return null}}var Ln=W(In);function Rn(){let e=[...navigator.languages],t=Ln();return t&&!e.includes(t)&&e.unshift(t),e}var zn=Rn(),Bn=W((e,t={})=>{try{return new Intl.Locale(e,t)}catch{if(!e)return null;let[n,...r]=e.split(`-`,4),i={language:n,region:r.pop()||null,...t,toString:()=>{let e=i.language,t=r.length>0?`-${r.join(`-`)}-`:`-`,n=i.region;return n?`${e}${t}${n}`:e}};return i}}),Vn=W((e,t)=>{let n=t,r=Bn(e),i=null;for(let e of zn){let t=Bn(e)?.region;if(t){i=t;break}}let a=B([i&&r&&r.region!==i?Bn(r.language,{...r,region:i})?.toString():null,e,e?.replace(/-[a-z]+$/i,``)],zn,e);try{return new Intl.DateTimeFormat(a,n)}catch{return new Intl.DateTimeFormat(void 0,n)}});function Hn(e,t){e instanceof Date||(e=new Date(e));let{hideTime:n,formatOpts:r,forceOpts:i}=t||{},a=new Date().getFullYear(),o=i||{year:e.getFullYear()===a?void 0:`numeric`,month:`short`,day:`numeric`,hour:n?void 0:`numeric`,minute:n?void 0:`numeric`,...r};return Vn(H.locale,o).format(e)}function Un(e){let t=URL.parse(`./compose/`,window.location),{width:n,height:r}=window.screen,i=Math.max(0,(n-600)/2),a=Math.max(0,(r-450)/2),o=Math.min(n,600),s=Math.min(r,450),c=e?.uid||Math.random(),l=window.open(t,`compose`+c,`width=${o},height=${s},left=${i},top=${a}`);return l?l.__COMPOSE__=e:alert(H._({id:`4S86wI`})),l}var Wn=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function Gn(){if(Wn){let e=document.createElement(`input`);e.style.position=`absolute`,e.style.top=`0`,e.style.left=`0`,e.style.opacity=`0`,document.body.appendChild(e),e.focus(),setTimeout(()=>{document.body.removeChild(e)},500)}}var Kn=document.documentElement,qn=getComputedStyle(Kn),Jn=8,Yn=[0,0,0,0];function Xn(){let e=qn.getPropertyValue(`--sai-top`),t=qn.getPropertyValue(`--sai-right`),n=qn.getPropertyValue(`--sai-bottom`),r=qn.getPropertyValue(`--sai-left`);Yn=[Math.max(0,parseInt(e,10)),Math.max(0,parseInt(t,10)),Math.max(0,parseInt(n,10)),Math.max(0,parseInt(r,10))]}requestAnimationFrame(Xn);function Zn(e=[]){return Yn.map((t,n)=>(t||Jn)+(e[n]||0)).join(` `)}CSS.supports(`top: env(safe-area-inset-top)`)&&window.addEventListener(`resize`,Xn,{passive:!0});var Qn=5e3;function $n(e){if(e||=!0,i.showCompose){i.composerState.minimized?q({duration:Qn,text:H._({id:`_4fHR1`})}):q({duration:Qn,text:H._({id:`vvl08N`})});return}Gn(),i.showCompose=e}var er=document.createElement(`template`),tr=/<\/p>/g,nr=/<\/li>/g,rr=/[\r\n]{3,}/g;function ir(e,t){if(!e)return``;let{preProcess:n,truncateLinks:r=!0}=t||{};er.innerHTML=e.replace(tr,`
`).replace(nr,`
`);let i=er.content,a=i.querySelectorAll(`br`);for(let e=0;e{if(s){let t=e.querySelector(`.quote-inline`);t&&t.remove()}}}),o=o.trim(),r?.options?.length&&(o+=`\n\n📊:\n${r.options.map(e=>`${r.multiple?`▪️`:`•`} ${e.title}`).join(`
`)}`),i?.length&&(o+=` `+i.map(e=>({image:`🖼️`,gifv:`🎞️`,video:`📹`,audio:`🎵`,unknown:``})[e.type]||``).join(``)),s){let e=ar(a.quotedStatus);o+=`\n\n❝\n${e}\n❞`}return o}var or={xs:8,s:12,m:16,l:20,xl:24,xxl:32},sr=/[^a-zA-Z0-9]/g;function cr({icon:e,size:t=`m`,alt:n,title:r,class:i=``,style:a={}}){r||=n;let{loadIcon:o,isIconLoaded:s}=ce();if(!e)return null;let c=or[t],l=he[e];if(!l)return null;let u,d,f=!1;Array.isArray(l)?[l,u,d]=l:typeof l==`object`&&({rotate:u,flip:d,rtl:f}=l,l=l.module);let p=`${ie}-title-${e}-${r?.replace(sr,`-`)}`;g(()=>{s(e)||o(e)},[e]);let m=s(e);return M(`span`,{class:`icon ${i} ${f?`rtl-flip`:``}`,style:{width:`${c}px`,height:`${c}px`,...a},"data-icon":e,title:m?void 0:r||void 0,children:m&&M(`svg`,{width:c,height:c,role:r?`img`:`presentation`,"aria-labelledby":p,style:{transform:`${u?`rotate(${u})`:``} ${d?`scaleX(-1)`:``}`},children:[r?M(`title`,{id:p,children:r}):null,M(`use`,{href:`#sprite-icon-${e}`})]})})}var Q=oe(cr,(e,t)=>e.icon===t.icon&&e.title===t.title&&e.alt===t.alt&&e.size===t.size),lr=x((e,t)=>{let n;try{n=ne()}catch{}let r=(location.hash||``).replace(/^#/,``).trim();r===``&&(r=`/`);let{to:a,...o}=e;if(r&&r!==`/`&&r.includes(`?`)){let e=URL.parse(r,location.origin);if(e?.searchParams?.size){let t=Array.from(e.searchParams.entries()).map(([e,t])=>`${e}=${encodeURIComponent(t)}`).join(`&`);r=e.pathname+`?`+t}}let s=r===a||decodeURIComponent(r)===a;return M(`a`,{ref:t,href:`#${a}`,...o,class:`${e.class||``} ${s?`is-active`:``}`,onClick:t=>{t.currentTarget?.parentNode?.closest(`a`)&&t.stopPropagation(),n&&(i.prevLocation=n),e.onClick?.(t)}})});function ur(e){let{className:t,disabled:n,...r}=e;return M(cn,{className:t,disabled:n,children:({ref:e,closeMenu:t})=>M(lr,{...r,ref:e,onClick:({detail:e})=>t(e===0?`Enter`:void 0)})})}var dr=W(e=>new Intl.RelativeTimeFormat(e||void 0));function fr(e){if(e instanceof Date)return!isNaN(e.getTime());{let t=new Date(e);return!isNaN(t.getTime())}}var pr=60,mr=60*pr,hr=24*mr,gr=e=>{let t=dr(H.locale),n=(e.getTime()-Date.now())/1e3,r=Math.abs(n);return r{let t=(Date.now()-e.getTime())/1e3;return te+1,0),i=p(()=>new Date(e),[e]),[a,o,s]=p(()=>{if(!fr(i))return[``+(typeof e==`string`?e:``),``,``];let n;if(t===`micro`){let e=new Date;n=(e.getTime()-i.getTime())/1e3/hr<=1?_r(i):e.getFullYear()===i.getFullYear()?Vn(H.locale,{year:void 0,month:`short`,day:`numeric`}).format(i):Vn(H.locale,{dateStyle:`short`}).format(i)}return n||=gr(i),[n,i.toISOString(),i.toLocaleString()]},[i,t,n]);return g(()=>{if(!fr(i))return;let e,t;function n(){t=requestAnimationFrame(()=>{r(),a()})}function a(){let t=(Date.now()-i.getTime())/1e3;t{clearTimeout(e),cancelAnimationFrame(t)}},[]),M(`time`,{datetime:o,title:s,children:a})}function yr(e){let t=r(),n=r(),{label:i,direction:a,shift:o,...s}=e,[c,l]=A(a),[u,d]=A(o);return O(()=>{n.current&&(n.current.offsetWidth>window.innerWidth*.5?(l(`bottom`),d(o||8)):(l(a),d(o)))},[a,o]),M(on,{...s,direction:c,shift:u,label:i,instanceRef:t,itemProps:{ref:n,onPointerMove:e=>{e.pointerType===`touch`&&t.current?.openMenu?.()},onPointerLeave:e=>{e.pointerType===`touch`&&t.current?.openMenu?.()},...e.itemProps}})}function br(e,t=[]){!e||typeof e!=`function`||g(()=>{let t=new CloseWatcher;return t.addEventListener(`close`,e),()=>{t.destroy()}},t)}var xr=window.CloseWatcher?br:()=>{},Sr=document.getElementById(`modal-container`);function Cr(){return getComputedStyle(document.documentElement).getPropertyValue(`--backdrop-theme-color`)}function wr({children:e,onClose:t,onClick:n,class:i,minimized:a}){if(!e)return null;let s=r();g(()=>{let e=setTimeout(()=>{let e=s.current?.querySelector(`[tabindex="-1"]`);e&&e.focus()},100);return()=>clearTimeout(e)},[]);let c=window.CloseWatcher,l=He(`esc`,()=>{setTimeout(()=>{t?.()},0)},{enabled:!c&&!!t,keydown:!1,keyup:!0,useKey:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey},[t]);xr(t,[t]),g(()=>{let t=document.querySelectorAll(`.deck-container`);if(a){let e=t[t.length-1];e&&e.tabIndex===-1&&e.focus()}else e?t.forEach(e=>{e.setAttribute(`inert`,``)}):t.forEach(e=>{e.removeAttribute(`inert`)});return()=>{t.forEach(e=>{e.removeAttribute(`inert`)})}},[e,a]);let u=r(),d=r();return O(()=>{if(e&&!a)if(ee.local.get(`theme`)){let e=Cr();u.current=document.querySelector(`meta[name="theme-color"][data-theme-setting="manual"]`),u.current&&(d.current=u.current.content,u.current.content=e),document.documentElement.style.setProperty(`--meta-theme-color`,e)}else{let e=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,t=Cr();u.current=document.querySelector(`meta[name="theme-color"][media*="${e}"]`),u.current&&(d.current=u.current.content,u.current.content=t),document.documentElement.style.setProperty(`--meta-theme-color`,t)}else u.current&&d.current&&(u.current.content=d.current),document.documentElement.style.removeProperty(`--meta-theme-color`);return()=>{u.current&&d.current&&(u.current.content=d.current),document.documentElement.style.removeProperty(`--meta-theme-color`)}},[e,a]),o(M(`div`,{ref:e=>{s.current=e,l.current=e?.querySelector?.(`[tabindex="-1"]`)||e},className:i,onClick:e=>{n?.(e),e.target===e.currentTarget&&t?.(e)},tabIndex:a?0:`-1`,inert:a,onFocus:e=>{try{if(e.target===e.currentTarget){let e=s.current?.querySelector(`[tabindex="-1"]`),t=!!e&&getComputedStyle(e)?.pointerEvents!==`none`;e&&t&&e.focus()}}catch{}},children:e}),Sr)}var Tr={s:16,m:20,l:24,xl:32,xxl:50,xxxl:64},Er=new Map,Dr=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement(`canvas`),Or=Dr.getContext(`2d`,{willReadFrequently:!0});Or.imageSmoothingEnabled=!1;var kr=typeof requestIdleCallback==`function`?e=>requestIdleCallback(e,{timeout:500}):e=>setTimeout(e,1),Ar=/missing\.png$/;function jr({url:e,staticUrl:t,size:n,alt:i=``,squircle:a,...o}){e||(e=t,t=void 0),n=Tr[n]||n||Tr.m;let s=r(),c=Ar.test(e);return M(`picture`,{ref:s,class:`avatar ${a?`squircle`:``} ${Er.get(e)?`has-alpha`:``}`,style:{width:n,height:n},title:i,...o,children:[!!t&&M(`source`,{srcset:t,media:`(prefers-reduced-motion: reduce)`}),!!e&&M(`img`,{src:e,width:n,height:n,alt:i,loading:`lazy`,decoding:`async`,fetchPriority:`low`,crossOrigin:!Er.has(e)&&!c?`anonymous`:void 0,onError:t=>{t.target.crossOrigin&&(t.target.crossOrigin=null,t.target.src=e)},onLoad:t=>{s.current&&(s.current.dataset.loaded=!0),!Er.has(e)&&(c||kr(()=>{try{let{naturalWidth:n,naturalHeight:r}=t.target,i=Math.min(1,Tr.xxxl/Math.max(n,r)),a=Math.max(1,Math.round(n*i)),o=Math.max(1,Math.round(r*i));Dr.width!==a&&(Dr.width=a),Dr.height!==o&&(Dr.height=o),Or.drawImage(t.target,0,0,a,o);let{data:c}=Or.getImageData(0,0,a,o),l=c.length/4*.1,u=0;for(let e=3;el);e+=4);let d=u>l;d&&s.current?.classList.add(`has-alpha`),Er.set(e,d)}catch{Er.set(e,!1)}}))}})]})}var Mr=W(jr),Nr=!1;new MutationObserver(e=>{e.forEach(e=>{if(e.type===`attributes`){let{dir:t}=e.target;Nr=t===`rtl`}})}).observe(document.documentElement,{attributes:!0,attributeFilter:[`dir`]});function Pr(){return Nr}function Fr(){let[e,t]=A({width:null,height:null});return O(()=>{let e=()=>{t({width:window.innerWidth,height:window.innerHeight})};return e(),window.addEventListener(`resize`,e,{passive:!0}),()=>{window.removeEventListener(`resize`,e)}},[]),e}function Ir(e){let{containerProps:t,instanceRef:n,align:i}=e,a=Fr(),o=n?.current?n:r(),s=Pr()?i===`end`?`start`:i===`start`?`end`:i:i;return M(tn,{boundingBoxPadding:Zn(),repositionFlag:`${a.width}x${a.height}`,unmountOnClose:!0,...e,align:s,instanceRef:o,containerProps:{onClick:e=>{e.target===e.currentTarget&&o.current?.closeMenu?.(),t?.onClick?.(e)},...t}})}function Lr({subMenu:e=!1,confirm:t=!0,confirmLabel:n,menuItemClassName:r,menuFooter:i,menuExtras:a,...o}){let{children:s,onClick:c,...l}=o;return t?M(e?yr:Ir,{openTrigger:`clickOnly`,direction:`bottom`,overflow:`auto`,gap:-8,shift:8,menuClassName:`menu-emphasized`,...l,menuButton:e?void 0:s,label:e?s:void 0,children:[M(Z,{className:r,onClick:c,children:n}),a,i]}):e?M(Z,{...o}):c?L(s,{onClick:c}):s}var Rr=P((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.loop=e.conditional=e.parse=void 0,e.parse=function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:r;if(Array.isArray(n))n.forEach(function(n){return e(t,n,r,i)});else if(typeof n==`function`)n(t,r,i,e);else{var a=Object.keys(n)[0];Array.isArray(n[a])?(i[a]={},e(t,n[a],r,i[a])):i[a]=n[a](t,r,i,e)}return r},e.conditional=function(e,t){return function(n,r,i,a){t(n,r,i)&&a(n,e,r,i)}},e.loop=function(e,t){return function(n,r,i,a){for(var o=[],s=n.pos;t(n,r,i);){var c={};if(a(n,e,r,c),n.pos===s)break;s=n.pos,o.push(c)}return o}}})),zr=P((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readBits=e.readArray=e.readUnsigned=e.readString=e.peekBytes=e.readBytes=e.peekByte=e.readByte=e.buildStream=void 0,e.buildStream=function(e){return{data:e,pos:0}};var t=function(){return function(e){return e.data[e.pos++]}};e.readByte=t,e.peekByte=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(t){return t.data[t.pos+e]}};var n=function(e){return function(t){return t.data.subarray(t.pos,t.pos+=e)}};e.readBytes=n,e.peekBytes=function(e){return function(t){return t.data.subarray(t.pos,t.pos+e)}},e.readString=function(e){return function(t){return Array.from(n(e)(t)).map(function(e){return String.fromCharCode(e)}).join(``)}},e.readUnsigned=function(e){return function(t){var r=n(2)(t);return e?(r[1]<<8)+r[0]:(r[0]<<8)+r[1]}},e.readArray=function(e,t){return function(r,i,a){for(var o=typeof t==`function`?t(r,i,a):t,s=n(e),c=Array(o),l=0;l{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=void 0;var t=Rr(),n=zr(),r={blocks:function(e){for(var t=0,r=[],i=e.data.length,a=0,o=(0,n.readByte)()(e);o!==t&&o;o=(0,n.readByte)()(e)){if(e.pos+o>=i){var s=i-e.pos;r.push((0,n.readBytes)(s)(e)),a+=s;break}r.push((0,n.readBytes)(o)(e)),a+=o}for(var c=new Uint8Array(a),l=0,u=0;u{Object.defineProperty(e,`__esModule`,{value:!0}),e.deinterlace=void 0,e.deinterlace=function(e,t){for(var n=Array(e.length),r=e.length/t,i=function(r,i){var a=e.slice(i*t,(i+1)*t);n.splice.apply(n,[r*t,t].concat(a))},a=[0,4,2,1],o=[8,8,4,2],s=0,c=0;c<4;c++)for(var l=a[c];l{Object.defineProperty(e,`__esModule`,{value:!0}),e.lzw=void 0,e.lzw=function(e,t,n){var r=4096,i=-1,a=n,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S=Array(n),C=Array(r),w=Array(r),T=Array(r+1);for(_=e,s=1<<_,u=s+1,o=s+2,f=i,l=_+1,c=(1<>=l,p-=l,m>o||m==u)break;if(m==s){l=_+1,c=(1<s;)T[y++]=w[m],m=C[m];v=w[m]&255,T[y++]=v,o{Object.defineProperty(e,`__esModule`,{value:!0}),e.decompressFrames=e.decompressFrame=e.parseGIF=void 0;var t=o(Br()),n=Rr(),r=zr(),i=Vr(),a=Hr();function o(e){return e&&e.__esModule?e:{default:e}}e.parseGIF=function(e){var i=new Uint8Array(e);return(0,n.parse)((0,r.buildStream)(i),t.default)};var s=function(e){for(var t=e.pixels.length,n=new Uint8ClampedArray(t*4),r=0;r{c.toBlob(e,`image/png`)});return URL.createObjectURL(d)}catch{return null}}function Gr({staticUrl:e,alt:t,url:n}){return M(`picture`,{children:[e&&M(`source`,{srcset:e,media:`(prefers-reduced-motion: reduce)`}),M(`img`,{src:n,alt:t,class:`shortcode-emoji emoji`,width:`16`,height:`16`,loading:`lazy`,decoding:`async`,fetchPriority:`low`,onLoad:e=>{try{e.target.dataset.isLarger=e.target.naturalWidth>e.target.width*2||e.target.naturalHeight>e.target.height*2}catch{}}},t||n)]})}var Kr=new se({concurrency:2,interval:1e3,intervalCap:2}),qr=(e,...t)=>Kr.add(()=>fetch(...t),{signal:e}),Jr=/(\:(\w|\+|\-)+\:)(?=|[\!\.\?]|$)/g,Yr=W(e=>RegExp(`:(${e.join(`|`)}):`,`g`)),Xr=new Map,Zr=30,Qr=async e=>{if(Xr.has(e))return Xr.get(e);try{let t=(await(await qr(null,e,{headers:{accept:`application/activity+json`},referrerPolicy:`no-referrer`})).json()).tag?.filter(e=>e.type===`Emoji`)||[],n=t.length?await Promise.all(t.map(async e=>{let t={shortcode:e.name.replace(/^:|:$/g,``),url:e.icon.url};if(e.icon?.mediaType===`image/gif`){let e=await Wr(t.url);e&&(t.staticUrl=e)}return t})):[];if(Xr.size>=Zr){let e=Xr.keys().next().value;Xr.delete(e)}return Xr.set(e,n),n}catch{return[]}},$r=W((e,t,n)=>{if(!e)return``;if(!e.includes(`:`)||!t.length)return e;let r=Yr(t.map(e=>e.shortcode));return e.split(r).map((e,r)=>{let i=t.find(t=>t.shortcode===e);if(i){let{url:t,staticUrl:a}=i;return M(Gr,{staticUrl:n?void 0:a,url:n&&a||t,alt:e},`${e}-${r}`)}return e})});function ei({text:e,emojis:t=[],staticEmoji:n,resolverURL:r}){let[i,a]=A(()=>Xr.get(r)||[]),[o,s]=A(!1);return g(()=>{if(!r||!e?.includes(`:`))return;let n=e.match(Jr);!n||!n.some(e=>{let n=e.slice(1,-1);return!t.some(e=>e.shortcode===n)})||Xr.has(r)||(s(!0),(async()=>{a(await Qr(r)),s(!1)})())},[r,e,t?.length]),e?e.includes(`:`)?r&&o?e.replace(Jr,``):$r(e,[...i.filter(e=>!t.some(t=>t.shortcode===e.shortcode)),...t],n):e:``}function ti({roles:t,accountId:n,accountUrl:r,hideSelf:i=!1}){if(!t?.length)return null;let o=n&&n===w();if(i&&o)return null;let s=a(r);return t?.map(t=>M(e,{children:[` `,M(`span`,{class:`tag collapsed tag-role`,children:[t.name,!!s&&M(e,{children:[` `,M(`span`,{class:`more-insignificant`,children:s})]})]})]}))}var ni=W(e=>{let t={sensitivity:`base`};try{return new Intl.Collator(e||void 0,t)}catch{return new Intl.Collator(void 0,t)}}),ri=/([^@]+)(@.+)/i,ii=/(\:(\w|\+|\-)+\:)(?=|[\!\.\?]|$)/g,ai=/\s+/g,oi=/[^a-z0-9@\.]/gi;function si({account:t,instance:n,showAvatar:r,showAcct:a,short:o,external:s,onClick:u}){let{i18n:d}=c();if(!t)return null;let{acct:f,avatar:p,avatarStatic:m,id:h,url:g,displayName:_,emojis:v,bot:y,username:b,roles:x}=t,[S,C,w]=f.match(ri)||[,f];n||=l().instance;let T=b.toLowerCase().trim(),E=(_||``).toLowerCase().trim(),D=E.replace(ii,``).replace(ai,``),O=D.replace(oi,``),k=!o&&(T===E||T===D||T===O||ni(d.locale).compare(T,D)===0)||O===f.toLowerCase();return M(`a`,{class:`name-text ${a?`show-acct`:``} ${o?`short`:``}`,href:g,target:s?`_blank`:null,title:_?`${_} (${w?``:`@`}${f})`:`${w?``:`@`}${f}`,onClick:e=>{if(!s&&!e.shiftKey){if(e.preventDefault(),e.stopPropagation(),u)return u(e);if(e.metaKey||e.ctrlKey||e.shiftKey||e.which===2){let e=`#/${n}/a/${h}`;window.open(e,`_blank`);return}i.showAccount={account:t,instance:n}}},children:[r&&M(e,{children:[M(Mr,{url:m||p,squircle:y}),` `]}),_&&!o?M(e,{children:[M(`b`,{dir:`auto`,children:M(ei,{text:_,emojis:v,resolverURL:t.url,staticEmoji:!0})}),!a&&!k&&M(e,{children:[` `,M(`i`,{class:`bidi-isolate`,children:[`@`,b]}),M(ti,{roles:x,accountId:h,accountUrl:g,hideSelf:!0})]})]}):M(o?`i`:`b`,{children:b}),a&&M(e,{children:[M(`br`,{}),M(`i`,{class:`bidi-isolate`,children:[w?``:`@`,C,!!w&&M(`span`,{class:`ib`,children:w})]}),M(ti,{roles:x,accountUrl:g})]})]})}function ci(e,t,n,i){var a=this,o=r(null),s=r(0),c=r(0),l=r(null),u=r([]),d=r(),f=r(),m=r(e),h=r(!0),_=r(),v=r();m.current=e;var y=typeof window<`u`,b=!t&&t!==0&&y;if(typeof e!=`function`)throw TypeError(`Expected a function`);t=+t||0;var x=!!(n||={}).leading,S=!(`trailing`in n)||!!n.trailing,C=!!n.flushOnExit&&S,w=`maxWait`in n,T=`debounceOnServer`in n&&!!n.debounceOnServer,E=w?Math.max(+n.maxWait||0,t):null,D=p(function(){var e=function(e){var t=u.current,n=d.current;return u.current=d.current=null,s.current=e,c.current=c.current||e,f.current=m.current.apply(n,t)},n=function(e,t){b&&cancelAnimationFrame(l.current),l.current=b?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!h.current)return!1;var n=e-o.current;return!o.current||n>=t||n<0||w&&e-s.current>=E},p=function(t){return l.current=null,S&&u.current?e(t):(u.current=d.current=null,f.current)},g=function e(){var i=Date.now();if(x&&c.current===s.current&&D(),r(i))return p(i);if(h.current){var a=t-(i-o.current);n(e,w?Math.min(a,E-(i-s.current)):a)}},D=function(){i&&i({})},O=function(){if(y||T){var i,c=Date.now(),p=r(c);if(u.current=[].slice.call(arguments),d.current=a,o.current=c,C&&!_.current&&(_.current=function(){globalThis.document?.visibilityState===`hidden`&&v.current.flush()},(i=globalThis.document)==null||i.addEventListener==null||i.addEventListener(`visibilitychange`,_.current)),p){if(!l.current&&h.current)return s.current=o.current,n(g,t),x?e(o.current):f.current;if(w)return n(g,t),e(o.current)}return l.current||n(g,t),f.current}};return O.cancel=function(){var e=l.current;e&&(b?cancelAnimationFrame(l.current):clearTimeout(l.current)),s.current=0,u.current=o.current=d.current=l.current=null,e&&i&&i({})},O.isPending=function(){return!!l.current},O.flush=function(){return l.current?p(Date.now()):f.current},O},[x,w,t,E,S,C,b,y,T,i]);return v.current=D,g(function(){return h.current=!0,function(){var e;C&&v.current.flush(),_.current&&=((e=globalThis.document)==null||e.removeEventListener==null||e.removeEventListener(`visibilitychange`,_.current),null),h.current=!1}},[C]),D}function li(e,t){return e===t}function ui(e,t,n){var i=n&&n.equalityFn||li,a=r(e),o=A({})[1],s=ci(_(function(e){a.current=e,o({})},[o]),t,n,o),c=r(e);return i(c.current,e)||(s(e),c.current=e),[a.current,s]}function di(e,t,n){var r=n===void 0?{}:n,i=r.leading,a=r.trailing,o=r.flushOnExit;return ci(e,t,{maxWait:t,leading:i===void 0||i,trailing:a===void 0||a,flushOnExit:o!==void 0&&o})}var fi={ab:`Аҧсшәа`,ace:`Acèh`,ach:`Lëbacoli`,aa:`Afár`,af:`Afrikaans`,sq:`Shqip`,alz:`Dhalur`,am:`አማርኛ`,ar:`العربية`,hy:`Հայերեն`,as:`অসমীয়া`,av:`Авар мацӀ`,awa:`अवधी`,ay:`Aymar aru`,az:`Azərbaycanca`,ban:`Basa Bali`,bal:`بلوچی`,bm:`Bamanankan`,bci:`Baoulé`,ba:`Башҡортса`,eu:`Euskara`,btx:`Batak Karo`,bts:`Batak Simalungun`,bbc:`Batak Toba`,be:`Беларуская`,bem:`Ichibemba`,bn:`বাংলা`,bew:`Betawi`,bho:`भोजपुरी`,bik:`Bikol`,bs:`Bosanski`,br:`Brezhoneg`,bg:`Български`,bua:`Буряад`,yue:`粵語`,ca:`Català`,ceb:`Cebuano`,ch:`Chamoru`,ce:`Нохчийн мотт`,ny:`Chichewa`,"zh-CN":`简体中文`,"zh-TW":`繁體中文`,chk:`Kapasen Chuuk`,cv:`Чӑвашла`,co:`Corsu`,crh:`Qırımtatarca (Кирилл)`,"crh-Latn":`Qırımtatarca (Latin)`,hr:`Hrvatski`,cs:`Čeština`,da:`Dansk`,"fa-AF":`درى`,dv:`ދިވެހި`,din:`Thuɔŋjäŋ`,doi:`डोगरी`,dov:`Dombe`,nl:`Nederlands`,dyu:`Jula`,dz:`རྫོང་ཁ`,en:`English`,eo:`Esperanto`,et:`Eesti`,ee:`Eʋegbe`,fo:`Føroyskt`,fj:`Vosa Vakaviti`,tl:`Tagalog`,fi:`Suomi`,fon:`Fon`,fr:`Français`,"fr-CA":`Français (Canada)`,fy:`Frysk`,fur:`Furlan`,ff:`Fulfulde`,gaa:`Gã`,gl:`Galego`,ka:`ქართული`,de:`Deutsch`,el:`Ελληνικά`,gn:`Avañe'ẽ`,gu:`ગુજરાતી`,ht:`Kreyòl ayisyen`,cnh:`Hakha Chin`,ha:`Hausa`,haw:`ʻŌlelo Hawaiʻi`,iw:`עברית`,hil:`Hiligaynon`,hi:`हिन्दी`,hmn:`Hmoob`,hu:`Magyar`,hrx:`Hunsrik`,iba:`Iban`,is:`Íslenska`,ig:`Igbo`,ilo:`Iloko`,id:`Bahasa Indonesia`,"iu-Latn":`Inuktitut (Latin)`,iu:`ᐃᓄᒃᑎᑐᑦ`,ga:`Gaeilge`,it:`Italiano`,jam:`Patwa`,ja:`日本語`,jw:`Basa Jawa`,kac:`Jinghpaw`,kl:`Kalaallisut`,kn:`ಕನ್ನಡ`,kr:`Kanuri`,pam:`Kapampangan`,kk:`Қазақша`,kha:`Khasi`,km:`ភាសាខ្មែរ`,cgg:`Rukiga`,kg:`Kikongo`,rw:`Kinyarwanda`,ktu:`Kituba`,trp:`Kokborok`,kv:`Коми кыв`,gom:`कोंकणी`,ko:`한국어`,kri:`Krio`,ku:`Kurdî (Kurmancî)`,ckb:`کوردی (سۆرانی)`,ky:`Кыргызча`,lo:`ລາວ`,ltg:`Latgaļu`,la:`Latina`,lv:`Latviešu`,lij:`Ligure`,li:`Limburgs`,ln:`Lingála`,lt:`Lietuvių`,lmo:`Lombard`,lg:`Luganda`,luo:`Dholuo`,lb:`Lëtzebuergesch`,mk:`Македонски`,mad:`Madhurâ`,mai:`मैथिली`,mak:`Makassar`,mg:`Malagasy`,ms:`Bahasa Melayu`,"ms-Arab":`بهاس ملايو`,ml:`മലയാളം`,mt:`Malti`,mam:`Mam`,gv:`Gaelg`,mi:`Te Reo Māori`,mr:`मराठी`,mh:`Kajin M̧ajeļ`,mwr:`मारवाड़ी`,mfe:`Kreol Morisien`,chm:`Олык марий`,"mni-Mtei":`ꯃꯤꯇꯩꯂꯣꯟ`,min:`Baso Minang`,lus:`Mizo ṭawng`,mn:`Монгол`,my:`မြန်မာစာ`,nhe:`Náhuatl`,"ndc-ZW":`Ndau`,nr:`isiNdebele`,new:`नेपाल भाषा`,ne:`नेपाली`,"bm-Nkoo":`ߒߞߏ`,no:`Norsk`,nus:`Thok Nath`,oc:`Occitan`,or:`ଓଡ଼ିଆ`,om:`Afaan Oromoo`,os:`Ирон æвзаг`,pag:`Pangasinan`,pap:`Papiamentu`,ps:`پښتو`,fa:`فارسی`,pl:`Polski`,pt:`Português (Brasil)`,"pt-PT":`Português (Portugal)`,pa:`ਪੰਜਾਬੀ`,"pa-Arab":`پنجابی`,qu:`Runa Simi`,kek:`Qʼeqchiʼ`,rom:`Romani čhib`,ro:`Română`,rn:`Ikirundi`,ru:`Русский`,se:`Davvisámegiella`,sm:`Gagana Samoa`,sg:`Sängö`,sa:`संस्कृतम्`,"sat-Latn":`Santali (Latin)`,sat:`ᱥᱟᱱᱛᱟᱲᱤ`,gd:`Gàidhlig`,nso:`Sepedi`,sr:`Српски`,st:`Sesotho`,crs:`Kreol seselwa`,shn:`လိၵ်ႈတႆး`,sn:`chiShona`,scn:`Sicilianu`,szl:`Ślōnskŏ`,sd:`سنڌي`,si:`සිංහල`,sk:`Slovenčina`,sl:`Slovenščina`,so:`Soomaali`,es:`Español`,su:`Basa Sunda`,sus:`Susu`,sw:`Kiswahili`,ss:`siSwati`,sv:`Svenska`,ty:`Reo Tahiti`,tg:`Тоҷикӣ`,"ber-Latn":`Tamazight (Latin)`,ber:`ⵜⴰⵎⴰⵣⵉⵖⵜ`,ta:`தமிழ்`,tt:`Татарча`,te:`తెలుగు`,tet:`Tetun`,th:`ไทย`,bo:`བོད་ཡིག`,ti:`ትግርኛ`,tiv:`Tiv`,tpi:`Tok Pisin`,to:`Lea fakatonga`,lua:`Tshiluba`,ts:`Xitsonga`,tn:`Setswana`,tcy:`ತುಳು`,tum:`chiTumbuka`,tr:`Türkçe`,tk:`Türkmençe`,tyv:`Тыва дыл`,ak:`Akankasa`,udm:`Удмурт кыл`,uk:`Українська`,ur:`اردو`,ug:`ئۇيغۇرچە`,uz:`Oʻzbekcha`,ve:`Tshivenḓa`,vec:`Vèneto`,vi:`Tiếng Việt`,war:`Winaray`,cy:`Cymraeg`,wo:`Wolof`,xh:`isiXhosa`,sah:`Саха тыла`,yi:`ייִדיש`,yo:`Yorùbá`,yua:`Màaya T'àan`,zap:`Didxazá`,zu:`isiZulu`},pi={"zh-YUE":`YUE`,zh_HANT:`zh-Hant`,mnMong:`mn-Mong`},mi=W(e=>new Intl.DisplayNames(e||void 0,{type:`language`}));function hi(e,t){return!e||!t?e!==t:e.toLowerCase()!==t.toLowerCase()}function gi(e){let t,n;typeof e==`object`&&({code:e,locale:t,fallback:n}=e);try{let r=mi(t||H.locale).of(e);if(hi(r,e))return r;if(!n){let n=mi(e).of(e);if(hi(n,e))return n;let r=fi?.[t];if(hi(r,e))return r}return n||``}catch{if(pi[e])try{let r=mi(pi[t]||t||H.locale).of(pi[e]);return hi(r,pi[e])?r:n||``}catch{}return n||``}}var _i=W(gi),vi={sl:{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`},tl:{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`},al:{}},yi=Object.entries(vi.tl).map(([e,{name:t}])=>({code:e,name:t})),bi=[...navigator.languages],xi=Ln();xi&&!bi.includes(xi)&&bi.unshift(xi);var Si=()=>B(bi,yi.map(e=>e.code.replace(`_`,`-`)),`en`);function Ci(e=!1){if(e){let{contentTranslationTargetLanguage:e}=i.settings;if(e)return e}return Si()}var wi=W((e,t)=>{try{return new Intl.NumberFormat(e||void 0,t)}catch{return new Intl.NumberFormat(void 0,t)}}),Ti=[`byte`,`kilobyte`,`megabyte`,`gigabyte`,`terabyte`,`petabyte`];function Ei(e){let t=Math.min(Math.floor(Math.log2(e)/10),Ti.length-1),n=e/1024**t;return wi(H.locale,{style:`unit`,unit:Ti[t],unitDisplay:`narrow`,maximumFractionDigits:0}).format(n)}function Di(){return d()?.mastodon>=7}function Oi(e){return e?.[e?.currentUser]?.[0]||`nobody`}var ki=/[.*+?^${}()|[\]\\]/g,Ai={"&":`&`,'"':`"`,"<":`<`,">":`>`},ji=/[&"<>]/g;function Mi(e){return e.replace(ki,`\\$&`)}function Ni(e){return e.replace(ji,e=>Ai[e])}function Pi(e,t=[]){if(!e)return``;if(!t.length||!e.includes(`:`))return e;let n=new Map;for(let e=0;e`:${Mi(e)}:`).join(`|`),i=new RegExp(r,`g`);return e.replace(i,e=>{let t=e.slice(1,-1),r=n.get(t);if(!r)return e;let{staticUrl:i,url:a}=r,o=Ni(e);return`${i?``:``}
`})}var Fi=/[&<>"']/g,Ii={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function Li(e){return e.replace(Fi,e=>Ii[e])}var Ri=document.createElement(`div`),zi=[`u-url`,`mention`,`hashtag`],Bi=/{}}=t,a=e,o=$i(a,r),s=Bi.test(a),c=a.includes("```");if(s){let e=o.querySelectorAll(`a:not([target="_blank"])`);for(let t of e)t.setAttribute(`target`,`_blank`);let t=o.querySelectorAll(`a[class]`);for(let e of t)for(let t of e.classList)zi.includes(t)||e.classList.remove(t)}if(s){let e=o.querySelectorAll(`a[href]`);for(let t of e)Vi.test(t.textContent.trim())&&(t.classList.add(`has-url-text`),aa(t))}if(s){let e=o.querySelectorAll(`a[href]`),t=[];for(let n of e){let e=n.innerText.trim(),r=n.querySelector(`*`);if(Hi.test(e)){let i=e[0],[a,o,s]=e.split(/[@@]/);r||(!t.some(([e])=>e===o)||t.some(([e,t])=>e===o&&t===s)?(n.innerHTML=`${i}${o}`,t.push([o,s])):n.innerHTML=`${i}${o}@${s}`),n.classList.add(`mention`)}if(Ui.test(e)){let t=e[0];r?Wi.test(e)&&(n.innerHTML=`#️⃣${e.replace(Wi,``)}`):n.innerHTML=`${t}${e.slice(1)}`,n.classList.add(`mention`,`hashtag`)}}}let l;if(a.includes(`:`)&&n?.length){l=oa(o);for(let e of l){let t=Li(e.nodeValue);t=Pi(t,n),Ri.innerHTML=t,e.replaceWith(...Ri.childNodes)}}if(c){let e=[...o.querySelectorAll(`p`)].filter(e=>Gi.test(e.innerText.trim()));for(let t of e){let e=document.createElement(`pre`);for(let e of t.querySelectorAll(`br`))e.replaceWith(`
`);e.innerHTML=`${t.innerHTML.trim()}`,t.replaceWith(e)}}if(c){let e=[...o.querySelectorAll(`p`)].filter(e=>Ki.test(e.innerText));for(let t of e){let e=[t],n=!1,r=t;for(;r.nextElementSibling;){let t=r.nextElementSibling;if(t&&t.tagName===`P`)if(qi.test(t.innerText)){e.push(t),n=!0;break}else e.push(t);else break;r=t}if(n){let n=document.createElement(`pre`);for(let t of e)for(let e of t.querySelectorAll(`br`))e.replaceWith(`
`);n.innerHTML=`${e.map(e=>e.innerHTML).join(`
`)}`,t.replaceWith(n);for(let t of e)t.remove()}}}if(a.includes("`")){l=oa(o);for(let e of l){let t=Li(e.nodeValue);Ji.test(t)&&(t=t.replaceAll(Qi,`$1`)),Ri.innerHTML=t,e.replaceWith(...Ri.childNodes)}}if(Yi.test(a)){l=oa(o,{rejectFilter:[`A`]});for(let e of l){let t=Li(e.nodeValue);Xi.test(t)&&(t=t.replaceAll(Zi,`$1`)),Ri.innerHTML=t,e.replaceWith(...Ri.childNodes)}}if(a.includes(`#`)||a.includes(`#`)){let e=null,t=[...o.querySelectorAll(`p`)].filter((t,n)=>{let r=0;for(let e=0;e3||r>1&&e&&n===e+1)return e=n,!0});if(t?.length)for(let e of t)e.classList.add(`hashtag-stuffing`),e.title=e.innerText}if(a.includes(`
i(o)),r?o:o.innerHTML}var ta=W(ea),na=Object.fromEntries([`STYLE`,`IMG`,`VIDEO`,`AUDIO`,`AREA`,`MAP`,`TRACK`,`EMBED`,`IFRAME`,`OBJECT`,`PICTURE`,`PORTAL`,`SOURCE`,`SVG`,`MATH`,`CANVAS`,`NOSCRIPT`,`SCRIPT`,`INPUT`,`OPTION`,`TEXTAREA`,`SLOT`,`TEMPLATE`].map(e=>[e,!0])),ra=/^(https?:\/\/(www\.)?|xmpp:)/,ia=30;function aa(e){if(!(!e||e.querySelector?.(`*`)))try{let t=e.innerText.trim(),n=(t.match(ra)||[])[0]||``;if(!n)return;let r=t.slice(n.length,n.length+ia),i=t.slice(n.length+ia);e.innerHTML=`${n}ia?`ellipsis`:``}>${r}${i}`}catch{}}function oa(e,t={}){let n=[],r=Object.assign({},na,t.rejectFilter?.reduce((e,t)=>(e[t]=!0,e),{})),i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(e){return r[e.parentNode.nodeName]?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}},!1),a;for(;a=i.nextNode();)n.push(a);return n}var sa=window.matchMedia(`(hover: hover)`).matches;function ca(e){let{mentions:t=[],instance:n,previewMode:r,statusURL:a}=e||{};return e=>{if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.which===2)return;let{target:o}=e;if(o.closest(`.shortcode-emoji`)){let{naturalWidth:t,naturalHeight:n,width:r,height:a}=o;if(t>r*2||n>a*2){e.preventDefault(),e.stopPropagation(),i.showMediaModal={mediaAttachments:[{type:`image`,url:o.src,description:o.title||o.alt}]};return}}if(o=o.closest(`a`),!o||!e.currentTarget.contains(o))return;let{href:s}=o,c=o.previousSibling?.textContent,l=c?.endsWith(`@`)||c?.endsWith(`@`),u=o.innerText.startsWith(`@`)||o.innerText.startsWith(`@`);if((o.classList.contains(`u-url`)||o.classList.contains(`mention`))&&u||l&&!u){let r=(o.querySelector(`span`)||o).innerText.trim(),a=r.replace(/^[@@]/,``),c=t.find(e=>e.url===s)||t.find(e=>e.acct===a||e.username===a);if(c){e.preventDefault(),e.stopPropagation(),i.showAccount={account:c.acct,instance:n};return}else if(!/^http/i.test(r)){e.preventDefault(),e.stopPropagation(),i.showAccount={account:s,instance:n};return}}else if(!r){let t=c?.endsWith(`#`)||c?.endsWith(`#`);if(o.classList.contains(`hashtag`)||t){e.preventDefault(),e.stopPropagation();let t=o.innerText.replace(/^[##]/,``).trim(),r=n?`#/${n}/t/${t}`:`#/t/${t}`;location.hash=r;return}else if(i.unfurledLinks[s]?.url&&a!==s){e.preventDefault(),e.stopPropagation(),i.prevLocation={pathname:location.hash.replace(/^#/,``)},location.hash=`#${i.unfurledLinks[s].url}`;return}}try{let t=URL.parse(s).hostname.replace(/^www\./i,``);!o.innerText.toLowerCase().includes(t.toLowerCase())&&!sa&&(e.preventDefault(),e.stopPropagation(),i.showOpenLink={url:s,linkText:o.innerText.trim()})}catch{}}}function la(e){try{return wi(H.locale,{notation:`compact`,roundingMode:`floor`}).format(e)}catch{return e}}var ua={"@mastodon/list-exclusive":`>=4.2`,"@gotosocial/list-exclusive":`>=0.17`,"@gotosocial/edit-media-attributes":`>=0.18`,"@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`},da=/pixelfed/i,fa=/^(?!.*pixelfed).*$/i,pa={"@mastodon/lists":fa,"@mastodon/filters":fa,"@mastodon/mentions":fa,"@mastodon/trending-hashtags":fa,"@mastodon/trending-links":fa,"@mastodon/post-bookmark":fa,"@mastodon/post-edit":fa,"@mastodon/profile-edit":fa,"@mastodon/profile-private-note":fa,"@mastodon/pinned-posts":fa,"@pixelfed/trending":da,"@pixelfed/home-include-reblogs":da,"@pixelfed/global-feed":da,"@pleroma/local-visibility-post":/pleroma/i,"@akkoma/local-visibility-post":/akkoma/i},ma={},ha=/^\d+\.\d+(\.\d+)?/,ga=/^@([a-z]+)\//i;function _a(e){try{let{version:t,domain:n}=R(),r=ue()?.software?.name||`mastodon`;r===`hometown`&&(r=`mastodon`);let i=`${n}-${e}`;if(ma[i])return ma[i];if(pa[e])return ma[i]=pa[e].test(t);let a=e.match(ga);if(!a){let t=e.replace(/^@/,``);return ma[i]=r===t}let o=ua[e];if(!o)return!1;let s=a[1]===r.toLowerCase(),c=I(t,o,{includePrerelease:!0,loose:!0});if(!c)try{c=I(t.match(ha)?.[0],o,{includePrerelease:!0,loose:!1})}catch{}return ma[i]=s&&c}catch{return!1}}function va({skeleton:t,account:n,avatarSize:r=`xl`,avatarDescription:a,useAvatarStatic:o=!1,instance:s,external:l,internal:u,onClick:d,showActivity:f=!1,showStats:p=!1,accountInstance:m,hideDisplayName:h=!1,relationship:g={},excludeRelationshipAttrs:_=[]}){let{_:v}=c();if(t)return M(`div`,{class:`account-block skeleton`,children:[M(Mr,{size:r}),M(`span`,{children:[M(`b`,{children:`████████`}),M(`br`,{}),M(`span`,{class:`account-block-acct`,children:`██████`})]})]});if(!n)return null;let{id:y,acct:b,avatar:x,avatarStatic:S,displayName:C,username:w,emojis:T,url:E,statusesCount:O,lastStatusAt:k,bot:ee,fields:A,note:te,group:j,followersCount:N,createdAt:P,locked:ne,roles:re}=n,[F,I,L]=b.match(/([^@]+)(@.+)/i)||[,b];m&&(L=`@${m}`);let R=A?.find(e=>!!e.verifiedAt&&!!e.value),ie={};for(let e in g)_.includes(e)||(ie[e]=g[e]);let z=ie.following||ie.followedBy||ie.requested;return M(`a`,{class:`account-block`,href:E,target:l?`_blank`:null,title:L?b:`@${b}`,onClick:e=>{if(!l){if(e.preventDefault(),d)return d(e);u?location.hash=`/${s}/a/${y}`:i.showAccount={account:n,instance:s}}},children:[M(`div`,{class:`avatar-container`,children:M(Mr,{url:o?S:x||S,staticUrl:o?void 0:S,size:r,squircle:ee,alt:a||``})}),M(`span`,{class:`account-block-content`,children:[!h&&M(e,{children:C?M(`b`,{children:M(ei,{text:C,emojis:T,resolverURL:E})}):M(`b`,{children:w})}),` `,M(`span`,{class:`account-block-acct bidi-isolate`,children:[L?``:`@`,I,M(`wbr`,{}),L,ne&&M(e,{children:[` `,M(Q,{icon:`lock`,size:`s`,alt:v({id:`G2fuEb`})})]})]}),M(ti,{roles:re,accountUrl:E}),f&&M(`div`,{class:`account-block-stats`,children:[M(D,{id:`ajzDof`,values:{0:la(O)}}),!!k&&M(e,{children:[` `,`·`,` `,M(D,{id:`f8bJ3C`,values:{0:Hn(k,{hideTime:!0})}})]})]}),p&&M(`div`,{class:`account-block-stats`,children:[ee&&M(e,{children:M(`span`,{class:`tag collapsed`,children:[M(Q,{icon:`bot`}),` `,M(D,{id:`9Vdq-j`})]})}),!!j&&M(e,{children:M(`span`,{class:`tag collapsed`,children:[M(Q,{icon:`group`}),` `,M(D,{id:`L8fEEm`})]})}),z&&M(`div`,{class:`shazam-container-horizontal`,children:M(`div`,{class:`shazam-container-inner`,children:ie.following&&ie.followedBy?M(`span`,{class:`tag minimal`,children:M(D,{id:`7oRLbi`})}):ie.requested?M(`span`,{class:`tag minimal`,children:M(D,{id:`Yx0Ud8`})}):ie.following?M(`span`,{class:`tag minimal`,children:M(D,{id:`y6sq5j`})}):ie.followedBy?M(`span`,{class:`tag minimal`,children:M(D,{id:`p3UO_y`})}):null})},g.id),!!N&&M(`span`,{class:`ib`,children:M(D,{id:`Mn1E9C`,values:{followersCount:N}})}),!!R&&M(`span`,{class:`verified-field`,children:[M(Q,{icon:`check-circle`,size:`s`,alt:v({id:`QDEWii`})}),` `,M(`span`,{dangerouslySetInnerHTML:{__html:ta(R.value,{emojis:T})}})]}),!ee&&!j&&!z&&!N&&!R&&!!P&&M(`span`,{class:`created-at`,children:M(D,{id:`PCcEFZ`,values:{0:Hn(P,{hideTime:!0})},components:{0:M(`time`,{datetime:P})}})})]})]})]})}async function ya(e,t={}){if(!e?.length)return;let{masto:n}=l(),r=w(),i=e.reduce((e,n)=>(!e.includes(n.id)&&!t[n.id]&&n.id!==r&&e.push(n.id),e),[]);if(!i.length)return null;try{return(await n.v1.accounts.relationships.fetch({id:i})).reduce((e,t)=>(e[t.id]=t,e),{})}catch{return null}}function ba(e,t){return()=>wi(H.locale,{style:`unit`,unit:t,unitDisplay:`long`}).format(e)}var xa=Object.prototype.toString,Sa=e=>xa.call(e)===`[object Error]`,Ca=new Set([`network error`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`,`fetch failed`,`terminated`,` A network error occurred.`,`Network connection lost`]);function wa(e){if(!(e&&Sa(e)&&e.name===`TypeError`&&typeof e.message==`string`))return!1;let{message:t,stack:n}=e;return t===`Load failed`||t.startsWith(`Load failed (`)&&t.endsWith(`)`)?n===void 0||`__sentry_captured__`in e:t.startsWith(`error sending request for url`)||t===`Failed to fetch`||t.startsWith(`Failed to fetch (`)&&t.endsWith(`)`)?!0:Ca.has(t)}function Ta(e){if(typeof e==`number`){if(e<0)throw TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(e))throw TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(e!==void 0)throw TypeError("Expected `retries` to be a number or Infinity.")}function Ea(e,t,{min:n=0,allowInfinity:r=!1}={}){if(t!==void 0){if(typeof t!=`number`||Number.isNaN(t))throw TypeError(`Expected \`${e}\` to be a number${r?` or Infinity`:``}.`);if(!r&&!Number.isFinite(t))throw TypeError(`Expected \`${e}\` to be a finite number.`);if(t{let i=()=>{clearTimeout(a),t.signal?.removeEventListener(`abort`,i),r(t.signal.reason)},a=setTimeout(()=>{t.signal?.removeEventListener(`abort`,i),n()},e);t.unref&&a.unref?.(),t.signal?.addEventListener(`abort`,i,{once:!0})})}async function Ma({error:e,attemptNumber:t,retriesConsumed:n,startTime:r,options:i}){let a=e instanceof Error?e:TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(a instanceof Oa)throw a.originalError;let o=Number.isFinite(i.retries)?Math.max(0,i.retries-n):i.retries,s=i.maxRetryTime??1/0,c=ka(n,i);if(Aa(r,s)<=0){let e=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:0});throw await i.onFailedAttempt(e),a}let l=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:o>0?c:0}),u=await i.shouldConsumeRetry(l),d=u&&o>0?c:0,f=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:d});if(await i.onFailedAttempt(f),Aa(r,s)<=0||Aa(r,s)<=0||o<=0||a instanceof TypeError&&!wa(a)||!await i.shouldRetry(f))throw a;let p=Aa(r,s);if(p<=0)throw a;if(!u)return i.signal?.throwIfAborted(),!1;let m=Math.min(d,p);return i.signal?.throwIfAborted(),await ja(m,i),i.signal?.throwIfAborted(),!0}async function Na(e,t={}){if(t={...t},Ta(t.retries),Object.hasOwn(t,`forever`))throw Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");t.retries??=10,t.factor??=2,t.minTimeout??=1e3,t.maxTimeout??=1/0,t.maxRetryTime??=1/0,t.randomize??=!1,t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.shouldConsumeRetry??=()=>!0,Da(`onFailedAttempt`,t.onFailedAttempt),Da(`shouldRetry`,t.shouldRetry),Da(`shouldConsumeRetry`,t.shouldConsumeRetry),Ea(`factor`,t.factor,{min:0,allowInfinity:!1}),Ea(`minTimeout`,t.minTimeout,{min:0,allowInfinity:!1}),Ea(`maxTimeout`,t.maxTimeout,{min:0,allowInfinity:!0}),Ea(`maxRetryTime`,t.maxRetryTime,{min:0,allowInfinity:!0}),t.factor>0||(t.factor=1),t.signal?.throwIfAborted();let n=0,r=0,i=performance.now();for(;!Number.isFinite(t.retries)||r<=t.retries;){n++;try{t.signal?.throwIfAborted();let r=await e(n);return t.signal?.throwIfAborted(),r}catch(e){await Ma({error:e,attemptNumber:n,retriesConsumed:r,startTime:i,options:t})&&r++}}throw Error(`Retry attempts exhausted without throwing an error.`)}var Pa=`LanguageDetector`in self,Fa=Pa&&`Translator`in self,Ia;Pa&&(async()=>{try{let e=await LanguageDetector.availability();if(e===`unavailable`)return;e===`available`?Ia=await LanguageDetector.create():(Ia=await LanguageDetector.create({monitor(e){e.addEventListener(`downloadprogress`,e=>{})}}),await Ia.ready)}catch{}})();var La=async(e,t,n)=>{let r;if(t===`auto`){if(!Ia?.detect)return{error:`No language detector`};try{t=(await Ia.detect(e))[0].detectedLanguage,r=t}catch(e){return{error:e}}}let i=`💬 BROWSER TRANSLATE ${e}`;console.groupCollapsed(i);try{let a=await Translator.availability({sourceLanguage:t,targetLanguage:n});if(a===`unavailable`)return console.groupEnd(i),{error:`Unsupported language pair: ${t} -> ${n}`};let o;a===`available`?o=await Translator.create({sourceLanguage:t,targetLanguage:n}):(o=await Translator.create({sourceLanguage:t,targetLanguage:n,monitor(e){e.addEventListener(`downloadprogress`,e=>{})}}),await o.ready);let s=await o.translate(e);return console.groupEnd(i),{content:s,detectedSourceLanguage:r,provider:`browser`}}catch(e){return console.groupEnd(i),{error:e}}},Ra=Object.defineProperty,za=(e,t,n)=>t in e?Ra(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ba=(e,t,n)=>za(e,typeof t==`symbol`?t:t+``,n),Va=new Map,Ha=new WeakMap,Ua=0,Wa;function Ga(e){return e?Ha.has(e)?Ha.get(e):(Ua+=1,Ha.set(e,Ua.toString()),Ha.get(e)):`0`}function Ka(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t===`root`?Ga(e.root):e[t]}`).toString()}function qa(e){let t=Ka(e),n=Va.get(t);if(!n){let r=new Map,i,a=new IntersectionObserver(t=>{t.forEach(t=>{let n=t.isIntersecting&&i.some(e=>t.intersectionRatio>=e);e.trackVisibility&&t.isVisible===void 0&&(t.isVisible=n),[...r.get(t.target)??[]].forEach(e=>{e(n,t)})})},e);i=a.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:a,elements:r},Va.set(t,n)}return n}function Ja(e,t,n={},r=Wa){if(window.IntersectionObserver===void 0&&r!==void 0){let i=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:typeof n.threshold==`number`?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}let{id:i,observer:a,elements:o}=qa(n),s=o.get(e)||[];return o.has(e)||o.set(e,s),s.push(t),a.observe(e),function(){s.splice(s.indexOf(t),1),s.length===0&&(o.delete(e),a.unobserve(e)),o.size===0&&(a.disconnect(),Va.delete(i))}}function Ya(e){return typeof e.children!=`function`}var Xa=class extends j{constructor(e){super(e),Ba(this,`node`,null),Ba(this,`_unobserveCb`,null),Ba(this,`lastInView`),Ba(this,`handleNode`,e=>{this.node&&(this.unobserve(),!e&&!this.props.triggerOnce&&!this.props.skip&&(this.setState({inView:!!this.props.initialInView,entry:void 0}),this.lastInView=this.props.initialInView)),this.node=e||null,this.observeNode()}),Ba(this,`handleChange`,(e,t)=>{let n=this.lastInView;this.lastInView=e,!(n===void 0&&!e)&&(e&&this.props.triggerOnce&&this.unobserve(),Ya(this.props)||this.setState({inView:e,entry:t}),this.props.onChange&&this.props.onChange(e,t))}),this.state={inView:!!e.initialInView,entry:void 0},this.lastInView=e.initialInView}componentDidMount(){this.unobserve(),this.observeNode()}componentDidUpdate(e){(e.rootMargin!==this.props.rootMargin||e.root!==this.props.root||e.threshold!==this.props.threshold||e.skip!==this.props.skip||e.trackVisibility!==this.props.trackVisibility||e.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve()}observeNode(){if(!this.node||this.props.skip)return;let{threshold:e,root:t,rootMargin:n,trackVisibility:r,delay:i,fallbackInView:a}=this.props;this.lastInView===void 0&&(this.lastInView=this.props.initialInView),this._unobserveCb=Ja(this.node,this.handleChange,{threshold:e,root:t,rootMargin:n,trackVisibility:r,delay:i},a)}unobserve(){this._unobserveCb&&=(this._unobserveCb(),null)}render(){let{children:e}=this.props;if(typeof e==`function`){let{inView:t,entry:n}=this.state;return e({inView:t,entry:n,ref:this.handleNode})}let{as:t,triggerOnce:n,threshold:r,root:i,rootMargin:a,onChange:o,skip:s,trackVisibility:c,delay:l,initialInView:u,fallbackInView:d,...f}=this.props;return le(t||`div`,{ref:this.handleNode,...f},e)}},Za=(`useInsertionEffect`in h?U:void 0)??O??g,Qa=(e,{threshold:t,root:n,rootMargin:i,trackVisibility:a,delay:o,triggerOnce:s,skip:c}={})=>{let l=r(e),u=r(null),d=r(void 0),f=r(void 0);return Za(()=>{l.current=e},[e]),_(e=>{let r=()=>{if(d.current){let e=d.current;d.current=void 0,e()}};if(e===u.current)return d.current;if(!e||c){r(),u.current=null,f.current=void 0;return}r(),u.current=e;let p=!1,m=Ja(e,(e,t)=>{let n=f.current;f.current=e,!(n===void 0&&!e)&&(l.current(e,t),s&&e&&h())},{threshold:t,root:n,rootMargin:i,trackVisibility:a,delay:o});function h(){p||(p=!0,m(),u.current=null,d.current=void 0,f.current=void 0)}return d.current=h,d.current},[Array.isArray(t)?t.toString():t,n,i,a,o,s,c])},$a=48,eo={};function to({id:e,children:t}){let n=r(),[i,a]=A(!!eo[e]),o=Qa(_(t=>{t&&n.current&&(n.current.hidden=!1,e&&(eo[e]=!0))},[e]),{rootMargin:`-${$a}px 0px 0px 0px`,trackVisibility:!0,delay:1e3,triggerOnce:!0,skip:i});return O(()=>{if(!n.current)return;let t=n.current.getBoundingClientRect();t.bottom>$a&&(t.top({code:e,name:t})),{PHANPY_TRANSLANG_INSTANCES:ro}={PHANPY_TRANSLANG_INSTANCES:`translang.phanpy.social`},io=ro?ro.split(/\s+/):[],ao=new se({concurrency:1,interval:2e3,intervalCap:1}),oo=1e3*60*60,so=0;function co(e,t,n){return Na(()=>{let r=io[so],i=e.length>2e3,a;return a=i?fetch(`https://${r}/api/v1/translate`,{method:`POST`,priority:`low`,referrerPolicy:`no-referrer`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sl:t,tl:n,text:e})}):fetch(`https://${r}/api/v1/translate?sl=${encodeURIComponent(t)}&tl=${encodeURIComponent(n)}&text=${encodeURIComponent(e)}`,{priority:`low`,referrerPolicy:`no-referrer`}),a.then(e=>{if(!e.ok)throw Error(e.statusText);return e.json()}).then(e=>({provider:`translang`,content:e.translated_text,detectedSourceLanguage:e.detected_language,pronunciation:e.pronunciation}))},{retries:3,onFailedAttempt:e=>{so=(so+1)%io.length}})}var lo=t(co,{expires:oo}),uo=t(({signal:e,text:t,source:n,target:r})=>ao.add(()=>lo(t,n,r),{signal:e}),{expires:oo}),fo=({text:e,source:t,target:n,signal:r})=>ao.add(()=>La(e,t,n),{signal:r});function po({forceTranslate:t,sourceLanguage:n,onTranslate:i,text:a=``,mini:o,autoDetected:s}){let{_:l}=c(),u=Ci(!0),[d,f]=A(`default`),[p,m]=A(null),[h,_]=A(null),[v,y]=A(null),b=r(),x=r(),S=n?_i(n):null,C=_i(u),w=r(`auto`);i||=async({text:e,source:t,target:n,signal:r})=>{if(Fa){let i=await fo({text:e,source:t,target:n,signal:r});if(i&&!i.error)return i}return o?await uo({signal:r,text:e,source:t,target:n}):await lo(e,t,n)};let T=async()=>{f(`loading`);try{let{content:e,detectedSourceLanguage:t,provider:n,error:r,...s}=await i({text:a,source:w.current,target:u,signal:x.current?.signal});if(e){if(t&&y(_i(t)),n===`translang`){let e=s?.pronunciation;e&&m(e)}_(e),f(`default`),!o&&e.trim()!==a.trim()&&b.current&&(b.current.open=!0,b.current.scrollIntoView({behavior:`smooth`,block:`nearest`}))}else f(`error`)}catch(e){e.name!==`AbortError`&&f(`error`)}};return g(()=>{t&&T()},[t]),g(()=>(x.current=new AbortController,()=>{x.current.abort()}),[]),o?h&&h.trim()!==a.trim()&&v!==C?M(to,{children:M(`div`,{class:`status-translation-block-mini`,children:[M(Q,{icon:`translate`,alt:l({id:`zVJKbG`,values:{sourceLangText:S}})}),M(`output`,{lang:u,dir:`auto`,title:p||``,children:h})]})}):null:M(`div`,{class:`status-translation-block`,onClick:e=>{e.preventDefault()},children:M(`details`,{ref:b,children:[M(`summary`,{children:M(`button`,{type:`button`,class:d===`loading`?`loading-mask`:``,onClick:async e=>{e.preventDefault(),e.stopPropagation(),b.current.open=!b.current.open,d!==`loading`&&(h||T())},children:[M(Q,{icon:`translate`}),` `,M(`span`,{children:l(d===`loading`?{id:`Zxkt_v`}:n&&S&&!v?s?{id:`R20Yf9`,values:{sourceLangText:S}}:{id:`h8zDAI`,values:{sourceLangText:S}}:{id:`pi8x_S`})})]})}),M(`div`,{class:`translated-block`,children:[M(`div`,{class:`translation-info insignificant`,children:[M(`select`,{class:`translated-source-select`,disabled:d===`loading`,onChange:e=>{w.current=e.target.value,T()},children:no.map(e=>{let t=_i({code:e.code,fallback:e.name}),n=_i({code:e.code,locale:e.code}),r=n&&t!==n;return M(`option`,{value:e.code,children:e.code===`auto`?l({id:`Bze3gr`,values:{0:v??`…`}}):r?`${n} - ${t}`:t})})}),` `,M(`span`,{children:[`→ `,C]}),M(F,{abrupt:!0,hidden:d!==`loading`})]}),d===`error`?M(`p`,{class:`ui-state`,children:M(D,{id:`m5LihO`})}):!!h&&M(e,{children:[M(`output`,{class:`translated-content`,lang:u,dir:`auto`,children:h}),!!p&&M(`output`,{class:`translated-pronunciation-content`,tabIndex:-1,onClick:e=>{e.target.classList.toggle(`expand`)},children:p})]})]})]})})}var mo=io?.length?po:()=>null;function ho(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function go(e,t){let n,r=()=>{if(n)return n;let r=indexedDB.open(e);return r.onupgradeneeded=()=>r.result.createObjectStore(t),n=ho(r),n.then(e=>{e.onclose=()=>n=void 0},()=>{}),n};return(e,n)=>r().then(r=>n(r.transaction(t,e).objectStore(t)))}var _o;function vo(){return _o||=go(`keyval-store`,`keyval`),_o}function yo(e,t=vo()){return t(`readonly`,t=>ho(t.get(e)))}function bo(e,t,n=vo()){return n(`readwrite`,n=>(n.put(t,e),ho(n.transaction)))}function xo(e,t=vo()){return t(`readonly`,t=>Promise.all(e.map(e=>ho(t.get(e)))))}function So(e,t=vo()){return t(`readwrite`,t=>(t.delete(e),ho(t.transaction)))}function Co(e,t=vo()){return t(`readwrite`,t=>(e.forEach(e=>t.delete(e)),ho(t.transaction)))}function wo(e=vo()){return e(`readwrite`,e=>(e.clear(),ho(e.transaction)))}function To(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},ho(e.transaction)}function Eo(e=vo()){return e(`readonly`,e=>{if(e.getAllKeys)return ho(e.getAllKeys());let t=[];return To(e,e=>t.push(e.key)).then(()=>t)})}function Do(e,t){let n=go(e,t);return{set:(e,t)=>bo(e,t,n),get:e=>yo(e,n),getMany:e=>xo(e,n),del:e=>So(e,n),delMany:e=>Co(e,n),clear:()=>wo(n),keys:()=>Eo(n)}}var Oo={drafts:Do(`drafts-db`,`drafts-store`),catchup:Do(`catchup-db`,`catchup-store`),yearInPosts:Do(`year-in-posts-db`,`year-in-posts-store`)},ko=fe({}),Ao=!!document.startViewTransition;function jo({children:e,statusID:t}){let n=r([]),[i,a]=A(!1),[o,s]=A(0);function c(e){e!==o&&(Ao?document.startViewTransition(()=>{s(e)}):s(e))}async function u(){let{masto:e}=l(),r=await e.v1.statuses.$select(t).history.list();r.sort((e,t)=>Date.parse(t.createdAt)-Date.parse(e.createdAt)),n.current=r}async function d(){try{await u(),a(!0),c(0)}catch{a(!1)}}function f(){n.current=[],a(!1),c(0)}function p(){c(e=>Math.min(e+1,n.current.length-1))}function m(){c(e=>Math.max(e-1,0))}return M(ko.Provider,{value:{editHistoryRef:n,initEditHistory:d,exitEditHistory:f,editHistoryMode:i,editedAtIndex:o,prevEditedAt:p,nextEditedAt:m},children:e})}function Mo(){return de(ko)}var No=fe();function Po(e,t){if(!e?.length)return!1;let n=e.filter(e=>{let{filter:n}=e,r=n.context.includes(t);return r?n.expiresAt?Date.parse(n.expiresAt)>Date.now():r:!1});if(!n.length)return!1;if(n.some(e=>e.filter.filterAction===`hide`))return{action:`hide`};if(n.every(e=>e.filter.filterAction===`blur`)){let e=n.map(e=>e.filter.title);return{action:`blur`,titles:e,titlesStr:e.join(` • `)}}if(n.some(e=>!!e.filter.filterAction)){let e=n.map(e=>e.filter.title);return{action:`warn`,titles:e,titlesStr:e.join(` • `)}}return!1}var Fo=W(Po);function Io(e,t,n){let{filtered:r}=e;if(!r?.length||n&&e.account?.id===n)return!0;let i=Fo(r,t);return i?i.action!==`hide`:!0}function Lo(e,t){if(!e?.length)return[];if(!t)return e;let n=w();return e.filter(e=>Io(e,t,n))}var Ro=document.createElement(`template`);function zo(e){if(!e)return 0;Ro.innerHTML=e;let t=Ro.content.querySelectorAll(`.invisible`);for(let e=0;e{if(n.current){let{scrollHeight:a}=n.current,o=a>r;if(o){let{height:e,maxHeight:t}=getComputedStyle(n.current);o=a>parseInt(t||e,10)}n.current.classList.toggle(e,o),i.current!==o&&typeof t==`function`&&(i.current=o,t(o))}}}),n}var Yo={public:`earth`,unlisted:`moon`,private:`lock`,direct:`message`,local:`building`},Xo={public:{id:`7d1a0d`},local:{id:`d5zxa4`},unlisted:{id:`pPYeIN`},private:{id:`x5LEuB`},direct:{id:`IV4QaU`}},Zo=5,Qo=3e5;function $o({collection:e,instance:t,sensitive:n,creatorAccount:r}){let a=z(i),{i18n:o}=c(),{name:s,description:u,url:d,items:f=[],itemsCount:m,accountId:h,language:_}=e,v=Math.floor(Date.now()/Qo),y=p(()=>{if(f.length>Zo){let e=v%f.length;return[...f.slice(e),...f.slice(0,e)].slice(0,Zo)}return f},[v,f]),b=y.slice(0,Zo).map(e=>a.accounts[e.accountId]).filter(Boolean),x=b.length===1?[b[0]]:[b[0],b[b.length-1]],S=r||a.accounts[h];g(()=>{let e=!1,{masto:n}=l({instance:t}),a=[...new Set(y.slice(0,Zo).map(e=>e.accountId).concat(r?[]:h).filter(Boolean))].filter(e=>!i.accounts[e]);return a.length>0&&n.v1.accounts.fetch({id:a}).then(t=>{if(!e)for(let e of t)i.accounts[e.id]=e}).catch(()=>{}),()=>{e=!0}},[y,t]);let C=(m||f.length)-Zo;return M(`a`,{href:d,target:`_blank`,rel:`nofollow noopener`,class:`collection-card ${n?`sensitive`:``}`,lang:_||void 0,children:[b.length>0&&M(`div`,{class:`collection-card-bg`,"aria-hidden":`true`,children:x.map(e=>M(`img`,{src:e.avatarStatic||e.avatar,alt:``,decoding:`async`,loading:`lazy`},e.id))}),f.length>0&&M(`div`,{class:`collection-accounts`,children:[b.map(e=>M(Mr,{url:e.avatarStatic||e.avatar,size:`l`,alt:e.displayName||e.username||``,squircle:e.bot},e.id)),C>0&&M(`span`,{class:`account-overflow-count`,children:[`+`,C]})]}),M(`div`,{class:`meta-container`,children:[M(`p`,{class:`title`,dir:`auto`,children:s}),!!u&&M(`p`,{class:`meta`,dir:`auto`,children:u}),!!S&&M(`p`,{class:`meta`,lang:o.locale,dir:`auto`,children:M(D,{id:`hnrI5E`,values:{username:S.acct},components:{0:M(`span`,{class:`bidi-isolate`})}})})]})]})}var es=48;function ts({as:e=`div`,id:t,class:i,children:a,renderIfHasChildren:o=!0,...s}){let c=r(null),l=p(()=>n.toArray(a).filter(e=>!!e).length>0,[a]),u=Qa((e,t)=>{if(!c.current)return;let n=c.current;e?n.classList.remove(`hidden`):t.boundingClientRect.bottom<=es&&(l&&o?u(null):n.classList.add(`hidden`))},{rootMargin:`-${es}px 0px 0px 0px`,triggerOnce:!0,skip:!l});return M(e,{...s,ref:e=>{c.current=e,u(e)},class:`lazy-render ${i||``}`,children:a})}var ns=new RegExp([`\\\\\\[[\\s\\S]*?\\\\\\]`,`\\\\\\([\\s\\S]*?\\\\\\)`].join(`|`),`g`);function rs(e){let t=RegExp(`(${[`\\\\\\[`,`\\\\\\(`].join(`|`)})`),n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=[],i;for(;i=n.nextNode();)r.push(i);for(let e of r){let n=e.textContent,r=n.match(t);if(!r)continue;let i=r[0]===`\\[`?`\\]`:`\\)`,a=[e],o=e,s=!1,c=n;if(n.includes(i))s=!0;else for(;o.nextSibling&&!s;){let e=o.nextSibling;if(e.nodeType===Node.TEXT_NODE)a.push(e),c+=e.textContent,e.textContent.includes(i)&&(s=!0);else if(e.nodeType===Node.ELEMENT_NODE&&e.tagName===`BR`)a.push(e),c+=`
`;else break;o=e}if(s&&a.length>1){e.textContent=c;for(let e=1;e{if(ns.lastIndex=0,!ns.test(e))return null;let{_:r}=c(),[i,a]=A(!1),o=_(async e=>{if(e.preventDefault(),e.stopPropagation(),i)a(!1),n();else try{let e=window.temml||(window.temml=(await V(()=>import(`./temml-BKKuir3p.js`),[],import.meta.url))?.default);rs(t.current);let i=t.current.innerHTML;e.renderMathInElement(t.current,{fences:`(`,annotate:!0,throwOnError:!0,errorCallback:e=>{}});let o=t.current.querySelector(`math`),s=t.current.innerHTML!==i;o&&s?a(!0):(q(r({id:`HBIZeo`})),a(!1),n())}catch{}},[i]);return M(`div`,{class:`math-block`,children:[M(Q,{icon:`formula`,size:`s`}),` `,M(`span`,{children:r({id:`_nf2x7`})}),` `,M(`button`,{type:`button`,class:`light small`,onClick:o,children:r(i?{id:`AJqQb-`}:{id:`dP6iYK`})})]})},as=new Uint8Array(128);for(let e=0;e<83;e++)as[`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~`.charCodeAt(e)]=e;var os=(e,t,n)=>{let r=0;for(;te>10.31475?ss(e/ds+.052132,2.4):e/us,ps=e=>~~(e>1227e-8?ds*ss(e,.416666)-13.025:e*us+1),ms=e=>(e<0?-1:1)*e*e,hs=e=>{for(e+=cs/2;e>cs;)e-=ls;let t=1.27323954*e-.405284735*ms(e);return .225*(ms(t)-t)+t};function gs(e){let t=os(e,2,6);return[t>>16,t>>8&255,t&255]}function _s(e,t,n,r){let i=os(e,0,1),a=i%9+1,o=~~(i/9)+1,s=a*o,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=(os(e,1,2)+1)/13446*(r|1),x=new Float64Array(s*3),S=gs(e);for(c=0;c<3;c++)x[c]=fs(S[c]);for(c=1;c`u`,Ds=function(){return!Es&&(`ontouchstart`in window||navigator.maxTouchPoints>0)},Os=function(e){var t=e.x,n=e.y,r=e.scale;return`scale3d(${r},${r}, 1) translate3d(${t}px, ${n}px, 0)`},ks=Math.min,As=Math.max;function js(e){var t=e.containerDimension,n=e.childDimension,r=e.padding,i=e.centerContained,a=n-t;return a+2*r<=0&&i?[a/2,a/2]:[ks(a+r,0)-r,As(0,a+r)]}var Ms=function(e,t){return t?`${e} ${t}`:e},Ns=Math.abs,Ps=Math.min,Fs=Math.sqrt,Is=typeof window>`u`,Ls=Is?!1:/(Mac)/i.test(navigator.platform),Rs=function(e){return e===`drag`},zs=function(e){return e===`zoom`},Bs=function(e){return Ls&&e.ctrlKey},Vs=function(e){e.stopPropagation(),e.preventDefault()},Hs=function(e,t){var n=e.x-t.x,r=e.y-t.y;return Fs(n*n+r*r)},Us=function(e,t){var n=Hs(e[0],e[1]);return Hs(t[0],t[1])/n},Ws=function(e,t){return e>t-.01&&et?t:n},Zs=function(e){return!(e.ctrlKey||e.metaKey)},Qs=function(e){if(e){var t=e.offsetWidth,n=e.offsetHeight;if(t&&n)return{width:t,height:n};var r=getComputedStyle(e),i=parseFloat(r.width),a=parseFloat(r.height);if(a&&i)return{width:i,height:a}}return{width:0,height:0}},$s=function(e,t){return{x:t.x-e.x,y:t.y-e.y}},ec=function(e,t){return e.x===t.x&&e.y===t.y},tc=function(){},nc={x:0,y:0},rc=function(e){ys(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t._prevDragMovePoint=null,t._containerObserver=null,t._fingers=0,t._firstMove=!0,t._initialOffset=bs({},nc),t._interaction=null,t._isDoubleTap=!1,t._isOffsetsSet=!1,t._lastDragPosition=null,t._lastScale=1,t._lastTouchStart=0,t._lastZoomCenter=null,t._listenMouseMove=!1,t._nthZoom=0,t._offset=bs({},nc),t._startOffset=bs({},nc),t._startTouches=null,t._updatePlaned=!1,t._wheelTimeOut=null,t._zoomFactor=1,t._initialZoomFactor=1,t._draggingPoint=bs({},nc),t._ignoreNextClick=!1,t._containerRef=N(),t._handleClick=function(e){t._ignoreNextClick&&(t._ignoreNextClick=!1,e.stopPropagation())},t._onResize=function(){t._containerRef?.current&&(t._updateInitialZoomFactor(),t._setupOffsets(),t._update())},t._handlerOnTouchEnd=t._handlerIfEnable(function(e){t._fingers=e.touches.length,t.props.shouldCancelHandledTouchEndEvents&&(zs(t._interaction)||Rs(t._interaction)&&(t._startOffset.x!==t._offset.x||t._startOffset.y!==t._offset.y))&&Vs(e),Rs(t._interaction)&&!t._enoughToDrag()&&t._handleClick(e),t._updateInteraction(e)}),t._handlerOnTouchStart=t._handlerIfEnable(function(e){t._firstMove=!0,t._fingers=e.touches.length,t._detectDoubleTap(e)}),t._handlerOnTouchMove=t._handlerIfEnable(function(e){t._isDoubleTap||(t._collectInertia(e),t._firstMove?(t._updateInteraction(e),t._interaction&&Vs(e),t._startOffset=bs({},t._offset),t._startTouches=qs(e.touches)):(zs(t._interaction)?t._startTouches&&t._startTouches.length===2&&e.touches.length===2&&t._handleZoom(e,Us(t._startTouches,qs(e.touches))):Rs(t._interaction)&&t._handleDrag(e),t._interaction&&(Vs(e),t._update())),t._firstMove=!1)}),t._handlerWheel=function(e){if(!t.props.shouldInterceptWheel(e)){Vs(e);var n=e.pageX,r=e.pageY,i=e.deltaY,a=e.deltaMode,o=1;(Bs(e)||a===1)&&(o=15);var s={touches:[{pageX:n,pageY:r}]},c=t._getOffsetByFirstTouch(s),l=i*o;t._stopAnimation(),t._scaleTo(t._zoomFactor-l/t.props.wheelScaleFactor,c),t._update(),clearTimeout(t._wheelTimeOut),t._wheelTimeOut=setTimeout(function(){return t._sanitize()},100)}},t._handlers=t.props.isTouch()?[[`touchstart`,t._handlerOnTouchStart],[`touchend`,t._handlerOnTouchEnd],[`touchmove`,t._handlerOnTouchMove]]:[[`mousemove`,t.simulate(t._handlerOnTouchMove),t.props._document],[`mouseup`,t.simulate(t._handlerOnTouchEnd),t.props._document],[`mousedown`,t.simulate(t._handlerOnTouchStart)],[`click`,t._handleClick],[`wheel`,t._handlerWheel]],t}return t.prototype._handleDragStart=function(e){this._ignoreNextClick=!0,this.props.onDragStart(),this._stopAnimation(),this._resetInertia(),this._lastDragPosition=null,this._hasInteraction=!0,this._draggingPoint=this._offset,this._handleDrag(e)},t.prototype._handleDrag=function(e){var t=this._getOffsetByFirstTouch(e);this._enoughToDrag()?this._drag(t,this._lastDragPosition):this._virtualDrag(t,this._lastDragPosition),this._offset=this._sanitizeOffset(this._offset),this._lastDragPosition=t},t.prototype._resetInertia=function(){this._velocity=null,this._prevDragMovePoint=null},t.prototype._realizeInertia=function(){var e=this,t=this.props,n=t.inertiaFriction;if(!(!t.inertia||!this._velocity)){var r=this._velocity,i=r.x,a=r.y;(i||a)&&(this._stopAnimation(),this._resetInertia(),this._animate(function(){if(i*=n,a*=n,!i&&!a)return e._stopAnimation();var t=bs({},e._offset);if(e._addOffset({x:i,y:a}),e._offset=e._sanitizeOffset(e._offset),ec(t,e._offset))return e._stopAnimation();e._update({isAnimation:!0})},{duration:9999}))}},t.prototype._collectInertia=function(e){var t=e.touches;if(this.props.inertia){var n=qs(t)[0],r=this._prevDragMovePoint;r&&(this._velocity=$s(n,r)),this._prevDragMovePoint=n}},t.prototype._handleDragEnd=function(){this.props.onDragEnd(),this._end(),this._realizeInertia()},t.prototype._handleZoomStart=function(){this.props.onZoomStart(),this._stopAnimation(),this._lastScale=1,this._nthZoom=0,this._lastZoomCenter=null,this._hasInteraction=!0},t.prototype._handleZoom=function(e,t){var n=Ys(this._getOffsetTouches(e)),r=t/this._lastScale;this._lastScale=t,this._nthZoom+=1,this._nthZoom>3&&(this._scale(r,n),this._drag(n,this._lastZoomCenter),this.props.enforceBoundsDuringZoom&&(this._offset=this._sanitizeOffset(this._offset))),this._lastZoomCenter=n},t.prototype._handleZoomEnd=function(){this.props.onZoomEnd(),this._end()},t.prototype._handleDoubleTap=function(e){var t=this;if(!(this._hasInteraction||this.props.tapZoomFactor===0)){var n=this.props.doubleTapZoomOutOnMaxScale&&this._zoomFactor===this.props.maxZoom||this.props.doubleTapToggleZoom&&this._zoomFactor>1;this.props.onDoubleTap(),this._ignoreNextClick=!0;var r=this._zoomFactor+this.props.tapZoomFactor,i=this._zoomFactor,a=function(e){t._scaleTo(i+e*(r-i),o)},o=this._getOffsetByFirstTouch(e);this._isDoubleTap=!0,i>r&&(o=this._getCurrentZoomCenter()),n?this._zoomOutAnimation():this._animate(a)}},t.prototype._computeInitialOffset=function(){var e=this._getContainerRect(),t=this._getChildSize(),n=t.width,r=t.height,i=-Ns(n*this._getInitialZoomFactor()-e.width)/2,a=-Ns(r*this._getInitialZoomFactor()-e.height)/2;this._initialOffset={x:i,y:a}},t.prototype._resetOffset=function(){this._offset=bs({},this._initialOffset)},t.prototype._setupOffsets=function(){this.props.setOffsetsOnce&&this._isOffsetsSet||(this._isOffsetsSet=!0,this._computeInitialOffset(),this._resetOffset())},t.prototype._sanitizeOffset=function(e){var t=this._getContainerRect(),n=this._getChildSize(),r=n.width,i=n.height,a=r*this._getInitialZoomFactor()*this._zoomFactor,o=i*this._getInitialZoomFactor()*this._zoomFactor,s=js({containerDimension:t.width,childDimension:a,padding:this.props.horizontalPadding,centerContained:this.props.centerContained}),c=s[0],l=s[1],u=js({containerDimension:t.height,childDimension:o,padding:this.props.verticalPadding,centerContained:this.props.centerContained}),d=u[0],f=u[1];return{x:Xs(c,l,e.x),y:Xs(d,f,e.y)}},t.prototype.alignCenter=function(e){var t=this,n=bs({duration:250,animated:!0},e),r=n.x,i=n.y,a=n.scale,o=n.animated,s=n.duration,c=r*this._initialZoomFactor,l=i*this._initialZoomFactor,u=this._zoomFactor,d=bs({},this._offset),f=this._getContainerRect(),p={x:f.width/2,y:f.height/2};if(this._zoomFactor=1,this._offset={x:-(p.x-c),y:-(p.y-l)},this._scaleTo(a,p),this._stopAnimation(),!o)return this._update();var m=this._zoomFactor-u,h={x:this._offset.x-d.x,y:this._offset.y-d.y};this._zoomFactor=u,this._offset=bs({},d),this._animate(function(e){var n=d.x+h.x*e,r=d.y+h.y*e;t._zoomFactor=u+m*e,t._offset=t._sanitizeOffset({x:n,y:r}),t._update()},{callback:function(){return t._sanitize()},duration:s})},t.prototype.scaleTo=function(e){var t=this,n=bs({duration:250,animated:!0},e),r=n.x,i=n.y,a=n.scale,o=n.animated,s=n.duration,c=this._zoomFactor,l=bs({},this._offset);if(this._zoomFactor=1,this._offset={x:0,y:0},this._scaleTo(a,{x:r,y:i}),this._stopAnimation(),!o)return this._update();var u=this._zoomFactor-c,d={x:this._offset.x-l.x,y:this._offset.y-l.y};this._zoomFactor=c,this._offset=bs({},l),this._animate(function(e){var n=l.x+d.x*e,r=l.y+d.y*e;t._zoomFactor=c+u*e,t._offset={x:n,y:r},t._update()},{callback:function(){return t._sanitize()},duration:s})},t.prototype._scaleTo=function(e,t){this._scale(e/this._zoomFactor,t),this._offset=this._sanitizeOffset(this._offset)},t.prototype._scale=function(e,t){e=this._scaleZoomFactor(e),this._addOffset({x:(e-1)*(t.x+this._offset.x),y:(e-1)*(t.y+this._offset.y)}),this.props.onZoomUpdate()},t.prototype._scaleZoomFactor=function(e){var t=this._zoomFactor;return this._zoomFactor*=e,this._zoomFactor=Xs(this.props.minZoom,this.props.maxZoom,this._zoomFactor),this._zoomFactor/t},t.prototype._canDrag=function(){return this.props.draggableUnZoomed||!Ws(this._zoomFactor,1)},t.prototype._drag=function(e,t){if(t){var n=-(e.y-t.y),r=-(e.x-t.x);this.props.lockDragAxis?Ns(r)>Ns(n)?this._addOffset({x:r,y:0}):this._addOffset({y:n,x:0}):this._addOffset({x:r,y:n}),this.props.onDragUpdate()}},t.prototype._virtualDrag=function(e,t){if(t){var n=-(e.y-t.y),r=-(e.x-t.x);this._draggingPoint={x:r+this._draggingPoint.x,y:n+this._draggingPoint.y}}},t.prototype._addOffset=function(e){var t=this._offset,n=t.x,r=t.y;this._offset={x:n+e.x,y:r+e.y}},t.prototype._sanitize=function(){this._zoomFactor=s?(e(1),n._stopAnimation(),o(),n._update()):(i=a(i),e(i),n._update({isAnimation:!0}),requestAnimationFrame(c))}};this._inAnimation=!0,requestAnimationFrame(c)},t.prototype._stopAnimation=function(){this._inAnimation=!1},t.prototype._end=function(){this._hasInteraction=!1,this._sanitize(),this._update()},t.prototype._getContainerRect=function(){return this._containerRef.current.getBoundingClientRect()},t.prototype._getChildSize=function(){var e=this._containerRef.current;return Qs(e?.firstElementChild)},t.prototype._updateInitialZoomFactor=function(){var e=this._getContainerRect(),t=this._getChildSize(),n=e.width/t.width,r=e.height/t.height;this._initialZoomFactor=Ps(n,r)},t.prototype._bindEvents=function(){var e=this,t=this._containerRef.current;window.ResizeObserver?(this._containerObserver=new ResizeObserver(this._onResize),this._containerObserver.observe(t)):window.addEventListener(`resize`,this._onResize),this._handlers.forEach(function(e){var n=e[0],r=e[1];(e[2]||t).addEventListener(n,r,!0)}),Array.from(t.querySelectorAll(`img`)).forEach(function(t){return t.addEventListener(`load`,e._onResize)})},t.prototype._unSubscribe=function(){var e=this,t=this._containerRef.current;this._containerObserver&&=(this._containerObserver.disconnect(),null),window.removeEventListener(`resize`,this._onResize),this._handlers.forEach(function(e){var n=e[0],r=e[1];(e[2]||t).removeEventListener(n,r,!0)}),Array.from(t.querySelectorAll(`img`)).forEach(function(t){return t.removeEventListener(`load`,e._onResize)})},t.prototype._update=function(e){var t=this;if(!this._updatePlaned){var n=function(){var e=t._getInitialZoomFactor()*t._zoomFactor,n=-t._offset.x/e,r=-t._offset.y/e;t.props.onUpdate({scale:e,x:n,y:r})};if(e?.isAnimation)return n();this._updatePlaned=!0,requestAnimationFrame(function(){t._updatePlaned=!1,n()})}},t.prototype._handlerIfEnable=function(e){var t=this;return function(){var n=[...arguments];t.props.enabled&&e.apply(void 0,n)}},t.prototype._setInteraction=function(e,t){var n=this._interaction;n!==e&&(n&&!e&&(zs(n)?this._handleZoomEnd():Rs(n)&&this._handleDragEnd()),zs(e)?this._handleZoomStart():Rs(e)&&this._handleDragStart(t)),this._interaction=e},t.prototype._distanceBetweenNumbers=function(e,t){return e>t?e-t:t-e},t.prototype._enoughToDrag=function(){return this._distanceBetweenNumbers(this._startOffset.x,this._draggingPoint.x)>5||this._distanceBetweenNumbers(this._startOffset.y,this._draggingPoint.y)>5},t.prototype._updateInteraction=function(e){var t=this._fingers;if(t===2)return this._setInteraction(`zoom`,e);if(t===1&&this._canDrag())return this._setInteraction(`drag`,e);this._setInteraction(null,e)},t.prototype._detectDoubleTap=function(e){var t=new Date().getTime();this._fingers>1&&(this._lastTouchStart=0),t-this._lastTouchStart<300?(Vs(e),this._handleDoubleTap(e),zs(this._interaction)?this._handleZoomEnd():Rs(this._interaction)&&this._handleDragEnd()):this._isDoubleTap=!1,this._fingers===1&&(this._lastTouchStart=t)},t.prototype.simulate=function(e){var t=this;return function(n){var r=n.pageX,i=n.pageY,a=n.type,o=a===`mouseup`;a===`mousedown`&&(n.preventDefault(),t._listenMouseMove=!0),t._listenMouseMove&&(n.touches=o?[]:[{pageX:r,pageY:i}],e(n)),o&&(t._listenMouseMove=!1)}},t.prototype.componentDidMount=function(){this._bindEvents(),this._update()},t.prototype.componentWillUnmount=function(){this._stopAnimation(),this._unSubscribe()},t.prototype.render=function(){var e=this.props,t=e.children,r=e.containerProps,i=e.nonce,a=n.only(t),o=r||{};return v.createElement(v.Fragment,null,v.createElement(`style`,{nonce:i},Ts),v.createElement(`div`,bs({},o,{ref:this._containerRef,className:Ms(Cs,o.className)}),T(a,{className:Ms(ws,a.props.className)})))},t.defaultProps={animationDuration:250,draggableUnZoomed:!0,enforceBoundsDuringZoom:!1,centerContained:!1,enabled:!0,inertia:!0,inertiaFriction:.96,horizontalPadding:0,isTouch:Ds,lockDragAxis:!1,maxZoom:5,minZoom:.5,onDoubleTap:tc,onDragEnd:tc,onDragStart:tc,onDragUpdate:tc,onZoomEnd:tc,onZoomStart:tc,onZoomUpdate:tc,setOffsetsOnce:!1,shouldInterceptWheel:Zs,shouldCancelHandledTouchEndEvents:!1,tapZoomFactor:1,verticalPadding:0,wheelScaleFactor:1500,zoomOutFactor:1.3,doubleTapZoomOutOnMaxScale:!1,doubleTapToggleZoom:!1,_document:Is?null:window.document},t}(j);function ic(e){if(!e)return;let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.round(e%60);return t===0?`${n}:${r.toString().padStart(2,`0`)}`:`${t}:${n.toString().padStart(2,`0`)}:${r.toString().padStart(2,`0`)}`}var ac=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),oc=`ALT`,sc=e=>{let{_:t}=c(),{alt:n,lang:r,index:a,...o}=e;return!n||!n.trim()?null:M(`button`,{type:`button`,class:`alt-badge clickable`,...o,onClick:e=>{e.stopPropagation(),e.preventDefault(),i.showMediaAlt={alt:n,lang:r}},title:t({id:`5gfDMm`}),children:[oc,!!a&&M(`sup`,{children:a})]})},cc=140,lc=280,uc=W(e=>e?.length?e.length>cc||/[\n\r].*[\n\r]/.test(e.trim()):!1),dc=(()=>{try{let e=document.createElement(`video`);return e.canPlayType?e.canPlayType(`application/vnd.apple.mpegurl`)!==``||e.canPlayType(`application/x-mpegURL`)!==``||e.canPlayType(`audio/mpegurl`)!==``:!1}catch{return!1}})();function fc({class:t=``,media:n,to:a,lang:o,showOriginal:s,autoAnimate:c,showCaption:l,allowLongerCaption:u,altIndex:d,checkAspectRatio:f=!0,onClick:m}){let{id:h,blurhash:v,description:y,meta:b,previewRemoteUrl:x,previewUrl:S,remoteUrl:C,url:w,type:T}=n;/no\-preview\./i.test(S)&&(S=null);let E=mc(h||v||w),{original:k={},small:ee,focus:te}=b||{},j=s?k?.width:ee?.width||k?.width,N=s?k?.height:ee?.height||k?.height,P=s?w:S||w,ne=s?C:x||C,re=ee?.width&&ee?.height,F=j&&N?j>N?`landscape`:`portrait`:null,I=v?gs(v):null,L=r(),R;if(te){let e=(te.x+1)/2*100,t=(1-te.y)/2*100;R=`${e.toFixed(0)}% ${t.toFixed(0)}%`}let ie=r(),z=_(({x:e,y:t,scale:n})=>{let{current:r}=ie;if(r){let i=Os({x:e,y:t,scale:n});n===1?r.style.removeProperty(`transform`):r.style.setProperty(`transform`,i),r.closest(`.media-zoom`).style.touchAction=n<=1.01?`pan-x`:``}},[]),[B,V]=A(!1),H={enabled:B,draggableUnZoomed:!1,inertiaFriction:.9,tapZoomFactor:2,doubleTapToggleZoom:!0,containerProps:{className:`media-zoom`,style:{overflow:`visible`}},onUpdate:z},[ae,oe]=A(!1),se=p(()=>a&&!ae?e=>M(lr,{to:a,...e}):`div`,[a,ae]),U=ne?pc(ne):null,ce=T===`unknown`&&U&&/\.(mp4|m4r|m4v|mov|webm)$/i.test(U.pathname),le=U&&/\.m3u8$/i.test(U.pathname)&&dc,ue=T===`unknown`&&U&&/\.(mp3|ogg|wav|m4a|m4p|m4b)$/i.test(U.pathname),de=T===`image`||T===`unknown`&&S&&!ce&&!le&&!ue,fe=S&&/\.(mp4|m4r|m4v|mov|webm)$/i.test(pc(S).pathname)||le,W=r(),[pe,me]=A(!1);O(()=>{if(!de||!s||!W.current)return;let{offsetWidth:e,offsetHeight:t}=W.current,n=j{let{children:t,...n}=e;return M(`figure`,{...n,children:[t,M(`figcaption`,{class:`media-caption`,lang:o,dir:`auto`,onClick:e=>{e.preventDefault(),e.stopPropagation(),i.showMediaAlt={alt:y,lang:o}},children:y})]})}:e,xe=()=>window.matchMedia(`(min-width: calc(40em + 350px))`).matches?`large`:`small`,Se=_(e=>{let t=e.target.closest(`.status-deck`);if(s||xe()===`large`&&t||!document.startViewTransition){m?.(e);return}let n=e.target.closest(`[data-view-transition-name]`)||e.target.querySelector(`[data-view-transition-name]`);if(n)if(m)m(e);else if(e.preventDefault(),n.dataset.viewTransitioned){n.style.viewTransitionName=E;try{document.startViewTransition(()=>{n.style.viewTransitionName=``,location.hash=`#${a}`})}catch{n.style.viewTransitionName=``,location.hash=`#${a}`}}else location.hash=`#${a}`;else m?.(e)},[E,s,m]);if(g(()=>()=>{let e=W.current?.querySelectorAll?.(`video, audio`);e&&e.forEach(e=>{try{e.pause(),e.src=``,e.load()}catch{}}),`mediaSession`in navigator&&(navigator.mediaSession.playbackState=`none`)},[]),de)return H.containerProps.style.display=`inherit`,O(()=>{ac&&s&&(async()=>{try{await fetch(P,{mode:`no-cors`}),ie.current.src=P}catch{}})()},[P]),M(be,{children:[M(se,{ref:W,class:`media media-image ${t}`,onClick:Se,"data-orientation":F,"data-has-alt":!G||void 0,style:s?{backgroundImage:`url(${S})`,"--bg-image":`url(${S})`,backgroundSize:pe?`${j}px ${N}px`:void 0,..._e}:ve,children:s?M(rc,{...H,children:M(`img`,{ref:ie,src:P,alt:y,width:j,height:N,"data-orientation":F,loading:`eager`,decoding:`sync`,style:{"view-transition-name":E},onLoad:e=>{let t=e.target,n=t.closest(`.media-image`);n&&(n.style.backgroundImage=`url(${t.src})`,n.style.removeProperty(`--bg-image`)),t.closest(`.media-zoom`).style.display=``,V(!0)},onError:e=>{let{src:t}=e.target;t===P&&ne&&P!==ne&&(e.target.src=ne)}})}):M(e,{children:[M(`img`,{src:P,alt:G?``:y,width:j,height:N,"data-orientation":F,loading:`lazy`,"data-view-transition-name":E,style:{objectPosition:R||`center`,"--anim-duration":`${Math.min(Math.max(Math.max(j,N)/100,5),120)}s`},onLoad:e=>{e.target.dataset.loaded=!0;let t=e.target.closest(`.media`);if(!re&&t){let{naturalWidth:n,naturalHeight:r}=e.target;t.dataset.orientation=n>r?`landscape`:`portrait`,t.style.setProperty(`--width`,`${n}px`),t.style.setProperty(`--height`,`${r}px`),t.style.aspectRatio=`${n}/${r}`}if(f&&t){let{target:n}=e;setTimeout(()=>{let{clientWidth:e,clientHeight:r,naturalWidth:i,naturalHeight:a}=n;if(e&&r&&i&&a)if(i<88||a<88)t.dataset.hasSmallDimension=!0;else{let n=a*e/i;if(Math.abs(n-r)<5){let e=t.closest(`.media`);e&&(e.dataset.hasNaturalAspectRatio=!0)}}},300)}},onError:e=>{let{src:t}=e.target;t===P&&ne&&P!==ne?e.target.src=ne:oe(!0)}}),!G&&M(sc,{alt:y,lang:o,index:d})]})}),ae&&M(`div`,{children:M(`a`,{href:C,class:`button plain6 small`,target:`_blank`,children:[M(Q,{icon:`external`}),` `,M(`span`,{children:M(D,{id:`9npOH9`})})]})})]});if(T===`gifv`||T===`video`||ce||le){let n=k.duration>0,r=k.duration<31,i=T===`gifv`&&r,a=k.duration<61,l=ic(k.duration),u=!s&&!c&&i,f=!s&&c&&i,p=k.duration>5,m=`
`,h=le?ne:w,g=`
`;return M(be,{children:M(se,{ref:W,class:`media ${t} media-${i?`gif`:`video`} ${f?`media-contain`:``} ${u?`media-hover-animate`:``}`,"data-orientation":F,"data-formatted-duration":s?void 0:l,"data-label":i&&!s&&!f?`GIF`:void 0,"data-has-alt":!G||void 0,style:!s&&ve,onClick:e=>{if(u)try{L.current.pause()}catch{}Se(e)},onMouseEnter:()=>{if(u)try{L.current.play()}catch{}},onMouseLeave:()=>{if(u)try{L.current.pause()}catch{}},onFocus:()=>{if(u)try{L.current.play()}catch{}},onBlur:()=>{if(u)try{L.current.pause()}catch{}},children:[s||f?i&&s?M(rc,{...H,enabled:!0,children:M(`div`,{ref:ie,dangerouslySetInnerHTML:{__html:m}})}):i?M(`div`,{class:`video-container`,dangerouslySetInnerHTML:{__html:m}}):M(`div`,{class:`video-container`,dangerouslySetInnerHTML:{__html:g}}):i?M(`video`,{ref:L,src:w,poster:S,width:j,height:N,"data-orientation":F,"data-view-transition-name":E,preload:`auto`,playsinline:!0,loop:!0,muted:!0,onTimeUpdate:p?e=>{let{target:t}=e,n=t?.closest(`.media-gif`);if(n){let e=t.currentTime/t.duration*100;n.style.setProperty(`--progress`,`${e}%`)}}:void 0}):M(e,{children:[S&&!fe?M(`img`,{src:S,alt:G?``:y,width:j,height:N,"data-orientation":F,loading:`lazy`,decoding:`async`,"data-view-transition-name":E,onLoad:e=>{if(!re){let t=e.target.closest(`.media`);if(t){let{naturalHeight:n,naturalWidth:r}=e.target;t.dataset.orientation=r>n?`landscape`:`portrait`,t.style.setProperty(`--width`,`${r}px`),t.style.setProperty(`--height`,`${n}px`),t.style.aspectRatio=`${r}/${n}`}}}}):M(`video`,{src:h+`#t=0.1`,width:j,height:N,"data-orientation":F,"data-view-transition-name":E,preload:`metadata`,muted:!0,disablePictureInPicture:!0,onLoadedMetadata:e=>{if(!n){let{duration:t}=e.target;if(t){let n=ic(t),r=e.target.closest(`.media-video`);r&&(r.dataset.formattedDuration=n)}}}}),M(`div`,{class:`media-play`,children:M(Q,{icon:`play`,size:`xl`,alt:`▶`})})]}),!s&&!G&&M(sc,{alt:y,lang:o,index:d})]})})}else if(T===`audio`||ue){let n=ic(k.duration);return M(be,{children:M(se,{class:`media media-audio ${t}`,"data-formatted-duration":s?void 0:n,"data-has-alt":!G||void 0,onClick:m,style:!s&&ve,children:[s?S?M(`video`,{src:(C||w)+`#t=0.1`,width:j,height:N,"data-orientation":F,poster:S,style:{background:`url(${S}) center/cover`,aspectRatio:`${j}/${N}`},preload:`metadata`,controls:!0,controlsList:`nofullscreen`,autoPlay:!0,playsInline:!0}):M(`audio`,{src:C||w,preload:`none`,controls:!0,autoPlay:!0}):S?M(`img`,{src:S,alt:G?``:y,width:j,height:N,"data-orientation":F,loading:`lazy`,onError:e=>{try{e.target?.remove?.()}catch{}}}):null,!s&&M(e,{children:[M(`div`,{class:`media-play`,children:M(Q,{icon:`play`,size:`xl`,alt:`▶`})}),!G&&M(sc,{alt:y,lang:o,index:d})]})]})})}}function pc(e){return URL.parse(e,location.origin)}function mc(e){let t=e.replace(/[^a-zA-Z0-9_-]/g,`-`);return t.match(/^[0-9-]/)&&(t=`vt-`+t),t}var hc=oe(fc,(e,t)=>{let n=e.media||{},r=t.media||{};return n?.id===r?.id&&n.url===r.url&&e.to===t.to&&e.class===t.class});function gc(t){let{mediaAttachments:n,language:i,postID:a,instance:o}=t,s=n.length>1,c=r(),[l,u]=A(0);return g(()=>{let e=()=>{let{clientWidth:e,scrollLeft:t}=c.current;u(Math.round(Math.abs(t)/e))};return c.current&&c.current.addEventListener(`scroll`,e,{passive:!0}),()=>{c.current&&c.current.removeEventListener(`scroll`,e)}},[]),M(e,{children:[M(`div`,{class:`media-first-container`,children:[M(`div`,{class:`media-first-carousel`,ref:c,children:n.map((e,t)=>M(`div`,{class:`media-first-item`,children:M(hc,{media:e,lang:i,to:`/${o}/s/${a}?media=${t+1}`})},e.id))}),s&&M(`div`,{class:`media-carousel-controls`,children:[M(`div`,{class:`carousel-indexer`,children:[l+1,`/`,n.length]}),M(`label`,{class:`media-carousel-button`,children:M(`button`,{type:`button`,class:`carousel-button`,hidden:l===0,onClick:e=>{e.preventDefault(),e.stopPropagation(),c.current.focus(),c.current.scrollTo({left:c.current.clientWidth*(l-1)*(Pr()?-1:1),behavior:`smooth`})},children:M(Q,{icon:`arrow-left`})})}),M(`label`,{class:`media-carousel-button`,children:M(`button`,{type:`button`,class:`carousel-button`,hidden:l===n.length-1,onClick:e=>{e.preventDefault(),e.stopPropagation(),c.current.focus(),c.current.scrollTo({left:c.current.clientWidth*(l+1)*(Pr()?-1:1),behavior:`smooth`})},children:M(Q,{icon:`arrow-right`})})})]})]}),s&&M(`div`,{class:`media-carousel-dots`,style:{"--dots-count":n.length},children:n.map((e,t)=>M(`span`,{class:`carousel-dot ${t===l?`active`:``}`},e.id))})]})}function _c(e){let{enabled:t,children:n,lang:r,captionChildren:i}=e;return!t||!i?n:M(`figure`,{class:`media-figure-multiple`,children:[n,M(`figcaption`,{lang:r,dir:`auto`,children:i})]})}var vc=40;function yc({poll:t,lang:n,readOnly:i,refresh:a=()=>{},votePoll:o=()=>{}}){let{_:s}=c(),[l,u]=A(`default`),[d,f]=A(vc),p=r(null),{expired:m,expiresAt:h,id:_,multiple:v,options:y,ownVotes:b,voted:x,votersCount:S,votesCount:C=0,emojis:w}=t,T=!!h&&new Date(h),E=v&&S||C,O=0;E<=1e3?O=0:E<=1e4?O=1:E<=1e5&&(O=2);let[k,ee]=A(!1),te=y.every(e=>e.votesCount!==null),j=k&&te||x||m,[N,P]=A(v?[]:null);g(()=>{if(!p.current||d>=y.length)return;let e=new IntersectionObserver(e=>{e[0].isIntersecting&&f(e=>Math.min(e+vc,y.length))},{threshold:.1});return e.observe(p.current),()=>e.disconnect()},[d,y.length]),g(()=>{f(vc)},[j,y.length]);let ne=v?N.length:N===null?0:1,[re,F]=A(!1),I=Jo({onTruncated:F});return M(`div`,{lang:n,dir:`auto`,class:`poll ${i?`read-only`:``} ${l===`loading`?`loading`:``}`,children:[j?M(e,{children:[M(`div`,{class:`poll-options`,ref:I,children:[y.slice(0,d).map((t,n)=>{let{title:r,votesCount:i}=t,a=E?i/E:0,o=a?a.toLocaleString(H.locale||void 0,{style:`percent`,maximumFractionDigits:O}):`0%`;return M(`div`,{class:`poll-option poll-result ${i>0&&i===Math.max(...y.map(e=>e.votesCount))?`poll-option-leading`:``}`,style:{"--percentage":`${a*100}%`},children:[M(`div`,{class:`poll-option-title`,children:M(`span`,{children:M(ei,{text:r,emojis:w})})}),M(`div`,{class:`poll-option-votes`,title:H._({id:`-syLpm`,values:{optionVotesCount:i}}),children:[x&&b.includes(n)&&M(e,{children:[M(Q,{icon:`check-circle`,alt:s({id:`IeO7us`})}),` `]}),M(`span`,{class:`poll-option-votes-percentage`,children:o})]})]},`${n}-${r}`)}),d{e.preventDefault(),ee(!1)},children:[M(Q,{icon:`arrow-left`,size:`s`}),` `,M(D,{id:`L96xSt`})]}),` `,M(`div`,{class:`poll-info`,children:re&&M(`small`,{class:`insignificant`,children:M(D,{id:`lndXtU`,values:{0:y.length}})})})]})]}):M(`form`,{onSubmit:async e=>{e.preventDefault();let t=v?N:N===null?[]:[N];if(t.length){u(`loading`);try{await o(t)}catch{q(s({id:`m4xQyv`}))}finally{u(`default`)}}},children:[M(`div`,{class:`poll-options`,ref:I,children:[y.slice(0,d).map((e,t)=>{let{title:n}=e,r=v?N.includes(t):N===t;return M(`div`,{class:`poll-option`,children:M(`label`,{class:`poll-label`,children:[M(`input`,{type:v?`checkbox`:`radio`,name:`poll`,value:t,disabled:l===`loading`,readOnly:i,checked:r,onChange:e=>{let n=t;P(v?t=>e.target.checked?[...t,n]:t.filter(e=>e!==n):n)}}),M(`span`,{class:`poll-option-title`,children:M(ei,{text:n,emojis:w})})]})},`${t}-${n}`)}),dPn.trigger(`medium`),children:M(D,{id:`lQXQKs`})}),` `,M(`div`,{class:`poll-info`,children:re&&(v&&ne>0?M(`small`,{children:[ne,` `,M(`span`,{class:`insignificant`,children:[`/ `,y.length]})]}):M(`small`,{class:`insignificant`,children:M(D,{id:`lndXtU`,values:{0:y.length}})}))})]})]}),M(`p`,{class:`poll-meta`,children:[M(`span`,{class:`spacer`,children:[(m||x)&&re&&M(e,{children:[M(`span`,{class:`ib`,children:M(D,{id:`lndXtU`,values:{0:y.length}})}),` `,`•`,` `]}),M(`span`,{class:`ib`,children:M(D,{id:`k7v0Rh`,values:{0:la(C),1:la(C),votesCount:C},components:{0:M(`span`,{title:C}),1:M(`span`,{title:C})}})}),!!S&&S!==C&&M(e,{children:[` `,`•`,` `,M(`span`,{class:`ib`,children:M(D,{id:`jf1i1L`,values:{0:la(S),1:la(S),votersCount:S},components:{0:M(`span`,{title:S}),1:M(`span`,{title:S})}})})]}),` `,`•`,` `,m?T?M(`span`,{class:`ib`,children:M(D,{id:`5LwCCI`,components:{0:M(vr,{datetime:T})}})}):s({id:`237hSL`}):T?M(`span`,{class:`ib`,children:M(D,{id:`ooHDPY`,components:{0:M(vr,{datetime:T})}})}):s({id:`O2tNG0`})]}),!x&&!m&&!i&&te&&M(`button`,{type:`button`,class:`plain small poll-results-button`,disabled:l===`loading`,onClick:e=>{e.preventDefault(),ee(!k)},title:s(k?{id:`L96xSt`}:{id:`zCjei3`}),children:[M(Q,{icon:k?`eye-open`:`eye-close`,alt:s(k?{id:`L96xSt`}:{id:`zCjei3`})}),` `]}),!m&&!i&&M(`button`,{type:`button`,class:`plain small`,disabled:l===`loading`,onClick:e=>{e.preventDefault(),u(`loading`),(async()=>{await a(),u(`default`)})()},title:s({id:`lCF0wC`}),children:M(Q,{icon:`refresh`,alt:s({id:`lCF0wC`})})})]})]})}var bc=/^http/i,xc=({post:e,instance:t,previewMode:n})=>{let{content:a,emojis:o,language:s,mentions:c,url:l}=e,u=z(i),d=pe(e.id,t),f=u.statusQuotes[d],p=r();return O(()=>{if(!p.current)return;let e=ta(a,{emojis:o,returnDOM:!0});for(let t of e.querySelectorAll(`a.u-url[target="_blank"]`))bc.test(t.innerText.trim())||t.removeAttribute(`target`);p.current.replaceChildren(e.cloneNode(!0))},[a,o?.length]),g(()=>{if(f?.length)for(let e of p.current.querySelectorAll(`a`))f.some(t=>t?.originalURL===e.href)&&e.classList.add(`is-quote`)},[f?.length]),M(`div`,{ref:p,lang:s,dir:`auto`,class:`inner-content`,onClick:ca({mentions:c,instance:t,previewMode:n,statusURL:l})})},Sc=P(((e,t)=>{t.exports=(e,t={})=>{let n=t.char||` `,r=t.count||2,i=0,a=[];return e.reverse().reduce((e,t)=>{a.length&&i&&a[i]&&a[i]===t.substring(1,a[i].length+1)&&(a.splice(i,1),i--);let o=[`${n.repeat(i?i*r:0)}${t}`,...e];return t.substring(0,2)===``&&(i++,a[i]=t.substring(2,t.length-1)),o},[]).join(`
`)}})),Cc=P(((e,t)=>{var n=e=>e.trim().replace(/(^(\s|\t)+|(( |\t)+)$)/gm,``);t.exports={mergeAttributesWithElements:e=>{let t=n(e).split(`
`),r=[],i=``;for(let e=0;e`)){r.push(`${i}${n.slice(0,-2)} />`),i=``;continue}if(n.endsWith(`>`)){r.push(`${i}${n.startsWith(`>`)||n.startsWith(`<`)?``:` `}${n}`),i=``;continue}i+=i.length?` ${n}`:n}return r},removeEmptyLines:n}})),wc=re(P(((e,t)=>{var n=Sc(),{mergeAttributesWithElements:r}=Cc();t.exports=(e,t={})=>n(r(e),t)}))(),1);function Tc(e,t,n=0){let{account:{url:r,displayName:a,acct:o,username:s,emojis:c,bot:l,group:u},id:d,poll:f,spoilerText:p,language:m,editedAt:h,createdAt:g,content:_,mediaAttachments:v,url:y,emojis:b}=e,x=pe(d,t),S=(i.statusQuotes[x]||[]).filter((e,t,n)=>n.findIndex(t=>t.url===e.url)===t),C=S.length&&n<=2?S.map(e=>{let{id:t,instance:r}=e,a=pe(t,r),o=i.statuses[a];if(o)return Tc(o,r,++n)}).join(``):``,w=new Date(g),T=Pi(_,b)+`
`+C+`
`+(f?.options?.length?`
📊:
${f.options.map(e=>`
-
${e.title}
${e.votesCount>=0?` (${e.votesCount})`:``}
`).join(``)}
`:``)+(v.length>0?`
`+v.map(e=>{let{description:t,meta:n,previewRemoteUrl:r,previewUrl:i,remoteUrl:a,url:o,type:s}=e,{original:c={},small:l}=n||{},u=l?.width||c?.width,d=l?.height||c?.height,f=a||o,p=r||i,m=p||f,h=f?URL.parse(f):null,g=s===`unknown`&&h&&/\.(mp4|m4r|m4v|mov|webm)$/i.test(h.pathname),_=s===`unknown`&&h&&/\.(mp3|ogg|wav|m4a|m4p|m4b)$/i.test(h.pathname),v=s===`image`||s===`unknown`&&p&&!g&&!_,y=s===`gifv`||s===`video`||g,b=s===`audio`||_,x=``;return x=v?`
`:y?`
${t?`${t}`:``}
`:b?`
${t?`${t}`:``}
`:`
📄 ${t||f}
`,`${x}`}).join(`
`):``),E=`
${p?`
${p}
${T}
`:T}
`;return(0,wc.default)(E)}function Ec({post:t,instance:n,onClose:r}){let{_:i}=c(),{account:{url:a,displayName:o,username:s,emojis:l,bot:u,group:d},id:f,poll:p,spoilerText:m,language:h,editedAt:g,createdAt:_,content:v,mediaAttachments:y,url:b,emojis:x}=t,S=Tc(t,n);return M(`div`,{id:`embed-post`,class:`sheet`,children:[!!r&&M(`button`,{type:`button`,class:`sheet-close`,onClick:r,children:M(Q,{icon:`x`,alt:i({id:`yz7wBu`})})}),M(`header`,{children:M(`h2`,{children:M(D,{id:`jdVwsS`})})}),M(`main`,{tabIndex:`-1`,children:[M(`h3`,{children:M(D,{id:`GkS6YG`})}),M(`textarea`,{class:`embed-code`,readonly:!0,onClick:e=>{e.target.select()},dir:`auto`,children:S}),M(`button`,{type:`button`,onClick:()=>{try{navigator.clipboard.writeText(S),q(i({id:`bl7nrg`}))}catch{q(i({id:`_KEBaP`}))}},children:[M(Q,{icon:`clipboard`}),` `,M(`span`,{children:M(D,{id:`he3ygx`})})]}),!!y?.length&&M(`section`,{children:[M(`p`,{children:M(D,{id:`_2mUza`})}),M(`ol`,{class:`links-list`,children:y.map(e=>M(`li`,{children:M(`a`,{href:e.remoteUrl||e.url,target:`_blank`,download:!0,children:e.remoteUrl||e.url})},e.id))})]}),!!l?.length&&M(`section`,{children:[M(`p`,{children:M(D,{id:`AeM_di`})}),M(`ul`,{children:l.map(t=>M(`li`,{children:[M(`picture`,{children:[M(`source`,{srcset:t.staticUrl,media:`(prefers-reduced-motion: reduce)`}),M(`img`,{class:`shortcode-emoji emoji`,src:t.url,alt:`:${t.shortcode}:`,width:`16`,height:`16`,loading:`lazy`,decoding:`async`})]}),` `,M(`code`,{children:[`:`,t.shortcode,`:`]}),` (`,M(`a`,{href:t.url,target:`_blank`,download:!0,children:`URL`}),`)`,t.staticUrl?M(e,{children:[` `,`(`,M(`a`,{href:t.staticUrl,target:`_blank`,download:!0,children:M(D,{id:`xiropL`})}),`)`]}):null]},t.shortcode))})]}),!!x?.length&&M(`section`,{children:[M(`p`,{children:M(D,{id:`jzjjJh`})}),M(`ul`,{children:x.map(t=>M(`li`,{children:[M(`picture`,{children:[M(`source`,{srcset:t.staticUrl,media:`(prefers-reduced-motion: reduce)`}),M(`img`,{class:`shortcode-emoji emoji`,src:t.url,alt:`:${t.shortcode}:`,width:`16`,height:`16`,loading:`lazy`,decoding:`async`})]}),` `,M(`code`,{children:[`:`,t.shortcode,`:`]}),` (`,M(`a`,{href:t.url,target:`_blank`,download:!0,children:`URL`}),`)`,t.staticUrl?M(e,{children:[` `,`(`,M(`a`,{href:t.staticUrl,target:`_blank`,download:!0,children:M(D,{id:`xiropL`})}),`)`]}):null]},t.shortcode))})]}),M(`section`,{children:M(`small`,{children:[M(`p`,{children:M(D,{id:`TnJgwX`})}),M(`ul`,{children:[M(`li`,{children:M(D,{id:`0OHPem`})}),M(`li`,{children:M(D,{id:`AzZ5zv`})}),M(`li`,{children:M(D,{id:`NU7wa_`})}),M(`li`,{children:M(D,{id:`R4PmPA`})})]})]})}),M(`h3`,{children:M(D,{id:`rdUucN`})}),M(`output`,{class:`embed-preview`,dangerouslySetInnerHTML:{__html:S},dir:`auto`}),M(`p`,{children:M(`small`,{children:M(D,{id:`j0kZfi`})})})]})]})}function Dc(e){let{_:t}=c(),n=Jo();return M(lr,{...e,"data-read-more":t({id:`8fZueG`}),ref:n})}var Oc=500,kc=30;function Ac({statusId:e,instance:t,onClose:n=()=>{}}){let{_:i}=c(),{masto:a}=l(),[o,s]=A([]),[u,d]=A(`default`),[f,p]=A(null),m=r(null),h=async e=>{m.current=new AbortController;let n=m.current.signal;d(`loading`);let r=0,i=e;for(;i&&!n.aborted&&re.id===i);){let e=me(i,t),o=!!e;if(!o)try{e=await a.v1.statuses.$select(i).fetch(),r++}catch{d(`error`);break}s(t=>[...t,e]),i=e.quote?.quotedStatusId||e.quote?.quotedStatus?.id,!o&&i&&!n.aborted&&rsetTimeout(e,Oc))}n.aborted||(p(i||null),d(`default`))};return g(()=>(h(e),()=>{m.current?.abort()}),[e]),M(`div`,{id:`quote-chain-modal`,class:`sheet`,tabindex:`-1`,children:[n&&M(`button`,{type:`button`,class:`sheet-close`,onClick:n,children:M(Q,{icon:`x`,alt:i({id:`yz7wBu`})})}),M(`header`,{children:[M(`b`,{children:M(D,{id:`BHObg8`})}),` `,o.length>0&&M(`small`,{class:`tag insignificant collapsed`,children:[o.length,(!!f||u===`loading`)&&`+`]})]}),M(`main`,{children:[M(`ul`,{class:`quoted-posts-list`,children:o.map(e=>M(`li`,{class:`quoted-post-item`,children:M(Dc,{to:t?`/${t}/s/${e.id}`:`/s/${e.id}`,class:`status-link`,onContextMenu:e=>{let t=e.target.querySelector(`.status`);if(t){if(e.metaKey)return;e.preventDefault(),t.dispatchEvent(new MouseEvent(`contextmenu`,{clientX:e.clientX,clientY:e.clientY}))}},children:M(Ol,{status:e,instance:t,size:`s`,readOnly:!0,showCommentCount:!0,showQuoteCount:e=>e>1})})},e.id))}),u===`error`?M(`p`,{class:`ui-state`,children:M(D,{id:`Ni40GV`})}):u===`loading`?M(`p`,{class:`ui-state`,children:M(F,{abrupt:!0})}):f?M(`button`,{type:`button`,class:`light block`,onClick:()=>{h(f)},children:[M(Q,{icon:`arrow-down`}),` `,M(D,{id:`UQR9OT`})]}):M(`p`,{class:`ui-state insignificant`,children:M(D,{id:`2EYeAZ`})})]})]})}function jc({onClose:e,post:t,currentPolicy:n}){let{_:r}=c(),{masto:i}=l(),[a,o]=A(`default`),[s,u]=A(n||`public`);return M(`div`,{class:`sheet`,id:`quote-settings-container`,children:[!!e&&M(`button`,{type:`button`,class:`sheet-close`,onClick:e,disabled:a===`loading`,children:M(Q,{icon:`x`,alt:r({id:`yz7wBu`})})}),M(`header`,{children:M(`h2`,{children:M(D,{id:`UWSCwN`})})}),M(`main`,{children:[!!t&&M(`div`,{class:`post-preview`,children:M(Ol,{status:t,size:`s`,readOnly:!0})}),M(`form`,{onSubmit:async n=>{n.preventDefault();let a=new FormData(n.target).get(`quoteApprovalPolicy`);u(a),o(`loading`);try{let n=await i.v1.statuses.$select(t.id).interactionPolicy.update({quote_approval_policy:a});e(!0),q(r({id:`3P1r1z`})),o(`default`),E(n,t.instance,{skipThreading:!0,skipUnfurling:!0})}catch{q(r({id:`hEe3YR`})),o(`error`)}},children:[M(`select`,{value:s,name:`quoteApprovalPolicy`,disabled:a===`loading`,children:[M(`option`,{value:`public`,children:M(D,{id:`hDWXuG`})}),M(`option`,{value:`followers`,children:M(D,{id:`9Ko-Xp`})}),M(`option`,{value:`nobody`,children:M(D,{id:`-bAQ3S`})})]}),` `,M(`button`,{disabled:a===`loading`,children:M(D,{id:`tfDRzk`})})]})]})]})}var Mc=20;function Nc({statusId:t,instance:n,onClose:i=()=>{}}){let{_:a}=c(),{masto:o}=l(),[s,u]=A([]),[d,f]=A(`default`),[p,m]=A(!1),h=r(),_=r(!0),v=(e=!1)=>{(e||!h.current)&&(h.current=o.v1.statuses.$select(t).quotes.list({limit:Mc}).values()),f(`loading`),(async()=>{try{let{done:t,value:n}=await h.current.next();Array.isArray(n)?(u(e?n:e=>[...e,...n]),n.length{v(!0),_.current=!1},[t]),M(`div`,{id:`quotes-modal`,class:`sheet`,tabindex:`-1`,children:[i&&M(`button`,{type:`button`,class:`sheet-close`,onClick:i,children:M(Q,{icon:`x`,alt:a({id:`yz7wBu`})})}),M(`header`,{children:M(`h2`,{children:M(D,{id:`eWLklq`})})}),M(`main`,{children:s.length>0?M(e,{children:[M(`ul`,{class:`quoted-posts-list`,children:s.map(e=>M(`li`,{class:`quoted-post-item`,children:M(lr,{to:n?`/${n}/s/${e.id}`:`/s/${e.id}`,class:`status-link`,onContextMenu:e=>{let t=e.target.querySelector(`.status`);if(t){if(e.metaKey)return;e.preventDefault(),t.dispatchEvent(new MouseEvent(`contextmenu`,{clientX:e.clientX,clientY:e.clientY}))}},children:M(Ol,{status:e,instance:n,size:`s`,readOnly:!0,showCommentCount:!0,showQuoteCount:!0})})},e.id))}),d===`default`?p?M(`button`,{type:`button`,class:`plain block`,onClick:()=>v(),children:M(D,{id:`uXRAkV`})}):M(`p`,{class:`ui-state insignificant`,children:M(D,{id:`2EYeAZ`})}):d===`loading`&&M(`p`,{class:`ui-state`,children:M(F,{abrupt:!0})})]}):d===`loading`?M(`p`,{class:`ui-state`,children:M(F,{abrupt:!0})}):d===`error`?M(`p`,{class:`ui-state`,children:M(D,{id:`3Uoj83`})}):M(`p`,{class:`ui-state insignificant`,children:M(D,{id:`_Xg6f6`})})})]})}var Pc=x((t,n)=>{let{checked:r,count:i,extraCount:a,class:o,title:s,alt:c,size:l,icon:u,iconSize:d=`l`,onClick:f,...p}=t;typeof s==`string`&&(s=[s,s]),typeof c==`string`&&(c=[c,c]);let[m,h]=A(s[0]||``),[_,v]=A(c[0]||``);return g(()=>{r?(h(s[1]||``),v(c[1]||``)):(h(s[0]||``),v(c[0]||``))},[r,s,c]),M(`button`,{ref:n,type:`button`,title:m,class:`plain ${l?`small`:``} ${o} ${r?`checked`:``}`,onClick:e=>{f&&(e.preventDefault(),e.stopPropagation(),f(e))},...p,children:[M(Q,{icon:u,size:d,alt:_}),(!!i||!!a)&&M(e,{children:[` `,!!i&&M(`small`,{title:i,children:la(i)}),!!i&&!!a&&M(`small`,{children:`+`}),!!a&&M(`small`,{title:a,children:la(a)})]})]})}),Fc=class e extends HTMLElement{constructor(){super(),this.isIframeLoaded=!1,this.isPlaylistThumbnailLoaded=!1,this.setupDom()}static get observedAttributes(){return[`videoid`,`playlistid`,`videoplay`,`videotitle`]}connectedCallback(){this.addEventListener(`pointerover`,()=>e.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(){let e=this.attachShadow({mode:`open`}),t=``;window.liteYouTubeNonce&&(t=`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,t,n){t!==n&&(e===`playlistid`&&t!==null&&t!==n&&(this.isPlaylistThumbnailLoaded=!1),this.setupComponent(),this.domRefFrame.classList.contains(`activated`)&&(this.domRefFrame.classList.remove(`activated`),this.shadowRoot.querySelector(`iframe`).remove(),this.isIframeLoaded=!1))}injectSearchNoScript(){let e=document.createElement(`noscript`);this.prepend(e),e.innerHTML=this.generateIframe()}generateIframe(e=!1){let t=+!e,n=this.autoPause?`&enablejsapi=1`:``,r=this.noCookie?`-nocookie`:``,i;return i=this.playlistId?`?listType=playlist&list=${this.playlistId}&`:`${this.videoId}?`,this.isYouTubeShort()&&(this.params=`loop=1&mute=1&modestbranding=1&playsinline=1&rel=0&enablejsapi=1&playlist=${this.videoId}`,t=1),`
`}addIframe(e=!1){if(!this.isIframeLoaded){let t=this.generateIframe(e);this.domRefFrame.insertAdjacentHTML(`beforeend`,t),this.domRefFrame.classList.add(`activated`),this.isIframeLoaded=!0,this.attemptShortAutoPlay(),this.dispatchEvent(new CustomEvent(`liteYoutubeIframeLoaded`,{detail:{videoId:this.videoId},bubbles:!0,cancelable:!0}))}}initImagePlaceholder(){this.playlistId&&!this.videoId?this.loadPlaylistThumbnail():this.testPosterImage(),this.domRefImg.fallback.setAttribute(`aria-label`,`${this.videoPlay}: ${this.videoTitle}`),this.domRefImg?.fallback?.setAttribute(`alt`,`${this.videoPlay}: ${this.videoTitle}`)}async loadPlaylistThumbnail(){if(!this.isPlaylistThumbnailLoaded){this.isPlaylistThumbnailLoaded=!0;try{let e=`https://www.youtube.com/oembed?url=https://www.youtube.com/playlist?list=${this.playlistId}&format=json`,t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch playlist thumbnail: ${t.status}`);let n=await t.json();if(n.thumbnail_url){let e=n.thumbnail_url,t=e.match(/\/vi\/([^\/]+)\//);if(t){let e=t[1];this.loadThumbnailImages(e)}else this.domRefImg.fallback.src=e,this.domRefImg.fallback.loading=this.posterLoading}}catch(e){console.warn(`Failed to load playlist thumbnail:`,e)}}}loadThumbnailImages(e){let t=`https://i.ytimg.com/vi_webp/${e}/${this.posterQuality}.webp`;this.domRefImg.webp.srcset=t;let n=`https://i.ytimg.com/vi/${e}/${this.posterQuality}.jpg`;this.domRefImg.jpeg.srcset=n,this.domRefImg.fallback.src=n,this.domRefImg.fallback.loading=this.posterLoading}async testPosterImage(){setTimeout(()=>{let e=`https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`,t=new Image;t.fetchPriority=`low`,t.referrerPolicy=`origin`,t.src=e,t.onload=async e=>{let t=e.target;t?.naturalHeight==90&&t?.naturalWidth==120&&(this.posterQuality=`hqdefault`),this.loadThumbnailImages(this.videoId)}},100)}initIntersectionObserver(){new IntersectionObserver((t,n)=>{t.forEach(t=>{t.isIntersecting&&!this.isIframeLoaded&&(e.warmConnections(this),this.addIframe(!0),n.unobserve(this))})},{root:null,rootMargin:`0px`,threshold:0}).observe(this),this.autoPause&&new IntersectionObserver((e,t)=>{e.forEach(e=>{e.intersectionRatio!==1&&this.shadowRoot.querySelector(`iframe`)?.contentWindow?.postMessage(`{"event":"command","func":"pauseVideo","args":""}`,`*`)})},{threshold:1}).observe(this)}attemptShortAutoPlay(){this.isYouTubeShort()&&setTimeout(()=>{this.shadowRoot.querySelector(`iframe`)?.contentWindow?.postMessage(`{"event":"command","func":"playVideo","args":""}`,`*`)},2e3)}isYouTubeShort(){return this.getAttribute(`short`)===``&&window.matchMedia(`(max-width: 40em)`).matches}static addPrefetch(e,t){let n=document.createElement(`link`);n.rel=e,n.href=t,n.crossOrigin=`true`,document.head.append(n)}static warmConnections(t){e.isPreconnected||window.liteYouTubeIsPreconnected||(e.addPrefetch(`preconnect`,`https://i.ytimg.com/`),e.addPrefetch(`preconnect`,`https://s.ytimg.com`),t.noCookie?e.addPrefetch(`preconnect`,`https://www.youtube-nocookie.com`):(e.addPrefetch(`preconnect`,`https://www.youtube.com`),e.addPrefetch(`preconnect`,`https://www.google.com`),e.addPrefetch(`preconnect`,`https://googleads.g.doubleclick.net`),e.addPrefetch(`preconnect`,`https://static.doubleclick.net`)),e.isPreconnected=!0,window.liteYouTubeIsPreconnected=!0)}};Fc.isPreconnected=!1,customElements.define(`lite-youtube`,Fc);function Ic({authors:e,hidden:t,children:n}){if(t||!e?.[0]?.account?.id)return n;let r=e[0].account;return M(`div`,{class:`card-byline`,children:[n,M(`div`,{class:`card-byline-author`,children:[M(Q,{icon:`link`,size:`s`}),` `,M(`small`,{children:M(D,{id:`4LHHK6`,components:{0:M(si,{account:r,showAvatar:!0})}})})]})]})}function Lc(e){return[`x.com`,`twitter.com`,`threads.net`,`bsky.app`,`bsky.brid.gy`,`fed.brid.gy`].includes(e)}function Rc({card:t,selfReferential:n,selfAuthor:r,instance:o}){let c=z(i),{blurhash:l,title:u,description:d,html:f,providerName:p,providerUrl:m,authorName:h,authorUrl:v,width:y,height:b,image:x,imageDescription:S,url:C,type:w,embedUrl:T,language:E,publishedAt:D,authors:O}=t,k=u||p||h,ee=y/b>=1.2?`large`:``,[te,j]=A(null);if(g(()=>{if(!k||!x||n||!ae(C))return;let e=new AbortController;return s(o,C,e.signal).then(e=>{if(!e)return;let{id:t,url:n}=e;j(`#`+n)}),()=>{e.abort()}},[k,x,n]),c.unfurledLinks[C])return null;let N=/