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A1pD,CAAA,EACuB0pD,QAAkBC,EAAA,yBAAlBD,cAAkB,KAI1C","names":["F","V","g","X","P","r","b","a","c","i","l","o","T","W","v","B","Y","Z","$","_","z","m","O","ee","f","y","k","e","s","d","C","H","h","G","I","te","q","N","J","ne","oe","S","D","ce","Q","U","se","w","u","p","j","E","M","x","L","K","root","factory","module","this","global","Toastify","options","version","divElement","property","avatarElement","closeElement","event","width","self","getAxisOffsetAValue","xOffset","yOffset","rootElement","elementToInsert","toastElement","topLeftOffsetSize","topRightOffsetSize","offsetSize","allToasts","classUsed","containsClass","height","offset","axis","elem","yourClass","window","_showToast","showToast","props","text","onClick","delay","rest","toast","className","destination","gravity","position","setTimeout","useInterval","fn","deps","immediate","savedCallback","useRef","useEffect","current","id","setInterval","tick","clearInterval","isMenuOpen","state","batchedUpdates","unstable_batchedUpdates","getTransition","transition","name","safeCall","arg","internalKey","getName","component","mergeProps","target","source","key","targetProp","sourceProp","parsePadding","paddingStr","padding","top","right","getScrollAncestor","node","overflow","overflowX","overflowY","commonProps","isDisabled","isHovering","indexOfNode","nodeList","useBEM","block","element","modifiers","useMemo","blockElement","classString","value","expandedClassName","menuContainerClass","menuClass","menuArrowClass","menuItemClass","menuDividerClass","menuHeaderClass","menuGroupClass","subMenuClass","HoverItemContext","createContext","MenuListItemContext","MenuListContext","EventHandlersContext","RadioGroupContext","SettingsContext","Keys","HoverActionTypes","CloseReason","FocusPositions","MenuStateMap","positionAbsolute","roleNone","roleMenuitem","noScrollFocus","MenuContainer","containerRef","containerProps","children","isOpen","theming","onClose","itemTransition","jsx","createSubmenuCtx","timer","count","closeDelay","pending","settled","useItems","menuRef","hoverItem","setHoverItem","useState","mutableState","updateItems","useCallback","item","isMounted","items","index","dispatch","actionType","nextIndex","hoverIndex","sortItems","orderedNodes","newItem","prevItem","getNativeDimension","transformed","untransformed","getNormalizedClientRect","rect","getPositionHelpers","containerElt","menuElt","menuScroll","boundingBoxPadding","menuRect","containerRect","boundingRect","getLeftOverflow","getRightOverflow","getTopOverflow","getBottomOverflow","leftOverflow","rightOverflow","topOverflow","bottomOverflow","placeArrowVertical","arrowRef","menuY","anchorRect","placeLeftorRight","placeLeftorRightY","placeLeftX","placeRightX","confineHorizontally","confineVertically","arrow","direction","computedDirection","placeArrowHorizontal","menuX","placeToporBottom","placeToporBottomX","placeTopY","placeBottomY","positionMenu","align","gap","shift","positionHelpers","isHorizontal","horizontalOffset","verticalOffset","arrowElt","useIsomorphicLayoutEffect","useLayoutEffect","setRef","ref","instance","useCombinedRef","refA","refB","offScreen","MenuList","ariaLabel","menuClassName","menuStyle","arrowProps","anchorPoint","anchorRef","externalRef","parentScrollingRef","setDownOverflow","repositionFlag","captureFocus","endTransition","menuItemFocus","_1","restProps","menuPosition","setMenuPosition","arrowPosition","setArrowPosition","overflowData","setOverflowData","expandedDirection","setExpandedDirection","submenuCtx","reposSubmenu","forceReposSubmenu","useReducer","boundingBoxRef","rootMenuRef","rootAnchorRef","scrollNodesRef","reposition","viewScroll","submenuCloseDelay","useContext","parentSubmenuCtx","reposFlag","prevOpen","openTransition","closeTransition","scrollNodes","onKeyDown","onAnimationEnd","onPointerMove","onPointerLeave","handlePosition","noOverflowCheck","_a","arrowX","arrowY","menuHeight","overflowAmt","anchorScroll","scroll","handleScroll","scrollObservers","hasOverflow","parentScroll","targetList","resizeObserver","entries","flushSync","resizeObserverOptions","anchor","alwaysUpdate","setItemFocus","itemContext","maxHeight","listContext","overflowStyle","arrowModifiers","_arrowClassName","menu","ControlledMenu","forwardRef","initialMounted","unmountOnClose","transitionTimeout","submenuOpenDelay","portal","onItemClick","settings","eventHandlers","isCheckorRadio","keepOpen","menuList","createPortal","PRE_ENTER","ENTERING","ENTERED","PRE_EXIT","EXITING","EXITED","UNMOUNTED","STATUS","getState","status","startOrEnd","unmounted","getEndStatus","unmountOnExit","getTimeout","timeout","nextTick","transitState","updateState","setState","latestState","timeoutId","onChange","useTransitionState","enter","exit","preEnter","preExit","initialEntered","mountOnEnter","enterTimeout","exitTimeout","toggle","toEnter","enterStage","useMenuState","initialOpen","onMenuChange","toggleMenu","isEnter","isResolved","useMenuStateAndFocus","menuProps","setMenuItemFocus","openMenu","useClick","onToggle","skipOpen","isLegacyReact","Menu","menuButton","instanceRef","stateProps","buttonRef","anchorProps","handleClose","button","buttonProps","renderButton","cloneElement","useImperativeHandle","jsxs","Fragment","withHovering","WrappedComponent","Component","memo","WithHovering","itemRef","useItemEffect","SubMenu","disabled","label","openTrigger","_2","itemProps","parentMenuRef","parentDir","parentOverflow","isParentOpen","isPortal","_openMenu","timerId","stopTimer","args","setHover","delayOpen","onKeyDownOfRoot","handled","externalItemRef","itemClassName","restItemProps","mergedItemProps","getMenuList","container","useItemState","focusRef","unsetHover","onBlur","keepHover","MenuItem","href","type","checked","restStateProps","radioGroup","isRadio","isCheckBox","isAnchor","isChecked","handleClick","handleKeyDown","mergedProps","menuItemProps","FocusableItem","renderChildren","MenuDivider","MenuHeader","MenuGroup","style","takeOverflow","setOverflowStyle","A","R","t","n","defaultLocale","mem","Intl","DateTimeFormat","resolvedOptions","locale","_DateTimeFormat","opts","dateYear","hideTime","formatOpts","forceOpts","regionlessLocale","replace","loc","localeMatch","currentYear","Date","getFullYear","year","undefined","month","day","hour","minute","niceDateTime","date","dtfOpts","i18n","format","openCompose","url","URL","parse","location","screenWidth","screenHeight","screen","left","Math","max","min","winUID","uid","random","newWin","open","__COMPOSE__","alert","_i18n","isSafari","test","navigator","userAgent","openOSK","fauxEl","document","createElement","opacity","body","appendChild","focus","removeChild","documentElement","getComputedStyle","defaultBoundingBoxPadding","safeAreaInsets","getSafeAreaInsets","safeAreaInsetTop","getPropertyValue","safeAreaInsetRight","safeAreaInsetBottom","safeAreaInsetLeft","parseInt","requestAnimationFrame","safeBoundingBoxPadding","paddings","map","join","CSS","supports","addEventListener","passive","TOAST_DURATION","showCompose","states","composerState","minimized","duration","div","getHTMLText","html","preProcess","innerHTML","querySelectorAll","forEach","br","replaceWith","el","remove","append","innerText","trim","statusPeek","spoilerText","content","poll","mediaAttachments","length","multiple","title","image","gifv","video","audio","unknown","ICONS","__vitePreload","heart","bookmark","check-circle","x-circle","transfer","rocket","rtl","arrow-up","arrow-down","earth","lock","unlock","eye-close","eye-open","message","comment","comment2","home","notification","follow","follow-add","pencil","quill","at","attachment","upload","gear","more","more2","external","popout","popin","rotate","plus","chevron-down","reply","flip","thread","group","bot","list","search","hashtag","info","shortcut","user","following","pin","unpin","bus","link","history","share","sparkles","sparkles2","translate","play","trash","mute","unmute","unblock","flag","time","refresh","emoji2","filter","filters","chart","react","layout4","layout5","announce","round","arrow-up-circle","arrow-down-circle","clipboard","account-edit","account-warning","keyboard","cloud","media","speak","building","history2","code","copy","quote","heart-break","user-x","minimize","celebrate","schedule","camera","SIZES","xl","xxl","ICONDATA","SVGICon","moize","_jsx","viewBox","dangerouslySetInnerHTML","__html","transform","isShallowEqual","maxSize","Object","keys","matchesArg","cacheKeyArg","keyArg","icon","Icon","size","alt","class","iconSize","iconBlock","warn","Array","iconData","setIconData","currentIcon","iconB","Link","routerLocation","useLocation","hash","to","includes","parsedHash","origin","searchParams","searchParamsStr","from","encodeURIComponent","pathname","isActive","decodeURIComponent","currentTarget","parentNode","closest","stopPropagation","prevLocation","MenuLink","closeMenu","detail","isValidDate","isNaN","getTime","resolvedLocale","DTF","lang","RTF","RelativeTimeFormat","rtfFromNow","rtf","seconds","now","absSeconds","abs","floor","twitterFromNow","values","0","RelativeTime","datetime","renderCount","rerender","dateStr","dt","str","dateStyle","toISOString","toLocaleString","raf","rafRerender","scheduleRerender","clearTimeout","cancelAnimationFrame","SubMenu2","pointerType","useCloseWatcher","console","watcher","CloseWatcher","useCloseWatcher$1","$modalContainer","getElementById","getBackdropThemeColor","Modal","modalRef","focusElement","querySelector","supportsCloseWatcher","escRef","useHotkeys","enabled","keydown","keyup","$deckContainers","page","tabIndex","$deckContainer","setAttribute","removeAttribute","$meta","metaColor","store","local","get","backdropColor","colorScheme","log","Modal2","_b","xxxl","alphaCache","canvas","OffscreenCanvas","ctx","getContext","willReadFrequently","imageSmoothingEnabled","MISSING_IMAGE_PATH_REGEX","Avatar","staticUrl","squircle","avatarRef","isMissing","_jsxs","srcset","src","loading","decoding","fetchPriority","crossOrigin","onError","onLoad","dataset","loaded","drawImage","allPixels","getImageData","hasAlpha","data","pixel","classList","add","clearRect","IS_RTL","observer","MutationObserver","mutations","mutation","dir","isRTL","observe","useWindowSize","setSize","handleResize","innerWidth","innerHeight","removeEventListener","Menu2","_instanceRef","rtlAlign","MenuConfirm","subMenu","confirm","confirmLabel","menuItemClassName","menuFooter","menuExtras","CustomEmoji","shortcodesRegexp","shortcodes","RegExp","EmojiText","emojis","indexOf","regex","shortcode","elements","split","word","emoji","find","nameCollator","sensitivity","Collator","ACCT_REGEX","SHORTCODES_REGEX","SPACES_REGEX","NON_ALPHA_NUMERIC_REGEX","NameText","account","showAvatar","showAcct","short","useLingui","acct","avatar","avatarStatic","displayName","username","acct1","acct2","match","api","trimmedUsername","toLowerCase","trimmedDisplayName","shortenedDisplayName","shortenedAlphaNumericDisplayName","hideUsername","compare","shiftKey","preventDefault","metaKey","ctrlKey","which","internalURL","showAccount","_Fragment","codeMappings","zh_HANT","IntlDN","DisplayNames","_localeCode2Text","fallback","of","anotherText","yetAnotherText","translangLanguagesNative","localeCode2Text","translationTargetLanguages","languages","tl","locales","localeTargetLanguages","getTranslateTargetLanguage","fromSettings","contentTranslationTargetLanguage","BYTES_UNITS","prettyBytes","bytes","unitIndex","log2","number","unit","unitDisplay","maximumFractionDigits","containPixelfed","notContainPixelfed","containPleroma","containAkkoma","platformFeatures","supportsCache","feature","domain","getCurrentInstance","softwareName","getCurrentNodeInfo","software","range","features","doesSoftwareMatch","satisfies","includePrerelease","loose","maxInt","base","tMin","tMax","skew","damp","initialBias","initialN","delimiter","regexPunycode","regexNonASCII","regexSeparators","errors","baseMinusTMin","stringFromCharCode","error","array","callback","result","mapDomain","parts","labels","encoded","ucs2decode","string","output","counter","extra","ucs2encode","codePoints","basicToDigit","codePoint","digitToBasic","digit","adapt","delta","numPoints","firstTime","decode","input","inputLength","bias","basic","oldi","baseMinusT","out","encode","currentValue","basicLength","handledCPCount","handledCPCountPlusOne","qMinusT","toUnicode","toASCII","punycode","emojifyText","fauxDiv","whitelistLinkClasses","HTML_CHARS_REGEX","escapeHTML","LINK_REGEX","HTTP_LINK_REGEX","MENTION_REGEX","HASHTAG_REGEX","CODE_BLOCK_REGEX","CODE_BLOCK_START_REGEX","CODE_BLOCK_END_REGEX","INLINE_CODE_REGEX","TWITTER_DOMAIN_REGEX","TWITTER_MENTION_REGEX","TWITTER_MENTION_CAPTURE_REGEX","CODE_INLINE_CAPTURE_REGEX","createDOM","isDocumentFragment","tpl","_enhanceContent","returnDOM","postEnhanceDOM","enhancedContent","dom","hasLink","hasCodeBlock","noTargetBlankLinks","links","textContent","shortenLink","usernames","hasChildren","some","push","slice","textNodes","extractTextNodes","nodeValue","childNodes","blocks","pre","codeBlocks","nextParagraphs","currentBlock","nextElementSibling","next","tagName","codeText","replaceAll","rejectFilter","prevIndex","hashtagStuffedParagraphs","hashtagCount","nodeType","Node","TEXT_NODE","linkText","startsWith","imgs","img","getAttribute","naturalWidth","naturalHeight","setProperty","span","replaceChild","queueMicrotask","enhanceContent","defaultRejectFilter","defaultRejectFilterMap","fromEntries","nodeName","URL_PREFIX_REGEX","URL_DISPLAY_LENGTH","prefix","displayURL","suffix","cutoff","rejectFilterMap","assign","reduce","acc","cur","walk","createTreeWalker","NodeFilter","SHOW_TEXT","acceptNode","FILTER_REJECT","FILTER_ACCEPT","nextNode","handleContentLinks","mentions","previewMode","statusURL","altKey","prevText","previousSibling","textBeforeLinkIsAt","endsWith","textStartsWithAt","contains","targetText","mention","textBeforeLinkIsHash","tag","hashURL","i18nDuration","shortenNumber","num","notation","roundingMode","AccountBlock","skeleton","avatarSize","useAvatarStatic","internal","showActivity","showStats","accountInstance","hideDisplayName","relationship","excludeRelationshipAttrs","_useLingui","statusesCount","lastStatusAt","fields","note","followersCount","createdAt","locked","verifiedField","verifiedAt","excludedRelationship","hasRelationship","followedBy","requested","_t","_Trans","components","RetryOperation","timeouts","retry_operation","err","currentTime","timeoutOps","counts","mainError","mainErrorCount","require$$0","exports","attempt","obj","methods","method","original","op","retry","objectToString","isError","errorMessages","isNetworkError","AbortError","decorateErrorWithCounts","attemptNumber","retriesLeft","pRetry","resolve","reject","operation","abortHandler","cleanUp","finalError","supportsBrowserTranslator","ai","langDetector","canDetect","languageDetector","capabilities","create","monitor","detectedSourceLanguage","originalSource","results","canTranslate","translatorCapabilities","translator","sourceLanguage","targetLanguage","__defProp","__defNormalProp","__publicField","observerMap","RootIds","rootId","unsupportedValue","getRootId","optionsToId","createObserver","thresholds","entry","inView","threshold","fallbackInView","bounds","callbacks","isPlainChildren","InView","React.Component","prevProps","rootMargin","trackVisibility","as","triggerOnce","skip","initialInView","React.createElement","useInView","React2.useState","React2.useRef","React2.useEffect","unobserve","entryTarget","previousEntryTarget","TOP","shazamIDs","LazyShazam","hasID","visible","setVisible","visibleStart","setVisibleStart","getBoundingClientRect","bottom","hidden","sourceLanguages","sl","PHANPY_TRANSLANG_INSTANCES","import","TRANSLANG_INSTANCES","throttle","pThrottle","limit","interval","TRANSLATED_MAX_AGE","currentTranslangInstance","_translangTranslate","fetchCall","tooLong","fetchPromise","fetch","priority","referrerPolicy","JSON","res","ok","provider","translated_text","detected_language","retries","onFailedAttempt","translangTranslate","pmem","forceTranslate","onTranslate","mini","autoDetected","uiState","setUIState","targetLang","setTranslatedContent","pronunciationContent","detailsRef","translatedContent","sourceLangText","targetLangText","apiSourceLang","browserTranslate","throttledTranslangTranslate","detectedLangText","setDetectedLang","pronunciation","setPronunciationContent","detectedLang","common","showCommon","native","abrupt","TranslationBlock$1","TranslationBlock","promisifyRequest","request","createStore","dbName","storeName","dbp","txMode","db","defaultGetStoreFunc","defaultGetStore","customStore","set","getMany","del","delMany","clear","eachCursor","cursor","initDB","val","drafts","catchup","fetchRelationships","accounts","relationshipsMap","masto","currentAccount","getCurrentAccountID","uniqueAccountIds","v1","relationships","LiteYTEmbed","shadowDom","nonce","oldVal","newVal","eleNoScript","isIntersectionObserver","autoplay","wantsNoCookie","embedTarget","iframeHTML","webpUrl","posterUrlWebp","posterUrlJpeg","kind","linkElem","context","digitLookup","decode83","start","end","pow","PI","PI2","sRGBToLinear","linearTosRGB","signSqr","fastCos","cos","getBlurHashAverageColor","blurHash","decodeBlurHash","punch","sizeFlag","numX","numY","basis","basisY","colorIndex","pixelIndex","maximumValue","colors","averageColor","cosinesY","cosinesX","bytesPerRow","pixels","addIndentation_1","splittedHtml","char","level","opened","indented","elTag","newIndented","removeEmptyLines","nonFormattedString","toLines","markup","splittedMarkup","mergedLines","currentElement","line","addIndentation","mergeAttributesWithElements","require$$1","splitted","Poll","readOnly","votePoll","expired","expiresAt","ownVotes","voted","votersCount","votesCount","expiresAtDate","pollVotesCount","roundPrecision","showResults","setShowResults","optionsHaveVoteCounts","every","option","optionVotesCount","ratio","percentage","isLeading","onSubmit","form","formData","FormData","choices","1","FilterContext","_isFiltered","filtered","filterContext","appliedFilters","hasContext","filterAction","action","filterTitles","titles","titlesStr","isFiltered","filteredItem","currentAccountID","filterState","filteredItems","getDomain","hostname","htmlContentLength","supportsTTS","speechSynthesis","speaking","cancel","utterance","SpeechSynthesisUtterance","useResolvedElement","subscriber","refOrElement","lastReportRef","refOrElementRef","cbElementRef","evaluateSubscription","cbElement","extractSize","boxProp","sizeType","useResizeObserver","onResize","onResizeRef","resizeObserverRef","_useState","didUnmount","previous","refCallback","reportedWidth","reportedHeight","newWidth","newHeight","newSize","useTruncated","useThrottledCallback","scrollHeight","truncated","_height","computedHeight","box","visibilityIconsMap","public","unlisted","private","direct","styleRoot","styleChild","styles","isSsr","isTouch","make3dTransformValue","scale","getOffsetBounds","containerDimension","childDimension","centerContained","diff","classnames","other","sqrt","isMac","isDragInteraction","isZoomInteraction","isZoomGesture","wheelEvent","cancelEvent","getDistance","calculateScale","startTouches","endTouches","startDistance","endDistance","isCloseTo","expected","swing","getPointByPageCoordinates","touch","getPageCoordinatesByTouches","touches","sum","getVectorAvg","vectors","clamp","shouldInterceptWheel","getElementSize","offsetWidth","offsetHeight","calculateVelocity","startPoint","endPoint","comparePoints","p1","p2","noup","zeroPoint","PinchZoom","_super","__extends","_this","__assign","createRef","clickEvent","touchEndEvent","touchStartEvent","touchMoveEvent","pageX","pageY","deltaY","deltaMode","scaleDelta","likeTouchEvent","center","dScale","inertiaFriction","inertia","renderFrame","prevOffset","currentCoordinates","prevPoint","newScale","touchCenter","needZoomOut","zoomFactor","startZoomFactor","updateProgress","progress","elWidth","elHeight","minOffsetX","maxOffsetX","_c","minOffsetY","maxOffsetY","__x","__y","animated","startOffset","containerCenter","diffZoomFactor","diffOffset","updateFrame","originalZoomFactor","lastCenter","sanitizedOffset","targetOffset","scaleFactor","offsetLeft","offsetTop","_document","_html","_body","scrollTop","scrollLeft","posTop","posLeft","frameFn","startTime","timeFn","frameTime","xZoomFactor","yZoomFactor","eventName","_i","newInteraction","interaction","fingers","mouseEvent","isEnd","isStart","child","Children","React","any","object","func","bool","formatDuration","hours","minutes","toString","padStart","dataAltLabel","AltBadge","showMediaAlt","MEDIA_CAPTION_LIMIT","MEDIA_CAPTION_LIMIT_LONGER","isMediaCaptionLong","caption","Media","showOriginal","autoAnimate","showCaption","allowLongerCaption","altIndex","checkAspectRatio","blurhash","description","meta","previewRemoteUrl","previewUrl","remoteUrl","small","mediaURL","remoteMediaURL","hasDimensions","orientation","rgbAverageColor","videoRef","focalPosition","toFixed","mediaRef","onUpdate","removeProperty","touchAction","pinchZoomEnabled","setPinchZoomEnabled","quickPinchZoomProps","draggableUnZoomed","tapZoomFactor","doubleTapToggleZoom","mediaLoadError","setMediaLoadError","Parent","remoteMediaURLObj","getURLObj","isVideoMaybe","isAudioMaybe","isImage","isPreviewVideoMaybe","parentRef","imageSmallerThanParent","setImageSmallerThanParent","smaller","maxAspectHeight","averageColorStyle","mediaStyles","aspectRatio","longDesc","showInlineDesc","Figure","hasNaturalAspectRatio","setHasNaturalAspectRatio","display","mode","backgroundImage","backgroundSize","QuickPinchZoom","objectPosition","$media","clientWidth","clientHeight","minDimension","hasSmallDimension","displayNaturalHeight","hasDuration","shortDuration","isGIF","loopable","formattedDuration","hoverAnimate","autoGIFAnimate","showProgress","gifHTML","videoHTML","pause","onMouseEnter","onMouseLeave","onFocus","poster","preload","playsinline","loop","muted","onTimeUpdate","disablePictureInPicture","onLoadedMetadata","controls","autoPlay","oldProps","newProps","oldMedia","newMedia","SHOW_COMMENT_COUNT_LIMIT","INLINE_TRANSLATE_LIMIT","fetchAccount","$select","memFetchAccount","visibilityText","isIOS","ontouchstart","REACTIONS_LIMIT","getPollText","getPostText","maskCustomEmojis","emojisRegex","forgivingQSA","selectors","selector","isTranslateble","getHTMLTextForDetectLang","HTTP_REGEX","PostContent","post","language","divRef","replaceChildren","cloneNode","SIZE_CLASS","detectLang","langs","detect","groupCollapsed","detectedLanguage","langs2","lang2","detectAll","readMoreText","DIFFERENT_LANG_CHECK","checkDifferentLanguage","contentTranslationHideLanguages","different","getCurrentAccID","getPrefs","Status","statusID","contentTextWeight","enableCommentHint","withinContext","enableTranslate","allowFilters","onMediaClick","quoted","onStatusLinkClick","allowContextMenu","showFollowedTags","showActionsBar","showReplyParent","mediaFirst","authenticated","propInstance","currentInstance","statusKey","sameInstance","snapStates","sKey","accountEmojis","repliesCount","reblogged","reblogsCount","favourited","favouritesCount","bookmarked","sensitive","visibility","editedAt","card","inReplyToId","inReplyToAccountId","reblog","uri","pinned","_pinned","emojiReactions","languageAutoDetected","_language","detected","setLanguageAutoDetected","hasMediaAttachments","accountId","isSelf","filterInfo","debugHover","FilteredStatus","createdAtDate","inReplyToAccountRef","accountURL","editedAtDate","inReplyToAccount","account2","setInReplyToAccount","catch","readingExpandMedia","mentionSelf","readingExpandSpoilers","showSpoiler","showSpoilerMedia","FollowedTagsParent","StatusParent","setForceTranslate","_forceTranslate","contentTranslation","contentTranslationAutoInline","isSizeLarge","inlineTranslate","spoilerContentRef","contentRef","contentLength","statusRef","unauthInteractionErrorMessage","canBoost","textWeight","createdDateText","editedDateText","mediaNoDesc","statusMonthsAgo","confirmBoostStatus","newStatus","statuses","saveStatus","favouriteStatus","done","bookmarkStatus","differentLanguage","setDifferentLanguage","reblogIterator","fetchBoostedLikedByAccounts","firstLoad","reblogResults","favouriteResults","Promise","_types","actionsRef","replyStatus","draftStatus","favouriteStatusNotify","bookmarkStatusNotify","fetchAccounts","postText","setShowEdited","nicePostURL","isPublic","setShowEmbed","isPinnable","getStatus","cachedStatus","isContextMenuOpen","setIsContextMenuOpen","setContextMenuProps","_deleted","bindLongPressContext","clientX","clientY","showContextMenu","useLongPress","hotkeysEnabled","dRef","bRef","rRef","fRef","xRef","activeStatus","spoilerButton","spoilerMediaButton","useKey","showMultipleMediaCaptions","displayedMediaAttachments","attachments","indices","captionChildren","showCommentHint","isThread","statusThreadNumber","showCommentCount","nodeRef","containsQuestion","selection","anchorNode","contextMenuProps","contextMenuRef","StatusMenuItems","spoilers","spoilersMedia","QuoteStatuses","newPoll","pollResponse","polls","then","MultipleMediaFigure","mediaContainerRef","_d","selfAuthor","me","url2","emojiReaction","isShortCode","StatusButton","showEdited","showEmbed","EmbedModal","fetchStatusHistory","MediaFirstContainer","setCurrentIndex","carouselRef","postID","moreThanOne","currentIndex","scrollTo","behavior","isCardPost","Byline","authors","author","Card","selfReferential","useSnapshot","providerName","providerUrl","authorName","authorUrl","imageDescription","embedUrl","publishedAt","hasText","isLandscape","cardStatusURL","unfurlMastodonLink","setCardStatusURL","showEmbedModal","imageData","hasIframeHTML","blurhashImage","blob","setBlurhashImage","putImageData","isPost","convertToBlob","videoID","EditedAtModal","editHistory","setEditHistory","editHistory2","Loader","_t2","uniqueQuotes","arr","q2","quotes","findIndex","contentHTML","previewMediaURL","sourceMediaURL","sourceMediaURLObj","isVideo","mediaHTML","htmlCode","prettify","_t3","download","otherProps","buttonTitle","setButtonTitle","iconAlt","setIconAlt","host","restPath","path","StatusCompact","statusReply","urlObj","filterTitleStr","srKey","statusPeekText","bindLongPressPeek","setShowPeek","actualStatusID","ssKey","isReblog","showPeek","_t4","statusPeekRef","restNewProps","IDX","HEX","len","isArray","getTag","INFINITY","baseToString","isString","isNumber","isBoolean","isObjectLike","isObject","isDefined","isBlank","INCORRECT_INDEX_TYPE","LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY","PATTERN_LENGTH_TOO_LARGE","MISSING_KEY_PROPERTY","INVALID_KEY_WEIGHT_VALUE","hasOwn","KeyStore","totalWeight","createKey","keyId","weight","getFn","createKeyPath","createKeyId","deepGet","MatchOptions","BasicOptions","FuzzyOptions","AdvancedOptions","Config","SPACE","norm","mantissa","cache","numTokens","FuseIndex","fieldNormWeight","docs","records","idx","doc","docIndex","record","keyIndex","subRecords","stack","nestedArrIndex","subRecord","createIndex","myIndex","parseIndex","computeScore$1","pattern","currentLocation","expectedLocation","distance","ignoreLocation","accuracy","proximity","convertMaskToIndices","matchmask","minMatchCharLength","MAX_BITS","patternAlphabet","findAllMatches","includeMatches","patternLen","textLen","currentThreshold","bestLocation","computeMatches","matchMask","score","lastBitArr","finalScore","binMax","mask","binMin","binMid","finish","bitArr","charMatch","createPatternAlphabet","stripDiacritics","BitapSearch","isCaseSensitive","ignoreDiacritics","addChunk","startIndex","remainder","allIndices","totalScore","hasMatches","alphabet","isMatch","BaseMatch","getMatch","exp","matches","ExactMatch","InverseExactMatch","PrefixExactMatch","InversePrefixExactMatch","SuffixExactMatch","InverseSuffixExactMatch","FuzzyMatch","IncludeMatch","searchers","searchersLen","SPACE_RE","OR_TOKEN","parseQuery","query","queryItem","found","searcher","token","MultiMatchSet","ExtendedSearch","numMatches","qLen","pLen","registeredSearchers","register","createSearcher","searcherClass","LogicalOperator","KeyType","isExpression","isPath","isLeaf","convertToExplicit","auto","isQueryPath","computeScore","ignoreFieldNorm","transformMatches","transformScore","includeScore","transformers","transformer","Fuse","predicate","shouldSort","sortFn","expression","evaluate","resultMap","expResults","MIN_SCHEDULED_AT","MAX_SCHEDULED_AT","ScheduledAtField","scheduledAt","setScheduledAt","minStr","setMinStr","timezoneOffset","updateMinStr","updateMaxStr","setMaxStr","intervalId","defaultValue","maxStr","required","getLocalTimezoneName","formatToParts","part"],"ignoreList":[0,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,64,71,72,73,74,75,77,80,83,84,85,86,87,94,95,98,99,100,101,105,106],"sources":["../../node_modules/react-hotkeys-hook/packages/react-hotkeys-hook/dist/index.js","../../node_modules/toastify-js/src/toastify.js","../../src/utils/show-toast.js","../../src/utils/useInterval.js","../../node_modules/@szhsin/react-menu/dist/esm/utils/utils.mjs","../../node_modules/@szhsin/react-menu/dist/esm/hooks/useBEM.mjs","../../node_modules/@szhsin/react-menu/dist/esm/utils/constants.mjs","../../node_modules/@szhsin/react-menu/dist/esm/components/MenuContainer.mjs","../../node_modules/@szhsin/react-menu/dist/esm/utils/submenuCtx.mjs","../../node_modules/@szhsin/react-menu/dist/esm/hooks/useItems.mjs","../../node_modules/@szhsin/react-menu/dist/esm/positionUtils/getNormalizedClientRect.mjs","../../node_modules/@szhsin/react-menu/dist/esm/positionUtils/getPositionHelpers.mjs","../../node_modules/@szhsin/react-menu/dist/esm/positionUtils/placeArrowVertical.mjs","../../node_modules/@szhsin/react-menu/dist/esm/positionUtils/placeLeftorRight.mjs","../../node_modules/@szhsin/react-menu/dist/esm/positionUtils/placeArrowHorizontal.mjs","../../node_modules/@szhsin/react-menu/dist/esm/positionUtils/placeToporBottom.mjs","../../node_modules/@szhsin/react-menu/dist/esm/positionUtils/positionMenu.mjs","../../node_modules/@szhsin/react-menu/dist/esm/hooks/useIsomorphicLayoutEffect.mjs","../../node_modules/@szhsin/react-menu/dist/esm/hooks/useCombinedRef.mjs","../../node_modules/@szhsin/react-menu/dist/esm/components/MenuList.mjs","../../node_modules/@szhsin/react-menu/dist/esm/components/ControlledMenu.mjs","../../node_modules/react-transition-state/dist/esm/hooks/utils.mjs","../../node_modules/react-transition-state/dist/esm/hooks/useTransitionState.mjs","../../node_modules/@szhsin/react-menu/dist/esm/hooks/useMenuState.mjs","../../node_modules/@szhsin/react-menu/dist/esm/hooks/useMenuStateAndFocus.mjs","../../node_modules/@szhsin/react-menu/dist/esm/hooks/useClick.mjs","../../node_modules/@szhsin/react-menu/dist/esm/components/Menu.mjs","../../node_modules/@szhsin/react-menu/dist/esm/utils/withHovering.mjs","../../node_modules/@szhsin/react-menu/dist/esm/hooks/useItemEffect.mjs","../../node_modules/@szhsin/react-menu/dist/esm/components/SubMenu.mjs","../../node_modules/@szhsin/react-menu/dist/esm/hooks/useItemState.mjs","../../node_modules/@szhsin/react-menu/dist/esm/components/MenuItem.mjs","../../node_modules/@szhsin/react-menu/dist/esm/components/FocusableItem.mjs","../../node_modules/@szhsin/react-menu/dist/esm/components/MenuDivider.mjs","../../node_modules/@szhsin/react-menu/dist/esm/components/MenuHeader.mjs","../../node_modules/@szhsin/react-menu/dist/esm/components/MenuGroup.mjs","../../node_modules/use-long-press/index.mjs","../../src/utils/nice-date-time.js","../../src/utils/open-compose.js","../../src/utils/open-osk.js","../../src/utils/safe-bounding-box-padding.js","../../src/utils/show-compose.js","../../src/utils/getHTMLText.js","../../src/utils/status-peek.js","../../src/components/ICONS.jsx","../../src/components/icon.jsx","../../src/components/link.jsx","../../src/components/menu-link.jsx","../../src/components/relative-time.jsx","../../src/components/submenu2.jsx","../../src/utils/useCloseWatcher.js","../../src/components/modal.jsx","../../src/components/avatar.jsx","../../src/utils/is-rtl.js","../../src/utils/useWindowSize.js","../../src/components/menu2.jsx","../../src/components/menu-confirm.jsx","../../src/components/custom-emoji.jsx","../../src/components/emoji-text.jsx","../../src/components/name-text.jsx","../../src/utils/localeCode2Text.js","../../src/utils/get-translate-target-language.js","../../src/utils/pretty-bytes.js","../../src/utils/supports.js","../../node_modules/punycode/punycode.es6.js","../../src/utils/emojify-text.js","../../src/utils/enhance-content.js","../../src/utils/handle-content-links.js","../../src/utils/i18n-duration.js","../../src/utils/shorten-number.js","../../src/components/account-block.jsx","../../node_modules/retry/lib/retry_operation.js","../../node_modules/retry/lib/retry.js","../../node_modules/retry/index.js","../../node_modules/is-network-error/index.js","../../node_modules/p-retry/index.js","../../src/utils/browser-translator.js","../../node_modules/react-intersection-observer/dist/index.mjs","../../src/components/lazy-shazam.jsx","../../src/components/translation-block.jsx","../../node_modules/idb-keyval/dist/index.js","../../src/utils/db.js","../../src/utils/relationships.js","../../node_modules/@justinribeiro/lite-youtube/lite-youtube.js","../../node_modules/fast-blurhash/index.js","../../node_modules/html-prettify/src/utils/addIndentation.js","../../node_modules/html-prettify/src/utils/toLines.js","../../node_modules/html-prettify/src/index.js","../../src/components/poll.jsx","../../src/utils/filter-context.js","../../src/utils/filters.js","../../src/utils/get-domain.js","../../src/utils/html-content-length.js","../../src/utils/speech.js","../../node_modules/use-debounce/dist/index.module.js","../../node_modules/use-resize-observer/dist/bundle.esm.js","../../src/utils/useTruncated.js","../../src/utils/visibility-icons-map.js","../../node_modules/react-quick-pinch-zoom/esm/PinchZoom/styles.css.js","../../node_modules/react-quick-pinch-zoom/esm/utils.js","../../node_modules/react-quick-pinch-zoom/esm/PinchZoom/getOffsetBounds.js","../../node_modules/react-quick-pinch-zoom/esm/PinchZoom/component.js","../../src/utils/format-duration.js","../../src/components/media.jsx","../../src/components/status.jsx","../../node_modules/uid/single/index.mjs","../../node_modules/fuse.js/dist/fuse.mjs","../../src/components/ScheduledAtField.jsx"],"sourcesContent":["import { createContext as I, useContext as q, useState as A, useCallback as w, useRef as S, useLayoutEffect as Q, useEffect as U } from \"react\";\nimport { jsx as R } from \"react/jsx-runtime\";\nconst F = [\"shift\", \"alt\", \"meta\", \"mod\", \"ctrl\", \"control\"], V = {\n esc: \"escape\",\n return: \"enter\",\n left: \"arrowleft\",\n right: \"arrowright\",\n up: \"arrowup\",\n down: \"arrowdown\",\n ShiftLeft: \"shift\",\n ShiftRight: \"shift\",\n AltLeft: \"alt\",\n AltRight: \"alt\",\n MetaLeft: \"meta\",\n MetaRight: \"meta\",\n OSLeft: \"meta\",\n OSRight: \"meta\",\n ControlLeft: \"ctrl\",\n ControlRight: \"ctrl\"\n};\nfunction g(t) {\n return (V[t.trim()] || t.trim()).toLowerCase().replace(/key|digit|numpad/, \"\");\n}\nfunction X(t) {\n return F.includes(t);\n}\nfunction P(t, r = \",\") {\n return t.toLowerCase().split(r);\n}\nfunction b(t, r = \"+\", n = !1, a) {\n const c = t.toLocaleLowerCase().split(r).map((i) => g(i)), l = {\n alt: c.includes(\"alt\"),\n ctrl: c.includes(\"ctrl\") || c.includes(\"control\"),\n shift: c.includes(\"shift\"),\n meta: c.includes(\"meta\"),\n mod: c.includes(\"mod\"),\n useKey: n\n }, o = c.filter((i) => !F.includes(i));\n return {\n ...l,\n keys: o,\n description: a\n };\n}\ntypeof document < \"u\" && (document.addEventListener(\"keydown\", (t) => {\n t.code !== void 0 && T([g(t.code)]);\n}), document.addEventListener(\"keyup\", (t) => {\n t.code !== void 0 && W([g(t.code)]);\n})), typeof window < \"u\" && window.addEventListener(\"blur\", () => {\n v.clear();\n});\nconst v = /* @__PURE__ */ new Set();\nfunction B(t) {\n return Array.isArray(t);\n}\nfunction Y(t, r = \",\") {\n return (B(t) ? t : t.split(r)).every((a) => v.has(a.trim().toLowerCase()));\n}\nfunction T(t) {\n const r = Array.isArray(t) ? t : [t];\n v.has(\"meta\") && v.forEach((n) => !X(n) && v.delete(n.toLowerCase())), r.forEach((n) => v.add(n.toLowerCase()));\n}\nfunction W(t) {\n const r = Array.isArray(t) ? t : [t];\n t === \"meta\" ? v.clear() : r.forEach((n) => v.delete(n.toLowerCase()));\n}\nfunction Z(t, r, n) {\n (typeof n == \"function\" && n(t, r) || n === !0) && t.preventDefault();\n}\nfunction $(t, r, n) {\n return typeof n == \"function\" ? n(t, r) : n === !0 || n === void 0;\n}\nfunction _(t) {\n return z(t, [\"input\", \"textarea\", \"select\"]);\n}\nfunction z(t, r = !1) {\n const { target: n, composed: a } = t;\n let c;\n return m(n) && a ? c = t.composedPath()[0] && t.composedPath()[0].tagName : c = n && n.tagName, B(r) ? !!(c && r && r.some((l) => l.toLowerCase() === c.toLowerCase())) : !!(c && r && r);\n}\nfunction m(t) {\n return !!t.tagName && !t.tagName.startsWith(\"-\") && t.tagName.includes(\"-\");\n}\nfunction O(t, r) {\n return t.length === 0 && r ? (console.warn(\n 'A hotkey has the \"scopes\" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'\n ), !0) : r ? t.some((n) => r.includes(n)) || t.includes(\"*\") : !0;\n}\nconst ee = (t, r, n = !1) => {\n const { alt: a, meta: c, mod: l, shift: o, ctrl: i, keys: f, useKey: y } = r, { code: k, key: e, ctrlKey: s, metaKey: d, shiftKey: C, altKey: H } = t, h = g(k);\n if (y && (f == null ? void 0 : f.length) === 1 && f.includes(e))\n return !0;\n if (!(f != null && f.includes(h)) && ![\"ctrl\", \"control\", \"unknown\", \"meta\", \"alt\", \"shift\", \"os\"].includes(h))\n return !1;\n if (!n) {\n if (a !== H && h !== \"alt\" || o !== C && h !== \"shift\")\n return !1;\n if (l) {\n if (!d && !s)\n return !1;\n } else if (c !== d && h !== \"meta\" && h !== \"os\" || i !== s && h !== \"ctrl\" && h !== \"control\")\n return !1;\n }\n return f && f.length === 1 && f.includes(h) ? !0 : f ? Y(f) : !f;\n}, G = I(void 0), te = () => q(G);\nfunction re({ addHotkey: t, removeHotkey: r, children: n }) {\n return /* @__PURE__ */ R(G.Provider, { value: { addHotkey: t, removeHotkey: r }, children: n });\n}\nfunction N(t, r) {\n return t && r && typeof t == \"object\" && typeof r == \"object\" ? Object.keys(t).length === Object.keys(r).length && // @ts-expect-error TS7053\n Object.keys(t).reduce((n, a) => n && N(t[a], r[a]), !0) : t === r;\n}\nconst J = I({\n hotkeys: [],\n activeScopes: [],\n // This array has to be empty instead of containing '*' as default, to check if the provider is set or not\n toggleScope: () => {\n },\n enableScope: () => {\n },\n disableScope: () => {\n }\n}), ne = () => q(J), fe = ({ initiallyActiveScopes: t = [\"*\"], children: r }) => {\n const [n, a] = A(t), [c, l] = A([]), o = w((e) => {\n a((s) => s.includes(\"*\") ? [e] : Array.from(/* @__PURE__ */ new Set([...s, e])));\n }, []), i = w((e) => {\n a((s) => s.filter((d) => d !== e));\n }, []), f = w((e) => {\n a((s) => s.includes(e) ? s.filter((d) => d !== e) : s.includes(\"*\") ? [e] : Array.from(/* @__PURE__ */ new Set([...s, e])));\n }, []), y = w((e) => {\n l((s) => [...s, e]);\n }, []), k = w((e) => {\n l((s) => s.filter((d) => !N(d, e)));\n }, []);\n return /* @__PURE__ */ R(\n J.Provider,\n {\n value: { activeScopes: n, hotkeys: c, enableScope: o, disableScope: i, toggleScope: f },\n children: /* @__PURE__ */ R(re, { addHotkey: y, removeHotkey: k, children: r })\n }\n );\n};\nfunction oe(t) {\n const r = S(void 0);\n return N(r.current, t) || (r.current = t), r.current;\n}\nconst D = (t) => {\n t.stopPropagation(), t.preventDefault(), t.stopImmediatePropagation();\n}, ce = typeof window < \"u\" ? Q : U;\nfunction se(t, r, n, a) {\n const c = S(null), l = S(!1), o = n instanceof Array ? a instanceof Array ? void 0 : a : n, i = B(t) ? t.join(o == null ? void 0 : o.delimiter) : t, f = n instanceof Array ? n : a instanceof Array ? a : void 0, y = w(r, f ?? []), k = S(y);\n f ? k.current = y : k.current = r;\n const e = oe(o), { activeScopes: s } = ne(), d = te();\n return ce(() => {\n if ((e == null ? void 0 : e.enabled) === !1 || !O(s, e == null ? void 0 : e.scopes))\n return;\n const C = (u, p = !1) => {\n var j;\n if (!(_(u) && !z(u, e == null ? void 0 : e.enableOnFormTags))) {\n if (c.current !== null) {\n const E = c.current.getRootNode();\n if ((E instanceof Document || E instanceof ShadowRoot) && E.activeElement !== c.current && !c.current.contains(E.activeElement)) {\n D(u);\n return;\n }\n }\n (j = u.target) != null && j.isContentEditable && !(e != null && e.enableOnContentEditable) || P(i, e == null ? void 0 : e.delimiter).forEach((E) => {\n var M, x;\n const L = b(E, e == null ? void 0 : e.splitKey, e == null ? void 0 : e.useKey, e == null ? void 0 : e.description);\n if (ee(u, L, e == null ? void 0 : e.ignoreModifiers) || (M = L.keys) != null && M.includes(\"*\")) {\n if ((x = e == null ? void 0 : e.ignoreEventWhen) != null && x.call(e, u) || p && l.current)\n return;\n if (Z(u, L, e == null ? void 0 : e.preventDefault), !$(u, L, e == null ? void 0 : e.enabled)) {\n D(u);\n return;\n }\n k.current(u, L), p || (l.current = !0);\n }\n });\n }\n }, H = (u) => {\n u.code !== void 0 && (T(g(u.code)), ((e == null ? void 0 : e.keydown) === void 0 && (e == null ? void 0 : e.keyup) !== !0 || e != null && e.keydown) && C(u));\n }, h = (u) => {\n u.code !== void 0 && (W(g(u.code)), l.current = !1, e != null && e.keyup && C(u, !0));\n }, K = c.current || (o == null ? void 0 : o.document) || document;\n return K.addEventListener(\"keyup\", h, o == null ? void 0 : o.eventListenerOptions), K.addEventListener(\"keydown\", H, o == null ? void 0 : o.eventListenerOptions), d && P(i, e == null ? void 0 : e.delimiter).forEach(\n (u) => d.addHotkey(\n b(u, e == null ? void 0 : e.splitKey, e == null ? void 0 : e.useKey, e == null ? void 0 : e.description)\n )\n ), () => {\n K.removeEventListener(\"keyup\", h, o == null ? void 0 : o.eventListenerOptions), K.removeEventListener(\"keydown\", H, o == null ? void 0 : o.eventListenerOptions), d && P(i, e == null ? void 0 : e.delimiter).forEach(\n (u) => d.removeHotkey(\n b(u, e == null ? void 0 : e.splitKey, e == null ? void 0 : e.useKey, e == null ? void 0 : e.description)\n )\n );\n };\n }, [i, e, s]), c;\n}\nfunction le(t = !1) {\n const [r, n] = A(/* @__PURE__ */ new Set()), [a, c] = A(!1), l = w((y) => {\n y.code !== void 0 && (y.preventDefault(), y.stopPropagation(), n((k) => {\n const e = new Set(k);\n return e.add(g(t ? y.key : y.code)), e;\n }));\n }, [t]), o = w(() => {\n typeof document < \"u\" && (document.removeEventListener(\"keydown\", l), c(!1));\n }, [l]), i = w(() => {\n n(/* @__PURE__ */ new Set()), typeof document < \"u\" && (o(), document.addEventListener(\"keydown\", l), c(!0));\n }, [l, o]), f = w(() => {\n n(/* @__PURE__ */ new Set());\n }, []);\n return [r, { start: i, stop: o, resetKeys: f, isRecording: a }];\n}\nexport {\n fe as HotkeysProvider,\n Y as isHotkeyPressed,\n se as useHotkeys,\n ne as useHotkeysContext,\n le as useRecordHotkeys\n};\n","/*!\n * Toastify js 1.12.0\n * https://github.com/apvarun/toastify-js\n * @license MIT licensed\n *\n * Copyright (C) 2018 Varun A P\n */\n(function(root, factory) {\n if (typeof module === \"object\" && module.exports) {\n module.exports = factory();\n } else {\n root.Toastify = factory();\n }\n})(this, function(global) {\n // Object initialization\n var Toastify = function(options) {\n // Returning a new init object\n return new Toastify.lib.init(options);\n },\n // Library version\n version = \"1.12.0\";\n\n // Set the default global options\n Toastify.defaults = {\n oldestFirst: true,\n text: \"Toastify is awesome!\",\n node: undefined,\n duration: 3000,\n selector: undefined,\n callback: function () {\n },\n destination: undefined,\n newWindow: false,\n close: false,\n gravity: \"toastify-top\",\n positionLeft: false,\n position: '',\n backgroundColor: '',\n avatar: \"\",\n className: \"\",\n stopOnFocus: true,\n onClick: function () {\n },\n offset: {x: 0, y: 0},\n escapeMarkup: true,\n ariaLive: 'polite',\n style: {background: ''}\n };\n\n // Defining the prototype of the object\n Toastify.lib = Toastify.prototype = {\n toastify: version,\n\n constructor: Toastify,\n\n // Initializing the object with required parameters\n init: function(options) {\n // Verifying and validating the input object\n if (!options) {\n options = {};\n }\n\n // Creating the options object\n this.options = {};\n\n this.toastElement = null;\n\n // Validating the options\n this.options.text = options.text || Toastify.defaults.text; // Display message\n this.options.node = options.node || Toastify.defaults.node; // Display content as node\n this.options.duration = options.duration === 0 ? 0 : options.duration || Toastify.defaults.duration; // Display duration\n this.options.selector = options.selector || Toastify.defaults.selector; // Parent selector\n this.options.callback = options.callback || Toastify.defaults.callback; // Callback after display\n this.options.destination = options.destination || Toastify.defaults.destination; // On-click destination\n this.options.newWindow = options.newWindow || Toastify.defaults.newWindow; // Open destination in new window\n this.options.close = options.close || Toastify.defaults.close; // Show toast close icon\n this.options.gravity = options.gravity === \"bottom\" ? \"toastify-bottom\" : Toastify.defaults.gravity; // toast position - top or bottom\n this.options.positionLeft = options.positionLeft || Toastify.defaults.positionLeft; // toast position - left or right\n this.options.position = options.position || Toastify.defaults.position; // toast position - left or right\n this.options.backgroundColor = options.backgroundColor || Toastify.defaults.backgroundColor; // toast background color\n this.options.avatar = options.avatar || Toastify.defaults.avatar; // img element src - url or a path\n this.options.className = options.className || Toastify.defaults.className; // additional class names for the toast\n this.options.stopOnFocus = options.stopOnFocus === undefined ? Toastify.defaults.stopOnFocus : options.stopOnFocus; // stop timeout on focus\n this.options.onClick = options.onClick || Toastify.defaults.onClick; // Callback after click\n this.options.offset = options.offset || Toastify.defaults.offset; // toast offset\n this.options.escapeMarkup = options.escapeMarkup !== undefined ? options.escapeMarkup : Toastify.defaults.escapeMarkup;\n this.options.ariaLive = options.ariaLive || Toastify.defaults.ariaLive;\n this.options.style = options.style || Toastify.defaults.style;\n if(options.backgroundColor) {\n this.options.style.background = options.backgroundColor;\n }\n\n // Returning the current object for chaining functions\n return this;\n },\n\n // Building the DOM element\n buildToast: function() {\n // Validating if the options are defined\n if (!this.options) {\n throw \"Toastify is not initialized\";\n }\n\n // Creating the DOM object\n var divElement = document.createElement(\"div\");\n divElement.className = \"toastify on \" + this.options.className;\n\n // Positioning toast to left or right or center\n if (!!this.options.position) {\n divElement.className += \" toastify-\" + this.options.position;\n } else {\n // To be depreciated in further versions\n if (this.options.positionLeft === true) {\n divElement.className += \" toastify-left\";\n console.warn('Property `positionLeft` will be depreciated in further versions. Please use `position` instead.')\n } else {\n // Default position\n divElement.className += \" toastify-right\";\n }\n }\n\n // Assigning gravity of element\n divElement.className += \" \" + this.options.gravity;\n\n if (this.options.backgroundColor) {\n // This is being deprecated in favor of using the style HTML DOM property\n console.warn('DEPRECATION NOTICE: \"backgroundColor\" is being deprecated. Please use the \"style.background\" property.');\n }\n\n // Loop through our style object and apply styles to divElement\n for (var property in this.options.style) {\n divElement.style[property] = this.options.style[property];\n }\n\n // Announce the toast to screen readers\n if (this.options.ariaLive) {\n divElement.setAttribute('aria-live', this.options.ariaLive)\n }\n\n // Adding the toast message/node\n if (this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE) {\n // If we have a valid node, we insert it\n divElement.appendChild(this.options.node)\n } else {\n if (this.options.escapeMarkup) {\n divElement.innerText = this.options.text;\n } else {\n divElement.innerHTML = this.options.text;\n }\n\n if (this.options.avatar !== \"\") {\n var avatarElement = document.createElement(\"img\");\n avatarElement.src = this.options.avatar;\n\n avatarElement.className = \"toastify-avatar\";\n\n if (this.options.position == \"left\" || this.options.positionLeft === true) {\n // Adding close icon on the left of content\n divElement.appendChild(avatarElement);\n } else {\n // Adding close icon on the right of content\n divElement.insertAdjacentElement(\"afterbegin\", avatarElement);\n }\n }\n }\n\n // Adding a close icon to the toast\n if (this.options.close === true) {\n // Create a span for close element\n var closeElement = document.createElement(\"button\");\n closeElement.type = \"button\";\n closeElement.setAttribute(\"aria-label\", \"Close\");\n closeElement.className = \"toast-close\";\n closeElement.innerHTML = \"✖\";\n\n // Triggering the removal of toast from DOM on close click\n closeElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n this.removeElement(this.toastElement);\n window.clearTimeout(this.toastElement.timeOutValue);\n }.bind(this)\n );\n\n //Calculating screen width\n var width = window.innerWidth > 0 ? window.innerWidth : screen.width;\n\n // Adding the close icon to the toast element\n // Display on the right if screen width is less than or equal to 360px\n if ((this.options.position == \"left\" || this.options.positionLeft === true) && width > 360) {\n // Adding close icon on the left of content\n divElement.insertAdjacentElement(\"afterbegin\", closeElement);\n } else {\n // Adding close icon on the right of content\n divElement.appendChild(closeElement);\n }\n }\n\n // Clear timeout while toast is focused\n if (this.options.stopOnFocus && this.options.duration > 0) {\n var self = this;\n // stop countdown\n divElement.addEventListener(\n \"mouseover\",\n function(event) {\n window.clearTimeout(divElement.timeOutValue);\n }\n )\n // add back the timeout\n divElement.addEventListener(\n \"mouseleave\",\n function() {\n divElement.timeOutValue = window.setTimeout(\n function() {\n // Remove the toast from DOM\n self.removeElement(divElement);\n },\n self.options.duration\n )\n }\n )\n }\n\n // Adding an on-click destination path\n if (typeof this.options.destination !== \"undefined\") {\n divElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n if (this.options.newWindow === true) {\n window.open(this.options.destination, \"_blank\");\n } else {\n window.location = this.options.destination;\n }\n }.bind(this)\n );\n }\n\n if (typeof this.options.onClick === \"function\" && typeof this.options.destination === \"undefined\") {\n divElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n this.options.onClick();\n }.bind(this)\n );\n }\n\n // Adding offset\n if(typeof this.options.offset === \"object\") {\n\n var x = getAxisOffsetAValue(\"x\", this.options);\n var y = getAxisOffsetAValue(\"y\", this.options);\n\n var xOffset = this.options.position == \"left\" ? x : \"-\" + x;\n var yOffset = this.options.gravity == \"toastify-top\" ? y : \"-\" + y;\n\n divElement.style.transform = \"translate(\" + xOffset + \",\" + yOffset + \")\";\n\n }\n\n // Returning the generated element\n return divElement;\n },\n\n // Displaying the toast\n showToast: function() {\n // Creating the DOM object for the toast\n this.toastElement = this.buildToast();\n\n // Getting the root element to with the toast needs to be added\n var rootElement;\n if (typeof this.options.selector === \"string\") {\n rootElement = document.getElementById(this.options.selector);\n } else if (this.options.selector instanceof HTMLElement || (typeof ShadowRoot !== 'undefined' && this.options.selector instanceof ShadowRoot)) {\n rootElement = this.options.selector;\n } else {\n rootElement = document.body;\n }\n\n // Validating if root element is present in DOM\n if (!rootElement) {\n throw \"Root element is not defined\";\n }\n\n // Adding the DOM element\n var elementToInsert = Toastify.defaults.oldestFirst ? rootElement.firstChild : rootElement.lastChild;\n rootElement.insertBefore(this.toastElement, elementToInsert);\n\n // Repositioning the toasts in case multiple toasts are present\n Toastify.reposition();\n\n if (this.options.duration > 0) {\n this.toastElement.timeOutValue = window.setTimeout(\n function() {\n // Remove the toast from DOM\n this.removeElement(this.toastElement);\n }.bind(this),\n this.options.duration\n ); // Binding `this` for function invocation\n }\n\n // Supporting function chaining\n return this;\n },\n\n hideToast: function() {\n if (this.toastElement.timeOutValue) {\n clearTimeout(this.toastElement.timeOutValue);\n }\n this.removeElement(this.toastElement);\n },\n\n // Removing the element from the DOM\n removeElement: function(toastElement) {\n // Hiding the element\n // toastElement.classList.remove(\"on\");\n toastElement.className = toastElement.className.replace(\" on\", \"\");\n\n // Removing the element from DOM after transition end\n window.setTimeout(\n function() {\n // remove options node if any\n if (this.options.node && this.options.node.parentNode) {\n this.options.node.parentNode.removeChild(this.options.node);\n }\n\n // Remove the element from the DOM, only when the parent node was not removed before.\n if (toastElement.parentNode) {\n toastElement.parentNode.removeChild(toastElement);\n }\n\n // Calling the callback function\n this.options.callback.call(toastElement);\n\n // Repositioning the toasts again\n Toastify.reposition();\n }.bind(this),\n 400\n ); // Binding `this` for function invocation\n },\n };\n\n // Positioning the toasts on the DOM\n Toastify.reposition = function() {\n\n // Top margins with gravity\n var topLeftOffsetSize = {\n top: 15,\n bottom: 15,\n };\n var topRightOffsetSize = {\n top: 15,\n bottom: 15,\n };\n var offsetSize = {\n top: 15,\n bottom: 15,\n };\n\n // Get all toast messages on the DOM\n var allToasts = document.getElementsByClassName(\"toastify\");\n\n var classUsed;\n\n // Modifying the position of each toast element\n for (var i = 0; i < allToasts.length; i++) {\n // Getting the applied gravity\n if (containsClass(allToasts[i], \"toastify-top\") === true) {\n classUsed = \"toastify-top\";\n } else {\n classUsed = \"toastify-bottom\";\n }\n\n var height = allToasts[i].offsetHeight;\n classUsed = classUsed.substr(9, classUsed.length-1)\n // Spacing between toasts\n var offset = 15;\n\n var width = window.innerWidth > 0 ? window.innerWidth : screen.width;\n\n // Show toast in center if screen with less than or equal to 360px\n if (width <= 360) {\n // Setting the position\n allToasts[i].style[classUsed] = offsetSize[classUsed] + \"px\";\n\n offsetSize[classUsed] += height + offset;\n } else {\n if (containsClass(allToasts[i], \"toastify-left\") === true) {\n // Setting the position\n allToasts[i].style[classUsed] = topLeftOffsetSize[classUsed] + \"px\";\n\n topLeftOffsetSize[classUsed] += height + offset;\n } else {\n // Setting the position\n allToasts[i].style[classUsed] = topRightOffsetSize[classUsed] + \"px\";\n\n topRightOffsetSize[classUsed] += height + offset;\n }\n }\n }\n\n // Supporting function chaining\n return this;\n };\n\n // Helper function to get offset.\n function getAxisOffsetAValue(axis, options) {\n\n if(options.offset[axis]) {\n if(isNaN(options.offset[axis])) {\n return options.offset[axis];\n }\n else {\n return options.offset[axis] + 'px';\n }\n }\n\n return '0px';\n\n }\n\n function containsClass(elem, yourClass) {\n if (!elem || typeof yourClass !== \"string\") {\n return false;\n } else if (\n elem.className &&\n elem.className\n .trim()\n .split(/\\s+/gi)\n .indexOf(yourClass) > -1\n ) {\n return true;\n } else {\n return false;\n }\n }\n\n // Setting up the prototype for the init object\n Toastify.lib.init.prototype = Toastify.lib;\n\n // Returning the Toastify function to be assigned to the window object/module\n return Toastify;\n});\n","import Toastify from 'toastify-js';\n\nwindow._showToast = showToast;\n\nfunction showToast(props) {\n if (typeof props === 'string') {\n props = { text: props };\n }\n const { onClick, delay, ...rest } = props;\n const toast = Toastify({\n className: `${onClick || props.destination ? 'shiny-pill' : ''}`,\n gravity: 'bottom',\n position: 'center',\n ...rest,\n onClick: () => {\n onClick?.(toast); // Pass in the object itself!\n },\n });\n if (delay) {\n setTimeout(() => {\n toast.showToast();\n }, delay);\n } else {\n toast.showToast();\n }\n return toast;\n}\n\nexport default showToast;\n","import { useEffect, useRef } from 'preact/hooks';\n\nfunction useInterval(fn, delay, deps, immediate) {\n const savedCallback = useRef(fn);\n useEffect(() => {\n savedCallback.current = fn;\n }, [fn, deps]);\n\n useEffect(() => {\n if (!immediate || delay === null || delay === false) return;\n savedCallback.current();\n }, [immediate]);\n\n useEffect(() => {\n if (delay === null || delay === false) return;\n const tick = () => savedCallback.current();\n const id = setInterval(tick, delay);\n return () => clearInterval(id);\n }, [delay]);\n}\n\nexport default useInterval;\n","import { unstable_batchedUpdates } from 'react-dom';\n\nconst isMenuOpen = state => !!state && state[0] === 'o';\nconst batchedUpdates = unstable_batchedUpdates;\nconst getTransition = (transition, name) => transition === true || !!(transition && transition[name]);\nconst safeCall = (fn, arg) => typeof fn === 'function' ? fn(arg) : fn;\nconst internalKey = '_szhsinMenu';\nconst getName = component => component[internalKey];\nconst defineName = (name, component) => Object.defineProperty(component, internalKey, {\n value: name\n});\nconst mergeProps = (target, source) => {\n source && Object.keys(source).forEach(key => {\n const targetProp = target[key];\n const sourceProp = source[key];\n if (typeof sourceProp === 'function' && targetProp) {\n target[key] = (...arg) => {\n sourceProp(...arg);\n targetProp(...arg);\n };\n } else {\n target[key] = sourceProp;\n }\n });\n return target;\n};\nconst parsePadding = paddingStr => {\n if (typeof paddingStr !== 'string') return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n const padding = paddingStr.trim().split(/\\s+/, 4).map(parseFloat);\n const top = !isNaN(padding[0]) ? padding[0] : 0;\n const right = !isNaN(padding[1]) ? padding[1] : top;\n return {\n top,\n right,\n bottom: !isNaN(padding[2]) ? padding[2] : top,\n left: !isNaN(padding[3]) ? padding[3] : right\n };\n};\nconst getScrollAncestor = node => {\n while (node) {\n node = node.parentNode;\n if (!node || node === document.body || !node.parentNode) return;\n const {\n overflow,\n overflowX,\n overflowY\n } = getComputedStyle(node);\n if (/auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX)) return node;\n }\n};\nfunction commonProps(isDisabled, isHovering) {\n return {\n 'aria-disabled': isDisabled || undefined,\n tabIndex: isHovering ? 0 : -1\n };\n}\nfunction indexOfNode(nodeList, node) {\n for (let i = 0; i < nodeList.length; i++) {\n if (nodeList[i] === node) return i;\n }\n return -1;\n}\n\nexport { batchedUpdates, commonProps, defineName, getName, getScrollAncestor, getTransition, indexOfNode, isMenuOpen, mergeProps, parsePadding, safeCall };\n","import { useMemo } from 'react';\n\nconst useBEM = ({\n block,\n element,\n modifiers,\n className\n}) => useMemo(() => {\n const blockElement = element ? `${block}__${element}` : block;\n let classString = blockElement;\n modifiers && Object.keys(modifiers).forEach(name => {\n const value = modifiers[name];\n if (value) classString += ` ${blockElement}--${value === true ? name : `${name}-${value}`}`;\n });\n let expandedClassName = typeof className === 'function' ? className(modifiers) : className;\n if (typeof expandedClassName === 'string') {\n expandedClassName = expandedClassName.trim();\n if (expandedClassName) classString += ` ${expandedClassName}`;\n }\n return classString;\n}, [block, element, modifiers, className]);\n\nexport { useBEM };\n","import { createContext } from 'react';\n\nconst menuContainerClass = 'szh-menu-container';\nconst menuClass = 'szh-menu';\nconst menuButtonClass = 'szh-menu-button';\nconst menuArrowClass = 'arrow';\nconst menuItemClass = 'item';\nconst menuDividerClass = 'divider';\nconst menuHeaderClass = 'header';\nconst menuGroupClass = 'group';\nconst subMenuClass = 'submenu';\nconst radioGroupClass = 'radio-group';\nconst HoverItemContext = /*#__PURE__*/createContext();\nconst MenuListItemContext = /*#__PURE__*/createContext({});\nconst MenuListContext = /*#__PURE__*/createContext({});\nconst EventHandlersContext = /*#__PURE__*/createContext({});\nconst RadioGroupContext = /*#__PURE__*/createContext({});\nconst SettingsContext = /*#__PURE__*/createContext({});\nconst Keys = /*#__PURE__*/Object.freeze({\n ENTER: 'Enter',\n ESC: 'Escape',\n SPACE: ' ',\n HOME: 'Home',\n END: 'End',\n LEFT: 'ArrowLeft',\n RIGHT: 'ArrowRight',\n UP: 'ArrowUp',\n DOWN: 'ArrowDown'\n});\nconst HoverActionTypes = /*#__PURE__*/Object.freeze({\n RESET: 0,\n SET: 1,\n UNSET: 2,\n INCREASE: 3,\n DECREASE: 4,\n FIRST: 5,\n LAST: 6,\n SET_INDEX: 7\n});\nconst CloseReason = /*#__PURE__*/Object.freeze({\n CLICK: 'click',\n CANCEL: 'cancel',\n BLUR: 'blur',\n SCROLL: 'scroll'\n});\nconst FocusPositions = /*#__PURE__*/Object.freeze({\n FIRST: 'first',\n LAST: 'last'\n});\nconst MenuStateMap = /*#__PURE__*/Object.freeze({\n entering: 'opening',\n entered: 'open',\n exiting: 'closing',\n exited: 'closed'\n});\nconst positionAbsolute = 'absolute';\nconst roleNone = 'none';\nconst roleMenuitem = 'menuitem';\nconst noScrollFocus = {\n preventScroll: true\n};\n\nexport { CloseReason, EventHandlersContext, FocusPositions, HoverActionTypes, HoverItemContext, Keys, MenuListContext, MenuListItemContext, MenuStateMap, RadioGroupContext, SettingsContext, menuArrowClass, menuButtonClass, menuClass, menuContainerClass, menuDividerClass, menuGroupClass, menuHeaderClass, menuItemClass, noScrollFocus, positionAbsolute, radioGroupClass, roleMenuitem, roleNone, subMenuClass };\n","import { useMemo } from 'react';\nimport { jsx } from 'react/jsx-runtime';\nimport { useBEM } from '../hooks/useBEM.mjs';\nimport { mergeProps, getTransition, safeCall } from '../utils/utils.mjs';\nimport { menuContainerClass, CloseReason, Keys } from '../utils/constants.mjs';\n\nconst MenuContainer = ({\n className,\n containerRef,\n containerProps,\n children,\n isOpen,\n theming,\n transition,\n onClose\n}) => {\n const itemTransition = getTransition(transition, 'item');\n const onKeyDown = ({\n key\n }) => {\n switch (key) {\n case Keys.ESC:\n safeCall(onClose, {\n key,\n reason: CloseReason.CANCEL\n });\n break;\n }\n };\n const onBlur = e => {\n if (isOpen && !e.currentTarget.contains(e.relatedTarget)) {\n safeCall(onClose, {\n reason: CloseReason.BLUR\n });\n }\n };\n return /*#__PURE__*/jsx(\"div\", {\n ...mergeProps({\n onKeyDown,\n onBlur\n }, containerProps),\n className: useBEM({\n block: menuContainerClass,\n modifiers: useMemo(() => ({\n theme: theming,\n itemTransition\n }), [theming, itemTransition]),\n className\n }),\n style: {\n position: 'absolute',\n ...containerProps?.style\n },\n ref: containerRef,\n children: children\n });\n};\n\nexport { MenuContainer };\n","const createSubmenuCtx = () => {\n let timer,\n count = 0;\n return {\n toggle: isOpen => {\n isOpen ? count++ : count--;\n count = Math.max(count, 0);\n },\n on: (closeDelay, pending, settled) => {\n if (count) {\n if (!timer) timer = setTimeout(() => {\n timer = 0;\n pending();\n }, closeDelay);\n } else {\n settled?.();\n }\n },\n off: () => {\n if (timer) {\n clearTimeout(timer);\n timer = 0;\n }\n }\n };\n};\n\nexport { createSubmenuCtx };\n","import { useState, useRef, useCallback } from 'react';\nimport { noScrollFocus, HoverActionTypes } from '../utils/constants.mjs';\nimport { indexOfNode } from '../utils/utils.mjs';\n\nconst useItems = menuRef => {\n const [hoverItem, setHoverItem] = useState();\n const stateRef = useRef({\n items: [],\n hoverIndex: -1,\n sorted: false\n });\n const mutableState = stateRef.current;\n const updateItems = useCallback((item, isMounted) => {\n const {\n items\n } = mutableState;\n if (!item) {\n mutableState.items = [];\n } else if (isMounted) {\n items.push(item);\n } else {\n const index = items.indexOf(item);\n if (index > -1) {\n items.splice(index, 1);\n if (item.contains(document.activeElement)) {\n menuRef.current.focus(noScrollFocus);\n setHoverItem();\n }\n }\n }\n mutableState.hoverIndex = -1;\n mutableState.sorted = false;\n }, [mutableState, menuRef]);\n const dispatch = useCallback((actionType, item, nextIndex) => {\n const {\n items,\n hoverIndex\n } = mutableState;\n const sortItems = () => {\n if (mutableState.sorted) return;\n const orderedNodes = menuRef.current.querySelectorAll('.szh-menu__item');\n items.sort((a, b) => indexOfNode(orderedNodes, a) - indexOfNode(orderedNodes, b));\n mutableState.sorted = true;\n };\n let index = -1,\n newItem = undefined;\n switch (actionType) {\n case HoverActionTypes.RESET:\n break;\n case HoverActionTypes.SET:\n newItem = item;\n break;\n case HoverActionTypes.UNSET:\n newItem = prevItem => prevItem === item ? undefined : prevItem;\n break;\n case HoverActionTypes.FIRST:\n sortItems();\n index = 0;\n newItem = items[index];\n break;\n case HoverActionTypes.LAST:\n sortItems();\n index = items.length - 1;\n newItem = items[index];\n break;\n case HoverActionTypes.SET_INDEX:\n sortItems();\n index = nextIndex;\n newItem = items[index];\n break;\n case HoverActionTypes.INCREASE:\n sortItems();\n index = hoverIndex;\n if (index < 0) index = items.indexOf(item);\n index++;\n if (index >= items.length) index = 0;\n newItem = items[index];\n break;\n case HoverActionTypes.DECREASE:\n sortItems();\n index = hoverIndex;\n if (index < 0) index = items.indexOf(item);\n index--;\n if (index < 0) index = items.length - 1;\n newItem = items[index];\n break;\n default:\n if (process.env.NODE_ENV !== 'production') throw new Error(`[React-Menu] Unknown hover action type: ${actionType}`);\n }\n if (!newItem) index = -1;\n setHoverItem(newItem);\n mutableState.hoverIndex = index;\n }, [menuRef, mutableState]);\n return {\n hoverItem,\n dispatch,\n updateItems\n };\n};\n\nexport { useItems };\n","const getNativeDimension = (transformed, untransformed) => Math.round(transformed) === untransformed ? transformed : untransformed;\nconst getNormalizedClientRect = element => {\n const rect = element.getBoundingClientRect();\n rect.width = getNativeDimension(rect.width, element.offsetWidth);\n rect.height = getNativeDimension(rect.height, element.offsetHeight);\n return rect;\n};\n\nexport { getNormalizedClientRect };\n","import { getNormalizedClientRect } from './getNormalizedClientRect.mjs';\nimport { parsePadding } from '../utils/utils.mjs';\n\nconst getPositionHelpers = (containerElt, menuElt, menuScroll, boundingBoxPadding) => {\n const menuRect = getNormalizedClientRect(menuElt);\n const containerRect = containerElt.getBoundingClientRect();\n const boundingRect = menuScroll === window ? {\n left: 0,\n top: 0,\n right: document.documentElement.clientWidth,\n bottom: window.innerHeight\n } : menuScroll.getBoundingClientRect();\n const padding = parsePadding(boundingBoxPadding);\n const getLeftOverflow = x => x + containerRect.left - boundingRect.left - padding.left;\n const getRightOverflow = x => x + containerRect.left + menuRect.width - boundingRect.right + padding.right;\n const getTopOverflow = y => y + containerRect.top - boundingRect.top - padding.top;\n const getBottomOverflow = y => y + containerRect.top + menuRect.height - boundingRect.bottom + padding.bottom;\n const confineHorizontally = x => {\n let leftOverflow = getLeftOverflow(x);\n if (leftOverflow < 0) {\n x -= leftOverflow;\n } else {\n const rightOverflow = getRightOverflow(x);\n if (rightOverflow > 0) {\n x -= rightOverflow;\n leftOverflow = getLeftOverflow(x);\n if (leftOverflow < 0) x -= leftOverflow;\n }\n }\n return x;\n };\n const confineVertically = y => {\n let topOverflow = getTopOverflow(y);\n if (topOverflow < 0) {\n y -= topOverflow;\n } else {\n const bottomOverflow = getBottomOverflow(y);\n if (bottomOverflow > 0) {\n y -= bottomOverflow;\n topOverflow = getTopOverflow(y);\n if (topOverflow < 0) y -= topOverflow;\n }\n }\n return y;\n };\n return {\n menuRect,\n containerRect,\n getLeftOverflow,\n getRightOverflow,\n getTopOverflow,\n getBottomOverflow,\n confineHorizontally,\n confineVertically\n };\n};\n\nexport { getPositionHelpers };\n","const placeArrowVertical = ({\n arrowRef,\n menuY,\n anchorRect,\n containerRect,\n menuRect\n}) => {\n let y = anchorRect.top - containerRect.top - menuY + anchorRect.height / 2;\n const offset = arrowRef.current.offsetHeight * 1.25;\n y = Math.max(offset, y);\n y = Math.min(y, menuRect.height - offset);\n return y;\n};\n\nexport { placeArrowVertical };\n","import { placeArrowVertical } from './placeArrowVertical.mjs';\n\nconst placeLeftorRight = ({\n anchorRect,\n containerRect,\n menuRect,\n placeLeftorRightY,\n placeLeftX,\n placeRightX,\n getLeftOverflow,\n getRightOverflow,\n confineHorizontally,\n confineVertically,\n arrowRef,\n arrow,\n direction,\n position\n}) => {\n let computedDirection = direction;\n let y = placeLeftorRightY;\n if (position !== 'initial') {\n y = confineVertically(y);\n if (position === 'anchor') {\n y = Math.min(y, anchorRect.bottom - containerRect.top);\n y = Math.max(y, anchorRect.top - containerRect.top - menuRect.height);\n }\n }\n let x, leftOverflow, rightOverflow;\n if (computedDirection === 'left') {\n x = placeLeftX;\n if (position !== 'initial') {\n leftOverflow = getLeftOverflow(x);\n if (leftOverflow < 0) {\n rightOverflow = getRightOverflow(placeRightX);\n if (rightOverflow <= 0 || -leftOverflow > rightOverflow) {\n x = placeRightX;\n computedDirection = 'right';\n }\n }\n }\n } else {\n x = placeRightX;\n if (position !== 'initial') {\n rightOverflow = getRightOverflow(x);\n if (rightOverflow > 0) {\n leftOverflow = getLeftOverflow(placeLeftX);\n if (leftOverflow >= 0 || -leftOverflow < rightOverflow) {\n x = placeLeftX;\n computedDirection = 'left';\n }\n }\n }\n }\n if (position === 'auto') x = confineHorizontally(x);\n const arrowY = arrow ? placeArrowVertical({\n menuY: y,\n arrowRef,\n anchorRect,\n containerRect,\n menuRect\n }) : undefined;\n return {\n arrowY,\n x,\n y,\n computedDirection\n };\n};\n\nexport { placeLeftorRight };\n","const placeArrowHorizontal = ({\n arrowRef,\n menuX,\n anchorRect,\n containerRect,\n menuRect\n}) => {\n let x = anchorRect.left - containerRect.left - menuX + anchorRect.width / 2;\n const offset = arrowRef.current.offsetWidth * 1.25;\n x = Math.max(offset, x);\n x = Math.min(x, menuRect.width - offset);\n return x;\n};\n\nexport { placeArrowHorizontal };\n","import { placeArrowHorizontal } from './placeArrowHorizontal.mjs';\n\nconst placeToporBottom = ({\n anchorRect,\n containerRect,\n menuRect,\n placeToporBottomX,\n placeTopY,\n placeBottomY,\n getTopOverflow,\n getBottomOverflow,\n confineHorizontally,\n confineVertically,\n arrowRef,\n arrow,\n direction,\n position\n}) => {\n let computedDirection = direction === 'top' ? 'top' : 'bottom';\n let x = placeToporBottomX;\n if (position !== 'initial') {\n x = confineHorizontally(x);\n if (position === 'anchor') {\n x = Math.min(x, anchorRect.right - containerRect.left);\n x = Math.max(x, anchorRect.left - containerRect.left - menuRect.width);\n }\n }\n let y, topOverflow, bottomOverflow;\n if (computedDirection === 'top') {\n y = placeTopY;\n if (position !== 'initial') {\n topOverflow = getTopOverflow(y);\n if (topOverflow < 0) {\n bottomOverflow = getBottomOverflow(placeBottomY);\n if (bottomOverflow <= 0 || -topOverflow > bottomOverflow) {\n y = placeBottomY;\n computedDirection = 'bottom';\n }\n }\n }\n } else {\n y = placeBottomY;\n if (position !== 'initial') {\n bottomOverflow = getBottomOverflow(y);\n if (bottomOverflow > 0) {\n topOverflow = getTopOverflow(placeTopY);\n if (topOverflow >= 0 || -topOverflow < bottomOverflow) {\n y = placeTopY;\n computedDirection = 'top';\n }\n }\n }\n }\n if (position === 'auto') y = confineVertically(y);\n const arrowX = arrow ? placeArrowHorizontal({\n menuX: x,\n arrowRef,\n anchorRect,\n containerRect,\n menuRect\n }) : undefined;\n return {\n arrowX,\n x,\n y,\n computedDirection\n };\n};\n\nexport { placeToporBottom };\n","import { placeLeftorRight } from './placeLeftorRight.mjs';\nimport { placeToporBottom } from './placeToporBottom.mjs';\n\nconst positionMenu = ({\n arrow,\n align,\n direction,\n gap,\n shift,\n position,\n anchorRect,\n arrowRef,\n positionHelpers\n}) => {\n const {\n menuRect,\n containerRect\n } = positionHelpers;\n const isHorizontal = direction === 'left' || direction === 'right';\n let horizontalOffset = isHorizontal ? gap : shift;\n let verticalOffset = isHorizontal ? shift : gap;\n if (arrow) {\n const arrowElt = arrowRef.current;\n if (isHorizontal) {\n horizontalOffset += arrowElt.offsetWidth;\n } else {\n verticalOffset += arrowElt.offsetHeight;\n }\n }\n const placeLeftX = anchorRect.left - containerRect.left - menuRect.width - horizontalOffset;\n const placeRightX = anchorRect.right - containerRect.left + horizontalOffset;\n const placeTopY = anchorRect.top - containerRect.top - menuRect.height - verticalOffset;\n const placeBottomY = anchorRect.bottom - containerRect.top + verticalOffset;\n let placeToporBottomX, placeLeftorRightY;\n if (align === 'end') {\n placeToporBottomX = anchorRect.right - containerRect.left - menuRect.width;\n placeLeftorRightY = anchorRect.bottom - containerRect.top - menuRect.height;\n } else if (align === 'center') {\n placeToporBottomX = anchorRect.left - containerRect.left - (menuRect.width - anchorRect.width) / 2;\n placeLeftorRightY = anchorRect.top - containerRect.top - (menuRect.height - anchorRect.height) / 2;\n } else {\n placeToporBottomX = anchorRect.left - containerRect.left;\n placeLeftorRightY = anchorRect.top - containerRect.top;\n }\n placeToporBottomX += horizontalOffset;\n placeLeftorRightY += verticalOffset;\n const options = {\n ...positionHelpers,\n anchorRect,\n placeLeftX,\n placeRightX,\n placeLeftorRightY,\n placeTopY,\n placeBottomY,\n placeToporBottomX,\n arrowRef,\n arrow,\n direction,\n position\n };\n switch (direction) {\n case 'left':\n case 'right':\n return placeLeftorRight(options);\n case 'top':\n case 'bottom':\n default:\n return placeToporBottom(options);\n }\n};\n\nexport { positionMenu };\n","import { useLayoutEffect, useEffect } from 'react';\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? useLayoutEffect : useEffect;\n\nexport { useIsomorphicLayoutEffect as useLayoutEffect };\n","import { useMemo } from 'react';\n\nfunction setRef(ref, instance) {\n typeof ref === 'function' ? ref(instance) : ref.current = instance;\n}\nconst useCombinedRef = (refA, refB) => useMemo(() => {\n if (!refA) return refB;\n if (!refB) return refA;\n return instance => {\n setRef(refA, instance);\n setRef(refB, instance);\n };\n}, [refA, refB]);\n\nexport { useCombinedRef };\n","import { useState, useReducer, useContext, useRef, useCallback, useEffect, useMemo } from 'react';\nimport { flushSync } from 'react-dom';\nimport { MenuContainer } from './MenuContainer.mjs';\nimport { jsxs, jsx } from 'react/jsx-runtime';\nimport { createSubmenuCtx } from '../utils/submenuCtx.mjs';\nimport { SettingsContext, MenuListContext, HoverActionTypes, noScrollFocus, menuClass, menuArrowClass, positionAbsolute, MenuListItemContext, HoverItemContext, CloseReason, FocusPositions, Keys } from '../utils/constants.mjs';\nimport { useItems } from '../hooks/useItems.mjs';\nimport { getScrollAncestor, isMenuOpen, batchedUpdates, getTransition, mergeProps, commonProps, safeCall } from '../utils/utils.mjs';\nimport { getPositionHelpers } from '../positionUtils/getPositionHelpers.mjs';\nimport { positionMenu } from '../positionUtils/positionMenu.mjs';\nimport { useLayoutEffect as useIsomorphicLayoutEffect } from '../hooks/useIsomorphicLayoutEffect.mjs';\nimport { useBEM } from '../hooks/useBEM.mjs';\nimport { useCombinedRef } from '../hooks/useCombinedRef.mjs';\n\nconst offScreen = -9999;\nconst MenuList = ({\n ariaLabel,\n menuClassName,\n menuStyle,\n arrow,\n arrowProps = {},\n anchorPoint,\n anchorRef,\n containerRef,\n containerProps,\n externalRef,\n parentScrollingRef,\n align = 'start',\n direction = 'bottom',\n position = 'auto',\n overflow = 'visible',\n setDownOverflow,\n repositionFlag,\n captureFocus = true,\n state,\n endTransition,\n isDisabled,\n menuItemFocus,\n gap = 0,\n shift = 0,\n children,\n onClose,\n focusProps: _1,\n ...restProps\n}) => {\n const [menuPosition, setMenuPosition] = useState({\n x: offScreen,\n y: offScreen\n });\n const [arrowPosition, setArrowPosition] = useState({});\n const [overflowData, setOverflowData] = useState();\n const [expandedDirection, setExpandedDirection] = useState(direction);\n const [submenuCtx] = useState(createSubmenuCtx);\n const [reposSubmenu, forceReposSubmenu] = useReducer(c => c + 1, 1);\n const {\n transition,\n boundingBoxRef,\n boundingBoxPadding,\n rootMenuRef,\n rootAnchorRef,\n scrollNodesRef,\n reposition,\n viewScroll,\n submenuCloseDelay\n } = useContext(SettingsContext);\n const {\n submenuCtx: parentSubmenuCtx,\n reposSubmenu: reposFlag = repositionFlag\n } = useContext(MenuListContext);\n const menuRef = useRef();\n const arrowRef = useRef();\n const prevOpen = useRef(false);\n const {\n hoverItem,\n dispatch,\n updateItems\n } = useItems(menuRef);\n const isOpen = isMenuOpen(state);\n const openTransition = getTransition(transition, 'open');\n const closeTransition = getTransition(transition, 'close');\n const scrollNodes = scrollNodesRef.current;\n const onKeyDown = e => {\n switch (e.key) {\n case Keys.HOME:\n dispatch(HoverActionTypes.FIRST);\n break;\n case Keys.END:\n dispatch(HoverActionTypes.LAST);\n break;\n case Keys.UP:\n dispatch(HoverActionTypes.DECREASE, hoverItem);\n break;\n case Keys.DOWN:\n dispatch(HoverActionTypes.INCREASE, hoverItem);\n break;\n case Keys.SPACE:\n if (e.target && e.target.className.indexOf(menuClass) !== -1) {\n e.preventDefault();\n }\n return;\n default:\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n };\n const onAnimationEnd = () => {\n if (state === 'closing') {\n setOverflowData();\n }\n safeCall(endTransition);\n };\n const onPointerMove = e => {\n e.stopPropagation();\n submenuCtx.on(submenuCloseDelay, () => {\n dispatch(HoverActionTypes.RESET);\n menuRef.current.focus(noScrollFocus);\n });\n };\n const onPointerLeave = e => {\n if (e.target === e.currentTarget) submenuCtx.off();\n };\n const handlePosition = useCallback(noOverflowCheck => {\n const menuElt = menuRef.current;\n const containerElt = containerRef.current;\n if (!menuElt || !containerElt) return;\n const anchorRect = anchorRef ? anchorRef.current?.getBoundingClientRect() : anchorPoint ? {\n left: anchorPoint.x,\n right: anchorPoint.x,\n top: anchorPoint.y,\n bottom: anchorPoint.y,\n width: 0,\n height: 0\n } : null;\n if (!anchorRect) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('[React-Menu] Menu might not be positioned properly as one of the anchorRef or anchorPoint prop should be provided. If `anchorRef` is provided, the anchor must be mounted before menu is open.');\n }\n return;\n }\n if (!scrollNodes.menu) {\n scrollNodes.menu = (boundingBoxRef ? boundingBoxRef.current : getScrollAncestor(rootMenuRef.current)) || window;\n }\n const positionHelpers = getPositionHelpers(containerElt, menuElt, scrollNodes.menu, boundingBoxPadding);\n let {\n arrowX,\n arrowY,\n x,\n y,\n computedDirection\n } = positionMenu({\n arrow,\n align,\n direction,\n gap,\n shift,\n position,\n anchorRect,\n arrowRef,\n positionHelpers\n });\n const {\n menuRect\n } = positionHelpers;\n const menuHeight = menuRect.height;\n if (!noOverflowCheck && overflow !== 'visible') {\n const {\n getTopOverflow,\n getBottomOverflow\n } = positionHelpers;\n let height, overflowAmt;\n const bottomOverflow = getBottomOverflow(y);\n if (bottomOverflow > 0) {\n height = menuHeight - bottomOverflow;\n overflowAmt = bottomOverflow;\n } else {\n const topOverflow = getTopOverflow(y);\n if (topOverflow < 0) {\n height = menuHeight + topOverflow;\n overflowAmt = 0 - topOverflow;\n if (height >= 0) y -= topOverflow;\n }\n }\n if (height >= 0) {\n setOverflowData({\n height,\n overflowAmt\n });\n }\n }\n if (arrow) setArrowPosition({\n x: arrowX,\n y: arrowY\n });\n setMenuPosition({\n x,\n y\n });\n setExpandedDirection(computedDirection);\n }, [arrow, align, boundingBoxPadding, direction, gap, shift, position, overflow, anchorPoint, anchorRef, containerRef, boundingBoxRef, rootMenuRef, scrollNodes]);\n useIsomorphicLayoutEffect(() => {\n if (isOpen) {\n handlePosition();\n if (prevOpen.current) forceReposSubmenu();\n }\n prevOpen.current = isOpen;\n }, [isOpen, handlePosition, reposFlag]);\n useIsomorphicLayoutEffect(() => {\n if (overflowData && !setDownOverflow) menuRef.current.scrollTop = 0;\n }, [overflowData, setDownOverflow]);\n useIsomorphicLayoutEffect(() => updateItems, [updateItems]);\n useEffect(() => {\n let {\n menu: menuScroll\n } = scrollNodes;\n if (!isOpen || !menuScroll) return;\n menuScroll = menuScroll.addEventListener ? menuScroll : window;\n if (!scrollNodes.anchors) {\n scrollNodes.anchors = [];\n let anchorScroll = getScrollAncestor(rootAnchorRef && rootAnchorRef.current);\n while (anchorScroll && anchorScroll !== menuScroll) {\n scrollNodes.anchors.push(anchorScroll);\n anchorScroll = getScrollAncestor(anchorScroll);\n }\n }\n let scroll = viewScroll;\n if (scrollNodes.anchors.length && scroll === 'initial') scroll = 'auto';\n if (scroll === 'initial') return;\n const handleScroll = () => {\n if (scroll === 'auto') {\n batchedUpdates(() => handlePosition(true));\n } else {\n safeCall(onClose, {\n reason: CloseReason.SCROLL\n });\n }\n };\n const scrollObservers = scrollNodes.anchors.concat(viewScroll !== 'initial' ? menuScroll : []);\n scrollObservers.forEach(o => o.addEventListener('scroll', handleScroll));\n return () => scrollObservers.forEach(o => o.removeEventListener('scroll', handleScroll));\n }, [rootAnchorRef, scrollNodes, isOpen, onClose, viewScroll, handlePosition]);\n const hasOverflow = !!overflowData && overflowData.overflowAmt > 0;\n useEffect(() => {\n if (hasOverflow || !isOpen || !parentScrollingRef) return;\n const handleScroll = () => batchedUpdates(handlePosition);\n const parentScroll = parentScrollingRef.current;\n parentScroll.addEventListener('scroll', handleScroll);\n return () => parentScroll.removeEventListener('scroll', handleScroll);\n }, [isOpen, hasOverflow, parentScrollingRef, handlePosition]);\n useEffect(() => {\n if (!isOpen || typeof ResizeObserver !== 'function' || reposition === 'initial') return;\n const targetList = [];\n const resizeObserver = new ResizeObserver(entries => entries.forEach(({\n target\n }) => {\n if (targetList.indexOf(target) < 0) {\n targetList.push(target);\n } else {\n flushSync(() => {\n handlePosition();\n forceReposSubmenu();\n });\n }\n }));\n const resizeObserverOptions = {\n box: 'border-box'\n };\n resizeObserver.observe(menuRef.current, resizeObserverOptions);\n const anchor = anchorRef?.current;\n anchor && resizeObserver.observe(anchor, resizeObserverOptions);\n return () => resizeObserver.disconnect();\n }, [isOpen, reposition, anchorRef, handlePosition]);\n useEffect(() => {\n if (!isOpen) {\n dispatch(HoverActionTypes.RESET);\n if (!closeTransition) setOverflowData();\n return;\n }\n const {\n position,\n alwaysUpdate\n } = menuItemFocus || {};\n const setItemFocus = () => {\n if (position === FocusPositions.FIRST) {\n dispatch(HoverActionTypes.FIRST);\n } else if (position === FocusPositions.LAST) {\n dispatch(HoverActionTypes.LAST);\n } else if (position >= -1) {\n dispatch(HoverActionTypes.SET_INDEX, undefined, position);\n }\n };\n if (alwaysUpdate) {\n setItemFocus();\n } else if (captureFocus) {\n const id = setTimeout(() => {\n const menuElt = menuRef.current;\n if (menuElt && !menuElt.contains(document.activeElement)) {\n menuElt.focus(noScrollFocus);\n setItemFocus();\n }\n }, openTransition ? 170 : 100);\n return () => clearTimeout(id);\n }\n }, [isOpen, openTransition, closeTransition, captureFocus, menuItemFocus, dispatch]);\n const itemContext = useMemo(() => ({\n isParentOpen: isOpen,\n submenuCtx,\n dispatch,\n updateItems\n }), [isOpen, submenuCtx, dispatch, updateItems]);\n let maxHeight, overflowAmt;\n if (overflowData) {\n setDownOverflow ? overflowAmt = overflowData.overflowAmt : maxHeight = overflowData.height;\n }\n const listContext = useMemo(() => ({\n reposSubmenu,\n submenuCtx,\n overflow,\n overflowAmt,\n parentMenuRef: menuRef,\n parentDir: expandedDirection\n }), [reposSubmenu, submenuCtx, overflow, overflowAmt, expandedDirection]);\n const overflowStyle = maxHeight >= 0 ? {\n maxHeight,\n overflow\n } : undefined;\n const modifiers = useMemo(() => ({\n state,\n align,\n dir: expandedDirection\n }), [state, align, expandedDirection]);\n const arrowModifiers = useMemo(() => ({\n dir: expandedDirection\n }), [expandedDirection]);\n const _arrowClassName = useBEM({\n block: menuClass,\n element: menuArrowClass,\n modifiers: arrowModifiers,\n className: arrowProps.className\n });\n const menu = /*#__PURE__*/jsxs(\"ul\", {\n role: \"menu\",\n \"aria-label\": ariaLabel,\n ...commonProps(isDisabled),\n ...mergeProps({\n onPointerEnter: parentSubmenuCtx?.off,\n onPointerMove,\n onPointerLeave,\n onKeyDown,\n onAnimationEnd\n }, restProps),\n ref: useCombinedRef(externalRef, menuRef),\n className: useBEM({\n block: menuClass,\n modifiers,\n className: menuClassName\n }),\n style: {\n ...menuStyle,\n ...overflowStyle,\n margin: 0,\n display: state === 'closed' ? 'none' : undefined,\n position: positionAbsolute,\n left: menuPosition.x,\n top: menuPosition.y\n },\n children: [arrow && /*#__PURE__*/jsx(\"li\", {\n \"aria-hidden\": true,\n ...arrowProps,\n className: _arrowClassName,\n style: {\n display: 'block',\n position: positionAbsolute,\n left: arrowPosition.x,\n top: arrowPosition.y,\n ...arrowProps.style\n },\n ref: arrowRef\n }), /*#__PURE__*/jsx(MenuListContext.Provider, {\n value: listContext,\n children: /*#__PURE__*/jsx(MenuListItemContext.Provider, {\n value: itemContext,\n children: /*#__PURE__*/jsx(HoverItemContext.Provider, {\n value: hoverItem,\n children: safeCall(children, modifiers)\n })\n })\n })]\n });\n return containerProps ? /*#__PURE__*/jsx(MenuContainer, {\n ...containerProps,\n isOpen: isOpen,\n children: menu\n }) : menu;\n};\n\nexport { MenuList };\n","import { forwardRef, useRef, useMemo } from 'react';\nimport { createPortal } from 'react-dom';\nimport { MenuList } from './MenuList.mjs';\nimport { jsx } from 'react/jsx-runtime';\nimport { SettingsContext, EventHandlersContext, CloseReason, Keys } from '../utils/constants.mjs';\nimport { safeCall } from '../utils/utils.mjs';\n\nconst ControlledMenu = /*#__PURE__*/forwardRef(function ControlledMenu({\n 'aria-label': ariaLabel,\n className,\n containerProps,\n initialMounted,\n unmountOnClose,\n transition,\n transitionTimeout,\n boundingBoxRef,\n boundingBoxPadding,\n reposition = 'auto',\n submenuOpenDelay = 300,\n submenuCloseDelay = 150,\n viewScroll = 'initial',\n portal,\n theming,\n onItemClick,\n ...restProps\n}, externalRef) {\n const containerRef = useRef(null);\n const scrollNodesRef = useRef({});\n const {\n anchorRef,\n state,\n onClose\n } = restProps;\n const settings = useMemo(() => ({\n initialMounted,\n unmountOnClose,\n transition,\n transitionTimeout,\n boundingBoxRef,\n boundingBoxPadding,\n rootMenuRef: containerRef,\n rootAnchorRef: anchorRef,\n scrollNodesRef,\n reposition,\n viewScroll,\n submenuOpenDelay,\n submenuCloseDelay\n }), [initialMounted, unmountOnClose, transition, transitionTimeout, anchorRef, boundingBoxRef, boundingBoxPadding, reposition, viewScroll, submenuOpenDelay, submenuCloseDelay]);\n const eventHandlers = useMemo(() => ({\n handleClick(event, isCheckorRadio) {\n if (!event.stopPropagation) safeCall(onItemClick, event);\n let keepOpen = event.keepOpen;\n if (keepOpen === undefined) {\n keepOpen = isCheckorRadio && event.key === Keys.SPACE;\n }\n if (!keepOpen) {\n safeCall(onClose, {\n value: event.value,\n key: event.key,\n reason: CloseReason.CLICK\n });\n }\n },\n handleClose(key) {\n safeCall(onClose, {\n key,\n reason: CloseReason.CLICK\n });\n }\n }), [onItemClick, onClose]);\n if (!state) return null;\n const menuList = /*#__PURE__*/jsx(SettingsContext.Provider, {\n value: settings,\n children: /*#__PURE__*/jsx(EventHandlersContext.Provider, {\n value: eventHandlers,\n children: /*#__PURE__*/jsx(MenuList, {\n ...restProps,\n ariaLabel: ariaLabel || 'Menu',\n externalRef: externalRef,\n containerRef: containerRef,\n containerProps: {\n className,\n containerRef,\n containerProps,\n theming,\n transition,\n onClose\n }\n })\n })\n });\n if (portal === true && typeof document !== 'undefined') {\n return /*#__PURE__*/createPortal(menuList, document.body);\n } else if (portal) {\n return portal.target ? /*#__PURE__*/createPortal(menuList, portal.target) : portal.stablePosition ? null : menuList;\n }\n return menuList;\n});\n\nexport { ControlledMenu };\n","const PRE_ENTER = 0;\nconst ENTERING = 1;\nconst ENTERED = 2;\nconst PRE_EXIT = 3;\nconst EXITING = 4;\nconst EXITED = 5;\nconst UNMOUNTED = 6;\nconst STATUS = ['preEnter', 'entering', 'entered', 'preExit', 'exiting', 'exited', 'unmounted'];\nconst getState = status => ({\n _s: status,\n status: STATUS[status],\n isEnter: status < PRE_EXIT,\n isMounted: status !== UNMOUNTED,\n isResolved: status === ENTERED || status > EXITING\n});\nconst startOrEnd = unmounted => unmounted ? UNMOUNTED : EXITED;\nconst getEndStatus = (status, unmountOnExit) => {\n switch (status) {\n case ENTERING:\n case PRE_ENTER:\n return ENTERED;\n case EXITING:\n case PRE_EXIT:\n return startOrEnd(unmountOnExit);\n }\n};\nconst getTimeout = timeout => typeof timeout === 'object' ? [timeout.enter, timeout.exit] : [timeout, timeout];\nconst nextTick = (transitState, status) => setTimeout(() => {\n // Reading document.body.offsetTop can force browser to repaint before transition to the next state\n isNaN(document.body.offsetTop) || transitState(status + 1);\n}, 0);\n\nexport { ENTERED, ENTERING, EXITED, EXITING, PRE_ENTER, PRE_EXIT, STATUS, UNMOUNTED, getEndStatus, getState, getTimeout, nextTick, startOrEnd };\n","import { useState, useRef, useCallback } from 'react';\nimport { getState, ENTERED, startOrEnd, getTimeout, getEndStatus, PRE_EXIT, nextTick, PRE_ENTER, EXITING, ENTERING } from './utils.mjs';\n\nconst updateState = (status, setState, latestState, timeoutId, onChange) => {\n clearTimeout(timeoutId.current);\n const state = getState(status);\n setState(state);\n latestState.current = state;\n onChange && onChange({\n current: state\n });\n};\nconst useTransitionState = ({\n enter = true,\n exit = true,\n preEnter,\n preExit,\n timeout,\n initialEntered,\n mountOnEnter,\n unmountOnExit,\n onStateChange: onChange\n} = {}) => {\n const [state, setState] = useState(() => getState(initialEntered ? ENTERED : startOrEnd(mountOnEnter)));\n const latestState = useRef(state);\n const timeoutId = useRef();\n const [enterTimeout, exitTimeout] = getTimeout(timeout);\n const endTransition = useCallback(() => {\n const status = getEndStatus(latestState.current._s, unmountOnExit);\n status && updateState(status, setState, latestState, timeoutId, onChange);\n }, [onChange, unmountOnExit]);\n const toggle = useCallback(toEnter => {\n const transitState = status => {\n updateState(status, setState, latestState, timeoutId, onChange);\n switch (status) {\n case ENTERING:\n if (enterTimeout >= 0) timeoutId.current = setTimeout(endTransition, enterTimeout);\n break;\n case EXITING:\n if (exitTimeout >= 0) timeoutId.current = setTimeout(endTransition, exitTimeout);\n break;\n case PRE_ENTER:\n case PRE_EXIT:\n timeoutId.current = nextTick(transitState, status);\n break;\n }\n };\n const enterStage = latestState.current.isEnter;\n if (typeof toEnter !== 'boolean') toEnter = !enterStage;\n if (toEnter) {\n !enterStage && transitState(enter ? preEnter ? PRE_ENTER : ENTERING : ENTERED);\n } else {\n enterStage && transitState(exit ? preExit ? PRE_EXIT : EXITING : startOrEnd(unmountOnExit));\n }\n }, [endTransition, onChange, enter, exit, preEnter, preExit, enterTimeout, exitTimeout, unmountOnExit]);\n return [state, toggle, endTransition];\n};\n\nexport { useTransitionState };\n","import { useCallback } from 'react';\nimport { useTransitionState } from 'react-transition-state';\nimport { getTransition } from '../utils/utils.mjs';\nimport { MenuStateMap } from '../utils/constants.mjs';\n\nconst useMenuState = ({\n initialOpen,\n initialMounted,\n unmountOnClose,\n transition,\n transitionTimeout = 500,\n onMenuChange\n} = {}) => {\n const enter = getTransition(transition, 'open');\n const exit = getTransition(transition, 'close');\n const [{\n status\n }, toggleMenu, endTransition] = useTransitionState({\n initialEntered: initialOpen,\n mountOnEnter: !initialMounted,\n unmountOnExit: unmountOnClose,\n timeout: transitionTimeout,\n enter,\n exit,\n onStateChange: useCallback(({\n current: {\n isEnter,\n isResolved\n }\n }) => {\n if (!onMenuChange || isEnter && enter && isResolved || !isEnter && exit && isResolved) {\n return;\n }\n onMenuChange({\n open: isEnter\n });\n }, [onMenuChange, enter, exit])\n });\n return [{\n state: MenuStateMap[status],\n endTransition\n }, toggleMenu];\n};\n\nexport { useMenuState };\n","import { useState } from 'react';\nimport { useMenuState } from './useMenuState.mjs';\n\nconst useMenuStateAndFocus = options => {\n const [menuProps, toggleMenu] = useMenuState(options);\n const [menuItemFocus, setMenuItemFocus] = useState();\n const openMenu = (position, alwaysUpdate) => {\n setMenuItemFocus({\n position,\n alwaysUpdate\n });\n toggleMenu(true);\n };\n return [{\n menuItemFocus,\n ...menuProps\n }, toggleMenu, openMenu];\n};\n\nexport { useMenuStateAndFocus };\n","import { useState } from 'react';\n\nconst useClick = (state, onToggle) => {\n if (process.env.NODE_ENV !== 'production' && typeof onToggle !== 'function') {\n throw new Error('[React-Menu] useClick/useHover requires a function in the second parameter.');\n }\n const [skipOpen] = useState({});\n return {\n onMouseDown: () => {\n skipOpen.v = state && state !== 'closed';\n },\n onClick: e => skipOpen.v ? skipOpen.v = false : onToggle(true, e)\n };\n};\n\nexport { useClick };\n","import { forwardRef, useRef, useCallback, useImperativeHandle, Fragment, cloneElement, version } from 'react';\nimport { ControlledMenu } from './ControlledMenu.mjs';\nimport { jsxs, jsx } from 'react/jsx-runtime';\nimport { useMenuStateAndFocus } from '../hooks/useMenuStateAndFocus.mjs';\nimport { useClick } from '../hooks/useClick.mjs';\nimport { useCombinedRef } from '../hooks/useCombinedRef.mjs';\nimport { safeCall, mergeProps, isMenuOpen, getName } from '../utils/utils.mjs';\nimport { FocusPositions, Keys } from '../utils/constants.mjs';\n\nconst isLegacyReact = parseInt(version) < 19;\nconst Menu = /*#__PURE__*/forwardRef(function Menu({\n 'aria-label': ariaLabel,\n captureFocus: _,\n initialOpen: _1,\n menuButton,\n instanceRef,\n onMenuChange,\n ...restProps\n}, externalRef) {\n const [stateProps, toggleMenu, openMenu] = useMenuStateAndFocus({\n ...restProps,\n onMenuChange\n });\n const {\n state\n } = stateProps;\n const isOpen = isMenuOpen(state);\n const buttonRef = useRef(null);\n const anchorProps = useClick(state, (_, e) => openMenu(!e.detail ? FocusPositions.FIRST : undefined));\n const handleClose = useCallback(e => {\n toggleMenu(false);\n if (e.key) buttonRef.current.focus();\n }, [toggleMenu]);\n const onKeyDown = e => {\n switch (e.key) {\n case Keys.UP:\n openMenu(FocusPositions.LAST);\n break;\n case Keys.DOWN:\n openMenu(FocusPositions.FIRST);\n break;\n default:\n return;\n }\n e.preventDefault();\n };\n const button = safeCall(menuButton, {\n open: isOpen\n });\n if (!button || !button.type) throw new Error('Menu requires a menuButton prop.');\n const buttonProps = {\n ...mergeProps({\n onKeyDown,\n ...anchorProps\n }, button.props),\n ref: useCombinedRef(isLegacyReact ? button.ref : button.props.ref, buttonRef)\n };\n if (getName(button.type) === 'MenuButton') {\n buttonProps.isOpen = isOpen;\n }\n const renderButton = /*#__PURE__*/cloneElement(button, buttonProps);\n useImperativeHandle(instanceRef, () => ({\n openMenu,\n closeMenu: () => toggleMenu(false)\n }));\n return /*#__PURE__*/jsxs(Fragment, {\n children: [renderButton, /*#__PURE__*/jsx(ControlledMenu, {\n ...restProps,\n ...stateProps,\n \"aria-label\": ariaLabel || (typeof button.props.children === 'string' ? button.props.children : 'Menu'),\n anchorRef: buttonRef,\n ref: externalRef,\n onClose: handleClose\n })]\n });\n});\n\nexport { Menu };\n","import { forwardRef, useRef, memo, useContext } from 'react';\nimport { HoverItemContext } from './constants.mjs';\nimport { jsx } from 'react/jsx-runtime';\n\nconst withHovering = (name, WrappedComponent) => {\n const Component = /*#__PURE__*/memo(WrappedComponent);\n const WithHovering = /*#__PURE__*/forwardRef((props, ref) => {\n const itemRef = useRef(null);\n return /*#__PURE__*/jsx(Component, {\n ...props,\n itemRef: itemRef,\n externalRef: ref,\n isHovering: useContext(HoverItemContext) === itemRef.current\n });\n });\n WithHovering.displayName = `WithHovering(${name})`;\n return WithHovering;\n};\n\nexport { withHovering };\n","import { useLayoutEffect as useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.mjs';\n\nconst useItemEffect = (isDisabled, itemRef, updateItems) => {\n useIsomorphicLayoutEffect(() => {\n if (process.env.NODE_ENV !== 'production' && !updateItems) {\n throw new Error(`[React-Menu] This menu item or submenu should be rendered under a menu: ${itemRef.current.outerHTML}`);\n }\n if (isDisabled) return;\n const item = itemRef.current;\n updateItems(item, true);\n return () => {\n updateItems(item);\n };\n }, [isDisabled, itemRef, updateItems]);\n};\n\nexport { useItemEffect };\n","import { useContext, useRef, useState, useEffect, useImperativeHandle, useMemo } from 'react';\nimport { createPortal } from 'react-dom';\nimport { MenuList } from './MenuList.mjs';\nimport { jsxs, jsx } from 'react/jsx-runtime';\nimport { withHovering } from '../utils/withHovering.mjs';\nimport { useMenuStateAndFocus } from '../hooks/useMenuStateAndFocus.mjs';\nimport { useItemEffect } from '../hooks/useItemEffect.mjs';\nimport { SettingsContext, MenuListContext, MenuListItemContext, roleNone, roleMenuitem, menuClass, menuItemClass, subMenuClass, HoverActionTypes, Keys, FocusPositions } from '../utils/constants.mjs';\nimport { useBEM } from '../hooks/useBEM.mjs';\nimport { useCombinedRef } from '../hooks/useCombinedRef.mjs';\nimport { isMenuOpen, mergeProps, commonProps, safeCall, batchedUpdates } from '../utils/utils.mjs';\n\nconst SubMenu = /*#__PURE__*/withHovering('SubMenu', function SubMenu({\n 'aria-label': ariaLabel,\n className,\n disabled,\n direction,\n label,\n openTrigger,\n onMenuChange,\n isHovering,\n instanceRef,\n itemRef,\n captureFocus: _1,\n repositionFlag: _2,\n itemProps = {},\n ...restProps\n}) {\n const settings = useContext(SettingsContext);\n const {\n rootMenuRef,\n submenuOpenDelay,\n submenuCloseDelay\n } = settings;\n const {\n parentMenuRef,\n parentDir,\n overflow: parentOverflow\n } = useContext(MenuListContext);\n const {\n isParentOpen,\n submenuCtx,\n dispatch,\n updateItems\n } = useContext(MenuListItemContext);\n const isPortal = parentOverflow !== 'visible';\n const [stateProps, toggleMenu, _openMenu] = useMenuStateAndFocus({\n ...settings,\n onMenuChange\n });\n const {\n state\n } = stateProps;\n const isDisabled = !!disabled;\n const isOpen = isMenuOpen(state);\n const containerRef = useRef(null);\n const [timerId] = useState({\n v: 0\n });\n const stopTimer = () => {\n submenuCtx.off();\n if (timerId.v) {\n clearTimeout(timerId.v);\n timerId.v = 0;\n }\n };\n const openMenu = (...args) => {\n stopTimer();\n setHover();\n !isDisabled && _openMenu(...args);\n };\n const setHover = () => !isHovering && !isDisabled && dispatch(HoverActionTypes.SET, itemRef.current);\n const delayOpen = delay => {\n setHover();\n if (!openTrigger) timerId.v = setTimeout(() => batchedUpdates(openMenu), Math.max(delay, 0));\n };\n const onPointerMove = e => {\n if (isDisabled) return;\n e.stopPropagation();\n if (timerId.v || isOpen) return;\n submenuCtx.on(submenuCloseDelay, () => delayOpen(submenuOpenDelay - submenuCloseDelay), () => delayOpen(submenuOpenDelay));\n };\n const onPointerLeave = () => {\n stopTimer();\n if (!isOpen) dispatch(HoverActionTypes.UNSET, itemRef.current);\n };\n const onKeyDown = e => {\n if (!isHovering) return;\n switch (e.key) {\n case Keys.ENTER:\n e.preventDefault();\n case Keys.SPACE:\n case Keys.RIGHT:\n openTrigger !== 'none' && openMenu(FocusPositions.FIRST);\n }\n };\n const onKeyDownOfRoot = e => {\n let handled = false;\n switch (e.key) {\n case Keys.LEFT:\n if (isOpen) {\n itemRef.current.focus();\n toggleMenu(false);\n handled = true;\n }\n break;\n case Keys.RIGHT:\n if (!isOpen) handled = true;\n break;\n }\n if (handled) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n useItemEffect(isDisabled, itemRef, updateItems);\n useEffect(() => submenuCtx.toggle(isOpen), [submenuCtx, isOpen]);\n useEffect(() => () => {\n clearTimeout(timerId.v);\n submenuCtx.toggle(false);\n }, [timerId, submenuCtx]);\n useEffect(() => {\n if (isHovering && isParentOpen) {\n itemRef.current.focus();\n } else {\n toggleMenu(false);\n }\n }, [isHovering, isParentOpen, toggleMenu, itemRef]);\n useImperativeHandle(instanceRef, () => ({\n openMenu: (...args) => {\n isParentOpen && openMenu(...args);\n },\n closeMenu: () => {\n if (isOpen) {\n itemRef.current.focus();\n toggleMenu(false);\n }\n }\n }));\n const modifiers = useMemo(() => ({\n open: isOpen,\n hover: isHovering,\n disabled: isDisabled,\n submenu: true\n }), [isOpen, isHovering, isDisabled]);\n const {\n ref: externalItemRef,\n className: itemClassName,\n ...restItemProps\n } = itemProps;\n const mergedItemProps = mergeProps({\n onPointerEnter: submenuCtx.off,\n onPointerMove,\n onPointerLeave,\n onKeyDown,\n onClick: () => openTrigger !== 'none' && openMenu()\n }, restItemProps);\n const getMenuList = () => {\n const menuList = /*#__PURE__*/jsx(MenuList, {\n ...restProps,\n ...stateProps,\n ariaLabel: ariaLabel || (typeof label === 'string' ? label : 'Submenu'),\n anchorRef: itemRef,\n containerRef: isPortal ? rootMenuRef : containerRef,\n direction: direction || (parentDir === 'right' || parentDir === 'left' ? parentDir : 'right'),\n parentScrollingRef: isPortal && parentMenuRef,\n isDisabled: isDisabled\n });\n const container = rootMenuRef.current;\n return isPortal && container ? /*#__PURE__*/createPortal(menuList, container) : menuList;\n };\n return /*#__PURE__*/jsxs(\"li\", {\n className: useBEM({\n block: menuClass,\n element: subMenuClass,\n className\n }),\n style: {\n position: 'relative'\n },\n role: roleNone,\n ref: containerRef,\n onKeyDown: onKeyDownOfRoot,\n children: [/*#__PURE__*/jsx(\"div\", {\n role: roleMenuitem,\n \"aria-haspopup\": true,\n \"aria-expanded\": isOpen,\n ...commonProps(isDisabled, isHovering),\n ...mergedItemProps,\n ref: useCombinedRef(externalItemRef, itemRef),\n className: useBEM({\n block: menuClass,\n element: menuItemClass,\n modifiers,\n className: itemClassName\n }),\n children: useMemo(() => safeCall(label, modifiers), [label, modifiers])\n }), state && getMenuList()]\n });\n});\n\nexport { SubMenu };\n","import { useContext, useEffect } from 'react';\nimport { useItemEffect } from './useItemEffect.mjs';\nimport { SettingsContext, MenuListItemContext, HoverActionTypes } from '../utils/constants.mjs';\n\nconst useItemState = (itemRef, focusRef, isHovering, isDisabled) => {\n const {\n submenuCloseDelay\n } = useContext(SettingsContext);\n const {\n isParentOpen,\n submenuCtx,\n dispatch,\n updateItems\n } = useContext(MenuListItemContext);\n const setHover = () => {\n !isHovering && !isDisabled && dispatch(HoverActionTypes.SET, itemRef.current);\n };\n const unsetHover = () => {\n !isDisabled && dispatch(HoverActionTypes.UNSET, itemRef.current);\n };\n const onBlur = e => {\n if (isHovering && !e.currentTarget.contains(e.relatedTarget)) unsetHover();\n };\n const onPointerMove = e => {\n if (!isDisabled) {\n e.stopPropagation();\n submenuCtx.on(submenuCloseDelay, setHover, setHover);\n }\n };\n const onPointerLeave = (_, keepHover) => {\n submenuCtx.off();\n !keepHover && unsetHover();\n };\n useItemEffect(isDisabled, itemRef, updateItems);\n useEffect(() => {\n if (isHovering && isParentOpen) {\n focusRef.current && focusRef.current.focus();\n }\n }, [focusRef, isHovering, isParentOpen]);\n return {\n setHover,\n onBlur,\n onPointerMove,\n onPointerLeave\n };\n};\n\nexport { useItemState };\n","import { useContext, useMemo } from 'react';\nimport { jsx } from 'react/jsx-runtime';\nimport { useItemState } from '../hooks/useItemState.mjs';\nimport { EventHandlersContext, RadioGroupContext, menuClass, menuItemClass, roleNone, roleMenuitem, Keys } from '../utils/constants.mjs';\nimport { useBEM } from '../hooks/useBEM.mjs';\nimport { useCombinedRef } from '../hooks/useCombinedRef.mjs';\nimport { withHovering } from '../utils/withHovering.mjs';\nimport { mergeProps, safeCall, commonProps } from '../utils/utils.mjs';\n\nconst MenuItem = /*#__PURE__*/withHovering('MenuItem', function MenuItem({\n className,\n value,\n href,\n type,\n checked,\n disabled,\n children,\n onClick,\n isHovering,\n itemRef,\n externalRef,\n ...restProps\n}) {\n const isDisabled = !!disabled;\n const {\n setHover,\n ...restStateProps\n } = useItemState(itemRef, itemRef, isHovering, isDisabled);\n const eventHandlers = useContext(EventHandlersContext);\n const radioGroup = useContext(RadioGroupContext);\n const isRadio = type === 'radio';\n const isCheckBox = type === 'checkbox';\n const isAnchor = !!href && !isDisabled && !isRadio && !isCheckBox;\n const isChecked = isRadio ? radioGroup.value === value : isCheckBox ? !!checked : false;\n const handleClick = e => {\n if (isDisabled) {\n e.stopPropagation();\n e.preventDefault();\n return;\n }\n const event = {\n value,\n syntheticEvent: e\n };\n if (e.key !== undefined) event.key = e.key;\n if (isCheckBox) event.checked = !isChecked;\n if (isRadio) event.name = radioGroup.name;\n safeCall(onClick, event);\n if (isRadio) safeCall(radioGroup.onRadioChange, event);\n eventHandlers.handleClick(event, isCheckBox || isRadio);\n };\n const handleKeyDown = e => {\n if (!isHovering) return;\n switch (e.key) {\n case Keys.ENTER:\n e.preventDefault();\n case Keys.SPACE:\n isAnchor ? itemRef.current.click() : handleClick(e);\n }\n };\n const modifiers = useMemo(() => ({\n type,\n disabled: isDisabled,\n hover: isHovering,\n checked: isChecked,\n anchor: isAnchor\n }), [type, isDisabled, isHovering, isChecked, isAnchor]);\n const mergedProps = mergeProps({\n ...restStateProps,\n onPointerDown: setHover,\n onKeyDown: handleKeyDown,\n onClick: handleClick\n }, restProps);\n const menuItemProps = {\n role: isRadio ? 'menuitemradio' : isCheckBox ? 'menuitemcheckbox' : roleMenuitem,\n 'aria-checked': isRadio || isCheckBox ? isChecked : undefined,\n ...commonProps(isDisabled, isHovering),\n ...mergedProps,\n ref: useCombinedRef(externalRef, itemRef),\n className: useBEM({\n block: menuClass,\n element: menuItemClass,\n modifiers,\n className\n }),\n children: useMemo(() => safeCall(children, modifiers), [children, modifiers])\n };\n return isAnchor ? /*#__PURE__*/jsx(\"li\", {\n role: roleNone,\n children: /*#__PURE__*/jsx(\"a\", {\n href: href,\n ...menuItemProps\n })\n }) : /*#__PURE__*/jsx(\"li\", {\n ...menuItemProps\n });\n});\n\nexport { MenuItem };\n","import { useRef, useContext, useMemo } from 'react';\nimport { jsx } from 'react/jsx-runtime';\nimport { useItemState } from '../hooks/useItemState.mjs';\nimport { useBEM } from '../hooks/useBEM.mjs';\nimport { useCombinedRef } from '../hooks/useCombinedRef.mjs';\nimport { withHovering } from '../utils/withHovering.mjs';\nimport { EventHandlersContext, roleMenuitem, menuClass, menuItemClass } from '../utils/constants.mjs';\nimport { safeCall, mergeProps, commonProps } from '../utils/utils.mjs';\n\nconst FocusableItem = /*#__PURE__*/withHovering('FocusableItem', function FocusableItem({\n className,\n disabled,\n children,\n isHovering,\n itemRef,\n externalRef,\n ...restProps\n}) {\n const isDisabled = !!disabled;\n const ref = useRef(null);\n const {\n setHover,\n onPointerLeave,\n ...restStateProps\n } = useItemState(itemRef, ref, isHovering, isDisabled);\n const {\n handleClose\n } = useContext(EventHandlersContext);\n const modifiers = useMemo(() => ({\n disabled: isDisabled,\n hover: isHovering,\n focusable: true\n }), [isDisabled, isHovering]);\n const renderChildren = useMemo(() => safeCall(children, {\n ...modifiers,\n ref,\n closeMenu: handleClose\n }), [children, modifiers, handleClose]);\n const mergedProps = mergeProps({\n ...restStateProps,\n onPointerLeave: e => onPointerLeave(e, true),\n onFocus: setHover\n }, restProps);\n return /*#__PURE__*/jsx(\"li\", {\n role: roleMenuitem,\n ...commonProps(isDisabled),\n ...mergedProps,\n ref: useCombinedRef(externalRef, itemRef),\n className: useBEM({\n block: menuClass,\n element: menuItemClass,\n modifiers,\n className\n }),\n children: renderChildren\n });\n});\n\nexport { FocusableItem };\n","import { memo, forwardRef } from 'react';\nimport { jsx } from 'react/jsx-runtime';\nimport { useBEM } from '../hooks/useBEM.mjs';\nimport { menuClass, menuDividerClass } from '../utils/constants.mjs';\n\nconst MenuDivider = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function MenuDivider({\n className,\n ...restProps\n}, externalRef) {\n return /*#__PURE__*/jsx(\"li\", {\n role: \"separator\",\n ...restProps,\n ref: externalRef,\n className: useBEM({\n block: menuClass,\n element: menuDividerClass,\n className\n })\n });\n}));\n\nexport { MenuDivider };\n","import { memo, forwardRef } from 'react';\nimport { jsx } from 'react/jsx-runtime';\nimport { useBEM } from '../hooks/useBEM.mjs';\nimport { roleNone, menuClass, menuHeaderClass } from '../utils/constants.mjs';\n\nconst MenuHeader = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function MenuHeader({\n className,\n ...restProps\n}, externalRef) {\n return /*#__PURE__*/jsx(\"li\", {\n role: roleNone,\n ...restProps,\n ref: externalRef,\n className: useBEM({\n block: menuClass,\n element: menuHeaderClass,\n className\n })\n });\n}));\n\nexport { MenuHeader };\n","import { forwardRef, useRef, useState, useContext } from 'react';\nimport { jsx } from 'react/jsx-runtime';\nimport { useLayoutEffect as useIsomorphicLayoutEffect } from '../hooks/useIsomorphicLayoutEffect.mjs';\nimport { getNormalizedClientRect } from '../positionUtils/getNormalizedClientRect.mjs';\nimport { useBEM } from '../hooks/useBEM.mjs';\nimport { useCombinedRef } from '../hooks/useCombinedRef.mjs';\nimport { MenuListContext, menuClass, menuGroupClass } from '../utils/constants.mjs';\n\nconst MenuGroup = /*#__PURE__*/forwardRef(function MenuGroup({\n className,\n style,\n takeOverflow,\n ...restProps\n}, externalRef) {\n const ref = useRef(null);\n const [overflowStyle, setOverflowStyle] = useState();\n const {\n overflow,\n overflowAmt\n } = useContext(MenuListContext);\n useIsomorphicLayoutEffect(() => {\n let maxHeight;\n if (takeOverflow && overflowAmt >= 0) {\n maxHeight = getNormalizedClientRect(ref.current).height - overflowAmt;\n if (maxHeight < 0) maxHeight = 0;\n }\n setOverflowStyle(maxHeight >= 0 ? {\n maxHeight,\n overflow\n } : undefined);\n }, [takeOverflow, overflow, overflowAmt]);\n useIsomorphicLayoutEffect(() => {\n if (overflowStyle) ref.current.scrollTop = 0;\n }, [overflowStyle]);\n return /*#__PURE__*/jsx(\"div\", {\n ...restProps,\n ref: useCombinedRef(externalRef, ref),\n className: useBEM({\n block: menuClass,\n element: menuGroupClass,\n className\n }),\n style: {\n ...style,\n ...overflowStyle\n }\n });\n});\n\nexport { MenuGroup };\n","import { useRef as i, useCallback as P, useEffect as C } from \"react\";\nvar f = /* @__PURE__ */ ((e) => (e.Mouse = \"mouse\", e.Touch = \"touch\", e.Pointer = \"pointer\", e))(f || {}), l = /* @__PURE__ */ ((e) => (e.CancelledByMovement = \"cancelled-by-movement\", e.CancelledByRelease = \"cancelled-by-release\", e.CancelledOutsideElement = \"cancelled-outside-element\", e))(l || {});\nconst b = [\n \"mousedown\",\n \"mousemove\",\n \"mouseup\",\n \"mouseleave\",\n \"mouseout\"\n], q = [\n \"touchstart\",\n \"touchmove\",\n \"touchend\",\n \"touchcancel\"\n], z = [\n \"pointerdown\",\n \"pointermove\",\n \"pointerup\",\n \"pointerleave\",\n \"pointerout\"\n];\nfunction G(e) {\n return typeof e == \"object\" && e !== null && \"pageX\" in e && typeof e.pageX == \"number\" && \"pageY\" in e && typeof e.pageY == \"number\";\n}\nfunction J(e) {\n var u;\n return b.includes((u = e == null ? void 0 : e.nativeEvent) == null ? void 0 : u.type);\n}\nfunction U(e) {\n var u;\n return q.includes((u = e == null ? void 0 : e.nativeEvent) == null ? void 0 : u.type) || \"touches\" in e;\n}\nfunction K(e) {\n const { nativeEvent: u } = e;\n return u ? z.includes(u == null ? void 0 : u.type) || \"pointerId\" in u : !1;\n}\nfunction D(e) {\n return J(e) || U(e) || K(e);\n}\nfunction A(e) {\n var s;\n const u = U(e) ? (s = e == null ? void 0 : e.touches) == null ? void 0 : s[0] : e;\n return G(u) ? {\n x: u.pageX,\n y: u.pageY\n } : null;\n}\nfunction N(e) {\n return {\n target: e.target,\n currentTarget: e.currentTarget,\n nativeEvent: e,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n persist: () => {\n }\n };\n}\nfunction V(e, {\n threshold: u = 400,\n captureEvent: s = !1,\n detect: R = f.Pointer,\n cancelOnMovement: p = !1,\n cancelOutsideElement: T = !0,\n filterEvents: M,\n onStart: m,\n onMove: w,\n onFinish: g,\n onCancel: h\n} = {}) {\n const L = i(!1), c = i(!1), H = i(), d = i(), B = i(e), a = i(null), y = P(\n (r) => (t) => {\n c.current || D(t) && (M !== void 0 && !M(t) || (s && t.persist(), m == null || m(t, { context: r }), a.current = A(t), c.current = !0, H.current = t.currentTarget, d.current = setTimeout(() => {\n B.current && (B.current(t, { context: r }), L.current = !0);\n }, u)));\n },\n [s, M, m, u]\n ), o = P(\n (r) => (t, n) => {\n D(t) && c.current && (a.current = null, s && t.persist(), L.current ? g == null || g(t, { context: r }) : c.current && (h == null || h(t, { context: r, reason: n ?? l.CancelledByRelease })), L.current = !1, c.current = !1, d.current !== void 0 && clearTimeout(d.current));\n },\n [s, g, h]\n ), E = P(\n (r) => (t) => {\n if (D(t) && (w == null || w(t, { context: r }), p !== !1 && a.current)) {\n const n = A(t);\n if (n) {\n const X = p === !0 ? 25 : p, Y = {\n x: Math.abs(n.x - a.current.x),\n y: Math.abs(n.y - a.current.y)\n };\n (Y.x > X || Y.y > X) && o(r)(t, l.CancelledByMovement);\n }\n }\n },\n [o, p, w]\n ), I = P(\n (r) => {\n if (e === null)\n return {};\n switch (R) {\n case f.Mouse: {\n const t = {\n onMouseDown: y(r),\n onMouseMove: E(r),\n onMouseUp: o(r)\n };\n return T && (t.onMouseLeave = (n) => {\n o(r)(n, l.CancelledOutsideElement);\n }), t;\n }\n case f.Touch:\n return {\n onTouchStart: y(r),\n onTouchMove: E(r),\n onTouchEnd: o(r)\n };\n case f.Pointer: {\n const t = {\n onPointerDown: y(r),\n onPointerMove: E(r),\n onPointerUp: o(r)\n };\n return T && (t.onPointerLeave = (n) => o(r)(n, l.CancelledOutsideElement)), t;\n }\n }\n },\n [e, o, T, R, E, y]\n );\n return C(() => {\n function r(t) {\n const n = N(t);\n o()(n);\n }\n return window.addEventListener(\"mouseup\", r), window.addEventListener(\"touchend\", r), window.addEventListener(\"pointerup\", r), () => {\n window.removeEventListener(\"mouseup\", r), window.removeEventListener(\"touchend\", r), window.removeEventListener(\"pointerup\", r);\n };\n }, [o]), C(\n () => () => {\n d.current !== void 0 && clearTimeout(d.current);\n },\n []\n ), C(() => {\n B.current = e;\n }, [e]), I;\n}\nexport {\n l as LongPressCallbackReason,\n f as LongPressEventType,\n V as useLongPress\n};\n","import { i18n } from '@lingui/core';\n\nimport localeMatch from './locale-match';\nimport mem from './mem';\n\nconst defaultLocale = mem(\n () => new Intl.DateTimeFormat().resolvedOptions().locale,\n);\n\nconst _DateTimeFormat = (opts) => {\n const { locale, dateYear, hideTime, formatOpts, forceOpts } = opts || {};\n const regionlessLocale = locale.replace(/-[a-z]+$/i, '');\n const loc = localeMatch([regionlessLocale], [defaultLocale], locale);\n const currentYear = new Date().getFullYear();\n const options = forceOpts || {\n // Show year if not current year\n year: dateYear === currentYear ? undefined : 'numeric',\n month: 'short',\n day: 'numeric',\n // Hide time if requested\n hour: hideTime ? undefined : 'numeric',\n minute: hideTime ? undefined : 'numeric',\n ...formatOpts,\n };\n try {\n return Intl.DateTimeFormat(loc, options);\n } catch (e) {}\n try {\n return Intl.DateTimeFormat(locale, options);\n } catch (e) {}\n return Intl.DateTimeFormat(undefined, options);\n};\nconst DateTimeFormat = mem(_DateTimeFormat);\n\nfunction niceDateTime(date, dtfOpts) {\n if (!(date instanceof Date)) {\n date = new Date(date);\n }\n const DTF = DateTimeFormat({\n dateYear: date.getFullYear(),\n locale: i18n.locale,\n ...dtfOpts,\n });\n const dateText = DTF.format(date);\n return dateText;\n}\n\nexport default niceDateTime;\n","import { t } from '@lingui/core/macro';\n\nexport default function openCompose(opts) {\n const url = URL.parse('/compose/', window.location);\n const { width: screenWidth, height: screenHeight } = window.screen;\n const left = Math.max(0, (screenWidth - 600) / 2);\n const top = Math.max(0, (screenHeight - 450) / 2);\n const width = Math.min(screenWidth, 600);\n const height = Math.min(screenHeight, 450);\n const winUID = opts?.uid || Math.random();\n const newWin = window.open(\n url,\n 'compose' + winUID,\n `width=${width},height=${height},left=${left},top=${top}`,\n );\n\n if (newWin) {\n // if (masto) {\n // newWin.masto = masto;\n // }\n\n newWin.__COMPOSE__ = opts;\n } else {\n alert(t`Looks like your browser is blocking popups.`);\n }\n\n return newWin;\n}\n","const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); // https://stackoverflow.com/a/23522755\n\nexport default function openOSK() {\n if (isSafari) {\n const fauxEl = document.createElement('input');\n fauxEl.style.position = 'absolute';\n fauxEl.style.top = '0';\n fauxEl.style.left = '0';\n fauxEl.style.opacity = '0';\n document.body.appendChild(fauxEl);\n fauxEl.focus();\n setTimeout(() => {\n document.body.removeChild(fauxEl);\n }, 500);\n }\n}\n","const root = document.documentElement;\nconst style = getComputedStyle(root);\nconst defaultBoundingBoxPadding = 8;\n\nlet safeAreaInsets = [0, 0, 0, 0];\nfunction getSafeAreaInsets() {\n // Get safe area inset variables from root\n const safeAreaInsetTop = style.getPropertyValue('--sai-top');\n const safeAreaInsetRight = style.getPropertyValue('--sai-right');\n const safeAreaInsetBottom = style.getPropertyValue('--sai-bottom');\n const safeAreaInsetLeft = style.getPropertyValue('--sai-left');\n safeAreaInsets = [\n // top, right, bottom, left (clockwise)\n Math.max(0, parseInt(safeAreaInsetTop, 10)),\n Math.max(0, parseInt(safeAreaInsetRight, 10)),\n Math.max(0, parseInt(safeAreaInsetBottom, 10)),\n Math.max(0, parseInt(safeAreaInsetLeft, 10)),\n ];\n}\nrequestAnimationFrame(getSafeAreaInsets);\n\nfunction safeBoundingBoxPadding(paddings = []) {\n const str = safeAreaInsets\n .map((v, i) => (v || defaultBoundingBoxPadding) + (paddings[i] || 0))\n .join(' ');\n // console.log(str);\n return str;\n}\n\n// Update safe area insets when orientation or resize\nif (CSS.supports('top: env(safe-area-inset-top)')) {\n window.addEventListener('resize', getSafeAreaInsets, { passive: true });\n}\n\nexport default safeBoundingBoxPadding;\n","import { t } from '@lingui/core/macro';\n\nimport openOSK from './open-osk';\nimport showToast from './show-toast';\nimport states from './states';\n\nconst TOAST_DURATION = 5_000; // 5 seconds\n\nexport default function showCompose(opts) {\n if (!opts) opts = true;\n\n if (states.showCompose) {\n if (states.composerState.minimized) {\n showToast({\n duration: TOAST_DURATION,\n text: t`A draft post is currently minimized. Post or discard it before creating a new one.`,\n });\n } else {\n showToast({\n duration: TOAST_DURATION,\n text: t`A post is currently open. Post or discard it before creating a new one.`,\n });\n }\n return;\n }\n\n openOSK();\n states.showCompose = opts;\n}\n","import mem from './mem';\n\nconst div = document.createElement('div');\nfunction getHTMLText(html, opts) {\n if (!html) return '';\n const { preProcess } = opts || {};\n\n div.innerHTML = html\n .replace(/<\\/p>/g, '</p>\\n\\n')\n .replace(/<\\/li>/g, '</li>\\n');\n div.querySelectorAll('br').forEach((br) => {\n br.replaceWith('\\n');\n });\n\n preProcess?.(div);\n\n // MASTODON-SPECIFIC classes\n // Remove .invisible\n div.querySelectorAll('.invisible').forEach((el) => {\n el.remove();\n });\n // Add … at end of .ellipsis\n div.querySelectorAll('.ellipsis').forEach((el) => {\n el.append('...');\n });\n\n return div.innerText.replace(/[\\r\\n]{3,}/g, '\\n\\n').trim();\n}\n\nexport default mem(getHTMLText);\n","import getHTMLText from './getHTMLText';\n\nfunction statusPeek(status) {\n const { spoilerText, content, poll, mediaAttachments } = status;\n let text = '';\n if (spoilerText?.trim()) {\n text += spoilerText;\n } else {\n text += getHTMLText(content);\n }\n text = text.trim();\n if (poll?.options?.length) {\n text += `\\n\\n📊:\\n${poll.options\n .map((o) => `${poll.multiple ? '▪️' : '•'} ${o.title}`)\n .join('\\n')}`;\n }\n if (mediaAttachments?.length) {\n text +=\n ' ' +\n mediaAttachments\n .map(\n (m) =>\n ({\n image: '🖼️',\n gifv: '🎞️',\n video: '📹',\n audio: '🎵',\n unknown: '',\n })[m.type] || '',\n )\n .join('');\n }\n return text;\n}\n\nexport default statusPeek;\n","export const ICONS = {\n x: () => import('@iconify-icons/mingcute/close-line'),\n heart: () => import('@iconify-icons/mingcute/heart-line'),\n bookmark: () => import('@iconify-icons/mingcute/bookmark-line'),\n 'check-circle': () => import('@iconify-icons/mingcute/check-circle-line'),\n 'x-circle': () => import('@iconify-icons/mingcute/close-circle-line'),\n transfer: () => import('@iconify-icons/mingcute/transfer-4-line'),\n rocket: () => import('@iconify-icons/mingcute/rocket-line'),\n 'arrow-left': {\n module: () => import('@iconify-icons/mingcute/arrow-left-line'),\n rtl: true,\n },\n 'arrow-right': {\n module: () => import('@iconify-icons/mingcute/arrow-right-line'),\n rtl: true,\n },\n 'arrow-up': () => import('@iconify-icons/mingcute/arrow-up-line'),\n 'arrow-down': () => import('@iconify-icons/mingcute/arrow-down-line'),\n earth: () => import('@iconify-icons/mingcute/earth-line'),\n lock: () => import('@iconify-icons/mingcute/lock-line'),\n unlock: () => import('@iconify-icons/mingcute/unlock-line'),\n 'eye-close': () => import('@iconify-icons/mingcute/eye-close-line'),\n 'eye-open': () => import('@iconify-icons/mingcute/eye-2-line'),\n message: () => import('@iconify-icons/mingcute/mail-line'),\n comment: {\n module: () => import('@iconify-icons/mingcute/chat-3-line'),\n rtl: true,\n },\n comment2: {\n module: () => import('@iconify-icons/mingcute/comment-2-line'),\n rtl: true,\n },\n home: () => import('@iconify-icons/mingcute/home-3-line'),\n notification: () => import('@iconify-icons/mingcute/notification-line'),\n follow: () => import('@iconify-icons/mingcute/user-follow-line'),\n 'follow-add': () => import('@iconify-icons/mingcute/user-add-line'),\n poll: [() => import('@iconify-icons/mingcute/chart-bar-line'), '90deg'],\n pencil: () => import('@iconify-icons/mingcute/pencil-line'),\n quill: () => import('@iconify-icons/mingcute/quill-pen-line'),\n at: () => import('@iconify-icons/mingcute/at-line'),\n attachment: () => import('@iconify-icons/mingcute/attachment-line'),\n upload: () => import('@iconify-icons/mingcute/upload-3-line'),\n gear: () => import('@iconify-icons/mingcute/settings-3-line'),\n more: () => import('@iconify-icons/mingcute/more-3-line'),\n more2: () => import('@iconify-icons/mingcute/more-1-fill'),\n external: {\n module: () => import('@iconify-icons/mingcute/external-link-line'),\n rtl: true,\n },\n popout: {\n module: () => import('@iconify-icons/mingcute/external-link-line'),\n rtl: true,\n },\n popin: {\n module: () => import('@iconify-icons/mingcute/external-link-line'),\n rotate: '180deg',\n rtl: true,\n },\n plus: () => import('@iconify-icons/mingcute/add-circle-line'),\n 'chevron-left': {\n module: () => import('@iconify-icons/mingcute/left-line'),\n rtl: true,\n },\n 'chevron-right': {\n module: () => import('@iconify-icons/mingcute/right-line'),\n rtl: true,\n },\n 'chevron-down': () => import('@iconify-icons/mingcute/down-line'),\n reply: {\n module: () => import('@iconify-icons/mingcute/share-forward-line'),\n rotate: '180deg',\n flip: 'horizontal',\n rtl: true,\n },\n thread: () => import('@iconify-icons/mingcute/route-line'),\n group: {\n module: () => import('@iconify-icons/mingcute/group-line'),\n rtl: true,\n },\n bot: () => import('@iconify-icons/mingcute/android-2-line'),\n menu: () => import('@iconify-icons/mingcute/rows-4-line'),\n list: {\n module: () => import('@iconify-icons/mingcute/list-check-line'),\n rtl: true,\n },\n search: () => import('@iconify-icons/mingcute/search-2-line'),\n hashtag: () => import('@iconify-icons/mingcute/hashtag-line'),\n info: () => import('@iconify-icons/mingcute/information-line'),\n shortcut: () => import('@iconify-icons/mingcute/lightning-line'),\n user: () => import('@iconify-icons/mingcute/user-4-line'),\n following: () => import('@iconify-icons/mingcute/walk-line'),\n pin: () => import('@iconify-icons/mingcute/pin-line'),\n unpin: [() => import('@iconify-icons/mingcute/pin-line'), '180deg'],\n bus: () => import('@iconify-icons/mingcute/bus-2-line'),\n link: () => import('@iconify-icons/mingcute/link-2-line'),\n history: () => import('@iconify-icons/mingcute/history-line'),\n share: () => import('@iconify-icons/mingcute/share-2-line'),\n sparkles: () => import('@iconify-icons/mingcute/sparkles-line'),\n sparkles2: () => import('@iconify-icons/mingcute/sparkles-2-line'),\n exit: {\n module: () => import('@iconify-icons/mingcute/exit-line'),\n rtl: true,\n },\n translate: () => import('@iconify-icons/mingcute/translate-line'),\n play: () => import('@iconify-icons/mingcute/play-fill'),\n trash: () => import('@iconify-icons/mingcute/delete-2-line'),\n mute: {\n module: () => import('@iconify-icons/mingcute/volume-mute-line'),\n rtl: true,\n },\n unmute: {\n module: () => import('@iconify-icons/mingcute/volume-line'),\n rtl: true,\n },\n block: () => import('@iconify-icons/mingcute/forbid-circle-line'),\n unblock: [\n () => import('@iconify-icons/mingcute/forbid-circle-line'),\n '180deg',\n ],\n flag: () => import('@iconify-icons/mingcute/flag-1-line'),\n time: () => import('@iconify-icons/mingcute/time-line'),\n refresh: () => import('@iconify-icons/mingcute/refresh-2-line'),\n emoji2: () => import('@iconify-icons/mingcute/emoji-2-line'),\n filter: () => import('@iconify-icons/mingcute/filter-2-line'),\n filters: () => import('@iconify-icons/mingcute/filter-line'),\n chart: () => import('@iconify-icons/mingcute/chart-line-line'),\n react: () => import('@iconify-icons/mingcute/react-line'),\n layout4: {\n module: () => import('@iconify-icons/mingcute/layout-4-line'),\n rtl: true,\n },\n layout5: () => import('@iconify-icons/mingcute/layout-5-line'),\n announce: {\n module: () => import('@iconify-icons/mingcute/announcement-line'),\n rtl: true,\n },\n alert: () => import('@iconify-icons/mingcute/alert-line'),\n round: () => import('@iconify-icons/mingcute/round-fill'),\n 'arrow-up-circle': () =>\n import('@iconify-icons/mingcute/arrow-up-circle-line'),\n 'arrow-down-circle': () =>\n import('@iconify-icons/mingcute/arrow-down-circle-line'),\n clipboard: {\n module: () => import('@iconify-icons/mingcute/clipboard-line'),\n rtl: true,\n },\n 'account-edit': () => import('@iconify-icons/mingcute/user-edit-line'),\n 'account-warning': () => import('@iconify-icons/mingcute/user-warning-line'),\n keyboard: () => import('@iconify-icons/mingcute/keyboard-line'),\n cloud: () => import('@iconify-icons/mingcute/cloud-line'),\n month: {\n module: () => import('@iconify-icons/mingcute/calendar-month-line'),\n rtl: true,\n },\n media: () => import('@iconify-icons/mingcute/photo-album-line'),\n speak: () => import('@iconify-icons/mingcute/radar-line'),\n building: () => import('@iconify-icons/mingcute/building-5-line'),\n history2: {\n module: () => import('@iconify-icons/mingcute/history-2-line'),\n rtl: true,\n },\n document: () => import('@iconify-icons/mingcute/document-line'),\n 'arrows-right': {\n module: () => import('@iconify-icons/mingcute/arrows-right-line'),\n rtl: true,\n },\n code: () => import('@iconify-icons/mingcute/code-line'),\n copy: () => import('@iconify-icons/mingcute/copy-2-line'),\n quote: {\n module: () => import('@iconify-icons/mingcute/quote-left-line'),\n rtl: true,\n },\n settings: () => import('@iconify-icons/mingcute/settings-6-line'),\n 'heart-break': () => import('@iconify-icons/mingcute/heart-crack-line'),\n 'user-x': () => import('@iconify-icons/mingcute/user-x-line'),\n minimize: () => import('@iconify-icons/mingcute/arrows-down-line'),\n celebrate: () => import('@iconify-icons/mingcute/celebrate-line'),\n schedule: () => import('@iconify-icons/mingcute/calendar-time-add-line'),\n month: () => import('@iconify-icons/mingcute/calendar-month-line'),\n day: () => import('@iconify-icons/mingcute/calendar-day-line'),\n camera: () => import('@iconify-icons/mingcute/camera-line'),\n};\n","import moize from 'moize';\nimport { useEffect, useRef, useState } from 'preact/hooks';\n\nimport { ICONS } from './ICONS';\n\nconst SIZES = {\n s: 12,\n m: 16,\n l: 20,\n xl: 24,\n xxl: 32,\n};\n\nconst ICONDATA = {};\n\n// Memoize the dangerouslySetInnerHTML of the SVGs\nconst SVGICon = moize(\n function ({ width, height, body, rotate, flip }) {\n return (\n <svg\n viewBox={`0 0 ${width} ${height}`}\n dangerouslySetInnerHTML={{ __html: body }}\n style={{\n transform: `${rotate ? `rotate(${rotate})` : ''} ${\n flip ? `scaleX(-1)` : ''\n }`,\n }}\n />\n );\n },\n {\n isShallowEqual: true,\n maxSize: Object.keys(ICONS).length,\n matchesArg: (cacheKeyArg, keyArg) =>\n cacheKeyArg.icon === keyArg.icon && cacheKeyArg.body === keyArg.body,\n },\n);\n\nfunction Icon({\n icon,\n size = 'm',\n alt,\n title,\n class: className = '',\n style = {},\n}) {\n if (!icon) return null;\n\n const iconSize = SIZES[size];\n let iconBlock = ICONS[icon];\n if (!iconBlock) {\n console.warn(`Icon ${icon} not found`);\n return null;\n }\n\n let rotate,\n flip,\n rtl = false;\n if (Array.isArray(iconBlock)) {\n [iconBlock, rotate, flip] = iconBlock;\n } else if (typeof iconBlock === 'object') {\n ({ rotate, flip, rtl } = iconBlock);\n iconBlock = iconBlock.module;\n }\n\n const [iconData, setIconData] = useState(ICONDATA[icon]);\n const currentIcon = useRef(icon);\n useEffect(() => {\n if (iconData && currentIcon.current === icon) return;\n (async () => {\n const iconB = await iconBlock();\n setIconData(iconB.default);\n ICONDATA[icon] = iconB.default;\n })();\n currentIcon.current = icon;\n }, [icon]);\n\n return (\n <span\n class={`icon ${className} ${rtl ? 'rtl-flip' : ''}`}\n title={title || alt}\n style={{\n width: `${iconSize}px`,\n height: `${iconSize}px`,\n ...style,\n }}\n data-icon={icon}\n >\n {iconData && (\n // <svg\n // width={iconSize}\n // height={iconSize}\n // viewBox={`0 0 ${iconData.width} ${iconData.height}`}\n // dangerouslySetInnerHTML={{ __html: iconData.body }}\n // style={{\n // transform: `${rotate ? `rotate(${rotate})` : ''} ${\n // flip ? `scaleX(-1)` : ''\n // }`,\n // }}\n // />\n <SVGICon\n icon={icon}\n width={iconData.width}\n height={iconData.height}\n body={iconData.body}\n rotate={rotate}\n flip={flip}\n />\n )}\n </span>\n );\n}\n\nexport default Icon;\n","import { forwardRef } from 'preact/compat';\nimport { useLocation } from 'react-router-dom';\n\nimport states from '../utils/states';\n\n/* NOTES\n =====\n Initially this uses <NavLink> from react-router-dom, but it doesn't work:\n 1. It interferes with nested <a> inside <a> and it's difficult to preventDefault/stopPropagation from the nested <a>\n 2. isActive doesn't work properly with the weird routes that's set up in this app, due to the faux \"location\" to make the modals work and prevent unmounting\n 3. Not using <Link state/> because it modifies history.state that *persists* across page reloads. I don't need that, so using valtio's states instead.\n*/\n\nconst Link = forwardRef((props, ref) => {\n let routerLocation;\n try {\n routerLocation = useLocation();\n } catch (e) {}\n let hash = (location.hash || '').replace(/^#/, '').trim();\n if (hash === '') hash = '/';\n const { to, ...restProps } = props;\n\n // Handle encodeURIComponent of searchParams values\n if (!!hash && hash !== '/' && hash.includes('?')) {\n const parsedHash = URL.parse(hash, location.origin); // Fake base URL\n if (parsedHash?.searchParams?.size) {\n const searchParamsStr = Array.from(parsedHash.searchParams.entries())\n .map(([key, value]) => `${key}=${encodeURIComponent(value)}`)\n .join('&');\n hash = parsedHash.pathname + '?' + searchParamsStr;\n }\n }\n\n const isActive = hash === to || decodeURIComponent(hash) === to;\n return (\n <a\n ref={ref}\n href={`#${to}`}\n {...restProps}\n class={`${props.class || ''} ${isActive ? 'is-active' : ''}`}\n onClick={(e) => {\n if (e.currentTarget?.parentNode?.closest('a')) {\n // If this <a> is nested inside another <a>\n e.stopPropagation();\n }\n if (routerLocation) states.prevLocation = routerLocation;\n props.onClick?.(e);\n }}\n />\n );\n});\n\nexport default Link;\n","import { FocusableItem } from '@szhsin/react-menu';\n\nimport Link from './link';\n\nfunction MenuLink(props) {\n const { className, disabled, ...restProps } = props;\n return (\n <FocusableItem className={className} disabled={disabled}>\n {({ ref, closeMenu }) => (\n <Link\n {...restProps}\n ref={ref}\n onClick={({ detail }) =>\n closeMenu(detail === 0 ? 'Enter' : undefined)\n }\n />\n )}\n </FocusableItem>\n );\n}\n\nexport default MenuLink;\n","import { i18n } from '@lingui/core';\nimport { t } from '@lingui/core/macro';\nimport { useEffect, useMemo, useReducer } from 'preact/hooks';\n\nimport localeMatch from '../utils/locale-match';\nimport mem from '../utils/mem';\n\nfunction isValidDate(value) {\n if (value instanceof Date) {\n return !isNaN(value.getTime());\n } else {\n const date = new Date(value);\n return !isNaN(date.getTime());\n }\n}\n\nconst resolvedLocale = mem(\n () => new Intl.DateTimeFormat().resolvedOptions().locale,\n);\nconst DTF = mem((locale, opts = {}) => {\n const regionlessLocale = locale.replace(/-[a-z]+$/i, '');\n const lang = localeMatch([regionlessLocale], [resolvedLocale()], locale);\n try {\n return new Intl.DateTimeFormat(lang, opts);\n } catch (e) {}\n try {\n return new Intl.DateTimeFormat(locale, opts);\n } catch (e) {}\n return new Intl.DateTimeFormat(undefined, opts);\n});\nconst RTF = mem((locale) => new Intl.RelativeTimeFormat(locale || undefined));\n\nconst minute = 60;\nconst hour = 60 * minute;\nconst day = 24 * hour;\n\nconst rtfFromNow = (date) => {\n // date = Date object\n const rtf = RTF(i18n.locale);\n const seconds = (date.getTime() - Date.now()) / 1000;\n const absSeconds = Math.abs(seconds);\n if (absSeconds < minute) {\n return rtf.format(Math.floor(seconds), 'second');\n } else if (absSeconds < hour) {\n return rtf.format(Math.floor(seconds / minute), 'minute');\n } else if (absSeconds < day) {\n return rtf.format(Math.floor(seconds / hour), 'hour');\n } else if (absSeconds < 30 * day) {\n return rtf.format(Math.floor(seconds / day), 'day');\n } else {\n return rtf.format(Math.floor(seconds / day / 30), 'month');\n }\n};\n\nconst twitterFromNow = (date) => {\n // date = Date object\n const seconds = (Date.now() - date.getTime()) / 1000;\n if (seconds < minute) {\n return t({\n comment: 'Relative time in seconds, as short as possible',\n message: `${seconds < 1 ? 1 : Math.floor(seconds)}s`,\n });\n } else if (seconds < hour) {\n return t({\n comment: 'Relative time in minutes, as short as possible',\n message: `${Math.floor(seconds / minute)}m`,\n });\n } else {\n return t({\n comment: 'Relative time in hours, as short as possible',\n message: `${Math.floor(seconds / hour)}h`,\n });\n }\n};\n\nexport default function RelativeTime({ datetime, format }) {\n if (!datetime) return null;\n const [renderCount, rerender] = useReducer((x) => x + 1, 0);\n const date = useMemo(() => new Date(datetime), [datetime]);\n const [dateStr, dt, title] = useMemo(() => {\n if (!isValidDate(date))\n return ['' + (typeof datetime === 'string' ? datetime : ''), '', ''];\n let str;\n if (format === 'micro') {\n // If date <= 1 day ago or day is within this year\n const now = new Date();\n const dayDiff = (now.getTime() - date.getTime()) / 1000 / day;\n if (dayDiff <= 1) {\n str = twitterFromNow(date);\n } else {\n const sameYear = now.getFullYear() === date.getFullYear();\n if (sameYear) {\n str = DTF(i18n.locale, {\n year: undefined,\n month: 'short',\n day: 'numeric',\n }).format(date);\n } else {\n str = DTF(i18n.locale, {\n dateStyle: 'short',\n }).format(date);\n }\n }\n }\n if (!str) str = rtfFromNow(date);\n return [str, date.toISOString(), date.toLocaleString()];\n }, [date, format, renderCount]);\n\n useEffect(() => {\n if (!isValidDate(date)) return;\n let timeout;\n let raf;\n function rafRerender() {\n raf = requestAnimationFrame(() => {\n rerender();\n scheduleRerender();\n });\n }\n function scheduleRerender() {\n // If less than 1 minute, rerender every 10s\n // If less than 1 hour rerender every 1m\n // Else, don't need to rerender\n const seconds = (Date.now() - date.getTime()) / 1000;\n if (seconds < minute) {\n timeout = setTimeout(rafRerender, 10_000);\n } else if (seconds < hour) {\n timeout = setTimeout(rafRerender, 60_000);\n }\n }\n scheduleRerender();\n return () => {\n clearTimeout(timeout);\n cancelAnimationFrame(raf);\n };\n }, []);\n\n return (\n <time datetime={dt} title={title}>\n {dateStr}\n </time>\n );\n}\n","import { SubMenu } from '@szhsin/react-menu';\nimport { useRef } from 'preact/hooks';\n\nexport default function SubMenu2(props) {\n const menuRef = useRef();\n return (\n <SubMenu\n {...props}\n instanceRef={menuRef}\n // Test fix for bug; submenus not opening on Android\n itemProps={{\n onPointerMove: (e) => {\n if (e.pointerType === 'touch') {\n menuRef.current?.openMenu?.();\n }\n },\n onPointerLeave: (e) => {\n if (e.pointerType === 'touch') {\n menuRef.current?.openMenu?.();\n }\n },\n ...props.itemProps,\n }}\n />\n );\n}\n","import { useEffect } from 'preact/hooks';\n\n// NOTE: The order of initialized close watchers is important\n// Last one will intercept first if there are multiple/nested close watchers\n// So if this hook reruns, the previous close watcher will be destroyed, the new one will be created and the order will change\nfunction useCloseWatcher(fn, deps = []) {\n if (!fn || typeof fn !== 'function') return;\n useEffect(() => {\n console.log('useCloseWatcher');\n const watcher = new CloseWatcher();\n watcher.addEventListener('close', fn);\n return () => {\n watcher.destroy();\n };\n }, deps);\n}\n\nexport default window.CloseWatcher ? useCloseWatcher : () => {};\n","import './modal.css';\n\nimport { createPortal } from 'preact/compat';\nimport { useEffect, useLayoutEffect, useRef } from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\n\nimport store from '../utils/store';\nimport useCloseWatcher from '../utils/useCloseWatcher';\n\nconst $modalContainer = document.getElementById('modal-container');\n\nfunction getBackdropThemeColor() {\n return getComputedStyle(document.documentElement).getPropertyValue(\n '--backdrop-theme-color',\n );\n}\n\nfunction Modal({ children, onClose, onClick, class: className, minimized }) {\n if (!children) return null;\n\n const modalRef = useRef();\n useEffect(() => {\n let timer = setTimeout(() => {\n const focusElement = modalRef.current?.querySelector('[tabindex=\"-1\"]');\n if (focusElement) {\n focusElement.focus();\n }\n }, 100);\n return () => clearTimeout(timer);\n }, []);\n\n const supportsCloseWatcher = window.CloseWatcher;\n const escRef = useHotkeys(\n 'esc',\n () => {\n setTimeout(() => {\n onClose?.();\n }, 0);\n },\n {\n enabled: !supportsCloseWatcher && !!onClose,\n // Using keyup and setTimeout above\n // This will run \"later\" to prevent clash with esc handlers from other components\n keydown: false,\n keyup: true,\n },\n [onClose],\n );\n useCloseWatcher(onClose, [onClose]);\n\n useEffect(() => {\n const $deckContainers = document.querySelectorAll('.deck-container');\n if (minimized) {\n // Similar to focusDeck in focus-deck.jsx\n // Focus last deck\n const page = $deckContainers[$deckContainers.length - 1]; // last one\n if (page && page.tabIndex === -1) {\n page.focus();\n }\n } else {\n if (children) {\n $deckContainers.forEach(($deckContainer) => {\n $deckContainer.setAttribute('inert', '');\n });\n } else {\n $deckContainers.forEach(($deckContainer) => {\n $deckContainer.removeAttribute('inert');\n });\n }\n }\n return () => {\n $deckContainers.forEach(($deckContainer) => {\n $deckContainer.removeAttribute('inert');\n });\n };\n }, [children, minimized]);\n\n const $meta = useRef();\n const metaColor = useRef();\n useLayoutEffect(() => {\n if (children && !minimized) {\n const theme = store.local.get('theme');\n if (theme) {\n const backdropColor = getBackdropThemeColor();\n console.log({ backdropColor });\n $meta.current = document.querySelector(\n `meta[name=\"theme-color\"][data-theme-setting=\"manual\"]`,\n );\n if ($meta.current) {\n metaColor.current = $meta.current.content;\n $meta.current.content = backdropColor;\n }\n } else {\n const colorScheme = window.matchMedia('(prefers-color-scheme: dark)')\n .matches\n ? 'dark'\n : 'light';\n const backdropColor = getBackdropThemeColor();\n console.log({ backdropColor });\n $meta.current = document.querySelector(\n `meta[name=\"theme-color\"][media*=\"${colorScheme}\"]`,\n );\n if ($meta.current) {\n metaColor.current = $meta.current.content;\n $meta.current.content = backdropColor;\n }\n }\n } else {\n // Reset meta color\n if ($meta.current && metaColor.current) {\n $meta.current.content = metaColor.current;\n }\n }\n return () => {\n // Reset meta color\n if ($meta.current && metaColor.current) {\n $meta.current.content = metaColor.current;\n }\n };\n }, [children, minimized]);\n\n const Modal = (\n <div\n ref={(node) => {\n modalRef.current = node;\n escRef.current = node?.querySelector?.('[tabindex=\"-1\"]') || node;\n }}\n className={className}\n onClick={(e) => {\n onClick?.(e);\n if (e.target === e.currentTarget) {\n onClose?.(e);\n }\n }}\n tabIndex={minimized ? 0 : '-1'}\n inert={minimized}\n onFocus={(e) => {\n try {\n if (e.target === e.currentTarget) {\n const focusElement =\n modalRef.current?.querySelector('[tabindex=\"-1\"]');\n const isFocusable =\n !!focusElement &&\n getComputedStyle(focusElement)?.pointerEvents !== 'none';\n if (focusElement && isFocusable) {\n focusElement.focus();\n }\n }\n } catch (err) {\n console.error(err);\n }\n }}\n >\n {children}\n </div>\n );\n\n return createPortal(Modal, $modalContainer);\n\n // return createPortal(children, $modalContainer);\n}\n\nexport default Modal;\n","import './avatar.css';\n\nimport { useRef } from 'preact/hooks';\n\nimport mem from '../utils/mem';\n\nconst SIZES = {\n s: 16,\n m: 20,\n l: 24,\n xl: 32,\n xxl: 50,\n xxxl: 64,\n};\n\nconst alphaCache = {};\n\nconst canvas = window.OffscreenCanvas\n ? new OffscreenCanvas(1, 1)\n : document.createElement('canvas');\nconst ctx = canvas.getContext('2d', {\n willReadFrequently: true,\n});\nctx.imageSmoothingEnabled = false;\n\nconst MISSING_IMAGE_PATH_REGEX = /missing\\.png$/;\n\nfunction Avatar({ url, staticUrl, size, alt = '', squircle, ...props }) {\n size = SIZES[size] || size || SIZES.m;\n const avatarRef = useRef();\n const isMissing = MISSING_IMAGE_PATH_REGEX.test(url);\n return (\n <picture\n ref={avatarRef}\n class={`avatar ${squircle ? 'squircle' : ''} ${\n alphaCache[url] ? 'has-alpha' : ''\n }`}\n style={{\n width: size,\n height: size,\n }}\n title={alt}\n {...props}\n >\n {!!staticUrl && (\n <source srcset={staticUrl} media=\"(prefers-reduced-motion: reduce)\" />\n )}\n {!!url && (\n <img\n src={url}\n width={size}\n height={size}\n alt={alt}\n loading=\"lazy\"\n decoding=\"async\"\n fetchPriority=\"low\"\n crossOrigin={\n alphaCache[url] === undefined && !isMissing\n ? 'anonymous'\n : undefined\n }\n onError={(e) => {\n if (e.target.crossOrigin) {\n e.target.crossOrigin = null;\n e.target.src = url;\n }\n }}\n onLoad={(e) => {\n if (avatarRef.current) avatarRef.current.dataset.loaded = true;\n if (alphaCache[url] !== undefined) return;\n if (isMissing) return;\n setTimeout(() => {\n try {\n // Check if image has alpha channel\n const { width, height } = e.target;\n if (canvas.width !== width) canvas.width = width;\n if (canvas.height !== height) canvas.height = height;\n ctx.drawImage(e.target, 0, 0);\n const allPixels = ctx.getImageData(0, 0, width, height);\n // At least 10% of pixels have alpha <= 128\n const hasAlpha =\n allPixels.data.filter(\n (pixel, i) => i % 4 === 3 && pixel <= 128,\n ).length /\n (allPixels.data.length / 4) >\n 0.1;\n if (hasAlpha) {\n // console.log('hasAlpha', hasAlpha, allPixels.data);\n avatarRef.current.classList.add('has-alpha');\n }\n alphaCache[url] = hasAlpha;\n ctx.clearRect(0, 0, width, height);\n } catch (e) {\n // Silent fail\n alphaCache[url] = false;\n }\n }, 1);\n }}\n />\n )}\n </picture>\n );\n}\n\nexport default mem(Avatar);\n","let IS_RTL = false;\n\n// Use MutationObserver to detect RTL\nconst observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.type === 'attributes') {\n const { dir } = mutation.target;\n if (dir === 'rtl') {\n IS_RTL = true;\n } else {\n IS_RTL = false;\n }\n console.log({ IS_RTL });\n // Fire custom event 'dirchange' on document\n // document.dispatchEvent(new Event('dirchange'));\n }\n });\n});\nobserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['dir'],\n});\n\nexport default function isRTL() {\n return IS_RTL;\n // return document.documentElement.dir === 'rtl';\n}\n","import { useLayoutEffect, useState } from 'preact/hooks';\n\nexport default function useWindowSize() {\n const [size, setSize] = useState({\n width: null,\n height: null,\n });\n\n useLayoutEffect(() => {\n const handleResize = () => {\n setSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n };\n\n handleResize();\n window.addEventListener('resize', handleResize, {\n passive: true,\n });\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, []);\n\n return size;\n}\n","import { Menu } from '@szhsin/react-menu';\nimport { useRef } from 'preact/hooks';\n\nimport isRTL from '../utils/is-rtl';\nimport safeBoundingBoxPadding from '../utils/safe-bounding-box-padding';\nimport useWindowSize from '../utils/useWindowSize';\n\n// It's like Menu but with sensible defaults, bug fixes and improvements.\nfunction Menu2(props) {\n const { containerProps, instanceRef: _instanceRef, align } = props;\n const size = useWindowSize();\n const instanceRef = _instanceRef?.current ? _instanceRef : useRef();\n\n // Values: start, end, center\n // Note: don't mess with 'center'\n const rtlAlign = isRTL()\n ? align === 'end'\n ? 'start'\n : align === 'start'\n ? 'end'\n : align\n : align;\n\n return (\n <Menu\n boundingBoxPadding={safeBoundingBoxPadding()}\n repositionFlag={`${size.width}x${size.height}`}\n unmountOnClose\n {...props}\n align={rtlAlign}\n instanceRef={instanceRef}\n containerProps={{\n onClick: (e) => {\n if (e.target === e.currentTarget) {\n instanceRef.current?.closeMenu?.();\n }\n containerProps?.onClick?.(e);\n },\n ...containerProps,\n }}\n />\n );\n}\n\nexport default Menu2;\n","import { MenuItem } from '@szhsin/react-menu';\nimport { cloneElement } from 'preact';\n\nimport Menu2 from './menu2';\nimport SubMenu2 from './submenu2';\n\nfunction MenuConfirm({\n subMenu = false,\n confirm = true,\n confirmLabel,\n menuItemClassName,\n menuFooter,\n menuExtras,\n ...props\n}) {\n const { children, onClick, ...restProps } = props;\n if (!confirm) {\n if (subMenu) return <MenuItem {...props} />;\n if (onClick) {\n return cloneElement(children, {\n onClick,\n });\n }\n return children;\n }\n const Parent = subMenu ? SubMenu2 : Menu2;\n return (\n <Parent\n openTrigger=\"clickOnly\"\n direction=\"bottom\"\n overflow=\"auto\"\n gap={-8}\n shift={8}\n menuClassName=\"menu-emphasized\"\n {...restProps}\n menuButton={subMenu ? undefined : children}\n label={subMenu ? children : undefined}\n >\n <MenuItem className={menuItemClassName} onClick={onClick}>\n {confirmLabel}\n </MenuItem>\n {menuExtras}\n {menuFooter}\n </Parent>\n );\n}\n\nexport default MenuConfirm;\n","export default function CustomEmoji({ staticUrl, alt, url }) {\n return (\n <picture>\n {staticUrl && (\n <source srcset={staticUrl} media=\"(prefers-reduced-motion: reduce)\" />\n )}\n <img\n key={alt || url}\n src={url}\n alt={alt}\n class=\"shortcode-emoji emoji\"\n width=\"16\"\n height=\"16\"\n loading=\"lazy\"\n decoding=\"async\"\n fetchPriority=\"low\"\n />\n </picture>\n );\n}\n","import { memo } from 'preact/compat';\n\nimport mem from '../utils/mem';\n\nimport CustomEmoji from './custom-emoji';\n\nconst shortcodesRegexp = mem((shortcodes) => {\n return new RegExp(`:(${shortcodes.join('|')}):`, 'g');\n});\n\nfunction EmojiText({ text, emojis }) {\n if (!text) return '';\n if (!emojis?.length) return text;\n if (text.indexOf(':') === -1) return text;\n // const regex = new RegExp(\n // `:(${emojis.map((e) => e.shortcode).join('|')}):`,\n // 'g',\n // );\n const regex = shortcodesRegexp(emojis.map((e) => e.shortcode));\n const elements = text.split(regex).map((word, i) => {\n const emoji = emojis.find((e) => e.shortcode === word);\n if (emoji) {\n const { url, staticUrl } = emoji;\n return (\n <CustomEmoji\n staticUrl={staticUrl}\n alt={word}\n url={url}\n key={word + '-' + i} // Handle >= 2 same shortcodes\n />\n );\n }\n return word;\n });\n return elements;\n}\n\nexport default mem(EmojiText);\n\n// export default memo(\n// EmojiText,\n// (oldProps, newProps) =>\n// oldProps.text === newProps.text &&\n// oldProps.emojis?.length === newProps.emojis?.length,\n// );\n","import './name-text.css';\n\nimport { useLingui } from '@lingui/react';\nimport { memo } from 'preact/compat';\n\nimport { api } from '../utils/api';\nimport mem from '../utils/mem';\nimport states from '../utils/states';\n\nimport Avatar from './avatar';\nimport EmojiText from './emoji-text';\n\nconst nameCollator = mem((locale) => {\n const options = {\n sensitivity: 'base',\n };\n try {\n return new Intl.Collator(locale || undefined, options);\n } catch (e) {\n return new Intl.Collator(undefined, options);\n }\n});\n\nconst ACCT_REGEX = /([^@]+)(@.+)/i;\nconst SHORTCODES_REGEX = /(\\:(\\w|\\+|\\-)+\\:)(?=|[\\!\\.\\?]|$)/g;\nconst SPACES_REGEX = /\\s+/g;\nconst NON_ALPHA_NUMERIC_REGEX = /[^a-z0-9@\\.]/gi;\n\nfunction NameText({\n account,\n instance,\n showAvatar,\n showAcct,\n short,\n external,\n onClick,\n}) {\n const { i18n } = useLingui();\n if (!account) return null;\n const {\n acct,\n avatar,\n avatarStatic,\n id,\n url,\n displayName,\n emojis,\n bot,\n username,\n } = account;\n const [_, acct1, acct2] = acct.match(ACCT_REGEX) || [, acct];\n\n if (!instance) instance = api().instance;\n\n const trimmedUsername = username.toLowerCase().trim();\n const trimmedDisplayName = (displayName || '').toLowerCase().trim();\n const shortenedDisplayName = trimmedDisplayName\n .replace(SHORTCODES_REGEX, '') // Remove shortcodes, regex from https://regex101.com/r/iE9uV0/1\n .replace(SPACES_REGEX, ''); // E.g. \"My name\" === \"myname\"\n const shortenedAlphaNumericDisplayName = shortenedDisplayName.replace(\n NON_ALPHA_NUMERIC_REGEX,\n '',\n ); // Remove non-alphanumeric characters\n\n const hideUsername =\n (!short &&\n (trimmedUsername === trimmedDisplayName ||\n trimmedUsername === shortenedDisplayName ||\n trimmedUsername === shortenedAlphaNumericDisplayName ||\n nameCollator(i18n.locale).compare(\n trimmedUsername,\n shortenedDisplayName,\n ) === 0)) ||\n shortenedAlphaNumericDisplayName === acct.toLowerCase();\n\n return (\n <a\n class={`name-text ${showAcct ? 'show-acct' : ''} ${short ? 'short' : ''}`}\n href={url}\n target={external ? '_blank' : null}\n title={\n displayName\n ? `${displayName} (${acct2 ? '' : '@'}${acct})`\n : `${acct2 ? '' : '@'}${acct}`\n }\n onClick={(e) => {\n if (external) return;\n if (e.shiftKey) return; // Save link? 🤷♂️\n e.preventDefault();\n e.stopPropagation();\n if (onClick) return onClick(e);\n if (e.metaKey || e.ctrlKey || e.shiftKey || e.which === 2) {\n const internalURL = `#/${instance}/a/${id}`;\n window.open(internalURL, '_blank');\n return;\n }\n states.showAccount = {\n account,\n instance,\n };\n }}\n >\n {showAvatar && (\n <>\n <Avatar url={avatarStatic || avatar} squircle={bot} />{' '}\n </>\n )}\n {displayName && !short ? (\n <>\n <b dir=\"auto\">\n <EmojiText text={displayName} emojis={emojis} />\n </b>\n {!showAcct && !hideUsername && (\n <>\n {' '}\n <i class=\"bidi-isolate\">@{username}</i>\n </>\n )}\n </>\n ) : short ? (\n <i>{username}</i>\n ) : (\n <b>{username}</b>\n )}\n {showAcct && (\n <>\n <br />\n <i class=\"bidi-isolate\">\n {acct2 ? '' : '@'}\n {acct1}\n {!!acct2 && <span class=\"ib\">{acct2}</span>}\n </i>\n </>\n )}\n </a>\n );\n}\n\nexport default mem(NameText);\n\n// export default memo(NameText, (oldProps, newProps) => {\n// // Only care about account.id, the other props usually don't change\n// const { account } = oldProps;\n// const { account: newAccount } = newProps;\n// return account?.acct === newAccount?.acct;\n// });\n","import { i18n } from '@lingui/core';\n\nimport translangLanguagesNative from '../data/translang-languages-native';\n\nimport mem from './mem';\n\n// Some codes are not supported by Intl.DisplayNames\n// These are mapped to other codes as fallback\nconst codeMappings = {\n 'zh-YUE': 'YUE',\n zh_HANT: 'zh-Hant',\n};\n\nconst IntlDN = mem(\n (locale) =>\n new Intl.DisplayNames(locale || undefined, {\n type: 'language',\n }),\n);\n\nfunction _localeCode2Text(code) {\n let locale;\n let fallback;\n if (typeof code === 'object') {\n ({ code, locale, fallback } = code);\n }\n try {\n const text = IntlDN(locale || i18n.locale).of(code);\n if (text !== code) return text;\n if (!fallback) {\n const anotherText = IntlDN(code).of(code);\n if (anotherText !== code) return anotherText;\n const yetAnotherText = translangLanguagesNative?.[locale];\n if (yetAnotherText !== code) return yetAnotherText;\n }\n return fallback || '';\n } catch (e) {\n if (codeMappings[code]) {\n try {\n const text = IntlDN(codeMappings[locale] || locale || i18n.locale).of(\n codeMappings[code],\n );\n if (text !== codeMappings[code]) return text;\n return fallback || '';\n } catch (e2) {\n console.warn(code, e2);\n }\n }\n return fallback || '';\n }\n}\n\nexport default mem(_localeCode2Text);\n","import languages from '../data/translang-languages';\n\nimport localeMatch from './locale-match';\nimport mem from './mem';\nimport states from './states';\n\nconst translationTargetLanguages = Object.entries(languages.tl).map(\n ([code, { name }]) => ({\n code,\n name,\n }),\n);\n\nconst locales = mem(() => [\n new Intl.DateTimeFormat().resolvedOptions().locale,\n ...navigator.languages,\n]);\n\nconst localeTargetLanguages = () =>\n localeMatch(\n locales(),\n translationTargetLanguages.map((l) => l.code.replace('_', '-')), // The underscore will fail Intl.Locale inside `match`\n 'en',\n );\n\nfunction getTranslateTargetLanguage(fromSettings = false) {\n if (fromSettings) {\n const { contentTranslationTargetLanguage } = states.settings;\n if (contentTranslationTargetLanguage) {\n return contentTranslationTargetLanguage;\n }\n }\n return localeTargetLanguages();\n}\n\nexport default getTranslateTargetLanguage;\n","import { i18n } from '@lingui/core';\n\n// https://tc39.es/ecma402/#table-sanctioned-single-unit-identifiers\nconst BYTES_UNITS = [\n 'byte',\n 'kilobyte',\n 'megabyte',\n 'gigabyte',\n 'terabyte',\n 'petabyte',\n];\nexport default function prettyBytes(bytes) {\n const unitIndex = Math.min(\n Math.floor(Math.log2(bytes) / 10),\n BYTES_UNITS.length - 1,\n );\n const value = bytes / 1024 ** unitIndex;\n return i18n.number(value, {\n style: 'unit',\n unit: BYTES_UNITS[unitIndex],\n unitDisplay: 'narrow',\n maximumFractionDigits: 0,\n });\n}\n","import { satisfies } from 'compare-versions';\n\nimport features from '../data/features.json';\n\nimport { getCurrentInstance, getCurrentNodeInfo } from './store-utils';\n\n// Non-semver(?) UA string detection\nconst containPixelfed = /pixelfed/i;\nconst notContainPixelfed = /^(?!.*pixelfed).*$/i;\nconst containPleroma = /pleroma/i;\nconst containAkkoma = /akkoma/i;\nconst containGTS = /gotosocial/i;\nconst platformFeatures = {\n '@mastodon/lists': notContainPixelfed,\n '@mastodon/filters': notContainPixelfed,\n '@mastodon/mentions': notContainPixelfed,\n '@mastodon/trending-hashtags': notContainPixelfed,\n '@mastodon/trending-links': notContainPixelfed,\n '@mastodon/post-bookmark': notContainPixelfed,\n '@mastodon/post-edit': notContainPixelfed,\n '@mastodon/profile-edit': notContainPixelfed,\n '@mastodon/profile-private-note': notContainPixelfed,\n '@pixelfed/trending': containPixelfed,\n '@pixelfed/home-include-reblogs': containPixelfed,\n '@pixelfed/global-feed': containPixelfed,\n '@pleroma/local-visibility-post': containPleroma,\n '@akkoma/local-visibility-post': containAkkoma,\n};\n\nconst supportsCache = {};\n\nfunction supports(feature) {\n try {\n let { version, domain } = getCurrentInstance();\n let softwareName = getCurrentNodeInfo()?.software?.name || 'mastodon';\n\n if (softwareName === 'hometown') {\n // Hometown is a Mastodon fork and inherits its features\n softwareName = 'mastodon';\n }\n\n const key = `${domain}-${feature}`;\n if (supportsCache[key]) return supportsCache[key];\n\n if (platformFeatures[feature]) {\n return (supportsCache[key] = platformFeatures[feature].test(version));\n }\n\n const range = features[feature];\n if (!range) return false;\n\n // '@mastodon/blah' => 'mastodon'\n const featureSoftware = feature.match(/^@([a-z]+)\\//)[1];\n\n const doesSoftwareMatch = featureSoftware === softwareName.toLowerCase();\n return (supportsCache[key] =\n doesSoftwareMatch &&\n satisfies(version, range, {\n includePrerelease: true,\n loose: true,\n }));\n } catch (e) {\n return false;\n }\n}\n\nexport default supports;\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7F]/; // Note: U+007F DEL is excluded too.\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, callback) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = callback(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {String} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(domain, callback) {\n\tconst parts = domain.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tdomain = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tdomain = domain.replace(regexSeparators, '\\x2E');\n\tconst labels = domain.split('.');\n\tconst encoded = map(labels, callback).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see <https://mathiasbynens.be/notes/javascript-encoding>\n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = codePoints => String.fromCodePoint(...codePoints);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint >= 0x30 && codePoint < 0x3A) {\n\t\treturn 26 + (codePoint - 0x30);\n\t}\n\tif (codePoint >= 0x41 && codePoint < 0x5B) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint >= 0x61 && codePoint < 0x7B) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tconst oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\t\t\tif (digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tconst inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tconst basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue === n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.3.1',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode };\nexport default punycode;\n","function emojifyText(text, emojis = []) {\n if (!text) return '';\n if (!emojis.length) return text;\n if (text.indexOf(':') === -1) return text;\n // Replace shortcodes in text with emoji\n // emojis = [{ shortcode: 'smile', url: 'https://example.com/emoji.png' }]\n emojis.forEach((emoji) => {\n const { shortcode, staticUrl, url } = emoji;\n text = text.replace(\n new RegExp(`:${shortcode}:`, 'g'),\n `<picture><source srcset=\"${staticUrl}\" media=\"(prefers-reduced-motion: reduce)\"></source><img class=\"shortcode-emoji emoji\" src=\"${url}\" alt=\":${shortcode}:\" title=\":${shortcode}:\" width=\"16\" height=\"16\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"low\" /></picture>`,\n );\n });\n // console.log(text, emojis);\n return text;\n}\n\nexport default emojifyText;\n","import emojifyText from './emojify-text';\nimport mem from './mem';\n\nconst fauxDiv = document.createElement('div');\nconst whitelistLinkClasses = ['u-url', 'mention', 'hashtag'];\n\nconst HTML_CHARS_REGEX = /[&<>]/g;\nfunction escapeHTML(html) {\n return html.replace(\n HTML_CHARS_REGEX,\n (c) =>\n ({\n '&': '&',\n '<': '<',\n '>': '>',\n })[c],\n );\n}\n\nconst LINK_REGEX = /<a/i;\nconst HTTP_LINK_REGEX = /^https?:\\/\\//i;\nconst MENTION_REGEX = /^@[^@]+(@[^@]+)?$/;\nconst HASHTAG_REGEX = /^#[^#]+$/;\nconst CODE_BLOCK_REGEX = /^```[^]+```$/;\nconst CODE_BLOCK_START_REGEX = /^```/;\nconst CODE_BLOCK_END_REGEX = /```$/;\nconst INLINE_CODE_REGEX = /`[^`]+`/;\nconst TWITTER_DOMAIN_REGEX = /(twitter|x)\\.com/i;\nconst TWITTER_MENTION_REGEX = /@[a-zA-Z0-9_]+@(twitter|x)\\.com/;\nconst TWITTER_MENTION_CAPTURE_REGEX = /(@([a-zA-Z0-9_]+)@(twitter|x)\\.com)/g;\nconst CODE_INLINE_CAPTURE_REGEX = /(`[^]+?`)/g;\n\nfunction createDOM(html, isDocumentFragment) {\n if (isDocumentFragment) {\n const tpl = document.createElement('template');\n tpl.innerHTML = html;\n return tpl.content;\n } else {\n const tpl = document.createElement('div');\n tpl.innerHTML = html;\n return tpl;\n }\n}\n\nfunction _enhanceContent(content, opts = {}) {\n const { emojis, returnDOM, postEnhanceDOM = () => {} } = opts;\n let enhancedContent = content;\n // const dom = document.createElement('div');\n // dom.innerHTML = enhancedContent;\n const dom = createDOM(enhancedContent, returnDOM);\n const hasLink = LINK_REGEX.test(enhancedContent);\n const hasCodeBlock = enhancedContent.includes('```');\n\n if (hasLink) {\n // Add target=\"_blank\" to all links with no target=\"_blank\"\n // E.g. `note` in `account`\n const noTargetBlankLinks = dom.querySelectorAll('a:not([target=\"_blank\"])');\n for (const link of noTargetBlankLinks) {\n link.setAttribute('target', '_blank');\n }\n\n // Remove all classes except `u-url`, `mention`, `hashtag`\n const links = dom.querySelectorAll('a[class]');\n for (const link of links) {\n for (const c of link.classList) {\n if (!whitelistLinkClasses.includes(c)) {\n link.classList.remove(c);\n }\n }\n }\n }\n\n // Add 'has-url-text' to all links that contains a url\n if (hasLink) {\n const links = dom.querySelectorAll('a[href]');\n for (const link of links) {\n if (HTTP_LINK_REGEX.test(link.textContent.trim())) {\n link.classList.add('has-url-text');\n shortenLink(link);\n }\n }\n }\n\n // Spanify un-spanned mentions\n if (hasLink) {\n const links = dom.querySelectorAll('a[href]');\n const usernames = [];\n for (const link of links) {\n const text = link.innerText.trim();\n const hasChildren = link.querySelector('*');\n // If text looks like @username@domain, then it's a mention\n if (MENTION_REGEX.test(text)) {\n // Only show @username\n const [_, username, domain] = text.split('@');\n if (!hasChildren) {\n if (\n !usernames.some(([u]) => u === username) ||\n usernames.some(([u, d]) => u === username && d === domain)\n ) {\n link.innerHTML = `@<span>${username}</span>`;\n usernames.push([username, domain]);\n } else {\n link.innerHTML = `@<span>${username}@${domain}</span>`;\n }\n }\n link.classList.add('mention');\n }\n // If text looks like #hashtag, then it's a hashtag\n if (HASHTAG_REGEX.test(text)) {\n if (!hasChildren) link.innerHTML = `#<span>${text.slice(1)}</span>`;\n link.classList.add('mention', 'hashtag');\n }\n }\n }\n\n // EMOJIS\n // ======\n // Convert :shortcode: to <img />\n let textNodes;\n if (enhancedContent.includes(':') && emojis?.length) {\n textNodes = extractTextNodes(dom);\n for (const node of textNodes) {\n let html = escapeHTML(node.nodeValue);\n html = emojifyText(html, emojis);\n fauxDiv.innerHTML = html;\n node.replaceWith(...fauxDiv.childNodes);\n }\n }\n\n // CODE BLOCKS\n // ===========\n // Convert ```code``` to <pre><code>code</code></pre>\n if (hasCodeBlock) {\n const blocks = [...dom.querySelectorAll('p')].filter((p) =>\n CODE_BLOCK_REGEX.test(p.innerText.trim()),\n );\n for (const block of blocks) {\n const pre = document.createElement('pre');\n // Replace <br /> with newlines\n for (const br of block.querySelectorAll('br')) {\n br.replaceWith('\\n');\n }\n pre.innerHTML = `<code>${block.innerHTML.trim()}</code>`;\n block.replaceWith(pre);\n }\n }\n\n // Convert multi-paragraph code blocks to <pre><code>code</code></pre>\n if (hasCodeBlock) {\n const paragraphs = [...dom.querySelectorAll('p')];\n // Filter out paragraphs with ``` in beginning only\n const codeBlocks = paragraphs.filter((p) =>\n CODE_BLOCK_START_REGEX.test(p.innerText),\n );\n // For each codeBlocks, get all paragraphs until the last paragraph with ``` at the end only\n for (const block of codeBlocks) {\n const nextParagraphs = [block];\n let hasCodeBlock = false;\n let currentBlock = block;\n while (currentBlock.nextElementSibling) {\n const next = currentBlock.nextElementSibling;\n if (next && next.tagName === 'P') {\n if (CODE_BLOCK_END_REGEX.test(next.innerText)) {\n nextParagraphs.push(next);\n hasCodeBlock = true;\n break;\n } else {\n nextParagraphs.push(next);\n }\n } else {\n break;\n }\n currentBlock = next;\n }\n if (hasCodeBlock) {\n const pre = document.createElement('pre');\n for (const p of nextParagraphs) {\n // Replace <br /> with newlines\n for (const br of p.querySelectorAll('br')) {\n br.replaceWith('\\n');\n }\n }\n const codeText = nextParagraphs.map((p) => p.innerHTML).join('\\n\\n');\n pre.innerHTML = `<code tabindex=\"0\">${codeText}</code>`;\n block.replaceWith(pre);\n for (const p of nextParagraphs) {\n p.remove();\n }\n }\n }\n }\n\n // INLINE CODE\n // ===========\n // Convert `code` to <code>code</code>\n if (enhancedContent.includes('`')) {\n textNodes = extractTextNodes(dom);\n for (const node of textNodes) {\n let html = escapeHTML(node.nodeValue);\n if (INLINE_CODE_REGEX.test(html)) {\n html = html.replaceAll(CODE_INLINE_CAPTURE_REGEX, '<code>$1</code>');\n }\n fauxDiv.innerHTML = html;\n // const nodes = [...fauxDiv.childNodes];\n node.replaceWith(...fauxDiv.childNodes);\n }\n }\n\n // TWITTER USERNAMES\n // =================\n // Convert @username@twitter.com to <a href=\"https://twitter.com/username\">@username@twitter.com</a>\n if (TWITTER_DOMAIN_REGEX.test(enhancedContent)) {\n textNodes = extractTextNodes(dom, {\n rejectFilter: ['A'],\n });\n for (const node of textNodes) {\n let html = escapeHTML(node.nodeValue);\n if (TWITTER_MENTION_REGEX.test(html)) {\n html = html.replaceAll(\n TWITTER_MENTION_CAPTURE_REGEX,\n '<a href=\"https://twitter.com/$2\" rel=\"nofollow noopener\" target=\"_blank\">$1</a>',\n );\n }\n fauxDiv.innerHTML = html;\n // const nodes = [...fauxDiv.childNodes];\n node.replaceWith(...fauxDiv.childNodes);\n }\n }\n\n // HASHTAG STUFFING\n // ================\n // Get the <p> that contains a lot of hashtags, add a class to it\n if (enhancedContent.includes('#')) {\n let prevIndex = null;\n const hashtagStuffedParagraphs = [...dom.querySelectorAll('p')].filter(\n (p, index) => {\n let hashtagCount = 0;\n for (let i = 0; i < p.childNodes.length; i++) {\n const node = p.childNodes[i];\n\n if (node.nodeType === Node.TEXT_NODE) {\n const text = node.textContent.trim();\n if (text !== '') {\n return false;\n }\n } else if (node.tagName === 'BR') {\n // Ignore <br />\n } else if (node.tagName === 'A') {\n const linkText = node.textContent.trim();\n if (!linkText || !linkText.startsWith('#')) {\n return false;\n } else {\n hashtagCount++;\n }\n } else {\n return false;\n }\n }\n // Only consider \"stuffing\" if:\n // - there are more than 3 hashtags\n // - there are more than 1 hashtag in adjacent paragraphs\n if (hashtagCount > 3) {\n prevIndex = index;\n return true;\n }\n if (hashtagCount > 1 && prevIndex && index === prevIndex + 1) {\n prevIndex = index;\n return true;\n }\n },\n );\n if (hashtagStuffedParagraphs?.length) {\n for (const p of hashtagStuffedParagraphs) {\n p.classList.add('hashtag-stuffing');\n p.title = p.innerText;\n }\n }\n }\n\n // ADD ASPECT RATIO TO ALL IMAGES\n if (enhancedContent.includes('<img')) {\n const imgs = dom.querySelectorAll('img');\n for (let i = 0; i < imgs.length; i++) {\n const img = imgs[i];\n const width = img.getAttribute('width') || img.naturalWidth;\n const height = img.getAttribute('height') || img.naturalHeight;\n if (width && height) {\n img.style.setProperty('--original-aspect-ratio', `${width}/${height}`);\n }\n }\n }\n\n // FIX CLOAK MODE FOR SAFARI\n // Workaround for Safari so that `text-decoration-thickness` works\n // Wrap child text nodes in spans\n for (const node of dom.childNodes) {\n if (node.nodeType === Node.TEXT_NODE && node.textContent.trim?.()) {\n const span = document.createElement('span');\n span.textContent = node.textContent;\n dom.replaceChild(span, node);\n }\n }\n\n if (postEnhanceDOM) {\n queueMicrotask(() => postEnhanceDOM(dom));\n // postEnhanceDOM(dom); // mutate dom\n }\n\n return returnDOM ? dom : dom.innerHTML;\n}\nconst enhanceContent = mem(_enhanceContent);\n\nconst defaultRejectFilter = [\n // Document metadata\n 'STYLE',\n // Image and multimedia\n 'IMG',\n 'VIDEO',\n 'AUDIO',\n 'AREA',\n 'MAP',\n 'TRACK',\n // Embedded content\n 'EMBED',\n 'IFRAME',\n 'OBJECT',\n 'PICTURE',\n 'PORTAL',\n 'SOURCE',\n // SVG and MathML\n 'SVG',\n 'MATH',\n // Scripting\n 'CANVAS',\n 'NOSCRIPT',\n 'SCRIPT',\n // Forms\n 'INPUT',\n 'OPTION',\n 'TEXTAREA',\n // Web Components\n 'SLOT',\n 'TEMPLATE',\n];\nconst defaultRejectFilterMap = Object.fromEntries(\n defaultRejectFilter.map((nodeName) => [nodeName, true]),\n);\n\nconst URL_PREFIX_REGEX = /^(https?:\\/\\/(www\\.)?|xmpp:)/;\nconst URL_DISPLAY_LENGTH = 30;\n// Similar to https://github.com/mastodon/mastodon/blob/1666b1955992e16f4605b414c6563ca25b3a3f18/app/lib/text_formatter.rb#L54-L69\nfunction shortenLink(link) {\n if (!link || link.querySelector?.('*')) {\n return;\n }\n try {\n const url = link.innerText.trim();\n const prefix = (url.match(URL_PREFIX_REGEX) || [])[0] || '';\n if (!prefix) return;\n const displayURL = url.slice(\n prefix.length,\n prefix.length + URL_DISPLAY_LENGTH,\n );\n const suffix = url.slice(prefix.length + URL_DISPLAY_LENGTH);\n const cutoff = url.slice(prefix.length).length > URL_DISPLAY_LENGTH;\n link.innerHTML = `<span class=\"invisible\">${prefix}</span><span class=${\n cutoff ? 'ellipsis' : ''\n }>${displayURL}</span><span class=\"invisible\">${suffix}</span>`;\n } catch (e) {}\n}\n\nfunction extractTextNodes(dom, opts = {}) {\n const textNodes = [];\n const rejectFilterMap = Object.assign(\n {},\n defaultRejectFilterMap,\n opts.rejectFilter?.reduce((acc, cur) => {\n acc[cur] = true;\n return acc;\n }, {}),\n );\n const walk = document.createTreeWalker(\n dom,\n NodeFilter.SHOW_TEXT,\n {\n acceptNode(node) {\n if (rejectFilterMap[node.parentNode.nodeName]) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n },\n },\n false,\n );\n let node;\n while ((node = walk.nextNode())) {\n textNodes.push(node);\n }\n return textNodes;\n}\n\nexport default enhanceContent;\n","import states from './states';\n\nfunction handleContentLinks(opts) {\n const { mentions = [], instance, previewMode, statusURL } = opts || {};\n return (e) => {\n let { target } = e;\n target = target.closest('a');\n if (!target) return;\n\n // If cmd/ctrl/shift/alt key is pressed or middle-click, let the browser handle it\n if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.which === 2) {\n return;\n }\n\n const prevText = target.previousSibling?.textContent;\n const textBeforeLinkIsAt = prevText?.endsWith('@');\n const textStartsWithAt = target.innerText.startsWith('@');\n if (\n ((target.classList.contains('u-url') ||\n target.classList.contains('mention')) &&\n textStartsWithAt) ||\n (textBeforeLinkIsAt && !textStartsWithAt)\n ) {\n const targetText = (\n target.querySelector('span') || target\n ).innerText.trim();\n const username = targetText.replace(/^@/, '');\n const url = target.getAttribute('href');\n // Only fallback to acct/username check if url doesn't match\n const mention =\n mentions.find((mention) => mention.url === url) ||\n mentions.find(\n (mention) =>\n mention.acct === username || mention.username === username,\n );\n console.warn('MENTION', mention, url);\n if (mention) {\n e.preventDefault();\n e.stopPropagation();\n states.showAccount = {\n account: mention.acct,\n instance,\n };\n } else if (!/^http/i.test(targetText)) {\n console.log('mention not found', targetText);\n e.preventDefault();\n e.stopPropagation();\n const href = target.getAttribute('href');\n states.showAccount = {\n account: href,\n instance,\n };\n }\n } else if (!previewMode) {\n const textBeforeLinkIsHash = prevText?.endsWith('#');\n if (target.classList.contains('hashtag') || textBeforeLinkIsHash) {\n e.preventDefault();\n e.stopPropagation();\n const tag = target.innerText.replace(/^#/, '').trim();\n const hashURL = instance ? `#/${instance}/t/${tag}` : `#/t/${tag}`;\n console.log({ hashURL });\n location.hash = hashURL;\n } else if (\n states.unfurledLinks[target.href]?.url &&\n statusURL !== target.href\n ) {\n // If unfurled AND not self-referential\n e.preventDefault();\n e.stopPropagation();\n states.prevLocation = {\n pathname: location.hash.replace(/^#/, ''),\n };\n location.hash = `#${states.unfurledLinks[target.href].url}`;\n }\n }\n };\n}\n\nexport default handleContentLinks;\n","import { i18n } from '@lingui/core';\n\nexport default function i18nDuration(duration, unit) {\n return () =>\n i18n.number(duration, {\n style: 'unit',\n unit,\n unitDisplay: 'long',\n });\n}\n","import { i18n } from '@lingui/core';\n\nexport default function shortenNumber(num) {\n try {\n return i18n.number(num, {\n notation: 'compact',\n roundingMode: 'floor',\n });\n } catch (e) {\n return num;\n }\n}\n","import './account-block.css';\n\nimport { Plural, Trans, useLingui } from '@lingui/react/macro';\n\n// import { useNavigate } from 'react-router-dom';\nimport enhanceContent from '../utils/enhance-content';\nimport niceDateTime from '../utils/nice-date-time';\nimport shortenNumber from '../utils/shorten-number';\nimport states from '../utils/states';\n\nimport Avatar from './avatar';\nimport EmojiText from './emoji-text';\nimport Icon from './icon';\n\nfunction AccountBlock({\n skeleton,\n account,\n avatarSize = 'xl',\n useAvatarStatic = false,\n instance,\n external,\n internal,\n onClick,\n showActivity = false,\n showStats = false,\n accountInstance,\n hideDisplayName = false,\n relationship = {},\n excludeRelationshipAttrs = [],\n}) {\n const { t } = useLingui();\n if (skeleton) {\n return (\n <div class=\"account-block skeleton\">\n <Avatar size={avatarSize} />\n <span>\n <b>████████</b>\n <br />\n <span class=\"account-block-acct\">██████</span>\n </span>\n </div>\n );\n }\n\n if (!account) {\n return null;\n }\n\n // const navigate = useNavigate();\n\n const {\n id,\n acct,\n avatar,\n avatarStatic,\n displayName,\n username,\n emojis,\n url,\n statusesCount,\n lastStatusAt,\n bot,\n fields,\n note,\n group,\n followersCount,\n createdAt,\n locked,\n } = account;\n let [_, acct1, acct2] = acct.match(/([^@]+)(@.+)/i) || [, acct];\n if (accountInstance) {\n acct2 = `@${accountInstance}`;\n }\n\n const verifiedField = fields?.find((f) => !!f.verifiedAt && !!f.value);\n\n const excludedRelationship = {};\n for (const r in relationship) {\n if (!excludeRelationshipAttrs.includes(r)) {\n excludedRelationship[r] = relationship[r];\n }\n }\n const hasRelationship =\n excludedRelationship.following ||\n excludedRelationship.followedBy ||\n excludedRelationship.requested;\n\n return (\n <a\n class=\"account-block\"\n href={url}\n target={external ? '_blank' : null}\n title={acct2 ? acct : `@${acct}`}\n onClick={(e) => {\n if (external) return;\n e.preventDefault();\n if (onClick) return onClick(e);\n if (internal) {\n // navigate(`/${instance}/a/${id}`);\n location.hash = `/${instance}/a/${id}`;\n } else {\n states.showAccount = {\n account,\n instance,\n };\n }\n }}\n >\n <div class=\"avatar-container\">\n <Avatar\n url={useAvatarStatic ? avatarStatic : avatar || avatarStatic}\n staticUrl={useAvatarStatic ? undefined : avatarStatic}\n size={avatarSize}\n squircle={bot}\n />\n </div>\n <span class=\"account-block-content\">\n {!hideDisplayName && (\n <>\n {displayName ? (\n <b>\n <EmojiText text={displayName} emojis={emojis} />\n </b>\n ) : (\n <b>{username}</b>\n )}\n </>\n )}{' '}\n <span class=\"account-block-acct bidi-isolate\">\n {acct2 ? '' : '@'}\n {acct1}\n <wbr />\n {acct2}\n {locked && (\n <>\n {' '}\n <Icon icon=\"lock\" size=\"s\" alt={t`Locked`} />\n </>\n )}\n </span>\n {showActivity && (\n <div class=\"account-block-stats\">\n <Trans>Posts: {shortenNumber(statusesCount)}</Trans>\n {!!lastStatusAt && (\n <>\n {' '}\n ·{' '}\n <Trans>\n Last posted:{' '}\n {niceDateTime(lastStatusAt, {\n hideTime: true,\n })}\n </Trans>\n </>\n )}\n </div>\n )}\n {showStats && (\n <div class=\"account-block-stats\">\n {bot && (\n <>\n <span class=\"tag collapsed\">\n <Icon icon=\"bot\" /> <Trans>Automated</Trans>\n </span>\n </>\n )}\n {!!group && (\n <>\n <span class=\"tag collapsed\">\n <Icon icon=\"group\" /> <Trans>Group</Trans>\n </span>\n </>\n )}\n {hasRelationship && (\n <div key={relationship.id} class=\"shazam-container-horizontal\">\n <div class=\"shazam-container-inner\">\n {excludedRelationship.following &&\n excludedRelationship.followedBy ? (\n <span class=\"tag minimal\">\n <Trans>Mutual</Trans>\n </span>\n ) : excludedRelationship.requested ? (\n <span class=\"tag minimal\">\n <Trans>Requested</Trans>\n </span>\n ) : excludedRelationship.following ? (\n <span class=\"tag minimal\">\n <Trans>Following</Trans>\n </span>\n ) : excludedRelationship.followedBy ? (\n <span class=\"tag minimal\">\n <Trans>Follows you</Trans>\n </span>\n ) : null}\n </div>\n </div>\n )}\n {!!followersCount && (\n <span class=\"ib\">\n <Plural\n value={followersCount}\n one=\"# follower\"\n other=\"# followers\"\n />\n </span>\n )}\n {!!verifiedField && (\n <span class=\"verified-field\">\n <Icon icon=\"check-circle\" size=\"s\" alt={t`Verified`} />{' '}\n <span\n dangerouslySetInnerHTML={{\n __html: enhanceContent(verifiedField.value, { emojis }),\n }}\n />\n </span>\n )}\n {!bot &&\n !group &&\n !hasRelationship &&\n !followersCount &&\n !verifiedField &&\n !!createdAt && (\n <span class=\"created-at\">\n <Trans>\n Joined{' '}\n <time datetime={createdAt}>\n {niceDateTime(createdAt, {\n hideTime: true,\n })}\n </time>\n </Trans>\n </span>\n )}\n </div>\n )}\n </span>\n </a>\n );\n}\n\nexport default AccountBlock;\n","function RetryOperation(timeouts, options) {\n // Compatibility for the old (timeouts, retryForever) signature\n if (typeof options === 'boolean') {\n options = { forever: options };\n }\n\n this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));\n this._timeouts = timeouts;\n this._options = options || {};\n this._maxRetryTime = options && options.maxRetryTime || Infinity;\n this._fn = null;\n this._errors = [];\n this._attempts = 1;\n this._operationTimeout = null;\n this._operationTimeoutCb = null;\n this._timeout = null;\n this._operationStart = null;\n this._timer = null;\n\n if (this._options.forever) {\n this._cachedTimeouts = this._timeouts.slice(0);\n }\n}\nmodule.exports = RetryOperation;\n\nRetryOperation.prototype.reset = function() {\n this._attempts = 1;\n this._timeouts = this._originalTimeouts.slice(0);\n}\n\nRetryOperation.prototype.stop = function() {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n if (this._timer) {\n clearTimeout(this._timer);\n }\n\n this._timeouts = [];\n this._cachedTimeouts = null;\n};\n\nRetryOperation.prototype.retry = function(err) {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n\n if (!err) {\n return false;\n }\n var currentTime = new Date().getTime();\n if (err && currentTime - this._operationStart >= this._maxRetryTime) {\n this._errors.push(err);\n this._errors.unshift(new Error('RetryOperation timeout occurred'));\n return false;\n }\n\n this._errors.push(err);\n\n var timeout = this._timeouts.shift();\n if (timeout === undefined) {\n if (this._cachedTimeouts) {\n // retry forever, only keep last error\n this._errors.splice(0, this._errors.length - 1);\n timeout = this._cachedTimeouts.slice(-1);\n } else {\n return false;\n }\n }\n\n var self = this;\n this._timer = setTimeout(function() {\n self._attempts++;\n\n if (self._operationTimeoutCb) {\n self._timeout = setTimeout(function() {\n self._operationTimeoutCb(self._attempts);\n }, self._operationTimeout);\n\n if (self._options.unref) {\n self._timeout.unref();\n }\n }\n\n self._fn(self._attempts);\n }, timeout);\n\n if (this._options.unref) {\n this._timer.unref();\n }\n\n return true;\n};\n\nRetryOperation.prototype.attempt = function(fn, timeoutOps) {\n this._fn = fn;\n\n if (timeoutOps) {\n if (timeoutOps.timeout) {\n this._operationTimeout = timeoutOps.timeout;\n }\n if (timeoutOps.cb) {\n this._operationTimeoutCb = timeoutOps.cb;\n }\n }\n\n var self = this;\n if (this._operationTimeoutCb) {\n this._timeout = setTimeout(function() {\n self._operationTimeoutCb();\n }, self._operationTimeout);\n }\n\n this._operationStart = new Date().getTime();\n\n this._fn(this._attempts);\n};\n\nRetryOperation.prototype.try = function(fn) {\n console.log('Using RetryOperation.try() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = function(fn) {\n console.log('Using RetryOperation.start() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = RetryOperation.prototype.try;\n\nRetryOperation.prototype.errors = function() {\n return this._errors;\n};\n\nRetryOperation.prototype.attempts = function() {\n return this._attempts;\n};\n\nRetryOperation.prototype.mainError = function() {\n if (this._errors.length === 0) {\n return null;\n }\n\n var counts = {};\n var mainError = null;\n var mainErrorCount = 0;\n\n for (var i = 0; i < this._errors.length; i++) {\n var error = this._errors[i];\n var message = error.message;\n var count = (counts[message] || 0) + 1;\n\n counts[message] = count;\n\n if (count >= mainErrorCount) {\n mainError = error;\n mainErrorCount = count;\n }\n }\n\n return mainError;\n};\n","var RetryOperation = require('./retry_operation');\n\nexports.operation = function(options) {\n var timeouts = exports.timeouts(options);\n return new RetryOperation(timeouts, {\n forever: options && (options.forever || options.retries === Infinity),\n unref: options && options.unref,\n maxRetryTime: options && options.maxRetryTime\n });\n};\n\nexports.timeouts = function(options) {\n if (options instanceof Array) {\n return [].concat(options);\n }\n\n var opts = {\n retries: 10,\n factor: 2,\n minTimeout: 1 * 1000,\n maxTimeout: Infinity,\n randomize: false\n };\n for (var key in options) {\n opts[key] = options[key];\n }\n\n if (opts.minTimeout > opts.maxTimeout) {\n throw new Error('minTimeout is greater than maxTimeout');\n }\n\n var timeouts = [];\n for (var i = 0; i < opts.retries; i++) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n if (options && options.forever && !timeouts.length) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n // sort the array numerically ascending\n timeouts.sort(function(a,b) {\n return a - b;\n });\n\n return timeouts;\n};\n\nexports.createTimeout = function(attempt, opts) {\n var random = (opts.randomize)\n ? (Math.random() + 1)\n : 1;\n\n var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));\n timeout = Math.min(timeout, opts.maxTimeout);\n\n return timeout;\n};\n\nexports.wrap = function(obj, options, methods) {\n if (options instanceof Array) {\n methods = options;\n options = null;\n }\n\n if (!methods) {\n methods = [];\n for (var key in obj) {\n if (typeof obj[key] === 'function') {\n methods.push(key);\n }\n }\n }\n\n for (var i = 0; i < methods.length; i++) {\n var method = methods[i];\n var original = obj[method];\n\n obj[method] = function retryWrapper(original) {\n var op = exports.operation(options);\n var args = Array.prototype.slice.call(arguments, 1);\n var callback = args.pop();\n\n args.push(function(err) {\n if (op.retry(err)) {\n return;\n }\n if (err) {\n arguments[0] = op.mainError();\n }\n callback.apply(this, arguments);\n });\n\n op.attempt(function() {\n original.apply(obj, args);\n });\n }.bind(obj, original);\n obj[method].options = options;\n }\n};\n","module.exports = require('./lib/retry');","const objectToString = Object.prototype.toString;\n\nconst isError = value => objectToString.call(value) === '[object Error]';\n\nconst errorMessages = new Set([\n\t'Failed to fetch', // Chrome\n\t'NetworkError when attempting to fetch resource.', // Firefox\n\t'The Internet connection appears to be offline.', // Safari 16\n\t'Load failed', // Safari 17+\n\t'Network request failed', // `cross-fetch`\n\t'fetch failed', // Undici (Node.js)\n]);\n\nexport default function isNetworkError(error) {\n\tconst isValid = error\n\t\t&& isError(error)\n\t\t&& error.name === 'TypeError'\n\t\t&& typeof error.message === 'string';\n\n\tif (!isValid) {\n\t\treturn false;\n\t}\n\n\t// We do an extra check for Safari 17+ as it has a very generic error message.\n\t// Network errors in Safari have no stack.\n\tif (error.message === 'Load failed') {\n\t\treturn error.stack === undefined;\n\t}\n\n\treturn errorMessages.has(error.message);\n}\n","import retry from 'retry';\nimport isNetworkError from 'is-network-error';\n\nexport class AbortError extends Error {\n\tconstructor(message) {\n\t\tsuper();\n\n\t\tif (message instanceof Error) {\n\t\t\tthis.originalError = message;\n\t\t\t({message} = message);\n\t\t} else {\n\t\t\tthis.originalError = new Error(message);\n\t\t\tthis.originalError.stack = this.stack;\n\t\t}\n\n\t\tthis.name = 'AbortError';\n\t\tthis.message = message;\n\t}\n}\n\nconst decorateErrorWithCounts = (error, attemptNumber, options) => {\n\t// Minus 1 from attemptNumber because the first attempt does not count as a retry\n\tconst retriesLeft = options.retries - (attemptNumber - 1);\n\n\terror.attemptNumber = attemptNumber;\n\terror.retriesLeft = retriesLeft;\n\treturn error;\n};\n\nexport default async function pRetry(input, options) {\n\treturn new Promise((resolve, reject) => {\n\t\toptions = {...options};\n\t\toptions.onFailedAttempt ??= () => {};\n\t\toptions.shouldRetry ??= () => true;\n\t\toptions.retries ??= 10;\n\n\t\tconst operation = retry.operation(options);\n\n\t\tconst abortHandler = () => {\n\t\t\toperation.stop();\n\t\t\treject(options.signal?.reason);\n\t\t};\n\n\t\tif (options.signal && !options.signal.aborted) {\n\t\t\toptions.signal.addEventListener('abort', abortHandler, {once: true});\n\t\t}\n\n\t\tconst cleanUp = () => {\n\t\t\toptions.signal?.removeEventListener('abort', abortHandler);\n\t\t\toperation.stop();\n\t\t};\n\n\t\toperation.attempt(async attemptNumber => {\n\t\t\ttry {\n\t\t\t\tconst result = await input(attemptNumber);\n\t\t\t\tcleanUp();\n\t\t\t\tresolve(result);\n\t\t\t} catch (error) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!(error instanceof Error)) {\n\t\t\t\t\t\tthrow new TypeError(`Non-error was thrown: \"${error}\". You should only throw errors.`);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (error instanceof AbortError) {\n\t\t\t\t\t\tthrow error.originalError;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (error instanceof TypeError && !isNetworkError(error)) {\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\n\t\t\t\t\tdecorateErrorWithCounts(error, attemptNumber, options);\n\n\t\t\t\t\tif (!(await options.shouldRetry(error))) {\n\t\t\t\t\t\toperation.stop();\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\n\t\t\t\t\tawait options.onFailedAttempt(error);\n\n\t\t\t\t\tif (!operation.retry(error)) {\n\t\t\t\t\t\tthrow operation.mainError();\n\t\t\t\t\t}\n\t\t\t\t} catch (finalError) {\n\t\t\t\t\tdecorateErrorWithCounts(finalError, attemptNumber, options);\n\t\t\t\t\tcleanUp();\n\t\t\t\t\treject(finalError);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n","export const supportsBrowserTranslator =\n 'ai' in self && 'translator' in self.ai;\n\n// https://developer.chrome.com/docs/ai/language-detection\nexport let langDetector;\nif (supportsBrowserTranslator) {\n (async () => {\n try {\n const languageDetectorCapabilities =\n await self.ai.languageDetector.capabilities();\n const canDetect = languageDetectorCapabilities.capabilities;\n if (canDetect === 'no') {\n // The language detector isn't usable.\n // return;\n }\n if (canDetect === 'readily') {\n // The language detector can immediately be used.\n langDetector = await self.ai.languageDetector.create();\n } else {\n // The language detector can be used after model download.\n langDetector = await self.ai.languageDetector.create({\n monitor(m) {\n m.addEventListener('downloadprogress', (e) => {\n console.log(\n `Detector: Downloaded ${e.loaded} of ${e.total} bytes.`,\n );\n });\n },\n });\n await langDetector.ready;\n }\n } catch (e) {\n console.error(e);\n }\n })();\n}\n\n// https://developer.chrome.com/docs/ai/translator-api\nexport const translate = async (text, source, target) => {\n let detectedSourceLanguage;\n const originalSource = source;\n if (source === 'auto') {\n try {\n const results = await langDetector.detect(text);\n source = results[0].detectedLanguage;\n detectedSourceLanguage = source;\n } catch (e) {\n console.error(e);\n return {\n error: e,\n };\n }\n }\n console.groupCollapsed(\n '💬 BROWSER TRANSLATE',\n originalSource,\n detectedSourceLanguage,\n target,\n );\n console.log(text);\n try {\n const translatorCapabilities = await self.ai.translator.capabilities();\n const canTranslate = translatorCapabilities.languagePairAvailable(\n source,\n target,\n );\n if (canTranslate === 'no') {\n console.groupEnd();\n return {\n error: `Unsupported language pair: ${source} -> ${target}`,\n };\n }\n let translator;\n if (canTranslate === 'readily') {\n translator = await self.ai.translator.create({\n sourceLanguage: source,\n targetLanguage: target,\n });\n } else {\n translator = await self.ai.translator.create({\n sourceLanguage: source,\n targetLanguage: target,\n monitor(m) {\n m.addEventListener('downloadprogress', (e) => {\n console.log(\n `Translate ${source} -> ${target}: Downloaded ${e.loaded} of ${e.total} bytes.`,\n );\n });\n },\n });\n }\n\n const content = await translator.translate(text);\n console.log(content);\n console.groupEnd();\n\n return {\n content,\n detectedSourceLanguage,\n provider: 'browser',\n };\n } catch (e) {\n console.groupEnd();\n console.error(e);\n return {\n error: e,\n };\n }\n};\n","\"use client\";\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n\n// src/InView.tsx\nimport * as React from \"react\";\n\n// src/observe.ts\nvar observerMap = /* @__PURE__ */ new Map();\nvar RootIds = /* @__PURE__ */ new WeakMap();\nvar rootId = 0;\nvar unsupportedValue = void 0;\nfunction defaultFallbackInView(inView) {\n unsupportedValue = inView;\n}\nfunction getRootId(root) {\n if (!root) return \"0\";\n if (RootIds.has(root)) return RootIds.get(root);\n rootId += 1;\n RootIds.set(root, rootId.toString());\n return RootIds.get(root);\n}\nfunction optionsToId(options) {\n return Object.keys(options).sort().filter(\n (key) => options[key] !== void 0\n ).map((key) => {\n return `${key}_${key === \"root\" ? getRootId(options.root) : options[key]}`;\n }).toString();\n}\nfunction createObserver(options) {\n const id = optionsToId(options);\n let instance = observerMap.get(id);\n if (!instance) {\n const elements = /* @__PURE__ */ new Map();\n let thresholds;\n const observer = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n var _a;\n const inView = entry.isIntersecting && thresholds.some((threshold) => entry.intersectionRatio >= threshold);\n if (options.trackVisibility && typeof entry.isVisible === \"undefined\") {\n entry.isVisible = inView;\n }\n (_a = elements.get(entry.target)) == null ? void 0 : _a.forEach((callback) => {\n callback(inView, entry);\n });\n });\n }, options);\n thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]);\n instance = {\n id,\n observer,\n elements\n };\n observerMap.set(id, instance);\n }\n return instance;\n}\nfunction observe(element, callback, options = {}, fallbackInView = unsupportedValue) {\n if (typeof window.IntersectionObserver === \"undefined\" && fallbackInView !== void 0) {\n const bounds = element.getBoundingClientRect();\n callback(fallbackInView, {\n isIntersecting: fallbackInView,\n target: element,\n intersectionRatio: typeof options.threshold === \"number\" ? options.threshold : 0,\n time: 0,\n boundingClientRect: bounds,\n intersectionRect: bounds,\n rootBounds: bounds\n });\n return () => {\n };\n }\n const { id, observer, elements } = createObserver(options);\n const callbacks = elements.get(element) || [];\n if (!elements.has(element)) {\n elements.set(element, callbacks);\n }\n callbacks.push(callback);\n observer.observe(element);\n return function unobserve() {\n callbacks.splice(callbacks.indexOf(callback), 1);\n if (callbacks.length === 0) {\n elements.delete(element);\n observer.unobserve(element);\n }\n if (elements.size === 0) {\n observer.disconnect();\n observerMap.delete(id);\n }\n };\n}\n\n// src/InView.tsx\nfunction isPlainChildren(props) {\n return typeof props.children !== \"function\";\n}\nvar InView = class extends React.Component {\n constructor(props) {\n super(props);\n __publicField(this, \"node\", null);\n __publicField(this, \"_unobserveCb\", null);\n __publicField(this, \"handleNode\", (node) => {\n if (this.node) {\n this.unobserve();\n if (!node && !this.props.triggerOnce && !this.props.skip) {\n this.setState({ inView: !!this.props.initialInView, entry: void 0 });\n }\n }\n this.node = node ? node : null;\n this.observeNode();\n });\n __publicField(this, \"handleChange\", (inView, entry) => {\n if (inView && this.props.triggerOnce) {\n this.unobserve();\n }\n if (!isPlainChildren(this.props)) {\n this.setState({ inView, entry });\n }\n if (this.props.onChange) {\n this.props.onChange(inView, entry);\n }\n });\n this.state = {\n inView: !!props.initialInView,\n entry: void 0\n };\n }\n componentDidMount() {\n this.unobserve();\n this.observeNode();\n }\n componentDidUpdate(prevProps) {\n if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) {\n this.unobserve();\n this.observeNode();\n }\n }\n componentWillUnmount() {\n this.unobserve();\n }\n observeNode() {\n if (!this.node || this.props.skip) return;\n const {\n threshold,\n root,\n rootMargin,\n trackVisibility,\n delay,\n fallbackInView\n } = this.props;\n this._unobserveCb = observe(\n this.node,\n this.handleChange,\n {\n threshold,\n root,\n rootMargin,\n // @ts-ignore\n trackVisibility,\n // @ts-ignore\n delay\n },\n fallbackInView\n );\n }\n unobserve() {\n if (this._unobserveCb) {\n this._unobserveCb();\n this._unobserveCb = null;\n }\n }\n render() {\n const { children } = this.props;\n if (typeof children === \"function\") {\n const { inView, entry } = this.state;\n return children({ inView, entry, ref: this.handleNode });\n }\n const {\n as,\n triggerOnce,\n threshold,\n root,\n rootMargin,\n onChange,\n skip,\n trackVisibility,\n delay,\n initialInView,\n fallbackInView,\n ...props\n } = this.props;\n return React.createElement(\n as || \"div\",\n { ref: this.handleNode, ...props },\n children\n );\n }\n};\n\n// src/useInView.tsx\nimport * as React2 from \"react\";\nfunction useInView({\n threshold,\n delay,\n trackVisibility,\n rootMargin,\n root,\n triggerOnce,\n skip,\n initialInView,\n fallbackInView,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = React2.useState(null);\n const callback = React2.useRef(onChange);\n const [state, setState] = React2.useState({\n inView: !!initialInView,\n entry: void 0\n });\n callback.current = onChange;\n React2.useEffect(\n () => {\n if (skip || !ref) return;\n let unobserve;\n unobserve = observe(\n ref,\n (inView, entry) => {\n setState({\n inView,\n entry\n });\n if (callback.current) callback.current(inView, entry);\n if (entry.isIntersecting && triggerOnce && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n },\n {\n root,\n rootMargin,\n threshold,\n // @ts-ignore\n trackVisibility,\n // @ts-ignore\n delay\n },\n fallbackInView\n );\n return () => {\n if (unobserve) {\n unobserve();\n }\n };\n },\n // We break the rule here, because we aren't including the actual `threshold` variable\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n // If the threshold is an array, convert it to a string, so it won't change between renders.\n Array.isArray(threshold) ? threshold.toString() : threshold,\n ref,\n root,\n rootMargin,\n triggerOnce,\n skip,\n trackVisibility,\n fallbackInView,\n delay\n ]\n );\n const entryTarget = (_a = state.entry) == null ? void 0 : _a.target;\n const previousEntryTarget = React2.useRef(void 0);\n if (!ref && entryTarget && !triggerOnce && !skip && previousEntryTarget.current !== entryTarget) {\n previousEntryTarget.current = entryTarget;\n setState({\n inView: !!initialInView,\n entry: void 0\n });\n }\n const result = [setRef, state.inView, state.entry];\n result.ref = result[0];\n result.inView = result[1];\n result.entry = result[2];\n return result;\n}\nexport {\n InView,\n defaultFallbackInView,\n observe,\n useInView\n};\n//# sourceMappingURL=index.mjs.map","/*\n Rendered but hidden. Only show when visible\n*/\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useInView } from 'react-intersection-observer';\n\n// The sticky header, usually at the top\nconst TOP = 48;\n\nconst shazamIDs = {};\n\nexport default function LazyShazam({ id, children }) {\n const containerRef = useRef();\n const hasID = !!shazamIDs[id];\n const [visible, setVisible] = useState(false);\n const [visibleStart, setVisibleStart] = useState(hasID || false);\n\n const { ref } = useInView({\n root: null,\n rootMargin: `-${TOP}px 0px 0px 0px`,\n trackVisibility: true,\n delay: 1000,\n onChange: (inView) => {\n if (inView) {\n setVisible(true);\n if (id) shazamIDs[id] = true;\n }\n },\n triggerOnce: true,\n skip: visibleStart || visible,\n });\n\n useEffect(() => {\n if (!containerRef.current) return;\n const rect = containerRef.current.getBoundingClientRect();\n if (rect.bottom > TOP) {\n if (rect.top < window.innerHeight) {\n setVisible(true);\n } else {\n setVisibleStart(true);\n }\n if (id) shazamIDs[id] = true;\n }\n }, []);\n\n if (visibleStart) return children;\n\n return (\n <div\n ref={containerRef}\n class=\"shazam-container no-animation\"\n hidden={!visible}\n >\n <div ref={ref} class=\"shazam-container-inner\">\n {children}\n </div>\n </div>\n );\n}\n","import './translation-block.css';\n\nimport { Trans, useLingui } from '@lingui/react/macro';\nimport pRetry from 'p-retry';\nimport pThrottle from 'p-throttle';\nimport { useEffect, useRef, useState } from 'preact/hooks';\n\nimport languages from '../data/translang-languages';\nimport {\n translate as browserTranslate,\n supportsBrowserTranslator,\n} from '../utils/browser-translator';\nimport getTranslateTargetLanguage from '../utils/get-translate-target-language';\nimport localeCode2Text from '../utils/localeCode2Text';\nimport pmem from '../utils/pmem';\n\nimport Icon from './icon';\nimport LazyShazam from './lazy-shazam';\nimport Loader from './loader';\n\nconst sourceLanguages = Object.entries(languages.sl).map(([code, name]) => ({\n code,\n name,\n}));\n\nconst { PHANPY_TRANSLANG_INSTANCES } = import.meta.env;\nconst TRANSLANG_INSTANCES = PHANPY_TRANSLANG_INSTANCES\n ? PHANPY_TRANSLANG_INSTANCES.split(/\\s+/)\n : [];\n\nconst throttle = pThrottle({\n limit: 1,\n interval: 2000,\n});\n\nconst TRANSLATED_MAX_AGE = 1000 * 60 * 60; // 1 hour\nlet currentTranslangInstance = 0;\n\nfunction _translangTranslate(text, source, target) {\n console.log('TRANSLATE', text, source, target);\n const fetchCall = () => {\n let instance = TRANSLANG_INSTANCES[currentTranslangInstance];\n const tooLong = text.length > 2000;\n let fetchPromise;\n if (tooLong) {\n // POST\n fetchPromise = fetch(`https://${instance}/api/v1/translate`, {\n method: 'POST',\n priority: 'low',\n referrerPolicy: 'no-referrer',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n sl: source,\n tl: target,\n text,\n }),\n });\n } else {\n // GET\n fetchPromise = fetch(\n `https://${instance}/api/v1/translate?sl=${encodeURIComponent(source)}&tl=${encodeURIComponent(target)}&text=${encodeURIComponent(text)}`,\n {\n priority: 'low',\n referrerPolicy: 'no-referrer',\n },\n );\n }\n return fetchPromise\n .then((res) => {\n if (!res.ok) throw new Error(res.statusText);\n return res.json();\n })\n .then((res) => {\n return {\n provider: 'translang',\n content: res.translated_text,\n detectedSourceLanguage: res.detected_language,\n pronunciation: res.pronunciation,\n };\n });\n };\n return pRetry(fetchCall, {\n retries: 3,\n onFailedAttempt: (e) => {\n currentTranslangInstance =\n (currentTranslangInstance + 1) % TRANSLANG_INSTANCES.length;\n console.log(\n 'Retrying translation with another instance',\n currentTranslangInstance,\n );\n },\n });\n}\nconst translangTranslate = pmem(_translangTranslate, {\n maxAge: TRANSLATED_MAX_AGE,\n});\nconst throttledTranslangTranslate = pmem(throttle(translangTranslate), {\n // I know, this is double-layered memoization\n maxAge: TRANSLATED_MAX_AGE,\n});\n\nfunction TranslationBlock({\n forceTranslate,\n sourceLanguage,\n onTranslate,\n text = '',\n mini,\n autoDetected,\n}) {\n const { t } = useLingui();\n const targetLang = getTranslateTargetLanguage(true);\n const [uiState, setUIState] = useState('default');\n const [pronunciationContent, setPronunciationContent] = useState(null);\n const [translatedContent, setTranslatedContent] = useState(null);\n const [detectedLang, setDetectedLang] = useState(null);\n const detailsRef = useRef();\n\n const sourceLangText = sourceLanguage\n ? localeCode2Text(sourceLanguage)\n : null;\n const targetLangText = localeCode2Text(targetLang);\n const apiSourceLang = useRef('auto');\n\n if (!onTranslate) {\n onTranslate = async (...args) => {\n if (supportsBrowserTranslator) {\n const result = await browserTranslate(...args);\n if (result && !result.error) {\n return result;\n }\n }\n return mini\n ? await throttledTranslangTranslate(...args)\n : await translangTranslate(...args);\n };\n }\n\n const translate = async () => {\n setUIState('loading');\n try {\n const { content, detectedSourceLanguage, provider, error, ...props } =\n await onTranslate(text, apiSourceLang.current, targetLang);\n if (content) {\n if (detectedSourceLanguage) {\n const detectedLangText = localeCode2Text(detectedSourceLanguage);\n setDetectedLang(detectedLangText);\n }\n if (provider === 'translang') {\n const pronunciation = props?.pronunciation;\n if (pronunciation) {\n setPronunciationContent(pronunciation);\n }\n }\n setTranslatedContent(content);\n setUIState('default');\n if (!mini && content.trim() !== text.trim()) {\n detailsRef.current.open = true;\n detailsRef.current.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n });\n }\n } else {\n if (error) console.error(error);\n setUIState('error');\n }\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n };\n\n useEffect(() => {\n if (forceTranslate) {\n translate();\n }\n }, [forceTranslate]);\n\n if (mini) {\n if (\n !!translatedContent &&\n translatedContent.trim() !== text.trim() &&\n detectedLang !== targetLangText\n ) {\n return (\n <LazyShazam>\n <div class=\"status-translation-block-mini\">\n <Icon\n icon=\"translate\"\n alt={t`Auto-translated from ${sourceLangText}`}\n />\n <output\n lang={targetLang}\n dir=\"auto\"\n title={pronunciationContent || ''}\n >\n {translatedContent}\n </output>\n </div>\n </LazyShazam>\n );\n }\n return null;\n }\n\n return (\n <div\n class=\"status-translation-block\"\n onClick={(e) => {\n e.preventDefault();\n }}\n >\n <details ref={detailsRef}>\n <summary>\n <button\n type=\"button\"\n onClick={async (e) => {\n e.preventDefault();\n e.stopPropagation();\n detailsRef.current.open = !detailsRef.current.open;\n if (uiState === 'loading') return;\n if (!translatedContent) translate();\n }}\n >\n <Icon icon=\"translate\" />{' '}\n <span>\n {uiState === 'loading'\n ? t`Translating…`\n : sourceLanguage && sourceLangText && !detectedLang\n ? autoDetected\n ? t`Translate from ${sourceLangText} (auto-detected)`\n : t`Translate from ${sourceLangText}`\n : t`Translate`}\n </span>\n </button>\n </summary>\n <div class=\"translated-block\">\n <div class=\"translation-info insignificant\">\n <select\n class=\"translated-source-select\"\n disabled={uiState === 'loading'}\n onChange={(e) => {\n apiSourceLang.current = e.target.value;\n translate();\n }}\n >\n {sourceLanguages.map((l) => {\n const common = localeCode2Text({\n code: l.code,\n fallback: l.name,\n });\n const native = localeCode2Text({\n code: l.code,\n locale: l.code,\n });\n const showCommon = native && common !== native;\n return (\n <option value={l.code}>\n {l.code === 'auto'\n ? t`Auto (${detectedLang ?? '…'})`\n : showCommon\n ? `${native} - ${common}`\n : common}\n </option>\n );\n })}\n </select>{' '}\n <span>→ {targetLangText}</span>\n <Loader abrupt hidden={uiState !== 'loading'} />\n </div>\n {uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Failed to translate</Trans>\n </p>\n ) : (\n !!translatedContent && (\n <>\n <output class=\"translated-content\" lang={targetLang} dir=\"auto\">\n {translatedContent}\n </output>\n {!!pronunciationContent && (\n <output\n class=\"translated-pronunciation-content\"\n tabIndex={-1}\n onClick={(e) => {\n e.target.classList.toggle('expand');\n }}\n >\n {pronunciationContent}\n </output>\n )}\n </>\n )\n )}\n </div>\n </details>\n </div>\n );\n}\n\nexport default TRANSLANG_INSTANCES?.length ? TranslationBlock : () => null;\n","function promisifyRequest(request) {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\nfunction createStore(dbName, storeName) {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\n return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));\n}\nlet defaultGetStoreFunc;\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore('keyval-store', 'keyval');\n }\n return defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction get(key, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => promisifyRequest(store.get(key)));\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction set(key, value, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction setMany(entries, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n entries.forEach((entry) => store.put(entry[1], entry[0]));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction getMany(keys, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => Promise.all(keys.map((key) => promisifyRequest(store.get(key)))));\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction update(key, updater, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => \n // Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise((resolve, reject) => {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n }\n catch (err) {\n reject(err);\n }\n };\n }));\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction del(key, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction delMany(keys, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n keys.forEach((key) => store.delete(key));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction clear(customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\nfunction eachCursor(store, callback) {\n store.openCursor().onsuccess = function () {\n if (!this.result)\n return;\n callback(this.result);\n this.result.continue();\n };\n return promisifyRequest(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction keys(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(store.getAllKeys());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.key)).then(() => items);\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction values(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.value)).then(() => items);\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction entries(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([\n promisifyRequest(store.getAllKeys()),\n promisifyRequest(store.getAll()),\n ]).then(([keys, values]) => keys.map((key, i) => [key, values[i]]));\n }\n const items = [];\n return customStore('readonly', (store) => eachCursor(store, (cursor) => items.push([cursor.key, cursor.value])).then(() => items));\n });\n}\n\nexport { clear, createStore, del, delMany, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\n","import {\n clear,\n createStore,\n del,\n delMany,\n get,\n getMany,\n keys,\n set,\n} from 'idb-keyval';\n\nfunction initDB(dbName, storeName) {\n const store = createStore(dbName, storeName);\n return {\n set: (key, val) => set(key, val, store),\n get: (key) => get(key, store),\n getMany: (keys) => getMany(keys, store),\n del: (key) => del(key, store),\n delMany: (keys) => delMany(keys, store),\n clear: () => clear(store),\n keys: () => keys(store),\n };\n}\n\nexport default {\n drafts: initDB('drafts-db', 'drafts-store'),\n catchup: initDB('catchup-db', 'catchup-store'),\n};\n","import { api } from './api';\nimport { getCurrentAccountID } from './store-utils';\n\nexport async function fetchRelationships(accounts, relationshipsMap = {}) {\n if (!accounts?.length) return;\n const { masto } = api();\n\n const currentAccount = getCurrentAccountID();\n const uniqueAccountIds = accounts.reduce((acc, a) => {\n // 1. Ignore duplicate accounts\n // 2. Ignore accounts that are already inside relationshipsMap\n // 3. Ignore currently logged in account\n if (\n !acc.includes(a.id) &&\n !relationshipsMap[a.id] &&\n a.id !== currentAccount\n ) {\n acc.push(a.id);\n }\n return acc;\n }, []);\n if (!uniqueAccountIds.length) return null;\n\n try {\n const relationships = await masto.v1.accounts.relationships.fetch({\n id: uniqueAccountIds,\n });\n const newRelationshipsMap = relationships.reduce((acc, r) => {\n acc[r.id] = r;\n return acc;\n }, {});\n return newRelationshipsMap;\n } catch (e) {\n console.error(e);\n // It's okay to fail\n return null;\n }\n}\n","export class LiteYTEmbed extends HTMLElement {\n constructor() {\n super();\n this.isIframeLoaded = false;\n this.setupDom();\n }\n static get observedAttributes() {\n return ['videoid', 'playlistid', 'videoplay', 'videotitle'];\n }\n connectedCallback() {\n this.addEventListener('pointerover', () => LiteYTEmbed.warmConnections(this), {\n once: true,\n });\n this.addEventListener('click', () => this.addIframe());\n }\n get videoId() {\n return encodeURIComponent(this.getAttribute('videoid') || '');\n }\n set videoId(id) {\n this.setAttribute('videoid', id);\n }\n get playlistId() {\n return encodeURIComponent(this.getAttribute('playlistid') || '');\n }\n set playlistId(id) {\n this.setAttribute('playlistid', id);\n }\n get videoTitle() {\n return this.getAttribute('videotitle') || 'Video';\n }\n set videoTitle(title) {\n this.setAttribute('videotitle', title);\n }\n get videoPlay() {\n return this.getAttribute('videoplay') || 'Play';\n }\n set videoPlay(name) {\n this.setAttribute('videoplay', name);\n }\n get videoStartAt() {\n return this.getAttribute('videoStartAt') || '0';\n }\n get autoLoad() {\n return this.hasAttribute('autoload');\n }\n get autoPause() {\n return this.hasAttribute('autopause');\n }\n get noCookie() {\n return this.hasAttribute('nocookie');\n }\n get posterQuality() {\n return this.getAttribute('posterquality') || 'hqdefault';\n }\n get posterLoading() {\n return (this.getAttribute('posterloading') ||\n 'lazy');\n }\n get params() {\n return `start=${this.videoStartAt}&${this.getAttribute('params')}`;\n }\n set params(opts) {\n this.setAttribute('params', opts);\n }\n set posterQuality(opts) {\n this.setAttribute('posterquality', opts);\n }\n get disableNoscript() {\n return this.hasAttribute('disablenoscript');\n }\n setupDom() {\n const shadowDom = this.attachShadow({ mode: 'open' });\n let nonce = '';\n if (window.liteYouTubeNonce) {\n nonce = `nonce=\"${window.liteYouTubeNonce}\"`;\n }\n shadowDom.innerHTML = `\n <style ${nonce}>\n :host {\n --aspect-ratio: var(--lite-youtube-aspect-ratio, 16 / 9);\n --aspect-ratio-short: var(--lite-youtube-aspect-ratio-short, 9 / 16);\n --frame-shadow-visible: var(--lite-youtube-frame-shadow-visible, yes);\n contain: content;\n display: block;\n position: relative;\n width: 100%;\n aspect-ratio: var(--aspect-ratio);\n }\n\n @media (max-width: 40em) {\n :host([short]) {\n aspect-ratio: var(--aspect-ratio-short);\n }\n }\n\n #frame, #fallbackPlaceholder, iframe {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n }\n\n #frame {\n cursor: pointer;\n }\n\n #fallbackPlaceholder, slot[name=image]::slotted(*) {\n object-fit: cover;\n width: 100%;\n }\n\n @container style(--frame-shadow-visible: yes) {\n #frame::before {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n background-image: linear-gradient(180deg, #111 -20%, transparent 90%);\n height: 60px;\n width: 100%;\n z-index: 1;\n }\n }\n\n #playButton {\n width: 68px;\n height: 48px;\n background-color: transparent;\n background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 68 48\"><path d=\"M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z\" fill=\"red\"/><path d=\"M45 24 27 14v20\" fill=\"white\"/></svg>');\n z-index: 1;\n border: 0;\n border-radius: inherit;\n }\n\n #playButton:before {\n content: '';\n border-style: solid;\n border-width: 11px 0 11px 19px;\n border-color: transparent transparent transparent #fff;\n }\n\n #playButton,\n #playButton:before {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate3d(-50%, -50%, 0);\n cursor: inherit;\n }\n\n /* Post-click styles */\n .activated {\n cursor: unset;\n }\n\n #frame.activated::before,\n #frame.activated > #playButton {\n display: none;\n }\n </style>\n <div id=\"frame\">\n <picture>\n <slot name=\"image\">\n <source id=\"webpPlaceholder\" type=\"image/webp\">\n <source id=\"jpegPlaceholder\" type=\"image/jpeg\">\n <img id=\"fallbackPlaceholder\" referrerpolicy=\"origin\" loading=\"lazy\">\n </slot>\n </picture>\n <button id=\"playButton\"></button>\n </div>\n `;\n this.domRefFrame = shadowDom.querySelector('#frame');\n this.domRefImg = {\n fallback: shadowDom.querySelector('#fallbackPlaceholder'),\n webp: shadowDom.querySelector('#webpPlaceholder'),\n jpeg: shadowDom.querySelector('#jpegPlaceholder'),\n };\n this.domRefPlayButton = shadowDom.querySelector('#playButton');\n }\n setupComponent() {\n const hasImgSlot = this.shadowRoot.querySelector('slot[name=image]');\n if (hasImgSlot.assignedNodes().length === 0) {\n this.initImagePlaceholder();\n }\n this.domRefPlayButton.setAttribute('aria-label', `${this.videoPlay}: ${this.videoTitle}`);\n this.setAttribute('title', `${this.videoPlay}: ${this.videoTitle}`);\n if (this.autoLoad || this.isYouTubeShort() || this.autoPause) {\n this.initIntersectionObserver();\n }\n if (!this.disableNoscript) {\n this.injectSearchNoScript();\n }\n }\n attributeChangedCallback(name, oldVal, newVal) {\n if (oldVal !== newVal) {\n this.setupComponent();\n if (this.domRefFrame.classList.contains('activated')) {\n this.domRefFrame.classList.remove('activated');\n this.shadowRoot.querySelector('iframe').remove();\n this.isIframeLoaded = false;\n }\n }\n }\n injectSearchNoScript() {\n const eleNoScript = document.createElement('noscript');\n this.prepend(eleNoScript);\n eleNoScript.innerHTML = this.generateIframe();\n }\n generateIframe(isIntersectionObserver = false) {\n let autoplay = isIntersectionObserver ? 0 : 1;\n const wantsNoCookie = this.noCookie ? '-nocookie' : '';\n let embedTarget;\n if (this.playlistId) {\n embedTarget = `?listType=playlist&list=${this.playlistId}&`;\n }\n else {\n embedTarget = `${this.videoId}?`;\n }\n if (this.autoPause) {\n this.params = `enablejsapi=1`;\n }\n if (this.isYouTubeShort()) {\n this.params = `loop=1&mute=1&modestbranding=1&playsinline=1&rel=0&enablejsapi=1&playlist=${this.videoId}`;\n autoplay = 1;\n }\n return `\n<iframe credentialless frameborder=\"0\" title=\"${this.videoTitle}\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen\n src=\"https://www.youtube${wantsNoCookie}.com/embed/${embedTarget}autoplay=${autoplay}&${this.params}\"\n></iframe>`;\n }\n addIframe(isIntersectionObserver = false) {\n if (!this.isIframeLoaded) {\n const iframeHTML = this.generateIframe(isIntersectionObserver);\n this.domRefFrame.insertAdjacentHTML('beforeend', iframeHTML);\n this.domRefFrame.classList.add('activated');\n this.isIframeLoaded = true;\n this.attemptShortAutoPlay();\n this.dispatchEvent(new CustomEvent('liteYoutubeIframeLoaded', {\n detail: {\n videoId: this.videoId,\n },\n bubbles: true,\n cancelable: true,\n }));\n }\n }\n initImagePlaceholder() {\n this.testPosterImage();\n this.domRefImg.fallback.setAttribute('aria-label', `${this.videoPlay}: ${this.videoTitle}`);\n this.domRefImg?.fallback?.setAttribute('alt', `${this.videoPlay}: ${this.videoTitle}`);\n }\n async testPosterImage() {\n setTimeout(() => {\n const webpUrl = `https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`;\n const img = new Image();\n img.fetchPriority = 'low';\n img.referrerPolicy = 'origin';\n img.src = webpUrl;\n img.onload = async (e) => {\n const target = e.target;\n const noPoster = target?.naturalHeight == 90 && target?.naturalWidth == 120;\n if (noPoster) {\n this.posterQuality = 'hqdefault';\n }\n const posterUrlWebp = `https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`;\n this.domRefImg.webp.srcset = posterUrlWebp;\n const posterUrlJpeg = `https://i.ytimg.com/vi/${this.videoId}/${this.posterQuality}.jpg`;\n this.domRefImg.fallback.loading = this.posterLoading;\n this.domRefImg.jpeg.srcset = posterUrlJpeg;\n this.domRefImg.fallback.src = posterUrlJpeg;\n this.domRefImg.fallback.loading = this.posterLoading;\n };\n }, 100);\n }\n initIntersectionObserver() {\n const options = {\n root: null,\n rootMargin: '0px',\n threshold: 0,\n };\n const observer = new IntersectionObserver((entries, observer) => {\n entries.forEach(entry => {\n if (entry.isIntersecting && !this.isIframeLoaded) {\n LiteYTEmbed.warmConnections(this);\n this.addIframe(true);\n observer.unobserve(this);\n }\n });\n }, options);\n observer.observe(this);\n if (this.autoPause) {\n const windowPause = new IntersectionObserver((e, o) => {\n e.forEach(entry => {\n if (entry.intersectionRatio !== 1) {\n this.shadowRoot\n .querySelector('iframe')\n ?.contentWindow?.postMessage('{\"event\":\"command\",\"func\":\"pauseVideo\",\"args\":\"\"}', '*');\n }\n });\n }, { threshold: 1 });\n windowPause.observe(this);\n }\n }\n attemptShortAutoPlay() {\n if (this.isYouTubeShort()) {\n setTimeout(() => {\n this.shadowRoot\n .querySelector('iframe')\n ?.contentWindow?.postMessage('{\"event\":\"command\",\"func\":\"' + 'playVideo' + '\",\"args\":\"\"}', '*');\n }, 2000);\n }\n }\n isYouTubeShort() {\n return (this.getAttribute('short') === '' &&\n window.matchMedia('(max-width: 40em)').matches);\n }\n static addPrefetch(kind, url) {\n const linkElem = document.createElement('link');\n linkElem.rel = kind;\n linkElem.href = url;\n linkElem.crossOrigin = 'true';\n document.head.append(linkElem);\n }\n static warmConnections(context) {\n if (LiteYTEmbed.isPreconnected || window.liteYouTubeIsPreconnected)\n return;\n LiteYTEmbed.addPrefetch('preconnect', 'https://i.ytimg.com/');\n LiteYTEmbed.addPrefetch('preconnect', 'https://s.ytimg.com');\n if (!context.noCookie) {\n LiteYTEmbed.addPrefetch('preconnect', 'https://www.youtube.com');\n LiteYTEmbed.addPrefetch('preconnect', 'https://www.google.com');\n LiteYTEmbed.addPrefetch('preconnect', 'https://googleads.g.doubleclick.net');\n LiteYTEmbed.addPrefetch('preconnect', 'https://static.doubleclick.net');\n }\n else {\n LiteYTEmbed.addPrefetch('preconnect', 'https://www.youtube-nocookie.com');\n }\n LiteYTEmbed.isPreconnected = true;\n window.liteYouTubeIsPreconnected = true;\n }\n}\nLiteYTEmbed.isPreconnected = false;\ncustomElements.define('lite-youtube', LiteYTEmbed);\n//# sourceMappingURL=lite-youtube.js.map","const digitLookup = new Uint8Array(128);\nfor (let i = 0; i < 83; i++) {\n digitLookup[\n '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~'.charCodeAt(\n i,\n )\n ] = i;\n}\nconst decode83 = (str, start, end) => {\n let value = 0;\n while (start < end) {\n value *= 83;\n value += digitLookup[str.charCodeAt(start++)];\n }\n return value;\n};\n\nconst pow = Math.pow;\nconst PI = Math.PI;\nconst PI2 = PI * 2;\n\nconst d = 3294.6;\nconst e = 269.025;\nconst sRGBToLinear = (value) =>\n value > 10.31475 ? pow(value / e + 0.052132, 2.4) : value / d;\n\nconst linearTosRGB = (v) =>\n ~~(v > 0.00001227 ? e * pow(v, 0.416666) - 13.025 : v * d + 1);\n\nconst signSqr = (x) => (x < 0 ? -1 : 1) * x * x;\n\n/**\n * Fast approximate cosine implementation\n * Based on FTrig https://github.com/netcell/FTrig\n */\nconst fastCos = (x) => {\n x += PI / 2;\n while (x > PI) {\n x -= PI2;\n }\n const cos = 1.27323954 * x - 0.405284735 * signSqr(x);\n return 0.225 * (signSqr(cos) - cos) + cos;\n};\n\n/**\n * Extracts average color from BlurHash image\n * @param {string} blurHash BlurHash image string\n * @returns {[number, number, number]}\n */\nexport function getBlurHashAverageColor(blurHash) {\n const val = decode83(blurHash, 2, 6);\n return [val >> 16, (val >> 8) & 255, val & 255];\n}\n\n/**\n * Decodes BlurHash image\n * @param {string} blurHash BlurHash image string\n * @param {number} width Output image width\n * @param {number} height Output image height\n * @param {?number} punch\n * @returns {Uint8ClampedArray}\n */\nexport function decodeBlurHash(blurHash, width, height, punch) {\n const sizeFlag = decode83(blurHash, 0, 1);\n const numX = (sizeFlag % 9) + 1;\n const numY = ~~(sizeFlag / 9) + 1;\n const size = numX * numY;\n\n let i = 0,\n j = 0,\n x = 0,\n y = 0,\n r = 0,\n g = 0,\n b = 0,\n basis = 0,\n basisY = 0,\n colorIndex = 0,\n pixelIndex = 0,\n value = 0;\n\n const maximumValue = ((decode83(blurHash, 1, 2) + 1) / 13446) * (punch | 1);\n\n const colors = new Float64Array(size * 3);\n\n const averageColor = getBlurHashAverageColor(blurHash);\n for (i = 0; i < 3; i++) {\n colors[i] = sRGBToLinear(averageColor[i]);\n }\n\n for (i = 1; i < size; i++) {\n value = decode83(blurHash, 4 + i * 2, 6 + i * 2);\n colors[i * 3] = signSqr(~~(value / 361) - 9) * maximumValue;\n colors[i * 3 + 1] = signSqr((~~(value / 19) % 19) - 9) * maximumValue;\n colors[i * 3 + 2] = signSqr((value % 19) - 9) * maximumValue;\n }\n\n const cosinesY = new Float64Array(numY * height);\n const cosinesX = new Float64Array(numX * width);\n for (j = 0; j < numY; j++) {\n for (y = 0; y < height; y++) {\n cosinesY[j * height + y] = fastCos((PI * y * j) / height);\n }\n }\n for (i = 0; i < numX; i++) {\n for (x = 0; x < width; x++) {\n cosinesX[i * width + x] = fastCos((PI * x * i) / width);\n }\n }\n\n const bytesPerRow = width * 4;\n const pixels = new Uint8ClampedArray(bytesPerRow * height);\n\n for (y = 0; y < height; y++) {\n for (x = 0; x < width; x++) {\n r = g = b = 0;\n for (j = 0; j < numY; j++) {\n basisY = cosinesY[j * height + y];\n for (i = 0; i < numX; i++) {\n basis = cosinesX[i * width + x] * basisY;\n colorIndex = (i + j * numX) * 3;\n r += colors[colorIndex] * basis;\n g += colors[colorIndex + 1] * basis;\n b += colors[colorIndex + 2] * basis;\n }\n }\n\n pixelIndex = 4 * x + y * bytesPerRow;\n pixels[pixelIndex] = linearTosRGB(r);\n pixels[pixelIndex + 1] = linearTosRGB(g);\n pixels[pixelIndex + 2] = linearTosRGB(b);\n pixels[pixelIndex + 3] = 255; // alpha\n }\n }\n return pixels;\n}\n","/**\n * @param {string[]} splittedHtml\n * @param {{ char?: string; count?: number}} options\n * @returns {string}\n */\nconst addIndentation = (splittedHtml, options = {}) => {\n const char = options.char || ' '\n const count = options.count || 2\n\n let level = 0\n const opened = []\n\n return splittedHtml.reverse().reduce((indented, elTag) => {\n if (opened.length\n && level\n && opened[level]\n /* if current element tag is the same as previously opened one */\n && opened[level] === elTag.substring(1, opened[level].length + 1)\n ) {\n opened.splice(level, 1)\n level--\n }\n\n const indentation = char.repeat(level ? level * count : 0)\n\n const newIndented = [\n `${indentation}${elTag}`,\n ...indented,\n ]\n\n // if current element tag is closing tag\n // add it to opened elements\n if (elTag.substring(0, 2) === '</') {\n level++\n opened[level] = elTag.substring(2, elTag.length - 1)\n }\n\n return newIndented\n }, []).join('\\n')\n}\n\nmodule.exports = addIndentation\n","/**\n * @param {string} nonFormattedString Any non formatted string\n * @returns {string[]} Array of strings separated on new lines\n */\nconst removeEmptyLines = (nonFormattedString) => (\n // Replace\n // - 1 or more spaces or tabs at the start of line\n // - 1 or more spaces or tabs at the end of line\n // - empty lines\n // with empty string\n nonFormattedString.trim().replace(/(^(\\s|\\t)+|(( |\\t)+)$)/gm, '')\n)\n\n/**\n * @param {string} markup\n * @returns {string[]} Array of strings splitted on new lines without empty lines\n */\nconst mergeAttributesWithElements = (markup) => {\n const splittedMarkup = removeEmptyLines(markup).split('\\n')\n\n const mergedLines = []\n let currentElement = ''\n for (let i = 0; i < splittedMarkup.length; i += 1) {\n const line = splittedMarkup[i]\n\n // If line is closing element/tag separate closing tag from rest of the line with space\n if (line.endsWith('/>')) {\n mergedLines.push(`${currentElement}${line.slice(0, -2)} />`)\n currentElement = ''\n // eslint-disable-next-line no-continue\n continue\n }\n\n if (line.endsWith('>')) {\n mergedLines.push(`${currentElement}${\n line.startsWith('>') || line.startsWith('<') ? '' : ' '\n }${line}`)\n currentElement = ''\n // eslint-disable-next-line no-continue\n continue\n }\n\n currentElement += currentElement.length ? ` ${line}` : line\n }\n\n return mergedLines\n}\n\nmodule.exports = {\n mergeAttributesWithElements,\n removeEmptyLines,\n}\n","const addIndentation = require('./utils/addIndentation')\nconst { mergeAttributesWithElements } = require('./utils/toLines')\n\n/**\n * @param {string} markup\n * @param {{ char?: string; count?: number }} options\n * @returns {string}\n */\nconst prettify = (markup, options = {}) => {\n const splitted = mergeAttributesWithElements(markup)\n\n return addIndentation(splitted, options)\n}\n\nmodule.exports = prettify\n","import { i18n } from '@lingui/core';\nimport { plural } from '@lingui/core/macro';\nimport { Plural, Trans, useLingui } from '@lingui/react/macro';\nimport { useState } from 'preact/hooks';\n\nimport shortenNumber from '../utils/shorten-number';\n\nimport EmojiText from './emoji-text';\nimport Icon from './icon';\nimport RelativeTime from './relative-time';\n\nexport default function Poll({\n poll,\n lang,\n readOnly,\n refresh = () => {},\n votePoll = () => {},\n}) {\n const { t } = useLingui();\n const [uiState, setUIState] = useState('default');\n const {\n expired,\n expiresAt,\n id,\n multiple,\n options,\n ownVotes,\n voted,\n votersCount,\n votesCount = 0,\n emojis,\n } = poll;\n const expiresAtDate = !!expiresAt && new Date(expiresAt); // Update poll at point of expiry\n // NOTE: Disable this because setTimeout runs immediately if delay is too large\n // https://stackoverflow.com/a/56718027/20838\n // useEffect(() => {\n // let timeout;\n // if (!expired && expiresAtDate) {\n // const ms = expiresAtDate.getTime() - Date.now() + 1; // +1 to give it a little buffer\n // if (ms > 0) {\n // timeout = setTimeout(() => {\n // setUIState('loading');\n // (async () => {\n // // await refresh();\n // setUIState('default');\n // })();\n // }, ms);\n // }\n // }\n // return () => {\n // clearTimeout(timeout);\n // };\n // }, [expired, expiresAtDate]);\n\n const pollVotesCount = multiple ? votersCount : votesCount;\n let roundPrecision = 0;\n\n if (pollVotesCount <= 1000) {\n roundPrecision = 0;\n } else if (pollVotesCount <= 10000) {\n roundPrecision = 1;\n } else if (pollVotesCount <= 100000) {\n roundPrecision = 2;\n }\n\n const [showResults, setShowResults] = useState(false);\n const optionsHaveVoteCounts = options.every((o) => o.votesCount !== null);\n\n return (\n <div\n lang={lang}\n dir=\"auto\"\n class={`poll ${readOnly ? 'read-only' : ''} ${\n uiState === 'loading' ? 'loading' : ''\n }`}\n >\n {(showResults && optionsHaveVoteCounts) || voted || expired ? (\n <>\n <div class=\"poll-options\">\n {options.map((option, i) => {\n const { title, votesCount: optionVotesCount } = option;\n const ratio = pollVotesCount\n ? optionVotesCount / pollVotesCount\n : 0;\n const percentage = ratio\n ? ratio.toLocaleString(i18n.locale || undefined, {\n style: 'percent',\n maximumFractionDigits: roundPrecision,\n })\n : '0%';\n\n const isLeading =\n optionVotesCount > 0 &&\n optionVotesCount ===\n Math.max(...options.map((o) => o.votesCount));\n return (\n <div\n key={`${i}-${title}-${optionVotesCount}`}\n class={`poll-option poll-result ${\n isLeading ? 'poll-option-leading' : ''\n }`}\n style={{\n '--percentage': `${ratio * 100}%`,\n }}\n >\n <div class=\"poll-option-title\">\n <span>\n <EmojiText text={title} emojis={emojis} />\n </span>\n {voted && ownVotes.includes(i) && (\n <>\n {' '}\n <Icon icon=\"check-circle\" alt={t`Voted`} />\n </>\n )}\n </div>\n <div\n class=\"poll-option-votes\"\n title={plural(optionVotesCount, {\n one: `# vote`,\n other: `# votes`,\n })}\n >\n {percentage}\n </div>\n </div>\n );\n })}\n </div>\n {!expired && !voted && (\n <button\n class=\"poll-vote-button plain2\"\n disabled={uiState === 'loading'}\n onClick={(e) => {\n e.preventDefault();\n setShowResults(false);\n }}\n >\n <Icon icon=\"arrow-left\" size=\"s\" /> <Trans>Hide results</Trans>\n </button>\n )}\n </>\n ) : (\n <form\n onSubmit={async (e) => {\n e.preventDefault();\n const form = e.target;\n const formData = new FormData(form);\n const choices = [];\n formData.forEach((value, key) => {\n if (key === 'poll') {\n choices.push(value);\n }\n });\n if (!choices.length) return;\n setUIState('loading');\n await votePoll(choices);\n setUIState('default');\n }}\n >\n <div class=\"poll-options\">\n {options.map((option, i) => {\n const { title } = option;\n return (\n <div class=\"poll-option\">\n <label class=\"poll-label\">\n <input\n type={multiple ? 'checkbox' : 'radio'}\n name=\"poll\"\n value={i}\n disabled={uiState === 'loading'}\n readOnly={readOnly}\n />\n <span class=\"poll-option-title\">\n <EmojiText text={title} emojis={emojis} />\n </span>\n </label>\n </div>\n );\n })}\n </div>\n {!readOnly && (\n <button\n class=\"poll-vote-button\"\n type=\"submit\"\n disabled={uiState === 'loading'}\n >\n <Trans>Vote</Trans>\n </button>\n )}\n </form>\n )}\n <p class=\"poll-meta\">\n {!expired && !readOnly && (\n <button\n type=\"button\"\n class=\"plain small\"\n disabled={uiState === 'loading'}\n onClick={(e) => {\n e.preventDefault();\n setUIState('loading');\n\n (async () => {\n await refresh();\n setUIState('default');\n })();\n }}\n title={t`Refresh`}\n >\n <Icon icon=\"refresh\" alt={t`Refresh`} />\n </button>\n )}\n {!voted && !expired && !readOnly && optionsHaveVoteCounts && (\n <button\n type=\"button\"\n class=\"plain small\"\n disabled={uiState === 'loading'}\n onClick={(e) => {\n e.preventDefault();\n setShowResults(!showResults);\n }}\n title={showResults ? t`Hide results` : t`Show results`}\n >\n <Icon\n icon={showResults ? 'eye-open' : 'eye-close'}\n alt={showResults ? t`Hide results` : t`Show results`}\n />{' '}\n </button>\n )}\n {!expired && !readOnly && ' '}\n <Plural\n value={votesCount}\n one={\n <Trans>\n <span title={votesCount}>{shortenNumber(votesCount)}</span> vote\n </Trans>\n }\n other={\n <Trans>\n <span title={votesCount}>{shortenNumber(votesCount)}</span> votes\n </Trans>\n }\n />\n {!!votersCount && votersCount !== votesCount && (\n <>\n {' '}\n •{' '}\n <Plural\n value={votersCount}\n one={\n <Trans>\n <span title={votersCount}>{shortenNumber(votersCount)}</span>{' '}\n voter\n </Trans>\n }\n other={\n <Trans>\n <span title={votersCount}>{shortenNumber(votersCount)}</span>{' '}\n voters\n </Trans>\n }\n />\n </>\n )}{' '}\n •{' '}\n {expired ? (\n !!expiresAtDate ? (\n <Trans>\n Ended <RelativeTime datetime={expiresAtDate} />\n </Trans>\n ) : (\n t`Ended`\n )\n ) : !!expiresAtDate ? (\n <Trans>\n Ending <RelativeTime datetime={expiresAtDate} />\n </Trans>\n ) : (\n t`Ending`\n )}\n </p>\n </div>\n );\n}\n","import { createContext } from 'preact';\n\nconst FilterContext = createContext();\nexport default FilterContext;\n","import mem from './mem';\nimport { getCurrentAccountID } from './store-utils';\n\nfunction _isFiltered(filtered, filterContext) {\n if (!filtered?.length) return false;\n const appliedFilters = filtered.filter((f) => {\n const { filter } = f;\n const hasContext = filter.context.includes(filterContext);\n if (!hasContext) return false;\n if (!filter.expiresAt) return hasContext;\n return new Date(filter.expiresAt) > new Date();\n });\n if (!appliedFilters.length) return false;\n const isHidden = appliedFilters.some((f) => f.filter.filterAction === 'hide');\n if (isHidden)\n return {\n action: 'hide',\n };\n const isBlur = appliedFilters.every((f) => f.filter.filterAction === 'blur');\n if (isBlur) {\n const filterTitles = appliedFilters.map((f) => f.filter.title);\n return {\n action: 'blur',\n titles: filterTitles,\n titlesStr: filterTitles.join(' • '),\n };\n }\n // const isWarn = appliedFilters.some((f) => f.filter.filterAction === 'warn');\n const isWarn = appliedFilters.some((f) => !!f.filter.filterAction);\n // Re: spec; unknown values for filter_action should be treated as warn.\n if (isWarn) {\n const filterTitles = appliedFilters.map((f) => f.filter.title);\n return {\n action: 'warn',\n titles: filterTitles,\n titlesStr: filterTitles.join(' • '),\n };\n }\n return false;\n}\nexport const isFiltered = mem(_isFiltered);\n\nexport function filteredItem(item, filterContext, currentAccountID) {\n const { filtered } = item;\n if (!filtered?.length) return true;\n const isSelf = currentAccountID && item.account?.id === currentAccountID;\n if (isSelf) return true;\n const filterState = isFiltered(filtered, filterContext);\n if (!filterState) return true;\n if (filterState.action === 'hide') return false;\n // item._filtered = filterState;\n return true;\n}\nexport function filteredItems(items, filterContext) {\n if (!items?.length) return [];\n if (!filterContext) return items;\n const currentAccountID = getCurrentAccountID();\n return items.filter((item) =>\n filteredItem(item, filterContext, currentAccountID),\n );\n}\n","import punycode from 'punycode/';\n\nexport default function getDomain(url) {\n try {\n return punycode.toUnicode(\n URL.parse(url)\n .hostname.replace(/^www\\./, '')\n .replace(/\\/$/, ''),\n );\n } catch (e) {\n return ''; // just give up\n }\n}\n","const div = document.createElement('div');\nexport default function htmlContentLength(html) {\n if (!html) return 0;\n div.innerHTML = html;\n // .invisible spans for links\n // e.g. <span class=\"invisible\">https://</span>mastodon.social\n div.querySelectorAll('.invisible').forEach((el) => {\n el.remove();\n });\n return div.innerText.length;\n}\n","export const supportsTTS = 'speechSynthesis' in window;\n\nexport function speak(text, lang) {\n if (!supportsTTS) return;\n try {\n if (speechSynthesis.speaking) {\n speechSynthesis.cancel();\n }\n const utterance = new SpeechSynthesisUtterance(text);\n if (lang) utterance.lang = lang;\n speechSynthesis.speak(utterance);\n } catch (e) {\n alert(e);\n }\n}\n","import{useRef as r,useEffect as n,useMemo as t,useState as e,useCallback as u}from\"react\";function c(e,u,c){var i=this,a=r(null),o=r(0),f=r(null),l=r([]),v=r(),m=r(),d=r(e),g=r(!0);d.current=e;var p=\"undefined\"!=typeof window,w=!u&&0!==u&&p;if(\"function\"!=typeof e)throw new TypeError(\"Expected a function\");u=+u||0;var s=!!(c=c||{}).leading,x=!(\"trailing\"in c)||!!c.trailing,h=\"maxWait\"in c,y=\"debounceOnServer\"in c&&!!c.debounceOnServer,F=h?Math.max(+c.maxWait||0,u):null;n(function(){return g.current=!0,function(){g.current=!1}},[]);var A=t(function(){var r=function(r){var n=l.current,t=v.current;return l.current=v.current=null,o.current=r,m.current=d.current.apply(t,n)},n=function(r,n){w&&cancelAnimationFrame(f.current),f.current=w?requestAnimationFrame(r):setTimeout(r,n)},t=function(r){if(!g.current)return!1;var n=r-a.current;return!a.current||n>=u||n<0||h&&r-o.current>=F},e=function(n){return f.current=null,x&&l.current?r(n):(l.current=v.current=null,m.current)},c=function r(){var c=Date.now();if(t(c))return e(c);if(g.current){var i=u-(c-a.current),f=h?Math.min(i,F-(c-o.current)):i;n(r,f)}},A=function(){if(p||y){var e=Date.now(),d=t(e);if(l.current=[].slice.call(arguments),v.current=i,a.current=e,d){if(!f.current&&g.current)return o.current=a.current,n(c,u),s?r(a.current):m.current;if(h)return n(c,u),r(a.current)}return f.current||n(c,u),m.current}};return A.cancel=function(){f.current&&(w?cancelAnimationFrame(f.current):clearTimeout(f.current)),o.current=0,l.current=a.current=v.current=f.current=null},A.isPending=function(){return!!f.current},A.flush=function(){return f.current?e(Date.now()):m.current},A},[s,h,u,F,x,w,p,y]);return A}function i(r,n){return r===n}function a(n,t,a){var o=a&&a.equalityFn||i,f=r(n),l=e({})[1],v=c(u(function(r){f.current=r,l({})},[l]),t,a),m=r(n);return o(m.current,n)||(v(n),m.current=n),[f.current,v]}function o(r,n,t){var e=void 0===t?{}:t,u=e.leading,i=e.trailing;return c(r,n,{maxWait:n,leading:void 0===u||u,trailing:void 0===i||i})}export{a as useDebounce,c as useDebouncedCallback,o as useThrottledCallback};\n//# sourceMappingURL=index.module.js.map\n","import { useRef, useEffect, useCallback, useState, useMemo } from 'react';\n\n// This could've been more streamlined with internal state instead of abusing\n// refs to such extent, but then composing hooks and components could not opt out of unnecessary renders.\nfunction useResolvedElement(subscriber, refOrElement) {\n var lastReportRef = useRef(null);\n var refOrElementRef = useRef(null);\n refOrElementRef.current = refOrElement;\n var cbElementRef = useRef(null); // Calling re-evaluation after each render without using a dep array,\n // as the ref object's current value could've changed since the last render.\n\n useEffect(function () {\n evaluateSubscription();\n });\n var evaluateSubscription = useCallback(function () {\n var cbElement = cbElementRef.current;\n var refOrElement = refOrElementRef.current; // Ugly ternary. But smaller than an if-else block.\n\n var element = cbElement ? cbElement : refOrElement ? refOrElement instanceof Element ? refOrElement : refOrElement.current : null;\n\n if (lastReportRef.current && lastReportRef.current.element === element && lastReportRef.current.subscriber === subscriber) {\n return;\n }\n\n if (lastReportRef.current && lastReportRef.current.cleanup) {\n lastReportRef.current.cleanup();\n }\n\n lastReportRef.current = {\n element: element,\n subscriber: subscriber,\n // Only calling the subscriber, if there's an actual element to report.\n // Setting cleanup to undefined unless a subscriber returns one, as an existing cleanup function would've been just called.\n cleanup: element ? subscriber(element) : undefined\n };\n }, [subscriber]); // making sure we call the cleanup function on unmount\n\n useEffect(function () {\n return function () {\n if (lastReportRef.current && lastReportRef.current.cleanup) {\n lastReportRef.current.cleanup();\n lastReportRef.current = null;\n }\n };\n }, []);\n return useCallback(function (element) {\n cbElementRef.current = element;\n evaluateSubscription();\n }, [evaluateSubscription]);\n}\n\n// We're only using the first element of the size sequences, until future versions of the spec solidify on how\n// exactly it'll be used for fragments in multi-column scenarios:\n// From the spec:\n// > The box size properties are exposed as FrozenArray in order to support elements that have multiple fragments,\n// > which occur in multi-column scenarios. However the current definitions of content rect and border box do not\n// > mention how those boxes are affected by multi-column layout. In this spec, there will only be a single\n// > ResizeObserverSize returned in the FrozenArray, which will correspond to the dimensions of the first column.\n// > A future version of this spec will extend the returned FrozenArray to contain the per-fragment size information.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-entry-interface)\n//\n// Also, testing these new box options revealed that in both Chrome and FF everything is returned in the callback,\n// regardless of the \"box\" option.\n// The spec states the following on this:\n// > This does not have any impact on which box dimensions are returned to the defined callback when the event\n// > is fired, it solely defines which box the author wishes to observe layout changes on.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-interface)\n// I'm not exactly clear on what this means, especially when you consider a later section stating the following:\n// > This section is non-normative. An author may desire to observe more than one CSS box.\n// > In this case, author will need to use multiple ResizeObservers.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-interface)\n// Which is clearly not how current browser implementations behave, and seems to contradict the previous quote.\n// For this reason I decided to only return the requested size,\n// even though it seems we have access to results for all box types.\n// This also means that we get to keep the current api, being able to return a simple { width, height } pair,\n// regardless of box option.\nfunction extractSize(entry, boxProp, sizeType) {\n if (!entry[boxProp]) {\n if (boxProp === \"contentBoxSize\") {\n // The dimensions in `contentBoxSize` and `contentRect` are equivalent according to the spec.\n // See the 6th step in the description for the RO algorithm:\n // https://drafts.csswg.org/resize-observer/#create-and-populate-resizeobserverentry-h\n // > Set this.contentRect to logical this.contentBoxSize given target and observedBox of \"content-box\".\n // In real browser implementations of course these objects differ, but the width/height values should be equivalent.\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"];\n }\n\n return undefined;\n } // A couple bytes smaller than calling Array.isArray() and just as effective here.\n\n\n return entry[boxProp][0] ? entry[boxProp][0][sizeType] : // TS complains about this, because the RO entry type follows the spec and does not reflect Firefox's current\n // behaviour of returning objects instead of arrays for `borderBoxSize` and `contentBoxSize`.\n // @ts-ignore\n entry[boxProp][sizeType];\n}\n\nfunction useResizeObserver(opts) {\n if (opts === void 0) {\n opts = {};\n }\n\n // Saving the callback as a ref. With this, I don't need to put onResize in the\n // effect dep array, and just passing in an anonymous function without memoising\n // will not reinstantiate the hook's ResizeObserver.\n var onResize = opts.onResize;\n var onResizeRef = useRef(undefined);\n onResizeRef.current = onResize;\n var round = opts.round || Math.round; // Using a single instance throughout the hook's lifetime\n\n var resizeObserverRef = useRef();\n\n var _useState = useState({\n width: undefined,\n height: undefined\n }),\n size = _useState[0],\n setSize = _useState[1]; // In certain edge cases the RO might want to report a size change just after\n // the component unmounted.\n\n\n var didUnmount = useRef(false);\n useEffect(function () {\n didUnmount.current = false;\n return function () {\n didUnmount.current = true;\n };\n }, []); // Using a ref to track the previous width / height to avoid unnecessary renders.\n\n var previous = useRef({\n width: undefined,\n height: undefined\n }); // This block is kinda like a useEffect, only it's called whenever a new\n // element could be resolved based on the ref option. It also has a cleanup\n // function.\n\n var refCallback = useResolvedElement(useCallback(function (element) {\n // We only use a single Resize Observer instance, and we're instantiating it on demand, only once there's something to observe.\n // This instance is also recreated when the `box` option changes, so that a new observation is fired if there was a previously observed element with a different box option.\n if (!resizeObserverRef.current || resizeObserverRef.current.box !== opts.box || resizeObserverRef.current.round !== round) {\n resizeObserverRef.current = {\n box: opts.box,\n round: round,\n instance: new ResizeObserver(function (entries) {\n var entry = entries[0];\n var boxProp = opts.box === \"border-box\" ? \"borderBoxSize\" : opts.box === \"device-pixel-content-box\" ? \"devicePixelContentBoxSize\" : \"contentBoxSize\";\n var reportedWidth = extractSize(entry, boxProp, \"inlineSize\");\n var reportedHeight = extractSize(entry, boxProp, \"blockSize\");\n var newWidth = reportedWidth ? round(reportedWidth) : undefined;\n var newHeight = reportedHeight ? round(reportedHeight) : undefined;\n\n if (previous.current.width !== newWidth || previous.current.height !== newHeight) {\n var newSize = {\n width: newWidth,\n height: newHeight\n };\n previous.current.width = newWidth;\n previous.current.height = newHeight;\n\n if (onResizeRef.current) {\n onResizeRef.current(newSize);\n } else {\n if (!didUnmount.current) {\n setSize(newSize);\n }\n }\n }\n })\n };\n }\n\n resizeObserverRef.current.instance.observe(element, {\n box: opts.box\n });\n return function () {\n if (resizeObserverRef.current) {\n resizeObserverRef.current.instance.unobserve(element);\n }\n };\n }, [opts.box, round]), opts.ref);\n return useMemo(function () {\n return {\n ref: refCallback,\n width: size.width,\n height: size.height\n };\n }, [refCallback, size.width, size.height]);\n}\n\nexport { useResizeObserver as default };\n","import { useRef } from 'preact/hooks';\nimport { useThrottledCallback } from 'use-debounce';\nimport useResizeObserver from 'use-resize-observer';\n\nexport default function useTruncated({ className = 'truncated' } = {}) {\n const ref = useRef();\n const onResize = useThrottledCallback(({ height }) => {\n if (ref.current) {\n const { scrollHeight } = ref.current;\n let truncated = scrollHeight > height;\n if (truncated) {\n const { height: _height, maxHeight } = getComputedStyle(ref.current);\n const computedHeight = parseInt(maxHeight || _height, 10);\n truncated = scrollHeight > computedHeight;\n }\n ref.current.classList.toggle(className, truncated);\n }\n }, 300);\n useResizeObserver({\n ref,\n box: 'border-box',\n onResize,\n });\n return ref;\n}\n","export default {\n public: 'earth',\n unlisted: 'group',\n private: 'lock',\n direct: 'message',\n local: 'building',\n};\n","export var styleRoot = 'kvfysmfp';\nexport var styleChild = 'ufhsfnkm';\nexport var styles = \".\".concat(styleRoot, \"{overflow:hidden;touch-action:none}.\").concat(styleChild, \"{transform-origin: 0 0}\");\n","var isSsr = typeof window === 'undefined';\nexport var isTouch = function () {\n return !isSsr && ('ontouchstart' in window || navigator.maxTouchPoints > 0);\n};\nexport var make2dTransformValue = function (_a) {\n var x = _a.x, y = _a.y, scale = _a.scale;\n return \"scale(\".concat(scale, \") translate(\").concat(x, \"px, \").concat(y, \"px)\");\n};\nexport var make3dTransformValue = function (_a) {\n var x = _a.x, y = _a.y, scale = _a.scale;\n return \"scale3d(\".concat(scale, \",\").concat(scale, \", 1) translate3d(\").concat(x, \"px, \").concat(y, \"px, 0)\");\n};\nexport var hasTranslate3DSupport = function () {\n var css = !isSsr && window.CSS;\n return css && css.supports && css.supports('transform', 'translate3d(0,0,0)');\n};\n","var min = Math.min, max = Math.max;\nexport function getOffsetBounds(_a) {\n var containerDimension = _a.containerDimension, childDimension = _a.childDimension, padding = _a.padding, centerContained = _a.centerContained;\n var diff = childDimension - containerDimension;\n if (diff + 2 * padding <= 0 && centerContained) {\n return [diff / 2, diff / 2];\n }\n else {\n return [min(diff + padding, 0) - padding, max(0, diff + padding)];\n }\n}\n","import { __assign, __extends } from \"tslib\";\nimport React, { Component, createRef, Children, cloneElement } from 'react';\nimport { styleRoot, styleChild, styles } from './styles.css';\nimport { isTouch } from '../utils';\nimport { getOffsetBounds } from './getOffsetBounds';\nvar classnames = function (base, other) {\n return other ? \"\".concat(base, \" \").concat(other) : base;\n};\nvar abs = Math.abs, min = Math.min, sqrt = Math.sqrt;\nvar isSsr = typeof window === 'undefined';\nvar isMac = isSsr ? false : /(Mac)/i.test(navigator.platform);\nvar isDragInteraction = function (i) { return i === 'drag'; };\nvar isZoomInteraction = function (i) { return i === 'zoom'; };\nvar isZoomGesture = function (wheelEvent) { return isMac && wheelEvent.ctrlKey; };\nvar cancelEvent = function (event) {\n event.stopPropagation();\n event.preventDefault();\n};\nvar getDistance = function (a, b) {\n var x = a.x - b.x;\n var y = a.y - b.y;\n return sqrt(x * x + y * y);\n};\nvar calculateScale = function (startTouches, endTouches) {\n var startDistance = getDistance(startTouches[0], startTouches[1]);\n var endDistance = getDistance(endTouches[0], endTouches[1]);\n return endDistance / startDistance;\n};\nvar isCloseTo = function (value, expected) {\n return value > expected - 0.01 && value < expected + 0.01;\n};\nvar swing = function (p) { return -Math.cos(p * Math.PI) / 2 + 0.5; };\nvar getPointByPageCoordinates = function (touch) { return ({\n x: touch.pageX,\n y: touch.pageY,\n}); };\nvar getPageCoordinatesByTouches = function (touches) {\n return Array.from(touches).map(getPointByPageCoordinates);\n};\nvar sum = function (a, b) { return a + b; };\nvar getVectorAvg = function (vectors) { return ({\n x: vectors.map(function (_a) {\n var x = _a.x;\n return x;\n }).reduce(sum, 0) / vectors.length,\n y: vectors.map(function (_a) {\n var y = _a.y;\n return y;\n }).reduce(sum, 0) / vectors.length,\n}); };\nvar clamp = function (min, max, value) {\n return value < min ? min : value > max ? max : value;\n};\nvar shouldInterceptWheel = function (event) {\n return !(event.ctrlKey || event.metaKey);\n};\nvar getElementSize = function (element) {\n if (element) {\n var offsetWidth = element.offsetWidth, offsetHeight = element.offsetHeight;\n // Any DOMElement\n if (offsetWidth && offsetHeight) {\n return { width: offsetWidth, height: offsetHeight };\n }\n // Svg support\n var style = getComputedStyle(element);\n var width = parseFloat(style.width);\n var height = parseFloat(style.height);\n if (height && width) {\n return { width: width, height: height };\n }\n }\n return { width: 0, height: 0 };\n};\nvar calculateVelocity = function (startPoint, endPoint) { return ({\n x: endPoint.x - startPoint.x,\n y: endPoint.y - startPoint.y,\n}); };\nvar comparePoints = function (p1, p2) { return p1.x === p2.x && p1.y === p2.y; };\nvar noup = function () { };\nvar zeroPoint = { x: 0, y: 0 };\nvar PinchZoom = /** @class */ (function (_super) {\n __extends(PinchZoom, _super);\n function PinchZoom() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._prevDragMovePoint = null;\n _this._containerObserver = null;\n _this._fingers = 0;\n _this._firstMove = true;\n _this._initialOffset = __assign({}, zeroPoint);\n _this._interaction = null;\n _this._isDoubleTap = false;\n _this._isOffsetsSet = false;\n _this._lastDragPosition = null;\n _this._lastScale = 1;\n _this._lastTouchStart = 0;\n _this._lastZoomCenter = null;\n _this._listenMouseMove = false;\n _this._nthZoom = 0;\n _this._offset = __assign({}, zeroPoint);\n _this._startOffset = __assign({}, zeroPoint);\n _this._startTouches = null;\n _this._updatePlaned = false;\n _this._wheelTimeOut = null;\n _this._zoomFactor = 1;\n _this._initialZoomFactor = 1;\n _this._draggingPoint = __assign({}, zeroPoint);\n // It help reduce behavior difference between touch and mouse events\n _this._ignoreNextClick = false;\n // @ts-ignore\n _this._containerRef = createRef();\n _this._handleClick = function (clickEvent) {\n if (_this._ignoreNextClick) {\n _this._ignoreNextClick = false;\n clickEvent.stopPropagation();\n }\n };\n _this._onResize = function () {\n var _a;\n if ((_a = _this._containerRef) === null || _a === void 0 ? void 0 : _a.current) {\n _this._updateInitialZoomFactor();\n _this._setupOffsets();\n _this._update();\n }\n };\n _this._handlerOnTouchEnd = _this._handlerIfEnable(function (touchEndEvent) {\n _this._fingers = touchEndEvent.touches.length;\n if (_this.props.shouldCancelHandledTouchEndEvents &&\n (isZoomInteraction(_this._interaction) ||\n (isDragInteraction(_this._interaction) &&\n (_this._startOffset.x !== _this._offset.x ||\n _this._startOffset.y !== _this._offset.y)))) {\n cancelEvent(touchEndEvent);\n }\n if (isDragInteraction(_this._interaction) && !_this._enoughToDrag()) {\n _this._handleClick(touchEndEvent);\n }\n _this._updateInteraction(touchEndEvent);\n });\n _this._handlerOnTouchStart = _this._handlerIfEnable(function (touchStartEvent) {\n _this._firstMove = true;\n _this._fingers = touchStartEvent.touches.length;\n _this._detectDoubleTap(touchStartEvent);\n });\n _this._handlerOnTouchMove = _this._handlerIfEnable(function (touchMoveEvent) {\n if (_this._isDoubleTap) {\n return;\n }\n _this._collectInertia(touchMoveEvent);\n if (_this._firstMove) {\n _this._updateInteraction(touchMoveEvent);\n if (_this._interaction) {\n cancelEvent(touchMoveEvent);\n }\n _this._startOffset = __assign({}, _this._offset);\n _this._startTouches = getPageCoordinatesByTouches(touchMoveEvent.touches);\n }\n else {\n if (isZoomInteraction(_this._interaction)) {\n if (_this._startTouches &&\n _this._startTouches.length === 2 &&\n touchMoveEvent.touches.length === 2) {\n _this._handleZoom(touchMoveEvent, calculateScale(_this._startTouches, getPageCoordinatesByTouches(touchMoveEvent.touches)));\n }\n }\n else if (isDragInteraction(_this._interaction)) {\n _this._handleDrag(touchMoveEvent);\n }\n if (_this._interaction) {\n cancelEvent(touchMoveEvent);\n _this._update();\n }\n }\n _this._firstMove = false;\n });\n _this._handlerWheel = function (wheelEvent) {\n if (_this.props.shouldInterceptWheel(wheelEvent)) {\n return;\n }\n cancelEvent(wheelEvent);\n var pageX = wheelEvent.pageX, pageY = wheelEvent.pageY, deltaY = wheelEvent.deltaY, deltaMode = wheelEvent.deltaMode;\n var scaleDelta = 1;\n if (isZoomGesture(wheelEvent) || deltaMode === 1) {\n scaleDelta = 15;\n }\n var likeTouchEvent = {\n touches: [\n // @ts-ignore\n { pageX: pageX, pageY: pageY },\n ],\n };\n var center = _this._getOffsetByFirstTouch(likeTouchEvent);\n var dScale = deltaY * scaleDelta;\n _this._stopAnimation();\n _this._scaleTo(_this._zoomFactor - dScale / _this.props.wheelScaleFactor, center);\n _this._update();\n clearTimeout(\n // @ts-ignore\n _this._wheelTimeOut);\n _this._wheelTimeOut = setTimeout(function () { return _this._sanitize(); }, 100);\n };\n // @ts-ignore\n _this._handlers = _this.props.isTouch()\n ? [\n ['touchstart', _this._handlerOnTouchStart],\n ['touchend', _this._handlerOnTouchEnd],\n ['touchmove', _this._handlerOnTouchMove],\n ]\n : [\n [\n 'mousemove',\n _this.simulate(_this._handlerOnTouchMove),\n _this.props._document,\n ],\n [\n 'mouseup',\n _this.simulate(_this._handlerOnTouchEnd),\n _this.props._document,\n ],\n ['mousedown', _this.simulate(_this._handlerOnTouchStart)],\n ['click', _this._handleClick],\n ['wheel', _this._handlerWheel],\n ];\n return _this;\n }\n PinchZoom.prototype._handleDragStart = function (event) {\n this._ignoreNextClick = true;\n this.props.onDragStart();\n this._stopAnimation();\n this._resetInertia();\n this._lastDragPosition = null;\n this._hasInteraction = true;\n this._draggingPoint = this._offset;\n this._handleDrag(event);\n };\n PinchZoom.prototype._handleDrag = function (event) {\n var touch = this._getOffsetByFirstTouch(event);\n if (this._enoughToDrag()) {\n this._drag(touch, this._lastDragPosition);\n }\n else {\n this._virtualDrag(touch, this._lastDragPosition);\n }\n this._offset = this._sanitizeOffset(this._offset);\n this._lastDragPosition = touch;\n };\n PinchZoom.prototype._resetInertia = function () {\n this._velocity = null;\n this._prevDragMovePoint = null;\n };\n PinchZoom.prototype._realizeInertia = function () {\n var _this = this;\n var _a = this.props, inertiaFriction = _a.inertiaFriction, inertia = _a.inertia;\n if (!inertia || !this._velocity) {\n return;\n }\n var _b = this._velocity, x = _b.x, y = _b.y;\n if (x || y) {\n this._stopAnimation();\n this._resetInertia();\n var renderFrame = function () {\n x *= inertiaFriction;\n y *= inertiaFriction;\n if (!x && !y) {\n return _this._stopAnimation();\n }\n var prevOffset = __assign({}, _this._offset);\n _this._addOffset({ x: x, y: y });\n _this._offset = _this._sanitizeOffset(_this._offset);\n if (comparePoints(prevOffset, _this._offset)) {\n return _this._stopAnimation();\n }\n _this._update({ isAnimation: true });\n };\n this._animate(renderFrame, { duration: 9999 });\n }\n };\n PinchZoom.prototype._collectInertia = function (_a) {\n var touches = _a.touches;\n if (!this.props.inertia) {\n return;\n }\n var currentCoordinates = getPageCoordinatesByTouches(touches)[0];\n var prevPoint = this._prevDragMovePoint;\n if (prevPoint) {\n this._velocity = calculateVelocity(currentCoordinates, prevPoint);\n }\n this._prevDragMovePoint = currentCoordinates;\n };\n PinchZoom.prototype._handleDragEnd = function () {\n this.props.onDragEnd();\n this._end();\n this._realizeInertia();\n };\n PinchZoom.prototype._handleZoomStart = function () {\n this.props.onZoomStart();\n this._stopAnimation();\n this._lastScale = 1;\n this._nthZoom = 0;\n this._lastZoomCenter = null;\n this._hasInteraction = true;\n };\n PinchZoom.prototype._handleZoom = function (event, newScale) {\n var touchCenter = getVectorAvg(this._getOffsetTouches(event));\n var scale = newScale / this._lastScale;\n this._lastScale = newScale;\n // The first touch events are thrown away since they are not precise\n this._nthZoom += 1;\n if (this._nthZoom > 3) {\n this._scale(scale, touchCenter);\n this._drag(touchCenter, this._lastZoomCenter);\n if (this.props.enforceBoundsDuringZoom) {\n this._offset = this._sanitizeOffset(this._offset);\n }\n }\n this._lastZoomCenter = touchCenter;\n };\n PinchZoom.prototype._handleZoomEnd = function () {\n this.props.onZoomEnd();\n this._end();\n };\n PinchZoom.prototype._handleDoubleTap = function (event) {\n var _this = this;\n if (this._hasInteraction || this.props.tapZoomFactor === 0) {\n return;\n }\n var needZoomOut = (this.props.doubleTapZoomOutOnMaxScale &&\n this._zoomFactor === this.props.maxZoom) ||\n (this.props.doubleTapToggleZoom && this._zoomFactor > 1);\n this.props.onDoubleTap();\n this._ignoreNextClick = true;\n var zoomFactor = this._zoomFactor + this.props.tapZoomFactor;\n var startZoomFactor = this._zoomFactor;\n var updateProgress = function (progress) {\n _this._scaleTo(startZoomFactor + progress * (zoomFactor - startZoomFactor), center);\n };\n var center = this._getOffsetByFirstTouch(event);\n this._isDoubleTap = true;\n if (startZoomFactor > zoomFactor) {\n center = this._getCurrentZoomCenter();\n }\n needZoomOut ? this._zoomOutAnimation() : this._animate(updateProgress);\n };\n PinchZoom.prototype._computeInitialOffset = function () {\n var rect = this._getContainerRect();\n var _a = this._getChildSize(), width = _a.width, height = _a.height;\n var x = -abs(width * this._getInitialZoomFactor() - rect.width) / 2;\n var y = -abs(height * this._getInitialZoomFactor() - rect.height) / 2;\n this._initialOffset = { x: x, y: y };\n };\n PinchZoom.prototype._resetOffset = function () {\n this._offset = __assign({}, this._initialOffset);\n };\n PinchZoom.prototype._setupOffsets = function () {\n if (this.props.setOffsetsOnce && this._isOffsetsSet) {\n return;\n }\n this._isOffsetsSet = true;\n this._computeInitialOffset();\n this._resetOffset();\n };\n PinchZoom.prototype._sanitizeOffset = function (offset) {\n var rect = this._getContainerRect();\n var _a = this._getChildSize(), width = _a.width, height = _a.height;\n var elWidth = width * this._getInitialZoomFactor() * this._zoomFactor;\n var elHeight = height * this._getInitialZoomFactor() * this._zoomFactor;\n var _b = getOffsetBounds({\n containerDimension: rect.width,\n childDimension: elWidth,\n padding: this.props.horizontalPadding,\n centerContained: this.props.centerContained,\n }), minOffsetX = _b[0], maxOffsetX = _b[1];\n var _c = getOffsetBounds({\n containerDimension: rect.height,\n childDimension: elHeight,\n padding: this.props.verticalPadding,\n centerContained: this.props.centerContained,\n }), minOffsetY = _c[0], maxOffsetY = _c[1];\n return {\n x: clamp(minOffsetX, maxOffsetX, offset.x),\n y: clamp(minOffsetY, maxOffsetY, offset.y),\n };\n };\n PinchZoom.prototype.alignCenter = function (options) {\n var _this = this;\n var _a = __assign({ duration: 250, animated: true }, options), __x = _a.x, __y = _a.y, scale = _a.scale, animated = _a.animated, duration = _a.duration;\n // Bug-Fix: https://github.com/retyui/react-quick-pinch-zoom/issues/58\n var x = __x * this._initialZoomFactor;\n var y = __y * this._initialZoomFactor;\n var startZoomFactor = this._zoomFactor;\n var startOffset = __assign({}, this._offset);\n var rect = this._getContainerRect();\n var containerCenter = { x: rect.width / 2, y: rect.height / 2 };\n this._zoomFactor = 1;\n this._offset = { x: -(containerCenter.x - x), y: -(containerCenter.y - y) };\n this._scaleTo(scale, containerCenter);\n this._stopAnimation();\n if (!animated) {\n return this._update();\n }\n var diffZoomFactor = this._zoomFactor - startZoomFactor;\n var diffOffset = {\n x: this._offset.x - startOffset.x,\n y: this._offset.y - startOffset.y,\n };\n this._zoomFactor = startZoomFactor;\n this._offset = __assign({}, startOffset);\n var updateFrame = function (progress) {\n var x = startOffset.x + diffOffset.x * progress;\n var y = startOffset.y + diffOffset.y * progress;\n _this._zoomFactor = startZoomFactor + diffZoomFactor * progress;\n _this._offset = _this._sanitizeOffset({ x: x, y: y });\n _this._update();\n };\n this._animate(updateFrame, {\n callback: function () { return _this._sanitize(); },\n duration: duration,\n });\n };\n PinchZoom.prototype.scaleTo = function (options) {\n var _this = this;\n var _a = __assign({ duration: 250, animated: true }, options), x = _a.x, y = _a.y, scale = _a.scale, animated = _a.animated, duration = _a.duration;\n var startZoomFactor = this._zoomFactor;\n var startOffset = __assign({}, this._offset);\n this._zoomFactor = 1;\n this._offset = { x: 0, y: 0 };\n this._scaleTo(scale, { x: x, y: y });\n this._stopAnimation();\n if (!animated) {\n return this._update();\n }\n var diffZoomFactor = this._zoomFactor - startZoomFactor;\n var diffOffset = {\n x: this._offset.x - startOffset.x,\n y: this._offset.y - startOffset.y,\n };\n this._zoomFactor = startZoomFactor;\n this._offset = __assign({}, startOffset);\n var updateFrame = function (progress) {\n var x = startOffset.x + diffOffset.x * progress;\n var y = startOffset.y + diffOffset.y * progress;\n _this._zoomFactor = startZoomFactor + diffZoomFactor * progress;\n _this._offset = { x: x, y: y };\n _this._update();\n };\n this._animate(updateFrame, { callback: function () { return _this._sanitize(); }, duration: duration });\n };\n PinchZoom.prototype._scaleTo = function (zoomFactor, center) {\n this._scale(zoomFactor / this._zoomFactor, center);\n this._offset = this._sanitizeOffset(this._offset);\n };\n PinchZoom.prototype._scale = function (scale, center) {\n scale = this._scaleZoomFactor(scale);\n this._addOffset({\n x: (scale - 1) * (center.x + this._offset.x),\n y: (scale - 1) * (center.y + this._offset.y),\n });\n this.props.onZoomUpdate();\n };\n PinchZoom.prototype._scaleZoomFactor = function (scale) {\n var originalZoomFactor = this._zoomFactor;\n this._zoomFactor *= scale;\n this._zoomFactor = clamp(this.props.minZoom, this.props.maxZoom, this._zoomFactor);\n return this._zoomFactor / originalZoomFactor;\n };\n PinchZoom.prototype._canDrag = function () {\n return this.props.draggableUnZoomed || !isCloseTo(this._zoomFactor, 1);\n };\n PinchZoom.prototype._drag = function (center, lastCenter) {\n if (lastCenter) {\n var y = -(center.y - lastCenter.y);\n var x = -(center.x - lastCenter.x);\n if (!this.props.lockDragAxis) {\n this._addOffset({\n x: x,\n y: y,\n });\n }\n else {\n // lock scroll to position that was changed the most\n if (abs(x) > abs(y)) {\n this._addOffset({\n x: x,\n y: 0,\n });\n }\n else {\n this._addOffset({\n y: y,\n x: 0,\n });\n }\n }\n this.props.onDragUpdate();\n }\n };\n PinchZoom.prototype._virtualDrag = function (center, lastCenter) {\n if (lastCenter) {\n var y = -(center.y - lastCenter.y);\n var x = -(center.x - lastCenter.x);\n this._draggingPoint = {\n x: x + this._draggingPoint.x,\n y: y + this._draggingPoint.y,\n };\n }\n };\n PinchZoom.prototype._addOffset = function (offset) {\n var _a = this._offset, x = _a.x, y = _a.y;\n this._offset = {\n x: x + offset.x,\n y: y + offset.y,\n };\n };\n PinchZoom.prototype._sanitize = function () {\n if (this._zoomFactor < this.props.zoomOutFactor) {\n this._resetInertia();\n this._zoomOutAnimation();\n }\n else if (this._isInsaneOffset()) {\n this._sanitizeOffsetAnimation();\n }\n };\n PinchZoom.prototype._isInsaneOffset = function () {\n var offset = this._offset;\n var sanitizedOffset = this._sanitizeOffset(offset);\n return sanitizedOffset.x !== offset.x || sanitizedOffset.y !== offset.y;\n };\n PinchZoom.prototype._sanitizeOffsetAnimation = function () {\n var _this = this;\n var targetOffset = this._sanitizeOffset(this._offset);\n var startOffset = __assign({}, this._offset);\n var updateProgress = function (progress) {\n var x = startOffset.x + progress * (targetOffset.x - startOffset.x);\n var y = startOffset.y + progress * (targetOffset.y - startOffset.y);\n _this._offset = { x: x, y: y };\n _this._update();\n };\n this._animate(updateProgress);\n };\n PinchZoom.prototype._zoomOutAnimation = function () {\n var _this = this;\n if (this._zoomFactor === 1) {\n return;\n }\n var startZoomFactor = this._zoomFactor;\n var zoomFactor = 1;\n var center = this._getCurrentZoomCenter();\n var updateProgress = function (progress) {\n var scaleFactor = startZoomFactor + progress * (zoomFactor - startZoomFactor);\n _this._scaleTo(scaleFactor, center);\n };\n this._animate(updateProgress);\n };\n PinchZoom.prototype._getInitialZoomFactor = function () {\n return this._initialZoomFactor;\n };\n PinchZoom.prototype._getCurrentZoomCenter = function () {\n var _a = this._offset, x = _a.x, y = _a.y;\n var offsetLeft = x - this._initialOffset.x;\n var offsetTop = y - this._initialOffset.y;\n return {\n x: -1 * x - offsetLeft / (1 / this._zoomFactor - 1),\n y: -1 * y - offsetTop / (1 / this._zoomFactor - 1),\n };\n };\n PinchZoom.prototype._getOffsetByFirstTouch = function (event) {\n return this._getOffsetTouches(event)[0];\n };\n PinchZoom.prototype._getOffsetTouches = function (event) {\n var _document = this.props._document;\n var _html = _document.documentElement;\n var _body = _document.body;\n var _a = this._getContainerRect(), top = _a.top, left = _a.left;\n var scrollTop = _html.scrollTop || _body.scrollTop;\n var scrollLeft = _html.scrollLeft || _body.scrollLeft;\n var posTop = top + scrollTop;\n var posLeft = left + scrollLeft;\n return getPageCoordinatesByTouches(event.touches).map(function (_a) {\n var x = _a.x, y = _a.y;\n return ({\n x: x - posLeft,\n y: y - posTop,\n });\n });\n };\n PinchZoom.prototype._animate = function (frameFn, options) {\n var _this = this;\n var startTime = new Date().getTime();\n var _a = __assign({ timeFn: swing, callback: function () { }, duration: this.props.animationDuration }, options), timeFn = _a.timeFn, callback = _a.callback, duration = _a.duration;\n var renderFrame = function () {\n if (!_this._inAnimation) {\n return;\n }\n var frameTime = new Date().getTime() - startTime;\n var progress = frameTime / duration;\n if (frameTime >= duration) {\n frameFn(1);\n _this._stopAnimation();\n callback();\n _this._update();\n }\n else {\n progress = timeFn(progress);\n frameFn(progress);\n _this._update({ isAnimation: true });\n requestAnimationFrame(renderFrame);\n }\n };\n this._inAnimation = true;\n requestAnimationFrame(renderFrame);\n };\n PinchZoom.prototype._stopAnimation = function () {\n this._inAnimation = false;\n };\n PinchZoom.prototype._end = function () {\n this._hasInteraction = false;\n this._sanitize();\n this._update();\n };\n PinchZoom.prototype._getContainerRect = function () {\n var div = this._containerRef.current;\n return div.getBoundingClientRect();\n };\n PinchZoom.prototype._getChildSize = function () {\n var div = this._containerRef.current;\n return getElementSize(div === null || div === void 0 ? void 0 : div.firstElementChild);\n };\n PinchZoom.prototype._updateInitialZoomFactor = function () {\n var rect = this._getContainerRect();\n var size = this._getChildSize();\n var xZoomFactor = rect.width / size.width;\n var yZoomFactor = rect.height / size.height;\n this._initialZoomFactor = min(xZoomFactor, yZoomFactor);\n };\n PinchZoom.prototype._bindEvents = function () {\n var _this = this;\n var div = this._containerRef.current;\n if (window.ResizeObserver) {\n this._containerObserver = new ResizeObserver(this._onResize);\n this._containerObserver.observe(div);\n }\n else {\n window.addEventListener('resize', this._onResize);\n }\n this._handlers.forEach(function (_a) {\n var eventName = _a[0], fn = _a[1], target = _a[2];\n (target || div).addEventListener(eventName, fn, true);\n });\n Array.from(div.querySelectorAll('img')).forEach(function (img) {\n return img.addEventListener('load', _this._onResize);\n });\n };\n PinchZoom.prototype._unSubscribe = function () {\n var _this = this;\n var div = this._containerRef.current;\n if (this._containerObserver) {\n this._containerObserver.disconnect();\n this._containerObserver = null;\n }\n window.removeEventListener('resize', this._onResize);\n this._handlers.forEach(function (_a) {\n var eventName = _a[0], fn = _a[1], target = _a[2];\n (target || div).removeEventListener(eventName, fn, true);\n });\n Array.from(div.querySelectorAll('img')).forEach(function (img) {\n return img.removeEventListener('load', _this._onResize);\n });\n };\n PinchZoom.prototype._update = function (options) {\n var _this = this;\n if (this._updatePlaned) {\n return;\n }\n var updateFrame = function () {\n var scale = _this._getInitialZoomFactor() * _this._zoomFactor;\n var x = -_this._offset.x / scale;\n var y = -_this._offset.y / scale;\n _this.props.onUpdate({ scale: scale, x: x, y: y });\n };\n if (options === null || options === void 0 ? void 0 : options.isAnimation) {\n return updateFrame();\n }\n this._updatePlaned = true;\n requestAnimationFrame(function () {\n _this._updatePlaned = false;\n updateFrame();\n });\n };\n PinchZoom.prototype._handlerIfEnable = function (fn) {\n var _this = this;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (_this.props.enabled) {\n fn.apply(void 0, args);\n }\n };\n };\n PinchZoom.prototype._setInteraction = function (newInteraction, event) {\n var interaction = this._interaction;\n if (interaction !== newInteraction) {\n if (interaction && !newInteraction) {\n if (isZoomInteraction(interaction)) {\n this._handleZoomEnd();\n }\n else if (isDragInteraction(interaction)) {\n this._handleDragEnd();\n }\n }\n if (isZoomInteraction(newInteraction)) {\n this._handleZoomStart();\n }\n else if (isDragInteraction(newInteraction)) {\n this._handleDragStart(event);\n }\n }\n this._interaction = newInteraction;\n };\n PinchZoom.prototype._distanceBetweenNumbers = function (a, b) {\n return a > b ? a - b : b - a;\n };\n PinchZoom.prototype._enoughToDrag = function () {\n if (this._distanceBetweenNumbers(this._startOffset.x, this._draggingPoint.x) >\n 5 ||\n this._distanceBetweenNumbers(this._startOffset.y, this._draggingPoint.y) >\n 5)\n return true;\n return false;\n };\n PinchZoom.prototype._updateInteraction = function (event) {\n var fingers = this._fingers;\n if (fingers === 2) {\n return this._setInteraction('zoom', event);\n }\n if (fingers === 1 && this._canDrag()) {\n return this._setInteraction('drag', event);\n }\n this._setInteraction(null, event);\n };\n PinchZoom.prototype._detectDoubleTap = function (event) {\n var time = new Date().getTime();\n if (this._fingers > 1) {\n this._lastTouchStart = 0;\n }\n if (time - this._lastTouchStart < 300) {\n cancelEvent(event);\n this._handleDoubleTap(event);\n if (isZoomInteraction(this._interaction)) {\n this._handleZoomEnd();\n }\n else if (isDragInteraction(this._interaction)) {\n this._handleDragEnd();\n }\n }\n else {\n this._isDoubleTap = false;\n }\n if (this._fingers === 1) {\n this._lastTouchStart = time;\n }\n };\n PinchZoom.prototype.simulate = function (fn) {\n var _this = this;\n return function (mouseEvent) {\n var pageX = mouseEvent.pageX, pageY = mouseEvent.pageY, type = mouseEvent.type;\n var isEnd = type === 'mouseup';\n var isStart = type === 'mousedown';\n if (isStart) {\n mouseEvent.preventDefault();\n _this._listenMouseMove = true;\n }\n if (_this._listenMouseMove) {\n // @ts-ignore\n mouseEvent.touches = isEnd ? [] : [{ pageX: pageX, pageY: pageY }];\n fn(\n // @ts-ignore\n mouseEvent);\n }\n if (isEnd) {\n _this._listenMouseMove = false;\n }\n };\n };\n PinchZoom.prototype.componentDidMount = function () {\n this._bindEvents();\n this._update();\n };\n PinchZoom.prototype.componentWillUnmount = function () {\n this._stopAnimation();\n this._unSubscribe();\n };\n PinchZoom.prototype.render = function () {\n var _a = this.props, children = _a.children, containerProps = _a.containerProps;\n var child = Children.only(children);\n var props = containerProps || {};\n return (React.createElement(React.Fragment, null,\n React.createElement(\"style\", null, styles),\n React.createElement(\"div\", __assign({}, props, { ref: this._containerRef, className: classnames(styleRoot, props.className) }), cloneElement(child, {\n className: classnames(styleChild, child.props.className),\n }))));\n };\n PinchZoom.defaultProps = {\n animationDuration: 250,\n draggableUnZoomed: true,\n enforceBoundsDuringZoom: false,\n centerContained: false,\n enabled: true,\n inertia: true,\n inertiaFriction: 0.96,\n horizontalPadding: 0,\n isTouch: isTouch,\n lockDragAxis: false,\n maxZoom: 5,\n minZoom: 0.5,\n onDoubleTap: noup,\n onDragEnd: noup,\n onDragStart: noup,\n onDragUpdate: noup,\n onZoomEnd: noup,\n onZoomStart: noup,\n onZoomUpdate: noup,\n setOffsetsOnce: false,\n shouldInterceptWheel: shouldInterceptWheel,\n shouldCancelHandledTouchEndEvents: false,\n tapZoomFactor: 1,\n verticalPadding: 0,\n wheelScaleFactor: 1500,\n zoomOutFactor: 1.3,\n doubleTapZoomOutOnMaxScale: false,\n doubleTapToggleZoom: false,\n // @ts-expect-error\n _document: isSsr ? null : window.document,\n };\n return PinchZoom;\n}(Component));\nif (process.env.NODE_ENV !== 'production') {\n var _a = require('prop-types'), any = _a.any, element = _a.element, object = _a.object, number = _a.number, func = _a.func, bool = _a.bool;\n // @ts-ignore\n PinchZoom.propTypes = {\n children: element,\n containerProps: object,\n wheelScaleFactor: number,\n animationDuration: number,\n draggableUnZoomed: bool,\n enforceBoundsDuringZoom: bool,\n centerContained: bool,\n enabled: bool,\n horizontalPadding: number,\n lockDragAxis: bool,\n onUpdate: func.isRequired,\n maxZoom: number,\n minZoom: number,\n onDoubleTap: func,\n onDragEnd: func,\n onDragStart: func,\n onDragUpdate: func,\n onZoomEnd: func,\n onZoomStart: func,\n onZoomUpdate: func,\n setOffsetsOnce: bool,\n tapZoomFactor: number,\n verticalPadding: number,\n zoomOutFactor: number,\n doubleTapZoomOutOnMaxScale: bool,\n doubleTapToggleZoom: bool,\n isTouch: func,\n _document: any,\n };\n}\nexport default PinchZoom;\n","export default function formatDuration(time) {\n if (!time) return;\n let hours = Math.floor(time / 3600);\n let minutes = Math.floor((time % 3600) / 60);\n let seconds = Math.round(time % 60);\n\n if (hours === 0) {\n return `${minutes}:${seconds.toString().padStart(2, '0')}`;\n } else {\n return `${hours}:${minutes.toString().padStart(2, '0')}:${seconds\n .toString()\n .padStart(2, '0')}`;\n }\n}\n","import { Trans, useLingui } from '@lingui/react/macro';\nimport { getBlurHashAverageColor } from 'fast-blurhash';\nimport { Fragment } from 'preact';\nimport { memo } from 'preact/compat';\nimport {\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport QuickPinchZoom, { make3dTransformValue } from 'react-quick-pinch-zoom';\n\nimport formatDuration from '../utils/format-duration';\nimport mem from '../utils/mem';\nimport states from '../utils/states';\n\nimport Icon from './icon';\nimport Link from './link';\n\nconst isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); // https://stackoverflow.com/a/23522755\n\n/*\nMedia type\n===\nunknown = unsupported or unrecognized file type\nimage = Static image\ngifv = Looping, soundless animation\nvideo = Video clip\naudio = Audio track\n*/\n\nconst dataAltLabel = 'ALT';\nconst AltBadge = (props) => {\n const { t } = useLingui();\n const { alt, lang, index, ...rest } = props;\n if (!alt || !alt.trim()) return null;\n return (\n <button\n type=\"button\"\n class=\"alt-badge clickable\"\n {...rest}\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n states.showMediaAlt = {\n alt,\n lang,\n };\n }}\n title={t`Media description`}\n >\n {dataAltLabel}\n {!!index && <sup>{index}</sup>}\n </button>\n );\n};\n\nconst MEDIA_CAPTION_LIMIT = 140;\nconst MEDIA_CAPTION_LIMIT_LONGER = 280;\nexport const isMediaCaptionLong = mem((caption) =>\n caption?.length\n ? caption.length > MEDIA_CAPTION_LIMIT ||\n /[\\n\\r].*[\\n\\r]/.test(caption.trim())\n : false,\n);\n\nfunction Media({\n class: className = '',\n media,\n to,\n lang,\n showOriginal,\n autoAnimate,\n showCaption,\n allowLongerCaption,\n altIndex,\n checkAspectRatio = true,\n onClick = () => {},\n}) {\n let {\n blurhash,\n description,\n meta,\n previewRemoteUrl,\n previewUrl,\n remoteUrl,\n url,\n type,\n } = media;\n if (/no\\-preview\\./i.test(previewUrl)) {\n previewUrl = null;\n }\n const { original = {}, small, focus } = meta || {};\n\n const width = showOriginal\n ? original?.width\n : small?.width || original?.width;\n const height = showOriginal\n ? original?.height\n : small?.height || original?.height;\n const mediaURL = showOriginal ? url : previewUrl || url;\n const remoteMediaURL = showOriginal\n ? remoteUrl\n : previewRemoteUrl || remoteUrl;\n const hasDimensions = width && height;\n const orientation = hasDimensions\n ? width > height\n ? 'landscape'\n : 'portrait'\n : null;\n\n const rgbAverageColor = blurhash ? getBlurHashAverageColor(blurhash) : null;\n\n const videoRef = useRef();\n\n let focalPosition;\n if (focus) {\n // Convert focal point to CSS background position\n // Formula from jquery-focuspoint\n // x = -1, y = 1 => 0% 0%\n // x = 0, y = 0 => 50% 50%\n // x = 1, y = -1 => 100% 100%\n const x = ((focus.x + 1) / 2) * 100;\n const y = ((1 - focus.y) / 2) * 100;\n focalPosition = `${x.toFixed(0)}% ${y.toFixed(0)}%`;\n }\n\n const mediaRef = useRef();\n const onUpdate = useCallback(({ x, y, scale }) => {\n const { current: media } = mediaRef;\n\n if (media) {\n const value = make3dTransformValue({ x, y, scale });\n\n if (scale === 1) {\n media.style.removeProperty('transform');\n } else {\n media.style.setProperty('transform', value);\n }\n\n media.closest('.media-zoom').style.touchAction =\n scale <= 1.01 ? 'pan-x' : '';\n }\n }, []);\n\n const [pinchZoomEnabled, setPinchZoomEnabled] = useState(false);\n const quickPinchZoomProps = {\n enabled: pinchZoomEnabled,\n draggableUnZoomed: false,\n inertiaFriction: 0.9,\n tapZoomFactor: 2,\n doubleTapToggleZoom: true,\n containerProps: {\n className: 'media-zoom',\n style: {\n overflow: 'visible',\n // width: 'inherit',\n // height: 'inherit',\n // justifyContent: 'inherit',\n // alignItems: 'inherit',\n // display: 'inherit',\n },\n },\n onUpdate,\n };\n\n const [mediaLoadError, setMediaLoadError] = useState(false);\n\n const Parent = useMemo(\n () =>\n to && !mediaLoadError ? (props) => <Link to={to} {...props} /> : 'div',\n [to, mediaLoadError],\n );\n\n const remoteMediaURLObj = remoteMediaURL ? getURLObj(remoteMediaURL) : null;\n const isVideoMaybe =\n type === 'unknown' &&\n remoteMediaURLObj &&\n /\\.(mp4|m4r|m4v|mov|webm)$/i.test(remoteMediaURLObj.pathname);\n const isAudioMaybe =\n type === 'unknown' &&\n remoteMediaURLObj &&\n /\\.(mp3|ogg|wav|m4a|m4p|m4b)$/i.test(remoteMediaURLObj.pathname);\n const isImage =\n type === 'image' ||\n (type === 'unknown' && previewUrl && !isVideoMaybe && !isAudioMaybe);\n const isPreviewVideoMaybe =\n previewUrl &&\n /\\.(mp4|m4r|m4v|mov|webm)$/i.test(getURLObj(previewUrl).pathname);\n\n const parentRef = useRef();\n const [imageSmallerThanParent, setImageSmallerThanParent] = useState(false);\n useLayoutEffect(() => {\n if (!isImage) return;\n if (!showOriginal) return;\n if (!parentRef.current) return;\n const { offsetWidth, offsetHeight } = parentRef.current;\n const smaller = width < offsetWidth && height < offsetHeight;\n if (smaller) setImageSmallerThanParent(smaller);\n }, [width, height]);\n\n const maxAspectHeight =\n window.innerHeight * (orientation === 'portrait' ? 0.45 : 0.33);\n const maxHeight = orientation === 'portrait' ? 0 : 160;\n const averageColorStyle = {\n '--average-color': rgbAverageColor && `rgb(${rgbAverageColor.join(',')})`,\n };\n const mediaStyles =\n width && height\n ? {\n '--width': `${width}px`,\n '--height': `${height}px`,\n // Calculate '--aspectWidth' based on aspect ratio calculated from '--width' and '--height', max height has to be 160px\n '--aspectWidth': `${\n (width / height) * Math.max(maxHeight, maxAspectHeight)\n }px`,\n aspectRatio: `${width} / ${height}`,\n ...averageColorStyle,\n }\n : {\n ...averageColorStyle,\n };\n\n const longDesc = isMediaCaptionLong(description);\n let showInlineDesc =\n !!showCaption && !showOriginal && !!description && !longDesc;\n if (\n allowLongerCaption &&\n !showInlineDesc &&\n description?.length <= MEDIA_CAPTION_LIMIT_LONGER\n ) {\n showInlineDesc = true;\n }\n const Figure = !showInlineDesc\n ? Fragment\n : (props) => {\n const { children, ...restProps } = props;\n return (\n <figure {...restProps}>\n {children}\n <figcaption\n class=\"media-caption\"\n lang={lang}\n dir=\"auto\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n states.showMediaAlt = {\n alt: description,\n lang,\n };\n }}\n >\n {description}\n </figcaption>\n </figure>\n );\n };\n\n const [hasNaturalAspectRatio, setHasNaturalAspectRatio] = useState(undefined);\n\n if (isImage) {\n // Note: type: unknown might not have width/height\n quickPinchZoomProps.containerProps.style.display = 'inherit';\n\n useLayoutEffect(() => {\n if (!isSafari) return;\n if (!showOriginal) return;\n (async () => {\n try {\n await fetch(mediaURL, { mode: 'no-cors' });\n mediaRef.current.src = mediaURL;\n } catch (e) {\n // Ignore\n }\n })();\n }, [mediaURL]);\n\n return (\n <Figure>\n <Parent\n ref={parentRef}\n class={`media media-image ${className}`}\n onClick={onClick}\n data-orientation={orientation}\n data-has-alt={!showInlineDesc || undefined}\n data-has-natural-aspect-ratio={hasNaturalAspectRatio || undefined}\n style={\n showOriginal\n ? {\n backgroundImage: `url(${previewUrl})`,\n backgroundSize: imageSmallerThanParent\n ? `${width}px ${height}px`\n : undefined,\n ...averageColorStyle,\n }\n : mediaStyles\n }\n >\n {showOriginal ? (\n <QuickPinchZoom {...quickPinchZoomProps}>\n <img\n ref={mediaRef}\n src={mediaURL}\n alt={description}\n width={width}\n height={height}\n data-orientation={orientation}\n loading=\"eager\"\n decoding=\"sync\"\n onLoad={(e) => {\n e.target.closest('.media-image').style.backgroundImage = '';\n e.target.closest('.media-zoom').style.display = '';\n setPinchZoomEnabled(true);\n }}\n onError={(e) => {\n const { src } = e.target;\n if (\n src === mediaURL &&\n remoteMediaURL &&\n mediaURL !== remoteMediaURL\n ) {\n e.target.src = remoteMediaURL;\n }\n }}\n />\n </QuickPinchZoom>\n ) : (\n <>\n <img\n src={mediaURL}\n alt={showInlineDesc ? '' : description}\n width={width}\n height={height}\n data-orientation={orientation}\n loading=\"lazy\"\n style={{\n // backgroundColor:\n // rgbAverageColor && `rgb(${rgbAverageColor.join(',')})`,\n // backgroundPosition: focalBackgroundPosition || 'center',\n // Duration based on width or height in pixels\n objectPosition: focalPosition || 'center',\n // 100px per second (rough estimate)\n // Clamp between 5s and 120s\n '--anim-duration': `${Math.min(\n Math.max(Math.max(width, height) / 100, 5),\n 120,\n )}s`,\n }}\n onLoad={(e) => {\n // e.target.closest('.media-image').style.backgroundImage = '';\n e.target.dataset.loaded = true;\n const $media = e.target.closest('.media');\n if (!hasDimensions && $media) {\n const { naturalWidth, naturalHeight } = e.target;\n $media.dataset.orientation =\n naturalWidth > naturalHeight ? 'landscape' : 'portrait';\n $media.style.setProperty('--width', `${naturalWidth}px`);\n $media.style.setProperty('--height', `${naturalHeight}px`);\n $media.style.aspectRatio = `${naturalWidth}/${naturalHeight}`;\n }\n\n // Check natural aspect ratio vs display aspect ratio\n if (checkAspectRatio && $media) {\n const {\n clientWidth,\n clientHeight,\n naturalWidth,\n naturalHeight,\n } = e.target;\n if (\n clientWidth &&\n clientHeight &&\n naturalWidth &&\n naturalHeight\n ) {\n const minDimension = 88;\n if (\n naturalWidth < minDimension ||\n naturalHeight < minDimension\n ) {\n $media.dataset.hasSmallDimension = true;\n } else {\n const displayNaturalHeight =\n (naturalHeight * clientWidth) / naturalWidth;\n const almostSimilarHeight =\n Math.abs(displayNaturalHeight - clientHeight) < 5;\n\n if (almostSimilarHeight) {\n setHasNaturalAspectRatio(true);\n }\n }\n }\n }\n }}\n onError={(e) => {\n const { src } = e.target;\n if (src === mediaURL && mediaURL !== remoteMediaURL) {\n e.target.src = remoteMediaURL;\n } else {\n setMediaLoadError(true);\n }\n }}\n />\n {!showInlineDesc && (\n <AltBadge alt={description} lang={lang} index={altIndex} />\n )}\n </>\n )}\n </Parent>\n {mediaLoadError && (\n <div>\n <a href={remoteUrl} class=\"button plain6 small\" target=\"_blank\">\n <Icon icon=\"external\" />{' '}\n <span>\n <Trans>Open file</Trans>\n </span>\n </a>\n </div>\n )}\n </Figure>\n );\n } else if (type === 'gifv' || type === 'video' || isVideoMaybe) {\n const hasDuration = original.duration > 0;\n const shortDuration = original.duration < 31;\n const isGIF = type === 'gifv' && shortDuration;\n // If GIF is too long, treat it as a video\n const loopable = original.duration < 61;\n const formattedDuration = formatDuration(original.duration);\n const hoverAnimate = !showOriginal && !autoAnimate && isGIF;\n const autoGIFAnimate = !showOriginal && autoAnimate && isGIF;\n const showProgress = original.duration > 5;\n\n // This string is only for autoplay + muted to work on Mobile Safari\n const gifHTML = `\n <video\n src=\"${url}\"\n poster=\"${previewUrl}\"\n width=\"${width}\"\n height=\"${height}\"\n data-orientation=\"${orientation}\"\n preload=\"auto\"\n autoplay\n muted\n playsinline\n ${loopable ? 'loop' : ''}\n ondblclick=\"this.paused ? this.play() : this.pause()\"\n ${\n showProgress\n ? \"ontimeupdate=\\\"this.closest('.media-gif') && this.closest('.media-gif').style.setProperty('--progress', `${~~((this.currentTime / this.duration) * 100)}%`)\\\"\"\n : ''\n }\n ></video>\n `;\n\n const videoHTML = `\n <video\n src=\"${url}\"\n poster=\"${previewUrl}\"\n width=\"${width}\"\n height=\"${height}\"\n data-orientation=\"${orientation}\"\n preload=\"auto\"\n autoplay\n playsinline\n ${loopable ? 'loop' : ''}\n controls\n ></video>\n `;\n\n return (\n <Figure>\n <Parent\n class={`media ${className} media-${isGIF ? 'gif' : 'video'} ${\n autoGIFAnimate ? 'media-contain' : ''\n } ${hoverAnimate ? 'media-hover-animate' : ''}`}\n data-orientation={orientation}\n data-formatted-duration={\n !showOriginal ? formattedDuration : undefined\n }\n data-label={\n isGIF && !showOriginal && !autoGIFAnimate ? 'GIF' : undefined\n }\n data-has-alt={!showInlineDesc || undefined}\n // style={{\n // backgroundColor:\n // rgbAverageColor && `rgb(${rgbAverageColor.join(',')})`,\n // }}\n style={!showOriginal && mediaStyles}\n onClick={(e) => {\n if (hoverAnimate) {\n try {\n videoRef.current.pause();\n } catch (e) {}\n }\n onClick(e);\n }}\n onMouseEnter={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.play();\n } catch (e) {}\n }\n }}\n onMouseLeave={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.pause();\n } catch (e) {}\n }\n }}\n onFocus={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.play();\n } catch (e) {}\n }\n }}\n onBlur={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.pause();\n } catch (e) {}\n }\n }}\n >\n {showOriginal || autoGIFAnimate ? (\n isGIF && showOriginal ? (\n <QuickPinchZoom {...quickPinchZoomProps} enabled>\n <div\n ref={mediaRef}\n dangerouslySetInnerHTML={{\n __html: gifHTML,\n }}\n />\n </QuickPinchZoom>\n ) : isGIF ? (\n <div\n class=\"video-container\"\n dangerouslySetInnerHTML={{\n __html: gifHTML,\n }}\n />\n ) : (\n <div\n class=\"video-container\"\n dangerouslySetInnerHTML={{ __html: videoHTML }}\n />\n )\n ) : isGIF ? (\n <video\n ref={videoRef}\n src={url}\n poster={previewUrl}\n width={width}\n height={height}\n data-orientation={orientation}\n preload=\"auto\"\n // controls\n playsinline\n loop\n muted\n onTimeUpdate={\n showProgress\n ? (e) => {\n const { target } = e;\n const container = target?.closest('.media-gif');\n if (container) {\n const percentage =\n (target.currentTime / target.duration) * 100;\n container.style.setProperty(\n '--progress',\n `${percentage}%`,\n );\n }\n }\n : undefined\n }\n />\n ) : (\n <>\n {previewUrl && !isPreviewVideoMaybe ? (\n <img\n src={previewUrl}\n alt={showInlineDesc ? '' : description}\n width={width}\n height={height}\n data-orientation={orientation}\n loading=\"lazy\"\n decoding=\"async\"\n onLoad={(e) => {\n if (!hasDimensions) {\n const $media = e.target.closest('.media');\n if ($media) {\n const { naturalHeight, naturalWidth } = e.target;\n $media.dataset.orientation =\n naturalWidth > naturalHeight\n ? 'landscape'\n : 'portrait';\n $media.style.setProperty(\n '--width',\n `${naturalWidth}px`,\n );\n $media.style.setProperty(\n '--height',\n `${naturalHeight}px`,\n );\n $media.style.aspectRatio = `${naturalWidth}/${naturalHeight}`;\n }\n }\n }}\n />\n ) : (\n <video\n src={url + '#t=0.1'} // Make Safari show 1st-frame preview\n width={width}\n height={height}\n data-orientation={orientation}\n preload=\"metadata\"\n muted\n disablePictureInPicture\n onLoadedMetadata={(e) => {\n if (!hasDuration) {\n const { duration } = e.target;\n if (duration) {\n const formattedDuration = formatDuration(duration);\n const container = e.target.closest('.media-video');\n if (container) {\n container.dataset.formattedDuration =\n formattedDuration;\n }\n }\n }\n }}\n />\n )}\n <div class=\"media-play\">\n <Icon icon=\"play\" size=\"xl\" alt=\"▶\" />\n </div>\n </>\n )}\n {!showOriginal && !showInlineDesc && (\n <AltBadge alt={description} lang={lang} index={altIndex} />\n )}\n </Parent>\n </Figure>\n );\n } else if (type === 'audio' || isAudioMaybe) {\n const formattedDuration = formatDuration(original.duration);\n return (\n <Figure>\n <Parent\n class={`media media-audio ${className}`}\n data-formatted-duration={\n !showOriginal ? formattedDuration : undefined\n }\n data-has-alt={!showInlineDesc || undefined}\n onClick={onClick}\n style={!showOriginal && mediaStyles}\n >\n {showOriginal ? (\n <audio src={remoteUrl || url} preload=\"none\" controls autoPlay />\n ) : previewUrl ? (\n <img\n src={previewUrl}\n alt={showInlineDesc ? '' : description}\n width={width}\n height={height}\n data-orientation={orientation}\n loading=\"lazy\"\n onError={(e) => {\n try {\n // Remove self if broken\n e.target?.remove?.();\n } catch (e) {}\n }}\n />\n ) : null}\n {!showOriginal && (\n <>\n <div class=\"media-play\">\n <Icon icon=\"play\" size=\"xl\" alt=\"▶\" />\n </div>\n {!showInlineDesc && (\n <AltBadge alt={description} lang={lang} index={altIndex} />\n )}\n </>\n )}\n </Parent>\n </Figure>\n );\n }\n}\n\nfunction getURLObj(url) {\n // Fake base URL if url doesn't have https:// prefix\n return URL.parse(url, location.origin);\n}\n\nexport default memo(Media, (oldProps, newProps) => {\n const oldMedia = oldProps.media || {};\n const newMedia = newProps.media || {};\n\n return (\n oldMedia?.id === newMedia?.id &&\n oldMedia.url === newMedia.url &&\n oldProps.to === newProps.to &&\n oldProps.class === newProps.class\n );\n});\n","import './status.css';\nimport '@justinribeiro/lite-youtube';\n\nimport { msg, plural } from '@lingui/core/macro';\nimport { Trans, useLingui } from '@lingui/react/macro';\nimport {\n ControlledMenu,\n Menu,\n MenuDivider,\n MenuHeader,\n MenuItem,\n} from '@szhsin/react-menu';\nimport { decodeBlurHash, getBlurHashAverageColor } from 'fast-blurhash';\nimport { shallowEqual } from 'fast-equals';\nimport prettify from 'html-prettify';\nimport pThrottle from 'p-throttle';\nimport { Fragment } from 'preact';\nimport { forwardRef, memo } from 'preact/compat';\nimport {\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useHotkeys } from 'react-hotkeys-hook';\n// import { detectAll } from 'tinyld/light';\nimport { useLongPress } from 'use-long-press';\nimport { useSnapshot } from 'valtio';\n\nimport CustomEmoji from '../components/custom-emoji';\nimport EmojiText from '../components/emoji-text';\nimport LazyShazam from '../components/lazy-shazam';\nimport Loader from '../components/loader';\nimport MenuConfirm from '../components/menu-confirm';\nimport Menu2 from '../components/menu2';\nimport Modal from '../components/modal';\nimport NameText from '../components/name-text';\nimport Poll from '../components/poll';\nimport { api } from '../utils/api';\nimport { langDetector } from '../utils/browser-translator';\nimport emojifyText from '../utils/emojify-text';\nimport enhanceContent from '../utils/enhance-content';\nimport FilterContext from '../utils/filter-context';\nimport { isFiltered } from '../utils/filters';\nimport getDomain from '../utils/get-domain';\nimport getTranslateTargetLanguage from '../utils/get-translate-target-language';\nimport getHTMLText from '../utils/getHTMLText';\nimport handleContentLinks from '../utils/handle-content-links';\nimport htmlContentLength from '../utils/html-content-length';\nimport isRTL from '../utils/is-rtl';\nimport isMastodonLinkMaybe from '../utils/isMastodonLinkMaybe';\nimport localeMatch from '../utils/locale-match';\nimport mem from '../utils/mem';\nimport niceDateTime from '../utils/nice-date-time';\nimport openCompose from '../utils/open-compose';\nimport pmem from '../utils/pmem';\nimport safeBoundingBoxPadding from '../utils/safe-bounding-box-padding';\nimport shortenNumber from '../utils/shorten-number';\nimport showCompose from '../utils/show-compose';\nimport showToast from '../utils/show-toast';\nimport { speak, supportsTTS } from '../utils/speech';\nimport states, { getStatus, saveStatus, statusKey } from '../utils/states';\nimport statusPeek from '../utils/status-peek';\nimport store from '../utils/store';\nimport { getCurrentAccountID } from '../utils/store-utils';\nimport supports from '../utils/supports';\nimport unfurlMastodonLink from '../utils/unfurl-link';\nimport useTruncated from '../utils/useTruncated';\nimport visibilityIconsMap from '../utils/visibility-icons-map';\n\nimport Avatar from './avatar';\nimport Icon from './icon';\nimport Link from './link';\nimport Media, { isMediaCaptionLong } from './media';\nimport MenuLink from './menu-link';\nimport RelativeTime from './relative-time';\nimport TranslationBlock from './translation-block';\n\nconst SHOW_COMMENT_COUNT_LIMIT = 280;\nconst INLINE_TRANSLATE_LIMIT = 140;\n\nconst throttle = pThrottle({\n limit: 1,\n interval: 1000,\n});\nfunction fetchAccount(id, masto) {\n return masto.v1.accounts.$select(id).fetch();\n}\nconst memFetchAccount = pmem(throttle(fetchAccount));\n\nconst visibilityText = {\n public: msg`Public`,\n local: msg`Local`,\n unlisted: msg`Unlisted`,\n private: msg`Followers only`,\n direct: msg`Private mention`,\n};\n\nconst isIOS =\n window.ontouchstart !== undefined &&\n /iPad|iPhone|iPod/.test(navigator.userAgent);\n\nconst rtf = new Intl.RelativeTimeFormat();\n\nconst REACTIONS_LIMIT = 80;\n\nfunction getPollText(poll) {\n if (!poll?.options?.length) return '';\n return `📊:\\n${poll.options\n .map(\n (option) =>\n `- ${option.title}${\n option.votesCount >= 0 ? ` (${option.votesCount})` : ''\n }`,\n )\n .join('\\n')}`;\n}\nfunction getPostText(status, opts) {\n const { maskCustomEmojis } = opts || {};\n const { spoilerText, poll, emojis } = status;\n let { content } = status;\n if (maskCustomEmojis && emojis?.length) {\n const emojisRegex = new RegExp(\n `:(${emojis.map((e) => e.shortcode).join('|')}):`,\n 'g',\n );\n content = content.replace(emojisRegex, '⬚');\n }\n return (\n (spoilerText ? `${spoilerText}\\n\\n` : '') +\n getHTMLText(content) +\n getPollText(poll)\n );\n}\n\nfunction forgivingQSA(selectors = [], dom = document) {\n // Run QSA for list of selectors\n // If a selector return invalid selector error, try the next one\n for (const selector of selectors) {\n try {\n return dom.querySelectorAll(selector);\n } catch (e) {}\n }\n return [];\n}\n\nfunction isTranslateble(content, emojis) {\n if (!content) return false;\n // Remove custom emojis\n if (emojis?.length) {\n const emojisRegex = new RegExp(\n `:(${emojis.map((e) => e.shortcode).join('|')}):`,\n 'g',\n );\n content = content.replace(emojisRegex, '');\n }\n content = content.trim();\n if (!content) return false;\n const text = getHTMLText(content, {\n preProcess: (dom) => {\n // Remove .mention, pre, code, a:has(.invisible)\n for (const a of forgivingQSA(\n ['.mention, pre, code, a:has(.invisible)', '.mention, pre, code'],\n dom,\n )) {\n a.remove();\n }\n },\n });\n return !!text;\n}\n\nfunction getHTMLTextForDetectLang(content, emojis) {\n if (emojis?.length) {\n const emojisRegex = new RegExp(\n `:(${emojis.map((e) => e.shortcode).join('|')}):`,\n 'g',\n );\n content = content.replace(emojisRegex, '');\n }\n\n return getHTMLText(content, {\n preProcess: (dom) => {\n // Remove anything that can skew the language detection\n\n // Remove .mention, .hashtag, pre, code, a:has(.invisible)\n for (const a of forgivingQSA(\n [\n '.mention, .hashtag, pre, code, a:has(.invisible)',\n '.mention, .hashtag, pre, code',\n ],\n dom,\n )) {\n a.remove();\n }\n\n // Remove links that contains text that starts with https?://\n for (const a of dom.querySelectorAll('a')) {\n const text = a.innerText.trim();\n if (text.startsWith('https://') || text.startsWith('http://')) {\n a.remove();\n }\n }\n },\n });\n}\n\nconst HTTP_REGEX = /^http/i;\nconst PostContent =\n /*memo(*/\n ({ post, instance, previewMode }) => {\n const { content, emojis, language, mentions, url } = post;\n\n const divRef = useRef();\n useLayoutEffect(() => {\n if (!divRef.current) return;\n const dom = enhanceContent(content, {\n emojis,\n returnDOM: true,\n });\n // Remove target=\"_blank\" from links\n for (const a of dom.querySelectorAll('a.u-url[target=\"_blank\"]')) {\n if (!HTTP_REGEX.test(a.innerText.trim())) {\n a.removeAttribute('target');\n }\n }\n divRef.current.replaceChildren(dom.cloneNode(true));\n }, [content, emojis?.length]);\n\n return (\n <div\n ref={divRef}\n lang={language}\n dir=\"auto\"\n class=\"inner-content\"\n onClick={handleContentLinks({\n mentions,\n instance,\n previewMode,\n statusURL: url,\n })}\n // dangerouslySetInnerHTML={{\n // __html: enhanceContent(content, {\n // emojis,\n // postEnhanceDOM: (dom) => {\n // // Remove target=\"_blank\" from links\n // dom.querySelectorAll('a.u-url[target=\"_blank\"]').forEach((a) => {\n // if (!/http/i.test(a.innerText.trim())) {\n // a.removeAttribute('target');\n // }\n // });\n // },\n // }),\n // }}\n />\n );\n }; /*,\n (oldProps, newProps) => {\n const { post: oldPost } = oldProps;\n const { post: newPost } = newProps;\n return oldPost.content === newPost.content;\n },\n);*/\n\nconst SIZE_CLASS = {\n s: 'small',\n m: 'medium',\n l: 'large',\n};\n\nconst detectLang = pmem(async (text) => {\n text = text?.trim();\n\n // Ref: https://github.com/komodojp/tinyld/blob/develop/docs/benchmark.md\n // 500 should be enough for now, also the default max chars for Mastodon\n if (text?.length > 500) {\n return null;\n }\n\n if (langDetector) {\n const langs = await langDetector.detect(text);\n console.groupCollapsed(\n '💬 DETECTLANG BROWSER',\n langs.slice(0, 3).map((l) => l.detectedLanguage),\n );\n console.log(text, langs.slice(0, 3));\n console.groupEnd();\n const lang = langs[0];\n if (lang?.detectedLanguage && lang?.confidence > 0.5) {\n return lang.detectedLanguage;\n }\n }\n\n const { detectAll } = await import('tinyld/light');\n const langs = detectAll(text);\n console.groupCollapsed(\n '💬 DETECTLANG TINYLD',\n langs.slice(0, 3).map((l) => l.lang),\n );\n console.log(text, langs.slice(0, 3));\n console.groupEnd();\n const lang = langs[0];\n if (lang?.lang && lang?.accuracy > 0.5) {\n // If > 50% accurate, use it\n // It can be accurate if < 50% but better be safe\n // Though > 50% also can be inaccurate 🤷♂️\n return lang.lang;\n }\n return null;\n});\n\nconst readMoreText = msg`Read more →`;\n\n// All this work just to make sure this only lazy-run once\n// Because first run is slow due to intl-localematcher\nconst DIFFERENT_LANG_CHECK = {};\nconst checkDifferentLanguage = (\n language,\n contentTranslationHideLanguages = [],\n) => {\n if (!language) return false;\n const targetLanguage = getTranslateTargetLanguage(true);\n const different =\n language !== targetLanguage &&\n !localeMatch([language], [targetLanguage]) &&\n !contentTranslationHideLanguages.find(\n (l) => language === l || localeMatch([language], [l]),\n );\n if (different)\n DIFFERENT_LANG_CHECK[language + contentTranslationHideLanguages] = true;\n return different;\n};\n\nconst getCurrentAccID = mem(\n () => {\n return getCurrentAccountID();\n },\n {\n maxAge: 60 * 1000, // 1 minute\n },\n);\n\nconst getPrefs = mem(\n () => {\n return store.account.get('preferences') || {};\n },\n {\n maxAge: 60 * 1000, // 1 minute\n },\n);\n\nfunction Status({\n statusID,\n status,\n instance: propInstance,\n size = 'm',\n contentTextWeight,\n readOnly,\n enableCommentHint,\n withinContext,\n skeleton,\n enableTranslate,\n forceTranslate: _forceTranslate,\n previewMode,\n allowFilters,\n onMediaClick,\n quoted,\n onStatusLinkClick = () => {},\n showFollowedTags,\n allowContextMenu,\n showActionsBar,\n showReplyParent,\n mediaFirst,\n}) {\n const { _, t } = useLingui();\n\n if (skeleton) {\n return (\n <div\n class={`status skeleton ${\n mediaFirst ? 'status-media-first small' : ''\n }`}\n >\n {!mediaFirst && <Avatar size=\"xxl\" />}\n <div class=\"container\">\n <div class=\"meta\">\n {(size === 's' || mediaFirst) && <Avatar size=\"m\" />} ███ ████████\n </div>\n <div class=\"content-container\">\n {mediaFirst && <div class=\"media-first-container\" />}\n <div class={`content ${mediaFirst ? 'media-first-content' : ''}`}>\n <p>████ ████████</p>\n </div>\n </div>\n </div>\n </div>\n );\n }\n const { masto, instance, authenticated } = api({ instance: propInstance });\n const { instance: currentInstance } = api();\n const sameInstance = instance === currentInstance;\n\n let sKey = statusKey(statusID || status?.id, instance);\n const snapStates = useSnapshot(states);\n if (!status) {\n status = snapStates.statuses[sKey] || snapStates.statuses[statusID];\n sKey = statusKey(status?.id, instance);\n }\n if (!status) {\n return null;\n }\n\n const {\n account: {\n acct,\n avatar,\n avatarStatic,\n id: accountId,\n url: accountURL,\n displayName,\n username,\n emojis: accountEmojis,\n bot,\n group,\n } = {},\n id,\n repliesCount,\n reblogged,\n reblogsCount,\n favourited,\n favouritesCount,\n bookmarked,\n poll,\n muted,\n sensitive,\n spoilerText,\n visibility, // public, unlisted, private, direct\n language: _language,\n editedAt,\n filtered,\n card,\n createdAt,\n inReplyToId,\n inReplyToAccountId,\n content,\n mentions,\n mediaAttachments,\n reblog,\n uri,\n url,\n emojis,\n tags,\n pinned,\n // Non-API props\n _deleted,\n _pinned,\n // _filtered,\n // Non-Mastodon\n emojiReactions,\n } = status;\n\n const [languageAutoDetected, setLanguageAutoDetected] = useState(null);\n useEffect(() => {\n if (!content) return;\n if (_language) return;\n if (languageAutoDetected) return;\n let timer;\n timer = setTimeout(async () => {\n let detected = await detectLang(\n getHTMLTextForDetectLang(content, emojis),\n );\n setLanguageAutoDetected(detected);\n }, 1000);\n return () => clearTimeout(timer);\n }, [content, _language]);\n const language = _language || languageAutoDetected;\n\n // if (!mediaAttachments?.length) mediaFirst = false;\n const hasMediaAttachments = !!mediaAttachments?.length;\n if (mediaFirst && hasMediaAttachments) size = 's';\n\n const currentAccount = getCurrentAccID();\n const isSelf = useMemo(() => {\n return currentAccount && currentAccount === accountId;\n }, [accountId, currentAccount]);\n\n const filterContext = useContext(FilterContext);\n const filterInfo =\n !isSelf &&\n ((!readOnly && !previewMode) || allowFilters) &&\n isFiltered(filtered, filterContext);\n\n if (filterInfo?.action === 'hide') {\n return null;\n }\n\n console.debug('RENDER Status', id, status?.account?.displayName, quoted);\n\n const debugHover = (e) => {\n if (e.shiftKey) {\n console.log({\n ...status,\n });\n }\n };\n\n if (\n (allowFilters || size !== 'l') &&\n filterInfo &&\n filterInfo.action !== 'blur'\n ) {\n return (\n <FilteredStatus\n status={status}\n filterInfo={filterInfo}\n instance={instance}\n containerProps={{\n onMouseEnter: debugHover,\n }}\n showFollowedTags\n quoted={quoted}\n />\n );\n }\n\n const createdAtDate = new Date(createdAt);\n const editedAtDate = new Date(editedAt);\n\n let inReplyToAccountRef = mentions?.find(\n (mention) => mention.id === inReplyToAccountId,\n );\n if (!inReplyToAccountRef && inReplyToAccountId === id) {\n inReplyToAccountRef = { url: accountURL, username, displayName };\n }\n const [inReplyToAccount, setInReplyToAccount] = useState(inReplyToAccountRef);\n if (!withinContext && !inReplyToAccount && inReplyToAccountId) {\n const account = states.accounts[inReplyToAccountId];\n if (account) {\n setInReplyToAccount(account);\n } else {\n memFetchAccount(inReplyToAccountId, masto)\n .then((account) => {\n setInReplyToAccount(account);\n states.accounts[account.id] = account;\n })\n .catch((e) => {});\n }\n }\n const mentionSelf =\n inReplyToAccountId === currentAccount ||\n mentions?.find((mention) => mention.id === currentAccount);\n\n const readingExpandSpoilers = useMemo(() => {\n const prefs = getPrefs();\n return !!prefs['reading:expand:spoilers'];\n }, []);\n const readingExpandMedia = useMemo(() => {\n // default | show_all | hide_all\n // Ignore hide_all because it means hide *ALL* media including non-sensitive ones\n const prefs = getPrefs();\n return prefs['reading:expand:media']?.toLowerCase() || 'default';\n }, []);\n // FOR TESTING:\n // const readingExpandSpoilers = true;\n // const readingExpandMedia = 'show_all';\n const showSpoiler =\n previewMode || readingExpandSpoilers || !!snapStates.spoilers[id];\n const showSpoilerMedia =\n previewMode ||\n (readingExpandMedia === 'show_all' && filterInfo?.action !== 'blur') ||\n !!snapStates.spoilersMedia[id];\n\n if (reblog) {\n // If has statusID, means useItemID (cached in states)\n\n if (group) {\n return (\n <div\n data-state-post-id={sKey}\n class=\"status-group\"\n onMouseEnter={debugHover}\n >\n <div class=\"status-pre-meta\">\n <Icon icon=\"group\" size=\"l\" alt={t`Group`} />{' '}\n <NameText account={status.account} instance={instance} showAvatar />\n </div>\n <Status\n status={statusID ? null : reblog}\n statusID={statusID ? reblog.id : null}\n instance={instance}\n size={size}\n contentTextWeight={contentTextWeight}\n readOnly={readOnly}\n mediaFirst={mediaFirst}\n />\n </div>\n );\n }\n\n return (\n <div\n data-state-post-id={sKey}\n class=\"status-reblog\"\n onMouseEnter={debugHover}\n >\n <div class=\"status-pre-meta\">\n <Icon icon=\"rocket\" size=\"l\" />{' '}\n <Trans>\n <NameText account={status.account} instance={instance} showAvatar />{' '}\n <span>boosted</span>\n </Trans>\n </div>\n <Status\n status={statusID ? null : reblog}\n statusID={statusID ? reblog.id : null}\n instance={instance}\n size={size}\n contentTextWeight={contentTextWeight}\n readOnly={readOnly}\n enableCommentHint\n mediaFirst={mediaFirst}\n />\n </div>\n );\n }\n\n // Check followedTags\n const FollowedTagsParent = useCallback(\n ({ children }) => (\n <div\n data-state-post-id={sKey}\n class=\"status-followed-tags\"\n onMouseEnter={debugHover}\n >\n <div class=\"status-pre-meta\">\n <Icon icon=\"hashtag\" size=\"l\" />{' '}\n {snapStates.statusFollowedTags[sKey].slice(0, 3).map((tag) => (\n <Link\n key={tag}\n to={instance ? `/${instance}/t/${tag}` : `/t/${tag}`}\n class=\"status-followed-tag-item\"\n >\n {tag}\n </Link>\n ))}\n </div>\n {children}\n </div>\n ),\n [sKey, instance, snapStates.statusFollowedTags[sKey]],\n );\n const StatusParent =\n showFollowedTags && !!snapStates.statusFollowedTags[sKey]?.length\n ? FollowedTagsParent\n : Fragment;\n\n const isSizeLarge = size === 'l';\n\n const [forceTranslate, setForceTranslate] = useState(_forceTranslate);\n // const targetLanguage = getTranslateTargetLanguage(true);\n // const contentTranslationHideLanguages =\n // snapStates.settings.contentTranslationHideLanguages || [];\n const { contentTranslation, contentTranslationAutoInline } =\n snapStates.settings;\n if (!contentTranslation) enableTranslate = false;\n const inlineTranslate = useMemo(() => {\n if (\n !contentTranslation ||\n !contentTranslationAutoInline ||\n readOnly ||\n (withinContext && !isSizeLarge) ||\n previewMode ||\n spoilerText ||\n sensitive ||\n poll ||\n card ||\n mediaAttachments?.length\n ) {\n return false;\n }\n const contentLength = htmlContentLength(content);\n return contentLength > 0 && contentLength <= INLINE_TRANSLATE_LIMIT;\n }, [\n contentTranslation,\n contentTranslationAutoInline,\n readOnly,\n withinContext,\n isSizeLarge,\n previewMode,\n spoilerText,\n sensitive,\n poll,\n card,\n mediaAttachments,\n content,\n ]);\n\n const [showEdited, setShowEdited] = useState(false);\n const [showEmbed, setShowEmbed] = useState(false);\n\n const spoilerContentRef = useTruncated();\n const contentRef = useTruncated();\n const mediaContainerRef = useTruncated();\n\n const statusRef = useRef(null);\n\n const unauthInteractionErrorMessage = t`Sorry, your current logged-in instance can't interact with this post from another instance.`;\n\n const textWeight = useCallback(\n () =>\n Math.max(\n Math.round((spoilerText.length + htmlContentLength(content)) / 140) ||\n 1,\n 1,\n ),\n [spoilerText, content],\n );\n\n const createdDateText = createdAt && niceDateTime(createdAtDate);\n const editedDateText = editedAt && niceDateTime(editedAtDate);\n\n // Can boost if:\n // - authenticated AND\n // - visibility != direct OR\n // - visibility = private AND isSelf\n let canBoost =\n authenticated && visibility !== 'direct' && visibility !== 'private';\n if (visibility === 'private' && isSelf) {\n canBoost = true;\n }\n\n const replyStatus = (e) => {\n if (!sameInstance || !authenticated) {\n return alert(unauthInteractionErrorMessage);\n }\n // syntheticEvent comes from MenuItem\n if (e?.shiftKey || e?.syntheticEvent?.shiftKey) {\n const newWin = openCompose({\n replyToStatus: status,\n });\n if (newWin) return;\n }\n showCompose({\n replyToStatus: status,\n });\n };\n\n // Check if media has no descriptions\n const mediaNoDesc = useMemo(() => {\n return mediaAttachments.some(\n (attachment) => !attachment.description?.trim?.(),\n );\n }, [mediaAttachments]);\n\n const statusMonthsAgo = useMemo(() => {\n return Math.floor(\n (new Date() - createdAtDate) / (1000 * 60 * 60 * 24 * 30),\n );\n }, [createdAtDate]);\n\n // const boostStatus = async () => {\n // if (!sameInstance || !authenticated) {\n // alert(unauthInteractionErrorMessage);\n // return false;\n // }\n // try {\n // if (!reblogged) {\n // let confirmText = 'Boost this post?';\n // if (mediaNoDesc) {\n // confirmText += '\\n\\n⚠️ Some media have no descriptions.';\n // }\n // const yes = confirm(confirmText);\n // if (!yes) {\n // return false;\n // }\n // }\n // // Optimistic\n // states.statuses[sKey] = {\n // ...status,\n // reblogged: !reblogged,\n // reblogsCount: reblogsCount + (reblogged ? -1 : 1),\n // };\n // if (reblogged) {\n // const newStatus = await masto.v1.statuses.$select(id).unreblog();\n // saveStatus(newStatus, instance);\n // return true;\n // } else {\n // const newStatus = await masto.v1.statuses.$select(id).reblog();\n // saveStatus(newStatus, instance);\n // return true;\n // }\n // } catch (e) {\n // console.error(e);\n // // Revert optimistism\n // states.statuses[sKey] = status;\n // return false;\n // }\n // };\n const confirmBoostStatus = async () => {\n if (!sameInstance || !authenticated) {\n alert(unauthInteractionErrorMessage);\n return false;\n }\n try {\n // Optimistic\n states.statuses[sKey] = {\n ...status,\n reblogged: !reblogged,\n reblogsCount: reblogsCount + (reblogged ? -1 : 1),\n };\n if (reblogged) {\n const newStatus = await masto.v1.statuses.$select(id).unreblog();\n saveStatus(newStatus, instance);\n } else {\n const newStatus = await masto.v1.statuses.$select(id).reblog();\n saveStatus(newStatus, instance);\n }\n return true;\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n return false;\n }\n };\n\n const favouriteStatus = async () => {\n if (!sameInstance || !authenticated) {\n alert(unauthInteractionErrorMessage);\n return false;\n }\n try {\n // Optimistic\n states.statuses[sKey] = {\n ...status,\n favourited: !favourited,\n favouritesCount: favouritesCount + (favourited ? -1 : 1),\n };\n if (favourited) {\n const newStatus = await masto.v1.statuses.$select(id).unfavourite();\n saveStatus(newStatus, instance);\n } else {\n const newStatus = await masto.v1.statuses.$select(id).favourite();\n saveStatus(newStatus, instance);\n }\n return true;\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n return false;\n }\n };\n const favouriteStatusNotify = async () => {\n try {\n const done = await favouriteStatus();\n if (!isSizeLarge && done) {\n showToast(\n favourited\n ? t`Unliked @${username || acct}'s post`\n : t`Liked @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n };\n\n const bookmarkStatus = async () => {\n if (!supports('@mastodon/post-bookmark')) return;\n if (!sameInstance || !authenticated) {\n alert(unauthInteractionErrorMessage);\n return false;\n }\n try {\n // Optimistic\n states.statuses[sKey] = {\n ...status,\n bookmarked: !bookmarked,\n };\n if (bookmarked) {\n const newStatus = await masto.v1.statuses.$select(id).unbookmark();\n saveStatus(newStatus, instance);\n } else {\n const newStatus = await masto.v1.statuses.$select(id).bookmark();\n saveStatus(newStatus, instance);\n }\n return true;\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n return false;\n }\n };\n const bookmarkStatusNotify = async () => {\n try {\n const done = await bookmarkStatus();\n if (!isSizeLarge && done) {\n showToast(\n bookmarked\n ? t`Unbookmarked @${username || acct}'s post`\n : t`Bookmarked @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n };\n\n // const differentLanguage =\n // !!language &&\n // language !== targetLanguage &&\n // !localeMatch([language], [targetLanguage]) &&\n // !contentTranslationHideLanguages.find(\n // (l) => language === l || localeMatch([language], [l]),\n // );\n const contentTranslationHideLanguages =\n snapStates.settings.contentTranslationHideLanguages || [];\n const [differentLanguage, setDifferentLanguage] = useState(\n () =>\n DIFFERENT_LANG_CHECK[language + contentTranslationHideLanguages] ||\n checkDifferentLanguage(language, contentTranslationHideLanguages),\n );\n useEffect(() => {\n if (!language || differentLanguage) {\n return;\n }\n if (\n !differentLanguage &&\n DIFFERENT_LANG_CHECK[language + contentTranslationHideLanguages]\n ) {\n setDifferentLanguage(true);\n return;\n }\n let timeout = setTimeout(() => {\n const different = checkDifferentLanguage(\n language,\n contentTranslationHideLanguages,\n );\n if (different) setDifferentLanguage(different);\n }, 1);\n return () => clearTimeout(timeout);\n }, [language, differentLanguage, contentTranslationHideLanguages]);\n\n const reblogIterator = useRef();\n const favouriteIterator = useRef();\n async function fetchBoostedLikedByAccounts(firstLoad) {\n if (firstLoad) {\n reblogIterator.current = masto.v1.statuses\n .$select(statusID)\n .rebloggedBy.list({\n limit: REACTIONS_LIMIT,\n });\n favouriteIterator.current = masto.v1.statuses\n .$select(statusID)\n .favouritedBy.list({\n limit: REACTIONS_LIMIT,\n });\n }\n const [{ value: reblogResults }, { value: favouriteResults }] =\n await Promise.allSettled([\n reblogIterator.current.next(),\n favouriteIterator.current.next(),\n ]);\n if (reblogResults.value?.length || favouriteResults.value?.length) {\n const accounts = [];\n if (reblogResults.value?.length) {\n accounts.push(\n ...reblogResults.value.map((a) => {\n a._types = ['reblog'];\n return a;\n }),\n );\n }\n if (favouriteResults.value?.length) {\n accounts.push(\n ...favouriteResults.value.map((a) => {\n a._types = ['favourite'];\n return a;\n }),\n );\n }\n return {\n value: accounts,\n done: reblogResults.done && favouriteResults.done,\n };\n }\n return {\n value: [],\n done: true,\n };\n }\n\n const actionsRef = useRef();\n const isPublic = ['public', 'unlisted'].includes(visibility);\n const isPinnable = ['public', 'unlisted', 'private'].includes(visibility);\n const menuFooter =\n mediaNoDesc && !reblogged ? (\n <div class=\"footer\">\n <Icon icon=\"alert\" />\n <Trans>Some media have no descriptions.</Trans>\n </div>\n ) : (\n statusMonthsAgo >= 3 && (\n <div class=\"footer\">\n <Icon icon=\"info\" />\n <span>\n <Trans>\n Old post (<strong>{rtf.format(-statusMonthsAgo, 'month')}</strong>\n )\n </Trans>\n </span>\n </div>\n )\n );\n const StatusMenuItems = (\n <>\n {!isSizeLarge && sameInstance && (\n <>\n <div class=\"menu-control-group-horizontal status-menu\">\n <MenuItem onClick={replyStatus}>\n <Icon icon=\"comment\" />\n <span>\n {repliesCount > 0 ? shortenNumber(repliesCount) : t`Reply`}\n </span>\n </MenuItem>\n <MenuConfirm\n subMenu\n confirmLabel={\n <>\n <Icon icon=\"rocket\" />\n <span>{reblogged ? t`Unboost` : t`Boost`}</span>\n </>\n }\n className={`menu-reblog ${reblogged ? 'checked' : ''}`}\n menuExtras={\n <MenuItem\n onClick={() => {\n showCompose({\n draftStatus: {\n status: `\\n${url}`,\n },\n });\n }}\n >\n <Icon icon=\"quote\" />\n <span>\n <Trans>Quote</Trans>\n </span>\n </MenuItem>\n }\n menuFooter={menuFooter}\n disabled={!canBoost}\n onClick={async () => {\n try {\n const done = await confirmBoostStatus();\n if (!isSizeLarge && done) {\n showToast(\n reblogged\n ? t`Unboosted @${username || acct}'s post`\n : t`Boosted @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n }}\n >\n <Icon icon=\"rocket\" />\n <span>\n {reblogsCount > 0\n ? shortenNumber(reblogsCount)\n : reblogged\n ? t`Unboost`\n : t`Boost…`}\n </span>\n </MenuConfirm>\n <MenuItem\n onClick={favouriteStatusNotify}\n className={`menu-favourite ${favourited ? 'checked' : ''}`}\n >\n <Icon icon=\"heart\" />\n <span>\n {favouritesCount > 0\n ? shortenNumber(favouritesCount)\n : favourited\n ? t`Unlike`\n : t`Like`}\n </span>\n </MenuItem>\n {supports('@mastodon/post-bookmark') && (\n <MenuItem\n onClick={bookmarkStatusNotify}\n className={`menu-bookmark ${bookmarked ? 'checked' : ''}`}\n >\n <Icon icon=\"bookmark\" />\n <span>{bookmarked ? t`Unbookmark` : t`Bookmark`}</span>\n </MenuItem>\n )}\n </div>\n </>\n )}\n {!isSizeLarge && sameInstance && (isSizeLarge || showActionsBar) && (\n <MenuDivider />\n )}\n {(isSizeLarge || showActionsBar) && (\n <>\n <MenuItem\n onClick={() => {\n states.showGenericAccounts = {\n heading: t`Boosted/Liked by…`,\n fetchAccounts: fetchBoostedLikedByAccounts,\n instance,\n showReactions: true,\n postID: sKey,\n };\n }}\n >\n <Icon icon=\"react\" />\n <span>\n <Trans>Boosted/Liked by…</Trans>\n </span>\n </MenuItem>\n </>\n )}\n {(isSizeLarge ||\n (!mediaFirst &&\n (enableTranslate || !language || differentLanguage))) && (\n <MenuDivider />\n )}\n {!mediaFirst && (enableTranslate || !language || differentLanguage) && (\n <div class={supportsTTS ? 'menu-horizontal' : ''}>\n {enableTranslate ? (\n <MenuItem\n disabled={forceTranslate}\n onClick={() => setForceTranslate(true)}\n >\n <Icon icon=\"translate\" />\n <span>\n <Trans>Translate</Trans>\n </span>\n </MenuItem>\n ) : (\n <MenuLink\n to={`${instance ? `/${instance}` : ''}/s/${id}?translate=1`}\n >\n <Icon icon=\"translate\" />\n <span>\n <Trans>Translate</Trans>\n </span>\n </MenuLink>\n )}\n {supportsTTS && (\n <MenuItem\n onClick={() => {\n try {\n const postText = getPostText(status);\n if (postText) {\n speak(postText, language);\n }\n } catch (error) {\n console.error('Failed to speak text:', error);\n }\n }}\n >\n <Icon icon=\"speak\" />\n <span>\n <Trans>Speak</Trans>\n </span>\n </MenuItem>\n )}\n </div>\n )}\n {isSizeLarge && (\n <MenuItem\n onClick={() => {\n try {\n const postText = getPostText(status);\n navigator.clipboard.writeText(postText);\n showToast(t`Post text copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy post text`);\n }\n }}\n >\n <Icon icon=\"clipboard\" />\n <span>\n <Trans>Copy post text</Trans>\n </span>\n </MenuItem>\n )}\n {((!isSizeLarge && sameInstance) ||\n enableTranslate ||\n !language ||\n differentLanguage) && <MenuDivider />}\n {!isSizeLarge && (\n <>\n <MenuLink\n to={instance ? `/${instance}/s/${id}` : `/s/${id}`}\n onClick={(e) => {\n onStatusLinkClick(e, status);\n }}\n >\n <Icon icon=\"arrows-right\" />\n <small>\n <Trans>\n View post by{' '}\n <span class=\"bidi-isolate\">@{username || acct}</span>\n </Trans>\n <br />\n <span class=\"more-insignificant\">\n {_(visibilityText[visibility])} • {createdDateText}\n </span>\n </small>\n </MenuLink>\n </>\n )}\n {!!editedAt && (\n <>\n <MenuItem\n onClick={() => {\n setShowEdited(id);\n }}\n >\n <Icon icon=\"history\" />\n <small>\n <Trans>Show Edit History</Trans>\n <br />\n <span class=\"more-insignificant\">\n <Trans>Edited: {editedDateText}</Trans>\n </span>\n </small>\n </MenuItem>\n </>\n )}\n <MenuItem href={url} target=\"_blank\">\n <Icon icon=\"external\" />\n <small\n class=\"menu-double-lines\"\n style={{\n maxWidth: '16em',\n }}\n >\n {nicePostURL(url)}\n </small>\n </MenuItem>\n <div class=\"menu-horizontal\">\n <MenuItem\n onClick={() => {\n // Copy url to clipboard\n try {\n navigator.clipboard.writeText(url);\n showToast(t`Link copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy link`);\n }\n }}\n >\n <Icon icon=\"link\" />\n <span>\n <Trans>Copy</Trans>\n </span>\n </MenuItem>\n {isPublic &&\n navigator?.share &&\n navigator?.canShare?.({\n url,\n }) && (\n <MenuItem\n onClick={() => {\n try {\n navigator.share({\n url,\n });\n } catch (e) {\n console.error(e);\n alert(t`Sharing doesn't seem to work.`);\n }\n }}\n >\n <Icon icon=\"share\" />\n <span>\n <Trans>Share…</Trans>\n </span>\n </MenuItem>\n )}\n </div>\n {isPublic && isSizeLarge && (\n <MenuItem\n onClick={() => {\n setShowEmbed(true);\n }}\n >\n <Icon icon=\"code\" />\n <span>\n <Trans>Embed post</Trans>\n </span>\n </MenuItem>\n )}\n {(isSelf || mentionSelf) && <MenuDivider />}\n {(isSelf || mentionSelf) && (\n <MenuItem\n onClick={async () => {\n try {\n const newStatus = await masto.v1.statuses\n .$select(id)\n [muted ? 'unmute' : 'mute']();\n saveStatus(newStatus, instance);\n showToast(\n muted ? t`Conversation unmuted` : t`Conversation muted`,\n );\n } catch (e) {\n console.error(e);\n showToast(\n muted\n ? t`Unable to unmute conversation`\n : t`Unable to mute conversation`,\n );\n }\n }}\n >\n {muted ? (\n <>\n <Icon icon=\"unmute\" />\n <span>\n <Trans>Unmute conversation</Trans>\n </span>\n </>\n ) : (\n <>\n <Icon icon=\"mute\" />\n <span>\n <Trans>Mute conversation</Trans>\n </span>\n </>\n )}\n </MenuItem>\n )}\n {isSelf && isPinnable && (\n <MenuItem\n onClick={async () => {\n try {\n const newStatus = await masto.v1.statuses\n .$select(id)\n [pinned ? 'unpin' : 'pin']();\n saveStatus(newStatus, instance);\n showToast(\n pinned\n ? t`Post unpinned from profile`\n : t`Post pinned to profile`,\n );\n } catch (e) {\n console.error(e);\n showToast(\n pinned ? t`Unable to unpin post` : t`Unable to pin post`,\n );\n }\n }}\n >\n {pinned ? (\n <>\n <Icon icon=\"unpin\" />\n <span>\n <Trans>Unpin from profile</Trans>\n </span>\n </>\n ) : (\n <>\n <Icon icon=\"pin\" />\n <span>\n <Trans>Pin to profile</Trans>\n </span>\n </>\n )}\n </MenuItem>\n )}\n {isSelf && (\n <div class=\"menu-horizontal\">\n {supports('@mastodon/post-edit') && (\n <MenuItem\n onClick={() => {\n showCompose({\n editStatus: status,\n });\n }}\n >\n <Icon icon=\"pencil\" />\n <span>\n <Trans>Edit</Trans>\n </span>\n </MenuItem>\n )}\n {isSizeLarge && (\n <MenuConfirm\n subMenu\n confirmLabel={\n <>\n <Icon icon=\"trash\" />\n <span>\n <Trans>Delete this post?</Trans>\n </span>\n </>\n }\n itemProps={{\n className: 'danger',\n }}\n menuItemClassName=\"danger\"\n onClick={() => {\n // const yes = confirm('Delete this post?');\n // if (yes) {\n (async () => {\n try {\n await masto.v1.statuses.$select(id).remove();\n const cachedStatus = getStatus(id, instance);\n cachedStatus._deleted = true;\n showToast(t`Post deleted`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to delete post`);\n }\n })();\n // }\n }}\n >\n <Icon icon=\"trash\" />\n <span>\n <Trans>Delete…</Trans>\n </span>\n </MenuConfirm>\n )}\n </div>\n )}\n {!isSelf && isSizeLarge && (\n <>\n <MenuDivider />\n <MenuItem\n className=\"danger\"\n onClick={() => {\n states.showReportModal = {\n account: status.account,\n post: status,\n };\n }}\n >\n <Icon icon=\"flag\" />\n <span>\n <Trans>Report post…</Trans>\n </span>\n </MenuItem>\n </>\n )}\n </>\n );\n\n const contextMenuRef = useRef();\n const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);\n const [contextMenuProps, setContextMenuProps] = useState({});\n\n const showContextMenu =\n allowContextMenu || (!isSizeLarge && !previewMode && !_deleted && !quoted);\n\n // Only iOS/iPadOS browsers don't support contextmenu\n // Some comments report iPadOS might support contextmenu if a mouse is connected\n const bindLongPressContext = useLongPress(\n isIOS && showContextMenu\n ? (e) => {\n if (e.pointerType === 'mouse') return;\n // There's 'pen' too, but not sure if contextmenu event would trigger from a pen\n\n const { clientX, clientY } = e.touches?.[0] || e;\n // link detection copied from onContextMenu because here it works\n const link = e.target.closest('a');\n if (\n link &&\n statusRef.current.contains(link) &&\n !link.getAttribute('href').startsWith('#')\n )\n return;\n e.preventDefault();\n setContextMenuProps({\n anchorPoint: {\n x: clientX,\n y: clientY,\n },\n direction: 'right',\n });\n setIsContextMenuOpen(true);\n }\n : null,\n {\n threshold: 600,\n captureEvent: true,\n detect: 'touch',\n cancelOnMovement: 2, // true allows movement of up to 25 pixels\n },\n );\n\n const hotkeysEnabled = !readOnly && !previewMode && !quoted;\n const rRef = useHotkeys('r, shift+r', replyStatus, {\n enabled: hotkeysEnabled,\n useKey: true,\n });\n const fRef = useHotkeys('f, l', favouriteStatusNotify, {\n enabled: hotkeysEnabled,\n useKey: true,\n });\n const dRef = useHotkeys('d', bookmarkStatusNotify, {\n enabled: hotkeysEnabled,\n useKey: true,\n });\n const bRef = useHotkeys(\n 'shift+b',\n (e) => {\n // Need shiftKey check due to useKey: true\n if (!e.shiftKey) return;\n\n (async () => {\n try {\n const done = await confirmBoostStatus();\n if (!isSizeLarge && done) {\n showToast(\n reblogged\n ? t`Unboosted @${username || acct}'s post`\n : t`Boosted @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n })();\n },\n {\n enabled: hotkeysEnabled && canBoost,\n useKey: true,\n },\n );\n const xRef = useHotkeys(\n 'x',\n (e) => {\n const activeStatus = document.activeElement.closest(\n '.status-link, .status-focus',\n );\n if (activeStatus) {\n const spoilerButton = activeStatus.querySelector(\n '.spoiler-button:not(.spoiling)',\n );\n if (spoilerButton) {\n e.stopPropagation();\n spoilerButton.click();\n } else {\n const spoilerMediaButton = activeStatus.querySelector(\n '.spoiler-media-button:not(.spoiling)',\n );\n if (spoilerMediaButton) {\n e.stopPropagation();\n spoilerMediaButton.click();\n }\n }\n }\n },\n {\n useKey: true,\n },\n );\n\n const displayedMediaAttachments = mediaAttachments.slice(\n 0,\n isSizeLarge ? undefined : 4,\n );\n const showMultipleMediaCaptions =\n mediaAttachments.length > 1 &&\n displayedMediaAttachments.some(\n (media) => !!media.description && !isMediaCaptionLong(media.description),\n );\n const captionChildren = useMemo(() => {\n if (!showMultipleMediaCaptions) return null;\n const attachments = [];\n displayedMediaAttachments.forEach((media, i) => {\n if (!media.description) return;\n const index = attachments.findIndex(\n (attachment) => attachment.media.description === media.description,\n );\n if (index === -1) {\n attachments.push({\n media,\n indices: [i],\n });\n } else {\n attachments[index].indices.push(i);\n }\n });\n return attachments.map(({ media, indices }) => (\n <div\n key={media.id}\n data-caption-index={indices.map((i) => i + 1).join(' ')}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n states.showMediaAlt = {\n alt: media.description,\n lang: language,\n };\n }}\n title={media.description}\n >\n <sup>{indices.map((i) => i + 1).join(' ')}</sup> {media.description}\n </div>\n ));\n\n // return displayedMediaAttachments.map(\n // (media, i) =>\n // !!media.description && (\n // <div\n // key={media.id}\n // data-caption-index={i + 1}\n // onClick={(e) => {\n // e.preventDefault();\n // e.stopPropagation();\n // states.showMediaAlt = {\n // alt: media.description,\n // lang: language,\n // };\n // }}\n // title={media.description}\n // >\n // <sup>{i + 1}</sup> {media.description}\n // </div>\n // ),\n // );\n }, [showMultipleMediaCaptions, displayedMediaAttachments, language]);\n\n const isThread = useMemo(() => {\n return (\n (!!inReplyToId && inReplyToAccountId === status.account?.id) ||\n !!snapStates.statusThreadNumber[sKey]\n );\n }, [\n inReplyToId,\n inReplyToAccountId,\n status.account?.id,\n snapStates.statusThreadNumber[sKey],\n ]);\n\n const showCommentHint = useMemo(() => {\n return (\n enableCommentHint &&\n !isThread &&\n !withinContext &&\n !inReplyToId &&\n visibility === 'public' &&\n repliesCount > 0\n );\n }, [\n enableCommentHint,\n isThread,\n withinContext,\n inReplyToId,\n repliesCount,\n visibility,\n ]);\n const showCommentCount = useMemo(() => {\n if (\n card ||\n poll ||\n sensitive ||\n spoilerText ||\n mediaAttachments?.length ||\n isThread ||\n withinContext ||\n inReplyToId ||\n repliesCount <= 0\n ) {\n return false;\n }\n const questionRegex = /[???︖❓❔⁇⁈⁉¿‽؟]/;\n const containsQuestion = questionRegex.test(content);\n if (!containsQuestion) return false;\n const contentLength = htmlContentLength(content);\n if (contentLength > 0 && contentLength <= SHOW_COMMENT_COUNT_LIMIT) {\n return true;\n }\n }, [\n card,\n poll,\n sensitive,\n spoilerText,\n mediaAttachments,\n reblog,\n isThread,\n withinContext,\n inReplyToId,\n repliesCount,\n content,\n ]);\n\n return (\n <StatusParent>\n {showReplyParent && !!(inReplyToId && inReplyToAccountId) && (\n <StatusCompact sKey={sKey} />\n )}\n <article\n data-state-post-id={sKey}\n ref={(node) => {\n statusRef.current = node;\n // Use parent node if it's in focus\n // Use case: <a><status /></a>\n // When navigating (j/k), the <a> is focused instead of <status />\n // Hotkey binding doesn't bubble up thus this hack\n const nodeRef =\n node?.closest?.(\n '.timeline-item, .timeline-item-alt, .status-link, .status-focus',\n ) || node;\n rRef.current = nodeRef;\n fRef.current = nodeRef;\n dRef.current = nodeRef;\n bRef.current = nodeRef;\n xRef.current = nodeRef;\n }}\n tabindex=\"-1\"\n class={`status ${\n !withinContext && inReplyToId && inReplyToAccount\n ? 'status-reply-to'\n : ''\n } visibility-${visibility} ${_pinned ? 'status-pinned' : ''} ${\n SIZE_CLASS[size]\n } ${_deleted ? 'status-deleted' : ''} ${quoted ? 'status-card' : ''} ${\n isContextMenuOpen ? 'status-menu-open' : ''\n } ${mediaFirst && hasMediaAttachments ? 'status-media-first' : ''}`}\n onMouseEnter={debugHover}\n onContextMenu={(e) => {\n if (!showContextMenu) return;\n if (e.metaKey) return;\n // console.log('context menu', e);\n const link = e.target.closest('a');\n if (\n link &&\n statusRef.current.contains(link) &&\n !link.getAttribute('href').startsWith('#')\n )\n return;\n\n // If there's selected text, don't show custom context menu\n const selection = window.getSelection?.();\n if (selection.toString().length > 0) {\n const { anchorNode } = selection;\n if (statusRef.current?.contains(anchorNode)) {\n return;\n }\n }\n e.preventDefault();\n setContextMenuProps({\n anchorPoint: {\n x: e.clientX,\n y: e.clientY,\n },\n direction: 'right',\n });\n setIsContextMenuOpen(true);\n }}\n {...(showContextMenu ? bindLongPressContext() : {})}\n >\n {showContextMenu && (\n <ControlledMenu\n ref={contextMenuRef}\n state={isContextMenuOpen ? 'open' : undefined}\n {...contextMenuProps}\n onClose={(e) => {\n setIsContextMenuOpen(false);\n // statusRef.current?.focus?.();\n if (e?.reason === 'click') {\n statusRef.current?.closest('[tabindex]')?.focus?.();\n }\n }}\n portal={{\n target: document.body,\n }}\n containerProps={{\n style: {\n // Higher than the backdrop\n zIndex: 1001,\n },\n onClick: () => {\n contextMenuRef.current?.closeMenu?.();\n },\n }}\n overflow=\"auto\"\n boundingBoxPadding={safeBoundingBoxPadding()}\n unmountOnClose\n >\n {StatusMenuItems}\n </ControlledMenu>\n )}\n {showActionsBar &&\n size !== 'l' &&\n !previewMode &&\n !readOnly &&\n !_deleted &&\n !quoted && (\n <div\n class={`status-actions ${\n isContextMenuOpen === 'actions-bar' ? 'open' : ''\n }`}\n ref={actionsRef}\n >\n <StatusButton\n size=\"s\"\n title={t`Reply`}\n alt={t`Reply`}\n class=\"reply-button\"\n icon=\"comment\"\n iconSize=\"m\"\n onClick={replyStatus}\n />\n <StatusButton\n size=\"s\"\n checked={favourited}\n title={[t`Like`, t`Unlike`]}\n alt={[t`Like`, t`Liked`]}\n class=\"favourite-button\"\n icon=\"heart\"\n iconSize=\"m\"\n count={favouritesCount}\n onClick={favouriteStatusNotify}\n />\n <button\n type=\"button\"\n title={t`More`}\n class=\"plain more-button\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n setContextMenuProps({\n anchorRef: {\n current: e.currentTarget,\n },\n align: 'start',\n direction: 'left',\n gap: 0,\n shift: -8,\n });\n setIsContextMenuOpen('actions-bar');\n }}\n >\n <Icon icon=\"more2\" size=\"m\" alt={t`More`} />\n </button>\n </div>\n )}\n {size !== 'l' && (\n <div class=\"status-badge\">\n {reblogged && (\n <Icon class=\"reblog\" icon=\"rocket\" size=\"s\" alt={t`Boosted`} />\n )}\n {favourited && (\n <Icon class=\"favourite\" icon=\"heart\" size=\"s\" alt={t`Liked`} />\n )}\n {bookmarked && (\n <Icon\n class=\"bookmark\"\n icon=\"bookmark\"\n size=\"s\"\n alt={t`Bookmarked`}\n />\n )}\n {_pinned && (\n <Icon class=\"pin\" icon=\"pin\" size=\"s\" alt={t`Pinned`} />\n )}\n </div>\n )}\n {size !== 's' && (\n <a\n href={accountURL}\n tabindex=\"-1\"\n // target=\"_blank\"\n title={`@${acct}`}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n states.showAccount = {\n account: status.account,\n instance,\n };\n }}\n >\n <Avatar url={avatarStatic || avatar} size=\"xxl\" squircle={bot} />\n </a>\n )}\n <div class=\"container\">\n {!!(status.account || createdAt) && (\n <div class=\"meta\">\n <span class=\"meta-name\">\n <NameText\n account={status.account}\n instance={instance}\n showAvatar={size === 's'}\n showAcct={isSizeLarge}\n />\n </span>\n {/* {inReplyToAccount && !withinContext && size !== 's' && (\n <>\n {' '}\n <span class=\"ib\">\n <Icon icon=\"arrow-right\" class=\"arrow\" />{' '}\n <NameText account={inReplyToAccount} instance={instance} short />\n </span>\n </>\n )} */}\n {/* </span> */}{' '}\n {size !== 'l' &&\n (_deleted ? (\n <span class=\"status-deleted-tag\">\n <Trans>Deleted</Trans>\n </span>\n ) : url && !previewMode && !readOnly && !quoted ? (\n <Link\n to={instance ? `/${instance}/s/${id}` : `/s/${id}`}\n onClick={(e) => {\n if (\n e.metaKey ||\n e.ctrlKey ||\n e.shiftKey ||\n e.altKey ||\n e.which === 2\n ) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n onStatusLinkClick?.(e, status);\n setContextMenuProps({\n anchorRef: {\n current: e.currentTarget,\n },\n align: 'end',\n direction: 'bottom',\n gap: 4,\n });\n setIsContextMenuOpen(true);\n }}\n class={`time ${\n isContextMenuOpen && contextMenuProps?.anchorRef\n ? 'is-open'\n : ''\n }`}\n >\n {showCommentHint && !showCommentCount ? (\n <Icon\n icon=\"comment2\"\n size=\"s\"\n // alt={`${repliesCount} ${\n // repliesCount === 1 ? 'reply' : 'replies'\n // }`}\n alt={plural(repliesCount, {\n one: '# reply',\n other: '# replies',\n })}\n />\n ) : (\n visibility !== 'public' &&\n visibility !== 'direct' && (\n <Icon\n icon={visibilityIconsMap[visibility]}\n alt={_(visibilityText[visibility])}\n size=\"s\"\n />\n )\n )}{' '}\n <RelativeTime datetime={createdAtDate} format=\"micro\" />\n {!previewMode && !readOnly && (\n <Icon icon=\"more2\" class=\"more\" alt={t`More`} />\n )}\n </Link>\n ) : (\n // <Menu\n // instanceRef={menuInstanceRef}\n // portal={{\n // target: document.body,\n // }}\n // containerProps={{\n // style: {\n // // Higher than the backdrop\n // zIndex: 1001,\n // },\n // onClick: (e) => {\n // if (e.target === e.currentTarget)\n // menuInstanceRef.current?.closeMenu?.();\n // },\n // }}\n // align=\"end\"\n // gap={4}\n // overflow=\"auto\"\n // viewScroll=\"close\"\n // boundingBoxPadding=\"8 8 8 8\"\n // unmountOnClose\n // menuButton={({ open }) => (\n // <Link\n // to={instance ? `/${instance}/s/${id}` : `/s/${id}`}\n // onClick={(e) => {\n // e.preventDefault();\n // e.stopPropagation();\n // onStatusLinkClick?.(e, status);\n // }}\n // class={`time ${open ? 'is-open' : ''}`}\n // >\n // <Icon\n // icon={visibilityIconsMap[visibility]}\n // alt={visibilityText[visibility]}\n // size=\"s\"\n // />{' '}\n // <RelativeTime datetime={createdAtDate} format=\"micro\" />\n // </Link>\n // )}\n // >\n // {StatusMenuItems}\n // </Menu>\n <span class=\"time\">\n {visibility !== 'public' && visibility !== 'direct' && (\n <>\n <Icon\n icon={visibilityIconsMap[visibility]}\n alt={_(visibilityText[visibility])}\n size=\"s\"\n />{' '}\n </>\n )}\n <RelativeTime datetime={createdAtDate} format=\"micro\" />\n </span>\n ))}\n </div>\n )}\n {visibility === 'direct' && (\n <>\n <div class=\"status-direct-badge\">\n <Trans>Private mention</Trans>\n </div>{' '}\n </>\n )}\n {!withinContext && (\n <>\n {isThread ? (\n <div class=\"status-thread-badge\">\n <Icon icon=\"thread\" size=\"s\" />\n <Trans>\n Thread\n {snapStates.statusThreadNumber[sKey]\n ? ` ${snapStates.statusThreadNumber[sKey]}/X`\n : ''}\n </Trans>\n </div>\n ) : (\n !!inReplyToId &&\n !!inReplyToAccount &&\n (!!spoilerText ||\n !mentions.find((mention) => {\n return mention.id === inReplyToAccountId;\n })) && (\n <div class=\"status-reply-badge\">\n <Icon icon=\"reply\" />{' '}\n <NameText\n account={inReplyToAccount}\n instance={instance}\n short\n />\n </div>\n )\n )}\n </>\n )}\n <div\n class={`content-container ${\n spoilerText || sensitive || filterInfo?.action === 'blur'\n ? 'has-spoiler'\n : ''\n } ${showSpoiler ? 'show-spoiler' : ''} ${\n showSpoilerMedia ? 'show-media' : ''\n }`}\n data-content-text-weight={contentTextWeight ? textWeight() : null}\n style={\n (isSizeLarge || contentTextWeight) && {\n '--content-text-weight': textWeight(),\n }\n }\n >\n {mediaFirst && hasMediaAttachments ? (\n <>\n {(!!spoilerText || !!sensitive) && !readingExpandSpoilers && (\n <>\n {!!spoilerText && (\n <span\n class=\"spoiler-content media-first-spoiler-content\"\n lang={language}\n dir=\"auto\"\n ref={spoilerContentRef}\n data-read-more={_(readMoreText)}\n >\n <EmojiText text={spoilerText} emojis={emojis} />{' '}\n </span>\n )}\n <button\n class={`light spoiler-button media-first-spoiler-button ${\n showSpoiler ? 'spoiling' : ''\n }`}\n type=\"button\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n if (showSpoiler) {\n delete states.spoilers[id];\n if (!readingExpandSpoilers) {\n delete states.spoilersMedia[id];\n }\n } else {\n states.spoilers[id] = true;\n if (!readingExpandSpoilers) {\n states.spoilersMedia[id] = true;\n }\n }\n }}\n >\n <Icon icon={showSpoiler ? 'eye-open' : 'eye-close'} />{' '}\n {showSpoiler ? t`Show less` : t`Show content`}\n </button>\n </>\n )}\n <MediaFirstContainer\n mediaAttachments={mediaAttachments}\n language={language}\n postID={id}\n instance={instance}\n />\n {!!content && (\n <div class=\"media-first-content content\" ref={contentRef}>\n <PostContent\n post={status}\n instance={instance}\n previewMode={previewMode}\n />\n </div>\n )}\n </>\n ) : (\n <>\n {!!spoilerText && (\n <>\n <div\n class=\"content spoiler-content\"\n lang={language}\n dir=\"auto\"\n ref={spoilerContentRef}\n data-read-more={_(readMoreText)}\n >\n <p>\n <EmojiText text={spoilerText} emojis={emojis} />\n </p>\n </div>\n {readingExpandSpoilers || previewMode ? (\n <div class=\"spoiler-divider\">\n <Icon icon=\"eye-open\" /> <Trans>Content warning</Trans>\n </div>\n ) : (\n <button\n class={`light spoiler-button ${\n showSpoiler ? 'spoiling' : ''\n }`}\n type=\"button\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n if (showSpoiler) {\n delete states.spoilers[id];\n if (!readingExpandSpoilers) {\n delete states.spoilersMedia[id];\n }\n } else {\n states.spoilers[id] = true;\n if (!readingExpandSpoilers) {\n states.spoilersMedia[id] = true;\n }\n }\n }}\n >\n <Icon icon={showSpoiler ? 'eye-open' : 'eye-close'} />{' '}\n {showSpoiler ? t`Show less` : t`Show content`}\n </button>\n )}\n </>\n )}\n {!!content && (\n <div\n class=\"content\"\n ref={contentRef}\n data-read-more={_(readMoreText)}\n inert={!!spoilerText && !showSpoiler ? true : undefined}\n >\n <PostContent\n post={status}\n instance={instance}\n previewMode={previewMode}\n />\n <QuoteStatuses id={id} instance={instance} level={quoted} />\n </div>\n )}\n {!!poll && (\n <Poll\n lang={language}\n poll={poll}\n readOnly={readOnly || !sameInstance || !authenticated}\n onUpdate={(newPoll) => {\n states.statuses[sKey].poll = newPoll;\n }}\n refresh={() => {\n return masto.v1.polls\n .$select(poll.id)\n .fetch()\n .then((pollResponse) => {\n states.statuses[sKey].poll = pollResponse;\n })\n .catch((e) => {}); // Silently fail\n }}\n votePoll={(choices) => {\n return masto.v1.polls\n .$select(poll.id)\n .votes.create({\n choices,\n })\n .then((pollResponse) => {\n states.statuses[sKey].poll = pollResponse;\n })\n .catch((e) => {}); // Silently fail\n }}\n />\n )}\n {(((enableTranslate || inlineTranslate) &&\n isTranslateble(content, emojis) &&\n differentLanguage) ||\n forceTranslate) && (\n <TranslationBlock\n forceTranslate={forceTranslate || inlineTranslate}\n mini={!isSizeLarge && !withinContext}\n sourceLanguage={language}\n autoDetected={languageAutoDetected}\n text={getPostText(status, {\n maskCustomEmojis: true,\n })}\n />\n )}\n {!previewMode &&\n (sensitive || filterInfo?.action === 'blur') &&\n !!mediaAttachments.length &&\n (readingExpandMedia !== 'show_all' ||\n filterInfo?.action === 'blur') && (\n <button\n class={`plain spoiler-media-button ${\n showSpoilerMedia ? 'spoiling' : ''\n }`}\n type=\"button\"\n hidden={!readingExpandSpoilers && !!spoilerText}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n if (showSpoilerMedia) {\n delete states.spoilersMedia[id];\n } else {\n states.spoilersMedia[id] = true;\n }\n }}\n >\n <Icon\n icon={showSpoilerMedia ? 'eye-open' : 'eye-close'}\n />{' '}\n <span>\n {filterInfo?.action === 'blur' && (\n <small>\n <Trans>Filtered: {filterInfo?.titlesStr}</Trans>\n <br />\n </small>\n )}\n {showSpoilerMedia ? t`Show less` : t`Show media`}\n </span>\n </button>\n )}\n {!!mediaAttachments.length &&\n (mediaAttachments.length > 1 &&\n (isSizeLarge || (withinContext && size === 'm')) ? (\n <div class=\"media-large-container\">\n {mediaAttachments.map((media, i) => (\n <div key={media.id} class={`media-container media-eq1`}>\n <Media\n media={media}\n autoAnimate\n showCaption\n allowLongerCaption={!content}\n lang={language}\n to={`/${instance}/s/${id}?${\n withinContext ? 'media' : 'media-only'\n }=${i + 1}`}\n onClick={\n onMediaClick\n ? (e) => onMediaClick(e, i, media, status)\n : undefined\n }\n />\n </div>\n ))}\n </div>\n ) : (\n <MultipleMediaFigure\n lang={language}\n enabled={showMultipleMediaCaptions}\n captionChildren={captionChildren}\n >\n <div\n ref={mediaContainerRef}\n class={`media-container media-eq${\n mediaAttachments.length\n } ${mediaAttachments.length > 2 ? 'media-gt2' : ''} ${\n mediaAttachments.length > 4 ? 'media-gt4' : ''\n }`}\n >\n {displayedMediaAttachments.map((media, i) => (\n <Media\n key={media.id}\n media={media}\n autoAnimate={isSizeLarge}\n showCaption={mediaAttachments.length === 1}\n allowLongerCaption={\n !content && mediaAttachments.length === 1\n }\n lang={language}\n altIndex={\n showMultipleMediaCaptions &&\n !!media.description &&\n i + 1\n }\n to={`/${instance}/s/${id}?${\n withinContext ? 'media' : 'media-only'\n }=${i + 1}`}\n onClick={\n onMediaClick\n ? (e) => {\n onMediaClick(e, i, media, status);\n }\n : undefined\n }\n checkAspectRatio={mediaAttachments.length === 1}\n />\n ))}\n </div>\n </MultipleMediaFigure>\n ))}\n {!!card &&\n /^https/i.test(card?.url) &&\n !sensitive &&\n !spoilerText &&\n !poll &&\n !mediaAttachments.length &&\n !snapStates.statusQuotes[sKey] && (\n <Card\n card={card}\n selfReferential={\n card?.url === status.url || card?.url === status.uri\n }\n selfAuthor={card?.authors?.some(\n (a) => a.account?.url === accountURL,\n )}\n instance={currentInstance}\n />\n )}\n </>\n )}\n </div>\n {!isSizeLarge && showCommentCount && (\n <div class=\"content-comment-hint insignificant\">\n <Icon icon=\"comment2\" alt={t`Replies`} /> {repliesCount}\n </div>\n )}\n {isSizeLarge && (\n <>\n <div class=\"extra-meta\">\n {_deleted ? (\n <span class=\"status-deleted-tag\">\n <Trans>Deleted</Trans>\n </span>\n ) : (\n <>\n {/* <Icon\n icon={visibilityIconsMap[visibility]}\n alt={visibilityText[visibility]}\n /> */}\n <span>{_(visibilityText[visibility])}</span> •{' '}\n <a href={url} target=\"_blank\" rel=\"noopener\">\n {\n // within a day\n new Date().getTime() - createdAtDate.getTime() <\n 86400000 && (\n <>\n <RelativeTime\n datetime={createdAtDate}\n format=\"micro\"\n />{' '}\n ‒{' '}\n </>\n )\n }\n {!!createdAt && (\n <time\n class=\"created\"\n datetime={createdAtDate.toISOString()}\n title={createdAtDate.toLocaleString()}\n >\n {createdDateText}\n </time>\n )}\n </a>\n {editedAt && (\n <>\n {' '}\n • <Icon icon=\"pencil\" alt={t`Edited`} />{' '}\n <time\n tabIndex=\"0\"\n class=\"edited\"\n datetime={editedAtDate.toISOString()}\n onClick={() => {\n setShowEdited(id);\n }}\n >\n {editedDateText}\n </time>\n </>\n )}\n </>\n )}\n </div>\n {!!emojiReactions?.length && (\n <div class=\"emoji-reactions\">\n {emojiReactions.map((emojiReaction) => {\n const { name, count, me, url, staticUrl } = emojiReaction;\n if (url) {\n // Some servers return url and staticUrl\n return (\n <span\n class={`emoji-reaction tag ${\n me ? '' : 'insignificant'\n }`}\n >\n <CustomEmoji\n alt={name}\n url={url}\n staticUrl={staticUrl}\n />{' '}\n {count}\n </span>\n );\n }\n const isShortCode = /^:.+?:$/.test(name);\n if (isShortCode) {\n const emoji = emojis.find(\n (e) =>\n e.shortcode ===\n name.replace(/^:/, '').replace(/:$/, ''),\n );\n if (emoji) {\n return (\n <span\n class={`emoji-reaction tag ${\n me ? '' : 'insignificant'\n }`}\n >\n <CustomEmoji\n alt={name}\n url={emoji.url}\n staticUrl={emoji.staticUrl}\n />{' '}\n {count}\n </span>\n );\n }\n }\n return (\n <span\n class={`emoji-reaction tag ${\n me ? '' : 'insignificant'\n }`}\n >\n {name} {count}\n </span>\n );\n })}\n </div>\n )}\n <div class={`actions ${_deleted ? 'disabled' : ''}`}>\n <div class=\"action has-count\">\n <StatusButton\n title={t`Reply`}\n alt={t`Comments`}\n class=\"reply-button\"\n icon=\"comment\"\n count={repliesCount}\n onClick={replyStatus}\n />\n </div>\n {/* <div class=\"action has-count\">\n <StatusButton\n checked={reblogged}\n title={['Boost', 'Unboost']}\n alt={['Boost', 'Boosted']}\n class=\"reblog-button\"\n icon=\"rocket\"\n count={reblogsCount}\n onClick={boostStatus}\n disabled={!canBoost}\n />\n </div> */}\n <div class=\"action has-count\">\n <MenuConfirm\n disabled={!canBoost}\n onClick={confirmBoostStatus}\n confirmLabel={\n <>\n <Icon icon=\"rocket\" />\n <span>{reblogged ? t`Unboost` : t`Boost`}</span>\n </>\n }\n menuExtras={\n <MenuItem\n onClick={() => {\n showCompose({\n draftStatus: {\n status: `\\n${url}`,\n },\n });\n }}\n >\n <Icon icon=\"quote\" />\n <span>\n <Trans>Quote</Trans>\n </span>\n </MenuItem>\n }\n menuFooter={menuFooter}\n >\n <StatusButton\n checked={reblogged}\n title={[t`Boost`, t`Unboost`]}\n alt={[t`Boost`, t`Boosted`]}\n class=\"reblog-button\"\n icon=\"rocket\"\n count={reblogsCount}\n // onClick={boostStatus}\n disabled={!canBoost}\n />\n </MenuConfirm>\n </div>\n <div class=\"action has-count\">\n <StatusButton\n checked={favourited}\n title={[t`Like`, t`Unlike`]}\n alt={[t`Like`, t`Liked`]}\n class=\"favourite-button\"\n icon=\"heart\"\n count={favouritesCount}\n onClick={favouriteStatus}\n />\n </div>\n {supports('@mastodon/post-bookmark') && (\n <div class=\"action\">\n <StatusButton\n checked={bookmarked}\n title={[t`Bookmark`, t`Unbookmark`]}\n alt={[t`Bookmark`, t`Bookmarked`]}\n class=\"bookmark-button\"\n icon=\"bookmark\"\n onClick={bookmarkStatus}\n />\n </div>\n )}\n <Menu2\n portal={{\n target:\n document.querySelector('.status-deck') || document.body,\n }}\n align=\"end\"\n gap={4}\n overflow=\"auto\"\n viewScroll=\"close\"\n menuButton={\n <div class=\"action\">\n <button\n type=\"button\"\n title={t`More`}\n class=\"plain more-button\"\n >\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n </div>\n }\n >\n {StatusMenuItems}{' '}\n </Menu2>\n </div>\n </>\n )}\n </div>\n {!!showEdited && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowEdited(false);\n // statusRef.current?.focus();\n }\n }}\n >\n <EditedAtModal\n statusID={showEdited}\n instance={instance}\n fetchStatusHistory={() => {\n return masto.v1.statuses.$select(showEdited).history.list();\n }}\n onClose={() => {\n setShowEdited(false);\n statusRef.current?.focus();\n }}\n />\n </Modal>\n )}\n {!!showEmbed && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowEmbed(false);\n }\n }}\n >\n <EmbedModal\n post={status}\n instance={instance}\n onClose={() => {\n setShowEmbed(false);\n }}\n />\n </Modal>\n )}\n </article>\n </StatusParent>\n );\n}\n\nfunction MultipleMediaFigure(props) {\n const { enabled, children, lang, captionChildren } = props;\n if (!enabled || !captionChildren) return children;\n return (\n <figure class=\"media-figure-multiple\">\n {children}\n <figcaption lang={lang} dir=\"auto\">\n {captionChildren}\n </figcaption>\n </figure>\n );\n}\n\nfunction MediaFirstContainer(props) {\n const { mediaAttachments, language, postID, instance } = props;\n const moreThanOne = mediaAttachments.length > 1;\n\n const carouselRef = useRef();\n const [currentIndex, setCurrentIndex] = useState(0);\n\n useEffect(() => {\n let handleScroll = () => {\n const { clientWidth, scrollLeft } = carouselRef.current;\n const index = Math.round(Math.abs(scrollLeft) / clientWidth);\n setCurrentIndex(index);\n };\n if (carouselRef.current) {\n carouselRef.current.addEventListener('scroll', handleScroll, {\n passive: true,\n });\n }\n return () => {\n if (carouselRef.current) {\n carouselRef.current.removeEventListener('scroll', handleScroll);\n }\n };\n }, []);\n\n return (\n <>\n <div class=\"media-first-container\">\n <div class=\"media-first-carousel\" ref={carouselRef}>\n {mediaAttachments.map((media, i) => (\n <div class=\"media-first-item\" key={media.id}>\n <Media\n media={media}\n lang={language}\n to={`/${instance}/s/${postID}?media=${i + 1}`}\n />\n </div>\n ))}\n </div>\n {moreThanOne && (\n <div class=\"media-carousel-controls\">\n <div class=\"carousel-indexer\">\n {currentIndex + 1}/{mediaAttachments.length}\n </div>\n <label class=\"media-carousel-button\">\n <button\n type=\"button\"\n class=\"carousel-button\"\n hidden={currentIndex === 0}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n carouselRef.current.focus();\n carouselRef.current.scrollTo({\n left:\n carouselRef.current.clientWidth *\n (currentIndex - 1) *\n (isRTL() ? -1 : 1),\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"arrow-left\" />\n </button>\n </label>\n <label class=\"media-carousel-button\">\n <button\n type=\"button\"\n class=\"carousel-button\"\n hidden={currentIndex === mediaAttachments.length - 1}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n carouselRef.current.focus();\n carouselRef.current.scrollTo({\n left:\n carouselRef.current.clientWidth *\n (currentIndex + 1) *\n (isRTL() ? -1 : 1),\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"arrow-right\" />\n </button>\n </label>\n </div>\n )}\n </div>\n {moreThanOne && (\n <div\n class=\"media-carousel-dots\"\n style={{\n '--dots-count': mediaAttachments.length,\n }}\n >\n {mediaAttachments.map((media, i) => (\n <span\n key={media.id}\n class={`carousel-dot ${i === currentIndex ? 'active' : ''}`}\n />\n ))}\n </div>\n )}\n </>\n );\n}\n\n// \"Post\": Quote post + card link preview combo\n// Assume all links from these domains are \"posts\"\n// Mastodon links are \"posts\" too but they are converted to real quote posts and there's too many domains to check\n// This is just \"Progressive Enhancement\"\nfunction isCardPost(domain) {\n return ['x.com', 'twitter.com', 'threads.net', 'bsky.app'].includes(domain);\n}\n\nfunction Byline({ authors, hidden, children }) {\n if (hidden) return children;\n if (!authors?.[0]?.account?.id) return children;\n const author = authors[0].account;\n\n return (\n <div class=\"card-byline\">\n {children}\n <div class=\"card-byline-author\">\n <Icon icon=\"link\" size=\"s\" />{' '}\n <small>\n <Trans comment=\"More from [Author]\">\n More from <NameText account={author} showAvatar />\n </Trans>\n </small>\n </div>\n </div>\n );\n}\n\nfunction Card({ card, selfReferential, selfAuthor, instance }) {\n const snapStates = useSnapshot(states);\n const {\n blurhash,\n title,\n description,\n html,\n providerName,\n providerUrl,\n authorName,\n authorUrl,\n width,\n height,\n image,\n imageDescription,\n url,\n type,\n embedUrl,\n language,\n publishedAt,\n authors,\n } = card;\n\n /* type\n link = Link OEmbed\n photo = Photo OEmbed\n video = Video OEmbed\n rich = iframe OEmbed. Not currently accepted, so won’t show up in practice.\n */\n\n const hasText = title || providerName || authorName;\n const isLandscape = width / height >= 1.2;\n const size = isLandscape ? 'large' : '';\n\n const [cardStatusURL, setCardStatusURL] = useState(null);\n // const [cardStatusID, setCardStatusID] = useState(null);\n useEffect(() => {\n if (hasText && image && !selfReferential && isMastodonLinkMaybe(url)) {\n unfurlMastodonLink(instance, url).then((result) => {\n if (!result) return;\n const { id, url } = result;\n setCardStatusURL('#' + url);\n\n // NOTE: This is for quote post\n // (async () => {\n // const { masto } = api({ instance });\n // const status = await masto.v1.statuses.$select(id).fetch();\n // saveStatus(status, instance);\n // setCardStatusID(id);\n // })();\n });\n }\n }, [hasText, image, selfReferential]);\n\n // if (cardStatusID) {\n // return (\n // <Status statusID={cardStatusID} instance={instance} size=\"s\" readOnly />\n // );\n // }\n\n if (snapStates.unfurledLinks[url]) return null;\n\n const hasIframeHTML = /<iframe/i.test(html);\n const handleClick = useCallback(\n (e) => {\n if (hasIframeHTML) {\n e.preventDefault();\n states.showEmbedModal = {\n html,\n url: url || embedUrl,\n width,\n height,\n };\n }\n },\n [hasIframeHTML],\n );\n\n const [blurhashImage, setBlurhashImage] = useState(null);\n if (hasText && (image || (type === 'photo' && blurhash))) {\n const domain = getDomain(url);\n const rgbAverageColor =\n image && blurhash ? getBlurHashAverageColor(blurhash) : null;\n if (!image) {\n const w = 44;\n const h = 44;\n const blurhashPixels = decodeBlurHash(blurhash, w, h);\n const canvas = window.OffscreenCanvas\n ? new OffscreenCanvas(1, 1)\n : document.createElement('canvas');\n canvas.width = w;\n canvas.height = h;\n const ctx = canvas.getContext('2d');\n ctx.imageSmoothingEnabled = false;\n const imageData = ctx.createImageData(w, h);\n imageData.data.set(blurhashPixels);\n ctx.putImageData(imageData, 0, 0);\n try {\n if (window.OffscreenCanvas) {\n canvas.convertToBlob().then((blob) => {\n setBlurhashImage(URL.createObjectURL(blob));\n });\n } else {\n setBlurhashImage(canvas.toDataURL());\n }\n } catch (e) {\n // Silently fail\n console.error(e);\n }\n }\n\n const isPost = isCardPost(domain);\n\n return (\n <Byline hidden={!!selfAuthor} authors={authors}>\n <a\n href={cardStatusURL || url}\n target={cardStatusURL ? null : '_blank'}\n rel=\"nofollow noopener\"\n class={`card link ${isPost ? 'card-post' : ''} ${\n blurhashImage ? '' : size\n }`}\n style={{\n '--average-color':\n rgbAverageColor && `rgb(${rgbAverageColor.join(',')})`,\n }}\n onClick={handleClick}\n >\n <div class=\"card-image\">\n <img\n src={image || blurhashImage}\n width={width}\n height={height}\n loading=\"lazy\"\n decoding=\"async\"\n fetchPriority=\"low\"\n alt={imageDescription || ''}\n onError={(e) => {\n try {\n e.target.style.display = 'none';\n } catch (e) {}\n }}\n style={{\n '--anim-duration':\n width &&\n height &&\n `${Math.min(\n Math.max(Math.max(width, height) / 100, 5),\n 120,\n )}s`,\n }}\n />\n </div>\n <div class=\"meta-container\" lang={language}>\n <p class=\"meta domain\">\n <span class=\"domain\">{domain}</span>{' '}\n {!!publishedAt && <>· </>}\n {!!publishedAt && (\n <>\n <RelativeTime datetime={publishedAt} format=\"micro\" />\n </>\n )}\n </p>\n <p class=\"title\" dir=\"auto\" title={title}>\n {title}\n </p>\n <p class=\"meta\" dir=\"auto\" title={description}>\n {description ||\n (!!publishedAt && (\n <RelativeTime datetime={publishedAt} format=\"micro\" />\n ))}\n </p>\n </div>\n </a>\n </Byline>\n );\n } else if (type === 'photo') {\n return (\n <a\n href={url}\n target=\"_blank\"\n rel=\"nofollow noopener\"\n class=\"card photo\"\n onClick={handleClick}\n >\n <img\n src={embedUrl}\n width={width}\n height={height}\n alt={title || description}\n loading=\"lazy\"\n style={{\n height: 'auto',\n aspectRatio: `${width}/${height}`,\n }}\n />\n </a>\n );\n } else {\n if (type === 'video') {\n if (/youtube/i.test(providerName)) {\n // Get ID from e.g. https://www.youtube.com/watch?v=[VIDEO_ID]\n const videoID = url.match(/watch\\?v=([^&]+)/)?.[1];\n if (videoID) {\n return (\n <a class=\"card video\" onClick={handleClick}>\n <lite-youtube videoid={videoID} nocookie autoPause></lite-youtube>\n </a>\n );\n }\n }\n // return (\n // <div\n // class=\"card video\"\n // style={{\n // aspectRatio: `${width}/${height}`,\n // }}\n // dangerouslySetInnerHTML={{ __html: html }}\n // />\n // );\n }\n if (hasText && !image) {\n const domain = getDomain(url);\n const isPost = isCardPost(domain);\n return (\n <a\n href={cardStatusURL || url}\n target={cardStatusURL ? null : '_blank'}\n rel=\"nofollow noopener\"\n class={`card link ${isPost ? 'card-post' : ''} no-image`}\n lang={language}\n dir=\"auto\"\n onClick={handleClick}\n >\n <div class=\"meta-container\">\n <p class=\"meta domain\">\n <span class=\"domain\">\n <Icon icon=\"link\" size=\"s\" /> <span>{domain}</span>\n </span>{' '}\n {!!publishedAt && <>· </>}\n {!!publishedAt && (\n <>\n <RelativeTime datetime={publishedAt} format=\"micro\" />\n </>\n )}\n </p>\n <p class=\"title\" title={title}>\n {title}\n </p>\n <p class=\"meta\" title={description || providerName || authorName}>\n {description || providerName || authorName}\n </p>\n </div>\n </a>\n );\n }\n }\n}\n\nfunction EditedAtModal({\n statusID,\n instance,\n fetchStatusHistory = () => {},\n onClose,\n}) {\n const { t } = useLingui();\n const [uiState, setUIState] = useState('default');\n const [editHistory, setEditHistory] = useState([]);\n\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const editHistory = await fetchStatusHistory();\n console.log(editHistory);\n setEditHistory(editHistory);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, []);\n\n return (\n <div id=\"edit-history\" class=\"sheet\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Trans>Edit History</Trans>\n </h2>\n {uiState === 'error' && (\n <p>\n <Trans>Failed to load history</Trans>\n </p>\n )}\n {uiState === 'loading' && (\n <p>\n <Loader abrupt /> <Trans>Loading…</Trans>\n </p>\n )}\n </header>\n <main tabIndex=\"-1\">\n {editHistory.length > 0 && (\n <ol>\n {editHistory.map((status) => {\n const { createdAt } = status;\n const createdAtDate = new Date(createdAt);\n return (\n <li key={createdAt} class=\"history-item\">\n <h3>\n <time>\n {niceDateTime(createdAtDate, {\n formatOpts: {\n weekday: 'short',\n second: 'numeric',\n },\n })}\n </time>\n </h3>\n <Status\n status={status}\n instance={instance}\n size=\"s\"\n withinContext\n readOnly\n previewMode\n />\n </li>\n );\n })}\n </ol>\n )}\n </main>\n </div>\n );\n}\n\nfunction generateHTMLCode(post, instance, level = 0) {\n const {\n account: {\n url: accountURL,\n displayName,\n acct,\n username,\n emojis: accountEmojis,\n bot,\n group,\n },\n id,\n poll,\n spoilerText,\n language,\n editedAt,\n createdAt,\n content,\n mediaAttachments,\n url,\n emojis,\n } = post;\n\n const sKey = statusKey(id, instance);\n const quotes = states.statusQuotes[sKey] || [];\n const uniqueQuotes = quotes.filter(\n (q, i, arr) => arr.findIndex((q2) => q2.url === q.url) === i,\n );\n const quoteStatusesHTML =\n uniqueQuotes.length && level <= 2\n ? uniqueQuotes\n .map((quote) => {\n const { id, instance } = quote;\n const sKey = statusKey(id, instance);\n const s = states.statuses[sKey];\n if (s) {\n return generateHTMLCode(s, instance, ++level);\n }\n })\n .join('')\n : '';\n\n const createdAtDate = new Date(createdAt);\n // const editedAtDate = editedAt && new Date(editedAt);\n\n const contentHTML =\n emojifyText(content, emojis) +\n '\\n' +\n quoteStatusesHTML +\n '\\n' +\n (poll?.options?.length\n ? `\n <p>📊:</p>\n <ul>\n ${poll.options\n .map(\n (option) => `\n <li>\n ${option.title}\n ${option.votesCount >= 0 ? ` (${option.votesCount})` : ''}\n </li>\n `,\n )\n .join('')}\n </ul>`\n : '') +\n (mediaAttachments.length > 0\n ? '\\n' +\n mediaAttachments\n .map((media) => {\n const {\n description,\n meta,\n previewRemoteUrl,\n previewUrl,\n remoteUrl,\n url,\n type,\n } = media;\n const { original = {}, small } = meta || {};\n const width = small?.width || original?.width;\n const height = small?.height || original?.height;\n\n // Prefer remote over original\n const sourceMediaURL = remoteUrl || url;\n const previewMediaURL = previewRemoteUrl || previewUrl;\n const mediaURL = previewMediaURL || sourceMediaURL;\n\n const sourceMediaURLObj = sourceMediaURL\n ? URL.parse(sourceMediaURL)\n : null;\n const isVideoMaybe =\n type === 'unknown' &&\n sourceMediaURLObj &&\n /\\.(mp4|m4r|m4v|mov|webm)$/i.test(sourceMediaURLObj.pathname);\n const isAudioMaybe =\n type === 'unknown' &&\n sourceMediaURLObj &&\n /\\.(mp3|ogg|wav|m4a|m4p|m4b)$/i.test(sourceMediaURLObj.pathname);\n const isImage =\n type === 'image' ||\n (type === 'unknown' &&\n previewMediaURL &&\n !isVideoMaybe &&\n !isAudioMaybe);\n const isVideo = type === 'gifv' || type === 'video' || isVideoMaybe;\n const isAudio = type === 'audio' || isAudioMaybe;\n\n let mediaHTML = '';\n if (isImage) {\n mediaHTML = `<img src=\"${mediaURL}\" width=\"${width}\" height=\"${height}\" alt=\"${description}\" loading=\"lazy\" />`;\n } else if (isVideo) {\n mediaHTML = `\n <video src=\"${sourceMediaURL}\" width=\"${width}\" height=\"${height}\" controls preload=\"auto\" poster=\"${previewMediaURL}\" loading=\"lazy\"></video>\n ${description ? `<figcaption>${description}</figcaption>` : ''}\n `;\n } else if (isAudio) {\n mediaHTML = `\n <audio src=\"${sourceMediaURL}\" controls preload=\"auto\"></audio>\n ${description ? `<figcaption>${description}</figcaption>` : ''}\n `;\n } else {\n mediaHTML = `\n <a href=\"${sourceMediaURL}\">📄 ${\n description || sourceMediaURL\n }</a>\n `;\n }\n\n return `<figure>${mediaHTML}</figure>`;\n })\n .join('\\n')\n : '');\n\n const htmlCode = `\n <blockquote lang=\"${language}\" cite=\"${url}\" data-source=\"fediverse\">\n ${\n spoilerText\n ? `\n <details>\n <summary>${spoilerText}</summary>\n ${contentHTML}\n </details>\n `\n : contentHTML\n }\n <footer>\n — ${emojifyText(\n displayName,\n accountEmojis,\n )} (@${acct}) ${!!createdAt ? `<a href=\"${url}\"><time datetime=\"${createdAtDate.toISOString()}\">${createdAtDate.toLocaleString()}</time></a>` : ''}\n </footer>\n </blockquote>\n `;\n\n return prettify(htmlCode);\n}\n\nfunction EmbedModal({ post, instance, onClose }) {\n const { t } = useLingui();\n const {\n account: {\n url: accountURL,\n displayName,\n username,\n emojis: accountEmojis,\n bot,\n group,\n },\n id,\n poll,\n spoilerText,\n language,\n editedAt,\n createdAt,\n content,\n mediaAttachments,\n url,\n emojis,\n } = post;\n\n const htmlCode = generateHTMLCode(post, instance);\n return (\n <div id=\"embed-post\" class=\"sheet\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Trans>Embed post</Trans>\n </h2>\n </header>\n <main tabIndex=\"-1\">\n <h3>\n <Trans>HTML Code</Trans>\n </h3>\n <textarea\n class=\"embed-code\"\n readonly\n onClick={(e) => {\n e.target.select();\n }}\n dir=\"auto\"\n >\n {htmlCode}\n </textarea>\n <button\n type=\"button\"\n onClick={() => {\n try {\n navigator.clipboard.writeText(htmlCode);\n showToast(t`HTML code copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy HTML code`);\n }\n }}\n >\n <Icon icon=\"clipboard\" />{' '}\n <span>\n <Trans>Copy</Trans>\n </span>\n </button>\n {!!mediaAttachments?.length && (\n <section>\n <p>\n <Trans>Media attachments:</Trans>\n </p>\n <ol class=\"links-list\">\n {mediaAttachments.map((media) => {\n return (\n <li key={media.id}>\n <a\n href={media.remoteUrl || media.url}\n target=\"_blank\"\n download\n >\n {media.remoteUrl || media.url}\n </a>\n </li>\n );\n })}\n </ol>\n </section>\n )}\n {!!accountEmojis?.length && (\n <section>\n <p>\n <Trans>Account Emojis:</Trans>\n </p>\n <ul>\n {accountEmojis.map((emoji) => {\n return (\n <li key={emoji.shortcode}>\n <picture>\n <source\n srcset={emoji.staticUrl}\n media=\"(prefers-reduced-motion: reduce)\"\n ></source>\n <img\n class=\"shortcode-emoji emoji\"\n src={emoji.url}\n alt={`:${emoji.shortcode}:`}\n width=\"16\"\n height=\"16\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n </picture>{' '}\n <code>:{emoji.shortcode}:</code> (\n <a href={emoji.url} target=\"_blank\" download>\n URL\n </a>\n )\n {emoji.staticUrl ? (\n <>\n {' '}\n (\n <a href={emoji.staticUrl} target=\"_blank\" download>\n <Trans>static URL</Trans>\n </a>\n )\n </>\n ) : null}\n </li>\n );\n })}\n </ul>\n </section>\n )}\n {!!emojis?.length && (\n <section>\n <p>\n <Trans>Emojis:</Trans>\n </p>\n <ul>\n {emojis.map((emoji) => {\n return (\n <li key={emoji.shortcode}>\n <picture>\n <source\n srcset={emoji.staticUrl}\n media=\"(prefers-reduced-motion: reduce)\"\n ></source>\n <img\n class=\"shortcode-emoji emoji\"\n src={emoji.url}\n alt={`:${emoji.shortcode}:`}\n width=\"16\"\n height=\"16\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n </picture>{' '}\n <code>:{emoji.shortcode}:</code> (\n <a href={emoji.url} target=\"_blank\" download>\n URL\n </a>\n )\n {emoji.staticUrl ? (\n <>\n {' '}\n (\n <a href={emoji.staticUrl} target=\"_blank\" download>\n <Trans>static URL</Trans>\n </a>\n )\n </>\n ) : null}\n </li>\n );\n })}\n </ul>\n </section>\n )}\n <section>\n <small>\n <p>\n <Trans>Notes:</Trans>\n </p>\n <ul>\n <li>\n <Trans>\n This is static, unstyled and scriptless. You may need to apply\n your own styles and edit as needed.\n </Trans>\n </li>\n <li>\n <Trans>\n Polls are not interactive, becomes a list with vote counts.\n </Trans>\n </li>\n <li>\n <Trans>\n Media attachments can be images, videos, audios or any file\n types.\n </Trans>\n </li>\n <li>\n <Trans>Post could be edited or deleted later.</Trans>\n </li>\n </ul>\n </small>\n </section>\n <h3>\n <Trans>Preview</Trans>\n </h3>\n <output\n class=\"embed-preview\"\n dangerouslySetInnerHTML={{ __html: htmlCode }}\n dir=\"auto\"\n />\n <p>\n <small>\n <Trans>Note: This preview is lightly styled.</Trans>\n </small>\n </p>\n </main>\n </div>\n );\n}\n\nconst StatusButton = forwardRef((props, ref) => {\n let {\n checked,\n count,\n class: className,\n title,\n alt,\n size,\n icon,\n iconSize = 'l',\n onClick,\n ...otherProps\n } = props;\n if (typeof title === 'string') {\n title = [title, title];\n }\n if (typeof alt === 'string') {\n alt = [alt, alt];\n }\n\n const [buttonTitle, setButtonTitle] = useState(title[0] || '');\n const [iconAlt, setIconAlt] = useState(alt[0] || '');\n\n useEffect(() => {\n if (checked) {\n setButtonTitle(title[1] || '');\n setIconAlt(alt[1] || '');\n } else {\n setButtonTitle(title[0] || '');\n setIconAlt(alt[0] || '');\n }\n }, [checked, title, alt]);\n\n return (\n <button\n ref={ref}\n type=\"button\"\n title={buttonTitle}\n class={`plain ${size ? 'small' : ''} ${className} ${\n checked ? 'checked' : ''\n }`}\n onClick={(e) => {\n if (!onClick) return;\n e.preventDefault();\n e.stopPropagation();\n onClick(e);\n }}\n {...otherProps}\n >\n <Icon icon={icon} size={iconSize} alt={iconAlt} />\n {!!count && (\n <>\n {' '}\n <small title={count}>{shortenNumber(count)}</small>\n </>\n )}\n </button>\n );\n});\n\nfunction nicePostURL(url) {\n if (!url) return;\n const urlObj = URL.parse(url);\n if (!urlObj) return;\n const { host, pathname } = urlObj;\n const path = pathname.replace(/\\/$/, '');\n // split only first slash\n const [_, username, restPath] = path.match(/\\/(@[^\\/]+)\\/(.*)/) || [];\n return (\n <>\n {punycode.toUnicode(host)}\n {username ? (\n <>\n /{username}\n <wbr />\n <span class=\"more-insignificant\">/{restPath}</span>\n </>\n ) : (\n <span class=\"more-insignificant\">{path}</span>\n )}\n </>\n );\n}\n\nfunction StatusCompact({ sKey }) {\n const snapStates = useSnapshot(states);\n const statusReply = snapStates.statusReply[sKey];\n if (!statusReply) return null;\n\n const { id, instance } = statusReply;\n const status = getStatus(id, instance);\n if (!status) return null;\n\n const {\n account: { id: accountId },\n sensitive,\n spoilerText,\n account: { avatar, avatarStatic, bot } = {},\n visibility,\n content,\n language,\n filtered,\n } = status;\n if (sensitive || spoilerText) return null;\n if (!content) return null;\n\n const srKey = statusKey(id, instance);\n const statusPeekText = statusPeek(status);\n\n const currentAccount = getCurrentAccID();\n const isSelf = currentAccount && currentAccount === accountId;\n\n const filterContext = useContext(FilterContext);\n let filterInfo = !isSelf && isFiltered(filtered, filterContext);\n\n // This is fine. Images are converted to emojis so they are\n // in a way, already \"obscured\"\n if (filterInfo?.action === 'blur') filterInfo = null;\n\n if (filterInfo?.action === 'hide') return null;\n\n const filterTitleStr = filterInfo?.titlesStr || '';\n\n return (\n <article\n class={`status compact-reply ${\n visibility === 'direct' ? 'visibility-direct' : ''\n }`}\n tabindex=\"-1\"\n data-state-post-id={srKey}\n >\n <Avatar url={avatarStatic || avatar} squircle={bot} />\n <div\n class=\"content-compact\"\n title={statusPeekText}\n lang={language}\n dir=\"auto\"\n >\n {filterInfo ? (\n <b class=\"status-filtered-badge badge-meta\" title={filterTitleStr}>\n <span>\n <Trans>Filtered</Trans>\n </span>\n <span>{filterTitleStr}</span>\n </b>\n ) : (\n <span>{statusPeekText}</span>\n )}\n </div>\n </article>\n );\n}\n\nfunction FilteredStatus({\n status,\n filterInfo,\n instance,\n containerProps = {},\n showFollowedTags,\n quoted,\n}) {\n const { _, t } = useLingui();\n const snapStates = useSnapshot(states);\n const {\n id: statusID,\n account: { avatar, avatarStatic, bot, group },\n createdAt,\n visibility,\n reblog,\n } = status;\n const isReblog = !!reblog;\n const filterTitleStr = filterInfo?.titlesStr || '';\n const createdAtDate = new Date(createdAt);\n const statusPeekText = statusPeek(status.reblog || status);\n\n const [showPeek, setShowPeek] = useState(false);\n const bindLongPressPeek = useLongPress(\n () => {\n setShowPeek(true);\n },\n {\n threshold: 600,\n captureEvent: true,\n detect: 'touch',\n cancelOnMovement: 2, // true allows movement of up to 25 pixels\n },\n );\n\n const statusPeekRef = useTruncated();\n const sKey = statusKey(status.id, instance);\n const ssKey =\n statusKey(status.id, instance) +\n ' ' +\n (statusKey(reblog?.id, instance) || '');\n\n const actualStatusID = reblog?.id || statusID;\n const url = instance\n ? `/${instance}/s/${actualStatusID}`\n : `/s/${actualStatusID}`;\n const isFollowedTags =\n showFollowedTags && !!snapStates.statusFollowedTags[sKey]?.length;\n\n return (\n <div\n class={`${\n quoted\n ? ''\n : isReblog\n ? group\n ? 'status-group'\n : 'status-reblog'\n : isFollowedTags\n ? 'status-followed-tags'\n : ''\n } visibility-${visibility}`}\n {...containerProps}\n // title={statusPeekText}\n onContextMenu={(e) => {\n e.preventDefault();\n setShowPeek(true);\n }}\n {...bindLongPressPeek()}\n >\n <article\n data-state-post-id={ssKey}\n class={`status filtered ${quoted ? 'status-card' : ''}`}\n tabindex=\"-1\"\n >\n <b\n class=\"status-filtered-badge clickable badge-meta\"\n title={filterTitleStr}\n onClick={(e) => {\n e.preventDefault();\n setShowPeek(true);\n }}\n >\n <span>\n <Trans>Filtered</Trans>\n </span>\n <span>{filterTitleStr}</span>\n </b>{' '}\n <Avatar url={avatarStatic || avatar} squircle={bot} />\n <span class=\"status-filtered-info\">\n <span class=\"status-filtered-info-1\">\n {isReblog ? (\n <Trans comment=\"[Name] [Visibility icon] boosted\">\n <NameText account={status.account} instance={instance} />{' '}\n <Icon\n icon={visibilityIconsMap[visibility]}\n alt={_(visibilityText[visibility])}\n size=\"s\"\n />{' '}\n boosted\n </Trans>\n ) : isFollowedTags ? (\n <>\n <NameText account={status.account} instance={instance} />{' '}\n <Icon\n icon={visibilityIconsMap[visibility]}\n alt={_(visibilityText[visibility])}\n size=\"s\"\n />{' '}\n <span>\n {snapStates.statusFollowedTags[sKey]\n .slice(0, 3)\n .map((tag) => (\n <span key={tag} class=\"status-followed-tag-item\">\n #{tag}\n </span>\n ))}\n </span>\n </>\n ) : (\n <>\n <NameText account={status.account} instance={instance} />{' '}\n <Icon\n icon={visibilityIconsMap[visibility]}\n alt={_(visibilityText[visibility])}\n size=\"s\"\n />{' '}\n <RelativeTime datetime={createdAtDate} format=\"micro\" />\n </>\n )}\n </span>\n <span class=\"status-filtered-info-2\">\n {isReblog && (\n <>\n <Avatar\n url={reblog.account.avatarStatic || reblog.account.avatar}\n squircle={bot}\n />{' '}\n </>\n )}\n {statusPeekText}\n </span>\n </span>\n </article>\n {!!showPeek && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowPeek(false);\n }\n }}\n >\n <div id=\"filtered-status-peek\" class=\"sheet\">\n <button\n type=\"button\"\n class=\"sheet-close\"\n onClick={() => setShowPeek(false)}\n >\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <b class=\"status-filtered-badge\">\n <Trans>Filtered</Trans>\n </b>{' '}\n {filterTitleStr}\n </header>\n <main tabIndex=\"-1\">\n <Link\n ref={statusPeekRef}\n class=\"status-link\"\n to={url}\n onClick={() => {\n setShowPeek(false);\n }}\n data-read-more={_(readMoreText)}\n >\n <Status status={status} instance={instance} size=\"s\" readOnly />\n </Link>\n </main>\n </div>\n </Modal>\n )}\n </div>\n );\n}\n\nconst QuoteStatuses = memo(({ id, instance, level = 0 }) => {\n if (!id || !instance) return;\n const { _ } = useLingui();\n const snapStates = useSnapshot(states);\n const sKey = statusKey(id, instance);\n const quotes = snapStates.statusQuotes[sKey];\n const uniqueQuotes = quotes?.filter(\n (q, i, arr) => arr.findIndex((q2) => q2.url === q.url) === i,\n );\n\n if (!uniqueQuotes?.length) return;\n if (level > 2) return;\n\n return uniqueQuotes.map((q) => {\n return (\n <LazyShazam id={q.instance + q.id}>\n <Link\n key={q.instance + q.id}\n to={`${q.instance ? `/${q.instance}` : ''}/s/${q.id}`}\n class=\"status-card-link\"\n data-read-more={_(readMoreText)}\n >\n <Status\n statusID={q.id}\n instance={q.instance}\n size=\"s\"\n quoted={level + 1}\n enableCommentHint\n />\n </Link>\n </LazyShazam>\n );\n });\n});\n\nexport default memo(Status, (oldProps, newProps) => {\n // Shallow equal all props except 'status'\n // This will be pure static until status ID changes\n const { status, ...restOldProps } = oldProps;\n const { status: newStatus, ...restNewProps } = newProps;\n return (\n status?.id === newStatus?.id && shallowEqual(restOldProps, restNewProps)\n );\n});\n","var IDX=36, HEX='';\nwhile (IDX--) HEX += IDX.toString(36);\n\nexport function uid(len) {\n\tvar str='', num = len || 11;\n\twhile (num--) str += HEX[Math.random() * 36 | 0];\n\treturn str;\n}\n","/**\n * Fuse.js v7.1.0 - Lightweight fuzzy-search (http://fusejs.io)\n *\n * Copyright (c) 2025 Kiro Risk (http://kiro.me)\n * All Rights Reserved. Apache Software License 2.0\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfunction isArray(value) {\n return !Array.isArray\n ? getTag(value) === '[object Array]'\n : Array.isArray(value)\n}\n\n// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js\nconst INFINITY = 1 / 0;\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value\n }\n let result = value + '';\n return result == '0' && 1 / value == -INFINITY ? '-0' : result\n}\n\nfunction toString(value) {\n return value == null ? '' : baseToString(value)\n}\n\nfunction isString(value) {\n return typeof value === 'string'\n}\n\nfunction isNumber(value) {\n return typeof value === 'number'\n}\n\n// Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js\nfunction isBoolean(value) {\n return (\n value === true ||\n value === false ||\n (isObjectLike(value) && getTag(value) == '[object Boolean]')\n )\n}\n\nfunction isObject(value) {\n return typeof value === 'object'\n}\n\n// Checks if `value` is object-like.\nfunction isObjectLike(value) {\n return isObject(value) && value !== null\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null\n}\n\nfunction isBlank(value) {\n return !value.trim().length\n}\n\n// Gets the `toStringTag` of `value`.\n// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js\nfunction getTag(value) {\n return value == null\n ? value === undefined\n ? '[object Undefined]'\n : '[object Null]'\n : Object.prototype.toString.call(value)\n}\n\nconst EXTENDED_SEARCH_UNAVAILABLE = 'Extended search is not available';\n\nconst INCORRECT_INDEX_TYPE = \"Incorrect 'index' type\";\n\nconst LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key) =>\n `Invalid value for key ${key}`;\n\nconst PATTERN_LENGTH_TOO_LARGE = (max) =>\n `Pattern length exceeds max of ${max}.`;\n\nconst MISSING_KEY_PROPERTY = (name) => `Missing ${name} property in key`;\n\nconst INVALID_KEY_WEIGHT_VALUE = (key) =>\n `Property 'weight' in key '${key}' must be a positive integer`;\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nclass KeyStore {\n constructor(keys) {\n this._keys = [];\n this._keyMap = {};\n\n let totalWeight = 0;\n\n keys.forEach((key) => {\n let obj = createKey(key);\n\n this._keys.push(obj);\n this._keyMap[obj.id] = obj;\n\n totalWeight += obj.weight;\n });\n\n // Normalize weights so that their sum is equal to 1\n this._keys.forEach((key) => {\n key.weight /= totalWeight;\n });\n }\n get(keyId) {\n return this._keyMap[keyId]\n }\n keys() {\n return this._keys\n }\n toJSON() {\n return JSON.stringify(this._keys)\n }\n}\n\nfunction createKey(key) {\n let path = null;\n let id = null;\n let src = null;\n let weight = 1;\n let getFn = null;\n\n if (isString(key) || isArray(key)) {\n src = key;\n path = createKeyPath(key);\n id = createKeyId(key);\n } else {\n if (!hasOwn.call(key, 'name')) {\n throw new Error(MISSING_KEY_PROPERTY('name'))\n }\n\n const name = key.name;\n src = name;\n\n if (hasOwn.call(key, 'weight')) {\n weight = key.weight;\n\n if (weight <= 0) {\n throw new Error(INVALID_KEY_WEIGHT_VALUE(name))\n }\n }\n\n path = createKeyPath(name);\n id = createKeyId(name);\n getFn = key.getFn;\n }\n\n return { path, id, weight, src, getFn }\n}\n\nfunction createKeyPath(key) {\n return isArray(key) ? key : key.split('.')\n}\n\nfunction createKeyId(key) {\n return isArray(key) ? key.join('.') : key\n}\n\nfunction get(obj, path) {\n let list = [];\n let arr = false;\n\n const deepGet = (obj, path, index) => {\n if (!isDefined(obj)) {\n return\n }\n if (!path[index]) {\n // If there's no path left, we've arrived at the object we care about.\n list.push(obj);\n } else {\n let key = path[index];\n\n const value = obj[key];\n\n if (!isDefined(value)) {\n return\n }\n\n // If we're at the last value in the path, and if it's a string/number/bool,\n // add it to the list\n if (\n index === path.length - 1 &&\n (isString(value) || isNumber(value) || isBoolean(value))\n ) {\n list.push(toString(value));\n } else if (isArray(value)) {\n arr = true;\n // Search each item in the array.\n for (let i = 0, len = value.length; i < len; i += 1) {\n deepGet(value[i], path, index + 1);\n }\n } else if (path.length) {\n // An object. Recurse further.\n deepGet(value, path, index + 1);\n }\n }\n };\n\n // Backwards compatibility (since path used to be a string)\n deepGet(obj, isString(path) ? path.split('.') : path, 0);\n\n return arr ? list : list[0]\n}\n\nconst MatchOptions = {\n // Whether the matches should be included in the result set. When `true`, each record in the result\n // set will include the indices of the matched characters.\n // These can consequently be used for highlighting purposes.\n includeMatches: false,\n // When `true`, the matching function will continue to the end of a search pattern even if\n // a perfect match has already been located in the string.\n findAllMatches: false,\n // Minimum number of characters that must be matched before a result is considered a match\n minMatchCharLength: 1\n};\n\nconst BasicOptions = {\n // When `true`, the algorithm continues searching to the end of the input even if a perfect\n // match is found before the end of the same input.\n isCaseSensitive: false,\n // When `true`, the algorithm will ignore diacritics (accents) in comparisons\n ignoreDiacritics: false,\n // When true, the matching function will continue to the end of a search pattern even if\n includeScore: false,\n // List of properties that will be searched. This also supports nested properties.\n keys: [],\n // Whether to sort the result list, by score\n shouldSort: true,\n // Default sort function: sort by ascending score, ascending index\n sortFn: (a, b) =>\n a.score === b.score ? (a.idx < b.idx ? -1 : 1) : a.score < b.score ? -1 : 1\n};\n\nconst FuzzyOptions = {\n // Approximately where in the text is the pattern expected to be found?\n location: 0,\n // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match\n // (of both letters and location), a threshold of '1.0' would match anything.\n threshold: 0.6,\n // Determines how close the match must be to the fuzzy location (specified above).\n // An exact letter match which is 'distance' characters away from the fuzzy location\n // would score as a complete mismatch. A distance of '0' requires the match be at\n // the exact location specified, a threshold of '1000' would require a perfect match\n // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.\n distance: 100\n};\n\nconst AdvancedOptions = {\n // When `true`, it enables the use of unix-like search commands\n useExtendedSearch: false,\n // The get function to use when fetching an object's properties.\n // The default will search nested paths *ie foo.bar.baz*\n getFn: get,\n // When `true`, search will ignore `location` and `distance`, so it won't matter\n // where in the string the pattern appears.\n // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score\n ignoreLocation: false,\n // When `true`, the calculation for the relevance score (used for sorting) will\n // ignore the field-length norm.\n // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm\n ignoreFieldNorm: false,\n // The weight to determine how much field length norm effects scoring.\n fieldNormWeight: 1\n};\n\nvar Config = {\n ...BasicOptions,\n ...MatchOptions,\n ...FuzzyOptions,\n ...AdvancedOptions\n};\n\nconst SPACE = /[^ ]+/g;\n\n// Field-length norm: the shorter the field, the higher the weight.\n// Set to 3 decimals to reduce index size.\nfunction norm(weight = 1, mantissa = 3) {\n const cache = new Map();\n const m = Math.pow(10, mantissa);\n\n return {\n get(value) {\n const numTokens = value.match(SPACE).length;\n\n if (cache.has(numTokens)) {\n return cache.get(numTokens)\n }\n\n // Default function is 1/sqrt(x), weight makes that variable\n const norm = 1 / Math.pow(numTokens, 0.5 * weight);\n\n // In place of `toFixed(mantissa)`, for faster computation\n const n = parseFloat(Math.round(norm * m) / m);\n\n cache.set(numTokens, n);\n\n return n\n },\n clear() {\n cache.clear();\n }\n }\n}\n\nclass FuseIndex {\n constructor({\n getFn = Config.getFn,\n fieldNormWeight = Config.fieldNormWeight\n } = {}) {\n this.norm = norm(fieldNormWeight, 3);\n this.getFn = getFn;\n this.isCreated = false;\n\n this.setIndexRecords();\n }\n setSources(docs = []) {\n this.docs = docs;\n }\n setIndexRecords(records = []) {\n this.records = records;\n }\n setKeys(keys = []) {\n this.keys = keys;\n this._keysMap = {};\n keys.forEach((key, idx) => {\n this._keysMap[key.id] = idx;\n });\n }\n create() {\n if (this.isCreated || !this.docs.length) {\n return\n }\n\n this.isCreated = true;\n\n // List is Array<String>\n if (isString(this.docs[0])) {\n this.docs.forEach((doc, docIndex) => {\n this._addString(doc, docIndex);\n });\n } else {\n // List is Array<Object>\n this.docs.forEach((doc, docIndex) => {\n this._addObject(doc, docIndex);\n });\n }\n\n this.norm.clear();\n }\n // Adds a doc to the end of the index\n add(doc) {\n const idx = this.size();\n\n if (isString(doc)) {\n this._addString(doc, idx);\n } else {\n this._addObject(doc, idx);\n }\n }\n // Removes the doc at the specified index of the index\n removeAt(idx) {\n this.records.splice(idx, 1);\n\n // Change ref index of every subsquent doc\n for (let i = idx, len = this.size(); i < len; i += 1) {\n this.records[i].i -= 1;\n }\n }\n getValueForItemAtKeyId(item, keyId) {\n return item[this._keysMap[keyId]]\n }\n size() {\n return this.records.length\n }\n _addString(doc, docIndex) {\n if (!isDefined(doc) || isBlank(doc)) {\n return\n }\n\n let record = {\n v: doc,\n i: docIndex,\n n: this.norm.get(doc)\n };\n\n this.records.push(record);\n }\n _addObject(doc, docIndex) {\n let record = { i: docIndex, $: {} };\n\n // Iterate over every key (i.e, path), and fetch the value at that key\n this.keys.forEach((key, keyIndex) => {\n let value = key.getFn ? key.getFn(doc) : this.getFn(doc, key.path);\n\n if (!isDefined(value)) {\n return\n }\n\n if (isArray(value)) {\n let subRecords = [];\n const stack = [{ nestedArrIndex: -1, value }];\n\n while (stack.length) {\n const { nestedArrIndex, value } = stack.pop();\n\n if (!isDefined(value)) {\n continue\n }\n\n if (isString(value) && !isBlank(value)) {\n let subRecord = {\n v: value,\n i: nestedArrIndex,\n n: this.norm.get(value)\n };\n\n subRecords.push(subRecord);\n } else if (isArray(value)) {\n value.forEach((item, k) => {\n stack.push({\n nestedArrIndex: k,\n value: item\n });\n });\n } else ;\n }\n record.$[keyIndex] = subRecords;\n } else if (isString(value) && !isBlank(value)) {\n let subRecord = {\n v: value,\n n: this.norm.get(value)\n };\n\n record.$[keyIndex] = subRecord;\n }\n });\n\n this.records.push(record);\n }\n toJSON() {\n return {\n keys: this.keys,\n records: this.records\n }\n }\n}\n\nfunction createIndex(\n keys,\n docs,\n { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}\n) {\n const myIndex = new FuseIndex({ getFn, fieldNormWeight });\n myIndex.setKeys(keys.map(createKey));\n myIndex.setSources(docs);\n myIndex.create();\n return myIndex\n}\n\nfunction parseIndex(\n data,\n { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}\n) {\n const { keys, records } = data;\n const myIndex = new FuseIndex({ getFn, fieldNormWeight });\n myIndex.setKeys(keys);\n myIndex.setIndexRecords(records);\n return myIndex\n}\n\nfunction computeScore$1(\n pattern,\n {\n errors = 0,\n currentLocation = 0,\n expectedLocation = 0,\n distance = Config.distance,\n ignoreLocation = Config.ignoreLocation\n } = {}\n) {\n const accuracy = errors / pattern.length;\n\n if (ignoreLocation) {\n return accuracy\n }\n\n const proximity = Math.abs(expectedLocation - currentLocation);\n\n if (!distance) {\n // Dodge divide by zero error.\n return proximity ? 1.0 : accuracy\n }\n\n return accuracy + proximity / distance\n}\n\nfunction convertMaskToIndices(\n matchmask = [],\n minMatchCharLength = Config.minMatchCharLength\n) {\n let indices = [];\n let start = -1;\n let end = -1;\n let i = 0;\n\n for (let len = matchmask.length; i < len; i += 1) {\n let match = matchmask[i];\n if (match && start === -1) {\n start = i;\n } else if (!match && start !== -1) {\n end = i - 1;\n if (end - start + 1 >= minMatchCharLength) {\n indices.push([start, end]);\n }\n start = -1;\n }\n }\n\n // (i-1 - start) + 1 => i - start\n if (matchmask[i - 1] && i - start >= minMatchCharLength) {\n indices.push([start, i - 1]);\n }\n\n return indices\n}\n\n// Machine word size\nconst MAX_BITS = 32;\n\nfunction search(\n text,\n pattern,\n patternAlphabet,\n {\n location = Config.location,\n distance = Config.distance,\n threshold = Config.threshold,\n findAllMatches = Config.findAllMatches,\n minMatchCharLength = Config.minMatchCharLength,\n includeMatches = Config.includeMatches,\n ignoreLocation = Config.ignoreLocation\n } = {}\n) {\n if (pattern.length > MAX_BITS) {\n throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS))\n }\n\n const patternLen = pattern.length;\n // Set starting location at beginning text and initialize the alphabet.\n const textLen = text.length;\n // Handle the case when location > text.length\n const expectedLocation = Math.max(0, Math.min(location, textLen));\n // Highest score beyond which we give up.\n let currentThreshold = threshold;\n // Is there a nearby exact match? (speedup)\n let bestLocation = expectedLocation;\n\n // Performance: only computer matches when the minMatchCharLength > 1\n // OR if `includeMatches` is true.\n const computeMatches = minMatchCharLength > 1 || includeMatches;\n // A mask of the matches, used for building the indices\n const matchMask = computeMatches ? Array(textLen) : [];\n\n let index;\n\n // Get all exact matches, here for speed up\n while ((index = text.indexOf(pattern, bestLocation)) > -1) {\n let score = computeScore$1(pattern, {\n currentLocation: index,\n expectedLocation,\n distance,\n ignoreLocation\n });\n\n currentThreshold = Math.min(score, currentThreshold);\n bestLocation = index + patternLen;\n\n if (computeMatches) {\n let i = 0;\n while (i < patternLen) {\n matchMask[index + i] = 1;\n i += 1;\n }\n }\n }\n\n // Reset the best location\n bestLocation = -1;\n\n let lastBitArr = [];\n let finalScore = 1;\n let binMax = patternLen + textLen;\n\n const mask = 1 << (patternLen - 1);\n\n for (let i = 0; i < patternLen; i += 1) {\n // Scan for the best match; each iteration allows for one more error.\n // Run a binary search to determine how far from the match location we can stray\n // at this error level.\n let binMin = 0;\n let binMid = binMax;\n\n while (binMin < binMid) {\n const score = computeScore$1(pattern, {\n errors: i,\n currentLocation: expectedLocation + binMid,\n expectedLocation,\n distance,\n ignoreLocation\n });\n\n if (score <= currentThreshold) {\n binMin = binMid;\n } else {\n binMax = binMid;\n }\n\n binMid = Math.floor((binMax - binMin) / 2 + binMin);\n }\n\n // Use the result from this iteration as the maximum for the next.\n binMax = binMid;\n\n let start = Math.max(1, expectedLocation - binMid + 1);\n let finish = findAllMatches\n ? textLen\n : Math.min(expectedLocation + binMid, textLen) + patternLen;\n\n // Initialize the bit array\n let bitArr = Array(finish + 2);\n\n bitArr[finish + 1] = (1 << i) - 1;\n\n for (let j = finish; j >= start; j -= 1) {\n let currentLocation = j - 1;\n let charMatch = patternAlphabet[text.charAt(currentLocation)];\n\n if (computeMatches) {\n // Speed up: quick bool to int conversion (i.e, `charMatch ? 1 : 0`)\n matchMask[currentLocation] = +!!charMatch;\n }\n\n // First pass: exact match\n bitArr[j] = ((bitArr[j + 1] << 1) | 1) & charMatch;\n\n // Subsequent passes: fuzzy match\n if (i) {\n bitArr[j] |=\n ((lastBitArr[j + 1] | lastBitArr[j]) << 1) | 1 | lastBitArr[j + 1];\n }\n\n if (bitArr[j] & mask) {\n finalScore = computeScore$1(pattern, {\n errors: i,\n currentLocation,\n expectedLocation,\n distance,\n ignoreLocation\n });\n\n // This match will almost certainly be better than any existing match.\n // But check anyway.\n if (finalScore <= currentThreshold) {\n // Indeed it is\n currentThreshold = finalScore;\n bestLocation = currentLocation;\n\n // Already passed `loc`, downhill from here on in.\n if (bestLocation <= expectedLocation) {\n break\n }\n\n // When passing `bestLocation`, don't exceed our current distance from `expectedLocation`.\n start = Math.max(1, 2 * expectedLocation - bestLocation);\n }\n }\n }\n\n // No hope for a (better) match at greater error levels.\n const score = computeScore$1(pattern, {\n errors: i + 1,\n currentLocation: expectedLocation,\n expectedLocation,\n distance,\n ignoreLocation\n });\n\n if (score > currentThreshold) {\n break\n }\n\n lastBitArr = bitArr;\n }\n\n const result = {\n isMatch: bestLocation >= 0,\n // Count exact matches (those with a score of 0) to be \"almost\" exact\n score: Math.max(0.001, finalScore)\n };\n\n if (computeMatches) {\n const indices = convertMaskToIndices(matchMask, minMatchCharLength);\n if (!indices.length) {\n result.isMatch = false;\n } else if (includeMatches) {\n result.indices = indices;\n }\n }\n\n return result\n}\n\nfunction createPatternAlphabet(pattern) {\n let mask = {};\n\n for (let i = 0, len = pattern.length; i < len; i += 1) {\n const char = pattern.charAt(i);\n mask[char] = (mask[char] || 0) | (1 << (len - i - 1));\n }\n\n return mask\n}\n\nconst stripDiacritics = String.prototype.normalize\n ? ((str) => str.normalize('NFD').replace(/[\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C04\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u1885\\u1886\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1AB0-\\u1ABE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8E0-\\uA8F1\\uA8FF\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F]/g, ''))\n : ((str) => str);\n\nclass BitapSearch {\n constructor(\n pattern,\n {\n location = Config.location,\n threshold = Config.threshold,\n distance = Config.distance,\n includeMatches = Config.includeMatches,\n findAllMatches = Config.findAllMatches,\n minMatchCharLength = Config.minMatchCharLength,\n isCaseSensitive = Config.isCaseSensitive,\n ignoreDiacritics = Config.ignoreDiacritics,\n ignoreLocation = Config.ignoreLocation\n } = {}\n ) {\n this.options = {\n location,\n threshold,\n distance,\n includeMatches,\n findAllMatches,\n minMatchCharLength,\n isCaseSensitive,\n ignoreDiacritics,\n ignoreLocation\n };\n\n pattern = isCaseSensitive ? pattern : pattern.toLowerCase();\n pattern = ignoreDiacritics ? stripDiacritics(pattern) : pattern;\n this.pattern = pattern;\n\n this.chunks = [];\n\n if (!this.pattern.length) {\n return\n }\n\n const addChunk = (pattern, startIndex) => {\n this.chunks.push({\n pattern,\n alphabet: createPatternAlphabet(pattern),\n startIndex\n });\n };\n\n const len = this.pattern.length;\n\n if (len > MAX_BITS) {\n let i = 0;\n const remainder = len % MAX_BITS;\n const end = len - remainder;\n\n while (i < end) {\n addChunk(this.pattern.substr(i, MAX_BITS), i);\n i += MAX_BITS;\n }\n\n if (remainder) {\n const startIndex = len - MAX_BITS;\n addChunk(this.pattern.substr(startIndex), startIndex);\n }\n } else {\n addChunk(this.pattern, 0);\n }\n }\n\n searchIn(text) {\n const { isCaseSensitive, ignoreDiacritics, includeMatches } = this.options;\n\n text = isCaseSensitive ? text : text.toLowerCase();\n text = ignoreDiacritics ? stripDiacritics(text) : text;\n\n // Exact match\n if (this.pattern === text) {\n let result = {\n isMatch: true,\n score: 0\n };\n\n if (includeMatches) {\n result.indices = [[0, text.length - 1]];\n }\n\n return result\n }\n\n // Otherwise, use Bitap algorithm\n const {\n location,\n distance,\n threshold,\n findAllMatches,\n minMatchCharLength,\n ignoreLocation\n } = this.options;\n\n let allIndices = [];\n let totalScore = 0;\n let hasMatches = false;\n\n this.chunks.forEach(({ pattern, alphabet, startIndex }) => {\n const { isMatch, score, indices } = search(text, pattern, alphabet, {\n location: location + startIndex,\n distance,\n threshold,\n findAllMatches,\n minMatchCharLength,\n includeMatches,\n ignoreLocation\n });\n\n if (isMatch) {\n hasMatches = true;\n }\n\n totalScore += score;\n\n if (isMatch && indices) {\n allIndices = [...allIndices, ...indices];\n }\n });\n\n let result = {\n isMatch: hasMatches,\n score: hasMatches ? totalScore / this.chunks.length : 1\n };\n\n if (hasMatches && includeMatches) {\n result.indices = allIndices;\n }\n\n return result\n }\n}\n\nclass BaseMatch {\n constructor(pattern) {\n this.pattern = pattern;\n }\n static isMultiMatch(pattern) {\n return getMatch(pattern, this.multiRegex)\n }\n static isSingleMatch(pattern) {\n return getMatch(pattern, this.singleRegex)\n }\n search(/*text*/) {}\n}\n\nfunction getMatch(pattern, exp) {\n const matches = pattern.match(exp);\n return matches ? matches[1] : null\n}\n\n// Token: 'file\n\nclass ExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'exact'\n }\n static get multiRegex() {\n return /^=\"(.*)\"$/\n }\n static get singleRegex() {\n return /^=(.*)$/\n }\n search(text) {\n const isMatch = text === this.pattern;\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, this.pattern.length - 1]\n }\n }\n}\n\n// Token: !fire\n\nclass InverseExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'inverse-exact'\n }\n static get multiRegex() {\n return /^!\"(.*)\"$/\n }\n static get singleRegex() {\n return /^!(.*)$/\n }\n search(text) {\n const index = text.indexOf(this.pattern);\n const isMatch = index === -1;\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, text.length - 1]\n }\n }\n}\n\n// Token: ^file\n\nclass PrefixExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'prefix-exact'\n }\n static get multiRegex() {\n return /^\\^\"(.*)\"$/\n }\n static get singleRegex() {\n return /^\\^(.*)$/\n }\n search(text) {\n const isMatch = text.startsWith(this.pattern);\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, this.pattern.length - 1]\n }\n }\n}\n\n// Token: !^fire\n\nclass InversePrefixExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'inverse-prefix-exact'\n }\n static get multiRegex() {\n return /^!\\^\"(.*)\"$/\n }\n static get singleRegex() {\n return /^!\\^(.*)$/\n }\n search(text) {\n const isMatch = !text.startsWith(this.pattern);\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, text.length - 1]\n }\n }\n}\n\n// Token: .file$\n\nclass SuffixExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'suffix-exact'\n }\n static get multiRegex() {\n return /^\"(.*)\"\\$$/\n }\n static get singleRegex() {\n return /^(.*)\\$$/\n }\n search(text) {\n const isMatch = text.endsWith(this.pattern);\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [text.length - this.pattern.length, text.length - 1]\n }\n }\n}\n\n// Token: !.file$\n\nclass InverseSuffixExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'inverse-suffix-exact'\n }\n static get multiRegex() {\n return /^!\"(.*)\"\\$$/\n }\n static get singleRegex() {\n return /^!(.*)\\$$/\n }\n search(text) {\n const isMatch = !text.endsWith(this.pattern);\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, text.length - 1]\n }\n }\n}\n\nclass FuzzyMatch extends BaseMatch {\n constructor(\n pattern,\n {\n location = Config.location,\n threshold = Config.threshold,\n distance = Config.distance,\n includeMatches = Config.includeMatches,\n findAllMatches = Config.findAllMatches,\n minMatchCharLength = Config.minMatchCharLength,\n isCaseSensitive = Config.isCaseSensitive,\n ignoreDiacritics = Config.ignoreDiacritics,\n ignoreLocation = Config.ignoreLocation\n } = {}\n ) {\n super(pattern);\n this._bitapSearch = new BitapSearch(pattern, {\n location,\n threshold,\n distance,\n includeMatches,\n findAllMatches,\n minMatchCharLength,\n isCaseSensitive,\n ignoreDiacritics,\n ignoreLocation\n });\n }\n static get type() {\n return 'fuzzy'\n }\n static get multiRegex() {\n return /^\"(.*)\"$/\n }\n static get singleRegex() {\n return /^(.*)$/\n }\n search(text) {\n return this._bitapSearch.searchIn(text)\n }\n}\n\n// Token: 'file\n\nclass IncludeMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'include'\n }\n static get multiRegex() {\n return /^'\"(.*)\"$/\n }\n static get singleRegex() {\n return /^'(.*)$/\n }\n search(text) {\n let location = 0;\n let index;\n\n const indices = [];\n const patternLen = this.pattern.length;\n\n // Get all exact matches\n while ((index = text.indexOf(this.pattern, location)) > -1) {\n location = index + patternLen;\n indices.push([index, location - 1]);\n }\n\n const isMatch = !!indices.length;\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices\n }\n }\n}\n\n// ❗Order is important. DO NOT CHANGE.\nconst searchers = [\n ExactMatch,\n IncludeMatch,\n PrefixExactMatch,\n InversePrefixExactMatch,\n InverseSuffixExactMatch,\n SuffixExactMatch,\n InverseExactMatch,\n FuzzyMatch\n];\n\nconst searchersLen = searchers.length;\n\n// Regex to split by spaces, but keep anything in quotes together\nconst SPACE_RE = / +(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)/;\nconst OR_TOKEN = '|';\n\n// Return a 2D array representation of the query, for simpler parsing.\n// Example:\n// \"^core go$ | rb$ | py$ xy$\" => [[\"^core\", \"go$\"], [\"rb$\"], [\"py$\", \"xy$\"]]\nfunction parseQuery(pattern, options = {}) {\n return pattern.split(OR_TOKEN).map((item) => {\n let query = item\n .trim()\n .split(SPACE_RE)\n .filter((item) => item && !!item.trim());\n\n let results = [];\n for (let i = 0, len = query.length; i < len; i += 1) {\n const queryItem = query[i];\n\n // 1. Handle multiple query match (i.e, once that are quoted, like `\"hello world\"`)\n let found = false;\n let idx = -1;\n while (!found && ++idx < searchersLen) {\n const searcher = searchers[idx];\n let token = searcher.isMultiMatch(queryItem);\n if (token) {\n results.push(new searcher(token, options));\n found = true;\n }\n }\n\n if (found) {\n continue\n }\n\n // 2. Handle single query matches (i.e, once that are *not* quoted)\n idx = -1;\n while (++idx < searchersLen) {\n const searcher = searchers[idx];\n let token = searcher.isSingleMatch(queryItem);\n if (token) {\n results.push(new searcher(token, options));\n break\n }\n }\n }\n\n return results\n })\n}\n\n// These extended matchers can return an array of matches, as opposed\n// to a singl match\nconst MultiMatchSet = new Set([FuzzyMatch.type, IncludeMatch.type]);\n\n/**\n * Command-like searching\n * ======================\n *\n * Given multiple search terms delimited by spaces.e.g. `^jscript .python$ ruby !java`,\n * search in a given text.\n *\n * Search syntax:\n *\n * | Token | Match type | Description |\n * | ----------- | -------------------------- | -------------------------------------- |\n * | `jscript` | fuzzy-match | Items that fuzzy match `jscript` |\n * | `=scheme` | exact-match | Items that are `scheme` |\n * | `'python` | include-match | Items that include `python` |\n * | `!ruby` | inverse-exact-match | Items that do not include `ruby` |\n * | `^java` | prefix-exact-match | Items that start with `java` |\n * | `!^earlang` | inverse-prefix-exact-match | Items that do not start with `earlang` |\n * | `.js$` | suffix-exact-match | Items that end with `.js` |\n * | `!.go$` | inverse-suffix-exact-match | Items that do not end with `.go` |\n *\n * A single pipe character acts as an OR operator. For example, the following\n * query matches entries that start with `core` and end with either`go`, `rb`,\n * or`py`.\n *\n * ```\n * ^core go$ | rb$ | py$\n * ```\n */\nclass ExtendedSearch {\n constructor(\n pattern,\n {\n isCaseSensitive = Config.isCaseSensitive,\n ignoreDiacritics = Config.ignoreDiacritics,\n includeMatches = Config.includeMatches,\n minMatchCharLength = Config.minMatchCharLength,\n ignoreLocation = Config.ignoreLocation,\n findAllMatches = Config.findAllMatches,\n location = Config.location,\n threshold = Config.threshold,\n distance = Config.distance\n } = {}\n ) {\n this.query = null;\n this.options = {\n isCaseSensitive,\n ignoreDiacritics,\n includeMatches,\n minMatchCharLength,\n findAllMatches,\n ignoreLocation,\n location,\n threshold,\n distance\n };\n\n pattern = isCaseSensitive ? pattern : pattern.toLowerCase();\n pattern = ignoreDiacritics ? stripDiacritics(pattern) : pattern;\n this.pattern = pattern;\n this.query = parseQuery(this.pattern, this.options);\n }\n\n static condition(_, options) {\n return options.useExtendedSearch\n }\n\n searchIn(text) {\n const query = this.query;\n\n if (!query) {\n return {\n isMatch: false,\n score: 1\n }\n }\n\n const { includeMatches, isCaseSensitive, ignoreDiacritics } = this.options;\n\n text = isCaseSensitive ? text : text.toLowerCase();\n text = ignoreDiacritics ? stripDiacritics(text) : text;\n\n let numMatches = 0;\n let allIndices = [];\n let totalScore = 0;\n\n // ORs\n for (let i = 0, qLen = query.length; i < qLen; i += 1) {\n const searchers = query[i];\n\n // Reset indices\n allIndices.length = 0;\n numMatches = 0;\n\n // ANDs\n for (let j = 0, pLen = searchers.length; j < pLen; j += 1) {\n const searcher = searchers[j];\n const { isMatch, indices, score } = searcher.search(text);\n\n if (isMatch) {\n numMatches += 1;\n totalScore += score;\n if (includeMatches) {\n const type = searcher.constructor.type;\n if (MultiMatchSet.has(type)) {\n allIndices = [...allIndices, ...indices];\n } else {\n allIndices.push(indices);\n }\n }\n } else {\n totalScore = 0;\n numMatches = 0;\n allIndices.length = 0;\n break\n }\n }\n\n // OR condition, so if TRUE, return\n if (numMatches) {\n let result = {\n isMatch: true,\n score: totalScore / numMatches\n };\n\n if (includeMatches) {\n result.indices = allIndices;\n }\n\n return result\n }\n }\n\n // Nothing was matched\n return {\n isMatch: false,\n score: 1\n }\n }\n}\n\nconst registeredSearchers = [];\n\nfunction register(...args) {\n registeredSearchers.push(...args);\n}\n\nfunction createSearcher(pattern, options) {\n for (let i = 0, len = registeredSearchers.length; i < len; i += 1) {\n let searcherClass = registeredSearchers[i];\n if (searcherClass.condition(pattern, options)) {\n return new searcherClass(pattern, options)\n }\n }\n\n return new BitapSearch(pattern, options)\n}\n\nconst LogicalOperator = {\n AND: '$and',\n OR: '$or'\n};\n\nconst KeyType = {\n PATH: '$path',\n PATTERN: '$val'\n};\n\nconst isExpression = (query) =>\n !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);\n\nconst isPath = (query) => !!query[KeyType.PATH];\n\nconst isLeaf = (query) =>\n !isArray(query) && isObject(query) && !isExpression(query);\n\nconst convertToExplicit = (query) => ({\n [LogicalOperator.AND]: Object.keys(query).map((key) => ({\n [key]: query[key]\n }))\n});\n\n// When `auto` is `true`, the parse function will infer and initialize and add\n// the appropriate `Searcher` instance\nfunction parse(query, options, { auto = true } = {}) {\n const next = (query) => {\n let keys = Object.keys(query);\n\n const isQueryPath = isPath(query);\n\n if (!isQueryPath && keys.length > 1 && !isExpression(query)) {\n return next(convertToExplicit(query))\n }\n\n if (isLeaf(query)) {\n const key = isQueryPath ? query[KeyType.PATH] : keys[0];\n\n const pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];\n\n if (!isString(pattern)) {\n throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key))\n }\n\n const obj = {\n keyId: createKeyId(key),\n pattern\n };\n\n if (auto) {\n obj.searcher = createSearcher(pattern, options);\n }\n\n return obj\n }\n\n let node = {\n children: [],\n operator: keys[0]\n };\n\n keys.forEach((key) => {\n const value = query[key];\n\n if (isArray(value)) {\n value.forEach((item) => {\n node.children.push(next(item));\n });\n }\n });\n\n return node\n };\n\n if (!isExpression(query)) {\n query = convertToExplicit(query);\n }\n\n return next(query)\n}\n\n// Practical scoring function\nfunction computeScore(\n results,\n { ignoreFieldNorm = Config.ignoreFieldNorm }\n) {\n results.forEach((result) => {\n let totalScore = 1;\n\n result.matches.forEach(({ key, norm, score }) => {\n const weight = key ? key.weight : null;\n\n totalScore *= Math.pow(\n score === 0 && weight ? Number.EPSILON : score,\n (weight || 1) * (ignoreFieldNorm ? 1 : norm)\n );\n });\n\n result.score = totalScore;\n });\n}\n\nfunction transformMatches(result, data) {\n const matches = result.matches;\n data.matches = [];\n\n if (!isDefined(matches)) {\n return\n }\n\n matches.forEach((match) => {\n if (!isDefined(match.indices) || !match.indices.length) {\n return\n }\n\n const { indices, value } = match;\n\n let obj = {\n indices,\n value\n };\n\n if (match.key) {\n obj.key = match.key.src;\n }\n\n if (match.idx > -1) {\n obj.refIndex = match.idx;\n }\n\n data.matches.push(obj);\n });\n}\n\nfunction transformScore(result, data) {\n data.score = result.score;\n}\n\nfunction format(\n results,\n docs,\n {\n includeMatches = Config.includeMatches,\n includeScore = Config.includeScore\n } = {}\n) {\n const transformers = [];\n\n if (includeMatches) transformers.push(transformMatches);\n if (includeScore) transformers.push(transformScore);\n\n return results.map((result) => {\n const { idx } = result;\n\n const data = {\n item: docs[idx],\n refIndex: idx\n };\n\n if (transformers.length) {\n transformers.forEach((transformer) => {\n transformer(result, data);\n });\n }\n\n return data\n })\n}\n\nclass Fuse {\n constructor(docs, options = {}, index) {\n this.options = { ...Config, ...options };\n\n if (\n this.options.useExtendedSearch &&\n !true\n ) {\n throw new Error(EXTENDED_SEARCH_UNAVAILABLE)\n }\n\n this._keyStore = new KeyStore(this.options.keys);\n\n this.setCollection(docs, index);\n }\n\n setCollection(docs, index) {\n this._docs = docs;\n\n if (index && !(index instanceof FuseIndex)) {\n throw new Error(INCORRECT_INDEX_TYPE)\n }\n\n this._myIndex =\n index ||\n createIndex(this.options.keys, this._docs, {\n getFn: this.options.getFn,\n fieldNormWeight: this.options.fieldNormWeight\n });\n }\n\n add(doc) {\n if (!isDefined(doc)) {\n return\n }\n\n this._docs.push(doc);\n this._myIndex.add(doc);\n }\n\n remove(predicate = (/* doc, idx */) => false) {\n const results = [];\n\n for (let i = 0, len = this._docs.length; i < len; i += 1) {\n const doc = this._docs[i];\n if (predicate(doc, i)) {\n this.removeAt(i);\n i -= 1;\n len -= 1;\n\n results.push(doc);\n }\n }\n\n return results\n }\n\n removeAt(idx) {\n this._docs.splice(idx, 1);\n this._myIndex.removeAt(idx);\n }\n\n getIndex() {\n return this._myIndex\n }\n\n search(query, { limit = -1 } = {}) {\n const {\n includeMatches,\n includeScore,\n shouldSort,\n sortFn,\n ignoreFieldNorm\n } = this.options;\n\n let results = isString(query)\n ? isString(this._docs[0])\n ? this._searchStringList(query)\n : this._searchObjectList(query)\n : this._searchLogical(query);\n\n computeScore(results, { ignoreFieldNorm });\n\n if (shouldSort) {\n results.sort(sortFn);\n }\n\n if (isNumber(limit) && limit > -1) {\n results = results.slice(0, limit);\n }\n\n return format(results, this._docs, {\n includeMatches,\n includeScore\n })\n }\n\n _searchStringList(query) {\n const searcher = createSearcher(query, this.options);\n const { records } = this._myIndex;\n const results = [];\n\n // Iterate over every string in the index\n records.forEach(({ v: text, i: idx, n: norm }) => {\n if (!isDefined(text)) {\n return\n }\n\n const { isMatch, score, indices } = searcher.searchIn(text);\n\n if (isMatch) {\n results.push({\n item: text,\n idx,\n matches: [{ score, value: text, norm, indices }]\n });\n }\n });\n\n return results\n }\n\n _searchLogical(query) {\n\n const expression = parse(query, this.options);\n\n const evaluate = (node, item, idx) => {\n if (!node.children) {\n const { keyId, searcher } = node;\n\n const matches = this._findMatches({\n key: this._keyStore.get(keyId),\n value: this._myIndex.getValueForItemAtKeyId(item, keyId),\n searcher\n });\n\n if (matches && matches.length) {\n return [\n {\n idx,\n item,\n matches\n }\n ]\n }\n\n return []\n }\n\n const res = [];\n for (let i = 0, len = node.children.length; i < len; i += 1) {\n const child = node.children[i];\n const result = evaluate(child, item, idx);\n if (result.length) {\n res.push(...result);\n } else if (node.operator === LogicalOperator.AND) {\n return []\n }\n }\n return res\n };\n\n const records = this._myIndex.records;\n const resultMap = {};\n const results = [];\n\n records.forEach(({ $: item, i: idx }) => {\n if (isDefined(item)) {\n let expResults = evaluate(expression, item, idx);\n\n if (expResults.length) {\n // Dedupe when adding\n if (!resultMap[idx]) {\n resultMap[idx] = { idx, item, matches: [] };\n results.push(resultMap[idx]);\n }\n expResults.forEach(({ matches }) => {\n resultMap[idx].matches.push(...matches);\n });\n }\n }\n });\n\n return results\n }\n\n _searchObjectList(query) {\n const searcher = createSearcher(query, this.options);\n const { keys, records } = this._myIndex;\n const results = [];\n\n // List is Array<Object>\n records.forEach(({ $: item, i: idx }) => {\n if (!isDefined(item)) {\n return\n }\n\n let matches = [];\n\n // Iterate over every key (i.e, path), and fetch the value at that key\n keys.forEach((key, keyIndex) => {\n matches.push(\n ...this._findMatches({\n key,\n value: item[keyIndex],\n searcher\n })\n );\n });\n\n if (matches.length) {\n results.push({\n idx,\n item,\n matches\n });\n }\n });\n\n return results\n }\n _findMatches({ key, value, searcher }) {\n if (!isDefined(value)) {\n return []\n }\n\n let matches = [];\n\n if (isArray(value)) {\n value.forEach(({ v: text, i: idx, n: norm }) => {\n if (!isDefined(text)) {\n return\n }\n\n const { isMatch, score, indices } = searcher.searchIn(text);\n\n if (isMatch) {\n matches.push({\n score,\n key,\n value: text,\n idx,\n norm,\n indices\n });\n }\n });\n } else {\n const { v: text, n: norm } = value;\n\n const { isMatch, score, indices } = searcher.searchIn(text);\n\n if (isMatch) {\n matches.push({ score, key, value: text, norm, indices });\n }\n }\n\n return matches\n }\n}\n\nFuse.version = '7.1.0';\nFuse.createIndex = createIndex;\nFuse.parseIndex = parseIndex;\nFuse.config = Config;\n\n{\n Fuse.parseQuery = parse;\n}\n\n{\n register(ExtendedSearch);\n}\n\nexport { Fuse as default };\n","import { useEffect, useState } from 'preact/hooks';\n\nexport const MIN_SCHEDULED_AT = 6 * 60 * 1000; // 6 mins\nconst MAX_SCHEDULED_AT = 90 * 24 * 60 * 60 * 1000; // 90 days\n\nexport default function ScheduledAtField({ scheduledAt, setScheduledAt }) {\n if (!scheduledAt || !(scheduledAt instanceof Date)) {\n console.warn('scheduledAt is not a Date:', scheduledAt);\n return;\n }\n const [minStr, setMinStr] = useState();\n const [maxStr, setMaxStr] = useState();\n const timezoneOffset = scheduledAt.getTimezoneOffset();\n\n useEffect(() => {\n function updateMinStr() {\n const min = new Date(Date.now() + MIN_SCHEDULED_AT);\n const str = new Date(min.getTime() - timezoneOffset * 60000)\n .toISOString()\n .slice(0, 16);\n setMinStr(str);\n }\n updateMinStr();\n\n function updateMaxStr() {\n const max = new Date(Date.now() + MAX_SCHEDULED_AT);\n const str = new Date(max.getTime() - timezoneOffset * 60000)\n .toISOString()\n .slice(0, 16);\n setMaxStr(str);\n }\n updateMaxStr();\n\n // Update every 10s\n const intervalId = setInterval(() => {\n updateMinStr();\n updateMaxStr();\n }, 1000 * 10);\n return () => clearInterval(intervalId);\n }, []);\n\n const defaultValue = scheduledAt\n ? new Date(scheduledAt.getTime() - scheduledAt.getTimezoneOffset() * 60000)\n .toISOString()\n .slice(0, 16)\n : null;\n\n return (\n <input\n type=\"datetime-local\"\n name=\"scheduledAt\"\n defaultValue={defaultValue}\n min={minStr}\n max={maxStr}\n required\n onChange={(e) => {\n setScheduledAt(new Date(e.target.value));\n }}\n />\n );\n}\n\nexport function getLocalTimezoneName() {\n const date = new Date();\n const formatter = new Intl.DateTimeFormat(undefined, {\n timeZoneName: 'long',\n });\n const parts = formatter.formatToParts(date);\n const timezoneName = parts.find(\n (part) => part.type === 'timeZoneName',\n )?.value;\n return timezoneName;\n}\n"],"file":"assets/ScheduledAtField-DT-yp6SF.js"} |