PageSourceSearch

https://www.mumsnet.com/build/assets/index-DyaHskFO.js

js mumsnet.com collected 2026-09-24 09:03:09 UTC 288,429 bytes, 81 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FeedTrending-DCUxc6c-.js","assets/dist-DViRp4pB.js","assets/RichPreviewLink-2uqPeGYt.js","assets/helpers-BbGwLwYt.js","assets/useFeature-BghRU3ys.js","assets/useApiFetch-Dunr7vaE.js","assets/echo-BkqwpmdH.js","assets/auth-Duc6VjE7.js","assets/tailwind-BdxN9Y1q.js","assets/click-id-BskgSvSs.js","assets/lifecycle-B3D1druh.js","assets/consent-CB6N6ypq.js","assets/classPrivateFieldSet2-BpGEd64M.js","assets/parseAdSizes-OhehVpiA.js","assets/shouldCapSafariSession-Bak1G07s.js","assets/Enum-t8T5OW0A.js","assets/useCookies-FVB3JI4U.js","assets/toast-Ckj7knoe.js","assets/toast-BKBneOsh.css","assets/useScrollManager-DdF18opK.js","assets/ScrollManager-BC40HKR1.js","assets/ReadyBarrier-GU8V6cKt.js","assets/PrimaryButton-DnIp69dG.js","assets/vue-router-D7hTbeZt.js","assets/RovingFocusGroup-DLluUwg7.js","assets/utils-9pdn69G0.js","assets/SurveyWidget-BNaRO67k.js","assets/permutive-CjlDZSTc.js","assets/esm-BiFo4-4P.js","assets/json-query-BNy9RHg4.js","assets/_plugin-vue_export-helper-BuuqxS5P.js","assets/SurveyWidget-CkTZX-ml.css","assets/button-DpuiwghW.js","assets/dist-BKL6-yQU.js","assets/api-request-B1Ijgz_i.js","assets/ClientOnly-BmGoGhwk.js","assets/card-C0fINC59.js","assets/MpuAd-BrrBdxcU.js","assets/DangerousHtml-DHIgo9D4.js","assets/dist-zS6AMtM4.js","assets/helpers-D67UMDGR.js","assets/image-BvyVGhjo.js","assets/TheGif-D1jhNEJW.js","assets/AffiliateTrendingWidgetApp-MruCenin.js","assets/WidgetLink-BgKL3Jva.js","assets/WidgetSkeleton-B9Mtpk5V.js","assets/accessibility-BEFhwGVw.js","assets/CbotWidget-DV6ggNzx.js","assets/glide.esm-CT-HKwZn.js","assets/PrimisPlayer-ClvwKQXu.js","assets/TrendingWidgetApp-qKi9M3BR.js","assets/FeedAffiliate-BCUe5yBA.js","assets/FeedActive-BpVCm_xK.js","assets/FeedPersonal-BdjQUwCx.js","assets/comments-sparkles-DSA5U2jc.js","assets/FeedFollowing-Be-ydUNU.js"])))=>i.map(i=>d[i]);
2(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`8091322e-fc0c-4918-a19c-fe4468a85c23`,e._sentryDebugIdIdentifier=`sentry-dbid-8091322e-fc0c-4918-a19c-fe4468a85c23`)}catch{}})();import{$t as e,At as t,B as n,Bt as r,C as i,Cn as a,E as o,Et as s,F as c,Ft as l,G as u,Gt as d,H as f,Hn as p,In as m,It as h,J as g,Jt as _,Ln as v,Lt as y,M as b,Mn as x,Mt as S,Nt as C,On as w,Ot as T,Pn as E,Pt as D,Rn as O,St as k,Tn as A,Tt as j,Ut as M,V as ee,Vn as N,Wn as P,Wt as F,Xt as I,Z as te,Zt as L,_ as R,a as z,an as ne,b as re,bn as B,bt as ie,c as ae,cn as oe,d as se,dn as ce,en as le,fn as ue,ft as de,hn as V,i as H,in as fe,jn as pe,jt as U,k as me,kt as W,m as he,mn as G,mt as ge,n as _e,nn as K,on as ve,qt as ye,r as be,rn as xe,sn as Se,tn as Ce,un as we,v as Te,vt as Ee,wn as De,wt as q,xn as Oe,xt as ke,y as Ae,yt as je,zn as J,zt as Me}from"./dist-DViRp4pB.js";import{t as Ne}from"./axios-DewT-bdj.js";import{A as Pe,B as Fe,F as Ie,H as Le,O as Re,V as ze,f as Be,k as Ve,l as He}from"./helpers-BbGwLwYt.js";import{n as Ue,t as We}from"./useFeature-BghRU3ys.js";import{t as Ge}from"./sentry-BW8hzKNk.js";import{c as Ke}from"./consent-CB6N6ypq.js";import{n as qe}from"./echo-BkqwpmdH.js";import{i as Je,n as Ye,r as Xe}from"./useApiFetch-Dunr7vaE.js";import{t as Ze}from"./auth-Duc6VjE7.js";import{t as Qe}from"./ReadyBarrier-GU8V6cKt.js";import{n as $e,r as et,t as tt}from"./tailwind-BdxN9Y1q.js";import{t as nt}from"./click-id-BskgSvSs.js";import{N as rt,r as it,s as at,u as ot}from"./lifecycle-B3D1druh.js";import{t as st}from"./preload-helper-Bc_9wxK1.js";import{t as ct}from"./once-per-session-CUTUIF3h.js";import{t as lt}from"./useDismiss-Cv1adlKC.js";import{i as ut,n as dt,r as ft}from"./store-Dg1Ku7Ip.js";import{t as pt}from"./toast-Ckj7knoe.js";import{n as mt,r as ht}from"./utils-os6_fS6b.js";import{t as gt}from"./watch-thread-DctyCgyl.js";import{a as _t,c as vt,d as yt,f as bt,i as xt,l as St,m as Ct,n as wt,o as Tt,p as Et,r as Dt,s as Ot,t as kt,u as At}from"./merge-q7_Yd1hl.js";import{t as jt}from"./useScrollManager-DdF18opK.js";import{t as Mt}from"./_plugin-vue_export-helper-BuuqxS5P.js";import{t as Nt}from"./PrimaryButton-DnIp69dG.js";import{i as Pt,t as Ft}
vendor: 4,046 bytes, line 2
2from"./createVueApp-z5fgMD2Z.js";import{c as It,d as Lt,f as Rt,h as zt,l as Bt,m as Vt,p as Ht,t as Ut,u as Wt,v as Gt,y as Kt}from"./RovingFocusGroup-DLluUwg7.js";import{C as qt,S as Jt,T as Yt,_ as Xt,b as Zt,c as Qt,d as $t,f as en,g as Y,h as tn,i as nn,l as rn,m as an,n as on,o as sn,p as cn,s as ln,t as un,u as dn,v as fn,w as pn,x as mn,y as hn}from"./vue-router-D7hTbeZt.js";import{t as gn}from"./RovingFocusItem-iBrobi16.js";import"./utils-9pdn69G0.js";import{n as _n}from"./SurveyWidget-BNaRO67k.js";import{n as X,t as vn}from"./button-DpuiwghW.js";import{t as yn}from"./api-request-B1Ijgz_i.js";import{a as bn,c as xn,d as Sn,f as Cn,l as wn,n as Tn,o as En,s as Dn,t as On,u as kn}from"./RichPreviewLink-2uqPeGYt.js";import{t as An}from"./ClientOnly-BmGoGhwk.js";import{i as jn,n as Mn,t as Nn}from"./card-C0fINC59.js";import{t as Pn}from"./MpuAd-BrrBdxcU.js";import{t as Fn}from"./DangerousHtml-DHIgo9D4.js";import{n as In,t as Ln}from"./dist-zS6AMtM4.js";import{t as Rn}from"./image-BvyVGhjo.js";import{t as zn}from"./TheGif-D1jhNEJW.js";import{n as Bn}from"./AffiliateTrendingWidgetApp-MruCenin.js";import{n as Vn}from"./CbotWidget-DV6ggNzx.js";import{n as Hn}from"./PrimisPlayer-ClvwKQXu.js";import{n as Un}from"./TrendingWidgetApp-qKi9M3BR.js";import{i as Wn,n as Gn,r as Kn}from"./CreateReplyForm-BKI0TMzn.js";import{t as qn}from"./useShortcut-CpjEVo62.js";import{t as Jn}from"./TheAlert-gznQxLp8.js";import{n as Yn}from"./WatchThreadDropin-DOJlk2JO.js";import{t as Xn}from"./TheSpinner-bECB5TZ6.js";import{n as Zn}from"./PollWidget-DROm09vF.js";import{n as Qn}from"./SimilarThreadsWidgetApp-BWXxxF3B.js";import{n as $n}from"./ImageGallery-DXQYtdg8.js";import{n as er,r as tr}from"./ReactionCounter-Dsje8cJ2.js";import{c as nr}from"./RichPreviewLink-DGo_NWYw.js";import{a as rr,c as ir,i as ar,n as or,o as sr,r as cr,s as lr}from"./PostFooter-DSg7hPjJ.js";import{t as ur}from"./TheTooltip-D1FLiLx3.js";import{n as dr}from"./StartThreadPrompt-r1exs5Sf.js";import{t as fr}from"./LinkButton-C7oKjOCm.js";import{n as pr}from"./ThreadMediaApp-B-rWMntv.js";import{n as mr}from"./EmailNewsletterCtaCard-DZYQ_qev.js";var{Axios:hr,AxiosError:gr,CanceledError:_r,isCancel:vr,CancelToken:yr,VERSION:br,all:xr,Cancel:Sr,isAxiosError:Cr,spread:wr,toFormData:Tr,AxiosHeaders:Er,HttpStatusCode:Dr,formToJSON:Or,getAdapter:kr,mergeConfig:Ar,create:jr}=Ne,Mr=`[object Symbol]`;function Nr(e){return typeof e==`symbol`||yt(e)&&bt(e)==Mr}function Pr(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var Fr=1/0,Ir=Et?Et.prototype:void 0,Lr=Ir?Ir.toString:void 0;function Rr(e){if(typeof e==`string`)return e;if(At(e))return Pr(e,Rr)+``;if(Nr(e))return Lr?Lr.call(e):``;var t=e+``;return t==`0`&&1/e==-Fr?`-0`:t}var zr=/\s/;function Br(e){for(var t=e.length;t--&&zr.test(e.charAt(t)););return t}var Vr=/^\s+/;function Hr(e){return e&&e.slice(0,Br(e)+1).replace(Vr,``)}var Ur=NaN,Wr=/^[-+]0x[0-9a-f]+$/i,Gr=/^0b[01]+$/i,Kr=/^0o[0-7]+$/i,qr=parseInt;function Jr(e){if(typeof e==`number`)return e;if(Nr(e))return Ur;if(St(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=St(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=Hr(e);var n=Gr.test(e);return n||Kr.test(e)?qr(e.slice(2),n?2:8):Wr.test(e)?Ur:+e}var Yr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xr=/^\w*$/;function Zr(e,t){if(At(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||Nr(e)?!0:Xr.test(e)||!Yr.test(e)||t!=null&&e in Object(t)}var Qr=`Expected a function`;function $r(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(Qr);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new($r.Cache||xt),n}$r.Cache=xt;var ei=500;function ti(e){var t=$r(e,function(e){return n.size===ei&&n.clear(),e}),n=t.cache;return t}var ni=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ri=/\\(\\)?/g,ii=ti(function(e){var t=[];
2return e.charCodeAt(0)===46&&t.push(``),e.replace(ni,function(e,n,r,i){t.push(r?i.replace(ri,`$1`):n||e)}),t});function ai(e){return e==null?``:Rr(e)}function oi(e,t){return At(e)?e:Zr(e,t)?[e]:ii(ai(e))}var si=1/0;function ci(e){if(typeof e==`string`||Nr(e))return e;var t=e+``;return t==`0`&&1/e==-si?`-0`:t}function li(e,t){t=oi(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ci(t[n++])];return n&&n==r?e:void 0}function ui(e,t,n){var r=e==null?void 0:li(e,t);return r===void 0?n:r}function di(e){return function(t){return e?.[t]}}function fi(e,t,n){t=oi(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=ci(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&Tt(i)&&vt(o,i)&&(At(e)||_t(e)))}var pi=function(){return Ct.Date.now()},mi=`Expected a function`,hi=Math.max,gi=Math.min;function _i(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError(mi);t=Jr(t)||0,St(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?hi(Jr(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function m(e){return l=e,s=setTimeout(_,t),u?p(e):o}function h(e){var n=e-c,r=e-l,i=t-n;return d?gi(i,a-r):i}function g(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){var e=pi();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(pi())}function x(){var e=pi(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}var vi=di({"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`}),yi=/[&<>"']/g,bi=RegExp(yi.source);function xi(e){return e=ai(e),e&&bi.test(e)?e.replace(yi,vi):e}var Si=Object.prototype.hasOwnProperty;function Ci(e,t){return e!=null&&Si.call(e,t)}function wi(e,t){return e!=null&&fi(e,t,Ci)}function Ti(e,t,n,r){if(!St(e))return e;t=oi(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=ci(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var u=s[c];l=r?r(u,c,s):void 0,l===void 0&&(l=St(u)?u:vt(t[i+1])?[]:{})}Ot(s,c,l),s=s[c]}return e}function Ei(e,t,n){return e==null?e:Ti(e,t,n)}var[Di,Oi]=Kt(`DialogRoot`),ki=y({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let r=e,i=n(r,`open`,t,{defaultValue:r.defaultOpen,passive:r.open===void 0}),a=A(),o=A(),{modal:s,unmountOnHide:c}=pe(r);return Oi({open:i,modal:s,unmountOnHide:c,openModal:()=>{i.value=!0},onOpenChange:e=>{i.value=e},onOpenToggle:()=>{i.value=!i.value},contentId:``,titleId:``,descriptionId:``,triggerElement:a,contentElement:o}),(e,t)=>K(e.$slots,`default`,{open:E(i),close:()=>i.value=!1})}}),Ai=y({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(n){let r=n;Ht();let i=Di();return(n,a)=>(e(),t(E(It),F(r,{type:n.as===`button`?`button`:void 0,onClick:a[0]||=e=>E(i).onOpenChange(!1)}),{default:G(()=>[K(n.$slots,`default`)]),_:3},16,[`type`]))}}),ji=y({__name:`DialogContentImpl`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(n,{emit:r}){let i=n,a=r,o=Di(),{forwardRef:s,currentElement:c}=Ht();return o.titleId||=Wt(void 0,`reka-dialog-title`),o.descriptionId||=Wt(void 0,`reka-dialog-description`),I(()=>{o.contentElement=c,Gt()!==document.body&&(o.triggerElement.value=Gt())}),(n,r)=>(e(),t(E(Jt),{"as-child":``,loop:``,trapped:i.trapFocus,present:i.present,onMountAutoFocus:r[5]||=e=>a(`openAutoFocus`,e),onUnmountAutoFocus:r[6]||=e=>a(`closeAutoFocus`,e)}
2,{default:G(()=>[h(E(qt),F({id:E(o).contentId,ref:E(s),as:n.as,"as-child":n.asChild,present:i.present,"disable-outside-pointer-events":n.disableOutsidePointerEvents,role:`dialog`,"aria-describedby":E(o).descriptionId,"aria-labelledby":E(o).titleId,"data-state":E(mn)(E(o).open.value)},n.$attrs,{onDismiss:r[0]||=e=>E(o).onOpenChange(!1),onEscapeKeyDown:r[1]||=e=>a(`escapeKeyDown`,e),onFocusOutside:r[2]||=e=>a(`focusOutside`,e),onInteractOutside:r[3]||=e=>a(`interactOutside`,e),onPointerDownOutside:r[4]||=e=>a(`pointerDownOutside`,e)}),{default:G(()=>[K(n.$slots,`default`)]),_:3},16,[`id`,`as`,`as-child`,`present`,`disable-outside-pointer-events`,`aria-describedby`,`aria-labelledby`,`data-state`])]),_:3},8,[`trapped`,`present`]))}}),Mi=y({__name:`DialogContentModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(n,{emit:r}){let i=n,a=r,o=Di(),s=Vt(a),{forwardRef:c,currentElement:l}=Ht(),u=T(()=>i.present?l.value:void 0);pn(u);let d=T(()=>{let{present:e,...t}=i;return t});return ce(()=>i.present,(e,t)=>{!e&&t&&o.triggerElement.value?.focus()}),(n,r)=>(e(),t(ji,F({...d.value,...E(s)},{ref:E(c),present:n.present,"trap-focus":E(o).open.value,"disable-outside-pointer-events":i.disableOutsidePointerEvents,onCloseAutoFocus:r[0]||=e=>{e.defaultPrevented||(e.preventDefault(),E(o).triggerElement.value?.focus())},onPointerDownOutside:r[1]||=e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()},onFocusOutside:r[2]||=e=>{e.preventDefault()}}),{default:G(()=>[K(n.$slots,`default`)]),_:3},16,[`present`,`trap-focus`,`disable-outside-pointer-events`]))}}),Ni=y({__name:`DialogContentNonModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(n,{emit:r}){let i=n,a=Vt(r);Ht();let o=Di(),s=A(!1),c=A(!1),l=T(()=>{let{present:e,...t}=i;return t});return ce(()=>i.present,(e,t)=>{!e&&t&&(s.value||o.triggerElement.value?.focus(),s.value=!1,c.value=!1)}),(n,r)=>(e(),t(ji,F({...l.value,...E(a)},{present:n.present,"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:r[0]||=e=>{e.defaultPrevented||(s.value||E(o).triggerElement.value?.focus(),e.preventDefault()),s.value=!1,c.value=!1},onInteractOutside:r[1]||=e=>{e.defaultPrevented||(s.value=!0,e.detail.originalEvent.type===`pointerdown`&&(c.value=!0));let t=e.target;E(o).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&c.value&&e.preventDefault()}}),{default:G(()=>[K(n.$slots,`default`)]),_:3},16,[`present`]))}}),Pi=y({__name:`DialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(n,{emit:r}){let i=n,a=r,o=Di(),s=Vt(a),{forwardRef:c}=Ht();return(n,r)=>(e(),t(E(Bt),{present:n.forceMount||E(o).open.value,"force-mount":n.forceMount||!E(o).unmountOnHide.value},{default:G(({present:r})=>[E(o).modal.value?V((e(),t(Mi,F({key:0,ref:E(c),present:E(o).unmountOnHide.value||r},{...i,...E(s),...n.$attrs}),{default:G(()=>[K(n.$slots,`default`)]),_:2},1040,[`present`])),[[ie,E(o).unmountOnHide.value||r]]):V((e(),t(Ni,F({key:1,ref:E(c),present:E(o).unmountOnHide.value||r},{...i,...E(s),...n.$attrs}),{default:G(()=>[K(n.$slots,`default`)]),_:2},1040,[`present`])),[[ie,E(o).unmountOnHide.value||r]])]),_:3},8,[`present`,`force-mount`]))}}),Fi=y({__name:`DialogOverlayImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},setup(n){let r=n,i=Di(),a=Yt(r.present);return ce(()=>r.present,e=>a.value=e),Ht(),(n,r)=>(e(),t(E(It),{as:n.as,"as-child":n.asChild,"data-state":E(i).open.value?`open`:`closed`,style:{"pointer-events":`auto`},onPointerdown:r[0]||=k(()=>{},[`left`,`self`,`prevent`])},{default:G(()=>[K(n.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),Ii=y({__name:`DialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){let r=Di(),{forwardRef:i}=Ht();return(n,a)=>E(r)?.modal.value?(e(),t(E(Bt),{key:0,present:n.forceMount||E(r).open.value,"force-mount":n.forceMount||!E(r).unmountOnHide.value},{default:G(({present:e})=>[V(h(Fi,F(n.$attrs,{ref:E(i),as:n.as,"as-child":n.asChild,present:E(r).unmountOnHide.value||e}),{default:G(()=>[K(n.$slots,`default`)]),_:2},1040,[`as`,`as-child`,`present`]),[[ie,E(r).unmountOnHide.value||e]])]),_:3},8,[`present`,`force-mount`])):U(`v-if`,!0)}}),Li=y({__name:`DialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(n){let r=n;return(n,i)=>(e(),t(E(Zt),v(Me(r)),{default:G(()=>[K(n.$slots,`default`)]),_:3},16))}}),Ri=y({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(n){let r=n,i=Di();return Ht(),(n,a)=>(e(),t(E(It),F(r,{id:E(i).titleId}),{default:G(()=>[K(n.$slots,`default`)]),_:3},16,[`id`]))}}
2),[zi,Bi]=Kt(`TabsRoot`),Vi=y({__name:`TabsRoot`,props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:`horizontal`},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:`automatic`},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(r,{emit:i}){let a=r,o=i,{orientation:s,unmountOnHide:c,dir:l}=pe(a),u=zt(l);Ht();let d=n(a,`modelValue`,o,{defaultValue:a.defaultValue,passive:a.modelValue===void 0}),f=A(),p=w(new Set);return Bi({modelValue:d,changeModelValue:e=>{d.value=e},orientation:s,dir:u,unmountOnHide:c,activationMode:a.activationMode,baseId:Wt(void 0,`reka-tabs`),tabsList:f,contentIds:p,registerContent:e=>{p.value=new Set([...p.value,e])},unregisterContent:e=>{let t=new Set(p.value);t.delete(e),p.value=t}}),(n,r)=>(e(),t(E(It),{dir:E(u),"data-orientation":E(s),"as-child":n.asChild,as:n.as},{default:G(()=>[K(n.$slots,`default`,{modelValue:E(d)})]),_:3},8,[`dir`,`data-orientation`,`as-child`,`as`]))}});function Hi(e,t){return`${e}-trigger-${t}`}function Ui(e,t){return`${e}-content-${t}`}var Wi=y({__name:`TabsList`,props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){let{loop:r}=pe(n),{forwardRef:i,currentElement:a}=Ht(),o=zi();return o.tabsList=a,(n,a)=>(e(),t(E(Ut),{"as-child":``,orientation:E(o).orientation.value,dir:E(o).dir.value,loop:E(r)},{default:G(()=>[h(E(It),{ref:E(i),role:`tablist`,"as-child":n.asChild,as:n.as,"aria-orientation":E(o).orientation.value},{default:G(()=>[K(n.$slots,`default`)]),_:3},8,[`as-child`,`as`,`aria-orientation`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),Gi=y({__name:`TabsTrigger`,props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(n){let r=n,{forwardRef:i}=Ht(),a=zi(),o=T(()=>Hi(a.baseId,r.value)),s=T(()=>a.contentIds.value.has(r.value)?Ui(a.baseId,r.value):void 0),c=T(()=>r.value===a.modelValue.value);return(n,r)=>(e(),t(E(gn),{"as-child":``,focusable:!n.disabled,active:c.value},{default:G(()=>[h(E(It),{id:o.value,ref:E(i),role:`tab`,type:n.as===`button`?`button`:void 0,as:n.as,"as-child":n.asChild,"aria-selected":c.value?`true`:`false`,"aria-controls":s.value,"data-state":c.value?`active`:`inactive`,disabled:n.disabled,"data-disabled":n.disabled?``:void 0,"data-orientation":E(a).orientation.value,onMousedown:r[0]||=k(e=>{!n.disabled&&e.ctrlKey===!1?E(a).changeModelValue(n.value):e.preventDefault()},[`left`]),onKeydown:r[1]||=ke(e=>E(a).changeModelValue(n.value),[`enter`,`space`]),onFocus:r[2]||=()=>{let e=E(a).activationMode!==`manual`;!c.value&&!n.disabled&&e&&E(a).changeModelValue(n.value)}},{default:G(()=>[K(n.$slots,`default`)]),_:3},8,[`id`,`type`,`as`,`as-child`,`aria-selected`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`data-orientation`])]),_:3},8,[`focusable`,`active`]))}}),Ki={__name:`FeedFeatured`,props:Sn.props,setup(n){let r=n;return(n,i)=>(e(),t(E(Sn),F(r,{"aria-label":`Featured Feed`}),C({_:2},[Ce(n.$slots,(e,t)=>({name:t,fn:G(e=>[K(n.$slots,t,v(Me(e)))])}))]),1040))}},qi;(function(e){e.pop=`pop`,e.push=`push`})(qi||={});var Ji;(function(e){e.back=`back`,e.forward=`forward`,e.unknown=``})(Ji||={});var Yi=()=>({left:window.scrollX,top:window.scrollY}),Xi=(e=``)=>{let t=[],n=H?.history.state,r=n?.to??e,i=0,a=(e,n,{direction:r,delta:i,type:a})=>{let o={direction:r,delta:i,type:a??qi.pop};for(let r of t)r(e,n,o)},o={state:n,base:``,push(e,t){n={...t,to:e,back:n,stateId:Date.now(),position:++i},H?.history.pushState(n,``),r=e},replace(e,t){n={...t,to:e,back:n?.back,stateId:Date.now(),position:i},setTimeout(()=>{H?.history.replaceState(n,``),r=e},0)},go(e,t=!0){let r=this.location,i=e<0?Ji.back:Ji.forward;H?.history.go(e),n=H?.history.state,t&&a(this.location,r,{direction:i,delta:e})},listen(e){return t.push(e),function(){t=t.filter(t=>t!==e)}},destroy(){t=[]},createHref:e=>e};return Object.defineProperty(o,"location",{enumerable:!0,get:()=>r}),H.addEventListener(`popstate`,({state:t})=>{let i=t?.to??e,s=o.location,c=n,l=0,u=Ji.unknown;t?(r=i,n=t,l=c?t.position-c.position:0,l&&(u=l>0?Ji.forward:Ji.back)):o.replace(i),a(r,s,{direction:u,delta:l,type:qi.push})}),H.addEventListener(`beforeunload`,()=>{history.state&&history.replaceState(Object.assign({},history.state,n,{scroll:Yi()}),``)},{passive:!0}),o},Zi=[{alias:`/`,path:`/featured`,name:`featured`,components:{default:Ki,"sidebar-primary":Un,"sidebar-secondary":Bn},meta:{title:`Featured`,initUrl:`/api/v3/feeds/featured`}},{path:`/trending`,name:`trending`,components:{default:()=>st(()=>import(`./FeedTrending-DCUxc6c-.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50])),"sidebar-primary":Un,"sidebar-secondary":Bn},meta:{title:`Trending`,initUrl:`/api/v3/feeds/trending?is_sensitive=false`}},{path:`/shopping`,name:`shopping`,components:{default:()=>st(()=>import(`./FeedAffiliate-BCUe5yBA.js`),__vite__mapDeps([51,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50])),"sidebar-primary":Un,"sidebar-secondary":Bn},props:{default:e=>({name:e.name}),"sidebar-primary":e=>({name:e.name+`: sidebar-primary`}),"sidebar-secondary":e=>({name:e.name+`: sidebar-secondary`})},meta:{title:`Shopping`,initUrl:`/api/v3/feeds/affiliate?is_sensitive=false`}},{path:`/active`,name:`active`,components:{default:()=>st(()=>import(`./FeedActive-BpVCm_xK.js`),__vite__mapDeps([52,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50])),"sidebar-primary":Un,"sidebar-secondary":Bn},props:{default:e=>({name:e.name}),"sidebar-primary":e=>({name:e.name+`: sidebar-primary`}),"sidebar-secondary":e=>({name:e.name+`: sidebar-secondary`})},meta:{title:`Active`,initUrl:`/api/v3/talk/threads/active?is_sensitive=false&with_media=true`}},{path:`/for-you`,name:`for-you`,components:{default:()=>st(()=>import(`./FeedPersonal-BdjQUwCx.js`),__vite__mapDeps([53,1,7,3,6,5,23,8,24,25,32,33,2,4,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,27,28,29,30,31,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,54])),"sidebar-primary":Un,"sidebar-secondary":Bn},props:{default:e=>({name:e.name}),"sidebar-primary":e=>({name:e.name+`: sidebar-primary`}),"sidebar-secondary":e=>({name:e.name+`: sidebar-secondary`})},meta:{title:`For You`,initUrl:`/api/v3/feeds/personal?is_sensitive=false`}},{path:`/following`,name:`following`,components:{default:()=>st(()=>import(`./FeedFollowing-Be-ydUNU.js`),__vite__mapDeps([55,1,7,3,6,5,23,8,24,25,32,33,2,4,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,27,28,29,30,31,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,54])),"sidebar-primary":Un,"sidebar-secondary":Bn},props:{default:e=>({name:e.name}),"sidebar-primary":e=>({name:e.name+`: sidebar-primary`}),"sidebar-secondary":e=>({name:e.name+`: sidebar-secondary`})},meta:{title:`Following`,initUrl:`/api/v3/feeds/following?is_sensitive=false`}}],Qi=async e=>
2{let t=on({history:g?Xi():un(),routes:Zi});return e.use(t),g&&(window.history.scrollRestoration=`manual`),g||await t.replace({name:`featured`}),await t.isReady(),g&&(await t.replace({query:{...t.currentRoute.query,page:void 0}}),ce(t.currentRoute,(e,t)=>{H?.dispatchEvent(new CustomEvent(`virtual-page-view`,{detail:{...e.query.page??{},oldUrl:`/home`+t.fullPath,newUrl:`/home`+e.fullPath,pageTitle:e.meta?.title?Qp.title(e.meta.title):be?.title}}))},{deep:!0})),t},$i=N(((e,t)=>{t.exports=TypeError})),ea=N(((e,t)=>{t.exports={}})),ta=N(((e,t)=>{var n=typeof Map==`function`&&Map.prototype,r=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,`size`):null,i=n&&r&&typeof r.get==`function`?r.get:null,a=n&&Map.prototype.forEach,o=typeof Set==`function`&&Set.prototype,s=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Set.prototype,`size`):null,c=o&&s&&typeof s.get==`function`?s.get:null,l=o&&Set.prototype.forEach,u=typeof WeakMap==`function`&&WeakMap.prototype?WeakMap.prototype.has:null,d=typeof WeakSet==`function`&&WeakSet.prototype?WeakSet.prototype.has:null,f=typeof WeakRef==`function`&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,m=Object.prototype.toString,h=Function.prototype.toString,g=String.prototype.match,_=String.prototype.slice,v=String.prototype.replace,y=String.prototype.toUpperCase,b=String.prototype.toLowerCase,x=RegExp.prototype.test,S=Array.prototype.concat,C=Array.prototype.join,w=Array.prototype.slice,T=Math.floor,E=typeof BigInt==`function`?BigInt.prototype.valueOf:null,D=Object.getOwnPropertySymbols,O=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?Symbol.prototype.toString:null,k=typeof Symbol==`function`&&typeof Symbol.iterator==`object`,A=typeof Symbol==`function`&&Symbol.toStringTag?Symbol.toStringTag:null,j=Object.prototype.propertyIsEnumerable,M=(typeof Reflect==`function`?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function ee(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||x.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e==`number`){var r=e<0?-T(-e):T(e);if(r!==e){var i=String(r),a=_.call(t,i.length+1);return v.call(i,n,`$&_`)+`.`+v.call(v.call(a,/([0-9]{3})/g,`$&_`),/_$/,``)}}return v.call(t,n,`$&_`)}var N=ea(),P=N.custom,F=ce(P)?P:null,I={__proto__:null,double:`"`,single:`'`},te={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};t.exports=function e(t,n,r,o){var s=n||{};if(de(s,`quoteStyle`)&&!de(I,s.quoteStyle))throw TypeError(`option "quoteStyle" must be "single" or "double"`);if(de(s,`maxStringLength`)&&(typeof s.maxStringLength==`number`?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!de(s,`customInspect`)||s.customInspect;if(typeof u!=`boolean`&&u!==`symbol`)throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(de(s,`indent`)&&s.indent!==null&&s.indent!==`	`&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(de(s,`numericSeparator`)&&typeof s.numericSeparator!=`boolean`)throw TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=s.numericSeparator;if(t===void 0)return`undefined`;if(t===null)return`null`;if(typeof t==`boolean`)return t?`true`:`false`;if(typeof t==`string`)return ge(t,s);if(typeof t==`number`){if(t===0)return 1/0/t>0?`0`:`-0`;var f=String(t);return d?ee(t,f):f}if(typeof t==`bigint`){var m=String(t)+`n`;return d?ee(t,m):m}var h=s.depth===void 0?5:s.depth;if(r===void 0&&(r=0),r>=h&&h>0&&typeof t==`object`)return ne(t)?`[Array]`:`[Object]`;var g=xe(s,r);
vendor: 5,735 bytes, lines 2-5
2if(o===void 0)o=[];else if(fe(o,t)>=0)return`[Circular]`;function y(t,n,i){if(n&&(o=w.call(o),o.push(n)),i){var a={depth:s.depth};return de(s,`quoteStyle`)&&(a.quoteStyle=s.quoteStyle),e(t,a,r+1,o)}return e(t,s,r+1,o)}if(typeof t==`function`&&!B(t)){var x=H(t),T=Ce(t,y);return`[Function`+(x?`: `+x:` (anonymous)`)+`]`+(T.length>0?` { `+C.call(T,`, `)+` }`:``)}if(ce(t)){var D=k?v.call(String(t),/^(Symbol\(.*\))_[^)]*$/,`$1`):O.call(t);return typeof t==`object`&&!k?K(D):D}if(G(t)){for(var P=`<`+b.call(String(t.nodeName)),te=t.attributes||[],z=0;z<te.length;z++)P+=` `+te[z].name+`=`+L(R(te[z].value),`double`,s);return P+=`>`,t.childNodes&&t.childNodes.length&&(P+=`...`),P+=`</`+b.call(String(t.nodeName))+`>`,P}if(ne(t)){if(t.length===0)return`[]`;var ue=Ce(t,y);return g&&!be(ue)?`[`+Se(ue,g)+`]`:`[ `+C.call(ue,`, `)+` ]`}if(ie(t)){var _e=Ce(t,y);return!(`cause`in Error.prototype)&&`cause`in t&&!j.call(t,`cause`)?`{ [`+String(t)+`] `+C.call(S.call(`[cause]: `+y(t.cause),_e),`, `)+` }`:_e.length===0?`[`+String(t)+`]`:`{ [`+String(t)+`] `+C.call(_e,`, `)+` }`}if(typeof t==`object`&&u){if(F&&typeof t[F]==`function`&&N)return N(t,{depth:h-r});if(u!==`symbol`&&typeof t.inspect==`function`)return t.inspect()}if(pe(t)){var we=[];return a&&a.call(t,function(e,n){we.push(y(n,t,!0)+` => `+y(e,t))}),ye(`Map`,i.call(t),we,g)}if(W(t)){var Te=[];return l&&l.call(t,function(e){Te.push(y(e,t))}),ye(`Set`,c.call(t),Te,g)}if(U(t))return ve(`WeakMap`);if(he(t))return ve(`WeakSet`);if(me(t))return ve(`WeakRef`);if(oe(t))return K(y(Number(t)));if(le(t))return K(y(E.call(t)));if(se(t))return K(p.call(t));if(ae(t))return K(y(String(t)));if(typeof window<`u`&&t===window)return`{ [object Window] }`;if(typeof globalThis<`u`&&t===globalThis||typeof global<`u`&&t===global)return`{ [object globalThis] }`;if(!re(t)&&!B(t)){var Ee=Ce(t,y),De=M?M(t)===Object.prototype:t instanceof Object||t.constructor===Object,q=t instanceof Object?``:`null prototype`,Oe=!De&&A&&Object(t)===t&&A in t?_.call(V(t),8,-1):q?`Object`:``,ke=(De||typeof t.constructor!=`function`?``:t.constructor.name?t.constructor.name+` `:``)+(Oe||q?`[`+C.call(S.call([],Oe||[],q||[]),`: `)+`] `:``);return Ee.length===0?ke+`{}`:g?ke+`{`+Se(Ee,g)+`}`:ke+`{ `+C.call(Ee,`, `)+` }`}return String(t)};function L(e,t,n){var r=I[n.quoteStyle||t];return r+e+r}function R(e){return v.call(String(e),/"/g,`&quot;`)}function z(e){return!A||!(typeof e==`object`&&(A in e||e[A]!==void 0))}function ne(e){return V(e)===`[object Array]`&&z(e)}function re(e){return V(e)===`[object Date]`&&z(e)}function B(e){return V(e)===`[object RegExp]`&&z(e)}function ie(e){return V(e)===`[object Error]`&&z(e)}function ae(e){return V(e)===`[object String]`&&z(e)}function oe(e){return V(e)===`[object Number]`&&z(e)}function se(e){return V(e)===`[object Boolean]`&&z(e)}function ce(e){if(k)return e&&typeof e==`object`&&e instanceof Symbol;if(typeof e==`symbol`)return!0;if(!e||typeof e!=`object`||!O)return!1;try{return O.call(e),!0}catch{}return!1}function le(e){if(!e||typeof e!=`object`||!E)return!1;try{return E.call(e),!0}catch{}return!1}var ue=Object.prototype.hasOwnProperty||function(e){return e in this};function de(e,t){return ue.call(e,t)}function V(e){return m.call(e)}function H(e){if(e.name)return e.name;var t=g.call(h.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function fe(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function pe(e){if(!i||!e||typeof e!=`object`)return!1;try{i.call(e);try{c.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function U(e){if(!u||!e||typeof e!=`object`)return!1;try{u.call(e,u);try{d.call(e,d)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function me(e){if(!f||!e||typeof e!=`object`)return!1;try{return f.call(e),!0}catch{}return!1}function W(e){if(!c||!e||typeof e!=`object`)return!1;try{c.call(e);try{i.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function he(e){if(!d||!e||typeof e!=`object`)return!1;try{d.call(e,d);try{u.call(e,u)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function G(e){return!e||typeof e!=`object`?!1:typeof HTMLElement<`u`&&e instanceof HTMLElement||typeof e.nodeName==`string`&&typeof e.getAttribute==`function`}function ge(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r=`... `+n+` more character`+(n>1?`s`:``);return ge(_.call(e,0,t.maxStringLength),t)+r}var i=te[t.quoteStyle||`single`];return i.lastIndex=0,L(v.call(v.call(e,i,`\\$1`),/[\x00-\x1f]/g,_e),`single`,t)}function _e(e){var t=e.charCodeAt(0),n={8:`b`,9:`t`,10:`n`,12:`f`,13:`r`}[t];return n?`\\`+n:`\\x`+(t<16?`0`:``)+y.call(t.toString(16))}function K(e){return`Object(`+e+`)`}function ve(e){return e+` { ? }`}function ye(e,t,n,r){var i=r?Se(n,r):C.call(n,`, `);return e+` (`+t+`) {`+i+`}`}function be(e){for(var t=0;t<e.length;t++)if(fe(e[t],`
3`)>=0)return!1;return!0}function xe(e,t){var n;if(e.indent===`	`)n=`	`;else if(typeof e.indent==`number`&&e.indent>0)n=C.call(Array(e.indent+1),` `);else return null;return{base:n,prev:C.call(Array(t+1),n)}}function Se(e,t){if(e.length===0)return``;var n=`
4`+t.prev+t.base;return n+C.call(e,`,`+n)+`
5`+t.prev}function Ce(e,t){var n=ne(e),r=[];if(n){r.length=e.length;for(var i=0;i<e.length;i++)r[i]=de(e,i)?t(e[i],e):``}var a=typeof D==`function`?D(e):[],o;if(k){o={};for(var s=0;s<a.length;s++)o[`$`+a[s]]=a[s]}for(var c in e)de(e,c)&&(n&&String(Number(c))===c&&c<e.length||k&&o[`$`+c]instanceof Symbol||(x.call(/[^\w$]/,c)?r.push(t(c,e)+`: `+t(e[c],e)):r.push(c+`: `+t(e[c],e))));if(typeof D==`function`)for(var l=0;l<a.length;l++)j.call(e,a[l])&&r.push(`[`+t(a[l])+`]: `+t(e[a[l]],e));return r}})),na=N(((e,t)=>{var n=ta(),r=$i(),i=function(e,t,n){for(var r=e,i;
5(i=r.next)!=null;r=i)if(i.key===t)return r.next=i.next,n||(i.next=e.next,e.next=i),i},a=function(e,t){if(e){var n=i(e,t);return n&&n.value}},o=function(e,t,n){var r=i(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},s=function(e,t){return e?!!i(e,t):!1},c=function(e,t){if(e)return i(e,t,!0)};t.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new r(`Side channel does not contain `+n(e))},delete:function(t){var n=c(e,t);return n&&e&&!e.next&&(e=void 0),!!n},get:function(t){return a(e,t)},has:function(t){return s(e,t)},set:function(t,n){e||={next:void 0},o(e,t,n)}};return t}})),ra=N(((e,t)=>{t.exports=Object})),ia=N(((e,t)=>{t.exports=Error})),aa=N(((e,t)=>{t.exports=EvalError})),oa=N(((e,t)=>{t.exports=RangeError})),sa=N(((e,t)=>{t.exports=ReferenceError})),ca=N(((e,t)=>{t.exports=SyntaxError})),la=N(((e,t)=>{t.exports=URIError})),ua=N(((e,t)=>{t.exports=Math.abs})),da=N(((e,t)=>{t.exports=Math.floor})),fa=N(((e,t)=>{t.exports=Math.max})),pa=N(((e,t)=>{t.exports=Math.min})),ma=N(((e,t)=>{t.exports=Math.pow})),ha=N(((e,t)=>{t.exports=Math.round})),ga=N(((e,t)=>{t.exports=Number.isNaN||function(e){return e!==e}})),_a=N(((e,t)=>{var n=ga();t.exports=function(e){return n(e)||e===0?e:e<0?-1:1}})),va=N(((e,t)=>{t.exports=Object.getOwnPropertyDescriptor})),ya=N(((e,t)=>{var n=va();if(n)try{n([],`length`)}catch{n=null}t.exports=n})),ba=N(((e,t)=>{var n=Object.defineProperty||!1;if(n)try{n({},`a`,{value:1})}catch{n=!1}t.exports=n})),xa=N(((e,t)=>{t.exports=function(){if(typeof Symbol!=`function`||typeof Object.getOwnPropertySymbols!=`function`)return!1;if(typeof Symbol.iterator==`symbol`)return!0;var e={},t=Symbol(`test`),n=Object(t);if(typeof t==`string`||Object.prototype.toString.call(t)!==`[object Symbol]`||Object.prototype.toString.call(n)!==`[object Symbol]`)return!1;var r=42;for(var i in e[t]=r,e)return!1;if(typeof Object.keys==`function`&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames==`function`&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor==`function`){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==r||o.enumerable!==!0)return!1}return!0}})),Sa=N(((e,t)=>{var n=typeof Symbol<`u`&&Symbol,r=xa();t.exports=function(){return typeof n!=`function`||typeof Symbol!=`function`||typeof n(`foo`)!=`symbol`||typeof Symbol(`bar`)!=`symbol`?!1:r()}})),Ca=N(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect.getPrototypeOf||null})),wa=N(((e,t)=>{t.exports=ra().getPrototypeOf||null})),Ta=N(((e,t)=>{var n=Object.prototype.toString,r=Math.max,i=`[object Function]`,a=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},o=function(e,t){for(var n=[],r=t||0,i=0;r<e.length;r+=1,i+=1)n[i]=e[r];return n},s=function(e,t){for(var n=``,r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n};t.exports=function(e){var t=this;if(typeof t!=`function`||n.apply(t)!==i)throw TypeError(`Function.prototype.bind called on incompatible `+t);for(var c=o(arguments,1),l,u=function(){if(this instanceof l){var n=t.apply(this,a(c,arguments));return Object(n)===n?n:this}return t.apply(e,a(c,arguments))},d=r(0,t.length-c.length),f=[],p=0;p<d;p++)f[p]=`$`+p;if(l=Function(`binder`,`return function (`+s(f,`,`)+`){ return binder.apply(this,arguments); }`)(u),t.prototype){var m=function(){};m.prototype=t.prototype,l.prototype=new m,m.prototype=null}return l}})),Ea=N(((e,t)=>{var n=Ta();t.exports=Function.prototype.bind||n})),Da=N(((e,t)=>{t.exports=Function.prototype.call})),Oa=N(((e,t)=>{t.exports=Function.prototype.apply})),ka=N(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect&&Reflect.apply})),Aa=N(((e,t)=>{var n=Ea(),r=Oa(),i=Da();t.exports=ka()||n.call(i,r)})),ja=N(((e,t)=>{var n=Ea(),r=$i(),i=Da(),a=Aa();t.exports=function(e){if(e.length<1||typeof e[0]!=`function`)throw new r(`a function is required`);return a(n,i,e)}}
5)),Ma=N(((e,t)=>{var n=ja(),r=ya(),i;try{i=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!=`object`||!(`code`in e)||e.code!==`ERR_PROTO_ACCESS`)throw e}var a=!!i&&r&&r(Object.prototype,`__proto__`),o=Object,s=o.getPrototypeOf;t.exports=a&&typeof a.get==`function`?n([a.get]):typeof s==`function`&&function(e){return s(e==null?e:o(e))}})),Na=N(((e,t)=>{var n=Ca(),r=wa(),i=Ma();t.exports=n?function(e){return n(e)}:r?function(e){if(!e||typeof e!=`object`&&typeof e!=`function`)throw TypeError(`getProto: not an object`);return r(e)}:i?function(e){return i(e)}:null})),Pa=N(((e,t)=>{var n=Function.prototype.call,r=Object.prototype.hasOwnProperty;t.exports=Ea().call(n,r)})),Fa=N(((e,t)=>{var n,r=ra(),i=ia(),a=aa(),o=oa(),s=sa(),c=ca(),l=$i(),u=la(),d=ua(),f=da(),p=fa(),m=pa(),h=ma(),g=ha(),_=_a(),v=Function,y=function(e){try{return v(`"use strict"; return (`+e+`).constructor;`)()}catch{}},b=ya(),x=ba(),S=function(){throw new l},C=b?function(){try{return arguments.callee,S}catch{try{return b(arguments,`callee`).get}catch{return S}}}():S,w=Sa()(),T=Na(),E=wa(),D=Ca(),O=Oa(),k=Da(),A={},j=typeof Uint8Array>`u`||!T?n:T(Uint8Array),M={__proto__:null,"%AggregateError%":typeof AggregateError>`u`?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>`u`?n:ArrayBuffer,"%ArrayIteratorPrototype%":w&&T?T([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":A,"%AsyncGenerator%":A,"%AsyncGeneratorFunction%":A,"%AsyncIteratorPrototype%":A,"%Atomics%":typeof Atomics>`u`?n:Atomics,"%BigInt%":typeof BigInt>`u`?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>`u`?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>`u`?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>`u`?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>`u`?n:Float16Array,"%Float32Array%":typeof Float32Array>`u`?n:Float32Array,"%Float64Array%":typeof Float64Array>`u`?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>`u`?n:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":A,"%Int8Array%":typeof Int8Array>`u`?n:Int8Array,"%Int16Array%":typeof Int16Array>`u`?n:Int16Array,"%Int32Array%":typeof Int32Array>
vendor: 4,882 bytes, line 5
5`u`?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&T?T(T([][Symbol.iterator]())):n,"%JSON%":typeof JSON==`object`?JSON:n,"%Map%":typeof Map>`u`?n:Map,"%MapIteratorPrototype%":typeof Map>`u`||!w||!T?n:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>`u`?n:Promise,"%Proxy%":typeof Proxy>`u`?n:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>`u`?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>`u`?n:Set,"%SetIteratorPrototype%":typeof Set>`u`||!w||!T?n:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>`u`?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&T?T(``[Symbol.iterator]()):n,"%Symbol%":w?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":C,"%TypedArray%":j,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>`u`?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>`u`?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>`u`?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>`u`?n:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>`u`?n:WeakMap,"%WeakRef%":typeof WeakRef>`u`?n:WeakRef,"%WeakSet%":typeof WeakSet>`u`?n:WeakSet,"%Function.prototype.call%":k,"%Function.prototype.apply%":O,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":E,"%Math.abs%":d,"%Math.floor%":f,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":h,"%Math.round%":g,"%Math.sign%":_,"%Reflect.getPrototypeOf%":D};if(T)try{null.error}catch(e){M[`%Error.prototype%`]=T(T(e))}var ee=function e(t){var n;if(t===`%AsyncFunction%`)n=y(`async function () {}`);else if(t===`%GeneratorFunction%`)n=y(`function* () {}`);else if(t===`%AsyncGeneratorFunction%`)n=y(`async function* () {}`);else if(t===`%AsyncGenerator%`){var r=e(`%AsyncGeneratorFunction%`);r&&(n=r.prototype)}else if(t===`%AsyncIteratorPrototype%`){var i=e(`%AsyncGenerator%`);i&&T&&(n=T(i.prototype))}return M[t]=n,n},N={__proto__:null,"%ArrayBufferPrototype%":[`ArrayBuffer`,`prototype`],"%ArrayPrototype%":[`Array`,`prototype`],"%ArrayProto_entries%":[`Array`,`prototype`,`entries`],"%ArrayProto_forEach%":[`Array`,`prototype`,`forEach`],"%ArrayProto_keys%":[`Array`,`prototype`,`keys`],"%ArrayProto_values%":[`Array`,`prototype`,`values`],"%AsyncFunctionPrototype%":[`AsyncFunction`,`prototype`],"%AsyncGenerator%":[`AsyncGeneratorFunction`,`prototype`],"%AsyncGeneratorPrototype%":[`AsyncGeneratorFunction`,`prototype`,`prototype`],"%BooleanPrototype%":[`Boolean`,`prototype`],"%DataViewPrototype%":[`DataView`,`prototype`],"%DatePrototype%":[`Date`,`prototype`],"%ErrorPrototype%":[`Error`,`prototype`],"%EvalErrorPrototype%":[`EvalError`,`prototype`],"%Float32ArrayPrototype%":[`Float32Array`,`prototype`],"%Float64ArrayPrototype%":[`Float64Array`,`prototype`],"%FunctionPrototype%":[`Function`,`prototype`],"%Generator%":[`GeneratorFunction`,`prototype`],"%GeneratorPrototype%":[`GeneratorFunction`,`prototype`,`prototype`],"%Int8ArrayPrototype%":[`Int8Array`,`prototype`],"%Int16ArrayPrototype%":[`Int16Array`,`prototype`],"%Int32ArrayPrototype%":[`Int32Array`,`prototype`],"%JSONParse%":[`JSON`,`parse`],"%JSONStringify%":[`JSON`,`stringify`],"%MapPrototype%":[`Map`,`prototype`],"%NumberPrototype%":[`Number`,`prototype`],"%ObjectPrototype%":[`Object`,`prototype`],"%ObjProto_toString%":[`Object`,`prototype`,`toString`],"%ObjProto_valueOf%":[`Object`,`prototype`,`valueOf`],"%PromisePrototype%":[`Promise`,`prototype`],"%PromiseProto_then%":[`Promise`,`prototype`,`then`],"%Promise_all%":[`Promise`,`all`],"%Promise_reject%":[`Promise`,`reject`],"%Promise_resolve%":[`Promise`,`resolve`],"%RangeErrorPrototype%":[`RangeError`,`prototype`],"%ReferenceErrorPrototype%":[`ReferenceError`,`prototype`],"%RegExpPrototype%":[`RegExp`,`prototype`],"%SetPrototype%":[`Set`,`prototype`],"%SharedArrayBufferPrototype%":[`SharedArrayBuffer`,`prototype`],"%StringPrototype%":[`String`,`prototype`],"%SymbolPrototype%":[`Symbol`,`prototype`],"%SyntaxErrorPrototype%":[`SyntaxError`,`prototype`],"%TypedArrayPrototype%":[`TypedArray`,`prototype`],"%TypeErrorPrototype%":[`TypeError`,`prototype`],"%Uint8ArrayPrototype%":[`Uint8Array`,`prototype`],"%Uint8ClampedArrayPrototype%":[`Uint8ClampedArray`,`prototype`],"%Uint16ArrayPrototype%":[`Uint16Array`,`prototype`],"%Uint32ArrayPrototype%":[`Uint32Array`,`prototype`],"%URIErrorPrototype%":[`URIError`,`prototype`],"%WeakMapPrototype%":[`WeakMap`,`prototype`],"%WeakSetPrototype%":[`WeakSet`,`prototype`]},P=Ea(),F=Pa(),I=P.call(k,Array.prototype.concat),te=P.call(O,Array.prototype.splice),L=P.call(k,String.prototype.replace),R=P.call(k,String.prototype.slice),z=P.call(k,RegExp.prototype.exec),ne=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,re=/\\(\\)?/g,B=function(e){var t=R(e,0,1),n=R(e,
5-1);if(t===`%`&&n!==`%`)throw new c("invalid intrinsic syntax, expected closing `%`");if(n===`%`&&t!==`%`)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return L(e,ne,function(e,t,n,i){r[r.length]=n?L(i,re,`$1`):t||e}),r},ie=function(e,t){var n=e,r;if(F(N,n)&&(r=N[n],n=`%`+r[0]+`%`),F(M,n)){var i=M[n];if(i===A&&(i=ee(n)),i===void 0&&!t)throw new l(`intrinsic `+e+` exists, but is not available. Please file an issue!`);return{alias:r,name:n,value:i}}throw new c(`intrinsic `+e+` does not exist!`)};t.exports=function(e,t){if(typeof e!=`string`||e.length===0)throw new l(`intrinsic name must be a non-empty string`);if(arguments.length>1&&typeof t!=`boolean`)throw new l(`"allowMissing" argument must be a boolean`);if(z(/^%?[^%]*%?$/,e)===null)throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=B(e),r=n.length>0?n[0]:``,i=ie(`%`+r+`%`,t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(r=u[0],te(n,I([0,1],u)));for(var d=1,f=!0;d<n.length;d+=1){var p=n[d],m=R(p,0,1),h=R(p,-1);if((m===`"`||m===`'`||m==="`"||h===`"`||h===`'`||h==="`")&&m!==h)throw new c(`property names with quotes must have matching quotes`);if((p===`constructor`||!f)&&(s=!0),r+=`.`+p,a=`%`+r+`%`,F(M,a))o=M[a];else if(o!=null){if(!(p in o)){if(!t)throw new l(`base intrinsic for `+e+` exists, but the property is not available.`);return}if(b&&d+1>=n.length){var g=b(o,p);f=!!g,o=f&&`get`in g&&!(`originalValue`in g.get)?g.get:o[p]}else f=F(o,p),o=o[p];f&&!s&&(M[a]=o)}}return o}})),Ia=N(((e,t)=>{var n=Fa(),r=ja(),i=r([n(`%String.prototype.indexOf%`)]);t.exports=function(e,t){var a=n(e,!!t);return typeof a==`function`&&i(e,`.prototype.`)>-1?r([a]):a}})),La=N(((e,t)=>{var n=Fa(),r=Ia(),i=ta(),a=$i(),o=n(`%Map%`,!0),s=r(`Map.prototype.get`,!0),c=r(`Map.prototype.set`,!0),l=r(`Map.prototype.has`,!0),u=r(`Map.prototype.delete`,!0),d=r(`Map.prototype.size`,!0);t.exports=!!o&&function(){var e,t={assert:function(e){if(!t.has(e))throw new a(`Side channel does not contain `+i(e))},delete:function(t){if(e){var n=u(e,t);return d(e)===0&&(e=void 0),n}return!1},get:function(t){if(e)return s(e,t)},has:function(t){return e?l(e,t):!1},set:function(t,n){e||=new o,c(e,t,n)}};return t}})),Ra=N(((e,t)=>{var n=Fa(),r=Ia(),i=ta(),a=La(),o=$i(),s=n(`%WeakMap%`,!0),c=r(`WeakMap.prototype.get`,!0),l=r(`WeakMap.prototype.set`,!0),u=r(`WeakMap.prototype.has`,!0),d=r(`WeakMap.prototype.delete`,!0);t.exports=s?function(){var e,t,n={assert:function(e){if(!n.has(e))throw new o(`Side channel does not contain `+i(e))},delete:function(n){if(s&&n&&(typeof n==`object`||typeof n==`function`)){if(e)return d(e,n)}else if(a&&t)return t.delete(n);return!1},get:function(n){return s&&n&&(typeof n==`object`||typeof n==`function`)&&e?c(e,n):t&&t.get(n)},has:function(n){return s&&n&&(typeof n==`object`||typeof n==`function`)&&e?u(e,n):!!t&&t.has(n)},set:function(n,r){s&&n&&(typeof n==`object`||typeof n==`function`)?(e||=new s,l(e,n,r)):a&&(t||=a(),t.set(n,r))}};return n}:a})),za=N(((e,t)=>{var n=$i(),r=ta(),i=na(),a=La(),o=Ra()||a||i;t.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new n(`Side channel does not contain `+(e&&Object(e)===e?`the given object key`:r(e)))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,n){e||=o(),e.set(t,n)}};return t}})),Ba=N(((e,t)=>{var n=String.prototype.replace,r=/%20/g,i={RFC1738:`RFC1738`,RFC3986:`RFC3986`};t.exports={default:i.RFC3986,formatters:{RFC1738:function(e){return n.call(e,r,`+`)},RFC3986:function(e){return String(e)}},RFC1738:i.RFC1738,RFC3986:i.RFC3986}})),Va=N(((e,t)=>{var n=Ba(),r=za(),i=ba(),a=Object.prototype.hasOwnProperty,o=Array.isArray,s=r(),c=function(e,t){return s.set(e,t),e},l=function(e){return s.has(e)},u=function(e){return s.get(e)},d=function(e,t){s.set(e,t)},f=function(){for(var e=[],t=0;t<256;++t)e[e.length]=`%`+((t<16?`0`:``)+t.toString(16)).toUpperCase();return e}(),p=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(o(n)){for(var r=[],i=0;i<n.length;++i)n[i]!==void 0&&(r[r.length]=n[i]);t.obj[t.prop]=r}}},m=function(e,t){for(var n=t&&t.plainObjects?{__proto__:null}:{},r=0;r<e.length;++r)e[r]!==void 0&&(n[r]=e[r]);return n},h=function(e,t,n){t===`__proto__`&&i?i(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},g=function e(t,n,r){if(!n)return t;if(typeof n!=`object`&&typeof n!=`function`){if(o(t)){var i=t.length;if(r&&typeof r.arrayLimit==`number`&&i>=r.arrayLimit){if(r.throwOnLimitExceeded)throw RangeError(`Array limit exceeded. Only `+r.arrayLimit+` element`+(r.arrayLimit===1?``:`s`)+` allowed in an array.`);return c(m(t.concat(n),r),i)}t[i]=n}else if(t&&typeof t==`object`){if(l(t)){var s=u(t)+1;t[s]=n,d(t,s)}else if(r&&r.strictMerge)return[t,n];else(r&&(r.plainObjects||r.allowPrototypes)||!a.call(Object.prototype,n))&&(t[n]=!0)}else return[t,n];return t}if(!t||typeof t!=`object`){if(l(n)){for(var f=Object.keys(n),p=r&&r.plainObjects?{__proto__:null,0:t}:{0:t},g=0;g<f.length;g++){var _=parseInt(f[g],10);p[_+1]=n[f[g]]}return c(p,u(n)+1)}var v=[t].concat(n);if(r&&typeof r.arrayLimit==`number`&&v.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw RangeError(`Array limit exceeded. Only `+r.arrayLimit+` element`+(r.arrayLimit===1?``:`s`)+` allowed in an array.`);return c(m(v,r),v.length-1)}return v}var y=t;if(o(t)&&!o(n)&&(y=m(t,r)),o(t)&&o(n)){if(n.forEach(function(n,i){if
5(a.call(t,i)){var o=t[i];o&&typeof o==`object`&&n&&typeof n==`object`?t[i]=e(o,n,r):t[t.length]=n}else t[i]=n}),r&&typeof r.arrayLimit==`number`&&t.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw RangeError(`Array limit exceeded. Only `+r.arrayLimit+` element`+(r.arrayLimit===1?``:`s`)+` allowed in an array.`);return c(m(t,r),t.length-1)}return t}return Object.keys(n).reduce(function(t,i){var o=n[i];if(a.call(t,i)?h(t,i,e(t[i],o,r)):h(t,i,o),l(n)&&!l(t)&&c(t,u(n)),l(t)){var s=parseInt(i,10);String(s)===i&&s>=0&&s>u(t)&&d(t,s)}return t},y)},_=function(e,t){return Object.keys(t).reduce(function(e,n){return h(e,n,t[n]),e},e)},v=function(e,t,n){var r=e.replace(/\+/g,` `);if(n===`iso-8859-1`)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},y=1024;t.exports={arrayToObject:m,assign:_,combine:function(e,t,n,r,i){if(l(e)){if(i)throw RangeError(`Array limit exceeded. Only `+n+` element`+(n===1?``:`s`)+` allowed in an array.`);var a=u(e)+1;return e[a]=t,d(e,a),e}var o=[].concat(e,t);if(o.length>n){if(i)throw RangeError(`Array limit exceeded. Only `+n+` element`+(n===1?``:`s`)+` allowed in an array.`);return c(m(o,{plainObjects:r}),o.length-1)}return o},compact:function(e){for(var t=[{obj:{o:e},prop:`o`}],n=r(),i=0;i<t.length;++i)for(var a=t[i],o=a.obj[a.prop],s=Object.keys(o),c=0;c<s.length;++c){var l=s[c],u=o[l];typeof u==`object`&&u&&!n.has(u)&&(t[t.length]={obj:o,prop:l},n.set(u,!0))}return p(t),e},decode:v,encode:function(e,t,r,i,a){if(e.length===0)return e;var o=e;if(typeof e==`symbol`?o=Symbol.prototype.toString.call(e):typeof e!=`string`&&(o=String(e)),r===`iso-8859-1`)return escape(o).replace(/%u[0-9a-f]{4}/gi,function(e){return`%26%23`+parseInt(e.slice(2),16)+`%3B`});for(var s=``,c=0;c<o.length;c+=y){var l=o.length>=y?o.slice(c,c+y):o;if(c+y<o.length){var u=l.charCodeAt(l.length-1);u>=55296&&u<=56319&&(l=l.slice(0,-1),--c)}for(var d=[],p=0;p<l.length;++p){var m=l.charCodeAt(p);if(m===45||m===46||m===95||m===126||m>=48&&m<=57||m>=65&&m<=90||m>=97&&m<=122||a===n.RFC1738&&(m===40||m===41)){d[d.length]=l.charAt(p);continue}if(m<128){d[d.length]=f[m];continue}if(m<2048){d[d.length]=f[192|m>>6]+f[128|m&63];continue}if(m<55296||m>=57344){d[d.length]=f[224|m>>12]+f[128|m>>6&63]+f[128|m&63];continue}p+=1,m=65536+((m&1023)<<10|l.charCodeAt(p)&1023),d[d.length]=f[240|m>>18]+f[128|m>>12&63]+f[128|m>>6&63]+f[128|m&63]}s+=d.join(``)}return s},isBuffer:function(e){return!e||typeof e!=`object`?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isOverflow:l,isRegExp:function(e){return Object.prototype.toString.call(e)===`[object RegExp]`},markOverflow:c,maybeMap:function(e,t){if(o(e)){for(var n=[],r=0;r<e.length;r+=1)n[n.length]=t(e[r]);return n}return t(e)},merge:g}})),Ha=N(((e,t)=>{var n=za(),r=Va(),i=Ba(),a=Object.prototype.hasOwnProperty,o={brackets:function(e){return e+`[]`},comma:`comma`,indices:function(e,t){return e+`[`+t+`]`},repeat:function(e){return e}},s=Array.isArray,c=Array.prototype.push,l=function(e,t){c.apply(e,s(t)?t:[t])},u=Date.prototype.toISOString,d=i.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:`indices`,charset:`utf-8`,charsetSentinel:!1,commaRoundTrip:!1,delimiter:`&`,encode:!0,encodeDotInKeys:!1,encoder:r.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:i.formatters[d],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},p=function(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`symbol`||typeof e==`bigint`},m={},h=function e(t,i,a,o,c,u,d,h,g,_,v,y,b,x,S,C,w,T){for(var E=t,D=T,O=0,k=!1;(D=D.get(m))!==void 0&&!k;){var A=D.get(t);if(O+=1,A!==void 0){if(A===O)throw RangeError(`Cyclic object value`);k=!0}D.get(m)===void 0&&(O=0)}if(typeof _==`function`?E=_(i,E):E instanceof Date?E=b(E):a===`comma`&&s(E)&&(E=r.maybeMap(E,function(e){return e instanceof Date?b(e):e})),E===null){if(u)return S(g&&!C?g(i,f.encoder,w,`key`,x):i);E=``}if(p(E)||r.isBuffer(E))return g?[S(C?i:g(i,f.encoder,w,`key`,x))+`=`+S(g(E,f.encoder,w,`value`,x))]:[S(i)+`=`+S(String(E))];var j=[];if(E===void 0)return j;var M;if(a===`comma`&&s(E))C&&g&&(E=r.maybeMap(E,function(e){return e==null?e:g(e)})),M=[{value:E.length>0?E.join(`,`)||null:void 0}];else if(s(_))M=_;else{var ee=Object.keys(E);M=v?ee.sort(v):ee}var N=h?String(i).replace(/\./g,`%2E`):String(i),P=o&&s(E)&&E.length===1?N+`[]`:N;if(c&&s(E)&&E.length===0)return P+`[]`;for(var F=0;F<M.length;++F){var I=M[F],te=typeof I==`object`&&I&&I.value!==void 0?I.value:E[I];if(!(d&&te===null)){var L=y&&h?String(I).replace(/\./g,`%2E`):String(I),R=s(E)?typeof a==`function`?a(P,L):P:P+(y?`.`+L:`[`+L+`]`);T.set(t,O);var z=n();z.set(m,T),l(j,e(te,R,a,o,c,u,d,h,a===`comma`&&C&&s(E)?null:g,_,v,y,b,x,S,C,w,z))}}return j},g=function(e){if(!e)return f;if(e.allowEmptyArrays!==void 0&&typeof e.allowEmptyArrays!=`boolean`)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
5if(e.encodeDotInKeys!==void 0&&typeof e.encodeDotInKeys!=`boolean`)throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&e.encoder!==void 0&&typeof e.encoder!=`function`)throw TypeError(`Encoder has to be a function.`);var t=e.charset||f.charset;if(e.charset!==void 0&&e.charset!==`utf-8`&&e.charset!==`iso-8859-1`)throw TypeError(`The charset option must be either utf-8, iso-8859-1, or undefined`);var n=i.default;if(e.format!==void 0){if(!a.call(i.formatters,e.format))throw TypeError(`Unknown format option provided.`);n=e.format}var r=i.formatters[n],c=f.filter;(typeof e.filter==`function`||s(e.filter))&&(c=e.filter);var l=e.arrayFormat in o?e.arrayFormat:`indices`in e?e.indices?`indices`:`repeat`:f.arrayFormat;if(`commaRoundTrip`in e&&typeof e.commaRoundTrip!=`boolean`)throw TypeError("`commaRoundTrip` must be a boolean, or absent");var u=e.allowDots===void 0?e.encodeDotInKeys===!0||f.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix==`boolean`?e.addQueryPrefix:f.addQueryPrefix,allowDots:u,allowEmptyArrays:typeof e.allowEmptyArrays==`boolean`?!!e.allowEmptyArrays:f.allowEmptyArrays,arrayFormat:l,charset:t,charsetSentinel:typeof e.charsetSentinel==`boolean`?e.charsetSentinel:f.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:e.delimiter===void 0?f.delimiter:e.delimiter,encode:typeof e.encode==`boolean`?e.encode:f.encode,encodeDotInKeys:typeof e.encodeDotInKeys==`boolean`?e.encodeDotInKeys:f.encodeDotInKeys,encoder:typeof e.encoder==`function`?e.encoder:f.encoder,encodeValuesOnly:typeof e.encodeValuesOnly==`boolean`?e.encodeValuesOnly:f.encodeValuesOnly,filter:c,format:n,formatter:r,serializeDate:typeof e.serializeDate==`function`?e.serializeDate:f.serializeDate,skipNulls:typeof e.skipNulls==`boolean`?e.skipNulls:f.skipNulls,sort:typeof e.sort==`function`?e.sort:null,strictNullHandling:typeof e.strictNullHandling==`boolean`?e.strictNullHandling:f.strictNullHandling}};t.exports=function(e,t){var r=e,i=g(t),a,c;typeof i.filter==`function`?(c=i.filter,r=c(``,r)):s(i.filter)&&(c=i.filter,a=c);var u=[];if(typeof r!=`object`||!r)return``;var d=o[i.arrayFormat],f=d===`comma`&&i.commaRoundTrip;a||=Object.keys(r),i.sort&&a.sort(i.sort);for(var p=n(),m=0;m<a.length;++m){var _=a[m];if(_!=null){var v=r[_];i.skipNulls&&v===null||l(u,h(v,_,d,f,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,p))}}var y=u.join(i.delimiter),b=i.addQueryPrefix===!0?`?`:``;return i.charsetSentinel&&(i.charset===`iso-8859-1`?b+=`utf8=%26%2310003%3B`+i.delimiter:b+=`utf8=%E2%9C%93`+i.delimiter),y.length>0?b+y:``}})),Ua=N(((e,t)=>{var n=Va(),r=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:`utf-8`,charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:`&`,depth:5,duplicates:`combine`,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},o=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},s=function(e,t,n,r){if(e&&typeof e==`string`&&t.comma&&e.indexOf(`,`)>-1){if(r&&t.throwOnLimitExceeded)for(var i=0,a=e.indexOf(`,`);a>-1;){if(i+=1,i>=t.arrayLimit)throw RangeError(`Array limit exceeded. Only `+t.arrayLimit+` element`+(t.arrayLimit===1?``:`s`)+` allowed in an array.`);a=e.indexOf(`,`,a+1)}return e.split(`,`)}if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw RangeError(`Array limit exceeded. Only `+t.arrayLimit+` element`+(t.arrayLimit===1?``:`s`)+` allowed in an array.`);return e},c=`utf8=%26%2310003%3B`,l=`utf8=%E2%9C%93`,u=function(e,t){var u={__proto__:null},d=t.ignoreQueryPrefix?e.replace(/^\?/,``):e;d=d.replace(/%5B/gi,`[`).replace(/%5D/gi,`]`);var f=t.parameterLimit===1/0?void 0:t.parameterLimit,p=d.split(t.delimiter,t.throwOnLimitExceeded&&f!==void 0?f+1:f);if(t.throwOnLimitExceeded&&f!==void 0&&p.length>f)throw RangeError(`Parameter limit exceeded. Only `+f+` parameter`+(f===1?``:`s`)+` allowed.`);var m=-1,h,g=t.charset;if(t.charsetSentinel)for(h=0;h<p.length;++h)p[h].indexOf(`utf8=`)===0&&(p[h]===l?g=`utf-8`:p[h]===c&&(g=`iso-8859-1`),m=h,h=p.length);for(h=0;h<p.length;++h)if(h!==m){var _=p[h],v=_.indexOf(`]=`),y=v===-1?_.indexOf(`=`):v+1,b,x;if(y===-1?(b=t.decoder(_,a.decoder,g,`key`),x=t.strictNullHandling?null:``):(b=t.decoder(_.slice(0,y),a.decoder,g,`key`),b!==null&&(x=n.maybeMap(s(_.slice(y+1),t,i(u[b])?u[b].length:0,_.indexOf(`[]=`)===-1),function(e){return t.decoder(e,a.decoder,g,`value`)}))),x&&t.interpretNumericEntities&&g===`iso-8859-1`&&(x=o(String(x))),_.indexOf(`[]=`)>-1&&(x=i(x)?[x]:x),t.comma&&i(x)&&x.length>t.arrayLimit&&(x=n.combine([],x,t.arrayLimit,t.plainObjects,t.throwOnLimitExceeded)),b!==null){var S=r.call(u,b);
5S&&(t.duplicates===`combine`||_.indexOf(`[]=`)>-1)?u[b]=n.combine(u[b],x,t.arrayLimit,t.plainObjects,t.throwOnLimitExceeded):(!S||t.duplicates===`last`)&&(u[b]=x)}}return u},d=function(e,t,r,i){var a=0;if(e.length>0&&e[e.length-1]===`[]`){var o=e.slice(0,-1).join(``);a=Array.isArray(t)&&t[o]?t[o].length:0}for(var c=i?t:s(t,r,a),l=e.length-1;l>=0;--l){var u,d=e[l];if(d===`[]`&&r.parseArrays)u=n.isOverflow(c)?c:r.allowEmptyArrays&&(c===``||r.strictNullHandling&&c===null)?[]:n.combine([],c,r.arrayLimit,r.plainObjects,r.throwOnLimitExceeded);else{u=r.plainObjects?{__proto__:null}:{};var f=d.charAt(0)===`[`&&d.charAt(d.length-1)===`]`?d.slice(1,-1):d,p=r.decodeDotInKeys?f.replace(/%2E/g,`.`):f,m=parseInt(p,10),h=!isNaN(m)&&d!==p&&String(m)===p&&m>=0&&r.parseArrays;if(!r.parseArrays&&p===``)u={0:c};else if(h&&m<r.arrayLimit)u=[],u[m]=c;else if(h&&r.throwOnLimitExceeded)throw RangeError(`Array limit exceeded. Only `+r.arrayLimit+` element`+(r.arrayLimit===1?``:`s`)+` allowed in an array.`);else h?(u[m]=c,n.markOverflow(u,m)):p!==`__proto__`&&(u[p]=c)}c=u}return c},f=function(e,t){var n=t.allowDots?e.replace(/\.([^.[]+)/g,`[$1]`):e;if(t.depth<=0)return!t.plainObjects&&r.call(Object.prototype,n)&&!t.allowPrototypes?void 0:[n];var i=[],a=n.indexOf(`[`),o=a>=0?n.slice(0,a):n;if(o){if(!t.plainObjects&&r.call(Object.prototype,o)&&!t.allowPrototypes)return;i[i.length]=o}for(var s=n.length,c=a,l=0;c>=0&&l<t.depth;){for(var u=1,d=c+1,f=-1;d<s&&f<0;){var p=n.charCodeAt(d);p===91?u+=1:p===93&&(--u,u===0&&(f=d)),d+=1}if(f<0)return i[i.length]=`[`+n.slice(c)+`]`,i;var m=n.slice(c,f+1),h=m.slice(1,-1);if(!t.plainObjects&&r.call(Object.prototype,h)&&!t.allowPrototypes)return;i[i.length]=m,l+=1,c=n.indexOf(`[`,f+1)}if(c>=0){if(t.strictDepth===!0)throw RangeError(`Input depth exceeded depth option of `+t.depth+` and strictDepth is true`);i[i.length]=`[`+n.slice(c)+`]`}return i},p=function(e,t,n,r){if(e){var i=f(e,n);if(i)return d(i,t,n,r)}},m=function(e){if(!e)return a;
5if(e.allowEmptyArrays!==void 0&&typeof e.allowEmptyArrays!=`boolean`)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(e.decodeDotInKeys!==void 0&&typeof e.decodeDotInKeys!=`boolean`)throw TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!=`function`)throw TypeError(`Decoder has to be a function.`);if(e.charset!==void 0&&e.charset!==`utf-8`&&e.charset!==`iso-8859-1`)throw TypeError(`The charset option must be either utf-8, iso-8859-1, or undefined`);if(e.throwOnLimitExceeded!==void 0&&typeof e.throwOnLimitExceeded!=`boolean`)throw TypeError("`throwOnLimitExceeded` option must be a boolean");var t=e.charset===void 0?a.charset:e.charset,r=e.duplicates===void 0?a.duplicates:e.duplicates;if(r!==`combine`&&r!==`first`&&r!==`last`)throw TypeError(`The duplicates option must be either combine, first, or last`);return{allowDots:e.allowDots===void 0?e.decodeDotInKeys===!0||a.allowDots:!!e.allowDots,allowEmptyArrays:typeof e.allowEmptyArrays==`boolean`?!!e.allowEmptyArrays:a.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes==`boolean`?e.allowPrototypes:a.allowPrototypes,allowSparse:typeof e.allowSparse==`boolean`?e.allowSparse:a.allowSparse,arrayLimit:typeof e.arrayLimit==`number`?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel==`boolean`?e.charsetSentinel:a.charsetSentinel,comma:typeof e.comma==`boolean`?e.comma:a.comma,decodeDotInKeys:typeof e.decodeDotInKeys==`boolean`?e.decodeDotInKeys:a.decodeDotInKeys,decoder:typeof e.decoder==`function`?e.decoder:a.decoder,delimiter:typeof e.delimiter==`string`||n.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:typeof e.depth==`number`||e.depth===!1?+e.depth:a.depth,duplicates:r,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities==`boolean`?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:typeof e.parameterLimit==`number`?e.parameterLimit:a.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects==`boolean`?e.plainObjects:a.plainObjects,strictDepth:typeof e.strictDepth==`boolean`?!!e.strictDepth:a.strictDepth,strictMerge:typeof e.strictMerge==`boolean`?!!e.strictMerge:a.strictMerge,strictNullHandling:typeof e.strictNullHandling==`boolean`?e.strictNullHandling:a.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded==`boolean`&&e.throwOnLimitExceeded}};t.exports=function(e,t){var r=m(t);if(e===``||e==null)return r.plainObjects?{__proto__:null}:{};for(var i=typeof e==`string`?u(e,r):e,a=r.plainObjects?{__proto__:null}:{},o=Object.keys(i),s=0;s<o.length;++s){var c=o[s],l=p(c,i[c],r,typeof e==`string`);a=n.merge(a,l,r)}return r.allowSparse===!0?a:n.compact(a)}})),Wa=P(N(((e,t)=>{var n=Ha(),r=Ua();t.exports={formats:Ba(),parse:r,stringify:n}}))()),Ga=new class{constructor(e){this.config={},this.defaults=e}extend(e){return e&&(this.defaults={...this.defaults,...e}),this}replace(e){this.config=e}get(e){return wi(this.config,e)?ui(this.config,e):ui(this.defaults,e)}set(e,t){typeof e==`string`?Ei(this.config,e,t):Object.entries(e).forEach(([e,t])=>{Ei(this.config,e,t)})}}({form:{recentlySuccessfulDuration:2e3,forceIndicesArrayFormatInFormData:!0,withAllErrors:!1},future:{preserveEqualProps:!1,useDataInertiaHeadAttribute:!1,useDialogForErrorModal:!1,useScriptElementForInitialPage:!1},prefetch:{cacheFor:3e4,hoverDelay:75}});function Ka(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function qa(e,t){return document.dispatchEvent(new CustomEvent(`inertia:${e}`,t))}var Ja=e=>qa(`before`,{cancelable:!0,detail:{visit:e}}),Ya=e=>qa(`error`,{detail:{errors:e}}),Xa=e=>qa(`exception`,{cancelable:!0,detail:{exception:e}}),Za=e=>qa(`finish`,{detail:{visit:e}}),Qa=e=>qa(`invalid`,{cancelable:!0,detail:{response:e}}),$a=e=>qa(`beforeUpdate`,{detail:{page:e}}),eo=e=>qa(`navigate`,{detail:{page:e}}),to=e=>qa(`progress`,{detail:{progress:e}}),no=e=>qa(`start`,{detail:{visit:e}}),ro=e=>qa(`success`,{detail:{page:e}}),io=(e,t)=>qa(`prefetched`,{detail:{fetchedAt:Date.now(),response:e.data,visit:t}}),ao=e=>qa(`prefetching`,{detail:{visit:e}}),oo=e=>qa(`flash`,{detail:{flash:e}}),so=class{static set(e,t){typeof window<`u`&&window.sessionStorage.setItem(e,JSON.stringify(t))}static get(e){if(typeof window<`u`)return JSON.parse(window.sessionStorage.getItem(e)||`null`)}static merge(e,t){let n=this.get(e);n===null?this.set(e,t):this.set(e,{...n,...t})}static remove(e){typeof window<`u`&&window.sessionStorage.removeItem(e)}static removeNested(e,t){let n=this.get(e);n!==null&&(delete n[t],this.set(e,n))}static exists(e){try{return this.get(e)!==null}catch{return!1}}static clear(){typeof window<`u`&&window.sessionStorage.clear()}};so.locationVisitKey=`inertiaLocationVisit`;var co=async e=>{if(typeof window>`u`)throw Error(`Unable to encrypt history`);let t=mo(),n=await _o(await vo());if(!n)throw Error(`Unable to encrypt history`);return await fo(t,n,e)},lo={key:`historyKey`,iv:`historyIv`},uo=async e=>{let t=mo(),n=await vo();if(!n)throw Error(`Unable to decrypt history`);return await po(t,n,e)},fo=async(e,t,n)=>{if(typeof window>`u`)throw Error(`Unable to encrypt history`);if(window.crypto.subtle===void 0)return console.warn(`Encryption is not supported in this environment. SSL is required.`),Promise.resolve(n);let r=new TextEncoder,i=JSON.stringify(n),a=new Uint8Array(i.length*3),o=r.encodeInto(i,a);return window.crypto.subtle.encrypt({name:`AES-GCM`,iv:e},t,a.subarray(0,o.written))},po=async(e,t,n)=>{if(window.crypto.subtle===void 0)return console.warn(`Decryption is not supported in this environment. SSL is required.`),Promise.resolve(n);
5let r=await window.crypto.subtle.decrypt({name:`AES-GCM`,iv:e},t,n);return JSON.parse(new TextDecoder().decode(r))},mo=()=>{let e=so.get(lo.iv);if(e)return new Uint8Array(e);let t=window.crypto.getRandomValues(new Uint8Array(12));return so.set(lo.iv,Array.from(t)),t},ho=async()=>window.crypto.subtle===void 0?(console.warn(`Encryption is not supported in this environment. SSL is required.`),Promise.resolve(null)):window.crypto.subtle.generateKey({name:`AES-GCM`,length:256},!0,[`encrypt`,`decrypt`]),go=async e=>{if(window.crypto.subtle===void 0)return console.warn(`Encryption is not supported in this environment. SSL is required.`),Promise.resolve();let t=await window.crypto.subtle.exportKey(`raw`,e);so.set(lo.key,Array.from(new Uint8Array(t)))},_o=async e=>{if(e)return e;let t=await ho();return t?(await go(t),t):null},vo=async()=>{let e=so.get(lo.key);return e?await window.crypto.subtle.importKey(`raw`,new Uint8Array(e),{name:`AES-GCM`,length:256},!0,[`encrypt`,`decrypt`]):null},yo=e=>{let t={};for(let n of Object.keys(e))e[n]!==void 0&&(t[n]=e[n]);return t},bo=(e,t,n)=>{if(e===t)return!0;for(let r in e)if(!n.includes(r)&&e[r]!==t[r]&&!xo(e[r],t[r]))return!1;for(let r in t)if(!n.includes(r)&&!(r in e))return!1;return!0},xo=(e,t)=>{switch(typeof e){case`object`:return bo(e,t,[]);case`function`:return e.toString()===t.toString();default:return e===t}},So={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},Co=e=>{if(typeof e==`number`)return e;for(let[t,n]of Object.entries(So))if(e.endsWith(t))return parseFloat(e)*n;return parseInt(e)},wo=new class{constructor(){this.cached=[],this.inFlightRequests=[],this.removalTimers=[],this.currentUseId=null}add(e,t,{cacheFor:n,cacheTags:r}){if(this.findInFlight(e))return Promise.resolve();let i=this.findCached(e);if(!e.fresh&&i&&i.staleTimestamp>Date.now())return Promise.resolve();let[a,o]=this.extractStaleValues(n),s=new Promise((n,r)=>{t({...e,onCancel:()=>{this.remove(e),e.onCancel(),r()},onError:t=>{this.remove(e),e.onError(t),r()},onPrefetching(t){e.onPrefetching(t)},onPrefetched(t,n){e.onPrefetched(t,n)},onPrefetchResponse(e){n(e)},onPrefetchError(t){wo.removeFromInFlight(e),r(t)}})}).then(t=>{this.remove(e);let n=t.getPageResponse();Z.mergeOncePropsIntoResponse(n),this.cached.push({params:{...e},staleTimestamp:Date.now()+a,expiresAt:Date.now()+o,response:s,singleUse:o===0,timestamp:Date.now(),inFlight:!1,tags:Array.isArray(r)?r:[r]});let i=this.getShortestOncePropTtl(n);return this.scheduleForRemoval(e,i?Math.min(o,i):o),this.removeFromInFlight(e),t.handlePrefetch(),t});return this.inFlightRequests.push({params:{...e},response:s,staleTimestamp:null,inFlight:!0}),s}removeAll(){this.cached=[],this.removalTimers.forEach(e=>{clearTimeout(e.timer)}),this.removalTimers=[]}removeByTags(e){this.cached=this.cached.filter(t=>!t.tags.some(t=>e.includes(t)))}remove(e){this.cached=this.cached.filter(t=>!this.paramsAreEqual(t.params,e)),this.clearTimer(e)}removeFromInFlight(e){this.inFlightRequests=this.inFlightRequests.filter(t=>!this.paramsAreEqual(t.params,e))}extractStaleValues(e){let[t,n]=this.cacheForToStaleAndExpires(e);return[Co(t),Co(n)]}cacheForToStaleAndExpires(e){if(!Array.isArray(e))return[e,e];switch(e.length){case 0:return[0,0];case 1:return[e[0],e[0]];default:return[e[0],e[1]]}}clearTimer(e){let t=this.removalTimers.find(t=>this.paramsAreEqual(t.params,e));t&&(clearTimeout(t.timer),this.removalTimers=this.removalTimers.filter(e=>e!==t))}scheduleForRemoval(e,t){if(!(typeof window>`u`)&&(this.clearTimer(e),t>0)){let n=window.setTimeout(()=>this.remove(e),t);this.removalTimers.push({params:e,timer:n})}}get(e){return this.findCached(e)||this.findInFlight(e)}use(e,t){let n=`${t.url.pathname}-${Date.now()}-${Math.random().toString(36).substring(7)}`;return this.currentUseId=n,e.response.then(e=>{if(this.currentUseId===n)return e.mergeParams({...t,onPrefetched:()=>{}}),this.removeSingleUseItems(t),e.handle()})}removeSingleUseItems(e){this.cached=this.cached.filter(t=>!this.paramsAreEqual(t.params,e)||!t.singleUse)}findCached(e){return this.cached.find(t=>this.paramsAreEqual(t.params,e))||null}findInFlight(e){return this.inFlightRequests.find(t=>this.paramsAreEqual(t.params,e))||null}withoutPurposePrefetchHeader(e){let t=Dt(e);return t.headers.Purpose===`prefetch`&&delete t.headers.Purpose,t}paramsAreEqual(e,t){return bo(this.withoutPurposePrefetchHeader(e),this.withoutPurposePrefetchHeader(t),[`showProgress`,`replace`,`prefetch`,`preserveScroll`,`preserveState`,`onBefore`,`onBeforeUpdate`,`onStart`,`onProgress`,`onFinish`,`onCancel`,`onSuccess`,`onError`,`onFlash`,`onPrefetched`,`onCancelToken`,`onPrefetching`,`async`,`viewTransition`])}
5updateCachedOncePropsFromCurrentPage(){this.cached.forEach(e=>{e.response.then(t=>{let n=t.getPageResponse();Z.mergeOncePropsIntoResponse(n,{force:!0});for(let[e,t]of Object.entries(n.deferredProps??{})){let r=t.filter(e=>n.props[e]===void 0);r.length>0?n.deferredProps[e]=r:delete n.deferredProps[e]}let r=this.getShortestOncePropTtl(n);if(r===null)return;let i=e.expiresAt-Date.now(),a=Math.min(i,r);a>0?this.scheduleForRemoval(e.params,a):this.remove(e.params)})})}getShortestOncePropTtl(e){let t=Object.values(e.onceProps??{}).map(e=>e.expiresAt).filter(e=>!!e);return t.length===0?null:Math.min(...t)-Date.now()}},To=e=>{if(e.offsetParent===null)return!1;let t=e.getBoundingClientRect(),n=t.top<window.innerHeight&&t.bottom>=0,r=t.left<window.innerWidth&&t.right>=0;return n&&r},Eo=e=>{let t=e=>{let t=window.getComputedStyle(e);return[`scroll`,`overlay`].includes(t.overflowY)?!0:t.overflowY===`auto`?[`visible`,`clip`].includes(t.overflowX)?!0:r(t.maxHeight,e.style.height)||i(e,`height`):!1},n=e=>{let t=window.getComputedStyle(e);return[`scroll`,`overlay`].includes(t.overflowX)?!0:t.overflowX===`auto`?[`visible`,`clip`].includes(t.overflowY)?!0:r(t.maxWidth,e.style.width)||i(e,`width`):!1},r=(e,t)=>!!(e&&e!==`none`&&e!==`0px`||t&&t!==`auto`&&t!==`0`),i=(e,t)=>{let n=e.parentElement;if(!n)return!1;let r=window.getComputedStyle(n);if([`flex`,`inline-flex`].includes(r.display)){let e=[`column`,`column-reverse`].includes(r.flexDirection);return t===`height`?e:!e}return[`grid`,`inline-grid`].includes(r.display)},a=e?.parentElement;for(;a;){let e=t(a)||n(a);if(window.getComputedStyle(a).display!==`contents`&&e)return a;a=a.parentElement}return null},Do=(e,t)=>{if(!t)return e.filter(e=>To(e));let n=e.indexOf(t),r=[],i=[];for(let t=n;t>=0;t--){let n=e[t];if(To(n))r.push(n);else break}for(let t=n+1;t<e.length;t++){let n=e[t];if(To(n))i.push(n);else break}return[...r.reverse(),...i]},Oo=(e,t=1)=>{window.requestAnimationFrame(()=>{t>1?Oo(e,t-1):e()})},ko=(e,t=!1)=>{if(typeof window>`u`)return null;if(!t){let t=document.getElementById(e);if(t?.dataset.page)return JSON.parse(t.dataset.page)}let n=document.querySelector(`script[data-page="${e}"][type="application/json"]`);return n?.textContent?JSON.parse(n.textContent):null},Ao=typeof window>`u`,jo=!Ao&&/Firefox/i.test(window.navigator.userAgent),Mo=class{static save(){Q.saveScrollPositions(this.getScrollRegions())}static getScrollRegions(){return Array.from(this.regions()).map(e=>({top:e.scrollTop,left:e.scrollLeft}))}static regions(){return document.querySelectorAll(`[scroll-region]`)}static scrollToTop(){if(jo&&getComputedStyle(document.documentElement).scrollBehavior===`smooth`)return Oo(()=>window.scrollTo(0,0),2);window.scrollTo(0,0)}static reset(){!Ao&&window.location.hash||this.scrollToTop(),this.regions().forEach(e=>{typeof e.scrollTo==`function`?e.scrollTo(0,0):(e.scrollTop=0,e.scrollLeft=0)}),this.save(),this.scrollToAnchor()}static scrollToAnchor(){let e=Ao?null:window.location.hash;e&&setTimeout(()=>{let t=document.getElementById(e.slice(1));t?t.scrollIntoView():this.scrollToTop()})}static restore(e){Ao||window.requestAnimationFrame(()=>{this.restoreDocument(),this.restoreScrollRegions(e)})}static restoreScrollRegions(e){Ao||this.regions().forEach((t,n)=>{let r=e[n];r&&(typeof t.scrollTo==`function`?t.scrollTo(r.left,r.top):(t.scrollTop=r.top,t.scrollLeft=r.left))})}static restoreDocument(){let e=Q.getDocumentScrollPosition();window.scrollTo(e.left,e.top)}static onScroll(e){let t=e.target;typeof t.hasAttribute==`function`&&t.hasAttribute(`scroll-region`)&&this.save()}static onWindowScroll(){Q.saveDocumentScrollPosition({top:window.scrollY,left:window.scrollX})}},No=e=>typeof File<`u`&&e instanceof File||e instanceof Blob||typeof FileList<`u`&&e instanceof FileList&&e.length>0;function Po(e){return No(e)||e instanceof FormData&&Array.from(e.values()).some(e=>Po(e))||typeof e==`object`&&!!e&&Object.values(e).some(e=>Po(e))}var Fo=e=>e instanceof FormData;function Io(e,t=new FormData,n=null,r=`brackets`){e||={};for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&Ro(t,Lo(n,i,`indices`),e[i],r);return t}function Lo(e,t,n){return e?n===`brackets`?`${e}[]`:`${e}[${t}]`:t}function Ro(e,t,n,r){if(Array.isArray(n))return Array.from(n.keys()).forEac
5h(i=>Ro(e,Lo(t,i.toString(),r),n[i],r));if(n instanceof Date)return e.append(t,n.toISOString());if(n instanceof File)return e.append(t,n,n.name);if(n instanceof Blob)return e.append(t,n);if(typeof n==`boolean`)return e.append(t,n?`1`:`0`);if(typeof n==`string`)return e.append(t,n);if(typeof n==`number`)return e.append(t,`${n}`);if(n==null)return e.append(t,``);Io(n,e,t,r)}function zo(e){return new URL(e.toString(),typeof window>`u`?void 0:window.location.toString())}var Bo=(e,t,n,r,i)=>{let a=typeof e==`string`?zo(e):e;if((Po(t)||r)&&!Fo(t)&&(Ga.get(`form.forceIndicesArrayFormatInFormData`)&&(i=`indices`),t=Io(t,new FormData,null,i)),Fo(t))return[a,t];let[o,s]=Vo(n,a,t,i);return[zo(o),s]};function Vo(e,t,n,r=`brackets`){let i=e===`get`&&!Fo(n)&&Object.keys(n).length>0,a=qo(t.toString()),o=a||t.toString().startsWith(`/`)||t.toString()===``,s=!o&&!t.toString().startsWith(`#`)&&!t.toString().startsWith(`?`),c=/^[.]{1,2}([/]|$)/.test(t.toString()),l=t.toString().includes(`?`)||i,u=t.toString().includes(`#`),d=new URL(t.toString(),typeof window>`u`?`http://localhost`:window.location.toString());if(i){let e=/\[\d+\]/.test(decodeURIComponent(d.search));d.search=Wa.stringify({...Wa.parse(d.search,{ignoreQueryPrefix:!0,allowSparse:!0}),...n},{encodeValuesOnly:!0,arrayFormat:e?`indices`:r})}return[[a?`${d.protocol}//${d.host}`:``,o?d.pathname:``,s?d.pathname.substring(+!c):``,l?d.search:``,u?d.hash:``].join(``),i?{}:n]}function Ho(e){return e=new URL(e.href),e.hash=``,e}var Uo=(e,t)=>{e.hash&&!t.hash&&Ho(e).href===t.href&&(t.hash=e.hash)},Wo=(e,t)=>Ho(e).href===Ho(t).href,Go=(e,t)=>e.origin===t.origin&&e.pathname===t.pathname;function Ko(e){return typeof e==`object`&&!!e&&e!==void 0&&`url`in e&&`method`in e}function qo(e){return/^([a-z][a-z0-9+.-]*:)?\/\/[^/]/i.test(e)}function Jo(e,t){let n=typeof e==`string`?zo(e):e;return t?`${n.protocol}//${n.host}${n.pathname}${n.search}${n.hash}`:`${n.pathname}${n.search}${n.hash}`}var Z=new class{constructor(){this.componentId={},this.listeners=[],this.isFirstPageLoad=!0,this.cleared=!1,this.pendingDeferredProps=null,this.historyQuotaExceeded=!1}init({initialPage:e,swapComponent:t,resolveComponent:n,onFlash:r}){return this.page={...e,flash:e.flash??{}},this.swapComponent=t,this.resolveComponent=n,this.onFlashCallback=r,es.on(`historyQuotaExceeded`,()=>{this.historyQuotaExceeded=!0}),this}set(e,{replace:t=!1,preserveScroll:n=!1,preserveState:r=!1,viewTransition:i=!1}={}){Object.keys(e.deferredProps||{}).length&&(this.pendingDeferredProps={deferredProps:e.deferredProps,component:e.component,url:e.url},e.initialDeferredProps===void 0&&(e.initialDeferredProps=e.deferredProps)),this.componentId={};let a=this.componentId;return e.clearHistory&&Q.clear(),this.resolve(e.component).then(o=>{if(a!==this.componentId)return;e.rememberedState??={};let s=typeof window>`u`,c=s?new URL(e.url):window.location,l=!s&&n?Mo.getScrollRegions():[];t||=Wo(zo(e.url),c);let u={...e,flash:{}};return new Promise(e=>t?Q.replaceState(u,e):Q.pushState(u,e)).then(()=>{let a=!this.isTheSame(e);if(!a&&Object.keys(e.props.errors||{}).length>0&&(i=!1),this.page=e,this.cleared=!1,this.hasOnceProps()&&wo.updateCachedOncePropsFromCurrentPage(),a&&this.fireEventsFor(`newComponent`),this.isFirstPageLoad&&this.fireEventsFor(`firstLoad`),this.isFirstPageLoad=!1,this.historyQuotaExceeded){this.historyQuotaExceeded=!1;return}return this.swap({component:o,page:e,preserveState:r,viewTransition:i}).then(()=>{n?window.requestAnimationFrame(()=>Mo.restoreScrollRegions(l)):Mo.reset(),this.pendingDeferredProps&&this.pendingDeferredProps.component===e.component&&this.pendingDeferredProps.url===e.url&&es.fireInternalEvent(`loadDeferredProps`,this.pendingDeferredProps.deferredProps),this.pendingDeferredProps=null,t||eo(e)})})})}setQuietly(e,{preserveState:t=!1}={}){return this.resolve(e.component).then(n=>(this.page=e,this.cleared=!1,Q.setCurrent(e),this.swap({component:n,page:e,preserveState:t,viewTransition:!1})))}clear(){this.cleared=!0}isCleared(){return this.cleared}get(){return this.page}getWithoutFlashData(){return{...this.page,flash:{}}}hasOnceProps(){return Object.keys(this.page.onceProps??{}).length>0}merge(e){this.page={...this.page,...e}}setFlash(e){this.page={...this.page,flash:e},this.onFlashCallback?.(e)}setUrlHash(e){this.page.url.includes(e)||(this.page.url+=e)}remember(e){this.page.rememberedState=e}swap({component:e,page:t,preserveState:n,viewTransition:r}){let i=()=>this.swapComponent({component:e,page:t,preserveState:n});if(!r||!document?.startViewTransition||document.visibilityState===`hidden`)return i();let a=typeof r==`boolean`?()=>null:r;return new Promise(e=>{let t=document.startViewTransition(()=>i().then(e));t.ready.catch(()=>{}),a(t)})}resolve(e){return Promise.resolve(this.resolveComponent(e))}isTheSame(e){return this.page.component===e.component}on(e,t){return this.listeners.push({event:e,callback:t}),()=>{this.listeners=this.listeners.filter(n=>n.event!==e&&n.callback!==t)}}fireEventsFor(e){this.listeners.filter(t=>
5t.event===e).forEach(e=>e.callback())}mergeOncePropsIntoResponse(e,{force:t=!1}={}){Object.entries(e.onceProps??{}).forEach(([n,r])=>{let i=this.page.onceProps?.[n];i!==void 0&&(t||e.props[r.prop]===void 0)&&(e.props[r.prop]=this.page.props[i.prop],e.onceProps[n].expiresAt=i.expiresAt)})}},Yo=class{constructor(){this.items=[],this.processingPromise=null}add(e){return this.items.push(e),this.process()}process(){return this.processingPromise??=this.processNext().finally(()=>{this.processingPromise=null}),this.processingPromise}processNext(){let e=this.items.shift();return e?Promise.resolve(e()).then(()=>this.processNext()):Promise.resolve()}},Xo=typeof window>`u`,Zo=new Yo,Qo=!Xo&&/CriOS/.test(window.navigator.userAgent),$o=class{constructor(){this.rememberedState=`rememberedState`,this.scrollRegions=`scrollRegions`,this.preserveUrl=!1,this.current={},this.initialState=null}remember(e,t){this.replaceState({...Z.getWithoutFlashData(),rememberedState:{...Z.get()?.rememberedState??{},[t]:e}})}restore(e){if(!Xo)return this.current[this.rememberedState]?.[e]===void 0?this.initialState?.[this.rememberedState]?.[e]:this.current[this.rememberedState]?.[e]}pushState(e,t=null){if(!Xo){if(this.preserveUrl){t&&t();return}this.current=e,Zo.add(()=>this.getPageData(e).then(n=>{let r=()=>this.doPushState({page:n},e.url).then(()=>t?.());return Qo?new Promise(e=>{setTimeout(()=>r().then(e))}):r()}))}}clonePageProps(e){try{return structuredClone(e.props),e}catch{return{...e,props:Dt(e.props)}}}getPageData(e){let t=this.clonePageProps(e);return new Promise(n=>e.encryptHistory?co(t).then(n):n(t))}processQueue(){return Zo.process()}decrypt(e=null){if(Xo)return Promise.resolve(e??Z.get());let t=e??window.history.state?.page;return this.decryptPageData(t).then(e=>{if(!e)throw Error(`Unable to decrypt history`);return this.initialState===null?this.initialState=e??void 0:this.current=e??{},e})}decryptPageData(e){return e instanceof ArrayBuffer?uo(e):Promise.resolve(e)}saveScrollPositions(e){Zo.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!wt(this.getScrollRegions(),e))return this.doReplaceState({page:window.history.state.page,scrollRegions:e})}))}saveDocumentScrollPosition(e){Zo.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!wt(this.getDocumentScrollPosition(),e))return this.doReplaceState({page:window.history.state.page,documentScrollPosition:e})}))}getScrollRegions(){return window.history.state?.scrollRegions||[]}getDocumentScrollPosition(){return window.history.state?.documentScrollPosition||{top:0,left:0}}replaceState(e,t=null){if(wt(this.current,e)){t&&t();return}let{flash:n,...r}=e;if(Z.merge(r),!Xo){if(this.preserveUrl){t&&t();return}this.current=e,Zo.add(()=>this.getPageData(e).then(n=>{let r=()=>this.doReplaceState({page:n},e.url).then(()=>t?.());return Qo?new Promise(e=>{setTimeout(()=>r().then(e))}):r()}))}}isHistoryThrottleError(e){return e instanceof Error&&e.name===`SecurityError`&&(e.message.includes(`history.pushState`)||e.message.includes(`history.replaceState`))}isQuotaExceededError(e){return e instanceof Error&&e.name===`QuotaExceededError`}withThrottleProtection(e){return Promise.resolve().then(()=>{try{return e()}catch(e){if(!this.isHistoryThrottleError(e))throw e;console.error(e.message)}})}doReplaceState(e,t){return this.withThrottleProtection(()=>{window.history.replaceState({...e,scrollRegions:e.scrollRegions??window.history.state?.scrollRegions,documentScrollPosition:e.documentScrollPosition??window.history.state?.documentScrollPosition},``,t)})}doPushState(e,t){return this.withThrottleProtection(()=>{try{window.history.pushState(e,``,t)}catch(e){if(!this.isQuotaExceededError(e))throw e;es.fireInternalEvent(`historyQuotaExceeded`,t)}})}getState(e,t){return this.current?.[e]??t}deleteState(e){this.current[e]!==void 0&&(delete this.current[e],this.replaceState(this.current))}clearInitialState(e){this.initialState&&this.initialState[e]!==void 0&&delete this.initialState[e]}browserHasHistoryEntry(){return!Xo&&!!window.history.state?.page}clear(){so.remove(lo.key),so.remove(lo.iv)}setCurrent(e){this.current=e}isValidState(e){return!!e.page}getAllState(){return this.current}};typeof window<`u`&&window.history.scrollRestoration&&(window.history.scrollRestoration=`manual`);var Q=new $o,es=new class{constructor(){this.internalListeners=[]}init(){typeof window<`u`&&(window.addEventListener(`popstate`,this.handlePopstateEvent.bind(this)),window.addEventListener(`pageshow`,this.handlePageshowEvent.bind(this)),window.addEventListener(`scroll`,Ka(Mo.onWindowScroll.bind(Mo),100),!0)),typeof document<`u`&&document.addEventListener(`scroll`,Ka(Mo.onScroll.bind(Mo),100),!0)}onGlobalEvent(e,t){return this.registerListener(`inertia:${e}`,(e=>{let n=t(e);e.cancelable&&!e.defaultPrevented&&n===!1&&e.preventDefault()}))}on(e,t){return this.internalListeners.push({event:e,listener:t}),()=>{this.internalListeners=this.internalListeners.filter(e=>e.listener!==t)}}onMissingHistoryItem(){Z.clear(),this.fireInternalEvent(`missingHistoryItem`)}fireInternalEvent(e,...t){this.internalListeners.filter(t=>
5t.event===e).forEach(e=>e.listener(...t))}registerListener(e,t){return document.addEventListener(e,t),()=>document.removeEventListener(e,t)}handlePageshowEvent(e){e.persisted&&Q.decrypt().catch(()=>this.onMissingHistoryItem())}handlePopstateEvent(e){let t=e.state||null;if(t===null){let e=zo(Z.get().url);e.hash=window.location.hash,Q.replaceState({...Z.getWithoutFlashData(),url:e.href}),Mo.reset();return}if(!Q.isValidState(t))return this.onMissingHistoryItem();Q.decrypt(t.page).then(e=>{if(Z.get().version!==e.version){this.onMissingHistoryItem();return}$.cancelAll({prefetch:!1}),Z.setQuietly(e,{preserveState:!1}).then(()=>{Mo.restore(Q.getScrollRegions()),eo(Z.get());let t={},n=Z.get().props;for(let[r,i]of Object.entries(e.initialDeferredProps??e.deferredProps??{})){let e=i.filter(e=>n[e]===void 0);e.length>0&&(t[r]=e)}Object.keys(t).length>0&&this.fireInternalEvent(`loadDeferredProps`,t)})}).catch(()=>{this.onMissingHistoryItem()})}},ts=new class{constructor(){this.type=this.resolveType()}resolveType(){return typeof window>`u`?`navigate`:window.performance&&window.performance.getEntriesByType&&window.performance.getEntriesByType(`navigation`).length>0?window.performance.getEntriesByType(`navigation`)[0].type:`navigate`}get(){return this.type}isBackForward(){return this.type===`back_forward`}isReload(){return this.type===`reload`}},ns=class{static handle(){this.clearRememberedStateOnReload(),[this.handleBackForward,this.handleLocation,this.handleDefault].find(e=>e.bind(this)())}static clearRememberedStateOnReload(){ts.isReload()&&(Q.deleteState(Q.rememberedState),Q.clearInitialState(Q.rememberedState))}static handleBackForward(){if(!ts.isBackForward()||!Q.browserHasHistoryEntry())return!1;let e=Q.getScrollRegions();return Q.decrypt().then(t=>{Z.set(t,{preserveScroll:!0,preserveState:!0}).then(()=>{Mo.restore(e),eo(Z.get())})}).catch(()=>{es.onMissingHistoryItem()}),!0}static handleLocation(){if(!so.exists(so.locationVisitKey))return!1;let e=so.get(so.locationVisitKey)||{};return so.remove(so.locationVisitKey),typeof window<`u`&&Z.setUrlHash(window.location.hash),Q.decrypt(Z.get()).then(()=>{let t=Q.getState(Q.rememberedState,{}),n=Q.getScrollRegions();Z.remember(t),Z.set(Z.get(),{preserveScroll:e.preserveScroll,preserveState:!0}).then(()=>{e.preserveScroll&&Mo.restore(n),eo(Z.get())})}).catch(()=>{es.onMissingHistoryItem()}),!0}static handleDefault(){typeof window<`u`&&Z.setUrlHash(window.location.hash),Z.set(Z.get(),{preserveScroll:!0,preserveState:!0}).then(()=>{ts.isReload()?Mo.restore(Q.getScrollRegions()):Mo.scrollToAnchor();let e=Z.get();eo(e);let t=e.flash;Object.keys(t).length>0&&queueMicrotask(()=>oo(t))})}},rs=class{constructor(e,t,n){this.intervalId=null,this.timeoutId=null,this.throttle=!1,this.keepAlive=!1,this.cbCount=0,this.inFlight=!1,this.currentCancel=null,this.stopped=!0,this.instanceId=0,this.keepAlive=n.keepAlive??!1,this.mode=n.mode??`overlap`,this.cb=t,this.interval=e,(n.autoStart??!0)&&this.start()}stop(){this.stopped=!0,this.instanceId++,this.inFlight=!1,this.currentCancel=null,this.intervalId&&=(clearInterval(this.intervalId),null),this.timeoutId&&=(clearTimeout(this.timeoutId),null)}start(){if(!(typeof window>`u`)){if(this.stop(),this.stopped=!1,this.mode===`rest`){this.scheduleNext();return}this.intervalId=window.setInterval(()=>this.tick(),this.interval)}}isInBackground(e){this.throttle=!this.keepAlive&&e,this.throttle&&(this.cbCount=0)}scheduleNext(){this.stopped||(this.timeoutId=window.setTimeout(()=>{this.timeoutId=null,this.tick()},this.interval))}tick(){!this.throttle||this.cbCount%10==0?this.fire():this.mode===`rest`&&this.scheduleNext(),this.throttle&&this.cbCount++}fire(){this.inFlight&&this.mode===`cancel`&&this.currentCancel?.();let e=this.instanceId;this.cb({onStart:t=>{e===this.instanceId&&(this.inFlight=!0,this.currentCancel=t)},onFinish:()=>{e===this.instanceId&&(this.inFlight=!1,this.currentCancel=null,this.mode===`rest`&&this.scheduleNext())}})}},is=new class{constructor(){this.polls=[],this.setupVisibilityListener()}get count(){return this.polls.length}add(e,t,n){let r=new rs(e,t,n);return this.polls.push(r),{stop:()=>r.stop(),start:()=>r.start(),destroy:()=>{r.stop(),this.polls=this.polls.filter(e=>e!==r)}}}
5clear(){this.polls.forEach(e=>e.stop()),this.polls=[]}setupVisibilityListener(){typeof document>`u`||document.addEventListener(`visibilitychange`,()=>{this.polls.forEach(e=>e.isInBackground(document.hidden))},!1)}},as=class e{constructor(e){if(this.callbacks=[],!e.prefetch)this.params=e;else{let t={onBefore:this.wrapCallback(e,`onBefore`),onBeforeUpdate:this.wrapCallback(e,`onBeforeUpdate`),onStart:this.wrapCallback(e,`onStart`),onProgress:this.wrapCallback(e,`onProgress`),onFinish:this.wrapCallback(e,`onFinish`),onCancel:this.wrapCallback(e,`onCancel`),onSuccess:this.wrapCallback(e,`onSuccess`),onError:this.wrapCallback(e,`onError`),onFlash:this.wrapCallback(e,`onFlash`),onCancelToken:this.wrapCallback(e,`onCancelToken`),onPrefetched:this.wrapCallback(e,`onPrefetched`),onPrefetching:this.wrapCallback(e,`onPrefetching`)};this.params={...e,...t,onPrefetchResponse:e.onPrefetchResponse||(()=>{}),onPrefetchError:e.onPrefetchError||(()=>{})}}}static create(t){return new e(t)}data(){return this.params.method===`get`?null:this.params.data}queryParams(){return this.params.method===`get`?this.params.data:{}}isPartial(){return this.params.only.length>0||this.params.except.length>0||this.params.reset.length>0}isPrefetch(){return this.params.prefetch===!0}isDeferredPropsRequest(){return this.params.deferredProps===!0}onCancelToken(e){this.params.onCancelToken({cancel:e})}markAsFinished(){this.params.completed=!0,this.params.cancelled=!1,this.params.interrupted=!1}markAsCancelled({cancelled:e=!0,interrupted:t=!1}){this.params.onCancel(),this.params.completed=!1,this.params.cancelled=e,this.params.interrupted=t}wasCancelledAtAll(){return this.params.cancelled||this.params.interrupted}onFinish(){this.params.onFinish(this.params)}onStart(){this.params.onStart(this.params)}onPrefetching(){this.params.onPrefetching(this.params)}onPrefetchResponse(e){this.params.onPrefetchResponse&&this.params.onPrefetchResponse(e)}onPrefetchError(e){this.params.onPrefetchError&&this.params.onPrefetchError(e)}all(){return this.params}headers(){let e={...this.params.headers};this.isPartial()&&(e[`X-Inertia-Partial-Component`]=Z.get().component);let t=this.params.only.concat(this.params.reset);return t.length>0&&(e[`X-Inertia-Partial-Data`]=t.join(`,`)),this.params.except.length>0&&(e[`X-Inertia-Partial-Except`]=this.params.except.join(`,`)),this.params.reset.length>0&&(e[`X-Inertia-Reset`]=this.params.reset.join(`,`)),this.params.errorBag&&this.params.errorBag.length>0&&(e[`X-Inertia-Error-Bag`]=this.params.errorBag),e}setPreserveOptions(t){this.params.preserveScroll=e.resolvePreserveOption(this.params.preserveScroll,t),this.params.preserveState=e.resolvePreserveOption(this.params.preserveState,t)}runCallbacks(){this.callbacks.forEach(({name:e,args:t})=>{this.params[e](...t)})}merge(e){this.params={...this.params,...e}}wrapCallback(e,t){return(...n)=>{this.recordCallback(t,n),e[t](...n)}}recordCallback(e,t){this.callbacks.push({name:e,args:t})}static resolvePreserveOption(e,t){return typeof e==`function`?e(t):e===`errors`?Object.keys(t.props.errors||{}).length>0:e}},os={modal:null,listener:null,previousBodyOverflow:null,createIframeAndPage(e){typeof e==`object`&&(e=`All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.<hr>${JSON.stringify(e)}`);let t=document.createElement(`html`);t.innerHTML=e,t.querySelectorAll(`a`).forEach(e=>e.setAttribute(`target`,`_top`));let n=document.createElement(`iframe`);return n.style.backgroundColor=`white`,n.style.borderRadius=`5px`,n.style.width=`100%`,n.style.height=`100%`,n.setAttribute(`sandbox`,`allow-scripts`),{iframe:n,page:t}},show(e){let{iframe:t,page:n}=this.createIframeAndPage(e);this.modal=document.createElement(`div`),this.modal.style.position=`fixed`,this.modal.style.width=`100vw`,this.modal.style.height=`100vh`,this.modal.style.padding=`50px`,this.modal.style.boxSizing=`border-box`,this.modal.style.backgroundColor=`rgba(0, 0, 0, .6)`,this.modal.style.zIndex=2e5,this.modal.addEventListener(`click`,()=>this.hide()),this.modal.appendChild(t),document.body.prepend(this.modal),this.previousBodyOverflow=document.body.style.overflow,document.body.style.overflow=`hidden`,t.srcdoc=n.outerHTML,this.listener=this.hideOnEscape.bind(this),document.addEventListener(`ke
5ydown`,this.listener)},hide(){this.modal.outerHTML=``,this.modal=null,document.body.style.overflow=this.previousBodyOverflow??``,this.previousBodyOverflow=null,document.removeEventListener(`keydown`,this.listener)},hideOnEscape(e){e.keyCode===27&&this.hide()}},ss={show(e){let{iframe:t,page:n}=os.createIframeAndPage(e);t.style.boxSizing=`border-box`,t.style.display=`block`;let r=document.createElement(`dialog`);r.id=`inertia-error-dialog`,Object.assign(r.style,{width:`calc(100vw - 100px)`,height:`calc(100vh - 100px)`,padding:`0`,margin:`auto`,border:`none`,backgroundColor:`transparent`});let i=document.createElement(`style`);i.textContent=`
6      dialog#inertia-error-dialog::backdrop {
7        background-color: rgba(0, 0, 0, 0.6);
8      }
9
10      dialog#inertia-error-dialog:focus {
11        outline: none;
12      }
13    `,document.head.appendChild(i),r.addEventListener(`click`,e=>{e.target===r&&r.close()}),r.addEventListener(`close`,()=>{i.remove(),r.remove()}),r.appendChild(t),document.body.prepend(r),r.showModal(),r.focus(),t.srcdoc=n.outerHTML}},cs=new Yo,ls=class e{constructor(e,t,n){this.requestParams=e,this.response=t,this.originatingPage=n,this.wasPrefetched=!1}static create(t,n,r){return new e(t,n,r)}async handlePrefetch(){Wo(this.requestParams.all().url,window.location)&&this.handle()}async handle(){return cs.add(()=>this.process())}async process(){if(this.requestParams.all().prefetch)return this.wasPrefetched=!0,this.requestParams.all().prefetch=!1,this.requestParams.all().onPrefetched(this.response,this.requestParams.all()),io(this.response,this.requestParams.all()),Promise.resolve();if(this.requestParams.runCallbacks(),!this.isInertiaResponse())return this.handleNonInertiaResponse();await Q.processQueue(),Q.preserveUrl=this.requestParams.all().preserveUrl,await this.setPage();let e=Z.get().props.errors||{};if(Object.keys(e).length>0){let t=this.getScopedErrors(e);return Ya(t),this.requestParams.all().onError(t)}$.flushByCacheTags(this.requestParams.all().invalidateCacheTags||[]),this.wasPrefetched||$.flush(Z.get().url);let{flash:t}=Z.get();Object.keys(t).length>0&&!this.requestParams.isDeferredPropsRequest()&&(oo(t),this.requestParams.all().onFlash(t)),ro(Z.get()),await this.requestParams.all().onSuccess(Z.get()),Q.preserveUrl=!1}mergeParams(e){this.requestParams.merge(e)}getPageResponse(){let e=this.getDataFromResponse(this.response.data);return typeof e==`object`?this.response.data={...e,flash:e.flash??{}}:this.response.data=e}async handleNonInertiaResponse(){if(this.isLocationVisit()){let e=zo(this.getHeader(`x-inertia-location`));return Uo(this.requestParams.all().url,e),this.locationVisit(e)}let e={...this.response,data:this.getDataFromResponse(this.response.data)};if(Qa(e))return Ga.get(`future.useDialogForErrorModal`)?ss.show(e.data):os.show(e.data)}isInertiaResponse(){return this.hasHeader(`x-inertia`)}hasStatus(e){return this.response.status===e}getHeader(e){return this.response.headers[e]}hasHeader(e){return this.getHeader(e)!==void 0}isLocationVisit(){return this.hasStatus(409)&&this.hasHeader(`x-inertia-location`)}locationVisit(e){try{if(so.set(so.locationVisitKey,{preserveScroll:this.requestParams.all().preserveScroll===!0}),typeof window>`u`)return;Wo(window.location,e)?window.location.reload():window.location.href=e.href}catch{return!1}}async setPage(){let e=this.getPageResponse();return this.shouldSetPage(e)?(this.mergeProps(e),Z.mergeOncePropsIntoResponse(e),this.preserveEqualProps(e),await this.setRememberedState(e),this.requestParams.setPreserveOptions(e),e.url=Q.preserveUrl?Z.get().url:this.pageUrl(e),this.requestParams.all().onBeforeUpdate(e),$a(e),Z.set(e,{replace:this.requestParams.all().replace,preserveScroll:this.requestParams.all().preserveScroll,preserveState:this.requestParams.all().preserveState,viewTransition:this.requestParams.all().viewTransition})):Promise.resolve()}getDataFromResponse(e){if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}}shouldSetPage(e){if(!this.requestParams.all().async||this.originatingPage.component!==e.component)return!0;if(this.originatingPage.component!==Z.get().component)return!1;let t=zo(this.originatingPage.url),n=zo(Z.get().url);return t.origin===n.origin&&t.pathname===n.pathname}pageUrl(e){let t=zo(e.url);
13return Uo(this.requestParams.all().url,t),t.pathname+t.search+t.hash}preserveEqualProps(e){if(e.component!==Z.get().component||Ga.get(`future.preserveEqualProps`)!==!0)return;let t=Z.get().props;Object.entries(e.props).forEach(([n,r])=>{wt(r,t[n])&&(e.props[n]=t[n])})}mergeProps(e){if(!this.requestParams.isPartial()||e.component!==Z.get().component)return;let t=e.mergeProps||[],n=e.prependProps||[],r=e.deepMergeProps||[],i=e.matchPropsOn||[],a=(t,n)=>{let r=ui(Z.get().props,t),a=ui(e.props,t);if(Array.isArray(a)){let o=this.mergeOrMatchItems(r||[],a,t,i,n);Ei(e.props,t,o)}else if(typeof a==`object`&&a){let n={...r||{},...a};Ei(e.props,t,n)}};if(t.forEach(e=>a(e,!0)),n.forEach(e=>a(e,!1)),r.forEach(t=>{let n=Z.get().props[t],r=e.props[t],a=(e,t,n)=>Array.isArray(t)?this.mergeOrMatchItems(e,t,n,i):typeof t==`object`&&t?Object.keys(t).reduce((r,i)=>(r[i]=a(e?e[i]:void 0,t[i],`${n}.${i}`),r),{...e}):t;e.props[t]=a(n,r,t)}),e.props={...Z.get().props,...e.props},this.requestParams.isDeferredPropsRequest()){let t=Z.get().props.errors;t&&Object.keys(t).length>0&&(e.props.errors=t)}Z.get().scrollProps&&(e.scrollProps={...Z.get().scrollProps||{},...e.scrollProps||{}}),Z.hasOnceProps()&&(e.onceProps={...Z.get().onceProps||{},...e.onceProps||{}}),this.requestParams.isDeferredPropsRequest()&&(e.flash={...Z.get().flash});let o=Z.get().initialDeferredProps;o&&Object.keys(o).length>0&&(e.initialDeferredProps=o)}mergeOrMatchItems(e,t,n,r,i=!0){let a=Array.isArray(e)?e:[],o=r.find(e=>e.split(`.`).slice(0,-1).join(`.`)===n);if(!o)return i?[...a,...t]:[...t,...a];let s=o.split(`.`).pop()||``,c=new Map;return t.forEach(e=>{this.hasUniqueProperty(e,s)&&c.set(e[s],e)}),i?this.appendWithMatching(a,t,c,s):this.prependWithMatching(a,t,c,s)}appendWithMatching(e,t,n,r){let i=e.map(e=>this.hasUniqueProperty(e,r)&&n.has(e[r])?n.get(e[r]):e),a=t.filter(t=>!this.hasUniqueProperty(t,r)||!e.some(e=>this.hasUniqueProperty(e,r)&&e[r]===t[r]));return[...i,...a]}prependWithMatching(e,t,n,r){let i=e.filter(e=>!this.hasUniqueProperty(e,r)||!n.has(e[r]));return[...t,...i]}hasUniqueProperty(e,t){return e&&typeof e==`object`&&t in e}async setRememberedState(e){let t=await Q.getState(Q.rememberedState,{});this.requestParams.all().preserveState&&t&&e.component===Z.get().component&&(e.rememberedState=t)}getScopedErrors(e){return this.requestParams.all().errorBag?e[this.requestParams.all().errorBag||``]||{}:e}},us=class e{constructor(e,t){this.page=t,this.requestHasFinished=!1,this.requestParams=as.create(e),this.cancelToken=new AbortController}static create(t,n){return new e(t,n)}isPrefetch(){return this.requestParams.isPrefetch()}async send(){this.requestParams.onCancelToken(()=>this.cancel({cancelled:!0})),no(this.requestParams.all()),this.requestParams.onStart(),this.requestParams.all().prefetch&&(this.requestParams.onPrefetching(),ao(this.requestParams.all()));let e=this.requestParams.all().prefetch;return Ne({method:this.requestParams.all().method,url:Ho(this.requestParams.all().url).href,data:this.requestParams.data(),params:this.requestParams.queryParams(),signal:this.cancelToken.signal,headers:this.getHeaders(),onUploadProgress:this.onProgress.bind(this),responseType:`text`}).then(e=>(this.response=ls.create(this.requestParams,e,this.page),this.response.handle())).catch(e=>e?.response?(this.response=ls.create(this.requestParams,e.response,this.page),this.response.handle()):Promise.reject(e)).catch(t=>{if(!Ne.isCancel(t)&&Xa(t))return e&&this.requestParams.onPrefetchError(t),Promise.reject(t)}).finally(()=>{this.finish(),e&&this.response&&this.requestParams.onPrefetchResponse(this.response)})}finish(){this.requestParams.wasCancelledAtAll()||(this.requestParams.markAsFinished(),this.fireFinishEvents())}fireFinishEvents(){this.requestHasFinished||(this.requestHasFinished=!0,Za(this.requestParams.all()),this.requestParams.onFinish())}cancel({cancelled:e=!1,interrupted:t=!1}){this.requestHasFinished||(this.cancelToken.abort(),this.requestParams.markAsCancelled({cancelled:e,interrupted:t}),this.fireFinishEvents())}onProgress(e){this.requestParams.data()instanceof FormData&&(e.percentage=e.progress?Math.round(e.progress*100):0,to(e),this.requestParam
13s.all().onProgress(e))}getHeaders(){let e={...this.requestParams.headers(),Accept:`text/html, application/xhtml+xml`,"X-Requested-With":`XMLHttpRequest`,"X-Inertia":!0},t=Z.get();t.version&&(e[`X-Inertia-Version`]=t.version);let n=Object.entries(t.onceProps||{}).filter(([,e])=>t.props[e.prop]===void 0?!1:!e.expiresAt||e.expiresAt>Date.now()).map(([e])=>e);return n.length>0&&(e[`X-Inertia-Except-Once-Props`]=n.join(`,`)),e}},ds=class{constructor({maxConcurrent:e,interruptible:t}){this.requests=[],this.maxConcurrent=e,this.interruptible=t}send(e){this.requests.push(e),e.send().finally(()=>{this.requests=this.requests.filter(t=>t!==e)})}interruptInFlight(){this.cancel({interrupted:!0},!1)}cancelInFlight({prefetch:e=!0}={}){this.requests.filter(t=>e||!t.isPrefetch()).forEach(e=>e.cancel({cancelled:!0}))}cancel({cancelled:e=!1,interrupted:t=!1}={},n=!1){!n&&!this.shouldCancel()||this.requests.shift()?.cancel({cancelled:e,interrupted:t})}shouldCancel(){return this.interruptible&&this.requests.length>=this.maxConcurrent}},fs=class{constructor(){this.syncRequestStream=new ds({maxConcurrent:1,interruptible:!0}),this.asyncRequestStream=new ds({maxConcurrent:1/0,interruptible:!1}),this.clientVisitQueue=new Yo}init({initialPage:e,resolveComponent:t,swapComponent:n,onFlash:r}){Z.init({initialPage:e,resolveComponent:t,swapComponent:n,onFlash:r}),ns.handle(),es.init(),es.on(`missingHistoryItem`,()=>{typeof window<`u`&&this.visit(window.location.href,{preserveState:!0,preserveScroll:!0,replace:!0})}),es.on(`loadDeferredProps`,e=>{this.loadDeferredProps(e)}),es.on(`historyQuotaExceeded`,e=>{window.location.href=e})}get(e,t={},n={}){return this.visit(e,{...n,method:`get`,data:t})}post(e,t={},n={}){return this.visit(e,{preserveState:!0,...n,method:`post`,data:t})}put(e,t={},n={}){return this.visit(e,{preserveState:!0,...n,method:`put`,data:t})}patch(e,t={},n={}){return this.visit(e,{preserveState:!0,...n,method:`patch`,data:t})}delete(e,t={}){return this.visit(e,{preserveState:!0,...t,method:`delete`})}reload(e={}){return this.doReload(e)}doReload(e={}){if(!(typeof window>`u`))return this.visit(window.location.href,{...e,preserveScroll:!0,preserveState:!0,async:!0,headers:{...e.headers||{},"Cache-Control":`no-cache`}})}remember(e,t=`default`){Q.remember(e,t)}restore(e=`default`){return Q.restore(e)}on(e,t){return typeof window>`u`?()=>{}:es.onGlobalEvent(e,t)}cancel(){this.syncRequestStream.cancelInFlight()}get activePolls(){return is.count}cancelAll({async:e=!0,prefetch:t=!0,sync:n=!0}={}){e&&this.asyncRequestStream.cancelInFlight({prefetch:t}),n&&this.syncRequestStream.cancelInFlight()}poll(e,t={},n={}){return is.add(e,({onStart:e,onFinish:n})=>{let r=typeof t==`function`?t():t;this.reload({...r,onCancelToken:t=>{e(t.cancel),r.onCancelToken?.(t)},onFinish:e=>{n(),r.onFinish?.(e)}})},{autoStart:n.autoStart??!0,keepAlive:n.keepAlive??!1,mode:n.mode})}visit(e,t={}){let n=this.getPendingVisit(e,{...t,showProgress:t.showProgress??!t.async}),r=this.getVisitEvents(t);if(r.onBefore(n)===!1||!Ja(n))return;let i=zo(Z.get().url);(n.only.length>0||n.except.length>0||n.reset.length>0?Go(n.url,i):Wo(n.url,i))||this.asyncRequestStream.cancelInFlight({prefetch:!1}),n.async||this.syncRequestStream.interruptInFlight(),!Z.isCleared()&&!n.preserveUrl&&Mo.save();let a={...n,...r},o=wo.get(a);o?(ac.reveal(o.inFlight),wo.use(o,a)):(ac.reveal(!0),(n.async?this.asyncRequestStream:this.syncRequestStream).send(us.create(a,Z.get())))}getCached(e,t={}){return wo.findCached(this.getPrefetchParams(e,t))}flush(e,t={}){wo.remove(this.getPrefetchParams(e,t))}flushAll(){wo.removeAll()}flushByCacheTags(e){wo.removeByTags(Array.isArray(e)?e:[e])}getPrefetching(e,t={}){return wo.findInFlight(this.getPrefetchParams(e,t))}prefetch(e,t={},n={}){if((t.method??(Ko(e)?e.method:`get`))!==`get`)throw Error(`Prefetch requests must use the GET method`);let r=this.getPendingVisit(e,{...t,async:!0,showProgress:!1,prefetch:!0,viewTransition:!1});if(r.url.origin+r.url.pathname+r.url.search===window.location.origin+window.location.pathname+window.location.search)return;let i=this.getVisitEvents(t);if(i.onBefore(r)===!1||!Ja(r))return;ac.hide(),this.asyncRequestStream.interruptInFlight();let a={...r,...i};new Promise(e=>{let t=()=>{Z.get()?e():setTimeout(t,50)};t()}).then(()=>{wo.add(a,e=>{this.asyncRequestStream.send(us.create(e,Z.get()))},{cacheFor:Ga.get(`prefetch.cacheFor`),cacheTags:[],...n})})}clearHistory(){Q.clear()}decryptHistory(){return Q.decrypt()}resolveComponent(e){return Z.resolve(e)}replace(e){this.clientVisit(e,{replace:!0})}replaceProp(e,t,n){this.replace({preserveScroll:!0,preserveState:!0,props(n){let r=typeof t==`function`?t(ui(n,e),n):t;return Ei(Dt(n),e,r)},...n||{}})}appendToProp(e,t,n){this.replaceProp(e,(e,n)=>{let r=typeof t==`function`?t(e,n):t;return Array.isArray(e)||(e=e===void 0?[]:[e]),[...e,r]},n)}prependToProp(e,t,n){this.replaceProp(e,(e,n)=>{let r=typeof t==`function`?t(e,n):t;return Array.isArray(e)||(e=e===void 0?[]:[e]),[r,...e]},n)}push(e){this.clientVisit(e)}flash(e,t){let n=Z.get().flash,r;if(typeof e==`function`)r=e(n);else if(typeof e==`string`)r={...n,[e]:t};else if(e&&Object.keys(e).length)r={...n,...e};else return;Z.setFlash(r),Object.keys(r).length&&oo(r)}clientVisit(e,{replace:t=!1}={}){this.clientVisitQueue.add(()=>this.performClientVisit(e,{replace:t}))}performClientVisit(e,{replace:t=!1}={}){let n=Z.get(),r=typeof e.props==`function`?Object.fromEntries(Object.values(n.onceProps??{}).map(e=>
13[e.prop,n.props[e.prop]])):{},i=typeof e.props==`function`?e.props(n.props,r):e.props??n.props,a=typeof e.flash==`function`?e.flash(n.flash):e.flash,{viewTransition:o,onError:s,onFinish:c,onFlash:l,onSuccess:u,...d}=e,f={...n,...d,flash:a??{},props:i},p=as.resolvePreserveOption(e.preserveScroll??!1,f),m=as.resolvePreserveOption(e.preserveState??!1,f);return Z.set(f,{replace:t,preserveScroll:p,preserveState:m,viewTransition:o}).then(()=>{let t=Z.get().flash;Object.keys(t).length>0&&(oo(t),l?.(t));let n=Z.get().props.errors||{};if(Object.keys(n).length===0){u?.(Z.get());return}let r=e.errorBag?n[e.errorBag||``]||{}:n;s?.(r)}).finally(()=>c?.(e))}getPrefetchParams(e,t){return{...this.getPendingVisit(e,{...t,async:!0,showProgress:!1,prefetch:!0,viewTransition:!1}),...this.getVisitEvents(t)}}getPendingVisit(e,t,n={}){if(Ko(e)){let n=e;e=n.url,t.method=t.method??n.method}let r=Ga.get(`visitOptions`),i=r&&r(e.toString(),Dt(t))||{},a={method:`get`,data:{},replace:!1,preserveScroll:!1,preserveState:!1,only:[],except:[],headers:{},errorBag:``,forceFormData:!1,queryStringArrayFormat:`brackets`,async:!1,showProgress:!0,fresh:!1,reset:[],preserveUrl:!1,prefetch:!1,invalidateCacheTags:[],viewTransition:!1,...yo(t),...yo(i)},[o,s]=Bo(e,a.data,a.method,a.forceFormData,a.queryStringArrayFormat),c={cancelled:!1,completed:!1,interrupted:!1,...a,...n,url:o,data:s};return c.prefetch&&(c.headers.Purpose=`prefetch`),c}getVisitEvents(e){return{onCancelToken:e.onCancelToken||(()=>{}),onBefore:e.onBefore||(()=>{}),onBeforeUpdate:e.onBeforeUpdate||(()=>{}),onStart:e.onStart||(()=>{}),onProgress:e.onProgress||(()=>{}),onFinish:e.onFinish||(()=>{}),onCancel:e.onCancel||(()=>{}),onSuccess:e.onSuccess||(()=>{}),onError:e.onError||(()=>{}),onFlash:e.onFlash||(()=>{}),onPrefetched:e.onPrefetched||(()=>{}),onPrefetching:e.onPrefetching||(()=>{})}}loadDeferredProps(e){e&&Object.entries(e).forEach(([e,t])=>{this.doReload({only:t,deferredProps:!0})})}},ps=class{static createWayfinderCallback(...e){return()=>e.length===1?Ko(e[0])?e[0]:e[0]():{method:typeof e[0]==`function`?e[0]():e[0],url:typeof e[1]==`function`?e[1]():e[1]}}static parseUseFormArguments(...e){return e.length===0?{rememberKey:null,data:{},precognitionEndpoint:null}:e.length===1?{rememberKey:null,data:e[0],precognitionEndpoint:null}:e.length===2?typeof e[0]==`string`?{rememberKey:e[0],data:e[1],precognitionEndpoint:null}:{rememberKey:null,data:e[1],precognitionEndpoint:this.createWayfinderCallback(e[0])}:{rememberKey:null,data:e[2],precognitionEndpoint:this.createWayfinderCallback(e[0],e[1])}}static parseSubmitArguments(e,t){return e.length===3||e.length===2&&typeof e[0]==`string`?{method:e[0],url:e[1],options:e[2]??{}}:Ko(e[0])?{...e[0],options:e[1]??{}}:{...t(),options:e[0]??{}}}static mergeHeadersForValidation(e,t,n){let r=e=>(e.headers={...n??{},...e.headers??{}},e);return e&&typeof e==`object`&&!(`target`in e)?e=r(e):t&&typeof t==`object`?t=r(t):typeof e==`string`?t=r(t??{}):e=r(e??{}),[e,t]}};function ms(e){return e.includes(`.`)?e.replace(/\\\./g,`__ESCAPED_DOT__`).split(/(\[[^\]]*\])/).filter(Boolean).map(e=>e.startsWith(`[`)&&e.endsWith(`]`)?e:e.split(`.`).reduce((e,t,n)=>n===0?t:`${e}[${t}]`)).join(``).replace(/__ESCAPED_DOT__/g,`.`):e}function hs(e){let t=[],n=/([^\[\]]+)|\[(\d*)\]/g,r;for(;(r=n.exec(e))!==null;)r[1]===void 0?r[2]!==void 0&&t.push(r[2]===``?``:Number(r[2])):t.push(r[1]);return t}function gs(e,t,n){let r=e;for(let e=0;e<t.length-1;e++)t[e]in r||(r[t[e]]={}),r=r[t[e]];r[t[t.length-1]]=n}function _s(e){let t=Object.keys(e),n=t.filter(e=>/^\d+$/.test(e)).map(Number).sort((e,t)=>e-t);return t.length===n.length&&n.length>0&&n[0]===0&&n.every((e,t)=>e===t)}function vs(e){if(Array.isArray(e))return e.map(vs);if(typeof e!=`object`||!e||No(e))return e;if(_s(e)){let t=[];for(let n=0;n<Object.keys(e).length;n++)t[n]=vs(e[n]);return t}let t={};for(let n in e)t[n]=vs(e[n]);return t}function ys(e){let t={};for(let[n,r]of e.entries()){if(r instanceof File&&r.size===0&&r.name===``)continue;let e=hs(ms(n));if(e[e.length-1]===``){let n=e.slice(0,-1),i=ui(t,n);if(Array.isArray(i))i.push(r);else if(i&&typeof i==`object`&&!No(i)){let e=Object.keys(i).filter(e=>/^\d+$/.test(e)).map(Number).sort((e,t)=>
13e-t);Ei(t,n,e.length>0?[...e.map(e=>i[e]),r]:[r])}else Ei(t,n,[r]);continue}gs(t,e.map(String),r)}return vs(t)}var bs={preferredAttribute(){return Ga.get(`future.useDataInertiaHeadAttribute`)?`data-inertia`:`inertia`},buildDOMElement(e){let t=document.createElement(`template`);t.innerHTML=e;let n=t.content.firstChild;if(!e.startsWith(`<script `))return n;let r=document.createElement(`script`);return r.innerHTML=n.innerHTML,n.getAttributeNames().forEach(e=>{r.setAttribute(e,n.getAttribute(e)||``)}),r},isInertiaManagedElement(e){return e.nodeType===Node.ELEMENT_NODE&&e.getAttribute(this.preferredAttribute())!==null},findMatchingElementIndex(e,t){let n=this.preferredAttribute(),r=e.getAttribute(n);return r===null?-1:t.findIndex(e=>e.getAttribute(n)===r)},update:Ka(function(e){let t=e.map(e=>this.buildDOMElement(e));Array.from(document.head.childNodes).filter(e=>this.isInertiaManagedElement(e)).forEach(e=>{let n=this.findMatchingElementIndex(e,t);if(n===-1){e?.parentNode?.removeChild(e);return}let r=t.splice(n,1)[0];r&&!e.isEqualNode(r)&&e?.parentNode?.replaceChild(r,e)}),t.forEach(e=>document.head.appendChild(e))},1)};function xs(e,t,n){let r={},i=0;function a(){let e=i+=1;return r[e]=[],e.toString()}function o(e){e!==null&&Object.keys(r).indexOf(e)!==-1&&(delete r[e],u())}function s(e){Object.keys(r).indexOf(e)===-1&&(r[e]=[])}function c(e,t=[]){e!==null&&Object.keys(r).indexOf(e)>-1&&(r[e]=t),u()}function l(){let e=t(``),n=bs.preferredAttribute(),i={...e?{title:`<title ${n}="">${e}</title>`}:{}},a=Object.values(r).reduce((e,t)=>e.concat(t),[]).reduce((e,r)=>{if(r.indexOf(`<`)===-1)return e;if(r.indexOf(`<title `)===0){let n=r.match(/(<title [^>]+>)(.*?)(<\/title>)/s);return e.title=n?`${n[1]}${t(n[2])}${n[3]}`:r,e}let i=r.match(n===`inertia`?/ inertia="[^"]+"/:/ data-inertia="[^"]+"/);return i?e[i[0]]=r:e[Object.keys(e).length]=r,e},i);return Object.values(a)}function u(){e?n(l()):bs.update(l())}return u(),{forceUpdate:u,createProvider:function(){let e=a();return{preferredAttribute:bs.preferredAttribute,reconnect:()=>s(e),update:t=>c(e,t),disconnect:()=>o(e)}}}}var Ss=`X-Inertia-Infinite-Scroll-Merge-Intent`,Cs=e=>{let t=()=>{let t=Z.get().scrollProps?.[e.getPropName()];if(t)return t;throw Error(`The page object does not contain a scroll prop named "${e.getPropName()}".`)},n={component:null,loading:!1,previousPage:null,nextPage:null,lastLoadedPage:null,requestCount:0},r=()=>{let e=t();n.component=Z.get().component,n.loading=!1,n.previousPage=e.previousPage,n.nextPage=e.nextPage,n.lastLoadedPage=e.currentPage,n.requestCount=0},i=()=>`inertia:infinite-scroll-data:${e.getPropName()}`;if(typeof window<`u`){r();let e=$.restore(i());e&&typeof e==`object`&&e.lastLoadedPage===t().currentPage&&(n.previousPage=e.previousPage,n.nextPage=e.nextPage,n.lastLoadedPage=e.lastLoadedPage,n.requestCount=e.requestCount||0)}let a=$.on(`success`,i=>{n.component===i.detail.page.component&&t().reset&&(r(),e.onReset?.())}),o=e=>e===`next`?`nextPage`:`previousPage`,s=e=>{let t=o(e);return n[t]},c=e=>{let r=t(),a=o(e);n.lastLoadedPage=r.currentPage,n[a]=r[a],n.requestCount+=1,$.remember({previousPage:n.previousPage,nextPage:n.nextPage,lastLoadedPage:n.lastLoadedPage,requestCount:n.requestCount},i())},l=()=>t().pageName,u=()=>n.requestCount,d=(t,r={})=>{let i=s(t);n.loading||i===null||(n.loading=!0,$.reload({...r,data:{[l()]:i},only:[e.getPropName()],preserveUrl:!0,headers:{[Ss]:t===`previous`?`prepend`:`append`,...r.headers},onBefore:n=>{t===`next`?e.onBeforeNextRequest():e.onBeforePreviousRequest(),r.onBefore?.(n)},onBeforeUpdate:t=>{e.onBeforeUpdate(),r.onBeforeUpdate?.(t)},onSuccess:e=>{c(t),r.onSuccess?.(e)},onFinish:i=>{n.loading=!1;let a=i.completed,o=a?n.lastLoadedPage:null;t===`next`?e.onCompleteNextRequest(o,{page:o,completed:a}):e.onCompletePreviousRequest(o,{page:o,completed:a}),r.onFinish?.(i)}}))};return{getLastLoadedPage:()=>n.lastLoadedPage,getPageName:l,getRequestCount:u,hasPrevious:()=>!!n.previousPage,hasNext:()=>!!n.nextPage,fetchNext:e=>d(`next`,e),fetchPrevious:e=>d(`previous`,e),removeEventListener:a}},ws=()=>{let e=[];return{new:(t,n={})=>{let r=new IntersectionObserver(e=>{for(let n of e)n.isIntersecting&&t(n)},n);return e.push(r),r},flushAll:()=>
13{e.forEach(e=>e.disconnect()),e.length=0}}},Ts=`infiniteScrollPage`,Es=`infiniteScrollIgnore`,Ds=e=>e.dataset[Ts],Os=e=>{let t=ws(),n,r,i,a,o=!1,s=()=>{a=new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&f.add(e)})}),b()}),a.observe(e.getItemsElement(),{childList:!0}),n=t.new(t=>e.onItemIntersected(t.target));let o={root:e.getScrollableParent(),rootMargin:`${Math.max(1,e.getTriggerMargin())}px`};r=t.new(e.onPreviousTriggered,o),i=t.new(e.onNextTriggered,o)},c=()=>{o&&l();let t=e.getStartElement(),n=e.getEndElement();t&&e.shouldFetchPrevious()&&r.observe(t),n&&e.shouldFetchNext()&&i.observe(n),o=!0},l=()=>{o&&=(r.disconnect(),i.disconnect(),!1)},u=()=>{o&&c()},d=()=>{l(),t.flushAll(),a?.disconnect()},f=new Set,p=e=>!(Ts in e.dataset)&&!(Es in e.dataset),m=()=>{Array.from(f).forEach(e=>{p(e)&&(e.dataset[Es]=`true`),n.observe(e)}),f.clear()},h=e=>Array.from(e.querySelectorAll(`:scope > *:not([data-infinite-scroll-page]):not([data-infinite-scroll-ignore])`)),g=!1,_=t=>{!g&&(g=!0,x())||(h(e.getItemsElement()).forEach(e=>{p(e)&&(e.dataset[Ts]=t?.toString()||`1`),n.observe(e)}),y())},v=()=>`inertia:infinite-scroll-elements:${e.getPropName()}`,y=()=>{let t={},n=e.getItemsElement().childNodes;for(let e=0;e<n.length;e++){let r=n[e];if(r.nodeType!==Node.ELEMENT_NODE)continue;let i=Ds(r);i!==void 0&&(i in t?t[i].to=e:t[i]={from:e,to:e})}$.remember(t,v())},b=Ka(y,250),x=()=>{let t=$.restore(v());if(!t||typeof t!=`object`)return!1;let r=e.getItemsElement().childNodes;for(let e=0;e<r.length;e++){let i=r[e];if(i.nodeType!==Node.ELEMENT_NODE)continue;let a=i,o;for(let[n,r]of Object.entries(t))if(e>=r.from&&e<=r.to){o=n;break}if(o)a.dataset[Ts]=o;else if(p(a))a.dataset[Es]=`true`;else continue;n.observe(a)}return!0};return{setupObservers:s,enableTriggers:c,disableTriggers:l,refreshTriggers:u,flushAll:d,processManuallyAddedElements:m,processServerLoadedElements:_}},ks=new Yo,As,js,Ms=null,Ns=e=>{let t=!0,n=n=>{ks.add(()=>new Promise(r=>{if(!t)return As=js=null,r();if(!As||!js){let e=Z.get().url;As=zo(e),js=zo(e),Ms=qo(e)}let i=e.getPageName(),a=js.searchParams;n===`1`?a.delete(i):a.set(i,n),setTimeout(()=>r())})).finally(()=>{t&&As&&js&&As.href!==js.href&&Ms!==null&&$.replace({url:Jo(js,Ms),preserveScroll:!0,preserveState:!0}),As=js=Ms=null})};return{onItemIntersected:Ka(r=>{let i=e.getItemsElement();if(!t||e.shouldPreserveUrl()||!r||!i)return;let a=new Map;Do([...i.children],r).forEach(e=>{let t=Ds(e)??`1`;a.has(t)?a.set(t,a.get(t)+1):a.set(t,1)});let o=Array.from(a.entries()).sort((e,t)=>t[1]-e[1])[0]?.[0];o!==void 0&&n(o)},250),cancel:()=>t=!1}},Ps=e=>({createCallbacks:()=>{let t,n=null,r=0;return{captureScrollPosition:()=>{let i=e.getScrollableParent(),a=e.getItemsElement();t=i?.scrollTop||window.scrollY;let o=Do([...a.children]);if(o.length>0){n=o[0];let e=i?.getBoundingClientRect()||{top:0},t=i?e.top:0;r=n.getBoundingClientRect().top-t}},restoreScrollPosition:()=>{if(!n)return;let i=0,a=!1,o=()=>{if(i++,a||i>10)return!1;let s=e.getScrollableParent(),c=s?.getBoundingClientRect()||{top:0},l=s?c.top:0,u=n.getBoundingClientRect().top-l-r;if(u===0){window.requestAnimationFrame(o);return}s?s.scrollTo({top:t+u}):window.scrollTo(0,window.scrollY+u),a=!0}
13;window.requestAnimationFrame(o)}}}});function Fs(e){let t=Ns({...e,getPageName:()=>i.getPageName()}),n=Ps(e),r=Os({...e,onItemIntersected:t.onItemIntersected,onPreviousTriggered:()=>i.fetchPrevious(),onNextTriggered:()=>i.fetchNext()}),i=Cs({...e,onBeforeUpdate:r.processManuallyAddedElements,onCompletePreviousRequest:(t,n)=>{e.onCompletePreviousRequest(n),n.completed&&Oo(()=>r.processServerLoadedElements(n.page),2)},onCompleteNextRequest:(t,n)=>{e.onCompleteNextRequest(n),n.completed&&Oo(()=>r.processServerLoadedElements(n.page),2)},onReset:e.onDataReset}),a=e=>{let{captureScrollPosition:t,restoreScrollPosition:r}=n.createCallbacks(),i=e.onBeforeUpdate||(()=>{}),a=e.onSuccess||(()=>{});return e.onBeforeUpdate=e=>{i(e),t()},e.onSuccess=e=>{a(e),r()},e},o=i.fetchNext;i.fetchNext=(t={})=>{e.inReverseMode()&&(t=a(t)),o(t)};let s=i.fetchPrevious;i.fetchPrevious=(t={})=>{e.inReverseMode()||(t=a(t)),s(t)};let c=$.on(`success`,()=>Oo(r.refreshTriggers,2));return{dataManager:i,elementManager:r,flush:()=>{c(),i.removeEventListener(),r.flushAll(),t.cancel()}}}function Is(e){return e.target instanceof HTMLElement&&e.target.isContentEditable||e.defaultPrevented}function Ls(e){let t=e.currentTarget.tagName.toLowerCase()===`a`,n=t?e.currentTarget.target:``;return!(Is(e)||t&&e.altKey||t&&e.ctrlKey||t&&e.metaKey||t&&e.shiftKey||t&&n!==``&&n!==`_self`||t&&`button`in e&&e.button!==0)}function Rs(e){let t=e.currentTarget.tagName.toLowerCase()===`button`;return!Is(e)&&(e.key===`Enter`||t&&e.key===` `)}var zs=`nprogress`,Bs,Vs={minimum:.08,easing:`linear`,positionUsing:`translate3d`,speed:200,trickle:!0,trickleSpeed:200,showSpinner:!0,barSelector:`[role="bar"]`,spinnerSelector:`[role="spinner"]`,parent:`body`,color:`#29d`,includeCSS:!0,template:[`<div class="bar" role="bar">`,`<div class="peg"></div>`,`</div>`,`<div class="spinner" role="spinner">`,`<div class="spinner-icon"></div>`,`</div>`].join(``)},Hs=null,Us=e=>{Object.assign(Vs,e),Vs.includeCSS&&rc(Vs.color),Bs=document.createElement(`div`),Bs.id=zs,Bs.innerHTML=Vs.template},Ws=e=>{let t=Gs();e=ec(e,Vs.minimum,1),Hs=e===1?null:e;let n=Ys(!t),r=n.querySelector(Vs.barSelector),i=Vs.speed,a=Vs.easing;n.offsetWidth,nc(t=>{let o=Vs.positionUsing===`translate3d`?{transition:`all ${i}ms ${a}`,transform:`translate3d(${tc(e)}%,0,0)`}:Vs.positionUsing===`translate`?{transition:`all ${i}ms ${a}`,transform:`translate(${tc(e)}%,0)`}:{marginLeft:`${tc(e)}%`};for(let e in o)r.style[e]=o[e];if(e!==1)return setTimeout(t,i);n.style.transition=`none`,n.style.opacity=`1`,n.offsetWidth,setTimeout(()=>{n.style.transition=`all ${i}ms linear`,n.style.opacity=`0`,setTimeout(()=>{Zs(),n.style.transition=``,n.style.opacity=``,t()},i)},i)})},Gs=()=>typeof Hs==`number`,Ks=()=>{Hs||Ws(0);let e=function(){setTimeout(function(){Hs&&(Js(),e())},Vs.trickleSpeed)};Vs.trickle&&e()},qs=e=>{!e&&!Hs||(Js(.3+.5*Math.random()),Ws(1))},Js=e=>{let t=Hs;if(t===null)return Ks();if(!(t>1))return e=typeof e==`number`?e:(()=>{let e={.1:[0,.2],.04:[.2,.5],.02:[.5,.8],.005:[.8,.99]};for(let n in e)if(t>=e[n][0]&&t<e[n][1])return parseFloat(n);return 0})(),Ws(ec(t+e,0,.994))},Ys=e=>{if(Qs())return document.getElementById(zs);document.documentElement.classList.add(`${zs}-busy`);let t=Bs.querySelector(Vs.barSelector),n=e?`-100`:tc(Hs||0),r=Xs();return t.style.transition=`all 0 linear`,t.style.transform=`translate3d(${n}%,0,0)`,Vs.showSpinner||Bs.querySelector(Vs.spinnerSelector)?.remove(),r!==document.body&&r.classList.add(`${zs}-custom-parent`),r.appendChild(Bs),Bs},Xs=()=>$s(Vs.parent)?Vs.parent:document.querySelector(Vs.parent),Zs=()=>{document.documentElement.classList.remove(`${zs}-busy`),Xs().classList.remove(`${zs}-custom-parent`),Bs?.remove()},Qs=()=>document.getElementById(zs)!==null,$s=e=>typeof HTMLElement==`object`?e instanceof HTMLElement:e&&typeof e==`object`&&e.nodeType===1&&typeof e.nodeName==`string`;function ec(e,t,n){return e<t?t:e>n?n:e}var tc=e=>(-1+e)*100,nc=(()=>{let e=[],t=()=>{let n=e.shift();n&&n(t)};return n=>{e.push(n),e.length===1&&t()}})(),rc=e=>{let t=document.createElement(`style`);t.textContent=`
14    #${zs} {
15      pointer-events: none;
16    }
17
18    #${zs} .bar {
19      background: ${e};
20
21      position: fixed;
22      z-index: 1031;
23      top: 0;
24      left: 0;
25
26      width: 100%;
27      height: 2px;
28    }
29
30    #${zs} .peg {
31      display: block;
32      position: absolute;
33      right: 0px;
34      width: 100px;
35      height: 100%;
36      box-shadow: 0 0 10px ${e}, 0 0 5px ${e};
37      opacity: 1.0;
38
39      transform: rotate(3deg) translate(0px, -4px);
40    }
41
42    #${zs} .spinner {
43      display: block;
44      position: fixed;
45      z-index: 1031;
46      top: 15px;
47      right: 15px;
48    }
49
50    #${zs} .spinner-icon {
51      width: 18px;
52      height: 18px;
53      box-sizing: border-box;
54
55      border: solid 2px transparent;
56      border-top-color: ${e};
57      border-left-color: ${e};
58      border-radius: 50%;
59
60      animation: ${zs}-spinner 400ms linear infinite;
61    }
62
63    .${zs}-custom-parent {
64      overflow: hidden;
65      position: relative;
66    }
67
68    .${zs}-custom-parent #${zs} .spinner,
69    .${zs}-custom-parent #${zs} .bar {
70      position: absolute;
71    }
72
73    @keyframes ${zs}-spinner {
74      0%   { transform: rotate(0deg); }
75      100% { transform: rotate(360deg); }
76    }
77  `,document.head.appendChild(t)},ic={configure:Us,isStarted:Gs,done:qs,set:Ws,remove:Zs,start:Ks,status:Hs,show:()=>{Bs&&(Bs.style.display=``)},hide:()=>{Bs&&(Bs.style.display=`none`)}},ac=new class{constructor(){this.hideCount=0}start(){ic.start()}reveal(e=!1){this.hideCount=Math.max(0,this.hideCount-1),(e||this.hideCount===0)&&ic.show()}hide(){this.hideCount++,ic.hide()}set(e){ic.set(Math.max(0,Math.min(1,e)))}finish(){ic.done()}reset(){ic.set(0)}remove(){ic.done(),ic.remove()}isStarted(){return ic.isStarted()}getStatus(){return ic.status}};ac.reveal,ac.hide;function oc(e){document.addEventListener(`inertia:start`,t=>sc(t,e)),document.addEventListener(`inertia:progress`,cc)}function sc(e,t){e.detail.visit.showProgress||ac.hide();let n=setTimeout(()=>ac.start(),t);document.addEventListener(`inertia:finish`,e=>lc(e,n),{once:!0})}function cc(e){ac.isStarted()&&e.detail.progress?.percentage&&ac.set(Math.max(ac.getStatus(),e.detail.progress.percentage/100*.9))}function lc(e,t){clearTimeout(t),ac.isStarted()&&(e.detail.visit.completed?ac.finish():e.detail.visit.interrupted?ac.reset():e.detail.visit.cancelled&&ac.remove())}function uc({delay:e=250,color:t=`#29d`,includeCSS:n=!0,showSpinner:r=!1}={}){oc(e),ic.configure({showSpinner:r,includeCSS:n,color:t})}var dc=Symbol(`FormComponentReset`);function fc(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function pc(e,t){let n=e.value,r=e.checked;switch(e.type.toLowerCase()){case`checkbox`:e.checked=t.includes(e.value);break;case`radio`:e.checked=t[0]===e.value;break;case`file`:e.value=``;break;case`button`:case`submit`:case`reset`:case`image`:break;default:e.value=t[0]!==null&&t[0]!==void 0?String(t[0]):``}return e.value!==n||e.checked!==r}function mc(e,t){let n=e.value,r=Array.from(e.selectedOptions).map(e=>e.value);if(e.multiple){let n=t.map(e=>String(e));Array.from(e.options).forEach(e=>{e.selected=n.includes(e.value)})}else e.value=t[0]===void 0?``:String(t[0]);let i=Array.from(e.selectedOptions).map(e=>e.value);return e.multiple?JSON.stringify(r.sort())!==JSON.stringify(i.sort()):e.value!==n}function hc(e,t){if(e.disabled){if(e instanceof HTMLInputElement){let t=e.value,n=e.checked;switch(e.type.toLowerCase()){case`checkbox`:case`radio`:return e.checked=e.defaultChecked,e.checked!==n;case`file`:return e.value=``,t!==``;case`button`:case`submit`:case`reset`:case`image`:return!1;default:return e.value=e.defaultValue,e.value!==t}}else if(e instanceof HTMLSelectElement){let t=Array.from(e.selectedOptions).map(e=>e.value);Array.from(e.options).forEach(e=>{e.selected=e.defaultSelected});let n=Array.from(e.selectedOptions).map(e=>e.value);return JSON.stringify(t.sort())!==JSON.stringify(n.sort())}else if(e instanceof HTMLTextAreaElement){let t=e.value;return e.value=e.defaultValue,e.value!==t}return!1}if(e instanceof HTMLInputElement)return pc(e,t);if(e instanceof HTMLSelectElement)return mc(e,t);if(e instanceof HTMLTextAreaElement){let n=e.value;return e.value=t[0]===void 0?``:String(t[0]),e.value!==n}return!1}function gc(e,t){let n=!1;return e instanceof RadioNodeList||e instanceof HTMLCollection?Array.from(e).forEach((e,r)=>{e instanceof Element&&fc(e)&&(e instanceof HTMLInputElement&&[`checkbox`,`radio`].includes(e.type.toLowerCase())?hc(e,t)&&(n=!0):hc(e,t[r]===void 0?[t[0]??null].filter(Boolean):[t[r]])&&(n=!0))}):fc(e)&&(n=hc(e,t)),n}function _c(e,t,n){if(!e)return;let r=!n||n.length===0;if(r){let r=new FormData(e),i=Array.from(e.elements).map(e=>fc(e)?e.name:``).filter(Boolean);n=[...new Set([...t.keys(),...r.keys(),...i])]}let i=!1;n.forEach(n=>{let r=e.elements.namedItem(n);r&&gc(r,t.getAll(n))&&(i=!0)}),i&&r&&e.dispatchEvent(new CustomEvent(`reset`,{bubbles:!0,cancelable:!0,detail:{[dc]:!0}}))}var $=new fs,vc=Ne.create(),yc=(e,t)=>`${e.method}:${e.baseURL??t.defaults.baseURL??``}${e.url}`,bc=e=>e.status===204&&e.headers[`precognition-success`]===`true`,xc={},Sc={get:(e,t={},n={})=>wc(Cc(`get`,e,t,n)),post:(e,t={},n={})=>wc(Cc(`post`,e,t,n)),patch:(e,t={},n={})=>wc(Cc(`patch`,e,t,n)),put:(e,t={},n={})=>wc(Cc(`put`,e,t,n)),delete:(e,t={},n={})=>
77wc(Cc(`delete`,e,t,n)),use(e){return vc=e,Sc},axios(){return vc},fingerprintRequestsUsing(e){return yc=e===null?()=>null:e,Sc},determineSuccessUsing(e){return bc=e,Sc}},Cc=(e,t,n,r)=>({url:t,method:e,...r,...[`get`,`delete`].includes(e)?{params:kt({},n,r?.params)}:{data:kt({},n,r?.data)}}),wc=(e={})=>{let t=[Tc,Dc,Oc].reduce((e,t)=>t(e),e);return(t.onBefore??(()=>!0))()===!1?Promise.resolve(null):((t.onStart??(()=>null))(),vc.request(t).then(async e=>{t.precognitive&&kc(e);let n=e.status,r=e;return t.precognitive&&t.onPrecognitionSuccess&&bc(r)&&(r=await Promise.resolve(t.onPrecognitionSuccess(r)??r)),t.onSuccess&&Ec(n)&&(r=await Promise.resolve(t.onSuccess(r)??r)),(jc(t,n)??(e=>e))(r)??r},e=>Ac(e)?Promise.reject(e):(t.precognitive&&kc(e.response),(jc(t,e.response.status)??((e,t)=>Promise.reject(t)))(e.response,e))).finally(t.onFinish??(()=>null)))},Tc=e=>{let t=e.only??e.validate;return{...e,timeout:e.timeout??vc.defaults.timeout??3e4,precognitive:e.precognitive!==!1,fingerprint:e.fingerprint===void 0?yc(e,vc):e.fingerprint,headers:{...e.headers,"Content-Type":Mc(e),...e.precognitive===!1?{}:{Precognition:!0},...t?{"Precognition-Validate-Only":Array.from(t).join()}:{}}}},Ec=e=>e>=200&&e<300,Dc=e=>typeof e.fingerprint==`string`?(xc[e.fingerprint]?.abort(),delete xc[e.fingerprint],e):e,Oc=e=>typeof e.fingerprint!=`string`||e.signal||e.cancelToken||!e.precognitive?e:(xc[e.fingerprint]=new AbortController,{...e,signal:xc[e.fingerprint].signal}),kc=e=>{if(e.headers?.precognition!==`true`)throw Error(`Did not receive a Precognition response. Ensure you have the Precognition middleware in place for the route.`)},Ac=e=>!Cr(e)||typeof e.response?.status!=`number`||vr(e),jc=(e,t)=>({401:e.onUnauthorized,403:e.onForbidden,404:e.onNotFound,409:e.onConflict,422:e.onValidationError,423:e.onLocked})[t],Mc=e=>e.headers?.[`Content-Type`]??e.headers?.[`Content-type`]??e.headers?.[`content-type`]??(Nc(e.data)?`multipart/form-data`:`application/json`),Nc=e=>Pc(e)||typeof e==`object`&&!!e&&Object.values(e).some(e=>Nc(e)),Pc=e=>typeof File<`u`&&e instanceof File||e instanceof Blob||typeof FileList<`u`&&e instanceof FileList&&e.length>0,Fc=(e,t)=>{if(!e.includes(`*`))return[e];let n=e.split(`.`),r=[``];for(let e of n)if(e===`*`){let e=[];for(let n of r){let r=n?ui(t,n):t;if(Array.isArray(r))for(let t=0;t<r.length;t++)e.push(n?`${n}.${t}`:String(t));else if(typeof r==`object`&&r)for(let t of Object.keys(r))e.push(n?`${n}.${t}`:t)}r=e}else r=r.map(t=>t?`${t}.${e}`:e);return r},Ic=(e,t)=>t.includes(`*`)?RegExp(`^`+t.replace(/\./g,`\\.`).replace(/\*/g,`[^.]+`)+`$`).test(e):e===t,Lc=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>!t.some(t=>Ic(e,t)))),Rc=(e,t={})=>{let n={errorsChanged:[],touchedChanged:[],validatingChanged:[],validatedChanged:[]},r=!1,i=!1,a=e=>e===i?[]:(i=e,n.validatingChanged),o=[],s=e=>{let t=[...new Set(e)];return o.length!==t.length||!t.every(e=>o.includes(e))?(o=t,n.validatedChanged):[]},c=()=>o.filter(e=>d[e]===void 0),l=[],u=e=>{let t=[...new Set(e)];return l.length!==t.length||!t.every(e=>l.includes(e))?(l=t,n.touchedChanged):[]},d={},f=e=>{let t=Bc(e);return wt(d,t)?[]:(d=t,n.errorsChanged)},p=e=>{let t={...d};return delete t[Vc(e)],f(t)},m=()=>Object.keys(d).length>0,h=1500,g=e=>{h=e,S.cancel(),S=x()},_=t,v=null,y=[],b=null,x=()=>_i(t=>{e({get:(e,n={},r={})=>Sc.get(e,T(n),C(r,t,n)),post:(e,n={},r={})=>Sc.post(e,T(n),C(r,t,n)),patch:(e,n={},r={})=>Sc.patch(e,T(n),C(r,t,n)),put:(e,n={},r={})=>Sc.put(e,T(n),C(r,t,n)),delete:(e,n={},r={})=>Sc.delete(e,T(n),C(r,t,n))}).catch(e=>vr(e)||Cr(e)&&e.response?.status===422?null:Promise.reject(e))},h,{leading:!0,trailing:!0}),S=x(),C=(e,t,n={})=>{let r={...e,...t},i=Array.from(r.only??r.validate??l);return{...t,...Ar(e,t),only:i,timeout:r.timeout??5e3,onValidationError:(e,t)=>([...s([...o,...i]),...f(kt(Lc({...d},i),e.data.errors))].forEach(e=>e()),r.onValidationError?r.onValidationError(e,t):Promise.reject(t)),onSuccess:e=>(s([...o,...i]).forEach(e=>e()),r.onSuccess?r.onSuccess(e):e),onPrecognitionSuccess:e=>([...s([...o,...i]),...f(Lc({...d},i))].forEach(e=>e()),r.onPrecognitionSuccess?r.onPrecognitionSuccess(e):e),onBefore:()=>{let e=l.some(e=>e.includes(`*`)),t=e?[...new Set(l.flatMap(e=>Fc(e,n)))]:l;return r.onBeforeValidation&&r.onBeforeValidation({data:n,touched:t},{data:_,touched:y})===!1||(r.onBefore||(()=>
77!0))()===!1?!1:(e&&u(t).forEach(e=>e()),b=l,v=n,!0)},onStart:()=>{a(!0).forEach(e=>e()),(r.onStart??(()=>null))()},onFinish:()=>{a(!1).forEach(e=>e()),y=b,_=v,b=v=null,(r.onFinish??(()=>null))()}}},w=(e,t,n)=>{if(e===void 0){let e=Array.from(n?.only??n?.validate??[]);u([...l,...e]).forEach(e=>e()),S(n??{});return}if(Pc(t)&&!r){console.warn(`Precognition file validation is not active. Call the "validateFiles" function on your form to enable it.`);return}e=Vc(e),(e.includes(`*`)||ui(_,e)!==t)&&(u([e,...l]).forEach(e=>e()),S(n??{}))},T=e=>r===!1?Hc(e):e,E={touched:()=>l,validate(e,t,n){return typeof e==`object`&&!(`target`in e)&&(n=e,e=t=void 0),w(e,t,n),E},touch(e){let t=Array.isArray(e)?e:[Vc(e)];return u([...l,...t]).forEach(e=>e()),E},validating:()=>i,valid:c,errors:()=>d,hasErrors:m,setErrors(e){return f(e).forEach(e=>e()),E},forgetError(e){return p(e).forEach(e=>e()),E},defaults(e){return t=e,_=e,E},reset(...e){if(e.length===0)u([]).forEach(e=>e());else{let n=[...l];e.forEach(e=>{n.includes(e)&&n.splice(n.indexOf(e),1),Ei(_,e,ui(t,e))}),u(n).forEach(e=>e())}return E},setTimeout(e){return g(e),E},on(e,t){return n[e].push(t),E},validateFiles(){return r=!0,E},withoutFileValidation(){return r=!1,E}};return E},zc=e=>Object.keys(e).reduce((t,n)=>({...t,[n]:Array.isArray(e[n])?e[n][0]:e[n]}),{}),Bc=e=>Object.keys(e).reduce((t,n)=>({...t,[n]:typeof e[n]==`string`?[e[n]]:e[n]}),{}),Vc=e=>typeof e==`string`?e:e.target.name,Hc=e=>{let t={...e};return Object.keys(t).forEach(e=>{let n=t[e];if(n!==null){if(Pc(n)){delete t[e];return}if(Array.isArray(n)){t[e]=Object.values(Hc({...n}));return}if(typeof n==`object`){t[e]=Hc(t[e]);return}}}),t},Uc={created(){if(!this.$options.remember)return;Array.isArray(this.$options.remember)&&(this.$options.remember={data:this.$options.remember}),typeof this.$options.remember==`string`&&(this.$options.remember={data:[this.$options.remember]}),typeof this.$options.remember.data==`string`&&(this.$options.remember={data:[this.$options.remember.data]});let e=this.$options.remember.key instanceof Function?this.$options.remember.key.call(this):this.$options.remember.key,t=$.restore(e),n=this.$options.remember.data.filter(e=>this[e]===null||typeof this[e]!=`object`||this[e].__rememberable!==!1),r=e=>this[e]!==null&&typeof this[e]==`object`&&typeof this[e].__remember==`function`&&typeof this[e].__restore==`function`;n.forEach(i=>{this[i]!==void 0&&t!==void 0&&t[i]!==void 0&&(r(i)?this[i].__restore(t[i]):this[i]=t[i]),this.$watch(i,()=>{$.remember(n.reduce((e,t)=>({...e,[t]:Dt(r(t)?this[t].__remember():this[t])}),{}),e)},{immediate:!0,deep:!0})})}},Wc=null,Gc=!1;function Kc(e){if(Gc)return;Wc===null&&(Gc=!0,Wc=new Set(Object.keys(qc({}))),Gc=!1);let t=Object.keys(e).filter(e=>Wc.has(e));t.length>0&&console.error(`[Inertia] useForm() data contains field(s) that conflict with form properties: ${t.map(e=>`"${e}"`).join(`, `)}. These fields will be overwritten by form methods/properties. Please rename these fields.`)}function qc(...e){let{rememberKey:t,data:n,precognitionEndpoint:r}=ps.parseUseFormArguments(...e),i=t?$.restore(t):null,o=Dt(typeof n==`function`?n():n);Kc(o);let s=null,c,l=e=>e,u=null,d=[],f=!1,p=a({...i?i.data:Dt(o),isDirty:!1,errors:i?i.errors:{},hasErrors:!1,processing:!1,progress:null,wasSuccessful:!1,recentlySuccessful:!1,withPrecognition(...e){r=ps.createWayfinderCallback(...e);let t=this,n=null,i=Rc(e=>{let{method:t,url:n}=r(),i=Dt(l(this.data()));return e[t](n,i)},Dt(o));u=i,i.on(`validatingChanged`,()=>{t.validating=i.validating()}).on(`validatedChanged`,()=>{t.__valid=i.valid()}).on(`touchedChanged`,()=>{t.__touched=i.touched()}).on(`errorsChanged`,()=>{let e=n??cl.get(`form.withAllErrors`)?i.errors():zc(i.errors());this.errors={},this.setError(e),t.__valid=i.valid()});let a=(e,t)=>(t(e),e);return Object.assign(t,{__touched:[],__valid:[],validating:!1,validator:()=>i,withAllErrors:()=>a(t,()=>n=!0),valid:e=>t.__valid.includes(e),invalid:e=>e in this.errors,setValidationTimeout:e=>a(t,()=>i.setTimeout(e)),validateFiles:()=>a(t,()=>i.validateFiles()),withoutFileValidation:()=>a(t,()=>i.withoutFileValidation()),touch:(e,...n)=>(Array.isArray(e)?i.touch(e):typeof e==`string`?i.touch([e,...n]):i.touch(e),t),touched:e=>typeof e==`string`?t.__touched.includes(e):t.__touched.length>
770,validate:(e,n)=>{if(typeof e==`object`&&!(`target`in e)&&(n=e,e=void 0),e===void 0)i.validate(n);else{let t=Vc(e),r=l(this.data());i.validate(t,ui(r,t),n)}return t},setErrors:e=>a(t,()=>this.setError(e)),forgetError:e=>a(t,()=>this.clearErrors(Vc(e)))}),t},data(){return Object.keys(o).reduce((e,t)=>Ei(e,t,ui(this,t)),{})},transform(e){return l=e,this},defaults(e,t){if(typeof n==`function`)throw Error("You cannot call `defaults()` when using a function to define your form data.");return f=!0,e===void 0?(o=Dt(this.data()),this.isDirty=!1):o=typeof e==`string`?Ei(Dt(o),e,t):Object.assign({},Dt(o),e),u?.defaults(o),this},reset(...e){let t=Dt(typeof n==`function`?n():o),r=Dt(t);return e.length===0?(o=r,Object.assign(this,t)):e.filter(e=>wi(r,e)).forEach(e=>{Ei(o,e,ui(r,e)),Ei(this,e,ui(t,e))}),u?.reset(...e),this},setError(e,t){let n=typeof e==`string`?{[e]:t}:e;return Object.assign(this.errors,n),this.hasErrors=Object.keys(this.errors).length>0,u?.setErrors(n),this},clearErrors(...e){return this.errors=Object.keys(this.errors).reduce((t,n)=>({...t,...e.length>0&&!e.includes(n)?{[n]:this.errors[n]}:{}}),{}),this.hasErrors=Object.keys(this.errors).length>0,u&&(e.length===0?u.setErrors({}):e.forEach(u.forgetError)),this},resetAndClearErrors(...e){return this.reset(...e),this.clearErrors(...e),this},submit(...e){let{method:t,url:n,options:i}=ps.parseSubmitArguments(e,r);f=!1;let a={...i,onCancelToken:e=>{if(s=e,i.onCancelToken)return i.onCancelToken(e)},onBefore:e=>{if(this.wasSuccessful=!1,this.recentlySuccessful=!1,clearTimeout(c),i.onBefore)return i.onBefore(e)},onStart:e=>{if(this.processing=!0,i.onStart)return i.onStart(e)},onProgress:e=>{if(this.progress=e??null,i.onProgress)return i.onProgress(e)},onSuccess:async e=>{this.processing=!1,this.progress=null,this.clearErrors(),this.wasSuccessful=!0,this.recentlySuccessful=!0,c=setTimeout(()=>this.recentlySuccessful=!1,cl.get(`form.recentlySuccessfulDuration`));let t=i.onSuccess?await i.onSuccess(e):null;return f||(o=Dt(this.data()),this.isDirty=!1),t},onError:e=>{if(this.processing=!1,this.progress=null,this.clearErrors().setError(e),i.onError)return i.onError(e)},onCancel:()=>{if(this.processing=!1,this.progress=null,i.onCancel)return i.onCancel()},onFinish:e=>{if(this.processing=!1,this.progress=null,s=null,i.onFinish)return i.onFinish(e)}},u=l(this.data());t===`delete`?$.delete(n,{...a,data:u}):$[t](n,u,a)},get(e,t){this.submit(`get`,e,t)},post(e,t){this.submit(`post`,e,t)},put(e,t){this.submit(`put`,e,t)},patch(e,t){this.submit(`patch`,e,t)},delete(e,t){this.submit(`delete`,e,t)},cancel(){s&&s.cancel()},dontRemember(...e){return d=e,this},__rememberable:t===null,__remember(){let e=this.data();if(d.length>0){let t={...e};return d.forEach(e=>delete t[e]),{data:t,errors:this.errors}}return{data:e,errors:this.errors}},__restore(e){Object.assign(this,e.data),this.setError(e.errors)}});return ce(p,e=>{p.isDirty=!wt(p.data(),o);let n=$.restore(t),r=Dt(e.__remember());t&&!wt(n,r)&&$.remember(r,t)},{immediate:!0,deep:!0}),r?p.withPrecognition(r):p}var Jc=A(void 0),Yc=A(),Xc=w(null),Zc=A(void 0),Qc,$c=y({name:`Inertia`,props:{initialPage:{type:Object,required:!0},initialComponent:{type:Object,required:!1},resolveComponent:{type:Function,required:!1},titleCallback:{type:Function,required:!1,default:e=>e},onHeadUpdate:{type:Function,required:!1,default:()=>()=>{}}},setup({initialPage:e,initialComponent:t,resolveComponent:n,titleCallback:i,onHeadUpdate:a}){Jc.value=t?Oe(t):void 0,Yc.value={...e,flash:e.flash??{}},Zc.value=void 0;let o=typeof window>`u`;return Qc=xs(o,i||(e=>e),a||(()=>{})),o||($.init({initialPage:e,resolveComponent:n,swapComponent:async e=>{Jc.value=Oe(e.component),Yc.value=e.page,Zc.value=e.preserveState?Zc.value:Date.now()},onFlash:e=>{Yc.value={...Yc.value,flash:e}}}),$.on(`navigate`,()=>Qc.forceUpdate())),()=>{if(Jc.value){Jc.value.inheritAttrs=!!Jc.value.inheritAttrs;let e=r(Jc.value,{...Yc.value.props,key:Zc.value});return Xc.value&&=(Jc.value.layout=Xc.value,null),Jc.value.layout?typeof Jc.value.layout==`function`?Jc.value.layout(r,e):(Array.isArray(Jc.value.layout)?Jc.value.layout:[Jc.value.layout]).concat(e).reverse().reduce((e,t)=>
77(t.inheritAttrs=!!t.inheritAttrs,r(t,{...Yc.value.props},()=>e))):e}}}}),el={install(e){$.form=qc,Object.defineProperty(e.config.globalProperties,"$inertia",{get:()=>$}),Object.defineProperty(e.config.globalProperties,"$page",{get:()=>Yc.value}),Object.defineProperty(e.config.globalProperties,"$headManager",{get:()=>Qc}),e.mixin(Uc)}};function tl(){return a({props:T(()=>Yc.value?.props),url:T(()=>Yc.value?.url),component:T(()=>Yc.value?.component),version:T(()=>Yc.value?.version),clearHistory:T(()=>Yc.value?.clearHistory),deferredProps:T(()=>Yc.value?.deferredProps),mergeProps:T(()=>Yc.value?.mergeProps),prependProps:T(()=>Yc.value?.prependProps),deepMergeProps:T(()=>Yc.value?.deepMergeProps),matchPropsOn:T(()=>Yc.value?.matchPropsOn),rememberedState:T(()=>Yc.value?.rememberedState),encryptHistory:T(()=>Yc.value?.encryptHistory),scrollProps:T(()=>Yc.value?.scrollProps),flash:T(()=>Yc.value?.flash)})}async function nl({id:e=`app`,resolve:t,setup:n,title:i,progress:a={},page:o,render:s,defaults:c={}}){cl.replace(c);let l=typeof window>`u`,u=cl.get(`future.useScriptElementForInitialPage`),d=o||ko(e,u),f=e=>Promise.resolve(t(e)).then(e=>e.default||e),p=[],m=await Promise.all([f(d.component),$.decryptHistory().catch(()=>{})]).then(([t])=>{let r={initialPage:d,initialComponent:t,resolveComponent:f,titleCallback:i};return n(l?{el:null,App:$c,props:{...r,onHeadUpdate:e=>p=e},plugin:el}:{el:document.getElementById(e),App:$c,props:r,plugin:el})});if(!l&&a&&uc(a),l&&s){let t=()=>u?[r(`script`,{"data-page":e,type:`application/json`,innerHTML:JSON.stringify(d).replace(/\//g,`\\/`)}),r(`div`,{id:e,innerHTML:m?s(m):``})]:r(`div`,{id:e,"data-page":JSON.stringify(d),innerHTML:m?s(m):``}),n=await s(ge({render:()=>t()}));return{head:p,body:n}}}y({name:`Deferred`,props:{data:{type:[String,Array],required:!0}},render(){let e=Array.isArray(this.$props.data)?this.$props.data:[this.$props.data];if(!this.$slots.fallback)throw Error("`<Deferred>` requires a `<template #fallback>` slot");return e.every(e=>this.$page.props[e]!==void 0)?this.$slots.default?.():this.$slots.fallback()}});var rl=()=>void 0,il=Symbol(`InertiaFormContext`);y({name:`Form`,slots:Object,props:{action:{type:[String,Object],default:``},method:{type:String,default:`get`},headers:{type:Object,default:()=>({})},queryStringArrayFormat:{type:String,default:`brackets`},errorBag:{type:[String,null],default:null},showProgress:{type:Boolean,default:!0},transform:{type:Function,default:e=>e},options:{type:Object,default:()=>({})},resetOnError:{type:[Boolean,Array],default:!1},resetOnSuccess:{type:[Boolean,Array],default:!1},setDefaultsOnSuccess:{type:Boolean,default:!1},onCancelToken:{type:Function,default:rl},onBefore:{type:Function,default:rl},onStart:{type:Function,default:rl},onProgress:{type:Function,default:rl},onFinish:{type:Function,default:rl},onCancel:{type:Function,default:rl},onSuccess:{type:Function,default:rl},onError:{type:Function,default:rl},onSubmitComplete:{type:Function,default:rl},disableWhileProcessing:{type:Boolean,default:!1},invalidateCacheTags:{type:[String,Array],default:()=>[]},validateFiles:{type:Boolean,default:!1},validationTimeout:{type:Number,default:1500},withAllErrors:{type:Boolean,default:null}},setup(e,{slots:t,attrs:n,expose:i}){let a=()=>{let[t,n]=h();return e.transform(n)},o=qc({}).withPrecognition(()=>c.value,()=>h()[0]).transform(a).setValidationTimeout(e.validationTimeout);e.validateFiles&&o.validateFiles(),(e.withAllErrors??Ga.get(`form.withAllErrors`))&&o.withAllErrors();let s=A(),c=T(()=>Ko(e.action)?e.action.method:e.method.toLowerCase()),l=A(!1),u=A(new FormData),d=e=>{e.type===`reset`&&e.detail?.[dc]&&e.preventDefault(),l.value=e.type!==`reset`&&!wt(m(),ys(u.value))},f=[`input`,`change`,`reset`];I(()=>{u.value=p(),o.defaults(m()),f.forEach(e=>s.value.addEventListener(e,d))}),ce(()=>e.validateFiles,e=>e?o.validateFiles():o.withoutFileValidation()),ce(()=>e.validationTimeout,e=>o.setValidationTimeout(e)),_(()=>f.forEach(e=>s.value?.removeEventListener(e,d)));let p=e=>new FormData(s.value,e),m=e=>ys(p(e)),h=t=>Vo(c.value,Ko(e.action)?e.action.url:e.action,m(t),e.queryStringArrayFormat),g=t=>{let[n,r]=h(t);if(t?.getAttribute(`formtarget`)===`_blank`&&c.value===`get`){window.open(n,`_blank`);return}let i=e=>{e&&(e===!0?v():e.length>0&&v(...e))},s={headers:e.headers,queryStringArrayFormat:e.queryStringArrayFormat,errorBag:e.errorBag,showProgress:e.showProgress,invalidateCacheTags:e.invalidateCacheTags,onCancelToken:e.onCancelToken,onBefore:e.onBefore,onStart:e.onStart,onProgress:e.onProgress,onFinish:e.onFinish,onCancel:e.onCancel,onSuccess:(...t)=>{e.onSuccess?.(...t),e.onSubmitComplete?.(S),i(e.resetOnSuccess),e.setDefaultsOnSuccess===!0&&x()},onError:(...t)=>{e.onError?.(...t),i(e.resetOnError)},...e.options};o.transform(()=>
77e.transform(r)).submit(c.value,n,s),o.transform(a)},v=(...e)=>{_c(s.value,u.value,e),o.reset(...e)},y=(...e)=>{o.clearErrors(...e)},b=(...e)=>{y(...e),v(...e)},x=()=>{u.value=p(),l.value=!1},S={get errors(){return o.errors},get hasErrors(){return o.hasErrors},get processing(){return o.processing},get progress(){return o.progress},get wasSuccessful(){return o.wasSuccessful},get recentlySuccessful(){return o.recentlySuccessful},get validating(){return o.validating},clearErrors:y,resetAndClearErrors:b,setError:(e,t)=>o.setError(typeof e==`string`?{[e]:t}:e),get isDirty(){return l.value},reset:v,submit:g,defaults:x,getData:m,getFormData:p,touch:o.touch,valid:o.valid,invalid:o.invalid,touched:o.touched,validate:(t,n)=>o.validate(...ps.mergeHeadersForValidation(t,n,e.headers)),validator:()=>o.validator()};return i(S),le(il,S),()=>r(`form`,{...n,ref:s,action:Ko(e.action)?e.action.url:e.action,method:c.value,onSubmit:e=>{e.preventDefault(),g(e.submitter)},inert:e.disableWhileProcessing&&o.processing},t.default?t.default(S):[])}});var al=y({props:{title:{type:String,required:!1}},data(){return{provider:this.$headManager.createProvider()}},beforeUnmount(){this.provider.disconnect()},methods:{isUnaryTag(e){return typeof e.type==`string`&&[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`].indexOf(e.type)>-1},renderTagStart(e){e.props=e.props||{},e.props[this.provider.preferredAttribute()]=e.props[`head-key`]===void 0?``:e.props[`head-key`];let t=Object.keys(e.props).reduce((t,n)=>{let r=String(e.props[n]);return[`key`,`head-key`].includes(n)?t:r===``?t+` ${n}`:t+` ${n}="${xi(r)}"`},``);return`<${String(e.type)}${t}>`},renderTagChildren(e){let{children:t}=e;return typeof t==`string`?t:Array.isArray(t)?t.reduce((e,t)=>e+this.renderTag(t),``):``},isFunctionNode(e){return typeof e.type==`function`},isComponentNode(e){return typeof e.type==`object`},isCommentNode(e){return/(comment|cmt)/i.test(e.type.toString())},isFragmentNode(e){return/(fragment|fgt|symbol\(\))/i.test(e.type.toString())},isTextNode(e){return/(text|txt)/i.test(e.type.toString())},renderTag(e){if(this.isTextNode(e))return String(e.children);if(this.isFragmentNode(e)||this.isCommentNode(e))return``;let t=this.renderTagStart(e);return e.children&&(t+=this.renderTagChildren(e)),this.isUnaryTag(e)||(t+=`</${String(e.type)}>`),t},addTitleElement(e){return this.title&&!e.find(e=>e.startsWith(`<title`))&&e.push(`<title ${this.provider.preferredAttribute()}>${xi(this.title)}</title>`),e},renderNodes(e){let t=e.flatMap(e=>this.resolveNode(e)).map(e=>this.renderTag(e)).filter(e=>e);return this.addTitleElement(t)},resolveNode(e){return this.isFunctionNode(e)?this.resolveNode(e.type()):this.isComponentNode(e)?(console.warn(`Using components in the <Head> component is not supported.`),[]):this.isTextNode(e)&&e.children?e:this.isFragmentNode(e)&&e.children?e.children.flatMap(e=>this.resolveNode(e)):this.isCommentNode(e)?[]:e}},render(){this.provider.update(this.renderNodes(this.$slots.default?this.$slots.default():[]))}}),ol=(e,t)=>e?typeof e==`string`?document.querySelector(e):typeof e==`function`?e()||null:t:t;y({name:`InfiniteScroll`,slots:Object,props:{data:{type:String,required:!0},buffer:{type:Number,default:0},onlyNext:{type:Boolean,default:!1},onlyPrevious:{type:Boolean,default:!1},as:{type:String,default:`div`},manual:{type:Boolean,default:!1},manualAfter:{type:Number,default:0},preserveUrl:{type:Boolean,default:!1},reverse:{type:Boolean,default:!1},autoScroll:{type:Boolean,default:void 0},itemsElement:{type:[String,Function,Object],default:null},startElement:{type:[String,Function,Object],default:null},endElement:{type:[String,Function,Object],default:null}},inheritAttrs:!1,setup(e,{slots:t,attrs:n,expose:i}){let a=A(null),o=A(null),s=A(null),c=T(()=>ol(e.itemsElement,a.value)),l=T(()=>Eo(c.value)),u=T(()=>ol(e.startElement,o.value)),d=T(()=>ol(e.endElement,s.value)),f=A(!1),p=A(!1),m=A(0),h=A(!1),g=A(!1),_=()=>{m.value=v.getRequestCount(),h.value=v.hasPrevious(),g.value=v.hasNext()},{dataManager:v,elementManager:y,flush:b}=Fs({getPropName:()=>e.data,inReverseMode:()=>e.reverse,shouldFetchNext:()=>!e.onlyPrevious,shouldFetchPrevious:()=>!e.onlyNext,shouldPreserveUrl:()=>e.preserveUrl,getTriggerMargin:()=>e.buffer,getStartElement:()=>u.value,getEndElement:()=>d.value,getItemsElement:()=>c.value,getScrollableParent:()=>l.value,onBeforePreviousRequest:()=>f.value=!0,onBeforeNextRequest:()=>p.value=!0,onCompletePreviousRequest:({completed:e})=>{f.value=!1,e&&_()},onCompleteNextRequest:({completed:e})=>{p.value=!1,e&&_()},onDataReset:_});if(_(),typeof window>`u`){let t=tl().scrollProps?.[e.data];t&&(h.value=!!t.previousPage,g.value=!!t.nextPage)}let x=T(()=>!S.value),S=T(()=>e.manual||e.manualAfter>0&&m.value>=e.manualAfter),C=()=>{l.value?l.value.scrollTo({top:l.value.scrollHeight,behavior:`instant`}):window.scrollTo({top:document.body.scrollHeight,behavior:`instant`})};return I(()=>{y.setupObservers(),y.processServerLoadedElements(v.getLastLoadedPage()),(e.autoScroll===void 0?e.reverse:e.autoScroll)&&C(),x.value&&y.enableTriggers()}),L(b),ce(()=>[x.value,e.onlyNext,e.onlyPrevious],([e])=>{e?y.enableTriggers():y.disableTriggers()}),i({fetchNext:v.fetchNext,fetchPrevious:v.fetchPrevious,hasPrevious:v.hasPrevious,hasNext:v.hasNext}),()=>{let i=[],c={loadingPrevious:f.value,loadingNext:p.value,hasPrevious:h.value,hasNext:g.value};if(!e.startElement){let n=x.value&&!e.onlyNext,a={loading:f.value,fetch:v.fetchPrevious,autoMode:n,manualMode:!n,hasMore:h.value,...c};
77i.push(r(`div`,{ref:o},t.previous?t.previous(a):f.value?t.loading?.(a):void 0))}if(i.push(r(e.as,{...n,ref:a},t.default?.({loading:f.value||p.value,loadingPrevious:f.value,loadingNext:p.value}))),!e.endElement){let n=x.value&&!e.onlyPrevious,a={loading:p.value,fetch:v.fetchNext,autoMode:n,manualMode:!n,hasMore:g.value,...c};i.push(r(`div`,{ref:s},t.next?t.next(a):p.value?t.loading?.(a):void 0))}return r(q,{},e.reverse?[...i].reverse():i)}}});var sl=()=>{};y({name:`Link`,props:{as:{type:[String,Object],default:`a`},data:{type:Object,default:()=>({})},href:{type:[String,Object],default:``},method:{type:String,default:`get`},replace:{type:Boolean,default:!1},preserveScroll:{type:[Boolean,String,Function],default:!1},preserveState:{type:[Boolean,String,Function],default:null},preserveUrl:{type:Boolean,default:!1},only:{type:Array,default:()=>[]},except:{type:Array,default:()=>[]},headers:{type:Object,default:()=>({})},queryStringArrayFormat:{type:String,default:`brackets`},async:{type:Boolean,default:!1},prefetch:{type:[Boolean,String,Array],default:!1},cacheFor:{type:[Number,String,Array],default:0},onStart:{type:Function,default:sl},onProgress:{type:Function,default:sl},onFinish:{type:Function,default:sl},onBefore:{type:Function,default:sl},onCancel:{type:Function,default:sl},onSuccess:{type:Function,default:sl},onError:{type:Function,default:sl},onCancelToken:{type:Function,default:sl},onPrefetching:{type:Function,default:sl},onPrefetched:{type:Function,default:sl},cacheTags:{type:[String,Array],default:()=>[]},viewTransition:{type:[Boolean,Object],default:!1}},setup(e,{slots:t,attrs:n}){let i=A(0),a=A(),o=T(()=>e.prefetch===!0?[`hover`]:e.prefetch===!1?[]:Array.isArray(e.prefetch)?e.prefetch:[e.prefetch]),s=T(()=>e.cacheFor===0?o.value.length===1&&o.value[0]===`click`?0:cl.get(`prefetch.cacheFor`):e.cacheFor);I(()=>{o.value.includes(`mount`)&&g()}),L(()=>{clearTimeout(a.value)});let c=T(()=>Ko(e.href)?e.href.method:(e.method??`get`).toLowerCase()),l=T(()=>typeof e.as!=`string`||e.as.toLowerCase()!==`a`?e.as:c.value===`get`?e.as.toLowerCase():`button`),u=T(()=>Vo(c.value,Ko(e.href)?e.href.url:e.href,e.data||{},e.queryStringArrayFormat)),d=T(()=>u.value[0]),f=T(()=>u.value[1]),p=T(()=>l.value===`button`?{type:`button`}:l.value===`a`||typeof l.value!=`string`?{href:d.value}:{}),m=T(()=>({data:f.value,method:c.value,replace:e.replace,preserveScroll:e.preserveScroll,preserveState:e.preserveState??c.value!==`get`,preserveUrl:e.preserveUrl,only:e.only,except:e.except,headers:e.headers,async:e.async})),h=T(()=>({...m.value,viewTransition:e.viewTransition,onCancelToken:e.onCancelToken,onBefore:e.onBefore,onStart:t=>{i.value++,e.onStart?.(t)},onProgress:e.onProgress,onFinish:t=>{i.value--,e.onFinish?.(t)},onCancel:e.onCancel,onSuccess:e.onSuccess,onError:e.onError})),g=()=>{$.prefetch(d.value,{...m.value,onPrefetching:e.onPrefetching,onPrefetched:e.onPrefetched},{cacheFor:s.value,cacheTags:e.cacheTags})},_={onClick:e=>{Ls(e)&&(e.preventDefault(),$.visit(d.value,h.value))}},v={onMouseenter:()=>{a.value=setTimeout(()=>{g()},cl.get(`prefetch.hoverDelay`))},onMouseleave:()=>{clearTimeout(a.value)},onClick:_.onClick},y={onMousedown:e=>{Ls(e)&&(e.preventDefault(),g())},onKeydown:e=>{Rs(e)&&(e.preventDefault(),g())},onMouseup:e=>{Ls(e)&&(e.preventDefault(),$.visit(d.value,h.value))},onKeyup:e=>{Rs(e)&&(e.preventDefault(),$.visit(d.value,h.value))},onClick:e=>{Ls(e)&&e.preventDefault()}};return()=>r(l.value,{...n,...p.value,"data-loading":i.value>0?``:void 0,...o.value.includes(`hover`)?v:o.value.includes(`click`)?y:_},t)}}),y({name:`WhenVisible`,slots:Object,props:{data:{type:[String,Array]},params:{type:Object},buffer:{type:Number,default:0},as:{type:String,default:`div`},always:{type:Boolean,default:!1}},data(){return{loaded:!1,fetching:!1,observer:null}},unmounted(){this.observer?.disconnect()},computed:{keys(){return this.data?Array.isArray(this.data)?this.data:[this.data]:[]}},created(){let e=tl();this.$watch(()=>this.keys.map(t=>e.props[t]),()=>{let t=this.keys.length>0&&this.keys.every(t=>e.props[t]!==void 0);this.loaded=t,!(t&&!this.always)&&(!this.observer||!t)&&this.$nextTick(this.registerObserver)},{immediate:!0})},methods:{registerObserver(){typeof window>`u`||(this.observer?.disconnect(),this.observer=new IntersectionObserver(e=>{if(!e[0].isIntersecting||this.fetching||!this.always&&this.loaded)return;this.fetching=!0;let t=this.getReloadParams();$.reload({...t,onStart:e=>{this.fetching=!0,t.onStart?.(e)},onFinish:e=>{this.loaded=!0,this.fetching=!1,t.onFinish?.(e),this.always||this.observer?.disconnect()}})},{rootMargin:`${this.$props.buffer}px`}),this.observer.observe(this.$el.nextSibling))},getReloadParams(){let e={...this.$props.params};return this.$props.data&&(e.only=Array.isArray(this.$props.data)?this.$props.data:[this.$props.data]),e}},render(){let e=[];return(this.$props.always||!this.loaded)&&e.push(r(this.$props.as)),this.loaded?this.$slots.default&&e.push(this.$slots.default({fetching:this.fetching})):e.push(this.$slots.fallback?this.$slots.fallback({}):null),e}});var cl=Ga.extend({}),ll=p({default:()=>hl}),ul=Fe(),dl={role:`tabpanel`},fl={key:0,class:`mt-3 hidden w-[300px] min-w-[300px] shrink-0 grow-0 basis-[300px] flex-col gap-6 lg:flex`},pl={class:`hidden min-w-[300px] lg:block lg:flex-1`},ml={class:`sticky top-[130px] lg:top-3`},hl={__name:`PageHome`,props:{initUrl:{type:String,default:void 0},initItems:{type:Array,default:void 0},prevUrl:{type:String,default:void 0},inserts:{type:Array,default:()=>[]}},setup(n){let r=n,{isPremium:i}=Ze(),{greaterOrEqual:a}=$e(),o=a(`lg`),s=T(()=>
77!g||o.value),c=we(`mpu2`);I(()=>{let e=c.value?.$el;e?.style&&(e.style.maxHeight=e.clientHeight+`px`)});let u=Zi.filter(e=>e.meta?.title),d=nn(),f=T(()=>d.name===`featured`),p=T(()=>r.inserts.filter(e=>e.type===`content_list`).map((e,t)=>({...e,index:t+1}))),_=T(()=>r.inserts.find(e=>e.type===`start_thread_cta`)),v=T(()=>r.inserts.find(e=>e.type===`link_grid`)),y=T(()=>r.inserts.find(e=>e.type===`carousel`)),b=e=>{if(e<12){let t={3:0,7:1,11:2}[e]??void 0;return t===void 0?void 0:p.value[t]}if(e-=12,(e+1)%5==0)return p.value[(e+1)/5+2]},{survey:x,surveyPosition:w,fetchSurvey:D,isSuppressedBySurvey:O,shouldShowSurvey:k}=bn(`homepage_feed`,4);I(()=>{ce(f,e=>{e&&!x.value&&D()},{immediate:!0})});let A=We(`homepage-feed-ads`),M=e=>{if(!A||e===0||O(e))return;let t;if(e<12&&(e+1)%4==0)t=(0,ul.clamp)((e+1)/4,1,6);else{let n=e-12;if(n<0||(n+1)%5!=0)return;t=(0,ul.clamp)((n+1)/5+3,1,6)}return x.value&&e>w.value&&(t=Math.max(t-1,1)),t},ee=e=>{if(!(s.value||e===0))return{1:1,7:2,11:3}[e]??void 0};return(n,a)=>{let d=xe(`RouterLink`),p=xe(`RouterView`),g=fe(`icon`);return e(),S(`main`,{id:`main-content`,ref:`root`,"data-id":`side-rail-container`,class:m([`pointer-events-auto relative mx-auto flex max-w-2xl grow flex-col gap-4 bg-gray-100 pb-4 lg:container sm:px-4 lg:max-w-reskin lg:flex-row lg:gap-6`,{"max-lg:scroll-mt-28":!E(i)}])},[h(E(al),{title:n.$route.meta?.title||`Home`},null,8,[`title`]),h(E(Vi),{as:`section`,class:`min-w-0 shrink grow basis-0`,"activation-mode":`manual`},{default:G(()=>[h(E(Wi),{class:`mb-1.5 flex items-center space-x-2 bg-white [scrollbar-width:none] max-md:overflow-x-auto max-sm:h-12 max-sm:border-b max-sm:px-4 sm:my-2 sm:bg-transparent sm:max-lg:max-w-2xl dark:md:bg-transparent md:max-lg:mx-auto lg:mt-3`},{default:G(()=>[(e(!0),S(q,null,Ce(E(u),n=>(e(),t(E(Gi),{key:n.name,value:n.name,"as-child":``},{default:G(()=>[h(d,{to:{name:n.name},custom:``},{default:G(({isActive:t,navigate:r})=>[h(E(X),{variant:t?`tab`:`gray`,class:m([`text-nowrap`,{"gap-1":n.name===`shopping`}]),role:`tab`,onClick:r},{default:G(()=>[l(J(n.meta.title)+` `,1),n.name===`shopping`?V((e(),S(`i`,{key:0,class:m([`flex aspect-1 size-4 shrink-0`,{"text-pink-500":!t}])},null,2)),[[g,{icon:`sparkles-solid`,classes:`before:size-4`}]]):U(``,!0)]),_:2},1032,[`variant`,`class`,`onClick`])]),_:2},1032,[`to`])]),_:2},1032,[`value`]))),128))]),_:1}),W(`div`,dl,[h(p,null,{default:G(({Component:i})=>[(e(),t(j,null,[(e(),t(ne(i),{class:`min-w-0 shrink grow basis-0 max-md:gap-1.5 max-sm:[&>[data-feed-insert]]:border-x-0 max-sm:[&>[data-feed-item]]:border-x-0`,"init-url":f.value?r.initUrl??n.$route.meta.initUrl:n.$route.meta.initUrl,"init-items":f.value?r.initItems:[],"prev-url":f.value?r.prevUrl:void 0,"ad-slot-name-suffix":`_home`,"item-tracking-event-prefix":`homepage_`,"item-tracking-click-id-prefix":`${n.$route.name}-`,"disable-feed-ads":!E(A)},C({_:2},[f.value?{name:`after-item`,fn:G(({index:n,item:r})=>[y.value&&n===1?(e(),t(E(xn),{key:0,carousel:y.value},null,8,[`carousel`])):U(``,!0),!E(o)&&n===1?(e(),t(Un,{key:1,class:`h-[428px] rounded-xl border bg-card text-card-foreground ring-offset-background`})):U(``,!0),ee(n)?(e(),t(Pn,{key:2,"slot-id":`mn-mpu-${ee(n)}`,"slot-name":`m_home_mpu${ee(n)}`,sizes:[[300,250],[300,600],[160,600]],device:`mobile`,sticky:``},null,8,[`slot-id`,`slot-name`])):U(``,!0),!E(o)&&n===1?(e(),t(Bn,{key:3,class:`h-[428px] rounded-xl border bg-card text-card-foreground ring-offset-background`})):U(``,!0),b(n)?(e(),t(E(Dn),{key:4,list:b(n),"item-tracking-event":`content_block_${b(n).index}_engagement`},null,8,[`list`,`item-tracking-event`])):U(``,!0),M(n)?(e(),t(E(kn),{key:5,index:M(n),"slot-name-suffix":`_home`,"
77slot-id":E(rt)(r.id)},null,8,[`index`,`slot-id`])):U(``,!0),_.value&&n===5?(e(),t(E(wn),{key:6,cta:_.value},null,8,[`cta`])):U(``,!0),n===11?(e(),t(E(En),{key:7,list:v.value},null,8,[`list`])):U(``,!0),E(k)(n)?(e(),t(_n,{key:8,survey:E(x),"feed-type":`homepage`},null,8,[`survey`])):U(``,!0)]),key:`0`}:void 0]),1032,[`init-url`,`init-items`,`prev-url`,`item-tracking-click-id-prefix`,`disable-feed-ads`]))],1024))]),_:1})])]),_:1}),s.value?(e(),S(`aside`,fl,[h(p,{name:`sidebar-primary`},{default:G(({Component:n})=>[(e(),t(j,null,[(e(),t(ne(n),{class:`h-[428px] shrink-0`}))],1024))]),_:1}),h(Pn,{as:`div`,"slot-id":`mn-mpu-1`,"slot-name":`m_home_mpu1`,sizes:[[300,250],[300,600],[160,600]],device:`desktop`,sticky:``}),h(p,{name:`sidebar-secondary`},{default:G(({Component:n})=>[(e(),t(j,null,[(e(),t(ne(n),{class:`h-[428px] shrink-0`}))],1024))]),_:1}),h(Pn,{ref_key:`mpu2`,ref:c,as:`div`,"slot-id":`mn-mpu-2`,"slot-name":`m_home_mpu2`,sizes:[[300,250],[300,600],[160,600]],device:`desktop`,sticky:``,"sticky-full-height":``,"sticky-tall":``},null,512),W(`div`,pl,[W(`div`,ml,[h(Pn,{as:`div`,"slot-id":`mn-mpu-3`,"slot-name":`m_home_mpu3`,sizes:[[300,250],[300,600],[160,600]],device:`desktop`}),h(Pn,{as:`div`,"slot-id":`mn-mpu-4`,"slot-name":`m_home_mpu4`,sizes:[[300,250]],device:`desktop`,class:`mt-2`})])])])):U(``,!0)],2)}}},[gl,_l]=u((e={})=>{let{container:t,childSelector:n,items:r,fetchStart:i,fetchEnd:a,fetchItem:o,scrollToStart:s,scrollToEnd:c,scrollToItem:l}=e,{isLoading:u,executeImmediate:f}=se(()=>i?i():Promise.resolve(),null,{immediate:!1}),{isLoading:p,executeImmediate:m}=se(()=>a?a():Promise.resolve(),null,{immediate:!1}),{isLoading:h,executeImmediate:g}=se((...e)=>o?o(...e):Promise.resolve(),null,{immediate:!1}),_=T(()=>u.value||p.value||h.value),v=jt(),y=async(e={})=>s?s({execFetchStart:f,items:x(r)},e):(e.source??=`useFeed:scrollToStart`,i&&(await f(),await d()),S(x(r)[0],e)),b=async(e={})=>{if(c)return c({execFetchEnd:m,items:x(r)},e);e.source??=`useFeed:scrollToEnd`,a&&(await m(),await d());let t=x(r);return S(t[t.length-1],e)},S=async(e,t={})=>{if(l)return l({execFetchItem:g,items:x(r)},e,t);t.source??=`useFeed:scrollToItem`;let n=x(r).find(({id:t,posinset:n})=>t===e.id||n===e.posinset);if(!n&&o&&(n=await g(e)),n)return await C(n,t)},C=async(e,n)=>{let r=x(t)?.querySelector(`[data-feed-item="${e.post_type??e.type}:${e.id}"]`);if(!r)return e;let i=Object.assign({block:`center`,behavior:`auto`,source:`useFeed:scrollToItem`},n);return v.scrollIntoView(r,i),(i.behavior===`smooth`||i.behavior===`auto`&&v.autoScrollBehavior===`smooth`)&&await Ie(H,`scrollend`),r.focus({focusVisible:!1}),e},{stop:w}=Cn(t,{childSelector:n});return{container:B(t)?t:A(t),items:B(r)?r:A(r),isFetchingItem:h,isFetchingStart:u,isFetchingEnd:p,isFetching:_,scrollToStart:y,scrollToEnd:b,scrollToItem:S,stop:()=>w()}});function vl(){let e=_l();if(!e)throw Error(`useFeed must be used within a <Feed />`);return e}var yl={__name:`BackToTopButton`,setup(t){let{scrollToStart:n,isFetchingStart:r}=vl();return(t,i)=>{let a=fe(`icon`);return V((e(),S(`button`,{class:`dark-override-text-white dark-override-bg-gray-700 ml-auto flex h-10 cursor-pointer items-center justify-center space-x-2 rounded-full bg-gray-200 px-6 py-2 text-center text-sm font-medium text-blue-800 transition duration-200 ease-in hover:bg-gray-300 focus:outline-none dark:hover:bg-gray-800`,onClick:i[0]||=(...e)=>E(n)&&E(n)(...e)},[...i[1]||=[l(` Back to top `,-1)]])),[[a,{icon:`arrow-up-long`,classes:`before:w-4 before:h-4 before:mr-2`,loading:E(r)}]])}}},bl=[`disabled`,`aria-label`,`aria-expanded`],xl=4e3,Sl=3,Cl=Object.assign({inheritAttrs:!1},{__name:`FeedProgressCounter`,props:M({boundary:{type:g?HTMLElement:Object,default:void 0},disabled:{type:Boolean,default:!1},posinset:{type:Number,default:void 0},setsize:{type:Number,default:void 0},min:{type:Number,default:void 0},max:{type:Number,default:void 0},class:{type:[String,Array,Object],default:void 0}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(n){let r=oe(n,`modelValue`),i=n,{isScrolling:a}=jt(),{isScrolling:o}=ee(),c=$e().smaller(`lg`),{scrollToItem:u}=vl(),d=we(`root`),f=w(!1);I(()=>setTimeout(()=>f.value=!0,150)),L(()=>f.value=!1);let p=w(!1),m=T(()=>c.value?`#mobile-nav-portal`:`body`),g=T(()=>i.setsize>1?`${i.posinset??0}/${i.setsize}`:`${i.posinset??0}`),_=T(()=>i.min??1),v=T(()=>i.max??i.setsize),y=i.posinset??0,b,x=he(()=>i.boundary??d.value?.parentElement),C=T(()=>(x?.left?.value??0)+`px`),D=()=>f.value&&!i.disabled&&!a.value&&i.posinset!==void 0&&i.setsize!==void 0&&i.posinset>_.value&&v.value>i.posinset&&(!i.boundary||x.bottom.value>H.innerHeight),k=()=>{r.value=!1,y=i.posinset};ce(()=>[i.disabled,a.value],k),ce(()=>[i.posinset,i.setsize,o.value],()=>{if(clearTimeout(b),!D())return k();r.value||=i.posinset>_.value&&i.posinset<v.value&&Math.abs(y-i.posinset)>=Sl,!o.value&&(b=setTimeout(k,xl))}),ce(x.bottom,(0,ul.throttle)(()=>{D()||k()},100));let A=T(()=>Re(i.setsize>=37,()=>Array.from({length:Math.ceil(i.setsize/25)-1},(e,t)=>
77({number:t+1,label:`${((t+1)*25).toLocaleString()} / ${i.setsize.toLocaleString()}`,isLoading:!1})),[])),j=ct(`progress-counter-initial-click`),M=()=>{A.value.length&&(j(()=>nt(null,`thread-progress-counter:initial-click`)),p.value||nt(null,`thread-progress-counter:open`),p.value=!p.value)},N=w(null),P=e=>async t=>{t.preventDefault();let n=e.number*25;N.value=e.number,nt(null,`thread-progress-counter:jump-to-${n}`,e.label);let r=await Pe(u({posinset:n},{behavior:`smooth`,focusVisible:!1}));if(N.value=null,p.value=!1,r){let e=`${r.post_type??r.type}:${r.id}`;Wn(e).highlight()}};return qn([`Meta+J`,`Ctrl+J`],M),L(()=>clearTimeout(b)),(a,o)=>{let c=fe(`icon`);return e(),S(q,null,[(e(),t(s,{to:m.value},[h(de,{"enter-from-class":`opacity-0`,"leave-to-class":`opacity-0`,"appear-active-class":`pointer-events-none`},{default:G(()=>[r.value&&n.posinset>0||p.value?(e(),S(`button`,F({key:0,ref_key:`root`,ref:d,type:`button`,disabled:!A.value.length,class:E(tt)(`fixed z-20 flex cursor-pointer select-none items-center rounded-full bg-purple-600 px-3.5 py-2 text-sm font-bold tabular-nums text-white transition-[opacity] duration-700 ease-in-out will-change-[opacity,transform] disabled:cursor-default`,`absolute -top-2.5 ml-2.5 -translate-y-full`,`lg:fixed lg:bottom-0 lg:top-auto lg:mb-5 lg:ml-5 lg:translate-y-0`,i.class),style:{left:C.value},"aria-label":`Jump to a different page in this thread (currently post ${g.value})`,"aria-expanded":p.value,"aria-haspopup":`menu`},a.$attrs,{onClick:M}),` Post `+J(g.value),17,bl)):U(``,!0)]),_:1})],8,[`to`])),A.value.length?(e(),t(E(fn),{key:0,open:p.value,"onUpdate:open":o[1]||=e=>p.value=e,modal:!1},{default:G(()=>[h(E(Xt),{class:`w-52 p-5`,align:`start`,reference:a.$refs.root},{default:G(()=>[p.value?(e(),t(E(hn),{key:0,to:`body`},{default:G(()=>[...o[2]||=[W(`div`,{class:`fixed inset-0 z-30 bg-black/30`},null,-1)]]),_:1})):U(``,!0),h(E(tn),{class:`pt-0 text-center`},{default:G(()=>[o[3]||=l(` Jump to post `,-1),V(h(E(X),{variant:`ghost`,class:`absolute right-4 top-3.5 border-0 p-2 text-primary hover:bg-inherit hover:text-blue-900 dark:text-white dark:hover:text-blue-500`,"aria-label":`Close menu`,"data-click-id":`thread-progress-counter:close`,onClick:o[0]||=e=>p.value=!1},null,512),[[c,{icon:`xmark`,classes:`before:size-5 shrink-0`}]])]),_:1}),W(`div`,{class:`max-h-32 overflow-auto`,style:O({scrollbarColor:`${E(et).theme.colors.zinc[300]} transparent`,scrollbarWidth:`thin`})},[(e(!0),S(q,null,Ce(A.value,n=>V((e(),t(E(Y),{key:n.number,class:`py-1.5`,onSelect:e=>P(n)(e)},{default:G(()=>[l(J(n.label),1)]),_:2},1032,[`onSelect`])),[[c,E(Re)(N.value,()=>({position:`after`,classes:`after:size-4 after:shrink-0`,loading:n.number===N.value}))]])),128))],4)]),_:1},8,[`reference`])]),_:1},8,[`open`])):U(``,!0)],64)}}}),wl=[`href`,`data-click-id`,`aria-label`],Tl={__name:`IconButton`,props:{link:{type:String,required:!0},dataClickId:{type:String,default:null},label:{type:String,required:!0},icon:{type:String,required:!0}},setup(t){let n=t;return(t,r)=>{let i=fe(`icon`);return V((e(),S(`a`,{class:`flex cursor-pointer items-center justify-center overflow-visible rounded-full bg-gray-200 p-2 text-blue-700 transition duration-200 ease-in hover:bg-blue-600 hover:text-white focus:bg-blue-600 focus:outline-none dark:text-blue-500 dark:hover:bg-blue-600 dark:hover:text-white dark:focus:bg-blue-600`,href:n.link,"data-click-id":n.dataClickId,"aria-label":n.label},null,8,wl)),[[i,{icon:n.icon,classes:`before:w-6 before:h-6`}]])}}},El=(e,t)=>{let n=e.getAttribute(`aria-${t}`);if(!n)return null;let r=Number.parseInt(n,10);return Number.isFinite(r)?r:null},Dl=(e,t={})=>{let{root:n,rootMargin:r,threshold:a=[0,.01,.5,1],itemSelector:o=`article, [role=article]`,onChange:s=(e,t)=>{}}=t,c=w(),l=w(),u=f(()=>e,()=>{let t=x(e)?.querySelectorAll(o);return t?Array.from(t):[]}),d=T(()=>{if(u.value.length)return u.value.reduce((e,t)=>{let n=El(t,`posinset`);return n===null?e:Math.min(e,n)},2**53-1)}),p=T(()=>{if(u.value.length)return u.value.reduce((e,t)=>{let n=El(t,`posinset`);return n===null?e:Math.max(e,n)},0)}),m=()=>{let t=(x(n)??be?.documentElement)?.getBoundingClientRect(),r=x(e),i=be?.activeElement,a,d=1/0;
77if(r&&i&&r.contains(i)){let e=i.closest(o);e&&r.contains(e)&&Be(e)&&(a=e)}if(!a)for(let e of u.value){let n=e.getBoundingClientRect();if(!Be(e))continue;let r=Math.abs(n.top-t.top);r>=d||(a=e,d=r)}if(!a)return;let f=El(a,`posinset`),p=El(a,`setsize`);if(f!==null||p!==null){let e=f!==c.value,t=p!==l.value;e&&(c.value=f),t&&(l.value=p),(e||t)&&s(c.value??null,l.value??null)}},h=(0,ul.throttle)(m,50,{leading:!0,trailing:!0}),{isSupported:g,stop:_}=i(u,h,{root:n,rootMargin:r,threshold:a}),{stop:v}=me(e,()=>{u.trigger(),m()},{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`aria-posinset`,`aria-setsize`,`class`,`style`,`hidden`]}),y=Ae(e,`focusin`,m,{capture:!0,passive:!0}),b=(()=>{if(g.value)return()=>{};let e=x(n)??H;return Ae(e,`scroll`,h,{passive:!0})})(),S=Ae(H,`resize`,h);return ue(()=>{x(e)&&(u.trigger(),m())}),{posinset:c,setsize:l,min:d,max:p,refresh:()=>{u.trigger(),m()},stop:()=>{_(),v(),y(),b(),S()}}},Ol=A(!1),kl=A(null),Al=A(!1);ce(Ol,e=>{kl.value===null&&(kl.value=e)});var jl=async()=>{Ol.value=!Ol.value,Al.value=!0,await Te(`thread`).emit(`threadFlipped`),Al.value=!1},Ml=T(()=>Ol.value===kl.value?`Unflip`:`Flip`),Nl=T(()=>Ol.value===kl.value?`unflip_thread:unflip-thread`:`flip_thread:flip-thread`);function Pl(){return{isFlipped:Ol,loadingFlip:Al,handleFlip:jl,flipLabel:Ml,flipClickId:Nl}}var Fl=(e,t={})=>{e??=H;let{smoothing:n=.25,deadband:r=5,thresholds:i=[600,1500]}=t,o=c(e,t),{x:s,y:l,isScrolling:u}=o,d={x:w(0),y:w(0)},f={timestamp:performance.now(),x:s.value,y:l.value},{pause:p,resume:m}=b(()=>{let e=performance.now(),t=~~((e-f.timestamp)/100);if(t===0)return;let i=s.value,a=l.value,o=(i-f.x)/t,c=(a-f.y)/t,u=d.x.value,p=d.y.value,m=(0,ul.clamp)(n,0,.99);u=m*u+(1-m)*o*10,p=m*p+(1-m)*c*10,Math.abs(u)<r&&(u=0),Math.abs(p)<r&&(p=0),d.x.value!==u&&(d.x.value=u),d.y.value!==p&&(d.y.value=p),f.timestamp=e,f.x=i,f.y=a}),h=a({left:!1,right:!1,top:!1,bottom:!1});ue(()=>{u.value||(d.x.value=0,d.y.value=0),h.top=d.y.value<0,h.bottom=d.y.value>0,h.left=d.x.value<0,h.right=d.x.value>0});let g=T(()=>Math.sqrt(d.x.value**2+d.y.value**2)),_=T(()=>Math.abs(g.value)),v=T(()=>{let e=d.x.value,t=d.y.value;return e===0&&t===0?0:(Math.atan2(-t,e)*180/Math.PI+360)%360-90}),y=T(()=>_.value>0&&_.value<i[0]),x=T(()=>_.value>=i[0]&&_.value<i[1]),S=T(()=>_.value>=i[1]);return{...o,directions:h,speed:{...d,magnitude:g,angle:v},isSlow:y,isMedium:x,isFast:S,isScrolling:T(()=>g.value!==0),pause:p,resume:m}},Il=4e3,Ll={__name:`DynamicThreadJumpButton`,props:M({boundary:{type:g?HTMLElement:Object,default:void 0},posinset:{type:Number,default:void 0},setsize:{type:Number,default:void 0},min:{type:Number,default:void 0},max:{type:Number,default:void 0},class:{type:[String,Array,Object],default:void 0}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(n){let r=oe(n,`modelValue`),i=n,{isScrolling:a}=jt(),{isFast:o,y:c,directions:l,isScrolling:u}=Fl(H,{thresholds:[300,600]}),d=he(()=>i.boundary),f=$e().smaller(`lg`),{scrollToStart:p,scrollToEnd:g,isFetching:_}=vl(),v=w(!1);I(()=>setTimeout(()=>v.value=!0,150)),L(()=>v.value=!1);let y=T(()=>f.value?`#mobile-nav-portal`:`body`),b=T(()=>i.min??1),x=T(()=>i.max??i.setsize),S=null,C=()=>v.value&&!a.value&&i.posinset>b.value&&x.value>i.posinset&&(!i.boundary||d.bottom.value>H.innerHeight),D=()=>{clearTimeout(S),r.value=!1};ce(()=>[i.disabled,a],D),ce([()=>i.posinset,()=>i.setsize,o,u],()=>{if(clearTimeout(S),!C())return D();r.value||=o.value,!u.value&&(S=setTimeout(D,Il))}),ce(d.bottom,(0,ul.throttle)(()=>{C()||D()},100));let A=w(!1),j=c.value;ce([c,u],([e,t])=>{if(t&&!(Math.abs(e-j)<100)){if(j=e,l.top)return A.value=!0;if(l.bottom)return A.value=!1}});let M=(0,ul.debounce)(()=>{let e=A.value;nt(null,e?`thread_jump:up`:`thread_jump:down`);let t={behavior:`smooth`};return e?p(t):g(t)},50,{leading:!0,trailing:!1}),ee=T(()=>{if(i.boundary)return(H?.innerWidth??0)-(d.right.value??0)+`px`});return L(()=>clearTimeout(S)),(n,i)=>{let a=fe(`icon`);return e(),t(s,{to:y.value},[h(de,{"enter-from-class":`opacity-0 !duration-700 ease-in-out`,"leave-to-class":`opacity-0 !duration-700 ease-in-out`,"leave-active-class":`pointer-events-none`},{default:G(()=>[r.value?V((e(),t(E(X),{key:0,size:`icon`,variant:`secondary`,class:m([`z-20 flex size-11 transition-[colors,transform,opacity] duration-300 will-change-[op
77acity,colors,transform,left] hover:cursor-pointer dark:border-gray-700 dark:bg-gray-700 dark:hover:border-gray-800 dark:hover:bg-gray-800`,[`absolute -top-2.5 mr-2.5 -translate-y-full`,`lg:fixed lg:bottom-0 lg:top-auto lg:mb-5 lg:mr-5 lg:translate-y-0`,{"-rotate-180":A.value}]]),style:O({right:ee.value}),"aria-label":A.value?`Jump to top`:`Jump to bottom`,title:A.value?`Jump to top`:`Jump to bottom`,onClick:k(E(M),[`prevent`]),onTap:E(M)},null,8,[`class`,`style`,`aria-label`,`title`,`onClick`,`onTap`])),[[a,{icon:`arrow-down-long`,classes:`before:size-5`,loading:E(_)}]]):U(``,!0)]),_:1})],8,[`to`])}}},Rl={},zl={class:`dark-override-bg-white dark-override-text-gray-800 ml-1.5 inline-block rounded-full bg-white px-3 py-0.5 align-text-bottom text-xs font-bold shadow`};function Bl(t,n){return e(),S(`div`,zl,[K(t.$slots,`default`)])}var Vl=Mt(Rl,[[`render`,Bl]]),Hl=(e,t=[])=>{let{isGuest:n}=Ze();return{hasNextPost:T(()=>{let n=x(t),r=x(e);return n.length>0&&r.id!==n[n.length-1]}),navigateToNextPost:()=>{if(n.value){ln({configKey:`opPostNext`});return}let r=x(t),i=x(e),a=r.indexOf(i.id);a!==r.length-1&&Te(`thread`).emit(`goToPost`,r[a+1])},navigateToSeeAll:()=>{if(n.value){ln({configKey:`opPostAll`});return}let t=x(e),r=t.post_type===`thread`?`${t.link}?postsby=${t.username}`:`${t.thread.link}?postsby=${t.username}`;H?.location.assign(r)}}},Ul=new Date,Wl=()=>{let e=H?.performance?.timeOrigin;return e?new Date(e):new Date(Ul)},Gl=[`data-click-id`],Kl={__name:`RevisionsButton`,props:{post:{type:Object,required:!0}},setup(t){let n=t,{backgroundColor:r,isHighlightedPost:i}=tr(n.post),a=()=>{Ze().check()?o():s()},o=()=>{n.post.post_type===`reply`?c():l()},s=()=>{ln({configKey:`editedPost`})},c=()=>{window.dispatchEvent(new CustomEvent(`enable-revisions-modal-reply`,{detail:{threadId:n.post.thread_id,replyId:n.post.id,username:n.post.username,createdAt:n.post.created_at,editedAt:n.post.edited_at,pointInTime:Wl().toISOString(),postStyles:r.value,postBody:n.post.body}}))},l=async()=>{window.dispatchEvent(new CustomEvent(`enable-revisions-modal-thread`,{detail:{threadId:n.post.id,username:n.post.username,createdAt:n.post.created_at,editedAt:n.post.edited_at,pointInTime:Wl().toISOString(),postStyles:r.value,postBody:n.post.body}}))},u=()=>{let e={thread:`thread`,reply:`post`}[n.post.post_type]??n.post.post_type;return e?`edit_check:${e}`:null};return(n,r)=>t.post.edited_at?(e(),S(`button`,{key:0,class:m([`edited-button mt-1 inline-block cursor-pointer rounded-full px-2 py-px text-[13px] leading-6 text-blue-700 transition duration-200 ease-in focus:outline-none dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600`,[E(i)?`bg-white hover:bg-gray-50`:`bg-gray-100 hover:bg-gray-200`]]),"data-click-id":u(),onClick:a},` Edited `,10,Gl)):U(``,!0)}},ql={class:`space-y-4`},Jl={class:`flex justify-between border-b border-blue-200 py-3`},Yl={class:`mr-2 space-y-1`},Xl={class:`text-sm font-bold`},Zl={class:`text-xs`},Ql={key:0,class:`flex items-center space-x-2`},$l={key:0,class:`prose`},eu={class:`text-xs`},tu={__name:`GuestPostDetails`,props:{thread:{type:Object,required:!0}},setup(n){let r=n,i=T(()=>r.thread.guest);return(n,r)=>{let a=fe(`icon`);return e(),S(`div`,ql,[W(`div`,Jl,[W(`div`,Yl,[W(`p`,Xl,J(i.value.name),1),W(`div`,Zl,J(i.value.description),1)]),i.value.x_url||i.value.blog_url?(e(),S(`div`,Ql,[i.value.x_url?V((e(),t(E(X),{key:0,as:`a`,href:i.value.x_url,rel:`noopener nofollow`,"aria-label":`Visit ${i.value.name}'s X profile`,size:`icon`,variant:`social`},null,8,[`href`,`aria-label`])),[[a,{icon:`x-twitter`,classes:`before:size-6 before:block before:shrink-0`}]]):U(``,!0),i.value.blog_url?V((e(),t(E(X),{key:1,as:`a`,href:i.value.blog_url,rel:`noopener nofollow`,"aria-label":`Visit ${i.value.name}'s blog`,size:`icon`,variant:`social`},null,8,[`href`,`aria-label`])),[[a,{icon:`link`,classes:`before:size-6 before:block before:shrink-0`}]]):U(``,!0)])):U(``,!0)]),i.value.standfirst?(e(),S(`p`,$l,J(i.value.standfirst),1)):U(``,!0),i.value.image?(e(),t(E(Rn),{key:1,src:i.value.image.url,alt:i.value.image.alt,loading:`lazy`,class:`w-full rounded border border-gray-100 object-cover sm:mx-auto sm:w-[70%]`},C({_:2},[i.value.image.caption?{name:`caption`,fn:G(()=>[W(`figcaption`,eu,J(i.value.image.caption),1)]),key:`0`}:void 0]),1032,[`src`,`alt`])):U(``,!0)])}}},nu=async e=>{let t=yn().request(`/api/v3/talk/threads/${e.id}/save`,{immediate:!1}).json();if(e.has_saved?await t.post().delete().execute():await t.post().execute(),t.error.value){pt().show({text:`Something went wrong. Please try again later`});return}Te(`thread`).emit(`threadSaved`,{id:e.id,has_saved:!e.has_saved})},ru=async e=>{let t=yn().request(`/api/v3/talk/threads/${e.thread_id}/replies/${e.id}/save`,{immediate:!1}).json();if(e.has_saved?await t.post().delete().execute():await t.post().execute(),t.error.value){pt().show({text:`Something went wrong. Please try again later`});return}Te(`thread`).emit(`replySaved`,{id:e.id,has_saved:!e.has_saved})};function iu(e){let{isGuest:t}=Ze(),n=A(e),r=A(e.post_type),i=A(!1),a=T(()=>n.value.has_saved?`Unsave`:`Save`),o=T(()=>t.value?`sign_up_login_trigger:save`:n.value.has_saved?`unsave_click:unsave`:`save_created:save`);return{toggleThreadSave:nu,toggleReplySave:ru,handlePostSave:async()=>
77{if(t.value){ln({configKey:`save`,dataId:`save`});return}i.value=!0,r.value===`thread`?await nu(n.value):await ru(n.value),i.value=!1},loadingSave:i,saveLabel:a,saveIcon:T(()=>n.value.has_saved?`heart-solid`:`heart`),saveClickId:o}}var au={__name:`Dialog`,props:{open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},modal:{type:Boolean,required:!1}},emits:[`update:open`],setup(n,{emit:r}){let i=Lt(n,r);return(n,r)=>(e(),t(E(ki),v(Me(E(i))),{default:G(()=>[K(n.$slots,`default`)]),_:3},16))}},ou={__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){let r=n;return(n,i)=>(e(),t(E(Ai),v(Me(r)),{default:G(()=>[K(n.$slots,`default`)]),_:3},16))}},su={__name:`DialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},class:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(n,{emit:r}){let i=n,a=r,o=te(i,`class`),s=Lt(o,a);return(n,r)=>{let a=fe(`icon`);return e(),t(E(Li),null,{default:G(()=>[h(E(Ii),{class:`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),h(E(Pi),F(E(s),{class:E(tt)(`fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] dark:bg-gray-900 sm:rounded-lg`,i.class)}),{default:G(()=>[K(n.$slots,`default`),h(E(Ai),{class:`absolute right-4 top-4 roun
77ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`},{default:G(()=>[V(W(`i`,null,null,512),[[a,{icon:`xmark`,classes:`before:size-4 before:block`}]]),r[0]||=W(`span`,{class:`sr-only`},`Close`,-1)]),_:1})]),_:3},16,[`class`])]),_:3})}}},cu={__name:`DialogFooter`,props:{class:{type:null,required:!1}},setup(t){let n=t;return(t,r)=>(e(),S(`div`,{class:m(E(tt)(`flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2`,n.class))},[K(t.$slots,`default`)],2))}},lu={__name:`DialogHeader`,props:{class:{type:null,required:!1}},setup(t){let n=t;return(t,r)=>(e(),S(`div`,{class:m(E(tt)(`flex flex-col gap-y-1.5 text-center sm:text-left`,n.class))},[K(t.$slots,`default`)],2))}},uu={__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},class:{type:null,required:!1}},setup(n){let r=n,i=te(r,`class`),a=Rt(i);return(n,i)=>(e(),t(E(Ri),F(E(a),{class:E(tt)(`text-lg font-semibold leading-none tracking-tight`,r.class)}),{default:G(()=>[K(n.$slots,`default`)]),_:3},16,[`class`]))}},du={key:0},fu=[`href`],pu=[`href`],mu={key:0,class:`space-y-4`},hu=[`for`],gu=[`id`,`aria-describedby`,`aria-invalid`,`disabled`],_u=[`value`],vu=[`id`],yu=[`for`],bu=[`id`,`aria-describedby`,`aria-invalid`,`disabled`],xu=[`id`],Su={key:1,class:`space-y-4`},Cu={key:2,class:`space-y-4`},wu=[`for`],Tu=[`id`,`aria-describedby`,`aria-invalid`,`disabled`],Eu=[`id`],Du=[`id`],Ou={key:3,class:`space-y-4`},ku={key:4,class:`space-y-4`},Au=[`for`],ju=[`id`,`aria-describedby`,`aria-invalid`,`disabled`],Mu=[`value`],Nu=[`id`],Pu=[`for`],Fu=[`id`,`aria-describedby`,`aria-invalid`,`disabled`],Iu=[`id`],Lu=[`id`],Ru={key:5,class:`space-y-4`},zu={key:6,class:`space-y-4`},Bu=[`for`],Vu=[`id`,`aria-describedby`,`aria-invalid`,`disabled`],Hu=[`value`],Uu=[`id`],Wu=[`for`],Gu=[`id`,`aria-describedby`,`aria-invalid`,`disabled`],Ku=[`id`],qu={key:7,class:`space-y-4`},Ju={key:8,class:`text-xs text-red-600`},Yu=`THIS MESSAGE WILL BE DISPLAYED TO USERS IN PLACE OF THE REPLY ONCE IT HAS BEEN DELETED. IT IS ONLY REQUIRED IF THE REASON FOR DELETION IS SET TO "Other", IN WHICH CASE IT MUST BE AT LEAST 10 CHARACTERS LONG.`,Xu=`THIS MESSAGE WILL BE DISPLAYED TO USERS IN PLACE OF THE REPLY ONCE IT HAS BEEN WITHDRAWN. IF LEFT BLANK, A STANDARD MESSAGE WILL BE DISPLAYED.`,Zu={__name:`ReplyFrontendControls`,props:{post:{type:Object,required:!0},parentPost:{type:Object,default:null}},setup(n){let r=n,i=ze(),a=T(()=>i.value?.user??{}),o=T(()=>a.value?.can_access_frontend_controls??!1),s=T(()=>i.value?.frontend_controls?.reply??{}),c=T(()=>s.value?.deletion_reasons??{}),u=T(()=>s.value?.hidden_reasons??{}),d=T(()=>s.value?.suspension_reasons??{}),f=T(()=>a.value?.can_view_replies_in_nova??!1),p=T(()=>a.value?.can_view_users_in_nova??!1),m=T(()=>a.value?.can_run_suspend_user_action??!1),g=T(()=>a.value?.can_run_unsuspend_user_action??!1),_=T(()=>a.value?.can_run_withdraw_reply_action??!1),v=T(()=>a.value?.can_run_unwithdraw_reply_action??!1),y=T(()=>a.value?.can_run_delete_reply_action??!1),b=T(()=>a.value?.can_run_undelete_reply_action??!1),x=T(()=>a.value?.can_run_hide_reply_action??!1),C=T(()=>a.value?.can_run_unhide_reply_action??!1),w=A(null),D=A(!1),O=A({}),k=A({reason:``,note:``,message:``}),j=T(()=>r.parentPost?.id??r.post.thread_id),M=T(()=>r.post.id),ee=T(()=>r.post.admin_reply_url??null),N=T(()=>r.post.admin_user_url??null),P=T(()=>!!r.post.is_hidden),F=T(()=>!!r.post.is_withdrawn),I=T(()=>!!r.post.is_deleted),te=T(()=>!!r.post.user_is_suspended),L=(e,t)=>`reply-${M.value}-${e}-${t}`,R=(...e)=>e.filter(Boolean).join(` `)||void 0,z=(e,t=null)=>{t?.preventDefault?.(),t?.stopPropagation?.(),O.value={},k.value={reason:``,note:``,message:``},w.value=e},ne=()=>{w.value=null,O.value={},k.value={reason:``,note:``,message:``}},re=async(e,t={})=>{if(!j.value||!M.value)return;D.value=!0,O.value={};let n=Xe(`/api/v3/talk/threads/${j.value}/replies/${M.value}/frontend-controls/${e}`,{immediate:!1}).post(t).json();if(await n.execute(),n.statusCode.value===422){O.value=n.data.value?.errors??{},D.value=!1;return}if(n.error.value){O.value={general:[`Something went wrong. Please try again.`]},D.value=!1;return}let r=n.data.value?.redirect_url;if(H?.location&&r){H.location=r;return}D.value=!1},B=async e=>{await re(e)};return(n,i)=>{let a=fe(`icon`);return o.value?(e(),S(`div`,du,[h(E(en),{class:`my-1 bg-border`}),h(E($t),null,{default:G(()=>[h(E(rn),{class:`cursor-pointer gap-2 text-red-600 hover:bg-transparent hover:underline focus:bg-transparent focus:underline data-[state=open]:bg-transparent`},{default:G(()=>[V(W(`i`,null,null,512),[[a,{icon:`gear`,classes:`before:block before:size-4 before:shrink-0`}]]),i[24]||=l(` Post controls `,-1)]),_:1}),h(E(dn),{class:`w-60`},{default:G(()=>[f.value&&ee.value?(e(),t(E(Y),{key:0,"as-child":``},{default:G(()=>[W(`a`,{href:ee.value,class:`text-red-600`,target:`_blank`,rel:`noopener noreferrer`},` Direct link `,8,fu)]),_:1})):U(``,!0),p.value&&N.value?(e(),t(E(Y),{key:1,"as-child":``},{default:G(()=>[W(`a`,{href:N.value,class:`text-red-600`,target:`_blank`,rel:`noopener noreferrer`},` User details `,8,pu)]),_:1})):U(``,!0),r.post.user_id&&te.value&&g.value?(e(),t(E(Y),{key:2,class:`text-red-600`,onSelect:i[0]||=e=>z(`unsuspend-user`,e)},{default:G(()=>[...i[25]||=[l(` Unsuspend user `,-1)]]),_:1})):r.post.user_id&&!te.value&&m.value?(e(),t(E(Y),{key:3,class:`text-red-600`,onSelect:i[1]||=e=>z(`suspend-user`,e)},{default:G(()=>[...i[26]||=[l(` Suspend user `,-1)]]),_:1})):U(``,!0),!F.value&&_.value?(e(),t(E(Y),{key:4,class:`text-red-600`,onSelect:i[2]||=e=>z(`withdraw`,e)},{default:G(()=>[...i[27]||=[l(` Withdraw reply `,-1)]]),_:1})):F.value&&v.value?(e(),t(E(Y),{key:5,class:`text-red-600`,onSelect:i[3]||=e=>z(`unwithdraw`,e)},{default:G(()=>[...i[28]||=[l(` Unwithdraw reply `,-1)]]),_:1})):U(``,!0),!I.value&&y.value?(e(),t(E(Y),{key:6,class:`text-red-600`,onSelect:i[4]||=e=>z(`delete`,e)},{default:G(()=>[...i[29]||=[l(` Delete reply `,-1)]]),_:1})):I.value&&b.value?(e(),t(E(Y),{key:7,class:`text-red-600`,onSelect:i[5]||=e=>z(`undelete`,e)},{default:G(()=>[...i[30]||=[l(` Undelete reply `,-1)]]),_:1})):U(``,!0),!P.value&&x.value?(e(),t(E(Y),{key:8,class:`text-red-600`,onSelect:i[6]||=e=>z(`hide`,e)},{default:G(()=>[...i[31]||=[l(` Hide reply `,-1)]]),_:1})):P.value&&C.value?(e(),t(E(Y),{key:9,class:`text-red-600`,onSelect:i[7]||=e=>z(`unhide`,e)},{default:G(()=>[...i[32]||=[l(` Unhide reply `,-1)]]),_:1})):U(``,!0)]),_:1})]),_:1}),h(E(au),{open:w.value!==null,"onUpdate:open":i[23]||=e=>!e&&ne()},{default:G(()=>[h(E(su),{class:`sm:max-w-xl`},{default:G(()=>[h(E(lu),null,{default:G(()=>[h(E(uu),null,{default:G(()=>[w.value===`suspend-user`?(e(),S(q,{key:0},[l(` Suspend user `)],64)):w.value===`unsuspend-user`?(e(),S(q,{key:1},[l(` Unsuspend user `)],64)):w.value===`withdraw`?(e(),S(q,{key:2},[l(` Withdraw reply `)],64)):w.value===`unwithdraw`?(e(),S(q,{key:3},[l(` Unwithdraw reply `)],64)):w.value===`delete`?(e(),S(q,{key:4},[l(` Delete reply `)],64)):w.value===`undelete`?(e(),S(q,{key:5},[l(` Undelete reply `)],64)):w.value===`hide`?(e(),S(q,{key:6}
77,[l(` Hide reply `)],64)):w.value===`unhide`?(e(),S(q,{key:7},[l(` Unhide reply `)],64)):U(``,!0)]),_:1})]),_:1}),w.value===`suspend-user`?(e(),S(`div`,mu,[W(`div`,null,[W(`label`,{for:L(`suspend-user`,`reason`),class:`mb-1 block text-sm font-semibold`},` Reason `,8,hu),V(W(`select`,{id:L(`suspend-user`,`reason`),"onUpdate:modelValue":i[8]||=e=>k.value.reason=e,"aria-describedby":R(O.value.reason?L(`suspend-user`,`reason-error`):void 0),"aria-invalid":!!O.value.reason,class:`h-10 w-full rounded-lg border border-gray-300 bg-white px-3 text-sm`,disabled:D.value},[i[33]||=W(`option`,{value:``,disabled:``},`Select a reason`,-1),(e(!0),S(q,null,Ce(d.value,(t,n)=>(e(),S(`option`,{key:n,value:n},J(t),9,_u))),128))],8,gu),[[Ee,k.value.reason]]),O.value.reason?(e(),S(`p`,{key:0,id:L(`suspend-user`,`reason-error`),class:`mt-1 text-xs text-red-600`},J(O.value.reason[0]),9,vu)):U(``,!0)]),W(`div`,null,[W(`label`,{for:L(`suspend-user`,`note`),class:`mb-1 block text-sm font-semibold`},` Note `,8,yu),V(W(`textarea`,{id:L(`suspend-user`,`note`),"onUpdate:modelValue":i[9]||=e=>k.value.note=e,rows:`6`,"aria-describedby":R(O.value.note?L(`suspend-user`,`note-error`):void 0),"aria-invalid":!!O.value.note,class:`w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm`,disabled:D.value},null,8,bu),[[je,k.value.note]]),O.value.note?(e(),S(`p`,{key:0,id:L(`suspend-user`,`note-error`),class:`mt-1 text-xs text-red-600`},J(O.value.note[0]),9,xu)):U(``,!0)])])):w.value===`unsuspend-user`?(e(),S(`div`,Su,[...i[34]||=[W(`p`,null,`Are you sure you want to unsuspend this user?`,-1)]])):w.value===`withdraw`?(e(),S(`div`,Cu,[W(`div`,null,[W(`label`,{for:L(`withdraw`,`message`),class:`mb-1 block text-sm font-semibold`},` Message `,8,wu),V(W(`textarea`,{id:L(`withdraw`,`message`),"onUpdate:modelValue":i[10]||=e=>k.value.message=e,rows:`6`,"aria-describedby":R(L(`withdraw`,`message-help`),O.value.message?L(`withdraw`,`message-error`):void 0),"aria-invalid":!!O.value.message,class:`w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm`,disabled:D.value},null,8,Tu),[[je,k.value.message]]),W(`p`,{id:L(`withdraw`,`message-help`),class:`mt-2 text-xs text-gray-500`},J(Xu),8,Eu),O.value.message?(e(),S(`p`,{key:0,id:L(`withdraw`,`message-error`),class:`mt-1 text-xs text-red-600`},J(O.value.message[0]),9,Du)):U(``,!0)])])):w.value===`unwithdraw`?(e(),S(`div`,Ou,[...i[35]||=[W(`p`,null,`Are you sure you want to unwithdraw this reply?`,-1)]])):w.value===`delete`?(e(),S(`div`,ku,[W(`div`,null,[W(`label`,{for:L(`delete`,`reason`),class:`mb-1 block text-sm font-semibold`},` Reason `,8,Au),V(W(`select`,{id:L(`delete`,`reason`),"onUpdate:modelValue":i[11]||=e=>k.value.reason=e,"aria-describedby":R(O.value.reason?L(`delete`,`reason-error`):void 0),"aria-invalid":!!O.value.reason,class:`h-10 w-full rounded-lg border border-gray-300 bg-white px-3 text-sm`,disabled:D.value},[i[36]||=W(`option`,{value:``,disabled:``},`Select a reason`,-1),(e(!0),S(q,null,Ce(c.value,(t,n)=>(e(),S(`option`,{key:n,value:n},J(t),9,Mu))),128))],8,ju),[[Ee,k.value.reason]]),O.value.reason?(e(),S(`p`,{key:0,id:L(`delete`,`reason-error`),class:`mt-1 text-xs text-red-600`},J(O.value.reason[0]),9,Nu)):U(``,!0)]),W(`div`,null,[W(`label`,{for:L(`delete`,`message`),class:`mb-1 block text-sm font-semibold`},` Message `,8,Pu),V(W(`textarea`,{id:L(`delete`,`message`),"onUpdate:modelValue":i[12]||=e=>k.value.message=e,rows:`6`,"aria-describedby":R(L(`delete`,`message-help`),O.value.message?L(`delete`,`message-error`):void 0),"aria-invalid":!!O.value.message,class:`w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm`,disabled:D.value},null,8,Fu),[[je,k.value.message]]),W(`p`,{id:L(`delete`,`message-help`),class:`mt-2 text-xs text-gray-500`},J(Yu),8,Iu),O.value.message?(e(),S(`p`,{key:0,id:L(`delete`,`message-error`),class:`mt-1 text-xs text-red-600`},J(O.value.message[0]),9,Lu)):U(``,!0)])])):w.value===`undelete`?(e(),S(`div`,Ru,[...i[37]||=[W(`p`,null,`Are you sure you want to undelete this reply?`,-1)]])):w.value===`hide`?(e(),S(`div`,zu,[W(`div`,null,[W(`label`,{for:L(`hide`,`reason`),class:`mb-1 block text-sm font-semibold`},` Reason `,8,Bu),V(W(`select`,{id:L(`hide`,`reason`),"onUpdate:modelValue":i[13]||=e=>k.value.reason=e,"aria-describedby":R(O.value.reason?L(`hide`,`reason-error`):void 0),"aria-invalid":!!O.value.reason,class:`h-10 w-full rounded-lg border border-gray-300 bg-white px-3 text-sm`,disabled:D.value},[i[38]||=W(`option`,{value:``,disabled:``},`Select a reason`,-1),(e(!0),S(q,null,Ce(u.value,(t,n)=>(e(),S(`option`,{key:n,value:n},J(t),9,Hu))),128))],8,Vu),[[Ee,k.value.reason]]),O.value.reason?(e(),S(`p`,{key:0,id:L(`hide`,`reason-error`),class:`mt-1 text-xs text-red-600`},J(O.value.reason[0]),9,Uu)):U(``,!0)]),W(`div`,null,[W(`label`,{for:L(`hide`,`note`),class:`mb-1 block text-sm font-semibold`},` Note `,8,Wu),V(W(`textarea`,{id:L(`hide`,`note`),"onUpdate:modelValue":i[14]||=e=>k.value.note=e,rows:`6`,"aria-describedby":R(O.value.note?L(`hide`,`note-error`):void 0),"aria-invalid":!!O.value.note,class:`w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm`,disabled:D.value},null,8,Gu),[[je,k.value.note]]),O.value.note?(e(),S(`p`,{key:0,id:L(`hide`,`note-error`),class:`mt-1 text-xs text-red-600`},J(O.value.note[0]),9,Ku)):U(``,!0)])])):w.value===`unhide`?(e(),S(`div`,qu,[...i[39]||=[W(`p`,null,`Are you sure you want to unhide this reply?`,-1)]])):U(``,!0),O.value.general?(e(),S(`p`,Ju,J(O.value.general[0]),1)):U(``,!0),h(E(cu),null,{default:G(()=>[h(E(ou),{"as-child":``},{default:G(()=>[h(E(X),{variant:`outline`,disabled:D.value},{default:G(()=>
77[...i[40]||=[l(` Cancel `,-1)]]),_:1},8,[`disabled`])]),_:1}),w.value===`suspend-user`?(e(),t(E(X),{key:0,disabled:D.value,onClick:i[15]||=e=>re(`suspend-user`,{reason:k.value.reason,note:k.value.note})},{default:G(()=>[...i[41]||=[l(` Suspend user `,-1)]]),_:1},8,[`disabled`])):w.value===`unsuspend-user`?(e(),t(E(X),{key:1,disabled:D.value,onClick:i[16]||=e=>B(`unsuspend-user`)},{default:G(()=>[...i[42]||=[l(` Unsuspend user `,-1)]]),_:1},8,[`disabled`])):w.value===`withdraw`?(e(),t(E(X),{key:2,disabled:D.value,onClick:i[17]||=e=>re(`withdraw`,{message:k.value.message})},{default:G(()=>[...i[43]||=[l(` Withdraw reply `,-1)]]),_:1},8,[`disabled`])):w.value===`unwithdraw`?(e(),t(E(X),{key:3,disabled:D.value,onClick:i[18]||=e=>B(`unwithdraw`)},{default:G(()=>[...i[44]||=[l(` Unwithdraw reply `,-1)]]),_:1},8,[`disabled`])):w.value===`delete`?(e(),t(E(X),{key:4,disabled:D.value,onClick:i[19]||=e=>re(`delete`,{reason:k.value.reason,message:k.value.message})},{default:G(()=>[...i[45]||=[l(` Delete reply `,-1)]]),_:1},8,[`disabled`])):w.value===`undelete`?(e(),t(E(X),{key:5,disabled:D.value,onClick:i[20]||=e=>B(`undelete`)},{default:G(()=>[...i[46]||=[l(` Undelete reply `,-1)]]),_:1},8,[`disabled`])):w.value===`hide`?(e(),t(E(X),{key:6,disabled:D.value,onClick:i[21]||=e=>re(`hide`,{reason:k.value.reason,note:k.value.note})},{default:G(()=>[...i[47]||=[l(` Hide reply `,-1)]]),_:1},8,[`disabled`])):w.value===`unhide`?(e(),t(E(X),{key:7,disabled:D.value,onClick:i[22]||=e=>B(`unhide`)},{default:G(()=>[...i[48]||=[l(` Unhide reply `,-1)]]),_:1},8,[`disabled`])):U(``,!0)]),_:1})]),_:1})]),_:1},8,[`open`])])):U(``,!0)}}},Qu={key:0},$u=[`href`],ed=[`href`],td={key:0,class:`space-y-4`},nd=[`for`],rd=[`id`,`aria-describedby`,`aria-invalid`,`disabled`],id=[`value`],ad=[`id`],od=[`for`],sd=[`id`,`aria-describedby`,`aria-invalid`,`disabled`],cd=[`id`],ld=[`id`],ud={key:1,class:`space-y-4`},dd={key:2,class:`space-y-4`},fd=[`for`],pd=[`id`,`aria-describedby`,`aria-invalid`,`disabled`],md=[`id`],hd=[`id`],gd={key:3,class:`space-y-4`},_d={key:4,class:`space-y-4`},vd=[`for`],yd=[`id`,`aria-describedby`,`aria-invalid`,`disabled`],bd=[`value`],xd=[`id`],Sd=[`for`],Cd=[`id`,`aria-describedby`,`aria-invalid`,`disabled`],wd=[`id`],Td=[`id`],Ed={key:5,class:`space-y-4`},Dd={key:6,class:`space-y-4`},Od=[`for`],kd=[`id`,`aria-describedby`,`aria-invalid`,`disabled`],Ad=[`value`],jd=[`id`],Md=[`for`],Nd=[`id`,`aria-describedby`,`aria-invalid`,`disabled`],Pd=[`id`],Fd=[`id`],Id={key:7,class:`space-y-4`},Ld={key:8,class:`text-xs text-red-600`},Rd=`THIS MESSAGE WILL BE DISPLAYED TO USERS IN PLACE OF THE THREAD ONCE IT HAS BEEN DELETED. IT IS ONLY REQUIRED IF THE REASON FOR DELETION IS SET TO "Other", IN WHICH CASE IT MUST BE AT LEAST 10 CHARACTERS LONG.`,zd=`THIS MESSAGE WILL BE DISPLAYED TO USERS IN PLACE OF THE THREAD ONCE IT HAS BEEN WITHDRAWN. IF LEFT BLANK, A STANDARD MESSAGE WILL BE DISPLAYED.`,Bd=`This will be stored as a note against the thread.`,Vd={__name:`ThreadFrontendControls`,props:{post:{type:Object,required:!0}},emits:[`close`],setup(n,{emit:r}){let i=n,a=r,o=ze(),s=T(()=>o.value?.user??{}),c=T(()=>s.value?.can_access_frontend_controls??!1),u=T(()=>o.value?.frontend_controls?.thread??{}),d=T(()=>u.value?.deletion_reasons??{}),f=T(()=>u.value?.hidden_reasons??{}),p=T(()=>u.value?.suspension_reasons??{}),m=T(()=>s.value?.can_view_threads_in_nova??!1),g=T(()=>s.value?.can_view_users_in_nova??!1),_=T(()=>s.value?.can_run_suspend_user_action??!1),v=T(()=>s.value?.can_run_unsuspend_user_action??!1),y=T(()=>s.value?.can_run_withdraw_thread_action??!1),b=T(()=>s.value?.can_run_unwithdraw_thread_action??!1),x=T(()=>s.value?.can_run_delete_thread_action??!1),C=T(()=>s.value?.can_run_undelete_thread_action??!1),w=T(()=>s.value?.can_run_hide_thread_action??!1),D=T(()=>s.value?.can_run_unhide_thread_action??!1),O=A(null),k=A(!1),j=A({}),M=A({reason:``,note:``,message:``}),ee=T(()=>i.post.id),N=T(()=>i.post.admin_thread_url??null),P=T(()=>i.post.admin_user_url??null),F=T(()=>!!i.post.admin_is_hidden),I=T(()=>!!i.post.admin_is_withdrawn),te=T(()=>!!i.post.admin_is_deleted),L=T(()=>!!i.post.admin_user_is_suspended),R=(e,t)=>`thread-${ee.value}-${e}-${t}`,z=(...e)=>e.filter(Boolean).join(` `)||void 0,ne=(e,t=null)=>{t?.preventDefault?.(),t?.stopPropagation?.(),j.value={},M.value={reason:``,note:``,message:``},O.value=e},re=()=>{O.value=null,j.value={},M.value={reason:``,note:``,message:``}},B=async(e,t={})=>
77{if(!ee.value)return;k.value=!0,j.value={};let n=Xe(`/api/v3/talk/threads/${ee.value}/frontend-controls/${e}`,{immediate:!1}).post(t).json();if(await n.execute(),n.statusCode.value===422){j.value=n.data.value?.errors??{},k.value=!1;return}if(n.error.value){j.value={general:[`Something went wrong. Please try again.`]},k.value=!1;return}let r=n.data.value?.redirect_url;if(H?.location&&r){H.location=r;return}re(),a(`close`),k.value=!1},ie=async e=>{await B(e)};return(n,r)=>{let i=fe(`icon`);return c.value?(e(),S(`div`,Qu,[h(E(en),{class:`my-1 bg-border`}),h(E($t),null,{default:G(()=>[h(E(rn),{class:`cursor-pointer gap-2 text-red-600 hover:bg-transparent hover:underline focus:bg-transparent focus:underline data-[state=open]:bg-transparent`},{default:G(()=>[V(W(`i`,null,null,512),[[i,{icon:`gear`,classes:`before:size-4 before:shrink-0`}]]),r[24]||=l(` Thread controls `,-1)]),_:1}),h(E(dn),{class:`w-64`},{default:G(()=>[m.value&&N.value?(e(),t(E(Y),{key:0,"as-child":``},{default:G(()=>[W(`a`,{href:N.value,class:`text-red-600`,target:`_blank`,rel:`noopener noreferrer`},` Direct link `,8,$u)]),_:1})):U(``,!0),g.value&&P.value?(e(),t(E(Y),{key:1,"as-child":``},{default:G(()=>[W(`a`,{href:P.value,class:`text-red-600`,target:`_blank`,rel:`noopener noreferrer`},` User details `,8,ed)]),_:1})):U(``,!0),L.value&&v.value?(e(),t(E(Y),{key:2,class:`text-red-600`,onSelect:r[0]||=e=>ne(`unsuspend-user`,e)},{default:G(()=>[...r[25]||=[l(` Unsuspend user `,-1)]]),_:1})):!L.value&&_.value?(e(),t(E(Y),{key:3,class:`text-red-600`,onSelect:r[1]||=e=>ne(`suspend-user`,e)},{default:G(()=>[...r[26]||=[l(` Suspend user `,-1)]]),_:1})):U(``,!0),!I.value&&y.value?(e(),t(E(Y),{key:4,class:`text-red-600`,onSelect:r[2]||=e=>ne(`withdraw`,e)},{default:G(()=>[...r[27]||=[l(` Withdraw thread `,-1)]]),_:1})):I.value&&b.value?(e(),t(E(Y),{key:5,class:`text-red-600`,onSelect:r[3]||=e=>ne(`unwithdraw`,e)},{default:G(()=>[...r[28]||=[l(` Unwithdraw thread `,-1)]]),_:1})):U(``,!0),!te.value&&x.value?(e(),t(E(Y),{key:6,class:`text-red-600`,onSelect:r[4]||=e=>ne(`delete`,e)},{default:G(()=>[...r[29]||=[l(` Delete thread `,-1)]]),_:1})):te.value&&C.value?(e(),t(E(Y),{key:7,class:`text-red-600`,onSelect:r[5]||=e=>ne(`undelete`,e)},{default:G(()=>[...r[30]||=[l(` Undelete thread `,-1)]]),_:1})):U(``,!0),!F.value&&w.value?(e(),t(E(Y),{key:8,class:`text-red-600`,onSelect:r[6]||=e=>ne(`hide`,e)},{default:G(()=>[...r[31]||=[l(` Hide thread `,-1)]]),_:1})):F.value&&D.value?(e(),t(E(Y),{key:9,class:`text-red-600`,onSelect:r[7]||=e=>ne(`unhide`,e)},{default:G(()=>[...r[32]||=[l(` Unhide thread `,-1)]]),_:1})):U(``,!0)]),_:1})]),_:1}),h(E(au),{open:O.value!==null,"onUpdate:open":r[23]||=e=>!e&&re()},{default:G(()=>[h(E(su),{class:`sm:max-w-xl`},{default:G(()=>[h(E(lu),null,{default:G(()=>[h(E(uu),null,{default:G(()=>[O.value===`suspend-user`?(e(),S(q,{key:0},[l(` Suspend user `)],64)):O.value===`unsuspend-user`?(e(),S(q,{key:1},[l(` Unsuspend user `)],64)):O.value===`withdraw`?(e(),S(q,{key:2},[l(` Withdraw thread `)],64)):O.value===`unwithdraw`?(e(),S(q,{key:3},[l(` Unwithdraw thread `)],64)):O.value===`delete`?(e(),S(q,{key:4},[l(` Delete thread `)],64)):O.value===`undelete`?(e(),S(q,{key:5},[l(` Undelete thread `)],64)):O.value===`hide`?(e(),S(q,{key:6},[l(` Hide thread `)],64)):O.value===`unhide`?(e(),S(q,{key:7},[l(` Unhide thread `)],64)):U(``,!0)]),_:1})]),_:1}),O.value===`suspend-user`?(e(),S(`div`,td,[W(`div`,null,[W(`label`,{for:R(`suspend-user`,`reason`),class:`mb-1 block text-sm font-semibold`},` Reason `,8,nd),V(W(`select`,{id:R(`suspend-user`,`reason`),"onUpdate:modelValue":r[8]||=e=>M.value.reason=e,"aria-describedby":z(j.value.reason?R(`suspend-user`,`reason-error`):void 0),"aria-invalid":!!j.value.reason,class:`h-10 w-full rounded-lg border border-gray-300 bg-white px-3 text-sm`,disabled:k.value},[r[33]||=W(`option`,{value:``,disabled:``},`Select a reason`,-1),(e(!0),S(q,null,Ce(p.value,(t,n)=>(e(),S(`option`,{key:n,value:n},J(t),9,id))),128))],8,rd),[[Ee,M.value.reason]]),j.value.reason?(e(),S(`p`,{key:0,id:R(`suspend-user`,`reason-error`),class:`mt-1 text-xs text-red-600`},J(j.value.reason[0]),9,ad)):U(``,!0)]),W(`div`,null,[W(`label`,{for:R(`suspend-user`,`note`),class:`mb-1 block text-sm font-semibold`},` Note `,8,od),V(W(`textarea`,{id:R(`suspend-user`,`note`),"onUpdate:modelValue":r[9]||=e=>M.value.note=e,rows:`6`,"aria-describedby":z(R(`suspend-user`,`note-help`),j.value.note?R(`suspend-user`,`note-error`):void 0),"aria-invalid":!!j.value.note,class:`w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm`,disabled:k.value},null,8,sd),[[je,M.value.note]]),W(`p`,{id:R(`suspend-user`,`note-help`),class:`mt-2 text-xs text-gray-500`}
77,J(Bd),8,cd),j.value.note?(e(),S(`p`,{key:0,id:R(`suspend-user`,`note-error`),class:`mt-1 text-xs text-red-600`},J(j.value.note[0]),9,ld)):U(``,!0)])])):O.value===`unsuspend-user`?(e(),S(`div`,ud,[...r[34]||=[W(`p`,null,`Are you sure you want to unsuspend this user?`,-1)]])):O.value===`withdraw`?(e(),S(`div`,dd,[W(`div`,null,[W(`label`,{for:R(`withdraw`,`message`),class:`mb-1 block text-sm font-semibold`},` Message `,8,fd),V(W(`textarea`,{id:R(`withdraw`,`message`),"onUpdate:modelValue":r[10]||=e=>M.value.message=e,rows:`6`,"aria-describedby":z(R(`withdraw`,`message-help`),j.value.message?R(`withdraw`,`message-error`):void 0),"aria-invalid":!!j.value.message,class:`w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm`,disabled:k.value},null,8,pd),[[je,M.value.message]]),W(`p`,{id:R(`withdraw`,`message-help`),class:`mt-2 text-xs text-gray-500`},J(zd),8,md),j.value.message?(e(),S(`p`,{key:0,id:R(`withdraw`,`message-error`),class:`mt-1 text-xs text-red-600`},J(j.value.message[0]),9,hd)):U(``,!0)])])):O.value===`unwithdraw`?(e(),S(`div`,gd,[...r[35]||=[W(`p`,null,`Are you sure you want to unwithdraw this thread?`,-1)]])):O.value===`delete`?(e(),S(`div`,_d,[W(`div`,null,[W(`label`,{for:R(`delete`,`reason`),class:`mb-1 block text-sm font-semibold`},` Reason `,8,vd),V(W(`select`,{id:R(`delete`,`reason`),"onUpdate:modelValue":r[11]||=e=>M.value.reason=e,"aria-describedby":z(j.value.reason?R(`delete`,`reason-error`):void 0),"aria-invalid":!!j.value.reason,class:`h-10 w-full rounded-lg border border-gray-300 bg-white px-3 text-sm`,disabled:k.value},[r[36]||=W(`option`,{value:``,disabled:``},`Select a reason`,-1),(e(!0),S(q,null,Ce(d.value,(t,n)=>(e(),S(`option`,{key:n,value:n},J(t),9,bd))),128))],8,yd),[[Ee,M.value.reason]]),j.value.reason?(e(),S(`p`,{key:0,id:R(`delete`,`reason-error`),class:`mt-1 text-xs text-red-600`},J(j.value.reason[0]),9,xd)):U(``,!0)]),W(`div`,null,[W(`label`,{for:R(`delete`,`message`),class:`mb-1 block text-sm font-semibold`},` Message `,8,Sd),V(W(`textarea`,{id:R(`delete`,`message`),"onUpdate:modelValue":r[12]||=e=>M.value.message=e,rows:`6`,"aria-describedby":z(R(`delete`,`message-help`),j.value.message?R(`delete`,`message-error`):void 0),"aria-invalid":!!j.value.message,class:`w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm`,disabled:k.value},null,8,Cd),[[je,M.value.message]]),W(`p`,{id:R(`delete`,`message-help`),class:`mt-2 text-xs text-gray-500`},J(Rd),8,wd),j.value.message?(e(),S(`p`,{key:0,id:R(`delete`,`message-error`),class:`mt-1 text-xs text-red-600`},J(j.value.message[0]),9,Td)):U(``,!0)])])):O.value===`undelete`?(e(),S(`div`,Ed,[...r[37]||=[W(`p`,null,`Are you sure you want to undelete this thread?`,-1)]])):O.value===`hide`?(e(),S(`div`,Dd,[W(`div`,null,[W(`label`,{for:R(`hide`,`reason`),class:`mb-1 block text-sm font-semibold`},` Reason `,8,Od),V(W(`select`,{id:R(`hide`,`reason`),"onUpdate:modelValue":r[13]||=e=>M.value.reason=e,"aria-describedby":z(j.value.reason?R(`hide`,`reason-error`):void 0),"aria-invalid":!!j.value.reason,class:`h-10 w-full rounded-lg border border-gray-300 bg-white px-3 text-sm`,disabled:k.value},[r[38]||=W(`option`,{value:``,disabled:``},`Select a reason`,-1),(e(!0),S(q,null,Ce(f.value,(t,n)=>(e(),S(`option`,{key:n,value:n},J(t),9,Ad))),128))],8,kd),[[Ee,M.value.reason]]),j.value.reason?(e(),S(`p`,{key:0,id:R(`hide`,`reason-error`),class:`mt-1 text-xs text-red-600`},J(j.value.reason[0]),9,jd)):U(``,!0)]),W(`div`,null,[W(`label`,{for:R(`hide`,`note`),class:`mb-1 block text-sm font-semibold`},` Note `,8,Md),V(W(`textarea`,{id:R(`hide`,`note`),"onUpdate:modelValue":r[14]||=e=>M.value.note=e,rows:`6`,"aria-describedby":z(R(`hide`,`note-help`),j.value.note?R(`hide`,`note-error`):void 0),"aria-invalid":!!j.value.note,class:`w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm`,disabled:k.value},null,8,Nd),[[je,M.value.note]]),W(`p`,{id:R(`hide`,`note-help`),class:`mt-2 text-xs text-gray-500`},J(Bd),8,Pd),j.value.note?(e(),S(`p`,{key:0,id:R(`hide`,`note-error`),class:`mt-1 text-xs text-red-600`},J(j.value.note[0]),9,Fd)):U(``,!0)])])):O.value===`unhide`?(e(),S(`div`,Id,[...r[39]||=[W(`p`,null,`Are you sure you want to unhide this thread?`,-1)]])):U(``,!0),j.value.general?(e(),S(`p`,Ld,J(j.value.general[0]),1)):U(``,!0),h(E(cu),null,{default:G(()=>[h(E(ou),{"as-child":``},{default:G(()=>[h(E(X),{variant:`outline`,disabled:k.value},{default:G(()=>
77[...r[40]||=[l(` Cancel `,-1)]]),_:1},8,[`disabled`])]),_:1}),O.value===`suspend-user`?(e(),t(E(X),{key:0,disabled:k.value,onClick:r[15]||=e=>B(`suspend-user`,{reason:M.value.reason,note:M.value.note})},{default:G(()=>[...r[41]||=[l(` Suspend user `,-1)]]),_:1},8,[`disabled`])):O.value===`unsuspend-user`?(e(),t(E(X),{key:1,disabled:k.value,onClick:r[16]||=e=>ie(`unsuspend-user`)},{default:G(()=>[...r[42]||=[l(` Unsuspend user `,-1)]]),_:1},8,[`disabled`])):O.value===`withdraw`?(e(),t(E(X),{key:2,disabled:k.value,onClick:r[17]||=e=>B(`withdraw`,{message:M.value.message})},{default:G(()=>[...r[43]||=[l(` Withdraw thread `,-1)]]),_:1},8,[`disabled`])):O.value===`unwithdraw`?(e(),t(E(X),{key:3,disabled:k.value,onClick:r[18]||=e=>ie(`unwithdraw`)},{default:G(()=>[...r[44]||=[l(` Unwithdraw thread `,-1)]]),_:1},8,[`disabled`])):O.value===`delete`?(e(),t(E(X),{key:4,disabled:k.value,onClick:r[19]||=e=>B(`delete`,{reason:M.value.reason,message:M.value.message})},{default:G(()=>[...r[45]||=[l(` Delete thread `,-1)]]),_:1},8,[`disabled`])):O.value===`undelete`?(e(),t(E(X),{key:5,disabled:k.value,onClick:r[20]||=e=>ie(`undelete`)},{default:G(()=>[...r[46]||=[l(` Undelete thread `,-1)]]),_:1},8,[`disabled`])):O.value===`hide`?(e(),t(E(X),{key:6,disabled:k.value,onClick:r[21]||=e=>B(`hide`,{reason:M.value.reason,note:M.value.note})},{default:G(()=>[...r[47]||=[l(` Hide thread `,-1)]]),_:1},8,[`disabled`])):O.value===`unhide`?(e(),t(E(X),{key:7,disabled:k.value,onClick:r[22]||=e=>ie(`unhide`)},{default:G(()=>[...r[48]||=[l(` Unhide thread `,-1)]]),_:1},8,[`disabled`])):U(``,!0)]),_:1})]),_:1})]),_:1},8,[`open`])])):U(``,!0)}}},Hd={__name:`ThreadNewsletterControls`,props:{post:{type:Object,required:!0}},emits:[`close`],setup(n,{emit:r}){let i=n,a=r,o=ze(),s=T(()=>o.value?.user??{}),c=T(()=>s.value?.can_access_frontend_controls??!1),u=T(()=>s.value?.can_run_manage_daily_newsletter_action??!1),d=T(()=>o.value?.frontend_controls?.thread??{}),f=T(()=>{let e=d.value?.newsletter_statuses??{};return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t===`-`?`Neutral`:t]))}),p=A(i.post.admin_newsletter_status??null),m=T(()=>i.post.id),g=A(!1);ce(()=>i.post.admin_newsletter_status,e=>{p.value=e??null});let _=async e=>{if(!m.value||g.value)return;let t=p.value;g.value=!0;let n=Xe(`/api/v3/talk/threads/${m.value}/frontend-controls/newsletter`,{immediate:!1}).post({status:e}).json();try{if(await n.execute(),n.statusCode.value===422||n.error.value){p.value=t;return}p.value=e,a(`close`)}finally{g.value=!1}},v=(e,t)=>{t?.preventDefault?.(),t?.stopPropagation?.(),!g.value&&_(e)};return(n,r)=>{let i=fe(`icon`);return c.value&&u.value?(e(),t(E($t),{key:0},{default:G(()=>[h(E(rn),{class:`cursor-pointer gap-2 text-red-600 hover:bg-transparent hover:underline focus:bg-transparent focus:underline data-[state=open]:bg-transparent`},{default:G(()=>[V(W(`i`,null,null,512),[[i,{icon:`envelope`,classes:`before:size-4 before:shrink-0`}]]),r[0]||=l(` Daily newsletter `,-1)]),_:1}),h(E(dn),{class:`w-64`},{default:G(()=>[h(E(an),{"model-value":p.value,class:`text-red-600`},{default:G(()=>[(e(!0),S(q,null,Ce(f.value,(n,r)=>(e(),t(E(cn),{key:r,value:r,disabled:g.value,class:`text-red-600 focus:bg-transparent data-[state=checked]:bg-transparent`,onSelect:e=>v(r,e)},{default:G(()=>[l(J(n),1)]),_:2},1032,[`value`,`disabled`,`onSelect`]))),128))]),_:1},8,[`model-value`])]),_:1})]),_:1})):U(``,!0)}}},Ud={key:0,class:`word-break-break-word relative -mx-1 -mt-1 rounded-t bg-gray-100 p-4 pl-10 font-bold dark:border-b dark:border-gray-700 dark:bg-gray-800`},Wd={key:1,class:`relative -mx-1 -mt-1 rounded-t bg-gray-100 p-4 pl-10 font-bold`},Gd=tt(vn({variant:`ghost`}),`outline-none absolute right-0 top-0 h-5 rounded-sm border-0 p-1 text-blue-700 hover:bg-inherit hover:text-blue-900`),Kd={__name:`PostMenu`,props:{post:{type:Object,required:!0},parentPost:{type:Object,default:null},dispatchesEvents:{type:Boolean,default:!1}},setup(n){let r=n,{scrollToStart:i,scrollToEnd:a,isFetchingStart:o,isFetchingEnd:s}=vl(),c=$e().smaller(`lg`),u=ze(),{isGuest:f}=Ze(),p=w(!1),g=w(!1),_=we(`menuTrigger`),v=async({opens:e=!1,focuses:t=!1}={})=>{let n=g.value;g.value=!0,!n&&t&&(await d(),_.value?.$el?.focus?.()),e&&(p.value=!0)},y=u.value.user.is_logged_in,b=u.value.user.is_verified,x=u.value.user.is_premium,C=u.value.user.is_mnhq,D=T(()=>r.post.post_type===`thread`),O=T(()=>{let e=new URL(H?.location.href);return r.post.post_type===`reply`&&e.searchParams.set(`reply`,r.post.id),e}),A=(e={})=>{p.value=!1,ln({redirectUrl:O.value.toString(),...e})},{saveLabel:j,saveIcon:M,handlePostSave:ee,loadingSave:N,saveClickId:P}=iu(r.post),F=async()=>
77{if(!N.value){if(f.value){ln({configKey:`save`,dataId:`save`});return}return await ee()}},I=()=>{window.location=`/talk/private-messages?foruser=${r.post.username}`},te=e=>{if(f.value){A({promptType:`login`,dataId:`thread-post-report`}),nt(e,`sign_up_login_trigger:thread-post-report`);return}let t=D.value?r.post.slug:`${r.parentPost.slug}/${r.post.id}`;H.location=`/talk/${t}/create-report`},L=()=>{if(x||C){let e=D.value?r.post.link:r.parentPost.link;window.location.href=`${e}?postsby=${r.post.username}`;return}window.Livewire.dispatchTo(`modal`,`show-modal`,{partial:`talk.modals.premium-cta`})},R=async e=>{e.preventDefault(),await i({behavior:`smooth`}),p.value=!1},z=async e=>{e.preventDefault(),await a({behavior:`smooth`}),p.value=!1},ne=()=>{window.location=D.value?`/talk/${r.post.slug}/edit`:`/talk/${r.parentPost.slug}/${r.post.id}/edit`},re=()=>rr().handleShare(D.value?r.post.subject:r.parentPost.subject,r.post.link,`thread`),B=()=>r.post.is_author&&r.post.editable_until&&new Date(r.post.editable_until)>new Date,ie=w(B()),ae;return ce(()=>r.post,()=>{clearTimeout(ae),ie.value=B(),r.post.editable_until&&(ae=setTimeout(()=>{ie.value=!1},new Date(r.post.editable_until).getTime()-Date.now()))}),(n,i)=>{let a=fe(`icon`);return g.value?(e(),t(E(fn),{key:1,open:p.value,"onUpdate:open":i[10]||=e=>p.value=e,modal:!1},{default:G(()=>[h(E(Qt),{"as-child":``},{default:G(()=>[V(h(E(X),{ref_key:`menuTrigger`,ref:_,variant:`ghost`,class:`absolute right-0 top-0 h-5 rounded-sm border-0 p-1 text-blue-700 hover:bg-inherit hover:text-blue-900`,"aria-label":`Post options`,"data-click-id":`thread-post-options`,"aria-expanded":p.value},null,8,[`aria-expanded`]),[[a,{icon:`ellipsis`,classes:`before:size-5 before:block`}]])]),_:1}),p.value?(e(),t(E(hn),{key:0,to:`body`},{default:G(()=>[...i[11]||=[W(`div`,{class:`fixed inset-0 z-30 bg-black/30 lg:bg-transparent`},null,-1)]]),_:1})):U(``,!0),h(E(Xt),{align:`end`,"align-offset":-16,loop:``,class:`w-screen text-sm lg:w-auto lg:max-w-xs`,side:`bottom`,"avoid-collisions":E(c),sticky:E(c)?`always`:`partial`,onCloseAutoFocus:i[9]||=k(()=>{},[`prevent`])},{default:G(()=>[E(y)&&!E(b)?V((e(),S(`p`,Ud,[...i[12]||=[l(` You need to confirm your email address to access all these features `,-1)]])),[[a,{icon:`circle-exclamation`,classes:`before:size-4 before:mt-0.5 before:absolute before:left-4 before:top-4 before:text-blue-700 before:dark:text-white`}]]):U(``,!0),E(y)?U(``,!0):V((e(),S(`div`,Wd,[i[13]||=l(` Please `,-1),W(`button`,{class:`cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none`,onClick:i[3]||=e=>A({promptType:`register`,dataId:`thread-post-create-an-account`})},` create an account `),i[14]||=l(` or `,-1),W(`button`,{class:`cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none`,onClick:i[4]||=e=>A({promptType:`login`,dataId:`thread-post-log-in`})},` log in `),i[15]||=l(` to access all these features `,-1)])),[[a,{icon:`circle-exclamation`,classes:`before:absolute before:left-4 before:top-4 before:size-4 before:mt-0.5 before:text-blue-700 word-break-break-word`}]]),E(c)?V((e(),t(E(X),{key:2,variant:`ghost`,class:`ml-auto flex border-0 p-2 text-blue-700 hover:bg-inherit hover:text-blue-900`,"aria-label":`Close post options popup`,onClick:i[5]||=e=>p.value=!1},null,512)),[[a,{icon:`xmark`,classes:`before:size-5 before:mb-0.5 before:block`}]]):U(``,!0),r.post.is_author?U(``,!0):(e(),S(q,{key:3},[V((e(),t(E(Y),{"data-click-id":r.post.post_type===`thread`?E(sr)(`${E(P)}-thread`,`op-menu`):`${E(P)}-${r.post.post_type}`,disabled:!E(y)||E(N),onSelect:F},{default:G(()=>[l(J(E(j)),1)]),_:1},8,[`data-click-id`,`disabled`])),[[a,{icon:E(M),classes:`before:size-4 before:shrink-0`,loading:E(N)}]]),V((e(),t(E(Y),{"data-click-id":`private_message_engagement:thread-pm`,disabled:!E(b)||!E(y),onSelect:I},{default:G(()=>[...i[16]||=[l(` PM `,-1)]]),_:1},8,[`disabled`])),[[a,{icon:`envelope`,classes:`before:size-4 before:shrink-0`}]])],64)),V((e(),t(E(Y),{disabled:!E(y),onSelect:L},{default:G(()=>[l(J(`See all by ${r.post.username}`),1)]),_:1},8,[`disabled`])),[[a,{icon:`comment`,classes:`before:size-4 before:shrink-0`}]]),E(c)?V((e(),t(E(Y),{key:4,"data-click-id":`cta_share_post:share-post-mobile`,onSelect:re},{default:G(()=>[...i[17]||=[l(` Share `,-1)]]),_:1}
77)),[[a,{icon:`arrow-turn-right`,classes:`before:size-4 before:shrink-0`}]]):U(``,!0),E(y)?(e(),t(Jn,{key:5,class:`mx-2 w-fit lg:hidden`},{default:G(()=>[...i[18]||=[W(`span`,{class:`text-xs`},` Sharing posts outside of Mumsnet does not disclose your username `,-1)]]),_:1})):U(``,!0),V((e(),t(E(Y),{onSelect:R},{default:G(()=>[...i[19]||=[l(` Top `,-1)]]),_:1})),[[a,{icon:`arrow-up-long`,classes:`before:size-4 before:shrink-0`,loading:E(o)}]]),V((e(),t(E(Y),{onSelect:z},{default:G(()=>[...i[20]||=[l(` Bottom `,-1)]]),_:1})),[[a,{icon:`arrow-down-long`,classes:`before:size-4 before:shrink-0`,loading:E(s)}]]),V((e(),t(E(Y),{onSelect:te},{default:G(()=>[...i[21]||=[l(` Report `,-1)]]),_:1})),[[a,{icon:`circle-exclamation`,classes:`before:size-4 before:shrink-0`}]]),ie.value?V((e(),t(E(Y),{key:6,onSelect:ne},{default:G(()=>[...i[22]||=[l(` Edit post `,-1)]]),_:1})),[[a,{icon:`pen`,classes:`before:size-4 before:shrink-0`}]]):U(``,!0),r.post.post_type===`thread`?(e(),t(Vd,{key:7,post:r.post,onClose:i[6]||=e=>p.value=!1},null,8,[`post`])):U(``,!0),r.post.post_type===`thread`?(e(),t(Hd,{key:8,post:r.post,onClose:i[7]||=e=>p.value=!1},null,8,[`post`])):U(``,!0),r.post.post_type===`reply`?(e(),t(Zu,{key:9,post:r.post,"parent-post":r.parentPost,onClose:i[8]||=e=>p.value=!1},null,8,[`post`,`parent-post`])):U(``,!0)]),_:1},8,[`avoid-collisions`,`sticky`])]),_:1},8,[`open`])):V((e(),S(`button`,{key:0,type:`button`,class:m(E(Gd)),"aria-label":`Post options`,"aria-haspopup":`menu`,"aria-expanded":`false`,"data-click-id":`thread-post-options`,onPointerenter:i[0]||=e=>v(),onFocus:i[1]||=e=>v({focuses:!0}),onClick:i[2]||=e=>v({opens:!0})},null,34)),[[a,{icon:`ellipsis`,classes:`before:size-5 before:block`}]])}}},qd=[`id`,`data-feed-item`],Jd={class:`relative mt-1`},Yd={class:`word-break-break-word h4 inline text-2xl font-bold`},Xd={class:`mt-2 flex justify-between break-all font-bold`},Zd={class:`mt-2 flex w-full flex-wrap items-center justify-between space-x-3`},Qd={class:`prose flex max-w-full items-center first:ml-auto dark:text-white lg:text-sm`},$d=[`data-click-id`],ef=[`data-click-id`],tf={__name:`OriginalPost`,props:{thread:{type:Object,required:!0},opReplies:{type:Array,default:()=>[]},dispatchesEvents:{type:Boolean,default:!1}},setup(n){let r=n,i=T(()=>`thread:${r.thread.id}`),{isHighlighted:a,classes:o}=Wn(i),{backgroundColor:s,labelColor:c,isHighlightedPost:u}=tr(r.thread),{isGuest:d}=Ze(),f=ze(),p=T(()=>{let e=f.value?.preferences??{},t=e.talk_show_my_post_labels??!0,n=e.talk_show_op_labels??!0;return r.thread.is_from_mnhq?`MNHQ`:r.thread.is_author?t?`My post`:null:r.thread.is_author?null:n?`Original poster`:null}),{hasNextPost:g,navigateToNextPost:_,navigateToSeeAll:v}=Hl(()=>r.thread,()=>r.opReplies);return(i,f)=>(e(),S(`div`,{id:`thread${r.thread.id}`,class:m(E(tt)(`relative mt-1.5 rounded-xl border border-gray-200 px-4 pb-1 pt-3 dark:border-gray-800 max-md:scroll-mt-28 lg:pb-2.5`,!E(a)&&E(s),E(o))),role:`article`,"data-feed-item":`thread:${r.thread.id}`,tabindex:`0`},[W(`div`,Jd,[p.value===null?U(``,!0):(e(),S(`div`,{key:0,class:m(E(tt)(`mb-2 inline-block rounded-lg px-2 py-1 text-sm font-semibold text-white`,E(c)))},J(p.value),3)),W(`div`,{class:m({"pr-8":p.value===null})},[W(`h1`,Yd,J(r.thread.subject),1),h(Vl,null,{default:G(()=>[l(J(E(Ve)(r.thread.replies_count,`reply`)),1)]),_:1})],2),h(Kd,{post:r.thread,"dispatches-events":n.dispatchesEvents},null,8,[`post`,`dispatches-events`])]),W(`div`,Xd,[h(nr,{post:r.thread},null,8,[`post`])]),r.thread.guest?(e(),t(tu,{key:0,thread:r.thread},null,8,[`thread`])):U(``,!0),h(E(Fn),{class:`post-body prose-bullets-dark prose mt-2 w-full break-words leading-6 dark:text-white`,html:r.thread.parsed_body??r.thread.body},null,8,[`html`]),h(Kl,{post:r.thread},null,8,[`post`]),r.thread.images&&!r.thread.non_safe_images_exists?(e(),t($n,{key:1,images:r.thread.images},null,8,[`images`])):U(``,!0),r.thread.non_safe_images_exists&&r.thread.is_author?(e(),t(Jn,{key:2,class:`mt-3.5`},{default:G(()=>[...f[2]||=[W(`p`,null,` Your images are currently under review. Please check back later. `,-1)]]),_:1})):U(``,!0),r.thread.gif?(e(),t(zn,{key:3,gif:r.thread.gif},null,8,[`gif`])):U(``,!0),r.thread.rich_preview_link?(e(),t(On,{key:4,link:r.thread.rich_preview_link},null,8,[`link`])):U(``,!0),W(`div`,Zd,[r.thread.is_author||E(Ze)().isMnhq?(e(),t(er,{key:0,post:r.thread},null,8,[`post`])):U(``,!0),W(`div`,Qd,[f[3]||=l(` OP posts: `,-1),E(g)?(e(),S(`button`,{key:0,class:`ml-3 cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white`,"data-id":`op-post-tooltip-next`,"data-click-id":E(d)?`sign_up_login_trigger:thread-see-next`:`op_filter_engagement:thread-see-next`,onClick:f[0]||=(...e)=>E(_)&&E(_)(...e)}
77,` See next `,8,$d)):U(``,!0),W(`button`,{class:`ml-3 cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white`,"data-id":`op_filter_engagement:thread-see-all`,"data-click-id":E(d)?`sign_up_login_trigger:thread-see-all`:`op_filter_engagement:thread-see-all`,"aria-expanded":`false`,onClick:f[1]||=(...e)=>E(v)&&E(v)(...e)},` See all `,8,ef)])]),h(or,{thread:r.thread,"is-highlighted-post":E(u),"post-type":`thread`},null,8,[`thread`,`is-highlighted-post`])],10,qd))}},nf={class:`mt-4 rounded-xl border bg-white p-4`},rf={class:`flex flex-col items-start rounded bg-transparent`},af={class:`mt-3 w-full space-y-3 sm:flex sm:flex-row sm:space-x-3 sm:space-y-0`},of={__name:`CreateAccountCta`,setup(t){let n=()=>{let e=new URL(H?.location.href??`https://www.mumsnet.com`);return e.searchParams.has(`reply`)&&e.searchParams.delete(`reply`),e.toString()},r=e=>{ln({promptCode:`reply.create`,dataId:`reply-create`,promptType:e,redirectUrl:n()})};return(t,n)=>(e(),S(`div`,nf,[W(`div`,rf,[n[4]||=W(`strong`,{class:`h4 block`},`Please create an account`,-1),n[5]||=W(`p`,{class:`pt-2 text-lg`},` To comment on this thread you need to create a Mumsnet account. `,-1),W(`div`,af,[h(Nt,{class:`w-full sm:w-1/4`,size:`sm`,"data-click-id":`sign_up_login_trigger:thread-create-post`,onClick:n[0]||=e=>r(`register`)},{default:G(()=>[...n[2]||=[l(` Join Mumsnet `,-1)]]),_:1}),h(Nt,{class:`w-full sm:w-1/4`,kind:`blue-inverse`,size:`sm`,"data-click-id":`sign_up_login_trigger:thread-create-post`,onClick:n[1]||=e=>r(`login`)},{default:G(()=>[...n[3]||=[l(` Log In `,-1)]]),_:1})])])]))}},sf={id:`post-box`},cf={__name:`PostBox`,props:{thread:{type:Object,required:!0},replyFormKey:{type:Number,required:!0}},setup(n){let r=n,i=ze(),{isLoggedIn:a,isMnhq:o,user:s,isGuest:c,isPremium:l}=Ze(),u=T(()=>{if(o.value)return null;let{thread:e}=r,{topic:t}=e,n=()=>{let n=t.new_users_can_not_post_for_x_days??0,r=e.new_users_can_not_post_for_x_days??0;return Math.max(n,r)},i=()=>{let e=n(),t=s.value.verified_account_age??0;return c.value?e>0:t<e},a=()=>`This thread is closed and is no longer accepting replies.
78               <a href="/talk/create-thread?topic=${t.slug}" class="font-semibold">
79                   Click here to start a new thread.
80               </a>`,l=()=>{let r=t.new_users_can_not_post_for_x_days??0,i=e.new_users_can_not_post_for_x_days??0,a=n();return`This ${r>i?`topic`:`thread`} prevents users from posting on it until they have been members for at least ${Ve(a,`day`)}.`};switch(!0){case e.is_closed:return a();case e.is_suspended:return`Posting is temporarily suspended on this thread.`;case e.has_reached_reply_limit:return`This thread is not accepting new messages.`;case t.prevent_user_replies:return`Replies to this thread have been disabled.`;case i():return l();default:return null}});return(a,o)=>(e(),S(`div`,sf,[u.value?(e(),t(Jn,{key:0,kind:`warning`,class:m([`prose mt-4 max-w-none text-sm`,{"scroll-mt-28":!E(l)}])},{default:G(()=>[h(E(Fn),{html:u.value},null,8,[`html`])]),_:1},8,[`class`])):(e(),t(Gn,{key:r.replyFormKey,class:m([`mt-4 rounded-xl border bg-white p-4 pt-3.5`,{"max-lg:scroll-mt-28":!E(l)}]),"thread-id":r.thread.id,"initial-username":r.thread.default_posting_username,"mentionable-usernames":r.thread.mentionable_usernames,"has-posted":r.thread.has_posted,"username-count":E(s).username_count,"watch-thread":E(i).preferences.talk_watch_threads_posted_on,"redirect-after-post":!1,"zombie-notice":n.thread.is_zombie?`/talk/create-thread?topic=${r.thread.topic.slug}`:null,"dispatches-events":!0},null,8,[`class`,`thread-id`,`initial-username`,`mentionable-usernames`,`has-posted`,`username-count`,`watch-thread`,`zombie-notice`])),E(c)&&u.value?(e(),t(of,{key:2,class:m({"scroll-mt-28":!E(l)})},null,8,[`class`])):U(``,!0)]))}},lf=A(!1);Ae(`keydown`,()=>lf.value=!0,{passive:!0,capture:!0,once:!0});var uf=()=>De(lf),df={key:0,ref:`root`,class:`relative mt-1.5 h-auto overflow-hidden text-white transition-all duration-700 ease-in sm:h-10`},ff={class:`flex h-auto items-center justify-center space-x-1 rounded-xl bg-purple-600 px-4 py-2 text-sm font-bold sm:h-10 sm:px-0 sm:py-0`},pf={class:`text-pretty`},mf={__name:`ReplyResumeBanner`,props:M({posinset:{type:Number,default:void 0}
80,setsize:{type:Number,default:void 0}},{open:{type:Boolean,default:!0},openModifiers:{}}),emits:[`update:open`],setup(n){let r=oe(n,`open`),i=n,{isScrolling:a}=ee(),o=R(we(`root`)),s=e=>{if(!g||a.value||!o.value)return;let t=window.scrollY,n=()=>e.getBoundingClientRect().height+ +getComputedStyle(e).marginTop.replace(`px`,``)+ +getComputedStyle(e).marginBottom.replace(`px`,``),r=n(),i=()=>{if(a.value||!o.value)return;let e=r-n();e>=r||(scrollTo({top:t-e,behavior:`instant`}),requestAnimationFrame(i))};requestAnimationFrame(i)};return(n,a)=>{let o=fe(`icon`);return e(),t(de,{"enter-from-class":`opacity-0 !h-0 mt-0`,"leave-to-class":`opacity-0 !h-0 mt-0`,onBeforeLeave:s},{default:G(()=>[r.value?(e(),S(`div`,df,[W(`div`,ff,[W(`div`,pf,` Welcome back. You're at `+J(i.posinset)+`/`+J(i.setsize)+` — pick up where you left off. `,1)]),V(h(E(X),{variant:`ghost`,size:`sm`,class:`absolute right-2 top-2 hidden size-6 rounded border-0 p-1 hover:bg-inherit xs:flex`,"aria-label":`Dismiss`,onClick:a[0]||=e=>r.value=!1},null,512),[[o,{icon:`xmark`,classes:`before:size-4 before:block`}]])],512)):U(``,!0)]),_:1})}}},hf={__name:`ThreadInsert`,props:{insert:{type:Object,required:!0}},setup(n){let{isPremium:r}=Ze();function i(e){return{"hidden lg:flex":e===`desktop`,"lg:hidden":e===`mobile`}}function a(e){return e===`mobile`?`inline`:``}return(o,s)=>(e(),S(`div`,null,[n.insert.type===`affiliate_trending`?(e(),t(Bn,{key:0,class:m([`mt-1.5 h-[428px]`,i(n.insert.data.device)]),"click-id-context":a(n.insert.data.device)},null,8,[`class`,`click-id-context`])):U(``,!0),n.insert.type===`cbot`?(e(),t(Vn,{key:1,content:n.insert.data},null,8,[`content`])):U(``,!0),n.insert.type===`discover_cta`?(e(),t(Tn,{key:2,subjects:n.insert.data},null,8,[`subjects`])):U(``,!0),n.insert.type===`feed_ad`?(e(),t(E(kn),{key:3,class:`mt-1.5`,"slot-id":n.insert.data.slot_id,"slot-name":n.insert.data.slot_name,device:n.insert.data.device,index:n.insert.data.index},null,8,[`slot-id`,`slot-name`,`device`,`index`])):U(``,!0),n.insert.type===`mpu`?(e(),t(Pn,{key:4,class:`my-11`,"slot-id":n.insert.data.slot_id,"slot-name":n.insert.data.slot_name,device:n.insert.data.device,sizes:n.insert.data.sizes,sticky:n.insert.data.sticky,render:n.insert.data.render??!1},null,8,[`slot-id`,`slot-name`,`device`,`sizes`,`sticky`,`render`])):U(``,!0),n.insert.type===`primis`?(e(),t(Hn,{key:5,"primis-id":n.insert.data.primis_id,size:n.insert.data.size,feature:n.insert.data.feature,leaderboard:n.insert.data.leaderboard??!1},null,8,[`primis-id`,`size`,`feature`,`leaderboard`])):U(``,!0),n.insert.type===`trending`?(e(),t(Un,{key:6,class:m([`mt-1.5 h-[428px]`,i(n.insert.data.device)]),"click-id-context":a(n.insert.data.device)},null,8,[`class`,`click-id-context`])):U(``,!0),n.insert.type===`similar_threads`?(e(),t(Qn,{key:7,"init-threads":n.insert.data.similar_threads,canonical:n.insert.data.canonical,"page-title":n.insert.data.page_title,class:m([`mt-1.5`,{"max-lg:scroll-mt-28":E(r),"h-[381px] lg:h-[282px]":n.insert.data.similar_threads_count===5,"h-[316px] lg:h-[237px]":n.insert.data.similar_threads_count===4,"h-[251px] lg:h-[192px]":n.insert.data.similar_threads_count===3},i(n.insert.data.device)])},null,8,[`init-threads`,`canonical`,`page-title`,`class`])):U(``,!0),n.insert.type===`survey`?(e(),t(_n,{key:8,survey:n.insert.data.survey},null,8,[`survey`])):U(``,!0)]))}},gf=[`id`,`aria-posinset`,`aria-setsize`,`data-feed-item`],_f={class:`relative mt-2`},vf={class:`mb-4 mt-3 flex space-x-2.5 text-sm before:text-blue-700 before:dark:text-white`},yf={class:`flex flex-col space-y-1 pl-2 leading-5`},bf={class:`font-bold`},xf=[`id`,`data-reply-id`,`aria-posinset`,`aria-setsize`,`data-feed-item`],Sf={class:`relative mt-1`},Cf={key:0,class:`mt-2 inline-flex items-center space-x-1 rounded-full bg-gray-200 px-2 py-px text-[13px] text-gray-600`},wf={key:6},Tf={key:0,class:`mt-2 flex w-full flex-wrap justify-between space-x-3`},Ef={class:`first:ml-auto`},Df={key:0,class:`flex items-center justify-end dark:text-white lg:text-sm`},Of=[`data-click-id`],kf=[`data-click-id`],Af={key:1,class:`mt-2 flex justify-end lg:text-sm`},jf={__name:`ReplyPost`,props:{thread:{type:Object,required:!0},reply:{type:Object,required:!0},isBookmarked:{type:Boolean,required:!0},isReplyTarget:{type:Boolean,required:!1},isInitialReplyTarget:{type:Boolean,required:!1}
80,opReplies:{type:Array,default:()=>[]},dispatchesEvents:{type:Boolean,default:!1},isPinned:{type:Boolean,default:!1},type:{type:String,default:`standard`,validator:e=>[`standard`,`go-to-post`].includes(e)}},emits:[`reply-target-loaded`,`go-to-post`,`set-old-url`],setup(n,{emit:r}){let a=n,o=r,s=uf(),c=We(`bookmark-start-thread-prompt`),u=T(()=>`reply:${a.reply.id}`),{isHighlighted:f,classes:p}=Wn(u),g=w(!1),_=w(!1),v=we(`eventObserver`),y=ze(),{backgroundColor:b,labelColor:x,isHighlightedPost:C}=tr(a.reply),{isGuest:D,isPremium:O}=Ze(),k=T(()=>{let e=y.value?.preferences??{},t=e.talk_show_my_post_labels??!0,n=e.talk_show_op_labels??!0;return a.reply.is_from_mnhq||a.reply.is_from_nightwatch?`MNHQ`:a.reply.is_from_expert?`Expert`:a.reply.is_author?t?`My post`:null:a.reply.is_op&&n?`Original poster`:null}),{hasNextPost:A,navigateToNextPost:j,navigateToSeeAll:M}=Hl(()=>a.reply,()=>a.opReplies),ee=()=>{if(D.value){ln({configKey:`expert`,dataId:`expert`});return}window.location.href=`${a.thread.link}?show-expert-replies=1`},N=()=>{o(`go-to-post`,a.reply.id)},P=T(()=>g.value&&!_.value),F=()=>{if(P.value){_.value=!0;let e=a.reply.observer_event;window.dispatchEvent(e),o(`set-old-url`,e.detail.newUrl)}};return I(()=>{a.isReplyTarget&&d(()=>{o(`reply-target-loaded`)}),a.reply.observer_event!==void 0&&a.reply.observer_event instanceof CustomEvent&&(i(v,([e])=>{e?.isIntersecting&&F()}),g.value=!0)}),(n,r)=>{let i=fe(`icon`);return e(),S(`div`,null,[P.value?(e(),S(`div`,{key:0,ref_key:`eventObserver`,ref:v},null,512)):U(``,!0),(e(!0),S(q,null,Ce(a.reply.inserts?.above,(n,r)=>(e(),t(hf,{key:r,insert:n},null,8,[`insert`]))),128)),a.isInitialReplyTarget?(e(),t(mf,{key:1,posinset:a.reply.posinset,setsize:a.thread.replies_count},null,8,[`posinset`,`setsize`])):U(``,!0),a.reply.was_moderated?(e(),S(`div`,{key:2,id:`reply${a.reply.id}`,class:m(E(tt)(`mt-1.5 overflow-x-hidden rounded-xl border border-gray-400 bg-gray-300 p-4 pb-1 pt-3 dark:border-gray-700 dark:bg-gray-900 lg:py-3`,{"scroll-mt-40":a.isInitialReplyTarget,"max-lg:scroll-mt-28":!E(O)&&!a.isInitialReplyTarget})),role:`article`,"aria-posinset":a.reply.posinset,"aria-setsize":a.thread.replies_count,"data-feed-item":`reply:${a.reply.id}`,tabindex:`0`},[W(`div`,_f,[h(nr,{post:a.reply,class:`break-all`},null,8,[`post`]),a.isPinned?U(``,!0):(e(),t(Kd,{key:0,post:a.reply,"parent-post":a.thread,"dispatches-events":a.dispatchesEvents},null,8,[`post`,`parent-post`,`dispatches-events`]))]),V((e(),S(`div`,vf,[W(`div`,yf,[W(`p`,bf,J(a.reply.title),1),h(E(Fn),{class:`font-light`,html:a.reply.message},null,8,[`html`])])])),[[i,{icon:`circle-exclamation`,classes:`before:h-4 before:w-4 before:mt-0.5 before:flex-none`}]])],10,gf)):(e(),S(`div`,{key:3,id:`reply${a.reply.id}`,"data-reply-id":a.reply.id,class:m(E(tt)(`mt-1.5 overflow-x-hidden rounded-xl border border-gray-200 px-4 pb-1 pt-3 ring-offset-background focus-visible:outline-none dark:border-gray-800 dark:bg-gray-800 lg:pb-2.5`,E(s)&&`focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,!E(f)&&E(b),E(p),{"scroll-mt-40":a.isInitialReplyTarget,"max-lg:scroll-mt-28":!E(O)&&!a.isInitialReplyTarget})),role:`article`,tabindex:`0`,"aria-posinset":a.reply.posinset,"aria-setsize":a.thread.replies_count,"data-feed-item":`reply:${a.reply.id}`},[W(`div`,Sf,[k.value===null?U(``,!0):(e(),S(`div`,{key:0,class:m(E(tt)(`mb-2 inline-block rounded-lg px-2 py-1 text-sm font-semibold text-white`,E(x)))},J(k.value),3)),h(nr,{post:a.reply,label:k.value},null,8,[`post`,`label`]),a.isPinned?U(``,!0):(e(),t(Kd,{key:1,post:a.reply,"parent-post":a.thread,"dispatches-events":a.dispatchesEvents},null,8,[`post`,`parent-post`,`dispatches-events`]))]),a.isPinned?V((e(),S(`div`,Cf,[...r[2]||=[l(` Pinned `,-1)]])),[[i,{icon:`thumbtack-solid`,classes:`before:size-3 before:block before:mr-1`}]]):U(``,!0),a.reply.quoted?(e(),t(Kn,{key:1,"op-id":a.reply.thread_id,quote:a.reply.quoted,depth:0},null,8,[`op-id`,`quote`])):U(``,!0),h(E(Fn),{class:`post-body prose-bullets-dark prose mt-2.5 w-full break-words leading-6 dark:text-white`,html:a.reply.parsed_body??a.reply.body},null,8,[`html`]),h(Kl,{post:a.reply},null,8,[`post`]),a.reply.gif?(e(),t(zn,{key:2,gif:a.reply.gif},null,8,[`gif`])):U(``,!0),a.reply.images&&!a.reply.non_safe_images_exists?(e(),t($n,{key:3,images:a.reply.images},null,8,[`images`])):U(``,!0),a.reply.non_safe_images_exists&&a.reply.is_author?(e(),t(Jn,{key:4,class:`mt-3.5`},{default:G(()=>[...r[3]||=[W(`p`,null,` Your images are currently under review. Please check back later. `,-1)]]),_:1})):U(``,!0),a.reply.rich_preview_link?(e(),t(On,{key:5,link:a.reply.rich_preview_link},null,8,[`link`])):U(``,!0),a.type===`standard`?(e(),S(`div`,wf,[a.reply.is_author||a.reply.is_op||a.reply.is_from_expert||E(Ze)().isMnhq?(e(),S(`div`,Tf,[a.reply.is_author||E(Ze)().isMnhq?(e(),t(er,{key:0,post:a.reply},null,8,[`post`])):U(``,!0),W(`div`,Ef,[a.reply.is_op?(e(),S(`div`,Df,[r[4]||=l(` OP posts: `,-1),E(A)?(e(),S(`button`,{key:0,class:`ml-3 cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white`,"data-click-id":E(D)?`sign_up_login_trigger:thread-see-next`:`op_filter_engagement:thread-see-next`,onClick:r[0]||=(...e)=>E(j)&&E(j)(...e)},` See next `,8,Of)):U(``,!0),W(`button`,{class:`ml-3 cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white`,"data-click-id":E(D)?`sign_up_login_trigger:thread-see-all`:`op_filter_engagement:thread-see-all`,"aria-expanded":`false`,onClick:r[1]||=(...e)=>E(M)&&E(M)(...e)},` See all `,8,kf)])):U(``,!0),a.reply.is_from_expert?(e(),S(`div`,Af,[r[5]||=l(` Experts' posts: `,-1),W(`button`,{class:`ml-3 cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white`,"data-id":`op-post-tooltip-all`,onClick:ee},` See all `)])):U(``,!0)])])):U(``,!0),h(or,{thread:a.thread,post:a.reply,"is-bookmarked":a.isBookmarked,"is-highlighted-post":E(C)},null,8,[`thread`,`post`,`is-bookmarked`,`is-highlighted-post`])])):U(``,!0),a.type===`go-to-post`?(e(),S(`div`,{key:7,class:m([`mt-4 flex items-center justify-end border-t pt-2 lg:text-sm`,{"border-gray-300":E(C),"border-gray-200":!E(C)}])},[V((e(),S(`button`,{class:`flex items-center text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white`,onClick:N},[...r[6]||=[l(` Go to post `,-1)]])),[[i,{icon:`arrow-right`,classes:`after:h-4 after:w-4 after:ml-3`,position:`after`}]])],2)):U(``,!0)],10,xf)),E(c)&&a.type===`standard`?(e(),t(dr,{key:4,"reply-id":a.reply.id,"topic-slug":a.thread.topic?.slug},null,8,[`reply-id`,`topic-slug`])):U(``,!0),(e(!0),S(q,null,Ce(a.reply.inserts?.below,(n,r)=>(e(),t(hf,{key:r,insert:n},null,8,[`insert`]))),128))])}}},Mf={class:`relative`},Nf={class:`absolute left-1/2 top-1/2 z-10 -translate-x-1/2 -translate-y-1/2 transform text-nowrap`},Pf={class:`h5 flex items-center gap-2 text-gray-800`},Ff={class:`mt-3 border-t border-gray-200`},If={class:`mt-2 grid w-full grid-cols-5 lg:grid-cols-6`},Lf={__name:`ReplySkeleton`,props:{label:{type:String,required:!0},fadeDown:{type:Boolean,default:!0}},setup(t){let n=t;return(r,i)=>(e(),S(`div`,Mf,[W(`div`,Nf,[W(`div`,Pf,[h(Xn,{class:`h-4 w-4`}),l(` `+J(t.label),1)])]),W(`div`,{class:m([`mt-1.5 border-x border-b from-white p-4 opacity-50 rounded-b-xl`,n.fadeDown?`bg-gradient-to-t`:`bg-gradient-to-b`])},[i[0]||=D(`<div class="animate-r-to-l skeleton-loading-gradient mb-6 mt-2 flex h-5 justify-between"><div class="w-2/3 flex-none"></div><div class="flex-1 bg-gray-100"></div></div><div class="animate-r-to-l skeleton-loading-gradient mb-2 flex h-4"><div class="w-12/12 flex-none"></div></div>`,2),W(`div`,Ff,[W(`div`,If,[(e(),S(q,null,Ce(6,e=>W(`div`,{key:e,class:m([`m-auto h-10 w-10 bg-gray-100`,{"hidden lg:block":e===6}])},null,2)),64))])])],2)]))}},Rf=A(),zf=A(!1),Bf=async()=>{let{isGuest:e}=Ze();if(e.value){ln({configKey:`hide-thread`,dataId:`hide-thread`});return}zf.value=!0,await Vf(Rf.value),zf.value=!1},Vf=async e=>{let t=yn().request(`/api/v3/talk/threads/${e.id}/hidden`,{immediate:!1}).json();if(e.is_hidden?await t.delete().execute():await t.post().execute(),t.error.value){pt().show({text:`Something went wrong. Please try again later`});return}Te(`thread`).emit(`hideChange`,{id:e.id,is_hidden:!e.is_hidden})},Hf=T(()=>Rf.value.is_hidden?`Unhide`:`Hide`);function Uf(e){return Rf.value=e,{toggleHide:Vf,handleThreadHide:Bf,loadingHide:zf,hideLabel:Hf}}var Wf={key:0,class:`relative rounded-t bg-gray-100 p-4 pl-10 font-bold dark:border-b dark:border-gray-700 dark:bg-gray-800 lg:hidden`},Gf={key:1,class:`relative rounded-t bg-gray-100 p-4 pl-10 font-bold lg:hidden`},Kf={class:`relative grid grid-cols-10 gap-x-6 gap-y-5 px-4 pb-6 pt-10 lg:pt-6`},qf={class:`col-span-5 flex flex-col items-start space-y-4 lg:hidden`},Jf={class:`col-span-5 space-y-4 lg:hidden`},Yf=[`href`],Xf={class:`col-span-5 space-y-4 lg:hidden`},Zf={class:`col-span-5 space-y-4 lg:hidden`},Qf={class:`col-span-5 space-y-4`},$f={class:`col-span-5 space-y-4 lg:hidden`},ep={__name:`TalkChevronMenu`,props:{thread:{type:Object,required:!0},visible:{type:Boolean,default:!0}},emits:[`closeTalkChevronMenu`],setup(n,{emit:r}){let i=n,{scrollIntoView:a}=jt(),o=Te(`thread`),s=r,c=A(),{isGuest:u,isLoggedIn:d,isVerified:f}=Ze(),p=(e,t={})=>{sn(e,t)&&F()}
80,{handleWatchToggle:g,loadingWatch:_,watchLabel:v,watchClickId:y}=ar(i.thread),{handleThreadHide:b,loadingHide:x,hideLabel:C}=Uf(i.thread),w=()=>{o.emit(`pauseNext`),a(document.getElementById(`post-box`),{behavior:`smooth`,source:`TalkChevron:handleAddPost`}),F()},{saveClickId:D,saveLabel:O,handlePostSave:k,loadingSave:j}=iu(i.thread),{flipClickId:M,flipLabel:ee,loadingFlip:N,handleFlip:P}=Pl(),F=()=>{s(`closeTalkChevronMenu`),window.dispatchEvent(new CustomEvent(`close-talk-chevron-menu`))},te=A(!1),L=T(()=>te.value?`Hide`:`Unhide`),R=()=>{Alpine.store(`global`).toggleMobileFixedNavSetting(),te.value=!te.value,F()};return z(c,()=>{i.visible&&F()}),I(()=>{o.on(e=>{i.visible&&(e===`threadFlipped`||e===`threadSaved`||e===`watchChange`||e===`hideChange`)&&F()}),te.value=Alpine.store(`global`).mobileFixedNavSettingEnabled}),(r,a)=>{let o=fe(`icon`);return V((e(),S(`div`,null,[W(`div`,{ref_key:`menuEl`,ref:c,class:`left-1/2 top-1/2 z-50 w-full rounded-xl border border-gray-200 bg-white text-sm dark:border-gray-500 max-lg:fixed max-lg:-translate-x-1/2 max-lg:-translate-y-1/2 lg:absolute lg:left-0 lg:top-20`},[E(d)&&!E(f)?V((e(),S(`p`,Wf,[...a[9]||=[l(` You need to confirm your email address to access all these features `,-1)]])),[[o,{icon:`circle-exclamation`,classes:`before:size-4 before:mt-0.5 before:absolute before:left-4 before:top-4 before:text-blue-700 before:dark:text-white word-break-break-word`}]]):U(``,!0),E(u)?V((e(),S(`p`,Gf,[a[10]||=l(` Please `,-1),W(`button`,{class:`cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none`,"data-click-id":`sign_up_login_trigger:talk-common-menu`,onClick:a[0]||=e=>p(e,{dataId:`talk-common-menu-create-an-account`,promptCode:`talk-common-menu`})},` create an account `),a[11]||=l(` or `,-1),W(`button`,{class:`cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none`,"data-click-id":`sign_up_login_trigger:talk-common-menu`,onClick:a[1]||=e=>p(e,{dataId:`talk-common-menu-log-in`,promptCode:`talk-common-menu`,promptType:`login`})},` log in `),a[12]||=l(` to access all these features `,-1)])),[[o,{icon:`circle-exclamation`,classes:`before:absolute before:left-4 before:top-4 before:size-4 before:mt-0.5 before:text-blue-700 word-break-break-word`}]]):U(``,!0),W(`div`,Kf,[V(W(`button`,{class:`absolute right-3 top-3 text-blue-700 lg:hidden`,"aria-label":`close talk sub-menu dropdown`,onClick:F},null,512),[[o,{icon:`xmark`,classes:`before:size-5 before:block before:mb-0.5 before:text-blue-700`}]]),W(`div`,qf,[h(fr,{disabled:E(u),"data-click-id":`cta_create_post:talk-common-menu-add-post`,onClick:w},{default:G(()=>[...a[13]||=[l(` Add post `,-1)]]),_:1},8,[`disabled`]),h(fr,{class:`flex items-center gap-2`,disabled:E(u),"data-click-id":E(sr)(E(y),`chevron-menu`),"data-click-event":E(ir)(E(y)),onClick:E(g)},{default:G(()=>[l(J(E(v))+` thread `,1),E(_)?(e(),t(Xn,{key:0,class:`h-4 w-4`})):U(``,!0)]),_:1},8,[`disabled`,`data-click-id`,`data-click-event`,`onClick`]),h(fr,{class:`flex items-center gap-2`,disabled:E(u),"data-click-id":E(sr)(`${E(D)}-thread`,`chevron-menu`),onClick:E(k)},{default:G(()=>[l(J(E(O))+` thread `,1),E(j)?(e(),t(Xn,{key:0,class:`h-4 w-4`})):U(``,!0)]),_:1},8,[`disabled`,`data-click-id`,`onClick`])]),W(`div`,Jf,[W(`a`,{class:m([`block cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white`,{"cursor-not-allowed text-gray-500":E(u)||!E(f)}]),href:!E(u)&&E(f)?`/talk/create-thread?topic=${n.thread.topic.slug}`:void 0,onClick:a[2]||=e=>p(e,{redirectUrl:`/talk/create-thread?topic=${n.thread.topic.slug}`,dataId:`talk-common-menu-start-thread`,promptCode:`thread.create`,promptType:`login`})},` Start a new thread `,10,Yf),h(fr,{class:`flex items-center gap-2`,disabled:E(u),"data-click-id":`${E(M)}-talk-chevron-menu`,onClick:E(P)},{default:G(()=>[l(J(E(ee))+` thread `,1),E(N)?(e(),t(Xn,{key:0,class:`h-4 w-4`})):U(``,!0)]),_:1},8,[`disabled`,`data-click-id`,`onClick`]),h(fr,{class:`flex items-center gap-2`,disabled:E(u),"data-click-id":E(lr)(i.thread.is_hidden,`chevron-menu`),onClick:E(b)},{default:G(()=>[l(J(E(C))+` thread `,1),E(x)?(e(),t(Xn,{key:0,class:`h-4 w-4`})):U(``,!0)]),_:1},8,[`disabled`,`data-click-id`,`onClick`])]),a[19]||=W(`hr`,{class:`col-span-10 border-gray-200 lg:hidden`},null,-1),W(`div`,Xf,[a[14]||=W(`a`,{class:`block cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white`,href:`/talk/my-feed/following`},` My feed `,-1),W(`a`,{class:`block cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white`,href:`/talk/my-lists/threads-im-on`,rel:`nofollow`,onClick:a[3]||=e=>p(e,{redirectUrl:`/talk/my-lists/threads-im-on`,dataId:`talk-common-menu-threads-im-on`,promptCode:`im-on`})},J(E(We)(`my-posts-button-text`)?`My posts`:`I'm on`),1),W(`a`,{class:`block cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white`,href:`/talk/my-lists/threads-im-watching`,rel:`nofollow`,onClick:a[4]||=e=>p(e,{redirectUrl:`/talk/my-lists/threads-im-watching`,dataId:`talk-common-menu-threads-im-watching`,promptCode:`im-watching`})},` I'm watching `),W(`a`,{class:`block cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white`,href:`/talk/my-lists/threads-i-started`,rel:`nofollow`,onClick:a[5]||=e=>p(e,{redirectUrl:`/talk/my-lists/threads-i-started`,dataId:`talk-common-menu-threads-i-started`,promptCode:`i-started`})},J(E(We)(`my-posts-button-text`)?`My threads`:`I started`),1)]),W(`div`,Zf,[W(`a`,{class:`block cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white`,href:`/search/advanced#/`,rel:`nofollow`,onClick:a[6]||=e=>p(e,{redirectUrl:`/search/advanced#/`,dataId:`talk-common-menu-advanced-search`,promptCode:`advanced-search`,promptType:`login`})},` Advanced search `),W(`a`,{class:`block cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white`,href:`/talk/my-lists/saved/threads`,rel:`nofollow`,onClick:a[7]||=e=>p(e,{redirectUrl:`/talk/my-lists/saved/threads`,dataId:`talk-common-menu-bookmarks`,promptCode:`bookmarks`})},` Saved `),a[15]||=W(`a`,{class:`block cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white`,href:`/talk/active`},` Active `,-1),a[16]||=W(`a`,{class:`block cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white`,href:`/talk/active?tab=unanswered`},` Unanswered threads `,-1)]),a[20]||=W(`hr`,{class:`col-span-10 border-gray-200 lg:hidden`},null,-1),W(`div`,Qf,[W(`a`,{class:`block cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white`,href:`/settings/talk`,onClick:a[8]||=e=>p(e,{redirectUrl:`/settings/talk`,dataId:`talk-common-menu-customise`,promptCode:`customise`})},` Customise `),a[17]||=W(`a`,{class:`block cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white max-lg:hidden`,href:`/i/getting-started`},` Getting started `,-1),a[18]||=W(`a`,{class:`block cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white max-lg:hidden`,href:`/i/faqs`},` FAQ's `,-1)]),W(`div`,$f,[W(`button`,{class:`block cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white lg:hidden`,onClick:R},J(L.value)+` shortcut buttons `,1)]),a[21]||=W(`div`,{class:`col-span-5 space-y-4 max-lg:hidden`},[W(`a`,{class:`block cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white max-lg:hidden`,href:`/talk/active?tab=unanswered`},` Unanswered threads `),W(`a`,{class:`block cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white max-lg:hidden`,href:`/i/acronyms`},` Acronyms `),W(`a`,{class:`block cursor-pointer text-blue-700 hover:underline focus:underline focus:outline-none dark:text-white max-lg:hidden`,href:`/i/netiquette`},` Talk guidelines `)],-1)])],512),a[22]||=W(`div`,{class:`fixed bottom-0 left-0 right-0 top-0 z-40 bg-black/30 lg:bg-transparent`},null,-1)],512)),[[ie,n.visible]])}}},tp={class:`ml-1 mt-3 hidden max-w-full justify-between text-sm text-blue-700 lg:flex`,role:`menu`},np=[`data-click-id`],rp=[`data-click-id`],ip=[`data-click-id`],ap=[`data-click-id`],op=[`data-click-id`],sp={__name:`TalkSubNav`,setup(t){let{isGuest:n}=Ze(),r=(e,t={})=>{sn(e,t)};return(t,i)=>(e(),S(`nav`,tp,[i[5]||=W(`a`,{href:`/talk/active`,role:`menuitem`},` Active `,-1),i[6]||=W(`a`,{href:`/talk/my-feed`,role:`menuitem`},` My feed `,-1),W(`a`,{href:`/talk/my-lists/threads-im-on`,role:`menuitem`,rel:`nofollow`,"data-click-id":E(n)?`sign_up_login_trigger:header-menu-link-im-on`:null,onClick:i[0]||=e=>r(e,{promptCode:`im-on`,dataId:`header-menu-link-im-on`,redirectUrl:`/talk/my-lists/threads-im-on`})},J(E(We)(`my-posts-button-text`)?`My posts`:`I'm on`),9,np),W(`a`,{href:`/talk/my-lists/threads-i-started`,role:`menuitem`,rel:`nofollow`,"data-click-id":E(n)?`sign_up_login_trigger:header-menu-link-i-started`:null,onClick:i[1]||=e=>r(e,{promptCode:`i-started`,dataId:`header-menu-link-i-started`,redirectUrl:`/talk/my-lists/threads-i-started`})},J(E(We)(`my-posts-button-text`)?`My threads`:`I started`),9,rp),W(`a`,{href:`/talk/my-lists/threads-im-watching`,role:`menuitem`,rel:`nofollow`,"data-click-id":E(n)?`sign_up_login_trigger:header-menu-link-im-watching`:null,onClick:i[2]||=e=>r(e,{promptCode:`im-watching`,dataId:`header-menu-link-im-watching`,redirectUrl:`/talk/my-lists/threads-im-watching`})},` I'm watching `,8,ip),W(`a`,{href:`/talk/my-lists/saved/threads`,role:`menuitem`,rel:`nofollow`,"data-click-id":E(n)?`sign_up_login_trigger:header-menu-link-saved`:null,onClick:i[3]||=e=>r(e,{promptCode:`bookmarks`,dataId:`header-menu-link-saved`,redirectUrl:`/talk/my-lists/saved/threads`})},` Saved `,8,ap),i[7]||=W(`a`,{href:`/talk/last-hour`,role:`menuitem`,rel:`nofollow`},`Last hour`,-1),W(`a`,{href:`/search/advanced#/`,role:`menuitem`,rel:`nofollow`,"data-click-id":E(n)?`sign_up_login_trigger:header-menu-link-advanced-search`:null,onClick:i[4]||=e=>r(e,{promptCode:`advanced-search`,dataId:`header-menu-link-advanced-search`,redirectUrl:`/search/advanced#/`,promptType:`login`})},` Advanced search `,8,op)]))}},cp={class:`lg:mt-1.5 lg:flex lg:justify-between lg:rounded-xl lg:border lg:border-b lg:border-t lg:bg-white lg:px-4 lg:py-2`},lp={class:`hidden h-8 items-center space-x-3 lg:flex`},up=[`data-click-id`],dp={class:`z-20 mt-1.5 flex h-12 flex-col justify-center rounded-xl border bg-white px-4 lg:hidden`},fp={class:`flex space-x-2.5`},pp={__name:`ThreadActionsBar`,props:{thread:{type:Object,required:!0},position:{type:String,default:`bottom`}},setup(n){let r=n,{watchLabel:i,loadingWatch:a,handleWatchToggle:o,watchClickId:s}=ar(r.thread,{deferredWatchPosition:r.position===`bottom`?`bottom`:`top`}),c=()=>{rr().handleShare(r.thread.subject,r.thread.link,`thread`)},{saveLabel:u,loadingSave:d,handlePostSave:f,saveClickId:p}=iu(r.thread),{flipClickId:m,flipLabel:g,loadingFlip:_,handleFlip:v}=Pl(),{hideLabel:y,loadingHide:b,handleThreadHide:x}=Uf(r.thread);return(n,C)=>{let w=fe(`icon`);return e(),S(`div`,cp,[W(`div`,lp,[h(Nt,{class:`flex w-full min-w-32`,kind:`blue`,size:`sm`,disabled:E(a),"data-click-id":E(sr)(E(s),r.position),"data-click-event":E(ir)(E(s)),onClick:E(o)},{default:G(()=>[V(W(`span`,null,J(E(i))+` thread `,513),[[ie,!E(a)]]),V(h(Xn,{class:`h-5 w-5 text-white`},null,512),[[ie,E(a)]])]),_:1},8,[`disabled`,`data-click-id`,`data-click-event`,`onClick`]),W(`button`,{class:`flex gap-2 text-sm font-bold text-blue-700`,onClick:C[0]||=e=>{E(nt)(e,E(sr)(`${E(m)}-on-thread`,r.position)),E(v)()}},[l(J(E(g))+` `,1),E(_)?(e(),t(Xn,{key:0,class:`h-5 w-5 text-blue-700`})):U(``,!0)]),E(Ze)().check()?(e(),S(`button`,{key:0,class:`flex text-sm font-bold text-blue-700`,"data-click-id":E(lr)(r.thread.is_hidden,r.position),onClick:C[1]||=(...e)=>E(x)&&E(x)(...e)},[l(J(E(y))+` `,1),E(b)?(e(),t(Xn,{key:0,class:`h-5 w-5 text-blue-700`})):U(``,!0)],8,up)):U(``,!0)]),W(`div`,dp,[W(`div`,fp,[V((e(),t(Nt,{class:`flex items-center gap-2`,size:`sm`,kind:`gray`,"data-click-id":E(sr)(E(s),r.position),"data-click-event":E(ir)(E(s)),onClick:E(o)},{default:G(()=>[l(J(E(i)),1)]),_:1},8,[`data-click-id`,`data-click-event`,`onClick`])),[[w,{icon:r.thread.is_watching?`bell-solid`:`bell`,classes:`before:w-4 before:h-4`,loading:E(a)}]]),V((e(),t(Nt,{class:`flex items-center gap-2`,size:`sm`,kind:`gray`,"data-click-id":E(sr)(`${E(p)}-thread`,r.position),onClick:E(f)},{default:G(()=>[l(J(E(u)),1)]),_:1},8,[`data-click-id`,`onClick`])),[[w,{icon:r.thread.has_saved?`heart-solid`:`heart`,classes:`before:w-4 before:h-4`,loading:E(d)}]]),V((e(),t(Nt,{class:`flex items-center gap-2`,size:`sm`,kind:`gray`,"data-click-id":`cta_share_post:share-actions-bar-mobile`,onClick:c},{default:G(()=>[...C[2]||=[l(` Share `,-1)]]),_:1}
80)),[[w,{icon:`arrow-turn-right`,classes:`before:w-4 before:h-4`}]])])])])}}},mp={class:`mt-1.5 overflow-x-hidden rounded-xl border border-gray-200 bg-white pb-3.5 pl-4 pt-2.5 dark:bg-gray-800 lg:py-2.5`},hp={class:`flex items-center justify-between space-x-3 pr-5`},gp={class:`flex items-center space-x-2`},_p={class:`text-xl font-bold`},vp={class:`flex items-center space-x-3`},yp=[`aria-expanded`,`aria-label`,`data-click-id`],bp={key:0,"data-impression-id":`thread-media-gallery-engagement`},xp={__name:`ThreadMediaFull`,props:{attachments:{type:Array,required:!0},threadId:{type:Number,required:!0},count:{type:Number,required:!0},cursor:{type:String,default:null}},setup(t){let n=t,r=A(!0),i=()=>{r.value=!r.value};return(t,a)=>{let o=fe(`icon`);return e(),S(`div`,mp,[W(`div`,hp,[W(`div`,gp,[V((e(),S(`span`,_p,[...a[0]||=[l(` Thread gallery `,-1)]])),[[o,{icon:`gallery`,classes:`before:w-5 before:h-5 before:text-black`}]]),h(ur,{ref:`galleryHelp`,placement:`top`,theme:`blue`},{default:G(()=>[...a[1]||=[W(`div`,{class:`font-bold`},` We've gathered up the images and links on this thread so you can browse them easily. `,-1),W(`div`,{class:`pt-2`},` Click on an image to reveal more details `,-1)]]),_:1},512)]),W(`div`,vp,[h(Vl,null,{default:G(()=>[l(J(n.count),1)]),_:1}),V(W(`button`,{"aria-expanded":r.value,"aria-label":r.value?`Collapse gallery`:`Expand gallery`,"data-click-id":r.value?`thread_media_gallery_engagement:thread-media-gallery-engagement-expand`:`thread_media_gallery_engagement:thread-media-gallery-engagement-collapse`,onClick:i},null,8,yp),[[o,{icon:r.value?`chevron-up`:`chevron-down`,classes:`before:size-5 before:text-blue-700 before:block`}]])])]),r.value?(e(),S(`div`,bp,[h(An,null,{fallback:G(()=>[...a[2]||=[W(`div`,{class:`h-[244px]`},null,-1)]]),default:G(()=>[h(pr,{attachments:n.attachments,"thread-id":n.threadId,cursor:n.cursor},null,8,[`attachments`,`thread-id`,`cursor`])]),_:1})])):U(``,!0)])}}},Sp={class:`mt-1.5 h-[60px] rounded-xl border border-gray-200 bg-white p-3`},Cp=[`href`],wp={class:`text-[10px] text-gray-500`},Tp={key:0},Ep=[`src`,`alt`],Dp={__name:`ThreadSponsor`,props:{sponsor:{type:Object,required:!0}},setup(t){let n=t;return(t,r)=>(e(),S(`div`,Sp,[W(`a`,{class:`flex h-full items-center justify-center`,href:n.sponsor.url,target:`_blank`,rel:`nofollow`},[W(`p`,wp,[W(`span`,null,J(n.sponsor.text??`Created with`),1),n.sponsor.name_hide===`0`?(e(),S(`span`,Tp,` \xA0`+J(n.sponsor.name),1)):U(``,!0)]),n.sponsor.logo_hide===`0`?(e(),S(`img`,{key:0,class:`ml-4 max-h-full max-w-[156px]`,loading:`lazy`,src:n.sponsor.logo_url,alt:n.sponsor.logo_alt},null,8,Ep)):U(``,!0)],8,Cp)]))}},Op={class:`flex size-12 shrink-0 items-center justify-center rounded-full bg-gray-200 text-secondary`},kp=[`id`],Ap={__name:`VaccinationCta`,setup(n){let r=ve(),i=Se(),a=T(()=>r.id||i),o=T(()=>`${a.value}__btn`),s=T(()=>`${a.value}__description`),c=we(`root`),u=we(`action`),d=ze().value.vaccination?.cta.destination,f=w(0);I(()=>{let{focused:e}=re(c.value?.$el);ce(e,e=>f.value=e?-1:0)});let p=e=>{e.target===c.value?.$el&&u.value?.$el.focus()},{user:m}=Ze(),g=T(()=>`vaccination-cta`+Re(m.value?.id,e=>`:${e}`)),_=lt(g);return(n,r)=>{let i=fe(`icon`);return E(_)?U(``,!0):(e(),t(E(jn),{key:0,id:a.value,ref_key:`root`,ref:c,role:`region`,"aria-labelledby":o.value,"aria-describedby":s.value,tabindex:f.value,"data-feed-insert":``,class:`relative ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,onFocusin:p},{default:G(()=>[h(E(Nn),{class:`flex-row items-center justify-center gap-x-4`,"data-impression-id":`in-thread-vaccine-cta`},{default:G(()=>[V(W(`i`,Op,null,512),[[i,{icon:`kit-medical-solid`,classes:`before:size-8 before:shrink-0`}]]),W(`strong`,{id:s.value,class:`mr-6 text-pretty text-xl text-gray-800`},` Are your children’s vaccines up\xA0to\xA0date? `,8,kp)]),_:1}),h(E(Mn),null,{default:G(()=>[V((e(),t(E(X),{ref_key:`action`,ref:u,as:`a`,href:E(d),variant:`secondary`,class:`w-full`,"data-click-id":`vaccine_engagement:cta-click`,size:`lg`},{default:G(()=>[...r[1]||=[l(` Set a reminder `,-1)]]),_:1},8,[`href`])),[[i,{icon:`bell-solid`,classes:`before:block before:size-5 before:shrink-0`}]])]),_:1}),V(h(E(X),{id:o.value,variant:`link`,size:`sm`,class:`absolute right-2 top-2 size-7 p-0 text-secondary hover:text-purple-700`,"aria-label":`Dismiss`,"data-click-id":`vaccine_engagement:cta-dismiss`,onClick:r[0]||=e=>_.value=!0},null,8,[`id`]),[[i,{icon:`xmark`,classes:`before:size-4 before:block before:shrink-0`}]])]),_:1},8,[`id`,`aria-labelledby`,`aria-describedby`,`tabindex`]))}}},jp=[`href`],Mp={class:`mt-1.5 flex bg-purple-700 lg:rounded-xl`},Np={class:`flex w-full items-center justify-between px-2 font-bold sm:px-4 lg:text-lg`},Pp={__name:`WebchatSummaryBar`,props:{link:{type:String,required:!0}},setup(t){let n=t;return(t,r)=>{let i=fe(`icon`);return e(),S(`a`,{class:`cursor-pointer text-white hover:underline focus:underline focus:outline-none`,href:`${n.link}?show-expert-replies=1`},[W(`div`,Mp,[r[1]||=W(`div`,{class:`flex items-center border-r border-purple-100 bg-purple-800 p-2 px-2.5 sm:rounded-l-xl`},[W(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,class:`h-6 w-6 fill-current text-white`,viewBox:`0 0 23 18`},[W(`path`,{"fill-rule":`evenodd`,d:`M.41 1.43 4.43.35c.3.46.43.86.6 1.72A5.86 5.86 0 0 1 9.17.36a4.6 4.6 0 0 1 4.1 2.23C14.85 1 16.24.38 18.1.39c1.33 0 2.59.4 3.35 1.06.96.83 1.25 1.83 1.25 4.15l-.04 12.06-4.3-.01.02-11.2c0-2.02-.22-2.42-1.38-2.43-.84 0-2 .56-2.96 1.42L14 17.64l-4.22-.01.03-11.04c0-2.12-.29-2.62-1.52-2.62a4.7 4.7 0 0 0-2.92 1.28l-.03 12.37L1 17.6l.03-11.83c0-2.45-.15-3.51-.62-4.34Z`,"clip-rule":`evenodd`})])],-1),V((e(),S(`div`,Np,[...r[0]||=[l(` See all questions and answers `,-1)]])),[[i,{icon:`arrow-right`,classes:`after:w-5 after:h-5`,position:`after`}]])])],8,jp)}}},Fp=p({default:()=>Xp}),Ip=[`aria-busy`],Lp={class:`prose text-sm`},Rp=[`href`],zp={key:3,class:`mt-1.5 rounded-xl border bg-white px-4 py-3`},Bp={class:`flex items-center justify-between gap-4`},Vp={class:`min-w-0`},Hp={class:`mt-1 flex items-center gap-2`},Up=[`href`],Wp={key:0,class:`mt-2`},Gp={key:11}
80,Kp=[`data-batch`,`data-view-count`],qp={key:4,class:`mx-4 mt-6 flex items-center lg:mx-0`},Jp={class:`flex space-x-2`},Yp=6,Xp={__name:`PageShowThread`,props:{thread:{type:Object,required:!0},replies:{type:Array,required:!0},opReplyIds:{type:Array,required:!0},cursor:{type:Object,required:!0},startedFromFirstPage:{type:Boolean,required:!0},targetReplyId:{type:Number,default:null},batch:{type:Number,required:!1,default:1}},setup(n){let r=We(`adtech-revamp`),i=n,a=ze(),{isFlipped:s}=Pl();s.value=i.thread.is_flipped;let c=o(),{scrollTo:u,scrollIntoView:f,restorePoint:p,clearRestorePoint:_,restoreScroll:v,setRestorePoint:y}=jt(),{isPremium:b,isGuest:x}=Ze(),{"create-replies":C,"delayed-watch-dropin":D,"email-newsletter-ctas-top":O}=Ue(),k=we(`feedEl`),j=we(`replyContainerEl`),M=A(),ee=A(),N=A(),P=A(),F=A(),te=A(),R=Te(`thread`),z=A(i.thread),ne=A(0),re=A(z.value.bookmarked_reply_id),B=A(0),ie=tl(),ae=A({id:i.targetReplyId,instantly:!0,isBookmark:!0,type:`reply`}),oe=A([]),se=A(!1),le=A(),ue=A(),de=[2e3,3e3],pe=[3004,3005,3006,3007],me=[...de,...pe],he=A(i.cursor.prev_cursor),ge=A(i.cursor.next_cursor),K=w(ge.value===null||H?.location.hash===`#post-box`),ve=w(!0),xe=A(i.startedFromFirstPage),Se=w(i.batch),Ee=w(!1),De=w(0),Oe=w(0),ke=w(Re(H?.location.href,e=>new URL(e))),je=(e={})=>{e instanceof URLSearchParams||(e=new URLSearchParams(e));let t=H?.location.href??ie.url??`https://www.mumsnet.com`,n=H?.origin??`https://www.mumsnet.com`,r=new URL(t,n);return e.forEach((e,t)=>r.searchParams.set(t,e)),r},Me=(e={})=>{let t=e instanceof URL?e:je(e);return{newUrl:t.toString(),pageTitle:be?.title,startedFromFirstPage:xe.value,previousLoadCount:De.value,nextLoadCount:Oe.value,totalLoadCount:De.value+Oe.value,...Object.fromEntries(t.searchParams.entries()),key:Math.random().toString(36).substring(2,15)}},Ne=e=>{if(!e)return;let t=ke.value?.toString(),n=(0,ul.omit)({oldUrl:t,...e},`key`);H?.dispatchEvent(new CustomEvent(`virtual-page-view`,{detail:n})),ke.value=new URL(e.newUrl)},Pe=(e,t={},n={})=>({replies:e,visibleCount:e.length,viewCount:0,batch:Se.value,key:Math.random().toString(36).substring(2,15),event:{...Me(t),replyCount:e.length},...n}),Fe=A([{key:Math.random().toString(36).substring(2,15),batch:Se.value,viewCount:0,replies:i.replies??[],visibleCount:(i.replies??[]).length,event:Me(Re(H?.location.href,e=>new URL(e),{}))}]),Ie=w(Fe.value[0].key),Be=w(!1),Ve=e=>e.key===Ie.value?t=>{if(c.value){if(!Be.value&&!t){Be.value=!0;return}t&&(e.viewCount++,Be.value&&Ne(e.event))}}:t=>{c.value&&t&&(e.viewCount++,Ne(e.event))},Ge=T(()=>Fe.value.reduce((e,t)=>e.concat(t.replies),[])),Qe=new Set;ce(Fe,()=>{Qe.clear(),Ge.value.forEach(e=>Qe.add(e.id))},{immediate:!0});let $e=e=>new Promise(t=>{let n=H?.requestAnimationFrame?.bind(H)??(e=>setTimeout(e,16)),r=()=>{e.visibleCount=Math.min(e.visibleCount+Yp,e.replies.length),e.visibleCount<e.replies.length?n(r):t()};e.visibleCount<e.replies.length?n(r):t()}),et=Promise.resolve(),tt=(e,t={})=>(e=e.filter(e=>!Qe.has(e.id)),Fe.value.push(Pe(e,t,{visibleCount:Math.min(Yp,e.length)})),et=$e(Fe.value[Fe.value.length-1]),e),rt=(e,t={})=>(e=e.filter(e=>!Qe.has(e.id)),Fe.value.unshift(Pe(e,t)),e),st=(e,t={})=>(Fe.value=[Pe(e,t)],e),ct=T(()=>z.value.type===`webchat`&&z.value.expert_replies_count>1),lt=T(()=>Se.value+1),_t=T(()=>z.value.link),vt=T(()=>s.value?`latest`:`oldest`),yt=T(()=>s.value?`older`:`newer`),bt=T(()=>s.value?`newer`:`older`),xt=T(()=>`/api/v3/talk/threads/${z.value.id}/replies`),St=T(()=>`?`+new URLSearchParams({"order-by":vt.value,[vt.value===`latest`?`latest`:`oldest`]:!0,batch:lt.value})),Ct=T(()=>`?`+new URLSearchParams({"order-by":vt.value,[vt.value===`latest`?`oldest`:`latest`]:!0,batch:0})),wt=T(()=>`?`+new URLSearchParams({"order-by":vt.value,cursor:ge.value,batch:lt.value})),Tt=T(()=>`?`+new URLSearchParams({"order-by":vt.value,cursor:he.value,batch:0})),Et=T(()=>`?`+new URLSearchParams({"order-by":vt.value,reply:ae.value.id,batch:lt.value}).toString()),Dt=_e(Ye({baseUrl:xt,options:{afterFetch(e){return e.data?.data?.length&&e.data.data.forEach(e=>{e.thread||e.thread_id===i.thread?.id&&(e.thread=i.thread)}),e}}})),Ot=Dt(St,{immediate:!1}).json(),kt=Dt(Ct,{immediate:!1}).json(),At=Dt(wt,{immediate:!1}).json(),Mt=Dt(Tt,{immediate:!1}).json(),Pt=Dt(Et,{immediate:!1}).json(),Ft=()=>{xe.value=!1,It(),Lt()},It=()=>{Se.value=0},Lt=()=>{De.value=0,Oe.value=0},Rt=()=>{Se.value++},zt=()=>{De.value++},Bt=()=>{Oe.value++},Vt=()=>{Ht()},Ht=(e=null,t=!1,n=!1,r=`reply`)=>{ae.value={id:e,instantly:t,isBookmark:n,type:r}},Ut=async()=>
80{if(!g||!it())return;if(r){let e=ot.findByDiv(`mn-leaderboard-mobile`);if(!e)return;await e.refresh();return}let e=at(`mn-leaderboard-mobile`);e&&(Ke.google.debug(`Refresh mn-leaderboard-mobile`),window.googletag.pubads().refresh([e.gamAdSlot]))},Wt=(0,ul.throttle)(async([e])=>{e?.isIntersecting&&(At.isFetching.value||ge.value&&(K.value||await Qt()))},300,{leading:!0}),Gt=(0,ul.throttle)(async([e])=>{e?.isIntersecting&&(Mt.isFetching.value||he.value&&(ve.value||await en()))},300,{leading:!0}),Kt=T(()=>At.isFetching.value||Mt.isFetching.value||Ot.isFetching.value||kt.isFetching.value||Pt.isFetching.value||Ee.value),qt=e=>{let t=e.getBoundingClientRect();return t.bottom>0&&t.top<window.innerHeight&&t.right>0&&t.left<window.innerWidth},Jt=Re(i.startedFromFirstPage,{replies:i.replies,nextCursor:i.cursor}),Yt=async()=>{if(!(Jt&&Ge.value[0]?.id===Jt.replies[0]?.id))try{Ft(),he.value=null,Jt||=(await Ot.execute(!0),{replies:Ot.data.value.data,nextCursor:Ot.data.value.meta.next_cursor}),Rt(),st(Jt.replies,{action:`go_to`,target:`top`}),ge.value=Jt.nextCursor,K.value=!1,vt.value===`latest`&&Vn()}catch{Un(Ot)?Gn(Ot):pt().show({text:`Failed to fetch ${vt.value} replies. Please try again`})}},Xt=null,Zt=async()=>{if(!(Xt&&Ge.value.at(-1)?.id===Xt.replies.at(-1)?.id))try{Ft(),ge.value=null,Xt||=(await kt.execute(!0),{replies:kt.data.value.data,previousCursor:kt.data.value.meta.prev_cursor}),Rt(),st(Xt.replies,{action:`go_to`,target:`bottom`}),he.value=Xt.previousCursor,ve.value=!0,vt.value===`oldest`&&Vn()}catch{Un(kt)?Gn(kt):pt().show({text:`Failed to fetch ${vt.value} replies. Please try again`})}},Qt=async()=>{try{await At.execute(!0),Bt(),Rt(),tt(At.data.value.data,{action:`scroll`,target:`next`}),ge.value=At.data.value.meta.next_cursor,await et,await d(),K.value=!!qt(P.value[P.value.length-1].$el),N.value.$el.getBoundingClientRect().top<0&&(K.value=!0),Ut()}catch{Un(At)?Gn(At):(K.value=!0,pt().show({text:`Failed to fetch more replies. Please try again`}))}},$t=async()=>{let e=Ge.value.at(-1)??z.value;ge.value=btoa(JSON.stringify({"replies.created_at":e.created_at,"replies.id":e.post_type===`reply`?e.id:void 0,_pointsToNextItems:!0})),await Qt(),Vn()},en=async(e=!0)=>{try{await Mt.execute(!0),zt();let t=document.getElementById(`main-container`),n=window.scrollY,r=t.scrollHeight;rt(Mt.data.value.data,{action:`scroll`,target:`previous`}),he.value=Mt.data.value.meta.prev_cursor,await d();let i=t.scrollHeight-r;j.value.getBoundingClientRect().top>0&&(e?ve.value=!0:ve.value=!1,u({top:n+i,behavior:`instant`,source:`PageShowThread:fetchPreviousReplies`})),Ut()}catch{Un(Mt)?Gn(Mt):(ve.value=!0,pt().show({text:`Failed to fetch more replies. Please try again`}))}},Y=async e=>{let t=Ge.value.at(0)??z.value;he.value=btoa(JSON.stringify({"replies.created_at":t.created_at,"replies.id":t.post_type===`reply`?t.id:void 0,_pointsToNextItems:!1})),await en(),Vn();let n=e.target?.nextElementSibling;if(!n)return;let r=n.getBoundingClientRect().top+document.documentElement.scrollTop;u({top:r,behavior:`instant`,source:`PageShowThread:fetchNewPreviousReplies`})},{scrollToItem:tn,scrollToStart:nn}=gl({container:k,childSelector:`& article, & [role=article], & [data-feed-insert], & [data-feed-item]`,fetchStart:Yt,fetchEnd:Zt,fetchItem:async({id:e,posinset:t})=>e?await kn(e):await jn(t),items:Ge,scrollToStart:async({execFetchStart:e},t)=>{let n=be?.getElementById(`main-content`);n&&(await e(),await d(),f(n,{options:t,source:t.source??`PageShowThread:scrollToStart`}))}}),rn=(e,t=``)=>{se.value=!0,ue.value=e,le.value=t},an=({id:e,has_saved:t})=>{let n=Ge.value.find(t=>t.id===e);if(!n)return;n.has_saved=t;let r=t?{text:`You have saved this post. Click to go to your saved list.`,destination:`/talk/my-lists/saved/posts`}:{text:`You have unsaved this post`};pt().show(r)},on=({has_saved:e})=>{z.value.has_saved=e;let t=e?{text:`You have saved this thread. Click to go to your saved list.`,destination:`/talk/my-lists/saved/threads`}:{text:`You have unsaved this thread`};pt().show(t)},sn=({id:e,expression:t})=>{let n=Ge.value.find(t=>t.id===e);if(n){if(n.has_reacted=!!t,n.reaction){n.reaction.expression=t;return}n.reaction={expression:t}}},cn=({expression:e})=>
80{if(z.value.has_reacted=!!e,z.value.reaction){z.value.reaction.expression=e;return}z.value.reaction={expression:e}},ln=({is_watching:e})=>{z.value.is_watching=e;let t=e?{text:`You are now watching this thread. Click to view your watch list.`,destination:`/talk/my-lists/threads-im-watching/`}:{text:`You are no longer watching this thread`};pt().show(t)},un=async()=>{[Jt,Xt]=[Xt,Jt],await nn({behavior:`instant`})},dn=({is_hidden:e})=>{z.value.is_hidden=e;let t=e?{text:`You will no longer see this thread on Mumsnet. Click here to manage your hidden threads.`,destination:`/settings/hidden-threads`}:{text:`This thread will now be visible on Mumsnet`};pt().show(t)},fn=async(e,t)=>{if(e!==`bottom`&&!t)return;e===`bottom`&&(await Zt(),await d());let n={top:()=>ee.value?.$el,op:()=>be?.querySelector(`[data-deferred-watch-op-target]`),bottom:()=>N.value?.$el}[e]?.();n instanceof Element&&mt(n,{source:`PageShowThread:restoreDeferredWatchThread`})},pn=async e=>{if(e?.action!==dt.WatchThread||e.threadId!==z.value.id)return;let t=e.payload?.position??`top`,n=i.targetReplyId!==null;if(z.value.is_watching){ft(e.id),await fn(t,n);return}if(ft(e.id)){if(!await cr(z.value)){gt(e.threadId,t);return}z.value.is_watching&&nt(null,`watch_thread:watch-thread`,`Watch thread`,{deferred:!0}),await fn(t,n)}};I(()=>{x.value||!We(`deferred-actions`)||ut().forEach(pn)});let mn=null;ye(()=>{if(ae.value.id===null||!Ze().isLoggedIn.value||!We(`deferred-actions`))return;let e={threadId:z.value.id,topicId:z.value.topic?.id,replyTargetId:ae.value.id,replyIds:Ge.value.map(e=>e.id),showsPoll:!!(z.value.poll&&a.value.preferences?.talk_show_polls)};mn=ut().some(t=>ht(t,e))?ae.value.id:null});let hn,gn=T(()=>typeof p.value==`string`||p.value instanceof Element),_n=e=>typeof e==`string`?document.querySelector(e)??e:e,X=e=>e.getBoundingClientRect().height>=window.innerHeight?`start`:`center`,vn=e=>{if(!gn.value)return;let t=e?.id;if(!t)return;let n=/^(reply|thread)(\d+)$/.exec(t);if(!n)return;let[,r,i]=n;Wn(`${r}:${i}`).highlight()},yn=()=>{hn=null,_()},bn=()=>{let e={behavior:`smooth`,source:`PageShowThread:restoreScrollPosition`},t=_n(p.value);t&&(t instanceof Element&&(e.block=X(t)),v(e),t instanceof Element&&vn(t))},xn=async()=>{if(!hn||!hn.restorePoint){new Le(`vue:PageShowThread`).warn(`Tried to restore scroll but no restore point was found`);return}y(hn.restorePoint);let e=hn.restorePoint;if(typeof e==`string`&&(e=document.querySelector(e)??e),e instanceof Element&&!e.id.startsWith(`thread`)){bn(),yn();return}ne.value=hn.replyFormKey,ge.value=hn.nextCursor,he.value=hn.previousCursor,Fe.value=hn.virtualPages,Lt(),Vn(),await d(),bn(),yn()},Sn=async()=>{if(!hn)return;let e=pt({className:`bg-purple-700 !flex items-center space-x-2`,text:`<i class="before:bg-icon-circle-check before:size-full before:block size-4 shrink-0 mr-2"></i> <span>Your comment was posted. <span class="underline">Return&nbsp;to&nbsp;reading.</span></span>`,escapeMarkup:!1,onClick:()=>{nt(e.toast.options.id,`jump_back_cta_click:return-to-reading`,e.toast.toastElement?.textContent),xn(),e.hide()}});await e.show(),hn=null},Cn=async e=>{Jt=null,Xt=null,Ht(e.id,!0),p.value&&(hn={restorePoint:p.value,replyFormKey:ne.value,nextCursor:ge.value,previousCursor:he.value,virtualPages:Fe.value},_()),await qn(!0);let t=vt.value===`latest`?te:F;f(t.value.$el,{behavior:`instant`,source:`PageShowThread:handleReplyAdded`}),ne.value++,K.value=!0,ge.value=null,ve.value=!0,he.value=null;let n=Xe(`/api/v3/talk/threads/${z.value.id}/replies?reply=${e.id}`,{immediate:!1}).json();try{await n.execute(),st(n.data.value.data,{action:`reply_added`,target:`added_post`,replyId:e.id}),Lt(),K.value=vt.value===`latest`,ge.value=n.data.value.meta.next_cursor,he.value=n.data.value.meta.prev_cursor,Vn(),await d(),await qn(!1),ne.value++,await d();let t=document.getElementById(`reply`+e.id);t&&f(t,{behavior:`instant`,source:`PageShowThread:handleReplyAdded`}),hn&&Sn()}catch{Un(n)?Gn(n):pt().show({text:`Failed to fetch your reply. Please try again`})}},wn=()=>{if(ae.value.id!==null){if(mn===ae.value.id){mn=null,Vt();return}tn(ae.value),Vt()}},Tn=(e,t)=>{let n={goToPost:()=>On(t),hideChange:()=>dn(t),pauseNext:()=>K.value=!0,threadFlipped:()=>un(),threadReacted:()=>cn(t),threadSaved:()=>on(t),replyAdded:()=>Cn(t),replyReacted:()=>sn(t),replySaved:()=>
80an(t),watchChange:()=>ln(t)}[e];n?n():console.warn(`Unhandled event: ${e}`)},En=e=>P.value.find(t=>t.$el.id===`replyPost`+e),Dn=(e,t=!0,n=!1)=>{if(!g)return;let r=En(e);if(!r){t&&(window.location=`${z.value.link}?reply=${e}`);return}let i=r.$el.querySelector(`#reply${e}`),a=()=>{i.focus(),i.blur()};n||Ae(`scrollend`,a,{once:!0}),f(i,{behavior:n?`instant`:`smooth`,source:`PageShowThread:goToPost`}),n&&a()},On=async e=>{if(!Ge.value.find(t=>t.id===e)){await kn(e);let t=vt.value===`oldest`?Ge.value[0].id:Ge.value[Ge.value.length-1].id;Dn(t,!1,!0),Lt()}Dn(e,!1)},kn=async e=>{try{Ht(e,!1),Ft(),ve.value=!0,he.value=null,K.value=!0,ge.value=null,await Pt.execute(!0),Rt(),st(Pt.data.value.data,{action:`go_to`,target:`next_op_post`,reply:e}),he.value=Pt.data.value.meta.prev_cursor,ge.value=Pt.data.value.meta.next_cursor,K.value=vt.value===`latest`,await d()}catch{Un(Pt)?Gn(Pt):pt().show({text:`Failed to fetch specific reply. Please try again`})}},jn=async e=>{let t=`?`+new URLSearchParams({posinset:e,"order-by":vt.value,batch:lt.value}).toString(),{data:n,error:r}=await Dt(t).json();if(r.value){pt().show({text:`Failed to fetch replies. Please try again`});return}return Ft(),he.value=n.value.meta.prev_cursor,ve.value=!!he.value,ge.value=n.value.meta.next_cursor,K.value=!!ge.value,Rt(),st(n.value.data,{action:`go_to`,target:`posinset:${e}`,reply:n.value.data.find(t=>t.posinset===e)?.id}),Ge.value.find(t=>t.posinset===e)},Mn=A(!1),Nn=A(!1),Pn=()=>{Nn.value=!0,Mn.value=!Mn.value},Rn=()=>{if(!g)return;let e=()=>{Nn.value=!0};typeof window.requestIdleCallback==`function`?window.requestIdleCallback(e,{timeout:2e3}):setTimeout(e,200)},zn=(e,t)=>{oe.value.push({id:e,createdAt:t}),oe.value.sort((e,t)=>e.createdAt-t.createdAt),oe.value=oe.value.slice(-5),z.value.latest_reply_id=oe.value[oe.value.length-1].id},Bn=e=>{Ee.value||(vt.value===`oldest`?ge.value:he.value)||Ge.value.find(t=>t.id===e)||B.value++},Vn=()=>{B.value=0},Hn=e=>{vt.value===`oldest`?Xt=null:Jt=null,zn(e.replyId,e.replyCreatedAt),Bn(e.replyId)},Un=e=>me.includes(e.data.value?.error?.code),Gn=e=>{pe.includes(e.data.value.error.code)?window.location.href=i.thread.link:(rn(At.data.value.error.message),u({top:0,behavior:`instant`,source:`PageShowThread:handleApiError`}))},Kn=()=>{$.remember(JSON.parse(JSON.stringify({thread:z.value,virtualPages:Fe.value,nextCursor:ge.value,previousCursor:he.value,bookmarkId:re.value,isDeleted:se.value,pausedNext:K.value,pausedPrevious:ve.value,virtualPageUrl:ke.value?.toString(),startedFromFirstPage:xe.value,batch:Se.value,previousLoadCount:De.value,nextLoadCount:Oe.value,newReplyCount:B.value,latestReplies:oe.value,replyTarget:ae.value,initialVirtualPageKey:Ie.value,canFireInitialVirtualPageEvent:Be.value})),`threadState`)},qn=async e=>{Ee.value=e};ce([Se,re,se,oe,B,ge,Oe,ke,K,ve,he,De,Fe,ae,xe,z,Ie,Be],Kn);let Xn=()=>{let e=$.restore(`threadState`);e&&(z.value=e.thread,Fe.value=e.virtualPages,ge.value=e.nextCursor,he.value=e.previousCursor,re.value=e.bookmarkId,se.value=e.isDeleted,K.value=e.pausedNext,ve.value=e.pausedPrevious,ke.value=Re(e.virtualPageUrl,e=>new URL(e)),xe.value=e.startedFromFirstPage,Se.value=e.batch,De.value=e.previousLoadCount,Oe.value=e.nextLoadCount,B.value=e.newReplyCount,oe.value=e.latestReplies,ae.value=e.replyTarget,Ie.value=e.initialVirtualPageKey,Be.value=e.canFireInitialVirtualPageEvent)};Je(()=>qe(`thread.${i.thread.id}`,`.reply-created`,Hn)),I(()=>{R.on(Tn),Ae(`open-talk-chevron-menu-vue`,Pn),Rn(),z.value.was_moderated&&(se.value=!0,le.value=z.value.message,ue.value=z.value.title);let e=performance.getEntriesByType(`navigation`).length&&performance.getEntriesByType(`navigation`).find(e=>e.type===`back_forward`);e&&(Xn(),re.value&&Ht(re.value,!0,!0)),ae.value.id&&!e&&`scrollRestoration`in window.history&&(window.history.scrollRestoration=`manual`),He()}),L(()=>{R.off(Tn)});let $n=A(ae.value),er=()=>{$n.value||=ae.value};ce(ae,er,{immediate:!0}),I(er),L(()=>$n.value=null);let{posinset:tr,setsize:nr,min:rr,max:ir}=Dl(j);return(n,r)=>{let o=fe(`icon`);return e(),S(`div`,null,[h(E(al),{title:z.value.subject},null,8,[`title`]),Nn.value?(e(),t(ep,{key:0,thread:z.value,visible:Mn.value,onCloseTalkChevronMenu:Pn},null,8,[`thread`,`visible`])):U(``,!0),z.value.sponsor?(e(),t(Dp,{key:1,sponsor:z.value.sponsor},null,8,[`sponsor`])):U(``,!0),se.value?(e(),t(Jn,{key:2,kind:`plain`,title:ue.value,class:`mt-4 flex space-x-2.5 rounded-xl border border-gray-200 bg-blue-200 px-4 py-3 text-sm text-gray-800 dark:border-gray-700 dark:text-white`},{default:G(()=>[h(E(Fn),{html:le.value},null,8,[`html`])]),_:1},8,[`title`])):U(``,!0),se.value?U(``,!0):(e(),S(`div`,{key:3,ref_key:`feedEl`,ref:k,role:`feed`,"aria-label":`Replies`,"aria-busy":Kt.value?`true`:`false`},[E(D)?(e(),t(Yn,{key:0,"is-watching":z.value.is_watching,"onUpdate:isWatching":r[0]||=e=>z.value.is_watching=e,"thread-id":z.value.id},null,8,[`is-watching`,`thread-id`])):U(``,!0),z.value.latest_mnhq_reply_id?(e(),t(Jn,{key:1,class:`mt-1.5`},{default:G(()=>[W(`div`,Lp,[W(`a`,{href:`${z.value.link}?show-mnhq-replies=1`,rel:`nofollow`,class:`font-semibold`},` See all MNHQ comments `,8,Rp),r[2]||=l(` on this thread `,-1)])]),_:1})):U(``,!0),E(O)?(e(),t(mr,{key:2,position:`top`,"topic-slug":z.value.topic.slug},null,8,[`topic-slug`])):U(``,!0),h(pp,{ref_key:`topThreadActionsBarEl`,ref:ee,thread:z.value,position:`top`},null,8,[`thread`]),E(We)(`thread-groups`)&&z.value.group?(e(),S(`div`,zp,[W(`div`,Bp,[W(`div`,Vp,[r[5]||=W(`p`,{class:`text-sm text-gray-800`},` This thread is part of a group: `,-1),W(`div`,Hp,[r[3]||=W(`svg`,{"aria-hidden":`true`,class:`h-[26px] w-[26px] shrink-0`,viewBox:`0 0 22 22`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[W(`path`,{class:`fill-[#E7B2F1] dark:fill-gray-400`,d:`M0 16.5a4.4 4.4 0 0 1 5.668-4.214A7.13 7.13 0 0 0 3.85 17.05v.55c0 .392.083.763.23 1.1H1.
801c-.608 0-1.1-.491-1.1-1.1zm5.775-8.8A2.473 2.473 0 0 1 3.3 10.175 2.473 2.473 0 0 1 .825 7.7 2.473 2.473 0 0 1 3.3 5.225 2.473 2.473 0 0 1 5.775 7.7m15.4 0a2.473 2.473 0 0 1-2.475 2.475A2.473 2.473 0 0 1 16.225 7.7 2.473 2.473 0 0 1 18.7 5.225 2.473 2.473 0 0 1 21.175 7.7m-4.843 4.586A4.4 4.4 0 0 1 22 16.5v1.1c0 .608-.492 1.1-1.1 1.1h-2.98c.147-.337.23-.708.23-1.1v-.55c0-1.829-.687-3.5-1.818-4.764`,opacity:`.75`}),W(`path`,{class:`fill-bright-orchid-500 dark:fill-purple-100`,d:`M5.5 17.05c0-3.039 2.461-5.5 5.5-5.5s5.5 2.461 5.5 5.5v.55c0 .608-.492 1.1-1.1 1.1H6.6c-.608 0-1.1-.492-1.1-1.1zM7.425 6.325A3.577 3.577 0 0 1 11 2.75a3.577 3.577 0 0 1 3.575 3.575A3.577 3.577 0 0 1 11 9.9a3.577 3.577 0 0 1-3.575-3.575`})],-1),W(`a`,{href:z.value.group.link,class:`min-w-0 truncate text-base font-bold text-blue-700 hover:underline`},J(z.value.group.name),9,Up)]),z.value.has_reached_reply_limit?(e(),S(`div`,Wp,[...r[4]||=[W(`div`,{class:`inline-flex items-center gap-[3px] whitespace-nowrap rounded-[100px] bg-orange-50 px-4 py-2 text-[14px] font-bold text-black`},[W(`span`,{"aria-hidden":`true`,class:`before:bg-icon-triangle-exclamation-solid before:block before:size-4 before:text-orange-600`}),W(`span`,null,`This thread is now full`)],-1)]])):U(``,!0)])])])):U(``,!0),h(tf,{thread:z.value,"op-replies":i.opReplyIds,"dispatches-events":!0,"aria-posinset":`0`,"aria-setsize":E(nr)??-1},null,8,[`thread`,`op-replies`,`aria-setsize`]),E(ie).props.showVaccinationCta?(e(),t(Ap,{key:4,class:`mt-1.5`})):U(``,!0),z.value.attachments?.attachments&&z.value.attachments.attachments.length?(e(),t(xp,{key:5,cursor:z.value.attachments.cursor,count:z.value.attachments.count,"thread-id":z.value.id,attachments:z.value.attachments.attachments},null,8,[`cursor`,`count`,`thread-id`,`attachments`])):U(``,!0),z.value.poll&&E(a).preferences.talk_show_polls?(e(),t(Zn,{key:6,poll:z.value.poll},null,8,[`poll`])):U(``,!0),ct.value?(e(),t(Pp,{key:7,link:z.value.link},null,8,[`link`])):U(``,!0),E(Ot).isFetching.value||vt.value===`latest`&&Ee.value?(e(),t(Lf,{key:8,ref_key:`topReplySkeletonEl`,ref:te,label:`Loading top posts...`,"fade-down":!1},null,512)):U(``,!0),he.value?V((e(),t(Nt,{key:9,size:`sm`,class:`m-auto my-3 flex gap-2`,onClick:r[1]||=e=>en(!1)},{default:G(()=>[l(` Load `+J(bt.value)+` posts `,1)]),_:1})),[[o,{icon:`chevron-up`,classes:`before:w-4 before:h-4 before:text-white`,loading:E(Mt).isFetching.value}]]):vt.value===`latest`&&he.value===null&&!E(Mt).isFetching.value&&B.value>0?V((e(),t(Nt,{key:10,size:`sm`,class:`m-auto my-3 flex gap-2`,onClick:Y},{default:G(()=>[l(J(B.value)+` new `+J(B.value>1?`posts`:`post`),1)]),_:1})),[[o,{icon:`arrow-rotate-right`,classes:`before:w-4 before:h-4`}]]):U(``,!0),V(W(`div`,null,null,512),[[E(In),[E(Gt),{rootMargin:`1200px`}]]]),z.value.pinned_reply&&he.value===null?(e(),S(`div`,Gp,[h(jf,{reply:z.value.pinned_reply,thread:z.value,"is-bookmarked":!1,"is-reply-target":!1,"dispatches-events":!0,type:`go-to-post`,"is-pinned":!0,onReplyTargetL
80oaded:wn,onGoToPost:Dn},null,8,[`reply`,`thread`])])):U(``,!0),W(`div`,{ref_key:`replyContainerEl`,ref:j,class:`relative`},[h(An,null,{default:G(()=>[h(Cl,{boundary:n.$refs.replyContainerEl,setsize:E(nr)??i.thread.replies_count,posinset:E(tr)??0,min:E(rr),max:E(ir)},null,8,[`boundary`,`setsize`,`posinset`,`min`,`max`]),!se.value&&(P.value?.length??0)>0&&(Ge.value?.length??0)>0?(e(),t(Ll,{key:0,boundary:n.$refs.replyContainerEl,posinset:E(tr),setsize:E(nr),min:E(rr),max:E(ir)},null,8,[`boundary`,`posinset`,`setsize`,`min`,`max`])):U(``,!0)]),_:1}),(e(!0),S(q,null,Ce(Fe.value.filter(e=>e.replies.length),n=>V((e(),S(`div`,{key:n.key,"data-batch":n.batch,"data-view-count":n.viewCount},[(e(!0),S(q,null,Ce(n.replies.slice(0,n.visibleCount),(n,r)=>(e(),t(jf,{id:`replyPost`+n.id,ref_for:!0,ref_key:`replyRefs`,ref:P,key:r+`_`+n.id,reply:n,thread:z.value,"is-bookmarked":n.id===re.value,"is-reply-target":ae.value.id===n.id,"is-initial-reply-target":$n.value?.id===n.id,"op-replies":i.opReplyIds,"dispatches-events":!0,type:`standard`,onReplyTargetL
80oaded:wn,onGoToPost:Dn},null,8,[`id`,`reply`,`thread`,`is-bookmarked`,`is-reply-target`,`is-initial-reply-target`,`op-replies`]))),128))],8,Kp)),[[E(Ln),Ve(n)]])),128))],512),W(`div`,{ref_key:`bottomBoxEl`,ref:M},[V(W(`div`,null,null,512),[[E(In),[E(Wt),{rootMargin:`1000px`}]]]),ge.value&&K.value&&!E(At).isFetching.value?V((e(),t(Nt,{key:0,size:`sm`,class:`m-auto my-3 flex gap-2`,onClick:Qt},{default:G(()=>[l(` Load `+J(yt.value)+` posts `,1)]),_:1})),[[o,{icon:`chevron-down`,classes:`before:w-4 before:h-4`}]]):vt.value===`oldest`&&ge.value===null&&K.value&&!E(At).isFetching.value&&B.value>0?V((e(),t(Nt,{key:1,size:`sm`,class:`m-auto my-3 flex gap-2`,onClick:$t},{default:G(()=>[l(J(B.value)+` new `+J(B.value>1?`posts`:`post`),1)]),_:1})),[[o,{icon:`arrow-rotate-right`,classes:`before:w-4 before:h-4`}]]):U(``,!0),ge.value&&E(At).isFetching.value||E(kt).isFetching.value||vt.value===`oldest`&&Ee.value?(e(),t(Lf,{key:2,ref_key:`bottomReplySkeletonEl`,ref:F,label:`Loading newer posts...`,"fade-down":!1},null,512)):U(``,!0)],512)],8,Ip)),h(pp,{ref_key:`bottomThreadActionsBarEl`,ref:N,thread:z.value},null,8,[`thread`]),h(sp),se.value?U(``,!0):(e(),S(`div`,qp,[W(`div`,Jp,[h(Tl,{icon:`facebook`,link:`https://www.facebook.com/sharer.php?u=${_t.value}`,label:`Share on Facebook`},null,8,[`link`]),h(Tl,{icon:`x-twitter`,link:`https://twitter.com/share?url=${_t.value}`,label:`Share on X`},null,8,[`link`]),h(Tl,{class:`lg:hidden`,icon:`whatsapp`,link:`whatsapp://send?text=${_t.value}`,label:`Share on Whatsapp`},null,8,[`link`])]),h(yl,{anchor:`talk-nav-top`,"dispatches-events":!0})])),!se.value&&E(C)?(e(),t(cf,{key:5,id:`post-box`,"reply-form-key":ne.value,thread:z.value,class:m({"max-lg:scroll-mt-28":!E(b)})},null,8,[`reply-form-key`,`thread`,`class`])):U(``,!0),i.thread.display_similar_threads&&!se.value?(e(),t(Qn,{key:6,class:m({"mt-3 h-[381px] lg:h-[282px]":!0,"max-lg:scroll-mt-28":E(b)}),"init-thread-id":i.thread.id,canonical:i.thread.link,"page-title":i.thread.subject},null,8,[`class`,`init-thread-id`,`canonical`,`page-title`])):U(``,!0)])}}},Zp=be?.title,Qp={title:e=>e?``+e.replace(/\s\|\sMumsnet$/i,``)+` | Mumsnet`:be?.title??Zp??`Mumsnet`,resolve:e=>Object.assign({"../vue/Pages/PageHome.vue":ll,"../vue/Pages/PageShowThread.vue":Fp})[`../vue/Pages/${e}.vue`],async setup({el:e,App:t,props:n,plugin:r}){let i=ze();(!g||(0,ul.isEmpty)(i.value)&&n.initialPage.props.globalState)&&i.replace(n.initialPage.props.globalState??{}),g||Qe.ssrReset();let a=ge(t,n).use(r).mixin(Pt);if(!g){let e=Number(n.initialPage?.props?.clientHints?.viewportWidth??NaN);Number.isFinite(e)&&e>0&&ae(e,a)}Ft(a),Ge(a);let o;if(n.initialPage.component===`PageHome`&&(o=await Qi(a)),!g)return a;
80if(n.initialPage.component===`PageHome`&&o?.currentRoute.value.name!==`featured`){let t=document.createElement(`div`);return a.mount(t),e.replaceWith(t),a}return a.mount(e),a}};typeof window<`u`&&!window.inertiaApp&&(window.inertiaApp=nl(Qp));
81//# sourceMappingURL=index-DyaHskFO.js.map

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.