@blogmcp/community 0.3.1 → 0.4.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/README.md +9 -3
- package/dist/blogmcp-community.global.js +7 -7
- package/dist/chunks/{mount-BpDqOL7w.js → mount-Ts_r2fwt.js} +134 -76
- package/dist/core/attrs.d.ts +14 -1
- package/dist/core/onboarding.d.ts +10 -0
- package/dist/index.js +2 -2
- package/dist/react.js +14 -14
- package/dist/ui/MembersOnly.vue.d.ts +1 -0
- package/dist/ui/OnboardingSteps.vue.d.ts +1 -0
- package/dist/vue.js +14 -14
- package/package.json +3 -3
- package/src/core/attrs.ts +18 -1
- package/src/core/onboarding.ts +50 -11
- package/src/ui/DiscussionView.vue +1 -1
- package/src/ui/ForumCategoryView.vue +2 -2
- package/src/ui/ForumSearchView.vue +1 -0
- package/src/ui/ForumView.vue +1 -0
- package/src/ui/MembersOnly.vue +2 -2
- package/src/ui/MyCommunityView.vue +1 -1
- package/src/ui/OnboardingSteps.vue +30 -3
- package/src/ui/TopicView.vue +2 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var BlogmcpCommunity=(function(Ye){"use strict";function As(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Me={},Rn=[],gn=()=>{},Wi=()=>!1,Mo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Os=e=>e.startsWith("onUpdate:"),ut=Object.assign,Yi=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Xc=Object.prototype.hasOwnProperty,Ce=(e,t)=>Xc.call(e,t),he=Array.isArray,Nn=e=>oo(e)==="[object Map]",jn=e=>oo(e)==="[object Set]",Gi=e=>oo(e)==="[object Date]",Te=e=>typeof e=="function",Be=e=>typeof e=="string",zt=e=>typeof e=="symbol",je=e=>e!==null&&typeof e=="object",Zi=e=>(je(e)||Te(e))&&Te(e.then)&&Te(e.catch),Ji=Object.prototype.toString,oo=e=>Ji.call(e),Qc=e=>oo(e).slice(8,-1),Po=e=>oo(e)==="[object Object]",Es=e=>Be(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,so=As(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ro=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},eu=/-\w/g,rt=Ro(e=>e.replace(eu,t=>t.slice(1).toUpperCase())),tu=/\B([A-Z])/g,wt=Ro(e=>e.replace(tu,"-$1").toLowerCase()),No=Ro(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ms=Ro(e=>e?`on${No(e)}`:""),ln=(e,t)=>!Object.is(e,t),jo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Xi=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},zo=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Qi=e=>{const t=Be(e)?Number(e):NaN;return isNaN(t)?e:t};let er;const Lo=()=>er||(er=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Do(e){if(he(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=Be(s)?iu(s):Do(s);if(o)for(const r in o)t[r]=o[r]}return t}else if(Be(e)||je(e))return e}const nu=/;(?![^(]*\))/g,ou=/:([^]+)/,su=/\/\*[^]*?\*\//g;function iu(e){const t={};return e.replace(su,"").split(nu).forEach(n=>{if(n){const s=n.split(ou);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Ve(e){let t="";if(Be(e))t=e;else if(he(e))for(let n=0;n<e.length;n++){const s=Ve(e[n]);s&&(t+=s+" ")}else if(je(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const ru=As("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function tr(e){return!!e||e===""}function au(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=vn(e[s],t[s]);return n}function vn(e,t){if(e===t)return!0;let n=Gi(e),s=Gi(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=zt(e),s=zt(t),n||s)return e===t;if(n=he(e),s=he(t),n||s)return n&&s?au(e,t):!1;if(n=je(e),s=je(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,r=Object.keys(t).length;if(o!==r)return!1;for(const a in e){const l=e.hasOwnProperty(a),c=t.hasOwnProperty(a);if(l&&!c||!l&&c||!vn(e[a],t[a]))return!1}}return String(e)===String(t)}function Ps(e,t){return e.findIndex(n=>vn(n,t))}const nr=e=>!!(e&&e.__v_isRef===!0),u=e=>Be(e)?e:e==null?"":he(e)||je(e)&&(e.toString===Ji||!Te(e.toString))?nr(e)?u(e.value):JSON.stringify(e,or,2):String(e),or=(e,t)=>nr(t)?or(e,t.value):Nn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],r)=>(n[Rs(s,r)+" =>"]=o,n),{})}:jn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Rs(n))}:zt(t)?Rs(t):je(t)&&!he(t)&&!Po(t)?String(t):t,Rs=(e,t="")=>{var n;return zt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let dt;class lu{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=dt,!t&&dt&&(this.index=(dt.scopes||(dt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=dt;try{return dt=this,t()}finally{dt=n}}}on(){++this._on===1&&(this.prevScope=dt,dt=this)}off(){this._on>0&&--this._on===0&&(dt=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function cu(){return dt}let Oe;const Ns=new WeakSet;class sr{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,dt&&dt.active&&dt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ns.has(this)&&(Ns.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||rr(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,dr(this),ar(this);const t=Oe,n=Lt;Oe=this,Lt=!0;try{return this.fn()}finally{lr(this),Oe=t,Lt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ds(t);this.deps=this.depsTail=void 0,dr(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ns.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ls(this)&&this.run()}get dirty(){return Ls(this)}}let ir=0,io,ro;function rr(e,t=!1){if(e.flags|=8,t){e.next=ro,ro=e;return}e.next=io,io=e}function js(){ir++}function zs(){if(--ir>0)return;if(ro){let t=ro;for(ro=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;io;){let t=io;for(io=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function ar(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function lr(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),Ds(s),uu(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Ls(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(cr(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function cr(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ao)||(e.globalVersion=ao,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ls(e))))return;e.flags|=2;const t=e.dep,n=Oe,s=Lt;Oe=e,Lt=!0;try{ar(e);const o=e.fn(e._value);(t.version===0||ln(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Oe=n,Lt=s,lr(e),e.flags&=-3}}function Ds(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)Ds(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function uu(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Lt=!0;const ur=[];function Jt(){ur.push(Lt),Lt=!1}function Xt(){const e=ur.pop();Lt=e===void 0?!0:e}function dr(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Oe;Oe=void 0;try{t()}finally{Oe=n}}}let ao=0;class du{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Fs{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Oe||!Lt||Oe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Oe)n=this.activeLink=new du(Oe,this),Oe.deps?(n.prevDep=Oe.depsTail,Oe.depsTail.nextDep=n,Oe.depsTail=n):Oe.deps=Oe.depsTail=n,fr(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=Oe.depsTail,n.nextDep=void 0,Oe.depsTail.nextDep=n,Oe.depsTail=n,Oe.deps===n&&(Oe.deps=s)}return n}trigger(t){this.version++,ao++,this.notify(t)}notify(t){js();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{zs()}}}function fr(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)fr(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Us=new WeakMap,yn=Symbol(""),qs=Symbol(""),lo=Symbol("");function et(e,t,n){if(Lt&&Oe){let s=Us.get(e);s||Us.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Fs),o.map=s,o.key=n),o.track()}}function Qt(e,t,n,s,o,r){const a=Us.get(e);if(!a){ao++;return}const l=c=>{c&&c.trigger()};if(js(),t==="clear")a.forEach(l);else{const c=he(e),p=c&&Es(n);if(c&&n==="length"){const h=Number(s);a.forEach((b,_)=>{(_==="length"||_===lo||!zt(_)&&_>=h)&&l(b)})}else switch((n!==void 0||a.has(void 0))&&l(a.get(n)),p&&l(a.get(lo)),t){case"add":c?p&&l(a.get("length")):(l(a.get(yn)),Nn(e)&&l(a.get(qs)));break;case"delete":c||(l(a.get(yn)),Nn(e)&&l(a.get(qs)));break;case"set":Nn(e)&&l(a.get(yn));break}}zs()}function zn(e){const t=ke(e);return t===e?t:(et(t,"iterate",lo),St(e)?t:t.map(Dt))}function Fo(e){return et(e=ke(e),"iterate",lo),e}function cn(e,t){return tn(e)?_n(e)?Ln(Dt(t)):Ln(t):Dt(t)}const fu={__proto__:null,[Symbol.iterator](){return Bs(this,Symbol.iterator,e=>cn(this,e))},concat(...e){return zn(this).concat(...e.map(t=>he(t)?zn(t):t))},entries(){return Bs(this,"entries",e=>(e[1]=cn(this,e[1]),e))},every(e,t){return en(this,"every",e,t,void 0,arguments)},filter(e,t){return en(this,"filter",e,t,n=>n.map(s=>cn(this,s)),arguments)},find(e,t){return en(this,"find",e,t,n=>cn(this,n),arguments)},findIndex(e,t){return en(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return en(this,"findLast",e,t,n=>cn(this,n),arguments)},findLastIndex(e,t){return en(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return en(this,"forEach",e,t,void 0,arguments)},includes(...e){return Hs(this,"includes",e)},indexOf(...e){return Hs(this,"indexOf",e)},join(e){return zn(this).join(e)},lastIndexOf(...e){return Hs(this,"lastIndexOf",e)},map(e,t){return en(this,"map",e,t,void 0,arguments)},pop(){return co(this,"pop")},push(...e){return co(this,"push",e)},reduce(e,...t){return mr(this,"reduce",e,t)},reduceRight(e,...t){return mr(this,"reduceRight",e,t)},shift(){return co(this,"shift")},some(e,t){return en(this,"some",e,t,void 0,arguments)},splice(...e){return co(this,"splice",e)},toReversed(){return zn(this).toReversed()},toSorted(e){return zn(this).toSorted(e)},toSpliced(...e){return zn(this).toSpliced(...e)},unshift(...e){return co(this,"unshift",e)},values(){return Bs(this,"values",e=>cn(this,e))}};function Bs(e,t,n){const s=Fo(e),o=s[t]();return s!==e&&!St(e)&&(o._next=o.next,o.next=()=>{const r=o._next();return r.done||(r.value=n(r.value)),r}),o}const mu=Array.prototype;function en(e,t,n,s,o,r){const a=Fo(e),l=a!==e&&!St(e),c=a[t];if(c!==mu[t]){const b=c.apply(e,r);return l?Dt(b):b}let p=n;a!==e&&(l?p=function(b,_){return n.call(this,cn(e,b),_,e)}:n.length>2&&(p=function(b,_){return n.call(this,b,_,e)}));const h=c.call(a,p,s);return l&&o?o(h):h}function mr(e,t,n,s){const o=Fo(e);let r=n;return o!==e&&(St(e)?n.length>3&&(r=function(a,l,c){return n.call(this,a,l,c,e)}):r=function(a,l,c){return n.call(this,a,cn(e,l),c,e)}),o[t](r,...s)}function Hs(e,t,n){const s=ke(e);et(s,"iterate",lo);const o=s[t](...n);return(o===-1||o===!1)&&Ws(n[0])?(n[0]=ke(n[0]),s[t](...n)):o}function co(e,t,n=[]){Jt(),js();const s=ke(e)[t].apply(e,n);return zs(),Xt(),s}const pu=As("__proto__,__v_isRef,__isVue"),pr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(zt));function hu(e){zt(e)||(e=String(e));const t=ke(this);return et(t,"has",e),t.hasOwnProperty(e)}class hr{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return r;if(n==="__v_raw")return s===(o?r?kr:_r:r?yr:vr).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const a=he(t);if(!o){let c;if(a&&(c=fu[n]))return c;if(n==="hasOwnProperty")return hu}const l=Reflect.get(t,n,tt(t)?t:s);if((zt(n)?pr.has(n):pu(n))||(o||et(t,"get",n),r))return l;if(tt(l)){const c=a&&Es(n)?l:l.value;return o&&je(c)?Ks(c):c}return je(l)?o?Ks(l):Re(l):l}}class br extends hr{constructor(t=!1){super(!1,t)}set(t,n,s,o){let r=t[n];const a=he(t)&&Es(n);if(!this._isShallow){const p=tn(r);if(!St(s)&&!tn(s)&&(r=ke(r),s=ke(s)),!a&&tt(r)&&!tt(s))return p||(r.value=s),!0}const l=a?Number(n)<t.length:Ce(t,n),c=Reflect.set(t,n,s,tt(t)?t:o);return t===ke(o)&&(l?ln(s,r)&&Qt(t,"set",n,s):Qt(t,"add",n,s)),c}deleteProperty(t,n){const s=Ce(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Qt(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!zt(n)||!pr.has(n))&&et(t,"has",n),s}ownKeys(t){return et(t,"iterate",he(t)?"length":yn),Reflect.ownKeys(t)}}class gr extends hr{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const bu=new br,gu=new gr,vu=new br(!0),yu=new gr(!0),Vs=e=>e,Uo=e=>Reflect.getPrototypeOf(e);function _u(e,t,n){return function(...s){const o=this.__v_raw,r=ke(o),a=Nn(r),l=e==="entries"||e===Symbol.iterator&&a,c=e==="keys"&&a,p=o[e](...s),h=n?Vs:t?Ln:Dt;return!t&&et(r,"iterate",c?qs:yn),{next(){const{value:b,done:_}=p.next();return _?{value:b,done:_}:{value:l?[h(b[0]),h(b[1])]:h(b),done:_}},[Symbol.iterator](){return this}}}}function qo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ku(e,t){const n={get(o){const r=this.__v_raw,a=ke(r),l=ke(o);e||(ln(o,l)&&et(a,"get",o),et(a,"get",l));const{has:c}=Uo(a),p=t?Vs:e?Ln:Dt;if(c.call(a,o))return p(r.get(o));if(c.call(a,l))return p(r.get(l));r!==a&&r.get(o)},get size(){const o=this.__v_raw;return!e&&et(ke(o),"iterate",yn),o.size},has(o){const r=this.__v_raw,a=ke(r),l=ke(o);return e||(ln(o,l)&&et(a,"has",o),et(a,"has",l)),o===l?r.has(o):r.has(o)||r.has(l)},forEach(o,r){const a=this,l=a.__v_raw,c=ke(l),p=t?Vs:e?Ln:Dt;return!e&&et(c,"iterate",yn),l.forEach((h,b)=>o.call(r,p(h),p(b),a))}};return ut(n,e?{add:qo("add"),set:qo("set"),delete:qo("delete"),clear:qo("clear")}:{add(o){!t&&!St(o)&&!tn(o)&&(o=ke(o));const r=ke(this);return Uo(r).has.call(r,o)||(r.add(o),Qt(r,"add",o,o)),this},set(o,r){!t&&!St(r)&&!tn(r)&&(r=ke(r));const a=ke(this),{has:l,get:c}=Uo(a);let p=l.call(a,o);p||(o=ke(o),p=l.call(a,o));const h=c.call(a,o);return a.set(o,r),p?ln(r,h)&&Qt(a,"set",o,r):Qt(a,"add",o,r),this},delete(o){const r=ke(this),{has:a,get:l}=Uo(r);let c=a.call(r,o);c||(o=ke(o),c=a.call(r,o)),l&&l.call(r,o);const p=r.delete(o);return c&&Qt(r,"delete",o,void 0),p},clear(){const o=ke(this),r=o.size!==0,a=o.clear();return r&&Qt(o,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=_u(o,e,t)}),n}function Bo(e,t){const n=ku(e,t);return(s,o,r)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(Ce(n,o)&&o in s?n:s,o,r)}const wu={get:Bo(!1,!1)},$u={get:Bo(!1,!0)},xu={get:Bo(!0,!1)},Iu={get:Bo(!0,!0)},vr=new WeakMap,yr=new WeakMap,_r=new WeakMap,kr=new WeakMap;function Tu(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Cu(e){return e.__v_skip||!Object.isExtensible(e)?0:Tu(Qc(e))}function Re(e){return tn(e)?e:Ho(e,!1,bu,wu,vr)}function Su(e){return Ho(e,!1,vu,$u,yr)}function Ks(e){return Ho(e,!0,gu,xu,_r)}function kC(e){return Ho(e,!0,yu,Iu,kr)}function Ho(e,t,n,s,o){if(!je(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const r=Cu(e);if(r===0)return e;const a=o.get(e);if(a)return a;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function _n(e){return tn(e)?_n(e.__v_raw):!!(e&&e.__v_isReactive)}function tn(e){return!!(e&&e.__v_isReadonly)}function St(e){return!!(e&&e.__v_isShallow)}function Ws(e){return e?!!e.__v_raw:!1}function ke(e){const t=e&&e.__v_raw;return t?ke(t):e}function Au(e){return!Ce(e,"__v_skip")&&Object.isExtensible(e)&&Xi(e,"__v_skip",!0),e}const Dt=e=>je(e)?Re(e):e,Ln=e=>je(e)?Ks(e):e;function tt(e){return e?e.__v_isRef===!0:!1}function ue(e){return wr(e,!1)}function Ht(e){return wr(e,!0)}function wr(e,t){return tt(e)?e:new Ou(e,t)}class Ou{constructor(t,n){this.dep=new Fs,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ke(t),this._value=n?t:Dt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||St(t)||tn(t);t=s?t:ke(t),ln(t,n)&&(this._rawValue=t,this._value=s?t:Dt(t),this.dep.trigger())}}function i(e){return tt(e)?e.value:e}const Eu={get:(e,t,n)=>t==="__v_raw"?e:i(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return tt(o)&&!tt(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function $r(e){return _n(e)?e:new Proxy(e,Eu)}class Mu{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Fs(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ao-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Oe!==this)return rr(this,!0),!0}get value(){const t=this.dep.track();return cr(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Pu(e,t,n=!1){let s,o;return Te(e)?s=e:(s=e.get,o=e.set),new Mu(s,o,n)}const Vo={},Ko=new WeakMap;let kn;function Ru(e,t=!1,n=kn){if(n){let s=Ko.get(n);s||Ko.set(n,s=[]),s.push(e)}}function Nu(e,t,n=Me){const{immediate:s,deep:o,once:r,scheduler:a,augmentJob:l,call:c}=n,p=k=>o?k:St(k)||o===!1||o===0?nn(k,1):nn(k);let h,b,_,$,v=!1,I=!1;if(tt(e)?(b=()=>e.value,v=St(e)):_n(e)?(b=()=>p(e),v=!0):he(e)?(I=!0,v=e.some(k=>_n(k)||St(k)),b=()=>e.map(k=>{if(tt(k))return k.value;if(_n(k))return p(k);if(Te(k))return c?c(k,2):k()})):Te(e)?t?b=c?()=>c(e,2):e:b=()=>{if(_){Jt();try{_()}finally{Xt()}}const k=kn;kn=h;try{return c?c(e,3,[$]):e($)}finally{kn=k}}:b=gn,t&&o){const k=b,E=o===!0?1/0:o;b=()=>nn(k(),E)}const j=cu(),P=()=>{h.stop(),j&&j.active&&Yi(j.effects,h)};if(r&&t){const k=t;t=(...E)=>{k(...E),P()}}let T=I?new Array(e.length).fill(Vo):Vo;const g=k=>{if(!(!(h.flags&1)||!h.dirty&&!k))if(t){const E=h.run();if(o||v||(I?E.some((w,y)=>ln(w,T[y])):ln(E,T))){_&&_();const w=kn;kn=h;try{const y=[E,T===Vo?void 0:I&&T[0]===Vo?[]:T,$];T=E,c?c(t,3,y):t(...y)}finally{kn=w}}}else h.run()};return l&&l(g),h=new sr(b),h.scheduler=a?()=>a(g,!1):g,$=k=>Ru(k,!1,h),_=h.onStop=()=>{const k=Ko.get(h);if(k){if(c)c(k,4);else for(const E of k)E();Ko.delete(h)}},t?s?g(!0):T=h.run():a?a(g.bind(null,!0),!0):h.run(),P.pause=h.pause.bind(h),P.resume=h.resume.bind(h),P.stop=P,P}function nn(e,t=1/0,n){if(t<=0||!je(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,tt(e))nn(e.value,t,n);else if(he(e))for(let s=0;s<e.length;s++)nn(e[s],t,n);else if(jn(e)||Nn(e))e.forEach(s=>{nn(s,t,n)});else if(Po(e)){for(const s in e)nn(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&nn(e[s],t,n)}return e}const uo=[];let Ys=!1;function wC(e,...t){if(Ys)return;Ys=!0,Jt();const n=uo.length?uo[uo.length-1].component:null,s=n&&n.appContext.config.warnHandler,o=ju();if(s)Dn(s,n,11,[e+t.map(r=>{var a,l;return(l=(a=r.toString)==null?void 0:a.call(r))!=null?l:JSON.stringify(r)}).join(""),n&&n.proxy,o.map(({vnode:r})=>`at <${ra(n,r.type)}>`).join(`
|
|
1
|
+
var BlogmcpCommunity=(function(Ye){"use strict";function As(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Me={},Rn=[],gn=()=>{},Wi=()=>!1,Mo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Os=e=>e.startsWith("onUpdate:"),ut=Object.assign,Yi=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},tu=Object.prototype.hasOwnProperty,Ce=(e,t)=>tu.call(e,t),he=Array.isArray,Nn=e=>oo(e)==="[object Map]",jn=e=>oo(e)==="[object Set]",Gi=e=>oo(e)==="[object Date]",Te=e=>typeof e=="function",He=e=>typeof e=="string",zt=e=>typeof e=="symbol",ze=e=>e!==null&&typeof e=="object",Zi=e=>(ze(e)||Te(e))&&Te(e.then)&&Te(e.catch),Ji=Object.prototype.toString,oo=e=>Ji.call(e),nu=e=>oo(e).slice(8,-1),Po=e=>oo(e)==="[object Object]",Es=e=>He(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,so=As(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ro=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ou=/-\w/g,rt=Ro(e=>e.replace(ou,t=>t.slice(1).toUpperCase())),su=/\B([A-Z])/g,wt=Ro(e=>e.replace(su,"-$1").toLowerCase()),No=Ro(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ms=Ro(e=>e?`on${No(e)}`:""),ln=(e,t)=>!Object.is(e,t),jo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Xi=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},zo=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Qi=e=>{const t=He(e)?Number(e):NaN;return isNaN(t)?e:t};let er;const Lo=()=>er||(er=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Do(e){if(he(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=He(s)?lu(s):Do(s);if(o)for(const r in o)t[r]=o[r]}return t}else if(He(e)||ze(e))return e}const iu=/;(?![^(]*\))/g,ru=/:([^]+)/,au=/\/\*[^]*?\*\//g;function lu(e){const t={};return e.replace(au,"").split(iu).forEach(n=>{if(n){const s=n.split(ru);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Ke(e){let t="";if(He(e))t=e;else if(he(e))for(let n=0;n<e.length;n++){const s=Ke(e[n]);s&&(t+=s+" ")}else if(ze(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const cu=As("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function tr(e){return!!e||e===""}function uu(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=vn(e[s],t[s]);return n}function vn(e,t){if(e===t)return!0;let n=Gi(e),s=Gi(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=zt(e),s=zt(t),n||s)return e===t;if(n=he(e),s=he(t),n||s)return n&&s?uu(e,t):!1;if(n=ze(e),s=ze(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,r=Object.keys(t).length;if(o!==r)return!1;for(const a in e){const l=e.hasOwnProperty(a),c=t.hasOwnProperty(a);if(l&&!c||!l&&c||!vn(e[a],t[a]))return!1}}return String(e)===String(t)}function Ps(e,t){return e.findIndex(n=>vn(n,t))}const nr=e=>!!(e&&e.__v_isRef===!0),u=e=>He(e)?e:e==null?"":he(e)||ze(e)&&(e.toString===Ji||!Te(e.toString))?nr(e)?u(e.value):JSON.stringify(e,or,2):String(e),or=(e,t)=>nr(t)?or(e,t.value):Nn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],r)=>(n[Rs(s,r)+" =>"]=o,n),{})}:jn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Rs(n))}:zt(t)?Rs(t):ze(t)&&!he(t)&&!Po(t)?String(t):t,Rs=(e,t="")=>{var n;return zt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let dt;class du{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=dt,!t&&dt&&(this.index=(dt.scopes||(dt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=dt;try{return dt=this,t()}finally{dt=n}}}on(){++this._on===1&&(this.prevScope=dt,dt=this)}off(){this._on>0&&--this._on===0&&(dt=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function fu(){return dt}let Oe;const Ns=new WeakSet;class sr{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,dt&&dt.active&&dt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ns.has(this)&&(Ns.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||rr(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,dr(this),ar(this);const t=Oe,n=Lt;Oe=this,Lt=!0;try{return this.fn()}finally{lr(this),Oe=t,Lt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ds(t);this.deps=this.depsTail=void 0,dr(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ns.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ls(this)&&this.run()}get dirty(){return Ls(this)}}let ir=0,io,ro;function rr(e,t=!1){if(e.flags|=8,t){e.next=ro,ro=e;return}e.next=io,io=e}function js(){ir++}function zs(){if(--ir>0)return;if(ro){let t=ro;for(ro=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;io;){let t=io;for(io=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function ar(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function lr(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),Ds(s),mu(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Ls(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(cr(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function cr(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ao)||(e.globalVersion=ao,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ls(e))))return;e.flags|=2;const t=e.dep,n=Oe,s=Lt;Oe=e,Lt=!0;try{ar(e);const o=e.fn(e._value);(t.version===0||ln(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Oe=n,Lt=s,lr(e),e.flags&=-3}}function Ds(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)Ds(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function mu(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Lt=!0;const ur=[];function Jt(){ur.push(Lt),Lt=!1}function Xt(){const e=ur.pop();Lt=e===void 0?!0:e}function dr(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Oe;Oe=void 0;try{t()}finally{Oe=n}}}let ao=0;class pu{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Fs{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Oe||!Lt||Oe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Oe)n=this.activeLink=new pu(Oe,this),Oe.deps?(n.prevDep=Oe.depsTail,Oe.depsTail.nextDep=n,Oe.depsTail=n):Oe.deps=Oe.depsTail=n,fr(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=Oe.depsTail,n.nextDep=void 0,Oe.depsTail.nextDep=n,Oe.depsTail=n,Oe.deps===n&&(Oe.deps=s)}return n}trigger(t){this.version++,ao++,this.notify(t)}notify(t){js();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{zs()}}}function fr(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)fr(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Us=new WeakMap,yn=Symbol(""),qs=Symbol(""),lo=Symbol("");function et(e,t,n){if(Lt&&Oe){let s=Us.get(e);s||Us.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Fs),o.map=s,o.key=n),o.track()}}function Qt(e,t,n,s,o,r){const a=Us.get(e);if(!a){ao++;return}const l=c=>{c&&c.trigger()};if(js(),t==="clear")a.forEach(l);else{const c=he(e),p=c&&Es(n);if(c&&n==="length"){const h=Number(s);a.forEach((b,_)=>{(_==="length"||_===lo||!zt(_)&&_>=h)&&l(b)})}else switch((n!==void 0||a.has(void 0))&&l(a.get(n)),p&&l(a.get(lo)),t){case"add":c?p&&l(a.get("length")):(l(a.get(yn)),Nn(e)&&l(a.get(qs)));break;case"delete":c||(l(a.get(yn)),Nn(e)&&l(a.get(qs)));break;case"set":Nn(e)&&l(a.get(yn));break}}zs()}function zn(e){const t=ke(e);return t===e?t:(et(t,"iterate",lo),At(e)?t:t.map(Dt))}function Fo(e){return et(e=ke(e),"iterate",lo),e}function cn(e,t){return tn(e)?_n(e)?Ln(Dt(t)):Ln(t):Dt(t)}const hu={__proto__:null,[Symbol.iterator](){return Bs(this,Symbol.iterator,e=>cn(this,e))},concat(...e){return zn(this).concat(...e.map(t=>he(t)?zn(t):t))},entries(){return Bs(this,"entries",e=>(e[1]=cn(this,e[1]),e))},every(e,t){return en(this,"every",e,t,void 0,arguments)},filter(e,t){return en(this,"filter",e,t,n=>n.map(s=>cn(this,s)),arguments)},find(e,t){return en(this,"find",e,t,n=>cn(this,n),arguments)},findIndex(e,t){return en(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return en(this,"findLast",e,t,n=>cn(this,n),arguments)},findLastIndex(e,t){return en(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return en(this,"forEach",e,t,void 0,arguments)},includes(...e){return Hs(this,"includes",e)},indexOf(...e){return Hs(this,"indexOf",e)},join(e){return zn(this).join(e)},lastIndexOf(...e){return Hs(this,"lastIndexOf",e)},map(e,t){return en(this,"map",e,t,void 0,arguments)},pop(){return co(this,"pop")},push(...e){return co(this,"push",e)},reduce(e,...t){return mr(this,"reduce",e,t)},reduceRight(e,...t){return mr(this,"reduceRight",e,t)},shift(){return co(this,"shift")},some(e,t){return en(this,"some",e,t,void 0,arguments)},splice(...e){return co(this,"splice",e)},toReversed(){return zn(this).toReversed()},toSorted(e){return zn(this).toSorted(e)},toSpliced(...e){return zn(this).toSpliced(...e)},unshift(...e){return co(this,"unshift",e)},values(){return Bs(this,"values",e=>cn(this,e))}};function Bs(e,t,n){const s=Fo(e),o=s[t]();return s!==e&&!At(e)&&(o._next=o.next,o.next=()=>{const r=o._next();return r.done||(r.value=n(r.value)),r}),o}const bu=Array.prototype;function en(e,t,n,s,o,r){const a=Fo(e),l=a!==e&&!At(e),c=a[t];if(c!==bu[t]){const b=c.apply(e,r);return l?Dt(b):b}let p=n;a!==e&&(l?p=function(b,_){return n.call(this,cn(e,b),_,e)}:n.length>2&&(p=function(b,_){return n.call(this,b,_,e)}));const h=c.call(a,p,s);return l&&o?o(h):h}function mr(e,t,n,s){const o=Fo(e);let r=n;return o!==e&&(At(e)?n.length>3&&(r=function(a,l,c){return n.call(this,a,l,c,e)}):r=function(a,l,c){return n.call(this,a,cn(e,l),c,e)}),o[t](r,...s)}function Hs(e,t,n){const s=ke(e);et(s,"iterate",lo);const o=s[t](...n);return(o===-1||o===!1)&&Ws(n[0])?(n[0]=ke(n[0]),s[t](...n)):o}function co(e,t,n=[]){Jt(),js();const s=ke(e)[t].apply(e,n);return zs(),Xt(),s}const gu=As("__proto__,__v_isRef,__isVue"),pr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(zt));function vu(e){zt(e)||(e=String(e));const t=ke(this);return et(t,"has",e),t.hasOwnProperty(e)}class hr{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return r;if(n==="__v_raw")return s===(o?r?kr:_r:r?yr:vr).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const a=he(t);if(!o){let c;if(a&&(c=hu[n]))return c;if(n==="hasOwnProperty")return vu}const l=Reflect.get(t,n,tt(t)?t:s);if((zt(n)?pr.has(n):gu(n))||(o||et(t,"get",n),r))return l;if(tt(l)){const c=a&&Es(n)?l:l.value;return o&&ze(c)?Ks(c):c}return ze(l)?o?Ks(l):Re(l):l}}class br extends hr{constructor(t=!1){super(!1,t)}set(t,n,s,o){let r=t[n];const a=he(t)&&Es(n);if(!this._isShallow){const p=tn(r);if(!At(s)&&!tn(s)&&(r=ke(r),s=ke(s)),!a&&tt(r)&&!tt(s))return p||(r.value=s),!0}const l=a?Number(n)<t.length:Ce(t,n),c=Reflect.set(t,n,s,tt(t)?t:o);return t===ke(o)&&(l?ln(s,r)&&Qt(t,"set",n,s):Qt(t,"add",n,s)),c}deleteProperty(t,n){const s=Ce(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Qt(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!zt(n)||!pr.has(n))&&et(t,"has",n),s}ownKeys(t){return et(t,"iterate",he(t)?"length":yn),Reflect.ownKeys(t)}}class gr extends hr{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const yu=new br,_u=new gr,ku=new br(!0),wu=new gr(!0),Vs=e=>e,Uo=e=>Reflect.getPrototypeOf(e);function $u(e,t,n){return function(...s){const o=this.__v_raw,r=ke(o),a=Nn(r),l=e==="entries"||e===Symbol.iterator&&a,c=e==="keys"&&a,p=o[e](...s),h=n?Vs:t?Ln:Dt;return!t&&et(r,"iterate",c?qs:yn),{next(){const{value:b,done:_}=p.next();return _?{value:b,done:_}:{value:l?[h(b[0]),h(b[1])]:h(b),done:_}},[Symbol.iterator](){return this}}}}function qo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function xu(e,t){const n={get(o){const r=this.__v_raw,a=ke(r),l=ke(o);e||(ln(o,l)&&et(a,"get",o),et(a,"get",l));const{has:c}=Uo(a),p=t?Vs:e?Ln:Dt;if(c.call(a,o))return p(r.get(o));if(c.call(a,l))return p(r.get(l));r!==a&&r.get(o)},get size(){const o=this.__v_raw;return!e&&et(ke(o),"iterate",yn),o.size},has(o){const r=this.__v_raw,a=ke(r),l=ke(o);return e||(ln(o,l)&&et(a,"has",o),et(a,"has",l)),o===l?r.has(o):r.has(o)||r.has(l)},forEach(o,r){const a=this,l=a.__v_raw,c=ke(l),p=t?Vs:e?Ln:Dt;return!e&&et(c,"iterate",yn),l.forEach((h,b)=>o.call(r,p(h),p(b),a))}};return ut(n,e?{add:qo("add"),set:qo("set"),delete:qo("delete"),clear:qo("clear")}:{add(o){!t&&!At(o)&&!tn(o)&&(o=ke(o));const r=ke(this);return Uo(r).has.call(r,o)||(r.add(o),Qt(r,"add",o,o)),this},set(o,r){!t&&!At(r)&&!tn(r)&&(r=ke(r));const a=ke(this),{has:l,get:c}=Uo(a);let p=l.call(a,o);p||(o=ke(o),p=l.call(a,o));const h=c.call(a,o);return a.set(o,r),p?ln(r,h)&&Qt(a,"set",o,r):Qt(a,"add",o,r),this},delete(o){const r=ke(this),{has:a,get:l}=Uo(r);let c=a.call(r,o);c||(o=ke(o),c=a.call(r,o)),l&&l.call(r,o);const p=r.delete(o);return c&&Qt(r,"delete",o,void 0),p},clear(){const o=ke(this),r=o.size!==0,a=o.clear();return r&&Qt(o,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=$u(o,e,t)}),n}function Bo(e,t){const n=xu(e,t);return(s,o,r)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(Ce(n,o)&&o in s?n:s,o,r)}const Iu={get:Bo(!1,!1)},Tu={get:Bo(!1,!0)},Cu={get:Bo(!0,!1)},Su={get:Bo(!0,!0)},vr=new WeakMap,yr=new WeakMap,_r=new WeakMap,kr=new WeakMap;function Au(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ou(e){return e.__v_skip||!Object.isExtensible(e)?0:Au(nu(e))}function Re(e){return tn(e)?e:Ho(e,!1,yu,Iu,vr)}function Eu(e){return Ho(e,!1,ku,Tu,yr)}function Ks(e){return Ho(e,!0,_u,Cu,_r)}function TC(e){return Ho(e,!0,wu,Su,kr)}function Ho(e,t,n,s,o){if(!ze(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const r=Ou(e);if(r===0)return e;const a=o.get(e);if(a)return a;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function _n(e){return tn(e)?_n(e.__v_raw):!!(e&&e.__v_isReactive)}function tn(e){return!!(e&&e.__v_isReadonly)}function At(e){return!!(e&&e.__v_isShallow)}function Ws(e){return e?!!e.__v_raw:!1}function ke(e){const t=e&&e.__v_raw;return t?ke(t):e}function Mu(e){return!Ce(e,"__v_skip")&&Object.isExtensible(e)&&Xi(e,"__v_skip",!0),e}const Dt=e=>ze(e)?Re(e):e,Ln=e=>ze(e)?Ks(e):e;function tt(e){return e?e.__v_isRef===!0:!1}function ue(e){return wr(e,!1)}function Vt(e){return wr(e,!0)}function wr(e,t){return tt(e)?e:new Pu(e,t)}class Pu{constructor(t,n){this.dep=new Fs,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ke(t),this._value=n?t:Dt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||At(t)||tn(t);t=s?t:ke(t),ln(t,n)&&(this._rawValue=t,this._value=s?t:Dt(t),this.dep.trigger())}}function i(e){return tt(e)?e.value:e}const Ru={get:(e,t,n)=>t==="__v_raw"?e:i(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return tt(o)&&!tt(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function $r(e){return _n(e)?e:new Proxy(e,Ru)}class Nu{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Fs(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ao-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Oe!==this)return rr(this,!0),!0}get value(){const t=this.dep.track();return cr(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function ju(e,t,n=!1){let s,o;return Te(e)?s=e:(s=e.get,o=e.set),new Nu(s,o,n)}const Vo={},Ko=new WeakMap;let kn;function zu(e,t=!1,n=kn){if(n){let s=Ko.get(n);s||Ko.set(n,s=[]),s.push(e)}}function Lu(e,t,n=Me){const{immediate:s,deep:o,once:r,scheduler:a,augmentJob:l,call:c}=n,p=k=>o?k:At(k)||o===!1||o===0?nn(k,1):nn(k);let h,b,_,$,y=!1,I=!1;if(tt(e)?(b=()=>e.value,y=At(e)):_n(e)?(b=()=>p(e),y=!0):he(e)?(I=!0,y=e.some(k=>_n(k)||At(k)),b=()=>e.map(k=>{if(tt(k))return k.value;if(_n(k))return p(k);if(Te(k))return c?c(k,2):k()})):Te(e)?t?b=c?()=>c(e,2):e:b=()=>{if(_){Jt();try{_()}finally{Xt()}}const k=kn;kn=h;try{return c?c(e,3,[$]):e($)}finally{kn=k}}:b=gn,t&&o){const k=b,M=o===!0?1/0:o;b=()=>nn(k(),M)}const R=fu(),P=()=>{h.stop(),R&&R.active&&Yi(R.effects,h)};if(r&&t){const k=t;t=(...M)=>{k(...M),P()}}let T=I?new Array(e.length).fill(Vo):Vo;const g=k=>{if(!(!(h.flags&1)||!h.dirty&&!k))if(t){const M=h.run();if(o||y||(I?M.some((w,v)=>ln(w,T[v])):ln(M,T))){_&&_();const w=kn;kn=h;try{const v=[M,T===Vo?void 0:I&&T[0]===Vo?[]:T,$];T=M,c?c(t,3,v):t(...v)}finally{kn=w}}}else h.run()};return l&&l(g),h=new sr(b),h.scheduler=a?()=>a(g,!1):g,$=k=>zu(k,!1,h),_=h.onStop=()=>{const k=Ko.get(h);if(k){if(c)c(k,4);else for(const M of k)M();Ko.delete(h)}},t?s?g(!0):T=h.run():a?a(g.bind(null,!0),!0):h.run(),P.pause=h.pause.bind(h),P.resume=h.resume.bind(h),P.stop=P,P}function nn(e,t=1/0,n){if(t<=0||!ze(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,tt(e))nn(e.value,t,n);else if(he(e))for(let s=0;s<e.length;s++)nn(e[s],t,n);else if(jn(e)||Nn(e))e.forEach(s=>{nn(s,t,n)});else if(Po(e)){for(const s in e)nn(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&nn(e[s],t,n)}return e}const uo=[];let Ys=!1;function CC(e,...t){if(Ys)return;Ys=!0,Jt();const n=uo.length?uo[uo.length-1].component:null,s=n&&n.appContext.config.warnHandler,o=Du();if(s)Dn(s,n,11,[e+t.map(r=>{var a,l;return(l=(a=r.toString)==null?void 0:a.call(r))!=null?l:JSON.stringify(r)}).join(""),n&&n.proxy,o.map(({vnode:r})=>`at <${ra(n,r.type)}>`).join(`
|
|
2
2
|
`),o]);else{const r=[`[Vue warn]: ${e}`,...t];o.length&&r.push(`
|
|
3
|
-
`,...
|
|
4
|
-
`],...Lu(n))}),t}function Lu({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",s=e.component?e.component.parent==null:!1,o=` at <${ra(e.component,e.type,s)}`,r=">"+n;return e.props?[o,...Du(e.props),r]:[o+r]}function Du(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(s=>{t.push(...xr(s,e[s]))}),n.length>3&&t.push(" ..."),t}function xr(e,t,n){return Be(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:tt(t)?(t=xr(e,ke(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):Te(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=ke(t),n?t:[`${e}=`,t])}function Dn(e,t,n,s){try{return s?e(...s):e()}catch(o){Wo(o,t,n)}}function on(e,t,n,s){if(Te(e)){const o=Dn(e,t,n,s);return o&&Zi(o)&&o.catch(r=>{Wo(r,t,n)}),o}if(he(e)){const o=[];for(let r=0;r<e.length;r++)o.push(on(e[r],t,n,s));return o}}function Wo(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:a}=t&&t.appContext.config||Me;if(t){let l=t.parent;const c=t.proxy,p=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const h=l.ec;if(h){for(let b=0;b<h.length;b++)if(h[b](e,c,p)===!1)return}l=l.parent}if(r){Jt(),Dn(r,null,10,[e,c,p]),Xt();return}}Fu(e,n,o,s,a)}function Fu(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const at=[];let Vt=-1;const Fn=[];let un=null,Un=0;const Ir=Promise.resolve();let Yo=null;function ze(e){const t=Yo||Ir;return e?t.then(this?e.bind(this):e):t}function Uu(e){let t=Vt+1,n=at.length;for(;t<n;){const s=t+n>>>1,o=at[s],r=fo(o);r<e||r===e&&o.flags&2?t=s+1:n=s}return t}function Gs(e){if(!(e.flags&1)){const t=fo(e),n=at[at.length-1];!n||!(e.flags&2)&&t>=fo(n)?at.push(e):at.splice(Uu(t),0,e),e.flags|=1,Tr()}}function Tr(){Yo||(Yo=Ir.then(Ar))}function qu(e){he(e)?Fn.push(...e):un&&e.id===-1?un.splice(Un+1,0,e):e.flags&1||(Fn.push(e),e.flags|=1),Tr()}function Cr(e,t,n=Vt+1){for(;n<at.length;n++){const s=at[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;at.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Sr(e){if(Fn.length){const t=[...new Set(Fn)].sort((n,s)=>fo(n)-fo(s));if(Fn.length=0,un){un.push(...t);return}for(un=t,Un=0;Un<un.length;Un++){const n=un[Un];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}un=null,Un=0}}const fo=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ar(e){try{for(Vt=0;Vt<at.length;Vt++){const t=at[Vt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Dn(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Vt<at.length;Vt++){const t=at[Vt];t&&(t.flags&=-2)}Vt=-1,at.length=0,Sr(),Yo=null,(at.length||Fn.length)&&Ar()}}let Je=null,Or=null;function Go(e){const t=Je;return Je=e,Or=e&&e.type.__scopeId||null,t}function Bu(e,t=Je,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Jr(-1);const r=Go(t);let a;try{a=e(...o)}finally{Go(r),s._d&&Jr(1)}return a};return s._n=!0,s._c=!0,s._d=!0,s}function ge(e,t){if(Je===null)return e;const n=ts(Je),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[r,a,l,c=Me]=t[o];r&&(Te(r)&&(r={mounted:r,updated:r}),r.deep&&nn(a),s.push({dir:r,instance:n,value:a,oldValue:void 0,arg:l,modifiers:c}))}return e}function wn(e,t,n,s){const o=e.dirs,r=t&&t.dirs;for(let a=0;a<o.length;a++){const l=o[a];r&&(l.oldValue=r[a].value);let c=l.dir[s];c&&(Jt(),on(c,n,8,[e.el,l,e,t]),Xt())}}const Hu=Symbol("_vte"),Vu=e=>e.__isTeleport,Ku=Symbol("_leaveCb");function Zs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Zs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function $e(e,t){return Te(e)?ut({name:e.name},t,{setup:e}):e}function Wu(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const Zo=new WeakMap;function mo(e,t,n,s,o=!1){if(he(e)){e.forEach((v,I)=>mo(v,t&&(he(t)?t[I]:t),n,s,o));return}if(qn(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&mo(e,t,n,s.component.subTree);return}const r=s.shapeFlag&4?ts(s.component):s.el,a=o?null:r,{i:l,r:c}=e,p=t&&t.r,h=l.refs===Me?l.refs={}:l.refs,b=l.setupState,_=ke(b),$=b===Me?Wi:v=>Ce(_,v);if(p!=null&&p!==c){if(Er(t),Be(p))h[p]=null,$(p)&&(b[p]=null);else if(tt(p)){p.value=null;const v=t;v.k&&(h[v.k]=null)}}if(Te(c))Dn(c,l,12,[a,h]);else{const v=Be(c),I=tt(c);if(v||I){const j=()=>{if(e.f){const P=v?$(c)?b[c]:h[c]:c.value;if(o)he(P)&&Yi(P,r);else if(he(P))P.includes(r)||P.push(r);else if(v)h[c]=[r],$(c)&&(b[c]=h[c]);else{const T=[r];c.value=T,e.k&&(h[e.k]=T)}}else v?(h[c]=a,$(c)&&(b[c]=a)):I&&(c.value=a,e.k&&(h[e.k]=a))};if(a){const P=()=>{j(),Zo.delete(e)};P.id=-1,Zo.set(e,P),$t(P,n)}else Er(e),j()}}}function Er(e){const t=Zo.get(e);t&&(t.flags|=8,Zo.delete(e))}Lo().requestIdleCallback,Lo().cancelIdleCallback;const qn=e=>!!e.type.__asyncLoader,Yu=e=>e.type.__isKeepAlive;function Gu(e,t,n=ft,s=!1){if(n){const o=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...a)=>{Jt();const l=li(n),c=on(t,n,e,a);return l(),Xt(),c});return s?o.unshift(r):o.push(r),r}}const Mr=e=>(t,n=ft)=>{(!vo||e==="sp")&&Gu(e,(...s)=>t(...s),n)},nt=Mr("m"),Ge=Mr("bum"),Zu="components";function Ju(e,t){return Qu(Zu,e,!0,t)||e}const Xu=Symbol.for("v-ndc");function Qu(e,t,n=!0,s=!1){const o=Je||ft;if(o){const r=o.type;{const l=ia(r,!1);if(l&&(l===t||l===rt(t)||l===No(rt(t))))return r}const a=Pr(o[e]||r[e],t)||Pr(o.appContext[e],t);return!a&&s?r:a}}function Pr(e,t){return e&&(e[t]||e[rt(t)]||e[No(rt(t))])}function me(e,t,n,s){let o;const r=n,a=he(e);if(a||Be(e)){const l=a&&_n(e);let c=!1,p=!1;l&&(c=!St(e),p=tn(e),e=Fo(e)),o=new Array(e.length);for(let h=0,b=e.length;h<b;h++)o[h]=t(c?p?Ln(Dt(e[h])):Dt(e[h]):e[h],h,void 0,r)}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,r)}else if(je(e))if(e[Symbol.iterator])o=Array.from(e,(l,c)=>t(l,c,void 0,r));else{const l=Object.keys(e);o=new Array(l.length);for(let c=0,p=l.length;c<p;c++){const h=l[c];o[c]=t(e[h],h,c,r)}}else o=[];return o}function ed(e,t,n={},s,o){if(Je.ce||Je.parent&&qn(Je.parent)&&Je.parent.ce){const p=Object.keys(n).length>0;return n.name=t,d(),_e(q,null,[Ee("slot",n,s)],p?-2:64)}let r=e[t];r&&r._c&&(r._d=!1),d();const a=r&&Rr(r(n)),l=n.key||a&&a.key,c=_e(q,{key:(l&&!zt(l)?l:`_${t}`)+(!a&&s?"_fb":"")},a||[],a&&e._===1?64:-2);return c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),r&&r._c&&(r._d=!0),c}function Rr(e){return e.some(t=>ii(t)?!(t.type===sn||t.type===q&&!Rr(t.children)):!0)?e:null}const Js=e=>e?na(e)?ts(e):Js(e.parent):null,po=ut(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Js(e.parent),$root:e=>Js(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>e.type,$forceUpdate:e=>e.f||(e.f=()=>{Gs(e.update)}),$nextTick:e=>e.n||(e.n=ze.bind(e.proxy)),$watch:e=>gn}),Xs=(e,t)=>e!==Me&&!e.__isScriptSetup&&Ce(e,t),td={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:r,accessCache:a,type:l,appContext:c}=e;if(t[0]!=="$"){const _=a[t];if(_!==void 0)switch(_){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return r[t]}else{if(Xs(s,t))return a[t]=1,s[t];if(Ce(r,t))return a[t]=3,r[t];if(n!==Me&&Ce(n,t))return a[t]=4,n[t];a[t]=0}}const p=po[t];let h,b;if(p)return t==="$attrs"&&et(e.attrs,"get",""),p(e);if((h=l.__cssModules)&&(h=h[t]))return h;if(n!==Me&&Ce(n,t))return a[t]=4,n[t];if(b=c.config.globalProperties,Ce(b,t))return b[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:r}=e;return Xs(o,t)?(o[t]=n,!0):Ce(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:r,type:a}},l){let c;return!!(n[l]||Xs(t,l)||Ce(r,l)||Ce(s,l)||Ce(po,l)||Ce(o.config.globalProperties,l)||(c=a.__cssModules)&&c[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Ce(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Nr(){return{app:null,config:{isNativeTag:Wi,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let nd=0;function od(e,t){return function(s,o=null){Te(s)||(s=ut({},s)),o!=null&&!je(o)&&(o=null);const r=Nr(),a=new WeakSet,l=[];let c=!1;const p=r.app={_uid:nd++,_component:s,_props:o,_container:null,_context:r,_instance:null,version:Dd,get config(){return r.config},set config(h){},use(h,...b){return a.has(h)||(h&&Te(h.install)?(a.add(h),h.install(p,...b)):Te(h)&&(a.add(h),h(p,...b))),p},mixin(h){return p},component(h,b){return b?(r.components[h]=b,p):r.components[h]},directive(h,b){return b?(r.directives[h]=b,p):r.directives[h]},mount(h,b,_){if(!c){const $=p._ceVNode||Ee(s,o);return $.appContext=r,_===!0?_="svg":_===!1&&(_=void 0),e($,h,_),c=!0,p._container=h,h.__vue_app__=p,ts($.component)}},onUnmount(h){l.push(h)},unmount(){c&&(on(l,p._instance,16),e(null,p._container),delete p._container.__vue_app__)},provide(h,b){return r.provides[h]=b,p},runWithContext(h){const b=Bn;Bn=p;try{return h()}finally{Bn=b}}};return p}}let Bn=null;function jr(e,t){if(ft){let n=ft.provides;const s=ft.parent&&ft.parent.provides;s===n&&(n=ft.provides=Object.create(s)),n[e]=t}}function Qs(e,t,n=!1){const s=ea();if(s||Bn){let o=Bn?Bn._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&Te(t)?t.call(s&&s.proxy):t}}const sd=Symbol.for("v-scx"),id=()=>Qs(sd);function ve(e,t,n){return rd(e,t,n)}function rd(e,t,n=Me){const{immediate:s,deep:o,flush:r,once:a}=n,l=ut({},n),c=t&&s||!t&&r!=="post";let p;if(vo){if(r==="sync"){const $=id();p=$.__watcherHandles||($.__watcherHandles=[])}else if(!c){const $=()=>{};return $.stop=gn,$.resume=gn,$.pause=gn,$}}const h=ft;l.call=($,v,I)=>on($,h,v,I);let b=!1;r==="post"?l.scheduler=$=>{$t($,h&&h.suspense)}:r!=="sync"&&(b=!0,l.scheduler=($,v)=>{v?$():Gs($)}),l.augmentJob=$=>{t&&($.flags|=4),b&&($.flags|=2,h&&($.id=h.uid,$.i=h))};const _=Nu(e,t,l);return vo&&(p?p.push(_):c&&_()),_}const ad=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${rt(t)}Modifiers`]||e[`${wt(t)}Modifiers`];function ld(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Me;let o=n;const r=t.startsWith("update:"),a=r&&ad(s,t.slice(7));a&&(a.trim&&(o=n.map(h=>Be(h)?h.trim():h)),a.number&&(o=n.map(zo)));let l,c=s[l=Ms(t)]||s[l=Ms(rt(t))];!c&&r&&(c=s[l=Ms(wt(t))]),c&&on(c,e,6,o);const p=s[l+"Once"];if(p){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,on(p,e,6,o)}}function cd(e,t,n=!1){const s=t.emitsCache,o=s.get(e);if(o!==void 0)return o;const r=e.emits;let a={};return r?(he(r)?r.forEach(l=>a[l]=null):ut(a,r),je(e)&&s.set(e,a),a):(je(e)&&s.set(e,null),null)}function Jo(e,t){return!e||!Mo(t)?!1:(t=t.slice(2).replace(/Once$/,""),Ce(e,t[0].toLowerCase()+t.slice(1))||Ce(e,wt(t))||Ce(e,t))}function $C(){}function zr(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[r],slots:a,attrs:l,emit:c,render:p,renderCache:h,props:b,data:_,setupState:$,ctx:v,inheritAttrs:I}=e,j=Go(e);let P,T;try{if(n.shapeFlag&4){const k=o||s,E=k;P=Kt(p.call(E,k,h,b,$,_,v)),T=l}else{const k=t;P=Kt(k.length>1?k(b,{attrs:l,slots:a,emit:c}):k(b,null)),T=t.props?l:ud(l)}}catch(k){ho.length=0,Wo(k,e,1),P=Ee(sn)}let g=P;if(T&&I!==!1){const k=Object.keys(T),{shapeFlag:E}=g;k.length&&E&7&&(r&&k.some(Os)&&(T=dd(T,r)),g=Hn(g,T,!1,!0))}return n.dirs&&(g=Hn(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(n.dirs):n.dirs),n.transition&&Zs(g,n.transition),P=g,Go(j),P}const ud=e=>{let t;for(const n in e)(n==="class"||n==="style"||Mo(n))&&((t||(t={}))[n]=e[n]);return t},dd=(e,t)=>{const n={};for(const s in e)(!Os(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function fd(e,t,n){const{props:s,children:o,component:r}=e,{props:a,children:l,patchFlag:c}=t,p=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return s?Lr(s,a,p):!!a;if(c&8){const h=t.dynamicProps;for(let b=0;b<h.length;b++){const _=h[b];if(a[_]!==s[_]&&!Jo(p,_))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===a?!1:s?a?Lr(s,a,p):!0:!!a;return!1}function Lr(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const r=s[o];if(t[r]!==e[r]&&!Jo(n,r))return!0}return!1}function md({vnode:e,parent:t},n){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.el=e.el),s===e)(e=t.vnode).el=n,t=t.parent;else break}}const Dr={},Fr=()=>Object.create(Dr),Ur=e=>Object.getPrototypeOf(e)===Dr;function pd(e,t,n,s=!1){const o={},r=Fr();e.propsDefaults=Object.create(null),qr(e,t,o,r);for(const a in e.propsOptions[0])a in o||(o[a]=void 0);n?e.props=s?o:Su(o):e.type.props?e.props=o:e.props=r,e.attrs=r}function hd(e,t,n,s){const{props:o,attrs:r,vnode:{patchFlag:a}}=e,l=ke(o),[c]=e.propsOptions;let p=!1;if((s||a>0)&&!(a&16)){if(a&8){const h=e.vnode.dynamicProps;for(let b=0;b<h.length;b++){let _=h[b];if(Jo(e.emitsOptions,_))continue;const $=t[_];if(c)if(Ce(r,_))$!==r[_]&&(r[_]=$,p=!0);else{const v=rt(_);o[v]=ei(c,l,v,$,e,!1)}else $!==r[_]&&(r[_]=$,p=!0)}}}else{qr(e,t,o,r)&&(p=!0);let h;for(const b in l)(!t||!Ce(t,b)&&((h=wt(b))===b||!Ce(t,h)))&&(c?n&&(n[b]!==void 0||n[h]!==void 0)&&(o[b]=ei(c,l,b,void 0,e,!0)):delete o[b]);if(r!==l)for(const b in r)(!t||!Ce(t,b))&&(delete r[b],p=!0)}p&&Qt(e.attrs,"set","")}function qr(e,t,n,s){const[o,r]=e.propsOptions;let a=!1,l;if(t)for(let c in t){if(so(c))continue;const p=t[c];let h;o&&Ce(o,h=rt(c))?!r||!r.includes(h)?n[h]=p:(l||(l={}))[h]=p:Jo(e.emitsOptions,c)||(!(c in s)||p!==s[c])&&(s[c]=p,a=!0)}if(r){const c=ke(n),p=l||Me;for(let h=0;h<r.length;h++){const b=r[h];n[b]=ei(o,c,b,p[b],e,!Ce(p,b))}}return a}function ei(e,t,n,s,o,r){const a=e[n];if(a!=null){const l=Ce(a,"default");if(l&&s===void 0){const c=a.default;if(a.type!==Function&&!a.skipFactory&&Te(c)){const{propsDefaults:p}=o;if(n in p)s=p[n];else{const h=li(o);s=p[n]=c.call(null,t),h()}}else s=c;o.ce&&o.ce._setProp(n,s)}a[0]&&(r&&!l?s=!1:a[1]&&(s===""||s===wt(n))&&(s=!0))}return s}function bd(e,t,n=!1){const s=t.propsCache,o=s.get(e);if(o)return o;const r=e.props,a={},l=[];if(!r)return je(e)&&s.set(e,Rn),Rn;if(he(r))for(let p=0;p<r.length;p++){const h=rt(r[p]);Br(h)&&(a[h]=Me)}else if(r)for(const p in r){const h=rt(p);if(Br(h)){const b=r[p],_=a[h]=he(b)||Te(b)?{type:b}:ut({},b),$=_.type;let v=!1,I=!0;if(he($))for(let j=0;j<$.length;++j){const P=$[j],T=Te(P)&&P.name;if(T==="Boolean"){v=!0;break}else T==="String"&&(I=!1)}else v=Te($)&&$.name==="Boolean";_[0]=v,_[1]=I,(v||Ce(_,"default"))&&l.push(h)}}const c=[a,l];return je(e)&&s.set(e,c),c}function Br(e){return e[0]!=="$"&&!so(e)}const ti=e=>e==="_"||e==="_ctx"||e==="$stable",ni=e=>he(e)?e.map(Kt):[Kt(e)],gd=(e,t,n)=>{if(t._n)return t;const s=Bu((...o)=>ni(t(...o)),n);return s._c=!1,s},Hr=(e,t,n)=>{const s=e._ctx;for(const o in e){if(ti(o))continue;const r=e[o];if(Te(r))t[o]=gd(o,r,s);else if(r!=null){const a=ni(r);t[o]=()=>a}}},Vr=(e,t)=>{const n=ni(t);e.slots.default=()=>n},Kr=(e,t,n)=>{for(const s in t)(n||!ti(s))&&(e[s]=t[s])},vd=(e,t,n)=>{const s=e.slots=Fr();if(e.vnode.shapeFlag&32){const o=t._;o?(Kr(s,t,n),n&&Xi(s,"_",o,!0)):Hr(t,s)}else t&&Vr(e,t)},yd=(e,t,n)=>{const{vnode:s,slots:o}=e;let r=!0,a=Me;if(s.shapeFlag&32){const l=t._;l?n&&l===1?r=!1:Kr(o,t,n):(r=!t.$stable,Hr(t,o)),a=t}else t&&(Vr(e,t),a={default:1});if(r)for(const l in o)!ti(l)&&a[l]==null&&delete o[l]},$t=xd;function _d(e){return kd(e)}function kd(e,t){const n=Lo();n.__VUE__=!0;const{insert:s,remove:o,patchProp:r,createElement:a,createText:l,createComment:c,setText:p,setElementText:h,parentNode:b,nextSibling:_,setScopeId:$=gn,insertStaticContent:v}=e,I=(S,R,F,G=null,V=null,H=null,te=void 0,Q=null,X=!!R.dynamicChildren)=>{if(S===R)return;S&&!go(S,R)&&(G=W(S),Fe(S,V,H,!0),S=null),R.patchFlag===-2&&(X=!1,R.dynamicChildren=null);const{type:Y,ref:ce,shapeFlag:ne}=R;switch(Y){case Xo:j(S,R,F,G);break;case sn:P(S,R,F,G);break;case si:S==null&&T(R,F,G,te);break;case q:B(S,R,F,G,V,H,te,Q,X);break;default:ne&1?E(S,R,F,G,V,H,te,Q,X):ne&6?ee(S,R,F,G,V,H,te,Q,X):(ne&64||ne&128)&&Y.process(S,R,F,G,V,H,te,Q,X,Rt)}ce!=null&&V?mo(ce,S&&S.ref,H,R||S,!R):ce==null&&S&&S.ref!=null&&mo(S.ref,null,H,S,!0)},j=(S,R,F,G)=>{if(S==null)s(R.el=l(R.children),F,G);else{const V=R.el=S.el;R.children!==S.children&&p(V,R.children)}},P=(S,R,F,G)=>{S==null?s(R.el=c(R.children||""),F,G):R.el=S.el},T=(S,R,F,G)=>{[S.el,S.anchor]=v(S.children,R,F,G,S.el,S.anchor)},g=({el:S,anchor:R},F,G)=>{let V;for(;S&&S!==R;)V=_(S),s(S,F,G),S=V;s(R,F,G)},k=({el:S,anchor:R})=>{let F;for(;S&&S!==R;)F=_(S),o(S),S=F;o(R)},E=(S,R,F,G,V,H,te,Q,X)=>{if(R.type==="svg"?te="svg":R.type==="math"&&(te="mathml"),S==null)w(R,F,G,V,H,te,Q,X);else{const Y=S.el&&S.el._isVueCE?S.el:null;try{Y&&Y._beginPatch(),N(S,R,V,H,te,Q,X)}finally{Y&&Y._endPatch()}}},w=(S,R,F,G,V,H,te,Q)=>{let X,Y;const{props:ce,shapeFlag:ne,transition:ae,dirs:de}=S;if(X=S.el=a(S.type,H,ce&&ce.is,ce),ne&8?h(X,S.children):ne&16&&x(S.children,X,null,G,V,oi(S,H),te,Q),de&&wn(S,null,G,"created"),y(X,S,S.scopeId,te,G),ce){for(const Se in ce)Se!=="value"&&!so(Se)&&r(X,Se,null,ce[Se],H,G);"value"in ce&&r(X,"value",null,ce.value,H),(Y=ce.onVnodeBeforeMount)&&Wt(Y,G,S)}de&&wn(S,null,G,"beforeMount");const ye=wd(V,ae);ye&&ae.beforeEnter(X),s(X,R,F),((Y=ce&&ce.onVnodeMounted)||ye||de)&&$t(()=>{Y&&Wt(Y,G,S),ye&&ae.enter(X),de&&wn(S,null,G,"mounted")},V)},y=(S,R,F,G,V)=>{if(F&&$(S,F),G)for(let H=0;H<G.length;H++)$(S,G[H]);if(V){let H=V.subTree;if(R===H||Zr(H.type)&&(H.ssContent===R||H.ssFallback===R)){const te=V.vnode;y(S,te,te.scopeId,te.slotScopeIds,V.parent)}}},x=(S,R,F,G,V,H,te,Q,X=0)=>{for(let Y=X;Y<S.length;Y++){const ce=S[Y]=Q?dn(S[Y]):Kt(S[Y]);I(null,ce,R,F,G,V,H,te,Q)}},N=(S,R,F,G,V,H,te)=>{const Q=R.el=S.el;let{patchFlag:X,dynamicChildren:Y,dirs:ce}=R;X|=S.patchFlag&16;const ne=S.props||Me,ae=R.props||Me;let de;if(F&&$n(F,!1),(de=ae.onVnodeBeforeUpdate)&&Wt(de,F,R,S),ce&&wn(R,S,F,"beforeUpdate"),F&&$n(F,!0),(ne.innerHTML&&ae.innerHTML==null||ne.textContent&&ae.textContent==null)&&h(Q,""),Y?M(S.dynamicChildren,Y,Q,F,G,oi(R,V),H):te||D(S,R,Q,null,F,G,oi(R,V),H,!1),X>0){if(X&16)O(Q,ne,ae,F,V);else if(X&2&&ne.class!==ae.class&&r(Q,"class",null,ae.class,V),X&4&&r(Q,"style",ne.style,ae.style,V),X&8){const ye=R.dynamicProps;for(let Se=0;Se<ye.length;Se++){const xe=ye[Se],st=ne[xe],it=ae[xe];(it!==st||xe==="value")&&r(Q,xe,st,it,V,F)}}X&1&&S.children!==R.children&&h(Q,R.children)}else!te&&Y==null&&O(Q,ne,ae,F,V);((de=ae.onVnodeUpdated)||ce)&&$t(()=>{de&&Wt(de,F,R,S),ce&&wn(R,S,F,"updated")},G)},M=(S,R,F,G,V,H,te)=>{for(let Q=0;Q<R.length;Q++){const X=S[Q],Y=R[Q],ce=X.el&&(X.type===q||!go(X,Y)||X.shapeFlag&198)?b(X.el):F;I(X,Y,ce,null,G,V,H,te,!0)}},O=(S,R,F,G,V)=>{if(R!==F){if(R!==Me)for(const H in R)!so(H)&&!(H in F)&&r(S,H,R[H],null,V,G);for(const H in F){if(so(H))continue;const te=F[H],Q=R[H];te!==Q&&H!=="value"&&r(S,H,Q,te,V,G)}"value"in F&&r(S,"value",R.value,F.value,V)}},B=(S,R,F,G,V,H,te,Q,X)=>{const Y=R.el=S?S.el:l(""),ce=R.anchor=S?S.anchor:l("");let{patchFlag:ne,dynamicChildren:ae,slotScopeIds:de}=R;de&&(Q=Q?Q.concat(de):de),S==null?(s(Y,F,G),s(ce,F,G),x(R.children||[],F,ce,V,H,te,Q,X)):ne>0&&ne&64&&ae&&S.dynamicChildren?(M(S.dynamicChildren,ae,F,V,H,te,Q),(R.key!=null||V&&R===V.subTree)&&Wr(S,R,!0)):D(S,R,F,ce,V,H,te,Q,X)},ee=(S,R,F,G,V,H,te,Q,X)=>{R.slotScopeIds=Q,S==null?R.shapeFlag&512?V.ctx.activate(R,F,G,te,X):re(R,F,G,V,H,te,X):be(S,R,X)},re=(S,R,F,G,V,H,te)=>{const Q=S.component=Ed(S,G,V);if(Yu(S)&&(Q.ctx.renderer=Rt),Md(Q,!1,te),Q.asyncDep){if(V&&V.registerDep(Q,we,te),!S.el){const X=Q.subTree=Ee(sn);P(null,X,R,F),S.placeholder=X.el}}else we(Q,S,R,F,V,H,te)},be=(S,R,F)=>{const G=R.component=S.component;if(fd(S,R,F))if(G.asyncDep&&!G.asyncResolved){K(G,R,F);return}else G.next=R,G.update();else R.el=S.el,G.vnode=R},we=(S,R,F,G,V,H,te)=>{const Q=()=>{if(S.isMounted){let{next:ne,bu:ae,u:de,parent:ye,vnode:Se}=S;{const jt=Yr(S);if(jt){ne&&(ne.el=Se.el,K(S,ne,te)),jt.asyncDep.then(()=>{S.isUnmounted||Q()});return}}let xe=ne,st;$n(S,!1),ne?(ne.el=Se.el,K(S,ne,te)):ne=Se,ae&&jo(ae),(st=ne.props&&ne.props.onVnodeBeforeUpdate)&&Wt(st,ye,ne,Se),$n(S,!0);const it=zr(S),Nt=S.subTree;S.subTree=it,I(Nt,it,b(Nt.el),W(Nt),S,V,H),ne.el=it.el,xe===null&&md(S,it.el),de&&$t(de,V),(st=ne.props&&ne.props.onVnodeUpdated)&&$t(()=>Wt(st,ye,ne,Se),V)}else{let ne;const{el:ae,props:de}=R,{bm:ye,m:Se,parent:xe,root:st,type:it}=S,Nt=qn(R);$n(S,!1),ye&&jo(ye),!Nt&&(ne=de&&de.onVnodeBeforeMount)&&Wt(ne,xe,R),$n(S,!0);{st.ce&&st.ce._def.shadowRoot!==!1&&st.ce._injectChildStyle(it);const jt=S.subTree=zr(S);I(null,jt,F,G,S,V,H),R.el=jt.el}if(Se&&$t(Se,V),!Nt&&(ne=de&&de.onVnodeMounted)){const jt=R;$t(()=>Wt(ne,xe,jt),V)}(R.shapeFlag&256||xe&&qn(xe.vnode)&&xe.vnode.shapeFlag&256)&&S.a&&$t(S.a,V),S.isMounted=!0,R=F=G=null}};S.scope.on();const X=S.effect=new sr(Q);S.scope.off();const Y=S.update=X.run.bind(X),ce=S.job=X.runIfDirty.bind(X);ce.i=S,ce.id=S.uid,X.scheduler=()=>Gs(ce),$n(S,!0),Y()},K=(S,R,F)=>{R.component=S;const G=S.vnode.props;S.vnode=R,S.next=null,hd(S,R.props,G,F),yd(S,R.children,F),Jt(),Cr(S),Xt()},D=(S,R,F,G,V,H,te,Q,X=!1)=>{const Y=S&&S.children,ce=S?S.shapeFlag:0,ne=R.children,{patchFlag:ae,shapeFlag:de}=R;if(ae>0){if(ae&128){De(Y,ne,F,G,V,H,te,Q,X);return}else if(ae&256){U(Y,ne,F,G,V,H,te,Q,X);return}}de&8?(ce&16&&J(Y,V,H),ne!==Y&&h(F,ne)):ce&16?de&16?De(Y,ne,F,G,V,H,te,Q,X):J(Y,V,H,!0):(ce&8&&h(F,""),de&16&&x(ne,F,G,V,H,te,Q,X))},U=(S,R,F,G,V,H,te,Q,X)=>{S=S||Rn,R=R||Rn;const Y=S.length,ce=R.length,ne=Math.min(Y,ce);let ae;for(ae=0;ae<ne;ae++){const de=R[ae]=X?dn(R[ae]):Kt(R[ae]);I(S[ae],de,F,null,V,H,te,Q,X)}Y>ce?J(S,V,H,!0,!1,ne):x(R,F,G,V,H,te,Q,X,ne)},De=(S,R,F,G,V,H,te,Q,X)=>{let Y=0;const ce=R.length;let ne=S.length-1,ae=ce-1;for(;Y<=ne&&Y<=ae;){const de=S[Y],ye=R[Y]=X?dn(R[Y]):Kt(R[Y]);if(go(de,ye))I(de,ye,F,null,V,H,te,Q,X);else break;Y++}for(;Y<=ne&&Y<=ae;){const de=S[ne],ye=R[ae]=X?dn(R[ae]):Kt(R[ae]);if(go(de,ye))I(de,ye,F,null,V,H,te,Q,X);else break;ne--,ae--}if(Y>ne){if(Y<=ae){const de=ae+1,ye=de<ce?R[de].el:G;for(;Y<=ae;)I(null,R[Y]=X?dn(R[Y]):Kt(R[Y]),F,ye,V,H,te,Q,X),Y++}}else if(Y>ae)for(;Y<=ne;)Fe(S[Y],V,H,!0),Y++;else{const de=Y,ye=Y,Se=new Map;for(Y=ye;Y<=ae;Y++){const ct=R[Y]=X?dn(R[Y]):Kt(R[Y]);ct.key!=null&&Se.set(ct.key,Y)}let xe,st=0;const it=ae-ye+1;let Nt=!1,jt=0;const Mn=new Array(it);for(Y=0;Y<it;Y++)Mn[Y]=0;for(Y=de;Y<=ne;Y++){const ct=S[Y];if(st>=it){Fe(ct,V,H,!0);continue}let Tt;if(ct.key!=null)Tt=Se.get(ct.key);else for(xe=ye;xe<=ae;xe++)if(Mn[xe-ye]===0&&go(ct,R[xe])){Tt=xe;break}Tt===void 0?Fe(ct,V,H,!0):(Mn[Tt-ye]=Y+1,Tt>=jt?jt=Tt:Nt=!0,I(ct,R[Tt],F,null,V,H,te,Q,X),st++)}const eo=Nt?$d(Mn):Rn;for(xe=eo.length-1,Y=it-1;Y>=0;Y--){const ct=ye+Y,Tt=R[ct],C=R[ct+1],L=ct+1<ce?C.el||C.placeholder:G;Mn[Y]===0?I(null,Tt,F,L,V,H,te,Q,X):Nt&&(xe<0||Y!==eo[xe]?Ne(Tt,F,L,2):xe--)}}},Ne=(S,R,F,G,V=null)=>{const{el:H,type:te,transition:Q,children:X,shapeFlag:Y}=S;if(Y&6){Ne(S.component.subTree,R,F,G);return}if(Y&128){S.suspense.move(R,F,G);return}if(Y&64){te.move(S,R,F,Rt);return}if(te===q){s(H,R,F);for(let ne=0;ne<X.length;ne++)Ne(X[ne],R,F,G);s(S.anchor,R,F);return}if(te===si){g(S,R,F);return}if(G!==2&&Y&1&&Q)if(G===0)Q.beforeEnter(H),s(H,R,F),$t(()=>Q.enter(H),V);else{const{leave:ne,delayLeave:ae,afterLeave:de}=Q,ye=()=>{S.ctx.isUnmounted?o(H):s(H,R,F)},Se=()=>{H._isLeaving&&H[Ku](!0),ne(H,()=>{ye(),de&&de()})};ae?ae(H,ye,Se):Se()}else s(H,R,F)},Fe=(S,R,F,G=!1,V=!1)=>{const{type:H,props:te,ref:Q,children:X,dynamicChildren:Y,shapeFlag:ce,patchFlag:ne,dirs:ae,cacheIndex:de}=S;if(ne===-2&&(V=!1),Q!=null&&(Jt(),mo(Q,null,F,S,!0),Xt()),de!=null&&(R.renderCache[de]=void 0),ce&256){R.ctx.deactivate(S);return}const ye=ce&1&&ae,Se=!qn(S);let xe;if(Se&&(xe=te&&te.onVnodeBeforeUnmount)&&Wt(xe,R,S),ce&6)Z(S.component,F,G);else{if(ce&128){S.suspense.unmount(F,G);return}ye&&wn(S,null,R,"beforeUnmount"),ce&64?S.type.remove(S,R,F,Rt,G):Y&&!Y.hasOnce&&(H!==q||ne>0&&ne&64)?J(Y,R,F,!1,!0):(H===q&&ne&384||!V&&ce&16)&&J(X,R,F),G&&Qe(S)}(Se&&(xe=te&&te.onVnodeUnmounted)||ye)&&$t(()=>{xe&&Wt(xe,R,S),ye&&wn(S,null,R,"unmounted")},F)},Qe=S=>{const{type:R,el:F,anchor:G,transition:V}=S;if(R===q){oe(F,G);return}if(R===si){k(S);return}const H=()=>{o(F),V&&!V.persisted&&V.afterLeave&&V.afterLeave()};if(S.shapeFlag&1&&V&&!V.persisted){const{leave:te,delayLeave:Q}=V,X=()=>te(F,H);Q?Q(S.el,H,X):X()}else H()},oe=(S,R)=>{let F;for(;S!==R;)F=_(S),o(S),S=F;o(R)},Z=(S,R,F)=>{const{bum:G,scope:V,job:H,subTree:te,um:Q,m:X,a:Y}=S;Gr(X),Gr(Y),G&&jo(G),V.stop(),H&&(H.flags|=8,Fe(te,S,R,F)),Q&&$t(Q,R),$t(()=>{S.isUnmounted=!0},R)},J=(S,R,F,G=!1,V=!1,H=0)=>{for(let te=H;te<S.length;te++)Fe(S[te],R,F,G,V)},W=S=>{if(S.shapeFlag&6)return W(S.component.subTree);if(S.shapeFlag&128)return S.suspense.next();const R=_(S.anchor||S.el),F=R&&R[Hu];return F?_(F):R};let pe=!1;const Bt=(S,R,F)=>{S==null?R._vnode&&Fe(R._vnode,null,null,!0):I(R._vnode||null,S,R,null,null,null,F),R._vnode=S,pe||(pe=!0,Cr(),Sr(),pe=!1)},Rt={p:I,um:Fe,m:Ne,r:Qe,mt:re,mc:x,pc:D,pbc:M,n:W,o:e};return{render:Bt,hydrate:void 0,createApp:od(Bt)}}function oi({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function $n({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function wd(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Wr(e,t,n=!1){const s=e.children,o=t.children;if(he(s)&&he(o))for(let r=0;r<s.length;r++){const a=s[r];let l=o[r];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[r]=dn(o[r]),l.el=a.el),!n&&l.patchFlag!==-2&&Wr(a,l)),l.type===Xo&&l.patchFlag!==-1&&(l.el=a.el),l.type===sn&&!l.el&&(l.el=a.el)}}function $d(e){const t=e.slice(),n=[0];let s,o,r,a,l;const c=e.length;for(s=0;s<c;s++){const p=e[s];if(p!==0){if(o=n[n.length-1],e[o]<p){t[s]=o,n.push(s);continue}for(r=0,a=n.length-1;r<a;)l=r+a>>1,e[n[l]]<p?r=l+1:a=l;p<e[n[r]]&&(r>0&&(t[s]=n[r-1]),n[r]=s)}}for(r=n.length,a=n[r-1];r-- >0;)n[r]=a,a=t[a];return n}function Yr(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Yr(t)}function Gr(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const Zr=e=>e.__isSuspense;function xd(e,t){t&&t.pendingBranch?he(e)?t.effects.push(...e):t.effects.push(e):qu(e)}const q=Symbol.for("v-fgt"),Xo=Symbol.for("v-txt"),sn=Symbol.for("v-cmt"),si=Symbol.for("v-stc"),ho=[];let xt=null;function d(e=!1){ho.push(xt=e?null:[])}function Id(){ho.pop(),xt=ho[ho.length-1]||null}let bo=1;function Jr(e,t=!1){bo+=e,e<0&&xt&&t&&(xt.hasOnce=!0)}function Xr(e){return e.dynamicChildren=bo>0?xt||Rn:null,Id(),bo>0&&xt&&xt.push(e),e}function m(e,t,n,s,o,r){return Xr(f(e,t,n,s,o,r,!0))}function _e(e,t,n,s,o){return Xr(Ee(e,t,n,s,o,!0))}function ii(e){return e?e.__v_isVNode===!0:!1}function go(e,t){return e.type===t.type&&e.key===t.key}const Qr=({key:e})=>e??null,Qo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Be(e)||tt(e)||Te(e)?{i:Je,r:e,k:t,f:!!n}:e:null);function f(e,t=null,n=null,s=0,o=null,r=e===q?0:1,a=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Qr(t),ref:t&&Qo(t),scopeId:Or,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Je};return l?(ri(c,n),r&128&&e.normalize(c)):n&&(c.shapeFlag|=Be(n)?8:16),bo>0&&!a&&xt&&(c.patchFlag>0||r&6)&&c.patchFlag!==32&&xt.push(c),c}const Ee=Td;function Td(e,t=null,n=null,s=0,o=null,r=!1){if((!e||e===Xu)&&(e=sn),ii(e)){const l=Hn(e,t,!0);return n&&ri(l,n),bo>0&&!r&&xt&&(l.shapeFlag&6?xt[xt.indexOf(e)]=l:xt.push(l)),l.patchFlag=-2,l}if(Ld(e)&&(e=e.__vccOpts),t){t=Cd(t);let{class:l,style:c}=t;l&&!Be(l)&&(t.class=Ve(l)),je(c)&&(Ws(c)&&!he(c)&&(c=ut({},c)),t.style=Do(c))}const a=Be(e)?1:Zr(e)?128:Vu(e)?64:je(e)?4:Te(e)?2:0;return f(e,t,n,s,o,a,r,!0)}function Cd(e){return e?Ws(e)||Ur(e)?ut({},e):e:null}function Hn(e,t,n=!1,s=!1){const{props:o,ref:r,patchFlag:a,children:l,transition:c}=e,p=t?Sd(o||{},t):o,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:p,key:p&&Qr(p),ref:t&&t.ref?n&&r?he(r)?r.concat(Qo(t)):[r,Qo(t)]:Qo(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==q?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Hn(e.ssContent),ssFallback:e.ssFallback&&Hn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&s&&Zs(h,c.clone(h)),h}function At(e=" ",t=0){return Ee(Xo,null,e,t)}function A(e="",t=!1){return t?(d(),_e(sn,null,e)):Ee(sn,null,e)}function Kt(e){return e==null||typeof e=="boolean"?Ee(sn):he(e)?Ee(q,null,e.slice()):ii(e)?dn(e):Ee(Xo,null,String(e))}function dn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Hn(e)}function ri(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(he(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),ri(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Ur(t)?t._ctx=Je:o===3&&Je&&(Je.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Te(t)?(t={default:t,_ctx:Je},n=32):(t=String(t),s&64?(n=16,t=[At(t)]):n=8);e.children=t,e.shapeFlag|=n}function Sd(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=Ve([t.class,s.class]));else if(o==="style")t.style=Do([t.style,s.style]);else if(Mo(o)){const r=t[o],a=s[o];a&&r!==a&&!(he(r)&&r.includes(a))&&(t[o]=r?[].concat(r,a):a)}else o!==""&&(t[o]=s[o])}return t}function Wt(e,t,n,s=null){on(e,t,7,[n,s])}const Ad=Nr();let Od=0;function Ed(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Ad,r={uid:Od++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new lu(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:bd(s,o),emitsOptions:cd(s,o),emit:null,emitted:null,propsDefaults:Me,inheritAttrs:s.inheritAttrs,ctx:Me,data:Me,props:Me,attrs:Me,slots:Me,refs:Me,setupState:Me,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return r.ctx={_:r},r.root=t?t.root:r,r.emit=ld.bind(null,r),e.ce&&e.ce(r),r}let ft=null;const ea=()=>ft||Je;let es,ai;{const e=Lo(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),r=>{o.length>1?o.forEach(a=>a(r)):o[0](r)}};es=t("__VUE_INSTANCE_SETTERS__",n=>ft=n),ai=t("__VUE_SSR_SETTERS__",n=>vo=n)}const li=e=>{const t=ft;return es(e),e.scope.on(),()=>{e.scope.off(),es(t)}},ta=()=>{ft&&ft.scope.off(),es(null)};function na(e){return e.vnode.shapeFlag&4}let vo=!1;function Md(e,t=!1,n=!1){t&&ai(t);const{props:s,children:o}=e.vnode,r=na(e);pd(e,s,r,t),vd(e,o,n||t);const a=r?Pd(e,t):void 0;return t&&ai(!1),a}function Pd(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,td);const{setup:s}=n;if(s){Jt();const o=e.setupContext=s.length>1?Nd(e):null,r=li(e),a=Dn(s,e,0,[e.props,o]),l=Zi(a);if(Xt(),r(),(l||e.sp)&&!qn(e)&&Wu(e),l){if(a.then(ta,ta),t)return a.then(c=>{oa(e,c)}).catch(c=>{Wo(c,e,0)});e.asyncDep=a}else oa(e,a)}else sa(e)}function oa(e,t,n){Te(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:je(t)&&(e.setupState=$r(t)),sa(e)}function sa(e,t,n){const s=e.type;e.render||(e.render=s.render||gn)}const Rd={get(e,t){return et(e,"get",""),e[t]}};function Nd(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Rd),slots:e.slots,emit:e.emit,expose:t}}function ts(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy($r(Au(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in po)return po[n](e)},has(t,n){return n in t||n in po}})):e.proxy}const jd=/(?:^|[-_])\w/g,zd=e=>e.replace(jd,t=>t.toUpperCase()).replace(/[-_]/g,"");function ia(e,t=!0){return Te(e)?e.displayName||e.name:e.name||t&&e.__name}function ra(e,t,n=!1){let s=ia(t);if(!s&&t.__file){const o=t.__file.match(/([^/\\]+)\.\w+$/);o&&(s=o[1])}if(!s&&e){const o=r=>{for(const a in r)if(r[a]===t)return a};s=o(e.components)||e.parent&&o(e.parent.type.components)||o(e.appContext.components)}return s?zd(s):n?"App":"Anonymous"}function Ld(e){return Te(e)&&"__vccOpts"in e}const z=(e,t)=>Pu(e,t,vo),Dd="3.5.25";let ci;const aa=typeof window<"u"&&window.trustedTypes;if(aa)try{ci=aa.createPolicy("vue",{createHTML:e=>e})}catch{}const la=ci?e=>ci.createHTML(e):e=>e,Fd="http://www.w3.org/2000/svg",Ud="http://www.w3.org/1998/Math/MathML",rn=typeof document<"u"?document:null,ca=rn&&rn.createElement("template"),qd={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?rn.createElementNS(Fd,e):t==="mathml"?rn.createElementNS(Ud,e):n?rn.createElement(e,{is:n}):rn.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>rn.createTextNode(e),createComment:e=>rn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>rn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,r){const a=n?n.previousSibling:t.lastChild;if(o&&(o===r||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===r||!(o=o.nextSibling)););else{ca.innerHTML=la(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=ca.content;if(s==="svg"||s==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[a?a.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Bd=Symbol("_vtc");function Hd(e,t,n){const s=e[Bd];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ua=Symbol("_vod"),Vd=Symbol("_vsh"),Kd=Symbol(""),Wd=/(?:^|;)\s*display\s*:/;function Yd(e,t,n){const s=e.style,o=Be(n);let r=!1;if(n&&!o){if(t)if(Be(t))for(const a of t.split(";")){const l=a.slice(0,a.indexOf(":")).trim();n[l]==null&&ns(s,l,"")}else for(const a in t)n[a]==null&&ns(s,a,"");for(const a in n)a==="display"&&(r=!0),ns(s,a,n[a])}else if(o){if(t!==n){const a=s[Kd];a&&(n+=";"+a),s.cssText=n,r=Wd.test(n)}}else t&&e.removeAttribute("style");ua in e&&(e[ua]=r?s.display:"",e[Vd]&&(s.display="none"))}const da=/\s*!important$/;function ns(e,t,n){if(he(n))n.forEach(s=>ns(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Gd(e,t);da.test(n)?e.setProperty(wt(s),n.replace(da,""),"important"):e[s]=n}}const fa=["Webkit","Moz","ms"],ui={};function Gd(e,t){const n=ui[t];if(n)return n;let s=rt(t);if(s!=="filter"&&s in e)return ui[t]=s;s=No(s);for(let o=0;o<fa.length;o++){const r=fa[o]+s;if(r in e)return ui[t]=r}return t}const ma="http://www.w3.org/1999/xlink";function pa(e,t,n,s,o,r=ru(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ma,t.slice(6,t.length)):e.setAttributeNS(ma,t,n):n==null||r&&!tr(n)?e.removeAttribute(t):e.setAttribute(t,r?"":zt(n)?String(n):n)}function ha(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?la(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const l=r==="OPTION"?e.getAttribute("value")||"":e.value,c=n==null?e.type==="checkbox"?"on":"":String(n);(l!==c||!("_value"in e))&&(e.value=c),n==null&&e.removeAttribute(t),e._value=n;return}let a=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=tr(n):n==null&&l==="string"?(n="",a=!0):l==="number"&&(n=0,a=!0)}try{e[t]=n}catch{}a&&e.removeAttribute(o||t)}function an(e,t,n,s){e.addEventListener(t,n,s)}function Zd(e,t,n,s){e.removeEventListener(t,n,s)}const ba=Symbol("_vei");function Jd(e,t,n,s,o=null){const r=e[ba]||(e[ba]={}),a=r[t];if(s&&a)a.value=s;else{const[l,c]=Xd(t);if(s){const p=r[t]=tf(s,o);an(e,l,p,c)}else a&&(Zd(e,l,a,c),r[t]=void 0)}}const ga=/(?:Once|Passive|Capture)$/;function Xd(e){let t;if(ga.test(e)){t={};let s;for(;s=e.match(ga);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):wt(e.slice(2)),t]}let di=0;const Qd=Promise.resolve(),ef=()=>di||(Qd.then(()=>di=0),di=Date.now());function tf(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;on(nf(s,n.value),t,5,[s])};return n.value=e,n.attached=ef(),n}function nf(e,t){if(he(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>o=>!o._stopped&&s&&s(o))}else return t}const va=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,of=(e,t,n,s,o,r)=>{const a=o==="svg";t==="class"?Hd(e,s,a):t==="style"?Yd(e,n,s):Mo(t)?Os(t)||Jd(e,t,n,s,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):sf(e,t,s,a))?(ha(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&pa(e,t,s,a,r,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Be(s))?ha(e,rt(t),s,r,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),pa(e,t,s,a))};function sf(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&va(t)&&Te(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return va(t)&&Be(n)?!1:t in e}const ya={};function rf(e,t,n){let s=$e(e,t);Po(s)&&(s=ut({},s,t));class o extends fi{constructor(a){super(s,a,n)}}return o.def=s,o}const af=typeof HTMLElement<"u"?HTMLElement:class{};class fi extends af{constructor(t,n={},s=Ca){super(),this._def=t,this._props=n,this._createApp=s,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&s!==Ca?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(ut({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.parentNode||t.host);)if(t instanceof fi){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,ze(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:r,styles:a}=s;let l;if(r&&!he(r))for(const c in r){const p=r[c];(p===Number||p&&p.type===Number)&&(c in this._props&&(this._props[c]=Qi(this._props[c])),(l||(l=Object.create(null)))[rt(c)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(a),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)Ce(this,s)||Object.defineProperty(this,s,{get:()=>i(n[s])})}_resolveProps(t){const{props:n}=t,s=he(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&s.includes(o)&&this._setProp(o,this[o]);for(const o of s.map(rt))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(r){this._setProp(o,r,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let s=n?this.getAttribute(t):ya;const o=rt(t);n&&this._numberProps&&this._numberProps[o]&&(s=Qi(s)),this._setProp(o,s,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,s=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===ya?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),s)){const r=this._ob;r&&(this._processMutations(r.takeRecords()),r.disconnect()),n===!0?this.setAttribute(wt(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(wt(t),n+""):n||this.removeAttribute(wt(t)),r&&r.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),pf(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=Ee(this._def,ut(t,this._props));return this._instance||(n.ce=s=>{this._instance=s,s.ce=this,s.isCE=!0;const o=(r,a)=>{this.dispatchEvent(new CustomEvent(r,Po(a[0])?ut({detail:a},a[0]):{detail:a}))};s.emit=(r,...a)=>{o(r,a),wt(r)!==r&&o(wt(r),a)},this._setParent()}),n}_applyStyles(t,n){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const s=this._nonce;for(let o=t.length-1;o>=0;o--){const r=document.createElement("style");s&&r.setAttribute("nonce",s),r.textContent=t[o],this.shadowRoot.prepend(r)}}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const s=n.nodeType===1&&n.getAttribute("slot")||"default";(t[s]||(t[s]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let s=0;s<t.length;s++){const o=t[s],r=o.getAttribute("name")||"default",a=this._slots[r],l=o.parentNode;if(a)for(const c of a){if(n&&c.nodeType===1){const p=n+"-s",h=document.createTreeWalker(c,1);c.setAttribute(p,"");let b;for(;b=h.nextNode();)b.setAttribute(p,"")}l.insertBefore(c,o)}else for(;o.firstChild;)l.insertBefore(o.firstChild,o);l.removeChild(o)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const s of t){const o=s.querySelectorAll("slot");for(let r=0;r<o.length;r++)n.add(o[r])}return Array.from(n)}_injectChildStyle(t){this._applyStyles(t.styles,t)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_removeChildStyle(t){}}function Vn(e){const t=ea(),n=t&&t.ce;return n||null}const fn=e=>{const t=e.props["onUpdate:modelValue"]||!1;return he(t)?n=>jo(t,n):t};function lf(e){e.target.composing=!0}function _a(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ot=Symbol("_assign");function ka(e,t,n){return t&&(e=e.trim()),n&&(e=zo(e)),e}const Xe={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[Ot]=fn(o);const r=s||o.props&&o.props.type==="number";an(e,t?"change":"input",a=>{a.target.composing||e[Ot](ka(e.value,n,r))}),(n||r)&&an(e,"change",()=>{e.value=ka(e.value,n,r)}),t||(an(e,"compositionstart",lf),an(e,"compositionend",_a),an(e,"change",_a))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:r}},a){if(e[Ot]=fn(a),e.composing)return;const l=(r||e.type==="number")&&!/^0\d/.test(e.value)?zo(e.value):e.value,c=t??"";l!==c&&(document.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===c)||(e.value=c))}},os={deep:!0,created(e,t,n){e[Ot]=fn(n),an(e,"change",()=>{const s=e._modelValue,o=Kn(e),r=e.checked,a=e[Ot];if(he(s)){const l=Ps(s,o),c=l!==-1;if(r&&!c)a(s.concat(o));else if(!r&&c){const p=[...s];p.splice(l,1),a(p)}}else if(jn(s)){const l=new Set(s);r?l.add(o):l.delete(o),a(l)}else a(xa(e,r))})},mounted:wa,beforeUpdate(e,t,n){e[Ot]=fn(n),wa(e,t,n)}};function wa(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(he(t))o=Ps(t,s.props.value)>-1;else if(jn(t))o=t.has(s.props.value);else{if(t===n)return;o=vn(t,xa(e,!0))}e.checked!==o&&(e.checked=o)}const xn={created(e,{value:t},n){e.checked=vn(t,n.props.value),e[Ot]=fn(n),an(e,"change",()=>{e[Ot](Kn(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[Ot]=fn(s),t!==n&&(e.checked=vn(t,s.props.value))}},Yt={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=jn(t);an(e,"change",()=>{const r=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>n?zo(Kn(a)):Kn(a));e[Ot](e.multiple?o?new Set(r):r:r[0]),e._assigning=!0,ze(()=>{e._assigning=!1})}),e[Ot]=fn(s)},mounted(e,{value:t}){$a(e,t)},beforeUpdate(e,t,n){e[Ot]=fn(n)},updated(e,{value:t}){e._assigning||$a(e,t)}};function $a(e,t){const n=e.multiple,s=he(t);if(!(n&&!s&&!jn(t))){for(let o=0,r=e.options.length;o<r;o++){const a=e.options[o],l=Kn(a);if(n)if(s){const c=typeof l;c==="string"||c==="number"?a.selected=t.some(p=>String(p)===String(l)):a.selected=Ps(t,l)>-1}else a.selected=t.has(l);else if(vn(Kn(a),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Kn(e){return"_value"in e?e._value:e.value}function xa(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const cf=["ctrl","shift","alt","meta"],uf={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>cf.some(n=>e[`${n}Key`]&&!t.includes(n))},mt=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...r)=>{for(let a=0;a<t.length;a++){const l=uf[t[a]];if(l&&l(o,t))return}return e(o,...r)}))},df={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},ff=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const r=wt(o.key);if(t.some(a=>a===r||df[a]===r))return e(o)}))},mf=ut({patchProp:of},qd);let Ia;function Ta(){return Ia||(Ia=_d(mf))}const pf=((...e)=>{Ta().render(...e)}),Ca=((...e)=>{const t=Ta().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=bf(s);if(!o)return;const r=t._component;!Te(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const a=n(o,!1,hf(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),a},t});function hf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function bf(e){return Be(e)?document.querySelector(e):e}const gf=["method","origin","unavailable","invalid","signIn","onboarding","age","name","handle","restricted","suspended","terminated","links","fast","blocked","confirm","removed","quota","captcha","notFound","surfaceOff","notMoved","ledger","readOnly","braked","mentionLimit","pushRefused","realtimeOff","membersOnly","topicLocked","topicCreationClosed","followLimit","submit"];new Set(gf);const Sa=Object.freeze({SURFACE_OFF:"surfaceOff",CUTOVER_NOT_MOVED:"notMoved",NOT_FOUND:"notFound",ONBOARDING_REQUIRED:"onboarding",AGE_BELOW_MINIMUM:"age",NAME_RESERVED:"name",NAME_BLOCKED:"name",HANDLE_TAKEN:"handle",HANDLE_RATE:"handle",POSTING_RESTRICTED:"restricted",ACCOUNT_SUSPENDED:"suspended",ACCOUNT_TERMINATED:"terminated",TOO_MANY_LINKS:"links",TOO_FAST:"fast",FILTER_BLOCKED:"blocked",CONFIRMATION_REQUIRED:"confirm",MESSAGE_REMOVED:"removed",REACTION_NOT_ALLOWED:"invalid",CAPTCHA_FAILED:"captcha",UNAUTHORIZED:"signIn",VALIDATION:"invalid",UNAVAILABLE:"unavailable",STALE_LEASE:"submit",STAFF_POSTING_OFF:"submit",PRESET_CONFLICT:"submit",INTERNAL:"unavailable",MODULE_DARK:"unavailable",MODULE_READ_ONLY:"readOnly",BRAKED:"braked",BRAKE_PLATFORM:"submit",MODULE_CONDITIONS:"submit",TRUST_LEVEL_INVALID:"invalid",MENTION_LIMIT:"mentionLimit",DIGEST_UNSUBSCRIBE_INVALID:"invalid",PUSH_ENDPOINT_REFUSED:"pushRefused",PUSH_LIMIT:"quota",REALTIME_OFF:"realtimeOff",BUSY:"submit",BRAKE_KIND_MISMATCH:"submit",MEMBERS_ONLY:"membersOnly",TOPIC_LOCKED:"topicLocked",TOPIC_CREATION_CLOSED:"topicCreationClosed",FOLLOW_LIMIT:"followLimit",BRAND_RESTRICTED:"submit",CATEGORY_NOT_EMPTY:"submit",SLUG_TAKEN:"submit",MODERATOR_NOT_ELIGIBLE:"submit",STALE_REVISION:"submit",CASE_UNDECIDED:"submit",NOT_A_MEMBER_SESSION:"signIn",IDENTITY_NOT_ADMITTED:"signIn",ACCOUNT_NOT_ELIGIBLE:"signIn",MEMBER_READ_ONLY:"restricted",MEMBER_DELETION_REQUESTED:"restricted",PRIVATE_SPACE:"submit",WRONG_PROVIDER:"submit",CASE_CLOSED:"submit",NOTIFIER_NOT_ALLOWED:"invalid",UNSUPPORTED_RESTRICTION:"submit",LADDER_EXCEEDED:"submit",PERSON_REQUIRED:"submit",APPEAL_OPEN:"submit",APPEAL_WINDOW_CLOSED:"submit",APPEAL_NEEDS_ANOTHER_PERSON:"submit",GAG_PLATFORM_ONLY:"submit",ORDER_FINAL:"submit",BODY_JSON_INVALID:"invalid",AUDIT_DETAIL_NOT_CODE:"submit",LEDGER_UNAVAILABLE:"ledger",INVALID_INPUT:"invalid",LEGAL_HOLD:"submit",TEXT_MISSING:"unavailable",AGE16_NOT_ALLOWED:"submit",QUOTA_DAILY:"quota",QUOTA_IP_HOURLY:"quota"}),Aa=Object.freeze({METHOD:"method",ORIGIN:"origin",TOO_LARGE:"invalid",INVALID_JSON:"invalid"}),Oa=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function vf(e){return typeof e!="string"||e===""?"submit":Oa(Sa,e)?Sa[e]:Oa(Aa,e)?Aa[e]:"submit"}const Ea=Symbol.for("@blogmcp/sdk/CommunityTransportError");function yf(e){return typeof e=="number"&&Number.isInteger(e)&&e>=100&&e<=599?e:null}function _f(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.ceil(e):null}class Ma extends Error{status;retryAfterS;constructor(t,n={}){super(t),this.name="CommunityTransportError",this.status=yf(n.status),this.retryAfterS=_f(n.retryAfterS),Object.defineProperty(this,Ea,{value:!0})}}function kf(e){return e instanceof Ma?!0:e instanceof Error&&e[Ea]===!0}function wf(e){return kf(e)&&e.retryAfterS!==null?{ok:!1,code:"unavailable",retryAfterS:e.retryAfterS}:{ok:!1,code:"unavailable"}}function $f(e){return e==="unavailable"||e==="submit"||e==="method"||e==="origin"||e==="invalid"||e==="ledger"}const ie=(e,t,n)=>Object.freeze({name:e,method:"POST",path:n,surface:t}),xf=Object.freeze({"discussions.list":ie("discussions.list","public","/community/v1/public/discussions/list"),"discussions.head":ie("discussions.head","public","/community/v1/public/discussions/head"),"messages.post":ie("messages.post","public","/community/v1/public/messages/post"),"messages.edit":ie("messages.edit","public","/community/v1/public/messages/edit"),"messages.delete":ie("messages.delete","public","/community/v1/public/messages/delete"),"messages.report":ie("messages.report","public","/community/v1/public/messages/report"),"reactions.set":ie("reactions.set","public","/community/v1/public/reactions/set"),"blocks.set":ie("blocks.set","public","/community/v1/public/blocks/set"),"blocks.list":ie("blocks.list","public","/community/v1/public/blocks/list"),"profile.get":ie("profile.get","public","/community/v1/public/profile/get"),"me.get":ie("me.get","public","/community/v1/public/me/get"),"me.onboard":ie("me.onboard","public","/community/v1/public/me/onboard"),"me.updateProfile":ie("me.updateProfile","public","/community/v1/public/me/profile/update"),"me.notifications.list":ie("me.notifications.list","public","/community/v1/public/me/notifications/list"),"me.notifications.markRead":ie("me.notifications.markRead","public","/community/v1/public/me/notifications/mark-read"),"me.notifications.unreadCount":ie("me.notifications.unreadCount","public","/community/v1/public/me/notifications/unread-count"),"me.settings.get":ie("me.settings.get","public","/community/v1/public/me/settings/get"),"me.settings.update":ie("me.settings.update","public","/community/v1/public/me/settings/update"),"me.settings.unsubscribeDigest":ie("me.settings.unsubscribeDigest","public","/community/v1/public/me/settings/unsubscribe-digest"),"me.mutes.set":ie("me.mutes.set","public","/community/v1/public/me/mutes/set"),"me.mutes.list":ie("me.mutes.list","public","/community/v1/public/me/mutes/list"),"me.push.vapid":ie("me.push.vapid","public","/community/v1/public/me/push/vapid"),"me.push.subscribe":ie("me.push.subscribe","public","/community/v1/public/me/push/subscribe"),"me.push.unsubscribe":ie("me.push.unsubscribe","public","/community/v1/public/me/push/unsubscribe"),"me.push.status":ie("me.push.status","public","/community/v1/public/me/push/status"),"me.realtime.token":ie("me.realtime.token","public","/community/v1/public/me/realtime/token"),"realtime.subscribeToken":ie("realtime.subscribeToken","public","/community/v1/public/realtime/subscribe-token"),"me.decisions.list":ie("me.decisions.list","public","/community/v1/public/me/decisions/list"),"me.decisions.get":ie("me.decisions.get","public","/community/v1/public/me/decisions/get"),"me.appeals.file":ie("me.appeals.file","public","/community/v1/public/me/appeals/file"),"me.appeals.withdraw":ie("me.appeals.withdraw","public","/community/v1/public/me/appeals/withdraw"),"me.appeals.list":ie("me.appeals.list","public","/community/v1/public/me/appeals/list"),"me.reports.list":ie("me.reports.list","public","/community/v1/public/me/reports/list"),"me.consents.withdraw":ie("me.consents.withdraw","public","/community/v1/public/me/consents/withdraw"),"me.export":ie("me.export","public","/community/v1/public/me/export"),"me.erase":ie("me.erase","public","/community/v1/public/me/erase"),"me.cancelErase":ie("me.cancelErase","public","/community/v1/public/me/erase/cancel"),"legal.current":ie("legal.current","public","/community/v1/public/legal/current"),"forum.categories.list":ie("forum.categories.list","public","/community/v1/public/forum/categories/list"),"forum.topics.list":ie("forum.topics.list","public","/community/v1/public/forum/topics/list"),"forum.topics.get":ie("forum.topics.get","public","/community/v1/public/forum/topics/get"),"forum.topics.head":ie("forum.topics.head","public","/community/v1/public/forum/topics/head"),"forum.topics.create":ie("forum.topics.create","public","/community/v1/public/forum/topics/create"),"forum.search":ie("forum.search","public","/community/v1/public/forum/search"),"me.follows.set":ie("me.follows.set","public","/community/v1/public/me/follows/set"),"me.follows.list":ie("me.follows.list","public","/community/v1/public/me/follows/list"),"moderation.queue":ie("moderation.queue","public","/community/v1/public/moderation/queue"),"moderation.getCase":ie("moderation.getCase","public","/community/v1/public/moderation/cases/get"),"moderation.decide":ie("moderation.decide","public","/community/v1/public/moderation/decide"),"moderation.remove":ie("moderation.remove","public","/community/v1/public/moderation/remove"),"moderation.escalate":ie("moderation.escalate","public","/community/v1/public/moderation/escalate"),"moderation.setTopicState":ie("moderation.setTopicState","public","/community/v1/public/moderation/topics/set-state"),"moderation.moveTopic":ie("moderation.moveTopic","public","/community/v1/public/moderation/topics/move"),"moderation.pinTopic":ie("moderation.pinTopic","public","/community/v1/public/moderation/topics/pin"),"moderation.reviewPremod":ie("moderation.reviewPremod","public","/community/v1/public/moderation/premod/review"),"notices.submit":ie("notices.submit","notice","/trust/v1/notices/submit"),"notices.status":ie("notices.status","notice","/trust/v1/notices/status"),"notices.appeal":ie("notices.appeal","notice","/trust/v1/notices/appeal"),"notices.withdrawAppeal":ie("notices.withdrawAppeal","notice","/trust/v1/notices/appeal/withdraw")}),Pa="/community";function If(e){return e.surface==="public"&&e.path.startsWith(`${Pa}/`)?e.path.slice(Pa.length):e.path}const In=4e3,Tf=2,ss=1e3,Tn=4e3,mi=4e3,Ra=120,Cf=2,Na=80,yo=/^[a-z0-9][a-z0-9_]{2,29}$/,ja=30,Sf=50,is=200,za=30,Af=50,pi=2,rs=200,La=5,Of=500,Ef=/^[a-z0-9][a-z0-9-]{0,62}$/,Mf="community_notice",Pf="good_faith";function as(){const e=globalThis.crypto;if(typeof e?.randomUUID=="function")return e.randomUUID();const t=e.getRandomValues(new Uint8Array(16));t[6]=(t[6]??0)&15|64,t[8]=(t[8]??0)&63|128;const n=Array.from(t,s=>s.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}const mn=(e,t)=>typeof t=="string"&&e.includes(t),Rf=Object.freeze(["visible","held","removed","deleted"]),Nf=e=>mn(Rf,e),jf=Object.freeze(["member","staff","system"]),Da=e=>mn(jf,e),zf=Object.freeze(["sign_in","onboarding","reconsent_rules","art9_consent"]),Wn=e=>mn(zf,e),Lf=Object.freeze(["restriction","suspension","ban"]),Df=e=>mn(Lf,e),Fa=Object.freeze(["decision","appeal_resolved","erasure_scheduled","inactivity_warning","module_read_only","module_braked","reply","mention","module_push_reset","age_limit_changed","topic_update","category_topic"]),Ua=e=>mn(Fa,e),Ff=Object.freeze(["new","member","regular","trusted"]),hi=Object.freeze(["fraud_spam","harassment","hate","threats","sexual_content","child_at_risk","self_harm","doxxing","copyright","terrorism","drugs","other_illegal","rules","adverse_event","third_party_health_data","suspected_minor"]),Uf="child_at_risk",ls=Object.freeze(hi.filter(e=>e!=="rules"&&e!=="adverse_event"&&e!=="third_party_health_data"&&e!=="suspected_minor")),qf=Object.freeze(["recorded","reported_to_authority","not_adverse"]),Bf=Object.freeze(["16_17","18_plus"]);function Hf(e){return typeof e=="object"&&e!==null&&Da(e.kind)}const Vf=Object.freeze(["dark","live","read_only","braked"]),Yn=e=>mn(Vf,e),Kf=e=>e==="split"?"split":"joint",qa=e=>e==="public_write"?"public_write":"read_only";function Gn(e){const t=typeof e=="object"&&e!==null?e.rules:void 0;if(!Array.isArray(t))return[];const n=[];for(const s of t){if(typeof s!="object"||s===null)continue;const{id:o,title:r,summary:a,anchor:l}=s;typeof o!="string"||typeof r!="string"||typeof l!="string"||n.push(Object.freeze({id:o,title:r,summary:typeof a=="string"?a:null,anchor:l}))}return n}const Wf=2;function Yf(e){const t=typeof e=="object"&&e!==null?e.controllers:void 0;if(!Array.isArray(t))return[];const n=[];for(const s of t){if(n.length>=Wf)break;if(typeof s!="object"||s===null)continue;const{entity:o,label:r}=s;typeof o!="string"||typeof r!="string"||o.trim()===""||r.trim()===""||n.push(Object.freeze({entity:o,label:r.trim()}))}return n}const Gf=Object.freeze(["open","locked","archived"]),Zf=e=>mn(Gf,e),Jf=Object.freeze(["forum","article_discussions"]),Xf=e=>mn(Jf,e),Qf=Object.freeze(["no_action","visibility_restricted","removal"]),em=/^(?:\/[A-Za-z0-9_~-][A-Za-z0-9._~-]*)*\/?$/;function Ba(e){return typeof e=="string"&&e.startsWith("/")&&em.test(e)&&!/(^|\/)\.\.?(\/|$)/.test(e)}function Ha(e){if(!Ba(e))throw new TypeError('[blogmcp-sdk] the community client takes a relative base on the page’s own origin (e.g. "/api/community"), never an absolute URL: kb-api’s community routes are reached only through the host’s proxy or BFF');return e.replace(/\/+$/,"")}function tm(e,t){return`${e.replace(/\/+$/,"")}${If(t)}`}function nm(e,t){if(e===null||e.trim()==="")return;const n=e.trim();if(/^\d+$/.test(n))return Number(n);const s=Date.parse(n);return Number.isFinite(s)?Math.max(0,Math.ceil((s-t)/1e3)):void 0}function om(e,t={}){const n=Ha(e),s=t.now??Date.now,o=t.fetch??(()=>globalThis.fetch);return async(r,a,l)=>{let c;try{c=await o()(tm(n,r),{method:r.method,headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a??{}),mode:"same-origin",credentials:"same-origin",cache:"no-store",redirect:"error",signal:l})}catch{throw new Ma(l.aborted?"community request aborted or timed out":"community request failed")}let p=null;try{const b=await c.text();p=b===""?null:JSON.parse(b)}catch{p=null}const h=nm(c.headers.get("Retry-After"),s());return h===void 0?{status:c.status,body:p}:{status:c.status,body:p,retryAfterS:h}}}const Va=1e4,sm=2147483647;let Ka=!1;function im(e){if(e===void 0)return Va;const t=typeof e=="number"?Math.floor(e):Number.NaN;return t>=1&&t<=sm?t:(Ka||(Ka=!0,console.warn("[community] timeoutMs is not a number of milliseconds from 1 to 2147483647 — the default 10 s is used.")),Va)}const ot=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Cn=e=>typeof e=="string",pn=Array.isArray,rm=Object.freeze({string:Cn,number:e=>typeof e=="number",boolean:e=>typeof e=="boolean",array:pn,record:ot}),se=e=>Object.freeze({...e}),am=Object.freeze({"discussions.list":se({articleId:"string",messages:"array",viewer:"record"}),"discussions.head":se({heads:"array"}),"messages.post":se({message:"record",warnings:"array"}),"messages.edit":se({message:"record",warnings:"array"}),"messages.delete":se({message:"record"}),"messages.report":se({caseId:"string"}),"reactions.set":se({reactions:"record"}),"blocks.set":se({blocked:"boolean"}),"blocks.list":se({blocks:"array"}),"profile.get":se({author:"record"}),"me.get":se({needs:"array"}),"me.onboard":se({needs:"array"}),"me.updateProfile":se({profile:"record"}),"me.notifications.list":se({items:"array"}),"me.notifications.markRead":se({updated:"number"}),"me.notifications.unreadCount":se({count:"number"}),"me.settings.get":se({settings:"record"}),"me.settings.update":se({settings:"record"}),"me.settings.unsubscribeDigest":se({unsubscribed:"boolean"}),"me.mutes.set":se({muted:"boolean"}),"me.mutes.list":se({items:"array"}),"me.push.vapid":se({publicKey:"string",keyId:"string"}),"me.push.subscribe":se({subscribed:"boolean",keyId:"string"}),"me.push.unsubscribe":se({unsubscribed:"boolean"}),"me.push.status":se({subscribed:"boolean"}),"me.realtime.token":se({token:"string",url:"string",expiresInS:"number"}),"realtime.subscribeToken":se({token:"string"}),"me.decisions.list":se({items:"array"}),"me.decisions.get":se({decisionId:"string"}),"me.appeals.file":se({appealId:"string"}),"me.appeals.withdraw":se({appealId:"string"}),"me.appeals.list":se({items:"array"}),"me.reports.list":se({items:"array"}),"me.consents.withdraw":se({state:"string"}),"me.export":se({generatedAt:"string"}),"me.erase":se({purgeAfter:"string"}),"me.cancelErase":se({status:"string"}),"legal.current":se({textId:"string"}),"notices.submit":se({caseId:"string",receipt:"string"}),"notices.status":se({status:"string"}),"notices.appeal":se({appealId:"string"}),"notices.withdrawAppeal":se({appealId:"string"}),"forum.categories.list":se({categories:"array"}),"forum.topics.list":se({category:"record",items:"array"}),"forum.topics.get":se({topic:"record",messages:"array",viewer:"record"}),"forum.topics.head":se({heads:"array"}),"forum.topics.create":se({topic:"record",message:"record",warnings:"array"}),"forum.search":se({results:"array",page:"number",hasMore:"boolean"}),"me.follows.set":se({following:"boolean"}),"me.follows.list":se({follows:"array"}),"moderation.queue":se({items:"array"}),"moderation.getCase":se({case:"record"}),"moderation.decide":se({dryRun:"boolean",statement:"string"}),"moderation.remove":se({decision:"record",statement:"string"}),"moderation.escalate":se({}),"moderation.setTopicState":se({topic:"record"}),"moderation.moveTopic":se({topic:"record"}),"moderation.pinTopic":se({topic:"record"}),"moderation.reviewPremod":se({})}),lm=Object.freeze({"moderation.reviewPremod":Object.freeze([se({message:"record"}),se({decision:"record",statement:"string"})])}),Wa=(e,t)=>Object.entries(e).every(([n,s])=>rm[s](t[n])),cm=(e,t)=>{if(!Wa(am[e],t))return!1;const n=lm[e];return n===void 0||n.some(s=>Wa(s,t))};function pt(e,t){const n={};if(!ot(e))return n;for(const s of t)e[s]!==void 0&&(n[s]=e[s]);return n}function Ya(e){return ot(e)?"conversationId"in e?pt(e,["conversationId","seq"]):"memberId"in e?pt(e,["memberId"]):"handle"in e?pt(e,["handle"]):pt(e,["articleId"]):e}const Ga=/^[A-Za-z0-9_.:-]{1,64}$/,cs=20;function um(e){if(pn(e))return e.filter(t=>Cn(t)&&Ga.test(t)).slice(0,cs)}function dm(e){return pn(e)?e.filter(Wn).slice(0,cs):void 0}function fm(e){return pn(e)?e.map(n=>ot(n)?n.path:n).filter(n=>Cn(n)&&n.length<=128).slice(0,cs):void 0}function mm(e){if(!pn(e))return;const t=e.map(n=>ot(n)?n.code:void 0).filter(n=>Cn(n)&&Ga.test(n));return t.length>0?[...new Set(t)].slice(0,cs):void 0}const pm=/^[a-z][a-z0-9_]{0,63}$/;function hm(e){return Cn(e)&&pm.test(e)?e:void 0}function bm(e){return ot(e)?"conversationId"in e?pt(e,["conversationId"]):pt(e,["categoryId"]):e}function us(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.ceil(e):void 0}function gm(e,t){const n={ok:!1,code:vf(e.code)},s=us(e.retryAfterS)??us(t.retryAfterS);s!==void 0&&(n.retryAfterS=s);const o=dm(e.needs);o&&(n.needs=o);const r=um(e.codes);r&&(n.codes=r),Cn(e.until)&&(n.until=e.until);const a=hm(e.surface);a!==void 0&&(n.surface=a);const l=fm(e.issues);l&&(n.fields=l);const c=mm(e.issues);return c&&(n.issueCodes=c),n}function vm(e){Ha(e?.base);const t=e.transport??om(e.base,e.now?{now:e.now}:{}),n=im(e.timeoutMs),s=e.logger,o=(c,p,h,b)=>{if(!(!s||!$f(p)))try{s({op:c,outcome:p,kbCode:h,status:b})}catch{}};async function r(c,p,h){const b=xf[c],_=new AbortController,$=h?.signal,v=()=>_.abort();$?.aborted?_.abort():$?.addEventListener("abort",v,{once:!0});const I=setTimeout(()=>_.abort(),n);let j;try{j=await t(b,p,_.signal)}catch(k){const E=wf(k);return $?.aborted||o(c,E.code,null,null),E}finally{clearTimeout(I),$?.removeEventListener("abort",v)}const P=typeof j?.status=="number"?j.status:0,T=j?.body;if(ot(T)&&T.ok===!1&&Cn(T.code)&&T.code!==""){const k=gm(T,j);return o(c,k.code,T.code.slice(0,64),P),k}if(P>=200&&P<300&&ot(T)&&T.ok===!0){const{ok:k,...E}=T;return cm(c,E)?{ok:!0,value:E}:(o(c,"unavailable",null,P),{ok:!1,code:"unavailable"})}if(P===429){const k=us(j.retryAfterS);return k===void 0?{ok:!1,code:"fast"}:{ok:!1,code:"fast",retryAfterS:k}}o(c,"unavailable",null,P);const g=P===503?us(j.retryAfterS):void 0;return g===void 0?{ok:!1,code:"unavailable"}:{ok:!1,code:"unavailable",retryAfterS:g}}const a=(c,p)=>(h,b)=>r(c,pt(h,p),b),l=c=>p=>r(c,{},p);return{discussions:{list:a("discussions.list",["articleId","languageCode","cursor"]),head:(c,p)=>r("discussions.head",{articleIds:ot(c)&&pn(c.articleIds)?[...c.articleIds]:[]},p)},messages:{post:a("messages.post",["articleId","conversationId","body","replyToSeq","clientMsgId","languageCode","confirmations"]),edit:a("messages.edit",["conversationId","seq","body","title","confirmations"]),delete:a("messages.delete",["conversationId","seq"]),report:a("messages.report",["conversationId","seq","category","ruleId","note"])},reactions:{set:(c,p)=>r("reactions.set",{target:Ya(c?.target),emoji:c?.emoji??null},p)},blocks:{set:a("blocks.set",["memberId","blocked"]),list:l("blocks.list")},profile:{get:(c,p)=>r("profile.get",ot(c)&&"handle"in c?pt(c,["handle"]):pt(c,["memberId"]),p)},me:{get:l("me.get"),onboard:a("me.onboard",["ageBand","rulesTextId","art9TextId","art9Refused","displayName","handle","avatarPreset"]),updateProfile:a("me.updateProfile",["displayName","handle","avatarPreset","bio"]),notifications:{list:a("me.notifications.list",["cursor","unreadOnly","codes"]),markRead:(c,p)=>r("me.notifications.markRead",ot(c)&&"all"in c?{all:c.all}:{ids:ot(c)&&pn(c.ids)?[...c.ids]:[]},p),unreadCount:l("me.notifications.unreadCount")},settings:{get:l("me.settings.get"),update:a("me.settings.update",["notifyReply","notifyMention","notifyTopic","pushEnabled","digestEmail","quietHours"]),unsubscribeDigest:a("me.settings.unsubscribeDigest",["token"])},mutes:{set:a("me.mutes.set",["targetKind","targetId","muted"]),list:l("me.mutes.list")},push:{vapid:l("me.push.vapid"),subscribe:(c,p)=>r("me.push.subscribe",{...pt(c,["endpoint","userAgentClass"]),...ot(c)&&ot(c.keys)?{keys:pt(c.keys,["p256dh","auth"])}:{}},p),unsubscribe:a("me.push.unsubscribe",["endpoint"]),status:a("me.push.status",["endpoint"])},realtime:{token:l("me.realtime.token")},decisions:{list:a("me.decisions.list",["cursor"]),get:a("me.decisions.get",["decisionId"])},appeals:{file:a("me.appeals.file",["decisionId","body"]),withdraw:a("me.appeals.withdraw",["appealId"]),list:l("me.appeals.list")},reports:{list:l("me.reports.list")},consents:{withdraw:(c,p)=>r("me.consents.withdraw",{kind:"art9_consent"},p)},follows:{set:(c,p)=>{const h=pt(c,["target","following"]);return h.target!==void 0&&(h.target=bm(h.target)),r("me.follows.set",h,p)},list:a("me.follows.list",["cursor"])},export:l("me.export"),erase:l("me.erase"),cancelErase:l("me.cancelErase")},legal:{current:a("legal.current",["kind","locale"])},realtime:{subscribeToken:a("realtime.subscribeToken",["channel"])},forum:{categories:{list:l("forum.categories.list")},topics:{list:a("forum.topics.list",["categoryId","categorySlug","sort","cursor","limit"]),get:a("forum.topics.get",["conversationId","languageCode","cursor"]),head:(c,p)=>r("forum.topics.head",{conversationIds:ot(c)&&pn(c.conversationIds)?[...c.conversationIds]:[]},p),create:a("forum.topics.create",["categoryId","title","body","clientMsgId","languageCode","confirmations"])},search:a("forum.search",["query","categoryId","space","page"])},moderation:{queue:a("moderation.queue",["categoryId","cursor"]),getCase:a("moderation.getCase",["caseId"]),decide:a("moderation.decide",["caseId","restriction","basis","facts","contractualGround","locale","dryRun"]),remove:a("moderation.remove",["conversationId","seq","ruleId","facts","locale"]),escalate:a("moderation.escalate",["conversationId","seq","category"]),setTopicState:a("moderation.setTopicState",["conversationId","state"]),moveTopic:a("moderation.moveTopic",["conversationId","categoryId"]),pinTopic:a("moderation.pinTopic",["conversationId","pinned"]),reviewPremod:a("moderation.reviewPremod",["conversationId","seq","rev","outcome","ruleId","facts","locale"])},notices:{submit:(c,p)=>{const h=pt(c,["category","target","description","ruleId","turnstileToken","confirmations"]);return h.target!==void 0&&(h.target=Ya(h.target)),ot(c?.notifier)?h.notifier=pt(c.notifier,["name","email","locale"]):c?.notifier===null&&(h.notifier=null),r("notices.submit",h,p)},status:a("notices.status",["receipt"]),appeal:a("notices.appeal",["receipt","body"]),withdrawAppeal:a("notices.withdrawAppeal",["receipt"])}}}const ym=/FBAN|FBAV|Instagram/;function _m(e){const t=typeof e=="string"?e:typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:"";return ym.test(t)}const Ft=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ae=e=>typeof e=="string"?e:null,_o=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>0,ds=Object.freeze({counts:Object.freeze({}),mine:null});function ko(e){if(!Ft(e))return ds;const t={};if(Ft(e.counts))for(const[n,s]of Object.entries(e.counts))typeof s=="number"&&Number.isSafeInteger(s)&&s>0&&(t[n]=s);return Object.freeze({counts:Object.freeze(t),mine:Ae(e.mine)})}const Za=Object.freeze({kind:"member",memberId:null,handle:null,displayName:null,avatarPreset:null,deleted:!0}),km=Object.freeze({kind:"system"});function bi(e){if(!Ft(e)||!Da(e.kind))return null;if(e.kind==="system")return km;if(e.kind==="staff")return Object.freeze({kind:"staff",staffId:Ae(e.staffId)??"",displayName:Ae(e.displayName)??"",badge:Ae(e.badge)??""});const t=Ae(e.memberId),n=Ae(e.handle),s=Ae(e.displayName);return t===null||n===null||s===null||e.deleted===!0?Za:Object.freeze({kind:"member",memberId:t,handle:n,displayName:s,avatarPreset:Ae(e.avatarPreset),...e.moderator===!0?{moderator:!0}:{}})}function Ja(e){if(Array.isArray(e))return Object.freeze(e.filter(t=>typeof t=="string"))}function wo(e,t){if(!Ft(e))return null;const n=bi(e.author);if(n===null||!Nf(e.state))return null;const s=Ae(e.conversationId),o=Ae(e.id);if(s===null||o===null||!_o(e.seq))return null;const r=Ae(e.body),a=[];if(t&&Array.isArray(e.replies))for(const c of e.replies){const p=wo(c,!1);p&&a.push(p)}const l=Ja(e.notes);return Object.freeze({conversationId:s,seq:e.seq,id:o,rev:typeof e.rev=="number"?e.rev:0,replyToSeq:t?null:_o(e.replyToSeq)?e.replyToSeq:null,author:n,state:e.state,body:r,displayBody:Ae(e.displayBody)??r,displayLanguageCode:Ae(e.displayLanguageCode),sourceLanguageCode:Ae(e.sourceLanguageCode),isTranslated:e.isTranslated===!0,isEdited:e.isEdited===!0,createdAt:Ae(e.createdAt)??"",editedAt:Ae(e.editedAt),collapsed:e.collapsed===!0,reactions:ko(e.reactions),translationVersionId:Ae(e.translationVersionId),...l&&l.length>0?{notes:l}:{},...e.hiddenUntilConsent===!0&&e.state==="held"?{hiddenUntilConsent:!0}:{},...e.premoderated===!0&&e.state==="held"?{premoderated:!0}:{},replies:Sn(a),...t&&e.repliesTruncated===!0?{repliesTruncated:!0}:{}})}function wm(e){const t=Ft(e)?e:{},n=Array.isArray(t.needs)?t.needs.filter(Wn):[],s=[];if(Array.isArray(t.restrictions))for(const o of t.restrictions)!Ft(o)||!Df(o.kind)||typeof o.decisionId!="string"||s.push(Object.freeze({kind:o.kind,scope:Ae(o.scope)??"",endsAt:Ae(o.endsAt),decisionId:o.decisionId}));return Object.freeze({memberId:Ae(t.memberId),canPost:t.canPost===!0,needs:Object.freeze([...new Set(n)]),restrictions:Object.freeze(s)})}const $m=Object.freeze({memberId:null,canPost:!1,needs:Object.freeze([]),restrictions:Object.freeze([])}),gi=Object.freeze({articleId:null,conversationId:null,count:0,lastSeq:0,lastChangeAt:null,messages:Object.freeze([]),nextCursor:null,articleReactions:ds,reactionSet:Object.freeze([]),preset:null,viewer:$m,loaded:!1,stale:!1}),xm=(e,t)=>e===null?t:t===null?e:Date.parse(t)>Date.parse(e)?t:e;function Sn(e){const t=e.filter(s=>s.seq>0).sort((s,o)=>s.seq-o.seq),n=e.filter(s=>s.seq<0).sort((s,o)=>o.seq-s.seq);return Object.freeze([...t,...n])}function Gt(e,t){let n=!1;const s=[];for(const o of e){let r=t(o);if(r!==null&&r.replies.length>0){const a=Gt(r.replies,t);a!==r.replies&&(r=Object.freeze({...r,replies:a}))}r!==o&&(n=!0),r!==null&&s.push(r)}return n?Object.freeze(s):e}function hn(e,t){for(const n of e){if(t(n))return n;for(const s of n.replies)if(t(s))return s}return null}function vi(e,t){return Gt(e,n=>n.seq===t.seq?n.replyToSeq===null&&t.replyToSeq===null?Object.freeze({...t,replies:n.replies}):t:n)}function Xa(e,t){if(hn(e,s=>s.seq===t.seq))return vi(e,t);if(t.replyToSeq===null)return Sn([...e,t]);const n=e.find(s=>s.seq===t.replyToSeq);return n?Object.freeze(e.map(s=>s===n?Object.freeze({...s,replies:Sn([...s.replies,t])}):s)):e}const Qa=e=>e.replyToSeq===null&&e.replies.length>0,el=(e,t)=>e.toLowerCase()===t.toLowerCase(),tl=e=>e.author.kind==="member"&&e.author.memberId!==null?e.author.memberId.toLowerCase():null,Im=256,nl=new WeakMap;function ol(){let e=gi;const t=new Set,n=new Map,s=new Set;let o=0,r=-1;const a=new Set,l=()=>{o+=1,a.clear();for(const y of n.keys())s.delete(y),s.add(y);n.clear();for(const y of s){if(s.size<=Im)break;s.delete(y)}},c=y=>{if(y!==e){e=Object.freeze(y);for(const x of[...t])try{x(e)}catch{}}};function p(y,x={}){if(!Ft(y))return;const N=Ae(y.articleId)?.toLowerCase()??null,M=e.articleId!==null&&N!==null&&N!==e.articleId,O=M?gi:e;M&&l();const B=typeof x.cursor=="number"&&Number.isFinite(x.cursor)?x.cursor:null,ee=B??0,re=typeof y.nextCursor=="number"&&Number.isFinite(y.nextCursor)?y.nextCursor:null,be=re??Number.POSITIVE_INFINITY,we=new Map;for(const oe of Array.isArray(y.messages)?y.messages:[]){const Z=wo(oe,!0);Z&&Z.seq>ee&&Z.seq<=be&&we.set(Z.seq,Z)}for(const oe of we.values())for(const Z of[oe,...oe.replies]){const J=tl(Z);J===null||Z.body===null||(Z.collapsed?a.add(J):a.delete(J))}const K=new Map;for(const oe of O.messages){const Z=[oe,...oe.replies];for(const J of Z)J.pending&&J.pending!=="post"&&J.clientMsgId&&K.set(J.seq,J)}const D=oe=>{const Z=K.get(oe.seq);if(!Z)return oe;const J=Z.clientMsgId?n.get(Z.clientMsgId):void 0;return J&&(J.before=oe),Z.replyToSeq===null?Object.freeze({...Z,replies:oe.replies}):Z},U=O.messages.filter(oe=>oe.seq<0||oe.seq<=ee||oe.seq>be),De=new Map;for(const oe of O.messages)for(const Z of oe.replies)Z.seq<0&&Z.replyToSeq!==null&&De.set(Z.replyToSeq,[...De.get(Z.replyToSeq)??[],Z]);const Ne=[...U.filter(oe=>!we.has(oe.seq)),...we.values()].map(oe=>{if(!we.has(oe.seq))return oe;const Z=D(oe),J=Z.replies.map(D),W=De.get(oe.seq)??[];return J.some((pe,Bt)=>pe!==Z.replies[Bt])||W.length>0?Object.freeze({...Z,replies:Sn([...J,...W])}):Z}),Fe=O.loaded?O.nextCursor:0,Qe=Fe===null?null:ee>Fe?Fe:re===null?null:Math.max(Fe,re);c({articleId:N??O.articleId,conversationId:Ae(y.conversationId)??O.conversationId,count:typeof y.count=="number"&&y.count>=0?y.count:O.count,lastSeq:Math.max(typeof y.lastSeq=="number"?y.lastSeq:0,O.lastSeq),lastChangeAt:xm(O.lastChangeAt,Ae(y.lastChangeAt)),messages:Sn(Ne),nextCursor:Qe,articleReactions:ko(y.articleReactions),reactionSet:Object.freeze(Array.isArray(y.reactionSet)?y.reactionSet.filter(oe=>typeof oe=="string"):[]),preset:Ae(y.preset),viewer:wm(y.viewer),loaded:!0,stale:B===null?!1:O.stale})}function h(y){if(n.has(y.clientMsgId))return;const x=_o(y.replyToSeq)?y.replyToSeq:null;if(x!==null&&!e.messages.some(B=>B.seq===x))return;const N=bi(y.author)??Za,M=Object.freeze({conversationId:e.conversationId??"",seq:r--,id:`pending:${y.clientMsgId}`,rev:0,replyToSeq:x,author:N,state:"visible",body:y.body,displayBody:y.body,displayLanguageCode:y.languageCode??null,sourceLanguageCode:y.languageCode??null,isTranslated:!1,isEdited:!1,createdAt:y.createdAt??new Date().toISOString(),editedAt:null,collapsed:!1,reactions:ds,translationVersionId:null,replies:Object.freeze([]),pending:"post",clientMsgId:y.clientMsgId});n.set(y.clientMsgId,{type:"post",before:null});const O=x===null?Sn([...e.messages,M]):Object.freeze(e.messages.map(B=>B.seq===x?Object.freeze({...B,replies:Sn([...B.replies,M])}):B));c({...e,messages:O})}function b(y){if(n.has(y.clientMsgId))return;const x=hn(e.messages,M=>M.seq===y.seq);if(!x||x.pending)return;n.set(y.clientMsgId,{type:y.type,before:x});const N=y.type==="edit"?Object.freeze({...x,body:y.body,displayBody:y.body,displayLanguageCode:x.sourceLanguageCode,isTranslated:!1,isEdited:!0,pending:"edit",clientMsgId:y.clientMsgId}):Object.freeze({...x,pending:"delete",clientMsgId:y.clientMsgId});c({...e,messages:Gt(e.messages,M=>M===x?N:M)})}const _=y=>e.conversationId===null||el(y.conversationId,e.conversationId);function $(y){const x=n.get(y.clientMsgId);if(!x&&s.has(y.clientMsgId))return;n.delete(y.clientMsgId);const N=wo(y.message,y.message?.replyToSeq===null||y.message?.replyToSeq===void 0),M=N&&_(N)?N:null,O=Gt(e.messages,K=>K.clientMsgId===y.clientMsgId&&K.pending==="post"?null:K.clientMsgId===y.clientMsgId?sl(K):K);if(!M){O!==e.messages&&c({...e,messages:O});return}const B=y.warnings?Ja(y.warnings):void 0,ee=B&&B.length>0?Object.freeze({...M,warnings:B}):M,re=hn(O,K=>K.seq===ee.seq);let be,we=e.count;if(ee.state==="deleted"||x?.type==="delete"){const K=re??null,D=K?.state==="visible"&&K.body!==null;be=Gt(O,U=>U.seq!==ee.seq?U:Qa(U)?Object.freeze({...ee,replies:U.replies}):null),D&&(we=Math.max(0,we-1))}else be=Xa(O,ee),!re&&ee.state==="visible"&&(we+=1);c({...e,conversationId:e.conversationId??(x?ee.conversationId:null),lastSeq:Math.max(e.lastSeq,ee.seq),count:we,messages:be})}function v(y){const x=n.get(y);if(!x)return;n.delete(y);const N=Gt(e.messages,M=>{if(M.clientMsgId!==y)return M;if(x.type==="post")return null;const O=x.before;return O?M.replyToSeq===null?Object.freeze({...O,replies:M.replies}):O:sl(M)});N!==e.messages&&c({...e,messages:N})}function I(y){const x=wo(y,y?.replyToSeq===null||y?.replyToSeq===void 0);!x||!hn(e.messages,N=>N.seq===x.seq&&!N.pending&&el(N.conversationId,x.conversationId))||c({...e,messages:vi(e.messages,x)})}function j(y){if(Ft(y))switch(y.type){case"post":return h(y);case"edit":case"delete":return b(y);case"confirm":return $(y);case"rollback":return v(y.clientMsgId);case"server":return I(y.message)}}function P(y){if(!Ft(y)||!e.loaded||e.articleId===null||Ae(y.articleId)?.toLowerCase()!==e.articleId)return!1;if(e.stale)return!0;const x=typeof y.lastSeq=="number"&&y.lastSeq>e.lastSeq,N=typeof y.count=="number"&&y.count!==e.count,M=Ae(y.lastChangeAt),O=M!==null&&(e.lastChangeAt===null||Date.parse(M)>Date.parse(e.lastChangeAt));return!x&&!N&&!O?!1:(c({...e,stale:!0}),!0)}function T(y,x){if(!Ft(y))return;const N=ko(x);if("articleId"in y){if(Ae(y.articleId)?.toLowerCase()!==e.articleId)return;c({...e,articleReactions:N});return}const{conversationId:M,seq:O}=y;if(!_o(O)||typeof M!="string")return;const B=M.toLowerCase(),ee=Gt(e.messages,re=>re.seq===O&&re.conversationId.toLowerCase()===B?Object.freeze({...re,reactions:N}):re);ee!==e.messages&&c({...e,messages:ee})}function g(y,x){if(typeof y!="string"||y==="")return;const N=y.toLowerCase();x?a.add(N):a.delete(N);const M=Gt(e.messages,O=>O.author.kind==="member"&&O.author.memberId!==null&&O.author.memberId.toLowerCase()===N&&O.body!==null&&O.collapsed!==x?Object.freeze({...O,collapsed:x}):O);M!==e.messages&&c({...e,messages:M})}function k(y,x){const N=tl(y),M=y.body!==null&&N!==null&&a.has(N),O=x?x.reactions.mine:null,B=O===y.reactions.mine?y.reactions:Object.freeze({counts:y.reactions.counts,mine:O}),ee=x?.repliesTruncated===!0&&y.replyToSeq===null,re=x?.warnings;return M===y.collapsed&&B===y.reactions&&!ee&&!re?y:Object.freeze({...y,collapsed:M,reactions:B,...ee?{repliesTruncated:!0}:{},...re?{warnings:re}:{}})}function E(y){if(!Ft(y)||!e.loaded)return"dropped";const x=typeof y.rev=="number"&&Number.isSafeInteger(y.rev)&&y.rev>=0?y.rev:null;if(y.kind==="resync")return"resync";if(x===null)return"dropped";if(y.kind==="reaction"){if(y.seq===void 0){const Ne=ko(y.reactions);return c({...e,articleReactions:Object.freeze({counts:Ne.counts,mine:e.articleReactions.mine})}),"applied"}if(!_o(y.seq))return"dropped";const K=y.seq,D=hn(e.messages,Ne=>Ne.seq===K);if(!D||D.pending||x<D.rev)return"dropped";if(x>D.rev)return"resync";const U=ko(y.reactions),De=Object.freeze({counts:U.counts,mine:D.reactions.mine});return c({...e,messages:Gt(e.messages,Ne=>Ne===D?Object.freeze({...Ne,reactions:De}):Ne)}),"applied"}if(y.kind!=="message"&&y.kind!=="edit"&&y.kind!=="delete")return"dropped";const N=y.message,M=wo(N,N?.replyToSeq===null||N?.replyToSeq===void 0);if(!M||!_(M))return"dropped";const O=hn(e.messages,K=>K.seq===M.seq);if(O?.pending)return"dropped";const B=O?.rev??0;if(y.kind==="delete"){if(!O||x<=B)return"dropped";const K=O.state==="visible"&&O.body!==null,D=Gt(e.messages,U=>U.seq!==M.seq?U:Qa(U)?Object.freeze({...M,replies:U.replies}):null);return c({...e,messages:D,count:K?Math.max(0,e.count-1):e.count,lastSeq:Math.max(e.lastSeq,M.seq)}),"applied"}const ee=M.author.kind==="member"&&M.author.memberId!==null&&M.author.memberId===e.viewer.memberId;if(!O&&ee&&[...n.values()].some(K=>K.type==="post")||x<=B)return"dropped";if(x>B+1||!O&&M.replyToSeq!==null&&!e.messages.some(K=>K.seq===M.replyToSeq))return"resync";const re=k(M,O),be=O?vi(e.messages,re):Xa(e.messages,re),we=!O&&M.state==="visible"?e.count+1:e.count;return c({...e,messages:be,count:we,lastSeq:Math.max(e.lastSeq,M.seq)}),"applied"}const w={getState:()=>e,subscribe(y){return t.add(y),()=>{t.delete(y)}},applyPage:p,applyMessage:j,applyHead:P,applyReaction:T,collapse:g,applyEvent:E,reset(){l(),c(gi)}};return nl.set(w,()=>o),w}function sl(e){const{pending:t,clientMsgId:n,...s}=e;return Object.freeze(s)}function Zt(e){const t="viewer"in e?e.viewer.needs:e.needs,n=new Set(t.filter(Wn)),s=n.has("sign_in"),o=n.has("onboarding"),r=o||n.has("reconsent_rules"),a=n.has("art9_consent");return Object.freeze({signIn:s,onboarding:o,rules:r,art9:a,any:s||o||r||a})}function Zn(e,t){return hn(e.messages,n=>n.seq===t)}function Tm(e,t){return t.author.kind==="member"&&t.author.memberId!==null&&t.author.memberId===e.viewer.memberId}function Cm(e,t){if("articleId"in t)return e.articleReactions;const n=t.conversationId.toLowerCase();return hn(e.messages,o=>o.seq===t.seq&&o.conversationId.toLowerCase()===n)?.reactions??ds}function Sm(e,t){const n={...e.counts},s=e.mine;if(s!==null){const o=(n[s]??0)-1;o>0?n[s]=o:delete n[s]}return t!==null&&(n[t]=(n[t]??0)+1),Object.freeze({counts:Object.freeze(n),mine:t})}const Am=20;function yi(e){const t=nl.get(e);let n=t?.(),s=e.getState().articleId;return{moved:()=>t!==void 0&&t()!==n||e.getState().articleId!==s,mark(){n=t?.(),s=e.getState().articleId}}}const Om=e=>typeof e=="number"&&Number.isFinite(e)?e:null;async function Em(e,t,n,s){const o=e.getState(),r=o.loaded?o.nextCursor:0,a=yi(e);let l=null;for(let c=0;c<Am;c++){const p=await t.discussions.list({articleId:n.articleId,languageCode:n.languageCode??null,cursor:l},s);if(!p.ok)return p;if(a.moved())break;e.applyPage(p.value,{cursor:l}),a.mark();const h=Om(p.value.nextCursor);if(h===null||r!==null&&h>=r||l!==null&&h<=l)break;l=h}return{ok:!0,value:e.getState()}}async function Mm(e,t,n,s){const o=e.getState().nextCursor;if(o===null)return{ok:!0,value:e.getState()};const r=yi(e),a=await t.discussions.list({articleId:n.articleId,languageCode:n.languageCode??null,cursor:o},s);return a.ok?(r.moved()||e.applyPage(a.value,{cursor:o}),{ok:!0,value:e.getState()}):a}const Pm=2e4,Rm=5*6e4,Nm=6e4,jm=(e,t)=>e.lastSeq===t.lastSeq&&e.count===t.count&&e.lastChangeAt===t.lastChangeAt;function zm(e,t,n){return il({ask:(s,o)=>e.discussions.head({articleIds:s},o),keyOf:s=>typeof s?.articleId=="string"?s.articleId.toLowerCase():null,max:Sf,stopsOn:["surfaceOff"]},t,n)}function Lm(e,t,n){return il({ask:(s,o)=>e.forum.topics.head({conversationIds:s},o),keyOf:s=>typeof s?.conversationId=="string"?s.conversationId.toLowerCase():null,max:Af,stopsOn:["surfaceOff","membersOnly"]},t,n)}function il(e,t,n){const s=Math.max(1e3,n.intervalMs??Pm),o=[...new Set((Array.isArray(t)?t:[]).filter(g=>typeof g=="string"&&g!==""))].slice(0,e.max),r=n.visible??(()=>typeof document>"u"||document.visibilityState!=="hidden"),a=new Map;let l=null,c=null,p=0,h=!1,b=!1;const _=g=>{b||(l&&clearTimeout(l),l=setTimeout(()=>{I()},g))},$=g=>{_(g),h=!0},v=()=>{!b&&!c&&!h&&_(0)};async function I(){if(l=null,h=!1,b||c)return;if(!r()){_(s);return}const g=new AbortController;c=g;const k={signal:g.signal},E=await e.ask(o,k);if(c=null,!b){if(E.ok){p=0;const w=[];for(const y of Array.isArray(E.value.heads)?E.value.heads:[]){const x=e.keyOf(y);if(x===null)continue;const N=a.get(x);a.set(x,y),(!N||!jm(N,y))&&w.push(y)}if(w.length>0)try{n.onChange(w)}catch{}_(s);return}try{n.onFailure?.(E)}catch{}if(e.stopsOn.includes(E.code))return T();if(E.code==="fast"||E.code==="quota"){$(Math.max(s,E.retryAfterS!==void 0?E.retryAfterS*1e3:Nm));return}p=Math.min(Rm,(p||s)*2),$(p)}}const j=()=>{r()&&v()},P=()=>T();function T(){b||(b=!0,l&&clearTimeout(l),l=null,c?.abort(),c=null,typeof document<"u"&&document.removeEventListener("visibilitychange",j),n.signal?.removeEventListener("abort",P))}return o.length===0||n.signal?.aborted?(b=!0,{stop:()=>{},now:()=>{}}):(typeof document<"u"&&document.addEventListener("visibilitychange",j),n.signal?.addEventListener("abort",P,{once:!0}),_(s),{stop:T,now:v})}const It=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),An=e=>typeof e=="string"?e:null,Dm=Object.freeze({counts:Object.freeze({}),mine:null}),Fm=Object.freeze({kind:"member",memberId:null,handle:null,displayName:null,avatarPreset:null,deleted:!0});function Um(e){if(!It(e))return null;const t=An(e.id),n=An(e.slug),s=An(e.name);return t===null||n===null||s===null?null:Object.freeze({id:t,slug:n,name:s})}function rl(e){if(!It(e))return null;const t=An(e.conversationId);return t===null||t===""?null:Object.freeze({conversationId:t,category:Um(e.category),title:An(e.title),state:An(e.state)??"open",pinned:e.pinned===!0,createdAt:An(e.createdAt)??"",author:bi(e.author)??Fm,following:e.following===!0})}const qm=(e,t)=>e===t||e!==null&&t!==null&&e.id===t.id&&e.slug===t.slug&&e.name===t.name,Bm=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function al(e,t){return e===t?!0:e===null||t===null?!1:e.conversationId===t.conversationId&&e.title===t.title&&e.state===t.state&&e.pinned===t.pinned&&e.createdAt===t.createdAt&&e.following===t.following&&qm(e.category,t.category)&&Bm(e.author,t.author)}const fs=1,ll=new WeakMap;function Hm(){const e=ol();let t=null,n=!1,s=!1;const o=new Set;let r=null,a=null;const l=w=>{if(a&&a.from===w&&a.moderator===n)return a.viewer;const y=Object.freeze({...w,moderator:n});return a={from:w,moderator:n,viewer:y},y},c=()=>{const w=e.getState();if(r&&r.from===w&&r.header===t&&r.moderator===n&&r.openingDeleted===s)return r.state;const y=w.messages.find(N=>N.seq===fs),x=Object.freeze({conversationId:w.loaded?w.conversationId:null,topic:w.loaded?t:null,count:w.count,lastSeq:w.lastSeq,lastChangeAt:w.lastChangeAt,messages:w.messages,openingState:y?y.state:s&&w.loaded?"deleted":null,nextCursor:w.nextCursor,reactionSet:w.reactionSet,preset:w.preset,viewer:l(w.viewer),loaded:w.loaded,stale:w.stale});return r={from:w,header:t,moderator:n,openingDeleted:s,state:x},x};let p=c(),h=!1;const b=()=>{if(h)return;const w=c();if(w!==p){p=w;for(const y of[...o])try{y(w)}catch{}}};e.subscribe(b);const _=w=>{h=!0;try{return w()}finally{h=!1,b()}},$=()=>e.getState().articleId;function v(w,y={}){if(!It(w))return;const x=rl(w.topic);if(x===null)return;const N=x.conversationId.toLowerCase(),M={articleId:N,conversationId:x.conversationId,count:w.count,lastSeq:w.lastSeq,lastChangeAt:w.lastChangeAt,messages:w.messages,nextCursor:w.nextCursor,articleReactions:Dm,reactionSet:w.reactionSet,preset:w.preset,viewer:w.viewer};_(()=>{const O=$()!==N,B=Array.isArray(w.messages)&&w.messages.some(ee=>It(ee)&&ee.seq===fs);(O||B)&&(s=!1),al(t,x)||(t=x),n=It(w.viewer)&&w.viewer.moderator===!0,e.applyPage(M,y)})}function I(w){const y=rl(w),x=$();y===null||x===null||y.conversationId.toLowerCase()!==x||al(t,y)||(t=y,b())}function j(){s=!0,!(t===null||t.title===null)&&(t=Object.freeze({...t,title:null}))}function P(w){It(w)&&_(()=>{const y=e.getState();if(e.applyMessage(w),w.type!=="confirm"||e.getState()===y)return;const x=It(w.message)?w.message:null;x!==null&&x.seq===fs&&x.state==="deleted"&&j()})}function T(w){if(!It(w)||typeof w.conversationId!="string")return!1;const y={articleId:w.conversationId,count:w.count,lastSeq:w.lastSeq,lastChangeAt:w.lastChangeAt};return e.applyHead(y)}function g(w,y){!It(w)||typeof w.conversationId!="string"||e.applyReaction({conversationId:w.conversationId,seq:w.seq},y)}function k(w){if(!It(w)||w.kind==="reaction"&&w.seq===void 0)return"dropped";const y=_(()=>e.applyEvent(w)),x=It(w.message)?w.message:null,N=x!==null&&x.seq===fs&&(w.kind==="edit"||w.kind==="delete"||w.kind==="message");return y==="applied"&&N?"resync":y}const E={getState:c,subscribe(w){return o.add(w),()=>{o.delete(w)}},applyPage:v,applyTopic:I,applyMessage:P,applyHead:T,applyReaction:g,collapse:(w,y)=>e.collapse(w,y),applyEvent:k,reset(){_(()=>{t=null,n=!1,s=!1,e.reset()})}};return ll.set(E,e),E}function Vm(e){return e!=null&&Zf(e.state)&&e.state==="open"}const Km=Object.freeze({kind:"deleted"}),cl=Object.freeze({kind:"withheld"});function ul(e,t){return typeof e=="string"&&e.trim()!==""?Object.freeze({kind:"shown",text:e}):t==="deleted"?Km:cl}function ms(e){if(!It(e))return cl;if("messages"in e&&"topic"in e){const{topic:n,openingState:s}=e;return ul(It(n)?n.title:null,s)}const t=e;return ul(t.title,t.openingState)}const Wm=20;function dl(e){const t=ll.get(e);if(t)return yi(t);let n=e.getState().conversationId;return{moved:()=>e.getState().conversationId!==n,mark(){n=e.getState().conversationId}}}const Ym=e=>typeof e=="number"&&Number.isFinite(e)?e:null;async function fl(e,t,n,s){const o=e.getState(),r=o.loaded?o.nextCursor:0,a=dl(e);let l=null;for(let c=0;c<Wm;c++){const p=await t.forum.topics.get({conversationId:n.conversationId,languageCode:n.languageCode??null,cursor:l},s);if(!p.ok)return p;if(a.moved())break;e.applyPage(p.value,{cursor:l}),a.mark();const h=Ym(p.value.nextCursor);if(h===null||r!==null&&h>=r||l!==null&&h<=l)break;l=h}return{ok:!0,value:e.getState()}}async function Gm(e,t,n,s){const o=e.getState().nextCursor;if(o===null)return{ok:!0,value:e.getState()};const r=dl(e),a=await t.forum.topics.get({conversationId:n.conversationId,languageCode:n.languageCode??null,cursor:o},s);return a.ok?(r.moved()||e.applyPage(a.value,{cursor:o}),{ok:!0,value:e.getState()}):a}async function Zm(e,t,n,s,o){if(s.code!=="notFound")return s;const r=await fl(e,t,n,o);return r.ok?s:r}const Et=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),_i=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ml(e,t){if(typeof t!="string"||!_i.test(t))return null;const n=t.toLowerCase();return e==="conversation"?Object.freeze({conversationId:n}):e==="category"?Object.freeze({categoryId:n}):null}function Jm(e){if(!Et(e))return null;const{conversationId:t,categoryId:n}=e;return typeof t=="string"&&n===void 0&&_i.test(t)?Object.freeze({kind:"conversation",id:t.toLowerCase()}):typeof n=="string"&&t===void 0&&_i.test(n)?Object.freeze({kind:"category",id:n.toLowerCase()}):null}function $o(e){if(!Et(e))return null;if("targetKind"in e){const n=ml(e.targetKind,e.targetId);return n===null?null:$o(n)}const t=Jm(e);return t===null?null:`${t.kind}:${t.id}`}const pl=e=>e.replace(/\s+/gu," ").trim();function hl(e){if(typeof e!="string")return 0;const t=pl(e);return Math.max(t.length,[...t.normalize("NFC")].length)}function ki(e){if(typeof e!="string")return null;const t=pl(e),n=hl(t);return n>=1&&n<=is?t:null}function wi(e){if(typeof e!="string")return null;const t=e.replace(/\s+/gu," ").trim();return[...t].length>=pi&&t.length<=rs?t:null}function Xm(e){if(!Et(e)||e.hasMore!==!0)return null;const t=e.page;return typeof t!="number"||!Number.isSafeInteger(t)||t<1||t>=La?null:t+1}function Qm(e){return!Et(e)||typeof e.conversationId!="string"?!1:e.kind==="topic"?!0:e.kind==="article"&&typeof e.articleId=="string"}function $i(e){return Array.isArray(e)?e.filter(Qm):[]}const ep=Object.freeze({forum:"forum",article_discussions:"articleDiscussions"}),xi=e=>typeof e=="string"?e:"";function tp(e){if(!Et(e))return null;const t=Et(e.brake)&&typeof e.brake.until=="string"?e.brake:null;return Object.freeze({enabled:e.enabled===!0,brake:t===null?null:Object.freeze({kind:xi(t.kind),until:xi(t.until),reasonCode:xi(t.reasonCode)})})}function bl(e,t){return!Et(e)||!Et(e.surfaces)||!Xf(t)?null:tp(e.surfaces[ep[t]])}function np(e,t=Date.now()){if(!Et(e)||!Et(e.away))return null;const n=e.away.until;if(typeof n!="string")return null;const s=Date.parse(n);return Number.isFinite(s)&&s>t?Object.freeze({until:n}):null}function gl(e,t){if(!Et(e)||!Et(e.moderator)||typeof t!="string"||t==="")return!1;const n=e.moderator.categoryIds;if(!Array.isArray(n))return!1;const s=t.toLowerCase();return n.some(o=>typeof o=="string"&&o.toLowerCase()===s)}const Ke=Object.freeze({myCommunity:"/community",statement:"/community/statements/{id}",report:"/community/report",notices:"/community/notices",rules:"/community/rules",terms:"/community/terms",privacy:"/community/privacy",discussions:"/community/discussions",profile:"/community/u/{handle}",settings:"/community/settings",welcome:"/community/welcome",notifications:"/community/notifications",forum:"/community/forum",category:"/community/c/{slug}",topic:"/community/t/{id}",search:"/community/search"}),vl=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,yl=/^kbnt_[A-Za-z0-9_-]{1,507}$/,_l="t";function bn(e){return typeof e=="string"&&/^\/(?![/\\])/.test(e)&&!/[\s\\\u0000-\u001f\u007f]/.test(e)}function Jn(e,t){const n=e==null||e===""?Ke.statement:e;return!bn(n)||!n.includes("{id}")||/[{}]/.test(n.split("{id}").join(""))||typeof t!="string"||!vl.test(t)?null:n.split("{id}").join(t.toLowerCase())}function kl(e,t){const n=e==null||e===""?Ke.profile:e;if(!bn(n)||!n.includes("{handle}")||/[{}]/.test(n.split("{handle}").join("")))return null;const s=typeof t=="string"?t.replace(/^@/,"").toLowerCase():"";return yo.test(s)?n.split("{handle}").join(s):null}function On(e,t){const n=e==null||e===""?Ke.category:e;return!bn(n)||n.includes("#")||!n.includes("{slug}")||/[{}]/.test(n.split("{slug}").join(""))||typeof t!="string"||!Ef.test(t)?null:n.split("{slug}").join(t)}function xo(e,t){const n=e==null||e===""?Ke.topic:e;return!bn(n)||n.includes("#")||!n.includes("{id}")||/[{}]/.test(n.split("{id}").join(""))||typeof t!="string"||!vl.test(t)?null:n.split("{id}").join(t.toLowerCase())}function Ii(e,t,n){const s=xo(e,t),o=Io(n);return s===null||o===null?null:`${s}#${o}`}const wl="bcm-msg-",$l=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>0;function Io(e){return $l(e)?`${wl}${e}`:null}function xl(e){const t=new RegExp(`^#${wl}([1-9][0-9]{0,14})$`).exec(typeof e=="string"?e:""),n=t?Number(t[1]):NaN;return $l(n)?n:null}function Ti(e,t,n){const s=Il(e,t),o=Io(n);return s===null||o===null?null:`${s}#${o}`}function Il(e,t){const n=e;return!bn(n)||n.includes("#")||!n.includes("{slug}")||/[{}]/.test(n.split("{slug}").join(""))||typeof t!="string"||t===""||t.length>512||t==="."||t===".."||/[\u0000-\u001f\u007f]/.test(t)?null:n.split("{slug}").join(encodeURIComponent(t))}function op(e,t){const n=e==null||e===""?Ke.notices:e;return!bn(n)||n.includes("#")||typeof t!="string"||!yl.test(t)?null:`${n}#${_l}=${t}`}function En(e,t){return bn(e)?e.includes("#")||!bn(t)||t.includes("#")?e:`${e}#${t}`:null}function Tl(e){const n=/^#t=([^&]*)/.exec(typeof e=="string"?e:"")?.[1]??"";return yl.test(n)?n:null}const Ci=new WeakMap;function Si(){if(typeof window>"u")throw new Error("[blogmcp-sdk] readReceiptFromHash and readDigestTokenFromHash read the address bar — call them in the browser (onMounted / useEffect), never while rendering on the server");return window}function sp(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ip(e,t,n){let s=e;const o=t?s.indexOf(t):-1;if(o>=0&&(s=s.slice(0,o)),n!==null)for(let r=s.indexOf(n);r>=0;r=s.indexOf(n)){const a=s.lastIndexOf("#",r);s=a>=0?s.slice(0,a):s.slice(0,r)+s.slice(r+n.length)}return s}function Cl(e,t,n){if(!sp(e))return e;let s=!1;const o={...e};for(const[r,a]of Object.entries(o)){if(typeof a!="string")continue;const l=ip(a,t,n);l!==a&&(o[r]=l,s=!0)}return s?o:e}function rp(e=Si()){const t=e.location.hash,n=Tl(t),s=!Ci.has(e);return t.startsWith(`#${_l}=`)&&e.history.replaceState(Cl(e.history.state,t,n),"",e.location.pathname+e.location.search),(s||n!==null)&&Ci.set(e,n),Ci.get(e)??null}const ap=/^kbun_[A-Za-z0-9_-]{64}$/,lp="u";function Sl(e){const n=/^#u=([^&]*)/.exec(typeof e=="string"?e:"")?.[1]??"";return ap.test(n)?n:null}const ps=new WeakMap;function cp(e=Si()){const t=e.location.hash,n=Sl(t),s=!ps.has(e);return t.startsWith(`#${lp}=`)&&e.history.replaceState(Cl(e.history.state,t,n),"",e.location.pathname+e.location.search),(s||n!==null)&&ps.set(e,n),ps.get(e)??null}function up(e=Si()){ps.delete(e)}const dp=/(^|[^A-Za-z0-9_@./])@([A-Za-z0-9][A-Za-z0-9_]{2,29})(?![A-Za-z0-9_])/g;function Al(e){if(typeof e!="string"||e==="")return[];if(!e.includes("@"))return[{kind:"text",text:e}];const t=[];let n=0;for(const s of e.matchAll(new RegExp(dp.source,"g"))){const o=s[2],r=o.toLowerCase();if(!yo.test(r))continue;const a=(s.index??0)+s[1].length;a>n&&t.push({kind:"text",text:e.slice(n,a)}),t.push({kind:"mention",text:`@${o}`,handle:r}),n=a+1+o.length}return n<e.length&&t.push({kind:"text",text:e.slice(n)}),t}function Ol(e){const t=[];for(const n of Al(e))n.kind==="mention"&&!t.includes(n.handle)&&t.push(n.handle);return t}const fp={"error.method":"Tohle se takhle spustit nedá. Obnovte prosím stránku.","error.origin":"Požadavek nepřišel z této stránky. Obnovte ji prosím a zkuste to znovu.","error.unavailable":"Teď se to nepodařilo načíst ani uložit. Zkuste to prosím za chvíli.","error.invalid":"Něco ve formuláři nesedí. Zkontrolujte ho prosím a zkuste to znovu.","error.signIn":"K tomu je potřeba přihlásit se čtenářským účtem.","error.onboarding":"Než začnete psát, dokončete prosím vstup do diskuse.","error.age":"Diskuse je otevřená od vyššího věku, zapojit se do ní zatím nejde.","error.name":"Tohle jméno použít nejde. Zkuste prosím jiné.","error.handle":"Tohle uživatelské jméno je obsazené, nebo jste ho nedávno měnili. Zkuste prosím jiné, nebo později.","error.restricted":"Psaní do diskuse máte teď omezené.","error.suspended":"Váš účet v diskusi je teď pozastavený.","error.terminated":"Váš účet v diskusi je zrušený.","error.links":"V komentáři je víc odkazů, než se vejde. Některé prosím uberte.","error.fast":"Jde to moc rychle za sebou. Chvilku počkejte a zkuste to znovu.","error.blocked":"Komentář v téhle podobě zveřejnit nejde. Zkuste ho prosím upravit.","error.confirm":"Než komentář odešlete, potvrďte prosím jednu věc.","error.removed":"Tahle zpráva byla odstraněna, upravit ji už nejde.","error.quota":"Posíláte toho hodně najednou. Zkuste to prosím později.","error.captcha":"Nepodařilo se ověřit, že nejste robot. Počkejte prosím na nové ověření a odešlete to znovu.","error.notFound":"Tohle jsme nenašli. Možná už není k dispozici.","error.surfaceOff":"Diskuse tu teď není k dispozici.","error.notMoved":"Diskusi teď připravujeme. Psát do ní půjde brzy.","error.ledger":"Teď se to nepodařilo uložit a všechno zůstalo, jak bylo. Zkuste to prosím znovu.","error.readOnly":"Tahle funkce komunity je teď vypnutá. Diskuse pod články běží dál.","error.braked":"Psaní je teď na chvíli pozastavené. Číst můžete dál, psát půjde zase brzy.","error.mentionLimit":"V jednom příspěvku jste zmínili víc lidí, než zatím jde. Některé zmínky odeberte a pošlete znovu.","error.pushRefused":"V tomhle prohlížeči upozornění zapnout nejde. Zkuste jiný prohlížeč, nebo sledujte stránku s upozorněními.","error.realtimeOff":"Nové příspěvky se tu teď neukazují hned. Diskuse se obnovuje sama každou chvíli.","error.membersOnly":"Fórum je otevřené členům komunity. Po přihlášení a vstupu do komunity ho uvidíte.","error.topicLocked":"Téma je uzavřené, psát do něj už nejde. Číst ho můžete dál.","error.topicCreationClosed":"V téhle kategorii nové téma založit nejde. Zkuste prosím jinou.","error.followLimit":"Sledujete toho už hodně. Něco prosím přestaňte sledovat a zkuste to znovu.","error.submit":"Nepovedlo se to. Obnovte prosím stránku a zkuste to znovu.","need.sign_in":"Do diskuse můžete psát po přihlášení.","need.onboarding":"Před prvním komentářem si nastavte jméno a potvrďte pravidla diskuse.","need.reconsent_rules":"Pravidla diskuse se změnila. Potvrďte prosím novou verzi.","need.art9_consent":"Pro psaní do diskuse potřebujeme váš souhlas se zpracováním.","state.visible":"Zveřejněno","state.held":"Čeká na kontrolu","state.removed":"Odstraněno","state.deleted":"Smazáno","state.hiddenUntilConsent":"Čeká na váš souhlas","note.identification_safety":"Podle fotky se houba spolehlivě určit nedá a o jedlosti tady nerozhodujeme. Při podezření na otravu volejte Toxikologické informační středisko: 224 919 293 (nonstop).","note.report_to_manufacturer":"Jde-li o nežádoucí účinek přípravku, dejte nám o něm prosím vědět také v poradně, ať ho můžeme prověřit.","category.fraud_spam":"Podvod nebo spam","category.harassment":"Obtěžování","category.hate":"Nenávistné projevy","category.threats":"Výhrůžky","category.sexual_content":"Sexuální obsah","category.child_at_risk":"Ohrožené dítě","category.self_harm":"Sebepoškozování","category.doxxing":"Zveřejnění cizích osobních údajů","category.copyright":"Porušení autorských práv","category.terrorism":"Terorismus","category.drugs":"Drogy","category.other_illegal":"Jiný nezákonný obsah","category.rules":"Porušení pravidel diskuse","category.adverse_event":"Nežádoucí účinek přípravku","category.third_party_health_data":"Cizí údaje o zdraví","category.suspected_minor":"Autor je nejspíš mladší, než pravidla dovolují","confirm.title":"Než to odešlete","confirm.about_self_or_consent":"Píšu o sobě, nebo mám souhlas člověka, o kterém píšu.","confirm.good_faith":"Potvrzuji, že podle mého nejlepšího vědomí je hlášení přesné a úplné.","confirm.other":"Rozumím upozornění a chci komentář odeslat.","confirm.submit":"Potvrdit a odeslat","warning.identifier":"V komentáři je nejspíš e-mail, telefon nebo číslo účtu. Pokud tam být nemá, komentář upravte.","warning.invisible_chars":"Z komentáře jsme odstranili neviditelné znaky.","warning.other":"Komentář je zveřejněný, ale pravidla diskuse u něj na něco upozorňují. Projděte si ho prosím.","author.deleted":"Smazaný uživatel","author.system":"Oznámení webu","author.badge.team":"Tým","discussion.title":"Diskuse","discussion.count_one":"{count} komentář","discussion.count_few":"{count} komentáře","discussion.count_many":"{count} komentáře","discussion.count_other":"{count} komentářů","discussion.empty":"Zatím tu nejsou komentáře. Začněte diskusi jako první.","discussion.loading":"Načítám diskusi…","discussion.loadMore":"Načíst další","discussion.newMessages":"V diskusi přibyly nové komentáře.","discussion.refresh":"Zobrazit","discussion.signInPrompt":"Přihlaste se a zapojte se do diskuse.","discussion.reply":"Odpovědět","discussion.edit":"Upravit","discussion.delete":"Smazat","discussion.deleteTitle":"Smazat komentář?","discussion.deleteExplain":"Komentář zmizí. Pokud na něj už někdo odpověděl, zůstane po něm prázdné místo.","discussion.deleteConfirm":"Ano, smazat","discussion.report":"Nahlásit","discussion.block":"Blokovat autora","discussion.unblock":"Odblokovat autora","discussion.blocked":"Autora jste zablokovali. Jeho komentáře uvidíte sbalené.","discussion.unblocked":"Autora jste odblokovali.","discussion.menu":"Další akce","discussion.collapsed":"Komentář autora, kterého jste zablokovali.","discussion.show":"Zobrazit","discussion.hide":"Skrýt","discussion.edited":"upraveno","discussion.translated":"Přeloženo automaticky","discussion.showOriginal":"Zobrazit originál","discussion.showTranslation":"Zobrazit překlad","discussion.showReplies_one":"Zobrazit {count} odpověď","discussion.showReplies_few":"Zobrazit {count} odpovědi","discussion.showReplies_many":"Zobrazit {count} odpovědi","discussion.showReplies_other":"Zobrazit {count} odpovědí","discussion.repliesTruncated":"Odpovědí je tu víc, než se dá zobrazit najednou.","discussion.heldNote":"Komentář čeká na kontrolu a zatím ho vidíte jen vy. Po kontrole se ukáže ostatním, nebo se v Moje komunita dozvíte, proč ne.","discussion.hiddenUntilConsentNote":"Komentář zatím vidíte jen vy. Ostatním se ukáže, až udělíte souhlas se zpracováním.","discussion.giveConsent":"Udělit souhlas","discussion.removedNote":"Tenhle komentář jsme odstranili a ostatní ho nevidí.","discussion.why":"Proč?","discussion.placeholderHeld":"Komentář čeká na kontrolu.","discussion.placeholderRemoved":"Komentář byl odstraněn.","discussion.placeholderDeleted":"Komentář byl smazán.","discussion.pending":"Odesílám…","discussion.reactions":"Reakce","discussion.reactionCount":"{emoji} {count}","discussion.reactionAdd":"Přidat reakci","discussion.reactionRemove":"Odebrat reakci","discussion.reactionMine":"Vaše reakce","composer.label":"Váš komentář","composer.replyLabel":"Vaše odpověď","composer.editLabel":"Úprava komentáře","composer.replyingTo":"Odpovídáte: {name}","composer.placeholder":"Napište komentář…","composer.counter":"{length} / {max} znaků","composer.tooLong":"Komentář je moc dlouhý. Zkraťte ho prosím nejvýš na {max} znaků.","composer.linksNote_one":"Do komentáře se vejde nejvýš {count} odkaz.","composer.linksNote_few":"Do komentáře se vejdou nejvýš {count} odkazy.","composer.linksNote_many":"Do komentáře se vejde nejvýš {count} odkazu.","composer.linksNote_other":"Do komentáře se vejde nejvýš {count} odkazů.","composer.shortcut":"Odeslat můžete i klávesami {keys}.","composer.submit":"Odeslat","composer.sending":"Odesílám…","composer.save":"Uložit","composer.cancel":"Zrušit","composer.posted":"Komentář je zveřejněný.","composer.held":"Komentář máme, teď čeká na kontrolu.","composer.cooldown_one":"Další komentář můžete poslat za {count} sekundu.","composer.cooldown_few":"Další komentář můžete poslat za {count} sekundy.","composer.cooldown_many":"Další komentář můžete poslat za {count} sekundy.","composer.cooldown_other":"Další komentář můžete poslat za {count} sekund.","sanction.restriction":"Psaní do diskuse máte omezené.","sanction.restrictionUntil":"Psaní do diskuse máte omezené do {date}.","sanction.suspension":"Váš účet v diskusi je pozastavený.","sanction.suspensionUntil":"Váš účet v diskusi je pozastavený do {date}.","sanction.ban":"Váš účet v diskusi je zrušený.","sanction.statement":"Zobrazit odůvodnění","onboarding.title":"Vítejte v diskusi","onboarding.lede":"Než napíšete první komentář, potřebujeme od vás pár věcí. Zabere to chvilku.","onboarding.ageTitle":"Kolik vám je let?","onboarding.age.16_17":"16–17 let","onboarding.age.18_plus":"18 let a víc","onboarding.ageHint":"Ptáme se jen jednou a uložíme si jen věkovou skupinu.","onboarding.ageBelow":"Diskuse je otevřená od {min} let. Číst ji ale můžete dál.","onboarding.rulesTitle":"Pravidla diskuse","onboarding.rulesLede":"Přečtěte si prosím, jak to v diskusi chodí.","onboarding.rulesLink":"Celá pravidla","onboarding.rulesAccept":"Souhlasím s pravidly diskuse.","onboarding.rulesChanged":"Pravidla diskuse se od vaší poslední návštěvy změnila. Přečtěte si prosím novou verzi a potvrďte ji.","onboarding.art9Title":"Souhlas se zpracováním","onboarding.art9Lede":"Pro psaní do diskuse potřebujeme váš souhlas podle textu níže.","onboarding.art9LedeOptional":"Prosíme o váš souhlas podle textu níže. Psát ve veřejné diskusi můžete i bez něj.","onboarding.art9Accept":"Souhlasím se zpracováním podle textu výše.","onboarding.art9Controller":"Souhlas pro {label}","onboarding.art9Refuse":"Nesouhlasím","onboarding.art9RefusedDone":"Bez tohoto souhlasu můžete psát ve veřejné diskusi.","onboarding.art9RequiredToWrite":"Bez souhlasu můžete diskusi jen číst.","onboarding.profileTitle":"Jak vás uvidí ostatní","onboarding.displayName":"Jméno v diskusi","onboarding.displayNameHint":"Může to být i přezdívka. Uvidí ho všichni čtenáři.","onboarding.handle":"Uživatelské jméno","onboarding.handleHint":"Malá písmena, číslice a podtržítko, {min} až {max} znaků. Změnit ho jde jednou za {days} dní.","onboarding.handleSuggested":"Navrhujeme: {handle}","onboarding.avatar":"Obrázek u jména","onboarding.avatarNone":"Bez obrázku","onboarding.continue":"Pokračovat","onboarding.back":"Zpět","onboarding.submit":"Hotovo","onboarding.done":"Hotovo, teď můžete psát.","report.title":"Nahlásit komentář","report.lede":"Hlášení posoudí tým webu. Výsledek uvidíte v Moje komunita.","report.category":"Co je na komentáři špatně?","report.rule":"Které pravidlo porušuje?","report.ruleOther":"Jiné pravidlo","report.note":"Poznámka pro tým (nepovinné)","report.noteHint":"Poznámku uvidí jen tým, který hlášení posuzuje.","report.counter":"{length} / {max} znaků","report.submit":"Nahlásit","report.sending":"Odesílám…","report.cancel":"Zrušit","report.done":"Díky, hlášení máme. Výsledek uvidíte v Moje komunita.","panel.title":"Moje komunita","panel.signIn":"Moje komunita je dostupná po přihlášení.","panel.profile":"Profil","panel.profileEdit":"Upravit profil","panel.statements":"Rozhodnutí o mém obsahu","panel.statementsEmpty":"Rozhodnutí o vašem obsahu uvidíte tady.","panel.reports":"Moje hlášení","panel.reportsEmpty":"Hlášení, která pošlete, uvidíte tady.","panel.notifications":"Upozornění","panel.notificationsEmpty":"Nová upozornění uvidíte tady.","panel.unread_one":"{count} nepřečtené oznámení","panel.unread_few":"{count} nepřečtená oznámení","panel.unread_many":"{count} nepřečteného oznámení","panel.unread_other":"{count} nepřečtených oznámení","panel.markRead":"Označit jako přečtené","panel.blocks":"Zablokovaní autoři","panel.blocksEmpty":"Autory, které zablokujete, uvidíte tady.","panel.consents":"Souhlasy","panel.art9Given":"Souhlas se zpracováním je udělený.","panel.art9NotGiven":"Souhlas se zpracováním jste zatím nedali.","panel.art9Refused":"Souhlas se zpracováním jste odmítli.","panel.art9Withdraw":"Odvolat souhlas","panel.art9WithdrawTitle":"Odvolat souhlas se zpracováním?","panel.art9WithdrawExplain":"Diskusi můžete dál číst. Jestli do ní půjde psát i bez souhlasu, nebo až ho zase udělíte, záleží na nastavení webu — řekne vám to před dalším komentářem.","panel.art9WithdrawConfirm":"Ano, odvolat souhlas","panel.art9WithdrawCancel":"Ponechat souhlas","panel.art9Withdrawn":"Souhlas jste odvolali.","panel.export":"Stáhnout moje data","panel.exportHint":"Soubor JSON s tím, co o vás v diskusi máme uložené.","panel.exporting":"Připravuji soubor…","panel.exportFileName":"moje-komunita","panel.erase":"Smazat profil v diskusi","panel.eraseExplain":"Po ochranné lhůtě smažeme váš profil v diskusi, vaše komentáře a reakce, pokud je nemusíme ze zákona uchovat. Účet na webu zůstane. Během lhůty to můžete zrušit.","panel.eraseTitle":"Opravdu smazat profil v diskusi?","panel.eraseConfirm":"Ano, smazat profil","panel.eraseKeep":"Ponechat","panel.eraseScheduled":"Profil v diskusi smažeme {date}. Do té doby to můžete zrušit.","panel.eraseCancel":"Zrušit smazání","panel.eraseCancelled":"Smazání jsme zrušili, profil zůstává.","statement.title":"Odůvodnění rozhodnutí","statement.decidedAt":"Rozhodnuto {date}","statement.provider":"Rozhoduje: {entity}","statement.restriction":"Opatření","statement.until":"Do {date}","statement.scope":"Rozsah","statement.scopeAll":"Všude","statement.basis":"Podnět","statement.facts":"Skutečnosti a okolnosti","statement.automation":"Automatizace","statement.automatedDetection":"Zjištěno automaticky","statement.automatedDecision":"Rozhodnuto automaticky","statement.humanDecision":"Rozhodl člověk","statement.legalGround":"Právní důvod","statement.contractualGround":"Pravidlo","statement.redress":"Možnosti nápravy","statement.subject":"Týká se","statement.subjectMessage":"Komentáře","statement.subjectProfile":"Profilu","statement.subjectArticle":"Článku","statement.full":"Celé odůvodnění","statement.appealTitle":"Odvolání","statement.appealLede":"Nesouhlasíte s rozhodnutím? Napište nám proč. Odvolání posoudí, kde to jde, jiný člověk než ten, kdo rozhodoval.","statement.appealUntil":"Odvolat se můžete do {date}.","statement.appealBody":"Proč s rozhodnutím nesouhlasíte?","statement.appealCounter":"{length} / {max} znaků","statement.appealSubmit":"Odeslat odvolání","statement.appealSending":"Odesílám…","statement.appealSent":"Odvolání máme. Až ho posoudíme, dáme vám vědět.","statement.appealOpen":"Vaše odvolání se posuzuje.","statement.appealWithdraw":"Vzít odvolání zpět","statement.appealWithdrawn":"Odvolání jste vzali zpět.","statement.appealClosed":"Lhůta pro odvolání uplynula.","statement.appealUnavailable":"Proti tomuto rozhodnutí se už odvolat nejde.","restriction.no_action":"Bez opatření","restriction.warning":"Upozornění","restriction.removal":"Odstranění obsahu","restriction.visibility_restricted":"Omezená viditelnost","restriction.posting_restricted":"Omezené psaní","restriction.account_suspended":"Pozastavený účet","restriction.account_terminated":"Zrušený účet","basis.notice":"Hlášení","basis.own_initiative":"Vlastní kontrola","basis.order":"Úřední příkaz","caseStatus.open":"Posuzujeme","caseStatus.decided":"Rozhodnuto","caseStatus.appealed":"Probíhá odvolání","caseStatus.closed":"Uzavřeno","appealStatus.open":"Posuzujeme","appealStatus.upheld":"Rozhodnutí platí","appealStatus.reversed":"Rozhodnutí zrušeno","appealStatus.withdrawn":"Vzato zpět","adverseOutcome.recorded":"Posouzeno jako možný nežádoucí účinek a zaznamenáno do evidence.","adverseOutcome.reported_to_authority":"Posouzeno jako možný nežádoucí účinek a ohlášeno příslušnému úřadu.","adverseOutcome.not_adverse":"Posouzeno: o nežádoucí účinek nejde.","notification.decision":"Máte nové rozhodnutí o svém obsahu.","notification.appeal_resolved":"Vaše odvolání je vyřízené.","notification.erasure_scheduled":"Smazání vašeho profilu v diskusi je naplánované.","notification.inactivity_warning":"Dlouho jste v diskusi nebyli. Bez další aktivity váš profil po čase smažeme.","notification.module_read_only":"Rozšířené funkce komunity jsou vypnuté. Diskuse pod články běží dál; co se pro vás mění, najdete na stránce Moje komunita.","notification.module_braked":"Psaní v komunitě je teď pozastavené. Číst můžete dál.","notification.reply":"Někdo odpověděl na váš příspěvek.","notification.mention":"Někdo vás zmínil v diskusi.","notification.module_push_reset":"Upozornění v prohlížeči je potřeba znovu zapnout v nastavení komunity.","notification.age_limit_changed":"Komunita je nově jen pro dospělé, váš profil je proto jen ke čtení. Podrobnosti najdete na stránce Moje komunita.","notification.topic_update":"V diskusi, kterou sledujete, přibyl nový příspěvek.","notification.category_topic":"V kategorii, kterou sledujete, je nové téma.","notification.category_topic.article":"V kategorii, kterou sledujete, je nová diskuse pod článkem.","centre.title":"Upozornění","centre.empty":"Nová upozornění uvidíte tady.","centre.markAllRead":"Označit vše jako přečtené","centre.settings":"Nastavení upozornění","centre.loadMore":"Načíst starší","centre.unreadOnly":"Jen nepřečtené","centre.signIn":"Upozornění uvidíte po přihlášení.","centre.openMessage":"Zobrazit příspěvek","badge.unread_one":"{count} nové upozornění","badge.unread_few":"{count} nová upozornění","badge.unread_many":"{count} nového upozornění","badge.unread_other":"{count} nových upozornění","settings.title":"Nastavení upozornění","settings.signIn":"Nastavení upozornění změníte po přihlášení.","settings.notifyReply":"Odpovědi na moje příspěvky","settings.notifyMention":"Když mě někdo zmíní","settings.notifyTopic":"Novinky v diskusích, které sleduji","settings.pushEnabled":"Upozornění v prohlížeči","settings.digestEmail":"Denní souhrn e-mailem","settings.quietHours":"Noční klid: mezi 22:00 a 7:00 počkají upozornění v prohlížeči do rána.","settings.saved":"Uloženo.","settings.push.enable":"Zapnout upozornění","settings.push.disable":"Vypnout upozornění","settings.push.carries":"Upozornění doručuje tento web. Samo upozornění nenese, co přišlo ani od koho.","settings.push.unsupported":"Tenhle prohlížeč upozornění neumí. Nové odpovědi a zmínky najdete na stránce s upozorněními.","settings.push.refused":"Upozornění se v tomhle prohlížeči zapnout nepodařilo. Zkuste to prosím později nebo v jiném prohlížeči.","settings.push.denied":"Upozornění má tenhle prohlížeč pro tento web zablokovaná. Povolit je můžete v nastavení prohlížeče.","settings.push.inAppExplain":"V aplikaci Facebooku nebo Instagramu upozornění zapnout nejdou. Otevřete stránku v prohlížeči.","settings.push.openInBrowser":"Otevřít v prohlížeči","settings.push.iosGuide":"Na iPhonu a iPadu fungují upozornění jen u webu přidaného na plochu: v Safari klepněte na Sdílet a zvolte „Přidat na plochu“. Pak web otevřete z plochy a upozornění zapněte.","settings.push.reset":"Zapněte si upozornění znovu: nastavení webu se změnilo a dřívější zapnutí přestalo platit.","settings.digest.prompt":"Chcete přestat dostávat denní souhrn e-mailem?","settings.digest.confirm":"Odhlásit denní souhrn","settings.digest.unsubscribed":"Denní souhrn e-mailem jsme vypnuli.","settings.digest.staleLink":"Odkaz na odhlášení souhrnu už neplatí. Po přihlášení ho vypnete přepínačem v nastavení.","profile.memberSince":"Členem od {date}","profile.bio":"O mně","profile.notFound":"Tenhle profil jsme nenašli.","profile.signIn":"Profily členů uvidíte po přihlášení.","trust.0":"Nový člen","trust.1":"Člen","trust.2":"Stálý člen","trust.3":"Důvěryhodný člen","role.moderator":"Moderátor","welcome.title":"Vítejte v komunitě","welcome.lede":"Tady je pár věcí, které se vám na začátku hodí.","welcome.rules":"Jak to v diskusi chodí","welcome.discussions":"Projít diskuse","welcome.settings":"Nastavit upozornění","welcome.profile":"Můj profil","realtime.off":"Živé aktualizace jsou teď vypnuté. Diskuse se sama obnovuje každou chvíli.","state.readOnly":"Rozšířené funkce komunity jsou teď vypnuté. Diskuse pod článkem běží dál.","state.braked":"Psaní je teď na chvíli pozastavené. Číst můžete dál.","state.away":"Tým je teď nepřítomen; nová témata počkají na kontrolu.","topic.deleted":"Smazané téma","topic.withheld":"Název tématu není k dispozici","follow.follow":"Sledovat","follow.following":"Sledujete","follow.followed":"Sledujete. Novinky uvidíte v upozorněních.","follow.unfollowed":"Už nesledujete.","follow.unavailable":"Tohle teď sledovat nejde.","forum.title":"Fórum","forum.loading":"Načítám fórum…","forum.empty":"Kategorie fóra tu zatím nejsou.","forum.topicCount_one":"{count} téma","forum.topicCount_few":"{count} témata","forum.topicCount_many":"{count} tématu","forum.topicCount_other":"{count} témat","forum.discussionCount_one":"{count} diskuse","forum.discussionCount_few":"{count} diskuse","forum.discussionCount_many":"{count} diskuse","forum.discussionCount_other":"{count} diskusí","forum.lastActivity":"Naposledy {date}","forum.latest":"Nejnovější témata","forum.allTopics":"Všechna témata","forum.allCategories":"Všechny kategorie","forum.search":"Hledat ve fóru","forum.searchSubmit":"Hledat","forum.modePre":"Nové příspěvky tu před zveřejněním čekají na kontrolu.","forum.teamTopics":"Témata tady zakládá tým.","forum.join":"Vstoupit do komunity","forum.back":"Zpět na fórum","state.forumBraked":"Psaní ve fóru je teď na chvíli pozastavené. Číst můžete dál.","forumCategory.notFound":"Tuhle kategorii jsme nenašli.","forumCategory.empty":"V téhle kategorii zatím nejsou témata.","forumCategory.articlesEmpty":"Diskuse pod články tu zatím nejsou.","forumCategory.sort":"Řazení","forumCategory.sortActivity":"Podle aktivity","forumCategory.sortNew":"Nejnovější","forumCategory.newTopic":"Nové téma","topic.loading":"Načítám téma…","topic.notFound":"Tohle téma jsme nenašli. Možná už není k dispozici.","topic.count_one":"{count} příspěvek","topic.count_few":"{count} příspěvky","topic.count_many":"{count} příspěvku","topic.count_other":"{count} příspěvků","topic.locked":"Uzavřené","topic.archived":"Archivované","topic.pinned":"Připnuté","topic.titleLabel":"Název tématu","topic.titleMissing":"Napište prosím název tématu.","topic.titleTooLong":"Název je moc dlouhý. Zkraťte ho prosím nejvýš na {max} znaků.","topic.bodyLabel":"Úvodní příspěvek","topic.create":"Založit téma","topic.created":"Téma je založené.","topic.createdHeld":"Téma máme, teď čeká na kontrolu.","topic.open":"Otevřít téma","forumText.composer.label":"Váš příspěvek","forumText.composer.editLabel":"Úprava příspěvku","forumText.composer.placeholder":"Napište příspěvek…","forumText.composer.tooLong":"Příspěvek je moc dlouhý. Zkraťte ho prosím nejvýš na {max} znaků.","forumText.composer.linksNote_one":"Do příspěvku se vejde nejvýš {count} odkaz.","forumText.composer.linksNote_few":"Do příspěvku se vejdou nejvýš {count} odkazy.","forumText.composer.linksNote_many":"Do příspěvku se vejde nejvýš {count} odkazu.","forumText.composer.linksNote_other":"Do příspěvku se vejde nejvýš {count} odkazů.","forumText.composer.posted":"Příspěvek je zveřejněný.","forumText.composer.held":"Příspěvek máme, teď čeká na kontrolu.","forumText.composer.cooldown_one":"Další příspěvek můžete poslat za {count} sekundu.","forumText.composer.cooldown_few":"Další příspěvek můžete poslat za {count} sekundy.","forumText.composer.cooldown_many":"Další příspěvek můžete poslat za {count} sekundy.","forumText.composer.cooldown_other":"Další příspěvek můžete poslat za {count} sekund.","forumText.discussion.empty":"Zatím tu nejsou odpovědi. Odpovězte jako první.","forumText.discussion.deleteTitle":"Smazat příspěvek?","forumText.discussion.deleteExplain":"Příspěvek zmizí. Pokud na něj už někdo odpověděl, zůstane po něm prázdné místo.","forumText.discussion.collapsed":"Příspěvek autora, kterého jste zablokovali.","forumText.discussion.heldNote":"Příspěvek čeká na kontrolu a zatím ho vidíte jen vy. Po kontrole se ukáže ostatním, nebo se v Moje komunita dozvíte, proč ne.","forumText.discussion.hiddenUntilConsentNote":"Příspěvek zatím vidíte jen vy. Ostatním se ukáže, až udělíte souhlas se zpracováním.","forumText.discussion.removedNote":"Tenhle příspěvek jsme odstranili a ostatní ho nevidí.","forumText.discussion.placeholderHeld":"Příspěvek čeká na kontrolu.","forumText.discussion.placeholderRemoved":"Příspěvek byl odstraněn.","forumText.discussion.placeholderDeleted":"Příspěvek byl smazán.","forumText.report.title":"Nahlásit příspěvek","forumText.report.category":"Co je na příspěvku špatně?","forumText.error.links":"V příspěvku je víc odkazů, než se vejde. Některé prosím uberte.","forumText.error.blocked":"Příspěvek v téhle podobě zveřejnit nejde. Zkuste ho prosím upravit.","forumText.error.confirm":"Než příspěvek odešlete, potvrďte prosím jednu věc.","forumText.confirm.other":"Rozumím upozornění a chci příspěvek odeslat.","forumText.warning.identifier":"V příspěvku je nejspíš e-mail, telefon nebo číslo účtu. Pokud tam být nemá, příspěvek upravte.","forumText.warning.other":"Příspěvek je zveřejněný, ale pravidla diskuse u něj na něco upozorňují. Projděte si ho prosím.","forumText.need.onboarding":"Před prvním příspěvkem si nastavte jméno a potvrďte pravidla diskuse.","forumText.need.art9_consent":"Pro psaní ve fóru potřebujeme váš souhlas se zpracováním.","search.title":"Hledání ve fóru","search.label":"Co hledáte?","search.submit":"Hledat","search.searching":"Hledám…","search.tooShort":"Napište prosím aspoň {min} znaky.","search.tooLong":"Hledaný text je moc dlouhý. Zkraťte ho prosím nejvýš na {max} znaků.","search.empty":"K tomu jsme nenašli výsledky. Zkuste jiná slova.","search.more":"Další výsledky","search.lastPage":"Další výsledky už nezobrazíme. Zkuste hledání upřesnit.","search.space":"Kde hledat","search.spaceAll":"Všude","search.spaceForum":"Ve fóru","search.spaceArticle":"V diskusích pod články","search.category":"Kategorie","search.topic":"Téma","search.message":"Příspěvek","search.inArticle":"Diskuse pod článkem","moderation.title":"Moderování","moderation.loading":"Načítám frontu…","moderation.empty":"Fronta je teď prázdná.","moderation.source.member_report":"Nahlásil člen","moderation.source.filter":"Zachytil filtr","moderation.source.staff":"Od týmu","moderation.premod":"Čeká na schválení","moderation.heldBySystem":"Zatím skryté automaticky","moderation.deadline":"Vyřídit do {date}","moderation.open":"Posoudit","moderation.package":"Obsah k posouzení","moderation.itemWithheld":"Tenhle příspěvek teď ostatní nevidí, a tak ho tu neukazujeme.","moderation.restriction":"Rozhodnutí","moderation.factsHint":"Popište, co jste u obsahu zjistili. Text bude součástí odůvodnění pro autora.","moderation.ruleRequired":"Vyberte prosím pravidlo, o které se rozhodnutí opírá.","moderation.preview":"Náhled odůvodnění","moderation.previewTitle":"Takhle odůvodnění uvidí autor","moderation.decide":"Rozhodnout","moderation.decided":"Rozhodnuto.","moderation.escalate":"Předat týmu","moderation.escalateLede":"Jde podle vás o protiprávní obsah? Předejte ho týmu webu, posoudí ho sám.","moderation.escalateCategory":"O co jde?","moderation.escalated":"Předáno týmu.","moderation.remove":"Odstranit jako moderátor","moderation.removeLede":"Příspěvek zmizí a autor dostane odůvodnění, proti kterému se může odvolat.","moderation.removed":"Odstraněno. Autor dostal odůvodnění.","moderation.approve":"Zveřejnit","moderation.approved":"Zveřejněno.","moderation.reject":"Zamítnout","moderation.rejected":"Zamítnuto. Autor dostal odůvodnění.","moderation.gone":"Tahle položka už ve frontě není.","moderation.textChanged":"Autor text mezitím upravil. Přečtěte si novou verzi a rozhodněte znovu.","moderation.lock":"Uzavřít téma","moderation.unlock":"Znovu otevřít téma","moderation.pin":"Připnout téma","moderation.unpin":"Odepnout téma","moderation.move":"Přesunout téma","moderation.moveTo":"Kam téma přesunout?","moderation.done":"Hotovo.","moderation.openTopic":"Zobrazit v tématu","profile.moderates":"V kategoriích","mention.limit":"V jednom příspěvku jste zmínili víc lidí, než zatím jde.","notice.title":"Nahlásit obsah","notice.lede":"Nahlásit můžete komentář, profil nebo článek, i bez přihlášení.","notice.noTarget":"Hlášení otevřete přímo u obsahu, který chcete nahlásit: u komentáře zvolte „Nahlásit“.","notice.category":"Proč obsah hlásíte?","notice.target":"Co hlásíte","notice.targetMessage":"Komentář","notice.targetProfile":"Profil","notice.targetArticle":"Článek","notice.rule":"Které pravidlo obsah porušuje?","notice.description":"Popis","notice.descriptionHint":"Popište prosím, co je na obsahu špatně a proč.","notice.counter":"{length} / {max} znaků","notice.contactTitle":"Kontakt (nepovinné)","notice.contactHint":"Kontakt potřebujeme k potvrzení přijetí a k odeslání výsledku.","notice.name":"Jméno","notice.email":"E-mail","notice.childAtRisk":"Hlášení o ohroženém dítěti přijímáme bez jména a e-mailu.","notice.submit":"Odeslat hlášení","notice.sending":"Odesílám…","notice.done":"Díky, hlášení máme.","notice.receiptLede":"Uložte si odkaz níže. Podle něj zjistíte, jak jsme hlášení vyřídili.","notice.statusLink":"Stav hlášení","notice.noContactKept":"Kontakt u tohoto hlášení neukládáme, výsledek vám proto e-mailem nepřijde. Zjistíte ho přes odkaz výše.","notice.captchaUnavailable":"Ověření proti robotům se nenačetlo (možná ho blokuje rozšíření prohlížeče), takže formulář teď odeslat nejde. Zkuste prosím stránku obnovit.","notice.statusTitle":"Stav hlášení","notice.submittedAt":"Odesláno {date}","notice.decidedAt":"Rozhodnuto {date}","notice.statement":"Odůvodnění","notice.outcome":"Výsledek","notice.redress":"Pokud s vyřízením nesouhlasíte, můžete se obrátit na soud nebo využít mimosoudní řešení sporu.","notice.appealTitle":"Odvolání","notice.appealLede":"Nesouhlasíte s tím, jak jsme hlášení vyřídili? Napište nám proč.","notice.appealBody":"Proč s rozhodnutím nesouhlasíte?","notice.appealSubmit":"Odeslat odvolání","notice.appealSent":"Odvolání máme.","notice.appealOpen":"Vaše odvolání se posuzuje.","notice.appealWithdraw":"Vzít odvolání zpět","notice.appealUntil":"Odvolat se můžete do {date}.","notice.appealClosed":"Lhůta pro odvolání uplynula.","notice.receiptMissing":"V odkazu chybí číslo hlášení. Otevřete prosím celý odkaz z e-mailu.","common.signIn":"Přihlásit se","common.close":"Zavřít","common.cancel":"Zrušit","common.retry":"Zkusit znovu","common.loading":"Načítám…","common.back":"Zpět","common.optional":"nepovinné","common.needsJs":"Tahle část stránky potřebuje zapnutý JavaScript. Zapněte ho prosím a stránku obnovte."},mp={"error.method":"This can't be started this way. Please reload the page.","error.origin":"This request didn't come from this page. Please reload it and try again.","error.unavailable":"We couldn't load or save that just now. Please try again in a little while.","error.invalid":"Something in the form isn't right. Please check it and try again.","error.signIn":"You need to sign in with a reader account for this.","error.onboarding":"Before you write, please finish joining the discussion.","error.age":"The discussion is open to an older age group, so you can't join it yet.","error.name":"This name can't be used. Please try another one.","error.handle":"This username is taken, or you changed yours recently. Please try another one, or try later.","error.restricted":"Your posting in the discussion is restricted for now.","error.suspended":"Your discussion account is suspended for now.","error.terminated":"Your discussion account is closed.","error.links":"This comment has more links than fit. Please remove some of them.","error.fast":"That's a bit fast. Please wait a moment and try again.","error.blocked":"This comment can't be published as it is. Please try editing it.","error.confirm":"Before you send the comment, please confirm one thing.","error.removed":"This message was removed; it can't be edited any more.","error.quota":"That's a lot in a short time — please try again later.","error.captcha":"We couldn't check that you're not a robot. Please wait for a new check and send it again.","error.notFound":"We couldn't find this. It may not be available any more.","error.surfaceOff":"The discussion isn't available here right now.","error.notMoved":"We're preparing the discussion. You'll be able to write here soon.","error.ledger":"That couldn't be saved just now, and everything is as it was. Please try again.","error.readOnly":"This community feature is switched off for now. The discussions under articles keep working.","error.braked":"Writing is paused for a while. You can keep reading, and writing will open again soon.","error.mentionLimit":"This post mentions more people than you can mention yet. Remove some of the mentions and send it again.","error.pushRefused":"Notifications cannot be switched on in this browser. Try another browser, or keep an eye on the notifications page.","error.realtimeOff":"New posts do not show up instantly here right now. The discussion refreshes itself every so often.","error.membersOnly":"The forum is open to community members. Sign in and join the community to see it.","error.topicLocked":"This topic is closed, so you can't post in it any more. You can still read it.","error.topicCreationClosed":"You can't start a new topic in this category. Please try another one.","error.followLimit":"You're already following a lot. Please unfollow something and try again.","error.submit":"That didn't work. Please reload the page and try again.","need.sign_in":"Sign in to write in the discussion.","need.onboarding":"Before your first comment, choose a name and confirm the discussion rules.","need.reconsent_rules":"The discussion rules have changed. Please confirm the new version.","need.art9_consent":"To write in the discussion, we need your consent to the processing.","state.visible":"Published","state.held":"Awaiting review","state.removed":"Removed","state.deleted":"Deleted","state.hiddenUntilConsent":"Awaiting your consent","note.identification_safety":"A mushroom can't be reliably identified from a photo, and edibility isn't decided here. If you suspect poisoning, call the Czech Toxicological Information Centre: +420 224 919 293 (24/7).","note.report_to_manufacturer":"If this is about a side effect of a product, please also tell us through the advice desk so we can look into it.","category.fraud_spam":"Fraud or spam","category.harassment":"Harassment","category.hate":"Hate speech","category.threats":"Threats","category.sexual_content":"Sexual content","category.child_at_risk":"A child at risk","category.self_harm":"Self-harm","category.doxxing":"Publishing someone else's personal data","category.copyright":"Copyright infringement","category.terrorism":"Terrorism","category.drugs":"Drugs","category.other_illegal":"Other illegal content","category.rules":"Breaks the discussion rules","category.adverse_event":"A side effect of a product","category.third_party_health_data":"Someone else's health information","category.suspected_minor":"The author seems younger than the rules allow","confirm.title":"Before you send it","confirm.about_self_or_consent":"I'm writing about myself, or I have the consent of the person I'm writing about.","confirm.good_faith":"I confirm that, to the best of my knowledge, this report is accurate and complete.","confirm.other":"I understand the notice and want to send the comment.","confirm.submit":"Confirm and send","warning.identifier":"The comment seems to contain an e-mail address, a phone number or an account number. If it shouldn't be there, edit the comment.","warning.invisible_chars":"We removed invisible characters from the comment.","warning.other":"The comment is published, but the discussion rules flag something in it. Please look it over.","author.deleted":"Deleted user","author.system":"Site notice","author.badge.team":"Team","discussion.title":"Discussion","discussion.count_one":"{count} comment","discussion.count_other":"{count} comments","discussion.empty":"There aren't any comments yet. Start the discussion.","discussion.loading":"Loading the discussion…","discussion.loadMore":"Load more","discussion.newMessages":"There are new comments in the discussion.","discussion.refresh":"Show","discussion.signInPrompt":"Sign in to join the discussion.","discussion.reply":"Reply","discussion.edit":"Edit","discussion.delete":"Delete","discussion.deleteTitle":"Delete the comment?","discussion.deleteExplain":"The comment disappears. If someone has replied to it, an empty placeholder stays in its place.","discussion.deleteConfirm":"Yes, delete","discussion.report":"Report","discussion.block":"Block the author","discussion.unblock":"Unblock the author","discussion.blocked":"You've blocked the author. Their comments will show collapsed.","discussion.unblocked":"You've unblocked the author.","discussion.menu":"More actions","discussion.collapsed":"A comment by an author you've blocked.","discussion.show":"Show","discussion.hide":"Hide","discussion.edited":"edited","discussion.translated":"Translated automatically","discussion.showOriginal":"Show the original","discussion.showTranslation":"Show the translation","discussion.showReplies_one":"Show {count} reply","discussion.showReplies_other":"Show {count} replies","discussion.repliesTruncated":"There are more replies than can be shown at once.","discussion.heldNote":"The comment is awaiting review and only you can see it for now. After the review it shows to others, or you'll find out why not in My community.","discussion.hiddenUntilConsentNote":"Only you can see this comment for now. Others will see it once you give your consent to the processing.","discussion.giveConsent":"Give consent","discussion.removedNote":"We removed this comment; others can't see it.","discussion.why":"Why?","discussion.placeholderHeld":"This comment is awaiting review.","discussion.placeholderRemoved":"This comment was removed.","discussion.placeholderDeleted":"This comment was deleted.","discussion.pending":"Sending…","discussion.reactions":"Reactions","discussion.reactionCount":"{emoji} {count}","discussion.reactionAdd":"Add a reaction","discussion.reactionRemove":"Remove the reaction","discussion.reactionMine":"Your reaction","composer.label":"Your comment","composer.replyLabel":"Your reply","composer.editLabel":"Editing the comment","composer.replyingTo":"Replying to: {name}","composer.placeholder":"Write a comment…","composer.counter":"{length} / {max} characters","composer.tooLong":"The comment is too long. Please shorten it to {max} characters at most.","composer.linksNote_one":"A comment can hold up to {count} link.","composer.linksNote_other":"A comment can hold up to {count} links.","composer.shortcut":"You can also send it with {keys}.","composer.submit":"Send","composer.sending":"Sending…","composer.save":"Save","composer.cancel":"Cancel","composer.posted":"The comment is published.","composer.held":"We've got the comment; it's awaiting review now.","composer.cooldown_one":"You can post again in {count} second.","composer.cooldown_other":"You can post again in {count} seconds.","sanction.restriction":"Your posting in the discussion is restricted.","sanction.restrictionUntil":"Your posting in the discussion is restricted until {date}.","sanction.suspension":"Your discussion account is suspended.","sanction.suspensionUntil":"Your discussion account is suspended until {date}.","sanction.ban":"Your discussion account is closed.","sanction.statement":"Show the statement of reasons","onboarding.title":"Welcome to the discussion","onboarding.lede":"Before your first comment, we need a few things from you. It takes a moment.","onboarding.ageTitle":"How old are you?","onboarding.age.16_17":"16–17","onboarding.age.18_plus":"18 or older","onboarding.ageHint":"We ask once and keep only the age group.","onboarding.ageBelow":"The discussion is open from the age of {min}. You can keep reading it, though.","onboarding.rulesTitle":"Discussion rules","onboarding.rulesLede":"Please read how the discussion works.","onboarding.rulesLink":"The full rules","onboarding.rulesAccept":"I agree to the discussion rules.","onboarding.rulesChanged":"The discussion rules have changed since your last visit. Please read the new version and confirm it.","onboarding.art9Title":"Consent to processing","onboarding.art9Lede":"To write in the discussion, we need your consent as described below.","onboarding.art9LedeOptional":"We ask for your consent as described below. You can write in the public discussion without it too.","onboarding.art9Accept":"I consent to the processing as described above.","onboarding.art9Controller":"Consent for {label}","onboarding.art9Refuse":"I do not consent","onboarding.art9RefusedDone":"You can write in the public discussion without this consent.","onboarding.art9RequiredToWrite":"Without the consent you can only read.","onboarding.profileTitle":"How others will see you","onboarding.displayName":"Name in the discussion","onboarding.displayNameHint":"It can be a nickname. Every reader will see it.","onboarding.handle":"Username","onboarding.handleHint":"Lower-case letters, digits and the underscore, {min} to {max} characters. It can be changed once every {days} days.","onboarding.handleSuggested":"Suggested: {handle}","onboarding.avatar":"Picture next to your name","onboarding.avatarNone":"Without a picture","onboarding.continue":"Continue","onboarding.back":"Back","onboarding.submit":"Done","onboarding.done":"Done — you can write now.","report.title":"Report the comment","report.lede":"The site's team reviews the report. You'll see the outcome in My community.","report.category":"What's wrong with the comment?","report.rule":"Which rule does it break?","report.ruleOther":"Another rule","report.note":"A note for the team (optional)","report.noteHint":"Only the team that reviews the report sees the note.","report.counter":"{length} / {max} characters","report.submit":"Report","report.sending":"Sending…","report.cancel":"Cancel","report.done":"Thanks, we've got the report. You'll see the outcome in My community.","panel.title":"My community","panel.signIn":"My community is available after you sign in.","panel.profile":"Profile","panel.profileEdit":"Edit the profile","panel.statements":"Decisions about my content","panel.statementsEmpty":"Decisions about your content will show here.","panel.reports":"My reports","panel.reportsEmpty":"The reports you send will show here.","panel.notifications":"Notifications","panel.notificationsEmpty":"New notifications will show here.","panel.unread_one":"{count} unread notification","panel.unread_other":"{count} unread notifications","panel.markRead":"Mark as read","panel.blocks":"Blocked authors","panel.blocksEmpty":"Authors you block will show here.","panel.consents":"Consents","panel.art9Given":"Consent to the processing is given.","panel.art9NotGiven":"You haven't given consent to the processing yet.","panel.art9Refused":"You declined the consent to the processing.","panel.art9Withdraw":"Withdraw consent","panel.art9WithdrawTitle":"Withdraw your consent to the processing?","panel.art9WithdrawExplain":"You can keep reading the discussion. Whether you can write without the consent, or only once you give it again, depends on the website's settings — it tells you before your next comment.","panel.art9WithdrawConfirm":"Yes, withdraw consent","panel.art9WithdrawCancel":"Keep the consent","panel.art9Withdrawn":"You've withdrawn your consent.","panel.export":"Download my data","panel.exportHint":"A JSON file with what the discussion keeps about you.","panel.exporting":"Preparing the file…","panel.exportFileName":"my-community","panel.erase":"Delete my discussion profile","panel.eraseExplain":"After a grace period we delete your discussion profile, your comments and reactions, unless the law requires us to keep them. Your account on the site stays. You can cancel it during the grace period.","panel.eraseTitle":"Really delete your discussion profile?","panel.eraseConfirm":"Yes, delete the profile","panel.eraseKeep":"Keep it","panel.eraseScheduled":"We will delete your discussion profile on {date}. You can cancel it until then.","panel.eraseCancel":"Cancel the deletion","panel.eraseCancelled":"The deletion is cancelled; your profile stays.","statement.title":"Statement of reasons","statement.decidedAt":"Decided on {date}","statement.provider":"Decided by: {entity}","statement.restriction":"Measure","statement.until":"Until {date}","statement.scope":"Scope","statement.scopeAll":"Everywhere","statement.basis":"Prompted by","statement.facts":"Facts and circumstances","statement.automation":"Automation","statement.automatedDetection":"Detected automatically","statement.automatedDecision":"Decided automatically","statement.humanDecision":"Decided by a person","statement.legalGround":"Legal ground","statement.contractualGround":"Rule","statement.redress":"Redress","statement.subject":"Concerns","statement.subjectMessage":"A comment","statement.subjectProfile":"A profile","statement.subjectArticle":"An article","statement.full":"The full statement","statement.appealTitle":"Appeal","statement.appealLede":"Don't agree with the decision? Tell us why. Where possible, a different person from the one who decided reviews the appeal.","statement.appealUntil":"You can appeal until {date}.","statement.appealBody":"Why don't you agree with the decision?","statement.appealCounter":"{length} / {max} characters","statement.appealSubmit":"Send the appeal","statement.appealSending":"Sending…","statement.appealSent":"We've got the appeal. We'll let you know once it's reviewed.","statement.appealOpen":"Your appeal is being reviewed.","statement.appealWithdraw":"Withdraw the appeal","statement.appealWithdrawn":"You've withdrawn the appeal.","statement.appealClosed":"The time for an appeal has passed.","statement.appealUnavailable":"This decision can't be appealed any more.","restriction.no_action":"Left as it was","restriction.warning":"A warning","restriction.removal":"Content removed","restriction.visibility_restricted":"Visibility restricted","restriction.posting_restricted":"Posting restricted","restriction.account_suspended":"Account suspended","restriction.account_terminated":"Account closed","basis.notice":"A report","basis.own_initiative":"Our own review","basis.order":"An official order","caseStatus.open":"Under review","caseStatus.decided":"Decided","caseStatus.appealed":"Under appeal","caseStatus.closed":"Closed","appealStatus.open":"Under review","appealStatus.upheld":"The decision stands","appealStatus.reversed":"The decision was reversed","appealStatus.withdrawn":"Withdrawn","adverseOutcome.recorded":"Assessed as a possible adverse reaction and recorded in the register.","adverseOutcome.reported_to_authority":"Assessed as a possible adverse reaction and reported to the competent authority.","adverseOutcome.not_adverse":"Assessed: it is not an adverse reaction.","notification.decision":"There is a new decision about your content.","notification.appeal_resolved":"Your appeal has been resolved.","notification.erasure_scheduled":"The deletion of your discussion profile is scheduled.","notification.inactivity_warning":"You haven't been active in the discussion for a long time. Without further activity, we'll delete your profile after a while.","notification.module_read_only":"The community's extra features are switched off. The discussions under articles go on; what changes for you is on the My community page.","notification.module_braked":"Writing in the community is paused for now. You can keep reading.","notification.reply":"Someone replied to your post.","notification.mention":"Someone mentioned you in a discussion.","notification.module_push_reset":"Browser notifications need to be switched on again in your community settings.","notification.age_limit_changed":"The community is now for adults only, so your profile is read-only. The details are on the My community page.","notification.topic_update":"A discussion you follow has a new post.","notification.category_topic":"A category you follow has a new topic.","notification.category_topic.article":"A category you follow has a new discussion under an article.","centre.title":"Notifications","centre.empty":"New notifications will show here.","centre.markAllRead":"Mark all as read","centre.settings":"Notification settings","centre.loadMore":"Load older","centre.unreadOnly":"Unread only","centre.signIn":"Sign in to see your notifications.","centre.openMessage":"Show the post","badge.unread_one":"{count} new notification","badge.unread_other":"{count} new notifications","settings.title":"Notification settings","settings.signIn":"Sign in to change your notification settings.","settings.notifyReply":"Replies to my posts","settings.notifyMention":"When someone mentions me","settings.notifyTopic":"News in discussions I follow","settings.pushEnabled":"Browser notifications","settings.digestEmail":"Daily e-mail summary","settings.quietHours":"Quiet hours: between 22:00 and 7:00, browser notifications wait until the morning.","settings.saved":"Saved.","settings.push.enable":"Turn on notifications","settings.push.disable":"Turn off notifications","settings.push.carries":"This website delivers the notifications. A notification doesn't say what arrived or who it's from.","settings.push.unsupported":"This browser can't show notifications. You'll find new replies and mentions on the notifications page.","settings.push.refused":"Notifications couldn't be turned on in this browser. Please try again later or in another browser.","settings.push.denied":"This browser blocks notifications for this site. You can allow them in the browser settings.","settings.push.inAppExplain":"Notifications can't be turned on inside the Facebook or Instagram app. Open the page in your browser.","settings.push.openInBrowser":"Open in browser","settings.push.iosGuide":"On an iPhone or iPad, notifications work only for a site added to the Home Screen: in Safari tap Share and choose “Add to Home Screen”. Then open the site from the Home Screen and turn notifications on.","settings.push.reset":"Turn notifications on again: a site setting changed, so the earlier setup no longer works.","settings.digest.prompt":"Do you want to stop receiving the daily e-mail summary?","settings.digest.confirm":"Stop the daily summary","settings.digest.unsubscribed":"We've switched off the daily e-mail summary.","settings.digest.staleLink":"This unsubscribe link is no longer valid. Sign in to switch the summary off in the settings.","profile.memberSince":"Member since {date}","profile.bio":"About me","profile.notFound":"We couldn't find this profile.","profile.signIn":"Sign in to see members' profiles.","trust.0":"New member","trust.1":"Member","trust.2":"Regular","trust.3":"Trusted member","role.moderator":"Moderator","welcome.title":"Welcome to the community","welcome.lede":"Here are a few things that help at the start.","welcome.rules":"How the discussion works","welcome.discussions":"Browse the discussions","welcome.settings":"Set up notifications","welcome.profile":"My profile","realtime.off":"Live updates are off right now. The discussion refreshes itself every so often.","state.readOnly":"The community's extra features are switched off for now. The discussion under the article goes on.","state.braked":"Writing is paused for a while. You can keep reading.","state.away":"The team is away for now; new topics will wait for review.","topic.deleted":"Deleted topic","topic.withheld":"Topic title unavailable","follow.follow":"Follow","follow.following":"Following","follow.followed":"You're following. You'll see what's new in your notifications.","follow.unfollowed":"You've stopped following.","follow.unavailable":"You can't follow this right now.","forum.title":"Forum","forum.loading":"Loading the forum…","forum.empty":"The forum has no categories yet.","forum.topicCount_one":"{count} topic","forum.topicCount_other":"{count} topics","forum.discussionCount_one":"{count} discussion","forum.discussionCount_other":"{count} discussions","forum.lastActivity":"Last activity {date}","forum.latest":"Latest topics","forum.allTopics":"All topics","forum.allCategories":"All categories","forum.search":"Search the forum","forum.searchSubmit":"Search","forum.modePre":"New posts here wait for review before they appear.","forum.teamTopics":"The team starts the topics here.","forum.join":"Join the community","forum.back":"Back to the forum","state.forumBraked":"Posting in the forum is paused for a while. You can keep reading.","forumCategory.notFound":"We couldn't find this category.","forumCategory.empty":"There are no topics in this category yet.","forumCategory.articlesEmpty":"There are no article discussions here yet.","forumCategory.sort":"Sort","forumCategory.sortActivity":"By activity","forumCategory.sortNew":"Newest","forumCategory.newTopic":"New topic","topic.loading":"Loading the topic…","topic.notFound":"We couldn't find this topic. It may no longer be available.","topic.count_one":"{count} post","topic.count_other":"{count} posts","topic.locked":"Closed","topic.archived":"Archived","topic.pinned":"Pinned","topic.titleLabel":"Topic title","topic.titleMissing":"Please give the topic a title.","topic.titleTooLong":"The title is too long. Please shorten it to {max} characters at most.","topic.bodyLabel":"Opening post","topic.create":"Start the topic","topic.created":"The topic is up.","topic.createdHeld":"We've got the topic; it's awaiting review now.","topic.open":"Open the topic","forumText.composer.label":"Your post","forumText.composer.editLabel":"Editing the post","forumText.composer.placeholder":"Write a post…","forumText.composer.tooLong":"The post is too long. Please shorten it to {max} characters at most.","forumText.composer.linksNote_one":"A post can hold up to {count} link.","forumText.composer.linksNote_other":"A post can hold up to {count} links.","forumText.composer.posted":"The post is published.","forumText.composer.held":"We've got the post; it's awaiting review now.","forumText.composer.cooldown_one":"You can post again in {count} second.","forumText.composer.cooldown_other":"You can post again in {count} seconds.","forumText.discussion.empty":"There aren't any replies yet. Be the first to reply.","forumText.discussion.deleteTitle":"Delete the post?","forumText.discussion.deleteExplain":"The post disappears. If someone has replied to it, an empty placeholder stays in its place.","forumText.discussion.collapsed":"A post by an author you've blocked.","forumText.discussion.heldNote":"The post is awaiting review and only you can see it for now. After the review it shows to others, or you'll find out why not in My community.","forumText.discussion.hiddenUntilConsentNote":"Only you can see this post for now. Others will see it once you give your consent to the processing.","forumText.discussion.removedNote":"We removed this post; others can't see it.","forumText.discussion.placeholderHeld":"This post is awaiting review.","forumText.discussion.placeholderRemoved":"This post was removed.","forumText.discussion.placeholderDeleted":"This post was deleted.","forumText.report.title":"Report the post","forumText.report.category":"What's wrong with the post?","forumText.error.links":"This post has more links than fit. Please remove some of them.","forumText.error.blocked":"This post can't be published as it is. Please try editing it.","forumText.error.confirm":"Before you send the post, please confirm one thing.","forumText.confirm.other":"I understand the notice and want to send the post.","forumText.warning.identifier":"The post seems to contain an e-mail address, a phone number or an account number. If it shouldn't be there, edit the post.","forumText.warning.other":"The post is published, but the discussion rules flag something in it. Please look it over.","forumText.need.onboarding":"Before your first post, choose a name and confirm the discussion rules.","forumText.need.art9_consent":"To write in the forum, we need your consent to the processing.","search.title":"Search the forum","search.label":"What are you looking for?","search.submit":"Search","search.searching":"Searching…","search.tooShort":"Please type at least {min} characters.","search.tooLong":"The search text is too long. Please shorten it to {max} characters at most.","search.empty":"We found no results for that. Try other words.","search.more":"More results","search.lastPage":"We don't show more results. Try narrowing the search.","search.space":"Where to search","search.spaceAll":"Everywhere","search.spaceForum":"In the forum","search.spaceArticle":"In article discussions","search.category":"Category","search.topic":"Topic","search.message":"Post","search.inArticle":"An article discussion","moderation.title":"Moderation","moderation.loading":"Loading the queue…","moderation.empty":"The queue is empty right now.","moderation.source.member_report":"Reported by a member","moderation.source.filter":"Caught by the filters","moderation.source.staff":"From the team","moderation.premod":"Awaiting approval","moderation.heldBySystem":"Hidden automatically for now","moderation.deadline":"Due by {date}","moderation.open":"Review","moderation.package":"Content to review","moderation.itemWithheld":"Others can't see this post now, so it isn't shown here.","moderation.restriction":"Decision","moderation.factsHint":"Describe what you found. The text becomes part of the statement of reasons for the author.","moderation.ruleRequired":"Please choose the rule the decision rests on.","moderation.preview":"Preview the statement","moderation.previewTitle":"This is the statement the author will see","moderation.decide":"Decide","moderation.decided":"Decided.","moderation.escalate":"Pass to the team","moderation.escalateLede":"Do you think it's illegal? Pass it to the site's team to assess.","moderation.escalateCategory":"What is it?","moderation.escalated":"Passed to the team.","moderation.remove":"Remove as a moderator","moderation.removeLede":"The post disappears and its author gets a statement of reasons they can appeal.","moderation.removed":"Removed. The author got a statement of reasons.","moderation.approve":"Publish","moderation.approved":"Published.","moderation.reject":"Reject","moderation.rejected":"Rejected. The author got a statement of reasons.","moderation.gone":"This item is no longer in the queue.","moderation.textChanged":"The author has edited the text since. Read the new version and decide again.","moderation.lock":"Close the topic","moderation.unlock":"Reopen the topic","moderation.pin":"Pin the topic","moderation.unpin":"Unpin the topic","moderation.move":"Move the topic","moderation.moveTo":"Where to move the topic?","moderation.done":"Done.","moderation.openTopic":"View in the topic","profile.moderates":"In the categories","mention.limit":"This post mentions more people than you can mention yet.","notice.title":"Report content","notice.lede":"You can report a comment, a profile or an article, even without signing in.","notice.noTarget":"Open a report from the content you want to report: on a comment, choose “Report”.","notice.category":"Why are you reporting the content?","notice.target":"What you're reporting","notice.targetMessage":"A comment","notice.targetProfile":"A profile","notice.targetArticle":"An article","notice.rule":"Which rule does the content break?","notice.description":"Description","notice.descriptionHint":"Please describe what's wrong with the content and why.","notice.counter":"{length} / {max} characters","notice.contactTitle":"Contact (optional)","notice.contactHint":"We need a contact to confirm that the report arrived and to send you the outcome.","notice.name":"Name","notice.email":"E-mail","notice.childAtRisk":"We take reports of a child at risk without a name or an e-mail address.","notice.submit":"Send the report","notice.sending":"Sending…","notice.done":"Thanks, we've got the report.","notice.receiptLede":"Keep the link below. It's how you'll find out how we handled the report.","notice.statusLink":"Report status","notice.noContactKept":"We don't keep a contact for this report, so the outcome won't come by e-mail. You'll find it through the link above.","notice.captchaUnavailable":"The robot check didn't load (a browser extension may be blocking it), so the form can't be sent right now. Please try reloading the page.","notice.statusTitle":"Report status","notice.submittedAt":"Sent on {date}","notice.decidedAt":"Decided on {date}","notice.statement":"Statement of reasons","notice.outcome":"Outcome","notice.redress":"If you disagree with how it was dealt with, you can turn to a court or use an out-of-court dispute settlement.","notice.appealTitle":"Appeal","notice.appealLede":"Don't agree with how we handled the report? Tell us why.","notice.appealBody":"Why don't you agree with the decision?","notice.appealSubmit":"Send the appeal","notice.appealSent":"We've got the appeal.","notice.appealOpen":"Your appeal is being reviewed.","notice.appealWithdraw":"Withdraw the appeal","notice.appealUntil":"You can appeal until {date}.","notice.appealClosed":"The time for an appeal has passed.","notice.receiptMissing":"The link is missing the report number. Please open the whole link from the e-mail.","common.signIn":"Sign in","common.close":"Close","common.cancel":"Cancel","common.retry":"Try again","common.loading":"Loading…","common.back":"Back","common.optional":"optional","common.needsJs":"This part of the page needs JavaScript. Please turn it on and reload the page."},Ai=Object.freeze({cs:Object.freeze(fp),en:Object.freeze(mp)});function pp(e){return(typeof e=="string"?e.toLowerCase().split("-")[0]:"")==="cs"?"cs":"en"}const Oi=new Map;function hp(e,t){if(!Oi.has(e)){let n=null;try{n=new Intl.PluralRules(e)}catch{}Oi.set(e,n)}return Oi.get(e)?.select(t)??"other"}function bp(e){const t=typeof e=="number"?e:typeof e=="string"&&e.trim()!==""?Number(e):Number.NaN;return Number.isFinite(t)?t:null}function To(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function gp(e,t){return t?e.replace(/\{(\w+)\}/g,(n,s)=>Object.prototype.hasOwnProperty.call(t,s)&&t[s]!=null?String(t[s]):n):e}function El(e,t,n){const s=pp(e),o=Ai[s];let r=To(o,t);if(r===void 0){const a=bp(n?.count),l=a===null?"other":hp(s,a);r=To(o,`${t}_${l}`)??To(o,`${t}_other`)}return r===void 0?String(t):gp(r,n)}function Xn(e){return typeof e!="string"?!1:To(Ai.en,e)!==void 0||To(Ai.en,`${e}_other`)!==void 0}function vp(e){return typeof e=="string"&&e.startsWith("identifier_")?"warning.identifier":e==="invisible_chars"?"warning.invisible_chars":"warning.other"}function yp(e){const t=`confirm.${e}`;return e!=="title"&&e!=="submit"&&e!=="other"&&Xn(t)?t:"confirm.other"}function _p(e){const t=`note.${e}`;return Xn(t)?t:null}function kp(e){return Fa.includes(e)?`notification.${e}`:null}function wp(e){const t=kp(e.code);return t==="notification.category_topic"&&typeof e.articleId=="string"&&e.articleId!==""?"notification.category_topic.article":t}function $p(e){const t=typeof e=="string"?Ff.indexOf(e):-1;return t<0?null:`trust.${t}`}function Ei(e){return typeof e=="string"&&qf.includes(e)?`adverseOutcome.${e}`:null}const xp=["statementPath","myCommunityPath","rulesPath","reportPath","noticesPath","consultationPath","profilePath","settingsPath","notificationsPath","welcomePath","discussionsPath","articlePath","forumPath","categoryPath","topicPath","searchPath"];function hs(e){return typeof e=="string"&&/^\/(?![/\\])/.test(e)&&!/[\s\\\u0000-\u001f\u007f]/.test(e)}const Ml=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Pl(e){if(typeof e!="string")return e;if(e.trim()==="")return null;try{return JSON.parse(e)}catch{return null}}function Mt(e){const t=Pl(e),n={};if(!Ml(t))return n;for(const s of xp)hs(t[s])&&(n[s]=t[s]);return n}function Ip(e){if(e==null||e==="")return"";if(typeof e!="string")return null;const t=e.replace(/\/+$/,"");return t===""?e.startsWith("/")?"":null:/^(?:\/(?!\.{1,2}(?:\/|$))[A-Za-z0-9._~%-]+)+$/.test(t)?t:null}function Pt(e,t,n=""){const s=o=>hs(o)?o:void 0;return{statementPath:e.statementPath??s(t?.statementPath)??`${n}${Ke.statement}`,myCommunityPath:e.myCommunityPath??s(t?.myCommunityPath)??`${n}${Ke.myCommunity}`,rulesPath:e.rulesPath??`${n}${Ke.rules}`,reportPath:e.reportPath??`${n}${Ke.report}`,noticesPath:e.noticesPath??`${n}${Ke.notices}`,consultationPath:e.consultationPath??null,profilePath:e.profilePath??`${n}${Ke.profile}`,settingsPath:e.settingsPath??`${n}${Ke.settings}`,notificationsPath:e.notificationsPath??`${n}${Ke.notifications}`,welcomePath:e.welcomePath??`${n}${Ke.welcome}`,discussionsPath:e.discussionsPath??`${n}${Ke.discussions}`,articlePath:e.articlePath??null,forumPath:e.forumPath??`${n}${Ke.forum}`,categoryPath:e.categoryPath??`${n}${Ke.category}`,topicPath:e.topicPath??`${n}${Ke.topic}`,searchPath:e.searchPath??`${n}${Ke.search}`}}const Tp=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Cp=/^[a-z0-9][a-z0-9_]{2,29}$/,bs=e=>typeof e=="string"&&Tp.test(e),Rl=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>0;function gs(e){const t=Pl(e);return Ml(t)?"conversationId"in t?bs(t.conversationId)&&Rl(t.seq)?{conversationId:t.conversationId.toLowerCase(),seq:t.seq}:null:"memberId"in t?bs(t.memberId)?{memberId:t.memberId.toLowerCase()}:null:"handle"in t?typeof t.handle=="string"&&Cp.test(t.handle)?{handle:t.handle}:null:"articleId"in t&&bs(t.articleId)?{articleId:t.articleId.toLowerCase()}:null:null}function Sp(e){return"conversationId"in e?"message":"articleId"in e?"article":"profile"}function Ap(e,t){return!hs(e)||e.includes("#")||!bs(t.conversationId)||!Rl(t.seq)?null:`${e}#c=${t.conversationId.toLowerCase()}&s=${t.seq}`}function Op(e){if(typeof e!="string"||!e.startsWith("#")||e.startsWith("#t="))return null;const t=new Map;for(const r of e.slice(1).split("&")){const a=r.indexOf("=");a>0&&t.set(r.slice(0,a),r.slice(a+1))}const n=t.get("c"),s=t.get("s");if(n!==void 0&&s!==void 0&&/^\d{1,15}$/.test(s))return gs({conversationId:n,seq:Number(s)});const o=t.get("a");return o!==void 0?gs({articleId:o}):null}const Nl=6e4,jl=99,Ep=e=>e>jl?`${jl}+`:String(e);function Mp(e){const{client:t}=e,n=typeof e.intervalMs=="number"&&Number.isFinite(e.intervalMs)?e.intervalMs:Nl,s=n>0?Math.max(n,Nl):0,o=e.visible??(()=>typeof document>"u"||document.visibilityState!=="hidden"),r=new AbortController,a={signal:r.signal},l=Re({phase:"pending",count:0});let c=!1,p=!1,h=null,b=null;function _(){p=!1,h&&clearInterval(h),h=null,typeof document<"u"&&document.removeEventListener("visibilitychange",I)}function $(){l.phase="hidden",l.count=0,_()}function v(){return c||!p?Promise.resolve():(b??=(async()=>{const j=await t.me.notifications.unreadCount(a);if(!(c||!p)){if(j.ok){l.count=Math.max(0,Math.floor(j.value.count)),l.phase="shown";return}j.code==="signIn"&&$()}})().finally(()=>{b=null}),b)}function I(){o()&&v()}return{state:l,async start(){const j=await t.me.get(a);if(c)return;const P=j.ok?j.value.module?.state:void 0,T=P!==void 0&&(!Yn(P)||P==="dark");if(!j.ok||j.value.needs.includes("sign_in")||!j.value.member||T)return $();p=!0,typeof document<"u"&&document.addEventListener("visibilitychange",I),s>0&&(h=setInterval(()=>{o()&&v()},s)),o()&&await v()},refresh:v,dispose(){c||(c=!0,_(),r.abort())}}}const Pp="/api/community",zl=new Set;function Ut(e,t){zl.has(e)||(zl.add(e),console.warn(t))}function ht(e){const t=Ip(e);return t===null&&Ut("site-base",'[blogmcp-community] site-base must be a path on this site (e.g. "/blog"), never a URL: the site’s pages and its proxy are found under it'),t}function bt(e,t,n=""){const s=e==null||e===""?`${n}${Pp}`:e;if(!Ba(s))return Ut("api-base",'[blogmcp-community] api-base must be a path on this site (e.g. "/api/community"), never a URL: the community API is reached through the site’s own proxy or BFF'),null;try{return vm(t?{base:s,transport:t}:{base:s})}catch{return Ut("api-base","[blogmcp-community] api-base was refused by the community client"),null}}function Le(...e){for(const t of e){if(!t)continue;const n=t.toLowerCase();if(n.startsWith("cs")||n.startsWith("sk"))return"cs";if(n.startsWith("en"))return"en"}return"en"}function Ue(){return typeof document>"u"?null:document.documentElement.lang||null}function Rp(e){return(t,n)=>El(e,t,n)}function qt(e){return Xn(e)?e:null}const Ll=Symbol("bcm-text");function gt(e,t){const n=(o,r)=>El(e.value,t?.[o]??o,r),s={lang:e,t:n,text:o=>o?n(o.key,o.params):""};return jr(Ll,s),s}function vt(){const e=Qs(Ll,null);if(!e)throw new Error("[blogmcp-community] a component rendered outside its element");return e}let Dl=0;function He(e){return Dl+=1,`${e}-${Dl}`}function Mi(e,t,n){let s=null;const o=r=>{r.preventDefault(),t()};nt(()=>{const r=e.value;if(!r)return;if(s=r.getRootNode().activeElement??null,r.addEventListener("cancel",o),typeof r.showModal=="function")try{r.showModal()}catch{r.setAttribute("open","")}else r.setAttribute("open","")}),Ge(()=>{const r=e.value;r?.removeEventListener("cancel",o),r?.open&&typeof r.close=="function"&&r.close();const a=s;ze(()=>{(a&&a.isConnected?a:n?.()??null)?.focus()})})}const Np=["lang","href","aria-label","title"],jp={"aria-hidden":"true"},zp=$e({inheritAttrs:!1,__name:"BadgeView",props:{apiBase:{},siteBase:{},lang:{},routes:{},pollMs:{},transport:{type:Function}},setup(e){const t=e,n=ue(Le(t.lang,Ue())),{t:s}=gt(n),o=ht(t.siteBase),r=o===null?null:bt(t.apiBase,t.transport,o),a=r?Mp({client:r,...typeof t.pollMs=="number"?{intervalMs:t.pollMs}:{}}):null,l=a?.state??null,c=z(()=>Pt(Mt(t.routes),null,o??""));return nt(()=>{a?.start()}),Ge(()=>a?.dispose()),(p,h)=>i(l)&&i(l).phase==="shown"&&i(l).count>0?(d(),m("a",{key:0,class:"bcm-badge-link",lang:n.value,href:c.value.notificationsPath,"aria-label":i(s)("badge.unread",{count:i(l).count}),title:i(s)("badge.unread",{count:i(l).count})},[f("span",jp,u(i(Ep)(i(l).count)),1)],8,Np)):A("",!0)}}),Fl=e=>e==="cs"?"cs-CZ":"en-GB",Pi=new Map;function Lp(e,t){const n=`${e}:${t?"t":"d"}`;if(!Pi.has(n)){let s=null;try{s=new Intl.DateTimeFormat(Fl(e),t?{dateStyle:"medium",timeStyle:"short"}:{dateStyle:"long"})}catch{}Pi.set(n,s)}return Pi.get(n)??null}function Pe(e,t,n=!0){if(typeof t!="string"||t==="")return"";const s=Date.parse(t);return Number.isFinite(s)?Lp(e,n)?.format(new Date(s))??t:""}const Dp=new Map;function Fp(e,t){if(typeof t!="string"||!/^\d{4}-(?:0[1-9]|1[0-2])$/.test(t))return"";const n=Ri(Dp,e,s=>new Intl.DateTimeFormat(s,{day:"numeric",month:"long",year:"numeric",timeZone:"UTC"}));try{const s=n?.formatToParts(new Date(`${t}-01T00:00:00.000Z`));if(!s)return t;const o=s.findIndex(a=>a.type==="day");return s.filter((a,l)=>l!==o&&!(l===o+1&&s[l].type==="literal")).map(a=>a.value).join("").trim()||t}catch{return t}}function Ul(e,t=Date.now()){if(typeof e!="string")return!1;const n=Date.parse(e);return Number.isFinite(n)&&n<=t}const Up=/^[A-Z]{2}(?:,[A-Z]{2})*$/,qp=new Map,Bp=new Map;function Ri(e,t,n){if(!e.has(t)){let s=null;try{s=n(Fl(t))}catch{}e.set(t,s)}return e.get(t)??null}function Hp(e,t){try{return Ri(qp,e,n=>new Intl.DisplayNames(n,{type:"region"}))?.of(t)||t}catch{return t}}function Vp(e,t){if(typeof t!="string")return"";const n=t.trim();if(n==="all")return Rp(e)("statement.scopeAll");if(!Up.test(n))return n;const s=n.split(",").map(o=>Hp(e,o));try{return Ri(Bp,e,o=>new Intl.ListFormat(o,{type:"conjunction"}))?.format(s)??s.join(", ")}catch{return s.join(", ")}}function Ie(e,t){const n=e.until?Pe(t,e.until):"";return e.code==="restricted"&&n?{key:"sanction.restrictionUntil",params:{date:n}}:e.code==="suspended"&&n?{key:"sanction.suspensionUntil",params:{date:n}}:{key:`error.${e.code}`}}const Kp=Object.freeze({fast:3,quota:60});function Ni(e,t){const n=Kp[e.code];if(n===void 0)return null;const s=typeof e.retryAfterS=="number"&&e.retryAfterS>0?e.retryAfterS:n;return t+s*1e3}const ql=120,Wp=Object.freeze({method:"show",origin:"show",unavailable:"retry",invalid:"show",signIn:"reload",onboarding:"onboard",age:"show",name:"show",handle:"show",restricted:"reload",suspended:"reload",terminated:"reload",links:"show",fast:"wait",blocked:"show",confirm:"confirm",removed:"reload",quota:"wait",captcha:"show",notFound:"reload",surfaceOff:"hide",notMoved:"notMoved",ledger:"retry",braked:"wait",readOnly:"reload",mentionLimit:"show",pushRefused:"show",realtimeOff:"hide",membersOnly:"reload",topicLocked:"reload",topicCreationClosed:"show",followLimit:"show",submit:"show"});function Bl(e){return Wp[e]??"show"}var vs={},We={},Hl;function Yp(){return Hl||(Hl=1,Object.defineProperty(We,"__esModule",{value:!0}),We.BLANK_URL=We.relativeFirstCharacters=We.whitespaceEscapeCharsRegex=We.urlSchemeRegex=We.ctrlCharactersRegex=We.htmlCtrlEntityRegex=We.htmlEntitiesRegex=We.invalidProtocolRegex=void 0,We.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,We.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,We.htmlCtrlEntityRegex=/&(newline|tab);/gi,We.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,We.urlSchemeRegex=/^.+(:|:)/gim,We.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,We.relativeFirstCharacters=[".","/"],We.BLANK_URL="about:blank"),We}var Vl;function Gp(){if(Vl)return vs;Vl=1,Object.defineProperty(vs,"__esModule",{value:!0}),vs.sanitizeUrl=r;var e=Yp();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function n(a){var l=a.replace(e.ctrlCharactersRegex,"");return l.replace(e.htmlEntitiesRegex,function(c,p){return String.fromCharCode(p)})}function s(a){return URL.canParse(a)}function o(a){try{return decodeURIComponent(a)}catch{return a}}function r(a){if(!a)return e.BLANK_URL;var l,c=o(a.trim());do c=n(c).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),c=o(c),l=c.match(e.ctrlCharactersRegex)||c.match(e.htmlEntitiesRegex)||c.match(e.htmlCtrlEntityRegex)||c.match(e.whitespaceEscapeCharsRegex);while(l&&l.length>0);var p=c;if(!p)return e.BLANK_URL;if(t(p))return p;var h=p.trimStart(),b=h.match(e.urlSchemeRegex);if(!b)return p;var _=b[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(_))return e.BLANK_URL;var $=h.replace(/\\/g,"/");if(_==="mailto:"||_.includes("://"))return $;if(_==="http:"||_==="https:"){if(!s($))return e.BLANK_URL;var v=new URL($);return v.protocol=v.protocol.toLowerCase(),v.hostname=v.hostname.toLowerCase(),v.toString()}return $}return vs}var Zp=Gp();const Jp="nofollow ugc noopener noreferrer",Xp=/\b(?:https?:\/\/|www\.)[^\s<>"'`{}|\\^]+/gi,Qp=`.,;:!?…'"»”’]`;function eh(e){let t=e;for(;t.length>0;){const n=t[t.length-1];if(n===")"){const s=t.split("(").length-1;if(t.split(")").length-1<=s)break}else if(!Qp.includes(n))break;t=t.slice(0,-1)}return t}function th(e){const t=/^www\./i.test(e)?`https://${e}`:e;if(/^https?:\/\/$/i.test(t))return null;const n=Zp.sanitizeUrl(t);return n!=="about:blank"&&/^https?:\/\//i.test(n)?n:null}function nh(e){const t=[];if(typeof e!="string"||e==="")return t;let n=0;for(const s of e.matchAll(Xp)){const o=s.index??0;if(o<n)continue;const r=eh(s[0]),a=r?th(r):null;a&&(o>n&&t.push({kind:"text",text:e.slice(n,o)}),t.push({kind:"link",text:r,href:a}),n=o+r.length)}return n<e.length&&t.push({kind:"text",text:e.slice(n)}),t}function oh(e,t){const n=nh(e);if(!t)return n;const s=[];for(const o of n){if(o.kind!=="text"||!o.text.includes("@")){s.push(o);continue}for(const r of Al(o.text)){const a=r.kind==="mention"?t(r.handle):null;if(r.kind==="mention"&&a)s.push({kind:"mention",text:r.text,href:a});else{const l=s[s.length-1];l&&l.kind==="text"?s[s.length-1]={kind:"text",text:l.text+r.text}:s.push({kind:"text",text:r.text})}}}return s}function lt(e){let t=0;for(const n of e)t++;return t}function Ze(e){return typeof e=="string"?e.normalize("NFC").trim():""}const sh=Object.freeze({amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",ndash:"–",mdash:"—",hellip:"…",laquo:"«",raquo:"»",bdquo:"„",ldquo:"“",rdquo:"”",lsquo:"‘",rsquo:"’",sbquo:"‚",copy:"©",reg:"®",euro:"€",shy:""});function ih(e){return e.replace(/&(#\d{1,7}|#x[0-9a-f]{1,6}|[a-z]{2,8});/gi,(t,n)=>{if(n[0]==="#"){const s=n[1]==="x"||n[1]==="X",o=Number.parseInt(n.slice(s?2:1),s?16:10);return o>0&&o<=1114111&&!(o>=55296&&o<=57343)?String.fromCodePoint(o):t}return sh[n.toLowerCase()]??t})}const rh=/<\/(?:p|div|li|h[1-6]|section|article|blockquote|tr|ul|ol|dl|dt|dd|header|footer|table|pre|figure)\s*>/gi,ah=/<(?:li|tr|dt|dd|h[1-6]|blockquote|pre|figure)\b[^>]*>/gi;function lh(e){if(typeof e!="string"||e==="")return[];const t=e.replace(/<!--[\s\S]*?-->/g,"").replace(/<(script|style|template|noscript|svg|math)\b[\s\S]*?<\/\1\s*>/gi,"").replace(/[\t\n\r\f ]+/g," ").replace(/<br\b[^>]*>/gi,`
|
|
5
|
-
`).replace(
|
|
3
|
+
`,...Fu(o)),console.warn(...r)}Xt(),Ys=!1}function Du(){let e=uo[uo.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const s=e.component&&e.component.parent;e=s&&s.vnode}return t}function Fu(e){const t=[];return e.forEach((n,s)=>{t.push(...s===0?[]:[`
|
|
4
|
+
`],...Uu(n))}),t}function Uu({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",s=e.component?e.component.parent==null:!1,o=` at <${ra(e.component,e.type,s)}`,r=">"+n;return e.props?[o,...qu(e.props),r]:[o+r]}function qu(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(s=>{t.push(...xr(s,e[s]))}),n.length>3&&t.push(" ..."),t}function xr(e,t,n){return He(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:tt(t)?(t=xr(e,ke(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):Te(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=ke(t),n?t:[`${e}=`,t])}function Dn(e,t,n,s){try{return s?e(...s):e()}catch(o){Wo(o,t,n)}}function on(e,t,n,s){if(Te(e)){const o=Dn(e,t,n,s);return o&&Zi(o)&&o.catch(r=>{Wo(r,t,n)}),o}if(he(e)){const o=[];for(let r=0;r<e.length;r++)o.push(on(e[r],t,n,s));return o}}function Wo(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:a}=t&&t.appContext.config||Me;if(t){let l=t.parent;const c=t.proxy,p=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const h=l.ec;if(h){for(let b=0;b<h.length;b++)if(h[b](e,c,p)===!1)return}l=l.parent}if(r){Jt(),Dn(r,null,10,[e,c,p]),Xt();return}}Bu(e,n,o,s,a)}function Bu(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const at=[];let Kt=-1;const Fn=[];let un=null,Un=0;const Ir=Promise.resolve();let Yo=null;function Le(e){const t=Yo||Ir;return e?t.then(this?e.bind(this):e):t}function Hu(e){let t=Kt+1,n=at.length;for(;t<n;){const s=t+n>>>1,o=at[s],r=fo(o);r<e||r===e&&o.flags&2?t=s+1:n=s}return t}function Gs(e){if(!(e.flags&1)){const t=fo(e),n=at[at.length-1];!n||!(e.flags&2)&&t>=fo(n)?at.push(e):at.splice(Hu(t),0,e),e.flags|=1,Tr()}}function Tr(){Yo||(Yo=Ir.then(Ar))}function Vu(e){he(e)?Fn.push(...e):un&&e.id===-1?un.splice(Un+1,0,e):e.flags&1||(Fn.push(e),e.flags|=1),Tr()}function Cr(e,t,n=Kt+1){for(;n<at.length;n++){const s=at[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;at.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Sr(e){if(Fn.length){const t=[...new Set(Fn)].sort((n,s)=>fo(n)-fo(s));if(Fn.length=0,un){un.push(...t);return}for(un=t,Un=0;Un<un.length;Un++){const n=un[Un];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}un=null,Un=0}}const fo=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ar(e){try{for(Kt=0;Kt<at.length;Kt++){const t=at[Kt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Dn(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Kt<at.length;Kt++){const t=at[Kt];t&&(t.flags&=-2)}Kt=-1,at.length=0,Sr(),Yo=null,(at.length||Fn.length)&&Ar()}}let Je=null,Or=null;function Go(e){const t=Je;return Je=e,Or=e&&e.type.__scopeId||null,t}function Ku(e,t=Je,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Jr(-1);const r=Go(t);let a;try{a=e(...o)}finally{Go(r),s._d&&Jr(1)}return a};return s._n=!0,s._c=!0,s._d=!0,s}function ge(e,t){if(Je===null)return e;const n=ts(Je),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[r,a,l,c=Me]=t[o];r&&(Te(r)&&(r={mounted:r,updated:r}),r.deep&&nn(a),s.push({dir:r,instance:n,value:a,oldValue:void 0,arg:l,modifiers:c}))}return e}function wn(e,t,n,s){const o=e.dirs,r=t&&t.dirs;for(let a=0;a<o.length;a++){const l=o[a];r&&(l.oldValue=r[a].value);let c=l.dir[s];c&&(Jt(),on(c,n,8,[e.el,l,e,t]),Xt())}}const Wu=Symbol("_vte"),Yu=e=>e.__isTeleport,Gu=Symbol("_leaveCb");function Zs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Zs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function $e(e,t){return Te(e)?ut({name:e.name},t,{setup:e}):e}function Zu(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const Zo=new WeakMap;function mo(e,t,n,s,o=!1){if(he(e)){e.forEach((y,I)=>mo(y,t&&(he(t)?t[I]:t),n,s,o));return}if(qn(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&mo(e,t,n,s.component.subTree);return}const r=s.shapeFlag&4?ts(s.component):s.el,a=o?null:r,{i:l,r:c}=e,p=t&&t.r,h=l.refs===Me?l.refs={}:l.refs,b=l.setupState,_=ke(b),$=b===Me?Wi:y=>Ce(_,y);if(p!=null&&p!==c){if(Er(t),He(p))h[p]=null,$(p)&&(b[p]=null);else if(tt(p)){p.value=null;const y=t;y.k&&(h[y.k]=null)}}if(Te(c))Dn(c,l,12,[a,h]);else{const y=He(c),I=tt(c);if(y||I){const R=()=>{if(e.f){const P=y?$(c)?b[c]:h[c]:c.value;if(o)he(P)&&Yi(P,r);else if(he(P))P.includes(r)||P.push(r);else if(y)h[c]=[r],$(c)&&(b[c]=h[c]);else{const T=[r];c.value=T,e.k&&(h[e.k]=T)}}else y?(h[c]=a,$(c)&&(b[c]=a)):I&&(c.value=a,e.k&&(h[e.k]=a))};if(a){const P=()=>{R(),Zo.delete(e)};P.id=-1,Zo.set(e,P),$t(P,n)}else Er(e),R()}}}function Er(e){const t=Zo.get(e);t&&(t.flags|=8,Zo.delete(e))}Lo().requestIdleCallback,Lo().cancelIdleCallback;const qn=e=>!!e.type.__asyncLoader,Ju=e=>e.type.__isKeepAlive;function Xu(e,t,n=ft,s=!1){if(n){const o=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...a)=>{Jt();const l=li(n),c=on(t,n,e,a);return l(),Xt(),c});return s?o.unshift(r):o.push(r),r}}const Mr=e=>(t,n=ft)=>{(!vo||e==="sp")&&Xu(e,(...s)=>t(...s),n)},nt=Mr("m"),Ge=Mr("bum"),Qu="components";function ed(e,t){return nd(Qu,e,!0,t)||e}const td=Symbol.for("v-ndc");function nd(e,t,n=!0,s=!1){const o=Je||ft;if(o){const r=o.type;{const l=ia(r,!1);if(l&&(l===t||l===rt(t)||l===No(rt(t))))return r}const a=Pr(o[e]||r[e],t)||Pr(o.appContext[e],t);return!a&&s?r:a}}function Pr(e,t){return e&&(e[t]||e[rt(t)]||e[No(rt(t))])}function fe(e,t,n,s){let o;const r=n,a=he(e);if(a||He(e)){const l=a&&_n(e);let c=!1,p=!1;l&&(c=!At(e),p=tn(e),e=Fo(e)),o=new Array(e.length);for(let h=0,b=e.length;h<b;h++)o[h]=t(c?p?Ln(Dt(e[h])):Dt(e[h]):e[h],h,void 0,r)}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,r)}else if(ze(e))if(e[Symbol.iterator])o=Array.from(e,(l,c)=>t(l,c,void 0,r));else{const l=Object.keys(e);o=new Array(l.length);for(let c=0,p=l.length;c<p;c++){const h=l[c];o[c]=t(e[h],h,c,r)}}else o=[];return o}function od(e,t,n={},s,o){if(Je.ce||Je.parent&&qn(Je.parent)&&Je.parent.ce){const p=Object.keys(n).length>0;return n.name=t,d(),_e(q,null,[Ee("slot",n,s)],p?-2:64)}let r=e[t];r&&r._c&&(r._d=!1),d();const a=r&&Rr(r(n)),l=n.key||a&&a.key,c=_e(q,{key:(l&&!zt(l)?l:`_${t}`)+(!a&&s?"_fb":"")},a||[],a&&e._===1?64:-2);return c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),r&&r._c&&(r._d=!0),c}function Rr(e){return e.some(t=>ii(t)?!(t.type===sn||t.type===q&&!Rr(t.children)):!0)?e:null}const Js=e=>e?na(e)?ts(e):Js(e.parent):null,po=ut(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Js(e.parent),$root:e=>Js(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>e.type,$forceUpdate:e=>e.f||(e.f=()=>{Gs(e.update)}),$nextTick:e=>e.n||(e.n=Le.bind(e.proxy)),$watch:e=>gn}),Xs=(e,t)=>e!==Me&&!e.__isScriptSetup&&Ce(e,t),sd={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:r,accessCache:a,type:l,appContext:c}=e;if(t[0]!=="$"){const _=a[t];if(_!==void 0)switch(_){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return r[t]}else{if(Xs(s,t))return a[t]=1,s[t];if(Ce(r,t))return a[t]=3,r[t];if(n!==Me&&Ce(n,t))return a[t]=4,n[t];a[t]=0}}const p=po[t];let h,b;if(p)return t==="$attrs"&&et(e.attrs,"get",""),p(e);if((h=l.__cssModules)&&(h=h[t]))return h;if(n!==Me&&Ce(n,t))return a[t]=4,n[t];if(b=c.config.globalProperties,Ce(b,t))return b[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:r}=e;return Xs(o,t)?(o[t]=n,!0):Ce(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:r,type:a}},l){let c;return!!(n[l]||Xs(t,l)||Ce(r,l)||Ce(s,l)||Ce(po,l)||Ce(o.config.globalProperties,l)||(c=a.__cssModules)&&c[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Ce(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Nr(){return{app:null,config:{isNativeTag:Wi,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let id=0;function rd(e,t){return function(s,o=null){Te(s)||(s=ut({},s)),o!=null&&!ze(o)&&(o=null);const r=Nr(),a=new WeakSet,l=[];let c=!1;const p=r.app={_uid:id++,_component:s,_props:o,_container:null,_context:r,_instance:null,version:qd,get config(){return r.config},set config(h){},use(h,...b){return a.has(h)||(h&&Te(h.install)?(a.add(h),h.install(p,...b)):Te(h)&&(a.add(h),h(p,...b))),p},mixin(h){return p},component(h,b){return b?(r.components[h]=b,p):r.components[h]},directive(h,b){return b?(r.directives[h]=b,p):r.directives[h]},mount(h,b,_){if(!c){const $=p._ceVNode||Ee(s,o);return $.appContext=r,_===!0?_="svg":_===!1&&(_=void 0),e($,h,_),c=!0,p._container=h,h.__vue_app__=p,ts($.component)}},onUnmount(h){l.push(h)},unmount(){c&&(on(l,p._instance,16),e(null,p._container),delete p._container.__vue_app__)},provide(h,b){return r.provides[h]=b,p},runWithContext(h){const b=Bn;Bn=p;try{return h()}finally{Bn=b}}};return p}}let Bn=null;function jr(e,t){if(ft){let n=ft.provides;const s=ft.parent&&ft.parent.provides;s===n&&(n=ft.provides=Object.create(s)),n[e]=t}}function Qs(e,t,n=!1){const s=ea();if(s||Bn){let o=Bn?Bn._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&Te(t)?t.call(s&&s.proxy):t}}const ad=Symbol.for("v-scx"),ld=()=>Qs(ad);function ve(e,t,n){return cd(e,t,n)}function cd(e,t,n=Me){const{immediate:s,deep:o,flush:r,once:a}=n,l=ut({},n),c=t&&s||!t&&r!=="post";let p;if(vo){if(r==="sync"){const $=ld();p=$.__watcherHandles||($.__watcherHandles=[])}else if(!c){const $=()=>{};return $.stop=gn,$.resume=gn,$.pause=gn,$}}const h=ft;l.call=($,y,I)=>on($,h,y,I);let b=!1;r==="post"?l.scheduler=$=>{$t($,h&&h.suspense)}:r!=="sync"&&(b=!0,l.scheduler=($,y)=>{y?$():Gs($)}),l.augmentJob=$=>{t&&($.flags|=4),b&&($.flags|=2,h&&($.id=h.uid,$.i=h))};const _=Lu(e,t,l);return vo&&(p?p.push(_):c&&_()),_}const ud=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${rt(t)}Modifiers`]||e[`${wt(t)}Modifiers`];function dd(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Me;let o=n;const r=t.startsWith("update:"),a=r&&ud(s,t.slice(7));a&&(a.trim&&(o=n.map(h=>He(h)?h.trim():h)),a.number&&(o=n.map(zo)));let l,c=s[l=Ms(t)]||s[l=Ms(rt(t))];!c&&r&&(c=s[l=Ms(wt(t))]),c&&on(c,e,6,o);const p=s[l+"Once"];if(p){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,on(p,e,6,o)}}function fd(e,t,n=!1){const s=t.emitsCache,o=s.get(e);if(o!==void 0)return o;const r=e.emits;let a={};return r?(he(r)?r.forEach(l=>a[l]=null):ut(a,r),ze(e)&&s.set(e,a),a):(ze(e)&&s.set(e,null),null)}function Jo(e,t){return!e||!Mo(t)?!1:(t=t.slice(2).replace(/Once$/,""),Ce(e,t[0].toLowerCase()+t.slice(1))||Ce(e,wt(t))||Ce(e,t))}function SC(){}function zr(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[r],slots:a,attrs:l,emit:c,render:p,renderCache:h,props:b,data:_,setupState:$,ctx:y,inheritAttrs:I}=e,R=Go(e);let P,T;try{if(n.shapeFlag&4){const k=o||s,M=k;P=Wt(p.call(M,k,h,b,$,_,y)),T=l}else{const k=t;P=Wt(k.length>1?k(b,{attrs:l,slots:a,emit:c}):k(b,null)),T=t.props?l:md(l)}}catch(k){ho.length=0,Wo(k,e,1),P=Ee(sn)}let g=P;if(T&&I!==!1){const k=Object.keys(T),{shapeFlag:M}=g;k.length&&M&7&&(r&&k.some(Os)&&(T=pd(T,r)),g=Hn(g,T,!1,!0))}return n.dirs&&(g=Hn(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(n.dirs):n.dirs),n.transition&&Zs(g,n.transition),P=g,Go(R),P}const md=e=>{let t;for(const n in e)(n==="class"||n==="style"||Mo(n))&&((t||(t={}))[n]=e[n]);return t},pd=(e,t)=>{const n={};for(const s in e)(!Os(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function hd(e,t,n){const{props:s,children:o,component:r}=e,{props:a,children:l,patchFlag:c}=t,p=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return s?Lr(s,a,p):!!a;if(c&8){const h=t.dynamicProps;for(let b=0;b<h.length;b++){const _=h[b];if(a[_]!==s[_]&&!Jo(p,_))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===a?!1:s?a?Lr(s,a,p):!0:!!a;return!1}function Lr(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const r=s[o];if(t[r]!==e[r]&&!Jo(n,r))return!0}return!1}function bd({vnode:e,parent:t},n){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.el=e.el),s===e)(e=t.vnode).el=n,t=t.parent;else break}}const Dr={},Fr=()=>Object.create(Dr),Ur=e=>Object.getPrototypeOf(e)===Dr;function gd(e,t,n,s=!1){const o={},r=Fr();e.propsDefaults=Object.create(null),qr(e,t,o,r);for(const a in e.propsOptions[0])a in o||(o[a]=void 0);n?e.props=s?o:Eu(o):e.type.props?e.props=o:e.props=r,e.attrs=r}function vd(e,t,n,s){const{props:o,attrs:r,vnode:{patchFlag:a}}=e,l=ke(o),[c]=e.propsOptions;let p=!1;if((s||a>0)&&!(a&16)){if(a&8){const h=e.vnode.dynamicProps;for(let b=0;b<h.length;b++){let _=h[b];if(Jo(e.emitsOptions,_))continue;const $=t[_];if(c)if(Ce(r,_))$!==r[_]&&(r[_]=$,p=!0);else{const y=rt(_);o[y]=ei(c,l,y,$,e,!1)}else $!==r[_]&&(r[_]=$,p=!0)}}}else{qr(e,t,o,r)&&(p=!0);let h;for(const b in l)(!t||!Ce(t,b)&&((h=wt(b))===b||!Ce(t,h)))&&(c?n&&(n[b]!==void 0||n[h]!==void 0)&&(o[b]=ei(c,l,b,void 0,e,!0)):delete o[b]);if(r!==l)for(const b in r)(!t||!Ce(t,b))&&(delete r[b],p=!0)}p&&Qt(e.attrs,"set","")}function qr(e,t,n,s){const[o,r]=e.propsOptions;let a=!1,l;if(t)for(let c in t){if(so(c))continue;const p=t[c];let h;o&&Ce(o,h=rt(c))?!r||!r.includes(h)?n[h]=p:(l||(l={}))[h]=p:Jo(e.emitsOptions,c)||(!(c in s)||p!==s[c])&&(s[c]=p,a=!0)}if(r){const c=ke(n),p=l||Me;for(let h=0;h<r.length;h++){const b=r[h];n[b]=ei(o,c,b,p[b],e,!Ce(p,b))}}return a}function ei(e,t,n,s,o,r){const a=e[n];if(a!=null){const l=Ce(a,"default");if(l&&s===void 0){const c=a.default;if(a.type!==Function&&!a.skipFactory&&Te(c)){const{propsDefaults:p}=o;if(n in p)s=p[n];else{const h=li(o);s=p[n]=c.call(null,t),h()}}else s=c;o.ce&&o.ce._setProp(n,s)}a[0]&&(r&&!l?s=!1:a[1]&&(s===""||s===wt(n))&&(s=!0))}return s}function yd(e,t,n=!1){const s=t.propsCache,o=s.get(e);if(o)return o;const r=e.props,a={},l=[];if(!r)return ze(e)&&s.set(e,Rn),Rn;if(he(r))for(let p=0;p<r.length;p++){const h=rt(r[p]);Br(h)&&(a[h]=Me)}else if(r)for(const p in r){const h=rt(p);if(Br(h)){const b=r[p],_=a[h]=he(b)||Te(b)?{type:b}:ut({},b),$=_.type;let y=!1,I=!0;if(he($))for(let R=0;R<$.length;++R){const P=$[R],T=Te(P)&&P.name;if(T==="Boolean"){y=!0;break}else T==="String"&&(I=!1)}else y=Te($)&&$.name==="Boolean";_[0]=y,_[1]=I,(y||Ce(_,"default"))&&l.push(h)}}const c=[a,l];return ze(e)&&s.set(e,c),c}function Br(e){return e[0]!=="$"&&!so(e)}const ti=e=>e==="_"||e==="_ctx"||e==="$stable",ni=e=>he(e)?e.map(Wt):[Wt(e)],_d=(e,t,n)=>{if(t._n)return t;const s=Ku((...o)=>ni(t(...o)),n);return s._c=!1,s},Hr=(e,t,n)=>{const s=e._ctx;for(const o in e){if(ti(o))continue;const r=e[o];if(Te(r))t[o]=_d(o,r,s);else if(r!=null){const a=ni(r);t[o]=()=>a}}},Vr=(e,t)=>{const n=ni(t);e.slots.default=()=>n},Kr=(e,t,n)=>{for(const s in t)(n||!ti(s))&&(e[s]=t[s])},kd=(e,t,n)=>{const s=e.slots=Fr();if(e.vnode.shapeFlag&32){const o=t._;o?(Kr(s,t,n),n&&Xi(s,"_",o,!0)):Hr(t,s)}else t&&Vr(e,t)},wd=(e,t,n)=>{const{vnode:s,slots:o}=e;let r=!0,a=Me;if(s.shapeFlag&32){const l=t._;l?n&&l===1?r=!1:Kr(o,t,n):(r=!t.$stable,Hr(t,o)),a=t}else t&&(Vr(e,t),a={default:1});if(r)for(const l in o)!ti(l)&&a[l]==null&&delete o[l]},$t=Cd;function $d(e){return xd(e)}function xd(e,t){const n=Lo();n.__VUE__=!0;const{insert:s,remove:o,patchProp:r,createElement:a,createText:l,createComment:c,setText:p,setElementText:h,parentNode:b,nextSibling:_,setScopeId:$=gn,insertStaticContent:y}=e,I=(A,j,F,G=null,V=null,H=null,te=void 0,Q=null,X=!!j.dynamicChildren)=>{if(A===j)return;A&&!go(A,j)&&(G=W(A),Ue(A,V,H,!0),A=null),j.patchFlag===-2&&(X=!1,j.dynamicChildren=null);const{type:Y,ref:ce,shapeFlag:ne}=j;switch(Y){case Xo:R(A,j,F,G);break;case sn:P(A,j,F,G);break;case si:A==null&&T(j,F,G,te);break;case q:B(A,j,F,G,V,H,te,Q,X);break;default:ne&1?M(A,j,F,G,V,H,te,Q,X):ne&6?ee(A,j,F,G,V,H,te,Q,X):(ne&64||ne&128)&&Y.process(A,j,F,G,V,H,te,Q,X,Rt)}ce!=null&&V?mo(ce,A&&A.ref,H,j||A,!j):ce==null&&A&&A.ref!=null&&mo(A.ref,null,H,A,!0)},R=(A,j,F,G)=>{if(A==null)s(j.el=l(j.children),F,G);else{const V=j.el=A.el;j.children!==A.children&&p(V,j.children)}},P=(A,j,F,G)=>{A==null?s(j.el=c(j.children||""),F,G):j.el=A.el},T=(A,j,F,G)=>{[A.el,A.anchor]=y(A.children,j,F,G,A.el,A.anchor)},g=({el:A,anchor:j},F,G)=>{let V;for(;A&&A!==j;)V=_(A),s(A,F,G),A=V;s(j,F,G)},k=({el:A,anchor:j})=>{let F;for(;A&&A!==j;)F=_(A),o(A),A=F;o(j)},M=(A,j,F,G,V,H,te,Q,X)=>{if(j.type==="svg"?te="svg":j.type==="math"&&(te="mathml"),A==null)w(j,F,G,V,H,te,Q,X);else{const Y=A.el&&A.el._isVueCE?A.el:null;try{Y&&Y._beginPatch(),N(A,j,V,H,te,Q,X)}finally{Y&&Y._endPatch()}}},w=(A,j,F,G,V,H,te,Q)=>{let X,Y;const{props:ce,shapeFlag:ne,transition:ae,dirs:de}=A;if(X=A.el=a(A.type,H,ce&&ce.is,ce),ne&8?h(X,A.children):ne&16&&x(A.children,X,null,G,V,oi(A,H),te,Q),de&&wn(A,null,G,"created"),v(X,A,A.scopeId,te,G),ce){for(const Se in ce)Se!=="value"&&!so(Se)&&r(X,Se,null,ce[Se],H,G);"value"in ce&&r(X,"value",null,ce.value,H),(Y=ce.onVnodeBeforeMount)&&Yt(Y,G,A)}de&&wn(A,null,G,"beforeMount");const ye=Id(V,ae);ye&&ae.beforeEnter(X),s(X,j,F),((Y=ce&&ce.onVnodeMounted)||ye||de)&&$t(()=>{Y&&Yt(Y,G,A),ye&&ae.enter(X),de&&wn(A,null,G,"mounted")},V)},v=(A,j,F,G,V)=>{if(F&&$(A,F),G)for(let H=0;H<G.length;H++)$(A,G[H]);if(V){let H=V.subTree;if(j===H||Zr(H.type)&&(H.ssContent===j||H.ssFallback===j)){const te=V.vnode;v(A,te,te.scopeId,te.slotScopeIds,V.parent)}}},x=(A,j,F,G,V,H,te,Q,X=0)=>{for(let Y=X;Y<A.length;Y++){const ce=A[Y]=Q?dn(A[Y]):Wt(A[Y]);I(null,ce,j,F,G,V,H,te,Q)}},N=(A,j,F,G,V,H,te)=>{const Q=j.el=A.el;let{patchFlag:X,dynamicChildren:Y,dirs:ce}=j;X|=A.patchFlag&16;const ne=A.props||Me,ae=j.props||Me;let de;if(F&&$n(F,!1),(de=ae.onVnodeBeforeUpdate)&&Yt(de,F,j,A),ce&&wn(j,A,F,"beforeUpdate"),F&&$n(F,!0),(ne.innerHTML&&ae.innerHTML==null||ne.textContent&&ae.textContent==null)&&h(Q,""),Y?O(A.dynamicChildren,Y,Q,F,G,oi(j,V),H):te||D(A,j,Q,null,F,G,oi(j,V),H,!1),X>0){if(X&16)E(Q,ne,ae,F,V);else if(X&2&&ne.class!==ae.class&&r(Q,"class",null,ae.class,V),X&4&&r(Q,"style",ne.style,ae.style,V),X&8){const ye=j.dynamicProps;for(let Se=0;Se<ye.length;Se++){const xe=ye[Se],st=ne[xe],it=ae[xe];(it!==st||xe==="value")&&r(Q,xe,st,it,V,F)}}X&1&&A.children!==j.children&&h(Q,j.children)}else!te&&Y==null&&E(Q,ne,ae,F,V);((de=ae.onVnodeUpdated)||ce)&&$t(()=>{de&&Yt(de,F,j,A),ce&&wn(j,A,F,"updated")},G)},O=(A,j,F,G,V,H,te)=>{for(let Q=0;Q<j.length;Q++){const X=A[Q],Y=j[Q],ce=X.el&&(X.type===q||!go(X,Y)||X.shapeFlag&198)?b(X.el):F;I(X,Y,ce,null,G,V,H,te,!0)}},E=(A,j,F,G,V)=>{if(j!==F){if(j!==Me)for(const H in j)!so(H)&&!(H in F)&&r(A,H,j[H],null,V,G);for(const H in F){if(so(H))continue;const te=F[H],Q=j[H];te!==Q&&H!=="value"&&r(A,H,Q,te,V,G)}"value"in F&&r(A,"value",j.value,F.value,V)}},B=(A,j,F,G,V,H,te,Q,X)=>{const Y=j.el=A?A.el:l(""),ce=j.anchor=A?A.anchor:l("");let{patchFlag:ne,dynamicChildren:ae,slotScopeIds:de}=j;de&&(Q=Q?Q.concat(de):de),A==null?(s(Y,F,G),s(ce,F,G),x(j.children||[],F,ce,V,H,te,Q,X)):ne>0&&ne&64&&ae&&A.dynamicChildren?(O(A.dynamicChildren,ae,F,V,H,te,Q),(j.key!=null||V&&j===V.subTree)&&Wr(A,j,!0)):D(A,j,F,ce,V,H,te,Q,X)},ee=(A,j,F,G,V,H,te,Q,X)=>{j.slotScopeIds=Q,A==null?j.shapeFlag&512?V.ctx.activate(j,F,G,te,X):re(j,F,G,V,H,te,X):be(A,j,X)},re=(A,j,F,G,V,H,te)=>{const Q=A.component=Rd(A,G,V);if(Ju(A)&&(Q.ctx.renderer=Rt),Nd(Q,!1,te),Q.asyncDep){if(V&&V.registerDep(Q,we,te),!A.el){const X=Q.subTree=Ee(sn);P(null,X,j,F),A.placeholder=X.el}}else we(Q,A,j,F,V,H,te)},be=(A,j,F)=>{const G=j.component=A.component;if(hd(A,j,F))if(G.asyncDep&&!G.asyncResolved){K(G,j,F);return}else G.next=j,G.update();else j.el=A.el,G.vnode=j},we=(A,j,F,G,V,H,te)=>{const Q=()=>{if(A.isMounted){let{next:ne,bu:ae,u:de,parent:ye,vnode:Se}=A;{const jt=Yr(A);if(jt){ne&&(ne.el=Se.el,K(A,ne,te)),jt.asyncDep.then(()=>{A.isUnmounted||Q()});return}}let xe=ne,st;$n(A,!1),ne?(ne.el=Se.el,K(A,ne,te)):ne=Se,ae&&jo(ae),(st=ne.props&&ne.props.onVnodeBeforeUpdate)&&Yt(st,ye,ne,Se),$n(A,!0);const it=zr(A),Nt=A.subTree;A.subTree=it,I(Nt,it,b(Nt.el),W(Nt),A,V,H),ne.el=it.el,xe===null&&bd(A,it.el),de&&$t(de,V),(st=ne.props&&ne.props.onVnodeUpdated)&&$t(()=>Yt(st,ye,ne,Se),V)}else{let ne;const{el:ae,props:de}=j,{bm:ye,m:Se,parent:xe,root:st,type:it}=A,Nt=qn(j);$n(A,!1),ye&&jo(ye),!Nt&&(ne=de&&de.onVnodeBeforeMount)&&Yt(ne,xe,j),$n(A,!0);{st.ce&&st.ce._def.shadowRoot!==!1&&st.ce._injectChildStyle(it);const jt=A.subTree=zr(A);I(null,jt,F,G,A,V,H),j.el=jt.el}if(Se&&$t(Se,V),!Nt&&(ne=de&&de.onVnodeMounted)){const jt=j;$t(()=>Yt(ne,xe,jt),V)}(j.shapeFlag&256||xe&&qn(xe.vnode)&&xe.vnode.shapeFlag&256)&&A.a&&$t(A.a,V),A.isMounted=!0,j=F=G=null}};A.scope.on();const X=A.effect=new sr(Q);A.scope.off();const Y=A.update=X.run.bind(X),ce=A.job=X.runIfDirty.bind(X);ce.i=A,ce.id=A.uid,X.scheduler=()=>Gs(ce),$n(A,!0),Y()},K=(A,j,F)=>{j.component=A;const G=A.vnode.props;A.vnode=j,A.next=null,vd(A,j.props,G,F),wd(A,j.children,F),Jt(),Cr(A),Xt()},D=(A,j,F,G,V,H,te,Q,X=!1)=>{const Y=A&&A.children,ce=A?A.shapeFlag:0,ne=j.children,{patchFlag:ae,shapeFlag:de}=j;if(ae>0){if(ae&128){Fe(Y,ne,F,G,V,H,te,Q,X);return}else if(ae&256){U(Y,ne,F,G,V,H,te,Q,X);return}}de&8?(ce&16&&J(Y,V,H),ne!==Y&&h(F,ne)):ce&16?de&16?Fe(Y,ne,F,G,V,H,te,Q,X):J(Y,V,H,!0):(ce&8&&h(F,""),de&16&&x(ne,F,G,V,H,te,Q,X))},U=(A,j,F,G,V,H,te,Q,X)=>{A=A||Rn,j=j||Rn;const Y=A.length,ce=j.length,ne=Math.min(Y,ce);let ae;for(ae=0;ae<ne;ae++){const de=j[ae]=X?dn(j[ae]):Wt(j[ae]);I(A[ae],de,F,null,V,H,te,Q,X)}Y>ce?J(A,V,H,!0,!1,ne):x(j,F,G,V,H,te,Q,X,ne)},Fe=(A,j,F,G,V,H,te,Q,X)=>{let Y=0;const ce=j.length;let ne=A.length-1,ae=ce-1;for(;Y<=ne&&Y<=ae;){const de=A[Y],ye=j[Y]=X?dn(j[Y]):Wt(j[Y]);if(go(de,ye))I(de,ye,F,null,V,H,te,Q,X);else break;Y++}for(;Y<=ne&&Y<=ae;){const de=A[ne],ye=j[ae]=X?dn(j[ae]):Wt(j[ae]);if(go(de,ye))I(de,ye,F,null,V,H,te,Q,X);else break;ne--,ae--}if(Y>ne){if(Y<=ae){const de=ae+1,ye=de<ce?j[de].el:G;for(;Y<=ae;)I(null,j[Y]=X?dn(j[Y]):Wt(j[Y]),F,ye,V,H,te,Q,X),Y++}}else if(Y>ae)for(;Y<=ne;)Ue(A[Y],V,H,!0),Y++;else{const de=Y,ye=Y,Se=new Map;for(Y=ye;Y<=ae;Y++){const ct=j[Y]=X?dn(j[Y]):Wt(j[Y]);ct.key!=null&&Se.set(ct.key,Y)}let xe,st=0;const it=ae-ye+1;let Nt=!1,jt=0;const Mn=new Array(it);for(Y=0;Y<it;Y++)Mn[Y]=0;for(Y=de;Y<=ne;Y++){const ct=A[Y];if(st>=it){Ue(ct,V,H,!0);continue}let Ct;if(ct.key!=null)Ct=Se.get(ct.key);else for(xe=ye;xe<=ae;xe++)if(Mn[xe-ye]===0&&go(ct,j[xe])){Ct=xe;break}Ct===void 0?Ue(ct,V,H,!0):(Mn[Ct-ye]=Y+1,Ct>=jt?jt=Ct:Nt=!0,I(ct,j[Ct],F,null,V,H,te,Q,X),st++)}const eo=Nt?Td(Mn):Rn;for(xe=eo.length-1,Y=it-1;Y>=0;Y--){const ct=ye+Y,Ct=j[ct],C=j[ct+1],L=ct+1<ce?C.el||C.placeholder:G;Mn[Y]===0?I(null,Ct,F,L,V,H,te,Q,X):Nt&&(xe<0||Y!==eo[xe]?je(Ct,F,L,2):xe--)}}},je=(A,j,F,G,V=null)=>{const{el:H,type:te,transition:Q,children:X,shapeFlag:Y}=A;if(Y&6){je(A.component.subTree,j,F,G);return}if(Y&128){A.suspense.move(j,F,G);return}if(Y&64){te.move(A,j,F,Rt);return}if(te===q){s(H,j,F);for(let ne=0;ne<X.length;ne++)je(X[ne],j,F,G);s(A.anchor,j,F);return}if(te===si){g(A,j,F);return}if(G!==2&&Y&1&&Q)if(G===0)Q.beforeEnter(H),s(H,j,F),$t(()=>Q.enter(H),V);else{const{leave:ne,delayLeave:ae,afterLeave:de}=Q,ye=()=>{A.ctx.isUnmounted?o(H):s(H,j,F)},Se=()=>{H._isLeaving&&H[Gu](!0),ne(H,()=>{ye(),de&&de()})};ae?ae(H,ye,Se):Se()}else s(H,j,F)},Ue=(A,j,F,G=!1,V=!1)=>{const{type:H,props:te,ref:Q,children:X,dynamicChildren:Y,shapeFlag:ce,patchFlag:ne,dirs:ae,cacheIndex:de}=A;if(ne===-2&&(V=!1),Q!=null&&(Jt(),mo(Q,null,F,A,!0),Xt()),de!=null&&(j.renderCache[de]=void 0),ce&256){j.ctx.deactivate(A);return}const ye=ce&1&&ae,Se=!qn(A);let xe;if(Se&&(xe=te&&te.onVnodeBeforeUnmount)&&Yt(xe,j,A),ce&6)Z(A.component,F,G);else{if(ce&128){A.suspense.unmount(F,G);return}ye&&wn(A,null,j,"beforeUnmount"),ce&64?A.type.remove(A,j,F,Rt,G):Y&&!Y.hasOnce&&(H!==q||ne>0&&ne&64)?J(Y,j,F,!1,!0):(H===q&&ne&384||!V&&ce&16)&&J(X,j,F),G&&Qe(A)}(Se&&(xe=te&&te.onVnodeUnmounted)||ye)&&$t(()=>{xe&&Yt(xe,j,A),ye&&wn(A,null,j,"unmounted")},F)},Qe=A=>{const{type:j,el:F,anchor:G,transition:V}=A;if(j===q){oe(F,G);return}if(j===si){k(A);return}const H=()=>{o(F),V&&!V.persisted&&V.afterLeave&&V.afterLeave()};if(A.shapeFlag&1&&V&&!V.persisted){const{leave:te,delayLeave:Q}=V,X=()=>te(F,H);Q?Q(A.el,H,X):X()}else H()},oe=(A,j)=>{let F;for(;A!==j;)F=_(A),o(A),A=F;o(j)},Z=(A,j,F)=>{const{bum:G,scope:V,job:H,subTree:te,um:Q,m:X,a:Y}=A;Gr(X),Gr(Y),G&&jo(G),V.stop(),H&&(H.flags|=8,Ue(te,A,j,F)),Q&&$t(Q,j),$t(()=>{A.isUnmounted=!0},j)},J=(A,j,F,G=!1,V=!1,H=0)=>{for(let te=H;te<A.length;te++)Ue(A[te],j,F,G,V)},W=A=>{if(A.shapeFlag&6)return W(A.component.subTree);if(A.shapeFlag&128)return A.suspense.next();const j=_(A.anchor||A.el),F=j&&j[Wu];return F?_(F):j};let pe=!1;const Ht=(A,j,F)=>{A==null?j._vnode&&Ue(j._vnode,null,null,!0):I(j._vnode||null,A,j,null,null,null,F),j._vnode=A,pe||(pe=!0,Cr(),Sr(),pe=!1)},Rt={p:I,um:Ue,m:je,r:Qe,mt:re,mc:x,pc:D,pbc:O,n:W,o:e};return{render:Ht,hydrate:void 0,createApp:rd(Ht)}}function oi({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function $n({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Id(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Wr(e,t,n=!1){const s=e.children,o=t.children;if(he(s)&&he(o))for(let r=0;r<s.length;r++){const a=s[r];let l=o[r];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[r]=dn(o[r]),l.el=a.el),!n&&l.patchFlag!==-2&&Wr(a,l)),l.type===Xo&&l.patchFlag!==-1&&(l.el=a.el),l.type===sn&&!l.el&&(l.el=a.el)}}function Td(e){const t=e.slice(),n=[0];let s,o,r,a,l;const c=e.length;for(s=0;s<c;s++){const p=e[s];if(p!==0){if(o=n[n.length-1],e[o]<p){t[s]=o,n.push(s);continue}for(r=0,a=n.length-1;r<a;)l=r+a>>1,e[n[l]]<p?r=l+1:a=l;p<e[n[r]]&&(r>0&&(t[s]=n[r-1]),n[r]=s)}}for(r=n.length,a=n[r-1];r-- >0;)n[r]=a,a=t[a];return n}function Yr(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Yr(t)}function Gr(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const Zr=e=>e.__isSuspense;function Cd(e,t){t&&t.pendingBranch?he(e)?t.effects.push(...e):t.effects.push(e):Vu(e)}const q=Symbol.for("v-fgt"),Xo=Symbol.for("v-txt"),sn=Symbol.for("v-cmt"),si=Symbol.for("v-stc"),ho=[];let xt=null;function d(e=!1){ho.push(xt=e?null:[])}function Sd(){ho.pop(),xt=ho[ho.length-1]||null}let bo=1;function Jr(e,t=!1){bo+=e,e<0&&xt&&t&&(xt.hasOnce=!0)}function Xr(e){return e.dynamicChildren=bo>0?xt||Rn:null,Sd(),bo>0&&xt&&xt.push(e),e}function m(e,t,n,s,o,r){return Xr(f(e,t,n,s,o,r,!0))}function _e(e,t,n,s,o){return Xr(Ee(e,t,n,s,o,!0))}function ii(e){return e?e.__v_isVNode===!0:!1}function go(e,t){return e.type===t.type&&e.key===t.key}const Qr=({key:e})=>e??null,Qo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?He(e)||tt(e)||Te(e)?{i:Je,r:e,k:t,f:!!n}:e:null);function f(e,t=null,n=null,s=0,o=null,r=e===q?0:1,a=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Qr(t),ref:t&&Qo(t),scopeId:Or,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Je};return l?(ri(c,n),r&128&&e.normalize(c)):n&&(c.shapeFlag|=He(n)?8:16),bo>0&&!a&&xt&&(c.patchFlag>0||r&6)&&c.patchFlag!==32&&xt.push(c),c}const Ee=Ad;function Ad(e,t=null,n=null,s=0,o=null,r=!1){if((!e||e===td)&&(e=sn),ii(e)){const l=Hn(e,t,!0);return n&&ri(l,n),bo>0&&!r&&xt&&(l.shapeFlag&6?xt[xt.indexOf(e)]=l:xt.push(l)),l.patchFlag=-2,l}if(Ud(e)&&(e=e.__vccOpts),t){t=Od(t);let{class:l,style:c}=t;l&&!He(l)&&(t.class=Ke(l)),ze(c)&&(Ws(c)&&!he(c)&&(c=ut({},c)),t.style=Do(c))}const a=He(e)?1:Zr(e)?128:Yu(e)?64:ze(e)?4:Te(e)?2:0;return f(e,t,n,s,o,a,r,!0)}function Od(e){return e?Ws(e)||Ur(e)?ut({},e):e:null}function Hn(e,t,n=!1,s=!1){const{props:o,ref:r,patchFlag:a,children:l,transition:c}=e,p=t?Ed(o||{},t):o,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:p,key:p&&Qr(p),ref:t&&t.ref?n&&r?he(r)?r.concat(Qo(t)):[r,Qo(t)]:Qo(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==q?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Hn(e.ssContent),ssFallback:e.ssFallback&&Hn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&s&&Zs(h,c.clone(h)),h}function It(e=" ",t=0){return Ee(Xo,null,e,t)}function S(e="",t=!1){return t?(d(),_e(sn,null,e)):Ee(sn,null,e)}function Wt(e){return e==null||typeof e=="boolean"?Ee(sn):he(e)?Ee(q,null,e.slice()):ii(e)?dn(e):Ee(Xo,null,String(e))}function dn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Hn(e)}function ri(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(he(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),ri(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Ur(t)?t._ctx=Je:o===3&&Je&&(Je.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Te(t)?(t={default:t,_ctx:Je},n=32):(t=String(t),s&64?(n=16,t=[It(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ed(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=Ke([t.class,s.class]));else if(o==="style")t.style=Do([t.style,s.style]);else if(Mo(o)){const r=t[o],a=s[o];a&&r!==a&&!(he(r)&&r.includes(a))&&(t[o]=r?[].concat(r,a):a)}else o!==""&&(t[o]=s[o])}return t}function Yt(e,t,n,s=null){on(e,t,7,[n,s])}const Md=Nr();let Pd=0;function Rd(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Md,r={uid:Pd++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new du(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:yd(s,o),emitsOptions:fd(s,o),emit:null,emitted:null,propsDefaults:Me,inheritAttrs:s.inheritAttrs,ctx:Me,data:Me,props:Me,attrs:Me,slots:Me,refs:Me,setupState:Me,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return r.ctx={_:r},r.root=t?t.root:r,r.emit=dd.bind(null,r),e.ce&&e.ce(r),r}let ft=null;const ea=()=>ft||Je;let es,ai;{const e=Lo(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),r=>{o.length>1?o.forEach(a=>a(r)):o[0](r)}};es=t("__VUE_INSTANCE_SETTERS__",n=>ft=n),ai=t("__VUE_SSR_SETTERS__",n=>vo=n)}const li=e=>{const t=ft;return es(e),e.scope.on(),()=>{e.scope.off(),es(t)}},ta=()=>{ft&&ft.scope.off(),es(null)};function na(e){return e.vnode.shapeFlag&4}let vo=!1;function Nd(e,t=!1,n=!1){t&&ai(t);const{props:s,children:o}=e.vnode,r=na(e);gd(e,s,r,t),kd(e,o,n||t);const a=r?jd(e,t):void 0;return t&&ai(!1),a}function jd(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,sd);const{setup:s}=n;if(s){Jt();const o=e.setupContext=s.length>1?Ld(e):null,r=li(e),a=Dn(s,e,0,[e.props,o]),l=Zi(a);if(Xt(),r(),(l||e.sp)&&!qn(e)&&Zu(e),l){if(a.then(ta,ta),t)return a.then(c=>{oa(e,c)}).catch(c=>{Wo(c,e,0)});e.asyncDep=a}else oa(e,a)}else sa(e)}function oa(e,t,n){Te(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ze(t)&&(e.setupState=$r(t)),sa(e)}function sa(e,t,n){const s=e.type;e.render||(e.render=s.render||gn)}const zd={get(e,t){return et(e,"get",""),e[t]}};function Ld(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,zd),slots:e.slots,emit:e.emit,expose:t}}function ts(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy($r(Mu(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in po)return po[n](e)},has(t,n){return n in t||n in po}})):e.proxy}const Dd=/(?:^|[-_])\w/g,Fd=e=>e.replace(Dd,t=>t.toUpperCase()).replace(/[-_]/g,"");function ia(e,t=!0){return Te(e)?e.displayName||e.name:e.name||t&&e.__name}function ra(e,t,n=!1){let s=ia(t);if(!s&&t.__file){const o=t.__file.match(/([^/\\]+)\.\w+$/);o&&(s=o[1])}if(!s&&e){const o=r=>{for(const a in r)if(r[a]===t)return a};s=o(e.components)||e.parent&&o(e.parent.type.components)||o(e.appContext.components)}return s?Fd(s):n?"App":"Anonymous"}function Ud(e){return Te(e)&&"__vccOpts"in e}const z=(e,t)=>ju(e,t,vo),qd="3.5.25";let ci;const aa=typeof window<"u"&&window.trustedTypes;if(aa)try{ci=aa.createPolicy("vue",{createHTML:e=>e})}catch{}const la=ci?e=>ci.createHTML(e):e=>e,Bd="http://www.w3.org/2000/svg",Hd="http://www.w3.org/1998/Math/MathML",rn=typeof document<"u"?document:null,ca=rn&&rn.createElement("template"),Vd={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?rn.createElementNS(Bd,e):t==="mathml"?rn.createElementNS(Hd,e):n?rn.createElement(e,{is:n}):rn.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>rn.createTextNode(e),createComment:e=>rn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>rn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,r){const a=n?n.previousSibling:t.lastChild;if(o&&(o===r||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===r||!(o=o.nextSibling)););else{ca.innerHTML=la(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=ca.content;if(s==="svg"||s==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[a?a.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Kd=Symbol("_vtc");function Wd(e,t,n){const s=e[Kd];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ua=Symbol("_vod"),Yd=Symbol("_vsh"),Gd=Symbol(""),Zd=/(?:^|;)\s*display\s*:/;function Jd(e,t,n){const s=e.style,o=He(n);let r=!1;if(n&&!o){if(t)if(He(t))for(const a of t.split(";")){const l=a.slice(0,a.indexOf(":")).trim();n[l]==null&&ns(s,l,"")}else for(const a in t)n[a]==null&&ns(s,a,"");for(const a in n)a==="display"&&(r=!0),ns(s,a,n[a])}else if(o){if(t!==n){const a=s[Gd];a&&(n+=";"+a),s.cssText=n,r=Zd.test(n)}}else t&&e.removeAttribute("style");ua in e&&(e[ua]=r?s.display:"",e[Yd]&&(s.display="none"))}const da=/\s*!important$/;function ns(e,t,n){if(he(n))n.forEach(s=>ns(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Xd(e,t);da.test(n)?e.setProperty(wt(s),n.replace(da,""),"important"):e[s]=n}}const fa=["Webkit","Moz","ms"],ui={};function Xd(e,t){const n=ui[t];if(n)return n;let s=rt(t);if(s!=="filter"&&s in e)return ui[t]=s;s=No(s);for(let o=0;o<fa.length;o++){const r=fa[o]+s;if(r in e)return ui[t]=r}return t}const ma="http://www.w3.org/1999/xlink";function pa(e,t,n,s,o,r=cu(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ma,t.slice(6,t.length)):e.setAttributeNS(ma,t,n):n==null||r&&!tr(n)?e.removeAttribute(t):e.setAttribute(t,r?"":zt(n)?String(n):n)}function ha(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?la(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const l=r==="OPTION"?e.getAttribute("value")||"":e.value,c=n==null?e.type==="checkbox"?"on":"":String(n);(l!==c||!("_value"in e))&&(e.value=c),n==null&&e.removeAttribute(t),e._value=n;return}let a=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=tr(n):n==null&&l==="string"?(n="",a=!0):l==="number"&&(n=0,a=!0)}try{e[t]=n}catch{}a&&e.removeAttribute(o||t)}function an(e,t,n,s){e.addEventListener(t,n,s)}function Qd(e,t,n,s){e.removeEventListener(t,n,s)}const ba=Symbol("_vei");function ef(e,t,n,s,o=null){const r=e[ba]||(e[ba]={}),a=r[t];if(s&&a)a.value=s;else{const[l,c]=tf(t);if(s){const p=r[t]=sf(s,o);an(e,l,p,c)}else a&&(Qd(e,l,a,c),r[t]=void 0)}}const ga=/(?:Once|Passive|Capture)$/;function tf(e){let t;if(ga.test(e)){t={};let s;for(;s=e.match(ga);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):wt(e.slice(2)),t]}let di=0;const nf=Promise.resolve(),of=()=>di||(nf.then(()=>di=0),di=Date.now());function sf(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;on(rf(s,n.value),t,5,[s])};return n.value=e,n.attached=of(),n}function rf(e,t){if(he(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>o=>!o._stopped&&s&&s(o))}else return t}const va=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,af=(e,t,n,s,o,r)=>{const a=o==="svg";t==="class"?Wd(e,s,a):t==="style"?Jd(e,n,s):Mo(t)?Os(t)||ef(e,t,n,s,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):lf(e,t,s,a))?(ha(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&pa(e,t,s,a,r,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!He(s))?ha(e,rt(t),s,r,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),pa(e,t,s,a))};function lf(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&va(t)&&Te(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return va(t)&&He(n)?!1:t in e}const ya={};function cf(e,t,n){let s=$e(e,t);Po(s)&&(s=ut({},s,t));class o extends fi{constructor(a){super(s,a,n)}}return o.def=s,o}const uf=typeof HTMLElement<"u"?HTMLElement:class{};class fi extends uf{constructor(t,n={},s=Ca){super(),this._def=t,this._props=n,this._createApp=s,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&s!==Ca?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(ut({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.parentNode||t.host);)if(t instanceof fi){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,Le(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:r,styles:a}=s;let l;if(r&&!he(r))for(const c in r){const p=r[c];(p===Number||p&&p.type===Number)&&(c in this._props&&(this._props[c]=Qi(this._props[c])),(l||(l=Object.create(null)))[rt(c)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(a),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)Ce(this,s)||Object.defineProperty(this,s,{get:()=>i(n[s])})}_resolveProps(t){const{props:n}=t,s=he(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&s.includes(o)&&this._setProp(o,this[o]);for(const o of s.map(rt))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(r){this._setProp(o,r,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let s=n?this.getAttribute(t):ya;const o=rt(t);n&&this._numberProps&&this._numberProps[o]&&(s=Qi(s)),this._setProp(o,s,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,s=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===ya?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),s)){const r=this._ob;r&&(this._processMutations(r.takeRecords()),r.disconnect()),n===!0?this.setAttribute(wt(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(wt(t),n+""):n||this.removeAttribute(wt(t)),r&&r.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),gf(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=Ee(this._def,ut(t,this._props));return this._instance||(n.ce=s=>{this._instance=s,s.ce=this,s.isCE=!0;const o=(r,a)=>{this.dispatchEvent(new CustomEvent(r,Po(a[0])?ut({detail:a},a[0]):{detail:a}))};s.emit=(r,...a)=>{o(r,a),wt(r)!==r&&o(wt(r),a)},this._setParent()}),n}_applyStyles(t,n){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const s=this._nonce;for(let o=t.length-1;o>=0;o--){const r=document.createElement("style");s&&r.setAttribute("nonce",s),r.textContent=t[o],this.shadowRoot.prepend(r)}}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const s=n.nodeType===1&&n.getAttribute("slot")||"default";(t[s]||(t[s]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let s=0;s<t.length;s++){const o=t[s],r=o.getAttribute("name")||"default",a=this._slots[r],l=o.parentNode;if(a)for(const c of a){if(n&&c.nodeType===1){const p=n+"-s",h=document.createTreeWalker(c,1);c.setAttribute(p,"");let b;for(;b=h.nextNode();)b.setAttribute(p,"")}l.insertBefore(c,o)}else for(;o.firstChild;)l.insertBefore(o.firstChild,o);l.removeChild(o)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const s of t){const o=s.querySelectorAll("slot");for(let r=0;r<o.length;r++)n.add(o[r])}return Array.from(n)}_injectChildStyle(t){this._applyStyles(t.styles,t)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_removeChildStyle(t){}}function Vn(e){const t=ea(),n=t&&t.ce;return n||null}const fn=e=>{const t=e.props["onUpdate:modelValue"]||!1;return he(t)?n=>jo(t,n):t};function df(e){e.target.composing=!0}function _a(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ot=Symbol("_assign");function ka(e,t,n){return t&&(e=e.trim()),n&&(e=zo(e)),e}const Xe={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[Ot]=fn(o);const r=s||o.props&&o.props.type==="number";an(e,t?"change":"input",a=>{a.target.composing||e[Ot](ka(e.value,n,r))}),(n||r)&&an(e,"change",()=>{e.value=ka(e.value,n,r)}),t||(an(e,"compositionstart",df),an(e,"compositionend",_a),an(e,"change",_a))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:r}},a){if(e[Ot]=fn(a),e.composing)return;const l=(r||e.type==="number")&&!/^0\d/.test(e.value)?zo(e.value):e.value,c=t??"";l!==c&&(document.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===c)||(e.value=c))}},os={deep:!0,created(e,t,n){e[Ot]=fn(n),an(e,"change",()=>{const s=e._modelValue,o=Kn(e),r=e.checked,a=e[Ot];if(he(s)){const l=Ps(s,o),c=l!==-1;if(r&&!c)a(s.concat(o));else if(!r&&c){const p=[...s];p.splice(l,1),a(p)}}else if(jn(s)){const l=new Set(s);r?l.add(o):l.delete(o),a(l)}else a(xa(e,r))})},mounted:wa,beforeUpdate(e,t,n){e[Ot]=fn(n),wa(e,t,n)}};function wa(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(he(t))o=Ps(t,s.props.value)>-1;else if(jn(t))o=t.has(s.props.value);else{if(t===n)return;o=vn(t,xa(e,!0))}e.checked!==o&&(e.checked=o)}const xn={created(e,{value:t},n){e.checked=vn(t,n.props.value),e[Ot]=fn(n),an(e,"change",()=>{e[Ot](Kn(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[Ot]=fn(s),t!==n&&(e.checked=vn(t,s.props.value))}},Gt={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=jn(t);an(e,"change",()=>{const r=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>n?zo(Kn(a)):Kn(a));e[Ot](e.multiple?o?new Set(r):r:r[0]),e._assigning=!0,Le(()=>{e._assigning=!1})}),e[Ot]=fn(s)},mounted(e,{value:t}){$a(e,t)},beforeUpdate(e,t,n){e[Ot]=fn(n)},updated(e,{value:t}){e._assigning||$a(e,t)}};function $a(e,t){const n=e.multiple,s=he(t);if(!(n&&!s&&!jn(t))){for(let o=0,r=e.options.length;o<r;o++){const a=e.options[o],l=Kn(a);if(n)if(s){const c=typeof l;c==="string"||c==="number"?a.selected=t.some(p=>String(p)===String(l)):a.selected=Ps(t,l)>-1}else a.selected=t.has(l);else if(vn(Kn(a),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Kn(e){return"_value"in e?e._value:e.value}function xa(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const ff=["ctrl","shift","alt","meta"],mf={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>ff.some(n=>e[`${n}Key`]&&!t.includes(n))},mt=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...r)=>{for(let a=0;a<t.length;a++){const l=mf[t[a]];if(l&&l(o,t))return}return e(o,...r)}))},pf={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},hf=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const r=wt(o.key);if(t.some(a=>a===r||pf[a]===r))return e(o)}))},bf=ut({patchProp:af},Vd);let Ia;function Ta(){return Ia||(Ia=$d(bf))}const gf=((...e)=>{Ta().render(...e)}),Ca=((...e)=>{const t=Ta().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=yf(s);if(!o)return;const r=t._component;!Te(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const a=n(o,!1,vf(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),a},t});function vf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function yf(e){return He(e)?document.querySelector(e):e}const _f=["method","origin","unavailable","invalid","signIn","onboarding","age","name","handle","restricted","suspended","terminated","links","fast","blocked","confirm","removed","quota","captcha","notFound","surfaceOff","notMoved","ledger","readOnly","braked","mentionLimit","pushRefused","realtimeOff","membersOnly","topicLocked","topicCreationClosed","followLimit","submit"];new Set(_f);const Sa=Object.freeze({SURFACE_OFF:"surfaceOff",CUTOVER_NOT_MOVED:"notMoved",NOT_FOUND:"notFound",ONBOARDING_REQUIRED:"onboarding",AGE_BELOW_MINIMUM:"age",NAME_RESERVED:"name",NAME_BLOCKED:"name",HANDLE_TAKEN:"handle",HANDLE_RATE:"handle",POSTING_RESTRICTED:"restricted",ACCOUNT_SUSPENDED:"suspended",ACCOUNT_TERMINATED:"terminated",TOO_MANY_LINKS:"links",TOO_FAST:"fast",FILTER_BLOCKED:"blocked",CONFIRMATION_REQUIRED:"confirm",MESSAGE_REMOVED:"removed",REACTION_NOT_ALLOWED:"invalid",CAPTCHA_FAILED:"captcha",UNAUTHORIZED:"signIn",VALIDATION:"invalid",UNAVAILABLE:"unavailable",STALE_LEASE:"submit",STAFF_POSTING_OFF:"submit",PRESET_CONFLICT:"submit",INTERNAL:"unavailable",MODULE_DARK:"unavailable",MODULE_READ_ONLY:"readOnly",BRAKED:"braked",BRAKE_PLATFORM:"submit",MODULE_CONDITIONS:"submit",TRUST_LEVEL_INVALID:"invalid",MENTION_LIMIT:"mentionLimit",DIGEST_UNSUBSCRIBE_INVALID:"invalid",PUSH_ENDPOINT_REFUSED:"pushRefused",PUSH_LIMIT:"quota",REALTIME_OFF:"realtimeOff",BUSY:"submit",BRAKE_KIND_MISMATCH:"submit",MEMBERS_ONLY:"membersOnly",TOPIC_LOCKED:"topicLocked",TOPIC_CREATION_CLOSED:"topicCreationClosed",FOLLOW_LIMIT:"followLimit",BRAND_RESTRICTED:"submit",CATEGORY_NOT_EMPTY:"submit",SLUG_TAKEN:"submit",MODERATOR_NOT_ELIGIBLE:"submit",STALE_REVISION:"submit",CASE_UNDECIDED:"submit",NOT_A_MEMBER_SESSION:"signIn",IDENTITY_NOT_ADMITTED:"signIn",ACCOUNT_NOT_ELIGIBLE:"signIn",MEMBER_READ_ONLY:"restricted",MEMBER_DELETION_REQUESTED:"restricted",PRIVATE_SPACE:"submit",WRONG_PROVIDER:"submit",CASE_CLOSED:"submit",NOTIFIER_NOT_ALLOWED:"invalid",UNSUPPORTED_RESTRICTION:"submit",LADDER_EXCEEDED:"submit",PERSON_REQUIRED:"submit",APPEAL_OPEN:"submit",APPEAL_WINDOW_CLOSED:"submit",APPEAL_NEEDS_ANOTHER_PERSON:"submit",GAG_PLATFORM_ONLY:"submit",ORDER_FINAL:"submit",BODY_JSON_INVALID:"invalid",AUDIT_DETAIL_NOT_CODE:"submit",LEDGER_UNAVAILABLE:"ledger",INVALID_INPUT:"invalid",LEGAL_HOLD:"submit",TEXT_MISSING:"unavailable",AGE16_NOT_ALLOWED:"submit",QUOTA_DAILY:"quota",QUOTA_IP_HOURLY:"quota"}),Aa=Object.freeze({METHOD:"method",ORIGIN:"origin",TOO_LARGE:"invalid",INVALID_JSON:"invalid"}),Oa=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function kf(e){return typeof e!="string"||e===""?"submit":Oa(Sa,e)?Sa[e]:Oa(Aa,e)?Aa[e]:"submit"}const Ea=Symbol.for("@blogmcp/sdk/CommunityTransportError");function wf(e){return typeof e=="number"&&Number.isInteger(e)&&e>=100&&e<=599?e:null}function $f(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.ceil(e):null}class Ma extends Error{status;retryAfterS;constructor(t,n={}){super(t),this.name="CommunityTransportError",this.status=wf(n.status),this.retryAfterS=$f(n.retryAfterS),Object.defineProperty(this,Ea,{value:!0})}}function xf(e){return e instanceof Ma?!0:e instanceof Error&&e[Ea]===!0}function If(e){return xf(e)&&e.retryAfterS!==null?{ok:!1,code:"unavailable",retryAfterS:e.retryAfterS}:{ok:!1,code:"unavailable"}}function Tf(e){return e==="unavailable"||e==="submit"||e==="method"||e==="origin"||e==="invalid"||e==="ledger"}const ie=(e,t,n)=>Object.freeze({name:e,method:"POST",path:n,surface:t}),Cf=Object.freeze({"discussions.list":ie("discussions.list","public","/community/v1/public/discussions/list"),"discussions.head":ie("discussions.head","public","/community/v1/public/discussions/head"),"messages.post":ie("messages.post","public","/community/v1/public/messages/post"),"messages.edit":ie("messages.edit","public","/community/v1/public/messages/edit"),"messages.delete":ie("messages.delete","public","/community/v1/public/messages/delete"),"messages.report":ie("messages.report","public","/community/v1/public/messages/report"),"reactions.set":ie("reactions.set","public","/community/v1/public/reactions/set"),"blocks.set":ie("blocks.set","public","/community/v1/public/blocks/set"),"blocks.list":ie("blocks.list","public","/community/v1/public/blocks/list"),"profile.get":ie("profile.get","public","/community/v1/public/profile/get"),"me.get":ie("me.get","public","/community/v1/public/me/get"),"me.onboard":ie("me.onboard","public","/community/v1/public/me/onboard"),"me.updateProfile":ie("me.updateProfile","public","/community/v1/public/me/profile/update"),"me.notifications.list":ie("me.notifications.list","public","/community/v1/public/me/notifications/list"),"me.notifications.markRead":ie("me.notifications.markRead","public","/community/v1/public/me/notifications/mark-read"),"me.notifications.unreadCount":ie("me.notifications.unreadCount","public","/community/v1/public/me/notifications/unread-count"),"me.settings.get":ie("me.settings.get","public","/community/v1/public/me/settings/get"),"me.settings.update":ie("me.settings.update","public","/community/v1/public/me/settings/update"),"me.settings.unsubscribeDigest":ie("me.settings.unsubscribeDigest","public","/community/v1/public/me/settings/unsubscribe-digest"),"me.mutes.set":ie("me.mutes.set","public","/community/v1/public/me/mutes/set"),"me.mutes.list":ie("me.mutes.list","public","/community/v1/public/me/mutes/list"),"me.push.vapid":ie("me.push.vapid","public","/community/v1/public/me/push/vapid"),"me.push.subscribe":ie("me.push.subscribe","public","/community/v1/public/me/push/subscribe"),"me.push.unsubscribe":ie("me.push.unsubscribe","public","/community/v1/public/me/push/unsubscribe"),"me.push.status":ie("me.push.status","public","/community/v1/public/me/push/status"),"me.realtime.token":ie("me.realtime.token","public","/community/v1/public/me/realtime/token"),"realtime.subscribeToken":ie("realtime.subscribeToken","public","/community/v1/public/realtime/subscribe-token"),"me.decisions.list":ie("me.decisions.list","public","/community/v1/public/me/decisions/list"),"me.decisions.get":ie("me.decisions.get","public","/community/v1/public/me/decisions/get"),"me.appeals.file":ie("me.appeals.file","public","/community/v1/public/me/appeals/file"),"me.appeals.withdraw":ie("me.appeals.withdraw","public","/community/v1/public/me/appeals/withdraw"),"me.appeals.list":ie("me.appeals.list","public","/community/v1/public/me/appeals/list"),"me.reports.list":ie("me.reports.list","public","/community/v1/public/me/reports/list"),"me.consents.withdraw":ie("me.consents.withdraw","public","/community/v1/public/me/consents/withdraw"),"me.export":ie("me.export","public","/community/v1/public/me/export"),"me.erase":ie("me.erase","public","/community/v1/public/me/erase"),"me.cancelErase":ie("me.cancelErase","public","/community/v1/public/me/erase/cancel"),"legal.current":ie("legal.current","public","/community/v1/public/legal/current"),"forum.categories.list":ie("forum.categories.list","public","/community/v1/public/forum/categories/list"),"forum.topics.list":ie("forum.topics.list","public","/community/v1/public/forum/topics/list"),"forum.topics.get":ie("forum.topics.get","public","/community/v1/public/forum/topics/get"),"forum.topics.head":ie("forum.topics.head","public","/community/v1/public/forum/topics/head"),"forum.topics.create":ie("forum.topics.create","public","/community/v1/public/forum/topics/create"),"forum.search":ie("forum.search","public","/community/v1/public/forum/search"),"me.follows.set":ie("me.follows.set","public","/community/v1/public/me/follows/set"),"me.follows.list":ie("me.follows.list","public","/community/v1/public/me/follows/list"),"moderation.queue":ie("moderation.queue","public","/community/v1/public/moderation/queue"),"moderation.getCase":ie("moderation.getCase","public","/community/v1/public/moderation/cases/get"),"moderation.decide":ie("moderation.decide","public","/community/v1/public/moderation/decide"),"moderation.remove":ie("moderation.remove","public","/community/v1/public/moderation/remove"),"moderation.escalate":ie("moderation.escalate","public","/community/v1/public/moderation/escalate"),"moderation.setTopicState":ie("moderation.setTopicState","public","/community/v1/public/moderation/topics/set-state"),"moderation.moveTopic":ie("moderation.moveTopic","public","/community/v1/public/moderation/topics/move"),"moderation.pinTopic":ie("moderation.pinTopic","public","/community/v1/public/moderation/topics/pin"),"moderation.reviewPremod":ie("moderation.reviewPremod","public","/community/v1/public/moderation/premod/review"),"notices.submit":ie("notices.submit","notice","/trust/v1/notices/submit"),"notices.status":ie("notices.status","notice","/trust/v1/notices/status"),"notices.appeal":ie("notices.appeal","notice","/trust/v1/notices/appeal"),"notices.withdrawAppeal":ie("notices.withdrawAppeal","notice","/trust/v1/notices/appeal/withdraw")}),Pa="/community";function Sf(e){return e.surface==="public"&&e.path.startsWith(`${Pa}/`)?e.path.slice(Pa.length):e.path}const In=4e3,Af=2,ss=1e3,Tn=4e3,mi=4e3,Ra=120,Of=2,Na=80,yo=/^[a-z0-9][a-z0-9_]{2,29}$/,ja=30,Ef=50,is=200,za=30,Mf=50,pi=2,rs=200,La=5,Pf=500,Rf=/^[a-z0-9][a-z0-9-]{0,62}$/,Nf="community_notice",jf="good_faith";function as(){const e=globalThis.crypto;if(typeof e?.randomUUID=="function")return e.randomUUID();const t=e.getRandomValues(new Uint8Array(16));t[6]=(t[6]??0)&15|64,t[8]=(t[8]??0)&63|128;const n=Array.from(t,s=>s.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}const mn=(e,t)=>typeof t=="string"&&e.includes(t),zf=Object.freeze(["visible","held","removed","deleted"]),Lf=e=>mn(zf,e),Df=Object.freeze(["member","staff","system"]),Da=e=>mn(Df,e),Ff=Object.freeze(["sign_in","onboarding","reconsent_rules","art9_consent"]),Wn=e=>mn(Ff,e),Uf=Object.freeze(["restriction","suspension","ban"]),qf=e=>mn(Uf,e),Fa=Object.freeze(["decision","appeal_resolved","erasure_scheduled","inactivity_warning","module_read_only","module_braked","reply","mention","module_push_reset","age_limit_changed","topic_update","category_topic"]),Ua=e=>mn(Fa,e),Bf=Object.freeze(["new","member","regular","trusted"]),hi=Object.freeze(["fraud_spam","harassment","hate","threats","sexual_content","child_at_risk","self_harm","doxxing","copyright","terrorism","drugs","other_illegal","rules","adverse_event","third_party_health_data","suspected_minor"]),Hf="child_at_risk",ls=Object.freeze(hi.filter(e=>e!=="rules"&&e!=="adverse_event"&&e!=="third_party_health_data"&&e!=="suspected_minor")),Vf=Object.freeze(["recorded","reported_to_authority","not_adverse"]),Kf=Object.freeze(["16_17","18_plus"]);function Wf(e){return typeof e=="object"&&e!==null&&Da(e.kind)}const Yf=Object.freeze(["dark","live","read_only","braked"]),Yn=e=>mn(Yf,e),Gf=e=>e==="split"?"split":"joint",qa=e=>e==="public_write"?"public_write":"read_only";function Gn(e){const t=typeof e=="object"&&e!==null?e.rules:void 0;if(!Array.isArray(t))return[];const n=[];for(const s of t){if(typeof s!="object"||s===null)continue;const{id:o,title:r,summary:a,anchor:l}=s;typeof o!="string"||typeof r!="string"||typeof l!="string"||n.push(Object.freeze({id:o,title:r,summary:typeof a=="string"?a:null,anchor:l}))}return n}const Zf=2;function Jf(e){const t=typeof e=="object"&&e!==null?e.controllers:void 0;if(!Array.isArray(t))return[];const n=[];for(const s of t){if(n.length>=Zf)break;if(typeof s!="object"||s===null)continue;const{entity:o,label:r}=s;typeof o!="string"||typeof r!="string"||o.trim()===""||r.trim()===""||n.push(Object.freeze({entity:o,label:r.trim()}))}return n}const Xf=Object.freeze(["open","locked","archived"]),Qf=e=>mn(Xf,e),em=Object.freeze(["forum","article_discussions"]),tm=e=>mn(em,e),nm=Object.freeze(["no_action","visibility_restricted","removal"]),om=/^(?:\/[A-Za-z0-9_~-][A-Za-z0-9._~-]*)*\/?$/;function Ba(e){return typeof e=="string"&&e.startsWith("/")&&om.test(e)&&!/(^|\/)\.\.?(\/|$)/.test(e)}function Ha(e){if(!Ba(e))throw new TypeError('[blogmcp-sdk] the community client takes a relative base on the page’s own origin (e.g. "/api/community"), never an absolute URL: kb-api’s community routes are reached only through the host’s proxy or BFF');return e.replace(/\/+$/,"")}function sm(e,t){return`${e.replace(/\/+$/,"")}${Sf(t)}`}function im(e,t){if(e===null||e.trim()==="")return;const n=e.trim();if(/^\d+$/.test(n))return Number(n);const s=Date.parse(n);return Number.isFinite(s)?Math.max(0,Math.ceil((s-t)/1e3)):void 0}function rm(e,t={}){const n=Ha(e),s=t.now??Date.now,o=t.fetch??(()=>globalThis.fetch);return async(r,a,l)=>{let c;try{c=await o()(sm(n,r),{method:r.method,headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a??{}),mode:"same-origin",credentials:"same-origin",cache:"no-store",redirect:"error",signal:l})}catch{throw new Ma(l.aborted?"community request aborted or timed out":"community request failed")}let p=null;try{const b=await c.text();p=b===""?null:JSON.parse(b)}catch{p=null}const h=im(c.headers.get("Retry-After"),s());return h===void 0?{status:c.status,body:p}:{status:c.status,body:p,retryAfterS:h}}}const Va=1e4,am=2147483647;let Ka=!1;function lm(e){if(e===void 0)return Va;const t=typeof e=="number"?Math.floor(e):Number.NaN;return t>=1&&t<=am?t:(Ka||(Ka=!0,console.warn("[community] timeoutMs is not a number of milliseconds from 1 to 2147483647 — the default 10 s is used.")),Va)}const ot=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Cn=e=>typeof e=="string",pn=Array.isArray,cm=Object.freeze({string:Cn,number:e=>typeof e=="number",boolean:e=>typeof e=="boolean",array:pn,record:ot}),se=e=>Object.freeze({...e}),um=Object.freeze({"discussions.list":se({articleId:"string",messages:"array",viewer:"record"}),"discussions.head":se({heads:"array"}),"messages.post":se({message:"record",warnings:"array"}),"messages.edit":se({message:"record",warnings:"array"}),"messages.delete":se({message:"record"}),"messages.report":se({caseId:"string"}),"reactions.set":se({reactions:"record"}),"blocks.set":se({blocked:"boolean"}),"blocks.list":se({blocks:"array"}),"profile.get":se({author:"record"}),"me.get":se({needs:"array"}),"me.onboard":se({needs:"array"}),"me.updateProfile":se({profile:"record"}),"me.notifications.list":se({items:"array"}),"me.notifications.markRead":se({updated:"number"}),"me.notifications.unreadCount":se({count:"number"}),"me.settings.get":se({settings:"record"}),"me.settings.update":se({settings:"record"}),"me.settings.unsubscribeDigest":se({unsubscribed:"boolean"}),"me.mutes.set":se({muted:"boolean"}),"me.mutes.list":se({items:"array"}),"me.push.vapid":se({publicKey:"string",keyId:"string"}),"me.push.subscribe":se({subscribed:"boolean",keyId:"string"}),"me.push.unsubscribe":se({unsubscribed:"boolean"}),"me.push.status":se({subscribed:"boolean"}),"me.realtime.token":se({token:"string",url:"string",expiresInS:"number"}),"realtime.subscribeToken":se({token:"string"}),"me.decisions.list":se({items:"array"}),"me.decisions.get":se({decisionId:"string"}),"me.appeals.file":se({appealId:"string"}),"me.appeals.withdraw":se({appealId:"string"}),"me.appeals.list":se({items:"array"}),"me.reports.list":se({items:"array"}),"me.consents.withdraw":se({state:"string"}),"me.export":se({generatedAt:"string"}),"me.erase":se({purgeAfter:"string"}),"me.cancelErase":se({status:"string"}),"legal.current":se({textId:"string"}),"notices.submit":se({caseId:"string",receipt:"string"}),"notices.status":se({status:"string"}),"notices.appeal":se({appealId:"string"}),"notices.withdrawAppeal":se({appealId:"string"}),"forum.categories.list":se({categories:"array"}),"forum.topics.list":se({category:"record",items:"array"}),"forum.topics.get":se({topic:"record",messages:"array",viewer:"record"}),"forum.topics.head":se({heads:"array"}),"forum.topics.create":se({topic:"record",message:"record",warnings:"array"}),"forum.search":se({results:"array",page:"number",hasMore:"boolean"}),"me.follows.set":se({following:"boolean"}),"me.follows.list":se({follows:"array"}),"moderation.queue":se({items:"array"}),"moderation.getCase":se({case:"record"}),"moderation.decide":se({dryRun:"boolean",statement:"string"}),"moderation.remove":se({decision:"record",statement:"string"}),"moderation.escalate":se({}),"moderation.setTopicState":se({topic:"record"}),"moderation.moveTopic":se({topic:"record"}),"moderation.pinTopic":se({topic:"record"}),"moderation.reviewPremod":se({})}),dm=Object.freeze({"moderation.reviewPremod":Object.freeze([se({message:"record"}),se({decision:"record",statement:"string"})])}),Wa=(e,t)=>Object.entries(e).every(([n,s])=>cm[s](t[n])),fm=(e,t)=>{if(!Wa(um[e],t))return!1;const n=dm[e];return n===void 0||n.some(s=>Wa(s,t))};function pt(e,t){const n={};if(!ot(e))return n;for(const s of t)e[s]!==void 0&&(n[s]=e[s]);return n}function Ya(e){return ot(e)?"conversationId"in e?pt(e,["conversationId","seq"]):"memberId"in e?pt(e,["memberId"]):"handle"in e?pt(e,["handle"]):pt(e,["articleId"]):e}const Ga=/^[A-Za-z0-9_.:-]{1,64}$/,cs=20;function mm(e){if(pn(e))return e.filter(t=>Cn(t)&&Ga.test(t)).slice(0,cs)}function pm(e){return pn(e)?e.filter(Wn).slice(0,cs):void 0}function hm(e){return pn(e)?e.map(n=>ot(n)?n.path:n).filter(n=>Cn(n)&&n.length<=128).slice(0,cs):void 0}function bm(e){if(!pn(e))return;const t=e.map(n=>ot(n)?n.code:void 0).filter(n=>Cn(n)&&Ga.test(n));return t.length>0?[...new Set(t)].slice(0,cs):void 0}const gm=/^[a-z][a-z0-9_]{0,63}$/;function vm(e){return Cn(e)&&gm.test(e)?e:void 0}function ym(e){return ot(e)?"conversationId"in e?pt(e,["conversationId"]):pt(e,["categoryId"]):e}function us(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.ceil(e):void 0}function _m(e,t){const n={ok:!1,code:kf(e.code)},s=us(e.retryAfterS)??us(t.retryAfterS);s!==void 0&&(n.retryAfterS=s);const o=pm(e.needs);o&&(n.needs=o);const r=mm(e.codes);r&&(n.codes=r),Cn(e.until)&&(n.until=e.until);const a=vm(e.surface);a!==void 0&&(n.surface=a);const l=hm(e.issues);l&&(n.fields=l);const c=bm(e.issues);return c&&(n.issueCodes=c),n}function km(e){Ha(e?.base);const t=e.transport??rm(e.base,e.now?{now:e.now}:{}),n=lm(e.timeoutMs),s=e.logger,o=(c,p,h,b)=>{if(!(!s||!Tf(p)))try{s({op:c,outcome:p,kbCode:h,status:b})}catch{}};async function r(c,p,h){const b=Cf[c],_=new AbortController,$=h?.signal,y=()=>_.abort();$?.aborted?_.abort():$?.addEventListener("abort",y,{once:!0});const I=setTimeout(()=>_.abort(),n);let R;try{R=await t(b,p,_.signal)}catch(k){const M=If(k);return $?.aborted||o(c,M.code,null,null),M}finally{clearTimeout(I),$?.removeEventListener("abort",y)}const P=typeof R?.status=="number"?R.status:0,T=R?.body;if(ot(T)&&T.ok===!1&&Cn(T.code)&&T.code!==""){const k=_m(T,R);return o(c,k.code,T.code.slice(0,64),P),k}if(P>=200&&P<300&&ot(T)&&T.ok===!0){const{ok:k,...M}=T;return fm(c,M)?{ok:!0,value:M}:(o(c,"unavailable",null,P),{ok:!1,code:"unavailable"})}if(P===429){const k=us(R.retryAfterS);return k===void 0?{ok:!1,code:"fast"}:{ok:!1,code:"fast",retryAfterS:k}}o(c,"unavailable",null,P);const g=P===503?us(R.retryAfterS):void 0;return g===void 0?{ok:!1,code:"unavailable"}:{ok:!1,code:"unavailable",retryAfterS:g}}const a=(c,p)=>(h,b)=>r(c,pt(h,p),b),l=c=>p=>r(c,{},p);return{discussions:{list:a("discussions.list",["articleId","languageCode","cursor"]),head:(c,p)=>r("discussions.head",{articleIds:ot(c)&&pn(c.articleIds)?[...c.articleIds]:[]},p)},messages:{post:a("messages.post",["articleId","conversationId","body","replyToSeq","clientMsgId","languageCode","confirmations"]),edit:a("messages.edit",["conversationId","seq","body","title","confirmations"]),delete:a("messages.delete",["conversationId","seq"]),report:a("messages.report",["conversationId","seq","category","ruleId","note"])},reactions:{set:(c,p)=>r("reactions.set",{target:Ya(c?.target),emoji:c?.emoji??null},p)},blocks:{set:a("blocks.set",["memberId","blocked"]),list:l("blocks.list")},profile:{get:(c,p)=>r("profile.get",ot(c)&&"handle"in c?pt(c,["handle"]):pt(c,["memberId"]),p)},me:{get:l("me.get"),onboard:a("me.onboard",["ageBand","rulesTextId","termsTextId","art9TextId","art9Refused","displayName","handle","avatarPreset"]),updateProfile:a("me.updateProfile",["displayName","handle","avatarPreset","bio"]),notifications:{list:a("me.notifications.list",["cursor","unreadOnly","codes"]),markRead:(c,p)=>r("me.notifications.markRead",ot(c)&&"all"in c?{all:c.all}:{ids:ot(c)&&pn(c.ids)?[...c.ids]:[]},p),unreadCount:l("me.notifications.unreadCount")},settings:{get:l("me.settings.get"),update:a("me.settings.update",["notifyReply","notifyMention","notifyTopic","pushEnabled","digestEmail","quietHours"]),unsubscribeDigest:a("me.settings.unsubscribeDigest",["token"])},mutes:{set:a("me.mutes.set",["targetKind","targetId","muted"]),list:l("me.mutes.list")},push:{vapid:l("me.push.vapid"),subscribe:(c,p)=>r("me.push.subscribe",{...pt(c,["endpoint","userAgentClass"]),...ot(c)&&ot(c.keys)?{keys:pt(c.keys,["p256dh","auth"])}:{}},p),unsubscribe:a("me.push.unsubscribe",["endpoint"]),status:a("me.push.status",["endpoint"])},realtime:{token:l("me.realtime.token")},decisions:{list:a("me.decisions.list",["cursor"]),get:a("me.decisions.get",["decisionId"])},appeals:{file:a("me.appeals.file",["decisionId","body"]),withdraw:a("me.appeals.withdraw",["appealId"]),list:l("me.appeals.list")},reports:{list:l("me.reports.list")},consents:{withdraw:(c,p)=>r("me.consents.withdraw",{kind:"art9_consent"},p)},follows:{set:(c,p)=>{const h=pt(c,["target","following"]);return h.target!==void 0&&(h.target=ym(h.target)),r("me.follows.set",h,p)},list:a("me.follows.list",["cursor"])},export:l("me.export"),erase:l("me.erase"),cancelErase:l("me.cancelErase")},legal:{current:a("legal.current",["kind","locale"])},realtime:{subscribeToken:a("realtime.subscribeToken",["channel"])},forum:{categories:{list:l("forum.categories.list")},topics:{list:a("forum.topics.list",["categoryId","categorySlug","sort","cursor","limit"]),get:a("forum.topics.get",["conversationId","languageCode","cursor"]),head:(c,p)=>r("forum.topics.head",{conversationIds:ot(c)&&pn(c.conversationIds)?[...c.conversationIds]:[]},p),create:a("forum.topics.create",["categoryId","title","body","clientMsgId","languageCode","confirmations"])},search:a("forum.search",["query","categoryId","space","page"])},moderation:{queue:a("moderation.queue",["categoryId","cursor"]),getCase:a("moderation.getCase",["caseId"]),decide:a("moderation.decide",["caseId","restriction","basis","facts","contractualGround","locale","dryRun"]),remove:a("moderation.remove",["conversationId","seq","ruleId","facts","locale"]),escalate:a("moderation.escalate",["conversationId","seq","category"]),setTopicState:a("moderation.setTopicState",["conversationId","state"]),moveTopic:a("moderation.moveTopic",["conversationId","categoryId"]),pinTopic:a("moderation.pinTopic",["conversationId","pinned"]),reviewPremod:a("moderation.reviewPremod",["conversationId","seq","rev","outcome","ruleId","facts","locale"])},notices:{submit:(c,p)=>{const h=pt(c,["category","target","description","ruleId","turnstileToken","confirmations"]);return h.target!==void 0&&(h.target=Ya(h.target)),ot(c?.notifier)?h.notifier=pt(c.notifier,["name","email","locale"]):c?.notifier===null&&(h.notifier=null),r("notices.submit",h,p)},status:a("notices.status",["receipt"]),appeal:a("notices.appeal",["receipt","body"]),withdrawAppeal:a("notices.withdrawAppeal",["receipt"])}}}const wm=/FBAN|FBAV|Instagram/;function $m(e){const t=typeof e=="string"?e:typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:"";return wm.test(t)}const Ft=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ae=e=>typeof e=="string"?e:null,_o=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>0,ds=Object.freeze({counts:Object.freeze({}),mine:null});function ko(e){if(!Ft(e))return ds;const t={};if(Ft(e.counts))for(const[n,s]of Object.entries(e.counts))typeof s=="number"&&Number.isSafeInteger(s)&&s>0&&(t[n]=s);return Object.freeze({counts:Object.freeze(t),mine:Ae(e.mine)})}const Za=Object.freeze({kind:"member",memberId:null,handle:null,displayName:null,avatarPreset:null,deleted:!0}),xm=Object.freeze({kind:"system"});function bi(e){if(!Ft(e)||!Da(e.kind))return null;if(e.kind==="system")return xm;if(e.kind==="staff")return Object.freeze({kind:"staff",staffId:Ae(e.staffId)??"",displayName:Ae(e.displayName)??"",badge:Ae(e.badge)??""});const t=Ae(e.memberId),n=Ae(e.handle),s=Ae(e.displayName);return t===null||n===null||s===null||e.deleted===!0?Za:Object.freeze({kind:"member",memberId:t,handle:n,displayName:s,avatarPreset:Ae(e.avatarPreset),...e.moderator===!0?{moderator:!0}:{}})}function Ja(e){if(Array.isArray(e))return Object.freeze(e.filter(t=>typeof t=="string"))}function wo(e,t){if(!Ft(e))return null;const n=bi(e.author);if(n===null||!Lf(e.state))return null;const s=Ae(e.conversationId),o=Ae(e.id);if(s===null||o===null||!_o(e.seq))return null;const r=Ae(e.body),a=[];if(t&&Array.isArray(e.replies))for(const c of e.replies){const p=wo(c,!1);p&&a.push(p)}const l=Ja(e.notes);return Object.freeze({conversationId:s,seq:e.seq,id:o,rev:typeof e.rev=="number"?e.rev:0,replyToSeq:t?null:_o(e.replyToSeq)?e.replyToSeq:null,author:n,state:e.state,body:r,displayBody:Ae(e.displayBody)??r,displayLanguageCode:Ae(e.displayLanguageCode),sourceLanguageCode:Ae(e.sourceLanguageCode),isTranslated:e.isTranslated===!0,isEdited:e.isEdited===!0,createdAt:Ae(e.createdAt)??"",editedAt:Ae(e.editedAt),collapsed:e.collapsed===!0,reactions:ko(e.reactions),translationVersionId:Ae(e.translationVersionId),...l&&l.length>0?{notes:l}:{},...e.hiddenUntilConsent===!0&&e.state==="held"?{hiddenUntilConsent:!0}:{},...e.premoderated===!0&&e.state==="held"?{premoderated:!0}:{},replies:Sn(a),...t&&e.repliesTruncated===!0?{repliesTruncated:!0}:{}})}function Im(e){const t=Ft(e)?e:{},n=Array.isArray(t.needs)?t.needs.filter(Wn):[],s=[];if(Array.isArray(t.restrictions))for(const o of t.restrictions)!Ft(o)||!qf(o.kind)||typeof o.decisionId!="string"||s.push(Object.freeze({kind:o.kind,scope:Ae(o.scope)??"",endsAt:Ae(o.endsAt),decisionId:o.decisionId}));return Object.freeze({memberId:Ae(t.memberId),canPost:t.canPost===!0,needs:Object.freeze([...new Set(n)]),restrictions:Object.freeze(s)})}const Tm=Object.freeze({memberId:null,canPost:!1,needs:Object.freeze([]),restrictions:Object.freeze([])}),gi=Object.freeze({articleId:null,conversationId:null,count:0,lastSeq:0,lastChangeAt:null,messages:Object.freeze([]),nextCursor:null,articleReactions:ds,reactionSet:Object.freeze([]),preset:null,viewer:Tm,loaded:!1,stale:!1}),Cm=(e,t)=>e===null?t:t===null?e:Date.parse(t)>Date.parse(e)?t:e;function Sn(e){const t=e.filter(s=>s.seq>0).sort((s,o)=>s.seq-o.seq),n=e.filter(s=>s.seq<0).sort((s,o)=>o.seq-s.seq);return Object.freeze([...t,...n])}function Zt(e,t){let n=!1;const s=[];for(const o of e){let r=t(o);if(r!==null&&r.replies.length>0){const a=Zt(r.replies,t);a!==r.replies&&(r=Object.freeze({...r,replies:a}))}r!==o&&(n=!0),r!==null&&s.push(r)}return n?Object.freeze(s):e}function hn(e,t){for(const n of e){if(t(n))return n;for(const s of n.replies)if(t(s))return s}return null}function vi(e,t){return Zt(e,n=>n.seq===t.seq?n.replyToSeq===null&&t.replyToSeq===null?Object.freeze({...t,replies:n.replies}):t:n)}function Xa(e,t){if(hn(e,s=>s.seq===t.seq))return vi(e,t);if(t.replyToSeq===null)return Sn([...e,t]);const n=e.find(s=>s.seq===t.replyToSeq);return n?Object.freeze(e.map(s=>s===n?Object.freeze({...s,replies:Sn([...s.replies,t])}):s)):e}const Qa=e=>e.replyToSeq===null&&e.replies.length>0,el=(e,t)=>e.toLowerCase()===t.toLowerCase(),tl=e=>e.author.kind==="member"&&e.author.memberId!==null?e.author.memberId.toLowerCase():null,Sm=256,nl=new WeakMap;function ol(){let e=gi;const t=new Set,n=new Map,s=new Set;let o=0,r=-1;const a=new Set,l=()=>{o+=1,a.clear();for(const v of n.keys())s.delete(v),s.add(v);n.clear();for(const v of s){if(s.size<=Sm)break;s.delete(v)}},c=v=>{if(v!==e){e=Object.freeze(v);for(const x of[...t])try{x(e)}catch{}}};function p(v,x={}){if(!Ft(v))return;const N=Ae(v.articleId)?.toLowerCase()??null,O=e.articleId!==null&&N!==null&&N!==e.articleId,E=O?gi:e;O&&l();const B=typeof x.cursor=="number"&&Number.isFinite(x.cursor)?x.cursor:null,ee=B??0,re=typeof v.nextCursor=="number"&&Number.isFinite(v.nextCursor)?v.nextCursor:null,be=re??Number.POSITIVE_INFINITY,we=new Map;for(const oe of Array.isArray(v.messages)?v.messages:[]){const Z=wo(oe,!0);Z&&Z.seq>ee&&Z.seq<=be&&we.set(Z.seq,Z)}for(const oe of we.values())for(const Z of[oe,...oe.replies]){const J=tl(Z);J===null||Z.body===null||(Z.collapsed?a.add(J):a.delete(J))}const K=new Map;for(const oe of E.messages){const Z=[oe,...oe.replies];for(const J of Z)J.pending&&J.pending!=="post"&&J.clientMsgId&&K.set(J.seq,J)}const D=oe=>{const Z=K.get(oe.seq);if(!Z)return oe;const J=Z.clientMsgId?n.get(Z.clientMsgId):void 0;return J&&(J.before=oe),Z.replyToSeq===null?Object.freeze({...Z,replies:oe.replies}):Z},U=E.messages.filter(oe=>oe.seq<0||oe.seq<=ee||oe.seq>be),Fe=new Map;for(const oe of E.messages)for(const Z of oe.replies)Z.seq<0&&Z.replyToSeq!==null&&Fe.set(Z.replyToSeq,[...Fe.get(Z.replyToSeq)??[],Z]);const je=[...U.filter(oe=>!we.has(oe.seq)),...we.values()].map(oe=>{if(!we.has(oe.seq))return oe;const Z=D(oe),J=Z.replies.map(D),W=Fe.get(oe.seq)??[];return J.some((pe,Ht)=>pe!==Z.replies[Ht])||W.length>0?Object.freeze({...Z,replies:Sn([...J,...W])}):Z}),Ue=E.loaded?E.nextCursor:0,Qe=Ue===null?null:ee>Ue?Ue:re===null?null:Math.max(Ue,re);c({articleId:N??E.articleId,conversationId:Ae(v.conversationId)??E.conversationId,count:typeof v.count=="number"&&v.count>=0?v.count:E.count,lastSeq:Math.max(typeof v.lastSeq=="number"?v.lastSeq:0,E.lastSeq),lastChangeAt:Cm(E.lastChangeAt,Ae(v.lastChangeAt)),messages:Sn(je),nextCursor:Qe,articleReactions:ko(v.articleReactions),reactionSet:Object.freeze(Array.isArray(v.reactionSet)?v.reactionSet.filter(oe=>typeof oe=="string"):[]),preset:Ae(v.preset),viewer:Im(v.viewer),loaded:!0,stale:B===null?!1:E.stale})}function h(v){if(n.has(v.clientMsgId))return;const x=_o(v.replyToSeq)?v.replyToSeq:null;if(x!==null&&!e.messages.some(B=>B.seq===x))return;const N=bi(v.author)??Za,O=Object.freeze({conversationId:e.conversationId??"",seq:r--,id:`pending:${v.clientMsgId}`,rev:0,replyToSeq:x,author:N,state:"visible",body:v.body,displayBody:v.body,displayLanguageCode:v.languageCode??null,sourceLanguageCode:v.languageCode??null,isTranslated:!1,isEdited:!1,createdAt:v.createdAt??new Date().toISOString(),editedAt:null,collapsed:!1,reactions:ds,translationVersionId:null,replies:Object.freeze([]),pending:"post",clientMsgId:v.clientMsgId});n.set(v.clientMsgId,{type:"post",before:null});const E=x===null?Sn([...e.messages,O]):Object.freeze(e.messages.map(B=>B.seq===x?Object.freeze({...B,replies:Sn([...B.replies,O])}):B));c({...e,messages:E})}function b(v){if(n.has(v.clientMsgId))return;const x=hn(e.messages,O=>O.seq===v.seq);if(!x||x.pending)return;n.set(v.clientMsgId,{type:v.type,before:x});const N=v.type==="edit"?Object.freeze({...x,body:v.body,displayBody:v.body,displayLanguageCode:x.sourceLanguageCode,isTranslated:!1,isEdited:!0,pending:"edit",clientMsgId:v.clientMsgId}):Object.freeze({...x,pending:"delete",clientMsgId:v.clientMsgId});c({...e,messages:Zt(e.messages,O=>O===x?N:O)})}const _=v=>e.conversationId===null||el(v.conversationId,e.conversationId);function $(v){const x=n.get(v.clientMsgId);if(!x&&s.has(v.clientMsgId))return;n.delete(v.clientMsgId);const N=wo(v.message,v.message?.replyToSeq===null||v.message?.replyToSeq===void 0),O=N&&_(N)?N:null,E=Zt(e.messages,K=>K.clientMsgId===v.clientMsgId&&K.pending==="post"?null:K.clientMsgId===v.clientMsgId?sl(K):K);if(!O){E!==e.messages&&c({...e,messages:E});return}const B=v.warnings?Ja(v.warnings):void 0,ee=B&&B.length>0?Object.freeze({...O,warnings:B}):O,re=hn(E,K=>K.seq===ee.seq);let be,we=e.count;if(ee.state==="deleted"||x?.type==="delete"){const K=re??null,D=K?.state==="visible"&&K.body!==null;be=Zt(E,U=>U.seq!==ee.seq?U:Qa(U)?Object.freeze({...ee,replies:U.replies}):null),D&&(we=Math.max(0,we-1))}else be=Xa(E,ee),!re&&ee.state==="visible"&&(we+=1);c({...e,conversationId:e.conversationId??(x?ee.conversationId:null),lastSeq:Math.max(e.lastSeq,ee.seq),count:we,messages:be})}function y(v){const x=n.get(v);if(!x)return;n.delete(v);const N=Zt(e.messages,O=>{if(O.clientMsgId!==v)return O;if(x.type==="post")return null;const E=x.before;return E?O.replyToSeq===null?Object.freeze({...E,replies:O.replies}):E:sl(O)});N!==e.messages&&c({...e,messages:N})}function I(v){const x=wo(v,v?.replyToSeq===null||v?.replyToSeq===void 0);!x||!hn(e.messages,N=>N.seq===x.seq&&!N.pending&&el(N.conversationId,x.conversationId))||c({...e,messages:vi(e.messages,x)})}function R(v){if(Ft(v))switch(v.type){case"post":return h(v);case"edit":case"delete":return b(v);case"confirm":return $(v);case"rollback":return y(v.clientMsgId);case"server":return I(v.message)}}function P(v){if(!Ft(v)||!e.loaded||e.articleId===null||Ae(v.articleId)?.toLowerCase()!==e.articleId)return!1;if(e.stale)return!0;const x=typeof v.lastSeq=="number"&&v.lastSeq>e.lastSeq,N=typeof v.count=="number"&&v.count!==e.count,O=Ae(v.lastChangeAt),E=O!==null&&(e.lastChangeAt===null||Date.parse(O)>Date.parse(e.lastChangeAt));return!x&&!N&&!E?!1:(c({...e,stale:!0}),!0)}function T(v,x){if(!Ft(v))return;const N=ko(x);if("articleId"in v){if(Ae(v.articleId)?.toLowerCase()!==e.articleId)return;c({...e,articleReactions:N});return}const{conversationId:O,seq:E}=v;if(!_o(E)||typeof O!="string")return;const B=O.toLowerCase(),ee=Zt(e.messages,re=>re.seq===E&&re.conversationId.toLowerCase()===B?Object.freeze({...re,reactions:N}):re);ee!==e.messages&&c({...e,messages:ee})}function g(v,x){if(typeof v!="string"||v==="")return;const N=v.toLowerCase();x?a.add(N):a.delete(N);const O=Zt(e.messages,E=>E.author.kind==="member"&&E.author.memberId!==null&&E.author.memberId.toLowerCase()===N&&E.body!==null&&E.collapsed!==x?Object.freeze({...E,collapsed:x}):E);O!==e.messages&&c({...e,messages:O})}function k(v,x){const N=tl(v),O=v.body!==null&&N!==null&&a.has(N),E=x?x.reactions.mine:null,B=E===v.reactions.mine?v.reactions:Object.freeze({counts:v.reactions.counts,mine:E}),ee=x?.repliesTruncated===!0&&v.replyToSeq===null,re=x?.warnings;return O===v.collapsed&&B===v.reactions&&!ee&&!re?v:Object.freeze({...v,collapsed:O,reactions:B,...ee?{repliesTruncated:!0}:{},...re?{warnings:re}:{}})}function M(v){if(!Ft(v)||!e.loaded)return"dropped";const x=typeof v.rev=="number"&&Number.isSafeInteger(v.rev)&&v.rev>=0?v.rev:null;if(v.kind==="resync")return"resync";if(x===null)return"dropped";if(v.kind==="reaction"){if(v.seq===void 0){const je=ko(v.reactions);return c({...e,articleReactions:Object.freeze({counts:je.counts,mine:e.articleReactions.mine})}),"applied"}if(!_o(v.seq))return"dropped";const K=v.seq,D=hn(e.messages,je=>je.seq===K);if(!D||D.pending||x<D.rev)return"dropped";if(x>D.rev)return"resync";const U=ko(v.reactions),Fe=Object.freeze({counts:U.counts,mine:D.reactions.mine});return c({...e,messages:Zt(e.messages,je=>je===D?Object.freeze({...je,reactions:Fe}):je)}),"applied"}if(v.kind!=="message"&&v.kind!=="edit"&&v.kind!=="delete")return"dropped";const N=v.message,O=wo(N,N?.replyToSeq===null||N?.replyToSeq===void 0);if(!O||!_(O))return"dropped";const E=hn(e.messages,K=>K.seq===O.seq);if(E?.pending)return"dropped";const B=E?.rev??0;if(v.kind==="delete"){if(!E||x<=B)return"dropped";const K=E.state==="visible"&&E.body!==null,D=Zt(e.messages,U=>U.seq!==O.seq?U:Qa(U)?Object.freeze({...O,replies:U.replies}):null);return c({...e,messages:D,count:K?Math.max(0,e.count-1):e.count,lastSeq:Math.max(e.lastSeq,O.seq)}),"applied"}const ee=O.author.kind==="member"&&O.author.memberId!==null&&O.author.memberId===e.viewer.memberId;if(!E&&ee&&[...n.values()].some(K=>K.type==="post")||x<=B)return"dropped";if(x>B+1||!E&&O.replyToSeq!==null&&!e.messages.some(K=>K.seq===O.replyToSeq))return"resync";const re=k(O,E),be=E?vi(e.messages,re):Xa(e.messages,re),we=!E&&O.state==="visible"?e.count+1:e.count;return c({...e,messages:be,count:we,lastSeq:Math.max(e.lastSeq,O.seq)}),"applied"}const w={getState:()=>e,subscribe(v){return t.add(v),()=>{t.delete(v)}},applyPage:p,applyMessage:R,applyHead:P,applyReaction:T,collapse:g,applyEvent:M,reset(){l(),c(gi)}};return nl.set(w,()=>o),w}function sl(e){const{pending:t,clientMsgId:n,...s}=e;return Object.freeze(s)}function Ut(e){const t="viewer"in e?e.viewer.needs:e.needs,n=new Set(t.filter(Wn)),s=n.has("sign_in"),o=n.has("onboarding"),r=o||n.has("reconsent_rules"),a=n.has("art9_consent"),l=o&&!("viewer"in e)&&e.acceptances?.terms==="never";return Object.freeze({signIn:s,onboarding:o,rules:r,art9:a,terms:l,any:s||o||r||a})}function Zn(e,t){return hn(e.messages,n=>n.seq===t)}function Am(e,t){return t.author.kind==="member"&&t.author.memberId!==null&&t.author.memberId===e.viewer.memberId}function Om(e,t){if("articleId"in t)return e.articleReactions;const n=t.conversationId.toLowerCase();return hn(e.messages,o=>o.seq===t.seq&&o.conversationId.toLowerCase()===n)?.reactions??ds}function Em(e,t){const n={...e.counts},s=e.mine;if(s!==null){const o=(n[s]??0)-1;o>0?n[s]=o:delete n[s]}return t!==null&&(n[t]=(n[t]??0)+1),Object.freeze({counts:Object.freeze(n),mine:t})}const Mm=20;function yi(e){const t=nl.get(e);let n=t?.(),s=e.getState().articleId;return{moved:()=>t!==void 0&&t()!==n||e.getState().articleId!==s,mark(){n=t?.(),s=e.getState().articleId}}}const Pm=e=>typeof e=="number"&&Number.isFinite(e)?e:null;async function Rm(e,t,n,s){const o=e.getState(),r=o.loaded?o.nextCursor:0,a=yi(e);let l=null;for(let c=0;c<Mm;c++){const p=await t.discussions.list({articleId:n.articleId,languageCode:n.languageCode??null,cursor:l},s);if(!p.ok)return p;if(a.moved())break;e.applyPage(p.value,{cursor:l}),a.mark();const h=Pm(p.value.nextCursor);if(h===null||r!==null&&h>=r||l!==null&&h<=l)break;l=h}return{ok:!0,value:e.getState()}}async function Nm(e,t,n,s){const o=e.getState().nextCursor;if(o===null)return{ok:!0,value:e.getState()};const r=yi(e),a=await t.discussions.list({articleId:n.articleId,languageCode:n.languageCode??null,cursor:o},s);return a.ok?(r.moved()||e.applyPage(a.value,{cursor:o}),{ok:!0,value:e.getState()}):a}const jm=2e4,zm=5*6e4,Lm=6e4,Dm=(e,t)=>e.lastSeq===t.lastSeq&&e.count===t.count&&e.lastChangeAt===t.lastChangeAt;function Fm(e,t,n){return il({ask:(s,o)=>e.discussions.head({articleIds:s},o),keyOf:s=>typeof s?.articleId=="string"?s.articleId.toLowerCase():null,max:Ef,stopsOn:["surfaceOff"]},t,n)}function Um(e,t,n){return il({ask:(s,o)=>e.forum.topics.head({conversationIds:s},o),keyOf:s=>typeof s?.conversationId=="string"?s.conversationId.toLowerCase():null,max:Mf,stopsOn:["surfaceOff","membersOnly"]},t,n)}function il(e,t,n){const s=Math.max(1e3,n.intervalMs??jm),o=[...new Set((Array.isArray(t)?t:[]).filter(g=>typeof g=="string"&&g!==""))].slice(0,e.max),r=n.visible??(()=>typeof document>"u"||document.visibilityState!=="hidden"),a=new Map;let l=null,c=null,p=0,h=!1,b=!1;const _=g=>{b||(l&&clearTimeout(l),l=setTimeout(()=>{I()},g))},$=g=>{_(g),h=!0},y=()=>{!b&&!c&&!h&&_(0)};async function I(){if(l=null,h=!1,b||c)return;if(!r()){_(s);return}const g=new AbortController;c=g;const k={signal:g.signal},M=await e.ask(o,k);if(c=null,!b){if(M.ok){p=0;const w=[];for(const v of Array.isArray(M.value.heads)?M.value.heads:[]){const x=e.keyOf(v);if(x===null)continue;const N=a.get(x);a.set(x,v),(!N||!Dm(N,v))&&w.push(v)}if(w.length>0)try{n.onChange(w)}catch{}_(s);return}try{n.onFailure?.(M)}catch{}if(e.stopsOn.includes(M.code))return T();if(M.code==="fast"||M.code==="quota"){$(Math.max(s,M.retryAfterS!==void 0?M.retryAfterS*1e3:Lm));return}p=Math.min(zm,(p||s)*2),$(p)}}const R=()=>{r()&&y()},P=()=>T();function T(){b||(b=!0,l&&clearTimeout(l),l=null,c?.abort(),c=null,typeof document<"u"&&document.removeEventListener("visibilitychange",R),n.signal?.removeEventListener("abort",P))}return o.length===0||n.signal?.aborted?(b=!0,{stop:()=>{},now:()=>{}}):(typeof document<"u"&&document.addEventListener("visibilitychange",R),n.signal?.addEventListener("abort",P,{once:!0}),_(s),{stop:T,now:y})}const Tt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),An=e=>typeof e=="string"?e:null,qm=Object.freeze({counts:Object.freeze({}),mine:null}),Bm=Object.freeze({kind:"member",memberId:null,handle:null,displayName:null,avatarPreset:null,deleted:!0});function Hm(e){if(!Tt(e))return null;const t=An(e.id),n=An(e.slug),s=An(e.name);return t===null||n===null||s===null?null:Object.freeze({id:t,slug:n,name:s})}function rl(e){if(!Tt(e))return null;const t=An(e.conversationId);return t===null||t===""?null:Object.freeze({conversationId:t,category:Hm(e.category),title:An(e.title),state:An(e.state)??"open",pinned:e.pinned===!0,createdAt:An(e.createdAt)??"",author:bi(e.author)??Bm,following:e.following===!0})}const Vm=(e,t)=>e===t||e!==null&&t!==null&&e.id===t.id&&e.slug===t.slug&&e.name===t.name,Km=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function al(e,t){return e===t?!0:e===null||t===null?!1:e.conversationId===t.conversationId&&e.title===t.title&&e.state===t.state&&e.pinned===t.pinned&&e.createdAt===t.createdAt&&e.following===t.following&&Vm(e.category,t.category)&&Km(e.author,t.author)}const fs=1,ll=new WeakMap;function Wm(){const e=ol();let t=null,n=!1,s=!1;const o=new Set;let r=null,a=null;const l=w=>{if(a&&a.from===w&&a.moderator===n)return a.viewer;const v=Object.freeze({...w,moderator:n});return a={from:w,moderator:n,viewer:v},v},c=()=>{const w=e.getState();if(r&&r.from===w&&r.header===t&&r.moderator===n&&r.openingDeleted===s)return r.state;const v=w.messages.find(N=>N.seq===fs),x=Object.freeze({conversationId:w.loaded?w.conversationId:null,topic:w.loaded?t:null,count:w.count,lastSeq:w.lastSeq,lastChangeAt:w.lastChangeAt,messages:w.messages,openingState:v?v.state:s&&w.loaded?"deleted":null,nextCursor:w.nextCursor,reactionSet:w.reactionSet,preset:w.preset,viewer:l(w.viewer),loaded:w.loaded,stale:w.stale});return r={from:w,header:t,moderator:n,openingDeleted:s,state:x},x};let p=c(),h=!1;const b=()=>{if(h)return;const w=c();if(w!==p){p=w;for(const v of[...o])try{v(w)}catch{}}};e.subscribe(b);const _=w=>{h=!0;try{return w()}finally{h=!1,b()}},$=()=>e.getState().articleId;function y(w,v={}){if(!Tt(w))return;const x=rl(w.topic);if(x===null)return;const N=x.conversationId.toLowerCase(),O={articleId:N,conversationId:x.conversationId,count:w.count,lastSeq:w.lastSeq,lastChangeAt:w.lastChangeAt,messages:w.messages,nextCursor:w.nextCursor,articleReactions:qm,reactionSet:w.reactionSet,preset:w.preset,viewer:w.viewer};_(()=>{const E=$()!==N,B=Array.isArray(w.messages)&&w.messages.some(ee=>Tt(ee)&&ee.seq===fs);(E||B)&&(s=!1),al(t,x)||(t=x),n=Tt(w.viewer)&&w.viewer.moderator===!0,e.applyPage(O,v)})}function I(w){const v=rl(w),x=$();v===null||x===null||v.conversationId.toLowerCase()!==x||al(t,v)||(t=v,b())}function R(){s=!0,!(t===null||t.title===null)&&(t=Object.freeze({...t,title:null}))}function P(w){Tt(w)&&_(()=>{const v=e.getState();if(e.applyMessage(w),w.type!=="confirm"||e.getState()===v)return;const x=Tt(w.message)?w.message:null;x!==null&&x.seq===fs&&x.state==="deleted"&&R()})}function T(w){if(!Tt(w)||typeof w.conversationId!="string")return!1;const v={articleId:w.conversationId,count:w.count,lastSeq:w.lastSeq,lastChangeAt:w.lastChangeAt};return e.applyHead(v)}function g(w,v){!Tt(w)||typeof w.conversationId!="string"||e.applyReaction({conversationId:w.conversationId,seq:w.seq},v)}function k(w){if(!Tt(w)||w.kind==="reaction"&&w.seq===void 0)return"dropped";const v=_(()=>e.applyEvent(w)),x=Tt(w.message)?w.message:null,N=x!==null&&x.seq===fs&&(w.kind==="edit"||w.kind==="delete"||w.kind==="message");return v==="applied"&&N?"resync":v}const M={getState:c,subscribe(w){return o.add(w),()=>{o.delete(w)}},applyPage:y,applyTopic:I,applyMessage:P,applyHead:T,applyReaction:g,collapse:(w,v)=>e.collapse(w,v),applyEvent:k,reset(){_(()=>{t=null,n=!1,s=!1,e.reset()})}};return ll.set(M,e),M}function Ym(e){return e!=null&&Qf(e.state)&&e.state==="open"}const Gm=Object.freeze({kind:"deleted"}),cl=Object.freeze({kind:"withheld"});function ul(e,t){return typeof e=="string"&&e.trim()!==""?Object.freeze({kind:"shown",text:e}):t==="deleted"?Gm:cl}function ms(e){if(!Tt(e))return cl;if("messages"in e&&"topic"in e){const{topic:n,openingState:s}=e;return ul(Tt(n)?n.title:null,s)}const t=e;return ul(t.title,t.openingState)}const Zm=20;function dl(e){const t=ll.get(e);if(t)return yi(t);let n=e.getState().conversationId;return{moved:()=>e.getState().conversationId!==n,mark(){n=e.getState().conversationId}}}const Jm=e=>typeof e=="number"&&Number.isFinite(e)?e:null;async function fl(e,t,n,s){const o=e.getState(),r=o.loaded?o.nextCursor:0,a=dl(e);let l=null;for(let c=0;c<Zm;c++){const p=await t.forum.topics.get({conversationId:n.conversationId,languageCode:n.languageCode??null,cursor:l},s);if(!p.ok)return p;if(a.moved())break;e.applyPage(p.value,{cursor:l}),a.mark();const h=Jm(p.value.nextCursor);if(h===null||r!==null&&h>=r||l!==null&&h<=l)break;l=h}return{ok:!0,value:e.getState()}}async function Xm(e,t,n,s){const o=e.getState().nextCursor;if(o===null)return{ok:!0,value:e.getState()};const r=dl(e),a=await t.forum.topics.get({conversationId:n.conversationId,languageCode:n.languageCode??null,cursor:o},s);return a.ok?(r.moved()||e.applyPage(a.value,{cursor:o}),{ok:!0,value:e.getState()}):a}async function Qm(e,t,n,s,o){if(s.code!=="notFound")return s;const r=await fl(e,t,n,o);return r.ok?s:r}const Et=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),_i=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ml(e,t){if(typeof t!="string"||!_i.test(t))return null;const n=t.toLowerCase();return e==="conversation"?Object.freeze({conversationId:n}):e==="category"?Object.freeze({categoryId:n}):null}function ep(e){if(!Et(e))return null;const{conversationId:t,categoryId:n}=e;return typeof t=="string"&&n===void 0&&_i.test(t)?Object.freeze({kind:"conversation",id:t.toLowerCase()}):typeof n=="string"&&t===void 0&&_i.test(n)?Object.freeze({kind:"category",id:n.toLowerCase()}):null}function $o(e){if(!Et(e))return null;if("targetKind"in e){const n=ml(e.targetKind,e.targetId);return n===null?null:$o(n)}const t=ep(e);return t===null?null:`${t.kind}:${t.id}`}const pl=e=>e.replace(/\s+/gu," ").trim();function hl(e){if(typeof e!="string")return 0;const t=pl(e);return Math.max(t.length,[...t.normalize("NFC")].length)}function ki(e){if(typeof e!="string")return null;const t=pl(e),n=hl(t);return n>=1&&n<=is?t:null}function wi(e){if(typeof e!="string")return null;const t=e.replace(/\s+/gu," ").trim();return[...t].length>=pi&&t.length<=rs?t:null}function tp(e){if(!Et(e)||e.hasMore!==!0)return null;const t=e.page;return typeof t!="number"||!Number.isSafeInteger(t)||t<1||t>=La?null:t+1}function np(e){return!Et(e)||typeof e.conversationId!="string"?!1:e.kind==="topic"?!0:e.kind==="article"&&typeof e.articleId=="string"}function $i(e){return Array.isArray(e)?e.filter(np):[]}const op=Object.freeze({forum:"forum",article_discussions:"articleDiscussions"}),xi=e=>typeof e=="string"?e:"";function sp(e){if(!Et(e))return null;const t=Et(e.brake)&&typeof e.brake.until=="string"?e.brake:null;return Object.freeze({enabled:e.enabled===!0,brake:t===null?null:Object.freeze({kind:xi(t.kind),until:xi(t.until),reasonCode:xi(t.reasonCode)})})}function bl(e,t){return!Et(e)||!Et(e.surfaces)||!tm(t)?null:sp(e.surfaces[op[t]])}function ip(e,t=Date.now()){if(!Et(e)||!Et(e.away))return null;const n=e.away.until;if(typeof n!="string")return null;const s=Date.parse(n);return Number.isFinite(s)&&s>t?Object.freeze({until:n}):null}function gl(e,t){if(!Et(e)||!Et(e.moderator)||typeof t!="string"||t==="")return!1;const n=e.moderator.categoryIds;if(!Array.isArray(n))return!1;const s=t.toLowerCase();return n.some(o=>typeof o=="string"&&o.toLowerCase()===s)}const Ne=Object.freeze({myCommunity:"/community",statement:"/community/statements/{id}",report:"/community/report",notices:"/community/notices",rules:"/community/rules",terms:"/community/terms",privacy:"/community/privacy",discussions:"/community/discussions",profile:"/community/u/{handle}",settings:"/community/settings",welcome:"/community/welcome",notifications:"/community/notifications",forum:"/community/forum",category:"/community/c/{slug}",topic:"/community/t/{id}",search:"/community/search"}),vl=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,yl=/^kbnt_[A-Za-z0-9_-]{1,507}$/,_l="t";function bn(e){return typeof e=="string"&&/^\/(?![/\\])/.test(e)&&!/[\s\\\u0000-\u001f\u007f]/.test(e)}function Jn(e,t){const n=e==null||e===""?Ne.statement:e;return!bn(n)||!n.includes("{id}")||/[{}]/.test(n.split("{id}").join(""))||typeof t!="string"||!vl.test(t)?null:n.split("{id}").join(t.toLowerCase())}function kl(e,t){const n=e==null||e===""?Ne.profile:e;if(!bn(n)||!n.includes("{handle}")||/[{}]/.test(n.split("{handle}").join("")))return null;const s=typeof t=="string"?t.replace(/^@/,"").toLowerCase():"";return yo.test(s)?n.split("{handle}").join(s):null}function On(e,t){const n=e==null||e===""?Ne.category:e;return!bn(n)||n.includes("#")||!n.includes("{slug}")||/[{}]/.test(n.split("{slug}").join(""))||typeof t!="string"||!Rf.test(t)?null:n.split("{slug}").join(t)}function xo(e,t){const n=e==null||e===""?Ne.topic:e;return!bn(n)||n.includes("#")||!n.includes("{id}")||/[{}]/.test(n.split("{id}").join(""))||typeof t!="string"||!vl.test(t)?null:n.split("{id}").join(t.toLowerCase())}function Ii(e,t,n){const s=xo(e,t),o=Io(n);return s===null||o===null?null:`${s}#${o}`}const wl="bcm-msg-",$l=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>0;function Io(e){return $l(e)?`${wl}${e}`:null}function xl(e){const t=new RegExp(`^#${wl}([1-9][0-9]{0,14})$`).exec(typeof e=="string"?e:""),n=t?Number(t[1]):NaN;return $l(n)?n:null}function Ti(e,t,n){const s=Il(e,t),o=Io(n);return s===null||o===null?null:`${s}#${o}`}function Il(e,t){const n=e;return!bn(n)||n.includes("#")||!n.includes("{slug}")||/[{}]/.test(n.split("{slug}").join(""))||typeof t!="string"||t===""||t.length>512||t==="."||t===".."||/[\u0000-\u001f\u007f]/.test(t)?null:n.split("{slug}").join(encodeURIComponent(t))}function rp(e,t){const n=e==null||e===""?Ne.notices:e;return!bn(n)||n.includes("#")||typeof t!="string"||!yl.test(t)?null:`${n}#${_l}=${t}`}function En(e,t){return bn(e)?e.includes("#")||!bn(t)||t.includes("#")?e:`${e}#${t}`:null}function Tl(e){const n=/^#t=([^&]*)/.exec(typeof e=="string"?e:"")?.[1]??"";return yl.test(n)?n:null}const Ci=new WeakMap;function Si(){if(typeof window>"u")throw new Error("[blogmcp-sdk] readReceiptFromHash and readDigestTokenFromHash read the address bar — call them in the browser (onMounted / useEffect), never while rendering on the server");return window}function ap(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function lp(e,t,n){let s=e;const o=t?s.indexOf(t):-1;if(o>=0&&(s=s.slice(0,o)),n!==null)for(let r=s.indexOf(n);r>=0;r=s.indexOf(n)){const a=s.lastIndexOf("#",r);s=a>=0?s.slice(0,a):s.slice(0,r)+s.slice(r+n.length)}return s}function Cl(e,t,n){if(!ap(e))return e;let s=!1;const o={...e};for(const[r,a]of Object.entries(o)){if(typeof a!="string")continue;const l=lp(a,t,n);l!==a&&(o[r]=l,s=!0)}return s?o:e}function cp(e=Si()){const t=e.location.hash,n=Tl(t),s=!Ci.has(e);return t.startsWith(`#${_l}=`)&&e.history.replaceState(Cl(e.history.state,t,n),"",e.location.pathname+e.location.search),(s||n!==null)&&Ci.set(e,n),Ci.get(e)??null}const up=/^kbun_[A-Za-z0-9_-]{64}$/,dp="u";function Sl(e){const n=/^#u=([^&]*)/.exec(typeof e=="string"?e:"")?.[1]??"";return up.test(n)?n:null}const ps=new WeakMap;function fp(e=Si()){const t=e.location.hash,n=Sl(t),s=!ps.has(e);return t.startsWith(`#${dp}=`)&&e.history.replaceState(Cl(e.history.state,t,n),"",e.location.pathname+e.location.search),(s||n!==null)&&ps.set(e,n),ps.get(e)??null}function mp(e=Si()){ps.delete(e)}const pp=/(^|[^A-Za-z0-9_@./])@([A-Za-z0-9][A-Za-z0-9_]{2,29})(?![A-Za-z0-9_])/g;function Al(e){if(typeof e!="string"||e==="")return[];if(!e.includes("@"))return[{kind:"text",text:e}];const t=[];let n=0;for(const s of e.matchAll(new RegExp(pp.source,"g"))){const o=s[2],r=o.toLowerCase();if(!yo.test(r))continue;const a=(s.index??0)+s[1].length;a>n&&t.push({kind:"text",text:e.slice(n,a)}),t.push({kind:"mention",text:`@${o}`,handle:r}),n=a+1+o.length}return n<e.length&&t.push({kind:"text",text:e.slice(n)}),t}function Ol(e){const t=[];for(const n of Al(e))n.kind==="mention"&&!t.includes(n.handle)&&t.push(n.handle);return t}const hp={"error.method":"Tohle se takhle spustit nedá. Obnovte prosím stránku.","error.origin":"Požadavek nepřišel z této stránky. Obnovte ji prosím a zkuste to znovu.","error.unavailable":"Teď se to nepodařilo načíst ani uložit. Zkuste to prosím za chvíli.","error.invalid":"Něco ve formuláři nesedí. Zkontrolujte ho prosím a zkuste to znovu.","error.signIn":"K tomu je potřeba přihlásit se čtenářským účtem.","error.onboarding":"Než začnete psát, dokončete prosím vstup do diskuse.","error.age":"Diskuse je otevřená od vyššího věku, zapojit se do ní zatím nejde.","error.name":"Tohle jméno použít nejde. Zkuste prosím jiné.","error.handle":"Tohle uživatelské jméno je obsazené, nebo jste ho nedávno měnili. Zkuste prosím jiné, nebo později.","error.restricted":"Psaní do diskuse máte teď omezené.","error.suspended":"Váš účet v diskusi je teď pozastavený.","error.terminated":"Váš účet v diskusi je zrušený.","error.links":"V komentáři je víc odkazů, než se vejde. Některé prosím uberte.","error.fast":"Jde to moc rychle za sebou. Chvilku počkejte a zkuste to znovu.","error.blocked":"Komentář v téhle podobě zveřejnit nejde. Zkuste ho prosím upravit.","error.confirm":"Než komentář odešlete, potvrďte prosím jednu věc.","error.removed":"Tahle zpráva byla odstraněna, upravit ji už nejde.","error.quota":"Posíláte toho hodně najednou. Zkuste to prosím později.","error.captcha":"Nepodařilo se ověřit, že nejste robot. Počkejte prosím na nové ověření a odešlete to znovu.","error.notFound":"Tohle jsme nenašli. Možná už není k dispozici.","error.surfaceOff":"Diskuse tu teď není k dispozici.","error.notMoved":"Diskusi teď připravujeme. Psát do ní půjde brzy.","error.ledger":"Teď se to nepodařilo uložit a všechno zůstalo, jak bylo. Zkuste to prosím znovu.","error.readOnly":"Tahle funkce komunity je teď vypnutá. Diskuse pod články běží dál.","error.braked":"Psaní je teď na chvíli pozastavené. Číst můžete dál, psát půjde zase brzy.","error.mentionLimit":"V jednom příspěvku jste zmínili víc lidí, než zatím jde. Některé zmínky odeberte a pošlete znovu.","error.pushRefused":"V tomhle prohlížeči upozornění zapnout nejde. Zkuste jiný prohlížeč, nebo sledujte stránku s upozorněními.","error.realtimeOff":"Nové příspěvky se tu teď neukazují hned. Diskuse se obnovuje sama každou chvíli.","error.membersOnly":"Fórum je otevřené členům komunity. Po přihlášení a vstupu do komunity ho uvidíte.","error.topicLocked":"Téma je uzavřené, psát do něj už nejde. Číst ho můžete dál.","error.topicCreationClosed":"V téhle kategorii nové téma založit nejde. Zkuste prosím jinou.","error.followLimit":"Sledujete toho už hodně. Něco prosím přestaňte sledovat a zkuste to znovu.","error.submit":"Nepovedlo se to. Obnovte prosím stránku a zkuste to znovu.","need.sign_in":"Do diskuse můžete psát po přihlášení.","need.onboarding":"Před prvním komentářem si nastavte jméno a potvrďte pravidla diskuse a podmínky.","need.reconsent_rules":"Pravidla diskuse se změnila. Potvrďte prosím novou verzi.","need.art9_consent":"Pro psaní do diskuse potřebujeme váš souhlas se zpracováním.","state.visible":"Zveřejněno","state.held":"Čeká na kontrolu","state.removed":"Odstraněno","state.deleted":"Smazáno","state.hiddenUntilConsent":"Čeká na váš souhlas","note.identification_safety":"Podle fotky se houba spolehlivě určit nedá a o jedlosti tady nerozhodujeme. Při podezření na otravu volejte Toxikologické informační středisko: 224 919 293 (nonstop).","note.report_to_manufacturer":"Jde-li o nežádoucí účinek přípravku, dejte nám o něm prosím vědět také v poradně, ať ho můžeme prověřit.","category.fraud_spam":"Podvod nebo spam","category.harassment":"Obtěžování","category.hate":"Nenávistné projevy","category.threats":"Výhrůžky","category.sexual_content":"Sexuální obsah","category.child_at_risk":"Ohrožené dítě","category.self_harm":"Sebepoškozování","category.doxxing":"Zveřejnění cizích osobních údajů","category.copyright":"Porušení autorských práv","category.terrorism":"Terorismus","category.drugs":"Drogy","category.other_illegal":"Jiný nezákonný obsah","category.rules":"Porušení pravidel diskuse","category.adverse_event":"Nežádoucí účinek přípravku","category.third_party_health_data":"Cizí údaje o zdraví","category.suspected_minor":"Autor je nejspíš mladší, než pravidla dovolují","confirm.title":"Než to odešlete","confirm.about_self_or_consent":"Píšu o sobě, nebo mám souhlas člověka, o kterém píšu.","confirm.good_faith":"Potvrzuji, že podle mého nejlepšího vědomí je hlášení přesné a úplné.","confirm.other":"Rozumím upozornění a chci komentář odeslat.","confirm.submit":"Potvrdit a odeslat","warning.identifier":"V komentáři je nejspíš e-mail, telefon nebo číslo účtu. Pokud tam být nemá, komentář upravte.","warning.invisible_chars":"Z komentáře jsme odstranili neviditelné znaky.","warning.other":"Komentář je zveřejněný, ale pravidla diskuse u něj na něco upozorňují. Projděte si ho prosím.","author.deleted":"Smazaný uživatel","author.system":"Oznámení webu","author.badge.team":"Tým","discussion.title":"Diskuse","discussion.count_one":"{count} komentář","discussion.count_few":"{count} komentáře","discussion.count_many":"{count} komentáře","discussion.count_other":"{count} komentářů","discussion.empty":"Zatím tu nejsou komentáře. Začněte diskusi jako první.","discussion.loading":"Načítám diskusi…","discussion.loadMore":"Načíst další","discussion.newMessages":"V diskusi přibyly nové komentáře.","discussion.refresh":"Zobrazit","discussion.signInPrompt":"Přihlaste se a zapojte se do diskuse.","discussion.reply":"Odpovědět","discussion.edit":"Upravit","discussion.delete":"Smazat","discussion.deleteTitle":"Smazat komentář?","discussion.deleteExplain":"Komentář zmizí. Pokud na něj už někdo odpověděl, zůstane po něm prázdné místo.","discussion.deleteConfirm":"Ano, smazat","discussion.report":"Nahlásit","discussion.block":"Blokovat autora","discussion.unblock":"Odblokovat autora","discussion.blocked":"Autora jste zablokovali. Jeho komentáře uvidíte sbalené.","discussion.unblocked":"Autora jste odblokovali.","discussion.menu":"Další akce","discussion.collapsed":"Komentář autora, kterého jste zablokovali.","discussion.show":"Zobrazit","discussion.hide":"Skrýt","discussion.edited":"upraveno","discussion.translated":"Přeloženo automaticky","discussion.showOriginal":"Zobrazit originál","discussion.showTranslation":"Zobrazit překlad","discussion.showReplies_one":"Zobrazit {count} odpověď","discussion.showReplies_few":"Zobrazit {count} odpovědi","discussion.showReplies_many":"Zobrazit {count} odpovědi","discussion.showReplies_other":"Zobrazit {count} odpovědí","discussion.repliesTruncated":"Odpovědí je tu víc, než se dá zobrazit najednou.","discussion.heldNote":"Komentář čeká na kontrolu a zatím ho vidíte jen vy. Po kontrole se ukáže ostatním, nebo se v Moje komunita dozvíte, proč ne.","discussion.hiddenUntilConsentNote":"Komentář zatím vidíte jen vy. Ostatním se ukáže, až udělíte souhlas se zpracováním.","discussion.giveConsent":"Udělit souhlas","discussion.removedNote":"Tenhle komentář jsme odstranili a ostatní ho nevidí.","discussion.why":"Proč?","discussion.placeholderHeld":"Komentář čeká na kontrolu.","discussion.placeholderRemoved":"Komentář byl odstraněn.","discussion.placeholderDeleted":"Komentář byl smazán.","discussion.pending":"Odesílám…","discussion.reactions":"Reakce","discussion.reactionCount":"{emoji} {count}","discussion.reactionAdd":"Přidat reakci","discussion.reactionRemove":"Odebrat reakci","discussion.reactionMine":"Vaše reakce","composer.label":"Váš komentář","composer.replyLabel":"Vaše odpověď","composer.editLabel":"Úprava komentáře","composer.replyingTo":"Odpovídáte: {name}","composer.placeholder":"Napište komentář…","composer.counter":"{length} / {max} znaků","composer.tooLong":"Komentář je moc dlouhý. Zkraťte ho prosím nejvýš na {max} znaků.","composer.linksNote_one":"Do komentáře se vejde nejvýš {count} odkaz.","composer.linksNote_few":"Do komentáře se vejdou nejvýš {count} odkazy.","composer.linksNote_many":"Do komentáře se vejde nejvýš {count} odkazu.","composer.linksNote_other":"Do komentáře se vejde nejvýš {count} odkazů.","composer.shortcut":"Odeslat můžete i klávesami {keys}.","composer.submit":"Odeslat","composer.sending":"Odesílám…","composer.save":"Uložit","composer.cancel":"Zrušit","composer.posted":"Komentář je zveřejněný.","composer.held":"Komentář máme, teď čeká na kontrolu.","composer.cooldown_one":"Další komentář můžete poslat za {count} sekundu.","composer.cooldown_few":"Další komentář můžete poslat za {count} sekundy.","composer.cooldown_many":"Další komentář můžete poslat za {count} sekundy.","composer.cooldown_other":"Další komentář můžete poslat za {count} sekund.","sanction.restriction":"Psaní do diskuse máte omezené.","sanction.restrictionUntil":"Psaní do diskuse máte omezené do {date}.","sanction.suspension":"Váš účet v diskusi je pozastavený.","sanction.suspensionUntil":"Váš účet v diskusi je pozastavený do {date}.","sanction.ban":"Váš účet v diskusi je zrušený.","sanction.statement":"Zobrazit odůvodnění","onboarding.title":"Vítejte v diskusi","onboarding.lede":"Než napíšete první komentář, potřebujeme od vás pár věcí. Zabere to chvilku.","onboarding.ageTitle":"Kolik vám je let?","onboarding.age.16_17":"16–17 let","onboarding.age.18_plus":"18 let a víc","onboarding.ageHint":"Ptáme se jen jednou a uložíme si jen věkovou skupinu.","onboarding.ageBelow":"Diskuse je otevřená od {min} let. Číst ji ale můžete dál.","onboarding.rulesTitle":"Pravidla diskuse","onboarding.rulesLede":"Přečtěte si prosím, jak to v diskusi chodí.","onboarding.rulesLink":"Celá pravidla","onboarding.rulesAccept":"Souhlasím s pravidly diskuse.","onboarding.rulesTermsAccept":"Souhlasím s pravidly diskuse a s podmínkami.","onboarding.termsLink":"Podmínky diskuse","onboarding.rulesChanged":"Pravidla diskuse se od vaší poslední návštěvy změnila. Přečtěte si prosím novou verzi a potvrďte ji.","onboarding.art9Title":"Souhlas se zpracováním","onboarding.art9Lede":"Pro psaní do diskuse potřebujeme váš souhlas podle textu níže.","onboarding.art9LedeOptional":"Prosíme o váš souhlas podle textu níže. Psát ve veřejné diskusi můžete i bez něj.","onboarding.art9Accept":"Souhlasím se zpracováním podle textu výše.","onboarding.art9Controller":"Souhlas pro {label}","onboarding.art9Refuse":"Nesouhlasím","onboarding.art9RefusedDone":"Bez tohoto souhlasu můžete psát ve veřejné diskusi.","onboarding.art9RequiredToWrite":"Bez souhlasu můžete diskusi jen číst.","onboarding.profileTitle":"Jak vás uvidí ostatní","onboarding.displayName":"Jméno v diskusi","onboarding.displayNameHint":"Může to být i přezdívka. Uvidí ho všichni čtenáři.","onboarding.handle":"Uživatelské jméno","onboarding.handleHint":"Malá písmena, číslice a podtržítko, {min} až {max} znaků. Změnit ho jde jednou za {days} dní.","onboarding.handleSuggested":"Navrhujeme: {handle}","onboarding.avatar":"Obrázek u jména","onboarding.avatarNone":"Bez obrázku","onboarding.continue":"Pokračovat","onboarding.back":"Zpět","onboarding.submit":"Hotovo","onboarding.done":"Hotovo, teď můžete psát.","report.title":"Nahlásit komentář","report.lede":"Hlášení posoudí tým webu. Výsledek uvidíte v Moje komunita.","report.category":"Co je na komentáři špatně?","report.rule":"Které pravidlo porušuje?","report.ruleOther":"Jiné pravidlo","report.note":"Poznámka pro tým (nepovinné)","report.noteHint":"Poznámku uvidí jen tým, který hlášení posuzuje.","report.counter":"{length} / {max} znaků","report.submit":"Nahlásit","report.sending":"Odesílám…","report.cancel":"Zrušit","report.done":"Díky, hlášení máme. Výsledek uvidíte v Moje komunita.","panel.title":"Moje komunita","panel.signIn":"Moje komunita je dostupná po přihlášení.","panel.profile":"Profil","panel.profileEdit":"Upravit profil","panel.statements":"Rozhodnutí o mém obsahu","panel.statementsEmpty":"Rozhodnutí o vašem obsahu uvidíte tady.","panel.reports":"Moje hlášení","panel.reportsEmpty":"Hlášení, která pošlete, uvidíte tady.","panel.notifications":"Upozornění","panel.notificationsEmpty":"Nová upozornění uvidíte tady.","panel.unread_one":"{count} nepřečtené oznámení","panel.unread_few":"{count} nepřečtená oznámení","panel.unread_many":"{count} nepřečteného oznámení","panel.unread_other":"{count} nepřečtených oznámení","panel.markRead":"Označit jako přečtené","panel.blocks":"Zablokovaní autoři","panel.blocksEmpty":"Autory, které zablokujete, uvidíte tady.","panel.consents":"Souhlasy","panel.art9Given":"Souhlas se zpracováním je udělený.","panel.art9NotGiven":"Souhlas se zpracováním jste zatím nedali.","panel.art9Refused":"Souhlas se zpracováním jste odmítli.","panel.art9Withdraw":"Odvolat souhlas","panel.art9WithdrawTitle":"Odvolat souhlas se zpracováním?","panel.art9WithdrawExplain":"Diskusi můžete dál číst. Příspěvky ve fóru, které jste napsali se souhlasem, smažeme za 7 dní — když souhlas do té doby znovu udělíte, zůstanou. Jestli půjde psát i bez souhlasu, záleží na nastavení webu; řekne vám to před dalším komentářem.","panel.art9WithdrawConfirm":"Ano, odvolat souhlas","panel.art9WithdrawCancel":"Ponechat souhlas","panel.art9Withdrawn":"Souhlas jste odvolali.","panel.export":"Stáhnout moje data","panel.exportHint":"Soubor JSON s tím, co o vás v diskusi máme uložené.","panel.exporting":"Připravuji soubor…","panel.exportFileName":"moje-komunita","panel.erase":"Smazat profil v diskusi","panel.eraseExplain":"Po ochranné lhůtě smažeme váš profil v diskusi, vaše komentáře a reakce, pokud je nemusíme ze zákona uchovat. Účet na webu zůstane. Během lhůty to můžete zrušit.","panel.eraseTitle":"Opravdu smazat profil v diskusi?","panel.eraseConfirm":"Ano, smazat profil","panel.eraseKeep":"Ponechat","panel.eraseScheduled":"Profil v diskusi smažeme {date}. Do té doby to můžete zrušit.","panel.eraseCancel":"Zrušit smazání","panel.eraseCancelled":"Smazání jsme zrušili, profil zůstává.","statement.title":"Odůvodnění rozhodnutí","statement.decidedAt":"Rozhodnuto {date}","statement.provider":"Rozhoduje: {entity}","statement.restriction":"Opatření","statement.until":"Do {date}","statement.scope":"Rozsah","statement.scopeAll":"Všude","statement.basis":"Podnět","statement.facts":"Skutečnosti a okolnosti","statement.automation":"Automatizace","statement.automatedDetection":"Zjištěno automaticky","statement.automatedDecision":"Rozhodnuto automaticky","statement.humanDecision":"Rozhodl člověk","statement.legalGround":"Právní důvod","statement.contractualGround":"Pravidlo","statement.redress":"Možnosti nápravy","statement.subject":"Týká se","statement.subjectMessage":"Komentáře","statement.subjectProfile":"Profilu","statement.subjectArticle":"Článku","statement.full":"Celé odůvodnění","statement.appealTitle":"Odvolání","statement.appealLede":"Nesouhlasíte s rozhodnutím? Napište nám proč. Odvolání posoudí, kde to jde, jiný člověk než ten, kdo rozhodoval.","statement.appealUntil":"Odvolat se můžete do {date}.","statement.appealBody":"Proč s rozhodnutím nesouhlasíte?","statement.appealCounter":"{length} / {max} znaků","statement.appealSubmit":"Odeslat odvolání","statement.appealSending":"Odesílám…","statement.appealSent":"Odvolání máme. Až ho posoudíme, dáme vám vědět.","statement.appealOpen":"Vaše odvolání se posuzuje.","statement.appealWithdraw":"Vzít odvolání zpět","statement.appealWithdrawn":"Odvolání jste vzali zpět.","statement.appealClosed":"Lhůta pro odvolání uplynula.","statement.appealUnavailable":"Proti tomuto rozhodnutí se už odvolat nejde.","restriction.no_action":"Bez opatření","restriction.warning":"Upozornění","restriction.removal":"Odstranění obsahu","restriction.visibility_restricted":"Omezená viditelnost","restriction.posting_restricted":"Omezené psaní","restriction.account_suspended":"Pozastavený účet","restriction.account_terminated":"Zrušený účet","basis.notice":"Hlášení","basis.own_initiative":"Vlastní kontrola","basis.order":"Úřední příkaz","caseStatus.open":"Posuzujeme","caseStatus.decided":"Rozhodnuto","caseStatus.appealed":"Probíhá odvolání","caseStatus.closed":"Uzavřeno","appealStatus.open":"Posuzujeme","appealStatus.upheld":"Rozhodnutí platí","appealStatus.reversed":"Rozhodnutí zrušeno","appealStatus.withdrawn":"Vzato zpět","adverseOutcome.recorded":"Posouzeno jako možný nežádoucí účinek a zaznamenáno do evidence.","adverseOutcome.reported_to_authority":"Posouzeno jako možný nežádoucí účinek a ohlášeno příslušnému úřadu.","adverseOutcome.not_adverse":"Posouzeno: o nežádoucí účinek nejde.","notification.decision":"Máte nové rozhodnutí o svém obsahu.","notification.appeal_resolved":"Vaše odvolání je vyřízené.","notification.erasure_scheduled":"Smazání vašeho profilu v diskusi je naplánované.","notification.inactivity_warning":"Dlouho jste v diskusi nebyli. Bez další aktivity váš profil po čase smažeme.","notification.module_read_only":"Rozšířené funkce komunity jsou vypnuté. Diskuse pod články běží dál; co se pro vás mění, najdete na stránce Moje komunita.","notification.module_braked":"Psaní v komunitě je teď pozastavené. Číst můžete dál.","notification.reply":"Někdo odpověděl na váš příspěvek.","notification.mention":"Někdo vás zmínil v diskusi.","notification.module_push_reset":"Upozornění v prohlížeči je potřeba znovu zapnout v nastavení komunity.","notification.age_limit_changed":"Komunita je nově jen pro dospělé, váš profil je proto jen ke čtení. Podrobnosti najdete na stránce Moje komunita.","notification.topic_update":"V diskusi, kterou sledujete, přibyl nový příspěvek.","notification.category_topic":"V kategorii, kterou sledujete, je nové téma.","notification.category_topic.article":"V kategorii, kterou sledujete, je nová diskuse pod článkem.","centre.title":"Upozornění","centre.empty":"Nová upozornění uvidíte tady.","centre.markAllRead":"Označit vše jako přečtené","centre.settings":"Nastavení upozornění","centre.loadMore":"Načíst starší","centre.unreadOnly":"Jen nepřečtené","centre.signIn":"Upozornění uvidíte po přihlášení.","centre.openMessage":"Zobrazit příspěvek","badge.unread_one":"{count} nové upozornění","badge.unread_few":"{count} nová upozornění","badge.unread_many":"{count} nového upozornění","badge.unread_other":"{count} nových upozornění","settings.title":"Nastavení upozornění","settings.signIn":"Nastavení upozornění změníte po přihlášení.","settings.notifyReply":"Odpovědi na moje příspěvky","settings.notifyMention":"Když mě někdo zmíní","settings.notifyTopic":"Novinky v diskusích, které sleduji","settings.pushEnabled":"Upozornění v prohlížeči","settings.digestEmail":"Denní souhrn e-mailem","settings.quietHours":"Noční klid: mezi 22:00 a 7:00 počkají upozornění v prohlížeči do rána.","settings.saved":"Uloženo.","settings.push.enable":"Zapnout upozornění","settings.push.disable":"Vypnout upozornění","settings.push.carries":"Upozornění doručuje tento web. Samo upozornění nenese, co přišlo ani od koho.","settings.push.unsupported":"Tenhle prohlížeč upozornění neumí. Nové odpovědi a zmínky najdete na stránce s upozorněními.","settings.push.refused":"Upozornění se v tomhle prohlížeči zapnout nepodařilo. Zkuste to prosím později nebo v jiném prohlížeči.","settings.push.denied":"Upozornění má tenhle prohlížeč pro tento web zablokovaná. Povolit je můžete v nastavení prohlížeče.","settings.push.inAppExplain":"V aplikaci Facebooku nebo Instagramu upozornění zapnout nejdou. Otevřete stránku v prohlížeči.","settings.push.openInBrowser":"Otevřít v prohlížeči","settings.push.iosGuide":"Na iPhonu a iPadu fungují upozornění jen u webu přidaného na plochu: v Safari klepněte na Sdílet a zvolte „Přidat na plochu“. Pak web otevřete z plochy a upozornění zapněte.","settings.push.reset":"Zapněte si upozornění znovu: nastavení webu se změnilo a dřívější zapnutí přestalo platit.","settings.digest.prompt":"Chcete přestat dostávat denní souhrn e-mailem?","settings.digest.confirm":"Odhlásit denní souhrn","settings.digest.unsubscribed":"Denní souhrn e-mailem jsme vypnuli.","settings.digest.staleLink":"Odkaz na odhlášení souhrnu už neplatí. Po přihlášení ho vypnete přepínačem v nastavení.","profile.memberSince":"Členem od {date}","profile.bio":"O mně","profile.notFound":"Tenhle profil jsme nenašli.","profile.signIn":"Profily členů uvidíte po přihlášení.","trust.0":"Nový člen","trust.1":"Člen","trust.2":"Stálý člen","trust.3":"Důvěryhodný člen","role.moderator":"Moderátor","welcome.title":"Vítejte v komunitě","welcome.lede":"Tady je pár věcí, které se vám na začátku hodí.","welcome.rules":"Jak to v diskusi chodí","welcome.discussions":"Projít diskuse","welcome.settings":"Nastavit upozornění","welcome.profile":"Můj profil","realtime.off":"Živé aktualizace jsou teď vypnuté. Diskuse se sama obnovuje každou chvíli.","state.readOnly":"Rozšířené funkce komunity jsou teď vypnuté. Diskuse pod článkem běží dál.","state.braked":"Psaní je teď na chvíli pozastavené. Číst můžete dál.","state.away":"Tým je teď nepřítomen; nová témata počkají na kontrolu.","topic.deleted":"Smazané téma","topic.withheld":"Název tématu není k dispozici","follow.follow":"Sledovat","follow.following":"Sledujete","follow.followed":"Sledujete. Novinky uvidíte v upozorněních.","follow.unfollowed":"Už nesledujete.","follow.unavailable":"Tohle teď sledovat nejde.","forum.title":"Fórum","forum.loading":"Načítám fórum…","forum.empty":"Kategorie fóra tu zatím nejsou.","forum.topicCount_one":"{count} téma","forum.topicCount_few":"{count} témata","forum.topicCount_many":"{count} tématu","forum.topicCount_other":"{count} témat","forum.discussionCount_one":"{count} diskuse","forum.discussionCount_few":"{count} diskuse","forum.discussionCount_many":"{count} diskuse","forum.discussionCount_other":"{count} diskusí","forum.lastActivity":"Naposledy {date}","forum.latest":"Nejnovější témata","forum.allTopics":"Všechna témata","forum.allCategories":"Všechny kategorie","forum.search":"Hledat ve fóru","forum.searchSubmit":"Hledat","forum.modePre":"Nové příspěvky tu před zveřejněním čekají na kontrolu.","forum.teamTopics":"Témata tady zakládá tým.","forum.join":"Vstoupit do komunity","forum.back":"Zpět na fórum","state.forumBraked":"Psaní ve fóru je teď na chvíli pozastavené. Číst můžete dál.","forumCategory.notFound":"Tuhle kategorii jsme nenašli.","forumCategory.empty":"V téhle kategorii zatím nejsou témata.","forumCategory.articlesEmpty":"Diskuse pod články tu zatím nejsou.","forumCategory.sort":"Řazení","forumCategory.sortActivity":"Podle aktivity","forumCategory.sortNew":"Nejnovější","forumCategory.newTopic":"Nové téma","topic.loading":"Načítám téma…","topic.notFound":"Tohle téma jsme nenašli. Možná už není k dispozici.","topic.count_one":"{count} příspěvek","topic.count_few":"{count} příspěvky","topic.count_many":"{count} příspěvku","topic.count_other":"{count} příspěvků","topic.locked":"Uzavřené","topic.archived":"Archivované","topic.pinned":"Připnuté","topic.titleLabel":"Název tématu","topic.titleMissing":"Napište prosím název tématu.","topic.titleTooLong":"Název je moc dlouhý. Zkraťte ho prosím nejvýš na {max} znaků.","topic.bodyLabel":"Úvodní příspěvek","topic.create":"Založit téma","topic.created":"Téma je založené.","topic.createdHeld":"Téma máme, teď čeká na kontrolu.","topic.open":"Otevřít téma","forumText.composer.label":"Váš příspěvek","forumText.composer.editLabel":"Úprava příspěvku","forumText.composer.placeholder":"Napište příspěvek…","forumText.composer.tooLong":"Příspěvek je moc dlouhý. Zkraťte ho prosím nejvýš na {max} znaků.","forumText.composer.linksNote_one":"Do příspěvku se vejde nejvýš {count} odkaz.","forumText.composer.linksNote_few":"Do příspěvku se vejdou nejvýš {count} odkazy.","forumText.composer.linksNote_many":"Do příspěvku se vejde nejvýš {count} odkazu.","forumText.composer.linksNote_other":"Do příspěvku se vejde nejvýš {count} odkazů.","forumText.composer.posted":"Příspěvek je zveřejněný.","forumText.composer.held":"Příspěvek máme, teď čeká na kontrolu.","forumText.composer.cooldown_one":"Další příspěvek můžete poslat za {count} sekundu.","forumText.composer.cooldown_few":"Další příspěvek můžete poslat za {count} sekundy.","forumText.composer.cooldown_many":"Další příspěvek můžete poslat za {count} sekundy.","forumText.composer.cooldown_other":"Další příspěvek můžete poslat za {count} sekund.","forumText.discussion.empty":"Zatím tu nejsou odpovědi. Odpovězte jako první.","forumText.discussion.deleteTitle":"Smazat příspěvek?","forumText.discussion.deleteExplain":"Příspěvek zmizí. Pokud na něj už někdo odpověděl, zůstane po něm prázdné místo.","forumText.discussion.collapsed":"Příspěvek autora, kterého jste zablokovali.","forumText.discussion.heldNote":"Příspěvek čeká na kontrolu a zatím ho vidíte jen vy. Po kontrole se ukáže ostatním, nebo se v Moje komunita dozvíte, proč ne.","forumText.discussion.hiddenUntilConsentNote":"Příspěvek zatím vidíte jen vy. Ostatním se ukáže, až udělíte souhlas se zpracováním.","forumText.discussion.removedNote":"Tenhle příspěvek jsme odstranili a ostatní ho nevidí.","forumText.discussion.placeholderHeld":"Příspěvek čeká na kontrolu.","forumText.discussion.placeholderRemoved":"Příspěvek byl odstraněn.","forumText.discussion.placeholderDeleted":"Příspěvek byl smazán.","forumText.report.title":"Nahlásit příspěvek","forumText.report.category":"Co je na příspěvku špatně?","forumText.error.links":"V příspěvku je víc odkazů, než se vejde. Některé prosím uberte.","forumText.error.blocked":"Příspěvek v téhle podobě zveřejnit nejde. Zkuste ho prosím upravit.","forumText.error.confirm":"Než příspěvek odešlete, potvrďte prosím jednu věc.","forumText.confirm.other":"Rozumím upozornění a chci příspěvek odeslat.","forumText.warning.identifier":"V příspěvku je nejspíš e-mail, telefon nebo číslo účtu. Pokud tam být nemá, příspěvek upravte.","forumText.warning.other":"Příspěvek je zveřejněný, ale pravidla diskuse u něj na něco upozorňují. Projděte si ho prosím.","forumText.need.onboarding":"Před prvním příspěvkem si nastavte jméno a potvrďte pravidla diskuse a podmínky.","forumText.need.art9_consent":"Pro psaní ve fóru potřebujeme váš souhlas se zpracováním.","search.title":"Hledání ve fóru","search.label":"Co hledáte?","search.submit":"Hledat","search.searching":"Hledám…","search.tooShort":"Napište prosím aspoň {min} znaky.","search.tooLong":"Hledaný text je moc dlouhý. Zkraťte ho prosím nejvýš na {max} znaků.","search.empty":"K tomu jsme nenašli výsledky. Zkuste jiná slova.","search.more":"Další výsledky","search.lastPage":"Další výsledky už nezobrazíme. Zkuste hledání upřesnit.","search.space":"Kde hledat","search.spaceAll":"Všude","search.spaceForum":"Ve fóru","search.spaceArticle":"V diskusích pod články","search.category":"Kategorie","search.topic":"Téma","search.message":"Příspěvek","search.inArticle":"Diskuse pod článkem","moderation.title":"Moderování","moderation.loading":"Načítám frontu…","moderation.empty":"Fronta je teď prázdná.","moderation.source.member_report":"Nahlásil člen","moderation.source.filter":"Zachytil filtr","moderation.source.staff":"Od týmu","moderation.premod":"Čeká na schválení","moderation.heldBySystem":"Zatím skryté automaticky","moderation.deadline":"Vyřídit do {date}","moderation.open":"Posoudit","moderation.package":"Obsah k posouzení","moderation.itemWithheld":"Tenhle příspěvek teď ostatní nevidí, a tak ho tu neukazujeme.","moderation.restriction":"Rozhodnutí","moderation.factsHint":"Popište, co jste u obsahu zjistili. Text bude součástí odůvodnění pro autora.","moderation.ruleRequired":"Vyberte prosím pravidlo, o které se rozhodnutí opírá.","moderation.preview":"Náhled odůvodnění","moderation.previewTitle":"Takhle odůvodnění uvidí autor","moderation.decide":"Rozhodnout","moderation.decided":"Rozhodnuto.","moderation.escalate":"Předat týmu","moderation.escalateLede":"Jde podle vás o protiprávní obsah? Předejte ho týmu webu, posoudí ho sám.","moderation.escalateCategory":"O co jde?","moderation.escalated":"Předáno týmu.","moderation.remove":"Odstranit jako moderátor","moderation.removeLede":"Příspěvek zmizí a autor dostane odůvodnění, proti kterému se může odvolat.","moderation.removed":"Odstraněno. Autor dostal odůvodnění.","moderation.approve":"Zveřejnit","moderation.approved":"Zveřejněno.","moderation.reject":"Zamítnout","moderation.rejected":"Zamítnuto. Autor dostal odůvodnění.","moderation.gone":"Tahle položka už ve frontě není.","moderation.textChanged":"Autor text mezitím upravil. Přečtěte si novou verzi a rozhodněte znovu.","moderation.lock":"Uzavřít téma","moderation.unlock":"Znovu otevřít téma","moderation.pin":"Připnout téma","moderation.unpin":"Odepnout téma","moderation.move":"Přesunout téma","moderation.moveTo":"Kam téma přesunout?","moderation.done":"Hotovo.","moderation.openTopic":"Zobrazit v tématu","profile.moderates":"V kategoriích","mention.limit":"V jednom příspěvku jste zmínili víc lidí, než zatím jde.","notice.title":"Nahlásit obsah","notice.lede":"Nahlásit můžete komentář, profil nebo článek, i bez přihlášení.","notice.noTarget":"Hlášení otevřete přímo u obsahu, který chcete nahlásit: u komentáře zvolte „Nahlásit“.","notice.category":"Proč obsah hlásíte?","notice.target":"Co hlásíte","notice.targetMessage":"Komentář","notice.targetProfile":"Profil","notice.targetArticle":"Článek","notice.rule":"Které pravidlo obsah porušuje?","notice.description":"Popis","notice.descriptionHint":"Popište prosím, co je na obsahu špatně a proč.","notice.counter":"{length} / {max} znaků","notice.contactTitle":"Kontakt (nepovinné)","notice.contactHint":"Kontakt potřebujeme k potvrzení přijetí a k odeslání výsledku.","notice.name":"Jméno","notice.email":"E-mail","notice.childAtRisk":"Hlášení o ohroženém dítěti přijímáme bez jména a e-mailu.","notice.submit":"Odeslat hlášení","notice.sending":"Odesílám…","notice.done":"Díky, hlášení máme.","notice.receiptLede":"Uložte si odkaz níže. Podle něj zjistíte, jak jsme hlášení vyřídili.","notice.statusLink":"Stav hlášení","notice.noContactKept":"Kontakt u tohoto hlášení neukládáme, výsledek vám proto e-mailem nepřijde. Zjistíte ho přes odkaz výše.","notice.captchaUnavailable":"Ověření proti robotům se nenačetlo (možná ho blokuje rozšíření prohlížeče), takže formulář teď odeslat nejde. Zkuste prosím stránku obnovit.","notice.statusTitle":"Stav hlášení","notice.submittedAt":"Odesláno {date}","notice.decidedAt":"Rozhodnuto {date}","notice.statement":"Odůvodnění","notice.outcome":"Výsledek","notice.redress":"Pokud s vyřízením nesouhlasíte, můžete se obrátit na soud nebo využít mimosoudní řešení sporu.","notice.appealTitle":"Odvolání","notice.appealLede":"Nesouhlasíte s tím, jak jsme hlášení vyřídili? Napište nám proč.","notice.appealBody":"Proč s rozhodnutím nesouhlasíte?","notice.appealSubmit":"Odeslat odvolání","notice.appealSent":"Odvolání máme.","notice.appealOpen":"Vaše odvolání se posuzuje.","notice.appealWithdraw":"Vzít odvolání zpět","notice.appealUntil":"Odvolat se můžete do {date}.","notice.appealClosed":"Lhůta pro odvolání uplynula.","notice.receiptMissing":"V odkazu chybí číslo hlášení. Otevřete prosím celý odkaz z e-mailu.","common.signIn":"Přihlásit se","common.close":"Zavřít","common.cancel":"Zrušit","common.retry":"Zkusit znovu","common.loading":"Načítám…","common.back":"Zpět","common.optional":"nepovinné","common.needsJs":"Tahle část stránky potřebuje zapnutý JavaScript. Zapněte ho prosím a stránku obnovte."},bp={"error.method":"This can't be started this way. Please reload the page.","error.origin":"This request didn't come from this page. Please reload it and try again.","error.unavailable":"We couldn't load or save that just now. Please try again in a little while.","error.invalid":"Something in the form isn't right. Please check it and try again.","error.signIn":"You need to sign in with a reader account for this.","error.onboarding":"Before you write, please finish joining the discussion.","error.age":"The discussion is open to an older age group, so you can't join it yet.","error.name":"This name can't be used. Please try another one.","error.handle":"This username is taken, or you changed yours recently. Please try another one, or try later.","error.restricted":"Your posting in the discussion is restricted for now.","error.suspended":"Your discussion account is suspended for now.","error.terminated":"Your discussion account is closed.","error.links":"This comment has more links than fit. Please remove some of them.","error.fast":"That's a bit fast. Please wait a moment and try again.","error.blocked":"This comment can't be published as it is. Please try editing it.","error.confirm":"Before you send the comment, please confirm one thing.","error.removed":"This message was removed; it can't be edited any more.","error.quota":"That's a lot in a short time — please try again later.","error.captcha":"We couldn't check that you're not a robot. Please wait for a new check and send it again.","error.notFound":"We couldn't find this. It may not be available any more.","error.surfaceOff":"The discussion isn't available here right now.","error.notMoved":"We're preparing the discussion. You'll be able to write here soon.","error.ledger":"That couldn't be saved just now, and everything is as it was. Please try again.","error.readOnly":"This community feature is switched off for now. The discussions under articles keep working.","error.braked":"Writing is paused for a while. You can keep reading, and writing will open again soon.","error.mentionLimit":"This post mentions more people than you can mention yet. Remove some of the mentions and send it again.","error.pushRefused":"Notifications cannot be switched on in this browser. Try another browser, or keep an eye on the notifications page.","error.realtimeOff":"New posts do not show up instantly here right now. The discussion refreshes itself every so often.","error.membersOnly":"The forum is open to community members. Sign in and join the community to see it.","error.topicLocked":"This topic is closed, so you can't post in it any more. You can still read it.","error.topicCreationClosed":"You can't start a new topic in this category. Please try another one.","error.followLimit":"You're already following a lot. Please unfollow something and try again.","error.submit":"That didn't work. Please reload the page and try again.","need.sign_in":"Sign in to write in the discussion.","need.onboarding":"Before your first comment, choose a name and confirm the discussion rules and terms.","need.reconsent_rules":"The discussion rules have changed. Please confirm the new version.","need.art9_consent":"To write in the discussion, we need your consent to the processing.","state.visible":"Published","state.held":"Awaiting review","state.removed":"Removed","state.deleted":"Deleted","state.hiddenUntilConsent":"Awaiting your consent","note.identification_safety":"A mushroom can't be reliably identified from a photo, and edibility isn't decided here. If you suspect poisoning, call the Czech Toxicological Information Centre: +420 224 919 293 (24/7).","note.report_to_manufacturer":"If this is about a side effect of a product, please also tell us through the advice desk so we can look into it.","category.fraud_spam":"Fraud or spam","category.harassment":"Harassment","category.hate":"Hate speech","category.threats":"Threats","category.sexual_content":"Sexual content","category.child_at_risk":"A child at risk","category.self_harm":"Self-harm","category.doxxing":"Publishing someone else's personal data","category.copyright":"Copyright infringement","category.terrorism":"Terrorism","category.drugs":"Drugs","category.other_illegal":"Other illegal content","category.rules":"Breaks the discussion rules","category.adverse_event":"A side effect of a product","category.third_party_health_data":"Someone else's health information","category.suspected_minor":"The author seems younger than the rules allow","confirm.title":"Before you send it","confirm.about_self_or_consent":"I'm writing about myself, or I have the consent of the person I'm writing about.","confirm.good_faith":"I confirm that, to the best of my knowledge, this report is accurate and complete.","confirm.other":"I understand the notice and want to send the comment.","confirm.submit":"Confirm and send","warning.identifier":"The comment seems to contain an e-mail address, a phone number or an account number. If it shouldn't be there, edit the comment.","warning.invisible_chars":"We removed invisible characters from the comment.","warning.other":"The comment is published, but the discussion rules flag something in it. Please look it over.","author.deleted":"Deleted user","author.system":"Site notice","author.badge.team":"Team","discussion.title":"Discussion","discussion.count_one":"{count} comment","discussion.count_other":"{count} comments","discussion.empty":"There aren't any comments yet. Start the discussion.","discussion.loading":"Loading the discussion…","discussion.loadMore":"Load more","discussion.newMessages":"There are new comments in the discussion.","discussion.refresh":"Show","discussion.signInPrompt":"Sign in to join the discussion.","discussion.reply":"Reply","discussion.edit":"Edit","discussion.delete":"Delete","discussion.deleteTitle":"Delete the comment?","discussion.deleteExplain":"The comment disappears. If someone has replied to it, an empty placeholder stays in its place.","discussion.deleteConfirm":"Yes, delete","discussion.report":"Report","discussion.block":"Block the author","discussion.unblock":"Unblock the author","discussion.blocked":"You've blocked the author. Their comments will show collapsed.","discussion.unblocked":"You've unblocked the author.","discussion.menu":"More actions","discussion.collapsed":"A comment by an author you've blocked.","discussion.show":"Show","discussion.hide":"Hide","discussion.edited":"edited","discussion.translated":"Translated automatically","discussion.showOriginal":"Show the original","discussion.showTranslation":"Show the translation","discussion.showReplies_one":"Show {count} reply","discussion.showReplies_other":"Show {count} replies","discussion.repliesTruncated":"There are more replies than can be shown at once.","discussion.heldNote":"The comment is awaiting review and only you can see it for now. After the review it shows to others, or you'll find out why not in My community.","discussion.hiddenUntilConsentNote":"Only you can see this comment for now. Others will see it once you give your consent to the processing.","discussion.giveConsent":"Give consent","discussion.removedNote":"We removed this comment; others can't see it.","discussion.why":"Why?","discussion.placeholderHeld":"This comment is awaiting review.","discussion.placeholderRemoved":"This comment was removed.","discussion.placeholderDeleted":"This comment was deleted.","discussion.pending":"Sending…","discussion.reactions":"Reactions","discussion.reactionCount":"{emoji} {count}","discussion.reactionAdd":"Add a reaction","discussion.reactionRemove":"Remove the reaction","discussion.reactionMine":"Your reaction","composer.label":"Your comment","composer.replyLabel":"Your reply","composer.editLabel":"Editing the comment","composer.replyingTo":"Replying to: {name}","composer.placeholder":"Write a comment…","composer.counter":"{length} / {max} characters","composer.tooLong":"The comment is too long. Please shorten it to {max} characters at most.","composer.linksNote_one":"A comment can hold up to {count} link.","composer.linksNote_other":"A comment can hold up to {count} links.","composer.shortcut":"You can also send it with {keys}.","composer.submit":"Send","composer.sending":"Sending…","composer.save":"Save","composer.cancel":"Cancel","composer.posted":"The comment is published.","composer.held":"We've got the comment; it's awaiting review now.","composer.cooldown_one":"You can post again in {count} second.","composer.cooldown_other":"You can post again in {count} seconds.","sanction.restriction":"Your posting in the discussion is restricted.","sanction.restrictionUntil":"Your posting in the discussion is restricted until {date}.","sanction.suspension":"Your discussion account is suspended.","sanction.suspensionUntil":"Your discussion account is suspended until {date}.","sanction.ban":"Your discussion account is closed.","sanction.statement":"Show the statement of reasons","onboarding.title":"Welcome to the discussion","onboarding.lede":"Before your first comment, we need a few things from you. It takes a moment.","onboarding.ageTitle":"How old are you?","onboarding.age.16_17":"16–17","onboarding.age.18_plus":"18 or older","onboarding.ageHint":"We ask once and keep only the age group.","onboarding.ageBelow":"The discussion is open from the age of {min}. You can keep reading it, though.","onboarding.rulesTitle":"Discussion rules","onboarding.rulesLede":"Please read how the discussion works.","onboarding.rulesLink":"The full rules","onboarding.rulesAccept":"I agree to the discussion rules.","onboarding.rulesTermsAccept":"I agree to the discussion rules and the terms.","onboarding.termsLink":"The discussion terms","onboarding.rulesChanged":"The discussion rules have changed since your last visit. Please read the new version and confirm it.","onboarding.art9Title":"Consent to processing","onboarding.art9Lede":"To write in the discussion, we need your consent as described below.","onboarding.art9LedeOptional":"We ask for your consent as described below. You can write in the public discussion without it too.","onboarding.art9Accept":"I consent to the processing as described above.","onboarding.art9Controller":"Consent for {label}","onboarding.art9Refuse":"I do not consent","onboarding.art9RefusedDone":"You can write in the public discussion without this consent.","onboarding.art9RequiredToWrite":"Without the consent you can only read.","onboarding.profileTitle":"How others will see you","onboarding.displayName":"Name in the discussion","onboarding.displayNameHint":"It can be a nickname. Every reader will see it.","onboarding.handle":"Username","onboarding.handleHint":"Lower-case letters, digits and the underscore, {min} to {max} characters. It can be changed once every {days} days.","onboarding.handleSuggested":"Suggested: {handle}","onboarding.avatar":"Picture next to your name","onboarding.avatarNone":"Without a picture","onboarding.continue":"Continue","onboarding.back":"Back","onboarding.submit":"Done","onboarding.done":"Done — you can write now.","report.title":"Report the comment","report.lede":"The site's team reviews the report. You'll see the outcome in My community.","report.category":"What's wrong with the comment?","report.rule":"Which rule does it break?","report.ruleOther":"Another rule","report.note":"A note for the team (optional)","report.noteHint":"Only the team that reviews the report sees the note.","report.counter":"{length} / {max} characters","report.submit":"Report","report.sending":"Sending…","report.cancel":"Cancel","report.done":"Thanks, we've got the report. You'll see the outcome in My community.","panel.title":"My community","panel.signIn":"My community is available after you sign in.","panel.profile":"Profile","panel.profileEdit":"Edit the profile","panel.statements":"Decisions about my content","panel.statementsEmpty":"Decisions about your content will show here.","panel.reports":"My reports","panel.reportsEmpty":"The reports you send will show here.","panel.notifications":"Notifications","panel.notificationsEmpty":"New notifications will show here.","panel.unread_one":"{count} unread notification","panel.unread_other":"{count} unread notifications","panel.markRead":"Mark as read","panel.blocks":"Blocked authors","panel.blocksEmpty":"Authors you block will show here.","panel.consents":"Consents","panel.art9Given":"Consent to the processing is given.","panel.art9NotGiven":"You haven't given consent to the processing yet.","panel.art9Refused":"You declined the consent to the processing.","panel.art9Withdraw":"Withdraw consent","panel.art9WithdrawTitle":"Withdraw your consent to the processing?","panel.art9WithdrawExplain":"You can keep reading the discussion. The forum posts you wrote under the consent are erased after 7 days — give the consent again before then and they stay. Whether you can write without the consent depends on the website's settings; it tells you before your next comment.","panel.art9WithdrawConfirm":"Yes, withdraw consent","panel.art9WithdrawCancel":"Keep the consent","panel.art9Withdrawn":"You've withdrawn your consent.","panel.export":"Download my data","panel.exportHint":"A JSON file with what the discussion keeps about you.","panel.exporting":"Preparing the file…","panel.exportFileName":"my-community","panel.erase":"Delete my discussion profile","panel.eraseExplain":"After a grace period we delete your discussion profile, your comments and reactions, unless the law requires us to keep them. Your account on the site stays. You can cancel it during the grace period.","panel.eraseTitle":"Really delete your discussion profile?","panel.eraseConfirm":"Yes, delete the profile","panel.eraseKeep":"Keep it","panel.eraseScheduled":"We will delete your discussion profile on {date}. You can cancel it until then.","panel.eraseCancel":"Cancel the deletion","panel.eraseCancelled":"The deletion is cancelled; your profile stays.","statement.title":"Statement of reasons","statement.decidedAt":"Decided on {date}","statement.provider":"Decided by: {entity}","statement.restriction":"Measure","statement.until":"Until {date}","statement.scope":"Scope","statement.scopeAll":"Everywhere","statement.basis":"Prompted by","statement.facts":"Facts and circumstances","statement.automation":"Automation","statement.automatedDetection":"Detected automatically","statement.automatedDecision":"Decided automatically","statement.humanDecision":"Decided by a person","statement.legalGround":"Legal ground","statement.contractualGround":"Rule","statement.redress":"Redress","statement.subject":"Concerns","statement.subjectMessage":"A comment","statement.subjectProfile":"A profile","statement.subjectArticle":"An article","statement.full":"The full statement","statement.appealTitle":"Appeal","statement.appealLede":"Don't agree with the decision? Tell us why. Where possible, a different person from the one who decided reviews the appeal.","statement.appealUntil":"You can appeal until {date}.","statement.appealBody":"Why don't you agree with the decision?","statement.appealCounter":"{length} / {max} characters","statement.appealSubmit":"Send the appeal","statement.appealSending":"Sending…","statement.appealSent":"We've got the appeal. We'll let you know once it's reviewed.","statement.appealOpen":"Your appeal is being reviewed.","statement.appealWithdraw":"Withdraw the appeal","statement.appealWithdrawn":"You've withdrawn the appeal.","statement.appealClosed":"The time for an appeal has passed.","statement.appealUnavailable":"This decision can't be appealed any more.","restriction.no_action":"Left as it was","restriction.warning":"A warning","restriction.removal":"Content removed","restriction.visibility_restricted":"Visibility restricted","restriction.posting_restricted":"Posting restricted","restriction.account_suspended":"Account suspended","restriction.account_terminated":"Account closed","basis.notice":"A report","basis.own_initiative":"Our own review","basis.order":"An official order","caseStatus.open":"Under review","caseStatus.decided":"Decided","caseStatus.appealed":"Under appeal","caseStatus.closed":"Closed","appealStatus.open":"Under review","appealStatus.upheld":"The decision stands","appealStatus.reversed":"The decision was reversed","appealStatus.withdrawn":"Withdrawn","adverseOutcome.recorded":"Assessed as a possible adverse reaction and recorded in the register.","adverseOutcome.reported_to_authority":"Assessed as a possible adverse reaction and reported to the competent authority.","adverseOutcome.not_adverse":"Assessed: it is not an adverse reaction.","notification.decision":"There is a new decision about your content.","notification.appeal_resolved":"Your appeal has been resolved.","notification.erasure_scheduled":"The deletion of your discussion profile is scheduled.","notification.inactivity_warning":"You haven't been active in the discussion for a long time. Without further activity, we'll delete your profile after a while.","notification.module_read_only":"The community's extra features are switched off. The discussions under articles go on; what changes for you is on the My community page.","notification.module_braked":"Writing in the community is paused for now. You can keep reading.","notification.reply":"Someone replied to your post.","notification.mention":"Someone mentioned you in a discussion.","notification.module_push_reset":"Browser notifications need to be switched on again in your community settings.","notification.age_limit_changed":"The community is now for adults only, so your profile is read-only. The details are on the My community page.","notification.topic_update":"A discussion you follow has a new post.","notification.category_topic":"A category you follow has a new topic.","notification.category_topic.article":"A category you follow has a new discussion under an article.","centre.title":"Notifications","centre.empty":"New notifications will show here.","centre.markAllRead":"Mark all as read","centre.settings":"Notification settings","centre.loadMore":"Load older","centre.unreadOnly":"Unread only","centre.signIn":"Sign in to see your notifications.","centre.openMessage":"Show the post","badge.unread_one":"{count} new notification","badge.unread_other":"{count} new notifications","settings.title":"Notification settings","settings.signIn":"Sign in to change your notification settings.","settings.notifyReply":"Replies to my posts","settings.notifyMention":"When someone mentions me","settings.notifyTopic":"News in discussions I follow","settings.pushEnabled":"Browser notifications","settings.digestEmail":"Daily e-mail summary","settings.quietHours":"Quiet hours: between 22:00 and 7:00, browser notifications wait until the morning.","settings.saved":"Saved.","settings.push.enable":"Turn on notifications","settings.push.disable":"Turn off notifications","settings.push.carries":"This website delivers the notifications. A notification doesn't say what arrived or who it's from.","settings.push.unsupported":"This browser can't show notifications. You'll find new replies and mentions on the notifications page.","settings.push.refused":"Notifications couldn't be turned on in this browser. Please try again later or in another browser.","settings.push.denied":"This browser blocks notifications for this site. You can allow them in the browser settings.","settings.push.inAppExplain":"Notifications can't be turned on inside the Facebook or Instagram app. Open the page in your browser.","settings.push.openInBrowser":"Open in browser","settings.push.iosGuide":"On an iPhone or iPad, notifications work only for a site added to the Home Screen: in Safari tap Share and choose “Add to Home Screen”. Then open the site from the Home Screen and turn notifications on.","settings.push.reset":"Turn notifications on again: a site setting changed, so the earlier setup no longer works.","settings.digest.prompt":"Do you want to stop receiving the daily e-mail summary?","settings.digest.confirm":"Stop the daily summary","settings.digest.unsubscribed":"We've switched off the daily e-mail summary.","settings.digest.staleLink":"This unsubscribe link is no longer valid. Sign in to switch the summary off in the settings.","profile.memberSince":"Member since {date}","profile.bio":"About me","profile.notFound":"We couldn't find this profile.","profile.signIn":"Sign in to see members' profiles.","trust.0":"New member","trust.1":"Member","trust.2":"Regular","trust.3":"Trusted member","role.moderator":"Moderator","welcome.title":"Welcome to the community","welcome.lede":"Here are a few things that help at the start.","welcome.rules":"How the discussion works","welcome.discussions":"Browse the discussions","welcome.settings":"Set up notifications","welcome.profile":"My profile","realtime.off":"Live updates are off right now. The discussion refreshes itself every so often.","state.readOnly":"The community's extra features are switched off for now. The discussion under the article goes on.","state.braked":"Writing is paused for a while. You can keep reading.","state.away":"The team is away for now; new topics will wait for review.","topic.deleted":"Deleted topic","topic.withheld":"Topic title unavailable","follow.follow":"Follow","follow.following":"Following","follow.followed":"You're following. You'll see what's new in your notifications.","follow.unfollowed":"You've stopped following.","follow.unavailable":"You can't follow this right now.","forum.title":"Forum","forum.loading":"Loading the forum…","forum.empty":"The forum has no categories yet.","forum.topicCount_one":"{count} topic","forum.topicCount_other":"{count} topics","forum.discussionCount_one":"{count} discussion","forum.discussionCount_other":"{count} discussions","forum.lastActivity":"Last activity {date}","forum.latest":"Latest topics","forum.allTopics":"All topics","forum.allCategories":"All categories","forum.search":"Search the forum","forum.searchSubmit":"Search","forum.modePre":"New posts here wait for review before they appear.","forum.teamTopics":"The team starts the topics here.","forum.join":"Join the community","forum.back":"Back to the forum","state.forumBraked":"Posting in the forum is paused for a while. You can keep reading.","forumCategory.notFound":"We couldn't find this category.","forumCategory.empty":"There are no topics in this category yet.","forumCategory.articlesEmpty":"There are no article discussions here yet.","forumCategory.sort":"Sort","forumCategory.sortActivity":"By activity","forumCategory.sortNew":"Newest","forumCategory.newTopic":"New topic","topic.loading":"Loading the topic…","topic.notFound":"We couldn't find this topic. It may no longer be available.","topic.count_one":"{count} post","topic.count_other":"{count} posts","topic.locked":"Closed","topic.archived":"Archived","topic.pinned":"Pinned","topic.titleLabel":"Topic title","topic.titleMissing":"Please give the topic a title.","topic.titleTooLong":"The title is too long. Please shorten it to {max} characters at most.","topic.bodyLabel":"Opening post","topic.create":"Start the topic","topic.created":"The topic is up.","topic.createdHeld":"We've got the topic; it's awaiting review now.","topic.open":"Open the topic","forumText.composer.label":"Your post","forumText.composer.editLabel":"Editing the post","forumText.composer.placeholder":"Write a post…","forumText.composer.tooLong":"The post is too long. Please shorten it to {max} characters at most.","forumText.composer.linksNote_one":"A post can hold up to {count} link.","forumText.composer.linksNote_other":"A post can hold up to {count} links.","forumText.composer.posted":"The post is published.","forumText.composer.held":"We've got the post; it's awaiting review now.","forumText.composer.cooldown_one":"You can post again in {count} second.","forumText.composer.cooldown_other":"You can post again in {count} seconds.","forumText.discussion.empty":"There aren't any replies yet. Be the first to reply.","forumText.discussion.deleteTitle":"Delete the post?","forumText.discussion.deleteExplain":"The post disappears. If someone has replied to it, an empty placeholder stays in its place.","forumText.discussion.collapsed":"A post by an author you've blocked.","forumText.discussion.heldNote":"The post is awaiting review and only you can see it for now. After the review it shows to others, or you'll find out why not in My community.","forumText.discussion.hiddenUntilConsentNote":"Only you can see this post for now. Others will see it once you give your consent to the processing.","forumText.discussion.removedNote":"We removed this post; others can't see it.","forumText.discussion.placeholderHeld":"This post is awaiting review.","forumText.discussion.placeholderRemoved":"This post was removed.","forumText.discussion.placeholderDeleted":"This post was deleted.","forumText.report.title":"Report the post","forumText.report.category":"What's wrong with the post?","forumText.error.links":"This post has more links than fit. Please remove some of them.","forumText.error.blocked":"This post can't be published as it is. Please try editing it.","forumText.error.confirm":"Before you send the post, please confirm one thing.","forumText.confirm.other":"I understand the notice and want to send the post.","forumText.warning.identifier":"The post seems to contain an e-mail address, a phone number or an account number. If it shouldn't be there, edit the post.","forumText.warning.other":"The post is published, but the discussion rules flag something in it. Please look it over.","forumText.need.onboarding":"Before your first post, choose a name and confirm the discussion rules and terms.","forumText.need.art9_consent":"To write in the forum, we need your consent to the processing.","search.title":"Search the forum","search.label":"What are you looking for?","search.submit":"Search","search.searching":"Searching…","search.tooShort":"Please type at least {min} characters.","search.tooLong":"The search text is too long. Please shorten it to {max} characters at most.","search.empty":"We found no results for that. Try other words.","search.more":"More results","search.lastPage":"We don't show more results. Try narrowing the search.","search.space":"Where to search","search.spaceAll":"Everywhere","search.spaceForum":"In the forum","search.spaceArticle":"In article discussions","search.category":"Category","search.topic":"Topic","search.message":"Post","search.inArticle":"An article discussion","moderation.title":"Moderation","moderation.loading":"Loading the queue…","moderation.empty":"The queue is empty right now.","moderation.source.member_report":"Reported by a member","moderation.source.filter":"Caught by the filters","moderation.source.staff":"From the team","moderation.premod":"Awaiting approval","moderation.heldBySystem":"Hidden automatically for now","moderation.deadline":"Due by {date}","moderation.open":"Review","moderation.package":"Content to review","moderation.itemWithheld":"Others can't see this post now, so it isn't shown here.","moderation.restriction":"Decision","moderation.factsHint":"Describe what you found. The text becomes part of the statement of reasons for the author.","moderation.ruleRequired":"Please choose the rule the decision rests on.","moderation.preview":"Preview the statement","moderation.previewTitle":"This is the statement the author will see","moderation.decide":"Decide","moderation.decided":"Decided.","moderation.escalate":"Pass to the team","moderation.escalateLede":"Do you think it's illegal? Pass it to the site's team to assess.","moderation.escalateCategory":"What is it?","moderation.escalated":"Passed to the team.","moderation.remove":"Remove as a moderator","moderation.removeLede":"The post disappears and its author gets a statement of reasons they can appeal.","moderation.removed":"Removed. The author got a statement of reasons.","moderation.approve":"Publish","moderation.approved":"Published.","moderation.reject":"Reject","moderation.rejected":"Rejected. The author got a statement of reasons.","moderation.gone":"This item is no longer in the queue.","moderation.textChanged":"The author has edited the text since. Read the new version and decide again.","moderation.lock":"Close the topic","moderation.unlock":"Reopen the topic","moderation.pin":"Pin the topic","moderation.unpin":"Unpin the topic","moderation.move":"Move the topic","moderation.moveTo":"Where to move the topic?","moderation.done":"Done.","moderation.openTopic":"View in the topic","profile.moderates":"In the categories","mention.limit":"This post mentions more people than you can mention yet.","notice.title":"Report content","notice.lede":"You can report a comment, a profile or an article, even without signing in.","notice.noTarget":"Open a report from the content you want to report: on a comment, choose “Report”.","notice.category":"Why are you reporting the content?","notice.target":"What you're reporting","notice.targetMessage":"A comment","notice.targetProfile":"A profile","notice.targetArticle":"An article","notice.rule":"Which rule does the content break?","notice.description":"Description","notice.descriptionHint":"Please describe what's wrong with the content and why.","notice.counter":"{length} / {max} characters","notice.contactTitle":"Contact (optional)","notice.contactHint":"We need a contact to confirm that the report arrived and to send you the outcome.","notice.name":"Name","notice.email":"E-mail","notice.childAtRisk":"We take reports of a child at risk without a name or an e-mail address.","notice.submit":"Send the report","notice.sending":"Sending…","notice.done":"Thanks, we've got the report.","notice.receiptLede":"Keep the link below. It's how you'll find out how we handled the report.","notice.statusLink":"Report status","notice.noContactKept":"We don't keep a contact for this report, so the outcome won't come by e-mail. You'll find it through the link above.","notice.captchaUnavailable":"The robot check didn't load (a browser extension may be blocking it), so the form can't be sent right now. Please try reloading the page.","notice.statusTitle":"Report status","notice.submittedAt":"Sent on {date}","notice.decidedAt":"Decided on {date}","notice.statement":"Statement of reasons","notice.outcome":"Outcome","notice.redress":"If you disagree with how it was dealt with, you can turn to a court or use an out-of-court dispute settlement.","notice.appealTitle":"Appeal","notice.appealLede":"Don't agree with how we handled the report? Tell us why.","notice.appealBody":"Why don't you agree with the decision?","notice.appealSubmit":"Send the appeal","notice.appealSent":"We've got the appeal.","notice.appealOpen":"Your appeal is being reviewed.","notice.appealWithdraw":"Withdraw the appeal","notice.appealUntil":"You can appeal until {date}.","notice.appealClosed":"The time for an appeal has passed.","notice.receiptMissing":"The link is missing the report number. Please open the whole link from the e-mail.","common.signIn":"Sign in","common.close":"Close","common.cancel":"Cancel","common.retry":"Try again","common.loading":"Loading…","common.back":"Back","common.optional":"optional","common.needsJs":"This part of the page needs JavaScript. Please turn it on and reload the page."},Ai=Object.freeze({cs:Object.freeze(hp),en:Object.freeze(bp)});function gp(e){return(typeof e=="string"?e.toLowerCase().split("-")[0]:"")==="cs"?"cs":"en"}const Oi=new Map;function vp(e,t){if(!Oi.has(e)){let n=null;try{n=new Intl.PluralRules(e)}catch{}Oi.set(e,n)}return Oi.get(e)?.select(t)??"other"}function yp(e){const t=typeof e=="number"?e:typeof e=="string"&&e.trim()!==""?Number(e):Number.NaN;return Number.isFinite(t)?t:null}function To(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function _p(e,t){return t?e.replace(/\{(\w+)\}/g,(n,s)=>Object.prototype.hasOwnProperty.call(t,s)&&t[s]!=null?String(t[s]):n):e}function El(e,t,n){const s=gp(e),o=Ai[s];let r=To(o,t);if(r===void 0){const a=yp(n?.count),l=a===null?"other":vp(s,a);r=To(o,`${t}_${l}`)??To(o,`${t}_other`)}return r===void 0?String(t):_p(r,n)}function Xn(e){return typeof e!="string"?!1:To(Ai.en,e)!==void 0||To(Ai.en,`${e}_other`)!==void 0}function kp(e){return typeof e=="string"&&e.startsWith("identifier_")?"warning.identifier":e==="invisible_chars"?"warning.invisible_chars":"warning.other"}function wp(e){const t=`confirm.${e}`;return e!=="title"&&e!=="submit"&&e!=="other"&&Xn(t)?t:"confirm.other"}function $p(e){const t=`note.${e}`;return Xn(t)?t:null}function xp(e){return Fa.includes(e)?`notification.${e}`:null}function Ip(e){const t=xp(e.code);return t==="notification.category_topic"&&typeof e.articleId=="string"&&e.articleId!==""?"notification.category_topic.article":t}function Tp(e){const t=typeof e=="string"?Bf.indexOf(e):-1;return t<0?null:`trust.${t}`}function Ei(e){return typeof e=="string"&&Vf.includes(e)?`adverseOutcome.${e}`:null}const Cp=["statementPath","myCommunityPath","rulesPath","termsPath","reportPath","noticesPath","consultationPath","profilePath","settingsPath","notificationsPath","welcomePath","discussionsPath","articlePath","forumPath","categoryPath","topicPath","searchPath"];function hs(e){return typeof e=="string"&&/^\/(?![/\\])/.test(e)&&!/[\s\\\u0000-\u001f\u007f]/.test(e)}const Ml=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Pl(e){if(typeof e!="string")return e;if(e.trim()==="")return null;try{return JSON.parse(e)}catch{return null}}function Mt(e){const t=Pl(e),n={};if(!Ml(t))return n;for(const s of Cp)hs(t[s])&&(n[s]=t[s]);return n}function Sp(e){if(e==null||e==="")return"";if(typeof e!="string")return null;const t=e.replace(/\/+$/,"");return t===""?e.startsWith("/")?"":null:/^(?:\/(?!\.{1,2}(?:\/|$))[A-Za-z0-9._~%-]+)+$/.test(t)?t:null}function Pt(e,t,n=""){const s=o=>hs(o)?o:void 0;return{statementPath:e.statementPath??s(t?.statementPath)??`${n}${Ne.statement}`,myCommunityPath:e.myCommunityPath??s(t?.myCommunityPath)??`${n}${Ne.myCommunity}`,rulesPath:e.rulesPath??`${n}${Ne.rules}`,termsPath:e.termsPath??Rl(e.rulesPath??`${n}${Ne.rules}`),reportPath:e.reportPath??`${n}${Ne.report}`,noticesPath:e.noticesPath??`${n}${Ne.notices}`,consultationPath:e.consultationPath??null,profilePath:e.profilePath??`${n}${Ne.profile}`,settingsPath:e.settingsPath??`${n}${Ne.settings}`,notificationsPath:e.notificationsPath??`${n}${Ne.notifications}`,welcomePath:e.welcomePath??`${n}${Ne.welcome}`,discussionsPath:e.discussionsPath??`${n}${Ne.discussions}`,articlePath:e.articlePath??null,forumPath:e.forumPath??`${n}${Ne.forum}`,categoryPath:e.categoryPath??`${n}${Ne.category}`,topicPath:e.topicPath??`${n}${Ne.topic}`,searchPath:e.searchPath??`${n}${Ne.search}`}}function Rl(e){return e.endsWith(Ne.rules)?`${e.slice(0,-Ne.rules.length)}${Ne.terms}`:null}const Ap=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Op=/^[a-z0-9][a-z0-9_]{2,29}$/,bs=e=>typeof e=="string"&&Ap.test(e),Nl=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>0;function gs(e){const t=Pl(e);return Ml(t)?"conversationId"in t?bs(t.conversationId)&&Nl(t.seq)?{conversationId:t.conversationId.toLowerCase(),seq:t.seq}:null:"memberId"in t?bs(t.memberId)?{memberId:t.memberId.toLowerCase()}:null:"handle"in t?typeof t.handle=="string"&&Op.test(t.handle)?{handle:t.handle}:null:"articleId"in t&&bs(t.articleId)?{articleId:t.articleId.toLowerCase()}:null:null}function Ep(e){return"conversationId"in e?"message":"articleId"in e?"article":"profile"}function Mp(e,t){return!hs(e)||e.includes("#")||!bs(t.conversationId)||!Nl(t.seq)?null:`${e}#c=${t.conversationId.toLowerCase()}&s=${t.seq}`}function Pp(e){if(typeof e!="string"||!e.startsWith("#")||e.startsWith("#t="))return null;const t=new Map;for(const r of e.slice(1).split("&")){const a=r.indexOf("=");a>0&&t.set(r.slice(0,a),r.slice(a+1))}const n=t.get("c"),s=t.get("s");if(n!==void 0&&s!==void 0&&/^\d{1,15}$/.test(s))return gs({conversationId:n,seq:Number(s)});const o=t.get("a");return o!==void 0?gs({articleId:o}):null}const jl=6e4,zl=99,Rp=e=>e>zl?`${zl}+`:String(e);function Np(e){const{client:t}=e,n=typeof e.intervalMs=="number"&&Number.isFinite(e.intervalMs)?e.intervalMs:jl,s=n>0?Math.max(n,jl):0,o=e.visible??(()=>typeof document>"u"||document.visibilityState!=="hidden"),r=new AbortController,a={signal:r.signal},l=Re({phase:"pending",count:0});let c=!1,p=!1,h=null,b=null;function _(){p=!1,h&&clearInterval(h),h=null,typeof document<"u"&&document.removeEventListener("visibilitychange",I)}function $(){l.phase="hidden",l.count=0,_()}function y(){return c||!p?Promise.resolve():(b??=(async()=>{const R=await t.me.notifications.unreadCount(a);if(!(c||!p)){if(R.ok){l.count=Math.max(0,Math.floor(R.value.count)),l.phase="shown";return}R.code==="signIn"&&$()}})().finally(()=>{b=null}),b)}function I(){o()&&y()}return{state:l,async start(){const R=await t.me.get(a);if(c)return;const P=R.ok?R.value.module?.state:void 0,T=P!==void 0&&(!Yn(P)||P==="dark");if(!R.ok||R.value.needs.includes("sign_in")||!R.value.member||T)return $();p=!0,typeof document<"u"&&document.addEventListener("visibilitychange",I),s>0&&(h=setInterval(()=>{o()&&y()},s)),o()&&await y()},refresh:y,dispose(){c||(c=!0,_(),r.abort())}}}const jp="/api/community",Ll=new Set;function qt(e,t){Ll.has(e)||(Ll.add(e),console.warn(t))}function ht(e){const t=Sp(e);return t===null&&qt("site-base",'[blogmcp-community] site-base must be a path on this site (e.g. "/blog"), never a URL: the site’s pages and its proxy are found under it'),t}function bt(e,t,n=""){const s=e==null||e===""?`${n}${jp}`:e;if(!Ba(s))return qt("api-base",'[blogmcp-community] api-base must be a path on this site (e.g. "/api/community"), never a URL: the community API is reached through the site’s own proxy or BFF'),null;try{return km(t?{base:s,transport:t}:{base:s})}catch{return qt("api-base","[blogmcp-community] api-base was refused by the community client"),null}}function De(...e){for(const t of e){if(!t)continue;const n=t.toLowerCase();if(n.startsWith("cs")||n.startsWith("sk"))return"cs";if(n.startsWith("en"))return"en"}return"en"}function qe(){return typeof document>"u"?null:document.documentElement.lang||null}function zp(e){return(t,n)=>El(e,t,n)}function Bt(e){return Xn(e)?e:null}const Dl=Symbol("bcm-text");function gt(e,t){const n=(o,r)=>El(e.value,t?.[o]??o,r),s={lang:e,t:n,text:o=>o?n(o.key,o.params):""};return jr(Dl,s),s}function vt(){const e=Qs(Dl,null);if(!e)throw new Error("[blogmcp-community] a component rendered outside its element");return e}let Fl=0;function Ve(e){return Fl+=1,`${e}-${Fl}`}function Mi(e,t,n){let s=null;const o=r=>{r.preventDefault(),t()};nt(()=>{const r=e.value;if(!r)return;if(s=r.getRootNode().activeElement??null,r.addEventListener("cancel",o),typeof r.showModal=="function")try{r.showModal()}catch{r.setAttribute("open","")}else r.setAttribute("open","")}),Ge(()=>{const r=e.value;r?.removeEventListener("cancel",o),r?.open&&typeof r.close=="function"&&r.close();const a=s;Le(()=>{(a&&a.isConnected?a:n?.()??null)?.focus()})})}const Lp=["lang","href","aria-label","title"],Dp={"aria-hidden":"true"},Fp=$e({inheritAttrs:!1,__name:"BadgeView",props:{apiBase:{},siteBase:{},lang:{},routes:{},pollMs:{},transport:{type:Function}},setup(e){const t=e,n=ue(De(t.lang,qe())),{t:s}=gt(n),o=ht(t.siteBase),r=o===null?null:bt(t.apiBase,t.transport,o),a=r?Np({client:r,...typeof t.pollMs=="number"?{intervalMs:t.pollMs}:{}}):null,l=a?.state??null,c=z(()=>Pt(Mt(t.routes),null,o??""));return nt(()=>{a?.start()}),Ge(()=>a?.dispose()),(p,h)=>i(l)&&i(l).phase==="shown"&&i(l).count>0?(d(),m("a",{key:0,class:"bcm-badge-link",lang:n.value,href:c.value.notificationsPath,"aria-label":i(s)("badge.unread",{count:i(l).count}),title:i(s)("badge.unread",{count:i(l).count})},[f("span",Dp,u(i(Rp)(i(l).count)),1)],8,Lp)):S("",!0)}}),Ul=e=>e==="cs"?"cs-CZ":"en-GB",Pi=new Map;function Up(e,t){const n=`${e}:${t?"t":"d"}`;if(!Pi.has(n)){let s=null;try{s=new Intl.DateTimeFormat(Ul(e),t?{dateStyle:"medium",timeStyle:"short"}:{dateStyle:"long"})}catch{}Pi.set(n,s)}return Pi.get(n)??null}function Pe(e,t,n=!0){if(typeof t!="string"||t==="")return"";const s=Date.parse(t);return Number.isFinite(s)?Up(e,n)?.format(new Date(s))??t:""}const qp=new Map;function Bp(e,t){if(typeof t!="string"||!/^\d{4}-(?:0[1-9]|1[0-2])$/.test(t))return"";const n=Ri(qp,e,s=>new Intl.DateTimeFormat(s,{day:"numeric",month:"long",year:"numeric",timeZone:"UTC"}));try{const s=n?.formatToParts(new Date(`${t}-01T00:00:00.000Z`));if(!s)return t;const o=s.findIndex(a=>a.type==="day");return s.filter((a,l)=>l!==o&&!(l===o+1&&s[l].type==="literal")).map(a=>a.value).join("").trim()||t}catch{return t}}function ql(e,t=Date.now()){if(typeof e!="string")return!1;const n=Date.parse(e);return Number.isFinite(n)&&n<=t}const Hp=/^[A-Z]{2}(?:,[A-Z]{2})*$/,Vp=new Map,Kp=new Map;function Ri(e,t,n){if(!e.has(t)){let s=null;try{s=n(Ul(t))}catch{}e.set(t,s)}return e.get(t)??null}function Wp(e,t){try{return Ri(Vp,e,n=>new Intl.DisplayNames(n,{type:"region"}))?.of(t)||t}catch{return t}}function Yp(e,t){if(typeof t!="string")return"";const n=t.trim();if(n==="all")return zp(e)("statement.scopeAll");if(!Hp.test(n))return n;const s=n.split(",").map(o=>Wp(e,o));try{return Ri(Kp,e,o=>new Intl.ListFormat(o,{type:"conjunction"}))?.format(s)??s.join(", ")}catch{return s.join(", ")}}function Ie(e,t){const n=e.until?Pe(t,e.until):"";return e.code==="restricted"&&n?{key:"sanction.restrictionUntil",params:{date:n}}:e.code==="suspended"&&n?{key:"sanction.suspensionUntil",params:{date:n}}:{key:`error.${e.code}`}}const Gp=Object.freeze({fast:3,quota:60});function Ni(e,t){const n=Gp[e.code];if(n===void 0)return null;const s=typeof e.retryAfterS=="number"&&e.retryAfterS>0?e.retryAfterS:n;return t+s*1e3}const Bl=120,Zp=Object.freeze({method:"show",origin:"show",unavailable:"retry",invalid:"show",signIn:"reload",onboarding:"onboard",age:"show",name:"show",handle:"show",restricted:"reload",suspended:"reload",terminated:"reload",links:"show",fast:"wait",blocked:"show",confirm:"confirm",removed:"reload",quota:"wait",captcha:"show",notFound:"reload",surfaceOff:"hide",notMoved:"notMoved",ledger:"retry",braked:"wait",readOnly:"reload",mentionLimit:"show",pushRefused:"show",realtimeOff:"hide",membersOnly:"reload",topicLocked:"reload",topicCreationClosed:"show",followLimit:"show",submit:"show"});function Hl(e){return Zp[e]??"show"}var vs={},We={},Vl;function Jp(){return Vl||(Vl=1,Object.defineProperty(We,"__esModule",{value:!0}),We.BLANK_URL=We.relativeFirstCharacters=We.whitespaceEscapeCharsRegex=We.urlSchemeRegex=We.ctrlCharactersRegex=We.htmlCtrlEntityRegex=We.htmlEntitiesRegex=We.invalidProtocolRegex=void 0,We.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,We.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,We.htmlCtrlEntityRegex=/&(newline|tab);/gi,We.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,We.urlSchemeRegex=/^.+(:|:)/gim,We.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,We.relativeFirstCharacters=[".","/"],We.BLANK_URL="about:blank"),We}var Kl;function Xp(){if(Kl)return vs;Kl=1,Object.defineProperty(vs,"__esModule",{value:!0}),vs.sanitizeUrl=r;var e=Jp();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function n(a){var l=a.replace(e.ctrlCharactersRegex,"");return l.replace(e.htmlEntitiesRegex,function(c,p){return String.fromCharCode(p)})}function s(a){return URL.canParse(a)}function o(a){try{return decodeURIComponent(a)}catch{return a}}function r(a){if(!a)return e.BLANK_URL;var l,c=o(a.trim());do c=n(c).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),c=o(c),l=c.match(e.ctrlCharactersRegex)||c.match(e.htmlEntitiesRegex)||c.match(e.htmlCtrlEntityRegex)||c.match(e.whitespaceEscapeCharsRegex);while(l&&l.length>0);var p=c;if(!p)return e.BLANK_URL;if(t(p))return p;var h=p.trimStart(),b=h.match(e.urlSchemeRegex);if(!b)return p;var _=b[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(_))return e.BLANK_URL;var $=h.replace(/\\/g,"/");if(_==="mailto:"||_.includes("://"))return $;if(_==="http:"||_==="https:"){if(!s($))return e.BLANK_URL;var y=new URL($);return y.protocol=y.protocol.toLowerCase(),y.hostname=y.hostname.toLowerCase(),y.toString()}return $}return vs}var Qp=Xp();const eh="nofollow ugc noopener noreferrer",th=/\b(?:https?:\/\/|www\.)[^\s<>"'`{}|\\^]+/gi,nh=`.,;:!?…'"»”’]`;function oh(e){let t=e;for(;t.length>0;){const n=t[t.length-1];if(n===")"){const s=t.split("(").length-1;if(t.split(")").length-1<=s)break}else if(!nh.includes(n))break;t=t.slice(0,-1)}return t}function sh(e){const t=/^www\./i.test(e)?`https://${e}`:e;if(/^https?:\/\/$/i.test(t))return null;const n=Qp.sanitizeUrl(t);return n!=="about:blank"&&/^https?:\/\//i.test(n)?n:null}function ih(e){const t=[];if(typeof e!="string"||e==="")return t;let n=0;for(const s of e.matchAll(th)){const o=s.index??0;if(o<n)continue;const r=oh(s[0]),a=r?sh(r):null;a&&(o>n&&t.push({kind:"text",text:e.slice(n,o)}),t.push({kind:"link",text:r,href:a}),n=o+r.length)}return n<e.length&&t.push({kind:"text",text:e.slice(n)}),t}function rh(e,t){const n=ih(e);if(!t)return n;const s=[];for(const o of n){if(o.kind!=="text"||!o.text.includes("@")){s.push(o);continue}for(const r of Al(o.text)){const a=r.kind==="mention"?t(r.handle):null;if(r.kind==="mention"&&a)s.push({kind:"mention",text:r.text,href:a});else{const l=s[s.length-1];l&&l.kind==="text"?s[s.length-1]={kind:"text",text:l.text+r.text}:s.push({kind:"text",text:r.text})}}}return s}function lt(e){let t=0;for(const n of e)t++;return t}function Ze(e){return typeof e=="string"?e.normalize("NFC").trim():""}const ah=Object.freeze({amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",ndash:"–",mdash:"—",hellip:"…",laquo:"«",raquo:"»",bdquo:"„",ldquo:"“",rdquo:"”",lsquo:"‘",rsquo:"’",sbquo:"‚",copy:"©",reg:"®",euro:"€",shy:""});function lh(e){return e.replace(/&(#\d{1,7}|#x[0-9a-f]{1,6}|[a-z]{2,8});/gi,(t,n)=>{if(n[0]==="#"){const s=n[1]==="x"||n[1]==="X",o=Number.parseInt(n.slice(s?2:1),s?16:10);return o>0&&o<=1114111&&!(o>=55296&&o<=57343)?String.fromCodePoint(o):t}return ah[n.toLowerCase()]??t})}const ch=/<\/(?:p|div|li|h[1-6]|section|article|blockquote|tr|ul|ol|dl|dt|dd|header|footer|table|pre|figure)\s*>/gi,uh=/<(?:li|tr|dt|dd|h[1-6]|blockquote|pre|figure)\b[^>]*>/gi;function Wl(e){if(typeof e!="string"||e==="")return[];const t=e.replace(/<!--[\s\S]*?-->/g,"").replace(/<(script|style|template|noscript|svg|math)\b[\s\S]*?<\/\1\s*>/gi,"").replace(/[\t\n\r\f ]+/g," ").replace(/<br\b[^>]*>/gi,`
|
|
5
|
+
`).replace(ch,`
|
|
6
6
|
|
|
7
|
-
`).replace(
|
|
7
|
+
`).replace(uh,`
|
|
8
8
|
|
|
9
|
-
`).replace(/<[^>]*>/g,"");return
|
|
10
|
-
`).replace(/[ ]{2,}/g," ").trim()).filter(n=>n!=="")}function ys(e){return typeof e=="string"?e.normalize("NFKC").replace(/\s+/gu," ").trim():""}function Kl(e){const t=lt(ys(e));return t>=Cf&&t<=Na}const Wl=3,_s=30;function Qn(e){return typeof e=="string"?e.trim().toLowerCase():""}function Yl(e){const t=Qn(e);return t===""||yo.test(t)}const ch=Object.freeze({ß:"ss",ł:"l",đ:"d",ð:"d",ø:"o",ħ:"h",ŧ:"t",ı:"i",æ:"ae",œ:"oe",þ:"th",ŀ:"l"});function uh(e){const s=ys(e).toLowerCase().normalize("NFD").replace(new RegExp("\\p{M}+","gu"),"").normalize("NFC").replace(/[ßłđðøħŧıæœþŀ]/g,o=>ch[o]??o).split(/[^a-z0-9]+/).filter(o=>o!=="").join("_").slice(0,24).replace(/_+$/,"");return yo.test(s)?s:null}const dh=new Set(["displayName","handle","avatarPreset"]),fh=new Set(["rulesTextId","art9TextId"]),mh="art9_refusal_read_only",Gl=e=>e.code==="invalid"&&e.issueCodes?.includes(mh)===!0;function ph(e,t){return Gl(e)?{key:"onboarding.art9RequiredToWrite"}:Ie(e,t)}function hh(e,t,n,s){const o=[];e.member?.ageBand||o.push("age"),e.acceptances.rules!=="accepted"&&o.push("rules");const r=e.acceptances.art9Consent,a=e.acceptances.art9Refused===!0&&qa(e.settings?.art9Refusal)==="public_write",l=s&&r!=="accepted"&&!a;return(t.includes("art9_consent")||n&&r!==null&&r!=="accepted"||l)&&o.push("art9"),e.profile||o.push("profile"),o}function bh(e,t){if(!e)return[];const n=Yf(e.bodyJson);return t==="split"&&n.length>1?n.map(s=>({entity:s.entity,label:s.label})):[{entity:n[0]?.entity??"",label:n.length>1?"":n[0]?.label??""}]}function ks(e){const t=e.signal?{signal:e.signal}:{},n=e.offerArt9===!0,s=e.forceArt9===!0&&!n,o=Re({phase:"loading",steps:[],index:0,me:null,rulesText:null,rules:[],art9Text:null,art9Paragraphs:[],art9Layout:"joint",art9Refusal:"read_only",art9Controllers:[],art9Refused:!1,art9RefusedSent:!1,reconsent:!1,ageBand:null,rulesAccepted:!1,get art9Accepted(){return this.art9Controllers.length>0&&this.art9Controllers.every(k=>k.accepted)},set art9Accepted(k){for(const E of this.art9Controllers)E.accepted=k},displayName:"",handle:"",avatarPreset:null,failure:null,fields:[],minAge:null}),r=k=>{o.failure=k,o.phase="failed"};async function a(k){const[E,w]=await Promise.all([k.includes("rules")?e.client.legal.current({kind:"rules",locale:e.lang},t):null,k.includes("art9")?e.client.legal.current({kind:"art9_consent",locale:e.lang},t):null]);for(const y of[E,w])if(y&&!y.ok)return r(y),null;return{rules:E?.ok?E.value:null,art9:w?.ok?w.value:null}}async function l(){const k=await e.client.me.get(t);if(!k.ok)return r(k),null;const E=k.value.needs.filter(Wn);if(E.includes("sign_in"))return e.onSignIn(),null;const w=hh(k.value,E,n,s),y=await a(w);return y?{me:k.value,steps:w,texts:y}:null}const c=()=>!n&&o.art9Refusal==="public_write";function p(k){k.texts.rules?.textId!==o.rulesText?.textId&&(o.rulesAccepted=!1);const E=Kf(k.me.settings?.art9ConsentLayout),w=k.texts.art9!==null&&k.texts.art9.textId===o.art9Text?.textId;o.art9Controllers=bh(k.texts.art9,E).map((y,x)=>{const N=o.art9Controllers[x];return{...y,accepted:w&&N?.entity===y.entity&&N.accepted===!0}}),o.art9Layout=E,o.art9Refusal=qa(k.me.settings?.art9Refusal),(!w||!c())&&(o.art9Refused=!1),o.me=k.me,o.steps=k.steps,o.reconsent=k.me.acceptances.rules==="reconsent_required",o.rulesText=k.texts.rules,o.rules=k.texts.rules?Gn(k.texts.rules.bodyJson):[],o.art9Text=k.texts.art9,o.art9Paragraphs=k.texts.art9?lh(k.texts.art9.body):[]}async function h(){o.phase="loading",o.failure=null;const k=await l();if(k){if(p(k),o.index=0,k.steps.length===0){if(n){o.phase="done",e.onDone(k.me);return}return j()}o.phase="ready"}}const b=()=>o.steps[o.index]??null;function _(k){switch(k){case"age":return o.ageBand!==null;case"rules":return o.rulesAccepted&&o.rulesText!==null;case"art9":return o.art9Text!==null&&(o.art9Accepted||o.art9Refused&&c());case"profile":return Kl(o.displayName)&&Yl(o.handle)}}function $(){const k=b();return o.phase!=="ready"||k===null?!1:k==="art9"?o.art9Text!==null&&o.art9Accepted:_(k)}function v(k){const E=o.steps.indexOf(k);E>=0&&(o.index=E)}const I=()=>o.steps.findIndex(k=>!_(k));async function j(){const k=I();if(k>=0){o.index=k;return}o.phase="sending",o.failure=null,o.fields=[];const E={ageBand:o.ageBand??o.me?.member?.ageBand??"18_plus",rulesTextId:o.steps.includes("rules")&&o.rulesText?o.rulesText.textId:""};let w=!1;if(o.steps.includes("art9")&&o.art9Text&&(o.art9Accepted?E.art9TextId=o.art9Text.textId:o.art9Refused&&c()&&(E.art9Refused=!0,w=!0)),o.steps.includes("profile")){E.displayName=ys(o.displayName);const x=Qn(o.handle);x!==""&&(E.handle=x),E.avatarPreset=o.avatarPreset}const y=await e.client.me.onboard(E,t);if(y.ok){o.art9RefusedSent=w,o.phase="done",e.onDone(y.value);return}switch(o.failure=y,o.phase="ready",y.code){case"age":o.minAge=18,o.phase="refused",e.onRefused?.(o.minAge);return;case"name":return o.fields=Qn(o.handle)!==""?["displayName","handle"]:["displayName"],v("profile");case"handle":return o.fields=["handle"],v("profile");case"invalid":return o.fields=y.fields??[],Gl(y)||o.fields.includes("art9Refused")?(o.art9Refused=!1,P(y)):o.fields.some(x=>dh.has(x))?v("profile"):o.fields.some(x=>fh.has(x))?P(y):o.fields.includes("ageBand")?v("age"):void 0;case"signIn":return e.onSignIn();default:return}}async function P(k){const E=[...o.fields];o.phase="sending";const w=await l();if(!w)return;p(w),E.includes("rulesTextId")&&(o.rulesAccepted=!1),E.includes("art9TextId")&&(o.art9Accepted=!1),o.failure=k,o.fields=E;const y=I();if(y>=0){o.index=y,o.phase="ready";return}if(w.me.needs.filter(Wn).length===0){o.phase="done",e.onDone(w.me);return}r(k)}async function T(){if(o.failure=null,o.index<o.steps.length-1){o.index+=1;return}await j()}const g=()=>o.phase==="ready"&&b()==="art9"&&o.art9Text!==null&&c();return{state:o,load:h,step:b,isLast:()=>o.index>=o.steps.length-1,canContinue:$,async next(){$()&&(b()==="art9"&&o.art9Accepted&&(o.art9Refused=!1),await T())},canRefuse:g,async refuse(){g()&&(o.art9Accepted=!1,o.art9Refused=!0,await T())},refusalOffered:c,back(){o.phase!=="ready"||o.index===0||(o.failure=null,o.index-=1,b()==="art9"&&(o.art9Refused=!1))},suggestedHandle:()=>Qn(o.handle)===""?uh(o.displayName):null,hasFieldError:k=>o.fields.includes(k)}}const ji=(e="")=>({body:e,sending:!1,failure:null,confirm:null,waitUntil:null,clientMsgId:null}),Zl=Object.freeze({counts:Object.freeze({}),mine:null}),Jl=()=>typeof document>"u"||document.visibilityState!=="hidden",gh=1;function vh(e){return Xl(e,{kind:"article",id:e.articleId.toLowerCase()},e.realtime??null)}function yh(e){return Xl(e,{kind:"topic",id:e.conversationId.toLowerCase()},e.realtime??null)}function Xl(e,t,n){const{client:s,lang:o}=e,r=t.kind==="topic",a=t.id,l=r?"forum":"article_discussions",c=e.now??Date.now,p=r?null:ol(),h=r?Hm():null,b=p??h,_=new AbortController,$={signal:_.signal},v=Re({phase:"loading",failure:null,thread:b.getState(),loadingMore:!1,refreshing:!1,newMessages:!1,me:null,block:null,composer:ji(),inline:null,report:null,announcement:null,announceId:0,clock:c(),busy:{},refusedAge:e.refusedAge??null,art9RefusedNote:!1,realtimeOff:!1}),I=b.subscribe(C=>{v.thread=C}),j=Ht(null);let P=!1,T=null,g=null,k=!0,E=!1,w=0,y=null,x=null,N=null,M=null,O=null;const B=e.pollMs??2e4;function ee(C){v.announcement=C,v.announceId+=1}function re(){v.phase="hidden",T?.stop(),T=null,g?.stop(),g=null}function be(C=!1){return v.me&&!C?Promise.resolve():(x??=s.me.get($).then(L=>{x=null,!(!L.ok||E)&&(v.me=L.value,D())}),x)}const we=C=>bl(C?.module,l)?.brake??null;function K(C){const L=C?.module;if(!L)return null;const le=L.brake?L.brake.until:Yn(L.state)&&L.state==="braked"?L.until:void 0,fe=typeof le=="string"?Date.parse(le):NaN,qe=we(C),Ct=qe?Date.parse(qe.until):NaN,to=[fe,Ct].filter(Ss=>Number.isFinite(Ss));return to.length>0?Math.max(...to):null}function D(){if(M&&clearTimeout(M),M=null,E)return;const C=[];if(S()){const fe=K(v.me);fe!==null&&C.push(fe)}if(v.block==="braked"&&O!==null&&C.push(O),C.length===0)return;const L=Math.max(...C)-c(),le=L>0?Math.min(L+1e3,2147e6):3e4;M=setTimeout(()=>{M=null,!E&&(U(),be(!0))},le)}function U(){v.block==="braked"&&(O!==null&&O>c()||(v.block=null,O=null))}function De(){const C=b.getState();C.viewer.canPost||Zt(C).any||C.viewer.restrictions.length>0||r&&(C.viewer.memberId===null||!Ne())||be(v.block===null).then(()=>{const L=v.me;if(!(E||!L||b.getState().viewer.canPost)&&!S()){if(r){v.block=Yn(L.module?.state)&&L.module?.state==="read_only"?"readOnly":L.member&&L.member.status!=="active"?"restricted":null;return}v.block=!L.member||L.member.status==="active"?"notMoved":"restricted"}})}const Ne=()=>!r||Vm(h.getState().topic);function Fe(){const C=b.getState(),L=v.block==="braked"||S();C.viewer.canPost&&v.block!=="braked"&&(v.block=null),L&&U(),C.viewer.memberId!==null&&be(L),De(),j.value&&!Zt(C).any&&j.value.state.phase!=="sending"&&(j.value=null)}function Qe(C){if(C.code==="surfaceOff")return re();if(r&&(C.code==="membersOnly"||C.code==="notFound")){T?.stop(),T=null,g?.stop(),g=null,v.phase=C.code,v.failure=C;return}if(C.code==="notFound"&&v.phase!=="ready")return Ut("not-found","[blogmcp-community] the discussion of this article-id was not found (no such live article, or it is not readable here)"),re();(v.phase==="loading"||v.phase==="failed")&&(v.phase="failed",v.failure=C)}const oe=C=>r?(C?Gm:fl)(h,s,{conversationId:a,languageCode:o},$):(C?Mm:Em)(p,s,{articleId:a,languageCode:o},$);function Z(){return E?Promise.resolve():(y??=(async()=>{v.refreshing=!0;const C=await oe(!1);v.refreshing=!1,!E&&(w=c(),C.ok?(v.phase="ready",v.failure=null,v.newMessages=!1,Fe()):Qe(C))})().finally(()=>{y=null}),y)}async function J(){if(v.loadingMore||v.thread.nextCursor===null)return;v.loadingMore=!0;const C=await oe(!0);if(v.loadingMore=!1,!(E||C.ok)){if(C.code==="surfaceOff")return re();if(r&&(C.code==="membersOnly"||C.code==="notFound"))return Qe(C);ee(Ie(C,o))}}const W=C=>{const L=r?C?.conversationId:C?.articleId;return typeof L=="string"?L.toLowerCase():null},pe=C=>r?h.applyHead(C):p.applyHead(C);function Bt(C){for(const L of C){if(W(L)!==a)continue;if(v.phase==="failed"){Z();continue}const le=b.getState(),fe=typeof L.lastSeq=="number"&&L.lastSeq>le.lastSeq;pe(L)&&(fe&&le.loaded?v.newMessages=!0:Z())}}function Rt(){if(T||B===0||E||v.phase==="hidden")return;const C={intervalMs:B,visible:()=>Jl()&&k,onChange:Bt,onFailure:L=>{L.code==="surfaceOff"?re():r&&L.code==="membersOnly"&&Qe(L)},signal:_.signal};T=r?Lm(s,[a],C):zm(s,[a],C)}async function Cs(C){if(!(g||E||v.phase==="hidden")){if(Zt(b.getState()).signIn)return Rt();if(await be(),!(E||g||v.phase==="hidden")){if(v.me?.module&&v.me.module.features.realtime!==!0)return Rt();try{g=C({client:s,store:p??h,languageCode:o,visible:()=>Jl()&&k,...B>0?{pollIntervalMs:B}:{},onMode:L=>{E||(L==="polling"&&!v.realtimeOff?v.realtimeOff=!0:L==="live"&&v.realtimeOff&&(v.realtimeOff=!1))}})}catch{Ut("realtime","[blogmcp-community] the realtime property is not a session factory (createRealtimeSession of @blogmcp/sdk/community/realtime): the discussion polls"),g=null,Rt()}}}}function S(){const C=v.me?.module;return C?C.brake!==void 0||Yn(C.state)&&C.state==="braked"||we(v.me)!==null:!1}function R(){const C=v.thread,L=Zt(C);if(L.signIn)return"signIn";if(r){if(C.viewer.memberId===null)return"none";if(!Ne())return"locked";if(v.block==="readOnly")return"readOnly"}return v.block==="notMoved"?"notMoved":v.block==="braked"||S()?"braked":!C.viewer.canPost&&C.viewer.restrictions.length>0?"sanction":L.any?v.refusedAge!==null&&!j.value?"ageRefused":"onboarding":j.value&&P?"onboarding":v.block==="restricted"?"restricted":C.viewer.canPost?"write":"pending"}function F(){const C=v.me,L=C?.caps?.mentionsPerMessage,le=C?.module?.state;return!C?.member||typeof L!="number"||!Number.isSafeInteger(L)||L<0?null:le==="live"||le==="braked"?L:null}const G=C=>{const L=F();return L!==null&&Ol(C).length>L},V=C=>Tm(v.thread,C),H=C=>!C.pending&&C.seq>0,te=()=>R()==="write";function Q(){const C=v.me;if(C?.member&&C.profile)return{kind:"member",memberId:C.member.memberId,handle:C.profile.handle,displayName:C.profile.displayName,avatarPreset:C.profile.avatarPreset};const L=v.thread.viewer.memberId;if(L===null)return null;for(const le of v.thread.messages)for(const fe of[le,...le.replies])if(fe.author.kind==="member"&&fe.author.memberId===L)return fe.author;return null}function X(){v.clock=c(),!N&&(N=setInterval(()=>{v.clock=c();let C=!1;for(const L of[v.composer,v.inline])!L||L.waitUntil===null||(L.waitUntil<=v.clock?(L.waitUntil=null,L.failure&&(L.failure.code==="fast"||L.failure.code==="quota")&&(L.failure=null)):C=!0);!C&&N&&(clearInterval(N),N=null)},1e3))}const Y=C=>C.waitUntil===null?0:Math.max(0,Math.ceil((C.waitUntil-Math.max(v.clock,c()))/1e3));async function ce(C,L){const le=await Zm(h,s,{conversationId:a,languageCode:o},L,$);if(!E){if(le===L){Fe();return}C&&C.failure===L&&(C.failure=le),Qe(le)}}function ne(C,L){if(C&&(C.failure=L),r&&L.code==="notFound"){ce(C,L);return}switch(Bl(L.code)){case"confirm":C&&L.codes&&L.codes.length>0&&(C.confirm={codes:[...L.codes],checked:[]});return;case"wait":C&&(C.waitUntil=Ni(L,c()),C.waitUntil!==null&&X()),L.code==="braked"&&(v.block="braked",O=Ni(L,c()),D(),be(!0));return;case"onboard":eo(L.needs?.includes("art9_consent")?{forceArt9:!0}:{}),Z();return;case"reload":Z();return;case"notMoved":v.block="notMoved";return;case"hide":return L.code==="realtimeOff"?void 0:re();default:return}}async function ae(C,L,le){if(C.sending||Y(C)>0||E)return;const fe=Ze(C.body);if(fe===""||lt(fe)>In)return;const qe=Zt(v.thread);if(qe.signIn)return;if(qe.any)return eo();const Ct=L.kind==="new"?null:Zn(v.thread,L.seq);if(L.kind!=="new"&&(!Ct||!H(Ct)))return;if(G(fe)){C.failure={ok:!1,code:"mentionLimit"};return}let to;const Ss=L.kind==="edit"&&v.inline===C?v.inline.title:null;if(Ss!==null){const no=ki(Ss);if(no===null)return;no!==h?.getState().topic?.title&&(to=no)}C.sending=!0,C.failure=null;const Jc=L.kind==="edit"?null:Q(),Eo=L.kind==="edit"?as():C.clientMsgId??=as();L.kind==="edit"?b.applyMessage({type:"edit",clientMsgId:Eo,seq:L.seq,body:fe}):Jc&&b.applyMessage({type:"post",clientMsgId:Eo,body:fe,replyToSeq:L.kind==="reply"?L.seq:null,author:Jc,languageCode:o});const yC=r?{conversationId:a}:{articleId:a},Pn=L.kind==="edit"?await s.messages.edit({conversationId:Ct.conversationId,seq:L.seq,body:fe,...to!==void 0?{title:to}:{},...le?{confirmations:le}:{}},$):await s.messages.post({...yC,body:fe,replyToSeq:L.kind==="reply"?L.seq:null,clientMsgId:Eo,languageCode:o,...le?{confirmations:le}:{}},$);if(!E){if(C.sending=!1,Pn.ok){b.applyMessage({type:"confirm",clientMsgId:Eo,message:Pn.value.message,warnings:Pn.value.warnings}),Pn.value.topic&&h&&h.applyTopic(Pn.value.topic);const no=Pn.value.message.state==="held";C.body="",C.clientMsgId=null,C.confirm=null,C.failure=null,L.kind!=="new"&&v.inline===C&&(v.inline=null),ee({key:no?"composer.held":"composer.posted"}),L.kind!=="edit"&&e.onPosted?.(no?"held":"visible");return}b.applyMessage({type:"rollback",clientMsgId:Eo}),ne(C,Pn)}}function de(C,L,le){if(!C.confirm||!C.confirm.codes.includes(L))return;const fe=C.confirm.checked.filter(qe=>qe!==L);C.confirm.checked=le?[...fe,L]:fe}async function ye(C){const L=C.confirm;if(!L||!L.codes.every(fe=>L.checked.includes(fe)))return;const le=C===v.composer?{kind:"new"}:v.inline===C?{kind:v.inline.kind,seq:v.inline.seq}:{kind:"new"};await ae(C,le,[...L.codes])}async function Se(C){const L=Zn(v.thread,C),le=`delete:${C}`;if(!L||!H(L)||v.busy[le])return!1;v.busy[le]=!0;const fe=as();b.applyMessage({type:"delete",clientMsgId:fe,seq:C});const qe=await s.messages.delete({conversationId:L.conversationId,seq:C},$);return delete v.busy[le],E?!1:qe.ok?(b.applyMessage({type:"confirm",clientMsgId:fe,message:qe.value.message}),!0):(b.applyMessage({type:"rollback",clientMsgId:fe}),ee(Ie(qe,o)),ne(null,qe),!1)}const xe=C=>"articleId"in C?"react:article":`react:${C.seq}`,st=C=>r?"articleId"in C?Zl:Zn(v.thread,C.seq)?.reactions??Zl:Cm(v.thread,C);async function it(C,L){const le=xe(C);if(r&&"articleId"in C||!te()||v.busy[le]||!v.thread.reactionSet.includes(L))return;const fe=st(C),qe=fe.mine===L?null:L;v.busy[le]=!0,b.applyReaction(C,Sm(fe,qe));const Ct=await s.reactions.set({target:C,emoji:qe},$);if(delete v.busy[le],!E){if(Ct.ok){b.applyReaction(C,Ct.value.reactions);return}b.applyReaction(C,fe),ee(Ie(Ct,o)),ne(null,Ct)}}async function Nt(C,L){const le=`block:${C}`;if(v.busy[le])return;v.busy[le]=!0;const fe=await s.blocks.set({memberId:C,blocked:L},$);if(delete v.busy[le],!E){if(fe.ok){b.collapse(C,fe.value.blocked),ee({key:fe.value.blocked?"discussion.blocked":"discussion.unblocked"});return}ee(Ie(fe,o)),ne(null,fe)}}function jt(C){v.report={conversationId:C.conversationId,seq:C.seq,category:"",ruleId:"",note:"",rules:null,rulesFailed:!1,sending:!1,failure:null,done:!1};const L=v.report;s.legal.current({kind:"rules",locale:o},$).then(le=>{v.report===L&&(le.ok?L.rules=Gn(le.value.bodyJson):L.rulesFailed=!0)})}async function Mn(){const C=v.report;if(!C||C.sending||C.done||C.category===""||C.category==="rules"&&C.ruleId==="")return;const L=Ze(C.note);if(lt(L)>ss)return;C.sending=!0,C.failure=null;const le=await s.messages.report({conversationId:C.conversationId,seq:C.seq,category:C.category,ruleId:C.category==="rules"?C.ruleId:null,note:L===""?null:L},$);if(C.sending=!1,!E){if(le.ok){C.done=!0,ee({key:"report.done"});return}C.failure=le,le.code==="surfaceOff"&&re()}}function eo(C={}){if(j.value||E||v.refusedAge!==null)return;const L=C.offerArt9===!0,le=!L&&(C.forceArt9===!0||r&&C.toRead!==!0);P=L;const fe=ks({client:s,lang:o,signal:_.signal,...L?{offerArt9:!0}:{},...le?{forceArt9:!0}:{},onRefused:qe=>{v.refusedAge=qe,e.onAgeRefused?.(qe)},onDone:qe=>{v.me=qe,j.value=null;for(const Ct of[v.composer,v.inline])Ct?.failure?.code==="onboarding"&&(Ct.failure=null);v.art9RefusedNote=fe.state.art9RefusedSent,L?qe.acceptances.art9Consent==="accepted"&&ee({key:"panel.art9Given"}):ee({key:fe.state.art9RefusedSent?"onboarding.art9RefusedDone":"onboarding.done"}),Z()},onSignIn:()=>{j.value=null,Z()}});j.value=fe,fe.load()}const ct=()=>{const C=R();if(C==="write")return!0;if(!r||C!=="locked")return!1;const L=v.thread;return L.viewer.memberId!==null&&!Zt(L).any&&L.viewer.restrictions.length===0&&!S()&&v.block===null},Tt=C=>r&&C.seq===gh&&V(C);return{state:v,store:b,onboarding:j,async start(){await Z(),n&&v.phase==="ready"?await Cs(n):Rt()},refresh:Z,loadMore:J,mode:R,needs:()=>Zt(v.thread),isOwn:V,canReply:C=>{if(!te()||!H(C)||C.state!=="visible"||C.body===null)return!1;if(C.replyToSeq===null)return!0;const L=Zn(v.thread,C.replyToSeq);return L!==null&&H(L)&&L.state==="visible"},canEdit:C=>te()&&V(C)&&H(C)&&C.body!==null&&(C.state==="visible"||C.state==="held"),canDelete:C=>v.thread.viewer.memberId!==null&&R()!=="braked"&&V(C)&&H(C)&&C.body!==null&&C.state!=="deleted",canReact:ct,mentionCap:F,editsTitle:Tt,canReport:C=>!Zt(v.thread).signIn&&!V(C)&&H(C)&&C.body!==null&&C.author.kind!=="system",canReportAsNotifier:C=>Zt(v.thread).signIn&&H(C)&&C.body!==null&&C.author.kind!=="system",canBlock:C=>!Zt(v.thread).signIn&&!V(C)&&H(C)&&C.author.kind==="member"&&C.author.memberId!==null,setInView(C){const L=k;k=C,C&&!L&&T&&c()-w>=B&&T.now()},submit:()=>ae(v.composer,{kind:"new"}),openReply(C,L=null){const le=Zn(v.thread,C);if(!le)return;const fe=le.replyToSeq??le.seq;if(v.inline?.kind==="reply"&&v.inline.seq===fe){v.inline.replyingTo=L;return}v.inline={...ji(),kind:"reply",seq:fe,replyingTo:L,title:null}},openEdit(C){const L=Zn(v.thread,C);if(!L||L.body===null)return;const le=Tt(L)?h?.getState().topic?.title??"":null;v.inline={...ji(L.body),kind:"edit",seq:C,replyingTo:null,title:le}},closeInline(){v.inline=null},async submitInline(){const C=v.inline;C&&await ae(C,{kind:C.kind,seq:C.seq})},setConfirmed:de,sendConfirmed:ye,remove:Se,react:it,setBlocked:Nt,openReport:jt,closeReport(){v.report=null},submitReport:Mn,beginOnboarding:eo,cancelOnboarding(){j.value=null},waitLeft:Y,dispose(){E||(E=!0,_.abort(),T?.stop(),T=null,g?.stop(),g=null,I(),N&&clearInterval(N),N=null,M&&clearTimeout(M),M=null,j.value=null)}}}const _h=["aria-labelledby","aria-describedby"],kh={class:"bcm-dialog-body"},wh=["id"],$h=["id"],xh={class:"bcm-row"},Ih=["disabled"],Th=["disabled"],ws=$e({__name:"ConfirmDialog",props:{title:{},explain:{},explainParams:{},confirm:{},cancel:{},danger:{type:Boolean},busy:{type:Boolean},fallbackFocus:{type:Function}},emits:["confirm","cancel"],setup(e,{emit:t}){const n=e,s=t,{t:o}=vt(),r=ue(null),a=He("bcm-dialog");return Mi(r,()=>s("cancel"),n.fallbackFocus),(l,c)=>(d(),m("dialog",{ref_key:"dialog",ref:r,class:"bcm-dialog","aria-labelledby":`${i(a)}-title`,"aria-describedby":e.explain?`${i(a)}-explain`:void 0},[f("div",kh,[f("h3",{id:`${i(a)}-title`},u(i(o)(e.title)),9,wh),e.explain?(d(),m("p",{key:0,id:`${i(a)}-explain`},u(i(o)(e.explain,e.explainParams)),9,$h)):A("",!0),f("div",xh,[c[2]||(c[2]=f("span",{class:"bcm-spacer"},null,-1)),f("button",{type:"button",class:"bcm-btn",disabled:e.busy,onClick:c[0]||(c[0]=p=>s("cancel"))},u(i(o)(e.cancel??"common.cancel")),9,Ih),f("button",{type:"button",class:Ve(["bcm-btn bcm-primary",{"bcm-danger":e.danger}]),disabled:e.busy,onClick:c[1]||(c[1]=p=>s("confirm"))},u(i(o)(e.confirm)),11,Th)])])],8,_h))}}),Ch=["for"],Sh=["id","aria-describedby","aria-invalid","readonly"],Ah=["id"],Oh={key:0,class:"bcm-error"},Eh={key:1,class:"bcm-hint"},Mh=["for"],Ph={key:1,class:"bcm-hint"},Rh=["id","placeholder","aria-describedby","aria-invalid","readonly"],Nh={class:"bcm-composer-foot"},jh=["id"],zh={class:"bcm-sr","aria-live":"polite"},Lh=["disabled"],Dh=["disabled"],Fh=["id"],Uh={key:0},qh=["href"],Bh={key:2,class:"bcm-error"},Hh={key:3,class:"bcm-error",role:"alert"},Vh={key:4,class:"bcm-warning",role:"status"},Kh={key:5,class:"bcm-error",role:"alert"},Wh={key:6,class:"bcm-confirm"},Yh={class:"bcm-label"},Gh=["checked","onChange"],Zh={class:"bcm-row"},Jh=["disabled"],Co=$e({__name:"MessageComposer",props:{draft:{},kind:{},wait:{},replyingTo:{},rulesHref:{},mentionsMax:{}},emits:["submit","cancel","confirmed","confirm"],setup(e,{expose:t,emit:n}){const s=e,o=n,{t:r,lang:a}=vt(),l=He("bcm-composer"),c=ue(null),p=z(()=>lt(Ze(s.draft.body))),h=z(()=>p.value>In),b=z(()=>{const M=s.mentionsMax;return typeof M=="number"&&M>=0&&Ol(Ze(s.draft.body)).length>M}),_=z(()=>typeof s.draft.title=="string"),$=z(()=>hl(s.draft.title)),v=z(()=>_.value&&$.value>is),I=z(()=>!_.value||ki(s.draft.title)!==null),j=z(()=>_.value&&!v.value&&!I.value&&p.value>0),P=z(()=>!s.draft.sending&&p.value>0&&!h.value&&!b.value&&I.value&&s.wait===0&&s.draft.confirm===null),T=z(()=>{const M=s.draft.confirm;return M!==null&&M.codes.every(O=>M.checked.includes(O))}),g=z(()=>r(s.kind==="reply"?"composer.replyLabel":s.kind==="edit"?"composer.editLabel":s.kind==="topic"?"topic.bodyLabel":"composer.label")),k=typeof navigator<"u"&&/Mac|iPhone|iPad/i.test(navigator.platform||navigator.userAgent)?"⌘ + Enter":"Ctrl + Enter",E=z(()=>{const M=s.draft.failure;if(!M||s.draft.confirm&&M.code==="confirm"||M.code==="mentionLimit"&&b.value||(M.code==="fast"||M.code==="quota")&&s.wait>0&&s.wait<=ql)return"";const O=Ie(M,a.value);return r(O.key,O.params)}),w=ue("");let y=null;ve(p,M=>{y&&clearTimeout(y),y=setTimeout(()=>{w.value=M>=In*.9?r("composer.counter",{length:M,max:In}):""},700)}),Ge(()=>{y&&clearTimeout(y)}),ve(()=>[s.draft.body,s.draft.title],()=>{const M=s.draft;M.confirm&&(M.confirm=null),M.failure&&M.failure.code!=="fast"&&M.failure.code!=="quota"&&(M.failure=null)});function x(M){M.key!=="Enter"||!(M.metaKey||M.ctrlKey)||(M.preventDefault(),P.value&&o("submit"))}function N(){P.value&&o("submit")}return t({focus:()=>c.value?.focus()}),(M,O)=>(d(),m("form",{class:"bcm-composer",onSubmit:mt(N,["prevent"])},[_.value?(d(),m(q,{key:0},[f("label",{for:`${i(l)}-title`,class:"bcm-label"},u(i(r)("topic.titleLabel")),9,Ch),ge(f("input",{id:`${i(l)}-title`,"onUpdate:modelValue":O[0]||(O[0]=B=>e.draft.title=B),class:"bcm-input",type:"text",autocomplete:"off","aria-describedby":`${i(l)}-title-counter`,"aria-invalid":v.value,readonly:e.draft.sending,onKeydown:x},null,40,Sh),[[Xe,e.draft.title]]),f("span",{id:`${i(l)}-title-counter`,class:Ve(["bcm-counter",{"bcm-counter-over":v.value}])},u(i(r)("composer.counter",{length:$.value,max:i(is)})),11,Ah),v.value?(d(),m("p",Oh,u(i(r)("topic.titleTooLong",{max:i(is)})),1)):j.value?(d(),m("p",Eh,u(i(r)("topic.titleMissing")),1)):A("",!0)],64)):A("",!0),f("label",{for:i(l),class:"bcm-label"},u(g.value),9,Mh),e.replyingTo?(d(),m("p",Ph,u(i(r)("composer.replyingTo",{name:e.replyingTo})),1)):A("",!0),ge(f("textarea",{id:i(l),ref_key:"input",ref:c,"onUpdate:modelValue":O[1]||(O[1]=B=>e.draft.body=B),class:"bcm-input bcm-textarea",rows:"4",placeholder:i(r)("composer.placeholder"),"aria-describedby":`${i(l)}-counter ${i(l)}-hints`,"aria-invalid":h.value||b.value,readonly:e.draft.sending,onKeydown:x},null,40,Rh),[[Xe,e.draft.body]]),f("div",Nh,[f("span",{id:`${i(l)}-counter`,class:Ve(["bcm-counter",{"bcm-counter-over":h.value}])},u(i(r)("composer.counter",{length:p.value,max:i(In)})),11,jh),f("span",zh,u(w.value),1),O[4]||(O[4]=f("span",{class:"bcm-spacer"},null,-1)),e.kind!=="new"&&e.kind!=="topic"?(d(),m("button",{key:0,type:"button",class:"bcm-btn",disabled:e.draft.sending,onClick:O[2]||(O[2]=B=>o("cancel"))},u(i(r)("composer.cancel")),9,Lh)):A("",!0),f("button",{type:"submit",class:"bcm-btn bcm-primary",disabled:!P.value},u(e.draft.sending?i(r)("composer.sending"):e.kind==="edit"?i(r)("composer.save"):e.kind==="topic"?i(r)("topic.create"):i(r)("composer.submit")),9,Dh)]),f("div",{id:`${i(l)}-hints`,class:"bcm-hint"},[f("p",null,u(i(r)("composer.linksNote",{count:i(Tf)})),1),f("p",null,u(i(r)("composer.shortcut",{keys:i(k)})),1),e.rulesHref?(d(),m("p",Uh,[f("a",{href:e.rulesHref,target:"_blank",rel:"noopener"},u(i(r)("onboarding.rulesTitle")),9,qh)])):A("",!0)],8,Fh),h.value?(d(),m("p",Bh,u(i(r)("composer.tooLong",{max:i(In)})),1)):A("",!0),b.value?(d(),m("p",Hh,u(i(r)("error.mentionLimit")),1)):A("",!0),e.wait>0&&e.wait<=i(ql)?(d(),m("p",Vh,u(i(r)("composer.cooldown",{count:e.wait})),1)):A("",!0),E.value?(d(),m("p",Kh,u(E.value),1)):A("",!0),e.draft.confirm?(d(),m("fieldset",Wh,[f("legend",Yh,u(i(r)("confirm.title")),1),f("p",null,u(i(r)("error.confirm")),1),(d(!0),m(q,null,me(e.draft.confirm.codes,B=>(d(),m("label",{key:B,class:"bcm-check"},[f("input",{type:"checkbox",checked:e.draft.confirm.checked.includes(B),onChange:ee=>o("confirm",B,ee.target.checked)},null,40,Gh),f("span",null,u(i(r)(i(yp)(B))),1)]))),128)),f("div",Zh,[f("button",{type:"button",class:"bcm-btn bcm-primary",disabled:!T.value||e.draft.sending||e.wait>0,onClick:O[3]||(O[3]=B=>o("confirmed"))},u(i(r)("confirm.submit")),9,Jh)])])):A("",!0)],32))}}),zi=Object.freeze([Object.freeze({id:"fox",emoji:"🦊"}),Object.freeze({id:"owl",emoji:"🦉"}),Object.freeze({id:"bear",emoji:"🐻"}),Object.freeze({id:"hedgehog",emoji:"🦔"}),Object.freeze({id:"frog",emoji:"🐸"}),Object.freeze({id:"bee",emoji:"🐝"}),Object.freeze({id:"leaf",emoji:"🍃"}),Object.freeze({id:"flower",emoji:"🌼"}),Object.freeze({id:"tree",emoji:"🌲"}),Object.freeze({id:"star",emoji:"⭐"})]),Xh=new Map(zi.map(e=>[e.id,e.emoji]));function Qh(e){return typeof e=="string"?Xh.get(e)??null:null}function Ql(e){if(typeof e!="string")return"";for(const t of e.trim())return t.toLocaleUpperCase();return""}function eb(e){if(typeof e!="string"||e==="")return 210;let t=0;for(let n=0;n<e.length;n++)t=(t*31+e.charCodeAt(n))%360;return t}const Li=$e({__name:"AuthorAvatar",props:{author:{}},setup(e){const t=e,n=z(()=>t.author.kind==="member"?Qh(t.author.avatarPreset):null),s=z(()=>{const r=t.author;return r.kind==="member"||r.kind==="staff"?Ql(r.displayName):""}),o=z(()=>{const r=t.author;if(n.value||!s.value)return;const a=r.kind==="member"?r.memberId:r.kind==="staff"?r.staffId:null;return`hsl(${eb(a)} 45% 42%)`});return(r,a)=>(d(),m("span",{class:Ve(["bcm-avatar",{"bcm-avatar-initial":!n.value&&s.value}]),style:Do(o.value?{background:o.value}:void 0),"aria-hidden":"true"},u(n.value??s.value),7))}}),tb=["href","rel"],nb=["href"],ec=$e({__name:"LinkedText",props:{text:{},profilePath:{}},setup(e){const t=e,n=z(()=>{const s=t.profilePath;return oh(t.text??"",s?o=>kl(s,o):null)});return(s,o)=>(d(!0),m(q,null,me(n.value,(r,a)=>(d(),m(q,{key:a},[r.kind==="link"?(d(),m("a",{key:0,href:r.href,rel:i(Jp),target:"_blank"},u(r.text),9,tb)):r.kind==="mention"?(d(),m("a",{key:1,class:"bcm-mention",href:r.href},u(r.text),9,nb)):(d(),m(q,{key:2},[At(u(r.text),1)],64))],64))),128))}}),ob=["aria-expanded","aria-controls"],sb=["id"],ib=["href"],rb=["onClick"],tc=$e({__name:"MessageMenu",props:{items:{},label:{}},emits:["select"],setup(e,{emit:t}){const n=t,{t:s}=vt(),o=ue(!1),r=ue(null),a=ue(null),l=He("bcm-menu");function c(_){!a.value||_.composedPath().includes(a.value)||h(!1)}function p(_){o.value=_,_?(document.addEventListener("pointerdown",c,!0),ze(()=>a.value?.querySelector(".bcm-menu-list button, .bcm-menu-list a")?.focus())):document.removeEventListener("pointerdown",c,!0)}function h(_=!0){p(!1),_&&r.value?.focus()}function b(_){h(!0),n("select",_)}return Ge(()=>document.removeEventListener("pointerdown",c,!0)),(_,$)=>e.items.length?(d(),m("div",{key:0,ref_key:"root",ref:a,class:"bcm-menu",onKeydown:$[2]||($[2]=ff(mt(v=>h(!0),["stop"]),["esc"]))},[f("button",{ref_key:"toggle",ref:r,type:"button",class:"bcm-quiet","aria-expanded":o.value,"aria-controls":i(l),onClick:$[0]||($[0]=v=>p(!o.value))},u(e.label??i(s)("discussion.menu")),9,ob),o.value?(d(),m("div",{key:0,id:i(l),class:"bcm-menu-list"},[(d(!0),m(q,null,me(e.items,v=>(d(),m(q,{key:v.id},[v.href?(d(),m("a",{key:0,href:v.href,class:Ve({"bcm-danger":v.danger}),onClick:$[1]||($[1]=I=>h(!1))},u(v.label),11,ib)):(d(),m("button",{key:1,type:"button",class:Ve({"bcm-danger":v.danger}),onClick:I=>b(v.id)},u(v.label),11,rb))],64))),128))],8,sb)):A("",!0)],544)):A("",!0)}}),ab=["aria-label"],lb=["aria-pressed","disabled","title","onClick"],cb={key:0,class:"bcm-sr"},ub={key:1,class:"bcm-react"},nc=$e({__name:"ReactionBar",props:{reactionSet:{},summary:{},interactive:{type:Boolean},busy:{type:Boolean}},emits:["react"],setup(e,{emit:t}){const n=e,s=t,{t:o}=vt(),r=z(()=>n.interactive?n.reactionSet:n.reactionSet.filter(a=>(n.summary.counts[a]??0)>0));return(a,l)=>r.value.length?(d(),m("div",{key:0,class:"bcm-reactions",role:"group","aria-label":i(o)("discussion.reactions")},[(d(!0),m(q,null,me(r.value,c=>(d(),m(q,{key:c},[e.interactive?(d(),m("button",{key:0,type:"button",class:"bcm-react","aria-pressed":e.summary.mine===c,disabled:e.busy,title:e.summary.mine===c?i(o)("discussion.reactionRemove"):i(o)("discussion.reactionAdd"),onClick:p=>s("react",c)},[f("span",null,u(i(o)("discussion.reactionCount",{emoji:c,count:e.summary.counts[c]??0})),1),e.summary.mine===c?(d(),m("span",cb,u(i(o)("discussion.reactionMine")),1)):A("",!0)],8,lb)):(d(),m("span",ub,u(i(o)("discussion.reactionCount",{emoji:c,count:e.summary.counts[c]??0})),1))],64))),128))],8,ab)):A("",!0)}}),oc=Symbol("bcm-discussion");function sc(e){jr(oc,e)}function db(){const e=Qs(oc,null);if(!e)throw new Error("[blogmcp-community] a discussion component rendered outside <blogmcp-discussion>");return e}const fb=["id"],mb=["aria-busy"],pb={class:"bcm-msg-main"},hb={class:"bcm-meta"},bb={class:"bcm-author"},gb={key:0,class:"bcm-badge bcm-badge-team"},vb={key:1,class:"bcm-badge bcm-badge-team"},yb={key:2,class:"bcm-handle"},_b=["datetime"],kb={key:4,class:"bcm-muted"},wb={key:5,class:"bcm-muted",role:"status"},$b={key:0,class:"bcm-placeholder"},xb={key:1,class:"bcm-muted"},Ib={key:0,class:"bcm-own-state bcm-own-consent"},Tb={class:"bcm-badge"},Cb={class:"bcm-hint"},Sb={key:1,class:"bcm-own-state"},Ab={class:"bcm-badge"},Ob={class:"bcm-hint"},Eb=["href"],Mb={key:3,class:"bcm-text"},Pb={key:4,class:"bcm-hint"},Rb=["href"],Nb={key:3,class:"bcm-actions"},jb={key:0,class:"bcm-replies"},zb={key:2,class:"bcm-hint"},Lb=3,ic=$e({name:"MessageItem",__name:"MessageItem",props:{message:{}},setup(e){const t=e,{t:n,lang:s}=vt(),{ctl:o,routes:r,opened:a,originals:l,allReplies:c,deleteMessage:p,extraMenu:h,onExtraMenu:b}=db(),_=z(()=>t.message),$=z(()=>_.value.replyToSeq!==null),v=z(()=>o.isOwn(_.value)),I=z(()=>_.value.body===null),j=z(()=>v.value&&_.value.state==="held"&&_.value.hiddenUntilConsent===!0),P=z(()=>o.state.me?.acceptances.art9Refused===!0),T=z(()=>j.value&&!o.onboarding.value&&o.state.refusedAge===null&&(o.mode()==="onboarding"&&o.needs().art9||P.value)),g=z(()=>{const oe=_.value.author;return oe.kind==="system"?n("author.system"):oe.kind==="staff"?oe.displayName:oe.displayName??n("author.deleted")}),k=z(()=>_.value.author.kind==="member"?_.value.author.handle:null),E=z(()=>_.value.author.kind==="member"&&"moderator"in _.value.author&&_.value.author.moderator===!0),w=z(()=>{const oe=_.value.author;if(oe.kind!=="staff")return null;const Z=`author.badge.${oe.badge}`;return Xn(Z)?n(Z):null}),y=z(()=>_.value.state==="held"?"discussion.placeholderHeld":_.value.state==="removed"?"discussion.placeholderRemoved":"discussion.placeholderDeleted"),x=z(()=>_.value.pending?void 0:Io(_.value.seq)??void 0),N=z(()=>_.value.collapsed&&!a.has(_.value.seq)),M=z(()=>l.has(_.value.seq)),O=z(()=>(_.value.isTranslated&&!M.value?_.value.displayBody:_.value.body)??_.value.displayBody),B=z(()=>(v.value?_.value.notes??[]:[]).map(oe=>_p(oe)).filter(oe=>oe!==null)),ee=z(()=>v.value?[...new Set((_.value.warnings??[]).map(oe=>vp(oe)))]:[]),re=z(()=>o.state.inline?.kind==="edit"&&o.state.inline.seq===_.value.seq),be=z(()=>!$.value&&o.state.inline?.kind==="reply"&&o.state.inline.seq===_.value.seq),we=z(()=>c.has(_.value.seq)?_.value.replies:_.value.replies.slice(0,Lb)),K=z(()=>_.value.replies.length-we.value.length),D=z(()=>({conversationId:_.value.conversationId,seq:_.value.seq})),U=z(()=>o.needs().signIn?null:r.value.profilePath),De=z(()=>{const oe=[],Z=_.value;if(o.canEdit(Z)&&oe.push({id:"edit",label:n("discussion.edit")}),o.canDelete(Z)&&oe.push({id:"delete",label:n("discussion.delete"),danger:!0}),o.canReport(Z))oe.push({id:"report",label:n("discussion.report")});else if(o.canReportAsNotifier(Z)){const J=Ap(r.value.reportPath,D.value);J&&oe.push({id:"report",label:n("discussion.report"),href:J})}return o.canBlock(Z)&&oe.push({id:Z.collapsed?"unblock":"block",label:Z.collapsed?n("discussion.unblock"):n("discussion.block")}),h&&oe.push(...h(Z)),oe});function Ne(oe){const Z=_.value;oe==="edit"?o.openEdit(Z.seq):oe==="delete"?p(Z.seq):oe==="report"?o.openReport(Z):(oe==="block"||oe==="unblock")&&Z.author.kind==="member"&&Z.author.memberId?o.setBlocked(Z.author.memberId,oe==="block"):b?.(oe,Z)}function Fe(){o.openReply(_.value.seq,$.value?g.value:null)}function Qe(oe){oe.has(_.value.seq)?oe.delete(_.value.seq):oe.add(_.value.seq)}return(oe,Z)=>{const J=Ju("MessageItem",!0);return d(),m("li",{id:x.value,class:"bcm-msg-item"},[f("article",{class:Ve(["bcm-msg",{"bcm-msg-pending":!!_.value.pending}]),"aria-busy":!!_.value.pending},[Ee(Li,{author:_.value.author},null,8,["author"]),f("div",pb,[f("header",hb,[f("span",bb,u(g.value),1),w.value?(d(),m("span",gb,u(w.value),1)):A("",!0),E.value?(d(),m("span",vb,u(i(n)("role.moderator")),1)):A("",!0),k.value?(d(),m("span",yb,u(k.value),1)):A("",!0),_.value.createdAt?(d(),m("time",{key:3,class:"bcm-time",datetime:_.value.createdAt},u(i(Pe)(i(s),_.value.createdAt)),9,_b)):A("",!0),_.value.isEdited&&!I.value?(d(),m("span",kb,u(i(n)("discussion.edited")),1)):A("",!0),_.value.pending?(d(),m("span",wb,u(i(n)("discussion.pending")),1)):A("",!0)]),I.value?(d(),m("p",$b,u(i(n)(y.value)),1)):N.value?(d(),m("p",xb,[At(u(i(n)("discussion.collapsed"))+" ",1),f("button",{type:"button",class:"bcm-link",onClick:Z[0]||(Z[0]=W=>Qe(i(a)))},u(i(n)("discussion.show")),1)])):(d(),m(q,{key:2},[j.value?(d(),m("div",Ib,[f("span",Tb,u(i(n)("state.hiddenUntilConsent")),1),f("p",Cb,u(i(n)("discussion.hiddenUntilConsentNote")),1),T.value?(d(),m("button",{key:0,type:"button",class:"bcm-link",onClick:Z[1]||(Z[1]=W=>i(o).beginOnboarding(P.value?{offerArt9:!0}:{}))},u(i(n)("discussion.giveConsent")),1)):A("",!0)])):v.value&&(_.value.state==="held"||_.value.state==="removed")?(d(),m("div",Sb,[f("span",Ab,u(_.value.state==="held"?i(n)("state.held"):i(n)("state.removed")),1),f("p",Ob,u(_.value.state==="held"?i(n)("discussion.heldNote"):i(n)("discussion.removedNote")),1),_.value.state==="removed"?(d(),m("a",{key:0,href:i(r).myCommunityPath},u(i(n)("discussion.why")),9,Eb)):A("",!0)])):A("",!0),re.value&&i(o).state.inline?(d(),_e(Co,{key:2,kind:"edit",draft:i(o).state.inline,wait:i(o).waitLeft(i(o).state.inline),"rules-href":i(r).rulesPath,"mentions-max":i(o).mentionCap(),onSubmit:Z[2]||(Z[2]=W=>i(o).submitInline()),onCancel:Z[3]||(Z[3]=W=>i(o).closeInline()),onConfirm:Z[4]||(Z[4]=(W,pe)=>i(o).state.inline&&i(o).setConfirmed(i(o).state.inline,W,pe)),onConfirmed:Z[5]||(Z[5]=W=>i(o).state.inline&&i(o).sendConfirmed(i(o).state.inline))},null,8,["draft","wait","rules-href","mentions-max"])):(d(),m("p",Mb,[Ee(ec,{text:O.value,"profile-path":U.value},null,8,["text","profile-path"])])),_.value.isTranslated&&!re.value?(d(),m("p",Pb,[At(u(i(n)("discussion.translated"))+" ",1),f("button",{type:"button",class:"bcm-link",onClick:Z[6]||(Z[6]=W=>Qe(i(l)))},u(M.value?i(n)("discussion.showTranslation"):i(n)("discussion.showOriginal")),1)])):A("",!0),_.value.collapsed?(d(),m("button",{key:5,type:"button",class:"bcm-link",onClick:Z[7]||(Z[7]=W=>Qe(i(a)))},u(i(n)("discussion.hide")),1)):A("",!0),(d(!0),m(q,null,me(B.value,W=>(d(),m("p",{key:W,class:"bcm-note"},[W==="note.report_to_manufacturer"&&i(r).consultationPath?(d(),m("a",{key:0,href:i(r).consultationPath},u(i(n)(W)),9,Rb)):(d(),m(q,{key:1},[At(u(i(n)(W)),1)],64))]))),128)),(d(!0),m(q,null,me(ee.value,W=>(d(),m("p",{key:W,class:"bcm-warning"},u(i(n)(W)),1))),128))],64)),!I.value&&!N.value&&!re.value?(d(),m("div",Nb,[Ee(nc,{"reaction-set":i(o).state.thread.reactionSet,summary:_.value.reactions,interactive:i(o).canReact()&&!_.value.pending&&_.value.seq>0&&_.value.state==="visible",busy:!!i(o).state.busy[`react:${_.value.seq}`],onReact:Z[8]||(Z[8]=W=>i(o).react(D.value,W))},null,8,["reaction-set","summary","interactive","busy"]),i(o).canReply(_.value)?(d(),m("button",{key:0,type:"button",class:"bcm-quiet",onClick:Fe},u(i(n)("discussion.reply")),1)):A("",!0),Ee(tc,{items:De.value,onSelect:Ne},null,8,["items"])])):A("",!0),$.value?A("",!0):(d(),m(q,{key:4},[_.value.replies.length?(d(),m("ol",jb,[(d(!0),m(q,null,me(we.value,W=>(d(),_e(J,{key:W.id,message:W},null,8,["message"]))),128))])):A("",!0),K.value>0?(d(),m("button",{key:1,type:"button",class:"bcm-link",onClick:Z[9]||(Z[9]=W=>i(c).add(_.value.seq))},u(i(n)("discussion.showReplies",{count:K.value})),1)):A("",!0),_.value.repliesTruncated?(d(),m("p",zb,u(i(n)("discussion.repliesTruncated")),1)):A("",!0),be.value&&i(o).state.inline?(d(),_e(Co,{key:3,kind:"reply",draft:i(o).state.inline,wait:i(o).waitLeft(i(o).state.inline),"rules-href":i(r).rulesPath,"mentions-max":i(o).mentionCap(),"replying-to":i(o).state.inline.replyingTo,onSubmit:Z[10]||(Z[10]=W=>i(o).submitInline()),onCancel:Z[11]||(Z[11]=W=>i(o).closeInline()),onConfirm:Z[12]||(Z[12]=(W,pe)=>i(o).state.inline&&i(o).setConfirmed(i(o).state.inline,W,pe)),onConfirmed:Z[13]||(Z[13]=W=>i(o).state.inline&&i(o).sendConfirmed(i(o).state.inline))},null,8,["draft","wait","rules-href","mentions-max","replying-to"])):A("",!0)],64))])],10,mb)],8,fb)}}}),Db=["aria-labelledby"],Fb=["id"],Ub={key:0,class:"bcm-muted",role:"status"},qb={class:"bcm-error",role:"alert"},Bb={class:"bcm-row"},Hb={role:"alert"},Vb={class:"bcm-row"},Kb={key:0,class:"bcm-hint"},Wb={key:1,class:"bcm-choices"},Yb=["name","value"],Gb={class:"bcm-hint bcm-full"},Zb={key:2,class:"bcm-section"},Jb={key:0,class:"bcm-rules"},Xb={key:0,class:"bcm-hint"},Qb=["href"],eg={class:"bcm-check"},tg={key:3,class:"bcm-section"},ng=["aria-label"],og={key:0,class:"bcm-fieldset"},sg={class:"bcm-sr"},ig=["onUpdate:modelValue"],rg={key:1,class:"bcm-check"},ag={key:4,class:"bcm-section"},lg={class:"bcm-field"},cg=["for"],ug=["id","maxlength","aria-invalid","aria-describedby"],dg=["id"],fg={class:"bcm-field"},mg=["for"],pg=["id","maxlength","placeholder","aria-invalid","aria-describedby"],hg=["id"],bg={key:0,class:"bcm-hint"},gg={class:"bcm-choices"},vg={class:"bcm-choice"},yg=["name"],_g=["name","value"],kg={key:5,class:"bcm-error",role:"alert"},wg={class:"bcm-row"},$g=["disabled"],xg=["disabled"],Ig=["disabled"],So=$e({__name:"OnboardingSteps",props:{model:{},rulesHref:{}},emits:["cancel"],setup(e,{emit:t}){const n=e,s=t,{t:o,lang:r}=vt(),a=n.model.state,l=He("bcm-onboarding"),c=ue(null),p=z(()=>n.model.step()),h=z(()=>a.steps.includes("profile")),b=z(()=>{const $=a.failure;if(!$)return"";const v=ph($,r.value);return o(v.key,v.params)}),_=$=>`onboarding.age.${$}`;return ve(()=>[a.index,a.phase,a.steps.join()],([$,v,I],[j,,P])=>{($!==j||I!==P||v==="refused"||v==="failed")&&ze(()=>c.value?.focus())}),nt(()=>{ze(()=>c.value?.focus())}),($,v)=>(d(),m("section",{class:"bcm-card","aria-labelledby":`${i(l)}-title`},[f("h3",{id:`${i(l)}-title`,ref_key:"heading",ref:c,tabindex:"-1"},u(i(o)("onboarding.title")),9,Fb),i(a).phase==="loading"?(d(),m("p",Ub,u(i(o)("common.loading")),1)):i(a).phase==="failed"?(d(),m(q,{key:1},[f("p",qb,u(b.value),1),f("div",Bb,[f("button",{type:"button",class:"bcm-btn",onClick:v[0]||(v[0]=I=>s("cancel"))},u(i(o)("common.cancel")),1),f("button",{type:"button",class:"bcm-btn bcm-primary",onClick:v[1]||(v[1]=I=>e.model.load())},u(i(o)("common.retry")),1)])],64)):i(a).phase==="refused"?(d(),m(q,{key:2},[f("p",Hb,u(i(o)("onboarding.ageBelow",{min:i(a).minAge??18})),1),f("div",Vb,[f("button",{type:"button",class:"bcm-btn",onClick:v[2]||(v[2]=I=>s("cancel"))},u(i(o)("common.close")),1)])],64)):(d(),m("form",{key:3,class:"bcm-form",novalidate:"",onSubmit:v[13]||(v[13]=mt(I=>e.model.next(),["prevent"]))},[i(a).index===0&&h.value?(d(),m("p",Kb,u(i(o)("onboarding.lede")),1)):A("",!0),p.value==="age"?(d(),m("fieldset",Wb,[f("legend",null,u(i(o)("onboarding.ageTitle")),1),(d(!0),m(q,null,me(i(Bf),I=>(d(),m("label",{key:I,class:"bcm-choice"},[ge(f("input",{"onUpdate:modelValue":v[3]||(v[3]=j=>i(a).ageBand=j),type:"radio",name:`${i(l)}-age`,value:I},null,8,Yb),[[xn,i(a).ageBand]]),f("span",null,u(i(o)(_(I))),1)]))),128)),f("p",Gb,u(i(o)("onboarding.ageHint")),1)])):p.value==="rules"?(d(),m("div",Zb,[f("h4",null,u(i(o)("onboarding.rulesTitle")),1),f("p",null,u(i(a).reconsent?i(o)("onboarding.rulesChanged"):i(o)("onboarding.rulesLede")),1),i(a).rules.length?(d(),m("ol",Jb,[(d(!0),m(q,null,me(i(a).rules,I=>(d(),m("li",{key:I.id},[f("strong",null,u(I.title),1),I.summary?(d(),m("span",Xb,u(I.summary),1)):A("",!0)]))),128))])):A("",!0),f("p",null,[f("a",{href:e.rulesHref,target:"_blank",rel:"noopener"},u(i(o)("onboarding.rulesLink")),9,Qb)]),f("label",eg,[ge(f("input",{"onUpdate:modelValue":v[4]||(v[4]=I=>i(a).rulesAccepted=I),type:"checkbox"},null,512),[[os,i(a).rulesAccepted]]),f("span",null,u(i(o)("onboarding.rulesAccept")),1)])])):p.value==="art9"?(d(),m("div",tg,[f("h4",null,u(i(o)("onboarding.art9Title")),1),f("p",null,u(e.model.refusalOffered()?i(o)("onboarding.art9LedeOptional"):i(o)("onboarding.art9Lede")),1),f("div",{class:"bcm-consent",tabindex:"0",role:"document","aria-label":i(o)("onboarding.art9Title")},[(d(!0),m(q,null,me(i(a).art9Paragraphs,(I,j)=>(d(),m("p",{key:j,class:"bcm-text"},u(I),1))),128))],8,ng),i(a).art9Controllers.length>1?(d(),m("fieldset",og,[f("legend",sg,u(i(o)("onboarding.art9Title")),1),(d(!0),m(q,null,me(i(a).art9Controllers,I=>(d(),m("label",{key:I.entity,class:"bcm-check"},[ge(f("input",{"onUpdate:modelValue":j=>I.accepted=j,type:"checkbox",required:""},null,8,ig),[[os,I.accepted]]),f("span",null,u(i(o)("onboarding.art9Controller",{label:I.label})),1)]))),128))])):(d(),m("label",rg,[ge(f("input",{"onUpdate:modelValue":v[5]||(v[5]=I=>i(a).art9Accepted=I),type:"checkbox"},null,512),[[os,i(a).art9Accepted]]),f("span",null,u(i(o)("onboarding.art9Accept")),1)]))])):p.value==="profile"?(d(),m("div",ag,[f("h4",null,u(i(o)("onboarding.profileTitle")),1),f("div",lg,[f("label",{for:`${i(l)}-name`},u(i(o)("onboarding.displayName")),9,cg),ge(f("input",{id:`${i(l)}-name`,"onUpdate:modelValue":v[6]||(v[6]=I=>i(a).displayName=I),class:"bcm-input",autocomplete:"nickname",maxlength:i(Na)*2,"aria-invalid":e.model.hasFieldError("displayName"),"aria-describedby":`${i(l)}-name-hint`},null,8,ug),[[Xe,i(a).displayName]]),f("p",{id:`${i(l)}-name-hint`,class:"bcm-hint"},u(i(o)("onboarding.displayNameHint")),9,dg)]),f("div",fg,[f("label",{for:`${i(l)}-handle`},u(i(o)("onboarding.handle")),9,mg),ge(f("input",{id:`${i(l)}-handle`,"onUpdate:modelValue":v[7]||(v[7]=I=>i(a).handle=I),class:"bcm-input",autocomplete:"username",autocapitalize:"none",spellcheck:"false",maxlength:i(_s),placeholder:e.model.suggestedHandle()??"","aria-invalid":e.model.hasFieldError("handle"),"aria-describedby":`${i(l)}-handle-hint`},null,8,pg),[[Xe,i(a).handle]]),f("p",{id:`${i(l)}-handle-hint`,class:"bcm-hint"},u(i(o)("onboarding.handleHint",{min:i(Wl),max:i(_s),days:i(ja)})),9,hg),e.model.suggestedHandle()?(d(),m("p",bg,u(i(o)("onboarding.handleSuggested",{handle:e.model.suggestedHandle()??""})),1)):A("",!0)]),f("fieldset",gg,[f("legend",null,u(i(o)("onboarding.avatar")),1),f("label",vg,[ge(f("input",{"onUpdate:modelValue":v[8]||(v[8]=I=>i(a).avatarPreset=I),type:"radio",name:`${i(l)}-avatar`,value:null},null,8,yg),[[xn,i(a).avatarPreset]]),f("span",null,u(i(o)("onboarding.avatarNone")),1)]),(d(!0),m(q,null,me(i(zi),I=>(d(),m("label",{key:I.id,class:"bcm-choice"},[ge(f("input",{"onUpdate:modelValue":v[9]||(v[9]=j=>i(a).avatarPreset=j),type:"radio",name:`${i(l)}-avatar`,value:I.id},null,8,_g),[[xn,i(a).avatarPreset]]),f("span",null,u(I.emoji),1)]))),128))])])):A("",!0),b.value?(d(),m("p",kg,u(b.value),1)):A("",!0),f("div",wg,[i(a).index>0?(d(),m("button",{key:0,type:"button",class:"bcm-btn",disabled:i(a).phase==="sending",onClick:v[10]||(v[10]=I=>e.model.back())},u(i(o)("onboarding.back")),9,$g)):A("",!0),f("button",{type:"button",class:"bcm-btn",disabled:i(a).phase==="sending",onClick:v[11]||(v[11]=I=>s("cancel"))},u(i(o)("common.cancel")),9,xg),v[14]||(v[14]=f("span",{class:"bcm-spacer"},null,-1)),e.model.canRefuse()?(d(),m("button",{key:1,type:"button",class:"bcm-btn",onClick:v[12]||(v[12]=I=>e.model.refuse())},u(i(o)("onboarding.art9Refuse")),1)):A("",!0),f("button",{type:"submit",class:"bcm-btn bcm-primary",disabled:!e.model.canContinue()},u(i(a).phase==="sending"?i(o)("composer.sending"):e.model.isLast()?i(o)("onboarding.submit"):i(o)("onboarding.continue")),9,Ig)])],32))],8,Db))}}),Tg=["aria-labelledby"],Cg=["id"],Sg={class:"bcm-hint"},Ag={key:0},Og=["href"],Eg={class:"bcm-choices"},Mg=["name","value"],Pg={key:1,class:"bcm-field"},Rg=["for"],Ng={key:0,class:"bcm-error"},jg={key:1,class:"bcm-muted",role:"status"},zg=["id"],Lg=["value"],Dg={class:"bcm-field"},Fg=["for"],Ug=["id","aria-describedby","aria-invalid"],qg=["id"],Bg={key:2,class:"bcm-error",role:"alert"},Hg={class:"bcm-row"},Vg=["disabled"],Kg=["disabled"],Wg={role:"status"},Yg=["href"],Gg={class:"bcm-row"},rc=$e({__name:"ReportDialog",props:{report:{},myCommunityHref:{},rulesHref:{},fallbackFocus:{type:Function}},emits:["submit","close"],setup(e,{emit:t}){const n=e,s=t,{t:o,lang:r}=vt(),a=ue(null),l=He("bcm-report");Mi(a,()=>s("close"),n.fallbackFocus);const c=_=>`category.${_}`,p=z(()=>lt(Ze(n.report.note))),h=z(()=>!n.report.sending&&n.report.category!==""&&(n.report.category!=="rules"||n.report.ruleId!=="")&&p.value<=ss),b=z(()=>{const _=n.report.failure;if(!_)return"";const $=Ie(_,r.value);return o($.key,$.params)});return(_,$)=>(d(),m("dialog",{ref_key:"dialog",ref:a,class:"bcm-dialog","aria-labelledby":`${i(l)}-title`},[f("form",{class:"bcm-dialog-body",novalidate:"",onSubmit:$[5]||($[5]=mt(v=>h.value&&s("submit"),["prevent"]))},[f("h3",{id:`${i(l)}-title`},u(i(o)("report.title")),9,Cg),e.report.done?(d(),m(q,{key:1},[f("p",Wg,u(i(o)("report.done")),1),f("p",null,[f("a",{href:e.myCommunityHref},u(i(o)("panel.title")),9,Yg)]),f("div",Gg,[$[8]||($[8]=f("span",{class:"bcm-spacer"},null,-1)),f("button",{type:"button",class:"bcm-btn bcm-primary",onClick:$[4]||($[4]=v=>s("close"))},u(i(o)("common.close")),1)])],64)):(d(),m(q,{key:0},[f("p",Sg,u(i(o)("report.lede")),1),e.rulesHref?(d(),m("p",Ag,[f("a",{href:e.rulesHref,target:"_blank",rel:"noopener"},u(i(o)("onboarding.rulesTitle")),9,Og)])):A("",!0),f("fieldset",Eg,[f("legend",null,u(i(o)("report.category")),1),(d(!0),m(q,null,me(i(hi),v=>(d(),m("label",{key:v,class:"bcm-choice"},[ge(f("input",{"onUpdate:modelValue":$[0]||($[0]=I=>e.report.category=I),type:"radio",name:`${i(l)}-category`,value:v},null,8,Mg),[[xn,e.report.category]]),f("span",null,u(i(o)(c(v))),1)]))),128))]),e.report.category==="rules"?(d(),m("div",Pg,[f("label",{for:`${i(l)}-rule`},u(i(o)("report.rule")),9,Rg),e.report.rulesFailed?(d(),m("p",Ng,u(i(o)("error.unavailable")),1)):e.report.rules===null?(d(),m("p",jg,u(i(o)("common.loading")),1)):ge((d(),m("select",{key:2,id:`${i(l)}-rule`,"onUpdate:modelValue":$[1]||($[1]=v=>e.report.ruleId=v),class:"bcm-input",required:""},[$[6]||($[6]=f("option",{value:"",disabled:""},null,-1)),(d(!0),m(q,null,me(e.report.rules,v=>(d(),m("option",{key:v.id,value:v.id},u(v.title),9,Lg))),128))],8,zg)),[[Yt,e.report.ruleId]])])):A("",!0),f("div",Dg,[f("label",{for:`${i(l)}-note`},u(i(o)("report.note")),9,Fg),ge(f("textarea",{id:`${i(l)}-note`,"onUpdate:modelValue":$[2]||($[2]=v=>e.report.note=v),class:"bcm-input bcm-textarea",rows:"3","aria-describedby":`${i(l)}-note-hint`,"aria-invalid":p.value>i(ss)},null,8,Ug),[[Xe,e.report.note]]),f("p",{id:`${i(l)}-note-hint`,class:"bcm-hint"},u(i(o)("report.noteHint"))+" "+u(i(o)("report.counter",{length:p.value,max:i(ss)})),9,qg)]),b.value?(d(),m("p",Bg,u(b.value),1)):A("",!0),f("div",Hg,[$[7]||($[7]=f("span",{class:"bcm-spacer"},null,-1)),f("button",{type:"button",class:"bcm-btn",disabled:e.report.sending,onClick:$[3]||($[3]=v=>s("close"))},u(i(o)("report.cancel")),9,Vg),f("button",{type:"submit",class:"bcm-btn bcm-primary",disabled:!h.value},u(e.report.sending?i(o)("report.sending"):i(o)("report.submit")),9,Kg)])],64))],32)],8,Tg))}}),Zg=["lang","aria-labelledby"],Jg={class:"bcm-head"},Xg=["id"],Qg={key:0,class:"bcm-count"},ev={key:0,class:"bcm-muted",role:"status"},tv={key:1,class:"bcm-banner",role:"alert"},nv={key:0,class:"bcm-banner",role:"status"},ov=["disabled"],sv={key:1,class:"bcm-hint",role:"status"},iv={key:2,class:"bcm-muted"},rv={key:3,class:"bcm-thread"},av={key:4,class:"bcm-row"},lv=["disabled"],cv={class:"bcm-section"},uv={key:0,class:"bcm-hint"},dv={key:2,class:"bcm-row"},fv=["href"],mv={key:1,class:"bcm-row"},pv={key:4,class:"bcm-note"},hv={key:5,class:"bcm-section"},bv=["href"],gv={key:6,class:"bcm-note"},vv={key:7,class:"bcm-note",role:"status"},yv={key:8,class:"bcm-note"},_v=["href"],kv={class:"bcm-sr","aria-live":"polite"},ac=new WeakMap,wv=$e({inheritAttrs:!1,__name:"DiscussionView",props:{articleId:{},apiBase:{},siteBase:{},lang:{},signInHref:{},routes:{},pollMs:{},transport:{type:Function},realtime:{type:Function}},setup(e){const t=e,n=Vn(),s=ue(Le(t.lang,Ue())),{t:o,text:r}=gt(s);ve(()=>t.lang,K=>{s.value=Le(K,Ue())});const a=He("bcm-discussion"),l=ue(null),c=ue(0),p=Ht(null),h=z(()=>ht(t.siteBase));function b(){const K=t.articleId?.trim();if(!K)return Ut("article-id","[blogmcp-community] <blogmcp-discussion> needs an article-id"),null;if(h.value===null)return null;const D=bt(t.apiBase,t.transport,h.value);return D?vh({client:D,articleId:K,lang:s.value,pollMs:t.pollMs,realtime:typeof t.realtime=="function"?t.realtime:null,refusedAge:(n&&ac.get(n))??null,onAgeRefused:U=>{n&&ac.set(n,U)},onPosted:U=>n?.dispatchEvent(new CustomEvent("bcm-posted",{detail:{state:U},bubbles:!0,composed:!0}))}):null}const _=Re(new Set),$=Re(new Set),v=Re(new Set),I=ue(null),j=z(()=>Mt(t.routes)),P=z(()=>Pt(j.value,p.value?.state.me?.links,h.value??""));sc({get ctl(){return p.value},routes:P,opened:_,originals:$,allReplies:v,focusHeading:()=>l.value,deleteMessage:K=>{I.value=K}});let T=null;const g=ue(null);let k=!1;async function E(){if(k||typeof location>"u")return;k=!0;const K=xl(location.hash),D=K===null?null:Io(K);if(K===null||D===null)return;const U=x.value?.thread.messages.find(Ne=>Ne.replies.some(Fe=>Fe.seq===K));U&&v.add(U.seq),await ze();const De=g.value?.querySelector(`#${D}`);typeof De?.scrollIntoView=="function"&&De.scrollIntoView({block:"start"})}function w(){k=!1,p.value?.dispose(),_.clear(),$.clear(),v.clear(),I.value=null,p.value=b(),c.value+=1,p.value?.start()}nt(()=>{w(),n&&typeof IntersectionObserver<"u"&&(T=new IntersectionObserver(K=>{const D=K[K.length-1];D&&p.value?.setInView(D.isIntersecting)},{rootMargin:"200px"}),T.observe(n))}),ve(()=>[t.articleId,t.apiBase,h.value,t.transport,t.realtime,t.pollMs,s.value],()=>w()),Ge(()=>{T?.disconnect(),p.value?.dispose(),p.value=null});const y=z(()=>p.value),x=z(()=>p.value?.state??null);ve(()=>x.value?.phase,K=>{K==="ready"&&E()});const N=z(()=>p.value?.mode()??"pending"),M=ue(null);ve(N,(K,D)=>{K==="write"&&D==="onboarding"&&ze(()=>M.value?.focus()),K==="ageRefused"&&D==="onboarding"&&ze(()=>l.value?.focus())});const O=z(()=>{const K=p.value?.needs();return K?.onboarding?"need.onboarding":K?.rules?"need.reconsent_rules":"need.art9_consent"});function B(){return En(t.signInHref,typeof location>"u"?null:location.pathname)}function ee(K){const D=K.endsAt?Pe(s.value,K.endsAt):"";return K.kind==="ban"?o("sanction.ban"):K.kind==="suspension"?D?o("sanction.suspensionUntil",{date:D}):o("sanction.suspension"):D?o("sanction.restrictionUntil",{date:D}):o("sanction.restriction")}const re=z(()=>{const K=x.value?.failure;if(!K)return"";const D=Ie(K,s.value);return o(D.key,D.params)}),be=ue("");ve(()=>x.value?.announceId,()=>{be.value="";const K=r(x.value?.announcement);ze(()=>{be.value=K})});async function we(){const K=I.value;K===null||!p.value||(await p.value.remove(K),I.value=null)}return(K,D)=>y.value&&x.value&&x.value.phase!=="hidden"?(d(),m("section",{ref_key:"section",ref:g,key:c.value,class:"bcm bcm-discussion",lang:s.value,"aria-labelledby":i(a)},[f("header",Jg,[f("h2",{id:i(a),ref_key:"heading",ref:l,tabindex:"-1"},u(i(o)("discussion.title")),9,Xg),x.value.phase==="ready"?(d(),m("span",Qg,u(i(o)("discussion.count",{count:x.value.thread.count})),1)):A("",!0)]),x.value.phase==="loading"?(d(),m("p",ev,u(i(o)("discussion.loading")),1)):x.value.phase==="failed"?(d(),m("div",tv,[f("span",null,u(re.value),1),f("button",{type:"button",class:"bcm-btn",onClick:D[0]||(D[0]=U=>y.value.refresh())},u(i(o)("common.retry")),1)])):(d(),m(q,{key:2},[Ee(nc,{"reaction-set":x.value.thread.reactionSet,summary:x.value.thread.articleReactions,interactive:y.value.canReact(),busy:!!x.value.busy["react:article"],onReact:D[1]||(D[1]=U=>y.value&&y.value.react({articleId:x.value.thread.articleId??e.articleId??""},U))},null,8,["reaction-set","summary","interactive","busy"]),x.value.newMessages?(d(),m("div",nv,[f("span",null,u(i(o)("discussion.newMessages")),1),f("button",{type:"button",class:"bcm-btn",disabled:x.value.refreshing,onClick:D[2]||(D[2]=U=>y.value.refresh())},u(i(o)("discussion.refresh")),9,ov)])):A("",!0),x.value.realtimeOff?(d(),m("p",sv,u(i(o)("realtime.off")),1)):A("",!0),x.value.thread.messages.length===0?(d(),m("p",iv,u(i(o)("discussion.empty")),1)):(d(),m("ol",rv,[(d(!0),m(q,null,me(x.value.thread.messages,U=>(d(),_e(ic,{key:U.id,message:U},null,8,["message"]))),128))])),x.value.thread.nextCursor!==null?(d(),m("div",av,[f("button",{type:"button",class:"bcm-btn",disabled:x.value.loadingMore,onClick:D[3]||(D[3]=U=>y.value.loadMore())},u(i(o)("discussion.loadMore")),9,lv)])):A("",!0),f("div",cv,[N.value==="write"&&x.value.art9RefusedNote?(d(),m("p",uv,u(i(o)("onboarding.art9RefusedDone")),1)):A("",!0),N.value==="write"?(d(),_e(Co,{key:1,ref_key:"composer",ref:M,kind:"new",draft:x.value.composer,wait:y.value.waitLeft(x.value.composer),"rules-href":P.value.rulesPath,"mentions-max":y.value.mentionCap(),onSubmit:D[4]||(D[4]=U=>y.value.submit()),onConfirm:D[5]||(D[5]=(U,De)=>y.value&&y.value.setConfirmed(x.value.composer,U,De)),onConfirmed:D[6]||(D[6]=U=>y.value.sendConfirmed(x.value.composer))},null,8,["draft","wait","rules-href","mentions-max"])):N.value==="signIn"?(d(),m("div",dv,[f("p",null,u(i(o)("discussion.signInPrompt")),1),B()?(d(),m("a",{key:0,class:"bcm-btn bcm-primary",href:B()??void 0},u(i(o)("common.signIn")),9,fv)):A("",!0)])):N.value==="onboarding"?(d(),m(q,{key:3},[y.value.onboarding.value?(d(),_e(So,{key:0,model:y.value.onboarding.value,"rules-href":P.value.rulesPath,onCancel:D[7]||(D[7]=U=>y.value.cancelOnboarding())},null,8,["model","rules-href"])):(d(),m("div",mv,[f("p",null,u(i(o)(O.value)),1),f("button",{type:"button",class:"bcm-btn bcm-primary",onClick:D[8]||(D[8]=U=>y.value.beginOnboarding())},u(i(o)("onboarding.continue")),1)]))],64)):N.value==="ageRefused"?(d(),m("p",pv,u(i(o)("onboarding.ageBelow",{min:x.value.refusedAge??18})),1)):N.value==="sanction"?(d(),m("div",hv,[(d(!0),m(q,null,me(x.value.thread.viewer.restrictions,U=>(d(),m("p",{key:U.decisionId,class:"bcm-note"},[At(u(ee(U))+" ",1),i(Jn)(P.value.statementPath,U.decisionId)?(d(),m("a",{key:0,href:i(Jn)(P.value.statementPath,U.decisionId)??void 0},u(i(o)("sanction.statement")),9,bv)):A("",!0)]))),128))])):N.value==="notMoved"?(d(),m("p",gv,u(i(o)("error.notMoved")),1)):N.value==="braked"?(d(),m("p",vv,u(i(o)("state.braked")),1)):N.value==="restricted"?(d(),m("p",yv,[At(u(i(o)("error.restricted"))+" ",1),f("a",{href:P.value.myCommunityPath},u(i(o)("panel.title")),9,_v)])):A("",!0)])],64)),f("p",kv,u(be.value),1),x.value.report?(d(),_e(rc,{key:3,report:x.value.report,"my-community-href":P.value.myCommunityPath,"rules-href":P.value.rulesPath,"fallback-focus":()=>l.value,onSubmit:D[9]||(D[9]=U=>y.value.submitReport()),onClose:D[10]||(D[10]=U=>y.value.closeReport())},null,8,["report","my-community-href","rules-href","fallback-focus"])):A("",!0),I.value!==null?(d(),_e(ws,{key:4,title:"discussion.deleteTitle",explain:"discussion.deleteExplain",confirm:"discussion.deleteConfirm",danger:"",busy:!!x.value.busy[`delete:${I.value}`],"fallback-focus":()=>l.value,onConfirm:D[11]||(D[11]=U=>we()),onCancel:D[12]||(D[12]=U=>I.value=null)},null,8,["busy","fallback-focus"])):A("",!0)],8,Zg)):A("",!0)}}),$v=25;function $s(e){const{client:t,target:n,lang:s}=e,o=$o(n),r=new AbortController,a={signal:r.signal};let l=!1;const c=Re({phase:"idle",following:!1,busy:!1,failure:null,announcement:null,announceId:0}),p=b=>{c.announcement=b,c.announceId+=1};async function h(){let b=null,_=0;for(let $=0;$<$v;$++){const v=await t.me.follows.list(b===null?{}:{cursor:b},a);if(!v.ok)return v;for(const I of v.value.follows)if($o(I)===o)return!0;if(_+=v.value.follows.length,b=v.value.nextCursor,b===null||_>=Of)return!1}return!1}return{state:c,async load(b){if(c.failure=null,o===null){c.phase="unavailable";return}if(typeof b=="boolean"){c.following=b,c.phase="ready";return}c.phase="loading";const _=await h();if(!l){if(typeof _=="boolean"){c.following=_,c.phase="ready";return}c.phase=_.code==="signIn"?"signIn":"failed",c.failure=_}},sync(b){!c.busy&&c.phase==="ready"&&(c.following=b)},async toggle(){if(c.busy||c.phase!=="ready"||o===null)return;const b=!c.following;c.busy=!0,c.failure=null;const _=await t.me.follows.set({target:n,following:b},a);if(c.busy=!1,!l){if(_.ok){c.following=_.value.following,p({key:_.value.following?"follow.followed":"follow.unfollowed"});return}if(b&&_.code==="notFound"){c.phase="unavailable",p({key:"follow.unavailable"});return}if(_.code==="signIn"){c.phase="signIn";return}c.failure=_,p(Ie(_,s))}},dispose(){l=!0,r.abort()}}}const xv={class:"bcm-follow"},Iv=["aria-pressed","disabled"],Tv={key:1,class:"bcm-muted"},Cv={class:"bcm-sr","aria-live":"polite"},xs=$e({__name:"FollowToggle",props:{ctl:{}},setup(e){const t=e,{t:n,text:s}=vt(),o=ue("");return ve(()=>t.ctl.state.announceId,()=>{o.value=s(t.ctl.state.announcement)}),(r,a)=>(d(),m("span",xv,[e.ctl.state.phase==="ready"?(d(),m("button",{key:0,type:"button",class:"bcm-btn bcm-small","aria-pressed":e.ctl.state.following,disabled:e.ctl.state.busy,onClick:a[0]||(a[0]=l=>e.ctl.toggle())},u(e.ctl.state.following?i(n)("follow.following"):i(n)("follow.follow")),9,Iv)):e.ctl.state.phase==="unavailable"?(d(),m("span",Tv,u(i(n)("follow.unavailable")),1)):A("",!0),f("span",Cv,u(o.value),1)]))}}),Sv=["lang"],Av=$e({inheritAttrs:!1,__name:"FollowButtonView",props:{targetKind:{},targetId:{},following:{type:[String,Boolean],default:void 0},apiBase:{},siteBase:{},lang:{},transport:{}},setup(e){const t=e,n=ue(Le(t.lang,Ue()));gt(n);const s=Ht(null);function o(){const a=t.following;return a===!0||a==="true"||a===""?!0:a===!1||a==="false"?!1:null}function r(){s.value?.dispose(),s.value=null;const a=ml(t.targetKind,t.targetId);if(a===null){Ut("follow-target",'[blogmcp-community] <blogmcp-follow-button> needs target-kind ("conversation" or "category") and a target-id');return}const l=ht(t.siteBase),c=l===null?null:bt(t.apiBase,t.transport,l);c&&(s.value=$s({client:c,target:a,lang:n.value}),s.value.load(o()))}return nt(r),ve(()=>[t.targetKind,t.targetId,t.apiBase,t.siteBase,t.transport],r),ve(()=>t.following,()=>{const a=o();a!==null&&s.value?.sync(a)}),ve(()=>t.lang,a=>{n.value=Le(a,Ue())}),Ge(()=>s.value?.dispose()),(a,l)=>s.value&&(s.value.state.phase==="ready"||s.value.state.phase==="unavailable")?(d(),m("div",{key:0,class:"bcm-follow-host",lang:n.value},[Ee(xs,{ctl:s.value},null,8,["ctl"])],8,Sv)):A("",!0)}});function Is(e,t=Date.now()){const n=e?.module;if(!n)return{away:!1,paused:null,readOnly:!1};const s=Yn(n.state)?n.state:"dark",o=bl(n,"forum")?.brake??null,r=o!==null&&Date.parse(o.until)>t;return{away:np(n,t)!==null,paused:n.brake!==void 0||s==="braked"?"module":r?"forum":null,readOnly:s==="read_only"}}const Di=e=>e==="module"?"state.braked":e==="forum"?"state.forumBraked":null;function Ov(e){const t=(e?.needs??[]).filter(Wn);return!t.includes("sign_in")&&(t.includes("onboarding")||t.includes("reconsent_rules"))?"join":"signIn"}const lc=e=>!!e?.member&&!e.needs.includes("sign_in"),cc=()=>({title:"",body:"",sending:!1,failure:null,confirm:null,waitUntil:null,clientMsgId:null});function Ev(e){const{client:t,lang:n}=e,s=e.slug.trim().toLowerCase(),o=e.now??Date.now,r=new AbortController,a={signal:r.signal};let l=!1,c=0,p=null;const h=Ht(null),b=Re({phase:"loading",failure:null,me:null,category:null,header:null,items:[],nextCursor:null,sort:"activity",loadingMore:!1,sorting:!1,composer:cc(),created:null,creationClosed:!1,brakedBy:null,clock:o(),announcement:null,announceId:0}),_=y=>{b.announcement=y,b.announceId+=1};function $(y){b.failure=y,y.code==="surfaceOff"?b.phase="hidden":y.code==="membersOnly"?b.phase="membersOnly":y.code==="notFound"?b.phase="notFound":b.phase!=="ready"?b.phase="failed":_(Ie(y,n))}async function v(y){const x=await t.forum.topics.list({categorySlug:s,sort:b.sort,limit:za},a);return l||y!==c?!1:x.ok?(b.header={...x.value.category},b.items=$i(x.value.items),b.nextCursor=x.value.nextCursor,!0):($(x),!1)}async function I(){const y=++c;b.phase="loading",b.failure=null;const[x,N,M]=await Promise.all([t.me.get(a),t.forum.categories.list(a),v(y)]);l||y!==c||(x.ok&&(b.me=x.value),N.ok&&(b.category=N.value.categories.find(O=>O.slug===s)??null),b.brakedBy=null,M&&(b.phase="ready"))}function j(){b.clock=o(),!p&&(p=setInterval(()=>{b.clock=o();const y=b.composer;y.waitUntil!==null&&y.waitUntil<=b.clock&&(y.waitUntil=null,y.failure&&(y.failure.code==="fast"||y.failure.code==="quota")&&(y.failure=null)),y.waitUntil===null&&p&&(clearInterval(p),p=null)},1e3))}const P=()=>{const y=b.composer;return y.waitUntil===null?0:Math.max(0,Math.ceil((y.waitUntil-Math.max(b.clock,o()))/1e3))},T=()=>(b.category?.kind??b.header?.kind)==="topics";function g(){if(!T()||!lc(b.me))return null;if(b.category?.topicCreation!=="members"||b.creationClosed)return"team";const y=Is(b.me,o());return b.brakedBy!==null||y.paused!==null?"paused":y.readOnly?"readOnly":null}const k=()=>b.phase==="ready"&&T()&&lc(b.me)&&b.category?.topicCreation==="members"&&g()===null;function E(y={}){if(h.value||l)return;const x=ks({client:t,lang:n,signal:r.signal,forceArt9:y.forceArt9!==!1,onDone:N=>{b.me=N,h.value=null,b.composer.failure?.code==="onboarding"&&(b.composer.failure=null),_({key:x.state.art9RefusedSent?"onboarding.art9RefusedDone":"onboarding.done"})},onSignIn:()=>{h.value=null,I()}});h.value=x,x.load()}async function w(y){const x=b.composer;if(x.sending||P()>0||l||!b.category)return;const N=ki(x.title),M=Ze(x.body);if(N===null||M===""||lt(M)>In)return;x.sending=!0,x.failure=null;const O=x.clientMsgId??=as(),B=await t.forum.topics.create({categoryId:b.category.id,title:N,body:M,clientMsgId:O,languageCode:n,...y?{confirmations:y}:{}},a);if(!l){if(x.sending=!1,B.ok){const ee=B.value.message.state==="held";b.composer=cc(),b.created={conversationId:B.value.topic.conversationId,held:ee},_({key:ee?"topic.createdHeld":"topic.created"}),e.onCreated?.(b.created);const re=++c;await v(re);return}switch(x.failure=B,Bl(B.code)){case"confirm":B.codes&&B.codes.length>0&&(x.confirm={codes:[...B.codes],checked:[]});return;case"wait":x.waitUntil=Ni(B,o()),x.waitUntil!==null&&j(),B.code==="braked"&&(b.brakedBy=B.surface==="forum"?"forum":"module");return;case"onboard":E({forceArt9:!0});return;default:if(B.code==="topicCreationClosed")b.creationClosed=!0;else if(B.code==="membersOnly"||B.code==="surfaceOff"||B.code==="notFound")$(B);else if(B.code==="readOnly"||B.code==="signIn"||B.code==="restricted"||B.code==="suspended"||B.code==="terminated"){const ee=await t.me.get(a);!l&&ee.ok&&(b.me=ee.value)}}}}return{state:b,onboarding:h,load:I,async loadMore(){if(b.loadingMore||b.nextCursor===null||b.phase!=="ready")return;const y=c;b.loadingMore=!0;const x=await t.forum.topics.list({categorySlug:s,sort:b.sort,cursor:b.nextCursor,limit:za},a);if(b.loadingMore=!1,l||y!==c)return;if(!x.ok)return $(x);const N=new Set(b.items.map(M=>M.conversationId));b.items=[...b.items,...$i(x.value.items).filter(M=>!N.has(M.conversationId))],b.nextCursor=x.value.nextCursor},async setSort(y){if(b.sort===y||b.phase!=="ready")return;b.sort=y;const x=++c;b.sorting=!0,await v(x),x===c&&(b.sorting=!1)},canCreate:k,notCreating:g,create:()=>w(),setConfirmed(y,x){const N=b.composer.confirm;if(!N||!N.codes.includes(y))return;const M=N.checked.filter(O=>O!==y);N.checked=x?[...M,y]:M},async sendConfirmed(){const y=b.composer.confirm;!y||!y.codes.every(x=>y.checked.includes(x))||await w([...y.codes])},beginOnboarding:E,cancelOnboarding(){h.value=null},waitLeft:P,dispose(){l=!0,r.abort(),p&&clearInterval(p),p=null,h.value=null}}}const uc=Object.freeze({"composer.label":"forumText.composer.label","composer.editLabel":"forumText.composer.editLabel","composer.placeholder":"forumText.composer.placeholder","composer.tooLong":"forumText.composer.tooLong","composer.linksNote":"forumText.composer.linksNote","composer.posted":"forumText.composer.posted","composer.held":"forumText.composer.held","composer.cooldown":"forumText.composer.cooldown","discussion.empty":"forumText.discussion.empty","discussion.deleteTitle":"forumText.discussion.deleteTitle","discussion.deleteExplain":"forumText.discussion.deleteExplain","discussion.collapsed":"forumText.discussion.collapsed","discussion.heldNote":"forumText.discussion.heldNote","discussion.hiddenUntilConsentNote":"forumText.discussion.hiddenUntilConsentNote","discussion.removedNote":"forumText.discussion.removedNote","discussion.placeholderHeld":"forumText.discussion.placeholderHeld","discussion.placeholderRemoved":"forumText.discussion.placeholderRemoved","discussion.placeholderDeleted":"forumText.discussion.placeholderDeleted","report.title":"forumText.report.title","report.category":"forumText.report.category","error.links":"forumText.error.links","error.blocked":"forumText.error.blocked","error.confirm":"forumText.error.confirm","confirm.other":"forumText.confirm.other","warning.identifier":"forumText.warning.identifier","warning.other":"forumText.warning.other","need.onboarding":"forumText.need.onboarding","need.art9_consent":"forumText.need.art9_consent"}),Mv={key:0,class:"bcm-note",role:"status"},Pv={key:1,class:"bcm-note",role:"status"},Rv={key:2,class:"bcm-note",role:"status"},Fi=$e({__name:"ForumNotices",props:{me:{},now:{}},setup(e){const t=e,{t:n}=vt(),s=z(()=>Is(t.me,t.now)),o=z(()=>Di(s.value.paused));return(r,a)=>(d(),m(q,null,[o.value?(d(),m("p",Mv,u(i(n)(o.value)),1)):s.value.readOnly?(d(),m("p",Pv,u(i(n)("error.readOnly")),1)):A("",!0),s.value.away?(d(),m("p",Rv,u(i(n)("state.away")),1)):A("",!0)],64))}}),Nv={class:"bcm-section"},jv={class:"bcm-note"},zv={key:1,class:"bcm-row"},Lv={key:2,class:"bcm-row"},Dv=["href"],Ts=$e({__name:"MembersOnly",props:{failure:{},client:{},lang:{},signInHref:{},rulesHref:{}},emits:["joined"],setup(e,{emit:t}){const n=e,s=t,{t:o}=vt(),r=z(()=>Ov(n.failure)),a=Ht(null),l=new AbortController;Ge(()=>l.abort());function c(){return En(n.signInHref,typeof location>"u"?null:location.pathname)}function p(){if(a.value)return;const h=ks({client:n.client,lang:n.lang,signal:l.signal,onDone:()=>{a.value=null,s("joined")},onSignIn:()=>{a.value=null}});a.value=h,h.load()}return(h,b)=>(d(),m("div",Nv,[f("p",jv,u(i(o)("error.membersOnly")),1),a.value?(d(),_e(So,{key:0,model:a.value,"rules-href":e.rulesHref,onCancel:b[0]||(b[0]=_=>a.value=null)},null,8,["model","rules-href"])):r.value==="join"?(d(),m("div",zv,[f("button",{type:"button",class:"bcm-btn bcm-primary",onClick:p},u(i(o)("forum.join")),1)])):c()?(d(),m("div",Lv,[f("a",{class:"bcm-btn bcm-primary",href:c()??void 0},u(i(o)("common.signIn")),9,Dv)])):A("",!0)]))}}),Fv={class:"bcm-topic-row"},Uv={class:"bcm-topic-title"},qv=["href"],Bv={class:"bcm-row bcm-muted"},Hv={key:0,class:"bcm-badge"},Vv={key:1,class:"bcm-badge"},Kv={key:2,class:"bcm-badge"},Wv={key:3},Yv=["datetime"],Gv={class:"bcm-topic-title"},Zv=["href"],Jv={key:1},Xv={class:"bcm-row bcm-muted"},Qv=["datetime"],dc=$e({__name:"TopicRow",props:{item:{},topicHref:{},articleHref:{},follow:{}},setup(e){const t=e,{t:n,lang:s}=vt(),o=z(()=>t.item.kind==="topic"?ms(t.item):null),r=z(()=>{const h=o.value;return h?h.kind==="shown"?h.text:n(h.kind==="deleted"?"topic.deleted":"topic.withheld"):""}),a=z(()=>t.item.kind==="topic"?xo(t.topicHref,t.item.conversationId):null),l=z(()=>t.item.kind==="article"?Il(t.articleHref,t.item.articleSlug):null),c=z(()=>t.item.kind!=="topic"?null:t.item.state==="locked"?"topic.locked":t.item.state==="archived"?"topic.archived":null),p=z(()=>{if(t.item.kind!=="topic")return null;const h=t.item.author;return h.kind==="member"?"displayName"in h&&h.displayName?h.displayName:n("author.deleted"):h.kind==="staff"&&"displayName"in h?h.displayName:null});return(h,b)=>(d(),m("li",Fv,[e.item.kind==="topic"?(d(),m(q,{key:0},[f("p",Uv,[a.value?(d(),m("a",{key:0,href:a.value,class:Ve({"bcm-placeholder":o.value?.kind!=="shown"})},u(r.value),11,qv)):(d(),m("span",{key:1,class:Ve({"bcm-placeholder":o.value?.kind!=="shown"})},u(r.value),3))]),f("p",Bv,[e.item.pinned?(d(),m("span",Hv,u(i(n)("topic.pinned")),1)):A("",!0),c.value?(d(),m("span",Vv,u(i(n)(c.value)),1)):A("",!0),e.item.openingState==="held"&&o.value?.kind==="shown"?(d(),m("span",Kv,u(i(n)("state.held")),1)):A("",!0),p.value?(d(),m("span",Wv,u(p.value),1)):A("",!0),f("span",null,u(i(n)("topic.count",{count:e.item.count})),1),f("time",{datetime:e.item.lastActivityAt},u(i(n)("forum.lastActivity",{date:i(Pe)(i(s),e.item.lastActivityAt)})),9,Yv)])],64)):(d(),m(q,{key:1},[f("p",Gv,[l.value?(d(),m("a",{key:0,href:l.value},u(e.item.articleTitle??i(n)("search.inArticle")),9,Zv)):(d(),m("span",Jv,u(e.item.articleTitle??i(n)("search.inArticle")),1))]),f("p",Xv,[f("span",null,u(i(n)("discussion.count",{count:e.item.count})),1),f("time",{datetime:e.item.lastActivityAt},u(i(n)("forum.lastActivity",{date:i(Pe)(i(s),e.item.lastActivityAt)})),9,Qv),e.follow?(d(),_e(xs,{key:0,ctl:e.follow},null,8,["ctl"])):A("",!0)])],64))]))}}),ey=["lang","aria-labelledby"],ty={class:"bcm-row"},ny=["href"],oy=["id"],sy=["id"],iy=["id"],ry={key:3,class:"bcm-banner",role:"alert"},ay=["id"],ly={class:"bcm-head"},cy=["id"],uy={key:0,class:"bcm-text"},dy={key:1,class:"bcm-hint"},fy={key:2,class:"bcm-row"},my=["for"],py=["id","value","disabled"],hy={value:"activity"},by={value:"new"},gy={key:3,class:"bcm-muted"},vy=["aria-busy"],yy={key:5,class:"bcm-row"},_y=["disabled"],ky=["aria-labelledby"],wy={key:0,class:"bcm-note"},$y=["href"],xy={key:1,class:"bcm-new-topic"},Iy=["id"],Ty={key:2,class:"bcm-hint"},Cy={key:3,class:"bcm-note",role:"status"},Sy={class:"bcm-sr","aria-live":"polite"},Ay=$e({inheritAttrs:!1,__name:"ForumCategoryView",props:{slug:{},apiBase:{},siteBase:{},lang:{},routes:{},signInHref:{},transport:{type:Function}},setup(e){const t=e,n=Vn(),s=ue(Le(t.lang,Ue())),{t:o,text:r}=gt(s,uc),a=He("bcm-category"),l=ht(t.siteBase),c=l===null?null:bt(t.apiBase,t.transport,l);function p(){const O=t.slug?.trim();return O?c?Ev({client:c,slug:O,lang:s.value,onCreated:B=>n?.dispatchEvent(new CustomEvent("bcm-topic-created",{detail:{conversationId:B.conversationId,state:B.held?"held":"visible"},bubbles:!0,composed:!0}))}):null:(Ut("category-slug","[blogmcp-community] <blogmcp-forum-category> needs a slug"),null)}const h=Ht(null),b=z(()=>h.value?.state??null),_=z(()=>Pt(Mt(t.routes),b.value?.me?.links,l??"")),$=Ht(null),v=new Map;function I(){$.value?.dispose(),$.value=null;for(const O of v.values())O.dispose();v.clear()}function j(){h.value?.dispose(),I(),h.value=p(),h.value?.load()}nt(j),ve(()=>[t.slug,s.value],j),ve(()=>t.lang,O=>{s.value=Le(O,Ue())}),Ge(()=>{h.value?.dispose(),I()}),ve(()=>b.value?.category,O=>{!O||!c||($.value||($.value=$s({client:c,target:{categoryId:O.id},lang:s.value})),$.value.state.phase==="idle"?$.value.load(O.following):$.value.sync(O.following))}),ve(()=>b.value?.items,O=>{if(!(!O||!c))for(const B of O){if(B.kind!=="article")continue;const ee=$o({conversationId:B.conversationId});if(ee===null||v.has(ee))continue;const re=$s({client:c,target:{conversationId:B.conversationId},lang:s.value});v.set(ee,re),re.load(B.following)}});function P(O){if(O.kind!=="article")return null;const B=$o({conversationId:O.conversationId});return B===null?null:v.get(B)??null}const T=z(()=>b.value?.category?.name??b.value?.header?.name??""),g=z(()=>(b.value?.category?.kind??b.value?.header?.kind)==="article_discussions"),k=z(()=>h.value?.notCreating()??null),E=z(()=>b.value&&Is(b.value.me).paused===null?Di(b.value.brakedBy):null),w=z(()=>b.value?.created?xo(_.value.topicPath,b.value.created.conversationId):null),y=z(()=>{const O=b.value?.failure;if(!O)return"";const B=Ie(O,s.value);return o(B.key,B.params)});function x(O){h.value?.setSort(O.target.value)}const N=ue(null);ve(()=>h.value?.onboarding.value??null,(O,B)=>{O===null&&B?.state.phase==="done"&&ze(()=>N.value?.focus())});const M=ue("");return ve(()=>b.value?.announceId,()=>{M.value="";const O=r(b.value?.announcement);ze(()=>{M.value=O})}),(O,B)=>h.value&&b.value&&b.value.phase!=="hidden"?(d(),m("section",{key:0,class:"bcm bcm-forum-category",lang:s.value,"aria-labelledby":`${i(a)}-title`},[f("nav",ty,[f("a",{href:_.value.forumPath},u(i(o)("forum.back")),9,ny)]),b.value.phase==="loading"?(d(),m("p",{key:0,id:`${i(a)}-title`,class:"bcm-muted",role:"status"},u(i(o)("forum.loading")),9,oy)):b.value.phase==="membersOnly"&&i(c)?(d(),m("div",{key:1,id:`${i(a)}-title`},[Ee(Ts,{failure:b.value.failure,client:i(c),lang:s.value,"sign-in-href":e.signInHref,"rules-href":_.value.rulesPath,onJoined:B[0]||(B[0]=ee=>h.value.load())},null,8,["failure","client","lang","sign-in-href","rules-href"])],8,sy)):b.value.phase==="notFound"?(d(),m("p",{key:2,id:`${i(a)}-title`,class:"bcm-note"},u(i(o)("forumCategory.notFound")),9,iy)):b.value.phase==="failed"?(d(),m("div",ry,[f("span",{id:`${i(a)}-title`},u(y.value),9,ay),f("button",{type:"button",class:"bcm-btn",onClick:B[1]||(B[1]=ee=>h.value.load())},u(i(o)("common.retry")),1)])):b.value.phase==="ready"?(d(),m(q,{key:4},[f("header",ly,[f("h2",{id:`${i(a)}-title`},u(T.value),9,cy),$.value?(d(),_e(xs,{key:0,ctl:$.value},null,8,["ctl"])):A("",!0)]),b.value.category?.description?(d(),m("p",uy,u(b.value.category.description),1)):A("",!0),Ee(Fi,{me:b.value.me},null,8,["me"]),b.value.category?.mode==="pre"?(d(),m("p",dy,u(i(o)("forum.modePre")),1)):A("",!0),g.value?A("",!0):(d(),m("div",fy,[f("label",{for:`${i(a)}-sort`},u(i(o)("forumCategory.sort")),9,my),f("select",{id:`${i(a)}-sort`,class:"bcm-input bcm-select",value:b.value.sort,disabled:b.value.sorting,onChange:x},[f("option",hy,u(i(o)("forumCategory.sortActivity")),1),f("option",by,u(i(o)("forumCategory.sortNew")),1)],40,py)])),b.value.items.length===0?(d(),m("p",gy,u(g.value?i(o)("forumCategory.articlesEmpty"):i(o)("forumCategory.empty")),1)):(d(),m("ul",{key:4,class:"bcm-topics","aria-busy":b.value.sorting},[(d(!0),m(q,null,me(b.value.items,ee=>(d(),_e(dc,{key:ee.conversationId,item:ee,"topic-href":_.value.topicPath,"article-href":_.value.articlePath,follow:P(ee)},null,8,["item","topic-href","article-href","follow"]))),128))],8,vy)),b.value.nextCursor!==null?(d(),m("div",yy,[f("button",{type:"button",class:"bcm-btn",disabled:b.value.loadingMore,onClick:B[2]||(B[2]=ee=>h.value.loadMore())},u(i(o)("discussion.loadMore")),9,_y)])):A("",!0),g.value?A("",!0):(d(),m("section",{key:6,class:"bcm-section","aria-labelledby":`${i(a)}-new`},[b.value.created?(d(),m("p",wy,[At(u(b.value.created.held?i(o)("topic.createdHeld"):i(o)("topic.created"))+" ",1),w.value?(d(),m("a",{key:0,href:w.value},u(i(o)("topic.open")),9,$y)):A("",!0)])):A("",!0),h.value.canCreate()?(d(),m("div",xy,[f("h3",{id:`${i(a)}-new`},u(i(o)("forumCategory.newTopic")),9,Iy),h.value.onboarding.value?(d(),_e(So,{key:0,model:h.value.onboarding.value,"rules-href":_.value.rulesPath,onCancel:B[3]||(B[3]=ee=>h.value.cancelOnboarding())},null,8,["model","rules-href"])):(d(),_e(Co,{key:1,ref_key:"composerRef",ref:N,kind:"topic",draft:b.value.composer,wait:h.value.waitLeft(),"rules-href":_.value.rulesPath,onSubmit:B[4]||(B[4]=ee=>h.value.create()),onConfirm:B[5]||(B[5]=(ee,re)=>h.value&&h.value.setConfirmed(ee,re)),onConfirmed:B[6]||(B[6]=ee=>h.value.sendConfirmed())},null,8,["draft","wait","rules-href"]))])):k.value==="team"?(d(),m("p",Ty,u(i(o)("forum.teamTopics")),1)):k.value==="paused"&&E.value?(d(),m("p",Cy,u(i(o)(E.value)),1)):A("",!0)],8,ky))],64)):A("",!0),f("p",Sy,u(M.value),1)],8,ey)):A("",!0)}}),fc=4e3,Oy=20;function Ey(e){const{client:t,lang:n}=e,s=new AbortController,o={signal:s.signal};let r=!1,a=0;const l=Re({phase:"loading",failure:null,me:null,categoryId:e.categoryId?.toLowerCase()??"",categories:[],items:[],nextCursor:null,loadingMore:!1,rules:null,open:null,review:null,announcement:null,announceId:0}),c=g=>{l.announcement=g,l.announceId+=1},p=()=>[...l.me?.moderator?.categoryIds??[]].map(g=>g.toLowerCase());function h(g){l.items=l.items.filter(k=>k!==g),c({key:"moderation.gone"})}const b=g=>({...l.categoryId!==""?{categoryId:l.categoryId}:{},...g?{cursor:g}:{}});async function _(g){const k=await t.moderation.queue(b(null),o);if(!(r||g!==a)){if(!k.ok){l.failure=k,l.phase=k.code==="notFound"?"none":k.code==="surfaceOff"?"hidden":k.code==="membersOnly"?"membersOnly":"failed";return}l.items=[...k.value.items],l.nextCursor=k.value.nextCursor,l.phase="ready"}}async function $(){if(l.rules!==null)return;const g=await t.legal.current({kind:"rules",locale:n},o);!r&&g.ok&&(l.rules=Gn(g.value.bodyJson))}async function v(){const g=++a;l.phase="loading",l.failure=null;const k=await t.me.get(o);if(r||g!==a)return;if(!k.ok){l.failure=k,l.phase="failed";return}if(l.me=k.value,p().length===0){l.phase="none";return}const E=await t.forum.categories.list(o);r||g!==a||(E.ok&&(l.categories=E.value.categories.filter(w=>p().includes(w.id.toLowerCase()))),$(),l.categoryId!==""&&!p().includes(l.categoryId)&&(l.categoryId=""),await _(g))}const I=g=>{const k=l.open;return{caseId:k.item.caseId,restriction:k.restriction,basis:k.item.source==="member_report"?"notice":"own_initiative",facts:Ze(k.facts),...k.ground!==""?{contractualGround:k.ground}:{},locale:n,dryRun:g}};function j(){const g=l.open;if(!g||!g.kase||g.restriction===""||g.previewing||g.deciding||g.decided)return!1;const k=Ze(g.facts);return k===""||lt(k)>fc?!1:g.restriction==="no_action"||g.ground!==""||g.kase.ruleId!==null&&!g.needsRule}async function P(g){const k=w=>w.kind==="premod"&&w.conversationId===g.item.conversationId&&w.seq===g.item.seq;let E=null;for(let w=0;w<Oy;w++){const y=await t.moderation.queue(b(E),o);if(r||l.review!==g||!y.ok)return;const x=y.value.items.find(k);if(x){if(x.rev===g.item.rev)return;l.items=l.items.map(N=>k(N)?x:N),g.item=x,g.failure=null,g.changed=!0,c({key:"moderation.textChanged"});return}if(E=y.value.nextCursor,E===null)break}l.review=null,h(g.item)}function T(g,k){if(g.failure=k,k.code==="invalid"&&k.fields?.includes("contractualGround")){g.needsRule=!0,$();return}k.code==="notFound"&&(l.open=null,h(g.item))}return{state:l,load:v,async loadMore(){if(l.loadingMore||l.nextCursor===null||l.phase!=="ready")return;const g=a;l.loadingMore=!0;const k=await t.moderation.queue(b(l.nextCursor),o);if(l.loadingMore=!1,!(r||g!==a)){if(!k.ok)return c(Ie(k,n));l.items=[...l.items,...k.value.items],l.nextCursor=k.value.nextCursor}},async setCategory(g){const k=g.toLowerCase();if(k===l.categoryId||k!==""&&!p().includes(k))return;l.categoryId=k;const E=++a;await _(E)},async openCase(g){if(g.kind!=="case"||!g.caseId)return;l.review=null,l.open={item:g,kase:null,loading:!0,restriction:"",facts:"",ground:"",needsRule:!1,preview:null,previewing:!1,deciding:!1,failure:null,decided:!1,escalation:null};const k=l.open;$();const E=await t.moderation.getCase({caseId:g.caseId},o);r||l.open!==k||(k.loading=!1,E.ok?k.kase=E.value.case:T(k,E))},closeCase(){l.open=null},canPreview:j,async preview(){const g=l.open;if(!g||!j())return;g.previewing=!0,g.failure=null;const k=await t.moderation.decide(I(!0),o);g.previewing=!1,!(r||l.open!==g)&&(k.ok?g.preview=k.value.statement:T(g,k))},async decide(){const g=l.open;if(!g||g.preview===null||g.deciding||g.decided)return;g.deciding=!0,g.failure=null;const k=await t.moderation.decide(I(!1),o);if(g.deciding=!1,!(r||l.open!==g)){if(!k.ok)return T(g,k);g.decided=!0,g.preview=k.value.statement,l.items=l.items.filter(E=>E!==g.item),c({key:"moderation.decided"})}},startEscalation(){const g=l.open;g&&!g.escalation&&(g.escalation={category:"",sending:!1,failure:null,done:!1})},async escalate(){const g=l.open,k=g?.escalation;if(!g||!k||k.sending||k.done||k.category===""||!ls.includes(k.category))return;k.sending=!0,k.failure=null;const E=await t.moderation.escalate({conversationId:g.item.conversationId,seq:g.item.seq,category:k.category},o);if(k.sending=!1,!(r||l.open!==g)){if(E.ok){k.done=!0,c({key:"moderation.escalated"});return}k.failure=E,E.code==="notFound"&&(l.open=null,h(g.item))}},openReview(g,k){g.kind==="premod"&&(l.open=null,l.review={item:g,outcome:k,ruleId:"",facts:"",sending:!1,failure:null,statement:null,done:null,changed:!1},k==="reject"&&$())},closeReview(){l.review=null},async review(){const g=l.review;if(!g||g.sending||g.done||g.outcome==="")return;const k=Ze(g.facts);if(g.outcome==="reject"&&(g.ruleId===""||k===""||lt(k)>fc))return;g.sending=!0,g.failure=null,g.changed=!1;const E={conversationId:g.item.conversationId,seq:g.item.seq,rev:g.item.rev??1},w=g.outcome==="approve"?await t.moderation.reviewPremod({...E,outcome:"approve"},o):await t.moderation.reviewPremod({...E,outcome:"reject",ruleId:g.ruleId,facts:k,locale:n},o);if(g.sending=!1,!(r||l.review!==g)){if(!w.ok){if(g.failure=w,w.code==="notFound"){l.review=null,h(g.item);return}await P(g);return}g.done=g.outcome==="approve"?"approved":"rejected","statement"in w.value&&(g.statement=w.value.statement),l.items=l.items.filter(y=>y!==g.item),c({key:g.done==="approved"?"moderation.approved":"moderation.rejected"})}},dispose(){r=!0,s.abort()}}}const My=["lang","aria-labelledby"],Py={class:"bcm-head"},Ry=["id"],Ny={key:0,class:"bcm-muted",role:"status"},jy={key:1,class:"bcm-banner",role:"alert"},zy={key:0,class:"bcm-row"},Ly=["for"],Dy=["id","value"],Fy={value:""},Uy=["value"],qy={key:1,class:"bcm-muted"},By={key:2,class:"bcm-list"},Hy={class:"bcm-row"},Vy={class:"bcm-badge"},Ky={key:0},Wy={key:1,class:"bcm-muted"},Yy={key:0,class:"bcm-hint"},Gy={key:0,class:"bcm-topic-title"},Zy={key:1,class:"bcm-text"},Jy={key:2,class:"bcm-muted"},Xy={class:"bcm-row bcm-muted"},Qy=["datetime"],e_={key:0},t_={class:"bcm-row"},n_=["href"],o_=["onClick"],s_=["onClick"],i_=["onClick"],r_={key:3,class:"bcm-row"},a_=["disabled"],l_=["aria-labelledby"],c_=["id"],u_={key:0,class:"bcm-muted",role:"status"},d_={key:1,class:"bcm-list"},f_={key:0,class:"bcm-topic-title"},m_={key:1,class:"bcm-topic-title bcm-placeholder"},p_={key:2,class:"bcm-text"},h_={key:3,class:"bcm-placeholder"},b_={key:4,class:"bcm-row bcm-muted"},g_={key:0,class:"bcm-handle"},v_=["datetime"],y_={class:"bcm-fieldset"},__=["value"],k_={class:"bcm-field"},w_=["for"],$_=["id","aria-describedby"],x_=["id"],I_={key:0,class:"bcm-field"},T_=["for"],C_=["id","aria-invalid"],S_={value:"",disabled:""},A_=["value"],O_={key:1,class:"bcm-error",role:"alert"},E_={class:"bcm-facts"},M_={class:"bcm-row"},P_=["disabled"],R_=["disabled"],N_={class:"bcm-facts"},j_={class:"bcm-row"},z_={key:4,class:"bcm-section"},L_={class:"bcm-field"},D_=["for"],F_=["id"],U_={value:"",disabled:""},q_=["value"],B_={key:0,class:"bcm-error",role:"alert"},H_={class:"bcm-row"},V_=["disabled"],K_={key:2},W_=["aria-labelledby"],Y_=["id"],G_={key:0,class:"bcm-facts"},Z_={class:"bcm-row"},J_={key:0,class:"bcm-banner",role:"alert"},X_={key:1,class:"bcm-topic-title"},Q_={key:2,class:"bcm-text"},ek={class:"bcm-field"},tk=["for"],nk=["id"],ok={value:"",disabled:""},sk=["value"],ik={class:"bcm-field"},rk=["for"],ak=["id","aria-describedby"],lk=["id"],ck={key:4,class:"bcm-error",role:"alert"},uk={class:"bcm-row"},dk=["disabled"],fk=["disabled"],mk={class:"bcm-sr","aria-live":"polite"},pk=$e({inheritAttrs:!1,__name:"ForumModerationView",props:{categoryId:{},apiBase:{},siteBase:{},lang:{},routes:{},transport:{type:Function}},setup(e){const t=e,n=ue(Le(t.lang,Ue())),{t:s,text:o}=gt(n),r=He("bcm-moderation");ve(()=>t.lang,N=>{n.value=Le(N,Ue())});const a=ht(t.siteBase),l=a===null?null:bt(t.apiBase,t.transport,a),c=l?Ey({client:l,lang:n.value,categoryId:t.categoryId??null}):null,p=c?.state??null,h=z(()=>Pt(Mt(t.routes),p?.me?.links,a??""));function b(N){const M=ms({title:N.title??null,openingState:N.openingState});return M.kind==="shown"?M.text:s(M.kind==="deleted"?"topic.deleted":"topic.withheld")}nt(()=>{c?.load()}),Ge(()=>c?.dispose());const _=Qf,$=N=>`restriction.${N}`,v=N=>`category.${N}`,I=N=>{const M=N===null?null:`category.${N}`;return M!==null&&Xn(M)?s(M):""},j=N=>{const M=N.source===null?null:`moderation.source.${N.source}`;return M!==null&&Xn(M)?s(M):""},P=N=>p?.categories.find(M=>M.id.toLowerCase()===N.toLowerCase())?.name??"",T=N=>N===null?"":p?.rules?.find(M=>M.id===N)?.title??N,g=N=>Ii(h.value.topicPath,N.conversationId,N.seq),k=N=>{if(!N)return"";const M=Ie(N,n.value);return s(M.key,M.params)},E=z(()=>p?.open??null),w=z(()=>p?.review??null),y=z(()=>{const N=E.value;return!!N&&N.restriction!==""&&N.restriction!=="no_action"&&(N.needsRule||N.kase?.ruleId===null)});ve(()=>[E.value?.restriction,E.value?.facts,E.value?.ground],()=>{const N=E.value;N&&!N.decided&&(N.preview=null)});const x=ue("");return ve(()=>p?.announceId,()=>{x.value="";const N=o(p?.announcement);ze(()=>{x.value=N})}),(N,M)=>i(c)&&i(p)&&i(p).phase!=="none"&&i(p).phase!=="hidden"&&i(p).phase!=="membersOnly"?(d(),m("section",{key:0,class:"bcm bcm-forum-moderation",lang:n.value,"aria-labelledby":`${i(r)}-title`},[f("header",Py,[f("h2",{id:`${i(r)}-title`},u(i(s)("moderation.title")),9,Ry)]),i(p).phase==="loading"?(d(),m("p",Ny,u(i(s)("moderation.loading")),1)):i(p).phase==="failed"?(d(),m("div",jy,[f("span",null,u(k(i(p).failure)),1),f("button",{type:"button",class:"bcm-btn",onClick:M[0]||(M[0]=O=>i(c).load())},u(i(s)("common.retry")),1)])):(d(),m(q,{key:2},[i(p).categories.length>1?(d(),m("div",zy,[f("label",{for:`${i(r)}-category`},u(i(s)("search.category")),9,Ly),f("select",{id:`${i(r)}-category`,class:"bcm-input bcm-select",value:i(p).categoryId,onChange:M[1]||(M[1]=O=>i(c).setCategory(O.target.value))},[f("option",Fy,u(i(s)("forum.allCategories")),1),(d(!0),m(q,null,me(i(p).categories,O=>(d(),m("option",{key:O.id,value:O.id},u(O.name),9,Uy))),128))],40,Dy)])):A("",!0),i(p).items.length===0?(d(),m("p",qy,u(i(s)("moderation.empty")),1)):(d(),m("ul",By,[(d(!0),m(q,null,me(i(p).items,O=>(d(),m("li",{key:`${O.kind}:${O.caseId??""}:${O.conversationId}:${O.seq}`},[f("p",Hy,[f("span",Vy,u(O.kind==="premod"?i(s)("moderation.premod"):j(O)),1),O.kind==="case"&&I(O.caseCategory)?(d(),m("strong",Ky,u(I(O.caseCategory)),1)):A("",!0),P(O.categoryId)?(d(),m("span",Wy,u(P(O.categoryId)),1)):A("",!0)]),O.caseStatus==="decided"?(d(),m("p",Yy,u(i(s)("moderation.heldBySystem")),1)):A("",!0),O.kind==="premod"?(d(),m(q,{key:1},[O.title?(d(),m("p",Gy,u(O.title),1)):A("",!0),O.body!==null?(d(),m("p",Zy,u(O.body),1)):A("",!0)],64)):A("",!0),O.ruleId?(d(),m("p",Jy,u(i(s)("statement.contractualGround"))+": "+u(T(O.ruleId)),1)):A("",!0),f("p",Xy,[f("time",{datetime:O.createdAt},u(i(Pe)(n.value,O.createdAt)),9,Qy),O.deadlineAt?(d(),m("span",e_,u(i(s)("moderation.deadline",{date:i(Pe)(n.value,O.deadlineAt)})),1)):A("",!0)]),f("div",t_,[g(O)?(d(),m("a",{key:0,href:g(O)??void 0},u(i(s)("moderation.openTopic")),9,n_)):A("",!0),M[17]||(M[17]=f("span",{class:"bcm-spacer"},null,-1)),O.kind==="case"?(d(),m("button",{key:1,type:"button",class:"bcm-btn bcm-small",onClick:B=>i(c).openCase(O)},u(i(s)("moderation.open")),9,o_)):(d(),m(q,{key:2},[f("button",{type:"button",class:"bcm-btn bcm-small",onClick:B=>i(c).openReview(O,"approve")},u(i(s)("moderation.approve")),9,s_),f("button",{type:"button",class:"bcm-btn bcm-small bcm-danger",onClick:B=>i(c).openReview(O,"reject")},u(i(s)("moderation.reject")),9,i_)],64))])]))),128))])),i(p).nextCursor!==null?(d(),m("div",r_,[f("button",{type:"button",class:"bcm-btn",disabled:i(p).loadingMore,onClick:M[2]||(M[2]=O=>i(c).loadMore())},u(i(s)("discussion.loadMore")),9,a_)])):A("",!0),E.value?(d(),m("section",{key:4,class:"bcm-card","aria-labelledby":`${i(r)}-case`},[f("h3",{id:`${i(r)}-case`},u(i(s)("moderation.package")),9,c_),E.value.loading?(d(),m("p",u_,u(i(s)("common.loading")),1)):E.value.kase?(d(),m("ol",d_,[(d(!0),m(q,null,me(E.value.kase.items,O=>(d(),m("li",{key:O.itemNo},[O.title?(d(),m("p",f_,u(O.title),1)):O.title===null?(d(),m("p",m_,u(b(O)),1)):A("",!0),O.body!==null?(d(),m("p",p_,u(O.body),1)):(d(),m("p",h_,u(i(s)("moderation.itemWithheld")),1)),O.authorHandle||O.createdAt?(d(),m("p",b_,[O.authorHandle?(d(),m("span",g_,u(O.authorHandle),1)):A("",!0),O.createdAt?(d(),m("time",{key:1,datetime:O.createdAt},u(i(Pe)(n.value,O.createdAt)),9,v_)):A("",!0)])):A("",!0)]))),128))])):A("",!0),E.value.kase&&!E.value.decided?(d(),m("form",{key:2,class:"bcm-form",novalidate:"",onSubmit:M[7]||(M[7]=mt(O=>E.value.preview===null?i(c).preview():i(c).decide(),["prevent"]))},[f("fieldset",y_,[f("legend",null,u(i(s)("moderation.restriction")),1),(d(!0),m(q,null,me(i(_),O=>(d(),m("label",{key:O,class:"bcm-check"},[ge(f("input",{"onUpdate:modelValue":M[3]||(M[3]=B=>E.value.restriction=B),type:"radio",value:O},null,8,__),[[xn,E.value.restriction]]),f("span",null,u(i(s)($(O))),1)]))),128))]),f("div",k_,[f("label",{for:`${i(r)}-facts`},u(i(s)("statement.facts")),9,w_),ge(f("textarea",{id:`${i(r)}-facts`,"onUpdate:modelValue":M[4]||(M[4]=O=>E.value.facts=O),class:"bcm-input bcm-textarea",rows:"4","aria-describedby":`${i(r)}-facts-hint`},null,8,$_),[[Xe,E.value.facts]]),f("p",{id:`${i(r)}-facts-hint`,class:"bcm-hint"},u(i(s)("moderation.factsHint")),9,x_)]),y.value||E.value.ground!==""?(d(),m("div",I_,[f("label",{for:`${i(r)}-ground`},u(i(s)("statement.contractualGround")),9,T_),ge(f("select",{id:`${i(r)}-ground`,"onUpdate:modelValue":M[5]||(M[5]=O=>E.value.ground=O),class:"bcm-input bcm-select","aria-invalid":E.value.needsRule&&E.value.ground===""},[f("option",S_,u(i(s)("moderation.ruleRequired")),1),(d(!0),m(q,null,me(i(p).rules??[],O=>(d(),m("option",{key:O.id,value:O.id},u(O.title),9,A_))),128))],8,C_),[[Yt,E.value.ground]])])):A("",!0),E.value.failure?(d(),m("p",O_,u(E.value.needsRule?i(s)("moderation.ruleRequired"):k(E.value.failure)),1)):A("",!0),E.value.preview!==null?(d(),m(q,{key:2},[f("h4",null,u(i(s)("moderation.previewTitle")),1),f("pre",E_,u(E.value.preview),1)],64)):A("",!0),f("div",M_,[f("button",{type:"button",class:"bcm-btn",onClick:M[6]||(M[6]=O=>i(c).closeCase())},u(i(s)("common.close")),1),M[18]||(M[18]=f("span",{class:"bcm-spacer"},null,-1)),E.value.preview===null?(d(),m("button",{key:0,type:"submit",class:"bcm-btn",disabled:!i(c).canPreview()},u(i(s)("moderation.preview")),9,P_)):(d(),m("button",{key:1,type:"submit",class:"bcm-btn bcm-primary",disabled:E.value.deciding},u(i(s)("moderation.decide")),9,R_))])],32)):E.value.decided?(d(),m(q,{key:3},[f("p",null,u(i(s)("moderation.decided")),1),f("h4",null,u(i(s)("statement.title")),1),f("pre",N_,u(E.value.preview),1),f("div",j_,[f("button",{type:"button",class:"bcm-btn",onClick:M[8]||(M[8]=O=>i(c).closeCase())},u(i(s)("common.close")),1)])],64)):A("",!0),E.value.kase&&!E.value.decided?(d(),m("div",z_,[E.value.escalation?E.value.escalation.done?(d(),m("p",K_,u(i(s)("moderation.escalated")),1)):(d(),m("form",{key:1,class:"bcm-form",novalidate:"",onSubmit:M[11]||(M[11]=mt(O=>i(c).escalate(),["prevent"]))},[f("p",null,u(i(s)("moderation.escalateLede")),1),f("div",L_,[f("label",{for:`${i(r)}-escalate`},u(i(s)("moderation.escalateCategory")),9,D_),ge(f("select",{id:`${i(r)}-escalate`,"onUpdate:modelValue":M[10]||(M[10]=O=>E.value.escalation.category=O),class:"bcm-input bcm-select"},[f("option",U_,u(i(s)("moderation.escalateCategory")),1),(d(!0),m(q,null,me(i(ls),O=>(d(),m("option",{key:O,value:O},u(i(s)(v(O))),9,q_))),128))],8,F_),[[Yt,E.value.escalation.category]])]),E.value.escalation.failure?(d(),m("p",B_,u(k(E.value.escalation.failure)),1)):A("",!0),f("div",H_,[f("button",{type:"submit",class:"bcm-btn",disabled:E.value.escalation.category===""||E.value.escalation.sending},u(i(s)("moderation.escalate")),9,V_)])],32)):(d(),m("button",{key:0,type:"button",class:"bcm-link",onClick:M[9]||(M[9]=O=>i(c).startEscalation())},u(i(s)("moderation.escalate")),1))])):A("",!0)],8,l_)):A("",!0),w.value?(d(),m("section",{key:5,class:"bcm-card","aria-labelledby":`${i(r)}-review`},[f("h3",{id:`${i(r)}-review`},u(w.value.outcome==="approve"?i(s)("moderation.approve"):i(s)("moderation.reject")),9,Y_),w.value.done?(d(),m(q,{key:0},[f("p",null,u(w.value.done==="approved"?i(s)("moderation.approved"):i(s)("moderation.rejected")),1),w.value.statement?(d(),m("pre",G_,u(w.value.statement),1)):A("",!0),f("div",Z_,[f("button",{type:"button",class:"bcm-btn",onClick:M[12]||(M[12]=O=>i(c).closeReview())},u(i(s)("common.close")),1)])],64)):(d(),m("form",{key:1,class:"bcm-form",novalidate:"",onSubmit:M[16]||(M[16]=mt(O=>i(c).review(),["prevent"]))},[w.value.changed?(d(),m("p",J_,u(i(s)("moderation.textChanged")),1)):A("",!0),w.value.item.title?(d(),m("p",X_,u(w.value.item.title),1)):A("",!0),w.value.item.body!==null?(d(),m("p",Q_,u(w.value.item.body),1)):A("",!0),w.value.outcome==="reject"?(d(),m(q,{key:3},[f("div",ek,[f("label",{for:`${i(r)}-review-rule`},u(i(s)("statement.contractualGround")),9,tk),ge(f("select",{id:`${i(r)}-review-rule`,"onUpdate:modelValue":M[13]||(M[13]=O=>w.value.ruleId=O),class:"bcm-input bcm-select"},[f("option",ok,u(i(s)("moderation.ruleRequired")),1),(d(!0),m(q,null,me(i(p).rules??[],O=>(d(),m("option",{key:O.id,value:O.id},u(O.title),9,sk))),128))],8,nk),[[Yt,w.value.ruleId]])]),f("div",ik,[f("label",{for:`${i(r)}-review-facts`},u(i(s)("statement.facts")),9,rk),ge(f("textarea",{id:`${i(r)}-review-facts`,"onUpdate:modelValue":M[14]||(M[14]=O=>w.value.facts=O),class:"bcm-input bcm-textarea",rows:"4","aria-describedby":`${i(r)}-review-hint`},null,8,ak),[[Xe,w.value.facts]]),f("p",{id:`${i(r)}-review-hint`,class:"bcm-hint"},u(i(s)("moderation.factsHint")),9,lk)])],64)):A("",!0),w.value.failure?(d(),m("p",ck,u(k(w.value.failure)),1)):A("",!0),f("div",uk,[f("button",{type:"button",class:"bcm-btn",disabled:w.value.sending,onClick:M[15]||(M[15]=O=>i(c).closeReview())},u(i(s)("common.cancel")),9,dk),M[19]||(M[19]=f("span",{class:"bcm-spacer"},null,-1)),f("button",{type:"submit",class:Ve(["bcm-btn bcm-primary",{"bcm-danger":w.value.outcome==="reject"}]),disabled:w.value.sending||w.value.outcome==="reject"&&(w.value.ruleId===""||w.value.facts.trim()==="")},u(w.value.outcome==="approve"?i(s)("moderation.approve"):i(s)("moderation.reject")),11,fk)])],32))],8,W_)):A("",!0)],64)),f("p",mk,u(x.value),1)],8,My)):A("",!0)}});function mc(e){if(typeof e!="string"||!e.startsWith("#"))return null;for(const t of e.slice(1).split("&"))if(t.startsWith("q="))try{const n=decodeURIComponent(t.slice(2).replace(/\+/g," "));return n.length<=rs*2?n:null}catch{return null}return null}function hk(e,t){const n=wi(t);return n===null||e.includes("#")?null:`${e}#q=${encodeURIComponent(n)}`}function bk(e){const{client:t}=e,n=new AbortController,s={signal:n.signal};let o=!1,r=0;const a=Re({phase:"idle",failure:null,query:e.query??"",space:"",categoryId:"",categories:[],invalid:null,results:[],page:0,hasMore:!1,loadingMore:!1}),l=h=>{a.failure=h,a.phase=h.code==="surfaceOff"?"hidden":h.code==="membersOnly"?"membersOnly":"failed"};let c=null;async function p(){const h=wi(a.query);if(h===null){a.invalid=a.query.trim().length>rs?"long":"short";return}a.invalid=null;const b=++r;a.phase="searching",a.failure=null;const _={query:h,...a.categoryId!==""?{categoryId:a.categoryId}:{},...a.space!==""?{space:a.space}:{}};c=_;const $=await t.forum.search({..._,page:1},s);if(!(o||b!==r)){if(!$.ok)return l($);a.results=[...$.value.results],a.page=$.value.page,a.hasMore=$.value.hasMore,a.phase="ready"}}return{state:a,async load(){const h=await t.forum.categories.list(s);o||(h.ok?a.categories=h.value.categories.filter(b=>b.kind==="topics"):(h.code==="membersOnly"||h.code==="surfaceOff")&&l(h),wi(a.query)!==null&&a.phase==="idle"&&await p())},search:p,async more(){const h=Xm({page:a.page,hasMore:a.hasMore});if(h===null||c===null||a.loadingMore||a.phase!=="ready")return;const b=r;a.loadingMore=!0;const _=await t.forum.search({...c,page:h},s);if(a.loadingMore=!1,!(o||b!==r)){if(!_.ok){a.failure=_;return}a.results=[...a.results,..._.value.results],a.page=_.value.page,a.hasMore=_.value.hasMore}},dispose(){o=!0,n.abort()}}}const gk=["lang","aria-labelledby"],vk={class:"bcm-head"},yk=["id"],_k={key:1,class:"bcm-search-body"},kk={class:"bcm-field"},wk=["for"],$k=["id","aria-invalid","aria-describedby"],xk=["id"],Ik={class:"bcm-row"},Tk=["for"],Ck=["id"],Sk={value:""},Ak={value:"forum"},Ok={value:"article"},Ek=["for"],Mk=["id"],Pk={value:""},Rk=["value"],Nk=["disabled"],jk={key:0,class:"bcm-muted",role:"status"},zk={key:1,class:"bcm-banner",role:"alert"},Lk={key:0,class:"bcm-muted",role:"status"},Dk={key:1,class:"bcm-list"},Fk={class:"bcm-row bcm-muted"},Uk={class:"bcm-badge"},qk=["datetime"],Bk={class:"bcm-topic-title"},Hk=["href"],Vk={key:0,class:"bcm-text"},Kk={key:2,class:"bcm-error",role:"alert"},Wk={key:3,class:"bcm-row"},Yk=["disabled"],Gk={key:4,class:"bcm-hint"},Zk=$e({inheritAttrs:!1,__name:"ForumSearchView",props:{apiBase:{},siteBase:{},lang:{},routes:{},signInHref:{},transport:{type:Function}},setup(e){const t=e,n=ue(Le(t.lang,Ue())),{t:s}=gt(n),o=He("bcm-search");ve(()=>t.lang,I=>{n.value=Le(I,Ue())});const r=ht(t.siteBase),a=r===null?null:bt(t.apiBase,t.transport,r),l=a?bk({client:a,query:mc(typeof location>"u"?null:location.hash)}):null,c=l?.state??null,p=z(()=>Pt(Mt(t.routes),null,r??""));function h(){const I=mc(location.hash);!l||!c||I===null||I===c.query||(c.query=I,l.search())}nt(()=>{l?.load(),typeof window<"u"&&window.addEventListener("hashchange",h)}),Ge(()=>{typeof window<"u"&&window.removeEventListener("hashchange",h),l?.dispose()});function b(I){return I.space==="article"?Ti(p.value.articlePath,I.articleSlug,I.seq):I.space!=="forum"?null:I.seq!==null&&I.kind==="message"?Ii(p.value.topicPath,I.conversationId,I.seq):xo(p.value.topicPath,I.conversationId)}function _(I){if(I.space==="forum"){const j=ms(I);return j.kind==="shown"?j.text:s(j.kind==="deleted"?"topic.deleted":"topic.withheld")}return I.title!==null&&I.title.trim()!==""?I.title:s("search.inArticle")}const $=z(()=>{const I=c?.failure;if(!I)return"";const j=Ie(I,n.value);return s(j.key,j.params)}),v=z(()=>!!c&&c.phase==="ready"&&c.page>=La&&c.results.length>0);return(I,j)=>i(l)&&i(c)&&i(c).phase!=="hidden"?(d(),m("section",{key:0,class:"bcm bcm-forum-search",lang:n.value,"aria-labelledby":`${i(o)}-title`},[f("header",vk,[f("h2",{id:`${i(o)}-title`},u(i(s)("search.title")),9,yk)]),i(c).phase==="membersOnly"&&i(a)?(d(),_e(Ts,{key:0,failure:i(c).failure,client:i(a),lang:n.value,"sign-in-href":e.signInHref,"rules-href":p.value.rulesPath,onJoined:j[0]||(j[0]=P=>i(l).load())},null,8,["failure","client","lang","sign-in-href","rules-href"])):(d(),m("div",_k,[f("form",{class:"bcm-form",role:"search",novalidate:"",onSubmit:j[4]||(j[4]=mt(P=>i(l).search(),["prevent"]))},[f("div",kk,[f("label",{for:`${i(o)}-q`},u(i(s)("search.label")),9,wk),ge(f("input",{id:`${i(o)}-q`,"onUpdate:modelValue":j[1]||(j[1]=P=>i(c).query=P),class:"bcm-input",type:"search","aria-invalid":i(c).invalid!==null,"aria-describedby":`${i(o)}-q-error`},null,8,$k),[[Xe,i(c).query]]),i(c).invalid?(d(),m("p",{key:0,id:`${i(o)}-q-error`,class:"bcm-error",role:"alert"},u(i(c).invalid==="short"?i(s)("search.tooShort",{min:i(pi)}):i(s)("search.tooLong",{max:i(rs)})),9,xk)):A("",!0)]),f("div",Ik,[f("label",{for:`${i(o)}-space`},u(i(s)("search.space")),9,Tk),ge(f("select",{id:`${i(o)}-space`,"onUpdate:modelValue":j[2]||(j[2]=P=>i(c).space=P),class:"bcm-input bcm-select"},[f("option",Sk,u(i(s)("search.spaceAll")),1),f("option",Ak,u(i(s)("search.spaceForum")),1),f("option",Ok,u(i(s)("search.spaceArticle")),1)],8,Ck),[[Yt,i(c).space]]),i(c).categories.length>0&&i(c).space!=="article"?(d(),m(q,{key:0},[f("label",{for:`${i(o)}-category`},u(i(s)("search.category")),9,Ek),ge(f("select",{id:`${i(o)}-category`,"onUpdate:modelValue":j[3]||(j[3]=P=>i(c).categoryId=P),class:"bcm-input bcm-select"},[f("option",Pk,u(i(s)("forum.allCategories")),1),(d(!0),m(q,null,me(i(c).categories,P=>(d(),m("option",{key:P.id,value:P.id},u(P.name),9,Rk))),128))],8,Mk),[[Yt,i(c).categoryId]])],64)):A("",!0),f("button",{type:"submit",class:"bcm-btn bcm-primary",disabled:i(c).phase==="searching"},u(i(s)("search.submit")),9,Nk)])],32),i(c).phase==="searching"?(d(),m("p",jk,u(i(s)("search.searching")),1)):i(c).phase==="failed"?(d(),m("div",zk,[f("span",null,u($.value),1)])):i(c).phase==="ready"?(d(),m(q,{key:2},[i(c).results.length===0?(d(),m("p",Lk,u(i(s)("search.empty")),1)):(d(),m("ol",Dk,[(d(!0),m(q,null,me(i(c).results,(P,T)=>(d(),m("li",{key:`${P.conversationId}:${P.seq??0}:${T}`},[f("p",Fk,[f("span",Uk,u(P.kind==="topic"?i(s)("search.topic"):i(s)("search.message")),1),f("time",{datetime:P.createdAt},u(i(Pe)(n.value,P.createdAt)),9,qk)]),f("p",Bk,[b(P)?(d(),m("a",{key:0,href:b(P)??void 0,class:Ve({"bcm-placeholder":P.title===null})},u(_(P)),11,Hk)):(d(),m("span",{key:1,class:Ve({"bcm-placeholder":P.title===null})},u(_(P)),3))]),P.snippet?(d(),m("p",Vk,u(P.snippet),1)):A("",!0)]))),128))])),i(c).failure?(d(),m("p",Kk,u($.value),1)):A("",!0),i(c).hasMore?(d(),m("div",Wk,[f("button",{type:"button",class:"bcm-btn",disabled:i(c).loadingMore,onClick:j[5]||(j[5]=P=>i(l).more())},u(i(s)("search.more")),9,Yk)])):v.value?(d(),m("p",Gk,u(i(s)("search.lastPage")),1)):A("",!0)],64)):A("",!0)]))],8,gk)):A("",!0)}}),Jk=10,pc=3;function Xk(e){const{client:t}=e,n=new AbortController,s={signal:n.signal};let o=!1,r=0;const a=Re({phase:"loading",failure:null,me:null,categories:[],latest:{}});async function l(){const c=++r;a.phase="loading",a.failure=null;const[p,h]=await Promise.all([t.me.get(s),t.forum.categories.list(s)]);if(o||c!==r)return;if(p.ok&&(a.me=p.value),!h.ok){a.failure=h,a.phase=h.code==="surfaceOff"?"hidden":h.code==="membersOnly"?"membersOnly":"failed";return}a.categories=[...h.value.categories].sort((v,I)=>v.position-I.position),a.latest={},a.phase="ready";const b=a.categories.slice(0,Jk),_=await Promise.all(b.map(v=>t.forum.topics.list({categoryId:v.id,sort:"activity",limit:pc},s)));if(o||c!==r)return;const $={};b.forEach((v,I)=>{const j=_[I];j?.ok&&($[v.id]=$i(j.value.items).slice(0,pc))}),a.latest=$}return{state:a,load:l,dispose(){o=!0,n.abort()}}}const Qk=["lang","aria-labelledby"],ew={class:"bcm-head"},tw=["id"],nw={key:0,class:"bcm-muted",role:"status"},ow={key:2,class:"bcm-banner",role:"alert"},sw={key:3,class:"bcm-forum-body"},iw=["for"],rw=["id","placeholder"],aw={type:"submit",class:"bcm-btn"},lw={key:0,class:"bcm-error bcm-full",role:"alert"},cw={key:0,class:"bcm-muted"},uw={key:1,class:"bcm-list"},dw=["href"],fw={key:0,class:"bcm-text"},mw={class:"bcm-row bcm-muted"},pw=["datetime"],hw={key:1,class:"bcm-hint"},bw=["aria-label"],gw={key:3},vw=["href"],yw=$e({inheritAttrs:!1,__name:"ForumView",props:{apiBase:{},siteBase:{},lang:{},routes:{},signInHref:{},transport:{type:Function}},setup(e){const t=e,n=ue(Le(t.lang,Ue())),{t:s}=gt(n),o=He("bcm-forum"),r=ht(t.siteBase),a=r===null?null:bt(t.apiBase,t.transport,r),l=a?Xk({client:a}):null,c=l?.state??null,p=z(()=>Pt(Mt(t.routes),c?.me?.links,r??""));nt(()=>{l?.load()}),Ge(()=>l?.dispose()),ve(()=>t.lang,I=>{n.value=Le(I,Ue())});const h=ue(""),b=ue(!1);function _(){const I=hk(p.value.searchPath,h.value);b.value=I===null,I!==null&&typeof location<"u"&&location.assign(I)}const $=z(()=>{const I=c?.failure;if(!I)return"";const j=Ie(I,n.value);return s(j.key,j.params)}),v=I=>I.kind==="article_discussions"?s("forum.discussionCount",{count:I.topicCount}):s("forum.topicCount",{count:I.topicCount});return(I,j)=>i(l)&&i(c)&&i(c).phase!=="hidden"?(d(),m("section",{key:0,class:"bcm bcm-forum",lang:n.value,"aria-labelledby":`${i(o)}-title`},[f("header",ew,[f("h2",{id:`${i(o)}-title`},u(i(s)("forum.title")),9,tw)]),i(c).phase==="loading"?(d(),m("p",nw,u(i(s)("forum.loading")),1)):i(c).phase==="membersOnly"&&i(a)?(d(),_e(Ts,{key:1,failure:i(c).failure,client:i(a),lang:n.value,"sign-in-href":e.signInHref,"rules-href":p.value.rulesPath,onJoined:j[0]||(j[0]=P=>i(l).load())},null,8,["failure","client","lang","sign-in-href","rules-href"])):i(c).phase==="failed"?(d(),m("div",ow,[f("span",null,u($.value),1),f("button",{type:"button",class:"bcm-btn",onClick:j[1]||(j[1]=P=>i(l).load())},u(i(s)("common.retry")),1)])):i(c).phase==="ready"?(d(),m("div",sw,[Ee(Fi,{me:i(c).me},null,8,["me"]),f("form",{class:"bcm-row",role:"search",onSubmit:mt(_,["prevent"])},[f("label",{for:`${i(o)}-q`,class:"bcm-sr"},u(i(s)("forum.search")),9,iw),ge(f("input",{id:`${i(o)}-q`,"onUpdate:modelValue":j[2]||(j[2]=P=>h.value=P),class:"bcm-input bcm-grow",type:"search",placeholder:i(s)("forum.search")},null,8,rw),[[Xe,h.value]]),f("button",aw,u(i(s)("forum.searchSubmit")),1),b.value?(d(),m("p",lw,u(i(s)("search.tooShort",{min:i(pi)})),1)):A("",!0)],32),i(c).categories.length===0?(d(),m("p",cw,u(i(s)("forum.empty")),1)):(d(),m("ul",uw,[(d(!0),m(q,null,me(i(c).categories,P=>(d(),m("li",{key:P.id,class:"bcm-category"},[f("h3",null,[i(On)(p.value.categoryPath,P.slug)?(d(),m("a",{key:0,href:i(On)(p.value.categoryPath,P.slug)??void 0},u(P.name),9,dw)):(d(),m(q,{key:1},[At(u(P.name),1)],64))]),P.description?(d(),m("p",fw,u(P.description),1)):A("",!0),f("p",mw,[f("span",null,u(v(P)),1),P.lastActivityAt?(d(),m("time",{key:0,datetime:P.lastActivityAt},u(i(s)("forum.lastActivity",{date:i(Pe)(n.value,P.lastActivityAt)})),9,pw)):A("",!0)]),P.mode==="pre"?(d(),m("p",hw,u(i(s)("forum.modePre")),1)):A("",!0),i(c).latest[P.id]?.length?(d(),m("ul",{key:2,class:"bcm-topics","aria-label":i(s)("forum.latest")},[(d(!0),m(q,null,me(i(c).latest[P.id],T=>(d(),_e(dc,{key:T.conversationId,item:T,"topic-href":p.value.topicPath,"article-href":p.value.articlePath},null,8,["item","topic-href","article-href"]))),128))],8,bw)):A("",!0),i(On)(p.value.categoryPath,P.slug)?(d(),m("p",gw,[f("a",{href:i(On)(p.value.categoryPath,P.slug)??void 0},u(i(s)("forum.allTopics")),9,vw)])):A("",!0)]))),128))]))])):A("",!0)],8,Qk)):A("",!0)}}),Ui=new WeakMap;function _w(e){if(typeof location<"u"&&location.hash.startsWith("#u=")){const t=Sl(location.hash);return cp(),up(),e&&Ui.set(e,t),t}return e&&Ui.has(e)?Ui.get(e)??null:null}const Ao=()=>typeof navigator>"u"?null:navigator;function qi(){const e=globalThis;return e.Notification&&typeof e.Notification.requestPermission=="function"?e.Notification:null}function hc(e=Ao()){if(!e)return!1;const t=e.userAgent??"";return/iPhone|iPad|iPod/.test(t)||e.platform==="MacIntel"&&(e.maxTouchPoints??0)>1}function kw(e=Ao()){if(!e)return"other";if(hc(e))return"ios";const t=e.userAgent??"";return/Android/.test(t)?"android":/Mobi|Tablet/.test(t)||t===""?"other":"desktop"}function ww(){const e=Ao();if(!e)return"unsupported";if(_m(e.userAgent??""))return"inApp";if(hc(e)&&e.standalone!==!0)return"iosInstall";const t=globalThis;return!e.serviceWorker||typeof e.serviceWorker.register!="function"||typeof t.PushManager>"u"||!qi()?"unsupported":"supported"}function bc(){return qi()?.permission??"default"}async function $w(){const e=qi();if(!e)return"denied";if(e.permission!=="default")return e.permission;try{return await e.requestPermission()}catch{return"denied"}}async function gc(){const e=Ao()?.serviceWorker;if(!e||typeof e.getRegistration!="function")return null;try{return await e.getRegistration()??null}catch{return null}}async function xw(e){const t=Ao()?.serviceWorker;if(!t)throw new Error("[blogmcp-community] no service worker support");return t.register(e)}async function Bi(e){if(!e?.pushManager||typeof e.pushManager.getSubscription!="function")return null;try{return await e.pushManager.getSubscription()??null}catch{return null}}function Iw(e){if(typeof e!="string"||!/^[A-Za-z0-9_-]+={0,2}$/.test(e))return null;const t=e.replace(/=+$/,"").replace(/-/g,"+").replace(/_/g,"/"),n=t+"=".repeat((4-t.length%4)%4);try{const s=atob(n),o=new Uint8Array(s.length);for(let r=0;r<s.length;r++)o[r]=s.charCodeAt(r);return o}catch{return null}}function vc(e){const t=typeof e.toJSON=="function"?e.toJSON():null,n=t?.endpoint??e.endpoint,s=t?.keys?.p256dh,o=t?.keys?.auth;return typeof n!="string"||typeof s!="string"||typeof o!="string"?null:{endpoint:n,keys:{p256dh:s,auth:o}}}const Hi="blogmcp-community:push-key-id";function Tw(){try{const e=typeof localStorage>"u"?null:localStorage.getItem(Hi);if(e===null)return null;const t=JSON.parse(e);return t&&typeof t.memberId=="string"&&typeof t.keyId=="string"?{memberId:t.memberId,keyId:t.keyId}:null}catch{return null}}function yc(e){try{if(typeof localStorage>"u")return;e===null?localStorage.removeItem(Hi):localStorage.setItem(Hi,JSON.stringify({memberId:e.memberId,keyId:e.keyId}))}catch{}}const Cw=["notifyReply","notifyMention","notifyTopic","pushEnabled","digestEmail","quietHours"];function Sw(e){const{client:t,swPath:n}=e,s=e.digestToken,o=new AbortController,r={signal:o.signal};let a=!1,l=null,c=[];const p=Re({phase:"idle",failure:null,module:null,settings:null,saving:{},push:{support:ww(),status:"checking",note:null,failure:null},digest:{offered:s!==null,sending:!1,outcome:null,failure:null},announcement:null,announceId:0}),h=w=>{p.announcement=w,p.announceId+=1},b=w=>({key:`error.${w.code}`}),_=()=>{const w=p.module?.state;return w===void 0||Yn(w)&&w!=="dark"},$=()=>p.phase==="ready"&&l!==null&&p.module?.features.push===!0;async function v(){const w=await t.me.get(r);return w.ok?(p.module=w.value.module??null,w.value.needs.includes("sign_in")?"signIn":(l=w.value.member?.memberId??null,l===null?"reader":"member")):w.code==="signIn"?"signIn":w}async function I(w){const y=vc(w)?.endpoint;if(!y||l===null)return!1;const x=await t.me.push.status({endpoint:y},r);return x.ok&&x.value.subscribed===!0}async function j(){if(!$()||p.push.support!=="supported"){p.push.status="off";return}const w=await Bi(await gc());if(a)return;const y=await t.me.notifications.list({unreadOnly:!0,codes:["module_push_reset"]},r);if(a)return;c=y.ok?y.value.items.filter(re=>re.code==="module_push_reset"&&re.readAt===null).map(re=>re.id):[];const x=Tw(),N=w!==null&&x!==null&&x.memberId===l;let M=!1,O=!1;if(N){const re=await t.me.push.vapid(r);if(a)return;M=re.ok&&re.value.keyId!==x.keyId,O=re.ok&&!M}const B=bc();let ee=N&&O&&B==="granted";ee&&w&&(ee=await I(w),a)||(p.push.status=ee?"on":"off",p.push.note=M||c.length>0?"reset":B==="denied"?"denied":null)}async function P(){p.phase="loading",p.failure=null;const w=await v();if(a)return;if(w==="signIn"){p.phase="signIn";return}if(w!=="member"&&w!=="reader"){p.phase="failed",p.failure=w;return}if(!_()){p.phase="failed",p.failure={ok:!1,code:"unavailable"};return}const y=await t.me.settings.get(r);if(!a){if(!y.ok){p.phase=y.code==="signIn"?"signIn":"failed",p.failure=y;return}p.settings={...y.value.settings},p.phase="ready",await j()}}async function T(w,y){const x=p.settings;if(!x||p.saving[w]||x[w]===y)return;p.saving[w]=!0;const N=x[w];p.settings={...x,[w]:y};const M=await t.me.settings.update({[w]:y},r);if(delete p.saving[w],!a){if(!M.ok)return p.settings&&(p.settings={...p.settings,[w]:N}),h(b(M));if(p.settings={...M.value.settings},h({key:"settings.saved"}),w==="pushEnabled"){const O=await v();if(a||O!=="member"&&O!=="reader")return;await j()}}}async function g(){const w=p.push;if(!$()||w.support!=="supported"||w.status==="busy"||l===null)return;const y=l;w.status="busy",w.failure=null,w.note=null;const x=(N,M=null)=>{w.status="off",w.note=N,w.failure=M};try{if(await $w()!=="granted")return x("denied");if(a)return;const N=await xw(n);if(a)return;const M=await t.me.push.vapid(r);if(a)return;if(!M.ok)return x(M.code==="pushRefused"?"refused":null,M);const O=Iw(M.value.publicKey);if(!O)return x(null,{ok:!1,code:"unavailable"});const B=await Bi(N);B&&await B.unsubscribe().catch(()=>!1);const ee=await N.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:O});if(a)return;const re=vc(ee);if(!re)return await ee.unsubscribe().catch(()=>!1),x("refused");const be=await t.me.push.subscribe({...re,userAgentClass:kw()},r);if(a)return;if(!be.ok)return await ee.unsubscribe().catch(()=>!1),x(be.code==="pushRefused"?"refused":null,be);if(yc({memberId:y,keyId:be.value.keyId}),w.status="on",h({key:"settings.saved"}),c.length>0){const we=c;c=[],t.me.notifications.markRead({ids:we},r)}}catch{a||x(bc()==="denied"?"denied":"refused")}}async function k(){const w=p.push;if(w.status==="busy")return;w.status="busy",w.failure=null,w.note=null;let y=null;try{const x=await Bi(await gc());y=x?.endpoint??null,await x?.unsubscribe()}catch{}if(!a){if(y){const x=await t.me.push.unsubscribe({endpoint:y},r);if(a)return;x.ok||(w.failure=x)}yc(null),w.status="off",w.failure||h({key:"settings.saved"})}}async function E(){const w=p.digest;if(!s||w.sending||w.outcome==="unsubscribed")return;w.sending=!0,w.failure=null;const y=await t.me.settings.unsubscribeDigest({token:s},r);if(w.sending=!1,!a){if(y.ok){w.outcome="unsubscribed",p.settings&&(p.settings={...p.settings,digestEmail:!1}),h({key:"settings.digest.unsubscribed"});return}if(y.code==="invalid"){w.outcome="staleLink";return}w.failure=y}}return{state:p,load:P,toggle:T,pushShown:$,enablePush:g,disablePush:k,unsubscribeDigest:E,dispose(){a=!0,o.abort()}}}const Aw=["lang","aria-labelledby"],Ow=["id"],Ew=["aria-labelledby"],Mw=["id"],Pw={key:0,role:"status"},Rw={key:1,class:"bcm-note",role:"alert"},Nw={key:0,class:"bcm-error",role:"alert"},jw={class:"bcm-row"},zw=["disabled"],Lw={key:1,class:"bcm-muted",role:"status"},Dw={key:2,class:"bcm-row"},Fw=["href"],Uw={key:3,class:"bcm-banner",role:"alert"},qw={class:"bcm-switches"},Bw={class:"bcm-check"},Hw=["name","checked","disabled","onChange"],Vw=["aria-labelledby"],Kw=["id"],Ww={class:"bcm-hint"},Yw=["href"],Gw={class:"bcm-url"},Zw={key:1},Jw={key:2},Xw={key:0,class:"bcm-note"},Qw={key:1,class:"bcm-note",role:"alert"},e1={key:2,class:"bcm-note",role:"alert"},t1={key:3,class:"bcm-error",role:"alert"},n1={class:"bcm-row"},o1=["disabled"],s1={class:"bcm-sr","aria-live":"polite"},i1=$e({inheritAttrs:!1,__name:"MemberSettingsView",props:{apiBase:{},siteBase:{},lang:{},swPath:{},routes:{},signInHref:{},transport:{type:Function}},setup(e){const t=e,n=ue(Le(t.lang,Ue())),{t:s,text:o}=gt(n),r=He("bcm-settings"),a=Vn(),l=ht(t.siteBase),c=l===null?null:bt(t.apiBase,t.transport,l);function p(w){return w===void 0||w===""?`${l??""}/sw.js`:hs(w)?w:(Ut("sw-path",'[blogmcp-community] sw-path must be a path on this site (e.g. "/blog/sw.js"): the service worker is the site’s own'),null)}const h=_w(a),b=p(t.swPath),_=c&&b?Sw({client:c,swPath:b,digestToken:h}):null,$=_?.state??null;nt(()=>{_?.load()}),Ge(()=>_?.dispose());const v=Object.freeze({notifyReply:"settings.notifyReply",notifyMention:"settings.notifyMention",notifyTopic:"settings.notifyTopic",pushEnabled:"settings.pushEnabled",digestEmail:"settings.digestEmail",quietHours:"settings.quietHours"}),I=z(()=>{const w=$?.failure;if(!w)return"";const y=Ie(w,n.value);return s(y.key,y.params)}),j=z(()=>{const w=$?.push.failure;if(!w)return"";const y=Ie(w,n.value);return s(y.key,y.params)}),P=z(()=>{const w=$?.digest.failure;if(!w)return"";const y=Ie(w,n.value);return s(y.key,y.params)}),T=z(()=>typeof location>"u"?"":location.href);function g(){return En(t.signInHref,typeof location>"u"?null:location.pathname)}function k(w,y){_?.toggle(w,y.target.checked)}const E=ue("");return ve(()=>$?.announceId,()=>{E.value="";const w=o($?.announcement);ze(()=>{E.value=w})}),(w,y)=>i(_)&&i($)?(d(),m("section",{key:0,class:"bcm bcm-settings",lang:n.value,"aria-labelledby":`${i(r)}-title`},[f("h2",{id:`${i(r)}-title`},u(i(s)("settings.title")),9,Ow),i($).digest.offered?(d(),m("section",{key:0,class:"bcm-card","aria-labelledby":`${i(r)}-digest`},[f("h3",{id:`${i(r)}-digest`},u(i(s)("settings.digestEmail")),9,Mw),i($).digest.outcome==="unsubscribed"?(d(),m("p",Pw,u(i(s)("settings.digest.unsubscribed")),1)):i($).digest.outcome==="staleLink"?(d(),m("p",Rw,u(i(s)("settings.digest.staleLink")),1)):(d(),m(q,{key:2},[f("p",null,u(i(s)("settings.digest.prompt")),1),P.value?(d(),m("p",Nw,u(P.value),1)):A("",!0),f("div",jw,[f("button",{type:"button",class:"bcm-btn bcm-primary",disabled:i($).digest.sending,onClick:y[0]||(y[0]=x=>i(_).unsubscribeDigest())},u(i(s)("settings.digest.confirm")),9,zw)])],64))],8,Ew)):A("",!0),i($).phase==="loading"||i($).phase==="idle"?(d(),m("p",Lw,u(i(s)("common.loading")),1)):i($).phase==="signIn"?(d(),m("div",Dw,[f("p",null,u(i(s)("settings.signIn")),1),g()?(d(),m("a",{key:0,class:"bcm-btn bcm-primary",href:g()??void 0},u(i(s)("common.signIn")),9,Fw)):A("",!0)])):i($).phase==="failed"?(d(),m("div",Uw,[f("span",null,u(I.value),1),f("button",{type:"button",class:"bcm-btn",onClick:y[1]||(y[1]=x=>i(_).load())},u(i(s)("common.retry")),1)])):i($).settings?(d(),m(q,{key:4},[f("ul",qw,[(d(!0),m(q,null,me(i(Cw),x=>(d(),m("li",{key:x},[f("label",Bw,[f("input",{type:"checkbox",name:x,checked:i($).settings[x],disabled:!!i($).saving[x],onChange:N=>k(x,N)},null,40,Hw),f("span",null,u(i(s)(i(v)[x])),1)])]))),128))]),i(_).pushShown()?(d(),m("section",{key:0,class:"bcm-card","aria-labelledby":`${i(r)}-push`},[f("h3",{id:`${i(r)}-push`},u(i(s)("settings.pushEnabled")),9,Kw),f("p",Ww,u(i(s)("settings.push.carries")),1),i($).push.support==="inApp"?(d(),m(q,{key:0},[f("p",null,u(i(s)("settings.push.inAppExplain")),1),f("p",null,[f("a",{href:T.value,target:"_blank",rel:"noopener"},u(i(s)("settings.push.openInBrowser")),9,Yw)]),f("p",Gw,u(T.value),1)],64)):i($).push.support==="iosInstall"?(d(),m("p",Zw,u(i(s)("settings.push.iosGuide")),1)):i($).push.support==="unsupported"?(d(),m("p",Jw,u(i(s)("settings.push.unsupported")),1)):(d(),m(q,{key:3},[i($).push.note==="reset"?(d(),m("p",Xw,u(i(s)("settings.push.reset")),1)):i($).push.note==="denied"?(d(),m("p",Qw,u(i(s)("settings.push.denied")),1)):i($).push.note==="refused"?(d(),m("p",e1,u(i(s)("settings.push.refused")),1)):A("",!0),j.value&&i($).push.note===null?(d(),m("p",t1,u(j.value),1)):A("",!0),f("div",n1,[i($).push.status==="on"?(d(),m("button",{key:0,type:"button",class:"bcm-btn",onClick:y[2]||(y[2]=x=>i(_).disablePush())},u(i(s)("settings.push.disable")),1)):(d(),m("button",{key:1,type:"button",class:"bcm-btn bcm-primary",disabled:i($).push.status==="busy"||i($).push.status==="checking",onClick:y[3]||(y[3]=x=>i(_).enablePush())},u(i(s)("settings.push.enable")),9,o1))])],64))],8,Vw)):A("",!0)],64)):A("",!0),f("p",s1,u(E.value),1)],8,Aw)):A("",!0)}});function r1(e,t){if(typeof document>"u"||typeof URL.createObjectURL!="function")return;const n=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),s=URL.createObjectURL(n),o=document.createElement("a");o.href=s,o.download=t,o.style.display="none",document.body.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(s),1e3)}function a1(e,t=new Date){const n=t.toISOString().slice(0,10);return`${e.replace(/[^\p{L}\p{N}_-]+/gu,"-").replace(/^-+|-+$/g,"")||"export"}-${n}.json`}const Vi=()=>({body:"",sending:!1,failure:null});function l1(e){const{client:t}=e,n=new AbortController,s={signal:n.signal},o=Re({phase:"idle",failure:null,me:null,notifications:[],decisions:[],appeals:[],reports:[],blocks:[],statement:{phase:"idle",value:null,failure:null,appeal:Vi()},notice:{phase:"idle",value:null,failure:null,appeal:Vi()},profile:null,purgeAfter:null,exporting:!1,busy:{},announcement:null,announceId:0});let r=!1;const a=Ht(null),l=T=>{o.announcement=T,o.announceId+=1},c=T=>({key:`error.${T.code}`});async function p(){o.phase="loading",o.failure=null;const T=await t.me.get(s);if(r)return;if(!T.ok){if(T.code==="signIn"){o.phase="signIn";return}o.phase="failed",o.failure=T;return}if(o.me=T.value,T.value.needs.includes("sign_in")){o.phase="signIn";return}if(!T.value.member){o.phase="ready";return}const[g,k,E,w,y]=await Promise.all([t.me.notifications.list({},s),t.me.decisions.list({},s),t.me.appeals.list(s),t.me.reports.list(s),t.blocks.list(s)]);if(r)return;g.ok&&(o.notifications=g.value.items.filter(N=>Ua(N.code))),k.ok&&(o.decisions=[...k.value.items]),E.ok&&(o.appeals=[...E.value.items]),w.ok&&(o.reports=[...w.value.items]),y.ok&&(o.blocks=[...y.value.blocks]);const x=[g,k,E,w,y].find(N=>!N.ok);x&&!x.ok&&l(c(x)),o.phase="ready"}let h=null,b=0;async function _(T){const g=++b;T!==h&&(h=T,o.statement.value=null,o.statement.appeal=Vi()),o.statement.phase="loading",o.statement.failure=null;const k=await t.me.decisions.get({decisionId:T},s);if(!(r||g!==b)){if(k.ok){o.statement.value=k.value,o.statement.phase="ready";return}o.statement.failure=k,o.statement.phase=k.code==="signIn"?"signIn":"failed"}}async function $(T){if(T===null){o.notice.phase="missing";return}o.notice.phase="loading",o.notice.failure=null;const g=await t.notices.status({receipt:T},s);if(!r){if(g.ok){o.notice.value=g.value,o.notice.phase="ready";return}o.notice.failure=g,o.notice.phase="failed"}}let v=null;const I=T=>lt(Ze(T.body)),j=T=>!T.sending&&I(T)>0&&I(T)<=Tn;function P(){if(a.value||r||!o.me?.member||o.me.acceptances.art9Refused!==!0)return;const T=ks({client:t,lang:Le(e.lang),signal:n.signal,offerArt9:!0,onDone:g=>{o.me=g,a.value=null,g.acceptances.art9Consent==="accepted"&&l({key:"panel.art9Given"})},onSignIn:()=>{a.value=null,o.phase="signIn"}});a.value=T,T.load()}return{state:o,consent:a,giveConsent:P,closeConsent(){a.value=null},loadMember:p,loadStatement:_,async loadNotice(T){v=T,await $(T)},unreadCount:()=>o.notifications.filter(T=>T.readAt===null).length,async markAllRead(){const T=o.notifications.filter(E=>E.readAt===null).map(E=>E.id);if(T.length===0||o.busy.markRead)return;o.busy.markRead=!0;const g=await t.me.notifications.markRead({ids:T},s);if(delete o.busy.markRead,r)return;if(!g.ok)return l(c(g));const k=new Date().toISOString();o.notifications=o.notifications.map(E=>T.includes(E.id)?{...E,readAt:k}:E)},async fileAppeal(){const T=o.statement,g=T.appeal;if(!T.value||!T.value.canAppeal||!j(g))return;const k=T.value.decisionId;g.sending=!0,g.failure=null;const E=await t.me.appeals.file({decisionId:k,body:Ze(g.body)},s);if(g.sending=!1,!(r||k!==h)){if(!E.ok){g.failure=E;return}g.body="",l({key:"statement.appealSent"}),await _(k)}},async withdrawAppeal(){const T=o.statement,g=T.value?.appeal;if(!T.value||!g||g.status!=="open"||o.busy.withdraw)return;const k=T.value.decisionId;o.busy.withdraw=!0;const E=await t.me.appeals.withdraw({appealId:g.appealId},s);if(delete o.busy.withdraw,!(r||k!==h)){if(!E.ok)return l(c(E));l({key:"statement.appealWithdrawn"}),await _(k)}},async fileNoticeAppeal(){const T=o.notice,g=T.appeal;if(!T.value||!T.value.appeal.canAppeal||v===null||!j(g))return;g.sending=!0,g.failure=null;const k=await t.notices.appeal({receipt:v,body:Ze(g.body)},s);if(g.sending=!1,!r){if(!k.ok){g.failure=k;return}g.body="",l({key:"notice.appealSent"}),await $(v)}},async withdrawNoticeAppeal(){if(!o.notice.value?.appeal.open||v===null||o.busy.noticeWithdraw)return;o.busy.noticeWithdraw=!0;const T=await t.notices.withdrawAppeal({receipt:v},s);if(delete o.busy.noticeWithdraw,!r){if(!T.ok)return l(c(T));l({key:"statement.appealWithdrawn"}),await $(v)}},async withdrawConsent(){if(o.busy.consent)return!1;o.busy.consent=!0;const T=await t.me.consents.withdraw({kind:"art9_consent"},s);return delete o.busy.consent,r?!1:T.ok?(o.me&&(o.me={...o.me,acceptances:{...o.me.acceptances,art9Consent:T.value.state}}),l({key:"panel.art9Withdrawn"}),!0):(l(c(T)),!1)},async unblock(T){const g=`block:${T}`;if(o.busy[g])return;o.busy[g]=!0;const k=await t.blocks.set({memberId:T,blocked:!1},s);if(delete o.busy[g],!r){if(!k.ok)return l(c(k));o.blocks=o.blocks.filter(E=>E.memberId!==T),l({key:"discussion.unblocked"})}},editProfile(){const T=o.me?.profile;T&&(o.profile={displayName:T.displayName,handle:T.handle,avatarPreset:T.avatarPreset,sending:!1,failure:null,fields:[]})},cancelProfile(){o.profile=null},async saveProfile(){const T=o.profile,g=o.me?.profile;if(!T||!g||T.sending||!Kl(T.displayName)||!Yl(T.handle)||Qn(T.handle)==="")return;const k={},E=ys(T.displayName),w=Qn(T.handle);if(E!==g.displayName&&(k.displayName=E),w!==g.handle&&(k.handle=w),T.avatarPreset!==g.avatarPreset&&(k.avatarPreset=T.avatarPreset),Object.keys(k).length===0){o.profile=null;return}T.sending=!0,T.failure=null,T.fields=[];const y=await t.me.updateProfile(k,s);if(T.sending=!1,!r){if(!y.ok){T.failure=y,T.fields=y.code==="handle"?["handle"]:y.code==="name"?["displayName"]:y.fields??[];return}o.me&&(o.me={...o.me,profile:y.value.profile}),o.profile=null}},async exportData(T){if(o.exporting)return;o.exporting=!0;const g=await t.me.export(s);if(o.exporting=!1,!r){if(!g.ok)return l(c(g));T(g.value)}},async erase(){if(o.busy.erase)return!1;o.busy.erase=!0;const T=await t.me.erase(s);return delete o.busy.erase,r?!1:T.ok?(o.purgeAfter=T.value.purgeAfter,o.me?.member&&(o.me={...o.me,member:{...o.me.member,status:T.value.status}}),!0):(l(c(T)),!1)},async cancelErase(){if(o.busy.erase)return;o.busy.erase=!0;const T=await t.me.cancelErase(s);if(delete o.busy.erase,!r){if(!T.ok)return l(c(T));o.purgeAfter=null,o.me?.member&&(o.me={...o.me,member:{...o.me.member,status:T.value.status}}),l({key:"panel.eraseCancelled"})}},erasing:()=>o.me?.member?.status==="deletion_requested",appealLength:I,canAppealWith:j,dispose(){r=!0,n.abort(),a.value=null}}}const Ki=new WeakMap;function c1(e){if(typeof location<"u"&&location.hash.startsWith("#t=")){const t=Tl(location.hash);return rp(),e&&Ki.set(e,t),t}return e&&Ki.has(e)?Ki.get(e)??null:void 0}const u1=["aria-labelledby"],d1=["id"],f1={class:"bcm-dl"},m1={class:"bcm-muted"},p1={key:0,class:"bcm-muted"},h1={key:0},b1={class:"bcm-facts"},g1=["aria-labelledby"],v1=["id"],y1={class:"bcm-row"},_1=["disabled"],k1={key:0,class:"bcm-muted"},w1={class:"bcm-field"},$1=["for"],x1=["id","aria-describedby","aria-invalid"],I1=["id"],T1={key:0,class:"bcm-error",role:"alert"},C1={class:"bcm-row"},S1=["disabled"],A1={key:2},O1={key:3},E1=$e({__name:"NoticeStatusView",props:{notice:{},appeal:{},withdrawing:{type:Boolean}},emits:["appeal","withdraw"],setup(e,{emit:t}){const n=e,s=t,{t:o,lang:r}=vt(),a=He("bcm-notice-status"),l=z(()=>n.notice),c=z(()=>qt(`category.${l.value.category}`)),p=z(()=>qt(`caseStatus.${l.value.status}`)),h=z(()=>Ei(l.value.outcome)),b=z(()=>h.value!==null&&l.value.statement===null&&!l.value.appeal.canAppeal&&!l.value.appeal.open),_=z(()=>lt(Ze(n.appeal.body))),$=z(()=>!n.appeal.sending&&_.value>0&&_.value<=Tn),v=z(()=>l.value.appeal.closesAt?Ul(l.value.appeal.closesAt):!1),I=z(()=>{const j=n.appeal.failure;if(!j)return"";const P=Ie(j,r.value);return o(P.key,P.params)});return(j,P)=>(d(),m("section",{class:"bcm-section","aria-labelledby":`${i(a)}-title`},[f("h3",{id:`${i(a)}-title`},u(i(o)("notice.statusTitle")),9,d1),f("dl",f1,[c.value?(d(),m(q,{key:0},[f("dt",null,u(i(o)("notice.category")),1),f("dd",null,u(i(o)(c.value)),1)],64)):A("",!0),p.value?(d(),m(q,{key:1},[f("dt",null,u(i(o)("notice.statusTitle")),1),f("dd",null,u(i(o)(p.value)),1)],64)):A("",!0)]),f("p",m1,u(i(o)("notice.submittedAt",{date:i(Pe)(i(r),l.value.submittedAt)})),1),l.value.decidedAt?(d(),m("p",p1,u(i(o)("notice.decidedAt",{date:i(Pe)(i(r),l.value.decidedAt)})),1)):A("",!0),h.value?(d(),m(q,{key:1},[f("h4",null,u(i(o)("notice.outcome")),1),f("p",null,u(i(o)(h.value)),1),b.value?(d(),m("p",h1,u(i(o)("notice.redress")),1)):A("",!0)],64)):A("",!0),l.value.statement?(d(),m(q,{key:2},[f("h4",null,u(i(o)("notice.statement")),1),f("pre",b1,u(l.value.statement),1)],64)):A("",!0),l.value.decidedAt&&!b.value?(d(),m("section",{key:3,class:"bcm-card","aria-labelledby":`${i(a)}-appeal`},[f("h4",{id:`${i(a)}-appeal`},u(i(o)("notice.appealTitle")),9,v1),l.value.appeal.open?(d(),m(q,{key:0},[f("p",null,u(i(o)("notice.appealOpen")),1),f("div",y1,[f("button",{type:"button",class:"bcm-btn",disabled:e.withdrawing,onClick:P[0]||(P[0]=T=>s("withdraw"))},u(i(o)("notice.appealWithdraw")),9,_1)])],64)):l.value.appeal.canAppeal?(d(),m(q,{key:1},[f("p",null,u(i(o)("notice.appealLede")),1),l.value.appeal.closesAt?(d(),m("p",k1,u(i(o)("notice.appealUntil",{date:i(Pe)(i(r),l.value.appeal.closesAt)})),1)):A("",!0),f("form",{class:"bcm-form",novalidate:"",onSubmit:P[2]||(P[2]=mt(T=>$.value&&s("appeal"),["prevent"]))},[f("div",w1,[f("label",{for:`${i(a)}-body`},u(i(o)("notice.appealBody")),9,$1),ge(f("textarea",{id:`${i(a)}-body`,"onUpdate:modelValue":P[1]||(P[1]=T=>e.appeal.body=T),class:"bcm-input bcm-textarea",rows:"5","aria-describedby":`${i(a)}-counter`,"aria-invalid":_.value>i(Tn)},null,8,x1),[[Xe,e.appeal.body]]),f("p",{id:`${i(a)}-counter`,class:"bcm-counter"},u(i(o)("statement.appealCounter",{length:_.value,max:i(Tn)})),9,I1)]),I.value?(d(),m("p",T1,u(I.value),1)):A("",!0),f("div",C1,[f("button",{type:"submit",class:"bcm-btn bcm-primary",disabled:!$.value},u(e.appeal.sending?i(o)("statement.appealSending"):i(o)("notice.appealSubmit")),9,S1)])],32)],64)):v.value?(d(),m("p",A1,u(i(o)("notice.appealClosed")),1)):(d(),m("p",O1,u(i(o)("statement.appealUnavailable")),1))],8,g1)):A("",!0)],8,u1))}}),M1=["aria-labelledby"],P1=["id"],R1={class:"bcm-muted"},N1={class:"bcm-dl"},j1={key:0,class:"bcm-muted"},z1={key:0},L1={key:0,class:"bcm-text"},D1={key:0,class:"bcm-text"},F1={key:0,class:"bcm-note bcm-text"},U1={class:"bcm-facts"},q1={class:"bcm-text"},B1={class:"bcm-facts"},H1=["aria-labelledby"],V1=["id"],K1={key:0,class:"bcm-muted"},W1={class:"bcm-row"},Y1=["disabled"],G1={class:"bcm-muted"},Z1={class:"bcm-field"},J1=["for"],X1=["id","aria-describedby","aria-invalid"],Q1=["id"],e$={key:0,class:"bcm-error",role:"alert"},t$={class:"bcm-row"},n$=["disabled"],o$={key:0,class:"bcm-muted"},s$=$e({__name:"StatementView",props:{statement:{},appeal:{},withdrawing:{type:Boolean}},emits:["appeal","withdraw"],setup(e,{emit:t}){const n=e,s=t,{t:o,lang:r}=vt(),a=He("bcm-statement"),l=z(()=>n.statement),c=z(()=>qt(`restriction.${l.value.restriction}`)),p=z(()=>qt(`basis.${l.value.basis}`)),h=z(()=>qt(`category.${l.value.category}`)),b=z(()=>Vp(r.value,l.value.territorialScope)),_=z(()=>l.value.appeal?qt(`appealStatus.${l.value.appeal.status}`):null),$=z(()=>l.value.subject.kind==="message"?"statement.subjectMessage":l.value.subject.kind==="article"?"statement.subjectArticle":"statement.subjectProfile"),v=z(()=>{const k=l.value.subject;return k.kind==="message"&&k.message?k.message.body??k.message.displayBody:null}),I=z(()=>l.value.appeal?.status==="open"),j=z(()=>Ul(l.value.appealWindowClosesAt)),P=z(()=>lt(Ze(n.appeal.body))),T=z(()=>!n.appeal.sending&&P.value>0&&P.value<=Tn),g=z(()=>{const k=n.appeal.failure;if(!k)return"";const E=Ie(k,r.value);return o(E.key,E.params)});return(k,E)=>(d(),m("article",{class:"bcm-section","aria-labelledby":`${i(a)}-title`},[f("h3",{id:`${i(a)}-title`},u(i(o)("statement.title")),9,P1),f("p",R1,u(i(o)("statement.decidedAt",{date:i(Pe)(i(r),l.value.decidedAt)})),1),f("p",null,u(i(o)("statement.provider",{entity:l.value.providerEntity})),1),f("dl",N1,[c.value?(d(),m(q,{key:0},[f("dt",null,u(i(o)("statement.restriction")),1),f("dd",null,[At(u(i(o)(c.value))+" ",1),l.value.restrictionUntil?(d(),m("span",j1,u(i(o)("statement.until",{date:i(Pe)(i(r),l.value.restrictionUntil)})),1)):A("",!0)])],64)):A("",!0),h.value?(d(),m(q,{key:1},[f("dt",null,u(i(o)("report.category")),1),f("dd",null,u(i(o)(h.value)),1)],64)):A("",!0),b.value?(d(),m(q,{key:2},[f("dt",null,u(i(o)("statement.scope")),1),f("dd",null,u(b.value),1)],64)):A("",!0),p.value?(d(),m(q,{key:3},[f("dt",null,u(i(o)("statement.basis")),1),f("dd",null,u(i(o)(p.value)),1)],64)):A("",!0),f("dt",null,u(i(o)("statement.automation")),1),f("dd",null,[l.value.automatedDetection?(d(),m("span",z1,u(i(o)("statement.automatedDetection")),1)):A("",!0),f("span",null,u(l.value.automated?i(o)("statement.automatedDecision"):i(o)("statement.humanDecision")),1)]),l.value.legalGround?(d(),m(q,{key:4},[f("dt",null,u(i(o)("statement.legalGround")),1),f("dd",null,[f("p",null,u(l.value.legalGround),1),l.value.legalExplanation?(d(),m("p",L1,u(l.value.legalExplanation),1)):A("",!0)])],64)):A("",!0),l.value.contractualGround?(d(),m(q,{key:5},[f("dt",null,u(i(o)("statement.contractualGround")),1),f("dd",null,[f("p",null,u(l.value.contractualGround),1),l.value.contractualExplanation?(d(),m("p",D1,u(l.value.contractualExplanation),1)):A("",!0)])],64)):A("",!0),f("dt",null,u(i(o)("statement.subject")),1),f("dd",null,[f("p",null,u(i(o)($.value)),1),v.value?(d(),m("p",F1,[Ee(ec,{text:v.value},null,8,["text"])])):A("",!0)])]),f("h4",null,u(i(o)("statement.facts")),1),f("pre",U1,u(l.value.facts),1),f("h4",null,u(i(o)("statement.redress")),1),f("p",q1,u(l.value.redress),1),f("details",null,[f("summary",null,u(i(o)("statement.full")),1),f("pre",B1,u(l.value.statement),1)]),f("section",{class:"bcm-card","aria-labelledby":`${i(a)}-appeal`},[f("h4",{id:`${i(a)}-appeal`},u(i(o)("statement.appealTitle")),9,V1),I.value?(d(),m(q,{key:0},[f("p",null,u(i(o)("statement.appealOpen")),1),_.value?(d(),m("p",K1,u(i(o)(_.value)),1)):A("",!0),f("div",W1,[f("button",{type:"button",class:"bcm-btn",disabled:e.withdrawing,onClick:E[0]||(E[0]=w=>s("withdraw"))},u(i(o)("statement.appealWithdraw")),9,Y1)])],64)):l.value.canAppeal?(d(),m(q,{key:1},[f("p",null,u(i(o)("statement.appealLede")),1),f("p",G1,u(i(o)("statement.appealUntil",{date:i(Pe)(i(r),l.value.appealWindowClosesAt)})),1),f("form",{class:"bcm-form",novalidate:"",onSubmit:E[2]||(E[2]=mt(w=>T.value&&s("appeal"),["prevent"]))},[f("div",Z1,[f("label",{for:`${i(a)}-body`},u(i(o)("statement.appealBody")),9,J1),ge(f("textarea",{id:`${i(a)}-body`,"onUpdate:modelValue":E[1]||(E[1]=w=>e.appeal.body=w),class:"bcm-input bcm-textarea",rows:"5","aria-describedby":`${i(a)}-counter`,"aria-invalid":P.value>i(Tn)},null,8,X1),[[Xe,e.appeal.body]]),f("p",{id:`${i(a)}-counter`,class:"bcm-counter"},u(i(o)("statement.appealCounter",{length:P.value,max:i(Tn)})),9,Q1)]),g.value?(d(),m("p",e$,u(g.value),1)):A("",!0),f("div",t$,[f("button",{type:"submit",class:"bcm-btn bcm-primary",disabled:!T.value},u(e.appeal.sending?i(o)("statement.appealSending"):i(o)("statement.appealSubmit")),9,n$)])],32)],64)):(d(),m(q,{key:2},[_.value?(d(),m("p",o$,u(i(o)(_.value)),1)):A("",!0),f("p",null,u(j.value?i(o)("statement.appealClosed"):i(o)("statement.appealUnavailable")),1)],64))],8,H1)],8,M1))}}),i$=["lang","aria-labelledby"],r$=["id"],a$={key:0,class:"bcm-note",role:"alert"},l$={key:1,class:"bcm-muted",role:"status"},c$={key:2,class:"bcm-error",role:"alert"},u$={key:0,class:"bcm-muted",role:"status"},d$={key:1,class:"bcm-row"},f$=["href"],m$={key:2,class:"bcm-error",role:"alert"},p$=["href"],h$={key:0,class:"bcm-muted",role:"status"},b$={key:1,class:"bcm-row"},g$=["href"],v$={key:2,class:"bcm-error",role:"alert"},y$=["aria-labelledby"],_$=["id"],k$={key:0,class:"bcm-msg"},w$={class:"bcm-msg-main"},$$={class:"bcm-author"},x$={class:"bcm-handle"},I$={class:"bcm-row"},T$={class:"bcm-field"},C$=["for"],S$=["id","aria-invalid"],A$={class:"bcm-hint"},O$={class:"bcm-field"},E$=["for"],M$=["id","maxlength","aria-invalid"],P$={class:"bcm-hint"},R$={class:"bcm-choices"},N$={class:"bcm-choice"},j$=["name"],z$=["name","value"],L$={key:0,class:"bcm-error",role:"alert"},D$={class:"bcm-row"},F$=["disabled"],U$=["disabled"],q$=["aria-labelledby"],B$={class:"bcm-row"},H$=["id"],V$={key:0,class:"bcm-badge"},K$=["disabled"],W$={key:0,class:"bcm-muted"},Y$={key:1,class:"bcm-list"},G$={key:0},Z$=["datetime"],J$=["href"],X$=["aria-labelledby"],Q$=["id"],e0={key:0,class:"bcm-muted"},t0={key:1,class:"bcm-list"},n0={key:0},o0={key:1,class:"bcm-muted"},s0={class:"bcm-muted"},i0={key:2,class:"bcm-muted"},r0={key:3,class:"bcm-muted"},a0=["href"],l0=["aria-labelledby"],c0=["id"],u0={key:0,class:"bcm-muted"},d0={key:1,class:"bcm-list"},f0={key:0},m0={key:1},p0={key:2},h0=["datetime"],b0={key:3,class:"bcm-muted"},g0=["aria-labelledby"],v0=["id"],y0={key:0,class:"bcm-muted"},_0={key:1,class:"bcm-list"},k0=["disabled","onClick"],w0=["aria-labelledby"],$0=["id"],x0={class:"bcm-row"},I0=["disabled"],T0={key:1,class:"bcm-row"},C0={key:2},S0=["aria-labelledby"],A0=["id"],O0={class:"bcm-hint"},E0={class:"bcm-row"},M0=["disabled"],P0=["aria-labelledby"],R0=["id"],N0={class:"bcm-row"},j0=["disabled"],z0={class:"bcm-hint"},L0={class:"bcm-row"},D0=["disabled"],F0={class:"bcm-sr","aria-live":"polite"},U0=$e({inheritAttrs:!1,__name:"MyCommunityView",props:{apiBase:{},siteBase:{},lang:{},decisionId:{},routes:{},signInHref:{},transport:{type:Function}},setup(e){const t=e,n=ue(Le(t.lang,Ue())),{t:s,text:o}=gt(n),r=He("bcm-panel"),a=ue(null),l=ht(t.siteBase),c=l===null?null:bt(t.apiBase,t.transport,l),p=c?l1({client:c,lang:n.value}):null,h=p?.state??null,b=z(()=>Pt(Mt(t.routes),h?.me?.links,l??"")),_=z(()=>!!t.decisionId),$=ue(!1),v=ue(null),I=Vn();nt(()=>{if(!p)return;const K=c1(I);K!==void 0&&($.value=!0,p.loadNotice(K)),t.decisionId?p.loadStatement(t.decisionId):p.loadMember()}),ve(()=>t.decisionId,(K,D)=>{!p||K===D||(K?p.loadStatement(K):h?.phase==="idle"&&p.loadMember())}),Ge(()=>p?.dispose());const j=z(()=>{const K=h?.failure;if(!K)return"";const D=Ie(K,n.value);return s(D.key,D.params)}),P=z(()=>{const K=h?.statement.failure;if(!K)return"";const D=Ie(K,n.value);return s(D.key,D.params)}),T=z(()=>{const K=h?.notice.failure;if(!K)return"";const D=Ie(K,n.value);return s(D.key,D.params)});function g(){return En(t.signInHref,typeof location>"u"?null:location.pathname)}const k=K=>Jn(b.value.statementPath,K),E=K=>qt(`notification.${K.code}`),w=K=>qt(`restriction.${K}`),y=K=>qt(`category.${K}`),x=K=>qt(`caseStatus.${K}`),N=K=>{const D=h?.appeals.find(U=>U.decisionId===K);return D?qt(`appealStatus.${D.status}`):null},M=z(()=>h?.me?.acceptances.art9Consent??null),O=z(()=>h?.me?.acceptances.art9Refused===!0),B=z(()=>h?.me?.member??null),ee=z(()=>h?.me?.profile??null);function re(){p?.exportData(K=>r1(K,a1(s("panel.exportFileName"))))}async function be(){p&&(v.value==="consent"?await p.withdrawConsent():v.value==="erase"&&await p.erase(),v.value=null)}const we=ue("");return ve(()=>h?.announceId,()=>{we.value="";const K=o(h?.announcement);ze(()=>{we.value=K})}),(K,D)=>i(p)&&i(h)?(d(),m("section",{key:0,class:"bcm bcm-panel",lang:n.value,"aria-labelledby":`${i(r)}-title`},[f("h2",{id:`${i(r)}-title`,ref_key:"heading",ref:a,tabindex:"-1"},u(_.value?i(s)("statement.title"):i(s)("panel.title")),9,r$),$.value?(d(),m(q,{key:0},[i(h).notice.phase==="missing"?(d(),m("p",a$,u(i(s)("notice.receiptMissing")),1)):i(h).notice.phase==="loading"?(d(),m("p",l$,u(i(s)("common.loading")),1)):i(h).notice.phase==="failed"?(d(),m("p",c$,u(T.value),1)):i(h).notice.value?(d(),_e(E1,{key:3,notice:i(h).notice.value,appeal:i(h).notice.appeal,withdrawing:!!i(h).busy.noticeWithdraw,onAppeal:D[0]||(D[0]=U=>i(p).fileNoticeAppeal()),onWithdraw:D[1]||(D[1]=U=>i(p).withdrawNoticeAppeal())},null,8,["notice","appeal","withdrawing"])):A("",!0)],64)):A("",!0),_.value?(d(),m(q,{key:1},[i(h).statement.phase==="loading"?(d(),m("p",u$,u(i(s)("common.loading")),1)):i(h).statement.phase==="signIn"?(d(),m("div",d$,[f("p",null,u(i(s)("panel.signIn")),1),g()?(d(),m("a",{key:0,class:"bcm-btn bcm-primary",href:g()??void 0},u(i(s)("common.signIn")),9,f$)):A("",!0)])):i(h).statement.phase==="failed"?(d(),m("p",m$,u(P.value),1)):i(h).statement.value?(d(),_e(s$,{key:3,statement:i(h).statement.value,appeal:i(h).statement.appeal,withdrawing:!!i(h).busy.withdraw,onAppeal:D[2]||(D[2]=U=>i(p).fileAppeal()),onWithdraw:D[3]||(D[3]=U=>i(p).withdrawAppeal())},null,8,["statement","appeal","withdrawing"])):A("",!0),f("p",null,[f("a",{href:b.value.myCommunityPath},u(i(s)("common.back")),9,p$)])],64)):(d(),m(q,{key:2},[i(h).phase==="loading"?(d(),m("p",h$,u(i(s)("common.loading")),1)):i(h).phase==="signIn"&&!$.value?(d(),m("div",b$,[f("p",null,u(i(s)("panel.signIn")),1),g()?(d(),m("a",{key:0,class:"bcm-btn bcm-primary",href:g()??void 0},u(i(s)("common.signIn")),9,g$)):A("",!0)])):i(h).phase==="failed"?(d(),m("p",v$,u(j.value),1)):i(h).phase==="ready"?(d(),m(q,{key:3},[ee.value&&B.value?(d(),m("section",{key:0,class:"bcm-section","aria-labelledby":`${i(r)}-profile`},[f("h3",{id:`${i(r)}-profile`},u(i(s)("panel.profile")),9,_$),i(h).profile?(d(),m("form",{key:1,class:"bcm-form bcm-card",novalidate:"",onSubmit:D[10]||(D[10]=mt(U=>i(p).saveProfile(),["prevent"]))},[f("div",T$,[f("label",{for:`${i(r)}-name`},u(i(s)("onboarding.displayName")),9,C$),ge(f("input",{id:`${i(r)}-name`,"onUpdate:modelValue":D[5]||(D[5]=U=>i(h).profile.displayName=U),class:"bcm-input",autocomplete:"nickname","aria-invalid":i(h).profile.fields.includes("displayName")},null,8,S$),[[Xe,i(h).profile.displayName]]),f("p",A$,u(i(s)("onboarding.displayNameHint")),1)]),f("div",O$,[f("label",{for:`${i(r)}-handle`},u(i(s)("onboarding.handle")),9,E$),ge(f("input",{id:`${i(r)}-handle`,"onUpdate:modelValue":D[6]||(D[6]=U=>i(h).profile.handle=U),class:"bcm-input",autocomplete:"username",autocapitalize:"none",spellcheck:"false",maxlength:i(_s),"aria-invalid":i(h).profile.fields.includes("handle")},null,8,M$),[[Xe,i(h).profile.handle]]),f("p",P$,u(i(s)("onboarding.handleHint",{min:i(Wl),max:i(_s),days:i(ja)})),1)]),f("fieldset",R$,[f("legend",null,u(i(s)("onboarding.avatar")),1),f("label",N$,[ge(f("input",{"onUpdate:modelValue":D[7]||(D[7]=U=>i(h).profile.avatarPreset=U),type:"radio",name:`${i(r)}-avatar`,value:null},null,8,j$),[[xn,i(h).profile.avatarPreset]]),f("span",null,u(i(s)("onboarding.avatarNone")),1)]),(d(!0),m(q,null,me(i(zi),U=>(d(),m("label",{key:U.id,class:"bcm-choice"},[ge(f("input",{"onUpdate:modelValue":D[8]||(D[8]=De=>i(h).profile.avatarPreset=De),type:"radio",name:`${i(r)}-avatar`,value:U.id},null,8,z$),[[xn,i(h).profile.avatarPreset]]),f("span",null,u(U.emoji),1)]))),128))]),i(h).profile.failure?(d(),m("p",L$,u(i(o)(i(Ie)(i(h).profile.failure,n.value))),1)):A("",!0),f("div",D$,[D[22]||(D[22]=f("span",{class:"bcm-spacer"},null,-1)),f("button",{type:"button",class:"bcm-btn",disabled:i(h).profile.sending,onClick:D[9]||(D[9]=U=>i(p).cancelProfile())},u(i(s)("composer.cancel")),9,F$),f("button",{type:"submit",class:"bcm-btn bcm-primary",disabled:i(h).profile.sending},u(i(h).profile.sending?i(s)("composer.sending"):i(s)("composer.save")),9,U$)])],32)):(d(),m("div",k$,[Ee(Li,{author:{kind:"member",memberId:B.value.memberId,displayName:ee.value.displayName,avatarPreset:ee.value.avatarPreset}},null,8,["author"]),f("div",w$,[f("span",$$,u(ee.value.displayName),1),f("span",x$,u(ee.value.handle),1),f("div",I$,[f("button",{type:"button",class:"bcm-btn bcm-small",onClick:D[4]||(D[4]=U=>i(p).editProfile())},u(i(s)("panel.profileEdit")),1)])])]))],8,y$)):A("",!0),f("section",{class:"bcm-section","aria-labelledby":`${i(r)}-notifications`},[f("div",B$,[f("h3",{id:`${i(r)}-notifications`},u(i(s)("panel.notifications")),9,H$),i(p).unreadCount()>0?(d(),m("span",V$,u(i(s)("panel.unread",{count:i(p).unreadCount()})),1)):A("",!0),D[23]||(D[23]=f("span",{class:"bcm-spacer"},null,-1)),i(p).unreadCount()>0?(d(),m("button",{key:1,type:"button",class:"bcm-btn bcm-small",disabled:!!i(h).busy.markRead,onClick:D[11]||(D[11]=U=>i(p).markAllRead())},u(i(s)("panel.markRead")),9,K$)):A("",!0)]),i(h).notifications.length===0?(d(),m("p",W$,u(i(s)("panel.notificationsEmpty")),1)):(d(),m("ul",Y$,[(d(!0),m(q,null,me(i(h).notifications,U=>(d(),m("li",{key:U.id,class:Ve({"bcm-unread":U.readAt===null})},[E(U)?(d(),m("p",G$,u(i(s)(E(U))),1)):A("",!0),f("time",{class:"bcm-time",datetime:U.createdAt},u(i(Pe)(n.value,U.createdAt)),9,Z$),U.decisionId&&k(U.decisionId)?(d(),m("a",{key:1,href:k(U.decisionId)??void 0},u(i(s)("sanction.statement")),9,J$)):A("",!0)],2))),128))]))],8,q$),f("section",{class:"bcm-section","aria-labelledby":`${i(r)}-statements`},[f("h3",{id:`${i(r)}-statements`},u(i(s)("panel.statements")),9,Q$),i(h).decisions.length===0?(d(),m("p",e0,u(i(s)("panel.statementsEmpty")),1)):(d(),m("ul",t0,[(d(!0),m(q,null,me(i(h).decisions,U=>(d(),m("li",{key:U.decisionId},[w(U.restriction)?(d(),m("p",n0,[f("strong",null,u(i(s)(w(U.restriction))),1)])):A("",!0),y(U.category)?(d(),m("p",o0,u(i(s)(y(U.category))),1)):A("",!0),f("p",s0,u(i(s)("statement.decidedAt",{date:i(Pe)(n.value,U.decidedAt)})),1),N(U.decisionId)?(d(),m("p",i0,u(i(s)(N(U.decisionId))),1)):U.canAppeal?(d(),m("p",r0,u(i(s)("statement.appealUntil",{date:i(Pe)(n.value,U.appealWindowClosesAt)})),1)):A("",!0),k(U.decisionId)?(d(),m("a",{key:4,href:k(U.decisionId)??void 0},u(i(s)("sanction.statement")),9,a0)):A("",!0)]))),128))]))],8,X$),f("section",{class:"bcm-section","aria-labelledby":`${i(r)}-reports`},[f("h3",{id:`${i(r)}-reports`},u(i(s)("panel.reports")),9,c0),i(h).reports.length===0?(d(),m("p",u0,u(i(s)("panel.reportsEmpty")),1)):(d(),m("ul",d0,[(d(!0),m(q,null,me(i(h).reports,U=>(d(),m("li",{key:U.caseId},[y(U.category)?(d(),m("p",f0,[f("strong",null,u(i(s)(y(U.category))),1)])):A("",!0),x(U.status)?(d(),m("p",m0,u(i(s)(x(U.status))),1)):A("",!0),i(Ei)(U.outcome)?(d(),m("p",p0,u(i(s)(i(Ei)(U.outcome))),1)):A("",!0),f("time",{class:"bcm-time",datetime:U.reportedAt},u(i(Pe)(n.value,U.reportedAt)),9,h0),U.decidedAt?(d(),m("p",b0,u(i(s)("statement.decidedAt",{date:i(Pe)(n.value,U.decidedAt)})),1)):A("",!0)]))),128))]))],8,l0),B.value?(d(),m("section",{key:1,class:"bcm-section","aria-labelledby":`${i(r)}-blocks`},[f("h3",{id:`${i(r)}-blocks`},u(i(s)("panel.blocks")),9,v0),i(h).blocks.length===0?(d(),m("p",y0,u(i(s)("panel.blocksEmpty")),1)):(d(),m("ul",_0,[(d(!0),m(q,null,me(i(h).blocks,U=>(d(),m("li",{key:U.memberId,class:"bcm-row"},[f("span",null,u(U.author.kind==="member"&&"displayName"in U.author&&U.author.displayName?U.author.displayName:i(s)("author.deleted")),1),D[24]||(D[24]=f("span",{class:"bcm-spacer"},null,-1)),f("button",{type:"button",class:"bcm-btn bcm-small",disabled:!!i(h).busy[`block:${U.memberId}`],onClick:De=>i(p).unblock(U.memberId)},u(i(s)("discussion.unblock")),9,k0)]))),128))]))],8,g0)):A("",!0),B.value&&M.value!==null?(d(),m("section",{key:2,class:"bcm-section","aria-labelledby":`${i(r)}-consents`},[f("h3",{id:`${i(r)}-consents`},u(i(s)("panel.consents")),9,$0),M.value==="accepted"?(d(),m(q,{key:0},[f("p",null,u(i(s)("panel.art9Given")),1),f("div",x0,[f("button",{type:"button",class:"bcm-btn",disabled:!!i(h).busy.consent,onClick:D[12]||(D[12]=U=>v.value="consent")},u(i(s)("panel.art9Withdraw")),9,I0)])],64)):O.value?(d(),m(q,{key:1},[f("p",null,u(i(s)("panel.art9Refused")),1),i(p).consent.value?(d(),_e(So,{key:0,model:i(p).consent.value,"rules-href":b.value.rulesPath,onCancel:D[13]||(D[13]=U=>i(p).closeConsent())},null,8,["model","rules-href"])):(d(),m("div",T0,[f("button",{type:"button",class:"bcm-btn bcm-primary",onClick:D[14]||(D[14]=U=>i(p).giveConsent())},u(i(s)("discussion.giveConsent")),1)]))],64)):(d(),m("p",C0,u(i(s)("panel.art9NotGiven")),1))],8,w0)):A("",!0),B.value?(d(),m("section",{key:3,class:"bcm-section","aria-labelledby":`${i(r)}-export`},[f("h3",{id:`${i(r)}-export`},u(i(s)("panel.export")),9,A0),f("p",O0,u(i(s)("panel.exportHint")),1),f("div",E0,[f("button",{type:"button",class:"bcm-btn",disabled:i(h).exporting,onClick:D[15]||(D[15]=U=>re())},u(i(h).exporting?i(s)("panel.exporting"):i(s)("panel.export")),9,M0)])],8,S0)):A("",!0),B.value?(d(),m("section",{key:4,class:"bcm-section","aria-labelledby":`${i(r)}-erase`},[f("h3",{id:`${i(r)}-erase`},u(i(s)("panel.erase")),9,R0),i(p).erasing()?(d(),m(q,{key:0},[f("p",null,u(i(h).purgeAfter?i(s)("panel.eraseScheduled",{date:i(Pe)(n.value,i(h).purgeAfter)}):i(s)("notification.erasure_scheduled")),1),f("div",N0,[f("button",{type:"button",class:"bcm-btn bcm-primary",disabled:!!i(h).busy.erase,onClick:D[16]||(D[16]=U=>i(p).cancelErase())},u(i(s)("panel.eraseCancel")),9,j0)])],64)):(d(),m(q,{key:1},[f("p",z0,u(i(s)("panel.eraseExplain")),1),f("div",L0,[f("button",{type:"button",class:"bcm-btn bcm-danger",disabled:!!i(h).busy.erase,onClick:D[17]||(D[17]=U=>v.value="erase")},u(i(s)("panel.erase")),9,D0)])],64))],8,P0)):A("",!0)],64)):A("",!0)],64)),f("p",F0,u(we.value),1),v.value==="consent"?(d(),_e(ws,{key:3,title:"panel.art9WithdrawTitle",explain:"panel.art9WithdrawExplain",confirm:"panel.art9WithdrawConfirm",cancel:"panel.art9WithdrawCancel",busy:!!i(h).busy.consent,"fallback-focus":()=>a.value,onConfirm:D[18]||(D[18]=U=>be()),onCancel:D[19]||(D[19]=U=>v.value=null)},null,8,["busy","fallback-focus"])):A("",!0),v.value==="erase"?(d(),_e(ws,{key:4,title:"panel.eraseTitle",explain:"panel.eraseExplain",confirm:"panel.eraseConfirm",cancel:"panel.eraseKeep",danger:"",busy:!!i(h).busy.erase,"fallback-focus":()=>a.value,onConfirm:D[20]||(D[20]=U=>be()),onCancel:D[21]||(D[21]=U=>v.value=null)},null,8,["busy","fallback-focus"])):A("",!0)],8,i$)):A("",!0)}});function q0(e){const t=new AbortController,n={signal:t.signal},s=Re({target:e.target,category:"",ruleId:"",rules:null,description:"",name:"",email:"",goodFaith:!1,captcha:e.captcha?"loading":"off",token:null,resetSignal:0,sending:!1,failure:null,receipt:null,statusLink:null});let o=!1;const r=()=>s.category!==Uf,a=()=>lt(Ze(s.description));function l(){const h=a();return!s.sending&&s.receipt===null&&s.target!==null&&s.category!==""&&h>0&&h<=mi&<(s.name.trim())<=Ra&&s.goodFaith&&(s.captcha==="off"||s.captcha==="ready"&&s.token!==null)}function c(){o||(o=!0,e.client.legal.current({kind:"rules",locale:e.lang},n).then(h=>{s.rules=h.ok?Gn(h.value.bodyJson):[]}))}async function p(){if(!l()||!s.target||s.category==="")return;s.sending=!0,s.failure=null;const h={category:s.category,target:s.target,description:Ze(s.description),confirmations:[Pf]};s.category==="rules"&&s.ruleId!==""&&(h.ruleId=s.ruleId);const b=s.name.trim(),_=s.email.trim();r()&&(b!==""||_!=="")&&(h.notifier={name:b||null,email:_||null,locale:e.lang}),s.token!==null&&(h.turnstileToken=s.token),s.token=null;const $=await e.client.notices.submit(h,n);if(s.sending=!1,$.ok){s.receipt=$.value,s.statusLink=op(e.noticesPath,$.value.receipt),e.onSubmitted?.({contactKept:$.value.contactKept});return}s.failure=$,s.captcha!=="off"&&(s.resetSignal+=1)}return{state:s,contactAllowed:r,canSubmit:l,descriptionLength:a,setCategory(h){s.category=h,h!=="rules"?s.ruleId="":c()},setToken(h){s.token=h,h!==null&&s.captcha==="loading"&&(s.captcha="ready")},setCaptcha(h){s.captcha!=="off"&&(s.captcha=h)},submit:p,dispose(){t.abort()}}}const B0="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit";let Oo=null;function H0(e){const t=window;return t.turnstile?Promise.resolve(t.turnstile):Oo||(Oo=new Promise((n,s)=>{const o=document.createElement("script");o.src=B0,o.async=!0,o.defer=!0,e&&(o.nonce=e),o.onload=()=>t.turnstile?n(t.turnstile):s(new Error("[blogmcp-community] the Turnstile script loaded without its API")),o.onerror=()=>s(new Error("[blogmcp-community] the Turnstile script failed to load")),document.head.appendChild(o)}).catch(n=>{throw Oo=null,n}),Oo)}async function V0(e,t){const n=await H0(t.nonce),s=n.render(e,{sitekey:t.siteKey,action:Mf,language:t.language,appearance:"interaction-only",callback:r=>t.onToken(r),"expired-callback":()=>t.onToken(null),"error-callback":()=>t.onToken(null),"timeout-callback":()=>t.onToken(null)});let o=!1;return{reset(){o||(t.onToken(null),n.reset(s))},remove(){o||(o=!0,n.remove(s))}}}const K0=["lang","aria-labelledby"],W0=["id"],Y0={key:0},G0=["href"],Z0=["value","aria-label"],J0={key:2,class:"bcm-note"},X0={class:"bcm-field"},Q0={class:"bcm-label"},ex={class:"bcm-choices"},tx=["name","value","checked","onChange"],nx={key:0,class:"bcm-field"},ox=["for"],sx=["id"],ix=["value"],rx={class:"bcm-field"},ax=["for"],lx=["id","aria-describedby","aria-invalid"],cx=["id"],ux={key:1,class:"bcm-fieldset"},dx={class:"bcm-hint"},fx={class:"bcm-field"},mx=["for"],px=["id","maxlength"],hx={class:"bcm-field"},bx=["for"],gx=["id","aria-invalid"],vx={key:2,class:"bcm-note"},yx={key:3,class:"bcm-turnstile"},_x={key:0,class:"bcm-error",role:"alert"},kx={class:"bcm-check"},wx={key:4,class:"bcm-error",role:"alert"},$x={class:"bcm-row"},xx=["disabled"],Ix=["lang","aria-labelledby"],Tx=["id"],Cx=["href"],Sx=$e({inheritAttrs:!1,__name:"NoticeFormView",props:{apiBase:{},siteBase:{},lang:{},turnstileSiteKey:{},target:{},articleId:{},routes:{},transport:{type:Function}},setup(e){const t=e,n=Vn(),s=ue(Le(t.lang,Ue())),{t:o}=gt(s),r=He("bcm-notice"),a=ue(null),l=ue(null);function c(){const x=gs(t.target);return x||(t.articleId?gs({articleId:t.articleId}):typeof location>"u"?null:Op(location.hash))}const p=ht(t.siteBase),h=z(()=>Pt(Mt(t.routes),null,p??"")),b=Ht(null),_=p===null?null:bt(t.apiBase,t.transport,p),$=c(),v=!!_&&!$;v&&Ut("notice-target","[blogmcp-community] <blogmcp-notice-form> has no target (a target, an article-id or the report link’s #c=…&s= fragment): it shows where a report starts instead of the form"),_&&$&&(b.value=q0({client:_,lang:s.value,target:$,captcha:!!t.turnstileSiteKey,noticesPath:h.value.noticesPath,onSubmitted:x=>n?.dispatchEvent(new CustomEvent("bcm-notice-submitted",{detail:x,bubbles:!0,composed:!0}))}));const I=z(()=>b.value?.state??null),j=z(()=>I.value?.target?Sp(I.value.target):null),P=z(()=>j.value==="message"?o("notice.targetMessage"):j.value==="article"?o("notice.targetArticle"):o("notice.targetProfile")),T=x=>`category.${x}`,g=z(()=>{const x=I.value?.failure;if(!x)return"";const N=Ie(x,s.value);return o(N.key,N.params)}),k=z(()=>{const x=I.value?.statusLink;return x&&typeof location<"u"?`${location.origin}${x}`:x??""});let E=null,w=null,y=!1;return nt(async()=>{const x=b.value;if(!(!x||!t.turnstileSiteKey||!n)){w=document.createElement("div"),w.slot="turnstile",n.appendChild(w);try{const N=n.nonce||n.getAttribute("nonce")||void 0,M=await V0(w,{siteKey:t.turnstileSiteKey,language:s.value,onToken:O=>x.setToken(O),nonce:N});if(y){M.remove();return}E=M,x.setCaptcha("ready")}catch{x.setCaptcha("unavailable")}}}),ve(()=>I.value?.resetSignal,(x,N)=>{x!==void 0&&N!==void 0&&x!==N&&E?.reset()}),ve(()=>I.value?.receipt,x=>{x&&(E?.remove(),E=null,ze(()=>l.value?.focus()))}),Ge(()=>{y=!0,E?.remove(),E=null,w?.remove(),w=null,b.value?.dispose()}),(x,N)=>b.value&&I.value?(d(),m("section",{key:0,class:"bcm bcm-notice",lang:s.value,"aria-labelledby":`${i(r)}-title`},[f("h2",{id:`${i(r)}-title`,ref_key:"heading",ref:a,tabindex:"-1"},u(i(o)("notice.title")),9,W0),I.value.receipt?(d(),m("div",{key:0,ref_key:"done",ref:l,class:"bcm-receipt",role:"status",tabindex:"-1"},[f("p",null,u(i(o)("notice.done")),1),f("p",null,u(i(o)("notice.receiptLede")),1),I.value.statusLink?(d(),m("p",Y0,[f("a",{href:I.value.statusLink},u(i(o)("notice.statusLink")),9,G0)])):A("",!0),k.value?(d(),m("input",{key:1,class:"bcm-input",readonly:"",value:k.value,"aria-label":i(o)("notice.statusLink"),onFocus:N[0]||(N[0]=M=>M.target.select())},null,40,Z0)):A("",!0),I.value.receipt.contactKept?A("",!0):(d(),m("p",J0,u(i(o)("notice.noContactKept")),1))],512)):(d(),m("form",{key:1,class:"bcm-form",novalidate:"",onSubmit:N[6]||(N[6]=mt(M=>b.value.submit(),["prevent"]))},[f("p",null,u(i(o)("notice.lede")),1),f("div",X0,[f("span",Q0,u(i(o)("notice.target")),1),f("span",null,u(P.value),1)]),f("fieldset",ex,[f("legend",null,u(i(o)("notice.category")),1),(d(!0),m(q,null,me(i(hi),M=>(d(),m("label",{key:M,class:"bcm-choice"},[f("input",{type:"radio",name:`${i(r)}-category`,value:M,checked:I.value.category===M,onChange:O=>b.value.setCategory(M)},null,40,tx),f("span",null,u(i(o)(T(M))),1)]))),128))]),I.value.category==="rules"&&I.value.rules&&I.value.rules.length?(d(),m("div",nx,[f("label",{for:`${i(r)}-rule`},u(i(o)("notice.rule")),9,ox),ge(f("select",{id:`${i(r)}-rule`,"onUpdate:modelValue":N[1]||(N[1]=M=>I.value.ruleId=M),class:"bcm-input"},[N[7]||(N[7]=f("option",{value:""},null,-1)),(d(!0),m(q,null,me(I.value.rules,M=>(d(),m("option",{key:M.id,value:M.id},u(M.title),9,ix))),128))],8,sx),[[Yt,I.value.ruleId]])])):A("",!0),f("div",rx,[f("label",{for:`${i(r)}-description`},u(i(o)("notice.description")),9,ax),ge(f("textarea",{id:`${i(r)}-description`,"onUpdate:modelValue":N[2]||(N[2]=M=>I.value.description=M),class:"bcm-input bcm-textarea",rows:"5","aria-describedby":`${i(r)}-description-hint`,"aria-invalid":b.value.descriptionLength()>i(mi)},null,8,lx),[[Xe,I.value.description]]),f("p",{id:`${i(r)}-description-hint`,class:"bcm-hint"},u(i(o)("notice.descriptionHint"))+" "+u(i(o)("notice.counter",{length:b.value.descriptionLength(),max:i(mi)})),9,cx)]),b.value.contactAllowed()?(d(),m("fieldset",ux,[f("legend",null,u(i(o)("notice.contactTitle")),1),f("p",dx,u(i(o)("notice.contactHint")),1),f("div",fx,[f("label",{for:`${i(r)}-name`},u(i(o)("notice.name")),9,mx),ge(f("input",{id:`${i(r)}-name`,"onUpdate:modelValue":N[3]||(N[3]=M=>I.value.name=M),class:"bcm-input",autocomplete:"name",maxlength:i(Ra)},null,8,px),[[Xe,I.value.name]])]),f("div",hx,[f("label",{for:`${i(r)}-email`},u(i(o)("notice.email")),9,bx),ge(f("input",{id:`${i(r)}-email`,"onUpdate:modelValue":N[4]||(N[4]=M=>I.value.email=M),class:"bcm-input",type:"email",autocomplete:"email","aria-invalid":!!I.value.failure?.fields?.includes("notifier.email")},null,8,gx),[[Xe,I.value.email]])])])):(d(),m("p",vx,u(i(o)("notice.childAtRisk")),1)),I.value.captcha!=="off"?(d(),m("div",yx,[ed(x.$slots,"turnstile"),I.value.captcha==="unavailable"?(d(),m("p",_x,u(i(o)("notice.captchaUnavailable")),1)):A("",!0)])):A("",!0),f("label",kx,[ge(f("input",{"onUpdate:modelValue":N[5]||(N[5]=M=>I.value.goodFaith=M),type:"checkbox"},null,512),[[os,I.value.goodFaith]]),f("span",null,u(i(o)("confirm.good_faith")),1)]),g.value?(d(),m("p",wx,u(g.value),1)):A("",!0),f("div",$x,[N[8]||(N[8]=f("span",{class:"bcm-spacer"},null,-1)),f("button",{type:"submit",class:"bcm-btn bcm-primary",disabled:!b.value.canSubmit()},u(I.value.sending?i(o)("notice.sending"):i(o)("notice.submit")),9,xx)])],32))],8,K0)):i(v)?(d(),m("section",{key:1,class:"bcm bcm-notice",lang:s.value,"aria-labelledby":`${i(r)}-title`},[f("h2",{id:`${i(r)}-title`},u(i(o)("notice.title")),9,Tx),f("p",null,u(i(o)("notice.noTarget")),1),f("p",null,[f("a",{href:h.value.rulesPath},u(i(o)("onboarding.rulesTitle")),9,Cx)])],8,Ix)):A("",!0)}});function Ax(e){const{client:t}=e,n=new AbortController,s={signal:n.signal};let o=!1,r=0;const a=Re({phase:"idle",failure:null,items:[],nextCursor:null,unreadOnly:!1,loadingMore:!1,busy:{},announcement:null,announceId:0}),l=b=>{a.announcement=b,a.announceId+=1},c=b=>({key:`error.${b.code}`}),p=b=>b.filter(_=>Ua(_.code));async function h(){const b=++r;a.phase="loading",a.failure=null;const _=await t.me.notifications.list(a.unreadOnly?{unreadOnly:!0}:{},s);if(!(o||b!==r)){if(!_.ok){a.phase=_.code==="signIn"?"signIn":"failed",a.failure=_;return}a.items=p(_.value.items),a.nextCursor=_.value.nextCursor,a.phase="ready"}}return{state:a,load:h,async loadMore(){if(a.loadingMore||a.nextCursor===null||a.phase!=="ready")return;const b=r;a.loadingMore=!0;const _=await t.me.notifications.list({cursor:a.nextCursor,...a.unreadOnly?{unreadOnly:!0}:{}},s);if(a.loadingMore=!1,o||b!==r)return;if(!_.ok)return l(c(_));const $=new Set(a.items.map(v=>v.id));a.items=[...a.items,...p(_.value.items).filter(v=>!$.has(v.id))],a.nextCursor=_.value.nextCursor},async setUnreadOnly(b){a.unreadOnly!==b&&(a.unreadOnly=b,await h())},async markRead(b){const _=`read:${b}`,$=a.items.find(j=>j.id===b);if(!$||$.readAt!==null||a.busy[_])return;a.busy[_]=!0;const v=await t.me.notifications.markRead({ids:[b]},s);if(delete a.busy[_],o)return;if(!v.ok)return l(c(v));const I=new Date().toISOString();a.items=a.items.map(j=>j.id===b?{...j,readAt:I}:j)},async markAllRead(){if(a.busy.all||!a.items.some($=>$.readAt===null)&&a.nextCursor===null)return;a.busy.all=!0;const b=await t.me.notifications.markRead({all:!0},s);if(delete a.busy.all,o)return;if(!b.ok)return l(c(b));const _=new Date().toISOString();a.items=a.unreadOnly?[]:a.items.map($=>$.readAt===null?{...$,readAt:_}:$),a.unreadOnly&&(a.nextCursor=null)},unread:()=>a.items.filter(b=>b.readAt===null).length,dispose(){o=!0,n.abort()}}}const Ox=["lang","aria-labelledby"],Ex={class:"bcm-row"},Mx=["id"],Px={key:0,class:"bcm-badge"},Rx={key:0,class:"bcm-muted",role:"status"},Nx={key:1,class:"bcm-row"},jx=["href"],zx={key:2,class:"bcm-banner",role:"alert"},Lx={class:"bcm-row"},Dx={class:"bcm-check"},Fx=["checked"],Ux=["disabled"],qx={key:0,class:"bcm-muted"},Bx={key:1,class:"bcm-list"},Hx=["id"],Vx=["id","datetime"],Kx={class:"bcm-row"},Wx=["href"],Yx=["aria-describedby","disabled","onClick"],Gx={key:2,class:"bcm-row"},Zx=["disabled"],Jx=["href"],Xx={class:"bcm-sr","aria-live":"polite"},Qx=$e({inheritAttrs:!1,__name:"NotificationCentreView",props:{apiBase:{},siteBase:{},lang:{},routes:{},signInHref:{},transport:{type:Function}},setup(e){const t=e,n=ue(Le(t.lang,Ue())),{t:s,text:o}=gt(n),r=He("bcm-centre"),a=ht(t.siteBase),l=a===null?null:bt(t.apiBase,t.transport,a),c=l?Ax({client:l}):null,p=c?.state??null,h=z(()=>Pt(Mt(t.routes),null,a??""));nt(()=>{c?.load()}),Ge(()=>c?.dispose());const b=z(()=>{const P=p?.failure;if(!P)return"";const T=Ie(P,n.value);return s(T.key,T.params)});function _(){return En(t.signInHref,typeof location>"u"?null:location.pathname)}const $=P=>P.code==="category_topic"&&P.conversationKind==="article"?"notification.category_topic.article":wp(P);function v(P){if(P.decisionId){const T=Jn(h.value.statementPath,P.decisionId);return T?{href:T,key:"sanction.statement"}:null}if(P.code==="category_topic"){if(P.articleId||P.conversationKind==="article"){const g=Ti(h.value.articlePath,P.articleSlug,P.seq);return g?{href:g,key:"centre.openMessage"}:null}const T=typeof P.conversationId=="string"?xo(h.value.topicPath,P.conversationId):null;return T?{href:T,key:"topic.open"}:null}if(P.code==="reply"||P.code==="mention"||P.code==="topic_update"){if(P.conversationKind==="topic"){const g=typeof P.conversationId=="string"&&typeof P.seq=="number"?Ii(h.value.topicPath,P.conversationId,P.seq):null;return g?{href:g,key:"centre.openMessage"}:null}const T=Ti(h.value.articlePath,P.articleSlug,P.seq);return T?{href:T,key:"centre.openMessage"}:null}return P.code==="module_push_reset"?{href:h.value.settingsPath,key:"centre.settings"}:P.code==="module_read_only"||P.code==="module_braked"||P.code==="age_limit_changed"||P.code==="erasure_scheduled"||P.code==="inactivity_warning"?{href:h.value.myCommunityPath,key:"panel.title"}:null}function I(P){c?.setUnreadOnly(P.target.checked)}const j=ue("");return ve(()=>p?.announceId,()=>{j.value="";const P=o(p?.announcement);ze(()=>{j.value=P})}),(P,T)=>i(c)&&i(p)?(d(),m("section",{key:0,class:"bcm bcm-centre",lang:n.value,"aria-labelledby":`${i(r)}-title`},[f("div",Ex,[f("h2",{id:`${i(r)}-title`},u(i(s)("centre.title")),9,Mx),i(p).phase==="ready"&&i(c).unread()>0?(d(),m("span",Px,u(i(s)("panel.unread",{count:i(c).unread()})),1)):A("",!0)]),i(p).phase==="loading"||i(p).phase==="idle"?(d(),m("p",Rx,u(i(s)("common.loading")),1)):i(p).phase==="signIn"?(d(),m("div",Nx,[f("p",null,u(i(s)("centre.signIn")),1),_()?(d(),m("a",{key:0,class:"bcm-btn bcm-primary",href:_()??void 0},u(i(s)("common.signIn")),9,jx)):A("",!0)])):i(p).phase==="failed"?(d(),m("div",zx,[f("span",null,u(b.value),1),f("button",{type:"button",class:"bcm-btn",onClick:T[0]||(T[0]=g=>i(c).load())},u(i(s)("common.retry")),1)])):(d(),m(q,{key:3},[f("div",Lx,[f("label",Dx,[f("input",{type:"checkbox",checked:i(p).unreadOnly,onChange:I},null,40,Fx),f("span",null,u(i(s)("centre.unreadOnly")),1)]),T[3]||(T[3]=f("span",{class:"bcm-spacer"},null,-1)),i(c).unread()>0||i(p).nextCursor!==null?(d(),m("button",{key:0,type:"button",class:"bcm-btn bcm-small",disabled:!!i(p).busy.all,onClick:T[1]||(T[1]=g=>i(c).markAllRead())},u(i(s)("centre.markAllRead")),9,Ux)):A("",!0)]),i(p).items.length===0?(d(),m("p",qx,u(i(s)("centre.empty")),1)):(d(),m("ul",Bx,[(d(!0),m(q,null,me(i(p).items,g=>(d(),m("li",{key:g.id,class:Ve({"bcm-unread":g.readAt===null})},[$(g)?(d(),m("p",{key:0,id:`${i(r)}-s-${g.id}`},u(i(s)($(g))),9,Hx)):A("",!0),f("time",{id:`${i(r)}-t-${g.id}`,class:"bcm-time",datetime:g.createdAt},u(i(Pe)(n.value,g.createdAt)),9,Vx),f("div",Kx,[v(g)?(d(),m("a",{key:0,href:v(g).href},u(i(s)(v(g).key)),9,Wx)):A("",!0),T[4]||(T[4]=f("span",{class:"bcm-spacer"},null,-1)),g.readAt===null?(d(),m("button",{key:1,type:"button",class:"bcm-btn bcm-small","aria-describedby":$(g)?`${i(r)}-s-${g.id} ${i(r)}-t-${g.id}`:`${i(r)}-t-${g.id}`,disabled:!!i(p).busy[`read:${g.id}`],onClick:k=>i(c).markRead(g.id)},u(i(s)("panel.markRead")),9,Yx)):A("",!0)])],2))),128))])),i(p).nextCursor!==null?(d(),m("div",Gx,[f("button",{type:"button",class:"bcm-btn",disabled:i(p).loadingMore,onClick:T[2]||(T[2]=g=>i(c).loadMore())},u(i(s)("centre.loadMore")),9,Zx)])):A("",!0),f("p",null,[f("a",{href:h.value.settingsPath},u(i(s)("centre.settings")),9,Jx)])],64)),f("p",Xx,u(j.value),1)],8,Ox)):A("",!0)}});function _c(e){if(typeof e!="string")return null;const t=e.trim().replace(/^@/,"").toLowerCase();return yo.test(t)?t:null}function eI(e){const{client:t}=e,n=new AbortController,s={signal:n.signal};let o=!1,r=0;const a=Re({phase:"idle",failure:null,author:null,memberSince:null,bio:null,trustKey:null,moderates:[]});return{state:a,async load(l){const c=++r;a.failure=null,a.author=null,a.memberSince=null,a.bio=null,a.trustKey=null,a.moderates=[];const p=_c(l);if(p===null){a.phase="notFound";return}a.phase="loading";const h=await t.profile.get({handle:p},s);if(o||c!==r)return;if(!h.ok){a.phase=h.code==="signIn"?"signIn":h.code==="notFound"?"notFound":"failed",a.failure=h;return}const b=h.value;if(!Hf(b.author)||b.author.kind!=="member"||b.author.memberId===null){a.phase="notFound";return}a.author=b.author,a.memberSince=typeof b.memberSince=="string"?b.memberSince:null,a.bio=typeof b.bio=="string"&&b.bio.trim()!==""?b.bio:null,a.trustKey=$p(b.trustLabel),a.moderates=Array.isArray(b.moderates)?b.moderates.filter(_=>typeof _?.slug=="string"&&typeof _?.name=="string").map(_=>({slug:_.slug,name:_.name})):[],a.phase="ready"},dispose(){o=!0,n.abort()}}}function tI(e){const{client:t}=e,n=new AbortController,s={signal:n.signal};let o=!1;const r=Re({phase:"idle",rules:[],rulesFailed:!1,handle:null,visitor:!1});return{state:r,async load(){r.phase="loading";const[a,l]=await Promise.all([t.legal.current({kind:"rules",locale:e.lang},s),t.me.get(s)]);o||(a.ok?r.rules=Gn(a.value.bodyJson):r.rulesFailed=!0,l.ok?(r.visitor=l.value.needs.includes("sign_in"),r.handle=l.value.member?_c(l.value.profile?.handle):null):r.visitor=l.code==="signIn",r.phase="ready")},dispose(){o=!0,n.abort()}}}const nI=["lang","aria-labelledby"],oI={key:0,class:"bcm-muted",role:"status"},sI=["id"],iI={key:2,class:"bcm-row"},rI=["id"],aI=["href"],lI={key:3,class:"bcm-banner",role:"alert"},cI=["id"],uI={class:"bcm-profile-head"},dI={class:"bcm-msg-main"},fI=["id"],mI={class:"bcm-handle"},pI={key:0},hI={class:"bcm-badge"},bI={key:1,class:"bcm-row"},gI={class:"bcm-badge bcm-badge-team"},vI=["href"],yI={key:1},_I={key:2,class:"bcm-muted"},kI=["aria-labelledby"],wI=["id"],$I={class:"bcm-text"},xI=$e({inheritAttrs:!1,__name:"ProfileView",props:{handle:{},apiBase:{},siteBase:{},lang:{},routes:{},signInHref:{},transport:{type:Function}},setup(e){const t=e,n=ue(Le(t.lang,Ue())),{t:s}=gt(n),o=He("bcm-profile"),r=ht(t.siteBase),a=r===null?null:bt(t.apiBase,t.transport,r),l=a?eI({client:a}):null,c=l?.state??null;nt(()=>{l?.load(t.handle??"")}),ve(()=>t.handle,($,v)=>{$!==v&&l?.load($??"")}),Ge(()=>l?.dispose());const p=z(()=>c?.memberSince?Fp(n.value,c.memberSince):""),h=z(()=>Pt(Mt(t.routes),null,r??"")),b=z(()=>{const $=c?.failure;if(!$)return"";const v=Ie($,n.value);return s(v.key,v.params)});function _(){return En(t.signInHref,typeof location>"u"?null:location.pathname)}return($,v)=>i(l)&&i(c)?(d(),m("section",{key:0,class:"bcm bcm-profile",lang:n.value,"aria-labelledby":`${i(o)}-title`},[i(c).phase==="loading"||i(c).phase==="idle"?(d(),m("p",oI,u(i(s)("common.loading")),1)):i(c).phase==="notFound"?(d(),m("p",{key:1,id:`${i(o)}-title`,class:"bcm-note"},u(i(s)("profile.notFound")),9,sI)):i(c).phase==="signIn"?(d(),m("div",iI,[f("p",{id:`${i(o)}-title`},u(i(s)("profile.signIn")),9,rI),_()?(d(),m("a",{key:0,class:"bcm-btn bcm-primary",href:_()??void 0},u(i(s)("common.signIn")),9,aI)):A("",!0)])):i(c).phase==="failed"?(d(),m("div",lI,[f("span",{id:`${i(o)}-title`},u(b.value),9,cI),f("button",{type:"button",class:"bcm-btn",onClick:v[0]||(v[0]=I=>i(l).load(t.handle??""))},u(i(s)("common.retry")),1)])):i(c).author&&i(c).author.kind==="member"?(d(),m(q,{key:4},[f("header",uI,[Ee(Li,{author:i(c).author},null,8,["author"]),f("div",dI,[f("h2",{id:`${i(o)}-title`},u(i(c).author.displayName),9,fI),f("span",mI,u(i(c).author.handle),1)])]),i(c).trustKey?(d(),m("p",pI,[f("span",hI,u(i(s)(i(c).trustKey)),1)])):A("",!0),i(c).moderates.length>0?(d(),m("p",bI,[f("span",gI,u(i(s)("role.moderator")),1),f("span",null,u(i(s)("profile.moderates")),1),(d(!0),m(q,null,me(i(c).moderates,I=>(d(),m(q,{key:I.slug},[i(On)(h.value.categoryPath,I.slug)?(d(),m("a",{key:0,href:i(On)(h.value.categoryPath,I.slug)??void 0},u(I.name),9,vI)):(d(),m("span",yI,u(I.name),1))],64))),128))])):A("",!0),p.value?(d(),m("p",_I,u(i(s)("profile.memberSince",{date:p.value})),1)):A("",!0),i(c).bio?(d(),m("section",{key:3,class:"bcm-section","aria-labelledby":`${i(o)}-bio`},[f("h3",{id:`${i(o)}-bio`},u(i(s)("profile.bio")),9,wI),f("p",$I,u(i(c).bio),1)],8,kI)):A("",!0)],64)):A("",!0)],8,nI)):A("",!0)}}),II=4e3;function TI(e){const{client:t,lang:n}=e,s=e.conversationId.toLowerCase(),o=yh(e),r=new AbortController,a={signal:r.signal};let l=!1;const c=$s({client:t,target:{conversationId:s},lang:n}),p=Re({rules:null,moveTargets:null,dialog:null,busy:{},announcement:null,announceId:0}),h=g=>{p.announcement=g,p.announceId+=1},b=()=>o.state.thread.topic;let _=null;const $=o.store.subscribe(g=>{const k=g.topic?.following;typeof k!="boolean"||k===_||(_===null&&c&&c.state.phase==="idle"?c.load(k):c?.sync(k),_=k)});function v(){const g=b();return g?.category?o.state.thread.viewer.moderator===!0||o.state.me!==null&&gl(o.state.me,g.category.id):!1}const I=g=>v()&&!o.isOwn(g)&&!g.pending&&g.seq>0&&g.body!==null&&g.state!=="deleted"&&g.author.kind==="member";async function j(g,k){if(p.busy[g])return;p.busy[g]=!0;const E=await k();if(delete p.busy[g],!l){if(E.ok){o.store.applyTopic(E.value.topic),h({key:"moderation.done"});return}h(Ie(E,n)),E.code==="notFound"&&o.refresh()}}async function P(){if(p.rules!==null)return;const g=await t.legal.current({kind:"rules",locale:n},a);!l&&g.ok&&(p.rules=Gn(g.value.bodyJson))}async function T(){if(p.moveTargets!==null)return;const g=await t.forum.categories.list(a);if(l||!g.ok)return;const k=b()?.category?.id,E=o.state.me;p.moveTargets=g.value.categories.filter(w=>w.kind==="topics"&&w.id!==k&&E!==null&&gl(E,w.id))}return{thread:o,follow:c,extras:p,async start(){await o.start()},isModerator:v,canModerate:I,setState:g=>j(`state:${g}`,()=>t.moderation.setTopicState({conversationId:s,state:g},a)),setPinned:g=>j(`pin:${g}`,()=>t.moderation.pinTopic({conversationId:s,pinned:g},a)),openDialog(g,k=null){p.dialog={kind:g,seq:k,ruleId:"",facts:"",category:"",categoryId:"",sending:!1,failure:null,statement:null,done:!1},g==="remove"&&P(),g==="move"&&T()},closeDialog(){p.dialog=null},async submitDialog(){const g=p.dialog;if(!g||g.sending||g.done)return;if(g.kind==="move"){if(g.categoryId==="")return;g.sending=!0;const y=await t.moderation.moveTopic({conversationId:s,categoryId:g.categoryId},a);if(g.sending=!1,l)return;if(y.ok){o.store.applyTopic(y.value.topic),p.dialog=null,p.moveTargets=null,h({key:"moderation.done"});return}g.failure=y;return}const k=g.seq===null?null:o.state.thread.messages.flatMap(y=>[y,...y.replies]).find(y=>y.seq===g.seq);if(!k)return;if(g.kind==="escalate"){if(g.category===""||!ls.includes(g.category))return;g.sending=!0;const y=await t.moderation.escalate({conversationId:s,seq:k.seq,category:g.category},a);if(g.sending=!1,l)return;if(y.ok){g.done=!0,h({key:"moderation.escalated"});return}g.failure=y,y.code==="notFound"&&o.refresh();return}const E=Ze(g.facts);if(g.ruleId===""||E===""||lt(E)>II)return;g.sending=!0;const w=await t.moderation.remove({conversationId:s,seq:k.seq,ruleId:g.ruleId,facts:E,locale:n},a);if(g.sending=!1,!l){if(w.ok){g.done=!0,g.statement=w.value.statement,h({key:"moderation.removed"}),o.refresh();return}g.failure=w,w.code==="notFound"&&o.refresh()}},dispose(){l||(l=!0,r.abort(),$(),c?.dispose(),o.dispose())}}}const CI=["aria-labelledby"],SI=["id"],AI={class:"bcm-field"},OI=["for"],EI=["id"],MI={value:"",disabled:""},PI=["value"],RI={class:"bcm-field"},NI=["for"],jI=["id","aria-describedby"],zI=["id"],LI={role:"status"},DI={class:"bcm-facts"},FI={class:"bcm-field"},UI=["for"],qI=["id"],BI={value:"",disabled:""},HI=["value"],VI={key:1,role:"status"},KI={key:2,class:"bcm-field"},WI=["for"],YI=["id"],GI={value:"",disabled:""},ZI=["value"],JI={key:3,class:"bcm-error",role:"alert"},XI={class:"bcm-row"},QI=["disabled"],eT=["disabled"],tT=$e({__name:"ModeratorDialog",props:{ctl:{},fallbackFocus:{type:Function}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o,lang:r}=vt(),a=ue(null),l=He("bcm-moderator");Mi(a,()=>s("close"),n.fallbackFocus);const c=z(()=>n.ctl.extras.dialog),p=z(()=>c.value?.kind==="remove"?"moderation.remove":c.value?.kind==="escalate"?"moderation.escalate":"moderation.move"),h=$=>`category.${$}`,b=z(()=>{const $=c.value?.failure;if(!$)return"";const v=Ie($,r.value);return o(v.key,v.params)}),_=z(()=>{const $=c.value;if(!$||$.sending||$.done)return!1;if($.kind==="move")return $.categoryId!=="";if($.kind==="escalate")return $.category!=="";const v=Ze($.facts);return $.ruleId!==""&&v!==""&<(v)<=4e3});return($,v)=>(d(),m("dialog",{ref_key:"dialog",ref:a,class:"bcm-dialog","aria-labelledby":`${i(l)}-title`},[c.value?(d(),m("form",{key:0,class:"bcm-dialog-body bcm-form",novalidate:"",onSubmit:v[5]||(v[5]=mt(I=>_.value&&e.ctl.submitDialog(),["prevent"]))},[f("h3",{id:`${i(l)}-title`},u(i(o)(p.value)),9,SI),c.value.kind==="remove"?(d(),m(q,{key:0},[c.value.done?(d(),m(q,{key:1},[f("p",LI,u(i(o)("moderation.removed")),1),f("h4",null,u(i(o)("statement.title")),1),f("pre",DI,u(c.value.statement),1)],64)):(d(),m(q,{key:0},[f("p",null,u(i(o)("moderation.removeLede")),1),f("div",AI,[f("label",{for:`${i(l)}-rule`},u(i(o)("statement.contractualGround")),9,OI),ge(f("select",{id:`${i(l)}-rule`,"onUpdate:modelValue":v[0]||(v[0]=I=>c.value.ruleId=I),class:"bcm-input bcm-select",required:""},[f("option",MI,u(i(o)("moderation.ruleRequired")),1),(d(!0),m(q,null,me(e.ctl.extras.rules??[],I=>(d(),m("option",{key:I.id,value:I.id},u(I.title),9,PI))),128))],8,EI),[[Yt,c.value.ruleId]])]),f("div",RI,[f("label",{for:`${i(l)}-facts`},u(i(o)("statement.facts")),9,NI),ge(f("textarea",{id:`${i(l)}-facts`,"onUpdate:modelValue":v[1]||(v[1]=I=>c.value.facts=I),class:"bcm-input bcm-textarea",rows:"4","aria-describedby":`${i(l)}-facts-hint`},null,8,jI),[[Xe,c.value.facts]]),f("p",{id:`${i(l)}-facts-hint`,class:"bcm-hint"},u(i(o)("moderation.factsHint")),9,zI)])],64))],64)):c.value.kind==="escalate"?(d(),m(q,{key:1},[c.value.done?(d(),m("p",VI,u(i(o)("moderation.escalated")),1)):(d(),m(q,{key:0},[f("p",null,u(i(o)("moderation.escalateLede")),1),f("div",FI,[f("label",{for:`${i(l)}-category`},u(i(o)("moderation.escalateCategory")),9,UI),ge(f("select",{id:`${i(l)}-category`,"onUpdate:modelValue":v[2]||(v[2]=I=>c.value.category=I),class:"bcm-input bcm-select",required:""},[f("option",BI,u(i(o)("moderation.escalateCategory")),1),(d(!0),m(q,null,me(i(ls),I=>(d(),m("option",{key:I,value:I},u(i(o)(h(I))),9,HI))),128))],8,qI),[[Yt,c.value.category]])])],64))],64)):(d(),m("div",KI,[f("label",{for:`${i(l)}-target`},u(i(o)("moderation.moveTo")),9,WI),ge(f("select",{id:`${i(l)}-target`,"onUpdate:modelValue":v[3]||(v[3]=I=>c.value.categoryId=I),class:"bcm-input bcm-select",required:""},[f("option",GI,u(i(o)("moderation.moveTo")),1),(d(!0),m(q,null,me(e.ctl.extras.moveTargets??[],I=>(d(),m("option",{key:I.id,value:I.id},u(I.name),9,ZI))),128))],8,YI),[[Yt,c.value.categoryId]])])),b.value?(d(),m("p",JI,u(b.value),1)):A("",!0),f("div",XI,[v[6]||(v[6]=f("span",{class:"bcm-spacer"},null,-1)),f("button",{type:"button",class:"bcm-btn",disabled:c.value.sending,onClick:v[4]||(v[4]=I=>s("close"))},u(c.value.done?i(o)("common.close"):i(o)("common.cancel")),9,QI),c.value.done?A("",!0):(d(),m("button",{key:0,type:"submit",class:Ve(["bcm-btn bcm-primary",{"bcm-danger":c.value.kind==="remove"}]),disabled:!_.value},u(i(o)(p.value)),11,eT))])],32)):A("",!0)],8,CI))}}),nT=["lang","aria-labelledby"],oT={class:"bcm-row"},sT=["href"],iT=["href"],rT=["id"],aT=["id"],lT=["id"],cT={key:3,class:"bcm-banner",role:"alert"},uT=["id"],dT={class:"bcm-head"},fT=["id"],mT={key:0,class:"bcm-badge"},pT={key:1,class:"bcm-badge"},hT={key:2,class:"bcm-badge"},bT={class:"bcm-count"},gT={key:0,class:"bcm-banner",role:"status"},vT=["disabled"],yT={key:1,class:"bcm-hint",role:"status"},_T={class:"bcm-thread"},kT={key:2,class:"bcm-muted"},wT={key:3,class:"bcm-row"},$T=["disabled"],xT={class:"bcm-section"},IT={key:0,class:"bcm-hint"},TT={key:2,class:"bcm-note"},CT={key:3,class:"bcm-note"},ST={key:1,class:"bcm-row"},AT={key:5,class:"bcm-note"},OT={key:6,class:"bcm-section"},ET=["href"],MT={key:7,class:"bcm-note",role:"status"},PT={key:8,class:"bcm-note"},RT=["href"],NT={class:"bcm-sr","aria-live":"polite"},kc=new WeakMap,jT=$e({inheritAttrs:!1,__name:"TopicView",props:{conversationId:{},apiBase:{},siteBase:{},lang:{},signInHref:{},routes:{},pollMs:{},transport:{type:Function},realtime:{type:Function}},setup(e){const t=e,n=Vn(),s=ue(Le(t.lang,Ue())),{t:o,text:r}=gt(s,uc);ve(()=>t.lang,J=>{s.value=Le(J,Ue())});const a=He("bcm-topic"),l=ue(null),c=ue(0),p=Ht(null),h=z(()=>ht(t.siteBase)),b=z(()=>h.value===null?null:bt(t.apiBase,t.transport,h.value));function _(){const J=t.conversationId?.trim();return J?b.value?TI({client:b.value,conversationId:J,lang:s.value,pollMs:t.pollMs,realtime:typeof t.realtime=="function"?t.realtime:null,refusedAge:(n&&kc.get(n))??null,onAgeRefused:W=>{n&&kc.set(n,W)},onPosted:W=>n?.dispatchEvent(new CustomEvent("bcm-posted",{detail:{state:W},bubbles:!0,composed:!0}))}):null:(Ut("conversation-id","[blogmcp-community] <blogmcp-topic> needs a conversation-id"),null)}const $=Re(new Set),v=Re(new Set),I=Re(new Set),j=ue(null),P=z(()=>p.value),T=z(()=>p.value?.thread??null),g=z(()=>p.value?.thread.state??null),k=z(()=>Pt(Mt(t.routes),g.value?.me?.links,h.value??""));function E(J){return p.value?.canModerate(J)?[{id:"mod-remove",label:o("moderation.remove"),danger:!0},{id:"mod-escalate",label:o("moderation.escalate")}]:[]}sc({get ctl(){return p.value.thread},routes:k,opened:$,originals:v,allReplies:I,focusHeading:()=>l.value,deleteMessage:J=>{j.value=J},extraMenu:E,onExtraMenu:(J,W)=>{J==="mod-remove"?p.value?.openDialog("remove",W.seq):J==="mod-escalate"&&p.value?.openDialog("escalate",W.seq)}});let w=null;const y=ue(null);let x=!1;async function N(){if(x||typeof location>"u")return;x=!0;const J=xl(location.hash),W=J===null?null:Io(J);if(J===null||W===null)return;const pe=g.value?.thread.messages.find(Rt=>Rt.replies.some(Cs=>Cs.seq===J));pe&&I.add(pe.seq),await ze();const Bt=y.value?.querySelector(`#${W}`);typeof Bt?.scrollIntoView=="function"&&Bt.scrollIntoView({block:"start"})}function M(){x=!1,p.value?.dispose(),$.clear(),v.clear(),I.clear(),j.value=null,p.value=_(),c.value+=1,p.value?.start()}nt(()=>{M(),n&&typeof IntersectionObserver<"u"&&(w=new IntersectionObserver(J=>{const W=J[J.length-1];W&&p.value?.thread.setInView(W.isIntersecting)},{rootMargin:"200px"}),w.observe(n))}),ve(()=>[t.conversationId,t.apiBase,h.value,t.transport,t.realtime,t.pollMs,s.value],()=>M()),Ge(()=>{w?.disconnect(),p.value?.dispose(),p.value=null}),ve(()=>g.value?.phase,J=>{J==="ready"&&N()});const O=z(()=>g.value?.thread.topic??null),B=z(()=>g.value?ms(g.value.thread):null),ee=z(()=>{const J=B.value;return J?J.kind==="shown"?J.text:o(J.kind==="deleted"?"topic.deleted":"topic.withheld"):""}),re=z(()=>O.value?.category?On(k.value.categoryPath,O.value.category.slug):null),be=z(()=>T.value?.mode()??"pending"),we=z(()=>{const J=Is(g.value?.me??null);return Di(J.paused??"forum")}),K=ue(null);ve(be,(J,W)=>{J==="write"&&W==="onboarding"&&ze(()=>K.value?.focus()),J==="ageRefused"&&W==="onboarding"&&ze(()=>l.value?.focus())});const D=z(()=>{const J=T.value?.needs();return J?.onboarding?"need.onboarding":J?.rules?"need.reconsent_rules":"need.art9_consent"}),U=z(()=>{const J=p.value,W=O.value;if(!J||!W||!J.isModerator())return[];const pe=[];return W.state==="open"?pe.push({id:"lock",label:o("moderation.lock")}):W.state==="locked"&&pe.push({id:"unlock",label:o("moderation.unlock")}),pe.push(W.pinned?{id:"unpin",label:o("moderation.unpin")}:{id:"pin",label:o("moderation.pin")}),pe.push({id:"move",label:o("moderation.move")}),pe});function De(J){const W=p.value;W&&(J==="lock"||J==="unlock"?W.setState(J==="lock"?"locked":"open"):J==="pin"||J==="unpin"?W.setPinned(J==="pin"):J==="move"&&W.openDialog("move"))}function Ne(J){const W=J.endsAt?Pe(s.value,J.endsAt):"";return J.kind==="ban"?o("sanction.ban"):J.kind==="suspension"?W?o("sanction.suspensionUntil",{date:W}):o("sanction.suspension"):W?o("sanction.restrictionUntil",{date:W}):o("sanction.restriction")}const Fe=z(()=>{const J=g.value?.failure;if(!J)return"";const W=Ie(J,s.value);return o(W.key,W.params)}),Qe=ue("");function oe(J){Qe.value="",ze(()=>{Qe.value=J})}ve(()=>g.value?.announceId,()=>oe(r(g.value?.announcement))),ve(()=>p.value?.extras.announceId,()=>oe(r(p.value?.extras.announcement)));async function Z(){const J=j.value;J===null||!T.value||(await T.value.remove(J),j.value=null)}return(J,W)=>P.value&&T.value&&g.value&&g.value.phase!=="hidden"?(d(),m("section",{ref_key:"section",ref:y,key:c.value,class:"bcm bcm-topic",lang:s.value,"aria-labelledby":i(a)},[f("nav",oT,[re.value&&O.value?.category?(d(),m("a",{key:0,href:re.value},u(O.value.category.name),9,sT)):(d(),m("a",{key:1,href:k.value.forumPath},u(i(o)("forum.back")),9,iT))]),g.value.phase==="loading"?(d(),m("p",{key:0,id:i(a),class:"bcm-muted",role:"status"},u(i(o)("topic.loading")),9,rT)):g.value.phase==="membersOnly"&&b.value?(d(),m("div",{key:1,id:i(a)},[Ee(Ts,{failure:g.value.failure,client:b.value,lang:s.value,"sign-in-href":e.signInHref,"rules-href":k.value.rulesPath,onJoined:W[0]||(W[0]=pe=>T.value.refresh())},null,8,["failure","client","lang","sign-in-href","rules-href"])],8,aT)):g.value.phase==="notFound"?(d(),m("p",{key:2,id:i(a),class:"bcm-note"},u(i(o)("topic.notFound")),9,lT)):g.value.phase==="failed"?(d(),m("div",cT,[f("span",{id:i(a)},u(Fe.value),9,uT),f("button",{type:"button",class:"bcm-btn",onClick:W[1]||(W[1]=pe=>T.value.refresh())},u(i(o)("common.retry")),1)])):(d(),m(q,{key:4},[f("header",dT,[f("h2",{id:i(a),ref_key:"heading",ref:l,tabindex:"-1",class:Ve({"bcm-placeholder":B.value?.kind!=="shown"})},u(ee.value),11,fT),O.value?.pinned?(d(),m("span",mT,u(i(o)("topic.pinned")),1)):A("",!0),O.value?.state==="locked"?(d(),m("span",pT,u(i(o)("topic.locked")),1)):O.value?.state==="archived"?(d(),m("span",hT,u(i(o)("topic.archived")),1)):A("",!0),f("span",bT,u(i(o)("topic.count",{count:g.value.thread.count})),1),W[14]||(W[14]=f("span",{class:"bcm-spacer"},null,-1)),P.value.follow&&g.value.thread.viewer.memberId!==null?(d(),_e(xs,{key:3,ctl:P.value.follow},null,8,["ctl"])):A("",!0),U.value.length?(d(),_e(tc,{key:4,items:U.value,label:i(o)("moderation.title"),onSelect:De},null,8,["items","label"])):A("",!0)]),Ee(Fi,{me:g.value.me},null,8,["me"]),g.value.newMessages?(d(),m("div",gT,[f("span",null,u(i(o)("discussion.newMessages")),1),f("button",{type:"button",class:"bcm-btn",disabled:g.value.refreshing,onClick:W[2]||(W[2]=pe=>T.value.refresh())},u(i(o)("discussion.refresh")),9,vT)])):A("",!0),g.value.realtimeOff?(d(),m("p",yT,u(i(o)("realtime.off")),1)):A("",!0),f("ol",_T,[(d(!0),m(q,null,me(g.value.thread.messages,pe=>(d(),_e(ic,{key:pe.id,message:pe},null,8,["message"]))),128))]),g.value.thread.messages.length<=1?(d(),m("p",kT,u(i(o)("discussion.empty")),1)):A("",!0),g.value.thread.nextCursor!==null?(d(),m("div",wT,[f("button",{type:"button",class:"bcm-btn",disabled:g.value.loadingMore,onClick:W[3]||(W[3]=pe=>T.value.loadMore())},u(i(o)("discussion.loadMore")),9,$T)])):A("",!0),f("div",xT,[be.value==="write"&&g.value.art9RefusedNote?(d(),m("p",IT,u(i(o)("onboarding.art9RefusedDone")),1)):A("",!0),be.value==="write"?(d(),_e(Co,{key:1,ref_key:"composer",ref:K,kind:"new",draft:g.value.composer,wait:T.value.waitLeft(g.value.composer),"rules-href":k.value.rulesPath,"mentions-max":T.value.mentionCap(),onSubmit:W[4]||(W[4]=pe=>T.value.submit()),onConfirm:W[5]||(W[5]=(pe,Bt)=>T.value&&T.value.setConfirmed(g.value.composer,pe,Bt)),onConfirmed:W[6]||(W[6]=pe=>T.value.sendConfirmed(g.value.composer))},null,8,["draft","wait","rules-href","mentions-max"])):be.value==="locked"?(d(),m("p",TT,u(i(o)("error.topicLocked")),1)):be.value==="readOnly"?(d(),m("p",CT,u(i(o)("error.readOnly")),1)):be.value==="onboarding"?(d(),m(q,{key:4},[T.value.onboarding.value?(d(),_e(So,{key:0,model:T.value.onboarding.value,"rules-href":k.value.rulesPath,onCancel:W[7]||(W[7]=pe=>T.value.cancelOnboarding())},null,8,["model","rules-href"])):(d(),m("div",ST,[f("p",null,u(i(o)(D.value)),1),f("button",{type:"button",class:"bcm-btn bcm-primary",onClick:W[8]||(W[8]=pe=>T.value.beginOnboarding())},u(i(o)("onboarding.continue")),1)]))],64)):be.value==="ageRefused"?(d(),m("p",AT,u(i(o)("onboarding.ageBelow",{min:g.value.refusedAge??18})),1)):be.value==="sanction"?(d(),m("div",OT,[(d(!0),m(q,null,me(g.value.thread.viewer.restrictions,pe=>(d(),m("p",{key:pe.decisionId,class:"bcm-note"},[At(u(Ne(pe))+" ",1),i(Jn)(k.value.statementPath,pe.decisionId)?(d(),m("a",{key:0,href:i(Jn)(k.value.statementPath,pe.decisionId)??void 0},u(i(o)("sanction.statement")),9,ET)):A("",!0)]))),128))])):be.value==="braked"&&we.value?(d(),m("p",MT,u(i(o)(we.value)),1)):be.value==="restricted"?(d(),m("p",PT,[At(u(i(o)("error.restricted"))+" ",1),f("a",{href:k.value.myCommunityPath},u(i(o)("panel.title")),9,RT)])):A("",!0)])],64)),f("p",NT,u(Qe.value),1),g.value.report?(d(),_e(rc,{key:5,report:g.value.report,"my-community-href":k.value.myCommunityPath,"rules-href":k.value.rulesPath,"fallback-focus":()=>l.value,onSubmit:W[9]||(W[9]=pe=>T.value.submitReport()),onClose:W[10]||(W[10]=pe=>T.value.closeReport())},null,8,["report","my-community-href","rules-href","fallback-focus"])):A("",!0),j.value!==null?(d(),_e(ws,{key:6,title:"discussion.deleteTitle",explain:"discussion.deleteExplain",confirm:"discussion.deleteConfirm",danger:"",busy:!!g.value.busy[`delete:${j.value}`],"fallback-focus":()=>l.value,onConfirm:W[11]||(W[11]=pe=>Z()),onCancel:W[12]||(W[12]=pe=>j.value=null)},null,8,["busy","fallback-focus"])):A("",!0),P.value.extras.dialog?(d(),_e(tT,{key:7,ctl:P.value,"fallback-focus":()=>l.value,onClose:W[13]||(W[13]=pe=>P.value.closeDialog())},null,8,["ctl","fallback-focus"])):A("",!0)],8,nT)):A("",!0)}}),zT=["lang","aria-labelledby"],LT=["id"],DT={key:0,class:"bcm-muted",role:"status"},FT=["aria-labelledby"],UT=["id"],qT={key:0,class:"bcm-rules"},BT={key:0,class:"bcm-hint"},HT=["href"],VT={class:"bcm-links"},KT=["href"],WT=["href"],YT={key:0},GT=["href"],ZT={key:1},JT=["href"],XT=$e({inheritAttrs:!1,__name:"WelcomeView",props:{apiBase:{},siteBase:{},lang:{},routes:{},signInHref:{},transport:{type:Function}},setup(e){const t=e,n=ue(Le(t.lang,Ue())),{t:s}=gt(n),o=He("bcm-welcome"),r=ht(t.siteBase),a=r===null?null:bt(t.apiBase,t.transport,r),l=a?tI({client:a,lang:n.value}):null,c=l?.state??null,p=z(()=>Pt(Mt(t.routes),null,r??"")),h=z(()=>c?.handle?kl(p.value.profilePath,c.handle):null);nt(()=>{l?.load()}),Ge(()=>l?.dispose());function b(){return En(t.signInHref,typeof location>"u"?null:location.pathname)}return(_,$)=>i(l)&&i(c)?(d(),m("section",{key:0,class:"bcm bcm-welcome",lang:n.value,"aria-labelledby":`${i(o)}-title`},[f("h2",{id:`${i(o)}-title`},u(i(s)("welcome.title")),9,LT),f("p",null,u(i(s)("welcome.lede")),1),i(c).phase!=="ready"?(d(),m("p",DT,u(i(s)("common.loading")),1)):(d(),m(q,{key:1},[f("section",{class:"bcm-section","aria-labelledby":`${i(o)}-rules`},[f("h3",{id:`${i(o)}-rules`},u(i(s)("welcome.rules")),9,UT),i(c).rules.length?(d(),m("ol",qT,[(d(!0),m(q,null,me(i(c).rules,v=>(d(),m("li",{key:v.id},[f("strong",null,u(v.title),1),v.summary?(d(),m("span",BT,u(v.summary),1)):A("",!0)]))),128))])):A("",!0),f("p",null,[f("a",{href:p.value.rulesPath},u(i(s)("onboarding.rulesLink")),9,HT)])],8,FT),f("ul",VT,[f("li",null,[f("a",{class:"bcm-btn",href:p.value.discussionsPath},u(i(s)("welcome.discussions")),9,KT)]),f("li",null,[f("a",{class:"bcm-btn",href:p.value.settingsPath},u(i(s)("welcome.settings")),9,WT)]),h.value?(d(),m("li",YT,[f("a",{class:"bcm-btn",href:h.value},u(i(s)("welcome.profile")),9,GT)])):i(c).visitor&&b()?(d(),m("li",ZT,[f("a",{class:"bcm-btn bcm-primary",href:b()??void 0},u(i(s)("common.signIn")),9,JT)])):A("",!0)])],64))],8,zT)):A("",!0)}}),QT=':host{all:initial;display:block;--bcm-bg: #ffffff;--bcm-fg: #1d1f23;--bcm-muted: #5f6672;--bcm-line: #dfe2e7;--bcm-soft: #f4f5f7;--bcm-accent: #2457d6;--bcm-accent-fg: #ffffff;--bcm-danger: #b42318;--bcm-ok: #1f7a3f;--bcm-warn-bg: #fff6d6;--bcm-shadow: 0 8px 28px rgba(16, 24, 40, .18);--bcm-z: 20;color-scheme:light dark;font:var(--bcm-font-size, 16px) / 1.5 var(--bcm-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);color:var(--bcm-fg)}:host([hidden]){display:none}@media(prefers-color-scheme:dark){:host{--bcm-bg: #1c1f24;--bcm-fg: #eceef1;--bcm-muted: #a4abb6;--bcm-line: #343943;--bcm-soft: #262a31;--bcm-accent: #6d93ff;--bcm-accent-fg: #0d1117;--bcm-danger: #ff8a7a;--bcm-ok: #6fd08e;--bcm-warn-bg: #3a3420;--bcm-shadow: 0 8px 28px rgba(0, 0, 0, .5)}}*{box-sizing:border-box}h2,h3,h4{margin:0;font-weight:650;line-height:1.3}h2{font-size:1.25em}h3{font-size:1.05em}h4{font-size:1em}p{margin:0}ul,ol{margin:0;padding:0}a{color:var(--bcm-accent)}.bcm{background:var(--bcm-bg);color:var(--bcm-fg);border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:16px;max-width:100%;overflow-wrap:anywhere}.bcm-sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bcm-btn{font:inherit;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:6px 14px;border-radius:8px;border:1px solid var(--bcm-line);background:var(--bcm-bg);color:var(--bcm-fg);cursor:pointer;text-decoration:none}.bcm-btn:hover:not(:disabled){background:var(--bcm-soft)}.bcm-btn:disabled{opacity:.55;cursor:default}.bcm-primary{background:var(--bcm-accent);border-color:var(--bcm-accent);color:var(--bcm-accent-fg)}.bcm-primary:hover:not(:disabled){background:var(--bcm-accent);filter:brightness(1.08)}.bcm-danger{color:var(--bcm-danger)}.bcm-primary.bcm-danger{background:var(--bcm-danger);border-color:var(--bcm-danger);color:var(--bcm-bg)}.bcm-small{min-height:30px;padding:2px 10px;font-size:.875em}.bcm-link{font:inherit;border:0;background:none;padding:0;color:var(--bcm-accent);cursor:pointer;text-align:left;text-decoration:underline}.bcm-quiet{font:inherit;border:0;background:none;padding:4px 6px;color:var(--bcm-muted);cursor:pointer;border-radius:6px;min-height:30px}.bcm-quiet:hover:not(:disabled){background:var(--bcm-soft);color:var(--bcm-fg)}.bcm-btn:focus-visible,.bcm-link:focus-visible,.bcm-quiet:focus-visible,.bcm-input:focus-visible,.bcm-react:focus-visible,a:focus-visible,.bcm-choice input:focus-visible+span{outline:2px solid var(--bcm-accent);outline-offset:2px}.bcm-input{font:inherit;width:100%;padding:8px 10px;border-radius:8px;border:1px solid var(--bcm-line);background:var(--bcm-bg);color:var(--bcm-fg)}.bcm-input[aria-invalid=true]{border-color:var(--bcm-danger);border-width:2px}.bcm-textarea{resize:vertical;min-height:96px}.bcm-field{display:flex;flex-direction:column;gap:4px}.bcm-field>label,.bcm-label{font-weight:600}.bcm-check{display:flex;gap:8px;align-items:flex-start}.bcm-check input{margin-top:.3em;width:18px;height:18px;flex:none}.bcm-choices{display:flex;flex-wrap:wrap;gap:8px;border:0;margin:0;padding:0;min-width:0}.bcm-choices legend,.bcm-fieldset legend{font-weight:600;padding:0;margin-bottom:6px}.bcm-fieldset{border:0;margin:0;padding:0;min-width:0;display:flex;flex-direction:column;gap:8px}.bcm-choice{position:relative;display:inline-flex}.bcm-choice input{position:absolute;opacity:0;width:1px;height:1px}.bcm-choice span{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;min-width:40px;padding:6px 12px;border:1px solid var(--bcm-line);border-radius:999px;cursor:pointer;background:var(--bcm-bg)}.bcm-choice input:checked+span{border:2px solid var(--bcm-accent);font-weight:650}.bcm-choice input:checked+span:before{content:"✓"}.bcm-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.bcm-spacer{flex:1}.bcm-full{flex-basis:100%}.bcm-muted,.bcm-hint{color:var(--bcm-muted);font-size:.875em}.bcm-error{color:var(--bcm-danger)}.bcm-ok{color:var(--bcm-ok)}.bcm-note{background:var(--bcm-soft);border-radius:8px;padding:8px 12px;font-size:.9375em}.bcm-warning{background:var(--bcm-warn-bg);border-radius:8px;padding:8px 12px;font-size:.9375em}.bcm-banner{background:var(--bcm-warn-bg);border-radius:10px;padding:10px 12px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}.bcm-text{white-space:pre-wrap;overflow-wrap:anywhere}.bcm-facts{font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;margin:0;background:var(--bcm-soft);border-radius:8px;padding:10px 12px}.bcm-badge{display:inline-flex;align-items:center;gap:4px;border:1px solid currentColor;border-radius:999px;padding:0 8px;font-size:.8125em;line-height:1.6}.bcm-badge-team{color:var(--bcm-accent);font-weight:650}.bcm-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}.bcm-count{color:var(--bcm-muted)}.bcm-thread,.bcm-replies{list-style:none;display:flex;flex-direction:column;gap:12px}.bcm-replies{margin-top:12px;padding-left:20px;border-left:2px solid var(--bcm-line)}.bcm-msg{display:flex;gap:10px;align-items:flex-start}.bcm-msg-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}.bcm-msg-pending{opacity:.65}.bcm-meta{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px;font-size:.875em}.bcm-author{font-weight:650}.bcm-handle,.bcm-time{color:var(--bcm-muted)}.bcm-handle:before{content:"@"}.bcm-placeholder{color:var(--bcm-muted);font-style:italic}.bcm-own-state{border-left:3px solid var(--bcm-line);padding-left:10px;display:flex;flex-direction:column;gap:4px}.bcm-actions{display:flex;align-items:center;flex-wrap:wrap;gap:2px 6px}.bcm-avatar{flex:none;width:36px;height:36px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;background:var(--bcm-soft);font-size:20px;line-height:1;-webkit-user-select:none;user-select:none}.bcm-avatar-initial{color:#fff;font-size:16px;font-weight:650}.bcm-reactions{display:flex;flex-wrap:wrap;gap:6px}.bcm-react{font:inherit;display:inline-flex;align-items:center;gap:4px;min-height:32px;padding:2px 10px;border-radius:999px;border:1px solid var(--bcm-line);background:var(--bcm-bg);color:var(--bcm-fg);cursor:pointer}button.bcm-react:hover:not(:disabled){background:var(--bcm-soft)}.bcm-react[aria-pressed=true]{border:2px solid var(--bcm-accent);font-weight:700}span.bcm-react{cursor:default}.bcm-menu{position:relative;display:inline-flex}.bcm-menu-list{position:absolute;right:0;top:calc(100% + 4px);z-index:var(--bcm-z);min-width:200px;display:flex;flex-direction:column;padding:4px;background:var(--bcm-bg);border:1px solid var(--bcm-line);border-radius:10px;box-shadow:var(--bcm-shadow)}.bcm-menu-list button,.bcm-menu-list a{font:inherit;text-align:left;border:0;background:none;color:var(--bcm-fg);padding:8px 10px;border-radius:6px;cursor:pointer;text-decoration:none;min-height:36px}.bcm-menu-list button:hover,.bcm-menu-list a:hover{background:var(--bcm-soft)}.bcm-composer{display:flex;flex-direction:column;gap:8px}.bcm-composer-foot{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.bcm-counter{color:var(--bcm-muted);font-size:.8125em;font-variant-numeric:tabular-nums}.bcm-counter-over{color:var(--bcm-danger);font-weight:650}.bcm-confirm{border:2px solid var(--bcm-accent);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:10px}.bcm-card{border:1px solid var(--bcm-line);border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:12px}.bcm-steps{color:var(--bcm-muted);font-size:.875em}.bcm-rules{list-style:none;display:flex;flex-direction:column;gap:8px}.bcm-rules li{display:flex;flex-direction:column;gap:2px}.bcm-consent{max-height:260px;overflow:auto;border:1px solid var(--bcm-line);border-radius:8px;padding:10px 12px;display:flex;flex-direction:column;gap:8px}.bcm-form{display:flex;flex-direction:column;gap:14px}.bcm-section{display:flex;flex-direction:column;gap:10px}.bcm-list{list-style:none;display:flex;flex-direction:column;gap:8px}.bcm-list>li{border:1px solid var(--bcm-line);border-radius:10px;padding:10px 12px;display:flex;flex-direction:column;gap:4px}.bcm-unread{border-left:4px solid var(--bcm-accent)!important}.bcm-dl{display:grid;grid-template-columns:minmax(120px,max-content) 1fr;gap:6px 14px;margin:0}.bcm-dl dt{font-weight:600}.bcm-dl dd{margin:0}.bcm-receipt{display:flex;flex-direction:column;gap:8px}.bcm-turnstile{min-height:0}.bcm-mention{color:var(--bcm-accent);font-weight:600;text-decoration:none}.bcm-mention:hover{text-decoration:underline}:host(blogmcp-badge){display:inline-block}.bcm-badge-link{display:inline-flex;align-items:center;justify-content:center;min-width:1.5em;height:1.5em;padding:0 6px;border-radius:999px;background:var(--bcm-accent);color:var(--bcm-accent-fg);font-size:.8125em;font-weight:700;line-height:1;text-decoration:none;font-variant-numeric:tabular-nums}.bcm-switches{list-style:none;display:flex;flex-direction:column;gap:10px}.bcm-switches li{display:flex;flex-direction:column;gap:2px}.bcm-profile-head{display:flex;align-items:center;gap:12px}.bcm-profile-head .bcm-avatar{width:48px;height:48px;font-size:26px}.bcm-links{list-style:none;display:flex;flex-direction:column;gap:8px}.bcm-url{overflow-wrap:anywhere;font-family:ui-monospace,monospace;font-size:.875em}.bcm-dialog{border:1px solid var(--bcm-line);border-radius:14px;padding:0;width:min(520px,calc(100vw - 32px));max-height:calc(100vh - 32px);background:var(--bcm-bg);color:var(--bcm-fg);box-shadow:var(--bcm-shadow)}.bcm-dialog::backdrop{background:#0a0c1073}.bcm-dialog-body{padding:16px;display:flex;flex-direction:column;gap:12px}@media(max-width:480px){.bcm{padding:12px;border-radius:0}.bcm-replies{padding-left:12px}.bcm-avatar{width:30px;height:30px;font-size:17px}.bcm-dl{grid-template-columns:1fr}.bcm-dialog{width:100vw;max-width:100vw;margin:auto 0 0;border-radius:16px 16px 0 0}}@media(prefers-reduced-motion:no-preference){.bcm-dialog[open]{animation:bcm-in .14s ease-out}@keyframes bcm-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}}:host(blogmcp-follow-button){display:inline-block}.bcm-follow-host{display:inline-flex}.bcm-follow{display:inline-flex;align-items:center;gap:6px}.bcm-follow .bcm-btn[aria-pressed=true]{border:2px solid var(--bcm-accent);font-weight:650}.bcm-grow{flex:1;min-width:0}.bcm-select{width:auto;max-width:100%}.bcm-category{gap:8px}.bcm-topics{list-style:none;display:flex;flex-direction:column}.bcm-topic-row{border-bottom:1px solid var(--bcm-line);padding:8px 0;display:flex;flex-direction:column;gap:4px}.bcm-topic-row:last-child{border-bottom:0}.bcm-topic-title{font-weight:650}';function eC(){const e=globalThis,t={__VUE_OPTIONS_API__:!0,__VUE_PROD_DEVTOOLS__:!1,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__:!1};for(const[n,s]of Object.entries(t))typeof e[n]>"u"&&(e[n]=s)}const wc="blogmcp-discussion",$c="blogmcp-notice-form",xc="blogmcp-my-community",Ic="blogmcp-notification-centre",Tc="blogmcp-badge",Cc="blogmcp-member-settings",Sc="blogmcp-profile",Ac="blogmcp-welcome",Oc="blogmcp-forum",Ec="blogmcp-forum-category",Mc="blogmcp-topic",Pc="blogmcp-forum-search",Rc="blogmcp-follow-button",Nc="blogmcp-forum-moderation";function tC(e){const t=e.nonce;return typeof t=="string"&&t!==""?t:e.getAttribute("nonce")||void 0}function nC(e,t){const n=rf(e);return class extends n{connectedCallback(){const o=tC(this),r=t||o;r&&!o&&(this.nonce=r);const a=this.shadowRoot;if(a&&!a.querySelector("style[data-bcm]")){const l=document.createElement("style");l.setAttribute("data-bcm",""),r&&l.setAttribute("nonce",r),l.textContent=QT,a.prepend(l)}super.connectedCallback()}}}function yt(e,t,n){typeof customElements>"u"||customElements.get(e)||(eC(),customElements.define(e,nC(t,n)))}function jc(e={}){yt(e.tag??wc,wv,e.nonce)}function zc(e={}){yt(e.tag??$c,Sx,e.nonce)}function Lc(e={}){yt(e.tag??xc,U0,e.nonce)}function Dc(e={}){yt(e.tag??Ic,Qx,e.nonce)}function Fc(e={}){yt(e.tag??Tc,zp,e.nonce)}function Uc(e={}){yt(e.tag??Cc,i1,e.nonce)}function qc(e={}){yt(e.tag??Sc,xI,e.nonce)}function Bc(e={}){yt(e.tag??Ac,XT,e.nonce)}function Hc(e={}){yt(e.tag??Oc,yw,e.nonce)}function Vc(e={}){yt(e.tag??Ec,Ay,e.nonce)}function Kc(e={}){yt(e.tag??Mc,jT,e.nonce)}function Wc(e={}){yt(e.tag??Pc,Zk,e.nonce)}function Yc(e={}){yt(e.tag??Rc,Av,e.nonce)}function Gc(e={}){yt(e.tag??Nc,pk,e.nonce)}function Zc(e={}){jc({tag:e.tags?.discussion,nonce:e.nonce}),zc({tag:e.tags?.noticeForm,nonce:e.nonce}),Lc({tag:e.tags?.myCommunity,nonce:e.nonce}),Dc({tag:e.tags?.notificationCentre,nonce:e.nonce}),Fc({tag:e.tags?.badge,nonce:e.nonce}),Uc({tag:e.tags?.memberSettings,nonce:e.nonce}),qc({tag:e.tags?.profile,nonce:e.nonce}),Bc({tag:e.tags?.welcome,nonce:e.nonce}),Hc({tag:e.tags?.forum,nonce:e.nonce}),Vc({tag:e.tags?.forumCategory,nonce:e.nonce}),Kc({tag:e.tags?.topic,nonce:e.nonce}),Wc({tag:e.tags?.forumSearch,nonce:e.nonce}),Yc({tag:e.tags?.followButton,nonce:e.nonce}),Gc({tag:e.tags?.forumModeration,nonce:e.nonce})}function _t(e,t){for(const[n,s]of Object.entries(t))s!=null&&s!==""&&e.setAttribute(n,String(s))}function kt(e,t){return t.transport&&(e.transport=t.transport),(t.container??document.body).appendChild(e),()=>e.remove()}function oC(e){if(typeof document>"u")return()=>{};jc({nonce:e.nonce});const t=document.createElement(wc);return _t(t,{"article-id":e.articleId,"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,"sign-in-href":e.signInHref,routes:e.routes?JSON.stringify(e.routes):void 0,"poll-ms":e.pollMs,nonce:e.nonce}),e.realtime&&(t.realtime=e.realtime),kt(t,e)}function sC(e){if(typeof document>"u")return()=>{};zc({nonce:e.nonce});const t=document.createElement($c);return _t(t,{"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,"turnstile-site-key":e.turnstileSiteKey,target:e.target?JSON.stringify(e.target):void 0,"article-id":e.articleId,routes:e.routes?JSON.stringify(e.routes):void 0,nonce:e.nonce}),kt(t,e)}function iC(e={}){if(typeof document>"u")return()=>{};Lc({nonce:e.nonce});const t=document.createElement(xc);return _t(t,{"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,"decision-id":e.decisionId,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,nonce:e.nonce}),kt(t,e)}function rC(e={}){if(typeof document>"u")return()=>{};Dc({nonce:e.nonce});const t=document.createElement(Ic);return _t(t,{"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,nonce:e.nonce}),kt(t,e)}function aC(e={}){if(typeof document>"u")return()=>{};Fc({nonce:e.nonce});const t=document.createElement(Tc);return _t(t,{"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,"poll-ms":e.pollMs,nonce:e.nonce}),kt(t,e)}function lC(e={}){if(typeof document>"u")return()=>{};Uc({nonce:e.nonce});const t=document.createElement(Cc);return _t(t,{"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,"sw-path":e.swPath,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,nonce:e.nonce}),kt(t,e)}function cC(e){if(typeof document>"u")return()=>{};qc({nonce:e.nonce});const t=document.createElement(Sc);return _t(t,{handle:e.handle,"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,nonce:e.nonce}),kt(t,e)}function uC(e={}){if(typeof document>"u")return()=>{};Bc({nonce:e.nonce});const t=document.createElement(Ac);return _t(t,{"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,nonce:e.nonce}),kt(t,e)}function dC(e={}){if(typeof document>"u")return()=>{};Hc({nonce:e.nonce});const t=document.createElement(Oc);return _t(t,{"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,nonce:e.nonce}),kt(t,e)}function fC(e){if(typeof document>"u")return()=>{};Vc({nonce:e.nonce});const t=document.createElement(Ec);return _t(t,{slug:e.slug,"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,nonce:e.nonce}),kt(t,e)}function mC(e){if(typeof document>"u")return()=>{};Kc({nonce:e.nonce});const t=document.createElement(Mc);return _t(t,{"conversation-id":e.conversationId,"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,"poll-ms":e.pollMs,nonce:e.nonce}),e.realtime&&(t.realtime=e.realtime),kt(t,e)}function pC(e={}){if(typeof document>"u")return()=>{};Wc({nonce:e.nonce});const t=document.createElement(Pc);return _t(t,{"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,nonce:e.nonce}),kt(t,e)}function hC(e){if(typeof document>"u")return()=>{};Yc({nonce:e.nonce});const t=document.createElement(Rc);return _t(t,{"target-kind":e.targetKind,"target-id":e.targetId,following:typeof e.following=="boolean"?String(e.following):void 0,"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,nonce:e.nonce}),kt(t,e)}function bC(e={}){if(typeof document>"u")return()=>{};Gc({nonce:e.nonce});const t=document.createElement(Nc);return _t(t,{"category-id":e.categoryId,"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,nonce:e.nonce}),kt(t,e)}const gC="0.3.1",vC=typeof document<"u"?document.currentScript:null;return Zc({nonce:vC?.nonce||void 0}),Ye.VERSION=gC,Ye.defineCommunityElements=Zc,Ye.mountBadge=aC,Ye.mountDiscussion=oC,Ye.mountFollowButton=hC,Ye.mountForum=dC,Ye.mountForumCategory=fC,Ye.mountForumModeration=bC,Ye.mountForumSearch=pC,Ye.mountMemberSettings=lC,Ye.mountMyCommunity=iC,Ye.mountNoticeForm=sC,Ye.mountNotificationCentre=rC,Ye.mountProfile=cC,Ye.mountTopic=mC,Ye.mountWelcome=uC,Object.defineProperty(Ye,Symbol.toStringTag,{value:"Module"}),Ye})({});
|
|
9
|
+
`).replace(/<[^>]*>/g,"");return lh(t).split(/\n{2,}/).map(n=>n.replace(/ *\n */g,`
|
|
10
|
+
`).replace(/[ ]{2,}/g," ").trim()).filter(n=>n!=="")}function ys(e){return typeof e=="string"?e.normalize("NFKC").replace(/\s+/gu," ").trim():""}function Yl(e){const t=lt(ys(e));return t>=Of&&t<=Na}const Gl=3,_s=30;function Qn(e){return typeof e=="string"?e.trim().toLowerCase():""}function Zl(e){const t=Qn(e);return t===""||yo.test(t)}const dh=Object.freeze({ß:"ss",ł:"l",đ:"d",ð:"d",ø:"o",ħ:"h",ŧ:"t",ı:"i",æ:"ae",œ:"oe",þ:"th",ŀ:"l"});function fh(e){const s=ys(e).toLowerCase().normalize("NFD").replace(new RegExp("\\p{M}+","gu"),"").normalize("NFC").replace(/[ßłđðøħŧıæœþŀ]/g,o=>dh[o]??o).split(/[^a-z0-9]+/).filter(o=>o!=="").join("_").slice(0,24).replace(/_+$/,"");return yo.test(s)?s:null}const mh=new Set(["displayName","handle","avatarPreset"]),ph=new Set(["rulesTextId","termsTextId","art9TextId"]),hh="art9_refusal_read_only",Jl=e=>e.code==="invalid"&&e.issueCodes?.includes(hh)===!0;function bh(e,t){return Jl(e)?{key:"onboarding.art9RequiredToWrite"}:Ie(e,t)}function gh(e,t,n,s){const o=[];e.member?.ageBand||o.push("age"),(e.acceptances.rules!=="accepted"||Xl(e))&&o.push("rules");const r=e.acceptances.art9Consent,a=e.acceptances.art9Refused===!0&&qa(e.settings?.art9Refusal)==="public_write",l=s&&r!=="accepted"&&!a;return(t.includes("art9_consent")||n&&r!==null&&r!=="accepted"||l)&&o.push("art9"),e.profile||o.push("profile"),o}const Xl=e=>Ut(e).terms;function vh(e,t){if(!e)return[];const n=Jf(e.bodyJson);return t==="split"&&n.length>1?n.map(s=>({entity:s.entity,label:s.label})):[{entity:n[0]?.entity??"",label:n.length>1?"":n[0]?.label??""}]}function ks(e){const t=e.signal?{signal:e.signal}:{},n=e.offerArt9===!0,s=e.forceArt9===!0&&!n,o=Re({phase:"loading",steps:[],index:0,me:null,rulesText:null,rules:[],termsText:null,termsParagraphs:[],art9Text:null,art9Paragraphs:[],art9Layout:"joint",art9Refusal:"read_only",art9Controllers:[],art9Refused:!1,art9RefusedSent:!1,reconsent:!1,ageBand:null,rulesAccepted:!1,get art9Accepted(){return this.art9Controllers.length>0&&this.art9Controllers.every(k=>k.accepted)},set art9Accepted(k){for(const M of this.art9Controllers)M.accepted=k},displayName:"",handle:"",avatarPreset:null,failure:null,fields:[],minAge:null}),r=k=>{o.failure=k,o.phase="failed"};async function a(k,M){const w=M&&k.includes("rules"),[v,x,N]=await Promise.all([k.includes("rules")?e.client.legal.current({kind:"rules",locale:e.lang},t):null,w?e.client.legal.current({kind:"terms",locale:e.lang},t):null,k.includes("art9")?e.client.legal.current({kind:"art9_consent",locale:e.lang},t):null]);for(const O of[v,x,N])if(O&&!O.ok)return r(O),null;return{rules:v?.ok?v.value:null,terms:x?.ok?x.value:null,art9:N?.ok?N.value:null}}async function l(){const k=await e.client.me.get(t);if(!k.ok)return r(k),null;const M=k.value.needs.filter(Wn);if(M.includes("sign_in"))return e.onSignIn(),null;const w=gh(k.value,M,n,s),v=await a(w,Xl(k.value));return v?{me:k.value,steps:w,texts:v}:null}const c=()=>!n&&o.art9Refusal==="public_write";function p(k){(k.texts.rules?.textId!==o.rulesText?.textId||k.texts.terms?.textId!==o.termsText?.textId)&&(o.rulesAccepted=!1);const M=Gf(k.me.settings?.art9ConsentLayout),w=k.texts.art9!==null&&k.texts.art9.textId===o.art9Text?.textId;o.art9Controllers=vh(k.texts.art9,M).map((v,x)=>{const N=o.art9Controllers[x];return{...v,accepted:w&&N?.entity===v.entity&&N.accepted===!0}}),o.art9Layout=M,o.art9Refusal=qa(k.me.settings?.art9Refusal),(!w||!c())&&(o.art9Refused=!1),o.me=k.me,o.steps=k.steps,o.reconsent=k.me.acceptances.rules==="reconsent_required",o.rulesText=k.texts.rules,o.rules=k.texts.rules?Gn(k.texts.rules.bodyJson):[],o.termsText=k.texts.terms,o.termsParagraphs=k.texts.terms?Wl(k.texts.terms.body):[],o.art9Text=k.texts.art9,o.art9Paragraphs=k.texts.art9?Wl(k.texts.art9.body):[]}async function h(){o.phase="loading",o.failure=null;const k=await l();if(k){if(p(k),o.index=0,k.steps.length===0){if(n){o.phase="done",e.onDone(k.me);return}return R()}o.phase="ready"}}const b=()=>o.steps[o.index]??null;function _(k){switch(k){case"age":return o.ageBand!==null;case"rules":return o.rulesAccepted&&o.rulesText!==null;case"art9":return o.art9Text!==null&&(o.art9Accepted||o.art9Refused&&c());case"profile":return Yl(o.displayName)&&Zl(o.handle)}}function $(){const k=b();return o.phase!=="ready"||k===null?!1:k==="art9"?o.art9Text!==null&&o.art9Accepted:_(k)}function y(k){const M=o.steps.indexOf(k);M>=0&&(o.index=M)}const I=()=>o.steps.findIndex(k=>!_(k));async function R(){const k=I();if(k>=0){o.index=k;return}o.phase="sending",o.failure=null,o.fields=[];const M={ageBand:o.ageBand??o.me?.member?.ageBand??"18_plus",rulesTextId:o.steps.includes("rules")&&o.rulesText?o.rulesText.textId:""};o.steps.includes("rules")&&o.termsText&&(M.termsTextId=o.termsText.textId);let w=!1;if(o.steps.includes("art9")&&o.art9Text&&(o.art9Accepted?M.art9TextId=o.art9Text.textId:o.art9Refused&&c()&&(M.art9Refused=!0,w=!0)),o.steps.includes("profile")){M.displayName=ys(o.displayName);const x=Qn(o.handle);x!==""&&(M.handle=x),M.avatarPreset=o.avatarPreset}const v=await e.client.me.onboard(M,t);if(v.ok){o.art9RefusedSent=w,o.phase="done",e.onDone(v.value);return}switch(o.failure=v,o.phase="ready",v.code){case"age":o.minAge=18,o.phase="refused",e.onRefused?.(o.minAge);return;case"name":return o.fields=Qn(o.handle)!==""?["displayName","handle"]:["displayName"],y("profile");case"handle":return o.fields=["handle"],y("profile");case"invalid":return o.fields=v.fields??[],Jl(v)||o.fields.includes("art9Refused")?(o.art9Refused=!1,P(v)):o.fields.some(x=>mh.has(x))?y("profile"):o.fields.some(x=>ph.has(x))?P(v):o.fields.includes("ageBand")?y("age"):void 0;case"signIn":return e.onSignIn();default:return}}async function P(k){const M=[...o.fields];o.phase="sending";const w=await l();if(!w)return;p(w),(M.includes("rulesTextId")||M.includes("termsTextId"))&&(o.rulesAccepted=!1),M.includes("art9TextId")&&(o.art9Accepted=!1),o.failure=k,o.fields=M;const v=I();if(v>=0){o.index=v,o.phase="ready";return}if(w.me.needs.filter(Wn).length===0){o.phase="done",e.onDone(w.me);return}r(k)}async function T(){if(o.failure=null,o.index<o.steps.length-1){o.index+=1;return}await R()}const g=()=>o.phase==="ready"&&b()==="art9"&&o.art9Text!==null&&c();return{state:o,load:h,step:b,isLast:()=>o.index>=o.steps.length-1,canContinue:$,async next(){$()&&(b()==="art9"&&o.art9Accepted&&(o.art9Refused=!1),await T())},canRefuse:g,async refuse(){g()&&(o.art9Accepted=!1,o.art9Refused=!0,await T())},refusalOffered:c,back(){o.phase!=="ready"||o.index===0||(o.failure=null,o.index-=1,b()==="art9"&&(o.art9Refused=!1))},suggestedHandle:()=>Qn(o.handle)===""?fh(o.displayName):null,hasFieldError:k=>o.fields.includes(k)}}const ji=(e="")=>({body:e,sending:!1,failure:null,confirm:null,waitUntil:null,clientMsgId:null}),Ql=Object.freeze({counts:Object.freeze({}),mine:null}),ec=()=>typeof document>"u"||document.visibilityState!=="hidden",yh=1;function _h(e){return tc(e,{kind:"article",id:e.articleId.toLowerCase()},e.realtime??null)}function kh(e){return tc(e,{kind:"topic",id:e.conversationId.toLowerCase()},e.realtime??null)}function tc(e,t,n){const{client:s,lang:o}=e,r=t.kind==="topic",a=t.id,l=r?"forum":"article_discussions",c=e.now??Date.now,p=r?null:ol(),h=r?Wm():null,b=p??h,_=new AbortController,$={signal:_.signal},y=Re({phase:"loading",failure:null,thread:b.getState(),loadingMore:!1,refreshing:!1,newMessages:!1,me:null,block:null,composer:ji(),inline:null,report:null,announcement:null,announceId:0,clock:c(),busy:{},refusedAge:e.refusedAge??null,art9RefusedNote:!1,realtimeOff:!1}),I=b.subscribe(C=>{y.thread=C}),R=Vt(null);let P=!1,T=null,g=null,k=!0,M=!1,w=0,v=null,x=null,N=null,O=null,E=null;const B=e.pollMs??2e4;function ee(C){y.announcement=C,y.announceId+=1}function re(){y.phase="hidden",T?.stop(),T=null,g?.stop(),g=null}function be(C=!1){return y.me&&!C?Promise.resolve():(x??=s.me.get($).then(L=>{x=null,!(!L.ok||M)&&(y.me=L.value,D())}),x)}const we=C=>bl(C?.module,l)?.brake??null;function K(C){const L=C?.module;if(!L)return null;const le=L.brake?L.brake.until:Yn(L.state)&&L.state==="braked"?L.until:void 0,me=typeof le=="string"?Date.parse(le):NaN,Be=we(C),St=Be?Date.parse(Be.until):NaN,to=[me,St].filter(Ss=>Number.isFinite(Ss));return to.length>0?Math.max(...to):null}function D(){if(O&&clearTimeout(O),O=null,M)return;const C=[];if(A()){const me=K(y.me);me!==null&&C.push(me)}if(y.block==="braked"&&E!==null&&C.push(E),C.length===0)return;const L=Math.max(...C)-c(),le=L>0?Math.min(L+1e3,2147e6):3e4;O=setTimeout(()=>{O=null,!M&&(U(),be(!0))},le)}function U(){y.block==="braked"&&(E!==null&&E>c()||(y.block=null,E=null))}function Fe(){const C=b.getState();C.viewer.canPost||Ut(C).any||C.viewer.restrictions.length>0||r&&(C.viewer.memberId===null||!je())||be(y.block===null).then(()=>{const L=y.me;if(!(M||!L||b.getState().viewer.canPost)&&!A()){if(r){y.block=Yn(L.module?.state)&&L.module?.state==="read_only"?"readOnly":L.member&&L.member.status!=="active"?"restricted":null;return}y.block=!L.member||L.member.status==="active"?"notMoved":"restricted"}})}const je=()=>!r||Ym(h.getState().topic);function Ue(){const C=b.getState(),L=y.block==="braked"||A();C.viewer.canPost&&y.block!=="braked"&&(y.block=null),L&&U(),C.viewer.memberId!==null&&be(L),Fe(),R.value&&!Ut(C).any&&R.value.state.phase!=="sending"&&(R.value=null)}function Qe(C){if(C.code==="surfaceOff")return re();if(r&&(C.code==="membersOnly"||C.code==="notFound")){T?.stop(),T=null,g?.stop(),g=null,y.phase=C.code,y.failure=C;return}if(C.code==="notFound"&&y.phase!=="ready")return qt("not-found","[blogmcp-community] the discussion of this article-id was not found (no such live article, or it is not readable here)"),re();(y.phase==="loading"||y.phase==="failed")&&(y.phase="failed",y.failure=C)}const oe=C=>r?(C?Xm:fl)(h,s,{conversationId:a,languageCode:o},$):(C?Nm:Rm)(p,s,{articleId:a,languageCode:o},$);function Z(){return M?Promise.resolve():(v??=(async()=>{y.refreshing=!0;const C=await oe(!1);y.refreshing=!1,!M&&(w=c(),C.ok?(y.phase="ready",y.failure=null,y.newMessages=!1,Ue()):Qe(C))})().finally(()=>{v=null}),v)}async function J(){if(y.loadingMore||y.thread.nextCursor===null)return;y.loadingMore=!0;const C=await oe(!0);if(y.loadingMore=!1,!(M||C.ok)){if(C.code==="surfaceOff")return re();if(r&&(C.code==="membersOnly"||C.code==="notFound"))return Qe(C);ee(Ie(C,o))}}const W=C=>{const L=r?C?.conversationId:C?.articleId;return typeof L=="string"?L.toLowerCase():null},pe=C=>r?h.applyHead(C):p.applyHead(C);function Ht(C){for(const L of C){if(W(L)!==a)continue;if(y.phase==="failed"){Z();continue}const le=b.getState(),me=typeof L.lastSeq=="number"&&L.lastSeq>le.lastSeq;pe(L)&&(me&&le.loaded?y.newMessages=!0:Z())}}function Rt(){if(T||B===0||M||y.phase==="hidden")return;const C={intervalMs:B,visible:()=>ec()&&k,onChange:Ht,onFailure:L=>{L.code==="surfaceOff"?re():r&&L.code==="membersOnly"&&Qe(L)},signal:_.signal};T=r?Um(s,[a],C):Fm(s,[a],C)}async function Cs(C){if(!(g||M||y.phase==="hidden")){if(Ut(b.getState()).signIn)return Rt();if(await be(),!(M||g||y.phase==="hidden")){if(y.me?.module&&y.me.module.features.realtime!==!0)return Rt();try{g=C({client:s,store:p??h,languageCode:o,visible:()=>ec()&&k,...B>0?{pollIntervalMs:B}:{},onMode:L=>{M||(L==="polling"&&!y.realtimeOff?y.realtimeOff=!0:L==="live"&&y.realtimeOff&&(y.realtimeOff=!1))}})}catch{qt("realtime","[blogmcp-community] the realtime property is not a session factory (createRealtimeSession of @blogmcp/sdk/community/realtime): the discussion polls"),g=null,Rt()}}}}function A(){const C=y.me?.module;return C?C.brake!==void 0||Yn(C.state)&&C.state==="braked"||we(y.me)!==null:!1}function j(){const C=y.thread,L=Ut(C);if(L.signIn)return"signIn";if(r){if(C.viewer.memberId===null)return"none";if(!je())return"locked";if(y.block==="readOnly")return"readOnly"}return y.block==="notMoved"?"notMoved":y.block==="braked"||A()?"braked":!C.viewer.canPost&&C.viewer.restrictions.length>0?"sanction":L.any?y.refusedAge!==null&&!R.value?"ageRefused":"onboarding":R.value&&P?"onboarding":y.block==="restricted"?"restricted":C.viewer.canPost?"write":"pending"}function F(){const C=y.me,L=C?.caps?.mentionsPerMessage,le=C?.module?.state;return!C?.member||typeof L!="number"||!Number.isSafeInteger(L)||L<0?null:le==="live"||le==="braked"?L:null}const G=C=>{const L=F();return L!==null&&Ol(C).length>L},V=C=>Am(y.thread,C),H=C=>!C.pending&&C.seq>0,te=()=>j()==="write";function Q(){const C=y.me;if(C?.member&&C.profile)return{kind:"member",memberId:C.member.memberId,handle:C.profile.handle,displayName:C.profile.displayName,avatarPreset:C.profile.avatarPreset};const L=y.thread.viewer.memberId;if(L===null)return null;for(const le of y.thread.messages)for(const me of[le,...le.replies])if(me.author.kind==="member"&&me.author.memberId===L)return me.author;return null}function X(){y.clock=c(),!N&&(N=setInterval(()=>{y.clock=c();let C=!1;for(const L of[y.composer,y.inline])!L||L.waitUntil===null||(L.waitUntil<=y.clock?(L.waitUntil=null,L.failure&&(L.failure.code==="fast"||L.failure.code==="quota")&&(L.failure=null)):C=!0);!C&&N&&(clearInterval(N),N=null)},1e3))}const Y=C=>C.waitUntil===null?0:Math.max(0,Math.ceil((C.waitUntil-Math.max(y.clock,c()))/1e3));async function ce(C,L){const le=await Qm(h,s,{conversationId:a,languageCode:o},L,$);if(!M){if(le===L){Ue();return}C&&C.failure===L&&(C.failure=le),Qe(le)}}function ne(C,L){if(C&&(C.failure=L),r&&L.code==="notFound"){ce(C,L);return}switch(Hl(L.code)){case"confirm":C&&L.codes&&L.codes.length>0&&(C.confirm={codes:[...L.codes],checked:[]});return;case"wait":C&&(C.waitUntil=Ni(L,c()),C.waitUntil!==null&&X()),L.code==="braked"&&(y.block="braked",E=Ni(L,c()),D(),be(!0));return;case"onboard":eo(L.needs?.includes("art9_consent")?{forceArt9:!0}:{}),Z();return;case"reload":Z();return;case"notMoved":y.block="notMoved";return;case"hide":return L.code==="realtimeOff"?void 0:re();default:return}}async function ae(C,L,le){if(C.sending||Y(C)>0||M)return;const me=Ze(C.body);if(me===""||lt(me)>In)return;const Be=Ut(y.thread);if(Be.signIn)return;if(Be.any)return eo();const St=L.kind==="new"?null:Zn(y.thread,L.seq);if(L.kind!=="new"&&(!St||!H(St)))return;if(G(me)){C.failure={ok:!1,code:"mentionLimit"};return}let to;const Ss=L.kind==="edit"&&y.inline===C?y.inline.title:null;if(Ss!==null){const no=ki(Ss);if(no===null)return;no!==h?.getState().topic?.title&&(to=no)}C.sending=!0,C.failure=null;const eu=L.kind==="edit"?null:Q(),Eo=L.kind==="edit"?as():C.clientMsgId??=as();L.kind==="edit"?b.applyMessage({type:"edit",clientMsgId:Eo,seq:L.seq,body:me}):eu&&b.applyMessage({type:"post",clientMsgId:Eo,body:me,replyToSeq:L.kind==="reply"?L.seq:null,author:eu,languageCode:o});const xC=r?{conversationId:a}:{articleId:a},Pn=L.kind==="edit"?await s.messages.edit({conversationId:St.conversationId,seq:L.seq,body:me,...to!==void 0?{title:to}:{},...le?{confirmations:le}:{}},$):await s.messages.post({...xC,body:me,replyToSeq:L.kind==="reply"?L.seq:null,clientMsgId:Eo,languageCode:o,...le?{confirmations:le}:{}},$);if(!M){if(C.sending=!1,Pn.ok){b.applyMessage({type:"confirm",clientMsgId:Eo,message:Pn.value.message,warnings:Pn.value.warnings}),Pn.value.topic&&h&&h.applyTopic(Pn.value.topic);const no=Pn.value.message.state==="held";C.body="",C.clientMsgId=null,C.confirm=null,C.failure=null,L.kind!=="new"&&y.inline===C&&(y.inline=null),ee({key:no?"composer.held":"composer.posted"}),L.kind!=="edit"&&e.onPosted?.(no?"held":"visible");return}b.applyMessage({type:"rollback",clientMsgId:Eo}),ne(C,Pn)}}function de(C,L,le){if(!C.confirm||!C.confirm.codes.includes(L))return;const me=C.confirm.checked.filter(Be=>Be!==L);C.confirm.checked=le?[...me,L]:me}async function ye(C){const L=C.confirm;if(!L||!L.codes.every(me=>L.checked.includes(me)))return;const le=C===y.composer?{kind:"new"}:y.inline===C?{kind:y.inline.kind,seq:y.inline.seq}:{kind:"new"};await ae(C,le,[...L.codes])}async function Se(C){const L=Zn(y.thread,C),le=`delete:${C}`;if(!L||!H(L)||y.busy[le])return!1;y.busy[le]=!0;const me=as();b.applyMessage({type:"delete",clientMsgId:me,seq:C});const Be=await s.messages.delete({conversationId:L.conversationId,seq:C},$);return delete y.busy[le],M?!1:Be.ok?(b.applyMessage({type:"confirm",clientMsgId:me,message:Be.value.message}),!0):(b.applyMessage({type:"rollback",clientMsgId:me}),ee(Ie(Be,o)),ne(null,Be),!1)}const xe=C=>"articleId"in C?"react:article":`react:${C.seq}`,st=C=>r?"articleId"in C?Ql:Zn(y.thread,C.seq)?.reactions??Ql:Om(y.thread,C);async function it(C,L){const le=xe(C);if(r&&"articleId"in C||!te()||y.busy[le]||!y.thread.reactionSet.includes(L))return;const me=st(C),Be=me.mine===L?null:L;y.busy[le]=!0,b.applyReaction(C,Em(me,Be));const St=await s.reactions.set({target:C,emoji:Be},$);if(delete y.busy[le],!M){if(St.ok){b.applyReaction(C,St.value.reactions);return}b.applyReaction(C,me),ee(Ie(St,o)),ne(null,St)}}async function Nt(C,L){const le=`block:${C}`;if(y.busy[le])return;y.busy[le]=!0;const me=await s.blocks.set({memberId:C,blocked:L},$);if(delete y.busy[le],!M){if(me.ok){b.collapse(C,me.value.blocked),ee({key:me.value.blocked?"discussion.blocked":"discussion.unblocked"});return}ee(Ie(me,o)),ne(null,me)}}function jt(C){y.report={conversationId:C.conversationId,seq:C.seq,category:"",ruleId:"",note:"",rules:null,rulesFailed:!1,sending:!1,failure:null,done:!1};const L=y.report;s.legal.current({kind:"rules",locale:o},$).then(le=>{y.report===L&&(le.ok?L.rules=Gn(le.value.bodyJson):L.rulesFailed=!0)})}async function Mn(){const C=y.report;if(!C||C.sending||C.done||C.category===""||C.category==="rules"&&C.ruleId==="")return;const L=Ze(C.note);if(lt(L)>ss)return;C.sending=!0,C.failure=null;const le=await s.messages.report({conversationId:C.conversationId,seq:C.seq,category:C.category,ruleId:C.category==="rules"?C.ruleId:null,note:L===""?null:L},$);if(C.sending=!1,!M){if(le.ok){C.done=!0,ee({key:"report.done"});return}C.failure=le,le.code==="surfaceOff"&&re()}}function eo(C={}){if(R.value||M||y.refusedAge!==null)return;const L=C.offerArt9===!0,le=!L&&(C.forceArt9===!0||r&&C.toRead!==!0);P=L;const me=ks({client:s,lang:o,signal:_.signal,...L?{offerArt9:!0}:{},...le?{forceArt9:!0}:{},onRefused:Be=>{y.refusedAge=Be,e.onAgeRefused?.(Be)},onDone:Be=>{y.me=Be,R.value=null;for(const St of[y.composer,y.inline])St?.failure?.code==="onboarding"&&(St.failure=null);y.art9RefusedNote=me.state.art9RefusedSent,L?Be.acceptances.art9Consent==="accepted"&&ee({key:"panel.art9Given"}):ee({key:me.state.art9RefusedSent?"onboarding.art9RefusedDone":"onboarding.done"}),Z()},onSignIn:()=>{R.value=null,Z()}});R.value=me,me.load()}const ct=()=>{const C=j();if(C==="write")return!0;if(!r||C!=="locked")return!1;const L=y.thread;return L.viewer.memberId!==null&&!Ut(L).any&&L.viewer.restrictions.length===0&&!A()&&y.block===null},Ct=C=>r&&C.seq===yh&&V(C);return{state:y,store:b,onboarding:R,async start(){await Z(),n&&y.phase==="ready"?await Cs(n):Rt()},refresh:Z,loadMore:J,mode:j,needs:()=>Ut(y.thread),isOwn:V,canReply:C=>{if(!te()||!H(C)||C.state!=="visible"||C.body===null)return!1;if(C.replyToSeq===null)return!0;const L=Zn(y.thread,C.replyToSeq);return L!==null&&H(L)&&L.state==="visible"},canEdit:C=>te()&&V(C)&&H(C)&&C.body!==null&&(C.state==="visible"||C.state==="held"),canDelete:C=>y.thread.viewer.memberId!==null&&j()!=="braked"&&V(C)&&H(C)&&C.body!==null&&C.state!=="deleted",canReact:ct,mentionCap:F,editsTitle:Ct,canReport:C=>!Ut(y.thread).signIn&&!V(C)&&H(C)&&C.body!==null&&C.author.kind!=="system",canReportAsNotifier:C=>Ut(y.thread).signIn&&H(C)&&C.body!==null&&C.author.kind!=="system",canBlock:C=>!Ut(y.thread).signIn&&!V(C)&&H(C)&&C.author.kind==="member"&&C.author.memberId!==null,setInView(C){const L=k;k=C,C&&!L&&T&&c()-w>=B&&T.now()},submit:()=>ae(y.composer,{kind:"new"}),openReply(C,L=null){const le=Zn(y.thread,C);if(!le)return;const me=le.replyToSeq??le.seq;if(y.inline?.kind==="reply"&&y.inline.seq===me){y.inline.replyingTo=L;return}y.inline={...ji(),kind:"reply",seq:me,replyingTo:L,title:null}},openEdit(C){const L=Zn(y.thread,C);if(!L||L.body===null)return;const le=Ct(L)?h?.getState().topic?.title??"":null;y.inline={...ji(L.body),kind:"edit",seq:C,replyingTo:null,title:le}},closeInline(){y.inline=null},async submitInline(){const C=y.inline;C&&await ae(C,{kind:C.kind,seq:C.seq})},setConfirmed:de,sendConfirmed:ye,remove:Se,react:it,setBlocked:Nt,openReport:jt,closeReport(){y.report=null},submitReport:Mn,beginOnboarding:eo,cancelOnboarding(){R.value=null},waitLeft:Y,dispose(){M||(M=!0,_.abort(),T?.stop(),T=null,g?.stop(),g=null,I(),N&&clearInterval(N),N=null,O&&clearTimeout(O),O=null,R.value=null)}}}const wh=["aria-labelledby","aria-describedby"],$h={class:"bcm-dialog-body"},xh=["id"],Ih=["id"],Th={class:"bcm-row"},Ch=["disabled"],Sh=["disabled"],ws=$e({__name:"ConfirmDialog",props:{title:{},explain:{},explainParams:{},confirm:{},cancel:{},danger:{type:Boolean},busy:{type:Boolean},fallbackFocus:{type:Function}},emits:["confirm","cancel"],setup(e,{emit:t}){const n=e,s=t,{t:o}=vt(),r=ue(null),a=Ve("bcm-dialog");return Mi(r,()=>s("cancel"),n.fallbackFocus),(l,c)=>(d(),m("dialog",{ref_key:"dialog",ref:r,class:"bcm-dialog","aria-labelledby":`${i(a)}-title`,"aria-describedby":e.explain?`${i(a)}-explain`:void 0},[f("div",$h,[f("h3",{id:`${i(a)}-title`},u(i(o)(e.title)),9,xh),e.explain?(d(),m("p",{key:0,id:`${i(a)}-explain`},u(i(o)(e.explain,e.explainParams)),9,Ih)):S("",!0),f("div",Th,[c[2]||(c[2]=f("span",{class:"bcm-spacer"},null,-1)),f("button",{type:"button",class:"bcm-btn",disabled:e.busy,onClick:c[0]||(c[0]=p=>s("cancel"))},u(i(o)(e.cancel??"common.cancel")),9,Ch),f("button",{type:"button",class:Ke(["bcm-btn bcm-primary",{"bcm-danger":e.danger}]),disabled:e.busy,onClick:c[1]||(c[1]=p=>s("confirm"))},u(i(o)(e.confirm)),11,Sh)])])],8,wh))}}),Ah=["for"],Oh=["id","aria-describedby","aria-invalid","readonly"],Eh=["id"],Mh={key:0,class:"bcm-error"},Ph={key:1,class:"bcm-hint"},Rh=["for"],Nh={key:1,class:"bcm-hint"},jh=["id","placeholder","aria-describedby","aria-invalid","readonly"],zh={class:"bcm-composer-foot"},Lh=["id"],Dh={class:"bcm-sr","aria-live":"polite"},Fh=["disabled"],Uh=["disabled"],qh=["id"],Bh={key:0},Hh=["href"],Vh={key:2,class:"bcm-error"},Kh={key:3,class:"bcm-error",role:"alert"},Wh={key:4,class:"bcm-warning",role:"status"},Yh={key:5,class:"bcm-error",role:"alert"},Gh={key:6,class:"bcm-confirm"},Zh={class:"bcm-label"},Jh=["checked","onChange"],Xh={class:"bcm-row"},Qh=["disabled"],Co=$e({__name:"MessageComposer",props:{draft:{},kind:{},wait:{},replyingTo:{},rulesHref:{},mentionsMax:{}},emits:["submit","cancel","confirmed","confirm"],setup(e,{expose:t,emit:n}){const s=e,o=n,{t:r,lang:a}=vt(),l=Ve("bcm-composer"),c=ue(null),p=z(()=>lt(Ze(s.draft.body))),h=z(()=>p.value>In),b=z(()=>{const O=s.mentionsMax;return typeof O=="number"&&O>=0&&Ol(Ze(s.draft.body)).length>O}),_=z(()=>typeof s.draft.title=="string"),$=z(()=>hl(s.draft.title)),y=z(()=>_.value&&$.value>is),I=z(()=>!_.value||ki(s.draft.title)!==null),R=z(()=>_.value&&!y.value&&!I.value&&p.value>0),P=z(()=>!s.draft.sending&&p.value>0&&!h.value&&!b.value&&I.value&&s.wait===0&&s.draft.confirm===null),T=z(()=>{const O=s.draft.confirm;return O!==null&&O.codes.every(E=>O.checked.includes(E))}),g=z(()=>r(s.kind==="reply"?"composer.replyLabel":s.kind==="edit"?"composer.editLabel":s.kind==="topic"?"topic.bodyLabel":"composer.label")),k=typeof navigator<"u"&&/Mac|iPhone|iPad/i.test(navigator.platform||navigator.userAgent)?"⌘ + Enter":"Ctrl + Enter",M=z(()=>{const O=s.draft.failure;if(!O||s.draft.confirm&&O.code==="confirm"||O.code==="mentionLimit"&&b.value||(O.code==="fast"||O.code==="quota")&&s.wait>0&&s.wait<=Bl)return"";const E=Ie(O,a.value);return r(E.key,E.params)}),w=ue("");let v=null;ve(p,O=>{v&&clearTimeout(v),v=setTimeout(()=>{w.value=O>=In*.9?r("composer.counter",{length:O,max:In}):""},700)}),Ge(()=>{v&&clearTimeout(v)}),ve(()=>[s.draft.body,s.draft.title],()=>{const O=s.draft;O.confirm&&(O.confirm=null),O.failure&&O.failure.code!=="fast"&&O.failure.code!=="quota"&&(O.failure=null)});function x(O){O.key!=="Enter"||!(O.metaKey||O.ctrlKey)||(O.preventDefault(),P.value&&o("submit"))}function N(){P.value&&o("submit")}return t({focus:()=>c.value?.focus()}),(O,E)=>(d(),m("form",{class:"bcm-composer",onSubmit:mt(N,["prevent"])},[_.value?(d(),m(q,{key:0},[f("label",{for:`${i(l)}-title`,class:"bcm-label"},u(i(r)("topic.titleLabel")),9,Ah),ge(f("input",{id:`${i(l)}-title`,"onUpdate:modelValue":E[0]||(E[0]=B=>e.draft.title=B),class:"bcm-input",type:"text",autocomplete:"off","aria-describedby":`${i(l)}-title-counter`,"aria-invalid":y.value,readonly:e.draft.sending,onKeydown:x},null,40,Oh),[[Xe,e.draft.title]]),f("span",{id:`${i(l)}-title-counter`,class:Ke(["bcm-counter",{"bcm-counter-over":y.value}])},u(i(r)("composer.counter",{length:$.value,max:i(is)})),11,Eh),y.value?(d(),m("p",Mh,u(i(r)("topic.titleTooLong",{max:i(is)})),1)):R.value?(d(),m("p",Ph,u(i(r)("topic.titleMissing")),1)):S("",!0)],64)):S("",!0),f("label",{for:i(l),class:"bcm-label"},u(g.value),9,Rh),e.replyingTo?(d(),m("p",Nh,u(i(r)("composer.replyingTo",{name:e.replyingTo})),1)):S("",!0),ge(f("textarea",{id:i(l),ref_key:"input",ref:c,"onUpdate:modelValue":E[1]||(E[1]=B=>e.draft.body=B),class:"bcm-input bcm-textarea",rows:"4",placeholder:i(r)("composer.placeholder"),"aria-describedby":`${i(l)}-counter ${i(l)}-hints`,"aria-invalid":h.value||b.value,readonly:e.draft.sending,onKeydown:x},null,40,jh),[[Xe,e.draft.body]]),f("div",zh,[f("span",{id:`${i(l)}-counter`,class:Ke(["bcm-counter",{"bcm-counter-over":h.value}])},u(i(r)("composer.counter",{length:p.value,max:i(In)})),11,Lh),f("span",Dh,u(w.value),1),E[4]||(E[4]=f("span",{class:"bcm-spacer"},null,-1)),e.kind!=="new"&&e.kind!=="topic"?(d(),m("button",{key:0,type:"button",class:"bcm-btn",disabled:e.draft.sending,onClick:E[2]||(E[2]=B=>o("cancel"))},u(i(r)("composer.cancel")),9,Fh)):S("",!0),f("button",{type:"submit",class:"bcm-btn bcm-primary",disabled:!P.value},u(e.draft.sending?i(r)("composer.sending"):e.kind==="edit"?i(r)("composer.save"):e.kind==="topic"?i(r)("topic.create"):i(r)("composer.submit")),9,Uh)]),f("div",{id:`${i(l)}-hints`,class:"bcm-hint"},[f("p",null,u(i(r)("composer.linksNote",{count:i(Af)})),1),f("p",null,u(i(r)("composer.shortcut",{keys:i(k)})),1),e.rulesHref?(d(),m("p",Bh,[f("a",{href:e.rulesHref,target:"_blank",rel:"noopener"},u(i(r)("onboarding.rulesTitle")),9,Hh)])):S("",!0)],8,qh),h.value?(d(),m("p",Vh,u(i(r)("composer.tooLong",{max:i(In)})),1)):S("",!0),b.value?(d(),m("p",Kh,u(i(r)("error.mentionLimit")),1)):S("",!0),e.wait>0&&e.wait<=i(Bl)?(d(),m("p",Wh,u(i(r)("composer.cooldown",{count:e.wait})),1)):S("",!0),M.value?(d(),m("p",Yh,u(M.value),1)):S("",!0),e.draft.confirm?(d(),m("fieldset",Gh,[f("legend",Zh,u(i(r)("confirm.title")),1),f("p",null,u(i(r)("error.confirm")),1),(d(!0),m(q,null,fe(e.draft.confirm.codes,B=>(d(),m("label",{key:B,class:"bcm-check"},[f("input",{type:"checkbox",checked:e.draft.confirm.checked.includes(B),onChange:ee=>o("confirm",B,ee.target.checked)},null,40,Jh),f("span",null,u(i(r)(i(wp)(B))),1)]))),128)),f("div",Xh,[f("button",{type:"button",class:"bcm-btn bcm-primary",disabled:!T.value||e.draft.sending||e.wait>0,onClick:E[3]||(E[3]=B=>o("confirmed"))},u(i(r)("confirm.submit")),9,Qh)])])):S("",!0)],32))}}),zi=Object.freeze([Object.freeze({id:"fox",emoji:"🦊"}),Object.freeze({id:"owl",emoji:"🦉"}),Object.freeze({id:"bear",emoji:"🐻"}),Object.freeze({id:"hedgehog",emoji:"🦔"}),Object.freeze({id:"frog",emoji:"🐸"}),Object.freeze({id:"bee",emoji:"🐝"}),Object.freeze({id:"leaf",emoji:"🍃"}),Object.freeze({id:"flower",emoji:"🌼"}),Object.freeze({id:"tree",emoji:"🌲"}),Object.freeze({id:"star",emoji:"⭐"})]),eb=new Map(zi.map(e=>[e.id,e.emoji]));function tb(e){return typeof e=="string"?eb.get(e)??null:null}function nc(e){if(typeof e!="string")return"";for(const t of e.trim())return t.toLocaleUpperCase();return""}function nb(e){if(typeof e!="string"||e==="")return 210;let t=0;for(let n=0;n<e.length;n++)t=(t*31+e.charCodeAt(n))%360;return t}const Li=$e({__name:"AuthorAvatar",props:{author:{}},setup(e){const t=e,n=z(()=>t.author.kind==="member"?tb(t.author.avatarPreset):null),s=z(()=>{const r=t.author;return r.kind==="member"||r.kind==="staff"?nc(r.displayName):""}),o=z(()=>{const r=t.author;if(n.value||!s.value)return;const a=r.kind==="member"?r.memberId:r.kind==="staff"?r.staffId:null;return`hsl(${nb(a)} 45% 42%)`});return(r,a)=>(d(),m("span",{class:Ke(["bcm-avatar",{"bcm-avatar-initial":!n.value&&s.value}]),style:Do(o.value?{background:o.value}:void 0),"aria-hidden":"true"},u(n.value??s.value),7))}}),ob=["href","rel"],sb=["href"],oc=$e({__name:"LinkedText",props:{text:{},profilePath:{}},setup(e){const t=e,n=z(()=>{const s=t.profilePath;return rh(t.text??"",s?o=>kl(s,o):null)});return(s,o)=>(d(!0),m(q,null,fe(n.value,(r,a)=>(d(),m(q,{key:a},[r.kind==="link"?(d(),m("a",{key:0,href:r.href,rel:i(eh),target:"_blank"},u(r.text),9,ob)):r.kind==="mention"?(d(),m("a",{key:1,class:"bcm-mention",href:r.href},u(r.text),9,sb)):(d(),m(q,{key:2},[It(u(r.text),1)],64))],64))),128))}}),ib=["aria-expanded","aria-controls"],rb=["id"],ab=["href"],lb=["onClick"],sc=$e({__name:"MessageMenu",props:{items:{},label:{}},emits:["select"],setup(e,{emit:t}){const n=t,{t:s}=vt(),o=ue(!1),r=ue(null),a=ue(null),l=Ve("bcm-menu");function c(_){!a.value||_.composedPath().includes(a.value)||h(!1)}function p(_){o.value=_,_?(document.addEventListener("pointerdown",c,!0),Le(()=>a.value?.querySelector(".bcm-menu-list button, .bcm-menu-list a")?.focus())):document.removeEventListener("pointerdown",c,!0)}function h(_=!0){p(!1),_&&r.value?.focus()}function b(_){h(!0),n("select",_)}return Ge(()=>document.removeEventListener("pointerdown",c,!0)),(_,$)=>e.items.length?(d(),m("div",{key:0,ref_key:"root",ref:a,class:"bcm-menu",onKeydown:$[2]||($[2]=hf(mt(y=>h(!0),["stop"]),["esc"]))},[f("button",{ref_key:"toggle",ref:r,type:"button",class:"bcm-quiet","aria-expanded":o.value,"aria-controls":i(l),onClick:$[0]||($[0]=y=>p(!o.value))},u(e.label??i(s)("discussion.menu")),9,ib),o.value?(d(),m("div",{key:0,id:i(l),class:"bcm-menu-list"},[(d(!0),m(q,null,fe(e.items,y=>(d(),m(q,{key:y.id},[y.href?(d(),m("a",{key:0,href:y.href,class:Ke({"bcm-danger":y.danger}),onClick:$[1]||($[1]=I=>h(!1))},u(y.label),11,ab)):(d(),m("button",{key:1,type:"button",class:Ke({"bcm-danger":y.danger}),onClick:I=>b(y.id)},u(y.label),11,lb))],64))),128))],8,rb)):S("",!0)],544)):S("",!0)}}),cb=["aria-label"],ub=["aria-pressed","disabled","title","onClick"],db={key:0,class:"bcm-sr"},fb={key:1,class:"bcm-react"},ic=$e({__name:"ReactionBar",props:{reactionSet:{},summary:{},interactive:{type:Boolean},busy:{type:Boolean}},emits:["react"],setup(e,{emit:t}){const n=e,s=t,{t:o}=vt(),r=z(()=>n.interactive?n.reactionSet:n.reactionSet.filter(a=>(n.summary.counts[a]??0)>0));return(a,l)=>r.value.length?(d(),m("div",{key:0,class:"bcm-reactions",role:"group","aria-label":i(o)("discussion.reactions")},[(d(!0),m(q,null,fe(r.value,c=>(d(),m(q,{key:c},[e.interactive?(d(),m("button",{key:0,type:"button",class:"bcm-react","aria-pressed":e.summary.mine===c,disabled:e.busy,title:e.summary.mine===c?i(o)("discussion.reactionRemove"):i(o)("discussion.reactionAdd"),onClick:p=>s("react",c)},[f("span",null,u(i(o)("discussion.reactionCount",{emoji:c,count:e.summary.counts[c]??0})),1),e.summary.mine===c?(d(),m("span",db,u(i(o)("discussion.reactionMine")),1)):S("",!0)],8,ub)):(d(),m("span",fb,u(i(o)("discussion.reactionCount",{emoji:c,count:e.summary.counts[c]??0})),1))],64))),128))],8,cb)):S("",!0)}}),rc=Symbol("bcm-discussion");function ac(e){jr(rc,e)}function mb(){const e=Qs(rc,null);if(!e)throw new Error("[blogmcp-community] a discussion component rendered outside <blogmcp-discussion>");return e}const pb=["id"],hb=["aria-busy"],bb={class:"bcm-msg-main"},gb={class:"bcm-meta"},vb={class:"bcm-author"},yb={key:0,class:"bcm-badge bcm-badge-team"},_b={key:1,class:"bcm-badge bcm-badge-team"},kb={key:2,class:"bcm-handle"},wb=["datetime"],$b={key:4,class:"bcm-muted"},xb={key:5,class:"bcm-muted",role:"status"},Ib={key:0,class:"bcm-placeholder"},Tb={key:1,class:"bcm-muted"},Cb={key:0,class:"bcm-own-state bcm-own-consent"},Sb={class:"bcm-badge"},Ab={class:"bcm-hint"},Ob={key:1,class:"bcm-own-state"},Eb={class:"bcm-badge"},Mb={class:"bcm-hint"},Pb=["href"],Rb={key:3,class:"bcm-text"},Nb={key:4,class:"bcm-hint"},jb=["href"],zb={key:3,class:"bcm-actions"},Lb={key:0,class:"bcm-replies"},Db={key:2,class:"bcm-hint"},Fb=3,lc=$e({name:"MessageItem",__name:"MessageItem",props:{message:{}},setup(e){const t=e,{t:n,lang:s}=vt(),{ctl:o,routes:r,opened:a,originals:l,allReplies:c,deleteMessage:p,extraMenu:h,onExtraMenu:b}=mb(),_=z(()=>t.message),$=z(()=>_.value.replyToSeq!==null),y=z(()=>o.isOwn(_.value)),I=z(()=>_.value.body===null),R=z(()=>y.value&&_.value.state==="held"&&_.value.hiddenUntilConsent===!0),P=z(()=>o.state.me?.acceptances.art9Refused===!0),T=z(()=>R.value&&!o.onboarding.value&&o.state.refusedAge===null&&(o.mode()==="onboarding"&&o.needs().art9||P.value)),g=z(()=>{const oe=_.value.author;return oe.kind==="system"?n("author.system"):oe.kind==="staff"?oe.displayName:oe.displayName??n("author.deleted")}),k=z(()=>_.value.author.kind==="member"?_.value.author.handle:null),M=z(()=>_.value.author.kind==="member"&&"moderator"in _.value.author&&_.value.author.moderator===!0),w=z(()=>{const oe=_.value.author;if(oe.kind!=="staff")return null;const Z=`author.badge.${oe.badge}`;return Xn(Z)?n(Z):null}),v=z(()=>_.value.state==="held"?"discussion.placeholderHeld":_.value.state==="removed"?"discussion.placeholderRemoved":"discussion.placeholderDeleted"),x=z(()=>_.value.pending?void 0:Io(_.value.seq)??void 0),N=z(()=>_.value.collapsed&&!a.has(_.value.seq)),O=z(()=>l.has(_.value.seq)),E=z(()=>(_.value.isTranslated&&!O.value?_.value.displayBody:_.value.body)??_.value.displayBody),B=z(()=>(y.value?_.value.notes??[]:[]).map(oe=>$p(oe)).filter(oe=>oe!==null)),ee=z(()=>y.value?[...new Set((_.value.warnings??[]).map(oe=>kp(oe)))]:[]),re=z(()=>o.state.inline?.kind==="edit"&&o.state.inline.seq===_.value.seq),be=z(()=>!$.value&&o.state.inline?.kind==="reply"&&o.state.inline.seq===_.value.seq),we=z(()=>c.has(_.value.seq)?_.value.replies:_.value.replies.slice(0,Fb)),K=z(()=>_.value.replies.length-we.value.length),D=z(()=>({conversationId:_.value.conversationId,seq:_.value.seq})),U=z(()=>o.needs().signIn?null:r.value.profilePath),Fe=z(()=>{const oe=[],Z=_.value;if(o.canEdit(Z)&&oe.push({id:"edit",label:n("discussion.edit")}),o.canDelete(Z)&&oe.push({id:"delete",label:n("discussion.delete"),danger:!0}),o.canReport(Z))oe.push({id:"report",label:n("discussion.report")});else if(o.canReportAsNotifier(Z)){const J=Mp(r.value.reportPath,D.value);J&&oe.push({id:"report",label:n("discussion.report"),href:J})}return o.canBlock(Z)&&oe.push({id:Z.collapsed?"unblock":"block",label:Z.collapsed?n("discussion.unblock"):n("discussion.block")}),h&&oe.push(...h(Z)),oe});function je(oe){const Z=_.value;oe==="edit"?o.openEdit(Z.seq):oe==="delete"?p(Z.seq):oe==="report"?o.openReport(Z):(oe==="block"||oe==="unblock")&&Z.author.kind==="member"&&Z.author.memberId?o.setBlocked(Z.author.memberId,oe==="block"):b?.(oe,Z)}function Ue(){o.openReply(_.value.seq,$.value?g.value:null)}function Qe(oe){oe.has(_.value.seq)?oe.delete(_.value.seq):oe.add(_.value.seq)}return(oe,Z)=>{const J=ed("MessageItem",!0);return d(),m("li",{id:x.value,class:"bcm-msg-item"},[f("article",{class:Ke(["bcm-msg",{"bcm-msg-pending":!!_.value.pending}]),"aria-busy":!!_.value.pending},[Ee(Li,{author:_.value.author},null,8,["author"]),f("div",bb,[f("header",gb,[f("span",vb,u(g.value),1),w.value?(d(),m("span",yb,u(w.value),1)):S("",!0),M.value?(d(),m("span",_b,u(i(n)("role.moderator")),1)):S("",!0),k.value?(d(),m("span",kb,u(k.value),1)):S("",!0),_.value.createdAt?(d(),m("time",{key:3,class:"bcm-time",datetime:_.value.createdAt},u(i(Pe)(i(s),_.value.createdAt)),9,wb)):S("",!0),_.value.isEdited&&!I.value?(d(),m("span",$b,u(i(n)("discussion.edited")),1)):S("",!0),_.value.pending?(d(),m("span",xb,u(i(n)("discussion.pending")),1)):S("",!0)]),I.value?(d(),m("p",Ib,u(i(n)(v.value)),1)):N.value?(d(),m("p",Tb,[It(u(i(n)("discussion.collapsed"))+" ",1),f("button",{type:"button",class:"bcm-link",onClick:Z[0]||(Z[0]=W=>Qe(i(a)))},u(i(n)("discussion.show")),1)])):(d(),m(q,{key:2},[R.value?(d(),m("div",Cb,[f("span",Sb,u(i(n)("state.hiddenUntilConsent")),1),f("p",Ab,u(i(n)("discussion.hiddenUntilConsentNote")),1),T.value?(d(),m("button",{key:0,type:"button",class:"bcm-link",onClick:Z[1]||(Z[1]=W=>i(o).beginOnboarding(P.value?{offerArt9:!0}:{}))},u(i(n)("discussion.giveConsent")),1)):S("",!0)])):y.value&&(_.value.state==="held"||_.value.state==="removed")?(d(),m("div",Ob,[f("span",Eb,u(_.value.state==="held"?i(n)("state.held"):i(n)("state.removed")),1),f("p",Mb,u(_.value.state==="held"?i(n)("discussion.heldNote"):i(n)("discussion.removedNote")),1),_.value.state==="removed"?(d(),m("a",{key:0,href:i(r).myCommunityPath},u(i(n)("discussion.why")),9,Pb)):S("",!0)])):S("",!0),re.value&&i(o).state.inline?(d(),_e(Co,{key:2,kind:"edit",draft:i(o).state.inline,wait:i(o).waitLeft(i(o).state.inline),"rules-href":i(r).rulesPath,"mentions-max":i(o).mentionCap(),onSubmit:Z[2]||(Z[2]=W=>i(o).submitInline()),onCancel:Z[3]||(Z[3]=W=>i(o).closeInline()),onConfirm:Z[4]||(Z[4]=(W,pe)=>i(o).state.inline&&i(o).setConfirmed(i(o).state.inline,W,pe)),onConfirmed:Z[5]||(Z[5]=W=>i(o).state.inline&&i(o).sendConfirmed(i(o).state.inline))},null,8,["draft","wait","rules-href","mentions-max"])):(d(),m("p",Rb,[Ee(oc,{text:E.value,"profile-path":U.value},null,8,["text","profile-path"])])),_.value.isTranslated&&!re.value?(d(),m("p",Nb,[It(u(i(n)("discussion.translated"))+" ",1),f("button",{type:"button",class:"bcm-link",onClick:Z[6]||(Z[6]=W=>Qe(i(l)))},u(O.value?i(n)("discussion.showTranslation"):i(n)("discussion.showOriginal")),1)])):S("",!0),_.value.collapsed?(d(),m("button",{key:5,type:"button",class:"bcm-link",onClick:Z[7]||(Z[7]=W=>Qe(i(a)))},u(i(n)("discussion.hide")),1)):S("",!0),(d(!0),m(q,null,fe(B.value,W=>(d(),m("p",{key:W,class:"bcm-note"},[W==="note.report_to_manufacturer"&&i(r).consultationPath?(d(),m("a",{key:0,href:i(r).consultationPath},u(i(n)(W)),9,jb)):(d(),m(q,{key:1},[It(u(i(n)(W)),1)],64))]))),128)),(d(!0),m(q,null,fe(ee.value,W=>(d(),m("p",{key:W,class:"bcm-warning"},u(i(n)(W)),1))),128))],64)),!I.value&&!N.value&&!re.value?(d(),m("div",zb,[Ee(ic,{"reaction-set":i(o).state.thread.reactionSet,summary:_.value.reactions,interactive:i(o).canReact()&&!_.value.pending&&_.value.seq>0&&_.value.state==="visible",busy:!!i(o).state.busy[`react:${_.value.seq}`],onReact:Z[8]||(Z[8]=W=>i(o).react(D.value,W))},null,8,["reaction-set","summary","interactive","busy"]),i(o).canReply(_.value)?(d(),m("button",{key:0,type:"button",class:"bcm-quiet",onClick:Ue},u(i(n)("discussion.reply")),1)):S("",!0),Ee(sc,{items:Fe.value,onSelect:je},null,8,["items"])])):S("",!0),$.value?S("",!0):(d(),m(q,{key:4},[_.value.replies.length?(d(),m("ol",Lb,[(d(!0),m(q,null,fe(we.value,W=>(d(),_e(J,{key:W.id,message:W},null,8,["message"]))),128))])):S("",!0),K.value>0?(d(),m("button",{key:1,type:"button",class:"bcm-link",onClick:Z[9]||(Z[9]=W=>i(c).add(_.value.seq))},u(i(n)("discussion.showReplies",{count:K.value})),1)):S("",!0),_.value.repliesTruncated?(d(),m("p",Db,u(i(n)("discussion.repliesTruncated")),1)):S("",!0),be.value&&i(o).state.inline?(d(),_e(Co,{key:3,kind:"reply",draft:i(o).state.inline,wait:i(o).waitLeft(i(o).state.inline),"rules-href":i(r).rulesPath,"mentions-max":i(o).mentionCap(),"replying-to":i(o).state.inline.replyingTo,onSubmit:Z[10]||(Z[10]=W=>i(o).submitInline()),onCancel:Z[11]||(Z[11]=W=>i(o).closeInline()),onConfirm:Z[12]||(Z[12]=(W,pe)=>i(o).state.inline&&i(o).setConfirmed(i(o).state.inline,W,pe)),onConfirmed:Z[13]||(Z[13]=W=>i(o).state.inline&&i(o).sendConfirmed(i(o).state.inline))},null,8,["draft","wait","rules-href","mentions-max","replying-to"])):S("",!0)],64))])],10,hb)],8,pb)}}}),Ub=["aria-labelledby"],qb=["id"],Bb={key:0,class:"bcm-muted",role:"status"},Hb={class:"bcm-error",role:"alert"},Vb={class:"bcm-row"},Kb={role:"alert"},Wb={class:"bcm-row"},Yb={key:0,class:"bcm-hint"},Gb={key:1,class:"bcm-choices"},Zb=["name","value"],Jb={class:"bcm-hint bcm-full"},Xb={key:2,class:"bcm-section"},Qb={key:0,class:"bcm-rules"},eg={key:0,class:"bcm-hint"},tg=["href"],ng=["href"],og=["id"],sg=["aria-labelledby"],ig={class:"bcm-check"},rg={key:3,class:"bcm-section"},ag=["aria-label"],lg={key:0,class:"bcm-fieldset"},cg={class:"bcm-sr"},ug=["onUpdate:modelValue"],dg={key:1,class:"bcm-check"},fg={key:4,class:"bcm-section"},mg={class:"bcm-field"},pg=["for"],hg=["id","maxlength","aria-invalid","aria-describedby"],bg=["id"],gg={class:"bcm-field"},vg=["for"],yg=["id","maxlength","placeholder","aria-invalid","aria-describedby"],_g=["id"],kg={key:0,class:"bcm-hint"},wg={class:"bcm-choices"},$g={class:"bcm-choice"},xg=["name"],Ig=["name","value"],Tg={key:5,class:"bcm-error",role:"alert"},Cg={class:"bcm-row"},Sg=["disabled"],Ag=["disabled"],Og=["disabled"],So=$e({__name:"OnboardingSteps",props:{model:{},rulesHref:{},termsHref:{}},emits:["cancel"],setup(e,{emit:t}){const n=e,s=t,{t:o,lang:r}=vt(),a=n.model.state,l=Ve("bcm-onboarding"),c=ue(null),p=z(()=>n.model.step()),h=z(()=>a.steps.includes("profile")),b=z(()=>n.termsHref!==void 0?n.termsHref:Rl(n.rulesHref)),_=z(()=>{const y=a.failure;if(!y)return"";const I=bh(y,r.value);return o(I.key,I.params)}),$=y=>`onboarding.age.${y}`;return ve(()=>[a.index,a.phase,a.steps.join()],([y,I,R],[P,,T])=>{(y!==P||R!==T||I==="refused"||I==="failed")&&Le(()=>c.value?.focus())}),nt(()=>{Le(()=>c.value?.focus())}),(y,I)=>(d(),m("section",{class:"bcm-card","aria-labelledby":`${i(l)}-title`},[f("h3",{id:`${i(l)}-title`,ref_key:"heading",ref:c,tabindex:"-1"},u(i(o)("onboarding.title")),9,qb),i(a).phase==="loading"?(d(),m("p",Bb,u(i(o)("common.loading")),1)):i(a).phase==="failed"?(d(),m(q,{key:1},[f("p",Hb,u(_.value),1),f("div",Vb,[f("button",{type:"button",class:"bcm-btn",onClick:I[0]||(I[0]=R=>s("cancel"))},u(i(o)("common.cancel")),1),f("button",{type:"button",class:"bcm-btn bcm-primary",onClick:I[1]||(I[1]=R=>e.model.load())},u(i(o)("common.retry")),1)])],64)):i(a).phase==="refused"?(d(),m(q,{key:2},[f("p",Kb,u(i(o)("onboarding.ageBelow",{min:i(a).minAge??18})),1),f("div",Wb,[f("button",{type:"button",class:"bcm-btn",onClick:I[2]||(I[2]=R=>s("cancel"))},u(i(o)("common.close")),1)])],64)):(d(),m("form",{key:3,class:"bcm-form",novalidate:"",onSubmit:I[13]||(I[13]=mt(R=>e.model.next(),["prevent"]))},[i(a).index===0&&h.value?(d(),m("p",Yb,u(i(o)("onboarding.lede")),1)):S("",!0),p.value==="age"?(d(),m("fieldset",Gb,[f("legend",null,u(i(o)("onboarding.ageTitle")),1),(d(!0),m(q,null,fe(i(Kf),R=>(d(),m("label",{key:R,class:"bcm-choice"},[ge(f("input",{"onUpdate:modelValue":I[3]||(I[3]=P=>i(a).ageBand=P),type:"radio",name:`${i(l)}-age`,value:R},null,8,Zb),[[xn,i(a).ageBand]]),f("span",null,u(i(o)($(R))),1)]))),128)),f("p",Jb,u(i(o)("onboarding.ageHint")),1)])):p.value==="rules"?(d(),m("div",Xb,[f("h4",null,u(i(o)("onboarding.rulesTitle")),1),f("p",null,u(i(a).reconsent?i(o)("onboarding.rulesChanged"):i(o)("onboarding.rulesLede")),1),i(a).rules.length?(d(),m("ol",Qb,[(d(!0),m(q,null,fe(i(a).rules,R=>(d(),m("li",{key:R.id},[f("strong",null,u(R.title),1),R.summary?(d(),m("span",eg,u(R.summary),1)):S("",!0)]))),128))])):S("",!0),f("p",null,[f("a",{href:e.rulesHref,target:"_blank",rel:"noopener"},u(i(o)("onboarding.rulesLink")),9,tg),i(a).termsText&&b.value?(d(),m(q,{key:0},[I[14]||(I[14]=It(" · ",-1)),f("a",{href:b.value,target:"_blank",rel:"noopener","data-terms-link":""},u(i(o)("onboarding.termsLink")),9,ng)],64)):S("",!0)]),i(a).termsText&&!b.value?(d(),m(q,{key:1},[f("p",{id:`${i(l)}-terms`},[f("strong",null,u(i(o)("onboarding.termsLink")),1)],8,og),f("div",{class:"bcm-consent",tabindex:"0",role:"document","aria-labelledby":`${i(l)}-terms`,"data-terms-inline":""},[(d(!0),m(q,null,fe(i(a).termsParagraphs,(R,P)=>(d(),m("p",{key:P,class:"bcm-text"},u(R),1))),128))],8,sg)],64)):S("",!0),f("label",ig,[ge(f("input",{"onUpdate:modelValue":I[4]||(I[4]=R=>i(a).rulesAccepted=R),type:"checkbox"},null,512),[[os,i(a).rulesAccepted]]),f("span",null,u(i(a).termsText?i(o)("onboarding.rulesTermsAccept"):i(o)("onboarding.rulesAccept")),1)])])):p.value==="art9"?(d(),m("div",rg,[f("h4",null,u(i(o)("onboarding.art9Title")),1),f("p",null,u(e.model.refusalOffered()?i(o)("onboarding.art9LedeOptional"):i(o)("onboarding.art9Lede")),1),f("div",{class:"bcm-consent",tabindex:"0",role:"document","aria-label":i(o)("onboarding.art9Title")},[(d(!0),m(q,null,fe(i(a).art9Paragraphs,(R,P)=>(d(),m("p",{key:P,class:"bcm-text"},u(R),1))),128))],8,ag),i(a).art9Controllers.length>1?(d(),m("fieldset",lg,[f("legend",cg,u(i(o)("onboarding.art9Title")),1),(d(!0),m(q,null,fe(i(a).art9Controllers,R=>(d(),m("label",{key:R.entity,class:"bcm-check"},[ge(f("input",{"onUpdate:modelValue":P=>R.accepted=P,type:"checkbox",required:""},null,8,ug),[[os,R.accepted]]),f("span",null,u(i(o)("onboarding.art9Controller",{label:R.label})),1)]))),128))])):(d(),m("label",dg,[ge(f("input",{"onUpdate:modelValue":I[5]||(I[5]=R=>i(a).art9Accepted=R),type:"checkbox"},null,512),[[os,i(a).art9Accepted]]),f("span",null,u(i(o)("onboarding.art9Accept")),1)]))])):p.value==="profile"?(d(),m("div",fg,[f("h4",null,u(i(o)("onboarding.profileTitle")),1),f("div",mg,[f("label",{for:`${i(l)}-name`},u(i(o)("onboarding.displayName")),9,pg),ge(f("input",{id:`${i(l)}-name`,"onUpdate:modelValue":I[6]||(I[6]=R=>i(a).displayName=R),class:"bcm-input",autocomplete:"nickname",maxlength:i(Na)*2,"aria-invalid":e.model.hasFieldError("displayName"),"aria-describedby":`${i(l)}-name-hint`},null,8,hg),[[Xe,i(a).displayName]]),f("p",{id:`${i(l)}-name-hint`,class:"bcm-hint"},u(i(o)("onboarding.displayNameHint")),9,bg)]),f("div",gg,[f("label",{for:`${i(l)}-handle`},u(i(o)("onboarding.handle")),9,vg),ge(f("input",{id:`${i(l)}-handle`,"onUpdate:modelValue":I[7]||(I[7]=R=>i(a).handle=R),class:"bcm-input",autocomplete:"username",autocapitalize:"none",spellcheck:"false",maxlength:i(_s),placeholder:e.model.suggestedHandle()??"","aria-invalid":e.model.hasFieldError("handle"),"aria-describedby":`${i(l)}-handle-hint`},null,8,yg),[[Xe,i(a).handle]]),f("p",{id:`${i(l)}-handle-hint`,class:"bcm-hint"},u(i(o)("onboarding.handleHint",{min:i(Gl),max:i(_s),days:i(ja)})),9,_g),e.model.suggestedHandle()?(d(),m("p",kg,u(i(o)("onboarding.handleSuggested",{handle:e.model.suggestedHandle()??""})),1)):S("",!0)]),f("fieldset",wg,[f("legend",null,u(i(o)("onboarding.avatar")),1),f("label",$g,[ge(f("input",{"onUpdate:modelValue":I[8]||(I[8]=R=>i(a).avatarPreset=R),type:"radio",name:`${i(l)}-avatar`,value:null},null,8,xg),[[xn,i(a).avatarPreset]]),f("span",null,u(i(o)("onboarding.avatarNone")),1)]),(d(!0),m(q,null,fe(i(zi),R=>(d(),m("label",{key:R.id,class:"bcm-choice"},[ge(f("input",{"onUpdate:modelValue":I[9]||(I[9]=P=>i(a).avatarPreset=P),type:"radio",name:`${i(l)}-avatar`,value:R.id},null,8,Ig),[[xn,i(a).avatarPreset]]),f("span",null,u(R.emoji),1)]))),128))])])):S("",!0),_.value?(d(),m("p",Tg,u(_.value),1)):S("",!0),f("div",Cg,[i(a).index>0?(d(),m("button",{key:0,type:"button",class:"bcm-btn",disabled:i(a).phase==="sending",onClick:I[10]||(I[10]=R=>e.model.back())},u(i(o)("onboarding.back")),9,Sg)):S("",!0),f("button",{type:"button",class:"bcm-btn",disabled:i(a).phase==="sending",onClick:I[11]||(I[11]=R=>s("cancel"))},u(i(o)("common.cancel")),9,Ag),I[15]||(I[15]=f("span",{class:"bcm-spacer"},null,-1)),e.model.canRefuse()?(d(),m("button",{key:1,type:"button",class:"bcm-btn",onClick:I[12]||(I[12]=R=>e.model.refuse())},u(i(o)("onboarding.art9Refuse")),1)):S("",!0),f("button",{type:"submit",class:"bcm-btn bcm-primary",disabled:!e.model.canContinue()},u(i(a).phase==="sending"?i(o)("composer.sending"):e.model.isLast()?i(o)("onboarding.submit"):i(o)("onboarding.continue")),9,Og)])],32))],8,Ub))}}),Eg=["aria-labelledby"],Mg=["id"],Pg={class:"bcm-hint"},Rg={key:0},Ng=["href"],jg={class:"bcm-choices"},zg=["name","value"],Lg={key:1,class:"bcm-field"},Dg=["for"],Fg={key:0,class:"bcm-error"},Ug={key:1,class:"bcm-muted",role:"status"},qg=["id"],Bg=["value"],Hg={class:"bcm-field"},Vg=["for"],Kg=["id","aria-describedby","aria-invalid"],Wg=["id"],Yg={key:2,class:"bcm-error",role:"alert"},Gg={class:"bcm-row"},Zg=["disabled"],Jg=["disabled"],Xg={role:"status"},Qg=["href"],ev={class:"bcm-row"},cc=$e({__name:"ReportDialog",props:{report:{},myCommunityHref:{},rulesHref:{},fallbackFocus:{type:Function}},emits:["submit","close"],setup(e,{emit:t}){const n=e,s=t,{t:o,lang:r}=vt(),a=ue(null),l=Ve("bcm-report");Mi(a,()=>s("close"),n.fallbackFocus);const c=_=>`category.${_}`,p=z(()=>lt(Ze(n.report.note))),h=z(()=>!n.report.sending&&n.report.category!==""&&(n.report.category!=="rules"||n.report.ruleId!=="")&&p.value<=ss),b=z(()=>{const _=n.report.failure;if(!_)return"";const $=Ie(_,r.value);return o($.key,$.params)});return(_,$)=>(d(),m("dialog",{ref_key:"dialog",ref:a,class:"bcm-dialog","aria-labelledby":`${i(l)}-title`},[f("form",{class:"bcm-dialog-body",novalidate:"",onSubmit:$[5]||($[5]=mt(y=>h.value&&s("submit"),["prevent"]))},[f("h3",{id:`${i(l)}-title`},u(i(o)("report.title")),9,Mg),e.report.done?(d(),m(q,{key:1},[f("p",Xg,u(i(o)("report.done")),1),f("p",null,[f("a",{href:e.myCommunityHref},u(i(o)("panel.title")),9,Qg)]),f("div",ev,[$[8]||($[8]=f("span",{class:"bcm-spacer"},null,-1)),f("button",{type:"button",class:"bcm-btn bcm-primary",onClick:$[4]||($[4]=y=>s("close"))},u(i(o)("common.close")),1)])],64)):(d(),m(q,{key:0},[f("p",Pg,u(i(o)("report.lede")),1),e.rulesHref?(d(),m("p",Rg,[f("a",{href:e.rulesHref,target:"_blank",rel:"noopener"},u(i(o)("onboarding.rulesTitle")),9,Ng)])):S("",!0),f("fieldset",jg,[f("legend",null,u(i(o)("report.category")),1),(d(!0),m(q,null,fe(i(hi),y=>(d(),m("label",{key:y,class:"bcm-choice"},[ge(f("input",{"onUpdate:modelValue":$[0]||($[0]=I=>e.report.category=I),type:"radio",name:`${i(l)}-category`,value:y},null,8,zg),[[xn,e.report.category]]),f("span",null,u(i(o)(c(y))),1)]))),128))]),e.report.category==="rules"?(d(),m("div",Lg,[f("label",{for:`${i(l)}-rule`},u(i(o)("report.rule")),9,Dg),e.report.rulesFailed?(d(),m("p",Fg,u(i(o)("error.unavailable")),1)):e.report.rules===null?(d(),m("p",Ug,u(i(o)("common.loading")),1)):ge((d(),m("select",{key:2,id:`${i(l)}-rule`,"onUpdate:modelValue":$[1]||($[1]=y=>e.report.ruleId=y),class:"bcm-input",required:""},[$[6]||($[6]=f("option",{value:"",disabled:""},null,-1)),(d(!0),m(q,null,fe(e.report.rules,y=>(d(),m("option",{key:y.id,value:y.id},u(y.title),9,Bg))),128))],8,qg)),[[Gt,e.report.ruleId]])])):S("",!0),f("div",Hg,[f("label",{for:`${i(l)}-note`},u(i(o)("report.note")),9,Vg),ge(f("textarea",{id:`${i(l)}-note`,"onUpdate:modelValue":$[2]||($[2]=y=>e.report.note=y),class:"bcm-input bcm-textarea",rows:"3","aria-describedby":`${i(l)}-note-hint`,"aria-invalid":p.value>i(ss)},null,8,Kg),[[Xe,e.report.note]]),f("p",{id:`${i(l)}-note-hint`,class:"bcm-hint"},u(i(o)("report.noteHint"))+" "+u(i(o)("report.counter",{length:p.value,max:i(ss)})),9,Wg)]),b.value?(d(),m("p",Yg,u(b.value),1)):S("",!0),f("div",Gg,[$[7]||($[7]=f("span",{class:"bcm-spacer"},null,-1)),f("button",{type:"button",class:"bcm-btn",disabled:e.report.sending,onClick:$[3]||($[3]=y=>s("close"))},u(i(o)("report.cancel")),9,Zg),f("button",{type:"submit",class:"bcm-btn bcm-primary",disabled:!h.value},u(e.report.sending?i(o)("report.sending"):i(o)("report.submit")),9,Jg)])],64))],32)],8,Eg))}}),tv=["lang","aria-labelledby"],nv={class:"bcm-head"},ov=["id"],sv={key:0,class:"bcm-count"},iv={key:0,class:"bcm-muted",role:"status"},rv={key:1,class:"bcm-banner",role:"alert"},av={key:0,class:"bcm-banner",role:"status"},lv=["disabled"],cv={key:1,class:"bcm-hint",role:"status"},uv={key:2,class:"bcm-muted"},dv={key:3,class:"bcm-thread"},fv={key:4,class:"bcm-row"},mv=["disabled"],pv={class:"bcm-section"},hv={key:0,class:"bcm-hint"},bv={key:2,class:"bcm-row"},gv=["href"],vv={key:1,class:"bcm-row"},yv={key:4,class:"bcm-note"},_v={key:5,class:"bcm-section"},kv=["href"],wv={key:6,class:"bcm-note"},$v={key:7,class:"bcm-note",role:"status"},xv={key:8,class:"bcm-note"},Iv=["href"],Tv={class:"bcm-sr","aria-live":"polite"},uc=new WeakMap,Cv=$e({inheritAttrs:!1,__name:"DiscussionView",props:{articleId:{},apiBase:{},siteBase:{},lang:{},signInHref:{},routes:{},pollMs:{},transport:{type:Function},realtime:{type:Function}},setup(e){const t=e,n=Vn(),s=ue(De(t.lang,qe())),{t:o,text:r}=gt(s);ve(()=>t.lang,K=>{s.value=De(K,qe())});const a=Ve("bcm-discussion"),l=ue(null),c=ue(0),p=Vt(null),h=z(()=>ht(t.siteBase));function b(){const K=t.articleId?.trim();if(!K)return qt("article-id","[blogmcp-community] <blogmcp-discussion> needs an article-id"),null;if(h.value===null)return null;const D=bt(t.apiBase,t.transport,h.value);return D?_h({client:D,articleId:K,lang:s.value,pollMs:t.pollMs,realtime:typeof t.realtime=="function"?t.realtime:null,refusedAge:(n&&uc.get(n))??null,onAgeRefused:U=>{n&&uc.set(n,U)},onPosted:U=>n?.dispatchEvent(new CustomEvent("bcm-posted",{detail:{state:U},bubbles:!0,composed:!0}))}):null}const _=Re(new Set),$=Re(new Set),y=Re(new Set),I=ue(null),R=z(()=>Mt(t.routes)),P=z(()=>Pt(R.value,p.value?.state.me?.links,h.value??""));ac({get ctl(){return p.value},routes:P,opened:_,originals:$,allReplies:y,focusHeading:()=>l.value,deleteMessage:K=>{I.value=K}});let T=null;const g=ue(null);let k=!1;async function M(){if(k||typeof location>"u")return;k=!0;const K=xl(location.hash),D=K===null?null:Io(K);if(K===null||D===null)return;const U=x.value?.thread.messages.find(je=>je.replies.some(Ue=>Ue.seq===K));U&&y.add(U.seq),await Le();const Fe=g.value?.querySelector(`#${D}`);typeof Fe?.scrollIntoView=="function"&&Fe.scrollIntoView({block:"start"})}function w(){k=!1,p.value?.dispose(),_.clear(),$.clear(),y.clear(),I.value=null,p.value=b(),c.value+=1,p.value?.start()}nt(()=>{w(),n&&typeof IntersectionObserver<"u"&&(T=new IntersectionObserver(K=>{const D=K[K.length-1];D&&p.value?.setInView(D.isIntersecting)},{rootMargin:"200px"}),T.observe(n))}),ve(()=>[t.articleId,t.apiBase,h.value,t.transport,t.realtime,t.pollMs,s.value],()=>w()),Ge(()=>{T?.disconnect(),p.value?.dispose(),p.value=null});const v=z(()=>p.value),x=z(()=>p.value?.state??null);ve(()=>x.value?.phase,K=>{K==="ready"&&M()});const N=z(()=>p.value?.mode()??"pending"),O=ue(null);ve(N,(K,D)=>{K==="write"&&D==="onboarding"&&Le(()=>O.value?.focus()),K==="ageRefused"&&D==="onboarding"&&Le(()=>l.value?.focus())});const E=z(()=>{const K=p.value?.needs();return K?.onboarding?"need.onboarding":K?.rules?"need.reconsent_rules":"need.art9_consent"});function B(){return En(t.signInHref,typeof location>"u"?null:location.pathname)}function ee(K){const D=K.endsAt?Pe(s.value,K.endsAt):"";return K.kind==="ban"?o("sanction.ban"):K.kind==="suspension"?D?o("sanction.suspensionUntil",{date:D}):o("sanction.suspension"):D?o("sanction.restrictionUntil",{date:D}):o("sanction.restriction")}const re=z(()=>{const K=x.value?.failure;if(!K)return"";const D=Ie(K,s.value);return o(D.key,D.params)}),be=ue("");ve(()=>x.value?.announceId,()=>{be.value="";const K=r(x.value?.announcement);Le(()=>{be.value=K})});async function we(){const K=I.value;K===null||!p.value||(await p.value.remove(K),I.value=null)}return(K,D)=>v.value&&x.value&&x.value.phase!=="hidden"?(d(),m("section",{ref_key:"section",ref:g,key:c.value,class:"bcm bcm-discussion",lang:s.value,"aria-labelledby":i(a)},[f("header",nv,[f("h2",{id:i(a),ref_key:"heading",ref:l,tabindex:"-1"},u(i(o)("discussion.title")),9,ov),x.value.phase==="ready"?(d(),m("span",sv,u(i(o)("discussion.count",{count:x.value.thread.count})),1)):S("",!0)]),x.value.phase==="loading"?(d(),m("p",iv,u(i(o)("discussion.loading")),1)):x.value.phase==="failed"?(d(),m("div",rv,[f("span",null,u(re.value),1),f("button",{type:"button",class:"bcm-btn",onClick:D[0]||(D[0]=U=>v.value.refresh())},u(i(o)("common.retry")),1)])):(d(),m(q,{key:2},[Ee(ic,{"reaction-set":x.value.thread.reactionSet,summary:x.value.thread.articleReactions,interactive:v.value.canReact(),busy:!!x.value.busy["react:article"],onReact:D[1]||(D[1]=U=>v.value&&v.value.react({articleId:x.value.thread.articleId??e.articleId??""},U))},null,8,["reaction-set","summary","interactive","busy"]),x.value.newMessages?(d(),m("div",av,[f("span",null,u(i(o)("discussion.newMessages")),1),f("button",{type:"button",class:"bcm-btn",disabled:x.value.refreshing,onClick:D[2]||(D[2]=U=>v.value.refresh())},u(i(o)("discussion.refresh")),9,lv)])):S("",!0),x.value.realtimeOff?(d(),m("p",cv,u(i(o)("realtime.off")),1)):S("",!0),x.value.thread.messages.length===0?(d(),m("p",uv,u(i(o)("discussion.empty")),1)):(d(),m("ol",dv,[(d(!0),m(q,null,fe(x.value.thread.messages,U=>(d(),_e(lc,{key:U.id,message:U},null,8,["message"]))),128))])),x.value.thread.nextCursor!==null?(d(),m("div",fv,[f("button",{type:"button",class:"bcm-btn",disabled:x.value.loadingMore,onClick:D[3]||(D[3]=U=>v.value.loadMore())},u(i(o)("discussion.loadMore")),9,mv)])):S("",!0),f("div",pv,[N.value==="write"&&x.value.art9RefusedNote?(d(),m("p",hv,u(i(o)("onboarding.art9RefusedDone")),1)):S("",!0),N.value==="write"?(d(),_e(Co,{key:1,ref_key:"composer",ref:O,kind:"new",draft:x.value.composer,wait:v.value.waitLeft(x.value.composer),"rules-href":P.value.rulesPath,"mentions-max":v.value.mentionCap(),onSubmit:D[4]||(D[4]=U=>v.value.submit()),onConfirm:D[5]||(D[5]=(U,Fe)=>v.value&&v.value.setConfirmed(x.value.composer,U,Fe)),onConfirmed:D[6]||(D[6]=U=>v.value.sendConfirmed(x.value.composer))},null,8,["draft","wait","rules-href","mentions-max"])):N.value==="signIn"?(d(),m("div",bv,[f("p",null,u(i(o)("discussion.signInPrompt")),1),B()?(d(),m("a",{key:0,class:"bcm-btn bcm-primary",href:B()??void 0},u(i(o)("common.signIn")),9,gv)):S("",!0)])):N.value==="onboarding"?(d(),m(q,{key:3},[v.value.onboarding.value?(d(),_e(So,{key:0,model:v.value.onboarding.value,"rules-href":P.value.rulesPath,"terms-href":P.value.termsPath,onCancel:D[7]||(D[7]=U=>v.value.cancelOnboarding())},null,8,["model","rules-href","terms-href"])):(d(),m("div",vv,[f("p",null,u(i(o)(E.value)),1),f("button",{type:"button",class:"bcm-btn bcm-primary",onClick:D[8]||(D[8]=U=>v.value.beginOnboarding())},u(i(o)("onboarding.continue")),1)]))],64)):N.value==="ageRefused"?(d(),m("p",yv,u(i(o)("onboarding.ageBelow",{min:x.value.refusedAge??18})),1)):N.value==="sanction"?(d(),m("div",_v,[(d(!0),m(q,null,fe(x.value.thread.viewer.restrictions,U=>(d(),m("p",{key:U.decisionId,class:"bcm-note"},[It(u(ee(U))+" ",1),i(Jn)(P.value.statementPath,U.decisionId)?(d(),m("a",{key:0,href:i(Jn)(P.value.statementPath,U.decisionId)??void 0},u(i(o)("sanction.statement")),9,kv)):S("",!0)]))),128))])):N.value==="notMoved"?(d(),m("p",wv,u(i(o)("error.notMoved")),1)):N.value==="braked"?(d(),m("p",$v,u(i(o)("state.braked")),1)):N.value==="restricted"?(d(),m("p",xv,[It(u(i(o)("error.restricted"))+" ",1),f("a",{href:P.value.myCommunityPath},u(i(o)("panel.title")),9,Iv)])):S("",!0)])],64)),f("p",Tv,u(be.value),1),x.value.report?(d(),_e(cc,{key:3,report:x.value.report,"my-community-href":P.value.myCommunityPath,"rules-href":P.value.rulesPath,"fallback-focus":()=>l.value,onSubmit:D[9]||(D[9]=U=>v.value.submitReport()),onClose:D[10]||(D[10]=U=>v.value.closeReport())},null,8,["report","my-community-href","rules-href","fallback-focus"])):S("",!0),I.value!==null?(d(),_e(ws,{key:4,title:"discussion.deleteTitle",explain:"discussion.deleteExplain",confirm:"discussion.deleteConfirm",danger:"",busy:!!x.value.busy[`delete:${I.value}`],"fallback-focus":()=>l.value,onConfirm:D[11]||(D[11]=U=>we()),onCancel:D[12]||(D[12]=U=>I.value=null)},null,8,["busy","fallback-focus"])):S("",!0)],8,tv)):S("",!0)}}),Sv=25;function $s(e){const{client:t,target:n,lang:s}=e,o=$o(n),r=new AbortController,a={signal:r.signal};let l=!1;const c=Re({phase:"idle",following:!1,busy:!1,failure:null,announcement:null,announceId:0}),p=b=>{c.announcement=b,c.announceId+=1};async function h(){let b=null,_=0;for(let $=0;$<Sv;$++){const y=await t.me.follows.list(b===null?{}:{cursor:b},a);if(!y.ok)return y;for(const I of y.value.follows)if($o(I)===o)return!0;if(_+=y.value.follows.length,b=y.value.nextCursor,b===null||_>=Pf)return!1}return!1}return{state:c,async load(b){if(c.failure=null,o===null){c.phase="unavailable";return}if(typeof b=="boolean"){c.following=b,c.phase="ready";return}c.phase="loading";const _=await h();if(!l){if(typeof _=="boolean"){c.following=_,c.phase="ready";return}c.phase=_.code==="signIn"?"signIn":"failed",c.failure=_}},sync(b){!c.busy&&c.phase==="ready"&&(c.following=b)},async toggle(){if(c.busy||c.phase!=="ready"||o===null)return;const b=!c.following;c.busy=!0,c.failure=null;const _=await t.me.follows.set({target:n,following:b},a);if(c.busy=!1,!l){if(_.ok){c.following=_.value.following,p({key:_.value.following?"follow.followed":"follow.unfollowed"});return}if(b&&_.code==="notFound"){c.phase="unavailable",p({key:"follow.unavailable"});return}if(_.code==="signIn"){c.phase="signIn";return}c.failure=_,p(Ie(_,s))}},dispose(){l=!0,r.abort()}}}const Av={class:"bcm-follow"},Ov=["aria-pressed","disabled"],Ev={key:1,class:"bcm-muted"},Mv={class:"bcm-sr","aria-live":"polite"},xs=$e({__name:"FollowToggle",props:{ctl:{}},setup(e){const t=e,{t:n,text:s}=vt(),o=ue("");return ve(()=>t.ctl.state.announceId,()=>{o.value=s(t.ctl.state.announcement)}),(r,a)=>(d(),m("span",Av,[e.ctl.state.phase==="ready"?(d(),m("button",{key:0,type:"button",class:"bcm-btn bcm-small","aria-pressed":e.ctl.state.following,disabled:e.ctl.state.busy,onClick:a[0]||(a[0]=l=>e.ctl.toggle())},u(e.ctl.state.following?i(n)("follow.following"):i(n)("follow.follow")),9,Ov)):e.ctl.state.phase==="unavailable"?(d(),m("span",Ev,u(i(n)("follow.unavailable")),1)):S("",!0),f("span",Mv,u(o.value),1)]))}}),Pv=["lang"],Rv=$e({inheritAttrs:!1,__name:"FollowButtonView",props:{targetKind:{},targetId:{},following:{type:[String,Boolean],default:void 0},apiBase:{},siteBase:{},lang:{},transport:{}},setup(e){const t=e,n=ue(De(t.lang,qe()));gt(n);const s=Vt(null);function o(){const a=t.following;return a===!0||a==="true"||a===""?!0:a===!1||a==="false"?!1:null}function r(){s.value?.dispose(),s.value=null;const a=ml(t.targetKind,t.targetId);if(a===null){qt("follow-target",'[blogmcp-community] <blogmcp-follow-button> needs target-kind ("conversation" or "category") and a target-id');return}const l=ht(t.siteBase),c=l===null?null:bt(t.apiBase,t.transport,l);c&&(s.value=$s({client:c,target:a,lang:n.value}),s.value.load(o()))}return nt(r),ve(()=>[t.targetKind,t.targetId,t.apiBase,t.siteBase,t.transport],r),ve(()=>t.following,()=>{const a=o();a!==null&&s.value?.sync(a)}),ve(()=>t.lang,a=>{n.value=De(a,qe())}),Ge(()=>s.value?.dispose()),(a,l)=>s.value&&(s.value.state.phase==="ready"||s.value.state.phase==="unavailable")?(d(),m("div",{key:0,class:"bcm-follow-host",lang:n.value},[Ee(xs,{ctl:s.value},null,8,["ctl"])],8,Pv)):S("",!0)}});function Is(e,t=Date.now()){const n=e?.module;if(!n)return{away:!1,paused:null,readOnly:!1};const s=Yn(n.state)?n.state:"dark",o=bl(n,"forum")?.brake??null,r=o!==null&&Date.parse(o.until)>t;return{away:ip(n,t)!==null,paused:n.brake!==void 0||s==="braked"?"module":r?"forum":null,readOnly:s==="read_only"}}const Di=e=>e==="module"?"state.braked":e==="forum"?"state.forumBraked":null;function Nv(e){const t=(e?.needs??[]).filter(Wn);return!t.includes("sign_in")&&(t.includes("onboarding")||t.includes("reconsent_rules"))?"join":"signIn"}const dc=e=>!!e?.member&&!e.needs.includes("sign_in"),fc=()=>({title:"",body:"",sending:!1,failure:null,confirm:null,waitUntil:null,clientMsgId:null});function jv(e){const{client:t,lang:n}=e,s=e.slug.trim().toLowerCase(),o=e.now??Date.now,r=new AbortController,a={signal:r.signal};let l=!1,c=0,p=null;const h=Vt(null),b=Re({phase:"loading",failure:null,me:null,category:null,header:null,items:[],nextCursor:null,sort:"activity",loadingMore:!1,sorting:!1,composer:fc(),created:null,creationClosed:!1,brakedBy:null,clock:o(),announcement:null,announceId:0}),_=v=>{b.announcement=v,b.announceId+=1};function $(v){b.failure=v,v.code==="surfaceOff"?b.phase="hidden":v.code==="membersOnly"?b.phase="membersOnly":v.code==="notFound"?b.phase="notFound":b.phase!=="ready"?b.phase="failed":_(Ie(v,n))}async function y(v){const x=await t.forum.topics.list({categorySlug:s,sort:b.sort,limit:za},a);return l||v!==c?!1:x.ok?(b.header={...x.value.category},b.items=$i(x.value.items),b.nextCursor=x.value.nextCursor,!0):($(x),!1)}async function I(){const v=++c;b.phase="loading",b.failure=null;const[x,N,O]=await Promise.all([t.me.get(a),t.forum.categories.list(a),y(v)]);l||v!==c||(x.ok&&(b.me=x.value),N.ok&&(b.category=N.value.categories.find(E=>E.slug===s)??null),b.brakedBy=null,O&&(b.phase="ready"))}function R(){b.clock=o(),!p&&(p=setInterval(()=>{b.clock=o();const v=b.composer;v.waitUntil!==null&&v.waitUntil<=b.clock&&(v.waitUntil=null,v.failure&&(v.failure.code==="fast"||v.failure.code==="quota")&&(v.failure=null)),v.waitUntil===null&&p&&(clearInterval(p),p=null)},1e3))}const P=()=>{const v=b.composer;return v.waitUntil===null?0:Math.max(0,Math.ceil((v.waitUntil-Math.max(b.clock,o()))/1e3))},T=()=>(b.category?.kind??b.header?.kind)==="topics";function g(){if(!T()||!dc(b.me))return null;if(b.category?.topicCreation!=="members"||b.creationClosed)return"team";const v=Is(b.me,o());return b.brakedBy!==null||v.paused!==null?"paused":v.readOnly?"readOnly":null}const k=()=>b.phase==="ready"&&T()&&dc(b.me)&&b.category?.topicCreation==="members"&&g()===null;function M(v={}){if(h.value||l)return;const x=ks({client:t,lang:n,signal:r.signal,forceArt9:v.forceArt9!==!1,onDone:N=>{b.me=N,h.value=null,b.composer.failure?.code==="onboarding"&&(b.composer.failure=null),_({key:x.state.art9RefusedSent?"onboarding.art9RefusedDone":"onboarding.done"})},onSignIn:()=>{h.value=null,I()}});h.value=x,x.load()}async function w(v){const x=b.composer;if(x.sending||P()>0||l||!b.category)return;const N=ki(x.title),O=Ze(x.body);if(N===null||O===""||lt(O)>In)return;x.sending=!0,x.failure=null;const E=x.clientMsgId??=as(),B=await t.forum.topics.create({categoryId:b.category.id,title:N,body:O,clientMsgId:E,languageCode:n,...v?{confirmations:v}:{}},a);if(!l){if(x.sending=!1,B.ok){const ee=B.value.message.state==="held";b.composer=fc(),b.created={conversationId:B.value.topic.conversationId,held:ee},_({key:ee?"topic.createdHeld":"topic.created"}),e.onCreated?.(b.created);const re=++c;await y(re);return}switch(x.failure=B,Hl(B.code)){case"confirm":B.codes&&B.codes.length>0&&(x.confirm={codes:[...B.codes],checked:[]});return;case"wait":x.waitUntil=Ni(B,o()),x.waitUntil!==null&&R(),B.code==="braked"&&(b.brakedBy=B.surface==="forum"?"forum":"module");return;case"onboard":M({forceArt9:!0});return;default:if(B.code==="topicCreationClosed")b.creationClosed=!0;else if(B.code==="membersOnly"||B.code==="surfaceOff"||B.code==="notFound")$(B);else if(B.code==="readOnly"||B.code==="signIn"||B.code==="restricted"||B.code==="suspended"||B.code==="terminated"){const ee=await t.me.get(a);!l&&ee.ok&&(b.me=ee.value)}}}}return{state:b,onboarding:h,load:I,async loadMore(){if(b.loadingMore||b.nextCursor===null||b.phase!=="ready")return;const v=c;b.loadingMore=!0;const x=await t.forum.topics.list({categorySlug:s,sort:b.sort,cursor:b.nextCursor,limit:za},a);if(b.loadingMore=!1,l||v!==c)return;if(!x.ok)return $(x);const N=new Set(b.items.map(O=>O.conversationId));b.items=[...b.items,...$i(x.value.items).filter(O=>!N.has(O.conversationId))],b.nextCursor=x.value.nextCursor},async setSort(v){if(b.sort===v||b.phase!=="ready")return;b.sort=v;const x=++c;b.sorting=!0,await y(x),x===c&&(b.sorting=!1)},canCreate:k,notCreating:g,create:()=>w(),setConfirmed(v,x){const N=b.composer.confirm;if(!N||!N.codes.includes(v))return;const O=N.checked.filter(E=>E!==v);N.checked=x?[...O,v]:O},async sendConfirmed(){const v=b.composer.confirm;!v||!v.codes.every(x=>v.checked.includes(x))||await w([...v.codes])},beginOnboarding:M,cancelOnboarding(){h.value=null},waitLeft:P,dispose(){l=!0,r.abort(),p&&clearInterval(p),p=null,h.value=null}}}const mc=Object.freeze({"composer.label":"forumText.composer.label","composer.editLabel":"forumText.composer.editLabel","composer.placeholder":"forumText.composer.placeholder","composer.tooLong":"forumText.composer.tooLong","composer.linksNote":"forumText.composer.linksNote","composer.posted":"forumText.composer.posted","composer.held":"forumText.composer.held","composer.cooldown":"forumText.composer.cooldown","discussion.empty":"forumText.discussion.empty","discussion.deleteTitle":"forumText.discussion.deleteTitle","discussion.deleteExplain":"forumText.discussion.deleteExplain","discussion.collapsed":"forumText.discussion.collapsed","discussion.heldNote":"forumText.discussion.heldNote","discussion.hiddenUntilConsentNote":"forumText.discussion.hiddenUntilConsentNote","discussion.removedNote":"forumText.discussion.removedNote","discussion.placeholderHeld":"forumText.discussion.placeholderHeld","discussion.placeholderRemoved":"forumText.discussion.placeholderRemoved","discussion.placeholderDeleted":"forumText.discussion.placeholderDeleted","report.title":"forumText.report.title","report.category":"forumText.report.category","error.links":"forumText.error.links","error.blocked":"forumText.error.blocked","error.confirm":"forumText.error.confirm","confirm.other":"forumText.confirm.other","warning.identifier":"forumText.warning.identifier","warning.other":"forumText.warning.other","need.onboarding":"forumText.need.onboarding","need.art9_consent":"forumText.need.art9_consent"}),zv={key:0,class:"bcm-note",role:"status"},Lv={key:1,class:"bcm-note",role:"status"},Dv={key:2,class:"bcm-note",role:"status"},Fi=$e({__name:"ForumNotices",props:{me:{},now:{}},setup(e){const t=e,{t:n}=vt(),s=z(()=>Is(t.me,t.now)),o=z(()=>Di(s.value.paused));return(r,a)=>(d(),m(q,null,[o.value?(d(),m("p",zv,u(i(n)(o.value)),1)):s.value.readOnly?(d(),m("p",Lv,u(i(n)("error.readOnly")),1)):S("",!0),s.value.away?(d(),m("p",Dv,u(i(n)("state.away")),1)):S("",!0)],64))}}),Fv={class:"bcm-section"},Uv={class:"bcm-note"},qv={key:1,class:"bcm-row"},Bv={key:2,class:"bcm-row"},Hv=["href"],Ts=$e({__name:"MembersOnly",props:{failure:{},client:{},lang:{},signInHref:{},rulesHref:{},termsHref:{}},emits:["joined"],setup(e,{emit:t}){const n=e,s=t,{t:o}=vt(),r=z(()=>Nv(n.failure)),a=Vt(null),l=new AbortController;Ge(()=>l.abort());function c(){return En(n.signInHref,typeof location>"u"?null:location.pathname)}function p(){if(a.value)return;const h=ks({client:n.client,lang:n.lang,signal:l.signal,onDone:()=>{a.value=null,s("joined")},onSignIn:()=>{a.value=null}});a.value=h,h.load()}return(h,b)=>(d(),m("div",Fv,[f("p",Uv,u(i(o)("error.membersOnly")),1),a.value?(d(),_e(So,{key:0,model:a.value,"rules-href":e.rulesHref,"terms-href":e.termsHref,onCancel:b[0]||(b[0]=_=>a.value=null)},null,8,["model","rules-href","terms-href"])):r.value==="join"?(d(),m("div",qv,[f("button",{type:"button",class:"bcm-btn bcm-primary",onClick:p},u(i(o)("forum.join")),1)])):c()?(d(),m("div",Bv,[f("a",{class:"bcm-btn bcm-primary",href:c()??void 0},u(i(o)("common.signIn")),9,Hv)])):S("",!0)]))}}),Vv={class:"bcm-topic-row"},Kv={class:"bcm-topic-title"},Wv=["href"],Yv={class:"bcm-row bcm-muted"},Gv={key:0,class:"bcm-badge"},Zv={key:1,class:"bcm-badge"},Jv={key:2,class:"bcm-badge"},Xv={key:3},Qv=["datetime"],ey={class:"bcm-topic-title"},ty=["href"],ny={key:1},oy={class:"bcm-row bcm-muted"},sy=["datetime"],pc=$e({__name:"TopicRow",props:{item:{},topicHref:{},articleHref:{},follow:{}},setup(e){const t=e,{t:n,lang:s}=vt(),o=z(()=>t.item.kind==="topic"?ms(t.item):null),r=z(()=>{const h=o.value;return h?h.kind==="shown"?h.text:n(h.kind==="deleted"?"topic.deleted":"topic.withheld"):""}),a=z(()=>t.item.kind==="topic"?xo(t.topicHref,t.item.conversationId):null),l=z(()=>t.item.kind==="article"?Il(t.articleHref,t.item.articleSlug):null),c=z(()=>t.item.kind!=="topic"?null:t.item.state==="locked"?"topic.locked":t.item.state==="archived"?"topic.archived":null),p=z(()=>{if(t.item.kind!=="topic")return null;const h=t.item.author;return h.kind==="member"?"displayName"in h&&h.displayName?h.displayName:n("author.deleted"):h.kind==="staff"&&"displayName"in h?h.displayName:null});return(h,b)=>(d(),m("li",Vv,[e.item.kind==="topic"?(d(),m(q,{key:0},[f("p",Kv,[a.value?(d(),m("a",{key:0,href:a.value,class:Ke({"bcm-placeholder":o.value?.kind!=="shown"})},u(r.value),11,Wv)):(d(),m("span",{key:1,class:Ke({"bcm-placeholder":o.value?.kind!=="shown"})},u(r.value),3))]),f("p",Yv,[e.item.pinned?(d(),m("span",Gv,u(i(n)("topic.pinned")),1)):S("",!0),c.value?(d(),m("span",Zv,u(i(n)(c.value)),1)):S("",!0),e.item.openingState==="held"&&o.value?.kind==="shown"?(d(),m("span",Jv,u(i(n)("state.held")),1)):S("",!0),p.value?(d(),m("span",Xv,u(p.value),1)):S("",!0),f("span",null,u(i(n)("topic.count",{count:e.item.count})),1),f("time",{datetime:e.item.lastActivityAt},u(i(n)("forum.lastActivity",{date:i(Pe)(i(s),e.item.lastActivityAt)})),9,Qv)])],64)):(d(),m(q,{key:1},[f("p",ey,[l.value?(d(),m("a",{key:0,href:l.value},u(e.item.articleTitle??i(n)("search.inArticle")),9,ty)):(d(),m("span",ny,u(e.item.articleTitle??i(n)("search.inArticle")),1))]),f("p",oy,[f("span",null,u(i(n)("discussion.count",{count:e.item.count})),1),f("time",{datetime:e.item.lastActivityAt},u(i(n)("forum.lastActivity",{date:i(Pe)(i(s),e.item.lastActivityAt)})),9,sy),e.follow?(d(),_e(xs,{key:0,ctl:e.follow},null,8,["ctl"])):S("",!0)])],64))]))}}),iy=["lang","aria-labelledby"],ry={class:"bcm-row"},ay=["href"],ly=["id"],cy=["id"],uy=["id"],dy={key:3,class:"bcm-banner",role:"alert"},fy=["id"],my={class:"bcm-head"},py=["id"],hy={key:0,class:"bcm-text"},by={key:1,class:"bcm-hint"},gy={key:2,class:"bcm-row"},vy=["for"],yy=["id","value","disabled"],_y={value:"activity"},ky={value:"new"},wy={key:3,class:"bcm-muted"},$y=["aria-busy"],xy={key:5,class:"bcm-row"},Iy=["disabled"],Ty=["aria-labelledby"],Cy={key:0,class:"bcm-note"},Sy=["href"],Ay={key:1,class:"bcm-new-topic"},Oy=["id"],Ey={key:2,class:"bcm-hint"},My={key:3,class:"bcm-note",role:"status"},Py={class:"bcm-sr","aria-live":"polite"},Ry=$e({inheritAttrs:!1,__name:"ForumCategoryView",props:{slug:{},apiBase:{},siteBase:{},lang:{},routes:{},signInHref:{},transport:{type:Function}},setup(e){const t=e,n=Vn(),s=ue(De(t.lang,qe())),{t:o,text:r}=gt(s,mc),a=Ve("bcm-category"),l=ht(t.siteBase),c=l===null?null:bt(t.apiBase,t.transport,l);function p(){const E=t.slug?.trim();return E?c?jv({client:c,slug:E,lang:s.value,onCreated:B=>n?.dispatchEvent(new CustomEvent("bcm-topic-created",{detail:{conversationId:B.conversationId,state:B.held?"held":"visible"},bubbles:!0,composed:!0}))}):null:(qt("category-slug","[blogmcp-community] <blogmcp-forum-category> needs a slug"),null)}const h=Vt(null),b=z(()=>h.value?.state??null),_=z(()=>Pt(Mt(t.routes),b.value?.me?.links,l??"")),$=Vt(null),y=new Map;function I(){$.value?.dispose(),$.value=null;for(const E of y.values())E.dispose();y.clear()}function R(){h.value?.dispose(),I(),h.value=p(),h.value?.load()}nt(R),ve(()=>[t.slug,s.value],R),ve(()=>t.lang,E=>{s.value=De(E,qe())}),Ge(()=>{h.value?.dispose(),I()}),ve(()=>b.value?.category,E=>{!E||!c||($.value||($.value=$s({client:c,target:{categoryId:E.id},lang:s.value})),$.value.state.phase==="idle"?$.value.load(E.following):$.value.sync(E.following))}),ve(()=>b.value?.items,E=>{if(!(!E||!c))for(const B of E){if(B.kind!=="article")continue;const ee=$o({conversationId:B.conversationId});if(ee===null||y.has(ee))continue;const re=$s({client:c,target:{conversationId:B.conversationId},lang:s.value});y.set(ee,re),re.load(B.following)}});function P(E){if(E.kind!=="article")return null;const B=$o({conversationId:E.conversationId});return B===null?null:y.get(B)??null}const T=z(()=>b.value?.category?.name??b.value?.header?.name??""),g=z(()=>(b.value?.category?.kind??b.value?.header?.kind)==="article_discussions"),k=z(()=>h.value?.notCreating()??null),M=z(()=>b.value&&Is(b.value.me).paused===null?Di(b.value.brakedBy):null),w=z(()=>b.value?.created?xo(_.value.topicPath,b.value.created.conversationId):null),v=z(()=>{const E=b.value?.failure;if(!E)return"";const B=Ie(E,s.value);return o(B.key,B.params)});function x(E){h.value?.setSort(E.target.value)}const N=ue(null);ve(()=>h.value?.onboarding.value??null,(E,B)=>{E===null&&B?.state.phase==="done"&&Le(()=>N.value?.focus())});const O=ue("");return ve(()=>b.value?.announceId,()=>{O.value="";const E=r(b.value?.announcement);Le(()=>{O.value=E})}),(E,B)=>h.value&&b.value&&b.value.phase!=="hidden"?(d(),m("section",{key:0,class:"bcm bcm-forum-category",lang:s.value,"aria-labelledby":`${i(a)}-title`},[f("nav",ry,[f("a",{href:_.value.forumPath},u(i(o)("forum.back")),9,ay)]),b.value.phase==="loading"?(d(),m("p",{key:0,id:`${i(a)}-title`,class:"bcm-muted",role:"status"},u(i(o)("forum.loading")),9,ly)):b.value.phase==="membersOnly"&&i(c)?(d(),m("div",{key:1,id:`${i(a)}-title`},[Ee(Ts,{failure:b.value.failure,client:i(c),lang:s.value,"sign-in-href":e.signInHref,"rules-href":_.value.rulesPath,"terms-href":_.value.termsPath,onJoined:B[0]||(B[0]=ee=>h.value.load())},null,8,["failure","client","lang","sign-in-href","rules-href","terms-href"])],8,cy)):b.value.phase==="notFound"?(d(),m("p",{key:2,id:`${i(a)}-title`,class:"bcm-note"},u(i(o)("forumCategory.notFound")),9,uy)):b.value.phase==="failed"?(d(),m("div",dy,[f("span",{id:`${i(a)}-title`},u(v.value),9,fy),f("button",{type:"button",class:"bcm-btn",onClick:B[1]||(B[1]=ee=>h.value.load())},u(i(o)("common.retry")),1)])):b.value.phase==="ready"?(d(),m(q,{key:4},[f("header",my,[f("h2",{id:`${i(a)}-title`},u(T.value),9,py),$.value?(d(),_e(xs,{key:0,ctl:$.value},null,8,["ctl"])):S("",!0)]),b.value.category?.description?(d(),m("p",hy,u(b.value.category.description),1)):S("",!0),Ee(Fi,{me:b.value.me},null,8,["me"]),b.value.category?.mode==="pre"?(d(),m("p",by,u(i(o)("forum.modePre")),1)):S("",!0),g.value?S("",!0):(d(),m("div",gy,[f("label",{for:`${i(a)}-sort`},u(i(o)("forumCategory.sort")),9,vy),f("select",{id:`${i(a)}-sort`,class:"bcm-input bcm-select",value:b.value.sort,disabled:b.value.sorting,onChange:x},[f("option",_y,u(i(o)("forumCategory.sortActivity")),1),f("option",ky,u(i(o)("forumCategory.sortNew")),1)],40,yy)])),b.value.items.length===0?(d(),m("p",wy,u(g.value?i(o)("forumCategory.articlesEmpty"):i(o)("forumCategory.empty")),1)):(d(),m("ul",{key:4,class:"bcm-topics","aria-busy":b.value.sorting},[(d(!0),m(q,null,fe(b.value.items,ee=>(d(),_e(pc,{key:ee.conversationId,item:ee,"topic-href":_.value.topicPath,"article-href":_.value.articlePath,follow:P(ee)},null,8,["item","topic-href","article-href","follow"]))),128))],8,$y)),b.value.nextCursor!==null?(d(),m("div",xy,[f("button",{type:"button",class:"bcm-btn",disabled:b.value.loadingMore,onClick:B[2]||(B[2]=ee=>h.value.loadMore())},u(i(o)("discussion.loadMore")),9,Iy)])):S("",!0),g.value?S("",!0):(d(),m("section",{key:6,class:"bcm-section","aria-labelledby":`${i(a)}-new`},[b.value.created?(d(),m("p",Cy,[It(u(b.value.created.held?i(o)("topic.createdHeld"):i(o)("topic.created"))+" ",1),w.value?(d(),m("a",{key:0,href:w.value},u(i(o)("topic.open")),9,Sy)):S("",!0)])):S("",!0),h.value.canCreate()?(d(),m("div",Ay,[f("h3",{id:`${i(a)}-new`},u(i(o)("forumCategory.newTopic")),9,Oy),h.value.onboarding.value?(d(),_e(So,{key:0,model:h.value.onboarding.value,"rules-href":_.value.rulesPath,"terms-href":_.value.termsPath,onCancel:B[3]||(B[3]=ee=>h.value.cancelOnboarding())},null,8,["model","rules-href","terms-href"])):(d(),_e(Co,{key:1,ref_key:"composerRef",ref:N,kind:"topic",draft:b.value.composer,wait:h.value.waitLeft(),"rules-href":_.value.rulesPath,onSubmit:B[4]||(B[4]=ee=>h.value.create()),onConfirm:B[5]||(B[5]=(ee,re)=>h.value&&h.value.setConfirmed(ee,re)),onConfirmed:B[6]||(B[6]=ee=>h.value.sendConfirmed())},null,8,["draft","wait","rules-href"]))])):k.value==="team"?(d(),m("p",Ey,u(i(o)("forum.teamTopics")),1)):k.value==="paused"&&M.value?(d(),m("p",My,u(i(o)(M.value)),1)):S("",!0)],8,Ty))],64)):S("",!0),f("p",Py,u(O.value),1)],8,iy)):S("",!0)}}),hc=4e3,Ny=20;function jy(e){const{client:t,lang:n}=e,s=new AbortController,o={signal:s.signal};let r=!1,a=0;const l=Re({phase:"loading",failure:null,me:null,categoryId:e.categoryId?.toLowerCase()??"",categories:[],items:[],nextCursor:null,loadingMore:!1,rules:null,open:null,review:null,announcement:null,announceId:0}),c=g=>{l.announcement=g,l.announceId+=1},p=()=>[...l.me?.moderator?.categoryIds??[]].map(g=>g.toLowerCase());function h(g){l.items=l.items.filter(k=>k!==g),c({key:"moderation.gone"})}const b=g=>({...l.categoryId!==""?{categoryId:l.categoryId}:{},...g?{cursor:g}:{}});async function _(g){const k=await t.moderation.queue(b(null),o);if(!(r||g!==a)){if(!k.ok){l.failure=k,l.phase=k.code==="notFound"?"none":k.code==="surfaceOff"?"hidden":k.code==="membersOnly"?"membersOnly":"failed";return}l.items=[...k.value.items],l.nextCursor=k.value.nextCursor,l.phase="ready"}}async function $(){if(l.rules!==null)return;const g=await t.legal.current({kind:"rules",locale:n},o);!r&&g.ok&&(l.rules=Gn(g.value.bodyJson))}async function y(){const g=++a;l.phase="loading",l.failure=null;const k=await t.me.get(o);if(r||g!==a)return;if(!k.ok){l.failure=k,l.phase="failed";return}if(l.me=k.value,p().length===0){l.phase="none";return}const M=await t.forum.categories.list(o);r||g!==a||(M.ok&&(l.categories=M.value.categories.filter(w=>p().includes(w.id.toLowerCase()))),$(),l.categoryId!==""&&!p().includes(l.categoryId)&&(l.categoryId=""),await _(g))}const I=g=>{const k=l.open;return{caseId:k.item.caseId,restriction:k.restriction,basis:k.item.source==="member_report"?"notice":"own_initiative",facts:Ze(k.facts),...k.ground!==""?{contractualGround:k.ground}:{},locale:n,dryRun:g}};function R(){const g=l.open;if(!g||!g.kase||g.restriction===""||g.previewing||g.deciding||g.decided)return!1;const k=Ze(g.facts);return k===""||lt(k)>hc?!1:g.restriction==="no_action"||g.ground!==""||g.kase.ruleId!==null&&!g.needsRule}async function P(g){const k=w=>w.kind==="premod"&&w.conversationId===g.item.conversationId&&w.seq===g.item.seq;let M=null;for(let w=0;w<Ny;w++){const v=await t.moderation.queue(b(M),o);if(r||l.review!==g||!v.ok)return;const x=v.value.items.find(k);if(x){if(x.rev===g.item.rev)return;l.items=l.items.map(N=>k(N)?x:N),g.item=x,g.failure=null,g.changed=!0,c({key:"moderation.textChanged"});return}if(M=v.value.nextCursor,M===null)break}l.review=null,h(g.item)}function T(g,k){if(g.failure=k,k.code==="invalid"&&k.fields?.includes("contractualGround")){g.needsRule=!0,$();return}k.code==="notFound"&&(l.open=null,h(g.item))}return{state:l,load:y,async loadMore(){if(l.loadingMore||l.nextCursor===null||l.phase!=="ready")return;const g=a;l.loadingMore=!0;const k=await t.moderation.queue(b(l.nextCursor),o);if(l.loadingMore=!1,!(r||g!==a)){if(!k.ok)return c(Ie(k,n));l.items=[...l.items,...k.value.items],l.nextCursor=k.value.nextCursor}},async setCategory(g){const k=g.toLowerCase();if(k===l.categoryId||k!==""&&!p().includes(k))return;l.categoryId=k;const M=++a;await _(M)},async openCase(g){if(g.kind!=="case"||!g.caseId)return;l.review=null,l.open={item:g,kase:null,loading:!0,restriction:"",facts:"",ground:"",needsRule:!1,preview:null,previewing:!1,deciding:!1,failure:null,decided:!1,escalation:null};const k=l.open;$();const M=await t.moderation.getCase({caseId:g.caseId},o);r||l.open!==k||(k.loading=!1,M.ok?k.kase=M.value.case:T(k,M))},closeCase(){l.open=null},canPreview:R,async preview(){const g=l.open;if(!g||!R())return;g.previewing=!0,g.failure=null;const k=await t.moderation.decide(I(!0),o);g.previewing=!1,!(r||l.open!==g)&&(k.ok?g.preview=k.value.statement:T(g,k))},async decide(){const g=l.open;if(!g||g.preview===null||g.deciding||g.decided)return;g.deciding=!0,g.failure=null;const k=await t.moderation.decide(I(!1),o);if(g.deciding=!1,!(r||l.open!==g)){if(!k.ok)return T(g,k);g.decided=!0,g.preview=k.value.statement,l.items=l.items.filter(M=>M!==g.item),c({key:"moderation.decided"})}},startEscalation(){const g=l.open;g&&!g.escalation&&(g.escalation={category:"",sending:!1,failure:null,done:!1})},async escalate(){const g=l.open,k=g?.escalation;if(!g||!k||k.sending||k.done||k.category===""||!ls.includes(k.category))return;k.sending=!0,k.failure=null;const M=await t.moderation.escalate({conversationId:g.item.conversationId,seq:g.item.seq,category:k.category},o);if(k.sending=!1,!(r||l.open!==g)){if(M.ok){k.done=!0,c({key:"moderation.escalated"});return}k.failure=M,M.code==="notFound"&&(l.open=null,h(g.item))}},openReview(g,k){g.kind==="premod"&&(l.open=null,l.review={item:g,outcome:k,ruleId:"",facts:"",sending:!1,failure:null,statement:null,done:null,changed:!1},k==="reject"&&$())},closeReview(){l.review=null},async review(){const g=l.review;if(!g||g.sending||g.done||g.outcome==="")return;const k=Ze(g.facts);if(g.outcome==="reject"&&(g.ruleId===""||k===""||lt(k)>hc))return;g.sending=!0,g.failure=null,g.changed=!1;const M={conversationId:g.item.conversationId,seq:g.item.seq,rev:g.item.rev??1},w=g.outcome==="approve"?await t.moderation.reviewPremod({...M,outcome:"approve"},o):await t.moderation.reviewPremod({...M,outcome:"reject",ruleId:g.ruleId,facts:k,locale:n},o);if(g.sending=!1,!(r||l.review!==g)){if(!w.ok){if(g.failure=w,w.code==="notFound"){l.review=null,h(g.item);return}await P(g);return}g.done=g.outcome==="approve"?"approved":"rejected","statement"in w.value&&(g.statement=w.value.statement),l.items=l.items.filter(v=>v!==g.item),c({key:g.done==="approved"?"moderation.approved":"moderation.rejected"})}},dispose(){r=!0,s.abort()}}}const zy=["lang","aria-labelledby"],Ly={class:"bcm-head"},Dy=["id"],Fy={key:0,class:"bcm-muted",role:"status"},Uy={key:1,class:"bcm-banner",role:"alert"},qy={key:0,class:"bcm-row"},By=["for"],Hy=["id","value"],Vy={value:""},Ky=["value"],Wy={key:1,class:"bcm-muted"},Yy={key:2,class:"bcm-list"},Gy={class:"bcm-row"},Zy={class:"bcm-badge"},Jy={key:0},Xy={key:1,class:"bcm-muted"},Qy={key:0,class:"bcm-hint"},e_={key:0,class:"bcm-topic-title"},t_={key:1,class:"bcm-text"},n_={key:2,class:"bcm-muted"},o_={class:"bcm-row bcm-muted"},s_=["datetime"],i_={key:0},r_={class:"bcm-row"},a_=["href"],l_=["onClick"],c_=["onClick"],u_=["onClick"],d_={key:3,class:"bcm-row"},f_=["disabled"],m_=["aria-labelledby"],p_=["id"],h_={key:0,class:"bcm-muted",role:"status"},b_={key:1,class:"bcm-list"},g_={key:0,class:"bcm-topic-title"},v_={key:1,class:"bcm-topic-title bcm-placeholder"},y_={key:2,class:"bcm-text"},__={key:3,class:"bcm-placeholder"},k_={key:4,class:"bcm-row bcm-muted"},w_={key:0,class:"bcm-handle"},$_=["datetime"],x_={class:"bcm-fieldset"},I_=["value"],T_={class:"bcm-field"},C_=["for"],S_=["id","aria-describedby"],A_=["id"],O_={key:0,class:"bcm-field"},E_=["for"],M_=["id","aria-invalid"],P_={value:"",disabled:""},R_=["value"],N_={key:1,class:"bcm-error",role:"alert"},j_={class:"bcm-facts"},z_={class:"bcm-row"},L_=["disabled"],D_=["disabled"],F_={class:"bcm-facts"},U_={class:"bcm-row"},q_={key:4,class:"bcm-section"},B_={class:"bcm-field"},H_=["for"],V_=["id"],K_={value:"",disabled:""},W_=["value"],Y_={key:0,class:"bcm-error",role:"alert"},G_={class:"bcm-row"},Z_=["disabled"],J_={key:2},X_=["aria-labelledby"],Q_=["id"],ek={key:0,class:"bcm-facts"},tk={class:"bcm-row"},nk={key:0,class:"bcm-banner",role:"alert"},ok={key:1,class:"bcm-topic-title"},sk={key:2,class:"bcm-text"},ik={class:"bcm-field"},rk=["for"],ak=["id"],lk={value:"",disabled:""},ck=["value"],uk={class:"bcm-field"},dk=["for"],fk=["id","aria-describedby"],mk=["id"],pk={key:4,class:"bcm-error",role:"alert"},hk={class:"bcm-row"},bk=["disabled"],gk=["disabled"],vk={class:"bcm-sr","aria-live":"polite"},yk=$e({inheritAttrs:!1,__name:"ForumModerationView",props:{categoryId:{},apiBase:{},siteBase:{},lang:{},routes:{},transport:{type:Function}},setup(e){const t=e,n=ue(De(t.lang,qe())),{t:s,text:o}=gt(n),r=Ve("bcm-moderation");ve(()=>t.lang,N=>{n.value=De(N,qe())});const a=ht(t.siteBase),l=a===null?null:bt(t.apiBase,t.transport,a),c=l?jy({client:l,lang:n.value,categoryId:t.categoryId??null}):null,p=c?.state??null,h=z(()=>Pt(Mt(t.routes),p?.me?.links,a??""));function b(N){const O=ms({title:N.title??null,openingState:N.openingState});return O.kind==="shown"?O.text:s(O.kind==="deleted"?"topic.deleted":"topic.withheld")}nt(()=>{c?.load()}),Ge(()=>c?.dispose());const _=nm,$=N=>`restriction.${N}`,y=N=>`category.${N}`,I=N=>{const O=N===null?null:`category.${N}`;return O!==null&&Xn(O)?s(O):""},R=N=>{const O=N.source===null?null:`moderation.source.${N.source}`;return O!==null&&Xn(O)?s(O):""},P=N=>p?.categories.find(O=>O.id.toLowerCase()===N.toLowerCase())?.name??"",T=N=>N===null?"":p?.rules?.find(O=>O.id===N)?.title??N,g=N=>Ii(h.value.topicPath,N.conversationId,N.seq),k=N=>{if(!N)return"";const O=Ie(N,n.value);return s(O.key,O.params)},M=z(()=>p?.open??null),w=z(()=>p?.review??null),v=z(()=>{const N=M.value;return!!N&&N.restriction!==""&&N.restriction!=="no_action"&&(N.needsRule||N.kase?.ruleId===null)});ve(()=>[M.value?.restriction,M.value?.facts,M.value?.ground],()=>{const N=M.value;N&&!N.decided&&(N.preview=null)});const x=ue("");return ve(()=>p?.announceId,()=>{x.value="";const N=o(p?.announcement);Le(()=>{x.value=N})}),(N,O)=>i(c)&&i(p)&&i(p).phase!=="none"&&i(p).phase!=="hidden"&&i(p).phase!=="membersOnly"?(d(),m("section",{key:0,class:"bcm bcm-forum-moderation",lang:n.value,"aria-labelledby":`${i(r)}-title`},[f("header",Ly,[f("h2",{id:`${i(r)}-title`},u(i(s)("moderation.title")),9,Dy)]),i(p).phase==="loading"?(d(),m("p",Fy,u(i(s)("moderation.loading")),1)):i(p).phase==="failed"?(d(),m("div",Uy,[f("span",null,u(k(i(p).failure)),1),f("button",{type:"button",class:"bcm-btn",onClick:O[0]||(O[0]=E=>i(c).load())},u(i(s)("common.retry")),1)])):(d(),m(q,{key:2},[i(p).categories.length>1?(d(),m("div",qy,[f("label",{for:`${i(r)}-category`},u(i(s)("search.category")),9,By),f("select",{id:`${i(r)}-category`,class:"bcm-input bcm-select",value:i(p).categoryId,onChange:O[1]||(O[1]=E=>i(c).setCategory(E.target.value))},[f("option",Vy,u(i(s)("forum.allCategories")),1),(d(!0),m(q,null,fe(i(p).categories,E=>(d(),m("option",{key:E.id,value:E.id},u(E.name),9,Ky))),128))],40,Hy)])):S("",!0),i(p).items.length===0?(d(),m("p",Wy,u(i(s)("moderation.empty")),1)):(d(),m("ul",Yy,[(d(!0),m(q,null,fe(i(p).items,E=>(d(),m("li",{key:`${E.kind}:${E.caseId??""}:${E.conversationId}:${E.seq}`},[f("p",Gy,[f("span",Zy,u(E.kind==="premod"?i(s)("moderation.premod"):R(E)),1),E.kind==="case"&&I(E.caseCategory)?(d(),m("strong",Jy,u(I(E.caseCategory)),1)):S("",!0),P(E.categoryId)?(d(),m("span",Xy,u(P(E.categoryId)),1)):S("",!0)]),E.caseStatus==="decided"?(d(),m("p",Qy,u(i(s)("moderation.heldBySystem")),1)):S("",!0),E.kind==="premod"?(d(),m(q,{key:1},[E.title?(d(),m("p",e_,u(E.title),1)):S("",!0),E.body!==null?(d(),m("p",t_,u(E.body),1)):S("",!0)],64)):S("",!0),E.ruleId?(d(),m("p",n_,u(i(s)("statement.contractualGround"))+": "+u(T(E.ruleId)),1)):S("",!0),f("p",o_,[f("time",{datetime:E.createdAt},u(i(Pe)(n.value,E.createdAt)),9,s_),E.deadlineAt?(d(),m("span",i_,u(i(s)("moderation.deadline",{date:i(Pe)(n.value,E.deadlineAt)})),1)):S("",!0)]),f("div",r_,[g(E)?(d(),m("a",{key:0,href:g(E)??void 0},u(i(s)("moderation.openTopic")),9,a_)):S("",!0),O[17]||(O[17]=f("span",{class:"bcm-spacer"},null,-1)),E.kind==="case"?(d(),m("button",{key:1,type:"button",class:"bcm-btn bcm-small",onClick:B=>i(c).openCase(E)},u(i(s)("moderation.open")),9,l_)):(d(),m(q,{key:2},[f("button",{type:"button",class:"bcm-btn bcm-small",onClick:B=>i(c).openReview(E,"approve")},u(i(s)("moderation.approve")),9,c_),f("button",{type:"button",class:"bcm-btn bcm-small bcm-danger",onClick:B=>i(c).openReview(E,"reject")},u(i(s)("moderation.reject")),9,u_)],64))])]))),128))])),i(p).nextCursor!==null?(d(),m("div",d_,[f("button",{type:"button",class:"bcm-btn",disabled:i(p).loadingMore,onClick:O[2]||(O[2]=E=>i(c).loadMore())},u(i(s)("discussion.loadMore")),9,f_)])):S("",!0),M.value?(d(),m("section",{key:4,class:"bcm-card","aria-labelledby":`${i(r)}-case`},[f("h3",{id:`${i(r)}-case`},u(i(s)("moderation.package")),9,p_),M.value.loading?(d(),m("p",h_,u(i(s)("common.loading")),1)):M.value.kase?(d(),m("ol",b_,[(d(!0),m(q,null,fe(M.value.kase.items,E=>(d(),m("li",{key:E.itemNo},[E.title?(d(),m("p",g_,u(E.title),1)):E.title===null?(d(),m("p",v_,u(b(E)),1)):S("",!0),E.body!==null?(d(),m("p",y_,u(E.body),1)):(d(),m("p",__,u(i(s)("moderation.itemWithheld")),1)),E.authorHandle||E.createdAt?(d(),m("p",k_,[E.authorHandle?(d(),m("span",w_,u(E.authorHandle),1)):S("",!0),E.createdAt?(d(),m("time",{key:1,datetime:E.createdAt},u(i(Pe)(n.value,E.createdAt)),9,$_)):S("",!0)])):S("",!0)]))),128))])):S("",!0),M.value.kase&&!M.value.decided?(d(),m("form",{key:2,class:"bcm-form",novalidate:"",onSubmit:O[7]||(O[7]=mt(E=>M.value.preview===null?i(c).preview():i(c).decide(),["prevent"]))},[f("fieldset",x_,[f("legend",null,u(i(s)("moderation.restriction")),1),(d(!0),m(q,null,fe(i(_),E=>(d(),m("label",{key:E,class:"bcm-check"},[ge(f("input",{"onUpdate:modelValue":O[3]||(O[3]=B=>M.value.restriction=B),type:"radio",value:E},null,8,I_),[[xn,M.value.restriction]]),f("span",null,u(i(s)($(E))),1)]))),128))]),f("div",T_,[f("label",{for:`${i(r)}-facts`},u(i(s)("statement.facts")),9,C_),ge(f("textarea",{id:`${i(r)}-facts`,"onUpdate:modelValue":O[4]||(O[4]=E=>M.value.facts=E),class:"bcm-input bcm-textarea",rows:"4","aria-describedby":`${i(r)}-facts-hint`},null,8,S_),[[Xe,M.value.facts]]),f("p",{id:`${i(r)}-facts-hint`,class:"bcm-hint"},u(i(s)("moderation.factsHint")),9,A_)]),v.value||M.value.ground!==""?(d(),m("div",O_,[f("label",{for:`${i(r)}-ground`},u(i(s)("statement.contractualGround")),9,E_),ge(f("select",{id:`${i(r)}-ground`,"onUpdate:modelValue":O[5]||(O[5]=E=>M.value.ground=E),class:"bcm-input bcm-select","aria-invalid":M.value.needsRule&&M.value.ground===""},[f("option",P_,u(i(s)("moderation.ruleRequired")),1),(d(!0),m(q,null,fe(i(p).rules??[],E=>(d(),m("option",{key:E.id,value:E.id},u(E.title),9,R_))),128))],8,M_),[[Gt,M.value.ground]])])):S("",!0),M.value.failure?(d(),m("p",N_,u(M.value.needsRule?i(s)("moderation.ruleRequired"):k(M.value.failure)),1)):S("",!0),M.value.preview!==null?(d(),m(q,{key:2},[f("h4",null,u(i(s)("moderation.previewTitle")),1),f("pre",j_,u(M.value.preview),1)],64)):S("",!0),f("div",z_,[f("button",{type:"button",class:"bcm-btn",onClick:O[6]||(O[6]=E=>i(c).closeCase())},u(i(s)("common.close")),1),O[18]||(O[18]=f("span",{class:"bcm-spacer"},null,-1)),M.value.preview===null?(d(),m("button",{key:0,type:"submit",class:"bcm-btn",disabled:!i(c).canPreview()},u(i(s)("moderation.preview")),9,L_)):(d(),m("button",{key:1,type:"submit",class:"bcm-btn bcm-primary",disabled:M.value.deciding},u(i(s)("moderation.decide")),9,D_))])],32)):M.value.decided?(d(),m(q,{key:3},[f("p",null,u(i(s)("moderation.decided")),1),f("h4",null,u(i(s)("statement.title")),1),f("pre",F_,u(M.value.preview),1),f("div",U_,[f("button",{type:"button",class:"bcm-btn",onClick:O[8]||(O[8]=E=>i(c).closeCase())},u(i(s)("common.close")),1)])],64)):S("",!0),M.value.kase&&!M.value.decided?(d(),m("div",q_,[M.value.escalation?M.value.escalation.done?(d(),m("p",J_,u(i(s)("moderation.escalated")),1)):(d(),m("form",{key:1,class:"bcm-form",novalidate:"",onSubmit:O[11]||(O[11]=mt(E=>i(c).escalate(),["prevent"]))},[f("p",null,u(i(s)("moderation.escalateLede")),1),f("div",B_,[f("label",{for:`${i(r)}-escalate`},u(i(s)("moderation.escalateCategory")),9,H_),ge(f("select",{id:`${i(r)}-escalate`,"onUpdate:modelValue":O[10]||(O[10]=E=>M.value.escalation.category=E),class:"bcm-input bcm-select"},[f("option",K_,u(i(s)("moderation.escalateCategory")),1),(d(!0),m(q,null,fe(i(ls),E=>(d(),m("option",{key:E,value:E},u(i(s)(y(E))),9,W_))),128))],8,V_),[[Gt,M.value.escalation.category]])]),M.value.escalation.failure?(d(),m("p",Y_,u(k(M.value.escalation.failure)),1)):S("",!0),f("div",G_,[f("button",{type:"submit",class:"bcm-btn",disabled:M.value.escalation.category===""||M.value.escalation.sending},u(i(s)("moderation.escalate")),9,Z_)])],32)):(d(),m("button",{key:0,type:"button",class:"bcm-link",onClick:O[9]||(O[9]=E=>i(c).startEscalation())},u(i(s)("moderation.escalate")),1))])):S("",!0)],8,m_)):S("",!0),w.value?(d(),m("section",{key:5,class:"bcm-card","aria-labelledby":`${i(r)}-review`},[f("h3",{id:`${i(r)}-review`},u(w.value.outcome==="approve"?i(s)("moderation.approve"):i(s)("moderation.reject")),9,Q_),w.value.done?(d(),m(q,{key:0},[f("p",null,u(w.value.done==="approved"?i(s)("moderation.approved"):i(s)("moderation.rejected")),1),w.value.statement?(d(),m("pre",ek,u(w.value.statement),1)):S("",!0),f("div",tk,[f("button",{type:"button",class:"bcm-btn",onClick:O[12]||(O[12]=E=>i(c).closeReview())},u(i(s)("common.close")),1)])],64)):(d(),m("form",{key:1,class:"bcm-form",novalidate:"",onSubmit:O[16]||(O[16]=mt(E=>i(c).review(),["prevent"]))},[w.value.changed?(d(),m("p",nk,u(i(s)("moderation.textChanged")),1)):S("",!0),w.value.item.title?(d(),m("p",ok,u(w.value.item.title),1)):S("",!0),w.value.item.body!==null?(d(),m("p",sk,u(w.value.item.body),1)):S("",!0),w.value.outcome==="reject"?(d(),m(q,{key:3},[f("div",ik,[f("label",{for:`${i(r)}-review-rule`},u(i(s)("statement.contractualGround")),9,rk),ge(f("select",{id:`${i(r)}-review-rule`,"onUpdate:modelValue":O[13]||(O[13]=E=>w.value.ruleId=E),class:"bcm-input bcm-select"},[f("option",lk,u(i(s)("moderation.ruleRequired")),1),(d(!0),m(q,null,fe(i(p).rules??[],E=>(d(),m("option",{key:E.id,value:E.id},u(E.title),9,ck))),128))],8,ak),[[Gt,w.value.ruleId]])]),f("div",uk,[f("label",{for:`${i(r)}-review-facts`},u(i(s)("statement.facts")),9,dk),ge(f("textarea",{id:`${i(r)}-review-facts`,"onUpdate:modelValue":O[14]||(O[14]=E=>w.value.facts=E),class:"bcm-input bcm-textarea",rows:"4","aria-describedby":`${i(r)}-review-hint`},null,8,fk),[[Xe,w.value.facts]]),f("p",{id:`${i(r)}-review-hint`,class:"bcm-hint"},u(i(s)("moderation.factsHint")),9,mk)])],64)):S("",!0),w.value.failure?(d(),m("p",pk,u(k(w.value.failure)),1)):S("",!0),f("div",hk,[f("button",{type:"button",class:"bcm-btn",disabled:w.value.sending,onClick:O[15]||(O[15]=E=>i(c).closeReview())},u(i(s)("common.cancel")),9,bk),O[19]||(O[19]=f("span",{class:"bcm-spacer"},null,-1)),f("button",{type:"submit",class:Ke(["bcm-btn bcm-primary",{"bcm-danger":w.value.outcome==="reject"}]),disabled:w.value.sending||w.value.outcome==="reject"&&(w.value.ruleId===""||w.value.facts.trim()==="")},u(w.value.outcome==="approve"?i(s)("moderation.approve"):i(s)("moderation.reject")),11,gk)])],32))],8,X_)):S("",!0)],64)),f("p",vk,u(x.value),1)],8,zy)):S("",!0)}});function bc(e){if(typeof e!="string"||!e.startsWith("#"))return null;for(const t of e.slice(1).split("&"))if(t.startsWith("q="))try{const n=decodeURIComponent(t.slice(2).replace(/\+/g," "));return n.length<=rs*2?n:null}catch{return null}return null}function _k(e,t){const n=wi(t);return n===null||e.includes("#")?null:`${e}#q=${encodeURIComponent(n)}`}function kk(e){const{client:t}=e,n=new AbortController,s={signal:n.signal};let o=!1,r=0;const a=Re({phase:"idle",failure:null,query:e.query??"",space:"",categoryId:"",categories:[],invalid:null,results:[],page:0,hasMore:!1,loadingMore:!1}),l=h=>{a.failure=h,a.phase=h.code==="surfaceOff"?"hidden":h.code==="membersOnly"?"membersOnly":"failed"};let c=null;async function p(){const h=wi(a.query);if(h===null){a.invalid=a.query.trim().length>rs?"long":"short";return}a.invalid=null;const b=++r;a.phase="searching",a.failure=null;const _={query:h,...a.categoryId!==""?{categoryId:a.categoryId}:{},...a.space!==""?{space:a.space}:{}};c=_;const $=await t.forum.search({..._,page:1},s);if(!(o||b!==r)){if(!$.ok)return l($);a.results=[...$.value.results],a.page=$.value.page,a.hasMore=$.value.hasMore,a.phase="ready"}}return{state:a,async load(){const h=await t.forum.categories.list(s);o||(h.ok?a.categories=h.value.categories.filter(b=>b.kind==="topics"):(h.code==="membersOnly"||h.code==="surfaceOff")&&l(h),wi(a.query)!==null&&a.phase==="idle"&&await p())},search:p,async more(){const h=tp({page:a.page,hasMore:a.hasMore});if(h===null||c===null||a.loadingMore||a.phase!=="ready")return;const b=r;a.loadingMore=!0;const _=await t.forum.search({...c,page:h},s);if(a.loadingMore=!1,!(o||b!==r)){if(!_.ok){a.failure=_;return}a.results=[...a.results,..._.value.results],a.page=_.value.page,a.hasMore=_.value.hasMore}},dispose(){o=!0,n.abort()}}}const wk=["lang","aria-labelledby"],$k={class:"bcm-head"},xk=["id"],Ik={key:1,class:"bcm-search-body"},Tk={class:"bcm-field"},Ck=["for"],Sk=["id","aria-invalid","aria-describedby"],Ak=["id"],Ok={class:"bcm-row"},Ek=["for"],Mk=["id"],Pk={value:""},Rk={value:"forum"},Nk={value:"article"},jk=["for"],zk=["id"],Lk={value:""},Dk=["value"],Fk=["disabled"],Uk={key:0,class:"bcm-muted",role:"status"},qk={key:1,class:"bcm-banner",role:"alert"},Bk={key:0,class:"bcm-muted",role:"status"},Hk={key:1,class:"bcm-list"},Vk={class:"bcm-row bcm-muted"},Kk={class:"bcm-badge"},Wk=["datetime"],Yk={class:"bcm-topic-title"},Gk=["href"],Zk={key:0,class:"bcm-text"},Jk={key:2,class:"bcm-error",role:"alert"},Xk={key:3,class:"bcm-row"},Qk=["disabled"],ew={key:4,class:"bcm-hint"},tw=$e({inheritAttrs:!1,__name:"ForumSearchView",props:{apiBase:{},siteBase:{},lang:{},routes:{},signInHref:{},transport:{type:Function}},setup(e){const t=e,n=ue(De(t.lang,qe())),{t:s}=gt(n),o=Ve("bcm-search");ve(()=>t.lang,I=>{n.value=De(I,qe())});const r=ht(t.siteBase),a=r===null?null:bt(t.apiBase,t.transport,r),l=a?kk({client:a,query:bc(typeof location>"u"?null:location.hash)}):null,c=l?.state??null,p=z(()=>Pt(Mt(t.routes),null,r??""));function h(){const I=bc(location.hash);!l||!c||I===null||I===c.query||(c.query=I,l.search())}nt(()=>{l?.load(),typeof window<"u"&&window.addEventListener("hashchange",h)}),Ge(()=>{typeof window<"u"&&window.removeEventListener("hashchange",h),l?.dispose()});function b(I){return I.space==="article"?Ti(p.value.articlePath,I.articleSlug,I.seq):I.space!=="forum"?null:I.seq!==null&&I.kind==="message"?Ii(p.value.topicPath,I.conversationId,I.seq):xo(p.value.topicPath,I.conversationId)}function _(I){if(I.space==="forum"){const R=ms(I);return R.kind==="shown"?R.text:s(R.kind==="deleted"?"topic.deleted":"topic.withheld")}return I.title!==null&&I.title.trim()!==""?I.title:s("search.inArticle")}const $=z(()=>{const I=c?.failure;if(!I)return"";const R=Ie(I,n.value);return s(R.key,R.params)}),y=z(()=>!!c&&c.phase==="ready"&&c.page>=La&&c.results.length>0);return(I,R)=>i(l)&&i(c)&&i(c).phase!=="hidden"?(d(),m("section",{key:0,class:"bcm bcm-forum-search",lang:n.value,"aria-labelledby":`${i(o)}-title`},[f("header",$k,[f("h2",{id:`${i(o)}-title`},u(i(s)("search.title")),9,xk)]),i(c).phase==="membersOnly"&&i(a)?(d(),_e(Ts,{key:0,failure:i(c).failure,client:i(a),lang:n.value,"sign-in-href":e.signInHref,"rules-href":p.value.rulesPath,"terms-href":p.value.termsPath,onJoined:R[0]||(R[0]=P=>i(l).load())},null,8,["failure","client","lang","sign-in-href","rules-href","terms-href"])):(d(),m("div",Ik,[f("form",{class:"bcm-form",role:"search",novalidate:"",onSubmit:R[4]||(R[4]=mt(P=>i(l).search(),["prevent"]))},[f("div",Tk,[f("label",{for:`${i(o)}-q`},u(i(s)("search.label")),9,Ck),ge(f("input",{id:`${i(o)}-q`,"onUpdate:modelValue":R[1]||(R[1]=P=>i(c).query=P),class:"bcm-input",type:"search","aria-invalid":i(c).invalid!==null,"aria-describedby":`${i(o)}-q-error`},null,8,Sk),[[Xe,i(c).query]]),i(c).invalid?(d(),m("p",{key:0,id:`${i(o)}-q-error`,class:"bcm-error",role:"alert"},u(i(c).invalid==="short"?i(s)("search.tooShort",{min:i(pi)}):i(s)("search.tooLong",{max:i(rs)})),9,Ak)):S("",!0)]),f("div",Ok,[f("label",{for:`${i(o)}-space`},u(i(s)("search.space")),9,Ek),ge(f("select",{id:`${i(o)}-space`,"onUpdate:modelValue":R[2]||(R[2]=P=>i(c).space=P),class:"bcm-input bcm-select"},[f("option",Pk,u(i(s)("search.spaceAll")),1),f("option",Rk,u(i(s)("search.spaceForum")),1),f("option",Nk,u(i(s)("search.spaceArticle")),1)],8,Mk),[[Gt,i(c).space]]),i(c).categories.length>0&&i(c).space!=="article"?(d(),m(q,{key:0},[f("label",{for:`${i(o)}-category`},u(i(s)("search.category")),9,jk),ge(f("select",{id:`${i(o)}-category`,"onUpdate:modelValue":R[3]||(R[3]=P=>i(c).categoryId=P),class:"bcm-input bcm-select"},[f("option",Lk,u(i(s)("forum.allCategories")),1),(d(!0),m(q,null,fe(i(c).categories,P=>(d(),m("option",{key:P.id,value:P.id},u(P.name),9,Dk))),128))],8,zk),[[Gt,i(c).categoryId]])],64)):S("",!0),f("button",{type:"submit",class:"bcm-btn bcm-primary",disabled:i(c).phase==="searching"},u(i(s)("search.submit")),9,Fk)])],32),i(c).phase==="searching"?(d(),m("p",Uk,u(i(s)("search.searching")),1)):i(c).phase==="failed"?(d(),m("div",qk,[f("span",null,u($.value),1)])):i(c).phase==="ready"?(d(),m(q,{key:2},[i(c).results.length===0?(d(),m("p",Bk,u(i(s)("search.empty")),1)):(d(),m("ol",Hk,[(d(!0),m(q,null,fe(i(c).results,(P,T)=>(d(),m("li",{key:`${P.conversationId}:${P.seq??0}:${T}`},[f("p",Vk,[f("span",Kk,u(P.kind==="topic"?i(s)("search.topic"):i(s)("search.message")),1),f("time",{datetime:P.createdAt},u(i(Pe)(n.value,P.createdAt)),9,Wk)]),f("p",Yk,[b(P)?(d(),m("a",{key:0,href:b(P)??void 0,class:Ke({"bcm-placeholder":P.title===null})},u(_(P)),11,Gk)):(d(),m("span",{key:1,class:Ke({"bcm-placeholder":P.title===null})},u(_(P)),3))]),P.snippet?(d(),m("p",Zk,u(P.snippet),1)):S("",!0)]))),128))])),i(c).failure?(d(),m("p",Jk,u($.value),1)):S("",!0),i(c).hasMore?(d(),m("div",Xk,[f("button",{type:"button",class:"bcm-btn",disabled:i(c).loadingMore,onClick:R[5]||(R[5]=P=>i(l).more())},u(i(s)("search.more")),9,Qk)])):y.value?(d(),m("p",ew,u(i(s)("search.lastPage")),1)):S("",!0)],64)):S("",!0)]))],8,wk)):S("",!0)}}),nw=10,gc=3;function ow(e){const{client:t}=e,n=new AbortController,s={signal:n.signal};let o=!1,r=0;const a=Re({phase:"loading",failure:null,me:null,categories:[],latest:{}});async function l(){const c=++r;a.phase="loading",a.failure=null;const[p,h]=await Promise.all([t.me.get(s),t.forum.categories.list(s)]);if(o||c!==r)return;if(p.ok&&(a.me=p.value),!h.ok){a.failure=h,a.phase=h.code==="surfaceOff"?"hidden":h.code==="membersOnly"?"membersOnly":"failed";return}a.categories=[...h.value.categories].sort((y,I)=>y.position-I.position),a.latest={},a.phase="ready";const b=a.categories.slice(0,nw),_=await Promise.all(b.map(y=>t.forum.topics.list({categoryId:y.id,sort:"activity",limit:gc},s)));if(o||c!==r)return;const $={};b.forEach((y,I)=>{const R=_[I];R?.ok&&($[y.id]=$i(R.value.items).slice(0,gc))}),a.latest=$}return{state:a,load:l,dispose(){o=!0,n.abort()}}}const sw=["lang","aria-labelledby"],iw={class:"bcm-head"},rw=["id"],aw={key:0,class:"bcm-muted",role:"status"},lw={key:2,class:"bcm-banner",role:"alert"},cw={key:3,class:"bcm-forum-body"},uw=["for"],dw=["id","placeholder"],fw={type:"submit",class:"bcm-btn"},mw={key:0,class:"bcm-error bcm-full",role:"alert"},pw={key:0,class:"bcm-muted"},hw={key:1,class:"bcm-list"},bw=["href"],gw={key:0,class:"bcm-text"},vw={class:"bcm-row bcm-muted"},yw=["datetime"],_w={key:1,class:"bcm-hint"},kw=["aria-label"],ww={key:3},$w=["href"],xw=$e({inheritAttrs:!1,__name:"ForumView",props:{apiBase:{},siteBase:{},lang:{},routes:{},signInHref:{},transport:{type:Function}},setup(e){const t=e,n=ue(De(t.lang,qe())),{t:s}=gt(n),o=Ve("bcm-forum"),r=ht(t.siteBase),a=r===null?null:bt(t.apiBase,t.transport,r),l=a?ow({client:a}):null,c=l?.state??null,p=z(()=>Pt(Mt(t.routes),c?.me?.links,r??""));nt(()=>{l?.load()}),Ge(()=>l?.dispose()),ve(()=>t.lang,I=>{n.value=De(I,qe())});const h=ue(""),b=ue(!1);function _(){const I=_k(p.value.searchPath,h.value);b.value=I===null,I!==null&&typeof location<"u"&&location.assign(I)}const $=z(()=>{const I=c?.failure;if(!I)return"";const R=Ie(I,n.value);return s(R.key,R.params)}),y=I=>I.kind==="article_discussions"?s("forum.discussionCount",{count:I.topicCount}):s("forum.topicCount",{count:I.topicCount});return(I,R)=>i(l)&&i(c)&&i(c).phase!=="hidden"?(d(),m("section",{key:0,class:"bcm bcm-forum",lang:n.value,"aria-labelledby":`${i(o)}-title`},[f("header",iw,[f("h2",{id:`${i(o)}-title`},u(i(s)("forum.title")),9,rw)]),i(c).phase==="loading"?(d(),m("p",aw,u(i(s)("forum.loading")),1)):i(c).phase==="membersOnly"&&i(a)?(d(),_e(Ts,{key:1,failure:i(c).failure,client:i(a),lang:n.value,"sign-in-href":e.signInHref,"rules-href":p.value.rulesPath,"terms-href":p.value.termsPath,onJoined:R[0]||(R[0]=P=>i(l).load())},null,8,["failure","client","lang","sign-in-href","rules-href","terms-href"])):i(c).phase==="failed"?(d(),m("div",lw,[f("span",null,u($.value),1),f("button",{type:"button",class:"bcm-btn",onClick:R[1]||(R[1]=P=>i(l).load())},u(i(s)("common.retry")),1)])):i(c).phase==="ready"?(d(),m("div",cw,[Ee(Fi,{me:i(c).me},null,8,["me"]),f("form",{class:"bcm-row",role:"search",onSubmit:mt(_,["prevent"])},[f("label",{for:`${i(o)}-q`,class:"bcm-sr"},u(i(s)("forum.search")),9,uw),ge(f("input",{id:`${i(o)}-q`,"onUpdate:modelValue":R[2]||(R[2]=P=>h.value=P),class:"bcm-input bcm-grow",type:"search",placeholder:i(s)("forum.search")},null,8,dw),[[Xe,h.value]]),f("button",fw,u(i(s)("forum.searchSubmit")),1),b.value?(d(),m("p",mw,u(i(s)("search.tooShort",{min:i(pi)})),1)):S("",!0)],32),i(c).categories.length===0?(d(),m("p",pw,u(i(s)("forum.empty")),1)):(d(),m("ul",hw,[(d(!0),m(q,null,fe(i(c).categories,P=>(d(),m("li",{key:P.id,class:"bcm-category"},[f("h3",null,[i(On)(p.value.categoryPath,P.slug)?(d(),m("a",{key:0,href:i(On)(p.value.categoryPath,P.slug)??void 0},u(P.name),9,bw)):(d(),m(q,{key:1},[It(u(P.name),1)],64))]),P.description?(d(),m("p",gw,u(P.description),1)):S("",!0),f("p",vw,[f("span",null,u(y(P)),1),P.lastActivityAt?(d(),m("time",{key:0,datetime:P.lastActivityAt},u(i(s)("forum.lastActivity",{date:i(Pe)(n.value,P.lastActivityAt)})),9,yw)):S("",!0)]),P.mode==="pre"?(d(),m("p",_w,u(i(s)("forum.modePre")),1)):S("",!0),i(c).latest[P.id]?.length?(d(),m("ul",{key:2,class:"bcm-topics","aria-label":i(s)("forum.latest")},[(d(!0),m(q,null,fe(i(c).latest[P.id],T=>(d(),_e(pc,{key:T.conversationId,item:T,"topic-href":p.value.topicPath,"article-href":p.value.articlePath},null,8,["item","topic-href","article-href"]))),128))],8,kw)):S("",!0),i(On)(p.value.categoryPath,P.slug)?(d(),m("p",ww,[f("a",{href:i(On)(p.value.categoryPath,P.slug)??void 0},u(i(s)("forum.allTopics")),9,$w)])):S("",!0)]))),128))]))])):S("",!0)],8,sw)):S("",!0)}}),Ui=new WeakMap;function Iw(e){if(typeof location<"u"&&location.hash.startsWith("#u=")){const t=Sl(location.hash);return fp(),mp(),e&&Ui.set(e,t),t}return e&&Ui.has(e)?Ui.get(e)??null:null}const Ao=()=>typeof navigator>"u"?null:navigator;function qi(){const e=globalThis;return e.Notification&&typeof e.Notification.requestPermission=="function"?e.Notification:null}function vc(e=Ao()){if(!e)return!1;const t=e.userAgent??"";return/iPhone|iPad|iPod/.test(t)||e.platform==="MacIntel"&&(e.maxTouchPoints??0)>1}function Tw(e=Ao()){if(!e)return"other";if(vc(e))return"ios";const t=e.userAgent??"";return/Android/.test(t)?"android":/Mobi|Tablet/.test(t)||t===""?"other":"desktop"}function Cw(){const e=Ao();if(!e)return"unsupported";if($m(e.userAgent??""))return"inApp";if(vc(e)&&e.standalone!==!0)return"iosInstall";const t=globalThis;return!e.serviceWorker||typeof e.serviceWorker.register!="function"||typeof t.PushManager>"u"||!qi()?"unsupported":"supported"}function yc(){return qi()?.permission??"default"}async function Sw(){const e=qi();if(!e)return"denied";if(e.permission!=="default")return e.permission;try{return await e.requestPermission()}catch{return"denied"}}async function _c(){const e=Ao()?.serviceWorker;if(!e||typeof e.getRegistration!="function")return null;try{return await e.getRegistration()??null}catch{return null}}async function Aw(e){const t=Ao()?.serviceWorker;if(!t)throw new Error("[blogmcp-community] no service worker support");return t.register(e)}async function Bi(e){if(!e?.pushManager||typeof e.pushManager.getSubscription!="function")return null;try{return await e.pushManager.getSubscription()??null}catch{return null}}function Ow(e){if(typeof e!="string"||!/^[A-Za-z0-9_-]+={0,2}$/.test(e))return null;const t=e.replace(/=+$/,"").replace(/-/g,"+").replace(/_/g,"/"),n=t+"=".repeat((4-t.length%4)%4);try{const s=atob(n),o=new Uint8Array(s.length);for(let r=0;r<s.length;r++)o[r]=s.charCodeAt(r);return o}catch{return null}}function kc(e){const t=typeof e.toJSON=="function"?e.toJSON():null,n=t?.endpoint??e.endpoint,s=t?.keys?.p256dh,o=t?.keys?.auth;return typeof n!="string"||typeof s!="string"||typeof o!="string"?null:{endpoint:n,keys:{p256dh:s,auth:o}}}const Hi="blogmcp-community:push-key-id";function Ew(){try{const e=typeof localStorage>"u"?null:localStorage.getItem(Hi);if(e===null)return null;const t=JSON.parse(e);return t&&typeof t.memberId=="string"&&typeof t.keyId=="string"?{memberId:t.memberId,keyId:t.keyId}:null}catch{return null}}function wc(e){try{if(typeof localStorage>"u")return;e===null?localStorage.removeItem(Hi):localStorage.setItem(Hi,JSON.stringify({memberId:e.memberId,keyId:e.keyId}))}catch{}}const Mw=["notifyReply","notifyMention","notifyTopic","pushEnabled","digestEmail","quietHours"];function Pw(e){const{client:t,swPath:n}=e,s=e.digestToken,o=new AbortController,r={signal:o.signal};let a=!1,l=null,c=[];const p=Re({phase:"idle",failure:null,module:null,settings:null,saving:{},push:{support:Cw(),status:"checking",note:null,failure:null},digest:{offered:s!==null,sending:!1,outcome:null,failure:null},announcement:null,announceId:0}),h=w=>{p.announcement=w,p.announceId+=1},b=w=>({key:`error.${w.code}`}),_=()=>{const w=p.module?.state;return w===void 0||Yn(w)&&w!=="dark"},$=()=>p.phase==="ready"&&l!==null&&p.module?.features.push===!0;async function y(){const w=await t.me.get(r);return w.ok?(p.module=w.value.module??null,w.value.needs.includes("sign_in")?"signIn":(l=w.value.member?.memberId??null,l===null?"reader":"member")):w.code==="signIn"?"signIn":w}async function I(w){const v=kc(w)?.endpoint;if(!v||l===null)return!1;const x=await t.me.push.status({endpoint:v},r);return x.ok&&x.value.subscribed===!0}async function R(){if(!$()||p.push.support!=="supported"){p.push.status="off";return}const w=await Bi(await _c());if(a)return;const v=await t.me.notifications.list({unreadOnly:!0,codes:["module_push_reset"]},r);if(a)return;c=v.ok?v.value.items.filter(re=>re.code==="module_push_reset"&&re.readAt===null).map(re=>re.id):[];const x=Ew(),N=w!==null&&x!==null&&x.memberId===l;let O=!1,E=!1;if(N){const re=await t.me.push.vapid(r);if(a)return;O=re.ok&&re.value.keyId!==x.keyId,E=re.ok&&!O}const B=yc();let ee=N&&E&&B==="granted";ee&&w&&(ee=await I(w),a)||(p.push.status=ee?"on":"off",p.push.note=O||c.length>0?"reset":B==="denied"?"denied":null)}async function P(){p.phase="loading",p.failure=null;const w=await y();if(a)return;if(w==="signIn"){p.phase="signIn";return}if(w!=="member"&&w!=="reader"){p.phase="failed",p.failure=w;return}if(!_()){p.phase="failed",p.failure={ok:!1,code:"unavailable"};return}const v=await t.me.settings.get(r);if(!a){if(!v.ok){p.phase=v.code==="signIn"?"signIn":"failed",p.failure=v;return}p.settings={...v.value.settings},p.phase="ready",await R()}}async function T(w,v){const x=p.settings;if(!x||p.saving[w]||x[w]===v)return;p.saving[w]=!0;const N=x[w];p.settings={...x,[w]:v};const O=await t.me.settings.update({[w]:v},r);if(delete p.saving[w],!a){if(!O.ok)return p.settings&&(p.settings={...p.settings,[w]:N}),h(b(O));if(p.settings={...O.value.settings},h({key:"settings.saved"}),w==="pushEnabled"){const E=await y();if(a||E!=="member"&&E!=="reader")return;await R()}}}async function g(){const w=p.push;if(!$()||w.support!=="supported"||w.status==="busy"||l===null)return;const v=l;w.status="busy",w.failure=null,w.note=null;const x=(N,O=null)=>{w.status="off",w.note=N,w.failure=O};try{if(await Sw()!=="granted")return x("denied");if(a)return;const N=await Aw(n);if(a)return;const O=await t.me.push.vapid(r);if(a)return;if(!O.ok)return x(O.code==="pushRefused"?"refused":null,O);const E=Ow(O.value.publicKey);if(!E)return x(null,{ok:!1,code:"unavailable"});const B=await Bi(N);B&&await B.unsubscribe().catch(()=>!1);const ee=await N.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:E});if(a)return;const re=kc(ee);if(!re)return await ee.unsubscribe().catch(()=>!1),x("refused");const be=await t.me.push.subscribe({...re,userAgentClass:Tw()},r);if(a)return;if(!be.ok)return await ee.unsubscribe().catch(()=>!1),x(be.code==="pushRefused"?"refused":null,be);if(wc({memberId:v,keyId:be.value.keyId}),w.status="on",h({key:"settings.saved"}),c.length>0){const we=c;c=[],t.me.notifications.markRead({ids:we},r)}}catch{a||x(yc()==="denied"?"denied":"refused")}}async function k(){const w=p.push;if(w.status==="busy")return;w.status="busy",w.failure=null,w.note=null;let v=null;try{const x=await Bi(await _c());v=x?.endpoint??null,await x?.unsubscribe()}catch{}if(!a){if(v){const x=await t.me.push.unsubscribe({endpoint:v},r);if(a)return;x.ok||(w.failure=x)}wc(null),w.status="off",w.failure||h({key:"settings.saved"})}}async function M(){const w=p.digest;if(!s||w.sending||w.outcome==="unsubscribed")return;w.sending=!0,w.failure=null;const v=await t.me.settings.unsubscribeDigest({token:s},r);if(w.sending=!1,!a){if(v.ok){w.outcome="unsubscribed",p.settings&&(p.settings={...p.settings,digestEmail:!1}),h({key:"settings.digest.unsubscribed"});return}if(v.code==="invalid"){w.outcome="staleLink";return}w.failure=v}}return{state:p,load:P,toggle:T,pushShown:$,enablePush:g,disablePush:k,unsubscribeDigest:M,dispose(){a=!0,o.abort()}}}const Rw=["lang","aria-labelledby"],Nw=["id"],jw=["aria-labelledby"],zw=["id"],Lw={key:0,role:"status"},Dw={key:1,class:"bcm-note",role:"alert"},Fw={key:0,class:"bcm-error",role:"alert"},Uw={class:"bcm-row"},qw=["disabled"],Bw={key:1,class:"bcm-muted",role:"status"},Hw={key:2,class:"bcm-row"},Vw=["href"],Kw={key:3,class:"bcm-banner",role:"alert"},Ww={class:"bcm-switches"},Yw={class:"bcm-check"},Gw=["name","checked","disabled","onChange"],Zw=["aria-labelledby"],Jw=["id"],Xw={class:"bcm-hint"},Qw=["href"],e1={class:"bcm-url"},t1={key:1},n1={key:2},o1={key:0,class:"bcm-note"},s1={key:1,class:"bcm-note",role:"alert"},i1={key:2,class:"bcm-note",role:"alert"},r1={key:3,class:"bcm-error",role:"alert"},a1={class:"bcm-row"},l1=["disabled"],c1={class:"bcm-sr","aria-live":"polite"},u1=$e({inheritAttrs:!1,__name:"MemberSettingsView",props:{apiBase:{},siteBase:{},lang:{},swPath:{},routes:{},signInHref:{},transport:{type:Function}},setup(e){const t=e,n=ue(De(t.lang,qe())),{t:s,text:o}=gt(n),r=Ve("bcm-settings"),a=Vn(),l=ht(t.siteBase),c=l===null?null:bt(t.apiBase,t.transport,l);function p(w){return w===void 0||w===""?`${l??""}/sw.js`:hs(w)?w:(qt("sw-path",'[blogmcp-community] sw-path must be a path on this site (e.g. "/blog/sw.js"): the service worker is the site’s own'),null)}const h=Iw(a),b=p(t.swPath),_=c&&b?Pw({client:c,swPath:b,digestToken:h}):null,$=_?.state??null;nt(()=>{_?.load()}),Ge(()=>_?.dispose());const y=Object.freeze({notifyReply:"settings.notifyReply",notifyMention:"settings.notifyMention",notifyTopic:"settings.notifyTopic",pushEnabled:"settings.pushEnabled",digestEmail:"settings.digestEmail",quietHours:"settings.quietHours"}),I=z(()=>{const w=$?.failure;if(!w)return"";const v=Ie(w,n.value);return s(v.key,v.params)}),R=z(()=>{const w=$?.push.failure;if(!w)return"";const v=Ie(w,n.value);return s(v.key,v.params)}),P=z(()=>{const w=$?.digest.failure;if(!w)return"";const v=Ie(w,n.value);return s(v.key,v.params)}),T=z(()=>typeof location>"u"?"":location.href);function g(){return En(t.signInHref,typeof location>"u"?null:location.pathname)}function k(w,v){_?.toggle(w,v.target.checked)}const M=ue("");return ve(()=>$?.announceId,()=>{M.value="";const w=o($?.announcement);Le(()=>{M.value=w})}),(w,v)=>i(_)&&i($)?(d(),m("section",{key:0,class:"bcm bcm-settings",lang:n.value,"aria-labelledby":`${i(r)}-title`},[f("h2",{id:`${i(r)}-title`},u(i(s)("settings.title")),9,Nw),i($).digest.offered?(d(),m("section",{key:0,class:"bcm-card","aria-labelledby":`${i(r)}-digest`},[f("h3",{id:`${i(r)}-digest`},u(i(s)("settings.digestEmail")),9,zw),i($).digest.outcome==="unsubscribed"?(d(),m("p",Lw,u(i(s)("settings.digest.unsubscribed")),1)):i($).digest.outcome==="staleLink"?(d(),m("p",Dw,u(i(s)("settings.digest.staleLink")),1)):(d(),m(q,{key:2},[f("p",null,u(i(s)("settings.digest.prompt")),1),P.value?(d(),m("p",Fw,u(P.value),1)):S("",!0),f("div",Uw,[f("button",{type:"button",class:"bcm-btn bcm-primary",disabled:i($).digest.sending,onClick:v[0]||(v[0]=x=>i(_).unsubscribeDigest())},u(i(s)("settings.digest.confirm")),9,qw)])],64))],8,jw)):S("",!0),i($).phase==="loading"||i($).phase==="idle"?(d(),m("p",Bw,u(i(s)("common.loading")),1)):i($).phase==="signIn"?(d(),m("div",Hw,[f("p",null,u(i(s)("settings.signIn")),1),g()?(d(),m("a",{key:0,class:"bcm-btn bcm-primary",href:g()??void 0},u(i(s)("common.signIn")),9,Vw)):S("",!0)])):i($).phase==="failed"?(d(),m("div",Kw,[f("span",null,u(I.value),1),f("button",{type:"button",class:"bcm-btn",onClick:v[1]||(v[1]=x=>i(_).load())},u(i(s)("common.retry")),1)])):i($).settings?(d(),m(q,{key:4},[f("ul",Ww,[(d(!0),m(q,null,fe(i(Mw),x=>(d(),m("li",{key:x},[f("label",Yw,[f("input",{type:"checkbox",name:x,checked:i($).settings[x],disabled:!!i($).saving[x],onChange:N=>k(x,N)},null,40,Gw),f("span",null,u(i(s)(i(y)[x])),1)])]))),128))]),i(_).pushShown()?(d(),m("section",{key:0,class:"bcm-card","aria-labelledby":`${i(r)}-push`},[f("h3",{id:`${i(r)}-push`},u(i(s)("settings.pushEnabled")),9,Jw),f("p",Xw,u(i(s)("settings.push.carries")),1),i($).push.support==="inApp"?(d(),m(q,{key:0},[f("p",null,u(i(s)("settings.push.inAppExplain")),1),f("p",null,[f("a",{href:T.value,target:"_blank",rel:"noopener"},u(i(s)("settings.push.openInBrowser")),9,Qw)]),f("p",e1,u(T.value),1)],64)):i($).push.support==="iosInstall"?(d(),m("p",t1,u(i(s)("settings.push.iosGuide")),1)):i($).push.support==="unsupported"?(d(),m("p",n1,u(i(s)("settings.push.unsupported")),1)):(d(),m(q,{key:3},[i($).push.note==="reset"?(d(),m("p",o1,u(i(s)("settings.push.reset")),1)):i($).push.note==="denied"?(d(),m("p",s1,u(i(s)("settings.push.denied")),1)):i($).push.note==="refused"?(d(),m("p",i1,u(i(s)("settings.push.refused")),1)):S("",!0),R.value&&i($).push.note===null?(d(),m("p",r1,u(R.value),1)):S("",!0),f("div",a1,[i($).push.status==="on"?(d(),m("button",{key:0,type:"button",class:"bcm-btn",onClick:v[2]||(v[2]=x=>i(_).disablePush())},u(i(s)("settings.push.disable")),1)):(d(),m("button",{key:1,type:"button",class:"bcm-btn bcm-primary",disabled:i($).push.status==="busy"||i($).push.status==="checking",onClick:v[3]||(v[3]=x=>i(_).enablePush())},u(i(s)("settings.push.enable")),9,l1))])],64))],8,Zw)):S("",!0)],64)):S("",!0),f("p",c1,u(M.value),1)],8,Rw)):S("",!0)}});function d1(e,t){if(typeof document>"u"||typeof URL.createObjectURL!="function")return;const n=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),s=URL.createObjectURL(n),o=document.createElement("a");o.href=s,o.download=t,o.style.display="none",document.body.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(s),1e3)}function f1(e,t=new Date){const n=t.toISOString().slice(0,10);return`${e.replace(/[^\p{L}\p{N}_-]+/gu,"-").replace(/^-+|-+$/g,"")||"export"}-${n}.json`}const Vi=()=>({body:"",sending:!1,failure:null});function m1(e){const{client:t}=e,n=new AbortController,s={signal:n.signal},o=Re({phase:"idle",failure:null,me:null,notifications:[],decisions:[],appeals:[],reports:[],blocks:[],statement:{phase:"idle",value:null,failure:null,appeal:Vi()},notice:{phase:"idle",value:null,failure:null,appeal:Vi()},profile:null,purgeAfter:null,exporting:!1,busy:{},announcement:null,announceId:0});let r=!1;const a=Vt(null),l=T=>{o.announcement=T,o.announceId+=1},c=T=>({key:`error.${T.code}`});async function p(){o.phase="loading",o.failure=null;const T=await t.me.get(s);if(r)return;if(!T.ok){if(T.code==="signIn"){o.phase="signIn";return}o.phase="failed",o.failure=T;return}if(o.me=T.value,T.value.needs.includes("sign_in")){o.phase="signIn";return}if(!T.value.member){o.phase="ready";return}const[g,k,M,w,v]=await Promise.all([t.me.notifications.list({},s),t.me.decisions.list({},s),t.me.appeals.list(s),t.me.reports.list(s),t.blocks.list(s)]);if(r)return;g.ok&&(o.notifications=g.value.items.filter(N=>Ua(N.code))),k.ok&&(o.decisions=[...k.value.items]),M.ok&&(o.appeals=[...M.value.items]),w.ok&&(o.reports=[...w.value.items]),v.ok&&(o.blocks=[...v.value.blocks]);const x=[g,k,M,w,v].find(N=>!N.ok);x&&!x.ok&&l(c(x)),o.phase="ready"}let h=null,b=0;async function _(T){const g=++b;T!==h&&(h=T,o.statement.value=null,o.statement.appeal=Vi()),o.statement.phase="loading",o.statement.failure=null;const k=await t.me.decisions.get({decisionId:T},s);if(!(r||g!==b)){if(k.ok){o.statement.value=k.value,o.statement.phase="ready";return}o.statement.failure=k,o.statement.phase=k.code==="signIn"?"signIn":"failed"}}async function $(T){if(T===null){o.notice.phase="missing";return}o.notice.phase="loading",o.notice.failure=null;const g=await t.notices.status({receipt:T},s);if(!r){if(g.ok){o.notice.value=g.value,o.notice.phase="ready";return}o.notice.failure=g,o.notice.phase="failed"}}let y=null;const I=T=>lt(Ze(T.body)),R=T=>!T.sending&&I(T)>0&&I(T)<=Tn;function P(){if(a.value||r||!o.me?.member||o.me.acceptances.art9Refused!==!0)return;const T=ks({client:t,lang:De(e.lang),signal:n.signal,offerArt9:!0,onDone:g=>{o.me=g,a.value=null,g.acceptances.art9Consent==="accepted"&&l({key:"panel.art9Given"})},onSignIn:()=>{a.value=null,o.phase="signIn"}});a.value=T,T.load()}return{state:o,consent:a,giveConsent:P,closeConsent(){a.value=null},loadMember:p,loadStatement:_,async loadNotice(T){y=T,await $(T)},unreadCount:()=>o.notifications.filter(T=>T.readAt===null).length,async markAllRead(){const T=o.notifications.filter(M=>M.readAt===null).map(M=>M.id);if(T.length===0||o.busy.markRead)return;o.busy.markRead=!0;const g=await t.me.notifications.markRead({ids:T},s);if(delete o.busy.markRead,r)return;if(!g.ok)return l(c(g));const k=new Date().toISOString();o.notifications=o.notifications.map(M=>T.includes(M.id)?{...M,readAt:k}:M)},async fileAppeal(){const T=o.statement,g=T.appeal;if(!T.value||!T.value.canAppeal||!R(g))return;const k=T.value.decisionId;g.sending=!0,g.failure=null;const M=await t.me.appeals.file({decisionId:k,body:Ze(g.body)},s);if(g.sending=!1,!(r||k!==h)){if(!M.ok){g.failure=M;return}g.body="",l({key:"statement.appealSent"}),await _(k)}},async withdrawAppeal(){const T=o.statement,g=T.value?.appeal;if(!T.value||!g||g.status!=="open"||o.busy.withdraw)return;const k=T.value.decisionId;o.busy.withdraw=!0;const M=await t.me.appeals.withdraw({appealId:g.appealId},s);if(delete o.busy.withdraw,!(r||k!==h)){if(!M.ok)return l(c(M));l({key:"statement.appealWithdrawn"}),await _(k)}},async fileNoticeAppeal(){const T=o.notice,g=T.appeal;if(!T.value||!T.value.appeal.canAppeal||y===null||!R(g))return;g.sending=!0,g.failure=null;const k=await t.notices.appeal({receipt:y,body:Ze(g.body)},s);if(g.sending=!1,!r){if(!k.ok){g.failure=k;return}g.body="",l({key:"notice.appealSent"}),await $(y)}},async withdrawNoticeAppeal(){if(!o.notice.value?.appeal.open||y===null||o.busy.noticeWithdraw)return;o.busy.noticeWithdraw=!0;const T=await t.notices.withdrawAppeal({receipt:y},s);if(delete o.busy.noticeWithdraw,!r){if(!T.ok)return l(c(T));l({key:"statement.appealWithdrawn"}),await $(y)}},async withdrawConsent(){if(o.busy.consent)return!1;o.busy.consent=!0;const T=await t.me.consents.withdraw({kind:"art9_consent"},s);return delete o.busy.consent,r?!1:T.ok?(o.me&&(o.me={...o.me,acceptances:{...o.me.acceptances,art9Consent:T.value.state}}),l({key:"panel.art9Withdrawn"}),!0):(l(c(T)),!1)},async unblock(T){const g=`block:${T}`;if(o.busy[g])return;o.busy[g]=!0;const k=await t.blocks.set({memberId:T,blocked:!1},s);if(delete o.busy[g],!r){if(!k.ok)return l(c(k));o.blocks=o.blocks.filter(M=>M.memberId!==T),l({key:"discussion.unblocked"})}},editProfile(){const T=o.me?.profile;T&&(o.profile={displayName:T.displayName,handle:T.handle,avatarPreset:T.avatarPreset,sending:!1,failure:null,fields:[]})},cancelProfile(){o.profile=null},async saveProfile(){const T=o.profile,g=o.me?.profile;if(!T||!g||T.sending||!Yl(T.displayName)||!Zl(T.handle)||Qn(T.handle)==="")return;const k={},M=ys(T.displayName),w=Qn(T.handle);if(M!==g.displayName&&(k.displayName=M),w!==g.handle&&(k.handle=w),T.avatarPreset!==g.avatarPreset&&(k.avatarPreset=T.avatarPreset),Object.keys(k).length===0){o.profile=null;return}T.sending=!0,T.failure=null,T.fields=[];const v=await t.me.updateProfile(k,s);if(T.sending=!1,!r){if(!v.ok){T.failure=v,T.fields=v.code==="handle"?["handle"]:v.code==="name"?["displayName"]:v.fields??[];return}o.me&&(o.me={...o.me,profile:v.value.profile}),o.profile=null}},async exportData(T){if(o.exporting)return;o.exporting=!0;const g=await t.me.export(s);if(o.exporting=!1,!r){if(!g.ok)return l(c(g));T(g.value)}},async erase(){if(o.busy.erase)return!1;o.busy.erase=!0;const T=await t.me.erase(s);return delete o.busy.erase,r?!1:T.ok?(o.purgeAfter=T.value.purgeAfter,o.me?.member&&(o.me={...o.me,member:{...o.me.member,status:T.value.status}}),!0):(l(c(T)),!1)},async cancelErase(){if(o.busy.erase)return;o.busy.erase=!0;const T=await t.me.cancelErase(s);if(delete o.busy.erase,!r){if(!T.ok)return l(c(T));o.purgeAfter=null,o.me?.member&&(o.me={...o.me,member:{...o.me.member,status:T.value.status}}),l({key:"panel.eraseCancelled"})}},erasing:()=>o.me?.member?.status==="deletion_requested",appealLength:I,canAppealWith:R,dispose(){r=!0,n.abort(),a.value=null}}}const Ki=new WeakMap;function p1(e){if(typeof location<"u"&&location.hash.startsWith("#t=")){const t=Tl(location.hash);return cp(),e&&Ki.set(e,t),t}return e&&Ki.has(e)?Ki.get(e)??null:void 0}const h1=["aria-labelledby"],b1=["id"],g1={class:"bcm-dl"},v1={class:"bcm-muted"},y1={key:0,class:"bcm-muted"},_1={key:0},k1={class:"bcm-facts"},w1=["aria-labelledby"],$1=["id"],x1={class:"bcm-row"},I1=["disabled"],T1={key:0,class:"bcm-muted"},C1={class:"bcm-field"},S1=["for"],A1=["id","aria-describedby","aria-invalid"],O1=["id"],E1={key:0,class:"bcm-error",role:"alert"},M1={class:"bcm-row"},P1=["disabled"],R1={key:2},N1={key:3},j1=$e({__name:"NoticeStatusView",props:{notice:{},appeal:{},withdrawing:{type:Boolean}},emits:["appeal","withdraw"],setup(e,{emit:t}){const n=e,s=t,{t:o,lang:r}=vt(),a=Ve("bcm-notice-status"),l=z(()=>n.notice),c=z(()=>Bt(`category.${l.value.category}`)),p=z(()=>Bt(`caseStatus.${l.value.status}`)),h=z(()=>Ei(l.value.outcome)),b=z(()=>h.value!==null&&l.value.statement===null&&!l.value.appeal.canAppeal&&!l.value.appeal.open),_=z(()=>lt(Ze(n.appeal.body))),$=z(()=>!n.appeal.sending&&_.value>0&&_.value<=Tn),y=z(()=>l.value.appeal.closesAt?ql(l.value.appeal.closesAt):!1),I=z(()=>{const R=n.appeal.failure;if(!R)return"";const P=Ie(R,r.value);return o(P.key,P.params)});return(R,P)=>(d(),m("section",{class:"bcm-section","aria-labelledby":`${i(a)}-title`},[f("h3",{id:`${i(a)}-title`},u(i(o)("notice.statusTitle")),9,b1),f("dl",g1,[c.value?(d(),m(q,{key:0},[f("dt",null,u(i(o)("notice.category")),1),f("dd",null,u(i(o)(c.value)),1)],64)):S("",!0),p.value?(d(),m(q,{key:1},[f("dt",null,u(i(o)("notice.statusTitle")),1),f("dd",null,u(i(o)(p.value)),1)],64)):S("",!0)]),f("p",v1,u(i(o)("notice.submittedAt",{date:i(Pe)(i(r),l.value.submittedAt)})),1),l.value.decidedAt?(d(),m("p",y1,u(i(o)("notice.decidedAt",{date:i(Pe)(i(r),l.value.decidedAt)})),1)):S("",!0),h.value?(d(),m(q,{key:1},[f("h4",null,u(i(o)("notice.outcome")),1),f("p",null,u(i(o)(h.value)),1),b.value?(d(),m("p",_1,u(i(o)("notice.redress")),1)):S("",!0)],64)):S("",!0),l.value.statement?(d(),m(q,{key:2},[f("h4",null,u(i(o)("notice.statement")),1),f("pre",k1,u(l.value.statement),1)],64)):S("",!0),l.value.decidedAt&&!b.value?(d(),m("section",{key:3,class:"bcm-card","aria-labelledby":`${i(a)}-appeal`},[f("h4",{id:`${i(a)}-appeal`},u(i(o)("notice.appealTitle")),9,$1),l.value.appeal.open?(d(),m(q,{key:0},[f("p",null,u(i(o)("notice.appealOpen")),1),f("div",x1,[f("button",{type:"button",class:"bcm-btn",disabled:e.withdrawing,onClick:P[0]||(P[0]=T=>s("withdraw"))},u(i(o)("notice.appealWithdraw")),9,I1)])],64)):l.value.appeal.canAppeal?(d(),m(q,{key:1},[f("p",null,u(i(o)("notice.appealLede")),1),l.value.appeal.closesAt?(d(),m("p",T1,u(i(o)("notice.appealUntil",{date:i(Pe)(i(r),l.value.appeal.closesAt)})),1)):S("",!0),f("form",{class:"bcm-form",novalidate:"",onSubmit:P[2]||(P[2]=mt(T=>$.value&&s("appeal"),["prevent"]))},[f("div",C1,[f("label",{for:`${i(a)}-body`},u(i(o)("notice.appealBody")),9,S1),ge(f("textarea",{id:`${i(a)}-body`,"onUpdate:modelValue":P[1]||(P[1]=T=>e.appeal.body=T),class:"bcm-input bcm-textarea",rows:"5","aria-describedby":`${i(a)}-counter`,"aria-invalid":_.value>i(Tn)},null,8,A1),[[Xe,e.appeal.body]]),f("p",{id:`${i(a)}-counter`,class:"bcm-counter"},u(i(o)("statement.appealCounter",{length:_.value,max:i(Tn)})),9,O1)]),I.value?(d(),m("p",E1,u(I.value),1)):S("",!0),f("div",M1,[f("button",{type:"submit",class:"bcm-btn bcm-primary",disabled:!$.value},u(e.appeal.sending?i(o)("statement.appealSending"):i(o)("notice.appealSubmit")),9,P1)])],32)],64)):y.value?(d(),m("p",R1,u(i(o)("notice.appealClosed")),1)):(d(),m("p",N1,u(i(o)("statement.appealUnavailable")),1))],8,w1)):S("",!0)],8,h1))}}),z1=["aria-labelledby"],L1=["id"],D1={class:"bcm-muted"},F1={class:"bcm-dl"},U1={key:0,class:"bcm-muted"},q1={key:0},B1={key:0,class:"bcm-text"},H1={key:0,class:"bcm-text"},V1={key:0,class:"bcm-note bcm-text"},K1={class:"bcm-facts"},W1={class:"bcm-text"},Y1={class:"bcm-facts"},G1=["aria-labelledby"],Z1=["id"],J1={key:0,class:"bcm-muted"},X1={class:"bcm-row"},Q1=["disabled"],e$={class:"bcm-muted"},t$={class:"bcm-field"},n$=["for"],o$=["id","aria-describedby","aria-invalid"],s$=["id"],i$={key:0,class:"bcm-error",role:"alert"},r$={class:"bcm-row"},a$=["disabled"],l$={key:0,class:"bcm-muted"},c$=$e({__name:"StatementView",props:{statement:{},appeal:{},withdrawing:{type:Boolean}},emits:["appeal","withdraw"],setup(e,{emit:t}){const n=e,s=t,{t:o,lang:r}=vt(),a=Ve("bcm-statement"),l=z(()=>n.statement),c=z(()=>Bt(`restriction.${l.value.restriction}`)),p=z(()=>Bt(`basis.${l.value.basis}`)),h=z(()=>Bt(`category.${l.value.category}`)),b=z(()=>Yp(r.value,l.value.territorialScope)),_=z(()=>l.value.appeal?Bt(`appealStatus.${l.value.appeal.status}`):null),$=z(()=>l.value.subject.kind==="message"?"statement.subjectMessage":l.value.subject.kind==="article"?"statement.subjectArticle":"statement.subjectProfile"),y=z(()=>{const k=l.value.subject;return k.kind==="message"&&k.message?k.message.body??k.message.displayBody:null}),I=z(()=>l.value.appeal?.status==="open"),R=z(()=>ql(l.value.appealWindowClosesAt)),P=z(()=>lt(Ze(n.appeal.body))),T=z(()=>!n.appeal.sending&&P.value>0&&P.value<=Tn),g=z(()=>{const k=n.appeal.failure;if(!k)return"";const M=Ie(k,r.value);return o(M.key,M.params)});return(k,M)=>(d(),m("article",{class:"bcm-section","aria-labelledby":`${i(a)}-title`},[f("h3",{id:`${i(a)}-title`},u(i(o)("statement.title")),9,L1),f("p",D1,u(i(o)("statement.decidedAt",{date:i(Pe)(i(r),l.value.decidedAt)})),1),f("p",null,u(i(o)("statement.provider",{entity:l.value.providerEntity})),1),f("dl",F1,[c.value?(d(),m(q,{key:0},[f("dt",null,u(i(o)("statement.restriction")),1),f("dd",null,[It(u(i(o)(c.value))+" ",1),l.value.restrictionUntil?(d(),m("span",U1,u(i(o)("statement.until",{date:i(Pe)(i(r),l.value.restrictionUntil)})),1)):S("",!0)])],64)):S("",!0),h.value?(d(),m(q,{key:1},[f("dt",null,u(i(o)("report.category")),1),f("dd",null,u(i(o)(h.value)),1)],64)):S("",!0),b.value?(d(),m(q,{key:2},[f("dt",null,u(i(o)("statement.scope")),1),f("dd",null,u(b.value),1)],64)):S("",!0),p.value?(d(),m(q,{key:3},[f("dt",null,u(i(o)("statement.basis")),1),f("dd",null,u(i(o)(p.value)),1)],64)):S("",!0),f("dt",null,u(i(o)("statement.automation")),1),f("dd",null,[l.value.automatedDetection?(d(),m("span",q1,u(i(o)("statement.automatedDetection")),1)):S("",!0),f("span",null,u(l.value.automated?i(o)("statement.automatedDecision"):i(o)("statement.humanDecision")),1)]),l.value.legalGround?(d(),m(q,{key:4},[f("dt",null,u(i(o)("statement.legalGround")),1),f("dd",null,[f("p",null,u(l.value.legalGround),1),l.value.legalExplanation?(d(),m("p",B1,u(l.value.legalExplanation),1)):S("",!0)])],64)):S("",!0),l.value.contractualGround?(d(),m(q,{key:5},[f("dt",null,u(i(o)("statement.contractualGround")),1),f("dd",null,[f("p",null,u(l.value.contractualGround),1),l.value.contractualExplanation?(d(),m("p",H1,u(l.value.contractualExplanation),1)):S("",!0)])],64)):S("",!0),f("dt",null,u(i(o)("statement.subject")),1),f("dd",null,[f("p",null,u(i(o)($.value)),1),y.value?(d(),m("p",V1,[Ee(oc,{text:y.value},null,8,["text"])])):S("",!0)])]),f("h4",null,u(i(o)("statement.facts")),1),f("pre",K1,u(l.value.facts),1),f("h4",null,u(i(o)("statement.redress")),1),f("p",W1,u(l.value.redress),1),f("details",null,[f("summary",null,u(i(o)("statement.full")),1),f("pre",Y1,u(l.value.statement),1)]),f("section",{class:"bcm-card","aria-labelledby":`${i(a)}-appeal`},[f("h4",{id:`${i(a)}-appeal`},u(i(o)("statement.appealTitle")),9,Z1),I.value?(d(),m(q,{key:0},[f("p",null,u(i(o)("statement.appealOpen")),1),_.value?(d(),m("p",J1,u(i(o)(_.value)),1)):S("",!0),f("div",X1,[f("button",{type:"button",class:"bcm-btn",disabled:e.withdrawing,onClick:M[0]||(M[0]=w=>s("withdraw"))},u(i(o)("statement.appealWithdraw")),9,Q1)])],64)):l.value.canAppeal?(d(),m(q,{key:1},[f("p",null,u(i(o)("statement.appealLede")),1),f("p",e$,u(i(o)("statement.appealUntil",{date:i(Pe)(i(r),l.value.appealWindowClosesAt)})),1),f("form",{class:"bcm-form",novalidate:"",onSubmit:M[2]||(M[2]=mt(w=>T.value&&s("appeal"),["prevent"]))},[f("div",t$,[f("label",{for:`${i(a)}-body`},u(i(o)("statement.appealBody")),9,n$),ge(f("textarea",{id:`${i(a)}-body`,"onUpdate:modelValue":M[1]||(M[1]=w=>e.appeal.body=w),class:"bcm-input bcm-textarea",rows:"5","aria-describedby":`${i(a)}-counter`,"aria-invalid":P.value>i(Tn)},null,8,o$),[[Xe,e.appeal.body]]),f("p",{id:`${i(a)}-counter`,class:"bcm-counter"},u(i(o)("statement.appealCounter",{length:P.value,max:i(Tn)})),9,s$)]),g.value?(d(),m("p",i$,u(g.value),1)):S("",!0),f("div",r$,[f("button",{type:"submit",class:"bcm-btn bcm-primary",disabled:!T.value},u(e.appeal.sending?i(o)("statement.appealSending"):i(o)("statement.appealSubmit")),9,a$)])],32)],64)):(d(),m(q,{key:2},[_.value?(d(),m("p",l$,u(i(o)(_.value)),1)):S("",!0),f("p",null,u(R.value?i(o)("statement.appealClosed"):i(o)("statement.appealUnavailable")),1)],64))],8,G1)],8,z1))}}),u$=["lang","aria-labelledby"],d$=["id"],f$={key:0,class:"bcm-note",role:"alert"},m$={key:1,class:"bcm-muted",role:"status"},p$={key:2,class:"bcm-error",role:"alert"},h$={key:0,class:"bcm-muted",role:"status"},b$={key:1,class:"bcm-row"},g$=["href"],v$={key:2,class:"bcm-error",role:"alert"},y$=["href"],_$={key:0,class:"bcm-muted",role:"status"},k$={key:1,class:"bcm-row"},w$=["href"],$$={key:2,class:"bcm-error",role:"alert"},x$=["aria-labelledby"],I$=["id"],T$={key:0,class:"bcm-msg"},C$={class:"bcm-msg-main"},S$={class:"bcm-author"},A$={class:"bcm-handle"},O$={class:"bcm-row"},E$={class:"bcm-field"},M$=["for"],P$=["id","aria-invalid"],R$={class:"bcm-hint"},N$={class:"bcm-field"},j$=["for"],z$=["id","maxlength","aria-invalid"],L$={class:"bcm-hint"},D$={class:"bcm-choices"},F$={class:"bcm-choice"},U$=["name"],q$=["name","value"],B$={key:0,class:"bcm-error",role:"alert"},H$={class:"bcm-row"},V$=["disabled"],K$=["disabled"],W$=["aria-labelledby"],Y$={class:"bcm-row"},G$=["id"],Z$={key:0,class:"bcm-badge"},J$=["disabled"],X$={key:0,class:"bcm-muted"},Q$={key:1,class:"bcm-list"},e0={key:0},t0=["datetime"],n0=["href"],o0=["aria-labelledby"],s0=["id"],i0={key:0,class:"bcm-muted"},r0={key:1,class:"bcm-list"},a0={key:0},l0={key:1,class:"bcm-muted"},c0={class:"bcm-muted"},u0={key:2,class:"bcm-muted"},d0={key:3,class:"bcm-muted"},f0=["href"],m0=["aria-labelledby"],p0=["id"],h0={key:0,class:"bcm-muted"},b0={key:1,class:"bcm-list"},g0={key:0},v0={key:1},y0={key:2},_0=["datetime"],k0={key:3,class:"bcm-muted"},w0=["aria-labelledby"],$0=["id"],x0={key:0,class:"bcm-muted"},I0={key:1,class:"bcm-list"},T0=["disabled","onClick"],C0=["aria-labelledby"],S0=["id"],A0={class:"bcm-row"},O0=["disabled"],E0={key:1,class:"bcm-row"},M0={key:2},P0=["aria-labelledby"],R0=["id"],N0={class:"bcm-hint"},j0={class:"bcm-row"},z0=["disabled"],L0=["aria-labelledby"],D0=["id"],F0={class:"bcm-row"},U0=["disabled"],q0={class:"bcm-hint"},B0={class:"bcm-row"},H0=["disabled"],V0={class:"bcm-sr","aria-live":"polite"},K0=$e({inheritAttrs:!1,__name:"MyCommunityView",props:{apiBase:{},siteBase:{},lang:{},decisionId:{},routes:{},signInHref:{},transport:{type:Function}},setup(e){const t=e,n=ue(De(t.lang,qe())),{t:s,text:o}=gt(n),r=Ve("bcm-panel"),a=ue(null),l=ht(t.siteBase),c=l===null?null:bt(t.apiBase,t.transport,l),p=c?m1({client:c,lang:n.value}):null,h=p?.state??null,b=z(()=>Pt(Mt(t.routes),h?.me?.links,l??"")),_=z(()=>!!t.decisionId),$=ue(!1),y=ue(null),I=Vn();nt(()=>{if(!p)return;const K=p1(I);K!==void 0&&($.value=!0,p.loadNotice(K)),t.decisionId?p.loadStatement(t.decisionId):p.loadMember()}),ve(()=>t.decisionId,(K,D)=>{!p||K===D||(K?p.loadStatement(K):h?.phase==="idle"&&p.loadMember())}),Ge(()=>p?.dispose());const R=z(()=>{const K=h?.failure;if(!K)return"";const D=Ie(K,n.value);return s(D.key,D.params)}),P=z(()=>{const K=h?.statement.failure;if(!K)return"";const D=Ie(K,n.value);return s(D.key,D.params)}),T=z(()=>{const K=h?.notice.failure;if(!K)return"";const D=Ie(K,n.value);return s(D.key,D.params)});function g(){return En(t.signInHref,typeof location>"u"?null:location.pathname)}const k=K=>Jn(b.value.statementPath,K),M=K=>Bt(`notification.${K.code}`),w=K=>Bt(`restriction.${K}`),v=K=>Bt(`category.${K}`),x=K=>Bt(`caseStatus.${K}`),N=K=>{const D=h?.appeals.find(U=>U.decisionId===K);return D?Bt(`appealStatus.${D.status}`):null},O=z(()=>h?.me?.acceptances.art9Consent??null),E=z(()=>h?.me?.acceptances.art9Refused===!0),B=z(()=>h?.me?.member??null),ee=z(()=>h?.me?.profile??null);function re(){p?.exportData(K=>d1(K,f1(s("panel.exportFileName"))))}async function be(){p&&(y.value==="consent"?await p.withdrawConsent():y.value==="erase"&&await p.erase(),y.value=null)}const we=ue("");return ve(()=>h?.announceId,()=>{we.value="";const K=o(h?.announcement);Le(()=>{we.value=K})}),(K,D)=>i(p)&&i(h)?(d(),m("section",{key:0,class:"bcm bcm-panel",lang:n.value,"aria-labelledby":`${i(r)}-title`},[f("h2",{id:`${i(r)}-title`,ref_key:"heading",ref:a,tabindex:"-1"},u(_.value?i(s)("statement.title"):i(s)("panel.title")),9,d$),$.value?(d(),m(q,{key:0},[i(h).notice.phase==="missing"?(d(),m("p",f$,u(i(s)("notice.receiptMissing")),1)):i(h).notice.phase==="loading"?(d(),m("p",m$,u(i(s)("common.loading")),1)):i(h).notice.phase==="failed"?(d(),m("p",p$,u(T.value),1)):i(h).notice.value?(d(),_e(j1,{key:3,notice:i(h).notice.value,appeal:i(h).notice.appeal,withdrawing:!!i(h).busy.noticeWithdraw,onAppeal:D[0]||(D[0]=U=>i(p).fileNoticeAppeal()),onWithdraw:D[1]||(D[1]=U=>i(p).withdrawNoticeAppeal())},null,8,["notice","appeal","withdrawing"])):S("",!0)],64)):S("",!0),_.value?(d(),m(q,{key:1},[i(h).statement.phase==="loading"?(d(),m("p",h$,u(i(s)("common.loading")),1)):i(h).statement.phase==="signIn"?(d(),m("div",b$,[f("p",null,u(i(s)("panel.signIn")),1),g()?(d(),m("a",{key:0,class:"bcm-btn bcm-primary",href:g()??void 0},u(i(s)("common.signIn")),9,g$)):S("",!0)])):i(h).statement.phase==="failed"?(d(),m("p",v$,u(P.value),1)):i(h).statement.value?(d(),_e(c$,{key:3,statement:i(h).statement.value,appeal:i(h).statement.appeal,withdrawing:!!i(h).busy.withdraw,onAppeal:D[2]||(D[2]=U=>i(p).fileAppeal()),onWithdraw:D[3]||(D[3]=U=>i(p).withdrawAppeal())},null,8,["statement","appeal","withdrawing"])):S("",!0),f("p",null,[f("a",{href:b.value.myCommunityPath},u(i(s)("common.back")),9,y$)])],64)):(d(),m(q,{key:2},[i(h).phase==="loading"?(d(),m("p",_$,u(i(s)("common.loading")),1)):i(h).phase==="signIn"&&!$.value?(d(),m("div",k$,[f("p",null,u(i(s)("panel.signIn")),1),g()?(d(),m("a",{key:0,class:"bcm-btn bcm-primary",href:g()??void 0},u(i(s)("common.signIn")),9,w$)):S("",!0)])):i(h).phase==="failed"?(d(),m("p",$$,u(R.value),1)):i(h).phase==="ready"?(d(),m(q,{key:3},[ee.value&&B.value?(d(),m("section",{key:0,class:"bcm-section","aria-labelledby":`${i(r)}-profile`},[f("h3",{id:`${i(r)}-profile`},u(i(s)("panel.profile")),9,I$),i(h).profile?(d(),m("form",{key:1,class:"bcm-form bcm-card",novalidate:"",onSubmit:D[10]||(D[10]=mt(U=>i(p).saveProfile(),["prevent"]))},[f("div",E$,[f("label",{for:`${i(r)}-name`},u(i(s)("onboarding.displayName")),9,M$),ge(f("input",{id:`${i(r)}-name`,"onUpdate:modelValue":D[5]||(D[5]=U=>i(h).profile.displayName=U),class:"bcm-input",autocomplete:"nickname","aria-invalid":i(h).profile.fields.includes("displayName")},null,8,P$),[[Xe,i(h).profile.displayName]]),f("p",R$,u(i(s)("onboarding.displayNameHint")),1)]),f("div",N$,[f("label",{for:`${i(r)}-handle`},u(i(s)("onboarding.handle")),9,j$),ge(f("input",{id:`${i(r)}-handle`,"onUpdate:modelValue":D[6]||(D[6]=U=>i(h).profile.handle=U),class:"bcm-input",autocomplete:"username",autocapitalize:"none",spellcheck:"false",maxlength:i(_s),"aria-invalid":i(h).profile.fields.includes("handle")},null,8,z$),[[Xe,i(h).profile.handle]]),f("p",L$,u(i(s)("onboarding.handleHint",{min:i(Gl),max:i(_s),days:i(ja)})),1)]),f("fieldset",D$,[f("legend",null,u(i(s)("onboarding.avatar")),1),f("label",F$,[ge(f("input",{"onUpdate:modelValue":D[7]||(D[7]=U=>i(h).profile.avatarPreset=U),type:"radio",name:`${i(r)}-avatar`,value:null},null,8,U$),[[xn,i(h).profile.avatarPreset]]),f("span",null,u(i(s)("onboarding.avatarNone")),1)]),(d(!0),m(q,null,fe(i(zi),U=>(d(),m("label",{key:U.id,class:"bcm-choice"},[ge(f("input",{"onUpdate:modelValue":D[8]||(D[8]=Fe=>i(h).profile.avatarPreset=Fe),type:"radio",name:`${i(r)}-avatar`,value:U.id},null,8,q$),[[xn,i(h).profile.avatarPreset]]),f("span",null,u(U.emoji),1)]))),128))]),i(h).profile.failure?(d(),m("p",B$,u(i(o)(i(Ie)(i(h).profile.failure,n.value))),1)):S("",!0),f("div",H$,[D[22]||(D[22]=f("span",{class:"bcm-spacer"},null,-1)),f("button",{type:"button",class:"bcm-btn",disabled:i(h).profile.sending,onClick:D[9]||(D[9]=U=>i(p).cancelProfile())},u(i(s)("composer.cancel")),9,V$),f("button",{type:"submit",class:"bcm-btn bcm-primary",disabled:i(h).profile.sending},u(i(h).profile.sending?i(s)("composer.sending"):i(s)("composer.save")),9,K$)])],32)):(d(),m("div",T$,[Ee(Li,{author:{kind:"member",memberId:B.value.memberId,displayName:ee.value.displayName,avatarPreset:ee.value.avatarPreset}},null,8,["author"]),f("div",C$,[f("span",S$,u(ee.value.displayName),1),f("span",A$,u(ee.value.handle),1),f("div",O$,[f("button",{type:"button",class:"bcm-btn bcm-small",onClick:D[4]||(D[4]=U=>i(p).editProfile())},u(i(s)("panel.profileEdit")),1)])])]))],8,x$)):S("",!0),f("section",{class:"bcm-section","aria-labelledby":`${i(r)}-notifications`},[f("div",Y$,[f("h3",{id:`${i(r)}-notifications`},u(i(s)("panel.notifications")),9,G$),i(p).unreadCount()>0?(d(),m("span",Z$,u(i(s)("panel.unread",{count:i(p).unreadCount()})),1)):S("",!0),D[23]||(D[23]=f("span",{class:"bcm-spacer"},null,-1)),i(p).unreadCount()>0?(d(),m("button",{key:1,type:"button",class:"bcm-btn bcm-small",disabled:!!i(h).busy.markRead,onClick:D[11]||(D[11]=U=>i(p).markAllRead())},u(i(s)("panel.markRead")),9,J$)):S("",!0)]),i(h).notifications.length===0?(d(),m("p",X$,u(i(s)("panel.notificationsEmpty")),1)):(d(),m("ul",Q$,[(d(!0),m(q,null,fe(i(h).notifications,U=>(d(),m("li",{key:U.id,class:Ke({"bcm-unread":U.readAt===null})},[M(U)?(d(),m("p",e0,u(i(s)(M(U))),1)):S("",!0),f("time",{class:"bcm-time",datetime:U.createdAt},u(i(Pe)(n.value,U.createdAt)),9,t0),U.decisionId&&k(U.decisionId)?(d(),m("a",{key:1,href:k(U.decisionId)??void 0},u(i(s)("sanction.statement")),9,n0)):S("",!0)],2))),128))]))],8,W$),f("section",{class:"bcm-section","aria-labelledby":`${i(r)}-statements`},[f("h3",{id:`${i(r)}-statements`},u(i(s)("panel.statements")),9,s0),i(h).decisions.length===0?(d(),m("p",i0,u(i(s)("panel.statementsEmpty")),1)):(d(),m("ul",r0,[(d(!0),m(q,null,fe(i(h).decisions,U=>(d(),m("li",{key:U.decisionId},[w(U.restriction)?(d(),m("p",a0,[f("strong",null,u(i(s)(w(U.restriction))),1)])):S("",!0),v(U.category)?(d(),m("p",l0,u(i(s)(v(U.category))),1)):S("",!0),f("p",c0,u(i(s)("statement.decidedAt",{date:i(Pe)(n.value,U.decidedAt)})),1),N(U.decisionId)?(d(),m("p",u0,u(i(s)(N(U.decisionId))),1)):U.canAppeal?(d(),m("p",d0,u(i(s)("statement.appealUntil",{date:i(Pe)(n.value,U.appealWindowClosesAt)})),1)):S("",!0),k(U.decisionId)?(d(),m("a",{key:4,href:k(U.decisionId)??void 0},u(i(s)("sanction.statement")),9,f0)):S("",!0)]))),128))]))],8,o0),f("section",{class:"bcm-section","aria-labelledby":`${i(r)}-reports`},[f("h3",{id:`${i(r)}-reports`},u(i(s)("panel.reports")),9,p0),i(h).reports.length===0?(d(),m("p",h0,u(i(s)("panel.reportsEmpty")),1)):(d(),m("ul",b0,[(d(!0),m(q,null,fe(i(h).reports,U=>(d(),m("li",{key:U.caseId},[v(U.category)?(d(),m("p",g0,[f("strong",null,u(i(s)(v(U.category))),1)])):S("",!0),x(U.status)?(d(),m("p",v0,u(i(s)(x(U.status))),1)):S("",!0),i(Ei)(U.outcome)?(d(),m("p",y0,u(i(s)(i(Ei)(U.outcome))),1)):S("",!0),f("time",{class:"bcm-time",datetime:U.reportedAt},u(i(Pe)(n.value,U.reportedAt)),9,_0),U.decidedAt?(d(),m("p",k0,u(i(s)("statement.decidedAt",{date:i(Pe)(n.value,U.decidedAt)})),1)):S("",!0)]))),128))]))],8,m0),B.value?(d(),m("section",{key:1,class:"bcm-section","aria-labelledby":`${i(r)}-blocks`},[f("h3",{id:`${i(r)}-blocks`},u(i(s)("panel.blocks")),9,$0),i(h).blocks.length===0?(d(),m("p",x0,u(i(s)("panel.blocksEmpty")),1)):(d(),m("ul",I0,[(d(!0),m(q,null,fe(i(h).blocks,U=>(d(),m("li",{key:U.memberId,class:"bcm-row"},[f("span",null,u(U.author.kind==="member"&&"displayName"in U.author&&U.author.displayName?U.author.displayName:i(s)("author.deleted")),1),D[24]||(D[24]=f("span",{class:"bcm-spacer"},null,-1)),f("button",{type:"button",class:"bcm-btn bcm-small",disabled:!!i(h).busy[`block:${U.memberId}`],onClick:Fe=>i(p).unblock(U.memberId)},u(i(s)("discussion.unblock")),9,T0)]))),128))]))],8,w0)):S("",!0),B.value&&O.value!==null?(d(),m("section",{key:2,class:"bcm-section","aria-labelledby":`${i(r)}-consents`},[f("h3",{id:`${i(r)}-consents`},u(i(s)("panel.consents")),9,S0),O.value==="accepted"?(d(),m(q,{key:0},[f("p",null,u(i(s)("panel.art9Given")),1),f("div",A0,[f("button",{type:"button",class:"bcm-btn",disabled:!!i(h).busy.consent,onClick:D[12]||(D[12]=U=>y.value="consent")},u(i(s)("panel.art9Withdraw")),9,O0)])],64)):E.value?(d(),m(q,{key:1},[f("p",null,u(i(s)("panel.art9Refused")),1),i(p).consent.value?(d(),_e(So,{key:0,model:i(p).consent.value,"rules-href":b.value.rulesPath,"terms-href":b.value.termsPath,onCancel:D[13]||(D[13]=U=>i(p).closeConsent())},null,8,["model","rules-href","terms-href"])):(d(),m("div",E0,[f("button",{type:"button",class:"bcm-btn bcm-primary",onClick:D[14]||(D[14]=U=>i(p).giveConsent())},u(i(s)("discussion.giveConsent")),1)]))],64)):(d(),m("p",M0,u(i(s)("panel.art9NotGiven")),1))],8,C0)):S("",!0),B.value?(d(),m("section",{key:3,class:"bcm-section","aria-labelledby":`${i(r)}-export`},[f("h3",{id:`${i(r)}-export`},u(i(s)("panel.export")),9,R0),f("p",N0,u(i(s)("panel.exportHint")),1),f("div",j0,[f("button",{type:"button",class:"bcm-btn",disabled:i(h).exporting,onClick:D[15]||(D[15]=U=>re())},u(i(h).exporting?i(s)("panel.exporting"):i(s)("panel.export")),9,z0)])],8,P0)):S("",!0),B.value?(d(),m("section",{key:4,class:"bcm-section","aria-labelledby":`${i(r)}-erase`},[f("h3",{id:`${i(r)}-erase`},u(i(s)("panel.erase")),9,D0),i(p).erasing()?(d(),m(q,{key:0},[f("p",null,u(i(h).purgeAfter?i(s)("panel.eraseScheduled",{date:i(Pe)(n.value,i(h).purgeAfter)}):i(s)("notification.erasure_scheduled")),1),f("div",F0,[f("button",{type:"button",class:"bcm-btn bcm-primary",disabled:!!i(h).busy.erase,onClick:D[16]||(D[16]=U=>i(p).cancelErase())},u(i(s)("panel.eraseCancel")),9,U0)])],64)):(d(),m(q,{key:1},[f("p",q0,u(i(s)("panel.eraseExplain")),1),f("div",B0,[f("button",{type:"button",class:"bcm-btn bcm-danger",disabled:!!i(h).busy.erase,onClick:D[17]||(D[17]=U=>y.value="erase")},u(i(s)("panel.erase")),9,H0)])],64))],8,L0)):S("",!0)],64)):S("",!0)],64)),f("p",V0,u(we.value),1),y.value==="consent"?(d(),_e(ws,{key:3,title:"panel.art9WithdrawTitle",explain:"panel.art9WithdrawExplain",confirm:"panel.art9WithdrawConfirm",cancel:"panel.art9WithdrawCancel",busy:!!i(h).busy.consent,"fallback-focus":()=>a.value,onConfirm:D[18]||(D[18]=U=>be()),onCancel:D[19]||(D[19]=U=>y.value=null)},null,8,["busy","fallback-focus"])):S("",!0),y.value==="erase"?(d(),_e(ws,{key:4,title:"panel.eraseTitle",explain:"panel.eraseExplain",confirm:"panel.eraseConfirm",cancel:"panel.eraseKeep",danger:"",busy:!!i(h).busy.erase,"fallback-focus":()=>a.value,onConfirm:D[20]||(D[20]=U=>be()),onCancel:D[21]||(D[21]=U=>y.value=null)},null,8,["busy","fallback-focus"])):S("",!0)],8,u$)):S("",!0)}});function W0(e){const t=new AbortController,n={signal:t.signal},s=Re({target:e.target,category:"",ruleId:"",rules:null,description:"",name:"",email:"",goodFaith:!1,captcha:e.captcha?"loading":"off",token:null,resetSignal:0,sending:!1,failure:null,receipt:null,statusLink:null});let o=!1;const r=()=>s.category!==Hf,a=()=>lt(Ze(s.description));function l(){const h=a();return!s.sending&&s.receipt===null&&s.target!==null&&s.category!==""&&h>0&&h<=mi&<(s.name.trim())<=Ra&&s.goodFaith&&(s.captcha==="off"||s.captcha==="ready"&&s.token!==null)}function c(){o||(o=!0,e.client.legal.current({kind:"rules",locale:e.lang},n).then(h=>{s.rules=h.ok?Gn(h.value.bodyJson):[]}))}async function p(){if(!l()||!s.target||s.category==="")return;s.sending=!0,s.failure=null;const h={category:s.category,target:s.target,description:Ze(s.description),confirmations:[jf]};s.category==="rules"&&s.ruleId!==""&&(h.ruleId=s.ruleId);const b=s.name.trim(),_=s.email.trim();r()&&(b!==""||_!=="")&&(h.notifier={name:b||null,email:_||null,locale:e.lang}),s.token!==null&&(h.turnstileToken=s.token),s.token=null;const $=await e.client.notices.submit(h,n);if(s.sending=!1,$.ok){s.receipt=$.value,s.statusLink=rp(e.noticesPath,$.value.receipt),e.onSubmitted?.({contactKept:$.value.contactKept});return}s.failure=$,s.captcha!=="off"&&(s.resetSignal+=1)}return{state:s,contactAllowed:r,canSubmit:l,descriptionLength:a,setCategory(h){s.category=h,h!=="rules"?s.ruleId="":c()},setToken(h){s.token=h,h!==null&&s.captcha==="loading"&&(s.captcha="ready")},setCaptcha(h){s.captcha!=="off"&&(s.captcha=h)},submit:p,dispose(){t.abort()}}}const Y0="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit";let Oo=null;function G0(e){const t=window;return t.turnstile?Promise.resolve(t.turnstile):Oo||(Oo=new Promise((n,s)=>{const o=document.createElement("script");o.src=Y0,o.async=!0,o.defer=!0,e&&(o.nonce=e),o.onload=()=>t.turnstile?n(t.turnstile):s(new Error("[blogmcp-community] the Turnstile script loaded without its API")),o.onerror=()=>s(new Error("[blogmcp-community] the Turnstile script failed to load")),document.head.appendChild(o)}).catch(n=>{throw Oo=null,n}),Oo)}async function Z0(e,t){const n=await G0(t.nonce),s=n.render(e,{sitekey:t.siteKey,action:Nf,language:t.language,appearance:"interaction-only",callback:r=>t.onToken(r),"expired-callback":()=>t.onToken(null),"error-callback":()=>t.onToken(null),"timeout-callback":()=>t.onToken(null)});let o=!1;return{reset(){o||(t.onToken(null),n.reset(s))},remove(){o||(o=!0,n.remove(s))}}}const J0=["lang","aria-labelledby"],X0=["id"],Q0={key:0},ex=["href"],tx=["value","aria-label"],nx={key:2,class:"bcm-note"},ox={class:"bcm-field"},sx={class:"bcm-label"},ix={class:"bcm-choices"},rx=["name","value","checked","onChange"],ax={key:0,class:"bcm-field"},lx=["for"],cx=["id"],ux=["value"],dx={class:"bcm-field"},fx=["for"],mx=["id","aria-describedby","aria-invalid"],px=["id"],hx={key:1,class:"bcm-fieldset"},bx={class:"bcm-hint"},gx={class:"bcm-field"},vx=["for"],yx=["id","maxlength"],_x={class:"bcm-field"},kx=["for"],wx=["id","aria-invalid"],$x={key:2,class:"bcm-note"},xx={key:3,class:"bcm-turnstile"},Ix={key:0,class:"bcm-error",role:"alert"},Tx={class:"bcm-check"},Cx={key:4,class:"bcm-error",role:"alert"},Sx={class:"bcm-row"},Ax=["disabled"],Ox=["lang","aria-labelledby"],Ex=["id"],Mx=["href"],Px=$e({inheritAttrs:!1,__name:"NoticeFormView",props:{apiBase:{},siteBase:{},lang:{},turnstileSiteKey:{},target:{},articleId:{},routes:{},transport:{type:Function}},setup(e){const t=e,n=Vn(),s=ue(De(t.lang,qe())),{t:o}=gt(s),r=Ve("bcm-notice"),a=ue(null),l=ue(null);function c(){const x=gs(t.target);return x||(t.articleId?gs({articleId:t.articleId}):typeof location>"u"?null:Pp(location.hash))}const p=ht(t.siteBase),h=z(()=>Pt(Mt(t.routes),null,p??"")),b=Vt(null),_=p===null?null:bt(t.apiBase,t.transport,p),$=c(),y=!!_&&!$;y&&qt("notice-target","[blogmcp-community] <blogmcp-notice-form> has no target (a target, an article-id or the report link’s #c=…&s= fragment): it shows where a report starts instead of the form"),_&&$&&(b.value=W0({client:_,lang:s.value,target:$,captcha:!!t.turnstileSiteKey,noticesPath:h.value.noticesPath,onSubmitted:x=>n?.dispatchEvent(new CustomEvent("bcm-notice-submitted",{detail:x,bubbles:!0,composed:!0}))}));const I=z(()=>b.value?.state??null),R=z(()=>I.value?.target?Ep(I.value.target):null),P=z(()=>R.value==="message"?o("notice.targetMessage"):R.value==="article"?o("notice.targetArticle"):o("notice.targetProfile")),T=x=>`category.${x}`,g=z(()=>{const x=I.value?.failure;if(!x)return"";const N=Ie(x,s.value);return o(N.key,N.params)}),k=z(()=>{const x=I.value?.statusLink;return x&&typeof location<"u"?`${location.origin}${x}`:x??""});let M=null,w=null,v=!1;return nt(async()=>{const x=b.value;if(!(!x||!t.turnstileSiteKey||!n)){w=document.createElement("div"),w.slot="turnstile",n.appendChild(w);try{const N=n.nonce||n.getAttribute("nonce")||void 0,O=await Z0(w,{siteKey:t.turnstileSiteKey,language:s.value,onToken:E=>x.setToken(E),nonce:N});if(v){O.remove();return}M=O,x.setCaptcha("ready")}catch{x.setCaptcha("unavailable")}}}),ve(()=>I.value?.resetSignal,(x,N)=>{x!==void 0&&N!==void 0&&x!==N&&M?.reset()}),ve(()=>I.value?.receipt,x=>{x&&(M?.remove(),M=null,Le(()=>l.value?.focus()))}),Ge(()=>{v=!0,M?.remove(),M=null,w?.remove(),w=null,b.value?.dispose()}),(x,N)=>b.value&&I.value?(d(),m("section",{key:0,class:"bcm bcm-notice",lang:s.value,"aria-labelledby":`${i(r)}-title`},[f("h2",{id:`${i(r)}-title`,ref_key:"heading",ref:a,tabindex:"-1"},u(i(o)("notice.title")),9,X0),I.value.receipt?(d(),m("div",{key:0,ref_key:"done",ref:l,class:"bcm-receipt",role:"status",tabindex:"-1"},[f("p",null,u(i(o)("notice.done")),1),f("p",null,u(i(o)("notice.receiptLede")),1),I.value.statusLink?(d(),m("p",Q0,[f("a",{href:I.value.statusLink},u(i(o)("notice.statusLink")),9,ex)])):S("",!0),k.value?(d(),m("input",{key:1,class:"bcm-input",readonly:"",value:k.value,"aria-label":i(o)("notice.statusLink"),onFocus:N[0]||(N[0]=O=>O.target.select())},null,40,tx)):S("",!0),I.value.receipt.contactKept?S("",!0):(d(),m("p",nx,u(i(o)("notice.noContactKept")),1))],512)):(d(),m("form",{key:1,class:"bcm-form",novalidate:"",onSubmit:N[6]||(N[6]=mt(O=>b.value.submit(),["prevent"]))},[f("p",null,u(i(o)("notice.lede")),1),f("div",ox,[f("span",sx,u(i(o)("notice.target")),1),f("span",null,u(P.value),1)]),f("fieldset",ix,[f("legend",null,u(i(o)("notice.category")),1),(d(!0),m(q,null,fe(i(hi),O=>(d(),m("label",{key:O,class:"bcm-choice"},[f("input",{type:"radio",name:`${i(r)}-category`,value:O,checked:I.value.category===O,onChange:E=>b.value.setCategory(O)},null,40,rx),f("span",null,u(i(o)(T(O))),1)]))),128))]),I.value.category==="rules"&&I.value.rules&&I.value.rules.length?(d(),m("div",ax,[f("label",{for:`${i(r)}-rule`},u(i(o)("notice.rule")),9,lx),ge(f("select",{id:`${i(r)}-rule`,"onUpdate:modelValue":N[1]||(N[1]=O=>I.value.ruleId=O),class:"bcm-input"},[N[7]||(N[7]=f("option",{value:""},null,-1)),(d(!0),m(q,null,fe(I.value.rules,O=>(d(),m("option",{key:O.id,value:O.id},u(O.title),9,ux))),128))],8,cx),[[Gt,I.value.ruleId]])])):S("",!0),f("div",dx,[f("label",{for:`${i(r)}-description`},u(i(o)("notice.description")),9,fx),ge(f("textarea",{id:`${i(r)}-description`,"onUpdate:modelValue":N[2]||(N[2]=O=>I.value.description=O),class:"bcm-input bcm-textarea",rows:"5","aria-describedby":`${i(r)}-description-hint`,"aria-invalid":b.value.descriptionLength()>i(mi)},null,8,mx),[[Xe,I.value.description]]),f("p",{id:`${i(r)}-description-hint`,class:"bcm-hint"},u(i(o)("notice.descriptionHint"))+" "+u(i(o)("notice.counter",{length:b.value.descriptionLength(),max:i(mi)})),9,px)]),b.value.contactAllowed()?(d(),m("fieldset",hx,[f("legend",null,u(i(o)("notice.contactTitle")),1),f("p",bx,u(i(o)("notice.contactHint")),1),f("div",gx,[f("label",{for:`${i(r)}-name`},u(i(o)("notice.name")),9,vx),ge(f("input",{id:`${i(r)}-name`,"onUpdate:modelValue":N[3]||(N[3]=O=>I.value.name=O),class:"bcm-input",autocomplete:"name",maxlength:i(Ra)},null,8,yx),[[Xe,I.value.name]])]),f("div",_x,[f("label",{for:`${i(r)}-email`},u(i(o)("notice.email")),9,kx),ge(f("input",{id:`${i(r)}-email`,"onUpdate:modelValue":N[4]||(N[4]=O=>I.value.email=O),class:"bcm-input",type:"email",autocomplete:"email","aria-invalid":!!I.value.failure?.fields?.includes("notifier.email")},null,8,wx),[[Xe,I.value.email]])])])):(d(),m("p",$x,u(i(o)("notice.childAtRisk")),1)),I.value.captcha!=="off"?(d(),m("div",xx,[od(x.$slots,"turnstile"),I.value.captcha==="unavailable"?(d(),m("p",Ix,u(i(o)("notice.captchaUnavailable")),1)):S("",!0)])):S("",!0),f("label",Tx,[ge(f("input",{"onUpdate:modelValue":N[5]||(N[5]=O=>I.value.goodFaith=O),type:"checkbox"},null,512),[[os,I.value.goodFaith]]),f("span",null,u(i(o)("confirm.good_faith")),1)]),g.value?(d(),m("p",Cx,u(g.value),1)):S("",!0),f("div",Sx,[N[8]||(N[8]=f("span",{class:"bcm-spacer"},null,-1)),f("button",{type:"submit",class:"bcm-btn bcm-primary",disabled:!b.value.canSubmit()},u(I.value.sending?i(o)("notice.sending"):i(o)("notice.submit")),9,Ax)])],32))],8,J0)):i(y)?(d(),m("section",{key:1,class:"bcm bcm-notice",lang:s.value,"aria-labelledby":`${i(r)}-title`},[f("h2",{id:`${i(r)}-title`},u(i(o)("notice.title")),9,Ex),f("p",null,u(i(o)("notice.noTarget")),1),f("p",null,[f("a",{href:h.value.rulesPath},u(i(o)("onboarding.rulesTitle")),9,Mx)])],8,Ox)):S("",!0)}});function Rx(e){const{client:t}=e,n=new AbortController,s={signal:n.signal};let o=!1,r=0;const a=Re({phase:"idle",failure:null,items:[],nextCursor:null,unreadOnly:!1,loadingMore:!1,busy:{},announcement:null,announceId:0}),l=b=>{a.announcement=b,a.announceId+=1},c=b=>({key:`error.${b.code}`}),p=b=>b.filter(_=>Ua(_.code));async function h(){const b=++r;a.phase="loading",a.failure=null;const _=await t.me.notifications.list(a.unreadOnly?{unreadOnly:!0}:{},s);if(!(o||b!==r)){if(!_.ok){a.phase=_.code==="signIn"?"signIn":"failed",a.failure=_;return}a.items=p(_.value.items),a.nextCursor=_.value.nextCursor,a.phase="ready"}}return{state:a,load:h,async loadMore(){if(a.loadingMore||a.nextCursor===null||a.phase!=="ready")return;const b=r;a.loadingMore=!0;const _=await t.me.notifications.list({cursor:a.nextCursor,...a.unreadOnly?{unreadOnly:!0}:{}},s);if(a.loadingMore=!1,o||b!==r)return;if(!_.ok)return l(c(_));const $=new Set(a.items.map(y=>y.id));a.items=[...a.items,...p(_.value.items).filter(y=>!$.has(y.id))],a.nextCursor=_.value.nextCursor},async setUnreadOnly(b){a.unreadOnly!==b&&(a.unreadOnly=b,await h())},async markRead(b){const _=`read:${b}`,$=a.items.find(R=>R.id===b);if(!$||$.readAt!==null||a.busy[_])return;a.busy[_]=!0;const y=await t.me.notifications.markRead({ids:[b]},s);if(delete a.busy[_],o)return;if(!y.ok)return l(c(y));const I=new Date().toISOString();a.items=a.items.map(R=>R.id===b?{...R,readAt:I}:R)},async markAllRead(){if(a.busy.all||!a.items.some($=>$.readAt===null)&&a.nextCursor===null)return;a.busy.all=!0;const b=await t.me.notifications.markRead({all:!0},s);if(delete a.busy.all,o)return;if(!b.ok)return l(c(b));const _=new Date().toISOString();a.items=a.unreadOnly?[]:a.items.map($=>$.readAt===null?{...$,readAt:_}:$),a.unreadOnly&&(a.nextCursor=null)},unread:()=>a.items.filter(b=>b.readAt===null).length,dispose(){o=!0,n.abort()}}}const Nx=["lang","aria-labelledby"],jx={class:"bcm-row"},zx=["id"],Lx={key:0,class:"bcm-badge"},Dx={key:0,class:"bcm-muted",role:"status"},Fx={key:1,class:"bcm-row"},Ux=["href"],qx={key:2,class:"bcm-banner",role:"alert"},Bx={class:"bcm-row"},Hx={class:"bcm-check"},Vx=["checked"],Kx=["disabled"],Wx={key:0,class:"bcm-muted"},Yx={key:1,class:"bcm-list"},Gx=["id"],Zx=["id","datetime"],Jx={class:"bcm-row"},Xx=["href"],Qx=["aria-describedby","disabled","onClick"],eI={key:2,class:"bcm-row"},tI=["disabled"],nI=["href"],oI={class:"bcm-sr","aria-live":"polite"},sI=$e({inheritAttrs:!1,__name:"NotificationCentreView",props:{apiBase:{},siteBase:{},lang:{},routes:{},signInHref:{},transport:{type:Function}},setup(e){const t=e,n=ue(De(t.lang,qe())),{t:s,text:o}=gt(n),r=Ve("bcm-centre"),a=ht(t.siteBase),l=a===null?null:bt(t.apiBase,t.transport,a),c=l?Rx({client:l}):null,p=c?.state??null,h=z(()=>Pt(Mt(t.routes),null,a??""));nt(()=>{c?.load()}),Ge(()=>c?.dispose());const b=z(()=>{const P=p?.failure;if(!P)return"";const T=Ie(P,n.value);return s(T.key,T.params)});function _(){return En(t.signInHref,typeof location>"u"?null:location.pathname)}const $=P=>P.code==="category_topic"&&P.conversationKind==="article"?"notification.category_topic.article":Ip(P);function y(P){if(P.decisionId){const T=Jn(h.value.statementPath,P.decisionId);return T?{href:T,key:"sanction.statement"}:null}if(P.code==="category_topic"){if(P.articleId||P.conversationKind==="article"){const g=Ti(h.value.articlePath,P.articleSlug,P.seq);return g?{href:g,key:"centre.openMessage"}:null}const T=typeof P.conversationId=="string"?xo(h.value.topicPath,P.conversationId):null;return T?{href:T,key:"topic.open"}:null}if(P.code==="reply"||P.code==="mention"||P.code==="topic_update"){if(P.conversationKind==="topic"){const g=typeof P.conversationId=="string"&&typeof P.seq=="number"?Ii(h.value.topicPath,P.conversationId,P.seq):null;return g?{href:g,key:"centre.openMessage"}:null}const T=Ti(h.value.articlePath,P.articleSlug,P.seq);return T?{href:T,key:"centre.openMessage"}:null}return P.code==="module_push_reset"?{href:h.value.settingsPath,key:"centre.settings"}:P.code==="module_read_only"||P.code==="module_braked"||P.code==="age_limit_changed"||P.code==="erasure_scheduled"||P.code==="inactivity_warning"?{href:h.value.myCommunityPath,key:"panel.title"}:null}function I(P){c?.setUnreadOnly(P.target.checked)}const R=ue("");return ve(()=>p?.announceId,()=>{R.value="";const P=o(p?.announcement);Le(()=>{R.value=P})}),(P,T)=>i(c)&&i(p)?(d(),m("section",{key:0,class:"bcm bcm-centre",lang:n.value,"aria-labelledby":`${i(r)}-title`},[f("div",jx,[f("h2",{id:`${i(r)}-title`},u(i(s)("centre.title")),9,zx),i(p).phase==="ready"&&i(c).unread()>0?(d(),m("span",Lx,u(i(s)("panel.unread",{count:i(c).unread()})),1)):S("",!0)]),i(p).phase==="loading"||i(p).phase==="idle"?(d(),m("p",Dx,u(i(s)("common.loading")),1)):i(p).phase==="signIn"?(d(),m("div",Fx,[f("p",null,u(i(s)("centre.signIn")),1),_()?(d(),m("a",{key:0,class:"bcm-btn bcm-primary",href:_()??void 0},u(i(s)("common.signIn")),9,Ux)):S("",!0)])):i(p).phase==="failed"?(d(),m("div",qx,[f("span",null,u(b.value),1),f("button",{type:"button",class:"bcm-btn",onClick:T[0]||(T[0]=g=>i(c).load())},u(i(s)("common.retry")),1)])):(d(),m(q,{key:3},[f("div",Bx,[f("label",Hx,[f("input",{type:"checkbox",checked:i(p).unreadOnly,onChange:I},null,40,Vx),f("span",null,u(i(s)("centre.unreadOnly")),1)]),T[3]||(T[3]=f("span",{class:"bcm-spacer"},null,-1)),i(c).unread()>0||i(p).nextCursor!==null?(d(),m("button",{key:0,type:"button",class:"bcm-btn bcm-small",disabled:!!i(p).busy.all,onClick:T[1]||(T[1]=g=>i(c).markAllRead())},u(i(s)("centre.markAllRead")),9,Kx)):S("",!0)]),i(p).items.length===0?(d(),m("p",Wx,u(i(s)("centre.empty")),1)):(d(),m("ul",Yx,[(d(!0),m(q,null,fe(i(p).items,g=>(d(),m("li",{key:g.id,class:Ke({"bcm-unread":g.readAt===null})},[$(g)?(d(),m("p",{key:0,id:`${i(r)}-s-${g.id}`},u(i(s)($(g))),9,Gx)):S("",!0),f("time",{id:`${i(r)}-t-${g.id}`,class:"bcm-time",datetime:g.createdAt},u(i(Pe)(n.value,g.createdAt)),9,Zx),f("div",Jx,[y(g)?(d(),m("a",{key:0,href:y(g).href},u(i(s)(y(g).key)),9,Xx)):S("",!0),T[4]||(T[4]=f("span",{class:"bcm-spacer"},null,-1)),g.readAt===null?(d(),m("button",{key:1,type:"button",class:"bcm-btn bcm-small","aria-describedby":$(g)?`${i(r)}-s-${g.id} ${i(r)}-t-${g.id}`:`${i(r)}-t-${g.id}`,disabled:!!i(p).busy[`read:${g.id}`],onClick:k=>i(c).markRead(g.id)},u(i(s)("panel.markRead")),9,Qx)):S("",!0)])],2))),128))])),i(p).nextCursor!==null?(d(),m("div",eI,[f("button",{type:"button",class:"bcm-btn",disabled:i(p).loadingMore,onClick:T[2]||(T[2]=g=>i(c).loadMore())},u(i(s)("centre.loadMore")),9,tI)])):S("",!0),f("p",null,[f("a",{href:h.value.settingsPath},u(i(s)("centre.settings")),9,nI)])],64)),f("p",oI,u(R.value),1)],8,Nx)):S("",!0)}});function $c(e){if(typeof e!="string")return null;const t=e.trim().replace(/^@/,"").toLowerCase();return yo.test(t)?t:null}function iI(e){const{client:t}=e,n=new AbortController,s={signal:n.signal};let o=!1,r=0;const a=Re({phase:"idle",failure:null,author:null,memberSince:null,bio:null,trustKey:null,moderates:[]});return{state:a,async load(l){const c=++r;a.failure=null,a.author=null,a.memberSince=null,a.bio=null,a.trustKey=null,a.moderates=[];const p=$c(l);if(p===null){a.phase="notFound";return}a.phase="loading";const h=await t.profile.get({handle:p},s);if(o||c!==r)return;if(!h.ok){a.phase=h.code==="signIn"?"signIn":h.code==="notFound"?"notFound":"failed",a.failure=h;return}const b=h.value;if(!Wf(b.author)||b.author.kind!=="member"||b.author.memberId===null){a.phase="notFound";return}a.author=b.author,a.memberSince=typeof b.memberSince=="string"?b.memberSince:null,a.bio=typeof b.bio=="string"&&b.bio.trim()!==""?b.bio:null,a.trustKey=Tp(b.trustLabel),a.moderates=Array.isArray(b.moderates)?b.moderates.filter(_=>typeof _?.slug=="string"&&typeof _?.name=="string").map(_=>({slug:_.slug,name:_.name})):[],a.phase="ready"},dispose(){o=!0,n.abort()}}}function rI(e){const{client:t}=e,n=new AbortController,s={signal:n.signal};let o=!1;const r=Re({phase:"idle",rules:[],rulesFailed:!1,handle:null,visitor:!1});return{state:r,async load(){r.phase="loading";const[a,l]=await Promise.all([t.legal.current({kind:"rules",locale:e.lang},s),t.me.get(s)]);o||(a.ok?r.rules=Gn(a.value.bodyJson):r.rulesFailed=!0,l.ok?(r.visitor=l.value.needs.includes("sign_in"),r.handle=l.value.member?$c(l.value.profile?.handle):null):r.visitor=l.code==="signIn",r.phase="ready")},dispose(){o=!0,n.abort()}}}const aI=["lang","aria-labelledby"],lI={key:0,class:"bcm-muted",role:"status"},cI=["id"],uI={key:2,class:"bcm-row"},dI=["id"],fI=["href"],mI={key:3,class:"bcm-banner",role:"alert"},pI=["id"],hI={class:"bcm-profile-head"},bI={class:"bcm-msg-main"},gI=["id"],vI={class:"bcm-handle"},yI={key:0},_I={class:"bcm-badge"},kI={key:1,class:"bcm-row"},wI={class:"bcm-badge bcm-badge-team"},$I=["href"],xI={key:1},II={key:2,class:"bcm-muted"},TI=["aria-labelledby"],CI=["id"],SI={class:"bcm-text"},AI=$e({inheritAttrs:!1,__name:"ProfileView",props:{handle:{},apiBase:{},siteBase:{},lang:{},routes:{},signInHref:{},transport:{type:Function}},setup(e){const t=e,n=ue(De(t.lang,qe())),{t:s}=gt(n),o=Ve("bcm-profile"),r=ht(t.siteBase),a=r===null?null:bt(t.apiBase,t.transport,r),l=a?iI({client:a}):null,c=l?.state??null;nt(()=>{l?.load(t.handle??"")}),ve(()=>t.handle,($,y)=>{$!==y&&l?.load($??"")}),Ge(()=>l?.dispose());const p=z(()=>c?.memberSince?Bp(n.value,c.memberSince):""),h=z(()=>Pt(Mt(t.routes),null,r??"")),b=z(()=>{const $=c?.failure;if(!$)return"";const y=Ie($,n.value);return s(y.key,y.params)});function _(){return En(t.signInHref,typeof location>"u"?null:location.pathname)}return($,y)=>i(l)&&i(c)?(d(),m("section",{key:0,class:"bcm bcm-profile",lang:n.value,"aria-labelledby":`${i(o)}-title`},[i(c).phase==="loading"||i(c).phase==="idle"?(d(),m("p",lI,u(i(s)("common.loading")),1)):i(c).phase==="notFound"?(d(),m("p",{key:1,id:`${i(o)}-title`,class:"bcm-note"},u(i(s)("profile.notFound")),9,cI)):i(c).phase==="signIn"?(d(),m("div",uI,[f("p",{id:`${i(o)}-title`},u(i(s)("profile.signIn")),9,dI),_()?(d(),m("a",{key:0,class:"bcm-btn bcm-primary",href:_()??void 0},u(i(s)("common.signIn")),9,fI)):S("",!0)])):i(c).phase==="failed"?(d(),m("div",mI,[f("span",{id:`${i(o)}-title`},u(b.value),9,pI),f("button",{type:"button",class:"bcm-btn",onClick:y[0]||(y[0]=I=>i(l).load(t.handle??""))},u(i(s)("common.retry")),1)])):i(c).author&&i(c).author.kind==="member"?(d(),m(q,{key:4},[f("header",hI,[Ee(Li,{author:i(c).author},null,8,["author"]),f("div",bI,[f("h2",{id:`${i(o)}-title`},u(i(c).author.displayName),9,gI),f("span",vI,u(i(c).author.handle),1)])]),i(c).trustKey?(d(),m("p",yI,[f("span",_I,u(i(s)(i(c).trustKey)),1)])):S("",!0),i(c).moderates.length>0?(d(),m("p",kI,[f("span",wI,u(i(s)("role.moderator")),1),f("span",null,u(i(s)("profile.moderates")),1),(d(!0),m(q,null,fe(i(c).moderates,I=>(d(),m(q,{key:I.slug},[i(On)(h.value.categoryPath,I.slug)?(d(),m("a",{key:0,href:i(On)(h.value.categoryPath,I.slug)??void 0},u(I.name),9,$I)):(d(),m("span",xI,u(I.name),1))],64))),128))])):S("",!0),p.value?(d(),m("p",II,u(i(s)("profile.memberSince",{date:p.value})),1)):S("",!0),i(c).bio?(d(),m("section",{key:3,class:"bcm-section","aria-labelledby":`${i(o)}-bio`},[f("h3",{id:`${i(o)}-bio`},u(i(s)("profile.bio")),9,CI),f("p",SI,u(i(c).bio),1)],8,TI)):S("",!0)],64)):S("",!0)],8,aI)):S("",!0)}}),OI=4e3;function EI(e){const{client:t,lang:n}=e,s=e.conversationId.toLowerCase(),o=kh(e),r=new AbortController,a={signal:r.signal};let l=!1;const c=$s({client:t,target:{conversationId:s},lang:n}),p=Re({rules:null,moveTargets:null,dialog:null,busy:{},announcement:null,announceId:0}),h=g=>{p.announcement=g,p.announceId+=1},b=()=>o.state.thread.topic;let _=null;const $=o.store.subscribe(g=>{const k=g.topic?.following;typeof k!="boolean"||k===_||(_===null&&c&&c.state.phase==="idle"?c.load(k):c?.sync(k),_=k)});function y(){const g=b();return g?.category?o.state.thread.viewer.moderator===!0||o.state.me!==null&&gl(o.state.me,g.category.id):!1}const I=g=>y()&&!o.isOwn(g)&&!g.pending&&g.seq>0&&g.body!==null&&g.state!=="deleted"&&g.author.kind==="member";async function R(g,k){if(p.busy[g])return;p.busy[g]=!0;const M=await k();if(delete p.busy[g],!l){if(M.ok){o.store.applyTopic(M.value.topic),h({key:"moderation.done"});return}h(Ie(M,n)),M.code==="notFound"&&o.refresh()}}async function P(){if(p.rules!==null)return;const g=await t.legal.current({kind:"rules",locale:n},a);!l&&g.ok&&(p.rules=Gn(g.value.bodyJson))}async function T(){if(p.moveTargets!==null)return;const g=await t.forum.categories.list(a);if(l||!g.ok)return;const k=b()?.category?.id,M=o.state.me;p.moveTargets=g.value.categories.filter(w=>w.kind==="topics"&&w.id!==k&&M!==null&&gl(M,w.id))}return{thread:o,follow:c,extras:p,async start(){await o.start()},isModerator:y,canModerate:I,setState:g=>R(`state:${g}`,()=>t.moderation.setTopicState({conversationId:s,state:g},a)),setPinned:g=>R(`pin:${g}`,()=>t.moderation.pinTopic({conversationId:s,pinned:g},a)),openDialog(g,k=null){p.dialog={kind:g,seq:k,ruleId:"",facts:"",category:"",categoryId:"",sending:!1,failure:null,statement:null,done:!1},g==="remove"&&P(),g==="move"&&T()},closeDialog(){p.dialog=null},async submitDialog(){const g=p.dialog;if(!g||g.sending||g.done)return;if(g.kind==="move"){if(g.categoryId==="")return;g.sending=!0;const v=await t.moderation.moveTopic({conversationId:s,categoryId:g.categoryId},a);if(g.sending=!1,l)return;if(v.ok){o.store.applyTopic(v.value.topic),p.dialog=null,p.moveTargets=null,h({key:"moderation.done"});return}g.failure=v;return}const k=g.seq===null?null:o.state.thread.messages.flatMap(v=>[v,...v.replies]).find(v=>v.seq===g.seq);if(!k)return;if(g.kind==="escalate"){if(g.category===""||!ls.includes(g.category))return;g.sending=!0;const v=await t.moderation.escalate({conversationId:s,seq:k.seq,category:g.category},a);if(g.sending=!1,l)return;if(v.ok){g.done=!0,h({key:"moderation.escalated"});return}g.failure=v,v.code==="notFound"&&o.refresh();return}const M=Ze(g.facts);if(g.ruleId===""||M===""||lt(M)>OI)return;g.sending=!0;const w=await t.moderation.remove({conversationId:s,seq:k.seq,ruleId:g.ruleId,facts:M,locale:n},a);if(g.sending=!1,!l){if(w.ok){g.done=!0,g.statement=w.value.statement,h({key:"moderation.removed"}),o.refresh();return}g.failure=w,w.code==="notFound"&&o.refresh()}},dispose(){l||(l=!0,r.abort(),$(),c?.dispose(),o.dispose())}}}const MI=["aria-labelledby"],PI=["id"],RI={class:"bcm-field"},NI=["for"],jI=["id"],zI={value:"",disabled:""},LI=["value"],DI={class:"bcm-field"},FI=["for"],UI=["id","aria-describedby"],qI=["id"],BI={role:"status"},HI={class:"bcm-facts"},VI={class:"bcm-field"},KI=["for"],WI=["id"],YI={value:"",disabled:""},GI=["value"],ZI={key:1,role:"status"},JI={key:2,class:"bcm-field"},XI=["for"],QI=["id"],eT={value:"",disabled:""},tT=["value"],nT={key:3,class:"bcm-error",role:"alert"},oT={class:"bcm-row"},sT=["disabled"],iT=["disabled"],rT=$e({__name:"ModeratorDialog",props:{ctl:{},fallbackFocus:{type:Function}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o,lang:r}=vt(),a=ue(null),l=Ve("bcm-moderator");Mi(a,()=>s("close"),n.fallbackFocus);const c=z(()=>n.ctl.extras.dialog),p=z(()=>c.value?.kind==="remove"?"moderation.remove":c.value?.kind==="escalate"?"moderation.escalate":"moderation.move"),h=$=>`category.${$}`,b=z(()=>{const $=c.value?.failure;if(!$)return"";const y=Ie($,r.value);return o(y.key,y.params)}),_=z(()=>{const $=c.value;if(!$||$.sending||$.done)return!1;if($.kind==="move")return $.categoryId!=="";if($.kind==="escalate")return $.category!=="";const y=Ze($.facts);return $.ruleId!==""&&y!==""&<(y)<=4e3});return($,y)=>(d(),m("dialog",{ref_key:"dialog",ref:a,class:"bcm-dialog","aria-labelledby":`${i(l)}-title`},[c.value?(d(),m("form",{key:0,class:"bcm-dialog-body bcm-form",novalidate:"",onSubmit:y[5]||(y[5]=mt(I=>_.value&&e.ctl.submitDialog(),["prevent"]))},[f("h3",{id:`${i(l)}-title`},u(i(o)(p.value)),9,PI),c.value.kind==="remove"?(d(),m(q,{key:0},[c.value.done?(d(),m(q,{key:1},[f("p",BI,u(i(o)("moderation.removed")),1),f("h4",null,u(i(o)("statement.title")),1),f("pre",HI,u(c.value.statement),1)],64)):(d(),m(q,{key:0},[f("p",null,u(i(o)("moderation.removeLede")),1),f("div",RI,[f("label",{for:`${i(l)}-rule`},u(i(o)("statement.contractualGround")),9,NI),ge(f("select",{id:`${i(l)}-rule`,"onUpdate:modelValue":y[0]||(y[0]=I=>c.value.ruleId=I),class:"bcm-input bcm-select",required:""},[f("option",zI,u(i(o)("moderation.ruleRequired")),1),(d(!0),m(q,null,fe(e.ctl.extras.rules??[],I=>(d(),m("option",{key:I.id,value:I.id},u(I.title),9,LI))),128))],8,jI),[[Gt,c.value.ruleId]])]),f("div",DI,[f("label",{for:`${i(l)}-facts`},u(i(o)("statement.facts")),9,FI),ge(f("textarea",{id:`${i(l)}-facts`,"onUpdate:modelValue":y[1]||(y[1]=I=>c.value.facts=I),class:"bcm-input bcm-textarea",rows:"4","aria-describedby":`${i(l)}-facts-hint`},null,8,UI),[[Xe,c.value.facts]]),f("p",{id:`${i(l)}-facts-hint`,class:"bcm-hint"},u(i(o)("moderation.factsHint")),9,qI)])],64))],64)):c.value.kind==="escalate"?(d(),m(q,{key:1},[c.value.done?(d(),m("p",ZI,u(i(o)("moderation.escalated")),1)):(d(),m(q,{key:0},[f("p",null,u(i(o)("moderation.escalateLede")),1),f("div",VI,[f("label",{for:`${i(l)}-category`},u(i(o)("moderation.escalateCategory")),9,KI),ge(f("select",{id:`${i(l)}-category`,"onUpdate:modelValue":y[2]||(y[2]=I=>c.value.category=I),class:"bcm-input bcm-select",required:""},[f("option",YI,u(i(o)("moderation.escalateCategory")),1),(d(!0),m(q,null,fe(i(ls),I=>(d(),m("option",{key:I,value:I},u(i(o)(h(I))),9,GI))),128))],8,WI),[[Gt,c.value.category]])])],64))],64)):(d(),m("div",JI,[f("label",{for:`${i(l)}-target`},u(i(o)("moderation.moveTo")),9,XI),ge(f("select",{id:`${i(l)}-target`,"onUpdate:modelValue":y[3]||(y[3]=I=>c.value.categoryId=I),class:"bcm-input bcm-select",required:""},[f("option",eT,u(i(o)("moderation.moveTo")),1),(d(!0),m(q,null,fe(e.ctl.extras.moveTargets??[],I=>(d(),m("option",{key:I.id,value:I.id},u(I.name),9,tT))),128))],8,QI),[[Gt,c.value.categoryId]])])),b.value?(d(),m("p",nT,u(b.value),1)):S("",!0),f("div",oT,[y[6]||(y[6]=f("span",{class:"bcm-spacer"},null,-1)),f("button",{type:"button",class:"bcm-btn",disabled:c.value.sending,onClick:y[4]||(y[4]=I=>s("close"))},u(c.value.done?i(o)("common.close"):i(o)("common.cancel")),9,sT),c.value.done?S("",!0):(d(),m("button",{key:0,type:"submit",class:Ke(["bcm-btn bcm-primary",{"bcm-danger":c.value.kind==="remove"}]),disabled:!_.value},u(i(o)(p.value)),11,iT))])],32)):S("",!0)],8,MI))}}),aT=["lang","aria-labelledby"],lT={class:"bcm-row"},cT=["href"],uT=["href"],dT=["id"],fT=["id"],mT=["id"],pT={key:3,class:"bcm-banner",role:"alert"},hT=["id"],bT={class:"bcm-head"},gT=["id"],vT={key:0,class:"bcm-badge"},yT={key:1,class:"bcm-badge"},_T={key:2,class:"bcm-badge"},kT={class:"bcm-count"},wT={key:0,class:"bcm-banner",role:"status"},$T=["disabled"],xT={key:1,class:"bcm-hint",role:"status"},IT={class:"bcm-thread"},TT={key:2,class:"bcm-muted"},CT={key:3,class:"bcm-row"},ST=["disabled"],AT={class:"bcm-section"},OT={key:0,class:"bcm-hint"},ET={key:2,class:"bcm-note"},MT={key:3,class:"bcm-note"},PT={key:1,class:"bcm-row"},RT={key:5,class:"bcm-note"},NT={key:6,class:"bcm-section"},jT=["href"],zT={key:7,class:"bcm-note",role:"status"},LT={key:8,class:"bcm-note"},DT=["href"],FT={class:"bcm-sr","aria-live":"polite"},xc=new WeakMap,UT=$e({inheritAttrs:!1,__name:"TopicView",props:{conversationId:{},apiBase:{},siteBase:{},lang:{},signInHref:{},routes:{},pollMs:{},transport:{type:Function},realtime:{type:Function}},setup(e){const t=e,n=Vn(),s=ue(De(t.lang,qe())),{t:o,text:r}=gt(s,mc);ve(()=>t.lang,J=>{s.value=De(J,qe())});const a=Ve("bcm-topic"),l=ue(null),c=ue(0),p=Vt(null),h=z(()=>ht(t.siteBase)),b=z(()=>h.value===null?null:bt(t.apiBase,t.transport,h.value));function _(){const J=t.conversationId?.trim();return J?b.value?EI({client:b.value,conversationId:J,lang:s.value,pollMs:t.pollMs,realtime:typeof t.realtime=="function"?t.realtime:null,refusedAge:(n&&xc.get(n))??null,onAgeRefused:W=>{n&&xc.set(n,W)},onPosted:W=>n?.dispatchEvent(new CustomEvent("bcm-posted",{detail:{state:W},bubbles:!0,composed:!0}))}):null:(qt("conversation-id","[blogmcp-community] <blogmcp-topic> needs a conversation-id"),null)}const $=Re(new Set),y=Re(new Set),I=Re(new Set),R=ue(null),P=z(()=>p.value),T=z(()=>p.value?.thread??null),g=z(()=>p.value?.thread.state??null),k=z(()=>Pt(Mt(t.routes),g.value?.me?.links,h.value??""));function M(J){return p.value?.canModerate(J)?[{id:"mod-remove",label:o("moderation.remove"),danger:!0},{id:"mod-escalate",label:o("moderation.escalate")}]:[]}ac({get ctl(){return p.value.thread},routes:k,opened:$,originals:y,allReplies:I,focusHeading:()=>l.value,deleteMessage:J=>{R.value=J},extraMenu:M,onExtraMenu:(J,W)=>{J==="mod-remove"?p.value?.openDialog("remove",W.seq):J==="mod-escalate"&&p.value?.openDialog("escalate",W.seq)}});let w=null;const v=ue(null);let x=!1;async function N(){if(x||typeof location>"u")return;x=!0;const J=xl(location.hash),W=J===null?null:Io(J);if(J===null||W===null)return;const pe=g.value?.thread.messages.find(Rt=>Rt.replies.some(Cs=>Cs.seq===J));pe&&I.add(pe.seq),await Le();const Ht=v.value?.querySelector(`#${W}`);typeof Ht?.scrollIntoView=="function"&&Ht.scrollIntoView({block:"start"})}function O(){x=!1,p.value?.dispose(),$.clear(),y.clear(),I.clear(),R.value=null,p.value=_(),c.value+=1,p.value?.start()}nt(()=>{O(),n&&typeof IntersectionObserver<"u"&&(w=new IntersectionObserver(J=>{const W=J[J.length-1];W&&p.value?.thread.setInView(W.isIntersecting)},{rootMargin:"200px"}),w.observe(n))}),ve(()=>[t.conversationId,t.apiBase,h.value,t.transport,t.realtime,t.pollMs,s.value],()=>O()),Ge(()=>{w?.disconnect(),p.value?.dispose(),p.value=null}),ve(()=>g.value?.phase,J=>{J==="ready"&&N()});const E=z(()=>g.value?.thread.topic??null),B=z(()=>g.value?ms(g.value.thread):null),ee=z(()=>{const J=B.value;return J?J.kind==="shown"?J.text:o(J.kind==="deleted"?"topic.deleted":"topic.withheld"):""}),re=z(()=>E.value?.category?On(k.value.categoryPath,E.value.category.slug):null),be=z(()=>T.value?.mode()??"pending"),we=z(()=>{const J=Is(g.value?.me??null);return Di(J.paused??"forum")}),K=ue(null);ve(be,(J,W)=>{J==="write"&&W==="onboarding"&&Le(()=>K.value?.focus()),J==="ageRefused"&&W==="onboarding"&&Le(()=>l.value?.focus())});const D=z(()=>{const J=T.value?.needs();return J?.onboarding?"need.onboarding":J?.rules?"need.reconsent_rules":"need.art9_consent"}),U=z(()=>{const J=p.value,W=E.value;if(!J||!W||!J.isModerator())return[];const pe=[];return W.state==="open"?pe.push({id:"lock",label:o("moderation.lock")}):W.state==="locked"&&pe.push({id:"unlock",label:o("moderation.unlock")}),pe.push(W.pinned?{id:"unpin",label:o("moderation.unpin")}:{id:"pin",label:o("moderation.pin")}),pe.push({id:"move",label:o("moderation.move")}),pe});function Fe(J){const W=p.value;W&&(J==="lock"||J==="unlock"?W.setState(J==="lock"?"locked":"open"):J==="pin"||J==="unpin"?W.setPinned(J==="pin"):J==="move"&&W.openDialog("move"))}function je(J){const W=J.endsAt?Pe(s.value,J.endsAt):"";return J.kind==="ban"?o("sanction.ban"):J.kind==="suspension"?W?o("sanction.suspensionUntil",{date:W}):o("sanction.suspension"):W?o("sanction.restrictionUntil",{date:W}):o("sanction.restriction")}const Ue=z(()=>{const J=g.value?.failure;if(!J)return"";const W=Ie(J,s.value);return o(W.key,W.params)}),Qe=ue("");function oe(J){Qe.value="",Le(()=>{Qe.value=J})}ve(()=>g.value?.announceId,()=>oe(r(g.value?.announcement))),ve(()=>p.value?.extras.announceId,()=>oe(r(p.value?.extras.announcement)));async function Z(){const J=R.value;J===null||!T.value||(await T.value.remove(J),R.value=null)}return(J,W)=>P.value&&T.value&&g.value&&g.value.phase!=="hidden"?(d(),m("section",{ref_key:"section",ref:v,key:c.value,class:"bcm bcm-topic",lang:s.value,"aria-labelledby":i(a)},[f("nav",lT,[re.value&&E.value?.category?(d(),m("a",{key:0,href:re.value},u(E.value.category.name),9,cT)):(d(),m("a",{key:1,href:k.value.forumPath},u(i(o)("forum.back")),9,uT))]),g.value.phase==="loading"?(d(),m("p",{key:0,id:i(a),class:"bcm-muted",role:"status"},u(i(o)("topic.loading")),9,dT)):g.value.phase==="membersOnly"&&b.value?(d(),m("div",{key:1,id:i(a)},[Ee(Ts,{failure:g.value.failure,client:b.value,lang:s.value,"sign-in-href":e.signInHref,"rules-href":k.value.rulesPath,"terms-href":k.value.termsPath,onJoined:W[0]||(W[0]=pe=>T.value.refresh())},null,8,["failure","client","lang","sign-in-href","rules-href","terms-href"])],8,fT)):g.value.phase==="notFound"?(d(),m("p",{key:2,id:i(a),class:"bcm-note"},u(i(o)("topic.notFound")),9,mT)):g.value.phase==="failed"?(d(),m("div",pT,[f("span",{id:i(a)},u(Ue.value),9,hT),f("button",{type:"button",class:"bcm-btn",onClick:W[1]||(W[1]=pe=>T.value.refresh())},u(i(o)("common.retry")),1)])):(d(),m(q,{key:4},[f("header",bT,[f("h2",{id:i(a),ref_key:"heading",ref:l,tabindex:"-1",class:Ke({"bcm-placeholder":B.value?.kind!=="shown"})},u(ee.value),11,gT),E.value?.pinned?(d(),m("span",vT,u(i(o)("topic.pinned")),1)):S("",!0),E.value?.state==="locked"?(d(),m("span",yT,u(i(o)("topic.locked")),1)):E.value?.state==="archived"?(d(),m("span",_T,u(i(o)("topic.archived")),1)):S("",!0),f("span",kT,u(i(o)("topic.count",{count:g.value.thread.count})),1),W[14]||(W[14]=f("span",{class:"bcm-spacer"},null,-1)),P.value.follow&&g.value.thread.viewer.memberId!==null?(d(),_e(xs,{key:3,ctl:P.value.follow},null,8,["ctl"])):S("",!0),U.value.length?(d(),_e(sc,{key:4,items:U.value,label:i(o)("moderation.title"),onSelect:Fe},null,8,["items","label"])):S("",!0)]),Ee(Fi,{me:g.value.me},null,8,["me"]),g.value.newMessages?(d(),m("div",wT,[f("span",null,u(i(o)("discussion.newMessages")),1),f("button",{type:"button",class:"bcm-btn",disabled:g.value.refreshing,onClick:W[2]||(W[2]=pe=>T.value.refresh())},u(i(o)("discussion.refresh")),9,$T)])):S("",!0),g.value.realtimeOff?(d(),m("p",xT,u(i(o)("realtime.off")),1)):S("",!0),f("ol",IT,[(d(!0),m(q,null,fe(g.value.thread.messages,pe=>(d(),_e(lc,{key:pe.id,message:pe},null,8,["message"]))),128))]),g.value.thread.messages.length<=1?(d(),m("p",TT,u(i(o)("discussion.empty")),1)):S("",!0),g.value.thread.nextCursor!==null?(d(),m("div",CT,[f("button",{type:"button",class:"bcm-btn",disabled:g.value.loadingMore,onClick:W[3]||(W[3]=pe=>T.value.loadMore())},u(i(o)("discussion.loadMore")),9,ST)])):S("",!0),f("div",AT,[be.value==="write"&&g.value.art9RefusedNote?(d(),m("p",OT,u(i(o)("onboarding.art9RefusedDone")),1)):S("",!0),be.value==="write"?(d(),_e(Co,{key:1,ref_key:"composer",ref:K,kind:"new",draft:g.value.composer,wait:T.value.waitLeft(g.value.composer),"rules-href":k.value.rulesPath,"mentions-max":T.value.mentionCap(),onSubmit:W[4]||(W[4]=pe=>T.value.submit()),onConfirm:W[5]||(W[5]=(pe,Ht)=>T.value&&T.value.setConfirmed(g.value.composer,pe,Ht)),onConfirmed:W[6]||(W[6]=pe=>T.value.sendConfirmed(g.value.composer))},null,8,["draft","wait","rules-href","mentions-max"])):be.value==="locked"?(d(),m("p",ET,u(i(o)("error.topicLocked")),1)):be.value==="readOnly"?(d(),m("p",MT,u(i(o)("error.readOnly")),1)):be.value==="onboarding"?(d(),m(q,{key:4},[T.value.onboarding.value?(d(),_e(So,{key:0,model:T.value.onboarding.value,"rules-href":k.value.rulesPath,"terms-href":k.value.termsPath,onCancel:W[7]||(W[7]=pe=>T.value.cancelOnboarding())},null,8,["model","rules-href","terms-href"])):(d(),m("div",PT,[f("p",null,u(i(o)(D.value)),1),f("button",{type:"button",class:"bcm-btn bcm-primary",onClick:W[8]||(W[8]=pe=>T.value.beginOnboarding())},u(i(o)("onboarding.continue")),1)]))],64)):be.value==="ageRefused"?(d(),m("p",RT,u(i(o)("onboarding.ageBelow",{min:g.value.refusedAge??18})),1)):be.value==="sanction"?(d(),m("div",NT,[(d(!0),m(q,null,fe(g.value.thread.viewer.restrictions,pe=>(d(),m("p",{key:pe.decisionId,class:"bcm-note"},[It(u(je(pe))+" ",1),i(Jn)(k.value.statementPath,pe.decisionId)?(d(),m("a",{key:0,href:i(Jn)(k.value.statementPath,pe.decisionId)??void 0},u(i(o)("sanction.statement")),9,jT)):S("",!0)]))),128))])):be.value==="braked"&&we.value?(d(),m("p",zT,u(i(o)(we.value)),1)):be.value==="restricted"?(d(),m("p",LT,[It(u(i(o)("error.restricted"))+" ",1),f("a",{href:k.value.myCommunityPath},u(i(o)("panel.title")),9,DT)])):S("",!0)])],64)),f("p",FT,u(Qe.value),1),g.value.report?(d(),_e(cc,{key:5,report:g.value.report,"my-community-href":k.value.myCommunityPath,"rules-href":k.value.rulesPath,"fallback-focus":()=>l.value,onSubmit:W[9]||(W[9]=pe=>T.value.submitReport()),onClose:W[10]||(W[10]=pe=>T.value.closeReport())},null,8,["report","my-community-href","rules-href","fallback-focus"])):S("",!0),R.value!==null?(d(),_e(ws,{key:6,title:"discussion.deleteTitle",explain:"discussion.deleteExplain",confirm:"discussion.deleteConfirm",danger:"",busy:!!g.value.busy[`delete:${R.value}`],"fallback-focus":()=>l.value,onConfirm:W[11]||(W[11]=pe=>Z()),onCancel:W[12]||(W[12]=pe=>R.value=null)},null,8,["busy","fallback-focus"])):S("",!0),P.value.extras.dialog?(d(),_e(rT,{key:7,ctl:P.value,"fallback-focus":()=>l.value,onClose:W[13]||(W[13]=pe=>P.value.closeDialog())},null,8,["ctl","fallback-focus"])):S("",!0)],8,aT)):S("",!0)}}),qT=["lang","aria-labelledby"],BT=["id"],HT={key:0,class:"bcm-muted",role:"status"},VT=["aria-labelledby"],KT=["id"],WT={key:0,class:"bcm-rules"},YT={key:0,class:"bcm-hint"},GT=["href"],ZT={class:"bcm-links"},JT=["href"],XT=["href"],QT={key:0},eC=["href"],tC={key:1},nC=["href"],oC=$e({inheritAttrs:!1,__name:"WelcomeView",props:{apiBase:{},siteBase:{},lang:{},routes:{},signInHref:{},transport:{type:Function}},setup(e){const t=e,n=ue(De(t.lang,qe())),{t:s}=gt(n),o=Ve("bcm-welcome"),r=ht(t.siteBase),a=r===null?null:bt(t.apiBase,t.transport,r),l=a?rI({client:a,lang:n.value}):null,c=l?.state??null,p=z(()=>Pt(Mt(t.routes),null,r??"")),h=z(()=>c?.handle?kl(p.value.profilePath,c.handle):null);nt(()=>{l?.load()}),Ge(()=>l?.dispose());function b(){return En(t.signInHref,typeof location>"u"?null:location.pathname)}return(_,$)=>i(l)&&i(c)?(d(),m("section",{key:0,class:"bcm bcm-welcome",lang:n.value,"aria-labelledby":`${i(o)}-title`},[f("h2",{id:`${i(o)}-title`},u(i(s)("welcome.title")),9,BT),f("p",null,u(i(s)("welcome.lede")),1),i(c).phase!=="ready"?(d(),m("p",HT,u(i(s)("common.loading")),1)):(d(),m(q,{key:1},[f("section",{class:"bcm-section","aria-labelledby":`${i(o)}-rules`},[f("h3",{id:`${i(o)}-rules`},u(i(s)("welcome.rules")),9,KT),i(c).rules.length?(d(),m("ol",WT,[(d(!0),m(q,null,fe(i(c).rules,y=>(d(),m("li",{key:y.id},[f("strong",null,u(y.title),1),y.summary?(d(),m("span",YT,u(y.summary),1)):S("",!0)]))),128))])):S("",!0),f("p",null,[f("a",{href:p.value.rulesPath},u(i(s)("onboarding.rulesLink")),9,GT)])],8,VT),f("ul",ZT,[f("li",null,[f("a",{class:"bcm-btn",href:p.value.discussionsPath},u(i(s)("welcome.discussions")),9,JT)]),f("li",null,[f("a",{class:"bcm-btn",href:p.value.settingsPath},u(i(s)("welcome.settings")),9,XT)]),h.value?(d(),m("li",QT,[f("a",{class:"bcm-btn",href:h.value},u(i(s)("welcome.profile")),9,eC)])):i(c).visitor&&b()?(d(),m("li",tC,[f("a",{class:"bcm-btn bcm-primary",href:b()??void 0},u(i(s)("common.signIn")),9,nC)])):S("",!0)])],64))],8,qT)):S("",!0)}}),sC=':host{all:initial;display:block;--bcm-bg: #ffffff;--bcm-fg: #1d1f23;--bcm-muted: #5f6672;--bcm-line: #dfe2e7;--bcm-soft: #f4f5f7;--bcm-accent: #2457d6;--bcm-accent-fg: #ffffff;--bcm-danger: #b42318;--bcm-ok: #1f7a3f;--bcm-warn-bg: #fff6d6;--bcm-shadow: 0 8px 28px rgba(16, 24, 40, .18);--bcm-z: 20;color-scheme:light dark;font:var(--bcm-font-size, 16px) / 1.5 var(--bcm-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);color:var(--bcm-fg)}:host([hidden]){display:none}@media(prefers-color-scheme:dark){:host{--bcm-bg: #1c1f24;--bcm-fg: #eceef1;--bcm-muted: #a4abb6;--bcm-line: #343943;--bcm-soft: #262a31;--bcm-accent: #6d93ff;--bcm-accent-fg: #0d1117;--bcm-danger: #ff8a7a;--bcm-ok: #6fd08e;--bcm-warn-bg: #3a3420;--bcm-shadow: 0 8px 28px rgba(0, 0, 0, .5)}}*{box-sizing:border-box}h2,h3,h4{margin:0;font-weight:650;line-height:1.3}h2{font-size:1.25em}h3{font-size:1.05em}h4{font-size:1em}p{margin:0}ul,ol{margin:0;padding:0}a{color:var(--bcm-accent)}.bcm{background:var(--bcm-bg);color:var(--bcm-fg);border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:16px;max-width:100%;overflow-wrap:anywhere}.bcm-sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bcm-btn{font:inherit;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:6px 14px;border-radius:8px;border:1px solid var(--bcm-line);background:var(--bcm-bg);color:var(--bcm-fg);cursor:pointer;text-decoration:none}.bcm-btn:hover:not(:disabled){background:var(--bcm-soft)}.bcm-btn:disabled{opacity:.55;cursor:default}.bcm-primary{background:var(--bcm-accent);border-color:var(--bcm-accent);color:var(--bcm-accent-fg)}.bcm-primary:hover:not(:disabled){background:var(--bcm-accent);filter:brightness(1.08)}.bcm-danger{color:var(--bcm-danger)}.bcm-primary.bcm-danger{background:var(--bcm-danger);border-color:var(--bcm-danger);color:var(--bcm-bg)}.bcm-small{min-height:30px;padding:2px 10px;font-size:.875em}.bcm-link{font:inherit;border:0;background:none;padding:0;color:var(--bcm-accent);cursor:pointer;text-align:left;text-decoration:underline}.bcm-quiet{font:inherit;border:0;background:none;padding:4px 6px;color:var(--bcm-muted);cursor:pointer;border-radius:6px;min-height:30px}.bcm-quiet:hover:not(:disabled){background:var(--bcm-soft);color:var(--bcm-fg)}.bcm-btn:focus-visible,.bcm-link:focus-visible,.bcm-quiet:focus-visible,.bcm-input:focus-visible,.bcm-react:focus-visible,a:focus-visible,.bcm-choice input:focus-visible+span{outline:2px solid var(--bcm-accent);outline-offset:2px}.bcm-input{font:inherit;width:100%;padding:8px 10px;border-radius:8px;border:1px solid var(--bcm-line);background:var(--bcm-bg);color:var(--bcm-fg)}.bcm-input[aria-invalid=true]{border-color:var(--bcm-danger);border-width:2px}.bcm-textarea{resize:vertical;min-height:96px}.bcm-field{display:flex;flex-direction:column;gap:4px}.bcm-field>label,.bcm-label{font-weight:600}.bcm-check{display:flex;gap:8px;align-items:flex-start}.bcm-check input{margin-top:.3em;width:18px;height:18px;flex:none}.bcm-choices{display:flex;flex-wrap:wrap;gap:8px;border:0;margin:0;padding:0;min-width:0}.bcm-choices legend,.bcm-fieldset legend{font-weight:600;padding:0;margin-bottom:6px}.bcm-fieldset{border:0;margin:0;padding:0;min-width:0;display:flex;flex-direction:column;gap:8px}.bcm-choice{position:relative;display:inline-flex}.bcm-choice input{position:absolute;opacity:0;width:1px;height:1px}.bcm-choice span{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;min-width:40px;padding:6px 12px;border:1px solid var(--bcm-line);border-radius:999px;cursor:pointer;background:var(--bcm-bg)}.bcm-choice input:checked+span{border:2px solid var(--bcm-accent);font-weight:650}.bcm-choice input:checked+span:before{content:"✓"}.bcm-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.bcm-spacer{flex:1}.bcm-full{flex-basis:100%}.bcm-muted,.bcm-hint{color:var(--bcm-muted);font-size:.875em}.bcm-error{color:var(--bcm-danger)}.bcm-ok{color:var(--bcm-ok)}.bcm-note{background:var(--bcm-soft);border-radius:8px;padding:8px 12px;font-size:.9375em}.bcm-warning{background:var(--bcm-warn-bg);border-radius:8px;padding:8px 12px;font-size:.9375em}.bcm-banner{background:var(--bcm-warn-bg);border-radius:10px;padding:10px 12px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}.bcm-text{white-space:pre-wrap;overflow-wrap:anywhere}.bcm-facts{font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;margin:0;background:var(--bcm-soft);border-radius:8px;padding:10px 12px}.bcm-badge{display:inline-flex;align-items:center;gap:4px;border:1px solid currentColor;border-radius:999px;padding:0 8px;font-size:.8125em;line-height:1.6}.bcm-badge-team{color:var(--bcm-accent);font-weight:650}.bcm-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}.bcm-count{color:var(--bcm-muted)}.bcm-thread,.bcm-replies{list-style:none;display:flex;flex-direction:column;gap:12px}.bcm-replies{margin-top:12px;padding-left:20px;border-left:2px solid var(--bcm-line)}.bcm-msg{display:flex;gap:10px;align-items:flex-start}.bcm-msg-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}.bcm-msg-pending{opacity:.65}.bcm-meta{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px;font-size:.875em}.bcm-author{font-weight:650}.bcm-handle,.bcm-time{color:var(--bcm-muted)}.bcm-handle:before{content:"@"}.bcm-placeholder{color:var(--bcm-muted);font-style:italic}.bcm-own-state{border-left:3px solid var(--bcm-line);padding-left:10px;display:flex;flex-direction:column;gap:4px}.bcm-actions{display:flex;align-items:center;flex-wrap:wrap;gap:2px 6px}.bcm-avatar{flex:none;width:36px;height:36px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;background:var(--bcm-soft);font-size:20px;line-height:1;-webkit-user-select:none;user-select:none}.bcm-avatar-initial{color:#fff;font-size:16px;font-weight:650}.bcm-reactions{display:flex;flex-wrap:wrap;gap:6px}.bcm-react{font:inherit;display:inline-flex;align-items:center;gap:4px;min-height:32px;padding:2px 10px;border-radius:999px;border:1px solid var(--bcm-line);background:var(--bcm-bg);color:var(--bcm-fg);cursor:pointer}button.bcm-react:hover:not(:disabled){background:var(--bcm-soft)}.bcm-react[aria-pressed=true]{border:2px solid var(--bcm-accent);font-weight:700}span.bcm-react{cursor:default}.bcm-menu{position:relative;display:inline-flex}.bcm-menu-list{position:absolute;right:0;top:calc(100% + 4px);z-index:var(--bcm-z);min-width:200px;display:flex;flex-direction:column;padding:4px;background:var(--bcm-bg);border:1px solid var(--bcm-line);border-radius:10px;box-shadow:var(--bcm-shadow)}.bcm-menu-list button,.bcm-menu-list a{font:inherit;text-align:left;border:0;background:none;color:var(--bcm-fg);padding:8px 10px;border-radius:6px;cursor:pointer;text-decoration:none;min-height:36px}.bcm-menu-list button:hover,.bcm-menu-list a:hover{background:var(--bcm-soft)}.bcm-composer{display:flex;flex-direction:column;gap:8px}.bcm-composer-foot{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.bcm-counter{color:var(--bcm-muted);font-size:.8125em;font-variant-numeric:tabular-nums}.bcm-counter-over{color:var(--bcm-danger);font-weight:650}.bcm-confirm{border:2px solid var(--bcm-accent);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:10px}.bcm-card{border:1px solid var(--bcm-line);border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:12px}.bcm-steps{color:var(--bcm-muted);font-size:.875em}.bcm-rules{list-style:none;display:flex;flex-direction:column;gap:8px}.bcm-rules li{display:flex;flex-direction:column;gap:2px}.bcm-consent{max-height:260px;overflow:auto;border:1px solid var(--bcm-line);border-radius:8px;padding:10px 12px;display:flex;flex-direction:column;gap:8px}.bcm-form{display:flex;flex-direction:column;gap:14px}.bcm-section{display:flex;flex-direction:column;gap:10px}.bcm-list{list-style:none;display:flex;flex-direction:column;gap:8px}.bcm-list>li{border:1px solid var(--bcm-line);border-radius:10px;padding:10px 12px;display:flex;flex-direction:column;gap:4px}.bcm-unread{border-left:4px solid var(--bcm-accent)!important}.bcm-dl{display:grid;grid-template-columns:minmax(120px,max-content) 1fr;gap:6px 14px;margin:0}.bcm-dl dt{font-weight:600}.bcm-dl dd{margin:0}.bcm-receipt{display:flex;flex-direction:column;gap:8px}.bcm-turnstile{min-height:0}.bcm-mention{color:var(--bcm-accent);font-weight:600;text-decoration:none}.bcm-mention:hover{text-decoration:underline}:host(blogmcp-badge){display:inline-block}.bcm-badge-link{display:inline-flex;align-items:center;justify-content:center;min-width:1.5em;height:1.5em;padding:0 6px;border-radius:999px;background:var(--bcm-accent);color:var(--bcm-accent-fg);font-size:.8125em;font-weight:700;line-height:1;text-decoration:none;font-variant-numeric:tabular-nums}.bcm-switches{list-style:none;display:flex;flex-direction:column;gap:10px}.bcm-switches li{display:flex;flex-direction:column;gap:2px}.bcm-profile-head{display:flex;align-items:center;gap:12px}.bcm-profile-head .bcm-avatar{width:48px;height:48px;font-size:26px}.bcm-links{list-style:none;display:flex;flex-direction:column;gap:8px}.bcm-url{overflow-wrap:anywhere;font-family:ui-monospace,monospace;font-size:.875em}.bcm-dialog{border:1px solid var(--bcm-line);border-radius:14px;padding:0;width:min(520px,calc(100vw - 32px));max-height:calc(100vh - 32px);background:var(--bcm-bg);color:var(--bcm-fg);box-shadow:var(--bcm-shadow)}.bcm-dialog::backdrop{background:#0a0c1073}.bcm-dialog-body{padding:16px;display:flex;flex-direction:column;gap:12px}@media(max-width:480px){.bcm{padding:12px;border-radius:0}.bcm-replies{padding-left:12px}.bcm-avatar{width:30px;height:30px;font-size:17px}.bcm-dl{grid-template-columns:1fr}.bcm-dialog{width:100vw;max-width:100vw;margin:auto 0 0;border-radius:16px 16px 0 0}}@media(prefers-reduced-motion:no-preference){.bcm-dialog[open]{animation:bcm-in .14s ease-out}@keyframes bcm-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}}:host(blogmcp-follow-button){display:inline-block}.bcm-follow-host{display:inline-flex}.bcm-follow{display:inline-flex;align-items:center;gap:6px}.bcm-follow .bcm-btn[aria-pressed=true]{border:2px solid var(--bcm-accent);font-weight:650}.bcm-grow{flex:1;min-width:0}.bcm-select{width:auto;max-width:100%}.bcm-category{gap:8px}.bcm-topics{list-style:none;display:flex;flex-direction:column}.bcm-topic-row{border-bottom:1px solid var(--bcm-line);padding:8px 0;display:flex;flex-direction:column;gap:4px}.bcm-topic-row:last-child{border-bottom:0}.bcm-topic-title{font-weight:650}';function iC(){const e=globalThis,t={__VUE_OPTIONS_API__:!0,__VUE_PROD_DEVTOOLS__:!1,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__:!1};for(const[n,s]of Object.entries(t))typeof e[n]>"u"&&(e[n]=s)}const Ic="blogmcp-discussion",Tc="blogmcp-notice-form",Cc="blogmcp-my-community",Sc="blogmcp-notification-centre",Ac="blogmcp-badge",Oc="blogmcp-member-settings",Ec="blogmcp-profile",Mc="blogmcp-welcome",Pc="blogmcp-forum",Rc="blogmcp-forum-category",Nc="blogmcp-topic",jc="blogmcp-forum-search",zc="blogmcp-follow-button",Lc="blogmcp-forum-moderation";function rC(e){const t=e.nonce;return typeof t=="string"&&t!==""?t:e.getAttribute("nonce")||void 0}function aC(e,t){const n=cf(e);return class extends n{connectedCallback(){const o=rC(this),r=t||o;r&&!o&&(this.nonce=r);const a=this.shadowRoot;if(a&&!a.querySelector("style[data-bcm]")){const l=document.createElement("style");l.setAttribute("data-bcm",""),r&&l.setAttribute("nonce",r),l.textContent=sC,a.prepend(l)}super.connectedCallback()}}}function yt(e,t,n){typeof customElements>"u"||customElements.get(e)||(iC(),customElements.define(e,aC(t,n)))}function Dc(e={}){yt(e.tag??Ic,Cv,e.nonce)}function Fc(e={}){yt(e.tag??Tc,Px,e.nonce)}function Uc(e={}){yt(e.tag??Cc,K0,e.nonce)}function qc(e={}){yt(e.tag??Sc,sI,e.nonce)}function Bc(e={}){yt(e.tag??Ac,Fp,e.nonce)}function Hc(e={}){yt(e.tag??Oc,u1,e.nonce)}function Vc(e={}){yt(e.tag??Ec,AI,e.nonce)}function Kc(e={}){yt(e.tag??Mc,oC,e.nonce)}function Wc(e={}){yt(e.tag??Pc,xw,e.nonce)}function Yc(e={}){yt(e.tag??Rc,Ry,e.nonce)}function Gc(e={}){yt(e.tag??Nc,UT,e.nonce)}function Zc(e={}){yt(e.tag??jc,tw,e.nonce)}function Jc(e={}){yt(e.tag??zc,Rv,e.nonce)}function Xc(e={}){yt(e.tag??Lc,yk,e.nonce)}function Qc(e={}){Dc({tag:e.tags?.discussion,nonce:e.nonce}),Fc({tag:e.tags?.noticeForm,nonce:e.nonce}),Uc({tag:e.tags?.myCommunity,nonce:e.nonce}),qc({tag:e.tags?.notificationCentre,nonce:e.nonce}),Bc({tag:e.tags?.badge,nonce:e.nonce}),Hc({tag:e.tags?.memberSettings,nonce:e.nonce}),Vc({tag:e.tags?.profile,nonce:e.nonce}),Kc({tag:e.tags?.welcome,nonce:e.nonce}),Wc({tag:e.tags?.forum,nonce:e.nonce}),Yc({tag:e.tags?.forumCategory,nonce:e.nonce}),Gc({tag:e.tags?.topic,nonce:e.nonce}),Zc({tag:e.tags?.forumSearch,nonce:e.nonce}),Jc({tag:e.tags?.followButton,nonce:e.nonce}),Xc({tag:e.tags?.forumModeration,nonce:e.nonce})}function _t(e,t){for(const[n,s]of Object.entries(t))s!=null&&s!==""&&e.setAttribute(n,String(s))}function kt(e,t){return t.transport&&(e.transport=t.transport),(t.container??document.body).appendChild(e),()=>e.remove()}function lC(e){if(typeof document>"u")return()=>{};Dc({nonce:e.nonce});const t=document.createElement(Ic);return _t(t,{"article-id":e.articleId,"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,"sign-in-href":e.signInHref,routes:e.routes?JSON.stringify(e.routes):void 0,"poll-ms":e.pollMs,nonce:e.nonce}),e.realtime&&(t.realtime=e.realtime),kt(t,e)}function cC(e){if(typeof document>"u")return()=>{};Fc({nonce:e.nonce});const t=document.createElement(Tc);return _t(t,{"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,"turnstile-site-key":e.turnstileSiteKey,target:e.target?JSON.stringify(e.target):void 0,"article-id":e.articleId,routes:e.routes?JSON.stringify(e.routes):void 0,nonce:e.nonce}),kt(t,e)}function uC(e={}){if(typeof document>"u")return()=>{};Uc({nonce:e.nonce});const t=document.createElement(Cc);return _t(t,{"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,"decision-id":e.decisionId,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,nonce:e.nonce}),kt(t,e)}function dC(e={}){if(typeof document>"u")return()=>{};qc({nonce:e.nonce});const t=document.createElement(Sc);return _t(t,{"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,nonce:e.nonce}),kt(t,e)}function fC(e={}){if(typeof document>"u")return()=>{};Bc({nonce:e.nonce});const t=document.createElement(Ac);return _t(t,{"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,"poll-ms":e.pollMs,nonce:e.nonce}),kt(t,e)}function mC(e={}){if(typeof document>"u")return()=>{};Hc({nonce:e.nonce});const t=document.createElement(Oc);return _t(t,{"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,"sw-path":e.swPath,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,nonce:e.nonce}),kt(t,e)}function pC(e){if(typeof document>"u")return()=>{};Vc({nonce:e.nonce});const t=document.createElement(Ec);return _t(t,{handle:e.handle,"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,nonce:e.nonce}),kt(t,e)}function hC(e={}){if(typeof document>"u")return()=>{};Kc({nonce:e.nonce});const t=document.createElement(Mc);return _t(t,{"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,nonce:e.nonce}),kt(t,e)}function bC(e={}){if(typeof document>"u")return()=>{};Wc({nonce:e.nonce});const t=document.createElement(Pc);return _t(t,{"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,nonce:e.nonce}),kt(t,e)}function gC(e){if(typeof document>"u")return()=>{};Yc({nonce:e.nonce});const t=document.createElement(Rc);return _t(t,{slug:e.slug,"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,nonce:e.nonce}),kt(t,e)}function vC(e){if(typeof document>"u")return()=>{};Gc({nonce:e.nonce});const t=document.createElement(Nc);return _t(t,{"conversation-id":e.conversationId,"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,"poll-ms":e.pollMs,nonce:e.nonce}),e.realtime&&(t.realtime=e.realtime),kt(t,e)}function yC(e={}){if(typeof document>"u")return()=>{};Zc({nonce:e.nonce});const t=document.createElement(jc);return _t(t,{"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,"sign-in-href":e.signInHref,nonce:e.nonce}),kt(t,e)}function _C(e){if(typeof document>"u")return()=>{};Jc({nonce:e.nonce});const t=document.createElement(zc);return _t(t,{"target-kind":e.targetKind,"target-id":e.targetId,following:typeof e.following=="boolean"?String(e.following):void 0,"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,nonce:e.nonce}),kt(t,e)}function kC(e={}){if(typeof document>"u")return()=>{};Xc({nonce:e.nonce});const t=document.createElement(Lc);return _t(t,{"category-id":e.categoryId,"api-base":e.apiBase,"site-base":e.siteBase,lang:e.lang,routes:e.routes?JSON.stringify(e.routes):void 0,nonce:e.nonce}),kt(t,e)}const wC="0.4.0",$C=typeof document<"u"?document.currentScript:null;return Qc({nonce:$C?.nonce||void 0}),Ye.VERSION=wC,Ye.defineCommunityElements=Qc,Ye.mountBadge=fC,Ye.mountDiscussion=lC,Ye.mountFollowButton=_C,Ye.mountForum=bC,Ye.mountForumCategory=gC,Ye.mountForumModeration=kC,Ye.mountForumSearch=yC,Ye.mountMemberSettings=mC,Ye.mountMyCommunity=uC,Ye.mountNoticeForm=cC,Ye.mountNotificationCentre=dC,Ye.mountProfile=pC,Ye.mountTopic=vC,Ye.mountWelcome=hC,Object.defineProperty(Ye,Symbol.toStringTag,{value:"Module"}),Ye})({});
|