1import{l as e,t}from"./store-l4sk3yXz.js";import{lt as n,ot as r}from"./auth-0c8ju5aJ.js";import{r as i}from"./comments-B_kWFXLN.js";import{a}from"./posts-DIEIf07q.js";import{t as o}from"./vendor-dompurify-Cx-3ymZN.js";function s(e){return e?u(e):``}function c(e){return u(e)}function l(e){return typeof window>`u`?e:o.sanitize(e)}function u(e){return typeof window>`u`?e.replace(/<[^>]*>/g,``):new DOMParser().parseFromString(l(e),`text/html`).body.textContent||``}function d(e){return e?typeof window>`u`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/'/g,`'`):new DOMParser().parseFromString(e,`text/html`).documentElement.textContent||``:``}function f(){return a()}function p(e){return f()[e]}function m(e,t){let n=f();return n[e]?n[e]:Object.values(n).find(n=>n.slugUrl===e&&(!t||n.tokenName===t))}function h(e){return t().get(i)[e]}function g(){return 150}function _(e){let t=p(e);return t?[1,2,3,4].includes(t.status):!1}function v(e){let t=p(e);return t?t.status===5:!1}function y(e){let t=typeof e==`object`?e:p(e);return t?!!(t.postTypes?.includes(`linkedStory`)&&t.linkedStoryUrl):!1}function b(e,t){return!e||!y(e)?t:e.linkedStoryTokenName||t}function x(e){let t=p(e);return t?t.status===r.PENDING:!1}function S(e){try{let t=JSON.parse(e.postContent);return t?.blocks&&(t.blocks=t.blocks.map(C)),t}catch{return null}}function C(e){let t=e.data;if(!t)return e;if(t.file?.url&&(t.file.url=d(t.file.url)),t.url&&=d(t.url),t.images&&Array.isArray(t.images))for(let e of t.images)e.url&&=d(e.url);return t.image?.url&&(t.image.url=d(t.image.url)),t.meta?.image?.url&&(t.meta.image.url=d(t.meta.image.url)),e}function w(e){if(e.split(`/`).pop()?.includes(`.`)){let t=e.split(`.`).pop()??``;return e.replace(t,`jpeg?alt=media`)}return e.replace(`?alt=media`,`.jpeg?alt=media`)}function T(e){return!!e.find(e=>e.type===`video`||e.type===`audio`)}function E(t,n){return`${e()}${O(t,n)}`}function D(e,t=!0){let n=m(e);if(!n)return e;let r=n.slugUrl||e;if(t&&n.flairIds){let e=n.flairIds[0];e&&(r=`${e}/${r}`)}return n.kind!==`story`&&(r=`community/${r}`),r}function O(e,t,r){let i=D(t);return n(e,r?`${i}/${r}`:i)}function k(t){let n=t.assignedDomain||t.domain,r=O(t.tokenName,t.id);return n?`https://${n}${r}`:`${e()}${r}`}export{c as _,h as a,b as c,v as d,_ as f,l as g,s as h,p as i,T as l,S as m,k as n,E as o,x as p,w as r,g as s,O as t,y as u,u as v};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.