vendor: 31,958 bytes, line 1
1import{j as c}from"./jsx-runtime.D-8Ixrx1.js";import{r as w}from"./index.DGUhGSar.js";import{c as ke}from"./client.ZJ3cLauW.js";import{p as Me}from"./Comments.astro_astro_type_script_index_0_lang.DYxRQYsL.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"446a099aacd4b88519530f06c4e117c556cd2b9d"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0b4013e0-0fe9-486a-9965-426b0058a78b",e._sentryDebugIdIdentifier="sentry-dbid-0b4013e0-0fe9-486a-9965-426b0058a78b")}catch{}})();var A=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ie={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ne=class{#e=Ie;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},k=new Ne;function Qe(e){setTimeout(e,0)}var M=typeof window>"u"||"Deno"in globalThis;function x(){}function Ae(e,t){return typeof e=="function"?e(t):e}function H(e){return typeof e=="number"&&e>=0&&e!==1/0}function ve(e,t){return Math.max(e+(t||0)-Date.now(),0)}function j(e,t){return typeof e=="function"?e(t):e}function S(e,t){return typeof e=="function"?e(t):e}function re(e,t){const{type:s="all",exact:r,fetchStatus:i,predicate:n,queryKey:u,stale:a}=e;if(u){if(r){if(t.queryHash!==Z(u,t.options))return!1}else if(!Q(t.queryKey,u))return!1}if(s!=="all"){const h=t.isActive();if(s==="active"&&!h||s==="inactive"&&h)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||n&&!n(t))}function ie(e,t){const{exact:s,status:r,predicate:i,mutationKey:n}=e;if(n){if(!t.options.mutationKey)return!1;if(s){if(N(t.options.mutationKey)!==N(n))return!1}else if(!Q(t.options.mutationKey,n))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Z(e,t){return(t?.queryKeyHashFn||N)(e)}function N(e){return JSON.stringify(e,(t,s)=>W(s)?Object.keys(s).sort().reduce((r,i)=>(r[i]=s[i],r),{}):s)}function Q(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>Q(e[s],t[s])):!1}var De=Object.prototype.hasOwnProperty;function ge(e,t,s=0){if(e===t)return e;if(s>500)return t;const r=ne(e)&&ne(t);if(!r&&!(W(e)&&W(t)))return t;const n=(r?e:Object.keys(e)).length,u=r?t:Object.keys(t),a=u.length,h=r?new Array(a):{};let o=0;for(let l=0;l<a;l++){const p=r?l:u[l],d=e[p],y=t[p];if(d===y){h[p]=d,(r?l<n:De.call(e,p))&&o++;continue}if(d===null||y===null||typeof d!="object"||typeof y!="object"){h[p]=y;continue}const m=ge(d,y,s+1);h[p]=m,m===d&&o++}return n===a&&o===n?e:h}function G(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function ne(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function W(e){if(!ae(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!ae(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ae(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ue(e){return new Promise(t=>{k.setTimeout(t,e)})}function z(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?ge(e,t):t}function qe(e,t,s=0){const r=[...e,t];return s&&r.length>s?r.slice(1):r}function _e(e,t,s=0){const r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var X=Symbol();function xe(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===X?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function we(e,t){return typeof e=="function"?e(...t):!!e}function Le(e,t,s){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?s():i.addEventListener("abort",s,{once:!0})),i)}),e}var Ke=class extends A{#e;#t;#s;constructor(){super(),this.#s=e=>{if(!M&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},ee=new Ke;function V(){let e,t;const s=new Promise((i,n)=>{e=i,t=n});s.status="pending",s.catch(()=>{});function r(i){Object.assign(s,i),delete s.resolve,delete s.reject}return s.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},s.reject=i=>{r({status:"rejected",reason:i}),t(i)},s}var $e=Qe;function Be(){let e=[],t=0,s=a=>{a()},r=a=>{a()},i=$e;const n=a=>{t?e.push(a):i(()=>{s(a)})},u=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(h=>{s(h)})})})};return{batch:a=>{let h;t++;try{h=a()}finally{t--,t||u()}return h},batchCalls:a=>(...h)=>{n(()=>{a(...h)})},schedule:n,setNotifyFunction:a=>{s=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var v=Be(),He=class extends A{#e=!0;#t;#s;constructor(){super(),this.#s=e=>{if(!M&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(s=>{s(e)}))}isOnline(){return this.#e}},$=new He;function Ge(e){return Math.min(1e3*2**e,3e4)}function Ce(e){return(e??"online")==="online"?$.isOnline():!0}var Y=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Oe(e){let t=!1,s=0,r;const i=V(),n=()=>i.status!=="pending",u=f=>{if(!n()){const b=new Y(f);d(b),e.onCancel?.(b)}},a=()=>{t=!0},h=()=>{t=!1},o=()=>ee.isFocused()&&(e.networkMode==="always"||$.isOnline())&&e.canRun(),l=()=>Ce(e.networkMode)&&e.canRun(),p=f=>{n()||(r?.(),i.resolve(f))},d=f=>{n()||(r?.(),i.reject(f))},y=()=>new Promise(f=>{r=b=>{(n()||o())&&f(b)},e.onPause?.()}).then(()=>{r=void 0,n()||e.onContinue?.()}),m=()=>{if(n())return;let f;const b=s===0?e.initialPromise:void 0;try{f=b??e.fn()}catch(g){f=Promise.reject(g)}Promise.resolve(f).then(p).catch(g=>{if(n())return;const C=e.retry??(M?0:3),R=e.retryDelay??Ge,E=typeof R=="function"?R(s,g):R,F=C===!0||typeof C=="number"&&s<C||typeof C=="function"&&C(s,g);if(t||!F){d(g);return}s++,e.onFail?.(s,g),Ue(E).then(()=>o()?void 0:y()).then(()=>{t?d(g):m()})})};return{promise:i,status:()=>i.status,cancel:u,continue:()=>(r?.(),i),cancelRetry:a,continueRetry:h,canStart:l,start:()=>(l()?m():y().then(m),i)}}var Se=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),H(this.gcTime)&&(this.#e=k.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(M?1/0:300*1e3))}clearGcTimeout(){this.#e&&(k.clearTimeout(this.#e),this.#e=void 0)}},We=class extends Se{#e;#t;#s;#i;#r;#o;#a;constructor(e){super(),this.#a=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#s=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=ue(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=ue(this.options);t.data!==void 0&&(this.setState(oe(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(e,t){const s=z(this.state.data,e,this.options);return this.#n({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e,t){this.#n({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(x).catch(x):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>S(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===X||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>j(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!ve(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#n({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(h=>h.options.queryFn);a&&this.setOptions(a.options)}const s=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#a=!0,s.signal)})},i=()=>{const a=xe(this.options,t),o=(()=>{const l={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(l),l})();return this.#a=!1,this.options.persister?this.options.persister(a,o,this):a(o)},u=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(a),a})();this.options.behavior?.onFetch(u,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#n({type:"fetch",meta:u.fetchOptions?.meta}),this.#r=Oe({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:a=>{a instanceof Y&&a.revert&&this.setState({...this.#t,fetchStatus:"idle"}),s.abort()},onFail:(a,h)=>{this.#n({type:"failed",failureCount:a,error:h})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const a=await this.#r.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#s.config.onSuccess?.(a,this),this.#s.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof Y){if(a.silent)return this.#r.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#n({type:"error",error:a}),this.#s.config.onError?.(a,this),this.#s.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#n(e){const t=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...Re(s.data,this.options),fetchMeta:e.meta??null};case"success":const r={...s,...oe(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const i=e.error;return{...s,error:i,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),v.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:e})})}};function Re(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ce(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function oe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ue(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,r=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var ze=class extends A{constructor(e,t){super(),this.options=t,this.#e=e,this.#n=null,this.#a=V(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#s=void 0;#i=void 0;#r;#o;#a;#n;#y;#d;#f;#c;#l;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ce(this.#t,this.options)?this.#h():this.updateResult(),this.#g())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return J(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return J(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#t.setOptions(this.options),t._defaulted&&!G(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&le(this.#t,s,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==s||S(this.options.enabled,this.#t)!==S(t.enabled,this.#t)||j(this.options.staleTime,this.#t)!==j(t.staleTime,this.#t))&&this.#m();const i=this.#b();r&&(this.#t!==s||S(this.options.enabled,this.#t)!==S(t.enabled,this.#t)||i!==this.#u)&&this.#v(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),s=this.createResult(t,e);return Ye(this,s)&&(this.#i=s,this.#o=this.options,this.#r=this.#t.state),s}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(s,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),s=this.#e.getQueryCache().build(this.#e,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#h(e){this.#C();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(x)),t}#m(){this.#x();const e=j(this.options.staleTime,this.#t);if(M||this.#i.isStale||!H(e))return;const s=ve(this.#i.dataUpdatedAt,e)+1;this.#c=k.setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#b(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#u=e,!(M||S(this.options.enabled,this.#t)===!1||!H(this.#u)||this.#u===0)&&(this.#l=k.setInterval(()=>{(this.options.refetchIntervalInBackground||ee.isFocused())&&this.#h()},this.#u))}#g(){this.#m(),this.#v(this.#b())}#x(){this.#c&&(k.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#l&&(k.clearInterval(this.#l),this.#l=void 0)}createResult(e,t){const s=this.#t,r=this.options,i=this.#i,n=this.#r,u=this.#o,h=e!==s?e.state:this.#s,{state:o}=e;let l={...o},p=!1,d;if(t._optimisticResults){const O=this.hasListeners(),I=!O&&ce(e,t),D=O&&le(e,s,t,r);(I||D)&&(l={...l,...Re(o.data,e.options)}),t._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:y,errorUpdatedAt:m,status:f}=l;d=l.data;let b=!1;if(t.placeholderData!==void 0&&d===void 0&&f==="pending"){let O;i?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(O=i.data,b=!0):O=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,O!==void 0&&(f="success",d=z(i?.data,O,t),p=!0)}if(t.select&&d!==void 0&&!b)if(i&&d===n?.data&&t.select===this.#y)d=this.#d;else try{this.#y=t.select,d=t.select(d),d=z(i?.data,d,t),this.#d=d,this.#n=null}catch(O){this.#n=O}this.#n&&(y=this.#n,d=this.#d,m=Date.now(),f="error");const g=l.fetchStatus==="fetching",C=f==="pending",R=f==="error",E=C&&g,F=d!==void 0,P={status:f,fetchStatus:l.fetchStatus,isPending:C,isSuccess:f==="success",isError:R,isInitialLoading:E,isLoading:E,data:d,dataUpdatedAt:l.dataUpdatedAt,error:y,errorUpdatedAt:m,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>h.dataUpdateCount||l.errorUpdateCount>h.errorUpdateCount,isFetching:g,isRefetching:g&&!C,isLoadingError:R&&!F,isPaused:l.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:R&&F,isStale:te(e,t),refetch:this.refetch,promise:this.#a,isEnabled:S(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const O=P.data!==void 0,I=P.status==="error"&&!O,D=q=>{I?q.reject(P.error):O&&q.resolve(P.data)},se=()=>{const q=this.#a=P.promise=V();D(q)},U=this.#a;switch(U.status){case"pending":e.queryHash===s.queryHash&&D(U);break;case"fulfilled":(I||P.data!==U.value)&&se();break;case"rejected":(!I||P.error!==U.reason)&&se();break}}return P}updateResult(){const e=this.#i,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#o=this.options,this.#r.data!==void 0&&(this.#f=this.#t),G(t,e))return;this.#i=t;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#p.size)return!0;const n=new Set(i??this.#p);return this.options.throwOnError&&n.add("error"),Object.keys(this.#i).some(u=>{const a=u;return this.#i[a]!==e[a]&&n.has(a)})};this.#O({listeners:s()})}#C(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#s=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#g()}#O(e){v.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Ve(e,t){return S(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ce(e,t){return Ve(e,t)||e.state.data!==void 0&&J(e,t,t.refetchOnMount)}function J(e,t,s){if(S(t.enabled,e)!==!1&&j(t.staleTime,e)!=="static"){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&te(e,t)}return!1}function le(e,t,s,r){return(e!==t||S(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&te(e,s)}function te(e,t){return S(t.enabled,e)!==!1&&e.isStaleByTime(j(t.staleTime,e))}function Ye(e,t){return!G(e.getCurrentResult(),t)}function he(e){return{onFetch:(t,s)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,n=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},h=0;const o=async()=>{let l=!1;const p=m=>{Le(m,()=>t.signal,()=>l=!0)},d=xe(t.options,t.fetchOptions),y=async(m,f,b)=>{if(l)return Promise.reject();if(f==null&&m.pages.length)return Promise.resolve(m);const C=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:f,direction:b?"backward":"forward",meta:t.options.meta};return p(B),B})(),R=await d(C),{maxPages:E}=t.options,F=b?_e:qe;return{pages:F(m.pages,R,E),pageParams:F(m.pageParams,f,E)}};if(i&&n.length){const m=i==="backward",f=m?Je:de,b={pages:n,pageParams:u},g=f(r,b);a=await y(b,g,m)}else{const m=e??n.length;do{const f=h===0?u[0]??r.initialPageParam:de(r,a);if(h>0&&f==null)break;a=await y(a,f),h++}while(h<m)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(o,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=o}}}function de(e,{pages:t,pageParams:s}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,s[r],s):void 0}function Je(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var Ze=class extends Se{#e;#t;#s;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#s=e.mutationCache,this.#t=[],this.state=e.state||Xe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=Oe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(n,u)=>{this.#r({type:"failed",failureCount:n,error:u})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#s.config.onMutate&&await this.#s.config.onMutate(e,this,s);const u=await this.options.onMutate?.(e,s);u!==this.state.context&&this.#r({type:"pending",context:u,variables:e,isPaused:i})}const n=await this.#i.start();return await this.#s.config.onSuccess?.(n,e,this.state.context,this,s),await this.options.onSuccess?.(n,e,this.state.context,s),await this.#s.config.onSettled?.(n,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(n,null,e,this.state.context,s),this.#r({type:"success",data:n}),n}catch(n){try{await this.#s.config.onError?.(n,e,this.state.context,this,s)}catch(u){Promise.reject(u)}try{await this.options.onError?.(n,e,this.state.context,s)}catch(u){Promise.reject(u)}try{await this.#s.config.onSettled?.(void 0,n,this.state.variables,this.state.context,this,s)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,n,e,this.state.context,s)}catch(u){Promise.reject(u)}throw this.#r({type:"error",error:n}),n}finally{this.#s.runNext(this)}}#r(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),v.batch(()=>{this.#t.forEach(s=>{s.onMutationUpdate(e)}),this.#s.notify({mutation:this,type:"updated",action:e})})}};function Xe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var et=class extends A{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#s=0}#e;#t;#s;build(e,t,s){const r=new Ze({client:e,mutationCache:this,mutationId:++this.#s,options:e.defaultMutationOptions(t),state:s});return this.add(r),r}add(e){this.#e.add(e);const t=_(e);if(typeof t=="string"){const s=this.#t.get(t);s?s.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=_(e);if(typeof t=="string"){const s=this.#t.get(t);if(s)if(s.length>1){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}else s[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=_(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=_(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){v.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(s=>ie(t,s))}findAll(e={}){return this.getAll().filter(t=>ie(e,t))}notify(e){v.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return v.batch(()=>Promise.all(e.map(t=>t.continue().catch(x))))}};function _(e){return e.options.scope?.id}var tt=class extends A{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,s){const r=t.queryKey,i=t.queryHash??Z(r,t);let n=this.get(i);return n||(n=new We({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(n)),n}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){v.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(s=>re(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>re(e,s)):t}notify(e){v.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){v.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){v.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},st=class{#e;#t;#s;#i;#r;#o;#a;#n;constructor(e={}){this.#e=e.queryCache||new tt,this.#t=e.mutationCache||new et,this.#s=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=ee.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#n=$.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#n?.(),this.#n=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=this.#e.build(this,t),r=s.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(j(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:s})=>{const r=s.data;return[t,r]})}setQueryData(e,t,s){const r=this.defaultQueryOptions({queryKey:e}),n=this.#e.get(r.queryHash)?.state.data,u=Ae(t,n);if(u!==void 0)return this.#e.build(this,r).setData(u,{...s,manual:!0})}setQueriesData(e,t,s){return v.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;v.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#e;return v.batch(()=>(s.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},r=v.batch(()=>this.#e.findAll(e).map(i=>i.cancel(s)));return Promise.all(r).then(x).catch(x)}invalidateQueries(e,t={}){return v.batch(()=>(this.#e.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},r=v.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let n=i.fetch(void 0,s);return s.throwOnError||(n=n.catch(x)),i.state.fetchStatus==="paused"?Promise.resolve():n}));return Promise.all(r).then(x)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#e.build(this,t);return s.isStaleByTime(j(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(x).catch(x)}fetchInfiniteQuery(e){return e.behavior=he(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(x).catch(x)}ensureInfiniteQueryData(e){return e.behavior=he(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return $.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#s}setDefaultOptions(e){this.#s=e}setQueryDefaults(e,t){this.#i.set(N(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],s={};return t.forEach(r=>{Q(e,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(e,t){this.#r.set(N(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],s={};return t.forEach(r=>{Q(e,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#s.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Z(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===X&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#s.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Pe=w.createContext(void 0),rt=e=>{const t=w.useContext(Pe);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},fe=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(Pe.Provider,{value:e,children:t})),je=w.createContext(!1),it=()=>w.useContext(je);je.Provider;function nt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}
1var at=w.createContext(nt()),ot=()=>w.useContext(at),ut=(e,t,s)=>{const r=s?.state.error&&typeof e.throwOnError=="function"?we(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},ct=e=>{w.useEffect(()=>{e.clearReset()},[e])},lt=({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||we(s,[e.error,r])),ht=e=>{if(e.suspense){const s=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>s(r(...i)):s(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},dt=(e,t)=>e.isLoading&&e.isFetching&&!t,ft=(e,t)=>e?.suspense&&t.isPending,pe=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function pt(e,t,s){const r=it(),i=ot(),n=rt(),u=n.defaultQueryOptions(e);n.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const a=n.getQueryCache().get(u.queryHash);u._optimisticResults=r?"isRestoring":"optimistic",ht(u),ut(u,i,a),ct(i);const h=!n.getQueryCache().get(u.queryHash),[o]=w.useState(()=>new t(n,u)),l=o.getOptimisticResult(u),p=!r&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(d=>{const y=p?o.subscribe(v.batchCalls(d)):x;return o.updateResult(),y},[o,p]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),w.useEffect(()=>{o.setOptions(u)},[u,o]),ft(u,l))throw pe(u,o,i);if(lt({result:l,errorResetBoundary:i,throwOnError:u.throwOnError,query:a,suspense:u.suspense}))throw l.error;return n.getDefaultOptions().queries?._experimental_afterQuery?.(u,l),u.experimental_prefetchInRender&&!M&&dt(l,r)&&(h?pe(u,o,i):a?.promise)?.catch(x).finally(()=>{o.updateResult()}),u.notifyOnChangeProps?l:o.trackResult(l)}function yt(e,t){return pt(e,ze)}const L=(e,t)=>({text:e,features:e.length>0?t:void 0}),mt=(e,t)=>{if(t===void 0||t.length===0)return[L(e,void 0)];const s=[],r=e.length;let i=0,n=0;const u=(a,h)=>{let o=a;if(e.charCodeAt(o)<128)for(o+=1,n+=1;n+8<=h&&o+8<=r;){const p=e.charCodeAt(o),d=e.charCodeAt(o+1),y=e.charCodeAt(o+2),m=e.charCodeAt(o+3),f=e.charCodeAt(o+4),b=e.charCodeAt(o+5),g=e.charCodeAt(o+6),C=e.charCodeAt(o+7);if((p|d|y|m|f|b|g|C)<128){o+=8,n+=8;continue}break}for(;n<h&&o<r;){const p=e.charCodeAt(o);p<128?(o+=1,n+=1):p<2048?(o+=1,n+=2):p<55296||p>56319?(o+=1,n+=3):(o+=2,n+=4)}return o};for(let a=0,h=t.length;a<h;a++){const o=t[a],{byteStart:l,byteEnd:p}=o.index,d=o.features;if(!(l>p||d.length===0)){if(n<l){const y=u(i,l);y>i&&s.push(L(e.slice(i,y),void 0)),i=y}{const y=u(i,p);y>i&&s.push(L(e.slice(i,y),d)),i=y}}}return i<r&&s.push(L(e.slice(i),void 0)),s},Ee="https://public.api.bsky.app";function bt(e,t){return`at://${e}/app.bsky.feed.post/${t}`}async function vt(e,t=fetch){if(!e)return null;if(e.startsWith("did:"))return e;const s=`${Ee}/xrpc/com.atproto.identity.resolveHandle?handle=${encodeURIComponent(e)}`,r=await t(s);if(!r.ok)return null;const n=(await r.json()).did;return typeof n=="string"&&n.startsWith("did:")?n:null}function gt(e){return`https://bsky.app/profile/${encodeURIComponent(e)}`}function Fe(e){const t=e.match(/^at:\/\/([^/]+)\/app\.bsky\.feed\.post\/([^/]+)$/);return t?`https://bsky.app/profile/${t[1]}/post/${t[2]}`:null}function xt(e,t){return mt(e,t).map(r=>{const i=r.features?.[0];return!i||typeof i!="object"?{text:r.text}:i.$type==="app.bsky.richtext.facet#link"&&i.uri?{text:r.text,href:i.uri}:i.$type==="app.bsky.richtext.facet#mention"&&i.did?{text:r.text,href:gt(i.did)}:i.$type==="app.bsky.richtext.facet#tag"&&i.tag?{text:r.text,href:`https://bsky.app/hashtag/${encodeURIComponent(i.tag)}`}:{text:r.text}}).filter(r=>r.text.length>0)}function Te(e){return!!(e&&typeof e=="object")}function K(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function wt(e,t,s){const r=e.post,i=r?.uri,n=r?.author,u=n?.handle,a=r?.record,h=a?.text;if(!i||!u||!h||typeof h!="string")return null;const o=r?.embed?.external;return{id:i,replyUrl:Fe(i)??"",depth:t,hasReplies:s,author:{handle:u,displayName:n.displayName,avatar:n.avatar},createdAt:a.createdAt,likeCount:K(r.likeCount),segments:xt(h,a.facets),externalEmbed:o?.uri?{uri:o.uri,title:o.title,de
1scription:o.description,thumb:o.thumb}:void 0}}function Ct(e){if(!e)return[];const t=[],s=e.map(r=>({node:r,depth:0})).reverse();for(;s.length>0;){const r=s.pop();if(!r)continue;const i=r.node;if(!Te(i))continue;const n=Array.isArray(i.replies)?i.replies:[],u=wt(i,r.depth,n.length>0);if(u&&t.push(u),n.length>0)for(let a=n.length-1;a>=0;a-=1)s.push({node:n[a],depth:r.depth+1})}return t}function Ot(e,t){if(!e||typeof e!="object")return null;const s=e.thread;if(!Te(s)||!s.post?.uri)return null;const r=s.post;if(typeof r.uri!="string")return null;const i=r.uri;return{summary:{canonicalAtUri:i,replyCount:K(r.replyCount),likeCount:K(r.likeCount),quoteCount:K(r.quoteCount),replyUrl:Fe(i)??t},replies:Ct(s.replies)}}async function St(e,t){const s=`${Ee}/xrpc/app.bsky.feed.getPostThread?uri=${encodeURIComponent(e)}&depth=50`,r=await t(s);return r.ok?r.json():null}async function Rt(e,t=fetch){const s=Me(e);if(!s)return{status:"unavailable"};const r=await vt(s.actor,t);if(!r)return{status:"unavailable"};const i=bt(r,s.rkey),n=await St(i,t);if(!n)return{status:"unavailable"};const u=Ot(n,e);return u?{status:"ok",data:u}:{status:"unavailable"}}const ye=new WeakMap,Pt=[0,1,2];function T(e,t,s=`${t}s`){const r=s===`${t}s`&&t.endsWith("y")?`${t.slice(0,-1)}ies`:s;return`${e} ${e===1?t:r}`}function jt(e){const t=[];let s=[];for(const r of e){if(r.depth===0&&s.length>0){t.push(s),s=[r];continue}s.push(r)}return s.length>0&&t.push(s),t}function me(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const s=t.getTime()-Date.now(),r=new Intl.RelativeTimeFormat("en",{numeric:"auto"}),i=[["year",1e3*60*60*24*365],["month",1e3*60*60*24*30],["week",1e3*60*60*24*7],["day",1e3*60*60*24],["hour",1e3*60*60],["minute",1e3*60]];for(const[n,u]of i)if(Math.abs(s)>=u)return r.format(Math.round(s/u),n);return r.format(Math.round(s/1e3),"second")}function Et(){return c.jsx("ul",{className:"space-y-5",children:Pt.map(e=>c.jsxs("li",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"bg-ic-bg inline-flex h-9 w-9 animate-pulse rounded-full"}),c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("span",{className:"bg-ic-bg inline-flex h-4 w-28 animate-pulse rounded"}),c.jsx("span",{className:"bg-ic-bg inline-flex h-4 w-14 animate-pulse rounded"})]})]}),c.jsxs("div",{className:"ml-12 space-y-2",children:[c.jsx("span",{className:"bg-ic-bg inline-flex h-5 w-[90%] animate-pulse rounded"}),c.jsx("span",{className:"bg-ic-bg inline-flex h-5 w-[72%] animate-pulse rounded"}),c.jsx("span",{className:"bg-ic-bg inline-flex h-4 w-12 animate-pulse rounded"})]})]},e))})}function be({postUrl:e,onUnavailable:t}){const s=yt({queryKey:["bluesky-thread",e],queryFn:()=>Rt(e),refetchOnWindowFocus:!1,staleTime:3e4});w.useEffect(()=>{s.data?.status==="unavailable"&&t()},[t,s.data]);const r=s.isLoading||!s.data;if(!r&&s.data?.status==="unavailable")return null;const i=s.data?.status==="ok"?s.data.data.summary:null,n=s.data?.status==="ok"?s.data.data.replies:[],u=jt(n);return c.jsxs("div",{className:"space-y-5 text-sm md:text-base",children:[r?c.jsxs("div",{className:"text-subtle flex flex-wrap items-center justify-between gap-3 text-sm",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("span",{className:"inline-flex min-w-16",children:i?T(i.replyCount,"reply"):c.jsx("span",{className:"bg-ic-bg inline-flex h-4 w-16 animate-pulse rounded"})}),c.jsx("span",{className:"inline-flex min-w-14",children:i?T(i.likeCount,"like"):c.jsx("span",{className:"bg-ic-bg inline-flex h-4 w-14 animate-pulse rounded"})}),c.jsx("span",{className:"inline-flex min-w-14",children:i?T(i.quoteCount,"quote"):c.jsx("span",{className:"bg-ic-bg inline-flex h-4 w-14 animate-pulse rounded"})})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{type:"button",className:"border-border text-subtle hover:text-text cursor-pointer rounded border px-2 py-1 text-xs",disabled:!0,children:"Refresh"}),c.jsx("a",{href:i?.replyUrl??e,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Reply on Bluesky"})]})]}):c.jsxs("div",{className:"text-subtle flex flex-wrap items-center justify-between gap-3 text-sm",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("span",{children:T(i?.replyCount??0,"reply")}),c.jsx("span",{children:T(i?.likeCount??0,"like")}),c.jsx("span",{children:T(i?.quoteCount??0,"quote")})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{type:"button",className:"border-border text-subtle hover:text-text cursor-pointer rounded border px-2 py-1 text-xs",onClick:()=>s.refetch(),disabled:s.isFetching,children:s.isFetching?"Refreshing...":"Refresh"}),c.jsx("a",{href:i?.replyUrl??e,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Reply on Bluesky"})]})]}),r?c.jsx(Et,{}):n.length===0?c.jsx("p",{className:"text-subtle text-sm",children:"No Bluesky replies yet."}):c.jsx("ul",{className:"space-y-4",children:u.map((a,h)=>c.jsx("li",{className:"border-border bg-ic-bg/25 rounded-xl border p-4 md:p-5",children:c.jsx("ul",{className:"space-y-5",children:a.map(o=>c.jsxs("li",{className:"space-y-2",style:{marginInlineStart:`${o.depth*1.25}rem`},children:[c.jsxs("div",{className:"flex items-center gap-3",children:[o.author.avatar?c.jsx("img",{src:o.author.avatar,alt:"",className:"h-9 w-9 rounded-full object-cover",loading:"lazy"}):c.jsx("div",{className:"bg-ic-bg h-9 w-9 rounded-full","aria-hidden":"true"}),c.jsxs("div",{className:"min-w-0 text-sm",children:[c.jsx("span",{className:"text-text font-semibold",children:o.author.displayName??o.author.handle})," ",o.replyUrl?c.jsx("a",{href:o.replyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-subtle hover:underline",children:me(o.createdAt)}):c.jsx("span",{className:"text-subtle",children:me(o.createdAt)})]})]}),c.jsx("p",{className:"text-text ml-12 whitespace-pre-wrap",children:o.segments.map((l,p)=>l.href?c.jsx("a",{href:l.href,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:l.text},`${o.id}-${p}`):c.jsx(w.Fragment,{children:l.text},`${o.id}-${p}`))}),o.externalEmbed&&c.jsx("a",{href:o.externalEmbed.uri,target:"_blank",rel:"noopener noreferrer",className:"border-border bg-ic-bg/50 hover:border-primary ml-12 block overflow-hidden rounded-lg border",children:c.jsxs("div",{className:"flex items-stretch",children:[o.externalEmbed.thumb?c.jsx("img",{src:o.externalEmbed.thumb,alt:"",className:"h-24 w-24 shrink-0 object-cover",loading:"lazy"}):null,c.jsxs("div",{className:"space-y-1 p-3 text-sm",children:[c.jsx("p",{className:"text-primary line-clamp-1",children:o.externalEmbed.uri}),o.externalEmbed.title?c.jsx("p",{className:"text-text line-clamp-1",children:o.externalEmbed.title}):null,o.externalEmbed.description?c.jsx("p",{className:"text-subtle line-clamp-2",children:o.externalEmbed.description}):null]})]})}),c.jsx("p",{className:"text-subtle ml-12 text-sm",children:T(o.likeCount,"like")})]},o.id))})},a[0]?.id??h))})]})}async function It(e,t){const s=ye.get(e);if(s){s.root.render(c.jsx(fe,{client:s.queryClient,children:c.jsx(be,{...t})}));return}const r=new st,i=ke.createRoot(e);ye.set(e,{root:i,queryClient:r}),i.render(c.jsx(fe,{client:r,children:c.jsx(be,{...t})}))}export{It as mountBlueskyComments};
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.