@apolitical/component-library 1.9.4 → 1.9.5-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{4TNE5QTO-f2b91710.mjs → 4TNE5QTO-2aefb670.mjs} +1 -1
- package/{4TNE5QTO-eed10299.js → 4TNE5QTO-440b0dd4.js} +1 -1
- package/context/react-query/react-query.provider.d.ts +1 -1
- package/{index-44a23699.mjs → index-b7592811.mjs} +5 -2
- package/{index-e2f18610.js → index-bc8041f9.js} +1 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -98,4 +98,4 @@ For more details see https://formatjs.io/docs/getting-started/message-distributi
|
|
|
98
98
|
`},paragraph:{t:o1,i:Te.LOW,l:al,h:(f,p,m)=>n("p",{key:m.k},p(f.v,m))},ref:{t:Kr(RC),i:Te.MAX,l:f=>(s[f[1]]={B:f[2],F:f[4]},{}),h:cl},refImage:{t:Xr(PC),i:Te.MAX,l:f=>({D:f[1]||void 0,P:f[2]}),h:(f,p,m)=>n("img",{key:m.k,alt:f.D,src:Ai(s[f.P].B),title:s[f.P].F})},refLink:{t:Kr(NC),i:Te.MAX,l:(f,p,m)=>({v:p(f[1],m),Z:p(f[0].replace(IC,"\\$1"),m),P:f[2]}),h:(f,p,m)=>s[f.P]?n("a",{key:m.k,href:Ai(s[f.P].B),title:s[f.P].F},p(f.v,m)):n("span",{key:m.k},p(f.Z,m))},table:{t:Ir(p0),i:Te.HIGH,l:i1,h:(f,p,m)=>n("table",{key:m.k},n("thead",null,n("tr",null,f.L.map(function(_,S){return n("th",{key:S,style:Tm(f,S)},p(_,m))}))),n("tbody",null,f.A.map(function(_,S){return n("tr",{key:S},_.map(function(v,b){return n("td",{key:b,style:Tm(f,b)},p(v,m))}))})))},tableSeparator:{t:function(f,p){return p.$?(p._=!0,MC.exec(f)):null},i:Te.HIGH,l:function(){return{type:"tableSeparator"}},h:()=>" | "},text:{t:Es(WC),i:Te.MIN,l:f=>({v:f[0].replace(wC,(p,m)=>t.namedCodesToUnicode[m]?t.namedCodesToUnicode[m]:p)}),h:f=>f.v},textBolded:{t:Xr(jC),i:Te.MED,l:(f,p,m)=>({v:p(f[2],m)}),h:(f,p,m)=>n("strong",{key:m.k},p(f.v,m))},textEmphasized:{t:Xr(HC),i:Te.LOW,l:(f,p,m)=>({v:p(f[2],m)}),h:(f,p,m)=>n("em",{key:m.k},p(f.v,m))},textEscaped:{t:Xr(VC),i:Te.HIGH,l:f=>({v:f[1],type:"text"})},textMarked:{t:Xr(qC),i:Te.LOW,l:al,h:(f,p,m)=>n("mark",{key:m.k},p(f.v,m))},textStrikethroughed:{t:Xr(GC),i:Te.LOW,l:al,h:(f,p,m)=>n("del",{key:m.k},p(f.v,m))}};t.disableParsingRawHTML!==!0&&(c.htmlBlock={t:Es(rf),i:Te.HIGH,l(f,p,m){const[,_]=f[3].match(QC),S=new RegExp(`^${_}`,"gm"),v=f[3].replace(S,""),b=(T=v,t1.some(L=>L.test(T))?a1:Ga);var T;const w=f[1].toLowerCase(),N=uC.indexOf(w)!==-1;m.N=m.N||w==="a";const R=N?f[3]:b(p,v,m);return m.N=!1,{O:o(f[2]),v:R,G:N,H:N?w:f[1]}},h:(f,p,m)=>n(f.H,qn({key:m.k},f.O),f.G?f.v:p(f.v,m))},c.htmlSelfClosing={t:Es(nf),i:Te.HIGH,l:f=>({O:o(f[2]||""),H:f[1]}),h:(f,p,m)=>n(f.H,qn({},f.O,{key:m.k}))});const l=function(f){let p=Object.keys(f);function m(_,S){let v=[],b="";for(;_;){let T=0;for(;T<p.length;){const w=p[T],N=f[w],R=N.t(_,S,b);if(R){const L=R[0];_=_.substring(L.length);const $=N.l(R,m,S);$.type==null&&($.type=w),v.push($),b=L;break}T++}}return v}return p.sort(function(_,S){let v=f[_].i,b=f[S].i;return v!==b?v-b:_<S?-1:1}),function(_,S){return m(function(v){return v.replace(yC,`
|
|
99
99
|
`).replace(_C,"").replace(kC," ")}(_),S)}}(c),u=(d=function(f){return function(p,m,_){return f[p.type].h(p,m,_)}}(c),function f(p,m={}){if(Array.isArray(p)){const _=m.k,S=[];let v=!1;for(let b=0;b<p.length;b++){m.k=b;const T=f(p[b],m),w=typeof T=="string";w&&v?S[S.length-1]+=T:T!==null&&S.push(T),v=w}return m.k=_,S}return d(p,f,m)});var d;const h=i(e);return a.length?n("div",null,h,n("footer",{key:"footer"},a.map(function(f){return n("div",{id:t.slugify(f.j),key:f.j},f.j,u(l(f.I,{_:!0})))}))):h}(function(e){e[e.MAX=0]="MAX",e[e.HIGH=1]="HIGH",e[e.MED=2]="MED",e[e.LOW=3]="LOW",e[e.MIN=4]="MIN"})(Te||(Te={}));const xu=e=>{let{children:t,options:r}=e,n=function(i,o){if(i==null)return{};var a,s,c={},l=Object.keys(i);for(s=0;s<l.length;s++)o.indexOf(a=l[s])>=0||(c[a]=i[a]);return c}(e,aC);return pe.cloneElement(c1(t,r),n)};const Br=({variant:e="primary",className:t="",children:r,...n})=>x.jsx("div",{className:se("highlighted-text-box",e,t),...n,children:r});const aa=({variant:e="empty",text:t=!1,button:r=!1,className:n=""})=>{let i=r&&!!Object.keys(r).length;const o=typeof r=="object"&&"breakpoints"in r,a=ra(o);if(o&&typeof r=="object"&&typeof a=="number"){const d=Object.assign({},r.breakpoints),h=xv(Object.keys(d));i=Ov(a,h,d)}const{breakpoints:s,text:c="",component:l,...u}=r;return x.jsx(Br,{variant:"subtle",className:se("empty-state-box",e,n),children:x.jsxs(x.Fragment,{children:[t&&x.jsx(xu,{options:{forceBlock:!0},children:t}),i&&typeof r=="object"&&(l||x.jsx(ze,{...u,variant:r.variant?r.variant:"secondary",children:c}))]})})};const of=({children:e,...t})=>x.jsx("p",{...t,children:e}),O0={q:of,blockquote:of};for(let e=1;e<=6;e++)O0[`h${e}`]={component:of,props:{className:"title"}};const A0=({type:e="default",className:t="",heading:r=!1,children:n})=>x.jsxs("div",{className:se("helper-text-box text-small",e,t),children:[r&&x.jsx("p",{className:"title",children:r}),typeof n=="string"?x.jsx(xu,{options:{wrapper:U.Fragment,forceBlock:!0,overrides:O0},children:n}):x.jsx("p",{children:n})]});const l1=({className:e="",show:t=!1,hide:r=!1,text:n,children:i})=>{const o=Oe(),a=U.useRef(null),[s,c]=U.useState(""),[l,u]=U.useState("closed");U.useEffect(()=>{const f=a.current;if(f)return f.addEventListener("transitionend",d),()=>{f.removeEventListener("transitionend",d)}},[]),U.useEffect(()=>{if(!n||typeof n!="string")return;const f=n.split(`
|
|
100
100
|
`);c(f.length<3?`${n.substring(0,400)}...`:f.slice(0,3).join(`
|
|
101
|
-
`))},[n]),U.useEffect(()=>{l==="ready-to-close"&&u("closing")},[l]);const d=({propertyName:f})=>{f==="max-height"&&u(p=>p==="opening"?"open":p==="closing"?"closed":p)};if(!n)return null;const h=["opening","open"].includes(l);return x.jsxs(Br,{variant:"subtle",className:se("hide-show-text-box",e),children:[x.jsxs("div",{ref:a,className:se("content",l),children:[x.jsx(xu,{options:{forceBlock:!0},children:l==="closed"?s:n}),l!=="closed"&&i]}),x.jsx("p",{className:"cta",children:x.jsx(ze,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:se({"rotate-180":h}),onClick:()=>{u(h?"ready-to-close":"opening")},children:h?r||o.formatMessage({id:"hideShowTextBox_hide"}):t||o.formatMessage({id:"hideShowTextBox_show"})})})]})},f1=()=>U.Fragment,h1=({children:e})=>x.jsx(Br,{variant:"secondary",children:e}),d1=["span","strong","h1","h2","h3","h4","h5","h6","p"],p1=({children:e})=>{const t=Oe();if(!e)return null;let r=t.formatMessage({id:"markdown_collapsibleSection_summary"});const n=[];for(const o of U.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number"))if(U.isValidElement(o)&&o.type==="summary"){if(o.props&&o.props.children){for(const a of U.Children.toArray(o.props.children))if(!(!a||typeof a=="string"||typeof a=="number")&&U.isValidElement(a)){const s=a.type;if(d1.includes(s)){for(r=a.props.children;typeof r!="string"&&(Array.isArray(r)&&r[0].props&&r[0].props.children&&r[0].props.children[0]);)r=r[0].props.children[0];break}}}}else n.push(o);const i=r?r.toString():"";return x.jsx(Xf,{label:i,className:["Sources","Resources"].includes(i)?"discrete-links":"",children:n.map(o=>o)})},m1=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return x.jsx(Br,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return x.jsx(Br,{variant:"primary",children:e});case"pink-textbox":return x.jsx(Br,{variant:"tertiary",children:e});default:return x.jsx("div",{...t,children:e})}return x.jsx("div",{...t,children:e})},g1=e=>{const t=Oe(),r=Date.now().toString();let n="default";const i=e.src;return i.includes("youtube")||i.includes("vimeo")?n="video":i.includes("riddle")||i.includes("sli.do")?n="poll":i.includes("padlet")&&(n="padlet"),x.jsxs(x.Fragment,{children:[x.jsx(lt,{children:x.jsx("a",{href:`#content-after-iframe-${r}`,children:t.formatMessage({id:`markdown_skip${n==="default"?"":`_${n}`}`})})}),x.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${n==="default"?"":`_${n}`}`})}),x.jsx("span",{id:`content-after-iframe-${r}`,tabIndex:-1})]})},Om=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},y1=({children:e,...t})=>{let r={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(r.target="_blank");let n=e,i=!1;for(const o of U.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number")&&U.isValidElement(o)){const a=o.type;if(["button","center","span","strong"].includes(a)&&o.props&&o.props.children&&o.props.children[0])for((a==="button"||Om(o.props.children[0])==="button")&&(i=!0),n=o.props.children[0];n&&typeof n!="string"&&!(typeof n=="boolean"||typeof n=="number"||!U.isValidElement(n));)if(n.props&&n.props.children&&n.props.children[0])n=n.props.children[0],n&&Om(n)==="button"&&(i=!0);else break}return i?(r={...r,className:"button primary medium"},x.jsx("p",{className:"center",children:x.jsx(ze,{variant:"primary",size:"medium",...r,children:n})})):x.jsx("a",{...r,children:n})},C0=({children:e})=>x.jsx("span",{children:e});const sf=({className:e="",options:t={},children:r})=>{r=r.replace(/^<br\/?>/,"");const n={wrapper:U.Fragment,forceBlock:!0,overrides:{a:y1,CollapsibleSection:Xf,TextBox:Br,CaseStudy:h1,style:f1,details:p1,div:m1,iframe:g1}};return x.jsx("div",{className:se("markdown-text",e),children:x.jsx(xu,{options:{...n,...t},children:r})})};const R0=({size:e="medium",variant:t="default",className:r="",children:n})=>x.jsx("span",{className:se("pill",e,t,r),children:n});const nu=({element:e="p",children:t=null,className:r="",...n})=>U.createElement(e,{...n,className:se("status-banner text-small",r),"aria-live":"assertive"},t);const v1=({progress:e=0,text:t=!1,className:r=""})=>{const n=Oe(),i=e>75?100:e>50?75:e>25?50:e>5?25:0,o={"--progress":`${e}%`};return x.jsx("span",{className:se(`progress-bar section-${i}`,r),style:o,children:x.jsx(lt,{children:t?`${e} ${t}`:n.formatMessage({id:"progressBar"},{number:e})})})},P0=U.memo(v1);const fl="loadingBlock_",E1=({progress:e=0,steps:t=!1,className:r=""})=>{const n=Oe();t||(t={0:{text:n.formatMessage({id:`${fl}loading`})},75:{text:n.formatMessage({id:`${fl}almostDone`})},100:{text:n.formatMessage({id:`${fl}complete`})}});let i=null;const o=Object.keys(t);for(let s=0;s<o.length&&!(e<parseInt(o[s]));s++)i=o[s];const a=i&&t[i].icon?{"--icon":`url(${ru}icons/${t[i].icon}.svg)`}:{};return x.jsxs(Br,{className:se("loading-block",r,{"has-icon":i&&t[i].icon}),variant:"subtle",style:a,children:[i&&x.jsx("span",{className:"step",children:t[i].text}),x.jsx(P0,{progress:e})]})},_1=U.memo(E1);const yr=({element:e="div",className:t="",...r})=>x.jsx(Of,{element:e,className:se("loading-placeholder",t),...r});const af={header:["logo","link","link","search"],sidebar:["text","text","text","text","text"],"cards-section":["subtitle","cards"],cards:["card","card","card","card"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"]},N0=(e,t)=>e in af?x.jsx("div",{className:e,children:af[e].map((r,n)=>N0(r,n))},t):x.jsx(yr,{className:e},t),I0=({layout:e="overview-page"})=>x.jsx("div",{className:se("loading-state",e),children:af[e].map((t,r)=>N0(t,r))}),L0=e=>{const t=e&&e.toUpperCase().split(" ");return Array.isArray(t)&&t.length>1&&t[0]!==""?t[1]===""?t[0][0]:t[0][0]+t[t.length-1][0]:e?e.substr(0,1):""},ka=["#5AB6A3","#A2D7AF","#806056","#3962B3"],b1=e=>{const t=Math.ceil(26/ka.length),r=L0(e).toLowerCase();if(r==="")return ka[0];const n=r.charCodeAt(0)-96;for(let i=0;i<ka.length;i++)if(n<=t*(i+1))return ka[i]};const Am=256,Ou=({className:e="",src:t="",name:r,alt:n,width:i=Am,height:o=Am,...a})=>{const[s,c]=U.useState(!1),l=U.useRef(null);U.useEffect(()=>{const d=l.current;if(!d)return;const h=d.getContext("2d");if(!h)return;const f=i,p=o;typeof window<"u"&&window.devicePixelRatio&&(d.width=f*window.devicePixelRatio,d.height=p*window.devicePixelRatio,h.scale(window.devicePixelRatio,window.devicePixelRatio)),h.fillStyle=b1(r),h.fillRect(0,0,f,p),h.font=`${f/3}px Arial`,h.textAlign="center",h.fillStyle="white",h.fillText(L0(r),f/2,p/1.6)},[r]);let u=!1;return t&&t!==""&&!s&&(t.includes("http")||t.includes("//"))&&(u=!0),x.jsx("figure",{className:se("profile-picture",e,{error:s}),...a,children:u?x.jsx("img",{src:t,alt:n||r,onError:()=>{c(!0)},width:i,height:o}):x.jsx("canvas",{ref:l})})},eh=e=>e==="apolitical"?{image:`${ru}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${ru}logos/member_community.svg`}:{name:e.name,role:e.jobTitle||"",organisation:e.organization||"",country:e.location&&e.location.country||"",url:`/profiles/${e.id}`,image:e.image&&e.image.thumbnail},w1=({role:e="",organisation:t="",country:r="",maximumCharacters:n=80})=>{const i=e!=="",o=t!=="",a=r!=="";if(!i&&!o&&!a)return"";const s=`${e}${i&&o?` — ${t}`:t}`;let c=`${s}${(i||o)&&a?`, ${r}`:r}`;return c.length>n&&(c=s),c.length>n&&(c=Kf(c,n)),c};const Au=({element:e="div",member:t="community",additionalContent:r=!1,gtmContext:n="member",gtmType:i="member-click",className:o=""})=>{const a=Oe(),s=eh(t);s.name||(s.name=a.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:c,url:l,image:u}=s,d=w1(s),h=r&&r.createdAt?wO(r.createdAt):!1,f=r&&r.createdAt?bO(r.createdAt):"";return U.createElement(e,{className:se("member text-medium",o),children:x.jsxs(ia,{href:l,gtmType:i,gtmContext:n,onClick:p=>{p==null||p.stopPropagation()},children:[x.jsx(Ou,{name:c,src:u}),x.jsxs("p",{className:"details",children:[x.jsx("strong",{children:c}),r&&x.jsxs("span",{className:"additional-content",children:[r.createdAt&&h&&x.jsx("span",{className:"date",title:f,"aria-label":f,children:a.formatMessage({id:`dates_${h.path}`},{number:h.number})}),r.didEdit&&x.jsx("em",{children:a.formatMessage({id:"discussion_edited"})})]}),d&&x.jsx("small",{children:d})]})]})})};const Cm={small:24,medium:48},k0=({element:e="div",contributors:{total:t,data:r}={total:void 0,data:[]},styling:{showText:n,size:i,showGap:o,showPlaceholders:a}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:s=2,className:c=""})=>{const l=Oe();return!r||r.length===0?null:U.createElement(e,{className:se("contributors",c,i,{"has-gap":o}),children:x.jsxs(x.Fragment,{children:[x.jsx("ul",{children:r.map((u,d)=>{let h,f="";if(d<s){const{name:p="",image:m=""}=eh(u);if(a)return x.jsx(yr,{element:"li",className:"contributor"},d);h=x.jsx(Ou,{name:p,src:m,width:Cm[i||"medium"],height:Cm[i||"medium"]})}else if(d===s){const p=(t||r.length)-s;h=x.jsxs("small",{className:se({"large-number":p>99}),children:["+",CO(p,0)]}),f="number-left"}return h?x.jsx("li",{className:se("contributor",f),children:h},d):null})}),n&&x.jsx("span",{className:"label",children:typeof n=="string"?n:r.length===1?typeof r[0]=="string"?l.formatMessage({id:`member_${r[0]}`}):Kf(r[0].name||"",20):null})]})})},S1=({children:e,locale:t,messages:r})=>{const n=t||"en",i={...AO[n],...r||{}};return x.jsx(XA,{locale:n,messages:i,children:e})},$r=U.createContext(null),T1=({children:e,user:t})=>x.jsx($r.Provider,{value:t,children:e});var mo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ao=typeof window>"u"||"Deno"in window;function jt(){}function x1(e,t){return typeof e=="function"?e(t):e}function uf(e){return typeof e=="number"&&e>=0&&e!==1/0}function M0(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Rm(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(n){if(t.queryHash!==th(a,t.options))return!1}else if(!Ps(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Pm(e,t){const{exact:r,status:n,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(Rs(t.options.mutationKey)!==Rs(o))return!1}else if(!Ps(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function th(e,t){return((t==null?void 0:t.queryKeyHashFn)||Rs)(e)}function Rs(e){return JSON.stringify(e,(t,r)=>cf(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Ps(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!Ps(e[r],t[r])):!1}function F0(e,t){if(e===t)return e;const r=Nm(e)&&Nm(t);if(r||cf(e)&&cf(t)){const n=r?e.length:Object.keys(e).length,i=r?t:Object.keys(t),o=i.length,a=r?[]:{};let s=0;for(let c=0;c<o;c++){const l=r?c:i[c];a[l]=F0(e[l],t[l]),a[l]===e[l]&&s++}return n===o&&s===n?e:a}return t}function iu(e,t){if(e&&!t||t&&!e)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Nm(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cf(e){if(!Im(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const r=t.prototype;return!(!Im(r)||!r.hasOwnProperty("isPrototypeOf"))}function Im(e){return Object.prototype.toString.call(e)==="[object Object]"}function D0(e){return new Promise(t=>{setTimeout(t,e)})}function Lm(e){D0(0).then(e)}function lf(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?F0(e,t):t}function O1(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function A1(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Gn,en,ki,eg,C1=(eg=class extends mo{constructor(){super();ne(this,Gn,void 0);ne(this,en,void 0);ne(this,ki,void 0);J(this,ki,t=>{if(!ao&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){P(this,en)||this.setEventListener(P(this,ki))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,en))==null||t.call(this),J(this,en,void 0))}setEventListener(t){var r;J(this,ki,t),(r=P(this,en))==null||r.call(this),J(this,en,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){P(this,Gn)!==t&&(J(this,Gn,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof P(this,Gn)=="boolean"?P(this,Gn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Gn=new WeakMap,en=new WeakMap,ki=new WeakMap,eg),ou=new C1,Mi,tn,Fi,tg,R1=(tg=class extends mo{constructor(){super();ne(this,Mi,!0);ne(this,tn,void 0);ne(this,Fi,void 0);J(this,Fi,t=>{if(!ao&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){P(this,tn)||this.setEventListener(P(this,Fi))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,tn))==null||t.call(this),J(this,tn,void 0))}setEventListener(t){var r;J(this,Fi,t),(r=P(this,tn))==null||r.call(this),J(this,tn,t(this.setOnline.bind(this)))}setOnline(t){P(this,Mi)!==t&&(J(this,Mi,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return P(this,Mi)}},Mi=new WeakMap,tn=new WeakMap,Fi=new WeakMap,tg),Ns=new R1;function P1(e){return Math.min(1e3*2**e,3e4)}function Cu(e){return(e??"online")==="online"?Ns.isOnline():!0}var B0=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function hl(e){return e instanceof B0}function U0(e){let t=!1,r=0,n=!1,i,o,a;const s=new Promise((_,S)=>{o=_,a=S}),c=_=>{var S;n||(f(new B0(_)),(S=e.abort)==null||S.call(e))},l=()=>{t=!0},u=()=>{t=!1},d=()=>!ou.isFocused()||e.networkMode!=="always"&&!Ns.isOnline(),h=_=>{var S;n||(n=!0,(S=e.onSuccess)==null||S.call(e,_),i==null||i(),o(_))},f=_=>{var S;n||(n=!0,(S=e.onError)==null||S.call(e,_),i==null||i(),a(_))},p=()=>new Promise(_=>{var S;i=v=>{const b=n||!d();return b&&_(v),b},(S=e.onPause)==null||S.call(e)}).then(()=>{var _;i=void 0,n||(_=e.onContinue)==null||_.call(e)}),m=()=>{if(n)return;let _;try{_=e.fn()}catch(S){_=Promise.reject(S)}Promise.resolve(_).then(h).catch(S=>{var N;if(n)return;const v=e.retry??(ao?0:3),b=e.retryDelay??P1,T=typeof b=="function"?b(r,S):b,w=v===!0||typeof v=="number"&&r<v||typeof v=="function"&&v(r,S);if(t||!w){f(S);return}r++,(N=e.onFail)==null||N.call(e,r,S),D0(T).then(()=>{if(d())return p()}).then(()=>{t?f(S):m()})})};return Cu(e.networkMode)?m():p().then(m),{promise:s,cancel:c,continue:()=>(i==null?void 0:i())?s:Promise.resolve(),cancelRetry:l,continueRetry:u}}function N1(){let e=[],t=0,r=u=>{u()},n=u=>{u()};const i=u=>{let d;t++;try{d=u()}finally{t--,t||s()}return d},o=u=>{t?e.push(u):Lm(()=>{r(u)})},a=u=>(...d)=>{o(()=>{u(...d)})},s=()=>{const u=e;e=[],u.length&&Lm(()=>{n(()=>{u.forEach(d=>{r(d)})})})};return{batch:i,batchCalls:a,schedule:o,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u}}}var Ke=N1(),Vn,rg,$0=(rg=class{constructor(){ne(this,Vn,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uf(this.gcTime)&&J(this,Vn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ao?1/0:5*60*1e3))}clearGcTimeout(){P(this,Vn)&&(clearTimeout(P(this,Vn)),J(this,Vn,void 0))}},Vn=new WeakMap,rg),Di,Bi,Dt,rn,Bt,it,Fs,Wn,Ui,Va,Zt,kr,ng,I1=(ng=class extends $0{constructor(t){super();ne(this,Ui);ne(this,Zt);ne(this,Di,void 0);ne(this,Bi,void 0);ne(this,Dt,void 0);ne(this,rn,void 0);ne(this,Bt,void 0);ne(this,it,void 0);ne(this,Fs,void 0);ne(this,Wn,void 0);J(this,Wn,!1),J(this,Fs,t.defaultOptions),ye(this,Ui,Va).call(this,t.options),J(this,it,[]),J(this,Dt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,J(this,Di,t.state||L1(this.options)),this.state=P(this,Di),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!P(this,it).length&&this.state.fetchStatus==="idle"&&P(this,Dt).remove(this)}setData(t,r){const n=lf(this.state.data,t,this.options);return ye(this,Zt,kr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){ye(this,Zt,kr).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n;const r=P(this,rn);return(n=P(this,Bt))==null||n.cancel(t),r?r.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,Di))}isActive(){return P(this,it).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||P(this,it).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!M0(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=P(this,it).find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=P(this,Bt))==null||r.continue()}onOnline(){var r;const t=P(this,it).find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=P(this,Bt))==null||r.continue()}addObserver(t){P(this,it).includes(t)||(P(this,it).push(t),this.clearGcTimeout(),P(this,Dt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){P(this,it).includes(t)&&(J(this,it,P(this,it).filter(r=>r!==t)),P(this,it).length||(P(this,Bt)&&(P(this,Wn)?P(this,Bt).cancel({revert:!0}):P(this,Bt).cancelRetry()),this.scheduleGc()),P(this,Dt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return P(this,it).length}invalidate(){this.state.isInvalidated||ye(this,Zt,kr).call(this,{type:"invalidate"})}fetch(t,r){var l,u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(P(this,rn))return(l=P(this,Bt))==null||l.continueRetry(),P(this,rn)}if(t&&ye(this,Ui,Va).call(this,t),!this.options.queryFn){const f=P(this,it).find(p=>p.options.queryFn);f&&ye(this,Ui,Va).call(this,f.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,i={queryKey:this.queryKey,meta:this.meta},o=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(J(this,Wn,!0),n.signal)})};o(i);const a=()=>this.options.queryFn?(J(this,Wn,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),s={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};o(s),(u=this.options.behavior)==null||u.onFetch(s,this),J(this,Bi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=s.fetchOptions)==null?void 0:d.meta))&&ye(this,Zt,kr).call(this,{type:"fetch",meta:(h=s.fetchOptions)==null?void 0:h.meta});const c=f=>{var p,m,_,S;hl(f)&&f.silent||ye(this,Zt,kr).call(this,{type:"error",error:f}),hl(f)||((m=(p=P(this,Dt).config).onError)==null||m.call(p,f,this),(S=(_=P(this,Dt).config).onSettled)==null||S.call(_,this.state.data,f,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return J(this,Bt,U0({fn:s.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var p,m,_,S;if(typeof f>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),c(new Error(`${this.queryHash} data is undefined`));return}this.setData(f),(m=(p=P(this,Dt).config).onSuccess)==null||m.call(p,f,this),(S=(_=P(this,Dt).config).onSettled)==null||S.call(_,f,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:c,onFail:(f,p)=>{ye(this,Zt,kr).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{ye(this,Zt,kr).call(this,{type:"pause"})},onContinue:()=>{ye(this,Zt,kr).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode})),J(this,rn,P(this,Bt).promise),P(this,rn)}},Di=new WeakMap,Bi=new WeakMap,Dt=new WeakMap,rn=new WeakMap,Bt=new WeakMap,it=new WeakMap,Fs=new WeakMap,Wn=new WeakMap,Ui=new WeakSet,Va=function(t){this.options={...P(this,Fs),...t},this.updateGcTime(this.options.gcTime)},Zt=new WeakSet,kr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:Cu(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return hl(i)&&i.revert&&P(this,Bi)?{...P(this,Bi),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Ke.batch(()=>{P(this,it).forEach(n=>{n.onQueryUpdate()}),P(this,Dt).notify({query:this,type:"updated",action:t})})},ng);function L1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=typeof t<"u",n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var lr,ig,k1=(ig=class extends mo{constructor(t={}){super();ne(this,lr,void 0);this.config=t,J(this,lr,new Map)}build(t,r,n){const i=r.queryKey,o=r.queryHash??th(i,r);let a=this.get(o);return a||(a=new I1({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){P(this,lr).has(t.queryHash)||(P(this,lr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=P(this,lr).get(t.queryHash);r&&(t.destroy(),r===t&&P(this,lr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,lr).get(t)}getAll(){return[...P(this,lr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Rm(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Rm(t,n)):r}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},lr=new WeakMap,ig),fr,Ds,Lt,$i,hr,Jr,og,M1=(og=class extends $0{constructor(t){super();ne(this,hr);ne(this,fr,void 0);ne(this,Ds,void 0);ne(this,Lt,void 0);ne(this,$i,void 0);this.mutationId=t.mutationId,J(this,Ds,t.defaultOptions),J(this,Lt,t.mutationCache),J(this,fr,[]),this.state=t.state||j0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...P(this,Ds),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,fr).includes(t)||(P(this,fr).push(t),this.clearGcTimeout(),P(this,Lt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){J(this,fr,P(this,fr).filter(r=>r!==t)),this.scheduleGc(),P(this,Lt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,fr).length||(this.state.status==="pending"?this.scheduleGc():P(this,Lt).remove(this))}continue(){var t;return((t=P(this,$i))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,a,s,c,l,u,d,h,f,p,m,_,S,v,b,T,w,N,R;const r=()=>(J(this,$i,U0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(L,$)=>{ye(this,hr,Jr).call(this,{type:"failed",failureCount:L,error:$})},onPause:()=>{ye(this,hr,Jr).call(this,{type:"pause"})},onContinue:()=>{ye(this,hr,Jr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),P(this,$i).promise),n=this.state.status==="pending";try{if(!n){ye(this,hr,Jr).call(this,{type:"pending",variables:t}),await((o=(i=P(this,Lt).config).onMutate)==null?void 0:o.call(i,t,this));const $=await((s=(a=this.options).onMutate)==null?void 0:s.call(a,t));$!==this.state.context&&ye(this,hr,Jr).call(this,{type:"pending",context:$,variables:t})}const L=await r();return await((l=(c=P(this,Lt).config).onSuccess)==null?void 0:l.call(c,L,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,L,t,this.state.context)),await((f=(h=P(this,Lt).config).onSettled)==null?void 0:f.call(h,L,null,this.state.variables,this.state.context,this)),await((m=(p=this.options).onSettled)==null?void 0:m.call(p,L,null,t,this.state.context)),ye(this,hr,Jr).call(this,{type:"success",data:L}),L}catch(L){try{throw await((S=(_=P(this,Lt).config).onError)==null?void 0:S.call(_,L,t,this.state.context,this)),await((b=(v=this.options).onError)==null?void 0:b.call(v,L,t,this.state.context)),await((w=(T=P(this,Lt).config).onSettled)==null?void 0:w.call(T,void 0,L,this.state.variables,this.state.context,this)),await((R=(N=this.options).onSettled)==null?void 0:R.call(N,void 0,L,t,this.state.context)),L}finally{ye(this,hr,Jr).call(this,{type:"error",error:L})}}}},fr=new WeakMap,Ds=new WeakMap,Lt=new WeakMap,$i=new WeakMap,hr=new WeakSet,Jr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Cu(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ke.batch(()=>{P(this,fr).forEach(n=>{n.onMutationUpdate(t)}),P(this,Lt).notify({mutation:this,type:"updated",action:t})})},og);function j0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ut,Bs,zn,sg,F1=(sg=class extends mo{constructor(t={}){super();ne(this,Ut,void 0);ne(this,Bs,void 0);ne(this,zn,void 0);this.config=t,J(this,Ut,[]),J(this,Bs,0)}build(t,r,n){const i=new M1({mutationCache:this,mutationId:++la(this,Bs)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){P(this,Ut).push(t),this.notify({type:"added",mutation:t})}remove(t){J(this,Ut,P(this,Ut).filter(r=>r!==t)),this.notify({type:"removed",mutation:t})}clear(){Ke.batch(()=>{P(this,Ut).forEach(t=>{this.remove(t)})})}getAll(){return P(this,Ut)}find(t){const r={exact:!0,...t};return P(this,Ut).find(n=>Pm(r,n))}findAll(t={}){return P(this,Ut).filter(r=>Pm(t,r))}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){return J(this,zn,(P(this,zn)??Promise.resolve()).then(()=>{const t=P(this,Ut).filter(r=>r.state.isPaused);return Ke.batch(()=>t.reduce((r,n)=>r.then(()=>n.continue().catch(jt)),Promise.resolve()))}).then(()=>{J(this,zn,void 0)})),P(this,zn)}},Ut=new WeakMap,Bs=new WeakMap,zn=new WeakMap,sg);function D1(e){return{onFetch:(t,r)=>{const n=async()=>{var p,m,_,S,v;const i=t.options,o=(_=(m=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:m.fetchMore)==null?void 0:_.direction,a=((S=t.state.data)==null?void 0:S.pages)||[],s=((v=t.state.data)==null?void 0:v.pageParams)||[],c={pages:[],pageParams:[]};let l=!1;const u=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?l=!0:t.signal.addEventListener("abort",()=>{l=!0}),t.signal)})},d=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),h=async(b,T,w)=>{if(l)return Promise.reject();if(T==null&&b.pages.length)return Promise.resolve(b);const N={queryKey:t.queryKey,pageParam:T,direction:w?"backward":"forward",meta:t.options.meta};u(N);const R=await d(N),{maxPages:L}=t.options,$=w?A1:O1;return{pages:$(b.pages,R,L),pageParams:$(b.pageParams,T,L)}};let f;if(o&&a.length){const b=o==="backward",T=b?B1:km,w={pages:a,pageParams:s},N=T(i,w);f=await h(w,N,b)}else{f=await h(c,s[0]??i.initialPageParam);const b=e??a.length;for(let T=1;T<b;T++){const w=km(i,f);f=await h(f,w)}}return f};t.options.persister?t.fetchFn=()=>{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,n,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=n}}}function km(e,{pages:t,pageParams:r}){const n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function B1(e,{pages:t,pageParams:r}){var n;return(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r)}var Ye,nn,on,ji,Hi,sn,qi,Gi,ag,U1=(ag=class{constructor(e={}){ne(this,Ye,void 0);ne(this,nn,void 0);ne(this,on,void 0);ne(this,ji,void 0);ne(this,Hi,void 0);ne(this,sn,void 0);ne(this,qi,void 0);ne(this,Gi,void 0);J(this,Ye,e.queryCache||new k1),J(this,nn,e.mutationCache||new F1),J(this,on,e.defaultOptions||{}),J(this,ji,new Map),J(this,Hi,new Map),J(this,sn,0)}mount(){la(this,sn)._++,P(this,sn)===1&&(J(this,qi,ou.subscribe(()=>{ou.isFocused()&&(this.resumePausedMutations(),P(this,Ye).onFocus())})),J(this,Gi,Ns.subscribe(()=>{Ns.isOnline()&&(this.resumePausedMutations(),P(this,Ye).onOnline())})))}unmount(){var e,t;la(this,sn)._--,P(this,sn)===0&&((e=P(this,qi))==null||e.call(this),J(this,qi,void 0),(t=P(this,Gi))==null||t.call(this),J(this,Gi,void 0))}isFetching(e){return P(this,Ye).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,nn).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=P(this,Ye).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=P(this,Ye).find({queryKey:e}),i=n==null?void 0:n.state.data,o=x1(t,i);if(typeof o>"u")return;const a=this.defaultQueryOptions({queryKey:e});return P(this,Ye).build(this,a).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Ke.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var t;return(t=P(this,Ye).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=P(this,Ye);Ke.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=P(this,Ye),n={type:"active",...e};return Ke.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(n,t)))}cancelQueries(e={},t={}){const r={revert:!0,...t},n=Ke.batch(()=>P(this,Ye).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(jt).catch(jt)}invalidateQueries(e={},t={}){return Ke.batch(()=>{if(P(this,Ye).findAll(e).forEach(n=>{n.invalidate()}),e.refetchType==="none")return Promise.resolve();const r={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(r,t)})}refetchQueries(e={},t){const r={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},n=Ke.batch(()=>P(this,Ye).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,r);return r.throwOnError||(o=o.catch(jt)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const r=P(this,Ye).build(this,t);return r.isStaleByTime(t.staleTime)?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=D1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}resumePausedMutations(){return P(this,nn).resumePausedMutations()}getQueryCache(){return P(this,Ye)}getMutationCache(){return P(this,nn)}getDefaultOptions(){return P(this,on)}setDefaultOptions(e){J(this,on,e)}setQueryDefaults(e,t){P(this,ji).set(Rs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,ji).values()];let r={};return t.forEach(n=>{Ps(e,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(e,t){P(this,Hi).set(Rs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,Hi).values()];let r={};return t.forEach(n=>{Ps(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...P(this,on).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=th(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,on).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,Ye).clear(),P(this,nn).clear()}},Ye=new WeakMap,nn=new WeakMap,on=new WeakMap,ji=new WeakMap,Hi=new WeakMap,sn=new WeakMap,qi=new WeakMap,Gi=new WeakMap,ag),At,Be,Vi,pt,Qn,Wi,dr,Us,zi,Qi,Yn,Kn,an,Xn,Jn,_s,$s,ff,js,hf,Hs,df,qs,pf,Gs,mf,Vs,gf,Ws,yf,gu,H0,ug,$1=(ug=class extends mo{constructor(t,r){super();ne(this,Jn);ne(this,$s);ne(this,js);ne(this,Hs);ne(this,qs);ne(this,Gs);ne(this,Vs);ne(this,Ws);ne(this,gu);ne(this,At,void 0);ne(this,Be,void 0);ne(this,Vi,void 0);ne(this,pt,void 0);ne(this,Qn,void 0);ne(this,Wi,void 0);ne(this,dr,void 0);ne(this,Us,void 0);ne(this,zi,void 0);ne(this,Qi,void 0);ne(this,Yn,void 0);ne(this,Kn,void 0);ne(this,an,void 0);ne(this,Xn,void 0);J(this,Be,void 0),J(this,Vi,void 0),J(this,pt,void 0),J(this,Xn,new Set),J(this,At,t),this.options=r,J(this,dr,null),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,Be).addObserver(this),Mm(P(this,Be),this.options)&&ye(this,Jn,_s).call(this),ye(this,qs,pf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vf(P(this,Be),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vf(P(this,Be),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ye(this,Gs,mf).call(this),ye(this,Vs,gf).call(this),P(this,Be).removeObserver(this)}setOptions(t,r){const n=this.options,i=P(this,Be);if(this.options=P(this,At).defaultQueryOptions(t),iu(n,this.options)||P(this,At).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,Be),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),ye(this,Ws,yf).call(this);const o=this.hasListeners();o&&Fm(P(this,Be),i,this.options,n)&&ye(this,Jn,_s).call(this),this.updateResult(r),o&&(P(this,Be)!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&ye(this,$s,ff).call(this);const a=ye(this,js,hf).call(this);o&&(P(this,Be)!==i||this.options.enabled!==n.enabled||a!==P(this,an))&&ye(this,Hs,df).call(this,a)}getOptimisticResult(t){const r=P(this,At).getQueryCache().build(P(this,At),t),n=this.createResult(r,t);return H1(this,n)&&(J(this,pt,n),J(this,Wi,this.options),J(this,Qn,P(this,Be).state)),n}getCurrentResult(){return P(this,pt)}trackResult(t){const r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(P(this,Xn).add(n),t[n])})}),r}getCurrentQuery(){return P(this,Be)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=P(this,At).defaultQueryOptions(t),n=P(this,At).getQueryCache().build(P(this,At),r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(t){return ye(this,Jn,_s).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,pt)))}createResult(t,r){var N;const n=P(this,Be),i=this.options,o=P(this,pt),a=P(this,Qn),s=P(this,Wi),l=t!==n?t.state:P(this,Vi),{state:u}=t;let{error:d,errorUpdatedAt:h,fetchStatus:f,status:p}=u,m=!1,_;if(r._optimisticResults){const R=this.hasListeners(),L=!R&&Mm(t,r),$=R&&Fm(t,n,r,i);(L||$)&&(f=Cu(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(p="pending")),r._optimisticResults==="isRestoring"&&(f="idle")}if(r.select&&typeof u.data<"u")if(o&&u.data===(a==null?void 0:a.data)&&r.select===P(this,Us))_=P(this,zi);else try{J(this,Us,r.select),_=r.select(u.data),_=lf(o==null?void 0:o.data,_,r),J(this,zi,_),J(this,dr,null)}catch(R){J(this,dr,R)}else _=u.data;if(typeof r.placeholderData<"u"&&typeof _>"u"&&p==="pending"){let R;if(o!=null&&o.isPlaceholderData&&r.placeholderData===(s==null?void 0:s.placeholderData))R=o.data;else if(R=typeof r.placeholderData=="function"?r.placeholderData((N=P(this,Qi))==null?void 0:N.state.data,P(this,Qi)):r.placeholderData,r.select&&typeof R<"u")try{R=r.select(R),J(this,dr,null)}catch(L){J(this,dr,L)}typeof R<"u"&&(p="success",_=lf(o==null?void 0:o.data,R,r),m=!0)}P(this,dr)&&(d=P(this,dr),_=P(this,zi),h=Date.now(),p="error");const S=f==="fetching",v=p==="pending",b=p==="error",T=v&&S;return{status:p,fetchStatus:f,isPending:v,isSuccess:p==="success",isError:b,isInitialLoading:T,isLoading:T,data:_,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>l.dataUpdateCount||u.errorUpdateCount>l.errorUpdateCount,isFetching:S,isRefetching:S&&!v,isLoadingError:b&&u.dataUpdatedAt===0,isPaused:f==="paused",isPlaceholderData:m,isRefetchError:b&&u.dataUpdatedAt!==0,isStale:rh(t,r),refetch:this.refetch}}updateResult(t){const r=P(this,pt),n=this.createResult(P(this,Be),this.options);if(J(this,Qn,P(this,Be).state),J(this,Wi,this.options),iu(n,r))return;P(this,Qn).data!==void 0&&J(this,Qi,P(this,Be)),J(this,pt,n);const i={},o=()=>{if(!r)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!P(this,Xn).size)return!0;const c=new Set(s??P(this,Xn));return this.options.throwOnError&&c.add("error"),Object.keys(P(this,pt)).some(l=>{const u=l;return P(this,pt)[u]!==r[u]&&c.has(u)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),ye(this,gu,H0).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ye(this,qs,pf).call(this)}},At=new WeakMap,Be=new WeakMap,Vi=new WeakMap,pt=new WeakMap,Qn=new WeakMap,Wi=new WeakMap,dr=new WeakMap,Us=new WeakMap,zi=new WeakMap,Qi=new WeakMap,Yn=new WeakMap,Kn=new WeakMap,an=new WeakMap,Xn=new WeakMap,Jn=new WeakSet,_s=function(t){ye(this,Ws,yf).call(this);let r=P(this,Be).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(jt)),r},$s=new WeakSet,ff=function(){if(ye(this,Gs,mf).call(this),ao||P(this,pt).isStale||!uf(this.options.staleTime))return;const r=M0(P(this,pt).dataUpdatedAt,this.options.staleTime)+1;J(this,Yn,setTimeout(()=>{P(this,pt).isStale||this.updateResult()},r))},js=new WeakSet,hf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,Be)):this.options.refetchInterval)??!1},Hs=new WeakSet,df=function(t){ye(this,Vs,gf).call(this),J(this,an,t),!(ao||this.options.enabled===!1||!uf(P(this,an))||P(this,an)===0)&&J(this,Kn,setInterval(()=>{(this.options.refetchIntervalInBackground||ou.isFocused())&&ye(this,Jn,_s).call(this)},P(this,an)))},qs=new WeakSet,pf=function(){ye(this,$s,ff).call(this),ye(this,Hs,df).call(this,ye(this,js,hf).call(this))},Gs=new WeakSet,mf=function(){P(this,Yn)&&(clearTimeout(P(this,Yn)),J(this,Yn,void 0))},Vs=new WeakSet,gf=function(){P(this,Kn)&&(clearInterval(P(this,Kn)),J(this,Kn,void 0))},Ws=new WeakSet,yf=function(){const t=P(this,At).getQueryCache().build(P(this,At),this.options);if(t===P(this,Be))return;const r=P(this,Be);J(this,Be,t),J(this,Vi,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},gu=new WeakSet,H0=function(t){Ke.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(P(this,pt))}),P(this,At).getQueryCache().notify({query:P(this,Be),type:"observerResultsUpdated"})})},ug);function j1(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Mm(e,t){return j1(e,t)||e.state.dataUpdatedAt>0&&vf(e,t,t.refetchOnMount)}function vf(e,t,r){if(t.enabled!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&rh(e,t)}return!1}function Fm(e,t,r,n){return r.enabled!==!1&&(e!==t||n.enabled===!1)&&(!r.suspense||e.state.status!=="error")&&rh(e,r)}function rh(e,t){return e.isStaleByTime(t.staleTime)}function H1(e,t){return!iu(e.getCurrentResult(),t)}var un,Et,$t,Fr,Yi,Wa,zs,Ef,cg,q1=(cg=class extends mo{constructor(t,r){super();ne(this,Yi);ne(this,zs);ne(this,un,void 0);ne(this,Et,void 0);ne(this,$t,void 0);ne(this,Fr,void 0);J(this,Et,void 0),J(this,un,t),this.setOptions(r),this.bindMethods(),ye(this,Yi,Wa).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=P(this,un).defaultMutationOptions(t),iu(r,this.options)||P(this,un).getMutationCache().notify({type:"observerOptionsUpdated",mutation:P(this,$t),observer:this}),(n=P(this,$t))==null||n.setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=P(this,$t))==null||t.removeObserver(this)}onMutationUpdate(t){ye(this,Yi,Wa).call(this),ye(this,zs,Ef).call(this,t)}getCurrentResult(){return P(this,Et)}reset(){J(this,$t,void 0),ye(this,Yi,Wa).call(this),ye(this,zs,Ef).call(this)}mutate(t,r){var n;return J(this,Fr,r),(n=P(this,$t))==null||n.removeObserver(this),J(this,$t,P(this,un).getMutationCache().build(P(this,un),this.options)),P(this,$t).addObserver(this),P(this,$t).execute(t)}},un=new WeakMap,Et=new WeakMap,$t=new WeakMap,Fr=new WeakMap,Yi=new WeakSet,Wa=function(){var r;const t=((r=P(this,$t))==null?void 0:r.state)??j0();J(this,Et,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},zs=new WeakSet,Ef=function(t){Ke.batch(()=>{var r,n,i,o,a,s,c,l;P(this,Fr)&&this.hasListeners()&&((t==null?void 0:t.type)==="success"?((n=(r=P(this,Fr)).onSuccess)==null||n.call(r,t.data,P(this,Et).variables,P(this,Et).context),(o=(i=P(this,Fr)).onSettled)==null||o.call(i,t.data,null,P(this,Et).variables,P(this,Et).context)):(t==null?void 0:t.type)==="error"&&((s=(a=P(this,Fr)).onError)==null||s.call(a,t.error,P(this,Et).variables,P(this,Et).context),(l=(c=P(this,Fr)).onSettled)==null||l.call(c,void 0,t.error,P(this,Et).variables,P(this,Et).context))),this.listeners.forEach(u=>{u(P(this,Et))})})},cg),q0=pe.createContext(void 0),go=e=>{const t=pe.useContext(q0);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},G1=({client:e,children:t})=>(pe.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),pe.createElement(q0.Provider,{value:e},t)),G0=pe.createContext(!1),V1=()=>pe.useContext(G0);G0.Provider;function W1(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var z1=pe.createContext(W1()),Q1=()=>pe.useContext(z1);function V0(e,t){return typeof e=="function"?e(...t):!!e}var Y1=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},K1=e=>{pe.useEffect(()=>{e.clearReset()},[e])},X1=({result:e,errorResetBoundary:t,throwOnError:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&V0(r,[e.error,n]),J1=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},Z1=(e,t)=>e.isLoading&&e.isFetching&&!t,eR=(e,t,r)=>(e==null?void 0:e.suspense)&&Z1(t,r),tR=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function rR(e,t,r){const n=go(r),i=V1(),o=Q1(),a=n.defaultQueryOptions(e);a._optimisticResults=i?"isRestoring":"optimistic",J1(a),Y1(a,o),K1(o);const[s]=pe.useState(()=>new t(n,a)),c=s.getOptimisticResult(a);if(pe.useSyncExternalStore(pe.useCallback(l=>{const u=i?()=>{}:s.subscribe(Ke.batchCalls(l));return s.updateResult(),u},[s,i]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),pe.useEffect(()=>{s.setOptions(a,{listeners:!1})},[a,s]),eR(a,c,i))throw tR(a,s,o);if(X1({result:c,errorResetBoundary:o,throwOnError:a.throwOnError,query:s.getCurrentQuery()}))throw c.error;return a.notifyOnChangeProps?c:s.trackResult(c)}function W0(e,t){return rR(e,$1,t)}function fn(e,t){const r=go(t),[n]=pe.useState(()=>new q1(r,e));pe.useEffect(()=>{n.setOptions(e)},[n,e]);const i=pe.useSyncExternalStore(pe.useCallback(a=>n.subscribe(Ke.batchCalls(a)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=pe.useCallback((a,s)=>{n.mutate(a,s).catch(nR)},[n]);if(i.error&&V0(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function nR(){}var ve={context:void 0,registry:void 0};function bs(e){ve.context=e}var iR=(e,t)=>e===t,Is=Symbol("solid-proxy"),nh=Symbol("solid-track"),oR=Symbol("solid-dev-component"),su={equals:iR},z0=X0,jr=1,au=2,Q0={owned:null,cleanups:null,context:null,owner:null},dl={},Ue=null,pl=null,Me=null,mt=null,Ur=null,Ru=0,[sR,lI]=bt(!1);function hn(e,t){const r=Me,n=Ue,i=e.length===0,o=i?Q0:{owned:null,cleanups:null,context:null,owner:t===void 0?n:t},a=i?e:()=>e(()=>Xe(()=>Nu(o)));Ue=o,Me=null;try{return vr(a,!0)}finally{Me=r,Ue=n}}function bt(e,t){t=t?Object.assign({},su,t):su;const r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=i=>(typeof i=="function"&&(i=i(r.value)),K0(r,i));return[Y0.bind(r),n]}function _f(e,t,r){const n=Pu(e,t,!0,jr);yo(n)}function dn(e,t,r){const n=Pu(e,t,!1,jr);yo(n)}function ih(e,t,r){z0=_R;const n=Pu(e,t,!1,jr);(!r||!r.render)&&(n.user=!0),Ur?Ur.push(n):yo(n)}function St(e,t,r){r=r?Object.assign({},su,r):su;const n=Pu(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,yo(n),Y0.bind(n)}function aR(e,t,r){let n,i,o;arguments.length===2&&typeof t=="object"||arguments.length===1?(n=!0,i=e,o=t||{}):(n=e,i=t,o=r||{});let a=null,s=dl,c=null,l=!1,u="initialValue"in o,d=typeof n=="function"&&St(n);const h=new Set,[f,p]=(o.storage||bt)(o.initialValue),[m,_]=bt(void 0),[S,v]=bt(void 0,{equals:!1}),[b,T]=bt(u?"ready":"unresolved");if(ve.context){c=`${ve.context.id}${ve.context.count++}`;let $;o.ssrLoadFrom==="initial"?s=o.initialValue:ve.load&&($=ve.load(c))&&(s=$[0])}function w($,G,q,H){return a===$&&(a=null,H!==void 0&&(u=!0),($===s||G===s)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(H,{value:G})),s=dl,N(G,q)),G}function N($,G){vr(()=>{G===void 0&&p(()=>$),T(G!==void 0?"errored":u?"ready":"unresolved"),_(G);for(const q of h.keys())q.decrement();h.clear()},!1)}function R(){const $=yR,G=f(),q=m();if(q!==void 0&&!a)throw q;return Me&&!Me.user&&$&&_f(()=>{S(),a&&($.resolved||h.has($)||($.increment(),h.add($)))}),G}function L($=!0){if($!==!1&&l)return;l=!1;const G=d?d():n;if(G==null||G===!1){w(a,Xe(f));return}const q=s!==dl?s:Xe(()=>i(G,{value:f(),refetching:$}));return typeof q!="object"||!(q&&"then"in q)?(w(a,q,void 0,G),q):(a=q,l=!0,queueMicrotask(()=>l=!1),vr(()=>{T(u?"refreshing":"pending"),v()},!1),q.then(H=>w(q,H,void 0,G),H=>w(q,void 0,Z0(H),G)))}return Object.defineProperties(R,{state:{get:()=>b()},error:{get:()=>m()},loading:{get(){const $=b();return $==="pending"||$==="refreshing"}},latest:{get(){if(!u)return R();const $=m();if($&&!a)throw $;return f()}}}),d?_f(()=>L(!1)):L(!1),[R,{refetch:L,mutate:p}]}function uR(e){return vr(e,!1)}function Xe(e){if(Me===null)return e();const t=Me;Me=null;try{return e()}finally{Me=t}}function cR(e,t,r){const n=Array.isArray(e);let i,o=r&&r.defer;return a=>{let s;if(n){s=Array(e.length);for(let l=0;l<e.length;l++)s[l]=e[l]()}else s=e();if(o){o=!1;return}const c=Xe(()=>t(s,i,a));return i=s,c}}function lR(e){ih(()=>Xe(e))}function Ls(e){return Ue===null||(Ue.cleanups===null?Ue.cleanups=[e]:Ue.cleanups.push(e)),e}function fR(){return Me}function Dm(){return Ue}function hR(e,t){const r=Ue,n=Me;Ue=e,Me=null;try{return vr(t,!0)}catch(i){sh(i)}finally{Ue=r,Me=n}}function dR(e){const t=Me,r=Ue;return Promise.resolve().then(()=>{Me=t,Ue=r;let n;return vr(e,!1),Me=Ue=null,n?n.done:void 0})}function pR(){return[sR,dR]}function mR(e,t){const r=Symbol("context");return{id:r,Provider:bR(r),defaultValue:e}}function gR(e){let t;return(t=eE(Ue,e.id))!==void 0?t:e.defaultValue}function oh(e){const t=St(e),r=St(()=>bf(t()));return r.toArray=()=>{const n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}var yR;function Y0(){if(this.sources&&this.state)if(this.state===jr)yo(this);else{const e=mt;mt=null,vr(()=>cu(this),!1),mt=e}if(Me){const e=this.observers?this.observers.length:0;Me.sources?(Me.sources.push(this),Me.sourceSlots.push(e)):(Me.sources=[this],Me.sourceSlots=[e]),this.observers?(this.observers.push(Me),this.observerSlots.push(Me.sources.length-1)):(this.observers=[Me],this.observerSlots=[Me.sources.length-1])}return this.value}function K0(e,t,r){let n=e.value;return(!e.comparator||!e.comparator(n,t))&&(e.value=t,e.observers&&e.observers.length&&vr(()=>{for(let i=0;i<e.observers.length;i+=1){const o=e.observers[i],a=pl&&pl.running;a&&pl.disposed.has(o),(a?!o.tState:!o.state)&&(o.pure?mt.push(o):Ur.push(o),o.observers&&J0(o)),a||(o.state=jr)}if(mt.length>1e6)throw mt=[],new Error},!1)),t}function yo(e){if(!e.fn)return;Nu(e);const t=Ue,r=Me,n=Ru;Me=Ue=e,vR(e,e.value,n),Me=r,Ue=t}function vR(e,t,r){let n;try{n=e.fn(t)}catch(i){return e.pure&&(e.state=jr,e.owned&&e.owned.forEach(Nu),e.owned=null),e.updatedAt=r+1,sh(i)}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?K0(e,n):e.value=n,e.updatedAt=r)}function Pu(e,t,r,n=jr,i){const o={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Ue,context:null,pure:r};return Ue===null||Ue!==Q0&&(Ue.owned?Ue.owned.push(o):Ue.owned=[o]),o}function uu(e){if(e.state===0)return;if(e.state===au)return cu(e);if(e.suspense&&Xe(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Ru);)e.state&&t.push(e);for(let r=t.length-1;r>=0;r--)if(e=t[r],e.state===jr)yo(e);else if(e.state===au){const n=mt;mt=null,vr(()=>cu(e,t[0]),!1),mt=n}}function vr(e,t){if(mt)return e();let r=!1;t||(mt=[]),Ur?r=!0:Ur=[],Ru++;try{const n=e();return ER(r),n}catch(n){r||(Ur=null),mt=null,sh(n)}}function ER(e){if(mt&&(X0(mt),mt=null),e)return;const t=Ur;Ur=null,t.length&&vr(()=>z0(t),!1)}function X0(e){for(let t=0;t<e.length;t++)uu(e[t])}function _R(e){let t,r=0;for(t=0;t<e.length;t++){const n=e[t];n.user?e[r++]=n:uu(n)}if(ve.context){if(ve.count){ve.effects||(ve.effects=[]),ve.effects.push(...e.slice(0,r));return}else ve.effects&&(e=[...ve.effects,...e],r+=ve.effects.length,delete ve.effects);bs()}for(t=0;t<r;t++)uu(e[t])}function cu(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){const n=e.sources[r];if(n.sources){const i=n.state;i===jr?n!==t&&(!n.updatedAt||n.updatedAt<Ru)&&uu(n):i===au&&cu(n,t)}}}function J0(e){for(let t=0;t<e.observers.length;t+=1){const r=e.observers[t];r.state||(r.state=au,r.pure?mt.push(r):Ur.push(r),r.observers&&J0(r))}}function Nu(e){let t;if(e.sources)for(;e.sources.length;){const r=e.sources.pop(),n=e.sourceSlots.pop(),i=r.observers;if(i&&i.length){const o=i.pop(),a=r.observerSlots.pop();n<i.length&&(o.sourceSlots[a]=n,i[n]=o,r.observerSlots[n]=a)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Nu(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function Z0(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function sh(e,t=Ue){throw Z0(e)}function eE(e,t){return e?e.context&&e.context[t]!==void 0?e.context[t]:eE(e.owner,t):void 0}function bf(e){if(typeof e=="function"&&!e.length)return bf(e());if(Array.isArray(e)){const t=[];for(let r=0;r<e.length;r++){const n=bf(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function bR(e,t){return function(n){let i;return dn(()=>i=Xe(()=>(Ue.context={[e]:n.value},oh(()=>n.children))),void 0),i}}var wf=Symbol("fallback");function lu(e){for(let t=0;t<e.length;t++)e[t]()}function wR(e,t,r={}){let n=[],i=[],o=[],a=0,s=t.length>1?[]:null;return Ls(()=>lu(o)),()=>{let c=e()||[],l,u;return c[nh],Xe(()=>{let h=c.length,f,p,m,_,S,v,b,T,w;if(h===0)a!==0&&(lu(o),o=[],n=[],i=[],a=0,s&&(s=[])),r.fallback&&(n=[wf],i[0]=hn(N=>(o[0]=N,r.fallback())),a=1);else if(a===0){for(i=new Array(h),u=0;u<h;u++)n[u]=c[u],i[u]=hn(d);a=h}else{for(m=new Array(h),_=new Array(h),s&&(S=new Array(h)),v=0,b=Math.min(a,h);v<b&&n[v]===c[v];v++);for(b=a-1,T=h-1;b>=v&&T>=v&&n[b]===c[T];b--,T--)m[T]=i[b],_[T]=o[b],s&&(S[T]=s[b]);for(f=new Map,p=new Array(T+1),u=T;u>=v;u--)w=c[u],l=f.get(w),p[u]=l===void 0?-1:l,f.set(w,u);for(l=v;l<=b;l++)w=n[l],u=f.get(w),u!==void 0&&u!==-1?(m[u]=i[l],_[u]=o[l],s&&(S[u]=s[l]),u=p[u],f.set(w,u)):o[l]();for(u=v;u<h;u++)u in m?(i[u]=m[u],o[u]=_[u],s&&(s[u]=S[u],s[u](u))):i[u]=hn(d);i=i.slice(0,a=h),n=c.slice(0)}return i});function d(h){if(o[u]=h,s){const[f,p]=bt(u);return s[u]=p,t(c[u],f)}return t(c[u])}}}function SR(e,t,r={}){let n=[],i=[],o=[],a=[],s=0,c;return Ls(()=>lu(o)),()=>{const l=e()||[];return l[nh],Xe(()=>{if(l.length===0)return s!==0&&(lu(o),o=[],n=[],i=[],s=0,a=[]),r.fallback&&(n=[wf],i[0]=hn(d=>(o[0]=d,r.fallback())),s=1),i;for(n[0]===wf&&(o[0](),o=[],n=[],i=[],s=0),c=0;c<l.length;c++)c<n.length&&n[c]!==l[c]?a[c](()=>l[c]):c>=n.length&&(i[c]=hn(u));for(;c<n.length;c++)o[c]();return s=a.length=o.length=l.length,n=l.slice(0),i=i.slice(0,s)});function u(d){o[c]=d;const[h,f]=bt(l[c]);return a[c]=f,t(h,c)}}}function tE(e,t){return Xe(()=>e(t||{}))}function Ma(){return!0}var Sf={get(e,t,r){return t===Is?r:e.get(t)},has(e,t){return t===Is?!0:e.has(t)},set:Ma,deleteProperty:Ma,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Ma,deleteProperty:Ma}},ownKeys(e){return e.keys()}};function ml(e){return(e=typeof e=="function"?e():e)?e:{}}function TR(){for(let e=0,t=this.length;e<t;++e){const r=this[e]();if(r!==void 0)return r}}function rE(...e){let t=!1;for(let o=0;o<e.length;o++){const a=e[o];t=t||!!a&&Is in a,e[o]=typeof a=="function"?(t=!0,St(a)):a}if(t)return new Proxy({get(o){for(let a=e.length-1;a>=0;a--){const s=ml(e[a])[o];if(s!==void 0)return s}},has(o){for(let a=e.length-1;a>=0;a--)if(o in ml(e[a]))return!0;return!1},keys(){const o=[];for(let a=0;a<e.length;a++)o.push(...Object.keys(ml(e[a])));return[...new Set(o)]}},Sf);const r={},n={},i=new Set;for(let o=e.length-1;o>=0;o--){const a=e[o];if(!a)continue;const s=Object.getOwnPropertyNames(a);for(let c=0,l=s.length;c<l;c++){const u=s[c];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!i.has(u))d.get?(i.add(u),Object.defineProperty(r,u,{enumerable:!0,configurable:!0,get:TR.bind(n[u]=[d.get.bind(a)])})):(d.value!==void 0&&i.add(u),r[u]=d.value);else{const h=n[u];h?d.get?h.push(d.get.bind(a)):d.value!==void 0&&h.push(()=>d.value):r[u]===void 0&&(r[u]=d.value)}}}return r}function nE(e,...t){if(Is in e){const i=new Set(t.length>1?t.flat():t[0]),o=t.map(a=>new Proxy({get(s){return a.includes(s)?e[s]:void 0},has(s){return a.includes(s)&&s in e},keys(){return a.filter(s=>s in e)}},Sf));return o.push(new Proxy({get(a){return i.has(a)?void 0:e[a]},has(a){return i.has(a)?!1:a in e},keys(){return Object.keys(e).filter(a=>!i.has(a))}},Sf)),o}const r={},n=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const o=Object.getOwnPropertyDescriptor(e,i),a=!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable;let s=!1,c=0;for(const l of t)l.includes(i)&&(s=!0,a?n[c][i]=o.value:Object.defineProperty(n[c],i,o)),++c;s||(a?r[i]=o.value:Object.defineProperty(r,i,o))}return[...n,r]}function xR(e){let t,r;const n=i=>{const o=ve.context;if(o){const[s,c]=bt();ve.count||(ve.count=0),ve.count++,(r||(r=e())).then(l=>{bs(o),ve.count--,c(()=>l.default),bs()}),t=s}else if(!t){const[s]=aR(()=>(r||(r=e())).then(c=>c.default));t=s}let a;return St(()=>(a=t())&&Xe(()=>{if(!o)return a(i);const s=ve.context;bs(o);const c=a(i);return bs(s),c}))};return n.preload=()=>r||((r=e()).then(i=>t=()=>i.default),r),n}var OR=0;function AR(){const e=ve.context;return e?`${e.id}${e.count++}`:`cl-${OR++}`}var iE=e=>`Stale read from <${e}>.`;function CR(e){const t="fallback"in e&&{fallback:()=>e.fallback};return St(wR(()=>e.each,e.children,t||void 0))}function RR(e){const t="fallback"in e&&{fallback:()=>e.fallback};return St(SR(()=>e.each,e.children,t||void 0))}function PR(e){const t=e.keyed,r=St(()=>e.when,void 0,{equals:(n,i)=>t?n===i:!n==!i});return St(()=>{const n=r();if(n){const i=e.children;return typeof i=="function"&&i.length>0?Xe(()=>i(t?n:()=>{if(!Xe(r))throw iE("Show");return e.when})):i}return e.fallback},void 0,void 0)}function NR(e){let t=!1;const r=(o,a)=>o[0]===a[0]&&(t?o[1]===a[1]:!o[1]==!a[1])&&o[2]===a[2],n=oh(()=>e.children),i=St(()=>{let o=n();Array.isArray(o)||(o=[o]);for(let a=0;a<o.length;a++){const s=o[a].when;if(s)return t=!!o[a].keyed,[a,s,o[a]]}return[-1]},void 0,{equals:r});return St(()=>{const[o,a,s]=i();if(o<0)return e.fallback;const c=s.children;return typeof c=="function"&&c.length>0?Xe(()=>c(t?a:()=>{if(Xe(i)[0]!==o)throw iE("Match");return s.when})):c},void 0,void 0)}function IR(e){return e}var LR=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],kR=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...LR]),MR=new Set(["innerHTML","textContent","innerText","children"]),FR=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),DR=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function BR(e,t){const r=DR[e];return typeof r=="object"?r[t]?r.$:void 0:r}var UR=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),$R=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),jR={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function HR(e,t,r){let n=r.length,i=t.length,o=n,a=0,s=0,c=t[i-1].nextSibling,l=null;for(;a<i||s<o;){if(t[a]===r[s]){a++,s++;continue}for(;t[i-1]===r[o-1];)i--,o--;if(i===a){const u=o<n?s?r[s-1].nextSibling:r[o-s]:c;for(;s<o;)e.insertBefore(r[s++],u)}else if(o===s)for(;a<i;)(!l||!l.has(t[a]))&&t[a].remove(),a++;else if(t[a]===r[o-1]&&r[s]===t[i-1]){const u=t[--i].nextSibling;e.insertBefore(r[s++],t[a++].nextSibling),e.insertBefore(r[--o],u),t[i]=r[o]}else{if(!l){l=new Map;let d=s;for(;d<o;)l.set(r[d],d++)}const u=l.get(t[a]);if(u!=null)if(s<u&&u<o){let d=a,h=1,f;for(;++d<i&&d<o&&!((f=l.get(t[d]))==null||f!==u+h);)h++;if(h>u-s){const p=t[a];for(;s<u;)e.insertBefore(r[s++],p)}else e.replaceChild(r[s++],t[a++])}else a++;else t[a++].remove()}}}var Bm="_$DX_DELEGATE";function qR(e,t,r,n={}){let i;return hn(o=>{i=o,t===document?e():hu(t,e(),t.firstChild?null:void 0,r)},n.owner),()=>{i(),t.textContent=""}}function GR(e,t,r){let n;const i=()=>{const a=document.createElement("template");return a.innerHTML=e,r?a.content.firstChild.firstChild:a.content.firstChild},o=t?()=>Xe(()=>document.importNode(n||(n=i()),!0)):()=>(n||(n=i())).cloneNode(!0);return o.cloneNode=o,o}function oE(e,t=window.document){const r=t[Bm]||(t[Bm]=new Set);for(let n=0,i=e.length;n<i;n++){const o=e[n];r.has(o)||(r.add(o),t.addEventListener(o,JR))}}function fu(e,t,r){r==null?e.removeAttribute(t):e.setAttribute(t,r)}function VR(e,t,r,n){n==null?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n)}function sE(e,t){t==null?e.removeAttribute("class"):e.className=t}function aE(e,t,r,n){if(n)Array.isArray(r)?(e[`$$${t}`]=r[0],e[`$$${t}Data`]=r[1]):e[`$$${t}`]=r;else if(Array.isArray(r)){const i=r[0];e.addEventListener(t,r[0]=o=>i.call(e,r[1],o))}else e.addEventListener(t,r)}function WR(e,t,r={}){const n=Object.keys(t||{}),i=Object.keys(r);let o,a;for(o=0,a=i.length;o<a;o++){const s=i[o];!s||s==="undefined"||t[s]||(Um(e,s,!1),delete r[s])}for(o=0,a=n.length;o<a;o++){const s=n[o],c=!!t[s];!s||s==="undefined"||r[s]===c||!c||(Um(e,s,!0),r[s]=c)}return r}function zR(e,t,r){if(!t)return r?fu(e,"style"):t;const n=e.style;if(typeof t=="string")return n.cssText=t;typeof r=="string"&&(n.cssText=r=void 0),r||(r={}),t||(t={});let i,o;for(o in r)t[o]==null&&n.removeProperty(o),delete r[o];for(o in t)i=t[o],i!==r[o]&&(n.setProperty(o,i),r[o]=i);return r}function uE(e,t={},r,n){const i={};return n||dn(()=>i.children=uo(e,t.children,i.children)),dn(()=>t.ref&&t.ref(e)),dn(()=>YR(e,t,r,!0,i,!0)),i}function QR(e,t,r){return Xe(()=>e(t,r))}function hu(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return uo(e,t,n,r);dn(i=>uo(e,t(),i,r),n)}function YR(e,t,r,n,i={},o=!1){t||(t={});for(const a in i)if(!(a in t)){if(a==="children")continue;i[a]=$m(e,a,null,i[a],r,o)}for(const a in t){if(a==="children"){n||uo(e,t.children);continue}const s=t[a];i[a]=$m(e,a,s,i[a],r,o)}}function KR(e){let t,r;if(!ve.context||!(t=ve.registry.get(r=ZR()))){if(ve.context,!e)throw new Error("Unrecoverable Hydration Mismatch. No template for key: "+r);return e()}return ve.completed&&ve.completed.add(t),ve.registry.delete(r),t}function XR(e){return e.toLowerCase().replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}function Um(e,t,r){const n=t.trim().split(/\s+/);for(let i=0,o=n.length;i<o;i++)e.classList.toggle(n[i],r)}function $m(e,t,r,n,i,o){let a,s,c,l,u;if(t==="style")return zR(e,r,n);if(t==="classList")return WR(e,r,n);if(r===n)return n;if(t==="ref")o||r(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);n&&e.removeEventListener(d,n),r&&e.addEventListener(d,r)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);n&&e.removeEventListener(d,n,!0),r&&e.addEventListener(d,r,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),h=UR.has(d);if(!h&&n){const f=Array.isArray(n)?n[0]:n;e.removeEventListener(d,f)}(h||r)&&(aE(e,d,r,h),h&&oE([d]))}else if(t.slice(0,5)==="attr:")fu(e,t.slice(5),r);else if((u=t.slice(0,5)==="prop:")||(c=MR.has(t))||!i&&((l=BR(t,e.tagName))||(s=kR.has(t)))||(a=e.nodeName.includes("-")))u&&(t=t.slice(5),s=!0),t==="class"||t==="className"?sE(e,r):a&&!s&&!c?e[XR(t)]=r:e[l||t]=r;else{const d=i&&t.indexOf(":")>-1&&jR[t.split(":")[0]];d?VR(e,d,t,r):fu(e,FR[t]||t,r)}return r}function JR(e){const t=`$$${e.type}`;let r=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==r&&Object.defineProperty(e,"target",{configurable:!0,value:r}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return r||document}}),ve.registry&&!ve.done&&(ve.done=_$HY.done=!0);r;){const n=r[t];if(n&&!r.disabled){const i=r[`${t}Data`];if(i!==void 0?n.call(r,i,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}function uo(e,t,r,n,i){if(ve.context){!r&&(r=[...e.childNodes]);let s=[];for(let c=0;c<r.length;c++){const l=r[c];l.nodeType===8&&l.data.slice(0,2)==="!$"?l.remove():s.push(l)}r=s}for(;typeof r=="function";)r=r();if(t===r)return r;const o=typeof t,a=n!==void 0;if(e=a&&r[0]&&r[0].parentNode||e,o==="string"||o==="number"){if(ve.context)return r;if(o==="number"&&(t=t.toString()),a){let s=r[0];s&&s.nodeType===3?s.data=t:s=document.createTextNode(t),r=Ci(e,r,n,s)}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t}else if(t==null||o==="boolean"){if(ve.context)return r;r=Ci(e,r,n)}else{if(o==="function")return dn(()=>{let s=t();for(;typeof s=="function";)s=s();r=uo(e,s,r,n)}),()=>r;if(Array.isArray(t)){const s=[],c=r&&Array.isArray(r);if(Tf(s,t,r,i))return dn(()=>r=uo(e,s,r,n,!0)),()=>r;if(ve.context){if(!s.length)return r;for(let l=0;l<s.length;l++)if(s[l].parentNode)return r=s}if(s.length===0){if(r=Ci(e,r,n),a)return r}else c?r.length===0?jm(e,s,n):HR(e,r,s):(r&&Ci(e),jm(e,s));r=s}else if(t.nodeType){if(ve.context&&t.parentNode)return r=a?[t]:t;if(Array.isArray(r)){if(a)return r=Ci(e,r,n,t);Ci(e,r,null,t)}else r==null||r===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);r=t}}return r}function Tf(e,t,r,n){let i=!1;for(let o=0,a=t.length;o<a;o++){let s=t[o],c=r&&r[o],l;if(!(s==null||s===!0||s===!1))if((l=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))i=Tf(e,s,c)||i;else if(l==="function")if(n){for(;typeof s=="function";)s=s();i=Tf(e,Array.isArray(s)?s:[s],Array.isArray(c)?c:[c])||i}else e.push(s),i=!0;else{const u=String(s);c&&c.nodeType===3&&c.data===u?e.push(c):e.push(document.createTextNode(u))}}return i}function jm(e,t,r=null){for(let n=0,i=t.length;n<i;n++)e.insertBefore(t[n],r)}function Ci(e,t,r,n){if(r===void 0)return e.textContent="";const i=n||document.createTextNode("");if(t.length){let o=!1;for(let a=t.length-1;a>=0;a--){const s=t[a];if(i!==s){const c=s.parentNode===e;!o&&!a?c?e.replaceChild(i,s):e.insertBefore(i,r):c&&s.remove()}else o=!0}}else e.insertBefore(i,r);return[i]}function ZR(){const e=ve.context;return`${e.id}${e.count++}`}var eP="http://www.w3.org/2000/svg";function cE(e,t=!1){return t?document.createElementNS(eP,e):document.createElement(e)}function tP(e){const{useShadow:t}=e,r=document.createTextNode(""),n=()=>e.mount||document.body,i=Dm();let o,a=!!ve.context;return ih(()=>{a&&(Dm().user=a=!1),o||(o=hR(i,()=>St(()=>e.children)));const s=n();if(s instanceof HTMLHeadElement){const[c,l]=bt(!1),u=()=>l(!0);hn(d=>hu(s,()=>c()?d():o(),null)),Ls(u)}else{const c=cE(e.isSVG?"g":"div",e.isSVG),l=t&&c.attachShadow?c.attachShadow({mode:"open"}):c;Object.defineProperty(c,"_$host",{get(){return r.parentNode},configurable:!0}),hu(l,o),s.appendChild(c),e.ref&&e.ref(c),Ls(()=>s.removeChild(c))}},void 0,{render:!a}),r}function rP(e){const[t,r]=nE(e,["component"]),n=St(()=>t.component);return St(()=>{const i=n();switch(typeof i){case"function":return Object.assign(i,{[oR]:!0}),Xe(()=>i(r));case"string":const o=$R.has(i),a=ve.context?KR():cE(i,o);return uE(a,r,o),a}})}var Ki,Qs,Ys,Ks,Zn,Xi,Ji,Zi,eo,to,Xs,lg,nP=(lg=class{constructor(e){ne(this,Ki,void 0);ne(this,Qs,void 0);ne(this,Ys,void 0);ne(this,Ks,void 0);ne(this,Zn,!1);ne(this,Xi,void 0);ne(this,Ji,void 0);ne(this,Zi,void 0);ne(this,eo,void 0);ne(this,to,void 0);ne(this,Xs,void 0);const{client:t,queryFlavor:r,version:n,onlineManager:i,buttonPosition:o,position:a,initialIsOpen:s,errorTypes:c}=e;J(this,Ki,bt(t)),J(this,Ys,r),J(this,Ks,n),J(this,Qs,i),J(this,Xi,bt(o)),J(this,Ji,bt(a)),J(this,Zi,bt(s)),J(this,eo,bt(c))}setButtonPosition(e){P(this,Xi)[1](e)}setPosition(e){P(this,Ji)[1](e)}setInitialIsOpen(e){P(this,Zi)[1](e)}setErrorTypes(e){P(this,eo)[1](e)}setClient(e){P(this,Ki)[1](e)}mount(e){if(P(this,Zn))throw new Error("Devtools is already mounted");const t=qR(()=>{const[r]=P(this,Xi),[n]=P(this,Ji),[i]=P(this,Zi),[o]=P(this,eo),[a]=P(this,Ki);let s;P(this,to)?s=P(this,to):(s=xR(()=>Promise.resolve().then(()=>require("./4TNE5QTO-eed10299.js"))),J(this,to,s));const c=this;return tE(s,rE({get queryFlavor(){return P(c,Ys)},get version(){return P(c,Ks)},get onlineManager(){return P(c,Qs)}},{get client(){return a()},get buttonPosition(){return r()},get position(){return n()},get initialIsOpen(){return i()},get errorTypes(){return o()}}))},e);J(this,Zn,!0),J(this,Xs,t)}unmount(){var e;if(!P(this,Zn))throw new Error("Devtools is not mounted");(e=P(this,Xs))==null||e.call(this),J(this,Zn,!1)}},Ki=new WeakMap,Qs=new WeakMap,Ys=new WeakMap,Ks=new WeakMap,Zn=new WeakMap,Xi=new WeakMap,Ji=new WeakMap,Zi=new WeakMap,eo=new WeakMap,to=new WeakMap,Xs=new WeakMap,lg);function iP(e){const t=go(),r=e.client||t,n=U.useRef(null),{buttonPosition:i,position:o,initialIsOpen:a,errorTypes:s}=e,[c]=U.useState(new nP({client:r,queryFlavor:"React Query",version:"5",onlineManager:Ns,buttonPosition:i,position:o,initialIsOpen:a,errorTypes:s}));return U.useEffect(()=>{c.setClient(r)},[r,c]),U.useEffect(()=>{i&&c.setButtonPosition(i)},[i,c]),U.useEffect(()=>{o&&c.setPosition(o)},[o,c]),U.useEffect(()=>{c.setInitialIsOpen(a||!1)},[a,c]),U.useEffect(()=>{c.setErrorTypes(s||[])},[s,c]),U.useEffect(()=>(n.current&&c.mount(n.current),()=>{c.unmount()}),[c]),U.createElement("div",{className:"tsqd-parent-container",ref:n})}var oP=process.env.NODE_ENV!=="development"?function(){return null}:iP;const sP=({showDevTools:e,children:t})=>{const r=new U1({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return x.jsxs(G1,{client:r,children:[t,e&&x.jsx(oP,{initialIsOpen:!1})]})};const gl="joinCommunityButton",ah=({isMember:e=!1,isShort:t=!1,functions:{join:r,leave:n}={join:()=>{},leave:()=>{}}})=>{const i=Oe(),o=U.useContext($r),a=o&&typeof o.id=="string",[s,c]=U.useState(e),[l,u]=U.useState(e?"joined":"notJoined");U.useEffect(()=>{l==="joining"?u("joined"):l==="leaving"&&u("notJoined")},[s]);const d={},h={};return s&&l!=="leaving"&&(d["data-hover-text"]=i.formatMessage({id:`${gl}_leave`}),d["aria-label"]=i.formatMessage({id:`${gl}_member_aria`}),h["aria-hidden"]="true"),x.jsx(ze,{variant:s?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:s&&l!=="leaving"?{icon:"tick",position:"left"}:!1,onClick:async f=>{a&&(f.currentTarget.blur(),s?(u("leaving"),typeof n=="function"&&await n()):(u("joining"),typeof r=="function"&&await r()),c(!s))},className:se("join-community-button",l,{active:l==="joining"}),disabled:!a,...d,children:x.jsx("span",{className:"text",...h,children:i.formatMessage({id:`${gl}${["joining","leaving"].includes(l)?`_${l}`:s?"_member":t?"_short":""}`})})})};const yl="communityDetails_",aP=({isMember:e=!1,slug:t,members:{number:r,data:n}={number:void 0,data:[]},className:i="",...o})=>{const a=Oe(),s=r||(n==null?void 0:n.length)||0;return x.jsxs("div",{className:se("community-details",i),children:[x.jsx(tu,{}),x.jsxs("div",{className:"member-details",children:[x.jsxs("div",{className:"top",children:[x.jsxs("h3",{children:[a.formatMessage({id:`${yl}members`}),x.jsx("span",{className:"count",children:s})]}),x.jsx("p",{className:"text-small",children:x.jsx("a",{href:`/communities/${t}/members`,children:a.formatMessage({id:`${yl}viewAll`})})})]}),x.jsx(k0,{contributors:{total:r,data:n!=null&&n.length?n:[{},{},{},{},{}]},styling:{size:"medium",showGap:!0,showPlaceholders:s===0},cutoff:5})]}),x.jsx(ah,{isMember:e,...o}),e&&x.jsx(ze,{variant:"primary",icon:{icon:"plus"},styling:{fullWidth:!0},children:a.formatMessage({id:`${yl}invite`})})]})};const uP=({breadcrumbs:e,cutoff:t=20,className:r=""})=>{const n=Oe();return x.jsxs(x.Fragment,{children:[x.jsx(lt,{element:"p",children:n.formatMessage({id:"breadcrumbs_label"})}),x.jsx("ul",{className:se("breadcrumbs text-small",r),children:e.map(({text:i,href:o,current:a=!1},s)=>x.jsxs("li",{children:[a&&x.jsx(lt,{element:"span",children:n.formatMessage({id:"breadcrumbs_currentPage"})}),x.jsx(ia,{href:a?void 0:o,children:Kf(i,t)})]},`${window.btoa(i)}_${s}`))})]})};const cP=({options:e,allOption:t=!1,allowMultiple:r=!0,onChange:n=()=>{},className:i=""})=>{const o=Oe(),a=t?[{id:"all",text:typeof t!="boolean"&&t.text||o.formatMessage({id:"filters_all"})},...e]:e,[s,c]=U.useState(t?["all"]:[]),l=(u,d)=>{let h=[];s.includes(u)?h=s.filter(f=>f!==u):u==="all"?h=["all"]:r?h=[...s.filter(f=>f!=="all"),u]:h=[u],c(f=>(n&&typeof n=="function"&&n({current:h,previous:f}),h)),d&&typeof d=="function"&&d()};return x.jsx("ul",{className:se("filters",i),children:a.map(({id:u,text:d,disabled:h=!1,callback:f=()=>{}})=>{let p={};return h&&(p={disabled:!0,"aria-label":o.formatMessage({id:"filters_disabled"},{name:d})}),x.jsx("li",{children:x.jsx("button",{className:se(u,{selected:s.includes(u)}),onClick:m=>{m.preventDefault(),m.stopPropagation(),l(u,f)},...p,children:d})},u)})})},lP=(e,t)=>{const r=String(e);if(!t||!t.length)return`/${r}`;let n="";return t.forEach(({url:i,position:o})=>{o==="before-lang"?n+=`/${i}`:(n.includes(`/${r}/`)||(n+=`/${r}`),n+=`/${i}`)}),n.includes(`/${r}/`)||(n+=`/${r}`),n};const vl={en:"English",es:"Español",fr:"Français",pt:"Português"},Fa="languageSwitcher_",fP=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:r=!1,translations:n,onChange:i=()=>{},urlParts:o,variant:a="default",label:s,className:c=""})=>{const l=Oe(),[u,d]=U.useState(e);if(U.useEffect(()=>{e!==u&&d(e)},[e]),!n||!Object.values(n).some(m=>m&&m.post_name))return null;const f=Object.keys(n),p=u!==e;return x.jsxs("div",{className:se("language-switcher text-small",a,c),children:[x.jsxs("nav",{children:[a!=="short"&&x.jsx("p",{children:s||l.formatMessage({id:`${Fa}label`})}),x.jsx("ul",{children:f.map(m=>{if(!vl[m])return null;let _={className:m};return u===m?_["aria-label"]=l.formatMessage({id:`${Fa}selected`},{language:vl[m]}):_={..._,href:lP(m,o),onClick:S=>{S.preventDefault(),S.stopPropagation(),d(m),i(m)}},x.jsx("li",{children:x.jsx(ia,{..._,fallbackElement:"span",children:vl[m]})},m)})}),a!=="short"&&!p&&x.jsx("p",{children:l.formatMessage({id:`${Fa}translation_${t?"original":r?"human":"machine"}`})})]}),a!=="short"&&!p&&!t&&!r&&x.jsx("small",{children:l.formatMessage({id:`${Fa}disclaimer`},{email:Ni.support,link:m=>{const _=`mailto:${m}`;return x.jsx("a",{href:_,children:m})}})})]})};const El=tf({locale:"en",messages:Gf}),lE=({page:e=1,length:t=0,limit:r=10,loadNextPage:n=()=>{},icon:i=!1,messages:o={button:El.formatMessage({id:"loadMore_button"}),endOfFeed:El.formatMessage({id:"loadMore_endOfFeed"}),error:El.formatMessage({id:"loadMore_error"})},className:a="",gtmContext:s="LoadMore"})=>{const[c,l]=U.useState(!1),[u,d]=U.useState(!1);if(t<=0||t<r*e)return null;const h=async f=>{try{await n(f)}catch(p){p instanceof Error&&p.message&&p.message.includes("Cannot read items")?d(!0):l(!0)}};return x.jsxs("footer",{className:se("load-more",a),children:[c&&x.jsx("p",{className:"error",children:o.error}),u?x.jsx("p",{children:o.endOfFeed}):x.jsx(ze,{variant:"secondary",icon:i,onClick:h,"data-gtm-event-context":s,"data-gtm-event-type":"load-more-click",className:"gtm-trackable","data-testid":"load-more-button",children:o.button})]})};let Da=!1;const fE=({element:e="div",id:t="more-menu",options:r,className:n=""})=>{const i=Oe(),o=U.useRef(null),[a,s]=U.useState(!1),c=l=>{o.current&&l.target instanceof HTMLElement&&!o.current.contains(l.target)&&s(!1)};return U.useEffect(()=>(document.addEventListener("click",c,!0),()=>{document.removeEventListener("click",c,!0)})),U.createElement(e,{ref:o,className:se("more-menu text-medium",n),children:x.jsxs(x.Fragment,{children:[x.jsx(ze,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>s(!a),"aria-haspopup":"true","aria-expanded":a,"aria-controls":t,screenreaderText:i.formatMessage({id:"moreMenu"})}),x.jsx("ul",{id:t,hidden:!a,children:r.map(({href:l,onClick:u,text:d,icon:h,...f},p)=>{const m={...f,onClick:_=>{s(!1),typeof u=="function"&&u(_)},onFocus:()=>{Da&&(clearTimeout(Da),Da=!1)},onBlur:()=>{Da=setTimeout(()=>{s(!1)},100)}};return l&&(m.href=l),x.jsx("li",{children:x.jsx(ze,{variant:"tertiary",size:"medium",icon:h?{icon:h,position:"left"}:!1,...m,children:d})},`${window.btoa(d)}_${p}`)})})]})})};const uh=({variant:e="default",version:t="default",className:r="",...n})=>x.jsx("p",{className:"logo-wrapper",children:x.jsx("a",{href:"/home/",className:se("logo",e,t,r),...n,children:x.jsx(lt,{children:x.jsx(ln,{id:"apolitical"})})})});const hP={"2-1":901},dP=({layout:e="2-1",hideOnMobile:t=!1,className:r="",children:n})=>{const i=ra(!0);let o=n;return U.Children.count(n)===1&&(o=U.Children.toArray(n)[0],o.props&&(o=o.props.children)),x.jsx("section",{className:se("columns",`layout-${e}`,r),children:U.Children.map(o,(a,s)=>t!==!1&&s===t&&i&&i<hP[e]?null:a)})};const _l="cookieBanner_",bl=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],wl=new Date(Date.now()+12*30*24*60*60*1e3),hE=()=>{const e=Oe(),[t,r,n]=vg(bl),[i,o]=U.useState(!t["apol-cookie-banner"]),a=()=>{bl.forEach(u=>{r(u,!0,{path:"/",expires:wl,domain:u==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),o(!1),window.location.reload()},s=()=>{r("apol-cookie-banner",!0,{path:"/",expires:wl}),bl.forEach(u=>{if(u==="apol-cookie-banner"){r(u,!0,{path:"/",expires:wl});return}n(u)}),o(!1)};if(!i)return null;const c=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:s,gtmType:"reject-all"},{id:"accept",onClick:a,gtmType:"accepted-all"}],l=[];return c.forEach(u=>{l.push({variant:u.href?"tertiary":"primary",href:u.href,onClick:u.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${u.gtmType}-click`,children:e.formatMessage({id:`${_l}buttons_${u.id}`})})}),x.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[x.jsx("h6",{children:e.formatMessage({id:`${_l}title`})}),x.jsx("p",{children:e.formatMessage({id:`${_l}text`})}),x.jsx(na,{buttons:l})]})},Dr={platform:{order:["events","courses","qanda","articles"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},qanda:{href:"/questions-answers/",gtmType:"q-and-a-click"},articles:{href:"/solution-articles/",gtmType:"articles-click"}},community:{order:["support","post","join","guidelines"],support:{name:"Support FAQ",href:"/pages/support-faq",gtmType:"support-faq-click"},post:{href:"/pages/post-an-article",gtmType:"post-an-article-click"},join:{href:"/pages/who-can-join-the-community",gtmType:"who-can-join-click"},guidelines:{href:"/pages/values-and-guidelines",gtmType:"guidelines-and-values-click"}},company:{order:["story","team","careers","partner","contact"],story:{href:"/pages/our-story",gtmType:"our-story-click"},team:{href:"/pages/meet-our-team",gtmType:"team-click"},careers:{href:"/pages/careers",gtmType:"careers-click"},partner:{href:"/partnerships/",gtmType:"partner-with-us-click"},contact:{href:"/pages/get-in-touch",gtmType:"contact-click"},child:"legal"},legal:{order:["privacy","terms","cookie","accessibility"],privacy:{href:"https://about.apolitical.co/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"https://about.apolitical.co/terms-and-conditions",gtmType:"terms-conditions-link"},cookie:{href:"/pages/cookie-policy",gtmType:"cookie-policy-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:Ni["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Ni["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["correspondence","registered","berlin","support","business"],correspondence:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:Ni.support,gtmType:"concierge-email-click"},business:{email:Ni.general,gtmType:"hello-email-click"}}},social:{order:["linkedin","twitter","facebook"],linkedin:{href:"https://www.linkedin.com/company/apolitical"},twitter:{href:"https://twitter.com/apoliticalco"},facebook:{href:"https://www.facebook.com/apoliticalco"}}};const Ii="footer_",du="SiteFooter",Hm=({group:e})=>{const t=Dr[e].order||[];let r=!1;return"text"in Dr[e]&&(r=Dr[e].text),x.jsxs(U.Fragment,{children:[x.jsx("p",{className:"pre-title",children:x.jsx(ln,{id:`${Ii}${e}`})}),Array.isArray(t)&&t.length>0&&x.jsx("ul",{className:"text-medium",children:t.map(n=>{if(["order","child","text"].includes(n))return null;const{href:i,gtmType:o}=Dr[e][n],a={};return["legal"].includes(e)&&(a.target="_blank",a.rel="noopener"),x.jsx("li",{children:x.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":du,"data-gtm-event-type":o,...a,children:x.jsx(ln,{id:`${Ii}${e}_${n}`})})},`${e}_${n}`)})}),typeof r!="boolean"&&"order"in r&&Array.isArray(r.order)&&x.jsx("dl",{className:"text-medium",children:r.order.map(n=>x.jsxs(U.Fragment,{children:[x.jsx("dt",{children:x.jsx(ln,{id:`${Ii}${e}_${n}`})}),x.jsxs("dd",{children:[typeof r!="boolean"&&r[n].address&&x.jsx("address",{children:x.jsx(ln,{id:`${Ii}${e}_${n}_address`,values:{br:x.jsx("br",{})}})}),typeof r!="boolean"&&r[n].email&&x.jsx("a",{href:`mailto:${r[n].email}`,className:"gtm-trackable","data-gtm-event-context":du,"data-gtm-event-type":r[n].gtmType,children:r[n].email})]})]},`dl-${e}-${n}`))})]},e)},ch=()=>x.jsx("div",{id:"footer",children:x.jsxs("div",{className:"wrapper",children:[x.jsx(Of,{element:"hr"}),x.jsx(uh,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":du,"data-gtm-event-type":"logo-homepage-link"}),x.jsx("footer",{children:["platform","community","company","contact"].map(e=>x.jsxs("div",{className:"group",children:[x.jsx(Hm,{group:e}),Object.keys(Dr[e]).includes("child")&&x.jsx(Hm,{group:Dr[e].child})]},e))}),x.jsx("hr",{}),x.jsxs("div",{className:"sub-footer",children:[x.jsx("ul",{children:Array.isArray(Dr.social.order)&&Dr.social.order.map(e=>{const t=Dr.social[e];return x.jsx("li",{className:e,children:x.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":du,"data-gtm-event-type":"social-click",children:x.jsx("span",{className:"hidden",children:x.jsx(ln,{id:`${Ii}social_${e}`})})})},e)})}),x.jsx("small",{children:x.jsx(ln,{id:`${Ii}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})});const Ba="emailHelperTextBox_",pP=({type:e,email:t,redirectPath:r,resendVerificationCode:n})=>{const i=Oe(),[o,a]=U.useState({path:`${Ba}default`,type:"default",link:{},mail:{},error:""}),[s,c]=U.useState(!1),l=U.useCallback(f=>{f.preventDefault(),f.stopPropagation();const p=m=>{a({path:`${Ba}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:_=>l(_),href:"#","data-testid":"send-verify-email-click"},mail:{href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"ErrorVerifyingBox","data-gtm-event-type":"email-concierge-click"},error:m})};if(typeof n!="function"){p(i.formatMessage({id:`${Ba}error_noFunction`}));return}c(!0),n(t).then(()=>{localStorage.setItem("email",t),window.location.href=r||"/signup/verify-email"}).catch(m=>{p(m.message)}).finally(()=>{c(!1)})},[t,r,n]);U.useEffect(()=>{let f=Ba,p="default",m={},_={};switch(e){case"gov":f+="autoApproved",p="success";break;case"nonGov":f+="unrecognisedEmail",p="error",m={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":f+="pendingApproval",p="error",_={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":f+="emailUnverified",p="error",m={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:S=>l(S),"data-testid":"send-verify-email-click"};break;case"exists":f+="emailAlreadyExists",p="error",m={href:"/user-onboarding/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},_={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:f+="default",m={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}a({...o,path:f,type:p,link:m,mail:_})},[e]);const u={};return["link","mail"].forEach(f=>{u[f]=Object.keys(o[f]).length?p=>x.jsx("a",{...o[f],children:p}):p=>p}),x.jsx(A0,{type:o.type,heading:s?!1:i.formatMessage({id:`${o.path}_title`}),children:s?x.jsxs(x.Fragment,{children:[x.jsx(yr,{element:"span"}),x.jsx(yr,{element:"span"})]}):i.formatMessage({id:`${o.path}_text`},{...u,strong:f=>x.jsx("strong",{children:f}),em:f=>x.jsx("em",{children:f}),br:x.jsxs(x.Fragment,{children:[x.jsx("br",{}),x.jsx("br",{})]}),error:o.error})})};const Ua="passwordRules_",dE="isMoreThanEightCharacters",pE="includesNumberAndSymbol",mE="includesLowerAndUppercase",mP={[dE]:"8Characters",[pE]:"numberSymbol",[mE]:"lowercaseUppercase"},gP=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const r=Oe();return x.jsxs("aside",{className:se("password-rules",t),children:[x.jsx("small",{children:r.formatMessage({id:`${Ua}intro`})}),x.jsx("ul",{children:[dE,pE,mE].map(n=>x.jsxs("li",{className:se({matches:e[n]}),children:[x.jsxs(lt,{children:[r.formatMessage({id:`${Ua}rule_label`})," "]}),x.jsx("span",{children:r.formatMessage({id:`${Ua}rule_${mP[n]}`})}),!e[n]&&x.jsxs(lt,{element:"strong",children:[" "," ",r.formatMessage({id:`${Ua}notMet`})]})]},`rule-${n}`))})]})},yP=U.memo(gP);const vP=({text:e={},topRating:t=5,functions:{createRating:r=()=>null,updateRating:n=()=>{},reportError:i=()=>{}},className:o="",hasLoaded:a=!1})=>{const s=Oe(),[c,l]=U.useState({setUp:!1,id:null,rating:null,disabled:!0}),u=async()=>{try{const S=await r();l(v=>({...v,setUp:!0,id:S&&S.id,disabled:!1}))}catch(S){l(v=>({...v,setUp:!0,disabled:!0})),i(S)}};if(U.useEffect(()=>{a&&!c.setUp&&u()},[a]),!a)return x.jsx(yr,{className:"rating-placeholder"});const{id:d,rating:h,disabled:f}=c,p="ratings_",m={text:s.formatMessage({id:`${p}text`}),low:s.formatMessage({id:`${p}low`}),high:s.formatMessage({id:`${p}high`}),success:s.formatMessage({id:`${p}success`}),...e},_=async S=>{if(!(!d||f))try{l(v=>({...v,rating:S,disabled:!0})),await n({id:d,value:S})}catch(v){l(b=>({...b,rating:null})),i(v)}finally{l(v=>({...v,disabled:!1}))}};return x.jsxs("div",{className:se("rating",o),children:[x.jsx("span",{className:"label",children:m[h?"success":"text"]}),x.jsx("ol",{children:Array.from(new Array(t).keys()).map(S=>{const v=S+1;return x.jsx("li",{className:se({selected:h&&v<=h}),children:x.jsx(ze,{variant:"tertiary",size:"small",icon:{icon:`star${!h||v>h?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${s.formatMessage({id:`${p}stars`},{number:v,total:t})}${v===1||v===t?` - ${m[v===1?"low":"high"]}`:""}`,onClick:b=>{b.preventDefault(),b.stopPropagation(),_(v)},disabled:f})},`rating-${v}`)})})]})};const gE=({id:e="search",className:t="",handleToggle:r=!1,defaultValue:n="",gtmContext:i="search-bar",gtmEvent:o="form-submission"})=>{const{searchIsOpen:a=!0,isDesktopVersion:s=!1}=r||{},c=Oe(),l=U.useRef(null);ri(()=>{!r||s||!a||l.current&&l.current.focus()},[a]);const u=d=>{d.preventDefault(),d.stopPropagation(),!(!l.current||!l.current.value||l.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(l.current.value)}`)};return x.jsx("form",{onSubmit:u,className:se("search-form gtm-trackable",t),"data-gtm-event-context":i,"data-gtm-event-type":o,children:x.jsx("fieldset",{id:`${e}-form`,hidden:r?!a:!1,role:"search",children:x.jsxs("p",{children:[x.jsx(lt,{element:"label",htmlFor:e,children:c.formatMessage({id:"search_label"})}),x.jsx("input",{ref:l,type:"search",id:e,name:e,defaultValue:n,placeholder:c.formatMessage({id:"search_placeholder"}),onKeyDown:d=>{d.key==="Enter"&&u(d)}}),x.jsx("button",{className:"clear",onClick:d=>{d.preventDefault(),d.stopPropagation(),l.current&&l.current.value&&(l.current.value="")},children:x.jsx(lt,{children:c.formatMessage({id:"search_clear"})})}),x.jsx("button",{className:"search",onClick:u,children:x.jsx(lt,{children:c.formatMessage({id:"search_cta"})})})]})})})};var EP="Expected a function",yE="__lodash_hash_undefined__",vE=1/0,_P="[object Function]",bP="[object GeneratorFunction]",wP="[object Symbol]",SP=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,TP=/^\w*$/,xP=/^\./,OP=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,AP=/[\\^$.*+?()[\]{}|]/g,CP=/\\(\\)?/g,RP=/^\[object .+?Constructor\]$/,PP=typeof fe=="object"&&fe&&fe.Object===Object&&fe,NP=typeof self=="object"&&self&&self.Object===Object&&self,lh=PP||NP||Function("return this")();function IP(e,t){return e==null?void 0:e[t]}function LP(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var kP=Array.prototype,MP=Function.prototype,EE=Object.prototype,Sl=lh["__core-js_shared__"],qm=function(){var e=/[^.]+$/.exec(Sl&&Sl.keys&&Sl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),_E=MP.toString,fh=EE.hasOwnProperty,bE=EE.toString,FP=RegExp("^"+_E.call(fh).replace(AP,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gm=lh.Symbol,DP=kP.splice,BP=wE(lh,"Map"),ks=wE(Object,"create"),Vm=Gm?Gm.prototype:void 0,Wm=Vm?Vm.toString:void 0;function oi(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function UP(){this.__data__=ks?ks(null):{}}function $P(e){return this.has(e)&&delete this.__data__[e]}function jP(e){var t=this.__data__;if(ks){var r=t[e];return r===yE?void 0:r}return fh.call(t,e)?t[e]:void 0}function HP(e){var t=this.__data__;return ks?t[e]!==void 0:fh.call(t,e)}function qP(e,t){var r=this.__data__;return r[e]=ks&&t===void 0?yE:t,this}oi.prototype.clear=UP;oi.prototype.delete=$P;oi.prototype.get=jP;oi.prototype.has=HP;oi.prototype.set=qP;function vo(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function GP(){this.__data__=[]}function VP(e){var t=this.__data__,r=Iu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():DP.call(t,r,1),!0}function WP(e){var t=this.__data__,r=Iu(t,e);return r<0?void 0:t[r][1]}function zP(e){return Iu(this.__data__,e)>-1}function QP(e,t){var r=this.__data__,n=Iu(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}vo.prototype.clear=GP;vo.prototype.delete=VP;vo.prototype.get=WP;vo.prototype.has=zP;vo.prototype.set=QP;function ci(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function YP(){this.__data__={hash:new oi,map:new(BP||vo),string:new oi}}function KP(e){return Lu(this,e).delete(e)}function XP(e){return Lu(this,e).get(e)}function JP(e){return Lu(this,e).has(e)}function ZP(e,t){return Lu(this,e).set(e,t),this}ci.prototype.clear=YP;ci.prototype.delete=KP;ci.prototype.get=XP;ci.prototype.has=JP;ci.prototype.set=ZP;function Iu(e,t){for(var r=e.length;r--;)if(lN(e[r][0],t))return r;return-1}function eN(e,t){t=iN(t,e)?[t]:nN(t);for(var r=0,n=t.length;e!=null&&r<n;)e=e[uN(t[r++])];return r&&r==n?e:void 0}function tN(e){if(!TE(e)||sN(e))return!1;var t=fN(e)||LP(e)?FP:RP;return t.test(cN(e))}function rN(e){if(typeof e=="string")return e;if(dh(e))return Wm?Wm.call(e):"";var t=e+"";return t=="0"&&1/e==-vE?"-0":t}function nN(e){return SE(e)?e:aN(e)}function Lu(e,t){var r=e.__data__;return oN(t)?r[typeof t=="string"?"string":"hash"]:r.map}function wE(e,t){var r=IP(e,t);return tN(r)?r:void 0}function iN(e,t){if(SE(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||dh(e)?!0:TP.test(e)||!SP.test(e)||t!=null&&e in Object(t)}function oN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function sN(e){return!!qm&&qm in e}var aN=hh(function(e){e=dN(e);var t=[];return xP.test(e)&&t.push(""),e.replace(OP,function(r,n,i,o){t.push(i?o.replace(CP,"$1"):n||r)}),t});function uN(e){if(typeof e=="string"||dh(e))return e;var t=e+"";return t=="0"&&1/e==-vE?"-0":t}function cN(e){if(e!=null){try{return _E.call(e)}catch{}try{return e+""}catch{}}return""}function hh(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(EP);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a),a};return r.cache=new(hh.Cache||ci),r}hh.Cache=ci;function lN(e,t){return e===t||e!==e&&t!==t}var SE=Array.isArray;function fN(e){var t=TE(e)?bE.call(e):"";return t==_P||t==bP}function TE(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function hN(e){return!!e&&typeof e=="object"}function dh(e){return typeof e=="symbol"||hN(e)&&bE.call(e)==wP}function dN(e){return e==null?"":rN(e)}function pN(e,t,r){var n=e==null?void 0:eN(e,t);return n===void 0?r:n}var mN=pN;const xE=Er(mN),Fe={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const r={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},n=o=>{const a=`logged${e?"In":"Out"}`;return t>=r[o][a]};let i={};return["navigation","search"].forEach(o=>{i[o]=n(o)}),i},shouldChangeHeaderIsVisible:(e,t,r)=>{Object.values(t).filter(i=>i===!0).length||r([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:r,dispatch:n})=>{if(r[e]===t||e==="account"&&t===!1&&r.navigation===!0)return;const i=Date.now();if(!t&&Fe.handlerCalled[e]&&i-Fe.handlerCalled[e]<500)return;Fe.handlerCalled[e]=i;let o=[{type:`menus.${e}`,value:t}];t===!0&&Object.keys(r).forEach(a=>{a===e||r[a]===!1||o.push({type:`menus.${a}`,value:!1})}),n(o)},findFirstChild:(e,t,r=!1)=>{if(!e||!e[0])return!1;for(let n=0;n<=e.length;n++){if(!e[n])continue;if(e[n][t]&&(!r||e[n][t].includes(r)))return e[n];if(!t.includes("."))continue;const i=xE(e[n],t);if(!(typeof i>"u")&&(!r||i[t]&&i[t].includes(r)||i.value&&i.value.includes(r)||i.toString().includes(r)))return e[n]}return e[0].children?Fe.findFirstChild(e[0].children,t,r):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:r,focusElements:n,dispatch:i})=>{if(!t.current||!t.current.children)return;const o=r?"desktop":"default";if(n[e][o]){n[e][o].focus();return}let a,s;switch(e){case"navigation":if(r){const c=Fe.findFirstChild(t.current.children,"attributes.aria-controls","navigation");a=Fe.findFirstChild(c.children,"href")}else a=Fe.findFirstChild(t.current.children,"href");a||(a=t.current);break;case"account":if(s=Fe.findFirstChild(t.current.children,"className","account"),!s||!s.children)return;a=Fe.findFirstChild(s.children,"href");break;default:return}a&&(i([{type:`focusElements.${e}.${o}`,value:a}]),a.focus())},events:{onClick:(e,{id:t,callback:r,isOpen:n})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(Fe.timeouts[t]),r(t,!n))},onFocus:({id:e})=>{clearTimeout(Fe.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(Fe.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{Fe.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},Ms={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},topics:{order:["explore","topics"],menuId:"navigation",explore:{order:["events","courses","q-and-a","articles"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},"q-and-a":{href:"/questions-answers/",className:"icon q-and-a"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"}},topics:{order:["climate","cities-and-local-government","digital-and-data","education","equity-justice-and-inclusion","health-and-social-care","innovation","leadership-and-skills","life-in-government","policymaking","transport-and-infrastructure","work-and-the-economy"],className:"columns",climate:{href:"/topics/climate/"},"cities-and-local-government":{href:"/topics/cities-and-local-government/"},"digital-and-data":{href:"/topics/digital-and-data/"},education:{href:"/topics/education/"},"equity-justice-and-inclusion":{href:"/topics/equity-justice-and-inclusion/"},"health-and-social-care":{href:"/topics/health-and-social-care/"},innovation:{href:"/topics/innovation/"},"leadership-and-skills":{href:"/topics/leadership-and-skills/"},"life-in-government":{href:"/topics/life-in-government/"},policymaking:{href:"/topics/policymaking/"},"transport-and-infrastructure":{href:"/topics/transport-and-infrastructure/"},"work-and-the-economy":{href:"/topics/work-and-the-economy/"}}},partners:{href:"/partnerships/",onlyShow:"logged-out"},account:{order:["profile","settings","log-out"],className:"account",onlyShow:"logged-in",doTrack:!1,profile:{href:"/profiles/me"},settings:{href:"/profiles/me/manage-account"},"log-out":{href:"/user-onboarding/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/user-onboarding/login"},signup:{href:"/signup/?ref=header-banner",props:{variant:"primary"}}}},pu=({id:e,isLoggedIn:t=!1,isDesktopVersion:r=!1,menus:n={},callback:i=()=>{},doTrack:o=null})=>{const a=Oe(),s=xE(Ms,e);if(!s||s.onlyShow&&(s.onlyShow==="logged-in"&&!t||s.onlyShow==="logged-out"&&t))return null;const c="doTrack"in s,l=o===null?c?s.doTrack:!0:o,u=e.includes("buttons.");let d=`header_${e.replaceAll(".","_")}`;s.hasVariantText&&(d+=`_logged${t?"In":"Out"}`);let h=!1;if(s.href){let v=s.gtmType||`${e}-click`;if(v.includes(".")){const b=v.split("."),T=b[b.length-2];v=`${T==="topics"?`${T}-`:""}${b[b.length-1]}`}h={href:s.href,role:"menuitem"},l&&(h={...h,className:"gtm-trackable","data-gtm-event-type":v,"data-gtm-event-context":"HeaderButtons"}),u&&(h={...h,variant:"secondary",size:{mobile:"small",881:"large"},...s.props||{}})}const f=s.order&&s.order[0]&&s[s.order[0]],p=f&&s[s.order[0]].order,m=h&&window.location.pathname===s.href;let _={},S={};if(f){const v=s.menuId||e,b={onClick:T=>Fe.events.onClick(T,{id:v,callback:i,isOpen:n[v]}),onFocus:()=>Fe.events.onFocus({id:v}),onBlur:()=>Fe.events.onBlur({id:v,callback:i}),onMouseLeave:()=>Fe.events.onBlur({id:v,callback:i}),onMouseEnter:()=>Fe.events.onMouseEnter({id:v,callback:i})};r&&(p&&(_={...b,onKeyPress:T=>{T.key==="Enter"&&Fe.events.onClick(T,{id:v,callback:i,isOpen:n[v]})},tabIndex:"0","aria-haspopup":!0,"aria-expanded":n[v],"aria-controls":v}),S={hidden:v in n?!n[v]:!0}),p||(S={...S,...b})}return x.jsxs("li",{className:se({[s.className]:s.className,"has-submenu":f,parent:p,active:m}),role:"none",..._,children:[h?U.createElement(u?ze:"a",h,a.formatMessage({id:d})):a.formatMessage({id:d}),s.order&&x.jsx("ul",{...S,children:s.order.map(v=>{if(!s[v])return null;const b={isLoggedIn:t,isDesktopVersion:r,menus:n,callback:i,doTrack:c?l:null};return s[v].order?x.jsxs("li",{className:se({[s[v].className]:s[v].className}),children:[a.formatMessage({id:`${d}_${v}`}),x.jsx("ul",{children:s[v].order.map(T=>x.jsx(pu,{id:`${e}.${v}.${T}`,...b},T))})]},v):x.jsx(pu,{id:`${e}.${v}`,...b},v)})})]},e)};const gN={height:67,height_desktop:83},ph=()=>{const e=Oe(),t=U.useContext($r),r=ra(!0,!0),n=t&&typeof t.id=="string",i=U.useMemo(()=>Fe.getIsDesktopVersion(n,r),[n,r]),[o,a]=U.useReducer(_O,{headerIsVisible:!0,menus:{navigation:!1,search:!1,account:!1},focusElements:{navigation:{desktop:!1,default:!1},account:{desktop:!1,default:!1}}}),{headerIsVisible:s,menus:c,focusElements:l}=o;gv({scrollPosition:gN[`height${i.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{!i&&c.navigation||Fe.shouldChangeHeaderIsVisible(!0,c,a)},scrollDown:()=>{!i&&c.navigation||Fe.shouldChangeHeaderIsVisible(!1,c,a)}}});const u=(h,f)=>{Fe.handleMenus({id:h,value:f,menus:c,dispatch:a})},d=U.useRef(null);return ri(()=>{c.navigation&&Fe.autoFocus({menu:"navigation",navigationRef:d,isDesktopVersion:i.navigation,focusElements:l,dispatch:a})},[c.navigation]),ri(()=>{c.account&&Fe.autoFocus({menu:"account",navigationRef:d,isDesktopVersion:i.navigation,focusElements:l,dispatch:a})},[c.account]),t&&t.isLoading?null:x.jsxs(x.Fragment,{children:[x.jsxs("nav",{id:"header",className:se({"logged-in":n,"logged-out":!n,visible:s}),children:[x.jsx(lt,{element:"a",href:"#content-of-page",children:e.formatMessage({id:"header_skip"})}),x.jsx(uh,{}),!i.navigation&&x.jsx("button",{className:"menu-button gtm-trackable",onClick:h=>{h.preventDefault(),h.stopPropagation(),u("navigation",!c.navigation)},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":c.navigation,"aria-controls":"navigation",children:x.jsx(lt,{children:e.formatMessage({id:`header_menu_${c.navigation?"hide":"show"}`})})}),x.jsx("ul",{ref:d,id:"navigation",hidden:i.navigation||c.account?!1:!c.navigation,role:"menu","data-showing":!i.navigation&&c.account?"account":"default",children:Ms.order.map(h=>x.jsx(pu,{id:h,isLoggedIn:n,isDesktopVersion:i.navigation,menus:{navigation:c.navigation,account:c.account},callback:u},h))}),!i.search&&x.jsx("button",{className:"search toggle-search-button",onClick:h=>{h.preventDefault(),h.stopPropagation(),u("search",!c.search)},"aria-haspopup":"true","aria-expanded":c.search,"aria-controls":"search-form",children:x.jsx(lt,{children:e.formatMessage({id:`header_search_${c.search?"hide":"show"}`})})}),x.jsx(gE,{id:"global-search",handleToggle:{searchIsOpen:c.search,isDesktopVersion:i.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"}),n?x.jsxs("button",{className:"account-button",onClick:h=>Fe.events.onClick(h,{id:"account",callback:u,isOpen:c.account}),onMouseEnter:()=>Fe.events.onMouseEnter({id:"account",callback:u}),onMouseLeave:()=>Fe.events.onBlur({id:"account",callback:u}),"aria-haspopup":"true","aria-expanded":c.account,"aria-controls":"navigation",children:[x.jsx(lt,{children:e.formatMessage({id:`header_account_${c.account?"hide":"show"}`})}),x.jsx(Ou,{name:t&&t.name||"",src:t&&t.image&&t.image.thumbnail||""})]}):x.jsx("ul",{className:"sign-in-buttons",children:Ms.buttons.order.map(h=>x.jsx(pu,{id:`buttons.${h}`},h))})]}),x.jsx("hr",{id:"content-of-page"}),x.jsx("div",{className:se("overlay",{open:c.navigation||c.account||!i.search&&c.search})})]})},yN=U.createContext(null),Tl={didCatch:!1,error:null};class vN extends U.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Tl}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:o,reason:"imperative-api"}),this.setState(Tl)}}componentDidCatch(t,r){var n,i;(n=(i=this.props).onError)===null||n===void 0||n.call(i,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:i}=this.props;if(n&&r.error!==null&&EN(t.resetKeys,i)){var o,a;(o=(a=this.props).onReset)===null||o===void 0||o.call(a,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(Tl)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:i}=this.props,{didCatch:o,error:a}=this.state;let s=t;if(o){const c={error:a,resetErrorBoundary:this.resetErrorBoundary};if(U.isValidElement(i))s=i;else if(typeof r=="function")s=r(c);else if(n)s=U.createElement(n,c);else throw a}return U.createElement(yN.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function EN(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}const _N=()=>{const e=Oe();return x.jsxs(x.Fragment,{children:[x.jsx(ph,{}),x.jsx("div",{className:"content",children:x.jsx(aa,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),x.jsx(ch,{})]})},bN=({children:e,reportError:t,showFooter:r=!0,background:n="default",className:i="",locale:o="en"})=>{const a=hg();U.useEffect(()=>{window.scrollTo(0,0)},[a]);const s=Av(e,{locale:o});return x.jsx(vN,{onError:t,fallback:x.jsx(_N,{}),children:x.jsx(U.Suspense,{fallback:x.jsx(I0,{layout:"overview-page"}),children:x.jsx("div",{id:"wrapper",className:se(i,{[n]:n!=="default"}),children:x.jsxs(e_,{children:[x.jsx(ph,{}),x.jsx("div",{className:"content",children:s}),r&&x.jsx(ch,{}),x.jsx(hE,{})]})})})})},zm={default:"tags_",headerTopics:"header_topics_topics_"},xl={topic:{Climate:"climate",CitiesAndLocalGovernment:"cities-and-local-government",DigitalAndData:"digital-and-data",Education:"education",EquityJusticeAndInclusion:"equity-justice-and-inclusion",HealthAndSocialCare:"health-and-social-care",Innovation:"innovation",LeadershipAndSkills:"leadership-and-skills",LifeInGovernment:"life-in-government",Policymaking:"policymaking",TransportAndInfrastructure:"transport-and-infrastructure",WorkAndTheEconomy:"work-and-the-economy"},"from the community":"community"},wN={getTagDetails:e=>{if(e.includes("topic_")){if(e=xl.topic[e.replace("topic_","")],e){const t=Ms.topics.topics[e].href;return t?{id:e,href:t,text:`${zm.headerTopics}${e}`}:null}return null}return xl[e]?(e=xl[e],{id:e,text:`${zm.default}${e}`}):null}};const SN=({tags:e=[],color:t="default",forceOneLine:r=!1,canHaveLinks:n=!0,className:i="",gtmType:o="tag-click",gtmContext:a="tags"})=>{const s=Oe();if(!e||e.length<1)return null;const c=[];return e.forEach(l=>{if(!l)return;const u=wN.getTagDetails(l);u&&c.push(u)}),c.length<1?null:x.jsx("ul",{className:se("tags text-small",t,i,{"one-line":r}),children:c.map(l=>{const u=s.formatMessage({id:l.text});return x.jsx("li",{children:l.href&&n?x.jsx("a",{href:l.href,className:"gtm-trackable","data-gtm-event-type":o,"data-gtm-event-context":a,children:u}):u},l.id)})})};const TN=({members:{total:e,data:t=[]},pagination:r,gtmContext:n="member",gtmType:i="member-click",className:o=""})=>{const a=Oe();return t.length===0?null:(e||(e=t.length),x.jsxs("div",{className:se("members-list",o),children:[x.jsxs("h1",{children:[a.formatMessage({id:"membersList"}),x.jsx("span",{className:"count",children:e})]}),x.jsx("ul",{children:t.map((s,c)=>x.jsxs("li",{children:[x.jsx(Au,{member:s,gtmContext:n,gtmType:i}),s.isAdmin&&x.jsx(R0,{children:a.formatMessage({id:"membersList_admin"})})]},c))}),r&&x.jsx(lE,{...r,icon:{icon:"arrow-down",position:"right"},gtmContext:n})]}))};function xf(){return xf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xf.apply(this,arguments)}function xN(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o<n.length;o++)i=n[o],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var ON=U.useLayoutEffect,AN=function(t){var r=pe.useRef(t);return ON(function(){r.current=t}),r},Qm=function(t,r){if(typeof t=="function"){t(r);return}t.current=r},CN=function(t,r){var n=U.useRef();return U.useCallback(function(i){t.current=i,n.current&&Qm(n.current,null),n.current=r,r&&Qm(r,i)},[r])},Ym={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},RN=function(t){Object.keys(Ym).forEach(function(r){t.style.setProperty(r,Ym[r],"important")})},Km=RN,vt=null,Xm=function(t,r){var n=t.scrollHeight;return r.sizingStyle.boxSizing==="border-box"?n+r.borderSize:n-r.paddingSize};function PN(e,t,r,n){r===void 0&&(r=1),n===void 0&&(n=1/0),vt||(vt=document.createElement("textarea"),vt.setAttribute("tabindex","-1"),vt.setAttribute("aria-hidden","true"),Km(vt)),vt.parentNode===null&&document.body.appendChild(vt);var i=e.paddingSize,o=e.borderSize,a=e.sizingStyle,s=a.boxSizing;Object.keys(a).forEach(function(h){var f=h;vt.style[f]=a[f]}),Km(vt),vt.value=t;var c=Xm(vt,e);vt.value=t,c=Xm(vt,e),vt.value="x";var l=vt.scrollHeight-i,u=l*r;s==="border-box"&&(u=u+i+o),c=Math.max(u,c);var d=l*n;return s==="border-box"&&(d=d+i+o),c=Math.min(d,c),[c,l]}var Jm=function(){},NN=function(t,r){return t.reduce(function(n,i){return n[i]=r[i],n},{})},IN=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],LN=!!document.documentElement.currentStyle,kN=function(t){var r=window.getComputedStyle(t);if(r===null)return null;var n=NN(IN,r),i=n.boxSizing;if(i==="")return null;LN&&i==="border-box"&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px");var o=parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),a=parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth);return{sizingStyle:n,paddingSize:o,borderSize:a}},MN=kN;function OE(e,t,r){var n=AN(r);pe.useLayoutEffect(function(){var i=function(a){return n.current(a)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var FN=function(t){OE(window,"resize",t)},DN=function(t){OE(document.fonts,"loadingdone",t)},BN=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],UN=function(t,r){var n=t.cacheMeasurements,i=t.maxRows,o=t.minRows,a=t.onChange,s=a===void 0?Jm:a,c=t.onHeightChange,l=c===void 0?Jm:c,u=xN(t,BN),d=u.value!==void 0,h=pe.useRef(null),f=CN(h,r),p=pe.useRef(0),m=pe.useRef(),_=function(){var b=h.current,T=n&&m.current?m.current:MN(b);if(T){m.current=T;var w=PN(T,b.value||b.placeholder||"x",o,i),N=w[0],R=w[1];p.current!==N&&(p.current=N,b.style.setProperty("height",N+"px","important"),l(N,{rowHeight:R}))}},S=function(b){d||_(),s(b)};return pe.useLayoutEffect(_),FN(_),DN(_),pe.createElement("textarea",xf({},u,{onChange:S,ref:f}))},$N=pe.forwardRef(UN);let $a=null;const Ot="discussion_form_",mh=({content:e={type:"response",slugs:{}},userHasPermissions:t=!0,meta:r={isLoading:!1,isInWrapper:!1,isEditing:!1,showTitle:!1},inputRef:n,maxLength:i=5e4,minRows:o=4,forceShow:a={cancel:!1,error:!1},functions:s={create:()=>{},handleSaveEdit:()=>{},handleCancel:()=>{},callback:()=>{},props:{create:{projectNames:["questions-answers"]}}},gtmContext:c="DiscussionForm"})=>{var $,G;const l=Oe(),u=U.useContext($r),[d,h]=U.useState(r.isEditing&&r.isEditing.text||""),[f,p]=U.useState(a.error||!1),[m,_]=U.useState(!1),S=U.useRef(null);if(n||(n=S),r.isLoading)return x.jsx(yr,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const v=q=>{const H=q.target.value;h(H);let Y;!u||!u.id?Y=ar(l.formatMessage,`${Ot}error_loggedOut`,e.type,"action"):t?H.length>=i&&(Y=`${Ot}error_tooLong`):Y=ar(l.formatMessage,`${Ot}error_noPermission`,e.type,"action"),Y?p(Y):f&&p(!1)};let b=`${e.type}-form`;if(e.type==="response"||e.type==="reply"){const q=e.type==="response"?(($=e.slugs)==null?void 0:$.question)||"":((G=e.slugs)==null?void 0:G.answer)||"";q&&(b=`${b}-${q.slice(-15)}`)}const T=async q=>{var Y;if(q.preventDefault(),q.stopPropagation(),!u||!u.id||!t||N)return;$a&&clearTimeout($a),_("submitting");const H=window.location.pathname;try{let ie;switch(e.type){case"post":ie=await s.create({content:d});break;case"question":ie=await s.create({title:d,authorId:u&&u.id,...(Y=s.props)==null?void 0:Y.create});break;case"response":ie=await s.create({question:e.slugs.question},{body:d,authorId:u&&u.id,contentPath:H});break;case"reply":ie=await s.create({question:e.slugs.question,answer:e.slugs.answer},{body:d,authorId:u&&u.id,contentPath:H});break;default:break}await SO(1e3),s.callback&&await s.callback(ie),$a=setTimeout(()=>{h(""),_("submitted"),w()},500)}catch(ie){const K=ie;let k=`${Ot}error`;K.message.includes("entry already exists")&&(k=ar(l.formatMessage,`${Ot}error_alreadyExists`,e.type,"action")),K.message.includes("429")?k=ar(l.formatMessage,`${Ot}error_tooMany`,e.type,"action"):K.message.includes("400")&&(k=`${Ot}error`),p(k),w()}},w=()=>{$a=setTimeout(()=>{p(!1),_(!1)},5e3)},N=!d||!RO(d),R=m==="submitting",L=[];return(r.isEditing&&!R||a.cancel)&&L.push({variant:"secondary",size:{mobile:"small",600:"medium"},onClick:s.handleCancel,className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":`cancel-${e.type}-click`,disabled:!a.cancel&&(!u||!u.id||!d),children:l.formatMessage({id:`${Ot}cancel`})}),L.push({variant:"primary",size:{mobile:"small",600:"medium"},onClick:q=>{if(r.isEditing){_("submitting"),s.handleSaveEdit&&s.handleSaveEdit(S.current&&"value"in S.current?S.current.value:"");return}T(q)},className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":`${r.isEditing?"save":"submit"}-${e.type}-click`,"data-testid":"save-button",disabled:!u||!u.id||!t||N||R||r.isEditing&&d===r.isEditing.text,children:l.formatMessage({id:`${Ot}${R?r.isEditing?"saving":"posting":r.isEditing?"save":"post"}`})}),x.jsxs("form",{id:b,className:se("discussion-card discussion-form",{"no-styling":r.isInWrapper&&r.isEditing}),"data-testid":`discussion-${e.type}-form`,children:[(r==null?void 0:r.showTitle)&&!r.isEditing&&["question"].includes(e.type)&&x.jsx("h2",{children:ar(l.formatMessage,`${Ot}title`,e.type,"action")}),x.jsx(Au,{member:u||"community",gtmContext:c,gtmType:"profile-click"}),x.jsx(lt,{element:"label",showOnFocus:!1,htmlFor:`${b}-input`,children:ar(l.formatMessage,`${Ot}label`,e.type,"action")}),x.jsx($N,{ref:n,id:`${b}-input`,name:e.type,placeholder:ar(l.formatMessage,`${Ot}placeholder`,e.type,"action"),onChange:v,value:d,maxLength:i,"aria-invalid":!!f,"aria-errormessage":"error-message",minRows:o,autoFocus:!!r.isEditing}),x.jsx("small",{children:ar(l.formatMessage,`${Ot}explainer`,e.type,"action",{a:q=>x.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":"community-guidelines-link",children:q})})}),x.jsx(na,{buttons:L}),m==="submitted"&&x.jsx(nu,{className:"success","data-testid":"success",children:ar(l.formatMessage,`${Ot}success`,e.type,"action")}),f&&x.jsx(nu,{id:"error-message",className:"error","data-testid":"error",children:a.error?a.error:typeof f=="string"?f.includes(" ")?f:l.formatMessage({id:f},{action:l.formatMessage({id:`discussion_action_${e.type}`}),maxLength:i}):f})]})},gh=({contentType:e,createPost:t,membershipRequiredToPost:{isMember:r,required:n,join:i,leave:o,notMemberStateText:a}})=>n&&!r?x.jsx(aa,{text:a,button:{component:x.jsx(ah,{functions:{join:i,leave:o}})}}):x.jsx(mh,{content:{type:e,slugs:{}},functions:{create:t}}),jN={showThread:!1,showForm:!1},yh=U.createContext(jN),HN=({children:e})=>{const[t,r]=U.useState({showThread:!1,showForm:!1});return x.jsx(yh.Provider,{value:{...t,updateConversation:r},children:e})},qN=({question:e,answer:t,reply:r})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...r&&{replySlug:r}}),GN=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);let Os=!1;const Ol=()=>{Os!==!1&&(clearTimeout(Os),Os=!1)},Al=10,AE=({element:e="div",likes:t=0,peopleWhoLiked:r=!1,isShort:n=!0,userLiked:i=!1,content:o={type:"reply",slugs:{}},canLike:a=!0,functions:{createLike:s=()=>{},deleteLike:c=()=>{}}={}})=>{const l=Oe();U.useEffect(()=>{f(i)},[i]);const[u,d]=U.useState(t),[h,f]=U.useState(i),[p,m]=U.useState(!1),[_,S]=U.useState(!1),v=U.useMemo(()=>GN(r,Al),[r]),b=w=>{if(w.preventDefault(),w.stopPropagation(),S(!1),Os)return Ol(),!1;if(Ol(),p||!a)return!1;Os=setTimeout(T,350)},T=async()=>{if(Ol(),p||!a)return!1;let w=h?u-1:u+1;w<0&&(w=0),m(!0),d(w),f(!h);try{if(o&&o.slugs){const N=qN(o.slugs);h?await c(N):await s(N,{contentPath:window.location.pathname})}}catch{d(t),f(i)}finally{m(!1)}};return U.createElement(e,{className:se("likes-wrapper text-medium action-button",{"show-spinner":p,"is-liked":h,disabled:!a}),onClick:b,onMouseEnter:()=>{S(!0)},onMouseLeave:()=>{S(!1)},onFocus:()=>{S(!0)},onBlur:()=>{S(!1)},children:x.jsxs(x.Fragment,{children:[x.jsx(ze,{variant:"tertiary",size:"medium",icon:{icon:h?"heart":"heart_empty",animate:"bounce"},className:se({"do-animation":h&&!i}),screenreaderText:a?l.formatMessage({id:`discussion_likes_${h?"unlike":"like"}`},{action:l.formatMessage({id:`discussion_action_${o.type}`})}):!1,onClick:b,disabled:!a,"aria-hidden":!a,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${o.type}-click`}),x.jsx("span",{className:se("number-of-likes",{"no-likes":u===0}),"data-testid":"number-of-likes",children:l.formatMessage({id:`discussion_likes${n?"_short":""}`},{number:u})}),r&&x.jsx(o0,{isOpen:_,isLoading:r.length===0,children:r.length&&x.jsxs("ul",{children:[v.map(w=>typeof w=="string"||!w.name?null:x.jsx("li",{children:x.jsx(ia,{href:w.id?`/profiles/${w.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",children:w.name})},w.id||window.btoa(w.name))),r.length>Al&&x.jsx("li",{children:l.formatMessage({id:"discussion_likes_more"},{number:r.length-Al})})]})})]})})};var mu={exports:{}};mu.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",i=1,o=2,a=9007199254740991,s="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",h="[object Error]",f="[object Function]",p="[object GeneratorFunction]",m="[object Map]",_="[object Number]",S="[object Null]",v="[object Object]",b="[object Promise]",T="[object Proxy]",w="[object RegExp]",N="[object Set]",R="[object String]",L="[object Symbol]",$="[object Undefined]",G="[object WeakMap]",q="[object ArrayBuffer]",H="[object DataView]",Y="[object Float32Array]",ie="[object Float64Array]",K="[object Int8Array]",k="[object Int16Array]",Q="[object Int32Array]",ee="[object Uint8Array]",he="[object Uint8ClampedArray]",Z="[object Uint16Array]",X="[object Uint32Array]",le=/[\\^$.*+?()[\]{}|]/g,de=/^\[object .+?Constructor\]$/,Ve=/^(?:0|[1-9]\d*)$/,te={};te[Y]=te[ie]=te[K]=te[k]=te[Q]=te[ee]=te[he]=te[Z]=te[X]=!0,te[s]=te[c]=te[q]=te[u]=te[H]=te[d]=te[h]=te[f]=te[m]=te[_]=te[v]=te[w]=te[N]=te[R]=te[G]=!1;var ae=typeof fe=="object"&&fe&&fe.Object===Object&&fe,De=typeof self=="object"&&self&&self.Object===Object&&self,Ie=ae||De||Function("return this")(),Tt=t&&!t.nodeType&&t,Ct=Tt&&!0&&e&&!e.nodeType&&e,Gt=Ct&&Ct.exports===Tt,oe=Gt&&ae.process,st=function(){try{return oe&&oe.binding&&oe.binding("util")}catch{}}(),Je=st&&st.isTypedArray;function Vt(y,A){for(var I=-1,W=y==null?0:y.length,ge=0,ce=[];++I<W;){var _e=y[I];A(_e,I,y)&&(ce[ge++]=_e)}return ce}function wr(y,A){for(var I=-1,W=A.length,ge=y.length;++I<W;)y[ge+I]=A[I];return y}function er(y,A){for(var I=-1,W=y==null?0:y.length;++I<W;)if(A(y[I],I,y))return!0;return!1}function kt(y,A){for(var I=-1,W=Array(y);++I<y;)W[I]=A(I);return W}function yn(y){return function(A){return y(A)}}function Wt(y,A){return y.has(A)}function Mt(y,A){return y==null?void 0:y[A]}function Ze(y){var A=-1,I=Array(y.size);return y.forEach(function(W,ge){I[++A]=[ge,W]}),I}function zt(y,A){return function(I){return y(A(I))}}function yt(y){var A=-1,I=Array(y.size);return y.forEach(function(W){I[++A]=W}),I}var at=Array.prototype,vn=Function.prototype,O=Object.prototype,g=Ie["__core-js_shared__"],E=vn.toString,C=O.hasOwnProperty,M=function(){var y=/[^.]+$/.exec(g&&g.keys&&g.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),j=O.toString,z=RegExp("^"+E.call(C).replace(le,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),me=Gt?Ie.Buffer:void 0,Ce=Ie.Symbol,Re=Ie.Uint8Array,Pe=O.propertyIsEnumerable,Ee=at.splice,Rt=Ce?Ce.toStringTag:void 0,Hr=Object.getOwnPropertySymbols,En=me?me.isBuffer:void 0,Sr=zt(Object.keys,Object),_n=Yt(Ie,"DataView"),Tr=Yt(Ie,"Map"),bn=Yt(Ie,"Promise"),wn=Yt(Ie,"Set"),Sn=Yt(Ie,"WeakMap"),tr=Yt(Object,"create"),li=ut(_n),Qt=ut(Tr),Eo=ut(bn),_o=ut(wn),bo=ut(Sn),fi=Ce?Ce.prototype:void 0,Tn=fi?fi.valueOf:void 0;function We(y){var A=-1,I=y==null?0:y.length;for(this.clear();++A<I;){var W=y[A];this.set(W[0],W[1])}}function xn(){this.__data__=tr?tr(null):{},this.size=0}function On(y){var A=this.has(y)&&delete this.__data__[y];return this.size-=A?1:0,A}function xr(y){var A=this.__data__;if(tr){var I=A[y];return I===n?void 0:I}return C.call(A,y)?A[y]:void 0}function hi(y){var A=this.__data__;return tr?A[y]!==void 0:C.call(A,y)}function wo(y,A){var I=this.__data__;return this.size+=this.has(y)?0:1,I[y]=tr&&A===void 0?n:A,this}We.prototype.clear=xn,We.prototype.delete=On,We.prototype.get=xr,We.prototype.has=hi,We.prototype.set=wo;function et(y){var A=-1,I=y==null?0:y.length;for(this.clear();++A<I;){var W=y[A];this.set(W[0],W[1])}}function So(){this.__data__=[],this.size=0}function To(y){var A=this.__data__,I=Vr(A,y);if(I<0)return!1;var W=A.length-1;return I==W?A.pop():Ee.call(A,I,1),--this.size,!0}function xo(y){var A=this.__data__,I=Vr(A,y);return I<0?void 0:A[I][1]}function Oo(y){return Vr(this.__data__,y)>-1}function An(y,A){var I=this.__data__,W=Vr(I,y);return W<0?(++this.size,I.push([y,A])):I[W][1]=A,this}et.prototype.clear=So,et.prototype.delete=To,et.prototype.get=xo,et.prototype.has=Oo,et.prototype.set=An;function ht(y){var A=-1,I=y==null?0:y.length;for(this.clear();++A<I;){var W=y[A];this.set(W[0],W[1])}}function Ao(){this.size=0,this.__data__={hash:new We,map:new(Tr||et),string:new We}}function Co(y){var A=Pt(this,y).delete(y);return this.size-=A?1:0,A}function Ro(y){return Pt(this,y).get(y)}function Po(y){return Pt(this,y).has(y)}function No(y,A){var I=Pt(this,y),W=I.size;return I.set(y,A),this.size+=I.size==W?0:1,this}ht.prototype.clear=Ao,ht.prototype.delete=Co,ht.prototype.get=Ro,ht.prototype.has=Po,ht.prototype.set=No;function qr(y){var A=-1,I=y==null?0:y.length;for(this.__data__=new ht;++A<I;)this.add(y[A])}function di(y){return this.__data__.set(y,n),this}function Gr(y){return this.__data__.has(y)}qr.prototype.add=qr.prototype.push=di,qr.prototype.has=Gr;function xt(y){var A=this.__data__=new et(y);this.size=A.size}function Cn(){this.__data__=new et,this.size=0}function Io(y){var A=this.__data__,I=A.delete(y);return this.size=A.size,I}function Lo(y){return this.__data__.get(y)}function ko(y){return this.__data__.has(y)}function Mo(y,A){var I=this.__data__;if(I instanceof et){var W=I.__data__;if(!Tr||W.length<r-1)return W.push([y,A]),this.size=++I.size,this;I=this.__data__=new ht(W)}return I.set(y,A),this.size=I.size,this}xt.prototype.clear=Cn,xt.prototype.delete=Io,xt.prototype.get=Lo,xt.prototype.has=ko,xt.prototype.set=Mo;function Fo(y,A){var I=Wr(y),W=!I&&Ei(y),ge=!I&&!W&&Qr(y),ce=!I&&!W&&!ge&&Ln(y),_e=I||W||ge||ce,be=_e?kt(y.length,String):[],He=be.length;for(var Ae in y)(A||C.call(y,Ae))&&!(_e&&(Ae=="length"||ge&&(Ae=="offset"||Ae=="parent")||ce&&(Ae=="buffer"||Ae=="byteLength"||Ae=="byteOffset")||rr(Ae,He)))&&be.push(Ae);return be}function Vr(y,A){for(var I=y.length;I--;)if(vi(y[I][0],A))return I;return-1}function Rn(y,A,I){var W=A(y);return Wr(y)?W:wr(W,I(y))}function Or(y){return y==null?y===void 0?$:S:Rt&&Rt in Object(y)?Kt(y):yi(y)}function pi(y){return Ft(y)&&Or(y)==s}function mi(y,A,I,W,ge){return y===A?!0:y==null||A==null||!Ft(y)&&!Ft(A)?y!==y&&A!==A:gi(y,A,I,W,mi,ge)}function gi(y,A,I,W,ge,ce){var _e=Wr(y),be=Wr(A),He=_e?c:Nt(y),Ae=be?c:Nt(A);He=He==s?v:He,Ae=Ae==s?v:Ae;var tt=He==v,ct=Ae==v,Ge=He==Ae;if(Ge&&Qr(y)){if(!Qr(A))return!1;_e=!0,tt=!1}if(Ge&&!tt)return ce||(ce=new xt),_e||Ln(y)?Pn(y,A,I,W,ge,ce):$o(y,A,He,I,W,ge,ce);if(!(I&i)){var rt=tt&&C.call(y,"__wrapped__"),Qe=ct&&C.call(A,"__wrapped__");if(rt||Qe){var nr=rt?y.value():y,Xt=Qe?A.value():A;return ce||(ce=new xt),ge(nr,Xt,I,W,ce)}}return Ge?(ce||(ce=new xt),Nn(y,A,I,W,ge,ce)):!1}function Do(y){if(!bi(y)||qo(y))return!1;var A=_i(y)?z:de;return A.test(ut(y))}function Bo(y){return Ft(y)&&In(y.length)&&!!te[Or(y)]}function Uo(y){if(!Go(y))return Sr(y);var A=[];for(var I in Object(y))C.call(y,I)&&I!="constructor"&&A.push(I);return A}function Pn(y,A,I,W,ge,ce){var _e=I&i,be=y.length,He=A.length;if(be!=He&&!(_e&&He>be))return!1;var Ae=ce.get(y);if(Ae&&ce.get(A))return Ae==A;var tt=-1,ct=!0,Ge=I&o?new qr:void 0;for(ce.set(y,A),ce.set(A,y);++tt<be;){var rt=y[tt],Qe=A[tt];if(W)var nr=_e?W(Qe,rt,tt,A,y,ce):W(rt,Qe,tt,y,A,ce);if(nr!==void 0){if(nr)continue;ct=!1;break}if(Ge){if(!er(A,function(Xt,Cr){if(!Wt(Ge,Cr)&&(rt===Xt||ge(rt,Xt,I,W,ce)))return Ge.push(Cr)})){ct=!1;break}}else if(!(rt===Qe||ge(rt,Qe,I,W,ce))){ct=!1;break}}return ce.delete(y),ce.delete(A),ct}function $o(y,A,I,W,ge,ce,_e){switch(I){case H:if(y.byteLength!=A.byteLength||y.byteOffset!=A.byteOffset)return!1;y=y.buffer,A=A.buffer;case q:return!(y.byteLength!=A.byteLength||!ce(new Re(y),new Re(A)));case u:case d:case _:return vi(+y,+A);case h:return y.name==A.name&&y.message==A.message;case w:case R:return y==A+"";case m:var be=Ze;case N:var He=W&i;if(be||(be=yt),y.size!=A.size&&!He)return!1;var Ae=_e.get(y);if(Ae)return Ae==A;W|=o,_e.set(y,A);var tt=Pn(be(y),be(A),W,ge,ce,_e);return _e.delete(y),tt;case L:if(Tn)return Tn.call(y)==Tn.call(A)}return!1}function Nn(y,A,I,W,ge,ce){var _e=I&i,be=Ar(y),He=be.length,Ae=Ar(A),tt=Ae.length;if(He!=tt&&!_e)return!1;for(var ct=He;ct--;){var Ge=be[ct];if(!(_e?Ge in A:C.call(A,Ge)))return!1}var rt=ce.get(y);if(rt&&ce.get(A))return rt==A;var Qe=!0;ce.set(y,A),ce.set(A,y);for(var nr=_e;++ct<He;){Ge=be[ct];var Xt=y[Ge],Cr=A[Ge];if(W)var ua=_e?W(Cr,Xt,Ge,A,y,ce):W(Xt,Cr,Ge,y,A,ce);if(!(ua===void 0?Xt===Cr||ge(Xt,Cr,I,W,ce):ua)){Qe=!1;break}nr||(nr=Ge=="constructor")}if(Qe&&!nr){var ir=y.constructor,Yr=A.constructor;ir!=Yr&&"constructor"in y&&"constructor"in A&&!(typeof ir=="function"&&ir instanceof ir&&typeof Yr=="function"&&Yr instanceof Yr)&&(Qe=!1)}return ce.delete(y),ce.delete(A),Qe}function Ar(y){return Rn(y,wi,jo)}function Pt(y,A){var I=y.__data__;return Ho(A)?I[typeof A=="string"?"string":"hash"]:I.map}function Yt(y,A){var I=Mt(y,A);return Do(I)?I:void 0}function Kt(y){var A=C.call(y,Rt),I=y[Rt];try{y[Rt]=void 0;var W=!0}catch{}var ge=j.call(y);return W&&(A?y[Rt]=I:delete y[Rt]),ge}var jo=Hr?function(y){return y==null?[]:(y=Object(y),Vt(Hr(y),function(A){return Pe.call(y,A)}))}:Si,Nt=Or;(_n&&Nt(new _n(new ArrayBuffer(1)))!=H||Tr&&Nt(new Tr)!=m||bn&&Nt(bn.resolve())!=b||wn&&Nt(new wn)!=N||Sn&&Nt(new Sn)!=G)&&(Nt=function(y){var A=Or(y),I=A==v?y.constructor:void 0,W=I?ut(I):"";if(W)switch(W){case li:return H;case Qt:return m;case Eo:return b;case _o:return N;case bo:return G}return A});function rr(y,A){return A=A??a,!!A&&(typeof y=="number"||Ve.test(y))&&y>-1&&y%1==0&&y<A}function Ho(y){var A=typeof y;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?y!=="__proto__":y===null}function qo(y){return!!M&&M in y}function Go(y){var A=y&&y.constructor,I=typeof A=="function"&&A.prototype||O;return y===I}function yi(y){return j.call(y)}function ut(y){if(y!=null){try{return E.call(y)}catch{}try{return y+""}catch{}}return""}function vi(y,A){return y===A||y!==y&&A!==A}var Ei=pi(function(){return arguments}())?pi:function(y){return Ft(y)&&C.call(y,"callee")&&!Pe.call(y,"callee")},Wr=Array.isArray;function zr(y){return y!=null&&In(y.length)&&!_i(y)}var Qr=En||Wo;function Vo(y,A){return mi(y,A)}function _i(y){if(!bi(y))return!1;var A=Or(y);return A==f||A==p||A==l||A==T}function In(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=a}function bi(y){var A=typeof y;return y!=null&&(A=="object"||A=="function")}function Ft(y){return y!=null&&typeof y=="object"}var Ln=Je?yn(Je):Bo;function wi(y){return zr(y)?Fo(y):Uo(y)}function Si(){return[]}function Wo(){return!1}e.exports=Vo})(mu,mu.exports);var VN=mu.exports;const WN=Er(VN);const CE=({element:e="section",children:t,className:r,...n})=>U.createElement(e,{className:se("modal",r),children:typeof t=="string"?x.jsx("p",{children:t}):t,...n});const RE=({id:e="content-overlay",isOpen:t=!1,maxWidth:r,functions:{onOpen:n=()=>{},onClose:i=()=>{}}={},forceShow:{error:o=!1}={},title:a,children:s,buttons:c,className:l="",gtmContext:u="Modal"})=>{const d=Oe(),[h,f]=U.useState(t),p=_=>{f(_),_?(n(),document.body.classList.add("has-overlay")):(i(),document.body.classList.remove("has-overlay"))};U.useEffect(()=>{p(t)},[t]);const m=r?{"--max-width":`${r/16}rem`}:{};return x.jsx("div",{className:se("overlay",{open:h}),children:x.jsx(CE,{id:e,className:se("overlay-modal",l,{"has-max-width":r}),hidden:!h,style:m,children:t&&x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"top",children:[x.jsx("h2",{children:a}),x.jsx(ze,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>p(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":u,screenreaderText:d.formatMessage({id:"overlay_button"})})]}),x.jsx(tu,{}),s,c&&x.jsxs("div",{className:"bottom",children:[x.jsx(tu,{}),x.jsx(na,{buttons:c})]}),o&&x.jsx(nu,{className:"error",children:o})]})})})},PE=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e}),Zm=e=>{const t={};return Object.keys(e).forEach(r=>{t[`${r}Slug`]=e[r]}),t};const Lr="discussion_",ku=({element:e="div",content:t,userHasPermissions:r=!0,isLoading:n=!1,originalAuthorId:i,functions:{content:{createContent:o,deleteContent:a,updateContent:s}={createContent:()=>{},deleteContent:()=>{},updateContent:()=>{}},likes:{createLike:c,deleteLike:l}={createLike:()=>{},deleteLike:()=>{}},comments:{openComments:u}={openComments:()=>{}}},links:d={},className:h,gtmContext:f="DiscussionAnswer",children:p})=>{const m=Oe(),_=U.useContext($r),S=U.useContext(yh),[v,b]=U.useState({body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1}),[T,w]=U.useState(!1),[N,R]=U.useState("");if(U.useEffect(()=>{b({...v,body:t&&t.body||"",didEdit:t&&t.isEdited||!1})},[t.isEdited]),n||!t||t.type==="answer"&&(!t.slugs||!t.slugs.question))return x.jsx(yr,{className:"discussion-card discussion-post"});const{author:L,canLike:$,createdAt:G,id:q,likes:H=0,userLiked:Y,comments:ie=0}=t,K=_&&_.id&&typeof L!="string"&&L.id&&L.id===_.id||!1,k=typeof $=="boolean"?$:r?!K:!1,Q=async X=>{X||(X=""),R("");try{if(!WN(X,v.body)){const le=t.type==="question"?{title:X}:{body:X};await s(Zm(t.slugs),le)}b({body:X,isEditing:!1,didEdit:!0})}catch{R(`${Lr}form_error`)}},ee=()=>{S&&S.updateConversation&&S.updateConversation({showThread:!0,showForm:!0}),setTimeout(()=>{const le=`reply-form-${(t.type==="answer"?t.slug:t.slugs.answer||"").toLowerCase().slice(-15)}`,de=document.getElementById(le),Ve=document.getElementById(`${le}-input`);Ve&&Ve.focus(),de&&de.scrollIntoView({behavior:"smooth"})},0)},he=()=>{try{a(Zm(t.slugs))}catch{R("delete-error")}},Z=[{text:m.formatMessage({id:`${Lr}moreMenu_report`}),href:`mailto:community@apolitical.co?subject=${encodeURI(m.formatMessage({id:`${Lr}report_subject`}))}&body=${encodeURI(m.formatMessage({id:`${Lr}report_body`},{contentType:t.type||"",contentSlug:t.slug||"",contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}))}`,icon:"flag"}];return r&&K&&Z.push({text:m.formatMessage({id:`${Lr}moreMenu_edit`}),onClick:()=>b({...v,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":f,"data-gtm-event-type":`edit-${t.type}-click`},{text:m.formatMessage({id:`${Lr}moreMenu_delete`}),onClick:X=>{X.preventDefault(),X.stopPropagation(),w(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":f,"data-gtm-event-type":`delete-${t.type}-click`,...PE(`delete-${t.slug}-modal`,T)}),U.createElement(e,{className:se("discussion-post",h),"data-testid":`discussion-${t.type}-thread`,children:x.jsxs(x.Fragment,{children:[x.jsxs("div",{id:q||t.slug,className:se("discussion-card",t.type,{editing:v.isEditing,"has-link":d.post&&!v.isEditing}),onClick:X=>{!d.post||v.isEditing||(X.preventDefault(),X.stopPropagation(),window.location.href=d.post)},children:[!v.isEditing&&x.jsx(Au,{member:L,additionalContent:{createdAt:G,didEdit:v.didEdit},className:typeof L!="string"&&L.id===i?"highlighted":"",gtmContext:f,gtmType:"profile-click"}),v.isEditing?x.jsx(mh,{content:{type:t.type,slugs:t.slugs},userHasPermissions:r,meta:{isLoading:n,isInWrapper:!0,isEditing:{text:v.body}},maxLength:t.type==="question"?250:5e4,forceShow:{error:N!==""&&N!=="delete-error"?m.formatMessage({id:N},{action:m.formatMessage({id:`discussion_action_${t.type}`})}):!1},functions:{create:o,handleSaveEdit:Q,handleCancel:()=>{R(""),b({...v,isEditing:!1})}},gtmContext:`${f}Form`}):d.post?x.jsx("a",{href:d.post,className:"gtm-trackable","data-gtm-event-context":f,"data-gtm-event-type":"title-click",children:x.jsx(sf,{options:{overrides:{a:C0}},children:v.body})}):x.jsx(sf,{options:{wrapper:t.type==="question"?"h1":U.Fragment,forceWrapper:t.type==="question",forceInline:t.type==="question",forceBlock:t.type!=="question"},children:v.body}),!v.isEditing&&x.jsxs("ul",{className:se("actions text-medium",t.type),"data-testid":`${t.type}-actions`,children:[x.jsx(AE,{element:"li",likes:H,isShort:!1,userLiked:Y,content:{type:t.type,slugs:t.slugs},canLike:k,functions:{createLike:c,deleteLike:l}}),(["question","post"].includes(t.type)||d.comments||typeof u=="function")&&x.jsxs("li",{className:"action-button",onClick:X=>{X.preventDefault(),X.stopPropagation(),d.comments&&(window.location.href=d.comments),typeof u=="function"&&u()},children:[x.jsx(ze,{variant:"tertiary",size:"medium",styling:{muted:!0},icon:{icon:"speech-bubble_square_thick"},href:d.comments?d.comments:!1,onClick:d.comments||typeof u!="function"?!1:u,className:"gtm-trackable","data-gtm-event-context":f,"data-gtm-event-type":`answer-${t.type}-click`,screenreaderText:m.formatMessage({id:`${Lr}comments_screenReader`},{count:ie})}),x.jsx("span",{children:m.formatMessage({id:`${Lr}comments`},{count:ie})})]}),(t.type==="answer"||t.type==="reply")&&x.jsx("li",{children:x.jsx(ze,{variant:"tertiary",size:"medium",styling:{muted:!0},onClick:ee,children:m.formatMessage({id:`${Lr}reply`})})}),x.jsx(fE,{element:"li",id:`more-${t.slug}`,options:Z})]})]}),p,x.jsx(RE,{id:`delete-${t.slug}-modal`,isOpen:T,functions:{onOpen:()=>{},onClose:()=>w(!1)},forceShow:{error:N==="delete-error"?m.formatMessage({id:"discussion_delete_error"},{action:m.formatMessage({id:`discussion_action_${t.type}`})}):!1},title:m.formatMessage({id:"discussion_delete_title"},{action:m.formatMessage({id:`discussion_action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>w(!1),children:m.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:he,children:m.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,children:x.jsx(ln,{id:"discussion_delete_text",values:{p:X=>x.jsx("p",{children:X}),action:m.formatMessage({id:`discussion_action_${t.type}`})}})})]})})};const Cl="discussion_responses_",zN=({type:e="answer",responses:t=0})=>{const r=Oe();return x.jsxs("div",{className:"responses-heading",children:[x.jsx("h3",{children:r.formatMessage({id:`${Cl}title`},{action:r.formatMessage({id:`${Cl}${e}`}),count:t})}),t===0&&x.jsx("p",{children:ar(r.formatMessage,`${Cl}empty`,e,e)})]})};const QN=({isOpen:e=!1,count:t=0,children:r})=>{const n=Oe(),i=U.useRef(null),[o,a]=U.useState(e),[s,c]=U.useState("closed");U.useEffect(()=>{const h=i.current;if(h)return h.addEventListener("transitionend",l),()=>{h.removeEventListener("transitionend",l)}},[]),ri(()=>{s==="closed"&&!o||c(["opening","open"].includes(s)?"ready-to-close":"opening")},[o]),U.useEffect(()=>{s==="ready-to-close"&&c("closing")},[s]);const l=({propertyName:h})=>{h==="max-height"&&c(f=>f==="opening"?"open":f==="closing"?"closed":f)},u=["opening","open"].includes(s),d=Av(r,{element:"li"});return x.jsxs("div",{className:"thread-wrapper",children:[x.jsx(ze,{variant:"secondary",size:"small",styling:{muted:!0},icon:{icon:`arrow_corner-down_${u?"left":"right"}`},onClick:()=>{a(!o)},children:n.formatMessage({id:`discussion_thread_${u?"hide":"show"}`},{count:t})}),x.jsx("ul",{ref:i,className:se("thread",s),hidden:!o,children:d})]})},YN=({user:e,content:t,verb:r="post"})=>({actor:{id:e.id,data:{name:e.name,organization:e==null?void 0:e.organization,jobTitle:e==null?void 0:e.jobTitle}},content:t,latest_reactions:{like:[]},reaction_counts:{like:0},verb:r}),KN=({queryClient:e,queryKey:t,user:r,mutationFn:n})=>({mutationFn:n,onMutate:async({content:s})=>{if(!r)return;const c=YN({user:r,content:s,verb:"post"});await e.cancelQueries({queryKey:t});const l=e.getQueryData(t);return e.setQueryData(t,u=>[...u,c]),{previousActivities:l}},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivities)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),XN=({queryClient:e,queryKey:t,mutationFn:r})=>({mutationFn:r,onMutate:async({activityId:s})=>{await e.cancelQueries({queryKey:t});const c=e.getQueryData(t),l=c==null?void 0:c.map(u=>{var d;return(u==null?void 0:u.id)===s&&((d=u.reaction_counts)!=null&&d.like?u.reaction_counts.like+=1:u.reaction_counts.like=1),u});return e.setQueryData(t,()=>l&&[...l]),{previousActivities:l}},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivities)},onSuccess:s=>{const c=e.getQueryData(t),l=c==null?void 0:c.map(u=>((u==null?void 0:u.id)===(s==null?void 0:s.activity_id)&&(u.latest_reactions.like?u.latest_reactions.like.push(s):u.latest_reactions.like=[s]),u));return e.setQueryData(t,()=>l&&[...l]),{previousActivities:c}},onSettled:(s,c,l)=>{e.invalidateQueries({queryKey:[...t,l.activityId]})}}),JN=({queryClient:e,queryKey:t,user:r,mutationFn:n})=>({mutationFn:n,onMutate:async({activityId:c})=>{await e.cancelQueries({queryKey:t});const l=e.getQueryData(t),u=l==null?void 0:l.map(d=>{var h;return(d==null?void 0:d.id)===c&&(h=d.reaction_counts)!=null&&h.like&&(d.reaction_counts.like-=1),d});return e.setQueryData(t,()=>u&&[...u]),{previousActivities:u}},onError:(c,l,u)=>{e.setQueryData(t,u.previousActivities)},onSuccess:(c,{activityId:l})=>{const u=e.getQueryData(t),d=u==null?void 0:u.map(h=>{var f,p,m,_;if(h.id===l){const S=(m=(p=(f=h.latest_reactions)==null?void 0:f.like)==null?void 0:p.find(v=>v.user_id===(r==null?void 0:r.id)))==null?void 0:m.id;return h.latest_reactions.like=(_=h.latest_reactions.like)==null?void 0:_.filter(v=>v.id!==S),h}else return h});return e.setQueryData(t,()=>d&&[...d]),{previousActivities:u}},onSettled:(c,l,u)=>{e.invalidateQueries({queryKey:[...t,u.activityId]})}}),ZN=({basePath:e,parentId:t,membershipRequiredToPost:{isMember:r,join:n,leave:i},functions:{list:o,create:a,like:s,unlike:c}})=>{const l=go(),u=U.useContext($r),{data:d,error:h,isLoading:f,isFetching:p}=W0({queryKey:[e,t],queryFn:o}),m=KN({queryClient:l,queryKey:[e,t],user:u,mutationFn:a}),{mutate:_}=fn(m),S=XN({queryClient:l,queryKey:[e,t],mutationFn:s}),{mutate:v}=fn(S),b=JN({queryClient:l,queryKey:[e,t],user:u,mutationFn:async({activityId:R})=>{var G,q,H;const L=d&&(d==null?void 0:d.find(Y=>Y.id===R)),$=(H=(q=(G=L==null?void 0:L.latest_reactions)==null?void 0:G.like)==null?void 0:q.find(Y=>Y.user_id===(u==null?void 0:u.id)))==null?void 0:H.id;await c({reactionId:$||"",activityId:R})}}),{mutate:T}=fn(b),w=U.useCallback(({activityId:R})=>v({activityId:R}),[v]),N=U.useCallback(({activityId:R})=>T({activityId:R}),[T]);return h?x.jsx(aa,{variant:"error",text:h.message}):f?x.jsx(yr,{style:{height:"400px"}}):x.jsxs(x.Fragment,{children:[x.jsx(gh,{contentType:"post",createPost:_,membershipRequiredToPost:{isMember:r,required:!0,join:n,leave:i,notMemberStateText:"Join community to create a post."}}),!p&&Array.isArray(d)&&(d==null?void 0:d.map(R=>{var L,$,G,q,H,Y,ie,K,k,Q,ee;return x.jsx(ku,{content:{type:"post",body:R==null?void 0:R.content,createdAt:(R==null?void 0:R.time)||"",slugs:{question:t},slug:R==null?void 0:R.id,author:{id:(L=R==null?void 0:R.actor)==null?void 0:L.id,name:(G=($=R==null?void 0:R.actor)==null?void 0:$.data)==null?void 0:G.name,organization:(H=(q=R==null?void 0:R.actor)==null?void 0:q.data)==null?void 0:H.organization,jobTitle:(ie=(Y=R==null?void 0:R.actor)==null?void 0:Y.data)==null?void 0:ie.jobTitle,image:{thumbnail:((k=(K=R==null?void 0:R.actor)==null?void 0:K.data)==null?void 0:k.thumbnail)||void 0}},userLiked:((Q=R==null?void 0:R.own_reactions)==null?void 0:Q.like)&&((ee=R==null?void 0:R.own_reactions)==null?void 0:ee.like.length)>0,likes:(R==null?void 0:R.reaction_counts.like)||0,comments:(R==null?void 0:R.reaction_counts.reply)||0},links:{post:`${e}/${t}/${R==null?void 0:R.id}`,comments:`${e}/${t}/${R==null?void 0:R.id}`},functions:{content:{createContent:()=>null,deleteContent:()=>null,updateContent:()=>null},likes:{createLike:()=>{w({activityId:R==null?void 0:R.id})},deleteLike:()=>{N({activityId:R==null?void 0:R.id})}},comments:{openComments:()=>null}}},R==null?void 0:R.id)}))]})},eI=({queryClient:e,queryKey:t,mutationFn:r})=>({mutationFn:r,onMutate:async()=>{await e.cancelQueries({queryKey:t})},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivity)},onSuccess:s=>{var l;const c=e.getQueryData(t);if(c)return(l=c==null?void 0:c.latest_reactions)!=null&&l.reply?(c.latest_reactions.reply.unshift(s),c&&(c.reaction_counts={reply:c.latest_reactions.reply.length})):(c.latest_reactions={reply:[s]},c.reaction_counts={reply:1}),e.setQueryData(t,()=>({...c})),{previousActivity:c}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),tI=({queryClient:e,queryKey:t,mutationFn:r})=>({mutationFn:r,onMutate:async({replyId:a})=>{var l,u;await e.cancelQueries({queryKey:t});const s=e.getQueryData(t),c=(u=(l=s==null?void 0:s.latest_reactions)==null?void 0:l.reply)==null?void 0:u.map(d=>{var h;return d.id===a&&((h=d.children_counts)!=null&&h.like?d.children_counts.like+=1:d.children_counts={like:1}),d});return e.setQueryData(t,()=>({...s,latest_reactions:{reply:c}})),{previousActivity:s}},onError:(a,s,c)=>{e.setQueryData(t,c.previousActivity)},onSuccess:a=>{var l;const s=e.getQueryData(t),c=(l=s==null?void 0:s.latest_reactions.reply)==null?void 0:l.map(u=>(u.id===a.id&&(u.latest_children.like?u.latest_children.like.push(a):u.latest_children.like=[a]),u));return e.setQueryData(t,()=>({...s,latest_reactions:{reply:c}})),{previousActivity:s}}}),rI=({queryClient:e,queryKey:t,user:r,mutationFn:n})=>({mutationFn:n,onMutate:async({replyId:s})=>{var u;await e.cancelQueries({queryKey:t});const c=e.getQueryData(t);if(!c)return;const l=(u=c.latest_reactions.reply)==null?void 0:u.map(d=>(d.id===s&&d.children_counts.like&&(d.children_counts.like-=1),d));return e.setQueryData(t,()=>({...c,latest_reactions:{reply:l}})),{previousActivity:c}},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivity)},onSuccess:(s,{replyId:c})=>{var d;const l=e.getQueryData(t);if(!l)return;const u=(d=l.latest_reactions.reply)==null?void 0:d.map(h=>{var f;return h.id===c?(f=h.latest_children.reply)==null?void 0:f.filter(m=>m.user_id!==(r==null?void 0:r.id)):h});return e.setQueryData(t,()=>({...l,latest_reactions:{reply:u}})),{previousActivity:l}}}),NE=({basePath:e,parentId:t,activityId:r,repliesList:n,membershipRequiredToPost:{isMember:i,join:o,leave:a},functions:{createReply:s,like:c,unlike:l}})=>{const u=go(),d=U.useContext($r),h=eI({queryClient:u,queryKey:[e,t,r],mutationFn:s}),{mutate:f}=fn(h),p=tI({queryClient:u,queryKey:[e,t,r],mutationFn:c}),{mutate:m}=fn(p),_=rI({queryClient:u,queryKey:[e,t,r],user:d,mutationFn:l}),{mutate:S}=fn(_),v=U.useCallback(({replyId:T})=>m({replyId:T}),[m]),b=U.useCallback(({replyId:T})=>S({replyId:T}),[S]);return x.jsxs(x.Fragment,{children:[x.jsx(gh,{contentType:"post",createPost:f,membershipRequiredToPost:{isMember:i,required:!0,join:o,leave:a,notMemberStateText:"Join community to create a post."}}),(n==null?void 0:n.length)===0||(n==null?void 0:n.map(T=>{var N,R,L,$,G,q,H,Y,ie,K,k,Q,ee,he,Z,X;const w=((N=T==null?void 0:T.latest_children)==null?void 0:N.like)&&((R=T==null?void 0:T.latest_children)==null?void 0:R.like.filter(le=>le.user_id===(d==null?void 0:d.id)));return x.jsx(ku,{content:{type:"post",body:typeof T.data.content=="string"?(L=T==null?void 0:T.data)==null?void 0:L.content:((G=($=T==null?void 0:T.data)==null?void 0:$.content)==null?void 0:G.text)||"",createdAt:T==null?void 0:T.created_at,slugs:{question:`${e}/${t}/${r}`,reply:T==null?void 0:T.id},slug:`${e}/${t}/${r}#${T==null?void 0:T.id}`,author:{id:(q=T==null?void 0:T.user)==null?void 0:q.id,name:(Y=(H=T==null?void 0:T.user)==null?void 0:H.data)==null?void 0:Y.name,organization:(K=(ie=T==null?void 0:T.user)==null?void 0:ie.data)==null?void 0:K.organization,jobTitle:(Q=(k=T==null?void 0:T.user)==null?void 0:k.data)==null?void 0:Q.jobTitle,image:{thumbnail:((he=(ee=T==null?void 0:T.user)==null?void 0:ee.data)==null?void 0:he.thumbnail)||void 0}},userLiked:!!(w!=null&&w.length),likes:((Z=T==null?void 0:T.children_counts)==null?void 0:Z.like)||0,comments:((X=T==null?void 0:T.children_counts)==null?void 0:X.reply)||0},functions:{content:{createContent:()=>console.log("create"),deleteContent:()=>console.log("delete"),updateContent:()=>console.log("update")},likes:{createLike:()=>v({replyId:T==null?void 0:T.id}),deleteLike:()=>b({replyId:T==null?void 0:T.id})},comments:{openComments:()=>{}}}},T==null?void 0:T.id)}))]})},nI=({queryClient:e,queryKey:t,mutationFn:r})=>({mutationFn:r,onMutate:async()=>{var c;await e.cancelQueries({queryKey:t});const s=e.getQueryData(t);return(c=s==null?void 0:s.reaction_counts)!=null&&c.like?s.reaction_counts.like+=1:s&&(s.reaction_counts={like:1}),e.setQueryData(t,()=>({...s})),{previousActivity:s}},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivity)},onSuccess:s=>{const c=e.getQueryData(t);return c!=null&&c.latest_reactions.like?c.latest_reactions.like.push(s):c&&(c.latest_reactions={like:[s]}),e.setQueryData(t,()=>({...c})),{previousActivity:c}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),iI=({queryClient:e,queryKey:t,user:r,activity:n,mutationFn:i})=>({mutationFn:i,onMutate:async()=>{var u;await e.cancelQueries({queryKey:t});const l=e.getQueryData(t);return(u=l==null?void 0:l.reaction_counts)!=null&&u.like&&l.reaction_counts.like>0&&(l.reaction_counts.like-=1),e.setQueryData(t,()=>({...l})),{previousActivity:l}},onError:(l,u,d)=>{e.setQueryData(t,d.previousActivity)},onSuccess:()=>{var d,h,f;if(!n)return;const l=(f=(h=(d=n.latest_reactions)==null?void 0:d.like)==null?void 0:h.find(p=>p.user_id===(r==null?void 0:r.id)))==null?void 0:f.id,u=e.getQueryData(t);if(u!=null&&u.latest_reactions.like)return u.latest_reactions.like=u.latest_reactions.like.filter(p=>p.id!==l),e.setQueryData(t,()=>({...u})),{previousActivity:u}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),oI=({basePath:e,parentId:t,activityId:r,membershipRequiredToPost:n,functions:{get:i,likeActivity:o,unlikeActivity:a,createReply:s,likeReply:c,unlikeReply:l}})=>{var N,R,L,$,G,q,H,Y,ie,K;const u=U.useContext($r),d=go(),{data:h,error:f,isLoading:p,isFetching:m}=W0({queryKey:[e,t,r],queryFn:i}),_=nI({queryClient:d,queryKey:[e,t,r],mutationFn:o}),{mutate:S}=fn(_),v=iI({queryClient:d,queryKey:[e,t,r],user:u,mutationFn:async()=>{var Q,ee,he;const k=(he=(ee=(Q=h==null?void 0:h.latest_reactions)==null?void 0:Q.like)==null?void 0:ee.find(Z=>Z.user_id===(u==null?void 0:u.id)))==null?void 0:he.id;await a({activityId:r,reactionId:k})},activity:h}),{mutate:b}=fn(v),T=U.useCallback(({activityId:k})=>S({activityId:k}),[S]),w=U.useCallback(async({activityId:k})=>b({activityId:k}),[b]);return f?x.jsx(aa,{variant:"error",text:f.message}):p||m?x.jsx(yr,{style:{height:"400px"}}):x.jsx(ku,{content:{type:"post",body:h==null?void 0:h.content,createdAt:(h==null?void 0:h.time)||"",slugs:{question:`${t}/${r}`},slug:r,author:{id:(N=h==null?void 0:h.actor)==null?void 0:N.id,name:(R=h==null?void 0:h.actor)==null?void 0:R.data.name,organization:(L=h==null?void 0:h.actor)==null?void 0:L.data.organization,jobTitle:($=h==null?void 0:h.actor)==null?void 0:$.data.jobTitle,image:{thumbnail:((G=h==null?void 0:h.actor)==null?void 0:G.data.thumbnail)||void 0}},userLiked:((q=h==null?void 0:h.own_reactions)==null?void 0:q.like)&&((H=h==null?void 0:h.own_reactions)==null?void 0:H.like.length)>0,likes:h&&(h==null?void 0:h.reaction_counts.like),comments:h&&(h==null?void 0:h.reaction_counts.reply)},originalAuthorId:(Y=h==null?void 0:h.actor)==null?void 0:Y.id,functions:{content:{createContent:()=>console.log("create"),deleteContent:()=>console.log("delete"),updateContent:()=>console.log("update")},likes:{createLike:()=>T({activityId:r}),deleteLike:()=>w({activityId:r})},comments:{openComments:()=>{}}},children:x.jsxs(x.Fragment,{children:[x.jsxs("h3",{children:["Comments (",((ie=h==null?void 0:h.reaction_counts)==null?void 0:ie.reply)||0,")"]}),x.jsx(NE,{basePath:e,parentId:t,activityId:r,repliesList:(K=h==null?void 0:h.latest_reactions)==null?void 0:K.reply,membershipRequiredToPost:n,functions:{createReply:s,like:c,unlike:l}})]})},r)},sI=({id:e,data:{jobTitle:t,name:r,organization:n,thumbnail:i}})=>({id:e,name:r,jobTitle:t,organization:n,image:{thumbnail:i}});exports.$PROXY=Is;exports.$TRACK=nh;exports.ASSETS_BUCKET=ru;exports.ActivitiesFeed=ZN;exports.ActivitySection=oI;exports.AddPost=gh;exports.Breadcrumbs=uP;exports.Button=ze;exports.ButtonWrapper=na;exports.CollapsibleSection=Xf;exports.Columns=dP;exports.CommunityDetails=aP;exports.Contributors=k0;exports.Conversation=HN;exports.ConversationContext=yh;exports.CookieBanner=hE;exports.Divider=tu;exports.DownloadSection=ZA;exports.Dynamic=rP;exports.EMAILS=Ni;exports.EmailHelperTextBox=pP;exports.EmptyStateBox=aa;exports.Filters=cP;exports.Footer=ch;exports.For=CR;exports.Form=mh;exports.FullWidthSection=Yf;exports.Header=ph;exports.HelperTextBox=A0;exports.HiddenFromScreenReaders=Of;exports.HideShowTextBox=l1;exports.HighlightedTextBoxWrapper=Br;exports.Index=RR;exports.IntlProvider=S1;exports.JoinButton=ah;exports.LanguageSwitcher=fP;exports.Likes=AE;exports.Link=ia;exports.LoadMore=lE;exports.LoadingPlaceholder=yr;exports.LoadingState=I0;exports.Logo=uh;exports.LogoSection=eC;exports.MarkdownText=sf;exports.MarketingBlock=iC;exports.Match=IR;exports.Member=Au;exports.MembersList=TN;exports.Modal=CE;exports.MoreMenu=fE;exports.NUMBER_OF_USERS=sC;exports.Overlay=RE;exports.PageLayout=bN;exports.Pill=R0;exports.Portal=tP;exports.Post=ku;exports.ProfilePicture=Ou;exports.ProgressBar=P0;exports.Rating=vP;exports.ReactQueryProvider=sP;exports.RepliesFeed=NE;exports.ResponsesHeading=zN;exports.ResponsiveImage=Cv;exports.SearchForm=gE;exports.Show=PR;exports.Span=C0;exports.StatusBanner=nu;exports.Switch=NR;exports.Tags=SN;exports.Thread=QN;exports.Tooltip=o0;exports.UserContext=$r;exports.UserProvider=T1;exports.VisuallyHidden=lt;exports.addAriaProps=PE;exports.addEventListener=aE;exports.bannerSection=nC;exports.batch=uR;exports.children=oh;exports.className=sE;exports.createComponent=tE;exports.createComputed=_f;exports.createContext=mR;exports.createEffect=ih;exports.createMemo=St;exports.createRenderEffect=dn;exports.createRoot=hn;exports.createSignal=bt;exports.createUniqueId=AR;exports.delegateEvents=oE;exports.getListener=fR;exports.getMember=eh;exports.headerData=Ms;exports.insert=hu;exports.loadingBlock=_1;exports.mapGetSteamData=sI;exports.mergeProps=rE;exports.on=cR;exports.onCleanup=Ls;exports.onMount=lR;exports.passwordRules=yP;exports.setAttribute=fu;exports.splitProps=nE;exports.spread=uE;exports.template=GR;exports.untrack=Xe;exports.use=QR;exports.useContext=gR;exports.useCurrentPath=hg;exports.useEffectAfterMount=ri;exports.useFeatureFlag=px;exports.useScreenWidth=ra;exports.useScrollListener=gv;exports.useScrollToHash=gx;exports.useTransition=pR;
|
|
101
|
+
`))},[n]),U.useEffect(()=>{l==="ready-to-close"&&u("closing")},[l]);const d=({propertyName:f})=>{f==="max-height"&&u(p=>p==="opening"?"open":p==="closing"?"closed":p)};if(!n)return null;const h=["opening","open"].includes(l);return x.jsxs(Br,{variant:"subtle",className:se("hide-show-text-box",e),children:[x.jsxs("div",{ref:a,className:se("content",l),children:[x.jsx(xu,{options:{forceBlock:!0},children:l==="closed"?s:n}),l!=="closed"&&i]}),x.jsx("p",{className:"cta",children:x.jsx(ze,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:se({"rotate-180":h}),onClick:()=>{u(h?"ready-to-close":"opening")},children:h?r||o.formatMessage({id:"hideShowTextBox_hide"}):t||o.formatMessage({id:"hideShowTextBox_show"})})})]})},f1=()=>U.Fragment,h1=({children:e})=>x.jsx(Br,{variant:"secondary",children:e}),d1=["span","strong","h1","h2","h3","h4","h5","h6","p"],p1=({children:e})=>{const t=Oe();if(!e)return null;let r=t.formatMessage({id:"markdown_collapsibleSection_summary"});const n=[];for(const o of U.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number"))if(U.isValidElement(o)&&o.type==="summary"){if(o.props&&o.props.children){for(const a of U.Children.toArray(o.props.children))if(!(!a||typeof a=="string"||typeof a=="number")&&U.isValidElement(a)){const s=a.type;if(d1.includes(s)){for(r=a.props.children;typeof r!="string"&&(Array.isArray(r)&&r[0].props&&r[0].props.children&&r[0].props.children[0]);)r=r[0].props.children[0];break}}}}else n.push(o);const i=r?r.toString():"";return x.jsx(Xf,{label:i,className:["Sources","Resources"].includes(i)?"discrete-links":"",children:n.map(o=>o)})},m1=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return x.jsx(Br,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return x.jsx(Br,{variant:"primary",children:e});case"pink-textbox":return x.jsx(Br,{variant:"tertiary",children:e});default:return x.jsx("div",{...t,children:e})}return x.jsx("div",{...t,children:e})},g1=e=>{const t=Oe(),r=Date.now().toString();let n="default";const i=e.src;return i.includes("youtube")||i.includes("vimeo")?n="video":i.includes("riddle")||i.includes("sli.do")?n="poll":i.includes("padlet")&&(n="padlet"),x.jsxs(x.Fragment,{children:[x.jsx(lt,{children:x.jsx("a",{href:`#content-after-iframe-${r}`,children:t.formatMessage({id:`markdown_skip${n==="default"?"":`_${n}`}`})})}),x.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${n==="default"?"":`_${n}`}`})}),x.jsx("span",{id:`content-after-iframe-${r}`,tabIndex:-1})]})},Om=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},y1=({children:e,...t})=>{let r={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(r.target="_blank");let n=e,i=!1;for(const o of U.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number")&&U.isValidElement(o)){const a=o.type;if(["button","center","span","strong"].includes(a)&&o.props&&o.props.children&&o.props.children[0])for((a==="button"||Om(o.props.children[0])==="button")&&(i=!0),n=o.props.children[0];n&&typeof n!="string"&&!(typeof n=="boolean"||typeof n=="number"||!U.isValidElement(n));)if(n.props&&n.props.children&&n.props.children[0])n=n.props.children[0],n&&Om(n)==="button"&&(i=!0);else break}return i?(r={...r,className:"button primary medium"},x.jsx("p",{className:"center",children:x.jsx(ze,{variant:"primary",size:"medium",...r,children:n})})):x.jsx("a",{...r,children:n})},C0=({children:e})=>x.jsx("span",{children:e});const sf=({className:e="",options:t={},children:r})=>{r=r.replace(/^<br\/?>/,"");const n={wrapper:U.Fragment,forceBlock:!0,overrides:{a:y1,CollapsibleSection:Xf,TextBox:Br,CaseStudy:h1,style:f1,details:p1,div:m1,iframe:g1}};return x.jsx("div",{className:se("markdown-text",e),children:x.jsx(xu,{options:{...n,...t},children:r})})};const R0=({size:e="medium",variant:t="default",className:r="",children:n})=>x.jsx("span",{className:se("pill",e,t,r),children:n});const nu=({element:e="p",children:t=null,className:r="",...n})=>U.createElement(e,{...n,className:se("status-banner text-small",r),"aria-live":"assertive"},t);const v1=({progress:e=0,text:t=!1,className:r=""})=>{const n=Oe(),i=e>75?100:e>50?75:e>25?50:e>5?25:0,o={"--progress":`${e}%`};return x.jsx("span",{className:se(`progress-bar section-${i}`,r),style:o,children:x.jsx(lt,{children:t?`${e} ${t}`:n.formatMessage({id:"progressBar"},{number:e})})})},P0=U.memo(v1);const fl="loadingBlock_",E1=({progress:e=0,steps:t=!1,className:r=""})=>{const n=Oe();t||(t={0:{text:n.formatMessage({id:`${fl}loading`})},75:{text:n.formatMessage({id:`${fl}almostDone`})},100:{text:n.formatMessage({id:`${fl}complete`})}});let i=null;const o=Object.keys(t);for(let s=0;s<o.length&&!(e<parseInt(o[s]));s++)i=o[s];const a=i&&t[i].icon?{"--icon":`url(${ru}icons/${t[i].icon}.svg)`}:{};return x.jsxs(Br,{className:se("loading-block",r,{"has-icon":i&&t[i].icon}),variant:"subtle",style:a,children:[i&&x.jsx("span",{className:"step",children:t[i].text}),x.jsx(P0,{progress:e})]})},_1=U.memo(E1);const yr=({element:e="div",className:t="",...r})=>x.jsx(Of,{element:e,className:se("loading-placeholder",t),...r});const af={header:["logo","link","link","search"],sidebar:["text","text","text","text","text"],"cards-section":["subtitle","cards"],cards:["card","card","card","card"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"]},N0=(e,t)=>e in af?x.jsx("div",{className:e,children:af[e].map((r,n)=>N0(r,n))},t):x.jsx(yr,{className:e},t),I0=({layout:e="overview-page"})=>x.jsx("div",{className:se("loading-state",e),children:af[e].map((t,r)=>N0(t,r))}),L0=e=>{const t=e&&e.toUpperCase().split(" ");return Array.isArray(t)&&t.length>1&&t[0]!==""?t[1]===""?t[0][0]:t[0][0]+t[t.length-1][0]:e?e.substr(0,1):""},ka=["#5AB6A3","#A2D7AF","#806056","#3962B3"],b1=e=>{const t=Math.ceil(26/ka.length),r=L0(e).toLowerCase();if(r==="")return ka[0];const n=r.charCodeAt(0)-96;for(let i=0;i<ka.length;i++)if(n<=t*(i+1))return ka[i]};const Am=256,Ou=({className:e="",src:t="",name:r,alt:n,width:i=Am,height:o=Am,...a})=>{const[s,c]=U.useState(!1),l=U.useRef(null);U.useEffect(()=>{const d=l.current;if(!d)return;const h=d.getContext("2d");if(!h)return;const f=i,p=o;typeof window<"u"&&window.devicePixelRatio&&(d.width=f*window.devicePixelRatio,d.height=p*window.devicePixelRatio,h.scale(window.devicePixelRatio,window.devicePixelRatio)),h.fillStyle=b1(r),h.fillRect(0,0,f,p),h.font=`${f/3}px Arial`,h.textAlign="center",h.fillStyle="white",h.fillText(L0(r),f/2,p/1.6)},[r]);let u=!1;return t&&t!==""&&!s&&(t.includes("http")||t.includes("//"))&&(u=!0),x.jsx("figure",{className:se("profile-picture",e,{error:s}),...a,children:u?x.jsx("img",{src:t,alt:n||r,onError:()=>{c(!0)},width:i,height:o}):x.jsx("canvas",{ref:l})})},eh=e=>e==="apolitical"?{image:`${ru}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${ru}logos/member_community.svg`}:{name:e.name,role:e.jobTitle||"",organisation:e.organization||"",country:e.location&&e.location.country||"",url:`/profiles/${e.id}`,image:e.image&&e.image.thumbnail},w1=({role:e="",organisation:t="",country:r="",maximumCharacters:n=80})=>{const i=e!=="",o=t!=="",a=r!=="";if(!i&&!o&&!a)return"";const s=`${e}${i&&o?` — ${t}`:t}`;let c=`${s}${(i||o)&&a?`, ${r}`:r}`;return c.length>n&&(c=s),c.length>n&&(c=Kf(c,n)),c};const Au=({element:e="div",member:t="community",additionalContent:r=!1,gtmContext:n="member",gtmType:i="member-click",className:o=""})=>{const a=Oe(),s=eh(t);s.name||(s.name=a.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:c,url:l,image:u}=s,d=w1(s),h=r&&r.createdAt?wO(r.createdAt):!1,f=r&&r.createdAt?bO(r.createdAt):"";return U.createElement(e,{className:se("member text-medium",o),children:x.jsxs(ia,{href:l,gtmType:i,gtmContext:n,onClick:p=>{p==null||p.stopPropagation()},children:[x.jsx(Ou,{name:c,src:u}),x.jsxs("p",{className:"details",children:[x.jsx("strong",{children:c}),r&&x.jsxs("span",{className:"additional-content",children:[r.createdAt&&h&&x.jsx("span",{className:"date",title:f,"aria-label":f,children:a.formatMessage({id:`dates_${h.path}`},{number:h.number})}),r.didEdit&&x.jsx("em",{children:a.formatMessage({id:"discussion_edited"})})]}),d&&x.jsx("small",{children:d})]})]})})};const Cm={small:24,medium:48},k0=({element:e="div",contributors:{total:t,data:r}={total:void 0,data:[]},styling:{showText:n,size:i,showGap:o,showPlaceholders:a}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:s=2,className:c=""})=>{const l=Oe();return!r||r.length===0?null:U.createElement(e,{className:se("contributors",c,i,{"has-gap":o}),children:x.jsxs(x.Fragment,{children:[x.jsx("ul",{children:r.map((u,d)=>{let h,f="";if(d<s){const{name:p="",image:m=""}=eh(u);if(a)return x.jsx(yr,{element:"li",className:"contributor"},d);h=x.jsx(Ou,{name:p,src:m,width:Cm[i||"medium"],height:Cm[i||"medium"]})}else if(d===s){const p=(t||r.length)-s;h=x.jsxs("small",{className:se({"large-number":p>99}),children:["+",CO(p,0)]}),f="number-left"}return h?x.jsx("li",{className:se("contributor",f),children:h},d):null})}),n&&x.jsx("span",{className:"label",children:typeof n=="string"?n:r.length===1?typeof r[0]=="string"?l.formatMessage({id:`member_${r[0]}`}):Kf(r[0].name||"",20):null})]})})},S1=({children:e,locale:t,messages:r})=>{const n=t||"en",i={...AO[n],...r||{}};return x.jsx(XA,{locale:n,messages:i,children:e})},$r=U.createContext(null),T1=({children:e,user:t})=>x.jsx($r.Provider,{value:t,children:e});var mo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ao=typeof window>"u"||"Deno"in window;function jt(){}function x1(e,t){return typeof e=="function"?e(t):e}function uf(e){return typeof e=="number"&&e>=0&&e!==1/0}function M0(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Rm(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(n){if(t.queryHash!==th(a,t.options))return!1}else if(!Ps(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Pm(e,t){const{exact:r,status:n,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(Rs(t.options.mutationKey)!==Rs(o))return!1}else if(!Ps(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function th(e,t){return((t==null?void 0:t.queryKeyHashFn)||Rs)(e)}function Rs(e){return JSON.stringify(e,(t,r)=>cf(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Ps(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!Ps(e[r],t[r])):!1}function F0(e,t){if(e===t)return e;const r=Nm(e)&&Nm(t);if(r||cf(e)&&cf(t)){const n=r?e.length:Object.keys(e).length,i=r?t:Object.keys(t),o=i.length,a=r?[]:{};let s=0;for(let c=0;c<o;c++){const l=r?c:i[c];a[l]=F0(e[l],t[l]),a[l]===e[l]&&s++}return n===o&&s===n?e:a}return t}function iu(e,t){if(e&&!t||t&&!e)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Nm(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cf(e){if(!Im(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const r=t.prototype;return!(!Im(r)||!r.hasOwnProperty("isPrototypeOf"))}function Im(e){return Object.prototype.toString.call(e)==="[object Object]"}function D0(e){return new Promise(t=>{setTimeout(t,e)})}function Lm(e){D0(0).then(e)}function lf(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?F0(e,t):t}function O1(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function A1(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Gn,en,ki,eg,C1=(eg=class extends mo{constructor(){super();ne(this,Gn,void 0);ne(this,en,void 0);ne(this,ki,void 0);J(this,ki,t=>{if(!ao&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){P(this,en)||this.setEventListener(P(this,ki))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,en))==null||t.call(this),J(this,en,void 0))}setEventListener(t){var r;J(this,ki,t),(r=P(this,en))==null||r.call(this),J(this,en,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){P(this,Gn)!==t&&(J(this,Gn,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof P(this,Gn)=="boolean"?P(this,Gn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Gn=new WeakMap,en=new WeakMap,ki=new WeakMap,eg),ou=new C1,Mi,tn,Fi,tg,R1=(tg=class extends mo{constructor(){super();ne(this,Mi,!0);ne(this,tn,void 0);ne(this,Fi,void 0);J(this,Fi,t=>{if(!ao&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){P(this,tn)||this.setEventListener(P(this,Fi))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,tn))==null||t.call(this),J(this,tn,void 0))}setEventListener(t){var r;J(this,Fi,t),(r=P(this,tn))==null||r.call(this),J(this,tn,t(this.setOnline.bind(this)))}setOnline(t){P(this,Mi)!==t&&(J(this,Mi,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return P(this,Mi)}},Mi=new WeakMap,tn=new WeakMap,Fi=new WeakMap,tg),Ns=new R1;function P1(e){return Math.min(1e3*2**e,3e4)}function Cu(e){return(e??"online")==="online"?Ns.isOnline():!0}var B0=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function hl(e){return e instanceof B0}function U0(e){let t=!1,r=0,n=!1,i,o,a;const s=new Promise((_,S)=>{o=_,a=S}),c=_=>{var S;n||(f(new B0(_)),(S=e.abort)==null||S.call(e))},l=()=>{t=!0},u=()=>{t=!1},d=()=>!ou.isFocused()||e.networkMode!=="always"&&!Ns.isOnline(),h=_=>{var S;n||(n=!0,(S=e.onSuccess)==null||S.call(e,_),i==null||i(),o(_))},f=_=>{var S;n||(n=!0,(S=e.onError)==null||S.call(e,_),i==null||i(),a(_))},p=()=>new Promise(_=>{var S;i=v=>{const b=n||!d();return b&&_(v),b},(S=e.onPause)==null||S.call(e)}).then(()=>{var _;i=void 0,n||(_=e.onContinue)==null||_.call(e)}),m=()=>{if(n)return;let _;try{_=e.fn()}catch(S){_=Promise.reject(S)}Promise.resolve(_).then(h).catch(S=>{var N;if(n)return;const v=e.retry??(ao?0:3),b=e.retryDelay??P1,T=typeof b=="function"?b(r,S):b,w=v===!0||typeof v=="number"&&r<v||typeof v=="function"&&v(r,S);if(t||!w){f(S);return}r++,(N=e.onFail)==null||N.call(e,r,S),D0(T).then(()=>{if(d())return p()}).then(()=>{t?f(S):m()})})};return Cu(e.networkMode)?m():p().then(m),{promise:s,cancel:c,continue:()=>(i==null?void 0:i())?s:Promise.resolve(),cancelRetry:l,continueRetry:u}}function N1(){let e=[],t=0,r=u=>{u()},n=u=>{u()};const i=u=>{let d;t++;try{d=u()}finally{t--,t||s()}return d},o=u=>{t?e.push(u):Lm(()=>{r(u)})},a=u=>(...d)=>{o(()=>{u(...d)})},s=()=>{const u=e;e=[],u.length&&Lm(()=>{n(()=>{u.forEach(d=>{r(d)})})})};return{batch:i,batchCalls:a,schedule:o,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u}}}var Ke=N1(),Vn,rg,$0=(rg=class{constructor(){ne(this,Vn,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uf(this.gcTime)&&J(this,Vn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ao?1/0:5*60*1e3))}clearGcTimeout(){P(this,Vn)&&(clearTimeout(P(this,Vn)),J(this,Vn,void 0))}},Vn=new WeakMap,rg),Di,Bi,Dt,rn,Bt,it,Fs,Wn,Ui,Va,Zt,kr,ng,I1=(ng=class extends $0{constructor(t){super();ne(this,Ui);ne(this,Zt);ne(this,Di,void 0);ne(this,Bi,void 0);ne(this,Dt,void 0);ne(this,rn,void 0);ne(this,Bt,void 0);ne(this,it,void 0);ne(this,Fs,void 0);ne(this,Wn,void 0);J(this,Wn,!1),J(this,Fs,t.defaultOptions),ye(this,Ui,Va).call(this,t.options),J(this,it,[]),J(this,Dt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,J(this,Di,t.state||L1(this.options)),this.state=P(this,Di),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!P(this,it).length&&this.state.fetchStatus==="idle"&&P(this,Dt).remove(this)}setData(t,r){const n=lf(this.state.data,t,this.options);return ye(this,Zt,kr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){ye(this,Zt,kr).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n;const r=P(this,rn);return(n=P(this,Bt))==null||n.cancel(t),r?r.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,Di))}isActive(){return P(this,it).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||P(this,it).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!M0(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=P(this,it).find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=P(this,Bt))==null||r.continue()}onOnline(){var r;const t=P(this,it).find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=P(this,Bt))==null||r.continue()}addObserver(t){P(this,it).includes(t)||(P(this,it).push(t),this.clearGcTimeout(),P(this,Dt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){P(this,it).includes(t)&&(J(this,it,P(this,it).filter(r=>r!==t)),P(this,it).length||(P(this,Bt)&&(P(this,Wn)?P(this,Bt).cancel({revert:!0}):P(this,Bt).cancelRetry()),this.scheduleGc()),P(this,Dt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return P(this,it).length}invalidate(){this.state.isInvalidated||ye(this,Zt,kr).call(this,{type:"invalidate"})}fetch(t,r){var l,u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(P(this,rn))return(l=P(this,Bt))==null||l.continueRetry(),P(this,rn)}if(t&&ye(this,Ui,Va).call(this,t),!this.options.queryFn){const f=P(this,it).find(p=>p.options.queryFn);f&&ye(this,Ui,Va).call(this,f.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,i={queryKey:this.queryKey,meta:this.meta},o=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(J(this,Wn,!0),n.signal)})};o(i);const a=()=>this.options.queryFn?(J(this,Wn,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),s={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};o(s),(u=this.options.behavior)==null||u.onFetch(s,this),J(this,Bi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=s.fetchOptions)==null?void 0:d.meta))&&ye(this,Zt,kr).call(this,{type:"fetch",meta:(h=s.fetchOptions)==null?void 0:h.meta});const c=f=>{var p,m,_,S;hl(f)&&f.silent||ye(this,Zt,kr).call(this,{type:"error",error:f}),hl(f)||((m=(p=P(this,Dt).config).onError)==null||m.call(p,f,this),(S=(_=P(this,Dt).config).onSettled)==null||S.call(_,this.state.data,f,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return J(this,Bt,U0({fn:s.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var p,m,_,S;if(typeof f>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),c(new Error(`${this.queryHash} data is undefined`));return}this.setData(f),(m=(p=P(this,Dt).config).onSuccess)==null||m.call(p,f,this),(S=(_=P(this,Dt).config).onSettled)==null||S.call(_,f,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:c,onFail:(f,p)=>{ye(this,Zt,kr).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{ye(this,Zt,kr).call(this,{type:"pause"})},onContinue:()=>{ye(this,Zt,kr).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode})),J(this,rn,P(this,Bt).promise),P(this,rn)}},Di=new WeakMap,Bi=new WeakMap,Dt=new WeakMap,rn=new WeakMap,Bt=new WeakMap,it=new WeakMap,Fs=new WeakMap,Wn=new WeakMap,Ui=new WeakSet,Va=function(t){this.options={...P(this,Fs),...t},this.updateGcTime(this.options.gcTime)},Zt=new WeakSet,kr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:Cu(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return hl(i)&&i.revert&&P(this,Bi)?{...P(this,Bi),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Ke.batch(()=>{P(this,it).forEach(n=>{n.onQueryUpdate()}),P(this,Dt).notify({query:this,type:"updated",action:t})})},ng);function L1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=typeof t<"u",n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var lr,ig,k1=(ig=class extends mo{constructor(t={}){super();ne(this,lr,void 0);this.config=t,J(this,lr,new Map)}build(t,r,n){const i=r.queryKey,o=r.queryHash??th(i,r);let a=this.get(o);return a||(a=new I1({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){P(this,lr).has(t.queryHash)||(P(this,lr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=P(this,lr).get(t.queryHash);r&&(t.destroy(),r===t&&P(this,lr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,lr).get(t)}getAll(){return[...P(this,lr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Rm(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Rm(t,n)):r}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},lr=new WeakMap,ig),fr,Ds,Lt,$i,hr,Jr,og,M1=(og=class extends $0{constructor(t){super();ne(this,hr);ne(this,fr,void 0);ne(this,Ds,void 0);ne(this,Lt,void 0);ne(this,$i,void 0);this.mutationId=t.mutationId,J(this,Ds,t.defaultOptions),J(this,Lt,t.mutationCache),J(this,fr,[]),this.state=t.state||j0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...P(this,Ds),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,fr).includes(t)||(P(this,fr).push(t),this.clearGcTimeout(),P(this,Lt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){J(this,fr,P(this,fr).filter(r=>r!==t)),this.scheduleGc(),P(this,Lt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,fr).length||(this.state.status==="pending"?this.scheduleGc():P(this,Lt).remove(this))}continue(){var t;return((t=P(this,$i))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,a,s,c,l,u,d,h,f,p,m,_,S,v,b,T,w,N,R;const r=()=>(J(this,$i,U0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(L,$)=>{ye(this,hr,Jr).call(this,{type:"failed",failureCount:L,error:$})},onPause:()=>{ye(this,hr,Jr).call(this,{type:"pause"})},onContinue:()=>{ye(this,hr,Jr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),P(this,$i).promise),n=this.state.status==="pending";try{if(!n){ye(this,hr,Jr).call(this,{type:"pending",variables:t}),await((o=(i=P(this,Lt).config).onMutate)==null?void 0:o.call(i,t,this));const $=await((s=(a=this.options).onMutate)==null?void 0:s.call(a,t));$!==this.state.context&&ye(this,hr,Jr).call(this,{type:"pending",context:$,variables:t})}const L=await r();return await((l=(c=P(this,Lt).config).onSuccess)==null?void 0:l.call(c,L,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,L,t,this.state.context)),await((f=(h=P(this,Lt).config).onSettled)==null?void 0:f.call(h,L,null,this.state.variables,this.state.context,this)),await((m=(p=this.options).onSettled)==null?void 0:m.call(p,L,null,t,this.state.context)),ye(this,hr,Jr).call(this,{type:"success",data:L}),L}catch(L){try{throw await((S=(_=P(this,Lt).config).onError)==null?void 0:S.call(_,L,t,this.state.context,this)),await((b=(v=this.options).onError)==null?void 0:b.call(v,L,t,this.state.context)),await((w=(T=P(this,Lt).config).onSettled)==null?void 0:w.call(T,void 0,L,this.state.variables,this.state.context,this)),await((R=(N=this.options).onSettled)==null?void 0:R.call(N,void 0,L,t,this.state.context)),L}finally{ye(this,hr,Jr).call(this,{type:"error",error:L})}}}},fr=new WeakMap,Ds=new WeakMap,Lt=new WeakMap,$i=new WeakMap,hr=new WeakSet,Jr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Cu(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ke.batch(()=>{P(this,fr).forEach(n=>{n.onMutationUpdate(t)}),P(this,Lt).notify({mutation:this,type:"updated",action:t})})},og);function j0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ut,Bs,zn,sg,F1=(sg=class extends mo{constructor(t={}){super();ne(this,Ut,void 0);ne(this,Bs,void 0);ne(this,zn,void 0);this.config=t,J(this,Ut,[]),J(this,Bs,0)}build(t,r,n){const i=new M1({mutationCache:this,mutationId:++la(this,Bs)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){P(this,Ut).push(t),this.notify({type:"added",mutation:t})}remove(t){J(this,Ut,P(this,Ut).filter(r=>r!==t)),this.notify({type:"removed",mutation:t})}clear(){Ke.batch(()=>{P(this,Ut).forEach(t=>{this.remove(t)})})}getAll(){return P(this,Ut)}find(t){const r={exact:!0,...t};return P(this,Ut).find(n=>Pm(r,n))}findAll(t={}){return P(this,Ut).filter(r=>Pm(t,r))}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){return J(this,zn,(P(this,zn)??Promise.resolve()).then(()=>{const t=P(this,Ut).filter(r=>r.state.isPaused);return Ke.batch(()=>t.reduce((r,n)=>r.then(()=>n.continue().catch(jt)),Promise.resolve()))}).then(()=>{J(this,zn,void 0)})),P(this,zn)}},Ut=new WeakMap,Bs=new WeakMap,zn=new WeakMap,sg);function D1(e){return{onFetch:(t,r)=>{const n=async()=>{var p,m,_,S,v;const i=t.options,o=(_=(m=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:m.fetchMore)==null?void 0:_.direction,a=((S=t.state.data)==null?void 0:S.pages)||[],s=((v=t.state.data)==null?void 0:v.pageParams)||[],c={pages:[],pageParams:[]};let l=!1;const u=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?l=!0:t.signal.addEventListener("abort",()=>{l=!0}),t.signal)})},d=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),h=async(b,T,w)=>{if(l)return Promise.reject();if(T==null&&b.pages.length)return Promise.resolve(b);const N={queryKey:t.queryKey,pageParam:T,direction:w?"backward":"forward",meta:t.options.meta};u(N);const R=await d(N),{maxPages:L}=t.options,$=w?A1:O1;return{pages:$(b.pages,R,L),pageParams:$(b.pageParams,T,L)}};let f;if(o&&a.length){const b=o==="backward",T=b?B1:km,w={pages:a,pageParams:s},N=T(i,w);f=await h(w,N,b)}else{f=await h(c,s[0]??i.initialPageParam);const b=e??a.length;for(let T=1;T<b;T++){const w=km(i,f);f=await h(f,w)}}return f};t.options.persister?t.fetchFn=()=>{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,n,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=n}}}function km(e,{pages:t,pageParams:r}){const n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function B1(e,{pages:t,pageParams:r}){var n;return(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r)}var Ye,nn,on,ji,Hi,sn,qi,Gi,ag,U1=(ag=class{constructor(e={}){ne(this,Ye,void 0);ne(this,nn,void 0);ne(this,on,void 0);ne(this,ji,void 0);ne(this,Hi,void 0);ne(this,sn,void 0);ne(this,qi,void 0);ne(this,Gi,void 0);J(this,Ye,e.queryCache||new k1),J(this,nn,e.mutationCache||new F1),J(this,on,e.defaultOptions||{}),J(this,ji,new Map),J(this,Hi,new Map),J(this,sn,0)}mount(){la(this,sn)._++,P(this,sn)===1&&(J(this,qi,ou.subscribe(()=>{ou.isFocused()&&(this.resumePausedMutations(),P(this,Ye).onFocus())})),J(this,Gi,Ns.subscribe(()=>{Ns.isOnline()&&(this.resumePausedMutations(),P(this,Ye).onOnline())})))}unmount(){var e,t;la(this,sn)._--,P(this,sn)===0&&((e=P(this,qi))==null||e.call(this),J(this,qi,void 0),(t=P(this,Gi))==null||t.call(this),J(this,Gi,void 0))}isFetching(e){return P(this,Ye).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,nn).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=P(this,Ye).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=P(this,Ye).find({queryKey:e}),i=n==null?void 0:n.state.data,o=x1(t,i);if(typeof o>"u")return;const a=this.defaultQueryOptions({queryKey:e});return P(this,Ye).build(this,a).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Ke.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var t;return(t=P(this,Ye).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=P(this,Ye);Ke.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=P(this,Ye),n={type:"active",...e};return Ke.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(n,t)))}cancelQueries(e={},t={}){const r={revert:!0,...t},n=Ke.batch(()=>P(this,Ye).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(jt).catch(jt)}invalidateQueries(e={},t={}){return Ke.batch(()=>{if(P(this,Ye).findAll(e).forEach(n=>{n.invalidate()}),e.refetchType==="none")return Promise.resolve();const r={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(r,t)})}refetchQueries(e={},t){const r={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},n=Ke.batch(()=>P(this,Ye).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,r);return r.throwOnError||(o=o.catch(jt)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const r=P(this,Ye).build(this,t);return r.isStaleByTime(t.staleTime)?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=D1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}resumePausedMutations(){return P(this,nn).resumePausedMutations()}getQueryCache(){return P(this,Ye)}getMutationCache(){return P(this,nn)}getDefaultOptions(){return P(this,on)}setDefaultOptions(e){J(this,on,e)}setQueryDefaults(e,t){P(this,ji).set(Rs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,ji).values()];let r={};return t.forEach(n=>{Ps(e,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(e,t){P(this,Hi).set(Rs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,Hi).values()];let r={};return t.forEach(n=>{Ps(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...P(this,on).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=th(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,on).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,Ye).clear(),P(this,nn).clear()}},Ye=new WeakMap,nn=new WeakMap,on=new WeakMap,ji=new WeakMap,Hi=new WeakMap,sn=new WeakMap,qi=new WeakMap,Gi=new WeakMap,ag),At,Be,Vi,pt,Qn,Wi,dr,Us,zi,Qi,Yn,Kn,an,Xn,Jn,_s,$s,ff,js,hf,Hs,df,qs,pf,Gs,mf,Vs,gf,Ws,yf,gu,H0,ug,$1=(ug=class extends mo{constructor(t,r){super();ne(this,Jn);ne(this,$s);ne(this,js);ne(this,Hs);ne(this,qs);ne(this,Gs);ne(this,Vs);ne(this,Ws);ne(this,gu);ne(this,At,void 0);ne(this,Be,void 0);ne(this,Vi,void 0);ne(this,pt,void 0);ne(this,Qn,void 0);ne(this,Wi,void 0);ne(this,dr,void 0);ne(this,Us,void 0);ne(this,zi,void 0);ne(this,Qi,void 0);ne(this,Yn,void 0);ne(this,Kn,void 0);ne(this,an,void 0);ne(this,Xn,void 0);J(this,Be,void 0),J(this,Vi,void 0),J(this,pt,void 0),J(this,Xn,new Set),J(this,At,t),this.options=r,J(this,dr,null),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,Be).addObserver(this),Mm(P(this,Be),this.options)&&ye(this,Jn,_s).call(this),ye(this,qs,pf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vf(P(this,Be),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vf(P(this,Be),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ye(this,Gs,mf).call(this),ye(this,Vs,gf).call(this),P(this,Be).removeObserver(this)}setOptions(t,r){const n=this.options,i=P(this,Be);if(this.options=P(this,At).defaultQueryOptions(t),iu(n,this.options)||P(this,At).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,Be),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),ye(this,Ws,yf).call(this);const o=this.hasListeners();o&&Fm(P(this,Be),i,this.options,n)&&ye(this,Jn,_s).call(this),this.updateResult(r),o&&(P(this,Be)!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&ye(this,$s,ff).call(this);const a=ye(this,js,hf).call(this);o&&(P(this,Be)!==i||this.options.enabled!==n.enabled||a!==P(this,an))&&ye(this,Hs,df).call(this,a)}getOptimisticResult(t){const r=P(this,At).getQueryCache().build(P(this,At),t),n=this.createResult(r,t);return H1(this,n)&&(J(this,pt,n),J(this,Wi,this.options),J(this,Qn,P(this,Be).state)),n}getCurrentResult(){return P(this,pt)}trackResult(t){const r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(P(this,Xn).add(n),t[n])})}),r}getCurrentQuery(){return P(this,Be)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=P(this,At).defaultQueryOptions(t),n=P(this,At).getQueryCache().build(P(this,At),r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(t){return ye(this,Jn,_s).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,pt)))}createResult(t,r){var N;const n=P(this,Be),i=this.options,o=P(this,pt),a=P(this,Qn),s=P(this,Wi),l=t!==n?t.state:P(this,Vi),{state:u}=t;let{error:d,errorUpdatedAt:h,fetchStatus:f,status:p}=u,m=!1,_;if(r._optimisticResults){const R=this.hasListeners(),L=!R&&Mm(t,r),$=R&&Fm(t,n,r,i);(L||$)&&(f=Cu(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(p="pending")),r._optimisticResults==="isRestoring"&&(f="idle")}if(r.select&&typeof u.data<"u")if(o&&u.data===(a==null?void 0:a.data)&&r.select===P(this,Us))_=P(this,zi);else try{J(this,Us,r.select),_=r.select(u.data),_=lf(o==null?void 0:o.data,_,r),J(this,zi,_),J(this,dr,null)}catch(R){J(this,dr,R)}else _=u.data;if(typeof r.placeholderData<"u"&&typeof _>"u"&&p==="pending"){let R;if(o!=null&&o.isPlaceholderData&&r.placeholderData===(s==null?void 0:s.placeholderData))R=o.data;else if(R=typeof r.placeholderData=="function"?r.placeholderData((N=P(this,Qi))==null?void 0:N.state.data,P(this,Qi)):r.placeholderData,r.select&&typeof R<"u")try{R=r.select(R),J(this,dr,null)}catch(L){J(this,dr,L)}typeof R<"u"&&(p="success",_=lf(o==null?void 0:o.data,R,r),m=!0)}P(this,dr)&&(d=P(this,dr),_=P(this,zi),h=Date.now(),p="error");const S=f==="fetching",v=p==="pending",b=p==="error",T=v&&S;return{status:p,fetchStatus:f,isPending:v,isSuccess:p==="success",isError:b,isInitialLoading:T,isLoading:T,data:_,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>l.dataUpdateCount||u.errorUpdateCount>l.errorUpdateCount,isFetching:S,isRefetching:S&&!v,isLoadingError:b&&u.dataUpdatedAt===0,isPaused:f==="paused",isPlaceholderData:m,isRefetchError:b&&u.dataUpdatedAt!==0,isStale:rh(t,r),refetch:this.refetch}}updateResult(t){const r=P(this,pt),n=this.createResult(P(this,Be),this.options);if(J(this,Qn,P(this,Be).state),J(this,Wi,this.options),iu(n,r))return;P(this,Qn).data!==void 0&&J(this,Qi,P(this,Be)),J(this,pt,n);const i={},o=()=>{if(!r)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!P(this,Xn).size)return!0;const c=new Set(s??P(this,Xn));return this.options.throwOnError&&c.add("error"),Object.keys(P(this,pt)).some(l=>{const u=l;return P(this,pt)[u]!==r[u]&&c.has(u)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),ye(this,gu,H0).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ye(this,qs,pf).call(this)}},At=new WeakMap,Be=new WeakMap,Vi=new WeakMap,pt=new WeakMap,Qn=new WeakMap,Wi=new WeakMap,dr=new WeakMap,Us=new WeakMap,zi=new WeakMap,Qi=new WeakMap,Yn=new WeakMap,Kn=new WeakMap,an=new WeakMap,Xn=new WeakMap,Jn=new WeakSet,_s=function(t){ye(this,Ws,yf).call(this);let r=P(this,Be).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(jt)),r},$s=new WeakSet,ff=function(){if(ye(this,Gs,mf).call(this),ao||P(this,pt).isStale||!uf(this.options.staleTime))return;const r=M0(P(this,pt).dataUpdatedAt,this.options.staleTime)+1;J(this,Yn,setTimeout(()=>{P(this,pt).isStale||this.updateResult()},r))},js=new WeakSet,hf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,Be)):this.options.refetchInterval)??!1},Hs=new WeakSet,df=function(t){ye(this,Vs,gf).call(this),J(this,an,t),!(ao||this.options.enabled===!1||!uf(P(this,an))||P(this,an)===0)&&J(this,Kn,setInterval(()=>{(this.options.refetchIntervalInBackground||ou.isFocused())&&ye(this,Jn,_s).call(this)},P(this,an)))},qs=new WeakSet,pf=function(){ye(this,$s,ff).call(this),ye(this,Hs,df).call(this,ye(this,js,hf).call(this))},Gs=new WeakSet,mf=function(){P(this,Yn)&&(clearTimeout(P(this,Yn)),J(this,Yn,void 0))},Vs=new WeakSet,gf=function(){P(this,Kn)&&(clearInterval(P(this,Kn)),J(this,Kn,void 0))},Ws=new WeakSet,yf=function(){const t=P(this,At).getQueryCache().build(P(this,At),this.options);if(t===P(this,Be))return;const r=P(this,Be);J(this,Be,t),J(this,Vi,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},gu=new WeakSet,H0=function(t){Ke.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(P(this,pt))}),P(this,At).getQueryCache().notify({query:P(this,Be),type:"observerResultsUpdated"})})},ug);function j1(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Mm(e,t){return j1(e,t)||e.state.dataUpdatedAt>0&&vf(e,t,t.refetchOnMount)}function vf(e,t,r){if(t.enabled!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&rh(e,t)}return!1}function Fm(e,t,r,n){return r.enabled!==!1&&(e!==t||n.enabled===!1)&&(!r.suspense||e.state.status!=="error")&&rh(e,r)}function rh(e,t){return e.isStaleByTime(t.staleTime)}function H1(e,t){return!iu(e.getCurrentResult(),t)}var un,Et,$t,Fr,Yi,Wa,zs,Ef,cg,q1=(cg=class extends mo{constructor(t,r){super();ne(this,Yi);ne(this,zs);ne(this,un,void 0);ne(this,Et,void 0);ne(this,$t,void 0);ne(this,Fr,void 0);J(this,Et,void 0),J(this,un,t),this.setOptions(r),this.bindMethods(),ye(this,Yi,Wa).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=P(this,un).defaultMutationOptions(t),iu(r,this.options)||P(this,un).getMutationCache().notify({type:"observerOptionsUpdated",mutation:P(this,$t),observer:this}),(n=P(this,$t))==null||n.setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=P(this,$t))==null||t.removeObserver(this)}onMutationUpdate(t){ye(this,Yi,Wa).call(this),ye(this,zs,Ef).call(this,t)}getCurrentResult(){return P(this,Et)}reset(){J(this,$t,void 0),ye(this,Yi,Wa).call(this),ye(this,zs,Ef).call(this)}mutate(t,r){var n;return J(this,Fr,r),(n=P(this,$t))==null||n.removeObserver(this),J(this,$t,P(this,un).getMutationCache().build(P(this,un),this.options)),P(this,$t).addObserver(this),P(this,$t).execute(t)}},un=new WeakMap,Et=new WeakMap,$t=new WeakMap,Fr=new WeakMap,Yi=new WeakSet,Wa=function(){var r;const t=((r=P(this,$t))==null?void 0:r.state)??j0();J(this,Et,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},zs=new WeakSet,Ef=function(t){Ke.batch(()=>{var r,n,i,o,a,s,c,l;P(this,Fr)&&this.hasListeners()&&((t==null?void 0:t.type)==="success"?((n=(r=P(this,Fr)).onSuccess)==null||n.call(r,t.data,P(this,Et).variables,P(this,Et).context),(o=(i=P(this,Fr)).onSettled)==null||o.call(i,t.data,null,P(this,Et).variables,P(this,Et).context)):(t==null?void 0:t.type)==="error"&&((s=(a=P(this,Fr)).onError)==null||s.call(a,t.error,P(this,Et).variables,P(this,Et).context),(l=(c=P(this,Fr)).onSettled)==null||l.call(c,void 0,t.error,P(this,Et).variables,P(this,Et).context))),this.listeners.forEach(u=>{u(P(this,Et))})})},cg),q0=pe.createContext(void 0),go=e=>{const t=pe.useContext(q0);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},G1=({client:e,children:t})=>(pe.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),pe.createElement(q0.Provider,{value:e},t)),G0=pe.createContext(!1),V1=()=>pe.useContext(G0);G0.Provider;function W1(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var z1=pe.createContext(W1()),Q1=()=>pe.useContext(z1);function V0(e,t){return typeof e=="function"?e(...t):!!e}var Y1=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},K1=e=>{pe.useEffect(()=>{e.clearReset()},[e])},X1=({result:e,errorResetBoundary:t,throwOnError:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&V0(r,[e.error,n]),J1=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},Z1=(e,t)=>e.isLoading&&e.isFetching&&!t,eR=(e,t,r)=>(e==null?void 0:e.suspense)&&Z1(t,r),tR=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function rR(e,t,r){const n=go(r),i=V1(),o=Q1(),a=n.defaultQueryOptions(e);a._optimisticResults=i?"isRestoring":"optimistic",J1(a),Y1(a,o),K1(o);const[s]=pe.useState(()=>new t(n,a)),c=s.getOptimisticResult(a);if(pe.useSyncExternalStore(pe.useCallback(l=>{const u=i?()=>{}:s.subscribe(Ke.batchCalls(l));return s.updateResult(),u},[s,i]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),pe.useEffect(()=>{s.setOptions(a,{listeners:!1})},[a,s]),eR(a,c,i))throw tR(a,s,o);if(X1({result:c,errorResetBoundary:o,throwOnError:a.throwOnError,query:s.getCurrentQuery()}))throw c.error;return a.notifyOnChangeProps?c:s.trackResult(c)}function W0(e,t){return rR(e,$1,t)}function fn(e,t){const r=go(t),[n]=pe.useState(()=>new q1(r,e));pe.useEffect(()=>{n.setOptions(e)},[n,e]);const i=pe.useSyncExternalStore(pe.useCallback(a=>n.subscribe(Ke.batchCalls(a)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=pe.useCallback((a,s)=>{n.mutate(a,s).catch(nR)},[n]);if(i.error&&V0(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function nR(){}var ve={context:void 0,registry:void 0};function bs(e){ve.context=e}var iR=(e,t)=>e===t,Is=Symbol("solid-proxy"),nh=Symbol("solid-track"),oR=Symbol("solid-dev-component"),su={equals:iR},z0=X0,jr=1,au=2,Q0={owned:null,cleanups:null,context:null,owner:null},dl={},Ue=null,pl=null,Me=null,mt=null,Ur=null,Ru=0,[sR,lI]=bt(!1);function hn(e,t){const r=Me,n=Ue,i=e.length===0,o=i?Q0:{owned:null,cleanups:null,context:null,owner:t===void 0?n:t},a=i?e:()=>e(()=>Xe(()=>Nu(o)));Ue=o,Me=null;try{return vr(a,!0)}finally{Me=r,Ue=n}}function bt(e,t){t=t?Object.assign({},su,t):su;const r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=i=>(typeof i=="function"&&(i=i(r.value)),K0(r,i));return[Y0.bind(r),n]}function _f(e,t,r){const n=Pu(e,t,!0,jr);yo(n)}function dn(e,t,r){const n=Pu(e,t,!1,jr);yo(n)}function ih(e,t,r){z0=_R;const n=Pu(e,t,!1,jr);(!r||!r.render)&&(n.user=!0),Ur?Ur.push(n):yo(n)}function St(e,t,r){r=r?Object.assign({},su,r):su;const n=Pu(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,yo(n),Y0.bind(n)}function aR(e,t,r){let n,i,o;arguments.length===2&&typeof t=="object"||arguments.length===1?(n=!0,i=e,o=t||{}):(n=e,i=t,o=r||{});let a=null,s=dl,c=null,l=!1,u="initialValue"in o,d=typeof n=="function"&&St(n);const h=new Set,[f,p]=(o.storage||bt)(o.initialValue),[m,_]=bt(void 0),[S,v]=bt(void 0,{equals:!1}),[b,T]=bt(u?"ready":"unresolved");if(ve.context){c=`${ve.context.id}${ve.context.count++}`;let $;o.ssrLoadFrom==="initial"?s=o.initialValue:ve.load&&($=ve.load(c))&&(s=$[0])}function w($,G,q,H){return a===$&&(a=null,H!==void 0&&(u=!0),($===s||G===s)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(H,{value:G})),s=dl,N(G,q)),G}function N($,G){vr(()=>{G===void 0&&p(()=>$),T(G!==void 0?"errored":u?"ready":"unresolved"),_(G);for(const q of h.keys())q.decrement();h.clear()},!1)}function R(){const $=yR,G=f(),q=m();if(q!==void 0&&!a)throw q;return Me&&!Me.user&&$&&_f(()=>{S(),a&&($.resolved||h.has($)||($.increment(),h.add($)))}),G}function L($=!0){if($!==!1&&l)return;l=!1;const G=d?d():n;if(G==null||G===!1){w(a,Xe(f));return}const q=s!==dl?s:Xe(()=>i(G,{value:f(),refetching:$}));return typeof q!="object"||!(q&&"then"in q)?(w(a,q,void 0,G),q):(a=q,l=!0,queueMicrotask(()=>l=!1),vr(()=>{T(u?"refreshing":"pending"),v()},!1),q.then(H=>w(q,H,void 0,G),H=>w(q,void 0,Z0(H),G)))}return Object.defineProperties(R,{state:{get:()=>b()},error:{get:()=>m()},loading:{get(){const $=b();return $==="pending"||$==="refreshing"}},latest:{get(){if(!u)return R();const $=m();if($&&!a)throw $;return f()}}}),d?_f(()=>L(!1)):L(!1),[R,{refetch:L,mutate:p}]}function uR(e){return vr(e,!1)}function Xe(e){if(Me===null)return e();const t=Me;Me=null;try{return e()}finally{Me=t}}function cR(e,t,r){const n=Array.isArray(e);let i,o=r&&r.defer;return a=>{let s;if(n){s=Array(e.length);for(let l=0;l<e.length;l++)s[l]=e[l]()}else s=e();if(o){o=!1;return}const c=Xe(()=>t(s,i,a));return i=s,c}}function lR(e){ih(()=>Xe(e))}function Ls(e){return Ue===null||(Ue.cleanups===null?Ue.cleanups=[e]:Ue.cleanups.push(e)),e}function fR(){return Me}function Dm(){return Ue}function hR(e,t){const r=Ue,n=Me;Ue=e,Me=null;try{return vr(t,!0)}catch(i){sh(i)}finally{Ue=r,Me=n}}function dR(e){const t=Me,r=Ue;return Promise.resolve().then(()=>{Me=t,Ue=r;let n;return vr(e,!1),Me=Ue=null,n?n.done:void 0})}function pR(){return[sR,dR]}function mR(e,t){const r=Symbol("context");return{id:r,Provider:bR(r),defaultValue:e}}function gR(e){let t;return(t=eE(Ue,e.id))!==void 0?t:e.defaultValue}function oh(e){const t=St(e),r=St(()=>bf(t()));return r.toArray=()=>{const n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}var yR;function Y0(){if(this.sources&&this.state)if(this.state===jr)yo(this);else{const e=mt;mt=null,vr(()=>cu(this),!1),mt=e}if(Me){const e=this.observers?this.observers.length:0;Me.sources?(Me.sources.push(this),Me.sourceSlots.push(e)):(Me.sources=[this],Me.sourceSlots=[e]),this.observers?(this.observers.push(Me),this.observerSlots.push(Me.sources.length-1)):(this.observers=[Me],this.observerSlots=[Me.sources.length-1])}return this.value}function K0(e,t,r){let n=e.value;return(!e.comparator||!e.comparator(n,t))&&(e.value=t,e.observers&&e.observers.length&&vr(()=>{for(let i=0;i<e.observers.length;i+=1){const o=e.observers[i],a=pl&&pl.running;a&&pl.disposed.has(o),(a?!o.tState:!o.state)&&(o.pure?mt.push(o):Ur.push(o),o.observers&&J0(o)),a||(o.state=jr)}if(mt.length>1e6)throw mt=[],new Error},!1)),t}function yo(e){if(!e.fn)return;Nu(e);const t=Ue,r=Me,n=Ru;Me=Ue=e,vR(e,e.value,n),Me=r,Ue=t}function vR(e,t,r){let n;try{n=e.fn(t)}catch(i){return e.pure&&(e.state=jr,e.owned&&e.owned.forEach(Nu),e.owned=null),e.updatedAt=r+1,sh(i)}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?K0(e,n):e.value=n,e.updatedAt=r)}function Pu(e,t,r,n=jr,i){const o={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Ue,context:null,pure:r};return Ue===null||Ue!==Q0&&(Ue.owned?Ue.owned.push(o):Ue.owned=[o]),o}function uu(e){if(e.state===0)return;if(e.state===au)return cu(e);if(e.suspense&&Xe(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Ru);)e.state&&t.push(e);for(let r=t.length-1;r>=0;r--)if(e=t[r],e.state===jr)yo(e);else if(e.state===au){const n=mt;mt=null,vr(()=>cu(e,t[0]),!1),mt=n}}function vr(e,t){if(mt)return e();let r=!1;t||(mt=[]),Ur?r=!0:Ur=[],Ru++;try{const n=e();return ER(r),n}catch(n){r||(Ur=null),mt=null,sh(n)}}function ER(e){if(mt&&(X0(mt),mt=null),e)return;const t=Ur;Ur=null,t.length&&vr(()=>z0(t),!1)}function X0(e){for(let t=0;t<e.length;t++)uu(e[t])}function _R(e){let t,r=0;for(t=0;t<e.length;t++){const n=e[t];n.user?e[r++]=n:uu(n)}if(ve.context){if(ve.count){ve.effects||(ve.effects=[]),ve.effects.push(...e.slice(0,r));return}else ve.effects&&(e=[...ve.effects,...e],r+=ve.effects.length,delete ve.effects);bs()}for(t=0;t<r;t++)uu(e[t])}function cu(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){const n=e.sources[r];if(n.sources){const i=n.state;i===jr?n!==t&&(!n.updatedAt||n.updatedAt<Ru)&&uu(n):i===au&&cu(n,t)}}}function J0(e){for(let t=0;t<e.observers.length;t+=1){const r=e.observers[t];r.state||(r.state=au,r.pure?mt.push(r):Ur.push(r),r.observers&&J0(r))}}function Nu(e){let t;if(e.sources)for(;e.sources.length;){const r=e.sources.pop(),n=e.sourceSlots.pop(),i=r.observers;if(i&&i.length){const o=i.pop(),a=r.observerSlots.pop();n<i.length&&(o.sourceSlots[a]=n,i[n]=o,r.observerSlots[n]=a)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Nu(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function Z0(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function sh(e,t=Ue){throw Z0(e)}function eE(e,t){return e?e.context&&e.context[t]!==void 0?e.context[t]:eE(e.owner,t):void 0}function bf(e){if(typeof e=="function"&&!e.length)return bf(e());if(Array.isArray(e)){const t=[];for(let r=0;r<e.length;r++){const n=bf(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function bR(e,t){return function(n){let i;return dn(()=>i=Xe(()=>(Ue.context={[e]:n.value},oh(()=>n.children))),void 0),i}}var wf=Symbol("fallback");function lu(e){for(let t=0;t<e.length;t++)e[t]()}function wR(e,t,r={}){let n=[],i=[],o=[],a=0,s=t.length>1?[]:null;return Ls(()=>lu(o)),()=>{let c=e()||[],l,u;return c[nh],Xe(()=>{let h=c.length,f,p,m,_,S,v,b,T,w;if(h===0)a!==0&&(lu(o),o=[],n=[],i=[],a=0,s&&(s=[])),r.fallback&&(n=[wf],i[0]=hn(N=>(o[0]=N,r.fallback())),a=1);else if(a===0){for(i=new Array(h),u=0;u<h;u++)n[u]=c[u],i[u]=hn(d);a=h}else{for(m=new Array(h),_=new Array(h),s&&(S=new Array(h)),v=0,b=Math.min(a,h);v<b&&n[v]===c[v];v++);for(b=a-1,T=h-1;b>=v&&T>=v&&n[b]===c[T];b--,T--)m[T]=i[b],_[T]=o[b],s&&(S[T]=s[b]);for(f=new Map,p=new Array(T+1),u=T;u>=v;u--)w=c[u],l=f.get(w),p[u]=l===void 0?-1:l,f.set(w,u);for(l=v;l<=b;l++)w=n[l],u=f.get(w),u!==void 0&&u!==-1?(m[u]=i[l],_[u]=o[l],s&&(S[u]=s[l]),u=p[u],f.set(w,u)):o[l]();for(u=v;u<h;u++)u in m?(i[u]=m[u],o[u]=_[u],s&&(s[u]=S[u],s[u](u))):i[u]=hn(d);i=i.slice(0,a=h),n=c.slice(0)}return i});function d(h){if(o[u]=h,s){const[f,p]=bt(u);return s[u]=p,t(c[u],f)}return t(c[u])}}}function SR(e,t,r={}){let n=[],i=[],o=[],a=[],s=0,c;return Ls(()=>lu(o)),()=>{const l=e()||[];return l[nh],Xe(()=>{if(l.length===0)return s!==0&&(lu(o),o=[],n=[],i=[],s=0,a=[]),r.fallback&&(n=[wf],i[0]=hn(d=>(o[0]=d,r.fallback())),s=1),i;for(n[0]===wf&&(o[0](),o=[],n=[],i=[],s=0),c=0;c<l.length;c++)c<n.length&&n[c]!==l[c]?a[c](()=>l[c]):c>=n.length&&(i[c]=hn(u));for(;c<n.length;c++)o[c]();return s=a.length=o.length=l.length,n=l.slice(0),i=i.slice(0,s)});function u(d){o[c]=d;const[h,f]=bt(l[c]);return a[c]=f,t(h,c)}}}function tE(e,t){return Xe(()=>e(t||{}))}function Ma(){return!0}var Sf={get(e,t,r){return t===Is?r:e.get(t)},has(e,t){return t===Is?!0:e.has(t)},set:Ma,deleteProperty:Ma,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Ma,deleteProperty:Ma}},ownKeys(e){return e.keys()}};function ml(e){return(e=typeof e=="function"?e():e)?e:{}}function TR(){for(let e=0,t=this.length;e<t;++e){const r=this[e]();if(r!==void 0)return r}}function rE(...e){let t=!1;for(let o=0;o<e.length;o++){const a=e[o];t=t||!!a&&Is in a,e[o]=typeof a=="function"?(t=!0,St(a)):a}if(t)return new Proxy({get(o){for(let a=e.length-1;a>=0;a--){const s=ml(e[a])[o];if(s!==void 0)return s}},has(o){for(let a=e.length-1;a>=0;a--)if(o in ml(e[a]))return!0;return!1},keys(){const o=[];for(let a=0;a<e.length;a++)o.push(...Object.keys(ml(e[a])));return[...new Set(o)]}},Sf);const r={},n={},i=new Set;for(let o=e.length-1;o>=0;o--){const a=e[o];if(!a)continue;const s=Object.getOwnPropertyNames(a);for(let c=0,l=s.length;c<l;c++){const u=s[c];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!i.has(u))d.get?(i.add(u),Object.defineProperty(r,u,{enumerable:!0,configurable:!0,get:TR.bind(n[u]=[d.get.bind(a)])})):(d.value!==void 0&&i.add(u),r[u]=d.value);else{const h=n[u];h?d.get?h.push(d.get.bind(a)):d.value!==void 0&&h.push(()=>d.value):r[u]===void 0&&(r[u]=d.value)}}}return r}function nE(e,...t){if(Is in e){const i=new Set(t.length>1?t.flat():t[0]),o=t.map(a=>new Proxy({get(s){return a.includes(s)?e[s]:void 0},has(s){return a.includes(s)&&s in e},keys(){return a.filter(s=>s in e)}},Sf));return o.push(new Proxy({get(a){return i.has(a)?void 0:e[a]},has(a){return i.has(a)?!1:a in e},keys(){return Object.keys(e).filter(a=>!i.has(a))}},Sf)),o}const r={},n=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const o=Object.getOwnPropertyDescriptor(e,i),a=!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable;let s=!1,c=0;for(const l of t)l.includes(i)&&(s=!0,a?n[c][i]=o.value:Object.defineProperty(n[c],i,o)),++c;s||(a?r[i]=o.value:Object.defineProperty(r,i,o))}return[...n,r]}function xR(e){let t,r;const n=i=>{const o=ve.context;if(o){const[s,c]=bt();ve.count||(ve.count=0),ve.count++,(r||(r=e())).then(l=>{bs(o),ve.count--,c(()=>l.default),bs()}),t=s}else if(!t){const[s]=aR(()=>(r||(r=e())).then(c=>c.default));t=s}let a;return St(()=>(a=t())&&Xe(()=>{if(!o)return a(i);const s=ve.context;bs(o);const c=a(i);return bs(s),c}))};return n.preload=()=>r||((r=e()).then(i=>t=()=>i.default),r),n}var OR=0;function AR(){const e=ve.context;return e?`${e.id}${e.count++}`:`cl-${OR++}`}var iE=e=>`Stale read from <${e}>.`;function CR(e){const t="fallback"in e&&{fallback:()=>e.fallback};return St(wR(()=>e.each,e.children,t||void 0))}function RR(e){const t="fallback"in e&&{fallback:()=>e.fallback};return St(SR(()=>e.each,e.children,t||void 0))}function PR(e){const t=e.keyed,r=St(()=>e.when,void 0,{equals:(n,i)=>t?n===i:!n==!i});return St(()=>{const n=r();if(n){const i=e.children;return typeof i=="function"&&i.length>0?Xe(()=>i(t?n:()=>{if(!Xe(r))throw iE("Show");return e.when})):i}return e.fallback},void 0,void 0)}function NR(e){let t=!1;const r=(o,a)=>o[0]===a[0]&&(t?o[1]===a[1]:!o[1]==!a[1])&&o[2]===a[2],n=oh(()=>e.children),i=St(()=>{let o=n();Array.isArray(o)||(o=[o]);for(let a=0;a<o.length;a++){const s=o[a].when;if(s)return t=!!o[a].keyed,[a,s,o[a]]}return[-1]},void 0,{equals:r});return St(()=>{const[o,a,s]=i();if(o<0)return e.fallback;const c=s.children;return typeof c=="function"&&c.length>0?Xe(()=>c(t?a:()=>{if(Xe(i)[0]!==o)throw iE("Match");return s.when})):c},void 0,void 0)}function IR(e){return e}var LR=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],kR=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...LR]),MR=new Set(["innerHTML","textContent","innerText","children"]),FR=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),DR=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function BR(e,t){const r=DR[e];return typeof r=="object"?r[t]?r.$:void 0:r}var UR=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),$R=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),jR={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function HR(e,t,r){let n=r.length,i=t.length,o=n,a=0,s=0,c=t[i-1].nextSibling,l=null;for(;a<i||s<o;){if(t[a]===r[s]){a++,s++;continue}for(;t[i-1]===r[o-1];)i--,o--;if(i===a){const u=o<n?s?r[s-1].nextSibling:r[o-s]:c;for(;s<o;)e.insertBefore(r[s++],u)}else if(o===s)for(;a<i;)(!l||!l.has(t[a]))&&t[a].remove(),a++;else if(t[a]===r[o-1]&&r[s]===t[i-1]){const u=t[--i].nextSibling;e.insertBefore(r[s++],t[a++].nextSibling),e.insertBefore(r[--o],u),t[i]=r[o]}else{if(!l){l=new Map;let d=s;for(;d<o;)l.set(r[d],d++)}const u=l.get(t[a]);if(u!=null)if(s<u&&u<o){let d=a,h=1,f;for(;++d<i&&d<o&&!((f=l.get(t[d]))==null||f!==u+h);)h++;if(h>u-s){const p=t[a];for(;s<u;)e.insertBefore(r[s++],p)}else e.replaceChild(r[s++],t[a++])}else a++;else t[a++].remove()}}}var Bm="_$DX_DELEGATE";function qR(e,t,r,n={}){let i;return hn(o=>{i=o,t===document?e():hu(t,e(),t.firstChild?null:void 0,r)},n.owner),()=>{i(),t.textContent=""}}function GR(e,t,r){let n;const i=()=>{const a=document.createElement("template");return a.innerHTML=e,r?a.content.firstChild.firstChild:a.content.firstChild},o=t?()=>Xe(()=>document.importNode(n||(n=i()),!0)):()=>(n||(n=i())).cloneNode(!0);return o.cloneNode=o,o}function oE(e,t=window.document){const r=t[Bm]||(t[Bm]=new Set);for(let n=0,i=e.length;n<i;n++){const o=e[n];r.has(o)||(r.add(o),t.addEventListener(o,JR))}}function fu(e,t,r){r==null?e.removeAttribute(t):e.setAttribute(t,r)}function VR(e,t,r,n){n==null?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n)}function sE(e,t){t==null?e.removeAttribute("class"):e.className=t}function aE(e,t,r,n){if(n)Array.isArray(r)?(e[`$$${t}`]=r[0],e[`$$${t}Data`]=r[1]):e[`$$${t}`]=r;else if(Array.isArray(r)){const i=r[0];e.addEventListener(t,r[0]=o=>i.call(e,r[1],o))}else e.addEventListener(t,r)}function WR(e,t,r={}){const n=Object.keys(t||{}),i=Object.keys(r);let o,a;for(o=0,a=i.length;o<a;o++){const s=i[o];!s||s==="undefined"||t[s]||(Um(e,s,!1),delete r[s])}for(o=0,a=n.length;o<a;o++){const s=n[o],c=!!t[s];!s||s==="undefined"||r[s]===c||!c||(Um(e,s,!0),r[s]=c)}return r}function zR(e,t,r){if(!t)return r?fu(e,"style"):t;const n=e.style;if(typeof t=="string")return n.cssText=t;typeof r=="string"&&(n.cssText=r=void 0),r||(r={}),t||(t={});let i,o;for(o in r)t[o]==null&&n.removeProperty(o),delete r[o];for(o in t)i=t[o],i!==r[o]&&(n.setProperty(o,i),r[o]=i);return r}function uE(e,t={},r,n){const i={};return n||dn(()=>i.children=uo(e,t.children,i.children)),dn(()=>t.ref&&t.ref(e)),dn(()=>YR(e,t,r,!0,i,!0)),i}function QR(e,t,r){return Xe(()=>e(t,r))}function hu(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return uo(e,t,n,r);dn(i=>uo(e,t(),i,r),n)}function YR(e,t,r,n,i={},o=!1){t||(t={});for(const a in i)if(!(a in t)){if(a==="children")continue;i[a]=$m(e,a,null,i[a],r,o)}for(const a in t){if(a==="children"){n||uo(e,t.children);continue}const s=t[a];i[a]=$m(e,a,s,i[a],r,o)}}function KR(e){let t,r;if(!ve.context||!(t=ve.registry.get(r=ZR()))){if(ve.context,!e)throw new Error("Unrecoverable Hydration Mismatch. No template for key: "+r);return e()}return ve.completed&&ve.completed.add(t),ve.registry.delete(r),t}function XR(e){return e.toLowerCase().replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}function Um(e,t,r){const n=t.trim().split(/\s+/);for(let i=0,o=n.length;i<o;i++)e.classList.toggle(n[i],r)}function $m(e,t,r,n,i,o){let a,s,c,l,u;if(t==="style")return zR(e,r,n);if(t==="classList")return WR(e,r,n);if(r===n)return n;if(t==="ref")o||r(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);n&&e.removeEventListener(d,n),r&&e.addEventListener(d,r)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);n&&e.removeEventListener(d,n,!0),r&&e.addEventListener(d,r,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),h=UR.has(d);if(!h&&n){const f=Array.isArray(n)?n[0]:n;e.removeEventListener(d,f)}(h||r)&&(aE(e,d,r,h),h&&oE([d]))}else if(t.slice(0,5)==="attr:")fu(e,t.slice(5),r);else if((u=t.slice(0,5)==="prop:")||(c=MR.has(t))||!i&&((l=BR(t,e.tagName))||(s=kR.has(t)))||(a=e.nodeName.includes("-")))u&&(t=t.slice(5),s=!0),t==="class"||t==="className"?sE(e,r):a&&!s&&!c?e[XR(t)]=r:e[l||t]=r;else{const d=i&&t.indexOf(":")>-1&&jR[t.split(":")[0]];d?VR(e,d,t,r):fu(e,FR[t]||t,r)}return r}function JR(e){const t=`$$${e.type}`;let r=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==r&&Object.defineProperty(e,"target",{configurable:!0,value:r}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return r||document}}),ve.registry&&!ve.done&&(ve.done=_$HY.done=!0);r;){const n=r[t];if(n&&!r.disabled){const i=r[`${t}Data`];if(i!==void 0?n.call(r,i,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}function uo(e,t,r,n,i){if(ve.context){!r&&(r=[...e.childNodes]);let s=[];for(let c=0;c<r.length;c++){const l=r[c];l.nodeType===8&&l.data.slice(0,2)==="!$"?l.remove():s.push(l)}r=s}for(;typeof r=="function";)r=r();if(t===r)return r;const o=typeof t,a=n!==void 0;if(e=a&&r[0]&&r[0].parentNode||e,o==="string"||o==="number"){if(ve.context)return r;if(o==="number"&&(t=t.toString()),a){let s=r[0];s&&s.nodeType===3?s.data=t:s=document.createTextNode(t),r=Ci(e,r,n,s)}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t}else if(t==null||o==="boolean"){if(ve.context)return r;r=Ci(e,r,n)}else{if(o==="function")return dn(()=>{let s=t();for(;typeof s=="function";)s=s();r=uo(e,s,r,n)}),()=>r;if(Array.isArray(t)){const s=[],c=r&&Array.isArray(r);if(Tf(s,t,r,i))return dn(()=>r=uo(e,s,r,n,!0)),()=>r;if(ve.context){if(!s.length)return r;for(let l=0;l<s.length;l++)if(s[l].parentNode)return r=s}if(s.length===0){if(r=Ci(e,r,n),a)return r}else c?r.length===0?jm(e,s,n):HR(e,r,s):(r&&Ci(e),jm(e,s));r=s}else if(t.nodeType){if(ve.context&&t.parentNode)return r=a?[t]:t;if(Array.isArray(r)){if(a)return r=Ci(e,r,n,t);Ci(e,r,null,t)}else r==null||r===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);r=t}}return r}function Tf(e,t,r,n){let i=!1;for(let o=0,a=t.length;o<a;o++){let s=t[o],c=r&&r[o],l;if(!(s==null||s===!0||s===!1))if((l=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))i=Tf(e,s,c)||i;else if(l==="function")if(n){for(;typeof s=="function";)s=s();i=Tf(e,Array.isArray(s)?s:[s],Array.isArray(c)?c:[c])||i}else e.push(s),i=!0;else{const u=String(s);c&&c.nodeType===3&&c.data===u?e.push(c):e.push(document.createTextNode(u))}}return i}function jm(e,t,r=null){for(let n=0,i=t.length;n<i;n++)e.insertBefore(t[n],r)}function Ci(e,t,r,n){if(r===void 0)return e.textContent="";const i=n||document.createTextNode("");if(t.length){let o=!1;for(let a=t.length-1;a>=0;a--){const s=t[a];if(i!==s){const c=s.parentNode===e;!o&&!a?c?e.replaceChild(i,s):e.insertBefore(i,r):c&&s.remove()}else o=!0}}else e.insertBefore(i,r);return[i]}function ZR(){const e=ve.context;return`${e.id}${e.count++}`}var eP="http://www.w3.org/2000/svg";function cE(e,t=!1){return t?document.createElementNS(eP,e):document.createElement(e)}function tP(e){const{useShadow:t}=e,r=document.createTextNode(""),n=()=>e.mount||document.body,i=Dm();let o,a=!!ve.context;return ih(()=>{a&&(Dm().user=a=!1),o||(o=hR(i,()=>St(()=>e.children)));const s=n();if(s instanceof HTMLHeadElement){const[c,l]=bt(!1),u=()=>l(!0);hn(d=>hu(s,()=>c()?d():o(),null)),Ls(u)}else{const c=cE(e.isSVG?"g":"div",e.isSVG),l=t&&c.attachShadow?c.attachShadow({mode:"open"}):c;Object.defineProperty(c,"_$host",{get(){return r.parentNode},configurable:!0}),hu(l,o),s.appendChild(c),e.ref&&e.ref(c),Ls(()=>s.removeChild(c))}},void 0,{render:!a}),r}function rP(e){const[t,r]=nE(e,["component"]),n=St(()=>t.component);return St(()=>{const i=n();switch(typeof i){case"function":return Object.assign(i,{[oR]:!0}),Xe(()=>i(r));case"string":const o=$R.has(i),a=ve.context?KR():cE(i,o);return uE(a,r,o),a}})}var Ki,Qs,Ys,Ks,Zn,Xi,Ji,Zi,eo,to,Xs,lg,nP=(lg=class{constructor(e){ne(this,Ki,void 0);ne(this,Qs,void 0);ne(this,Ys,void 0);ne(this,Ks,void 0);ne(this,Zn,!1);ne(this,Xi,void 0);ne(this,Ji,void 0);ne(this,Zi,void 0);ne(this,eo,void 0);ne(this,to,void 0);ne(this,Xs,void 0);const{client:t,queryFlavor:r,version:n,onlineManager:i,buttonPosition:o,position:a,initialIsOpen:s,errorTypes:c}=e;J(this,Ki,bt(t)),J(this,Ys,r),J(this,Ks,n),J(this,Qs,i),J(this,Xi,bt(o)),J(this,Ji,bt(a)),J(this,Zi,bt(s)),J(this,eo,bt(c))}setButtonPosition(e){P(this,Xi)[1](e)}setPosition(e){P(this,Ji)[1](e)}setInitialIsOpen(e){P(this,Zi)[1](e)}setErrorTypes(e){P(this,eo)[1](e)}setClient(e){P(this,Ki)[1](e)}mount(e){if(P(this,Zn))throw new Error("Devtools is already mounted");const t=qR(()=>{const[r]=P(this,Xi),[n]=P(this,Ji),[i]=P(this,Zi),[o]=P(this,eo),[a]=P(this,Ki);let s;P(this,to)?s=P(this,to):(s=xR(()=>Promise.resolve().then(()=>require("./4TNE5QTO-440b0dd4.js"))),J(this,to,s));const c=this;return tE(s,rE({get queryFlavor(){return P(c,Ys)},get version(){return P(c,Ks)},get onlineManager(){return P(c,Qs)}},{get client(){return a()},get buttonPosition(){return r()},get position(){return n()},get initialIsOpen(){return i()},get errorTypes(){return o()}}))},e);J(this,Zn,!0),J(this,Xs,t)}unmount(){var e;if(!P(this,Zn))throw new Error("Devtools is not mounted");(e=P(this,Xs))==null||e.call(this),J(this,Zn,!1)}},Ki=new WeakMap,Qs=new WeakMap,Ys=new WeakMap,Ks=new WeakMap,Zn=new WeakMap,Xi=new WeakMap,Ji=new WeakMap,Zi=new WeakMap,eo=new WeakMap,to=new WeakMap,Xs=new WeakMap,lg);function iP(e){const t=go(),r=e.client||t,n=U.useRef(null),{buttonPosition:i,position:o,initialIsOpen:a,errorTypes:s}=e,[c]=U.useState(new nP({client:r,queryFlavor:"React Query",version:"5",onlineManager:Ns,buttonPosition:i,position:o,initialIsOpen:a,errorTypes:s}));return U.useEffect(()=>{c.setClient(r)},[r,c]),U.useEffect(()=>{i&&c.setButtonPosition(i)},[i,c]),U.useEffect(()=>{o&&c.setPosition(o)},[o,c]),U.useEffect(()=>{c.setInitialIsOpen(a||!1)},[a,c]),U.useEffect(()=>{c.setErrorTypes(s||[])},[s,c]),U.useEffect(()=>(n.current&&c.mount(n.current),()=>{c.unmount()}),[c]),U.createElement("div",{className:"tsqd-parent-container",ref:n})}var oP=process.env.NODE_ENV!=="development"?function(){return null}:iP;const sP=({showDevTools:e=!0,children:t})=>{const r=new U1({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return x.jsxs(G1,{client:r,children:[t,e&&x.jsx(oP,{initialIsOpen:!1})]})};const gl="joinCommunityButton",ah=({isMember:e=!1,isShort:t=!1,functions:{join:r,leave:n}={join:()=>{},leave:()=>{}}})=>{const i=Oe(),o=U.useContext($r),a=o&&typeof o.id=="string",[s,c]=U.useState(e),[l,u]=U.useState(e?"joined":"notJoined");U.useEffect(()=>{l==="joining"?u("joined"):l==="leaving"&&u("notJoined")},[s]);const d={},h={};return s&&l!=="leaving"&&(d["data-hover-text"]=i.formatMessage({id:`${gl}_leave`}),d["aria-label"]=i.formatMessage({id:`${gl}_member_aria`}),h["aria-hidden"]="true"),x.jsx(ze,{variant:s?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:s&&l!=="leaving"?{icon:"tick",position:"left"}:!1,onClick:async f=>{a&&(f.currentTarget.blur(),s?(u("leaving"),typeof n=="function"&&await n()):(u("joining"),typeof r=="function"&&await r()),c(!s))},className:se("join-community-button",l,{active:l==="joining"}),disabled:!a,...d,children:x.jsx("span",{className:"text",...h,children:i.formatMessage({id:`${gl}${["joining","leaving"].includes(l)?`_${l}`:s?"_member":t?"_short":""}`})})})};const yl="communityDetails_",aP=({isMember:e=!1,slug:t,members:{number:r,data:n}={number:void 0,data:[]},className:i="",...o})=>{const a=Oe(),s=r||(n==null?void 0:n.length)||0;return x.jsxs("div",{className:se("community-details",i),children:[x.jsx(tu,{}),x.jsxs("div",{className:"member-details",children:[x.jsxs("div",{className:"top",children:[x.jsxs("h3",{children:[a.formatMessage({id:`${yl}members`}),x.jsx("span",{className:"count",children:s})]}),x.jsx("p",{className:"text-small",children:x.jsx("a",{href:`/communities/${t}/members`,children:a.formatMessage({id:`${yl}viewAll`})})})]}),x.jsx(k0,{contributors:{total:r,data:n!=null&&n.length?n:[{},{},{},{},{}]},styling:{size:"medium",showGap:!0,showPlaceholders:s===0},cutoff:5})]}),x.jsx(ah,{isMember:e,...o}),e&&x.jsx(ze,{variant:"primary",icon:{icon:"plus"},styling:{fullWidth:!0},children:a.formatMessage({id:`${yl}invite`})})]})};const uP=({breadcrumbs:e,cutoff:t=20,className:r=""})=>{const n=Oe();return x.jsxs(x.Fragment,{children:[x.jsx(lt,{element:"p",children:n.formatMessage({id:"breadcrumbs_label"})}),x.jsx("ul",{className:se("breadcrumbs text-small",r),children:e.map(({text:i,href:o,current:a=!1},s)=>x.jsxs("li",{children:[a&&x.jsx(lt,{element:"span",children:n.formatMessage({id:"breadcrumbs_currentPage"})}),x.jsx(ia,{href:a?void 0:o,children:Kf(i,t)})]},`${window.btoa(i)}_${s}`))})]})};const cP=({options:e,allOption:t=!1,allowMultiple:r=!0,onChange:n=()=>{},className:i=""})=>{const o=Oe(),a=t?[{id:"all",text:typeof t!="boolean"&&t.text||o.formatMessage({id:"filters_all"})},...e]:e,[s,c]=U.useState(t?["all"]:[]),l=(u,d)=>{let h=[];s.includes(u)?h=s.filter(f=>f!==u):u==="all"?h=["all"]:r?h=[...s.filter(f=>f!=="all"),u]:h=[u],c(f=>(n&&typeof n=="function"&&n({current:h,previous:f}),h)),d&&typeof d=="function"&&d()};return x.jsx("ul",{className:se("filters",i),children:a.map(({id:u,text:d,disabled:h=!1,callback:f=()=>{}})=>{let p={};return h&&(p={disabled:!0,"aria-label":o.formatMessage({id:"filters_disabled"},{name:d})}),x.jsx("li",{children:x.jsx("button",{className:se(u,{selected:s.includes(u)}),onClick:m=>{m.preventDefault(),m.stopPropagation(),l(u,f)},...p,children:d})},u)})})},lP=(e,t)=>{const r=String(e);if(!t||!t.length)return`/${r}`;let n="";return t.forEach(({url:i,position:o})=>{o==="before-lang"?n+=`/${i}`:(n.includes(`/${r}/`)||(n+=`/${r}`),n+=`/${i}`)}),n.includes(`/${r}/`)||(n+=`/${r}`),n};const vl={en:"English",es:"Español",fr:"Français",pt:"Português"},Fa="languageSwitcher_",fP=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:r=!1,translations:n,onChange:i=()=>{},urlParts:o,variant:a="default",label:s,className:c=""})=>{const l=Oe(),[u,d]=U.useState(e);if(U.useEffect(()=>{e!==u&&d(e)},[e]),!n||!Object.values(n).some(m=>m&&m.post_name))return null;const f=Object.keys(n),p=u!==e;return x.jsxs("div",{className:se("language-switcher text-small",a,c),children:[x.jsxs("nav",{children:[a!=="short"&&x.jsx("p",{children:s||l.formatMessage({id:`${Fa}label`})}),x.jsx("ul",{children:f.map(m=>{if(!vl[m])return null;let _={className:m};return u===m?_["aria-label"]=l.formatMessage({id:`${Fa}selected`},{language:vl[m]}):_={..._,href:lP(m,o),onClick:S=>{S.preventDefault(),S.stopPropagation(),d(m),i(m)}},x.jsx("li",{children:x.jsx(ia,{..._,fallbackElement:"span",children:vl[m]})},m)})}),a!=="short"&&!p&&x.jsx("p",{children:l.formatMessage({id:`${Fa}translation_${t?"original":r?"human":"machine"}`})})]}),a!=="short"&&!p&&!t&&!r&&x.jsx("small",{children:l.formatMessage({id:`${Fa}disclaimer`},{email:Ni.support,link:m=>{const _=`mailto:${m}`;return x.jsx("a",{href:_,children:m})}})})]})};const El=tf({locale:"en",messages:Gf}),lE=({page:e=1,length:t=0,limit:r=10,loadNextPage:n=()=>{},icon:i=!1,messages:o={button:El.formatMessage({id:"loadMore_button"}),endOfFeed:El.formatMessage({id:"loadMore_endOfFeed"}),error:El.formatMessage({id:"loadMore_error"})},className:a="",gtmContext:s="LoadMore"})=>{const[c,l]=U.useState(!1),[u,d]=U.useState(!1);if(t<=0||t<r*e)return null;const h=async f=>{try{await n(f)}catch(p){p instanceof Error&&p.message&&p.message.includes("Cannot read items")?d(!0):l(!0)}};return x.jsxs("footer",{className:se("load-more",a),children:[c&&x.jsx("p",{className:"error",children:o.error}),u?x.jsx("p",{children:o.endOfFeed}):x.jsx(ze,{variant:"secondary",icon:i,onClick:h,"data-gtm-event-context":s,"data-gtm-event-type":"load-more-click",className:"gtm-trackable","data-testid":"load-more-button",children:o.button})]})};let Da=!1;const fE=({element:e="div",id:t="more-menu",options:r,className:n=""})=>{const i=Oe(),o=U.useRef(null),[a,s]=U.useState(!1),c=l=>{o.current&&l.target instanceof HTMLElement&&!o.current.contains(l.target)&&s(!1)};return U.useEffect(()=>(document.addEventListener("click",c,!0),()=>{document.removeEventListener("click",c,!0)})),U.createElement(e,{ref:o,className:se("more-menu text-medium",n),children:x.jsxs(x.Fragment,{children:[x.jsx(ze,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>s(!a),"aria-haspopup":"true","aria-expanded":a,"aria-controls":t,screenreaderText:i.formatMessage({id:"moreMenu"})}),x.jsx("ul",{id:t,hidden:!a,children:r.map(({href:l,onClick:u,text:d,icon:h,...f},p)=>{const m={...f,onClick:_=>{s(!1),typeof u=="function"&&u(_)},onFocus:()=>{Da&&(clearTimeout(Da),Da=!1)},onBlur:()=>{Da=setTimeout(()=>{s(!1)},100)}};return l&&(m.href=l),x.jsx("li",{children:x.jsx(ze,{variant:"tertiary",size:"medium",icon:h?{icon:h,position:"left"}:!1,...m,children:d})},`${window.btoa(d)}_${p}`)})})]})})};const uh=({variant:e="default",version:t="default",className:r="",...n})=>x.jsx("p",{className:"logo-wrapper",children:x.jsx("a",{href:"/home/",className:se("logo",e,t,r),...n,children:x.jsx(lt,{children:x.jsx(ln,{id:"apolitical"})})})});const hP={"2-1":901},dP=({layout:e="2-1",hideOnMobile:t=!1,className:r="",children:n})=>{const i=ra(!0);let o=n;return U.Children.count(n)===1&&(o=U.Children.toArray(n)[0],o.props&&(o=o.props.children)),x.jsx("section",{className:se("columns",`layout-${e}`,r),children:U.Children.map(o,(a,s)=>t!==!1&&s===t&&i&&i<hP[e]?null:a)})};const _l="cookieBanner_",bl=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],wl=new Date(Date.now()+12*30*24*60*60*1e3),hE=()=>{const e=Oe(),[t,r,n]=vg(bl),[i,o]=U.useState(!t["apol-cookie-banner"]),a=()=>{bl.forEach(u=>{r(u,!0,{path:"/",expires:wl,domain:u==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),o(!1),window.location.reload()},s=()=>{r("apol-cookie-banner",!0,{path:"/",expires:wl}),bl.forEach(u=>{if(u==="apol-cookie-banner"){r(u,!0,{path:"/",expires:wl});return}n(u)}),o(!1)};if(!i)return null;const c=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:s,gtmType:"reject-all"},{id:"accept",onClick:a,gtmType:"accepted-all"}],l=[];return c.forEach(u=>{l.push({variant:u.href?"tertiary":"primary",href:u.href,onClick:u.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${u.gtmType}-click`,children:e.formatMessage({id:`${_l}buttons_${u.id}`})})}),x.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[x.jsx("h6",{children:e.formatMessage({id:`${_l}title`})}),x.jsx("p",{children:e.formatMessage({id:`${_l}text`})}),x.jsx(na,{buttons:l})]})},Dr={platform:{order:["events","courses","qanda","articles"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},qanda:{href:"/questions-answers/",gtmType:"q-and-a-click"},articles:{href:"/solution-articles/",gtmType:"articles-click"}},community:{order:["support","post","join","guidelines"],support:{name:"Support FAQ",href:"/pages/support-faq",gtmType:"support-faq-click"},post:{href:"/pages/post-an-article",gtmType:"post-an-article-click"},join:{href:"/pages/who-can-join-the-community",gtmType:"who-can-join-click"},guidelines:{href:"/pages/values-and-guidelines",gtmType:"guidelines-and-values-click"}},company:{order:["story","team","careers","partner","contact"],story:{href:"/pages/our-story",gtmType:"our-story-click"},team:{href:"/pages/meet-our-team",gtmType:"team-click"},careers:{href:"/pages/careers",gtmType:"careers-click"},partner:{href:"/partnerships/",gtmType:"partner-with-us-click"},contact:{href:"/pages/get-in-touch",gtmType:"contact-click"},child:"legal"},legal:{order:["privacy","terms","cookie","accessibility"],privacy:{href:"https://about.apolitical.co/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"https://about.apolitical.co/terms-and-conditions",gtmType:"terms-conditions-link"},cookie:{href:"/pages/cookie-policy",gtmType:"cookie-policy-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:Ni["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Ni["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["correspondence","registered","berlin","support","business"],correspondence:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:Ni.support,gtmType:"concierge-email-click"},business:{email:Ni.general,gtmType:"hello-email-click"}}},social:{order:["linkedin","twitter","facebook"],linkedin:{href:"https://www.linkedin.com/company/apolitical"},twitter:{href:"https://twitter.com/apoliticalco"},facebook:{href:"https://www.facebook.com/apoliticalco"}}};const Ii="footer_",du="SiteFooter",Hm=({group:e})=>{const t=Dr[e].order||[];let r=!1;return"text"in Dr[e]&&(r=Dr[e].text),x.jsxs(U.Fragment,{children:[x.jsx("p",{className:"pre-title",children:x.jsx(ln,{id:`${Ii}${e}`})}),Array.isArray(t)&&t.length>0&&x.jsx("ul",{className:"text-medium",children:t.map(n=>{if(["order","child","text"].includes(n))return null;const{href:i,gtmType:o}=Dr[e][n],a={};return["legal"].includes(e)&&(a.target="_blank",a.rel="noopener"),x.jsx("li",{children:x.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":du,"data-gtm-event-type":o,...a,children:x.jsx(ln,{id:`${Ii}${e}_${n}`})})},`${e}_${n}`)})}),typeof r!="boolean"&&"order"in r&&Array.isArray(r.order)&&x.jsx("dl",{className:"text-medium",children:r.order.map(n=>x.jsxs(U.Fragment,{children:[x.jsx("dt",{children:x.jsx(ln,{id:`${Ii}${e}_${n}`})}),x.jsxs("dd",{children:[typeof r!="boolean"&&r[n].address&&x.jsx("address",{children:x.jsx(ln,{id:`${Ii}${e}_${n}_address`,values:{br:x.jsx("br",{})}})}),typeof r!="boolean"&&r[n].email&&x.jsx("a",{href:`mailto:${r[n].email}`,className:"gtm-trackable","data-gtm-event-context":du,"data-gtm-event-type":r[n].gtmType,children:r[n].email})]})]},`dl-${e}-${n}`))})]},e)},ch=()=>x.jsx("div",{id:"footer",children:x.jsxs("div",{className:"wrapper",children:[x.jsx(Of,{element:"hr"}),x.jsx(uh,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":du,"data-gtm-event-type":"logo-homepage-link"}),x.jsx("footer",{children:["platform","community","company","contact"].map(e=>x.jsxs("div",{className:"group",children:[x.jsx(Hm,{group:e}),Object.keys(Dr[e]).includes("child")&&x.jsx(Hm,{group:Dr[e].child})]},e))}),x.jsx("hr",{}),x.jsxs("div",{className:"sub-footer",children:[x.jsx("ul",{children:Array.isArray(Dr.social.order)&&Dr.social.order.map(e=>{const t=Dr.social[e];return x.jsx("li",{className:e,children:x.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":du,"data-gtm-event-type":"social-click",children:x.jsx("span",{className:"hidden",children:x.jsx(ln,{id:`${Ii}social_${e}`})})})},e)})}),x.jsx("small",{children:x.jsx(ln,{id:`${Ii}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})});const Ba="emailHelperTextBox_",pP=({type:e,email:t,redirectPath:r,resendVerificationCode:n})=>{const i=Oe(),[o,a]=U.useState({path:`${Ba}default`,type:"default",link:{},mail:{},error:""}),[s,c]=U.useState(!1),l=U.useCallback(f=>{f.preventDefault(),f.stopPropagation();const p=m=>{a({path:`${Ba}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:_=>l(_),href:"#","data-testid":"send-verify-email-click"},mail:{href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"ErrorVerifyingBox","data-gtm-event-type":"email-concierge-click"},error:m})};if(typeof n!="function"){p(i.formatMessage({id:`${Ba}error_noFunction`}));return}c(!0),n(t).then(()=>{localStorage.setItem("email",t),window.location.href=r||"/signup/verify-email"}).catch(m=>{p(m.message)}).finally(()=>{c(!1)})},[t,r,n]);U.useEffect(()=>{let f=Ba,p="default",m={},_={};switch(e){case"gov":f+="autoApproved",p="success";break;case"nonGov":f+="unrecognisedEmail",p="error",m={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":f+="pendingApproval",p="error",_={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":f+="emailUnverified",p="error",m={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:S=>l(S),"data-testid":"send-verify-email-click"};break;case"exists":f+="emailAlreadyExists",p="error",m={href:"/user-onboarding/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},_={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:f+="default",m={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}a({...o,path:f,type:p,link:m,mail:_})},[e]);const u={};return["link","mail"].forEach(f=>{u[f]=Object.keys(o[f]).length?p=>x.jsx("a",{...o[f],children:p}):p=>p}),x.jsx(A0,{type:o.type,heading:s?!1:i.formatMessage({id:`${o.path}_title`}),children:s?x.jsxs(x.Fragment,{children:[x.jsx(yr,{element:"span"}),x.jsx(yr,{element:"span"})]}):i.formatMessage({id:`${o.path}_text`},{...u,strong:f=>x.jsx("strong",{children:f}),em:f=>x.jsx("em",{children:f}),br:x.jsxs(x.Fragment,{children:[x.jsx("br",{}),x.jsx("br",{})]}),error:o.error})})};const Ua="passwordRules_",dE="isMoreThanEightCharacters",pE="includesNumberAndSymbol",mE="includesLowerAndUppercase",mP={[dE]:"8Characters",[pE]:"numberSymbol",[mE]:"lowercaseUppercase"},gP=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const r=Oe();return x.jsxs("aside",{className:se("password-rules",t),children:[x.jsx("small",{children:r.formatMessage({id:`${Ua}intro`})}),x.jsx("ul",{children:[dE,pE,mE].map(n=>x.jsxs("li",{className:se({matches:e[n]}),children:[x.jsxs(lt,{children:[r.formatMessage({id:`${Ua}rule_label`})," "]}),x.jsx("span",{children:r.formatMessage({id:`${Ua}rule_${mP[n]}`})}),!e[n]&&x.jsxs(lt,{element:"strong",children:[" "," ",r.formatMessage({id:`${Ua}notMet`})]})]},`rule-${n}`))})]})},yP=U.memo(gP);const vP=({text:e={},topRating:t=5,functions:{createRating:r=()=>null,updateRating:n=()=>{},reportError:i=()=>{}},className:o="",hasLoaded:a=!1})=>{const s=Oe(),[c,l]=U.useState({setUp:!1,id:null,rating:null,disabled:!0}),u=async()=>{try{const S=await r();l(v=>({...v,setUp:!0,id:S&&S.id,disabled:!1}))}catch(S){l(v=>({...v,setUp:!0,disabled:!0})),i(S)}};if(U.useEffect(()=>{a&&!c.setUp&&u()},[a]),!a)return x.jsx(yr,{className:"rating-placeholder"});const{id:d,rating:h,disabled:f}=c,p="ratings_",m={text:s.formatMessage({id:`${p}text`}),low:s.formatMessage({id:`${p}low`}),high:s.formatMessage({id:`${p}high`}),success:s.formatMessage({id:`${p}success`}),...e},_=async S=>{if(!(!d||f))try{l(v=>({...v,rating:S,disabled:!0})),await n({id:d,value:S})}catch(v){l(b=>({...b,rating:null})),i(v)}finally{l(v=>({...v,disabled:!1}))}};return x.jsxs("div",{className:se("rating",o),children:[x.jsx("span",{className:"label",children:m[h?"success":"text"]}),x.jsx("ol",{children:Array.from(new Array(t).keys()).map(S=>{const v=S+1;return x.jsx("li",{className:se({selected:h&&v<=h}),children:x.jsx(ze,{variant:"tertiary",size:"small",icon:{icon:`star${!h||v>h?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${s.formatMessage({id:`${p}stars`},{number:v,total:t})}${v===1||v===t?` - ${m[v===1?"low":"high"]}`:""}`,onClick:b=>{b.preventDefault(),b.stopPropagation(),_(v)},disabled:f})},`rating-${v}`)})})]})};const gE=({id:e="search",className:t="",handleToggle:r=!1,defaultValue:n="",gtmContext:i="search-bar",gtmEvent:o="form-submission"})=>{const{searchIsOpen:a=!0,isDesktopVersion:s=!1}=r||{},c=Oe(),l=U.useRef(null);ri(()=>{!r||s||!a||l.current&&l.current.focus()},[a]);const u=d=>{d.preventDefault(),d.stopPropagation(),!(!l.current||!l.current.value||l.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(l.current.value)}`)};return x.jsx("form",{onSubmit:u,className:se("search-form gtm-trackable",t),"data-gtm-event-context":i,"data-gtm-event-type":o,children:x.jsx("fieldset",{id:`${e}-form`,hidden:r?!a:!1,role:"search",children:x.jsxs("p",{children:[x.jsx(lt,{element:"label",htmlFor:e,children:c.formatMessage({id:"search_label"})}),x.jsx("input",{ref:l,type:"search",id:e,name:e,defaultValue:n,placeholder:c.formatMessage({id:"search_placeholder"}),onKeyDown:d=>{d.key==="Enter"&&u(d)}}),x.jsx("button",{className:"clear",onClick:d=>{d.preventDefault(),d.stopPropagation(),l.current&&l.current.value&&(l.current.value="")},children:x.jsx(lt,{children:c.formatMessage({id:"search_clear"})})}),x.jsx("button",{className:"search",onClick:u,children:x.jsx(lt,{children:c.formatMessage({id:"search_cta"})})})]})})})};var EP="Expected a function",yE="__lodash_hash_undefined__",vE=1/0,_P="[object Function]",bP="[object GeneratorFunction]",wP="[object Symbol]",SP=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,TP=/^\w*$/,xP=/^\./,OP=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,AP=/[\\^$.*+?()[\]{}|]/g,CP=/\\(\\)?/g,RP=/^\[object .+?Constructor\]$/,PP=typeof fe=="object"&&fe&&fe.Object===Object&&fe,NP=typeof self=="object"&&self&&self.Object===Object&&self,lh=PP||NP||Function("return this")();function IP(e,t){return e==null?void 0:e[t]}function LP(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var kP=Array.prototype,MP=Function.prototype,EE=Object.prototype,Sl=lh["__core-js_shared__"],qm=function(){var e=/[^.]+$/.exec(Sl&&Sl.keys&&Sl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),_E=MP.toString,fh=EE.hasOwnProperty,bE=EE.toString,FP=RegExp("^"+_E.call(fh).replace(AP,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gm=lh.Symbol,DP=kP.splice,BP=wE(lh,"Map"),ks=wE(Object,"create"),Vm=Gm?Gm.prototype:void 0,Wm=Vm?Vm.toString:void 0;function oi(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function UP(){this.__data__=ks?ks(null):{}}function $P(e){return this.has(e)&&delete this.__data__[e]}function jP(e){var t=this.__data__;if(ks){var r=t[e];return r===yE?void 0:r}return fh.call(t,e)?t[e]:void 0}function HP(e){var t=this.__data__;return ks?t[e]!==void 0:fh.call(t,e)}function qP(e,t){var r=this.__data__;return r[e]=ks&&t===void 0?yE:t,this}oi.prototype.clear=UP;oi.prototype.delete=$P;oi.prototype.get=jP;oi.prototype.has=HP;oi.prototype.set=qP;function vo(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function GP(){this.__data__=[]}function VP(e){var t=this.__data__,r=Iu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():DP.call(t,r,1),!0}function WP(e){var t=this.__data__,r=Iu(t,e);return r<0?void 0:t[r][1]}function zP(e){return Iu(this.__data__,e)>-1}function QP(e,t){var r=this.__data__,n=Iu(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}vo.prototype.clear=GP;vo.prototype.delete=VP;vo.prototype.get=WP;vo.prototype.has=zP;vo.prototype.set=QP;function ci(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function YP(){this.__data__={hash:new oi,map:new(BP||vo),string:new oi}}function KP(e){return Lu(this,e).delete(e)}function XP(e){return Lu(this,e).get(e)}function JP(e){return Lu(this,e).has(e)}function ZP(e,t){return Lu(this,e).set(e,t),this}ci.prototype.clear=YP;ci.prototype.delete=KP;ci.prototype.get=XP;ci.prototype.has=JP;ci.prototype.set=ZP;function Iu(e,t){for(var r=e.length;r--;)if(lN(e[r][0],t))return r;return-1}function eN(e,t){t=iN(t,e)?[t]:nN(t);for(var r=0,n=t.length;e!=null&&r<n;)e=e[uN(t[r++])];return r&&r==n?e:void 0}function tN(e){if(!TE(e)||sN(e))return!1;var t=fN(e)||LP(e)?FP:RP;return t.test(cN(e))}function rN(e){if(typeof e=="string")return e;if(dh(e))return Wm?Wm.call(e):"";var t=e+"";return t=="0"&&1/e==-vE?"-0":t}function nN(e){return SE(e)?e:aN(e)}function Lu(e,t){var r=e.__data__;return oN(t)?r[typeof t=="string"?"string":"hash"]:r.map}function wE(e,t){var r=IP(e,t);return tN(r)?r:void 0}function iN(e,t){if(SE(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||dh(e)?!0:TP.test(e)||!SP.test(e)||t!=null&&e in Object(t)}function oN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function sN(e){return!!qm&&qm in e}var aN=hh(function(e){e=dN(e);var t=[];return xP.test(e)&&t.push(""),e.replace(OP,function(r,n,i,o){t.push(i?o.replace(CP,"$1"):n||r)}),t});function uN(e){if(typeof e=="string"||dh(e))return e;var t=e+"";return t=="0"&&1/e==-vE?"-0":t}function cN(e){if(e!=null){try{return _E.call(e)}catch{}try{return e+""}catch{}}return""}function hh(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(EP);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a),a};return r.cache=new(hh.Cache||ci),r}hh.Cache=ci;function lN(e,t){return e===t||e!==e&&t!==t}var SE=Array.isArray;function fN(e){var t=TE(e)?bE.call(e):"";return t==_P||t==bP}function TE(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function hN(e){return!!e&&typeof e=="object"}function dh(e){return typeof e=="symbol"||hN(e)&&bE.call(e)==wP}function dN(e){return e==null?"":rN(e)}function pN(e,t,r){var n=e==null?void 0:eN(e,t);return n===void 0?r:n}var mN=pN;const xE=Er(mN),Fe={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const r={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},n=o=>{const a=`logged${e?"In":"Out"}`;return t>=r[o][a]};let i={};return["navigation","search"].forEach(o=>{i[o]=n(o)}),i},shouldChangeHeaderIsVisible:(e,t,r)=>{Object.values(t).filter(i=>i===!0).length||r([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:r,dispatch:n})=>{if(r[e]===t||e==="account"&&t===!1&&r.navigation===!0)return;const i=Date.now();if(!t&&Fe.handlerCalled[e]&&i-Fe.handlerCalled[e]<500)return;Fe.handlerCalled[e]=i;let o=[{type:`menus.${e}`,value:t}];t===!0&&Object.keys(r).forEach(a=>{a===e||r[a]===!1||o.push({type:`menus.${a}`,value:!1})}),n(o)},findFirstChild:(e,t,r=!1)=>{if(!e||!e[0])return!1;for(let n=0;n<=e.length;n++){if(!e[n])continue;if(e[n][t]&&(!r||e[n][t].includes(r)))return e[n];if(!t.includes("."))continue;const i=xE(e[n],t);if(!(typeof i>"u")&&(!r||i[t]&&i[t].includes(r)||i.value&&i.value.includes(r)||i.toString().includes(r)))return e[n]}return e[0].children?Fe.findFirstChild(e[0].children,t,r):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:r,focusElements:n,dispatch:i})=>{if(!t.current||!t.current.children)return;const o=r?"desktop":"default";if(n[e][o]){n[e][o].focus();return}let a,s;switch(e){case"navigation":if(r){const c=Fe.findFirstChild(t.current.children,"attributes.aria-controls","navigation");a=Fe.findFirstChild(c.children,"href")}else a=Fe.findFirstChild(t.current.children,"href");a||(a=t.current);break;case"account":if(s=Fe.findFirstChild(t.current.children,"className","account"),!s||!s.children)return;a=Fe.findFirstChild(s.children,"href");break;default:return}a&&(i([{type:`focusElements.${e}.${o}`,value:a}]),a.focus())},events:{onClick:(e,{id:t,callback:r,isOpen:n})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(Fe.timeouts[t]),r(t,!n))},onFocus:({id:e})=>{clearTimeout(Fe.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(Fe.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{Fe.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},Ms={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},topics:{order:["explore","topics"],menuId:"navigation",explore:{order:["events","courses","q-and-a","articles"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},"q-and-a":{href:"/questions-answers/",className:"icon q-and-a"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"}},topics:{order:["climate","cities-and-local-government","digital-and-data","education","equity-justice-and-inclusion","health-and-social-care","innovation","leadership-and-skills","life-in-government","policymaking","transport-and-infrastructure","work-and-the-economy"],className:"columns",climate:{href:"/topics/climate/"},"cities-and-local-government":{href:"/topics/cities-and-local-government/"},"digital-and-data":{href:"/topics/digital-and-data/"},education:{href:"/topics/education/"},"equity-justice-and-inclusion":{href:"/topics/equity-justice-and-inclusion/"},"health-and-social-care":{href:"/topics/health-and-social-care/"},innovation:{href:"/topics/innovation/"},"leadership-and-skills":{href:"/topics/leadership-and-skills/"},"life-in-government":{href:"/topics/life-in-government/"},policymaking:{href:"/topics/policymaking/"},"transport-and-infrastructure":{href:"/topics/transport-and-infrastructure/"},"work-and-the-economy":{href:"/topics/work-and-the-economy/"}}},partners:{href:"/partnerships/",onlyShow:"logged-out"},account:{order:["profile","settings","log-out"],className:"account",onlyShow:"logged-in",doTrack:!1,profile:{href:"/profiles/me"},settings:{href:"/profiles/me/manage-account"},"log-out":{href:"/user-onboarding/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/user-onboarding/login"},signup:{href:"/signup/?ref=header-banner",props:{variant:"primary"}}}},pu=({id:e,isLoggedIn:t=!1,isDesktopVersion:r=!1,menus:n={},callback:i=()=>{},doTrack:o=null})=>{const a=Oe(),s=xE(Ms,e);if(!s||s.onlyShow&&(s.onlyShow==="logged-in"&&!t||s.onlyShow==="logged-out"&&t))return null;const c="doTrack"in s,l=o===null?c?s.doTrack:!0:o,u=e.includes("buttons.");let d=`header_${e.replaceAll(".","_")}`;s.hasVariantText&&(d+=`_logged${t?"In":"Out"}`);let h=!1;if(s.href){let v=s.gtmType||`${e}-click`;if(v.includes(".")){const b=v.split("."),T=b[b.length-2];v=`${T==="topics"?`${T}-`:""}${b[b.length-1]}`}h={href:s.href,role:"menuitem"},l&&(h={...h,className:"gtm-trackable","data-gtm-event-type":v,"data-gtm-event-context":"HeaderButtons"}),u&&(h={...h,variant:"secondary",size:{mobile:"small",881:"large"},...s.props||{}})}const f=s.order&&s.order[0]&&s[s.order[0]],p=f&&s[s.order[0]].order,m=h&&window.location.pathname===s.href;let _={},S={};if(f){const v=s.menuId||e,b={onClick:T=>Fe.events.onClick(T,{id:v,callback:i,isOpen:n[v]}),onFocus:()=>Fe.events.onFocus({id:v}),onBlur:()=>Fe.events.onBlur({id:v,callback:i}),onMouseLeave:()=>Fe.events.onBlur({id:v,callback:i}),onMouseEnter:()=>Fe.events.onMouseEnter({id:v,callback:i})};r&&(p&&(_={...b,onKeyPress:T=>{T.key==="Enter"&&Fe.events.onClick(T,{id:v,callback:i,isOpen:n[v]})},tabIndex:"0","aria-haspopup":!0,"aria-expanded":n[v],"aria-controls":v}),S={hidden:v in n?!n[v]:!0}),p||(S={...S,...b})}return x.jsxs("li",{className:se({[s.className]:s.className,"has-submenu":f,parent:p,active:m}),role:"none",..._,children:[h?U.createElement(u?ze:"a",h,a.formatMessage({id:d})):a.formatMessage({id:d}),s.order&&x.jsx("ul",{...S,children:s.order.map(v=>{if(!s[v])return null;const b={isLoggedIn:t,isDesktopVersion:r,menus:n,callback:i,doTrack:c?l:null};return s[v].order?x.jsxs("li",{className:se({[s[v].className]:s[v].className}),children:[a.formatMessage({id:`${d}_${v}`}),x.jsx("ul",{children:s[v].order.map(T=>x.jsx(pu,{id:`${e}.${v}.${T}`,...b},T))})]},v):x.jsx(pu,{id:`${e}.${v}`,...b},v)})})]},e)};const gN={height:67,height_desktop:83},ph=()=>{const e=Oe(),t=U.useContext($r),r=ra(!0,!0),n=t&&typeof t.id=="string",i=U.useMemo(()=>Fe.getIsDesktopVersion(n,r),[n,r]),[o,a]=U.useReducer(_O,{headerIsVisible:!0,menus:{navigation:!1,search:!1,account:!1},focusElements:{navigation:{desktop:!1,default:!1},account:{desktop:!1,default:!1}}}),{headerIsVisible:s,menus:c,focusElements:l}=o;gv({scrollPosition:gN[`height${i.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{!i&&c.navigation||Fe.shouldChangeHeaderIsVisible(!0,c,a)},scrollDown:()=>{!i&&c.navigation||Fe.shouldChangeHeaderIsVisible(!1,c,a)}}});const u=(h,f)=>{Fe.handleMenus({id:h,value:f,menus:c,dispatch:a})},d=U.useRef(null);return ri(()=>{c.navigation&&Fe.autoFocus({menu:"navigation",navigationRef:d,isDesktopVersion:i.navigation,focusElements:l,dispatch:a})},[c.navigation]),ri(()=>{c.account&&Fe.autoFocus({menu:"account",navigationRef:d,isDesktopVersion:i.navigation,focusElements:l,dispatch:a})},[c.account]),t&&t.isLoading?null:x.jsxs(x.Fragment,{children:[x.jsxs("nav",{id:"header",className:se({"logged-in":n,"logged-out":!n,visible:s}),children:[x.jsx(lt,{element:"a",href:"#content-of-page",children:e.formatMessage({id:"header_skip"})}),x.jsx(uh,{}),!i.navigation&&x.jsx("button",{className:"menu-button gtm-trackable",onClick:h=>{h.preventDefault(),h.stopPropagation(),u("navigation",!c.navigation)},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":c.navigation,"aria-controls":"navigation",children:x.jsx(lt,{children:e.formatMessage({id:`header_menu_${c.navigation?"hide":"show"}`})})}),x.jsx("ul",{ref:d,id:"navigation",hidden:i.navigation||c.account?!1:!c.navigation,role:"menu","data-showing":!i.navigation&&c.account?"account":"default",children:Ms.order.map(h=>x.jsx(pu,{id:h,isLoggedIn:n,isDesktopVersion:i.navigation,menus:{navigation:c.navigation,account:c.account},callback:u},h))}),!i.search&&x.jsx("button",{className:"search toggle-search-button",onClick:h=>{h.preventDefault(),h.stopPropagation(),u("search",!c.search)},"aria-haspopup":"true","aria-expanded":c.search,"aria-controls":"search-form",children:x.jsx(lt,{children:e.formatMessage({id:`header_search_${c.search?"hide":"show"}`})})}),x.jsx(gE,{id:"global-search",handleToggle:{searchIsOpen:c.search,isDesktopVersion:i.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"}),n?x.jsxs("button",{className:"account-button",onClick:h=>Fe.events.onClick(h,{id:"account",callback:u,isOpen:c.account}),onMouseEnter:()=>Fe.events.onMouseEnter({id:"account",callback:u}),onMouseLeave:()=>Fe.events.onBlur({id:"account",callback:u}),"aria-haspopup":"true","aria-expanded":c.account,"aria-controls":"navigation",children:[x.jsx(lt,{children:e.formatMessage({id:`header_account_${c.account?"hide":"show"}`})}),x.jsx(Ou,{name:t&&t.name||"",src:t&&t.image&&t.image.thumbnail||""})]}):x.jsx("ul",{className:"sign-in-buttons",children:Ms.buttons.order.map(h=>x.jsx(pu,{id:`buttons.${h}`},h))})]}),x.jsx("hr",{id:"content-of-page"}),x.jsx("div",{className:se("overlay",{open:c.navigation||c.account||!i.search&&c.search})})]})},yN=U.createContext(null),Tl={didCatch:!1,error:null};class vN extends U.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Tl}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:o,reason:"imperative-api"}),this.setState(Tl)}}componentDidCatch(t,r){var n,i;(n=(i=this.props).onError)===null||n===void 0||n.call(i,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:i}=this.props;if(n&&r.error!==null&&EN(t.resetKeys,i)){var o,a;(o=(a=this.props).onReset)===null||o===void 0||o.call(a,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(Tl)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:i}=this.props,{didCatch:o,error:a}=this.state;let s=t;if(o){const c={error:a,resetErrorBoundary:this.resetErrorBoundary};if(U.isValidElement(i))s=i;else if(typeof r=="function")s=r(c);else if(n)s=U.createElement(n,c);else throw a}return U.createElement(yN.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function EN(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}const _N=()=>{const e=Oe();return x.jsxs(x.Fragment,{children:[x.jsx(ph,{}),x.jsx("div",{className:"content",children:x.jsx(aa,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),x.jsx(ch,{})]})},bN=({children:e,reportError:t,showFooter:r=!0,background:n="default",className:i="",locale:o="en"})=>{const a=hg();U.useEffect(()=>{window.scrollTo(0,0)},[a]);const s=Av(e,{locale:o});return x.jsx(vN,{onError:t,fallback:x.jsx(_N,{}),children:x.jsx(U.Suspense,{fallback:x.jsx(I0,{layout:"overview-page"}),children:x.jsx("div",{id:"wrapper",className:se(i,{[n]:n!=="default"}),children:x.jsxs(e_,{children:[x.jsx(ph,{}),x.jsx("div",{className:"content",children:s}),r&&x.jsx(ch,{}),x.jsx(hE,{})]})})})})},zm={default:"tags_",headerTopics:"header_topics_topics_"},xl={topic:{Climate:"climate",CitiesAndLocalGovernment:"cities-and-local-government",DigitalAndData:"digital-and-data",Education:"education",EquityJusticeAndInclusion:"equity-justice-and-inclusion",HealthAndSocialCare:"health-and-social-care",Innovation:"innovation",LeadershipAndSkills:"leadership-and-skills",LifeInGovernment:"life-in-government",Policymaking:"policymaking",TransportAndInfrastructure:"transport-and-infrastructure",WorkAndTheEconomy:"work-and-the-economy"},"from the community":"community"},wN={getTagDetails:e=>{if(e.includes("topic_")){if(e=xl.topic[e.replace("topic_","")],e){const t=Ms.topics.topics[e].href;return t?{id:e,href:t,text:`${zm.headerTopics}${e}`}:null}return null}return xl[e]?(e=xl[e],{id:e,text:`${zm.default}${e}`}):null}};const SN=({tags:e=[],color:t="default",forceOneLine:r=!1,canHaveLinks:n=!0,className:i="",gtmType:o="tag-click",gtmContext:a="tags"})=>{const s=Oe();if(!e||e.length<1)return null;const c=[];return e.forEach(l=>{if(!l)return;const u=wN.getTagDetails(l);u&&c.push(u)}),c.length<1?null:x.jsx("ul",{className:se("tags text-small",t,i,{"one-line":r}),children:c.map(l=>{const u=s.formatMessage({id:l.text});return x.jsx("li",{children:l.href&&n?x.jsx("a",{href:l.href,className:"gtm-trackable","data-gtm-event-type":o,"data-gtm-event-context":a,children:u}):u},l.id)})})};const TN=({members:{total:e,data:t=[]},pagination:r,gtmContext:n="member",gtmType:i="member-click",className:o=""})=>{const a=Oe();return t.length===0?null:(e||(e=t.length),x.jsxs("div",{className:se("members-list",o),children:[x.jsxs("h1",{children:[a.formatMessage({id:"membersList"}),x.jsx("span",{className:"count",children:e})]}),x.jsx("ul",{children:t.map((s,c)=>x.jsxs("li",{children:[x.jsx(Au,{member:s,gtmContext:n,gtmType:i}),s.isAdmin&&x.jsx(R0,{children:a.formatMessage({id:"membersList_admin"})})]},c))}),r&&x.jsx(lE,{...r,icon:{icon:"arrow-down",position:"right"},gtmContext:n})]}))};function xf(){return xf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xf.apply(this,arguments)}function xN(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o<n.length;o++)i=n[o],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var ON=U.useLayoutEffect,AN=function(t){var r=pe.useRef(t);return ON(function(){r.current=t}),r},Qm=function(t,r){if(typeof t=="function"){t(r);return}t.current=r},CN=function(t,r){var n=U.useRef();return U.useCallback(function(i){t.current=i,n.current&&Qm(n.current,null),n.current=r,r&&Qm(r,i)},[r])},Ym={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},RN=function(t){Object.keys(Ym).forEach(function(r){t.style.setProperty(r,Ym[r],"important")})},Km=RN,vt=null,Xm=function(t,r){var n=t.scrollHeight;return r.sizingStyle.boxSizing==="border-box"?n+r.borderSize:n-r.paddingSize};function PN(e,t,r,n){r===void 0&&(r=1),n===void 0&&(n=1/0),vt||(vt=document.createElement("textarea"),vt.setAttribute("tabindex","-1"),vt.setAttribute("aria-hidden","true"),Km(vt)),vt.parentNode===null&&document.body.appendChild(vt);var i=e.paddingSize,o=e.borderSize,a=e.sizingStyle,s=a.boxSizing;Object.keys(a).forEach(function(h){var f=h;vt.style[f]=a[f]}),Km(vt),vt.value=t;var c=Xm(vt,e);vt.value=t,c=Xm(vt,e),vt.value="x";var l=vt.scrollHeight-i,u=l*r;s==="border-box"&&(u=u+i+o),c=Math.max(u,c);var d=l*n;return s==="border-box"&&(d=d+i+o),c=Math.min(d,c),[c,l]}var Jm=function(){},NN=function(t,r){return t.reduce(function(n,i){return n[i]=r[i],n},{})},IN=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],LN=!!document.documentElement.currentStyle,kN=function(t){var r=window.getComputedStyle(t);if(r===null)return null;var n=NN(IN,r),i=n.boxSizing;if(i==="")return null;LN&&i==="border-box"&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px");var o=parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),a=parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth);return{sizingStyle:n,paddingSize:o,borderSize:a}},MN=kN;function OE(e,t,r){var n=AN(r);pe.useLayoutEffect(function(){var i=function(a){return n.current(a)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var FN=function(t){OE(window,"resize",t)},DN=function(t){OE(document.fonts,"loadingdone",t)},BN=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],UN=function(t,r){var n=t.cacheMeasurements,i=t.maxRows,o=t.minRows,a=t.onChange,s=a===void 0?Jm:a,c=t.onHeightChange,l=c===void 0?Jm:c,u=xN(t,BN),d=u.value!==void 0,h=pe.useRef(null),f=CN(h,r),p=pe.useRef(0),m=pe.useRef(),_=function(){var b=h.current,T=n&&m.current?m.current:MN(b);if(T){m.current=T;var w=PN(T,b.value||b.placeholder||"x",o,i),N=w[0],R=w[1];p.current!==N&&(p.current=N,b.style.setProperty("height",N+"px","important"),l(N,{rowHeight:R}))}},S=function(b){d||_(),s(b)};return pe.useLayoutEffect(_),FN(_),DN(_),pe.createElement("textarea",xf({},u,{onChange:S,ref:f}))},$N=pe.forwardRef(UN);let $a=null;const Ot="discussion_form_",mh=({content:e={type:"response",slugs:{}},userHasPermissions:t=!0,meta:r={isLoading:!1,isInWrapper:!1,isEditing:!1,showTitle:!1},inputRef:n,maxLength:i=5e4,minRows:o=4,forceShow:a={cancel:!1,error:!1},functions:s={create:()=>{},handleSaveEdit:()=>{},handleCancel:()=>{},callback:()=>{},props:{create:{projectNames:["questions-answers"]}}},gtmContext:c="DiscussionForm"})=>{var $,G;const l=Oe(),u=U.useContext($r),[d,h]=U.useState(r.isEditing&&r.isEditing.text||""),[f,p]=U.useState(a.error||!1),[m,_]=U.useState(!1),S=U.useRef(null);if(n||(n=S),r.isLoading)return x.jsx(yr,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const v=q=>{const H=q.target.value;h(H);let Y;!u||!u.id?Y=ar(l.formatMessage,`${Ot}error_loggedOut`,e.type,"action"):t?H.length>=i&&(Y=`${Ot}error_tooLong`):Y=ar(l.formatMessage,`${Ot}error_noPermission`,e.type,"action"),Y?p(Y):f&&p(!1)};let b=`${e.type}-form`;if(e.type==="response"||e.type==="reply"){const q=e.type==="response"?(($=e.slugs)==null?void 0:$.question)||"":((G=e.slugs)==null?void 0:G.answer)||"";q&&(b=`${b}-${q.slice(-15)}`)}const T=async q=>{var Y;if(q.preventDefault(),q.stopPropagation(),!u||!u.id||!t||N)return;$a&&clearTimeout($a),_("submitting");const H=window.location.pathname;try{let ie;switch(e.type){case"post":ie=await s.create({content:d});break;case"question":ie=await s.create({title:d,authorId:u&&u.id,...(Y=s.props)==null?void 0:Y.create});break;case"response":ie=await s.create({question:e.slugs.question},{body:d,authorId:u&&u.id,contentPath:H});break;case"reply":ie=await s.create({question:e.slugs.question,answer:e.slugs.answer},{body:d,authorId:u&&u.id,contentPath:H});break;default:break}await SO(1e3),s.callback&&await s.callback(ie),$a=setTimeout(()=>{h(""),_("submitted"),w()},500)}catch(ie){const K=ie;let k=`${Ot}error`;K.message.includes("entry already exists")&&(k=ar(l.formatMessage,`${Ot}error_alreadyExists`,e.type,"action")),K.message.includes("429")?k=ar(l.formatMessage,`${Ot}error_tooMany`,e.type,"action"):K.message.includes("400")&&(k=`${Ot}error`),p(k),w()}},w=()=>{$a=setTimeout(()=>{p(!1),_(!1)},5e3)},N=!d||!RO(d),R=m==="submitting",L=[];return(r.isEditing&&!R||a.cancel)&&L.push({variant:"secondary",size:{mobile:"small",600:"medium"},onClick:s.handleCancel,className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":`cancel-${e.type}-click`,disabled:!a.cancel&&(!u||!u.id||!d),children:l.formatMessage({id:`${Ot}cancel`})}),L.push({variant:"primary",size:{mobile:"small",600:"medium"},onClick:q=>{if(r.isEditing){_("submitting"),s.handleSaveEdit&&s.handleSaveEdit(S.current&&"value"in S.current?S.current.value:"");return}T(q)},className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":`${r.isEditing?"save":"submit"}-${e.type}-click`,"data-testid":"save-button",disabled:!u||!u.id||!t||N||R||r.isEditing&&d===r.isEditing.text,children:l.formatMessage({id:`${Ot}${R?r.isEditing?"saving":"posting":r.isEditing?"save":"post"}`})}),x.jsxs("form",{id:b,className:se("discussion-card discussion-form",{"no-styling":r.isInWrapper&&r.isEditing}),"data-testid":`discussion-${e.type}-form`,children:[(r==null?void 0:r.showTitle)&&!r.isEditing&&["question"].includes(e.type)&&x.jsx("h2",{children:ar(l.formatMessage,`${Ot}title`,e.type,"action")}),x.jsx(Au,{member:u||"community",gtmContext:c,gtmType:"profile-click"}),x.jsx(lt,{element:"label",showOnFocus:!1,htmlFor:`${b}-input`,children:ar(l.formatMessage,`${Ot}label`,e.type,"action")}),x.jsx($N,{ref:n,id:`${b}-input`,name:e.type,placeholder:ar(l.formatMessage,`${Ot}placeholder`,e.type,"action"),onChange:v,value:d,maxLength:i,"aria-invalid":!!f,"aria-errormessage":"error-message",minRows:o,autoFocus:!!r.isEditing}),x.jsx("small",{children:ar(l.formatMessage,`${Ot}explainer`,e.type,"action",{a:q=>x.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":"community-guidelines-link",children:q})})}),x.jsx(na,{buttons:L}),m==="submitted"&&x.jsx(nu,{className:"success","data-testid":"success",children:ar(l.formatMessage,`${Ot}success`,e.type,"action")}),f&&x.jsx(nu,{id:"error-message",className:"error","data-testid":"error",children:a.error?a.error:typeof f=="string"?f.includes(" ")?f:l.formatMessage({id:f},{action:l.formatMessage({id:`discussion_action_${e.type}`}),maxLength:i}):f})]})},gh=({contentType:e,createPost:t,membershipRequiredToPost:{isMember:r,required:n,join:i,leave:o,notMemberStateText:a}})=>n&&!r?x.jsx(aa,{text:a,button:{component:x.jsx(ah,{functions:{join:i,leave:o}})}}):x.jsx(mh,{content:{type:e,slugs:{}},functions:{create:t}}),jN={showThread:!1,showForm:!1},yh=U.createContext(jN),HN=({children:e})=>{const[t,r]=U.useState({showThread:!1,showForm:!1});return x.jsx(yh.Provider,{value:{...t,updateConversation:r},children:e})},qN=({question:e,answer:t,reply:r})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...r&&{replySlug:r}}),GN=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);let Os=!1;const Ol=()=>{Os!==!1&&(clearTimeout(Os),Os=!1)},Al=10,AE=({element:e="div",likes:t=0,peopleWhoLiked:r=!1,isShort:n=!0,userLiked:i=!1,content:o={type:"reply",slugs:{}},canLike:a=!0,functions:{createLike:s=()=>{},deleteLike:c=()=>{}}={}})=>{const l=Oe();U.useEffect(()=>{f(i)},[i]);const[u,d]=U.useState(t),[h,f]=U.useState(i),[p,m]=U.useState(!1),[_,S]=U.useState(!1),v=U.useMemo(()=>GN(r,Al),[r]),b=w=>{if(w.preventDefault(),w.stopPropagation(),S(!1),Os)return Ol(),!1;if(Ol(),p||!a)return!1;Os=setTimeout(T,350)},T=async()=>{if(Ol(),p||!a)return!1;let w=h?u-1:u+1;w<0&&(w=0),m(!0),d(w),f(!h);try{if(o&&o.slugs){const N=qN(o.slugs);h?await c(N):await s(N,{contentPath:window.location.pathname})}}catch{d(t),f(i)}finally{m(!1)}};return U.createElement(e,{className:se("likes-wrapper text-medium action-button",{"show-spinner":p,"is-liked":h,disabled:!a}),onClick:b,onMouseEnter:()=>{S(!0)},onMouseLeave:()=>{S(!1)},onFocus:()=>{S(!0)},onBlur:()=>{S(!1)},children:x.jsxs(x.Fragment,{children:[x.jsx(ze,{variant:"tertiary",size:"medium",icon:{icon:h?"heart":"heart_empty",animate:"bounce"},className:se({"do-animation":h&&!i}),screenreaderText:a?l.formatMessage({id:`discussion_likes_${h?"unlike":"like"}`},{action:l.formatMessage({id:`discussion_action_${o.type}`})}):!1,onClick:b,disabled:!a,"aria-hidden":!a,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${o.type}-click`}),x.jsx("span",{className:se("number-of-likes",{"no-likes":u===0}),"data-testid":"number-of-likes",children:l.formatMessage({id:`discussion_likes${n?"_short":""}`},{number:u})}),r&&x.jsx(o0,{isOpen:_,isLoading:r.length===0,children:r.length&&x.jsxs("ul",{children:[v.map(w=>typeof w=="string"||!w.name?null:x.jsx("li",{children:x.jsx(ia,{href:w.id?`/profiles/${w.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",children:w.name})},w.id||window.btoa(w.name))),r.length>Al&&x.jsx("li",{children:l.formatMessage({id:"discussion_likes_more"},{number:r.length-Al})})]})})]})})};var mu={exports:{}};mu.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",i=1,o=2,a=9007199254740991,s="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",h="[object Error]",f="[object Function]",p="[object GeneratorFunction]",m="[object Map]",_="[object Number]",S="[object Null]",v="[object Object]",b="[object Promise]",T="[object Proxy]",w="[object RegExp]",N="[object Set]",R="[object String]",L="[object Symbol]",$="[object Undefined]",G="[object WeakMap]",q="[object ArrayBuffer]",H="[object DataView]",Y="[object Float32Array]",ie="[object Float64Array]",K="[object Int8Array]",k="[object Int16Array]",Q="[object Int32Array]",ee="[object Uint8Array]",he="[object Uint8ClampedArray]",Z="[object Uint16Array]",X="[object Uint32Array]",le=/[\\^$.*+?()[\]{}|]/g,de=/^\[object .+?Constructor\]$/,Ve=/^(?:0|[1-9]\d*)$/,te={};te[Y]=te[ie]=te[K]=te[k]=te[Q]=te[ee]=te[he]=te[Z]=te[X]=!0,te[s]=te[c]=te[q]=te[u]=te[H]=te[d]=te[h]=te[f]=te[m]=te[_]=te[v]=te[w]=te[N]=te[R]=te[G]=!1;var ae=typeof fe=="object"&&fe&&fe.Object===Object&&fe,De=typeof self=="object"&&self&&self.Object===Object&&self,Ie=ae||De||Function("return this")(),Tt=t&&!t.nodeType&&t,Ct=Tt&&!0&&e&&!e.nodeType&&e,Gt=Ct&&Ct.exports===Tt,oe=Gt&&ae.process,st=function(){try{return oe&&oe.binding&&oe.binding("util")}catch{}}(),Je=st&&st.isTypedArray;function Vt(y,A){for(var I=-1,W=y==null?0:y.length,ge=0,ce=[];++I<W;){var _e=y[I];A(_e,I,y)&&(ce[ge++]=_e)}return ce}function wr(y,A){for(var I=-1,W=A.length,ge=y.length;++I<W;)y[ge+I]=A[I];return y}function er(y,A){for(var I=-1,W=y==null?0:y.length;++I<W;)if(A(y[I],I,y))return!0;return!1}function kt(y,A){for(var I=-1,W=Array(y);++I<y;)W[I]=A(I);return W}function yn(y){return function(A){return y(A)}}function Wt(y,A){return y.has(A)}function Mt(y,A){return y==null?void 0:y[A]}function Ze(y){var A=-1,I=Array(y.size);return y.forEach(function(W,ge){I[++A]=[ge,W]}),I}function zt(y,A){return function(I){return y(A(I))}}function yt(y){var A=-1,I=Array(y.size);return y.forEach(function(W){I[++A]=W}),I}var at=Array.prototype,vn=Function.prototype,O=Object.prototype,g=Ie["__core-js_shared__"],E=vn.toString,C=O.hasOwnProperty,M=function(){var y=/[^.]+$/.exec(g&&g.keys&&g.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),j=O.toString,z=RegExp("^"+E.call(C).replace(le,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),me=Gt?Ie.Buffer:void 0,Ce=Ie.Symbol,Re=Ie.Uint8Array,Pe=O.propertyIsEnumerable,Ee=at.splice,Rt=Ce?Ce.toStringTag:void 0,Hr=Object.getOwnPropertySymbols,En=me?me.isBuffer:void 0,Sr=zt(Object.keys,Object),_n=Yt(Ie,"DataView"),Tr=Yt(Ie,"Map"),bn=Yt(Ie,"Promise"),wn=Yt(Ie,"Set"),Sn=Yt(Ie,"WeakMap"),tr=Yt(Object,"create"),li=ut(_n),Qt=ut(Tr),Eo=ut(bn),_o=ut(wn),bo=ut(Sn),fi=Ce?Ce.prototype:void 0,Tn=fi?fi.valueOf:void 0;function We(y){var A=-1,I=y==null?0:y.length;for(this.clear();++A<I;){var W=y[A];this.set(W[0],W[1])}}function xn(){this.__data__=tr?tr(null):{},this.size=0}function On(y){var A=this.has(y)&&delete this.__data__[y];return this.size-=A?1:0,A}function xr(y){var A=this.__data__;if(tr){var I=A[y];return I===n?void 0:I}return C.call(A,y)?A[y]:void 0}function hi(y){var A=this.__data__;return tr?A[y]!==void 0:C.call(A,y)}function wo(y,A){var I=this.__data__;return this.size+=this.has(y)?0:1,I[y]=tr&&A===void 0?n:A,this}We.prototype.clear=xn,We.prototype.delete=On,We.prototype.get=xr,We.prototype.has=hi,We.prototype.set=wo;function et(y){var A=-1,I=y==null?0:y.length;for(this.clear();++A<I;){var W=y[A];this.set(W[0],W[1])}}function So(){this.__data__=[],this.size=0}function To(y){var A=this.__data__,I=Vr(A,y);if(I<0)return!1;var W=A.length-1;return I==W?A.pop():Ee.call(A,I,1),--this.size,!0}function xo(y){var A=this.__data__,I=Vr(A,y);return I<0?void 0:A[I][1]}function Oo(y){return Vr(this.__data__,y)>-1}function An(y,A){var I=this.__data__,W=Vr(I,y);return W<0?(++this.size,I.push([y,A])):I[W][1]=A,this}et.prototype.clear=So,et.prototype.delete=To,et.prototype.get=xo,et.prototype.has=Oo,et.prototype.set=An;function ht(y){var A=-1,I=y==null?0:y.length;for(this.clear();++A<I;){var W=y[A];this.set(W[0],W[1])}}function Ao(){this.size=0,this.__data__={hash:new We,map:new(Tr||et),string:new We}}function Co(y){var A=Pt(this,y).delete(y);return this.size-=A?1:0,A}function Ro(y){return Pt(this,y).get(y)}function Po(y){return Pt(this,y).has(y)}function No(y,A){var I=Pt(this,y),W=I.size;return I.set(y,A),this.size+=I.size==W?0:1,this}ht.prototype.clear=Ao,ht.prototype.delete=Co,ht.prototype.get=Ro,ht.prototype.has=Po,ht.prototype.set=No;function qr(y){var A=-1,I=y==null?0:y.length;for(this.__data__=new ht;++A<I;)this.add(y[A])}function di(y){return this.__data__.set(y,n),this}function Gr(y){return this.__data__.has(y)}qr.prototype.add=qr.prototype.push=di,qr.prototype.has=Gr;function xt(y){var A=this.__data__=new et(y);this.size=A.size}function Cn(){this.__data__=new et,this.size=0}function Io(y){var A=this.__data__,I=A.delete(y);return this.size=A.size,I}function Lo(y){return this.__data__.get(y)}function ko(y){return this.__data__.has(y)}function Mo(y,A){var I=this.__data__;if(I instanceof et){var W=I.__data__;if(!Tr||W.length<r-1)return W.push([y,A]),this.size=++I.size,this;I=this.__data__=new ht(W)}return I.set(y,A),this.size=I.size,this}xt.prototype.clear=Cn,xt.prototype.delete=Io,xt.prototype.get=Lo,xt.prototype.has=ko,xt.prototype.set=Mo;function Fo(y,A){var I=Wr(y),W=!I&&Ei(y),ge=!I&&!W&&Qr(y),ce=!I&&!W&&!ge&&Ln(y),_e=I||W||ge||ce,be=_e?kt(y.length,String):[],He=be.length;for(var Ae in y)(A||C.call(y,Ae))&&!(_e&&(Ae=="length"||ge&&(Ae=="offset"||Ae=="parent")||ce&&(Ae=="buffer"||Ae=="byteLength"||Ae=="byteOffset")||rr(Ae,He)))&&be.push(Ae);return be}function Vr(y,A){for(var I=y.length;I--;)if(vi(y[I][0],A))return I;return-1}function Rn(y,A,I){var W=A(y);return Wr(y)?W:wr(W,I(y))}function Or(y){return y==null?y===void 0?$:S:Rt&&Rt in Object(y)?Kt(y):yi(y)}function pi(y){return Ft(y)&&Or(y)==s}function mi(y,A,I,W,ge){return y===A?!0:y==null||A==null||!Ft(y)&&!Ft(A)?y!==y&&A!==A:gi(y,A,I,W,mi,ge)}function gi(y,A,I,W,ge,ce){var _e=Wr(y),be=Wr(A),He=_e?c:Nt(y),Ae=be?c:Nt(A);He=He==s?v:He,Ae=Ae==s?v:Ae;var tt=He==v,ct=Ae==v,Ge=He==Ae;if(Ge&&Qr(y)){if(!Qr(A))return!1;_e=!0,tt=!1}if(Ge&&!tt)return ce||(ce=new xt),_e||Ln(y)?Pn(y,A,I,W,ge,ce):$o(y,A,He,I,W,ge,ce);if(!(I&i)){var rt=tt&&C.call(y,"__wrapped__"),Qe=ct&&C.call(A,"__wrapped__");if(rt||Qe){var nr=rt?y.value():y,Xt=Qe?A.value():A;return ce||(ce=new xt),ge(nr,Xt,I,W,ce)}}return Ge?(ce||(ce=new xt),Nn(y,A,I,W,ge,ce)):!1}function Do(y){if(!bi(y)||qo(y))return!1;var A=_i(y)?z:de;return A.test(ut(y))}function Bo(y){return Ft(y)&&In(y.length)&&!!te[Or(y)]}function Uo(y){if(!Go(y))return Sr(y);var A=[];for(var I in Object(y))C.call(y,I)&&I!="constructor"&&A.push(I);return A}function Pn(y,A,I,W,ge,ce){var _e=I&i,be=y.length,He=A.length;if(be!=He&&!(_e&&He>be))return!1;var Ae=ce.get(y);if(Ae&&ce.get(A))return Ae==A;var tt=-1,ct=!0,Ge=I&o?new qr:void 0;for(ce.set(y,A),ce.set(A,y);++tt<be;){var rt=y[tt],Qe=A[tt];if(W)var nr=_e?W(Qe,rt,tt,A,y,ce):W(rt,Qe,tt,y,A,ce);if(nr!==void 0){if(nr)continue;ct=!1;break}if(Ge){if(!er(A,function(Xt,Cr){if(!Wt(Ge,Cr)&&(rt===Xt||ge(rt,Xt,I,W,ce)))return Ge.push(Cr)})){ct=!1;break}}else if(!(rt===Qe||ge(rt,Qe,I,W,ce))){ct=!1;break}}return ce.delete(y),ce.delete(A),ct}function $o(y,A,I,W,ge,ce,_e){switch(I){case H:if(y.byteLength!=A.byteLength||y.byteOffset!=A.byteOffset)return!1;y=y.buffer,A=A.buffer;case q:return!(y.byteLength!=A.byteLength||!ce(new Re(y),new Re(A)));case u:case d:case _:return vi(+y,+A);case h:return y.name==A.name&&y.message==A.message;case w:case R:return y==A+"";case m:var be=Ze;case N:var He=W&i;if(be||(be=yt),y.size!=A.size&&!He)return!1;var Ae=_e.get(y);if(Ae)return Ae==A;W|=o,_e.set(y,A);var tt=Pn(be(y),be(A),W,ge,ce,_e);return _e.delete(y),tt;case L:if(Tn)return Tn.call(y)==Tn.call(A)}return!1}function Nn(y,A,I,W,ge,ce){var _e=I&i,be=Ar(y),He=be.length,Ae=Ar(A),tt=Ae.length;if(He!=tt&&!_e)return!1;for(var ct=He;ct--;){var Ge=be[ct];if(!(_e?Ge in A:C.call(A,Ge)))return!1}var rt=ce.get(y);if(rt&&ce.get(A))return rt==A;var Qe=!0;ce.set(y,A),ce.set(A,y);for(var nr=_e;++ct<He;){Ge=be[ct];var Xt=y[Ge],Cr=A[Ge];if(W)var ua=_e?W(Cr,Xt,Ge,A,y,ce):W(Xt,Cr,Ge,y,A,ce);if(!(ua===void 0?Xt===Cr||ge(Xt,Cr,I,W,ce):ua)){Qe=!1;break}nr||(nr=Ge=="constructor")}if(Qe&&!nr){var ir=y.constructor,Yr=A.constructor;ir!=Yr&&"constructor"in y&&"constructor"in A&&!(typeof ir=="function"&&ir instanceof ir&&typeof Yr=="function"&&Yr instanceof Yr)&&(Qe=!1)}return ce.delete(y),ce.delete(A),Qe}function Ar(y){return Rn(y,wi,jo)}function Pt(y,A){var I=y.__data__;return Ho(A)?I[typeof A=="string"?"string":"hash"]:I.map}function Yt(y,A){var I=Mt(y,A);return Do(I)?I:void 0}function Kt(y){var A=C.call(y,Rt),I=y[Rt];try{y[Rt]=void 0;var W=!0}catch{}var ge=j.call(y);return W&&(A?y[Rt]=I:delete y[Rt]),ge}var jo=Hr?function(y){return y==null?[]:(y=Object(y),Vt(Hr(y),function(A){return Pe.call(y,A)}))}:Si,Nt=Or;(_n&&Nt(new _n(new ArrayBuffer(1)))!=H||Tr&&Nt(new Tr)!=m||bn&&Nt(bn.resolve())!=b||wn&&Nt(new wn)!=N||Sn&&Nt(new Sn)!=G)&&(Nt=function(y){var A=Or(y),I=A==v?y.constructor:void 0,W=I?ut(I):"";if(W)switch(W){case li:return H;case Qt:return m;case Eo:return b;case _o:return N;case bo:return G}return A});function rr(y,A){return A=A??a,!!A&&(typeof y=="number"||Ve.test(y))&&y>-1&&y%1==0&&y<A}function Ho(y){var A=typeof y;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?y!=="__proto__":y===null}function qo(y){return!!M&&M in y}function Go(y){var A=y&&y.constructor,I=typeof A=="function"&&A.prototype||O;return y===I}function yi(y){return j.call(y)}function ut(y){if(y!=null){try{return E.call(y)}catch{}try{return y+""}catch{}}return""}function vi(y,A){return y===A||y!==y&&A!==A}var Ei=pi(function(){return arguments}())?pi:function(y){return Ft(y)&&C.call(y,"callee")&&!Pe.call(y,"callee")},Wr=Array.isArray;function zr(y){return y!=null&&In(y.length)&&!_i(y)}var Qr=En||Wo;function Vo(y,A){return mi(y,A)}function _i(y){if(!bi(y))return!1;var A=Or(y);return A==f||A==p||A==l||A==T}function In(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=a}function bi(y){var A=typeof y;return y!=null&&(A=="object"||A=="function")}function Ft(y){return y!=null&&typeof y=="object"}var Ln=Je?yn(Je):Bo;function wi(y){return zr(y)?Fo(y):Uo(y)}function Si(){return[]}function Wo(){return!1}e.exports=Vo})(mu,mu.exports);var VN=mu.exports;const WN=Er(VN);const CE=({element:e="section",children:t,className:r,...n})=>U.createElement(e,{className:se("modal",r),children:typeof t=="string"?x.jsx("p",{children:t}):t,...n});const RE=({id:e="content-overlay",isOpen:t=!1,maxWidth:r,functions:{onOpen:n=()=>{},onClose:i=()=>{}}={},forceShow:{error:o=!1}={},title:a,children:s,buttons:c,className:l="",gtmContext:u="Modal"})=>{const d=Oe(),[h,f]=U.useState(t),p=_=>{f(_),_?(n(),document.body.classList.add("has-overlay")):(i(),document.body.classList.remove("has-overlay"))};U.useEffect(()=>{p(t)},[t]);const m=r?{"--max-width":`${r/16}rem`}:{};return x.jsx("div",{className:se("overlay",{open:h}),children:x.jsx(CE,{id:e,className:se("overlay-modal",l,{"has-max-width":r}),hidden:!h,style:m,children:t&&x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"top",children:[x.jsx("h2",{children:a}),x.jsx(ze,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>p(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":u,screenreaderText:d.formatMessage({id:"overlay_button"})})]}),x.jsx(tu,{}),s,c&&x.jsxs("div",{className:"bottom",children:[x.jsx(tu,{}),x.jsx(na,{buttons:c})]}),o&&x.jsx(nu,{className:"error",children:o})]})})})},PE=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e}),Zm=e=>{const t={};return Object.keys(e).forEach(r=>{t[`${r}Slug`]=e[r]}),t};const Lr="discussion_",ku=({element:e="div",content:t,userHasPermissions:r=!0,isLoading:n=!1,originalAuthorId:i,functions:{content:{createContent:o,deleteContent:a,updateContent:s}={createContent:()=>{},deleteContent:()=>{},updateContent:()=>{}},likes:{createLike:c,deleteLike:l}={createLike:()=>{},deleteLike:()=>{}},comments:{openComments:u}={openComments:()=>{}}},links:d={},className:h,gtmContext:f="DiscussionAnswer",children:p})=>{const m=Oe(),_=U.useContext($r),S=U.useContext(yh),[v,b]=U.useState({body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1}),[T,w]=U.useState(!1),[N,R]=U.useState("");if(U.useEffect(()=>{b({...v,body:t&&t.body||"",didEdit:t&&t.isEdited||!1})},[t.isEdited]),n||!t||t.type==="answer"&&(!t.slugs||!t.slugs.question))return x.jsx(yr,{className:"discussion-card discussion-post"});const{author:L,canLike:$,createdAt:G,id:q,likes:H=0,userLiked:Y,comments:ie=0}=t,K=_&&_.id&&typeof L!="string"&&L.id&&L.id===_.id||!1,k=typeof $=="boolean"?$:r?!K:!1,Q=async X=>{X||(X=""),R("");try{if(!WN(X,v.body)){const le=t.type==="question"?{title:X}:{body:X};await s(Zm(t.slugs),le)}b({body:X,isEditing:!1,didEdit:!0})}catch{R(`${Lr}form_error`)}},ee=()=>{S&&S.updateConversation&&S.updateConversation({showThread:!0,showForm:!0}),setTimeout(()=>{const le=`reply-form-${(t.type==="answer"?t.slug:t.slugs.answer||"").toLowerCase().slice(-15)}`,de=document.getElementById(le),Ve=document.getElementById(`${le}-input`);Ve&&Ve.focus(),de&&de.scrollIntoView({behavior:"smooth"})},0)},he=()=>{try{a(Zm(t.slugs))}catch{R("delete-error")}},Z=[{text:m.formatMessage({id:`${Lr}moreMenu_report`}),href:`mailto:community@apolitical.co?subject=${encodeURI(m.formatMessage({id:`${Lr}report_subject`}))}&body=${encodeURI(m.formatMessage({id:`${Lr}report_body`},{contentType:t.type||"",contentSlug:t.slug||"",contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}))}`,icon:"flag"}];return r&&K&&Z.push({text:m.formatMessage({id:`${Lr}moreMenu_edit`}),onClick:()=>b({...v,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":f,"data-gtm-event-type":`edit-${t.type}-click`},{text:m.formatMessage({id:`${Lr}moreMenu_delete`}),onClick:X=>{X.preventDefault(),X.stopPropagation(),w(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":f,"data-gtm-event-type":`delete-${t.type}-click`,...PE(`delete-${t.slug}-modal`,T)}),U.createElement(e,{className:se("discussion-post",h),"data-testid":`discussion-${t.type}-thread`,children:x.jsxs(x.Fragment,{children:[x.jsxs("div",{id:q||t.slug,className:se("discussion-card",t.type,{editing:v.isEditing,"has-link":d.post&&!v.isEditing}),onClick:X=>{!d.post||v.isEditing||(X.preventDefault(),X.stopPropagation(),window.location.href=d.post)},children:[!v.isEditing&&x.jsx(Au,{member:L,additionalContent:{createdAt:G,didEdit:v.didEdit},className:typeof L!="string"&&L.id===i?"highlighted":"",gtmContext:f,gtmType:"profile-click"}),v.isEditing?x.jsx(mh,{content:{type:t.type,slugs:t.slugs},userHasPermissions:r,meta:{isLoading:n,isInWrapper:!0,isEditing:{text:v.body}},maxLength:t.type==="question"?250:5e4,forceShow:{error:N!==""&&N!=="delete-error"?m.formatMessage({id:N},{action:m.formatMessage({id:`discussion_action_${t.type}`})}):!1},functions:{create:o,handleSaveEdit:Q,handleCancel:()=>{R(""),b({...v,isEditing:!1})}},gtmContext:`${f}Form`}):d.post?x.jsx("a",{href:d.post,className:"gtm-trackable","data-gtm-event-context":f,"data-gtm-event-type":"title-click",children:x.jsx(sf,{options:{overrides:{a:C0}},children:v.body})}):x.jsx(sf,{options:{wrapper:t.type==="question"?"h1":U.Fragment,forceWrapper:t.type==="question",forceInline:t.type==="question",forceBlock:t.type!=="question"},children:v.body}),!v.isEditing&&x.jsxs("ul",{className:se("actions text-medium",t.type),"data-testid":`${t.type}-actions`,children:[x.jsx(AE,{element:"li",likes:H,isShort:!1,userLiked:Y,content:{type:t.type,slugs:t.slugs},canLike:k,functions:{createLike:c,deleteLike:l}}),(["question","post"].includes(t.type)||d.comments||typeof u=="function")&&x.jsxs("li",{className:"action-button",onClick:X=>{X.preventDefault(),X.stopPropagation(),d.comments&&(window.location.href=d.comments),typeof u=="function"&&u()},children:[x.jsx(ze,{variant:"tertiary",size:"medium",styling:{muted:!0},icon:{icon:"speech-bubble_square_thick"},href:d.comments?d.comments:!1,onClick:d.comments||typeof u!="function"?!1:u,className:"gtm-trackable","data-gtm-event-context":f,"data-gtm-event-type":`answer-${t.type}-click`,screenreaderText:m.formatMessage({id:`${Lr}comments_screenReader`},{count:ie})}),x.jsx("span",{children:m.formatMessage({id:`${Lr}comments`},{count:ie})})]}),(t.type==="answer"||t.type==="reply")&&x.jsx("li",{children:x.jsx(ze,{variant:"tertiary",size:"medium",styling:{muted:!0},onClick:ee,children:m.formatMessage({id:`${Lr}reply`})})}),x.jsx(fE,{element:"li",id:`more-${t.slug}`,options:Z})]})]}),p,x.jsx(RE,{id:`delete-${t.slug}-modal`,isOpen:T,functions:{onOpen:()=>{},onClose:()=>w(!1)},forceShow:{error:N==="delete-error"?m.formatMessage({id:"discussion_delete_error"},{action:m.formatMessage({id:`discussion_action_${t.type}`})}):!1},title:m.formatMessage({id:"discussion_delete_title"},{action:m.formatMessage({id:`discussion_action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>w(!1),children:m.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:he,children:m.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,children:x.jsx(ln,{id:"discussion_delete_text",values:{p:X=>x.jsx("p",{children:X}),action:m.formatMessage({id:`discussion_action_${t.type}`})}})})]})})};const Cl="discussion_responses_",zN=({type:e="answer",responses:t=0})=>{const r=Oe();return x.jsxs("div",{className:"responses-heading",children:[x.jsx("h3",{children:r.formatMessage({id:`${Cl}title`},{action:r.formatMessage({id:`${Cl}${e}`}),count:t})}),t===0&&x.jsx("p",{children:ar(r.formatMessage,`${Cl}empty`,e,e)})]})};const QN=({isOpen:e=!1,count:t=0,children:r})=>{const n=Oe(),i=U.useRef(null),[o,a]=U.useState(e),[s,c]=U.useState("closed");U.useEffect(()=>{const h=i.current;if(h)return h.addEventListener("transitionend",l),()=>{h.removeEventListener("transitionend",l)}},[]),ri(()=>{s==="closed"&&!o||c(["opening","open"].includes(s)?"ready-to-close":"opening")},[o]),U.useEffect(()=>{s==="ready-to-close"&&c("closing")},[s]);const l=({propertyName:h})=>{h==="max-height"&&c(f=>f==="opening"?"open":f==="closing"?"closed":f)},u=["opening","open"].includes(s),d=Av(r,{element:"li"});return x.jsxs("div",{className:"thread-wrapper",children:[x.jsx(ze,{variant:"secondary",size:"small",styling:{muted:!0},icon:{icon:`arrow_corner-down_${u?"left":"right"}`},onClick:()=>{a(!o)},children:n.formatMessage({id:`discussion_thread_${u?"hide":"show"}`},{count:t})}),x.jsx("ul",{ref:i,className:se("thread",s),hidden:!o,children:d})]})},YN=({user:e,content:t,verb:r="post"})=>({actor:{id:e.id,data:{name:e.name,organization:e==null?void 0:e.organization,jobTitle:e==null?void 0:e.jobTitle}},content:t,latest_reactions:{like:[]},reaction_counts:{like:0},verb:r}),KN=({queryClient:e,queryKey:t,user:r,mutationFn:n})=>({mutationFn:n,onMutate:async({content:s})=>{if(!r)return;const c=YN({user:r,content:s,verb:"post"});await e.cancelQueries({queryKey:t});const l=e.getQueryData(t);return e.setQueryData(t,u=>[...u,c]),{previousActivities:l}},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivities)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),XN=({queryClient:e,queryKey:t,mutationFn:r})=>({mutationFn:r,onMutate:async({activityId:s})=>{await e.cancelQueries({queryKey:t});const c=e.getQueryData(t),l=c==null?void 0:c.map(u=>{var d;return(u==null?void 0:u.id)===s&&((d=u.reaction_counts)!=null&&d.like?u.reaction_counts.like+=1:u.reaction_counts.like=1),u});return e.setQueryData(t,()=>l&&[...l]),{previousActivities:l}},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivities)},onSuccess:s=>{const c=e.getQueryData(t),l=c==null?void 0:c.map(u=>((u==null?void 0:u.id)===(s==null?void 0:s.activity_id)&&(u.latest_reactions.like?u.latest_reactions.like.push(s):u.latest_reactions.like=[s]),u));return e.setQueryData(t,()=>l&&[...l]),{previousActivities:c}},onSettled:(s,c,l)=>{e.invalidateQueries({queryKey:[...t,l.activityId]})}}),JN=({queryClient:e,queryKey:t,user:r,mutationFn:n})=>({mutationFn:n,onMutate:async({activityId:c})=>{await e.cancelQueries({queryKey:t});const l=e.getQueryData(t),u=l==null?void 0:l.map(d=>{var h;return(d==null?void 0:d.id)===c&&(h=d.reaction_counts)!=null&&h.like&&(d.reaction_counts.like-=1),d});return e.setQueryData(t,()=>u&&[...u]),{previousActivities:u}},onError:(c,l,u)=>{e.setQueryData(t,u.previousActivities)},onSuccess:(c,{activityId:l})=>{const u=e.getQueryData(t),d=u==null?void 0:u.map(h=>{var f,p,m,_;if(h.id===l){const S=(m=(p=(f=h.latest_reactions)==null?void 0:f.like)==null?void 0:p.find(v=>v.user_id===(r==null?void 0:r.id)))==null?void 0:m.id;return h.latest_reactions.like=(_=h.latest_reactions.like)==null?void 0:_.filter(v=>v.id!==S),h}else return h});return e.setQueryData(t,()=>d&&[...d]),{previousActivities:u}},onSettled:(c,l,u)=>{e.invalidateQueries({queryKey:[...t,u.activityId]})}}),ZN=({basePath:e,parentId:t,membershipRequiredToPost:{isMember:r,join:n,leave:i},functions:{list:o,create:a,like:s,unlike:c}})=>{const l=go(),u=U.useContext($r),{data:d,error:h,isLoading:f,isFetching:p}=W0({queryKey:[e,t],queryFn:o}),m=KN({queryClient:l,queryKey:[e,t],user:u,mutationFn:a}),{mutate:_}=fn(m),S=XN({queryClient:l,queryKey:[e,t],mutationFn:s}),{mutate:v}=fn(S),b=JN({queryClient:l,queryKey:[e,t],user:u,mutationFn:async({activityId:R})=>{var G,q,H;const L=d&&(d==null?void 0:d.find(Y=>Y.id===R)),$=(H=(q=(G=L==null?void 0:L.latest_reactions)==null?void 0:G.like)==null?void 0:q.find(Y=>Y.user_id===(u==null?void 0:u.id)))==null?void 0:H.id;await c({reactionId:$||"",activityId:R})}}),{mutate:T}=fn(b),w=U.useCallback(({activityId:R})=>v({activityId:R}),[v]),N=U.useCallback(({activityId:R})=>T({activityId:R}),[T]);return h?x.jsx(aa,{variant:"error",text:h.message}):f?x.jsx(yr,{style:{height:"400px"}}):x.jsxs(x.Fragment,{children:[x.jsx(gh,{contentType:"post",createPost:_,membershipRequiredToPost:{isMember:r,required:!0,join:n,leave:i,notMemberStateText:"Join community to create a post."}}),!p&&Array.isArray(d)&&(d==null?void 0:d.map(R=>{var L,$,G,q,H,Y,ie,K,k,Q,ee;return x.jsx(ku,{content:{type:"post",body:R==null?void 0:R.content,createdAt:(R==null?void 0:R.time)||"",slugs:{question:t},slug:R==null?void 0:R.id,author:{id:(L=R==null?void 0:R.actor)==null?void 0:L.id,name:(G=($=R==null?void 0:R.actor)==null?void 0:$.data)==null?void 0:G.name,organization:(H=(q=R==null?void 0:R.actor)==null?void 0:q.data)==null?void 0:H.organization,jobTitle:(ie=(Y=R==null?void 0:R.actor)==null?void 0:Y.data)==null?void 0:ie.jobTitle,image:{thumbnail:((k=(K=R==null?void 0:R.actor)==null?void 0:K.data)==null?void 0:k.thumbnail)||void 0}},userLiked:((Q=R==null?void 0:R.own_reactions)==null?void 0:Q.like)&&((ee=R==null?void 0:R.own_reactions)==null?void 0:ee.like.length)>0,likes:(R==null?void 0:R.reaction_counts.like)||0,comments:(R==null?void 0:R.reaction_counts.reply)||0},links:{post:`${e}/${t}/${R==null?void 0:R.id}`,comments:`${e}/${t}/${R==null?void 0:R.id}`},functions:{content:{createContent:()=>null,deleteContent:()=>null,updateContent:()=>null},likes:{createLike:()=>{w({activityId:R==null?void 0:R.id})},deleteLike:()=>{N({activityId:R==null?void 0:R.id})}},comments:{openComments:()=>null}}},R==null?void 0:R.id)}))]})},eI=({queryClient:e,queryKey:t,mutationFn:r})=>({mutationFn:r,onMutate:async()=>{await e.cancelQueries({queryKey:t})},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivity)},onSuccess:s=>{var l;const c=e.getQueryData(t);if(c)return(l=c==null?void 0:c.latest_reactions)!=null&&l.reply?(c.latest_reactions.reply.unshift(s),c&&(c.reaction_counts={reply:c.latest_reactions.reply.length})):(c.latest_reactions={reply:[s]},c.reaction_counts={reply:1}),e.setQueryData(t,()=>({...c})),{previousActivity:c}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),tI=({queryClient:e,queryKey:t,mutationFn:r})=>({mutationFn:r,onMutate:async({replyId:a})=>{var l,u;await e.cancelQueries({queryKey:t});const s=e.getQueryData(t),c=(u=(l=s==null?void 0:s.latest_reactions)==null?void 0:l.reply)==null?void 0:u.map(d=>{var h;return d.id===a&&((h=d.children_counts)!=null&&h.like?d.children_counts.like+=1:d.children_counts={like:1}),d});return e.setQueryData(t,()=>({...s,latest_reactions:{reply:c}})),{previousActivity:s}},onError:(a,s,c)=>{e.setQueryData(t,c.previousActivity)},onSuccess:a=>{var l;const s=e.getQueryData(t),c=(l=s==null?void 0:s.latest_reactions.reply)==null?void 0:l.map(u=>(u.id===a.id&&(u.latest_children.like?u.latest_children.like.push(a):u.latest_children.like=[a]),u));return e.setQueryData(t,()=>({...s,latest_reactions:{reply:c}})),{previousActivity:s}}}),rI=({queryClient:e,queryKey:t,user:r,mutationFn:n})=>({mutationFn:n,onMutate:async({replyId:s})=>{var u;await e.cancelQueries({queryKey:t});const c=e.getQueryData(t);if(!c)return;const l=(u=c.latest_reactions.reply)==null?void 0:u.map(d=>(d.id===s&&d.children_counts.like&&(d.children_counts.like-=1),d));return e.setQueryData(t,()=>({...c,latest_reactions:{reply:l}})),{previousActivity:c}},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivity)},onSuccess:(s,{replyId:c})=>{var d;const l=e.getQueryData(t);if(!l)return;const u=(d=l.latest_reactions.reply)==null?void 0:d.map(h=>{var f;return h.id===c?(f=h.latest_children.reply)==null?void 0:f.filter(m=>m.user_id!==(r==null?void 0:r.id)):h});return e.setQueryData(t,()=>({...l,latest_reactions:{reply:u}})),{previousActivity:l}}}),NE=({basePath:e,parentId:t,activityId:r,repliesList:n,membershipRequiredToPost:{isMember:i,join:o,leave:a},functions:{createReply:s,like:c,unlike:l}})=>{const u=go(),d=U.useContext($r),h=eI({queryClient:u,queryKey:[e,t,r],mutationFn:s}),{mutate:f}=fn(h),p=tI({queryClient:u,queryKey:[e,t,r],mutationFn:c}),{mutate:m}=fn(p),_=rI({queryClient:u,queryKey:[e,t,r],user:d,mutationFn:l}),{mutate:S}=fn(_),v=U.useCallback(({replyId:T})=>m({replyId:T}),[m]),b=U.useCallback(({replyId:T})=>S({replyId:T}),[S]);return x.jsxs(x.Fragment,{children:[x.jsx(gh,{contentType:"post",createPost:f,membershipRequiredToPost:{isMember:i,required:!0,join:o,leave:a,notMemberStateText:"Join community to create a post."}}),(n==null?void 0:n.length)===0||(n==null?void 0:n.map(T=>{var N,R,L,$,G,q,H,Y,ie,K,k,Q,ee,he,Z,X;const w=((N=T==null?void 0:T.latest_children)==null?void 0:N.like)&&((R=T==null?void 0:T.latest_children)==null?void 0:R.like.filter(le=>le.user_id===(d==null?void 0:d.id)));return x.jsx(ku,{content:{type:"post",body:typeof T.data.content=="string"?(L=T==null?void 0:T.data)==null?void 0:L.content:((G=($=T==null?void 0:T.data)==null?void 0:$.content)==null?void 0:G.text)||"",createdAt:T==null?void 0:T.created_at,slugs:{question:`${e}/${t}/${r}`,reply:T==null?void 0:T.id},slug:`${e}/${t}/${r}#${T==null?void 0:T.id}`,author:{id:(q=T==null?void 0:T.user)==null?void 0:q.id,name:(Y=(H=T==null?void 0:T.user)==null?void 0:H.data)==null?void 0:Y.name,organization:(K=(ie=T==null?void 0:T.user)==null?void 0:ie.data)==null?void 0:K.organization,jobTitle:(Q=(k=T==null?void 0:T.user)==null?void 0:k.data)==null?void 0:Q.jobTitle,image:{thumbnail:((he=(ee=T==null?void 0:T.user)==null?void 0:ee.data)==null?void 0:he.thumbnail)||void 0}},userLiked:!!(w!=null&&w.length),likes:((Z=T==null?void 0:T.children_counts)==null?void 0:Z.like)||0,comments:((X=T==null?void 0:T.children_counts)==null?void 0:X.reply)||0},functions:{content:{createContent:()=>console.log("create"),deleteContent:()=>console.log("delete"),updateContent:()=>console.log("update")},likes:{createLike:()=>v({replyId:T==null?void 0:T.id}),deleteLike:()=>b({replyId:T==null?void 0:T.id})},comments:{openComments:()=>{}}}},T==null?void 0:T.id)}))]})},nI=({queryClient:e,queryKey:t,mutationFn:r})=>({mutationFn:r,onMutate:async()=>{var c;await e.cancelQueries({queryKey:t});const s=e.getQueryData(t);return(c=s==null?void 0:s.reaction_counts)!=null&&c.like?s.reaction_counts.like+=1:s&&(s.reaction_counts={like:1}),e.setQueryData(t,()=>({...s})),{previousActivity:s}},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivity)},onSuccess:s=>{const c=e.getQueryData(t);return c!=null&&c.latest_reactions.like?c.latest_reactions.like.push(s):c&&(c.latest_reactions={like:[s]}),e.setQueryData(t,()=>({...c})),{previousActivity:c}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),iI=({queryClient:e,queryKey:t,user:r,activity:n,mutationFn:i})=>({mutationFn:i,onMutate:async()=>{var u;await e.cancelQueries({queryKey:t});const l=e.getQueryData(t);return(u=l==null?void 0:l.reaction_counts)!=null&&u.like&&l.reaction_counts.like>0&&(l.reaction_counts.like-=1),e.setQueryData(t,()=>({...l})),{previousActivity:l}},onError:(l,u,d)=>{e.setQueryData(t,d.previousActivity)},onSuccess:()=>{var d,h,f;if(!n)return;const l=(f=(h=(d=n.latest_reactions)==null?void 0:d.like)==null?void 0:h.find(p=>p.user_id===(r==null?void 0:r.id)))==null?void 0:f.id,u=e.getQueryData(t);if(u!=null&&u.latest_reactions.like)return u.latest_reactions.like=u.latest_reactions.like.filter(p=>p.id!==l),e.setQueryData(t,()=>({...u})),{previousActivity:u}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),oI=({basePath:e,parentId:t,activityId:r,membershipRequiredToPost:n,functions:{get:i,likeActivity:o,unlikeActivity:a,createReply:s,likeReply:c,unlikeReply:l}})=>{var N,R,L,$,G,q,H,Y,ie,K;const u=U.useContext($r),d=go(),{data:h,error:f,isLoading:p,isFetching:m}=W0({queryKey:[e,t,r],queryFn:i}),_=nI({queryClient:d,queryKey:[e,t,r],mutationFn:o}),{mutate:S}=fn(_),v=iI({queryClient:d,queryKey:[e,t,r],user:u,mutationFn:async()=>{var Q,ee,he;const k=(he=(ee=(Q=h==null?void 0:h.latest_reactions)==null?void 0:Q.like)==null?void 0:ee.find(Z=>Z.user_id===(u==null?void 0:u.id)))==null?void 0:he.id;await a({activityId:r,reactionId:k})},activity:h}),{mutate:b}=fn(v),T=U.useCallback(({activityId:k})=>S({activityId:k}),[S]),w=U.useCallback(async({activityId:k})=>b({activityId:k}),[b]);return f?x.jsx(aa,{variant:"error",text:f.message}):p||m?x.jsx(yr,{style:{height:"400px"}}):x.jsx(ku,{content:{type:"post",body:h==null?void 0:h.content,createdAt:(h==null?void 0:h.time)||"",slugs:{question:`${t}/${r}`},slug:r,author:{id:(N=h==null?void 0:h.actor)==null?void 0:N.id,name:(R=h==null?void 0:h.actor)==null?void 0:R.data.name,organization:(L=h==null?void 0:h.actor)==null?void 0:L.data.organization,jobTitle:($=h==null?void 0:h.actor)==null?void 0:$.data.jobTitle,image:{thumbnail:((G=h==null?void 0:h.actor)==null?void 0:G.data.thumbnail)||void 0}},userLiked:((q=h==null?void 0:h.own_reactions)==null?void 0:q.like)&&((H=h==null?void 0:h.own_reactions)==null?void 0:H.like.length)>0,likes:h&&(h==null?void 0:h.reaction_counts.like),comments:h&&(h==null?void 0:h.reaction_counts.reply)},originalAuthorId:(Y=h==null?void 0:h.actor)==null?void 0:Y.id,functions:{content:{createContent:()=>console.log("create"),deleteContent:()=>console.log("delete"),updateContent:()=>console.log("update")},likes:{createLike:()=>T({activityId:r}),deleteLike:()=>w({activityId:r})},comments:{openComments:()=>{}}},children:x.jsxs(x.Fragment,{children:[x.jsxs("h3",{children:["Comments (",((ie=h==null?void 0:h.reaction_counts)==null?void 0:ie.reply)||0,")"]}),x.jsx(NE,{basePath:e,parentId:t,activityId:r,repliesList:(K=h==null?void 0:h.latest_reactions)==null?void 0:K.reply,membershipRequiredToPost:n,functions:{createReply:s,like:c,unlike:l}})]})},r)},sI=({id:e,data:{jobTitle:t,name:r,organization:n,thumbnail:i}})=>({id:e,name:r,jobTitle:t,organization:n,image:{thumbnail:i}});exports.$PROXY=Is;exports.$TRACK=nh;exports.ASSETS_BUCKET=ru;exports.ActivitiesFeed=ZN;exports.ActivitySection=oI;exports.AddPost=gh;exports.Breadcrumbs=uP;exports.Button=ze;exports.ButtonWrapper=na;exports.CollapsibleSection=Xf;exports.Columns=dP;exports.CommunityDetails=aP;exports.Contributors=k0;exports.Conversation=HN;exports.ConversationContext=yh;exports.CookieBanner=hE;exports.Divider=tu;exports.DownloadSection=ZA;exports.Dynamic=rP;exports.EMAILS=Ni;exports.EmailHelperTextBox=pP;exports.EmptyStateBox=aa;exports.Filters=cP;exports.Footer=ch;exports.For=CR;exports.Form=mh;exports.FullWidthSection=Yf;exports.Header=ph;exports.HelperTextBox=A0;exports.HiddenFromScreenReaders=Of;exports.HideShowTextBox=l1;exports.HighlightedTextBoxWrapper=Br;exports.Index=RR;exports.IntlProvider=S1;exports.JoinButton=ah;exports.LanguageSwitcher=fP;exports.Likes=AE;exports.Link=ia;exports.LoadMore=lE;exports.LoadingPlaceholder=yr;exports.LoadingState=I0;exports.Logo=uh;exports.LogoSection=eC;exports.MarkdownText=sf;exports.MarketingBlock=iC;exports.Match=IR;exports.Member=Au;exports.MembersList=TN;exports.Modal=CE;exports.MoreMenu=fE;exports.NUMBER_OF_USERS=sC;exports.Overlay=RE;exports.PageLayout=bN;exports.Pill=R0;exports.Portal=tP;exports.Post=ku;exports.ProfilePicture=Ou;exports.ProgressBar=P0;exports.Rating=vP;exports.ReactQueryProvider=sP;exports.RepliesFeed=NE;exports.ResponsesHeading=zN;exports.ResponsiveImage=Cv;exports.SearchForm=gE;exports.Show=PR;exports.Span=C0;exports.StatusBanner=nu;exports.Switch=NR;exports.Tags=SN;exports.Thread=QN;exports.Tooltip=o0;exports.UserContext=$r;exports.UserProvider=T1;exports.VisuallyHidden=lt;exports.addAriaProps=PE;exports.addEventListener=aE;exports.bannerSection=nC;exports.batch=uR;exports.children=oh;exports.className=sE;exports.createComponent=tE;exports.createComputed=_f;exports.createContext=mR;exports.createEffect=ih;exports.createMemo=St;exports.createRenderEffect=dn;exports.createRoot=hn;exports.createSignal=bt;exports.createUniqueId=AR;exports.delegateEvents=oE;exports.getListener=fR;exports.getMember=eh;exports.headerData=Ms;exports.insert=hu;exports.loadingBlock=_1;exports.mapGetSteamData=sI;exports.mergeProps=rE;exports.on=cR;exports.onCleanup=Ls;exports.onMount=lR;exports.passwordRules=yP;exports.setAttribute=fu;exports.splitProps=nE;exports.spread=uE;exports.template=GR;exports.untrack=Xe;exports.use=QR;exports.useContext=gR;exports.useCurrentPath=hg;exports.useEffectAfterMount=ri;exports.useFeatureFlag=px;exports.useScreenWidth=ra;exports.useScrollListener=gv;exports.useScrollToHash=gx;exports.useTransition=pR;
|