1 line
1.2 MiB
1 line
1.2 MiB
{"version":3,"file":"main-hNUnS08_.js","sources":["../../node_modules/just-debounce-it/index.mjs","../../node_modules/swiped-events/src/swiped-events.js","../../src/utils/usePageVisibility.js","../../src/components/background-service.jsx","../../src/components/compose-button.jsx","../../src/components/keyboard-shortcuts-help.jsx","../../node_modules/@formkit/auto-animate/index.mjs","../../node_modules/@formkit/auto-animate/preact/index.mjs","../../src/pages/accounts.jsx","../../src/assets/logo.svg","../../src/components/lang-selector.jsx","../../src/utils/push-notifications.js","../../src/pages/settings.jsx","../../src/utils/focus-deck.js","../../src/utils/useLocationChange.js","../../src/utils/lists.js","../../src/components/list-add-edit.jsx","../../src/components/account-info.jsx","../../src/components/account-sheet.jsx","../../src/components/drafts.jsx","../../src/components/embed-modal.jsx","../../src/components/generic-accounts.jsx","../../src/components/media-alt-modal.jsx","../../node_modules/chroma-js/src/utils/limit.js","../../node_modules/chroma-js/src/utils/type.js","../../node_modules/chroma-js/src/utils/unpack.js","../../node_modules/chroma-js/src/utils/index.js","../../node_modules/chroma-js/src/utils/multiply-matrices.js","../../node_modules/chroma-js/src/io/lab/lab-constants.js","../../node_modules/chroma-js/src/io/lab/lab2rgb.js","../../node_modules/chroma-js/src/io/oklab/oklab2rgb.js","../../node_modules/chroma-js/src/io/lab/rgb2lab.js","../../node_modules/chroma-js/src/io/oklab/rgb2oklab.js","../../node_modules/chroma-js/src/io/lch/lch2lab.js","../../node_modules/chroma-js/src/io/oklch/oklch2rgb.js","../../node_modules/chroma-js/src/io/lch/lab2lch.js","../../node_modules/chroma-js/src/io/oklch/rgb2oklch.js","../../src/components/media-modal.jsx","../../src/components/report-modal.jsx","../../node_modules/lz-string/libs/lz-string.js","../../src/assets/floating-button.svg","../../src/assets/multi-column.svg","../../src/assets/tab-menu-bar.svg","../../src/utils/followed-tags.js","../../src/components/AsyncText.jsx","../../src/components/shortcuts-settings.jsx","../../src/components/modals.jsx","../../src/components/follow-request-buttons.jsx","../../src/components/notification.jsx","../../src/components/notification-service.jsx","../../src/components/search-form.jsx","../../src/components/search-command.jsx","../../src/components/shortcuts.jsx","../../src/utils/timeline-utils.js","../../src/utils/useScroll.js","../../src/utils/useScrollFn.js","../../src/components/media-post.jsx","../../src/components/nav-menu.jsx","../../src/components/timeline.jsx","../../src/pages/account-statuses.jsx","../../src/pages/annual-report.jsx","../../src/pages/bookmarks.jsx","../../src/assets/features/catch-up.png","../../src/pages/catchup.jsx","../../src/pages/favourites.jsx","../../src/pages/filters.jsx","../../src/pages/followed-hashtags.jsx","../../src/pages/following.jsx","../../src/pages/hashtag.jsx","../../src/pages/list.jsx","../../src/utils/group-notifications.js","../../src/pages/mentions.jsx","../../src/pages/notifications.jsx","../../src/pages/public.jsx","../../src/pages/search.jsx","../../src/pages/trending.jsx","../../src/components/columns.jsx","../../src/pages/home.jsx","../../src/utils/get-instance-status-url.js","../../src/pages/http-route.jsx","../../src/pages/lists.jsx","../../src/data/instances.json?url","../../src/utils/oauth-pkce.js","../../src/utils/auth.js","../../src/pages/login.jsx","../../src/pages/status.jsx","../../src/pages/status-route.jsx","../../src/assets/features/boosts-carousel.jpg","../../src/assets/features/grouped-notifications.jpg","../../src/assets/features/multi-column.jpg","../../src/assets/features/multi-hashtag-timeline.jpg","../../src/assets/features/nested-comments-thread.jpg","../../src/assets/logo-text.svg","../../src/pages/welcome.jsx","../../src/utils/toast-alert.js","../../src/app.jsx","../../src/main.jsx"],"sourcesContent":["var functionDebounce = debounce;\n\nfunction debounce(fn, wait, callFirst) {\n var timeout = null;\n var debouncedFn = null;\n\n var clear = function() {\n if (timeout) {\n clearTimeout(timeout);\n\n debouncedFn = null;\n timeout = null;\n }\n };\n\n var flush = function() {\n var call = debouncedFn;\n clear();\n\n if (call) {\n call();\n }\n };\n\n var debounceWrapper = function() {\n if (!wait) {\n return fn.apply(this, arguments);\n }\n\n var context = this;\n var args = arguments;\n var callNow = callFirst && !timeout;\n clear();\n\n debouncedFn = function() {\n fn.apply(context, args);\n };\n\n timeout = setTimeout(function() {\n timeout = null;\n\n if (!callNow) {\n var call = debouncedFn;\n debouncedFn = null;\n\n return call();\n }\n }, wait);\n\n if (callNow) {\n return debouncedFn();\n }\n };\n\n debounceWrapper.cancel = clear;\n debounceWrapper.flush = flush;\n\n return debounceWrapper;\n}\n\nexport {functionDebounce as default};\n","/*!\n * swiped-events.js - v@version@\n * Pure JavaScript swipe events\n * https://github.com/john-doherty/swiped-events\n * @inspiration https://stackoverflow.com/questions/16348031/disable-scrolling-when-touch-moving-certain-element\n * @author John Doherty <www.johndoherty.info>\n * @license MIT\n */\n(function (window, document) {\n\n 'use strict';\n\n // patch CustomEvent to allow constructor creation (IE/Chrome)\n if (typeof window.CustomEvent !== 'function') {\n\n window.CustomEvent = function (event, params) {\n\n params = params || { bubbles: false, cancelable: false, detail: undefined };\n\n var evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n\n window.CustomEvent.prototype = window.Event.prototype;\n }\n\n document.addEventListener('touchstart', handleTouchStart, false);\n document.addEventListener('touchmove', handleTouchMove, false);\n document.addEventListener('touchend', handleTouchEnd, false);\n\n var xDown = null;\n var yDown = null;\n var xDiff = null;\n var yDiff = null;\n var timeDown = null;\n var startEl = null;\n var touchCount = 0;\n\n /**\n * Fires swiped event if swipe detected on touchend\n * @param {object} e - browser event object\n * @returns {void}\n */\n function handleTouchEnd(e) {\n\n // if the user released on a different target, cancel!\n if (startEl !== e.target) return;\n\n var swipeThreshold = parseInt(getNearestAttribute(startEl, 'data-swipe-threshold', '20'), 10); // default 20 units\n var swipeUnit = getNearestAttribute(startEl, 'data-swipe-unit', 'px'); // default px\n var swipeTimeout = parseInt(getNearestAttribute(startEl, 'data-swipe-timeout', '500'), 10); // default 500ms\n var timeDiff = Date.now() - timeDown;\n var eventType = '';\n var changedTouches = e.changedTouches || e.touches || [];\n\n if (swipeUnit === 'vh') {\n swipeThreshold = Math.round((swipeThreshold / 100) * document.documentElement.clientHeight); // get percentage of viewport height in pixels\n }\n if (swipeUnit === 'vw') {\n swipeThreshold = Math.round((swipeThreshold / 100) * document.documentElement.clientWidth); // get percentage of viewport height in pixels\n }\n\n if (Math.abs(xDiff) > Math.abs(yDiff)) { // most significant\n if (Math.abs(xDiff) > swipeThreshold && timeDiff < swipeTimeout) {\n if (xDiff > 0) {\n eventType = 'swiped-left';\n }\n else {\n eventType = 'swiped-right';\n }\n }\n }\n else if (Math.abs(yDiff) > swipeThreshold && timeDiff < swipeTimeout) {\n if (yDiff > 0) {\n eventType = 'swiped-up';\n }\n else {\n eventType = 'swiped-down';\n }\n }\n\n if (eventType !== '') {\n\n var eventData = {\n dir: eventType.replace(/swiped-/, ''),\n touchType: (changedTouches[0] || {}).touchType || 'direct',\n fingers: touchCount, // Number of fingers used\n xStart: parseInt(xDown, 10),\n xEnd: parseInt((changedTouches[0] || {}).clientX || -1, 10),\n yStart: parseInt(yDown, 10),\n yEnd: parseInt((changedTouches[0] || {}).clientY || -1, 10)\n };\n\n // fire `swiped` event event on the element that started the swipe\n startEl.dispatchEvent(new CustomEvent('swiped', { bubbles: true, cancelable: true, detail: eventData }));\n\n // fire `swiped-dir` event on the element that started the swipe\n startEl.dispatchEvent(new CustomEvent(eventType, { bubbles: true, cancelable: true, detail: eventData }));\n }\n\n // reset values\n xDown = null;\n yDown = null;\n timeDown = null;\n }\n /**\n * Records current location on touchstart event\n * @param {object} e - browser event object\n * @returns {void}\n */\n function handleTouchStart(e) {\n\n // if the element has data-swipe-ignore=\"true\" we stop listening for swipe events\n if (e.target.getAttribute('data-swipe-ignore') === 'true') return;\n\n startEl = e.target;\n\n timeDown = Date.now();\n xDown = e.touches[0].clientX;\n yDown = e.touches[0].clientY;\n xDiff = 0;\n yDiff = 0;\n touchCount = e.touches.length;\n }\n\n /**\n * Records location diff in px on touchmove event\n * @param {object} e - browser event object\n * @returns {void}\n */\n function handleTouchMove(e) {\n\n if (!xDown || !yDown) return;\n\n var xUp = e.touches[0].clientX;\n var yUp = e.touches[0].clientY;\n\n xDiff = xDown - xUp;\n yDiff = yDown - yUp;\n }\n\n /**\n * Gets attribute off HTML element or nearest parent\n * @param {object} el - HTML element to retrieve attribute from\n * @param {string} attributeName - name of the attribute\n * @param {any} defaultValue - default value to return if no match found\n * @returns {any} attribute value or defaultValue\n */\n function getNearestAttribute(el, attributeName, defaultValue) {\n\n // walk up the dom tree looking for attributeName\n while (el && el !== document.documentElement) {\n\n var attributeValue = el.getAttribute(attributeName);\n\n if (attributeValue) {\n return attributeValue;\n }\n\n el = el.parentNode;\n }\n\n return defaultValue;\n }\n\n}(window, document));\n","import { useEffect, useRef } from 'preact/hooks';\n\nexport default function usePageVisibility(fn = () => {}, deps = []) {\n const savedCallback = useRef(fn);\n useEffect(() => {\n savedCallback.current = fn;\n }, [deps]);\n\n useEffect(() => {\n const handleVisibilityChange = () => {\n const hidden = document.hidden || document.visibilityState === 'hidden';\n console.log('👀 Page visibility changed', hidden ? 'hidden' : 'visible');\n savedCallback.current(!hidden);\n };\n\n document.addEventListener('visibilitychange', handleVisibilityChange);\n return () =>\n document.removeEventListener('visibilitychange', handleVisibilityChange);\n }, []);\n}\n","import { t, Trans } from '@lingui/macro';\nimport { memo } from 'preact/compat';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\n\nimport { api } from '../utils/api';\nimport showToast from '../utils/show-toast';\nimport states, { saveStatus } from '../utils/states';\nimport useInterval from '../utils/useInterval';\nimport usePageVisibility from '../utils/usePageVisibility';\n\nconst STREAMING_TIMEOUT = 1000 * 3; // 3 seconds\nconst POLL_INTERVAL = 20_000; // 20 seconds\n\nexport default memo(function BackgroundService({ isLoggedIn }) {\n // Notifications service\n // - WebSocket to receive notifications when page is visible\n const [visible, setVisible] = useState(true);\n const visibleTimeout = useRef();\n usePageVisibility((visible) => {\n clearTimeout(visibleTimeout.current);\n if (visible) {\n setVisible(true);\n } else {\n visibleTimeout.current = setTimeout(() => {\n setVisible(false);\n }, POLL_INTERVAL);\n }\n });\n\n const checkLatestNotification = async (masto, instance, skipCheckMarkers) => {\n if (states.notificationsLast) {\n const notificationsIterator = masto.v1.notifications.list({\n limit: 1,\n sinceId: states.notificationsLast.id,\n });\n const { value: notifications } = await notificationsIterator.next();\n if (notifications?.length) {\n if (skipCheckMarkers) {\n states.notificationsShowNew = true;\n } else {\n let lastReadId;\n try {\n const markers = await masto.v1.markers.fetch({\n timeline: 'notifications',\n });\n lastReadId = markers?.notifications?.lastReadId;\n } catch (e) {}\n if (lastReadId) {\n states.notificationsShowNew = notifications[0].id !== lastReadId;\n } else {\n states.notificationsShowNew = true;\n }\n }\n }\n }\n };\n\n useEffect(() => {\n let sub;\n let streamTimeout;\n let pollNotifications;\n if (isLoggedIn && visible) {\n const { masto, streaming, instance } = api();\n (async () => {\n // 1. Get the latest notification\n await checkLatestNotification(masto, instance);\n\n let hasStreaming = false;\n // 2. Start streaming\n if (streaming) {\n streamTimeout = setTimeout(() => {\n (async () => {\n try {\n hasStreaming = true;\n sub = streaming.user.notification.subscribe();\n console.log('🎏 Streaming notification', sub);\n for await (const entry of sub) {\n if (!sub) break;\n if (!visible) break;\n console.log('🔔🔔 Notification entry', entry);\n if (entry.event === 'notification') {\n console.log('🔔🔔 Notification', entry);\n saveStatus(entry.payload, instance, {\n skipThreading: true,\n });\n }\n states.notificationsShowNew = true;\n }\n console.log('💥 Streaming notification loop STOPPED');\n } catch (e) {\n hasStreaming = false;\n console.error(e);\n }\n\n if (!hasStreaming) {\n console.log('🎏 Streaming failed, fallback to polling');\n pollNotifications = setInterval(() => {\n checkLatestNotification(masto, instance, true);\n }, POLL_INTERVAL);\n }\n })();\n }, STREAMING_TIMEOUT);\n }\n })();\n }\n return () => {\n sub?.unsubscribe?.();\n sub = null;\n clearTimeout(streamTimeout);\n clearInterval(pollNotifications);\n };\n }, [visible, isLoggedIn]);\n\n // Check for updates service\n const lastCheckDate = useRef();\n const checkForUpdates = () => {\n lastCheckDate.current = Date.now();\n console.log('✨ Check app update');\n fetch('./version.json')\n .then((r) => r.json())\n .then((info) => {\n if (info) states.appVersion = info;\n })\n .catch((e) => {\n console.error(e);\n });\n };\n useInterval(checkForUpdates, visible && 1000 * 60 * 30); // 30 minutes\n usePageVisibility((visible) => {\n if (visible) {\n if (!lastCheckDate.current) {\n checkForUpdates();\n } else {\n const diff = Date.now() - lastCheckDate.current;\n if (diff > 1000 * 60 * 60) {\n // 1 hour\n checkForUpdates();\n }\n }\n }\n });\n\n // Global keyboard shortcuts \"service\"\n useHotkeys('shift+alt+k', () => {\n const currentCloakMode = states.settings.cloakMode;\n states.settings.cloakMode = !currentCloakMode;\n showToast({\n text: currentCloakMode ? t`Cloak mode disabled` : t`Cloak mode enabled`,\n });\n });\n\n return null;\n});\n","import { t, Trans } from '@lingui/macro';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { useSnapshot } from 'valtio';\n\nimport openCompose from '../utils/open-compose';\nimport openOSK from '../utils/open-osk';\nimport states from '../utils/states';\n\nimport Icon from './icon';\n\nexport default function ComposeButton() {\n const snapStates = useSnapshot(states);\n\n function handleButton(e) {\n if (snapStates.composerState.minimized) {\n states.composerState.minimized = false;\n openOSK();\n return;\n }\n\n if (e.shiftKey) {\n const newWin = openCompose();\n\n if (!newWin) {\n states.showCompose = true;\n }\n } else {\n openOSK();\n states.showCompose = true;\n }\n }\n\n useHotkeys('c, shift+c', handleButton, {\n ignoreEventWhen: (e) => {\n const hasModal = !!document.querySelector('#modal-container > *');\n return hasModal;\n },\n });\n\n return (\n <button\n type=\"button\"\n id=\"compose-button\"\n onClick={handleButton}\n class={`${snapStates.composerState.minimized ? 'min' : ''} ${\n snapStates.composerState.publishing ? 'loading' : ''\n } ${snapStates.composerState.publishingError ? 'error' : ''}`}\n >\n <Icon icon=\"quill\" size=\"xl\" alt={t`Compose`} />\n </button>\n );\n}\n","import './keyboard-shortcuts-help.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { memo } from 'preact/compat';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { useSnapshot } from 'valtio';\n\nimport states from '../utils/states';\n\nimport Icon from './icon';\nimport Modal from './modal';\n\nexport default memo(function KeyboardShortcutsHelp() {\n const snapStates = useSnapshot(states);\n\n function onClose() {\n states.showKeyboardShortcutsHelp = false;\n }\n\n useHotkeys(\n '?, shift+?, shift+slash',\n (e) => {\n console.log('help');\n states.showKeyboardShortcutsHelp = true;\n },\n {\n ignoreEventWhen: (e) => {\n const hasModal = !!document.querySelector('#modal-container > *');\n return hasModal;\n },\n },\n );\n\n return (\n !!snapStates.showKeyboardShortcutsHelp && (\n <Modal onClose={onClose}>\n <div id=\"keyboard-shortcuts-help-container\" class=\"sheet\" tabindex=\"-1\">\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <h2>\n <Trans>Keyboard shortcuts</Trans>\n </h2>\n </header>\n <main>\n <table>\n <tbody>\n {[\n {\n action: t`Keyboard shortcuts help`,\n keys: <kbd>?</kbd>,\n },\n {\n action: t`Next post`,\n keys: <kbd>j</kbd>,\n },\n {\n action: t`Previous post`,\n keys: <kbd>k</kbd>,\n },\n {\n action: t`Skip carousel to next post`,\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>j</kbd>\n </Trans>\n ),\n },\n {\n action: t`Skip carousel to previous post`,\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>k</kbd>\n </Trans>\n ),\n },\n {\n action: t`Load new posts`,\n keys: <kbd>.</kbd>,\n },\n {\n action: t`Open post details`,\n keys: (\n <Trans>\n <kbd>Enter</kbd> or <kbd>o</kbd>\n </Trans>\n ),\n },\n {\n action: (\n <Trans>\n Expand content warning or\n <br />\n toggle expanded/collapsed thread\n </Trans>\n ),\n keys: <kbd>x</kbd>,\n },\n {\n action: t`Close post or dialogs`,\n keys: (\n <Trans>\n <kbd>Esc</kbd> or <kbd>Backspace</kbd>\n </Trans>\n ),\n },\n {\n action: t`Focus column in multi-column mode`,\n keys: (\n <Trans>\n <kbd>1</kbd> to <kbd>9</kbd>\n </Trans>\n ),\n },\n {\n action: t`Focus next column in multi-column mode`,\n keys: <kbd>]</kbd>,\n },\n {\n action: t`Focus previous column in multi-column mode`,\n keys: <kbd>[</kbd>,\n },\n {\n action: t`Compose new post`,\n keys: <kbd>c</kbd>,\n },\n {\n action: t`Compose new post (new window)`,\n className: 'insignificant',\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>c</kbd>\n </Trans>\n ),\n },\n {\n action: t`Send post`,\n keys: (\n <Trans>\n <kbd>Ctrl</kbd> + <kbd>Enter</kbd> or <kbd>⌘</kbd> +{' '}\n <kbd>Enter</kbd>\n </Trans>\n ),\n },\n {\n action: t`Search`,\n keys: <kbd>/</kbd>,\n },\n {\n action: t`Reply`,\n keys: <kbd>r</kbd>,\n },\n {\n action: t`Reply (new window)`,\n className: 'insignificant',\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>r</kbd>\n </Trans>\n ),\n },\n {\n action: t`Like (favourite)`,\n keys: (\n <Trans>\n <kbd>l</kbd> or <kbd>f</kbd>\n </Trans>\n ),\n },\n {\n action: t`Boost`,\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>b</kbd>\n </Trans>\n ),\n },\n {\n action: t`Bookmark`,\n keys: <kbd>d</kbd>,\n },\n {\n action: t`Toggle Cloak mode`,\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>Alt</kbd> + <kbd>k</kbd>\n </Trans>\n ),\n },\n ].map(({ action, className, keys }) => (\n <tr key={action}>\n <th class={className}>{action}</th>\n <td>{keys}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </main>\n </div>\n </Modal>\n )\n );\n});\n","/**\n * A set of all the parents currently being observe. This is the only non weak\n * registry.\n */\nconst parents = new Set();\n/**\n * Element coordinates that is constantly kept up to date.\n */\nconst coords = new WeakMap();\n/**\n * Siblings of elements that have been removed from the dom.\n */\nconst siblings = new WeakMap();\n/**\n * Animations that are currently running.\n */\nconst animations = new WeakMap();\n/**\n * A map of existing intersection observers used to track element movements.\n */\nconst intersections = new WeakMap();\n/**\n * Intervals for automatically checking the position of elements occasionally.\n */\nconst intervals = new WeakMap();\n/**\n * The configuration options for each group of elements.\n */\nconst options = new WeakMap();\n/**\n * Debounce counters by id, used to debounce calls to update positions.\n */\nconst debounces = new WeakMap();\n/**\n * All parents that are currently enabled are tracked here.\n */\nconst enabled = new WeakSet();\n/**\n * The document used to calculate transitions.\n */\nlet root;\n/**\n * The root’s XY scroll positions.\n */\nlet scrollX = 0;\nlet scrollY = 0;\n/**\n * Used to sign an element as the target.\n */\nconst TGT = \"__aa_tgt\";\n/**\n * Used to sign an element as being part of a removal.\n */\nconst DEL = \"__aa_del\";\n/**\n * Used to sign an element as being \"new\". When an element is removed from the\n * dom, but may cycle back in we can sign it with new to ensure the next time\n * it is recognized we consider it new.\n */\nconst NEW = \"__aa_new\";\n/**\n * Callback for handling all mutations.\n * @param mutations - A mutation list\n */\nconst handleMutations = (mutations) => {\n const elements = getElements(mutations);\n // If elements is \"false\" that means this mutation that should be ignored.\n if (elements) {\n elements.forEach((el) => animate(el));\n }\n};\n/**\n *\n * @param entries - Elements that have been resized.\n */\nconst handleResizes = (entries) => {\n entries.forEach((entry) => {\n if (entry.target === root)\n updateAllPos();\n if (coords.has(entry.target))\n updatePos(entry.target);\n });\n};\n/**\n * Observe this elements position.\n * @param el - The element to observe the position of.\n */\nfunction observePosition(el) {\n const oldObserver = intersections.get(el);\n oldObserver === null || oldObserver === void 0 ? void 0 : oldObserver.disconnect();\n let rect = coords.get(el);\n let invocations = 0;\n const buffer = 5;\n if (!rect) {\n rect = getCoords(el);\n coords.set(el, rect);\n }\n const { offsetWidth, offsetHeight } = root;\n const rootMargins = [\n rect.top - buffer,\n offsetWidth - (rect.left + buffer + rect.width),\n offsetHeight - (rect.top + buffer + rect.height),\n rect.left - buffer,\n ];\n const rootMargin = rootMargins\n .map((px) => `${-1 * Math.floor(px)}px`)\n .join(\" \");\n const observer = new IntersectionObserver(() => {\n ++invocations > 1 && updatePos(el);\n }, {\n root,\n threshold: 1,\n rootMargin,\n });\n observer.observe(el);\n intersections.set(el, observer);\n}\n/**\n * Update the exact position of a given element.\n * @param el - An element to update the position of.\n */\nfunction updatePos(el) {\n clearTimeout(debounces.get(el));\n const optionsOrPlugin = getOptions(el);\n const delay = isPlugin(optionsOrPlugin) ? 500 : optionsOrPlugin.duration;\n debounces.set(el, setTimeout(async () => {\n const currentAnimation = animations.get(el);\n try {\n await (currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.finished);\n coords.set(el, getCoords(el));\n observePosition(el);\n }\n catch {\n // ignore errors as the `.finished` promise is rejected when animations were cancelled\n }\n }, delay));\n}\n/**\n * Updates all positions that are currently being tracked.\n */\nfunction updateAllPos() {\n clearTimeout(debounces.get(root));\n debounces.set(root, setTimeout(() => {\n parents.forEach((parent) => forEach(parent, (el) => lowPriority(() => updatePos(el))));\n }, 100));\n}\n/**\n * Its possible for a quick scroll or other fast events to get past the\n * intersection observer, so occasionally we need want \"cold-poll\" for the\n * latests and greatest position. We try to do this in the most non-disruptive\n * fashion possible. First we only do this ever couple seconds, staggard by a\n * random offset.\n * @param el - Element\n */\nfunction poll(el) {\n setTimeout(() => {\n intervals.set(el, setInterval(() => lowPriority(updatePos.bind(null, el)), 2000));\n }, Math.round(2000 * Math.random()));\n}\n/**\n * Perform some operation that is non critical at some point.\n * @param callback\n */\nfunction lowPriority(callback) {\n if (typeof requestIdleCallback === \"function\") {\n requestIdleCallback(() => callback());\n }\n else {\n requestAnimationFrame(() => callback());\n }\n}\n/**\n * The mutation observer responsible for watching each root element.\n */\nlet mutations;\n/**\n * A resize observer, responsible for recalculating elements on resize.\n */\nlet resize;\n/**\n * Ensure the browser is supported.\n */\nconst supportedBrowser = typeof window !== \"undefined\" && \"ResizeObserver\" in window;\n/**\n * If this is in a browser, initialize our Web APIs\n */\nif (supportedBrowser) {\n root = document.documentElement;\n mutations = new MutationObserver(handleMutations);\n resize = new ResizeObserver(handleResizes);\n window.addEventListener(\"scroll\", () => {\n scrollY = window.scrollY;\n scrollX = window.scrollX;\n });\n resize.observe(root);\n}\n/**\n * Retrieves all the elements that may have been affected by the last mutation\n * including ones that have been removed and are no longer in the DOM.\n * @param mutations - A mutation list.\n * @returns\n */\nfunction getElements(mutations) {\n const observedNodes = mutations.reduce((nodes, mutation) => {\n return [\n ...nodes,\n ...Array.from(mutation.addedNodes),\n ...Array.from(mutation.removedNodes),\n ];\n }, []);\n // Short circuit if _only_ comment nodes are observed\n const onlyCommentNodesObserved = observedNodes.every((node) => node.nodeName === \"#comment\");\n if (onlyCommentNodesObserved)\n return false;\n return mutations.reduce((elements, mutation) => {\n // Short circuit if we find a purposefully deleted node.\n if (elements === false)\n return false;\n if (mutation.target instanceof Element) {\n target(mutation.target);\n if (!elements.has(mutation.target)) {\n elements.add(mutation.target);\n for (let i = 0; i < mutation.target.children.length; i++) {\n const child = mutation.target.children.item(i);\n if (!child)\n continue;\n if (DEL in child) {\n return false;\n }\n target(mutation.target, child);\n elements.add(child);\n }\n }\n if (mutation.removedNodes.length) {\n for (let i = 0; i < mutation.removedNodes.length; i++) {\n const child = mutation.removedNodes[i];\n if (DEL in child) {\n return false;\n }\n if (child instanceof Element) {\n elements.add(child);\n target(mutation.target, child);\n siblings.set(child, [\n mutation.previousSibling,\n mutation.nextSibling,\n ]);\n }\n }\n }\n }\n return elements;\n }, new Set());\n}\n/**\n * Assign the target to an element.\n * @param el - The root element\n * @param child\n */\nfunction target(el, child) {\n if (!child && !(TGT in el))\n Object.defineProperty(el, TGT, { value: el });\n else if (child && !(TGT in child))\n Object.defineProperty(child, TGT, { value: el });\n}\n/**\n * Determines what kind of change took place on the given element and then\n * performs the proper animation based on that.\n * @param el - The specific element to animate.\n */\nfunction animate(el) {\n var _a;\n const isMounted = el.isConnected;\n const preExisting = coords.has(el);\n if (isMounted && siblings.has(el))\n siblings.delete(el);\n if (animations.has(el)) {\n (_a = animations.get(el)) === null || _a === void 0 ? void 0 : _a.cancel();\n }\n if (NEW in el) {\n add(el);\n }\n else if (preExisting && isMounted) {\n remain(el);\n }\n else if (preExisting && !isMounted) {\n remove(el);\n }\n else {\n add(el);\n }\n}\n/**\n * Removes all non-digits from a string and casts to a number.\n * @param str - A string containing a pixel value.\n * @returns\n */\nfunction raw(str) {\n return Number(str.replace(/[^0-9.\\-]/g, \"\"));\n}\n/**\n * Get the scroll offset of elements\n * @param el - Element\n * @returns\n */\nfunction getScrollOffset(el) {\n let p = el.parentElement;\n while (p) {\n if (p.scrollLeft || p.scrollTop) {\n return { x: p.scrollLeft, y: p.scrollTop };\n }\n p = p.parentElement;\n }\n return { x: 0, y: 0 };\n}\n/**\n * Get the coordinates of elements adjusted for scroll position.\n * @param el - Element\n * @returns\n */\nfunction getCoords(el) {\n const rect = el.getBoundingClientRect();\n const { x, y } = getScrollOffset(el);\n return {\n top: rect.top + y,\n left: rect.left + x,\n width: rect.width,\n height: rect.height,\n };\n}\n/**\n * Returns the width/height that the element should be transitioned between.\n * This takes into account box-sizing.\n * @param el - Element being animated\n * @param oldCoords - Old set of Coordinates coordinates\n * @param newCoords - New set of Coordinates coordinates\n * @returns\n */\nfunction getTransitionSizes(el, oldCoords, newCoords) {\n let widthFrom = oldCoords.width;\n let heightFrom = oldCoords.height;\n let widthTo = newCoords.width;\n let heightTo = newCoords.height;\n const styles = getComputedStyle(el);\n const sizing = styles.getPropertyValue(\"box-sizing\");\n if (sizing === \"content-box\") {\n const paddingY = raw(styles.paddingTop) +\n raw(styles.paddingBottom) +\n raw(styles.borderTopWidth) +\n raw(styles.borderBottomWidth);\n const paddingX = raw(styles.paddingLeft) +\n raw(styles.paddingRight) +\n raw(styles.borderRightWidth) +\n raw(styles.borderLeftWidth);\n widthFrom -= paddingX;\n widthTo -= paddingX;\n heightFrom -= paddingY;\n heightTo -= paddingY;\n }\n return [widthFrom, widthTo, heightFrom, heightTo].map(Math.round);\n}\n/**\n * Retrieves animation options for the current element.\n * @param el - Element to retrieve options for.\n * @returns\n */\nfunction getOptions(el) {\n return TGT in el && options.has(el[TGT])\n ? options.get(el[TGT])\n : { duration: 250, easing: \"ease-in-out\" };\n}\n/**\n * Returns the target of a given animation (generally the parent).\n * @param el - An element to check for a target\n * @returns\n */\nfunction getTarget(el) {\n if (TGT in el)\n return el[TGT];\n return undefined;\n}\n/**\n * Checks if animations are enabled or disabled for a given element.\n * @param el - Any element\n * @returns\n */\nfunction isEnabled(el) {\n const target = getTarget(el);\n return target ? enabled.has(target) : false;\n}\n/**\n * Iterate over the children of a given parent.\n * @param parent - A parent element\n * @param callback - A callback\n */\nfunction forEach(parent, ...callbacks) {\n callbacks.forEach((callback) => callback(parent, options.has(parent)));\n for (let i = 0; i < parent.children.length; i++) {\n const child = parent.children.item(i);\n if (child) {\n callbacks.forEach((callback) => callback(child, options.has(child)));\n }\n }\n}\n/**\n * Always return tuple to provide consistent interface\n */\nfunction getPluginTuple(pluginReturn) {\n if (Array.isArray(pluginReturn))\n return pluginReturn;\n return [pluginReturn];\n}\n/**\n * Determine if config is plugin\n */\nfunction isPlugin(config) {\n return typeof config === \"function\";\n}\n/**\n * The element in question is remaining in the DOM.\n * @param el - Element to flip\n * @returns\n */\nfunction remain(el) {\n const oldCoords = coords.get(el);\n const newCoords = getCoords(el);\n if (!isEnabled(el))\n return coords.set(el, newCoords);\n let animation;\n if (!oldCoords)\n return;\n const pluginOrOptions = getOptions(el);\n if (typeof pluginOrOptions !== \"function\") {\n const deltaX = oldCoords.left - newCoords.left;\n const deltaY = oldCoords.top - newCoords.top;\n const [widthFrom, widthTo, heightFrom, heightTo] = getTransitionSizes(el, oldCoords, newCoords);\n const start = {\n transform: `translate(${deltaX}px, ${deltaY}px)`,\n };\n const end = {\n transform: `translate(0, 0)`,\n };\n if (widthFrom !== widthTo) {\n start.width = `${widthFrom}px`;\n end.width = `${widthTo}px`;\n }\n if (heightFrom !== heightTo) {\n start.height = `${heightFrom}px`;\n end.height = `${heightTo}px`;\n }\n animation = el.animate([start, end], {\n duration: pluginOrOptions.duration,\n easing: pluginOrOptions.easing,\n });\n }\n else {\n const [keyframes] = getPluginTuple(pluginOrOptions(el, \"remain\", oldCoords, newCoords));\n animation = new Animation(keyframes);\n animation.play();\n }\n animations.set(el, animation);\n coords.set(el, newCoords);\n animation.addEventListener(\"finish\", updatePos.bind(null, el));\n}\n/**\n * Adds the element with a transition.\n * @param el - Animates the element being added.\n */\nfunction add(el) {\n if (NEW in el)\n delete el[NEW];\n const newCoords = getCoords(el);\n coords.set(el, newCoords);\n const pluginOrOptions = getOptions(el);\n if (!isEnabled(el))\n return;\n let animation;\n if (typeof pluginOrOptions !== \"function\") {\n animation = el.animate([\n { transform: \"scale(.98)\", opacity: 0 },\n { transform: \"scale(0.98)\", opacity: 0, offset: 0.5 },\n { transform: \"scale(1)\", opacity: 1 },\n ], {\n duration: pluginOrOptions.duration * 1.5,\n easing: \"ease-in\",\n });\n }\n else {\n const [keyframes] = getPluginTuple(pluginOrOptions(el, \"add\", newCoords));\n animation = new Animation(keyframes);\n animation.play();\n }\n animations.set(el, animation);\n animation.addEventListener(\"finish\", updatePos.bind(null, el));\n}\n/**\n * Clean up after removing an element from the dom.\n * @param el - Element being removed\n * @param styles - Optional styles that should be removed from the element.\n */\nfunction cleanUp(el, styles) {\n var _a;\n el.remove();\n coords.delete(el);\n siblings.delete(el);\n animations.delete(el);\n (_a = intersections.get(el)) === null || _a === void 0 ? void 0 : _a.disconnect();\n setTimeout(() => {\n if (DEL in el)\n delete el[DEL];\n Object.defineProperty(el, NEW, { value: true, configurable: true });\n if (styles && el instanceof HTMLElement) {\n for (const style in styles) {\n el.style[style] = \"\";\n }\n }\n }, 0);\n}\n/**\n * Animates the removal of an element.\n * @param el - Element to remove\n */\nfunction remove(el) {\n var _a;\n if (!siblings.has(el) || !coords.has(el))\n return;\n const [prev, next] = siblings.get(el);\n Object.defineProperty(el, DEL, { value: true, configurable: true });\n const finalX = window.scrollX;\n const finalY = window.scrollY;\n if (next && next.parentNode && next.parentNode instanceof Element) {\n next.parentNode.insertBefore(el, next);\n }\n else if (prev && prev.parentNode) {\n prev.parentNode.appendChild(el);\n }\n else {\n (_a = getTarget(el)) === null || _a === void 0 ? void 0 : _a.appendChild(el);\n }\n if (!isEnabled(el))\n return cleanUp(el);\n const [top, left, width, height] = deletePosition(el);\n const optionsOrPlugin = getOptions(el);\n const oldCoords = coords.get(el);\n if (finalX !== scrollX || finalY !== scrollY) {\n adjustScroll(el, finalX, finalY, optionsOrPlugin);\n }\n let animation;\n let styleReset = {\n position: \"absolute\",\n top: `${top}px`,\n left: `${left}px`,\n width: `${width}px`,\n height: `${height}px`,\n margin: \"0\",\n pointerEvents: \"none\",\n transformOrigin: \"center\",\n zIndex: \"100\",\n };\n if (!isPlugin(optionsOrPlugin)) {\n Object.assign(el.style, styleReset);\n animation = el.animate([\n {\n transform: \"scale(1)\",\n opacity: 1,\n },\n {\n transform: \"scale(.98)\",\n opacity: 0,\n },\n ], { duration: optionsOrPlugin.duration, easing: \"ease-out\" });\n }\n else {\n const [keyframes, options] = getPluginTuple(optionsOrPlugin(el, \"remove\", oldCoords));\n if ((options === null || options === void 0 ? void 0 : options.styleReset) !== false) {\n styleReset = (options === null || options === void 0 ? void 0 : options.styleReset) || styleReset;\n Object.assign(el.style, styleReset);\n }\n animation = new Animation(keyframes);\n animation.play();\n }\n animations.set(el, animation);\n animation.addEventListener(\"finish\", cleanUp.bind(null, el, styleReset));\n}\n/**\n * If the element being removed is at the very bottom of the page, and the\n * the page was scrolled into a space being \"made available\" by the element\n * that was removed, the page scroll will have jumped up some amount. We need\n * to offset the jump by the amount that the page was \"automatically\" scrolled\n * up. We can do this by comparing the scroll position before and after the\n * element was removed, and then offsetting by that amount.\n *\n * @param el - The element being deleted\n * @param finalX - The final X scroll position\n * @param finalY - The final Y scroll position\n * @param optionsOrPlugin - The options or plugin\n * @returns\n */\nfunction adjustScroll(el, finalX, finalY, optionsOrPlugin) {\n const scrollDeltaX = scrollX - finalX;\n const scrollDeltaY = scrollY - finalY;\n const scrollBefore = document.documentElement.style.scrollBehavior;\n const scrollBehavior = getComputedStyle(root).scrollBehavior;\n if (scrollBehavior === \"smooth\") {\n document.documentElement.style.scrollBehavior = \"auto\";\n }\n window.scrollTo(window.scrollX + scrollDeltaX, window.scrollY + scrollDeltaY);\n if (!el.parentElement)\n return;\n const parent = el.parentElement;\n let lastHeight = parent.clientHeight;\n let lastWidth = parent.clientWidth;\n const startScroll = performance.now();\n // Here we use a manual scroll animation to keep the element using the same\n // easing and timing as the parent’s scroll animation.\n function smoothScroll() {\n requestAnimationFrame(() => {\n if (!isPlugin(optionsOrPlugin)) {\n const deltaY = lastHeight - parent.clientHeight;\n const deltaX = lastWidth - parent.clientWidth;\n if (startScroll + optionsOrPlugin.duration > performance.now()) {\n window.scrollTo({\n left: window.scrollX - deltaX,\n top: window.scrollY - deltaY,\n });\n lastHeight = parent.clientHeight;\n lastWidth = parent.clientWidth;\n smoothScroll();\n }\n else {\n document.documentElement.style.scrollBehavior = scrollBefore;\n }\n }\n });\n }\n smoothScroll();\n}\n/**\n * Determines the position of the element being removed.\n * @param el - The element being deleted\n * @returns\n */\nfunction deletePosition(el) {\n const oldCoords = coords.get(el);\n const [width, , height] = getTransitionSizes(el, oldCoords, getCoords(el));\n let offsetParent = el.parentElement;\n while (offsetParent &&\n (getComputedStyle(offsetParent).position === \"static\" ||\n offsetParent instanceof HTMLBodyElement)) {\n offsetParent = offsetParent.parentElement;\n }\n if (!offsetParent)\n offsetParent = document.body;\n const parentStyles = getComputedStyle(offsetParent);\n const parentCoords = coords.get(offsetParent) || getCoords(offsetParent);\n const top = Math.round(oldCoords.top - parentCoords.top) -\n raw(parentStyles.borderTopWidth);\n const left = Math.round(oldCoords.left - parentCoords.left) -\n raw(parentStyles.borderLeftWidth);\n return [top, left, width, height];\n}\n/**\n * A function that automatically adds animation effects to itself and its\n * immediate children. Specifically it adds effects for adding, moving, and\n * removing DOM elements.\n * @param el - A parent element to add animations to.\n * @param options - An optional object of options.\n */\nfunction autoAnimate(el, config = {}) {\n if (mutations && resize) {\n const mediaQuery = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n const isDisabledDueToReduceMotion = mediaQuery.matches &&\n !isPlugin(config) &&\n !config.disrespectUserMotionPreference;\n if (!isDisabledDueToReduceMotion) {\n enabled.add(el);\n if (getComputedStyle(el).position === \"static\") {\n Object.assign(el.style, { position: \"relative\" });\n }\n forEach(el, updatePos, poll, (element) => resize === null || resize === void 0 ? void 0 : resize.observe(element));\n if (isPlugin(config)) {\n options.set(el, config);\n }\n else {\n options.set(el, { duration: 250, easing: \"ease-in-out\", ...config });\n }\n mutations.observe(el, { childList: true });\n parents.add(el);\n }\n }\n return Object.freeze({\n parent: el,\n enable: () => {\n enabled.add(el);\n },\n disable: () => {\n enabled.delete(el);\n },\n isEnabled: () => enabled.has(el),\n });\n}\n/**\n * The vue directive.\n */\nconst vAutoAnimate = {\n mounted: (el, binding) => {\n autoAnimate(el, binding.value || {});\n },\n // ignore ssr see #96:\n getSSRProps: () => ({}),\n};\n\nexport { autoAnimate as default, getTransitionSizes, vAutoAnimate };\n","import { useRef, useState, useEffect } from 'preact/hooks';\nimport autoAnimate from '../index.mjs';\n\n/**\n * AutoAnimate hook for adding dead-simple transitions and animations to preact.\n * @param options - Auto animate options or a plugin\n * @returns\n */\nfunction useAutoAnimate(options) {\n const element = useRef(null);\n const [controller, setController] = useState();\n const setEnabled = (enabled) => {\n if (controller) {\n enabled ? controller.enable() : controller.disable();\n }\n };\n useEffect(() => {\n if (element.current instanceof HTMLElement)\n setController(autoAnimate(element.current, options || {}));\n }, []);\n return [element, setEnabled];\n}\n\nexport { useAutoAnimate };\n","import './accounts.css';\n\nimport { useAutoAnimate } from '@formkit/auto-animate/preact';\nimport { t, Trans } from '@lingui/macro';\nimport { Menu, MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport { useReducer } from 'preact/hooks';\n\nimport Avatar from '../components/avatar';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport MenuConfirm from '../components/menu-confirm';\nimport MenuLink from '../components/menu-link';\nimport Menu2 from '../components/menu2';\nimport NameText from '../components/name-text';\nimport { api } from '../utils/api';\nimport states from '../utils/states';\nimport store from '../utils/store';\nimport { getCurrentAccountID, setCurrentAccountID } from '../utils/store-utils';\n\nconst isStandalone = window.matchMedia('(display-mode: standalone)').matches;\n\nfunction Accounts({ onClose }) {\n const { masto } = api();\n // Accounts\n const accounts = store.local.getJSON('accounts');\n const currentAccount = getCurrentAccountID();\n const moreThanOneAccount = accounts.length > 1;\n\n const [_, reload] = useReducer((x) => x + 1, 0);\n const [accountsListParent] = useAutoAnimate();\n\n return (\n <div id=\"accounts-container\" class=\"sheet\" tabIndex=\"-1\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header class=\"header-grid\">\n <h2>\n <Trans>Accounts</Trans>\n </h2>\n </header>\n <main>\n <section>\n <ul class=\"accounts-list\" ref={accountsListParent}>\n {accounts.map((account, i) => {\n const isCurrent = account.info.id === currentAccount;\n const isDefault = i === 0; // first account is always default\n return (\n <li key={account.info.id}>\n <div>\n {moreThanOneAccount && (\n <span class={`current ${isCurrent ? 'is-current' : ''}`}>\n <Icon icon=\"check-circle\" alt={t`Current`} />\n </span>\n )}\n <Avatar\n url={account.info.avatarStatic}\n size=\"xxl\"\n onDblClick={async () => {\n if (isCurrent) {\n try {\n const info = await masto.v1.accounts\n .$select(account.info.id)\n .fetch();\n console.log('fetched account info', info);\n account.info = info;\n store.local.setJSON('accounts', accounts);\n reload();\n } catch (e) {}\n }\n }}\n />\n <NameText\n account={\n moreThanOneAccount\n ? {\n ...account.info,\n acct: /@/.test(account.info.acct)\n ? account.info.acct\n : `${account.info.acct}@${account.instanceURL}`,\n }\n : account.info\n }\n showAcct\n onClick={() => {\n if (isCurrent) {\n states.showAccount = `${account.info.username}@${account.instanceURL}`;\n } else {\n setCurrentAccountID(account.info.id);\n location.reload();\n }\n }}\n />\n </div>\n <div class=\"actions\">\n {isDefault && moreThanOneAccount && (\n <>\n <span class=\"tag\">\n <Trans>Default</Trans>\n </span>{' '}\n </>\n )}\n <Menu2\n align=\"end\"\n menuButton={\n <button type=\"button\" class=\"plain more-button\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n {moreThanOneAccount && (\n <>\n <MenuItem\n disabled={isCurrent}\n onClick={() => {\n setCurrentAccountID(account.info.id);\n location.reload();\n }}\n >\n <Icon icon=\"transfer\" />{' '}\n <Trans>Switch to this account</Trans>\n </MenuItem>\n {!isStandalone && !isCurrent && (\n <MenuLink\n href={`./?account=${account.info.id}`}\n target=\"_blank\"\n >\n <Icon icon=\"external\" />\n <span>\n <Trans>Switch in new tab/window</Trans>\n </span>\n </MenuLink>\n )}\n <MenuDivider />\n </>\n )}\n <MenuItem\n onClick={() => {\n states.showAccount = `${account.info.username}@${account.instanceURL}`;\n }}\n >\n <Icon icon=\"user\" />\n <span>\n <Trans>View profile…</Trans>\n </span>\n </MenuItem>\n <MenuDivider />\n {moreThanOneAccount && (\n <MenuItem\n disabled={isDefault}\n onClick={() => {\n // Move account to the top of the list\n accounts.splice(i, 1);\n accounts.unshift(account);\n store.local.setJSON('accounts', accounts);\n reload();\n }}\n >\n <Icon icon=\"check-circle\" />\n <span>\n <Trans>Set as default</Trans>\n </span>\n </MenuItem>\n )}\n <MenuConfirm\n subMenu\n confirmLabel={\n <>\n <Icon icon=\"exit\" />\n <span>\n <Trans>\n Log out{' '}\n <span class=\"bidi-isolate\">\n @{account.info.acct}\n </span>\n ?\n </Trans>\n </span>\n </>\n }\n disabled={!isCurrent}\n menuItemClassName=\"danger\"\n onClick={() => {\n // const yes = confirm('Log out?');\n // if (!yes) return;\n accounts.splice(i, 1);\n store.local.setJSON('accounts', accounts);\n // location.reload();\n location.href = location.pathname || '/';\n }}\n >\n <Icon icon=\"exit\" />\n <span>\n <Trans>Log out…</Trans>\n </span>\n </MenuConfirm>\n </Menu2>\n </div>\n </li>\n );\n })}\n </ul>\n <p>\n <Link to=\"/login\" class=\"button plain2\" onClick={onClose}>\n <Icon icon=\"plus\" />{' '}\n <span>\n <Trans>Add an existing account</Trans>\n </span>\n </Link>\n </p>\n {moreThanOneAccount && (\n <p>\n <small>\n <Trans>\n Note: <i>Default</i> account will always be used for first\n load. Switched accounts will persist during the session.\n </Trans>\n </small>\n </p>\n )}\n </section>\n </main>\n </div>\n );\n}\n\nexport default Accounts;\n","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%2064%2064'%3e%3cpath%20fill='none'%20d='M0%200h63.994v63.994H0z'/%3e%3cpath%20fill='%23a4bff7'%20d='M37.774%2011.471c14.639%203.752%2019.034%2016.557%2015.889%2031.304-.696%203.261-2.563%206.661-6.356%208.693-3.204%201.717-8.07%202.537-15.338.55l-9.634-2.404C11.651%2046.992%208.378%2038.733%2010.027%2031.823c3.627-15.201%2015.543-23.48%2027.747-20.352Z'/%3e%3cpath%20fill='%23d8e7fe'%20d='M36.76%2015.429c12.289%203.15%2015.547%2014.114%2012.907%2026.493-.947%204.44-4.937%209.365-16.664%206.143l-9.684-2.417c-7.854-1.923-10.53-7.8-9.318-12.877%203.016-12.639%2012.611-19.943%2022.759-17.342Z'/%3e%3cpath%20fill='%236081e6'%20d='M27.471%2024.991c-1.457-.698-7.229%203.213-7.663%208.926-.182%202.39%204.55%203.237%205.071-.169.725-4.743%203.715-8.218%202.592-8.757Zm10.746%202.005c-2.083.327-.382%205.901-.595%2010.727-.123%202.8%204.388%203.464%204.703%202.011%201.098-5.073-2.066-13.058-4.108-12.738Z'/%3e%3c/svg%3e\"","import { useLingui } from '@lingui/react';\nimport { useMemo } from 'preact/hooks';\n\nimport { CATALOGS, DEFAULT_LANG, DEV_LOCALES, LOCALES } from '../locales';\nimport { activateLang } from '../utils/lang';\nimport localeCode2Text from '../utils/localeCode2Text';\nimport store from '../utils/store';\n\nconst regionMaps = {\n 'zh-CN': 'zh-Hans',\n 'zh-TW': 'zh-Hant',\n 'pt-BR': 'pt-BR',\n};\n\nexport default function LangSelector() {\n const { i18n } = useLingui();\n\n // Sorted on render, so the order won't suddenly change based on current locale\n const populatedLocales = useMemo(() => {\n return LOCALES.map((lang) => {\n // Don't need regions for now, it makes text too noisy\n // Wait till there's too many languages and there are regional clashes\n const regionlessCode = regionMaps[lang] || lang.replace(/-[a-z]+$/i, '');\n\n const native = localeCode2Text({\n code: regionlessCode,\n locale: lang,\n fallback: CATALOGS.find((c) => c.code === lang)?.nativeName,\n });\n\n // Not used when rendering because it'll change based on current locale\n // Only used for sorting on render\n const _common = localeCode2Text({\n code: regionlessCode,\n locale: i18n.locale,\n fallback: CATALOGS.find((c) => c.code === lang)?.name,\n });\n\n return {\n code: lang,\n regionlessCode,\n _common,\n native,\n };\n }).sort((a, b) => {\n // Sort by common name\n const order = a._common.localeCompare(b._common, i18n.locale);\n if (order !== 0) return order;\n // Sort by code (fallback)\n if (a.code < b.code) return -1;\n if (a.code > b.code) return 1;\n return 0;\n });\n }, []);\n\n return (\n <label class=\"lang-selector\">\n 🌐{' '}\n <select\n class=\"small\"\n value={i18n.locale || DEFAULT_LANG}\n onChange={(e) => {\n store.local.set('lang', e.target.value);\n activateLang(e.target.value);\n }}\n >\n {populatedLocales.map(({ code, regionlessCode, native }) => {\n // Common name changes based on current locale\n const common = localeCode2Text({\n code: regionlessCode,\n locale: i18n.locale,\n fallback: CATALOGS.find((c) => c.code === code)?.name,\n });\n const showCommon = !!common && common !== native;\n return (\n <option\n value={code}\n data-regionless-code={regionlessCode}\n key={code}\n >\n {showCommon ? `${native} - ${common}` : native}\n </option>\n );\n })}\n {(import.meta.env.DEV || import.meta.env.PHANPY_SHOW_DEV_LOCALES) && (\n <optgroup label=\"🚧 Development (<50% translated)\">\n {DEV_LOCALES.map((code) => {\n if (code === 'pseudo-LOCALE') {\n return (\n <>\n <hr />\n <option value={code} key={code}>\n Pseudolocalization (test)\n </option>\n </>\n );\n }\n const nativeName = CATALOGS.find(\n (c) => c.code === code,\n )?.nativeName;\n const completion = CATALOGS.find(\n (c) => c.code === code,\n )?.completion;\n return (\n <option value={code} key={code}>\n {nativeName || code} ‎[{completion}%]\n </option>\n );\n })}\n </optgroup>\n )}\n </select>\n </label>\n );\n}\n","// Utils for push notifications\nimport { api } from './api';\nimport { getVapidKey } from './store-utils';\n\n// Subscription is an object with the following structure:\n// {\n// data: {\n// alerts: {\n// admin: {\n// report: boolean,\n// signUp: boolean,\n// },\n// favourite: boolean,\n// follow: boolean,\n// mention: boolean,\n// poll: boolean,\n// reblog: boolean,\n// status: boolean,\n// update: boolean,\n// }\n// },\n// policy: \"all\" | \"followed\" | \"follower\" | \"none\",\n// subscription: {\n// endpoint: string,\n// keys: {\n// auth: string,\n// p256dh: string,\n// },\n// },\n// }\n\n// Back-end CRUD\n// =============\n\nfunction createBackendPushSubscription(subscription) {\n const { masto } = api();\n return masto.v1.push.subscription.create(subscription);\n}\n\nfunction fetchBackendPushSubscription() {\n const { masto } = api();\n return masto.v1.push.subscription.fetch();\n}\n\nfunction updateBackendPushSubscription(subscription) {\n const { masto } = api();\n return masto.v1.push.subscription.update(subscription);\n}\n\nfunction removeBackendPushSubscription() {\n const { masto } = api();\n return masto.v1.push.subscription.remove();\n}\n\n// Front-end\n// =========\n\nexport function isPushSupported() {\n return 'serviceWorker' in navigator && 'PushManager' in window;\n}\n\nexport function getRegistration() {\n // return navigator.serviceWorker.ready;\n return navigator.serviceWorker.getRegistration();\n}\n\nasync function getSubscription() {\n const registration = await getRegistration();\n const subscription = registration\n ? await registration.pushManager.getSubscription()\n : undefined;\n return { registration, subscription };\n}\n\nfunction urlBase64ToUint8Array(base64String) {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = `${base64String}${padding}`\n .replace(/-/g, '+')\n .replace(/_/g, '/');\n\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n\n return outputArray;\n}\n\n// Front-end <-> back-end\n// ======================\n\nexport async function initSubscription() {\n if (!isPushSupported()) return;\n const { subscription } = await getSubscription();\n let backendSubscription = null;\n try {\n backendSubscription = await fetchBackendPushSubscription();\n } catch (err) {\n if (/(not found|unknown)/i.test(err.message)) {\n // No subscription found\n } else {\n // Other error\n throw err;\n }\n }\n console.log('INIT subscription', {\n subscription,\n backendSubscription,\n });\n\n // Check if the subscription changed\n if (backendSubscription && subscription) {\n const sameEndpoint = backendSubscription.endpoint === subscription.endpoint;\n const vapidKey = getVapidKey();\n const sameKey = backendSubscription.serverKey === vapidKey;\n if (!sameEndpoint) {\n throw new Error('Backend subscription endpoint changed');\n }\n if (sameKey) {\n // Subscription didn't change\n } else {\n // Subscription changed\n console.error('🔔 Subscription changed', {\n sameEndpoint,\n serverKey: backendSubscription.serverKey,\n vapIdKey: vapidKey,\n endpoint1: backendSubscription.endpoint,\n endpoint2: subscription.endpoint,\n sameKey,\n key1: backendSubscription.serverKey,\n key2: vapidKey,\n });\n throw new Error('Backend subscription key and vapid key changed');\n // Only unsubscribe from backend, not from browser\n // await removeBackendPushSubscription();\n // // Now let's resubscribe\n // // NOTE: I have no idea if this works\n // return await updateSubscription({\n // data: backendSubscription.data,\n // policy: backendSubscription.policy,\n // });\n }\n }\n\n if (subscription && !backendSubscription) {\n // check if account's vapidKey is same as subscription's applicationServerKey\n const vapidKey = getVapidKey();\n if (vapidKey) {\n const { applicationServerKey } = subscription.options;\n const vapidKeyStr = urlBase64ToUint8Array(vapidKey).toString();\n const applicationServerKeyStr = new Uint8Array(\n applicationServerKey,\n ).toString();\n const sameKey = vapidKeyStr === applicationServerKeyStr;\n if (sameKey) {\n // Subscription didn't change\n } else {\n // Subscription changed\n console.error('🔔 Subscription changed', {\n vapidKeyStr,\n applicationServerKeyStr,\n sameKey,\n });\n // Unsubscribe since backend doesn't have a subscription\n await subscription.unsubscribe();\n throw new Error('Subscription key and vapid key changed');\n }\n } else {\n console.warn('No vapidKey found');\n }\n }\n\n // Check if backend subscription returns 404\n // if (subscription && !backendSubscription) {\n // // Re-subscribe to backend\n // backendSubscription = await createBackendPushSubscription({\n // subscription,\n // data: {},\n // policy: 'all',\n // });\n // }\n\n return { subscription, backendSubscription };\n}\n\nexport async function updateSubscription({ data, policy }) {\n console.log('🔔 Updating subscription', { data, policy });\n if (!isPushSupported()) return;\n let { registration, subscription } = await getSubscription();\n let backendSubscription = null;\n\n if (subscription) {\n try {\n backendSubscription = await updateBackendPushSubscription({\n data,\n policy,\n });\n // TODO: save subscription in user settings\n } catch (error) {\n // Backend doesn't have a subscription for this user\n // Create a new one\n backendSubscription = await createBackendPushSubscription({\n subscription,\n data,\n policy,\n });\n // TODO: save subscription in user settings\n }\n } else {\n // User is not subscribed\n const vapidKey = getVapidKey();\n if (!vapidKey) throw new Error('No server key found');\n subscription = await registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(vapidKey),\n });\n backendSubscription = await createBackendPushSubscription({\n subscription,\n data,\n policy,\n });\n // TODO: save subscription in user settings\n }\n\n return { subscription, backendSubscription };\n}\n\nexport async function removeSubscription() {\n if (!isPushSupported()) return;\n const { subscription } = await getSubscription();\n if (subscription) {\n await removeBackendPushSubscription();\n await subscription.unsubscribe();\n }\n}\n","import './settings.css';\n\nimport { Plural, t, Trans } from '@lingui/macro';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport logo from '../assets/logo.svg';\n\nimport Icon from '../components/icon';\nimport LangSelector from '../components/lang-selector';\nimport Link from '../components/link';\nimport RelativeTime from '../components/relative-time';\nimport targetLanguages from '../data/lingva-target-languages';\nimport { api } from '../utils/api';\nimport getTranslateTargetLanguage from '../utils/get-translate-target-language';\nimport localeCode2Text from '../utils/localeCode2Text';\nimport prettyBytes from '../utils/pretty-bytes';\nimport {\n initSubscription,\n isPushSupported,\n removeSubscription,\n updateSubscription,\n} from '../utils/push-notifications';\nimport showToast from '../utils/show-toast';\nimport states from '../utils/states';\nimport store from '../utils/store';\nimport supports from '../utils/supports';\n\nconst DEFAULT_TEXT_SIZE = 16;\nconst TEXT_SIZES = [14, 15, 16, 17, 18, 19, 20];\nconst {\n PHANPY_WEBSITE: WEBSITE,\n PHANPY_PRIVACY_POLICY_URL: PRIVACY_POLICY_URL,\n PHANPY_IMG_ALT_API_URL: IMG_ALT_API_URL,\n PHANPY_GIPHY_API_KEY: GIPHY_API_KEY,\n} = import.meta.env;\n\nfunction Settings({ onClose }) {\n const snapStates = useSnapshot(states);\n const currentTheme = store.local.get('theme') || 'auto';\n const themeFormRef = useRef();\n const targetLanguage =\n snapStates.settings.contentTranslationTargetLanguage || null;\n const systemTargetLanguage = getTranslateTargetLanguage();\n const systemTargetLanguageText = localeCode2Text(systemTargetLanguage);\n const currentTextSize = store.local.get('textSize') || DEFAULT_TEXT_SIZE;\n\n const [prefs, setPrefs] = useState(store.account.get('preferences') || {});\n const { masto, authenticated, instance } = api();\n // Get preferences every time Settings is opened\n // NOTE: Disabled for now because I don't expect this to change often. Also for some reason, the /api/v1/preferences endpoint is cached for a while and return old prefs if refresh immediately after changing them.\n // useEffect(() => {\n // const { masto } = api();\n // (async () => {\n // try {\n // const preferences = await masto.v1.preferences.fetch();\n // setPrefs(preferences);\n // store.account.set('preferences', preferences);\n // } catch (e) {\n // // Silently fail\n // console.error(e);\n // }\n // })();\n // }, []);\n\n return (\n <div\n id=\"settings-container\"\n class=\"sheet\"\n tabIndex=\"-1\"\n style={{\n '--current-text-size': `${currentTextSize}px`,\n }}\n >\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>Settings</Trans>\n </h2>\n </header>\n <main>\n <section>\n <ul>\n <li>\n <div>\n <label>\n <Trans>Appearance</Trans>\n </label>\n </div>\n <div>\n <form\n ref={themeFormRef}\n onInput={(e) => {\n console.log(e);\n e.preventDefault();\n const formData = new FormData(themeFormRef.current);\n const theme = formData.get('theme');\n const html = document.documentElement;\n\n if (theme === 'auto') {\n html.classList.remove('is-light', 'is-dark');\n\n // Disable manual theme <meta>\n const $manualMeta = document.querySelector(\n 'meta[data-theme-setting=\"manual\"]',\n );\n if ($manualMeta) {\n $manualMeta.name = '';\n }\n // Enable auto theme <meta>s\n const $autoMetas = document.querySelectorAll(\n 'meta[data-theme-setting=\"auto\"]',\n );\n $autoMetas.forEach((m) => {\n m.name = 'theme-color';\n });\n } else {\n html.classList.toggle('is-light', theme === 'light');\n html.classList.toggle('is-dark', theme === 'dark');\n\n // Enable manual theme <meta>\n const $manualMeta = document.querySelector(\n 'meta[data-theme-setting=\"manual\"]',\n );\n if ($manualMeta) {\n $manualMeta.name = 'theme-color';\n $manualMeta.content =\n theme === 'light'\n ? $manualMeta.dataset.themeLightColor\n : $manualMeta.dataset.themeDarkColor;\n }\n // Disable auto theme <meta>s\n const $autoMetas = document.querySelectorAll(\n 'meta[data-theme-setting=\"auto\"]',\n );\n $autoMetas.forEach((m) => {\n m.name = '';\n });\n }\n document\n .querySelector('meta[name=\"color-scheme\"]')\n .setAttribute(\n 'content',\n theme === 'auto' ? 'dark light' : theme,\n );\n\n if (theme === 'auto') {\n store.local.del('theme');\n } else {\n store.local.set('theme', theme);\n }\n }}\n >\n <div class=\"radio-group\">\n <label>\n <input\n type=\"radio\"\n name=\"theme\"\n value=\"light\"\n defaultChecked={currentTheme === 'light'}\n />\n <span>\n <Trans>Light</Trans>\n </span>\n </label>\n <label>\n <input\n type=\"radio\"\n name=\"theme\"\n value=\"dark\"\n defaultChecked={currentTheme === 'dark'}\n />\n <span>\n <Trans>Dark</Trans>\n </span>\n </label>\n <label>\n <input\n type=\"radio\"\n name=\"theme\"\n value=\"auto\"\n defaultChecked={\n currentTheme !== 'light' && currentTheme !== 'dark'\n }\n />\n <span>\n <Trans>Auto</Trans>\n </span>\n </label>\n </div>\n </form>\n </div>\n </li>\n <li>\n <div>\n <label>\n <Trans>Text size</Trans>\n </label>\n </div>\n <div class=\"range-group\">\n <span style={{ fontSize: TEXT_SIZES[0] }}>\n <Trans comment=\"Preview of one character, in smallest size\">\n A\n </Trans>\n </span>{' '}\n <input\n type=\"range\"\n min={TEXT_SIZES[0]}\n max={TEXT_SIZES[TEXT_SIZES.length - 1]}\n step=\"1\"\n value={currentTextSize}\n list=\"sizes\"\n onChange={(e) => {\n const value = parseInt(e.target.value, 10);\n const html = document.documentElement;\n // set CSS variable\n html.style.setProperty('--text-size', `${value}px`);\n // save to local storage\n if (value === DEFAULT_TEXT_SIZE) {\n store.local.del('textSize');\n } else {\n store.local.set('textSize', e.target.value);\n }\n }}\n />{' '}\n <span style={{ fontSize: TEXT_SIZES[TEXT_SIZES.length - 1] }}>\n <Trans comment=\"Preview of one character, in largest size\">\n A\n </Trans>\n </span>\n <datalist id=\"sizes\">\n {TEXT_SIZES.map((size) => (\n <option value={size} />\n ))}\n </datalist>\n </div>\n </li>\n <li>\n <span>\n <label>\n <Trans>Display language</Trans>\n </label>\n <br />\n <small>\n <a\n href=\"https://crowdin.com/project/phanpy\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>Volunteer translations</Trans>\n </a>\n </small>\n </span>\n <LangSelector />\n </li>\n </ul>\n </section>\n {authenticated && (\n <>\n <h3>\n <Trans>Posting</Trans>\n </h3>\n <section>\n <ul>\n <li>\n <div>\n <label for=\"posting-privacy-field\">\n <Trans>Default visibility</Trans>{' '}\n <Icon icon=\"cloud\" alt={t`Synced`} class=\"synced-icon\" />\n </label>\n </div>\n <div>\n <select\n id=\"posting-privacy-field\"\n value={prefs['posting:default:visibility'] || 'public'}\n onChange={(e) => {\n const { value } = e.target;\n (async () => {\n try {\n await masto.v1.accounts.updateCredentials({\n source: {\n privacy: value,\n },\n });\n setPrefs({\n ...prefs,\n 'posting:default:visibility': value,\n });\n store.account.set('preferences', {\n ...prefs,\n 'posting:default:visibility': value,\n });\n } catch (e) {\n alert(t`Failed to update posting privacy`);\n console.error(e);\n }\n })();\n }}\n >\n <option value=\"public\">\n <Trans>Public</Trans>\n </option>\n <option value=\"unlisted\">\n <Trans>Unlisted</Trans>\n </option>\n <option value=\"private\">\n <Trans>Followers only</Trans>\n </option>\n </select>\n </div>\n </li>\n </ul>\n </section>\n <p class=\"section-postnote\">\n <Icon icon=\"cloud\" alt={t`Synced`} class=\"synced-icon\" />{' '}\n <small>\n <Trans>\n Synced to your instance server's settings.{' '}\n <a\n href={`https://${instance}/`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Go to your instance ({instance}) for more settings.\n </a>\n </Trans>\n </small>\n </p>\n </>\n )}\n <h3>\n <Trans>Experiments</Trans>\n </h3>\n <section>\n <ul>\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.autoRefresh}\n onChange={(e) => {\n states.settings.autoRefresh = e.target.checked;\n }}\n />{' '}\n <Trans>Auto refresh timeline posts</Trans>\n </label>\n </li>\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.boostsCarousel}\n onChange={(e) => {\n states.settings.boostsCarousel = e.target.checked;\n }}\n />{' '}\n <Trans>Boosts carousel</Trans>\n </label>\n </li>\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.contentTranslation}\n onChange={(e) => {\n const { checked } = e.target;\n states.settings.contentTranslation = checked;\n if (!checked) {\n states.settings.contentTranslationTargetLanguage = null;\n }\n }}\n />{' '}\n <Trans>Post translation</Trans>\n </label>\n <div\n class={`sub-section ${\n !snapStates.settings.contentTranslation\n ? 'more-insignificant'\n : ''\n }`}\n >\n <div>\n <label>\n <Trans>Translate to </Trans>{' '}\n <select\n value={targetLanguage || ''}\n disabled={!snapStates.settings.contentTranslation}\n style={{ width: '10em' }}\n onChange={(e) => {\n states.settings.contentTranslationTargetLanguage =\n e.target.value || null;\n }}\n >\n <option value=\"\">\n <Trans>\n System language ({systemTargetLanguageText})\n </Trans>\n </option>\n <option disabled>──────────</option>\n {targetLanguages.map((lang) => {\n const common = localeCode2Text({\n code: lang.code,\n fallback: lang.name,\n });\n const native = localeCode2Text({\n code: lang.code,\n locale: lang.code,\n });\n const showCommon = common !== native;\n return (\n <option value={lang.code}>\n {showCommon ? `${native} - ${common}` : common}\n </option>\n );\n })}\n </select>\n </label>\n </div>\n <hr />\n <div class=\"checkbox-fieldset\">\n <Plural\n value={\n snapStates.settings.contentTranslationHideLanguages.length\n }\n _0={`Hide \"Translate\" button for:`}\n other={`Hide \"Translate\" button for (#):`}\n />\n <div class=\"checkbox-fields\">\n {targetLanguages.map((lang) => {\n const common = localeCode2Text({\n code: lang.code,\n fallback: lang.name,\n });\n const native = localeCode2Text({\n code: lang.code,\n locale: lang.code,\n });\n const showCommon = common !== native;\n return (\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.contentTranslationHideLanguages.includes(\n lang.code,\n )}\n onChange={(e) => {\n const { checked } = e.target;\n if (checked) {\n states.settings.contentTranslationHideLanguages.push(\n lang.code,\n );\n } else {\n states.settings.contentTranslationHideLanguages =\n snapStates.settings.contentTranslationHideLanguages.filter(\n (code) => code !== lang.code,\n );\n }\n }}\n />{' '}\n {showCommon ? (\n <span>\n {native}{' '}\n <span class=\"insignificant\">- {common}</span>\n </span>\n ) : (\n common\n )}\n </label>\n );\n })}\n </div>\n </div>\n <p class=\"insignificant\">\n <small>\n <Trans>\n Note: This feature uses external translation services,\n powered by{' '}\n <a\n href=\"https://github.com/cheeaun/lingva-api\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Lingva API\n </a>{' '}\n &{' '}\n <a\n href=\"https://github.com/thedaviddelta/lingva-translate\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Lingva Translate\n </a>\n .\n </Trans>\n </small>\n </p>\n <hr />\n <div>\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.contentTranslationAutoInline}\n disabled={!snapStates.settings.contentTranslation}\n onChange={(e) => {\n states.settings.contentTranslationAutoInline =\n e.target.checked;\n }}\n />{' '}\n <Trans>Auto inline translation</Trans>\n </label>\n <p class=\"insignificant\">\n <small>\n <Trans>\n Automatically show translation for posts in timeline.\n Only works for <b>short</b> posts without content\n warning, media and poll.\n </Trans>\n </small>\n </p>\n </div>\n </div>\n </li>\n {!!GIPHY_API_KEY && authenticated && (\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.composerGIFPicker}\n onChange={(e) => {\n states.settings.composerGIFPicker = e.target.checked;\n }}\n />{' '}\n <Trans>GIF Picker for composer</Trans>\n </label>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Note: This feature uses external GIF search service,\n powered by{' '}\n <a\n href=\"https://developers.giphy.com/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n GIPHY\n </a>\n . G-rated (suitable for viewing by all ages), tracking\n parameters are stripped, referrer information is omitted\n from requests, but search queries and IP address\n information will still reach their servers.\n </Trans>\n </small>\n </div>\n </li>\n )}\n {!!IMG_ALT_API_URL && authenticated && (\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.mediaAltGenerator}\n onChange={(e) => {\n states.settings.mediaAltGenerator = e.target.checked;\n }}\n />{' '}\n <Trans>Image description generator</Trans>{' '}\n <Icon icon=\"sparkles2\" class=\"more-insignificant\" />\n </label>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Only for new images while composing new posts.\n </Trans>\n </small>\n </div>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Note: This feature uses external AI service, powered by{' '}\n <a\n href=\"https://github.com/cheeaun/img-alt-api\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n img-alt-api\n </a>\n . May not work well. Only for images and in English.\n </Trans>\n </small>\n </div>\n </li>\n )}\n {authenticated && supports('@mastodon/grouped-notifications') && (\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.groupedNotificationsAlpha}\n onChange={(e) => {\n states.settings.groupedNotificationsAlpha =\n e.target.checked;\n }}\n />{' '}\n <Trans>Server-side grouped notifications</Trans>\n </label>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Alpha-stage feature. Potentially improved grouping window\n but basic grouping logic.\n </Trans>\n </small>\n </div>\n </li>\n )}\n {authenticated && (\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={\n snapStates.settings.shortcutSettingsCloudImportExport\n }\n onChange={(e) => {\n states.settings.shortcutSettingsCloudImportExport =\n e.target.checked;\n }}\n />{' '}\n <Trans>\"Cloud\" import/export for shortcuts settings</Trans>{' '}\n <Icon icon=\"cloud\" class=\"more-insignificant\" />\n </label>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n ⚠️⚠️⚠️ Very experimental.\n <br />\n Stored in your own profile’s notes. Profile (private)\n notes are mainly used for other profiles, and hidden for\n own profile.\n </Trans>\n </small>\n </div>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Note: This feature uses currently-logged-in instance\n server API.\n </Trans>\n </small>\n </div>\n </li>\n )}\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.cloakMode}\n onChange={(e) => {\n states.settings.cloakMode = e.target.checked;\n }}\n />{' '}\n <Trans>\n Cloak mode{' '}\n <span class=\"insignificant\">\n (<samp>Text</samp> → <samp>████</samp>)\n </span>\n </Trans>\n </label>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Replace text as blocks, useful when taking screenshots, for\n privacy reasons.\n </Trans>\n </small>\n </div>\n </li>\n {authenticated && (\n <li>\n <button\n type=\"button\"\n class=\"light\"\n onClick={() => {\n states.showDrafts = true;\n states.showSettings = false;\n }}\n >\n <Trans>Unsent drafts</Trans>\n </button>\n </li>\n )}\n </ul>\n </section>\n {authenticated && <PushNotificationsSection onClose={onClose} />}\n <h3>\n <Trans>About</Trans>\n </h3>\n <section>\n <div\n style={{\n display: 'flex',\n flexWrap: 'wrap',\n gap: 8,\n lineHeight: 1.25,\n alignItems: 'center',\n marginTop: 8,\n }}\n >\n <img\n src={logo}\n alt=\"\"\n width=\"64\"\n height=\"64\"\n style={{\n aspectRatio: '1/1',\n verticalAlign: 'middle',\n background: '#b7cdf9',\n borderRadius: 12,\n }}\n />\n <div>\n <b>Phanpy</b>{' '}\n <a\n href=\"https://hachyderm.io/@phanpy\"\n // target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => {\n e.preventDefault();\n states.showAccount = 'phanpy@hachyderm.io';\n }}\n >\n @phanpy\n </a>\n <br />\n <Trans>\n <a\n href=\"https://github.com/cheeaun/phanpy\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Built\n </a>{' '}\n by{' '}\n <a\n href=\"https://mastodon.social/@cheeaun\"\n // target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => {\n e.preventDefault();\n states.showAccount = 'cheeaun@mastodon.social';\n }}\n >\n @cheeaun\n </a>\n </Trans>\n </div>\n </div>\n <p>\n <a\n href=\"https://github.com/sponsors/cheeaun\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>Sponsor</Trans>\n </a>{' '}\n ·{' '}\n <a\n href=\"https://www.buymeacoffee.com/cheeaun\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>Donate</Trans>\n </a>{' '}\n ·{' '}\n <a\n href=\"https://patreon.com/cheeaun\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Patreon\n </a>{' '}\n ·{' '}\n <a\n href={PRIVACY_POLICY_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>Privacy Policy</Trans>\n </a>\n </p>\n {__BUILD_TIME__ && (\n <p>\n {WEBSITE && (\n <>\n <Trans>\n <span class=\"insignificant\">Site:</span>{' '}\n {WEBSITE.replace(/https?:\\/\\//g, '').replace(/\\/$/, '')}\n </Trans>\n <br />\n </>\n )}\n <Trans>\n <span class=\"insignificant\">Version:</span>{' '}\n <input\n type=\"text\"\n class=\"version-string\"\n readOnly\n size=\"18\" // Manually calculated here\n value={`${__BUILD_TIME__.slice(0, 10).replace(/-/g, '.')}${\n __COMMIT_HASH__ ? `.${__COMMIT_HASH__}` : ''\n }`}\n onClick={(e) => {\n e.target.select();\n // Copy to clipboard\n try {\n navigator.clipboard.writeText(e.target.value);\n showToast(t`Version string copied`);\n } catch (e) {\n console.warn(e);\n showToast(t`Unable to copy version string`);\n }\n }}\n />{' '}\n {!__FAKE_COMMIT_HASH__ && (\n <span class=\"ib insignificant\">\n (\n <a\n href={`https://github.com/cheeaun/phanpy/commit/${__COMMIT_HASH__}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <RelativeTime datetime={new Date(__BUILD_TIME__)} />\n </a>\n )\n </span>\n )}\n </Trans>\n </p>\n )}\n </section>\n {(import.meta.env.DEV || import.meta.env.PHANPY_DEV) && (\n <details class=\"debug-info\">\n <summary></summary>\n <p>Debugging</p>\n {__BENCH_RESULTS?.size > 0 && (\n <ul>\n {Array.from(__BENCH_RESULTS.entries()).map(\n ([name, duration]) => (\n <li>\n <b>{name}</b>: {duration}ms\n </li>\n ),\n )}\n </ul>\n )}\n <p>Service Worker Cache</p>\n <button\n type=\"button\"\n class=\"plain2 small\"\n onClick={async () => alert(await getCachesKeys())}\n >\n Show keys count\n </button>{' '}\n <button\n type=\"button\"\n class=\"plain2 small\"\n onClick={async () => alert(await getCachesSize())}\n >\n Show cache size\n </button>{' '}\n <button\n type=\"button\"\n class=\"plain2 small\"\n onClick={() => {\n const key = prompt('Enter cache key');\n if (!key) return;\n try {\n clearCacheKey(key);\n } catch (e) {\n alert(e);\n }\n }}\n >\n Clear cache key\n </button>{' '}\n <button\n type=\"button\"\n class=\"plain2 small\"\n onClick={() => {\n try {\n clearCaches();\n } catch (e) {\n alert(e);\n }\n }}\n >\n Clear all caches\n </button>\n </details>\n )}\n </main>\n </div>\n );\n}\n\nasync function getCachesKeys() {\n const keys = await caches.keys();\n const total = {};\n for (const key of keys) {\n const cache = await caches.open(key);\n const k = await cache.keys();\n total[key] = k.length;\n }\n return total;\n}\n\nasync function getCachesSize() {\n const keys = await caches.keys();\n let total = {};\n let TOTAL = 0;\n for (const key of keys) {\n const cache = await caches.open(key);\n const k = await cache.keys();\n for (const item of k) {\n try {\n const response = await cache.match(item);\n const blob = await response.blob();\n total[key] = (total[key] || 0) + blob.size;\n TOTAL += blob.size;\n } catch (e) {\n alert('Failed to get cache size for ' + item);\n alert(e);\n }\n }\n }\n return {\n ...Object.fromEntries(\n Object.entries(total).map(([k, v]) => [k, prettyBytes(v)]),\n ),\n TOTAL: prettyBytes(TOTAL),\n };\n}\n\nfunction clearCacheKey(key) {\n return caches.delete(key);\n}\n\nasync function clearCaches() {\n const keys = await caches.keys();\n for (const key of keys) {\n await caches.delete(key);\n }\n}\n\nfunction PushNotificationsSection({ onClose }) {\n if (!isPushSupported()) return null;\n\n const { instance } = api();\n const [uiState, setUIState] = useState('default');\n const pushFormRef = useRef();\n const [allowNotifications, setAllowNotifications] = useState(false);\n const [needRelogin, setNeedRelogin] = useState(false);\n const previousPolicyRef = useRef();\n useEffect(() => {\n (async () => {\n setUIState('loading');\n try {\n const { subscription, backendSubscription } = await initSubscription();\n if (\n backendSubscription?.policy &&\n backendSubscription.policy !== 'none'\n ) {\n setAllowNotifications(true);\n const { alerts, policy } = backendSubscription;\n console.log('backendSubscription', backendSubscription);\n previousPolicyRef.current = policy;\n const { elements } = pushFormRef.current;\n const policyEl = elements.namedItem('policy');\n if (policyEl) policyEl.value = policy;\n // alerts is {}, iterate it\n Object.keys(alerts).forEach((alert) => {\n const el = elements.namedItem(alert);\n if (el?.type === 'checkbox') {\n el.checked = true;\n }\n });\n }\n setUIState('default');\n } catch (err) {\n console.warn(err);\n if (/outside.*authorized/i.test(err.message)) {\n setNeedRelogin(true);\n } else {\n alert(err?.message || err);\n }\n setUIState('error');\n }\n })();\n }, []);\n\n const isLoading = uiState === 'loading';\n\n return (\n <form\n ref={pushFormRef}\n onChange={() => {\n setTimeout(() => {\n const values = Object.fromEntries(new FormData(pushFormRef.current));\n const allowNotifications = !!values['policy-allow'];\n const params = {\n data: {\n policy: values.policy,\n alerts: {\n mention: !!values.mention,\n favourite: !!values.favourite,\n reblog: !!values.reblog,\n follow: !!values.follow,\n follow_request: !!values.followRequest,\n poll: !!values.poll,\n update: !!values.update,\n status: !!values.status,\n },\n },\n };\n\n let alertsCount = 0;\n // Remove false values from data.alerts\n // API defaults to false anyway\n Object.keys(params.data.alerts).forEach((key) => {\n if (!params.data.alerts[key]) {\n delete params.data.alerts[key];\n } else {\n alertsCount++;\n }\n });\n const policyChanged =\n previousPolicyRef.current !== params.data.policy;\n\n console.log('PN Form', {\n values,\n allowNotifications: allowNotifications,\n params,\n });\n\n if (allowNotifications && alertsCount > 0) {\n if (policyChanged) {\n console.debug('Policy changed.');\n removeSubscription()\n .then(() => {\n updateSubscription(params);\n })\n .catch((err) => {\n console.warn(err);\n alert(t`Failed to update subscription. Please try again.`);\n });\n } else {\n updateSubscription(params).catch((err) => {\n console.warn(err);\n alert(t`Failed to update subscription. Please try again.`);\n });\n }\n } else {\n removeSubscription().catch((err) => {\n console.warn(err);\n alert(t`Failed to remove subscription. Please try again.`);\n });\n }\n }, 100);\n }}\n >\n <h3>\n <Trans>Push Notifications (beta)</Trans>\n </h3>\n <section>\n <ul>\n <li>\n <label>\n <input\n type=\"checkbox\"\n disabled={isLoading || needRelogin}\n name=\"policy-allow\"\n checked={allowNotifications}\n onChange={async (e) => {\n const { checked } = e.target;\n if (checked) {\n // Request permission\n const permission = await Notification.requestPermission();\n if (permission === 'granted') {\n setAllowNotifications(true);\n } else {\n setAllowNotifications(false);\n if (permission === 'denied') {\n alert(\n t`Push notifications are blocked. Please enable them in your browser settings.`,\n );\n }\n }\n } else {\n setAllowNotifications(false);\n }\n }}\n />{' '}\n <Trans>\n Allow from{' '}\n <select\n name=\"policy\"\n disabled={isLoading || needRelogin || !allowNotifications}\n >\n {[\n {\n value: 'all',\n label: t`anyone`,\n },\n {\n value: 'followed',\n label: t`people I follow`,\n },\n {\n value: 'follower',\n label: t`followers`,\n },\n ].map((type) => (\n <option value={type.value}>{type.label}</option>\n ))}\n </select>\n </Trans>\n </label>\n <div\n class=\"shazam-container no-animation\"\n style={{\n width: '100%',\n }}\n hidden={!allowNotifications}\n >\n <div class=\"shazam-container-inner\">\n <div class=\"sub-section\">\n <ul>\n {[\n {\n value: 'mention',\n label: t`Mentions`,\n },\n {\n value: 'favourite',\n label: t`Likes`,\n },\n {\n value: 'reblog',\n label: t`Boosts`,\n },\n {\n value: 'follow',\n label: t`Follows`,\n },\n {\n value: 'followRequest',\n label: t`Follow requests`,\n },\n {\n value: 'poll',\n label: t`Polls`,\n },\n {\n value: 'update',\n label: t`Post edits`,\n },\n {\n value: 'status',\n label: t`New posts`,\n },\n ].map((alert) => (\n <li>\n <label>\n <input type=\"checkbox\" name={alert.value} />{' '}\n {alert.label}\n </label>\n </li>\n ))}\n </ul>\n </div>\n </div>\n </div>\n {needRelogin && (\n <div class=\"sub-section\">\n <p>\n <Trans>\n Push permission was not granted since your last login.\n You'll need to{' '}\n <Link to={`/login?instance=${instance}`} onClick={onClose}>\n <b>log in</b> again to grant push permission\n </Link>\n .\n </Trans>\n </p>\n </div>\n )}\n </li>\n </ul>\n </section>\n <p class=\"section-postnote\">\n <small>\n <Trans>\n NOTE: Push notifications only work for <b>one account</b>.\n </Trans>\n </small>\n </p>\n </form>\n );\n}\n\nexport default Settings;\n","const focusDeck = () => {\n let timer = setTimeout(() => {\n const columns = document.getElementById('columns');\n if (columns) {\n // Focus focused column\n const focusedColumn = columns.querySelector('.deck-container.focus');\n if (focusedColumn) {\n focusedColumn.focus();\n } else {\n // Focus first column within viewport\n const firstVisibleColumn = columns\n .querySelectorAll('.deck-container')\n .find((column) => {\n const columnRect = column.getBoundingClientRect();\n return columnRect.left >= 0;\n });\n if (firstVisibleColumn) {\n firstVisibleColumn.focus();\n } else {\n // Focus first column\n columns.querySelector('.deck-container')?.focus?.();\n }\n }\n } else {\n const modals = document.querySelectorAll('#modal-container > *');\n if (modals?.length) {\n // Focus last modal\n const modal = modals[modals.length - 1]; // last one\n const modalFocusElement =\n modal.querySelector('[tabindex=\"-1\"]') || modal;\n if (modalFocusElement) {\n modalFocusElement.focus();\n return;\n }\n }\n const backDrop = document.querySelector('.deck-backdrop');\n if (backDrop) return;\n // Focus last deck\n const pages = document.querySelectorAll('.deck-container');\n const page = pages[pages.length - 1]; // last one\n if (page && page.tabIndex === -1) {\n console.log('FOCUS', page);\n page.focus();\n }\n }\n }, 100);\n return () => clearTimeout(timer);\n};\n\nexport default focusDeck;\n","import { useEffect, useRef } from 'preact/hooks';\nimport { useLocation } from 'react-router-dom';\n\n// Hook that runs a callback when the location changes\n// Won't run on the first render\n\nexport default function useLocationChange(fn) {\n if (!fn) return;\n const location = useLocation();\n const currentLocationRef = useRef(location.pathname);\n useEffect(() => {\n // console.log('location', {\n // current: currentLocationRef.current,\n // next: location.pathname,\n // });\n if (\n currentLocationRef.current &&\n location.pathname !== currentLocationRef.current\n ) {\n fn?.();\n }\n }, [location.pathname, fn]);\n}\n","import { api } from './api';\nimport pmem from './pmem';\nimport store from './store';\n\nconst FETCH_MAX_AGE = 1000 * 60; // 1 minute\nconst MAX_AGE = 24 * 60 * 60 * 1000; // 1 day\n\nexport const fetchLists = pmem(\n async () => {\n const { masto } = api();\n const lists = await masto.v1.lists.list();\n lists.sort((a, b) => a.title.localeCompare(b.title));\n\n if (lists.length) {\n setTimeout(() => {\n // Save to local storage, with saved timestamp\n store.account.set('lists', {\n lists,\n updatedAt: Date.now(),\n });\n }, 1);\n }\n\n return lists;\n },\n {\n maxAge: FETCH_MAX_AGE,\n },\n);\n\nexport async function getLists() {\n try {\n const { lists, updatedAt } = store.account.get('lists') || {};\n if (!lists?.length) return await fetchLists();\n if (Date.now() - updatedAt > MAX_AGE) {\n // Stale-while-revalidate\n fetchLists();\n return lists;\n }\n return lists;\n } catch (e) {\n return [];\n }\n}\n\nexport const fetchList = pmem(\n (id) => {\n const { masto } = api();\n return masto.v1.lists.$select(id).fetch();\n },\n {\n maxAge: FETCH_MAX_AGE,\n },\n);\n\nexport async function getList(id) {\n const { lists } = store.account.get('lists') || {};\n console.log({ lists });\n if (lists?.length) {\n const theList = lists.find((l) => l.id === id);\n if (theList) return theList;\n }\n try {\n return fetchList(id);\n } catch (e) {\n return null;\n }\n}\n\nexport async function getListTitle(id) {\n const list = await getList(id);\n return list?.title || '';\n}\n\nexport function addListStore(list) {\n const { lists } = store.account.get('lists') || {};\n if (lists?.length) {\n lists.push(list);\n lists.sort((a, b) => a.title.localeCompare(b.title));\n store.account.set('lists', {\n lists,\n updatedAt: Date.now(),\n });\n }\n}\n\nexport function updateListStore(list) {\n const { lists } = store.account.get('lists') || {};\n if (lists?.length) {\n const index = lists.findIndex((l) => l.id === list.id);\n if (index !== -1) {\n lists[index] = list;\n lists.sort((a, b) => a.title.localeCompare(b.title));\n store.account.set('lists', {\n lists,\n updatedAt: Date.now(),\n });\n }\n }\n}\n\nexport function deleteListStore(listID) {\n const { lists } = store.account.get('lists') || {};\n if (lists?.length) {\n const index = lists.findIndex((l) => l.id === listID);\n if (index !== -1) {\n lists.splice(index, 1);\n store.account.set('lists', {\n lists,\n updatedAt: Date.now(),\n });\n }\n }\n}\n","import { t, Trans } from '@lingui/macro';\nimport { useEffect, useRef, useState } from 'preact/hooks';\n\nimport { api } from '../utils/api';\nimport { addListStore, deleteListStore, updateListStore } from '../utils/lists';\nimport supports from '../utils/supports';\n\nimport Icon from './icon';\nimport MenuConfirm from './menu-confirm';\n\nfunction ListAddEdit({ list, onClose }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const editMode = !!list;\n const nameFieldRef = useRef();\n const repliesPolicyFieldRef = useRef();\n const exclusiveFieldRef = useRef();\n useEffect(() => {\n if (editMode) {\n nameFieldRef.current.value = list.title;\n repliesPolicyFieldRef.current.value = list.repliesPolicy;\n if (exclusiveFieldRef.current) {\n exclusiveFieldRef.current.checked = list.exclusive;\n }\n }\n }, [editMode]);\n const supportsExclusive =\n supports('@mastodon/list-exclusive') ||\n supports('@gotosocial/list-exclusive');\n\n return (\n <div 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>{editMode ? t`Edit list` : t`New list`}</h2>\n </header>\n <main>\n <form\n class=\"list-form\"\n onSubmit={(e) => {\n e.preventDefault(); // Get form values\n\n const formData = new FormData(e.target);\n const title = formData.get('title');\n const repliesPolicy = formData.get('replies_policy');\n const exclusive = formData.get('exclusive') === 'on';\n console.log({\n title,\n repliesPolicy,\n exclusive,\n });\n setUIState('loading');\n\n (async () => {\n try {\n let listResult;\n\n if (editMode) {\n listResult = await masto.v1.lists.$select(list.id).update({\n title,\n replies_policy: repliesPolicy,\n exclusive,\n });\n } else {\n listResult = await masto.v1.lists.create({\n title,\n replies_policy: repliesPolicy,\n exclusive,\n });\n }\n\n console.log(listResult);\n setUIState('default');\n onClose?.({\n state: 'success',\n list: listResult,\n });\n\n setTimeout(() => {\n if (editMode) {\n updateListStore(listResult);\n } else {\n addListStore(listResult);\n }\n }, 1);\n } catch (e) {\n console.error(e);\n setUIState('error');\n alert(\n editMode\n ? t`Unable to edit list.`\n : t`Unable to create list.`,\n );\n }\n })();\n }}\n >\n <div class=\"list-form-row\">\n <label for=\"list-title\">\n <Trans>Name</Trans>{' '}\n <input\n ref={nameFieldRef}\n type=\"text\"\n id=\"list-title\"\n name=\"title\"\n required\n disabled={uiState === 'loading'}\n dir=\"auto\"\n />\n </label>\n </div>\n <div class=\"list-form-row\">\n <select\n ref={repliesPolicyFieldRef}\n name=\"replies_policy\"\n required\n disabled={uiState === 'loading'}\n >\n <option value=\"list\">\n <Trans>Show replies to list members</Trans>\n </option>\n <option value=\"followed\">\n <Trans>Show replies to people I follow</Trans>\n </option>\n <option value=\"none\">\n <Trans>Don't show replies</Trans>\n </option>\n </select>\n </div>\n {supportsExclusive && (\n <div class=\"list-form-row\">\n <label class=\"label-block\">\n <input\n ref={exclusiveFieldRef}\n type=\"checkbox\"\n name=\"exclusive\"\n disabled={uiState === 'loading'}\n />{' '}\n <Trans>Hide posts on this list from Home/Following</Trans>\n </label>\n </div>\n )}\n <div class=\"list-form-footer\">\n <button type=\"submit\" disabled={uiState === 'loading'}>\n {editMode ? t`Save` : t`Create`}\n </button>\n {editMode && (\n <MenuConfirm\n disabled={uiState === 'loading'}\n align=\"end\"\n menuItemClassName=\"danger\"\n confirmLabel={t`Delete this list?`}\n onClick={() => {\n // const yes = confirm('Delete this list?');\n // if (!yes) return;\n setUIState('loading');\n\n (async () => {\n try {\n await masto.v1.lists.$select(list.id).remove();\n setUIState('default');\n onClose?.({\n state: 'deleted',\n });\n setTimeout(() => {\n deleteListStore(list.id);\n }, 1);\n } catch (e) {\n console.error(e);\n setUIState('error');\n alert(t`Unable to delete list.`);\n }\n })();\n }}\n >\n <button\n type=\"button\"\n class=\"light danger\"\n disabled={uiState === 'loading'}\n >\n <Trans>Delete…</Trans>\n </button>\n </MenuConfirm>\n )}\n </div>\n </form>\n </main>\n </div>\n );\n}\n\nexport default ListAddEdit;\n","import './account-info.css';\n\nimport { msg, plural, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\n\nimport { api } from '../utils/api';\nimport enhanceContent from '../utils/enhance-content';\nimport getHTMLText from '../utils/getHTMLText';\nimport handleContentLinks from '../utils/handle-content-links';\nimport i18nDuration from '../utils/i18n-duration';\nimport { getLists } from '../utils/lists';\nimport niceDateTime from '../utils/nice-date-time';\nimport pmem from '../utils/pmem';\nimport shortenNumber from '../utils/shorten-number';\nimport showCompose from '../utils/show-compose';\nimport showToast from '../utils/show-toast';\nimport states, { hideAllModals } from '../utils/states';\nimport store from '../utils/store';\nimport { getCurrentAccountID, updateAccount } from '../utils/store-utils';\nimport supports from '../utils/supports';\n\nimport AccountBlock from './account-block';\nimport Avatar from './avatar';\nimport EmojiText from './emoji-text';\nimport Icon from './icon';\nimport Link from './link';\nimport ListAddEdit from './list-add-edit';\nimport Loader from './loader';\nimport MenuConfirm from './menu-confirm';\nimport MenuLink from './menu-link';\nimport Menu2 from './menu2';\nimport Modal from './modal';\nimport SubMenu2 from './submenu2';\nimport TranslationBlock from './translation-block';\n\nconst MUTE_DURATIONS = [\n 60 * 5, // 5 minutes\n 60 * 30, // 30 minutes\n 60 * 60, // 1 hour\n 60 * 60 * 6, // 6 hours\n 60 * 60 * 24, // 1 day\n 60 * 60 * 24 * 3, // 3 days\n 60 * 60 * 24 * 7, // 1 week\n 60 * 60 * 24 * 30, // 30 days\n 0, // forever\n];\nconst MUTE_DURATIONS_LABELS = {\n 0: msg`Forever`,\n 300: i18nDuration(5, 'minute'),\n 1_800: i18nDuration(30, 'minute'),\n 3_600: i18nDuration(1, 'hour'),\n 21_600: i18nDuration(6, 'hour'),\n 86_400: i18nDuration(1, 'day'),\n 259_200: i18nDuration(3, 'day'),\n 604_800: i18nDuration(1, 'week'),\n 2592_000: i18nDuration(30, 'day'),\n};\n\nconst LIMIT = 80;\n\nconst ACCOUNT_INFO_MAX_AGE = 1000 * 60 * 10; // 10 mins\n\nfunction fetchFamiliarFollowers(currentID, masto) {\n return masto.v1.accounts.familiarFollowers.fetch({\n id: [currentID],\n });\n}\nconst memFetchFamiliarFollowers = pmem(fetchFamiliarFollowers, {\n maxAge: ACCOUNT_INFO_MAX_AGE,\n});\n\nasync function fetchPostingStats(accountID, masto) {\n const fetchStatuses = masto.v1.accounts\n .$select(accountID)\n .statuses.list({\n limit: 20,\n })\n .next();\n\n const { value: statuses } = await fetchStatuses;\n console.log('fetched statuses', statuses);\n const stats = {\n total: statuses.length,\n originals: 0,\n replies: 0,\n boosts: 0,\n };\n // Categories statuses by type\n // - Original posts (not replies to others)\n // - Threads (self-replies + 1st original post)\n // - Boosts (reblogs)\n // - Replies (not-self replies)\n statuses.forEach((status) => {\n if (status.reblog) {\n stats.boosts++;\n } else if (\n !!status.inReplyToId &&\n status.inReplyToAccountId !== status.account.id // Not self-reply\n ) {\n stats.replies++;\n } else {\n stats.originals++;\n }\n });\n\n // Count days since last post\n if (statuses.length) {\n stats.daysSinceLastPost = Math.ceil(\n (Date.now() - new Date(statuses[statuses.length - 1].createdAt)) /\n 86400000,\n );\n }\n\n console.log('posting stats', stats);\n return stats;\n}\nconst memFetchPostingStats = pmem(fetchPostingStats, {\n maxAge: ACCOUNT_INFO_MAX_AGE,\n});\n\nfunction AccountInfo({\n account,\n fetchAccount = () => {},\n standalone,\n instance,\n authenticated,\n}) {\n const { i18n } = useLingui();\n const { masto } = api({\n instance,\n });\n const { masto: currentMasto, instance: currentInstance } = api();\n const [uiState, setUIState] = useState('default');\n const isString = typeof account === 'string';\n const [info, setInfo] = useState(isString ? null : account);\n\n const sameCurrentInstance = useMemo(\n () => instance === currentInstance,\n [instance, currentInstance],\n );\n\n useEffect(() => {\n if (!isString) {\n setInfo(account);\n return;\n }\n setUIState('loading');\n (async () => {\n try {\n const info = await fetchAccount();\n states.accounts[`${info.id}@${instance}`] = info;\n setInfo(info);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setInfo(null);\n setUIState('error');\n }\n })();\n }, [isString, account, fetchAccount]);\n\n const {\n acct,\n avatar,\n avatarStatic,\n bot,\n createdAt,\n displayName,\n emojis,\n fields,\n followersCount,\n followingCount,\n group,\n // header,\n // headerStatic,\n id,\n lastStatusAt,\n locked,\n note,\n statusesCount,\n url,\n username,\n memorial,\n moved,\n roles,\n hideCollections,\n } = info || {};\n let headerIsAvatar = false;\n let { header, headerStatic } = info || {};\n if (!header || /missing\\.png$/.test(header)) {\n if (avatar && !/missing\\.png$/.test(avatar)) {\n header = avatar;\n headerIsAvatar = true;\n if (avatarStatic && !/missing\\.png$/.test(avatarStatic)) {\n headerStatic = avatarStatic;\n }\n }\n }\n\n const isSelf = useMemo(() => id === getCurrentAccountID(), [id]);\n\n useEffect(() => {\n const infoHasEssentials = !!(\n info?.id &&\n info?.username &&\n info?.acct &&\n info?.avatar &&\n info?.avatarStatic &&\n info?.displayName &&\n info?.url\n );\n if (isSelf && instance && infoHasEssentials) {\n const accounts = store.local.getJSON('accounts');\n let updated = false;\n accounts.forEach((account) => {\n if (account.info.id === info.id && account.instanceURL === instance) {\n account.info = info;\n updated = true;\n }\n });\n if (updated) {\n console.log('Updated account info', info);\n store.local.setJSON('accounts', accounts);\n }\n }\n }, [isSelf, info, instance]);\n\n const accountInstance = useMemo(() => {\n if (!url) return null;\n const domain = punycode.toUnicode(URL.parse(url).hostname);\n return domain;\n }, [url]);\n\n const [headerCornerColors, setHeaderCornerColors] = useState([]);\n\n const followersIterator = useRef();\n const familiarFollowersCache = useRef([]);\n async function fetchFollowers(firstLoad) {\n if (firstLoad || !followersIterator.current) {\n followersIterator.current = masto.v1.accounts.$select(id).followers.list({\n limit: LIMIT,\n });\n }\n const results = await followersIterator.current.next();\n if (isSelf) return results;\n if (!sameCurrentInstance) return results;\n\n const { value } = results;\n let newValue = [];\n // On first load, fetch familiar followers, merge to top of results' `value`\n // Remove dups on every fetch\n if (firstLoad) {\n let familiarFollowers = [];\n try {\n familiarFollowers = await masto.v1.accounts.familiarFollowers.fetch({\n id: [id],\n });\n } catch (e) {}\n familiarFollowersCache.current = familiarFollowers?.[0]?.accounts || [];\n newValue = [\n ...familiarFollowersCache.current,\n ...value.filter(\n (account) =>\n !familiarFollowersCache.current.some(\n (familiar) => familiar.id === account.id,\n ),\n ),\n ];\n } else if (value?.length) {\n newValue = value.filter(\n (account) =>\n !familiarFollowersCache.current.some(\n (familiar) => familiar.id === account.id,\n ),\n );\n }\n\n return {\n ...results,\n value: newValue,\n };\n }\n\n const followingIterator = useRef();\n async function fetchFollowing(firstLoad) {\n if (firstLoad || !followingIterator.current) {\n followingIterator.current = masto.v1.accounts.$select(id).following.list({\n limit: LIMIT,\n });\n }\n const results = await followingIterator.current.next();\n return results;\n }\n\n const LinkOrDiv = standalone ? 'div' : Link;\n const accountLink = instance ? `/${instance}/a/${id}` : `/a/${id}`;\n\n const [familiarFollowers, setFamiliarFollowers] = useState([]);\n const [postingStats, setPostingStats] = useState();\n const [postingStatsUIState, setPostingStatsUIState] = useState('default');\n const hasPostingStats = !!postingStats?.total;\n\n const renderFamiliarFollowers = async (currentID) => {\n try {\n const followers = await memFetchFamiliarFollowers(\n currentID,\n currentMasto,\n );\n console.log('fetched familiar followers', followers);\n setFamiliarFollowers(\n followers[0].accounts.slice(0, FAMILIAR_FOLLOWERS_LIMIT),\n );\n } catch (e) {\n console.error(e);\n }\n };\n\n const renderPostingStats = async () => {\n if (!id) return;\n setPostingStatsUIState('loading');\n try {\n const stats = await memFetchPostingStats(id, masto);\n setPostingStats(stats);\n setPostingStatsUIState('default');\n } catch (e) {\n console.error(e);\n setPostingStatsUIState('error');\n }\n };\n\n const onRelationshipChange = useCallback(\n ({ relationship, currentID }) => {\n if (!relationship.following) {\n renderFamiliarFollowers(currentID);\n if (!standalone && statusesCount > 0) {\n // Only render posting stats if not standalone and has posts\n renderPostingStats();\n }\n }\n },\n [standalone, id, statusesCount],\n );\n\n const onProfileUpdate = useCallback(\n (newAccount) => {\n if (newAccount.id === id) {\n console.log('Updated account info', newAccount);\n setInfo(newAccount);\n states.accounts[`${newAccount.id}@${instance}`] = newAccount;\n }\n },\n [id, instance],\n );\n\n return (\n <div\n tabIndex=\"-1\"\n class={`account-container ${uiState === 'loading' ? 'skeleton' : ''}`}\n style={{\n '--header-color-1': headerCornerColors[0],\n '--header-color-2': headerCornerColors[1],\n '--header-color-3': headerCornerColors[2],\n '--header-color-4': headerCornerColors[3],\n }}\n >\n {uiState === 'error' && (\n <div class=\"ui-state\">\n <p>\n <Trans>Unable to load account.</Trans>\n </p>\n <p>\n <a\n href={isString ? account : url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>Go to account page</Trans> <Icon icon=\"external\" />\n </a>\n </p>\n </div>\n )}\n {uiState === 'loading' ? (\n <>\n <header>\n <AccountBlock avatarSize=\"xxxl\" skeleton />\n </header>\n <main>\n <div class=\"note\">\n <p>███████ ████ ████</p>\n <p>████ ████████ ██████ █████████ ████ ██</p>\n </div>\n <div class=\"account-metadata-box\">\n <div class=\"profile-metadata\">\n <div class=\"profile-field\">\n <b class=\"more-insignificant\">███</b>\n <p>██████</p>\n </div>\n <div class=\"profile-field\">\n <b class=\"more-insignificant\">████</b>\n <p>███████████</p>\n </div>\n </div>\n <div class=\"stats\">\n <div>\n <span>██</span> <Trans>Followers</Trans>\n </div>\n <div>\n <span>██</span> <Trans id=\"following.stats\">Following</Trans>\n </div>\n <div>\n <span>██</span> <Trans>Posts</Trans>\n </div>\n </div>\n </div>\n <div class=\"actions\">\n <span />\n <span class=\"buttons\">\n <button type=\"button\" class=\"plain\" disabled>\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n </span>\n </div>\n </main>\n </>\n ) : (\n info && (\n <>\n {!!moved && (\n <div class=\"account-moved\">\n <p>\n <Trans>\n <b>{displayName}</b> has indicated that their new account is\n now:\n </Trans>\n </p>\n <AccountBlock\n account={moved}\n instance={instance}\n onClick={(e) => {\n e.stopPropagation();\n states.showAccount = moved;\n }}\n />\n </div>\n )}\n {!!header && !/missing\\.png$/.test(header) && (\n <img\n src={header}\n alt=\"\"\n class={`header-banner ${\n headerIsAvatar ? 'header-is-avatar' : ''\n }`}\n onError={(e) => {\n if (e.target.crossOrigin) {\n if (e.target.src !== headerStatic) {\n e.target.src = headerStatic;\n } else {\n e.target.removeAttribute('crossorigin');\n e.target.src = header;\n }\n } else if (e.target.src !== headerStatic) {\n e.target.src = headerStatic;\n } else {\n e.target.remove();\n }\n }}\n crossOrigin=\"anonymous\"\n onLoad={(e) => {\n e.target.classList.add('loaded');\n try {\n // Get color from four corners of image\n const canvas = window.OffscreenCanvas\n ? new OffscreenCanvas(1, 1)\n : document.createElement('canvas');\n const ctx = canvas.getContext('2d', {\n willReadFrequently: true,\n });\n canvas.width = e.target.width;\n canvas.height = e.target.height;\n ctx.imageSmoothingEnabled = false;\n ctx.drawImage(e.target, 0, 0);\n // const colors = [\n // ctx.getImageData(0, 0, 1, 1).data,\n // ctx.getImageData(e.target.width - 1, 0, 1, 1).data,\n // ctx.getImageData(0, e.target.height - 1, 1, 1).data,\n // ctx.getImageData(\n // e.target.width - 1,\n // e.target.height - 1,\n // 1,\n // 1,\n // ).data,\n // ];\n // Get 10x10 pixels from corners, get average color from each\n const pixelDimension = 10;\n const colors = [\n ctx.getImageData(0, 0, pixelDimension, pixelDimension)\n .data,\n ctx.getImageData(\n e.target.width - pixelDimension,\n 0,\n pixelDimension,\n pixelDimension,\n ).data,\n ctx.getImageData(\n 0,\n e.target.height - pixelDimension,\n pixelDimension,\n pixelDimension,\n ).data,\n ctx.getImageData(\n e.target.width - pixelDimension,\n e.target.height - pixelDimension,\n pixelDimension,\n pixelDimension,\n ).data,\n ].map((data) => {\n let r = 0;\n let g = 0;\n let b = 0;\n let a = 0;\n for (let i = 0; i < data.length; i += 4) {\n r += data[i];\n g += data[i + 1];\n b += data[i + 2];\n a += data[i + 3];\n }\n const dataLength = data.length / 4;\n return [\n r / dataLength,\n g / dataLength,\n b / dataLength,\n a / dataLength,\n ];\n });\n const rgbColors = colors.map((color) => {\n const [r, g, b, a] = lightenRGB(color);\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n });\n setHeaderCornerColors(rgbColors);\n console.log({ colors, rgbColors });\n } catch (e) {\n // Silently fail\n }\n }}\n />\n )}\n <header>\n {standalone ? (\n <Menu2\n shift={\n window.matchMedia('(min-width: calc(40em))').matches\n ? 114\n : 64\n }\n menuButton={\n <div>\n <AccountBlock\n account={info}\n instance={instance}\n avatarSize=\"xxxl\"\n onClick={() => {}}\n />\n </div>\n }\n >\n <div class=\"szh-menu__header\">\n <AccountHandleInfo acct={acct} instance={instance} />\n </div>\n <MenuItem\n onClick={() => {\n const handleWithInstance = acct.includes('@')\n ? `@${acct}`\n : `@${acct}@${instance}`;\n try {\n navigator.clipboard.writeText(handleWithInstance);\n showToast(t`Handle copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy handle`);\n }\n }}\n >\n <Icon icon=\"link\" />\n <span>\n <Trans>Copy handle</Trans>\n </span>\n </MenuItem>\n <MenuItem href={url} target=\"_blank\">\n <Icon icon=\"external\" />\n <span>\n <Trans>Go to original profile page</Trans>\n </span>\n </MenuItem>\n <MenuDivider />\n <MenuLink href={info.avatar} target=\"_blank\">\n <Icon icon=\"user\" />\n <span>\n <Trans>View profile image</Trans>\n </span>\n </MenuLink>\n <MenuLink href={info.header} target=\"_blank\">\n <Icon icon=\"media\" />\n <span>\n <Trans>View profile header</Trans>\n </span>\n </MenuLink>\n </Menu2>\n ) : (\n <AccountBlock\n account={info}\n instance={instance}\n avatarSize=\"xxxl\"\n internal\n />\n )}\n </header>\n <div class=\"faux-header-bg\" aria-hidden=\"true\" />\n <main>\n {!!memorial && (\n <span class=\"tag\">\n <Trans>In Memoriam</Trans>\n </span>\n )}\n {!!bot && (\n <span class=\"tag\">\n <Icon icon=\"bot\" /> <Trans>Automated</Trans>\n </span>\n )}\n {!!group && (\n <span class=\"tag\">\n <Icon icon=\"group\" /> <Trans>Group</Trans>\n </span>\n )}\n {roles?.map((role) => (\n <span class=\"tag\">\n {role.name}\n {!!accountInstance && (\n <>\n {' '}\n <span class=\"more-insignificant\">{accountInstance}</span>\n </>\n )}\n </span>\n ))}\n <div\n class=\"note\"\n dir=\"auto\"\n onClick={handleContentLinks({\n instance: currentInstance,\n })}\n dangerouslySetInnerHTML={{\n __html: enhanceContent(note, { emojis }),\n }}\n />\n <div class=\"account-metadata-box\">\n {fields?.length > 0 && (\n <div class=\"profile-metadata\">\n {fields.map(({ name, value, verifiedAt }, i) => (\n <div\n class={`profile-field ${\n verifiedAt ? 'profile-verified' : ''\n }`}\n key={name + i}\n dir=\"auto\"\n >\n <b>\n <EmojiText text={name} emojis={emojis} />{' '}\n {!!verifiedAt && (\n <Icon\n icon=\"check-circle\"\n size=\"s\"\n alt={t`Verified`}\n />\n )}\n </b>\n <p\n dangerouslySetInnerHTML={{\n __html: enhanceContent(value, { emojis }),\n }}\n />\n </div>\n ))}\n </div>\n )}\n <div class=\"stats\">\n <LinkOrDiv\n tabIndex={0}\n to={accountLink}\n onClick={() => {\n // states.showAccount = false;\n setTimeout(() => {\n states.showGenericAccounts = {\n id: 'followers',\n heading: t`Followers`,\n fetchAccounts: fetchFollowers,\n instance,\n excludeRelationshipAttrs: isSelf\n ? ['followedBy']\n : [],\n blankCopy: hideCollections\n ? t`This user has chosen to not make this information available.`\n : undefined,\n };\n }, 0);\n }}\n >\n {!!familiarFollowers.length && (\n <span class=\"shazam-container-horizontal\">\n <span class=\"shazam-container-inner stats-avatars-bunch\">\n {familiarFollowers.map((follower) => (\n <Avatar\n url={follower.avatarStatic}\n size=\"s\"\n alt={`${follower.displayName} @${follower.acct}`}\n squircle={follower?.bot}\n />\n ))}\n </span>\n </span>\n )}\n <span title={followersCount}>\n {shortenNumber(followersCount)}\n </span>{' '}\n <Trans>Followers</Trans>\n </LinkOrDiv>\n <LinkOrDiv\n class=\"insignificant\"\n tabIndex={0}\n to={accountLink}\n onClick={() => {\n // states.showAccount = false;\n setTimeout(() => {\n states.showGenericAccounts = {\n heading: t({\n id: 'following.stats',\n message: 'Following',\n }),\n fetchAccounts: fetchFollowing,\n instance,\n excludeRelationshipAttrs: isSelf ? ['following'] : [],\n blankCopy: hideCollections\n ? t`This user has chosen to not make this information available.`\n : undefined,\n };\n }, 0);\n }}\n >\n <span title={followingCount}>\n {shortenNumber(followingCount)}\n </span>{' '}\n <Trans id=\"following.stats\">Following</Trans>\n <br />\n </LinkOrDiv>\n <LinkOrDiv\n class=\"insignificant\"\n to={accountLink}\n // onClick={\n // standalone\n // ? undefined\n // : () => {\n // hideAllModals();\n // }\n // }\n >\n <span title={statusesCount}>\n {shortenNumber(statusesCount)}\n </span>{' '}\n <Trans>Posts</Trans>\n </LinkOrDiv>\n {!!createdAt && (\n <div class=\"insignificant\">\n <Trans>\n Joined{' '}\n <time datetime={createdAt}>\n {niceDateTime(createdAt, {\n hideTime: true,\n })}\n </time>\n </Trans>\n </div>\n )}\n </div>\n </div>\n {!!postingStats && (\n <LinkOrDiv\n to={accountLink}\n class=\"account-metadata-box\"\n // onClick={() => {\n // states.showAccount = false;\n // }}\n >\n <div class=\"shazam-container\">\n <div class=\"shazam-container-inner\">\n {hasPostingStats ? (\n <div\n class=\"posting-stats\"\n title={t`${(\n postingStats.originals / postingStats.total\n ).toLocaleString(i18n.locale || undefined, {\n style: 'percent',\n })} original posts, ${(\n postingStats.replies / postingStats.total\n ).toLocaleString(i18n.locale || undefined, {\n style: 'percent',\n })} replies, ${(\n postingStats.boosts / postingStats.total\n ).toLocaleString(i18n.locale || undefined, {\n style: 'percent',\n })} boosts`}\n >\n <div>\n {postingStats.daysSinceLastPost < 365\n ? plural(postingStats.total, {\n one: plural(postingStats.daysSinceLastPost, {\n one: `Last 1 post in the past 1 day`,\n other: `Last 1 post in the past ${postingStats.daysSinceLastPost} days`,\n }),\n other: plural(\n postingStats.daysSinceLastPost,\n {\n one: `Last ${postingStats.total} posts in the past 1 day`,\n other: `Last ${postingStats.total} posts in the past ${postingStats.daysSinceLastPost} days`,\n },\n ),\n })\n : plural(postingStats.total, {\n one: 'Last 1 post in the past year(s)',\n other: `Last ${postingStats.total} posts in the past year(s)`,\n })}\n </div>\n <div\n class=\"posting-stats-bar\"\n style={{\n // [originals | replies | boosts]\n '--originals-percentage': `${\n (postingStats.originals / postingStats.total) *\n 100\n }%`,\n '--replies-percentage': `${\n ((postingStats.originals +\n postingStats.replies) /\n postingStats.total) *\n 100\n }%`,\n }}\n />\n <div class=\"posting-stats-legends\">\n <span class=\"ib\">\n <span class=\"posting-stats-legend-item posting-stats-legend-item-originals\" />{' '}\n <Trans>Original</Trans>\n </span>{' '}\n <span class=\"ib\">\n <span class=\"posting-stats-legend-item posting-stats-legend-item-replies\" />{' '}\n <Trans>Replies</Trans>\n </span>{' '}\n <span class=\"ib\">\n <span class=\"posting-stats-legend-item posting-stats-legend-item-boosts\" />{' '}\n <Trans>Boosts</Trans>\n </span>\n </div>\n </div>\n ) : (\n <div class=\"posting-stats\">\n <Trans>Post stats unavailable.</Trans>\n </div>\n )}\n </div>\n </div>\n </LinkOrDiv>\n )}\n {!moved && (\n <div class=\"account-metadata-box\">\n <div\n class=\"shazam-container no-animation\"\n hidden={!!postingStats}\n >\n <div class=\"shazam-container-inner\">\n <button\n type=\"button\"\n class=\"posting-stats-button\"\n disabled={postingStatsUIState === 'loading'}\n onClick={() => {\n renderPostingStats();\n }}\n >\n <div\n class={`posting-stats-bar posting-stats-icon ${\n postingStatsUIState === 'loading' ? 'loading' : ''\n }`}\n style={{\n '--originals-percentage': '33%',\n '--replies-percentage': '66%',\n }}\n />\n <Trans>View post stats</Trans>{' '}\n {/* <Loader\n abrupt\n hidden={postingStatsUIState !== 'loading'}\n /> */}\n </button>\n </div>\n </div>\n </div>\n )}\n </main>\n <footer>\n <RelatedActions\n info={info}\n instance={instance}\n standalone={standalone}\n authenticated={authenticated}\n onRelationshipChange={onRelationshipChange}\n onProfileUpdate={onProfileUpdate}\n />\n </footer>\n </>\n )\n )}\n </div>\n );\n}\n\nconst FAMILIAR_FOLLOWERS_LIMIT = 3;\n\nfunction RelatedActions({\n info,\n instance,\n standalone,\n authenticated,\n onRelationshipChange = () => {},\n onProfileUpdate = () => {},\n}) {\n if (!info) return null;\n const { _ } = useLingui();\n const {\n masto: currentMasto,\n instance: currentInstance,\n authenticated: currentAuthenticated,\n } = api();\n const sameInstance = instance === currentInstance;\n\n const [relationshipUIState, setRelationshipUIState] = useState('default');\n const [relationship, setRelationship] = useState(null);\n\n const { id, acct, url, username, locked, lastStatusAt, note, fields, moved } =\n info;\n const accountID = useRef(id);\n\n const {\n following,\n showingReblogs,\n notifying,\n followedBy,\n blocking,\n blockedBy,\n muting,\n mutingNotifications,\n requested,\n domainBlocking,\n endorsed,\n note: privateNote,\n } = relationship || {};\n\n const [currentInfo, setCurrentInfo] = useState(null);\n const [isSelf, setIsSelf] = useState(false);\n\n const acctWithInstance = acct.includes('@') ? acct : `${acct}@${instance}`;\n\n useEffect(() => {\n if (info) {\n const currentAccount = getCurrentAccountID();\n let currentID;\n (async () => {\n if (sameInstance && authenticated) {\n currentID = id;\n } else if (!sameInstance && currentAuthenticated) {\n // Grab this account from my logged-in instance\n const acctHasInstance = info.acct.includes('@');\n try {\n const results = await currentMasto.v2.search.fetch({\n q: acctHasInstance ? info.acct : `${info.username}@${instance}`,\n type: 'accounts',\n limit: 1,\n resolve: true,\n });\n console.log('🥏 Fetched account from logged-in instance', results);\n if (results.accounts.length) {\n currentID = results.accounts[0].id;\n setCurrentInfo(results.accounts[0]);\n }\n } catch (e) {\n console.error(e);\n }\n }\n\n if (!currentID) return;\n\n if (currentAccount === currentID) {\n // It's myself!\n setIsSelf(true);\n return;\n }\n\n accountID.current = currentID;\n\n // if (moved) return;\n\n setRelationshipUIState('loading');\n\n const fetchRelationships = currentMasto.v1.accounts.relationships.fetch(\n {\n id: [currentID],\n },\n );\n\n try {\n const relationships = await fetchRelationships;\n console.log('fetched relationship', relationships);\n setRelationshipUIState('default');\n\n if (relationships.length) {\n const relationship = relationships[0];\n setRelationship(relationship);\n onRelationshipChange({ relationship, currentID });\n }\n } catch (e) {\n console.error(e);\n setRelationshipUIState('error');\n }\n })();\n }\n }, [info, authenticated]);\n\n useEffect(() => {\n if (info && isSelf) {\n updateAccount(info);\n }\n }, [info, isSelf]);\n\n const loading = relationshipUIState === 'loading';\n\n const [showTranslatedBio, setShowTranslatedBio] = useState(false);\n const [showAddRemoveLists, setShowAddRemoveLists] = useState(false);\n const [showPrivateNoteModal, setShowPrivateNoteModal] = useState(false);\n const [showEditProfile, setShowEditProfile] = useState(false);\n const [lists, setLists] = useState([]);\n\n return (\n <>\n <div class=\"actions\">\n <span>\n {followedBy ? (\n <span class=\"tag\">\n <Trans>Follows you</Trans>\n </span>\n ) : !!lastStatusAt ? (\n <small class=\"insignificant\">\n <Trans>\n Last post:{' '}\n <span class=\"ib\">\n {niceDateTime(lastStatusAt, {\n hideTime: true,\n })}\n </span>\n </Trans>\n </small>\n ) : (\n <span />\n )}\n {muting && (\n <span class=\"tag danger\">\n <Trans>Muted</Trans>\n </span>\n )}\n {blocking && (\n <span class=\"tag danger\">\n <Trans>Blocked</Trans>\n </span>\n )}\n </span>{' '}\n <span class=\"buttons\">\n {!!privateNote && (\n <button\n type=\"button\"\n class=\"private-note-tag\"\n title={t`Private note`}\n onClick={() => {\n setShowPrivateNoteModal(true);\n }}\n dir=\"auto\"\n >\n <span>{privateNote}</span>\n </button>\n )}\n <Menu2\n portal={{\n target: document.body,\n }}\n containerProps={{\n style: {\n // Higher than the backdrop\n zIndex: 1001,\n },\n }}\n align=\"center\"\n position=\"anchor\"\n overflow=\"auto\"\n menuButton={\n <button type=\"button\" class=\"plain\" disabled={loading}>\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n onMenuChange={(e) => {\n if (following && e.open) {\n // Fetch lists that have this account\n (async () => {\n try {\n const lists = await currentMasto.v1.accounts\n .$select(accountID.current)\n .lists.list();\n console.log('fetched account lists', lists);\n setLists(lists);\n } catch (e) {\n console.error(e);\n }\n })();\n }\n }}\n >\n {currentAuthenticated && !isSelf && (\n <>\n <MenuItem\n onClick={() => {\n showCompose({\n draftStatus: {\n status: `@${currentInfo?.acct || acct} `,\n },\n });\n }}\n >\n <Icon icon=\"at\" />\n <span>\n <Trans>\n Mention <span class=\"bidi-isolate\">@{username}</span>\n </Trans>\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n setShowTranslatedBio(true);\n }}\n >\n <Icon icon=\"translate\" />\n <span>\n <Trans>Translate bio</Trans>\n </span>\n </MenuItem>\n {supports('@mastodon/profile-private-note') && (\n <MenuItem\n onClick={() => {\n setShowPrivateNoteModal(true);\n }}\n >\n <Icon icon=\"pencil\" />\n <span>\n {privateNote ? t`Edit private note` : t`Add private note`}\n </span>\n </MenuItem>\n )}\n {following && !!relationship && (\n <>\n <MenuItem\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n const rel = await currentMasto.v1.accounts\n .$select(accountID.current)\n .follow({\n notify: !notifying,\n });\n if (rel) setRelationship(rel);\n setRelationshipUIState('default');\n showToast(\n rel.notifying\n ? t`Notifications enabled for @${username}'s posts.`\n : t` Notifications disabled for @${username}'s posts.`,\n );\n } catch (e) {\n alert(e);\n setRelationshipUIState('error');\n }\n })();\n }}\n >\n <Icon icon=\"notification\" />\n <span>\n {notifying\n ? t`Disable notifications`\n : t`Enable notifications`}\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n const rel = await currentMasto.v1.accounts\n .$select(accountID.current)\n .follow({\n reblogs: !showingReblogs,\n });\n if (rel) setRelationship(rel);\n setRelationshipUIState('default');\n showToast(\n rel.showingReblogs\n ? t`Boosts from @${username} enabled.`\n : t`Boosts from @${username} disabled.`,\n );\n } catch (e) {\n alert(e);\n setRelationshipUIState('error');\n }\n })();\n }}\n >\n <Icon icon=\"rocket\" />\n <span>\n {showingReblogs ? t`Disable boosts` : t`Enable boosts`}\n </span>\n </MenuItem>\n </>\n )}\n {/* Add/remove from lists is only possible if following the account */}\n {following && (\n <MenuItem\n onClick={() => {\n setShowAddRemoveLists(true);\n }}\n >\n <Icon icon=\"list\" />\n {lists.length ? (\n <>\n <small class=\"menu-grow\">\n <Trans>Add/Remove from Lists</Trans>\n <br />\n <span class=\"more-insignificant\">\n {lists.map((list) => list.title).join(', ')}\n </span>\n </small>\n <small class=\"more-insignificant\">{lists.length}</small>\n </>\n ) : (\n <span>\n <Trans>Add/Remove from Lists</Trans>\n </span>\n )}\n </MenuItem>\n )}\n <MenuDivider />\n </>\n )}\n <MenuItem\n onClick={() => {\n const handle = `@${currentInfo?.acct || acctWithInstance}`;\n try {\n navigator.clipboard.writeText(handle);\n showToast(t`Handle copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy handle`);\n }\n }}\n >\n <Icon icon=\"copy\" />\n <small>\n <Trans>Copy handle</Trans>\n <br />\n <span class=\"more-insignificant bidi-isolate\">\n @{currentInfo?.acct || acctWithInstance}\n </span>\n </small>\n </MenuItem>\n <MenuItem href={url} target=\"_blank\">\n <Icon icon=\"external\" />\n <small class=\"menu-double-lines\">{niceAccountURL(url)}</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 {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 {!!relationship && (\n <>\n <MenuDivider />\n {muting ? (\n <MenuItem\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n const newRelationship = await currentMasto.v1.accounts\n .$select(currentInfo?.id || id)\n .unmute();\n console.log('unmuting', newRelationship);\n setRelationship(newRelationship);\n setRelationshipUIState('default');\n showToast(t`Unmuted @${username}`);\n states.reloadGenericAccounts.id = 'mute';\n states.reloadGenericAccounts.counter++;\n } catch (e) {\n console.error(e);\n setRelationshipUIState('error');\n }\n })();\n }}\n >\n <Icon icon=\"unmute\" />\n <span>\n <Trans>\n Unmute <span class=\"bidi-isolate\">@{username}</span>\n </Trans>\n </span>\n </MenuItem>\n ) : (\n <SubMenu2\n menuClassName=\"menu-blur\"\n openTrigger=\"clickOnly\"\n direction=\"bottom\"\n overflow=\"auto\"\n shift={16}\n label={\n <>\n <Icon icon=\"mute\" />\n <span class=\"menu-grow\">\n <Trans>\n Mute <span class=\"bidi-isolate\">@{username}</span>…\n </Trans>\n </span>\n <span\n style={{\n textOverflow: 'clip',\n }}\n >\n <Icon icon=\"time\" />\n <Icon icon=\"chevron-right\" />\n </span>\n </>\n }\n >\n <div class=\"menu-wrap\">\n {MUTE_DURATIONS.map((duration) => (\n <MenuItem\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n const newRelationship =\n await currentMasto.v1.accounts\n .$select(currentInfo?.id || id)\n .mute({\n duration,\n });\n console.log('muting', newRelationship);\n setRelationship(newRelationship);\n setRelationshipUIState('default');\n showToast(\n t`Muted @${username} for ${\n typeof MUTE_DURATIONS_LABELS[duration] ===\n 'function'\n ? MUTE_DURATIONS_LABELS[duration]()\n : _(MUTE_DURATIONS_LABELS[duration])\n }`,\n );\n states.reloadGenericAccounts.id = 'mute';\n states.reloadGenericAccounts.counter++;\n } catch (e) {\n console.error(e);\n setRelationshipUIState('error');\n showToast(t`Unable to mute @${username}`);\n }\n })();\n }}\n >\n {typeof MUTE_DURATIONS_LABELS[duration] === 'function'\n ? MUTE_DURATIONS_LABELS[duration]()\n : _(MUTE_DURATIONS_LABELS[duration])}\n </MenuItem>\n ))}\n </div>\n </SubMenu2>\n )}\n {followedBy && (\n <MenuConfirm\n subMenu\n menuItemClassName=\"danger\"\n confirmLabel={\n <>\n <Icon icon=\"user-x\" />\n <span>\n <Trans>\n Remove <span class=\"bidi-isolate\">@{username}</span>{' '}\n from followers?\n </Trans>\n </span>\n </>\n }\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n const newRelationship = await currentMasto.v1.accounts\n .$select(currentInfo?.id || id)\n .removeFromFollowers();\n console.log(\n 'removing from followers',\n newRelationship,\n );\n setRelationship(newRelationship);\n setRelationshipUIState('default');\n showToast(t`@${username} removed from followers`);\n states.reloadGenericAccounts.id = 'followers';\n states.reloadGenericAccounts.counter++;\n } catch (e) {\n console.error(e);\n setRelationshipUIState('error');\n }\n })();\n }}\n >\n <Icon icon=\"user-x\" />\n <span>\n <Trans>Remove follower…</Trans>\n </span>\n </MenuConfirm>\n )}\n <MenuConfirm\n subMenu\n confirm={!blocking}\n confirmLabel={\n <>\n <Icon icon=\"block\" />\n <span>\n <Trans>\n Block <span class=\"bidi-isolate\">@{username}</span>?\n </Trans>\n </span>\n </>\n }\n itemProps={{\n className: 'danger',\n }}\n menuItemClassName=\"danger\"\n onClick={() => {\n // if (!blocking && !confirm(`Block @${username}?`)) {\n // return;\n // }\n setRelationshipUIState('loading');\n (async () => {\n try {\n if (blocking) {\n const newRelationship = await currentMasto.v1.accounts\n .$select(currentInfo?.id || id)\n .unblock();\n console.log('unblocking', newRelationship);\n setRelationship(newRelationship);\n setRelationshipUIState('default');\n showToast(t`Unblocked @${username}`);\n } else {\n const newRelationship = await currentMasto.v1.accounts\n .$select(currentInfo?.id || id)\n .block();\n console.log('blocking', newRelationship);\n setRelationship(newRelationship);\n setRelationshipUIState('default');\n showToast(t`Blocked @${username}`);\n }\n states.reloadGenericAccounts.id = 'block';\n states.reloadGenericAccounts.counter++;\n } catch (e) {\n console.error(e);\n setRelationshipUIState('error');\n if (blocking) {\n showToast(t`Unable to unblock @${username}`);\n } else {\n showToast(t`Unable to block @${username}`);\n }\n }\n })();\n }}\n >\n {blocking ? (\n <>\n <Icon icon=\"unblock\" />\n <span>\n <Trans>\n Unblock <span class=\"bidi-isolate\">@{username}</span>\n </Trans>\n </span>\n </>\n ) : (\n <>\n <Icon icon=\"block\" />\n <span>\n <Trans>\n Block <span class=\"bidi-isolate\">@{username}</span>…\n </Trans>\n </span>\n </>\n )}\n </MenuConfirm>\n <MenuItem\n className=\"danger\"\n onClick={() => {\n states.showReportModal = {\n account: currentInfo || info,\n };\n }}\n >\n <Icon icon=\"flag\" />\n <span>\n <Trans>\n Report <span class=\"bidi-isolate\">@{username}</span>…\n </Trans>\n </span>\n </MenuItem>\n </>\n )}\n {currentAuthenticated &&\n isSelf &&\n standalone &&\n supports('@mastodon/profile-edit') && (\n <>\n <MenuDivider />\n <MenuItem\n onClick={() => {\n setShowEditProfile(true);\n }}\n >\n <Icon icon=\"pencil\" />\n <span>\n <Trans>Edit profile</Trans>\n </span>\n </MenuItem>\n </>\n )}\n {import.meta.env.DEV && currentAuthenticated && isSelf && (\n <>\n <MenuDivider />\n <MenuItem\n onClick={async () => {\n const relationships =\n await currentMasto.v1.accounts.relationships.fetch({\n id: [accountID.current],\n });\n const { note } = relationships[0] || {};\n if (note) {\n alert(note);\n console.log(note);\n }\n }}\n >\n <Icon icon=\"pencil\" />\n <span>See note</span>\n </MenuItem>\n </>\n )}\n </Menu2>\n {!relationship && relationshipUIState === 'loading' && (\n <Loader abrupt />\n )}\n {!!relationship && !moved && (\n <MenuConfirm\n confirm={following || requested}\n confirmLabel={\n <span>\n {requested\n ? t`Withdraw follow request?`\n : t`Unfollow @${info.acct || info.username}?`}\n </span>\n }\n menuItemClassName=\"danger\"\n align=\"end\"\n disabled={loading}\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n let newRelationship;\n\n if (following || requested) {\n // const yes = confirm(\n // requested\n // ? 'Withdraw follow request?'\n // : `Unfollow @${info.acct || info.username}?`,\n // );\n\n // if (yes) {\n newRelationship = await currentMasto.v1.accounts\n .$select(accountID.current)\n .unfollow();\n // }\n } else {\n newRelationship = await currentMasto.v1.accounts\n .$select(accountID.current)\n .follow();\n }\n\n if (newRelationship) setRelationship(newRelationship);\n setRelationshipUIState('default');\n } catch (e) {\n alert(e);\n setRelationshipUIState('error');\n }\n })();\n }}\n >\n <button\n type=\"button\"\n class={`${following || requested ? 'light swap' : ''}`}\n data-swap-state={following || requested ? 'danger' : ''}\n disabled={loading}\n >\n {following ? (\n <>\n <span>\n <Trans>Following</Trans>\n </span>\n <span>\n <Trans>Unfollow…</Trans>\n </span>\n </>\n ) : requested ? (\n <>\n <span>\n <Trans>Requested</Trans>\n </span>\n <span>\n <Trans>Withdraw…</Trans>\n </span>\n </>\n ) : locked ? (\n <>\n <Icon icon=\"lock\" />{' '}\n <span>\n <Trans>Follow</Trans>\n </span>\n </>\n ) : (\n t`Follow`\n )}\n </button>\n </MenuConfirm>\n )}\n </span>\n </div>\n {!!showTranslatedBio && (\n <Modal\n onClose={() => {\n setShowTranslatedBio(false);\n }}\n >\n <TranslatedBioSheet\n note={note}\n fields={fields}\n onClose={() => setShowTranslatedBio(false)}\n />\n </Modal>\n )}\n {!!showAddRemoveLists && (\n <Modal\n onClose={() => {\n setShowAddRemoveLists(false);\n }}\n >\n <AddRemoveListsSheet\n accountID={accountID.current}\n onClose={() => setShowAddRemoveLists(false)}\n />\n </Modal>\n )}\n {!!showPrivateNoteModal && (\n <Modal\n onClose={() => {\n setShowPrivateNoteModal(false);\n }}\n >\n <PrivateNoteSheet\n account={info}\n note={privateNote}\n onRelationshipChange={(relationship) => {\n setRelationship(relationship);\n // onRelationshipChange({ relationship, currentID: accountID.current });\n }}\n onClose={() => setShowPrivateNoteModal(false)}\n />\n </Modal>\n )}\n {!!showEditProfile && (\n <Modal\n onClose={() => {\n setShowEditProfile(false);\n }}\n >\n <EditProfileSheet\n onClose={({ state, account } = {}) => {\n setShowEditProfile(false);\n if (state === 'success' && account) {\n onProfileUpdate(account);\n }\n }}\n />\n </Modal>\n )}\n </>\n );\n}\n\n// Apply more alpha if high luminence\nfunction lightenRGB([r, g, b]) {\n const luminence = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n console.log('luminence', luminence);\n let alpha;\n if (luminence >= 220) {\n alpha = 1;\n } else if (luminence <= 50) {\n alpha = 0.1;\n } else {\n alpha = luminence / 255;\n }\n alpha = Math.min(1, alpha);\n return [r, g, b, alpha];\n}\n\nfunction niceAccountURL(url) {\n if (!url) return;\n const urlObj = URL.parse(url);\n const { host, pathname } = urlObj;\n const path = pathname.replace(/\\/$/, '').replace(/^\\//, '');\n return (\n <>\n <span class=\"more-insignificant\">{punycode.toUnicode(host)}/</span>\n <wbr />\n <span>{path}</span>\n </>\n );\n}\n\nfunction TranslatedBioSheet({ note, fields, onClose }) {\n const fieldsText =\n fields\n ?.map(({ name, value }) => `${name}\\n${getHTMLText(value)}`)\n .join('\\n\\n') || '';\n\n const text = getHTMLText(note) + (fieldsText ? `\\n\\n${fieldsText}` : '');\n\n return (\n <div 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>Translated Bio</Trans>\n </h2>\n </header>\n <main>\n <p\n style={{\n whiteSpace: 'pre-wrap',\n }}\n >\n {text}\n </p>\n <TranslationBlock forceTranslate text={text} />\n </main>\n </div>\n );\n}\n\nfunction AddRemoveListsSheet({ accountID, onClose }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [lists, setLists] = useState([]);\n const [listsContainingAccount, setListsContainingAccount] = useState([]);\n const [reloadCount, reload] = useReducer((c) => c + 1, 0);\n\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const lists = await getLists();\n setLists(lists);\n const listsContainingAccount = await masto.v1.accounts\n .$select(accountID)\n .lists.list();\n console.log({ lists, listsContainingAccount });\n setListsContainingAccount(listsContainingAccount);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, [reloadCount]);\n\n const [showListAddEditModal, setShowListAddEditModal] = useState(false);\n\n return (\n <div class=\"sheet\" id=\"list-add-remove-container\">\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>Add/Remove from Lists</Trans>\n </h2>\n </header>\n <main>\n {lists.length > 0 ? (\n <ul class=\"list-add-remove\">\n {lists.map((list) => {\n const inList = listsContainingAccount.some(\n (l) => l.id === list.id,\n );\n return (\n <li>\n <button\n type=\"button\"\n class={`light ${inList ? 'checked' : ''}`}\n disabled={uiState === 'loading'}\n onClick={() => {\n setUIState('loading');\n (async () => {\n try {\n if (inList) {\n await masto.v1.lists\n .$select(list.id)\n .accounts.remove({\n accountIds: [accountID],\n });\n } else {\n await masto.v1.lists\n .$select(list.id)\n .accounts.create({\n accountIds: [accountID],\n });\n }\n // setUIState('default');\n reload();\n } catch (e) {\n console.error(e);\n setUIState('error');\n alert(\n inList\n ? t`Unable to remove from list.`\n : t`Unable to add to list.`,\n );\n }\n })();\n }}\n >\n <Icon icon=\"check-circle\" alt=\"☑️\" />\n <span>{list.title}</span>\n </button>\n </li>\n );\n })}\n </ul>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Unable to load lists.</Trans>\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No lists.</Trans>\n </p>\n )}\n <button\n type=\"button\"\n class=\"plain2\"\n onClick={() => setShowListAddEditModal(true)}\n disabled={uiState !== 'default'}\n >\n <Icon icon=\"plus\" size=\"l\" />{' '}\n <span>\n <Trans>New list</Trans>\n </span>\n </button>\n </main>\n {showListAddEditModal && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowListAddEditModal(false);\n }\n }}\n >\n <ListAddEdit\n list={showListAddEditModal?.list}\n onClose={(result) => {\n if (result.state === 'success') {\n reload();\n }\n setShowListAddEditModal(false);\n }}\n />\n </Modal>\n )}\n </div>\n );\n}\n\nfunction PrivateNoteSheet({\n account,\n note: initialNote,\n onRelationshipChange = () => {},\n onClose = () => {},\n}) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const textareaRef = useRef(null);\n\n useEffect(() => {\n let timer;\n if (textareaRef.current && !initialNote) {\n timer = setTimeout(() => {\n textareaRef.current.focus?.();\n }, 100);\n }\n return () => {\n clearTimeout(timer);\n };\n }, []);\n\n return (\n <div class=\"sheet\" id=\"private-note-container\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <b>\n <Trans>\n Private note about{' '}\n <span class=\"bidi-isolate\">\n @{account?.username || account?.acct}\n </span>\n </Trans>\n </b>\n </header>\n <main>\n <form\n onSubmit={(e) => {\n e.preventDefault();\n const formData = new FormData(e.target);\n const note = formData.get('note');\n if (note?.trim() !== initialNote?.trim()) {\n setUIState('loading');\n (async () => {\n try {\n const newRelationship = await masto.v1.accounts\n .$select(account?.id)\n .note.create({\n comment: note,\n });\n console.log('updated relationship', newRelationship);\n setUIState('default');\n onRelationshipChange(newRelationship);\n onClose();\n } catch (e) {\n console.error(e);\n setUIState('error');\n alert(e?.message || t`Unable to update private note.`);\n }\n })();\n }\n }}\n >\n <textarea\n ref={textareaRef}\n name=\"note\"\n disabled={uiState === 'loading'}\n dir=\"auto\"\n >\n {initialNote}\n </textarea>\n <footer>\n <button\n type=\"button\"\n class=\"light\"\n disabled={uiState === 'loading'}\n onClick={() => {\n onClose?.();\n }}\n >\n <Trans>Cancel</Trans>\n </button>\n <span>\n <Loader abrupt hidden={uiState !== 'loading'} />\n <button disabled={uiState === 'loading'} type=\"submit\">\n <Trans>Save & close</Trans>\n </button>\n </span>\n </footer>\n </form>\n </main>\n </div>\n );\n}\n\nfunction EditProfileSheet({ onClose = () => {} }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('loading');\n const [account, setAccount] = useState(null);\n\n useEffect(() => {\n (async () => {\n try {\n const acc = await masto.v1.accounts.verifyCredentials();\n setAccount(acc);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, []);\n\n console.log('EditProfileSheet', account);\n const { displayName, source } = account || {};\n const { note, fields } = source || {};\n const fieldsAttributesRef = useRef(null);\n\n return (\n <div class=\"sheet\" id=\"edit-profile-container\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <b>\n <Trans>Edit profile</Trans>\n </b>\n </header>\n <main>\n {uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n <form\n onSubmit={(e) => {\n e.preventDefault();\n const formData = new FormData(e.target);\n const displayName = formData.get('display_name');\n const note = formData.get('note');\n const fieldsAttributesFields =\n fieldsAttributesRef.current.querySelectorAll(\n 'input[name^=\"fields_attributes\"]',\n );\n const fieldsAttributes = [];\n fieldsAttributesFields.forEach((field) => {\n const name = field.name;\n const [_, index, key] =\n name.match(/fields_attributes\\[(\\d+)\\]\\[(.+)\\]/) || [];\n const value = field.value ? field.value.trim() : '';\n if (index && key && value) {\n if (!fieldsAttributes[index]) fieldsAttributes[index] = {};\n fieldsAttributes[index][key] = value;\n }\n });\n // Fill in the blanks\n fieldsAttributes.forEach((field) => {\n if (field.name && !field.value) {\n field.value = '';\n }\n });\n\n (async () => {\n try {\n const newAccount = await masto.v1.accounts.updateCredentials({\n displayName,\n note,\n fieldsAttributes,\n });\n console.log('updated account', newAccount);\n onClose?.({\n state: 'success',\n account: newAccount,\n });\n } catch (e) {\n console.error(e);\n alert(e?.message || t`Unable to update profile.`);\n }\n })();\n }}\n >\n <p>\n <label>\n <Trans>Name</Trans>{' '}\n <input\n type=\"text\"\n name=\"display_name\"\n defaultValue={displayName}\n maxLength={30}\n disabled={uiState === 'loading'}\n dir=\"auto\"\n />\n </label>\n </p>\n <p>\n <label>\n <Trans>Bio</Trans>\n <textarea\n defaultValue={note}\n name=\"note\"\n maxLength={500}\n rows=\"5\"\n disabled={uiState === 'loading'}\n dir=\"auto\"\n />\n </label>\n </p>\n {/* Table for fields; name and values are in fields, min 4 rows */}\n <p>\n <Trans>Extra fields</Trans>\n </p>\n <table ref={fieldsAttributesRef}>\n <thead>\n <tr>\n <th>\n <Trans>Label</Trans>\n </th>\n <th>\n <Trans>Content</Trans>\n </th>\n </tr>\n </thead>\n <tbody>\n {Array.from({ length: Math.max(4, fields.length) }).map(\n (_, i) => {\n const { name = '', value = '' } = fields[i] || {};\n return (\n <FieldsAttributesRow\n key={i}\n name={name}\n value={value}\n index={i}\n disabled={uiState === 'loading'}\n />\n );\n },\n )}\n </tbody>\n </table>\n <footer>\n <button\n type=\"button\"\n class=\"light\"\n disabled={uiState === 'loading'}\n onClick={() => {\n onClose?.();\n }}\n >\n <Trans>Cancel</Trans>\n </button>\n <button type=\"submit\" disabled={uiState === 'loading'}>\n <Trans>Save</Trans>\n </button>\n </footer>\n </form>\n )}\n </main>\n </div>\n );\n}\n\nfunction FieldsAttributesRow({ name, value, disabled, index: i }) {\n const [hasValue, setHasValue] = useState(!!value);\n return (\n <tr>\n <td>\n <input\n type=\"text\"\n name={`fields_attributes[${i}][name]`}\n defaultValue={name}\n disabled={disabled}\n maxLength={255}\n required={hasValue}\n dir=\"auto\"\n />\n </td>\n <td>\n <input\n type=\"text\"\n name={`fields_attributes[${i}][value]`}\n defaultValue={value}\n disabled={disabled}\n maxLength={255}\n onChange={(e) => setHasValue(!!e.currentTarget.value)}\n dir=\"auto\"\n />\n </td>\n </tr>\n );\n}\n\nfunction AccountHandleInfo({ acct, instance }) {\n // acct = username or username@server\n let [username, server] = acct.split('@');\n if (!server) server = instance;\n const encodedAcct = punycode.toASCII(acct);\n return (\n <div class=\"handle-info\">\n <span class=\"handle-handle\" title={encodedAcct}>\n <b class=\"handle-username\">{username}</b>\n <span class=\"handle-at\">@</span>\n <b class=\"handle-server\">{server}</b>\n </span>\n <div class=\"handle-legend\">\n <span class=\"ib\">\n <span class=\"handle-legend-icon username\" /> <Trans>username</Trans>\n </span>{' '}\n <span class=\"ib\">\n <span class=\"handle-legend-icon server\" />{' '}\n <Trans>server domain name</Trans>\n </span>\n </div>\n </div>\n );\n}\n\nexport default AccountInfo;\n","import { t } from '@lingui/macro';\nimport { useEffect } from 'preact/hooks';\n\nimport { api } from '../utils/api';\nimport states from '../utils/states';\nimport useLocationChange from '../utils/useLocationChange';\n\nimport AccountInfo from './account-info';\nimport Icon from './icon';\n\nfunction AccountSheet({ account, instance: propInstance, onClose }) {\n const { masto, instance, authenticated } = api({ instance: propInstance });\n const isString = typeof account === 'string';\n\n useEffect(() => {\n if (!isString) {\n states.accounts[`${account.id}@${instance}`] = account;\n }\n }, [account]);\n\n useLocationChange(onClose);\n\n return (\n <div\n class=\"sheet\"\n // onClick={(e) => {\n // const accountBlock = e.target.closest('.account-block');\n // if (accountBlock) {\n // onClose({\n // destination: 'account-statuses',\n // });\n // }\n // }}\n >\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close outer\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <AccountInfo\n instance={instance}\n authenticated={authenticated}\n account={account}\n fetchAccount={async () => {\n if (isString) {\n try {\n const info = await masto.v1.accounts.lookup({\n acct: account,\n skip_webfinger: false,\n });\n return info;\n } catch (e) {\n const result = await masto.v2.search.fetch({\n q: account,\n type: 'accounts',\n limit: 1,\n resolve: authenticated,\n });\n if (result.accounts.length) {\n return result.accounts[0];\n } else if (/https?:\\/\\/[^/]+\\/@/.test(account)) {\n const accountURL = URL.parse(account);\n const { hostname, pathname } = accountURL;\n const acct =\n pathname.replace(/^\\//, '').replace(/\\/$/, '') +\n '@' +\n hostname;\n const result = await masto.v2.search.fetch({\n q: acct,\n type: 'accounts',\n limit: 1,\n resolve: authenticated,\n });\n if (result.accounts.length) {\n return result.accounts[0];\n }\n }\n }\n } else {\n return account;\n }\n }}\n />\n </div>\n );\n}\n\nexport default AccountSheet;\n","import './drafts.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { useEffect, useMemo, useReducer, useState } from 'react';\n\nimport { api } from '../utils/api';\nimport db from '../utils/db';\nimport niceDateTime from '../utils/nice-date-time';\nimport states from '../utils/states';\nimport { getCurrentAccountNS } from '../utils/store-utils';\n\nimport Icon from './icon';\nimport Loader from './loader';\nimport MenuConfirm from './menu-confirm';\n\nfunction Drafts({ onClose }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [drafts, setDrafts] = useState([]);\n const [reloadCount, reload] = useReducer((c) => c + 1, 0);\n\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const keys = await db.drafts.keys();\n if (keys.length) {\n const ns = getCurrentAccountNS();\n const ownKeys = keys.filter((key) => key.startsWith(ns));\n if (ownKeys.length) {\n const drafts = await db.drafts.getMany(ownKeys);\n drafts.sort(\n (a, b) =>\n new Date(b.updatedAt).getTime() -\n new Date(a.updatedAt).getTime(),\n );\n setDrafts(drafts);\n } else {\n setDrafts([]);\n }\n } else {\n setDrafts([]);\n }\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, [reloadCount]);\n\n const hasDrafts = drafts?.length > 0;\n\n return (\n <div 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>Unsent drafts</Trans>{' '}\n <Loader abrupt hidden={uiState !== 'loading'} />\n </h2>\n {hasDrafts && (\n <div class=\"insignificant\">\n <Trans>\n Looks like you have unsent drafts. Let's continue where you left\n off.\n </Trans>\n </div>\n )}\n </header>\n <main>\n {hasDrafts ? (\n <>\n <ul class=\"drafts-list\">\n {drafts.map((draft) => {\n const { updatedAt, key, draftStatus, replyTo } = draft;\n const updatedAtDate = new Date(updatedAt);\n return (\n <li key={updatedAt}>\n <div class=\"mini-draft-meta\">\n <b>\n <Icon icon={replyTo ? 'reply' : 'quill'} size=\"s\" />{' '}\n <time>\n {!!replyTo && (\n <>\n <span class=\"bidi-isolate\">\n @{replyTo.account.acct}\n </span>\n <br />\n </>\n )}\n {niceDateTime(updatedAtDate)}\n </time>\n </b>\n <MenuConfirm\n confirmLabel={\n <span>\n <Trans>Delete this draft?</Trans>\n </span>\n }\n menuItemClassName=\"danger\"\n align=\"end\"\n disabled={uiState === 'loading'}\n onClick={() => {\n (async () => {\n try {\n // const yes = confirm('Delete this draft?');\n // if (yes) {\n await db.drafts.del(key);\n reload();\n // }\n } catch (e) {\n alert(t`Error deleting draft! Please try again.`);\n }\n })();\n }}\n >\n <button\n type=\"button\"\n class=\"small light\"\n disabled={uiState === 'loading'}\n >\n <Trans>Delete…</Trans>\n </button>\n </MenuConfirm>\n </div>\n <button\n type=\"button\"\n disabled={uiState === 'loading'}\n class=\"draft-item\"\n onClick={async () => {\n // console.log({ draftStatus });\n let replyToStatus;\n if (replyTo) {\n setUIState('loading');\n try {\n replyToStatus = await masto.v1.statuses\n .$select(replyTo.id)\n .fetch();\n } catch (e) {\n console.error(e);\n alert(t`Error fetching reply-to status!`);\n setUIState('default');\n return;\n }\n setUIState('default');\n }\n window.__COMPOSE__ = {\n draftStatus,\n replyToStatus,\n };\n states.showCompose = true;\n states.showDrafts = false;\n }}\n >\n <MiniDraft draft={draft} />\n </button>\n </li>\n );\n })}\n </ul>\n {drafts.length > 1 && (\n <p>\n <MenuConfirm\n confirmLabel={\n <span>\n <Trans>Delete all drafts?</Trans>\n </span>\n }\n menuItemClassName=\"danger\"\n disabled={uiState === 'loading'}\n onClick={() => {\n (async () => {\n // const yes = confirm('Delete all drafts?');\n // if (yes) {\n setUIState('loading');\n try {\n await db.drafts.delMany(\n drafts.map((draft) => draft.key),\n );\n setUIState('default');\n reload();\n } catch (e) {\n console.error(e);\n alert(t`Error deleting drafts! Please try again.`);\n setUIState('error');\n }\n // }\n })();\n }}\n >\n <button\n type=\"button\"\n class=\"light danger\"\n disabled={uiState === 'loading'}\n >\n <Trans>Delete all…</Trans>\n </button>\n </MenuConfirm>\n </p>\n )}\n </>\n ) : (\n <p>\n <Trans>No drafts found.</Trans>\n </p>\n )}\n </main>\n </div>\n );\n}\n\nfunction MiniDraft({ draft }) {\n const { draftStatus, replyTo } = draft;\n const { status, spoilerText, poll, mediaAttachments } = draftStatus;\n const hasPoll = poll?.options?.length > 0;\n const hasMedia = mediaAttachments?.length > 0;\n const hasPollOrMedia = hasPoll || hasMedia;\n const firstImageMedia = useMemo(() => {\n if (!hasMedia) return;\n const image = mediaAttachments.find((media) => /image/.test(media.type));\n if (!image) return;\n const { file } = image;\n const objectURL = URL.createObjectURL(file);\n return objectURL;\n }, [hasMedia, mediaAttachments]);\n return (\n <>\n <div class=\"mini-draft\">\n {hasPollOrMedia && (\n <div\n class={`mini-draft-aside ${firstImageMedia ? 'has-image' : ''}`}\n style={\n firstImageMedia\n ? {\n '--bg-image': `url(${firstImageMedia})`,\n }\n : {}\n }\n >\n {hasPoll && <Icon icon=\"poll\" alt={t`Poll`} />}\n {hasMedia && (\n <span>\n <Icon icon=\"attachment\" alt={t`Media`} />{' '}\n <small>{mediaAttachments?.length}</small>\n </span>\n )}\n </div>\n )}\n <div class=\"mini-draft-main\">\n {!!spoilerText && <div class=\"mini-draft-spoiler\">{spoilerText}</div>}\n {!!status && <div class=\"mini-draft-status\">{status}</div>}\n </div>\n </div>\n </>\n );\n}\n\nexport default Drafts;\n","import './embed-modal.css';\n\nimport { t, Trans } from '@lingui/macro';\n\nimport Icon from './icon';\n\nfunction EmbedModal({ html, url, width, height, onClose = () => {} }) {\n return (\n <div class=\"embed-modal-container\">\n <div class=\"top-controls\">\n <button type=\"button\" class=\"light\" onClick={() => onClose()}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n {url && (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"button plain\"\n >\n <span>\n <Trans>Open in new window</Trans>\n </span>{' '}\n <Icon icon=\"external\" />\n </a>\n )}\n </div>\n <div\n class=\"embed-content\"\n dangerouslySetInnerHTML={{ __html: html }}\n style={{\n '--width': width + 'px',\n '--height': height + 'px',\n '--aspect-ratio': `${width}/${height}`,\n }}\n />\n </div>\n );\n}\n\nexport default EmbedModal;\n","import './generic-accounts.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { InView } from 'react-intersection-observer';\nimport { useSnapshot } from 'valtio';\n\nimport { api } from '../utils/api';\nimport { fetchRelationships } from '../utils/relationships';\nimport states from '../utils/states';\nimport useLocationChange from '../utils/useLocationChange';\n\nimport AccountBlock from './account-block';\nimport Icon from './icon';\nimport Link from './link';\nimport Loader from './loader';\nimport Status from './status';\n\nexport default function GenericAccounts({\n instance,\n excludeRelationshipAttrs = [],\n postID,\n onClose = () => {},\n blankCopy = t`Nothing to show`,\n}) {\n const { masto, instance: currentInstance } = api();\n const isCurrentInstance = instance ? instance === currentInstance : true;\n const snapStates = useSnapshot(states);\n ``;\n const [uiState, setUIState] = useState('default');\n const [accounts, setAccounts] = useState([]);\n const [showMore, setShowMore] = useState(false);\n\n useLocationChange(onClose);\n\n if (!snapStates.showGenericAccounts) {\n return null;\n }\n\n const {\n id,\n heading,\n fetchAccounts,\n accounts: staticAccounts,\n showReactions,\n } = snapStates.showGenericAccounts;\n\n const [relationshipsMap, setRelationshipsMap] = useState({});\n\n const loadRelationships = async (accounts) => {\n if (!accounts?.length) return;\n if (!isCurrentInstance) return;\n const relationships = await fetchRelationships(accounts, relationshipsMap);\n if (relationships) {\n setRelationshipsMap({\n ...relationshipsMap,\n ...relationships,\n });\n }\n };\n\n const loadAccounts = (firstLoad) => {\n if (!fetchAccounts) return;\n if (firstLoad) setAccounts([]);\n setUIState('loading');\n (async () => {\n try {\n const { done, value } = await fetchAccounts(firstLoad);\n if (Array.isArray(value)) {\n if (firstLoad) {\n const accounts = [];\n for (let i = 0; i < value.length; i++) {\n const account = value[i];\n const theAccount = accounts.find(\n (a, j) => a.id === account.id && i !== j,\n );\n if (!theAccount) {\n accounts.push({\n _types: [],\n ...account,\n });\n } else {\n theAccount._types.push(...account._types);\n }\n }\n setAccounts(accounts);\n } else {\n // setAccounts((prev) => [...prev, ...value]);\n // Merge accounts by id and _types\n setAccounts((prev) => {\n const newAccounts = prev;\n for (const account of value) {\n const theAccount = newAccounts.find((a) => a.id === account.id);\n if (!theAccount) {\n newAccounts.push(account);\n } else {\n theAccount._types.push(...account._types);\n }\n }\n return newAccounts;\n });\n }\n setShowMore(!done);\n\n loadRelationships(value);\n } else {\n setShowMore(false);\n }\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n };\n\n const firstLoad = useRef(true);\n useEffect(() => {\n if (staticAccounts?.length > 0) {\n setAccounts(staticAccounts);\n loadRelationships(staticAccounts);\n } else {\n loadAccounts(true);\n firstLoad.current = false;\n }\n }, [staticAccounts, fetchAccounts]);\n\n useEffect(() => {\n if (firstLoad.current) return;\n // reloadGenericAccounts contains value like {id: 'mute', counter: 1}\n // We only need to reload if the id matches\n if (snapStates.reloadGenericAccounts?.id === id) {\n loadAccounts(true);\n }\n }, [snapStates.reloadGenericAccounts.counter]);\n\n const post = states.statuses[postID];\n\n return (\n <div id=\"generic-accounts-container\" class=\"sheet\" tabindex=\"-1\">\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <h2>{heading || t`Accounts`}</h2>\n </header>\n <main>\n {post && (\n <Link\n to={`/${instance || currentInstance}/s/${post.id}`}\n class=\"post-preview\"\n >\n <Status status={post} size=\"s\" readOnly />\n </Link>\n )}\n {accounts.length > 0 ? (\n <>\n <ul class=\"accounts-list\">\n {accounts.map((account) => {\n const relationship = relationshipsMap[account.id];\n const key = `${account.id}-${account._types?.length || ''}`;\n return (\n <li key={key}>\n {showReactions && account._types?.length > 0 && (\n <div class=\"reactions-block\">\n {account._types.map((type) => (\n <Icon\n icon={\n {\n reblog: 'rocket',\n favourite: 'heart',\n }[type]\n }\n class={`${type}-icon`}\n />\n ))}\n </div>\n )}\n <div class=\"account-relationships\">\n <AccountBlock\n account={account}\n showStats\n relationship={relationship}\n excludeRelationshipAttrs={excludeRelationshipAttrs}\n />\n </div>\n </li>\n );\n })}\n </ul>\n {uiState === 'default' ? (\n showMore ? (\n <InView\n onChange={(inView) => {\n if (inView) {\n loadAccounts();\n }\n }}\n >\n <button\n type=\"button\"\n class=\"plain block\"\n onClick={() => loadAccounts()}\n >\n <Trans>Show more…</Trans>\n </button>\n </InView>\n ) : (\n <p class=\"ui-state insignificant\">\n <Trans>The end.</Trans>\n </p>\n )\n ) : (\n uiState === 'loading' && (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n )\n )}\n </>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Error loading accounts</Trans>\n </p>\n ) : (\n <p class=\"ui-state insignificant\">{blankCopy}</p>\n )}\n </main>\n </div>\n );\n}\n","import { t, Trans } from '@lingui/macro';\nimport { Menu, MenuItem } from '@szhsin/react-menu';\nimport { useState } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport getTranslateTargetLanguage from '../utils/get-translate-target-language';\nimport localeMatch from '../utils/locale-match';\nimport { speak, supportsTTS } from '../utils/speech';\nimport states from '../utils/states';\n\nimport Icon from './icon';\nimport Menu2 from './menu2';\nimport TranslationBlock from './translation-block';\n\nexport default function MediaAltModal({ alt, lang, onClose }) {\n const snapStates = useSnapshot(states);\n const [forceTranslate, setForceTranslate] = useState(false);\n const targetLanguage = getTranslateTargetLanguage(true);\n const contentTranslationHideLanguages =\n snapStates.settings.contentTranslationHideLanguages || [];\n const differentLanguage =\n !!lang &&\n lang !== targetLanguage &&\n !localeMatch([lang], [targetLanguage]) &&\n !contentTranslationHideLanguages.find(\n (l) => lang === l || localeMatch([lang], [l]),\n );\n\n return (\n <div class=\"sheet\" tabindex=\"-1\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close outer\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header class=\"header-grid\">\n <h2>\n <Trans>Media description</Trans>\n </h2>\n <div class=\"header-side\">\n <Menu2\n align=\"end\"\n menuButton={\n <button type=\"button\" class=\"plain4\">\n <Icon icon=\"more\" alt={t`More`} size=\"xl\" />\n </button>\n }\n >\n <MenuItem\n disabled={forceTranslate}\n onClick={() => {\n setForceTranslate(true);\n }}\n >\n <Icon icon=\"translate\" />\n <span>\n <Trans>Translate</Trans>\n </span>\n </MenuItem>\n {supportsTTS && (\n <MenuItem\n onClick={() => {\n speak(alt, lang);\n }}\n >\n <Icon icon=\"speak\" />\n <span>\n <Trans>Speak</Trans>\n </span>\n </MenuItem>\n )}\n </Menu2>\n </div>\n </header>\n <main lang={lang} dir=\"auto\">\n <p\n style={{\n whiteSpace: 'pre-wrap',\n textWrap: 'pretty',\n }}\n >\n {alt}\n </p>\n {(differentLanguage || forceTranslate) && (\n <TranslationBlock\n forceTranslate={forceTranslate}\n sourceLanguage={lang}\n text={alt}\n />\n )}\n </main>\n </div>\n );\n}\n","const { min, max } = Math;\n\nexport default (x, low = 0, high = 1) => {\n return min(max(low, x), high);\n};\n","// ported from jQuery's $.type\nconst classToType = {};\nfor (let name of [\n 'Boolean',\n 'Number',\n 'String',\n 'Function',\n 'Array',\n 'Date',\n 'RegExp',\n 'Undefined',\n 'Null'\n]) {\n classToType[`[object ${name}]`] = name.toLowerCase();\n}\nexport default function (obj) {\n return classToType[Object.prototype.toString.call(obj)] || 'object';\n}\n","import type from './type.js';\n\nexport default (args, keyOrder = null) => {\n // if called with more than 3 arguments, we return the arguments\n if (args.length >= 3) return Array.prototype.slice.call(args);\n // with less than 3 args we check if first arg is object\n // and use the keyOrder string to extract and sort properties\n if (type(args[0]) == 'object' && keyOrder) {\n return keyOrder\n .split('')\n .filter((k) => args[0][k] !== undefined)\n .map((k) => args[0][k]);\n }\n // otherwise we just return the first argument\n // (which we suppose is an array of args)\n return args[0].slice(0);\n};\n","const { PI, min, max } = Math;\n\nconst rnd2 = (a) => Math.round(a * 100) / 100;\nconst rnd3 = (a) => Math.round(a * 100) / 100;\n\nexport { default as clip_rgb } from './clip_rgb.js';\nexport { default as limit } from './limit.js';\nexport { default as type } from './type.js';\nexport { default as unpack } from './unpack.js';\nexport { default as last } from './last.js';\n\nconst TWOPI = PI * 2;\nconst PITHIRD = PI / 3;\nconst DEG2RAD = PI / 180;\nconst RAD2DEG = 180 / PI;\n\n/**\n * Reverse the first three elements of an array\n *\n * @param {any[]} arr\n * @returns {any[]}\n */\nfunction reverse3(arr) {\n return [...arr.slice(0, 3).reverse(), ...arr.slice(3)];\n}\n\nexport { PI, TWOPI, PITHIRD, DEG2RAD, RAD2DEG, min, max, rnd2, rnd3, reverse3 };\n","// from https://www.w3.org/TR/css-color-4/multiply-matrices.js\nexport default function multiplyMatrices(A, B) {\n let m = A.length;\n\n if (!Array.isArray(A[0])) {\n // A is vector, convert to [[a, b, c, ...]]\n A = [A];\n }\n\n if (!Array.isArray(B[0])) {\n // B is vector, convert to [[a], [b], [c], ...]]\n B = B.map((x) => [x]);\n }\n\n let p = B[0].length;\n let B_cols = B[0].map((_, i) => B.map((x) => x[i])); // transpose B\n let product = A.map((row) =>\n B_cols.map((col) => {\n if (!Array.isArray(row)) {\n return col.reduce((a, c) => a + c * row, 0);\n }\n\n return row.reduce((a, c, i) => a + c * (col[i] || 0), 0);\n })\n );\n\n if (m === 1) {\n product = product[0]; // Avoid [[a, b, c, ...]]\n }\n\n if (p === 1) {\n return product.map((x) => x[0]); // Avoid [[a], [b], [c], ...]]\n }\n\n return product;\n}\n","const labConstants = {\n // Corresponds roughly to RGB brighter/darker\n Kn: 18,\n\n // D65 standard referent\n labWhitePoint: 'd65',\n Xn: 0.95047,\n Yn: 1,\n Zn: 1.08883,\n\n t0: 0.137931034, // 4 / 29\n t1: 0.206896552, // 6 / 29\n t2: 0.12841855, // 3 * t1 * t1\n t3: 0.008856452, // t1 * t1 * t1,\n\n kE: 216.0 / 24389.0,\n kKE: 8.0,\n kK: 24389.0 / 27.0,\n\n RefWhiteRGB: {\n // sRGB\n X: 0.95047,\n Y: 1,\n Z: 1.08883\n },\n\n MtxRGB2XYZ: {\n m00: 0.4124564390896922,\n m01: 0.21267285140562253,\n m02: 0.0193338955823293,\n m10: 0.357576077643909,\n m11: 0.715152155287818,\n m12: 0.11919202588130297,\n m20: 0.18043748326639894,\n m21: 0.07217499330655958,\n m22: 0.9503040785363679\n },\n\n MtxXYZ2RGB: {\n m00: 3.2404541621141045,\n m01: -0.9692660305051868,\n m02: 0.055643430959114726,\n m10: -1.5371385127977166,\n m11: 1.8760108454466942,\n m12: -0.2040259135167538,\n m20: -0.498531409556016,\n m21: 0.041556017530349834,\n m22: 1.0572251882231791\n },\n\n // used in rgb2xyz\n As: 0.9414285350000001,\n Bs: 1.040417467,\n Cs: 1.089532651,\n\n MtxAdaptMa: {\n m00: 0.8951,\n m01: -0.7502,\n m02: 0.0389,\n m10: 0.2664,\n m11: 1.7135,\n m12: -0.0685,\n m20: -0.1614,\n m21: 0.0367,\n m22: 1.0296\n },\n\n MtxAdaptMaI: {\n m00: 0.9869929054667123,\n m01: 0.43230526972339456,\n m02: -0.008528664575177328,\n m10: -0.14705425642099013,\n m11: 0.5183602715367776,\n m12: 0.04004282165408487,\n m20: 0.15996265166373125,\n m21: 0.0492912282128556,\n m22: 0.9684866957875502\n }\n};\n\nexport default labConstants;\n\n// taken from https://de.mathworks.com/help/images/ref/whitepoint.html\nconst ILLUMINANTS = new Map([\n // ASTM E308-01\n ['a', [1.0985, 0.35585]],\n // Wyszecki & Stiles, p. 769\n ['b', [1.0985, 0.35585]],\n // C ASTM E308-01\n ['c', [0.98074, 1.18232]],\n // D50 (ASTM E308-01)\n ['d50', [0.96422, 0.82521]],\n // D55 (ASTM E308-01)\n ['d55', [0.95682, 0.92149]],\n // D65 (ASTM E308-01)\n ['d65', [0.95047, 1.08883]],\n // E (ASTM E308-01)\n ['e', [1, 1, 1]],\n // F2 (ASTM E308-01)\n ['f2', [0.99186, 0.67393]],\n // F7 (ASTM E308-01)\n ['f7', [0.95041, 1.08747]],\n // F11 (ASTM E308-01)\n ['f11', [1.00962, 0.6435]],\n ['icc', [0.96422, 0.82521]]\n]);\n\nexport function setLabWhitePoint(name) {\n const ill = ILLUMINANTS.get(String(name).toLowerCase());\n if (!ill) {\n throw new Error('unknown Lab illuminant ' + name);\n }\n labConstants.labWhitePoint = name;\n labConstants.Xn = ill[0];\n labConstants.Zn = ill[1];\n}\n\nexport function getLabWhitePoint() {\n return labConstants.labWhitePoint;\n}\n","import LAB_CONSTANTS from './lab-constants.js';\nimport { unpack } from '../../utils/index.js';\n\n/*\n * L* [0..100]\n * a [-100..100]\n * b [-100..100]\n */\nconst lab2rgb = (...args) => {\n args = unpack(args, 'lab');\n const [L, a, b] = args;\n const [x, y, z] = lab2xyz(L, a, b);\n const [r, g, b_] = xyz2rgb(x, y, z);\n return [r, g, b_, args.length > 3 ? args[3] : 1];\n};\n\nconst lab2xyz = (L, a, b) => {\n const { kE, kK, kKE, Xn, Yn, Zn } = LAB_CONSTANTS;\n\n const fy = (L + 16.0) / 116.0;\n const fx = 0.002 * a + fy;\n const fz = fy - 0.005 * b;\n\n const fx3 = fx * fx * fx;\n const fz3 = fz * fz * fz;\n\n const xr = fx3 > kE ? fx3 : (116.0 * fx - 16.0) / kK;\n const yr = L > kKE ? Math.pow((L + 16.0) / 116.0, 3.0) : L / kK;\n const zr = fz3 > kE ? fz3 : (116.0 * fz - 16.0) / kK;\n\n const x = xr * Xn;\n const y = yr * Yn;\n const z = zr * Zn;\n\n return [x, y, z];\n};\n\nconst compand = (linear) => {\n /* sRGB */\n const sign = Math.sign(linear);\n linear = Math.abs(linear);\n return (\n (linear <= 0.0031308\n ? linear * 12.92\n : 1.055 * Math.pow(linear, 1.0 / 2.4) - 0.055) * sign\n );\n};\n\nconst xyz2rgb = (x, y, z) => {\n const { MtxAdaptMa, MtxAdaptMaI, MtxXYZ2RGB, RefWhiteRGB, Xn, Yn, Zn } =\n LAB_CONSTANTS;\n\n const As = Xn * MtxAdaptMa.m00 + Yn * MtxAdaptMa.m10 + Zn * MtxAdaptMa.m20;\n const Bs = Xn * MtxAdaptMa.m01 + Yn * MtxAdaptMa.m11 + Zn * MtxAdaptMa.m21;\n const Cs = Xn * MtxAdaptMa.m02 + Yn * MtxAdaptMa.m12 + Zn * MtxAdaptMa.m22;\n\n const Ad =\n RefWhiteRGB.X * MtxAdaptMa.m00 +\n RefWhiteRGB.Y * MtxAdaptMa.m10 +\n RefWhiteRGB.Z * MtxAdaptMa.m20;\n const Bd =\n RefWhiteRGB.X * MtxAdaptMa.m01 +\n RefWhiteRGB.Y * MtxAdaptMa.m11 +\n RefWhiteRGB.Z * MtxAdaptMa.m21;\n const Cd =\n RefWhiteRGB.X * MtxAdaptMa.m02 +\n RefWhiteRGB.Y * MtxAdaptMa.m12 +\n RefWhiteRGB.Z * MtxAdaptMa.m22;\n\n const X1 =\n (x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 + z * MtxAdaptMa.m20) *\n (Ad / As);\n const Y1 =\n (x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 + z * MtxAdaptMa.m21) *\n (Bd / Bs);\n const Z1 =\n (x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 + z * MtxAdaptMa.m22) *\n (Cd / Cs);\n\n const X2 =\n X1 * MtxAdaptMaI.m00 + Y1 * MtxAdaptMaI.m10 + Z1 * MtxAdaptMaI.m20;\n const Y2 =\n X1 * MtxAdaptMaI.m01 + Y1 * MtxAdaptMaI.m11 + Z1 * MtxAdaptMaI.m21;\n const Z2 =\n X1 * MtxAdaptMaI.m02 + Y1 * MtxAdaptMaI.m12 + Z1 * MtxAdaptMaI.m22;\n\n const r = compand(\n X2 * MtxXYZ2RGB.m00 + Y2 * MtxXYZ2RGB.m10 + Z2 * MtxXYZ2RGB.m20\n );\n const g = compand(\n X2 * MtxXYZ2RGB.m01 + Y2 * MtxXYZ2RGB.m11 + Z2 * MtxXYZ2RGB.m21\n );\n const b = compand(\n X2 * MtxXYZ2RGB.m02 + Y2 * MtxXYZ2RGB.m12 + Z2 * MtxXYZ2RGB.m22\n );\n\n return [r * 255, g * 255, b * 255];\n};\n\nexport default lab2rgb;\nexport { xyz2rgb };\n","import { unpack } from '../../utils/index.js';\nimport multiplyMatrices from '../../utils/multiply-matrices.js';\nimport { xyz2rgb } from '../lab/lab2rgb.js';\n\nconst oklab2rgb = (...args) => {\n args = unpack(args, 'lab');\n const [L, a, b, ...rest] = args;\n const [X, Y, Z] = OKLab_to_XYZ([L, a, b]);\n const [r, g, b_] = xyz2rgb(X, Y, Z);\n return [r, g, b_, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\n// from https://www.w3.org/TR/css-color-4/#color-conversion-code\nfunction OKLab_to_XYZ(OKLab) {\n // Given OKLab, convert to XYZ relative to D65\n var LMStoXYZ = [\n [1.2268798758459243, -0.5578149944602171, 0.2813910456659647],\n [-0.0405757452148008, 1.112286803280317, -0.0717110580655164],\n [-0.0763729366746601, -0.4214933324022432, 1.5869240198367816]\n ];\n var OKLabtoLMS = [\n [1.0, 0.3963377773761749, 0.2158037573099136],\n [1.0, -0.1055613458156586, -0.0638541728258133],\n [1.0, -0.0894841775298119, -1.2914855480194092]\n ];\n\n var LMSnl = multiplyMatrices(OKLabtoLMS, OKLab);\n return multiplyMatrices(\n LMStoXYZ,\n LMSnl.map((c) => c ** 3)\n );\n}\n\nexport default oklab2rgb;\n","import LAB_CONSTANTS from './lab-constants.js';\nimport { unpack } from '../../utils/index.js';\n\nconst rgb2lab = (...args) => {\n const [r, g, b, ...rest] = unpack(args, 'rgb');\n const [x, y, z] = rgb2xyz(r, g, b);\n const [L, a, b_] = xyz2lab(x, y, z);\n return [L, a, b_, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\nfunction xyz2lab(x, y, z) {\n const { Xn, Yn, Zn, kE, kK } = LAB_CONSTANTS;\n const xr = x / Xn;\n const yr = y / Yn;\n const zr = z / Zn;\n\n const fx = xr > kE ? Math.pow(xr, 1.0 / 3.0) : (kK * xr + 16.0) / 116.0;\n const fy = yr > kE ? Math.pow(yr, 1.0 / 3.0) : (kK * yr + 16.0) / 116.0;\n const fz = zr > kE ? Math.pow(zr, 1.0 / 3.0) : (kK * zr + 16.0) / 116.0;\n\n return [116.0 * fy - 16.0, 500.0 * (fx - fy), 200.0 * (fy - fz)];\n}\n\nfunction gammaAdjustSRGB(companded) {\n const sign = Math.sign(companded);\n companded = Math.abs(companded);\n const linear =\n companded <= 0.04045\n ? companded / 12.92\n : Math.pow((companded + 0.055) / 1.055, 2.4);\n return linear * sign;\n}\n\nconst rgb2xyz = (r, g, b) => {\n // normalize and gamma adjust\n r = gammaAdjustSRGB(r / 255);\n g = gammaAdjustSRGB(g / 255);\n b = gammaAdjustSRGB(b / 255);\n\n const { MtxRGB2XYZ, MtxAdaptMa, MtxAdaptMaI, Xn, Yn, Zn, As, Bs, Cs } =\n LAB_CONSTANTS;\n\n let x = r * MtxRGB2XYZ.m00 + g * MtxRGB2XYZ.m10 + b * MtxRGB2XYZ.m20;\n let y = r * MtxRGB2XYZ.m01 + g * MtxRGB2XYZ.m11 + b * MtxRGB2XYZ.m21;\n let z = r * MtxRGB2XYZ.m02 + g * MtxRGB2XYZ.m12 + b * MtxRGB2XYZ.m22;\n\n const Ad = Xn * MtxAdaptMa.m00 + Yn * MtxAdaptMa.m10 + Zn * MtxAdaptMa.m20;\n const Bd = Xn * MtxAdaptMa.m01 + Yn * MtxAdaptMa.m11 + Zn * MtxAdaptMa.m21;\n const Cd = Xn * MtxAdaptMa.m02 + Yn * MtxAdaptMa.m12 + Zn * MtxAdaptMa.m22;\n\n let X = x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 + z * MtxAdaptMa.m20;\n let Y = x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 + z * MtxAdaptMa.m21;\n let Z = x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 + z * MtxAdaptMa.m22;\n\n X *= Ad / As;\n Y *= Bd / Bs;\n Z *= Cd / Cs;\n\n x = X * MtxAdaptMaI.m00 + Y * MtxAdaptMaI.m10 + Z * MtxAdaptMaI.m20;\n y = X * MtxAdaptMaI.m01 + Y * MtxAdaptMaI.m11 + Z * MtxAdaptMaI.m21;\n z = X * MtxAdaptMaI.m02 + Y * MtxAdaptMaI.m12 + Z * MtxAdaptMaI.m22;\n\n return [x, y, z];\n};\n\nexport default rgb2lab;\nexport { rgb2xyz };\n","import { unpack } from '../../utils/index.js';\nimport multiplyMatrices from '../../utils/multiply-matrices.js';\nimport { rgb2xyz } from '../lab/rgb2lab.js';\n\nconst rgb2oklab = (...args) => {\n const [r, g, b, ...rest] = unpack(args, 'rgb');\n const xyz = rgb2xyz(r, g, b);\n const oklab = XYZ_to_OKLab(xyz);\n return [...oklab, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\n// from https://www.w3.org/TR/css-color-4/#color-conversion-code\nfunction XYZ_to_OKLab(XYZ) {\n // Given XYZ relative to D65, convert to OKLab\n const XYZtoLMS = [\n [0.819022437996703, 0.3619062600528904, -0.1288737815209879],\n [0.0329836539323885, 0.9292868615863434, 0.0361446663506424],\n [0.0481771893596242, 0.2642395317527308, 0.6335478284694309]\n ];\n const LMStoOKLab = [\n [0.210454268309314, 0.7936177747023054, -0.0040720430116193],\n [1.9779985324311684, -2.4285922420485799, 0.450593709617411],\n [0.0259040424655478, 0.7827717124575296, -0.8086757549230774]\n ];\n\n const LMS = multiplyMatrices(XYZtoLMS, XYZ);\n // JavaScript Math.cbrt returns a sign-matched cube root\n // beware if porting to other languages\n // especially if tempted to use a general power function\n return multiplyMatrices(\n LMStoOKLab,\n LMS.map((c) => Math.cbrt(c))\n );\n // L in range [0,1]. For use in CSS, multiply by 100 and add a percent\n}\n\nexport default rgb2oklab;\n","import { unpack, DEG2RAD } from '../../utils/index.js';\nconst { sin, cos } = Math;\n\nconst lch2lab = (...args) => {\n /*\n Convert from a qualitative parameter h and a quantitative parameter l to a 24-bit pixel.\n These formulas were invented by David Dalrymple to obtain maximum contrast without going\n out of gamut if the parameters are in the range 0-1.\n\n A saturation multiplier was added by Gregor Aisch\n */\n let [l, c, h] = unpack(args, 'lch');\n if (isNaN(h)) h = 0;\n h = h * DEG2RAD;\n return [l, cos(h) * c, sin(h) * c];\n};\n\nexport default lch2lab;\n","import { unpack } from '../../utils/index.js';\nimport lch2lab from '../lch/lch2lab.js';\nimport oklab2rgb from '../oklab/oklab2rgb.js';\n\nconst oklch2rgb = (...args) => {\n args = unpack(args, 'lch');\n const [l, c, h, ...rest] = args;\n const [L, a, b_] = lch2lab(l, c, h);\n const [r, g, b] = oklab2rgb(L, a, b_);\n return [r, g, b, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\nexport default oklch2rgb;\n","import { unpack, RAD2DEG } from '../../utils/index.js';\nconst { sqrt, atan2, round } = Math;\n\nconst lab2lch = (...args) => {\n const [l, a, b] = unpack(args, 'lab');\n const c = sqrt(a * a + b * b);\n let h = (atan2(b, a) * RAD2DEG + 360) % 360;\n if (round(c * 10000) === 0) h = Number.NaN;\n return [l, c, h];\n};\n\nexport default lab2lch;\n","import { unpack } from '../../utils/index.js';\nimport rgb2oklab from '../oklab/rgb2oklab.js';\nimport lab2lch from '../lch/lab2lch.js';\n\nconst rgb2oklch = (...args) => {\n const [r, g, b, ...rest] = unpack(args, 'rgb');\n const [l, a, b_] = rgb2oklab(r, g, b);\n const [L, c, h] = lab2lch(l, a, b_);\n return [L, c, h, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\nexport default rgb2oklch;\n","import { t, Trans } from '@lingui/macro';\nimport { MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport { getBlurHashAverageColor } from 'fast-blurhash';\nimport {\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\n\nimport { oklch2rgb, rgb2oklch } from '../utils/color-utils';\nimport isRTL from '../utils/is-rtl';\nimport showToast from '../utils/show-toast';\nimport states from '../utils/states';\nimport store from '../utils/store';\n\nimport Icon from './icon';\nimport Link from './link';\nimport Media from './media';\nimport MenuLink from './menu-link';\nimport Menu2 from './menu2';\n\nconst { PHANPY_IMG_ALT_API_URL: IMG_ALT_API_URL } = import.meta.env;\n\nfunction MediaModal({\n mediaAttachments,\n statusID,\n instance,\n lang,\n index = 0,\n onClose = () => {},\n}) {\n const [uiState, setUIState] = useState('default');\n const carouselRef = useRef(null);\n\n const [currentIndex, setCurrentIndex] = useState(index);\n const carouselFocusItem = useRef(null);\n useLayoutEffect(() => {\n carouselFocusItem.current?.scrollIntoView();\n\n // history.pushState({ mediaModal: true }, '');\n // const handlePopState = (e) => {\n // if (e.state?.mediaModal) {\n // onClose();\n // }\n // };\n // window.addEventListener('popstate', handlePopState);\n // return () => {\n // window.removeEventListener('popstate', handlePopState);\n // };\n }, []);\n const prevStatusID = useRef(statusID);\n useEffect(() => {\n const scrollLeft = index * carouselRef.current.clientWidth;\n const differentStatusID = prevStatusID.current !== statusID;\n if (differentStatusID) prevStatusID.current = statusID;\n carouselRef.current.focus();\n carouselRef.current.scrollTo({\n left: scrollLeft * (isRTL() ? -1 : 1),\n behavior: differentStatusID ? 'auto' : 'smooth',\n });\n }, [index, statusID]);\n\n const [showControls, setShowControls] = useState(true);\n\n useEffect(() => {\n let handleSwipe = () => {\n onClose();\n };\n if (carouselRef.current) {\n carouselRef.current.addEventListener('swiped-down', handleSwipe);\n }\n return () => {\n if (carouselRef.current) {\n carouselRef.current.removeEventListener('swiped-down', handleSwipe);\n }\n };\n }, []);\n\n useHotkeys(\n 'esc',\n onClose,\n {\n ignoreEventWhen: (e) => {\n const hasModal = !!document.querySelector('#modal-container > *');\n return hasModal;\n },\n },\n [onClose],\n );\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 useEffect(() => {\n let timer = setTimeout(() => {\n carouselRef.current?.focus?.();\n }, 100);\n return () => clearTimeout(timer);\n }, []);\n\n const mediaOkColors = useMemo(() => {\n return mediaAttachments?.map((media) => {\n const { blurhash } = media;\n if (blurhash) {\n const averageColor = getBlurHashAverageColor(blurhash);\n return rgb2oklch(averageColor);\n }\n return null;\n });\n }, [mediaAttachments]);\n const mediaAccentColors = useMemo(() => {\n return mediaOkColors?.map((okColor) => {\n if (okColor) {\n return {\n light: oklch2rgb([0.95, 0.01, okColor[2]]),\n dark: oklch2rgb([0.35, 0.01, okColor[2]]),\n default: oklch2rgb([0.6, okColor[1], okColor[2]]),\n };\n }\n return null;\n });\n });\n const mediaAccentGradients = useMemo(() => {\n const gap = 5;\n const range = 100 / mediaAccentColors.length;\n const colors = mediaAccentColors.map((color, i) => {\n const start = i * range + gap;\n const end = (i + 1) * range - gap;\n if (color?.light && color?.dark) {\n return {\n light: `\n rgb(${color.light?.join(',')}) ${start}%, \n rgb(${color.light?.join(',')}) ${end}%\n `,\n dark: `\n rgb(${color.dark?.join(',')}) ${start}%, \n rgb(${color.dark?.join(',')}) ${end}%\n `,\n };\n }\n\n return {\n light: `\n transparent ${start}%, \n transparent ${end}%\n `,\n dark: `\n transparent ${start}%, \n transparent ${end}%\n `,\n };\n });\n const lightGradient = colors.map((color) => color.light).join(', ');\n const darkGradient = colors.map((color) => color.dark).join(', ');\n return {\n light: lightGradient,\n dark: darkGradient,\n };\n }, [mediaAccentColors]);\n\n let toastRef = useRef(null);\n useEffect(() => {\n return () => {\n toastRef.current?.hideToast?.();\n };\n }, []);\n\n useLayoutEffect(() => {\n const currentColor = mediaAccentColors[currentIndex];\n let $meta;\n let metaColor;\n if (currentColor) {\n const theme = store.local.get('theme');\n if (theme) {\n const mediaColor = `rgb(${currentColor[theme].join(',')})`;\n console.log({ mediaColor });\n $meta = document.querySelector(\n `meta[name=\"theme-color\"][data-theme-setting=\"manual\"]`,\n );\n if ($meta) {\n metaColor = $meta.content;\n $meta.content = mediaColor;\n }\n } else {\n const colorScheme = window.matchMedia('(prefers-color-scheme: dark)')\n .matches\n ? 'dark'\n : 'light';\n const mediaColor = `rgb(${currentColor[colorScheme].join(',')})`;\n console.log({ mediaColor });\n $meta = document.querySelector(\n `meta[name=\"theme-color\"][media*=\"${colorScheme}\"]`,\n );\n if ($meta) {\n metaColor = $meta.content;\n $meta.content = mediaColor;\n }\n }\n }\n return () => {\n // Reset meta color\n if ($meta && metaColor) {\n $meta.content = metaColor;\n }\n };\n }, [currentIndex, mediaAccentColors]);\n\n return (\n <div\n class={`media-modal-container media-modal-count-${mediaAttachments?.length}`}\n >\n <div\n ref={carouselRef}\n tabIndex=\"0\"\n data-swipe-threshold=\"44\"\n class=\"carousel\"\n onClick={(e) => {\n if (\n e.target.classList.contains('carousel-item') ||\n e.target.classList.contains('media') ||\n e.target.classList.contains('media-zoom')\n ) {\n onClose();\n }\n }}\n style={\n mediaAttachments.length > 1\n ? {\n backgroundAttachment: 'local',\n '--accent-gradient-light': mediaAccentGradients?.light,\n '--accent-gradient-dark': mediaAccentGradients?.dark,\n // backgroundImage: `linear-gradient(\n // to ${isRTL() ? 'left' : 'right'}, ${mediaAccentGradient})`,\n }\n : {}\n }\n >\n {mediaAttachments?.map((media, i) => {\n const accentColor =\n mediaAttachments.length === 1 ? mediaAccentColors[i] : null;\n return (\n <div\n class=\"carousel-item\"\n style={\n accentColor\n ? {\n '--accent-color': `rgb(${accentColor.default.join(',')})`,\n '--accent-light-color': `rgb(${accentColor.light?.join(\n ',',\n )})`,\n '--accent-dark-color': `rgb(${accentColor.dark?.join(\n ',',\n )})`,\n '--accent-alpha-color': `rgba(${accentColor.default.join(\n ',',\n )}, 0.4)`,\n }\n : {}\n }\n tabindex=\"0\"\n key={media.id}\n ref={i === currentIndex ? carouselFocusItem : null}\n onClick={(e) => {\n // console.log(e);\n // if (e.target !== e.currentTarget) {\n // setShowControls(!showControls);\n // }\n if (!e.target.classList.contains('media')) {\n setShowControls(!showControls);\n }\n }}\n >\n {!!media.description && (\n <button\n type=\"button\"\n class=\"media-alt\"\n hidden={!showControls}\n onClick={() => {\n states.showMediaAlt = {\n alt: media.description,\n lang,\n };\n }}\n >\n <span class=\"alt-badge\">ALT</span>\n <span class=\"media-alt-desc\" lang={lang} dir=\"auto\">\n {media.description}\n </span>\n </button>\n )}\n <Media media={media} showOriginal lang={lang} />\n </div>\n );\n })}\n </div>\n <div class=\"carousel-top-controls\" hidden={!showControls}>\n <span>\n <button\n type=\"button\"\n class=\"carousel-button\"\n onClick={() => onClose()}\n >\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n </span>\n {mediaAttachments?.length > 1 ? (\n <span class=\"carousel-dots\">\n {mediaAttachments?.map((media, i) => (\n <button\n key={media.id}\n type=\"button\"\n disabled={i === currentIndex}\n class={`carousel-dot ${i === currentIndex ? 'active' : ''}`}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n const left =\n carouselRef.current.clientWidth * i * (isRTL() ? -1 : 1);\n carouselRef.current.focus();\n carouselRef.current.scrollTo({ left, behavior: 'smooth' });\n }}\n >\n <Icon icon=\"round\" size=\"s\" alt=\"⸱\" />\n </button>\n ))}\n </span>\n ) : (\n <span />\n )}\n <span>\n <Menu2\n overflow=\"auto\"\n align=\"end\"\n position=\"anchor\"\n gap={4}\n menuClassName=\"glass-menu\"\n menuButton={\n <button type=\"button\" class=\"carousel-button\">\n <Icon icon=\"more\" alt={t`More`} />\n </button>\n }\n >\n <MenuLink\n href={\n mediaAttachments[currentIndex]?.remoteUrl ||\n mediaAttachments[currentIndex]?.url\n }\n class=\"carousel-button\"\n target=\"_blank\"\n title={t`Open original media in new window`}\n >\n <Icon icon=\"popout\" />\n <span>\n <Trans>Open original media</Trans>\n </span>\n </MenuLink>\n {import.meta.env.DEV && // Only dev for now\n !!states.settings.mediaAltGenerator &&\n !!IMG_ALT_API_URL &&\n !!mediaAttachments[currentIndex]?.url &&\n !mediaAttachments[currentIndex]?.description &&\n mediaAttachments[currentIndex]?.type === 'image' && (\n <>\n <MenuDivider />\n <MenuItem\n disabled={uiState === 'loading'}\n onClick={() => {\n setUIState('loading');\n toastRef.current = showToast({\n text: t`Attempting to describe image. Please wait…`,\n duration: -1,\n });\n (async function () {\n try {\n const response = await fetch(\n `${IMG_ALT_API_URL}?image=${encodeURIComponent(\n mediaAttachments[currentIndex]?.url,\n )}`,\n ).then((r) => r.json());\n states.showMediaAlt = {\n alt: response.description,\n };\n } catch (e) {\n console.error(e);\n showToast(t`Failed to describe image`);\n } finally {\n setUIState('default');\n toastRef.current?.hideToast?.();\n }\n })();\n }}\n >\n <Icon icon=\"sparkles2\" />\n <span>\n <Trans>Describe image…</Trans>\n </span>\n </MenuItem>\n </>\n )}\n </Menu2>{' '}\n <Link\n to={`${instance ? `/${instance}` : ''}/s/${statusID}${\n window.matchMedia('(min-width: calc(40em + 350px))').matches\n ? `?media=${currentIndex + 1}`\n : ''\n }`}\n class=\"button carousel-button media-post-link\"\n // onClick={() => {\n // // if small screen (not media query min-width 40em + 350px), run onClose\n // if (\n // !window.matchMedia('(min-width: calc(40em + 350px))').matches\n // ) {\n // onClose();\n // }\n // }}\n >\n <span class=\"button-label\">\n <Trans>View post</Trans>{' '}\n </span>\n »\n </Link>\n </span>\n </div>\n {mediaAttachments?.length > 1 && (\n <div class=\"carousel-controls\" hidden={!showControls}>\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\" alt={t`Previous`} />\n </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\" alt={t`Next`} />\n </button>\n </div>\n )}\n </div>\n );\n}\n\nexport default MediaModal;\n","import './report-modal.css';\n\nimport { msg, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { Fragment } from 'preact';\nimport { useMemo, useRef, useState } from 'preact/hooks';\n\nimport { api } from '../utils/api';\nimport showToast from '../utils/show-toast';\nimport { getCurrentInstance } from '../utils/store-utils';\n\nimport AccountBlock from './account-block';\nimport Icon from './icon';\nimport Loader from './loader';\nimport Status from './status';\n\n// NOTE: `dislike` hidden for now, it's actually not used for reporting\n// Mastodon shows another screen for unfollowing, muting or blocking instead of reporting\n\nconst CATEGORIES = [, /*'dislike'*/ 'spam', 'legal', 'violation', 'other'];\n// `violation` will be set if there are `rule_ids[]`\n\nconst CATEGORIES_INFO = {\n // dislike: {\n // label: 'Dislike',\n // description: 'Not something you want to see',\n // },\n spam: {\n label: msg`Spam`,\n description: msg`Malicious links, fake engagement, or repetitive replies`,\n },\n legal: {\n label: msg`Illegal`,\n description: msg`Violates the law of your or the server's country`,\n },\n violation: {\n label: msg`Server rule violation`,\n description: msg`Breaks specific server rules`,\n stampLabel: msg`Violation`,\n },\n other: {\n label: msg`Other`,\n description: msg`Issue doesn't fit other categories`,\n excludeStamp: true,\n },\n};\n\nfunction ReportModal({ account, post, onClose }) {\n const { _ } = useLingui();\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [username, domain] = account.acct.split('@');\n\n const [rules, currentDomain] = useMemo(() => {\n const { rules, domain } = getCurrentInstance();\n return [rules || [], domain];\n });\n\n const [selectedCategory, setSelectedCategory] = useState(null);\n const [showRules, setShowRules] = useState(false);\n\n const rulesRef = useRef(null);\n const [hasRules, setHasRules] = useState(false);\n\n return (\n <div class=\"report-modal-container\">\n <div class=\"top-controls\">\n <h1>{post ? t`Report Post` : t`Report @${username}`}</h1>\n <button\n type=\"button\"\n class=\"plain4 small\"\n disabled={uiState === 'loading'}\n onClick={() => onClose()}\n >\n <Icon icon=\"x\" size=\"xl\" alt={t`Close`} />\n </button>\n </div>\n <main>\n <div class=\"report-preview\">\n {post ? (\n <Status status={post} size=\"s\" previewMode />\n ) : (\n <AccountBlock\n account={account}\n avatarSize=\"xxl\"\n useAvatarStatic\n showStats\n showActivity\n />\n )}\n </div>\n {!!selectedCategory &&\n !CATEGORIES_INFO[selectedCategory].excludeStamp && (\n <span\n class=\"rubber-stamp\"\n key={selectedCategory}\n aria-hidden=\"true\"\n >\n {_(\n CATEGORIES_INFO[selectedCategory].stampLabel ||\n _(CATEGORIES_INFO[selectedCategory].label),\n )}\n <small>\n <Trans>Pending review</Trans>\n </small>\n </span>\n )}\n <form\n onSubmit={(e) => {\n e.preventDefault();\n\n const formData = new FormData(e.target);\n const entries = Object.fromEntries(formData.entries());\n console.log('ENTRIES', entries);\n\n let { category, comment, forward } = entries;\n if (!comment) comment = undefined;\n if (forward === 'on') forward = true;\n const ruleIds =\n category === 'violation'\n ? Object.entries(entries)\n .filter(([key]) => key.startsWith('rule_ids'))\n .map(([key, value]) => value)\n : undefined;\n\n const params = {\n category,\n comment,\n forward,\n ruleIds,\n };\n console.log('PARAMS', params);\n\n setUIState('loading');\n (async () => {\n try {\n await masto.v1.reports.create({\n accountId: account.id,\n statusIds: post?.id ? [post.id] : undefined,\n category,\n comment,\n ruleIds,\n forward,\n });\n setUIState('success');\n showToast(post ? t`Post reported` : t`Profile reported`);\n onClose();\n } catch (error) {\n console.error(error);\n setUIState('error');\n showToast(\n error?.message ||\n (post\n ? t`Unable to report post`\n : t`Unable to report profile`),\n );\n }\n })();\n }}\n >\n <p>\n {post\n ? t`What's the issue with this post?`\n : t`What's the issue with this profile?`}\n </p>\n <section class=\"report-categories\">\n {CATEGORIES.map((category) =>\n category === 'violation' && !rules?.length ? null : (\n <Fragment key={category}>\n <label class=\"report-category\">\n <input\n type=\"radio\"\n name=\"category\"\n value={category}\n required\n disabled={uiState === 'loading'}\n onChange={(e) => {\n setSelectedCategory(e.target.value);\n setShowRules(e.target.value === 'violation');\n }}\n />\n <span>\n {_(CATEGORIES_INFO[category].label)} \n <small class=\"ib insignificant\">\n {_(CATEGORIES_INFO[category].description)}\n </small>\n </span>\n </label>\n {category === 'violation' && !!rules?.length && (\n <div\n class=\"shazam-container no-animation\"\n hidden={!showRules}\n >\n <div class=\"shazam-container-inner\">\n <div class=\"report-rules\" ref={rulesRef}>\n {rules.map((rule, i) => (\n <label class=\"report-rule\" key={rule.id}>\n <input\n type=\"checkbox\"\n name={`rule_ids[${i}]`}\n value={rule.id}\n required={showRules && !hasRules}\n disabled={uiState === 'loading'}\n onChange={(e) => {\n const { checked } = e.target;\n if (checked) {\n setHasRules(true);\n } else {\n const checkedInputs =\n rulesRef.current.querySelectorAll(\n 'input:checked',\n );\n if (!checkedInputs.length) {\n setHasRules(false);\n }\n }\n }}\n />\n <span>{rule.text}</span>\n </label>\n ))}\n </div>\n </div>\n </div>\n )}\n </Fragment>\n ),\n )}\n </section>\n <section class=\"report-comment\">\n <p>\n <label for=\"report-comment\">\n <Trans>Additional info</Trans>\n </label>\n </p>\n <textarea\n maxlength=\"1000\"\n rows=\"1\"\n name=\"comment\"\n id=\"report-comment\"\n disabled={uiState === 'loading'}\n required={!post} // Required if not reporting a post\n />\n </section>\n {!!domain && domain !== currentDomain && (\n <section>\n <p>\n <label>\n <input\n type=\"checkbox\"\n switch\n name=\"forward\"\n disabled={uiState === 'loading'}\n />{' '}\n <span>\n <Trans>\n Forward to <i>{domain}</i>\n </Trans>\n </span>\n </label>\n </p>\n </section>\n )}\n <footer>\n <button type=\"submit\" disabled={uiState === 'loading'}>\n <Trans>Send Report</Trans>\n </button>{' '}\n <button\n type=\"submit\"\n class=\"plain2\"\n disabled={uiState === 'loading'}\n onClick={async () => {\n try {\n await masto.v1.accounts.$select(account.id).mute(); // Infinite duration\n showToast(t`Muted ${username}`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to mute ${username}`);\n }\n // onSubmit will still run\n }}\n >\n <Trans>\n Send Report <small class=\"ib\">+ Mute profile</small>\n </Trans>\n </button>{' '}\n <button\n type=\"submit\"\n class=\"plain2\"\n disabled={uiState === 'loading'}\n onClick={async () => {\n try {\n await masto.v1.accounts.$select(account.id).block();\n showToast(t`Blocked ${username}`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to block ${username}`);\n }\n // onSubmit will still run\n }}\n >\n <Trans>\n Send Report <small class=\"ib\">+ Block profile</small>\n </Trans>\n </button>\n <Loader hidden={uiState !== 'loading'} />\n </footer>\n </form>\n </main>\n </div>\n );\n}\n\nexport default ReportModal;\n","// Copyright (c) 2013 Pieroxy <pieroxy@pieroxy.net>\n// This work is free. You can redistribute it and/or modify it\n// under the terms of the WTFPL, Version 2\n// For more information see LICENSE.txt or http://www.wtfpl.net/\n//\n// For more information, the home page:\n// http://pieroxy.net/blog/pages/lz-string/testing.html\n//\n// LZ-based compression algorithm, version 1.4.5\nvar LZString = (function() {\n\n// private property\nvar f = String.fromCharCode;\nvar keyStrBase64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\nvar keyStrUriSafe = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$\";\nvar baseReverseDic = {};\n\nfunction getBaseValue(alphabet, character) {\n if (!baseReverseDic[alphabet]) {\n baseReverseDic[alphabet] = {};\n for (var i=0 ; i<alphabet.length ; i++) {\n baseReverseDic[alphabet][alphabet.charAt(i)] = i;\n }\n }\n return baseReverseDic[alphabet][character];\n}\n\nvar LZString = {\n compressToBase64 : function (input) {\n if (input == null) return \"\";\n var res = LZString._compress(input, 6, function(a){return keyStrBase64.charAt(a);});\n switch (res.length % 4) { // To produce valid Base64\n default: // When could this happen ?\n case 0 : return res;\n case 1 : return res+\"===\";\n case 2 : return res+\"==\";\n case 3 : return res+\"=\";\n }\n },\n\n decompressFromBase64 : function (input) {\n if (input == null) return \"\";\n if (input == \"\") return null;\n return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrBase64, input.charAt(index)); });\n },\n\n compressToUTF16 : function (input) {\n if (input == null) return \"\";\n return LZString._compress(input, 15, function(a){return f(a+32);}) + \" \";\n },\n\n decompressFromUTF16: function (compressed) {\n if (compressed == null) return \"\";\n if (compressed == \"\") return null;\n return LZString._decompress(compressed.length, 16384, function(index) { return compressed.charCodeAt(index) - 32; });\n },\n\n //compress into uint8array (UCS-2 big endian format)\n compressToUint8Array: function (uncompressed) {\n var compressed = LZString.compress(uncompressed);\n var buf=new Uint8Array(compressed.length*2); // 2 bytes per character\n\n for (var i=0, TotalLen=compressed.length; i<TotalLen; i++) {\n var current_value = compressed.charCodeAt(i);\n buf[i*2] = current_value >>> 8;\n buf[i*2+1] = current_value % 256;\n }\n return buf;\n },\n\n //decompress from uint8array (UCS-2 big endian format)\n decompressFromUint8Array:function (compressed) {\n if (compressed===null || compressed===undefined){\n return LZString.decompress(compressed);\n } else {\n var buf=new Array(compressed.length/2); // 2 bytes per character\n for (var i=0, TotalLen=buf.length; i<TotalLen; i++) {\n buf[i]=compressed[i*2]*256+compressed[i*2+1];\n }\n\n var result = [];\n buf.forEach(function (c) {\n result.push(f(c));\n });\n return LZString.decompress(result.join(''));\n\n }\n\n },\n\n\n //compress into a string that is already URI encoded\n compressToEncodedURIComponent: function (input) {\n if (input == null) return \"\";\n return LZString._compress(input, 6, function(a){return keyStrUriSafe.charAt(a);});\n },\n\n //decompress from an output of compressToEncodedURIComponent\n decompressFromEncodedURIComponent:function (input) {\n if (input == null) return \"\";\n if (input == \"\") return null;\n input = input.replace(/ /g, \"+\");\n return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrUriSafe, input.charAt(index)); });\n },\n\n compress: function (uncompressed) {\n return LZString._compress(uncompressed, 16, function(a){return f(a);});\n },\n _compress: function (uncompressed, bitsPerChar, getCharFromInt) {\n if (uncompressed == null) return \"\";\n var i, value,\n context_dictionary= {},\n context_dictionaryToCreate= {},\n context_c=\"\",\n context_wc=\"\",\n context_w=\"\",\n context_enlargeIn= 2, // Compensate for the first entry which should not count\n context_dictSize= 3,\n context_numBits= 2,\n context_data=[],\n context_data_val=0,\n context_data_position=0,\n ii;\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii);\n if (!Object.prototype.hasOwnProperty.call(context_dictionary,context_c)) {\n context_dictionary[context_c] = context_dictSize++;\n context_dictionaryToCreate[context_c] = true;\n }\n\n context_wc = context_w + context_c;\n if (Object.prototype.hasOwnProperty.call(context_dictionary,context_wc)) {\n context_w = context_wc;\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {\n if (context_w.charCodeAt(0)<256) {\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<8 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n } else {\n value = 1;\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | value;\n if (context_data_position ==bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = 0;\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<16 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n delete context_dictionaryToCreate[context_w];\n } else {\n value = context_dictionary[context_w];\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n\n\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++;\n context_w = String(context_c);\n }\n }\n\n // Output the code for w.\n if (context_w !== \"\") {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {\n if (context_w.charCodeAt(0)<256) {\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<8 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n } else {\n value = 1;\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | value;\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = 0;\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<16 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n delete context_dictionaryToCreate[context_w];\n } else {\n value = context_dictionary[context_w];\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n\n\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n }\n\n // Mark the end of the stream\n value = 2;\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data.push(getCharFromInt(context_data_val));\n break;\n }\n else context_data_position++;\n }\n return context_data.join('');\n },\n\n decompress: function (compressed) {\n if (compressed == null) return \"\";\n if (compressed == \"\") return null;\n return LZString._decompress(compressed.length, 32768, function(index) { return compressed.charCodeAt(index); });\n },\n\n _decompress: function (length, resetValue, getNextValue) {\n var dictionary = [],\n next,\n enlargeIn = 4,\n dictSize = 4,\n numBits = 3,\n entry = \"\",\n result = [],\n i,\n w,\n bits, resb, maxpower, power,\n c,\n data = {val:getNextValue(0), position:resetValue, index:1};\n\n for (i = 0; i < 3; i += 1) {\n dictionary[i] = i;\n }\n\n bits = 0;\n maxpower = Math.pow(2,2);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n switch (next = bits) {\n case 0:\n bits = 0;\n maxpower = Math.pow(2,8);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n c = f(bits);\n break;\n case 1:\n bits = 0;\n maxpower = Math.pow(2,16);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n c = f(bits);\n break;\n case 2:\n return \"\";\n }\n dictionary[3] = c;\n w = c;\n result.push(c);\n while (true) {\n if (data.index > length) {\n return \"\";\n }\n\n bits = 0;\n maxpower = Math.pow(2,numBits);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n switch (c = bits) {\n case 0:\n bits = 0;\n maxpower = Math.pow(2,8);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n dictionary[dictSize++] = f(bits);\n c = dictSize-1;\n enlargeIn--;\n break;\n case 1:\n bits = 0;\n maxpower = Math.pow(2,16);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n dictionary[dictSize++] = f(bits);\n c = dictSize-1;\n enlargeIn--;\n break;\n case 2:\n return result.join('');\n }\n\n if (enlargeIn == 0) {\n enlargeIn = Math.pow(2, numBits);\n numBits++;\n }\n\n if (dictionary[c]) {\n entry = dictionary[c];\n } else {\n if (c === dictSize) {\n entry = w + w.charAt(0);\n } else {\n return null;\n }\n }\n result.push(entry);\n\n // Add w+entry[0] to the dictionary.\n dictionary[dictSize++] = w + entry.charAt(0);\n enlargeIn--;\n\n w = entry;\n\n if (enlargeIn == 0) {\n enlargeIn = Math.pow(2, numBits);\n numBits++;\n }\n\n }\n }\n};\n return LZString;\n})();\n\nif (typeof define === 'function' && define.amd) {\n define(function () { return LZString; });\n} else if( typeof module !== 'undefined' && module != null ) {\n module.exports = LZString\n} else if( typeof angular !== 'undefined' && angular != null ) {\n angular.module('LZString', [])\n .factory('LZString', function () {\n return LZString;\n });\n}\n","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2084%2062'%3e%3crect%20width='64'%20height='48'%20x='18'%20y='2'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3crect%20width='32'%20height='48'%20x='2'%20y='12'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%234169E1'%20d='M14%2052a4%204%200%201%201-8%200%204%204%200%200%201%208%200Zm64-42a4%204%200%201%201-8%200%204%204%200%200%201%208%200Z'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2082%2062'%3e%3crect%20width='78'%20height='58'%20x='2'%20y='2'%20fill='%23999'%20fill-opacity='.3'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3crect%20width='18'%20height='46'%20x='8'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3crect%20width='18'%20height='46'%20x='32'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3crect%20width='18'%20height='46'%20x='56'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2084%2062'%3e%3crect%20width='64'%20height='48'%20x='18'%20y='2'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%23999'%20fill-opacity='.3'%20d='M19%203h62v10H19z'/%3e%3cpath%20stroke='%234169E1'%20stroke-width='2'%20d='M43%208a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3cpath%20stroke='%23999'%20stroke-width='2'%20d='M52%208a2%202%200%201%201-4%200%202%202%200%200%201%204%200Zm9%200a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3crect%20width='32'%20height='48'%20x='2'%20y='12'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%23999'%20fill-opacity='.3'%20d='M3%2049h30v10H3z'/%3e%3cpath%20stroke='%234169E1'%20stroke-width='2'%20d='M11%2054a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3cpath%20stroke='%23999'%20stroke-width='2'%20d='M20%2054a2%202%200%201%201-4%200%202%202%200%200%201%204%200Zm9%200a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3c/svg%3e\"","import { api } from '../utils/api';\nimport store from '../utils/store';\n\nconst LIMIT = 200;\nconst MAX_FETCH = 10;\n\nexport async function fetchFollowedTags() {\n const { masto } = api();\n const iterator = masto.v1.followedTags.list({\n limit: LIMIT,\n });\n const tags = [];\n let fetchCount = 0;\n do {\n const { value, done } = await iterator.next();\n if (done || value?.length === 0) break;\n tags.push(...value);\n fetchCount++;\n } while (fetchCount < MAX_FETCH);\n tags.sort((a, b) => a.name.localeCompare(b.name));\n console.log(tags);\n\n if (tags.length) {\n setTimeout(() => {\n // Save to local storage, with saved timestamp\n store.account.set('followedTags', {\n tags,\n updatedAt: Date.now(),\n });\n }, 1);\n }\n\n return tags;\n}\n\nconst MAX_AGE = 24 * 60 * 60 * 1000; // 1 day\nexport async function getFollowedTags() {\n try {\n const { tags, updatedAt } = store.account.get('followedTags') || {};\n if (!tags?.length) return await fetchFollowedTags();\n if (Date.now() - updatedAt > MAX_AGE) {\n // Stale-while-revalidate\n fetchFollowedTags();\n return tags;\n }\n return tags;\n } catch (e) {\n return [];\n }\n}\n\nconst fauxDiv = document.createElement('div');\nexport const extractTagsFromStatus = (content) => {\n if (!content) return [];\n if (content.indexOf('#') === -1) return [];\n fauxDiv.innerHTML = content;\n const hashtagLinks = fauxDiv.querySelectorAll('a.hashtag');\n if (!hashtagLinks.length) return [];\n return Array.from(hashtagLinks).map((a) =>\n a.innerText.trim().replace(/^[^#]*#+/, ''),\n );\n};\n","import { useEffect, useState } from 'preact/hooks';\n\nfunction AsyncText({ children }) {\n if (typeof children === 'string') return children;\n const [text, setText] = useState('');\n useEffect(() => {\n Promise.resolve(children).then(setText);\n }, [children]);\n return text;\n}\n\nexport default AsyncText;\n","import './shortcuts-settings.css';\n\nimport { useAutoAnimate } from '@formkit/auto-animate/preact';\nimport { msg, Plural, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport {\n compressToEncodedURIComponent,\n decompressFromEncodedURIComponent,\n} from 'lz-string';\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport floatingButtonUrl from '../assets/floating-button.svg';\nimport multiColumnUrl from '../assets/multi-column.svg';\nimport tabMenuBarUrl from '../assets/tab-menu-bar.svg';\n\nimport { api } from '../utils/api';\nimport { fetchFollowedTags } from '../utils/followed-tags';\nimport { getLists, getListTitle } from '../utils/lists';\nimport pmem from '../utils/pmem';\nimport showToast from '../utils/show-toast';\nimport states from '../utils/states';\nimport store from '../utils/store';\nimport { getCurrentAccountID } from '../utils/store-utils';\n\nimport AsyncText from './AsyncText';\nimport Icon from './icon';\nimport MenuConfirm from './menu-confirm';\nimport Modal from './modal';\n\nexport const SHORTCUTS_LIMIT = 9;\n\nconst TYPES = [\n 'following',\n 'mentions',\n 'notifications',\n 'list',\n 'public',\n 'trending',\n 'search',\n 'hashtag',\n 'bookmarks',\n 'favourites',\n // NOTE: Hide for now\n // 'account-statuses', // Need @acct search first\n];\nconst TYPE_TEXT = {\n following: msg`Home / Following`,\n notifications: msg`Notifications`,\n list: msg`Lists`,\n public: msg`Public (Local / Federated)`,\n search: msg`Search`,\n 'account-statuses': msg`Account`,\n bookmarks: msg`Bookmarks`,\n favourites: msg`Likes`,\n hashtag: msg`Hashtag`,\n trending: msg`Trending`,\n mentions: msg`Mentions`,\n};\nconst TYPE_PARAMS = {\n list: [\n {\n text: msg`List ID`,\n name: 'id',\n notRequired: true,\n },\n ],\n public: [\n {\n text: msg`Local only`,\n name: 'local',\n type: 'checkbox',\n },\n {\n text: msg`Instance`,\n name: 'instance',\n type: 'text',\n placeholder: msg`Optional, e.g. mastodon.social`,\n notRequired: true,\n },\n ],\n trending: [\n {\n text: msg`Instance`,\n name: 'instance',\n type: 'text',\n placeholder: msg`Optional, e.g. mastodon.social`,\n notRequired: true,\n },\n ],\n search: [\n {\n text: msg`Search term`,\n name: 'query',\n type: 'text',\n placeholder: msg`Optional, unless for multi-column mode`,\n notRequired: true,\n },\n ],\n 'account-statuses': [\n {\n text: '@',\n name: 'id',\n type: 'text',\n placeholder: 'cheeaun@mastodon.social',\n },\n ],\n hashtag: [\n {\n text: '#',\n name: 'hashtag',\n type: 'text',\n placeholder: msg`e.g. PixelArt (Max 5, space-separated)`,\n pattern: '[^#]+',\n },\n {\n text: msg`Media only`,\n name: 'media',\n type: 'checkbox',\n },\n {\n text: msg`Instance`,\n name: 'instance',\n type: 'text',\n placeholder: msg`Optional, e.g. mastodon.social`,\n notRequired: true,\n },\n ],\n};\nconst fetchAccountTitle = pmem(async ({ id }) => {\n const account = await api().masto.v1.accounts.$select(id).fetch();\n return account.username || account.acct || account.displayName;\n});\nexport const SHORTCUTS_META = {\n following: {\n id: 'home',\n title: (_, index) =>\n index === 0\n ? t`Home`\n : t({ id: 'following.title', message: 'Following' }),\n path: '/',\n icon: 'home',\n },\n mentions: {\n id: 'mentions',\n title: msg`Mentions`,\n path: '/mentions',\n icon: 'at',\n },\n notifications: {\n id: 'notifications',\n title: msg`Notifications`,\n path: '/notifications',\n icon: 'notification',\n },\n list: {\n id: ({ id }) => (id ? 'list' : 'lists'),\n title: ({ id }) => (id ? getListTitle(id) : t`Lists`),\n path: ({ id }) => (id ? `/l/${id}` : '/l'),\n icon: 'list',\n excludeViewMode: ({ id }) => (!id ? ['multi-column'] : []),\n },\n public: {\n id: 'public',\n title: ({ local }) => (local ? t`Local` : t`Federated`),\n subtitle: ({ instance }) => instance || api().instance,\n path: ({ local, instance }) => `/${instance}/p${local ? '/l' : ''}`,\n icon: ({ local }) => (local ? 'building' : 'earth'),\n },\n trending: {\n id: 'trending',\n title: msg`Trending`,\n subtitle: ({ instance }) => instance || api().instance,\n path: ({ instance }) => `/${instance}/trending`,\n icon: 'chart',\n },\n search: {\n id: 'search',\n title: ({ query }) => (query ? `“${query}”` : t`Search`),\n path: ({ query }) =>\n query\n ? `/search?q=${encodeURIComponent(query)}&type=statuses`\n : '/search',\n icon: 'search',\n excludeViewMode: ({ query }) => (!query ? ['multi-column'] : []),\n },\n 'account-statuses': {\n id: 'account-statuses',\n title: fetchAccountTitle,\n path: ({ id }) => `/a/${id}`,\n icon: 'user',\n },\n bookmarks: {\n id: 'bookmarks',\n title: msg`Bookmarks`,\n path: '/b',\n icon: 'bookmark',\n },\n favourites: {\n id: 'favourites',\n title: msg`Likes`,\n path: '/f',\n icon: 'heart',\n },\n hashtag: {\n id: 'hashtag',\n title: ({ hashtag }) => hashtag,\n subtitle: ({ instance }) => instance || api().instance,\n path: ({ hashtag, instance, media }) =>\n `${instance ? `/${instance}` : ''}/t/${hashtag.split(/\\s+/).join('+')}${\n media ? '?media=1' : ''\n }`,\n icon: 'hashtag',\n },\n};\n\nfunction ShortcutsSettings({ onClose }) {\n const { _ } = useLingui();\n const snapStates = useSnapshot(states);\n const { shortcuts } = snapStates;\n const [showForm, setShowForm] = useState(false);\n const [showImportExport, setShowImportExport] = useState(false);\n\n const [shortcutsListParent] = useAutoAnimate();\n\n return (\n <div id=\"shortcuts-settings-container\" class=\"sheet\" tabindex=\"-1\">\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 <Icon icon=\"shortcut\" /> <Trans>Shortcuts</Trans>{' '}\n <sup\n style={{\n fontSize: 12,\n opacity: 0.5,\n textTransform: 'uppercase',\n }}\n >\n <Trans>beta</Trans>\n </sup>\n </h2>\n </header>\n <main>\n <p>\n <Trans>Specify a list of shortcuts that'll appear as:</Trans>\n </p>\n <div class=\"shortcuts-view-mode\">\n {[\n {\n value: 'float-button',\n label: t`Floating button`,\n imgURL: floatingButtonUrl,\n },\n {\n value: 'tab-menu-bar',\n label: t`Tab/Menu bar`,\n imgURL: tabMenuBarUrl,\n },\n {\n value: 'multi-column',\n label: t`Multi-column`,\n imgURL: multiColumnUrl,\n },\n ].map(({ value, label, imgURL }) => {\n const checked =\n snapStates.settings.shortcutsViewMode === value ||\n (value === 'float-button' &&\n !snapStates.settings.shortcutsViewMode);\n return (\n <label key={value} class={checked ? 'checked' : ''}>\n <input\n type=\"radio\"\n name=\"shortcuts-view-mode\"\n value={value}\n checked={checked}\n onChange={(e) => {\n states.settings.shortcutsViewMode = e.target.value;\n }}\n />{' '}\n <img src={imgURL} alt=\"\" width=\"80\" height=\"58\" />{' '}\n <span>{label}</span>\n </label>\n );\n })}\n </div>\n {shortcuts.length > 0 ? (\n <>\n <ol class=\"shortcuts-list\" ref={shortcutsListParent}>\n {shortcuts.filter(Boolean).map((shortcut, i) => {\n // const key = i + Object.values(shortcut);\n const key = Object.values(shortcut).join('-');\n const { type } = shortcut;\n if (!SHORTCUTS_META[type]) return null;\n let { icon, title, subtitle, excludeViewMode } =\n SHORTCUTS_META[type];\n if (typeof title === 'function') {\n title = title(shortcut, i);\n } else {\n title = _(title);\n }\n if (typeof subtitle === 'function') {\n subtitle = subtitle(shortcut, i);\n } else {\n subtitle = _(subtitle);\n }\n if (typeof icon === 'function') {\n icon = icon(shortcut, i);\n }\n if (typeof excludeViewMode === 'function') {\n excludeViewMode = excludeViewMode(shortcut, i);\n }\n const excludedViewMode = excludeViewMode?.includes(\n snapStates.settings.shortcutsViewMode,\n );\n return (\n <li key={key}>\n <Icon icon={icon} />\n <span class=\"shortcut-text\">\n <AsyncText>{title}</AsyncText>\n {subtitle && (\n <>\n {' '}\n <small class=\"ib insignificant\">{subtitle}</small>\n </>\n )}\n {excludedViewMode && (\n <span class=\"tag\">\n <Trans>Not available in current view mode</Trans>\n </span>\n )}\n </span>\n <span class=\"shortcut-actions\">\n <button\n type=\"button\"\n class=\"plain small\"\n disabled={i === 0}\n onClick={() => {\n const shortcutsArr = Array.from(states.shortcuts);\n if (i > 0) {\n const temp = states.shortcuts[i - 1];\n shortcutsArr[i - 1] = shortcut;\n shortcutsArr[i] = temp;\n states.shortcuts = shortcutsArr;\n }\n }}\n >\n <Icon icon=\"arrow-up\" alt={t`Move up`} />\n </button>\n <button\n type=\"button\"\n class=\"plain small\"\n disabled={i === shortcuts.length - 1}\n onClick={() => {\n const shortcutsArr = Array.from(states.shortcuts);\n if (i < states.shortcuts.length - 1) {\n const temp = states.shortcuts[i + 1];\n shortcutsArr[i + 1] = shortcut;\n shortcutsArr[i] = temp;\n states.shortcuts = shortcutsArr;\n }\n }}\n >\n <Icon icon=\"arrow-down\" alt={t`Move down`} />\n </button>\n <button\n type=\"button\"\n class=\"plain small\"\n onClick={() => {\n setShowForm({\n shortcut,\n shortcutIndex: i,\n });\n }}\n >\n <Icon icon=\"pencil\" alt={t`Edit`} />\n </button>\n {/* <button\n type=\"button\"\n class=\"plain small\"\n onClick={() => {\n states.shortcuts.splice(i, 1);\n }}\n >\n <Icon icon=\"x\" alt=\"Remove\" />\n </button> */}\n </span>\n </li>\n );\n })}\n </ol>\n {shortcuts.length === 1 &&\n snapStates.settings.shortcutsViewMode !== 'float-button' && (\n <div class=\"ui-state insignificant\">\n <Icon icon=\"info\" />{' '}\n <small>\n <Trans>\n Add more than one shortcut/column to make this work.\n </Trans>\n </small>\n </div>\n )}\n </>\n ) : (\n <div class=\"ui-state insignificant\">\n <p>\n {snapStates.settings.shortcutsViewMode === 'multi-column'\n ? t`No columns yet. Tap on the Add column button.`\n : t`No shortcuts yet. Tap on the Add shortcut button.`}\n </p>\n <p>\n <Trans>\n Not sure what to add?\n <br />\n Try adding{' '}\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n states.shortcuts = [\n {\n type: 'following',\n },\n {\n type: 'notifications',\n },\n ];\n }}\n >\n Home / Following and Notifications\n </a>{' '}\n first.\n </Trans>\n </p>\n </div>\n )}\n <p class=\"insignificant\">\n {shortcuts.length >= SHORTCUTS_LIMIT &&\n (snapStates.settings.shortcutsViewMode === 'multi-column'\n ? t`Max ${SHORTCUTS_LIMIT} columns`\n : t`Max ${SHORTCUTS_LIMIT} shortcuts`)}\n </p>\n <p\n style={{\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n }}\n >\n <button\n type=\"button\"\n class=\"light\"\n onClick={() => setShowImportExport(true)}\n >\n <Trans>Import/export</Trans>\n </button>\n <button\n type=\"button\"\n disabled={shortcuts.length >= SHORTCUTS_LIMIT}\n onClick={() => setShowForm(true)}\n >\n <Icon icon=\"plus\" />{' '}\n <span>\n {snapStates.settings.shortcutsViewMode === 'multi-column'\n ? t`Add column…`\n : t`Add shortcut…`}\n </span>\n </button>\n </p>\n </main>\n {showForm && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowForm(false);\n }\n }}\n >\n <ShortcutForm\n shortcut={showForm.shortcut}\n shortcutIndex={showForm.shortcutIndex}\n onSubmit={({ result, mode }) => {\n console.log('onSubmit', result);\n if (mode === 'edit') {\n states.shortcuts[showForm.shortcutIndex] = result;\n } else {\n states.shortcuts.push(result);\n }\n }}\n onClose={() => setShowForm(false)}\n />\n </Modal>\n )}\n {showImportExport && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowImportExport(false);\n }\n }}\n >\n <ImportExport\n shortcuts={shortcuts}\n onClose={() => setShowImportExport(false)}\n />\n </Modal>\n )}\n </div>\n );\n}\n\nconst FORM_NOTES = {\n list: msg`Specific list is optional. For multi-column mode, list is required, else the column will not be shown.`,\n search: msg`For multi-column mode, search term is required, else the column will not be shown.`,\n hashtag: msg`Multiple hashtags are supported. Space-separated.`,\n};\n\nfunction ShortcutForm({\n onSubmit,\n disabled,\n shortcut,\n shortcutIndex,\n onClose,\n}) {\n const { _ } = useLingui();\n console.log('shortcut', shortcut);\n const editMode = !!shortcut;\n const [currentType, setCurrentType] = useState(shortcut?.type || null);\n\n const [uiState, setUIState] = useState('default');\n const [lists, setLists] = useState([]);\n const [followedHashtags, setFollowedHashtags] = useState([]);\n useEffect(() => {\n (async () => {\n if (currentType !== 'list') return;\n try {\n setUIState('loading');\n const lists = await getLists();\n setLists(lists);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n\n (async () => {\n if (currentType !== 'hashtag') return;\n try {\n const tags = await fetchFollowedTags();\n setFollowedHashtags(tags);\n } catch (e) {\n console.error(e);\n }\n })();\n }, [currentType]);\n\n const formRef = useRef();\n useEffect(() => {\n if (editMode && currentType && TYPE_PARAMS[currentType]) {\n // Populate form\n const form = formRef.current;\n TYPE_PARAMS[currentType].forEach(({ name, type }) => {\n const input = form.querySelector(`[name=\"${name}\"]`);\n if (input && shortcut[name]) {\n if (type === 'checkbox') {\n input.checked = shortcut[name] === 'on' ? true : false;\n } else {\n input.value = shortcut[name];\n }\n }\n });\n }\n }, [editMode, currentType]);\n\n return (\n <div id=\"shortcut-settings-form\" 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>{editMode ? t`Edit shortcut` : t`Add shortcut`}</h2>\n </header>\n <main tabindex=\"-1\">\n <form\n ref={formRef}\n onSubmit={(e) => {\n // Construct a nice object from form\n e.preventDefault();\n const data = new FormData(e.target);\n const result = {};\n data.forEach((value, key) => {\n result[key] = value?.trim();\n if (key === 'instance') {\n // Remove protocol and trailing slash\n result[key] = result[key]\n .replace(/^https?:\\/\\//, '')\n .replace(/\\/+$/, '');\n // Remove @acct@ or acct@ from instance URL\n result[key] = result[key].replace(/^@?[^@]+@/, '');\n }\n });\n console.log('result', result);\n if (!result.type) return;\n onSubmit({\n result,\n mode: editMode ? 'edit' : 'add',\n });\n // Reset\n e.target.reset();\n setCurrentType(null);\n onClose?.();\n }}\n >\n <p>\n <label>\n <span>\n <Trans>Timeline</Trans>\n </span>\n <select\n required\n disabled={disabled}\n onChange={(e) => {\n setCurrentType(e.target.value);\n }}\n defaultValue={editMode ? shortcut.type : undefined}\n name=\"type\"\n dir=\"auto\"\n >\n <option></option>\n {TYPES.map((type) => (\n <option value={type}>{_(TYPE_TEXT[type])}</option>\n ))}\n </select>\n </label>\n </p>\n {TYPE_PARAMS[currentType]?.map?.(\n ({ text, name, type, placeholder, pattern, notRequired }) => {\n if (currentType === 'list') {\n return (\n <p>\n <label>\n <span>\n <Trans>List</Trans>\n </span>\n <select\n name=\"id\"\n required={!notRequired}\n disabled={disabled || uiState === 'loading'}\n defaultValue={editMode ? shortcut.id : undefined}\n dir=\"auto\"\n >\n <option value=\"\"></option>\n {lists.map((list) => (\n <option value={list.id}>{list.title}</option>\n ))}\n </select>\n </label>\n </p>\n );\n }\n\n return (\n <p>\n <label>\n <span>{_(text)}</span>{' '}\n <input\n type={type}\n switch={type === 'checkbox' || undefined}\n name={name}\n placeholder={_(placeholder)}\n required={type === 'text' && !notRequired}\n disabled={disabled}\n list={\n currentType === 'hashtag'\n ? 'followed-hashtags-datalist'\n : null\n }\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellCheck={false}\n pattern={pattern}\n dir=\"auto\"\n />\n {currentType === 'hashtag' &&\n followedHashtags.length > 0 && (\n <datalist id=\"followed-hashtags-datalist\">\n {followedHashtags.map((tag) => (\n <option value={tag.name} />\n ))}\n </datalist>\n )}\n </label>\n </p>\n );\n },\n )}\n {!!FORM_NOTES[currentType] && (\n <p class=\"form-note insignificant\">\n <Icon icon=\"info\" />\n {_(FORM_NOTES[currentType])}\n </p>\n )}\n <footer>\n <button\n type=\"submit\"\n class=\"block\"\n disabled={disabled || uiState === 'loading'}\n >\n {editMode ? t`Save` : t`Add`}\n </button>\n {editMode && (\n <button\n type=\"button\"\n class=\"light danger\"\n onClick={() => {\n states.shortcuts.splice(shortcutIndex, 1);\n onClose?.();\n }}\n >\n <Trans>Remove</Trans>\n </button>\n )}\n </footer>\n </form>\n </main>\n </div>\n );\n}\n\nfunction ImportExport({ shortcuts, onClose }) {\n const { _ } = useLingui();\n const { masto } = api();\n const shortcutsStr = useMemo(() => {\n if (!shortcuts) return '';\n if (!shortcuts.filter(Boolean).length) return '';\n return compressToEncodedURIComponent(\n JSON.stringify(shortcuts.filter(Boolean)),\n );\n }, [shortcuts]);\n const [importShortcutStr, setImportShortcutStr] = useState('');\n const [importUIState, setImportUIState] = useState('default');\n const parsedImportShortcutStr = useMemo(() => {\n if (!importShortcutStr) {\n setImportUIState('default');\n return null;\n }\n try {\n const parsed = JSON.parse(\n decompressFromEncodedURIComponent(importShortcutStr),\n );\n // Very basic validation, I know\n if (!Array.isArray(parsed)) throw new Error('Not an array');\n setImportUIState('default');\n return parsed;\n } catch (err) {\n // Fallback to JSON string parsing\n // There's a chance that someone might want to import a JSON string instead of the compressed version\n try {\n const parsed = JSON.parse(importShortcutStr);\n if (!Array.isArray(parsed)) throw new Error('Not an array');\n setImportUIState('default');\n return parsed;\n } catch (err) {\n setImportUIState('error');\n return null;\n }\n }\n }, [importShortcutStr]);\n const hasCurrentSettings = states.shortcuts.length > 0;\n\n const shortcutsImportFieldRef = useRef();\n\n return (\n <div id=\"import-export-container\" 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>\n Import/Export <small class=\"ib insignificant\">Shortcuts</small>\n </Trans>\n </h2>\n </header>\n <main tabindex=\"-1\">\n <section>\n <h3>\n <Icon icon=\"arrow-down-circle\" size=\"l\" class=\"insignificant\" />{' '}\n <span>\n <Trans>Import</Trans>\n </span>\n </h3>\n <p class=\"field-button\">\n <input\n ref={shortcutsImportFieldRef}\n type=\"text\"\n name=\"import\"\n placeholder={t`Paste shortcuts here`}\n class=\"block\"\n onInput={(e) => {\n setImportShortcutStr(e.target.value);\n }}\n dir=\"auto\"\n />\n {states.settings.shortcutSettingsCloudImportExport && (\n <button\n type=\"button\"\n class=\"plain2 small\"\n disabled={importUIState === 'cloud-downloading'}\n onClick={async () => {\n setImportUIState('cloud-downloading');\n const currentAccount = getCurrentAccountID();\n showToast(\n t`Downloading saved shortcuts from instance server…`,\n );\n try {\n const relationships =\n await masto.v1.accounts.relationships.fetch({\n id: [currentAccount],\n });\n const relationship = relationships[0];\n if (relationship) {\n const { note = '' } = relationship;\n if (\n /<phanpy-shortcuts-settings>(.*)<\\/phanpy-shortcuts-settings>/.test(\n note,\n )\n ) {\n const settings = note.match(\n /<phanpy-shortcuts-settings>(.*)<\\/phanpy-shortcuts-settings>/,\n )[1];\n const { v, dt, data } = JSON.parse(settings);\n shortcutsImportFieldRef.current.value = data;\n shortcutsImportFieldRef.current.dispatchEvent(\n new Event('input'),\n );\n }\n }\n setImportUIState('default');\n } catch (e) {\n console.error(e);\n setImportUIState('error');\n showToast(t`Unable to download shortcuts`);\n }\n }}\n title={t`Download shortcuts from instance server`}\n >\n <Icon icon=\"cloud\" />\n <Icon icon=\"arrow-down\" />\n </button>\n )}\n </p>\n {!!parsedImportShortcutStr &&\n Array.isArray(parsedImportShortcutStr) && (\n <>\n <p>\n <b>{parsedImportShortcutStr.length}</b> shortcut\n {parsedImportShortcutStr.length > 1 ? 's' : ''}{' '}\n <small class=\"insignificant\">\n ({importShortcutStr.length} characters)\n </small>\n </p>\n <ol class=\"import-settings-list\">\n {parsedImportShortcutStr.map((shortcut) => (\n <li>\n <span\n style={{\n opacity: shortcuts.some((s) =>\n // Compare all properties\n Object.keys(s).every(\n (key) => s[key] === shortcut[key],\n ),\n )\n ? 1\n : 0,\n }}\n >\n *\n </span>\n <span>\n {_(TYPE_TEXT[shortcut.type])}\n {shortcut.type === 'list' && ' ⚠️'}{' '}\n {TYPE_PARAMS[shortcut.type]?.map?.(\n ({ text, name, type }) =>\n shortcut[name] ? (\n <>\n <span class=\"tag collapsed insignificant\">\n {text}:{' '}\n {type === 'checkbox'\n ? shortcut[name] === 'on'\n ? '✅'\n : '❌'\n : shortcut[name]}\n </span>{' '}\n </>\n ) : null,\n )}\n </span>\n </li>\n ))}\n </ol>\n <p>\n <small>\n <Trans>* Exists in current shortcuts</Trans>\n </small>\n <br />\n <small>\n ⚠️{' '}\n <Trans>\n List may not work if it's from a different account.\n </Trans>\n </small>\n </p>\n </>\n )}\n {importUIState === 'error' && (\n <p class=\"error\">\n <small>\n ⚠️ <Trans>Invalid settings format</Trans>\n </small>\n </p>\n )}\n <p>\n {hasCurrentSettings && (\n <>\n <MenuConfirm\n confirmLabel={t`Append to current shortcuts?`}\n menuFooter={\n <div class=\"footer\">\n <Trans>\n Only shortcuts that don’t exist in current shortcuts\n will be appended.\n </Trans>\n </div>\n }\n onClick={() => {\n // states.shortcuts = [\n // ...states.shortcuts,\n // ...parsedImportShortcutStr,\n // ];\n // Append non-unique shortcuts only\n const nonUniqueShortcuts = parsedImportShortcutStr.filter(\n (shortcut) =>\n !states.shortcuts.some((s) =>\n // Compare all properties\n Object.keys(s).every(\n (key) => s[key] === shortcut[key],\n ),\n ),\n );\n if (!nonUniqueShortcuts.length) {\n showToast(t`No new shortcuts to import`);\n return;\n }\n let newShortcuts = [\n ...states.shortcuts,\n ...nonUniqueShortcuts,\n ];\n const exceededLimit = newShortcuts.length > SHORTCUTS_LIMIT;\n if (exceededLimit) {\n // If exceeded, trim it\n newShortcuts = newShortcuts.slice(0, SHORTCUTS_LIMIT);\n }\n states.shortcuts = newShortcuts;\n showToast(\n exceededLimit\n ? t`Shortcuts imported. Exceeded max ${SHORTCUTS_LIMIT}, so the rest are not imported.`\n : t`Shortcuts imported`,\n );\n onClose?.();\n }}\n >\n <button\n type=\"button\"\n class=\"plain2\"\n disabled={!parsedImportShortcutStr}\n >\n <Trans>Import & append…</Trans>\n </button>\n </MenuConfirm>{' '}\n </>\n )}\n <MenuConfirm\n confirmLabel={\n hasCurrentSettings\n ? t`Override current shortcuts?`\n : t`Import shortcuts?`\n }\n menuItemClassName={hasCurrentSettings ? 'danger' : undefined}\n onClick={() => {\n states.shortcuts = parsedImportShortcutStr;\n showToast(t`Shortcuts imported`);\n onClose?.();\n }}\n >\n <button\n type=\"button\"\n class=\"plain2\"\n disabled={!parsedImportShortcutStr}\n >\n {hasCurrentSettings ? t`or override…` : t`Import…`}\n </button>\n </MenuConfirm>\n </p>\n </section>\n <section>\n <h3>\n <Icon icon=\"arrow-up-circle\" size=\"l\" class=\"insignificant\" />{' '}\n <span>\n <Trans>Export</Trans>\n </span>\n </h3>\n <p>\n <input\n style={{ width: '100%' }}\n type=\"text\"\n value={shortcutsStr}\n readOnly\n onClick={(e) => {\n if (!e.target.value) return;\n e.target.select();\n // Copy url to clipboard\n try {\n navigator.clipboard.writeText(e.target.value);\n showToast(t`Shortcuts copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy shortcuts`);\n }\n }}\n dir=\"auto\"\n />\n </p>\n <p>\n <button\n type=\"button\"\n class=\"plain2\"\n disabled={!shortcutsStr}\n onClick={() => {\n try {\n navigator.clipboard.writeText(shortcutsStr);\n showToast(t`Shortcut settings copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy shortcut settings`);\n }\n }}\n >\n <Icon icon=\"clipboard\" />{' '}\n <span>\n <Trans>Copy</Trans>\n </span>\n </button>{' '}\n {navigator?.share &&\n navigator?.canShare?.({\n text: shortcutsStr,\n }) && (\n <button\n type=\"button\"\n class=\"plain2\"\n disabled={!shortcutsStr}\n onClick={() => {\n try {\n navigator.share({\n text: shortcutsStr,\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 </button>\n )}{' '}\n {states.settings.shortcutSettingsCloudImportExport && (\n <button\n type=\"button\"\n class=\"plain2\"\n disabled={importUIState === 'cloud-uploading'}\n onClick={async () => {\n setImportUIState('cloud-uploading');\n const currentAccount = getCurrentAccountID();\n try {\n const relationships =\n await masto.v1.accounts.relationships.fetch({\n id: [currentAccount],\n });\n const relationship = relationships[0];\n if (relationship) {\n const { note = '' } = relationship;\n // const newNote = `${note}\\n\\n\\n$<phanpy-shortcuts-settings>{shortcutsStr}</phanpy-shortcuts-settings>`;\n let newNote = '';\n const settingsJSON = JSON.stringify({\n v: '1', // version\n dt: Date.now(), // datetime stamp\n data: shortcutsStr, // shortcuts settings string\n });\n if (\n /<phanpy-shortcuts-settings>(.*)<\\/phanpy-shortcuts-settings>/.test(\n note,\n )\n ) {\n newNote = note.replace(\n /<phanpy-shortcuts-settings>(.*)<\\/phanpy-shortcuts-settings>/,\n `<phanpy-shortcuts-settings>${settingsJSON}</phanpy-shortcuts-settings>`,\n );\n } else {\n newNote = `${note}\\n\\n\\n<phanpy-shortcuts-settings>${settingsJSON}</phanpy-shortcuts-settings>`;\n }\n showToast(t`Saving shortcuts to instance server…`);\n await masto.v1.accounts\n .$select(currentAccount)\n .note.create({\n comment: newNote,\n });\n setImportUIState('default');\n showToast(t`Shortcuts saved`);\n }\n } catch (e) {\n console.error(e);\n setImportUIState('error');\n showToast(t`Unable to save shortcuts`);\n }\n }}\n title={t`Sync to instance server`}\n >\n <Icon icon=\"cloud\" />\n <Icon icon=\"arrow-up\" />\n </button>\n )}{' '}\n {shortcutsStr.length > 0 && (\n <small class=\"insignificant ib\">\n <Plural\n value={shortcutsStr.length}\n one=\"# character\"\n other=\"# characters\"\n />\n </small>\n )}\n </p>\n {!!shortcutsStr && (\n <details>\n <summary class=\"insignificant\">\n <small>\n <Trans>Raw Shortcuts JSON</Trans>\n </small>\n </summary>\n <textarea style={{ width: '100%' }} rows={10} readOnly>\n {JSON.stringify(shortcuts.filter(Boolean), null, 2)}\n </textarea>\n </details>\n )}\n </section>\n {states.settings.shortcutSettingsCloudImportExport && (\n <footer>\n <p>\n <Icon icon=\"cloud\" />{' '}\n <Trans>\n Import/export settings from/to instance server (Very\n experimental)\n </Trans>\n </p>\n </footer>\n )}\n </main>\n </div>\n );\n}\n\nexport default ShortcutsSettings;\n","import { t, Trans } from '@lingui/macro';\nimport { useEffect } from 'preact/hooks';\nimport { useLocation, useNavigate } from 'react-router-dom';\nimport { subscribe, useSnapshot } from 'valtio';\n\nimport Accounts from '../pages/accounts';\nimport Settings from '../pages/settings';\nimport focusDeck from '../utils/focus-deck';\nimport showToast from '../utils/show-toast';\nimport states from '../utils/states';\n\nimport AccountSheet from './account-sheet';\nimport ComposeSuspense, { preload } from './compose-suspense';\nimport Drafts from './drafts';\nimport EmbedModal from './embed-modal';\nimport GenericAccounts from './generic-accounts';\nimport MediaAltModal from './media-alt-modal';\nimport MediaModal from './media-modal';\nimport Modal from './modal';\nimport ReportModal from './report-modal';\nimport ShortcutsSettings from './shortcuts-settings';\n\nsubscribe(states, (changes) => {\n for (const [action, path, value, prevValue] of changes) {\n // When closing modal, focus on deck\n if (/^show/i.test(path) && !value) {\n focusDeck();\n }\n }\n});\n\nexport default function Modals() {\n const snapStates = useSnapshot(states);\n const navigate = useNavigate();\n const location = useLocation();\n\n useEffect(() => {\n setTimeout(preload, 1000);\n }, []);\n\n return (\n <>\n {!!snapStates.showCompose && (\n <Modal\n class={`solid ${snapStates.composerState.minimized ? 'min' : ''}`}\n minimized={!!snapStates.composerState.minimized}\n >\n <ComposeSuspense\n replyToStatus={\n typeof snapStates.showCompose !== 'boolean'\n ? snapStates.showCompose.replyToStatus\n : window.__COMPOSE__?.replyToStatus || null\n }\n editStatus={\n states.showCompose?.editStatus ||\n window.__COMPOSE__?.editStatus ||\n null\n }\n draftStatus={\n states.showCompose?.draftStatus ||\n window.__COMPOSE__?.draftStatus ||\n null\n }\n onClose={(results) => {\n const { newStatus, instance, type } = results || {};\n states.showCompose = false;\n window.__COMPOSE__ = null;\n if (newStatus) {\n states.reloadStatusPage++;\n showToast({\n text: {\n post: t`Post published. Check it out.`,\n reply: t`Reply posted. Check it out.`,\n edit: t`Post updated. Check it out.`,\n }[type || 'post'],\n delay: 1000,\n duration: 10_000, // 10 seconds\n onClick: (toast) => {\n toast.hideToast();\n states.prevLocation = location;\n navigate(\n instance\n ? `/${instance}/s/${newStatus.id}`\n : `/s/${newStatus.id}`,\n );\n },\n });\n }\n }}\n />\n </Modal>\n )}\n {!!snapStates.showSettings && (\n <Modal\n onClose={() => {\n states.showSettings = false;\n }}\n >\n <Settings\n onClose={() => {\n states.showSettings = false;\n }}\n />\n </Modal>\n )}\n {!!snapStates.showAccounts && (\n <Modal\n onClose={() => {\n states.showAccounts = false;\n }}\n >\n <Accounts\n onClose={() => {\n states.showAccounts = false;\n }}\n />\n </Modal>\n )}\n {!!snapStates.showAccount && (\n <Modal\n onClose={() => {\n states.showAccount = false;\n }}\n >\n <AccountSheet\n account={snapStates.showAccount?.account || snapStates.showAccount}\n instance={snapStates.showAccount?.instance}\n onClose={({ destination } = {}) => {\n states.showAccount = false;\n // states.showGenericAccounts = false;\n // if (destination) {\n // states.showAccounts = false;\n // }\n }}\n />\n </Modal>\n )}\n {!!snapStates.showDrafts && (\n <Modal\n onClose={() => {\n states.showDrafts = false;\n }}\n >\n <Drafts onClose={() => (states.showDrafts = false)} />\n </Modal>\n )}\n {!!snapStates.showMediaModal && (\n <Modal\n onClick={(e) => {\n if (\n e.target === e.currentTarget ||\n e.target.classList.contains('media')\n ) {\n states.showMediaModal = false;\n }\n }}\n >\n <MediaModal\n mediaAttachments={snapStates.showMediaModal.mediaAttachments}\n instance={snapStates.showMediaModal.instance}\n index={snapStates.showMediaModal.index}\n statusID={snapStates.showMediaModal.statusID}\n onClose={() => {\n states.showMediaModal = false;\n }}\n />\n </Modal>\n )}\n {!!snapStates.showShortcutsSettings && (\n <Modal\n onClose={() => {\n states.showShortcutsSettings = false;\n }}\n >\n <ShortcutsSettings\n onClose={() => (states.showShortcutsSettings = false)}\n />\n </Modal>\n )}\n {!!snapStates.showGenericAccounts && (\n <Modal\n onClose={() => {\n states.showGenericAccounts = false;\n }}\n >\n <GenericAccounts\n instance={snapStates.showGenericAccounts.instance}\n excludeRelationshipAttrs={\n snapStates.showGenericAccounts.excludeRelationshipAttrs\n }\n postID={snapStates.showGenericAccounts.postID}\n onClose={() => (states.showGenericAccounts = false)}\n blankCopy={snapStates.showGenericAccounts.blankCopy}\n />\n </Modal>\n )}\n {!!snapStates.showMediaAlt && (\n <Modal\n onClose={(e) => {\n states.showMediaAlt = false;\n }}\n >\n <MediaAltModal\n alt={snapStates.showMediaAlt.alt || snapStates.showMediaAlt}\n lang={snapStates.showMediaAlt?.lang}\n onClose={() => {\n states.showMediaAlt = false;\n }}\n />\n </Modal>\n )}\n {!!snapStates.showEmbedModal && (\n <Modal\n class=\"solid\"\n onClose={() => {\n states.showEmbedModal = false;\n }}\n >\n <EmbedModal\n html={snapStates.showEmbedModal.html}\n url={snapStates.showEmbedModal.url}\n width={snapStates.showEmbedModal.width}\n height={snapStates.showEmbedModal.height}\n onClose={() => {\n states.showEmbedModal = false;\n }}\n />\n </Modal>\n )}\n {!!snapStates.showReportModal && (\n <Modal\n onClose={() => {\n states.showReportModal = false;\n }}\n >\n <ReportModal\n account={snapStates.showReportModal.account}\n post={snapStates.showReportModal.post}\n onClose={() => {\n states.showReportModal = false;\n }}\n />\n </Modal>\n )}\n </>\n );\n}\n","import { t, Trans } from '@lingui/macro';\nimport { useState } from 'preact/hooks';\n\nimport { api } from '../utils/api';\n\nimport Icon from './icon';\nimport Loader from './loader';\n\nfunction FollowRequestButtons({ accountID, onChange }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [requestState, setRequestState] = useState(null); // accept, reject\n const [relationship, setRelationship] = useState(null);\n\n const hasRelationship = relationship !== null;\n\n return (\n <p class=\"follow-request-buttons\">\n <button\n type=\"button\"\n disabled={uiState === 'loading' || hasRelationship}\n onClick={() => {\n setUIState('loading');\n setRequestState('accept');\n (async () => {\n try {\n const rel = await masto.v1.followRequests\n .$select(accountID)\n .authorize();\n if (!rel?.followedBy) {\n throw new Error('Follow request not accepted');\n }\n setRelationship(rel);\n onChange();\n } catch (e) {\n console.error(e);\n }\n setUIState('default');\n })();\n }}\n >\n <Trans>Accept</Trans>\n </button>{' '}\n <button\n type=\"button\"\n disabled={uiState === 'loading' || hasRelationship}\n class=\"light danger\"\n onClick={() => {\n setUIState('loading');\n setRequestState('reject');\n (async () => {\n try {\n const rel = await masto.v1.followRequests\n .$select(accountID)\n .reject();\n if (rel?.followedBy) {\n throw new Error('Follow request not rejected');\n }\n setRelationship(rel);\n onChange();\n } catch (e) {\n console.error(e);\n setUIState('default');\n }\n })();\n }}\n >\n <Trans>Reject</Trans>\n </button>\n <span class=\"follow-request-states\">\n {hasRelationship && requestState ? (\n requestState === 'accept' ? (\n <Icon\n icon=\"check-circle\"\n alt={t`Accepted`}\n class=\"follow-accepted\"\n />\n ) : (\n <Icon icon=\"x-circle\" alt={t`Rejected`} class=\"follow-rejected\" />\n )\n ) : (\n <Loader hidden={uiState !== 'loading'} />\n )}\n </span>\n </p>\n );\n}\n\nexport default FollowRequestButtons;\n","import { msg, Plural, Select, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { Fragment } from 'preact';\nimport { memo } from 'preact/compat';\n\nimport { api } from '../utils/api';\nimport { isFiltered } from '../utils/filters';\nimport shortenNumber from '../utils/shorten-number';\nimport states, { statusKey } from '../utils/states';\nimport { getCurrentAccountID } from '../utils/store-utils';\nimport useTruncated from '../utils/useTruncated';\n\nimport Avatar from './avatar';\nimport CustomEmoji from './custom-emoji';\nimport FollowRequestButtons from './follow-request-buttons';\nimport Icon from './icon';\nimport Link from './link';\nimport NameText from './name-text';\nimport Status from './status';\n\nconst NOTIFICATION_ICONS = {\n mention: 'comment',\n status: 'notification',\n reblog: 'rocket',\n follow: 'follow',\n follow_request: 'follow-add',\n favourite: 'heart',\n poll: 'poll',\n update: 'pencil',\n 'admin.signup': 'account-edit',\n 'admin.report': 'account-warning',\n severed_relationships: 'heart-break',\n moderation_warning: 'alert',\n emoji_reaction: 'emoji2',\n 'pleroma:emoji_reaction': 'emoji2',\n annual_report: 'celebrate',\n};\n\n/*\nNotification types\n==================\nmention = Someone mentioned you in their status\nstatus = Someone you enabled notifications for has posted a status\nreblog = Someone boosted one of your statuses\nfollow = Someone followed you\nfollow_request = Someone requested to follow you\nfavourite = Someone favourited one of your statuses\npoll = A poll you have voted in or created has ended\nupdate = A status you interacted with has been edited\nadmin.sign_up = Someone signed up (optionally sent to admins)\nadmin.report = A new report has been filed\nsevered_relationships = Severed relationships\nmoderation_warning = Moderation warning\n*/\n\nfunction emojiText({ account, emoji, emoji_url }) {\n let url;\n let staticUrl;\n if (typeof emoji_url === 'string') {\n url = emoji_url;\n } else {\n url = emoji_url?.url;\n staticUrl = emoji_url?.staticUrl;\n }\n const emojiObject = url ? (\n <CustomEmoji url={url} staticUrl={staticUrl} alt={emoji} />\n ) : (\n emoji\n );\n return (\n <Trans>\n {account} reacted to your post with {emojiObject}\n </Trans>\n );\n}\n\nconst contentText = {\n status: ({ account }) => <Trans>{account} published a post.</Trans>,\n reblog: ({\n count,\n account,\n postsCount,\n postType,\n components: { Subject },\n }) => (\n <Plural\n value={count}\n _1={\n <Plural\n value={postsCount}\n _1={\n <Select\n value={postType}\n _reply={<Trans>{account} boosted your reply.</Trans>}\n other={<Trans>{account} boosted your post.</Trans>}\n />\n }\n other={\n <Trans>\n {account} boosted {postsCount} of your posts.\n </Trans>\n }\n />\n }\n other={\n <Select\n value={postType}\n _reply={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n boosted your reply.\n </Trans>\n }\n other={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n boosted your post.\n </Trans>\n }\n />\n }\n />\n ),\n follow: ({ account, count, components: { Subject } }) => (\n <Plural\n value={count}\n _1={<Trans>{account} followed you.</Trans>}\n other={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n followed you.\n </Trans>\n }\n />\n ),\n follow_request: ({ account }) => (\n <Trans>{account} requested to follow you.</Trans>\n ),\n favourite: ({\n account,\n count,\n postsCount,\n postType,\n components: { Subject },\n }) => (\n <Plural\n value={count}\n _1={\n <Plural\n value={postsCount}\n _1={\n <Select\n value={postType}\n _reply={<Trans>{account} liked your reply.</Trans>}\n other={<Trans>{account} liked your post.</Trans>}\n />\n }\n other={\n <Trans>\n {account} liked {postsCount} of your posts.\n </Trans>\n }\n />\n }\n other={\n <Select\n value={postType}\n _reply={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n liked your reply.\n </Trans>\n }\n other={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n liked your post.\n </Trans>\n }\n />\n }\n />\n ),\n poll: () => t`A poll you have voted in or created has ended.`,\n 'poll-self': () => t`A poll you have created has ended.`,\n 'poll-voted': () => t`A poll you have voted in has ended.`,\n update: () => t`A post you interacted with has been edited.`,\n 'favourite+reblog': ({\n count,\n account,\n postsCount,\n postType,\n components: { Subject },\n }) => (\n <Plural\n value={count}\n _1={\n <Plural\n value={postsCount}\n _1={\n <Select\n value={postType}\n _reply={<Trans>{account} boosted & liked your reply.</Trans>}\n other={<Trans>{account} boosted & liked your post.</Trans>}\n />\n }\n other={\n <Trans>\n {account} boosted & liked {postsCount} of your posts.\n </Trans>\n }\n />\n }\n other={\n <Select\n value={postType}\n _reply={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n boosted & liked your reply.\n </Trans>\n }\n other={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n boosted & liked your post.\n </Trans>\n }\n />\n }\n />\n ),\n 'admin.sign_up': ({ account }) => <Trans>{account} signed up.</Trans>,\n 'admin.report': ({ account, targetAccount }) => (\n <Trans>\n {account} reported {targetAccount}\n </Trans>\n ),\n severed_relationships: ({ name }) => (\n <Trans>\n Lost connections with <i>{name}</i>.\n </Trans>\n ),\n moderation_warning: () => (\n <b>\n <Trans>Moderation warning</Trans>\n </b>\n ),\n emoji_reaction: emojiText,\n 'pleroma:emoji_reaction': emojiText,\n annual_report: ({ year }) => <Trans>Your {year} #Wrapstodon is here!</Trans>,\n};\n\n// account_suspension, domain_block, user_domain_block\nconst SEVERED_RELATIONSHIPS_TEXT = {\n account_suspension: ({ from, targetName }) => (\n <Trans>\n An admin from <i>{from}</i> has suspended <i>{targetName}</i>, which means\n you can no longer receive updates from them or interact with them.\n </Trans>\n ),\n domain_block: ({ from, targetName, followersCount, followingCount }) => (\n <Trans>\n An admin from <i>{from}</i> has blocked <i>{targetName}</i>. Affected\n followers: {followersCount}, followings: {followingCount}.\n </Trans>\n ),\n user_domain_block: ({ targetName, followersCount, followingCount }) => (\n <Trans>\n You have blocked <i>{targetName}</i>. Removed followers: {followersCount},\n followings: {followingCount}.\n </Trans>\n ),\n};\n\nconst MODERATION_WARNING_TEXT = {\n none: msg`Your account has received a moderation warning.`,\n disable: msg`Your account has been disabled.`,\n mark_statuses_as_sensitive: msg`Some of your posts have been marked as sensitive.`,\n delete_statuses: msg`Some of your posts have been deleted.`,\n sensitive: msg`Your posts will be marked as sensitive from now on.`,\n silence: msg`Your account has been limited.`,\n suspend: msg`Your account has been suspended.`,\n};\n\nconst AVATARS_LIMIT = 30;\n\nfunction Notification({\n notification,\n instance,\n isStatic,\n disableContextMenu,\n}) {\n const { _ } = useLingui();\n const { masto } = api();\n const {\n id,\n status,\n account,\n report,\n event,\n moderation_warning,\n annualReport,\n // Client-side grouped notification\n _ids,\n _accounts,\n _statuses,\n _groupKeys,\n // Server-side grouped notification\n sampleAccounts,\n notificationsCount,\n groupKey,\n } = notification;\n let { type } = notification;\n\n if (type === 'mention' && !status) {\n // Could be deleted\n return null;\n }\n\n // status = Attached when type of the notification is favourite, reblog, status, mention, poll, or update\n const actualStatus = status?.reblog || status;\n const actualStatusID = actualStatus?.id;\n\n const currentAccount = getCurrentAccountID();\n const isSelf = currentAccount === account?.id;\n const isVoted = status?.poll?.voted;\n const isReplyToOthers =\n !!status?.inReplyToAccountId &&\n status?.inReplyToAccountId !== currentAccount &&\n status?.account?.id === currentAccount;\n\n let favsCount = 0;\n let reblogsCount = 0;\n if (type === 'favourite+reblog') {\n if (_accounts) {\n for (const account of _accounts) {\n if (account._types?.includes('favourite')) {\n favsCount++;\n }\n if (account._types?.includes('reblog')) {\n reblogsCount++;\n }\n }\n }\n if (!reblogsCount && favsCount) type = 'favourite';\n if (!favsCount && reblogsCount) type = 'reblog';\n }\n\n let text;\n if (type === 'poll') {\n text = contentText[isSelf ? 'poll-self' : isVoted ? 'poll-voted' : 'poll'];\n } else if (contentText[type]) {\n text = contentText[type];\n } else {\n // Anticipate unhandled notification types, possibly from Mastodon forks or non-Mastodon instances\n // This surfaces the error to the user, hoping that users will report it\n text = t`[Unknown notification type: ${type}]`;\n }\n\n const Subject = ({ clickable, ...props }) =>\n clickable ? (\n <b tabIndex=\"0\" onClick={handleOpenGenericAccounts} {...props} />\n ) : (\n <b {...props} />\n );\n\n if (typeof text === 'function') {\n const count =\n _accounts?.length || sampleAccounts?.length || (account ? 1 : 0);\n const postsCount = _statuses?.length || (status ? 1 : 0);\n if (type === 'admin.report') {\n const targetAccount = report?.targetAccount;\n if (targetAccount) {\n text = text({\n account: <NameText account={account} showAvatar />,\n targetAccount: <NameText account={targetAccount} showAvatar />,\n });\n }\n } else if (type === 'severed_relationships') {\n const targetName = event?.targetName;\n if (targetName) {\n text = text({ name: targetName });\n }\n } else if (\n (type === 'emoji_reaction' || type === 'pleroma:emoji_reaction') &&\n notification.emoji\n ) {\n const emojiURL =\n notification.emoji_url || // This is string\n status?.emojis?.find?.(\n (emoji) =>\n emoji?.shortcode ===\n notification.emoji.replace(/^:/, '').replace(/:$/, ''),\n ); // Emoji object instead of string\n text = text({\n account: <NameText account={account} showAvatar />,\n emoji: notification.emoji,\n emojiURL,\n });\n } else if (type === 'annual_report') {\n text = text({\n ...notification.annualReport,\n });\n } else {\n text = text({\n account: account ? (\n <NameText account={account} showAvatar />\n ) : (\n sampleAccounts?.[0] && (\n <NameText account={sampleAccounts[0]} showAvatar />\n )\n ),\n count,\n postsCount,\n postType: isReplyToOthers ? 'reply' : 'post',\n components: { Subject },\n });\n }\n }\n\n const formattedCreatedAt =\n notification.createdAt && new Date(notification.createdAt).toLocaleString();\n\n const genericAccountsHeading =\n {\n 'favourite+reblog': t`Boosted/Liked by…`,\n favourite: t`Liked by…`,\n reblog: t`Boosted by…`,\n follow: t`Followed by…`,\n }[type] || t`Accounts`;\n const handleOpenGenericAccounts = () => {\n states.showGenericAccounts = {\n heading: genericAccountsHeading,\n accounts: _accounts,\n showReactions: type === 'favourite+reblog',\n excludeRelationshipAttrs: type === 'follow' ? ['followedBy'] : [],\n postID: statusKey(actualStatusID, instance),\n };\n };\n\n console.debug('RENDER Notification', notification.id);\n\n const diffCount =\n notificationsCount > 0 && notificationsCount > sampleAccounts?.length;\n const expandAccounts = diffCount ? 'remote' : 'local';\n\n // If there's a status and filter action is 'hide', then the notification is hidden\n // TODO: Handle 'warn' action one day\n if (!!status?.filtered) {\n const isOwnPost = status?.account?.id === currentAccount;\n const filterInfo = isFiltered(status.filtered, 'notifications');\n if (!isSelf && !isOwnPost && filterInfo?.action === 'hide') {\n return null;\n }\n }\n\n return (\n <div\n class={`notification notification-${type}`}\n data-notification-id={_ids || id}\n data-group-key={_groupKeys?.join(' ') || groupKey}\n tabIndex=\"0\"\n >\n <div\n class={`notification-type notification-${type}`}\n title={formattedCreatedAt}\n >\n {type === 'favourite+reblog' ? (\n <>\n <Icon icon=\"rocket\" size=\"xl\" alt={type} class=\"reblog-icon\" />\n <Icon icon=\"heart\" size=\"xl\" alt={type} class=\"favourite-icon\" />\n </>\n ) : (\n <Icon\n icon={NOTIFICATION_ICONS[type] || 'notification'}\n size=\"xl\"\n alt={type}\n />\n )}\n </div>\n <div class=\"notification-content\">\n {type !== 'mention' && (\n <>\n <p>{text}</p>\n {type === 'follow_request' && (\n <FollowRequestButtons accountID={account.id} />\n )}\n {type === 'severed_relationships' && (\n <div>\n {SEVERED_RELATIONSHIPS_TEXT[event.type]({\n from: instance,\n ...event,\n })}\n <br />\n <a\n href={`https://${instance}/severed_relationships`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>\n Learn more <Icon icon=\"external\" size=\"s\" />\n </Trans>\n </a>\n .\n </div>\n )}\n {type === 'moderation_warning' && !!moderation_warning && (\n <div>\n {_(MODERATION_WARNING_TEXT[moderation_warning.action]())}\n <br />\n <a\n href={`/disputes/strikes/${moderation_warning.id}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>\n Learn more <Icon icon=\"external\" size=\"s\" />\n </Trans>\n </a>\n </div>\n )}\n {type === 'annual_report' && (\n <div>\n <Link to={`/annual_report/${annualReport?.year}`}>\n <Trans>View #Wrapstodon</Trans>\n </Link>\n </div>\n )}\n </>\n )}\n {_accounts?.length > 1 && (\n <p class=\"avatars-stack\">\n {_accounts.slice(0, AVATARS_LIMIT).map((account) => (\n <Fragment key={account.id}>\n <a\n key={account.id}\n href={account.url}\n rel=\"noopener noreferrer\"\n class=\"account-avatar-stack\"\n onClick={(e) => {\n e.preventDefault();\n states.showAccount = account;\n }}\n >\n <Avatar\n url={account.avatarStatic}\n size={\n _accounts.length <= 10\n ? 'xxl'\n : _accounts.length < 20\n ? 'xl'\n : 'l'\n }\n key={account.id}\n alt={`${account.displayName} @${account.acct}`}\n squircle={account?.bot}\n />\n {type === 'favourite+reblog' && (\n <div class=\"account-sub-icons\">\n {account._types.map((type) => (\n <Icon\n icon={NOTIFICATION_ICONS[type]}\n size=\"s\"\n class={`${type}-icon`}\n />\n ))}\n </div>\n )}\n </a>{' '}\n </Fragment>\n ))}\n {type === 'favourite+reblog' && expandAccounts === 'remote' ? (\n <button\n type=\"button\"\n class=\"small plain\"\n data-group-keys={_groupKeys?.join(' ')}\n onClick={() => {\n states.showGenericAccounts = {\n heading: genericAccountsHeading,\n fetchAccounts: async () => {\n const keyAccounts = await Promise.allSettled(\n _groupKeys.map(async (gKey) => {\n const iterator = masto.v2.notifications\n .$select(gKey)\n .accounts.list();\n return [gKey, (await iterator.next()).value];\n }),\n );\n const accounts = [];\n for (const keyAccount of keyAccounts) {\n const [key, _accounts] = keyAccount.value;\n const type = /^favourite/.test(key)\n ? 'favourite'\n : /^reblog/.test(key)\n ? 'reblog'\n : null;\n if (!type) continue;\n for (const account of _accounts) {\n const theAccount = accounts.find(\n (a) => a.id === account.id,\n );\n if (theAccount) {\n theAccount._types.push(type);\n } else {\n account._types = [type];\n accounts.push(account);\n }\n }\n }\n return {\n done: true,\n value: accounts,\n };\n },\n showReactions: true,\n postID: statusKey(actualStatusID, instance),\n };\n }}\n >\n <Icon icon=\"chevron-down\" />\n </button>\n ) : (\n <button\n type=\"button\"\n class=\"small plain\"\n onClick={handleOpenGenericAccounts}\n >\n {_accounts.length > AVATARS_LIMIT &&\n `+${_accounts.length - AVATARS_LIMIT}`}\n <Icon icon=\"chevron-down\" />\n </button>\n )}\n </p>\n )}\n {!_accounts?.length && sampleAccounts?.length > 1 && (\n <p class=\"avatars-stack\">\n {sampleAccounts.map((account) => (\n <Fragment key={account.id}>\n <a\n key={account.id}\n href={account.url}\n rel=\"noopener noreferrer\"\n class=\"account-avatar-stack\"\n onClick={(e) => {\n e.preventDefault();\n states.showAccount = account;\n }}\n >\n <Avatar\n url={account.avatarStatic}\n size=\"xxl\"\n key={account.id}\n alt={`${account.displayName} @${account.acct}`}\n squircle={account?.bot}\n />\n {/* {type === 'favourite+reblog' && (\n <div class=\"account-sub-icons\">\n {account._types.map((type) => (\n <Icon\n icon={NOTIFICATION_ICONS[type]}\n size=\"s\"\n class={`${type}-icon`}\n />\n ))}\n </div>\n )} */}\n </a>{' '}\n </Fragment>\n ))}\n {notificationsCount > sampleAccounts.length && (\n <Link\n to={\n instance ? `/${instance}/s/${status.id}` : `/s/${status.id}`\n }\n class=\"button small plain centered\"\n >\n +{notificationsCount - sampleAccounts.length}\n <Icon icon=\"chevron-right\" />\n </Link>\n )}\n </p>\n )}\n {_statuses?.length > 1 && (\n <ul class=\"notification-group-statuses\">\n {_statuses.map((status) => (\n <li key={status.id}>\n <TruncatedLink\n class={`status-link status-type-${type}`}\n to={\n instance ? `/${instance}/s/${status.id}` : `/s/${status.id}`\n }\n >\n <Status\n status={status}\n size=\"s\"\n previewMode\n allowContextMenu\n />\n </TruncatedLink>\n </li>\n ))}\n </ul>\n )}\n {status && (!_statuses?.length || _statuses?.length <= 1) && (\n <TruncatedLink\n class={`status-link status-type-${type}`}\n to={\n instance\n ? `/${instance}/s/${actualStatusID}`\n : `/s/${actualStatusID}`\n }\n onContextMenu={\n !disableContextMenu\n ? (e) => {\n const post = e.target.querySelector('.status');\n if (post) {\n // Fire a custom event to open the context menu\n if (e.metaKey) return;\n e.preventDefault();\n post.dispatchEvent(\n new MouseEvent('contextmenu', {\n clientX: e.clientX,\n clientY: e.clientY,\n }),\n );\n }\n }\n : undefined\n }\n >\n {isStatic ? (\n <Status\n status={actualStatus}\n size=\"s\"\n readOnly\n allowContextMenu\n />\n ) : (\n <Status\n statusID={actualStatusID}\n size=\"s\"\n readOnly\n allowContextMenu\n />\n )}\n </TruncatedLink>\n )}\n </div>\n </div>\n );\n}\n\nfunction TruncatedLink(props) {\n const ref = useTruncated();\n return <Link {...props} data-read-more={t`Read more →`} ref={ref} />;\n}\n\nexport default memo(Notification, (oldProps, newProps) => {\n return oldProps.notification?.id === newProps.notification?.id;\n});\n","import { t, Trans } from '@lingui/macro';\nimport { memo } from 'preact/compat';\nimport { useLayoutEffect, useState } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport { api } from '../utils/api';\nimport states from '../utils/states';\nimport {\n getAccountByAccessToken,\n getCurrentAccount,\n} from '../utils/store-utils';\nimport usePageVisibility from '../utils/usePageVisibility';\n\nimport Icon from './icon';\nimport Link from './link';\nimport Modal from './modal';\nimport Notification from './notification';\n\n{\n if ('serviceWorker' in navigator) {\n console.log('👂👂👂 Listen to message');\n navigator.serviceWorker.addEventListener('message', (event) => {\n console.log('💥💥💥 Message event', event);\n const { type, id, accessToken } = event?.data || {};\n if (type === 'notification') {\n states.routeNotification = {\n id,\n accessToken,\n };\n }\n });\n }\n}\n\nexport default memo(function NotificationService() {\n if (!('serviceWorker' in navigator)) return null;\n\n const snapStates = useSnapshot(states);\n const { routeNotification } = snapStates;\n\n console.log('🛎️ Notification service', routeNotification);\n\n const { id, accessToken } = routeNotification || {};\n const [showNotificationSheet, setShowNotificationSheet] = useState(false);\n\n useLayoutEffect(() => {\n if (!id || !accessToken) return;\n const { instance: currentInstance } = api();\n const { masto, instance } = api({\n accessToken,\n });\n console.log('API', { accessToken, currentInstance, instance });\n const sameInstance = currentInstance === instance;\n const account = accessToken\n ? getAccountByAccessToken(accessToken)\n : getCurrentAccount();\n (async () => {\n const notification = await masto.v1.notifications.$select(id).fetch();\n if (notification && account) {\n console.log('🛎️ Notification', { id, notification, account });\n const accountInstance = account.instanceURL;\n const { type, status, account: notificationAccount } = notification;\n const hasModal = !!document.querySelector('#modal-container > *');\n const isFollow = type === 'follow' && !!notificationAccount?.id;\n const hasAccount = !!notificationAccount?.id;\n const hasStatus = !!status?.id;\n if (isFollow && sameInstance) {\n // Show account sheet, can handle different instances\n states.showAccount = {\n account: notificationAccount,\n instance: accountInstance,\n };\n } else if (hasModal || !sameInstance || (hasAccount && hasStatus)) {\n // Show sheet of notification, if\n // - there is a modal open\n // - the notification is from another instance\n // - the notification has both account and status, gives choice for users to go to account or status\n setShowNotificationSheet({\n id,\n account,\n notification,\n sameInstance,\n });\n } else {\n if (hasStatus) {\n // Go to status page\n location.hash = `/${currentInstance}/s/${status.id}`;\n } else if (isFollow) {\n // Go to profile page\n location.hash = `/${currentInstance}/a/${notificationAccount.id}`;\n } else {\n // Go to notifications page\n location.hash = '/notifications';\n }\n }\n } else {\n console.warn('🛎️ Notification not found', id);\n }\n })();\n }, [id, accessToken]);\n\n // useLayoutEffect(() => {\n // // Listen to message from service worker\n // const handleMessage = (event) => {\n // console.log('💥💥💥 Message event', event);\n // const { type, id, accessToken } = event?.data || {};\n // if (type === 'notification') {\n // states.routeNotification = {\n // id,\n // accessToken,\n // };\n // }\n // };\n // console.log('👂👂👂 Listen to message');\n // navigator.serviceWorker.addEventListener('message', handleMessage);\n // return () => {\n // console.log('👂👂👂 Remove listen to message');\n // navigator.serviceWorker.removeEventListener('message', handleMessage);\n // };\n // }, []);\n\n useLayoutEffect(() => {\n if (navigator?.clearAppBadge) {\n navigator.clearAppBadge();\n }\n }, []);\n usePageVisibility((visible) => {\n if (visible && navigator?.clearAppBadge) {\n console.log('🔰 Clear app badge');\n navigator.clearAppBadge();\n }\n });\n\n const onClose = () => {\n setShowNotificationSheet(false);\n states.routeNotification = null;\n\n // If url is #/notifications?id=123, go to #/notifications\n if (/\\/notifications\\?id=/i.test(location.hash)) {\n location.hash = '/notifications';\n }\n };\n\n if (showNotificationSheet) {\n const { id, account, notification, sameInstance } = showNotificationSheet;\n return (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n onClose();\n }\n }}\n >\n <div class=\"sheet\" tabIndex=\"-1\">\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <b>\n <Trans>Notification</Trans>\n </b>\n </header>\n <main>\n {!sameInstance && (\n <p>\n <Trans>This notification is from your other account.</Trans>\n </p>\n )}\n <div\n class=\"notification-peek\"\n // style={{\n // pointerEvents: sameInstance ? '' : 'none',\n // }}\n onClick={(e) => {\n const { target } = e;\n // If button or links\n if (e.target.tagName === 'BUTTON' || e.target.tagName === 'A') {\n onClose();\n }\n }}\n >\n <Notification\n instance={account.instanceURL}\n notification={notification}\n isStatic\n />\n </div>\n <div\n style={{\n textAlign: 'end',\n }}\n >\n <Link to=\"/notifications\" class=\"button light\" onClick={onClose}>\n <span>\n <Trans>View all notifications</Trans>\n </span>{' '}\n <Icon icon=\"arrow-right\" />\n </Link>\n </div>\n </main>\n </div>\n </Modal>\n );\n }\n\n return null;\n});\n","import { t, Trans } from '@lingui/macro';\nimport { forwardRef } from 'preact/compat';\nimport { useImperativeHandle, useRef, useState } from 'preact/hooks';\nimport { useSearchParams } from 'react-router-dom';\n\nimport { api } from '../utils/api';\n\nimport Icon from './icon';\nimport Link from './link';\n\nconst SearchForm = forwardRef((props, ref) => {\n const { instance } = api();\n const [searchParams, setSearchParams] = useSearchParams();\n const [searchMenuOpen, setSearchMenuOpen] = useState(false);\n const [query, setQuery] = useState(searchParams.get('q') || '');\n const type = searchParams.get('type');\n const formRef = useRef(null);\n\n const searchFieldRef = useRef(null);\n useImperativeHandle(ref, () => ({\n setValue: (value) => {\n setQuery(value);\n },\n focus: () => {\n searchFieldRef.current.focus();\n },\n select: () => {\n searchFieldRef.current.select();\n },\n blur: () => {\n searchFieldRef.current.blur();\n },\n }));\n\n return (\n <form\n ref={formRef}\n class=\"search-popover-container\"\n onSubmit={(e) => {\n e.preventDefault();\n\n const isSearchPage = /\\/search/.test(location.hash);\n if (isSearchPage) {\n if (query) {\n const params = {\n q: query,\n };\n if (type) params.type = type; // Preserve type\n setSearchParams(params);\n } else {\n setSearchParams({});\n }\n } else {\n if (query) {\n location.hash = `/search?q=${encodeURIComponent(query)}${\n type ? `&type=${type}` : ''\n }`;\n } else {\n location.hash = `/search`;\n }\n }\n\n props?.onSubmit?.(e);\n }}\n >\n <input\n ref={searchFieldRef}\n value={query}\n name=\"q\"\n type=\"search\"\n // autofocus\n placeholder={t`Search`}\n dir=\"auto\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellCheck=\"false\"\n onSearch={(e) => {\n if (!e.target.value) {\n setSearchParams({});\n }\n }}\n onInput={(e) => {\n setQuery(e.target.value);\n setSearchMenuOpen(true);\n }}\n onFocus={() => {\n setSearchMenuOpen(true);\n formRef.current\n ?.querySelector('.search-popover-item')\n ?.classList.add('focus');\n }}\n onBlur={() => {\n setTimeout(() => {\n setSearchMenuOpen(false);\n }, 100);\n formRef.current\n ?.querySelector('.search-popover-item.focus')\n ?.classList.remove('focus');\n }}\n onKeyDown={(e) => {\n const { key } = e;\n switch (key) {\n case 'Escape':\n setSearchMenuOpen(false);\n break;\n case 'Down':\n case 'ArrowDown':\n e.preventDefault();\n if (searchMenuOpen) {\n const focusItem = formRef.current.querySelector(\n '.search-popover-item.focus',\n );\n if (focusItem) {\n let nextItem = focusItem.nextElementSibling;\n while (nextItem && nextItem.hidden) {\n nextItem = nextItem.nextElementSibling;\n }\n if (nextItem) {\n nextItem.classList.add('focus');\n const siblings = Array.from(\n nextItem.parentElement.children,\n ).filter((el) => el !== nextItem);\n siblings.forEach((el) => {\n el.classList.remove('focus');\n });\n }\n } else {\n const firstItem = formRef.current.querySelector(\n '.search-popover-item',\n );\n if (firstItem) {\n firstItem.classList.add('focus');\n }\n }\n }\n break;\n case 'Up':\n case 'ArrowUp':\n e.preventDefault();\n if (searchMenuOpen) {\n const focusItem = document.querySelector(\n '.search-popover-item.focus',\n );\n if (focusItem) {\n let prevItem = focusItem.previousElementSibling;\n while (prevItem && prevItem.hidden) {\n prevItem = prevItem.previousElementSibling;\n }\n if (prevItem) {\n prevItem.classList.add('focus');\n const siblings = Array.from(\n prevItem.parentElement.children,\n ).filter((el) => el !== prevItem);\n siblings.forEach((el) => {\n el.classList.remove('focus');\n });\n }\n } else {\n const lastItem = document.querySelector(\n '.search-popover-item:last-child',\n );\n if (lastItem) {\n lastItem.classList.add('focus');\n }\n }\n }\n break;\n case 'Enter':\n if (searchMenuOpen) {\n const focusItem = document.querySelector(\n '.search-popover-item.focus',\n );\n if (focusItem) {\n e.preventDefault();\n focusItem.click();\n }\n setSearchMenuOpen(false);\n props?.onSubmit?.(e);\n }\n break;\n }\n }}\n />\n <div class=\"search-popover\" hidden={!searchMenuOpen || !query}>\n {/* {!!query && (\n <Link\n to={`/search?q=${encodeURIComponent(query)}`}\n class=\"search-popover-item focus\"\n onClick={(e) => {\n props?.onSubmit?.(e);\n }}\n >\n <Icon icon=\"search\" />\n <span>{query}</span>\n </Link>\n )} */}\n {!!query &&\n [\n {\n label: (\n <Trans>\n {query}{' '}\n <small class=\"insignificant\">\n ‒ accounts, hashtags & posts\n </small>\n </Trans>\n ),\n to: `/search?q=${encodeURIComponent(query)}`,\n top: !type && !/\\s/.test(query),\n hidden: !!type,\n },\n {\n label: (\n <Trans>\n Posts with <q>{query}</q>\n </Trans>\n ),\n to: `/search?q=${encodeURIComponent(query)}&type=statuses`,\n hidden: /^https?:/.test(query),\n top: /\\s/.test(query),\n icon: 'document',\n queryType: 'statuses',\n },\n {\n label: (\n <Trans>\n Posts tagged with <mark>#{query.replace(/^#/, '')}</mark>\n </Trans>\n ),\n to: `/${instance}/t/${query.replace(/^#/, '')}`,\n hidden:\n /^@/.test(query) || /^https?:/.test(query) || /\\s/.test(query),\n top: /^#/.test(query),\n type: 'link',\n icon: 'hashtag',\n queryType: 'hashtags',\n },\n {\n label: (\n <Trans>\n Look up <mark>{query}</mark>\n </Trans>\n ),\n to: `/${query}`,\n hidden: !/^https?:/.test(query),\n top: /^https?:/.test(query),\n type: 'link',\n },\n {\n label: (\n <Trans>\n Accounts with <q>{query}</q>\n </Trans>\n ),\n to: `/search?q=${encodeURIComponent(query)}&type=accounts`,\n icon: 'group',\n queryType: 'accounts',\n },\n ]\n .sort((a, b) => {\n if (type) {\n if (a.queryType === type) return -1;\n if (b.queryType === type) return 1;\n }\n if (a.top && !b.top) return -1;\n if (!a.top && b.top) return 1;\n return 0;\n })\n .filter(({ hidden }) => !hidden)\n .map(({ label, to, icon, type }, i) => (\n <Link\n to={to}\n class={`search-popover-item ${i === 0 ? 'focus' : ''}`}\n // hidden={hidden}\n onClick={(e) => {\n console.log('onClick', e);\n props?.onSubmit?.(e);\n }}\n >\n <Icon\n icon={icon || (type === 'link' ? 'arrow-right' : 'search')}\n class=\"more-insignificant\"\n />\n <span>{label}</span>{' '}\n </Link>\n ))}\n </div>\n </form>\n );\n});\n\nexport default SearchForm;\n","import './search-command.css';\n\nimport { memo } from 'preact/compat';\nimport { useRef, useState } from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\n\nimport SearchForm from './search-form';\n\nexport default memo(function SearchCommand({ onClose = () => {} }) {\n const [showSearch, setShowSearch] = useState(false);\n const searchFormRef = useRef(null);\n\n useHotkeys(\n ['Slash', '/'],\n (e) => {\n setShowSearch(true);\n setTimeout(() => {\n searchFormRef.current?.focus?.();\n searchFormRef.current?.select?.();\n }, 0);\n },\n {\n preventDefault: true,\n ignoreEventWhen: (e) => {\n const isSearchPage = /\\/search/.test(location.hash);\n const hasModal = !!document.querySelector('#modal-container > *');\n return isSearchPage || hasModal;\n },\n },\n );\n\n const closeSearch = () => {\n setShowSearch(false);\n onClose();\n };\n\n useHotkeys(\n 'esc',\n (e) => {\n searchFormRef.current?.blur?.();\n closeSearch();\n },\n {\n enabled: showSearch,\n enableOnFormTags: true,\n preventDefault: true,\n },\n );\n\n return (\n <div\n id=\"search-command-container\"\n hidden={!showSearch}\n onClick={(e) => {\n console.log(e);\n if (e.target === e.currentTarget) {\n closeSearch();\n }\n }}\n >\n <SearchForm\n ref={searchFormRef}\n onSubmit={() => {\n closeSearch();\n }}\n />\n </div>\n );\n});\n","import './shortcuts.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { MenuDivider } from '@szhsin/react-menu';\nimport { memo } from 'preact/compat';\nimport { useRef, useState } from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { useNavigate } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport { SHORTCUTS_META } from '../components/shortcuts-settings';\nimport { api } from '../utils/api';\nimport { getLists } from '../utils/lists';\nimport states from '../utils/states';\n\nimport AsyncText from './AsyncText';\nimport Icon from './icon';\nimport Link from './link';\nimport MenuLink from './menu-link';\nimport Menu2 from './menu2';\nimport SubMenu2 from './submenu2';\n\nfunction Shortcuts() {\n const { _ } = useLingui();\n const { instance } = api();\n const snapStates = useSnapshot(states);\n const { shortcuts, settings } = snapStates;\n\n if (!shortcuts.length) {\n return null;\n }\n const isMultiColumnMode =\n settings.shortcutsViewMode === 'multi-column' ||\n (!settings.shortcutsViewMode && settings.shortcutsColumnsMode);\n if (isMultiColumnMode) {\n return null;\n }\n\n const menuRef = useRef();\n\n const hasLists = useRef(false);\n const formattedShortcuts = shortcuts\n .map((pin, i) => {\n const { type, ...data } = pin;\n if (!SHORTCUTS_META[type]) return null;\n let { id, path, title, subtitle, icon } = SHORTCUTS_META[type];\n\n if (typeof id === 'function') {\n id = id(data, i);\n }\n if (typeof path === 'function') {\n path = path(\n {\n ...data,\n instance: data.instance || instance,\n },\n i,\n );\n }\n if (typeof title === 'function') {\n title = title(data, i);\n } else {\n title = _(title);\n }\n if (typeof subtitle === 'function') {\n subtitle = subtitle(data, i);\n } else {\n subtitle = _(subtitle);\n }\n if (typeof icon === 'function') {\n icon = icon(data, i);\n }\n\n if (id === 'lists') {\n hasLists.current = true;\n }\n\n return {\n id,\n path,\n title,\n subtitle,\n icon,\n };\n })\n .filter(Boolean);\n\n const navigate = useNavigate();\n useHotkeys(\n ['1', '2', '3', '4', '5', '6', '7', '8', '9'],\n (e, handler) => {\n const index = parseInt(handler.keys[0], 10) - 1;\n if (index < formattedShortcuts.length) {\n const { path } = formattedShortcuts[index];\n if (path) {\n navigate(path);\n menuRef.current?.closeMenu?.();\n }\n }\n },\n {\n enabled: !isMultiColumnMode,\n },\n );\n\n const [lists, setLists] = useState([]);\n\n return (\n <div id=\"shortcuts\">\n {snapStates.settings.shortcutsViewMode === 'tab-menu-bar' ? (\n <nav\n class=\"tab-bar\"\n onContextMenu={(e) => {\n e.preventDefault();\n states.showShortcutsSettings = true;\n }}\n >\n <ul>\n {formattedShortcuts.map(\n ({ id, path, title, subtitle, icon }, i) => {\n return (\n <li key={`${i}-${id}-${title}-${subtitle}-${path}`}>\n <Link\n class={subtitle ? 'has-subtitle' : ''}\n to={path}\n onClick={(e) => {\n if (e.target.classList.contains('is-active')) {\n e.preventDefault();\n const page = document.getElementById(`${id}-page`);\n console.log(id, page);\n if (page) {\n page.scrollTop = 0;\n const updatesButton =\n page.querySelector('.updates-button');\n if (updatesButton) {\n updatesButton.click();\n }\n }\n }\n }}\n >\n <Icon icon={icon} size=\"xl\" alt={title} />\n <span>\n <AsyncText>{title}</AsyncText>\n {subtitle && (\n <>\n <br />\n <small>{subtitle}</small>\n </>\n )}\n </span>\n </Link>\n </li>\n );\n },\n )}\n </ul>\n </nav>\n ) : (\n <Menu2\n instanceRef={menuRef}\n overflow=\"auto\"\n viewScroll=\"close\"\n menuClassName=\"glass-menu shortcuts-menu\"\n gap={8}\n position=\"anchor\"\n onMenuChange={(e) => {\n if (e.open && hasLists.current) {\n getLists().then(setLists);\n }\n }}\n menuButton={\n <button\n type=\"button\"\n id=\"shortcuts-button\"\n class=\"plain\"\n onContextMenu={(e) => {\n e.preventDefault();\n states.showShortcutsSettings = true;\n }}\n onTransitionStart={(e) => {\n // Close menu if the button disappears\n try {\n const { target } = e;\n if (getComputedStyle(target).pointerEvents === 'none') {\n menuRef.current?.closeMenu?.();\n }\n } catch (e) {}\n }}\n >\n <Icon icon=\"shortcut\" size=\"xl\" alt={t`Shortcuts`} />\n </button>\n }\n >\n {formattedShortcuts.map(({ id, path, title, subtitle, icon }, i) => {\n if (id === 'lists') {\n return (\n <SubMenu2\n menuClassName=\"glass-menu\"\n overflow=\"auto\"\n gap={-8}\n label={\n <>\n <Icon icon={icon} size=\"l\" />\n <span class=\"menu-grow\">\n <AsyncText>{title}</AsyncText>\n </span>\n <Icon icon=\"chevron-right\" />\n </>\n }\n >\n <MenuLink to=\"/l\">\n <span>\n <Trans>All Lists</Trans>\n </span>\n </MenuLink>\n <MenuDivider />\n {lists?.map((list) => (\n <MenuLink key={list.id} to={`/l/${list.id}`}>\n <span>{list.title}</span>\n </MenuLink>\n ))}\n </SubMenu2>\n );\n }\n\n return (\n <MenuLink\n to={path}\n key={`${i}-${id}-${title}-${subtitle}-${path}`}\n class=\"glass-menu-item\"\n >\n <Icon icon={icon} size=\"l\" />{' '}\n <span class=\"menu-grow\">\n <span>\n <AsyncText>{title}</AsyncText>\n </span>\n {subtitle && (\n <>\n {' '}\n <small class=\"more-insignificant\">{subtitle}</small>\n </>\n )}\n </span>\n <span class=\"menu-shortcut hide-until-focus-visible\">\n {i + 1}\n </span>\n </MenuLink>\n );\n })}\n </Menu2>\n )}\n </div>\n );\n}\n\nexport default memo(Shortcuts);\n","import { api } from './api';\nimport { extractTagsFromStatus, getFollowedTags } from './followed-tags';\nimport pmem from './pmem';\nimport { fetchRelationships } from './relationships';\nimport states, { saveStatus, statusKey } from './states';\nimport store from './store';\nimport supports from './supports';\n\nexport function groupBoosts(values) {\n let newValues = [];\n let boostStash = [];\n let serialBoosts = 0;\n for (let i = 0; i < values.length; i++) {\n const item = values[i];\n if (item.reblog && !item.account?.group) {\n boostStash.push(item);\n serialBoosts++;\n } else {\n newValues.push(item);\n if (serialBoosts < 3) {\n serialBoosts = 0;\n }\n }\n }\n // if boostStash is more than quarter of values\n // or if there are 3 or more boosts in a row\n if (\n values.length > 10 &&\n (boostStash.length > values.length / 4 || serialBoosts >= 3)\n ) {\n // if boostStash is more than 3 quarter of values\n const boostStashID = boostStash.map((status) => status.id);\n if (boostStash.length > (values.length * 3) / 4) {\n // insert boost array at the end of specialHome list\n newValues = [\n ...newValues,\n { id: boostStashID, items: boostStash, type: 'boosts' },\n ];\n } else {\n // insert boosts array in the middle of specialHome list\n const half = Math.floor(newValues.length / 2);\n newValues = [\n ...newValues.slice(0, half),\n {\n id: boostStashID,\n items: boostStash,\n type: 'boosts',\n },\n ...newValues.slice(half),\n ];\n }\n return newValues;\n } else {\n return values;\n }\n}\n\nexport function dedupeBoosts(items, instance) {\n const boostedStatusIDs = store.account.get('boostedStatusIDs') || {};\n const filteredItems = items.filter((item) => {\n if (!item.reblog) return true;\n const statusKey = `${instance}-${item.reblog.id}`;\n const boosterID = boostedStatusIDs[statusKey];\n if (boosterID && boosterID !== item.id) {\n console.warn(\n `🚫 Duplicate boost by ${item.account.displayName}`,\n item,\n item.reblog,\n );\n return false;\n } else {\n boostedStatusIDs[statusKey] = item.id;\n }\n return true;\n });\n // Limit to 50\n const keys = Object.keys(boostedStatusIDs);\n if (keys.length > 50) {\n keys.slice(0, keys.length - 50).forEach((key) => {\n delete boostedStatusIDs[key];\n });\n }\n store.account.set('boostedStatusIDs', boostedStatusIDs);\n return filteredItems;\n}\n\nexport function groupContext(items, instance) {\n const contexts = [];\n let contextIndex = 0;\n items.forEach((item) => {\n for (let i = 0; i < contexts.length; i++) {\n if (contexts[i].find((t) => t.id === item.id)) return;\n if (\n contexts[i].find((t) => t.id === item.inReplyToId) ||\n contexts[i].find((t) => t.inReplyToId === item.id)\n ) {\n contexts[i].push(item);\n return;\n }\n }\n const repliedItem = items.find((i) => i.id === item.inReplyToId);\n if (repliedItem) {\n contexts[contextIndex++] = [item, repliedItem];\n }\n });\n\n // Check for cross-item contexts\n // Merge contexts into one if they have a common item (same id)\n for (let i = 0; i < contexts.length; i++) {\n for (let j = i + 1; j < contexts.length; j++) {\n const commonItem = contexts[i].find((t) => contexts[j].includes(t));\n if (commonItem) {\n contexts[i] = [...contexts[i], ...contexts[j]];\n // Remove duplicate items\n contexts[i] = contexts[i].filter(\n (item, index, self) =>\n self.findIndex((t) => t.id === item.id) === index,\n );\n contexts.splice(j, 1);\n j--;\n }\n }\n }\n\n // Sort items by checking inReplyToId\n contexts.forEach((context) => {\n context.sort((a, b) => {\n if (!a.inReplyToId && !b.inReplyToId) {\n return new Date(a.createdAt) - new Date(b.createdAt);\n }\n if (a.inReplyToId === b.id) return 1;\n if (b.inReplyToId === a.id) return -1;\n if (!a.inReplyToId) return -1;\n if (!b.inReplyToId) return 1;\n return new Date(a.createdAt) - new Date(b.createdAt);\n });\n });\n\n // Tag items that has different author than first post's author\n contexts.forEach((context) => {\n const firstItemAccountID = context[0].account.id;\n context.forEach((item) => {\n if (item.account.id !== firstItemAccountID) {\n item._differentAuthor = true;\n }\n });\n });\n\n if (contexts.length) console.log('🧵 Contexts', contexts);\n\n const newItems = [];\n const appliedContextIndices = [];\n const inReplyToIds = [];\n items.forEach((item) => {\n if (item.reblog) {\n newItems.push(item);\n return;\n }\n for (let i = 0; i < contexts.length; i++) {\n if (contexts[i].find((t) => t.id === item.id)) {\n if (appliedContextIndices.includes(i)) return;\n const contextItems = contexts[i];\n contextItems.sort((a, b) => {\n const aDate = new Date(a.createdAt);\n const bDate = new Date(b.createdAt);\n return aDate - bDate;\n });\n const firstItemAccountID = contextItems[0].account.id;\n newItems.push({\n id: contextItems.map((i) => i.id),\n items: contextItems,\n type: contextItems.every((it) => it.account.id === firstItemAccountID)\n ? 'thread'\n : 'conversation',\n });\n appliedContextIndices.push(i);\n return;\n }\n }\n\n // PREPARE FOR REPLY HINTS\n if (item.inReplyToId && item.inReplyToAccountId !== item.account.id) {\n const sKey = statusKey(item.id, instance);\n if (!states.statusReply[sKey]) {\n // If it's a reply and not a thread\n inReplyToIds.push({\n sKey,\n inReplyToId: item.inReplyToId,\n });\n // queueMicrotask(async () => {\n // try {\n // const { masto } = api({ instance });\n // // const replyToStatus = await masto.v1.statuses\n // // .$select(item.inReplyToId)\n // // .fetch();\n // const replyToStatus = await fetchStatus(item.inReplyToId, masto);\n // saveStatus(replyToStatus, instance, {\n // skipThreading: true,\n // skipUnfurling: true,\n // });\n // states.statusReply[sKey] = {\n // id: replyToStatus.id,\n // instance,\n // };\n // } catch (e) {\n // // Silently fail\n // console.error(e);\n // }\n // });\n }\n }\n\n newItems.push(item);\n });\n\n // FETCH AND SHOW REPLY HINTS\n if (inReplyToIds?.length) {\n queueMicrotask(() => {\n const { masto } = api({ instance });\n console.log('REPLYHINT', inReplyToIds);\n\n // Fallback if batch fetch fails or returns nothing or not supported\n async function fallbackFetch() {\n for (let i = 0; i < inReplyToIds.length; i++) {\n const { sKey, inReplyToId } = inReplyToIds[i];\n try {\n const replyToStatus = await fetchStatus(inReplyToId, masto);\n saveStatus(replyToStatus, instance, {\n skipThreading: true,\n });\n states.statusReply[sKey] = {\n id: replyToStatus.id,\n instance,\n };\n // Pause 1s\n await new Promise((resolve) => setTimeout(resolve, 1000));\n } catch (e) {\n // Silently fail\n console.error(e);\n }\n }\n }\n\n if (supports('@mastodon/fetch-multiple-statuses')) {\n // This is batch fetching yooo, woot\n // Limit 20, returns 422 if exceeded https://github.com/mastodon/mastodon/pull/27871\n const ids = inReplyToIds.map(({ inReplyToId }) => inReplyToId);\n (async () => {\n try {\n const replyToStatuses = await masto.v1.statuses.list({ id: ids });\n if (replyToStatuses?.length) {\n for (const replyToStatus of replyToStatuses) {\n saveStatus(replyToStatus, instance, {\n skipThreading: true,\n });\n const sKey = inReplyToIds.find(\n ({ inReplyToId }) => inReplyToId === replyToStatus.id,\n )?.sKey;\n if (sKey) {\n states.statusReply[sKey] = {\n id: replyToStatus.id,\n instance,\n };\n }\n }\n } else {\n fallbackFetch();\n }\n } catch (e) {\n // Silently fail\n console.error(e);\n fallbackFetch();\n }\n })();\n } else {\n fallbackFetch();\n }\n });\n }\n\n return newItems;\n}\n\nconst fetchStatus = pmem((statusID, masto) => {\n return masto.v1.statuses.$select(statusID).fetch();\n});\n\nexport async function assignFollowedTags(items, instance) {\n const followedTags = await getFollowedTags(); // [{name: 'tag'}, {...}]\n if (!followedTags.length) return;\n const { statusFollowedTags } = states;\n console.log('statusFollowedTags', statusFollowedTags);\n const statusWithFollowedTags = [];\n items.forEach((item) => {\n if (item.reblog) return;\n const { id, content, tags = [] } = item;\n const sKey = statusKey(id, instance);\n if (statusFollowedTags[sKey]?.length) return;\n const extractedTags = extractTagsFromStatus(content);\n if (!extractedTags.length && !tags.length) return;\n const itemFollowedTags = followedTags.reduce((acc, tag) => {\n if (\n extractedTags.some((t) => t.toLowerCase() === tag.name.toLowerCase()) ||\n tags.some((t) => t.name.toLowerCase() === tag.name.toLowerCase())\n ) {\n acc.push(tag.name);\n }\n return acc;\n }, []);\n if (itemFollowedTags.length) {\n // statusFollowedTags[sKey] = itemFollowedTags;\n statusWithFollowedTags.push({\n item,\n sKey,\n followedTags: itemFollowedTags,\n });\n }\n });\n\n if (statusWithFollowedTags.length) {\n const accounts = statusWithFollowedTags.map((s) => s.item.account);\n const relationships = await fetchRelationships(accounts);\n if (!relationships) return;\n\n statusWithFollowedTags.forEach((s) => {\n const { item, sKey, followedTags } = s;\n const r = relationships[item.account.id];\n if (r && !r.following) {\n statusFollowedTags[sKey] = followedTags;\n }\n });\n }\n}\n\nexport function clearFollowedTagsState() {\n states.statusFollowedTags = {};\n}\n","import { useLayoutEffect, useState } from 'preact/hooks';\n\nexport default function useScroll({\n scrollableRef,\n distanceFromStart = 1, // ratio of clientHeight/clientWidth\n distanceFromEnd = 1, // ratio of clientHeight/clientWidth\n scrollThresholdStart = 10,\n scrollThresholdEnd = 10,\n direction = 'vertical',\n distanceFromStartPx: _distanceFromStartPx,\n distanceFromEndPx: _distanceFromEndPx,\n} = {}) {\n const [scrollDirection, setScrollDirection] = useState(null);\n const [reachStart, setReachStart] = useState(false);\n const [reachEnd, setReachEnd] = useState(false);\n const [nearReachStart, setNearReachStart] = useState(false);\n const [nearReachEnd, setNearReachEnd] = useState(false);\n const isVertical = direction === 'vertical';\n\n useLayoutEffect(() => {\n const scrollableElement = scrollableRef.current;\n if (!scrollableElement) return {};\n let previousScrollStart = isVertical\n ? scrollableElement.scrollTop\n : scrollableElement.scrollLeft;\n\n function onScroll() {\n const {\n scrollTop,\n scrollLeft,\n scrollHeight,\n scrollWidth,\n clientHeight,\n clientWidth,\n } = scrollableElement;\n const scrollStart = isVertical ? scrollTop : scrollLeft;\n const scrollDimension = isVertical ? scrollHeight : scrollWidth;\n const clientDimension = isVertical ? clientHeight : clientWidth;\n const scrollDistance = Math.abs(scrollStart - previousScrollStart);\n const distanceFromStartPx =\n _distanceFromStartPx ||\n Math.min(\n clientDimension * distanceFromStart,\n scrollDimension,\n scrollStart,\n );\n const distanceFromEndPx =\n _distanceFromEndPx ||\n Math.min(\n clientDimension * distanceFromEnd,\n scrollDimension,\n scrollDimension - scrollStart - clientDimension,\n );\n\n if (\n scrollDistance >=\n (previousScrollStart < scrollStart\n ? scrollThresholdEnd\n : scrollThresholdStart)\n ) {\n setScrollDirection(previousScrollStart < scrollStart ? 'end' : 'start');\n previousScrollStart = scrollStart;\n }\n\n setReachStart(scrollStart <= 0);\n setReachEnd(scrollStart + clientDimension >= scrollDimension);\n setNearReachStart(scrollStart <= distanceFromStartPx);\n setNearReachEnd(\n scrollStart + clientDimension >= scrollDimension - distanceFromEndPx,\n );\n }\n\n scrollableElement.addEventListener('scroll', onScroll, { passive: true });\n\n return () => scrollableElement.removeEventListener('scroll', onScroll);\n }, [\n distanceFromStart,\n distanceFromEnd,\n scrollThresholdStart,\n scrollThresholdEnd,\n ]);\n\n return {\n scrollDirection,\n reachStart,\n reachEnd,\n nearReachStart,\n nearReachEnd,\n init: () => {\n if (scrollableRef.current) {\n scrollableRef.current.dispatchEvent(new Event('scroll'));\n }\n },\n };\n}\n","import { useEffect, useLayoutEffect, useRef, useState } from 'preact/hooks';\nimport { useThrottledCallback } from 'use-debounce';\n\nexport default function useScrollFn(\n {\n scrollableRef,\n distanceFromStart = 1, // ratio of clientHeight/clientWidth\n distanceFromEnd = 1, // ratio of clientHeight/clientWidth\n scrollThresholdStart = 10,\n scrollThresholdEnd = 10,\n direction = 'vertical',\n distanceFromStartPx: _distanceFromStartPx,\n distanceFromEndPx: _distanceFromEndPx,\n init,\n } = {},\n callback,\n deps,\n) {\n if (!callback) return;\n // const [scrollDirection, setScrollDirection] = useState(null);\n // const [reachStart, setReachStart] = useState(false);\n // const [reachEnd, setReachEnd] = useState(false);\n // const [nearReachStart, setNearReachStart] = useState(false);\n // const [nearReachEnd, setNearReachEnd] = useState(false);\n const isVertical = direction === 'vertical';\n const previousScrollStart = useRef(null);\n const scrollDirection = useRef(null);\n\n const onScroll = useThrottledCallback(() => {\n // let scrollDirection = null;\n let reachStart = false;\n let reachEnd = false;\n let nearReachStart = false;\n let nearReachEnd = false;\n\n const scrollableElement = scrollableRef.current;\n const {\n scrollTop,\n scrollLeft,\n scrollHeight,\n scrollWidth,\n clientHeight,\n clientWidth,\n } = scrollableElement;\n const scrollStart = isVertical ? scrollTop : scrollLeft;\n const scrollDimension = isVertical ? scrollHeight : scrollWidth;\n const clientDimension = isVertical ? clientHeight : clientWidth;\n const scrollDistance = Math.abs(scrollStart - previousScrollStart.current);\n const distanceFromStartPx =\n _distanceFromStartPx ||\n Math.min(\n clientDimension * distanceFromStart,\n scrollDimension,\n scrollStart,\n );\n const distanceFromEndPx =\n _distanceFromEndPx ||\n Math.min(\n clientDimension * distanceFromEnd,\n scrollDimension,\n scrollDimension - scrollStart - clientDimension,\n );\n\n if (\n scrollDistance >=\n (previousScrollStart.current < scrollStart\n ? scrollThresholdEnd\n : scrollThresholdStart)\n ) {\n // setScrollDirection(\n // previousScrollStart.current < scrollStart ? 'end' : 'start',\n // );\n scrollDirection.current =\n previousScrollStart.current < scrollStart ? 'end' : 'start';\n previousScrollStart.current = scrollStart;\n }\n\n // setReachStart(scrollStart <= 0);\n // setReachEnd(scrollStart + clientDimension >= scrollDimension);\n // setNearReachStart(scrollStart <= distanceFromStartPx);\n // setNearReachEnd(\n // scrollStart + clientDimension >= scrollDimension - distanceFromEndPx,\n // );\n reachStart = scrollStart <= 0;\n reachEnd = scrollStart + clientDimension >= scrollDimension;\n nearReachStart = scrollStart <= distanceFromStartPx;\n nearReachEnd =\n scrollStart + clientDimension >= scrollDimension - distanceFromEndPx;\n\n callback({\n scrollDirection: scrollDirection.current,\n reachStart,\n reachEnd,\n nearReachStart,\n nearReachEnd,\n });\n }, 500);\n\n useLayoutEffect(() => {\n const scrollableElement = scrollableRef.current;\n if (!scrollableElement) return {};\n previousScrollStart.current =\n scrollableElement[isVertical ? 'scrollTop' : 'scrollLeft'];\n\n scrollableElement.addEventListener('scroll', onScroll, { passive: true });\n\n return () => scrollableElement.removeEventListener('scroll', onScroll);\n }, [\n distanceFromStart,\n distanceFromEnd,\n scrollThresholdStart,\n scrollThresholdEnd,\n ...deps,\n ]);\n\n // useEffect(() => {\n // callback({\n // scrollDirection,\n // reachStart,\n // reachEnd,\n // nearReachStart,\n // nearReachEnd,\n // });\n // }, [\n // scrollDirection,\n // reachStart,\n // reachEnd,\n // nearReachStart,\n // nearReachEnd,\n // ...deps,\n // ]);\n\n useEffect(() => {\n if (init && scrollableRef.current) {\n queueMicrotask(() => {\n scrollableRef.current.dispatchEvent(new Event('scroll'));\n });\n }\n }, [init]);\n\n // return {\n // scrollDirection,\n // reachStart,\n // reachEnd,\n // nearReachStart,\n // nearReachEnd,\n // init: () => {\n // if (scrollableRef.current) {\n // scrollableRef.current.dispatchEvent(new Event('scroll'));\n // }\n // },\n // };\n}\n","import './media-post.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { memo } from 'preact/compat';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport FilterContext from '../utils/filter-context';\nimport { isFiltered } from '../utils/filters';\nimport states, { statusKey } from '../utils/states';\nimport store from '../utils/store';\nimport { getCurrentAccountID } from '../utils/store-utils';\n\nimport Media from './media';\n\nfunction MediaPost({\n class: className,\n statusID,\n status,\n instance,\n parent,\n // allowFilters,\n onMediaClick,\n}) {\n let sKey = statusKey(statusID, 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,\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 // Non-API props\n _deleted,\n _pinned,\n // _filtered,\n } = status;\n\n if (!mediaAttachments?.length) {\n return null;\n }\n\n const debugHover = (e) => {\n if (e.shiftKey) {\n console.log({\n ...status,\n });\n }\n };\n\n const currentAccount = useMemo(() => {\n return getCurrentAccountID();\n }, []);\n const isSelf = useMemo(() => {\n return currentAccount && currentAccount === accountId;\n }, [accountId, currentAccount]);\n\n const filterContext = useContext(FilterContext);\n const filterInfo = !isSelf && isFiltered(filtered, filterContext);\n\n if (filterInfo?.action === 'hide') {\n return null;\n }\n\n console.debug('RENDER Media post', id, status?.account.displayName);\n\n const hasSpoiler = sensitive;\n const readingExpandMedia = useMemo(() => {\n // default | show_all | hide_all\n const prefs = store.account.get('preferences') || {};\n return prefs['reading:expand:media']?.toLowerCase() || 'default';\n }, []);\n const showSpoilerMedia = readingExpandMedia === 'show_all';\n\n const Parent = parent || 'div';\n\n return mediaAttachments.map((media, i) => {\n const mediaKey = `${sKey}-${media.id}`;\n const filterTitleStr = filterInfo?.titlesStr;\n return (\n <Parent\n data-state-post-id={sKey}\n onMouseEnter={debugHover}\n key={mediaKey}\n data-spoiler-text={\n spoilerText || (sensitive ? t`Sensitive media` : undefined)\n }\n data-filtered-text={\n filterInfo\n ? filterTitleStr\n ? t`Filtered: ${filterTitleStr}`\n : t`Filtered`\n : undefined\n }\n class={`\n media-post\n ${filterInfo ? 'filtered' : ''}\n ${hasSpoiler ? 'has-spoiler' : ''}\n ${showSpoilerMedia ? 'show-media' : ''}\n `}\n >\n <Media\n class={className}\n media={media}\n lang={language}\n to={`/${instance}/s/${id}?media-only=${i + 1}`}\n onClick={\n onMediaClick ? (e) => onMediaClick(e, i, media, status) : undefined\n }\n />\n </Parent>\n );\n });\n}\n\nexport default memo(MediaPost);\n","import './nav-menu.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { ControlledMenu, MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport { memo } from 'preact/compat';\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport { useLongPress } from 'use-long-press';\nimport { useSnapshot } from 'valtio';\n\nimport { api } from '../utils/api';\nimport { getLists } from '../utils/lists';\nimport safeBoundingBoxPadding from '../utils/safe-bounding-box-padding';\nimport states from '../utils/states';\nimport store from '../utils/store';\nimport { getCurrentAccountID } from '../utils/store-utils';\nimport supports from '../utils/supports';\n\nimport Avatar from './avatar';\nimport Icon from './icon';\nimport MenuLink from './menu-link';\nimport SubMenu2 from './submenu2';\n\nfunction NavMenu(props) {\n const snapStates = useSnapshot(states);\n const { masto, instance, authenticated } = api();\n\n const [currentAccount, moreThanOneAccount] = useMemo(() => {\n const accounts = store.local.getJSON('accounts') || [];\n const acc =\n accounts.find((account) => account.info.id === getCurrentAccountID()) ||\n accounts[0];\n return [acc, accounts.length > 1];\n }, []);\n\n // Home = Following\n // But when in multi-column mode, Home becomes columns of anything\n // User may choose pin or not to pin Following\n // If user doesn't pin Following, we show it in the menu\n const showFollowing =\n (snapStates.settings.shortcutsViewMode === 'multi-column' ||\n (!snapStates.settings.shortcutsViewMode &&\n snapStates.settings.shortcutsColumnsMode)) &&\n !snapStates.shortcuts.find((pin) => pin.type === 'following');\n\n const bindLongPress = useLongPress(\n () => {\n states.showAccounts = true;\n },\n {\n threshold: 600,\n detect: 'touch',\n cancelOnMovement: true,\n },\n );\n\n const buttonRef = useRef();\n const [menuState, setMenuState] = useState(undefined);\n\n const boundingBoxPadding = safeBoundingBoxPadding([\n 0,\n 0,\n snapStates.settings.shortcutsViewMode === 'tab-menu-bar' ? 50 : 0,\n 0,\n ]);\n\n const mutesIterator = useRef();\n async function fetchMutes(firstLoad) {\n if (firstLoad || !mutesIterator.current) {\n mutesIterator.current = masto.v1.mutes.list({\n limit: 80,\n });\n }\n const results = await mutesIterator.current.next();\n return results;\n }\n\n const blocksIterator = useRef();\n async function fetchBlocks(firstLoad) {\n if (firstLoad || !blocksIterator.current) {\n blocksIterator.current = masto.v1.blocks.list({\n limit: 80,\n });\n }\n const results = await blocksIterator.current.next();\n return results;\n }\n\n const buttonClickTS = useRef();\n return (\n <>\n <button\n ref={buttonRef}\n type=\"button\"\n class={`button plain nav-menu-button ${\n moreThanOneAccount ? 'with-avatar' : ''\n } ${menuState === 'open' ? 'active' : ''}`}\n style={{ position: 'relative' }}\n onClick={() => {\n buttonClickTS.current = Date.now();\n setMenuState((state) => (!state ? 'open' : undefined));\n }}\n onContextMenu={(e) => {\n e.preventDefault();\n states.showAccounts = true;\n }}\n {...bindLongPress()}\n >\n {moreThanOneAccount && (\n <Avatar\n url={\n currentAccount?.info?.avatar || currentAccount?.info?.avatarStatic\n }\n size=\"l\"\n squircle={currentAccount?.info?.bot}\n />\n )}\n <Icon icon=\"menu\" size={moreThanOneAccount ? 's' : 'l'} alt={t`Menu`} />\n </button>\n <ControlledMenu\n menuClassName=\"nav-menu\"\n state={menuState}\n anchorRef={buttonRef}\n onClose={() => {\n setMenuState(undefined);\n }}\n containerProps={{\n style: {\n zIndex: 10,\n },\n onClick: () => {\n if (Date.now() - buttonClickTS.current < 300) {\n return;\n }\n // setMenuState(undefined);\n },\n }}\n portal={{\n target: document.body,\n }}\n {...props}\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n align=\"center\"\n boundingBoxPadding={boundingBoxPadding}\n unmountOnClose\n >\n {!!snapStates.appVersion?.commitHash &&\n __COMMIT_HASH__ !== snapStates.appVersion.commitHash && (\n <div class=\"top-menu\">\n <MenuItem\n onClick={() => {\n const yes = confirm(t`Reload page now to update?`);\n if (yes) {\n (async () => {\n try {\n location.reload();\n } catch (e) {}\n })();\n }\n }}\n >\n <Icon icon=\"sparkles\" class=\"sparkle-icon\" size=\"l\" />{' '}\n <span>\n <Trans>New update available…</Trans>\n </span>\n </MenuItem>\n <MenuDivider />\n </div>\n )}\n <section>\n <MenuLink to=\"/\">\n <Icon icon=\"home\" size=\"l\" />{' '}\n <span>\n <Trans>Home</Trans>\n </span>\n </MenuLink>\n {authenticated ? (\n <>\n {showFollowing && (\n <MenuLink to=\"/following\">\n <Icon icon=\"following\" size=\"l\" />{' '}\n <span>\n <Trans id=\"following.title\">Following</Trans>\n </span>\n </MenuLink>\n )}\n <MenuLink to=\"/catchup\">\n <Icon icon=\"history2\" size=\"l\" />\n <span>\n <Trans>Catch-up</Trans>\n </span>\n </MenuLink>\n {supports('@mastodon/mentions') && (\n <MenuLink to=\"/mentions\">\n <Icon icon=\"at\" size=\"l\" />{' '}\n <span>\n <Trans>Mentions</Trans>\n </span>\n </MenuLink>\n )}\n <MenuLink to=\"/notifications\">\n <Icon icon=\"notification\" size=\"l\" />{' '}\n <span>\n <Trans>Notifications</Trans>\n </span>\n {snapStates.notificationsShowNew && (\n <sup title={t`New`} style={{ opacity: 0.5 }}>\n {' '}\n •\n </sup>\n )}\n </MenuLink>\n <MenuDivider />\n {currentAccount?.info?.id && (\n <MenuLink to={`/${instance}/a/${currentAccount.info.id}`}>\n <Icon icon=\"user\" size=\"l\" />{' '}\n <span>\n <Trans>Profile</Trans>\n </span>\n </MenuLink>\n )}\n <ListMenu menuState={menuState} />\n <MenuLink to=\"/b\">\n <Icon icon=\"bookmark\" size=\"l\" />{' '}\n <span>\n <Trans>Bookmarks</Trans>\n </span>\n </MenuLink>\n <SubMenu2\n menuClassName=\"nav-submenu\"\n overflow=\"auto\"\n gap={-8}\n label={\n <>\n <Icon icon=\"more\" size=\"l\" />\n <span class=\"menu-grow\">\n <Trans>More…</Trans>\n </span>\n <Icon icon=\"chevron-right\" />\n </>\n }\n >\n <MenuLink to=\"/f\">\n <Icon icon=\"heart\" size=\"l\" />{' '}\n <span>\n <Trans>Likes</Trans>\n </span>\n </MenuLink>\n <MenuLink to=\"/fh\">\n <Icon icon=\"hashtag\" size=\"l\" />{' '}\n <span>\n <Trans>Followed Hashtags</Trans>\n </span>\n </MenuLink>\n <MenuDivider />\n {supports('@mastodon/filters') && (\n <MenuLink to=\"/ft\">\n <Icon icon=\"filters\" size=\"l\" />{' '}\n <span>\n <Trans>Filters</Trans>\n </span>\n </MenuLink>\n )}\n <MenuItem\n onClick={() => {\n states.showGenericAccounts = {\n id: 'mute',\n heading: t`Muted users`,\n fetchAccounts: fetchMutes,\n excludeRelationshipAttrs: ['muting'],\n };\n }}\n >\n <Icon icon=\"mute\" size=\"l\" />{' '}\n <span>\n <Trans>Muted users…</Trans>\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n states.showGenericAccounts = {\n id: 'block',\n heading: t`Blocked users`,\n fetchAccounts: fetchBlocks,\n excludeRelationshipAttrs: ['blocking'],\n };\n }}\n >\n <Icon icon=\"block\" size=\"l\" />{' '}\n <span>\n <Trans>Blocked users…</Trans>\n </span>\n </MenuItem>{' '}\n </SubMenu2>\n <MenuDivider />\n <MenuItem\n onClick={() => {\n states.showAccounts = true;\n }}\n >\n <Icon icon=\"group\" size=\"l\" />{' '}\n <span>\n <Trans>Accounts…</Trans>\n </span>\n </MenuItem>\n </>\n ) : (\n <>\n <MenuDivider />\n <MenuLink to=\"/login\">\n <Icon icon=\"user\" size=\"l\" />{' '}\n <span>\n <Trans>Log in</Trans>\n </span>\n </MenuLink>\n </>\n )}\n </section>\n <section>\n <MenuDivider />\n <MenuLink to={`/search`}>\n <Icon icon=\"search\" size=\"l\" />{' '}\n <span>\n <Trans>Search</Trans>\n </span>\n </MenuLink>\n <MenuLink to={`/${instance}/trending`}>\n <Icon icon=\"chart\" size=\"l\" />{' '}\n <span>\n <Trans>Trending</Trans>\n </span>\n </MenuLink>\n <MenuLink to={`/${instance}/p/l`}>\n <Icon icon=\"building\" size=\"l\" />{' '}\n <span>\n <Trans>Local</Trans>\n </span>\n </MenuLink>\n <MenuLink to={`/${instance}/p`}>\n <Icon icon=\"earth\" size=\"l\" />{' '}\n <span>\n <Trans>Federated</Trans>\n </span>\n </MenuLink>\n {authenticated ? (\n <>\n <MenuDivider className=\"divider-grow\" />\n <MenuItem\n onClick={() => {\n states.showKeyboardShortcutsHelp = true;\n }}\n >\n <Icon icon=\"keyboard\" size=\"l\" />{' '}\n <span>\n <Trans>Keyboard shortcuts</Trans>\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n states.showShortcutsSettings = true;\n }}\n >\n <Icon icon=\"shortcut\" size=\"l\" />{' '}\n <span>\n <Trans>Shortcuts / Columns…</Trans>\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n states.showSettings = true;\n }}\n >\n <Icon icon=\"gear\" size=\"l\" />{' '}\n <span>\n <Trans>Settings…</Trans>\n </span>\n </MenuItem>\n </>\n ) : (\n <>\n <MenuDivider />\n <MenuItem\n onClick={() => {\n states.showSettings = true;\n }}\n >\n <Icon icon=\"gear\" size=\"l\" />{' '}\n <span>\n <Trans>Settings…</Trans>\n </span>\n </MenuItem>\n </>\n )}\n </section>\n </ControlledMenu>\n </>\n );\n}\n\nfunction ListMenu({ menuState }) {\n const supportsLists = supports('@mastodon/lists');\n const [lists, setLists] = useState([]);\n useEffect(() => {\n if (!supportsLists) return;\n if (menuState === 'open') {\n getLists().then(setLists);\n }\n }, [menuState, supportsLists]);\n\n return lists.length > 0 ? (\n <SubMenu2\n menuClassName=\"nav-submenu\"\n overflow=\"auto\"\n gap={-8}\n label={\n <>\n <Icon icon=\"list\" size=\"l\" />\n <span class=\"menu-grow\">\n <Trans>Lists</Trans>\n </span>\n <Icon icon=\"chevron-right\" />\n </>\n }\n >\n <MenuLink to=\"/l\">\n <span>\n <Trans>All Lists</Trans>\n </span>\n </MenuLink>\n {lists?.length > 0 && (\n <>\n <MenuDivider />\n {lists.map((list) => (\n <MenuLink key={list.id} to={`/l/${list.id}`}>\n <span>{list.title}</span>\n </MenuLink>\n ))}\n </>\n )}\n </SubMenu2>\n ) : (\n supportsLists && (\n <MenuLink to=\"/l\">\n <Icon icon=\"list\" size=\"l\" />\n <span>\n <Trans>Lists</Trans>\n </span>\n </MenuLink>\n )\n );\n}\n\nexport default memo(NavMenu);\n","import { plural, t, Trans } from '@lingui/macro';\nimport { memo } from 'preact/compat';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { InView } from 'react-intersection-observer';\nimport { useDebouncedCallback } from 'use-debounce';\nimport { useSnapshot } from 'valtio';\n\nimport FilterContext from '../utils/filter-context';\nimport { filteredItems, isFiltered } from '../utils/filters';\nimport isRTL from '../utils/is-rtl';\nimport showToast from '../utils/show-toast';\nimport states, { statusKey } from '../utils/states';\nimport statusPeek from '../utils/status-peek';\nimport { isMediaFirstInstance } from '../utils/store-utils';\nimport { groupBoosts, groupContext } from '../utils/timeline-utils';\nimport useInterval from '../utils/useInterval';\nimport usePageVisibility from '../utils/usePageVisibility';\nimport useScroll from '../utils/useScroll';\nimport useScrollFn from '../utils/useScrollFn';\n\nimport Icon from './icon';\nimport Link from './link';\nimport MediaPost from './media-post';\nimport NavMenu from './nav-menu';\nimport Status from './status';\n\nconst scrollIntoViewOptions = {\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n};\n\nfunction Timeline({\n title,\n titleComponent,\n id,\n instance,\n emptyText,\n errorText,\n useItemID, // use statusID instead of status object, assuming it's already in states\n boostsCarousel,\n fetchItems = () => {},\n checkForUpdates = () => {},\n checkForUpdatesInterval = 15_000, // 15 seconds\n headerStart,\n headerEnd,\n timelineStart,\n // allowFilters,\n refresh,\n view,\n filterContext,\n showFollowedTags,\n showReplyParent,\n clearWhenRefresh,\n}) {\n const snapStates = useSnapshot(states);\n const [items, setItems] = useState([]);\n const [uiState, setUIState] = useState('start');\n const [showMore, setShowMore] = useState(false);\n const [showNew, setShowNew] = useState(false);\n const [visible, setVisible] = useState(true);\n const scrollableRef = useRef();\n\n console.debug('RENDER Timeline', id, refresh);\n __BENCHMARK.start(`timeline-${id}-load`);\n\n const mediaFirst = useMemo(() => isMediaFirstInstance(), []);\n\n const allowGrouping = view !== 'media';\n const loadItemsTS = useRef(0); // Ensures only one loadItems at a time\n const loadItems = useDebouncedCallback(\n (firstLoad) => {\n setShowNew(false);\n // if (uiState === 'loading') return;\n setUIState('loading');\n (async () => {\n try {\n const ts = (loadItemsTS.current = Date.now());\n let { done, value } = await fetchItems(firstLoad);\n if (ts !== loadItemsTS.current) return;\n if (Array.isArray(value)) {\n // Avoid grouping for pinned posts\n const [pinnedPosts, otherPosts] = value.reduce(\n (acc, item) => {\n if (item._pinned) {\n acc[0].push(item);\n } else {\n acc[1].push(item);\n }\n return acc;\n },\n [[], []],\n );\n value = otherPosts;\n if (allowGrouping) {\n if (boostsCarousel) {\n value = groupBoosts(value);\n }\n value = groupContext(value, instance);\n }\n if (pinnedPosts.length) {\n value = pinnedPosts.concat(value);\n }\n console.log(value);\n if (firstLoad) {\n setItems(value);\n } else {\n setItems((items) => [...items, ...value]);\n }\n if (!value.length) done = true;\n setShowMore(!done);\n } else {\n setShowMore(false);\n }\n setUIState('default');\n __BENCHMARK.end(`timeline-${id}-load`);\n } catch (e) {\n console.error(e);\n setUIState('error');\n if (firstLoad && !items.length && errorText) {\n showToast(errorText);\n }\n } finally {\n loadItems.cancel();\n }\n })();\n },\n 1_000,\n {\n leading: true,\n // trailing: false,\n },\n );\n\n const itemsSelector = '.timeline-item, .timeline-item-alt';\n\n const jRef = useHotkeys('j, shift+j', (_, handler) => {\n // focus on next status after active item\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let nextItem = allItems[activeItemIndex + 1];\n if (handler.shift) {\n // get next status that's not .timeline-item-alt\n nextItem = allItems.find(\n (item, index) =>\n index > activeItemIndex &&\n !item.classList.contains('timeline-item-alt'),\n );\n }\n if (nextItem) {\n nextItem.focus();\n nextItem.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n // If active status is not in viewport, get the topmost status-link in viewport\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0; // 44 is the magic number for header height, not real\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n const kRef = useHotkeys('k, shift+k', (_, handler) => {\n // focus on previous status after active item\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let prevItem = allItems[activeItemIndex - 1];\n if (handler.shift) {\n // get prev status that's not .timeline-item-alt\n prevItem = allItems.findLast(\n (item, index) =>\n index < activeItemIndex &&\n !item.classList.contains('timeline-item-alt'),\n );\n }\n if (prevItem) {\n prevItem.focus();\n prevItem.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n // If active status is not in viewport, get the topmost status-link in viewport\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0; // 44 is the magic number for header height, not real\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n const oRef = useHotkeys(['enter', 'o'], () => {\n // open active status\n const activeItem = document.activeElement;\n if (activeItem?.matches(itemsSelector)) {\n activeItem.click();\n }\n });\n\n const showNewPostsIndicator =\n items.length > 0 && uiState !== 'loading' && showNew;\n const handleLoadNewPosts = useCallback(() => {\n if (showNewPostsIndicator) loadItems(true);\n scrollableRef.current?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }, [loadItems, showNewPostsIndicator]);\n const dotRef = useHotkeys('.', handleLoadNewPosts);\n\n // const {\n // scrollDirection,\n // nearReachStart,\n // nearReachEnd,\n // reachStart,\n // reachEnd,\n // } = useScroll({\n // scrollableRef,\n // distanceFromEnd: 2,\n // scrollThresholdStart: 44,\n // });\n const headerRef = useRef();\n // const [hiddenUI, setHiddenUI] = useState(false);\n const [nearReachStart, setNearReachStart] = useState(false);\n useScrollFn(\n {\n scrollableRef,\n distanceFromEnd: 2,\n scrollThresholdStart: 44,\n },\n ({\n scrollDirection,\n nearReachStart,\n // nearReachEnd,\n reachStart,\n // reachEnd,\n }) => {\n // setHiddenUI(scrollDirection === 'end' && !nearReachEnd);\n if (headerRef.current) {\n const hiddenUI = scrollDirection === 'end' && !nearReachStart;\n headerRef.current.hidden = hiddenUI;\n }\n setNearReachStart(nearReachStart);\n if (reachStart) {\n loadItems(true);\n }\n // else if (nearReachEnd || (reachEnd && showMore)) {\n // loadItems();\n // }\n },\n [],\n );\n\n useEffect(() => {\n scrollableRef.current?.scrollTo({ top: 0 });\n loadItems(true);\n }, []);\n const firstLoad = useRef(true);\n useEffect(() => {\n if (firstLoad.current) {\n firstLoad.current = false;\n return;\n }\n if (clearWhenRefresh && items?.length) {\n loadItems.cancel?.();\n setItems([]);\n }\n loadItems(true);\n }, [clearWhenRefresh, refresh]);\n\n // useEffect(() => {\n // if (reachStart) {\n // loadItems(true);\n // }\n // }, [reachStart]);\n\n // useEffect(() => {\n // if (nearReachEnd || (reachEnd && showMore)) {\n // loadItems();\n // }\n // }, [nearReachEnd, showMore]);\n\n const prevView = useRef(view);\n useEffect(() => {\n if (prevView.current !== view) {\n prevView.current = view;\n setItems([]);\n }\n }, [view]);\n\n const loadOrCheckUpdates = useCallback(\n async ({ disableIdleCheck = false } = {}) => {\n const noPointers = scrollableRef.current\n ? getComputedStyle(scrollableRef.current).pointerEvents === 'none'\n : false;\n console.log('✨ Load or check updates', id, {\n autoRefresh: snapStates.settings.autoRefresh,\n scrollTop: scrollableRef.current.scrollTop,\n disableIdleCheck,\n idle: window.__IDLE__,\n inBackground: inBackground(),\n noPointers,\n });\n if (\n snapStates.settings.autoRefresh &&\n scrollableRef.current.scrollTop < 16 &&\n (disableIdleCheck || window.__IDLE__) &&\n !inBackground() &&\n !noPointers\n ) {\n console.log('✨ Load updates', id, snapStates.settings.autoRefresh);\n loadItems(true);\n } else {\n console.log('✨ Check updates', id, snapStates.settings.autoRefresh);\n const hasUpdate = await checkForUpdates();\n if (hasUpdate) {\n console.log('✨ Has new updates', id);\n setShowNew(true);\n }\n }\n },\n [id, loadItems, checkForUpdates, snapStates.settings.autoRefresh],\n );\n\n const lastHiddenTime = useRef();\n usePageVisibility(\n (visible) => {\n if (visible) {\n const timeDiff = Date.now() - lastHiddenTime.current;\n if (!lastHiddenTime.current || timeDiff > 1000 * 3) {\n // 3 seconds\n loadOrCheckUpdates({\n disableIdleCheck: true,\n });\n }\n } else {\n lastHiddenTime.current = Date.now();\n }\n setVisible(visible);\n },\n [checkForUpdates, loadOrCheckUpdates, snapStates.settings.autoRefresh],\n );\n\n // checkForUpdates interval\n useInterval(\n loadOrCheckUpdates,\n visible && !showNew\n ? checkForUpdatesInterval * (nearReachStart ? 1 : 2)\n : null,\n );\n\n // const hiddenUI = scrollDirection === 'end' && !nearReachStart;\n\n return (\n <FilterContext.Provider value={filterContext}>\n <div\n id={`${id}-page`}\n class={`deck-container ${\n mediaFirst ? 'deck-container-media-first' : ''\n }`}\n ref={(node) => {\n scrollableRef.current = node;\n jRef(node);\n kRef(node);\n oRef(node);\n dotRef(node);\n }}\n tabIndex=\"-1\"\n onClick={(e) => {\n // If click on timeline item, unhide header\n if (\n headerRef.current &&\n e.target.closest('.timeline-item, .timeline-item-alt')\n ) {\n setTimeout(() => {\n headerRef.current.hidden = false;\n }, 250);\n }\n }}\n >\n <div class=\"timeline-deck deck\">\n <header\n ref={headerRef}\n // hidden={hiddenUI}\n onClick={(e) => {\n if (!e.target.closest('a, button')) {\n scrollableRef.current?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }\n }}\n onDblClick={(e) => {\n if (!e.target.closest('a, button')) {\n loadItems(true);\n }\n }}\n class={uiState === 'loading' ? 'loading' : ''}\n >\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n {headerStart !== null && headerStart !== undefined ? (\n headerStart\n ) : (\n <Link to=\"/\" class=\"button plain home-button\">\n <Icon icon=\"home\" size=\"l\" alt={t`Home`} />\n </Link>\n )}\n </div>\n {title && (titleComponent ? titleComponent : <h1>{title}</h1>)}\n <div class=\"header-side\">\n {/* <Loader hidden={uiState !== 'loading'} /> */}\n {!!headerEnd && headerEnd}\n </div>\n </div>\n {showNewPostsIndicator && (\n <button\n class=\"updates-button shiny-pill\"\n type=\"button\"\n onClick={handleLoadNewPosts}\n >\n <Icon icon=\"arrow-up\" /> <Trans>New posts</Trans>\n </button>\n )}\n </header>\n {!!timelineStart && (\n <div\n class={`timeline-start ${uiState === 'loading' ? 'loading' : ''}`}\n >\n {timelineStart}\n </div>\n )}\n {!!items.length ? (\n <>\n <ul class={`timeline ${view ? `timeline-${view}` : ''}`}>\n {items.map((status) => (\n <TimelineItem\n status={status}\n instance={instance}\n useItemID={useItemID}\n // allowFilters={allowFilters}\n filterContext={filterContext}\n key={status.id + status?._pinned + view}\n view={view}\n showFollowedTags={showFollowedTags}\n showReplyParent={showReplyParent}\n mediaFirst={mediaFirst}\n />\n ))}\n {showMore &&\n uiState === 'loading' &&\n (view === 'media' ? null : (\n <>\n <li\n style={{\n height: '20vh',\n }}\n >\n <Status skeleton mediaFirst={mediaFirst} />\n </li>\n <li\n style={{\n height: '25vh',\n }}\n >\n <Status skeleton mediaFirst={mediaFirst} />\n </li>\n </>\n ))}\n </ul>\n {uiState === 'default' &&\n (showMore ? (\n <InView\n root={scrollableRef.current}\n rootMargin={`0px 0px ${screen.height * 1.5}px 0px`}\n onChange={(inView) => {\n if (inView) {\n loadItems();\n }\n }}\n >\n <button\n type=\"button\"\n class=\"plain block\"\n onClick={() => loadItems()}\n style={{ marginBlockEnd: '6em' }}\n >\n <Trans>Show more…</Trans>\n </button>\n </InView>\n ) : (\n <p class=\"ui-state insignificant\">\n <Trans>The end.</Trans>\n </p>\n ))}\n </>\n ) : uiState === 'loading' ? (\n <ul class=\"timeline\">\n {Array.from({ length: 5 }).map((_, i) =>\n view === 'media' ? (\n <div\n style={{\n height: '50vh',\n }}\n />\n ) : (\n <li key={i}>\n <Status skeleton mediaFirst={mediaFirst} />\n </li>\n ),\n )}\n </ul>\n ) : (\n uiState !== 'error' &&\n uiState !== 'start' && <p class=\"ui-state\">{emptyText}</p>\n )}\n {uiState === 'error' && (\n <p class=\"ui-state\">\n {errorText}\n <br />\n <br />\n <button type=\"button\" onClick={() => loadItems(!items.length)}>\n <Trans>Try again</Trans>\n </button>\n </p>\n )}\n </div>\n </div>\n </FilterContext.Provider>\n );\n}\n\nconst TimelineItem = memo(\n ({\n status,\n instance,\n useItemID,\n // allowFilters,\n filterContext,\n view,\n showFollowedTags,\n showReplyParent,\n mediaFirst,\n }) => {\n console.debug('RENDER TimelineItem', status.id);\n const { id: statusID, reblog, items, type, _pinned } = status;\n if (_pinned) useItemID = false;\n const actualStatusID = reblog?.id || statusID;\n const url = instance\n ? `/${instance}/s/${actualStatusID}`\n : `/s/${actualStatusID}`;\n\n if (items) {\n let fItems = filteredItems(items, filterContext);\n let title = '';\n if (type === 'boosts') {\n title = plural(fItems.length, {\n one: '# Boost',\n other: '# Boosts',\n });\n } else if (type === 'pinned') {\n title = t`Pinned posts`;\n }\n const isCarousel = type === 'boosts' || type === 'pinned';\n if (isCarousel) {\n const filteredItemsIDs = new Set();\n // Here, we don't hide filtered posts, but we sort them last\n fItems.sort((a, b) => {\n // if (a._filtered && !b._filtered) {\n // return 1;\n // }\n // if (!a._filtered && b._filtered) {\n // return -1;\n // }\n const aFiltered = isFiltered(a.filtered, filterContext);\n const bFiltered = isFiltered(b.filtered, filterContext);\n if (aFiltered) filteredItemsIDs.add(a.id);\n if (bFiltered) filteredItemsIDs.add(b.id);\n if (aFiltered && !bFiltered) {\n return 1;\n }\n if (!aFiltered && bFiltered) {\n return -1;\n }\n return 0;\n });\n\n if (filteredItemsIDs.size >= 2) {\n const GROUP_SIZE = 5;\n // If 2 or more, group filtered items into one, limit to GROUP_SIZE in a group\n const unfiltered = [];\n const filtered = [];\n fItems.forEach((item) => {\n if (filteredItemsIDs.has(item.id)) {\n filtered.push(item);\n } else {\n unfiltered.push(item);\n }\n });\n const filteredItems = [];\n for (let i = 0; i < filtered.length; i += GROUP_SIZE) {\n filteredItems.push({\n _grouped: true,\n posts: filtered.slice(i, i + GROUP_SIZE),\n });\n }\n fItems = unfiltered.concat(filteredItems);\n }\n\n return (\n <li key={`timeline-${statusID}`} class=\"timeline-item-carousel\">\n <StatusCarousel title={title} class={`${type}-carousel`}>\n {fItems.map((item) => {\n const { id: statusID, reblog, _pinned, _grouped } = item;\n if (_grouped) {\n return (\n <li key={statusID} class=\"timeline-item-carousel-group\">\n {item.posts.map((item) => {\n const { id: statusID, reblog, _pinned } = item;\n const actualStatusID = reblog?.id || statusID;\n const url = instance\n ? `/${instance}/s/${actualStatusID}`\n : `/s/${actualStatusID}`;\n if (_pinned) useItemID = false;\n return (\n <Link\n class=\"status-carousel-link timeline-item-alt\"\n to={url}\n >\n {useItemID ? (\n <Status\n statusID={statusID}\n instance={instance}\n size=\"s\"\n />\n ) : (\n <Status\n status={item}\n instance={instance}\n size=\"s\"\n />\n )}\n </Link>\n );\n })}\n </li>\n );\n }\n\n const actualStatusID = reblog?.id || statusID;\n const url = instance\n ? `/${instance}/s/${actualStatusID}`\n : `/s/${actualStatusID}`;\n if (_pinned) useItemID = false;\n return (\n <li key={statusID}>\n <Link\n class=\"status-carousel-link timeline-item-alt\"\n to={url}\n >\n {useItemID ? (\n <Status\n statusID={statusID}\n instance={instance}\n size=\"s\"\n contentTextWeight\n enableCommentHint\n // allowFilters={allowFilters}\n mediaFirst={mediaFirst}\n />\n ) : (\n <Status\n status={item}\n instance={instance}\n size=\"s\"\n contentTextWeight\n enableCommentHint\n // allowFilters={allowFilters}\n mediaFirst={mediaFirst}\n />\n )}\n </Link>\n </li>\n );\n })}\n </StatusCarousel>\n </li>\n );\n }\n const manyItems = fItems.length > 3;\n return fItems.map((item, i) => {\n const { id: statusID, _differentAuthor } = item;\n const url = instance ? `/${instance}/s/${statusID}` : `/s/${statusID}`;\n const isMiddle = i > 0 && i < fItems.length - 1;\n const isSpoiler = item.sensitive && !!item.spoilerText;\n const showCompact =\n (!_differentAuthor && isSpoiler && i > 0) ||\n (manyItems &&\n isMiddle &&\n (type === 'thread' ||\n (type === 'conversation' &&\n !_differentAuthor &&\n !fItems[i - 1]._differentAuthor &&\n !fItems[i + 1]._differentAuthor)));\n const isStart = i === 0;\n const isEnd = i === fItems.length - 1;\n return (\n <li\n key={`timeline-${statusID}`}\n class={`timeline-item-container timeline-item-container-type-${type} timeline-item-container-${\n isStart ? 'start' : isEnd ? 'end' : 'middle'\n } ${_differentAuthor ? 'timeline-item-diff-author' : ''}`}\n >\n <Link class=\"status-link timeline-item\" to={url}>\n {showCompact ? (\n <TimelineStatusCompact\n status={item}\n instance={instance}\n filterContext={filterContext}\n />\n ) : useItemID ? (\n <Status\n statusID={statusID}\n instance={instance}\n enableCommentHint={isEnd}\n showFollowedTags={showFollowedTags}\n // allowFilters={allowFilters}\n />\n ) : (\n <Status\n status={item}\n instance={instance}\n enableCommentHint={isEnd}\n showFollowedTags={showFollowedTags}\n // allowFilters={allowFilters}\n />\n )}\n </Link>\n </li>\n );\n });\n }\n\n const itemKey = `timeline-${statusID + _pinned}`;\n\n if (view === 'media') {\n return useItemID ? (\n <MediaPost\n class=\"timeline-item\"\n parent=\"li\"\n key={itemKey}\n statusID={statusID}\n instance={instance}\n // allowFilters={allowFilters}\n />\n ) : (\n <MediaPost\n class=\"timeline-item\"\n parent=\"li\"\n key={itemKey}\n status={status}\n instance={instance}\n // allowFilters={allowFilters}\n />\n );\n }\n\n return (\n <li key={itemKey}>\n <Link class=\"status-link timeline-item\" to={url}>\n {useItemID ? (\n <Status\n statusID={statusID}\n instance={instance}\n enableCommentHint\n showFollowedTags={showFollowedTags}\n showReplyParent={showReplyParent}\n // allowFilters={allowFilters}\n mediaFirst={mediaFirst}\n />\n ) : (\n <Status\n status={status}\n instance={instance}\n enableCommentHint\n showFollowedTags={showFollowedTags}\n showReplyParent={showReplyParent}\n // allowFilters={allowFilters}\n mediaFirst={mediaFirst}\n />\n )}\n </Link>\n </li>\n );\n },\n (oldProps, newProps) => {\n const oldID = (oldProps.status?.id || '').toString();\n const newID = (newProps.status?.id || '').toString();\n return (\n oldID === newID &&\n oldProps.instance === newProps.instance &&\n oldProps.view === newProps.view\n );\n },\n);\n\nfunction StatusCarousel({ title, class: className, children }) {\n const carouselRef = useRef();\n // const { reachStart, reachEnd, init } = useScroll({\n // scrollableRef: carouselRef,\n // direction: 'horizontal',\n // });\n const startButtonRef = useRef();\n const endButtonRef = useRef();\n // useScrollFn(\n // {\n // scrollableRef: carouselRef,\n // direction: 'horizontal',\n // init: true,\n // },\n // ({ reachStart, reachEnd }) => {\n // if (startButtonRef.current) startButtonRef.current.disabled = reachStart;\n // if (endButtonRef.current) endButtonRef.current.disabled = reachEnd;\n // },\n // [],\n // );\n // useEffect(() => {\n // init?.();\n // }, []);\n\n const [render, setRender] = useState(false);\n useEffect(() => {\n setTimeout(() => {\n setRender(true);\n }, 1);\n }, []);\n\n return (\n <div class={`status-carousel ${className}`}>\n <header>\n <h3>{title}</h3>\n <span>\n <button\n ref={startButtonRef}\n type=\"button\"\n class=\"small plain2\"\n // disabled={reachStart}\n onClick={() => {\n const left =\n Math.min(320, carouselRef.current?.offsetWidth) *\n (isRTL() ? 1 : -1);\n carouselRef.current?.scrollBy({\n left,\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"chevron-left\" alt={t`Previous`} />\n </button>{' '}\n <button\n ref={endButtonRef}\n type=\"button\"\n class=\"small plain2\"\n // disabled={reachEnd}\n onClick={() => {\n const left =\n Math.min(320, carouselRef.current?.offsetWidth) *\n (isRTL() ? -1 : 1);\n carouselRef.current?.scrollBy({\n left,\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"chevron-right\" alt={t`Next`} />\n </button>\n </span>\n </header>\n <ul ref={carouselRef}>\n <InView\n class=\"status-carousel-beacon\"\n onChange={(inView) => {\n if (startButtonRef.current)\n startButtonRef.current.disabled = inView;\n }}\n />\n {children[0]}\n {render && children.slice(1)}\n <InView\n class=\"status-carousel-beacon\"\n onChange={(inView) => {\n if (endButtonRef.current) endButtonRef.current.disabled = inView;\n }}\n />\n </ul>\n </div>\n );\n}\n\nfunction TimelineStatusCompact({ status, instance, filterContext }) {\n const snapStates = useSnapshot(states);\n const { id, visibility, language } = status;\n const statusPeekText = statusPeek(status);\n const sKey = statusKey(id, instance);\n const filterInfo = isFiltered(status.filtered, filterContext);\n return (\n <article\n class={`status compact-thread ${\n visibility === 'direct' ? 'visibility-direct' : ''\n }`}\n tabindex=\"-1\"\n >\n {!!snapStates.statusThreadNumber[sKey] ? (\n <div class=\"status-thread-badge\">\n <Icon icon=\"thread\" size=\"s\" alt={t`Thread`} />\n {snapStates.statusThreadNumber[sKey]\n ? ` ${snapStates.statusThreadNumber[sKey]}/X`\n : ''}\n </div>\n ) : (\n <div class=\"status-thread-badge\">\n <Icon icon=\"thread\" size=\"s\" alt={t`Thread`} />\n </div>\n )}\n <div\n class=\"content-compact\"\n title={statusPeekText}\n lang={language}\n dir=\"auto\"\n >\n {!!filterInfo ? (\n <b\n class=\"status-filtered-badge badge-meta horizontal\"\n title={filterInfo?.titlesStr || ''}\n >\n {filterInfo?.titlesStr ? (\n <Trans>\n <span>Filtered</span>: <span>{filterInfo.titlesStr}</span>\n </Trans>\n ) : (\n <span>\n <Trans>Filtered</Trans>\n </span>\n )}\n </b>\n ) : (\n <>\n {statusPeekText}\n {status.sensitive && status.spoilerText && (\n <>\n {' '}\n <span class=\"spoiler-badge\">\n <Icon icon=\"eye-close\" size=\"s\" alt={t`Content warning`} />\n </span>\n </>\n )}\n </>\n )}\n </div>\n </article>\n );\n}\n\nfunction inBackground() {\n return !!document.querySelector('.deck-backdrop, #modal-container > *');\n}\n\nexport default Timeline;\n","import { t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { MenuItem } from '@szhsin/react-menu';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useParams, useSearchParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport AccountInfo from '../components/account-info';\nimport EmojiText from '../components/emoji-text';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Menu2 from '../components/menu2';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport pmem from '../utils/pmem';\nimport showToast from '../utils/show-toast';\nimport states, { saveStatus } from '../utils/states';\nimport { isMediaFirstInstance } from '../utils/store-utils';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\nconst MIN_YEAR = 1983;\nconst MIN_YEAR_MONTH = `${MIN_YEAR}-01`; // Birth of the Internet\n\nconst supportsInputMonth = (() => {\n try {\n const input = document.createElement('input');\n input.setAttribute('type', 'month');\n return input.type === 'month';\n } catch (e) {\n return false;\n }\n})();\n\nasync function _isSearchEnabled(instance) {\n const { masto } = api({ instance });\n const results = await masto.v2.search.fetch({\n q: 'from:me',\n type: 'statuses',\n limit: 1,\n });\n return !!results?.statuses?.length;\n}\nconst isSearchEnabled = pmem(_isSearchEnabled);\n\nfunction AccountStatuses() {\n const snapStates = useSnapshot(states);\n const { id, ...params } = useParams();\n const [searchParams, setSearchParams] = useSearchParams();\n const month = searchParams.get('month');\n const excludeReplies = !searchParams.get('replies');\n const excludeBoosts = !!searchParams.get('boosts');\n const tagged = searchParams.get('tagged');\n const media = !!searchParams.get('media');\n const { masto, instance, authenticated } = api({ instance: params.instance });\n const { masto: currentMasto, instance: currentInstance } = api();\n const accountStatusesIterator = useRef();\n\n const allSearchParams = [month, excludeReplies, excludeBoosts, tagged, media];\n const [account, setAccount] = useState();\n const searchOffsetRef = useRef(0);\n useEffect(() => {\n searchOffsetRef.current = 0;\n }, allSearchParams);\n\n const mediaFirst = useMemo(() => isMediaFirstInstance(), []);\n\n const sameCurrentInstance = useMemo(\n () => instance === currentInstance,\n [instance, currentInstance],\n );\n const [searchEnabled, setSearchEnabled] = useState(false);\n useEffect(() => {\n // Only enable for current logged-in instance\n // Most remote instances don't allow unauthenticated searches\n if (!sameCurrentInstance) return;\n if (!account?.acct) return;\n (async () => {\n const enabled = await isSearchEnabled(instance);\n console.log({ enabled });\n setSearchEnabled(enabled);\n })();\n }, [instance, sameCurrentInstance, account?.acct]);\n\n async function fetchAccountStatuses(firstLoad) {\n const isValidMonth = /^\\d{4}-[01]\\d$/.test(month);\n const isValidYear = month?.split?.('-')?.[0] >= MIN_YEAR;\n if (isValidMonth && isValidYear) {\n if (!account) {\n return {\n value: [],\n done: true,\n };\n }\n const [_year, _month] = month.split('-');\n const monthIndex = parseInt(_month, 10) - 1;\n // YYYY-MM (no day)\n // Search options:\n // - from:account\n // - after:YYYY-MM-DD (non-inclusive)\n // - before:YYYY-MM-DD (non-inclusive)\n\n // Last day of previous month\n const after = new Date(_year, monthIndex, 0);\n const afterStr = `${after.getFullYear()}-${(after.getMonth() + 1)\n .toString()\n .padStart(2, '0')}-${after.getDate().toString().padStart(2, '0')}`;\n // First day of next month\n const before = new Date(_year, monthIndex + 1, 1);\n const beforeStr = `${before.getFullYear()}-${(before.getMonth() + 1)\n .toString()\n .padStart(2, '0')}-${before.getDate().toString().padStart(2, '0')}`;\n console.log({\n month,\n _year,\n _month,\n monthIndex,\n after,\n before,\n afterStr,\n beforeStr,\n });\n\n let limit;\n if (firstLoad) {\n limit = LIMIT + 1;\n searchOffsetRef.current = 0;\n } else {\n limit = LIMIT + searchOffsetRef.current + 1;\n searchOffsetRef.current += LIMIT;\n }\n\n const searchResults = await masto.v2.search.fetch({\n q: `from:${account.acct} after:${afterStr} before:${beforeStr}`,\n type: 'statuses',\n limit,\n offset: searchOffsetRef.current,\n });\n if (searchResults?.statuses?.length) {\n const value = searchResults.statuses.slice(0, LIMIT);\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n const done = searchResults.statuses.length <= LIMIT;\n return { value, done };\n } else {\n return { value: [], done: true };\n }\n }\n\n let results = [];\n if (firstLoad) {\n const { value } = await masto.v1.accounts\n .$select(id)\n .statuses.list({\n pinned: true,\n })\n .next();\n if (value?.length && !tagged && !media) {\n const pinnedStatuses = value.map((status) => {\n saveStatus(status, instance);\n return {\n ...status,\n _pinned: true,\n };\n });\n if (pinnedStatuses.length >= 3) {\n const pinnedStatusesIds = pinnedStatuses.map((status) => status.id);\n results.push({\n id: pinnedStatusesIds,\n items: pinnedStatuses,\n type: 'pinned',\n });\n } else {\n results.push(...pinnedStatuses);\n }\n }\n }\n if (firstLoad || !accountStatusesIterator.current) {\n accountStatusesIterator.current = masto.v1.accounts\n .$select(id)\n .statuses.list({\n limit: LIMIT,\n exclude_replies: excludeReplies,\n exclude_reblogs: excludeBoosts,\n only_media: media || undefined,\n tagged,\n });\n }\n const { value, done } = await accountStatusesIterator.current.next();\n if (value?.length) {\n // Check if value is same as pinned post (results)\n // If the index for every post is the same, means API might not support pinned posts\n if (results.length) {\n let pinnedStatusesIds = [];\n if (results[0]?.type === 'pinned') {\n pinnedStatusesIds = results[0].id;\n } else {\n pinnedStatusesIds = results\n .filter((status) => status._pinned)\n .map((status) => status.id);\n }\n const containsAllPinned = pinnedStatusesIds.every((postId) =>\n value.some((status) => status.id === postId),\n );\n if (containsAllPinned) {\n // Remove pinned posts\n results = [];\n }\n }\n\n results.push(...value);\n\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n }\n return {\n value: results,\n done,\n };\n }\n\n const [featuredTags, setFeaturedTags] = useState([]);\n const { i18n } = useLingui();\n let title = t`Account posts`;\n if (account?.acct) {\n const acctDisplay = (/@/.test(account.acct) ? '' : '@') + account.acct;\n const accountDisplay = account?.displayName\n ? `${account.displayName} (${acctDisplay})`\n : `${acctDisplay}`;\n if (!excludeReplies) {\n title = t`${accountDisplay} (+ Replies)`;\n } else if (excludeBoosts) {\n title = t`${accountDisplay} (- Boosts)`;\n } else if (tagged) {\n title = t`${accountDisplay} (#${tagged})`;\n } else if (media) {\n title = t`${accountDisplay} (Media)`;\n } else if (month) {\n const monthYear = new Date(month).toLocaleString(i18n.locale, {\n month: 'long',\n year: 'numeric',\n });\n title = t`${accountDisplay} (${monthYear})`;\n } else {\n title = accountDisplay;\n }\n }\n useTitle(title, '/:instance?/a/:id');\n\n const fetchAccountPromiseRef = useRef();\n const fetchAccount = useCallback(() => {\n const fetchPromise =\n fetchAccountPromiseRef.current || masto.v1.accounts.$select(id).fetch();\n fetchAccountPromiseRef.current = fetchPromise;\n return fetchPromise;\n }, [id, masto]);\n\n useEffect(() => {\n (async () => {\n try {\n const acc = await fetchAccount();\n console.log(acc);\n setAccount(acc);\n } catch (e) {\n console.error(e);\n }\n // No need, because the whole filter bar is hidden\n // TODO: Revisit this\n if (!mediaFirst) {\n try {\n const featuredTags = await masto.v1.accounts\n .$select(id)\n .featuredTags.list();\n console.log({ featuredTags });\n setFeaturedTags(featuredTags);\n } catch (e) {\n console.error(e);\n }\n }\n })();\n }, [id, mediaFirst]);\n\n const { displayName, acct, emojis } = account || {};\n\n const filterBarRef = useRef();\n const TimelineStart = useMemo(() => {\n const filtered =\n !excludeReplies || excludeBoosts || tagged || media || !!month;\n const cachedAccount = snapStates.accounts[`${id}@${instance}`];\n\n return (\n <>\n <AccountInfo\n instance={instance}\n account={cachedAccount || id}\n fetchAccount={fetchAccount}\n authenticated={authenticated}\n standalone\n />\n {!mediaFirst && (\n <div\n class=\"filter-bar\"\n ref={filterBarRef}\n style={{\n position: 'relative',\n }}\n >\n {filtered ? (\n <Link\n to={`/${instance}/a/${id}`}\n class=\"insignificant filter-clear\"\n title={t`Clear filters`}\n key=\"clear-filters\"\n >\n <Icon icon=\"x\" size=\"l\" alt={t`Clear`} />\n </Link>\n ) : (\n <Icon\n icon=\"filter\"\n class=\"insignificant\"\n size=\"l\"\n alt={t`Filters`}\n />\n )}\n <Link\n to={`/${instance}/a/${id}${excludeReplies ? '?replies=1' : ''}`}\n onClick={() => {\n if (excludeReplies) {\n showToast(t`Showing post with replies`);\n }\n }}\n class={excludeReplies ? '' : 'is-active'}\n >\n <Trans>+ Replies</Trans>\n </Link>\n <Link\n to={`/${instance}/a/${id}${excludeBoosts ? '' : '?boosts=0'}`}\n onClick={() => {\n if (!excludeBoosts) {\n showToast(t`Showing posts without boosts`);\n }\n }}\n class={!excludeBoosts ? '' : 'is-active'}\n >\n <Trans>- Boosts</Trans>\n </Link>\n <Link\n to={`/${instance}/a/${id}${media ? '' : '?media=1'}`}\n onClick={() => {\n if (!media) {\n showToast(t`Showing posts with media`);\n }\n }}\n class={media ? 'is-active' : ''}\n >\n <Trans>Media</Trans>\n </Link>\n {featuredTags.map((tag) => (\n <Link\n key={tag.id}\n to={`/${instance}/a/${id}${\n tagged === tag.name\n ? ''\n : `?tagged=${encodeURIComponent(tag.name)}`\n }`}\n onClick={() => {\n if (tagged !== tag.name) {\n showToast(t`Showing posts tagged with #${tag.name}`);\n }\n }}\n class={tagged === tag.name ? 'is-active' : ''}\n >\n <span>\n <span class=\"more-insignificant\">#</span>\n {tag.name}\n </span>\n {\n // The count differs based on instance 😅\n }\n {/* <span class=\"filter-count\">{tag.statusesCount}</span> */}\n </Link>\n ))}\n {searchEnabled &&\n (supportsInputMonth ? (\n <label class={`filter-field ${month ? 'is-active' : ''}`}>\n <Icon icon=\"month\" size=\"l\" />\n <input\n type=\"month\"\n disabled={!account?.acct}\n value={month || ''}\n min={MIN_YEAR_MONTH}\n max={new Date().toISOString().slice(0, 7)}\n onInput={(e) => {\n const { value, validity } = e.currentTarget;\n if (!validity.valid) return;\n setSearchParams(\n value\n ? {\n month: value,\n }\n : {},\n );\n const [year, month] = value.split('-');\n const monthIndex = parseInt(month, 10) - 1;\n const date = new Date(year, monthIndex);\n showToast(\n t`Showing posts in ${date.toLocaleString(i18n.locale, {\n month: 'long',\n year: 'numeric',\n })}`,\n );\n }}\n />\n </label>\n ) : (\n // Fallback to <select> for month and <input type=\"number\"> for year\n <MonthPicker\n class={`filter-field ${month ? 'is-active' : ''}`}\n disabled={!account?.acct}\n value={month || ''}\n min={MIN_YEAR_MONTH}\n max={new Date().toISOString().slice(0, 7)}\n onInput={(e) => {\n const { value, validity } = e;\n if (!validity.valid) return;\n setSearchParams(\n value\n ? {\n month: value,\n }\n : {},\n );\n }}\n />\n ))}\n </div>\n )}\n </>\n );\n }, [\n id,\n instance,\n authenticated,\n featuredTags,\n fetchAccount,\n searchEnabled,\n ...allSearchParams,\n ]);\n\n useEffect(() => {\n // Focus on .is-active\n const active = filterBarRef.current?.querySelector('.is-active');\n if (active) {\n console.log('active', active, active.offsetLeft);\n filterBarRef.current.scrollTo({\n behavior: 'smooth',\n left:\n active.offsetLeft -\n (filterBarRef.current.offsetWidth - active.offsetWidth) / 2,\n });\n }\n }, [featuredTags, searchEnabled, ...allSearchParams]);\n\n const accountInstance = useMemo(() => {\n if (!account?.url) return null;\n const domain = URL.parse(account.url).hostname;\n return domain;\n }, [account]);\n const sameInstance = instance === accountInstance;\n const allowSwitch = !!account && !sameInstance;\n\n return (\n <Timeline\n key={id}\n title={`${account?.acct ? '@' + account.acct : t`Posts`}`}\n titleComponent={\n <h1\n class=\"header-double-lines header-account\"\n // onClick={() => {\n // states.showAccount = {\n // account,\n // instance,\n // };\n // }}\n >\n <b>\n <EmojiText text={displayName} emojis={emojis} />\n </b>\n <div>\n <span class=\"bidi-isolate\">@{acct}</span>\n </div>\n </h1>\n }\n id=\"account-statuses\"\n instance={instance}\n emptyText={t`Nothing to see here yet.`}\n errorText={t`Unable to load posts`}\n fetchItems={fetchAccountStatuses}\n useItemID\n view={media || mediaFirst ? 'media' : undefined}\n boostsCarousel={snapStates.settings.boostsCarousel}\n timelineStart={TimelineStart}\n refresh={[\n excludeReplies,\n excludeBoosts,\n tagged,\n media,\n month + account?.acct,\n ].toString()}\n headerEnd={\n <Menu2\n portal\n // setDownOverflow\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n <MenuItem\n disabled={!allowSwitch}\n onClick={() => {\n (async () => {\n try {\n const { masto } = api({\n instance: accountInstance,\n });\n const acc = await masto.v1.accounts.lookup({\n acct: account.acct,\n });\n const { id } = acc;\n location.hash = `/${accountInstance}/a/${id}`;\n } catch (e) {\n console.error(e);\n alert(t`Unable to fetch account info`);\n }\n })();\n }}\n >\n <Icon icon=\"transfer\" />{' '}\n <small class=\"menu-double-lines\">\n <Trans>\n Switch to account's instance{' '}\n {accountInstance ? (\n <>\n {' '}\n (<b>{punycode.toUnicode(accountInstance)}</b>)\n </>\n ) : null}\n </Trans>\n </small>\n </MenuItem>\n {!sameCurrentInstance && (\n <MenuItem\n onClick={() => {\n (async () => {\n try {\n const acc = await currentMasto.v1.accounts.lookup({\n acct: account.acct + '@' + instance,\n });\n const { id } = acc;\n location.hash = `/${currentInstance}/a/${id}`;\n } catch (e) {\n console.error(e);\n alert(t`Unable to fetch account info`);\n }\n })();\n }}\n >\n <Icon icon=\"transfer\" />{' '}\n <small class=\"menu-double-lines\">\n <Trans>\n Switch to my instance (<b>{currentInstance}</b>)\n </Trans>\n </small>\n </MenuItem>\n )}\n </Menu2>\n }\n />\n );\n}\n\nfunction MonthPicker(props) {\n const { i18n } = useLingui();\n const {\n class: className,\n disabled,\n value,\n min,\n max,\n onInput = () => {},\n } = props;\n const [_year, _month] = value?.split('-') || [];\n const monthFieldRef = useRef();\n const yearFieldRef = useRef();\n\n const checkValidity = (month, year) => {\n const [minYear, minMonth] = min?.split('-') || [];\n const [maxYear, maxMonth] = max?.split('-') || [];\n if (year < minYear) return false;\n if (year > maxYear) return false;\n if (year === minYear && month < minMonth) return false;\n if (year === maxYear && month > maxMonth) return false;\n return true;\n };\n\n return (\n <div class={className}>\n <Icon icon=\"month\" size=\"l\" />\n <select\n ref={monthFieldRef}\n disabled={disabled}\n value={_month || ''}\n onInput={(e) => {\n const { value: month } = e.currentTarget;\n const year = yearFieldRef.current.value;\n if (!checkValidity(month, year))\n return {\n value: '',\n validity: {\n valid: false,\n },\n };\n onInput({\n value: month ? `${year}-${month}` : '',\n validity: {\n valid: true,\n },\n });\n }}\n >\n <option value=\"\">\n <Trans>Month</Trans>\n </option>\n <option disabled>-----</option>\n {Array.from({ length: 12 }, (_, i) => (\n <option\n value={\n // Month is 1-indexed\n (i + 1).toString().padStart(2, '0')\n }\n key={i}\n >\n {new Date(0, i).toLocaleString(i18n.locale, {\n month: 'long',\n })}\n </option>\n ))}\n </select>{' '}\n <input\n ref={yearFieldRef}\n type=\"number\"\n disabled={disabled}\n value={_year || new Date().getFullYear()}\n min={min?.slice(0, 4) || MIN_YEAR}\n max={max?.slice(0, 4) || new Date().getFullYear()}\n onInput={(e) => {\n const { value: year, validity } = e.currentTarget;\n const month = monthFieldRef.current.value;\n if (!validity.valid || !checkValidity(month, year))\n return {\n value: '',\n validity: {\n valid: false,\n },\n };\n onInput({\n value: year ? `${year}-${month}` : '',\n validity: {\n valid: true,\n },\n });\n }}\n style={{\n width: '4.5em',\n }}\n />\n </div>\n );\n}\n\nexport default AccountStatuses;\n","import { t, Trans } from '@lingui/macro';\n\nimport './annual-report.css';\n\nimport { useEffect, useState } from 'preact/hooks';\nimport { useParams } from 'react-router-dom';\n\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport NameText from '../components/name-text';\nimport Status from '../components/status';\nimport { api } from '../utils/api';\nimport useTitle from '../utils/useTitle';\n\nexport default function AnnualReport() {\n const params = useParams();\n const { year } = params;\n useTitle(year ? `Annual Report: ${year}` : 'Annual Report');\n const { masto, instance } = api();\n const [results, setResults] = useState(null);\n const [uiState, setUIState] = useState('default');\n\n useEffect(() => {\n if (year) {\n (async () => {\n setUIState('loading');\n const results = await masto.v1.annualReports.$select(year).fetch();\n console.log('REPORT', results);\n setResults(results);\n setUIState('default');\n })();\n }\n }, [year]);\n\n const { accounts, annualReports, statuses } = results || {};\n const report = annualReports?.find((report) => report.year == year)?.data;\n\n const datePlaceholder = new Date();\n\n return (\n <div id=\"annual-report-page\" class=\"deck-container\" tabIndex=\"-1\">\n <div class=\"report\">\n <h1>{year} #Wrapstodon</h1>\n {uiState === 'loading' && (\n <p>\n <Loader abrupt /> <Trans>Loading…</Trans>\n </p>\n )}\n {!!report && (\n <dl>\n {Object.entries(report).map(([key, value]) => (\n <>\n <dt>{key}</dt>\n <dd class={`report-${key}`}>\n {Array.isArray(value) ? (\n <table>\n <thead>\n <tr>\n {Object.entries(value[0]).map(([key, value]) => (\n <th\n class={\n key !== 'month' && typeof value === 'number'\n ? 'number'\n : ''\n }\n >\n {key}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {value.map((item) => (\n <tr>\n {Object.entries(item).map(([k, value]) => (\n <td\n class={\n k !== 'month' && typeof value === 'number'\n ? 'number'\n : ''\n }\n >\n {value &&\n /(accountId)/i.test(k) &&\n /^(mostRebloggedAccounts|commonlyInteractedWithAccounts)$/i.test(\n key,\n ) ? (\n <NameText\n account={accounts?.find(\n (a) => a.id === value,\n )}\n showAvatar\n />\n ) : k === 'month' ? (\n datePlaceholder.setMonth(value - 1) &&\n datePlaceholder.toLocaleString(undefined, {\n month: 'long',\n })\n ) : typeof value === 'number' ? (\n value.toLocaleString()\n ) : (\n value\n )}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n ) : typeof value === 'object' ? (\n /^(topStatuses)$/i.test(key) ? (\n <dl>\n {Object.entries(value).map(([k, value]) => (\n <>\n <dt>{k}</dt>\n <dd>\n {value && (\n <Link to={`/${instance}/s/${value}`}>\n <Status\n status={statuses?.find(\n (s) => s.id === value,\n )}\n size=\"s\"\n readOnly\n />\n </Link>\n )}\n </dd>\n </>\n ))}\n </dl>\n ) : (\n <table>\n <tbody>\n {Object.entries(value).map(([k, value]) => (\n <tr>\n <th>{k}</th>\n <td\n class={\n typeof value === 'number' ? 'number' : ''\n }\n >\n {value}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n )\n ) : typeof value === 'string' ? (\n value\n ) : (\n // Last resort\n JSON.stringify(value, null, 2)\n )}\n </dd>\n </>\n ))}\n </dl>\n )}\n </div>\n <hr />\n <p style={{ textAlign: 'center' }}>\n <Link to=\"/\">\n <Trans>Go home</Trans>\n </Link>\n </p>\n </div>\n );\n}\n","import { t, Trans } from '@lingui/macro';\nimport { useRef } from 'preact/hooks';\n\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\nfunction Bookmarks() {\n useTitle(t`Bookmarks`, '/bookmarks');\n const { masto, instance } = api();\n const bookmarksIterator = useRef();\n async function fetchBookmarks(firstLoad) {\n if (firstLoad || !bookmarksIterator.current) {\n bookmarksIterator.current = masto.v1.bookmarks.list({ limit: LIMIT });\n }\n return await bookmarksIterator.current.next();\n }\n\n return (\n <Timeline\n title={t`Bookmarks`}\n id=\"bookmarks\"\n emptyText={t`No bookmarks yet. Go bookmark something!`}\n errorText={t`Unable to load bookmarks.`}\n instance={instance}\n fetchItems={fetchBookmarks}\n />\n );\n}\n\nexport default Bookmarks;\n","export default \"__VITE_ASSET__S_9SYp01__\"","import '../components/links-bar.css';\nimport './catchup.css';\n\nimport autoAnimate from '@formkit/auto-animate';\nimport { msg, Plural, select, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { getBlurHashAverageColor } from 'fast-blurhash';\nimport { Fragment } from 'preact';\nimport { memo } from 'preact/compat';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { useSearchParams } from 'react-router-dom';\nimport { uid } from 'uid/single';\n\nimport catchupUrl from '../assets/features/catch-up.png';\n\nimport Avatar from '../components/avatar';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport Modal from '../components/modal';\nimport NameText from '../components/name-text';\nimport NavMenu from '../components/nav-menu';\nimport RelativeTime from '../components/relative-time';\nimport { api } from '../utils/api';\nimport { oklab2rgb, rgb2oklab } from '../utils/color-utils';\nimport db from '../utils/db';\nimport emojifyText from '../utils/emojify-text';\nimport { isFiltered } from '../utils/filters';\nimport htmlContentLength from '../utils/html-content-length';\nimport mem from '../utils/mem';\nimport niceDateTime from '../utils/nice-date-time';\nimport shortenNumber from '../utils/shorten-number';\nimport showToast from '../utils/show-toast';\nimport states, { statusKey } from '../utils/states';\nimport statusPeek from '../utils/status-peek';\nimport store from '../utils/store';\nimport { getCurrentAccountID, getCurrentAccountNS } from '../utils/store-utils';\nimport supports from '../utils/supports';\nimport { assignFollowedTags } from '../utils/timeline-utils';\nimport useTitle from '../utils/useTitle';\n\nconst FILTER_CONTEXT = 'home';\n\nconst RANGES = [\n { label: msg`last 1 hour`, value: 1 },\n { label: msg`last 2 hours`, value: 2 },\n { label: msg`last 3 hours`, value: 3 },\n { label: msg`last 4 hours`, value: 4 },\n { label: msg`last 5 hours`, value: 5 },\n { label: msg`last 6 hours`, value: 6 },\n { label: msg`last 7 hours`, value: 7 },\n { label: msg`last 8 hours`, value: 8 },\n { label: msg`last 9 hours`, value: 9 },\n { label: msg`last 10 hours`, value: 10 },\n { label: msg`last 11 hours`, value: 11 },\n { label: msg`last 12 hours`, value: 12 },\n { label: msg`beyond 12 hours`, value: 13 },\n];\n\nconst FILTER_KEYS = {\n original: msg`Original`,\n replies: msg`Replies`,\n boosts: msg`Boosts`,\n followedTags: msg`Followed tags`,\n groups: msg`Groups`,\n filtered: msg`Filtered`,\n};\nconst FILTER_SORTS = [\n 'createdAt',\n 'repliesCount',\n 'favouritesCount',\n 'reblogsCount',\n 'density',\n];\nconst FILTER_GROUPS = [null, 'account'];\n\nconst DTF = mem(\n (locale) =>\n new Intl.DateTimeFormat(locale || undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n }),\n);\n\nfunction Catchup() {\n const { i18n, _ } = useLingui();\n const dtf = DTF(i18n.locale);\n\n useTitle(`Catch-up`, '/catchup');\n const { masto, instance } = api();\n const [searchParams, setSearchParams] = useSearchParams();\n const id = searchParams.get('id');\n const [uiState, setUIState] = useState('start');\n const [showTopLinks, setShowTopLinks] = useState(false);\n\n const currentAccount = useMemo(() => {\n return getCurrentAccountID();\n }, []);\n const isSelf = (accountID) => accountID === currentAccount;\n\n const supportsPixelfed = supports('@pixelfed/home-include-reblogs');\n\n async function fetchHome({ maxCreatedAt }) {\n const maxCreatedAtDate = maxCreatedAt ? new Date(maxCreatedAt) : null;\n console.debug('fetchHome', maxCreatedAtDate);\n const allResults = [];\n const homeIterator = masto.v1.timelines.home.list({ limit: 40 });\n mainloop: while (true) {\n try {\n if (supportsPixelfed && homeIterator.nextParams) {\n if (typeof homeIterator.nextParams === 'string') {\n homeIterator.nextParams += '&include_reblogs=true';\n } else {\n homeIterator.nextParams.include_reblogs = true;\n }\n }\n const results = await homeIterator.next();\n const { value } = results;\n if (value?.length) {\n // This ignores maxCreatedAt filter, but it's ok for now\n await assignFollowedTags(value, instance);\n let addedResults = false;\n for (let i = 0; i < value.length; i++) {\n const item = value[i];\n const createdAtDate = new Date(item.createdAt);\n if (!maxCreatedAtDate || createdAtDate >= maxCreatedAtDate) {\n // Filtered\n const selfPost = isSelf(\n item.reblog?.account?.id || item.account.id,\n );\n const filterInfo =\n !selfPost &&\n isFiltered(\n item.reblog?.filtered || item.filtered,\n FILTER_CONTEXT,\n );\n if (filterInfo?.action === 'hide') continue;\n item._filtered = filterInfo;\n\n // Followed tags\n const sKey = statusKey(item.id, instance);\n item._followedTags = states.statusFollowedTags[sKey]\n ? [...states.statusFollowedTags[sKey]]\n : [];\n\n allResults.push(item);\n addedResults = true;\n } else {\n // Don't immediately stop, still add the other items that might still be within range\n // break mainloop;\n }\n // Only stop when ALL items are outside of range\n if (!addedResults) {\n break mainloop;\n }\n }\n } else {\n break mainloop;\n }\n // Pause 1s\n await new Promise((resolve) => setTimeout(resolve, 1000));\n } catch (e) {\n console.error(e);\n break mainloop;\n }\n }\n\n // Post-process all results\n // 1. Threadify - tag 1st-post in a thread\n allResults.forEach((status) => {\n if (status?.inReplyToId) {\n const replyToStatus = allResults.find(\n (s) => s.id === status.inReplyToId,\n );\n if (replyToStatus && !replyToStatus.inReplyToId) {\n replyToStatus._thread = true;\n }\n }\n });\n\n return allResults;\n }\n\n const [posts, setPosts] = useState([]);\n const catchupRangeRef = useRef();\n const catchupLastRef = useRef();\n const NS = useMemo(() => getCurrentAccountNS(), []);\n const handleCatchupClick = useCallback(async ({ duration } = {}) => {\n const now = Date.now();\n const maxCreatedAt = duration ? now - duration : null;\n setUIState('loading');\n const results = await fetchHome({ maxCreatedAt });\n // Namespaced by account ID\n // Possible conflict if ID matches between different accounts from different instances\n const catchupID = `${NS}-${uid()}`;\n try {\n await db.catchup.set(catchupID, {\n id: catchupID,\n posts: results,\n count: results.length,\n startAt: maxCreatedAt,\n endAt: now,\n });\n setSearchParams({ id: catchupID });\n } catch (e) {\n console.error(e, results);\n }\n }, []);\n\n useEffect(() => {\n if (id) {\n (async () => {\n const catchup = await db.catchup.get(id);\n if (catchup) {\n catchup.posts.sort((a, b) => (a.createdAt > b.createdAt ? 1 : -1));\n setPosts(catchup.posts);\n setUIState('results');\n }\n })();\n } else if (uiState === 'results') {\n setPosts([]);\n setUIState('start');\n }\n }, [id]);\n\n const [reloadCatchupsCount, reloadCatchups] = useReducer((c) => c + 1, 0);\n const [lastCatchupEndAt, setLastCatchupEndAt] = useState(null);\n const [prevCatchups, setPrevCatchups] = useState([]);\n useEffect(() => {\n (async () => {\n try {\n const catchups = await db.catchup.keys();\n if (catchups.length) {\n const ns = getCurrentAccountNS();\n const ownKeys = catchups.filter((key) => key.startsWith(`${ns}-`));\n if (ownKeys.length) {\n let ownCatchups = await db.catchup.getMany(ownKeys);\n ownCatchups.sort((a, b) => b.endAt - a.endAt);\n\n // Split to 1st 3 last catchups, and the rest\n let lastCatchups = ownCatchups.slice(0, 3);\n let restCatchups = ownCatchups.slice(3);\n\n const trimmedCatchups = lastCatchups.map((c) => {\n const { id, count, startAt, endAt } = c;\n return {\n id,\n count,\n startAt,\n endAt,\n };\n });\n setPrevCatchups(trimmedCatchups);\n setLastCatchupEndAt(lastCatchups[0].endAt);\n\n // GC time\n ownCatchups = null;\n lastCatchups = null;\n\n queueMicrotask(() => {\n if (restCatchups.length) {\n // delete them\n db.catchup\n .delMany(restCatchups.map((c) => c.id))\n .then(() => {\n // GC time\n restCatchups = null;\n })\n .catch((e) => {\n console.error(e);\n });\n }\n });\n\n return;\n }\n }\n } catch (e) {\n console.error(e);\n }\n setPrevCatchups([]);\n })();\n }, [reloadCatchupsCount]);\n useEffect(() => {\n if (uiState === 'start') {\n reloadCatchups();\n }\n }, [uiState === 'start']);\n\n const [filterCounts, links] = useMemo(() => {\n let filtered = 0,\n groups = 0,\n boosts = 0,\n replies = 0,\n followedTags = 0,\n original = 0;\n const links = {};\n for (const post of posts) {\n if (post._filtered) {\n filtered++;\n post.__FILTER = 'filtered';\n } else if (post.group) {\n groups++;\n post.__FILTER = 'groups';\n } else if (post.reblog) {\n boosts++;\n post.__FILTER = 'boosts';\n } else if (post._followedTags?.length) {\n followedTags++;\n post.__FILTER = 'followedTags';\n } else if (\n post.inReplyToId &&\n post.inReplyToAccountId !== post.account?.id\n ) {\n replies++;\n post.__FILTER = 'replies';\n } else {\n original++;\n post.__FILTER = 'original';\n }\n\n const thePost = post.reblog || post;\n if (\n post.__FILTER !== 'filtered' &&\n thePost.card?.url &&\n thePost.card?.image &&\n thePost.card?.type === 'link'\n ) {\n const { card, favouritesCount, reblogsCount } = thePost;\n let { url } = card;\n url = url.replace(/\\/$/, '');\n if (!links[url]) {\n links[url] = {\n postID: thePost.id,\n card,\n shared: 1,\n sharers: [post.account],\n likes: favouritesCount,\n boosts: reblogsCount,\n };\n } else {\n if (links[url].sharers.find((a) => a.id === post.account.id)) {\n continue;\n }\n links[url].shared++;\n links[url].sharers.push(post.account);\n if (links[url].postID !== thePost.id) {\n links[url].likes += favouritesCount;\n links[url].boosts += reblogsCount;\n }\n }\n }\n }\n\n let topLinks = [];\n for (const link in links) {\n topLinks.push({\n url: link,\n ...links[link],\n });\n }\n topLinks.sort((a, b) => {\n if (a.shared > b.shared) return -1;\n if (a.shared < b.shared) return 1;\n if (a.boosts > b.boosts) return -1;\n if (a.boosts < b.boosts) return 1;\n if (a.likes > b.likes) return -1;\n if (a.likes < b.likes) return 1;\n return 0;\n });\n\n // Slice links to shared > 1 but min 10 links\n if (topLinks.length > 10) {\n linksLoop: for (let i = 10; i < topLinks.length; i++) {\n const { shared } = topLinks[i];\n if (shared <= 1) {\n topLinks = topLinks.slice(0, i);\n break linksLoop;\n }\n }\n }\n\n return [\n {\n filtered,\n groups,\n boosts,\n replies,\n followedTags,\n original,\n },\n topLinks,\n ];\n }, [posts]);\n\n const [selectedFilterCategory, setSelectedFilterCategory] = useState('all');\n const [selectedAuthor, setSelectedAuthor] = useState(null);\n\n const [range, setRange] = useState(1);\n\n const [sortBy, setSortBy] = useState('createdAt');\n const [sortOrder, setSortOrder] = useState('asc');\n const [groupBy, setGroupBy] = useState(null);\n\n const [filteredPosts, authors, authorCounts] = useMemo(() => {\n const authorsHash = {};\n const authorCountsMap = new Map();\n\n let filteredPosts = posts.filter((post) => {\n const postFilterMatches =\n selectedFilterCategory === 'all' ||\n post.__FILTER === selectedFilterCategory;\n\n if (postFilterMatches) {\n authorsHash[post.account.id] = post.account;\n authorCountsMap.set(\n post.account.id,\n (authorCountsMap.get(post.account.id) || 0) + 1,\n );\n }\n\n return postFilterMatches;\n });\n\n // Deduplicate boosts\n const boostedPosts = {};\n filteredPosts.forEach((post) => {\n if (post.reblog) {\n if (boostedPosts[post.reblog.id]) {\n if (boostedPosts[post.reblog.id].__BOOSTERS) {\n boostedPosts[post.reblog.id].__BOOSTERS.add(post.account);\n } else {\n boostedPosts[post.reblog.id].__BOOSTERS = new Set([post.account]);\n }\n post.__HIDDEN = true;\n } else {\n boostedPosts[post.reblog.id] = post;\n }\n }\n });\n\n if (selectedAuthor && authorCountsMap.has(selectedAuthor)) {\n filteredPosts = filteredPosts.filter(\n (post) =>\n post.account.id === selectedAuthor ||\n [...(post.__BOOSTERS || [])].find((a) => a.id === selectedAuthor),\n );\n }\n\n return [filteredPosts, authorsHash, Object.fromEntries(authorCountsMap)];\n }, [selectedFilterCategory, selectedAuthor, posts]);\n\n const filteredPostsMap = useMemo(() => {\n const map = {};\n filteredPosts.forEach((post) => {\n map[post.id] = post;\n });\n return map;\n }, [filteredPosts]);\n\n const authorCountsList = useMemo(\n () =>\n Object.keys(authorCounts).sort(\n (a, b) => authorCounts[b] - authorCounts[a],\n ),\n [authorCounts],\n );\n\n const sortedFilteredPosts = useMemo(() => {\n const authorIndices = {};\n authorCountsList.forEach((authorID, index) => {\n authorIndices[authorID] = index;\n });\n return filteredPosts\n .filter((post) => !post.__HIDDEN)\n .sort((a, b) => {\n if (groupBy === 'account') {\n const aAccountID = a.account.id;\n const bAccountID = b.account.id;\n const aIndex = authorIndices[aAccountID];\n const bIndex = authorIndices[bAccountID];\n const order = aIndex - bIndex;\n if (order !== 0) {\n return order;\n }\n }\n if (sortBy !== 'createdAt') {\n a = a.reblog || a;\n b = b.reblog || b;\n if (sortBy !== 'density' && a[sortBy] === b[sortBy]) {\n return a.createdAt > b.createdAt ? 1 : -1;\n }\n }\n if (sortBy === 'density') {\n const aDensity = postDensity(a);\n const bDensity = postDensity(b);\n if (sortOrder === 'asc') {\n return aDensity > bDensity ? 1 : -1;\n } else {\n return bDensity > aDensity ? 1 : -1;\n }\n }\n if (sortOrder === 'asc') {\n return a[sortBy] > b[sortBy] ? 1 : -1;\n } else {\n return b[sortBy] > a[sortBy] ? 1 : -1;\n }\n });\n }, [filteredPosts, sortBy, sortOrder, groupBy, authorCountsList]);\n\n const prevGroup = useRef(null);\n\n const authorsListParent = useRef(null);\n const autoAnimated = useRef(false);\n useEffect(() => {\n if (posts.length > 100 || autoAnimated.current) return;\n if (authorsListParent.current) {\n autoAnimate(authorsListParent.current, {\n duration: 200,\n });\n autoAnimated.current = true;\n }\n }, [posts, authorsListParent]);\n\n const postsBarType = posts.length > 160 ? '3d' : '2d';\n\n const postsBar = useMemo(() => {\n if (postsBarType !== '2d') return null;\n return posts.map((post) => {\n // If part of filteredPosts\n const isFiltered = filteredPostsMap[post.id];\n return (\n <span\n key={post.id}\n class={`post-dot ${isFiltered ? 'post-dot-highlight' : ''}`}\n />\n );\n });\n }, [filteredPostsMap]);\n\n const postsBins = useMemo(() => {\n if (postsBarType !== '3d') return null;\n if (!posts?.length) return null;\n const bins = binByTime(posts, 'createdAt', 320);\n return bins.map((posts, i) => {\n return (\n <div class=\"posts-bin\" key={i}>\n {posts.map((post) => {\n const isFiltered = filteredPostsMap[post.id];\n return (\n <span\n key={post.id}\n class={`post-dot ${isFiltered ? 'post-dot-highlight' : ''}`}\n />\n );\n })}\n </div>\n );\n });\n }, [filteredPostsMap]);\n\n const scrollableRef = useRef(null);\n\n // if range value exceeded lastCatchupEndAt, show error\n const lastCatchupRange = useMemo(() => {\n // return hour, not ms\n if (!lastCatchupEndAt) return null;\n return (Date.now() - lastCatchupEndAt) / 1000 / 60 / 60;\n }, [lastCatchupEndAt, range]);\n\n useEffect(() => {\n if (uiState !== 'results') return;\n const authorUsername =\n selectedAuthor && authors[selectedAuthor]\n ? authors[selectedAuthor].username\n : '';\n const sortOrderIndex = sortOrder === 'asc' ? 0 : 1;\n const groupByText = {\n account: 'authors',\n };\n let toast = showToast({\n duration: 5_000, // 5 seconds\n // Note: I'm sorry, translators\n text: t`Showing ${select(selectedFilterCategory, {\n all: 'all posts',\n original: 'original posts',\n replies: 'replies',\n boosts: 'boosts',\n followedTags: 'followed tags',\n groups: 'groups',\n filtered: 'filtered posts',\n })}, ${select(sortBy, {\n createdAt: select(sortOrder, {\n asc: 'oldest',\n desc: 'latest',\n }),\n reblogsCount: select(sortOrder, {\n asc: 'fewest boosts',\n desc: 'most boosts',\n }),\n favouritesCount: select(sortOrder, {\n asc: 'fewest likes',\n desc: 'most likes',\n }),\n repliesCount: select(sortOrder, {\n asc: 'fewest replies',\n desc: 'most replies',\n }),\n density: select(sortOrder, { asc: 'least dense', desc: 'most dense' }),\n })} first${select(groupBy, {\n account: ', grouped by authors',\n other: '',\n })}`,\n });\n return () => {\n toast?.hideToast?.();\n };\n }, [\n uiState,\n selectedFilterCategory,\n selectedAuthor,\n sortBy,\n sortOrder,\n groupBy,\n authors,\n ]);\n\n useEffect(() => {\n if (selectedAuthor) {\n if (authors[selectedAuthor]) {\n // Check if author is visible and within the scrollable area viewport\n const authorElement = authorsListParent.current.querySelector(\n `[data-author=\"${selectedAuthor}\"]`,\n );\n const scrollableRect =\n authorsListParent.current?.getBoundingClientRect();\n const authorRect = authorElement?.getBoundingClientRect();\n console.log({\n sLeft: scrollableRect.left,\n sRight: scrollableRect.right,\n aLeft: authorRect.left,\n aRight: authorRect.right,\n });\n if (\n authorRect.left < scrollableRect.left ||\n authorRect.right > scrollableRect.right\n ) {\n authorElement.scrollIntoView({\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n });\n } else if (authorRect.top < 0) {\n authorElement.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n behavior: 'smooth',\n });\n }\n }\n }\n }, [selectedAuthor, authors]);\n\n const [showHelp, setShowHelp] = useState(false);\n\n const itemsSelector = '.catchup-list > li > a';\n const jRef = useHotkeys(\n 'j',\n () => {\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n const nextItem = allItems[activeItemIndex + 1];\n if (nextItem) {\n nextItem.focus();\n nextItem.scrollIntoView({\n block: 'center',\n inline: 'center',\n behavior: 'smooth',\n });\n }\n } else {\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 0;\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView({\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n });\n }\n }\n },\n {\n preventDefault: true,\n ignoreModifiers: true,\n },\n );\n\n const kRef = useHotkeys(\n 'k',\n () => {\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let prevItem = allItems[activeItemIndex - 1];\n if (prevItem) {\n prevItem.focus();\n prevItem.scrollIntoView({\n block: 'center',\n inline: 'center',\n behavior: 'smooth',\n });\n }\n } else {\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0;\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView({\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n });\n }\n }\n },\n {\n preventDefault: true,\n ignoreModifiers: true,\n },\n );\n\n const hlRef = useHotkeys(\n 'h, l',\n (_, handler) => {\n // Go next/prev selectedAuthor in authorCountsList list\n const key = handler.keys[0];\n if (selectedAuthor) {\n const index = authorCountsList.indexOf(selectedAuthor);\n if (key === 'h') {\n if (index > 0 && index < authorCountsList.length) {\n setSelectedAuthor(authorCountsList[index - 1]);\n scrollableRef.current?.focus();\n }\n } else if (key === 'l') {\n if (index < authorCountsList.length - 1 && index >= 0) {\n setSelectedAuthor(authorCountsList[index + 1]);\n scrollableRef.current?.focus();\n }\n }\n } else if (key === 'l') {\n setSelectedAuthor(authorCountsList[0]);\n scrollableRef.current?.focus();\n }\n },\n {\n preventDefault: true,\n ignoreModifiers: true,\n enableOnFormTags: ['input'],\n },\n );\n\n const escRef = useHotkeys(\n 'esc',\n () => {\n setSelectedAuthor(null);\n scrollableRef.current?.focus();\n },\n {\n preventDefault: true,\n ignoreModifiers: true,\n enableOnFormTags: ['input'],\n },\n );\n\n const dotRef = useHotkeys(\n '.',\n () => {\n scrollableRef.current?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n },\n {\n preventDefault: true,\n ignoreModifiers: true,\n enableOnFormTags: ['input'],\n },\n );\n\n const handleArrowKeys = useCallback((e) => {\n const activeElement = document.activeElement;\n const isRadio =\n activeElement?.tagName === 'INPUT' && activeElement.type === 'radio';\n const isArrowKeys =\n e.key === 'ArrowDown' ||\n e.key === 'ArrowUp' ||\n e.key === 'ArrowLeft' ||\n e.key === 'ArrowRight';\n if (isArrowKeys && isRadio) {\n // Note: page scroll won't trigger on first arrow key press due to this. Subsequent presses will.\n activeElement.blur();\n return;\n }\n }, []);\n\n return (\n <div\n ref={(node) => {\n scrollableRef.current = node;\n jRef(node);\n kRef(node);\n hlRef(node);\n escRef(node);\n }}\n id=\"catchup-page\"\n class=\"deck-container\"\n tabIndex=\"-1\"\n >\n <div class=\"timeline-deck deck wide\">\n <header\n class={`${uiState === 'loading' ? 'loading' : ''}`}\n onClick={(e) => {\n if (!e.target.closest('a, button')) {\n scrollableRef.current?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }\n }}\n >\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n {uiState === 'results' && (\n <Link to=\"/catchup\" class=\"button plain\">\n <Icon icon=\"history2\" size=\"l\" alt={t`Catch-up`} />\n </Link>\n )}\n {uiState === 'start' && (\n <Link to=\"/\" class=\"button plain\">\n <Icon icon=\"home\" size=\"l\" alt={t`Home`} />\n </Link>\n )}\n </div>\n <h1>\n {uiState !== 'start' && (\n <Trans>\n Catch-up <sup>beta</sup>\n </Trans>\n )}\n </h1>\n <div class=\"header-side\">\n {uiState !== 'start' && uiState !== 'loading' && (\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => {\n setShowHelp(true);\n }}\n >\n <Trans>Help</Trans>\n </button>\n )}\n </div>\n </div>\n </header>\n <main onKeyDown={handleArrowKeys}>\n {uiState === 'start' && (\n <div class=\"catchup-start\">\n <h1>\n <Trans>\n Catch-up <sup>beta</sup>\n </Trans>\n </h1>\n <details>\n <summary>\n <Trans>What is this?</Trans>\n </summary>\n <p>\n <Trans>\n Catch-up is a separate timeline for your followings,\n offering a high-level view at a glance, with a simple,\n email-inspired interface to effortlessly sort and filter\n through posts.\n </Trans>\n </p>\n <img\n src={catchupUrl}\n width=\"1200\"\n height=\"900\"\n alt={t`Preview of Catch-up UI`}\n />\n <p>\n <button\n type=\"button\"\n onClick={(e) => {\n e.target.closest('details').open = false;\n }}\n >\n <Trans>Let's catch up</Trans>\n </button>\n </p>\n </details>\n <p>\n <Trans>Let's catch up on the posts from your followings.</Trans>\n </p>\n <p>\n <b>\n <Trans>Show me all posts from…</Trans>\n </b>\n </p>\n <div class=\"catchup-form\">\n <input\n ref={catchupRangeRef}\n type=\"range\"\n value={range}\n min={RANGES[0].value}\n max={RANGES[RANGES.length - 1].value}\n step=\"1\"\n list=\"catchup-ranges\"\n onChange={(e) => setRange(+e.target.value)}\n />{' '}\n <span\n style={{\n width: '8em',\n }}\n >\n {_(RANGES[range - 1].label)}\n <br />\n <small class=\"insignificant\">\n {range == RANGES[RANGES.length - 1].value\n ? t`until the max`\n : niceDateTime(\n new Date(Date.now() - range * 60 * 60 * 1000),\n )}\n </small>\n </span>\n <datalist id=\"catchup-ranges\">\n {RANGES.map(({ label, value }) => (\n <option value={value} label={_(label)} />\n ))}\n </datalist>{' '}\n <button\n type=\"button\"\n onClick={() => {\n if (range < RANGES[RANGES.length - 1].value) {\n let duration;\n if (\n range === RANGES[RANGES.length - 1].value &&\n catchupLastRef.current?.checked\n ) {\n duration = Date.now() - lastCatchupEndAt;\n } else {\n duration = range * 60 * 60 * 1000;\n }\n handleCatchupClick({ duration });\n } else {\n handleCatchupClick();\n }\n }}\n >\n <Trans>Catch up</Trans>\n </button>\n </div>\n {lastCatchupRange && range > lastCatchupRange ? (\n <p class=\"catchup-info\">\n <Icon icon=\"info\" />{' '}\n <Trans>Overlaps with your last catch-up</Trans>\n </p>\n ) : range === RANGES[RANGES.length - 1].value &&\n lastCatchupEndAt ? (\n <p class=\"catchup-info\">\n <label>\n <input\n type=\"checkbox\"\n switch\n checked\n ref={catchupLastRef}\n />{' '}\n <Trans>\n Until the last catch-up (\n {dtf.format(new Date(lastCatchupEndAt))})\n </Trans>\n </label>\n </p>\n ) : null}\n <p class=\"insignificant\">\n <small>\n <Trans>\n Note: your instance might only show a maximum of 800 posts\n in the Home timeline regardless of the time range. Could be\n less or more.\n </Trans>\n </small>\n </p>\n {!!prevCatchups?.length && (\n <div class=\"catchup-prev\">\n <p>\n <Trans>Previously…</Trans>\n </p>\n <ul>\n {prevCatchups.map((pc) => (\n <li key={pc.id}>\n <Link to={`/catchup?id=${pc.id}`}>\n <Icon icon=\"history2\" />{' '}\n <span>\n {pc.startAt\n ? dtf.formatRange(\n new Date(pc.startAt),\n new Date(pc.endAt),\n )\n : `… – ${dtf.format(new Date(pc.endAt))}`}\n </span>\n </Link>{' '}\n <span>\n <small class=\"ib insignificant\">\n <Plural\n value={pc.count}\n one=\"# post\"\n other=\"# posts\"\n />\n </small>{' '}\n <button\n type=\"button\"\n class=\"light danger small\"\n onClick={async () => {\n const yes = confirm(t`Remove this catch-up?`);\n if (yes) {\n let st = showToast(\n t`Removing Catch-up ${pc.id}`,\n );\n await db.catchup.del(pc.id);\n st?.hideToast?.();\n showToast(t`Catch-up ${pc.id} removed`);\n reloadCatchups();\n }\n }}\n >\n <Icon icon=\"x\" alt={t`Remove`} />\n </button>\n </span>\n </li>\n ))}\n </ul>\n {prevCatchups.length >= 3 && (\n <p>\n <small>\n <Trans>\n Note: Only max 3 will be stored. The rest will be\n automatically removed.\n </Trans>\n </small>\n </p>\n )}\n </div>\n )}\n </div>\n )}\n {uiState === 'loading' && (\n <div class=\"ui-state catchup-start\">\n <Loader abrupt />\n <p class=\"insignificant\">\n <Trans>Fetching posts…</Trans>\n </p>\n <p class=\"insignificant\">\n <Trans>This might take a while.</Trans>\n </p>\n </div>\n )}\n {uiState === 'results' && (\n <>\n <div class=\"catchup-header\">\n {posts.length > 0 && (\n <p>\n <b class=\"ib\">\n {dtf.formatRange(\n new Date(posts[0].createdAt),\n new Date(posts[posts.length - 1].createdAt),\n )}\n </b>\n </p>\n )}\n <aside>\n <button\n hidden={\n selectedFilterCategory === 'all' &&\n !selectedAuthor &&\n sortBy === 'createdAt' &&\n sortOrder === 'asc'\n }\n type=\"button\"\n class=\"plain4 small\"\n onClick={() => {\n setSelectedFilterCategory('all');\n setSelectedAuthor(null);\n setSortBy('createdAt');\n setGroupBy(null);\n setSortOrder('asc');\n }}\n >\n <Trans>Reset filters</Trans>\n </button>\n {links?.length > 0 && (\n <button\n type=\"button\"\n class=\"plain small\"\n onClick={() => setShowTopLinks(!showTopLinks)}\n >\n <Trans>Top links</Trans>{' '}\n <Icon\n icon=\"chevron-down\"\n style={{\n transform: showTopLinks\n ? 'rotate(180deg)'\n : 'rotate(0deg)',\n }}\n />\n </button>\n )}\n </aside>\n </div>\n <div class=\"shazam-container no-animation\" hidden={!showTopLinks}>\n <div class=\"shazam-container-inner\">\n <div class=\"catchup-top-links links-bar\">\n {links.map((link) => {\n const { card, shared, sharers, likes, boosts } = link;\n const {\n blurhash,\n title,\n description,\n url,\n image,\n imageDescription,\n language,\n width,\n height,\n publishedAt,\n } = card;\n const domain = punycode.toUnicode(\n URL.parse(url)\n .hostname.replace(/^www\\./, '')\n .replace(/\\/$/, ''),\n );\n let accentColor;\n if (blurhash) {\n const averageColor = getBlurHashAverageColor(blurhash);\n const labAverageColor = rgb2oklab(averageColor);\n accentColor = oklab2rgb([\n 0.6,\n labAverageColor[1],\n labAverageColor[2],\n ]);\n }\n\n return (\n <a\n key={url}\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"link-block\"\n style={\n accentColor\n ? {\n '--accent-color': `rgb(${accentColor.join(\n ',',\n )})`,\n '--accent-alpha-color': `rgba(${accentColor.join(\n ',',\n )}, 0.4)`,\n }\n : {}\n }\n >\n <article>\n <figure>\n <img\n src={image}\n alt={imageDescription}\n width={width}\n height={height}\n loading=\"lazy\"\n />\n </figure>\n <div class=\"article-body\">\n <header>\n <div class=\"article-meta\">\n <span class=\"domain\">{domain}</span>{' '}\n {!!publishedAt && <>· </>}\n {!!publishedAt && (\n <>\n <RelativeTime\n datetime={publishedAt}\n format=\"micro\"\n />\n </>\n )}\n </div>\n {!!title && (\n <h1\n class=\"title\"\n lang={language}\n dir=\"auto\"\n title={title}\n >\n {title}\n </h1>\n )}\n </header>\n {!!description && (\n <p\n class=\"description\"\n lang={language}\n dir=\"auto\"\n title={description}\n >\n {description}\n </p>\n )}\n <hr />\n <p\n style={{\n whiteSpace: 'nowrap',\n }}\n >\n <Trans>\n Shared by{' '}\n {sharers.map((s) => {\n const { avatarStatic, displayName } = s;\n return (\n <button\n type=\"button\"\n class=\"plain\"\n style={{\n padding: 0,\n }}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n // Reset and filter to author\n const { id } = s;\n setSelectedAuthor(id);\n setSelectedFilterCategory('all');\n }}\n >\n <Avatar\n url={avatarStatic}\n size=\"s\"\n alt={displayName}\n />\n </button>\n );\n })}\n </Trans>\n </p>\n </div>\n </article>\n </a>\n );\n })}\n </div>\n </div>\n </div>\n {posts.length >= 5 &&\n (postsBarType === '3d' ? (\n <div class=\"catchup-posts-viz-time-bar\">{postsBins}</div>\n ) : (\n <div class=\"catchup-posts-viz-bar\">{postsBar}</div>\n ))}\n {posts.length >= 2 && (\n <div class=\"catchup-filters\">\n <label class=\"filter-cat\">\n <input\n type=\"radio\"\n name=\"filter-cat\"\n checked={selectedFilterCategory.toLowerCase() === 'all'}\n onChange={() => {\n setSelectedFilterCategory('all');\n }}\n />\n <Trans>All</Trans> <span class=\"count\">{posts.length}</span>\n </label>\n {Object.entries(FILTER_KEYS).map(\n ([key, label]) =>\n !!filterCounts[key] && (\n <label\n class=\"filter-cat\"\n key={_(label)}\n title={\n ((filterCounts[key] / posts.length) * 100).toFixed(\n 2,\n ) + '%'\n }\n >\n <input\n type=\"radio\"\n name=\"filter-cat\"\n checked={\n selectedFilterCategory.toLowerCase() ===\n key.toLowerCase()\n }\n onChange={() => {\n setSelectedFilterCategory(key);\n if (key === 'boosts') {\n setSortBy('reblogsCount');\n setSortOrder('desc');\n setGroupBy(null);\n }\n // setSelectedAuthor(null);\n }}\n />\n {_(label)}{' '}\n <span class=\"count\">{filterCounts[key]}</span>\n </label>\n ),\n )}\n </div>\n )}\n {posts.length >= 2 && !!authorCounts && (\n <div\n class=\"catchup-filters authors-filters\"\n ref={authorsListParent}\n >\n {authorCountsList.map((author) => (\n <label\n class=\"filter-author\"\n data-author={author}\n key={`${author}-${authorCounts[author]}`}\n // Preact messed up the order sometimes, need additional key besides just `author`\n // https://github.com/preactjs/preact/issues/2849\n >\n <input\n type=\"radio\"\n name=\"filter-author\"\n checked={selectedAuthor === author}\n onChange={() => {\n setSelectedAuthor(author);\n // setGroupBy(null);\n }}\n onClick={() => {\n if (selectedAuthor === author) {\n setSelectedAuthor(null);\n }\n }}\n />\n <Avatar\n url={\n authors[author].avatarStatic || authors[author].avatar\n }\n size=\"xxl\"\n alt={`${authors[author].displayName} (@${authors[author].acct})`}\n />{' '}\n <span class=\"count\">{authorCounts[author]}</span>\n <span class=\"username\">{authors[author].username}</span>\n </label>\n ))}\n {authorCountsList.length > 5 && (\n <small\n key=\"authors-count\"\n style={{\n whiteSpace: 'nowrap',\n paddingInline: '1em',\n opacity: 0.33,\n }}\n >\n <Plural\n value={authorCountsList.length}\n one=\"# author\"\n other=\"# authors\"\n />\n </small>\n )}\n </div>\n )}\n {posts.length >= 2 && (\n <div class=\"catchup-filters\">\n <span class=\"filter-label\">\n <Trans>Sort</Trans>\n </span>{' '}\n <fieldset class=\"radio-field-group\">\n {FILTER_SORTS.map((key) => (\n <label\n class=\"filter-sort\"\n key={key}\n onClick={(e) => {\n if (sortBy === key) {\n e.preventDefault();\n e.stopPropagation();\n setSortOrder(sortOrder === 'asc' ? 'desc' : 'asc');\n }\n }}\n >\n <input\n type=\"radio\"\n name=\"filter-sort-cat\"\n checked={sortBy === key}\n onChange={() => {\n setSortBy(key);\n const order = /(replies|favourites|reblogs)/.test(\n key,\n )\n ? 'desc'\n : 'asc';\n setSortOrder(order);\n }}\n />\n {\n {\n createdAt: t`Date`,\n repliesCount: t`Replies`,\n favouritesCount: t`Likes`,\n reblogsCount: t`Boosts`,\n density: t`Density`,\n }[key]\n }\n {sortBy === key && (sortOrder === 'asc' ? ' ↑' : ' ↓')}\n </label>\n ))}\n </fieldset>\n {/* <fieldset class=\"radio-field-group\">\n {['asc', 'desc'].map((key) => (\n <label class=\"filter-sort\" key={key}>\n <input\n type=\"radio\"\n name=\"filter-sort-dir\"\n checked={sortOrder === key}\n onChange={() => {\n setSortOrder(key);\n }}\n />\n {key === 'asc' ? '↑' : '↓'}\n </label>\n ))}\n </fieldset> */}\n <span class=\"filter-label\">\n <Trans id=\"group.filter\">Group</Trans>\n </span>{' '}\n <fieldset class=\"radio-field-group\">\n {FILTER_GROUPS.map((key) => (\n <label class=\"filter-group\" key={key || 'none'}>\n <input\n type=\"radio\"\n name=\"filter-group\"\n checked={groupBy === key}\n onChange={() => {\n setGroupBy(key);\n }}\n disabled={key === 'account' && selectedAuthor}\n />\n {{\n account: t`Authors`,\n }[key] || t`None`}\n </label>\n ))}\n </fieldset>\n {\n selectedAuthor && authorCountsList.length > 1 ? (\n <button\n type=\"button\"\n class=\"plain6 small\"\n onClick={() => {\n setSelectedAuthor(null);\n }}\n style={{\n whiteSpace: 'nowrap',\n }}\n >\n <Trans>Show all authors</Trans>\n </button>\n ) : null\n // <button\n // type=\"button\"\n // class=\"plain4 small\"\n // onClick={() => {}}\n // >\n // Group by authors\n // </button>\n }\n </div>\n )}\n <ul\n class={`catchup-list catchup-filter-${\n selectedFilterCategory || ''\n } ${sortBy ? `catchup-sort-${sortBy}` : ''} ${\n selectedAuthor && authors[selectedAuthor]\n ? `catchup-selected-author`\n : ''\n } ${groupBy ? `catchup-group-${groupBy}` : ''}`}\n >\n {sortedFilteredPosts.map((post, i) => {\n const id = post.reblog?.id || post.id;\n let showSeparator = false;\n if (groupBy === 'account') {\n if (\n prevGroup.current &&\n post.account.id !== prevGroup.current &&\n i > 0\n ) {\n showSeparator = true;\n }\n prevGroup.current = post.account.id;\n }\n return (\n <Fragment key={`${post.id}-${showSeparator}`}>\n {showSeparator && <li class=\"separator\" />}\n <IntersectionPostLineItem\n to={`/${instance}/s/${id}`}\n post={post}\n root={scrollableRef.current}\n />\n </Fragment>\n );\n })}\n </ul>\n <footer>\n {filteredPosts.length > 5 && (\n <p>\n {selectedFilterCategory === 'boosts'\n ? t`You don't have to read everything.`\n : t`That's all.`}{' '}\n <button\n type=\"button\"\n class=\"textual\"\n onClick={() => {\n scrollableRef.current.scrollTop = 0;\n }}\n >\n <Trans>Back to top</Trans>\n </button>\n .\n </p>\n )}\n </footer>\n </>\n )}\n </main>\n </div>\n {showHelp && (\n <Modal onClose={() => setShowHelp(false)}>\n <div class=\"sheet\" id=\"catchup-help-sheet\">\n <button\n type=\"button\"\n class=\"sheet-close\"\n onClick={() => setShowHelp(false)}\n >\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <h2>\n <Trans>Help</Trans>\n </h2>\n </header>\n <main>\n <dl>\n <dt>\n <Trans>Top links</Trans>\n </dt>\n <dd>\n <Trans>\n Links shared by followings, sorted by shared counts, boosts\n and likes.\n </Trans>\n </dd>\n <dt>\n <Trans>Sort: Density</Trans>\n </dt>\n <dd>\n <Trans>\n Posts are sorted by information density or depth. Shorter\n posts are \"lighter\" while longer posts are \"heavier\". Posts\n with photos are \"heavier\" than posts without photos.\n </Trans>\n </dd>\n <dt>\n <Trans>Group: Authors</Trans>\n </dt>\n <dd>\n <Trans>\n Posts are grouped by authors, sorted by posts count per\n author.\n </Trans>\n </dd>\n <dt>\n <Trans>Keyboard shortcuts</Trans>\n </dt>\n {/* <dd>\n <kbd>j</kbd>: <Trans>Next post</Trans>\n </dd>\n <dd>\n <kbd>k</kbd>: <Trans>Previous post</Trans>\n </dd>\n <dd>\n <kbd>l</kbd>: <Trans>Next author</Trans>\n </dd>\n <dd>\n <kbd>h</kbd>: <Trans>Previous author</Trans>\n </dd>\n <dd>\n <kbd>Enter</kbd>: <Trans>Open post details</Trans>\n </dd>\n <dd>\n <kbd>.</kbd>: <Trans>Scroll to top</Trans>\n </dd> */}\n <dd>\n <table>\n <tbody>\n <tr>\n <td>\n <Trans>Next post</Trans>\n </td>\n <td>\n <kbd>j</kbd>\n </td>\n </tr>\n <tr>\n <td>\n <Trans>Previous post</Trans>\n </td>\n <td>\n <kbd>k</kbd>\n </td>\n </tr>\n <tr>\n <td>\n <Trans>Next author</Trans>\n </td>\n <td>\n <kbd>l</kbd>\n </td>\n </tr>\n <tr>\n <td>\n <Trans>Previous author</Trans>\n </td>\n <td>\n <kbd>h</kbd>\n </td>\n </tr>\n <tr>\n <td>\n <Trans>Open post details</Trans>\n </td>\n <td>\n <kbd>Enter</kbd>\n </td>\n </tr>\n <tr>\n <td>\n <Trans>Scroll to top</Trans>\n </td>\n <td>\n <kbd>.</kbd>\n </td>\n </tr>\n </tbody>\n </table>\n </dd>\n </dl>\n </main>\n </div>\n </Modal>\n )}\n </div>\n );\n}\n\nconst PostLine = memo(\n function ({ post }) {\n const {\n id,\n account,\n group,\n reblog,\n inReplyToId,\n inReplyToAccountId,\n _followedTags: isFollowedTags,\n _filtered: filterInfo,\n visibility,\n __BOOSTERS,\n } = post;\n const isReplyTo = inReplyToId && inReplyToAccountId !== account.id;\n const isFiltered = !!filterInfo;\n\n const debugHover = (e) => {\n if (e.shiftKey) {\n console.log({\n ...post,\n });\n }\n };\n\n return (\n <article\n class={`post-line ${\n group\n ? 'group'\n : reblog\n ? 'reblog'\n : isFollowedTags?.length\n ? 'followed-tags'\n : ''\n } ${isReplyTo ? 'reply-to' : ''} ${\n isFiltered ? 'filtered' : ''\n } visibility-${visibility}`}\n onMouseEnter={debugHover}\n >\n <span class=\"post-author\">\n {reblog ? (\n <span class=\"post-reblog-avatar\">\n <Avatar\n url={account.avatarStatic || account.avatar}\n squircle={account.bot}\n />\n {__BOOSTERS?.size > 0\n ? [...__BOOSTERS].map((b) => (\n <Avatar url={b.avatarStatic || b.avatar} squircle={b.bot} />\n ))\n : ''}{' '}\n <Icon icon=\"rocket\" />{' '}\n {/* <Avatar\n url={reblog.account.avatarStatic || reblog.account.avatar}\n squircle={reblog.account.bot}\n /> */}\n <NameText account={reblog.account} showAvatar />\n </span>\n ) : (\n <NameText account={account} showAvatar />\n )}\n </span>\n <PostPeek post={reblog || post} filterInfo={filterInfo} />\n <span class=\"post-meta\">\n <PostStats post={reblog || post} />{' '}\n <RelativeTime\n datetime={new Date(reblog?.createdAt || post.createdAt)}\n format=\"micro\"\n />\n </span>\n </article>\n );\n },\n (oldProps, newProps) => {\n return oldProps?.post?.id === newProps?.post?.id;\n },\n);\n\nconst IntersectionPostLineItem = ({ root, to, ...props }) => {\n const ref = useRef();\n const [show, setShow] = useState(false);\n useEffect(() => {\n const observer = new IntersectionObserver(\n (entries) => {\n const entry = entries[0];\n if (entry.isIntersecting) {\n queueMicrotask(() => setShow(true));\n observer.unobserve(ref.current);\n }\n },\n {\n root,\n rootMargin: `${Math.max(320, screen.height * 0.75)}px`,\n },\n );\n if (ref.current) observer.observe(ref.current);\n return () => {\n if (ref.current) observer.unobserve(ref.current);\n };\n }, []);\n\n return show ? (\n <li>\n <Link to={to}>\n <PostLine {...props} />\n </Link>\n </li>\n ) : (\n <li ref={ref} style={{ height: '4em' }} />\n );\n};\n\n// A media speak a thousand words\nconst MEDIA_DENSITY = 8;\nconst CARD_DENSITY = 8;\nfunction postDensity(post) {\n const { spoilerText, content, poll, mediaAttachments, card } = post;\n const pollContent = poll?.options?.length\n ? poll.options.reduce((acc, cur) => acc + cur.title, '')\n : '';\n const density =\n (spoilerText.length + htmlContentLength(content) + pollContent.length) /\n 140 +\n (mediaAttachments?.length\n ? MEDIA_DENSITY * mediaAttachments.length\n : card?.image\n ? CARD_DENSITY\n : 0);\n return density;\n}\n\nconst MEDIA_SIZE = 48;\n\nfunction PostPeek({ post, filterInfo }) {\n const {\n spoilerText,\n sensitive,\n content,\n emojis,\n poll,\n mediaAttachments,\n card,\n inReplyToId,\n inReplyToAccountId,\n account,\n _thread,\n } = post;\n const isThread =\n (inReplyToId && inReplyToAccountId === account.id) || !!_thread;\n\n const readingExpandSpoilers = useMemo(() => {\n const prefs = store.account.get('preferences') || {};\n return !!prefs['reading:expand:spoilers'];\n }, []);\n // const readingExpandSpoilers = true;\n const showMedia = readingExpandSpoilers || (!spoilerText && !sensitive);\n const postText = content ? statusPeek(post) : '';\n\n const showPostContent = !spoilerText || readingExpandSpoilers;\n\n return (\n <div class=\"post-peek\" title={!spoilerText ? postText : ''}>\n <span class=\"post-peek-content\">\n {isThread && !showPostContent && (\n <>\n <span class=\"post-peek-tag post-peek-thread\">Thread</span>{' '}\n </>\n )}\n {!!filterInfo ? (\n <span class=\"post-peek-filtered\">\n {/* Filtered{filterInfo?.titlesStr ? `: ${filterInfo.titlesStr}` : ''} */}\n {filterInfo?.titlesStr\n ? t`Filtered: ${filterInfo.titlesStr}`\n : t`Filtered`}\n </span>\n ) : (\n <>\n {!!spoilerText && (\n <span class=\"post-peek-spoiler\">\n <Icon\n icon={`${readingExpandSpoilers ? 'eye-open' : 'eye-close'}`}\n />{' '}\n {spoilerText}\n </span>\n )}\n {showPostContent && (\n <div class=\"post-peek-html\">\n {isThread && (\n <>\n <span class=\"post-peek-tag post-peek-thread\">\n <Trans>Thread</Trans>\n </span>{' '}\n </>\n )}\n {!!content && (\n <div\n dangerouslySetInnerHTML={{\n __html: emojifyText(content, emojis),\n }}\n />\n )}\n {!!poll?.options?.length &&\n poll.options.map((o) => (\n <div>\n {poll.multiple ? '▪️' : '•'} {o.title}\n </div>\n ))}\n {!content &&\n mediaAttachments?.length === 1 &&\n mediaAttachments[0].description && (\n <>\n <span class=\"post-peek-tag post-peek-alt\">ALT</span>{' '}\n <div>{mediaAttachments[0].description}</div>\n </>\n )}\n </div>\n )}\n </>\n )}\n </span>\n {!filterInfo && (\n <span class=\"post-peek-post-content\">\n {!!poll && (\n <span class=\"post-peek-tag post-peek-poll\">\n <Icon icon=\"poll\" size=\"s\" />\n <Trans>Poll</Trans>\n </span>\n )}\n {!!mediaAttachments?.length\n ? mediaAttachments.map((m) => {\n const mediaURL = m.previewUrl || m.url;\n const remoteMediaURL = m.previewRemoteUrl || m.remoteUrl;\n const width = m.meta?.original\n ? m.meta.original.width\n : m.meta?.small?.width || m.meta?.original?.width;\n const height = m.meta?.original\n ? m.meta.original.height\n : m.meta?.small?.height || m.meta?.original?.height;\n return (\n <span key={m.id} class=\"post-peek-media\">\n {{\n image:\n (mediaURL || remoteMediaURL) && showMedia ? (\n <img\n src={mediaURL}\n width={MEDIA_SIZE}\n height={MEDIA_SIZE}\n alt={m.description}\n loading=\"lazy\"\n onError={(e) => {\n const { src } = e.target;\n if (src === mediaURL) {\n e.target.src = remoteMediaURL;\n }\n }}\n style={{\n '--anim-duration': `${Math.min(\n Math.max(Math.max(width, height) / 100, 5),\n 120,\n )}s`,\n }}\n />\n ) : (\n <span class=\"post-peek-faux-media\">🖼</span>\n ),\n gifv:\n (mediaURL || remoteMediaURL) && showMedia ? (\n <img\n src={mediaURL}\n width={MEDIA_SIZE}\n height={MEDIA_SIZE}\n alt={m.description}\n loading=\"lazy\"\n onError={(e) => {\n const { src } = e.target;\n if (src === mediaURL) {\n e.target.src = remoteMediaURL;\n }\n }}\n />\n ) : (\n <span class=\"post-peek-faux-media\">🎞️</span>\n ),\n video:\n (mediaURL || remoteMediaURL) && showMedia ? (\n <img\n src={mediaURL}\n width={MEDIA_SIZE}\n height={MEDIA_SIZE}\n alt={m.description}\n loading=\"lazy\"\n onError={(e) => {\n const { src } = e.target;\n if (src === mediaURL) {\n e.target.src = remoteMediaURL;\n }\n }}\n />\n ) : (\n <span class=\"post-peek-faux-media\">📹</span>\n ),\n audio: <span class=\"post-peek-faux-media\">🎵</span>,\n }[m.type] || null}\n </span>\n );\n })\n : !!card &&\n card.image &&\n showMedia && (\n <span\n class={`post-peek-media post-peek-card card-${\n card.type || ''\n }`}\n >\n {card.image ? (\n <img\n src={card.image}\n width={MEDIA_SIZE}\n height={MEDIA_SIZE}\n alt={\n card.title || card.description || card.imageDescription\n }\n loading=\"lazy\"\n style={{\n '--anim-duration':\n card.width &&\n card.height &&\n `${Math.min(\n Math.max(\n Math.max(card.width, card.height) / 100,\n 5,\n ),\n 120,\n )}s`,\n }}\n />\n ) : (\n <span class=\"post-peek-faux-media\">🔗</span>\n )}\n </span>\n )}\n </span>\n )}\n </div>\n );\n}\n\nfunction PostStats({ post }) {\n const { reblogsCount, repliesCount, favouritesCount } = post;\n return (\n <span class=\"post-stats\">\n {repliesCount > 0 && (\n <span class=\"post-stat-replies\">\n <Icon icon=\"comment2\" size=\"s\" alt={t`Replies`} />{' '}\n {shortenNumber(repliesCount)}\n </span>\n )}\n {favouritesCount > 0 && (\n <span class=\"post-stat-likes\">\n <Icon icon=\"heart\" size=\"s\" alt={t`Likes`} />{' '}\n {shortenNumber(favouritesCount)}\n </span>\n )}\n {reblogsCount > 0 && (\n <span class=\"post-stat-boosts\">\n <Icon icon=\"rocket\" size=\"s\" alt={t`Boosts`} />{' '}\n {shortenNumber(reblogsCount)}\n </span>\n )}\n </span>\n );\n}\n\nfunction binByTime(data, key, numBins) {\n // Extract dates from data objects\n const dates = data.map((item) => new Date(item[key]));\n\n // Find minimum and maximum dates directly (avoiding Math.min/max)\n const minDate = dates.reduce(\n (acc, date) => (date < acc ? date : acc),\n dates[0],\n );\n const maxDate = dates.reduce(\n (acc, date) => (date > acc ? date : acc),\n dates[0],\n );\n\n // Calculate the time span in milliseconds\n const range = maxDate.getTime() - minDate.getTime();\n\n // Create empty bins and loop through data\n const bins = Array.from({ length: numBins }, () => []);\n data.forEach((item) => {\n const date = new Date(item[key]);\n const normalized = (date.getTime() - minDate.getTime()) / range;\n const binIndex = Math.floor(normalized * (numBins - 1));\n bins[binIndex].push(item);\n });\n\n return bins;\n}\n\nexport default Catchup;\n","import { t, Trans } from '@lingui/macro';\nimport { useRef } from 'preact/hooks';\n\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\nfunction Favourites() {\n useTitle(t`Likes`, '/favourites');\n const { masto, instance } = api();\n const favouritesIterator = useRef();\n async function fetchFavourites(firstLoad) {\n if (firstLoad || !favouritesIterator.current) {\n favouritesIterator.current = masto.v1.favourites.list({ limit: LIMIT });\n }\n return await favouritesIterator.current.next();\n }\n\n return (\n <Timeline\n title={t`Likes`}\n id=\"favourites\"\n emptyText={t`No likes yet. Go like something!`}\n errorText={t`Unable to load likes.`}\n instance={instance}\n fetchItems={fetchFavourites}\n />\n );\n}\n\nexport default Favourites;\n","import './filters.css';\n\nimport { i18n } from '@lingui/core';\nimport { msg, Plural, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { useEffect, useReducer, useRef, useState } from 'preact/hooks';\n\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport MenuConfirm from '../components/menu-confirm';\nimport Modal from '../components/modal';\nimport NavMenu from '../components/nav-menu';\nimport RelativeTime from '../components/relative-time';\nimport { api } from '../utils/api';\nimport i18nDuration from '../utils/i18n-duration';\nimport useInterval from '../utils/useInterval';\nimport useTitle from '../utils/useTitle';\n\nconst FILTER_CONTEXT = ['home', 'public', 'notifications', 'thread', 'account'];\nconst FILTER_CONTEXT_UNIMPLEMENTED = ['notifications', 'thread', 'account'];\nconst FILTER_CONTEXT_LABELS = {\n home: msg`Home and lists`,\n notifications: msg`Notifications`,\n public: msg`Public timelines`,\n thread: msg`Conversations`,\n account: msg`Profiles`,\n};\n\nconst EXPIRY_DURATIONS = [\n 0, // forever\n 30 * 60, // 30 minutes\n 60 * 60, // 1 hour\n 6 * 60 * 60, // 6 hours\n 12 * 60 * 60, // 12 hours\n 60 * 60 * 24, // 24 hours\n 60 * 60 * 24 * 7, // 7 days\n 60 * 60 * 24 * 30, // 30 days\n];\n\nconst EXPIRY_DURATIONS_LABELS = {\n 0: msg`Never`,\n 1800: i18nDuration(30, 'minute'),\n 3600: i18nDuration(1, 'hour'),\n 21600: i18nDuration(6, 'hour'),\n 43200: i18nDuration(12, 'hour'),\n 86_400: i18nDuration(24, 'hour'),\n 604_800: i18nDuration(7, 'day'),\n 2_592_000: i18nDuration(30, 'day'),\n};\n\nfunction Filters() {\n const { masto } = api();\n useTitle(t`Filters`, `/ft`);\n const [uiState, setUIState] = useState('default');\n const [showFiltersAddEditModal, setShowFiltersAddEditModal] = useState(false);\n\n const [reloadCount, reload] = useReducer((c) => c + 1, 0);\n const [filters, setFilters] = useState([]);\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const filters = await masto.v2.filters.list();\n filters.sort((a, b) => a.title.localeCompare(b.title));\n filters.forEach((filter) => {\n if (filter.keywords?.length) {\n filter.keywords.sort((a, b) => a.id - b.id);\n }\n });\n console.log(filters);\n setFilters(filters);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, [reloadCount]);\n\n return (\n <div id=\"filters-page\" class=\"deck-container\" tabIndex=\"-1\">\n <div class=\"timeline-deck deck\">\n <header>\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n <Link to=\"/\" class=\"button plain\">\n <Icon icon=\"home\" size=\"l\" alt={t`Home`} />\n </Link>\n </div>\n <h1>\n <Trans>Filters</Trans>\n </h1>\n <div class=\"header-side\">\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => {\n setShowFiltersAddEditModal(true);\n }}\n >\n <Icon icon=\"plus\" size=\"l\" alt={t`New filter`} />\n </button>\n </div>\n </div>\n </header>\n <main>\n {filters.length > 0 ? (\n <>\n <ul class=\"filters-list\">\n {filters.map((filter) => {\n const { id, title, expiresAt, keywords } = filter;\n return (\n <li key={id}>\n <div>\n <h2>{title}</h2>\n {keywords?.length > 0 && (\n <div>\n {keywords.map((k) => (\n <>\n <span class=\"tag collapsed insignificant\">\n {k.wholeWord ? `“${k.keyword}”` : k.keyword}\n </span>{' '}\n </>\n ))}\n </div>\n )}\n <small class=\"insignificant\">\n <ExpiryStatus expiresAt={expiresAt} />\n </small>\n </div>\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => {\n setShowFiltersAddEditModal({\n filter,\n });\n }}\n >\n <Icon icon=\"pencil\" size=\"l\" alt=\"Edit filter\" />\n </button>\n </li>\n );\n })}\n </ul>\n {filters.length > 1 && (\n <footer class=\"ui-state\">\n <small class=\"insignificant\">\n <Plural\n value={filters.length}\n one=\"# filter\"\n other=\"# filters\"\n />\n </small>\n </footer>\n )}\n </>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader />\n </p>\n ) : uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Unable to load filters.</Trans>\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No filters yet.</Trans>\n </p>\n )}\n </main>\n </div>\n {!!showFiltersAddEditModal && (\n <Modal\n title={t`Add filter`}\n onClose={() => {\n setShowFiltersAddEditModal(false);\n }}\n >\n <FiltersAddEdit\n filter={showFiltersAddEditModal?.filter}\n onClose={(result) => {\n if (result.state === 'success') {\n reload();\n }\n setShowFiltersAddEditModal(false);\n }}\n />\n </Modal>\n )}\n </div>\n );\n}\n\nlet _id = 1;\nconst incID = () => _id++;\nfunction FiltersAddEdit({ filter, onClose }) {\n const { _ } = useLingui();\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const editMode = !!filter;\n const { context, expiresAt, id, keywords, title, filterAction } =\n filter || {};\n const hasExpiry = !!expiresAt;\n const expiresAtDate = hasExpiry && new Date(expiresAt);\n const [editKeywords, setEditKeywords] = useState(keywords || []);\n const keywordsRef = useRef();\n\n // Hacky way of handling removed keywords for both existing and new ones\n const [removedKeywordIDs, setRemovedKeywordIDs] = useState([]);\n const [removedKeyword_IDs, setRemovedKeyword_IDs] = useState([]);\n\n const filteredEditKeywords = editKeywords.filter(\n (k) =>\n !removedKeywordIDs.includes(k.id) && !removedKeyword_IDs.includes(k._id),\n );\n\n return (\n <div class=\"sheet\" id=\"filters-add-edit-modal\">\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>{editMode ? t`Edit filter` : t`New filter`}</h2>\n </header>\n <main>\n <form\n onSubmit={(e) => {\n e.preventDefault();\n const formData = new FormData(e.target);\n const title = formData.get('title');\n const keywordIDs = formData.getAll('keyword_attributes[][id]');\n const keywordKeywords = formData.getAll(\n 'keyword_attributes[][keyword]',\n );\n // const keywordWholeWords = formData.getAll(\n // 'keyword_attributes[][whole_word]',\n // );\n // Not using getAll because it skips the empty checkboxes\n const keywordWholeWords = [\n ...keywordsRef.current.querySelectorAll(\n 'input[name=\"keyword_attributes[][whole_word]\"]',\n ),\n ].map((i) => i.checked);\n const keywordsAttributes = keywordKeywords.map((k, i) => ({\n id: keywordIDs[i] || undefined,\n keyword: k,\n wholeWord: keywordWholeWords[i],\n }));\n // if (editMode && keywords?.length) {\n // // Find which one got deleted and add to keywordsAttributes\n // keywords.forEach((k) => {\n // if (!keywordsAttributes.find((ka) => ka.id === k.id)) {\n // keywordsAttributes.push({\n // ...k,\n // _destroy: true,\n // });\n // }\n // });\n // }\n if (editMode && removedKeywordIDs?.length) {\n removedKeywordIDs.forEach((id) => {\n keywordsAttributes.push({\n id,\n _destroy: true,\n });\n });\n }\n const context = formData.getAll('context');\n let expiresIn = formData.get('expires_in');\n const filterAction = formData.get('filter_action');\n console.log({\n title,\n keywordIDs,\n keywords: keywordKeywords,\n wholeWords: keywordWholeWords,\n keywordsAttributes,\n context,\n expiresIn,\n filterAction,\n });\n\n // Required fields\n if (!title || !context?.length) {\n return;\n }\n\n setUIState('loading');\n\n (async () => {\n try {\n let filterResult;\n\n if (editMode) {\n if (expiresIn === '' || expiresIn === null) {\n // No value\n // Preserve existing expiry if not specified\n // Seconds from now to expiresAtDate\n // Other clients don't do this\n if (hasExpiry) {\n expiresIn = Math.floor(\n (expiresAtDate - new Date()) / 1000,\n );\n } else {\n expiresIn = null;\n }\n } else if (expiresIn === '0' || expiresIn === 0) {\n // 0 = Never\n expiresIn = null;\n } else {\n expiresIn = +expiresIn;\n }\n filterResult = await masto.v2.filters.$select(id).update({\n title,\n context,\n expiresIn,\n keywordsAttributes,\n filterAction,\n });\n } else {\n expiresIn = +expiresIn || null;\n filterResult = await masto.v2.filters.create({\n title,\n context,\n expiresIn,\n keywordsAttributes,\n filterAction,\n });\n }\n console.log({ filterResult });\n setUIState('default');\n onClose?.({\n state: 'success',\n filter: filterResult,\n });\n } catch (error) {\n console.error(error);\n setUIState('error');\n alert(\n editMode\n ? t`Unable to edit filter`\n : t`Unable to create filter`,\n );\n }\n })();\n }}\n >\n <div class=\"filter-form-row\">\n <label>\n <b>\n <Trans>Title</Trans>\n </b>\n <input\n type=\"text\"\n name=\"title\"\n defaultValue={title}\n disabled={uiState === 'loading'}\n dir=\"auto\"\n required\n />\n </label>\n </div>\n <div class=\"filter-form-keywords\" ref={keywordsRef}>\n {filteredEditKeywords.length ? (\n <ul class=\"filter-keywords\">\n {filteredEditKeywords.map((k) => {\n const { id, keyword, wholeWord, _id } = k;\n return (\n <li key={`${id}-${_id}`}>\n <input\n type=\"hidden\"\n name=\"keyword_attributes[][id]\"\n value={id}\n />\n <input\n name=\"keyword_attributes[][keyword]\"\n type=\"text\"\n defaultValue={keyword}\n disabled={uiState === 'loading'}\n required\n dir=\"auto\"\n />\n <div class=\"filter-keyword-actions\">\n <label>\n <input\n name=\"keyword_attributes[][whole_word]\"\n type=\"checkbox\"\n value={id} // Hacky way to map checkbox boolean to the keyword id\n defaultChecked={wholeWord}\n disabled={uiState === 'loading'}\n />{' '}\n <Trans>Whole word</Trans>\n </label>\n <button\n type=\"button\"\n class=\"light danger small\"\n disabled={uiState === 'loading'}\n onClick={() => {\n if (id) {\n removedKeywordIDs.push(id);\n setRemovedKeywordIDs([...removedKeywordIDs]);\n } else if (_id) {\n removedKeyword_IDs.push(_id);\n setRemovedKeyword_IDs([...removedKeyword_IDs]);\n }\n }}\n >\n <Icon icon=\"x\" alt={t`Remove`} />\n </button>\n </div>\n </li>\n );\n })}\n </ul>\n ) : (\n <div class=\"filter-keywords\">\n <div class=\"insignificant\">\n <Trans>No keywords. Add one.</Trans>\n </div>\n </div>\n )}\n <footer class=\"filter-keywords-footer\">\n <button\n type=\"button\"\n class=\"light\"\n onClick={() => {\n setEditKeywords([\n ...editKeywords,\n {\n _id: incID(),\n keyword: '',\n wholeWord: true,\n },\n ]);\n setTimeout(() => {\n // Focus last input\n const fields =\n keywordsRef.current.querySelectorAll(\n 'input[type=\"text\"]',\n );\n fields[fields.length - 1]?.focus?.();\n }, 10);\n }}\n >\n <Trans>Add keyword</Trans>\n </button>{' '}\n {filteredEditKeywords?.length > 1 && (\n <small class=\"insignificant\">\n <Plural\n value={filteredEditKeywords.length}\n one=\"# keyword\"\n other=\"# keywords\"\n />\n </small>\n )}\n </footer>\n </div>\n <div class=\"filter-form-cols\">\n <div class=\"filter-form-col\">\n <div>\n <b>\n <Trans>Filter from…</Trans>\n </b>\n </div>\n {FILTER_CONTEXT.map((ctx) => (\n <div>\n <label\n class={\n FILTER_CONTEXT_UNIMPLEMENTED.includes(ctx)\n ? 'insignificant'\n : ''\n }\n >\n <input\n type=\"checkbox\"\n name=\"context\"\n value={ctx}\n defaultChecked={!!context ? context.includes(ctx) : true}\n disabled={uiState === 'loading'}\n />{' '}\n {_(FILTER_CONTEXT_LABELS[ctx])}\n {FILTER_CONTEXT_UNIMPLEMENTED.includes(ctx) ? '*' : ''}\n </label>{' '}\n </div>\n ))}\n <p>\n <small class=\"insignificant\">\n <Trans>* Not implemented yet</Trans>\n </small>\n </p>\n </div>\n <div class=\"filter-form-col\">\n {editMode && (\n <Trans>\n Status:{' '}\n <b>\n <ExpiryStatus expiresAt={expiresAt} showNeverExpires />\n </b>\n </Trans>\n )}\n <div>\n <label for=\"filters-expires_in\">\n {editMode ? t`Change expiry` : t`Expiry`}\n </label>\n <select\n id=\"filters-expires_in\"\n name=\"expires_in\"\n disabled={uiState === 'loading'}\n defaultValue={editMode ? undefined : 0}\n >\n {editMode && <option></option>}\n {EXPIRY_DURATIONS.map((v) => (\n <option value={v}>\n {typeof EXPIRY_DURATIONS_LABELS[v] === 'function'\n ? EXPIRY_DURATIONS_LABELS[v]()\n : _(EXPIRY_DURATIONS_LABELS[v])}\n </option>\n ))}\n </select>\n </div>\n <p>\n <Trans>Filtered post will be…</Trans>\n <br />\n <label class=\"ib\">\n <input\n type=\"radio\"\n name=\"filter_action\"\n value=\"warn\"\n defaultChecked={filterAction === 'warn' || !editMode}\n disabled={uiState === 'loading'}\n />{' '}\n <Trans>minimized</Trans>\n </label>{' '}\n <label class=\"ib\">\n <input\n type=\"radio\"\n name=\"filter_action\"\n value=\"hide\"\n defaultChecked={filterAction === 'hide'}\n disabled={uiState === 'loading'}\n />{' '}\n <Trans>hidden</Trans>\n </label>\n </p>\n </div>\n </div>\n <footer class=\"filter-form-footer\">\n <span>\n <button type=\"submit\" disabled={uiState === 'loading'}>\n {editMode ? t`Save` : t`Create`}\n </button>{' '}\n <Loader abrupt hidden={uiState !== 'loading'} />\n </span>\n {editMode && (\n <MenuConfirm\n disabled={uiState === 'loading'}\n align=\"end\"\n menuItemClassName=\"danger\"\n confirmLabel={t`Delete this filter?`}\n onClick={() => {\n setUIState('loading');\n (async () => {\n try {\n await masto.v2.filters.$select(id).remove();\n setUIState('default');\n onClose?.({\n state: 'success',\n });\n } catch (e) {\n console.error(e);\n setUIState('error');\n alert(t`Unable to delete filter.`);\n }\n })();\n }}\n >\n <button\n type=\"button\"\n class=\"light danger\"\n onClick={() => {}}\n disabled={uiState === 'loading'}\n >\n <Trans>Delete…</Trans>\n </button>\n </MenuConfirm>\n )}\n </footer>\n </form>\n </main>\n </div>\n );\n}\n\nfunction ExpiryStatus({ expiresAt, showNeverExpires }) {\n const hasExpiry = !!expiresAt;\n const expiresAtDate = hasExpiry && new Date(expiresAt);\n const expired = hasExpiry && expiresAtDate <= new Date();\n\n // If less than a minute left, re-render interval every second, else every minute\n const [_, rerender] = useReducer((c) => c + 1, 0);\n useInterval(rerender, expired || 30_000);\n\n return expired ? (\n t`Expired`\n ) : hasExpiry ? (\n <Trans>\n Expiring <RelativeTime datetime={expiresAtDate} />\n </Trans>\n ) : (\n showNeverExpires && t`Never expires`\n );\n}\n\nexport default Filters;\n","import { Plural, t, Trans } from '@lingui/macro';\nimport { useEffect, useState } from 'preact/hooks';\n\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport NavMenu from '../components/nav-menu';\nimport { api } from '../utils/api';\nimport { fetchFollowedTags } from '../utils/followed-tags';\nimport useTitle from '../utils/useTitle';\n\nfunction FollowedHashtags() {\n const { masto, instance } = api();\n useTitle(t`Followed Hashtags`, `/fh`);\n const [uiState, setUIState] = useState('default');\n\n const [followedHashtags, setFollowedHashtags] = useState([]);\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const tags = await fetchFollowedTags();\n setFollowedHashtags(tags);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, []);\n\n return (\n <div id=\"followed-hashtags-page\" class=\"deck-container\" tabIndex=\"-1\">\n <div class=\"timeline-deck deck\">\n <header>\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n <Link to=\"/\" class=\"button plain\">\n <Icon icon=\"home\" size=\"l\" alt={t`Home`} />\n </Link>\n </div>\n <h1>\n <Trans>Followed Hashtags</Trans>\n </h1>\n <div class=\"header-side\" />\n </div>\n </header>\n <main>\n {followedHashtags.length > 0 ? (\n <>\n <ul class=\"link-list\">\n {followedHashtags.map((tag) => (\n <li>\n <Link\n to={\n instance\n ? `/${instance}/t/${tag.name}`\n : `/t/${tag.name}`\n }\n >\n <Icon icon=\"hashtag\" alt=\"#\" /> <span>{tag.name}</span>\n </Link>\n </li>\n ))}\n </ul>\n {followedHashtags.length > 1 && (\n <footer class=\"ui-state\">\n <small class=\"insignificant\">\n <Plural\n value={followedHashtags.length}\n one=\"# hashtag\"\n other=\"# hashtags\"\n />\n </small>\n </footer>\n )}\n </>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Unable to load followed hashtags.</Trans>\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No hashtags followed yet.</Trans>\n </p>\n )}\n </main>\n </div>\n </div>\n );\n}\n\nexport default FollowedHashtags;\n","import { t, Trans } from '@lingui/macro';\nimport { useEffect, useRef } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { filteredItems } from '../utils/filters';\nimport states, { getStatus, saveStatus } from '../utils/states';\nimport supports from '../utils/supports';\nimport {\n assignFollowedTags,\n clearFollowedTagsState,\n dedupeBoosts,\n} from '../utils/timeline-utils';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\nfunction Following({ title, path, id, ...props }) {\n useTitle(\n title ||\n t({\n id: 'following.title',\n message: 'Following',\n }),\n path || '/following',\n );\n const { masto, streaming, instance } = api();\n const snapStates = useSnapshot(states);\n const homeIterator = useRef();\n const latestItem = useRef();\n __BENCHMARK.end('time-to-following');\n\n console.debug('RENDER Following', title, id);\n const supportsPixelfed = supports('@pixelfed/home-include-reblogs');\n\n async function fetchHome(firstLoad) {\n if (firstLoad || !homeIterator.current) {\n __BENCHMARK.start('fetch-home-first');\n homeIterator.current = masto.v1.timelines.home.list({ limit: LIMIT });\n }\n if (supportsPixelfed && homeIterator.current?.nextParams) {\n if (typeof homeIterator.current.nextParams === 'string') {\n homeIterator.current.nextParams += '&include_reblogs=true';\n } else {\n homeIterator.current.nextParams.include_reblogs = true;\n }\n }\n const results = await homeIterator.current.next();\n let { value } = results;\n if (value?.length) {\n let latestItemChanged = false;\n if (firstLoad) {\n if (value[0].id !== latestItem.current) {\n latestItemChanged = true;\n }\n latestItem.current = value[0].id;\n console.log('First load', latestItem.current);\n }\n\n // value = filteredItems(value, 'home');\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n value = dedupeBoosts(value, instance);\n if (firstLoad && latestItemChanged) clearFollowedTagsState();\n assignFollowedTags(value, instance);\n\n // ENFORCE sort by datetime (Latest first)\n value.sort((a, b) => {\n const aDate = new Date(a.createdAt);\n const bDate = new Date(b.createdAt);\n return bDate - aDate;\n });\n }\n __BENCHMARK.end('fetch-home-first');\n return {\n ...results,\n value,\n };\n }\n\n async function checkForUpdates() {\n try {\n const opts = {\n limit: 5,\n since_id: latestItem.current,\n };\n if (supports('@pixelfed/home-include-reblogs')) {\n opts.include_reblogs = true;\n }\n const results = await masto.v1.timelines.home.list(opts).next();\n let { value } = results;\n console.log('checkForUpdates', latestItem.current, value);\n const valueContainsLatestItem = value[0]?.id === latestItem.current; // since_id might not be supported\n if (value?.length && !valueContainsLatestItem) {\n latestItem.current = value[0].id;\n value = dedupeBoosts(value, instance);\n value = filteredItems(value, 'home');\n if (value.some((item) => !item.reblog)) {\n return true;\n }\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n\n useEffect(() => {\n let sub;\n (async () => {\n if (streaming) {\n sub = streaming.user.subscribe();\n console.log('🎏 Streaming user', sub);\n for await (const entry of sub) {\n if (!sub) break;\n if (entry.event === 'status.update') {\n const status = entry.payload;\n console.log(`🔄 Status ${status.id} updated`);\n saveStatus(status, instance);\n } else if (entry.event === 'delete') {\n const statusID = entry.payload;\n console.log(`❌ Status ${statusID} deleted`);\n // delete states.statuses[statusID];\n const s = getStatus(statusID, instance);\n if (s) s._deleted = true;\n }\n }\n console.log('💥 Streaming user loop STOPPED');\n }\n })();\n return () => {\n sub?.unsubscribe?.();\n sub = null;\n };\n }, [streaming]);\n\n return (\n <Timeline\n title={title || t({ id: 'following.title', message: 'Following' })}\n id={id || 'following'}\n emptyText={t`Nothing to see here.`}\n errorText={t`Unable to load posts.`}\n instance={instance}\n fetchItems={fetchHome}\n checkForUpdates={checkForUpdates}\n useItemID\n boostsCarousel={snapStates.settings.boostsCarousel}\n {...props}\n // allowFilters\n filterContext=\"home\"\n showFollowedTags\n showReplyParent\n />\n );\n}\n\nexport default Following;\n","import { plural, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport {\n FocusableItem,\n MenuDivider,\n MenuGroup,\n MenuHeader,\n MenuItem,\n} from '@szhsin/react-menu';\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport { useNavigate, useParams, useSearchParams } from 'react-router-dom';\n\nimport Icon from '../components/icon';\nimport MenuConfirm from '../components/menu-confirm';\nimport Menu2 from '../components/menu2';\nimport { SHORTCUTS_LIMIT } from '../components/shortcuts-settings';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { filteredItems } from '../utils/filters';\nimport showToast from '../utils/show-toast';\nimport states, { saveStatus } from '../utils/states';\nimport { isMediaFirstInstance } from '../utils/store-utils';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\n// Limit is 4 per \"mode\"\n// https://github.com/mastodon/mastodon/issues/15194\n// Hard-coded https://github.com/mastodon/mastodon/blob/19614ba2477f3d12468f5ec251ce1cc5f8c6210c/app/models/tag_feed.rb#L4\nconst TAGS_LIMIT_PER_MODE = 4;\nconst TOTAL_TAGS_LIMIT = TAGS_LIMIT_PER_MODE + 1;\n\nfunction Hashtags({ media: mediaView, columnMode, ...props }) {\n // const navigate = useNavigate();\n let { hashtag, ...params } = columnMode ? {} : useParams();\n if (props.hashtag) hashtag = props.hashtag;\n let hashtags = hashtag.trim().split(/[\\s+]+/);\n hashtags.sort();\n hashtag = hashtags[0];\n const [searchParams, setSearchParams] = useSearchParams();\n const media = mediaView || !!searchParams.get('media');\n const linkParams = media ? '?media=1' : '';\n\n const { masto, instance, authenticated } = api({\n instance: props?.instance || params.instance,\n });\n const {\n masto: currentMasto,\n instance: currentInstance,\n authenticated: currentAuthenticated,\n } = api();\n const hashtagTitle = hashtags.map((t) => `#${t}`).join(' ');\n const title = instance\n ? media\n ? t`${hashtagTitle} (Media only) on ${instance}`\n : t`${hashtagTitle} on ${instance}`\n : media\n ? t`${hashtagTitle} (Media only)`\n : t`${hashtagTitle}`;\n useTitle(title, `/:instance?/t/:hashtag`);\n const latestItem = useRef();\n\n const mediaFirst = useMemo(() => isMediaFirstInstance(), []);\n\n // const hashtagsIterator = useRef();\n const maxID = useRef(undefined);\n async function fetchHashtags(firstLoad) {\n // if (firstLoad || !hashtagsIterator.current) {\n // hashtagsIterator.current = masto.v1.timelines.tag.$select(hashtag).list({\n // limit: LIMIT,\n // any: hashtags.slice(1),\n // });\n // }\n // const results = await hashtagsIterator.current.next();\n\n // NOTE: Temporary fix for listHashtag not persisting `any` in subsequent calls.\n const results = await masto.v1.timelines.tag\n .$select(hashtag)\n .list({\n limit: LIMIT,\n any: hashtags.slice(1),\n maxId: firstLoad ? undefined : maxID.current,\n onlyMedia: media ? true : undefined,\n })\n .next();\n let { value } = results;\n if (value?.length) {\n if (firstLoad) {\n latestItem.current = value[0].id;\n }\n\n // value = filteredItems(value, 'public');\n value.forEach((item) => {\n saveStatus(item, instance, {\n skipThreading: media || mediaFirst, // If media view, no need to form threads\n });\n });\n\n maxID.current = value[value.length - 1].id;\n }\n return {\n ...results,\n value,\n };\n }\n\n async function checkForUpdates() {\n try {\n const results = await masto.v1.timelines.tag\n .$select(hashtag)\n .list({\n limit: 1,\n any: hashtags.slice(1),\n since_id: latestItem.current,\n onlyMedia: media,\n })\n .next();\n let { value } = results;\n const valueContainsLatestItem = value[0]?.id === latestItem.current; // since_id might not be supported\n if (value?.length && !valueContainsLatestItem) {\n value = filteredItems(value, 'public');\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n\n const [followUIState, setFollowUIState] = useState('default');\n const [info, setInfo] = useState();\n // Get hashtag info\n useEffect(() => {\n (async () => {\n try {\n const info = await masto.v1.tags.$select(hashtag).fetch();\n console.log(info);\n setInfo(info);\n } catch (e) {\n console.error(e);\n }\n })();\n }, [hashtag]);\n\n const reachLimit = hashtags.length >= TOTAL_TAGS_LIMIT;\n\n const [featuredUIState, setFeaturedUIState] = useState('default');\n const [featuredTags, setFeaturedTags] = useState([]);\n const [isFeaturedTag, setIsFeaturedTag] = useState(false);\n useEffect(() => {\n if (!authenticated) return;\n (async () => {\n try {\n const featuredTags = await masto.v1.featuredTags.list();\n setFeaturedTags(featuredTags);\n setIsFeaturedTag(\n featuredTags.some(\n (tag) => tag.name.toLowerCase() === hashtag.toLowerCase(),\n ),\n );\n } catch (e) {\n console.error(e);\n }\n })();\n }, []);\n\n return (\n <Timeline\n key={instance + hashtagTitle}\n title={title}\n titleComponent={\n !!instance && (\n <h1 class=\"header-double-lines\">\n <b dir=\"auto\">{hashtagTitle}</b>\n <div>{instance}</div>\n </h1>\n )\n }\n id=\"hashtag\"\n instance={instance}\n emptyText={t`No one has posted anything with this tag yet.`}\n errorText={t`Unable to load posts with this tag`}\n fetchItems={fetchHashtags}\n checkForUpdates={checkForUpdates}\n useItemID\n view={media || mediaFirst ? 'media' : undefined}\n refresh={media}\n // allowFilters\n filterContext=\"public\"\n headerEnd={\n <Menu2\n portal\n setDownOverflow\n overflow=\"auto\"\n // viewScroll=\"close\"\n position=\"anchor\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n {!!info && hashtags.length === 1 && (\n <>\n <MenuConfirm\n subMenu\n confirm={info.following}\n confirmLabel={t`Unfollow #${hashtag}?`}\n disabled={followUIState === 'loading' || !authenticated}\n onClick={() => {\n setFollowUIState('loading');\n if (info.following) {\n // const yes = confirm(`Unfollow #${hashtag}?`);\n // if (!yes) {\n // setFollowUIState('default');\n // return;\n // }\n masto.v1.tags\n .$select(hashtag)\n .unfollow()\n .then(() => {\n setInfo({ ...info, following: false });\n showToast(t`Unfollowed #${hashtag}`);\n })\n .catch((e) => {\n alert(e);\n console.error(e);\n })\n .finally(() => {\n setFollowUIState('default');\n });\n } else {\n masto.v1.tags\n .$select(hashtag)\n .follow()\n .then(() => {\n setInfo({ ...info, following: true });\n showToast(t`Followed #${hashtag}`);\n })\n .catch((e) => {\n alert(e);\n console.error(e);\n })\n .finally(() => {\n setFollowUIState('default');\n });\n }\n }}\n >\n {info.following ? (\n <>\n <Icon icon=\"check-circle\" />{' '}\n <span>\n <Trans>Following…</Trans>\n </span>\n </>\n ) : (\n <>\n <Icon icon=\"plus\" />{' '}\n <span>\n <Trans>Follow</Trans>\n </span>\n </>\n )}\n </MenuConfirm>\n <MenuItem\n type=\"checkbox\"\n checked={isFeaturedTag}\n disabled={featuredUIState === 'loading' || !authenticated}\n onClick={() => {\n setFeaturedUIState('loading');\n if (isFeaturedTag) {\n const featuredTagID = featuredTags.find(\n (tag) => tag.name.toLowerCase() === hashtag.toLowerCase(),\n ).id;\n if (featuredTagID) {\n masto.v1.featuredTags\n .$select(featuredTagID)\n .remove()\n .then(() => {\n setIsFeaturedTag(false);\n showToast(t`Unfeatured on profile`);\n setFeaturedTags(\n featuredTags.filter(\n (tag) => tag.id !== featuredTagID,\n ),\n );\n })\n .catch((e) => {\n console.error(e);\n })\n .finally(() => {\n setFeaturedUIState('default');\n });\n } else {\n showToast(t`Unable to unfeature on profile`);\n }\n } else {\n masto.v1.featuredTags\n .create({\n name: hashtag,\n })\n .then((value) => {\n setIsFeaturedTag(true);\n showToast(t`Featured on profile`);\n setFeaturedTags(featuredTags.concat(value));\n })\n .catch((e) => {\n console.error(e);\n })\n .finally(() => {\n setFeaturedUIState('default');\n });\n }\n }}\n >\n {isFeaturedTag ? (\n <>\n <Icon icon=\"check-circle\" />\n <span>\n <Trans>Featured on profile</Trans>\n </span>\n </>\n ) : (\n <>\n <Icon icon=\"check-circle\" />\n <span>\n <Trans>Feature on profile</Trans>\n </span>\n </>\n )}\n </MenuItem>\n <MenuDivider />\n </>\n )}\n {!mediaFirst && (\n <>\n <MenuHeader className=\"plain\">\n <Trans>Filters</Trans>\n </MenuHeader>\n <MenuItem\n type=\"checkbox\"\n checked={!!media}\n onClick={() => {\n if (media) {\n searchParams.delete('media');\n } else {\n searchParams.set('media', '1');\n }\n setSearchParams(searchParams);\n }}\n >\n <Icon icon=\"check-circle\" alt=\"☑️\" />{' '}\n <span class=\"menu-grow\">\n <Trans>Media only</Trans>\n </span>\n </MenuItem>\n <MenuDivider />\n </>\n )}\n <FocusableItem className=\"menu-field\" disabled={reachLimit}>\n {({ ref }) => (\n <form\n onSubmit={(e) => {\n e.preventDefault();\n const newHashtag = e.target[0].value?.trim?.();\n // Use includes but need to be case insensitive\n if (\n newHashtag &&\n !hashtags.some(\n (t) => t.toLowerCase() === newHashtag.toLowerCase(),\n )\n ) {\n hashtags.push(newHashtag);\n hashtags.sort();\n // navigate(\n // instance\n // ? `/${instance}/t/${hashtags.join('+')}`\n // : `/t/${hashtags.join('+')}`,\n // );\n location.hash = instance\n ? `/${instance}/t/${hashtags.join('+')}`\n : `/t/${hashtags.join('+')}${linkParams}`;\n }\n }}\n >\n <Icon icon=\"hashtag\" />\n <input\n ref={ref}\n type=\"text\"\n placeholder={\n reachLimit\n ? plural(TOTAL_TAGS_LIMIT, {\n other: 'Max # tags',\n })\n : t`Add hashtag`\n }\n required\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellCheck={false}\n // no spaces, no hashtags\n pattern=\"[^#][^\\s#]+[^#]\"\n disabled={reachLimit}\n dir=\"auto\"\n />\n </form>\n )}\n </FocusableItem>\n <MenuGroup takeOverflow>\n {hashtags.map((tag, i) => (\n <MenuItem\n key={tag}\n disabled={hashtags.length === 1}\n onClick={(e) => {\n hashtags.splice(i, 1);\n hashtags.sort();\n // navigate(\n // instance\n // ? `/${instance}/t/${hashtags.join('+')}`\n // : `/t/${hashtags.join('+')}`,\n // );\n location.hash = instance\n ? `/${instance}/t/${hashtags.join('+')}${linkParams}`\n : `/t/${hashtags.join('+')}${linkParams}`;\n }}\n >\n <Icon icon=\"x\" alt={t`Remove hashtag`} class=\"danger-icon\" />\n <span class=\"bidi-isolate\">\n <span class=\"more-insignificant\">#</span>\n {tag}\n </span>\n </MenuItem>\n ))}\n </MenuGroup>\n <MenuDivider />\n <MenuItem\n disabled={!currentAuthenticated}\n onClick={() => {\n if (states.shortcuts.length >= SHORTCUTS_LIMIT) {\n alert(\n plural(SHORTCUTS_LIMIT, {\n one: 'Max # shortcut reached. Unable to add shortcut.',\n other: 'Max # shortcuts reached. Unable to add shortcut.',\n }),\n );\n return;\n }\n const shortcut = {\n type: 'hashtag',\n hashtag: hashtags.join(' '),\n instance,\n media: media ? 'on' : undefined,\n };\n // Check if already exists\n const exists = states.shortcuts.some(\n (s) =>\n s.type === shortcut.type &&\n s.hashtag\n .split(/[\\s+]+/)\n .sort()\n .join(' ') ===\n shortcut.hashtag\n .split(/[\\s+]+/)\n .sort()\n .join(' ') &&\n (s.instance ? s.instance === shortcut.instance : true) &&\n (s.media ? !!s.media === !!shortcut.media : true),\n );\n if (exists) {\n alert(t`This shortcut already exists`);\n } else {\n states.shortcuts.push(shortcut);\n showToast(t`Hashtag shortcut added`);\n }\n }}\n >\n <Icon icon=\"shortcut\" />{' '}\n <span>\n <Trans>Add to Shortcuts</Trans>\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n let newInstance = prompt(\n t`Enter a new instance e.g. \"mastodon.social\"`,\n );\n if (!/\\./.test(newInstance)) {\n if (newInstance) alert(t`Invalid instance`);\n return;\n }\n if (newInstance) {\n newInstance = newInstance.toLowerCase().trim();\n // navigate(`/${newInstance}/t/${hashtags.join('+')}`);\n location.hash = `/${newInstance}/t/${hashtags.join(\n '+',\n )}${linkParams}`;\n }\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <span>\n <Trans>Go to another instance…</Trans>\n </span>\n </MenuItem>\n {currentInstance !== instance && (\n <MenuItem\n onClick={() => {\n location.hash = `/${currentInstance}/t/${hashtags.join(\n '+',\n )}${linkParams}`;\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <small class=\"menu-double-lines\">\n <Trans>\n Go to my instance (<b>{currentInstance}</b>)\n </Trans>\n </small>\n </MenuItem>\n )}\n </Menu2>\n }\n />\n );\n}\n\nexport default Hashtags;\n","import './lists.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { Menu, MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { InView } from 'react-intersection-observer';\nimport { useNavigate, useParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport AccountBlock from '../components/account-block';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport ListAddEdit from '../components/list-add-edit';\nimport MenuConfirm from '../components/menu-confirm';\nimport MenuLink from '../components/menu-link';\nimport Menu2 from '../components/menu2';\nimport Modal from '../components/modal';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { filteredItems } from '../utils/filters';\nimport { getList, getLists } from '../utils/lists';\nimport states, { saveStatus } from '../utils/states';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\nfunction List(props) {\n const snapStates = useSnapshot(states);\n const { masto, instance } = api();\n const id = props?.id || useParams()?.id;\n // const navigate = useNavigate();\n const latestItem = useRef();\n // const [reloadCount, reload] = useReducer((c) => c + 1, 0);\n\n const listIterator = useRef();\n async function fetchList(firstLoad) {\n if (firstLoad || !listIterator.current) {\n listIterator.current = masto.v1.timelines.list.$select(id).list({\n limit: LIMIT,\n });\n }\n const results = await listIterator.current.next();\n let { value } = results;\n if (value?.length) {\n if (firstLoad) {\n latestItem.current = value[0].id;\n }\n\n // value = filteredItems(value, 'home');\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n }\n return {\n ...results,\n value,\n };\n }\n\n async function checkForUpdates() {\n try {\n const results = await masto.v1.timelines.list.$select(id).list({\n limit: 1,\n since_id: latestItem.current,\n });\n let { value } = results;\n const valueContainsLatestItem = value[0]?.id === latestItem.current; // since_id might not be supported\n if (value?.length && !valueContainsLatestItem) {\n value = filteredItems(value, 'home');\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n\n const [lists, setLists] = useState([]);\n useEffect(() => {\n getLists().then(setLists);\n }, []);\n\n const [list, setList] = useState({ title: 'List' });\n // const [title, setTitle] = useState(`List`);\n useTitle(list.title, `/l/:id`);\n useEffect(() => {\n (async () => {\n try {\n const list = await getList(id);\n setList(list);\n // setTitle(list.title);\n } catch (e) {\n console.error(e);\n }\n })();\n }, [id]);\n\n const [showListAddEditModal, setShowListAddEditModal] = useState(false);\n const [showManageMembersModal, setShowManageMembersModal] = useState(false);\n\n return (\n <>\n <Timeline\n key={id}\n title={list.title}\n id=\"list\"\n emptyText={t`Nothing yet.`}\n errorText={t`Unable to load posts.`}\n instance={instance}\n fetchItems={fetchList}\n checkForUpdates={checkForUpdates}\n useItemID\n boostsCarousel={snapStates.settings.boostsCarousel}\n // allowFilters\n filterContext=\"home\"\n showReplyParent\n // refresh={reloadCount}\n headerStart={\n // <Link to=\"/l\" class=\"button plain\">\n // <Icon icon=\"list\" size=\"l\" />\n // </Link>\n <Menu2\n overflow=\"auto\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"list\" size=\"l\" alt={t`Lists`} />\n <Icon icon=\"chevron-down\" size=\"s\" />\n </button>\n }\n >\n <MenuLink to=\"/l\">\n <span>\n <Trans>All Lists</Trans>\n </span>\n </MenuLink>\n {lists?.length > 0 && (\n <>\n <MenuDivider />\n {lists.map((list) => (\n <MenuLink key={list.id} to={`/l/${list.id}`}>\n <span>{list.title}</span>\n </MenuLink>\n ))}\n </>\n )}\n </Menu2>\n }\n headerEnd={\n <Menu2\n portal\n setDownOverflow\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n <MenuItem\n onClick={() =>\n setShowListAddEditModal({\n list,\n })\n }\n >\n <Icon icon=\"pencil\" size=\"l\" />\n <span>\n <Trans>Edit</Trans>\n </span>\n </MenuItem>\n <MenuItem onClick={() => setShowManageMembersModal(true)}>\n <Icon icon=\"group\" size=\"l\" />\n <span>\n <Trans>Manage members</Trans>\n </span>\n </MenuItem>\n </Menu2>\n }\n />\n {showListAddEditModal && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowListAddEditModal(false);\n }\n }}\n >\n <ListAddEdit\n list={showListAddEditModal?.list}\n onClose={(result) => {\n if (result.state === 'success' && result.list) {\n setList(result.list);\n // reload();\n } else if (result.state === 'deleted') {\n // navigate('/l');\n location.hash = '/l';\n }\n setShowListAddEditModal(false);\n }}\n />\n </Modal>\n )}\n {showManageMembersModal && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowManageMembersModal(false);\n }\n }}\n >\n <ListManageMembers\n listID={id}\n onClose={() => setShowManageMembersModal(false)}\n />\n </Modal>\n )}\n </>\n );\n}\n\nconst MEMBERS_LIMIT = 40;\nfunction ListManageMembers({ listID, onClose }) {\n // Show list of members with [Remove] button\n // API only returns 40 members at a time, so this need to be paginated with infinite scroll\n // Show [Add] button after removing a member\n const { masto, instance } = api();\n const [members, setMembers] = useState([]);\n const [uiState, setUIState] = useState('default');\n const [showMore, setShowMore] = useState(false);\n\n const membersIterator = useRef();\n\n async function fetchMembers(firstLoad) {\n setShowMore(false);\n setUIState('loading');\n (async () => {\n try {\n if (firstLoad || !membersIterator.current) {\n membersIterator.current = masto.v1.lists\n .$select(listID)\n .accounts.list({\n limit: MEMBERS_LIMIT,\n });\n }\n const results = await membersIterator.current.next();\n let { done, value } = results;\n if (value?.length) {\n if (firstLoad) {\n setMembers(value);\n } else {\n setMembers(members.concat(value));\n }\n setShowMore(!done);\n } else {\n setShowMore(false);\n }\n setUIState('default');\n } catch (e) {\n setUIState('error');\n }\n })();\n }\n\n useEffect(() => {\n fetchMembers(true);\n }, []);\n\n return (\n <div class=\"sheet\" id=\"list-manage-members-container\">\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>Manage members</Trans>\n </h2>\n </header>\n <main>\n <ul>\n {members.map((member) => (\n <li key={member.id}>\n <AccountBlock account={member} instance={instance} />\n <RemoveAddButton account={member} listID={listID} />\n </li>\n ))}\n {showMore && uiState === 'default' && (\n <InView as=\"li\" onChange={(inView) => inView && fetchMembers()}>\n <button type=\"button\" class=\"light block\" onClick={fetchMembers}>\n <Trans>Show more…</Trans>\n </button>\n </InView>\n )}\n </ul>\n </main>\n </div>\n );\n}\n\nfunction RemoveAddButton({ account, listID }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [removed, setRemoved] = useState(false);\n\n return (\n <MenuConfirm\n confirm={!removed}\n confirmLabel={\n <span>\n <Trans>\n Remove <span class=\"bidi-isolate\">@{account.username}</span> from\n list?\n </Trans>\n </span>\n }\n align=\"end\"\n menuItemClassName=\"danger\"\n onClick={() => {\n if (removed) {\n setUIState('loading');\n (async () => {\n try {\n await masto.v1.lists.$select(listID).accounts.create({\n accountIds: [account.id],\n });\n setUIState('default');\n setRemoved(false);\n } catch (e) {\n setUIState('error');\n }\n })();\n } else {\n // const yes = confirm(`Remove ${account.username} from this list?`);\n // if (!yes) return;\n setUIState('loading');\n\n (async () => {\n try {\n await masto.v1.lists.$select(listID).accounts.remove({\n accountIds: [account.id],\n });\n setUIState('default');\n setRemoved(true);\n } catch (e) {\n setUIState('error');\n }\n })();\n }\n }}\n >\n <button\n type=\"button\"\n class={`light ${removed ? '' : 'danger'}`}\n disabled={uiState === 'loading'}\n >\n {removed ? t`Add` : t`Remove…`}\n </button>\n </MenuConfirm>\n );\n}\n\nexport default List;\n","// This is like very lame \"type-checking\" lol\nconst notificationTypeKeys = {\n mention: ['account', 'status'],\n status: ['account', 'status'],\n reblog: ['account', 'status'],\n follow: ['account'],\n follow_request: ['account'],\n favourite: ['account', 'status'],\n poll: ['status'],\n update: ['status'],\n};\n\nconst GROUP_TYPES = ['favourite', 'reblog', 'follow'];\nconst groupable = (type) => GROUP_TYPES.includes(type);\n\nexport function fixNotifications(notifications) {\n return notifications.filter((notification) => {\n const { type, id, createdAt } = notification;\n if (!type) {\n console.warn('Notification missing type', notification);\n return false;\n }\n if (!id || !createdAt) {\n console.warn('Notification missing id or createdAt', notification);\n // Continue processing this despite missing id or createdAt\n }\n const keys = notificationTypeKeys[type];\n if (keys?.length) {\n return keys.every((key) => !!notification[key]);\n }\n return true; // skip other types\n });\n}\n\nexport function massageNotifications2(notifications) {\n if (notifications?.notificationGroups) {\n const {\n accounts = [],\n notificationGroups = [],\n statuses = [],\n } = notifications;\n return notificationGroups.map((group) => {\n const { sampleAccountIds, statusId } = group;\n const sampleAccounts =\n sampleAccountIds?.map((id) => accounts.find((a) => a.id === id)) || [];\n const status = statuses?.find((s) => s.id === statusId) || null;\n return {\n ...group,\n sampleAccounts,\n status,\n };\n });\n }\n return notifications;\n}\n\nexport function groupNotifications2(groupNotifications) {\n // Make grouped notifications to look like faux grouped notifications\n const newGroupNotifications = groupNotifications.map((gn) => {\n const {\n latestPageNotificationAt,\n mostRecentNotificationId,\n sampleAccounts,\n notificationsCount,\n } = gn;\n\n return {\n id: '' + mostRecentNotificationId,\n createdAt: latestPageNotificationAt,\n account: sampleAccounts[0],\n ...gn,\n };\n });\n\n // Merge favourited and reblogged of same status into a single notification\n // - new type: \"favourite+reblog\"\n // - sum numbers for `notificationsCount` and `sampleAccounts`\n const notificationsMap = {};\n const newGroupNotifications1 = [];\n for (let i = 0; i < newGroupNotifications.length; i++) {\n const gn = newGroupNotifications[i];\n const {\n type,\n status,\n createdAt,\n notificationsCount,\n sampleAccounts,\n groupKey,\n } = gn;\n const date = createdAt ? new Date(createdAt).toLocaleDateString() : '';\n let virtualType = type;\n // const sameCount =\n notificationsCount > 0 && notificationsCount === sampleAccounts?.length;\n // if (sameCount && (type === 'favourite' || type === 'reblog')) {\n if (type === 'favourite' || type === 'reblog') {\n virtualType = 'favourite+reblog';\n }\n // const key = `${status?.id}-${virtualType}-${date}-${sameCount ? 1 : 0}`;\n const key = `${status?.id}-${virtualType}-${date}`;\n const mappedNotification = notificationsMap[key];\n if (!groupable(type)) {\n newGroupNotifications1.push(gn);\n } else if (mappedNotification) {\n // Merge sampleAccounts + merge _types\n sampleAccounts.forEach((a) => {\n const mappedAccount = mappedNotification.sampleAccounts.find(\n (ma) => ma.id === a.id,\n );\n if (!mappedAccount) {\n mappedNotification.sampleAccounts.push({\n ...a,\n _types: [type],\n });\n } else {\n mappedAccount._types.push(type);\n mappedAccount._types.sort().reverse();\n }\n });\n // mappedNotification.notificationsCount =\n // mappedNotification.sampleAccounts.length;\n mappedNotification.notificationsCount = Math.min(\n mappedNotification.notificationsCount,\n notificationsCount,\n );\n mappedNotification._notificationsCount.push(notificationsCount);\n mappedNotification._accounts = mappedNotification.sampleAccounts;\n mappedNotification._groupKeys.push(groupKey);\n } else {\n const accounts = sampleAccounts.map((a) => ({\n ...a,\n _types: [type],\n }));\n notificationsMap[key] = {\n ...gn,\n sampleAccounts: accounts,\n type: virtualType,\n _accounts: accounts,\n _groupKeys: groupKey ? [groupKey] : [],\n _notificationsCount: [notificationsCount],\n };\n newGroupNotifications1.push(notificationsMap[key]);\n }\n }\n\n // 2nd pass.\n // - Group 1 account favourte/reblog multiple posts\n // - _statuses: [status, status, ...]\n const notificationsMap2 = {};\n const newGroupNotifications2 = [];\n for (let i = 0; i < newGroupNotifications1.length; i++) {\n const gn = newGroupNotifications1[i];\n const { type, account, _accounts, sampleAccounts, createdAt, groupKey } =\n gn;\n const date = createdAt ? new Date(createdAt).toLocaleDateString() : '';\n const hasOneAccount =\n sampleAccounts?.length === 1 || _accounts?.length === 1;\n if (\n (type === 'favourite' ||\n type === 'reblog' ||\n type === 'favourite+reblog') &&\n hasOneAccount\n ) {\n const key = `${account?.id}-${type}-${date}`;\n const mappedNotification = notificationsMap2[key];\n if (mappedNotification) {\n mappedNotification._statuses.push(gn.status);\n mappedNotification._ids += `-${gn.id}`;\n mappedNotification._groupKeys.push(groupKey);\n } else {\n let n = (notificationsMap2[key] = {\n ...gn,\n type,\n _ids: gn.id,\n _statuses: [gn.status],\n _groupKeys: groupKey ? [groupKey] : [],\n });\n newGroupNotifications2.push(n);\n }\n } else {\n newGroupNotifications2.push(gn);\n }\n }\n\n console.log('newGroupNotifications2', newGroupNotifications2);\n\n return newGroupNotifications2;\n}\n\nexport default function groupNotifications(notifications) {\n // Filter out invalid notifications\n notifications = fixNotifications(notifications);\n\n // Create new flat list of notifications\n // Combine sibling notifications based on type and status id\n // Concat all notification.account into an array of _accounts\n const notificationsMap = {};\n const cleanNotifications = [];\n for (let i = 0, j = 0; i < notifications.length; i++) {\n const notification = notifications[i];\n const { id, status, account, type, createdAt } = notification;\n const date = createdAt ? new Date(createdAt).toLocaleDateString() : '';\n let virtualType = type;\n if (type === 'favourite' || type === 'reblog') {\n virtualType = 'favourite+reblog';\n }\n const key = `${status?.id}-${virtualType}-${date}`;\n const mappedNotification = notificationsMap[key];\n if (!groupable(type)) {\n cleanNotifications[j++] = notification;\n } else if (mappedNotification?.account) {\n const mappedAccount = mappedNotification._accounts.find(\n (a) => a.id === account.id,\n );\n if (mappedAccount) {\n mappedAccount._types.push(type);\n mappedAccount._types.sort().reverse();\n mappedNotification._ids += `-${id}`;\n } else {\n account._types = [type];\n mappedNotification._accounts.push(account);\n mappedNotification._ids += `-${id}`;\n }\n } else {\n if (account) account._types = [type];\n let n = (notificationsMap[key] = {\n ...notification,\n type: virtualType,\n _ids: id,\n _accounts: account ? [account] : [],\n });\n cleanNotifications[j++] = n;\n }\n }\n\n // 2nd pass to group \"favourite+reblog\"-type notifications by account if _accounts.length <= 1\n // This means one acount has favourited and reblogged the multiple statuses\n // The grouped notification\n // - type: \"favourite+reblog+account\"\n // - _statuses: [status, status, ...]\n const notificationsMap2 = {};\n const cleanNotifications2 = [];\n for (let i = 0, j = 0; i < cleanNotifications.length; i++) {\n const notification = cleanNotifications[i];\n const { id, account, _accounts, type, createdAt } = notification;\n const date = createdAt ? new Date(createdAt).toLocaleDateString() : '';\n if (type === 'favourite+reblog' && account && _accounts.length === 1) {\n const key = `${account?.id}-${type}-${date}`;\n const mappedNotification = notificationsMap2[key];\n if (mappedNotification) {\n mappedNotification._statuses.push(notification.status);\n mappedNotification._ids += `-${id}`;\n } else {\n let n = (notificationsMap2[key] = {\n ...notification,\n type,\n _ids: id,\n _statuses: [notification.status],\n });\n cleanNotifications2[j++] = n;\n }\n } else {\n cleanNotifications2[j++] = notification;\n }\n }\n\n console.log({ notifications, cleanNotifications, cleanNotifications2 });\n\n // return cleanNotifications;\n return cleanNotifications2;\n}\n","import { t, Trans } from '@lingui/macro';\nimport { useMemo, useRef, useState } from 'preact/hooks';\nimport { useSearchParams } from 'react-router-dom';\n\nimport Link from '../components/link';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { fixNotifications } from '../utils/group-notifications';\nimport { saveStatus } from '../utils/states';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\nconst emptySearchParams = new URLSearchParams();\n\nfunction Mentions({ columnMode, ...props }) {\n const { masto, instance } = api();\n const [searchParams] = columnMode ? [emptySearchParams] : useSearchParams();\n const [stateType, setStateType] = useState(null);\n const type = props?.type || searchParams.get('type') || stateType;\n useTitle(type === 'private' ? t`Private mentions` : t`Mentions`, '/mentions');\n\n const mentionsIterator = useRef();\n const latestItem = useRef();\n\n async function fetchMentions(firstLoad) {\n if (firstLoad || !mentionsIterator.current) {\n mentionsIterator.current = masto.v1.notifications.list({\n limit: LIMIT,\n types: ['mention'],\n });\n }\n const results = await mentionsIterator.current.next();\n let { value } = results;\n if (value?.length) {\n value = fixNotifications(value);\n\n if (firstLoad) {\n latestItem.current = value[0].id;\n console.log('First load', latestItem.current);\n }\n\n value.forEach(({ status: item }) => {\n saveStatus(item, instance);\n });\n }\n return {\n ...results,\n value: value?.map((item) => item.status),\n };\n }\n\n const conversationsIterator = useRef();\n const latestConversationItem = useRef();\n async function fetchConversations(firstLoad) {\n if (firstLoad || !conversationsIterator.current) {\n conversationsIterator.current = masto.v1.conversations.list({\n limit: LIMIT,\n });\n }\n const results = await conversationsIterator.current.next();\n let { value } = results;\n value = value?.filter((item) => item.lastStatus);\n if (value?.length) {\n if (firstLoad) {\n latestConversationItem.current = value[0].lastStatus.id;\n console.log('First load', latestConversationItem.current);\n }\n\n value.forEach(({ lastStatus: item }) => {\n saveStatus(item, instance);\n });\n }\n console.log('results', results);\n return {\n ...results,\n value: value?.map((item) => item.lastStatus),\n };\n }\n\n function fetchItems(...args) {\n if (type === 'private') {\n return fetchConversations(...args);\n }\n return fetchMentions(...args);\n }\n\n async function checkForUpdates() {\n if (type === 'private') {\n try {\n const results = await masto.v1.conversations\n .list({\n limit: 1,\n since_id: latestConversationItem.current,\n })\n .next();\n let { value } = results;\n console.log(\n 'checkForUpdates PRIVATE',\n latestConversationItem.current,\n value,\n );\n const valueContainsLatestItem =\n value[0]?.id === latestConversationItem.current; // since_id might not be supported\n if (value?.length && !valueContainsLatestItem) {\n latestConversationItem.current = value[0].lastStatus.id;\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n } else {\n try {\n const results = await masto.v1.notifications\n .list({\n limit: 1,\n types: ['mention'],\n since_id: latestItem.current,\n })\n .next();\n let { value } = results;\n console.log('checkForUpdates ALL', latestItem.current, value);\n if (value?.length) {\n latestItem.current = value[0].id;\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n }\n\n const TimelineStart = useMemo(() => {\n return (\n <div class=\"filter-bar centered\">\n <Link\n to=\"/mentions\"\n class={!type ? 'is-active' : ''}\n onClick={(e) => {\n if (columnMode) {\n e.preventDefault();\n setStateType(null);\n }\n }}\n >\n <Trans>All</Trans>\n </Link>\n <Link\n to=\"/mentions?type=private\"\n class={type === 'private' ? 'is-active' : ''}\n onClick={(e) => {\n if (columnMode) {\n e.preventDefault();\n setStateType('private');\n }\n }}\n >\n <Trans>Private</Trans>\n </Link>\n </div>\n );\n }, [type]);\n\n return (\n <Timeline\n title={t`Mentions`}\n id=\"mentions\"\n emptyText={t`No one mentioned you :(`}\n errorText={t`Unable to load mentions.`}\n instance={instance}\n fetchItems={fetchItems}\n checkForUpdates={checkForUpdates}\n useItemID\n timelineStart={TimelineStart}\n refresh={type}\n />\n );\n}\n\nexport default Mentions;\n","import './notifications.css';\n\nimport { msg, Plural, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { Fragment } from 'preact';\nimport { memo } from 'preact/compat';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { InView } from 'react-intersection-observer';\nimport { useSearchParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\nimport { subscribeKey } from 'valtio/utils';\n\nimport AccountBlock from '../components/account-block';\nimport FollowRequestButtons from '../components/follow-request-buttons';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport Modal from '../components/modal';\nimport NavMenu from '../components/nav-menu';\nimport Notification from '../components/notification';\nimport Status from '../components/status';\nimport { api } from '../utils/api';\nimport enhanceContent from '../utils/enhance-content';\nimport groupNotifications, {\n groupNotifications2,\n massageNotifications2,\n} from '../utils/group-notifications';\nimport handleContentLinks from '../utils/handle-content-links';\nimport mem from '../utils/mem';\nimport niceDateTime from '../utils/nice-date-time';\nimport { getRegistration } from '../utils/push-notifications';\nimport shortenNumber from '../utils/shorten-number';\nimport showToast from '../utils/show-toast';\nimport states, { saveStatus } from '../utils/states';\nimport store from '../utils/store';\nimport { getCurrentInstance } from '../utils/store-utils';\nimport supports from '../utils/supports';\nimport usePageVisibility from '../utils/usePageVisibility';\nimport useScroll from '../utils/useScroll';\nimport useTitle from '../utils/useTitle';\n\nconst NOTIFICATIONS_LIMIT = 80;\nconst NOTIFICATIONS_GROUPED_LIMIT = 20;\nconst emptySearchParams = new URLSearchParams();\n\nconst scrollIntoViewOptions = {\n block: 'center',\n inline: 'center',\n behavior: 'smooth',\n};\n\nconst memSupportsGroupedNotifications = mem(\n () => supports('@mastodon/grouped-notifications'),\n {\n maxAge: 1000 * 60 * 5, // 5 minutes\n },\n);\n\nexport function mastoFetchNotifications(opts = {}) {\n const { masto } = api();\n if (\n states.settings.groupedNotificationsAlpha &&\n memSupportsGroupedNotifications()\n ) {\n // https://github.com/mastodon/mastodon/pull/29889\n return masto.v2.notifications.list({\n limit: NOTIFICATIONS_GROUPED_LIMIT,\n ...opts,\n });\n } else {\n return masto.v1.notifications.list({\n limit: NOTIFICATIONS_LIMIT,\n ...opts,\n });\n }\n}\n\nexport function getGroupedNotifications(notifications) {\n if (\n states.settings.groupedNotificationsAlpha &&\n memSupportsGroupedNotifications()\n ) {\n return groupNotifications2(notifications);\n } else {\n return groupNotifications(notifications);\n }\n}\n\nconst NOTIFICATIONS_POLICIES = [\n 'forNotFollowing',\n 'forNotFollowers',\n 'forNewAccounts',\n 'forPrivateMentions',\n 'forLimitedAccounts',\n];\nconst NOTIFICATIONS_POLICIES_TEXT = {\n forNotFollowing: msg`You don't follow`,\n forNotFollowers: msg`Who don't follow you`,\n forNewAccounts: msg`With a new account`,\n forPrivateMentions: msg`Who unsolicitedly private mention you`,\n forLimitedAccounts: msg`Who are limited by server moderators`,\n};\n\nfunction Notifications({ columnMode }) {\n const { _ } = useLingui();\n useTitle(t`Notifications`, '/notifications');\n const { masto, instance } = api();\n const snapStates = useSnapshot(states);\n const [uiState, setUIState] = useState('default');\n const [searchParams] = columnMode ? [emptySearchParams] : useSearchParams();\n const notificationID = searchParams.get('id');\n const notificationAccessToken = searchParams.get('access_token');\n const [showMore, setShowMore] = useState(false);\n const [onlyMentions, setOnlyMentions] = useState(false);\n const scrollableRef = useRef();\n const { nearReachEnd, scrollDirection, reachStart, nearReachStart } =\n useScroll({\n scrollableRef,\n });\n const hiddenUI = scrollDirection === 'end' && !nearReachStart;\n const [followRequests, setFollowRequests] = useState([]);\n const [announcements, setAnnouncements] = useState([]);\n\n console.debug('RENDER Notifications');\n\n const notificationsIterator = useRef();\n async function fetchNotifications(firstLoad) {\n if (firstLoad || !notificationsIterator.current) {\n // Reset iterator\n notificationsIterator.current = mastoFetchNotifications({\n excludeTypes: ['follow_request'],\n });\n }\n if (/max_id=($|&)/i.test(notificationsIterator.current?.nextParams)) {\n // Pixelfed returns next paginationed link with empty max_id\n // I assume, it's done (end of list)\n return {\n done: true,\n };\n }\n const allNotifications = await notificationsIterator.current.next();\n const notifications = massageNotifications2(allNotifications.value);\n\n if (notifications?.length) {\n notifications.forEach((notification) => {\n saveStatus(notification.status, instance, {\n skipThreading: true,\n });\n });\n\n // TEST: Slot in a fake notification to test 'severed_relationships'\n // notifications.unshift({\n // id: '123123',\n // type: 'severed_relationships',\n // createdAt: '2024-03-22T19:20:08.316Z',\n // event: {\n // type: 'account_suspension',\n // targetName: 'mastodon.dev',\n // followersCount: 0,\n // followingCount: 0,\n // },\n // });\n\n // TEST: Slot in a fake notification to test 'moderation_warning'\n // notifications.unshift({\n // id: '123123',\n // type: 'moderation_warning',\n // createdAt: new Date().toISOString(),\n // moderation_warning: {\n // id: '1231234',\n // action: 'mark_statuses_as_sensitive',\n // },\n // });\n\n // console.log({ notifications });\n\n const groupedNotifications = getGroupedNotifications(notifications);\n\n if (firstLoad) {\n states.notificationsLast = groupedNotifications[0];\n states.notifications = groupedNotifications;\n\n // Update last read marker\n masto.v1.markers\n .create({\n notifications: {\n lastReadId: groupedNotifications[0].id,\n },\n })\n .catch(() => {});\n } else {\n states.notifications.push(...groupedNotifications);\n }\n }\n\n states.notificationsShowNew = false;\n states.notificationsLastFetchTime = Date.now();\n return allNotifications;\n }\n\n async function fetchFollowRequests() {\n // Note: no pagination here yet because this better be on a separate page. Should be rare use-case???\n try {\n return await masto.v1.followRequests.list({\n limit: 80,\n });\n } catch (e) {\n // Silently fail\n return [];\n }\n }\n\n const loadFollowRequests = () => {\n setUIState('loading');\n (async () => {\n try {\n const requests = await fetchFollowRequests();\n setFollowRequests(requests);\n setUIState('default');\n } catch (e) {\n setUIState('error');\n }\n })();\n };\n\n async function fetchAnnouncements() {\n try {\n return await masto.v1.announcements.list();\n } catch (e) {\n // Silently fail\n return [];\n }\n }\n\n const supportsFilteredNotifications = supports(\n '@mastodon/filtered-notifications',\n );\n const [showNotificationsSettings, setShowNotificationsSettings] =\n useState(false);\n const [notificationsPolicy, setNotificationsPolicy] = useState({});\n function fetchNotificationsPolicy() {\n return masto.v2.notifications.policy.fetch().catch(() => {});\n }\n function loadNotificationsPolicy() {\n fetchNotificationsPolicy()\n .then((policy) => {\n console.log('✨ Notifications policy', policy);\n setNotificationsPolicy(policy);\n })\n .catch(() => {});\n }\n const [notificationsRequests, setNotificationsRequests] = useState(null);\n function fetchNotificationsRequest() {\n return masto.v1.notifications.requests.list();\n }\n\n const loadNotifications = (firstLoad) => {\n setShowNew(false);\n setUIState('loading');\n (async () => {\n try {\n const fetchNotificationsPromise = fetchNotifications(firstLoad);\n\n if (firstLoad) {\n fetchAnnouncements()\n .then((announcements) => {\n announcements.sort((a, b) => {\n // Sort by updatedAt first, then createdAt\n const aDate = new Date(a.updatedAt || a.createdAt);\n const bDate = new Date(b.updatedAt || b.createdAt);\n return bDate - aDate;\n });\n setAnnouncements(announcements);\n })\n .catch(() => {});\n\n fetchFollowRequests()\n .then((requests) => {\n setFollowRequests(requests);\n })\n .catch(() => {});\n\n if (supportsFilteredNotifications) {\n loadNotificationsPolicy();\n }\n }\n\n const { done } = await fetchNotificationsPromise;\n setShowMore(!done);\n\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n };\n\n useEffect(() => {\n loadNotifications(true);\n }, []);\n useEffect(() => {\n if (reachStart) {\n loadNotifications(true);\n }\n }, [reachStart]);\n\n // useEffect(() => {\n // if (nearReachEnd && showMore) {\n // loadNotifications();\n // }\n // }, [nearReachEnd, showMore]);\n\n const [showNew, setShowNew] = useState(false);\n\n const loadUpdates = useCallback(\n ({ disableIdleCheck = false } = {}) => {\n if (uiState === 'loading') {\n return;\n }\n console.log('✨ Load updates', {\n autoRefresh: snapStates.settings.autoRefresh,\n scrollTop: scrollableRef.current?.scrollTop,\n inBackground: inBackground(),\n disableIdleCheck,\n });\n if (\n snapStates.settings.autoRefresh &&\n scrollableRef.current?.scrollTop < 16 &&\n (disableIdleCheck || window.__IDLE__) &&\n !inBackground()\n ) {\n loadNotifications(true);\n }\n },\n [snapStates.notificationsShowNew, snapStates.settings.autoRefresh, uiState],\n );\n // useEffect(loadUpdates, [snapStates.notificationsShowNew]);\n\n const lastHiddenTime = useRef();\n usePageVisibility((visible) => {\n if (visible) {\n const timeDiff = Date.now() - lastHiddenTime.current;\n if (!lastHiddenTime.current || timeDiff > 1000 * 3) {\n // 3 seconds\n loadUpdates({\n disableIdleCheck: true,\n });\n } else {\n lastHiddenTime.current = Date.now();\n }\n }\n });\n const firstLoad = useRef(true);\n useEffect(() => {\n let unsub = subscribeKey(states, 'notificationsShowNew', (v) => {\n if (firstLoad.current) {\n firstLoad.current = false;\n return;\n }\n if (uiState === 'loading') return;\n if (v) loadUpdates();\n setShowNew(v);\n });\n return () => unsub?.();\n }, []);\n\n const todayDate = new Date();\n const yesterdayDate = new Date(todayDate - 24 * 60 * 60 * 1000);\n let currentDay = new Date();\n const showTodayEmpty = !snapStates.notifications.some(\n (notification) =>\n new Date(notification.createdAt).toDateString() ===\n todayDate.toDateString(),\n );\n\n const announcementsListRef = useRef();\n\n useEffect(() => {\n if (notificationID) {\n states.routeNotification = {\n id: notificationID,\n accessToken: atob(notificationAccessToken),\n };\n }\n }, [notificationID, notificationAccessToken]);\n\n // useEffect(() => {\n // if (uiState === 'default') {\n // (async () => {\n // try {\n // const registration = await getRegistration();\n // if (registration?.getNotifications) {\n // const notifications = await registration.getNotifications();\n // console.log('🔔 Push notifications', notifications);\n // // Close all notifications?\n // // notifications.forEach((notification) => {\n // // notification.close();\n // // });\n // }\n // } catch (e) {}\n // })();\n // }\n // }, [uiState]);\n\n const [annualReportNotification, setAnnualReportNotification] =\n useState(null);\n useEffect(async () => {\n // Skip this if not in December\n const date = new Date();\n if (date.getMonth() !== 11) return;\n\n // Skip if doesn't support annual report\n if (!supports('@mastodon/annual-report')) return;\n\n let annualReportNotification = store.account.get(\n 'annualReportNotification',\n );\n if (annualReportNotification) {\n setAnnualReportNotification(annualReportNotification);\n return;\n }\n const notificationIterator = mastoFetchNotifications({\n types: ['annual_report'],\n });\n try {\n const notification = await notificationIterator.next();\n annualReportNotification = notification?.value?.notificationGroups?.[0];\n const annualReportYear = annualReportNotification?.annualReport?.year;\n // If same year, show the annual report\n if (annualReportYear == date.getFullYear()) {\n console.log(\n 'ANNUAL REPORT',\n annualReportYear,\n annualReportNotification,\n );\n setAnnualReportNotification(annualReportNotification);\n store.account.set('annualReportNotification', annualReportNotification);\n }\n } catch (e) {\n console.warn(e);\n }\n }, []);\n\n const itemsSelector = '.notification';\n const jRef = useHotkeys('j', () => {\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let nextItem = allItems[activeItemIndex + 1];\n if (nextItem) {\n nextItem.focus();\n nextItem.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0;\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n const kRef = useHotkeys('k', () => {\n // focus on previous status after active item\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let prevItem = allItems[activeItemIndex - 1];\n if (prevItem) {\n prevItem.focus();\n prevItem.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0;\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n const oRef = useHotkeys(['enter', 'o'], () => {\n const activeItem = document.activeElement.closest(itemsSelector);\n const statusLink = activeItem?.querySelector('.status-link');\n if (statusLink) {\n statusLink.click();\n }\n });\n\n const today = new Date();\n const todaySubHeading = useMemo(() => {\n return niceDateTime(today, {\n forceOpts: {\n weekday: 'long',\n },\n });\n }, [today]);\n\n return (\n <div\n id=\"notifications-page\"\n class=\"deck-container\"\n ref={(node) => {\n scrollableRef.current = node;\n jRef(node);\n kRef(node);\n oRef(node);\n }}\n tabIndex=\"-1\"\n >\n <div class={`timeline-deck deck ${onlyMentions ? 'only-mentions' : ''}`}>\n <header\n hidden={hiddenUI}\n onClick={(e) => {\n if (!e.target.closest('a, button')) {\n scrollableRef.current?.scrollTo({ top: 0, behavior: 'smooth' });\n }\n }}\n onDblClick={(e) => {\n if (!e.target.closest('a, button')) {\n loadNotifications(true);\n }\n }}\n class={uiState === 'loading' ? 'loading' : ''}\n >\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n <Link to=\"/\" class=\"button plain\">\n <Icon icon=\"home\" size=\"l\" alt={t`Home`} />\n </Link>\n </div>\n <h1>\n <Trans>Notifications</Trans>\n </h1>\n <div class=\"header-side\">\n {supportsFilteredNotifications && (\n <button\n type=\"button\"\n class=\"button plain4\"\n onClick={() => {\n setShowNotificationsSettings(true);\n }}\n >\n <Icon\n icon=\"settings\"\n size=\"l\"\n alt={t`Notifications settings`}\n />\n </button>\n )}\n </div>\n </div>\n {showNew && uiState !== 'loading' && (\n <button\n class=\"updates-button shiny-pill\"\n type=\"button\"\n onClick={() => {\n loadNotifications(true);\n scrollableRef.current?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"arrow-up\" /> <Trans>New notifications</Trans>\n </button>\n )}\n </header>\n {announcements.length > 0 && (\n <div class=\"shazam-container\">\n <div class=\"shazam-container-inner\">\n <details class=\"announcements\">\n <summary>\n <span>\n <Icon icon=\"announce\" class=\"announcement-icon\" size=\"l\" />{' '}\n <Plural\n value={announcements.length}\n one=\"Announcement\"\n other=\"Announcements\"\n />{' '}\n <small class=\"insignificant\">{instance}</small>\n </span>\n {announcements.length > 1 && (\n <span class=\"announcements-nav-buttons\">\n {announcements.map((announcement, index) => (\n <button\n type=\"button\"\n class=\"plain2 small\"\n onClick={() => {\n announcementsListRef.current?.children[\n index\n ].scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n });\n }}\n >\n {index + 1}\n </button>\n ))}\n </span>\n )}\n </summary>\n <ul\n class={`announcements-list-${\n announcements.length > 1 ? 'multiple' : 'single'\n }`}\n ref={announcementsListRef}\n >\n {announcements.map((announcement) => (\n <li>\n <AnnouncementBlock announcement={announcement} />\n </li>\n ))}\n </ul>\n </details>\n </div>\n </div>\n )}\n {followRequests.length > 0 && (\n <div class=\"follow-requests\">\n <h2 class=\"timeline-header\">\n <Trans>Follow requests</Trans>\n </h2>\n {followRequests.length > 5 ? (\n <details>\n <summary>\n <Plural\n value={followRequests.length}\n one=\"# follow request\"\n other=\"# follow requests\"\n />\n </summary>\n <ul>\n {followRequests.map((account) => (\n <li key={account.id}>\n <AccountBlock account={account} />\n <FollowRequestButtons\n accountID={account.id}\n onChange={() => {\n // loadFollowRequests();\n // loadNotifications(true);\n }}\n />\n </li>\n ))}\n </ul>\n </details>\n ) : (\n <ul>\n {followRequests.map((account) => (\n <li key={account.id}>\n <AccountBlock account={account} />\n <FollowRequestButtons\n accountID={account.id}\n onChange={() => {\n // loadFollowRequests();\n // loadNotifications(true);\n }}\n />\n </li>\n ))}\n </ul>\n )}\n </div>\n )}\n {supportsFilteredNotifications &&\n notificationsPolicy?.summary?.pendingRequestsCount > 0 && (\n <div class=\"shazam-container\">\n <div class=\"shazam-container-inner\">\n <div class=\"filtered-notifications\">\n <details\n onToggle={async (e) => {\n const { open } = e.target;\n if (open) {\n const requests = await fetchNotificationsRequest();\n setNotificationsRequests(requests);\n console.log({ open, requests });\n }\n }}\n >\n <summary>\n <Plural\n value={notificationsPolicy.summary.pendingRequestsCount}\n one=\"Filtered notifications from # person\"\n other=\"Filtered notifications from # people\"\n />\n </summary>\n {!notificationsRequests ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n notificationsRequests?.length > 0 && (\n <ul>\n {notificationsRequests.map((request) => (\n <li key={request.id}>\n <div class=\"request-notifcations\">\n {!request.lastStatus?.id && (\n <AccountBlock\n useAvatarStatic\n showStats\n account={request.account}\n />\n )}\n {request.lastStatus?.id && (\n <div class=\"last-post\">\n <Link\n class=\"status-link\"\n to={`/${instance}/s/${request.lastStatus.id}`}\n >\n <Status\n status={request.lastStatus}\n size=\"s\"\n readOnly\n />\n </Link>\n </div>\n )}\n <NotificationRequestModalButton\n request={request}\n />\n </div>\n <NotificationRequestButtons\n request={request}\n onChange={() => {\n loadNotifications(true);\n }}\n />\n </li>\n ))}\n </ul>\n )\n )}\n </details>\n </div>\n </div>\n </div>\n )}\n {annualReportNotification && (\n <div class=\"shazam-container\">\n <div class=\"shazam-container-inner\">\n <Notification notification={annualReportNotification} />\n </div>\n </div>\n )}\n <div id=\"mentions-option\">\n <label>\n <input\n type=\"checkbox\"\n checked={onlyMentions}\n onChange={(e) => {\n setOnlyMentions(e.target.checked);\n }}\n />{' '}\n <Trans>Only mentions</Trans>\n </label>\n </div>\n <h2 class=\"timeline-header\">\n <Trans>Today</Trans>{' '}\n <small class=\"insignificant bidi-isolate\">{todaySubHeading}</small>\n </h2>\n {showTodayEmpty && (\n <p class=\"ui-state insignificant\">\n {uiState === 'default' ? t`You're all caught up.` : <>…</>}\n </p>\n )}\n {snapStates.notifications.length ? (\n <>\n {snapStates.notifications\n // This is leaked from Notifications popover\n .filter((n) => n.type !== 'follow_request')\n .map((notification) => {\n if (onlyMentions && notification.type !== 'mention') {\n return null;\n }\n const notificationDay = new Date(notification.createdAt);\n const differentDay =\n notificationDay.toDateString() !== currentDay.toDateString();\n if (differentDay) {\n currentDay = notificationDay;\n }\n // if notificationDay is yesterday, show \"Yesterday\"\n // if notificationDay is before yesterday, show date\n const heading =\n notificationDay.toDateString() ===\n yesterdayDate.toDateString()\n ? t`Yesterday`\n : niceDateTime(currentDay, {\n hideTime: true,\n });\n const subHeading = niceDateTime(currentDay, {\n forceOpts: {\n weekday: 'long',\n },\n });\n return (\n <Fragment key={notification._ids || notification.id}>\n {differentDay && (\n <h2 class=\"timeline-header\">\n <span>{heading}</span>{' '}\n <small class=\"insignificant bidi-isolate\">\n {subHeading}\n </small>\n </h2>\n )}\n <Notification\n instance={instance}\n notification={notification}\n key={notification._ids || notification.id}\n />\n </Fragment>\n );\n })}\n </>\n ) : (\n <>\n {uiState === 'loading' && (\n <>\n <ul class=\"timeline flat\">\n {Array.from({ length: 5 }).map((_, i) => (\n <li class=\"notification skeleton\">\n <div class=\"notification-type\">\n <Icon icon=\"notification\" size=\"xl\" />\n </div>\n <div class=\"notification-content\">\n <p>███████████ ████</p>\n </div>\n </li>\n ))}\n </ul>\n </>\n )}\n {uiState === 'error' && (\n <p class=\"ui-state\">\n <Trans>Unable to load notifications</Trans>\n <br />\n <br />\n <button type=\"button\" onClick={() => loadNotifications(true)}>\n <Trans>Try again</Trans>\n </button>\n </p>\n )}\n </>\n )}\n {showMore && (\n <InView\n onChange={(inView) => {\n if (inView) {\n loadNotifications();\n }\n }}\n >\n <button\n type=\"button\"\n class=\"plain block\"\n disabled={uiState === 'loading'}\n onClick={() => loadNotifications()}\n style={{ marginBlockEnd: '6em' }}\n >\n {uiState === 'loading' ? (\n <Loader abrupt />\n ) : (\n <Trans>Show more…</Trans>\n )}\n </button>\n </InView>\n )}\n </div>\n {supportsFilteredNotifications && showNotificationsSettings && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowNotificationsSettings(false);\n }\n }}\n >\n <div class=\"sheet\" id=\"notifications-settings\" tabIndex=\"-1\">\n <button\n type=\"button\"\n class=\"sheet-close\"\n onClick={() => setShowNotificationsSettings(false)}\n >\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <h2>\n <Trans>Notifications settings</Trans>\n </h2>\n </header>\n <main>\n <form\n onSubmit={(e) => {\n e.preventDefault();\n const {\n forNotFollowing,\n forNotFollowers,\n forNewAccounts,\n forPrivateMentions,\n forLimitedAccounts,\n } = e.target;\n const newPolicy = {\n ...notificationsPolicy,\n forNotFollowing: forNotFollowing.value,\n forNotFollowers: forNotFollowers.value,\n forNewAccounts: forNewAccounts.value,\n forPrivateMentions: forPrivateMentions.value,\n forLimitedAccounts: forLimitedAccounts.value,\n };\n setNotificationsPolicy(newPolicy);\n setShowNotificationsSettings(false);\n (async () => {\n try {\n await masto.v2.notifications.policy.update(newPolicy);\n showToast(t`Notifications settings updated`);\n } catch (e) {\n console.error(e);\n }\n })();\n }}\n >\n <p>\n <Trans>Filter out notifications from people:</Trans>\n </p>\n <div class=\"notification-policy-fields\">\n {NOTIFICATIONS_POLICIES.map((key) => {\n const value = notificationsPolicy[key];\n return (\n <div key={key}>\n <label>\n {_(NOTIFICATIONS_POLICIES_TEXT[key])}\n <select name={key} defaultValue={value} class=\"small\">\n <option value=\"accept\">\n <Trans>Accept</Trans>\n </option>\n <option value=\"filter\">\n <Trans>Filter</Trans>\n </option>\n <option value=\"drop\">\n <Trans>Ignore</Trans>\n </option>\n </select>\n </label>\n </div>\n );\n })}\n </div>\n <p>\n <button type=\"submit\">\n <Trans>Save</Trans>\n </button>\n </p>\n </form>\n </main>\n </div>\n </Modal>\n )}\n </div>\n );\n}\n\nfunction inBackground() {\n return !!document.querySelector('.deck-backdrop, #modal-container > *');\n}\n\nfunction AnnouncementBlock({ announcement }) {\n const { instance } = api();\n const { contact } = getCurrentInstance();\n const contactAccount = contact?.account;\n const {\n id,\n content,\n startsAt,\n endsAt,\n published,\n allDay,\n publishedAt,\n updatedAt,\n read,\n mentions,\n statuses,\n tags,\n emojis,\n reactions,\n } = announcement;\n\n const publishedAtDate = new Date(publishedAt);\n const publishedDateText = niceDateTime(publishedAtDate);\n const updatedAtDate = new Date(updatedAt);\n const updatedAtText = niceDateTime(updatedAtDate);\n\n return (\n <div class=\"announcement-block\">\n <AccountBlock account={contactAccount} />\n <div\n class=\"announcement-content\"\n onClick={handleContentLinks({ mentions, instance })}\n dangerouslySetInnerHTML={{\n __html: enhanceContent(content, {\n emojis,\n }),\n }}\n />\n <p class=\"insignificant\">\n <time datetime={publishedAtDate.toISOString()}>\n {niceDateTime(publishedAtDate)}\n </time>\n {updatedAt && updatedAtText !== publishedDateText && (\n <>\n {' '}\n •{' '}\n <span class=\"ib\">\n <Trans>\n Updated{' '}\n <time datetime={updatedAtDate.toISOString()}>\n {niceDateTime(updatedAtDate)}\n </time>\n </Trans>\n </span>\n </>\n )}\n </p>\n <div class=\"announcement-reactions\" hidden>\n {reactions.map((reaction) => {\n const { name, count, me, staticUrl, url } = reaction;\n return (\n <button type=\"button\" class={`plain4 small ${me ? 'reacted' : ''}`}>\n {url || staticUrl ? (\n <img src={url || staticUrl} alt={name} width=\"16\" height=\"16\" />\n ) : (\n <span>{name}</span>\n )}{' '}\n <span class=\"count\">{shortenNumber(count)}</span>\n </button>\n );\n })}\n </div>\n </div>\n );\n}\n\nfunction fetchNotficationsByAccount(accountID) {\n const { masto } = api();\n return masto.v1.notifications.list({\n accountID,\n });\n}\nfunction NotificationRequestModalButton({ request }) {\n const { instance } = api();\n const [uiState, setUIState] = useState('loading');\n const { account, lastStatus } = request;\n const [showModal, setShowModal] = useState(false);\n const [notifications, setNotifications] = useState([]);\n\n function onClose() {\n setShowModal(false);\n }\n\n useEffect(() => {\n if (!request?.account?.id) return;\n if (!showModal) return;\n setUIState('loading');\n (async () => {\n const notifs = await fetchNotficationsByAccount(request.account.id);\n setNotifications(notifs || []);\n setUIState('default');\n })();\n }, [showModal, request?.account?.id]);\n\n return (\n <>\n <button\n type=\"button\"\n class=\"plain4 request-notifications-account\"\n onClick={() => {\n setShowModal(true);\n }}\n >\n <Icon icon=\"notification\" class=\"more-insignificant\" />{' '}\n <small>\n <Trans>\n View notifications from{' '}\n <span class=\"bidi-isolate\">@{account.username}</span>\n </Trans>\n </small>{' '}\n <Icon icon=\"chevron-down\" />\n </button>\n {showModal && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n onClose();\n }\n }}\n >\n <div class=\"sheet\" tabIndex=\"-1\">\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <b>\n <Trans>\n Notifications from{' '}\n <span class=\"bidi-isolate\">@{account.username}</span>\n </Trans>\n </b>\n </header>\n <main>\n {uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n notifications.map((notification) => (\n <div\n class=\"notification-peek\"\n onClick={(e) => {\n const { target } = e;\n // If button or links\n if (\n e.target.tagName === 'BUTTON' ||\n e.target.tagName === 'A'\n ) {\n onClose();\n }\n }}\n >\n <Notification\n instance={instance}\n notification={notification}\n isStatic\n />\n </div>\n ))\n )}\n </main>\n </div>\n </Modal>\n )}\n </>\n );\n}\n\nfunction NotificationRequestButtons({ request, onChange }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [requestState, setRequestState] = useState(null); // accept, dismiss\n const hasRequestState = requestState !== null;\n\n return (\n <p class=\"notification-request-buttons\">\n <button\n type=\"button\"\n disabled={uiState === 'loading' || hasRequestState}\n onClick={() => {\n setUIState('loading');\n (async () => {\n try {\n await masto.v1.notifications.requests\n .$select(request.id)\n .accept();\n setRequestState('accept');\n setUIState('default');\n onChange({\n request,\n state: 'accept',\n });\n showToast(\n t`Notifications from @${request.account.username} will not be filtered from now on.`,\n );\n } catch (error) {\n setUIState('error');\n console.error(error);\n showToast(t`Unable to accept notification request`);\n }\n })();\n }}\n >\n <Trans>Allow</Trans>\n </button>{' '}\n <button\n type=\"button\"\n disabled={uiState === 'loading' || hasRequestState}\n class=\"light danger\"\n onClick={() => {\n setUIState('loading');\n (async () => {\n try {\n await masto.v1.notifications.requests\n .$select(request.id)\n .dismiss();\n setRequestState('dismiss');\n setUIState('default');\n onChange({\n request,\n state: 'dismiss',\n });\n showToast(\n t`Notifications from @${request.account.username} will not show up in Filtered notifications from now on.`,\n );\n } catch (error) {\n setUIState('error');\n console.error(error);\n showToast(t`Unable to dismiss notification request`);\n }\n })();\n }}\n >\n <Trans>Dismiss</Trans>\n </button>\n <span class=\"notification-request-states\">\n {uiState === 'loading' ? (\n <Loader abrupt />\n ) : requestState === 'accept' ? (\n <Icon\n icon=\"check-circle\"\n alt={t`Accepted`}\n class=\"notification-accepted\"\n />\n ) : (\n requestState === 'dismiss' && (\n <Icon\n icon=\"x-circle\"\n alt={t`Dismissed`}\n class=\"notification-dismissed\"\n />\n )\n )}\n </span>\n </p>\n );\n}\n\nexport default memo(Notifications);\n","import { t, Trans } from '@lingui/macro';\nimport { Menu, MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport { useRef } from 'preact/hooks';\nimport { useNavigate, useParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport Icon from '../components/icon';\nimport Menu2 from '../components/menu2';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { filteredItems } from '../utils/filters';\nimport states, { saveStatus } from '../utils/states';\nimport supports from '../utils/supports';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\nfunction Public({ local, columnMode, ...props }) {\n const snapStates = useSnapshot(states);\n const isLocal = !!local;\n const params = columnMode ? {} : useParams();\n const { masto, instance } = api({\n instance: props?.instance || params.instance,\n });\n const { masto: currentMasto, instance: currentInstance } = api();\n const title = isLocal\n ? t`Local timeline (${instance})`\n : t`Federated timeline (${instance})`;\n useTitle(title, isLocal ? `/:instance?/p/l` : `/:instance?/p`);\n // const navigate = useNavigate();\n const latestItem = useRef();\n\n const publicIterator = useRef();\n async function fetchPublic(firstLoad) {\n if (firstLoad || !publicIterator.current) {\n const opts = {\n limit: LIMIT,\n local: isLocal || undefined,\n };\n if (!isLocal && supports('@pixelfed/global-feed')) {\n opts.remote = true;\n }\n publicIterator.current = masto.v1.timelines.public.list(opts);\n }\n const results = await publicIterator.current.next();\n let { value } = results;\n if (value?.length) {\n if (firstLoad) {\n latestItem.current = value[0].id;\n }\n\n // value = filteredItems(value, 'public');\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n }\n return {\n ...results,\n value,\n };\n }\n\n async function checkForUpdates() {\n try {\n const results = await masto.v1.timelines.public\n .list({\n limit: 1,\n local: isLocal,\n since_id: latestItem.current,\n })\n .next();\n let { value } = results;\n const valueContainsLatestItem = value[0]?.id === latestItem.current; // since_id might not be supported\n if (value?.length && !valueContainsLatestItem) {\n value = filteredItems(value, 'public');\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n\n return (\n <Timeline\n key={instance + isLocal}\n title={title}\n titleComponent={\n <h1 class=\"header-double-lines\">\n <b>{isLocal ? t`Local timeline` : t`Federated timeline`}</b>\n <div>{instance}</div>\n </h1>\n }\n id=\"public\"\n instance={instance}\n emptyText={t`No one has posted anything yet.`}\n errorText={t`Unable to load posts`}\n fetchItems={fetchPublic}\n checkForUpdates={checkForUpdates}\n useItemID\n headerStart={<></>}\n boostsCarousel={snapStates.settings.boostsCarousel}\n // allowFilters\n filterContext=\"public\"\n headerEnd={\n <Menu2\n portal\n // setDownOverflow\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n <MenuItem href={isLocal ? `/#/${instance}/p` : `/#/${instance}/p/l`}>\n {isLocal ? (\n <>\n <Icon icon=\"transfer\" />{' '}\n <span>\n <Trans>Switch to Federated</Trans>\n </span>\n </>\n ) : (\n <>\n <Icon icon=\"transfer\" />{' '}\n <span>\n <Trans>Switch to Local</Trans>\n </span>\n </>\n )}\n </MenuItem>\n <MenuDivider />\n <MenuItem\n onClick={() => {\n let newInstance = prompt(\n t`Enter a new instance e.g. \"mastodon.social\"`,\n );\n if (!/\\./.test(newInstance)) {\n if (newInstance) alert(t`Invalid instance`);\n return;\n }\n if (newInstance) {\n newInstance = newInstance.toLowerCase().trim();\n // navigate(isLocal ? `/${newInstance}/p/l` : `/${newInstance}/p`);\n location.hash = isLocal\n ? `/${newInstance}/p/l`\n : `/${newInstance}/p`;\n }\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <span>\n <Trans>Go to another instance…</Trans>\n </span>\n </MenuItem>\n {currentInstance !== instance && (\n <MenuItem\n onClick={() => {\n location.hash = isLocal\n ? `/${currentInstance}/p/l`\n : `/${currentInstance}/p`;\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <small class=\"menu-double-lines\">\n <Trans>\n Go to my instance (<b>{currentInstance}</b>)\n </Trans>\n </small>\n </MenuItem>\n )}\n </Menu2>\n }\n />\n );\n}\n\nexport default Public;\n","import './search.css';\n\nimport { useAutoAnimate } from '@formkit/auto-animate/preact';\nimport { t, Trans } from '@lingui/macro';\nimport { useEffect, useLayoutEffect, useRef, useState } from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { InView } from 'react-intersection-observer';\nimport { useParams, useSearchParams } from 'react-router-dom';\n\nimport AccountBlock from '../components/account-block';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport NavMenu from '../components/nav-menu';\nimport SearchForm from '../components/search-form';\nimport Status from '../components/status';\nimport { api } from '../utils/api';\nimport { fetchRelationships } from '../utils/relationships';\nimport shortenNumber from '../utils/shorten-number';\nimport usePageVisibility from '../utils/usePageVisibility';\nimport useTitle from '../utils/useTitle';\n\nconst SHORT_LIMIT = 5;\nconst LIMIT = 40;\nconst emptySearchParams = new URLSearchParams();\n\nconst scrollIntoViewOptions = {\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n};\n\nfunction Search({ columnMode, ...props }) {\n const params = columnMode ? {} : useParams();\n const { masto, instance, authenticated } = api({\n instance: params.instance,\n });\n const [uiState, setUIState] = useState('default');\n const [searchParams] = columnMode ? [emptySearchParams] : useSearchParams();\n const searchFormRef = useRef();\n const q = props?.query || searchParams.get('q');\n const type = columnMode\n ? 'statuses'\n : props?.type || searchParams.get('type');\n let title = t`Search`;\n if (q) {\n switch (type) {\n case 'statuses':\n title = t`Search: ${q} (Posts)`;\n break;\n case 'accounts':\n title = t`Search: ${q} (Accounts)`;\n break;\n case 'hashtags':\n title = t`Search: ${q} (Hashtags)`;\n break;\n default:\n title = t`Search: ${q}`;\n }\n }\n useTitle(title, `/search`);\n\n const [showMore, setShowMore] = useState(false);\n const offsetRef = useRef(0);\n useEffect(() => {\n offsetRef.current = 0;\n }, [q, type]);\n\n const scrollableRef = useRef();\n useLayoutEffect(() => {\n scrollableRef.current?.scrollTo?.(0, 0);\n }, [q, type]);\n\n const [statusResults, setStatusResults] = useState([]);\n const [accountResults, setAccountResults] = useState([]);\n const [hashtagResults, setHashtagResults] = useState([]);\n useEffect(() => {\n setStatusResults([]);\n setAccountResults([]);\n setHashtagResults([]);\n }, [q]);\n const typeResults = {\n statuses: statusResults,\n accounts: accountResults,\n hashtags: hashtagResults,\n };\n const setTypeResultsFunc = {\n statuses: setStatusResults,\n accounts: setAccountResults,\n hashtags: setHashtagResults,\n };\n\n const [relationshipsMap, setRelationshipsMap] = useState({});\n const loadRelationships = async (accounts) => {\n if (!accounts?.length) return;\n const relationships = await fetchRelationships(accounts, relationshipsMap);\n if (relationships) {\n setRelationshipsMap({\n ...relationshipsMap,\n ...relationships,\n });\n }\n };\n\n function loadResults(firstLoad) {\n if (firstLoad) {\n offsetRef.current = 0;\n }\n\n if (!firstLoad && !authenticated) {\n // Search results pagination is only available to authenticated users\n return;\n }\n\n setUIState('loading');\n if (firstLoad && !type) {\n setStatusResults(statusResults.slice(0, SHORT_LIMIT));\n setAccountResults(accountResults.slice(0, SHORT_LIMIT));\n setHashtagResults(hashtagResults.slice(0, SHORT_LIMIT));\n }\n\n (async () => {\n const params = {\n q,\n resolve: authenticated,\n limit: SHORT_LIMIT,\n };\n if (type) {\n params.limit = LIMIT;\n params.type = type;\n if (authenticated) params.offset = offsetRef.current;\n }\n\n try {\n const results = await masto.v2.search.fetch(params);\n console.log(results);\n if (type) {\n if (firstLoad) {\n setTypeResultsFunc[type](results[type]);\n const length = results[type]?.length;\n offsetRef.current = LIMIT;\n setShowMore(!!length);\n } else {\n // If first item is the same, it means API doesn't support offset\n // I know this is a very basic check, but it works for now\n if (results[type]?.[0]?.id === typeResults[type]?.[0]?.id) {\n setShowMore(false);\n } else {\n setTypeResultsFunc[type]((prev) => [...prev, ...results[type]]);\n const length = results[type]?.length;\n offsetRef.current = offsetRef.current + LIMIT;\n setShowMore(!!length);\n }\n }\n } else {\n setStatusResults(results.statuses || []);\n setAccountResults(results.accounts || []);\n setHashtagResults(results.hashtags || []);\n offsetRef.current = 0;\n setShowMore(false);\n }\n loadRelationships(results.accounts);\n\n setUIState('default');\n } catch (err) {\n console.error(err);\n setUIState('error');\n }\n })();\n }\n\n const lastHiddenTime = useRef();\n usePageVisibility((visible) => {\n const reachStart = scrollableRef.current?.scrollTop === 0;\n if (visible && reachStart) {\n const timeDiff = Date.now() - lastHiddenTime.current;\n if (!lastHiddenTime.current || timeDiff > 1000 * 3) {\n // 3 seconds\n loadResults(true);\n } else {\n lastHiddenTime.current = Date.now();\n }\n }\n });\n\n useEffect(() => {\n let timer;\n searchFormRef.current?.setValue?.(q || '');\n if (q) {\n loadResults(true);\n } else {\n timer = setTimeout(() => {\n searchFormRef.current?.focus?.();\n }, 150); // Right after focusDeck runs\n }\n return () => clearTimeout(timer);\n }, [q, type, instance]);\n\n useHotkeys(\n ['/', 'Slash'],\n (e) => {\n searchFormRef.current?.focus?.();\n searchFormRef.current?.select?.();\n },\n {\n preventDefault: true,\n },\n );\n\n const itemsSelector = '.timeline > li > a, .hashtag-list > li > a';\n const jRef = useHotkeys('j', () => {\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let nextItem = allItems[activeItemIndex + 1];\n if (nextItem) {\n nextItem.focus();\n nextItem.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0;\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n const kRef = useHotkeys('k', () => {\n // focus on previous status after active item\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let prevItem = allItems[activeItemIndex - 1];\n if (prevItem) {\n prevItem.focus();\n prevItem.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0;\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n const [filterBarParent] = useAutoAnimate();\n\n return (\n <div\n id=\"search-page\"\n class=\"deck-container\"\n tabIndex=\"-1\"\n ref={(node) => {\n scrollableRef.current = node;\n jRef(node);\n kRef(node);\n }}\n >\n <div class=\"timeline-deck deck\">\n <header class={uiState === 'loading' ? 'loading' : ''}>\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n </div>\n <SearchForm ref={searchFormRef} />\n <div class=\"header-side\">\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => {\n loadResults(true);\n }}\n disabled={uiState === 'loading'}\n >\n <Icon icon=\"search\" size=\"l\" alt={t`Search`} />\n </button>\n </div>\n </div>\n </header>\n <main>\n {!!q && !columnMode && (\n <div\n ref={filterBarParent}\n class={`filter-bar ${uiState === 'loading' ? 'loading' : ''}`}\n >\n {!!type && (\n <Link to={`/search${q ? `?q=${encodeURIComponent(q)}` : ''}`}>\n <Icon icon=\"chevron-left\" /> <Trans>All</Trans>\n </Link>\n )}\n {[\n {\n label: t`Accounts`,\n type: 'accounts',\n to: `/search?q=${encodeURIComponent(q)}&type=accounts`,\n },\n {\n label: t`Hashtags`,\n type: 'hashtags',\n to: `/search?q=${encodeURIComponent(q)}&type=hashtags`,\n },\n {\n label: t`Posts`,\n type: 'statuses',\n to: `/search?q=${encodeURIComponent(q)}&type=statuses`,\n },\n ]\n .sort((a, b) => {\n if (a.type === type) return -1;\n if (b.type === type) return 1;\n return 0;\n })\n .map((link) => (\n <Link to={link.to} key={link.type}>\n {link.label}\n </Link>\n ))}\n </div>\n )}\n {!!q ? (\n <>\n {(!type || type === 'accounts') && (\n <>\n {type !== 'accounts' && (\n <h2 class=\"timeline-header\">\n <Trans>Accounts</Trans>{' '}\n <Link\n to={`/search?q=${encodeURIComponent(q)}&type=accounts`}\n >\n <Icon icon=\"arrow-right\" size=\"l\" alt={t`See more`} />\n </Link>\n </h2>\n )}\n {accountResults.length > 0 ? (\n <>\n <ul class=\"timeline flat accounts-list\">\n {accountResults.map((account) => (\n <li key={account.id}>\n <AccountBlock\n account={account}\n instance={instance}\n showStats\n relationship={relationshipsMap[account.id]}\n />\n </li>\n ))}\n </ul>\n {type !== 'accounts' && (\n <div class=\"ui-state\">\n <Link\n class=\"plain button\"\n to={`/search?q=${encodeURIComponent(\n q,\n )}&type=accounts`}\n >\n <Trans>See more accounts</Trans>{' '}\n <Icon icon=\"arrow-right\" />\n </Link>\n </div>\n )}\n </>\n ) : (\n !type &&\n (uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No accounts found.</Trans>\n </p>\n ))\n )}\n </>\n )}\n {(!type || type === 'hashtags') && (\n <>\n {type !== 'hashtags' && (\n <h2 class=\"timeline-header\">\n <Trans>Hashtags</Trans>{' '}\n <Link\n to={`/search?q=${encodeURIComponent(q)}&type=hashtags`}\n >\n <Icon icon=\"arrow-right\" size=\"l\" alt={t`See more`} />\n </Link>\n </h2>\n )}\n {hashtagResults.length > 0 ? (\n <>\n <ul class=\"link-list hashtag-list\">\n {hashtagResults.map((hashtag) => {\n const { name, history } = hashtag;\n const total = history?.reduce?.(\n (acc, cur) => acc + +cur.uses,\n 0,\n );\n return (\n <li key={`${name}-${total}`}>\n <Link\n to={\n instance\n ? `/${instance}/t/${name}`\n : `/t/${name}`\n }\n >\n <Icon icon=\"hashtag\" alt=\"#\" />\n <span>{name}</span>\n {!!total && (\n <span class=\"count\">\n {shortenNumber(total)}\n </span>\n )}\n </Link>\n </li>\n );\n })}\n </ul>\n {type !== 'hashtags' && (\n <div class=\"ui-state\">\n <Link\n class=\"plain button\"\n to={`/search?q=${encodeURIComponent(\n q,\n )}&type=hashtags`}\n >\n <Trans>See more hashtags</Trans>{' '}\n <Icon icon=\"arrow-right\" />\n </Link>\n </div>\n )}\n </>\n ) : (\n !type &&\n (uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No hashtags found.</Trans>\n </p>\n ))\n )}\n </>\n )}\n {(!type || type === 'statuses') && (\n <>\n {type !== 'statuses' && (\n <h2 class=\"timeline-header\">\n <Trans>Posts</Trans>{' '}\n <Link\n to={`/search?q=${encodeURIComponent(q)}&type=statuses`}\n >\n <Icon icon=\"arrow-right\" size=\"l\" alt={t`See more`} />\n </Link>\n </h2>\n )}\n {statusResults.length > 0 ? (\n <>\n <ul class=\"timeline\">\n {statusResults.map((status) => (\n <li key={status.id}>\n <Link\n class=\"status-link\"\n to={\n instance\n ? `/${instance}/s/${status.id}`\n : `/s/${status.id}`\n }\n >\n <Status status={status} />\n </Link>\n </li>\n ))}\n </ul>\n {type !== 'statuses' && (\n <div class=\"ui-state\">\n <Link\n class=\"plain button\"\n to={`/search?q=${encodeURIComponent(\n q,\n )}&type=statuses`}\n >\n <Trans>See more posts</Trans>{' '}\n <Icon icon=\"arrow-right\" />\n </Link>\n </div>\n )}\n </>\n ) : (\n !type &&\n (uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No posts found.</Trans>\n </p>\n ))\n )}\n </>\n )}\n {!!type &&\n (uiState === 'default' ? (\n showMore ? (\n <InView\n onChange={(inView) => {\n if (inView) {\n loadResults();\n }\n }}\n >\n <button\n type=\"button\"\n class=\"plain block\"\n onClick={() => loadResults()}\n style={{ marginBlockEnd: '6em' }}\n >\n <Trans>Show more…</Trans>\n </button>\n </InView>\n ) : (\n <p class=\"ui-state insignificant\">\n <Trans>The end.</Trans>\n </p>\n )\n ) : (\n uiState === 'loading' && (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n )\n ))}\n </>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>\n Enter your search term or paste a URL above to get started.\n </Trans>\n </p>\n )}\n </main>\n </div>\n </div>\n );\n}\n\nexport default Search;\n","import '../components/links-bar.css';\nimport './trending.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { MenuItem } from '@szhsin/react-menu';\nimport { getBlurHashAverageColor } from 'fast-blurhash';\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useNavigate, useParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport Menu2 from '../components/menu2';\nimport NameText from '../components/name-text';\nimport RelativeTime from '../components/relative-time';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { oklab2rgb, rgb2oklab } from '../utils/color-utils';\nimport { filteredItems } from '../utils/filters';\nimport pmem from '../utils/pmem';\nimport shortenNumber from '../utils/shorten-number';\nimport states, { saveStatus } from '../utils/states';\nimport supports from '../utils/supports';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\nconst TREND_CACHE_TIME = 10 * 60 * 1000; // 10 minutes\n\nconst fetchLinks = pmem(\n (masto) => {\n return masto.v1.trends.links.list().next();\n },\n {\n maxAge: TREND_CACHE_TIME,\n },\n);\n\nconst fetchHashtags = pmem(\n (masto) => {\n return masto.v1.trends.tags.list().next();\n },\n {\n maxAge: TREND_CACHE_TIME,\n },\n);\n\nfunction fetchTrendsStatuses(masto) {\n if (supports('@pixelfed/trending')) {\n return masto.pixelfed.v2.discover.posts.trending.list({\n range: 'daily',\n });\n }\n return masto.v1.trends.statuses.list({\n limit: LIMIT,\n });\n}\n\nfunction fetchLinkList(masto, params) {\n return masto.v1.timelines.link.list(params);\n}\n\nfunction Trending({ columnMode, ...props }) {\n const snapStates = useSnapshot(states);\n const params = columnMode ? {} : useParams();\n const { masto, instance } = api({\n instance: props?.instance || params.instance,\n });\n const { masto: currentMasto, instance: currentInstance } = api();\n const title = t`Trending (${instance})`;\n useTitle(title, `/:instance?/trending`);\n // const navigate = useNavigate();\n const latestItem = useRef();\n\n const sameCurrentInstance = instance === currentInstance;\n\n const [hashtags, setHashtags] = useState([]);\n const [links, setLinks] = useState([]);\n const trendIterator = useRef();\n\n async function fetchTrends(firstLoad) {\n console.log('fetchTrend', firstLoad);\n if (firstLoad || !trendIterator.current) {\n trendIterator.current = fetchTrendsStatuses(masto);\n\n // Get hashtags\n if (supports('@mastodon/trending-hashtags')) {\n try {\n // const iterator = masto.v1.trends.tags.list();\n const { value: tags } = await fetchHashtags(masto);\n console.log('tags', tags);\n if (tags?.length) {\n setHashtags(tags);\n }\n } catch (e) {\n console.error(e);\n }\n }\n\n // Get links\n if (supports('@mastodon/trending-links')) {\n try {\n const { value } = await fetchLinks(masto, instance);\n // 4 types available: link, photo, video, rich\n // Only want links for now\n const links = value?.filter?.((link) => link.type === 'link');\n console.log('links', links);\n if (links?.length) {\n setLinks(links);\n }\n } catch (e) {\n console.error(e);\n }\n }\n }\n const results = await trendIterator.current.next();\n let { value } = results;\n if (value?.length) {\n if (firstLoad) {\n latestItem.current = value[0].id;\n }\n\n // value = filteredItems(value, 'public'); // Might not work here\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n }\n return {\n ...results,\n value,\n };\n }\n\n // Link mentions\n // https://github.com/mastodon/mastodon/pull/30381\n const [currentLinkMentionsLoading, setCurrentLinkMentionsLoading] =\n useState(false);\n const currentLinkMentionsIterator = useRef();\n const [currentLink, setCurrentLink] = useState(null);\n const hasCurrentLink = !!currentLink;\n const currentLinkRef = useRef();\n const supportsTrendingLinkPosts =\n sameCurrentInstance && supports('@mastodon/trending-link-posts');\n\n useEffect(() => {\n if (currentLink && currentLinkRef.current) {\n currentLinkRef.current.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'center',\n });\n }\n }, [currentLink]);\n\n const prevCurrentLink = useRef();\n async function fetchLinkMentions(firstLoad) {\n if (firstLoad || !currentLinkMentionsIterator.current) {\n setCurrentLinkMentionsLoading(true);\n currentLinkMentionsIterator.current = fetchLinkList(masto, {\n url: currentLink,\n });\n }\n prevCurrentLink.current = currentLink;\n const results = await currentLinkMentionsIterator.current.next();\n let { value } = results;\n if (value?.length) {\n value = filteredItems(value, 'public');\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n }\n if (prevCurrentLink.current === currentLink) {\n setCurrentLinkMentionsLoading(false);\n }\n return {\n ...results,\n value,\n };\n }\n\n async function checkForUpdates() {\n try {\n const results = await masto.v1.trends.statuses\n .list({\n limit: 1,\n // NOT SUPPORTED\n // since_id: latestItem.current,\n })\n .next();\n let { value } = results;\n value = filteredItems(value, 'public');\n if (value?.length && value[0].id !== latestItem.current) {\n latestItem.current = value[0].id;\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n\n const TimelineStart = useMemo(() => {\n return (\n <>\n {!!hashtags.length && (\n <div class=\"filter-bar expandable\">\n <Icon icon=\"chart\" class=\"insignificant\" size=\"l\" />\n {hashtags.map((tag, i) => {\n const { name, history } = tag;\n const total = history.reduce((acc, cur) => acc + +cur.uses, 0);\n return (\n <Link to={`/${instance}/t/${name}`} key={name}>\n <span dir=\"auto\">\n <span class=\"more-insignificant\">#</span>\n {name}\n </span>\n <span class=\"filter-count\">{shortenNumber(total)}</span>\n </Link>\n );\n })}\n </div>\n )}\n {!!links.length && (\n <div class=\"links-bar\">\n <header>\n <h3>\n <Trans>Trending News</Trans>\n </h3>\n </header>\n {links.map((link) => {\n const {\n authors,\n authorName,\n authorUrl,\n blurhash,\n description,\n height,\n image,\n imageDescription,\n language,\n providerName,\n providerUrl,\n publishedAt,\n title,\n url,\n width,\n } = link;\n const author = authors?.[0]?.account?.id\n ? authors[0].account\n : null;\n const isShortTitle = title.length < 30;\n const hasAuthor = !!(authorName || author);\n const domain = punycode.toUnicode(\n URL.parse(url)\n .hostname.replace(/^www\\./, '')\n .replace(/\\/$/, ''),\n );\n let accentColor;\n if (blurhash) {\n const averageColor = getBlurHashAverageColor(blurhash);\n const labAverageColor = rgb2oklab(averageColor);\n accentColor = oklab2rgb([\n 0.6,\n labAverageColor[1],\n labAverageColor[2],\n ]);\n }\n\n return (\n <div key={url}>\n <a\n ref={currentLink === url ? currentLinkRef : null}\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class={`link-block ${\n hasCurrentLink\n ? currentLink === url\n ? 'active'\n : 'inactive'\n : ''\n }`}\n style={\n accentColor\n ? {\n '--accent-color': `rgb(${accentColor.join(',')})`,\n '--accent-alpha-color': `rgba(${accentColor.join(\n ',',\n )}, 0.4)`,\n }\n : {}\n }\n >\n <article>\n <figure>\n <img\n src={image}\n alt={imageDescription}\n width={width}\n height={height}\n loading=\"lazy\"\n />\n </figure>\n <div class=\"article-body\">\n <header>\n <div class=\"article-meta\">\n <span class=\"domain\">{domain}</span>{' '}\n {!!publishedAt && <>· </>}\n {!!publishedAt && (\n <>\n <RelativeTime\n datetime={publishedAt}\n format=\"micro\"\n />\n </>\n )}\n </div>\n {!!title && (\n <h1\n class=\"title\"\n lang={language}\n dir=\"auto\"\n title={title}\n >\n {title}\n </h1>\n )}\n </header>\n {!!description && (\n <p\n class={`description ${\n hasAuthor && !isShortTitle ? '' : 'more-lines'\n }`}\n lang={language}\n dir=\"auto\"\n title={description}\n >\n {description}\n </p>\n )}\n {hasAuthor && (\n <>\n <hr />\n <p class=\"byline\">\n <small>\n <Trans comment=\"By [Author]\">\n By{' '}\n {author ? (\n <NameText account={author} showAvatar />\n ) : authorUrl ? (\n <a\n href={authorUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {authorName}\n </a>\n ) : (\n authorName\n )}\n </Trans>\n </small>\n </p>\n </>\n )}\n </div>\n </article>\n </a>\n {supportsTrendingLinkPosts && (\n <button\n type=\"button\"\n class=\"small plain4 block\"\n onClick={() => {\n setCurrentLink(url);\n }}\n disabled={url === currentLink}\n >\n <Icon icon=\"comment2\" />{' '}\n <span>\n <Trans>Mentions</Trans>\n </span>{' '}\n <Icon icon=\"chevron-down\" />\n </button>\n )}\n </div>\n );\n })}\n </div>\n )}\n {supportsTrendingLinkPosts && !!links.length && (\n <div\n class={`timeline-header-block ${hasCurrentLink ? 'blended' : ''}`}\n >\n {hasCurrentLink ? (\n <>\n <div style={{ width: 50, flexShrink: 0, textAlign: 'center' }}>\n {currentLinkMentionsLoading ? (\n <Loader abrupt />\n ) : (\n <button\n type=\"button\"\n class=\"light\"\n onClick={() => {\n setCurrentLink(null);\n }}\n >\n <Icon icon=\"x\" alt={t`Back to showing trending posts`} />\n </button>\n )}\n </div>\n <p>\n <Trans>\n Showing posts mentioning{' '}\n <span class=\"link-text\">\n {currentLink\n .replace(/^https?:\\/\\/(www\\.)?/i, '')\n .replace(/\\/$/, '')}\n </span>\n </Trans>\n </p>\n </>\n ) : (\n <p class=\"insignificant\">\n <Trans>Trending posts</Trans>\n </p>\n )}\n </div>\n )}\n </>\n );\n }, [hashtags, links, currentLink, currentLinkMentionsLoading]);\n\n return (\n <Timeline\n key={instance}\n title={title}\n titleComponent={\n <h1 class=\"header-double-lines\">\n <b>\n <Trans>Trending</Trans>\n </b>\n <div>{instance}</div>\n </h1>\n }\n id=\"trending\"\n instance={instance}\n emptyText={t`No trending posts.`}\n errorText={t`Unable to load posts`}\n fetchItems={hasCurrentLink ? fetchLinkMentions : fetchTrends}\n checkForUpdates={hasCurrentLink ? undefined : checkForUpdates}\n checkForUpdatesInterval={5 * 60 * 1000} // 5 minutes\n useItemID\n headerStart={<></>}\n boostsCarousel={snapStates.settings.boostsCarousel}\n // allowFilters\n filterContext=\"public\"\n timelineStart={TimelineStart}\n refresh={currentLink}\n clearWhenRefresh\n view={hasCurrentLink ? 'link-mentions' : undefined}\n headerEnd={\n <Menu2\n portal\n // setDownOverflow\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n <MenuItem\n onClick={() => {\n let newInstance = prompt(\n t`Enter a new instance e.g. \"mastodon.social\"`,\n );\n if (!/\\./.test(newInstance)) {\n if (newInstance) alert(t`Invalid instance`);\n return;\n }\n if (newInstance) {\n newInstance = newInstance.toLowerCase().trim();\n // navigate(`/${newInstance}/trending`);\n location.hash = `/${newInstance}/trending`;\n }\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <span>\n <Trans>Go to another instance…</Trans>\n </span>\n </MenuItem>\n {currentInstance !== instance && (\n <MenuItem\n onClick={() => {\n location.hash = `/${currentInstance}/trending`;\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <small class=\"menu-double-lines\">\n <Trans>\n Go to my instance (<b>{currentInstance}</b>)\n </Trans>\n </small>\n </MenuItem>\n )}\n </Menu2>\n }\n />\n );\n}\n\nexport default Trending;\n","import { t, Trans } from '@lingui/macro';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { useSnapshot } from 'valtio';\n\nimport Bookmarks from '../pages/bookmarks';\nimport Favourites from '../pages/favourites';\nimport Following from '../pages/following';\nimport Hashtag from '../pages/hashtag';\nimport List from '../pages/list';\nimport Mentions from '../pages/mentions';\nimport Notifications from '../pages/notifications';\nimport Public from '../pages/public';\nimport Search from '../pages/search';\nimport Trending from '../pages/trending';\nimport isRTL from '../utils/is-rtl';\nimport states from '../utils/states';\nimport useTitle from '../utils/useTitle';\n\nconst scrollIntoViewOptions = {\n block: 'nearest',\n inline: 'nearest',\n behavior: 'smooth',\n};\n\nfunction Columns() {\n useTitle(t`Home`, '/');\n const snapStates = useSnapshot(states);\n const { shortcuts } = snapStates;\n\n console.debug('RENDER Columns', shortcuts);\n\n const components = shortcuts.map((shortcut) => {\n if (!shortcut) return null;\n const { type, ...params } = shortcut;\n const Component = {\n following: Following,\n notifications: Notifications,\n list: List,\n public: Public,\n bookmarks: Bookmarks,\n favourites: Favourites,\n hashtag: Hashtag,\n mentions: Mentions,\n trending: Trending,\n search: Search,\n }[type];\n if (!Component) return null;\n // Don't show Search column with no query, for now\n if (type === 'search' && !params.query) return null;\n // Don't show List column with no list, for now\n if (type === 'list' && !params.id) return null;\n return (\n <Component key={type + JSON.stringify(params)} {...params} columnMode />\n );\n });\n\n useHotkeys(['1', '2', '3', '4', '5', '6', '7', '8', '9'], (e, handler) => {\n try {\n const index = parseInt(handler.keys[0], 10) - 1;\n const $column = document.querySelectorAll('#columns > *')[index];\n if ($column) {\n $column.focus();\n $column.scrollIntoView(scrollIntoViewOptions);\n }\n } catch (e) {\n console.error(e);\n }\n });\n\n useHotkeys(['[', ']'], (e, handler) => {\n const key = handler.keys[0];\n const currentFocusedColumn = document.activeElement.closest('#columns > *');\n\n const rtl = isRTL();\n const prevColKey = rtl ? ']' : '[';\n const nextColKey = rtl ? '[' : ']';\n let $column;\n\n if (key === prevColKey) {\n // If [, focus on left of focused column, else first column\n $column = currentFocusedColumn\n ? currentFocusedColumn.previousElementSibling\n : document.querySelectorAll('#columns > *')[0];\n } else if (key === nextColKey) {\n // If ], focus on right of focused column, else 2nd column\n $column = currentFocusedColumn\n ? currentFocusedColumn.nextElementSibling\n : document.querySelectorAll('#columns > *')[1];\n }\n if ($column) {\n $column.focus();\n $column.scrollIntoView(scrollIntoViewOptions);\n }\n });\n\n return (\n <div\n id=\"columns\"\n onContextMenu={(e) => {\n // If right-click on header, but not links or buttons\n if (\n e.target.closest('.deck > header') &&\n !e.target.closest('a') &&\n !e.target.closest('button')\n ) {\n e.preventDefault();\n states.showShortcutsSettings = true;\n }\n }}\n onFocus={() => {\n // Get current focused column\n const currentFocusedColumn =\n document.activeElement.closest('#columns > *');\n if (currentFocusedColumn) {\n // Remove focus classes from all columns\n // Add focus class to current focused column\n document.querySelectorAll('#columns > *').forEach((column) => {\n column.classList.toggle('focus', column === currentFocusedColumn);\n });\n }\n }}\n >\n {components}\n </div>\n );\n}\n\nexport default Columns;\n","import './notifications-menu.css';\n\nimport { msg, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { ControlledMenu } from '@szhsin/react-menu';\nimport { memo } from 'preact/compat';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport Columns from '../components/columns';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport Notification from '../components/notification';\nimport { api } from '../utils/api';\nimport db from '../utils/db';\nimport { massageNotifications2 } from '../utils/group-notifications';\nimport states, { saveStatus } from '../utils/states';\nimport { getCurrentAccountNS } from '../utils/store-utils';\n\nimport Following from './following';\nimport {\n getGroupedNotifications,\n mastoFetchNotifications,\n} from './notifications';\n\nfunction Home() {\n const { _ } = useLingui();\n const snapStates = useSnapshot(states);\n __BENCHMARK.end('time-to-home');\n useEffect(() => {\n (async () => {\n const keys = await db.drafts.keys();\n if (keys.length) {\n const ns = getCurrentAccountNS();\n const ownKeys = keys.filter((key) => key.startsWith(ns));\n if (ownKeys.length) {\n states.showDrafts = true;\n }\n }\n })();\n }, []);\n\n return (\n <>\n {(snapStates.settings.shortcutsViewMode === 'multi-column' ||\n (!snapStates.settings.shortcutsViewMode &&\n snapStates.settings.shortcutsColumnsMode)) &&\n !!snapStates.shortcuts?.length ? (\n <Columns />\n ) : (\n <Following\n title={_(msg`Home`)}\n path=\"/\"\n id=\"home\"\n headerStart={false}\n headerEnd={<NotificationsLink />}\n />\n )}\n </>\n );\n}\n\nfunction NotificationsLink() {\n const snapStates = useSnapshot(states);\n const notificationLinkRef = useRef();\n const [menuState, setMenuState] = useState(undefined);\n return (\n <>\n <Link\n ref={notificationLinkRef}\n to=\"/notifications\"\n class={`button plain notifications-button ${\n snapStates.notificationsShowNew ? 'has-badge' : ''\n } ${menuState || ''}`}\n onClick={(e) => {\n e.stopPropagation();\n if (window.matchMedia('(min-width: calc(40em))').matches) {\n e.preventDefault();\n setMenuState((state) => (!state ? 'open' : undefined));\n }\n }}\n >\n <Icon icon=\"notification\" size=\"l\" alt={t`Notifications`} />\n </Link>\n <NotificationsMenu\n state={menuState}\n anchorRef={notificationLinkRef}\n onClose={() => setMenuState(undefined)}\n />\n </>\n );\n}\n\nconst NOTIFICATIONS_DISPLAY_LIMIT = 5;\nfunction NotificationsMenu({ anchorRef, state, onClose }) {\n const { masto, instance } = api();\n const snapStates = useSnapshot(states);\n const [uiState, setUIState] = useState('default');\n\n const notificationsIterator = mastoFetchNotifications();\n\n async function fetchNotifications() {\n const allNotifications = await notificationsIterator.next();\n const notifications = massageNotifications2(allNotifications.value);\n\n if (notifications?.length) {\n notifications.forEach((notification) => {\n saveStatus(notification.status, instance, {\n skipThreading: true,\n });\n });\n\n const groupedNotifications = getGroupedNotifications(notifications);\n\n states.notificationsLast = groupedNotifications[0];\n states.notifications = groupedNotifications;\n\n // Update last read marker\n masto.v1.markers\n .create({\n notifications: {\n lastReadId: groupedNotifications[0].id,\n },\n })\n .catch(() => {});\n }\n\n states.notificationsShowNew = false;\n states.notificationsLastFetchTime = Date.now();\n return allNotifications;\n }\n\n const [hasFollowRequests, setHasFollowRequests] = useState(false);\n function fetchFollowRequests() {\n return masto.v1.followRequests.list({\n limit: 1,\n });\n }\n\n function loadNotifications() {\n setUIState('loading');\n (async () => {\n try {\n await fetchNotifications();\n const followRequests = await fetchFollowRequests();\n setHasFollowRequests(!!followRequests?.length);\n setUIState('default');\n } catch (e) {\n setUIState('error');\n }\n })();\n }\n\n useEffect(() => {\n if (state === 'open') loadNotifications();\n }, [state]);\n\n const menuRef = useRef();\n\n return (\n <ControlledMenu\n ref={menuRef}\n menuClassName=\"notifications-menu\"\n state={state}\n anchorRef={anchorRef}\n onClose={onClose}\n portal={{\n target: document.body,\n }}\n containerProps={{\n onClick: () => {\n menuRef.current?.closeMenu?.();\n },\n }}\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n align=\"center\"\n boundingBoxPadding=\"8 8 8 8\"\n >\n <header>\n <h2>\n <Trans>Notifications</Trans>\n </h2>\n </header>\n <main>\n {snapStates.notifications.length ? (\n <>\n {snapStates.notifications\n .slice(0, NOTIFICATIONS_DISPLAY_LIMIT)\n .map((notification) => (\n <Notification\n key={notification._ids || notification.id}\n instance={instance}\n notification={notification}\n disableContextMenu\n />\n ))}\n </>\n ) : uiState === 'loading' ? (\n <div class=\"ui-state\">\n <Loader abrupt />\n </div>\n ) : (\n uiState === 'error' && (\n <div class=\"ui-state\">\n <p>\n <Trans>Unable to fetch notifications.</Trans>\n </p>\n <p>\n <button type=\"button\" onClick={loadNotifications}>\n <Trans>Try again</Trans>\n </button>\n </p>\n </div>\n )\n )}\n </main>\n <footer>\n <Link to=\"/mentions\" class=\"button plain\">\n <Icon icon=\"at\" />{' '}\n <span>\n <Trans>Mentions</Trans>\n </span>\n </Link>\n <Link to=\"/notifications\" class=\"button plain2\">\n {hasFollowRequests ? (\n <Trans>\n <span class=\"tag collapsed\">New</span>{' '}\n <span>Follow Requests</span>\n </Trans>\n ) : (\n <b>\n <Trans>See all</Trans>\n </b>\n )}{' '}\n <Icon icon=\"arrow-right\" />\n </Link>\n </footer>\n </ControlledMenu>\n );\n}\n\nexport default memo(Home);\n","// export const statusRegex = /\\/@([^@\\/]+)@?([^\\/]+)?\\/([^\\/]+)\\/?$/i;\n// export const statusNoteRegex = /\\/notes\\/([^\\/]+)\\/?$/i;\n\nconst statusPostRegexes = [\n /^\\/@[^@\\/]+\\/(?:statuses|posts)\\/([^\\/]+)/i, // GoToSocial, Takahe\n /\\/notes\\/([^\\/]+)/i, // Misskey, Firefish\n /^\\/(?:notice|objects)\\/([a-z0-9-]+)/i, // Pleroma\n /\\/@[^@\\/]+\\/post\\/([^\\/]+)/i, // Threads\n /\\/@[^@\\/]+@?[^\\/]+?\\/([^\\/]+)/i, // Mastodon\n /^\\/p\\/[^\\/]+\\/([^\\/]+)/i, // Pixelfed\n];\n\nexport function getInstanceStatusObject(url) {\n // Regex /:username/:id, where username = @username or @username@domain, id = anything\n const { hostname, pathname } = URL.parse(url);\n // const [, username, domain, id] = pathname.match(statusRegex) || [];\n for (const regex of statusPostRegexes) {\n const [, id] = pathname.match(regex) || [];\n console.log(pathname, regex, id);\n if (id) {\n return {\n instance: hostname,\n id,\n };\n }\n }\n return {};\n}\n\nfunction getInstanceStatusURL(url) {\n const { instance, id } = getInstanceStatusObject(url);\n if (instance && id) {\n return `/${instance}/s/${id}`;\n }\n return null;\n}\n\nexport default getInstanceStatusURL;\n","import { t, Trans } from '@lingui/macro';\nimport { useLayoutEffect, useState } from 'preact/hooks';\nimport { useLocation } from 'react-router-dom';\n\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport { api } from '../utils/api';\nimport getInstanceStatusURL, {\n getInstanceStatusObject,\n} from '../utils/get-instance-status-url';\n\nexport default function HttpRoute() {\n const location = useLocation();\n const url = location.pathname.replace(/^\\//, '');\n const statusObject = getInstanceStatusObject(url);\n // const statusURL = getInstanceStatusURL(url);\n const statusURL = statusObject?.instance\n ? `/${statusObject.instance}/s/${statusObject.id}`\n : null;\n const [uiState, setUIState] = useState('loading');\n\n useLayoutEffect(() => {\n setUIState('loading');\n (async () => {\n // Check if status returns 200\n try {\n const { instance, id } = statusObject;\n if (id) {\n const { masto } = api({ instance });\n const status = await masto.v1.statuses.$select(id).fetch();\n if (status) {\n window.location.hash = statusURL + '?view=full';\n return;\n }\n }\n } catch (e) {}\n\n // Fallback to search\n {\n const { masto: currentMasto, instance: currentInstance } = api();\n const result = await currentMasto.v2.search.fetch({\n q: url,\n limit: 1,\n resolve: true,\n });\n if (result.statuses.length) {\n const status = result.statuses[0];\n window.location.hash = `/${currentInstance}/s/${status.id}?view=full`;\n } else if (result.accounts.length) {\n const account = result.accounts[0];\n window.location.hash = `/${currentInstance}/a/${account.id}`;\n } else if (statusURL) {\n // Fallback to original URL, which will probably show error\n window.location.hash = statusURL + '?view=full';\n } else {\n setUIState('error');\n }\n }\n })();\n }, [statusURL]);\n\n return (\n <div class=\"ui-state\" tabIndex=\"-1\">\n {uiState === 'loading' ? (\n <>\n <Loader abrupt />\n <h2>\n <Trans>Resolving…</Trans>\n </h2>\n <p>\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n {url}\n </a>\n </p>\n </>\n ) : (\n <>\n <h2>\n <Trans>Unable to resolve URL</Trans>\n </h2>\n <p>\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n {url}\n </a>\n </p>\n </>\n )}\n <hr />\n <p>\n <Link to=\"/\">\n <Trans>Go home</Trans>\n </Link>\n </p>\n </div>\n );\n}\n","import './lists.css';\n\nimport { Plural, t, Trans } from '@lingui/macro';\nimport { useEffect, useReducer, useState } from 'preact/hooks';\n\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport ListAddEdit from '../components/list-add-edit';\nimport Loader from '../components/loader';\nimport Modal from '../components/modal';\nimport NavMenu from '../components/nav-menu';\nimport { fetchLists } from '../utils/lists';\nimport useTitle from '../utils/useTitle';\n\nfunction Lists() {\n useTitle(t`Lists`, `/l`);\n const [uiState, setUIState] = useState('default');\n\n const [reloadCount, reload] = useReducer((c) => c + 1, 0);\n const [lists, setLists] = useState([]);\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const lists = await fetchLists();\n console.log(lists);\n setLists(lists);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, [reloadCount]);\n\n const [showListAddEditModal, setShowListAddEditModal] = useState(false);\n\n return (\n <div id=\"lists-page\" class=\"deck-container\" tabIndex=\"-1\">\n <div class=\"timeline-deck deck\">\n <header>\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n <Link to=\"/\" class=\"button plain\">\n <Icon icon=\"home\" size=\"l\" />\n </Link>\n </div>\n <h1>\n <Trans>Lists</Trans>\n </h1>\n <div class=\"header-side\">\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => setShowListAddEditModal(true)}\n >\n <Icon icon=\"plus\" size=\"l\" alt={t`New list`} />\n </button>\n </div>\n </div>\n </header>\n <main>\n {lists.length > 0 ? (\n <>\n <ul class=\"link-list\">\n {lists.map((list) => (\n <li>\n <Link to={`/l/${list.id}`}>\n <span>\n <Icon icon=\"list\" /> <span>{list.title}</span>\n </span>\n {/* <button\n type=\"button\"\n class=\"plain\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n setShowListAddEditModal({\n list,\n });\n }}\n >\n <Icon icon=\"pencil\" />\n </button> */}\n </Link>\n </li>\n ))}\n </ul>\n {lists.length > 1 && (\n <footer class=\"ui-state\">\n <small class=\"insignificant\">\n <Plural value={lists.length} one=\"# list\" other=\"# lists\" />\n </small>\n </footer>\n )}\n </>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader />\n </p>\n ) : uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Unable to load lists.</Trans>\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No lists yet.</Trans>\n </p>\n )}\n </main>\n </div>\n {showListAddEditModal && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowListAddEditModal(false);\n }\n }}\n >\n <ListAddEdit\n list={showListAddEditModal?.list}\n onClose={(result) => {\n if (result.state === 'success') {\n reload();\n }\n setShowListAddEditModal(false);\n }}\n />\n </Modal>\n )}\n </div>\n );\n}\n\nexport default Lists;\n","export default \"__VITE_ASSET__Y_wpqkTO__\"","function dec2hex(dec) {\n return ('0' + dec.toString(16)).slice(-2);\n}\nexport function verifier() {\n var array = new Uint32Array(56 / 2);\n window.crypto.getRandomValues(array);\n return Array.from(array, dec2hex).join('');\n}\nfunction sha256(plain) {\n // returns promise ArrayBuffer\n const encoder = new TextEncoder();\n const data = encoder.encode(plain);\n return window.crypto.subtle.digest('SHA-256', data);\n}\nfunction base64urlencode(a) {\n let str = '';\n const bytes = new Uint8Array(a);\n const len = bytes.byteLength;\n for (var i = 0; i < len; i++) {\n str += String.fromCharCode(bytes[i]);\n }\n return btoa(str).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}\nexport async function generateCodeChallenge(v) {\n const hashed = await sha256(v);\n return base64urlencode(hashed);\n}\n\n// If /.well-known/oauth-authorization-server exists and code_challenge_methods_supported includes \"S256\", means support PKCE\nexport async function supportsPKCE({ instanceURL }) {\n if (!instanceURL) return false;\n try {\n const res = await fetch(\n `https://${instanceURL}/.well-known/oauth-authorization-server`,\n );\n if (!res.ok || res.status !== 200) return false;\n const json = await res.json();\n if (json.code_challenge_methods_supported?.includes('S256')) return true;\n return false;\n } catch (e) {\n return false;\n }\n}\n\n// For debugging\nwindow.__generateCodeChallenge = generateCodeChallenge;\n","import { generateCodeChallenge, verifier } from './oauth-pkce';\n\nconst {\n DEV,\n PHANPY_CLIENT_NAME: CLIENT_NAME,\n PHANPY_WEBSITE: WEBSITE,\n} = import.meta.env;\n\nconst SCOPES = 'read write follow push';\n\n/*\n PHANPY_WEBSITE is set to the default official site.\n It's used in pre-built releases, so there's no way to change it dynamically\n without rebuilding.\n Therefore, we can't use it as redirect_uri.\n We only use PHANPY_WEBSITE if it's \"same\" as current location URL.\n \n Very basic check based on location.hostname for now\n*/\nconst sameSite = WEBSITE\n ? WEBSITE.toLowerCase().includes(location.hostname)\n : false;\nconst currentLocation = location.origin + location.pathname;\nconst REDIRECT_URI = DEV || !sameSite ? currentLocation : WEBSITE;\n\nexport async function registerApplication({ instanceURL }) {\n const registrationParams = new URLSearchParams({\n client_name: CLIENT_NAME,\n redirect_uris: REDIRECT_URI,\n scopes: SCOPES,\n website: WEBSITE,\n });\n const registrationResponse = await fetch(\n `https://${instanceURL}/api/v1/apps`,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n body: registrationParams.toString(),\n },\n );\n const registrationJSON = await registrationResponse.json();\n console.log({ registrationJSON });\n return registrationJSON;\n}\n\nexport async function getPKCEAuthorizationURL({ instanceURL, client_id }) {\n const codeVerifier = verifier();\n const codeChallenge = await generateCodeChallenge(codeVerifier);\n const params = new URLSearchParams({\n client_id,\n code_challenge_method: 'S256',\n code_challenge: codeChallenge,\n redirect_uri: REDIRECT_URI,\n response_type: 'code',\n scope: SCOPES,\n });\n const authorizationURL = `https://${instanceURL}/oauth/authorize?${params.toString()}`;\n return [authorizationURL, codeVerifier];\n}\n\nexport async function getAuthorizationURL({ instanceURL, client_id }) {\n const authorizationParams = new URLSearchParams({\n client_id,\n scope: SCOPES,\n redirect_uri: REDIRECT_URI,\n // redirect_uri: 'urn:ietf:wg:oauth:2.0:oob',\n response_type: 'code',\n });\n const authorizationURL = `https://${instanceURL}/oauth/authorize?${authorizationParams.toString()}`;\n return authorizationURL;\n}\n\nexport async function getAccessToken({\n instanceURL,\n client_id,\n client_secret,\n code,\n code_verifier,\n}) {\n const params = new URLSearchParams({\n client_id,\n redirect_uri: REDIRECT_URI,\n grant_type: 'authorization_code',\n code,\n scope: SCOPES,\n // client_secret,\n // code_verifier,\n });\n if (client_secret) {\n params.append('client_secret', client_secret);\n }\n if (code_verifier) {\n params.append('code_verifier', code_verifier);\n }\n const tokenResponse = await fetch(`https://${instanceURL}/oauth/token`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n body: params.toString(),\n });\n const tokenJSON = await tokenResponse.json();\n console.log({ tokenJSON });\n return tokenJSON;\n}\n","import './login.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport Fuse from 'fuse.js';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useSearchParams } from 'react-router-dom';\n\nimport logo from '../assets/logo.svg';\n\nimport LangSelector from '../components/lang-selector';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport instancesListURL from '../data/instances.json?url';\nimport {\n getAuthorizationURL,\n getPKCEAuthorizationURL,\n registerApplication,\n} from '../utils/auth';\nimport { supportsPKCE } from '../utils/oauth-pkce';\nimport store from '../utils/store';\nimport useTitle from '../utils/useTitle';\n\nconst { PHANPY_DEFAULT_INSTANCE: DEFAULT_INSTANCE } = import.meta.env;\n\nfunction Login() {\n useTitle('Log in');\n const instanceURLRef = useRef();\n const cachedInstanceURL = store.local.get('instanceURL');\n const [uiState, setUIState] = useState('default');\n const [searchParams] = useSearchParams();\n const instance = searchParams.get('instance');\n const submit = searchParams.get('submit');\n const [instanceText, setInstanceText] = useState(\n instance || cachedInstanceURL?.toLowerCase() || '',\n );\n\n const [instancesList, setInstancesList] = useState([]);\n const searcher = useRef();\n useEffect(() => {\n (async () => {\n try {\n const res = await fetch(instancesListURL);\n const data = await res.json();\n setInstancesList(data);\n searcher.current = new Fuse(data);\n } catch (e) {\n // Silently fail\n console.error(e);\n }\n })();\n }, []);\n\n // useEffect(() => {\n // if (cachedInstanceURL) {\n // instanceURLRef.current.value = cachedInstanceURL.toLowerCase();\n // }\n // }, []);\n\n const submitInstance = (instanceURL) => {\n if (!instanceURL) return;\n\n (async () => {\n // WEB_DOMAIN vs LOCAL_DOMAIN negotiation time\n // https://docs.joinmastodon.org/admin/config/#web_domain\n try {\n const res = await fetch(`https://${instanceURL}/.well-known/host-meta`); // returns XML\n const text = await res.text();\n // Parse XML\n const parser = new DOMParser();\n const xmlDoc = parser.parseFromString(text, 'text/xml');\n // Get Link[template]\n const link = xmlDoc.getElementsByTagName('Link')[0];\n const template = link.getAttribute('template');\n const url = URL.parse(template);\n const { host } = url; // host includes the port\n if (instanceURL !== host) {\n console.log(`💫 ${instanceURL} -> ${host}`);\n instanceURL = host;\n }\n } catch (e) {\n // Silently fail\n console.error(e);\n }\n\n store.local.set('instanceURL', instanceURL);\n\n setUIState('loading');\n try {\n const { client_id, client_secret, vapid_key } =\n await registerApplication({\n instanceURL,\n });\n\n const authPKCE = await supportsPKCE({ instanceURL });\n console.log({ authPKCE });\n if (authPKCE) {\n if (client_id && client_secret) {\n store.sessionCookie.set('clientID', client_id);\n store.sessionCookie.set('clientSecret', client_secret);\n store.sessionCookie.set('vapidKey', vapid_key);\n\n const [url, verifier] = await getPKCEAuthorizationURL({\n instanceURL,\n client_id,\n });\n store.sessionCookie.set('codeVerifier', verifier);\n location.href = url;\n } else {\n alert(t`Failed to register application`);\n }\n } else {\n if (client_id && client_secret) {\n store.sessionCookie.set('clientID', client_id);\n store.sessionCookie.set('clientSecret', client_secret);\n store.sessionCookie.set('vapidKey', vapid_key);\n\n location.href = await getAuthorizationURL({\n instanceURL,\n client_id,\n });\n } else {\n alert(t`Failed to register application`);\n }\n }\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n };\n\n const cleanInstanceText = instanceText\n ? instanceText\n .replace(/^https?:\\/\\//, '') // Remove protocol from instance URL\n .replace(/\\/+$/, '') // Remove trailing slash\n .replace(/^@?[^@]+@/, '') // Remove @?acct@\n .trim()\n : null;\n const instanceTextLooksLikeDomain =\n /[^\\s\\r\\n\\t\\/\\\\]+\\.[^\\s\\r\\n\\t\\/\\\\]+/.test(cleanInstanceText) &&\n !/[\\s\\/\\\\@]/.test(cleanInstanceText);\n\n const instancesSuggestions = cleanInstanceText\n ? searcher.current\n ?.search(cleanInstanceText, {\n limit: 10,\n })\n ?.map((match) => match.item)\n : [];\n\n const selectedInstanceText = instanceTextLooksLikeDomain\n ? cleanInstanceText\n : instancesSuggestions?.length\n ? instancesSuggestions[0]\n : instanceText\n ? instancesList.find((instance) => instance.includes(instanceText))\n : null;\n\n const onSubmit = (e) => {\n e.preventDefault();\n // const { elements } = e.target;\n // let instanceURL = elements.instanceURL.value.toLowerCase();\n // // Remove protocol from instance URL\n // instanceURL = instanceURL.replace(/^https?:\\/\\//, '').replace(/\\/+$/, '');\n // // Remove @acct@ or acct@ from instance URL\n // instanceURL = instanceURL.replace(/^@?[^@]+@/, '');\n // if (!/\\./.test(instanceURL)) {\n // instanceURL = instancesList.find((instance) =>\n // instance.includes(instanceURL),\n // );\n // }\n // submitInstance(instanceURL);\n submitInstance(selectedInstanceText);\n };\n\n if (submit) {\n useEffect(() => {\n submitInstance(instance || selectedInstanceText);\n }, []);\n }\n\n return (\n <main id=\"login\" style={{ textAlign: 'center' }}>\n <form onSubmit={onSubmit}>\n <h1>\n <img src={logo} alt=\"\" width=\"80\" height=\"80\" />\n <br />\n <Trans>Log in</Trans>\n </h1>\n <label>\n <p>\n <Trans>Instance</Trans>\n </p>\n <input\n value={instanceText}\n required\n type=\"text\"\n class=\"large\"\n id=\"instanceURL\"\n ref={instanceURLRef}\n disabled={uiState === 'loading'}\n // list=\"instances-list\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n spellCheck={false}\n placeholder={t`instance domain`}\n onInput={(e) => {\n setInstanceText(e.target.value);\n }}\n dir=\"auto\"\n />\n {instancesSuggestions?.length > 0 ? (\n <ul id=\"instances-suggestions\">\n {instancesSuggestions.map((instance, i) => (\n <li>\n <button\n type=\"button\"\n class=\"plain5\"\n onClick={() => {\n submitInstance(instance);\n }}\n >\n {instance}\n </button>\n </li>\n ))}\n </ul>\n ) : (\n <div id=\"instances-eg\">\n <Trans>e.g. “mastodon.social”</Trans>\n </div>\n )}\n {/* <datalist id=\"instances-list\">\n {instancesList.map((instance) => (\n <option value={instance} />\n ))}\n </datalist> */}\n </label>\n {uiState === 'error' && (\n <p class=\"error\">\n <Trans>\n Failed to log in. Please try again or try another instance.\n </Trans>\n </p>\n )}\n <div>\n <button\n disabled={\n uiState === 'loading' || !instanceText || !selectedInstanceText\n }\n >\n {selectedInstanceText\n ? t`Continue with ${selectedInstanceText}`\n : t`Continue`}\n </button>{' '}\n </div>\n <Loader hidden={uiState !== 'loading'} />\n <hr />\n {!DEFAULT_INSTANCE && (\n <p>\n <a href=\"https://joinmastodon.org/servers\" target=\"_blank\">\n <Trans>Don't have an account? Create one!</Trans>\n </a>\n </p>\n )}\n <p>\n <Link to=\"/\">\n <Trans>Go home</Trans>\n </Link>\n </p>\n <LangSelector />\n </form>\n </main>\n );\n}\n\nexport default Login;\n","import './status.css';\n\nimport { Plural, t, Trans } from '@lingui/macro';\nimport { Menu, MenuDivider, MenuHeader, MenuItem } from '@szhsin/react-menu';\nimport debounce from 'just-debounce-it';\nimport pRetry from 'p-retry';\nimport { memo } from 'preact/compat';\nimport {\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { InView } from 'react-intersection-observer';\nimport { matchPath, useSearchParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport Avatar from '../components/avatar';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport MediaModal from '../components/media-modal';\nimport Menu2 from '../components/menu2';\nimport NameText from '../components/name-text';\nimport RelativeTime from '../components/relative-time';\nimport Status from '../components/status';\nimport { api } from '../utils/api';\nimport htmlContentLength from '../utils/html-content-length';\nimport shortenNumber from '../utils/shorten-number';\nimport states, {\n getStatus,\n saveStatus,\n statusKey,\n threadifyStatus,\n} from '../utils/states';\nimport statusPeek from '../utils/status-peek';\nimport { getCurrentAccount } from '../utils/store-utils';\nimport useScroll from '../utils/useScroll';\nimport useTitle from '../utils/useTitle';\n\nimport getInstanceStatusURL from './../utils/get-instance-status-url';\n\nconst { PHANPY_DEFAULT_INSTANCE: DEFAULT_INSTANCE } = import.meta.env;\n\nconst LIMIT = 40;\nconst SUBCOMMENTS_OPEN_ALL_LIMIT = 10;\nconst MAX_WEIGHT = 5;\n\nlet cachedRepliesToggle = {};\nlet cachedStatusesMap = {};\nlet scrollPositions = {};\nfunction resetScrollPosition(id) {\n delete cachedStatusesMap[id];\n delete scrollPositions[id];\n}\n\nconst scrollIntoViewOptions = {\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n};\n\n// Select all statuses except those inside collapsed details/summary\n// Hat-tip to @AmeliaBR@front-end.social\n// https://front-end.social/@AmeliaBR/109784776146144471\nconst STATUSES_SELECTOR =\n '.status-link:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *), .status-focus:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *)';\n\nconst STATUS_URL_REGEX = /\\/s\\//i;\n\nfunction StatusPage(params) {\n const { id } = params;\n const { masto, instance } = api({ instance: params.instance });\n const snapStates = useSnapshot(states);\n const [searchParams, setSearchParams] = useSearchParams();\n const mediaParam = searchParams.get('media');\n const mediaOnlyParam = searchParams.get('media-only');\n const mediaIndex = parseInt(mediaParam || mediaOnlyParam, 10);\n let showMedia = mediaIndex > 0;\n const mediaStatusID = searchParams.get('mediaStatusID');\n const mediaStatus = getStatus(mediaStatusID, instance);\n if (mediaStatusID && !mediaStatus) {\n showMedia = false;\n }\n const showMediaOnly = showMedia && !!mediaOnlyParam;\n\n const sKey = statusKey(id, instance);\n const [heroStatus, setHeroStatus] = useState(states.statuses[sKey]);\n useEffect(() => {\n if (states.statuses[sKey]) {\n setHeroStatus(states.statuses[sKey]);\n }\n }, [sKey]);\n\n const closeLink = useMemo(() => {\n const { prevLocation } = states;\n const pathname =\n (prevLocation?.pathname || '') + (prevLocation?.search || '');\n const matchStatusPath =\n matchPath('/:instance/s/:id', pathname) || matchPath('/s/:id', pathname);\n if (!pathname || matchStatusPath) {\n return '/';\n }\n return pathname;\n }, []);\n\n useEffect(() => {\n if (!heroStatus && showMedia) {\n (async () => {\n try {\n const status = await masto.v1.statuses.$select(id).fetch();\n saveStatus(status, instance);\n setHeroStatus(status);\n } catch (err) {\n console.error(err);\n alert('Unable to load post.');\n location.hash = closeLink;\n }\n })();\n }\n }, [showMedia]);\n\n const mediaAttachments = mediaStatusID\n ? snapStates.statuses[statusKey(mediaStatusID, instance)]?.mediaAttachments\n : heroStatus?.mediaAttachments;\n\n const handleMediaClose = useCallback(() => {\n if (\n !window.matchMedia('(min-width: calc(40em + 350px))').matches &&\n snapStates.prevLocation\n ) {\n history.back();\n } else {\n if (showMediaOnly) {\n location.hash = closeLink;\n } else {\n searchParams.delete('media');\n searchParams.delete('mediaStatusID');\n setSearchParams(searchParams);\n }\n }\n }, [showMediaOnly, closeLink, snapStates.prevLocation]);\n\n useEffect(() => {\n let timer = setTimeout(() => {\n // carouselRef.current?.focus?.();\n const $carousel = document.querySelector('.carousel');\n if ($carousel) {\n $carousel.focus();\n }\n }, 100);\n return () => clearTimeout(timer);\n }, [showMediaOnly]);\n\n useEffect(() => {\n const $deckContainers = document.querySelectorAll('.deck-container');\n $deckContainers.forEach(($deckContainer) => {\n $deckContainer.setAttribute('inert', '');\n });\n return () => {\n $deckContainers.forEach(($deckContainer) => {\n $deckContainer.removeAttribute('inert');\n });\n };\n }, []);\n\n return (\n <div class=\"deck-backdrop\">\n {showMedia ? (\n mediaAttachments?.length ? (\n <MediaModal\n mediaAttachments={mediaAttachments}\n statusID={mediaStatusID || id}\n instance={instance}\n lang={heroStatus?.language}\n index={mediaIndex - 1}\n onClose={handleMediaClose}\n />\n ) : (\n <div class=\"media-modal-container loading\">\n <Loader abrupt />\n </div>\n )\n ) : (\n <Link to={closeLink} />\n )}\n {!showMediaOnly && (\n <StatusThread\n id={id}\n instance={params.instance}\n closeLink={closeLink}\n />\n )}\n </div>\n );\n}\n\nfunction StatusParent(props) {\n const { linkable, to, onClick, ...restProps } = props;\n return linkable ? (\n <Link class=\"status-link\" to={to} onClick={onClick} {...restProps} />\n ) : (\n <div class=\"status-focus\" tabIndex={0} {...restProps} />\n );\n}\n\n// oldest first\nfunction createdAtSort(a, b) {\n return new Date(b.created_at) - new Date(a.created_at);\n}\n\nfunction StatusThread({ id, closeLink = '/', instance: propInstance }) {\n const [searchParams, setSearchParams] = useSearchParams();\n const mediaParam = searchParams.get('media');\n const mediaStatusID = searchParams.get('mediaStatusID');\n const showMedia = parseInt(mediaParam, 10) > 0;\n const firstLoad = useRef(\n !states.prevLocation &&\n (history.length === 1 ||\n ('navigation' in window && navigation?.entries?.()?.length === 1)),\n );\n const [viewMode, setViewMode] = useState(\n searchParams.get('view') || firstLoad.current ? 'full' : null,\n );\n const translate = !!parseInt(searchParams.get('translate'));\n const { masto, instance } = api({ instance: propInstance });\n const {\n masto: currentMasto,\n instance: currentInstance,\n authenticated,\n } = api();\n const sameInstance = instance === currentInstance;\n const snapStates = useSnapshot(states);\n const [statuses, setStatuses] = useState([]);\n const [uiState, setUIState] = useState('default');\n const heroStatusRef = useRef();\n const sKey = statusKey(id, instance);\n const totalDescendants = useRef(0);\n\n const scrollableRef = useRef();\n useEffect(() => {\n scrollableRef.current?.focus();\n }, []);\n useEffect(() => {\n const onScroll = debounce(() => {\n // console.log('onScroll');\n if (!scrollableRef.current) return;\n const { scrollTop } = scrollableRef.current;\n if (uiState !== 'loading') {\n scrollPositions[id] = scrollTop;\n }\n }, 50);\n scrollableRef.current?.addEventListener('scroll', onScroll, {\n passive: true,\n });\n onScroll();\n return () => {\n onScroll.cancel();\n scrollableRef.current?.removeEventListener('scroll', onScroll);\n };\n }, [id, uiState !== 'loading']);\n\n const scrollOffsets = useRef();\n const lastInitContextTS = useRef();\n const initContext = ({ reloadHero } = {}) => {\n console.debug('initContext', id);\n setUIState('loading');\n let heroTimer;\n\n const cachedStatuses = cachedStatusesMap[id];\n if (cachedStatuses) {\n // Case 1: It's cached, let's restore them to make it snappy\n const reallyCachedStatuses = cachedStatuses.filter(\n (s) => states.statuses[sKey],\n // Some are not cached in the global state, so we need to filter them out\n );\n setStatuses(reallyCachedStatuses);\n } else {\n // const heroIndex = statuses.findIndex((s) => s.id === id);\n // if (heroIndex !== -1) {\n // // Case 2: It's in current statuses. Slice off all descendant statuses after the hero status to be safe\n // const slicedStatuses = statuses.slice(0, heroIndex + 1);\n // setStatuses(slicedStatuses);\n // } else {\n // Case 3: Not cached and not in statuses, let's start from scratch\n setStatuses([{ id }]);\n // }\n }\n\n (async () => {\n const heroFetch = () =>\n pRetry(() => masto.v1.statuses.$select(id).fetch(), {\n retries: 4,\n });\n const contextFetch = pRetry(\n () => masto.v1.statuses.$select(id).context.fetch(),\n {\n retries: 8,\n },\n );\n\n const hasStatus = !!snapStates.statuses[sKey];\n let heroStatus = snapStates.statuses[sKey];\n if (hasStatus && !reloadHero) {\n console.debug('Hero status is cached');\n } else {\n try {\n heroStatus = await heroFetch();\n saveStatus(heroStatus, instance);\n // Give time for context to appear\n await new Promise((resolve) => {\n setTimeout(resolve, 100);\n });\n } catch (e) {\n console.error(e);\n setUIState('error');\n return;\n }\n }\n\n try {\n const context = await contextFetch;\n const { ancestors, descendants } = context;\n\n ancestors.sort(createdAtSort);\n descendants.sort(createdAtSort);\n\n totalDescendants.current = descendants?.length || 0;\n\n const missingStatuses = new Set();\n ancestors.forEach((status) => {\n saveStatus(status, instance, {\n skipThreading: true,\n });\n if (\n status.inReplyToId &&\n !ancestors.find((s) => s.id === status.inReplyToId)\n ) {\n missingStatuses.add(status.inReplyToId);\n }\n });\n const ancestorsIsThread = ancestors.every(\n (s) => s.account.id === heroStatus.account.id,\n );\n const nestedDescendants = [];\n descendants.forEach((status) => {\n saveStatus(status, instance, {\n skipThreading: true,\n });\n\n if (\n status.inReplyToId &&\n !descendants.find((s) => s.id === status.inReplyToId) &&\n status.inReplyToId !== heroStatus.id\n ) {\n missingStatuses.add(status.inReplyToId);\n }\n\n if (status.inReplyToAccountId === status.account.id) {\n // If replying to self, it's part of the thread, level 1\n nestedDescendants.push(status);\n } else if (status.inReplyToId === heroStatus.id) {\n // If replying to the hero status, it's a reply, level 1\n nestedDescendants.push(status);\n } else if (\n !status.inReplyToAccountId &&\n nestedDescendants.find(\n (s) =>\n s.id === status.inReplyToId &&\n s.account.id === heroStatus.account.id,\n ) &&\n status.account.id === heroStatus.account.id\n ) {\n // If replying to hero's own statuses, it's part of the thread, level 1\n nestedDescendants.push(status);\n } else {\n // If replying to someone else, it's a reply to a reply, level 2\n const parent = descendants.find((s) => s.id === status.inReplyToId);\n if (parent) {\n if (!parent.__replies) {\n parent.__replies = [];\n }\n parent.__replies.push(status);\n } else {\n // If no parent, something is wrong\n console.warn('No parent found for', status);\n }\n }\n });\n\n // sort hero author to top\n nestedDescendants.sort((a, b) => {\n const heroAccountID = heroStatus.account.id;\n if (a.account.id === heroAccountID && b.account.id !== heroAccountID)\n return -1;\n if (b.account.id === heroAccountID && a.account.id !== heroAccountID)\n return 1;\n return 0;\n });\n\n console.log({ ancestors, descendants, nestedDescendants });\n if (missingStatuses.size) {\n console.error('Missing statuses', [...missingStatuses]);\n }\n\n let descendantLevelsCount = 1;\n function expandReplies(_replies, level) {\n const nextLevel = level + 1;\n if (nextLevel > descendantLevelsCount) {\n descendantLevelsCount = level;\n }\n return _replies?.map((_r) => ({\n id: _r.id,\n account: _r.account,\n repliesCount: _r.repliesCount,\n content: _r.content,\n weight: calcStatusWeight(_r),\n level: nextLevel,\n replies: expandReplies(_r.__replies, nextLevel),\n }));\n }\n\n const allStatuses = [\n ...ancestors.map((s) => ({\n id: s.id,\n ancestor: true,\n isThread: ancestorsIsThread,\n accountID: s.account.id,\n account: s.account,\n repliesCount: s.repliesCount,\n weight: calcStatusWeight(s),\n })),\n {\n id,\n accountID: heroStatus.account.id,\n weight: calcStatusWeight(heroStatus),\n },\n ...nestedDescendants.map((s) => ({\n id: s.id,\n account: s.account,\n accountID: s.account.id,\n descendant: true,\n thread: s.account.id === heroStatus.account.id,\n weight: calcStatusWeight(s),\n level: 1,\n replies: expandReplies(s.__replies, 1),\n })),\n ];\n\n setUIState('default');\n scrollOffsets.current = {\n offsetTop: heroStatusRef.current?.offsetTop,\n scrollTop: scrollableRef.current?.scrollTop,\n };\n\n // Set limit to hero's index\n // const heroLimit = allStatuses.findIndex((s) => s.id === id);\n const heroLimit = ancestors.length || 0; // 0-indexed\n if (heroLimit >= limit) {\n setLimit(heroLimit + 1);\n }\n\n console.log({ allStatuses, descendantLevelsCount });\n setStatuses(allStatuses);\n cachedStatusesMap[id] = allStatuses;\n\n // Let's threadify this one\n // Note that all non-hero statuses will trigger saveStatus which will threadify them too\n // By right, at this point, all descendant statuses should be cached\n threadifyStatus(heroStatus, instance);\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n\n lastInitContextTS.current = Date.now();\n\n return () => {\n clearTimeout(heroTimer);\n };\n };\n\n useEffect(initContext, [id, masto]);\n\n const [showRefresh, setShowRefresh] = useState(false);\n useEffect(() => {\n let interval = setInterval(() => {\n const now = Date.now();\n if (\n lastInitContextTS.current &&\n now - lastInitContextTS.current >= 60_000\n ) {\n setShowRefresh(true);\n }\n }, 60_000); // 1 minute\n return () => {\n clearInterval(interval);\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!statuses.length) return;\n console.debug('STATUSES', statuses);\n const scrollPosition = scrollPositions[id];\n console.debug('scrollPosition', scrollPosition);\n if (!!scrollPosition) {\n console.debug('Case 1', {\n id,\n scrollPosition,\n });\n scrollableRef.current.scrollTop = scrollPosition;\n } else if (scrollOffsets.current) {\n const newScrollOffsets = {\n offsetTop: heroStatusRef.current?.offsetTop,\n scrollTop: scrollableRef.current?.scrollTop,\n };\n const newScrollTop =\n newScrollOffsets.offsetTop -\n scrollOffsets.current.offsetTop +\n newScrollOffsets.scrollTop;\n console.debug('Case 2', {\n scrollOffsets: scrollOffsets.current,\n newScrollOffsets,\n newScrollTop,\n statuses: [...statuses],\n });\n scrollableRef.current.scrollTop = newScrollTop;\n } else if (statuses.length === 1) {\n console.debug('Case 3', {\n id,\n });\n scrollableRef.current.scrollTop = 0;\n }\n\n // RESET\n scrollOffsets.current = null;\n }, [statuses]);\n\n useEffect(() => {\n if (snapStates.reloadStatusPage <= 0) return;\n // Delete the cache for the context\n (async () => {\n try {\n const { instanceURL } = getCurrentAccount();\n const contextURL = `https://${instanceURL}/api/v1/statuses/${id}/context`;\n console.log('Clear cache', contextURL);\n const apiCache = await caches.open('api');\n await apiCache.delete(contextURL, { ignoreVary: true });\n\n return initContext({\n reloadHero: true,\n });\n } catch (e) {\n console.error(e);\n }\n })();\n }, [snapStates.reloadStatusPage]);\n\n useEffect(() => {\n return () => {\n // RESET\n scrollPositions = {};\n states.reloadStatusPage = 0;\n cachedStatusesMap = {};\n cachedRepliesToggle = {};\n statusWeightCache.clear();\n };\n }, []);\n\n const heroStatus = snapStates.statuses[sKey] || snapStates.statuses[id];\n const heroDisplayName = useMemo(() => {\n // Remove shortcodes from display name\n if (!heroStatus) return '';\n const { account } = heroStatus;\n const div = document.createElement('div');\n div.innerHTML = account.displayName;\n return div.innerText.trim();\n }, [heroStatus]);\n const heroContentText = useMemo(() => {\n if (!heroStatus) return '';\n let text = statusPeek(heroStatus);\n if (text.length > 64) {\n // \"The title should ideally be less than 64 characters in length\"\n // https://www.w3.org/Provider/Style/TITLE.html\n text = text.slice(0, 64) + '…';\n }\n return text;\n }, [heroStatus]);\n useTitle(\n heroDisplayName && heroContentText\n ? `${heroDisplayName}: \"${heroContentText}\"`\n : t({\n id: 'post.title',\n message: 'Post',\n }),\n '/:instance?/s/:id',\n );\n\n const postInstance = useMemo(() => {\n if (!heroStatus) return;\n const { url } = heroStatus;\n if (!url) return;\n return URL.parse(url).hostname;\n }, [heroStatus]);\n const postSameInstance = useMemo(() => {\n if (!postInstance) return;\n return postInstance === instance;\n }, [postInstance, instance]);\n\n const [limit, setLimit] = useState(LIMIT);\n const showMore = useMemo(() => {\n // return number of statuses to show\n return statuses.length - limit;\n }, [statuses.length, limit]);\n\n const hasDescendants = statuses.some((s) => s.descendant);\n const ancestors = statuses.filter((s) => s.ancestor);\n\n const [heroInView, setHeroInView] = useState(true);\n const heroPointer = useMemo(() => {\n // get top offset of heroStatus\n if (!heroStatusRef.current || heroInView) return null;\n const { top } = heroStatusRef.current.getBoundingClientRect();\n return top > 0 ? 'down' : 'up';\n }, [heroInView]);\n\n useHotkeys(\n 'esc',\n () => {\n location.hash = closeLink;\n },\n {\n // If media is open, esc to close media first\n // Else close the status page\n enabled: !showMedia,\n ignoreEventWhen: (e) => {\n const hasModal = !!document.querySelector('#modal-container > *');\n return hasModal;\n },\n },\n );\n // For backspace, will always close both media and status page\n useHotkeys('backspace', () => {\n location.hash = closeLink;\n });\n\n useHotkeys('j', () => {\n const activeStatus = document.activeElement.closest(\n '.status-link, .status-focus',\n );\n const activeStatusRect = activeStatus?.getBoundingClientRect();\n const allStatusLinks = Array.from(\n scrollableRef.current.querySelectorAll(STATUSES_SELECTOR),\n );\n console.log({ allStatusLinks });\n if (\n activeStatus &&\n activeStatusRect.top < scrollableRef.current.clientHeight &&\n activeStatusRect.bottom > 0\n ) {\n const activeStatusIndex = allStatusLinks.indexOf(activeStatus);\n let nextStatus = allStatusLinks[activeStatusIndex + 1];\n if (nextStatus) {\n nextStatus.focus();\n nextStatus.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n // If active status is not in viewport, get the topmost status-link in viewport\n const topmostStatusLink = allStatusLinks.find((statusLink) => {\n const statusLinkRect = statusLink.getBoundingClientRect();\n return statusLinkRect.top >= 44 && statusLinkRect.left >= 0; // 44 is the magic number for header height, not real\n });\n if (topmostStatusLink) {\n topmostStatusLink.focus();\n topmostStatusLink.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n useHotkeys('k', () => {\n const activeStatus = document.activeElement.closest(\n '.status-link, .status-focus',\n );\n const activeStatusRect = activeStatus?.getBoundingClientRect();\n const allStatusLinks = Array.from(\n scrollableRef.current.querySelectorAll(STATUSES_SELECTOR),\n );\n if (\n activeStatus &&\n activeStatusRect.top < scrollableRef.current.clientHeight &&\n activeStatusRect.bottom > 0\n ) {\n const activeStatusIndex = allStatusLinks.indexOf(activeStatus);\n let prevStatus = allStatusLinks[activeStatusIndex - 1];\n if (prevStatus) {\n prevStatus.focus();\n prevStatus.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n // If active status is not in viewport, get the topmost status-link in viewport\n const topmostStatusLink = allStatusLinks.find((statusLink) => {\n const statusLinkRect = statusLink.getBoundingClientRect();\n return statusLinkRect.top >= 44 && statusLinkRect.left >= 0; // 44 is the magic number for header height, not real\n });\n if (topmostStatusLink) {\n topmostStatusLink.focus();\n topmostStatusLink.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n // NOTE: I'm not sure if 'x' is the best shortcut for this, might change it later\n // IDEA: x is for expand\n useHotkeys('x', () => {\n const activeStatus = document.activeElement.closest(\n '.status-link, .status-focus',\n );\n if (activeStatus) {\n const details = activeStatus.nextElementSibling;\n if (details && details.tagName.toLowerCase() === 'details') {\n details.open = !details.open;\n }\n }\n });\n\n const [reachTopPost, setReachTopPost] = useState(false);\n // const { nearReachStart } = useScroll({\n // scrollableRef,\n // distanceFromStartPx: 16,\n // });\n\n const initialPageState = useRef(showMedia ? 'media+status' : 'status');\n\n const handleMediaClick = useCallback(\n (e, i, media, status) => {\n e.preventDefault();\n e.stopPropagation();\n setSearchParams({\n media: i + 1,\n mediaStatusID: status.id,\n });\n },\n [id],\n );\n\n const handleStatusLinkClick = useCallback((e, status) => {\n resetScrollPosition(status.id);\n }, []);\n\n useEffect(() => {\n let timer;\n if (mediaStatusID && showMedia) {\n timer = setTimeout(() => {\n const status = scrollableRef.current?.querySelector(\n `.status-link[href*=\"/${mediaStatusID}\"]`,\n );\n if (status) {\n status.scrollIntoView(scrollIntoViewOptions);\n }\n }, 400); // After CSS transition\n }\n return () => {\n clearTimeout(timer);\n };\n }, [mediaStatusID, showMedia]);\n\n const renderStatus = useCallback(\n (status, i) => {\n const {\n id: statusID,\n ancestor,\n isThread,\n descendant,\n thread,\n replies,\n repliesCount,\n weight,\n level,\n } = status;\n const isHero = statusID === id;\n const isLinkable = isThread || ancestor;\n\n return (\n <li\n key={statusID}\n ref={isHero ? heroStatusRef : null}\n class={`${ancestor ? 'ancestor' : ''} ${\n descendant ? 'descendant' : ''\n } ${thread ? 'thread' : ''} ${isHero ? 'hero' : ''}`}\n >\n {isHero ? (\n <>\n <InView\n threshold={0.1}\n onChange={(inView) => {\n queueMicrotask(() => {\n requestAnimationFrame(() => {\n setHeroInView(inView);\n });\n });\n }}\n class=\"status-focus\"\n tabIndex={0}\n >\n <Status\n statusID={statusID}\n instance={instance}\n withinContext\n size=\"l\"\n enableTranslate\n forceTranslate={translate}\n />\n </InView>\n {uiState !== 'loading' && !authenticated ? (\n <div class=\"post-status-banner\">\n <p>\n <Trans>\n You're not logged in. Interactions (reply, boost, etc) are\n not possible.\n </Trans>\n </p>\n <Link\n to={\n DEFAULT_INSTANCE\n ? `/login?instance=${DEFAULT_INSTANCE}&submit=1`\n : '/login'\n }\n class=\"button\"\n >\n <Trans>Log in</Trans>\n </Link>\n </div>\n ) : (\n !sameInstance && (\n <div class=\"post-status-banner\">\n <p>\n <Trans>\n This post is from another instance (<b>{instance}</b>).\n Interactions (reply, boost, etc) are not possible.\n </Trans>\n </p>\n <button\n type=\"button\"\n disabled={uiState === 'loading'}\n onClick={() => {\n setUIState('loading');\n (async () => {\n try {\n const results = await currentMasto.v2.search.fetch({\n q: heroStatus.url,\n type: 'statuses',\n resolve: true,\n limit: 1,\n });\n if (results.statuses.length) {\n const status = results.statuses[0];\n location.hash = currentInstance\n ? `/${currentInstance}/s/${status.id}`\n : `/s/${status.id}`;\n } else {\n throw new Error('No results');\n }\n } catch (e) {\n setUIState('default');\n alert(t`Error: ${e}`);\n console.error(e);\n }\n })();\n }}\n >\n <Icon icon=\"transfer\" />{' '}\n <Trans>\n Switch to my instance to enable interactions\n </Trans>\n </button>\n </div>\n )\n )}\n </>\n ) : (\n <StatusParent\n linkable={isLinkable}\n to={instance ? `/${instance}/s/${statusID}` : `/s/${statusID}`}\n onClick={() => {\n resetScrollPosition(statusID);\n }}\n >\n {/* <Link\n class=\"status-link\"\n to={instance ? `/${instance}/s/${statusID}` : `/s/${statusID}`}\n onClick={() => {\n resetScrollPosition(statusID);\n }}\n > */}\n {i === 0 && ancestor ? (\n <InView\n threshold={0.5}\n onChange={(inView) => {\n queueMicrotask(() => {\n requestAnimationFrame(() => {\n setReachTopPost(inView);\n });\n });\n }}\n >\n <Status\n statusID={statusID}\n instance={instance}\n withinContext\n size={thread || ancestor ? 'm' : 's'}\n enableTranslate\n onMediaClick={handleMediaClick}\n onStatusLinkClick={handleStatusLinkClick}\n />\n </InView>\n ) : (\n <Status\n statusID={statusID}\n instance={instance}\n withinContext\n size={thread || ancestor ? 'm' : 's'}\n enableTranslate\n onMediaClick={handleMediaClick}\n onStatusLinkClick={handleStatusLinkClick}\n showActionsBar={!!descendant}\n />\n )}\n {ancestor && repliesCount > 1 && (\n <div class=\"replies-link\">\n <Icon icon=\"comment2\" alt={t`Replies`} />{' '}\n <span title={repliesCount}>\n {shortenNumber(repliesCount)}\n </span>\n </div>\n )}{' '}\n {/* {replies?.length > LIMIT && (\n <div class=\"replies-link\">\n <Icon icon=\"comment\" />{' '}\n <span title={replies.length}>\n {shortenNumber(replies.length)}\n </span>\n </div>\n )} */}\n </StatusParent>\n // </Link>\n )}\n {descendant && replies?.length > 0 && (\n <SubComments\n instance={instance}\n replies={replies}\n hasParentThread={thread}\n level={level}\n accWeight={weight}\n openAll={totalDescendants.current < SUBCOMMENTS_OPEN_ALL_LIMIT}\n parentLink={{\n to: instance ? `/${instance}/s/${statusID}` : `/s/${statusID}`,\n onClick: () => resetScrollPosition(statusID),\n }}\n />\n )}\n {uiState === 'loading' &&\n isHero &&\n !!heroStatus?.repliesCount &&\n !hasDescendants && (\n <div class=\"status-loading\">\n <Loader abrupt={heroStatus.repliesCount >= 3} />\n </div>\n )}\n {uiState === 'error' &&\n isHero &&\n !!heroStatus?.repliesCount &&\n !hasDescendants && (\n <div class=\"status-error\">\n <Trans>Unable to load replies.</Trans>\n <br />\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => {\n states.reloadStatusPage++;\n }}\n >\n <Trans>Try again</Trans>\n </button>\n </div>\n )}\n </li>\n );\n },\n [\n id,\n instance,\n uiState,\n authenticated,\n sameInstance,\n translate,\n handleMediaClick,\n handleStatusLinkClick,\n hasDescendants,\n ],\n );\n\n const prevLocationIsStatusPage = useMemo(() => {\n // Navigation API\n if ('navigation' in window && navigation?.entries) {\n const prevEntry = navigation.entries()[navigation.currentEntry.index - 1];\n if (prevEntry?.url) {\n return STATUS_URL_REGEX.test(prevEntry.url);\n }\n }\n return STATUS_URL_REGEX.test(states.prevLocation?.pathname);\n }, [sKey]);\n\n const moreStatusesKeys = useMemo(() => {\n if (!showMore) return [];\n const ids = [];\n function getIDs(status) {\n ids.push(status.id);\n if (status.replies) {\n status.replies.forEach(getIDs);\n }\n }\n statuses.slice(limit).forEach(getIDs);\n return ids.map((id) => statusKey(id, instance));\n }, [showMore, statuses, limit, instance]);\n\n const statusesList = useMemo(\n () => statuses.slice(0, limit).map(renderStatus),\n [statuses, limit, renderStatus],\n );\n\n // If there's spoiler in hero status, auto-expand it\n useEffect(() => {\n let timer = setTimeout(() => {\n if (!heroStatusRef.current) return;\n const spoilerButton = heroStatusRef.current.querySelector(\n '.spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)',\n );\n if (spoilerButton) spoilerButton.click();\n }, 1000);\n return () => clearTimeout(timer);\n }, [id]);\n\n return (\n <div\n tabIndex=\"-1\"\n ref={scrollableRef}\n class={`status-deck deck contained ${\n statuses.length > 1 ? 'padded-bottom' : ''\n } ${\n initialPageState.current === 'status' && !firstLoad.current\n ? 'slide-in'\n : ''\n } ${viewMode ? `deck-view-${viewMode}` : ''}`}\n onAnimationEnd={(e) => {\n // Fix the bounce effect when switching viewMode\n // `slide-in` animation kicks in when switching viewMode\n if (initialPageState.current === 'status') {\n // e.target.classList.remove('slide-in');\n initialPageState.current = null;\n }\n }}\n >\n <header\n class={`${uiState === 'loading' ? 'loading' : ''}`}\n onDblClick={(e) => {\n // reload statuses\n states.reloadStatusPage++;\n }}\n >\n {/* <div>\n <Link class=\"button plain deck-close\" href={closeLink}>\n <Icon icon=\"chevron-left\" size=\"xl\" />\n </Link>\n </div> */}\n <div class=\"header-grid header-grid-2\">\n <h1>\n {prevLocationIsStatusPage && (\n <button\n type=\"button\"\n class=\"plain deck-back\"\n onClick={() => {\n history.back();\n }}\n >\n <Icon icon=\"chevron-left\" size=\"xl\" alt={t`Back`} />\n </button>\n )}\n {!heroInView && heroStatus && uiState !== 'loading' ? (\n <>\n <span class=\"hero-heading\">\n <NameText\n account={heroStatus.account}\n instance={instance}\n showAvatar\n short\n />{' '}\n <span class=\"insignificant\">\n •{' '}\n <RelativeTime\n datetime={heroStatus.createdAt}\n format=\"micro\"\n />\n </span>\n </span>{' '}\n <button\n type=\"button\"\n class=\"ancestors-indicator light small\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n heroStatusRef.current.scrollIntoView({\n behavior: 'smooth',\n block: 'start',\n });\n }}\n title={t`Go to main post`}\n >\n <Icon\n icon={heroPointer === 'down' ? 'arrow-down' : 'arrow-up'}\n />\n </button>\n </>\n ) : (\n <>\n <Trans id=\"post.title\">Post</Trans>{' '}\n <button\n type=\"button\"\n class=\"ancestors-indicator light small\"\n onClick={(e) => {\n // Scroll to top\n e.preventDefault();\n e.stopPropagation();\n scrollableRef.current.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }}\n hidden={!ancestors.length || reachTopPost}\n title={t`${ancestors.length} posts above ‒ Go to top`}\n >\n <Icon icon=\"arrow-up\" />\n {ancestors\n .filter(\n (a, i, arr) =>\n arr.findIndex((b) => b.accountID === a.accountID) === i,\n )\n .slice(0, 3)\n .map((ancestor) => (\n <Avatar\n key={ancestor.account.id}\n url={ancestor.account.avatar}\n alt={ancestor.account.displayName}\n />\n ))}\n {/* <Icon icon=\"comment\" />{' '} */}\n {ancestors.length > 3 && (\n <>\n {' '}\n <span class=\"insignificant\">\n {shortenNumber(ancestors.length)}\n </span>\n </>\n )}\n </button>\n </>\n )}\n </h1>\n <div class=\"header-side\">\n <button\n type=\"button\"\n class=\"plain4 button-switch-view\"\n style={{\n display: viewMode === 'full' ? '' : 'none',\n }}\n onClick={() => {\n setViewMode(null);\n searchParams.delete('media');\n searchParams.delete('media-only');\n searchParams.delete('view');\n setSearchParams(searchParams);\n }}\n title={t`Switch to Side Peek view`}\n >\n <Icon icon=\"layout4\" size=\"l\" />\n </button>\n {showRefresh && (\n <button\n type=\"button\"\n class=\"plain button-refresh\"\n onClick={() => {\n states.reloadStatusPage++;\n setShowRefresh(false);\n }}\n >\n <Icon icon=\"refresh\" size=\"l\" alt={t`Refresh`} />\n </button>\n )}\n <Menu2\n align=\"end\"\n portal={{\n // Need this, else the menu click will cause scroll jump\n target: scrollableRef.current,\n }}\n menuButton={\n <button type=\"button\" class=\"button plain4\">\n <Icon icon=\"more\" alt={t`More`} size=\"xl\" />\n </button>\n }\n >\n <MenuItem\n disabled={uiState === 'loading'}\n onClick={() => {\n states.reloadStatusPage++;\n }}\n >\n <Icon icon=\"refresh\" />\n <span>\n <Trans>Refresh</Trans>\n </span>\n </MenuItem>\n <MenuItem\n className=\"menu-switch-view\"\n onClick={() => {\n setViewMode(viewMode === 'full' ? null : 'full');\n searchParams.delete('media');\n searchParams.delete('media-only');\n if (viewMode === 'full') {\n searchParams.delete('view');\n } else {\n searchParams.set('view', 'full');\n }\n setSearchParams(searchParams);\n }}\n >\n <Icon\n icon={\n {\n '': 'layout5',\n full: 'layout4',\n }[viewMode || '']\n }\n />\n <span>\n {viewMode === 'full'\n ? t`Switch to Side Peek view`\n : t`Switch to Full view`}\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n // Click all buttons with class .spoiler but not .spoiling\n const buttons = Array.from(\n scrollableRef.current.querySelectorAll(\n '.spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)',\n ),\n );\n buttons.forEach((button) => {\n button.click();\n });\n }}\n >\n <Icon icon=\"eye-open\" />{' '}\n <span>\n <Trans>Show all sensitive content</Trans>\n </span>\n </MenuItem>\n <MenuDivider />\n <MenuHeader className=\"plain\">\n <Trans>Experimental</Trans>\n </MenuHeader>\n <MenuItem\n disabled={!postInstance || postSameInstance}\n onClick={() => {\n const statusURL = getInstanceStatusURL(heroStatus.url);\n if (statusURL) {\n location.hash = statusURL;\n } else {\n alert(t`Unable to switch`);\n }\n }}\n >\n <Icon icon=\"transfer\" />\n <small class=\"menu-double-lines\">\n {postInstance\n ? t`Switch to post's instance (${punycode.toUnicode(\n postInstance,\n )})`\n : t`Switch to post's instance`}\n </small>\n </MenuItem>\n </Menu2>\n <Link class=\"button plain deck-close\" to={closeLink}>\n <Icon icon=\"x\" size=\"xl\" alt={t`Close`} />\n </Link>\n </div>\n </div>\n </header>\n {!!statuses.length && heroStatus ? (\n <ul\n class={`timeline flat contextual grow ${\n uiState === 'loading' ? 'loading' : ''\n }`}\n >\n {statusesList}\n {showMore > 0 && (\n <li class=\"descendant descendant-more\">\n <button\n type=\"button\"\n class=\"plain block show-more\"\n disabled={uiState === 'loading'}\n onClick={() => setLimit((l) => l + LIMIT)}\n style={{ marginBlockEnd: '6em' }}\n data-state-post-ids={moreStatusesKeys.join(' ')}\n >\n <div class=\"ib avatars-bunch\">\n {/* show avatars for first 5 statuses */}\n {statuses.slice(limit, limit + 5).map((status) => (\n <Avatar\n key={status.id}\n url={status.account.avatarStatic}\n // title={`${status.avatar.displayName} (@${status.avatar.acct})`}\n />\n ))}\n </div>{' '}\n <div class=\"ib\">\n <Trans>Show more…</Trans>{' '}\n <span class=\"tag\">\n {showMore > LIMIT ? `${LIMIT}+` : showMore}\n </span>\n </div>\n </button>\n </li>\n )}\n </ul>\n ) : (\n <>\n {uiState === 'loading' && (\n <ul class=\"timeline flat contextual grow loading\">\n <li>\n <Status skeleton size=\"l\" />\n </li>\n </ul>\n )}\n {uiState === 'error' && (\n <p class=\"ui-state\">\n <Trans>Unable to load post</Trans>\n <br />\n <br />\n <button\n type=\"button\"\n onClick={() => {\n states.reloadStatusPage++;\n }}\n >\n <Trans>Try again</Trans>\n </button>\n </p>\n )}\n </>\n )}\n </div>\n );\n}\n\nfunction SubComments({\n replies,\n instance,\n hasParentThread,\n level,\n accWeight,\n openAll,\n parentLink,\n}) {\n const [searchParams, setSearchParams] = useSearchParams();\n\n // Total comments count, including sub-replies\n const diveDeep = (replies) => {\n return replies.reduce((acc, reply) => {\n const { repliesCount, replies } = reply;\n const count = replies?.length || repliesCount;\n return acc + count + diveDeep(replies || []);\n }, 0);\n };\n const totalComments = replies.length + diveDeep(replies);\n const sameCount = replies.length === totalComments;\n\n // Get the first 3 accounts, unique by id\n const accounts = replies\n .map((r) => r.account)\n .filter((a, i, arr) => arr.findIndex((b) => b.id === a.id) === i)\n .slice(0, 3);\n\n const totalWeight = useMemo(() => {\n return replies?.reduce((acc, reply) => {\n return acc + reply?.weight;\n }, accWeight);\n }, [accWeight, replies?.length]);\n\n let open = false;\n if (openAll) {\n open = true;\n } else if (totalWeight <= MAX_WEIGHT) {\n open = true;\n } else if (!hasParentThread && totalComments === 1) {\n const shortReply = calcStatusWeight(replies[0]) < 2;\n if (shortReply) open = true;\n }\n const openBefore = cachedRepliesToggle[replies[0].id];\n\n const handleMediaClick = useCallback((e, i, media, status) => {\n e.preventDefault();\n e.stopPropagation();\n setSearchParams({\n media: i + 1,\n mediaStatusID: status.id,\n });\n }, []);\n\n const detailsRef = useRef();\n useLayoutEffect(() => {\n function handleScroll(e) {\n // NOTE: this scrollLeft works for RTL too\n // Browsers do the magic for us\n e.target.dataset.scrollLeft = e.target.scrollLeft;\n }\n detailsRef.current?.addEventListener('scroll', handleScroll, {\n passive: true,\n });\n return () => {\n detailsRef.current?.removeEventListener('scroll', handleScroll);\n };\n }, []);\n\n // If not open, delay render replies\n const [renderReplies, setRenderReplies] = useState(openBefore || open);\n useEffect(() => {\n let timer;\n if (!openBefore && !open) {\n timer = setTimeout(() => setRenderReplies(true), 100);\n }\n return () => clearTimeout(timer);\n }, [openBefore, open]);\n\n const Container = open ? 'div' : 'details';\n const isDetails = Container === 'details';\n\n return (\n <Container\n ref={detailsRef}\n class=\"replies\"\n open={isDetails ? openBefore || open : undefined}\n onToggle={\n isDetails\n ? (e) => {\n const { open } = e.target;\n // use first reply as ID\n cachedRepliesToggle[replies[0].id] = open;\n }\n : undefined\n }\n style={{\n '--comments-level': level,\n }}\n data-comments-level={level}\n data-comments-level-overflow={level > 4}\n >\n {!open && (\n <summary class=\"replies-summary\" hidden={open}>\n <span class=\"avatars\">\n {accounts.map((a) => (\n <Avatar\n key={a.id}\n url={a.avatarStatic}\n title={`${a.displayName} @${a.username}`}\n squircle={a?.bot}\n />\n ))}\n </span>\n <span class=\"replies-counts\">\n <b>\n <Plural\n value={replies.length}\n one=\"# reply\"\n other={\n <Trans>\n <span title={replies.length}>\n {shortenNumber(replies.length)}\n </span>{' '}\n replies\n </Trans>\n }\n />\n </b>\n {!sameCount && totalComments > 1 && (\n <>\n {' '}\n ·{' '}\n <span>\n <Plural\n value={totalComments}\n one=\"# comment\"\n other={\n <Trans>\n <span title={totalComments}>\n {shortenNumber(totalComments)}\n </span>{' '}\n comments\n </Trans>\n }\n />\n </span>\n </>\n )}\n </span>\n <Icon icon=\"chevron-down\" class=\"replies-summary-chevron\" />\n {!!parentLink && (\n <Link\n class=\"replies-parent-link\"\n to={parentLink.to}\n onClick={parentLink.onClick}\n title={t`View post with its replies`}\n >\n »\n </Link>\n )}\n </summary>\n )}\n {renderReplies && (\n <ul>\n {replies.map((r) => (\n <li key={r.id}>\n {/* <Link\n class=\"status-link\"\n to={instance ? `/${instance}/s/${r.id}` : `/s/${r.id}`}\n onClick={() => {\n resetScrollPosition(r.id);\n }}\n > */}\n <div class=\"status-focus\" tabIndex={0}>\n <Status\n statusID={r.id}\n instance={instance}\n withinContext\n size=\"s\"\n enableTranslate\n onMediaClick={handleMediaClick}\n showActionsBar\n />\n {!r.replies?.length && r.repliesCount > 0 && (\n <div class=\"replies-link\">\n <Icon icon=\"comment2\" alt={t`Replies`} />{' '}\n <span title={r.repliesCount}>\n {shortenNumber(r.repliesCount)}\n </span>\n </div>\n )}\n </div>\n {/* </Link> */}\n {r.replies?.length && (\n <SubComments\n instance={instance}\n replies={r.replies}\n level={r.level}\n accWeight={!open ? r.weight : totalWeight}\n openAll={openAll}\n parentLink={{\n to: instance ? `/${instance}/s/${r.id}` : `/s/${r.id}`,\n onClick: () => {\n resetScrollPosition(r.id);\n },\n }}\n />\n )}\n </li>\n ))}\n </ul>\n )}\n </Container>\n );\n}\n\nconst MEDIA_VIRTUAL_LENGTH = 140;\nconst POLL_VIRTUAL_LENGTH = 35;\nconst CARD_VIRTUAL_LENGTH = 70;\nconst WEIGHT_SEGMENT = 140;\nconst statusWeightCache = new Map();\nfunction calcStatusWeight(status) {\n const cachedWeight = statusWeightCache.get(status.id);\n if (cachedWeight) return cachedWeight;\n const { spoilerText, content, mediaAttachments, poll, card } = status;\n const length = htmlContentLength(spoilerText + content);\n const mediaLength = mediaAttachments?.length ? MEDIA_VIRTUAL_LENGTH : 0;\n const pollLength = (poll?.options?.length || 0) * POLL_VIRTUAL_LENGTH;\n const cardLength =\n card && (mediaAttachments?.length || poll?.options?.length)\n ? 0\n : CARD_VIRTUAL_LENGTH;\n const totalLength = length + mediaLength + pollLength + cardLength;\n const weight = totalLength / WEIGHT_SEGMENT;\n statusWeightCache.set(status.id, weight);\n return weight;\n}\n\nexport default memo(StatusPage);\n","import { useParams } from 'react-router-dom';\n\nimport Status from './status';\n\nexport default function StatusRoute() {\n const params = useParams();\n const { id, instance } = params;\n return <Status id={id} instance={instance} />;\n}\n","export default \"__VITE_ASSET__W5CngKHO__\"","export default \"__VITE_ASSET__vmqRZ5q5__\"","export default \"__VITE_ASSET__DFAo1Udm__\"","export default \"__VITE_ASSET__D2_o1n6___\"","export default \"__VITE_ASSET__ySLnBMku__\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%20102%2028'%3e%3cpath%20fill='none'%20d='M0%200h101.5v27.5H0z'/%3e%3cg%20fill-rule='nonzero'%3e%3cpath%20fill='url(%23a)'%20d='M2.32%2021.85c1.4%200%202.21-.85%202.21-2.3v-4.64H8.5c4.45%200%207.54-2.9%207.54-7.24%200-4.35-2.98-7.24-7.32-7.24h-6.4C.93.43.11%201.28.11%202.73v16.82c0%201.45.82%202.3%202.21%202.3Zm2.21-10.4V3.94h3c2.54%200%204%201.34%204%203.75s-1.47%203.76-4%203.76h-3Z'/%3e%3cpath%20fill='url(%23b)'%20d='M20.52%2021.88c1.25%200%202.13-.76%202.13-2.23v-7.04c0-2.07%201.2-3.49%203.21-3.49%201.95%200%202.95%201.23%202.95%203.25v7.28c0%201.47.89%202.23%202.13%202.23%201.26%200%202.14-.76%202.14-2.23v-8.18c0-3.64-1.99-5.9-5.48-5.9-2.38%200-4.1%201.12-4.93%203.1h-.09V2.3c0-1.38-.78-2.2-2.1-2.2-1.31%200-2.1.82-2.1%202.2v17.34c0%201.47.9%202.23%202.14%202.23Z'/%3e%3cpath%20fill='url(%23c)'%20d='M40.45%2021.82c1.96%200%203.93-.98%204.8-2.65h.1v.8c.08%201.27.89%201.91%202.05%201.91%201.21%200%202.08-.73%202.08-2.15v-8.95c0-3.17-2.63-5.25-6.65-5.25-3.26%200-5.78%201.16-6.5%203.04-.15.32-.23.63-.23.96%200%20.97.75%201.64%201.79%201.64.69%200%201.23-.26%201.7-.79.95-1.23%201.74-1.65%203.04-1.65%201.62%200%202.64.85%202.64%202.31v1.04l-3.95.24c-3.93.23-6.13%201.88-6.13%204.74%200%202.83%202.27%204.76%205.26%204.76Zm1.4-3.09c-1.43%200-2.4-.73-2.4-1.9%200-1.12.91-1.83%202.51-1.95l3.31-.2v1.14c0%201.7-1.54%202.91-3.41%202.91Z'/%3e%3cpath%20fill='url(%23d)'%20d='M54.37%2021.88c1.26%200%202.14-.76%202.14-2.23v-7.09c0-2.03%201.21-3.44%203.13-3.44s2.89%201.17%202.89%203.22v7.31c0%201.47.88%202.23%202.14%202.23%201.24%200%202.13-.76%202.13-2.23v-8.2c0-3.68-1.96-5.87-5.45-5.87-2.41%200-4%201.07-4.83%203.01h-.09v-.87c0-1.35-.85-2.17-2.14-2.17-1.28%200-2.06.82-2.06%202.15v11.95c0%201.47.9%202.23%202.14%202.23Z'/%3e%3cpath%20fill='url(%23e)'%20d='M71.65%2027.17c1.26%200%202.14-.76%202.14-2.23v-6h.09a5.15%205.15%200%200%200%204.88%202.88c3.92%200%206.35-3.05%206.35-8.1%200-5.07-2.44-8.1-6.43-8.1a5.12%205.12%200%200%200-4.86%202.99h-.09v-.85c0-1.45-.88-2.21-2.1-2.21-1.24%200-2.11.76-2.11%202.2v17.2c0%201.46.89%202.22%202.13%202.22Zm5.6-8.8c-2.1%200-3.47-1.8-3.47-4.65%200-2.81%201.37-4.67%203.47-4.67%202.14%200%203.49%201.83%203.49%204.67%200%202.86-1.35%204.66-3.5%204.66Z'/%3e%3cpath%20fill='url(%23f)'%20d='M89.61%2027.39c3.44%200%205.26-1.5%206.73-5.55l4.81-13.1a4%204%200%200%200%20.24-1.26c0-1.13-.85-1.93-2.08-1.93-1.1%200-1.71.51-2.07%201.7l-3.4%2010.9h-.08L90.35%207.28c-.36-1.25-.94-1.73-2.07-1.73-1.26%200-2.21.83-2.21%201.99%200%20.35.09.82.25%201.26l5%2013.21-.21.56c-.52%201.1-1.32%201.42-2.07%201.42l-.75-.01c-.96%200-1.56.54-1.56%201.4%200%201.29%201%202%202.88%202Z'/%3e%3c/g%3e%3cdefs%3e%3cradialGradient%20id='a'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='b'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='c'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='d'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='e'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='f'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3c/defs%3e%3c/svg%3e\"","import './welcome.css';\n\nimport { t, Trans } from '@lingui/macro';\n\nimport boostsCarouselUrl from '../assets/features/boosts-carousel.jpg';\nimport groupedNotificationsUrl from '../assets/features/grouped-notifications.jpg';\nimport multiColumnUrl from '../assets/features/multi-column.jpg';\nimport multiHashtagTimelineUrl from '../assets/features/multi-hashtag-timeline.jpg';\nimport nestedCommentsThreadUrl from '../assets/features/nested-comments-thread.jpg';\nimport logoText from '../assets/logo-text.svg';\nimport logo from '../assets/logo.svg';\n\nimport LangSelector from '../components/lang-selector';\nimport Link from '../components/link';\nimport states from '../utils/states';\nimport useTitle from '../utils/useTitle';\n\nconst {\n PHANPY_DEFAULT_INSTANCE: DEFAULT_INSTANCE,\n PHANPY_WEBSITE: WEBSITE,\n PHANPY_PRIVACY_POLICY_URL: PRIVACY_POLICY_URL,\n PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL: DEFAULT_INSTANCE_REGISTRATION_URL,\n} = import.meta.env;\nconst appSite = WEBSITE\n ? WEBSITE.replace(/https?:\\/\\//g, '').replace(/\\/$/, '')\n : null;\nconst appVersion = __BUILD_TIME__\n ? `${__BUILD_TIME__.slice(0, 10).replace(/-/g, '.')}${\n __COMMIT_HASH__ ? `.${__COMMIT_HASH__}` : ''\n }`\n : null;\n\nfunction Welcome() {\n useTitle(null, ['/', '/welcome']);\n return (\n <main id=\"welcome\">\n <div class=\"hero-container\">\n <div class=\"hero-content\">\n <h1>\n <img\n src={logo}\n alt=\"\"\n width=\"160\"\n height=\"160\"\n style={{\n aspectRatio: '1/1',\n marginBlockEnd: -16,\n }}\n />\n <img src={logoText} alt=\"Phanpy\" width=\"200\" />\n </h1>\n <p class=\"desc\">\n <Trans>A minimalistic opinionated Mastodon web client.</Trans>\n </p>\n <p>\n <Link\n to={\n DEFAULT_INSTANCE\n ? `/login?instance=${DEFAULT_INSTANCE}&submit=1`\n : '/login'\n }\n class=\"button\"\n >\n {DEFAULT_INSTANCE ? t`Log in` : t`Log in with Mastodon`}\n </Link>\n </p>\n {DEFAULT_INSTANCE && DEFAULT_INSTANCE_REGISTRATION_URL && (\n <p>\n <a href={DEFAULT_INSTANCE_REGISTRATION_URL} class=\"button plain5\">\n <Trans>Sign up</Trans>\n </a>\n </p>\n )}\n {!DEFAULT_INSTANCE && (\n <p class=\"insignificant\">\n <small>\n <Trans>\n Connect your existing Mastodon/Fediverse account.\n <br />\n Your credentials are not stored on this server.\n </Trans>\n </small>\n </p>\n )}\n </div>\n {(appSite || appVersion) && (\n <p class=\"app-site-version\">\n <small>\n {appSite} {appVersion}\n </small>\n </p>\n )}\n <p>\n <Trans>\n <a href=\"https://github.com/cheeaun/phanpy\" target=\"_blank\">\n Built\n </a>{' '}\n by{' '}\n <a\n href=\"https://mastodon.social/@cheeaun\"\n target=\"_blank\"\n onClick={(e) => {\n e.preventDefault();\n states.showAccount = 'cheeaun@mastodon.social';\n }}\n >\n @cheeaun\n </a>\n .{' '}\n <a href={PRIVACY_POLICY_URL} target=\"_blank\">\n Privacy Policy\n </a>\n .\n </Trans>\n </p>\n <div>\n <LangSelector />\n </div>\n </div>\n <div id=\"why-container\">\n <div class=\"sections\">\n <section>\n <img\n src={boostsCarouselUrl}\n alt={t`Screenshot of Boosts Carousel`}\n loading=\"lazy\"\n />\n <h4>\n <Trans>Boosts Carousel</Trans>\n </h4>\n <p>\n <Trans>\n Visually separate original posts and re-shared posts (boosted\n posts).\n </Trans>\n </p>\n </section>\n <section>\n <img\n src={nestedCommentsThreadUrl}\n alt={t`Screenshot of nested comments thread`}\n loading=\"lazy\"\n />\n <h4>\n <Trans>Nested comments thread</Trans>\n </h4>\n <p>\n <Trans>\n Effortlessly follow conversations. Semi-collapsible replies.\n </Trans>\n </p>\n </section>\n <section>\n <img\n src={groupedNotificationsUrl}\n alt={t`Screenshot of grouped notifications`}\n loading=\"lazy\"\n />\n <h4>\n <Trans>Grouped notifications</Trans>\n </h4>\n <p>\n <Trans>\n Similar notifications are grouped and collapsed to reduce\n clutter.\n </Trans>\n </p>\n </section>\n <section>\n <img\n src={multiColumnUrl}\n alt={t`Screenshot of multi-column UI`}\n loading=\"lazy\"\n />\n <h4>\n <Trans>Single or multi-column</Trans>\n </h4>\n <p>\n <Trans>\n By default, single column for zen-mode seekers. Configurable\n multi-column for power users.\n </Trans>\n </p>\n </section>\n <section>\n <img\n src={multiHashtagTimelineUrl}\n alt={t`Screenshot of multi-hashtag timeline with a form to add more hashtags`}\n loading=\"lazy\"\n />\n <h4>\n <Trans>Multi-hashtag timeline</Trans>\n </h4>\n <p>\n <Trans>Up to 5 hashtags combined into a single timeline.</Trans>\n </p>\n </section>\n </div>\n </div>\n </main>\n );\n}\n\nexport default Welcome;\n","// Replace alert() with toastify-js\nimport Toastify from 'toastify-js';\n\nconst nativeAlert = window.alert;\nif (!window.__nativeAlert) window.__nativeAlert = nativeAlert;\n\nwindow.alert = function (message) {\n console.debug(\n 'ALERT: This is a custom alert() function. Native alert() is still available as window.__nativeAlert()',\n );\n // If Error object, show the message\n if (message instanceof Error && message?.message) {\n message = message.message;\n }\n // If not string, stringify it\n if (typeof message !== 'string') {\n message = JSON.stringify(message);\n }\n\n const toast = Toastify({\n text: message,\n className: 'alert',\n gravity: 'top',\n position: 'center',\n duration: 10_000,\n offset: {\n y: 48,\n },\n onClick: () => {\n toast.hideToast();\n },\n });\n toast.showToast();\n};\n","import './app.css';\n\nimport { useLingui } from '@lingui/react';\nimport debounce from 'just-debounce-it';\nimport { memo } from 'preact/compat';\nimport {\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport { matchPath, Route, Routes, useLocation } from 'react-router-dom';\n\nimport 'swiped-events';\n\nimport { subscribe } from 'valtio';\n\nimport BackgroundService from './components/background-service';\nimport ComposeButton from './components/compose-button';\nimport { ICONS } from './components/ICONS';\nimport KeyboardShortcutsHelp from './components/keyboard-shortcuts-help';\nimport Loader from './components/loader';\nimport Modals from './components/modals';\nimport NotificationService from './components/notification-service';\nimport SearchCommand from './components/search-command';\nimport Shortcuts from './components/shortcuts';\nimport NotFound from './pages/404';\nimport AccountStatuses from './pages/account-statuses';\nimport AnnualReport from './pages/annual-report';\nimport Bookmarks from './pages/bookmarks';\nimport Catchup from './pages/catchup';\nimport Favourites from './pages/favourites';\nimport Filters from './pages/filters';\nimport FollowedHashtags from './pages/followed-hashtags';\nimport Following from './pages/following';\nimport Hashtag from './pages/hashtag';\nimport Home from './pages/home';\nimport HttpRoute from './pages/http-route';\nimport List from './pages/list';\nimport Lists from './pages/lists';\nimport Login from './pages/login';\nimport Mentions from './pages/mentions';\nimport Notifications from './pages/notifications';\nimport Public from './pages/public';\nimport Search from './pages/search';\nimport StatusRoute from './pages/status-route';\nimport Trending from './pages/trending';\nimport Welcome from './pages/welcome';\nimport {\n api,\n hasInstance,\n hasPreferences,\n initAccount,\n initClient,\n initInstance,\n initPreferences,\n} from './utils/api';\nimport { getAccessToken } from './utils/auth';\nimport focusDeck from './utils/focus-deck';\nimport states, { initStates, statusKey } from './utils/states';\nimport store from './utils/store';\nimport {\n getAccount,\n getCurrentAccount,\n setCurrentAccountID,\n} from './utils/store-utils';\n\nimport './utils/toast-alert';\n\nwindow.__STATES__ = states;\nwindow.__STATES_STATS__ = () => {\n const keys = [\n 'statuses',\n 'accounts',\n 'spoilers',\n 'unfurledLinks',\n 'statusQuotes',\n ];\n const counts = {};\n keys.forEach((key) => {\n counts[key] = Object.keys(states[key]).length;\n });\n console.warn('STATE stats', counts);\n\n const { statuses } = states;\n const unmountedPosts = [];\n for (const key in statuses) {\n const $post = document.querySelector(\n `[data-state-post-id~=\"${key}\"], [data-state-post-ids~=\"${key}\"]`,\n );\n if (!$post) {\n unmountedPosts.push(key);\n }\n }\n console.warn('Unmounted posts', unmountedPosts.length, unmountedPosts);\n};\n\n// Experimental \"garbage collection\" for states\n// Every 15 minutes\n// Only posts for now\nsetInterval(\n () => {\n if (!window.__IDLE__) return;\n const { statuses, unfurledLinks, notifications } = states;\n let keysCount = 0;\n const { instance } = api();\n for (const key in statuses) {\n if (!window.__IDLE__) break;\n try {\n const $post = document.querySelector(\n `[data-state-post-id~=\"${key}\"], [data-state-post-ids~=\"${key}\"]`,\n );\n const postInNotifications = notifications.some(\n (n) => key === statusKey(n.status?.id, instance),\n );\n if (!$post && !postInNotifications) {\n delete states.statuses[key];\n delete states.statusQuotes[key];\n for (const link in unfurledLinks) {\n const unfurled = unfurledLinks[link];\n const sKey = statusKey(unfurled.id, unfurled.instance);\n if (sKey === key) {\n delete states.unfurledLinks[link];\n break;\n }\n }\n keysCount++;\n }\n } catch (e) {}\n }\n if (keysCount) {\n console.info(`GC: Removed ${keysCount} keys`);\n }\n },\n 15 * 60 * 1000,\n);\n\n// Preload icons\n// There's probably a better way to do this\n// Related: https://github.com/vitejs/vite/issues/10600\nsetTimeout(() => {\n for (const icon in ICONS) {\n setTimeout(() => {\n if (Array.isArray(ICONS[icon])) {\n ICONS[icon][0]?.();\n } else if (typeof ICONS[icon] === 'object') {\n ICONS[icon].module?.();\n } else {\n ICONS[icon]?.();\n }\n }, 1);\n }\n}, 5000);\n\n(() => {\n window.__IDLE__ = true;\n const nonIdleEvents = [\n 'mousemove',\n 'mousedown',\n 'resize',\n 'keydown',\n 'touchstart',\n 'pointerdown',\n 'pointermove',\n 'wheel',\n ];\n const setIdle = () => {\n window.__IDLE__ = true;\n };\n const IDLE_TIME = 3_000; // 3 seconds\n const debouncedSetIdle = debounce(setIdle, IDLE_TIME);\n const onNonIdle = () => {\n window.__IDLE__ = false;\n debouncedSetIdle();\n };\n nonIdleEvents.forEach((event) => {\n window.addEventListener(event, onNonIdle, {\n passive: true,\n capture: true,\n });\n });\n window.addEventListener('blur', setIdle, {\n passive: true,\n });\n // When cursor leaves the window, set idle\n document.documentElement.addEventListener(\n 'mouseleave',\n (e) => {\n if (!e.relatedTarget && !e.toElement) {\n setIdle();\n }\n },\n {\n passive: true,\n },\n );\n // document.addEventListener(\n // 'visibilitychange',\n // () => {\n // if (document.visibilityState === 'visible') {\n // onNonIdle();\n // }\n // },\n // {\n // passive: true,\n // },\n // );\n})();\n\n// Possible fix for iOS PWA theme-color bug\n// It changes when loading web pages in \"webview\"\nconst isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent);\nif (isIOS) {\n document.addEventListener('visibilitychange', () => {\n if (document.visibilityState === 'visible') {\n // Don't reset theme color if media modal is showing\n // Media modal will set its own theme color based on the media's color\n const showingMediaModal =\n document.getElementsByClassName('media-modal-container').length > 0;\n if (showingMediaModal) return;\n\n const theme = store.local.get('theme');\n let $meta;\n if (theme) {\n // Get current meta\n $meta = document.querySelector(\n `meta[name=\"theme-color\"][data-theme-setting=\"manual\"]`,\n );\n if ($meta) {\n const color = $meta.content;\n const tempColor =\n theme === 'light'\n ? $meta.dataset.themeLightColorTemp\n : $meta.dataset.themeDarkColorTemp;\n $meta.content = tempColor || '';\n setTimeout(() => {\n $meta.content = color;\n }, 10);\n }\n } else {\n // Get current color scheme\n const colorScheme = window.matchMedia('(prefers-color-scheme: dark)')\n .matches\n ? 'dark'\n : 'light';\n // Get current theme-color\n $meta = document.querySelector(\n `meta[name=\"theme-color\"][media*=\"${colorScheme}\"]`,\n );\n if ($meta) {\n const color = $meta.dataset.content;\n const tempColor = $meta.dataset.contentTemp;\n $meta.content = tempColor || '';\n setTimeout(() => {\n $meta.content = color;\n }, 10);\n }\n }\n }\n });\n}\n\n{\n const theme = store.local.get('theme');\n // If there's a theme, it's NOT auto\n if (theme) {\n // dark | light\n document.documentElement.classList.add(`is-${theme}`);\n document\n .querySelector('meta[name=\"color-scheme\"]')\n .setAttribute('content', theme || 'dark light');\n\n // Enable manual theme <meta>\n const $manualMeta = document.querySelector(\n 'meta[data-theme-setting=\"manual\"]',\n );\n if ($manualMeta) {\n $manualMeta.name = 'theme-color';\n $manualMeta.content =\n theme === 'light'\n ? $manualMeta.dataset.themeLightColor\n : $manualMeta.dataset.themeDarkColor;\n }\n // Disable auto theme <meta>s\n const $autoMetas = document.querySelectorAll(\n 'meta[data-theme-setting=\"auto\"]',\n );\n $autoMetas.forEach((m) => {\n m.name = '';\n });\n }\n const textSize = store.local.get('textSize');\n if (textSize) {\n document.documentElement.style.setProperty('--text-size', `${textSize}px`);\n }\n}\n\nsubscribe(states, (changes) => {\n for (const [action, path, value, prevValue] of changes) {\n // Change #app dataset based on settings.shortcutsViewMode\n if (path.join('.') === 'settings.shortcutsViewMode') {\n const $app = document.getElementById('app');\n if ($app) {\n $app.dataset.shortcutsViewMode = states.shortcuts?.length ? value : '';\n }\n }\n\n // Add/Remove cloak class to body\n if (path.join('.') === 'settings.cloakMode') {\n const $body = document.body;\n $body.classList.toggle('cloak', value);\n }\n }\n});\n\nconst BENCHES = new Map();\nwindow.__BENCH_RESULTS = new Map();\nwindow.__BENCHMARK = {\n start(name) {\n if (!import.meta.env.DEV && !import.meta.env.PHANPY_DEV) return;\n // If already started, ignore\n if (BENCHES.has(name)) return;\n const start = performance.now();\n BENCHES.set(name, start);\n },\n end(name) {\n if (!import.meta.env.DEV && !import.meta.env.PHANPY_DEV) return;\n const start = BENCHES.get(name);\n if (start) {\n const end = performance.now();\n const duration = end - start;\n __BENCH_RESULTS.set(name, duration);\n BENCHES.delete(name);\n }\n },\n};\n\nfunction App() {\n const [isLoggedIn, setIsLoggedIn] = useState(false);\n const [uiState, setUIState] = useState('loading');\n __BENCHMARK.start('app-init');\n __BENCHMARK.start('time-to-following');\n __BENCHMARK.start('time-to-home');\n __BENCHMARK.start('time-to-isLoggedIn');\n useLingui();\n\n useEffect(() => {\n const instanceURL = store.local.get('instanceURL');\n const code = decodeURIComponent(\n (window.location.search.match(/code=([^&]+)/) || [, ''])[1],\n );\n\n if (code) {\n console.log({ code });\n // Clear the code from the URL\n window.history.replaceState(\n {},\n document.title,\n window.location.pathname || '/',\n );\n\n const clientID = store.sessionCookie.get('clientID');\n const clientSecret = store.sessionCookie.get('clientSecret');\n const vapidKey = store.sessionCookie.get('vapidKey');\n const verifier = store.sessionCookie.get('codeVerifier');\n\n (async () => {\n setUIState('loading');\n const { access_token: accessToken } = await getAccessToken({\n instanceURL,\n client_id: clientID,\n client_secret: clientSecret,\n code,\n code_verifier: verifier || undefined,\n });\n\n if (accessToken) {\n const client = initClient({ instance: instanceURL, accessToken });\n await Promise.allSettled([\n initPreferences(client),\n initInstance(client, instanceURL),\n initAccount(client, instanceURL, accessToken, vapidKey),\n ]);\n initStates();\n window.__IGNORE_GET_ACCOUNT_ERROR__ = true;\n\n setIsLoggedIn(true);\n setUIState('default');\n } else {\n setUIState('error');\n }\n __BENCHMARK.end('app-init');\n })();\n } else {\n window.__IGNORE_GET_ACCOUNT_ERROR__ = true;\n const searchAccount = decodeURIComponent(\n (window.location.search.match(/account=([^&]+)/) || [, ''])[1],\n );\n let account;\n if (searchAccount) {\n account = getAccount(searchAccount);\n console.log('searchAccount', searchAccount, account);\n if (account) {\n setCurrentAccountID(account.info.id);\n window.history.replaceState(\n {},\n document.title,\n window.location.pathname || '/',\n );\n }\n }\n if (!account) {\n account = getCurrentAccount();\n }\n if (account) {\n setCurrentAccountID(account.info.id);\n const { client } = api({ account });\n const { instance } = client;\n // console.log('masto', masto);\n initStates();\n setUIState('loading');\n (async () => {\n try {\n if (hasPreferences() && hasInstance(instance)) {\n // Non-blocking\n initPreferences(client);\n initInstance(client, instance);\n } else {\n await Promise.allSettled([\n initPreferences(client),\n initInstance(client, instance),\n ]);\n }\n } catch (e) {\n } finally {\n setIsLoggedIn(true);\n setUIState('default');\n __BENCHMARK.end('app-init');\n }\n })();\n } else {\n setUIState('default');\n __BENCHMARK.end('app-init');\n }\n }\n\n // Cleanup\n store.sessionCookie.del('clientID');\n store.sessionCookie.del('clientSecret');\n store.sessionCookie.del('codeVerifier');\n }, []);\n\n let location = useLocation();\n states.currentLocation = location.pathname;\n // useLayoutEffect(() => {\n // states.currentLocation = location.pathname;\n // }, [location.pathname]);\n\n useEffect(focusDeck, [location, isLoggedIn]);\n\n if (/\\/https?:/.test(location.pathname)) {\n return <HttpRoute />;\n }\n\n if (uiState === 'loading') {\n return <Loader id=\"loader-root\" />;\n }\n\n return (\n <>\n <PrimaryRoutes isLoggedIn={isLoggedIn} />\n <SecondaryRoutes isLoggedIn={isLoggedIn} />\n <Routes>\n <Route path=\"/:instance?/s/:id\" element={<StatusRoute />} />\n </Routes>\n {isLoggedIn && <ComposeButton />}\n {isLoggedIn && <Shortcuts />}\n <Modals />\n {isLoggedIn && <NotificationService />}\n <BackgroundService isLoggedIn={isLoggedIn} />\n <SearchCommand onClose={focusDeck} />\n <KeyboardShortcutsHelp />\n </>\n );\n}\n\nfunction Root({ isLoggedIn }) {\n if (isLoggedIn) {\n __BENCHMARK.end('time-to-isLoggedIn');\n }\n return isLoggedIn ? <Home /> : <Welcome />;\n}\n\nconst PrimaryRoutes = memo(({ isLoggedIn }) => {\n const location = useLocation();\n const nonRootLocation = useMemo(() => {\n const { pathname } = location;\n return !/^\\/(login|welcome)/i.test(pathname);\n }, [location]);\n\n return (\n <Routes location={nonRootLocation || location}>\n <Route path=\"/\" element={<Root isLoggedIn={isLoggedIn} />} />\n <Route path=\"/login\" element={<Login />} />\n <Route path=\"/welcome\" element={<Welcome />} />\n </Routes>\n );\n});\n\nfunction getPrevLocation() {\n return states.prevLocation || null;\n}\nfunction SecondaryRoutes({ isLoggedIn }) {\n // const snapStates = useSnapshot(states);\n const location = useLocation();\n // const prevLocation = snapStates.prevLocation;\n const backgroundLocation = useRef(getPrevLocation());\n\n const isModalPage = useMemo(() => {\n return (\n matchPath('/:instance/s/:id', location.pathname) ||\n matchPath('/s/:id', location.pathname)\n );\n }, [location.pathname, matchPath]);\n if (isModalPage) {\n if (!backgroundLocation.current)\n backgroundLocation.current = getPrevLocation();\n } else {\n backgroundLocation.current = null;\n }\n console.debug({\n backgroundLocation: backgroundLocation.current,\n location,\n });\n\n return (\n <Routes location={backgroundLocation.current || location}>\n {isLoggedIn && (\n <>\n <Route path=\"/notifications\" element={<Notifications />} />\n <Route path=\"/mentions\" element={<Mentions />} />\n <Route path=\"/following\" element={<Following />} />\n <Route path=\"/b\" element={<Bookmarks />} />\n <Route path=\"/f\" element={<Favourites />} />\n <Route path=\"/l\">\n <Route index element={<Lists />} />\n <Route path=\":id\" element={<List />} />\n </Route>\n <Route path=\"/fh\" element={<FollowedHashtags />} />\n <Route path=\"/ft\" element={<Filters />} />\n <Route path=\"/catchup\" element={<Catchup />} />\n <Route path=\"/annual_report/:year\" element={<AnnualReport />} />\n </>\n )}\n <Route path=\"/:instance?/t/:hashtag\" element={<Hashtag />} />\n <Route path=\"/:instance?/a/:id\" element={<AccountStatuses />} />\n <Route path=\"/:instance?/p\">\n <Route index element={<Public />} />\n <Route path=\"l\" element={<Public local />} />\n </Route>\n <Route path=\"/:instance?/trending\" element={<Trending />} />\n <Route path=\"/:instance?/search\" element={<Search />} />\n {/* <Route path=\"/:anything\" element={<NotFound />} /> */}\n </Routes>\n );\n}\n\nexport { App };\n","import './index.css';\nimport './cloak-mode.css';\nimport './polyfills';\n\nimport { i18n } from '@lingui/core';\nimport { I18nProvider } from '@lingui/react';\n// Polyfill needed for Firefox < 122\n// https://bugzilla.mozilla.org/show_bug.cgi?id=1423593\n// import '@formatjs/intl-segmenter/polyfill';\nimport { render } from 'preact';\nimport { HashRouter } from 'react-router-dom';\n\nimport { App } from './app';\nimport { initActivateLang } from './utils/lang';\n\ninitActivateLang();\n\nif (import.meta.env.DEV) {\n import('preact/debug');\n}\n\nrender(\n <I18nProvider i18n={i18n}>\n <HashRouter>\n <App />\n </HashRouter>\n </I18nProvider>,\n document.getElementById('app'),\n);\n\n// Storage cleanup\nsetTimeout(() => {\n try {\n // Clean up iconify localStorage\n Object.keys(localStorage).forEach((key) => {\n if (key.startsWith('iconify')) {\n localStorage.removeItem(key);\n }\n });\n Object.keys(sessionStorage).forEach((key) => {\n if (key.startsWith('iconify')) {\n sessionStorage.removeItem(key);\n }\n });\n\n // Clean up old settings key\n localStorage.removeItem('settings:boostsCarousel');\n } catch (e) {}\n}, 5000);\n\n// Service worker cache cleanup\nif ('serviceWorker' in navigator && typeof caches !== 'undefined') {\n const MAX_SW_CACHE_SIZE = 50;\n const IGNORE_CACHE_KEYS = ['icons'];\n let clearRanOnce = false;\n const FAST_INTERVAL = 10_000; // 10 seconds\n const SLOW_INTERVAL = 60 * 60 * 1000; // 1 hour\n async function clearCaches() {\n if (window.__IDLE__) {\n try {\n const keys = await caches.keys();\n for (const key of keys) {\n if (IGNORE_CACHE_KEYS.includes(key)) continue;\n const cache = await caches.open(key);\n const _keys = await cache.keys();\n if (_keys.length > MAX_SW_CACHE_SIZE) {\n console.warn('Cleaning cache', key, _keys.length);\n const deleteKeys = _keys.slice(MAX_SW_CACHE_SIZE);\n for (const deleteKey of deleteKeys) {\n await cache.delete(deleteKey);\n }\n }\n }\n clearRanOnce = true;\n } catch (e) {} // Silent fail\n }\n // Once cleared, clear again at slower interval\n setTimeout(clearCaches, clearRanOnce ? SLOW_INTERVAL : FAST_INTERVAL);\n }\n setTimeout(clearCaches, FAST_INTERVAL);\n}\n\nwindow.__CLOAK__ = () => {\n document.body.classList.toggle('cloak');\n};\n"],"names":["functionDebounce","debounce","fn","wait","callFirst","timeout","debouncedFn","clear","flush","call","debounceWrapper","context","args","callNow","window","document","event","params","evt","handleTouchStart","handleTouchMove","handleTouchEnd","xDown","yDown","xDiff","yDiff","timeDown","startEl","touchCount","e","swipeThreshold","getNearestAttribute","swipeUnit","swipeTimeout","timeDiff","eventType","changedTouches","eventData","xUp","yUp","el","attributeName","defaultValue","attributeValue","usePageVisibility","deps","savedCallback","useRef","useEffect","current","handleVisibilityChange","hidden","visibilityState","console","STREAMING_TIMEOUT","POLL_INTERVAL","BackgroundService","memo","isLoggedIn","visible","setVisible","useState","visibleTimeout","clearTimeout","setTimeout","checkLatestNotification","masto","instance","skipCheckMarkers","states","notificationsLast","notificationsIterator","v1","notifications","list","limit","sinceId","id","value","next","length","notificationsShowNew","lastReadId","markers","fetch","timeline","sub","streamTimeout","pollNotifications","streaming","api","hasStreaming","user","notification","subscribe","log","entry","_a","checkForUpdates","clearInterval","r","info","useInterval","lastCheckDate","useHotkeys","currentCloakMode","Date","diff","i18n","settings","text","_","ComposeButton","snapStates","useSnapshot","handleButton","composerState","minimized","openOSK","shiftKey","openCompose","showCompose","ignoreEventWhen","querySelector","_jsx","type","onClick","class","publishing","publishingError","children","Icon","icon","size","alt","KeyboardShortcutsHelp","onClose","showKeyboardShortcutsHelp","hasModal","Modal","tabindex","Trans","keys","0","action","className","1","2","map","parents","coords","siblings","animations","intersections","intervals","options","debounces","enabled","root","scrollX","scrollY","TGT","DEL","NEW","handleMutations","mutations","elements","getElements","animate","handleResizes","entries","updateAllPos","updatePos","observePosition","oldObserver","rect","invocations","buffer","getCoords","offsetWidth","offsetHeight","rootMargin","px","observer","optionsOrPlugin","getOptions","delay","isPlugin","currentAnimation","parent","forEach","lowPriority","poll","callback","resize","supportedBrowser","nodes","mutation","node","target","i","child","isMounted","preExisting","add","remain","remove","raw","str","getScrollOffset","p","x","y","getTransitionSizes","oldCoords","newCoords","widthFrom","heightFrom","widthTo","heightTo","styles","paddingY","paddingX","getTarget","isEnabled","callbacks","getPluginTuple","pluginReturn","config","animation","pluginOrOptions","deltaX","deltaY","start","end","keyframes","cleanUp","style","prev","finalX","finalY","top","left","width","height","deletePosition","adjustScroll","styleReset","scrollDeltaX","scrollDeltaY","scrollBefore","lastHeight","lastWidth","startScroll","smoothScroll","offsetParent","parentStyles","parentCoords","autoAnimate","element","useAutoAnimate","controller","setController","setEnabled","isStandalone","matchMedia","matches","Accounts","accounts","store","local","getJSON","currentAccount","getCurrentAccountID","moreThanOneAccount","reload","useReducer","accountsListParent","_jsxs","tabIndex","ref","account","isCurrent","isDefault","Avatar","url","avatarStatic","onDblClick","$select","NameText","test","showAcct","setCurrentAccountID","_Fragment","Menu2","align","menuButton","disabled","location","MenuLink","href","MenuDivider","MenuItem","splice","MenuConfirm","subMenu","confirmLabel","menuItemClassName","Link","to","logo","regionMaps","LangSelector","useLingui","populatedLocales","useMemo","LOCALES","lang","regionlessCode","replace","native","localeCode2Text","code","locale","fallback","CATALOGS","find","c","nativeName","_common","name","sort","a","b","order","localeCompare","DEFAULT_LANG","onChange","set","common","import","createBackendPushSubscription","subscription","push","create","fetchBackendPushSubscription","updateBackendPushSubscription","update","removeBackendPushSubscription","isPushSupported","navigator","getRegistration","serviceWorker","getSubscription","registration","pushManager","undefined","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","outputArray","Uint8Array","charCodeAt","initSubscription","backendSubscription","err","message","sameEndpoint","sameKey","vapidKey","key2","applicationServerKey","vapidKeyStr","applicationServerKeyStr","updateSubscription","data","policy","removeSubscription","DEFAULT_TEXT_SIZE","TEXT_SIZES","PHANPY_WEBSITE","WEBSITE","PHANPY_PRIVACY_POLICY_URL","PRIVACY_POLICY_URL","PHANPY_IMG_ALT_API_URL","IMG_ALT_API_URL","PHANPY_GIPHY_API_KEY","GIPHY_API_KEY","Settings","currentTheme","get","themeFormRef","targetLanguage","contentTranslationTargetLanguage","systemTargetLanguage","getTranslateTargetLanguage","systemTargetLanguageText","currentTextSize","prefs","setPrefs","authenticated","onInput","formData","theme","documentElement","html","classList","$manualMeta","$autoMetas","querySelectorAll","m","toggle","defaultChecked","fontSize","min","max","step","parseInt","setProperty","rel","for","checked","autoRefresh","boostsCarousel","targetLanguages","showCommon","contentTranslationHideLanguages","contentTranslation","composerGIFPicker","mediaAltGenerator","supports","groupedNotificationsAlpha","shortcutSettingsCloudImportExport","cloakMode","PushNotificationsSection","display","flexWrap","gap","lineHeight","src","aspectRatio","verticalAlign","borderRadius","RelativeTime","datetime","readOnly","__BUILD_TIME__","showToast","caches","uiState","setUIState","allowNotifications","setAllowNotifications","setNeedRelogin","pushFormRef","needRelogin","alerts","previousPolicyRef","policyEl","namedItem","isLoading","values","mention","favourite","reblog","follow","follow_request","followRequest","status","key","alertsCount","allowNotifications2","alert","permission","label","components","alert2","focusDeck","timer","columns","getElementById","focusedColumn","focus","firstVisibleColumn","column","getBoundingClientRect","modals","modal","modalFocusElement","pages","page","useLocationChange","useLocation","currentLocationRef","pathname","FETCH_MAX_AGE","MAX_AGE","fetchLists","pmem","lists","title","updatedAt","now","maxAge","getLists","fetchList","getList","theList","getListTitle","addListStore","updateListStore","index","deleteListStore","listID","findIndex","ListAddEdit","editMode","nameFieldRef","repliesPolicyFieldRef","exclusiveFieldRef","repliesPolicy","exclusive","supportsExclusive","onSubmit","preventDefault","FormData","listResult","replies_policy","MUTE_DURATIONS","MUTE_DURATIONS_LABELS","i18nDuration","LIMIT","ACCOUNT_INFO_MAX_AGE","fetchFamiliarFollowers","currentID","familiarFollowers","memFetchFamiliarFollowers","fetchPostingStats","accountID","fetchStatuses","statuses","total","originals","replies","stats","boosts","memFetchPostingStats","fetchAccount","standalone","i18n2","currentMasto","currentInstance","isString","setInfo","sameCurrentInstance","info2","acct","avatar","bot","createdAt","displayName","emojis","fields","group","lastStatusAt","locked","note","statusesCount","username","memorial","moved","roles","hideCollections","header","headerStatic","headerIsAvatar","isSelf","infoHasEssentials","account2","updated","punycode","accountInstance","setHeaderCornerColors","followersIterator","toUnicode","domain","fetchFollowers","firstLoad","familiarFollowersCache","results","newValue","familiarFollowers2","familiar","followingIterator","LinkOrDiv","accountLink","postingStats","setPostingStats","renderFamiliarFollowers","setFamiliarFollowers","postingStatsUIState","setPostingStatsUIState","hasPostingStats","followers","renderPostingStats","onRelationshipChange","onProfileUpdate","useCallback","newAccount","headerCornerColors","stopPropagation","onError","ctx","canvas","onLoad","pixelDimension","rgbColors","OffscreenCanvas","createElement","g","imageSmoothingEnabled","drawImage","colors","getImageData","dataLength","lightenRGB","color","AccountBlock","avatarSize","handleWithInstance","clipboard","enhanceContent","verifiedAt","__html","EmojiText","blankCopy","follower","followersCount","shortenNumber","fetchFollowing","followingCount","excludeRelationshipAttrs","hideTime","daysSinceLastPost","FAMILIAR_FOLLOWERS_LIMIT","relationshipUIState","setRelationshipUIState","setRelationship","sameInstance","following","showingReblogs","currentInfo","setCurrentInfo","notifying","followedBy","blocking","blockedBy","muting","mutingNotifications","requested","domainBlocking","endorsed","privateNote","acctWithInstance","setIsSelf","q","fetchRelationships","relationships","relationship2","relationship","showAddRemoveLists","setShowAddRemoveLists","showPrivateNoteModal","setLists","updateAccount","showTranslatedBio","showEditProfile","setShowPrivateNoteModal","lists2","currentAuthenticated","onMenuChange","setShowTranslatedBio","handle","niceAccountURL","newRelationship","counter","duration","error","setShowEditProfile","Loader","loading","TranslatedBioSheet","EditProfileSheet","AddRemoveListsSheet","luminence","alpha","urlObj","host","state","getHTMLText","fieldsText","Math","path","listsContainingAccount2","reloadCount","showListAddEditModal","setShowListAddEditModal","setListsContainingAccount","listsContainingAccount","inList","accountIds","result","PrivateNoteSheet","initialNote","textareaRef","_b","e2","trim","setAccount","acc","source","fieldsAttributesRef","displayName2","note2","fieldsAttributesFields","field","fieldsAttributes","FieldsAttributesRow","hasValue","setHasValue","AccountHandleInfo","server","encodedAcct","dir","AccountSheet","propInstance","AccountInfo","lookup","skip_webfinger","v2","search","resolve","accountURL","URL","parse","hostname","Drafts","drafts","setDrafts","db","ns","getCurrentAccountNS","ownKeys","filter","startsWith","getMany","getTime","hasDrafts","abrupt","draft","draftStatus","replyTo","updatedAtDate","replyToStatus","MiniDraft","spoilerText","mediaAttachments","hasPoll","hasMedia","firstImageMedia","image","file","objectURL","createObjectURL","hasPollOrMedia","EmbedModal","dangerouslySetInnerHTML","GenericAccounts","postID","isCurrentInstance","setAccounts","showMore","setShowMore","showGenericAccounts","heading","fetchAccounts","staticAccounts","showReactions","relationshipsMap","setRelationshipsMap","loadRelationships","loadAccounts","done","Array","isArray","theAccount","j","_types","newAccounts","reloadGenericAccounts","post","Status","showStats","InView","MediaAltModal","forceTranslate","setForceTranslate","differentLanguage","localeMatch","l","supportsTTS","speak","whiteSpace","textWrap","TranslationBlock","sourceLanguage","classToType","obj","unpack","keyOrder","k","PI","TWOPI","PITHIRD","DEG2RAD","RAD2DEG","multiplyMatrices","A","B","B_cols","product","row","col","labConstants","compand","linear","sign","xyz2rgb","z","MtxAdaptMa","MtxAdaptMaI","MtxXYZ2RGB","RefWhiteRGB","Xn","Yn","Zn","LAB_CONSTANTS","As","Bs","Cs","Ad","Bd","Cd","X1","Y1","Z1","X2","Y2","Z2","oklab2rgb","L","rest","X","Y","Z","OKLab_to_XYZ","b_","OKLab","LMStoXYZ","OKLabtoLMS","LMSnl","gammaAdjustSRGB","companded","rgb2xyz","MtxRGB2XYZ","rgb2oklab","xyz","XYZ_to_OKLab","XYZ","XYZtoLMS","LMStoOKLab","LMS","sin","cos","lch2lab","h","oklch2rgb","sqrt","atan2","round","lab2lch","rgb2oklch","MediaModal","statusID","carouselRef","currentIndex","setCurrentIndex","carouselFocusItem","useLayoutEffect","scrollIntoView","prevStatusID","scrollLeft","clientWidth","differentStatusID","scrollTo","isRTL","behavior","showControls","setShowControls","handleSwipe","addEventListener","removeEventListener","handleScroll","abs","passive","mediaOkColors","media","blurhash","averageColor","getBlurHashAverageColor","mediaAccentColors","okColor","light","dark","default","mediaAccentGradients","range","join","lightGradient","darkGradient","toastRef","hideToast","currentColor","$meta","metaColor","mediaColor","colorScheme","content","accentColor","description","showMediaAlt","CATEGORIES","CATEGORIES_INFO","spam","legal","violation","stampLabel","other","excludeStamp","ReportModal","split","rules","currentDomain","getCurrentInstance","selectedCategory","setSelectedCategory","showRules","setShowRules","rulesRef","hasRules","setHasRules","previewMode","useAvatarStatic","showActivity","Object","fromEntries","category","comment","forward","ruleIds","reports","accountId","statusIds","Fragment","rule","required","maxlength","rows","LZString","f","keyStrBase64","keyStrUriSafe","baseReverseDic","getBaseValue","alphabet","character","input","res","compressed","uncompressed","buf","TotalLen","current_value","bitsPerChar","getCharFromInt","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data","context_data_val","context_data_position","ii","resetValue","getNextValue","dictionary","enlargeIn","dictSize","numBits","w","bits","resb","maxpower","power","module","floatingButtonUrl","multiColumnUrl$1","tabMenuBarUrl","MAX_FETCH","fetchFollowedTags","iterator","followedTags","tags","fetchCount","getFollowedTags","fauxDiv","extractTagsFromStatus","hashtagLinks","AsyncText","setText","Promise","then","SHORTCUTS_LIMIT","TYPES","TYPE_TEXT","public","bookmarks","favourites","hashtag","trending","mentions","TYPE_PARAMS","notRequired","placeholder","pattern","fetchAccountTitle","SHORTCUTS_META","excludeViewMode","subtitle","query","encodeURIComponent","ShortcutsSettings","shortcuts","showForm","setShowForm","showImportExport","setShowImportExport","shortcutsListParent","opacity","textTransform","imgURL","multiColumnUrl","shortcutsViewMode","Boolean","shortcut","excludedViewMode","includes","shortcutsArr","from","temp","shortcutIndex","justifyContent","alignItems","currentTarget","ShortcutForm","mode","ImportExport","FORM_NOTES","currentType","setCurrentType","setFollowedHashtags","form","formRef","switch","followedHashtags","autocorrect","autocapitalize","tag","shortcutsStr","compressToEncodedURIComponent","importShortcutStr","setImportShortcutStr","parsedImportShortcutStr","setImportUIState","parsed","JSON","decompressFromEncodedURIComponent","hasCurrentSettings","shortcutsImportFieldRef","v","dt","s","importUIState","menuFooter","nonUniqueShortcuts","exceededLimit","newShortcuts","writeText","share","settingsJSON","newNote","changes","prevValue","Modals","navigate","useNavigate","preload","ComposeSuspense","__COMPOSE__","editStatus","newStatus","reloadStatusPage","reply","edit","toast","prevLocation","showSettings","showAccounts","showAccount","destination","showDrafts","showMediaModal","contains","showShortcutsSettings","showEmbedModal","showReportModal","FollowRequestButtons","requestState","setRequestState","hasRelationship","followRequests","authorize","Error","NOTIFICATION_ICONS","severed_relationships","moderation_warning","emoji_reaction","annual_report","emojiText","emoji","emoji_url","staticUrl","emojiObject","CustomEmoji","contentText","count","postsCount","postType","Subject","clickable","3","poll-self","poll-voted","favourite+reblog","admin.sign_up","admin.report","targetAccount","year","SEVERED_RELATIONSHIPS_TEXT","account_suspension","targetName","domain_block","user_domain_block","MODERATION_WARNING_TEXT","none","disable","mark_statuses_as_sensitive","delete_statuses","sensitive","silence","suspend","AVATARS_LIMIT","Notification","isStatic","disableContextMenu","report","annualReport","_ids","_accounts","_statuses","_groupKeys","sampleAccounts","notificationsCount","groupKey","actualStatus","actualStatusID","isVoted","voted","isReplyToOthers","inReplyToAccountId","favsCount","reblogsCount","props","handleOpenGenericAccounts","showAvatar","emojiURL","shortcode","formattedCreatedAt","toLocaleString","genericAccountsHeading","statusKey","diffCount","expandAccounts","_g","isOwnPost","isFiltered","filtered","type2","gKey","keyAccounts","keyAccount","_accounts2","status2","TruncatedLink","onContextMenu","dispatchEvent","clientX","clientY","useTruncated","oldProps","newProps","accessToken","NotificationService","routeNotification","showNotificationSheet","notificationAccount","hasAccount","hash","warn","id2","setShowNotificationSheet","tagName","instanceURL","SearchForm","forwardRef","searchParams","setSearchParams","useSearchParams","searchMenuOpen","setSearchMenuOpen","setQuery","searchFieldRef","useImperativeHandle","setValue","select","blur","autocomplete","spellCheck","onSearch","onFocus","onBlur","onKeyDown","focusItem","nextItem","nextElementSibling","parentElement","firstItem","prevItem","previousElementSibling","lastItem","click","queryType","SearchCommand","showSearch","setShowSearch","searchFormRef","isSearchPage","closeSearch","enableOnFormTags","Shortcuts","isMultiColumnMode","shortcutsColumnsMode","menuRef","hasLists","formattedShortcuts","pin","handler","closeMenu","updatesButton","instanceRef","overflow","viewScroll","menuClassName","position","SubMenu2","groupBoosts","newValues","boostStash","serialBoosts","item","boostStashID","items","half","floor","slice","dedupeBoosts","boostedStatusIDs","filteredItems","boosterID","groupContext","contexts","contextIndex","t","repliedItem","self","inReplyToId","firstItemAccountID","newItems","appliedContextIndices","inReplyToIds","contextItems","aDate","bDate","every","it","sKey","statusReply","queueMicrotask","fallbackFetch","fetchStatus","saveStatus","skipThreading","ids","replyToStatuses","assignFollowedTags","statusFollowedTags","statusWithFollowedTags","extractedTags","itemFollowedTags","useScroll","scrollableRef","distanceFromStart","distanceFromEnd","scrollThresholdStart","scrollThresholdEnd","direction","distanceFromStartPx","_distanceFromStartPx","distanceFromEndPx","_distanceFromEndPx","scrollDirection","setScrollDirection","reachStart","setReachStart","reachEnd","setReachEnd","nearReachStart","setNearReachStart","nearReachEnd","setNearReachEnd","isVertical","scrollableElement","previousScrollStart","scrollTop","onScroll","scrollHeight","scrollWidth","clientHeight","scrollStart","scrollDimension","clientDimension","scrollDistance","init","Event","useScrollFn","useThrottledCallback","MediaPost","onMediaClick","accountEmojis","repliesCount","reblogged","favourited","favouritesCount","bookmarked","muted","visibility","language","editedAt","card","uri","_deleted","_pinned","debugHover","filterContext","useContext","FilterContext","filterInfo","hasSpoiler","readingExpandMedia","mediaKey","toLowerCase","filterTitleStr","Media","showSpoilerMedia","NavMenu","showFollowing","bindLongPress","useLongPress","threshold","detect","cancelOnMovement","buttonRef","menuState","setMenuState","boundingBoxPadding","safeBoundingBoxPadding","mutesIterator","fetchMutes","mutes","blocksIterator","fetchBlocks","blocks","buttonClickTS","squircle","ControlledMenu","anchorRef","containerProps","zIndex","portal","body","unmountOnClose","appVersion","commitHash","__COMMIT_HASH__","confirm","ListMenu","supportsLists","scrollIntoViewOptions","block","inline","Timeline","titleComponent","emptyText","errorText","useItemID","fetchItems","checkForUpdatesInterval","headerStart","headerEnd","timelineStart","refresh","view","showFollowedTags","showReplyParent","clearWhenRefresh","setItems","showNew","setShowNew","debug","isMediaFirstInstance","mediaFirst","allowGrouping","loadItemsTS","firstLoad2","loadItems","useDebouncedCallback","ts","otherPosts","pinnedPosts","items2","itemsSelector","jRef","activeItem","activeItemRect","closest","allItems","activeItemIndex","indexOf","itemRect","topmostItem","kRef","findLast","oRef","handleLoadNewPosts","showNewPostsIndicator","dotRef","headerRef","nearReachStart2","hiddenUI","prevView","disableIdleCheck","loadOrCheckUpdates","inBackground","noPointers","__IDLE__","visible2","hasUpdate","lastHiddenTime","TimelineItem","skeleton","inView","fItems","filteredItemsIDs","aFiltered","bFiltered","isCarousel","unfiltered","filteredItems2","has","StatusCarousel","_pinned2","_grouped","item2","statusID3","_pinned3","actualStatusID3","reblog3","statusID2","actualStatusID2","reblog2","url2","showCompact","_differentAuthor","isSpoiler","manyItems","isMiddle","isStart","isEnd","TimelineStatusCompact","itemKey","enableCommentHint","endButtonRef","render","setRender","newID","oldID","startButtonRef","statusPeekText","statusPeek","statusThreadNumber","titlesStr","MIN_YEAR","MIN_YEAR_MONTH","supportsInputMonth","setAttribute","_isSearchEnabled","isSearchEnabled","AccountStatuses","useParams","month","excludeReplies","excludeBoosts","tagged","accountStatusesIterator","allSearchParams","searchOffsetRef","searchEnabled","setSearchEnabled","isValidMonth","_year","_month","monthIndex","after","afterStr","before","beforeStr","searchResults","value2","offset","pinnedStatuses","pinnedStatusesIds","postId","setFeaturedTags","acctDisplay","accountDisplay","featuredTags","monthYear","fetchAccountPromiseRef","useTitle","fetchPromise","cachedAccount","filterBarRef","TimelineStart","month2","date","validity","MonthPicker","active","allowSwitch","offsetLeft","fetchAccountStatuses","masto2","monthFieldRef","yearFieldRef","checkValidity","minYear","minMonth","maxYear","maxMonth","AnnualReport","setResults","annualReports","report2","datePlaceholder","Bookmarks","bookmarksIterator","fetchBookmarks","catchupUrl","FILTER_CONTEXT","RANGES","FILTER_KEYS","original","groups","FILTER_SORTS","FILTER_GROUPS","DTF","mem","Intl","DateTimeFormat","day","hour","minute","Catchup","dtf","showTopLinks","setShowTopLinks","supportsPixelfed","fetchHome","maxCreatedAt","maxCreatedAtDate","allResults","mainloop","homeIterator","nextParams","createdAtDate","selfPost","addedResults","catchupRangeRef","catchupLastRef","handleCatchupClick","catchupID","catchup","posts","setPosts","reloadCatchups","setLastCatchupEndAt","prevCatchups","setPrevCatchups","lastCatchupEndAt","catchups","ownCatchups","trimmedCatchups","lastCatchups","restCatchups","endAt","startAt","reloadCatchupsCount","_followedTags","_e","thePost","__FILTER","links","sharers","links2","link","topLinks","shared","linksLoop","likes","filteredPosts","authors","authorCounts","selectedFilterCategory","filteredPosts2","setSelectedAuthor","sortBy","authorsHash","setSortOrder","authorCountsMap","postFilterMatches","boostedPosts","__BOOSTERS","selectedAuthor","filteredPostsMap","authorID","authorCountsList","sortedFilteredPosts","aAccountID","authorIndices","bAccountID","aIndex","bIndex","postDensity","bDensity","aDensity","sortOrder","groupBy","prevGroup","authorsListParent","autoAnimated","isFiltered2","postsBar","postsBarType","posts2","postsBins","binByTime","lastCatchupRange","sortOrderIndex","authorElement","scrollableRect","authorRect","right","showHelp","setShowHelp","hlRef","_2","escRef","handleArrowKeys","ignoreModifiers","activeElement","isRadio","isArrowKeys","setRange","niceDateTime","format","pc","yes","st","del","setSelectedFilterCategory","setSortBy","formatRange","setGroupBy","transform","imageDescription","publishedAt","labAverageColor","filterCounts","author","paddingInline","showSeparator","IntersectionPostLineItem","isFollowedTags","PostLine","isReplyTo","show","setShow","IntersectionObserver","unobserve","MEDIA_DENSITY","CARD_DENSITY","pollContent","cur","htmlContentLength","PostPeek","density","isThread","_thread","readingExpandSpoilers","showMedia","showPostContent","emojifyText","o","multiple","remoteMediaURL","_f","_h","_j","_i","mediaURL","MEDIA_SIZE","previewUrl","gifv","video","audio","PostStats","numBins","dates","minDate","normalized","binIndex","bins","Favourites","favouritesIterator","fetchFavourites","FILTER_CONTEXT_UNIMPLEMENTED","FILTER_CONTEXT_LABELS","home","thread","EXPIRY_DURATIONS","EXPIRY_DURATIONS_LABELS","Filters","showFiltersAddEditModal","setShowFiltersAddEditModal","filters","setFilters","keywords","expiresAt","keyword","ExpiryStatus","_id","incID","FiltersAddEdit","filterAction","hasExpiry","expiresAtDate","editKeywords","setEditKeywords","keywordsRef","setRemovedKeyword_IDs","filteredEditKeywords","setRemovedKeywordIDs","removedKeyword_IDs","title2","keywordIDs","getAll","keywordKeywords","keywordWholeWords","wholeWord","removedKeywordIDs","keywordsAttributes","context2","expiresIn","filterResult","filterAction2","_id2","showNeverExpires","expired","rerender","FollowedHashtags","Following","latestItem","__BENCHMARK","latestItemChanged","clearFollowedTagsState","opts","payload","TAGS_LIMIT_PER_MODE","TOTAL_TAGS_LIMIT","Hashtags","mediaView","columnMode","hashtags","linkParams","hashtagTitle","maxID","fetchHashtags","timelines","any","maxId","onlyMedia","since_id","valueContainsLatestItem","followUIState","setFollowUIState","reachLimit","featuredUIState","setFeaturedUIState","isFeaturedTag","featuredTags2","setIsFeaturedTag","finally","featuredTagID","catch","MenuHeader","delete","FocusableItem","newHashtag","MenuGroup","exists","newInstance","List","listIterator","setList","showManageMembersModal","setShowManageMembersModal","list2","setDownOverflow","ListManageMembers","MEMBERS_LIMIT","members","setMembers","membersIterator","fetchMembers","member","as","RemoveAddButton","removed","setRemoved","notificationTypeKeys","GROUP_TYPES","groupable","fixNotifications","massageNotifications2","notificationGroups","sampleAccountIds","statusId","groupNotifications2","groupNotifications","newGroupNotifications","gn","latestPageNotificationAt","mostRecentNotificationId","newGroupNotifications1","notificationsMap","virtualType","mappedNotification","ma","mappedAccount","newGroupNotifications2","notificationsMap2","hasOneAccount","toLocaleDateString","n","cleanNotifications","cleanNotifications2","emptySearchParams","URLSearchParams","Mentions","stateType","setStateType","mentionsIterator","fetchMentions","types","conversationsIterator","latestConversationItem","lastStatus","fetchConversations","NOTIFICATIONS_LIMIT","NOTIFICATIONS_GROUPED_LIMIT","memSupportsGroupedNotifications","mastoFetchNotifications","getGroupedNotifications","NOTIFICATIONS_POLICIES","NOTIFICATIONS_POLICIES_TEXT","forNotFollowing","forNotFollowers","forNewAccounts","forPrivateMentions","forLimitedAccounts","Notifications","notificationID","notificationAccessToken","onlyMentions","setOnlyMentions","setFollowRequests","announcements","setAnnouncements","excludeTypes","allNotifications","groupedNotifications","notificationsLastFetchTime","fetchFollowRequests","loadFollowRequests","requests","fetchAnnouncements","supportsFilteredNotifications","showNotificationsSettings","setNotificationsPolicy","fetchNotificationsPolicy","loadNotificationsPolicy","notificationsRequests","setNotificationsRequests","fetchNotificationsRequest","loadNotifications","fetchNotificationsPromise","fetchNotifications","loadUpdates","unsub","subscribeKey","yesterdayDate","todayDate","currentDay","showTodayEmpty","announcementsListRef","setAnnualReportNotification","annualReportNotification2","annualReportYear","getFullYear","statusLink","today","todaySubHeading","forceOpts","setShowNotificationsSettings","announcement","notificationsPolicy","open","onToggle","request","pendingRequestsCount","NotificationRequestModalButton","NotificationRequestButtons","annualReportNotification","notificationDay","differentDay","toDateString","subHeading","newPolicy","AnnouncementBlock","contact","contactAccount","startsAt","endsAt","published","allDay","reactions","publishedAtDate","read","publishedDateText","updatedAtText","reaction","me","fetchNotficationsByAccount","showModal","setShowModal","notifs","setNotifications","hasRequestState","Public","isLocal","publicIterator","fetchPublic","remote","prompt","SHORT_LIMIT","Search","offsetRef","statusResults","setStatusResults","accountResults","setAccountResults","hashtagResults","setHashtagResults","typeResults","setTypeResultsFunc","loadResults","_c","_d","filterBarParent","history","reduce","TREND_CACHE_TIME","fetchLinks","trends","fetchTrendsStatuses","pixelfed","discover","fetchLinkList","Trending","setHashtags","setLinks","trendIterator","fetchTrends","currentLinkMentionsLoading","setCurrentLinkMentionsLoading","currentLinkMentionsIterator","currentLink","setCurrentLink","supportsTrendingLinkPosts","currentLinkRef","hasCurrentLink","fetchLinkMentions","prevCurrentLink","authorUrl","authorName","providerName","providerUrl","isShortTitle","hasAuthor","flexShrink","textAlign","Columns","Hashtag","Component","$column","currentFocusedColumn","prevColKey","nextColKey","Home","NotificationsLink","notificationLinkRef","NotificationsMenu","NOTIFICATIONS_DISPLAY_LIMIT","hasFollowRequests","setHasFollowRequests","statusPostRegexes","getInstanceStatusObject","regex","match","getInstanceStatusURL","HttpRoute","statusObject","statusURL","Lists","instancesListURL","dec2hex","dec","toString","verifier","array","Uint32Array","crypto","getRandomValues","sha256","plain","TextEncoder","encode","subtle","digest","base64urlencode","bytes","len","byteLength","String","fromCharCode","btoa","generateCodeChallenge","hashed","supportsPKCE","ok","json","code_challenge_methods_supported","__generateCodeChallenge","DEV","PHANPY_CLIENT_NAME","CLIENT_NAME","SCOPES","sameSite","currentLocation","origin","REDIRECT_URI","registerApplication","registrationParams","client_name","redirect_uris","scopes","website","method","headers","getPKCEAuthorizationURL","registrationJSON","client_id","codeChallenge","code_challenge_method","code_challenge","authorizationParams","scope","authorizationURL","client_secret","code_verifier","redirect_uri","append","PHANPY_DEFAULT_INSTANCE","DEFAULT_INSTANCE","Login","instanceURLRef","cachedInstanceURL","submit","instanceText","setInstanceText","instancesList","setInstancesList","searcher","Fuse","submitInstance","xmlDoc","parseFromString","template","vapid_key","authPKCE","sessionCookie","getAuthorizationURL","cleanInstanceText","instanceTextLooksLikeDomain","instancesSuggestions","instance2","selectedInstanceText","SUBCOMMENTS_OPEN_ALL_LIMIT","MAX_WEIGHT","cachedRepliesToggle","cachedStatusesMap","scrollPositions","resetScrollPosition","STATUSES_SELECTOR","STATUS_URL_REGEX","StatusPage","mediaParam","mediaOnlyParam","mediaIndex","mediaStatusID","mediaStatus","getStatus","showMediaOnly","heroStatus","setHeroStatus","closeLink","matchStatusPath","matchPath","handleMediaClose","$carousel","$deckContainers","$deckContainer","StatusParent","linkable","restProps","createdAtSort","StatusThread","navigation","translate","setStatuses","heroStatusRef","totalDescendants","scrollOffsets","lastInitContextTS","reloadHero","heroTimer","cachedStatuses","reallyCachedStatuses","heroFetch","pRetry","contextFetch","hasStatus","heroStatus2","_replies","level","nextLevel","descendantLevelsCount","expandReplies","_r","weight","descendants","ancestors2","ancestors","missingStatuses","ancestorsIsThread","nestedDescendants","__replies","heroAccountID","ancestor","threadifyStatus","offsetTop","heroLimit","setLimit","showRefresh","setShowRefresh","allStatuses","scrollPosition","initContext","interval","newScrollOffsets","contextURL","newScrollTop","statusWeightCache","heroContentText","apiCache","heroDisplayName","postInstance","hasDescendants","div","innerHTML","activeStatusRect","activeStatus","postSameInstance","nextStatus","allStatusLinks","activeStatusIndex","some","heroPointer","topmostStatusLink","heroInView","prevStatus","statusLinkRect","details","initialPageState","handleMediaClick","handleStatusLinkClick","descendant","isHero","requestAnimationFrame","setHeroInView","setReachTopPost","isLinkable","SubComments","enableTranslate","onStatusLinkClick","showActionsBar","prevLocationIsStatusPage","prevEntry","hasParentThread","openAll","getIDs","statusesList","renderStatus","spoilerButton","viewMode","moreStatusesKeys","onAnimationEnd","back","reachTopPost","arr","setViewMode","button","full","buttons","accWeight","parentLink","diveDeep","replies3","totalComments","sameCount","totalWeight","calcStatusWeight","openBefore","renderReplies","Container","isDetails","detailsRef","shortReply","open2","dataset","setRenderReplies","MEDIA_VIRTUAL_LENGTH","CARD_VIRTUAL_LENGTH","cachedWeight","mediaLength","pollLength","POLL_VIRTUAL_LENGTH","cardLength","StatusRoute","boostsCarouselUrl","groupedNotificationsUrl","multiHashtagTimelineUrl","nestedCommentsThreadUrl","logoText","PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL","DEFAULT_INSTANCE_REGISTRATION_URL","appSite","Welcome","marginBlockEnd","nativeAlert","__nativeAlert","Toastify","gravity","__STATES__","__STATES_STATS__","counts","unmountedPosts","setInterval","unfurledLinks","postInNotifications","$post","unfurled","keysCount","ICONS","nonIdleEvents","setIdle","debouncedSetIdle","onNonIdle","isIOS","tempColor","themeDarkColor","textSize","$app","BENCHES","setIsLoggedIn","decodeURIComponent","clientSecret","clientID","initStates","searchAccount","getAccount","client","hasPreferences","hasInstance","initPreferences","initInstance","PrimaryRoutes","Routes","Route","Root","nonRootLocation","getPrevLocation","SecondaryRoutes","backgroundLocation","isModalPage","initActivateLang","I18nProvider","HashRouter","App","localStorage","removeItem","sessionStorage","IGNORE_CACHE_KEYS","clearRanOnce","FAST_INTERVAL","SLOW_INTERVAL","clearCaches","cache","_keys","MAX_SW_CACHE_SIZE","deleteKeys"],"mappings":"0lCAAA,IAAIA,GAAmBC,GAEvB,SAASA,GAASC,EAAIC,EAAMC,EAAW,CACrC,IAAIC,EAAU,KACVC,EAAc,KAEdC,EAAQ,UAAW,CACjBF,IACF,aAAaA,CAAO,EAEpBC,EAAc,KACdD,EAAU,KAEhB,EAEMG,EAAQ,UAAW,CACrB,IAAIC,EAAOH,EACXC,IAEIE,GACFA,GAEN,EAEMC,EAAkB,UAAW,CAC/B,GAAI,CAACP,EACH,OAAOD,EAAG,MAAM,KAAM,SAAS,EAGjC,IAAIS,EAAU,KACVC,EAAO,UACPC,EAAUT,GAAa,CAACC,EAkB5B,GAjBAE,IAEAD,EAAc,UAAW,CACvBJ,EAAG,MAAMS,EAASC,CAAI,CAC5B,EAEIP,EAAU,WAAW,UAAW,CAG9B,GAFAA,EAAU,KAEN,CAACQ,EAAS,CACZ,IAAIJ,EAAOH,EACX,OAAAA,EAAc,KAEPG,EAAI,CACZ,CACF,EAAEN,CAAI,EAEHU,EACF,OAAOP,EAAW,CAExB,EAEE,OAAAI,EAAgB,OAASH,EACzBG,EAAgB,MAAQF,EAEjBE,CACT,CC1DA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQC,SAAUI,EAAQC,EAAU,CAEzB,aAGI,OAAOD,EAAO,aAAgB,aAE9BA,EAAO,YAAc,SAAUE,EAAOC,EAAQ,CAE1CA,EAASA,GAAU,CAAE,QAAS,GAAO,WAAY,GA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