From cd3ed420a25adfa8f5e79e723b88f2d54a99f2d6 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 19 Oct 2026 00:07:17 +0800 Subject: [PATCH] Fix location card contrast and mobile history controls --- frontend/src/components/FamilyLocations.vue | 4 ++ frontend/src/components/LocationHistory.vue | 4 ++ frontend/src/maps/map.css | 2 + ...yMap-CoPJzTbz.js => FamilyMap-CiWCoS6Z.js} | 4 +- ...r-CWvM1oPI.css => controller-B0JP7gQd.css} | 2 +- ...ler-Je5cOZA3.js => controller-NWgljfVQ.js} | 0 ...{index-C1TAw2ld.css => index-CgbLhMOE.css} | 2 +- .../{index-Ctw7iCDS.js => index-xETRcHmQ.js} | 70 +++++++++---------- .../{map-CT6w3aO1.js => map-qt6gqu0E.js} | 2 +- .../assets/{tv-BLhSIH0H.js => tv-Dxkdq4LJ.js} | 2 +- web/ui/index.html | 6 +- web/ui/map.html | 6 +- web/ui/tv.html | 4 +- 13 files changed, 59 insertions(+), 49 deletions(-) rename web/ui/assets/{FamilyMap-CoPJzTbz.js => FamilyMap-CiWCoS6Z.js} (99%) rename web/ui/assets/{controller-CWvM1oPI.css => controller-B0JP7gQd.css} (99%) rename web/ui/assets/{controller-Je5cOZA3.js => controller-NWgljfVQ.js} (100%) rename web/ui/assets/{index-C1TAw2ld.css => index-CgbLhMOE.css} (94%) rename web/ui/assets/{index-Ctw7iCDS.js => index-xETRcHmQ.js} (77%) rename web/ui/assets/{map-CT6w3aO1.js => map-qt6gqu0E.js} (90%) rename web/ui/assets/{tv-BLhSIH0H.js => tv-Dxkdq4LJ.js} (99%) diff --git a/frontend/src/components/FamilyLocations.vue b/frontend/src/components/FamilyLocations.vue index a72ef2d..1415d87 100644 --- a/frontend/src/components/FamilyLocations.vue +++ b/frontend/src/components/FamilyLocations.vue @@ -45,3 +45,7 @@ onBeforeUnmount(()=>{epoch++;clearTimeout(timer)}) + diff --git a/frontend/src/components/LocationHistory.vue b/frontend/src/components/LocationHistory.vue index 235d118..b0d326e 100644 --- a/frontend/src/components/LocationHistory.vue +++ b/frontend/src/components/LocationHistory.vue @@ -10,3 +10,7 @@ async function load(more=false){const cursor=more?next.value:0;if(!more)clear(); function hidden(){if(document.hidden)clear()}document.addEventListener('visibilitychange',hidden);onBeforeUnmount(()=>{clear();document.removeEventListener('visibilitychange',hidden)}) + diff --git a/frontend/src/maps/map.css b/frontend/src/maps/map.css index e9d1d67..88b5fc4 100644 --- a/frontend/src/maps/map.css +++ b/frontend/src/maps/map.css @@ -1 +1,3 @@ .family-map-canvas{height:100%;width:100%;min-height:240px;background:#e5efea;border-radius:16px;overflow:hidden;position:relative}.family-map-pin{display:flex;align-items:center;gap:6px;border:0;background:transparent;color:#193d34;cursor:pointer;padding:4px;font-family:inherit}.family-map-pin>span{display:grid;place-items:center;width:40px;height:40px;background:#207e6e;border:3px solid white;border-radius:50%;color:white;font-size:17px;box-shadow:0 3px 14px #12392e40}.family-map-pin>b{background:#fffffff2;border-radius:8px;padding:5px 9px;box-shadow:0 2px 8px #12392e20;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.family-map-pin.selected>span{background:#d37f3a;outline:3px solid #e8bc72}.maplibregl-ctrl button{min-width:36px;min-height:36px}.maplibregl-ctrl-attrib a{color:#375e51}.maplibregl-canvas:focus-visible{outline:3px solid #207e6e;outline-offset:-3px}[data-theme=night] .family-map-canvas{background:#1d2d27}[data-theme=night] .family-map-pin>b{background:#243c34;color:#cad9d2}.family-map-status{font-size:.8rem;color:#627c70;margin:.4rem 0}.maplibregl-control-container{font:12px sans-serif} +.family-map-pin>b{color:#193d34} +[data-theme=night] .family-map-pin>b{color:#cad9d2} diff --git a/web/ui/assets/FamilyMap-CoPJzTbz.js b/web/ui/assets/FamilyMap-CiWCoS6Z.js similarity index 99% rename from web/ui/assets/FamilyMap-CoPJzTbz.js rename to web/ui/assets/FamilyMap-CiWCoS6Z.js index 78ffac2..c08acca 100644 --- a/web/ui/assets/FamilyMap-CoPJzTbz.js +++ b/web/ui/assets/FamilyMap-CiWCoS6Z.js @@ -1,3 +1,3 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/controller-Je5cOZA3.js","assets/controller-CWvM1oPI.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/controller-NWgljfVQ.js","assets/controller-B0JP7gQd.css"])))=>i.map(i=>d[i]); function qs(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const K={},et=[],Ae=()=>{},Yn=()=>!1,ls=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),cs=e=>e.startsWith("onUpdate:"),Z=Object.assign,ks=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},fr=Object.prototype.hasOwnProperty,j=(e,t)=>fr.call(e,t),T=Array.isArray,qe=e=>Ft(e)==="[object Map]",je=e=>Ft(e)==="[object Set]",mn=e=>Ft(e)==="[object Date]",I=e=>typeof e=="function",k=e=>typeof e=="string",Oe=e=>typeof e=="symbol",N=e=>e!==null&&typeof e=="object",Xn=e=>(N(e)||I(e))&&I(e.then)&&I(e.catch),Zn=Object.prototype.toString,Ft=e=>Zn.call(e),ur=e=>Ft(e).slice(8,-1),Qn=e=>Ft(e)==="[object Object]",Gs=e=>k(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,xt=qs(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),fs=e=>{const t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},ar=/-\w/g,he=fs(e=>e.replace(ar,t=>t.slice(1).toUpperCase())),dr=/\B([A-Z])/g,it=fs(e=>e.replace(dr,"-$1").toLowerCase()),ei=fs(e=>e.charAt(0).toUpperCase()+e.slice(1)),ws=fs(e=>e?`on${ei(e)}`:""),Ee=(e,t)=>!Object.is(e,t),kt=(e,...t)=>{for(let s=0;s{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},us=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let _n;const as=()=>_n||(_n=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});function ds(e){if(T(e)){const t={};for(let s=0;ss.startsWith("/*")?"":s).split(hr).forEach(s=>{if(s){const n=s.split(pr);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Js(e){let t="";if(k(e))t=e;else if(T(e))for(let s=0;sNe(s,t))}const ni=e=>!!(e&&e.__v_isRef===!0),ii=e=>k(e)?e:e==null?"":T(e)||N(e)&&(e.toString===Zn||!I(e.toString))?ni(e)?ii(e.value):JSON.stringify(e,ri,2):String(e),ri=(e,t)=>ni(t)?ri(e,t.value):qe(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,i],r)=>(s[Cs(n,r)+" =>"]=i,s),{})}:je(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Cs(s))}:Oe(t)?Cs(t):N(t)&&!T(t)&&!Qn(t)?String(t):t,Cs=(e,t="")=>{var s;return Oe(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};let X;class vr{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&X&&(X.active?(this.parent=X,this.index=(X.scopes||(X.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes){const n=this.scopes.slice();for(t=0,s=n.length;t0&&--this._on===0){if(X===this)X=this.prevScope;else{let t=X;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s0)return;if(St){let t=St;for(St=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;vt;){let t=vt;for(vt=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function fi(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ui(e){let t,s=e.depsTail,n=s;for(;n;){const i=n.prevDep;n.version===-1?(n===s&&(s=i),Zs(n),wr(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=i}e.deps=t,e.depsTail=s}function Ds(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ai(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ai(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Tt)||(e.globalVersion=Tt,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ds(e))))return;e.flags|=2;const t=e.dep,s=B,n=pe;B=e,pe=!0;try{fi(e);const i=e.fn(e._value);(t.version===0||Ee(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{B=s,pe=n,ui(e),e.flags&=-3}}function Zs(e,t=!1){const{dep:s,prevSub:n,nextSub:i}=e;if(n&&(n.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let r=s.computed.deps;r;r=r.nextDep)Zs(r,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function wr(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let pe=!0;const di=[];function He(){di.push(pe),pe=!1}function Le(){const e=di.pop();pe=e===void 0?!0:e}function xn(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=B;B=void 0;try{t()}finally{B=s}}}let Tt=0;class Cr{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class hs{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(!B||!pe||B===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==B)s=this.activeLink=new Cr(B,this),B.deps?(s.prevDep=B.depsTail,B.depsTail.nextDep=s,B.depsTail=s):B.deps=B.depsTail=s,hi(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=B.depsTail,s.nextDep=void 0,B.depsTail.nextDep=s,B.depsTail=s,B.deps===s&&(B.deps=n)}return s}trigger(t){this.version++,Tt++,this.notify(t)}notify(t){Ys();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{Xs()}}}function hi(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)hi(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const Vs=new WeakMap,st=Symbol(""),js=Symbol(""),At=Symbol("");function Q(e,t,s){if(pe&&B){let n=Vs.get(e);n||Vs.set(e,n=new Map);let i=n.get(s);i||(n.set(s,i=new hs),i.map=n,i.key=s),i.track()}}function De(e,t,s,n,i,r){const o=Vs.get(e);if(!o){Tt++;return}const l=f=>{f&&f.trigger()};if(Ys(),t==="clear")o.forEach(l);else{const f=T(e),d=f&&Gs(s);if(f&&s==="length"){const a=Number(n);o.forEach((p,v)=>{(v==="length"||v===At||!Oe(v)&&v>=a)&&l(p)})}else switch((s!==void 0||o.has(void 0))&&l(o.get(s)),d&&l(o.get(At)),t){case"add":f?d&&l(o.get("length")):(l(o.get(st)),qe(e)&&l(o.get(js)));break;case"delete":f||(l(o.get(st)),qe(e)&&l(o.get(js)));break;case"set":qe(e)&&l(o.get(st));break}}Xs()}function rt(e){const t=V(e);return t===e||(Q(t,"iterate",At),ue(e))?t:Pe(e)?ke(e)?t.map(s=>Ge(ae(s))):t.map(Ge):t.map(ae)}function ps(e){return Q(e=V(e),"iterate",At),e}function we(e,t){return Pe(e)?Ge(ke(e)?ae(t):t):ae(t)}const Er={__proto__:null,[Symbol.iterator](){return Ts(this,Symbol.iterator,e=>we(this,e))},concat(...e){return rt(this).concat(...e.map(t=>T(t)?rt(t):t))},entries(){return Ts(this,"entries",e=>(e[1]=we(this,e[1]),e))},every(e,t){return Me(this,"every",e,t,void 0,arguments)},filter(e,t){return Me(this,"filter",e,t,s=>s.map(n=>we(this,n)),arguments)},find(e,t){return Me(this,"find",e,t,s=>we(this,s),arguments)},findIndex(e,t){return Me(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Me(this,"findLast",e,t,s=>we(this,s),arguments)},findLastIndex(e,t){return Me(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Me(this,"forEach",e,t,void 0,arguments)},includes(...e){return As(this,"includes",e)},indexOf(...e){return As(this,"indexOf",e)},join(e){return rt(this).join(e)},lastIndexOf(...e){return As(this,"lastIndexOf",e)},map(e,t){return Me(this,"map",e,t,void 0,arguments)},pop(){return gt(this,"pop")},push(...e){return gt(this,"push",e)},reduce(e,...t){return vn(this,"reduce",e,t)},reduceRight(e,...t){return vn(this,"reduceRight",e,t)},shift(){return gt(this,"shift")},some(e,t){return Me(this,"some",e,t,void 0,arguments)},splice(...e){return gt(this,"splice",e)},toReversed(){return rt(this).toReversed()},toSorted(e){return rt(this).toSorted(e)},toSpliced(...e){return rt(this).toSpliced(...e)},unshift(...e){return gt(this,"unshift",e)},values(){return Ts(this,"values",e=>we(this,e))}};function Ts(e,t,s){const n=ps(e),i=n[t]();return n!==e&&!ue(e)&&(i._next=i.next,i.next=()=>{const r=i._next();return r.done||(r.value=s(r.value)),r}),i}const Tr=Array.prototype;function Me(e,t,s,n,i,r){const o=ps(e),l=o!==e&&!ue(e),f=o[t];if(f!==Tr[t]){const p=f.apply(e,r);return l?ae(p):p}let d=s;o!==e&&(l?d=function(p,v){return s.call(this,we(e,p),v,e)}:s.length>2&&(d=function(p,v){return s.call(this,p,v,e)}));const a=f.call(o,d,n);return l&&i?i(a):a}function vn(e,t,s,n){const i=ps(e),r=i!==e&&!ue(e);let o=s,l=!1;i!==e&&(r?(l=n.length===0,o=function(d,a,p){return l&&(l=!1,d=we(e,d)),s.call(this,d,we(e,a),p,e)}):s.length>3&&(o=function(d,a,p){return s.call(this,d,a,p,e)}));const f=i[t](o,...n);return l?we(e,f):f}function As(e,t,s){const n=V(e);Q(n,"iterate",At);const i=n[t](...s);return(i===-1||i===!1)&&sn(s[0])?(s[0]=V(s[0]),n[t](...s)):i}function gt(e,t,s=[]){He(),Ys();const n=V(e)[t].apply(e,s);return Xs(),Le(),n}const Ar=qs("__proto__,__v_isRef,__isVue"),pi=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Oe));function Or(e){Oe(e)||(e=String(e));const t=V(this);return Q(t,"has",e),t.hasOwnProperty(e)}class gi{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const i=this._isReadonly,r=this._isShallow;if(s==="__v_isReactive")return!i;if(s==="__v_isReadonly")return i;if(s==="__v_isShallow")return r;if(s==="__v_raw")return n===(i?r?Hr:yi:r?bi:_i).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const o=T(t);if(!i){let f;if(o&&(f=Er[s]))return f;if(s==="hasOwnProperty")return Or}const l=Reflect.get(t,s,ee(t)?t:n);if((Oe(s)?pi.has(s):Ar(s))||(i||Q(t,"get",s),r))return l;if(ee(l)){const f=o&&Gs(s)?l:l.value;return i&&N(f)?Hs(f):f}return N(l)?i?Hs(l):en(l):l}}class mi extends gi{constructor(t=!1){super(!1,t)}set(t,s,n,i){let r=t[s];const o=T(t)&&Gs(s);if(!this._isShallow){const d=Pe(r);if(!ue(n)&&!Pe(n)&&(r=V(r),n=V(n)),!o&&ee(r)&&!ee(n))return d||(r.value=n),!0}const l=o?Number(s)e,Kt=e=>Reflect.getPrototypeOf(e);function Fr(e,t,s){return function(...n){const i=this.__v_raw,r=V(i),o=qe(r),l=e==="entries"||e===Symbol.iterator&&o,f=e==="keys"&&o,d=i[e](...n),a=s?Ns:t?Ge:ae;return!t&&Q(r,"iterate",f?js:st),Z(Object.create(d),{next(){const{value:p,done:v}=d.next();return v?{value:p,done:v}:{value:l?[a(p[0]),a(p[1])]:a(p),done:v}}})}}function Ut(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Dr(e,t){const s={get(i){const r=this.__v_raw,o=V(r),l=V(i);e||(Ee(i,l)&&Q(o,"get",i),Q(o,"get",l));const{has:f}=Kt(o),d=t?Ns:e?Ge:ae;if(f.call(o,i))return d(r.get(i));if(f.call(o,l))return d(r.get(l));r!==o&&r.get(i)},get size(){const i=this.__v_raw;return!e&&Q(V(i),"iterate",st),i.size},has(i){const r=this.__v_raw,o=V(r),l=V(i);return e||(Ee(i,l)&&Q(o,"has",i),Q(o,"has",l)),i===l?r.has(i):r.has(i)||r.has(l)},forEach(i,r){const o=this,l=o.__v_raw,f=V(l),d=t?Ns:e?Ge:ae;return!e&&Q(f,"iterate",st),l.forEach((a,p)=>i.call(r,d(a),d(p),o))}};return Z(s,e?{add:Ut("add"),set:Ut("set"),delete:Ut("delete"),clear:Ut("clear")}:{add(i){const r=V(this),o=Kt(r),l=V(i),f=!t&&!ue(i)&&!Pe(i)?l:i;return o.has.call(r,f)||Ee(i,f)&&o.has.call(r,i)||Ee(l,f)&&o.has.call(r,l)||(r.add(f),De(r,"add",f,f)),this},set(i,r){!t&&!ue(r)&&!Pe(r)&&(r=V(r));const o=V(this),{has:l,get:f}=Kt(o);let d=l.call(o,i);d||(i=V(i),d=l.call(o,i));const a=f.call(o,i);return o.set(i,r),d?Ee(r,a)&&De(o,"set",i,r):De(o,"add",i,r),this},delete(i){const r=V(this),{has:o,get:l}=Kt(r);let f=o.call(r,i);f||(i=V(i),f=o.call(r,i)),l&&l.call(r,i);const d=r.delete(i);return f&&De(r,"delete",i,void 0),d},clear(){const i=V(this),r=i.size!==0,o=i.clear();return r&&De(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{s[i]=Fr(i,e,t)}),s}function Qs(e,t){const s=Dr(e,t);return(n,i,r)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(j(s,i)&&i in n?s:n,i,r)}const Vr={get:Qs(!1,!1)},jr={get:Qs(!1,!0)},Nr={get:Qs(!0,!1)};const _i=new WeakMap,bi=new WeakMap,yi=new WeakMap,Hr=new WeakMap;function Lr(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function en(e){return Pe(e)?e:tn(e,!1,Mr,Vr,_i)}function $r(e){return tn(e,!1,Rr,jr,bi)}function Hs(e){return tn(e,!0,Ir,Nr,yi)}function tn(e,t,s,n,i){if(!N(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const r=i.get(e);if(r)return r;const o=Lr(ur(e));if(o===0)return e;const l=new Proxy(e,o===2?n:s);return i.set(e,l),l}function ke(e){return Pe(e)?ke(e.__v_raw):!!(e&&e.__v_isReactive)}function Pe(e){return!!(e&&e.__v_isReadonly)}function ue(e){return!!(e&&e.__v_isShallow)}function sn(e){return e?!!e.__v_raw:!1}function V(e){const t=e&&e.__v_raw;return t?V(t):e}function Kr(e){return!j(e,"__v_skip")&&Object.isExtensible(e)&&ti(e,"__v_skip",!0),e}const ae=e=>N(e)?en(e):e,Ge=e=>N(e)?Hs(e):e;function ee(e){return e?e.__v_isRef===!0:!1}function Sn(e){return xi(e,!1)}function $l(e){return xi(e,!0)}function xi(e,t){return ee(e)?e:new Ur(e,t)}class Ur{constructor(t,s){this.dep=new hs,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:V(t),this._value=s?t:ae(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||ue(t)||Pe(t);t=n?t:V(t),Ee(t,s)&&(this._rawValue=t,this._value=n?t:ae(t),this.dep.trigger())}}function Br(e){return ee(e)?e.value:e}const Wr={get:(e,t,s)=>t==="__v_raw"?e:Br(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const i=e[t];return ee(i)&&!ee(s)?(i.value=s,!0):Reflect.set(e,t,s,n)}};function vi(e){return ke(e)?e:new Proxy(e,Wr)}class qr{constructor(t){this.__v_isRef=!0,this._value=void 0;const s=this.dep=new hs,{get:n,set:i}=t(s.track.bind(s),s.trigger.bind(s));this._get=n,this._set=i}get value(){return this._value=this._get()}set value(t){this._set(t)}}function Kl(e){return new qr(e)}class kr{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new hs(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Tt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&B!==this)return ci(this,!0),!0}get value(){const t=this.dep.track();return ai(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Gr(e,t,s=!1){let n,i;return I(e)?n=e:(n=e.get,i=e.set),new kr(n,i,s)}const Bt={},Yt=new WeakMap;let Qe;function Jr(e,t=!1,s=Qe){if(s){let n=Yt.get(s);n||Yt.set(s,n=[]),n.push(e)}}function zr(e,t,s=K){const{immediate:n,deep:i,once:r,scheduler:o,augmentJob:l,call:f}=s,d=O=>i?O:ue(O)||i===!1||i===0?Ve(O,1):Ve(O);let a,p,v,C,D=!1,M=!1;if(ee(e)?(p=()=>e.value,D=ue(e)):ke(e)?(p=()=>d(e),D=!0):T(e)?(M=!0,D=e.some(O=>ke(O)||ue(O)),p=()=>e.map(O=>{if(ee(O))return O.value;if(ke(O))return d(O);if(I(O))return f?f(O,2):O()})):I(e)?t?p=f?()=>f(e,2):e:p=()=>{if(v){He();try{v()}finally{Le()}}const O=Qe;Qe=a;try{return f?f(e,3,[C]):e(C)}finally{Qe=O}}:p=Ae,t&&i){const O=p,z=i===!0?1/0:i;p=()=>Ve(O(),z)}const G=Sr(),W=()=>{a.stop(),G&&G.active&&ks(G.effects,a)};if(r&&t){const O=t;t=(...z)=>{const me=O(...z);return W(),me}}let F=M?new Array(e.length).fill(Bt):Bt;const H=O=>{if(!(!(a.flags&1)||!a.dirty&&!O))if(t){const z=a.run();if(O||i||D||(M?z.some((me,_e)=>Ee(me,F[_e])):Ee(z,F))){v&&v();const me=Qe;Qe=a;try{const _e=[z,F===Bt?void 0:M&&F[0]===Bt?[]:F,C];F=z,f?f(t,3,_e):t(..._e)}finally{Qe=me}}}else a.run()};return l&&l(H),a=new oi(p),a.scheduler=o?()=>o(H,!1):H,C=O=>Jr(O,!1,a),v=a.onStop=()=>{const O=Yt.get(a);if(O){if(f)f(O,4);else for(const z of O)z();Yt.delete(a)}},t?n?H(!0):F=a.run():o?o(H.bind(null,!0),!0):a.run(),W.pause=a.pause.bind(a),W.resume=a.resume.bind(a),W.stop=W,W}function Ve(e,t=1/0,s){if(t<=0||!N(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,ee(e))Ve(e.value,t,s);else if(T(e))for(let n=0;n{Ve(n,t,s)});else if(Qn(e)){for(const n in e)Ve(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&Ve(e[n],t,s)}return e}function Dt(e,t,s,n){try{return n?e(...n):e()}catch(i){gs(i,t,s)}}function ge(e,t,s,n){if(I(e)){const i=Dt(e,t,s,n);return i&&Xn(i)&&i.catch(r=>{gs(r,t,s)}),i}if(T(e)){const i=[];for(let r=0;r>>1,i=ne[n],r=Ot(i);r=Ot(s)?ne.push(e):ne.splice(Xr(t),0,e),e.flags|=1,Ci()}}function Ci(){Xt||(Xt=Si.then(Ti))}function Zr(e){if(!T(e))Be&&e.id===-1?Be.splice(ot+1,0,e):e.flags&1||(lt.push(e),e.flags|=1);else for(let t=0;tOt(s)-Ot(n));if(lt.length=0,Be){for(let s=0;se.id==null?e.flags&2?-1:1/0:e.id;function Ti(e){try{for(Se=0;Se{n._d&&ts(-1);const r=Zt(t),o=nt.length;let l;try{l=e(...i)}finally{for(let f=nt.length;f>o;f--)Zi();Zt(r),n._d&&ts(1)}return l};return n._n=!0,n._c=!0,n._d=!0,n}function Ul(e,t){if(fe===null)return e;const s=xs(fe),n=e.dirs||(e.dirs=[]);for(let i=0;i1)return s&&I(t)?t.call(n&&n.proxy):t}}const to=Symbol.for("v-scx"),so=()=>Gt(to);function Bl(e,t){return rn(e,null,t)}function tt(e,t,s){return rn(e,t,s)}function rn(e,t,s=K){const{immediate:n,deep:i,flush:r,once:o}=s,l=Z({},s),f=t&&n||!t&&r!=="post";let d;if(It){if(r==="sync"){const C=so();d=C.__watcherHandles||(C.__watcherHandles=[])}else if(!f){const C=()=>{};return C.stop=Ae,C.resume=Ae,C.pause=Ae,C}}const a=ie;l.call=(C,D,M)=>ge(C,a,D,M);let p=!1;r==="post"?l.scheduler=C=>{re(C,a&&a.suspense)}:r!=="sync"&&(p=!0,l.scheduler=(C,D)=>{D?C():nn(C)}),l.augmentJob=C=>{t&&(C.flags|=4),p&&(C.flags|=2,a&&(C.id=a.uid,C.i=a))};const v=zr(e,t,l);return It&&(d?d.push(v):f&&v()),v}function no(e,t,s){const n=this.proxy,i=k(e)?e.includes(".")?Oi(n,e):()=>n[e]:e.bind(n,n);let r;I(t)?r=t:(r=t.handler,s=t);const o=Vt(this),l=rn(i,r.bind(n),s);return o(),l}function Oi(e,t){const s=t.split(".");return()=>{let n=e;for(let i=0;ie.__isTeleport,Os=Symbol("_leaveCb");function ro(e){let t=e[0];if(e.length>1){for(const s of e)if(s.type!==$e){t=s;break}}return t}function Pi(e){if(!ln(e))return ms(e.type)&&e.children?ro(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:s}=e;if(s){if(t&16)return s[0];if(t&32&&I(s.default))return s.default()}}function on(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const s=e.component.subTree;on(ms(s.type)&&Pi(s)||s,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Wl(e,t){return I(e)?Z({name:e.name},t,{setup:e}):e}function Mi(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Cn(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const Qt=new WeakMap;function wt(e,t,s,n,i=!1){if(T(e)){e.forEach((M,G)=>wt(M,t&&(T(t)?t[G]:t),s,n,i));return}if(Ct(n)&&!i){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&wt(e,t,s,n.component.subTree);return}const r=n.shapeFlag&4?xs(n.component):n.el,o=i?null:r,{i:l,r:f}=e,d=t&&t.r,a=l.refs===K?l.refs={}:l.refs,p=l.setupState,v=V(p),C=p===K?Yn:M=>Cn(a,M)?!1:j(v,M),D=(M,G)=>!(G&&Cn(a,G));if(d!=null&&d!==f){if(En(t),k(d))a[d]=null,C(d)&&(p[d]=null);else if(ee(d)){const M=t;D(d,M.k)&&(d.value=null),M.k&&(a[M.k]=null)}}if(I(f))Dt(f,l,12,[o,a]);else{const M=k(f),G=ee(f);if(M||G){const W=()=>{if(e.f){const F=M?C(f)?p[f]:a[f]:D()||!e.k?f.value:a[e.k];if(i)T(F)&&ks(F,r);else if(T(F))F.includes(r)||F.push(r);else if(M)a[f]=[r],C(f)&&(p[f]=a[f]);else{const H=[r];D(f,e.k)&&(f.value=H),e.k&&(a[e.k]=H)}}else M?(a[f]=o,C(f)&&(p[f]=o)):G&&(D(f,e.k)&&(f.value=o),e.k&&(a[e.k]=o))};if(o){const F=()=>{W(),Qt.delete(e)};F.id=-1,Qt.set(e,F),re(F,s)}else En(e),W()}}}function En(e){const t=Qt.get(e);t&&(t.flags|=8,Qt.delete(e))}as().requestIdleCallback;as().cancelIdleCallback;const Ct=e=>!!e.type.__asyncLoader,ln=e=>e.type.__isKeepAlive;function oo(e,t){Ii(e,"a",t)}function lo(e,t){Ii(e,"da",t)}function Ii(e,t,s=ie){const n=e.__wdc||(e.__wdc=()=>{let i=s;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(_s(t,n,s),s){let i=s.parent;for(;i&&i.parent;)ln(i.parent.vnode)&&co(n,t,s,i),i=i.parent}}function co(e,t,s,n){const i=_s(t,e,n,!0);Di(()=>{ks(n[t],i)},s)}function _s(e,t,s=ie,n=!1){if(s){const i=s[e]||(s[e]=[]),r=t.__weh||(t.__weh=(...o)=>{He();const l=Vt(s),f=ge(t,s,e,o);return l(),Le(),f});return n?i.unshift(r):i.push(r),r}}const Ke=e=>(t,s=ie)=>{(!It||e==="sp")&&_s(e,(...n)=>t(...n),s)},fo=Ke("bm"),Ri=Ke("m"),uo=Ke("bu"),ao=Ke("u"),Fi=Ke("bum"),Di=Ke("um"),ho=Ke("sp"),po=Ke("rtg"),go=Ke("rtc");function mo(e,t=ie){_s("ec",e,t)}const _o=Symbol.for("v-ndc");function ql(e,t,s,n){let i;const r=s,o=T(e);if(o||k(e)){const l=o&&ke(e);let f=!1,d=!1;l&&(f=!ue(e),d=Pe(e),e=ps(e)),i=new Array(e.length);for(let a=0,p=e.length;at(l,f,void 0,r));else{const l=Object.keys(e);i=new Array(l.length);for(let f=0,d=l.length;fe?sr(e)?xs(e):Ls(e.parent):null,Et=Z(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=>Ls(e.parent),$root:e=>Ls(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ji(e),$forceUpdate:e=>e.f||(e.f=()=>{nn(e.update)}),$nextTick:e=>e.n||(e.n=wi.bind(e.proxy)),$watch:e=>no.bind(e)}),Ps=(e,t)=>e!==K&&!e.__isScriptSetup&&j(e,t),bo={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:i,props:r,accessCache:o,type:l,appContext:f}=e;if(t[0]!=="$"){const v=o[t];if(v!==void 0)switch(v){case 1:return n[t];case 2:return i[t];case 4:return s[t];case 3:return r[t]}else{if(Ps(n,t))return o[t]=1,n[t];if(i!==K&&j(i,t))return o[t]=2,i[t];if(j(r,t))return o[t]=3,r[t];if(s!==K&&j(s,t))return o[t]=4,s[t];$s&&(o[t]=0)}}const d=Et[t];let a,p;if(d)return t==="$attrs"&&Q(e.attrs,"get",""),d(e);if((a=l.__cssModules)&&(a=a[t]))return a;if(s!==K&&j(s,t))return o[t]=4,s[t];if(p=f.config.globalProperties,j(p,t))return p[t]},set({_:e},t,s){const{data:n,setupState:i,ctx:r}=e;return Ps(i,t)?(i[t]=s,!0):n!==K&&j(n,t)?(n[t]=s,!0):j(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:i,props:r,type:o}},l){let f;return!!(s[l]||e!==K&&l[0]!=="$"&&j(e,l)||Ps(t,l)||j(r,l)||j(n,l)||j(Et,l)||j(i.config.globalProperties,l)||(f=o.__cssModules)&&f[l])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:j(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function Tn(e){return T(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let $s=!0;function yo(e){const t=ji(e),s=e.proxy,n=e.ctx;$s=!1,t.beforeCreate&&An(t.beforeCreate,e,"bc");const{data:i,computed:r,methods:o,watch:l,provide:f,inject:d,created:a,beforeMount:p,mounted:v,beforeUpdate:C,updated:D,activated:M,deactivated:G,beforeDestroy:W,beforeUnmount:F,destroyed:H,unmounted:O,render:z,renderTracked:me,renderTriggered:_e,errorCaptured:Ue,serverPrefetch:jt,expose:Je,inheritAttrs:at,components:Nt,directives:Ht,filters:vs}=t;if(d&&xo(d,n,null),o)for(const q in o){const U=o[q];I(U)&&(n[q]=U.bind(s))}if(i){const q=i.call(s,s);N(q)&&(e.data=en(q))}if($s=!0,r)for(const q in r){const U=r[q],ze=I(U)?U.bind(s,s):I(U.get)?U.get.bind(s,s):Ae,Lt=!I(U)&&I(U.set)?U.set.bind(s):Ae,Ye=il({get:ze,set:Lt});Object.defineProperty(n,q,{enumerable:!0,configurable:!0,get:()=>Ye.value,set:de=>Ye.value=de})}if(l)for(const q in l)Vi(l[q],n,s,q);if(f){const q=I(f)?f.call(s):f;Reflect.ownKeys(q).forEach(U=>{eo(U,q[U])})}a&&An(a,e,"c");function te(q,U){T(U)?U.forEach(ze=>q(ze.bind(s))):U&&q(U.bind(s))}if(te(fo,p),te(Ri,v),te(uo,C),te(ao,D),te(oo,M),te(lo,G),te(mo,Ue),te(go,me),te(po,_e),te(Fi,F),te(Di,O),te(ho,jt),T(Je))if(Je.length){const q=e.exposed||(e.exposed={});Je.forEach(U=>{Object.defineProperty(q,U,{get:()=>s[U],set:ze=>s[U]=ze,enumerable:!0})})}else e.exposed||(e.exposed={});z&&e.render===Ae&&(e.render=z),at!=null&&(e.inheritAttrs=at),Nt&&(e.components=Nt),Ht&&(e.directives=Ht),jt&&Mi(e)}function xo(e,t,s=Ae){T(e)&&(e=Ks(e));for(const n in e){const i=e[n];let r;N(i)?"default"in i?r=Gt(i.from||n,i.default,!0):r=Gt(i.from||n):r=Gt(i),ee(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):t[n]=r}}function An(e,t,s){ge(T(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function Vi(e,t,s,n){let i=n.includes(".")?Oi(s,n):()=>s[n];if(k(e)){const r=t[e];I(r)&&tt(i,r)}else if(I(e))tt(i,e.bind(s));else if(N(e))if(T(e))e.forEach(r=>Vi(r,t,s,n));else{const r=I(e.handler)?e.handler.bind(s):t[e.handler];I(r)&&tt(i,r,e)}}function ji(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:i,optionsCache:r,config:{optionMergeStrategies:o}}=e.appContext,l=r.get(t);let f;return l?f=l:!i.length&&!s&&!n?f=t:(f={},i.length&&i.forEach(d=>es(f,d,o,!0)),es(f,t,o)),N(t)&&r.set(t,f),f}function es(e,t,s,n=!1){const{mixins:i,extends:r}=t;r&&es(e,r,s,!0),i&&i.forEach(o=>es(e,o,s,!0));for(const o in t)if(!(n&&o==="expose")){const l=vo[o]||s&&s[o];e[o]=l?l(e[o],t[o]):t[o]}return e}const vo={data:On,props:Pn,emits:Pn,methods:bt,computed:bt,beforeCreate:se,created:se,beforeMount:se,mounted:se,beforeUpdate:se,updated:se,beforeDestroy:se,beforeUnmount:se,destroyed:se,unmounted:se,activated:se,deactivated:se,errorCaptured:se,serverPrefetch:se,components:bt,directives:bt,watch:wo,provide:On,inject:So};function On(e,t){return t?e?function(){return Z(I(e)?e.call(this,this):e,I(t)?t.call(this,this):t)}:t:e}function So(e,t){return bt(Ks(e),Ks(t))}function Ks(e){if(T(e)){const t={};for(let s=0;st==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${he(t)}Modifiers`]||e[`${it(t)}Modifiers`];function Ao(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||K;let i=s;const r=t.startsWith("update:"),o=r&&To(n,t.slice(7));o&&(o.trim&&(i=s.map(a=>k(a)?a.trim():a)),o.number&&(i=i.map(us)));let l,f=n[l=ws(t)]||n[l=ws(he(t))];!f&&r&&(f=n[l=ws(it(t))]),f&&ge(f,e,6,i);const d=n[l+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,ge(d,e,6,i)}}const Oo=new WeakMap;function Hi(e,t,s=!1){const n=s?Oo:t.emitsCache,i=n.get(e);if(i!==void 0)return i;const r=e.emits;let o={},l=!1;if(!I(e)){const f=d=>{const a=Hi(d,t,!0);a&&(l=!0,Z(o,a))};!s&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}return!r&&!l?(N(e)&&n.set(e,null),null):(T(r)?r.forEach(f=>o[f]=null):Z(o,r),N(e)&&n.set(e,o),o)}function bs(e,t){return!e||!ls(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),j(e,t[0].toLowerCase()+t.slice(1))||j(e,it(t))||j(e,t))}function Mn(e){const{type:t,vnode:s,proxy:n,withProxy:i,propsOptions:[r],slots:o,attrs:l,emit:f,render:d,renderCache:a,props:p,data:v,setupState:C,ctx:D,inheritAttrs:M}=e,G=Zt(e);let W,F;try{if(s.shapeFlag&4){const O=i||n,z=O;W=Ce(d.call(z,O,a,p,C,v,D)),F=l}else{const O=t;W=Ce(O.length>1?O(p,{attrs:l,slots:o,emit:f}):O(p,null)),F=t.props?l:Po(l)}}catch(O){nt.length=0,gs(O,e,1),W=oe($e)}let H=W;if(F&&M!==!1){const O=Object.keys(F),{shapeFlag:z}=H;O.length&&z&7&&(r&&O.some(cs)&&(F=Mo(F,r)),H=ft(H,F,!1,!0))}if(s.dirs&&(H=ft(H,null,!1,!0),H.dirs=H.dirs?H.dirs.concat(s.dirs):s.dirs),s.transition){const O=ms(H.type)&&Pi(H)||H;on(O,s.transition)}return W=H,Zt(G),W}const Po=e=>{let t;for(const s in e)(s==="class"||s==="style"||ls(s))&&((t||(t={}))[s]=e[s]);return t},Mo=(e,t)=>{const s={};for(const n in e)(!cs(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function Io(e,t,s){const{props:n,children:i,component:r}=e,{props:o,children:l,patchFlag:f}=t,d=r.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&f>=0){if(f&1024)return!0;if(f&16)return n?In(n,o,d):!!o;if(f&8){const a=t.dynamicProps;for(let p=0;pObject.create($i),Ui=e=>Object.getPrototypeOf(e)===$i;function Fo(e,t,s,n=!1){const i={},r=Ki();e.propsDefaults=Object.create(null),Bi(e,t,i,r);for(const o in e.propsOptions[0])o in i||(i[o]=void 0);s?e.props=n?i:$r(i):e.type.props?e.props=i:e.props=r,e.attrs=r}function Do(e,t,s,n){const{props:i,attrs:r,vnode:{patchFlag:o}}=e,l=V(i),[f]=e.propsOptions;let d=!1;if((n||o>0)&&!(o&16)){if(o&8){const a=e.vnode.dynamicProps;for(let p=0;p{f=!0;const[v,C]=Wi(p,t,!0);Z(o,v),C&&l.push(...C)};!s&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}if(!r&&!f)return N(e)&&n.set(e,et),et;if(T(r))for(let a=0;ae==="_"||e==="_ctx"||e==="$stable",fn=e=>T(e)?e.map(Ce):[Ce(e)],jo=(e,t,s)=>{if(t._n)return t;const n=Qr((...i)=>fn(t(...i)),s);return n._c=!1,n},qi=(e,t,s)=>{const n=e._ctx;for(const i in e){if(cn(i))continue;const r=e[i];if(I(r))t[i]=jo(i,r,n);else if(r!=null){const o=fn(r);t[i]=()=>o}}},ki=(e,t)=>{const s=fn(t);e.slots.default=()=>s},Gi=(e,t,s)=>{for(const n in t)(s||!cn(n))&&(e[n]=t[n])},No=(e,t,s)=>{const n=e.slots=Ki();if(e.vnode.shapeFlag&32){const i=t._;i?(Gi(n,t,s),s&&ti(n,"_",i,!0)):qi(t,n)}else t&&ki(e,t)},Ho=(e,t,s)=>{const{vnode:n,slots:i}=e;let r=!0,o=K;if(n.shapeFlag&32){const l=t._;l?s&&l===1?r=!1:Gi(i,t,s):(r=!t.$stable,qi(t,i)),o=t}else t&&(ki(e,t),o={default:1});if(r)for(const l in i)!cn(l)&&o[l]==null&&delete i[l]},re=Bo;function Lo(e){return $o(e)}function $o(e,t){const s=as();s.__VUE__=!0;const{insert:n,remove:i,patchProp:r,createElement:o,createText:l,createComment:f,setText:d,setElementText:a,parentNode:p,nextSibling:v,setScopeId:C=Ae,insertStaticContent:D}=e,M=(c,u,h,b=null,g=null,_=null,S=void 0,x=null,y=!!u.dynamicChildren)=>{if(c===u)return;c&&!mt(c,u)&&(b=$t(c),de(c,g,_,!0),c=null),u.patchFlag===-2&&(y=!1,u.dynamicChildren=null),u.dynamicChildren&&c&&c.dynamicChildren&&c.dynamicChildren.hasOnce&&(u.dynamicChildren===et&&(u.dynamicChildren=[]),u.dynamicChildren.hasOnce=!0);const{type:m,ref:A,shapeFlag:w}=u;switch(m){case ys:G(c,u,h,b);break;case $e:W(c,u,h,b);break;case Jt:c==null&&F(u,h,b,S);break;case Re:Nt(c,u,h,b,g,_,S,x,y);break;default:w&1?z(c,u,h,b,g,_,S,x,y):w&6?Ht(c,u,h,b,g,_,S,x,y):(w&64||w&128)&&m.process(c,u,h,b,g,_,S,x,y,ht)}A!=null&&g?wt(A,c&&c.ref,_,u||c,!u):A==null&&c&&c.ref!=null&&wt(c.ref,null,_,c,!0)},G=(c,u,h,b)=>{if(c==null)n(u.el=l(u.children),h,b);else{const g=u.el=c.el;u.children!==c.children&&d(g,u.children)}},W=(c,u,h,b)=>{c==null?n(u.el=f(u.children||""),h,b):u.el=c.el},F=(c,u,h,b)=>{[c.el,c.anchor]=D(c.children,u,h,b,c.el,c.anchor)},H=({el:c,anchor:u},h,b)=>{let g;for(;c&&c!==u;)g=v(c),n(c,h,b),c=g;n(u,h,b)},O=({el:c,anchor:u})=>{let h;for(;c&&c!==u;)h=v(c),i(c),c=h;i(u)},z=(c,u,h,b,g,_,S,x,y)=>{if(u.type==="svg"?S="svg":u.type==="math"&&(S="mathml"),c==null)me(u,h,b,g,_,S,x,y);else{const m=c.el&&c.el._isVueCE?c.el:null;try{m&&m._beginPatch(),jt(c,u,g,_,S,x,y)}finally{m&&m._endPatch()}}},me=(c,u,h,b,g,_,S,x)=>{let y,m;const{props:A,shapeFlag:w,transition:E,dirs:P}=c;if(y=c.el=o(c.type,_,A&&A.is,A),w&8?a(y,c.children):w&16&&Ue(c.children,y,null,b,g,Ms(c,_),S,x),P&&Xe(c,null,b,"created"),_e(y,c,c.scopeId,S,b),A){for(const $ in A)$!=="value"&&!xt($)&&r(y,$,null,A[$],_,b);"value"in A&&r(y,"value",null,A.value,_),(m=A.onVnodeBeforeMount)&&ve(m,b,c)}P&&Xe(c,null,b,"beforeMount");const R=Ko(g,E);R&&E.beforeEnter(y),n(y,u,h),((m=A&&A.onVnodeMounted)||R||P)&&re(()=>{m&&ve(m,b,c),R&&E.enter(y),P&&Xe(c,null,b,"mounted")},g)},_e=(c,u,h,b,g)=>{if(h&&C(c,h),b)for(let _=0;_{for(let m=y;m{const x=u.el=c.el;let{patchFlag:y,dynamicChildren:m,dirs:A}=u;y|=c.patchFlag&16;const w=c.props||K,E=u.props||K;let P;if(h&&Ze(h,!1),(P=E.onVnodeBeforeUpdate)&&ve(P,h,u,c),A&&Xe(u,c,h,"beforeUpdate"),h&&Ze(h,!0),m&&(!c.dynamicChildren||c.dynamicChildren.length!==m.length)&&(y=0,S=!1,m=null),(w.innerHTML&&E.innerHTML==null||w.textContent&&E.textContent==null)&&a(x,""),m?Je(c.dynamicChildren,m,x,h,b,Ms(u,g),_):S||U(c,u,x,null,h,b,Ms(u,g),_,!1),y>0){if(y&16)at(x,w,E,h,g);else if(y&2&&w.class!==E.class&&r(x,"class",null,E.class,g),y&4&&r(x,"style",w.style,E.style,g),y&8){const R=u.dynamicProps;for(let $=0;${P&&ve(P,h,u,c),A&&Xe(u,c,h,"updated")},b)},Je=(c,u,h,b,g,_,S)=>{for(let x=0;x{if(u!==h){if(u!==K)for(const _ in u)!xt(_)&&!(_ in h)&&r(c,_,u[_],null,g,b);for(const _ in h){if(xt(_))continue;const S=h[_],x=u[_];S!==x&&_!=="value"&&r(c,_,x,S,g,b)}"value"in h&&r(c,"value",u.value,h.value,g)}},Nt=(c,u,h,b,g,_,S,x,y)=>{const m=u.el=c?c.el:l(""),A=u.anchor=c?c.anchor:l("");let{patchFlag:w,dynamicChildren:E,slotScopeIds:P}=u;P&&(x=x?x.concat(P):P),c==null?(n(m,h,b),n(A,h,b),Ue(u.children||[],h,A,g,_,S,x,y)):w>0&&w&64&&E&&c.dynamicChildren&&c.dynamicChildren.length===E.length?(Je(c.dynamicChildren,E,h,g,_,S,x),(u.key!=null||g&&u===g.subTree)&&Ji(c,u,!0)):U(c,u,h,A,g,_,S,x,y)},Ht=(c,u,h,b,g,_,S,x,y)=>{u.slotScopeIds=x,c==null?u.shapeFlag&512?g.ctx.activate(u,h,b,S,y):vs(u,h,b,g,_,S,y):un(c,u,y)},vs=(c,u,h,b,g,_,S)=>{const x=c.component=Xo(c,b,g);if(ln(c)&&(x.ctx.renderer=ht),Qo(x,!1,S),x.asyncDep){if(g&&g.registerDep(x,te,S),!c.el){const y=x.subTree=oe($e);W(null,y,u,h),c.placeholder=y.el}}else te(x,c,u,h,g,_,S)},un=(c,u,h)=>{const b=u.component=c.component;if(Io(c,u,h))if(b.asyncDep&&!b.asyncResolved){u.el=c.el,q(b,u,h);return}else b.next=u,b.update();else u.el=c.el,b.vnode=u},te=(c,u,h,b,g,_,S)=>{const x=()=>{if(c.isMounted){let{next:w,bu:E,u:P,parent:R,vnode:$}=c;{const ye=zi(c);if(ye){w&&(w.el=$.el,q(c,w,S)),ye.asyncDep.then(()=>{re(()=>{c.isUnmounted||m()},g)});return}}let L=w,J;Ze(c,!1),w?(w.el=$.el,q(c,w,S)):w=$,E&&kt(E),(J=w.props&&w.props.onVnodeBeforeUpdate)&&ve(J,R,w,$),Ze(c,!0);const Y=Mn(c),be=c.subTree;c.subTree=Y,M(be,Y,p(be.el),$t(be),c,g,_),w.el=Y.el,L===null&&Ro(c,Y.el),P&&re(P,g),(J=w.props&&w.props.onVnodeUpdated)&&re(()=>ve(J,R,w,$),g)}else{let w;const{el:E,props:P}=u,{bm:R,m:$,parent:L,root:J,type:Y}=c,be=Ct(u);Ze(c,!1),R&&kt(R),!be&&(w=P&&P.onVnodeBeforeMount)&&ve(w,L,u),Ze(c,!0);{J.ce&&J.ce._hasShadowRoot()&&J.ce._injectChildStyle(Y,c.parent?c.parent.type:void 0);const ye=c.subTree=Mn(c);M(null,ye,h,b,c,g,_),u.el=ye.el}if($&&re($,g),!be&&(w=P&&P.onVnodeMounted)){const ye=u;re(()=>ve(w,L,ye),g)}(u.shapeFlag&256||L&&Ct(L.vnode)&&L.vnode.shapeFlag&256)&&c.a&&re(c.a,g),c.isMounted=!0,u=h=b=null}};c.scope.on();const y=c.effect=new oi(x);c.scope.off();const m=c.update=y.run.bind(y),A=c.job=y.runIfDirty.bind(y);A.i=c,A.id=c.uid,y.scheduler=()=>nn(A),Ze(c,!0),m()},q=(c,u,h)=>{u.component=c;const b=c.vnode.props;c.vnode=u,c.next=null,Do(c,u.props,b,h),Ho(c,u.children,h),He(),wn(c),Le()},U=(c,u,h,b,g,_,S,x,y=!1)=>{const m=c&&c.children,A=c?c.shapeFlag:0,w=u.children,{patchFlag:E,shapeFlag:P}=u;if(E>0){if(E&128){Lt(m,w,h,b,g,_,S,x,y);return}else if(E&256){ze(m,w,h,b,g,_,S,x,y);return}}P&8?(A&16&&dt(m,g,_),w!==m&&a(h,w)):A&16?P&16?Lt(m,w,h,b,g,_,S,x,y):dt(m,g,_,!0):(A&8&&a(h,""),P&16&&Ue(w,h,b,g,_,S,x,y))},ze=(c,u,h,b,g,_,S,x,y)=>{c=c||et,u=u||et;const m=c.length,A=u.length,w=Math.min(m,A);let E;for(E=0;EA?dt(c,g,_,!0,!1,w):Ue(u,h,b,g,_,S,x,y,w)},Lt=(c,u,h,b,g,_,S,x,y)=>{let m=0;const A=u.length;let w=c.length-1,E=A-1;for(;m<=w&&m<=E;){const P=c[m],R=u[m]=y?Fe(u[m]):Ce(u[m]);if(mt(P,R))M(P,R,h,null,g,_,S,x,y);else break;m++}for(;m<=w&&m<=E;){const P=c[w],R=u[E]=y?Fe(u[E]):Ce(u[E]);if(mt(P,R))M(P,R,h,null,g,_,S,x,y);else break;w--,E--}if(m>w){if(m<=E){const P=E+1,R=PE)for(;m<=w;)de(c[m],g,_,!0),m++;else{const P=m,R=m,$=new Map;for(m=R;m<=E;m++){const le=u[m]=y?Fe(u[m]):Ce(u[m]);le.key!=null&&$.set(le.key,m)}let L,J=0;const Y=E-R+1;let be=!1,ye=0;const pt=new Array(Y);for(m=0;m=Y){de(le,g,_,!0);continue}let xe;if(le.key!=null)xe=$.get(le.key);else for(L=R;L<=E;L++)if(pt[L-R]===0&&mt(le,u[L])){xe=L;break}xe===void 0?de(le,g,_,!0):(pt[xe-R]=m+1,xe>=ye?ye=xe:be=!0,M(le,u[xe],h,null,g,_,S,x,y),J++)}const hn=be?Uo(pt):et;for(L=hn.length-1,m=Y-1;m>=0;m--){const le=R+m,xe=u[le],pn=u[le+1],gn=le+1{const{el:_,type:S,transition:x,children:y,shapeFlag:m}=c;if(m&6){Ye(c.component.subTree,u,h,b);return}if(m&128){c.suspense.move(u,h,b);return}if(m&64){S.move(c,u,h,ht);return}if(S===Re){n(_,u,h);for(let w=0;wx.enter(_),g));else{const{leave:w,delayLeave:E,afterLeave:P}=x,R=()=>{c.ctx.isUnmounted?i(_):n(_,u,h)},$=()=>{const L=_._isLeaving||!!_[Os];_._isLeaving&&_[Os](!0),x.persisted&&!L?R():w(_,()=>{R(),P&&P()})};E?E(_,R,$):$()}else n(_,u,h)},de=(c,u,h,b=!1,g=!1)=>{const{type:_,props:S,ref:x,children:y,dynamicChildren:m,shapeFlag:A,patchFlag:w,dirs:E,cacheIndex:P,memo:R}=c;if((w===-2||m&&m.hasOnce)&&(g=!1),x!=null&&(He(),wt(x,null,h,c,!0),Le()),P!=null&&(!c.ctx||c.ctx===u)&&(u.renderCache[P]=void 0),A&256){u.ctx.deactivate(c);return}const $=A&1&&E,L=!Ct(c);let J;if(L&&(J=S&&S.onVnodeBeforeUnmount)&&ve(J,u,c),A&6)cr(c.component,h,b);else{if(A&128){c.suspense.unmount(h,b);return}$&&Xe(c,null,u,"beforeUnmount"),A&64?c.type.remove(c,u,h,ht,b):m&&!m.hasOnce&&(_!==Re||w>0&&w&64)?dt(m,u,h,!1,!0):(_===Re&&w&384||!g&&A&16)&&dt(y,u,h),b&&an(c)}const Y=R!=null&&P==null;(L&&(J=S&&S.onVnodeUnmounted)||$||Y)&&re(()=>{J&&ve(J,u,c),$&&Xe(c,null,u,"unmounted"),Y&&(c.el=null)},h)},an=c=>{const{type:u,el:h,anchor:b,transition:g}=c;if(u===Re){lr(h,b);return}if(u===Jt){O(c),g&&!g.persisted&&g.afterLeave&&g.afterLeave();return}const _=()=>{i(h),g&&!g.persisted&&g.afterLeave&&g.afterLeave()};if(c.shapeFlag&1&&g&&!g.persisted){const{leave:S,delayLeave:x}=g,y=()=>S(h,_);x?x(c.el,_,y):y()}else _()},lr=(c,u)=>{let h;for(;c!==u;)h=v(c),i(c),c=h;i(u)},cr=(c,u,h)=>{const{bum:b,scope:g,job:_,subTree:S,um:x,m:y,a:m}=c;Fn(y),Fn(m),b&&kt(b),g.stop(),_?(_.flags|=8,de(S,c,u,h)):c.vnode.el&&S&&(S.transition=c.vnode.transition,de(S,c,u,h)),x&&re(x,u),re(()=>{c.isUnmounted=!0},u)},dt=(c,u,h,b=!1,g=!1,_=0)=>{for(let S=_;S{if(c.shapeFlag&6)return $t(c.component.subTree);if(c.shapeFlag&128)return c.suspense.next();const u=v(c.anchor||c.el),h=u&&u[io];return h?v(h):u};let Ss=!1;const dn=(c,u,h)=>{let b;c==null?u._vnode&&(de(u._vnode,null,null,!0),b=u._vnode.component):M(u._vnode||null,c,u,null,null,null,h),u._vnode=c,Ss||(Ss=!0,wn(b),Ei(),Ss=!1)},ht={p:M,um:de,m:Ye,r:an,mt:vs,mc:Ue,pc:U,pbc:Je,n:$t,o:e};return{render:dn,hydrate:void 0,createApp:Eo(dn)}}function Ms({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function Ze({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Ko(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ji(e,t,s=!1){const n=e.children,i=t.children;if(T(n)&&T(i))for(let r=0;r>1,e[s[l]]0&&(t[n]=s[r-1]),s[r]=n)}}for(r=s.length,o=s[r-1];r-- >0;)s[r]=o,o=t[o];return s}function zi(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:zi(t)}function Fn(e){if(e)for(let t=0;te.__isSuspense;function Bo(e,t){t&&t.pendingBranch?T(e)?t.effects.push(...e):t.effects.push(e):Zr(e)}const Re=Symbol.for("v-fgt"),ys=Symbol.for("v-txt"),$e=Symbol.for("v-cmt"),Jt=Symbol.for("v-stc"),nt=[];let ce=null;function Bs(e=!1){nt.push(ce=e?null:[])}function Zi(){nt.pop(),ce=nt[nt.length-1]||null}let Pt=1;function ts(e,t=!1){Pt+=e,e<0&&ce&&t&&(ce.hasOnce=!0)}function Qi(e){return e.dynamicChildren=Pt>0?ce||et:null,Zi(),Pt>0&&ce&&ce.push(e),e}function Dn(e,t,s,n,i,r){return Qi(ns(e,t,s,n,i,r,!0))}function Wo(e,t,s,n,i){return Qi(oe(e,t,s,n,i,!0))}function ss(e){return e?e.__v_isVNode===!0:!1}function mt(e,t){return e.type===t.type&&e.key===t.key}const er=({key:e})=>e!=null?e:null,zt=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?k(e)||ee(e)||I(e)?{i:fe,r:e,k:t,f:!!s}:e:null);function ns(e,t=null,s=null,n=0,i=null,r=e===Re?0:1,o=!1,l=!1){const f={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&er(t),ref:t&&zt(t),scopeId:Ai,slotScopeIds:null,children:s,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:n,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:fe};return l?(is(f,s),r&128&&e.normalize(f)):s&&(f.shapeFlag|=k(s)?8:16),Pt>0&&!o&&ce&&(f.patchFlag>0||r&6)&&f.patchFlag!==32&&ce.push(f),f}const oe=qo;function qo(e,t=null,s=null,n=0,i=null,r=!1){if((!e||e===_o)&&(e=$e),ss(e)){const l=ft(e,t,!0);return s&&is(l,s),Pt>0&&!r&&ce&&(l.shapeFlag&6?ce[ce.indexOf(e)]=l:ce.push(l)),l.patchFlag=-2,l}if(nl(e)&&(e=e.__vccOpts),t){t=ko(t);let{class:l,style:f}=t;l&&!k(l)&&(t.class=Js(l)),N(f)&&(sn(f)&&!T(f)&&(f=Z({},f)),t.style=ds(f))}const o=k(e)?1:Xi(e)?128:ms(e)?64:N(e)?4:I(e)?2:0;return ns(e,t,s,n,i,o,r,!0)}function ko(e){return e?sn(e)||Ui(e)?Z({},e):e:null}function ft(e,t,s=!1,n=!1){const{props:i,ref:r,patchFlag:o,children:l,transition:f}=e,d=t?Jo(i||{},t):i,a={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&er(d),ref:t&&t.ref?s&&r?T(r)?r.concat(zt(t)):[r,zt(t)]:zt(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!==Re?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:f,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ft(e.ssContent),ssFallback:e.ssFallback&&ft(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return f&&n&&on(a,f.clone(a)),a}function tr(e=" ",t=0){return oe(ys,null,e,t)}function kl(e,t){const s=oe(Jt,null,e);return s.staticCount=t,s}function Go(e="",t=!1){return t?(Bs(),Wo($e,null,e)):oe($e,null,e)}function Ce(e){return e==null||typeof e=="boolean"?oe($e):T(e)?oe(Re,null,e.slice()):ss(e)?Fe(e):oe(ys,null,String(e))}function Fe(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ft(e)}function is(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(T(t))s=16;else if(typeof t=="object")if(n&65){const i=t.default;i&&(i._c&&(i._d=!1),is(e,i()),i._c&&(i._d=!0));return}else{s=32;const i=t._;!i&&!Ui(t)?t._ctx=fe:i===3&&fe&&(fe.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(I(t)){if(n&65){is(e,{default:t});return}t={default:t,_ctx:fe},s=32}else t=String(t),n&64?(s=16,t=[tr(t)]):s=8;e.children=t,e.shapeFlag|=s}function Jo(...e){const t={};for(let s=0;sie||fe;let rs,Mt;{const e=as(),t=(s,n)=>{let i;return(i=e[s])||(i=e[s]=[]),i.push(n),r=>{i.length>1?i.forEach(o=>o(r)):i[0](r)}};rs=t("__VUE_INSTANCE_SETTERS__",s=>ie=s),Mt=t("__VUE_SSR_SETTERS__",s=>It=s)}const Vt=e=>{const t=ie;return rs(e),e.scope.on(),()=>{e.scope.off(),rs(t)}},Vn=()=>{ie&&ie.scope.off(),rs(null)};function sr(e){return e.vnode.shapeFlag&4}let It=!1;function Qo(e,t=!1,s=!1){t&&Mt(t);const{props:n,children:i}=e.vnode,r=sr(e);Fo(e,n,r,t),No(e,i,s||t);const o=r?el(e,t):void 0;return t&&Mt(!1),o}function el(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,bo);const{setup:n}=s;if(n){He();const i=e.setupContext=n.length>1?sl(e):null,r=Vt(e),o=Dt(n,e,0,[e.props,i]),l=Xn(o);if(Le(),r(),(l||e.sp)&&!Ct(e)&&Mi(e),l){if(o.then(Vn,Vn),t)return o.then(f=>{Mt(!0);try{jn(e,f,t)}finally{Mt(!1)}}).catch(f=>{gs(f,e,0)});e.asyncDep=o}else jn(e,o)}else nr(e)}function jn(e,t,s){I(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:N(t)&&(e.setupState=vi(t)),nr(e)}function nr(e,t,s){const n=e.type;e.render||(e.render=n.render||Ae);{const i=Vt(e);He();try{yo(e)}finally{Le(),i()}}}const tl={get(e,t){return Q(e,"get",""),e[t]}};function sl(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,tl),slots:e.slots,emit:e.emit,expose:t}}function xs(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(vi(Kr(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in Et)return Et[s](e)},has(t,s){return s in t||s in Et}})):e.proxy}function nl(e){return I(e)&&"__vccOpts"in e}const il=(e,t)=>Gr(e,t,It);function Gl(e,t,s){try{ts(-1);const n=arguments.length;return n===2?N(t)&&!T(t)?ss(t)?oe(e,null,[t]):oe(e,t):oe(e,null,t):(n>3?s=Array.prototype.slice.call(arguments,2):n===3&&ss(s)&&(s=[s]),oe(e,t,s))}finally{ts(1)}}const rl="3.5.43";let Ws;const Nn=typeof window!="undefined"&&window.trustedTypes;if(Nn)try{Ws=Nn.createPolicy("vue",{createHTML:e=>e})}catch(e){}const ir=Ws?e=>Ws.createHTML(e):e=>e,ol="http://www.w3.org/2000/svg",ll="http://www.w3.org/1998/Math/MathML",Ie=typeof document!="undefined"?document:null,Hn=Ie&&Ie.createElement("template"),cl={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const i=t==="svg"?Ie.createElementNS(ol,e):t==="mathml"?Ie.createElementNS(ll,e):s?Ie.createElement(e,{is:s}):Ie.createElement(e);return e==="select"&&n&&n.multiple!=null&&i.setAttribute("multiple",n.multiple),i},createText:e=>Ie.createTextNode(e),createComment:e=>Ie.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ie.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,i,r){const o=s?s.previousSibling:t.lastChild;if(i&&(i===r||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),s),!(i===r||!(i=i.nextSibling)););else{Hn.innerHTML=ir(n==="svg"?`${e}`:n==="mathml"?`${e}`:e);const l=Hn.content;if(n==="svg"||n==="mathml"){const f=l.firstChild;for(;f.firstChild;)l.appendChild(f.firstChild);l.removeChild(f)}t.insertBefore(l,s)}return[o?o.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},fl=Symbol("_vtc");function ul(e,t,s){const n=e[fl];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const os=Symbol("_vod"),rr=Symbol("_vsh"),Jl={name:"show",beforeMount(e,{value:t},{transition:s}){e[os]=e.style.display==="none"?"":e.style.display,s&&t?s.beforeEnter(e):_t(e,t)},mounted(e,{value:t},{transition:s}){s&&t&&s.enter(e)},updated(e,{value:t,oldValue:s},{transition:n}){!t!=!s&&(n?t?(n.beforeEnter(e),_t(e,!0),n.enter(e)):n.leave(e,()=>{_t(e,!1)}):_t(e,t))},beforeUnmount(e,{value:t}){_t(e,t)}};function _t(e,t){e.style.display=t?e[os]:"none",e[rr]=!t}const al=Symbol(""),dl=/(?:^|;)\s*display\s*:/;function hl(e,t,s){const n=e.style,i=k(s);let r=!1;if(s&&!i){if(t)if(k(t))for(const o of t.split(";")){const l=o.slice(0,o.indexOf(":")).trim();s[l]==null&&yt(n,l,"")}else for(const o in t)s[o]==null&&yt(n,o,"");for(const o in s){o==="display"&&(r=!0);const l=s[o];l!=null?gl(e,o,!k(t)&&t?t[o]:void 0,l)||yt(n,o,l):yt(n,o,"")}}else if(i){if(t!==s){const o=n[al];o&&(s+=";"+o),n.cssText=s,r=dl.test(s)}}else t&&e.removeAttribute("style");os in e&&(e[os]=r?n.display:"",e[rr]&&(n.display="none"))}const Wt=/\s*!important$/;function yt(e,t,s){if(T(s))s.forEach(n=>yt(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))Wt.test(s)?e.setProperty(t,s.replace(Wt,""),"important"):e.setProperty(t,s);else{const n=pl(e,t);Wt.test(s)?e.setProperty(it(n),s.replace(Wt,""),"important"):e[n]=s}}const Ln=["Webkit","Moz","ms"],Is={};function pl(e,t){const s=Is[t];if(s)return s;let n=he(t);if(n!=="filter"&&n in e)return Is[t]=n;n=ei(n);for(let i=0;iRs||(vl.then(()=>Rs=0),Rs=Date.now());function wl(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;const i=s.value;if(T(i)){const r=n.stopImmediatePropagation;n.stopImmediatePropagation=()=>{r.call(n),n._stopped=!0};const o=i.slice(),l=[n];for(let f=0;fe.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Cl=(e,t,s,n,i,r)=>{const o=i==="svg";t==="class"?ul(e,n,o):t==="style"?hl(e,s,n):ls(t)?cs(t)||_l(e,t,s,n,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):El(e,t,n,o))?(Un(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Kn(e,t,n,o,r,t!=="value")):e._isVueCE&&(Tl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!k(n)))?Un(e,he(t),n,r,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),Kn(e,t,n,o))};function El(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&Wn(t)&&I(s));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 i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Wn(t)&&k(s)?!1:t in e}function Tl(e,t){const s=e._def.props;if(!s)return!1;const n=he(t);return Array.isArray(s)?s.some(i=>he(i)===n):Object.keys(s).some(i=>he(i)===n)}const ut=e=>{const t=e.props["onUpdate:modelValue"]||!1;return T(t)?s=>kt(t,s):t};function Al(e){e.target.composing=!0}function qn(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Te=Symbol("_assign"),qt=Symbol("_initialValue");function Fs(e,t,s){return t&&(e=e.trim()),s&&(e=us(e)),e}const zl={created(e,{modifiers:{lazy:t,trim:s,number:n}},i){e.parentNode&&(e.type==="text"?e[qt]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[qt]=e.defaultValue.replace(/\r\n?/g,` -`))),e[Te]=ut(i);const r=n||i.props&&i.props.type==="number";We(e,t?"change":"input",o=>{o.target.composing||e[Te](Fs(e.value,s,r))}),(s||r)&&We(e,"change",()=>{e.value=Fs(e.value,s,r)}),t||(We(e,"compositionstart",Al),We(e,"compositionend",qn),We(e,"change",qn))},mounted(e,{value:t,modifiers:{trim:s,number:n}}){const i=t==null?"":t,r=e[qt];delete e[qt],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[Te](Fs(e.value,s,n)):e.value=i},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:i,number:r}},o){if(e[Te]=ut(o),e.composing)return;const l=(r||e.type==="number")&&!/^0\d/.test(e.value)?us(e.value):e.value,f=t==null?"":t;if(l===f)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(n&&t===s||i&&e.value.trim()===f)||(e.value=f)}},Yl={deep:!0,created(e,t,s){e[Te]=ut(s),We(e,"change",()=>{const n=e._modelValue,i=Rt(e),r=e.checked,o=e[Te];if(T(n)){const l=zs(n,i),f=l!==-1;if(r&&!f)o(n.concat(i));else if(!r&&f){const d=[...n];d.splice(l,1),o(d)}}else if(je(n)){const l=new Set(n);r?l.add(i):l.delete(i),o(l)}else o(or(e,r))})},mounted:kn,beforeUpdate(e,t,s){e[Te]=ut(s),kn(e,t,s)}};function kn(e,{value:t,oldValue:s},n){e._modelValue=t;let i;if(T(t))i=zs(t,n.props.value)>-1;else if(je(t))i=t.has(n.props.value);else{if(t===s)return;i=Ne(t,or(e,!0))}e.checked!==i&&(e.checked=i)}const Xl={deep:!0,created(e,{value:t,modifiers:{number:s}},n){e._modelValue=t,We(e,"change",()=>{const i=Array.prototype.filter.call(e.options,f=>f.selected).map(f=>s?us(Rt(f)):Rt(f)),r=e.multiple,o=r?je(e._modelValue)?new Set(i):i:i[0],l=e._pendingValue=[r,r?T(o)?i.slice():i:o];try{e[Te](o)}finally{wi(()=>{e._pendingValue===l&&(e._pendingValue=void 0)})}}),e[Te]=ut(n)},mounted(e,{value:t}){Gn(e,t)},beforeUpdate(e,{value:t},s){e._modelValue=t,e[Te]=ut(s)},updated(e,{value:t}){const s=e._pendingValue;e._pendingValue=void 0,(!s||s[0]!==e.multiple||!Ol(t,s[1],s[0]))&&Gn(e,t)}};function Ol(e,t,s){if(!s||T(e))return Ne(e,t);if(je(e)){if(e.size!==t.length)return!1;for(const n of t)if(!e.has(n))return!1;return!0}return!1}function Gn(e,t){const s=e.multiple,n=T(t);if(!(s&&!n&&!je(t))){for(let i=0,r=e.options.length;iString(d)===String(l)):o.selected=zs(t,l)>-1}else o.selected=t.has(l);else if(Ne(Rt(o),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Rt(e){return"_value"in e?e._value:e.value}function or(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const Pl=["ctrl","shift","alt","meta"],Ml={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)=>Pl.some(s=>e[`${s}Key`]&&!t.includes(s))},Zl=(e,t)=>{if(!e)return e;const s=e._withMods||(e._withMods={}),n=t.join(".");return s[n]||(s[n]=((i,...r)=>{for(let o=0;o{const t=Rl().createApp(...e),{mount:s}=t;return t.mount=n=>{const i=Dl(n);if(!i)return;const r=t._component;!I(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=s(i,!1,Fl(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},t});function Fl(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Dl(e){return k(e)?document.querySelector(e):e}const Vl="modulepreload",jl=function(e){return"/ui/"+e},zn={},Nl=function(t,s,n){let i=Promise.resolve();if(s&&s.length>0){let f=function(d){return Promise.all(d.map(a=>Promise.resolve(a).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=f(s.map(d=>{if(d=jl(d),d in zn)return;zn[d]=!0;const a=d.endsWith(".css"),p=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const v=document.createElement("link");if(v.rel=a?"stylesheet":Vl,a||(v.as="script"),v.crossOrigin="",v.href=d,l&&v.setAttribute("nonce",l),document.head.appendChild(v),a)return new Promise((C,D)=>{v.addEventListener("load",C),v.addEventListener("error",()=>D(new Error(`Unable to preload CSS for ${d}`)))})}))}function r(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&r(l.reason);return t().catch(r)})},Hl={class:"family-map-status",role:"status"},ec={__name:"FamilyMap",props:{items:{type:Array,default:()=>[]},track:{type:Array,default:()=>[]},selected:{type:String,default:""},height:{type:Number,default:380},night:Boolean},emits:["select"],setup(e,{emit:t}){const s=e,n=t,i=Sn(),r=Sn("正在加载内置地图…");let o,l,f=0;async function d(){const a=++f;o==null||o.destroy(),r.value="正在加载内置地图…";try{const{createFamilyMap:p}=await Nl(async()=>{const{createFamilyMap:v}=await import("./controller-Je5cOZA3.js");return{createFamilyMap:v}},__vite__mapDeps([0,1]));if(a!==f)return;o=p(i.value,{night:s.night||["night","dark"].includes(document.documentElement.dataset.theme),onStatus:v=>r.value=v,onSelect:v=>n("select",v)}),o.setItems(s.items),o.setTrack(s.track)}catch(p){a===f&&(r.value="地图组件未能加载,请重试")}}return Ri(()=>{d(),l=new MutationObserver(()=>o==null?void 0:o.setNight(s.night||["night","dark"].includes(document.documentElement.dataset.theme))),l.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}),tt(()=>s.items,a=>o==null?void 0:o.setItems(a),{deep:!0}),tt(()=>s.track,a=>o==null?void 0:o.setTrack(a),{deep:!0}),tt(()=>s.selected,a=>a?o==null?void 0:o.focus(a):o==null?void 0:o.fit()),tt(()=>s.night,a=>o==null?void 0:o.setNight(a)),Fi(()=>{f++,l==null||l.disconnect(),o==null||o.destroy()}),(a,p)=>(Bs(),Dn("div",null,[ns("div",{ref_key:"canvas",ref:i,class:"family-map-canvas",style:ds({height:e.height+"px"}),"aria-label":"家人位置地图,可拖动缩放"},null,4),ns("p",Hl,[tr(ii(r.value)+" ",1),/未能|无法|未就绪/.test(r.value)?(Bs(),Dn("button",{key:0,class:"btn btn-sm btn-outline-secondary",onClick:d},"重试地图")):Go("",!0)])]))}};export{Jo as A,ec as B,Wl as C,Kr as D,Kl as E,Re as F,Gl as G,Bl as H,wi as I,Zo as J,Ql as K,Nl as _,ns as a,kl as b,Dn as c,oe as d,tr as e,Ri as f,Fi as g,Go as h,Wo as i,ql as j,Js as k,il as l,Ul as m,ds as n,Bs as o,Jl as p,Xl as q,Sn as r,$l as s,ii as t,Br as u,zl as v,tt as w,Yl as x,Zl as y,Di as z}; +`))),e[Te]=ut(i);const r=n||i.props&&i.props.type==="number";We(e,t?"change":"input",o=>{o.target.composing||e[Te](Fs(e.value,s,r))}),(s||r)&&We(e,"change",()=>{e.value=Fs(e.value,s,r)}),t||(We(e,"compositionstart",Al),We(e,"compositionend",qn),We(e,"change",qn))},mounted(e,{value:t,modifiers:{trim:s,number:n}}){const i=t==null?"":t,r=e[qt];delete e[qt],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[Te](Fs(e.value,s,n)):e.value=i},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:i,number:r}},o){if(e[Te]=ut(o),e.composing)return;const l=(r||e.type==="number")&&!/^0\d/.test(e.value)?us(e.value):e.value,f=t==null?"":t;if(l===f)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(n&&t===s||i&&e.value.trim()===f)||(e.value=f)}},Yl={deep:!0,created(e,t,s){e[Te]=ut(s),We(e,"change",()=>{const n=e._modelValue,i=Rt(e),r=e.checked,o=e[Te];if(T(n)){const l=zs(n,i),f=l!==-1;if(r&&!f)o(n.concat(i));else if(!r&&f){const d=[...n];d.splice(l,1),o(d)}}else if(je(n)){const l=new Set(n);r?l.add(i):l.delete(i),o(l)}else o(or(e,r))})},mounted:kn,beforeUpdate(e,t,s){e[Te]=ut(s),kn(e,t,s)}};function kn(e,{value:t,oldValue:s},n){e._modelValue=t;let i;if(T(t))i=zs(t,n.props.value)>-1;else if(je(t))i=t.has(n.props.value);else{if(t===s)return;i=Ne(t,or(e,!0))}e.checked!==i&&(e.checked=i)}const Xl={deep:!0,created(e,{value:t,modifiers:{number:s}},n){e._modelValue=t,We(e,"change",()=>{const i=Array.prototype.filter.call(e.options,f=>f.selected).map(f=>s?us(Rt(f)):Rt(f)),r=e.multiple,o=r?je(e._modelValue)?new Set(i):i:i[0],l=e._pendingValue=[r,r?T(o)?i.slice():i:o];try{e[Te](o)}finally{wi(()=>{e._pendingValue===l&&(e._pendingValue=void 0)})}}),e[Te]=ut(n)},mounted(e,{value:t}){Gn(e,t)},beforeUpdate(e,{value:t},s){e._modelValue=t,e[Te]=ut(s)},updated(e,{value:t}){const s=e._pendingValue;e._pendingValue=void 0,(!s||s[0]!==e.multiple||!Ol(t,s[1],s[0]))&&Gn(e,t)}};function Ol(e,t,s){if(!s||T(e))return Ne(e,t);if(je(e)){if(e.size!==t.length)return!1;for(const n of t)if(!e.has(n))return!1;return!0}return!1}function Gn(e,t){const s=e.multiple,n=T(t);if(!(s&&!n&&!je(t))){for(let i=0,r=e.options.length;iString(d)===String(l)):o.selected=zs(t,l)>-1}else o.selected=t.has(l);else if(Ne(Rt(o),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Rt(e){return"_value"in e?e._value:e.value}function or(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const Pl=["ctrl","shift","alt","meta"],Ml={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)=>Pl.some(s=>e[`${s}Key`]&&!t.includes(s))},Zl=(e,t)=>{if(!e)return e;const s=e._withMods||(e._withMods={}),n=t.join(".");return s[n]||(s[n]=((i,...r)=>{for(let o=0;o{const t=Rl().createApp(...e),{mount:s}=t;return t.mount=n=>{const i=Dl(n);if(!i)return;const r=t._component;!I(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=s(i,!1,Fl(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},t});function Fl(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Dl(e){return k(e)?document.querySelector(e):e}const Vl="modulepreload",jl=function(e){return"/ui/"+e},zn={},Nl=function(t,s,n){let i=Promise.resolve();if(s&&s.length>0){let f=function(d){return Promise.all(d.map(a=>Promise.resolve(a).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=f(s.map(d=>{if(d=jl(d),d in zn)return;zn[d]=!0;const a=d.endsWith(".css"),p=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const v=document.createElement("link");if(v.rel=a?"stylesheet":Vl,a||(v.as="script"),v.crossOrigin="",v.href=d,l&&v.setAttribute("nonce",l),document.head.appendChild(v),a)return new Promise((C,D)=>{v.addEventListener("load",C),v.addEventListener("error",()=>D(new Error(`Unable to preload CSS for ${d}`)))})}))}function r(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&r(l.reason);return t().catch(r)})},Hl={class:"family-map-status",role:"status"},ec={__name:"FamilyMap",props:{items:{type:Array,default:()=>[]},track:{type:Array,default:()=>[]},selected:{type:String,default:""},height:{type:Number,default:380},night:Boolean},emits:["select"],setup(e,{emit:t}){const s=e,n=t,i=Sn(),r=Sn("正在加载内置地图…");let o,l,f=0;async function d(){const a=++f;o==null||o.destroy(),r.value="正在加载内置地图…";try{const{createFamilyMap:p}=await Nl(async()=>{const{createFamilyMap:v}=await import("./controller-NWgljfVQ.js");return{createFamilyMap:v}},__vite__mapDeps([0,1]));if(a!==f)return;o=p(i.value,{night:s.night||["night","dark"].includes(document.documentElement.dataset.theme),onStatus:v=>r.value=v,onSelect:v=>n("select",v)}),o.setItems(s.items),o.setTrack(s.track)}catch(p){a===f&&(r.value="地图组件未能加载,请重试")}}return Ri(()=>{d(),l=new MutationObserver(()=>o==null?void 0:o.setNight(s.night||["night","dark"].includes(document.documentElement.dataset.theme))),l.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}),tt(()=>s.items,a=>o==null?void 0:o.setItems(a),{deep:!0}),tt(()=>s.track,a=>o==null?void 0:o.setTrack(a),{deep:!0}),tt(()=>s.selected,a=>a?o==null?void 0:o.focus(a):o==null?void 0:o.fit()),tt(()=>s.night,a=>o==null?void 0:o.setNight(a)),Fi(()=>{f++,l==null||l.disconnect(),o==null||o.destroy()}),(a,p)=>(Bs(),Dn("div",null,[ns("div",{ref_key:"canvas",ref:i,class:"family-map-canvas",style:ds({height:e.height+"px"}),"aria-label":"家人位置地图,可拖动缩放"},null,4),ns("p",Hl,[tr(ii(r.value)+" ",1),/未能|无法|未就绪/.test(r.value)?(Bs(),Dn("button",{key:0,class:"btn btn-sm btn-outline-secondary",onClick:d},"重试地图")):Go("",!0)])]))}};export{Jo as A,ec as B,Wl as C,Kr as D,Kl as E,Re as F,Gl as G,Bl as H,wi as I,Zo as J,Ql as K,Nl as _,ns as a,kl as b,Dn as c,oe as d,tr as e,Ri as f,Fi as g,Go as h,Wo as i,ql as j,Js as k,il as l,Ul as m,ds as n,Bs as o,Jl as p,Xl as q,Sn as r,$l as s,ii as t,Br as u,zl as v,tt as w,Yl as x,Zl as y,Di as z}; diff --git a/web/ui/assets/controller-CWvM1oPI.css b/web/ui/assets/controller-B0JP7gQd.css similarity index 99% rename from web/ui/assets/controller-CWvM1oPI.css rename to web/ui/assets/controller-B0JP7gQd.css index 5a593e9..78c6811 100644 --- a/web/ui/assets/controller-CWvM1oPI.css +++ b/web/ui/assets/controller-B0JP7gQd.css @@ -1 +1 @@ -.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0);-webkit-touch-callout:none}.maplibregl-canvas{position:absolute;left:0;top:0}.maplibregl-map:fullscreen{width:100%;height:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.maplibregl-ctrl-top-left{top:0;left:0}.maplibregl-ctrl-top-right{top:0;right:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{right:0;bottom:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{margin:10px 0 0 10px;float:left}.maplibregl-ctrl-top-right .maplibregl-ctrl{margin:10px 10px 0 0;float:right}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{margin:0 0 10px 10px;float:left}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 10px 10px 0;float:right}.maplibregl-ctrl-group{border-radius:4px;background:#fff}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}.maplibregl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.maplibregl-ctrl button{-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media(forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid buttontext}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}@media(hover:hover){.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}}.maplibregl-ctrl button:not(:disabled):active{background-color:#0000000d}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}}@media(forced-colors:active)and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}}@media(forced-colors:active)and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}}@media(forced-colors:active)and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-globe .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' viewBox='0 0 22 22' stroke='%23333'%3E %3Ccircle cx='11' cy='11' r='8.5'/%3E %3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E %3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517-.195 0-.461-.118-.775-.517-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11c0-2.447.331-4.64.853-6.206.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517.195 0 .461.118.775.517.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E %3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.333 1.333 0 0 1-.224-.138c.047-.038.12-.085.224-.138.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138-.047.038-.12.085-.224.138-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.33 1.33 0 0 1-.224-.138 1.33 1.33 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.33 1.33 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.465 1.465 0 0 1-.39-.272.293.293 0 0 1-.047-.064.293.293 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.33.33 0 0 1 .047.064.293.293 0 0 1-.048.064 1.435 1.435 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002-.002Zm0 .018v.002-.002Zm17.002.002v-.002.002Zm0-.018v-.002.002Z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-globe-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' viewBox='0 0 22 22' stroke='%2333b5e5'%3E %3Ccircle cx='11' cy='11' r='8.5'/%3E %3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E %3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517-.195 0-.461-.118-.775-.517-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11c0-2.447.331-4.64.853-6.206.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517.195 0 .461.118.775.517.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E %3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.333 1.333 0 0 1-.224-.138c.047-.038.12-.085.224-.138.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138-.047.038-.12.085-.224.138-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.33 1.33 0 0 1-.224-.138 1.33 1.33 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.33 1.33 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.465 1.465 0 0 1-.39-.272.293.293 0 0 1-.047-.064.293.293 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.33.33 0 0 1 .047.064.293.293 0 0 1-.048.064 1.435 1.435 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002-.002Zm0 .018v.002-.002Zm17.002.002v-.002.002Zm0-.018v-.002.002Z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='%23333'%3E %3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='%2333b5e5'%3E %3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23333'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23aaa'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e54e33'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23fff'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23999'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e54e33'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}}@media(forced-colors:active)and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23000'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23666'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media(forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}}@media(forced-colors:active)and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{padding:0 5px;background-color:#ffffff80;margin:0}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;color:#000;border-radius:12px;box-sizing:content-box}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E");background-color:#ffffff80;width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:#0000000d}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;right:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;left:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20' fill='%23fff'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E")}}@media screen and (forced-colors:active)and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:#000000bf;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;font-size:10px;white-space:nowrap;border-color:#333;border-style:none solid solid;border-width:medium 2px 2px;padding:0 5px;color:#333;box-sizing:border-box}.maplibregl-popup{position:absolute;top:0;left:0;display:flex;will-change:transform;pointer-events:none}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right,[dir=rtl] .maplibregl-popup-anchor-left{flex-direction:row-reverse}.maplibregl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-top:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-right:none;border-left-color:#fff}[dir=rtl] .maplibregl-popup-anchor-right{flex-direction:row}[dir=rtl] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-start}[dir=rtl] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-start}.maplibregl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.maplibregl-popup-close-button:hover{background-color:#0000000d}.maplibregl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:15px 10px;pointer-events:auto}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{position:absolute;top:0;left:0;will-change:transform;transition:opacity .2s}.maplibregl-marker-draggable{cursor:grab}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.maplibregl-user-location-dot:before{content:"";position:absolute;animation:maplibregl-user-location-dot-pulse 2s infinite}.maplibregl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px #00000059}@media(prefers-reduced-motion:reduce){.maplibregl-user-location-dot:before{animation:none}}@keyframes maplibregl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;width:1px;height:1px;border-radius:100%}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}.maplibregl-cooperative-gesture-screen{background:#0006;position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:#fff;padding:1rem;font-size:1.4em;line-height:1.2;opacity:0;pointer-events:none;transition:opacity 1s 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media(hover:none),(pointer:coarse){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{position:fixed!important;width:100%!important;height:100%!important;top:0!important;left:0!important;z-index:99999}.family-map-canvas{height:100%;width:100%;min-height:240px;background:#e5efea;border-radius:16px;overflow:hidden;position:relative}.family-map-pin{display:flex;align-items:center;gap:6px;border:0;background:transparent;color:#193d34;cursor:pointer;padding:4px;font-family:inherit}.family-map-pin>span{display:grid;place-items:center;width:40px;height:40px;background:#207e6e;border:3px solid white;border-radius:50%;color:#fff;font-size:17px;box-shadow:0 3px 14px #12392e40}.family-map-pin>b{background:#fffffff2;border-radius:8px;padding:5px 9px;box-shadow:0 2px 8px #12392e20;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.family-map-pin.selected>span{background:#d37f3a;outline:3px solid #e8bc72}.maplibregl-ctrl button{min-width:36px;min-height:36px}.maplibregl-ctrl-attrib a{color:#375e51}.maplibregl-canvas:focus-visible{outline:3px solid #207e6e;outline-offset:-3px}[data-theme=night] .family-map-canvas{background:#1d2d27}[data-theme=night] .family-map-pin>b{background:#243c34;color:#cad9d2}.family-map-status{font-size:.8rem;color:#627c70;margin:.4rem 0}.maplibregl-control-container{font:12px sans-serif} +.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0);-webkit-touch-callout:none}.maplibregl-canvas{position:absolute;left:0;top:0}.maplibregl-map:fullscreen{width:100%;height:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.maplibregl-ctrl-top-left{top:0;left:0}.maplibregl-ctrl-top-right{top:0;right:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{right:0;bottom:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{margin:10px 0 0 10px;float:left}.maplibregl-ctrl-top-right .maplibregl-ctrl{margin:10px 10px 0 0;float:right}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{margin:0 0 10px 10px;float:left}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 10px 10px 0;float:right}.maplibregl-ctrl-group{border-radius:4px;background:#fff}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}.maplibregl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.maplibregl-ctrl button{-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media(forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid buttontext}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}@media(hover:hover){.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}}.maplibregl-ctrl button:not(:disabled):active{background-color:#0000000d}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}}@media(forced-colors:active)and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}}@media(forced-colors:active)and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}}@media(forced-colors:active)and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-globe .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' viewBox='0 0 22 22' stroke='%23333'%3E %3Ccircle cx='11' cy='11' r='8.5'/%3E %3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E %3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517-.195 0-.461-.118-.775-.517-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11c0-2.447.331-4.64.853-6.206.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517.195 0 .461.118.775.517.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E %3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.333 1.333 0 0 1-.224-.138c.047-.038.12-.085.224-.138.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138-.047.038-.12.085-.224.138-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.33 1.33 0 0 1-.224-.138 1.33 1.33 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.33 1.33 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.465 1.465 0 0 1-.39-.272.293.293 0 0 1-.047-.064.293.293 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.33.33 0 0 1 .047.064.293.293 0 0 1-.048.064 1.435 1.435 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002-.002Zm0 .018v.002-.002Zm17.002.002v-.002.002Zm0-.018v-.002.002Z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-globe-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' viewBox='0 0 22 22' stroke='%2333b5e5'%3E %3Ccircle cx='11' cy='11' r='8.5'/%3E %3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E %3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517-.195 0-.461-.118-.775-.517-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11c0-2.447.331-4.64.853-6.206.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517.195 0 .461.118.775.517.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E %3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.333 1.333 0 0 1-.224-.138c.047-.038.12-.085.224-.138.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138-.047.038-.12.085-.224.138-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.33 1.33 0 0 1-.224-.138 1.33 1.33 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.33 1.33 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.465 1.465 0 0 1-.39-.272.293.293 0 0 1-.047-.064.293.293 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.33.33 0 0 1 .047.064.293.293 0 0 1-.048.064 1.435 1.435 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002-.002Zm0 .018v.002-.002Zm17.002.002v-.002.002Zm0-.018v-.002.002Z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='%23333'%3E %3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='%2333b5e5'%3E %3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23333'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23aaa'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e54e33'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23fff'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23999'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e54e33'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}}@media(forced-colors:active)and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23000'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23666'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media(forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}}@media(forced-colors:active)and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{padding:0 5px;background-color:#ffffff80;margin:0}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;color:#000;border-radius:12px;box-sizing:content-box}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E");background-color:#ffffff80;width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:#0000000d}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;right:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;left:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20' fill='%23fff'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E")}}@media screen and (forced-colors:active)and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:#000000bf;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;font-size:10px;white-space:nowrap;border-color:#333;border-style:none solid solid;border-width:medium 2px 2px;padding:0 5px;color:#333;box-sizing:border-box}.maplibregl-popup{position:absolute;top:0;left:0;display:flex;will-change:transform;pointer-events:none}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right,[dir=rtl] .maplibregl-popup-anchor-left{flex-direction:row-reverse}.maplibregl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-top:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-right:none;border-left-color:#fff}[dir=rtl] .maplibregl-popup-anchor-right{flex-direction:row}[dir=rtl] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-start}[dir=rtl] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-start}.maplibregl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.maplibregl-popup-close-button:hover{background-color:#0000000d}.maplibregl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:15px 10px;pointer-events:auto}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{position:absolute;top:0;left:0;will-change:transform;transition:opacity .2s}.maplibregl-marker-draggable{cursor:grab}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.maplibregl-user-location-dot:before{content:"";position:absolute;animation:maplibregl-user-location-dot-pulse 2s infinite}.maplibregl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px #00000059}@media(prefers-reduced-motion:reduce){.maplibregl-user-location-dot:before{animation:none}}@keyframes maplibregl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;width:1px;height:1px;border-radius:100%}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}.maplibregl-cooperative-gesture-screen{background:#0006;position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:#fff;padding:1rem;font-size:1.4em;line-height:1.2;opacity:0;pointer-events:none;transition:opacity 1s 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media(hover:none),(pointer:coarse){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{position:fixed!important;width:100%!important;height:100%!important;top:0!important;left:0!important;z-index:99999}.family-map-canvas{height:100%;width:100%;min-height:240px;background:#e5efea;border-radius:16px;overflow:hidden;position:relative}.family-map-pin{display:flex;align-items:center;gap:6px;border:0;background:transparent;color:#193d34;cursor:pointer;padding:4px;font-family:inherit}.family-map-pin>span{display:grid;place-items:center;width:40px;height:40px;background:#207e6e;border:3px solid white;border-radius:50%;color:#fff;font-size:17px;box-shadow:0 3px 14px #12392e40}.family-map-pin>b{background:#fffffff2;border-radius:8px;padding:5px 9px;box-shadow:0 2px 8px #12392e20;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.family-map-pin.selected>span{background:#d37f3a;outline:3px solid #e8bc72}.maplibregl-ctrl button{min-width:36px;min-height:36px}.maplibregl-ctrl-attrib a{color:#375e51}.maplibregl-canvas:focus-visible{outline:3px solid #207e6e;outline-offset:-3px}[data-theme=night] .family-map-canvas{background:#1d2d27}[data-theme=night] .family-map-pin>b{background:#243c34;color:#cad9d2}.family-map-status{font-size:.8rem;color:#627c70;margin:.4rem 0}.maplibregl-control-container{font:12px sans-serif}.family-map-pin>b{color:#193d34}[data-theme=night] .family-map-pin>b{color:#cad9d2} diff --git a/web/ui/assets/controller-Je5cOZA3.js b/web/ui/assets/controller-NWgljfVQ.js similarity index 100% rename from web/ui/assets/controller-Je5cOZA3.js rename to web/ui/assets/controller-NWgljfVQ.js diff --git a/web/ui/assets/index-C1TAw2ld.css b/web/ui/assets/index-CgbLhMOE.css similarity index 94% rename from web/ui/assets/index-C1TAw2ld.css rename to web/ui/assets/index-CgbLhMOE.css index 14b522e..923dfc9 100644 --- a/web/ui/assets/index-C1TAw2ld.css +++ b/web/ui/assets/index-CgbLhMOE.css @@ -1 +1 @@ -:root{font-family:Inter,Microsoft YaHei,system-ui,sans-serif;color:#dae4e6;background:#10191d;font-synthesis:none;--muted:#8faaaF;--line:#2b3b40;--panel:#18252b;--accent:#74d5bb}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,.button{border:1px solid transparent;background:var(--accent);color:#153b31;padding:11px 18px;border-radius:8px;font-weight:600;cursor:pointer;white-space:nowrap;text-decoration:none;font-size:14px}button:hover,.button:hover{filter:brightness(1.08)}button:disabled{opacity:.5;cursor:wait}.secondary{background:#263a40;color:#cfe7e5;border-color:#385058}.quiet{background:transparent;border-color:var(--line);color:var(--muted);padding:9px 13px;font-size:13px}input,select{background:#111e24;border:1px solid #3a4e55;color:#e3f0ef;border-radius:7px;padding:10px 11px;min-width:0;max-width:100%;outline:none}input:focus,select:focus{border-color:var(--accent)}label{font-size:13px;color:#a5bec1;display:flex;gap:8px;align-items:center}h1,h2,h3,p{margin-top:0}h1{font-size:30px;letter-spacing:1px;margin:8px 0}h2{font-size:19px;font-weight:600}h3{font-size:16px}p{line-height:1.8}small{font-weight:400}.sidebar{position:fixed;left:0;top:0;bottom:0;width:238px;background:#111e24;border-right:1px solid var(--line);padding:32px 20px;display:flex;flex-direction:column}.brand{display:flex;gap:12px;align-items:center;color:#e9f3f1;text-decoration:none;font-size:21px;font-weight:600;padding:5px 8px 40px}.brand-icon{color:var(--accent);font-size:39px}.brand small{display:block;font-size:9px;letter-spacing:1.1px;margin-top:7px;color:var(--muted)}.nav-label{color:#6b868b;font-size:11px;letter-spacing:3px;padding:14px 15px}nav{display:grid;gap:8px}nav button{text-align:left;background:transparent;color:#8fa9ae;display:flex;gap:15px;font-size:18px;padding:14px 16px}nav button span{font-size:14px}nav button.active{background:#244038;color:#9ee8d3}.side-note{margin-top:auto;padding:20px 9px;font-size:12px;color:#8ebdb1}.side-note p{color:#5e8086;font-size:11px;margin:16px 0}.dot{display:inline-block;width:7px;height:7px;background:#7bd5b5;border-radius:50%;margin-right:5px}main{margin-left:238px;padding:38px 42px 18px;max-width:1800px}header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:27px}.eyebrow{font-size:10px;letter-spacing:3px;color:#77aa9e}header p{color:var(--muted);font-size:13px;margin:0}.header-status{display:grid;justify-items:end;gap:13px;padding-top:4px;font-size:11px;color:#718f96}.badge{font-size:11px;background:#243c36;color:#8bddbd;padding:6px 10px;border-radius:5px}.badge.off{background:#372d27;color:#d7ae87}.metrics{display:grid;grid-template-columns:repeat(4,1fr);border:1px solid var(--line);background:#152329;border-radius:12px;overflow:hidden}.metrics>div{padding:21px 25px;border-right:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:10px}.metrics>div:last-child{border:0}.metrics span{font-size:12px;color:var(--muted)}.metrics strong{font-size:26px;font-weight:500}.filter-row{display:flex;gap:16px;align-items:center;margin:26px 0;color:#728c93;font-size:12px}.filter-row select{max-width:280px}.section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:28px 0 17px}.section-head h2{margin:0}.section-head small{font-size:9px;color:#637f87;letter-spacing:2px;margin-left:12px}.section-head>div{display:flex;align-items:center;gap:16px}.live-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.camera-card{border:1px solid var(--line);border-radius:11px;background:var(--panel);overflow:hidden}.camera-card .video-panel{border:0;border-radius:0;margin:0}.video-panel{position:relative;aspect-ratio:16/9;background:#070e12;overflow:hidden;border:1px solid var(--line);border-radius:10px;margin-bottom:16px}.video-panel video{width:100%;height:100%;object-fit:contain;display:block}.video-empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:13px;color:#5c7b85;font-size:13px;pointer-events:none;background:radial-gradient(ellipse at center,#142a32 0,transparent 70%)}.video-empty .lens{font-size:36px;color:#456773}.video-error{position:absolute;left:14px;right:14px;bottom:48px;background:#271d1ce6;border-radius:6px;color:#e3b7a1;padding:9px 12px;font-size:12px}.camera-meta{display:flex;justify-content:space-between;gap:12px;padding:16px 18px}.camera-meta strong{font-size:14px}.camera-meta p{color:#728f96;font-size:11px;margin:6px 0 0}.camera-meta .badge{align-self:flex-start}.camera-actions{display:flex;gap:8px;padding:0 18px 14px}.camera-actions button{font-size:11px;padding:7px 10px}.empty{grid-column:1/-1;padding:62px 20px;text-align:center;background:var(--panel);border:1px dashed #354b52;border-radius:12px;color:#819da5}.empty h3{font-size:19px;color:#c4d5d6;font-weight:500}.empty p{font-size:13px;margin-bottom:22px}.panel{padding:22px;background:var(--panel);border:1px solid var(--line);border-radius:10px;margin-bottom:18px}.playback-controls{display:flex;align-items:end;gap:15px;flex-wrap:wrap}.playback-controls label{display:grid}.playback-controls>span{font-size:12px;color:var(--muted);margin:auto 0}.timeline-head{display:flex;justify-content:space-between;font-size:12px;margin-bottom:20px}.timeline-head span{color:var(--muted)}.legend{display:inline-block;background:var(--accent);width:15px;height:6px;margin-right:7px}#timeline{width:100%;height:76px;display:block;cursor:crosshair}.time-labels{display:flex;justify-content:space-between;font-size:10px;color:#74949c}.seek-row{margin-top:22px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}.recording-list{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.recording-item{text-align:left;background:#203139;color:#bdd5d8;font-size:12px;border:1px solid var(--line);white-space:normal}.recording-item small{display:block;color:#719499;margin-top:7px}.discovery{display:flex;align-items:center;gap:14px}.discovery>div{margin-right:auto}.discovery p{font-size:12px;color:var(--muted);margin:5px 0 0}.discovery input{width:190px}.scan-chip{display:inline-flex;gap:16px;align-items:center;margin:0 12px 14px 0;padding:12px 16px;border:1px solid var(--line);border-radius:8px;font-size:13px}.scan-chip button{padding:6px 10px;font-size:11px}.table-wrap{overflow:auto}.device-table{width:100%;border-collapse:collapse;background:var(--panel);border:1px solid var(--line);font-size:13px}.device-table th{text-align:left;font-size:11px;color:#8ba9ae;font-weight:400;padding:15px}.device-table td{padding:18px 15px;border-top:1px solid var(--line)}.device-table td small{display:block;margin-top:7px;color:#75969d}.site-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.site-card{background:var(--panel);border:1px solid var(--line);padding:24px;border-radius:10px}.site-heading{display:flex;justify-content:space-between;gap:12px}.site-card h3{margin:12px 0}.site-card dl{font-size:12px}.site-card dl>div{display:flex;gap:18px;padding:7px 0}.site-card dt{color:#718d94;width:80px;flex-shrink:0}.site-card dd{margin:0;color:#b6cccf;word-break:break-word}.description{font-size:12px;color:var(--muted);line-height:1.9}.storage-grid{display:grid;grid-template-columns:1fr 1.2fr;gap:22px}.storage-grid form>label{display:grid;margin:20px 0}.storage-grid dl{font-size:13px}.storage-grid dl div{display:flex;justify-content:space-between;gap:15px;padding:15px 0;border-bottom:1px solid var(--line)}.storage-grid dt{color:var(--muted)}.storage-grid dd{margin:0}.audit-item{font-size:11px;padding:10px 0;border-top:1px solid var(--line);color:#9ab8bd}.audit-item small{display:block;color:#607f89;margin-bottom:5px}.banner{background:#493c24;border:1px solid #6b5430;color:#e1c69a;border-radius:8px;padding:13px 17px;font-size:13px;margin-bottom:22px}dialog{color:#dae4e6;background:#192a31;border:1px solid #3b555d;border-radius:15px;width:min(760px,94vw);max-height:90vh;padding:30px;box-shadow:0 25px 120px #0008}dialog::backdrop{background:#061015dd;backdrop-filter:blur(8px)}#auth-dialog{max-width:430px;padding:38px}#auth-form h2{font-size:28px;margin:18px 0 10px}#auth-form>label{display:grid;margin:22px 0}#auth-form p{color:#93afb5;font-size:13px}.dialog-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:25px}.dialog-heading h2{margin:0}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.form-grid label{display:grid;gap:8px}.form-grid .check{display:flex}.check input{accent-color:var(--accent);width:16px;height:16px}.dialog-footer{display:flex;justify-content:flex-end;margin-top:20px;padding-top:20px;border-top:1px solid var(--line)}.form-error{font-size:12px;color:#efab97;line-height:1.6}.wide{width:100%}footer{font-size:10px;color:#54727c;display:flex;justify-content:space-between;margin-top:40px;padding-top:18px;border-top:1px solid var(--line)}#toast{position:fixed;bottom:28px;left:50%;transform:translate(-50%);border:1px solid #4a7d70;background:#1a3c32;color:#b5efd9;padding:13px 22px;border-radius:9px;z-index:5;box-shadow:0 10px 30px #0005;font-size:13px}:focus-visible{outline:2px solid var(--accent);outline-offset:3px}@media(min-width:1600px){.live-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:1100px){.sidebar{width:190px;padding:25px 14px}.brand{font-size:17px}.brand-icon{font-size:30px}.brand small{font-size:8px}main{margin-left:190px;padding:25px}.metrics>div{padding:18px 14px}.metrics strong{font-size:22px}.storage-grid{grid-template-columns:1fr}.section-head small{display:none}}@media(max-width:760px){.sidebar{position:static;width:auto;padding:18px 16px 8px;border-right:0;border-bottom:1px solid var(--line)}.brand{padding:0 3px 16px}.brand small{font-size:9px}.sidebar nav{display:flex;gap:3px;overflow:auto}.sidebar nav button{padding:10px;font-size:14px;gap:6px}.sidebar nav button span{font-size:11px}.nav-label,.side-note,.sidebar #logout{display:none}main{margin:0;padding:23px 16px}h1{font-size:25px}.header-status{font-size:9px}.metrics{grid-template-columns:1fr 1fr}.metrics>div{border-bottom:1px solid var(--line)}.metrics>div:nth-child(2){border-right:0}.live-grid,.site-grid{grid-template-columns:1fr}.filter-row{flex-wrap:wrap;gap:10px}.filter-row>span{display:none}.filter-row select{max-width:200px}.section-head{align-items:start}.section-head>div{flex-wrap:wrap;justify-content:flex-end;gap:8px}.section-head button{padding:9px 11px;font-size:12px}.section-head h2{font-size:16px}.section-head label{font-size:11px}.section-head select{padding:6px}.discovery{flex-wrap:wrap}.discovery>div{width:100%}.discovery input{flex:1}.recording-list{grid-template-columns:1fr 1fr}.timeline-head{gap:10px;font-size:10px}.form-grid{gap:13px}.form-grid label{font-size:12px}dialog{padding:23px}.form-grid .full{grid-column:1/-1}.playback-controls label{flex:1}.video-empty{font-size:11px}.camera-meta{padding:14px}.seek-row label{width:100%}#auth-dialog{padding:30px}footer{font-size:9px}}.sidebar{overflow-y:auto}.sidebar .brand{padding-bottom:18px}.sidebar nav{gap:3px}.sidebar nav button{padding-top:10px;padding-bottom:10px}.sidebar .side-note{padding-bottom:0}.sidebar .side-note p{display:none}textarea{font:inherit;color:#e3f0ef;background:#111e24;border:1px solid #3a4e55;border-radius:7px;padding:10px;resize:vertical;max-width:100%}textarea:focus{outline:2px solid var(--accent)}fieldset{border:1px solid var(--line);border-radius:8px;padding:15px}legend{color:var(--muted);font-size:13px}#user-sites{display:flex;flex-wrap:wrap;gap:16px}.family-toolbar{display:flex;align-items:center;gap:16px;flex-wrap:wrap}.family-toolbar>span{margin-left:auto;font-size:12px;color:var(--muted)}.family-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:20px;align-items:start}.family-people{display:grid;gap:10px;max-height:720px;overflow:auto}.person-card{text-align:left;display:grid;gap:8px;white-space:normal;background:var(--panel);color:#dae4e6;border:1px solid var(--line);padding:18px}.person-card.selected{border-color:var(--accent);background:#234037}.person-card span{font-size:12px;color:var(--accent)}.person-card small{font-size:11px;color:var(--muted)}#family-detail .section-head{margin-top:0}#family-detail h2{margin:10px 0}.family-prose{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px}.family-link{display:flex;gap:15px;justify-content:space-between;align-items:center;padding:12px 0;border-bottom:1px solid var(--line);font-size:13px}.family-link small{display:block;color:var(--muted);margin-top:7px}.family-tree{display:grid;grid-template-columns:1fr 1fr;gap:25px;overflow:auto}.family-tree ul{padding-left:20px;list-style:none;border-left:1px solid #3f6359}.family-tree li{padding:6px 0}.family-tree button{max-width:100%;white-space:normal}.family-tree small{color:var(--muted);font-size:11px}.family-spouses{grid-column:1/-1}#family-error:empty{display:none}.family-people .empty{padding:30px 12px}.family-people .empty h3{font-size:16px}#current-user{font-size:12px;margin:12px 0}@media(max-width:900px){.family-layout{grid-template-columns:1fr}.family-people{grid-template-columns:repeat(2,minmax(0,1fr));max-height:350px}.family-tree{grid-template-columns:1fr}.family-spouses{grid-column:auto}.family-toolbar label{flex-wrap:wrap}.family-toolbar input{width:100%}}@media(max-width:760px){.sidebar #logout{display:block;align-self:flex-end}.sidebar #current-user{position:absolute;right:130px;top:15px;font-size:10px}.form-grid{grid-template-columns:1fr}.family-tree ul{padding-left:12px}}#family-detail dl{display:grid;grid-template-columns:1fr 1fr;gap:14px 28px;margin:20px 0 26px}#family-detail dl>div{display:grid;grid-template-columns:105px 1fr;gap:10px;border-bottom:1px solid var(--line);padding-bottom:10px}#family-detail dt{font-size:12px;color:var(--muted)}#family-detail dd{margin:0;font-size:13px;overflow-wrap:anywhere}@media(max-width:1000px){#family-detail dl{grid-template-columns:1fr}}.brand-icon{width:44px;height:44px;object-fit:cover;border-radius:12px;flex-shrink:0}.wall-toolbar{display:flex;align-items:center;gap:15px;flex-wrap:wrap;margin:16px 0}.wall-toolbar select{padding:8px}.wall-paging{display:flex;align-items:center;gap:9px;color:var(--muted);font-size:12px}#wall-clock{margin-left:auto;color:var(--muted);font-size:12px}.live-grid[data-layout="1"]{grid-template-columns:1fr}.live-grid[data-layout="2"],.live-grid[data-layout="4"]{grid-template-columns:repeat(2,minmax(0,1fr))}.live-grid[data-layout="6"],.live-grid[data-layout="9"]{grid-template-columns:repeat(3,minmax(0,1fr))}.live-grid[data-layout="16"]{grid-template-columns:repeat(4,minmax(0,1fr))}.wall-reorder{display:none;padding:8px 12px;align-items:center;gap:8px}.arranging .wall-reorder{display:flex}.wall-reorder span{cursor:grab;margin-right:auto;font-size:12px;color:var(--muted)}.wall-reorder button{padding:4px 9px;font-size:11px}#page-live:is(:fullscreen,.wall-expanded){background:#070f12;padding:12px;width:100vw;height:100dvh;display:flex;flex-direction:column;overflow:hidden}#page-live:is(:fullscreen,.wall-expanded)>.section-head,#page-live:is(:fullscreen,.wall-expanded)>#quality-note{display:none}#page-live:is(:fullscreen,.wall-expanded) .wall-toolbar{margin:0 0 10px;flex-shrink:0}#page-live:is(:fullscreen,.wall-expanded) .live-grid{flex:1;min-height:0;gap:8px;grid-template-rows:repeat(2,minmax(0,1fr))}#page-live:is(:fullscreen,.wall-expanded) .live-grid[data-layout="1"],#page-live:is(:fullscreen,.wall-expanded) .live-grid[data-layout="2"]{grid-template-rows:1fr}#page-live:is(:fullscreen,.wall-expanded) .live-grid[data-layout="9"]{grid-template-rows:repeat(3,minmax(0,1fr))}#page-live:is(:fullscreen,.wall-expanded) .live-grid[data-layout="16"]{grid-template-rows:repeat(4,minmax(0,1fr))}#page-live:is(:fullscreen,.wall-expanded) .camera-card{display:flex;flex-direction:column;min-height:0;position:relative}#page-live:is(:fullscreen,.wall-expanded) .video-panel{flex:1;min-height:0;aspect-ratio:auto}#page-live:is(:fullscreen,.wall-expanded) .camera-meta{padding:7px 10px;align-items:center}#page-live:is(:fullscreen,.wall-expanded) .camera-meta p,#page-live:is(:fullscreen,.wall-expanded) .camera-meta .badge{display:none}#page-live:is(:fullscreen,.wall-expanded) .camera-meta strong{font-size:12px}#page-live:is(:fullscreen,.wall-expanded) .camera-actions{position:absolute;bottom:34px;right:6px;padding:4px;background:#10191ddd;border-radius:6px;opacity:0}#page-live:is(:fullscreen,.wall-expanded) .camera-card:hover .camera-actions,#page-live:is(:fullscreen,.wall-expanded) .camera-card:focus-within .camera-actions{opacity:1}#page-live:is(:fullscreen,.wall-expanded) .camera-actions [data-edit-camera],#page-live:is(:fullscreen,.wall-expanded) .camera-actions [data-play-camera]{display:none}.ptz-panel{background:#1a3038;border:1px solid #41656c;border-radius:12px;padding:16px;display:flex;align-items:center;gap:22px;position:fixed;bottom:22px;right:22px;z-index:4;max-width:calc(100vw - 32px);box-shadow:0 12px 50px #0008}.ptz-panel p{font-size:12px;color:var(--muted);max-width:320px;margin:8px 0 0}.ptz-pad{display:grid;grid-template-columns:repeat(3,46px);grid-template-rows:repeat(3,40px);gap:4px}.ptz-pad button{padding:5px;font-size:17px}.ptz-pad [data-ptz-action=up]{grid-column:2}.ptz-pad [data-ptz-action=left]{grid-column:1;grid-row:2}.ptz-pad [data-ptz-action=stop]{grid-column:2;grid-row:2;background:#f0bda6;font-size:12px}.ptz-pad [data-ptz-action=right]{grid-column:3;grid-row:2}.ptz-pad [data-ptz-action=down]{grid-column:2;grid-row:3}.family-date{border:1px solid var(--line);border-radius:8px;padding:14px;margin:0;min-width:0}.family-date legend{font-size:13px;color:#a5bec1}.family-date label{margin-bottom:10px}.family-date output{display:block;font-size:12px;line-height:1.7;color:var(--accent)}@media(max-width:760px){.wall-toolbar{gap:9px}#wall-clock{display:none}.camera-meta strong{font-size:12px}.camera-actions{flex-wrap:wrap;padding:0 8px 8px}.camera-meta{padding:9px}.ptz-panel{flex-wrap:wrap;gap:12px}.ptz-panel>div:first-child{flex:1;min-width:160px}.family-date{grid-column:1/-1}#page-live:is(:fullscreen,.wall-expanded) .camera-actions{opacity:1}.live-grid[data-layout="16"] .camera-meta strong{font-size:9px}}#page-live:is(:fullscreen,.wall-expanded) .live-grid[data-layout=auto]{grid-template-columns:repeat(3,minmax(0,1fr))}.wall-reorder [data-wall-drag]{touch-action:none;user-select:none;padding:5px 0}.camera-card.wall-drop-target{outline:2px solid var(--accent);outline-offset:-3px}#camera-settings-dialog{width:min(1060px,94vw)}#camera-settings-info dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0 24px;padding:16px;border:1px solid var(--line);border-radius:10px}#camera-settings-info dt{font-size:12px;color:var(--muted);margin-bottom:6px}#camera-settings-info dd{font-size:13px;margin:0;overflow-wrap:anywhere}#camera-image-fields,#camera-video-fields{grid-template-columns:repeat(3,minmax(0,1fr))}#camera-settings-status:empty{display:none}#camera-settings-dialog details{margin-top:20px;color:var(--muted);font-size:13px;line-height:1.8}#page-live:is(:fullscreen,.wall-expanded) .camera-actions [data-camera-settings]{display:none}@media(max-width:700px){#camera-settings-info dl,#camera-image-fields,#camera-video-fields{grid-template-columns:1fr 1fr}}@media(max-width:420px){#camera-settings-info dl,#camera-image-fields,#camera-video-fields{grid-template-columns:1fr}}.ptz-panel{width:620px;display:grid;grid-template-columns:1fr auto;max-height:80dvh;overflow:auto;align-items:start}.ptz-panel>div:first-child{grid-column:1}.ptz-panel .ptz-pad{grid-column:2;grid-row:1/3}#ptz-presets{grid-column:1/-1;min-width:0;border-top:1px solid var(--line);padding-top:12px}#ptz-presets .section-head{margin:0;gap:10px}#ptz-presets p{max-width:none;line-height:1.6}#preset-count{color:var(--muted);font-size:12px}.preset-row{display:flex;align-items:center;gap:5px;padding:9px 0;border-bottom:1px solid var(--line);flex-wrap:wrap}.preset-row strong{font-size:13px;flex:1;overflow-wrap:anywhere}.preset-row button{padding:5px 8px;font-size:12px}#preset-form{display:flex;align-items:end;gap:10px;margin-top:12px}#preset-form label{flex:1;margin:0}#preset-name{width:100%}#preset-confirmation{padding:12px;background:#553b31;border-radius:8px;margin-top:10px}#ptz-close{justify-self:start}.playback-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0}.playback-tools .check{margin:0}.clip-editor{border-top:1px solid var(--line);padding-top:12px}.clip-editor summary{cursor:pointer;margin-bottom:14px}#snapshot-dialog{width:min(1000px,92vw)}#snapshot-image{width:100%;max-height:65vh;object-fit:contain;background:#000;border-radius:8px}#play-position{font-size:13px;color:var(--muted)}@media(max-width:600px){.ptz-panel{right:12px;bottom:12px;padding:12px;gap:12px}.ptz-panel .ptz-pad{grid-column:2}#preset-form{flex-wrap:wrap}#preset-form label{flex-basis:100%}}.settings-sections,.view-presets{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0 22px}.settings-sections button[aria-pressed=true],.view-presets button[aria-pressed=true]{background:var(--accent,#30594e);color:var(--paper,#fff);border-color:var(--accent,#30594e)}.group-custom{margin:16px 0}.group-custom summary{cursor:pointer;padding:10px 0}.device-search-row>button{align-self:end}.journal-entry.just-saved{outline:2px solid var(--accent,#30594e);outline-offset:4px;scroll-margin-block:24px}.family-workspace{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:18px;align-items:start}.family-canvas-panel{background:#17262b;border:1px solid #39504f;border-radius:14px;overflow:hidden;min-width:0}.family-map-heading{padding:22px 22px 16px;display:flex;justify-content:space-between;align-items:center;gap:14px}.family-map-heading h2{font-size:23px;margin:8px 0 0;letter-spacing:2px}.family-map-heading .eyebrow{font-size:9px}.family-view-tabs{display:flex;border:1px solid var(--line);border-radius:8px;padding:3px;flex-shrink:0}.family-view-tabs button{border:0;padding:8px 12px;border-radius:5px;font-size:12px}.family-view-tabs [aria-pressed=true]{background:#30574c;color:#b8f2df}.family-map-controls{padding:0 20px 16px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}.family-map-controls button{font-size:12px;padding:7px 10px}.family-zoom-controls{display:flex;gap:5px;align-items:center;margin-right:auto}.family-zoom-controls output{font-size:11px;min-width:38px;text-align:center;color:var(--muted)}.family-map-viewport{height:clamp(440px,65vh,740px);overflow:auto;background-color:#e8eeea;background-image:radial-gradient(#b5c5bb 1px,transparent 1px);background-size:22px 22px;position:relative;overscroll-behavior:contain;cursor:grab;scrollbar-color:#82988b #dce5de;scrollbar-width:thin;outline-offset:-3px}.family-map-viewport.panning{cursor:grabbing;user-select:none}.family-map-space{position:relative;min-width:100%;min-height:100%}.family-map-surface{position:absolute;left:0;top:0;transform-origin:0 0}.family-map-lines{position:absolute;inset:0;overflow:visible;pointer-events:none}.family-edge{fill:none;stroke:#86a299;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.family-edge.spouse{stroke:#bd9050;stroke-dasharray:5 4;stroke-width:2}.family-edge.nonbiological{stroke:#9987b4;stroke-dasharray:4 3}.family-edge.focused{stroke-width:2.6;stroke:#337b66}.family-edge.spouse.focused{stroke:#ab791e}.family-edge.nonbiological.focused{stroke:#7b55a2}.family-branch-label{position:absolute;color:#536c60;font-size:12px;letter-spacing:1px;pointer-events:none}.family-node{position:absolute;border:1px solid #c4d0c7;border-radius:12px;background:#fffef9;color:#273e33;padding:13px 15px;text-align:left;white-space:normal;box-shadow:0 4px 11px #263c3010;display:flex;flex-direction:column;gap:4px;overflow:visible;cursor:pointer;transition:box-shadow .15s,border-color .15s}.family-node:hover{filter:none;box-shadow:0 6px 20px #30583d30;border-color:#5b9179}.family-node:focus-visible{outline:3px solid #205a48;outline-offset:4px}.family-node>strong{font-size:16px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-right:30px}.family-node-top{position:absolute;right:12px;top:12px}.family-node-avatar{display:flex;width:28px;height:28px;align-items:center;justify-content:center;background:#e9f0e8;border-radius:9px;font-family:"Noto Serif SC",SimSun,serif;color:#48745c;font-size:17px}.family-node-flags{position:absolute;right:0;top:36px;display:grid;gap:4px;justify-items:end;white-space:nowrap}.family-node-flags>small{font-size:9px;color:#748375}.family-node .family-node-relation{display:block;font-size:11px;color:#577868;max-width:120px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.family-node>small{font-size:10px;color:#7a8a80;margin-top:auto}.family-node.self{background:#f6d795;border:2px solid #c49337;box-shadow:0 5px 18px #b487242e}.family-node.self .family-node-avatar{background:#fbe8bd;color:#82561f}.family-node.self>strong{color:#5d3d15}.family-node.self .family-node-relation,.family-node.self>small{color:#7d622f}.self-badge{display:inline-block;border-radius:4px;background:#996e2b;color:#fff4d7;padding:2px 5px;font-size:9px;font-weight:600;letter-spacing:.5px}.family-node.selected{outline:3px solid #3d9175;outline-offset:4px}.family-node.search-hit:after{content:"匹配";position:absolute;left:12px;top:-12px;padding:2px 6px;border-radius:4px;background:#315f8d;color:#fff;font-size:9px;box-shadow:0 2px 4px #0002}.family-node.archived{border-style:dashed}.family-map-footer{padding:15px 20px;border-top:1px solid #a4b7a41f}.family-map-legend{display:flex;gap:15px;flex-wrap:wrap;font-size:11px;color:#a5bbb4;margin-bottom:9px}.family-map-legend>span{display:flex;align-items:center;gap:6px}.family-map-legend i{display:inline-block;width:19px;height:2px;background:#86a299}.family-map-legend i.legend-self{width:11px;height:11px;background:#f6d795;border-radius:3px}.family-map-legend i.legend-selected{width:11px;height:11px;background:transparent;border:2px solid #64bc9d;border-radius:3px}.family-map-legend i.legend-spouse{background:none;border-top:2px dashed #bd9050}.family-map-legend i.legend-adoptive{background:none;border-top:2px dashed #aa98c4}.family-map-footer .description{font-size:11px;margin:0;line-height:1.8}.family-map-footer #family-map-note:not(:empty){padding:8px 0;color:#c9bc9a}.family-inspector{position:sticky;top:18px;max-height:calc(100vh - 36px);overflow:auto;margin:0;padding:20px;min-width:0;scrollbar-width:thin}.family-inspector.is-self{border-color:#b08848;background:linear-gradient(145deg,#343323,#18272a 55%)}.family-self-heading{color:#e8c780;font-size:12px;margin-bottom:18px}.family-back-to-map{display:block;margin:0 0 18px auto;font-size:11px}#family-detail .section-head{gap:12px;flex-wrap:wrap}#family-detail .section-head>div{display:block}#family-detail .section-head h2{font-size:23px;overflow-wrap:anywhere}#family-detail dl{grid-template-columns:1fr;gap:12px;margin:18px 0 24px}#family-detail dl>div{grid-template-columns:76px minmax(0,1fr);gap:9px}#family-detail h3{font-size:14px;margin-top:24px}#family-detail .family-link{align-items:flex-start;overflow-wrap:anywhere;font-size:12px}#family-detail .family-link .quiet{padding:5px 8px;font-size:11px}#family-detail .family-prose{font-size:13px}.family-register{grid-template-columns:repeat(auto-fill,minmax(180px,1fr));max-height:clamp(440px,65vh,740px);overflow:auto;padding:20px;align-content:start;background:#132226}.person-card.self{background:#463e27;border-color:#b28f50;color:#f1dca7}.person-card.self span:not(.self-badge){color:#e0c995}.person-card.self small{color:#b8a98b}.person-card.selected{outline:2px solid #63b89c;outline-offset:-2px}.family-map-viewport>.empty{border:0;background:transparent;color:#5c7567;height:100%;display:flex;flex-direction:column;justify-content:center;margin:0}.family-map-viewport>.empty h3{color:#314d3d}.family-toolbar #family-search{width:190px}.family-toolbar #family-reference{max-width:180px}.family-toolbar{gap:12px}.family-workspace:is(:fullscreen,.family-expanded){width:100vw;height:100dvh;background:#10191d;padding:16px;align-items:stretch;overflow:auto}.family-workspace:is(:fullscreen,.family-expanded) .family-canvas-panel{height:100%;display:flex;flex-direction:column}.family-workspace:is(:fullscreen,.family-expanded) .family-map-viewport{flex:1;height:auto;min-height:200px}.family-workspace:is(:fullscreen,.family-expanded) .family-register{max-height:none;flex:1}.family-workspace:is(:fullscreen,.family-expanded) .family-inspector{position:static;max-height:100%;overflow:auto}.family-workspace:is(:fullscreen,.family-expanded) .family-map-heading{padding:14px 20px}.family-workspace:is(:fullscreen,.family-expanded) .family-map-footer{padding:10px 20px}@media(max-width:1250px){.family-workspace{grid-template-columns:minmax(0,1fr) 270px}.family-map-heading{align-items:flex-start;flex-wrap:wrap}.family-map-controls{gap:6px}.family-map-controls button{padding:7px 8px}.family-inspector{padding:16px}.family-toolbar>span{margin-left:0}}@media(max-width:1000px){.family-workspace{grid-template-columns:1fr}.family-inspector{position:static;max-height:none}.family-map-viewport{height:560px}.family-register{grid-template-columns:repeat(auto-fill,minmax(180px,1fr));max-height:560px}.family-workspace:is(:fullscreen,.family-expanded){display:flex;flex-direction:column;gap:10px}.family-workspace:is(:fullscreen,.family-expanded) .family-canvas-panel{min-height:65vh;flex:1;flex-shrink:0}.family-workspace:is(:fullscreen,.family-expanded) .family-inspector{max-height:35vh;flex-shrink:0}}@media(max-width:600px){#page-family>.section-head{align-items:flex-start;flex-wrap:wrap}#page-family>.section-head>div{gap:7px;flex-wrap:wrap}#page-family>.section-head button{font-size:12px;padding:8px 10px}.family-toolbar{padding:15px}.family-toolbar label{width:100%;display:flex;justify-content:space-between;flex-wrap:nowrap}.family-toolbar label.check{justify-content:flex-start}.family-toolbar input,.family-toolbar #family-search,.family-toolbar #family-reference{width:60%;max-width:60%}.family-toolbar input[type=checkbox]{width:16px}.family-map-heading{padding:17px 15px}.family-map-heading h2{font-size:21px}.family-map-controls{padding:0 12px 14px}.family-map-footer{padding:13px 15px}.family-map-legend{gap:10px}.family-map-viewport{height:470px}.family-register{grid-template-columns:1fr 1fr;padding:12px;gap:10px}.family-register .person-card{padding:12px}.family-workspace:is(:fullscreen,.family-expanded){padding:8px}.family-map-footer>.description:last-child{font-size:10px}}.family-map-heading{flex-wrap:wrap}.family-view-tabs{max-width:100%;flex-wrap:wrap}.family-view-tabs button{font-size:11px}.family-event-intro{display:flex;justify-content:space-between;gap:15px;padding:8px 22px 12px;align-items:flex-start}.family-event-intro h3{font-size:16px;line-height:1.7;margin:0 0 7px}.family-event-intro p{margin:0}.family-event-intro button{font-size:12px;padding:9px 12px}.family-event-filters{display:flex;gap:12px;flex-wrap:wrap;padding:15px 22px;background:#101e2366;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.family-event-filters label{display:flex;font-size:12px;gap:7px;flex-wrap:wrap}.family-event-filters input:not([type=checkbox]){width:170px}.family-event-filters select{max-width:180px;font-size:12px;padding:8px}.family-event-filters .check{width:100%;font-size:11px}.family-event-filters button{font-size:11px;padding:7px 10px}.family-event-filters #family-event-state-label{margin-right:auto}#family-event-count{padding:16px 22px 0;margin-bottom:0}.family-timeline{padding:0 22px 28px;max-height:680px;overflow:auto;scrollbar-width:thin}.timeline-year{font-family:Georgia,SimSun,serif;color:#a4d6c3;font-size:27px;margin:30px 0 18px;letter-spacing:1px}.timeline-year span{font-family:inherit;font-size:12px;color:var(--muted);margin-left:8px}.timeline-event{display:flex;align-items:flex-start;gap:18px;position:relative;width:100%;background:transparent;color:inherit;text-align:left;padding:0 0 24px;border-radius:0;border:0;white-space:normal}.timeline-event:hover{filter:none}.timeline-event:before{content:"";position:absolute;left:85px;top:10px;bottom:-10px;border-left:1px solid #466659}.timeline-event:after{content:"";position:absolute;left:81px;top:6px;width:9px;height:9px;border-radius:50%;background:#7eccac;box-shadow:0 0 0 4px #1c342d}.timeline-event>time{font-size:12px;font-weight:400;color:#9bb3ae;flex:0 0 70px;margin-top:1px}.timeline-event-body{margin-left:12px;flex:1;min-width:0;border:1px solid #345248;border-radius:10px;padding:17px 19px;background:#20352f;display:flex;flex-direction:column;gap:11px}.timeline-event:hover .timeline-event-body{border-color:#71ad94;background:#264037}.timeline-event-body>strong{font-size:17px;line-height:1.6;color:#dfebe5;overflow-wrap:anywhere}.timeline-event-status{font-size:9px;color:#9fc8b7;letter-spacing:1px}.timeline-summary{font-size:12px;color:#a4beb2;line-height:1.8;font-weight:400;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-line;overflow-wrap:anywhere}.timeline-event-body>small{font-size:11px;color:#acc9b5;font-weight:400}.timeline-read{font-size:11px;color:#83d6b5;font-weight:400}.timeline-event.draft .timeline-event-body{border-style:dashed;background:#282e30}.timeline-event.draft:after{background:#aea087}.event-associated{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:22px 0}.event-associated button{font-size:12px}.event-detail-meta{display:flex;gap:15px;justify-content:space-between;align-items:flex-start;margin:20px 0;color:#97baac;font-size:12px}.event-detail-meta time{line-height:1.8}#event-detail-title{font-size:26px;line-height:1.6;overflow-wrap:anywhere}.event-lead{border-left:3px solid #8cb8a1;background:#233a32;padding:14px 18px;white-space:pre-wrap;font-size:14px;overflow-wrap:anywhere}.event-article{font-size:15px;line-height:2;margin:28px 0;color:#c9d9d1}.event-source{display:inline-block;white-space:normal;overflow-wrap:anywhere;line-height:1.7;margin:8px 0}.event-updated{border-top:1px solid var(--line);padding-top:18px;margin-top:22px}#event-person-choices{display:flex;gap:12px;flex-wrap:wrap;max-height:170px;overflow:auto;padding:14px 0}#event-person-choices label{display:flex;flex-direction:row;align-items:center}.event-editor-actions{gap:12px}.person-events{border-top:1px solid var(--line);margin-top:25px;padding-top:15px}.person-events .section-head{gap:8px}.person-events .section-head h3{margin:0!important;font-size:13px!important}.person-events .section-head small{letter-spacing:0;margin-left:4px}.person-events .section-head button{font-size:10px;padding:6px 7px}.person-event-link{display:flex;flex-direction:column;gap:6px;border:0;background:transparent;color:#c0d6c9;text-align:left;padding:10px 0;margin-bottom:8px;white-space:normal;line-height:1.7;font-size:12px}.person-event-link time{font-size:10px;color:#87a495}.family-workspace:is(:fullscreen,.family-expanded) #family-events{overflow:auto}.family-workspace:is(:fullscreen,.family-expanded) .family-timeline{max-height:none}@media(max-width:600px){.family-event-intro{flex-wrap:wrap;padding:8px 15px 15px}.family-event-filters{padding:15px;gap:10px}.family-event-filters label{font-size:11px}.family-event-filters .check{line-height:1.8;flex-wrap:nowrap}.family-timeline{padding:0 15px 22px}.timeline-event{gap:8px}.timeline-event>time{font-size:10px;flex-basis:55px}.timeline-event:before{left:62px}.timeline-event:after{left:58px}.timeline-event-body{padding:13px;margin-left:9px}.timeline-event-body>strong{font-size:15px}.family-view-tabs button{padding:8px 10px}#event-detail-title{font-size:22px}.event-detail-meta,.event-editor-actions{flex-wrap:wrap}}.family-workspace.family-expanded{position:fixed;inset:0;z-index:8}.family-map-viewport{scrollbar-gutter:stable;overflow-anchor:none}.family-map-space{min-width:0;min-height:0;overflow:clip}.family-workspace:is(:fullscreen,.family-expanded){min-height:0;grid-template-rows:minmax(0,1fr)}.family-workspace:is(:fullscreen,.family-expanded) .family-canvas-panel{min-height:0}.family-workspace:is(:fullscreen,.family-expanded) .family-map-heading,.family-workspace:is(:fullscreen,.family-expanded) .family-map-controls,.family-workspace:is(:fullscreen,.family-expanded) .family-map-footer{flex-shrink:0}.family-workspace.family-expanded{z-index:1100}@media(max-width:1000px){.family-workspace:is(:fullscreen,.family-expanded) .family-canvas-panel{min-height:65vh}}#history-dialog{width:min(1040px,94vw)}#history-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;max-height:260px;overflow:auto;margin:16px 0}.history-entry{text-align:left;display:flex;flex-direction:column;align-items:flex-start;gap:6px;white-space:normal}.history-entry small,.history-entry span{color:var(--muted);font-size:12px}.history-columns{display:grid;grid-template-columns:1fr 1fr;gap:20px}.history-columns section{min-width:0}.history-columns dd{white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;overflow:auto}.history-columns dl>div{padding:10px;border-bottom:1px solid #30434a}.history-changed{background:#27443e66;border-radius:8px}#history-confirm{padding:16px;border:1px solid #74d0b7;border-radius:12px;margin-top:18px}#history-confirm button{margin:6px}#history-error:empty{display:none}@media(max-width:650px){.history-columns{grid-template-columns:1fr}#history-list{max-height:200px}}:root{color-scheme:light;--paper: #f4f0e7;--ink: #2d3932;--muted: #6e6b5f;--line: #dcd5c6;--panel: #fffdf8;--accent: #315b4d;--cinnabar: #9e4b3d;--gold: #86682f;--serif: "Songti SC", "STSong", "SimSun", serif;--timeline-paper: #ede8dd;--timeline-grid: #d3ccbc;--timeline-range: #4c7761;color:var(--ink);background:var(--paper);font-family:Microsoft YaHei,PingFang SC,system-ui,sans-serif}body{background-image:radial-gradient(ellipse at 85% 0,#e4e9df80,transparent 50%);min-width:0}::selection{background:#e8d7ad;color:#2d3932}button,.button,input,select,textarea,fieldset{border-radius:5px}button,.button{background:var(--accent);color:#fffdf6;font-weight:500;transition:background .15s,border-color .15s,box-shadow .15s}button:hover,.button:hover{filter:brightness(.95)}.secondary{background:#e8ede5;color:#315b4d;border-color:#c7d3c4}.quiet{background:transparent;color:#586653;border-color:#cfcfbf}input,select,textarea{color:var(--ink);background:#fffefa;border-color:#cbc5b6}input::placeholder,textarea::placeholder{color:#847f72}input:focus,select:focus,textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px #315b4d12}input[type=range],input[type=checkbox]{accent-color:var(--accent)}label,.family-date legend{color:#625f53}h1,h2,h3{font-family:var(--serif);font-weight:600}h1{font-size:34px;letter-spacing:4px;margin-top:17px}h2{letter-spacing:1px}.sidebar{width:222px;background:#213d34;background-image:linear-gradient(145deg,#2d4b3d,transparent 60%);border-right:1px solid #425344;padding:30px 18px 20px;color:#ebe7d8;scrollbar-width:thin;scrollbar-color:#6f8271 #213d34}.sidebar .brand{gap:11px;padding:4px 5px 30px;color:#f3eddf;font-family:var(--serif);font-size:22px;letter-spacing:2px}.brand-icon{width:44px;height:44px;border-radius:5px;outline:1px solid #c6b98c66;outline-offset:3px}.brand small{font-family:Microsoft YaHei,sans-serif;color:#c0c7b5;font-size:9px;letter-spacing:2px;margin-top:10px}.nav-label{color:#b2bba6;font-size:10px;padding:12px 13px 17px;letter-spacing:3px;border-top:1px solid #b9c2aa24}.sidebar nav{gap:5px}.sidebar nav button{color:#c9d1be;border-radius:4px;padding:12px 13px;gap:13px;position:relative;border:1px solid transparent;background:transparent}.sidebar nav button span{font-size:13px;letter-spacing:.6px}.sidebar nav button:hover{background:#ffffff09;filter:none}.sidebar nav button.active{background:#efebdc;border-color:#e0d6b8;color:#244638}.sidebar nav button.active:after{content:"";width:5px;height:5px;background:var(--cinnabar);position:absolute;right:13px;transform:rotate(45deg)}.sidebar .side-note{padding:22px 5px 8px;color:#c4ccb9;font-size:11px}.sidebar .dot{background:#afc39c;width:5px;height:5px}.sidebar #current-user{color:#d3d7c8;padding:10px 5px 0;border-top:1px solid #b9c2aa24}.sidebar .quiet{color:#d1d6c6;border-color:#8b9a813f;padding:9px;font-size:11px}.sidebar #account-password{margin-bottom:8px}.sidebar :focus-visible{outline-color:#e7c887}main{margin-left:222px;padding:30px 38px 22px;max-width:1900px}main>header{min-height:142px;padding:13px 0 23px;margin-bottom:25px;border-bottom:1px solid #b4b5a2;position:relative;gap:24px;isolation:isolate}main>header:after{content:"";position:absolute;bottom:-2px;left:0;height:3px;width:48px;background:var(--cinnabar)}main>header>div{position:relative;z-index:1}.eyebrow{color:var(--gold);font-size:10px;letter-spacing:3px}header p{color:#686f60;font-size:12px;letter-spacing:.5px}.header-status{color:#666e5e;gap:12px;font-size:11px;flex-shrink:0}.courtyard-landscape{position:absolute;width:330px;height:125px;right:5px;bottom:0;z-index:0;pointer-events:none;opacity:.55}.badge{background:#e4eddf;color:#355b3d;border:1px solid #c8d6be;border-radius:3px;font-size:10px}.badge.off{background:#f2e8d9;color:#835428;border-color:#dfc6a3}.metrics{background:#fcfaf4;border-radius:6px;box-shadow:0 3px 12px #3a402905}.metrics>div{padding:20px 22px;align-items:baseline}.metrics span{color:#6f7260}.metrics strong{font-family:Georgia,var(--serif);color:#365846;font-size:29px}.filter-row{color:#6e6b5f;margin:24px 0}.household-context{display:flex;flex-wrap:wrap;align-items:center;gap:12px 24px;margin:-5px 0 24px;padding:12px 16px;border-left:3px solid var(--gold);background:#eae8dc}.household-context span{font-size:11px;color:var(--muted)}.household-context select{min-width:140px;max-width:240px}.section-head{margin-top:25px}.section-head small{color:#8a7859;font-size:9px;letter-spacing:2px}.wall-toolbar{padding:12px 15px;background:#eae8dc;border:1px solid var(--line);border-radius:5px;gap:14px}.wall-toolbar select{background:#f9f6ed}.live-grid{gap:22px}.camera-card,.site-card,.panel,.empty,.family-canvas-panel{border-radius:6px;box-shadow:0 4px 18px #39422a05}.camera-card{border-color:#d2cebe}.camera-meta{padding:17px 18px 13px}.camera-meta strong{font-family:var(--serif);font-size:16px;letter-spacing:.5px}.camera-meta p{color:#737464;margin-top:7px}.camera-actions{flex-wrap:wrap;gap:7px;padding-bottom:16px}.camera-actions .quiet{border-color:#dbd9cb;color:#52604d;background:#faf9f2}.video-panel{border-radius:5px;border-color:#c1c6b8}.video-empty{color:#b0bdae;background:radial-gradient(ellipse at center,#243d34 0,transparent 70%)}.video-empty .lens{color:#a5bca4}.video-error{color:#f6d7c1;background:#472c26ed}.empty{color:#6c7462;border-color:#c3c6b6}.empty h3{color:#384e3b;font-size:21px}.panel{padding:24px}.time-labels{color:#6e705e}.recording-item{color:#35533f;background:#f9f7ee;border-color:#d5d1c0}.recording-item small{color:#737261}.scan-chip{background:#fffdf7;border-radius:5px}.device-table{border-radius:5px}.device-table th{color:#6a6d5c;background:#ecebde}.device-table td small{color:#737261}.device-table tbody tr:hover{background:#f2f1e7}.site-card h3{font-size:20px}.site-card dt{color:#737261}.site-card dd{color:#384e3b}.audit-item{color:#56654f}.audit-item small{color:#767461}.banner{color:#784c26;background:#f6e9cf;border-color:#dfc797}dialog{background:#fbf8ef;color:var(--ink);border:1px solid #d5c8ac;border-radius:8px;box-shadow:0 28px 100px #172c3455;padding:30px}dialog::backdrop{background:#20382cb8;backdrop-filter:blur(5px)}.dialog-heading{border-bottom:1px solid var(--line);padding-bottom:20px;gap:16px}.dialog-heading h2{font-size:23px}.dialog-footer{gap:10px;flex-wrap:wrap}#auth-dialog{border-top:4px solid var(--cinnabar);padding:38px;background-image:radial-gradient(ellipse at 100% 0,#e4e9dd,transparent 65%)}#auth-dialog .brand-icon{width:52px;height:52px}#auth-form h2{font-size:32px;letter-spacing:3px;margin-top:26px}#auth-form p{color:#6b725d}.form-error{color:#994437}footer{color:#716b5b;font-size:10px;letter-spacing:.5px}#toast{background:#2a4c3c;color:#f3efdc;border-color:#819672;border-radius:5px;box-shadow:0 8px 25px #30433726;max-width:calc(100vw - 30px)}.ptz-panel{background:#f8f5eb;border-color:#b9c5ad;border-radius:7px;box-shadow:0 12px 50px #26392d44;color:var(--ink)}.ptz-pad [data-ptz-action=stop]{color:#8b4236;background:#efdbd0;border-color:#d5b2a4}#preset-confirmation{background:#f4e2d5}#snapshot-image{border-radius:4px}.family-canvas-panel{background:#fcfaf3;border-color:#c7cbb7}.family-map-heading{padding-top:24px}.family-map-heading h2{letter-spacing:3px;font-size:25px}.family-view-tabs{background:#f1eee2;border-color:#d7d0bf;border-radius:4px}.family-view-tabs button{color:#606650;border-radius:2px}.family-view-tabs [aria-pressed=true]{background:#365945;color:#fffbed}.family-map-viewport{background-color:#efece0;background-image:radial-gradient(#c9cbbb 1px,transparent 1px);scrollbar-color:#8b9a7b #e8e6d8}.family-map-lines marker path{fill:#678b71}.family-edge{stroke:#94a58a}.family-edge.focused{stroke:#446b50}.family-edge.spouse{stroke:#a9854f}.family-edge.nonbiological{stroke:#93829e}.family-node{background:#fffdf6;border-color:#c9cdb9;border-radius:5px;color:#304632;box-shadow:0 3px 12px #3943250d}.family-node>strong{font-family:var(--serif);font-size:17px}.family-node-avatar{background:#e8ecdf;color:#536e45;border-radius:4px}.family-node .family-node-relation{color:#53664a}.family-node>small,.family-node-flags>small{color:#6f775f}.family-node.self{background:#f1ddb0;border-color:#af873f;box-shadow:0 5px 18px #b4872425}.family-node.self .family-node-avatar{background:#f8eac9}.family-node.selected{outline-color:#426c50}.family-node.search-hit:after{background:#596b78}.self-badge{background:#94682f;color:#fff8e9;border-radius:2px}.family-map-footer{border-color:#d0d3c0}.family-map-legend{color:#69705b}.family-map-footer #family-map-note:not(:empty){color:#87652f}.family-inspector.is-self{background:linear-gradient(135deg,#f3e3bd,#fcfaf1 65%);border-color:#c3a66b}.family-self-heading{color:#88652d;letter-spacing:1px}.family-register{background:#eeecdf}.person-card{color:#344732;border-color:#c9cbb9}.person-card.selected{background:#e6ecdc;outline-color:#66845b}.person-card.self{background:#f1ddb0;border-color:#b89553;color:#5f461f}.person-card.self span:not(.self-badge),.person-card.self small{color:#765b2e}.family-tree ul{border-color:#a2b197}.family-workspace:is(:fullscreen,.family-expanded){background:var(--paper)}.family-event-filters{background:#f0eee2}.timeline-year{color:#456344;font-family:var(--serif)}.timeline-event:before{border-color:#b7c2a5}.timeline-event:after{background:#768d5f;box-shadow:0 0 0 4px #e7ebdc}.timeline-event>time{color:#6c745d}.timeline-event-body{background:#fffdf6;border-color:#d3d6c2;border-radius:5px}.timeline-event:hover .timeline-event-body{background:#f7f7ec;border-color:#8caa78}.timeline-event-body>strong{color:#344d32;font-family:var(--serif);font-size:18px}.timeline-event-status,.timeline-summary,.timeline-event-body>small{color:#6b725b}.timeline-read{color:#41623b}.timeline-event.draft .timeline-event-body{background:#efede3}.timeline-event.draft:after{background:#a28a62}.event-detail-meta,.person-event-link time{color:#71745e}.event-lead{background:#eaecdd;border-color:#8e9f77;color:#46553b}.event-article{color:#424c3a}.person-event-link{color:#455a3c}.history-columns dl>div{border-color:#d9d6c4}.history-changed{background:#e8ecda;border-radius:4px}#history-confirm{border-color:#b3be98;border-radius:5px;background:#efefdf}#page-live:fullscreen{--muted: #c0c9b4;--line: #52614d;--panel: #25352c;color:#efecdd;background:#111c16;color-scheme:dark}#page-live:fullscreen .wall-toolbar{background:#24372b;border-color:#40543e}#page-live:fullscreen label{color:#d9deca}#page-live:fullscreen select{background:#1a2a20;color:#ebeede;border-color:#65765a}#page-live:fullscreen .quiet{color:#d9dfca;border-color:#66765a;background:transparent}#page-live:fullscreen .camera-card{border-color:#394f38}#page-live:fullscreen .camera-actions{background:#17251ee8}#page-live:fullscreen .ptz-panel{--muted: #6e6b5f;--line: #dcd5c6;color-scheme:light}#page-live:fullscreen .ptz-panel label,#page-live:fullscreen .ptz-panel .quiet{color:#586653;border-color:#cfcfbf}@media(min-width:1600px){main{padding-left:46px;padding-right:46px}}@media(max-width:1100px){.sidebar{width:200px;padding:27px 14px 18px}.sidebar .brand{font-size:20px;gap:9px}.brand-icon{width:38px;height:38px}main{margin-left:200px;padding:24px}.metrics>div{padding:18px 14px}.metrics strong{font-size:25px}.courtyard-landscape{width:260px;opacity:.4}}@media(max-width:760px){.sidebar{position:static;width:auto;padding:22px 17px 14px;display:grid;grid-template-columns:1fr auto;gap:0 10px;overflow:visible}.sidebar .brand{padding:2px 4px 20px;font-size:22px;grid-column:1/-1}.brand-icon{width:38px;height:38px}.brand small{font-size:9px}.sidebar nav{grid-column:1/-1;display:flex;overflow-x:auto;gap:5px;padding-bottom:12px;scrollbar-width:thin;scrollbar-color:#819573 #213d34}.sidebar nav button{padding:10px 12px;gap:7px;flex-shrink:0}.sidebar nav button span{font-size:12px}.sidebar nav button.active:after{display:none}.sidebar #current-user{position:static;grid-column:1/-1;margin:4px 0 10px;padding-top:12px;font-size:11px}.sidebar #account-password,.sidebar #logout{margin:0;font-size:11px;padding:8px 12px;align-self:center;width:fit-content}.sidebar #logout{justify-self:end}main{margin:0;padding:20px 17px}main>header{min-height:132px;padding-top:9px;gap:10px;margin-bottom:20px}h1{font-size:28px;letter-spacing:3px}.eyebrow{font-size:9px;letter-spacing:2px}.header-status{font-size:9px;gap:9px;max-width:123px;padding-top:2px}.header-status .badge{font-size:9px}header p{max-width:205px;font-size:11px;line-height:1.8}.courtyard-landscape{width:170px;height:90px;right:0;opacity:.38}.metrics>div{padding:16px}.metrics strong{font-size:25px}.metrics>div:nth-last-child(-n+2){border-bottom:0}.filter-row{margin:20px 0}.filter-row select{max-width:155px}.filter-row>button{padding:9px}.section-head{flex-wrap:wrap}.section-head>div{gap:10px}.wall-toolbar{padding:11px;gap:10px}.wall-toolbar label{font-size:12px}#wall-fullscreen{padding:10px 12px}.camera-meta{padding:14px}.camera-meta strong{font-size:15px}.camera-actions{padding:0 14px 14px;gap:8px}.camera-actions button{padding:9px 11px}.panel,.site-card{padding:18px}.family-map-heading h2{font-size:23px}dialog{padding:22px}#auth-dialog{padding:30px 26px}.dialog-heading h2{font-size:21px}.dialog-footer{gap:8px}footer{gap:16px;flex-wrap:wrap;font-size:9px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important}}.household-actions{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0}.household-context select{max-width:100%}.household-context label{min-width:0}.device-actions,.device-search-row,.device-group-order,.group-step{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.device-search-row{align-items:end}.device-search-row label{flex:1;min-width:160px}.device-group-order{margin:12px 0}.group-step{padding:7px;background:var(--paper);border:1px solid var(--line);border-radius:5px}.group-step select{width:auto;max-width:145px}.group-step button{padding:7px 11px}.group-step>span{color:var(--muted)}.device-group{margin:26px 0}.device-group>h3{font-family:var(--serif);font-size:20px;overflow-wrap:anywhere}.device-group>h3>span{color:var(--gold);padding:0 8px}.device-group>h3 small{font:12px var(--sans);color:var(--muted);white-space:nowrap}.device-tags{display:flex;flex-wrap:wrap;gap:6px}.device-tags span{font-size:11px;padding:3px 8px;background:var(--paper);border:1px solid var(--line)}.site-card dd,.site-card .description{overflow-wrap:anywhere;min-width:0}@media(max-width:600px){.device-actions{width:100%}.device-actions button{flex:1;white-space:normal}.group-step{width:100%}.group-step select{flex:1;max-width:none;min-width:0}.device-group>h3{font-size:18px}}#scope-navigation{border-left:1px solid #6d8270;margin:12px 0 12px 10px;padding-left:9px}#scope-navigation .nav-label{padding:10px 12px;overflow-wrap:anywhere}.device-context{padding:18px 22px;margin:20px 0;border:1px solid var(--line);border-left:4px solid var(--accent);background:var(--panel)}.device-context p{color:var(--muted);overflow-wrap:anywhere;margin:0 0 14px}.device-context [role=group]{display:flex;flex-wrap:wrap;gap:8px}.device-context button.active{color:var(--paper);background:var(--accent)}.device-title{border:0;padding:0;background:transparent;color:var(--ink);font:inherit;text-align:left;box-shadow:none;white-space:normal;overflow-wrap:anywhere}.device-title:hover{color:var(--accent);background:transparent}.device-title span{color:var(--accent)}.scope-intro{padding:28px 0}.scope-intro h2{font:500 32px var(--serif);margin:12px 0}.scope-intro p{color:var(--muted);line-height:1.8}.steward-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.steward-tile{display:flex;flex-direction:column;text-align:left;gap:12px;min-height:190px;padding:28px;border:1px solid var(--line);border-top:3px solid var(--accent);background:var(--panel);color:var(--ink);white-space:normal;box-shadow:0 3px 12px #22332208}.steward-tile strong{font-size:23px;font-family:var(--serif);font-weight:500}.steward-tile span,.steward-tile small{color:var(--muted);line-height:1.7}.steward-tile:hover{background:var(--paper);border-color:var(--accent)}#device-detail dl,#heritage-detail dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}#device-detail dl>div,#heritage-detail dl>div{border-bottom:1px solid var(--line);padding-bottom:12px}#device-detail dt,#heritage-detail dt{font-size:12px;color:var(--muted);margin-bottom:6px}#device-detail dd,#heritage-detail dd{margin:0;overflow-wrap:anywhere}.heritage-prose{white-space:pre-wrap;line-height:1.9;overflow-wrap:anywhere;margin:24px 0}#heritage-detail{margin-top:24px}.heritage-controls{display:flex;gap:18px;flex-wrap:wrap;align-items:center;margin-bottom:22px}.heritage-controls label{min-width:0}.household-context{flex-wrap:wrap}@media(max-width:720px){.steward-grid{grid-template-columns:1fr}.steward-tile{min-height:150px;padding:22px}.device-context{padding:16px}.device-context button{flex:1 1 40%;min-width:0}#device-detail dl,#heritage-detail dl{grid-template-columns:1fr}#scope-navigation{display:flex;flex-wrap:wrap;border:0;margin:0;padding:0;width:100%}#scope-navigation .nav-label{width:100%;padding:8px 4px}.scope-intro h2{font-size:26px}}#household-list{display:block}.home-city-group{margin:24px 0 36px}.home-city-group>h3{font-size:21px}.home-city-group>h3 small{font:12px sans-serif;color:var(--muted);margin-left:12px}.home-card{padding:0;overflow:hidden}.home-cover{position:relative;min-height:210px;background:linear-gradient(145deg,#4b6957,#253d34);isolation:isolate;color:#fffdf6}.home-cover>img{position:absolute;width:100%;height:100%;object-fit:cover;inset:0;z-index:-2}.home-cover:after{content:"";position:absolute;inset:0;background:linear-gradient(0deg,#102019db,transparent);z-index:-1}.home-cover-content{padding:24px;min-height:210px;display:flex;flex-direction:column;justify-content:end}.home-cover .site-heading{margin-bottom:auto}.home-cover h3{margin:26px 0 4px;color:#fffdf6;text-shadow:0 1px 3px #000a;font-size:25px}.home-cover .quiet{background:#172a25ba;color:#fff;border-color:#bccabd80}.home-cover .badge{background:#f9f5e5e8;color:#244638;border-color:transparent}.home-location{font-size:12px;margin:8px 0 0;color:#fffdf6}.home-cover-placeholder{position:absolute;top:88px;right:22px;opacity:.3;font:18px var(--serif);letter-spacing:5px}.home-card-body{padding:24px}.home-card-body .household-actions{margin-bottom:0}.cover-editor img{width:100%;max-height:230px;object-fit:contain;border:1px solid var(--line);margin-bottom:12px;background:var(--paper)}#page-settings h3{font-size:21px;margin-top:8px}#page-settings .form-grid{margin:22px 0}#page-settings input:not([type=checkbox]),#page-settings select{width:100%;min-width:0}.brand-image-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin:28px 0}.brand-image-grid>div{border:1px solid var(--line);padding:18px;border-radius:6px;min-width:0}.brand-image-grid img{width:80px;height:80px;object-fit:contain;background:var(--paper);border-radius:6px;display:block;margin-bottom:18px}.brand-image-grid label{display:grid;gap:12px;margin-bottom:14px}.config-import{font-size:12px;max-width:300px}.backup-row{display:grid;gap:8px;padding:18px 0;border-bottom:1px solid var(--line);font-size:12px}.backup-row small,.backup-row code{overflow-wrap:anywhere}.backup-row span{color:var(--muted)}#settings-error,#brand-status,#preferences-status,#backup-save-status,#backup-result{line-height:1.8;font-size:13px;overflow-wrap:anywhere}.brand #brand-name{overflow-wrap:anywhere;letter-spacing:1px}.brand #brand-subtitle{overflow-wrap:anywhere;line-height:1.8;letter-spacing:1px}html[data-backdrop=plain] body{background-image:none}html[data-backdrop=plain] .courtyard-landscape{display:none}html[data-font=sans]{--serif:"Microsoft YaHei","PingFang SC",system-ui,sans-serif}html[data-density=compact] main{padding:20px 26px}html[data-density=compact] main>header{min-height:100px;padding:6px 0 15px;margin-bottom:20px}html[data-density=compact] .panel,html[data-density=compact] .site-card:not(.home-card),html[data-density=compact] .home-card-body{padding:17px}html[data-density=compact] .sidebar nav button{padding:9px 12px}html[data-density=compact] .steward-tile{min-height:150px;padding:20px}html[data-density=compact] .metrics>div{padding:13px 18px}html[data-density=compact] .home-cover,html[data-density=compact] .home-cover-content{min-height:180px}html[data-theme=clean]{--paper:#f3f6fa;--ink:#203349;--muted:#53667d;--panel:#ffffff;--line:#d2dce7;--accent:#285ca0;--gold:#52657f;--cinnabar:#386ea8;--timeline-paper:#edf2f8;--timeline-grid:#cbd6e4;--timeline-range:#4c72a5;--surface-alt:#e8eff8;--side:#1e3551;--on-accent:#ffffff;color-scheme:light}html[data-theme=ink]{--paper:#151d22;--ink:#e3e9e5;--muted:#afbdb5;--panel:#202c32;--line:#46565a;--accent:#a2cab4;--gold:#d6bd83;--cinnabar:#e0a390;--timeline-paper:#26343b;--timeline-grid:#516369;--timeline-range:#91bda6;--surface-alt:#2a3940;--side:#132020;--on-accent:#13231c;color-scheme:dark}html[data-theme=clean] body,html[data-theme=ink] body{background-color:var(--paper);color:var(--ink)}html:is([data-theme=clean],[data-theme=ink]) .sidebar{background:var(--side);border-color:var(--line)}html:is([data-theme=clean],[data-theme=ink]) main>header{border-color:var(--line)}html:is([data-theme=clean],[data-theme=ink]) :is(.metrics,.panel,.site-card,.camera-card,.empty,.family-canvas-panel,.scan-chip,dialog){background-color:var(--panel);border-color:var(--line);color:var(--ink)}html:is([data-theme=clean],[data-theme=ink]) :is(.household-context,.wall-toolbar,.device-table th,.family-view-tabs,.family-map-viewport,#preset-confirmation){background-color:var(--surface-alt);color:var(--ink);border-color:var(--line)}html:is([data-theme=clean],[data-theme=ink]) :is(input,select,textarea){background:var(--panel);border-color:var(--line);color:var(--ink)}html:is([data-theme=clean],[data-theme=ink]) :is(input,textarea)::placeholder{color:var(--muted)}html:is([data-theme=clean],[data-theme=ink]) :is(label,header p,.header-status,.metrics span,.filter-row,.section-head small,.camera-meta p,.empty,.time-labels,.recording-item small,.device-table td small,.site-card dt,.audit-item,.audit-item small,footer,#auth-form p,.family-date legend){color:var(--muted)}html:is([data-theme=clean],[data-theme=ink]) :is(.metrics strong,.empty h3,.site-card dd){color:var(--ink)}html:is([data-theme=clean],[data-theme=ink]) button:not(.quiet):not(.secondary):not(.device-title):not(.steward-tile),html:is([data-theme=clean],[data-theme=ink]) .button{background:var(--accent);color:var(--on-accent)}html:is([data-theme=clean],[data-theme=ink]) :is(.quiet,.secondary,.recording-item,.camera-actions .quiet){background:var(--surface-alt);color:var(--ink);border-color:var(--line)}html:is([data-theme=clean],[data-theme=ink]) .sidebar nav button{background:transparent;color:#dbe5e4}html:is([data-theme=clean],[data-theme=ink]) .sidebar nav button.active{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}html:is([data-theme=clean],[data-theme=ink]) .sidebar>.quiet{background:transparent;color:#dbe5e4}html:is([data-theme=clean],[data-theme=ink]) #auth-dialog{background-image:none;background-color:var(--panel)}html:is([data-theme=clean],[data-theme=ink]) .device-table tbody tr:hover{background:var(--surface-alt)}html:is([data-theme=clean],[data-theme=ink]) .family-node{background:var(--panel);border-color:var(--line);color:var(--ink)}html:is([data-theme=clean],[data-theme=ink]) .family-node.self{background:#ebd6aa;color:#2b3b30;border-color:#b79a59}html:is([data-theme=clean],[data-theme=ink]) .family-node.self :is(small,span,strong){color:#2b3b30}html[data-theme=ink] :is(.form-error,.family-warning){color:#ffc8b6}html[data-theme=ink] .ptz-panel{background:var(--panel);color:var(--ink);border-color:var(--line)}html[data-theme=ink] .home-cover .quiet{background:#172a25df;color:#fff}html[data-theme=ink] body{background-image:radial-gradient(ellipse at 90% 0,#263c3340,transparent 65%)}@media(min-width:761px){html[data-layout=top] .sidebar{position:relative;width:100%;padding:16px 30px;display:flex;align-items:center;flex-wrap:wrap;gap:12px 22px;min-height:0;height:auto;border-right:0;border-bottom:1px solid var(--line)}html[data-layout=top] .sidebar .brand{padding:0;max-width:250px}html[data-layout=top] .sidebar>.nav-label,html[data-layout=top] .side-note{display:none}html[data-layout=top] .sidebar nav{display:flex;flex:1;flex-wrap:wrap;min-width:250px;gap:6px}html[data-layout=top] #scope-navigation{display:flex;flex-wrap:wrap;width:100%;order:1;margin:0;padding:0;border:0}html[data-layout=top] #scope-navigation .nav-label{display:none}html[data-layout=top] .sidebar #current-user{margin:0;padding:0;border:0}html[data-layout=top] .sidebar>.quiet{margin:0}html[data-layout=top] main{margin-right:auto;margin-left:auto}html[data-layout=top] .sidebar nav button{width:auto;white-space:nowrap}}@media(max-width:760px){.brand-image-grid{grid-template-columns:1fr}.home-cover-content,.home-card-body{padding:20px}.home-cover-placeholder{font-size:15px}.sidebar #logout{display:block}#page-settings .form-grid{grid-template-columns:1fr}html[data-density=compact] main{padding:18px 14px}#household-form .form-grid{grid-template-columns:1fr}.home-city-group>h3 small{display:block;margin:8px 0}}.journal-feed{max-width:1080px;margin:0 auto}.journal-compose textarea{resize:vertical;min-height:130px}.journal-compose>label{display:grid;gap:12px}.journal-add-media,.journal-reactions{display:flex;flex-wrap:wrap;gap:12px;margin:20px 0}.journal-add-media>label{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.journal-add-media input{max-width:260px}.journal-filters{display:flex;align-items:end;flex-wrap:wrap;gap:16px}.journal-filters label{flex:1;min-width:145px;display:grid;gap:7px}.journal-entry{border-left:3px solid #a98964;margin-bottom:26px}.journal-entry .section-head small{display:block;color:var(--muted);margin-top:6px}.journal-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.95;font-size:17px}.journal-author{font-size:20px!important;font-family:serif}.journal-media{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:14px}.journal-media figure{margin:0;min-width:0}.journal-media img,.journal-media video{width:100%;max-height:450px;object-fit:contain;border-radius:8px;background:#1a2925}.journal-media audio{width:100%;max-width:100%}.journal-media figcaption{font-size:13px;overflow-wrap:anywhere;margin-top:6px}.journal-image-load{width:100%;min-height:150px;background:#e9eee2!important}.journal-upload{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;border-bottom:1px solid #d9d7c8;padding:12px 0}.journal-upload label{flex:1;overflow-wrap:anywhere}.journal-upload small{display:block}.journal-upload input[type=checkbox]{width:auto}.journal-resume input{max-width:220px}.journal-comments{border-top:1px solid #d9d7c8;padding-top:15px}.journal-comments form{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.journal-comments form label{flex:1;min-width:170px}.journal-comment{padding:10px 0;border-bottom:1px dashed #d9d7c8;overflow-wrap:anywhere}.journal-comment small{font-size:11px;color:var(--muted)}.journal-reactions [aria-pressed=true]{color:#ad5842!important}.journal-comments .quiet{padding:4px 8px;font-size:12px}.journal-feed .panel{overflow:hidden}html[data-theme=ink] .journal-image-load{background:#293f37!important}.journal-upload-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));gap:18px;margin:20px 0}.journal-upload-card{border:1px solid var(--line,#d9d7c8);border-radius:12px;padding:16px;background:var(--surface,#fffdf8);min-width:0;display:flex;flex-direction:column;gap:14px}.journal-upload-card:has(input:checked){border-color:#456f5f;box-shadow:0 0 0 1px #456f5f}.journal-upload-select{display:flex!important;align-items:flex-start;gap:10px;overflow-wrap:anywhere;line-height:1.5}.journal-upload-select input[type=checkbox]{width:18px;min-width:18px;height:18px;margin-top:3px;accent-color:#315a4e}.journal-upload-select small{display:block;font-size:12px;color:var(--muted);margin-top:4px}.journal-card-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:auto}.journal-card-actions button{padding:8px 13px;font-size:13px}.journal-card-actions [data-remove-upload]{margin-left:auto;color:#954f40}.journal-card-actions a,.journal-media-caption a{font-size:13px;color:var(--accent,#315a4e)}.journal-attachment{margin:0;min-width:0}.journal-photo{display:block;position:relative;width:100%;padding:0!important;border:0!important;background:#e6e9df!important;border-radius:9px;overflow:hidden;color:#fff!important}.journal-photo img{display:block;width:100%;min-height:120px;max-height:450px;object-fit:contain;aspect-ratio:16/10;background:#e6e9df;border-radius:9px}.journal-photo-hint{position:absolute;right:10px;bottom:10px;padding:4px 9px;background:#213a30c9;border-radius:5px;font-size:12px}.journal-upload-card .journal-photo img{height:180px;min-height:0;object-fit:cover}.journal-attachment video{width:100%;max-height:450px;border-radius:8px;background:#1a2925}.journal-upload-card video{height:180px}.journal-attachment audio{width:100%;max-width:100%}.journal-audio{background:#e9eee5;border:1px solid #d5decd;border-radius:10px;padding:14px}.journal-audio-label{display:flex;align-items:center;gap:10px;color:#42614f;font-size:13px;letter-spacing:1px;margin:0 0 14px}.journal-audio-label span{font-size:28px}.journal-media-state{display:block;font-size:12px;color:var(--muted);padding-top:6px;min-height:0}.journal-media-state:empty{display:none}.journal-media-caption{font-size:12px;color:var(--muted);overflow-wrap:anywhere;margin:8px 0 16px}.journal-trash{padding:12px 0;border-top:1px solid #d9d7c8}.journal-trash-row{display:flex;align-items:center;gap:15px;justify-content:space-between;padding:10px 0;border-bottom:1px solid #d9d7c8;overflow-wrap:anywhere}.journal-preview{width:min(960px,94vw);max-width:94vw;padding:24px;max-height:94vh}.journal-preview header,.journal-preview footer{display:flex;align-items:center;justify-content:space-between;gap:18px;position:static}.journal-preview header{margin-bottom:20px}.journal-preview h2{font-size:22px;overflow-wrap:anywhere;margin:0}.journal-preview footer{font-size:13px;margin-top:18px}.journal-preview .journal-photo img{max-height:65vh;min-height:0;aspect-ratio:auto}.journal-preview .journal-photo{pointer-events:none}.journal-preview .journal-photo-hint{display:none}.journal-preview video{max-height:65vh}html[data-theme=ink] .journal-upload-card{background:#20352d}html[data-theme=ink] .journal-audio{background:#293f37;border-color:#436152}html[data-theme=ink] .journal-audio-label{color:#d5e2ce}@media(max-width:600px){.journal-upload-grid{grid-template-columns:1fr}.journal-preview{padding:16px}.journal-preview h2{font-size:17px}.journal-preview header button{flex-shrink:0}.journal-media{grid-template-columns:1fr}}@media(max-width:760px){.sidebar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:14px 16px;height:auto;min-height:0}.sidebar .brand{min-width:0;padding:0;gap:10px}.sidebar .brand>span{min-width:0}.sidebar #brand-name{font-size:23px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebar .brand-icon{width:38px;height:44px}.sidebar #brand-subtitle{font-size:11px;letter-spacing:1px}.sidebar .mobile-nav-toggle{display:block;margin:0;min-height:44px;color:#f7f3e5;border-color:#8faaa0;padding:9px 14px}.sidebar:not(.mobile-open)>nav,.sidebar:not(.mobile-open)>#current-user,.sidebar:not(.mobile-open)>#account-password,.sidebar:not(.mobile-open)>#logout{display:none}.sidebar>nav,.sidebar>#current-user{grid-column:1/-1}.sidebar.mobile-open>nav{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:0;padding:8px 0 0}.sidebar #scope-navigation{display:contents}.sidebar #scope-navigation[hidden]{display:none}.sidebar nav button{width:100%;text-align:left;min-height:44px;white-space:normal;margin:0;font-size:14px}.sidebar.mobile-open>#current-user{margin:0;padding:12px 0 0}.sidebar.mobile-open>#account-password,.sidebar.mobile-open>#logout{display:block;min-height:44px;margin:0}main{padding:22px 16px}main>header{margin-bottom:22px}.header-status #clock{display:none}input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea{font-size:16px!important;min-height:44px}button,.button{min-height:44px;touch-action:manipulation}.form-grid{grid-template-columns:1fr}.form-grid>*{min-width:0}.form-grid .wide{grid-column:1/-1}.section-head{flex-wrap:wrap;gap:12px}.section-head>div{max-width:100%}.section-head button{white-space:normal}.household-context{gap:10px;padding:12px}.household-context label{width:100%;display:flex;flex-wrap:wrap}.household-context select{flex:1;min-width:0}.household-context #household-context-note{display:none}.filter-row{gap:10px;flex-wrap:wrap}.filter-row label{width:100%;display:grid;grid-template-columns:1fr}.filter-row select{width:100%}.settings-sections,.view-presets{gap:8px}.settings-sections button,.view-presets button{flex:1 1 100px;white-space:normal}.device-actions,.device-search-row{gap:10px}.device-search-row{display:grid;grid-template-columns:1fr}dialog{width:calc(100% - 24px);max-width:calc(100% - 24px);max-height:90vh;max-height:90dvh;padding:18px;overscroll-behavior:contain}dialog header,dialog .dialog-heading{gap:12px;align-items:flex-start}dialog h2{font-size:22px}dialog footer{flex-wrap:wrap}.journal-compose,.journal-entry{padding:18px}.journal-filters{gap:12px}.journal-filters label{flex-basis:100%;min-width:0}.journal-add-media input{max-width:100%;width:100%}.journal-add-media>label{width:100%}.journal-preview{padding:16px}.journal-preview .journal-photo img,.journal-preview video{max-height:60vh;max-height:60dvh}.journal-upload-card{padding:12px}.journal-media audio{min-width:0}.journal-comments form label{min-width:0;flex-basis:100%}.device-context [role=group]{display:flex;flex-wrap:wrap;gap:8px}.device-context button{flex:1 1 42%;white-space:normal}.metrics{margin-bottom:20px}}@media(max-width:760px){.sidebar .brand{grid-column:1;max-width:100%;width:auto}.sidebar>.mobile-nav-toggle{grid-column:2;grid-row:1;width:auto;max-width:110px}.sidebar .brand-icon{flex-shrink:0}.sidebar .brand>span{overflow:hidden}.sidebar #brand-name{font-size:21px}}.geo-picker{min-width:0;border:1px solid var(--line,#d8d2c3);border-radius:10px;padding:14px;margin:0}.geo-picker legend{padding:0 8px}.geo-picker .geo-path{display:block;overflow-wrap:anywhere;margin-top:10px;font-size:.9rem}.geo-picker .form-grid{min-width:0}.geo-picker input,.geo-picker select{width:100%;min-width:0}#household-cover-status[data-error=true]{color:#ad3c28;font-weight:600}#household-cover-preview{max-width:100%;max-height:240px;object-fit:contain}.home-layout-controls{padding:16px 20px}.home-layout-controls .device-actions{align-items:end;flex-wrap:wrap}.home-layout-controls label{margin:0;min-width:90px}.home-layout-controls label.check{min-width:0;align-self:center}.home-card-grid{display:grid;grid-template-columns:repeat(var(--home-columns,2),minmax(0,1fr));gap:20px;align-items:start}.home-card-grid .home-card{min-width:0}.home-card-grid .home-card-body{padding:18px}.home-card-grid .home-cover-content{min-height:190px;padding:18px}.home-card-grid .home-cover{min-height:190px}.home-card-grid .home-card-body dl{margin:12px 0}.home-card-grid .home-card-body .description{font-size:13px}.home-card-grid .household-actions{display:flex;flex-wrap:wrap;gap:8px}.home-card-grid .household-actions button{font-size:13px;padding:10px 12px}.home-order-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:14px}.home-order-actions span{font-size:12px;color:var(--muted)}.home-order-actions button{font-size:12px;padding:8px}.home-card[draggable=true]{cursor:grab;outline:1px dashed var(--accent);outline-offset:3px}.home-pagination{display:flex;gap:18px;justify-content:center;align-items:center;margin:24px 0;flex-wrap:wrap}.home-pagination span{font-size:13px;color:var(--muted)}@media(max-width:1100px){.home-card-grid{grid-template-columns:repeat(min(var(--home-columns,2),2),minmax(0,1fr))}}@media(max-width:650px){.home-card-grid{grid-template-columns:minmax(0,1fr)}.home-layout-controls{padding:12px}.home-layout-controls .device-actions{gap:10px}.home-layout-controls button{padding:10px 12px}.home-pagination{gap:10px}.home-card-grid .home-cover-content{padding:16px}}.device-network{min-width:0;border:1px solid var(--line);padding:16px}.device-network legend{padding:0 8px}.topology-tree,.topology-tree ul{list-style:none;padding:0;margin:20px 0}.topology-tree ul{margin-left:24px;padding-left:24px;border-left:2px solid var(--accent,#31584a)}.topology-tree li{position:relative;margin:18px 0;min-width:0}.topology-tree ul>li:before{content:"";position:absolute;left:-24px;top:28px;width:24px;border-top:2px solid var(--accent,#31584a)}.topology-node{border:1px solid var(--line);border-radius:10px;padding:20px;background:var(--paper);max-width:800px;overflow-wrap:anywhere}.topology-node h3{margin:12px 0}.topology-node dl{display:grid;gap:8px}.topology-node dl>div{display:grid;grid-template-columns:100px minmax(0,1fr);gap:10px}.topology-node dd{margin:0}.topology-node dt,.topology-node p{font-size:13px;color:var(--muted)}.topology-node .device-title{text-align:left}@media(max-width:650px){.topology-tree ul{margin-left:8px;padding-left:12px}.topology-tree ul>li:before{left:-12px;width:12px}.topology-node{padding:14px}.topology-node dl>div{grid-template-columns:72px minmax(0,1fr)}.device-network .form-grid{grid-template-columns:1fr}}.platform-topology-root{border:1px solid var(--line);border-top:4px solid var(--accent,#31584a);background:var(--paper);padding:22px;text-align:center;margin:24px auto;max-width:420px;border-radius:10px}.platform-place-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:24px;border-top:2px solid var(--line);padding-top:24px}.platform-place-node{position:relative;text-align:left;white-space:normal;min-width:0;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--text);padding:22px}.platform-place-node:before{position:absolute;content:"";height:25px;top:-25px;left:50%;border-left:2px solid var(--line)}.platform-place-node h3{margin:16px 0}.platform-place-node p,.platform-place-node small{color:var(--muted)}.platform-place-node>span:last-child{display:block;margin-top:18px}.platform-place-node:hover{border-color:var(--accent,#31584a);background:var(--surface,#f1f2e9)}.topology-tree{display:flex;gap:24px;align-items:start;flex-wrap:wrap}.topology-tree>li{flex:1 1 400px}.topology-tree ul{display:flex;gap:16px;flex-wrap:wrap}.topology-tree ul>li{flex:1 1 260px;max-width:560px}.topology-node{max-width:560px;padding:16px}.device-actions #devices-card-view[aria-pressed=true],.device-actions #devices-topology-view[aria-pressed=true],.device-actions #home-card-view[aria-pressed=true],.device-actions #home-topology-view[aria-pressed=true]{background:var(--accent,#31584a);color:#fff}.home-card-grid[hidden],.home-layout-controls[hidden],.home-pagination[hidden]{display:none!important}:root{--bs-primary: #28624f;--bs-primary-rgb: 40, 98, 79;--bs-body-color: #263f36;--bs-body-bg: #f4f6f4;--bs-border-color: #dde4df;--bs-border-radius: .65rem;--ui-surface: #fff;--ui-muted: #67776d;--ui-line: #dfe6e1;--ui-sidebar: #193c32;--ui-accent: #28624f;--ui-bg: #f4f6f4;--ink: #263f36;--muted: #67776d;--paper: #fff;--line: #dfe6e1;--green: #28624f;--green-dark: #193c32;--cream: #f4f6f4}html,body{min-width:320px;margin:0;background:var(--ui-bg)!important;color:var(--ink);font-family:Inter,Segoe UI,Microsoft YaHei,system-ui,sans-serif;font-size:14px;line-height:1.65}body{display:block!important;background-image:none!important}body:before,body:after{display:none!important}#app{min-height:100vh;display:grid;grid-template-columns:232px minmax(0,1fr)}*,*:before,*:after{box-sizing:border-box}[hidden]{display:none!important}button,input,select,textarea{font:inherit}button,a,input,select,textarea{touch-action:manipulation}button{letter-spacing:0!important}.app-icon{width:20px;height:20px;flex:0 0 20px;vertical-align:middle}.btn .app-icon{width:17px;height:17px}.sidebar{width:232px!important;position:fixed!important;inset:0 auto 0 0;z-index:20;background:var(--ui-sidebar)!important;color:#e6f0eb;padding:28px 18px 20px!important;display:flex;flex-direction:column;height:100dvh;overflow:auto;border:0!important;box-shadow:none!important}.brand{padding:0 6px 24px!important;gap:12px;text-decoration:none;color:#fff!important;border-bottom:1px solid #ffffff14!important;margin:0 0 24px!important;display:flex;align-items:center}.brand-icon{width:42px!important;height:42px!important;object-fit:contain;border-radius:10px}.brand>span>span{font-size:22px!important;line-height:1.2;letter-spacing:2px}.brand small{font-size:11px!important;letter-spacing:1px;color:#acc4b8!important;margin-top:6px;display:block}.nav-label{font-size:10px!important;letter-spacing:2px;padding:0 12px;margin-bottom:12px;color:#95b5a6!important}.sidebar nav{display:flex!important;flex-direction:column!important;gap:5px}.sidebar nav button{display:flex;gap:12px;align-items:center;text-align:left;width:100%;color:#c0d6c9!important;background:transparent!important;border:0!important;box-shadow:none!important;border-radius:8px!important;min-height:44px;padding:10px 13px!important;font-size:13px!important;white-space:normal}.sidebar nav button:hover{background:#ffffff0d!important;color:#fff!important}.sidebar nav button.active{background:#ffffffed!important;color:#234c3d!important;font-weight:600}.sidebar nav .app-icon{opacity:.85}#scope-navigation{border:0!important;padding:18px 0 10px!important;margin:7px 0!important;box-shadow:0 -1px #ffffff14,0 1px #ffffff14}#scope-nav-name{max-width:185px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0 0 12px}.side-note{margin-top:auto;padding:36px 12px 16px;font-size:10px;color:#9abbab}.side-note p{display:none}.sidebar #current-user{color:#c1d3c8!important;border-top:1px solid #ffffff18;padding-top:14px;font-size:11px;margin:0 0 8px}.sidebar>#account-password,.sidebar>#logout{border-color:#ffffff20!important;color:#c1d3c8!important;background:transparent!important;font-size:11px;min-height:32px;padding:5px;margin:4px 0}.mobile-nav-toggle{display:none}#app>main{grid-column:2;margin:0!important;padding:28px 34px 20px!important;width:100%;min-width:0;max-width:1800px;min-height:100vh;background:none!important}main>header{padding:0 0 24px!important;margin:0 0 24px!important;border-bottom:1px solid var(--ui-line)!important;display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:0!important;background:none!important;position:relative}main>header:after,main>header:before{display:none!important}.eyebrow{font-size:10px;letter-spacing:2px;color:var(--ui-muted)!important;margin-bottom:7px}h1,#page-title{font-family:inherit!important;font-size:26px!important;font-weight:650!important;line-height:1.35;letter-spacing:-.5px!important;margin:0 0 7px!important}h2{font-size:19px!important;font-weight:600!important;line-height:1.45;letter-spacing:0!important;margin:0 0 5px!important}h3{font-size:16px!important;line-height:1.5;font-weight:600!important;letter-spacing:0!important}h2,h3,h4{font-family:inherit!important}#page-note{font-size:12px!important;color:var(--ui-muted);margin:0!important}.header-status{align-items:flex-end;gap:8px;font-size:10px!important;white-space:nowrap}#service-status{font-size:10px}#clock{color:var(--ui-muted);background:none!important;padding:0!important}#clock:before{display:none!important}.btn{border-radius:7px!important;min-height:36px;padding:7px 13px;font-size:12px;font-weight:500;box-shadow:none;line-height:1.65;display:inline-flex;align-items:center;justify-content:center;gap:5px;white-space:normal}.btn-primary{--bs-btn-bg: var(--ui-accent);--bs-btn-border-color: var(--ui-accent);--bs-btn-hover-bg: #1d4d3c;--bs-btn-hover-border-color: #1d4d3c;--bs-btn-disabled-bg: #80988d;--bs-btn-disabled-border-color: #80988d;--bs-btn-active-bg: #1d4d3c;--bs-btn-active-border-color: #1d4d3c;color:#fff!important}.btn-outline-secondary{--bs-btn-color: #54685d;--bs-btn-border-color: #d8e1da;--bs-btn-hover-bg: #edf3ee;--bs-btn-hover-border-color: #bacdc0;--bs-btn-hover-color: #264d3b;--bs-btn-active-bg: #e0ece4;--bs-btn-active-border-color: #a7c0ae;--bs-btn-active-color: #254e3b;--bs-btn-disabled-color: #9faea4;--bs-btn-disabled-border-color: #e0e5e2;background:transparent}.btn-sm{min-height:30px;padding:4px 9px;font-size:11px}.btn-link{color:var(--ui-accent);text-decoration:none;background:transparent;border:0}.btn-link:hover{text-decoration:underline}.btn:focus-visible,.form-control:focus,.form-select:focus{box-shadow:0 0 0 3px #28744c1c!important;outline:0!important;border-color:#679b79}.btn-group>.btn{border-radius:0!important}.btn-group>.btn:first-child{border-radius:7px 0 0 7px!important}.btn-group>.btn:last-child{border-radius:0 7px 7px 0!important}.form-control,.form-select{color:var(--ink);background-color:var(--ui-surface);border:1px solid var(--ui-line);border-radius:7px!important;font-size:13px;padding:9px 12px;min-height:40px;max-width:100%;box-shadow:none}.form-select{padding-right:32px}.form-check-input{width:16px;height:16px;min-height:0;margin:0 6px 0 0;vertical-align:middle;flex:0 0 16px}.form-check-input:checked{background-color:var(--ui-accent);border-color:var(--ui-accent)}label{font-size:12px;color:#617367;gap:7px}.form-grid{gap:16px 20px!important}.form-grid label{min-width:0}.form-grid .full{grid-column:1/-1}textarea.form-control{min-height:100px}input[type=file]{font-size:12px;padding:8px;overflow:hidden}input[type=range]{max-width:100%}fieldset{border:1px solid var(--ui-line)!important;border-radius:9px;padding:14px!important}legend{float:none;width:auto;padding:0 6px;font-size:12px}.description,.hint{font-size:12px!important;line-height:1.8!important;color:var(--ui-muted)!important}p{overflow-wrap:anywhere}code{color:#3b6755;font-size:12px}.table{font-size:12px;--bs-table-bg: transparent}.table td,.table th{padding:12px!important;border-color:var(--ui-line)}.table-wrap{overflow:auto;border-radius:8px;border:1px solid var(--ui-line)}.panel,.site-card,.card,.camera-card,.person-card{background:var(--ui-surface)!important;border:1px solid var(--ui-line)!important;border-radius:11px!important;box-shadow:0 3px 12px #193c3204!important;overflow:hidden}.panel{padding:22px!important;margin-bottom:18px}.site-card{padding:22px!important}.card-body{padding:20px}.card-footer{background:transparent;border-top:1px solid var(--ui-line);padding:12px 18px}.section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px!important}.section-head h2 small,.section-head h3 small{display:none}.badge{font-size:10px;line-height:1.4;font-weight:500!important;letter-spacing:0!important;background:#edf4ee!important;color:#3c7056!important;border:1px solid #d6e6d9!important;border-radius:5px!important;padding:5px 8px!important}.badge.off{background:#f7eeea!important;border-color:#ecd9d0!important;color:#a66044!important}.count-pill{display:inline-block;padding:2px 7px;background:#e6ede8;color:#4b705b;border-radius:5px;font-size:11px;vertical-align:middle;margin-left:7px}.group-title{font-size:13px!important;color:#6a7c70;margin:24px 0 12px!important;display:flex;gap:5px;align-items:center}.site-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.household-context{padding:12px 16px!important;border-radius:9px!important;background:#eaf0eb!important;border:1px solid var(--ui-line);gap:12px;display:flex;align-items:center;flex-wrap:wrap;margin-bottom:18px!important}.household-context label{display:flex;align-items:center;gap:10px;margin:0}.household-context select{width:auto;max-width:260px;min-height:34px;padding-top:6px;padding-bottom:6px}.household-context span{font-size:11px;color:var(--ui-muted)}#scope-back{margin-left:auto}.device-context{border-radius:9px;background:#eaf0eb!important;padding:16px!important;margin-bottom:18px}.device-context p{font-size:12px;margin:0 0 10px}.device-context .btn.active{background:var(--ui-accent)!important;color:#fff!important}.filter-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 18px;padding:0!important;font-size:12px}.filter-row label{display:flex;align-items:center;gap:8px;margin:0}.filter-row select{width:180px}.filter-row>button{margin-left:auto}.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:0 0 22px!important;padding:0!important;background:none!important;border:0!important}.metrics>div{background:var(--ui-surface);border:1px solid var(--ui-line);border-radius:9px;padding:14px 18px!important;display:flex;justify-content:space-between;align-items:center;border-right:1px solid var(--ui-line)!important}.metrics span{font-size:11px;color:var(--ui-muted)}.metrics strong{font-family:inherit;font-size:23px!important;font-weight:600;color:var(--ui-accent)}.home-toolbar{display:flex;gap:16px;flex-wrap:wrap;align-items:center;padding:13px 0;margin:0 0 7px;border-top:1px solid var(--ui-line);border-bottom:1px solid var(--ui-line)}.home-layout-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-left:auto}.home-layout-controls label{display:flex;align-items:center;gap:7px;margin:0}.home-layout-controls select{width:80px!important;min-height:34px;padding-top:5px;padding-bottom:5px}.home-layout-controls>.form-select{width:80px!important}.inline-check{white-space:nowrap;font-size:11px}#home-layout-status{margin-bottom:18px;font-size:11px!important}.home-card-grid{display:grid!important;grid-template-columns:repeat(var(--home-columns, 2),minmax(0,1fr));gap:20px!important}.home-city-group{display:block}.home-card{padding:0!important;margin:0!important;min-width:0;align-self:start}.home-cover{position:relative;height:178px!important;min-height:178px!important;background:linear-gradient(135deg,#567d65,#203e36)!important;overflow:hidden}.home-cover img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.cover-shade{position:absolute;inset:0;background:linear-gradient(180deg,#132e2430 10%,#0e261ccc)}.home-cover-content{position:relative;z-index:1;height:100%;padding:17px 20px!important;display:flex;flex-direction:column;justify-content:space-between;background:none!important}.home-cover-content h3{font-family:inherit!important;font-size:21px!important;color:#fff!important;margin:0 0 6px!important;letter-spacing:0}.home-cover-content .badge{background:#ffffffd9!important;color:#244d3a!important;border-color:transparent!important;font-size:10px}.home-location{font-size:11px!important;color:#e8f0eb!important;line-height:1.6;margin:0!important}.cover-edit{color:#fff!important;background:#213e3670!important;border:1px solid #ffffff60!important;backdrop-filter:blur(8px)}.home-summary{font-size:12px;color:var(--ui-muted);margin-bottom:15px;min-height:20px}.home-numbers{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;padding:0 0 17px;border-bottom:1px solid var(--ui-line);margin-bottom:13px}.home-numbers span{display:flex;align-items:baseline;gap:7px;color:var(--ui-muted);font-size:11px}.home-numbers b{font-size:21px;font-weight:600;color:var(--ink)}.compact-details{margin:0!important;display:grid;gap:7px!important;font-size:12px}.compact-details>div{display:grid;grid-template-columns:100px minmax(0,1fr);gap:12px!important;padding:0!important}.compact-details dt{font-weight:400;color:var(--ui-muted)}.compact-details dd{margin:0;overflow-wrap:anywhere;color:var(--ink)}.home-card-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:17px;padding-top:14px;border-top:1px solid var(--ui-line)}.home-card-actions .btn-primary{flex:1}.home-order-actions{display:flex;align-items:center;gap:5px;margin-bottom:12px}.home-order-actions span{font-size:10px;flex:1}.home-pagination{display:flex;justify-content:flex-end;align-items:center;gap:10px;margin:22px 0}.home-pagination span{margin-right:auto;font-size:11px;color:var(--ui-muted)}.device-card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,330px),1fr));gap:18px}.device-card{min-width:0}.device-card-heading{display:flex;align-items:center;gap:12px;margin-bottom:15px}.device-symbol{width:42px;height:42px;border-radius:10px;background:#eaf2ec;color:var(--ui-accent);display:grid;place-items:center}.device-symbol .app-icon{width:23px;height:23px}.device-card-heading h3{margin:0!important;font-size:16px!important}.device-title{padding:0!important;border:0!important;background:none!important;text-align:left!important;min-height:0!important;color:var(--ink)!important;font-weight:600!important;font-size:16px!important;box-shadow:none!important}.device-title:hover{color:var(--ui-accent)!important;text-decoration:underline}.device-location{font-size:11px;color:var(--ui-muted);margin-bottom:15px}.device-card-actions{display:flex;flex-wrap:wrap;gap:8px}.device-tags{display:flex;flex-wrap:wrap;gap:5px;margin:12px 0 0}.device-tags span{background:#edf1ee;font-size:10px;color:#667e6d;padding:2px 8px;border-radius:4px}.device-view-controls{display:flex;flex-wrap:wrap;gap:12px}.device-view-controls label{display:flex;align-items:center;gap:9px}.group-custom{font-size:12px}.group-step{max-width:100%}.group-step select{max-width:200px}.view-presets{display:flex;gap:6px;flex-wrap:wrap}#device-count{font-size:11px!important}.device-group:first-child>.group-title{margin-top:4px!important}#asset-list .empty{min-height:160px}.device-tags+.network-status-block{margin-top:12px}.network-status-block{padding-top:12px;margin-top:14px;border-top:1px solid var(--ui-line);font-size:11px}.network-status-title{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}.network-status-title>span{font-weight:600}.status-dot{width:7px;height:7px;border-radius:50%;background:#b4b9b5;display:inline-block;margin-right:6px}.status-dot.online{background:#37a06a;box-shadow:0 0 0 3px #38a16a12}.network-target{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin:4px 0}.network-target>span:first-child{width:65px;color:var(--ui-muted)}.network-target code{font-size:11px}.network-target>span:last-child{margin-left:auto;font-size:10px}.network-status-block p{margin:6px 0;font-size:11px!important}.management-links{display:flex;gap:6px;flex-wrap:wrap;margin:9px 0}.network-check-time{font-size:10px;color:#8b9c90;line-height:1.5;display:block}.network-platform{display:flex;align-items:center;gap:15px;background:#edf3ee;border:1px solid #d6e4d9;padding:20px;border-radius:10px;margin-bottom:16px}.network-platform>.app-icon{width:32px;height:32px;flex-basis:32px;color:var(--ui-accent)}.network-platform h3{margin:0 0 3px!important;font-size:18px!important}.network-platform p{margin:0;font-size:11px;color:var(--ui-muted)}.platform-place-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:18px}.platform-place-node{display:flex!important;flex-direction:column;align-items:flex-start!important;text-align:left!important;padding:20px!important;gap:9px;border:1px solid var(--ui-line)!important;position:relative;color:var(--ink)!important}.platform-place-node:hover{border-color:#81ad90!important;box-shadow:0 4px 16px #2d4b3610!important}.platform-place-node h3{font-size:17px!important;margin:3px 0}.platform-place-node p,.platform-place-node small{font-size:11px;color:var(--ui-muted);margin:0}.network-open{padding-top:12px;margin-top:auto;color:var(--ui-accent);font-size:11px}.network-node{margin:0 0 14px calc(var(--depth) * 22px);overflow:visible!important;position:relative}.network-node.nested:before{position:absolute;content:"";border-left:2px solid #c1d3c6;border-bottom:2px solid #c1d3c6;width:15px;left:-17px;top:-15px;height:50px;border-bottom-left-radius:6px}.network-node .card-body{padding:18px}.network-node .device-card-heading{margin-bottom:9px}.network-facts{display:flex;flex-wrap:wrap;gap:8px 24px;font-size:11px;color:var(--ui-muted)}.network-facts b{font-weight:500;color:var(--ink);margin-left:7px;overflow-wrap:anywhere}.network-map{overflow:hidden}.network-map .network-platform{max-width:none}.network-overview{margin-top:18px}.scope-intro{padding:0!important;margin-bottom:24px!important}.scope-intro h2{font-size:24px!important}.scope-intro p{font-size:13px!important;color:var(--ui-muted)}.steward-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:18px}.steward-tile{padding:22px!important;min-height:160px!important;background:var(--ui-surface)!important;border:1px solid var(--ui-line)!important;border-radius:10px!important;text-align:left!important;display:flex;align-items:flex-start!important;flex-direction:column;justify-content:flex-start!important;gap:10px;color:var(--ink)!important;box-shadow:none!important}.steward-tile:before{display:none!important}.steward-tile:hover{border-color:#8caf99!important;background:#f9fcf9!important;transform:translateY(-1px)}.steward-tile strong{font-family:inherit!important;font-size:19px!important;font-weight:600!important}.steward-tile span{font-size:12px!important}.steward-tile small{font-size:11px!important;color:var(--ui-muted);line-height:1.8}.camera-meta{padding:16px!important}.camera-meta strong{font-size:14px!important}.camera-meta p{font-size:11px!important;margin:4px 0!important}.camera-actions{padding:0 16px 16px;display:flex;flex-wrap:wrap;gap:7px}.camera-card{background:var(--ui-surface)!important}.live-grid{gap:18px}.video-panel{background:#152720!important}.video-error{font-size:12px}.video-empty{color:#9bad9f}.wall-toolbar{padding:12px!important;border-radius:9px;gap:10px}.wall-toolbar label{font-size:11px}.wall-toolbar select{width:auto}#live-stage:fullscreen{background:#101c17}.wall-fullscreen .camera-card{border-color:#284336!important}.playback-panel{background:var(--ui-surface)!important}.settings-sections{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:20px}.settings-sections .btn[aria-pressed=true]{background:var(--ui-accent)!important;color:#fff!important}.journal-card{max-width:100%!important;background:var(--ui-surface)!important;border-radius:11px!important;padding:22px!important;border:1px solid var(--ui-line)!important}.journal-attachments{gap:14px}.journal-attachments img{border-radius:8px}.journal-media-library{max-width:100%}.journal-pager{font-size:12px}.family-toolbar{flex-wrap:wrap}.family-card,.person-card{padding:16px}.family-detail h2{font-size:20px!important}dialog{max-width:min(900px,calc(100vw - 32px))!important;width:800px;padding:26px!important;border:1px solid var(--ui-line)!important;border-radius:14px!important;background:var(--ui-surface)!important;color:var(--ink)!important;box-shadow:0 24px 80px #0f2d3d38!important;max-height:calc(100dvh - 48px);overflow:auto;margin:auto!important}dialog::backdrop{background:#10291e70;backdrop-filter:blur(3px)}dialog h2{font-size:21px!important}dialog .dialog-heading,dialog>header,dialog form>header{padding:0 0 18px!important;margin:0 0 20px!important;border-bottom:1px solid var(--ui-line);display:flex;align-items:center;justify-content:space-between;gap:15px;background:none}dialog form>.form-grid{margin-top:5px}dialog footer,dialog .dialog-actions{padding:18px 0 0!important;margin:20px 0 0!important;border-top:1px solid var(--ui-line);display:flex;justify-content:flex-end;gap:10px}#auth-dialog{width:420px!important;padding:32px!important}#auth-dialog h2{font-size:25px!important}#auth-dialog p{font-size:12px}#auth-form{display:grid;gap:15px}#auth-form label{margin:0}.form-error{font-size:12px;color:#b15a3c;min-height:0}#toast{position:fixed;bottom:24px;right:24px;z-index:200;background:#234c39!important;color:#fff!important;padding:12px 20px!important;border-radius:9px!important;font-size:13px!important;box-shadow:0 6px 22px #193c3226;max-width:calc(100vw - 32px)}main>footer{padding:22px 0 0!important;margin:30px 0 0!important;border-top:1px solid var(--ui-line);font-size:10px!important;color:var(--ui-muted)}.empty{border:1px dashed #cfdbd2;background:#f8faf8;border-radius:9px;color:var(--ui-muted);text-align:center;padding:40px 20px!important}.empty h3{margin-top:10px}.empty p{font-size:12px}.banner{padding:12px 16px;border-radius:8px;font-size:12px}html[data-theme=clean]{--ui-bg: #f4f6f9;--ui-accent: #31655b;--ui-surface: #fff}html[data-theme=ink]{--ui-bg: #14221e;--ui-surface: #1c2e26;--ui-line: #334a3e;--ui-muted: #a5baad;--ink: #e1ece5;--bs-body-color: #e1ece5;--bs-border-color: #334a3e;--ui-accent: #397359;--bs-secondary-color: #a5baad}html[data-theme=ink] .form-control,html[data-theme=ink] .form-select{background-color:#20352a;color:#e1ece5}html[data-theme=ink] .network-platform,html[data-theme=ink] .household-context,html[data-theme=ink] .device-context,html[data-theme=ink] .empty{background:#213d2d!important}html[data-theme=ink] .description,html[data-theme=ink] label{color:#a5baad!important}html[data-theme=ink] .btn-outline-secondary{color:#b9cec0;border-color:#476152}html[data-density=compact] #app>main{padding:20px 25px!important}html[data-density=compact] .panel,html[data-density=compact] .card-body{padding:15px!important}html[data-density=compact] .home-cover{height:150px!important;min-height:150px!important}html[data-layout=top] #app{display:block}html[data-layout=top] .sidebar{position:relative!important;width:100%!important;height:auto;padding:12px 24px!important;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:12px}html[data-layout=top] .sidebar .brand{padding:0 15px 0 0!important;margin:0!important;border:0!important}html[data-layout=top] .sidebar>.nav-label,html[data-layout=top] .side-note,html[data-layout=top] #current-user,html[data-layout=top] #scope-nav-name{display:none}html[data-layout=top] .sidebar nav{flex-direction:row!important;flex:1;flex-wrap:wrap}html[data-layout=top] #scope-navigation{display:flex;padding:0!important;margin:0!important;box-shadow:none}html[data-layout=top] .sidebar nav button{width:auto!important;padding:8px 10px!important}html[data-layout=top] #app>main{margin:auto!important;max-width:1800px}@media(min-width:1500px){.home-card-grid[style]{gap:22px}}@media(max-width:1200px){#app>main{padding:24px!important}#app{grid-template-columns:210px minmax(0,1fr)}.sidebar{width:210px!important;padding:24px 14px!important}.home-toolbar{align-items:flex-start}.home-layout-controls{margin-left:0}.home-card-grid{grid-template-columns:repeat(min(var(--home-columns, 2),2),minmax(0,1fr))}.metrics>div{padding:12px!important}.metrics strong{font-size:19px!important}.compact-details>div{grid-template-columns:90px minmax(0,1fr)}}@media(max-width:767px){html,body{font-size:14px}#app{display:block!important}.sidebar,html[data-layout=top] .sidebar{position:relative!important;width:100%!important;height:auto!important;padding:13px 16px!important;display:grid!important;grid-template-columns:1fr auto!important;overflow:visible!important}.brand,html[data-layout=top] .sidebar .brand{padding:0!important;margin:0!important;border:0!important;gap:10px}.brand-icon{width:34px!important;height:34px!important}.brand>span>span{font-size:19px!important}.brand small{font-size:9px!important;margin-top:2px}.sidebar>.nav-label,.side-note,#current-user,.sidebar>#account-password,.sidebar>#logout{display:none!important}.mobile-nav-toggle{display:flex!important;color:#e8f1ec!important;border:1px solid #ffffff30!important;background:transparent!important;font-size:12px;min-height:36px}.sidebar nav,html[data-layout=top] .sidebar nav{display:none!important;grid-column:1/-1}.sidebar.mobile-open nav,html[data-layout=top] .sidebar.mobile-open nav{display:flex!important;flex-direction:column!important;margin-top:15px}.sidebar.mobile-open>#account-password,.sidebar.mobile-open>#logout{display:block!important}.sidebar.mobile-open>#current-user{display:block!important;grid-column:1/-1}.sidebar.mobile-open>#account-password{grid-column:1}.sidebar.mobile-open>#logout{grid-column:2}html[data-layout=top] #scope-navigation{display:block}.sidebar nav button{width:100%!important}.sidebar #scope-navigation{padding:14px 0!important}#app>main,html[data-density=compact] #app>main{padding:20px 15px!important;min-height:calc(100vh - 65px);width:100%!important}main>header{gap:12px;align-items:flex-start;margin-bottom:20px!important;padding-bottom:18px!important}#page-title{font-size:22px!important}#page-note{font-size:11px!important}.eyebrow{font-size:9px;margin-bottom:5px;letter-spacing:1px}.header-status{font-size:9px!important;gap:5px;max-width:100px;white-space:normal;text-align:right}#service-status{font-size:9px!important;padding:4px 6px!important}#clock{font-size:9px}.section-head{gap:12px;align-items:flex-start;flex-wrap:wrap}.section-head>.btn{margin-left:0;font-size:11px}h2{font-size:17px!important}.home-toolbar{gap:13px}.home-layout-controls{gap:9px;width:100%;font-size:11px}.home-layout-controls .form-select{min-height:32px;font-size:11px}.home-layout-controls .btn{font-size:11px;min-height:32px}.home-card-grid{grid-template-columns:minmax(0,1fr)!important;gap:17px!important}.home-cover{height:170px!important;min-height:170px!important}.home-cover-content{padding:16px 18px!important}.card-body{padding:17px}.home-numbers b{font-size:21px}.home-pagination{flex-wrap:wrap}.home-pagination span{width:100%}.home-pagination .btn{flex:1}.household-context{padding:10px!important;gap:9px}.household-context label{width:100%}.household-context select{max-width:none;flex:1;min-width:0}#household-context-note{display:none}#scope-back{width:100%;margin:0}.metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.metrics>div{padding:11px 13px!important}.metrics strong{font-size:20px!important}.filter-row{gap:9px}.filter-row label{flex:1;min-width:0}.filter-row select{width:100%;min-width:0}#filter-caption{display:none}.filter-row>button{font-size:11px}.panel{padding:17px!important}.form-grid{grid-template-columns:minmax(0,1fr)!important;gap:14px!important}.form-grid>*{min-width:0;grid-column:auto}.form-grid .full{grid-column:1}.site-grid,.steward-grid,.platform-place-grid,.device-card-grid{grid-template-columns:minmax(0,1fr)!important}.device-view-controls{display:flex;flex-direction:column;align-items:stretch}.device-view-controls label{width:100%}.device-view-controls input,.device-view-controls select{width:100%;min-width:0}.network-node{margin-left:calc(min(var(--depth),2)*12px)}.network-node.nested:before{left:-10px;width:8px}.network-node .card-body{padding:14px}.network-facts{display:grid;gap:6px}.network-platform{padding:16px}.network-platform h3{font-size:16px!important}.network-target{font-size:10px}.network-target code{font-size:10px;word-break:break-all}.management-links a{max-width:100%;font-size:10px}.network-node .device-card-heading h3,.network-node .device-title{font-size:14px!important}.device-context [role=group]{display:flex;flex-wrap:wrap;gap:7px}.device-context .btn{flex:1;min-width:100px;font-size:11px}.steward-tile{min-height:145px!important}.steward-tile strong{font-size:18px!important}.journal-card{padding:17px!important}.journal-attachments{grid-template-columns:minmax(0,1fr)!important}.journal-attachments audio,.journal-attachments video{width:100%;max-width:100%}.journal-upload-controls{display:flex;flex-wrap:wrap}.journal-upload-controls>*{max-width:100%}.settings-sections{gap:6px}.settings-sections .btn{flex:1;min-width:calc(50% - 6px);font-size:11px}dialog{max-width:calc(100vw - 20px)!important;padding:20px!important;max-height:calc(100dvh - 20px);border-radius:12px!important}dialog h2{font-size:19px!important}dialog .dialog-heading{padding-bottom:14px!important;margin-bottom:16px!important}dialog .dialog-heading .btn{min-width:54px}#auth-dialog{padding:25px!important}.brand-image-grid{grid-template-columns:1fr!important}#toast{bottom:16px;right:16px;font-size:12px!important}.wall-toolbar{gap:7px}.wall-toolbar label{width:auto}.table-wrap{max-width:100%}main>footer{font-size:9px!important;gap:10px;flex-wrap:wrap}.network-node .device-card-heading>.btn{font-size:10px;min-height:28px;padding:3px 7px}html[data-layout=top] .sidebar.mobile-open nav button{width:100%!important}}@media(min-width:768px){.sidebar>.mobile-nav-toggle{display:none!important}}.sidebar nav button{justify-content:flex-start!important}.sidebar nav button.active:after{display:none!important}.section-head>div:first-child{display:block}.inline-check .form-check-input{width:16px!important;height:16px!important;min-height:0!important;padding:0!important}.form-check-input{padding:0!important}.dialog-footer{display:flex;justify-content:flex-end;gap:10px;margin-top:20px;padding-top:18px;border-top:1px solid var(--ui-line)}html[data-font=serif] #page-title,html[data-font=serif] .scope-intro h2{font-family:"Noto Serif SC",Songti SC,SimSun,serif!important;font-weight:600!important}.live-help{margin:10px 0;color:var(--ui-muted);font-size:13px}.live-help summary{cursor:pointer;padding:8px 0}.live-help p{margin:8px 0}#page-live.wall-expanded{position:fixed;inset:0;z-index:10000;margin:0}#page-live:is(:fullscreen,.wall-expanded)>.live-help{display:none}#page-live:is(:fullscreen,.wall-expanded) .live-grid[data-visible-count="1"]{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}.leadership-member-actions .btn{white-space:normal}#leadership-grant{align-items:flex-start;padding:14px}#leadership-grant span{line-height:1.7}@media(max-width:767px){#app>main{padding-bottom:max(20px,env(safe-area-inset-bottom))!important}main[data-page=live]>header{margin-bottom:12px!important;padding-bottom:12px!important}main[data-page=live]>header .eyebrow,main[data-page=live] #page-note,main[data-page=live]>.metrics{display:none!important}main[data-page=live] .household-context{margin-bottom:12px;flex-wrap:nowrap}main[data-page=live] .household-context label{flex:1;width:auto;font-size:0}main[data-page=live] .household-context select{font-size:16px;width:100%}main[data-page=live] #scope-back{width:auto;min-width:82px}main[data-page=live]>.filter-row{margin:12px 0}#page-live:not([hidden]){display:flex;flex-direction:column}#page-live>.section-head{order:0;margin:6px 0 12px}#page-live>.live-grid{order:1}#page-live>.wall-toolbar{order:2}#page-live>.live-help{order:3}#page-live:not(:fullscreen):not(.wall-expanded) .live-grid[data-layout=auto]{grid-template-columns:minmax(0,1fr)}.camera-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:0 12px 12px}.camera-actions .btn{min-height:44px;white-space:normal;font-size:13px}.camera-meta{padding:12px}.camera-meta strong{font-size:15px!important}.wall-toolbar .wall-paging{flex:1;justify-content:space-between}.wall-toolbar .btn{min-width:44px;min-height:44px}#page-live:is(:fullscreen,.wall-expanded){padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}#page-live:is(:fullscreen,.wall-expanded)>.wall-toolbar{order:0}#page-live:is(:fullscreen,.wall-expanded) .live-grid[data-layout=auto]{grid-template-columns:repeat(2,minmax(0,1fr))}#page-live:is(:fullscreen,.wall-expanded) .live-grid[data-visible-count="1"]{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}#page-live:is(:fullscreen,.wall-expanded) .camera-actions{display:none}.network-target{display:grid;grid-template-columns:76px minmax(0,1fr) auto;font-size:12px;gap:8px}.network-target code{font-size:13px!important}.network-check-time{font-size:12px;line-height:1.7}.management-links{display:grid;grid-template-columns:minmax(0,1fr)}.management-links .btn{min-height:44px!important;font-size:13px!important;white-space:normal}dialog .description,dialog label{font-size:14px!important}dialog .dialog-footer{position:sticky;bottom:-20px;background:var(--ui-surface);padding:14px 0;margin-bottom:-10px}dialog .dialog-footer .btn{flex:1;min-height:44px;white-space:normal}.leadership-member-actions .btn{flex:1;min-width:120px}#leadership-grant{display:flex;gap:10px}#leadership-grant[hidden]{display:none}}html[data-backdrop=mountains] #app>main{background-image:linear-gradient(150deg,transparent 70%,#8ba58f08 70%,transparent 85%),linear-gradient(170deg,transparent 60%,#8ba58f06 60%,transparent 90%)!important;background-size:100% 360px!important;background-repeat:no-repeat!important}@media(max-width:767px){.form-control,.form-select{font-size:16px!important;min-height:44px}.btn{min-height:42px;font-size:13px}.home-layout-controls .form-select{font-size:14px!important;min-height:40px}.home-layout-controls .btn,.network-status-title .btn,.management-links .btn{min-height:40px;font-size:12px}.network-target code{font-size:12px}.mobile-nav-toggle{min-height:42px}.device-card-actions .btn{min-height:42px;font-size:12px}}:root{--ui-bg: #f3f6fa;--ui-surface: #fff;--ui-line: #e3e9ef;--ui-muted: #5e6f7e;--ui-sidebar: #172e35;--ui-accent: #217964;--ink: #253b46;--muted: #5e6f7e;--paper: var(--ui-surface);--line: var(--ui-line);--green: var(--ui-accent);--bs-primary: #217964;--bs-primary-rgb: 33, 121, 100;--bs-body-color: var(--ink);--bs-body-bg: var(--ui-bg);--bs-border-color: var(--ui-line);--ui-shadow: 0 3px 16px #223d5010;--ui-soft: #f5f8fa}html[data-theme=paper]{--ui-bg: #f5f6f4;--ui-soft: #f5f7f3}html[data-theme=clean]{--ui-bg: #f1f5f9;--ui-soft: #f4f7fb}html[data-theme=ink]{--ui-bg: #111e26;--ui-surface: #1a2b35;--ui-line: #30444e;--ui-soft: #21353f;--ink: #e0ecef;--ui-muted: #a8bdc5;--muted: #a8bdc5;--ui-shadow: 0 3px 16px #0002;--paper: #1a2b35;--line: #30444e}html,body{min-width:0}body{-webkit-font-smoothing:antialiased}#app>main{max-width:2000px;padding:30px 38px 24px!important}main>header{margin-bottom:26px!important;padding-bottom:24px!important}#page-title{font-size:clamp(24px,2.3vw,32px)!important;letter-spacing:-.7px!important}html[data-font=serif] #page-title{font-weight:600!important}#brand-motto{color:var(--ui-accent)!important;letter-spacing:2.4px}#page-note{font-size:13px!important}.header-status{gap:9px}#clock{font-variant-numeric:tabular-nums;font-size:11px}#service-status{padding:6px 10px;border-radius:20px!important}.sidebar{background:linear-gradient(165deg,#1d3940,#152b32 70%)!important}.brand{padding-bottom:26px!important}.brand-icon{width:46px!important;height:46px!important;box-shadow:0 3px 12px #071d2860}.sidebar nav button{border-radius:10px!important;min-height:46px;transition:background .15s,color .15s}.sidebar nav button.active{background:#e1f2eb!important;color:#155b48!important;box-shadow:0 2px 7px #0002!important}.sidebar nav button.active .app-icon{opacity:1}.sidebar #current-user{padding:14px 9px 2px}.section-head{align-items:center;margin-bottom:18px}.section-head h2{font-size:21px!important}.count-pill{background:#e7f0ec;color:#286752;border:0;border-radius:7px;padding:3px 9px;font-size:12px}.btn{border-radius:9px!important;min-height:38px;padding:8px 14px;transition:background .15s,border-color .15s,box-shadow .15s}.btn-primary{--bs-btn-bg: var(--ui-accent);--bs-btn-border-color: var(--ui-accent);box-shadow:0 3px 8px #21796416}.btn-primary:hover{box-shadow:0 4px 12px #21796428}.btn-outline-secondary{--bs-btn-color: var(--ink);--bs-btn-border-color: var(--ui-line);background:var(--ui-surface)}.btn-link{color:var(--ui-accent)}html:is([data-theme=clean],[data-theme=ink]) :is(main,dialog) .btn-primary:not(.steward-tile):not(.device-title):not(.platform-place-node){background:var(--ui-accent)!important;color:#fff!important;border-color:var(--ui-accent)!important}html:is([data-theme=clean],[data-theme=ink]) :is(main,dialog) .btn-outline-secondary{background:var(--ui-surface)!important;color:var(--ink)!important}html:is([data-theme=clean],[data-theme=ink]) :is(main,dialog) .btn-outline-secondary:is(.active,[aria-pressed=true]){background:var(--ui-soft)!important;border-color:#629987!important}html:is([data-theme=clean],[data-theme=ink]) .btn-link{background:transparent!important;color:var(--ink)!important}html[data-theme=ink] #brand-motto{color:#a7d7c4!important}.btn:focus-visible,button:focus-visible,a:focus-visible{outline:3px solid #529cce;outline-offset:3px}.form-control,.form-select{border-radius:9px!important;border-color:var(--ui-line)!important;min-height:40px;background-color:var(--ui-surface);color:var(--ink)}.form-control:focus,.form-select:focus{border-color:#51a18b!important;box-shadow:0 0 0 3px #21856819!important}.card,.panel{border:1px solid var(--ui-line)!important;border-radius:14px!important;background:var(--ui-surface);box-shadow:var(--ui-shadow)!important}.card{overflow:hidden}.card-body{padding:24px}dialog{border-radius:16px!important;box-shadow:0 24px 100px #10293040!important}dialog::backdrop{background:#132a3670;backdrop-filter:blur(4px)}dialog h2{font-size:22px!important}.household-context,.device-context{border:1px solid var(--ui-line)!important;background:var(--ui-surface)!important;border-radius:12px;box-shadow:var(--ui-shadow)}.home-insights{display:grid;grid-template-columns:1.4fr .7fr 1fr;gap:18px;margin:22px 0 26px}.home-insights>article{border-radius:15px;padding:24px;min-width:0}.insight-welcome{position:relative;overflow:hidden;color:#fff;background:linear-gradient(115deg,#20534d,#297562);box-shadow:0 6px 22px #21594c1c}.insight-welcome:after{content:"";position:absolute;right:-28px;bottom:-64px;width:200px;height:200px;border:32px solid #fff07;border-radius:50%;pointer-events:none}.insight-kicker{color:#cae4d9;font-size:10px;letter-spacing:2px}.insight-welcome h2{color:#fff!important;font-size:23px!important;margin:14px 0 8px!important}.insight-welcome p{color:#d0e7df;font-size:12px;margin-bottom:22px}.insight-scope{display:flex;gap:7px;align-items:center;color:#d7ebe4;font-size:10px}.insight-scope .app-icon{width:15px;height:15px;flex-basis:15px}.insight-number,.insight-distribution{background:var(--ui-surface);border:1px solid var(--ui-line);box-shadow:var(--ui-shadow)}.insight-number{position:relative;display:flex;flex-direction:column;justify-content:center}.insight-icon{position:absolute;right:20px;top:22px;width:36px;height:36px;display:grid;place-items:center;background:#e8f1fb;color:#527ec0;border-radius:11px}.insight-label{color:var(--ui-muted);font-size:12px;padding-right:35px}.insight-number>strong{font-size:40px;line-height:1.3;font-weight:650;margin:10px 0;color:var(--ink);font-variant-numeric:tabular-nums}.insight-number strong small{font-size:12px;font-weight:400;margin-left:10px;color:var(--ui-muted)}.insight-foot{color:var(--ui-muted);font-size:11px}.insight-distribution{display:flex;align-items:center;justify-content:center;gap:20px}.insight-donut{width:126px;flex:0 0 126px;position:relative}.insight-donut svg{width:100%;display:block}.donut-track{stroke:var(--ui-line)}.insight-donut>div{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none}.insight-donut strong{font-size:28px;line-height:1.3}.insight-donut small{font-size:10px;color:var(--ui-muted)}.insight-legend{flex:1;min-width:60px;max-width:145px}.insight-legend h3{font-size:12px!important;margin-bottom:13px;white-space:nowrap}.insight-legend>span{display:flex;align-items:center;gap:7px;font-size:11px;margin-top:7px;color:var(--ui-muted)}.insight-legend i{width:7px;height:7px;border-radius:2px;flex-shrink:0}.insight-legend b{margin-left:auto;color:var(--ink)}.home-toolbar{padding:13px 16px;border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-surface);gap:14px}.home-layout-toggle{display:none}#home-layout-status{margin:10px 3px 18px;font-size:11px}.home-card-grid{gap:24px}.home-card{transition:box-shadow .18s,border-color .18s}.home-card:hover{box-shadow:0 8px 26px #223d5019!important;border-color:#b4cac0!important}.home-cover{height:220px;background:linear-gradient(120deg,#35595b,#193a40)}.home-cover .cover-shade{background:linear-gradient(180deg,#142b3830,#10282b05 30%,#0a232bcc)}.home-cover-content{padding:22px 25px}.home-cover-content h3{font-size:24px!important;font-weight:600!important;letter-spacing:.5px!important}.home-cover-content .badge{border:1px solid #ffffff38;background:#f6fffaed!important;color:#27594a!important;border-radius:6px!important;font-size:11px}.home-location{font-size:11px;color:#ebf3f0}.cover-edit{background:#142a3560!important;border:1px solid #ffffff80!important;color:#fff!important;backdrop-filter:blur(4px)}.home-summary{color:var(--ui-muted);font-size:12px}.home-numbers{background:var(--ui-soft);border:0;border-radius:10px;padding:14px 0;margin:16px 0 20px}.home-numbers span{border-right:1px solid var(--ui-line);color:var(--ui-muted);font-size:11px}.home-numbers span:last-child{border:0}.home-numbers b{font-size:24px;color:var(--ink)}.home-card-actions{border-top:1px solid var(--ui-line);padding-top:18px;margin-top:18px}.compact-details dt{color:var(--ui-muted)}.compact-details dd{color:var(--ink)}.home-pagination{margin-top:24px;font-size:11px}.metrics{gap:16px}.metrics>div{border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-surface);box-shadow:var(--ui-shadow);border-top:3px solid #438979}.metrics>div:nth-child(2){border-top-color:#658cd1}.metrics>div:nth-child(3){border-top-color:#b69c70}.metrics>div:nth-child(4){border-top-color:#8391b5}.metrics strong{font-variant-numeric:tabular-nums;color:var(--ink)}.device-card-heading .device-symbol{background:#e9f3ef;color:#287e65;border-radius:12px;width:44px;height:44px}.device-card .card-footer{border-top:1px solid var(--ui-line);background:var(--ui-soft);padding:14px 22px}.device-card-grid{gap:20px}.device-view-controls{padding:20px 24px}.device-search-row{border-bottom:1px solid var(--ui-line);padding-bottom:18px;margin-bottom:15px}.group-title{margin:24px 0 14px}.device-location{color:var(--ui-muted)}.network-map{padding:24px}.network-platform{background:var(--ui-soft);border:1px solid var(--ui-line);border-radius:12px;padding:20px}.network-platform>.app-icon{width:30px;height:30px;flex-basis:30px;color:var(--ui-accent)}.network-diagram{margin:20px 0 28px;border:1px solid var(--ui-line);border-radius:12px;overflow:hidden}.diagram-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px 18px;background:var(--ui-surface)}.diagram-toolbar>div{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.diagram-toolbar strong{font-size:13px}.diagram-dot{width:7px;height:7px;border-radius:50%;background:#4d8dbe}.diagram-toolbar label{display:flex;align-items:center;gap:8px;font-size:11px;margin:0}.diagram-toolbar select{width:86px}.diagram-scroll{max-height:480px;overflow:auto;background-color:var(--ui-soft);background-image:radial-gradient(var(--ui-line) 1px,transparent 1px);background-size:18px 18px;border-block:1px solid var(--ui-line)}.network-svg{display:block}.network-edge{stroke:#82a79c;stroke-width:2}.diagram-node{cursor:pointer;outline:none}.diagram-node-bg{fill:var(--ui-surface);stroke:var(--ui-line);stroke-width:1.5}.diagram-node:hover .diagram-node-bg,.diagram-node:focus .diagram-node-bg{stroke:#328d78;stroke-width:2.5}.diagram-node-type{fill:var(--ui-muted);font-size:10px}.diagram-node-title{fill:var(--ink);font-size:14px;font-weight:600}.diagram-node-ip{fill:var(--ui-muted);font-size:11px;font-family:ui-monospace,Consolas,monospace}.diagram-note{margin:0;padding:11px 18px;font-size:11px;color:var(--ui-muted)}.network-details-heading{margin:20px 0 14px}.platform-place-node{position:relative;text-align:left;padding:24px}.platform-place-node:before{content:"";position:absolute;inset:0 auto 0 0;width:4px;background:#438979}.platform-place-node:hover{border-color:#8db4a7!important;background:var(--ui-soft)}.network-open{color:var(--ui-accent);font-weight:600}.scope-intro{border-bottom:1px solid var(--ui-line);padding-bottom:20px}.steward-tile{border-radius:14px!important;border:1px solid var(--ui-line)!important;border-top:3px solid #438979!important;box-shadow:var(--ui-shadow)!important;padding:28px!important;background:var(--ui-surface)!important}.steward-tile:nth-child(2n){border-top-color:#6c8fbc!important}.steward-tile:nth-child(3n){border-top-color:#b29a72!important}.steward-tile strong{font-size:19px!important}.steward-tile:hover{border-color:#9dbab0!important;box-shadow:0 8px 22px #223d5016!important}.journal-card{border-radius:14px;box-shadow:var(--ui-shadow)}#page-live:is(:fullscreen,.wall-expanded) .camera-meta{background:#172e35!important;color:#e8f3ef!important}#page-live:is(:fullscreen,.wall-expanded) .camera-meta strong{color:#e8f3ef!important}#page-live:is(:fullscreen,.wall-expanded) .wall-toolbar{background:#172e35!important;border-color:#45616a!important}#page-live:is(:fullscreen,.wall-expanded) .form-select{background-color:#213b44!important;color:#e8f3ef!important;border-color:#64818b!important}main>footer{color:var(--ui-muted);font-size:10px}html[data-density=compact] .home-insights>article{padding:18px}html[data-density=compact] .home-cover{height:165px}html[data-density=compact] .card-body{padding:18px}@media(min-width:1100px){html[data-layout=top] #app>main{padding-top:28px!important}}@media(max-width:1250px){.home-insights{grid-template-columns:1.2fr .75fr 1fr;gap:12px}.home-insights>article{padding:19px}.insight-distribution{gap:10px}.insight-donut{width:102px;flex-basis:102px}.insight-welcome h2{font-size:20px!important}}@media(max-width:1000px)and (min-width:761px){#app>main{padding:26px 24px!important}.home-insights{grid-template-columns:1fr 1fr}.insight-welcome{grid-column:1/-1}.insight-welcome p{margin-bottom:12px}}@media(max-width:760px){#app>main{padding:20px 16px!important}.sidebar{background:#17353b!important}main>header{margin-bottom:20px!important;padding-bottom:18px!important}#page-title{font-size:25px!important}#page-note{font-size:12px!important}.home-insights{grid-template-columns:1fr 1fr;gap:12px;margin:16px 0 20px}.home-insights>article{padding:18px}.insight-welcome{grid-column:1/-1}.insight-welcome h2{margin:7px 0 0!important;font-size:20px!important}.insight-welcome p,.insight-scope{display:none}.insight-number>strong{font-size:34px}.insight-icon{width:29px;height:29px;top:14px;right:13px}.insight-distribution{flex-direction:column;gap:5px}.insight-donut{width:94px;flex-basis:auto}.insight-legend{width:100%;display:flex;flex-wrap:wrap;justify-content:center;gap:6px}.insight-legend h3{display:none}.insight-legend>span{margin:0;font-size:10px;gap:4px}.insight-number .insight-label{padding-right:24px;font-size:11px}.insight-donut strong{font-size:25px}.insight-donut small{font-size:9px}.home-toolbar{padding:12px}.home-layout-toggle{display:inline-flex;margin-left:auto}.home-toolbar .home-layout-controls{display:none}.home-toolbar.home-options-open .home-layout-controls{display:flex;flex-basis:100%;border-top:1px solid var(--ui-line);padding-top:12px}.home-cover{height:200px}.home-cover-content{padding:20px}.home-cover-content h3{font-size:23px!important}.card-body{padding:20px}.home-numbers{padding:12px 0}.home-card-grid{gap:18px}.home-card-actions{gap:8px;flex-wrap:wrap}.btn{min-height:44px}.form-control,.form-select{min-height:44px;font-size:16px}#page-playback .playback-controls{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}#page-playback .playback-controls label{width:100%;min-width:0}#page-playback .playback-controls input,#page-playback .playback-controls select,#page-playback .playback-controls button{width:100%}#play-info{overflow-wrap:anywhere}.device-view-controls{padding:16px}.network-map{padding:14px}.network-platform{padding:16px}.diagram-toolbar{padding:12px;align-items:flex-start}.diagram-toolbar>div{gap:6px}.diagram-toolbar>div .small{flex-basis:100%;font-size:10px}.diagram-toolbar label{flex-direction:column;align-items:flex-start}.diagram-toolbar select{width:82px}.diagram-scroll{max-height:360px}.steward-tile{padding:22px!important}main[data-page=live]>header{margin-bottom:10px!important;padding-bottom:12px!important}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;scroll-behavior:auto!important}}:root{--ui-shadow: 0 4px 22px #223d500a;--bs-body-font-family: system-ui,"Microsoft YaHei",sans-serif}html[data-theme=paper]{--ui-bg: #f5f5f1;--ui-soft: #f4f6f2}.dashboard-grid{margin-top:4px}.dashboard-grid>div,.row>div{min-width:0}.dashboard-welcome{position:relative;overflow:hidden;padding:28px;border-radius:16px;background:linear-gradient(140deg,#234a49,#2e7964);color:#fff}.dashboard-welcome:after{content:"";position:absolute;right:-85px;top:-95px;width:260px;height:260px;border:40px solid #ffffff07;border-radius:50%;pointer-events:none}.dashboard-welcome h2{font-size:clamp(21px,2vw,26px)!important;color:#fff!important;margin:16px 0 8px;letter-spacing:.2px}.dashboard-welcome>p{color:#d3e7df;font-size:12px}.dashboard-totals{display:flex;gap:28px;margin:22px 0}.dashboard-totals>div{display:flex;flex-direction:column}.dashboard-totals strong{color:#fff;font-size:32px;font-weight:600;line-height:1.3;font-variant-numeric:tabular-nums}.dashboard-totals span{color:#d3e7df;font-size:11px;margin-top:5px}.chart-card{padding:22px;border:1px solid var(--ui-line);border-radius:16px;background:var(--ui-surface);box-shadow:var(--ui-shadow);min-width:0}.chart-heading{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-bottom:10px}.chart-heading h3{font-size:15px!important;font-weight:650;margin:0}.chart-heading .small{font-size:11px}.chart-legend{display:flex;gap:10px 18px;flex-wrap:wrap;justify-content:center;padding-top:8px}.chart-legend span{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--ui-muted)}.chart-legend i{width:8px;height:8px;border-radius:3px}.chart-legend b{color:var(--ink);font-variant-numeric:tabular-nums}.chart-data{color:var(--ui-muted);font-size:11px;margin-top:8px}.chart-data summary{cursor:pointer;padding:6px 0}.chart-data ul{padding-left:20px;margin:8px 0 0}.chart-empty{min-height:150px;display:grid;place-items:center;color:var(--ui-muted);margin:0;font-size:13px}.local-chart-wrap,.local-chart{width:100%;min-width:0}.chart-network-surface{background:var(--ui-soft);border-radius:12px;background-image:radial-gradient(var(--ui-line) 1px,transparent 1px);background-size:20px 20px;overflow:hidden}.chart-network-surface .local-chart{touch-action:none}.household-context{border-left:3px solid #488b76!important}.section-head>div>.description{margin-top:7px}.home-toolbar,.device-view-controls,.playback-controls{box-shadow:var(--ui-shadow)}.home-card .card-body{padding:22px}.home-cover{height:200px}.form-grid label{align-items:stretch}dialog .dialog-heading{position:sticky;top:0;background:var(--ui-surface);z-index:2;padding-block:12px}dialog .dialog-footer{padding-top:18px;border-top:1px solid var(--ui-line)}html[data-theme=ink] .chart-card{color:var(--ink)}html[data-theme=ink] .chart-heading .badge{background:#2c493e!important;color:#c2e9d7!important}@media(max-width:767px){.dashboard-grid:not(.charts-expanded) .dashboard-chart-column{display:none}.dashboard-welcome{padding:22px}.dashboard-welcome h2{font-size:22px!important}.dashboard-totals{justify-content:space-between;gap:14px;margin:18px 0 14px}.dashboard-welcome .insight-scope{display:flex;font-size:10px}.chart-card{padding:18px}.dashboard-grid .chart-card{height:auto!important}.chart-network-surface .local-chart{max-height:340px}.diagram-toolbar{flex-wrap:wrap}.diagram-toolbar .btn{min-height:40px}.household-context{padding:14px!important}.section-head{gap:12px;flex-wrap:wrap}.dialog-footer button{flex:1}.table-wrap{overscroll-behavior-x:contain}}.hardware-grid>div[data-v-2d075cdb]{display:flex;flex-direction:column;gap:4px;background:#f5f7f7;padding:12px;border:3px solid white;border-radius:12px}.hardware-grid span[data-v-2d075cdb],.hardware-grid small[data-v-2d075cdb]{font-size:12px;color:#637471}.hardware-grid strong[data-v-2d075cdb]{font-size:18px}.tv-remote-preview[data-v-2d075cdb]{margin:16px 0;text-align:center}.tv-remote-preview img[data-v-2d075cdb]{max-height:640px;max-width:100%;border:6px solid #303b38;border-radius:12px}.display-manager summary[data-v-2d075cdb]{cursor:pointer}details p[data-v-2d075cdb]{margin-top:12px}.family-locations h2[data-v-f94289e2]{font-size:1.3rem}.location-empty[data-v-f94289e2]{display:grid;align-content:center;min-height:270px;text-align:center;color:var(--ui-muted,#64776f);padding:1rem}.location-empty>span[data-v-f94289e2]{font-size:3rem;color:#6c9685}.location-person[data-v-f94289e2]{display:flex;flex-direction:column;gap:.35rem;background:var(--panel,#fff);border:1px solid var(--ui-line,#d9e3dd);border-radius:12px;padding:14px;margin-bottom:10px;color:var(--ink,#243c32)}.location-person>span[data-v-f94289e2],.location-person small[data-v-f94289e2]{font-size:.85rem}.location-selected[data-v-f94289e2]{border-color:#257a68;box-shadow:inset 3px 0 #257a68}.family-locations summary[data-v-f94289e2]{cursor:pointer}.family-locations input[type=checkbox][data-v-f94289e2]{min-width:18px;width:18px;min-height:18px}.upload-metric[data-v-0c20c09f]{height:100%;padding:1rem;border:1px solid var(--ui-line,#e3e9ef);border-radius:12px;background:var(--panel,#fff);display:flex;flex-direction:column;gap:.35rem}.upload-metric>span[data-v-0c20c09f],.upload-metric>small[data-v-0c20c09f]{color:var(--ui-muted,#64748b);font-size:.8rem}.upload-metric>strong[data-v-0c20c09f]{font-size:1.65rem;line-height:1.5;font-variant-numeric:tabular-nums}.upload-metric.freed[data-v-0c20c09f]{background:color-mix(in srgb,var(--panel,#fff) 90%,#2e876e)}.upload-current[data-v-0c20c09f]{padding:1rem;border-radius:12px;background:color-mix(in srgb,var(--panel,#fff) 90%,#419be1)}.upload-filters[data-v-0c20c09f]{display:flex;flex-wrap:wrap;gap:1rem}.upload-filters label[data-v-0c20c09f]{flex:1;min-width:160px;max-width:330px;font-size:.85rem}.upload-task[data-v-0c20c09f]{padding:1rem 0;border-top:1px solid var(--ui-line,#e3e9ef)}.upload-task-heading[data-v-0c20c09f]{display:flex;justify-content:space-between;gap:.75rem;align-items:center;margin-bottom:.4rem}.upload-details[data-v-0c20c09f]{margin:1rem 0 0}.upload-details>div[data-v-0c20c09f]{display:grid;grid-template-columns:110px 1fr;gap:10px}.upload-details dd[data-v-0c20c09f]{overflow-wrap:anywhere}.upload-tasks summary[data-v-0c20c09f]{cursor:pointer}.upload-tasks .progress[data-v-0c20c09f]{height:8px}.upload-tasks .badge[data-v-0c20c09f]{white-space:normal}.upload-tasks button[data-v-0c20c09f]{min-height:40px}@media(max-width:576px){.upload-metric[data-v-0c20c09f]{padding:.75rem}.upload-metric>strong[data-v-0c20c09f]{font-size:1.2rem}.upload-filters label[data-v-0c20c09f]{min-width:100%;max-width:none}.upload-details>div[data-v-0c20c09f]{grid-template-columns:1fr;gap:0}}.journal-rich-editor{border:1px solid var(--bs-border-color,#ccd9d7);border-radius:12px;overflow:hidden;background:var(--bs-body-bg,#fff);margin:10px 0 20px}.journal-editor-toolbar{display:flex;flex-wrap:wrap;gap:6px;padding:10px;background:var(--bs-tertiary-bg,#f3f7f5);border-bottom:1px solid var(--bs-border-color,#ccd9d7)}.journal-editor-toolbar button{min-height:40px;padding:6px 12px}.journal-editor-toolbar button[aria-pressed=true]{background:#d8eae2;color:#153d31}.journal-rich-input{padding:20px;min-height:200px;outline:none;overflow-wrap:anywhere}.journal-rich-input:focus{box-shadow:inset 0 0 0 2px #669c89}.journal-rich-input p{min-height:1.5em;margin-bottom:12px;white-space:pre-wrap}.journal-rich-input blockquote,.journal-rich-body blockquote{border-left:3px solid #84ad9d;padding-left:16px;color:#5f7870}.journal-editor-foot{display:flex;justify-content:space-between;gap:12px;font-size:12px;color:#667b75;padding:10px 16px;border-top:1px solid #e1e9e5}.journal-inline-media{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:12px;border:1px solid #d4e1da;border-radius:10px;background:#f8faf9;max-width:680px}.journal-inline-media img,.journal-inline-media video{max-width:100%;max-height:380px;object-fit:contain;border-radius:6px}.journal-inline-media audio{width:min(100%,540px)}.journal-inline-media figcaption{font-size:12px;color:#60766c;overflow-wrap:anywhere}.journal-inline-media.ProseMirror-selectednode{outline:2px solid #368268}.journal-rich-body{line-height:1.8;overflow-wrap:anywhere}.journal-rich-body p{white-space:pre-wrap}.journal-rich-body .journal-attachment{max-width:760px;margin:16px 0}.journal-rich-body img,.journal-rich-body video{max-height:480px;object-fit:contain}.journal-materials .journal-add-media{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.journal-materials input[type=file]{max-width:100%}.journal-queue-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 16px;padding:14px 0;border-bottom:1px solid #e1e9e5}.journal-queue-row strong{overflow-wrap:anywhere}.journal-queue-row progress{width:100%;height:8px}.journal-queue-row small{display:block;color:#63756f}.journal-queue-row .journal-task-error{color:#a43b35}.journal-library-list-tools{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:14px 0}.journal-upload-select small{display:block}.journal-editor-heading{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:14px 22px;background:#f5f8f6;border:1px solid #d6e2da;border-radius:12px;margin-bottom:16px}.journal-editor-heading strong{margin-right:auto}.journal-editor-heading button{min-height:44px}.journal-editor-fullscreen{position:fixed;inset:0;z-index:1090;background:#f0f4f2;overflow:auto;overscroll-behavior:contain;padding:0 24px 24px;display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:18px;align-content:start}.journal-editor-fullscreen>.journal-editor-heading{grid-column:1/-1;position:sticky;top:0;z-index:3;margin:0 -24px;border-radius:0;padding:14px 24px;box-shadow:0 2px 10px #183b2412}.journal-editor-fullscreen>.journal-compose{margin:0;min-height:calc(100dvh - 110px);display:flex;flex-direction:column}.journal-editor-fullscreen .journal-rich-editor{flex:1;display:flex;flex-direction:column}.journal-editor-fullscreen .journal-rich-editor>div:has(>.tiptap){flex:1}.journal-editor-fullscreen .journal-rich-input{min-height:52dvh;font-size:19px;line-height:1.9}.journal-editor-fullscreen .journal-editor-toolbar{position:sticky;top:0;z-index:1}.journal-editor-fullscreen>.journal-materials{margin:0;padding:18px;max-height:calc(100dvh - 110px);overflow:auto;position:sticky;top:92px}.journal-editor-fullscreen .journal-upload-grid{grid-template-columns:1fr}.journal-editor-fullscreen .journal-upload-card video,.journal-editor-fullscreen .journal-upload-card img{max-height:160px}.journal-editor-fullscreen .journal-upload-select span{min-width:0;overflow-wrap:anywhere}#journal-record-elapsed{font-variant-numeric:tabular-nums;color:#bd4338}.journal-inline-media .recording-indicator{color:#bd4338}@media(max-width:900px){.journal-editor-fullscreen{display:block;padding:0 12px 20px}.journal-editor-fullscreen>.journal-editor-heading{margin:0 -12px 12px;padding:10px 12px}.journal-editor-fullscreen>.journal-compose{min-height:calc(100dvh - 140px)}.journal-editor-fullscreen>.journal-materials{position:static;max-height:none;margin-top:12px}.journal-editor-fullscreen .journal-rich-input{min-height:48dvh;font-size:17px}.journal-editor-heading{padding:12px;gap:8px}.journal-editor-heading strong{width:100%}}@media(max-width:600px){.journal-rich-input{padding:14px;min-height:190px}.journal-editor-toolbar{gap:4px}.journal-editor-toolbar button{padding:7px 10px}.journal-editor-foot{flex-wrap:wrap}.journal-inline-media{max-width:100%}.journal-queue-row{gap:8px}.journal-compose,.journal-materials{min-width:0}} +:root{font-family:Inter,Microsoft YaHei,system-ui,sans-serif;color:#dae4e6;background:#10191d;font-synthesis:none;--muted:#8faaaF;--line:#2b3b40;--panel:#18252b;--accent:#74d5bb}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,.button{border:1px solid transparent;background:var(--accent);color:#153b31;padding:11px 18px;border-radius:8px;font-weight:600;cursor:pointer;white-space:nowrap;text-decoration:none;font-size:14px}button:hover,.button:hover{filter:brightness(1.08)}button:disabled{opacity:.5;cursor:wait}.secondary{background:#263a40;color:#cfe7e5;border-color:#385058}.quiet{background:transparent;border-color:var(--line);color:var(--muted);padding:9px 13px;font-size:13px}input,select{background:#111e24;border:1px solid #3a4e55;color:#e3f0ef;border-radius:7px;padding:10px 11px;min-width:0;max-width:100%;outline:none}input:focus,select:focus{border-color:var(--accent)}label{font-size:13px;color:#a5bec1;display:flex;gap:8px;align-items:center}h1,h2,h3,p{margin-top:0}h1{font-size:30px;letter-spacing:1px;margin:8px 0}h2{font-size:19px;font-weight:600}h3{font-size:16px}p{line-height:1.8}small{font-weight:400}.sidebar{position:fixed;left:0;top:0;bottom:0;width:238px;background:#111e24;border-right:1px solid var(--line);padding:32px 20px;display:flex;flex-direction:column}.brand{display:flex;gap:12px;align-items:center;color:#e9f3f1;text-decoration:none;font-size:21px;font-weight:600;padding:5px 8px 40px}.brand-icon{color:var(--accent);font-size:39px}.brand small{display:block;font-size:9px;letter-spacing:1.1px;margin-top:7px;color:var(--muted)}.nav-label{color:#6b868b;font-size:11px;letter-spacing:3px;padding:14px 15px}nav{display:grid;gap:8px}nav button{text-align:left;background:transparent;color:#8fa9ae;display:flex;gap:15px;font-size:18px;padding:14px 16px}nav button span{font-size:14px}nav button.active{background:#244038;color:#9ee8d3}.side-note{margin-top:auto;padding:20px 9px;font-size:12px;color:#8ebdb1}.side-note p{color:#5e8086;font-size:11px;margin:16px 0}.dot{display:inline-block;width:7px;height:7px;background:#7bd5b5;border-radius:50%;margin-right:5px}main{margin-left:238px;padding:38px 42px 18px;max-width:1800px}header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:27px}.eyebrow{font-size:10px;letter-spacing:3px;color:#77aa9e}header p{color:var(--muted);font-size:13px;margin:0}.header-status{display:grid;justify-items:end;gap:13px;padding-top:4px;font-size:11px;color:#718f96}.badge{font-size:11px;background:#243c36;color:#8bddbd;padding:6px 10px;border-radius:5px}.badge.off{background:#372d27;color:#d7ae87}.metrics{display:grid;grid-template-columns:repeat(4,1fr);border:1px solid var(--line);background:#152329;border-radius:12px;overflow:hidden}.metrics>div{padding:21px 25px;border-right:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:10px}.metrics>div:last-child{border:0}.metrics span{font-size:12px;color:var(--muted)}.metrics strong{font-size:26px;font-weight:500}.filter-row{display:flex;gap:16px;align-items:center;margin:26px 0;color:#728c93;font-size:12px}.filter-row select{max-width:280px}.section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:28px 0 17px}.section-head h2{margin:0}.section-head small{font-size:9px;color:#637f87;letter-spacing:2px;margin-left:12px}.section-head>div{display:flex;align-items:center;gap:16px}.live-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.camera-card{border:1px solid var(--line);border-radius:11px;background:var(--panel);overflow:hidden}.camera-card .video-panel{border:0;border-radius:0;margin:0}.video-panel{position:relative;aspect-ratio:16/9;background:#070e12;overflow:hidden;border:1px solid var(--line);border-radius:10px;margin-bottom:16px}.video-panel video{width:100%;height:100%;object-fit:contain;display:block}.video-empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:13px;color:#5c7b85;font-size:13px;pointer-events:none;background:radial-gradient(ellipse at center,#142a32 0,transparent 70%)}.video-empty .lens{font-size:36px;color:#456773}.video-error{position:absolute;left:14px;right:14px;bottom:48px;background:#271d1ce6;border-radius:6px;color:#e3b7a1;padding:9px 12px;font-size:12px}.camera-meta{display:flex;justify-content:space-between;gap:12px;padding:16px 18px}.camera-meta strong{font-size:14px}.camera-meta p{color:#728f96;font-size:11px;margin:6px 0 0}.camera-meta .badge{align-self:flex-start}.camera-actions{display:flex;gap:8px;padding:0 18px 14px}.camera-actions button{font-size:11px;padding:7px 10px}.empty{grid-column:1/-1;padding:62px 20px;text-align:center;background:var(--panel);border:1px dashed #354b52;border-radius:12px;color:#819da5}.empty h3{font-size:19px;color:#c4d5d6;font-weight:500}.empty p{font-size:13px;margin-bottom:22px}.panel{padding:22px;background:var(--panel);border:1px solid var(--line);border-radius:10px;margin-bottom:18px}.playback-controls{display:flex;align-items:end;gap:15px;flex-wrap:wrap}.playback-controls label{display:grid}.playback-controls>span{font-size:12px;color:var(--muted);margin:auto 0}.timeline-head{display:flex;justify-content:space-between;font-size:12px;margin-bottom:20px}.timeline-head span{color:var(--muted)}.legend{display:inline-block;background:var(--accent);width:15px;height:6px;margin-right:7px}#timeline{width:100%;height:76px;display:block;cursor:crosshair}.time-labels{display:flex;justify-content:space-between;font-size:10px;color:#74949c}.seek-row{margin-top:22px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}.recording-list{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.recording-item{text-align:left;background:#203139;color:#bdd5d8;font-size:12px;border:1px solid var(--line);white-space:normal}.recording-item small{display:block;color:#719499;margin-top:7px}.discovery{display:flex;align-items:center;gap:14px}.discovery>div{margin-right:auto}.discovery p{font-size:12px;color:var(--muted);margin:5px 0 0}.discovery input{width:190px}.scan-chip{display:inline-flex;gap:16px;align-items:center;margin:0 12px 14px 0;padding:12px 16px;border:1px solid var(--line);border-radius:8px;font-size:13px}.scan-chip button{padding:6px 10px;font-size:11px}.table-wrap{overflow:auto}.device-table{width:100%;border-collapse:collapse;background:var(--panel);border:1px solid var(--line);font-size:13px}.device-table th{text-align:left;font-size:11px;color:#8ba9ae;font-weight:400;padding:15px}.device-table td{padding:18px 15px;border-top:1px solid var(--line)}.device-table td small{display:block;margin-top:7px;color:#75969d}.site-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.site-card{background:var(--panel);border:1px solid var(--line);padding:24px;border-radius:10px}.site-heading{display:flex;justify-content:space-between;gap:12px}.site-card h3{margin:12px 0}.site-card dl{font-size:12px}.site-card dl>div{display:flex;gap:18px;padding:7px 0}.site-card dt{color:#718d94;width:80px;flex-shrink:0}.site-card dd{margin:0;color:#b6cccf;word-break:break-word}.description{font-size:12px;color:var(--muted);line-height:1.9}.storage-grid{display:grid;grid-template-columns:1fr 1.2fr;gap:22px}.storage-grid form>label{display:grid;margin:20px 0}.storage-grid dl{font-size:13px}.storage-grid dl div{display:flex;justify-content:space-between;gap:15px;padding:15px 0;border-bottom:1px solid var(--line)}.storage-grid dt{color:var(--muted)}.storage-grid dd{margin:0}.audit-item{font-size:11px;padding:10px 0;border-top:1px solid var(--line);color:#9ab8bd}.audit-item small{display:block;color:#607f89;margin-bottom:5px}.banner{background:#493c24;border:1px solid #6b5430;color:#e1c69a;border-radius:8px;padding:13px 17px;font-size:13px;margin-bottom:22px}dialog{color:#dae4e6;background:#192a31;border:1px solid #3b555d;border-radius:15px;width:min(760px,94vw);max-height:90vh;padding:30px;box-shadow:0 25px 120px #0008}dialog::backdrop{background:#061015dd;backdrop-filter:blur(8px)}#auth-dialog{max-width:430px;padding:38px}#auth-form h2{font-size:28px;margin:18px 0 10px}#auth-form>label{display:grid;margin:22px 0}#auth-form p{color:#93afb5;font-size:13px}.dialog-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:25px}.dialog-heading h2{margin:0}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.form-grid label{display:grid;gap:8px}.form-grid .check{display:flex}.check input{accent-color:var(--accent);width:16px;height:16px}.dialog-footer{display:flex;justify-content:flex-end;margin-top:20px;padding-top:20px;border-top:1px solid var(--line)}.form-error{font-size:12px;color:#efab97;line-height:1.6}.wide{width:100%}footer{font-size:10px;color:#54727c;display:flex;justify-content:space-between;margin-top:40px;padding-top:18px;border-top:1px solid var(--line)}#toast{position:fixed;bottom:28px;left:50%;transform:translate(-50%);border:1px solid #4a7d70;background:#1a3c32;color:#b5efd9;padding:13px 22px;border-radius:9px;z-index:5;box-shadow:0 10px 30px #0005;font-size:13px}:focus-visible{outline:2px solid var(--accent);outline-offset:3px}@media(min-width:1600px){.live-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:1100px){.sidebar{width:190px;padding:25px 14px}.brand{font-size:17px}.brand-icon{font-size:30px}.brand small{font-size:8px}main{margin-left:190px;padding:25px}.metrics>div{padding:18px 14px}.metrics strong{font-size:22px}.storage-grid{grid-template-columns:1fr}.section-head small{display:none}}@media(max-width:760px){.sidebar{position:static;width:auto;padding:18px 16px 8px;border-right:0;border-bottom:1px solid var(--line)}.brand{padding:0 3px 16px}.brand small{font-size:9px}.sidebar nav{display:flex;gap:3px;overflow:auto}.sidebar nav button{padding:10px;font-size:14px;gap:6px}.sidebar nav button span{font-size:11px}.nav-label,.side-note,.sidebar #logout{display:none}main{margin:0;padding:23px 16px}h1{font-size:25px}.header-status{font-size:9px}.metrics{grid-template-columns:1fr 1fr}.metrics>div{border-bottom:1px solid var(--line)}.metrics>div:nth-child(2){border-right:0}.live-grid,.site-grid{grid-template-columns:1fr}.filter-row{flex-wrap:wrap;gap:10px}.filter-row>span{display:none}.filter-row select{max-width:200px}.section-head{align-items:start}.section-head>div{flex-wrap:wrap;justify-content:flex-end;gap:8px}.section-head button{padding:9px 11px;font-size:12px}.section-head h2{font-size:16px}.section-head label{font-size:11px}.section-head select{padding:6px}.discovery{flex-wrap:wrap}.discovery>div{width:100%}.discovery input{flex:1}.recording-list{grid-template-columns:1fr 1fr}.timeline-head{gap:10px;font-size:10px}.form-grid{gap:13px}.form-grid label{font-size:12px}dialog{padding:23px}.form-grid .full{grid-column:1/-1}.playback-controls label{flex:1}.video-empty{font-size:11px}.camera-meta{padding:14px}.seek-row label{width:100%}#auth-dialog{padding:30px}footer{font-size:9px}}.sidebar{overflow-y:auto}.sidebar .brand{padding-bottom:18px}.sidebar nav{gap:3px}.sidebar nav button{padding-top:10px;padding-bottom:10px}.sidebar .side-note{padding-bottom:0}.sidebar .side-note p{display:none}textarea{font:inherit;color:#e3f0ef;background:#111e24;border:1px solid #3a4e55;border-radius:7px;padding:10px;resize:vertical;max-width:100%}textarea:focus{outline:2px solid var(--accent)}fieldset{border:1px solid var(--line);border-radius:8px;padding:15px}legend{color:var(--muted);font-size:13px}#user-sites{display:flex;flex-wrap:wrap;gap:16px}.family-toolbar{display:flex;align-items:center;gap:16px;flex-wrap:wrap}.family-toolbar>span{margin-left:auto;font-size:12px;color:var(--muted)}.family-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:20px;align-items:start}.family-people{display:grid;gap:10px;max-height:720px;overflow:auto}.person-card{text-align:left;display:grid;gap:8px;white-space:normal;background:var(--panel);color:#dae4e6;border:1px solid var(--line);padding:18px}.person-card.selected{border-color:var(--accent);background:#234037}.person-card span{font-size:12px;color:var(--accent)}.person-card small{font-size:11px;color:var(--muted)}#family-detail .section-head{margin-top:0}#family-detail h2{margin:10px 0}.family-prose{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px}.family-link{display:flex;gap:15px;justify-content:space-between;align-items:center;padding:12px 0;border-bottom:1px solid var(--line);font-size:13px}.family-link small{display:block;color:var(--muted);margin-top:7px}.family-tree{display:grid;grid-template-columns:1fr 1fr;gap:25px;overflow:auto}.family-tree ul{padding-left:20px;list-style:none;border-left:1px solid #3f6359}.family-tree li{padding:6px 0}.family-tree button{max-width:100%;white-space:normal}.family-tree small{color:var(--muted);font-size:11px}.family-spouses{grid-column:1/-1}#family-error:empty{display:none}.family-people .empty{padding:30px 12px}.family-people .empty h3{font-size:16px}#current-user{font-size:12px;margin:12px 0}@media(max-width:900px){.family-layout{grid-template-columns:1fr}.family-people{grid-template-columns:repeat(2,minmax(0,1fr));max-height:350px}.family-tree{grid-template-columns:1fr}.family-spouses{grid-column:auto}.family-toolbar label{flex-wrap:wrap}.family-toolbar input{width:100%}}@media(max-width:760px){.sidebar #logout{display:block;align-self:flex-end}.sidebar #current-user{position:absolute;right:130px;top:15px;font-size:10px}.form-grid{grid-template-columns:1fr}.family-tree ul{padding-left:12px}}#family-detail dl{display:grid;grid-template-columns:1fr 1fr;gap:14px 28px;margin:20px 0 26px}#family-detail dl>div{display:grid;grid-template-columns:105px 1fr;gap:10px;border-bottom:1px solid var(--line);padding-bottom:10px}#family-detail dt{font-size:12px;color:var(--muted)}#family-detail dd{margin:0;font-size:13px;overflow-wrap:anywhere}@media(max-width:1000px){#family-detail dl{grid-template-columns:1fr}}.brand-icon{width:44px;height:44px;object-fit:cover;border-radius:12px;flex-shrink:0}.wall-toolbar{display:flex;align-items:center;gap:15px;flex-wrap:wrap;margin:16px 0}.wall-toolbar select{padding:8px}.wall-paging{display:flex;align-items:center;gap:9px;color:var(--muted);font-size:12px}#wall-clock{margin-left:auto;color:var(--muted);font-size:12px}.live-grid[data-layout="1"]{grid-template-columns:1fr}.live-grid[data-layout="2"],.live-grid[data-layout="4"]{grid-template-columns:repeat(2,minmax(0,1fr))}.live-grid[data-layout="6"],.live-grid[data-layout="9"]{grid-template-columns:repeat(3,minmax(0,1fr))}.live-grid[data-layout="16"]{grid-template-columns:repeat(4,minmax(0,1fr))}.wall-reorder{display:none;padding:8px 12px;align-items:center;gap:8px}.arranging .wall-reorder{display:flex}.wall-reorder span{cursor:grab;margin-right:auto;font-size:12px;color:var(--muted)}.wall-reorder button{padding:4px 9px;font-size:11px}#page-live:is(:fullscreen,.wall-expanded){background:#070f12;padding:12px;width:100vw;height:100dvh;display:flex;flex-direction:column;overflow:hidden}#page-live:is(:fullscreen,.wall-expanded)>.section-head,#page-live:is(:fullscreen,.wall-expanded)>#quality-note{display:none}#page-live:is(:fullscreen,.wall-expanded) .wall-toolbar{margin:0 0 10px;flex-shrink:0}#page-live:is(:fullscreen,.wall-expanded) .live-grid{flex:1;min-height:0;gap:8px;grid-template-rows:repeat(2,minmax(0,1fr))}#page-live:is(:fullscreen,.wall-expanded) .live-grid[data-layout="1"],#page-live:is(:fullscreen,.wall-expanded) .live-grid[data-layout="2"]{grid-template-rows:1fr}#page-live:is(:fullscreen,.wall-expanded) .live-grid[data-layout="9"]{grid-template-rows:repeat(3,minmax(0,1fr))}#page-live:is(:fullscreen,.wall-expanded) .live-grid[data-layout="16"]{grid-template-rows:repeat(4,minmax(0,1fr))}#page-live:is(:fullscreen,.wall-expanded) .camera-card{display:flex;flex-direction:column;min-height:0;position:relative}#page-live:is(:fullscreen,.wall-expanded) .video-panel{flex:1;min-height:0;aspect-ratio:auto}#page-live:is(:fullscreen,.wall-expanded) .camera-meta{padding:7px 10px;align-items:center}#page-live:is(:fullscreen,.wall-expanded) .camera-meta p,#page-live:is(:fullscreen,.wall-expanded) .camera-meta .badge{display:none}#page-live:is(:fullscreen,.wall-expanded) .camera-meta strong{font-size:12px}#page-live:is(:fullscreen,.wall-expanded) .camera-actions{position:absolute;bottom:34px;right:6px;padding:4px;background:#10191ddd;border-radius:6px;opacity:0}#page-live:is(:fullscreen,.wall-expanded) .camera-card:hover .camera-actions,#page-live:is(:fullscreen,.wall-expanded) .camera-card:focus-within .camera-actions{opacity:1}#page-live:is(:fullscreen,.wall-expanded) .camera-actions [data-edit-camera],#page-live:is(:fullscreen,.wall-expanded) .camera-actions [data-play-camera]{display:none}.ptz-panel{background:#1a3038;border:1px solid #41656c;border-radius:12px;padding:16px;display:flex;align-items:center;gap:22px;position:fixed;bottom:22px;right:22px;z-index:4;max-width:calc(100vw - 32px);box-shadow:0 12px 50px #0008}.ptz-panel p{font-size:12px;color:var(--muted);max-width:320px;margin:8px 0 0}.ptz-pad{display:grid;grid-template-columns:repeat(3,46px);grid-template-rows:repeat(3,40px);gap:4px}.ptz-pad button{padding:5px;font-size:17px}.ptz-pad [data-ptz-action=up]{grid-column:2}.ptz-pad [data-ptz-action=left]{grid-column:1;grid-row:2}.ptz-pad [data-ptz-action=stop]{grid-column:2;grid-row:2;background:#f0bda6;font-size:12px}.ptz-pad [data-ptz-action=right]{grid-column:3;grid-row:2}.ptz-pad [data-ptz-action=down]{grid-column:2;grid-row:3}.family-date{border:1px solid var(--line);border-radius:8px;padding:14px;margin:0;min-width:0}.family-date legend{font-size:13px;color:#a5bec1}.family-date label{margin-bottom:10px}.family-date output{display:block;font-size:12px;line-height:1.7;color:var(--accent)}@media(max-width:760px){.wall-toolbar{gap:9px}#wall-clock{display:none}.camera-meta strong{font-size:12px}.camera-actions{flex-wrap:wrap;padding:0 8px 8px}.camera-meta{padding:9px}.ptz-panel{flex-wrap:wrap;gap:12px}.ptz-panel>div:first-child{flex:1;min-width:160px}.family-date{grid-column:1/-1}#page-live:is(:fullscreen,.wall-expanded) .camera-actions{opacity:1}.live-grid[data-layout="16"] .camera-meta strong{font-size:9px}}#page-live:is(:fullscreen,.wall-expanded) .live-grid[data-layout=auto]{grid-template-columns:repeat(3,minmax(0,1fr))}.wall-reorder [data-wall-drag]{touch-action:none;user-select:none;padding:5px 0}.camera-card.wall-drop-target{outline:2px solid var(--accent);outline-offset:-3px}#camera-settings-dialog{width:min(1060px,94vw)}#camera-settings-info dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0 24px;padding:16px;border:1px solid var(--line);border-radius:10px}#camera-settings-info dt{font-size:12px;color:var(--muted);margin-bottom:6px}#camera-settings-info dd{font-size:13px;margin:0;overflow-wrap:anywhere}#camera-image-fields,#camera-video-fields{grid-template-columns:repeat(3,minmax(0,1fr))}#camera-settings-status:empty{display:none}#camera-settings-dialog details{margin-top:20px;color:var(--muted);font-size:13px;line-height:1.8}#page-live:is(:fullscreen,.wall-expanded) .camera-actions [data-camera-settings]{display:none}@media(max-width:700px){#camera-settings-info dl,#camera-image-fields,#camera-video-fields{grid-template-columns:1fr 1fr}}@media(max-width:420px){#camera-settings-info dl,#camera-image-fields,#camera-video-fields{grid-template-columns:1fr}}.ptz-panel{width:620px;display:grid;grid-template-columns:1fr auto;max-height:80dvh;overflow:auto;align-items:start}.ptz-panel>div:first-child{grid-column:1}.ptz-panel .ptz-pad{grid-column:2;grid-row:1/3}#ptz-presets{grid-column:1/-1;min-width:0;border-top:1px solid var(--line);padding-top:12px}#ptz-presets .section-head{margin:0;gap:10px}#ptz-presets p{max-width:none;line-height:1.6}#preset-count{color:var(--muted);font-size:12px}.preset-row{display:flex;align-items:center;gap:5px;padding:9px 0;border-bottom:1px solid var(--line);flex-wrap:wrap}.preset-row strong{font-size:13px;flex:1;overflow-wrap:anywhere}.preset-row button{padding:5px 8px;font-size:12px}#preset-form{display:flex;align-items:end;gap:10px;margin-top:12px}#preset-form label{flex:1;margin:0}#preset-name{width:100%}#preset-confirmation{padding:12px;background:#553b31;border-radius:8px;margin-top:10px}#ptz-close{justify-self:start}.playback-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0}.playback-tools .check{margin:0}.clip-editor{border-top:1px solid var(--line);padding-top:12px}.clip-editor summary{cursor:pointer;margin-bottom:14px}#snapshot-dialog{width:min(1000px,92vw)}#snapshot-image{width:100%;max-height:65vh;object-fit:contain;background:#000;border-radius:8px}#play-position{font-size:13px;color:var(--muted)}@media(max-width:600px){.ptz-panel{right:12px;bottom:12px;padding:12px;gap:12px}.ptz-panel .ptz-pad{grid-column:2}#preset-form{flex-wrap:wrap}#preset-form label{flex-basis:100%}}.settings-sections,.view-presets{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0 22px}.settings-sections button[aria-pressed=true],.view-presets button[aria-pressed=true]{background:var(--accent,#30594e);color:var(--paper,#fff);border-color:var(--accent,#30594e)}.group-custom{margin:16px 0}.group-custom summary{cursor:pointer;padding:10px 0}.device-search-row>button{align-self:end}.journal-entry.just-saved{outline:2px solid var(--accent,#30594e);outline-offset:4px;scroll-margin-block:24px}.family-workspace{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:18px;align-items:start}.family-canvas-panel{background:#17262b;border:1px solid #39504f;border-radius:14px;overflow:hidden;min-width:0}.family-map-heading{padding:22px 22px 16px;display:flex;justify-content:space-between;align-items:center;gap:14px}.family-map-heading h2{font-size:23px;margin:8px 0 0;letter-spacing:2px}.family-map-heading .eyebrow{font-size:9px}.family-view-tabs{display:flex;border:1px solid var(--line);border-radius:8px;padding:3px;flex-shrink:0}.family-view-tabs button{border:0;padding:8px 12px;border-radius:5px;font-size:12px}.family-view-tabs [aria-pressed=true]{background:#30574c;color:#b8f2df}.family-map-controls{padding:0 20px 16px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}.family-map-controls button{font-size:12px;padding:7px 10px}.family-zoom-controls{display:flex;gap:5px;align-items:center;margin-right:auto}.family-zoom-controls output{font-size:11px;min-width:38px;text-align:center;color:var(--muted)}.family-map-viewport{height:clamp(440px,65vh,740px);overflow:auto;background-color:#e8eeea;background-image:radial-gradient(#b5c5bb 1px,transparent 1px);background-size:22px 22px;position:relative;overscroll-behavior:contain;cursor:grab;scrollbar-color:#82988b #dce5de;scrollbar-width:thin;outline-offset:-3px}.family-map-viewport.panning{cursor:grabbing;user-select:none}.family-map-space{position:relative;min-width:100%;min-height:100%}.family-map-surface{position:absolute;left:0;top:0;transform-origin:0 0}.family-map-lines{position:absolute;inset:0;overflow:visible;pointer-events:none}.family-edge{fill:none;stroke:#86a299;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.family-edge.spouse{stroke:#bd9050;stroke-dasharray:5 4;stroke-width:2}.family-edge.nonbiological{stroke:#9987b4;stroke-dasharray:4 3}.family-edge.focused{stroke-width:2.6;stroke:#337b66}.family-edge.spouse.focused{stroke:#ab791e}.family-edge.nonbiological.focused{stroke:#7b55a2}.family-branch-label{position:absolute;color:#536c60;font-size:12px;letter-spacing:1px;pointer-events:none}.family-node{position:absolute;border:1px solid #c4d0c7;border-radius:12px;background:#fffef9;color:#273e33;padding:13px 15px;text-align:left;white-space:normal;box-shadow:0 4px 11px #263c3010;display:flex;flex-direction:column;gap:4px;overflow:visible;cursor:pointer;transition:box-shadow .15s,border-color .15s}.family-node:hover{filter:none;box-shadow:0 6px 20px #30583d30;border-color:#5b9179}.family-node:focus-visible{outline:3px solid #205a48;outline-offset:4px}.family-node>strong{font-size:16px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-right:30px}.family-node-top{position:absolute;right:12px;top:12px}.family-node-avatar{display:flex;width:28px;height:28px;align-items:center;justify-content:center;background:#e9f0e8;border-radius:9px;font-family:"Noto Serif SC",SimSun,serif;color:#48745c;font-size:17px}.family-node-flags{position:absolute;right:0;top:36px;display:grid;gap:4px;justify-items:end;white-space:nowrap}.family-node-flags>small{font-size:9px;color:#748375}.family-node .family-node-relation{display:block;font-size:11px;color:#577868;max-width:120px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.family-node>small{font-size:10px;color:#7a8a80;margin-top:auto}.family-node.self{background:#f6d795;border:2px solid #c49337;box-shadow:0 5px 18px #b487242e}.family-node.self .family-node-avatar{background:#fbe8bd;color:#82561f}.family-node.self>strong{color:#5d3d15}.family-node.self .family-node-relation,.family-node.self>small{color:#7d622f}.self-badge{display:inline-block;border-radius:4px;background:#996e2b;color:#fff4d7;padding:2px 5px;font-size:9px;font-weight:600;letter-spacing:.5px}.family-node.selected{outline:3px solid #3d9175;outline-offset:4px}.family-node.search-hit:after{content:"匹配";position:absolute;left:12px;top:-12px;padding:2px 6px;border-radius:4px;background:#315f8d;color:#fff;font-size:9px;box-shadow:0 2px 4px #0002}.family-node.archived{border-style:dashed}.family-map-footer{padding:15px 20px;border-top:1px solid #a4b7a41f}.family-map-legend{display:flex;gap:15px;flex-wrap:wrap;font-size:11px;color:#a5bbb4;margin-bottom:9px}.family-map-legend>span{display:flex;align-items:center;gap:6px}.family-map-legend i{display:inline-block;width:19px;height:2px;background:#86a299}.family-map-legend i.legend-self{width:11px;height:11px;background:#f6d795;border-radius:3px}.family-map-legend i.legend-selected{width:11px;height:11px;background:transparent;border:2px solid #64bc9d;border-radius:3px}.family-map-legend i.legend-spouse{background:none;border-top:2px dashed #bd9050}.family-map-legend i.legend-adoptive{background:none;border-top:2px dashed #aa98c4}.family-map-footer .description{font-size:11px;margin:0;line-height:1.8}.family-map-footer #family-map-note:not(:empty){padding:8px 0;color:#c9bc9a}.family-inspector{position:sticky;top:18px;max-height:calc(100vh - 36px);overflow:auto;margin:0;padding:20px;min-width:0;scrollbar-width:thin}.family-inspector.is-self{border-color:#b08848;background:linear-gradient(145deg,#343323,#18272a 55%)}.family-self-heading{color:#e8c780;font-size:12px;margin-bottom:18px}.family-back-to-map{display:block;margin:0 0 18px auto;font-size:11px}#family-detail .section-head{gap:12px;flex-wrap:wrap}#family-detail .section-head>div{display:block}#family-detail .section-head h2{font-size:23px;overflow-wrap:anywhere}#family-detail dl{grid-template-columns:1fr;gap:12px;margin:18px 0 24px}#family-detail dl>div{grid-template-columns:76px minmax(0,1fr);gap:9px}#family-detail h3{font-size:14px;margin-top:24px}#family-detail .family-link{align-items:flex-start;overflow-wrap:anywhere;font-size:12px}#family-detail .family-link .quiet{padding:5px 8px;font-size:11px}#family-detail .family-prose{font-size:13px}.family-register{grid-template-columns:repeat(auto-fill,minmax(180px,1fr));max-height:clamp(440px,65vh,740px);overflow:auto;padding:20px;align-content:start;background:#132226}.person-card.self{background:#463e27;border-color:#b28f50;color:#f1dca7}.person-card.self span:not(.self-badge){color:#e0c995}.person-card.self small{color:#b8a98b}.person-card.selected{outline:2px solid #63b89c;outline-offset:-2px}.family-map-viewport>.empty{border:0;background:transparent;color:#5c7567;height:100%;display:flex;flex-direction:column;justify-content:center;margin:0}.family-map-viewport>.empty h3{color:#314d3d}.family-toolbar #family-search{width:190px}.family-toolbar #family-reference{max-width:180px}.family-toolbar{gap:12px}.family-workspace:is(:fullscreen,.family-expanded){width:100vw;height:100dvh;background:#10191d;padding:16px;align-items:stretch;overflow:auto}.family-workspace:is(:fullscreen,.family-expanded) .family-canvas-panel{height:100%;display:flex;flex-direction:column}.family-workspace:is(:fullscreen,.family-expanded) .family-map-viewport{flex:1;height:auto;min-height:200px}.family-workspace:is(:fullscreen,.family-expanded) .family-register{max-height:none;flex:1}.family-workspace:is(:fullscreen,.family-expanded) .family-inspector{position:static;max-height:100%;overflow:auto}.family-workspace:is(:fullscreen,.family-expanded) .family-map-heading{padding:14px 20px}.family-workspace:is(:fullscreen,.family-expanded) .family-map-footer{padding:10px 20px}@media(max-width:1250px){.family-workspace{grid-template-columns:minmax(0,1fr) 270px}.family-map-heading{align-items:flex-start;flex-wrap:wrap}.family-map-controls{gap:6px}.family-map-controls button{padding:7px 8px}.family-inspector{padding:16px}.family-toolbar>span{margin-left:0}}@media(max-width:1000px){.family-workspace{grid-template-columns:1fr}.family-inspector{position:static;max-height:none}.family-map-viewport{height:560px}.family-register{grid-template-columns:repeat(auto-fill,minmax(180px,1fr));max-height:560px}.family-workspace:is(:fullscreen,.family-expanded){display:flex;flex-direction:column;gap:10px}.family-workspace:is(:fullscreen,.family-expanded) .family-canvas-panel{min-height:65vh;flex:1;flex-shrink:0}.family-workspace:is(:fullscreen,.family-expanded) .family-inspector{max-height:35vh;flex-shrink:0}}@media(max-width:600px){#page-family>.section-head{align-items:flex-start;flex-wrap:wrap}#page-family>.section-head>div{gap:7px;flex-wrap:wrap}#page-family>.section-head button{font-size:12px;padding:8px 10px}.family-toolbar{padding:15px}.family-toolbar label{width:100%;display:flex;justify-content:space-between;flex-wrap:nowrap}.family-toolbar label.check{justify-content:flex-start}.family-toolbar input,.family-toolbar #family-search,.family-toolbar #family-reference{width:60%;max-width:60%}.family-toolbar input[type=checkbox]{width:16px}.family-map-heading{padding:17px 15px}.family-map-heading h2{font-size:21px}.family-map-controls{padding:0 12px 14px}.family-map-footer{padding:13px 15px}.family-map-legend{gap:10px}.family-map-viewport{height:470px}.family-register{grid-template-columns:1fr 1fr;padding:12px;gap:10px}.family-register .person-card{padding:12px}.family-workspace:is(:fullscreen,.family-expanded){padding:8px}.family-map-footer>.description:last-child{font-size:10px}}.family-map-heading{flex-wrap:wrap}.family-view-tabs{max-width:100%;flex-wrap:wrap}.family-view-tabs button{font-size:11px}.family-event-intro{display:flex;justify-content:space-between;gap:15px;padding:8px 22px 12px;align-items:flex-start}.family-event-intro h3{font-size:16px;line-height:1.7;margin:0 0 7px}.family-event-intro p{margin:0}.family-event-intro button{font-size:12px;padding:9px 12px}.family-event-filters{display:flex;gap:12px;flex-wrap:wrap;padding:15px 22px;background:#101e2366;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.family-event-filters label{display:flex;font-size:12px;gap:7px;flex-wrap:wrap}.family-event-filters input:not([type=checkbox]){width:170px}.family-event-filters select{max-width:180px;font-size:12px;padding:8px}.family-event-filters .check{width:100%;font-size:11px}.family-event-filters button{font-size:11px;padding:7px 10px}.family-event-filters #family-event-state-label{margin-right:auto}#family-event-count{padding:16px 22px 0;margin-bottom:0}.family-timeline{padding:0 22px 28px;max-height:680px;overflow:auto;scrollbar-width:thin}.timeline-year{font-family:Georgia,SimSun,serif;color:#a4d6c3;font-size:27px;margin:30px 0 18px;letter-spacing:1px}.timeline-year span{font-family:inherit;font-size:12px;color:var(--muted);margin-left:8px}.timeline-event{display:flex;align-items:flex-start;gap:18px;position:relative;width:100%;background:transparent;color:inherit;text-align:left;padding:0 0 24px;border-radius:0;border:0;white-space:normal}.timeline-event:hover{filter:none}.timeline-event:before{content:"";position:absolute;left:85px;top:10px;bottom:-10px;border-left:1px solid #466659}.timeline-event:after{content:"";position:absolute;left:81px;top:6px;width:9px;height:9px;border-radius:50%;background:#7eccac;box-shadow:0 0 0 4px #1c342d}.timeline-event>time{font-size:12px;font-weight:400;color:#9bb3ae;flex:0 0 70px;margin-top:1px}.timeline-event-body{margin-left:12px;flex:1;min-width:0;border:1px solid #345248;border-radius:10px;padding:17px 19px;background:#20352f;display:flex;flex-direction:column;gap:11px}.timeline-event:hover .timeline-event-body{border-color:#71ad94;background:#264037}.timeline-event-body>strong{font-size:17px;line-height:1.6;color:#dfebe5;overflow-wrap:anywhere}.timeline-event-status{font-size:9px;color:#9fc8b7;letter-spacing:1px}.timeline-summary{font-size:12px;color:#a4beb2;line-height:1.8;font-weight:400;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-line;overflow-wrap:anywhere}.timeline-event-body>small{font-size:11px;color:#acc9b5;font-weight:400}.timeline-read{font-size:11px;color:#83d6b5;font-weight:400}.timeline-event.draft .timeline-event-body{border-style:dashed;background:#282e30}.timeline-event.draft:after{background:#aea087}.event-associated{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:22px 0}.event-associated button{font-size:12px}.event-detail-meta{display:flex;gap:15px;justify-content:space-between;align-items:flex-start;margin:20px 0;color:#97baac;font-size:12px}.event-detail-meta time{line-height:1.8}#event-detail-title{font-size:26px;line-height:1.6;overflow-wrap:anywhere}.event-lead{border-left:3px solid #8cb8a1;background:#233a32;padding:14px 18px;white-space:pre-wrap;font-size:14px;overflow-wrap:anywhere}.event-article{font-size:15px;line-height:2;margin:28px 0;color:#c9d9d1}.event-source{display:inline-block;white-space:normal;overflow-wrap:anywhere;line-height:1.7;margin:8px 0}.event-updated{border-top:1px solid var(--line);padding-top:18px;margin-top:22px}#event-person-choices{display:flex;gap:12px;flex-wrap:wrap;max-height:170px;overflow:auto;padding:14px 0}#event-person-choices label{display:flex;flex-direction:row;align-items:center}.event-editor-actions{gap:12px}.person-events{border-top:1px solid var(--line);margin-top:25px;padding-top:15px}.person-events .section-head{gap:8px}.person-events .section-head h3{margin:0!important;font-size:13px!important}.person-events .section-head small{letter-spacing:0;margin-left:4px}.person-events .section-head button{font-size:10px;padding:6px 7px}.person-event-link{display:flex;flex-direction:column;gap:6px;border:0;background:transparent;color:#c0d6c9;text-align:left;padding:10px 0;margin-bottom:8px;white-space:normal;line-height:1.7;font-size:12px}.person-event-link time{font-size:10px;color:#87a495}.family-workspace:is(:fullscreen,.family-expanded) #family-events{overflow:auto}.family-workspace:is(:fullscreen,.family-expanded) .family-timeline{max-height:none}@media(max-width:600px){.family-event-intro{flex-wrap:wrap;padding:8px 15px 15px}.family-event-filters{padding:15px;gap:10px}.family-event-filters label{font-size:11px}.family-event-filters .check{line-height:1.8;flex-wrap:nowrap}.family-timeline{padding:0 15px 22px}.timeline-event{gap:8px}.timeline-event>time{font-size:10px;flex-basis:55px}.timeline-event:before{left:62px}.timeline-event:after{left:58px}.timeline-event-body{padding:13px;margin-left:9px}.timeline-event-body>strong{font-size:15px}.family-view-tabs button{padding:8px 10px}#event-detail-title{font-size:22px}.event-detail-meta,.event-editor-actions{flex-wrap:wrap}}.family-workspace.family-expanded{position:fixed;inset:0;z-index:8}.family-map-viewport{scrollbar-gutter:stable;overflow-anchor:none}.family-map-space{min-width:0;min-height:0;overflow:clip}.family-workspace:is(:fullscreen,.family-expanded){min-height:0;grid-template-rows:minmax(0,1fr)}.family-workspace:is(:fullscreen,.family-expanded) .family-canvas-panel{min-height:0}.family-workspace:is(:fullscreen,.family-expanded) .family-map-heading,.family-workspace:is(:fullscreen,.family-expanded) .family-map-controls,.family-workspace:is(:fullscreen,.family-expanded) .family-map-footer{flex-shrink:0}.family-workspace.family-expanded{z-index:1100}@media(max-width:1000px){.family-workspace:is(:fullscreen,.family-expanded) .family-canvas-panel{min-height:65vh}}#history-dialog{width:min(1040px,94vw)}#history-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;max-height:260px;overflow:auto;margin:16px 0}.history-entry{text-align:left;display:flex;flex-direction:column;align-items:flex-start;gap:6px;white-space:normal}.history-entry small,.history-entry span{color:var(--muted);font-size:12px}.history-columns{display:grid;grid-template-columns:1fr 1fr;gap:20px}.history-columns section{min-width:0}.history-columns dd{white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;overflow:auto}.history-columns dl>div{padding:10px;border-bottom:1px solid #30434a}.history-changed{background:#27443e66;border-radius:8px}#history-confirm{padding:16px;border:1px solid #74d0b7;border-radius:12px;margin-top:18px}#history-confirm button{margin:6px}#history-error:empty{display:none}@media(max-width:650px){.history-columns{grid-template-columns:1fr}#history-list{max-height:200px}}:root{color-scheme:light;--paper: #f4f0e7;--ink: #2d3932;--muted: #6e6b5f;--line: #dcd5c6;--panel: #fffdf8;--accent: #315b4d;--cinnabar: #9e4b3d;--gold: #86682f;--serif: "Songti SC", "STSong", "SimSun", serif;--timeline-paper: #ede8dd;--timeline-grid: #d3ccbc;--timeline-range: #4c7761;color:var(--ink);background:var(--paper);font-family:Microsoft YaHei,PingFang SC,system-ui,sans-serif}body{background-image:radial-gradient(ellipse at 85% 0,#e4e9df80,transparent 50%);min-width:0}::selection{background:#e8d7ad;color:#2d3932}button,.button,input,select,textarea,fieldset{border-radius:5px}button,.button{background:var(--accent);color:#fffdf6;font-weight:500;transition:background .15s,border-color .15s,box-shadow .15s}button:hover,.button:hover{filter:brightness(.95)}.secondary{background:#e8ede5;color:#315b4d;border-color:#c7d3c4}.quiet{background:transparent;color:#586653;border-color:#cfcfbf}input,select,textarea{color:var(--ink);background:#fffefa;border-color:#cbc5b6}input::placeholder,textarea::placeholder{color:#847f72}input:focus,select:focus,textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px #315b4d12}input[type=range],input[type=checkbox]{accent-color:var(--accent)}label,.family-date legend{color:#625f53}h1,h2,h3{font-family:var(--serif);font-weight:600}h1{font-size:34px;letter-spacing:4px;margin-top:17px}h2{letter-spacing:1px}.sidebar{width:222px;background:#213d34;background-image:linear-gradient(145deg,#2d4b3d,transparent 60%);border-right:1px solid #425344;padding:30px 18px 20px;color:#ebe7d8;scrollbar-width:thin;scrollbar-color:#6f8271 #213d34}.sidebar .brand{gap:11px;padding:4px 5px 30px;color:#f3eddf;font-family:var(--serif);font-size:22px;letter-spacing:2px}.brand-icon{width:44px;height:44px;border-radius:5px;outline:1px solid #c6b98c66;outline-offset:3px}.brand small{font-family:Microsoft YaHei,sans-serif;color:#c0c7b5;font-size:9px;letter-spacing:2px;margin-top:10px}.nav-label{color:#b2bba6;font-size:10px;padding:12px 13px 17px;letter-spacing:3px;border-top:1px solid #b9c2aa24}.sidebar nav{gap:5px}.sidebar nav button{color:#c9d1be;border-radius:4px;padding:12px 13px;gap:13px;position:relative;border:1px solid transparent;background:transparent}.sidebar nav button span{font-size:13px;letter-spacing:.6px}.sidebar nav button:hover{background:#ffffff09;filter:none}.sidebar nav button.active{background:#efebdc;border-color:#e0d6b8;color:#244638}.sidebar nav button.active:after{content:"";width:5px;height:5px;background:var(--cinnabar);position:absolute;right:13px;transform:rotate(45deg)}.sidebar .side-note{padding:22px 5px 8px;color:#c4ccb9;font-size:11px}.sidebar .dot{background:#afc39c;width:5px;height:5px}.sidebar #current-user{color:#d3d7c8;padding:10px 5px 0;border-top:1px solid #b9c2aa24}.sidebar .quiet{color:#d1d6c6;border-color:#8b9a813f;padding:9px;font-size:11px}.sidebar #account-password{margin-bottom:8px}.sidebar :focus-visible{outline-color:#e7c887}main{margin-left:222px;padding:30px 38px 22px;max-width:1900px}main>header{min-height:142px;padding:13px 0 23px;margin-bottom:25px;border-bottom:1px solid #b4b5a2;position:relative;gap:24px;isolation:isolate}main>header:after{content:"";position:absolute;bottom:-2px;left:0;height:3px;width:48px;background:var(--cinnabar)}main>header>div{position:relative;z-index:1}.eyebrow{color:var(--gold);font-size:10px;letter-spacing:3px}header p{color:#686f60;font-size:12px;letter-spacing:.5px}.header-status{color:#666e5e;gap:12px;font-size:11px;flex-shrink:0}.courtyard-landscape{position:absolute;width:330px;height:125px;right:5px;bottom:0;z-index:0;pointer-events:none;opacity:.55}.badge{background:#e4eddf;color:#355b3d;border:1px solid #c8d6be;border-radius:3px;font-size:10px}.badge.off{background:#f2e8d9;color:#835428;border-color:#dfc6a3}.metrics{background:#fcfaf4;border-radius:6px;box-shadow:0 3px 12px #3a402905}.metrics>div{padding:20px 22px;align-items:baseline}.metrics span{color:#6f7260}.metrics strong{font-family:Georgia,var(--serif);color:#365846;font-size:29px}.filter-row{color:#6e6b5f;margin:24px 0}.household-context{display:flex;flex-wrap:wrap;align-items:center;gap:12px 24px;margin:-5px 0 24px;padding:12px 16px;border-left:3px solid var(--gold);background:#eae8dc}.household-context span{font-size:11px;color:var(--muted)}.household-context select{min-width:140px;max-width:240px}.section-head{margin-top:25px}.section-head small{color:#8a7859;font-size:9px;letter-spacing:2px}.wall-toolbar{padding:12px 15px;background:#eae8dc;border:1px solid var(--line);border-radius:5px;gap:14px}.wall-toolbar select{background:#f9f6ed}.live-grid{gap:22px}.camera-card,.site-card,.panel,.empty,.family-canvas-panel{border-radius:6px;box-shadow:0 4px 18px #39422a05}.camera-card{border-color:#d2cebe}.camera-meta{padding:17px 18px 13px}.camera-meta strong{font-family:var(--serif);font-size:16px;letter-spacing:.5px}.camera-meta p{color:#737464;margin-top:7px}.camera-actions{flex-wrap:wrap;gap:7px;padding-bottom:16px}.camera-actions .quiet{border-color:#dbd9cb;color:#52604d;background:#faf9f2}.video-panel{border-radius:5px;border-color:#c1c6b8}.video-empty{color:#b0bdae;background:radial-gradient(ellipse at center,#243d34 0,transparent 70%)}.video-empty .lens{color:#a5bca4}.video-error{color:#f6d7c1;background:#472c26ed}.empty{color:#6c7462;border-color:#c3c6b6}.empty h3{color:#384e3b;font-size:21px}.panel{padding:24px}.time-labels{color:#6e705e}.recording-item{color:#35533f;background:#f9f7ee;border-color:#d5d1c0}.recording-item small{color:#737261}.scan-chip{background:#fffdf7;border-radius:5px}.device-table{border-radius:5px}.device-table th{color:#6a6d5c;background:#ecebde}.device-table td small{color:#737261}.device-table tbody tr:hover{background:#f2f1e7}.site-card h3{font-size:20px}.site-card dt{color:#737261}.site-card dd{color:#384e3b}.audit-item{color:#56654f}.audit-item small{color:#767461}.banner{color:#784c26;background:#f6e9cf;border-color:#dfc797}dialog{background:#fbf8ef;color:var(--ink);border:1px solid #d5c8ac;border-radius:8px;box-shadow:0 28px 100px #172c3455;padding:30px}dialog::backdrop{background:#20382cb8;backdrop-filter:blur(5px)}.dialog-heading{border-bottom:1px solid var(--line);padding-bottom:20px;gap:16px}.dialog-heading h2{font-size:23px}.dialog-footer{gap:10px;flex-wrap:wrap}#auth-dialog{border-top:4px solid var(--cinnabar);padding:38px;background-image:radial-gradient(ellipse at 100% 0,#e4e9dd,transparent 65%)}#auth-dialog .brand-icon{width:52px;height:52px}#auth-form h2{font-size:32px;letter-spacing:3px;margin-top:26px}#auth-form p{color:#6b725d}.form-error{color:#994437}footer{color:#716b5b;font-size:10px;letter-spacing:.5px}#toast{background:#2a4c3c;color:#f3efdc;border-color:#819672;border-radius:5px;box-shadow:0 8px 25px #30433726;max-width:calc(100vw - 30px)}.ptz-panel{background:#f8f5eb;border-color:#b9c5ad;border-radius:7px;box-shadow:0 12px 50px #26392d44;color:var(--ink)}.ptz-pad [data-ptz-action=stop]{color:#8b4236;background:#efdbd0;border-color:#d5b2a4}#preset-confirmation{background:#f4e2d5}#snapshot-image{border-radius:4px}.family-canvas-panel{background:#fcfaf3;border-color:#c7cbb7}.family-map-heading{padding-top:24px}.family-map-heading h2{letter-spacing:3px;font-size:25px}.family-view-tabs{background:#f1eee2;border-color:#d7d0bf;border-radius:4px}.family-view-tabs button{color:#606650;border-radius:2px}.family-view-tabs [aria-pressed=true]{background:#365945;color:#fffbed}.family-map-viewport{background-color:#efece0;background-image:radial-gradient(#c9cbbb 1px,transparent 1px);scrollbar-color:#8b9a7b #e8e6d8}.family-map-lines marker path{fill:#678b71}.family-edge{stroke:#94a58a}.family-edge.focused{stroke:#446b50}.family-edge.spouse{stroke:#a9854f}.family-edge.nonbiological{stroke:#93829e}.family-node{background:#fffdf6;border-color:#c9cdb9;border-radius:5px;color:#304632;box-shadow:0 3px 12px #3943250d}.family-node>strong{font-family:var(--serif);font-size:17px}.family-node-avatar{background:#e8ecdf;color:#536e45;border-radius:4px}.family-node .family-node-relation{color:#53664a}.family-node>small,.family-node-flags>small{color:#6f775f}.family-node.self{background:#f1ddb0;border-color:#af873f;box-shadow:0 5px 18px #b4872425}.family-node.self .family-node-avatar{background:#f8eac9}.family-node.selected{outline-color:#426c50}.family-node.search-hit:after{background:#596b78}.self-badge{background:#94682f;color:#fff8e9;border-radius:2px}.family-map-footer{border-color:#d0d3c0}.family-map-legend{color:#69705b}.family-map-footer #family-map-note:not(:empty){color:#87652f}.family-inspector.is-self{background:linear-gradient(135deg,#f3e3bd,#fcfaf1 65%);border-color:#c3a66b}.family-self-heading{color:#88652d;letter-spacing:1px}.family-register{background:#eeecdf}.person-card{color:#344732;border-color:#c9cbb9}.person-card.selected{background:#e6ecdc;outline-color:#66845b}.person-card.self{background:#f1ddb0;border-color:#b89553;color:#5f461f}.person-card.self span:not(.self-badge),.person-card.self small{color:#765b2e}.family-tree ul{border-color:#a2b197}.family-workspace:is(:fullscreen,.family-expanded){background:var(--paper)}.family-event-filters{background:#f0eee2}.timeline-year{color:#456344;font-family:var(--serif)}.timeline-event:before{border-color:#b7c2a5}.timeline-event:after{background:#768d5f;box-shadow:0 0 0 4px #e7ebdc}.timeline-event>time{color:#6c745d}.timeline-event-body{background:#fffdf6;border-color:#d3d6c2;border-radius:5px}.timeline-event:hover .timeline-event-body{background:#f7f7ec;border-color:#8caa78}.timeline-event-body>strong{color:#344d32;font-family:var(--serif);font-size:18px}.timeline-event-status,.timeline-summary,.timeline-event-body>small{color:#6b725b}.timeline-read{color:#41623b}.timeline-event.draft .timeline-event-body{background:#efede3}.timeline-event.draft:after{background:#a28a62}.event-detail-meta,.person-event-link time{color:#71745e}.event-lead{background:#eaecdd;border-color:#8e9f77;color:#46553b}.event-article{color:#424c3a}.person-event-link{color:#455a3c}.history-columns dl>div{border-color:#d9d6c4}.history-changed{background:#e8ecda;border-radius:4px}#history-confirm{border-color:#b3be98;border-radius:5px;background:#efefdf}#page-live:fullscreen{--muted: #c0c9b4;--line: #52614d;--panel: #25352c;color:#efecdd;background:#111c16;color-scheme:dark}#page-live:fullscreen .wall-toolbar{background:#24372b;border-color:#40543e}#page-live:fullscreen label{color:#d9deca}#page-live:fullscreen select{background:#1a2a20;color:#ebeede;border-color:#65765a}#page-live:fullscreen .quiet{color:#d9dfca;border-color:#66765a;background:transparent}#page-live:fullscreen .camera-card{border-color:#394f38}#page-live:fullscreen .camera-actions{background:#17251ee8}#page-live:fullscreen .ptz-panel{--muted: #6e6b5f;--line: #dcd5c6;color-scheme:light}#page-live:fullscreen .ptz-panel label,#page-live:fullscreen .ptz-panel .quiet{color:#586653;border-color:#cfcfbf}@media(min-width:1600px){main{padding-left:46px;padding-right:46px}}@media(max-width:1100px){.sidebar{width:200px;padding:27px 14px 18px}.sidebar .brand{font-size:20px;gap:9px}.brand-icon{width:38px;height:38px}main{margin-left:200px;padding:24px}.metrics>div{padding:18px 14px}.metrics strong{font-size:25px}.courtyard-landscape{width:260px;opacity:.4}}@media(max-width:760px){.sidebar{position:static;width:auto;padding:22px 17px 14px;display:grid;grid-template-columns:1fr auto;gap:0 10px;overflow:visible}.sidebar .brand{padding:2px 4px 20px;font-size:22px;grid-column:1/-1}.brand-icon{width:38px;height:38px}.brand small{font-size:9px}.sidebar nav{grid-column:1/-1;display:flex;overflow-x:auto;gap:5px;padding-bottom:12px;scrollbar-width:thin;scrollbar-color:#819573 #213d34}.sidebar nav button{padding:10px 12px;gap:7px;flex-shrink:0}.sidebar nav button span{font-size:12px}.sidebar nav button.active:after{display:none}.sidebar #current-user{position:static;grid-column:1/-1;margin:4px 0 10px;padding-top:12px;font-size:11px}.sidebar #account-password,.sidebar #logout{margin:0;font-size:11px;padding:8px 12px;align-self:center;width:fit-content}.sidebar #logout{justify-self:end}main{margin:0;padding:20px 17px}main>header{min-height:132px;padding-top:9px;gap:10px;margin-bottom:20px}h1{font-size:28px;letter-spacing:3px}.eyebrow{font-size:9px;letter-spacing:2px}.header-status{font-size:9px;gap:9px;max-width:123px;padding-top:2px}.header-status .badge{font-size:9px}header p{max-width:205px;font-size:11px;line-height:1.8}.courtyard-landscape{width:170px;height:90px;right:0;opacity:.38}.metrics>div{padding:16px}.metrics strong{font-size:25px}.metrics>div:nth-last-child(-n+2){border-bottom:0}.filter-row{margin:20px 0}.filter-row select{max-width:155px}.filter-row>button{padding:9px}.section-head{flex-wrap:wrap}.section-head>div{gap:10px}.wall-toolbar{padding:11px;gap:10px}.wall-toolbar label{font-size:12px}#wall-fullscreen{padding:10px 12px}.camera-meta{padding:14px}.camera-meta strong{font-size:15px}.camera-actions{padding:0 14px 14px;gap:8px}.camera-actions button{padding:9px 11px}.panel,.site-card{padding:18px}.family-map-heading h2{font-size:23px}dialog{padding:22px}#auth-dialog{padding:30px 26px}.dialog-heading h2{font-size:21px}.dialog-footer{gap:8px}footer{gap:16px;flex-wrap:wrap;font-size:9px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important}}.household-actions{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0}.household-context select{max-width:100%}.household-context label{min-width:0}.device-actions,.device-search-row,.device-group-order,.group-step{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.device-search-row{align-items:end}.device-search-row label{flex:1;min-width:160px}.device-group-order{margin:12px 0}.group-step{padding:7px;background:var(--paper);border:1px solid var(--line);border-radius:5px}.group-step select{width:auto;max-width:145px}.group-step button{padding:7px 11px}.group-step>span{color:var(--muted)}.device-group{margin:26px 0}.device-group>h3{font-family:var(--serif);font-size:20px;overflow-wrap:anywhere}.device-group>h3>span{color:var(--gold);padding:0 8px}.device-group>h3 small{font:12px var(--sans);color:var(--muted);white-space:nowrap}.device-tags{display:flex;flex-wrap:wrap;gap:6px}.device-tags span{font-size:11px;padding:3px 8px;background:var(--paper);border:1px solid var(--line)}.site-card dd,.site-card .description{overflow-wrap:anywhere;min-width:0}@media(max-width:600px){.device-actions{width:100%}.device-actions button{flex:1;white-space:normal}.group-step{width:100%}.group-step select{flex:1;max-width:none;min-width:0}.device-group>h3{font-size:18px}}#scope-navigation{border-left:1px solid #6d8270;margin:12px 0 12px 10px;padding-left:9px}#scope-navigation .nav-label{padding:10px 12px;overflow-wrap:anywhere}.device-context{padding:18px 22px;margin:20px 0;border:1px solid var(--line);border-left:4px solid var(--accent);background:var(--panel)}.device-context p{color:var(--muted);overflow-wrap:anywhere;margin:0 0 14px}.device-context [role=group]{display:flex;flex-wrap:wrap;gap:8px}.device-context button.active{color:var(--paper);background:var(--accent)}.device-title{border:0;padding:0;background:transparent;color:var(--ink);font:inherit;text-align:left;box-shadow:none;white-space:normal;overflow-wrap:anywhere}.device-title:hover{color:var(--accent);background:transparent}.device-title span{color:var(--accent)}.scope-intro{padding:28px 0}.scope-intro h2{font:500 32px var(--serif);margin:12px 0}.scope-intro p{color:var(--muted);line-height:1.8}.steward-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.steward-tile{display:flex;flex-direction:column;text-align:left;gap:12px;min-height:190px;padding:28px;border:1px solid var(--line);border-top:3px solid var(--accent);background:var(--panel);color:var(--ink);white-space:normal;box-shadow:0 3px 12px #22332208}.steward-tile strong{font-size:23px;font-family:var(--serif);font-weight:500}.steward-tile span,.steward-tile small{color:var(--muted);line-height:1.7}.steward-tile:hover{background:var(--paper);border-color:var(--accent)}#device-detail dl,#heritage-detail dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}#device-detail dl>div,#heritage-detail dl>div{border-bottom:1px solid var(--line);padding-bottom:12px}#device-detail dt,#heritage-detail dt{font-size:12px;color:var(--muted);margin-bottom:6px}#device-detail dd,#heritage-detail dd{margin:0;overflow-wrap:anywhere}.heritage-prose{white-space:pre-wrap;line-height:1.9;overflow-wrap:anywhere;margin:24px 0}#heritage-detail{margin-top:24px}.heritage-controls{display:flex;gap:18px;flex-wrap:wrap;align-items:center;margin-bottom:22px}.heritage-controls label{min-width:0}.household-context{flex-wrap:wrap}@media(max-width:720px){.steward-grid{grid-template-columns:1fr}.steward-tile{min-height:150px;padding:22px}.device-context{padding:16px}.device-context button{flex:1 1 40%;min-width:0}#device-detail dl,#heritage-detail dl{grid-template-columns:1fr}#scope-navigation{display:flex;flex-wrap:wrap;border:0;margin:0;padding:0;width:100%}#scope-navigation .nav-label{width:100%;padding:8px 4px}.scope-intro h2{font-size:26px}}#household-list{display:block}.home-city-group{margin:24px 0 36px}.home-city-group>h3{font-size:21px}.home-city-group>h3 small{font:12px sans-serif;color:var(--muted);margin-left:12px}.home-card{padding:0;overflow:hidden}.home-cover{position:relative;min-height:210px;background:linear-gradient(145deg,#4b6957,#253d34);isolation:isolate;color:#fffdf6}.home-cover>img{position:absolute;width:100%;height:100%;object-fit:cover;inset:0;z-index:-2}.home-cover:after{content:"";position:absolute;inset:0;background:linear-gradient(0deg,#102019db,transparent);z-index:-1}.home-cover-content{padding:24px;min-height:210px;display:flex;flex-direction:column;justify-content:end}.home-cover .site-heading{margin-bottom:auto}.home-cover h3{margin:26px 0 4px;color:#fffdf6;text-shadow:0 1px 3px #000a;font-size:25px}.home-cover .quiet{background:#172a25ba;color:#fff;border-color:#bccabd80}.home-cover .badge{background:#f9f5e5e8;color:#244638;border-color:transparent}.home-location{font-size:12px;margin:8px 0 0;color:#fffdf6}.home-cover-placeholder{position:absolute;top:88px;right:22px;opacity:.3;font:18px var(--serif);letter-spacing:5px}.home-card-body{padding:24px}.home-card-body .household-actions{margin-bottom:0}.cover-editor img{width:100%;max-height:230px;object-fit:contain;border:1px solid var(--line);margin-bottom:12px;background:var(--paper)}#page-settings h3{font-size:21px;margin-top:8px}#page-settings .form-grid{margin:22px 0}#page-settings input:not([type=checkbox]),#page-settings select{width:100%;min-width:0}.brand-image-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin:28px 0}.brand-image-grid>div{border:1px solid var(--line);padding:18px;border-radius:6px;min-width:0}.brand-image-grid img{width:80px;height:80px;object-fit:contain;background:var(--paper);border-radius:6px;display:block;margin-bottom:18px}.brand-image-grid label{display:grid;gap:12px;margin-bottom:14px}.config-import{font-size:12px;max-width:300px}.backup-row{display:grid;gap:8px;padding:18px 0;border-bottom:1px solid var(--line);font-size:12px}.backup-row small,.backup-row code{overflow-wrap:anywhere}.backup-row span{color:var(--muted)}#settings-error,#brand-status,#preferences-status,#backup-save-status,#backup-result{line-height:1.8;font-size:13px;overflow-wrap:anywhere}.brand #brand-name{overflow-wrap:anywhere;letter-spacing:1px}.brand #brand-subtitle{overflow-wrap:anywhere;line-height:1.8;letter-spacing:1px}html[data-backdrop=plain] body{background-image:none}html[data-backdrop=plain] .courtyard-landscape{display:none}html[data-font=sans]{--serif:"Microsoft YaHei","PingFang SC",system-ui,sans-serif}html[data-density=compact] main{padding:20px 26px}html[data-density=compact] main>header{min-height:100px;padding:6px 0 15px;margin-bottom:20px}html[data-density=compact] .panel,html[data-density=compact] .site-card:not(.home-card),html[data-density=compact] .home-card-body{padding:17px}html[data-density=compact] .sidebar nav button{padding:9px 12px}html[data-density=compact] .steward-tile{min-height:150px;padding:20px}html[data-density=compact] .metrics>div{padding:13px 18px}html[data-density=compact] .home-cover,html[data-density=compact] .home-cover-content{min-height:180px}html[data-theme=clean]{--paper:#f3f6fa;--ink:#203349;--muted:#53667d;--panel:#ffffff;--line:#d2dce7;--accent:#285ca0;--gold:#52657f;--cinnabar:#386ea8;--timeline-paper:#edf2f8;--timeline-grid:#cbd6e4;--timeline-range:#4c72a5;--surface-alt:#e8eff8;--side:#1e3551;--on-accent:#ffffff;color-scheme:light}html[data-theme=ink]{--paper:#151d22;--ink:#e3e9e5;--muted:#afbdb5;--panel:#202c32;--line:#46565a;--accent:#a2cab4;--gold:#d6bd83;--cinnabar:#e0a390;--timeline-paper:#26343b;--timeline-grid:#516369;--timeline-range:#91bda6;--surface-alt:#2a3940;--side:#132020;--on-accent:#13231c;color-scheme:dark}html[data-theme=clean] body,html[data-theme=ink] body{background-color:var(--paper);color:var(--ink)}html:is([data-theme=clean],[data-theme=ink]) .sidebar{background:var(--side);border-color:var(--line)}html:is([data-theme=clean],[data-theme=ink]) main>header{border-color:var(--line)}html:is([data-theme=clean],[data-theme=ink]) :is(.metrics,.panel,.site-card,.camera-card,.empty,.family-canvas-panel,.scan-chip,dialog){background-color:var(--panel);border-color:var(--line);color:var(--ink)}html:is([data-theme=clean],[data-theme=ink]) :is(.household-context,.wall-toolbar,.device-table th,.family-view-tabs,.family-map-viewport,#preset-confirmation){background-color:var(--surface-alt);color:var(--ink);border-color:var(--line)}html:is([data-theme=clean],[data-theme=ink]) :is(input,select,textarea){background:var(--panel);border-color:var(--line);color:var(--ink)}html:is([data-theme=clean],[data-theme=ink]) :is(input,textarea)::placeholder{color:var(--muted)}html:is([data-theme=clean],[data-theme=ink]) :is(label,header p,.header-status,.metrics span,.filter-row,.section-head small,.camera-meta p,.empty,.time-labels,.recording-item small,.device-table td small,.site-card dt,.audit-item,.audit-item small,footer,#auth-form p,.family-date legend){color:var(--muted)}html:is([data-theme=clean],[data-theme=ink]) :is(.metrics strong,.empty h3,.site-card dd){color:var(--ink)}html:is([data-theme=clean],[data-theme=ink]) button:not(.quiet):not(.secondary):not(.device-title):not(.steward-tile),html:is([data-theme=clean],[data-theme=ink]) .button{background:var(--accent);color:var(--on-accent)}html:is([data-theme=clean],[data-theme=ink]) :is(.quiet,.secondary,.recording-item,.camera-actions .quiet){background:var(--surface-alt);color:var(--ink);border-color:var(--line)}html:is([data-theme=clean],[data-theme=ink]) .sidebar nav button{background:transparent;color:#dbe5e4}html:is([data-theme=clean],[data-theme=ink]) .sidebar nav button.active{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}html:is([data-theme=clean],[data-theme=ink]) .sidebar>.quiet{background:transparent;color:#dbe5e4}html:is([data-theme=clean],[data-theme=ink]) #auth-dialog{background-image:none;background-color:var(--panel)}html:is([data-theme=clean],[data-theme=ink]) .device-table tbody tr:hover{background:var(--surface-alt)}html:is([data-theme=clean],[data-theme=ink]) .family-node{background:var(--panel);border-color:var(--line);color:var(--ink)}html:is([data-theme=clean],[data-theme=ink]) .family-node.self{background:#ebd6aa;color:#2b3b30;border-color:#b79a59}html:is([data-theme=clean],[data-theme=ink]) .family-node.self :is(small,span,strong){color:#2b3b30}html[data-theme=ink] :is(.form-error,.family-warning){color:#ffc8b6}html[data-theme=ink] .ptz-panel{background:var(--panel);color:var(--ink);border-color:var(--line)}html[data-theme=ink] .home-cover .quiet{background:#172a25df;color:#fff}html[data-theme=ink] body{background-image:radial-gradient(ellipse at 90% 0,#263c3340,transparent 65%)}@media(min-width:761px){html[data-layout=top] .sidebar{position:relative;width:100%;padding:16px 30px;display:flex;align-items:center;flex-wrap:wrap;gap:12px 22px;min-height:0;height:auto;border-right:0;border-bottom:1px solid var(--line)}html[data-layout=top] .sidebar .brand{padding:0;max-width:250px}html[data-layout=top] .sidebar>.nav-label,html[data-layout=top] .side-note{display:none}html[data-layout=top] .sidebar nav{display:flex;flex:1;flex-wrap:wrap;min-width:250px;gap:6px}html[data-layout=top] #scope-navigation{display:flex;flex-wrap:wrap;width:100%;order:1;margin:0;padding:0;border:0}html[data-layout=top] #scope-navigation .nav-label{display:none}html[data-layout=top] .sidebar #current-user{margin:0;padding:0;border:0}html[data-layout=top] .sidebar>.quiet{margin:0}html[data-layout=top] main{margin-right:auto;margin-left:auto}html[data-layout=top] .sidebar nav button{width:auto;white-space:nowrap}}@media(max-width:760px){.brand-image-grid{grid-template-columns:1fr}.home-cover-content,.home-card-body{padding:20px}.home-cover-placeholder{font-size:15px}.sidebar #logout{display:block}#page-settings .form-grid{grid-template-columns:1fr}html[data-density=compact] main{padding:18px 14px}#household-form .form-grid{grid-template-columns:1fr}.home-city-group>h3 small{display:block;margin:8px 0}}.journal-feed{max-width:1080px;margin:0 auto}.journal-compose textarea{resize:vertical;min-height:130px}.journal-compose>label{display:grid;gap:12px}.journal-add-media,.journal-reactions{display:flex;flex-wrap:wrap;gap:12px;margin:20px 0}.journal-add-media>label{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.journal-add-media input{max-width:260px}.journal-filters{display:flex;align-items:end;flex-wrap:wrap;gap:16px}.journal-filters label{flex:1;min-width:145px;display:grid;gap:7px}.journal-entry{border-left:3px solid #a98964;margin-bottom:26px}.journal-entry .section-head small{display:block;color:var(--muted);margin-top:6px}.journal-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.95;font-size:17px}.journal-author{font-size:20px!important;font-family:serif}.journal-media{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:14px}.journal-media figure{margin:0;min-width:0}.journal-media img,.journal-media video{width:100%;max-height:450px;object-fit:contain;border-radius:8px;background:#1a2925}.journal-media audio{width:100%;max-width:100%}.journal-media figcaption{font-size:13px;overflow-wrap:anywhere;margin-top:6px}.journal-image-load{width:100%;min-height:150px;background:#e9eee2!important}.journal-upload{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;border-bottom:1px solid #d9d7c8;padding:12px 0}.journal-upload label{flex:1;overflow-wrap:anywhere}.journal-upload small{display:block}.journal-upload input[type=checkbox]{width:auto}.journal-resume input{max-width:220px}.journal-comments{border-top:1px solid #d9d7c8;padding-top:15px}.journal-comments form{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.journal-comments form label{flex:1;min-width:170px}.journal-comment{padding:10px 0;border-bottom:1px dashed #d9d7c8;overflow-wrap:anywhere}.journal-comment small{font-size:11px;color:var(--muted)}.journal-reactions [aria-pressed=true]{color:#ad5842!important}.journal-comments .quiet{padding:4px 8px;font-size:12px}.journal-feed .panel{overflow:hidden}html[data-theme=ink] .journal-image-load{background:#293f37!important}.journal-upload-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));gap:18px;margin:20px 0}.journal-upload-card{border:1px solid var(--line,#d9d7c8);border-radius:12px;padding:16px;background:var(--surface,#fffdf8);min-width:0;display:flex;flex-direction:column;gap:14px}.journal-upload-card:has(input:checked){border-color:#456f5f;box-shadow:0 0 0 1px #456f5f}.journal-upload-select{display:flex!important;align-items:flex-start;gap:10px;overflow-wrap:anywhere;line-height:1.5}.journal-upload-select input[type=checkbox]{width:18px;min-width:18px;height:18px;margin-top:3px;accent-color:#315a4e}.journal-upload-select small{display:block;font-size:12px;color:var(--muted);margin-top:4px}.journal-card-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:auto}.journal-card-actions button{padding:8px 13px;font-size:13px}.journal-card-actions [data-remove-upload]{margin-left:auto;color:#954f40}.journal-card-actions a,.journal-media-caption a{font-size:13px;color:var(--accent,#315a4e)}.journal-attachment{margin:0;min-width:0}.journal-photo{display:block;position:relative;width:100%;padding:0!important;border:0!important;background:#e6e9df!important;border-radius:9px;overflow:hidden;color:#fff!important}.journal-photo img{display:block;width:100%;min-height:120px;max-height:450px;object-fit:contain;aspect-ratio:16/10;background:#e6e9df;border-radius:9px}.journal-photo-hint{position:absolute;right:10px;bottom:10px;padding:4px 9px;background:#213a30c9;border-radius:5px;font-size:12px}.journal-upload-card .journal-photo img{height:180px;min-height:0;object-fit:cover}.journal-attachment video{width:100%;max-height:450px;border-radius:8px;background:#1a2925}.journal-upload-card video{height:180px}.journal-attachment audio{width:100%;max-width:100%}.journal-audio{background:#e9eee5;border:1px solid #d5decd;border-radius:10px;padding:14px}.journal-audio-label{display:flex;align-items:center;gap:10px;color:#42614f;font-size:13px;letter-spacing:1px;margin:0 0 14px}.journal-audio-label span{font-size:28px}.journal-media-state{display:block;font-size:12px;color:var(--muted);padding-top:6px;min-height:0}.journal-media-state:empty{display:none}.journal-media-caption{font-size:12px;color:var(--muted);overflow-wrap:anywhere;margin:8px 0 16px}.journal-trash{padding:12px 0;border-top:1px solid #d9d7c8}.journal-trash-row{display:flex;align-items:center;gap:15px;justify-content:space-between;padding:10px 0;border-bottom:1px solid #d9d7c8;overflow-wrap:anywhere}.journal-preview{width:min(960px,94vw);max-width:94vw;padding:24px;max-height:94vh}.journal-preview header,.journal-preview footer{display:flex;align-items:center;justify-content:space-between;gap:18px;position:static}.journal-preview header{margin-bottom:20px}.journal-preview h2{font-size:22px;overflow-wrap:anywhere;margin:0}.journal-preview footer{font-size:13px;margin-top:18px}.journal-preview .journal-photo img{max-height:65vh;min-height:0;aspect-ratio:auto}.journal-preview .journal-photo{pointer-events:none}.journal-preview .journal-photo-hint{display:none}.journal-preview video{max-height:65vh}html[data-theme=ink] .journal-upload-card{background:#20352d}html[data-theme=ink] .journal-audio{background:#293f37;border-color:#436152}html[data-theme=ink] .journal-audio-label{color:#d5e2ce}@media(max-width:600px){.journal-upload-grid{grid-template-columns:1fr}.journal-preview{padding:16px}.journal-preview h2{font-size:17px}.journal-preview header button{flex-shrink:0}.journal-media{grid-template-columns:1fr}}@media(max-width:760px){.sidebar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:14px 16px;height:auto;min-height:0}.sidebar .brand{min-width:0;padding:0;gap:10px}.sidebar .brand>span{min-width:0}.sidebar #brand-name{font-size:23px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebar .brand-icon{width:38px;height:44px}.sidebar #brand-subtitle{font-size:11px;letter-spacing:1px}.sidebar .mobile-nav-toggle{display:block;margin:0;min-height:44px;color:#f7f3e5;border-color:#8faaa0;padding:9px 14px}.sidebar:not(.mobile-open)>nav,.sidebar:not(.mobile-open)>#current-user,.sidebar:not(.mobile-open)>#account-password,.sidebar:not(.mobile-open)>#logout{display:none}.sidebar>nav,.sidebar>#current-user{grid-column:1/-1}.sidebar.mobile-open>nav{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:0;padding:8px 0 0}.sidebar #scope-navigation{display:contents}.sidebar #scope-navigation[hidden]{display:none}.sidebar nav button{width:100%;text-align:left;min-height:44px;white-space:normal;margin:0;font-size:14px}.sidebar.mobile-open>#current-user{margin:0;padding:12px 0 0}.sidebar.mobile-open>#account-password,.sidebar.mobile-open>#logout{display:block;min-height:44px;margin:0}main{padding:22px 16px}main>header{margin-bottom:22px}.header-status #clock{display:none}input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea{font-size:16px!important;min-height:44px}button,.button{min-height:44px;touch-action:manipulation}.form-grid{grid-template-columns:1fr}.form-grid>*{min-width:0}.form-grid .wide{grid-column:1/-1}.section-head{flex-wrap:wrap;gap:12px}.section-head>div{max-width:100%}.section-head button{white-space:normal}.household-context{gap:10px;padding:12px}.household-context label{width:100%;display:flex;flex-wrap:wrap}.household-context select{flex:1;min-width:0}.household-context #household-context-note{display:none}.filter-row{gap:10px;flex-wrap:wrap}.filter-row label{width:100%;display:grid;grid-template-columns:1fr}.filter-row select{width:100%}.settings-sections,.view-presets{gap:8px}.settings-sections button,.view-presets button{flex:1 1 100px;white-space:normal}.device-actions,.device-search-row{gap:10px}.device-search-row{display:grid;grid-template-columns:1fr}dialog{width:calc(100% - 24px);max-width:calc(100% - 24px);max-height:90vh;max-height:90dvh;padding:18px;overscroll-behavior:contain}dialog header,dialog .dialog-heading{gap:12px;align-items:flex-start}dialog h2{font-size:22px}dialog footer{flex-wrap:wrap}.journal-compose,.journal-entry{padding:18px}.journal-filters{gap:12px}.journal-filters label{flex-basis:100%;min-width:0}.journal-add-media input{max-width:100%;width:100%}.journal-add-media>label{width:100%}.journal-preview{padding:16px}.journal-preview .journal-photo img,.journal-preview video{max-height:60vh;max-height:60dvh}.journal-upload-card{padding:12px}.journal-media audio{min-width:0}.journal-comments form label{min-width:0;flex-basis:100%}.device-context [role=group]{display:flex;flex-wrap:wrap;gap:8px}.device-context button{flex:1 1 42%;white-space:normal}.metrics{margin-bottom:20px}}@media(max-width:760px){.sidebar .brand{grid-column:1;max-width:100%;width:auto}.sidebar>.mobile-nav-toggle{grid-column:2;grid-row:1;width:auto;max-width:110px}.sidebar .brand-icon{flex-shrink:0}.sidebar .brand>span{overflow:hidden}.sidebar #brand-name{font-size:21px}}.geo-picker{min-width:0;border:1px solid var(--line,#d8d2c3);border-radius:10px;padding:14px;margin:0}.geo-picker legend{padding:0 8px}.geo-picker .geo-path{display:block;overflow-wrap:anywhere;margin-top:10px;font-size:.9rem}.geo-picker .form-grid{min-width:0}.geo-picker input,.geo-picker select{width:100%;min-width:0}#household-cover-status[data-error=true]{color:#ad3c28;font-weight:600}#household-cover-preview{max-width:100%;max-height:240px;object-fit:contain}.home-layout-controls{padding:16px 20px}.home-layout-controls .device-actions{align-items:end;flex-wrap:wrap}.home-layout-controls label{margin:0;min-width:90px}.home-layout-controls label.check{min-width:0;align-self:center}.home-card-grid{display:grid;grid-template-columns:repeat(var(--home-columns,2),minmax(0,1fr));gap:20px;align-items:start}.home-card-grid .home-card{min-width:0}.home-card-grid .home-card-body{padding:18px}.home-card-grid .home-cover-content{min-height:190px;padding:18px}.home-card-grid .home-cover{min-height:190px}.home-card-grid .home-card-body dl{margin:12px 0}.home-card-grid .home-card-body .description{font-size:13px}.home-card-grid .household-actions{display:flex;flex-wrap:wrap;gap:8px}.home-card-grid .household-actions button{font-size:13px;padding:10px 12px}.home-order-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:14px}.home-order-actions span{font-size:12px;color:var(--muted)}.home-order-actions button{font-size:12px;padding:8px}.home-card[draggable=true]{cursor:grab;outline:1px dashed var(--accent);outline-offset:3px}.home-pagination{display:flex;gap:18px;justify-content:center;align-items:center;margin:24px 0;flex-wrap:wrap}.home-pagination span{font-size:13px;color:var(--muted)}@media(max-width:1100px){.home-card-grid{grid-template-columns:repeat(min(var(--home-columns,2),2),minmax(0,1fr))}}@media(max-width:650px){.home-card-grid{grid-template-columns:minmax(0,1fr)}.home-layout-controls{padding:12px}.home-layout-controls .device-actions{gap:10px}.home-layout-controls button{padding:10px 12px}.home-pagination{gap:10px}.home-card-grid .home-cover-content{padding:16px}}.device-network{min-width:0;border:1px solid var(--line);padding:16px}.device-network legend{padding:0 8px}.topology-tree,.topology-tree ul{list-style:none;padding:0;margin:20px 0}.topology-tree ul{margin-left:24px;padding-left:24px;border-left:2px solid var(--accent,#31584a)}.topology-tree li{position:relative;margin:18px 0;min-width:0}.topology-tree ul>li:before{content:"";position:absolute;left:-24px;top:28px;width:24px;border-top:2px solid var(--accent,#31584a)}.topology-node{border:1px solid var(--line);border-radius:10px;padding:20px;background:var(--paper);max-width:800px;overflow-wrap:anywhere}.topology-node h3{margin:12px 0}.topology-node dl{display:grid;gap:8px}.topology-node dl>div{display:grid;grid-template-columns:100px minmax(0,1fr);gap:10px}.topology-node dd{margin:0}.topology-node dt,.topology-node p{font-size:13px;color:var(--muted)}.topology-node .device-title{text-align:left}@media(max-width:650px){.topology-tree ul{margin-left:8px;padding-left:12px}.topology-tree ul>li:before{left:-12px;width:12px}.topology-node{padding:14px}.topology-node dl>div{grid-template-columns:72px minmax(0,1fr)}.device-network .form-grid{grid-template-columns:1fr}}.platform-topology-root{border:1px solid var(--line);border-top:4px solid var(--accent,#31584a);background:var(--paper);padding:22px;text-align:center;margin:24px auto;max-width:420px;border-radius:10px}.platform-place-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:24px;border-top:2px solid var(--line);padding-top:24px}.platform-place-node{position:relative;text-align:left;white-space:normal;min-width:0;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--text);padding:22px}.platform-place-node:before{position:absolute;content:"";height:25px;top:-25px;left:50%;border-left:2px solid var(--line)}.platform-place-node h3{margin:16px 0}.platform-place-node p,.platform-place-node small{color:var(--muted)}.platform-place-node>span:last-child{display:block;margin-top:18px}.platform-place-node:hover{border-color:var(--accent,#31584a);background:var(--surface,#f1f2e9)}.topology-tree{display:flex;gap:24px;align-items:start;flex-wrap:wrap}.topology-tree>li{flex:1 1 400px}.topology-tree ul{display:flex;gap:16px;flex-wrap:wrap}.topology-tree ul>li{flex:1 1 260px;max-width:560px}.topology-node{max-width:560px;padding:16px}.device-actions #devices-card-view[aria-pressed=true],.device-actions #devices-topology-view[aria-pressed=true],.device-actions #home-card-view[aria-pressed=true],.device-actions #home-topology-view[aria-pressed=true]{background:var(--accent,#31584a);color:#fff}.home-card-grid[hidden],.home-layout-controls[hidden],.home-pagination[hidden]{display:none!important}:root{--bs-primary: #28624f;--bs-primary-rgb: 40, 98, 79;--bs-body-color: #263f36;--bs-body-bg: #f4f6f4;--bs-border-color: #dde4df;--bs-border-radius: .65rem;--ui-surface: #fff;--ui-muted: #67776d;--ui-line: #dfe6e1;--ui-sidebar: #193c32;--ui-accent: #28624f;--ui-bg: #f4f6f4;--ink: #263f36;--muted: #67776d;--paper: #fff;--line: #dfe6e1;--green: #28624f;--green-dark: #193c32;--cream: #f4f6f4}html,body{min-width:320px;margin:0;background:var(--ui-bg)!important;color:var(--ink);font-family:Inter,Segoe UI,Microsoft YaHei,system-ui,sans-serif;font-size:14px;line-height:1.65}body{display:block!important;background-image:none!important}body:before,body:after{display:none!important}#app{min-height:100vh;display:grid;grid-template-columns:232px minmax(0,1fr)}*,*:before,*:after{box-sizing:border-box}[hidden]{display:none!important}button,input,select,textarea{font:inherit}button,a,input,select,textarea{touch-action:manipulation}button{letter-spacing:0!important}.app-icon{width:20px;height:20px;flex:0 0 20px;vertical-align:middle}.btn .app-icon{width:17px;height:17px}.sidebar{width:232px!important;position:fixed!important;inset:0 auto 0 0;z-index:20;background:var(--ui-sidebar)!important;color:#e6f0eb;padding:28px 18px 20px!important;display:flex;flex-direction:column;height:100dvh;overflow:auto;border:0!important;box-shadow:none!important}.brand{padding:0 6px 24px!important;gap:12px;text-decoration:none;color:#fff!important;border-bottom:1px solid #ffffff14!important;margin:0 0 24px!important;display:flex;align-items:center}.brand-icon{width:42px!important;height:42px!important;object-fit:contain;border-radius:10px}.brand>span>span{font-size:22px!important;line-height:1.2;letter-spacing:2px}.brand small{font-size:11px!important;letter-spacing:1px;color:#acc4b8!important;margin-top:6px;display:block}.nav-label{font-size:10px!important;letter-spacing:2px;padding:0 12px;margin-bottom:12px;color:#95b5a6!important}.sidebar nav{display:flex!important;flex-direction:column!important;gap:5px}.sidebar nav button{display:flex;gap:12px;align-items:center;text-align:left;width:100%;color:#c0d6c9!important;background:transparent!important;border:0!important;box-shadow:none!important;border-radius:8px!important;min-height:44px;padding:10px 13px!important;font-size:13px!important;white-space:normal}.sidebar nav button:hover{background:#ffffff0d!important;color:#fff!important}.sidebar nav button.active{background:#ffffffed!important;color:#234c3d!important;font-weight:600}.sidebar nav .app-icon{opacity:.85}#scope-navigation{border:0!important;padding:18px 0 10px!important;margin:7px 0!important;box-shadow:0 -1px #ffffff14,0 1px #ffffff14}#scope-nav-name{max-width:185px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0 0 12px}.side-note{margin-top:auto;padding:36px 12px 16px;font-size:10px;color:#9abbab}.side-note p{display:none}.sidebar #current-user{color:#c1d3c8!important;border-top:1px solid #ffffff18;padding-top:14px;font-size:11px;margin:0 0 8px}.sidebar>#account-password,.sidebar>#logout{border-color:#ffffff20!important;color:#c1d3c8!important;background:transparent!important;font-size:11px;min-height:32px;padding:5px;margin:4px 0}.mobile-nav-toggle{display:none}#app>main{grid-column:2;margin:0!important;padding:28px 34px 20px!important;width:100%;min-width:0;max-width:1800px;min-height:100vh;background:none!important}main>header{padding:0 0 24px!important;margin:0 0 24px!important;border-bottom:1px solid var(--ui-line)!important;display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:0!important;background:none!important;position:relative}main>header:after,main>header:before{display:none!important}.eyebrow{font-size:10px;letter-spacing:2px;color:var(--ui-muted)!important;margin-bottom:7px}h1,#page-title{font-family:inherit!important;font-size:26px!important;font-weight:650!important;line-height:1.35;letter-spacing:-.5px!important;margin:0 0 7px!important}h2{font-size:19px!important;font-weight:600!important;line-height:1.45;letter-spacing:0!important;margin:0 0 5px!important}h3{font-size:16px!important;line-height:1.5;font-weight:600!important;letter-spacing:0!important}h2,h3,h4{font-family:inherit!important}#page-note{font-size:12px!important;color:var(--ui-muted);margin:0!important}.header-status{align-items:flex-end;gap:8px;font-size:10px!important;white-space:nowrap}#service-status{font-size:10px}#clock{color:var(--ui-muted);background:none!important;padding:0!important}#clock:before{display:none!important}.btn{border-radius:7px!important;min-height:36px;padding:7px 13px;font-size:12px;font-weight:500;box-shadow:none;line-height:1.65;display:inline-flex;align-items:center;justify-content:center;gap:5px;white-space:normal}.btn-primary{--bs-btn-bg: var(--ui-accent);--bs-btn-border-color: var(--ui-accent);--bs-btn-hover-bg: #1d4d3c;--bs-btn-hover-border-color: #1d4d3c;--bs-btn-disabled-bg: #80988d;--bs-btn-disabled-border-color: #80988d;--bs-btn-active-bg: #1d4d3c;--bs-btn-active-border-color: #1d4d3c;color:#fff!important}.btn-outline-secondary{--bs-btn-color: #54685d;--bs-btn-border-color: #d8e1da;--bs-btn-hover-bg: #edf3ee;--bs-btn-hover-border-color: #bacdc0;--bs-btn-hover-color: #264d3b;--bs-btn-active-bg: #e0ece4;--bs-btn-active-border-color: #a7c0ae;--bs-btn-active-color: #254e3b;--bs-btn-disabled-color: #9faea4;--bs-btn-disabled-border-color: #e0e5e2;background:transparent}.btn-sm{min-height:30px;padding:4px 9px;font-size:11px}.btn-link{color:var(--ui-accent);text-decoration:none;background:transparent;border:0}.btn-link:hover{text-decoration:underline}.btn:focus-visible,.form-control:focus,.form-select:focus{box-shadow:0 0 0 3px #28744c1c!important;outline:0!important;border-color:#679b79}.btn-group>.btn{border-radius:0!important}.btn-group>.btn:first-child{border-radius:7px 0 0 7px!important}.btn-group>.btn:last-child{border-radius:0 7px 7px 0!important}.form-control,.form-select{color:var(--ink);background-color:var(--ui-surface);border:1px solid var(--ui-line);border-radius:7px!important;font-size:13px;padding:9px 12px;min-height:40px;max-width:100%;box-shadow:none}.form-select{padding-right:32px}.form-check-input{width:16px;height:16px;min-height:0;margin:0 6px 0 0;vertical-align:middle;flex:0 0 16px}.form-check-input:checked{background-color:var(--ui-accent);border-color:var(--ui-accent)}label{font-size:12px;color:#617367;gap:7px}.form-grid{gap:16px 20px!important}.form-grid label{min-width:0}.form-grid .full{grid-column:1/-1}textarea.form-control{min-height:100px}input[type=file]{font-size:12px;padding:8px;overflow:hidden}input[type=range]{max-width:100%}fieldset{border:1px solid var(--ui-line)!important;border-radius:9px;padding:14px!important}legend{float:none;width:auto;padding:0 6px;font-size:12px}.description,.hint{font-size:12px!important;line-height:1.8!important;color:var(--ui-muted)!important}p{overflow-wrap:anywhere}code{color:#3b6755;font-size:12px}.table{font-size:12px;--bs-table-bg: transparent}.table td,.table th{padding:12px!important;border-color:var(--ui-line)}.table-wrap{overflow:auto;border-radius:8px;border:1px solid var(--ui-line)}.panel,.site-card,.card,.camera-card,.person-card{background:var(--ui-surface)!important;border:1px solid var(--ui-line)!important;border-radius:11px!important;box-shadow:0 3px 12px #193c3204!important;overflow:hidden}.panel{padding:22px!important;margin-bottom:18px}.site-card{padding:22px!important}.card-body{padding:20px}.card-footer{background:transparent;border-top:1px solid var(--ui-line);padding:12px 18px}.section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px!important}.section-head h2 small,.section-head h3 small{display:none}.badge{font-size:10px;line-height:1.4;font-weight:500!important;letter-spacing:0!important;background:#edf4ee!important;color:#3c7056!important;border:1px solid #d6e6d9!important;border-radius:5px!important;padding:5px 8px!important}.badge.off{background:#f7eeea!important;border-color:#ecd9d0!important;color:#a66044!important}.count-pill{display:inline-block;padding:2px 7px;background:#e6ede8;color:#4b705b;border-radius:5px;font-size:11px;vertical-align:middle;margin-left:7px}.group-title{font-size:13px!important;color:#6a7c70;margin:24px 0 12px!important;display:flex;gap:5px;align-items:center}.site-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.household-context{padding:12px 16px!important;border-radius:9px!important;background:#eaf0eb!important;border:1px solid var(--ui-line);gap:12px;display:flex;align-items:center;flex-wrap:wrap;margin-bottom:18px!important}.household-context label{display:flex;align-items:center;gap:10px;margin:0}.household-context select{width:auto;max-width:260px;min-height:34px;padding-top:6px;padding-bottom:6px}.household-context span{font-size:11px;color:var(--ui-muted)}#scope-back{margin-left:auto}.device-context{border-radius:9px;background:#eaf0eb!important;padding:16px!important;margin-bottom:18px}.device-context p{font-size:12px;margin:0 0 10px}.device-context .btn.active{background:var(--ui-accent)!important;color:#fff!important}.filter-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 18px;padding:0!important;font-size:12px}.filter-row label{display:flex;align-items:center;gap:8px;margin:0}.filter-row select{width:180px}.filter-row>button{margin-left:auto}.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:0 0 22px!important;padding:0!important;background:none!important;border:0!important}.metrics>div{background:var(--ui-surface);border:1px solid var(--ui-line);border-radius:9px;padding:14px 18px!important;display:flex;justify-content:space-between;align-items:center;border-right:1px solid var(--ui-line)!important}.metrics span{font-size:11px;color:var(--ui-muted)}.metrics strong{font-family:inherit;font-size:23px!important;font-weight:600;color:var(--ui-accent)}.home-toolbar{display:flex;gap:16px;flex-wrap:wrap;align-items:center;padding:13px 0;margin:0 0 7px;border-top:1px solid var(--ui-line);border-bottom:1px solid var(--ui-line)}.home-layout-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-left:auto}.home-layout-controls label{display:flex;align-items:center;gap:7px;margin:0}.home-layout-controls select{width:80px!important;min-height:34px;padding-top:5px;padding-bottom:5px}.home-layout-controls>.form-select{width:80px!important}.inline-check{white-space:nowrap;font-size:11px}#home-layout-status{margin-bottom:18px;font-size:11px!important}.home-card-grid{display:grid!important;grid-template-columns:repeat(var(--home-columns, 2),minmax(0,1fr));gap:20px!important}.home-city-group{display:block}.home-card{padding:0!important;margin:0!important;min-width:0;align-self:start}.home-cover{position:relative;height:178px!important;min-height:178px!important;background:linear-gradient(135deg,#567d65,#203e36)!important;overflow:hidden}.home-cover img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.cover-shade{position:absolute;inset:0;background:linear-gradient(180deg,#132e2430 10%,#0e261ccc)}.home-cover-content{position:relative;z-index:1;height:100%;padding:17px 20px!important;display:flex;flex-direction:column;justify-content:space-between;background:none!important}.home-cover-content h3{font-family:inherit!important;font-size:21px!important;color:#fff!important;margin:0 0 6px!important;letter-spacing:0}.home-cover-content .badge{background:#ffffffd9!important;color:#244d3a!important;border-color:transparent!important;font-size:10px}.home-location{font-size:11px!important;color:#e8f0eb!important;line-height:1.6;margin:0!important}.cover-edit{color:#fff!important;background:#213e3670!important;border:1px solid #ffffff60!important;backdrop-filter:blur(8px)}.home-summary{font-size:12px;color:var(--ui-muted);margin-bottom:15px;min-height:20px}.home-numbers{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;padding:0 0 17px;border-bottom:1px solid var(--ui-line);margin-bottom:13px}.home-numbers span{display:flex;align-items:baseline;gap:7px;color:var(--ui-muted);font-size:11px}.home-numbers b{font-size:21px;font-weight:600;color:var(--ink)}.compact-details{margin:0!important;display:grid;gap:7px!important;font-size:12px}.compact-details>div{display:grid;grid-template-columns:100px minmax(0,1fr);gap:12px!important;padding:0!important}.compact-details dt{font-weight:400;color:var(--ui-muted)}.compact-details dd{margin:0;overflow-wrap:anywhere;color:var(--ink)}.home-card-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:17px;padding-top:14px;border-top:1px solid var(--ui-line)}.home-card-actions .btn-primary{flex:1}.home-order-actions{display:flex;align-items:center;gap:5px;margin-bottom:12px}.home-order-actions span{font-size:10px;flex:1}.home-pagination{display:flex;justify-content:flex-end;align-items:center;gap:10px;margin:22px 0}.home-pagination span{margin-right:auto;font-size:11px;color:var(--ui-muted)}.device-card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,330px),1fr));gap:18px}.device-card{min-width:0}.device-card-heading{display:flex;align-items:center;gap:12px;margin-bottom:15px}.device-symbol{width:42px;height:42px;border-radius:10px;background:#eaf2ec;color:var(--ui-accent);display:grid;place-items:center}.device-symbol .app-icon{width:23px;height:23px}.device-card-heading h3{margin:0!important;font-size:16px!important}.device-title{padding:0!important;border:0!important;background:none!important;text-align:left!important;min-height:0!important;color:var(--ink)!important;font-weight:600!important;font-size:16px!important;box-shadow:none!important}.device-title:hover{color:var(--ui-accent)!important;text-decoration:underline}.device-location{font-size:11px;color:var(--ui-muted);margin-bottom:15px}.device-card-actions{display:flex;flex-wrap:wrap;gap:8px}.device-tags{display:flex;flex-wrap:wrap;gap:5px;margin:12px 0 0}.device-tags span{background:#edf1ee;font-size:10px;color:#667e6d;padding:2px 8px;border-radius:4px}.device-view-controls{display:flex;flex-wrap:wrap;gap:12px}.device-view-controls label{display:flex;align-items:center;gap:9px}.group-custom{font-size:12px}.group-step{max-width:100%}.group-step select{max-width:200px}.view-presets{display:flex;gap:6px;flex-wrap:wrap}#device-count{font-size:11px!important}.device-group:first-child>.group-title{margin-top:4px!important}#asset-list .empty{min-height:160px}.device-tags+.network-status-block{margin-top:12px}.network-status-block{padding-top:12px;margin-top:14px;border-top:1px solid var(--ui-line);font-size:11px}.network-status-title{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}.network-status-title>span{font-weight:600}.status-dot{width:7px;height:7px;border-radius:50%;background:#b4b9b5;display:inline-block;margin-right:6px}.status-dot.online{background:#37a06a;box-shadow:0 0 0 3px #38a16a12}.network-target{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin:4px 0}.network-target>span:first-child{width:65px;color:var(--ui-muted)}.network-target code{font-size:11px}.network-target>span:last-child{margin-left:auto;font-size:10px}.network-status-block p{margin:6px 0;font-size:11px!important}.management-links{display:flex;gap:6px;flex-wrap:wrap;margin:9px 0}.network-check-time{font-size:10px;color:#8b9c90;line-height:1.5;display:block}.network-platform{display:flex;align-items:center;gap:15px;background:#edf3ee;border:1px solid #d6e4d9;padding:20px;border-radius:10px;margin-bottom:16px}.network-platform>.app-icon{width:32px;height:32px;flex-basis:32px;color:var(--ui-accent)}.network-platform h3{margin:0 0 3px!important;font-size:18px!important}.network-platform p{margin:0;font-size:11px;color:var(--ui-muted)}.platform-place-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:18px}.platform-place-node{display:flex!important;flex-direction:column;align-items:flex-start!important;text-align:left!important;padding:20px!important;gap:9px;border:1px solid var(--ui-line)!important;position:relative;color:var(--ink)!important}.platform-place-node:hover{border-color:#81ad90!important;box-shadow:0 4px 16px #2d4b3610!important}.platform-place-node h3{font-size:17px!important;margin:3px 0}.platform-place-node p,.platform-place-node small{font-size:11px;color:var(--ui-muted);margin:0}.network-open{padding-top:12px;margin-top:auto;color:var(--ui-accent);font-size:11px}.network-node{margin:0 0 14px calc(var(--depth) * 22px);overflow:visible!important;position:relative}.network-node.nested:before{position:absolute;content:"";border-left:2px solid #c1d3c6;border-bottom:2px solid #c1d3c6;width:15px;left:-17px;top:-15px;height:50px;border-bottom-left-radius:6px}.network-node .card-body{padding:18px}.network-node .device-card-heading{margin-bottom:9px}.network-facts{display:flex;flex-wrap:wrap;gap:8px 24px;font-size:11px;color:var(--ui-muted)}.network-facts b{font-weight:500;color:var(--ink);margin-left:7px;overflow-wrap:anywhere}.network-map{overflow:hidden}.network-map .network-platform{max-width:none}.network-overview{margin-top:18px}.scope-intro{padding:0!important;margin-bottom:24px!important}.scope-intro h2{font-size:24px!important}.scope-intro p{font-size:13px!important;color:var(--ui-muted)}.steward-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:18px}.steward-tile{padding:22px!important;min-height:160px!important;background:var(--ui-surface)!important;border:1px solid var(--ui-line)!important;border-radius:10px!important;text-align:left!important;display:flex;align-items:flex-start!important;flex-direction:column;justify-content:flex-start!important;gap:10px;color:var(--ink)!important;box-shadow:none!important}.steward-tile:before{display:none!important}.steward-tile:hover{border-color:#8caf99!important;background:#f9fcf9!important;transform:translateY(-1px)}.steward-tile strong{font-family:inherit!important;font-size:19px!important;font-weight:600!important}.steward-tile span{font-size:12px!important}.steward-tile small{font-size:11px!important;color:var(--ui-muted);line-height:1.8}.camera-meta{padding:16px!important}.camera-meta strong{font-size:14px!important}.camera-meta p{font-size:11px!important;margin:4px 0!important}.camera-actions{padding:0 16px 16px;display:flex;flex-wrap:wrap;gap:7px}.camera-card{background:var(--ui-surface)!important}.live-grid{gap:18px}.video-panel{background:#152720!important}.video-error{font-size:12px}.video-empty{color:#9bad9f}.wall-toolbar{padding:12px!important;border-radius:9px;gap:10px}.wall-toolbar label{font-size:11px}.wall-toolbar select{width:auto}#live-stage:fullscreen{background:#101c17}.wall-fullscreen .camera-card{border-color:#284336!important}.playback-panel{background:var(--ui-surface)!important}.settings-sections{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:20px}.settings-sections .btn[aria-pressed=true]{background:var(--ui-accent)!important;color:#fff!important}.journal-card{max-width:100%!important;background:var(--ui-surface)!important;border-radius:11px!important;padding:22px!important;border:1px solid var(--ui-line)!important}.journal-attachments{gap:14px}.journal-attachments img{border-radius:8px}.journal-media-library{max-width:100%}.journal-pager{font-size:12px}.family-toolbar{flex-wrap:wrap}.family-card,.person-card{padding:16px}.family-detail h2{font-size:20px!important}dialog{max-width:min(900px,calc(100vw - 32px))!important;width:800px;padding:26px!important;border:1px solid var(--ui-line)!important;border-radius:14px!important;background:var(--ui-surface)!important;color:var(--ink)!important;box-shadow:0 24px 80px #0f2d3d38!important;max-height:calc(100dvh - 48px);overflow:auto;margin:auto!important}dialog::backdrop{background:#10291e70;backdrop-filter:blur(3px)}dialog h2{font-size:21px!important}dialog .dialog-heading,dialog>header,dialog form>header{padding:0 0 18px!important;margin:0 0 20px!important;border-bottom:1px solid var(--ui-line);display:flex;align-items:center;justify-content:space-between;gap:15px;background:none}dialog form>.form-grid{margin-top:5px}dialog footer,dialog .dialog-actions{padding:18px 0 0!important;margin:20px 0 0!important;border-top:1px solid var(--ui-line);display:flex;justify-content:flex-end;gap:10px}#auth-dialog{width:420px!important;padding:32px!important}#auth-dialog h2{font-size:25px!important}#auth-dialog p{font-size:12px}#auth-form{display:grid;gap:15px}#auth-form label{margin:0}.form-error{font-size:12px;color:#b15a3c;min-height:0}#toast{position:fixed;bottom:24px;right:24px;z-index:200;background:#234c39!important;color:#fff!important;padding:12px 20px!important;border-radius:9px!important;font-size:13px!important;box-shadow:0 6px 22px #193c3226;max-width:calc(100vw - 32px)}main>footer{padding:22px 0 0!important;margin:30px 0 0!important;border-top:1px solid var(--ui-line);font-size:10px!important;color:var(--ui-muted)}.empty{border:1px dashed #cfdbd2;background:#f8faf8;border-radius:9px;color:var(--ui-muted);text-align:center;padding:40px 20px!important}.empty h3{margin-top:10px}.empty p{font-size:12px}.banner{padding:12px 16px;border-radius:8px;font-size:12px}html[data-theme=clean]{--ui-bg: #f4f6f9;--ui-accent: #31655b;--ui-surface: #fff}html[data-theme=ink]{--ui-bg: #14221e;--ui-surface: #1c2e26;--ui-line: #334a3e;--ui-muted: #a5baad;--ink: #e1ece5;--bs-body-color: #e1ece5;--bs-border-color: #334a3e;--ui-accent: #397359;--bs-secondary-color: #a5baad}html[data-theme=ink] .form-control,html[data-theme=ink] .form-select{background-color:#20352a;color:#e1ece5}html[data-theme=ink] .network-platform,html[data-theme=ink] .household-context,html[data-theme=ink] .device-context,html[data-theme=ink] .empty{background:#213d2d!important}html[data-theme=ink] .description,html[data-theme=ink] label{color:#a5baad!important}html[data-theme=ink] .btn-outline-secondary{color:#b9cec0;border-color:#476152}html[data-density=compact] #app>main{padding:20px 25px!important}html[data-density=compact] .panel,html[data-density=compact] .card-body{padding:15px!important}html[data-density=compact] .home-cover{height:150px!important;min-height:150px!important}html[data-layout=top] #app{display:block}html[data-layout=top] .sidebar{position:relative!important;width:100%!important;height:auto;padding:12px 24px!important;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:12px}html[data-layout=top] .sidebar .brand{padding:0 15px 0 0!important;margin:0!important;border:0!important}html[data-layout=top] .sidebar>.nav-label,html[data-layout=top] .side-note,html[data-layout=top] #current-user,html[data-layout=top] #scope-nav-name{display:none}html[data-layout=top] .sidebar nav{flex-direction:row!important;flex:1;flex-wrap:wrap}html[data-layout=top] #scope-navigation{display:flex;padding:0!important;margin:0!important;box-shadow:none}html[data-layout=top] .sidebar nav button{width:auto!important;padding:8px 10px!important}html[data-layout=top] #app>main{margin:auto!important;max-width:1800px}@media(min-width:1500px){.home-card-grid[style]{gap:22px}}@media(max-width:1200px){#app>main{padding:24px!important}#app{grid-template-columns:210px minmax(0,1fr)}.sidebar{width:210px!important;padding:24px 14px!important}.home-toolbar{align-items:flex-start}.home-layout-controls{margin-left:0}.home-card-grid{grid-template-columns:repeat(min(var(--home-columns, 2),2),minmax(0,1fr))}.metrics>div{padding:12px!important}.metrics strong{font-size:19px!important}.compact-details>div{grid-template-columns:90px minmax(0,1fr)}}@media(max-width:767px){html,body{font-size:14px}#app{display:block!important}.sidebar,html[data-layout=top] .sidebar{position:relative!important;width:100%!important;height:auto!important;padding:13px 16px!important;display:grid!important;grid-template-columns:1fr auto!important;overflow:visible!important}.brand,html[data-layout=top] .sidebar .brand{padding:0!important;margin:0!important;border:0!important;gap:10px}.brand-icon{width:34px!important;height:34px!important}.brand>span>span{font-size:19px!important}.brand small{font-size:9px!important;margin-top:2px}.sidebar>.nav-label,.side-note,#current-user,.sidebar>#account-password,.sidebar>#logout{display:none!important}.mobile-nav-toggle{display:flex!important;color:#e8f1ec!important;border:1px solid #ffffff30!important;background:transparent!important;font-size:12px;min-height:36px}.sidebar nav,html[data-layout=top] .sidebar nav{display:none!important;grid-column:1/-1}.sidebar.mobile-open nav,html[data-layout=top] .sidebar.mobile-open nav{display:flex!important;flex-direction:column!important;margin-top:15px}.sidebar.mobile-open>#account-password,.sidebar.mobile-open>#logout{display:block!important}.sidebar.mobile-open>#current-user{display:block!important;grid-column:1/-1}.sidebar.mobile-open>#account-password{grid-column:1}.sidebar.mobile-open>#logout{grid-column:2}html[data-layout=top] #scope-navigation{display:block}.sidebar nav button{width:100%!important}.sidebar #scope-navigation{padding:14px 0!important}#app>main,html[data-density=compact] #app>main{padding:20px 15px!important;min-height:calc(100vh - 65px);width:100%!important}main>header{gap:12px;align-items:flex-start;margin-bottom:20px!important;padding-bottom:18px!important}#page-title{font-size:22px!important}#page-note{font-size:11px!important}.eyebrow{font-size:9px;margin-bottom:5px;letter-spacing:1px}.header-status{font-size:9px!important;gap:5px;max-width:100px;white-space:normal;text-align:right}#service-status{font-size:9px!important;padding:4px 6px!important}#clock{font-size:9px}.section-head{gap:12px;align-items:flex-start;flex-wrap:wrap}.section-head>.btn{margin-left:0;font-size:11px}h2{font-size:17px!important}.home-toolbar{gap:13px}.home-layout-controls{gap:9px;width:100%;font-size:11px}.home-layout-controls .form-select{min-height:32px;font-size:11px}.home-layout-controls .btn{font-size:11px;min-height:32px}.home-card-grid{grid-template-columns:minmax(0,1fr)!important;gap:17px!important}.home-cover{height:170px!important;min-height:170px!important}.home-cover-content{padding:16px 18px!important}.card-body{padding:17px}.home-numbers b{font-size:21px}.home-pagination{flex-wrap:wrap}.home-pagination span{width:100%}.home-pagination .btn{flex:1}.household-context{padding:10px!important;gap:9px}.household-context label{width:100%}.household-context select{max-width:none;flex:1;min-width:0}#household-context-note{display:none}#scope-back{width:100%;margin:0}.metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.metrics>div{padding:11px 13px!important}.metrics strong{font-size:20px!important}.filter-row{gap:9px}.filter-row label{flex:1;min-width:0}.filter-row select{width:100%;min-width:0}#filter-caption{display:none}.filter-row>button{font-size:11px}.panel{padding:17px!important}.form-grid{grid-template-columns:minmax(0,1fr)!important;gap:14px!important}.form-grid>*{min-width:0;grid-column:auto}.form-grid .full{grid-column:1}.site-grid,.steward-grid,.platform-place-grid,.device-card-grid{grid-template-columns:minmax(0,1fr)!important}.device-view-controls{display:flex;flex-direction:column;align-items:stretch}.device-view-controls label{width:100%}.device-view-controls input,.device-view-controls select{width:100%;min-width:0}.network-node{margin-left:calc(min(var(--depth),2)*12px)}.network-node.nested:before{left:-10px;width:8px}.network-node .card-body{padding:14px}.network-facts{display:grid;gap:6px}.network-platform{padding:16px}.network-platform h3{font-size:16px!important}.network-target{font-size:10px}.network-target code{font-size:10px;word-break:break-all}.management-links a{max-width:100%;font-size:10px}.network-node .device-card-heading h3,.network-node .device-title{font-size:14px!important}.device-context [role=group]{display:flex;flex-wrap:wrap;gap:7px}.device-context .btn{flex:1;min-width:100px;font-size:11px}.steward-tile{min-height:145px!important}.steward-tile strong{font-size:18px!important}.journal-card{padding:17px!important}.journal-attachments{grid-template-columns:minmax(0,1fr)!important}.journal-attachments audio,.journal-attachments video{width:100%;max-width:100%}.journal-upload-controls{display:flex;flex-wrap:wrap}.journal-upload-controls>*{max-width:100%}.settings-sections{gap:6px}.settings-sections .btn{flex:1;min-width:calc(50% - 6px);font-size:11px}dialog{max-width:calc(100vw - 20px)!important;padding:20px!important;max-height:calc(100dvh - 20px);border-radius:12px!important}dialog h2{font-size:19px!important}dialog .dialog-heading{padding-bottom:14px!important;margin-bottom:16px!important}dialog .dialog-heading .btn{min-width:54px}#auth-dialog{padding:25px!important}.brand-image-grid{grid-template-columns:1fr!important}#toast{bottom:16px;right:16px;font-size:12px!important}.wall-toolbar{gap:7px}.wall-toolbar label{width:auto}.table-wrap{max-width:100%}main>footer{font-size:9px!important;gap:10px;flex-wrap:wrap}.network-node .device-card-heading>.btn{font-size:10px;min-height:28px;padding:3px 7px}html[data-layout=top] .sidebar.mobile-open nav button{width:100%!important}}@media(min-width:768px){.sidebar>.mobile-nav-toggle{display:none!important}}.sidebar nav button{justify-content:flex-start!important}.sidebar nav button.active:after{display:none!important}.section-head>div:first-child{display:block}.inline-check .form-check-input{width:16px!important;height:16px!important;min-height:0!important;padding:0!important}.form-check-input{padding:0!important}.dialog-footer{display:flex;justify-content:flex-end;gap:10px;margin-top:20px;padding-top:18px;border-top:1px solid var(--ui-line)}html[data-font=serif] #page-title,html[data-font=serif] .scope-intro h2{font-family:"Noto Serif SC",Songti SC,SimSun,serif!important;font-weight:600!important}.live-help{margin:10px 0;color:var(--ui-muted);font-size:13px}.live-help summary{cursor:pointer;padding:8px 0}.live-help p{margin:8px 0}#page-live.wall-expanded{position:fixed;inset:0;z-index:10000;margin:0}#page-live:is(:fullscreen,.wall-expanded)>.live-help{display:none}#page-live:is(:fullscreen,.wall-expanded) .live-grid[data-visible-count="1"]{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}.leadership-member-actions .btn{white-space:normal}#leadership-grant{align-items:flex-start;padding:14px}#leadership-grant span{line-height:1.7}@media(max-width:767px){#app>main{padding-bottom:max(20px,env(safe-area-inset-bottom))!important}main[data-page=live]>header{margin-bottom:12px!important;padding-bottom:12px!important}main[data-page=live]>header .eyebrow,main[data-page=live] #page-note,main[data-page=live]>.metrics{display:none!important}main[data-page=live] .household-context{margin-bottom:12px;flex-wrap:nowrap}main[data-page=live] .household-context label{flex:1;width:auto;font-size:0}main[data-page=live] .household-context select{font-size:16px;width:100%}main[data-page=live] #scope-back{width:auto;min-width:82px}main[data-page=live]>.filter-row{margin:12px 0}#page-live:not([hidden]){display:flex;flex-direction:column}#page-live>.section-head{order:0;margin:6px 0 12px}#page-live>.live-grid{order:1}#page-live>.wall-toolbar{order:2}#page-live>.live-help{order:3}#page-live:not(:fullscreen):not(.wall-expanded) .live-grid[data-layout=auto]{grid-template-columns:minmax(0,1fr)}.camera-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:0 12px 12px}.camera-actions .btn{min-height:44px;white-space:normal;font-size:13px}.camera-meta{padding:12px}.camera-meta strong{font-size:15px!important}.wall-toolbar .wall-paging{flex:1;justify-content:space-between}.wall-toolbar .btn{min-width:44px;min-height:44px}#page-live:is(:fullscreen,.wall-expanded){padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}#page-live:is(:fullscreen,.wall-expanded)>.wall-toolbar{order:0}#page-live:is(:fullscreen,.wall-expanded) .live-grid[data-layout=auto]{grid-template-columns:repeat(2,minmax(0,1fr))}#page-live:is(:fullscreen,.wall-expanded) .live-grid[data-visible-count="1"]{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}#page-live:is(:fullscreen,.wall-expanded) .camera-actions{display:none}.network-target{display:grid;grid-template-columns:76px minmax(0,1fr) auto;font-size:12px;gap:8px}.network-target code{font-size:13px!important}.network-check-time{font-size:12px;line-height:1.7}.management-links{display:grid;grid-template-columns:minmax(0,1fr)}.management-links .btn{min-height:44px!important;font-size:13px!important;white-space:normal}dialog .description,dialog label{font-size:14px!important}dialog .dialog-footer{position:sticky;bottom:-20px;background:var(--ui-surface);padding:14px 0;margin-bottom:-10px}dialog .dialog-footer .btn{flex:1;min-height:44px;white-space:normal}.leadership-member-actions .btn{flex:1;min-width:120px}#leadership-grant{display:flex;gap:10px}#leadership-grant[hidden]{display:none}}html[data-backdrop=mountains] #app>main{background-image:linear-gradient(150deg,transparent 70%,#8ba58f08 70%,transparent 85%),linear-gradient(170deg,transparent 60%,#8ba58f06 60%,transparent 90%)!important;background-size:100% 360px!important;background-repeat:no-repeat!important}@media(max-width:767px){.form-control,.form-select{font-size:16px!important;min-height:44px}.btn{min-height:42px;font-size:13px}.home-layout-controls .form-select{font-size:14px!important;min-height:40px}.home-layout-controls .btn,.network-status-title .btn,.management-links .btn{min-height:40px;font-size:12px}.network-target code{font-size:12px}.mobile-nav-toggle{min-height:42px}.device-card-actions .btn{min-height:42px;font-size:12px}}:root{--ui-bg: #f3f6fa;--ui-surface: #fff;--ui-line: #e3e9ef;--ui-muted: #5e6f7e;--ui-sidebar: #172e35;--ui-accent: #217964;--ink: #253b46;--muted: #5e6f7e;--paper: var(--ui-surface);--line: var(--ui-line);--green: var(--ui-accent);--bs-primary: #217964;--bs-primary-rgb: 33, 121, 100;--bs-body-color: var(--ink);--bs-body-bg: var(--ui-bg);--bs-border-color: var(--ui-line);--ui-shadow: 0 3px 16px #223d5010;--ui-soft: #f5f8fa}html[data-theme=paper]{--ui-bg: #f5f6f4;--ui-soft: #f5f7f3}html[data-theme=clean]{--ui-bg: #f1f5f9;--ui-soft: #f4f7fb}html[data-theme=ink]{--ui-bg: #111e26;--ui-surface: #1a2b35;--ui-line: #30444e;--ui-soft: #21353f;--ink: #e0ecef;--ui-muted: #a8bdc5;--muted: #a8bdc5;--ui-shadow: 0 3px 16px #0002;--paper: #1a2b35;--line: #30444e}html,body{min-width:0}body{-webkit-font-smoothing:antialiased}#app>main{max-width:2000px;padding:30px 38px 24px!important}main>header{margin-bottom:26px!important;padding-bottom:24px!important}#page-title{font-size:clamp(24px,2.3vw,32px)!important;letter-spacing:-.7px!important}html[data-font=serif] #page-title{font-weight:600!important}#brand-motto{color:var(--ui-accent)!important;letter-spacing:2.4px}#page-note{font-size:13px!important}.header-status{gap:9px}#clock{font-variant-numeric:tabular-nums;font-size:11px}#service-status{padding:6px 10px;border-radius:20px!important}.sidebar{background:linear-gradient(165deg,#1d3940,#152b32 70%)!important}.brand{padding-bottom:26px!important}.brand-icon{width:46px!important;height:46px!important;box-shadow:0 3px 12px #071d2860}.sidebar nav button{border-radius:10px!important;min-height:46px;transition:background .15s,color .15s}.sidebar nav button.active{background:#e1f2eb!important;color:#155b48!important;box-shadow:0 2px 7px #0002!important}.sidebar nav button.active .app-icon{opacity:1}.sidebar #current-user{padding:14px 9px 2px}.section-head{align-items:center;margin-bottom:18px}.section-head h2{font-size:21px!important}.count-pill{background:#e7f0ec;color:#286752;border:0;border-radius:7px;padding:3px 9px;font-size:12px}.btn{border-radius:9px!important;min-height:38px;padding:8px 14px;transition:background .15s,border-color .15s,box-shadow .15s}.btn-primary{--bs-btn-bg: var(--ui-accent);--bs-btn-border-color: var(--ui-accent);box-shadow:0 3px 8px #21796416}.btn-primary:hover{box-shadow:0 4px 12px #21796428}.btn-outline-secondary{--bs-btn-color: var(--ink);--bs-btn-border-color: var(--ui-line);background:var(--ui-surface)}.btn-link{color:var(--ui-accent)}html:is([data-theme=clean],[data-theme=ink]) :is(main,dialog) .btn-primary:not(.steward-tile):not(.device-title):not(.platform-place-node){background:var(--ui-accent)!important;color:#fff!important;border-color:var(--ui-accent)!important}html:is([data-theme=clean],[data-theme=ink]) :is(main,dialog) .btn-outline-secondary{background:var(--ui-surface)!important;color:var(--ink)!important}html:is([data-theme=clean],[data-theme=ink]) :is(main,dialog) .btn-outline-secondary:is(.active,[aria-pressed=true]){background:var(--ui-soft)!important;border-color:#629987!important}html:is([data-theme=clean],[data-theme=ink]) .btn-link{background:transparent!important;color:var(--ink)!important}html[data-theme=ink] #brand-motto{color:#a7d7c4!important}.btn:focus-visible,button:focus-visible,a:focus-visible{outline:3px solid #529cce;outline-offset:3px}.form-control,.form-select{border-radius:9px!important;border-color:var(--ui-line)!important;min-height:40px;background-color:var(--ui-surface);color:var(--ink)}.form-control:focus,.form-select:focus{border-color:#51a18b!important;box-shadow:0 0 0 3px #21856819!important}.card,.panel{border:1px solid var(--ui-line)!important;border-radius:14px!important;background:var(--ui-surface);box-shadow:var(--ui-shadow)!important}.card{overflow:hidden}.card-body{padding:24px}dialog{border-radius:16px!important;box-shadow:0 24px 100px #10293040!important}dialog::backdrop{background:#132a3670;backdrop-filter:blur(4px)}dialog h2{font-size:22px!important}.household-context,.device-context{border:1px solid var(--ui-line)!important;background:var(--ui-surface)!important;border-radius:12px;box-shadow:var(--ui-shadow)}.home-insights{display:grid;grid-template-columns:1.4fr .7fr 1fr;gap:18px;margin:22px 0 26px}.home-insights>article{border-radius:15px;padding:24px;min-width:0}.insight-welcome{position:relative;overflow:hidden;color:#fff;background:linear-gradient(115deg,#20534d,#297562);box-shadow:0 6px 22px #21594c1c}.insight-welcome:after{content:"";position:absolute;right:-28px;bottom:-64px;width:200px;height:200px;border:32px solid #fff07;border-radius:50%;pointer-events:none}.insight-kicker{color:#cae4d9;font-size:10px;letter-spacing:2px}.insight-welcome h2{color:#fff!important;font-size:23px!important;margin:14px 0 8px!important}.insight-welcome p{color:#d0e7df;font-size:12px;margin-bottom:22px}.insight-scope{display:flex;gap:7px;align-items:center;color:#d7ebe4;font-size:10px}.insight-scope .app-icon{width:15px;height:15px;flex-basis:15px}.insight-number,.insight-distribution{background:var(--ui-surface);border:1px solid var(--ui-line);box-shadow:var(--ui-shadow)}.insight-number{position:relative;display:flex;flex-direction:column;justify-content:center}.insight-icon{position:absolute;right:20px;top:22px;width:36px;height:36px;display:grid;place-items:center;background:#e8f1fb;color:#527ec0;border-radius:11px}.insight-label{color:var(--ui-muted);font-size:12px;padding-right:35px}.insight-number>strong{font-size:40px;line-height:1.3;font-weight:650;margin:10px 0;color:var(--ink);font-variant-numeric:tabular-nums}.insight-number strong small{font-size:12px;font-weight:400;margin-left:10px;color:var(--ui-muted)}.insight-foot{color:var(--ui-muted);font-size:11px}.insight-distribution{display:flex;align-items:center;justify-content:center;gap:20px}.insight-donut{width:126px;flex:0 0 126px;position:relative}.insight-donut svg{width:100%;display:block}.donut-track{stroke:var(--ui-line)}.insight-donut>div{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none}.insight-donut strong{font-size:28px;line-height:1.3}.insight-donut small{font-size:10px;color:var(--ui-muted)}.insight-legend{flex:1;min-width:60px;max-width:145px}.insight-legend h3{font-size:12px!important;margin-bottom:13px;white-space:nowrap}.insight-legend>span{display:flex;align-items:center;gap:7px;font-size:11px;margin-top:7px;color:var(--ui-muted)}.insight-legend i{width:7px;height:7px;border-radius:2px;flex-shrink:0}.insight-legend b{margin-left:auto;color:var(--ink)}.home-toolbar{padding:13px 16px;border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-surface);gap:14px}.home-layout-toggle{display:none}#home-layout-status{margin:10px 3px 18px;font-size:11px}.home-card-grid{gap:24px}.home-card{transition:box-shadow .18s,border-color .18s}.home-card:hover{box-shadow:0 8px 26px #223d5019!important;border-color:#b4cac0!important}.home-cover{height:220px;background:linear-gradient(120deg,#35595b,#193a40)}.home-cover .cover-shade{background:linear-gradient(180deg,#142b3830,#10282b05 30%,#0a232bcc)}.home-cover-content{padding:22px 25px}.home-cover-content h3{font-size:24px!important;font-weight:600!important;letter-spacing:.5px!important}.home-cover-content .badge{border:1px solid #ffffff38;background:#f6fffaed!important;color:#27594a!important;border-radius:6px!important;font-size:11px}.home-location{font-size:11px;color:#ebf3f0}.cover-edit{background:#142a3560!important;border:1px solid #ffffff80!important;color:#fff!important;backdrop-filter:blur(4px)}.home-summary{color:var(--ui-muted);font-size:12px}.home-numbers{background:var(--ui-soft);border:0;border-radius:10px;padding:14px 0;margin:16px 0 20px}.home-numbers span{border-right:1px solid var(--ui-line);color:var(--ui-muted);font-size:11px}.home-numbers span:last-child{border:0}.home-numbers b{font-size:24px;color:var(--ink)}.home-card-actions{border-top:1px solid var(--ui-line);padding-top:18px;margin-top:18px}.compact-details dt{color:var(--ui-muted)}.compact-details dd{color:var(--ink)}.home-pagination{margin-top:24px;font-size:11px}.metrics{gap:16px}.metrics>div{border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-surface);box-shadow:var(--ui-shadow);border-top:3px solid #438979}.metrics>div:nth-child(2){border-top-color:#658cd1}.metrics>div:nth-child(3){border-top-color:#b69c70}.metrics>div:nth-child(4){border-top-color:#8391b5}.metrics strong{font-variant-numeric:tabular-nums;color:var(--ink)}.device-card-heading .device-symbol{background:#e9f3ef;color:#287e65;border-radius:12px;width:44px;height:44px}.device-card .card-footer{border-top:1px solid var(--ui-line);background:var(--ui-soft);padding:14px 22px}.device-card-grid{gap:20px}.device-view-controls{padding:20px 24px}.device-search-row{border-bottom:1px solid var(--ui-line);padding-bottom:18px;margin-bottom:15px}.group-title{margin:24px 0 14px}.device-location{color:var(--ui-muted)}.network-map{padding:24px}.network-platform{background:var(--ui-soft);border:1px solid var(--ui-line);border-radius:12px;padding:20px}.network-platform>.app-icon{width:30px;height:30px;flex-basis:30px;color:var(--ui-accent)}.network-diagram{margin:20px 0 28px;border:1px solid var(--ui-line);border-radius:12px;overflow:hidden}.diagram-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px 18px;background:var(--ui-surface)}.diagram-toolbar>div{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.diagram-toolbar strong{font-size:13px}.diagram-dot{width:7px;height:7px;border-radius:50%;background:#4d8dbe}.diagram-toolbar label{display:flex;align-items:center;gap:8px;font-size:11px;margin:0}.diagram-toolbar select{width:86px}.diagram-scroll{max-height:480px;overflow:auto;background-color:var(--ui-soft);background-image:radial-gradient(var(--ui-line) 1px,transparent 1px);background-size:18px 18px;border-block:1px solid var(--ui-line)}.network-svg{display:block}.network-edge{stroke:#82a79c;stroke-width:2}.diagram-node{cursor:pointer;outline:none}.diagram-node-bg{fill:var(--ui-surface);stroke:var(--ui-line);stroke-width:1.5}.diagram-node:hover .diagram-node-bg,.diagram-node:focus .diagram-node-bg{stroke:#328d78;stroke-width:2.5}.diagram-node-type{fill:var(--ui-muted);font-size:10px}.diagram-node-title{fill:var(--ink);font-size:14px;font-weight:600}.diagram-node-ip{fill:var(--ui-muted);font-size:11px;font-family:ui-monospace,Consolas,monospace}.diagram-note{margin:0;padding:11px 18px;font-size:11px;color:var(--ui-muted)}.network-details-heading{margin:20px 0 14px}.platform-place-node{position:relative;text-align:left;padding:24px}.platform-place-node:before{content:"";position:absolute;inset:0 auto 0 0;width:4px;background:#438979}.platform-place-node:hover{border-color:#8db4a7!important;background:var(--ui-soft)}.network-open{color:var(--ui-accent);font-weight:600}.scope-intro{border-bottom:1px solid var(--ui-line);padding-bottom:20px}.steward-tile{border-radius:14px!important;border:1px solid var(--ui-line)!important;border-top:3px solid #438979!important;box-shadow:var(--ui-shadow)!important;padding:28px!important;background:var(--ui-surface)!important}.steward-tile:nth-child(2n){border-top-color:#6c8fbc!important}.steward-tile:nth-child(3n){border-top-color:#b29a72!important}.steward-tile strong{font-size:19px!important}.steward-tile:hover{border-color:#9dbab0!important;box-shadow:0 8px 22px #223d5016!important}.journal-card{border-radius:14px;box-shadow:var(--ui-shadow)}#page-live:is(:fullscreen,.wall-expanded) .camera-meta{background:#172e35!important;color:#e8f3ef!important}#page-live:is(:fullscreen,.wall-expanded) .camera-meta strong{color:#e8f3ef!important}#page-live:is(:fullscreen,.wall-expanded) .wall-toolbar{background:#172e35!important;border-color:#45616a!important}#page-live:is(:fullscreen,.wall-expanded) .form-select{background-color:#213b44!important;color:#e8f3ef!important;border-color:#64818b!important}main>footer{color:var(--ui-muted);font-size:10px}html[data-density=compact] .home-insights>article{padding:18px}html[data-density=compact] .home-cover{height:165px}html[data-density=compact] .card-body{padding:18px}@media(min-width:1100px){html[data-layout=top] #app>main{padding-top:28px!important}}@media(max-width:1250px){.home-insights{grid-template-columns:1.2fr .75fr 1fr;gap:12px}.home-insights>article{padding:19px}.insight-distribution{gap:10px}.insight-donut{width:102px;flex-basis:102px}.insight-welcome h2{font-size:20px!important}}@media(max-width:1000px)and (min-width:761px){#app>main{padding:26px 24px!important}.home-insights{grid-template-columns:1fr 1fr}.insight-welcome{grid-column:1/-1}.insight-welcome p{margin-bottom:12px}}@media(max-width:760px){#app>main{padding:20px 16px!important}.sidebar{background:#17353b!important}main>header{margin-bottom:20px!important;padding-bottom:18px!important}#page-title{font-size:25px!important}#page-note{font-size:12px!important}.home-insights{grid-template-columns:1fr 1fr;gap:12px;margin:16px 0 20px}.home-insights>article{padding:18px}.insight-welcome{grid-column:1/-1}.insight-welcome h2{margin:7px 0 0!important;font-size:20px!important}.insight-welcome p,.insight-scope{display:none}.insight-number>strong{font-size:34px}.insight-icon{width:29px;height:29px;top:14px;right:13px}.insight-distribution{flex-direction:column;gap:5px}.insight-donut{width:94px;flex-basis:auto}.insight-legend{width:100%;display:flex;flex-wrap:wrap;justify-content:center;gap:6px}.insight-legend h3{display:none}.insight-legend>span{margin:0;font-size:10px;gap:4px}.insight-number .insight-label{padding-right:24px;font-size:11px}.insight-donut strong{font-size:25px}.insight-donut small{font-size:9px}.home-toolbar{padding:12px}.home-layout-toggle{display:inline-flex;margin-left:auto}.home-toolbar .home-layout-controls{display:none}.home-toolbar.home-options-open .home-layout-controls{display:flex;flex-basis:100%;border-top:1px solid var(--ui-line);padding-top:12px}.home-cover{height:200px}.home-cover-content{padding:20px}.home-cover-content h3{font-size:23px!important}.card-body{padding:20px}.home-numbers{padding:12px 0}.home-card-grid{gap:18px}.home-card-actions{gap:8px;flex-wrap:wrap}.btn{min-height:44px}.form-control,.form-select{min-height:44px;font-size:16px}#page-playback .playback-controls{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}#page-playback .playback-controls label{width:100%;min-width:0}#page-playback .playback-controls input,#page-playback .playback-controls select,#page-playback .playback-controls button{width:100%}#play-info{overflow-wrap:anywhere}.device-view-controls{padding:16px}.network-map{padding:14px}.network-platform{padding:16px}.diagram-toolbar{padding:12px;align-items:flex-start}.diagram-toolbar>div{gap:6px}.diagram-toolbar>div .small{flex-basis:100%;font-size:10px}.diagram-toolbar label{flex-direction:column;align-items:flex-start}.diagram-toolbar select{width:82px}.diagram-scroll{max-height:360px}.steward-tile{padding:22px!important}main[data-page=live]>header{margin-bottom:10px!important;padding-bottom:12px!important}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;scroll-behavior:auto!important}}:root{--ui-shadow: 0 4px 22px #223d500a;--bs-body-font-family: system-ui,"Microsoft YaHei",sans-serif}html[data-theme=paper]{--ui-bg: #f5f5f1;--ui-soft: #f4f6f2}.dashboard-grid{margin-top:4px}.dashboard-grid>div,.row>div{min-width:0}.dashboard-welcome{position:relative;overflow:hidden;padding:28px;border-radius:16px;background:linear-gradient(140deg,#234a49,#2e7964);color:#fff}.dashboard-welcome:after{content:"";position:absolute;right:-85px;top:-95px;width:260px;height:260px;border:40px solid #ffffff07;border-radius:50%;pointer-events:none}.dashboard-welcome h2{font-size:clamp(21px,2vw,26px)!important;color:#fff!important;margin:16px 0 8px;letter-spacing:.2px}.dashboard-welcome>p{color:#d3e7df;font-size:12px}.dashboard-totals{display:flex;gap:28px;margin:22px 0}.dashboard-totals>div{display:flex;flex-direction:column}.dashboard-totals strong{color:#fff;font-size:32px;font-weight:600;line-height:1.3;font-variant-numeric:tabular-nums}.dashboard-totals span{color:#d3e7df;font-size:11px;margin-top:5px}.chart-card{padding:22px;border:1px solid var(--ui-line);border-radius:16px;background:var(--ui-surface);box-shadow:var(--ui-shadow);min-width:0}.chart-heading{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-bottom:10px}.chart-heading h3{font-size:15px!important;font-weight:650;margin:0}.chart-heading .small{font-size:11px}.chart-legend{display:flex;gap:10px 18px;flex-wrap:wrap;justify-content:center;padding-top:8px}.chart-legend span{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--ui-muted)}.chart-legend i{width:8px;height:8px;border-radius:3px}.chart-legend b{color:var(--ink);font-variant-numeric:tabular-nums}.chart-data{color:var(--ui-muted);font-size:11px;margin-top:8px}.chart-data summary{cursor:pointer;padding:6px 0}.chart-data ul{padding-left:20px;margin:8px 0 0}.chart-empty{min-height:150px;display:grid;place-items:center;color:var(--ui-muted);margin:0;font-size:13px}.local-chart-wrap,.local-chart{width:100%;min-width:0}.chart-network-surface{background:var(--ui-soft);border-radius:12px;background-image:radial-gradient(var(--ui-line) 1px,transparent 1px);background-size:20px 20px;overflow:hidden}.chart-network-surface .local-chart{touch-action:none}.household-context{border-left:3px solid #488b76!important}.section-head>div>.description{margin-top:7px}.home-toolbar,.device-view-controls,.playback-controls{box-shadow:var(--ui-shadow)}.home-card .card-body{padding:22px}.home-cover{height:200px}.form-grid label{align-items:stretch}dialog .dialog-heading{position:sticky;top:0;background:var(--ui-surface);z-index:2;padding-block:12px}dialog .dialog-footer{padding-top:18px;border-top:1px solid var(--ui-line)}html[data-theme=ink] .chart-card{color:var(--ink)}html[data-theme=ink] .chart-heading .badge{background:#2c493e!important;color:#c2e9d7!important}@media(max-width:767px){.dashboard-grid:not(.charts-expanded) .dashboard-chart-column{display:none}.dashboard-welcome{padding:22px}.dashboard-welcome h2{font-size:22px!important}.dashboard-totals{justify-content:space-between;gap:14px;margin:18px 0 14px}.dashboard-welcome .insight-scope{display:flex;font-size:10px}.chart-card{padding:18px}.dashboard-grid .chart-card{height:auto!important}.chart-network-surface .local-chart{max-height:340px}.diagram-toolbar{flex-wrap:wrap}.diagram-toolbar .btn{min-height:40px}.household-context{padding:14px!important}.section-head{gap:12px;flex-wrap:wrap}.dialog-footer button{flex:1}.table-wrap{overscroll-behavior-x:contain}}.hardware-grid>div[data-v-2d075cdb]{display:flex;flex-direction:column;gap:4px;background:#f5f7f7;padding:12px;border:3px solid white;border-radius:12px}.hardware-grid span[data-v-2d075cdb],.hardware-grid small[data-v-2d075cdb]{font-size:12px;color:#637471}.hardware-grid strong[data-v-2d075cdb]{font-size:18px}.tv-remote-preview[data-v-2d075cdb]{margin:16px 0;text-align:center}.tv-remote-preview img[data-v-2d075cdb]{max-height:640px;max-width:100%;border:6px solid #303b38;border-radius:12px}.display-manager summary[data-v-2d075cdb]{cursor:pointer}details p[data-v-2d075cdb]{margin-top:12px}form>label[data-v-3234de1e]{display:flex;flex-direction:column;align-items:stretch;gap:.35rem;min-width:0}form>label select[data-v-3234de1e],form>label input[data-v-3234de1e]{width:100%;min-width:0}.family-locations h2[data-v-e83725a4]{font-size:1.3rem}.location-empty[data-v-e83725a4]{display:grid;align-content:center;min-height:270px;text-align:center;color:var(--ui-muted,#64776f);padding:1rem}.location-empty>span[data-v-e83725a4]{font-size:3rem;color:#6c9685}.location-person[data-v-e83725a4]{display:flex;flex-direction:column;gap:.35rem;background:var(--panel,#fff);border:1px solid var(--ui-line,#d9e3dd);border-radius:12px;padding:14px;margin-bottom:10px;color:var(--ink,#243c32)}.location-person>span[data-v-e83725a4],.location-person small[data-v-e83725a4]{font-size:.85rem}.location-selected[data-v-e83725a4]{border-color:#257a68;box-shadow:inset 3px 0 #257a68}.family-locations summary[data-v-e83725a4]{cursor:pointer}.family-locations input[type=checkbox][data-v-e83725a4]{min-width:18px;width:18px;min-height:18px}button.location-person[data-v-e83725a4]{color:var(--ink,#243c32)!important;background:var(--panel,#fff)!important;align-items:stretch;text-align:left!important}.location-person strong[data-v-e83725a4],.location-person small[data-v-e83725a4]{color:var(--ink,#243c32)}.upload-metric[data-v-0c20c09f]{height:100%;padding:1rem;border:1px solid var(--ui-line,#e3e9ef);border-radius:12px;background:var(--panel,#fff);display:flex;flex-direction:column;gap:.35rem}.upload-metric>span[data-v-0c20c09f],.upload-metric>small[data-v-0c20c09f]{color:var(--ui-muted,#64748b);font-size:.8rem}.upload-metric>strong[data-v-0c20c09f]{font-size:1.65rem;line-height:1.5;font-variant-numeric:tabular-nums}.upload-metric.freed[data-v-0c20c09f]{background:color-mix(in srgb,var(--panel,#fff) 90%,#2e876e)}.upload-current[data-v-0c20c09f]{padding:1rem;border-radius:12px;background:color-mix(in srgb,var(--panel,#fff) 90%,#419be1)}.upload-filters[data-v-0c20c09f]{display:flex;flex-wrap:wrap;gap:1rem}.upload-filters label[data-v-0c20c09f]{flex:1;min-width:160px;max-width:330px;font-size:.85rem}.upload-task[data-v-0c20c09f]{padding:1rem 0;border-top:1px solid var(--ui-line,#e3e9ef)}.upload-task-heading[data-v-0c20c09f]{display:flex;justify-content:space-between;gap:.75rem;align-items:center;margin-bottom:.4rem}.upload-details[data-v-0c20c09f]{margin:1rem 0 0}.upload-details>div[data-v-0c20c09f]{display:grid;grid-template-columns:110px 1fr;gap:10px}.upload-details dd[data-v-0c20c09f]{overflow-wrap:anywhere}.upload-tasks summary[data-v-0c20c09f]{cursor:pointer}.upload-tasks .progress[data-v-0c20c09f]{height:8px}.upload-tasks .badge[data-v-0c20c09f]{white-space:normal}.upload-tasks button[data-v-0c20c09f]{min-height:40px}@media(max-width:576px){.upload-metric[data-v-0c20c09f]{padding:.75rem}.upload-metric>strong[data-v-0c20c09f]{font-size:1.2rem}.upload-filters label[data-v-0c20c09f]{min-width:100%;max-width:none}.upload-details>div[data-v-0c20c09f]{grid-template-columns:1fr;gap:0}}.journal-rich-editor{border:1px solid var(--bs-border-color,#ccd9d7);border-radius:12px;overflow:hidden;background:var(--bs-body-bg,#fff);margin:10px 0 20px}.journal-editor-toolbar{display:flex;flex-wrap:wrap;gap:6px;padding:10px;background:var(--bs-tertiary-bg,#f3f7f5);border-bottom:1px solid var(--bs-border-color,#ccd9d7)}.journal-editor-toolbar button{min-height:40px;padding:6px 12px}.journal-editor-toolbar button[aria-pressed=true]{background:#d8eae2;color:#153d31}.journal-rich-input{padding:20px;min-height:200px;outline:none;overflow-wrap:anywhere}.journal-rich-input:focus{box-shadow:inset 0 0 0 2px #669c89}.journal-rich-input p{min-height:1.5em;margin-bottom:12px;white-space:pre-wrap}.journal-rich-input blockquote,.journal-rich-body blockquote{border-left:3px solid #84ad9d;padding-left:16px;color:#5f7870}.journal-editor-foot{display:flex;justify-content:space-between;gap:12px;font-size:12px;color:#667b75;padding:10px 16px;border-top:1px solid #e1e9e5}.journal-inline-media{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:12px;border:1px solid #d4e1da;border-radius:10px;background:#f8faf9;max-width:680px}.journal-inline-media img,.journal-inline-media video{max-width:100%;max-height:380px;object-fit:contain;border-radius:6px}.journal-inline-media audio{width:min(100%,540px)}.journal-inline-media figcaption{font-size:12px;color:#60766c;overflow-wrap:anywhere}.journal-inline-media.ProseMirror-selectednode{outline:2px solid #368268}.journal-rich-body{line-height:1.8;overflow-wrap:anywhere}.journal-rich-body p{white-space:pre-wrap}.journal-rich-body .journal-attachment{max-width:760px;margin:16px 0}.journal-rich-body img,.journal-rich-body video{max-height:480px;object-fit:contain}.journal-materials .journal-add-media{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.journal-materials input[type=file]{max-width:100%}.journal-queue-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 16px;padding:14px 0;border-bottom:1px solid #e1e9e5}.journal-queue-row strong{overflow-wrap:anywhere}.journal-queue-row progress{width:100%;height:8px}.journal-queue-row small{display:block;color:#63756f}.journal-queue-row .journal-task-error{color:#a43b35}.journal-library-list-tools{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:14px 0}.journal-upload-select small{display:block}.journal-editor-heading{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:14px 22px;background:#f5f8f6;border:1px solid #d6e2da;border-radius:12px;margin-bottom:16px}.journal-editor-heading strong{margin-right:auto}.journal-editor-heading button{min-height:44px}.journal-editor-fullscreen{position:fixed;inset:0;z-index:1090;background:#f0f4f2;overflow:auto;overscroll-behavior:contain;padding:0 24px 24px;display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:18px;align-content:start}.journal-editor-fullscreen>.journal-editor-heading{grid-column:1/-1;position:sticky;top:0;z-index:3;margin:0 -24px;border-radius:0;padding:14px 24px;box-shadow:0 2px 10px #183b2412}.journal-editor-fullscreen>.journal-compose{margin:0;min-height:calc(100dvh - 110px);display:flex;flex-direction:column}.journal-editor-fullscreen .journal-rich-editor{flex:1;display:flex;flex-direction:column}.journal-editor-fullscreen .journal-rich-editor>div:has(>.tiptap){flex:1}.journal-editor-fullscreen .journal-rich-input{min-height:52dvh;font-size:19px;line-height:1.9}.journal-editor-fullscreen .journal-editor-toolbar{position:sticky;top:0;z-index:1}.journal-editor-fullscreen>.journal-materials{margin:0;padding:18px;max-height:calc(100dvh - 110px);overflow:auto;position:sticky;top:92px}.journal-editor-fullscreen .journal-upload-grid{grid-template-columns:1fr}.journal-editor-fullscreen .journal-upload-card video,.journal-editor-fullscreen .journal-upload-card img{max-height:160px}.journal-editor-fullscreen .journal-upload-select span{min-width:0;overflow-wrap:anywhere}#journal-record-elapsed{font-variant-numeric:tabular-nums;color:#bd4338}.journal-inline-media .recording-indicator{color:#bd4338}@media(max-width:900px){.journal-editor-fullscreen{display:block;padding:0 12px 20px}.journal-editor-fullscreen>.journal-editor-heading{margin:0 -12px 12px;padding:10px 12px}.journal-editor-fullscreen>.journal-compose{min-height:calc(100dvh - 140px)}.journal-editor-fullscreen>.journal-materials{position:static;max-height:none;margin-top:12px}.journal-editor-fullscreen .journal-rich-input{min-height:48dvh;font-size:17px}.journal-editor-heading{padding:12px;gap:8px}.journal-editor-heading strong{width:100%}}@media(max-width:600px){.journal-rich-input{padding:14px;min-height:190px}.journal-editor-toolbar{gap:4px}.journal-editor-toolbar button{padding:7px 10px}.journal-editor-foot{flex-wrap:wrap}.journal-inline-media{max-width:100%}.journal-queue-row{gap:8px}.journal-compose,.journal-materials{min-width:0}} diff --git a/web/ui/assets/index-Ctw7iCDS.js b/web/ui/assets/index-xETRcHmQ.js similarity index 77% rename from web/ui/assets/index-Ctw7iCDS.js rename to web/ui/assets/index-xETRcHmQ.js index e11b034..747fbdf 100644 --- a/web/ui/assets/index-Ctw7iCDS.js +++ b/web/ui/assets/index-xETRcHmQ.js @@ -1,33 +1,33 @@ -import"./modulepreload-polyfill-B5Qt9EMX.js";import{o as v,c as x,a,b as ge,d as G,e as C,s as Xr,w as Ae,f as $i,g as Bt,n as Nn,h as D,r as P,_ as Nu,t as k,i as Qe,u as j,F as H,j as J,k as De,l as ee,m as Y,v as At,p as dn,q as Te,x as st,y as Ve,z as Aa,A as Iu,B as Oa,C as Du,D as $u,E as Ru,G as Lu,H as Pu,I as Bu,J as _u,K as zu}from"./FamilyMap-CoPJzTbz.js";const ju={class:"app-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.65","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Fu=["d"],be={__name:"AppIcon",props:{name:{type:String,default:"grid"}},setup(n){const e={shield:"M12 2 3 6v6c0 5 9 10 9 10s9-5 9-10V6Z M8 12l3 3 5-6",location:"M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0 M15 10a3 3 0 1 1-6 0 3 3 0 0 1 6 0",home:"m3 10 9-7 9 7v10H3Z M9 20v-7h6v7",journal:"M5 3h14v18H5Z M8 7h8 M8 11h8 M8 15h5",grid:"M3 3h7v7H3Z M14 3h7v7h-7Z M3 14h7v7H3Z M14 14h7v7h-7Z",devices:"M3 4h18v12H3Z M8 20h8 M12 16v4",tree:"M9 2h6v6H9Z M2 16h6v6H2Z M16 16h6v6h-6Z M12 8v4 M5 16v-4h14v4",users:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2 M22 21v-2a4 4 0 0 0-3-3.8 M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8 M17 3a4 4 0 0 1 0 8",settings:"M9 3h6l1 4 4 1v8l-4 1-1 4H9l-1-4-4-1V8l4-1Z M15 12a3 3 0 1 0-6 0 3 3 0 0 0 6 0",database:"M3 6c0-5 18-5 18 0s-18 5-18 0V18c0 5 18 5 18 0V6 M3 12c0 5 18 5 18 0",network:"M9 2h6v6H9Z M2 16h6v6H2Z M16 16h6v6h-6Z M12 8v4 M5 16v-4h14v4",arrow:"M5 12h14 M14 7l5 5-5 5",router:"M3 13h18v8H3Z M6 13V5 M18 13V5 M7 17h.01 M11 17h.01 M15 17h3",camera:"M3 6h12v12H3Z M15 10l6-4v12l-6-4"};return(t,s)=>(v(),x("svg",ju,[a("path",{d:e[n.name]||e.grid},null,8,Fu)]))}},Vu={class:"sidebar"},Hu={class:"nav flex-column",id:"main-navigation","aria-label":"主导航"},qu={"data-page":"households",class:"active"},Uu={id:"scope-navigation",hidden:""},Wu={"data-page":"overview"},Ku={"data-page":"members"},Ju={"data-page":"journal"},Gu={"data-page":"heritage"},Yu={"data-page":"objects"},Xu={"data-page":"accounts"},Zu={"data-page":"settings"},Qu={"data-page":"storage"},ep={__name:"AppSidebar",setup(n){return(e,t)=>(v(),x("aside",Vu,[t[20]||(t[20]=ge('赵字古文字风格标识赵府智能数字管家',3)),a("nav",Hu,[a("button",qu,[G(be,{name:"home"}),t[0]||(t[0]=C()),t[1]||(t[1]=a("span",null,"家族与家庭",-1))]),a("div",Uu,[t[12]||(t[12]=a("div",{id:"scope-nav-name",class:"nav-label"},null,-1)),a("button",Wu,[G(be,{name:"grid"}),t[2]||(t[2]=C()),t[3]||(t[3]=a("span",null,"家庭总览",-1))]),a("button",Ku,[G(be,{name:"users"}),t[4]||(t[4]=C()),t[5]||(t[5]=a("span",null,"家庭成员",-1))]),a("button",Ju,[G(be,{name:"journal"}),t[6]||(t[6]=C()),t[7]||(t[7]=a("span",null,"记事与阅历",-1))]),a("button",Gu,[G(be,{name:"tree"}),t[8]||(t[8]=C()),t[9]||(t[9]=a("span",null,"家庭传承",-1))]),a("button",Yu,[G(be,{name:"devices"}),t[10]||(t[10]=C()),t[11]||(t[11]=a("span",null,"区域与设备",-1))])]),a("button",Xu,[G(be,{name:"users"}),t[13]||(t[13]=C()),t[14]||(t[14]=a("span",null,"系统用户",-1))]),a("button",Zu,[G(be,{name:"settings"}),t[15]||(t[15]=C()),t[16]||(t[16]=a("span",null,"设置中心",-1))]),t[19]||(t[19]=a("a",{class:"btn text-start text-reset",href:"/downloads",target:"_blank",rel:"noreferrer"},"↓ 配套 App 下载",-1)),a("button",Qu,[G(be,{name:"database"}),t[17]||(t[17]=C()),t[18]||(t[18]=a("span",null,"平台存储与审计",-1))])]),t[21]||(t[21]=ge('
独立部署 · 数据自有

记下每一位家人
让共同的记忆代代相传

',4))]))}},hs=(n,e)=>{const t=n.__vccOpts||n;for(const[s,i]of e)t[s]=i;return t},tp={};function np(n,e){return v(),x("header",null,[...e[0]||(e[0]=[ge('
赵氏家宅 · 起居有序

家族与家庭

从家人出发,连接每一代的亲情与记忆。

等待连接
',2)])])}const sp=hs(tp,[["render",np]]),R=Xr({state:{households:[],sites:[],cameras:[]},admin:!1,loggedIn:!1,page:"households",session:0,device:null}),ze=Xr({devices:[],groups:[],rows:[]});window.ZhaoVue={enabled:!0,accept(n){R.value=n},setDevices(n){ze.value=n},clear(){ze.value={devices:[],groups:[],rows:[]}}};const K=()=>window.ZhaoVue,Zr=n=>({lan:"局域网",tailscale:"Tailscale",public:"公网",unknown:"接入待确认"})[n]||"接入待确认";function ip(n=[]){const e=[{key:"home",label:"家庭",color:"#258b76",count:0},{key:"office",label:"办公",color:"#5c83cb",count:0},{key:"factory",label:"工厂",color:"#c69a52",count:0},{key:"other",label:"其他",color:"#8997a9",count:0}];let t=0,s=0;for(const r of n)(e.find(o=>o.key===(r.kind||"home"))||e[3]).count++,t+=Math.max(0,Number(r.deviceCount)||0),s+=Math.max(0,Number(r.sites)||0);let i=0;return{total:n.length,devices:t,areas:s,kinds:e.filter(r=>r.count).map(r=>{const o={...r,share:r.count/n.length*100,offset:i};return i+=o.share,o})}}const ts=["#268575","#648bcc","#c49b5b","#8e82b5","#899aa5"],qs=n=>Math.max(0,Math.floor(Number(n)||0));function Na(n=[]){return{series:[{type:"pie",radius:["62%","84%"],center:["50%","50%"],avoidLabelOverlap:!0,label:{show:!1},emphasis:{scale:!1},data:n.map((e,t)=>({name:e.label,value:qs(e.count),itemStyle:{color:e.color||ts[t%ts.length],borderRadius:4}}))}]}}function Ia(n=[]){return{grid:{left:12,right:35,top:10,bottom:12,containLabel:!0},xAxis:{type:"value",minInterval:1,axisTick:{show:!1}},yAxis:{type:"category",inverse:!0,axisTick:{show:!1},axisLine:{show:!1},axisLabel:{width:90,overflow:"truncate"},data:n.map(e=>e.label)},series:[{type:"bar",barMaxWidth:20,label:{show:!0,position:"right"},data:n.map((e,t)=>({value:qs(e.count),itemStyle:{color:e.color||ts[t%ts.length],borderRadius:[0,5,5,0]}}))}]}}function rp(n={}){const e=[...(n.assets||[]).map(o=>({...o,deviceType:"摄像机"})),...(n.recorders||[]).map(o=>({...o,deviceType:"录像机"})),...n.devices||[]],t=new Map,s=new Map,i={lan:"局域网",tailscale:"Tailscale",public:"公网",unknown:"待登记"};for(const o of e){const l=o.deviceType||"其他",c=i[o.networkAccess]||i.unknown;t.set(l,(t.get(l)||0)+1),s.set(c,(s.get(c)||0)+1)}const r=o=>[...o].map(([l,c])=>({label:l,count:c})).sort((l,c)=>c.count-l.count||l.label.localeCompare(c.label));return{total:e.length,types:r(t),networks:r(s)}}function Da(n,e){return{tooltip:{formatter:t=>t.dataType==="edge"?"已登记的上级连接":t.data.detail||t.name},series:[{type:"graph",layout:"none",roam:!0,draggable:!1,scaleLimit:{min:.2,max:4},symbol:"roundRect",symbolSize:[145,60],edgeSymbol:["none","arrow"],edgeSymbolSize:6,label:{show:!0,fontSize:11,width:128,overflow:"truncate",formatter:t=>t.data.caption||t.name},lineStyle:{color:"#8aa99f",width:2,curveness:.08},emphasis:{focus:"adjacency",lineStyle:{width:3}},data:n,links:e}]}}function op(n=[],e=()=>""){const t=new Map(n.map(r=>[r.device.id,r])),s=n.map((r,o)=>({id:r.device.id,targetId:r.device.id,name:r.device.name,caption:r.device.name+` +import"./modulepreload-polyfill-B5Qt9EMX.js";import{o as y,c as x,a,b as ge,d as G,e as C,s as Xr,w as Ae,f as $i,g as Bt,n as Nn,h as D,r as P,_ as Nu,t as k,i as Qe,u as j,F as H,j as J,k as De,l as ee,m as Y,v as At,p as dn,q as Te,x as st,y as Ve,z as Aa,A as Iu,B as Oa,C as Du,D as $u,E as Ru,G as Lu,H as Pu,I as Bu,J as _u,K as zu}from"./FamilyMap-CiWCoS6Z.js";const ju={class:"app-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.65","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Fu=["d"],be={__name:"AppIcon",props:{name:{type:String,default:"grid"}},setup(n){const e={shield:"M12 2 3 6v6c0 5 9 10 9 10s9-5 9-10V6Z M8 12l3 3 5-6",location:"M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0 M15 10a3 3 0 1 1-6 0 3 3 0 0 1 6 0",home:"m3 10 9-7 9 7v10H3Z M9 20v-7h6v7",journal:"M5 3h14v18H5Z M8 7h8 M8 11h8 M8 15h5",grid:"M3 3h7v7H3Z M14 3h7v7h-7Z M3 14h7v7H3Z M14 14h7v7h-7Z",devices:"M3 4h18v12H3Z M8 20h8 M12 16v4",tree:"M9 2h6v6H9Z M2 16h6v6H2Z M16 16h6v6h-6Z M12 8v4 M5 16v-4h14v4",users:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2 M22 21v-2a4 4 0 0 0-3-3.8 M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8 M17 3a4 4 0 0 1 0 8",settings:"M9 3h6l1 4 4 1v8l-4 1-1 4H9l-1-4-4-1V8l4-1Z M15 12a3 3 0 1 0-6 0 3 3 0 0 0 6 0",database:"M3 6c0-5 18-5 18 0s-18 5-18 0V18c0 5 18 5 18 0V6 M3 12c0 5 18 5 18 0",network:"M9 2h6v6H9Z M2 16h6v6H2Z M16 16h6v6h-6Z M12 8v4 M5 16v-4h14v4",arrow:"M5 12h14 M14 7l5 5-5 5",router:"M3 13h18v8H3Z M6 13V5 M18 13V5 M7 17h.01 M11 17h.01 M15 17h3",camera:"M3 6h12v12H3Z M15 10l6-4v12l-6-4"};return(t,s)=>(y(),x("svg",ju,[a("path",{d:e[n.name]||e.grid},null,8,Fu)]))}},Vu={class:"sidebar"},Hu={class:"nav flex-column",id:"main-navigation","aria-label":"主导航"},qu={"data-page":"households",class:"active"},Uu={id:"scope-navigation",hidden:""},Wu={"data-page":"overview"},Ku={"data-page":"members"},Ju={"data-page":"journal"},Gu={"data-page":"heritage"},Yu={"data-page":"objects"},Xu={"data-page":"accounts"},Zu={"data-page":"settings"},Qu={"data-page":"storage"},ep={__name:"AppSidebar",setup(n){return(e,t)=>(y(),x("aside",Vu,[t[20]||(t[20]=ge('赵字古文字风格标识赵府智能数字管家',3)),a("nav",Hu,[a("button",qu,[G(be,{name:"home"}),t[0]||(t[0]=C()),t[1]||(t[1]=a("span",null,"家族与家庭",-1))]),a("div",Uu,[t[12]||(t[12]=a("div",{id:"scope-nav-name",class:"nav-label"},null,-1)),a("button",Wu,[G(be,{name:"grid"}),t[2]||(t[2]=C()),t[3]||(t[3]=a("span",null,"家庭总览",-1))]),a("button",Ku,[G(be,{name:"users"}),t[4]||(t[4]=C()),t[5]||(t[5]=a("span",null,"家庭成员",-1))]),a("button",Ju,[G(be,{name:"journal"}),t[6]||(t[6]=C()),t[7]||(t[7]=a("span",null,"记事与阅历",-1))]),a("button",Gu,[G(be,{name:"tree"}),t[8]||(t[8]=C()),t[9]||(t[9]=a("span",null,"家庭传承",-1))]),a("button",Yu,[G(be,{name:"devices"}),t[10]||(t[10]=C()),t[11]||(t[11]=a("span",null,"区域与设备",-1))])]),a("button",Xu,[G(be,{name:"users"}),t[13]||(t[13]=C()),t[14]||(t[14]=a("span",null,"系统用户",-1))]),a("button",Zu,[G(be,{name:"settings"}),t[15]||(t[15]=C()),t[16]||(t[16]=a("span",null,"设置中心",-1))]),t[19]||(t[19]=a("a",{class:"btn text-start text-reset",href:"/downloads",target:"_blank",rel:"noreferrer"},"↓ 配套 App 下载",-1)),a("button",Qu,[G(be,{name:"database"}),t[17]||(t[17]=C()),t[18]||(t[18]=a("span",null,"平台存储与审计",-1))])]),t[21]||(t[21]=ge('
独立部署 · 数据自有

记下每一位家人
让共同的记忆代代相传

',4))]))}},In=(n,e)=>{const t=n.__vccOpts||n;for(const[s,i]of e)t[s]=i;return t},tp={};function np(n,e){return y(),x("header",null,[...e[0]||(e[0]=[ge('
赵氏家宅 · 起居有序

家族与家庭

从家人出发,连接每一代的亲情与记忆。

等待连接
',2)])])}const sp=In(tp,[["render",np]]),R=Xr({state:{households:[],sites:[],cameras:[]},admin:!1,loggedIn:!1,page:"households",session:0,device:null}),ze=Xr({devices:[],groups:[],rows:[]});window.ZhaoVue={enabled:!0,accept(n){R.value=n},setDevices(n){ze.value=n},clear(){ze.value={devices:[],groups:[],rows:[]}}};const K=()=>window.ZhaoVue,Zr=n=>({lan:"局域网",tailscale:"Tailscale",public:"公网",unknown:"接入待确认"})[n]||"接入待确认";function ip(n=[]){const e=[{key:"home",label:"家庭",color:"#258b76",count:0},{key:"office",label:"办公",color:"#5c83cb",count:0},{key:"factory",label:"工厂",color:"#c69a52",count:0},{key:"other",label:"其他",color:"#8997a9",count:0}];let t=0,s=0;for(const r of n)(e.find(o=>o.key===(r.kind||"home"))||e[3]).count++,t+=Math.max(0,Number(r.deviceCount)||0),s+=Math.max(0,Number(r.sites)||0);let i=0;return{total:n.length,devices:t,areas:s,kinds:e.filter(r=>r.count).map(r=>{const o={...r,share:r.count/n.length*100,offset:i};return i+=o.share,o})}}const ns=["#268575","#648bcc","#c49b5b","#8e82b5","#899aa5"],qs=n=>Math.max(0,Math.floor(Number(n)||0));function Na(n=[]){return{series:[{type:"pie",radius:["62%","84%"],center:["50%","50%"],avoidLabelOverlap:!0,label:{show:!1},emphasis:{scale:!1},data:n.map((e,t)=>({name:e.label,value:qs(e.count),itemStyle:{color:e.color||ns[t%ns.length],borderRadius:4}}))}]}}function Ia(n=[]){return{grid:{left:12,right:35,top:10,bottom:12,containLabel:!0},xAxis:{type:"value",minInterval:1,axisTick:{show:!1}},yAxis:{type:"category",inverse:!0,axisTick:{show:!1},axisLine:{show:!1},axisLabel:{width:90,overflow:"truncate"},data:n.map(e=>e.label)},series:[{type:"bar",barMaxWidth:20,label:{show:!0,position:"right"},data:n.map((e,t)=>({value:qs(e.count),itemStyle:{color:e.color||ns[t%ns.length],borderRadius:[0,5,5,0]}}))}]}}function rp(n={}){const e=[...(n.assets||[]).map(o=>({...o,deviceType:"摄像机"})),...(n.recorders||[]).map(o=>({...o,deviceType:"录像机"})),...n.devices||[]],t=new Map,s=new Map,i={lan:"局域网",tailscale:"Tailscale",public:"公网",unknown:"待登记"};for(const o of e){const l=o.deviceType||"其他",c=i[o.networkAccess]||i.unknown;t.set(l,(t.get(l)||0)+1),s.set(c,(s.get(c)||0)+1)}const r=o=>[...o].map(([l,c])=>({label:l,count:c})).sort((l,c)=>c.count-l.count||l.label.localeCompare(c.label));return{total:e.length,types:r(t),networks:r(s)}}function Da(n,e){return{tooltip:{formatter:t=>t.dataType==="edge"?"已登记的上级连接":t.data.detail||t.name},series:[{type:"graph",layout:"none",roam:!0,draggable:!1,scaleLimit:{min:.2,max:4},symbol:"roundRect",symbolSize:[145,60],edgeSymbol:["none","arrow"],edgeSymbolSize:6,label:{show:!0,fontSize:11,width:128,overflow:"truncate",formatter:t=>t.data.caption||t.name},lineStyle:{color:"#8aa99f",width:2,curveness:.08},emphasis:{focus:"adjacency",lineStyle:{width:3}},data:n,links:e}]}}function op(n=[],e=()=>""){const t=new Map(n.map(r=>[r.device.id,r])),s=n.map((r,o)=>({id:r.device.id,targetId:r.device.id,name:r.device.name,caption:r.device.name+` `+((r.device.networkHosts||[])[0]||"IP 待填写"),detail:[r.device.name,r.device.deviceType,e(r.device.siteId)||"位置待登记",(r.device.networkHosts||[]).join(" / ")||"IP 待填写",{lan:"局域网",tailscale:"Tailscale",public:"公网"}[r.device.networkAccess]||"接入待确认"].join(` `),x:Math.max(0,r.depth||0)*280,y:o*105,itemStyle:{color:r.device.source==="camera"?"#e1ebfb":"#dceddf",borderColor:r.device.source==="camera"?"#648bcc":"#468b73",borderWidth:1},label:{color:"#213f48"}})),i=n.flatMap(r=>{const o=t.get(r.device.uplinkId);return o&&o.depth+1===r.depth?[{source:o.device.id,target:r.device.id}]:[]});return Da(s,i)}function lp(n=[],e="赵府"){return Da([{id:"platform",name:e,x:0,y:0,symbolSize:[160,65],itemStyle:{color:"#286d5d"},label:{color:"#fff"}},...n.map((t,s)=>({id:"home:"+t.id,targetId:t.id,name:t.name,caption:t.name+` `+qs(t.deviceCount)+" 台设备",detail:[t.name,{home:"家庭",office:"办公",factory:"工厂"}[t.kind||"home"]||"场所",[t.province,t.city,t.district].filter(Boolean).join(" · "),qs(t.deviceCount)+" 台已授权设备"].filter(Boolean).join(` -`),x:300,y:(s-(n.length-1)/2)*120,itemStyle:{color:"#e3efe8",borderColor:"#8ebaa6",borderWidth:1},label:{color:"#213f48"}}))],n.map(t=>({source:"platform",target:"home:"+t.id})))}const ap={class:"local-chart-wrap"},cp=["aria-label"],dp={key:0,class:"small text-secondary px-3",role:"status"},wn={__name:"LocalChart",props:{option:{type:Object,required:!0},label:String,active:{type:Boolean,default:!0},height:{type:Number,default:260}},emits:["select"],setup(n,{emit:e}){const t=n,s=e,i=P(null),r=P(!1);let o,l,c,d,u=!0,p=!1,f="",h="";function g(){o==null||o.dispose(),o=null,f="",h=""}function b(){!d&&u&&(d=requestAnimationFrame(()=>{d=null,m()}))}async function m(){if(!u||!i.value||!t.active){g();return}const y=Math.floor(i.value.clientWidth),S=Math.floor(i.value.clientHeight);if(!y||!S)return;if(!o){if(p)return;p=!0;try{const T=await Nu(()=>import("./charts-runtime-DBCaHPDW.js"),[]);if(!u||!t.active||!i.value)return;o=T.init(i.value,null,{renderer:"canvas",devicePixelRatio:Math.min(window.devicePixelRatio||1,2)}),o.on("click",N=>{var I;(I=N.data)!=null&&I.targetId&&s("select",N.data.targetId)}),r.value=!1}catch(T){r.value=!0,console.error("Local chart unavailable",T);return}finally{p=!1}}const A=getComputedStyle(document.documentElement),O=A.getPropertyValue("--ink").trim()||"#253b46",B=A.getPropertyValue("--ui-muted").trim()||"#627485",E=A.getPropertyValue("--ui-line").trim()||"#e3e9ef",M=JSON.stringify(t.option)+O+B+E;if(M!==f){const T={...t.option,animation:!1,backgroundColor:"transparent",textStyle:{color:O,fontFamily:"system-ui, Microsoft YaHei, sans-serif"},aria:{enabled:!0,description:t.label},tooltip:{trigger:"item",renderMode:"richText",confine:!0,...t.option.tooltip}};for(const N of["xAxis","yAxis"])T[N]&&(T[N]={...T[N],axisLabel:{color:B,...T[N].axisLabel},splitLine:{lineStyle:{color:E}}});T.series=(T.series||[]).map(N=>({...N,label:{color:O,...N.label}})),o.setOption(T,{notMerge:!0,lazyUpdate:!1}),f=M}const w=y+":"+S;w!==h&&(o.resize({width:y,height:S}),h=w)}return Ae(()=>[t.option,t.active],b,{deep:!0,flush:"post"}),$i(()=>{l=new ResizeObserver(b),l.observe(i.value),c=new MutationObserver(b),c.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","data-density"]}),b()}),Bt(()=>{u=!1,cancelAnimationFrame(d),l==null||l.disconnect(),c==null||c.disconnect(),g()}),(y,S)=>(v(),x("div",ap,[a("div",{ref_key:"host",ref:i,class:"local-chart",role:"img","aria-label":n.label,style:Nn({height:n.height+"px"})},null,12,cp),r.value?(v(),x("p",dp,"图表暂未加载,可查看下方数据。")):D("",!0)]))}},up={class:"col-12 col-xl-4"},pp={class:"dashboard-welcome h-100"},fp={class:"dashboard-totals"},hp={class:"insight-scope"},mp={class:"col-12 d-md-none"},gp=["aria-expanded"],bp={class:"col-12 col-md-5 col-xl-3 dashboard-chart-column"},yp={class:"chart-card h-100"},vp={class:"chart-heading"},kp={class:"badge"},xp={key:1,class:"chart-empty"},wp={class:"chart-legend"},Sp={class:"col-12 col-md-7 col-xl-5 dashboard-chart-column"},Cp={class:"chart-card h-100"},Mp={key:1,class:"chart-empty"},Tp={key:2,class:"chart-data"},Ep={__name:"HomeInsights",setup(n){const e=ee(()=>ip(R.value.state.households)),t=P(!1),s=ee(()=>R.value.loggedIn&&R.value.page==="households"),i=ee(()=>(R.value.state.households||[]).map(r=>({label:r.name,count:r.deviceCount||0})).sort((r,o)=>o.count-r.count).slice(0,8));return(r,o)=>(v(),x("section",{class:De(["dashboard-grid row g-3 mb-4",{"charts-expanded":t.value}]),"aria-label":"已授权场所概览"},[a("div",up,[a("article",pp,[o[5]||(o[5]=a("span",{class:"insight-kicker"},"一处相连 · 各有归属",-1)),o[6]||(o[6]=a("h2",null,"家与日常,尽在掌握",-1)),o[7]||(o[7]=a("p",null,"从一处灯火,连接生活的每个空间。",-1)),a("div",fp,[a("div",null,[a("strong",null,k(e.value.total),1),o[1]||(o[1]=a("span",null,"家庭与场所",-1))]),a("div",null,[a("strong",null,k(e.value.devices),1),o[2]||(o[2]=a("span",null,"已登记设备",-1))]),a("div",null,[a("strong",null,k(e.value.areas),1),o[3]||(o[3]=a("span",null,"区域空间",-1))])]),a("div",hp,[G(be,{name:"shield"}),o[4]||(o[4]=C(" 仅汇总你有权访问的家庭与场所",-1))])])]),a("div",mp,[a("button",{class:"btn btn-outline-secondary w-100","aria-expanded":t.value,onClick:o[0]||(o[0]=l=>t.value=!t.value)},k(t.value?"收起图表统计":"展开图表统计"),9,gp)]),a("div",bp,[a("article",yp,[a("div",vp,[o[8]||(o[8]=a("h3",null,"空间分布",-1)),a("span",kp,k(e.value.total)+" 处",1)]),e.value.total?(v(),Qe(wn,{key:0,option:j(Na)(e.value.kinds),active:s.value,height:160,label:"场所分布:"+e.value.kinds.map(l=>l.label+l.count+"个").join(",")},null,8,["option","active","label"])):(v(),x("p",xp,"添加家庭或场所后显示分布")),a("div",wp,[(v(!0),x(H,null,J(e.value.kinds,l=>(v(),x("span",{key:l.key},[a("i",{style:Nn({background:l.color})},null,4),C(k(l.label)+" ",1),a("b",null,k(l.count),1)]))),128))])])]),a("div",Sp,[a("article",Cp,[o[10]||(o[10]=a("div",{class:"chart-heading"},[a("h3",null,"设备分布"),a("span",{class:"small text-secondary"},"按场所 · 最多显示 8 处")],-1)),i.value.length?(v(),Qe(wn,{key:0,option:j(Ia)(i.value),active:s.value,height:190,label:"各场所已登记设备:"+i.value.map(l=>l.label+l.count+"台").join(",")},null,8,["option","active","label"])):(v(),x("p",Mp,"暂无已授权场所")),i.value.length?(v(),x("details",Tp,[o[9]||(o[9]=a("summary",null,"查看统计数字",-1)),a("ul",null,[(v(!0),x(H,null,J(i.value,l=>(v(),x("li",{key:l.label},k(l.label)+":"+k(l.count)+" 台",1))),128))])])):D("",!0)])])],2))}},Ap={key:0,class:"panel","aria-label":"按世代浏览家庭"},Op={class:"d-flex justify-content-between align-items-start flex-wrap gap-3"},Np={key:0,class:"count-pill"},Ip={class:"mb-3"},Dp=["disabled"],$p={key:0,class:"alert alert-danger",role:"alert"},Rp={key:1,role:"status",class:"text-secondary"},Lp={class:"fw-semibold"},Pp={key:0,class:"mt-3 text-secondary"},Bp={key:0,class:"fs-6"},_p={class:"fw-semibold text-primary"},zp={class:"fw-normal text-secondary ms-2"},jp={class:"row g-3 mt-1"},Fp={class:"card-body"},Vp=["disabled","onClick"],Hp={key:0,class:"badge text-bg-primary ms-2"},qp={key:1,class:"text-secondary ms-2"},Up={class:"small text-secondary mt-2 mb-0"},Wp={class:"d-flex flex-wrap gap-2 mt-3"},Kp=["onClick"],Jp={key:0,class:"small text-secondary"},Gp={class:"d-flex flex-wrap gap-2 mt-3"},Yp=["disabled","onClick"],Xp={key:2,class:"mt-3"},Zp={class:"d-flex flex-wrap gap-2 mt-2"},Qp=["disabled","onClick"],ef={key:2,class:"text-secondary",role:"status"},tf={key:3,class:"alert alert-info"},nf={key:4,class:"border rounded p-3",open:""},sf={class:"d-flex flex-wrap gap-2 mt-3"},rf=["onClick"],of={key:5,class:"small text-secondary mt-3 mb-0"},lf={__name:"GenerationDirectory",props:{active:Boolean},setup(n){const e=n,t=P(null),s=P(""),i=P(""),r=P(!1);let o=0;async function l(){const h=++o;if(t.value=null,s.value="",i.value="",r.value=!1,!(!e.active||!R.value.loggedIn))try{const g=await K().api("/api/family-directory");h===o&&(t.value=g)}catch(g){h===o&&(s.value=g.message)}}Ae(()=>[e.active,R.value.loggedIn,R.value.session],l,{immediate:!0});const c=h=>h?(h<=10?["","一","二","三","四","五","六","七","八","九","十"][h]:"第"+h)+"世":"世次待考",d=h=>[...new Set(h.map(g=>g.generation))],u=ee(()=>{var g;const h=i.value.trim().toLocaleLowerCase();return(((g=t.value)==null?void 0:g.trees)||[]).map(b=>({...b,branches:b.branches.map(m=>({...m,people:m.people.filter(y=>!h||[y.name,...y.homes.map(S=>S.name)].join(" ").toLocaleLowerCase().includes(h))})).filter(m=>m.people.length)})).filter(b=>!h||b.branches.length)}),p=ee(()=>{var h;return new Set((((h=t.value)==null?void 0:h.trees)||[]).flatMap(g=>g.branches.flatMap(b=>b.people.map(m=>m.id)))).size});async function f(h,g,b=!1){if(r.value)return;const m=o;r.value=!0,s.value="";try{b?await K().viewMemberHistory(h.id,h.name,g):await K().viewPerson(h.id,g)}catch(y){m===o&&!y.stale&&(s.value=y.message)}finally{m===o&&(r.value=!1)}}return(h,g)=>{var b,m;return n.active?(v(),x("section",Ap,[a("div",Op,[a("div",null,[a("h2",null,[g[1]||(g[1]=C("家族世代 ",-1)),t.value?(v(),x("span",Np,k(p.value)+" 位家人",1)):D("",!0)]),g[2]||(g[2]=a("p",{class:"text-secondary"},"从长辈到晚辈,查看每个人的亲属、故事与家庭。一个家庭可以包含多代人。",-1))]),a("label",Ip,[g[3]||(g[3]=C("找家人",-1)),Y(a("input",{"onUpdate:modelValue":g[0]||(g[0]=y=>i.value=y),type:"search",class:"form-control",placeholder:"姓名或家庭名称",disabled:!t.value},null,8,Dp),[[At,i.value]])])]),g[7]||(g[7]=a("p",{class:"small text-secondary"},"一世从本支已知最早一代相对起算,不代表历史族谱中的绝对世次。未连接的分支分别展示,关系不足时标为“世次待考”。",-1)),s.value?(v(),x("div",$p,[C(k(s.value)+" ",1),a("button",{class:"btn btn-sm btn-outline-danger ms-2",onClick:l},"重新加载")])):t.value?D("",!0):(v(),x("p",Rp,"正在整理世代关系…")),(v(!0),x(H,null,J(u.value,y=>(v(),x("details",{key:y.id,class:"border rounded p-3 mb-3",open:""},[a("summary",Lp,"共用族谱 · "+k(y.homes.map(S=>S.name).join("、")),1),y.branches.length?D("",!0):(v(),x("p",Pp,"请先登记家庭成员,再连接亲属关系。")),(v(!0),x(H,null,J(y.branches,(S,A)=>{var O;return v(),x("section",{key:S.id,class:"mt-4"},[y.branches.length>1?(v(),x("h3",Bp,"分支 "+k(A+1)+" · "+k((O=S.people[0])==null?void 0:O.name),1)):D("",!0),(v(!0),x(H,null,J(d(S.people),B=>(v(),x("details",{key:B||"unknown",class:"border-start ps-3 mb-4",open:""},[a("summary",_p,[C(k(c(B))+" ",1),a("small",zp,k(S.people.filter(E=>E.generation===B).length)+" 人",1)]),a("div",jp,[(v(!0),x(H,null,J(S.people.filter(E=>E.generation===B),E=>{var M;return v(),x("article",{key:E.id,class:"col-12 col-md-6 col-xl-4"},[a("div",{class:De(["card h-100",{"border-primary bg-primary-subtle":E.self}])},[a("div",Fp,[a("button",{class:"btn btn-link p-0 fw-semibold fs-5 text-start",disabled:r.value,onClick:w=>f(E,y.familyId)},k(E.name),9,Vp),E.self?(v(),x("span",Hp,"本人")):D("",!0),E.lifeStatus==="deceased"?(v(),x("small",qp,"已故")):D("",!0),a("p",Up,k(E.self?"当前账号关联的家人":"人物档案 · 亲属关系 · 生平"),1),a("div",Wp,[(v(!0),x(H,null,J(E.homes,w=>(v(),x("button",{key:w.id,class:"btn btn-sm btn-outline-primary",onClick:T=>j(K)().enterHome(w.id)},k(w.name)+" →",9,Kp))),128)),E.homes.length?D("",!0):(v(),x("span",Jp,"暂无可访问的当前家庭关联"))]),a("div",Gp,[a("button",{class:"btn btn-sm btn-outline-primary",disabled:r.value,onClick:w=>f(E,y.familyId)},"查看人物与亲属",8,Yp)]),(M=E.journalHomes)!=null&&M.length?(v(),x("details",Xp,[g[4]||(g[4]=a("summary",{class:"small"},"个人阅历",-1)),a("div",Zp,[(v(!0),x(H,null,J(E.journalHomes,w=>(v(),x("button",{key:w.id,class:"btn btn-sm btn-outline-secondary",disabled:r.value,onClick:T=>f(E,w.id,!0)},k(w.name)+"的记事",9,Qp))),128))]),g[5]||(g[5]=a("p",{class:"small text-secondary mt-2 mb-0"},"按记事所属家庭查看,仅展示已授权的内容。",-1))])):D("",!0)])],2)])}),128))])]))),128))])}),128))]))),128)),t.value&&i.value.trim()&&!u.value.length?(v(),x("p",ef,"没有找到这位家人,可尝试其他姓名或清空搜索。")):D("",!0),t.value&&!t.value.trees.length?(v(),x("p",tf,"暂无可查看的家族资料。进入下方已授权家庭登记成员,或请家庭管理员授予族谱查看权限。")):D("",!0),(m=(b=t.value)==null?void 0:b.unplaced)!=null&&m.length?(v(),x("details",nf,[g[6]||(g[6]=a("summary",null,"我的家庭与其他场所",-1)),a("div",sf,[(v(!0),x(H,null,J(t.value.unplaced,y=>(v(),x("button",{key:y.id,class:"btn btn-outline-secondary",onClick:S=>j(K)().enterHome(y.id)},k(y.name)+" →",9,rf))),128))])])):D("",!0),t.value?(v(),x("p",of,"家人无需注册账号。人物档案沿用同一份,居住地址不决定亲属关系;这里仅展示你有权查看的资料。")):D("",!0)])):D("",!0)}}},af={id:"page-households",class:"page"},cf={class:"section-head"},df=["hidden"],uf={class:"btn-group",role:"group","aria-label":"浏览方式"},pf=["aria-pressed"],ff=["aria-pressed"],hf=["aria-pressed"],mf=["aria-expanded"],gf={id:"home-layout-options",class:"home-layout-controls"},bf=["disabled"],yf=["value"],vf=["disabled"],kf=["value"],xf={class:"inline-check"},wf=["disabled"],Sf={class:"inline-check"},Cf=["disabled"],Mf=["disabled"],Tf=["disabled"],Ef={key:0,class:"group-title"},Af={class:"home-card-grid"},Of=["draggable","onDragstart","onDrop"],Nf={class:"home-cover"},If=["src","alt"],Df={class:"home-cover-content"},$f={class:"site-heading"},Rf={class:"badge"},Lf=["data-edit-household"],Pf={class:"home-location"},Bf={class:"card-body"},_f={key:0,class:"home-order-actions"},zf=["disabled","aria-label","onClick"],jf=["disabled","aria-label","onClick"],Ff={class:"home-summary"},Vf={class:"home-numbers"},Hf={class:"compact-details"},qf={class:"home-card-actions"},Uf=["onClick"],Wf=["data-leadership"],Kf={key:0,class:"empty"},Jf={id:"home-global-topology",class:"network-overview"},Gf={class:"network-platform"},Yf={key:0,class:"chart-network-surface mb-3"},Xf={class:"platform-place-grid"},Zf=["onClick"],Qf={class:"badge"},eh={class:"home-pagination"},th={id:"home-page-info"},nh=["disabled"],sh=["disabled"],ih={__name:"HomeExplorer",setup(n){const e=P({revision:0,columns:2,rows:2,groupCity:!1,order:[]}),t=P(!1),s=P(!1),i=P(0),r=P(!1),o=P("generations"),l=P(!1),c=P(""),d=P("");let u="";Ae(R,E=>{var w;const M=((w=E.user)==null?void 0:w.id)+":"+E.session;u!==M&&(u=M,t.value=!1,s.value=!1,i.value=0,r.value=!1,o.value="generations",l.value=!1,c.value="",d.value=""),!t.value&&!s.value&&(e.value={revision:0,columns:2,rows:2,groupCity:!1,order:[],...E.state.householdLayout})},{immediate:!0});const p=ee(()=>{const E=R.value.state.households||[],M=new Map(E.map(w=>[w.id,w]));return[...new Set([...e.value.order,...E.map(w=>w.id)])].filter(w=>M.has(w)).map(w=>M.get(w))}),f=ee(()=>e.value.columns*e.value.rows),h=ee(()=>Math.max(1,Math.ceil(p.value.length/f.value)));Ae(h,E=>i.value=Math.min(i.value,E-1));const g=ee(()=>{var w;const E=p.value.slice(i.value*f.value,(i.value+1)*f.value);if(!e.value.groupCity)return[{name:"",items:E}];const M=new Map;for(const T of E){const N=[((w=T.geography)==null?void 0:w.country)||T.country,T.province,T.city||"地区待填写"].filter(Boolean).join(" / ");M.has(N)||M.set(N,[]),M.get(N).push(T)}return[...M].map(([T,N])=>({name:T,items:N}))}),b=E=>({home:"家庭",office:"办公场所",factory:"工厂"})[E.kind||"home"]||"场所",m=E=>{var M,w;return((w=(M=K()).address)==null?void 0:w.call(M,E))||[E.province,E.city,E.district].filter(Boolean).join(" · ")||"地区待填写"};function y(){t.value=!0,i.value=0,e.value.groupCity&&(r.value=!1),d.value="布局已调整,保存后下次登录会沿用。"}function S(E,M,w){if(s.value)return;const T=p.value.map(Z=>Z.id),N=T.indexOf(E),I=w?T.indexOf(w):N+M;N<0||I<0||I>=T.length||N===I||(T.splice(N,1),T.splice(I,0,E),e.value.order=T,t.value=!0,i.value=Math.floor(I/f.value))}function A(){t.value=!1,e.value={...R.value.state.householdLayout},i.value=0,d.value=""}async function O(){const E=u;s.value=!0;try{const M=await K().saveLayout({...e.value});if(E!==u)return;e.value=M,t.value=!1,d.value="布局与卡片顺序已保存"}catch(M){!M.stale&&E===u&&(d.value=M.message)}finally{E===u&&(s.value=!1)}}async function B(E,M=!1){await K().enterHome(E.id,M)}return(E,M)=>(v(),x("section",af,[a("div",cf,[M[13]||(M[13]=a("div",null,[a("h2",null," 家人与家庭 "),a("p",{class:"description mb-0"}," 以家人为起点,串起亲属关系、共同记忆与日常生活。 ")],-1)),a("button",{id:"new-household",class:"btn btn-primary",hidden:!j(R).platformAdmin}," + 新建家庭或场所 ",8,df)]),a("div",{class:De(["home-toolbar",{"home-options-open":l.value}])},[a("div",uf,[a("button",{class:De(["btn btn-outline-secondary",{active:o.value==="generations"}]),"aria-pressed":o.value==="generations",onClick:M[0]||(M[0]=w=>o.value="generations")},[G(be,{name:"tree"}),M[14]||(M[14]=C(" 家族世代",-1))],10,pf),a("button",{id:"home-card-view",class:De(["btn btn-outline-secondary",{active:o.value==="cards"}]),"aria-pressed":o.value==="cards",onClick:M[1]||(M[1]=w=>o.value="cards")},[G(be,{name:"grid"}),M[15]||(M[15]=C(" 家庭卡片",-1))],10,ff),a("button",{id:"home-topology-view",class:De(["btn btn-outline-secondary",{active:o.value==="topology"}]),"aria-pressed":o.value==="topology",onClick:M[2]||(M[2]=w=>o.value="topology")},[G(be,{name:"network"}),M[16]||(M[16]=C(" 场所网络 ",-1))],10,hf)]),Y(a("button",{class:"btn btn-outline-secondary home-layout-toggle","aria-expanded":l.value,"aria-controls":"home-layout-options",onClick:M[3]||(M[3]=w=>l.value=!l.value)},k(l.value?"收起设置":"布局设置"),9,mf),[[dn,o.value==="cards"]]),Y(a("div",gf,[a("label",null,[M[17]||(M[17]=C("每页 ",-1)),Y(a("select",{id:"home-columns","onUpdate:modelValue":M[4]||(M[4]=w=>e.value.columns=w),class:"form-select",disabled:s.value,onChange:y},[(v(),x(H,null,J(4,w=>a("option",{key:w,value:w},k(w)+" 列",9,yf)),64))],40,bf),[[Te,e.value.columns,void 0,{number:!0}]])]),M[20]||(M[20]=a("span",null,"×",-1)),Y(a("select",{id:"home-rows","onUpdate:modelValue":M[5]||(M[5]=w=>e.value.rows=w),"aria-label":"每页行数",class:"form-select",disabled:s.value,onChange:y},[(v(),x(H,null,J(4,w=>a("option",{key:w,value:w},k(w)+" 行",9,kf)),64))],40,vf),[[Te,e.value.rows,void 0,{number:!0}]]),a("label",xf,[Y(a("input",{id:"home-group-city","onUpdate:modelValue":M[6]||(M[6]=w=>e.value.groupCity=w),type:"checkbox",class:"form-check-input",disabled:s.value,onChange:y},null,40,wf),[[st,e.value.groupCity]]),M[18]||(M[18]=C("按城市分组",-1))]),a("label",Sf,[Y(a("input",{id:"home-arrange","onUpdate:modelValue":M[7]||(M[7]=w=>r.value=w),type:"checkbox",class:"form-check-input",disabled:e.value.groupCity||s.value},null,8,Cf),[[st,r.value]]),M[19]||(M[19]=C("调整顺序",-1))]),a("button",{id:"home-layout-save",class:"btn btn-primary",disabled:!t.value||s.value,onClick:O},k(s.value?"保存中…":"保存布局"),9,Mf),a("button",{id:"home-layout-reset",class:"btn btn-outline-secondary",disabled:!t.value||s.value,onClick:A}," 撤销 ",8,Tf)],512),[[dn,o.value==="cards"]])],2),Y(a("p",{id:"home-layout-status",role:"status",class:"small text-secondary"},k(d.value||"布局仅影响你的账号;手机端自动适配为单列。"),513),[[dn,o.value==="cards"]]),G(lf,{active:o.value==="generations"&&j(R).loggedIn&&j(R).page==="households"},null,8,["active"]),o.value==="topology"&&j(R).page==="households"&&j(R).loggedIn?(v(),Qe(Ep,{key:0})):D("",!0),Y(a("div",{id:"household-list",style:Nn({"--home-columns":e.value.columns})},[(v(!0),x(H,null,J(g.value,w=>(v(),x("section",{key:w.name,class:"home-city-group"},[w.name?(v(),x("h3",Ef,k(w.name),1)):D("",!0),a("div",Af,[(v(!0),x(H,null,J(w.items,T=>{var N,I;return v(),x("article",{key:T.id,class:"card home-card",draggable:r.value&&!s.value,onDragstart:Z=>{c.value=T.id,Z.dataTransfer.setData("text/plain",T.id)},onDragend:M[8]||(M[8]=Z=>c.value=""),onDragover:M[9]||(M[9]=Z=>r.value&&c.value&&Z.preventDefault()),onDrop:Ve(Z=>{r.value&&c.value&&S(c.value,0,T.id),c.value=""},["prevent"])},[a("div",Nf,[T.coverUrl?(v(),x("img",{key:0,src:T.coverUrl,alt:T.name+"封面",loading:"lazy"},null,8,If)):D("",!0),M[21]||(M[21]=a("div",{class:"cover-shade"},null,-1)),a("div",Df,[a("div",$f,[a("span",Rf,[C(k(b(T)),1),T.id===j(R).state.familyId?(v(),x(H,{key:0},[C(" · 当前")],64)):D("",!0)]),j(R).admin?(v(),x("button",{key:0,class:"btn btn-sm cover-edit","data-edit-household":T.id}," 编辑 ",8,Lf)):D("",!0)]),a("div",null,[a("h3",null,k(T.name),1),a("p",Pf,k(m(T)),1)])])]),a("div",Bf,[r.value?(v(),x("div",_f,[M[22]||(M[22]=a("span",null,"拖动排序",-1)),a("button",{class:"btn btn-sm btn-outline-secondary",disabled:((N=p.value[0])==null?void 0:N.id)===T.id||s.value,"aria-label":T.name+"前移",onClick:Z=>S(T.id,-1)}," ←",8,zf),a("button",{class:"btn btn-sm btn-outline-secondary",disabled:((I=p.value.at(-1))==null?void 0:I.id)===T.id||s.value,"aria-label":T.name+"后移",onClick:Z=>S(T.id,1)}," → ",8,jf)])):D("",!0),a("p",Ff,k(T.note||"记录家人、共同经历与日常生活。"),1),a("div",Vf,[a("span",null,[a("b",null,k(T.members||0),1),M[23]||(M[23]=C("成员",-1))]),a("span",null,[a("b",null,k(T.accounts||0),1),M[24]||(M[24]=C("授权账号",-1))]),a("span",null,k(b(T)),1)]),a("dl",Hf,[a("div",null,[a("dt",null,k(T.kind==="office"||T.kind==="factory"?"主要负责人":"家庭管理账号"),1),a("dd",null,k(T.ownerName||"待指定"),1)]),a("div",null,[M[25]||(M[25]=a("dt",null,"备用负责人",-1)),a("dd",null,k(T.successorName||"待指定"),1)])]),a("div",qf,[a("button",{class:"btn btn-primary",onClick:Z=>B(T)},[C(" 进入"+k(b(T))+" ",1),G(be,{name:"arrow"})],8,Uf),T.canAssignOwner?(v(),x("button",{key:0,class:"btn btn-link","data-leadership":T.id}," 负责人安排 ",8,Wf)):D("",!0)])])],40,Of)}),128))])]))),128)),p.value.length?D("",!0):(v(),x("div",Kf," 登录后查看已授权的家庭与场所。 "))],4),[[dn,o.value==="cards"]]),Y(a("div",Jf,[a("div",Gf,[G(be,{name:"network"}),a("div",null,[a("h3",null,k(j(R).brandName||"赵府")+" · 数字管家",1),a("p",null,k(p.value.length)+" 个已授权空间",1)])]),M[27]||(M[27]=a("p",{class:"description"}," 平台与场所的管理关系;进入场所查看内部设备及网络。 ",-1)),p.value.length?(v(),x("div",Yf,[G(wn,{option:j(lp)(p.value,j(R).brandName||"赵府"),active:j(R).loggedIn&&j(R).page==="households"&&o.value==="topology",height:340,label:"平台及已授权场所关系图;点击场所进入内部网络,下面也可通过卡片进入。",onSelect:M[10]||(M[10]=w=>B({id:w},!0))},null,8,["option","active"])])):D("",!0),a("div",Xf,[(v(!0),x(H,null,J(p.value,w=>(v(),x("button",{key:w.id,class:"card platform-place-node",onClick:T=>B(w,!0)},[a("span",Qf,k(b(w)),1),a("h3",null,k(w.name),1),a("p",null,k(m(w)),1),a("span",null,k(w.deviceCount||0)+" 台设备",1),a("small",null,k((w.networkAccesses||[]).map(j(Zr)).join(" · ")||"网络待登记"),1),M[26]||(M[26]=a("span",{class:"network-open"},"查看网络拓扑 →",-1))],8,Zf))),128))])],512),[[dn,o.value==="topology"]]),Y(a("div",eh,[a("span",th,"第 "+k(i.value+1)+" / "+k(h.value)+" 页 · 每页最多 "+k(f.value)+" 张",1),a("button",{id:"home-prev",class:"btn btn-outline-secondary",disabled:!i.value,onClick:M[11]||(M[11]=w=>i.value--)}," 上一页",8,nh),a("button",{id:"home-next",class:"btn btn-outline-secondary",disabled:i.value>=h.value-1,onClick:M[12]||(M[12]=w=>i.value++)}," 下一页 ",8,sh)],512),[[dn,o.value==="cards"]])]))}},rh={key:0,class:"network-status-block"},oh={class:"network-status-title"},lh=["disabled"],ah={key:0,class:"text-danger small",role:"status"},ch={key:0,class:"small text-secondary"},dh={key:1,class:"small text-secondary"},uh={key:2,class:"small text-secondary"},ph={class:"management-links"},fh=["href"],hh={key:0},mh={class:"network-check-time"},Qr={__name:"NetworkStatus",props:{device:{type:Object,required:!0},active:{type:Boolean,default:!0}},setup(n){const e=n,t=P(null),s=P(!1),i=P("");let r=0,o;const l=ee(()=>[e.device.id,e.device.source,e.device.managementHost,e.device.tailscaleHost,e.device.networkCidr,R.value.state.familyId,R.value.session,R.value.admin,e.active].join("|"));async function c(){const p=r;if(!(s.value||!R.value.admin||!e.active)){s.value=!0,i.value="";try{const f=await K().api("/api/devices/network?source="+encodeURIComponent(e.device.source)+"&id="+encodeURIComponent(e.device.id));p===r&&(t.value=f)}catch(f){p===r&&!f.stale&&(i.value=f.message)}finally{p===r&&(s.value=!1,o=setTimeout(c,35e3))}}}Ae(l,()=>{r++,clearTimeout(o),s.value=!1,t.value=null,i.value="",R.value.admin&&e.active&&c()},{immediate:!0}),Aa(()=>{r++,clearTimeout(o)});const d=ee(()=>t.value?t.value.targets.some(p=>p.reachable)?"网络可达":"未连通":"等待检查");function u(){clearTimeout(o),c()}return(p,f)=>{var h,g;return j(R).admin?(v(),x("div",rh,[a("div",oh,[a("span",null,[a("i",{class:De(["status-dot",{online:(h=t.value)==null?void 0:h.targets.some(b=>b.reachable)}])},null,2),C(k(s.value?"正在检查…":d.value),1)]),a("button",{class:"btn btn-sm btn-link",disabled:s.value,onClick:u},"检查网络",8,lh)]),i.value?(v(),x("p",ah,k(i.value),1)):D("",!0),t.value?(v(),x(H,{key:1},[(v(!0),x(H,null,J(t.value.targets,b=>(v(),x("div",{key:b.kind,class:"network-target"},[a("span",null,k(b.kind==="tailscale"?"Tailscale":"设备地址"),1),a("code",null,k(b.host),1),a("span",{class:De(b.reachable?"text-success":"text-secondary")},k(b.reachable?"服务可达":"未响应"),3)]))),128)),t.value.targets.length?D("",!0):(v(),x("p",ch,"请编辑设备档案,填写 IP 或域名。")),(g=t.value.tailscale)!=null&&g.available?(v(),x("p",dh,[C("Tailscale 节点"+k(t.value.tailscale.online?"在线":"离线"),1),t.value.tailscale.subnet?(v(),x(H,{key:0},[C(" · "+k(t.value.tailscale.subnetAvailable?"已发布":"未检测到")+" "+k(t.value.tailscale.subnet)+" 路由",1)],64)):D("",!0)])):t.value.tailscale?(v(),x("p",uh,k(t.value.tailscale.note),1)):D("",!0),a("div",ph,[(v(!0),x(H,null,J(t.value.links,b=>(v(),x("a",{key:b.kind,href:b.url,target:"_blank",rel:"noopener noreferrer",class:"btn btn-sm btn-outline-secondary"},[C("打开管理后台 · "+k(b.kind==="tailscale"?"Tailscale":"局域网")+" ↗",1),b.verified?D("",!0):(v(),x("span",hh,"(待连通)"))],8,fh))),128))]),a("small",mh,"检查于 "+k(new Date(t.value.checkedAt*1e3).toLocaleTimeString("zh-CN"))+" · 从服务器探测,打开后台需当前浏览器也能到达。",1)],64)):D("",!0)])):D("",!0)}}},gh={class:"mt-3"},bh=["disabled"],yh={class:"form-check"},vh={class:"d-flex flex-column gap-2 my-3"},kh=["value"],xh={key:0,class:"small text-secondary"},wh={key:0,class:"text-danger small",role:"alert"},Sh={key:1,class:"text-success small",role:"status"},Ch={__name:"VoicePermissions",props:{deviceId:String},setup(n){const e=n,t=P(!1),s=P([]),i=P([]),r=P(!0),o=P(""),l=P("");let c=!0;async function d(){try{const p=await K().api("/api/display-voice",{deviceId:e.deviceId,action:"settings"});c&&(t.value=p.enabled,s.value=p.allowed,i.value=p.candidates)}catch(p){c&&(o.value=p.message)}finally{c&&(r.value=!1)}}async function u(){if(!r.value){r.value=!0,o.value="",l.value="";try{await K().api("/api/display-voice",{deviceId:e.deviceId,action:"configure",enabled:t.value,allowed:s.value,consent:!0}),c&&(l.value="喊话接收权限已保存")}catch(p){c&&(o.value=p.message)}finally{c&&(r.value=!1)}}}return $i(d),Bt(()=>c=!1),(p,f)=>(v(),x("details",gh,[f[3]||(f[3]=a("summary",null,"家人喊话 · 接收权限",-1)),f[4]||(f[4]=a("p",{class:"small text-secondary mt-2"},"选择可以向此终端喊话的家人手机。对方按住说话、松开发送;终端 App 打开时播放,屏幕上可以停止播放。重新配对后需要重新授权。",-1)),a("fieldset",{disabled:r.value},[a("label",yh,[Y(a("input",{"onUpdate:modelValue":f[0]||(f[0]=h=>t.value=h),type:"checkbox",class:"form-check-input"},null,512),[[st,t.value]]),f[2]||(f[2]=C("允许接收所选家人的喊话",-1))]),a("div",vh,[(v(!0),x(H,null,J(i.value,h=>(v(),x("label",{key:h.id,class:"form-check"},[Y(a("input",{"onUpdate:modelValue":f[1]||(f[1]=g=>s.value=g),type:"checkbox",class:"form-check-input",value:h.id},null,8,kh),[[st,s.value]]),C(k(h.name),1)]))),128)),i.value.length?D("",!0):(v(),x("span",xh,"先让家人的手机完成配对,再选择喊话人。"))]),a("button",{class:"btn btn-outline-primary btn-sm",onClick:u},"保存接收权限")],8,bh),o.value?(v(),x("p",wh,k(o.value),1)):D("",!0),l.value?(v(),x("p",Sh,k(l.value),1)):D("",!0)]))}},Mh={key:0,class:"display-manager mt-3"},Th={key:0,class:"border rounded-3 p-3 mt-3"},Eh={class:"d-flex justify-content-between align-items-center gap-2 mb-3"},Ah={class:"small text-secondary"},Oh={class:"row g-2 hardware-grid"},Nh={class:"col-6"},Ih={class:"col-6"},Dh={class:"col-6"},$h={class:"col-6"},Rh={class:"small text-secondary mt-3"},Lh={key:0},Ph={key:0,class:"small text-secondary"},Bh={class:"small mb-3"},_h=["disabled"],zh={key:1,class:"tv-remote-preview"},jh=["src"],Fh={class:"small text-secondary"},Vh={class:"mt-3"},Hh={class:"row g-2 my-2"},qh={class:"col-12"},Uh={class:"col-6"},Wh={class:"col-6"},Kh=["disabled"],Jh={key:0,class:"my-3"},Gh=["value"],Yh=["href"],Xh=["disabled","onClick"],Zh={key:2,class:"alert alert-success mt-3"},Qh={class:"fs-3 font-monospace"},em={key:4,class:"text-danger mt-2",role:"alert"},tm={__name:"DisplayManager",props:{device:Object},setup(n){const e=n,t=P(!1),s=P(null),i=P([]),r=P(""),o=P(!1),l=P(""),c=P(""),d=P(0);let u,p=0,f="";const h=ee(()=>{var w;return(w=R.value.state.households)==null?void 0:w.find(T=>T.id===R.value.state.familyId)}),g=P(""),b=P(""),m=P(""),y=P(""),S=w=>w+"?deviceId="+encodeURIComponent(e.device.id),A=ee(()=>{var w;return((w=s.value)==null?void 0:w.hardware)||{}}),O=(w,T=1)=>typeof w=="number"?w.toFixed(T):"未提供",B=w=>w?new Date(w*1e3).toLocaleString("zh-CN"):"尚未上报";async function E(){const w=p;if(t.value)try{const T=await K().api(S("/api/displays/hardware"));if(w!==p)return;if(s.value=T,Date.now(){var T;if(p++,clearTimeout(u),l.value="",y.value="",r.value="",c.value="",d.value=0,f&&(URL.revokeObjectURL(f),f=""),w){const N=p;g.value=((T=h.value)==null?void 0:T.city)||"",b.value=g.value==="济南市"?"36.67":"",m.value=g.value==="济南市"?"116.99":"",E();try{const I=await K().api(S("/api/displays"));N===p&&(i.value=I.items)}catch(I){N===p&&(r.value=I.message)}}}),Ae(()=>[R.value.state.familyId,R.value.session,R.value.page,e.device.id].join("|"),()=>t.value=!1),Aa(()=>{p++,clearTimeout(u),f&&URL.revokeObjectURL(f)}),(w,T)=>{var N,I,Z,Oe,le,ae,_,fe,rt,vt,F,jt,xs,Ft,cn;return j(R).admin?(v(),x("div",Mh,[a("button",{class:"btn btn-outline-primary btn-sm",onClick:T[0]||(T[0]=te=>t.value=!t.value)},k(t.value?"收起显示终端管理":"显示终端管理 · 状态与模拟屏"),1),t.value?(v(),x("section",Th,[a("div",Eh,[a("strong",null,k(n.device.name),1),a("span",{class:De(["badge",(N=s.value)!=null&&N.online?"text-bg-success":"text-bg-secondary"])},k((I=s.value)!=null&&I.online?"在线 · 心跳正常":(Z=s.value)!=null&&Z.paired?"未收到心跳":"尚未绑定"),3)]),a("p",Ah,"所属:"+k((Oe=h.value)==null?void 0:Oe.name)+" · 最后心跳 "+k(B((le=s.value)==null?void 0:le.lastSeen)),1),a("div",Oh,[a("div",Nh,[T[7]||(T[7]=a("span",null,"处理器温度",-1)),a("strong",null,k(O(A.value.temperatureC))+k(A.value.temperatureC!=null?" °C":""),1),a("small",null,k(A.value.temperatureSource||"等待传感器上报"),1)]),a("div",Ih,[T[8]||(T[8]=a("span",null,"整机功率",-1)),a("strong",null,k(O(A.value.powerW))+k(A.value.powerW!=null?" W":""),1),a("small",null,k(A.value.powerSource||"需设备传感器或计量插座"),1)]),a("div",Dh,[T[9]||(T[9]=a("span",null,"可用内存",-1)),a("strong",null,k(O(A.value.memoryAvailableMB,0))+" / "+k(O(A.value.memoryTotalMB,0))+" MB",1)]),a("div",$h,[T[10]||(T[10]=a("span",null,"可用存储",-1)),a("strong",null,k(O(A.value.storageAvailableGB))+" / "+k(O(A.value.storageTotalGB))+" GB",1)])]),a("p",Rh,[C(k(A.value.model||n.device.model)+" · Android "+k(A.value.osVersion||"—")+" · IP "+k(A.value.ip||n.device.managementHost||"—"),1),T[11]||(T[11]=a("br",null,null,-1)),C(k(A.value.screenWidth||"—")+" × "+k(A.value.screenHeight||"—")+" · "+k(A.value.foreground?"看板在前台":"看板未在前台")+" · "+k(A.value.screenOn?"屏幕亮":"屏幕状态待确认"),1),(ae=s.value)!=null&&ae.online?D("",!0):(v(),x("span",Lh," · 当前数值为最后一次上报"))]),T[22]||(T[22]=a("h4",{class:"fs-6"},"异常与报警",-1)),(fe=(_=s.value)==null?void 0:_.alerts)!=null&&fe.some(te=>!te.cleared)?D("",!0):(v(),x("p",Ph,k((rt=s.value)!=null&&rt.online?"当前无活动报警":"连接恢复后继续检查硬件状态"),1)),(v(!0),x(H,null,J((F=(vt=s.value)==null?void 0:vt.alerts)==null?void 0:F.filter(te=>!te.cleared),te=>(v(),x("div",{key:te.code,class:De(["alert py-2 small",te.severity==="critical"?"alert-danger":"alert-warning"])},k(te.message)+" · "+k(B(te.opened)),3))),128)),a("details",Bh,[T[12]||(T[12]=a("summary",null,"报警记录与规则",-1)),T[13]||(T[13]=a("p",null,"心跳中断超过 100 秒;处理器 ≥75°C 提醒、≥85°C 严重;可用内存低于 5%;可用存储低于 0.5 GB;看板退出前台。数值来自显示终端上报。",-1)),(v(!0),x(H,null,J((jt=s.value)==null?void 0:jt.alerts,(te,ws)=>(v(),x("div",{key:ws},k(te.cleared?"已恢复":"处理中")+" · "+k(te.message)+" · "+k(B(te.opened)),1))),128))]),a("button",{class:"btn btn-primary btn-sm",disabled:o.value||!((xs=s.value)!=null&&xs.online),onClick:T[1]||(T[1]=te=>M("preview"))},"查看模拟屏 · 60 秒",8,_h),T[23]||(T[23]=a("p",{class:"small text-secondary mt-2"},"显示显示终端当前家庭看板的应用画面,约 20 秒更新一次;退出看板后不显示其他应用。预览仅短时保存在内存。",-1)),c.value?(v(),x("figure",zh,[a("img",{src:c.value,alt:"显示终端家庭看板的真实应用画面"},null,8,jh),a("figcaption",Fh,"画面时间:"+k(B((Ft=s.value)==null?void 0:Ft.previewAt)),1)])):D("",!0),a("details",Vh,[T[18]||(T[18]=a("summary",null,"展示授权与天气设置",-1)),a("div",Hh,[a("label",qh,[T[14]||(T[14]=C("天气城市",-1)),Y(a("input",{"onUpdate:modelValue":T[2]||(T[2]=te=>g.value=te),class:"form-control",maxlength:"60"},null,512),[[At,g.value]])]),a("label",Uh,[T[15]||(T[15]=C("纬度",-1)),Y(a("input",{"onUpdate:modelValue":T[3]||(T[3]=te=>b.value=te),class:"form-control",type:"number",step:"0.0001",min:"-90",max:"90"},null,512),[[At,b.value]])]),a("label",Wh,[T[16]||(T[16]=C("经度",-1)),Y(a("input",{"onUpdate:modelValue":T[4]||(T[4]=te=>m.value=te),class:"form-control",type:"number",step:"0.0001",min:"-180",max:"180"},null,512),[[At,m.value]])])]),T[19]||(T[19]=a("p",{class:"small text-secondary"},"链接有效期一年,仅可展示本家庭概况、设备状态与本人同意共享的家人位置。重新生成会停用旧链接。",-1)),a("button",{class:"btn btn-outline-primary btn-sm",disabled:o.value,onClick:T[5]||(T[5]=te=>M("create"))},"生成 App 配对码",8,Kh),l.value?(v(),x("div",Jh,[a("label",null,[T[17]||(T[17]=C("本次展示链接(请仅交给这台显示终端)",-1)),a("input",{class:"form-control",value:l.value,readonly:"",onFocus:T[6]||(T[6]=te=>te.target.select())},null,40,Gh)]),a("a",{class:"btn btn-sm btn-outline-secondary mt-2",href:l.value,target:"_blank",rel:"noreferrer"},"打开看板",8,Yh)])):D("",!0),(v(!0),x(H,null,J(i.value.filter(te=>!te.revoked),te=>(v(),x("div",{key:te.id,class:"d-flex gap-2 align-items-center small mt-2"},[a("span",null,"授权至 "+k(B(te.expires_at)),1),a("button",{class:"btn btn-sm btn-outline-danger",disabled:o.value,onClick:ws=>M("revoke",te.id)},"停用展示权限",8,Xh)]))),128))]),y.value&&l.value?(v(),x("div",Zh,[T[20]||(T[20]=C("App 配对码:",-1)),a("strong",Qh,k(y.value),1),T[21]||(T[21]=a("div",{class:"small"},"在“赵府家庭屏”App 输入,10 分钟内有效,使用一次即失效。App 摄像头画面在本地网络直接播放。",-1))])):D("",!0),(cn=s.value)!=null&&cn.paired?(v(),Qe(Ch,{key:n.device.id,"device-id":n.device.id},null,8,["device-id"])):D("",!0),r.value?(v(),x("p",em,k(r.value),1)):D("",!0)])):D("",!0)])):D("",!0)}}},$a=hs(tm,[["__scopeId","data-v-2d075cdb"]]),nm={key:0,class:"mt-3"},sm={key:0,class:"border rounded p-3 mt-2"},im={class:"w-100"},rm=["value"],om={class:"d-flex gap-2 small mb-2"},lm=["disabled"],am={key:1,class:"small mt-2",role:"status"},Ra={__name:"DeviceTransfer",props:{device:Object},setup(n){const e=n,t=P(!1),s=P(""),i=P(!1),r=P(!1),o=P(""),l=ee(()=>(R.value.state.households||[]).filter(d=>d.id!==R.value.state.familyId));Ae(()=>R.value.state.familyId,()=>{t.value=!1,s.value="",i.value=!1,o.value=""});async function c(){if(!(!i.value||!s.value)){r.value=!0,o.value="";try{await K().api("/api/devices/transfer",{source:e.device.source,id:e.device.id,targetFamilyId:s.value}),K().notify("设备已转移,电视需在新家庭重新授权。"),t.value=!1,await K().refresh()}catch(d){o.value=d.message}finally{r.value=!1}}}return(d,u)=>{var p;return((p=j(R).user)==null?void 0:p.role)==="admin"?(v(),x("div",nm,[a("button",{class:"btn btn-sm btn-outline-secondary",onClick:u[0]||(u[0]=f=>t.value=!t.value)},"转移到其他家庭"),t.value?(v(),x("div",sm,[a("label",im,[u[4]||(u[4]=C("目标家庭 / 公司 / 工厂",-1)),Y(a("select",{"onUpdate:modelValue":u[1]||(u[1]=f=>s.value=f),class:"form-select mt-2"},[u[3]||(u[3]=a("option",{value:""},"请选择",-1)),(v(!0),x(H,null,J(l.value,f=>(v(),x("option",{key:f.id,value:f.id},k(f.name),9,rm))),128))],512),[[Te,s.value]])]),u[6]||(u[6]=a("p",{class:"small text-secondary mt-2"},"保留设备编号与基本档案。所属区域、负责人和上级设备需重新设置;电视旧展示授权会停用。关联录像机的摄像头需先解除关联。",-1)),a("label",om,[Y(a("input",{"onUpdate:modelValue":u[2]||(u[2]=f=>i.value=f),type:"checkbox"},null,512),[[st,i.value]]),u[5]||(u[5]=C("确认将这台设备转移给目标家庭管理",-1))]),a("button",{class:"btn btn-primary btn-sm",disabled:r.value||!i.value||!s.value,onClick:c},"确认转移",8,lm)])):D("",!0),o.value?(v(),x("p",am,k(o.value),1)):D("",!0)])):D("",!0)}}},cm={id:"asset-list"},dm={class:"group-title"},um={class:"count-pill"},pm={class:"device-card-grid"},fm={class:"card-body"},hm={class:"device-card-heading"},mm={class:"device-symbol"},gm={class:"flex-grow-1"},bm={class:"small text-secondary"},ym=["onClick"],vm={class:"device-location"},km={class:"compact-details"},xm={class:"font-monospace"},wm={key:0},Sm={key:0,class:"device-tags"},Cm={class:"card-footer device-card-actions"},Mm=["onClick"],Tm=["onClick"],Em=["onClick"],Am={key:0,class:"empty"},Om={__name:"DeviceCollection",setup(n){const e=i=>(R.value.state.cameras||[]).filter(r=>i.source==="camera"?r.assetId===i.id:r.recorderId===i.id||r.archiveRecorderId===i.id),t=i=>({["data-"+(i.source==="camera"?"edit-asset":i.source==="recorder"?"edit-recorder":"edit-device")]:i.id}),s=i=>/路由|网关|服务器/.test(i.deviceType)||/gl\.inet/i.test(i.brand||"");return(i,r)=>(v(),x("div",cm,[(v(!0),x(H,null,J(j(ze).groups,o=>(v(),x("section",{key:o.key,class:"device-group"},[a("h3",dm,[C(k(o.labels.join(" / ")||"全部设备")+" ",1),a("span",um,k(o.items.length),1)]),a("div",pm,[(v(!0),x(H,null,J(o.items,l=>{var c,d,u;return v(),x("article",{key:l.source+l.id,class:"card device-card"},[a("div",fm,[a("div",hm,[a("div",mm,[G(be,{name:l.source==="camera"?"camera":s(l)?"router":"devices"},null,8,["name"])]),a("div",gm,[a("span",bm,k(l.deviceType),1),a("h3",null,[a("button",{class:"device-title",onClick:p=>j(K)().enterDevice(l.source,l.id)},k(l.name),9,ym)])]),j(R).admin?(v(),x("button",Iu({key:0,class:"btn btn-sm btn-outline-secondary"},{ref_for:!0},t(l))," 编辑 ",16)):D("",!0)]),a("p",vm,[C(k(((d=(c=j(K)()).location)==null?void 0:d.call(c,l.siteId))||"区域待填写"),1),l.point?(v(),x(H,{key:0},[C(" · "+k(l.point),1)],64)):D("",!0)]),a("dl",km,[a("div",null,[r[0]||(r[0]=a("dt",null,"品牌型号",-1)),a("dd",null,k([l.brand,l.model].filter(Boolean).join(" / ")||"未填写"),1)]),a("div",null,[r[1]||(r[1]=a("dt",null,"设备地址",-1)),a("dd",xm,k(l.networkHosts.join(" / ")||"未填写"),1)]),a("div",null,[r[2]||(r[2]=a("dt",null,"网络",-1)),a("dd",null,k(j(Zr)(l.networkAccess)),1)]),a("div",null,[r[3]||(r[3]=a("dt",null,"所有人 / 负责人",-1)),a("dd",null,k(l.ownerName||"待指定")+" / "+k(l.managerName||"待指定"),1)]),l.source!=="device"?(v(),x("div",wm,[r[4]||(r[4]=a("dt",null,"镜头通道",-1)),a("dd",null,k(e(l).length)+" 个已配置",1)])):D("",!0)]),(u=l.tags)!=null&&u.length?(v(),x("div",Sm,[(v(!0),x(H,null,J(l.tags,p=>(v(),x("span",{key:p},k(p),1))),128))])):D("",!0),s(l)?(v(),Qe(Qr,{key:1,device:l,active:j(R).page==="objects"&&j(ze).mode==="cards"},null,8,["device","active"])):D("",!0),l.source==="device"&&/电视|显示|大屏/.test(l.deviceType)?(v(),Qe($a,{key:2,device:l},null,8,["device"])):D("",!0),G(Ra,{device:l},null,8,["device"])]),a("div",Cm,[a("button",{class:"btn btn-sm btn-outline-secondary",onClick:p=>j(K)().enterDevice(l.source,l.id,"device")}," 设备详情",8,Mm),l.source!=="device"?(v(),x(H,{key:0},[j(R).admin?(v(),x("button",{key:0,class:"btn btn-sm btn-outline-secondary",onClick:p=>j(K)().enterDevice(l.source,l.id,"cameras")}," 配置镜头",8,Tm)):D("",!0),e(l).length?(v(),x("button",{key:1,class:"btn btn-sm btn-primary",onClick:p=>j(K)().enterDevice(l.source,l.id,"live")}," 实时画面 ",8,Em)):D("",!0)],64)):D("",!0)])])}),128))])]))),128)),j(ze).devices.length?D("",!0):(v(),x("div",Am,[G(be,{name:"devices"}),r[5]||(r[5]=a("h3",null,"当前范围没有设备",-1)),r[6]||(r[6]=a("p",null,"调整筛选条件,或添加摄像机、路由器、灯等设备。",-1))]))]))}},Nm={key:0,class:"network-diagram"},Im={class:"diagram-toolbar"},Dm={class:"small text-secondary"},$m={class:"chart-network-surface"},Rm={__name:"NetworkDiagram",setup(n){const e=P(0),t=ee(()=>op(ze.value.rows,K().location)),s=ee(()=>R.value.loggedIn&&R.value.page==="objects"&&ze.value.mode==="topology");Ae(()=>R.value.session+":"+R.value.state.familyId,()=>e.value++);function i(r){const o=ze.value.rows.find(l=>l.device.id===r);o&&K().enterDevice(o.device.source,r,"device")}return(r,o)=>j(ze).rows.length?(v(),x("div",Nm,[a("div",Im,[a("div",null,[o[1]||(o[1]=a("span",{class:"diagram-dot"},null,-1)),o[2]||(o[2]=a("strong",null,"设备连接图",-1)),a("span",Dm,k(j(ze).rows.length)+" 台设备 · "+k(t.value.series[0].links.length)+" 条已登记连接",1)]),a("button",{class:"btn btn-sm btn-outline-secondary",onClick:o[0]||(o[0]=l=>e.value++)},"重置视图")]),a("div",$m,[(v(),Qe(wn,{key:e.value,option:t.value,active:s.value,height:400,label:"已登记设备连接图,可拖动缩放;下方设备详情提供相同信息及操作。",onSelect:i},null,8,["option","active"]))]),o[3]||(o[3]=a("p",{class:"diagram-note"},"拖动平移、滚轮或双指缩放;点击节点打开档案。未登记上级的设备独立显示;接入方式不代表在线状态。",-1))])):D("",!0)}},Lm={id:"device-topology",hidden:""},Pm={class:"panel network-map"},Bm={class:"network-platform"},_m={class:"topology-nodes"},zm={class:"card-body"},jm={class:"device-card-heading"},Fm={class:"flex-grow-1"},Vm={class:"small text-secondary"},Hm=["onClick"],qm=["onClick"],Um={class:"device-location"},Wm={class:"network-facts"},Km={key:0},Jm={key:1},Gm={key:2},Ym={key:3},Xm={key:0,class:"empty"},Zm={__name:"NetworkMap",setup(n){const e=ee(()=>(R.value.state.households||[]).find(t=>t.id===R.value.state.familyId));return(t,s)=>{var i;return v(),x("div",Lm,[a("section",Pm,[a("div",Bm,[G(be,{name:"network"}),a("div",null,[a("h3",null,k(((i=e.value)==null?void 0:i.name)||"当前场所"),1),a("p",null,k(j(ze).devices.length)+" 台设备 · 随设备档案自动更新",1)])]),s[7]||(s[7]=a("p",{class:"description"}," 连线来自已确认的上级设备关系。上级未填写时单独列出;不代表已自动发现所有交换机或布线。 ",-1)),G(Rm),s[8]||(s[8]=a("h3",{class:"network-details-heading"},"设备与连接详情",-1)),a("div",_m,[(v(!0),x(H,null,J(j(ze).rows,r=>{var o,l;return v(),x("article",{key:r.device.id,class:De(["network-node card",{nested:r.depth>0}]),style:Nn({"--depth":Math.min(r.depth,5)})},[a("div",zm,[a("div",jm,[G(be,{name:r.device.source==="camera"?"camera":"router"},null,8,["name"]),a("div",Fm,[a("span",Vm,k(r.device.deviceType)+" · "+k(j(Zr)(r.device.networkAccess)),1),a("h3",null,[a("button",{class:"device-title",onClick:c=>j(K)().enterDevice(r.device.source,r.device.id)},k(r.device.name),9,Hm)])]),a("button",{class:"btn btn-sm btn-outline-secondary",onClick:c=>j(K)().enterDevice(r.device.source,r.device.id,"device")}," 详情 → ",8,qm)]),a("p",Um,[C(k(((l=(o=j(K)()).location)==null?void 0:l.call(o,r.device.siteId))||"未指定区域")+" ",1),r.device.point?(v(),x(H,{key:0},[C(" · "+k(r.device.point),1)],64)):D("",!0)]),a("div",Wm,[a("span",null,[s[0]||(s[0]=C("IP ",-1)),a("b",null,k(r.device.networkHosts.join(" / ")||"待填写"),1)]),r.device.tailscaleHost?(v(),x("span",Km,[s[1]||(s[1]=C("Tailscale ",-1)),a("b",null,k(r.device.tailscaleHost),1)])):D("",!0),r.device.networkCidr?(v(),x("span",Jm,[s[2]||(s[2]=C("网段 ",-1)),a("b",null,k(r.device.networkCidr),1)])):D("",!0),a("span",null,[s[3]||(s[3]=C("上级 ",-1)),a("b",null,k(r.parentName||"待确认 / 直接接入"),1)]),a("span",null,[s[4]||(s[4]=C("连接 ",-1)),a("b",null,k({wired:"网线",wifi:"Wi-Fi"}[r.device.connectionType]||"待确认"),1)]),r.via.length?(v(),x("span",Gm,[s[5]||(s[5]=C("取流经录像机 ",-1)),a("b",null,k(r.via.join("、")),1)])):D("",!0),r.archiveVia.length?(v(),x("span",Ym,[s[6]||(s[6]=C("录像归档 ",-1)),a("b",null,k(r.archiveVia.join("、")),1)])):D("",!0)]),/路由|网关|服务器/.test(r.device.deviceType)?(v(),Qe(Qr,{key:0,device:r.device,active:j(R).page==="objects"&&j(ze).mode==="topology"},null,8,["device","active"])):D("",!0)])],6)}),128)),j(ze).rows.length?D("",!0):(v(),x("p",Xm," 当前范围尚未登记设备。 "))])])])}}},Qm={key:0,class:"panel"},eg={__name:"DeviceNetworkPanel",setup(n){return(e,t)=>j(R).admin&&j(R).device&&j(R).page==="device"?(v(),x("section",Qm,[t[0]||(t[0]=a("h3",null,"网络状态与管理入口",-1)),j(R).device.source==="device"&&/电视|显示|大屏/.test(j(R).device.deviceType)?(v(),Qe($a,{key:0,device:j(R).device},null,8,["device"])):(v(),Qe(Qr,{key:1,device:j(R).device},null,8,["device"])),G(Ra,{device:j(R).device},null,8,["device"])])):D("",!0)}},tg={key:0,class:"row g-3 mb-4","aria-label":"当前场所设备统计"},ng={class:"col-12 col-lg-7"},sg={class:"chart-card h-100"},ig={class:"chart-heading"},rg={class:"small text-secondary"},og={class:"chart-data"},lg={class:"col-12 col-lg-5"},ag={class:"chart-card h-100"},cg={class:"chart-legend"},dg={__name:"ScopeInsights",setup(n){const e=ee(()=>rp(R.value.state)),t=ee(()=>R.value.loggedIn&&R.value.page==="objects");return(s,i)=>t.value&&e.value.total?(v(),x("section",tg,[a("div",ng,[a("article",sg,[a("div",ig,[i[0]||(i[0]=a("h3",null,"设备类型",-1)),a("span",rg,k(e.value.total)+" 台已授权设备",1)]),G(wn,{option:j(Ia)(e.value.types.slice(0,8)),height:220,label:"设备类型:"+e.value.types.map(r=>r.label+r.count+"台").join(",")},null,8,["option","label"]),a("details",og,[i[1]||(i[1]=a("summary",null,"查看全部类型",-1)),a("ul",null,[(v(!0),x(H,null,J(e.value.types,r=>(v(),x("li",{key:r.label},k(r.label)+":"+k(r.count)+" 台",1))),128))])])])]),a("div",lg,[a("article",ag,[i[2]||(i[2]=a("div",{class:"chart-heading"},[a("h3",null,"网络接入"),a("span",{class:"small text-secondary"},"来自设备档案")],-1)),G(wn,{option:j(Na)(e.value.networks),height:190,label:"登记的网络接入方式:"+e.value.networks.map(r=>r.label+r.count+"台").join(",")},null,8,["option","label"]),a("div",cg,[(v(!0),x(H,null,J(e.value.networks,(r,o)=>(v(),x("span",{key:r.label},[a("i",{style:Nn({background:j(ts)[o]})},null,4),C(k(r.label)+" ",1),a("b",null,k(r.count),1)]))),128))]),i[3]||(i[3]=a("p",{class:"small text-secondary mt-2 mb-0"},"接入方式不代表设备在线状态。",-1))])])])):D("",!0)}},ug={class:"border-top mt-3 pt-3"},pg={class:"col-sm-3"},fg=["value"],hg={class:"col-sm-2"},mg={key:0,class:"col-sm-3"},gg={key:1,class:"col-sm-3"},bg={class:"col-sm-3 align-self-end"},yg=["disabled"],vg={role:"status"},kg=["disabled"],xg={__name:"LocationHistory",props:{members:{type:Array,default:()=>[]}},setup(n){const e=P(""),t=P(new Intl.DateTimeFormat("sv-SE",{timeZone:"Asia/Shanghai"}).format(new Date)),s=P(t.value),i=P("day"),r=P([]),o=P(""),l=P(!1),c=P(null);let d=0,u;function p(){d++,r.value=[],o.value="",l.value=!1,c.value=null,clearTimeout(u)}Ae([e,t,s,i,()=>R.value.state.familyId,()=>R.value.page,()=>R.value.session],p);async function f(g=!1){const b=g?c.value:0;g||p();const m=d;l.value=!0,o.value="正在从网盘读取…";try{const y=await K().api("/api/location-history?"+new URLSearchParams({memberId:e.value,date:t.value,until:s.value,period:i.value,cursor:b}));if(m===d){const S=[...r.value,...y.points];let O=[...new Map(S.map(B=>[B.at,B])).values()].sort((B,E)=>B.at-E.at);O.length>1e4&&(O=Array.from({length:1e4},(B,E)=>O[Math.round(E*(O.length-1)/9999)])),r.value=O,c.value=y.nextCursor,o.value=`已读取 ${y.loadedFiles} / ${y.totalFiles} 段归档 · 显示 ${O.length} 个采样点${y.nextCursor!==null?",点击继续加载读取其余记录":",本时段已读取完毕"}`,clearTimeout(u),u=setTimeout(p,6e4)}}catch(y){m===d&&(r.value=[],c.value=null,o.value=y.message)}finally{m===d&&(l.value=!1)}}function h(){document.hidden&&p()}return document.addEventListener("visibilitychange",h),Bt(()=>{p(),document.removeEventListener("visibilitychange",h)}),(g,b)=>(v(),x("details",ug,[b[11]||(b[11]=a("summary",null,"历史轨迹 · 每天到一生",-1)),b[12]||(b[12]=a("p",{class:"small text-secondary mt-2"},"仅记录本人同意保存的轨迹,长期保留至本人删除。关闭共享后他人不能读取;新查看人不自动获得过去记录。长时段分批从网盘读取,概览抽样展示,原始定位点仍保留。连线不是实际道路路线。画面 1 分钟后清除,需要时重新读取。",-1)),a("form",{class:"row g-2 my-2",onSubmit:b[4]||(b[4]=Ve(m=>f(!1),["prevent"]))},[a("label",pg,[b[7]||(b[7]=C("家人",-1)),Y(a("select",{"onUpdate:modelValue":b[0]||(b[0]=m=>e.value=m),required:"",class:"form-select"},[b[6]||(b[6]=a("option",{value:""},"请选择",-1)),(v(!0),x(H,null,J(n.members,m=>(v(),x("option",{key:m.id,value:m.id},k(m.name),9,fg))),128))],512),[[Te,e.value]])]),a("label",hg,[b[9]||(b[9]=C("时段",-1)),Y(a("select",{"onUpdate:modelValue":b[1]||(b[1]=m=>i.value=m),class:"form-select"},[...b[8]||(b[8]=[ge('',6)])],512),[[Te,i.value]])]),i.value!=="life"?(v(),x("label",mg,[C(k(i.value==="custom"?"开始日期":"选择该时段内的日期"),1),Y(a("input",{type:"date","onUpdate:modelValue":b[2]||(b[2]=m=>t.value=m),required:"",class:"form-control"},null,512),[[At,t.value]])])):D("",!0),i.value==="custom"?(v(),x("label",gg,[b[10]||(b[10]=C("结束日期",-1)),Y(a("input",{type:"date","onUpdate:modelValue":b[3]||(b[3]=m=>s.value=m),required:"",class:"form-control"},null,512),[[At,s.value]])])):D("",!0),a("div",bg,[a("button",{class:"btn btn-primary",disabled:l.value},k(l.value?"读取中":"查看轨迹"),9,yg)])],32),r.value.length?(v(),Qe(Oa,{key:0,track:r.value,height:420},null,8,["track"])):D("",!0),a("p",vg,k(o.value),1),c.value!==null?(v(),x("button",{key:1,class:"btn btn-outline-primary",disabled:l.value,onClick:b[5]||(b[5]=m=>f(!0))},"继续加载",8,kg)):D("",!0)]))}},wg={key:0,class:"panel family-locations mb-4","aria-label":"家庭位置共享"},Sg={class:"d-flex flex-wrap justify-content-between gap-2"},Cg={class:"text-secondary small"},Mg={key:0,class:"alert alert-warning",role:"status"},Tg={class:"row g-3"},Eg={class:"col-12 col-lg-8"},Ag={class:"col-12 col-lg-4"},Og={key:0,class:"location-empty"},Ng=["onClick"],Ig={key:0},Dg={class:"mt-3 border-top pt-3"},$g={key:0,class:"alert alert-info"},Rg={class:"row g-3"},Lg={class:"col-sm-8"},Pg=["disabled"],Bg=["value","disabled"],_g={class:"col-sm-4"},zg=["disabled"],jg={class:"d-flex gap-2 mt-3"},Fg=["disabled"],Vg={key:0,class:"mt-3"},Hg=["value","disabled"],qg={key:1,class:"mt-3"},Ug=["value","disabled"],Wg={key:2,class:"mt-3"},Kg={key:0,class:"small text-secondary"},Jg=["value","disabled"],Gg={key:3},Yg={class:"d-flex flex-wrap gap-2 mt-3"},Xg=["disabled"],Zg=["disabled"],Qg={key:4,class:"alert alert-success mt-3",role:"status"},eb={class:"font-monospace fs-3"},tb={key:1,class:"text-danger mt-2",role:"alert"},nb={__name:"FamilyLocations",setup(n){const e=P(null),t=P(""),s=P(!1),i=P(7),r=P(""),o=P(0),l=P(!1),c=P(""),d=P(""),u=P([]),p=P([]),f=P([]),h=P(!0),g=ee(()=>{var N,I;return(I=(N=e.value)==null?void 0:N.bindings)==null?void 0:I.find(Z=>Z.memberId===d.value)}),b=ee(()=>R.value.loggedIn&&R.value.page==="overview"),m=ee(()=>{var N;return(N=R.value.state.households)==null?void 0:N.find(I=>I.id===R.value.state.familyId)});let y,S=0,A=0;const O=ee(()=>{var N;return((N=e.value)==null?void 0:N.items)||[]}),B=N=>N?new Date(N*1e3).toLocaleString("zh-CN"):"尚未收到",E=N=>N.status==="stale"?"位置更新中断":N.status==="live"?"位置已更新":"等待手机定位",M=N=>N.position?`${N.position.latitude.toFixed(4)}°, ${N.position.longitude.toFixed(4)}° · 精度约 ${Math.round(N.position.accuracy)} 米`:"尚无有效位置";async function w(){const N=S,I=++A;if(b.value)try{const Z=await K().api("/api/locations");N===S&&I===A&&(e.value=Z,t.value="")}catch(Z){N===S&&I===A&&(e.value=null,t.value=Z.message)}finally{N===S&&I===A&&b.value&&(y=setTimeout(w,3e4))}}async function T(N){if(l.value)return;l.value=!0,t.value="";const I=S;A++,clearTimeout(y);try{const Z=await K().api("/api/locations",{action:N,memberId:d.value,viewerIds:u.value,displayIds:p.value,phoneIds:f.value,viewOnly:h.value,days:i.value});if(I!==S)return;r.value=Z.code||"",o.value=Z.expires||0,N==="stop"&&(s.value=!1),clearTimeout(y),await w()}catch(Z){I===S&&(t.value=Z.message)}finally{I===S&&(l.value=!1,clearTimeout(y),b.value&&(y=setTimeout(w,3e4)))}}return Ae([b,()=>R.value.state.familyId,()=>R.value.session],()=>{S++,clearTimeout(y),e.value=null,r.value="",d.value="",u.value=[],p.value=[],f.value=[],h.value=!0,c.value="",s.value=!1,l.value=!1,b.value&&w()},{immediate:!0}),Ae([d,u,p,f,h,i],()=>{r.value=""},{deep:!0}),Bt(()=>{S++,clearTimeout(y)}),(N,I)=>{var Z,Oe,le,ae;return b.value?(v(),x("section",wg,[a("div",Sg,[a("div",null,[I[10]||(I[10]=a("h2",null,"家人位置",-1)),a("p",Cg,k((Z=m.value)==null?void 0:Z.name)+" · "+k(O.value.length)+" 位家人正在共享 · 只显示本人同意分享的最新位置",1)]),a("button",{class:"btn btn-sm btn-outline-secondary align-self-start",onClick:I[0]||(I[0]=_=>c.value="")},"查看全部位置")]),O.value.some(_=>_.status==="stale")?(v(),x("div",Mg,k(O.value.filter(_=>_.status==="stale").map(_=>_.name).join("、"))+"的位置超过 15 分钟未更新。请检查手机网络、定位权限或省电设置;这不代表人员失联。",1)):D("",!0),a("div",Tg,[a("div",Eg,[G(Oa,{items:O.value,selected:c.value,height:420,onSelect:I[1]||(I[1]=_=>c.value=_)},null,8,["items","selected"]),I[11]||(I[11]=a("p",{class:"small text-secondary mb-0"},"点击家人卡片定位,圆圈表示定位精度范围。底图由智家提供,位置仅对获授权的人显示。",-1))]),a("div",Ag,[O.value.length?D("",!0):(v(),x("div",Og,[...I[12]||(I[12]=[a("span",null,"⌖",-1),a("h3",{class:"fs-5"},"等待家人主动分享",-1),a("p",null,"家人无需注册账号。手机配对、本人同意并开启共享后,获准的查看人才能看到位置。",-1)])])),(v(!0),x(H,null,J(O.value,_=>{var fe;return v(),x("button",{key:_.id,class:De(["location-person w-100 text-start",{"location-selected":c.value===_.id}]),onClick:rt=>c.value=_.id},[a("strong",null,k(_.name),1),a("span",{class:De(_.status==="stale"?"text-warning-emphasis":"text-success")},k(E(_)),3),a("small",null,k(M(_)),1),a("small",null,"定位时间:"+k(B((fe=_.position)==null?void 0:fe.at)),1),_.signal==="permission_denied"||_.signal==="location_disabled"?(v(),x("small",Ig,"手机定位或权限未开启")):D("",!0)],10,Ng)}),128))])]),G(xg,{members:[...O.value,...(((Oe=e.value)==null?void 0:Oe.members)||[]).filter(_=>!O.value.some(fe=>fe.id===_.id))]},null,8,["members"]),a("details",Dg,[I[25]||(I[25]=a("summary",null,"为家庭成员配对手机",-1)),I[26]||(I[26]=a("p",{class:"small text-secondary mt-2"},"老人和孩子无需登录。先选择真实成员及具体查看人,再将配对码输入本人的手机。本人核对授权内容、允许定位并打开共享后才上传;管理员生成配对码不能代替本人同意。家庭屏需单独勾选。",-1)),(ae=(le=e.value)==null?void 0:le.members)!=null&&ae.length?(v(),x("form",{key:1,onSubmit:I[9]||(I[9]=Ve(_=>T("pair"),["prevent"]))},[a("div",Rg,[a("label",Lg,[I[14]||(I[14]=C("绑定的家庭成员",-1)),Y(a("select",{"onUpdate:modelValue":I[2]||(I[2]=_=>d.value=_),required:"",class:"form-select",disabled:l.value},[I[13]||(I[13]=a("option",{value:""},"请选择成员",-1)),(v(!0),x(H,null,J(e.value.members,_=>(v(),x("option",{key:_.id,value:_.id,disabled:_.status==="historical"||_.lifeStatus==="deceased"},k(_.name)+" "+k(_.label?`· ${_.label}`:""),9,Bg))),128))],8,Pg),[[Te,d.value]])]),a("label",_g,[I[16]||(I[16]=C("手机配对有效期",-1)),Y(a("select",{"onUpdate:modelValue":I[3]||(I[3]=_=>i.value=_),class:"form-select",disabled:l.value},[...I[15]||(I[15]=[a("option",{value:1},"1 天",-1),a("option",{value:7},"7 天",-1),a("option",{value:30},"30 天",-1)])],8,zg),[[Te,i.value,void 0,{number:!0}]])])]),a("label",jg,[Y(a("input",{type:"checkbox","onUpdate:modelValue":I[4]||(I[4]=_=>h.value=_),disabled:l.value},null,8,Fg),[[st,h.value]]),I[17]||(I[17]=C("先仅配对手机查看家人,本人可稍后在手机设置自己的共享",-1))]),h.value?D("",!0):(v(),x("fieldset",Vg,[I[18]||(I[18]=a("legend",{class:"fs-6"},"允许哪些账号查看",-1)),(v(!0),x(H,null,J(e.value.viewers,_=>(v(),x("label",{key:_.id,class:"d-inline-flex gap-2 me-4 mb-2"},[Y(a("input",{type:"checkbox","onUpdate:modelValue":I[5]||(I[5]=fe=>u.value=fe),value:_.id,disabled:l.value},null,8,Hg),[[st,u.value]]),C(k(_.name)+"("+k(_.username)+")",1)]))),128))])),h.value?D("",!0):(v(),x("fieldset",qg,[I[19]||(I[19]=a("legend",{class:"fs-6"},"允许哪些家人手机查看",-1)),(v(!0),x(H,null,J(e.value.phones||[],_=>(v(),x("label",{key:_.id,class:"d-inline-flex gap-2 me-4 mb-2"},[Y(a("input",{type:"checkbox","onUpdate:modelValue":I[6]||(I[6]=fe=>f.value=fe),value:_.id,disabled:l.value},null,8,Ug),[[st,f.value]]),C(k(_.name)+"的手机",1)]))),128))])),h.value?D("",!0):(v(),x("fieldset",Wg,[I[20]||(I[20]=a("legend",{class:"fs-6"},"允许哪些公共显示终端展示(默认不选)",-1)),e.value.displays.length?D("",!0):(v(),x("p",Kg,"尚无已配对显示终端。")),(v(!0),x(H,null,J(e.value.displays,_=>(v(),x("label",{key:_.id,class:"d-inline-flex gap-2 me-4 mb-2"},[Y(a("input",{type:"checkbox","onUpdate:modelValue":I[7]||(I[7]=fe=>p.value=fe),value:_.id,disabled:l.value},null,8,Jg),[[st,p.value]]),C(k(_.name),1)]))),128))])),g.value?(v(),x("p",Gg,k(g.value.enabled?"手机已开启共享":"手机已绑定,共享关闭")+" · "+k(B(g.value.expires))+" 到期",1)):D("",!0),a("div",Yg,[a("button",{class:"btn btn-primary",disabled:l.value||!d.value||!h.value&&!u.value.length&&!p.value.length&&!f.value.length},"生成配对码",8,Xg),g.value||r.value?(v(),x("button",{key:0,type:"button",class:"btn btn-outline-danger",disabled:l.value,onClick:I[8]||(I[8]=_=>T("stop"))},"解除该手机授权",8,Zg)):D("",!0),I[21]||(I[21]=a("a",{class:"btn btn-outline-secondary",href:"/downloads",target:"_blank",rel:"noreferrer"},"下载配套 App",-1))]),r.value?(v(),x("div",Qg,[I[22]||(I[22]=C("配对码 ",-1)),a("strong",eb,k(r.value),1),I[23]||(I[23]=C(" · 10 分钟内使用一次",-1)),I[24]||(I[24]=a("br",null,null,-1)),C("请在成员本人的手机核对姓名与查看名单,手机授权有效至 "+k(B(o.value))+"。重新配对会替换旧手机授权。",1)])):D("",!0)],32)):(v(),x("p",$g,"请先在“家庭成员”登记本人或家人;普通账号需关联本人档案。")),I[27]||(I[27]=a("p",{class:"small text-secondary mt-3"},"手机可在“我的位置设置”选择实时(约 10 秒)、1 分钟或 5 分钟上传,默认 5 分钟。实时位置仅在内存中保存,关闭共享后清除;本人可另行开启历史保存,长期归档到百度网盘并手动删除。定位或网络中断超过 15 分钟隐藏旧坐标,提示更新中断,不表示人员失联。",-1))]),t.value?(v(),x("p",tb,k(t.value),1)):D("",!0)])):D("",!0)}}},sb=hs(nb,[["__scopeId","data-v-f94289e2"]]);function Vt(n=0){const e=Math.max(0,Number(n)||0);return e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(1)+" MB":e>=1e3?(e/1e3).toFixed(1)+" KB":e+" B"}function ib(n,e={}){return n.id===e.id?{preparing:"准备上传",uploading:"正在上传",verifying:"云端校验",cleaning:"清理本机"}[e.stage]||"处理中":n.state==="cloud"?n.releasedAt?"已上传 · 本机已清理":"已存网盘":n.state==="expired"?"云端已到期清理":n.error?"等待重试":n.state==="verified"?"待清理本机":"排队中"}function rb(n,e){return new URLSearchParams({state:n.state,family:n.family,camera:n.camera,page:String(e)}).toString()}const ob={key:0,class:"panel upload-tasks mb-4","aria-label":"上传任务"},lb={class:"row g-3 mb-3"},ab={class:"col-6 col-xl-3"},cb={class:"upload-metric"},db={class:"col-6 col-xl-3"},ub={class:"upload-metric freed"},pb={class:"col-6 col-xl-3"},fb={class:"upload-metric"},hb={class:"col-6 col-xl-3"},mb={class:"upload-metric"},gb={key:0,class:"upload-current mb-3",role:"status"},bb={class:"d-flex justify-content-between gap-2"},yb={key:0},vb={class:"small my-2"},kb=["aria-label","aria-valuenow"],xb={key:1,class:"alert alert-warning"},wb={class:"my-2"},Sb={class:"d-flex flex-wrap align-items-center gap-2"},Cb={class:"small"},Mb=["disabled"],Tb={key:2,class:"small",role:"status"},Eb={key:3,class:"alert alert-danger",role:"alert"},Ab={class:"upload-filters mb-3"},Ob=["value"],Nb=["value"],Ib={key:4,class:"py-4 text-center text-secondary"},Db={key:5,class:"py-4 text-center text-secondary"},$b={key:6,class:"upload-list list-unstyled mb-0"},Rb={class:"upload-task-heading"},Lb={class:"small mb-1"},Pb={key:0,class:"small text-danger mb-1"},Bb={class:"small upload-details"},_b={key:0},zb={key:7,class:"d-flex flex-wrap justify-content-between gap-2 align-items-center mt-3"},jb={class:"small text-secondary"},Fb={class:"d-flex gap-2"},Vb=["disabled"],Hb=["disabled"],qb={class:"border-top pt-3 mt-3"},Ub={class:"small mt-2"},Wb={class:"list-unstyled small"},Kb={class:"ms-2"},Jb={key:0,class:"text-danger mb-0"},Gb={key:0,class:"small text-secondary"},Yb={__name:"UploadTasks",setup(n){const e=P(null),t=P(null),s=P(""),i=P(!1),r=P(""),o=P(1),l=P({state:"pending",family:"",camera:""}),c=ee(()=>R.value.loggedIn&&R.value.platformAdmin&&R.value.page==="storage"),d=ee(()=>{var M;return((M=e.value)==null?void 0:M.totals)||{}}),u=ee(()=>R.value.state.storage||{}),p=ee(()=>{var M;return(((M=e.value)==null?void 0:M.cameras)||[]).filter(w=>!l.value.family||w.familyId===l.value.family)}),f=M=>M?new Date(M*1e3).toLocaleString("zh-CN",{hour12:!1,timeZone:"Asia/Shanghai"})+" 北京时间":"—",h=ee(()=>{var M,w;return(w=(M=e.value)==null?void 0:M.active)==null?void 0:w.stage}),g=ee(()=>({preparing:"核对本机片段并准备上传",uploading:"上传文件分片",verifying:"回读网盘文件,核对完整性",cleaning:"校验成功,正在删除本机片段"})[h.value]||"");let b,m=0;async function y(){const M=++m;if(clearTimeout(b),!(!c.value||document.hidden))try{const[w,T]=await Promise.all([K().api("/api/uploads/recordings?"+rb(l.value,o.value)),K().api("/api/backups")]);if(M!==m)return;e.value=w,o.value=w.page,t.value=T,s.value=""}catch(w){M===m&&(s.value=w.message)}finally{M===m&&c.value&&(b=setTimeout(y,5e3))}}function S(){o.value=1,r.value="",y()}function A(){l.value.camera="",S()}function O(M){o.value+=M,y()}async function B(){if(i.value)return;i.value=!0,r.value="";const M=m;try{if(await K().api("/api/uploads/recordings/retry",{}),M!==m)return;r.value="已安排重试最早的片段,后续片段仍按时间顺序上传。",y()}catch(w){M===m&&(r.value=w.message)}finally{i.value=!1}}function E(){document.hidden?(m++,clearTimeout(b)):c.value&&y()}return Ae([c,()=>R.value.session],()=>{m++,clearTimeout(b),e.value=null,t.value=null,s.value="",r.value="",i.value=!1,o.value=1,l.value={state:"pending",family:"",camera:""},c.value&&y()},{immediate:!0}),document.addEventListener("visibilitychange",E),Bt(()=>{m++,clearTimeout(b),document.removeEventListener("visibilitychange",E)}),(M,w)=>{var T,N,I,Z,Oe,le,ae,_,fe,rt,vt;return c.value?(v(),x("section",ob,[a("div",{class:"d-flex flex-wrap justify-content-between gap-3 align-items-start mb-3"},[w[5]||(w[5]=a("div",null,[a("span",{class:"eyebrow"},"百度网盘 · 自动归档"),a("h2",{class:"fs-4 mt-1"},"上传任务"),a("p",{class:"small text-secondary mb-0"},"录像按录制时间依次上传,云端校验成功后才清理本机。此页每 5 秒自动更新。")],-1)),a("button",{class:"btn btn-outline-secondary",onClick:y},"刷新任务")]),a("div",lb,[a("div",ab,[a("div",cb,[w[6]||(w[6]=a("span",null,"待上传",-1)),a("strong",null,k(j(Vt)(d.value.pendingBytes)),1),a("small",null,k(d.value.pendingCount||0)+" 个片段保留在本机",1)])]),a("div",db,[a("div",ub,[w[7]||(w[7]=a("span",null,"累计清理本机录像",-1)),a("strong",null,k(j(Vt)(d.value.releasedBytes)),1),a("small",null,"今日清理 "+k(j(Vt)(d.value.releasedTodayBytes)),1)])]),a("div",pb,[a("div",fb,[w[8]||(w[8]=a("span",null,"已归档至网盘",-1)),a("strong",null,k(j(Vt)(d.value.cloudBytes)),1),a("small",null,k(d.value.cloudCount||0)+" 个未到期片段",1)])]),a("div",hb,[a("div",mb,[w[9]||(w[9]=a("span",null,"服务器磁盘可用",-1)),a("strong",null,k((T=u.value.freeGB)!=null?T:"—")+" GB",1),a("small",null,"临时录像分区上限 "+k((N=u.value.temporaryMaxGB)!=null?N:"—")+" GB",1)])])]),w[33]||(w[33]=a("p",{class:"small text-secondary"},"清理量按已删除录像文件的大小累计;磁盘可用空间也会受系统和其他文件影响,两者并非同一个数值。",-1)),(Z=(I=e.value)==null?void 0:I.active)!=null&&Z.id?(v(),x("div",gb,[a("div",bb,[a("strong",null,k(g.value),1),e.value.active.percent!==null?(v(),x("span",yb,k(e.value.active.percent)+"%",1)):D("",!0)]),a("p",vb,k(((Oe=e.value.items.find(F=>F.id===e.value.active.id))==null?void 0:Oe.cameraName)||"正在处理队首片段")+" · "+k(h.value==="verifying"?"校验完成后才释放空间":"上传完成后还需云端校验"),1),e.value.active.percent!==null?(v(),x("div",{key:0,class:"progress",role:"progressbar","aria-label":g.value,"aria-valuenow":e.value.active.percent,"aria-valuemin":"0","aria-valuemax":"100"},[a("div",{class:"progress-bar",style:Nn({width:e.value.active.percent+"%"})},null,4)],8,kb)):D("",!0)])):(le=e.value)!=null&&le.status.error?(v(),x("div",xb,[w[11]||(w[11]=a("strong",null,"队首片段等待重试",-1)),a("p",wb,k(e.value.status.error)+"。本机文件已保留。",1),a("div",Sb,[a("span",Cb,"预计重试:"+k(f(e.value.status.retryAt)),1),a("button",{class:"btn btn-sm btn-outline-secondary",disabled:i.value,onClick:B},"重试队首任务",8,Mb),w[10]||(w[10]=a("button",{class:"btn btn-sm btn-outline-secondary","data-page":"settings","data-settings-section":"baidu"},"检查网盘连接",-1))])])):D("",!0),r.value?(v(),x("p",Tb,k(r.value),1)):D("",!0),s.value?(v(),x("p",Eb,k(s.value)+" · 当前列表可能尚未更新。",1)):D("",!0),a("div",Ab,[a("label",null,[w[13]||(w[13]=C("任务状态",-1)),Y(a("select",{"onUpdate:modelValue":w[0]||(w[0]=F=>l.value.state=F),class:"form-select",onChange:S},[...w[12]||(w[12]=[ge('',5)])],544),[[Te,l.value.state]])]),a("label",null,[w[15]||(w[15]=C("家庭或场所",-1)),Y(a("select",{"onUpdate:modelValue":w[1]||(w[1]=F=>l.value.family=F),class:"form-select",onChange:A},[w[14]||(w[14]=a("option",{value:""},"全部家庭或场所",-1)),(v(!0),x(H,null,J(((ae=e.value)==null?void 0:ae.families)||[],F=>(v(),x("option",{key:F.id,value:F.id},k(F.name),9,Ob))),128))],544),[[Te,l.value.family]])]),a("label",null,[w[17]||(w[17]=C("摄像机",-1)),Y(a("select",{"onUpdate:modelValue":w[2]||(w[2]=F=>l.value.camera=F),class:"form-select",onChange:S},[w[16]||(w[16]=a("option",{value:""},"全部摄像机",-1)),(v(!0),x(H,null,J(p.value,F=>(v(),x("option",{key:F.id+":"+F.familyId,value:F.id},k(F.name),9,Nb))),128))],544),[[Te,l.value.camera]])])]),e.value?e.value.items.length?(v(),x("ol",$b,[(v(!0),x(H,null,J(e.value.items,F=>{var jt;return v(),x("li",{key:F.id,class:"upload-task"},[a("div",Rb,[a("strong",null,k(F.cameraName),1),a("span",{class:De(["badge",F.error?"text-bg-warning":F.state==="cloud"?"text-bg-success":"text-bg-light"])},k(j(ib)(F,e.value.active)),3)]),a("p",Lb,k(F.familyName)+" · "+k(f(F.started))+" · "+k(Math.round(F.duration))+" 秒 · "+k(j(Vt)(F.size)),1),F.error&&F.id!==e.value.active.id?(v(),x("p",Pb,k(F.error)+" · 已尝试 "+k(F.attempts)+" 次",1)):D("",!0),a("details",null,[w[30]||(w[30]=a("summary",{class:"small"},"文件与任务详情",-1)),a("dl",Bb,[a("div",null,[w[18]||(w[18]=a("dt",null,"文件名称",-1)),a("dd",null,k(F.name),1)]),a("div",null,[w[19]||(w[19]=a("dt",null,"录制开始",-1)),a("dd",null,k(f(F.started)),1)]),a("div",null,[w[20]||(w[20]=a("dt",null,"录制结束",-1)),a("dd",null,k(f(F.ended)),1)]),a("div",null,[w[21]||(w[21]=a("dt",null,"编码 / 保存方式",-1)),a("dd",null,k(((jt=F.metadata.codec)==null?void 0:jt.toUpperCase())||"原始码流")+" · 连续保留原始编码画面",1)]),a("div",null,[w[22]||(w[22]=a("dt",null,"时间属性",-1)),a("dd",null,k(F.metadata.start?"已写入 MP4 文件;服务器录制时钟":"历史文件:时间保存在系统索引中"),1)]),a("div",null,[w[23]||(w[23]=a("dt",null,"网盘文件大小",-1)),a("dd",null,k(j(Vt)(F.archiveSize)),1)]),a("div",null,[w[24]||(w[24]=a("dt",null,"摄像机编号",-1)),a("dd",null,k(F.cameraId),1)]),a("div",null,[w[25]||(w[25]=a("dt",null,"保存位置",-1)),a("dd",null,k(F.remotePath||"家庭 / 摄像头类型 / 摄像机 / 年 / 月 / 日"),1)]),a("div",null,[w[26]||(w[26]=a("dt",null,"云端校验时间",-1)),a("dd",null,k(f(F.verifiedAt)),1)]),a("div",null,[w[27]||(w[27]=a("dt",null,"本机清理时间",-1)),a("dd",null,k(f(F.releasedAt)),1)]),a("div",null,[w[28]||(w[28]=a("dt",null,"清理文件大小",-1)),a("dd",null,k(j(Vt)(F.releasedBytes)),1)]),F.retryAt&&F.error?(v(),x("div",_b,[w[29]||(w[29]=a("dt",null,"下一次重试",-1)),a("dd",null,k(f(F.retryAt)),1)])):D("",!0)])])])}),128))])):(v(),x("div",Db,"当前筛选下暂无任务。正在录制的片段完成后才会进入队列。")):(v(),x("div",Ib,"正在读取上传队列…")),e.value?(v(),x("div",zb,[a("span",jb,"共 "+k(e.value.total)+" 个任务 · 第 "+k(e.value.page)+" / "+k(e.value.pages)+" 页 · 更新于 "+k(f(e.value.updatedAt)),1),a("div",Fb,[a("button",{class:"btn btn-sm btn-outline-secondary",disabled:o.value<=1,onClick:w[3]||(w[3]=F=>O(-1))},"上一页",8,Vb),a("button",{class:"btn btn-sm btn-outline-secondary",disabled:o.value>=e.value.pages,onClick:w[4]||(w[4]=F=>O(1))},"下一页",8,Hb)])])):D("",!0),a("details",qb,[w[31]||(w[31]=a("summary",null,"数据库备份上传",-1)),a("p",Ub,k((_=t.value)!=null&&_.running?t.value.stage:"备份任务未在执行")+"。数据库副本使用独立保留策略,不计入上方录像清理量。",1),a("ul",Wb,[(v(!0),x(H,null,J((((fe=t.value)==null?void 0:fe.history)||[]).filter(F=>F.baiduRequested).slice(0,5),F=>(v(),x("li",{key:F.file||F.at,class:"py-2 border-bottom"},[a("strong",null,k(F.file||"数据库备份"),1),a("span",Kb,k(F.baiduOk?"已上传并校验":"上传未完成"),1),F.error?(v(),x("p",Jb,k(F.error),1)):D("",!0)]))),128))]),(vt=(rt=t.value)==null?void 0:rt.history)!=null&&vt.some(F=>F.baiduRequested)?D("",!0):(v(),x("p",Gb,"尚无网盘备份记录。")),w[32]||(w[32]=a("button",{class:"btn btn-sm btn-outline-secondary","data-page":"settings","data-settings-section":"backup"},"打开备份设置",-1))])])):D("",!0)}}},Xb=hs(Yb,[["__scopeId","data-v-0c20c09f"]]);var Bo=Object.defineProperty,Zb=(n,e)=>{let t={};for(var s in n)Bo(t,s,{get:n[s],enumerable:!0});return Bo(t,Symbol.toStringTag,{value:"Module"}),t};function Se(n){this.content=n}Se.prototype={constructor:Se,find:function(n){for(var e=0;e>1}};Se.from=function(n){if(n instanceof Se)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Se(e)};function La(n,e,t){for(let s=0;;s++){if(s==n.childCount||s==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(s),r=e.child(s);if(i==r){t+=i.nodeSize;continue}if(!i.sameMarkup(r))return t;if(i.isText&&i.text!=r.text){let o=i.text,l=r.text,c=0;for(;o[c]==l[c];c++)t++;return c&&c0&&f>0&&d[p-1]==u[f-1];)p--,f--,t--,s--;return p&&f&&p=56320&&n<57344}function _a(n){return n>=55296&&n<56320}class ${constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let s=0;se&&s(c,i+l,r||null,o)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,t-u),s,i+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,s,i){let r="",o=!0;return this.nodesBetween(e,t,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,t-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&s&&(o?o=!1:r+=s),r+=d},0),r}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,s=e.firstChild,i=this.content.slice(),r=0;for(t.isText&&t.sameMarkup(s)&&(i[i.length-1]=t.withText(t.text+s.text),r=1);re)for(let r=0,o=0;oe&&((ot)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),s.push(l),i+=l.nodeSize),o=c}return new $(s,i)}cutByIndex(e,t){return e==t?$.empty:e==0&&t==this.content.length?this:new $(this.content.slice(e,t))}replaceChild(e,t){let s=this.content[e];if(s==t)return this;let i=this.content.slice(),r=this.size+t.nodeSize-s.nodeSize;return i[e]=t,new $(i,r)}addToStart(e){return new $([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new $(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,s=0;;t++){let i=this.child(t),r=s+i.nodeSize;if(r>=e)return r==e?Ss(t+1,r):Ss(t,s);s=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return $.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return $.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return $.empty;let t,s=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),s=!0),t&&t.push(r)}}return t||(t=e.slice()),s||t.push(this),t}removeFromSet(e){for(let t=0;ts.type.rank-i.type.rank),t}};ie.none=[];class ns extends Error{}class z{constructor(e,t,s){this.content=e,this.openStart=t,this.openEnd=s}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let s=ja(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return s&&new z(s,this.openStart,this.openEnd)}removeBetween(e,t){return new z(za(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return z.empty;let s=t.openStart||0,i=t.openEnd||0;if(typeof s!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new z($.fromJSON(e,t.content),s,i)}static maxOpen(e,t=!0){let s=0,i=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)s++;for(let r=e.lastChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.lastChild)i++;return new z(e,s,i)}}z.empty=new z($.empty,0,0);function za(n,e,t){let{index:s,offset:i}=n.findIndex(e),r=n.maybeChild(s),{index:o,offset:l}=n.findIndex(t);if(i==e||r.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(s!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(s,r.copy(za(r.content,e-i-1,t-i-1)))}function ja(n,e,t,s,i,r){let{index:o,offset:l}=n.findIndex(e),c=n.maybeChild(o);if(l==e||c.isText)return r&&s<=0&&i<=0&&!r.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let d=ja(c.content,e-l-1,t,o==0?s-1:0,o==n.childCount-1?i-1:0,c);return d&&n.replaceChild(o,c.copy(d))}function Qb(n,e,t){if(t.openStart>n.depth)throw new ns("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new ns("Inconsistent open depths");return Fa(n,e,t,0)}function Fa(n,e,t,s){let i=n.index(s),r=n.node(s);if(i==e.index(s)&&s=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Vn(n,e,t,s){let i=(e||n).node(t),r=0,o=e?e.index(t):i.childCount;n&&(r=n.index(t),n.depth>t?r++:n.textOffset&&(Yt(n.nodeAfter,s),r++));for(let l=r;li&&kr(n,e,i+1),o=s.depth>i&&kr(t,s,i+1),l=[];return Vn(null,n,i,l),r&&o&&e.index(i)==t.index(i)?(Va(r,o),Yt(Xt(r,Ha(n,e,t,s,i+1)),l)):(r&&Yt(Xt(r,Ws(n,e,i+1)),l),Vn(e,t,i,l),o&&Yt(Xt(o,Ws(t,s,i+1)),l)),Vn(s,null,i,l),new $(l)}function Ws(n,e,t){let s=[];if(Vn(null,n,t,s),n.depth>t){let i=kr(n,e,t+1);Yt(Xt(i,Ws(n,e,t+1)),s)}return Vn(e,null,t,s),new $(s)}function ey(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let r=t-1;r>=0;r--)i=e.node(r).copy($.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class ss{constructor(e,t,s){this.pos=e,this.path=t,this.parentOffset=s,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let s=this.pos-this.path[this.path.length-1],i=e.child(t);return s?e.child(t).cut(s):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let s=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let r=0;r0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;s--)if(e.pos<=this.end(s)&&(!t||t(this.node(s))))return new Ks(this,e,s);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let s=[],i=0,r=t;for(let o=e;;){let{index:l,offset:c}=o.content.findIndex(r),d=r-c;if(s.push(o,l,i+c),!d||(o=o.child(l),o.isText))break;r=d-1,i+=c+1}return new ss(t,s,r)}static resolveCached(e,t){let s=_o.get(e);if(s)for(let r=0;re&&this.nodesBetween(e,t,r=>(s.isInSet(r.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),qa(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,s=$.empty,i=0,r=s.childCount){let o=this.contentMatchAt(e).matchFragment(s,i,r),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let c=i;ct.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let s;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");s=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,s)}let i=$.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,s)}};Zt.prototype.text=void 0;class Js extends Zt{constructor(e,t,s,i){if(super(e,t,null,i),!s)throw new RangeError("Empty text nodes are not allowed");this.text=s}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):qa(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Js(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Js(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function qa(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}function zo(n,e,t,s){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${s}`);for(let i in n)n[i].validate&&n[i].validate(e[i])}class tn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let s=new iy(e,t);if(s.next==null)return tn.empty;let i=Ua(s);s.next&&s.err("Unexpected trailing text");let r=uy(dy(i));return py(r,s),r}matchType(e){for(let t=0;td.createAndFill()));for(let d=0;d=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(s){e.push(s);for(let i=0;i{let r=i+(s.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(s.next[o].next);return r}).join(` -`)}}tn.empty=new tn(!0);class iy{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ua(n){let e=[];do e.push(ry(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function ry(n){let e=[];do e.push(oy(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function oy(n){let e=cy(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=ly(n,e);else break;return e}function jo(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function ly(n,e){let t=jo(n),s=t;return n.eat(",")&&(n.next!="}"?s=jo(n):s=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:s,expr:e}}function ay(n,e){let t=n.nodeTypes,s=t[e];if(s)return[s];let i=[];for(let r in t){let o=t[r];o.isInGroup(e)&&i.push(o)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function cy(n){if(n.eat("(")){let e=Ua(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=ay(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function dy(n){let e=[[]];return i(r(n,0),t()),e;function t(){return e.push([])-1}function s(o,l,c){let d={term:c,to:l};return e[o].push(d),d}function i(o,l){o.forEach(c=>c.to=l)}function r(o,l){if(o.type=="choice")return o.exprs.reduce((c,d)=>c.concat(r(d,l)),[]);if(o.type=="seq")for(let c=0;;c++){let d=r(o.exprs[c],l);if(c==o.exprs.length-1)return d;i(d,l=t())}else if(o.type=="star"){let c=t();return s(l,c),i(r(o.expr,c),c),[s(c)]}else if(o.type=="plus"){let c=t();return i(r(o.expr,l),c),i(r(o.expr,c),c),[s(c)]}else{if(o.type=="opt")return[s(l)].concat(r(o.expr,l));if(o.type=="range"){let c=l;for(let d=0;d{n[o].forEach(({term:l,to:c})=>{if(!l)return;let d;for(let u=0;u{d||i.push([l,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let r=e[s.join(",")]=new tn(s.indexOf(n.length-1)>-1);for(let o=0;o-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Ja(this.attrs,e)}create(e=null,t,s){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Zt(this,this.computeAttrs(e),$.from(t),ie.setFrom(s))}createChecked(e=null,t,s){return t=$.from(t),this.checkContent(t),new Zt(this,this.computeAttrs(e),t,ie.setFrom(s))}createAndFill(e=null,t,s){if(e=this.computeAttrs(e),t=$.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),r=i&&i.fillBefore($.empty,!0);return r?new Zt(this,e,t.append(r),ie.setFrom(s)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;ts[r]=new Ya(r,t,o));let i=t.spec.topNode||"doc";if(!s[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!s.text)throw new RangeError("Every schema needs a 'text' type");for(let r in s.text.attrs)throw new RangeError("The text node type should not have attributes");return s}};function fy(n,e,t){let s=t.split("|");return i=>{let r=i===null?"null":typeof i;if(s.indexOf(r)<0)throw new RangeError(`Expected value of type ${s} for attribute ${e} on type ${n}, got ${r}`)}}class hy{constructor(e,t,s){this.hasDefault=Object.prototype.hasOwnProperty.call(s,"default"),this.default=s.default,this.validate=typeof s.validate=="string"?fy(e,t,s.validate):s.validate}get isRequired(){return!this.hasDefault}}class Ri{constructor(e,t,s,i){this.name=e,this.rank=t,this.schema=s,this.spec=i,this.attrs=Ga(e,i.attrs),this.excluded=null;let r=Ka(this.attrs);this.instance=r?new ie(this,r):null}create(e=null){return!e&&this.instance?this.instance:new ie(this,Ja(this.attrs,e))}static compile(e,t){let s=Object.create(null),i=0;return e.forEach((r,o)=>s[r]=new Ri(r,i++,t,o)),s}removeFromSet(e){for(var t=0;t-1}}class _s{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Se.from(e.nodes),t.marks=Se.from(e.marks||{}),this.nodes=Vo.compile(this.spec.nodes,this),this.marks=Ri.compile(this.spec.marks,this);let s=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let r=this.nodes[i],o=r.spec.content||"",l=r.spec.marks;if(r.contentMatch=s[o]||(s[o]=tn.parse(o,this.nodes)),r.inlineContent=r.contentMatch.inlineContent,r.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!r.isInline||!r.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=r}r.markSet=l=="_"?null:l?Ho(this,l.split(" ")):l==""||!r.inlineContent?[]:null}for(let i in this.marks){let r=this.marks[i],o=r.spec.excludes;r.excluded=o==null?[r]:o==""?[]:Ho(this,o.split(" "))}this.nodeFromJSON=i=>Zt.fromJSON(this,i),this.markFromJSON=i=>ie.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,s,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Vo){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,s,i)}text(e,t){let s=this.nodes.text;return new Js(s,s.defaultAttrs,e,ie.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Ho(n,e){let t=[];for(let s=0;s-1)&&t.push(o=c)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[s]+"'")}return t}function my(n){return n.tag!=null}function gy(n){return n.style!=null}class Ot{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let s=this.matchedStyles=[];t.forEach(i=>{if(my(i))this.tags.push(i);else if(gy(i)){let r=/[^=]*/.exec(i.style)[0];s.indexOf(r)<0&&s.push(r),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let r=e.nodes[i.node];return r.contentMatch.matchType(r)})}parse(e,t={}){let s=new Uo(this,t,!1);return s.addAll(e,ie.none,t.from,t.to),s.finish()}parseSlice(e,t={}){let s=new Uo(this,t,!0);return s.addAll(e,ie.none,t.from,t.to),z.maxOpen(s.finish())}matchTag(e,t,s){for(let i=s?this.tags.indexOf(s)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let c=o.getAttrs(t);if(c===!1)continue;o.attrs=c||void 0}return o}}}static schemaRules(e){let t=[];function s(i){let r=i.priority==null?50:i.priority,o=0;for(;o{s(o=Wo(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let r=e.nodes[i].spec.parseDOM;r&&r.forEach(o=>{s(o=Wo(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ot(e,Ot.schemaRules(e)))}}const Xa={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},by={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Za={ol:!0,ul:!0},is=1,wr=2,Hn=4;function qo(n,e,t){return e!=null?(e?is:0)|(e==="full"?wr:0):n&&n.whitespace=="pre"?is|wr:t&~Hn}class Cs{constructor(e,t,s,i,r,o){this.type=e,this.attrs=t,this.marks=s,this.solid=i,this.options=o,this.content=[],this.activeMarks=ie.none,this.match=r||(o&Hn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore($.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let s=this.type.contentMatch,i;return(i=s.findWrapping(e.type))?(this.match=s,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&is)){let s=this.content[this.content.length-1],i;if(s&&s.isText&&(i=/[ \t\r\n\u000c]+$/.exec(s.text))){let r=s;s.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=r.withText(r.text.slice(0,r.text.length-i[0].length))}}let t=$.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore($.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Xa.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Uo{constructor(e,t,s){this.parser=e,this.options=t,this.isOpen=s,this.open=0,this.localPreserveWS=!1;let i=t.topNode,r,o=qo(null,t.preserveWhitespace,0)|(s?Hn:0);i?r=new Cs(i.type,i.attrs,ie.none,!0,t.topMatch||i.type.contentMatch,o):s?r=new Cs(null,null,ie.none,!0,null,o):r=new Cs(e.schema.topNodeType,null,ie.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let s=e.nodeValue,i=this.top,r=i.options&wr?"full":this.localPreserveWS||(i.options&is)>0,{schema:o}=this.parser;if(r==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(s)){if(r)if(r==="full")s=s.replace(/\r\n?/g,` -`);else if(o.linebreakReplacement&&/[\r\n]/.test(s)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=s.split(/\r?\n|\r/);for(let c=0;c!c.clearMark(d)):t=t.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return t}addElementByRule(e,t,s,i){let r,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),s,e.nodeName=="BR")||this.leafFallback(e,s);else{let c=this.enter(o,t.attrs||null,s,t.preserveWhitespace);c&&(r=!0,s=c)}else{let c=this.parser.schema.marks[t.mark];s=s.concat(c.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,s,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,s,!1));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c,s),this.findAround(e,c,!1)}r&&this.sync(l)&&this.open--}addAll(e,t,s,i){let r=s||0;for(let o=s?e.childNodes[s]:e.firstChild,l=i==null?null:e.childNodes[i];o!=l;o=o.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(o,t);this.findAtPoint(e,r)}findPlace(e,t,s){let i,r;for(let o=this.open,l=0;o>=0;o--){let c=this.nodes[o],d=c.findWrapping(e);if(d&&(!i||i.length>d.length+l)&&(i=d,r=c,!d.length))break;if(c.solid){if(s)break;l+=2}}if(!i)return null;this.sync(r);for(let o=0;o(o.type?o.type.allowsMarkType(d.type):Ko(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new Cs(e,t,c,i,null,l)),this.open++,s}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=is)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let s=this.nodes[t].content;for(let i=s.length-1;i>=0;i--)e+=s[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let s=0;s-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),s=this.options.context,i=!this.isOpen&&(!s||s.parent.type==this.nodes[0].type),r=-(s?s.depth+1:0)+(i?0:1),o=(l,c)=>{for(;l>=0;l--){let d=t[l];if(d==""){if(l==t.length-1||l==0)continue;for(;c>=r;c--)if(o(l-1,c))return!0;return!1}else{let u=c>0||c==0&&i?this.nodes[c].type:s&&c>=r?s.node(c-r).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;c--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let s=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(s&&s.isTextblock&&s.defaultAttrs)return s}for(let t in this.parser.schema.nodes){let s=this.parser.schema.nodes[t];if(s.isTextblock&&s.defaultAttrs)return s}}}function yy(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let s=e.nodeType==1?e.nodeName.toLowerCase():null;s&&Za.hasOwnProperty(s)&&t?(t.appendChild(e),e=t):s=="li"?t=e:s&&(t=null)}}function vy(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Wo(n){let e={};for(let t in n)e[t]=n[t];return e}function Ko(n,e){let t=e.schema.nodes;for(let s in t){let i=t[s];if(!i.allowsMarkType(n))continue;let r=[],o=l=>{r.push(l);for(let c=0;c{if(r.length||o.marks.length){let l=0,c=0;for(;l=0;i--){let r=this.serializeMark(e.marks[i],e.isInline,t);r&&((r.contentDOM||r.dom).appendChild(s),s=r.dom)}return s}serializeMark(e,t,s={}){let i=this.marks[e.type.name];return i&&zs(Ms(s),i(e,t),null,e.attrs)}static renderSpec(e,t,s=null,i){return typeof t=="string"?{dom:e.createTextNode(t)}:zs(e,t,s,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ln(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Jo(e.nodes);return t.text||(t.text=s=>s.text),t}static marksFromSchema(e){return Jo(e.marks)}}function Jo(n){let e={};for(let t in n){let s=n[t].spec.toDOM;s&&(e[t]=s)}return e}function Ms(n){return n.document||window.document}const Go=new WeakMap;function ky(n){let e=Go.get(n);return e===void 0&&Go.set(n,e=xy(n)),e}function xy(n){let e=null;function t(s){if(s&&typeof s=="object")if(Array.isArray(s))if(typeof s[0]=="string")e||(e=[]),e.push(s);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let l,c=t?n.createElementNS(t,i):n.createElement(i),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let p in d)if(d[p]!=null){let f=p.indexOf(" ");f>0?c.setAttributeNS(p.slice(0,f),p.slice(f+1),d[p]):p=="style"&&c.style?c.style.cssText=d[p]:c.setAttribute(p,d[p])}}for(let p=u;pu)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else if(typeof f=="string")c.appendChild(n.createTextNode(f));else{let{dom:h,contentDOM:g}=zs(n,f,t,s);if(c.appendChild(h),g){if(l)throw new RangeError("Multiple content holes");l=g}}}return{dom:c,contentDOM:l}}const Qa=65535,ec=Math.pow(2,16);function wy(n,e){return n+e*ec}function Yo(n){return n&Qa}function Sy(n){return(n-(n&Qa))/ec}const tc=1,nc=2,js=4,sc=8;class Sr{constructor(e,t,s){this.pos=e,this.delInfo=t,this.recover=s}get deleted(){return(this.delInfo&sc)>0}get deletedBefore(){return(this.delInfo&(tc|js))>0}get deletedAfter(){return(this.delInfo&(nc|js))>0}get deletedAcross(){return(this.delInfo&js)>0}}class He{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&He.empty)return He.empty}recover(e){let t=0,s=Yo(e);if(!this.inverted)for(let i=0;ie)break;let d=this.ranges[l+r],u=this.ranges[l+o],p=c+d;if(e<=p){let f=d?e==c?-1:e==p?1:t:t,h=c+i+(f<0?0:u);if(s)return h;let g=e==(t<0?c:p)?null:wy(l/3,e-c),b=0;return d&&(b|=e==c?nc:e==p?tc:js,(t<0?e!=c:e!=p)&&(b|=sc)),new Sr(h,b,g)}i+=u-d}return s?e+i:new Sr(e+i,0,null)}touches(e,t){let s=0,i=Yo(t),r=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;le)break;let d=this.ranges[l+r],u=c+d;if(e<=u&&l==i*3)return!0;s+=this.ranges[l+o]-d}return!1}forEach(e){let t=this.inverted?2:1,s=this.inverted?1:2;for(let i=0,r=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?s-i-1:void 0)}}invert(){let e=new rs;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let s=this.from;sr&&c!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return he.fromReplace(e,this.from,this.to,r)}invert(){return new Xe(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),s=e.mapResult(this.to,-1);return t.deleted&&s.deleted||t.pos>=s.pos?null:new Tt(t.pos,s.pos,this.mark)}merge(e){return e instanceof Tt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Tt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Tt(t.from,t.to,e.markFromJSON(t.mark))}}Re.jsonID("addMark",Tt);class Xe extends Re{constructor(e,t,s){super(),this.from=e,this.to=t,this.mark=s}apply(e){let t=e.slice(this.from,this.to),s=new z(eo(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return he.fromReplace(e,this.from,this.to,s)}invert(){return new Tt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),s=e.mapResult(this.to,-1);return t.deleted&&s.deleted||t.pos>=s.pos?null:new Xe(t.pos,s.pos,this.mark)}merge(e){return e instanceof Xe&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Xe(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Xe(t.from,t.to,e.markFromJSON(t.mark))}}Re.jsonID("removeMark",Xe);class Et extends Re{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return he.fail("No node at mark step's position");let s=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return he.fromReplace(e,this.pos,this.pos+1,new z($.from(s),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let s=this.mark.addToSet(t.marks);if(s.length==t.marks.length){for(let i=0;is.pos?null:new xe(t.pos,s.pos,i,r,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new xe(t.from,t.to,t.gapFrom,t.gapTo,z.fromJSON(e,t.slice),t.insert,!!t.structure)}}Re.jsonID("replaceAround",xe);function Cr(n,e,t){let s=n.resolve(e),i=t-e,r=s.depth;for(;i>0&&r>0&&s.indexAfter(r)==s.node(r).childCount;)r--,i--;if(i>0){let o=s.node(r).maybeChild(s.indexAfter(r));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Cy(n,e,t,s){let i=[],r=[],o,l;n.doc.nodesBetween(e,t,(c,d,u)=>{if(!c.isInline)return;let p=c.marks;if(!s.isInSet(p)&&u.type.allowsMarkType(s.type)){let f=Math.max(d,e),h=Math.min(d+c.nodeSize,t),g=s.addToSet(p);for(let b=0;bn.step(c)),r.forEach(c=>n.step(c))}function My(n,e,t,s){let i=[],r=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;r++;let c=null;if(s instanceof Ri){let d=o.marks,u;for(;u=s.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else s?s.isInSet(o.marks)&&(c=[s]):c=o.marks;if(c&&c.length){let d=Math.min(l+o.nodeSize,t);for(let u=0;un.step(new Xe(o.from,o.to,o.style)))}function to(n,e,t,s=t.contentMatch,i=!0){let r=n.doc.nodeAt(e),o=[],l=e+1;for(let c=0;c=0;c--)n.step(o[c])}function Ty(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function In(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let s=n.depth,i=0,r=0;;--s){let o=n.$from.node(s),l=n.$from.index(s)+i,c=n.$to.indexAfter(s)-r;if(st;g--)b||s.index(g)>0?(b=!0,u=$.from(s.node(g).copy(u)),p++):c--;let f=$.empty,h=0;for(let g=r,b=!1;g>t;g--)b||i.after(g+1)=0;o--){if(s.size){let l=t[o].type.contentMatch.matchFragment(s);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}s=$.from(t[o].type.create(t[o].attrs,s))}let i=e.start,r=e.end;n.step(new xe(i,r,i,r,new z(s,0,0),t.length,!0))}function Iy(n,e,t,s,i){if(!s.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let r=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let c=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(s,c)&&Dy(n.doc,n.mapping.slice(r).map(l),s)){let d=null;if(s.schema.linebreakReplacement){let h=s.whitespace=="pre",g=!!s.contentMatch.matchType(s.schema.linebreakReplacement);h&&!g?d=!1:!h&&g&&(d=!0)}d===!1&&rc(n,o,l,r),to(n,n.mapping.slice(r).map(l,1),s,void 0,d===null);let u=n.mapping.slice(r),p=u.map(l,1),f=u.map(l+o.nodeSize,1);return n.step(new xe(p,f,p+1,f-1,new z($.from(s.create(c,null,o.marks)),0,0),1,!0)),d===!0&&ic(n,o,l,r),!1}})}function ic(n,e,t,s){e.forEach((i,r)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let c=n.mapping.slice(s).map(t+1+r+o.index);n.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function rc(n,e,t,s){e.forEach((i,r)=>{if(i.type==i.type.schema.linebreakReplacement){let o=n.mapping.slice(s).map(t+1+r);n.replaceWith(o,o+1,e.type.schema.text(` -`))}})}function Dy(n,e,t){let s=n.resolve(e),i=s.index();return s.parent.canReplaceWith(i,i+1,t)}function $y(n,e,t,s,i){let r=n.doc.nodeAt(e);if(!r)throw new RangeError("No node at given position");t||(t=r.type);let o=t.create(s,null,i||r.marks);if(r.isLeaf)return n.replaceWith(e,e+r.nodeSize,o);if(!t.validContent(r.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new xe(e,e+r.nodeSize,e+1,e+r.nodeSize-1,new z($.from(o),0,0),1,!0))}function mt(n,e,t=1,s){let i=n.resolve(e),r=i.depth-t,o=s&&s[s.length-1]||i.parent;if(r<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=t-2;d>r;d--,u--){let p=i.node(d),f=i.index(d);if(p.type.spec.isolating)return!1;let h=p.content.cutByIndex(f,p.childCount),g=s&&s[u+1];g&&(h=h.replaceChild(0,g.type.create(g.attrs)));let b=s&&s[u]||p;if(!p.canReplace(f+1,p.childCount)||!b.type.validContent(h))return!1}let l=i.indexAfter(r),c=s&&s[0];return i.node(r).canReplaceWith(l,l,c?c.type:i.node(r+1).type)}function Ry(n,e,t=1,s){let i=n.doc.resolve(e),r=$.empty,o=$.empty;for(let l=i.depth,c=i.depth-t,d=t-1;l>c;l--,d--){r=$.from(i.node(l).copy(r));let u=s&&s[d];o=$.from(u?u.type.create(u.attrs,o):i.node(l).copy(o))}n.step(new de(e,e,new z(r.append(o),t,t),!0))}function _t(n,e){let t=n.resolve(e),s=t.index();return oc(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(s,s+1)}function Ly(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:s}=n.type.schema;for(let i=0;i0?(r=s.node(i+1),l++,o=s.node(i).maybeChild(l)):(r=s.node(i).maybeChild(l-1),o=s.node(i+1)),r&&!r.isTextblock&&oc(r,o)&&s.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?s.before(i):s.after(i)}}function Py(n,e,t){let s=null,{linebreakReplacement:i}=n.doc.type.schema,r=n.doc.resolve(e-t),o=r.node().type;if(i&&o.inlineContent){let u=o.whitespace=="pre",p=!!o.contentMatch.matchType(i);u&&!p?s=!1:!u&&p&&(s=!0)}let l=n.steps.length;if(s===!1){let u=n.doc.resolve(e+t);rc(n,u.node(),u.before(),l)}o.inlineContent&&to(n,e+t-1,o,r.node().contentMatchAt(r.index()),s==null);let c=n.mapping.slice(l),d=c.map(e-t);if(n.step(new de(d,c.map(e+t,-1),z.empty,!0)),s===!0){let u=n.doc.resolve(d);ic(n,u.node(),u.before(),n.steps.length)}return n}function By(n,e,t){let s=n.resolve(e);if(s.parent.canReplaceWith(s.index(),s.index(),t))return e;if(s.parentOffset==0)for(let i=s.depth-1;i>=0;i--){let r=s.index(i);if(s.node(i).canReplaceWith(r,r,t))return s.before(i+1);if(r>0)return null}if(s.parentOffset==s.parent.content.size)for(let i=s.depth-1;i>=0;i--){let r=s.indexAfter(i);if(s.node(i).canReplaceWith(r,r,t))return s.after(i+1);if(r=0;o--){let l=o==s.depth?0:s.pos<=(s.start(o+1)+s.end(o+1))/2?-1:1,c=s.index(o)+(l>0?1:0),d=s.node(o),u=!1;if(r==1)u=d.canReplace(c,c,i);else{let p=d.contentMatchAt(c).findWrapping(i.firstChild.type);u=p&&d.canReplaceWith(c,c,p[0])}if(u)return l==0?s.pos:l<0?s.before(o+1):s.after(o+1)}return null}function Pi(n,e,t=e,s=z.empty){if(e==t&&!s.size)return null;let i=n.resolve(e),r=n.resolve(t);return ac(i,r,s)?new de(e,t,s):new _y(i,r,s).fit()}function ac(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class _y{constructor(e,t,s){this.$from=e,this.$to=t,this.unplaced=s,this.frontier=[],this.placed=$.empty;for(let i=0;i<=e.depth;i++){let r=e.node(i);this.frontier.push({type:r.type,match:r.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=$.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,s=this.$from,i=this.close(e<0?this.$to:s.doc.resolve(e));if(!i)return null;let r=this.placed,o=s.depth,l=i.depth;for(;o&&l&&r.childCount==1;)r=r.firstChild.content,o--,l--;let c=new z(r,o,l);return e>-1?new xe(s.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||s.pos!=this.$to.pos?new de(s.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,s=0,i=this.unplaced.openEnd;s1&&(i=0),r.type.spec.isolating&&i<=s){e=s;break}t=r.content}for(let t=1;t<=2;t++)for(let s=t==1?e:this.unplaced.openStart;s>=0;s--){let i,r=null;s?(r=Zo(this.unplaced.content,s-1).firstChild,i=r.content):i=this.unplaced.content;let o=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:d}=this.frontier[l],u,p=null;if(t==1&&(o?d.matchType(o.type)||(p=d.fillBefore($.from(o),!1)):r&&c.compatibleContent(r.type)))return{sliceDepth:s,frontierDepth:l,parent:r,inject:p};if(t==2&&o&&(u=d.findWrapping(o.type)))return{sliceDepth:s,frontierDepth:l,parent:r,wrap:u};if(r&&d.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:s}=this.unplaced;return Qo(e,-1)<=t?!1:(this.unplaced.size>1&&Qo(e,1)>s&&s++,this.unplaced=new z(e,t+1,s),!0)}dropNode(){let{content:e,openStart:t,openEnd:s}=this.unplaced,i=Zo(e,t);if(i.childCount<=1&&t>0){let r=e.size-t<=t+i.size;this.unplaced=new z(Bn(e,t-1,1),t-1,r?t-1:s)}else this.unplaced=new z(Bn(e,t,1),t,s)}placeNodes({sliceDepth:e,frontierDepth:t,parent:s,inject:i,wrap:r}){for(;this.depth>t;)this.closeFrontierNode();if(r)for(let b=0;b1||c==0||b.content.size)&&(p=m,u.push(cc(b.mark(f.allowedMarks(b.marks)),d==1?c:0,d==l.childCount?h:-1)))}let g=d==l.childCount;g||(h=-1),this.placed=_n(this.placed,t,$.from(u)),this.frontier[t].match=p,g&&h<0&&s&&s.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,m=l;b1&&i==this.$to.end(--s);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:s,type:i}=this.frontier[t],r=t=0;l--){let{match:c,type:d}=this.frontier[l],u=Qi(e,l,d,c,!0);if(!u||u.childCount)continue e}return{depth:t,fit:o,move:r?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=_n(this.placed,t.depth,t.fit)),e=t.move;for(let s=t.depth+1;s<=e.depth;s++){let i=e.node(s),r=i.type.contentMatch.fillBefore(i.content,!0,e.index(s));this.openFrontierNode(i.type,i.attrs,r)}return e}openFrontierNode(e,t=null,s){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=_n(this.placed,this.depth,$.from(e.create(t,s))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore($.empty,!0);t.childCount&&(this.placed=_n(this.placed,this.frontier.length,t))}}function Bn(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Bn(n.firstChild.content,e-1,t)))}function _n(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(_n(n.lastChild.content,e-1,t)))}function Zo(n,e){for(let t=0;t1&&(s=s.replaceChild(0,cc(s.firstChild,e-1,s.childCount==1?t-1:0))),e>0&&(s=n.type.contentMatch.fillBefore(s).append(s),t<=0&&(s=s.append(n.type.contentMatch.matchFragment(s).fillBefore($.empty,!0)))),n.copy(s)}function Qi(n,e,t,s,i){let r=n.node(e),o=i?n.indexAfter(e):n.index(e);if(o==r.childCount&&!t.compatibleContent(r.type))return null;let l=s.fillBefore(r.content,!0,o);return l&&!zy(t,r.content,o)?l:null}function zy(n,e,t){for(let s=t;s0;f--,h--){let g=i.node(f).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;o.indexOf(f)>-1?l=f:i.before(f)==h&&o.splice(1,0,-f)}let c=o.indexOf(l),d=[],u=s.openStart;for(let f=s.content,h=0;;h++){let g=f.firstChild;if(d.push(g),h==s.openStart)break;f=g.content}for(let f=u-1;f>=0;f--){let h=d[f],g=jy(h.type);if(g&&!h.sameMarkup(i.node(Math.abs(l)-1)))u=f;else if(g||!h.type.isTextblock)break}for(let f=s.openStart;f>=0;f--){let h=(f+u+1)%(s.openStart+1),g=d[h];if(g)for(let b=0;b=0&&(n.replace(e,t,s),!(n.steps.length>p));f--){let h=o[f];h<0||(e=i.before(h),t=r.after(h))}}function dc(n,e,t,s,i){if(es){let r=i.contentMatchAt(0),o=r.fillBefore(n).append(n);n=o.append(r.matchFragment(o).fillBefore($.empty,!0))}return n}function Vy(n,e,t,s){if(!s.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=By(n.doc,e,s.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new z($.from(s),0,0))}function Hy(n,e,t){let s=n.doc.resolve(e),i=n.doc.resolve(t);if(s.parent.isTextblock&&i.parent.isTextblock&&s.start()!=i.start()&&s.parentOffset==0&&i.parentOffset==0){let o=s.sharedDepth(t),l=!1;for(let c=s.depth;c>o;c--)s.node(c).type.spec.isolating&&(l=!0);for(let c=i.depth;c>o;c--)i.node(c).type.spec.isolating&&(l=!0);if(!l){for(let c=s.depth;c>0&&e==s.start(c);c--)e=s.before(c);for(let c=i.depth;c>0&&t==i.start(c);c--)t=i.before(c);s=n.doc.resolve(e),i=n.doc.resolve(t)}}let r=uc(s,i);for(let o=0;o0&&(c||s.node(l-1).canReplace(s.index(l-1),i.indexAfter(l-1))))return n.delete(s.before(l),i.after(l))}for(let o=1;o<=s.depth&&o<=i.depth;o++)if(e-s.start(o)==s.depth-o&&t>s.end(o)&&i.end(o)-t!=i.depth-o&&s.start(o-1)==i.start(o-1)&&s.node(o-1).canReplace(s.index(o-1),i.index(o-1)))return n.delete(s.before(o),t);n.delete(e,t)}function uc(n,e){let t=[],s=Math.min(n.depth,e.depth);for(let i=s;i>=0;i--){let r=n.start(i);if(re.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(r==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==r-1)&&t.push(i)}return t}class kn extends Re{constructor(e,t,s){super(),this.pos=e,this.attr=t,this.value=s}apply(e){let t=e.nodeAt(this.pos);if(!t)return he.fail("No node at attribute step's position");let s=Object.create(null);for(let r in t.attrs)s[r]=t.attrs[r];s[this.attr]=this.value;let i=t.type.create(s,null,t.marks);return he.fromReplace(e,this.pos,this.pos+1,new z($.from(i),0,t.isLeaf?0:1))}getMap(){return He.empty}invert(e){return new kn(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new kn(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new kn(t.pos,t.attr,t.value)}}Re.jsonID("attr",kn);class ls extends Re{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let s=e.type.create(t,e.content,e.marks);return he.ok(s)}getMap(){return He.empty}invert(e){return new ls(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ls(t.attr,t.value)}}Re.jsonID("docAttr",ls);let Sn=class extends Error{};Sn=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};Sn.prototype=Object.create(Error.prototype);Sn.prototype.constructor=Sn;Sn.prototype.name="TransformError";class pc{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new rs}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Sn(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let s=0;s{e=Math.min(e,l),t=Math.max(t,c)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,s=z.empty){let i=Pi(this.doc,e,t,s);return i&&this.step(i),this}replaceWith(e,t,s){return this.replace(e,t,new z($.from(s),0,0))}delete(e,t){return this.replace(e,t,z.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,s){return Fy(this,e,t,s),this}replaceRangeWith(e,t,s){return Vy(this,e,t,s),this}deleteRange(e,t){return Hy(this,e,t),this}lift(e,t){return Ey(this,e,t),this}join(e,t=1){return Py(this,e,t),this}wrap(e,t){return Ny(this,e,t),this}setBlockType(e,t=e,s,i=null){return Iy(this,e,t,s,i),this}setNodeMarkup(e,t,s=null,i){return $y(this,e,t,s,i),this}setNodeAttribute(e,t,s){return this.step(new kn(e,t,s)),this}setDocAttribute(e,t){return this.step(new ls(e,t)),this}addNodeMark(e,t){return this.step(new Et(e,t)),this}removeNodeMark(e,t){let s=this.doc.nodeAt(e);if(!s)throw new RangeError("No node at position "+e);if(t instanceof ie)t.isInSet(s.marks)&&this.step(new nn(e,t));else{let i=s.marks,r,o=[];for(;r=t.isInSet(i);)o.push(new nn(e,r)),i=r.removeFromSet(i);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(e,t=1,s){return Ry(this,e,t,s),this}addMark(e,t,s){return Cy(this,e,t,s),this}removeMark(e,t,s){return My(this,e,t,s),this}clearIncompatible(e,t,s){return to(this,e,t,s),this}}const er=Object.create(null);class X{constructor(e,t,s){this.$anchor=e,this.$head=t,this.ranges=s||[new qy(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;r--){let o=t<0?mn(e.node(0),e.node(r),e.before(r+1),e.index(r),t,s):mn(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,s);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new qe(e.node(0))}static atStart(e){return mn(e,e,0,0,1)||new qe(e)}static atEnd(e){return mn(e,e,e.content.size,e.childCount,-1)||new qe(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let s=er[t.type];if(!s)throw new RangeError(`No selection type ${t.type} defined`);return s.fromJSON(e,t)}static jsonID(e,t){if(e in er)throw new RangeError("Duplicate use of selection JSON ID "+e);return er[e]=t,t.prototype.jsonID=e,t}getBookmark(){return U.between(this.$anchor,this.$head).getBookmark()}}X.prototype.visible=!0;class qy{constructor(e,t){this.$from=e,this.$to=t}}let el=!1;function tl(n){!el&&!n.parent.inlineContent&&(el=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class U extends X{constructor(e,t=e){tl(e),tl(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let s=e.resolve(t.map(this.head));if(!s.parent.inlineContent)return X.near(s);let i=e.resolve(t.map(this.anchor));return new U(i.parent.inlineContent?i:s,s)}replace(e,t=z.empty){if(super.replace(e,t),t==z.empty){let s=this.$from.marksAcross(this.$to);s&&e.ensureMarks(s)}}eq(e){return e instanceof U&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Bi(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new U(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,s=t){let i=e.resolve(t);return new this(i,s==t?i:e.resolve(s))}static between(e,t,s){let i=e.pos-t.pos;if((!s||i)&&(s=i>=0?1:-1),!t.parent.inlineContent){let r=X.findFrom(t,s,!0)||X.findFrom(t,-s,!0);if(r)t=r.$head;else return X.near(t,s)}return e.parent.inlineContent||(i==0?e=t:(e=(X.findFrom(e,-s,!0)||X.findFrom(e,s,!0)).$anchor,e.pos0?0:1);i>0?o=0;o+=i){let l=e.child(o);if(l.isAtom){if(!r&&W.isSelectable(l))return W.create(n,t-(i<0?l.nodeSize:0))}else{let c=mn(n,l,t+i,i<0?l.childCount:0,i,r);if(c)return c}t+=l.nodeSize*i}return null}function nl(n,e,t){let s=n.steps.length-1;if(s{o==null&&(o=u)}),n.setSelection(X.near(n.doc.resolve(o),t))}const sl=1,Ts=2,il=4;class Wy extends pc{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ts,this}ensureMarks(e){return ie.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ts)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Ts,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let s=this.selection;return t&&(e=e.mark(this.storedMarks||(s.empty?s.$from.marks():s.$from.marksAcross(s.$to)||ie.none))),s.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,s){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(s==null&&(s=t),!e)return this.deleteRange(t,s);let r=this.storedMarks;if(!r){let o=this.doc.resolve(t);r=s==t?o.marks():o.marksAcross(this.doc.resolve(s))}return this.replaceRangeWith(t,s,i.text(e,r)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(X.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=il,this}get scrolledIntoView(){return(this.updated&il)>0}}function rl(n,e){return!e||!n?n:n.bind(e)}class zn{constructor(e,t,s){this.name=e,this.init=rl(t.init,s),this.apply=rl(t.apply,s)}}const Ky=[new zn("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new zn("selection",{init(n,e){return n.selection||X.atStart(e.doc)},apply(n){return n.selection}}),new zn("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,s){return s.selection.$cursor?n.storedMarks:null}}),new zn("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class tr{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Ky.slice(),t&&t.forEach(s=>{if(this.pluginsByKey[s.key])throw new RangeError("Adding different instances of a keyed plugin ("+s.key+")");this.plugins.push(s),this.pluginsByKey[s.key]=s,s.spec.state&&this.fields.push(new zn(s.key,s.spec.state,s))})}}class pt{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let s=0;ss.toJSON())),e&&typeof e=="object")for(let s in e){if(s=="doc"||s=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[s],r=i.spec.state;r&&r.toJSON&&(t[s]=r.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,s){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new tr(e.schema,e.plugins),r=new pt(i);return i.fields.forEach(o=>{if(o.name=="doc")r.doc=Zt.fromJSON(e.schema,t.doc);else if(o.name=="selection")r.selection=X.fromJSON(r.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(r.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(s)for(let l in s){let c=s[l],d=c.spec.state;if(c.key==o.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){r[o.name]=d.fromJSON.call(c,e,t[l],r);return}}r[o.name]=o.init(e,r)}}),r}}function fc(n,e,t){for(let s in n){let i=n[s];i instanceof Function?i=i.bind(e):s=="handleDOMEvents"&&(i=fc(i,e,{})),t[s]=i}return t}class oe{constructor(e){this.spec=e,this.props={},e.props&&fc(e.props,this,this.props),this.key=e.key?e.key.key:hc("plugin")}getState(e){return e[this.key]}}const nr=Object.create(null);function hc(n){return n in nr?n+"$"+ ++nr[n]:(nr[n]=0,n+"$")}class me{constructor(e="key"){this.key=hc(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const mc=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function gc(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const bc=(n,e,t)=>{let s=gc(n,t);if(!s)return!1;let i=io(s);if(!i){let o=s.blockRange(),l=o&&In(o);return l==null?!1:(e&&e(n.tr.lift(o,l).scrollIntoView()),!0)}let r=i.nodeBefore;if(Tc(n,i,e,-1))return!0;if(s.parent.content.size==0&&(Cn(r,"end")||W.isSelectable(r)))for(let o=s.depth;;o--){let l=Pi(n.doc,s.before(o),s.after(o),z.empty);if(l&&l.slice.size1)break}return r.isAtom&&i.depth==s.depth-1?(e&&e(n.tr.delete(i.pos-r.nodeSize,i.pos).scrollIntoView()),!0):!1},Jy=(n,e,t)=>{let s=gc(n,t);if(!s)return!1;let i=io(s);return i?yc(n,i,e):!1},Gy=(n,e,t)=>{let s=kc(n,t);if(!s)return!1;let i=ro(s);return i?yc(n,i,e):!1};function yc(n,e,t){let s=e.nodeBefore,i=s,r=e.pos-1;for(;!i.isTextblock;r--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let o=e.nodeAfter,l=o,c=e.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let d=Pi(n.doc,r,c,z.empty);if(!d||d.from!=r||d instanceof de&&d.slice.size>=c-r)return!1;if(t){let u=n.tr.step(d);u.setSelection(U.create(u.doc,r)),t(u.scrollIntoView())}return!0}function Cn(n,e,t=!1){for(let s=n;s;s=e=="start"?s.firstChild:s.lastChild){if(s.isTextblock)return!0;if(t&&s.childCount!=1)return!1}return!1}const vc=(n,e,t)=>{let{$head:s,empty:i}=n.selection,r=s;if(!i)return!1;if(s.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):s.parentOffset>0)return!1;r=io(s)}let o=r&&r.nodeBefore;return!o||!W.isSelectable(o)?!1:(e&&e(n.tr.setSelection(W.create(n.doc,r.pos-o.nodeSize)).scrollIntoView()),!0)};function io(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function kc(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset{let s=kc(n,t);if(!s)return!1;let i=ro(s);if(!i)return!1;let r=i.nodeAfter;if(Tc(n,i,e,1))return!0;if(s.parent.content.size==0&&(Cn(r,"start")||W.isSelectable(r))){let o=Pi(n.doc,s.before(),s.after(),z.empty);if(o&&o.slice.size{let{$head:s,empty:i}=n.selection,r=s;if(!i)return!1;if(s.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):s.parentOffset=0;e--){let t=n.node(e);if(n.index(e)+1{let t=n.selection,s=t instanceof W,i;if(s){if(t.node.isTextblock||!_t(n.doc,t.from))return!1;i=t.from}else if(i=Li(n.doc,t.from,-1),i==null)return!1;if(e){let r=n.tr.join(i);s&&r.setSelection(W.create(r.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(r.scrollIntoView())}return!0},Xy=(n,e)=>{let t=n.selection,s;if(t instanceof W){if(t.node.isTextblock||!_t(n.doc,t.to))return!1;s=t.to}else if(s=Li(n.doc,t.to,1),s==null)return!1;return e&&e(n.tr.join(s).scrollIntoView()),!0},Zy=(n,e)=>{let{$from:t,$to:s}=n.selection,i=t.blockRange(s),r=i&&In(i);return r==null?!1:(e&&e(n.tr.lift(i,r).scrollIntoView()),!0)},Sc=(n,e)=>{let{$head:t,$anchor:s}=n.selection;return!t.parent.type.spec.code||!t.sameParent(s)?!1:(e&&e(n.tr.insertText(` -`).scrollIntoView()),!0)};function oo(n){for(let e=0;e{let{$head:t,$anchor:s}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(s))return!1;let i=t.node(-1),r=t.indexAfter(-1),o=oo(i.contentMatchAt(r));if(!o||!i.canReplaceWith(r,r,o))return!1;if(e){let l=t.after(),c=n.tr.replaceWith(l,l,o.createAndFill());c.setSelection(X.near(c.doc.resolve(l),1)),e(c.scrollIntoView())}return!0},Cc=(n,e)=>{let t=n.selection,{$from:s,$to:i}=t;if(t instanceof qe||s.parent.inlineContent||i.parent.inlineContent)return!1;let r=oo(i.parent.contentMatchAt(i.indexAfter()));if(!r||!r.isTextblock)return!1;if(e){let o=(!s.parentOffset&&i.index(){let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let r=t.before();if(mt(n.doc,r))return e&&e(n.tr.split(r).scrollIntoView()),!0}let s=t.blockRange(),i=s&&In(s);return i==null?!1:(e&&e(n.tr.lift(s,i).scrollIntoView()),!0)};function ev(n){return(e,t)=>{if(e.selection instanceof W&&e.selection.node.isBlock){let{$from:h}=e.selection;return!h.parentOffset||!mt(e.doc,h.pos)?!1:(t&&t(e.tr.split(h.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let s=e.tr;!e.selection.empty&&(e.selection instanceof U||e.selection instanceof qe)&&s.deleteSelection();let{$from:i}=s.selection,r=s.steps.length,o=[],l,c,d=!1,u=!1;for(let h=i.depth;;h--)if(i.node(h).isBlock){d=i.end(h)==i.pos+(i.depth-h),u=i.start(h)==i.pos-(i.depth-h),c=oo(i.node(h-1).contentMatchAt(i.indexAfter(h-1))),o.unshift(d&&c?{type:c}:null),l=h;break}else{if(h==1)return!1;o.unshift(null)}let p=i.pos,f=mt(s.doc,p,o.length,o);if(f||(o[0]=c?{type:c}:null,f=mt(s.doc,p,o.length,o)),!f)return!1;if(s.split(p,o.length,o),!d&&u&&i.node(l).type!=c){let h=s.mapping.slice(r),g=h.map(i.before(l)),b=s.doc.resolve(g);c&&i.node(l-1).canReplaceWith(b.index(),b.index()+1,c)&&s.setNodeMarkup(h.map(i.before(l)),c)}return t&&t(s.scrollIntoView()),!0}}const tv=ev(),nv=(n,e)=>{let{$from:t,to:s}=n.selection,i,r=t.sharedDepth(s);return r==0?!1:(i=t.before(r),e&&e(n.tr.setSelection(W.create(n.doc,i))),!0)};function sv(n,e,t){let s=e.nodeBefore,i=e.nodeAfter,r=e.index();return!s||!i||!s.type.compatibleContent(i.type)?!1:!s.content.size&&e.parent.canReplace(r-1,r)?(t&&t(n.tr.delete(e.pos-s.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(r,r+1)||!(i.isTextblock||_t(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function Tc(n,e,t,s){let i=e.nodeBefore,r=e.nodeAfter,o,l,c=i.type.spec.isolating||r.type.spec.isolating;if(!c&&sv(n,e,t))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(o=(l=i.contentMatchAt(i.childCount)).findWrapping(r.type))&&l.matchType(o[0]||r.type).validEnd){if(t){let h=e.pos+r.nodeSize,g=$.empty;for(let y=o.length-1;y>=0;y--)g=$.from(o[y].create(null,g));g=$.from(i.copy(g));let b=n.tr.step(new xe(e.pos-1,h,e.pos,h,new z(g,1,0),o.length,!0)),m=b.doc.resolve(h+2*o.length);m.nodeAfter&&m.nodeAfter.type==i.type&&_t(b.doc,m.pos)&&b.join(m.pos),t(b.scrollIntoView())}return!0}let u=r.type.spec.isolating||s>0&&c?null:X.findFrom(e,1),p=u&&u.$from.blockRange(u.$to),f=p&&In(p);if(f!=null&&f>=e.depth)return t&&t(n.tr.lift(p,f).scrollIntoView()),!0;if(d&&Cn(r,"start",!0)&&Cn(i,"end")){let h=i,g=[];for(;g.push(h),!h.isTextblock;)h=h.lastChild;let b=r,m=1;for(;!b.isTextblock;b=b.firstChild)m++;if(h.canReplace(h.childCount,h.childCount,b.content)){if(t){let y=$.empty;for(let A=g.length-1;A>=0;A--)y=$.from(g[A].copy(y));let S=n.tr.step(new xe(e.pos-g.length,e.pos+r.nodeSize,e.pos+m,e.pos+r.nodeSize-m,new z(y,g.length,0),0,!0));t(S.scrollIntoView())}return!0}}return!1}function Ec(n){return function(e,t){let s=e.selection,i=n<0?s.$from:s.$to,r=i.depth;for(;i.node(r).isInline;){if(!r)return!1;r--}return i.node(r).isTextblock?(t&&t(e.tr.setSelection(U.create(e.doc,n<0?i.start(r):i.end(r)))),!0):!1}}const iv=Ec(-1),rv=Ec(1);function ov(n,e=null){return function(t,s){let{$from:i,$to:r}=t.selection,o=i.blockRange(r),l=o&&no(o,n,e);return l?(s&&s(t.tr.wrap(o,l).scrollIntoView()),!0):!1}}function ol(n,e=null){return function(t,s){let i=!1;for(let r=0;r{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(n,e)))if(c.type==n)i=!0;else{let u=t.doc.resolve(d),p=u.index();i=u.parent.canReplaceWith(p,p+1,n)}})}if(!i)return!1;if(s){let r=t.tr;for(let o=0;o=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=o.resolve(e.start-2);r=new Ks(c,c,e.depth),e.endIndex=0;u--)r=$.from(t[u].type.create(t[u].attrs,r));n.step(new xe(e.start-(s?2:0),e.end,e.start,e.end,new z(r,0,0),t.length,!0));let o=0;for(let u=0;uo.childCount>0&&o.firstChild.type==n);return r?t?s.node(r.depth-1).type==n?uv(e,t,n,r):pv(e,t,r):!0:!1}}function uv(n,e,t,s){let i=n.tr,r=s.end,o=s.$to.end(s.depth);rb;g--)h-=i.child(g).nodeSize,s.delete(h-1,h+1);let r=s.doc.resolve(t.start),o=r.nodeAfter;if(s.mapping.map(t.end)!=t.start+r.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,c=t.endIndex==i.childCount,d=r.node(-1),u=r.index(-1);if(!d.canReplace(u+(l?0:1),u+1,o.content.append(c?$.empty:$.from(i))))return!1;let p=r.pos,f=p+o.nodeSize;return s.step(new xe(p-(l?1:0),f+(c?1:0),p+1,f-1,new z((l?$.empty:$.from(i.copy($.empty))).append(c?$.empty:$.from(i.copy($.empty))),l?0:1,c?0:1),l?0:1)),e(s.scrollIntoView()),!0}function fv(n){return function(e,t){let{$from:s,$to:i}=e.selection,r=s.blockRange(i,d=>d.childCount>0&&d.firstChild.type==n);if(!r)return!1;let o=r.startIndex;if(o==0)return!1;let l=r.parent,c=l.child(o-1);if(c.type!=n)return!1;if(t){let d=c.lastChild&&c.lastChild.type==l.type,u=$.from(d?n.create():null),p=new z($.from(n.create(null,$.from(l.type.create(null,u)))),d?3:1,0),f=r.start,h=r.end;t(e.tr.step(new xe(f-(d?3:1),h,f,h,p,1,!0)).scrollIntoView())}return!0}}const Ce=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Mn=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Mr=null;const ut=function(n,e,t){let s=Mr||(Mr=document.createRange());return s.setEnd(n,t==null?n.nodeValue.length:t),s.setStart(n,e||0),s},hv=function(){Mr=null},sn=function(n,e,t,s){return t&&(ll(n,e,t,s,-1)||ll(n,e,t,s,1))},mv=/^(img|br|input|textarea|hr)$/i;function ll(n,e,t,s,i){for(var r;;){if(n==t&&e==s)return!0;if(e==(i<0?0:Ie(n))){let o=n.parentNode;if(!o||!q(o)||ms(n)||mv.test(n.nodeName)||n.contentEditable=="false")return!1;e=Ce(n)+(i<0?0:1),n=o}else if(q(n)){let o=n.childNodes[e+(i<0?-1:0)];if(q(o)&&o.contentEditable=="false")if(!((r=o.pmViewDesc)===null||r===void 0)&&r.ignoreForSelection)e+=i;else return!1;else n=o,e=i<0?Ie(n):0}else return!1}}function Ie(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function q(n){return n.nodeType==1}function ye(n){return n.nodeType==3}function rn(n,e){return e?n.contains(q(e)?e:e.parentNode):!1}function gv(n,e){for(;;){if(ye(n)&&e)return n;if(q(n)&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=Ie(n)}else if(n.parentNode&&!ms(n))e=Ce(n),n=n.parentNode;else return null}}function bv(n,e){for(;;){if(ye(n)&&e2),Je=Tn||(it?/Mac/.test(it.platform):!1),Nc=it?/Win/.test(it.platform):!1,ft=/Android \d/.test(zt),zi=!!al&&"webkitFontSmoothing"in al.documentElement.style,xv=zi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function wv(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function ot(n,e){return typeof n=="number"?n:n[e]}function Sv(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,s=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*s}}function cl(n,e,t){if(!Or(e)&&e.left==0)return;let s=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,r=n.dom.ownerDocument;for(let o=t||n.dom;o;){if(!q(o)){o=Mn(o);continue}let l=o==r.body,c=l?wv(r):Sv(o),d=0,u=0;if(e.topc.bottom-ot(s,"bottom")&&(u=e.bottom-e.top>c.bottom-c.top?e.top+ot(i,"top")-c.top:e.bottom-c.bottom+ot(i,"bottom")),e.leftc.right-ot(s,"right")&&(d=e.right-c.right+ot(i,"right")),d||u)if(l)r.defaultView.scrollBy(d,u);else{let f=o.scrollLeft,h=o.scrollTop;u&&(o.scrollTop+=u),d&&(o.scrollLeft+=d);let g=o.scrollLeft-f,b=o.scrollTop-h;e={left:e.left-g,top:e.top-b,right:e.right-g,bottom:e.bottom-b}}let p=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(p))break;o=p=="absolute"?o.offsetParent:Mn(o)}}function Cv(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),s,i;for(let r=(e.left+e.right)/2,o=t+1;o=t-20){s=l,i=c.top;break}}return{refDOM:s,refTop:i,stack:Ic(n.dom)}}function Ic(n){let e=[],t=n.ownerDocument;for(let s=n;s&&(e.push({dom:s,top:s.scrollTop,left:s.scrollLeft}),n!=t);s=Mn(s));return e}function Mv({refDOM:n,refTop:e,stack:t}){let s=n?n.getBoundingClientRect().top:0;Dc(t,s==0?0:s-e)}function Dc(n,e){for(let t=0;t=l){o=Math.max(g.bottom,o),l=Math.min(g.top,l);let b=g.left>e.left?g.left-e.left:g.right=(g.left+g.right)/2?1:0));continue}}else g.top>e.top&&!c&&g.left<=e.left&&g.right>=e.left&&(c=u,d={left:Math.max(g.left,Math.min(g.right,e.left)),top:g.top});!t&&(e.left>=g.right&&e.top>=g.top||e.left>=g.left&&e.top>=g.bottom)&&(r=p+1)}}return!t&&c&&(t=c,i=d,s=0),t&&ye(t)?Ev(t,i):!t||s?{node:n,offset:r}:$c(t,i)}function Ev(n,e){let t=n.nodeValue.length,s=document.createRange(),i;for(let r=0;r=(o.left+o.right)/2?1:0)};break}}return s.detach(),i||{node:n,offset:0}}function ao(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function Av(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(o.left+o.right)/2?1:-1}return n.docView.posFromDOM(s,i,r)}function Nv(n,e,t,s){let i=-1;for(let r=e,o=!1;r!=n.dom;){let l=n.docView.nearestDesc(r,!0),c;if(!l)return null;if(q(l.dom)&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((c=l.dom.getBoundingClientRect()).width||c.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!o&&c.left>s.left||c.top>s.top?i=l.posBefore:(!o&&c.right-1?i:n.docView.posFromDOM(e,t,-1)}function Rc(n,e,t){let s=n.childNodes.length;if(s&&t.tope.top&&i++}let d;zi&&i&&q(s)&&q(d=s.childNodes[i-1])&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,s==n.dom&&i==s.childNodes.length-1&&q(s.lastChild)&&e.top>s.lastChild.getBoundingClientRect().bottom?l=n.state.doc.content.size:(i==0||!q(s)||s.childNodes[i-1].nodeName!="BR")&&(l=Nv(n,s,i,e))}l==null&&(l=Ov(n,o,e));let c=n.docView.nearestDesc(o,!0);return{pos:l,inside:c?c.posAtStart-c.border:-1}}function Or(n){return n.top=0&&i==s.nodeValue.length?(c--,u=1):t<0?c--:d++,Dn(xt(ut(s,c,d),u),u<0)}if(!n.state.doc.resolve(e-(r||0)).parent.inlineContent){if(r==null&&i&&(t<0||i==Ie(s))){let c=s.childNodes[i-1];if(q(c))return sr(c.getBoundingClientRect(),!1)}if(r==null&&i=0)}if(r==null&&i&&(t<0||i==Ie(s))){let c=s.childNodes[i-1],d=ye(c)?ut(c,Ie(c)-(o?0:1)):q(c)&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return Dn(xt(d,1),!1)}if(r==null&&i=0)}function Dn(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function sr(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function Pc(n,e,t){let s=n.state,i=n.root.activeElement;s!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{s!=e&&n.updateState(s),i!=n.dom&&i&&i.focus()}}function $v(n,e,t){let s=e.selection,i=t=="up"?s.$from:s.$to;return Pc(n,e,()=>{let{node:r}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let l=n.docView.nearestDesc(r,!0);if(!l)break;if(l.node.isBlock){r=l.contentDOM||l.dom;break}r=l.dom.parentNode}let o=Lc(n,i.pos,1);for(let l=r.firstChild;l;l=l.nextSibling){let c;if(q(l))c=l.getClientRects();else if(ye(l))c=ut(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;du.top+1&&(t=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const Rv=/[\u0590-\u08ac]/;function Lv(n,e,t){let{$head:s}=e.selection;if(!s.parent.isTextblock)return!1;let i=s.parentOffset,r=!i,o=i==s.parent.content.size,l=n.domSelection();return l?!Rv.test(s.parent.textContent)||!l.modify?t=="left"||t=="backward"?r:o:Pc(n,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:u,anchorOffset:p}=n.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",t,"character");let h=s.depth?n.docView.domAfterPos(s.before()):n.dom,{focusNode:g,focusOffset:b}=n.domSelectionRange(),m=g&&!rn(h,g)||c==g&&d==b;try{l.collapse(u,p),c&&(c!=u||d!=p)&&l.extend&&l.extend(c,d)}catch(y){}return f!=null&&(l.caretBidiLevel=f),m}):s.pos==s.start()||s.pos==s.end()}let dl=null,ul=null,pl=!1;function Pv(n,e,t){return dl==e&&ul==t?pl:(dl=e,ul=t,pl=t=="up"||t=="down"?$v(n,e,t):Lv(n,e,t))}const Ge=0,fl=1,Ut=2,Ze=3;class gs{constructor(e,t,s,i){this.parent=e,this.children=t,this.dom=s,this.contentDOM=i,this.dirty=Ge,s.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,s){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tCe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=!!(e.compareDocumentPosition(this.contentDOM)&4);else if(this.dom.firstChild){if(t==0)for(let r=e;;r=r.parentNode){if(r==this.dom){i=!1;break}if(r.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let r=e;;r=r.parentNode){if(r==this.dom){i=!0;break}if(r.nextSibling)break}}return(i==null?s>0:i)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let s=!0,i=e;i;i=i.parentNode){let r=this.getDesc(i),o;if(r&&(!t||r.node))if(s&&(o=r.nodeDOM)&&!(q(o)?rn(o,e):o==e))s=!1;else return r}}getDesc(e){let t=e.pmViewDesc;for(let s=t;s;s=s.parent)if(s==this)return t}posFromDOM(e,t,s){for(let i=e;i;i=i.parentNode){let r=this.getDesc(i);if(r)return r.localPosFromDOM(e,t,s)}return-1}descAt(e){for(let t=0,s=0;te){i=e-r;break}r=l}if(i)return this.children[s].domFromPos(i-this.children[s].border,t);for(;s>0;s--){let r=this.children[s-1];if(r.size||!(r instanceof _c||r instanceof Bc&&r.side>=0))break}if(t<=0){let r,o=!0;for(;r=s?this.children[s-1]:null,!(!r||r.dom.parentNode==this.contentDOM);s--,o=!1);return r&&t&&o&&!r.border&&!r.domAtom?r.domFromPos(r.size,t):{node:this.contentDOM,offset:r?Ce(r.dom)+1:0}}else{let r,o=!0;for(;r=s=u&&t<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,t,u);e=o;for(let p=l;p>0;p--){let f=this.children[p-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=Ce(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(d>t||l==this.children.length-1)){t=d;for(let u=l+1;ug&&ot){let g=l;l=c,c=g}let h=document.createRange();h.setEnd(c.node,c.offset),h.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let s=0,i=0;i=s:es){let l=s+r.border,c=o-r.border;if(e>=l&&t<=c){this.dirty=e==s||t==o?Ut:fl,e==l&&t==c&&(r.contentLost||r.dom.parentNode!=this.contentDOM)?r.dirty=Ze:r.markDirty(e-l,t-l);return}else r.dirty=r.dom==r.contentDOM&&r.dom.parentNode==this.contentDOM&&!r.children.length?Ut:Ze}s=o}this.dirty=Ut}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let s=e==1?Ut:fl;t.dirty{if(!r)return i;if(r.parent)return r.parent.posBeforeChild(r)})),!t.type.spec.raw){let l=q(o)?o:document.createElement("span");l!=o&&l.appendChild(o),l.hasAttribute("contenteditable")||(l.contentEditable="false"),l.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,r=this}matchesWidget(e){return this.dirty==Ge&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Bv extends gs{constructor(e,t,s,i){super(e,[],t,null),this.textDOM=s,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class It extends gs{constructor(e,t,s,i,r){super(e,[],s,i),this.mark=t,this.spec=r}static create(e,t,s,i){let r=i.nodeViews[t.type.name],o=r&&r(t,i,s);return(!o||!o.dom)&&(o=ln.renderSpec(document,t.type.spec.toDOM(t,s),null,t.attrs)),new It(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Ze||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ze&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Ge){let s=this.parent;for(;!s.node;)s=s.parent;s.dirty0&&(r=Ir(r,0,e,s));for(let l=0;l{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},s,i),u=d&&d.dom,p=d&&d.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(!ye(u))throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:p}=ln.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!p&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Fc(u,s,t),d?c=new _v(e,t,s,i,u,p||null,f,d):t.isText?new ji(e,t,s,i,u,f):new Dt(e,t,s,i,u,p||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let s=this.children.length-1;s>=0;s--){let i=this.children[s];if(this.dom.contains(i.dom.parentNode)){t.contentElement=i.dom.parentNode;break}}if(!t.contentElement){let s=e&&e.find(i=>q(i)&&e.indexOf(i.parentNode)<0&&this.dom.contains(i));s?t.contentElement=s:t.getContent=()=>$.empty}}return t}matchesNode(e,t,s){return this.dirty==Ge&&e.eq(this.node)&&Gs(t,this.outerDeco)&&s.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let s=this.node.inlineContent,i=t,r=e.composing?this.localCompositionInfo(e,t):null,o=r&&r.pos>-1?r:null,l=r&&r.pos<0,c=new jv(this,o&&o.node,e),d=this.node.inlineContent,u=d&&this.node.isBlock;Hv(this.node,this.innerDeco,(p,f,h)=>{p.spec.marks?c.syncToMarks(p.spec.marks,s,e,f):p.type.side>=0&&!h&&c.syncToMarks(f==this.node.childCount?ie.none:this.node.child(f).marks,s,e,f),c.placeWidget(p,e,i)},(p,f,h,g)=>{c.syncToMarks(p.marks,s,e,g),u&&p.isAtom&&!p.isText&&c.addHackNode("IMG",c.top);let b;c.findNodeMatch(p,f,h,g)||l&&e.state.selection.from>i&&e.state.selection.to-1&&c.updateNodeAt(p,f,h,b,e)||c.updateNextNode(p,f,h,e,g,i)||c.addNode(p,f,h,e,i),i+=p.nodeSize,d&&(u=p.isAtom&&!p.isText)}),c.syncToMarks([],s,e,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Ut)&&(o&&this.protectLocalComposition(e,o),zc(this.contentDOM,this.children,e),Tn&&qv(this.dom))}localCompositionInfo(e,t){let{from:s,to:i}=e.state.selection;if(!(e.state.selection instanceof U)||st+this.node.content.size)return null;let r=e.input.compositionNode;if(!r||!this.dom.contains(r.parentNode))return null;if(this.node.inlineContent){let o=r.nodeValue,l=Uv(this.node.content,o,s-t,i-t);return l<0?null:{node:r,pos:l,text:o}}else return{node:r,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:s,text:i}){if(this.getDesc(t))return;let r=t;for(;r.parentNode!=this.contentDOM;r=r.parentNode){for(;r.previousSibling;)r.parentNode.removeChild(r.previousSibling);for(;r.nextSibling;)r.parentNode.removeChild(r.nextSibling);r.pmViewDesc&&(r.pmViewDesc=void 0)}let o=new Bv(this,r,t,i);e.input.compositionNodes.push(o),this.children=Ir(this.children,s,s+i.length,e,o)}update(e,t,s,i){return this.dirty==Ze||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,s,i),!0)}updateInner(e,t,s,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=s,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Ge}updateOuterDeco(e){if(Gs(e,this.outerDeco))return;let t=!q(this.nodeDOM),s=this.dom;this.dom=jc(this.dom,this.nodeDOM,Nr(this.outerDeco,this.node,t),Nr(e,this.node,t)),this.dom!=s&&(s.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){q(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){q(this.nodeDOM)&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function hl(n,e,t,s,i){Fc(s,e,n);let r=new Dt(void 0,n,e,t,s,s,s);return r.contentDOM&&r.updateChildren(i,0),r}class ji extends Dt{constructor(e,t,s,i,r,o){super(e,t,s,i,r,null,o)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,s,i){return this.dirty==Ze||this.dirty!=Ge&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Ge||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Ge,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,s){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,s)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,s){let i=this.node.cut(e,t),r=document.createTextNode(i.text);return new ji(this.parent,i,this.outerDeco,this.innerDeco,r,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Ze)}get domAtom(){return!1}isText(e){return this.node.text==e}}class _c extends gs{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ge&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class _v extends Dt{constructor(e,t,s,i,r,o,l,c){super(e,t,s,i,r,o,l),this.spec=c}update(e,t,s,i){if(this.dirty==Ze)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let r=this.spec.update(e,t,s);return r&&this.updateInner(e,t,s,i),r}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,s,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,s,i){this.spec.setSelection?this.spec.setSelection(e,t,s.root):super.setSelection(e,t,s,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function zc(n,e,t){let s=n.firstChild,i=!1;for(let r=0;r>1,l=Math.min(o,e.length);for(;r-1)c>this.index&&(this.changed=!0,this.destroyBetween(this.index,c)),this.top=this.top.children[this.index];else{let u=It.create(this.top,e[o],t,s);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,s,i){let r=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,s))r=this.top.children.indexOf(o,this.index);else for(let l=this.index,c=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(s){let d=t.children[s-1];if(d instanceof It)t=d,s=d.children.length;else{l=d,s--;break}}else{if(t==e)break e;s=t.parent.children.indexOf(t),t=t.parent}let c=l.node;if(c){if(c!=n.child(i-1))break;--i,r.set(l,i),o.push(l)}}return{index:i,matched:r,matches:o.reverse()}}function Vv(n,e){return n.type.side-e.type.side}function Hv(n,e,t,s){let i=e.locals(n),r=0;if(i.length==0){for(let d=0;dr;)l.push(i[o++]);let g=r+f.nodeSize;if(f.isText){let m=g;o!m.inline):l.slice();s(f,b,e.forChild(r,f),h),r=g}}function qv(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function Uv(n,e,t,s){for(let i=0,r=0;i=t){if(r>=s&&c.slice(s-e.length-l,s-l)==e)return s-e.length;let d=l=0&&d+e.length+l>=t)return l+d;if(t==s&&c.length>=s+e.length-l&&c.slice(s-l,s-l+e.length)==e)return s}}return-1}function Ir(n,e,t,s,i){let r=[];for(let o=0,l=0;o=t||u<=e?r.push(c):(dt&&r.push(c.slice(t-d,c.size,s)))}return r}function co(n,e=null){let t=n.domSelectionRange(),s=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),r=i&&i.size==0,o=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let l=s.resolve(o),c,d;if(_i(t)){for(c=o;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&W.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&yv(t.focusNode,t.focusOffset,i.dom))){let p=i.posBefore;d=new W(o==p?l:s.resolve(p))}else if(Ue&&e=="key"&&o>n.state.selection.to&&q(t.focusNode)&&t.focusOffset==t.focusNode.childNodes.length&&i&&i.posAtStart>n.state.selection.to)for(let p=t.focusNode;;p=p.parentNode){if(getComputedStyle(p).overflow!="visible"){d=X.findFrom(s.resolve(i.posAtStart),1);break}if(p==i.dom||p.nextSibling||!p.parentNode||!q(p.parentNode))break}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let p=o,f=o;for(let h=0;h{(t.anchorNode!=s||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Vc(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function Kv(n){let e=n.domSelection();if(!e)return;let t=n.cursorWrapper.dom,s=t.nodeName=="IMG";s?e.collapse(t.parentNode,Ce(t)+1):e.collapse(t,0),!s&&!n.state.selection.visible&&je&&Nt<=11&&(t.disabled=!0,t.disabled=!1)}function Hc(n,e){if(e instanceof W){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(vl(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else vl(n)}function vl(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function uo(n,e,t,s){return n.someProp("createSelectionBetween",i=>i(n,e,t))||U.between(e,t,s)}function kl(n){return n.editable&&!n.hasFocus()?!1:qc(n)}function qc(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return rn(n.dom,e.anchorNode)&&(n.editable||rn(n.dom,e.focusNode))}catch(t){return!1}}function Jv(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return sn(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Dr(n,e){let{$anchor:t,$head:s}=n.selection,i=e>0?t.max(s):t.min(s),r=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return r&&X.findFrom(r,e)}function wt(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function xl(n,e,t){let s=n.state.selection;if(s instanceof U)if(t.indexOf("s")>-1){let{$head:i}=s,r=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!r||r.isText||!r.isLeaf)return!1;let o=n.state.doc.resolve(i.pos+r.nodeSize*(e<0?-1:1));return wt(n,new U(s.$anchor,o))}else if(s.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=Dr(n.state,e);return i&&i instanceof W?wt(n,i):!1}else if(!(Je&&t.indexOf("m")>-1)){let i=s.$head,r=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!r||r.isText)return!1;let l=e<0?i.pos-r.nodeSize:i.pos;return r.isAtom||(o=n.docView.descAt(l))&&!o.contentDOM?W.isSelectable(r)?wt(n,new W(e<0?n.state.doc.resolve(i.pos-r.nodeSize):i)):wt(n,new U(n.state.doc.resolve(e<0?l:l+r.nodeSize))):!1}}else return!1;else{if(s instanceof W&&s.node.isInline)return wt(n,new U(e>0?s.$to:s.$from));{let i=Dr(n.state,e);return i?wt(n,i):!1}}}function Un(n,e){let t=n.pmViewDesc;return t?t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR"):q(n)&&n.contentEditable=="false"}function pn(n,e){return e<0?Gv(n):Yv(n)}function Gv(n){let e=n.domSelectionRange(),t=e.focusNode,s=e.focusOffset;if(!t)return;let i,r,o=!1;for(Ue&&q(t)&&s0){if(!q(t))break;let l=t.childNodes[s-1];if(Un(l,-1))i=t,r=--s;else if(ye(l))t=l,s=t.nodeValue.length;else break}else{if(Uc(t))break;{let l=t.previousSibling;for(;l&&Un(l,-1);)i=t.parentNode,r=Ce(l),l=l.previousSibling;if(l)t=l,s=Ie(t);else{if(t=t.parentNode,t==n.dom)break;s=0}}}o?$r(n,t,s):i&&$r(n,i,r)}function Yv(n){let e=n.domSelectionRange(),t=e.focusNode,s=e.focusOffset;if(!t)return;let i=Ie(t),r,o;for(;;)if(s{n.state==i&>(n)},50)}function wl(n,e){let t=n.state.doc.resolve(e);if(!(Ee||Nc)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let r=n.coordsAtPos(e-1),o=(r.top+r.bottom)/2;if(o>i.top&&o1)return r.lefti.top&&o1)return r.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function Sl(n,e,t){let s=n.state.selection;if(s instanceof U&&!s.empty||t.indexOf("s")>-1||Je&&t.indexOf("m")>-1)return!1;let{$from:i,$to:r}=s;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let o=Dr(n.state,e);if(o&&o instanceof W)return wt(n,o)}if(!i.parent.inlineContent){let o=e<0?i:r,l=s instanceof qe?X.near(o,e):X.findFrom(o,e);return l?wt(n,l):!1}return!1}function Cl(n,e){if(!(n.state.selection instanceof U))return!0;let{$head:t,$anchor:s,empty:i}=n.state.selection;if(!t.sameParent(s))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let r=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(r&&!r.isText){let o=n.state.tr;return e<0?o.delete(t.pos-r.nodeSize,t.pos):o.delete(t.pos,t.pos+r.nodeSize),n.dispatch(o),!0}return!1}function Ml(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function Qv(n){if(!$e||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&q(e)&&t==0&&e.firstChild&&q(e.firstChild)&&e.firstChild.contentEditable=="false"){let s=e.firstChild;Ml(n,s,"true"),setTimeout(()=>Ml(n,s,"false"),20)}return!1}function e0(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function t0(n,e){let t=e.keyCode,s=e0(e);if(t==8||Je&&t==72&&s=="c")return Cl(n,-1)||pn(n,-1);if(t==46&&!e.shiftKey||Je&&t==68&&s=="c")return Cl(n,1)||pn(n,1);if(t==13||t==27)return!0;if(t==37||Je&&t==66&&s=="c"){let i=t==37?wl(n,n.state.selection.from)=="ltr"?-1:1:-1;return xl(n,i,s)||pn(n,i)}else if(t==39||Je&&t==70&&s=="c"){let i=t==39?wl(n,n.state.selection.from)=="ltr"?1:-1:1;return xl(n,i,s)||pn(n,i)}else{if(t==38||Je&&t==80&&s=="c")return Sl(n,-1,s)||pn(n,-1);if(t==40||Je&&t==78&&s=="c")return Qv(n)||Sl(n,1,s)||pn(n,1);if(s==(Je?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function po(n,e){n.someProp("transformCopied",h=>{e=h(e,n)});let t=[],{content:s,openStart:i,openEnd:r}=e;for(;i>1&&r>1&&s.childCount==1&&s.firstChild.childCount==1;){i--,r--;let h=s.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),s=h.content}let o=n.someProp("clipboardSerializer")||ln.fromSchema(n.state.schema),l=Xc(),c=l.createElement("div");c.appendChild(o.serializeFragment(s,{document:l}));let d=c.firstChild,u,p=0;for(;d&&q(d)&&(u=Yc[d.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let g=l.createElement(u[h]);for(;c.firstChild;)g.appendChild(c.firstChild);c.appendChild(g),p++}d=c.firstChild}d&&q(d)&&d.setAttribute("data-pm-slice",`${i} ${r}${p?` -${p}`:""} ${JSON.stringify(t)}`);let f=n.someProp("clipboardTextSerializer",h=>h(e,n))||e.content.textBetween(0,e.content.size,` +`),x:300,y:(s-(n.length-1)/2)*120,itemStyle:{color:"#e3efe8",borderColor:"#8ebaa6",borderWidth:1},label:{color:"#213f48"}}))],n.map(t=>({source:"platform",target:"home:"+t.id})))}const ap={class:"local-chart-wrap"},cp=["aria-label"],dp={key:0,class:"small text-secondary px-3",role:"status"},wn={__name:"LocalChart",props:{option:{type:Object,required:!0},label:String,active:{type:Boolean,default:!0},height:{type:Number,default:260}},emits:["select"],setup(n,{emit:e}){const t=n,s=e,i=P(null),r=P(!1);let o,l,c,d,u=!0,p=!1,f="",h="";function g(){o==null||o.dispose(),o=null,f="",h=""}function b(){!d&&u&&(d=requestAnimationFrame(()=>{d=null,m()}))}async function m(){if(!u||!i.value||!t.active){g();return}const v=Math.floor(i.value.clientWidth),S=Math.floor(i.value.clientHeight);if(!v||!S)return;if(!o){if(p)return;p=!0;try{const T=await Nu(()=>import("./charts-runtime-DBCaHPDW.js"),[]);if(!u||!t.active||!i.value)return;o=T.init(i.value,null,{renderer:"canvas",devicePixelRatio:Math.min(window.devicePixelRatio||1,2)}),o.on("click",N=>{var I;(I=N.data)!=null&&I.targetId&&s("select",N.data.targetId)}),r.value=!1}catch(T){r.value=!0,console.error("Local chart unavailable",T);return}finally{p=!1}}const A=getComputedStyle(document.documentElement),O=A.getPropertyValue("--ink").trim()||"#253b46",B=A.getPropertyValue("--ui-muted").trim()||"#627485",E=A.getPropertyValue("--ui-line").trim()||"#e3e9ef",M=JSON.stringify(t.option)+O+B+E;if(M!==f){const T={...t.option,animation:!1,backgroundColor:"transparent",textStyle:{color:O,fontFamily:"system-ui, Microsoft YaHei, sans-serif"},aria:{enabled:!0,description:t.label},tooltip:{trigger:"item",renderMode:"richText",confine:!0,...t.option.tooltip}};for(const N of["xAxis","yAxis"])T[N]&&(T[N]={...T[N],axisLabel:{color:B,...T[N].axisLabel},splitLine:{lineStyle:{color:E}}});T.series=(T.series||[]).map(N=>({...N,label:{color:O,...N.label}})),o.setOption(T,{notMerge:!0,lazyUpdate:!1}),f=M}const w=v+":"+S;w!==h&&(o.resize({width:v,height:S}),h=w)}return Ae(()=>[t.option,t.active],b,{deep:!0,flush:"post"}),$i(()=>{l=new ResizeObserver(b),l.observe(i.value),c=new MutationObserver(b),c.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","data-density"]}),b()}),Bt(()=>{u=!1,cancelAnimationFrame(d),l==null||l.disconnect(),c==null||c.disconnect(),g()}),(v,S)=>(y(),x("div",ap,[a("div",{ref_key:"host",ref:i,class:"local-chart",role:"img","aria-label":n.label,style:Nn({height:n.height+"px"})},null,12,cp),r.value?(y(),x("p",dp,"图表暂未加载,可查看下方数据。")):D("",!0)]))}},up={class:"col-12 col-xl-4"},pp={class:"dashboard-welcome h-100"},fp={class:"dashboard-totals"},hp={class:"insight-scope"},mp={class:"col-12 d-md-none"},gp=["aria-expanded"],bp={class:"col-12 col-md-5 col-xl-3 dashboard-chart-column"},vp={class:"chart-card h-100"},yp={class:"chart-heading"},kp={class:"badge"},xp={key:1,class:"chart-empty"},wp={class:"chart-legend"},Sp={class:"col-12 col-md-7 col-xl-5 dashboard-chart-column"},Cp={class:"chart-card h-100"},Mp={key:1,class:"chart-empty"},Tp={key:2,class:"chart-data"},Ep={__name:"HomeInsights",setup(n){const e=ee(()=>ip(R.value.state.households)),t=P(!1),s=ee(()=>R.value.loggedIn&&R.value.page==="households"),i=ee(()=>(R.value.state.households||[]).map(r=>({label:r.name,count:r.deviceCount||0})).sort((r,o)=>o.count-r.count).slice(0,8));return(r,o)=>(y(),x("section",{class:De(["dashboard-grid row g-3 mb-4",{"charts-expanded":t.value}]),"aria-label":"已授权场所概览"},[a("div",up,[a("article",pp,[o[5]||(o[5]=a("span",{class:"insight-kicker"},"一处相连 · 各有归属",-1)),o[6]||(o[6]=a("h2",null,"家与日常,尽在掌握",-1)),o[7]||(o[7]=a("p",null,"从一处灯火,连接生活的每个空间。",-1)),a("div",fp,[a("div",null,[a("strong",null,k(e.value.total),1),o[1]||(o[1]=a("span",null,"家庭与场所",-1))]),a("div",null,[a("strong",null,k(e.value.devices),1),o[2]||(o[2]=a("span",null,"已登记设备",-1))]),a("div",null,[a("strong",null,k(e.value.areas),1),o[3]||(o[3]=a("span",null,"区域空间",-1))])]),a("div",hp,[G(be,{name:"shield"}),o[4]||(o[4]=C(" 仅汇总你有权访问的家庭与场所",-1))])])]),a("div",mp,[a("button",{class:"btn btn-outline-secondary w-100","aria-expanded":t.value,onClick:o[0]||(o[0]=l=>t.value=!t.value)},k(t.value?"收起图表统计":"展开图表统计"),9,gp)]),a("div",bp,[a("article",vp,[a("div",yp,[o[8]||(o[8]=a("h3",null,"空间分布",-1)),a("span",kp,k(e.value.total)+" 处",1)]),e.value.total?(y(),Qe(wn,{key:0,option:j(Na)(e.value.kinds),active:s.value,height:160,label:"场所分布:"+e.value.kinds.map(l=>l.label+l.count+"个").join(",")},null,8,["option","active","label"])):(y(),x("p",xp,"添加家庭或场所后显示分布")),a("div",wp,[(y(!0),x(H,null,J(e.value.kinds,l=>(y(),x("span",{key:l.key},[a("i",{style:Nn({background:l.color})},null,4),C(k(l.label)+" ",1),a("b",null,k(l.count),1)]))),128))])])]),a("div",Sp,[a("article",Cp,[o[10]||(o[10]=a("div",{class:"chart-heading"},[a("h3",null,"设备分布"),a("span",{class:"small text-secondary"},"按场所 · 最多显示 8 处")],-1)),i.value.length?(y(),Qe(wn,{key:0,option:j(Ia)(i.value),active:s.value,height:190,label:"各场所已登记设备:"+i.value.map(l=>l.label+l.count+"台").join(",")},null,8,["option","active","label"])):(y(),x("p",Mp,"暂无已授权场所")),i.value.length?(y(),x("details",Tp,[o[9]||(o[9]=a("summary",null,"查看统计数字",-1)),a("ul",null,[(y(!0),x(H,null,J(i.value,l=>(y(),x("li",{key:l.label},k(l.label)+":"+k(l.count)+" 台",1))),128))])])):D("",!0)])])],2))}},Ap={key:0,class:"panel","aria-label":"按世代浏览家庭"},Op={class:"d-flex justify-content-between align-items-start flex-wrap gap-3"},Np={key:0,class:"count-pill"},Ip={class:"mb-3"},Dp=["disabled"],$p={key:0,class:"alert alert-danger",role:"alert"},Rp={key:1,role:"status",class:"text-secondary"},Lp={class:"fw-semibold"},Pp={key:0,class:"mt-3 text-secondary"},Bp={key:0,class:"fs-6"},_p={class:"fw-semibold text-primary"},zp={class:"fw-normal text-secondary ms-2"},jp={class:"row g-3 mt-1"},Fp={class:"card-body"},Vp=["disabled","onClick"],Hp={key:0,class:"badge text-bg-primary ms-2"},qp={key:1,class:"text-secondary ms-2"},Up={class:"small text-secondary mt-2 mb-0"},Wp={class:"d-flex flex-wrap gap-2 mt-3"},Kp=["onClick"],Jp={key:0,class:"small text-secondary"},Gp={class:"d-flex flex-wrap gap-2 mt-3"},Yp=["disabled","onClick"],Xp={key:2,class:"mt-3"},Zp={class:"d-flex flex-wrap gap-2 mt-2"},Qp=["disabled","onClick"],ef={key:2,class:"text-secondary",role:"status"},tf={key:3,class:"alert alert-info"},nf={key:4,class:"border rounded p-3",open:""},sf={class:"d-flex flex-wrap gap-2 mt-3"},rf=["onClick"],of={key:5,class:"small text-secondary mt-3 mb-0"},lf={__name:"GenerationDirectory",props:{active:Boolean},setup(n){const e=n,t=P(null),s=P(""),i=P(""),r=P(!1);let o=0;async function l(){const h=++o;if(t.value=null,s.value="",i.value="",r.value=!1,!(!e.active||!R.value.loggedIn))try{const g=await K().api("/api/family-directory");h===o&&(t.value=g)}catch(g){h===o&&(s.value=g.message)}}Ae(()=>[e.active,R.value.loggedIn,R.value.session],l,{immediate:!0});const c=h=>h?(h<=10?["","一","二","三","四","五","六","七","八","九","十"][h]:"第"+h)+"世":"世次待考",d=h=>[...new Set(h.map(g=>g.generation))],u=ee(()=>{var g;const h=i.value.trim().toLocaleLowerCase();return(((g=t.value)==null?void 0:g.trees)||[]).map(b=>({...b,branches:b.branches.map(m=>({...m,people:m.people.filter(v=>!h||[v.name,...v.homes.map(S=>S.name)].join(" ").toLocaleLowerCase().includes(h))})).filter(m=>m.people.length)})).filter(b=>!h||b.branches.length)}),p=ee(()=>{var h;return new Set((((h=t.value)==null?void 0:h.trees)||[]).flatMap(g=>g.branches.flatMap(b=>b.people.map(m=>m.id)))).size});async function f(h,g,b=!1){if(r.value)return;const m=o;r.value=!0,s.value="";try{b?await K().viewMemberHistory(h.id,h.name,g):await K().viewPerson(h.id,g)}catch(v){m===o&&!v.stale&&(s.value=v.message)}finally{m===o&&(r.value=!1)}}return(h,g)=>{var b,m;return n.active?(y(),x("section",Ap,[a("div",Op,[a("div",null,[a("h2",null,[g[1]||(g[1]=C("家族世代 ",-1)),t.value?(y(),x("span",Np,k(p.value)+" 位家人",1)):D("",!0)]),g[2]||(g[2]=a("p",{class:"text-secondary"},"从长辈到晚辈,查看每个人的亲属、故事与家庭。一个家庭可以包含多代人。",-1))]),a("label",Ip,[g[3]||(g[3]=C("找家人",-1)),Y(a("input",{"onUpdate:modelValue":g[0]||(g[0]=v=>i.value=v),type:"search",class:"form-control",placeholder:"姓名或家庭名称",disabled:!t.value},null,8,Dp),[[At,i.value]])])]),g[7]||(g[7]=a("p",{class:"small text-secondary"},"一世从本支已知最早一代相对起算,不代表历史族谱中的绝对世次。未连接的分支分别展示,关系不足时标为“世次待考”。",-1)),s.value?(y(),x("div",$p,[C(k(s.value)+" ",1),a("button",{class:"btn btn-sm btn-outline-danger ms-2",onClick:l},"重新加载")])):t.value?D("",!0):(y(),x("p",Rp,"正在整理世代关系…")),(y(!0),x(H,null,J(u.value,v=>(y(),x("details",{key:v.id,class:"border rounded p-3 mb-3",open:""},[a("summary",Lp,"共用族谱 · "+k(v.homes.map(S=>S.name).join("、")),1),v.branches.length?D("",!0):(y(),x("p",Pp,"请先登记家庭成员,再连接亲属关系。")),(y(!0),x(H,null,J(v.branches,(S,A)=>{var O;return y(),x("section",{key:S.id,class:"mt-4"},[v.branches.length>1?(y(),x("h3",Bp,"分支 "+k(A+1)+" · "+k((O=S.people[0])==null?void 0:O.name),1)):D("",!0),(y(!0),x(H,null,J(d(S.people),B=>(y(),x("details",{key:B||"unknown",class:"border-start ps-3 mb-4",open:""},[a("summary",_p,[C(k(c(B))+" ",1),a("small",zp,k(S.people.filter(E=>E.generation===B).length)+" 人",1)]),a("div",jp,[(y(!0),x(H,null,J(S.people.filter(E=>E.generation===B),E=>{var M;return y(),x("article",{key:E.id,class:"col-12 col-md-6 col-xl-4"},[a("div",{class:De(["card h-100",{"border-primary bg-primary-subtle":E.self}])},[a("div",Fp,[a("button",{class:"btn btn-link p-0 fw-semibold fs-5 text-start",disabled:r.value,onClick:w=>f(E,v.familyId)},k(E.name),9,Vp),E.self?(y(),x("span",Hp,"本人")):D("",!0),E.lifeStatus==="deceased"?(y(),x("small",qp,"已故")):D("",!0),a("p",Up,k(E.self?"当前账号关联的家人":"人物档案 · 亲属关系 · 生平"),1),a("div",Wp,[(y(!0),x(H,null,J(E.homes,w=>(y(),x("button",{key:w.id,class:"btn btn-sm btn-outline-primary",onClick:T=>j(K)().enterHome(w.id)},k(w.name)+" →",9,Kp))),128)),E.homes.length?D("",!0):(y(),x("span",Jp,"暂无可访问的当前家庭关联"))]),a("div",Gp,[a("button",{class:"btn btn-sm btn-outline-primary",disabled:r.value,onClick:w=>f(E,v.familyId)},"查看人物与亲属",8,Yp)]),(M=E.journalHomes)!=null&&M.length?(y(),x("details",Xp,[g[4]||(g[4]=a("summary",{class:"small"},"个人阅历",-1)),a("div",Zp,[(y(!0),x(H,null,J(E.journalHomes,w=>(y(),x("button",{key:w.id,class:"btn btn-sm btn-outline-secondary",disabled:r.value,onClick:T=>f(E,w.id,!0)},k(w.name)+"的记事",9,Qp))),128))]),g[5]||(g[5]=a("p",{class:"small text-secondary mt-2 mb-0"},"按记事所属家庭查看,仅展示已授权的内容。",-1))])):D("",!0)])],2)])}),128))])]))),128))])}),128))]))),128)),t.value&&i.value.trim()&&!u.value.length?(y(),x("p",ef,"没有找到这位家人,可尝试其他姓名或清空搜索。")):D("",!0),t.value&&!t.value.trees.length?(y(),x("p",tf,"暂无可查看的家族资料。进入下方已授权家庭登记成员,或请家庭管理员授予族谱查看权限。")):D("",!0),(m=(b=t.value)==null?void 0:b.unplaced)!=null&&m.length?(y(),x("details",nf,[g[6]||(g[6]=a("summary",null,"我的家庭与其他场所",-1)),a("div",sf,[(y(!0),x(H,null,J(t.value.unplaced,v=>(y(),x("button",{key:v.id,class:"btn btn-outline-secondary",onClick:S=>j(K)().enterHome(v.id)},k(v.name)+" →",9,rf))),128))])])):D("",!0),t.value?(y(),x("p",of,"家人无需注册账号。人物档案沿用同一份,居住地址不决定亲属关系;这里仅展示你有权查看的资料。")):D("",!0)])):D("",!0)}}},af={id:"page-households",class:"page"},cf={class:"section-head"},df=["hidden"],uf={class:"btn-group",role:"group","aria-label":"浏览方式"},pf=["aria-pressed"],ff=["aria-pressed"],hf=["aria-pressed"],mf=["aria-expanded"],gf={id:"home-layout-options",class:"home-layout-controls"},bf=["disabled"],vf=["value"],yf=["disabled"],kf=["value"],xf={class:"inline-check"},wf=["disabled"],Sf={class:"inline-check"},Cf=["disabled"],Mf=["disabled"],Tf=["disabled"],Ef={key:0,class:"group-title"},Af={class:"home-card-grid"},Of=["draggable","onDragstart","onDrop"],Nf={class:"home-cover"},If=["src","alt"],Df={class:"home-cover-content"},$f={class:"site-heading"},Rf={class:"badge"},Lf=["data-edit-household"],Pf={class:"home-location"},Bf={class:"card-body"},_f={key:0,class:"home-order-actions"},zf=["disabled","aria-label","onClick"],jf=["disabled","aria-label","onClick"],Ff={class:"home-summary"},Vf={class:"home-numbers"},Hf={class:"compact-details"},qf={class:"home-card-actions"},Uf=["onClick"],Wf=["data-leadership"],Kf={key:0,class:"empty"},Jf={id:"home-global-topology",class:"network-overview"},Gf={class:"network-platform"},Yf={key:0,class:"chart-network-surface mb-3"},Xf={class:"platform-place-grid"},Zf=["onClick"],Qf={class:"badge"},eh={class:"home-pagination"},th={id:"home-page-info"},nh=["disabled"],sh=["disabled"],ih={__name:"HomeExplorer",setup(n){const e=P({revision:0,columns:2,rows:2,groupCity:!1,order:[]}),t=P(!1),s=P(!1),i=P(0),r=P(!1),o=P("generations"),l=P(!1),c=P(""),d=P("");let u="";Ae(R,E=>{var w;const M=((w=E.user)==null?void 0:w.id)+":"+E.session;u!==M&&(u=M,t.value=!1,s.value=!1,i.value=0,r.value=!1,o.value="generations",l.value=!1,c.value="",d.value=""),!t.value&&!s.value&&(e.value={revision:0,columns:2,rows:2,groupCity:!1,order:[],...E.state.householdLayout})},{immediate:!0});const p=ee(()=>{const E=R.value.state.households||[],M=new Map(E.map(w=>[w.id,w]));return[...new Set([...e.value.order,...E.map(w=>w.id)])].filter(w=>M.has(w)).map(w=>M.get(w))}),f=ee(()=>e.value.columns*e.value.rows),h=ee(()=>Math.max(1,Math.ceil(p.value.length/f.value)));Ae(h,E=>i.value=Math.min(i.value,E-1));const g=ee(()=>{var w;const E=p.value.slice(i.value*f.value,(i.value+1)*f.value);if(!e.value.groupCity)return[{name:"",items:E}];const M=new Map;for(const T of E){const N=[((w=T.geography)==null?void 0:w.country)||T.country,T.province,T.city||"地区待填写"].filter(Boolean).join(" / ");M.has(N)||M.set(N,[]),M.get(N).push(T)}return[...M].map(([T,N])=>({name:T,items:N}))}),b=E=>({home:"家庭",office:"办公场所",factory:"工厂"})[E.kind||"home"]||"场所",m=E=>{var M,w;return((w=(M=K()).address)==null?void 0:w.call(M,E))||[E.province,E.city,E.district].filter(Boolean).join(" · ")||"地区待填写"};function v(){t.value=!0,i.value=0,e.value.groupCity&&(r.value=!1),d.value="布局已调整,保存后下次登录会沿用。"}function S(E,M,w){if(s.value)return;const T=p.value.map(Z=>Z.id),N=T.indexOf(E),I=w?T.indexOf(w):N+M;N<0||I<0||I>=T.length||N===I||(T.splice(N,1),T.splice(I,0,E),e.value.order=T,t.value=!0,i.value=Math.floor(I/f.value))}function A(){t.value=!1,e.value={...R.value.state.householdLayout},i.value=0,d.value=""}async function O(){const E=u;s.value=!0;try{const M=await K().saveLayout({...e.value});if(E!==u)return;e.value=M,t.value=!1,d.value="布局与卡片顺序已保存"}catch(M){!M.stale&&E===u&&(d.value=M.message)}finally{E===u&&(s.value=!1)}}async function B(E,M=!1){await K().enterHome(E.id,M)}return(E,M)=>(y(),x("section",af,[a("div",cf,[M[13]||(M[13]=a("div",null,[a("h2",null," 家人与家庭 "),a("p",{class:"description mb-0"}," 以家人为起点,串起亲属关系、共同记忆与日常生活。 ")],-1)),a("button",{id:"new-household",class:"btn btn-primary",hidden:!j(R).platformAdmin}," + 新建家庭或场所 ",8,df)]),a("div",{class:De(["home-toolbar",{"home-options-open":l.value}])},[a("div",uf,[a("button",{class:De(["btn btn-outline-secondary",{active:o.value==="generations"}]),"aria-pressed":o.value==="generations",onClick:M[0]||(M[0]=w=>o.value="generations")},[G(be,{name:"tree"}),M[14]||(M[14]=C(" 家族世代",-1))],10,pf),a("button",{id:"home-card-view",class:De(["btn btn-outline-secondary",{active:o.value==="cards"}]),"aria-pressed":o.value==="cards",onClick:M[1]||(M[1]=w=>o.value="cards")},[G(be,{name:"grid"}),M[15]||(M[15]=C(" 家庭卡片",-1))],10,ff),a("button",{id:"home-topology-view",class:De(["btn btn-outline-secondary",{active:o.value==="topology"}]),"aria-pressed":o.value==="topology",onClick:M[2]||(M[2]=w=>o.value="topology")},[G(be,{name:"network"}),M[16]||(M[16]=C(" 场所网络 ",-1))],10,hf)]),Y(a("button",{class:"btn btn-outline-secondary home-layout-toggle","aria-expanded":l.value,"aria-controls":"home-layout-options",onClick:M[3]||(M[3]=w=>l.value=!l.value)},k(l.value?"收起设置":"布局设置"),9,mf),[[dn,o.value==="cards"]]),Y(a("div",gf,[a("label",null,[M[17]||(M[17]=C("每页 ",-1)),Y(a("select",{id:"home-columns","onUpdate:modelValue":M[4]||(M[4]=w=>e.value.columns=w),class:"form-select",disabled:s.value,onChange:v},[(y(),x(H,null,J(4,w=>a("option",{key:w,value:w},k(w)+" 列",9,vf)),64))],40,bf),[[Te,e.value.columns,void 0,{number:!0}]])]),M[20]||(M[20]=a("span",null,"×",-1)),Y(a("select",{id:"home-rows","onUpdate:modelValue":M[5]||(M[5]=w=>e.value.rows=w),"aria-label":"每页行数",class:"form-select",disabled:s.value,onChange:v},[(y(),x(H,null,J(4,w=>a("option",{key:w,value:w},k(w)+" 行",9,kf)),64))],40,yf),[[Te,e.value.rows,void 0,{number:!0}]]),a("label",xf,[Y(a("input",{id:"home-group-city","onUpdate:modelValue":M[6]||(M[6]=w=>e.value.groupCity=w),type:"checkbox",class:"form-check-input",disabled:s.value,onChange:v},null,40,wf),[[st,e.value.groupCity]]),M[18]||(M[18]=C("按城市分组",-1))]),a("label",Sf,[Y(a("input",{id:"home-arrange","onUpdate:modelValue":M[7]||(M[7]=w=>r.value=w),type:"checkbox",class:"form-check-input",disabled:e.value.groupCity||s.value},null,8,Cf),[[st,r.value]]),M[19]||(M[19]=C("调整顺序",-1))]),a("button",{id:"home-layout-save",class:"btn btn-primary",disabled:!t.value||s.value,onClick:O},k(s.value?"保存中…":"保存布局"),9,Mf),a("button",{id:"home-layout-reset",class:"btn btn-outline-secondary",disabled:!t.value||s.value,onClick:A}," 撤销 ",8,Tf)],512),[[dn,o.value==="cards"]])],2),Y(a("p",{id:"home-layout-status",role:"status",class:"small text-secondary"},k(d.value||"布局仅影响你的账号;手机端自动适配为单列。"),513),[[dn,o.value==="cards"]]),G(lf,{active:o.value==="generations"&&j(R).loggedIn&&j(R).page==="households"},null,8,["active"]),o.value==="topology"&&j(R).page==="households"&&j(R).loggedIn?(y(),Qe(Ep,{key:0})):D("",!0),Y(a("div",{id:"household-list",style:Nn({"--home-columns":e.value.columns})},[(y(!0),x(H,null,J(g.value,w=>(y(),x("section",{key:w.name,class:"home-city-group"},[w.name?(y(),x("h3",Ef,k(w.name),1)):D("",!0),a("div",Af,[(y(!0),x(H,null,J(w.items,T=>{var N,I;return y(),x("article",{key:T.id,class:"card home-card",draggable:r.value&&!s.value,onDragstart:Z=>{c.value=T.id,Z.dataTransfer.setData("text/plain",T.id)},onDragend:M[8]||(M[8]=Z=>c.value=""),onDragover:M[9]||(M[9]=Z=>r.value&&c.value&&Z.preventDefault()),onDrop:Ve(Z=>{r.value&&c.value&&S(c.value,0,T.id),c.value=""},["prevent"])},[a("div",Nf,[T.coverUrl?(y(),x("img",{key:0,src:T.coverUrl,alt:T.name+"封面",loading:"lazy"},null,8,If)):D("",!0),M[21]||(M[21]=a("div",{class:"cover-shade"},null,-1)),a("div",Df,[a("div",$f,[a("span",Rf,[C(k(b(T)),1),T.id===j(R).state.familyId?(y(),x(H,{key:0},[C(" · 当前")],64)):D("",!0)]),j(R).admin?(y(),x("button",{key:0,class:"btn btn-sm cover-edit","data-edit-household":T.id}," 编辑 ",8,Lf)):D("",!0)]),a("div",null,[a("h3",null,k(T.name),1),a("p",Pf,k(m(T)),1)])])]),a("div",Bf,[r.value?(y(),x("div",_f,[M[22]||(M[22]=a("span",null,"拖动排序",-1)),a("button",{class:"btn btn-sm btn-outline-secondary",disabled:((N=p.value[0])==null?void 0:N.id)===T.id||s.value,"aria-label":T.name+"前移",onClick:Z=>S(T.id,-1)}," ←",8,zf),a("button",{class:"btn btn-sm btn-outline-secondary",disabled:((I=p.value.at(-1))==null?void 0:I.id)===T.id||s.value,"aria-label":T.name+"后移",onClick:Z=>S(T.id,1)}," → ",8,jf)])):D("",!0),a("p",Ff,k(T.note||"记录家人、共同经历与日常生活。"),1),a("div",Vf,[a("span",null,[a("b",null,k(T.members||0),1),M[23]||(M[23]=C("成员",-1))]),a("span",null,[a("b",null,k(T.accounts||0),1),M[24]||(M[24]=C("授权账号",-1))]),a("span",null,k(b(T)),1)]),a("dl",Hf,[a("div",null,[a("dt",null,k(T.kind==="office"||T.kind==="factory"?"主要负责人":"家庭管理账号"),1),a("dd",null,k(T.ownerName||"待指定"),1)]),a("div",null,[M[25]||(M[25]=a("dt",null,"备用负责人",-1)),a("dd",null,k(T.successorName||"待指定"),1)])]),a("div",qf,[a("button",{class:"btn btn-primary",onClick:Z=>B(T)},[C(" 进入"+k(b(T))+" ",1),G(be,{name:"arrow"})],8,Uf),T.canAssignOwner?(y(),x("button",{key:0,class:"btn btn-link","data-leadership":T.id}," 负责人安排 ",8,Wf)):D("",!0)])])],40,Of)}),128))])]))),128)),p.value.length?D("",!0):(y(),x("div",Kf," 登录后查看已授权的家庭与场所。 "))],4),[[dn,o.value==="cards"]]),Y(a("div",Jf,[a("div",Gf,[G(be,{name:"network"}),a("div",null,[a("h3",null,k(j(R).brandName||"赵府")+" · 数字管家",1),a("p",null,k(p.value.length)+" 个已授权空间",1)])]),M[27]||(M[27]=a("p",{class:"description"}," 平台与场所的管理关系;进入场所查看内部设备及网络。 ",-1)),p.value.length?(y(),x("div",Yf,[G(wn,{option:j(lp)(p.value,j(R).brandName||"赵府"),active:j(R).loggedIn&&j(R).page==="households"&&o.value==="topology",height:340,label:"平台及已授权场所关系图;点击场所进入内部网络,下面也可通过卡片进入。",onSelect:M[10]||(M[10]=w=>B({id:w},!0))},null,8,["option","active"])])):D("",!0),a("div",Xf,[(y(!0),x(H,null,J(p.value,w=>(y(),x("button",{key:w.id,class:"card platform-place-node",onClick:T=>B(w,!0)},[a("span",Qf,k(b(w)),1),a("h3",null,k(w.name),1),a("p",null,k(m(w)),1),a("span",null,k(w.deviceCount||0)+" 台设备",1),a("small",null,k((w.networkAccesses||[]).map(j(Zr)).join(" · ")||"网络待登记"),1),M[26]||(M[26]=a("span",{class:"network-open"},"查看网络拓扑 →",-1))],8,Zf))),128))])],512),[[dn,o.value==="topology"]]),Y(a("div",eh,[a("span",th,"第 "+k(i.value+1)+" / "+k(h.value)+" 页 · 每页最多 "+k(f.value)+" 张",1),a("button",{id:"home-prev",class:"btn btn-outline-secondary",disabled:!i.value,onClick:M[11]||(M[11]=w=>i.value--)}," 上一页",8,nh),a("button",{id:"home-next",class:"btn btn-outline-secondary",disabled:i.value>=h.value-1,onClick:M[12]||(M[12]=w=>i.value++)}," 下一页 ",8,sh)],512),[[dn,o.value==="cards"]])]))}},rh={key:0,class:"network-status-block"},oh={class:"network-status-title"},lh=["disabled"],ah={key:0,class:"text-danger small",role:"status"},ch={key:0,class:"small text-secondary"},dh={key:1,class:"small text-secondary"},uh={key:2,class:"small text-secondary"},ph={class:"management-links"},fh=["href"],hh={key:0},mh={class:"network-check-time"},Qr={__name:"NetworkStatus",props:{device:{type:Object,required:!0},active:{type:Boolean,default:!0}},setup(n){const e=n,t=P(null),s=P(!1),i=P("");let r=0,o;const l=ee(()=>[e.device.id,e.device.source,e.device.managementHost,e.device.tailscaleHost,e.device.networkCidr,R.value.state.familyId,R.value.session,R.value.admin,e.active].join("|"));async function c(){const p=r;if(!(s.value||!R.value.admin||!e.active)){s.value=!0,i.value="";try{const f=await K().api("/api/devices/network?source="+encodeURIComponent(e.device.source)+"&id="+encodeURIComponent(e.device.id));p===r&&(t.value=f)}catch(f){p===r&&!f.stale&&(i.value=f.message)}finally{p===r&&(s.value=!1,o=setTimeout(c,35e3))}}}Ae(l,()=>{r++,clearTimeout(o),s.value=!1,t.value=null,i.value="",R.value.admin&&e.active&&c()},{immediate:!0}),Aa(()=>{r++,clearTimeout(o)});const d=ee(()=>t.value?t.value.targets.some(p=>p.reachable)?"网络可达":"未连通":"等待检查");function u(){clearTimeout(o),c()}return(p,f)=>{var h,g;return j(R).admin?(y(),x("div",rh,[a("div",oh,[a("span",null,[a("i",{class:De(["status-dot",{online:(h=t.value)==null?void 0:h.targets.some(b=>b.reachable)}])},null,2),C(k(s.value?"正在检查…":d.value),1)]),a("button",{class:"btn btn-sm btn-link",disabled:s.value,onClick:u},"检查网络",8,lh)]),i.value?(y(),x("p",ah,k(i.value),1)):D("",!0),t.value?(y(),x(H,{key:1},[(y(!0),x(H,null,J(t.value.targets,b=>(y(),x("div",{key:b.kind,class:"network-target"},[a("span",null,k(b.kind==="tailscale"?"Tailscale":"设备地址"),1),a("code",null,k(b.host),1),a("span",{class:De(b.reachable?"text-success":"text-secondary")},k(b.reachable?"服务可达":"未响应"),3)]))),128)),t.value.targets.length?D("",!0):(y(),x("p",ch,"请编辑设备档案,填写 IP 或域名。")),(g=t.value.tailscale)!=null&&g.available?(y(),x("p",dh,[C("Tailscale 节点"+k(t.value.tailscale.online?"在线":"离线"),1),t.value.tailscale.subnet?(y(),x(H,{key:0},[C(" · "+k(t.value.tailscale.subnetAvailable?"已发布":"未检测到")+" "+k(t.value.tailscale.subnet)+" 路由",1)],64)):D("",!0)])):t.value.tailscale?(y(),x("p",uh,k(t.value.tailscale.note),1)):D("",!0),a("div",ph,[(y(!0),x(H,null,J(t.value.links,b=>(y(),x("a",{key:b.kind,href:b.url,target:"_blank",rel:"noopener noreferrer",class:"btn btn-sm btn-outline-secondary"},[C("打开管理后台 · "+k(b.kind==="tailscale"?"Tailscale":"局域网")+" ↗",1),b.verified?D("",!0):(y(),x("span",hh,"(待连通)"))],8,fh))),128))]),a("small",mh,"检查于 "+k(new Date(t.value.checkedAt*1e3).toLocaleTimeString("zh-CN"))+" · 从服务器探测,打开后台需当前浏览器也能到达。",1)],64)):D("",!0)])):D("",!0)}}},gh={class:"mt-3"},bh=["disabled"],vh={class:"form-check"},yh={class:"d-flex flex-column gap-2 my-3"},kh=["value"],xh={key:0,class:"small text-secondary"},wh={key:0,class:"text-danger small",role:"alert"},Sh={key:1,class:"text-success small",role:"status"},Ch={__name:"VoicePermissions",props:{deviceId:String},setup(n){const e=n,t=P(!1),s=P([]),i=P([]),r=P(!0),o=P(""),l=P("");let c=!0;async function d(){try{const p=await K().api("/api/display-voice",{deviceId:e.deviceId,action:"settings"});c&&(t.value=p.enabled,s.value=p.allowed,i.value=p.candidates)}catch(p){c&&(o.value=p.message)}finally{c&&(r.value=!1)}}async function u(){if(!r.value){r.value=!0,o.value="",l.value="";try{await K().api("/api/display-voice",{deviceId:e.deviceId,action:"configure",enabled:t.value,allowed:s.value,consent:!0}),c&&(l.value="喊话接收权限已保存")}catch(p){c&&(o.value=p.message)}finally{c&&(r.value=!1)}}}return $i(d),Bt(()=>c=!1),(p,f)=>(y(),x("details",gh,[f[3]||(f[3]=a("summary",null,"家人喊话 · 接收权限",-1)),f[4]||(f[4]=a("p",{class:"small text-secondary mt-2"},"选择可以向此终端喊话的家人手机。对方按住说话、松开发送;终端 App 打开时播放,屏幕上可以停止播放。重新配对后需要重新授权。",-1)),a("fieldset",{disabled:r.value},[a("label",vh,[Y(a("input",{"onUpdate:modelValue":f[0]||(f[0]=h=>t.value=h),type:"checkbox",class:"form-check-input"},null,512),[[st,t.value]]),f[2]||(f[2]=C("允许接收所选家人的喊话",-1))]),a("div",yh,[(y(!0),x(H,null,J(i.value,h=>(y(),x("label",{key:h.id,class:"form-check"},[Y(a("input",{"onUpdate:modelValue":f[1]||(f[1]=g=>s.value=g),type:"checkbox",class:"form-check-input",value:h.id},null,8,kh),[[st,s.value]]),C(k(h.name),1)]))),128)),i.value.length?D("",!0):(y(),x("span",xh,"先让家人的手机完成配对,再选择喊话人。"))]),a("button",{class:"btn btn-outline-primary btn-sm",onClick:u},"保存接收权限")],8,bh),o.value?(y(),x("p",wh,k(o.value),1)):D("",!0),l.value?(y(),x("p",Sh,k(l.value),1)):D("",!0)]))}},Mh={key:0,class:"display-manager mt-3"},Th={key:0,class:"border rounded-3 p-3 mt-3"},Eh={class:"d-flex justify-content-between align-items-center gap-2 mb-3"},Ah={class:"small text-secondary"},Oh={class:"row g-2 hardware-grid"},Nh={class:"col-6"},Ih={class:"col-6"},Dh={class:"col-6"},$h={class:"col-6"},Rh={class:"small text-secondary mt-3"},Lh={key:0},Ph={key:0,class:"small text-secondary"},Bh={class:"small mb-3"},_h=["disabled"],zh={key:1,class:"tv-remote-preview"},jh=["src"],Fh={class:"small text-secondary"},Vh={class:"mt-3"},Hh={class:"row g-2 my-2"},qh={class:"col-12"},Uh={class:"col-6"},Wh={class:"col-6"},Kh=["disabled"],Jh={key:0,class:"my-3"},Gh=["value"],Yh=["href"],Xh=["disabled","onClick"],Zh={key:2,class:"alert alert-success mt-3"},Qh={class:"fs-3 font-monospace"},em={key:4,class:"text-danger mt-2",role:"alert"},tm={__name:"DisplayManager",props:{device:Object},setup(n){const e=n,t=P(!1),s=P(null),i=P([]),r=P(""),o=P(!1),l=P(""),c=P(""),d=P(0);let u,p=0,f="";const h=ee(()=>{var w;return(w=R.value.state.households)==null?void 0:w.find(T=>T.id===R.value.state.familyId)}),g=P(""),b=P(""),m=P(""),v=P(""),S=w=>w+"?deviceId="+encodeURIComponent(e.device.id),A=ee(()=>{var w;return((w=s.value)==null?void 0:w.hardware)||{}}),O=(w,T=1)=>typeof w=="number"?w.toFixed(T):"未提供",B=w=>w?new Date(w*1e3).toLocaleString("zh-CN"):"尚未上报";async function E(){const w=p;if(t.value)try{const T=await K().api(S("/api/displays/hardware"));if(w!==p)return;if(s.value=T,Date.now(){var T;if(p++,clearTimeout(u),l.value="",v.value="",r.value="",c.value="",d.value=0,f&&(URL.revokeObjectURL(f),f=""),w){const N=p;g.value=((T=h.value)==null?void 0:T.city)||"",b.value=g.value==="济南市"?"36.67":"",m.value=g.value==="济南市"?"116.99":"",E();try{const I=await K().api(S("/api/displays"));N===p&&(i.value=I.items)}catch(I){N===p&&(r.value=I.message)}}}),Ae(()=>[R.value.state.familyId,R.value.session,R.value.page,e.device.id].join("|"),()=>t.value=!1),Aa(()=>{p++,clearTimeout(u),f&&URL.revokeObjectURL(f)}),(w,T)=>{var N,I,Z,Oe,le,ae,_,fe,rt,yt,F,jt,xs,Ft,cn;return j(R).admin?(y(),x("div",Mh,[a("button",{class:"btn btn-outline-primary btn-sm",onClick:T[0]||(T[0]=te=>t.value=!t.value)},k(t.value?"收起显示终端管理":"显示终端管理 · 状态与模拟屏"),1),t.value?(y(),x("section",Th,[a("div",Eh,[a("strong",null,k(n.device.name),1),a("span",{class:De(["badge",(N=s.value)!=null&&N.online?"text-bg-success":"text-bg-secondary"])},k((I=s.value)!=null&&I.online?"在线 · 心跳正常":(Z=s.value)!=null&&Z.paired?"未收到心跳":"尚未绑定"),3)]),a("p",Ah,"所属:"+k((Oe=h.value)==null?void 0:Oe.name)+" · 最后心跳 "+k(B((le=s.value)==null?void 0:le.lastSeen)),1),a("div",Oh,[a("div",Nh,[T[7]||(T[7]=a("span",null,"处理器温度",-1)),a("strong",null,k(O(A.value.temperatureC))+k(A.value.temperatureC!=null?" °C":""),1),a("small",null,k(A.value.temperatureSource||"等待传感器上报"),1)]),a("div",Ih,[T[8]||(T[8]=a("span",null,"整机功率",-1)),a("strong",null,k(O(A.value.powerW))+k(A.value.powerW!=null?" W":""),1),a("small",null,k(A.value.powerSource||"需设备传感器或计量插座"),1)]),a("div",Dh,[T[9]||(T[9]=a("span",null,"可用内存",-1)),a("strong",null,k(O(A.value.memoryAvailableMB,0))+" / "+k(O(A.value.memoryTotalMB,0))+" MB",1)]),a("div",$h,[T[10]||(T[10]=a("span",null,"可用存储",-1)),a("strong",null,k(O(A.value.storageAvailableGB))+" / "+k(O(A.value.storageTotalGB))+" GB",1)])]),a("p",Rh,[C(k(A.value.model||n.device.model)+" · Android "+k(A.value.osVersion||"—")+" · IP "+k(A.value.ip||n.device.managementHost||"—"),1),T[11]||(T[11]=a("br",null,null,-1)),C(k(A.value.screenWidth||"—")+" × "+k(A.value.screenHeight||"—")+" · "+k(A.value.foreground?"看板在前台":"看板未在前台")+" · "+k(A.value.screenOn?"屏幕亮":"屏幕状态待确认"),1),(ae=s.value)!=null&&ae.online?D("",!0):(y(),x("span",Lh," · 当前数值为最后一次上报"))]),T[22]||(T[22]=a("h4",{class:"fs-6"},"异常与报警",-1)),(fe=(_=s.value)==null?void 0:_.alerts)!=null&&fe.some(te=>!te.cleared)?D("",!0):(y(),x("p",Ph,k((rt=s.value)!=null&&rt.online?"当前无活动报警":"连接恢复后继续检查硬件状态"),1)),(y(!0),x(H,null,J((F=(yt=s.value)==null?void 0:yt.alerts)==null?void 0:F.filter(te=>!te.cleared),te=>(y(),x("div",{key:te.code,class:De(["alert py-2 small",te.severity==="critical"?"alert-danger":"alert-warning"])},k(te.message)+" · "+k(B(te.opened)),3))),128)),a("details",Bh,[T[12]||(T[12]=a("summary",null,"报警记录与规则",-1)),T[13]||(T[13]=a("p",null,"心跳中断超过 100 秒;处理器 ≥75°C 提醒、≥85°C 严重;可用内存低于 5%;可用存储低于 0.5 GB;看板退出前台。数值来自显示终端上报。",-1)),(y(!0),x(H,null,J((jt=s.value)==null?void 0:jt.alerts,(te,ws)=>(y(),x("div",{key:ws},k(te.cleared?"已恢复":"处理中")+" · "+k(te.message)+" · "+k(B(te.opened)),1))),128))]),a("button",{class:"btn btn-primary btn-sm",disabled:o.value||!((xs=s.value)!=null&&xs.online),onClick:T[1]||(T[1]=te=>M("preview"))},"查看模拟屏 · 60 秒",8,_h),T[23]||(T[23]=a("p",{class:"small text-secondary mt-2"},"显示显示终端当前家庭看板的应用画面,约 20 秒更新一次;退出看板后不显示其他应用。预览仅短时保存在内存。",-1)),c.value?(y(),x("figure",zh,[a("img",{src:c.value,alt:"显示终端家庭看板的真实应用画面"},null,8,jh),a("figcaption",Fh,"画面时间:"+k(B((Ft=s.value)==null?void 0:Ft.previewAt)),1)])):D("",!0),a("details",Vh,[T[18]||(T[18]=a("summary",null,"展示授权与天气设置",-1)),a("div",Hh,[a("label",qh,[T[14]||(T[14]=C("天气城市",-1)),Y(a("input",{"onUpdate:modelValue":T[2]||(T[2]=te=>g.value=te),class:"form-control",maxlength:"60"},null,512),[[At,g.value]])]),a("label",Uh,[T[15]||(T[15]=C("纬度",-1)),Y(a("input",{"onUpdate:modelValue":T[3]||(T[3]=te=>b.value=te),class:"form-control",type:"number",step:"0.0001",min:"-90",max:"90"},null,512),[[At,b.value]])]),a("label",Wh,[T[16]||(T[16]=C("经度",-1)),Y(a("input",{"onUpdate:modelValue":T[4]||(T[4]=te=>m.value=te),class:"form-control",type:"number",step:"0.0001",min:"-180",max:"180"},null,512),[[At,m.value]])])]),T[19]||(T[19]=a("p",{class:"small text-secondary"},"链接有效期一年,仅可展示本家庭概况、设备状态与本人同意共享的家人位置。重新生成会停用旧链接。",-1)),a("button",{class:"btn btn-outline-primary btn-sm",disabled:o.value,onClick:T[5]||(T[5]=te=>M("create"))},"生成 App 配对码",8,Kh),l.value?(y(),x("div",Jh,[a("label",null,[T[17]||(T[17]=C("本次展示链接(请仅交给这台显示终端)",-1)),a("input",{class:"form-control",value:l.value,readonly:"",onFocus:T[6]||(T[6]=te=>te.target.select())},null,40,Gh)]),a("a",{class:"btn btn-sm btn-outline-secondary mt-2",href:l.value,target:"_blank",rel:"noreferrer"},"打开看板",8,Yh)])):D("",!0),(y(!0),x(H,null,J(i.value.filter(te=>!te.revoked),te=>(y(),x("div",{key:te.id,class:"d-flex gap-2 align-items-center small mt-2"},[a("span",null,"授权至 "+k(B(te.expires_at)),1),a("button",{class:"btn btn-sm btn-outline-danger",disabled:o.value,onClick:ws=>M("revoke",te.id)},"停用展示权限",8,Xh)]))),128))]),v.value&&l.value?(y(),x("div",Zh,[T[20]||(T[20]=C("App 配对码:",-1)),a("strong",Qh,k(v.value),1),T[21]||(T[21]=a("div",{class:"small"},"在“赵府家庭屏”App 输入,10 分钟内有效,使用一次即失效。App 摄像头画面在本地网络直接播放。",-1))])):D("",!0),(cn=s.value)!=null&&cn.paired?(y(),Qe(Ch,{key:n.device.id,"device-id":n.device.id},null,8,["device-id"])):D("",!0),r.value?(y(),x("p",em,k(r.value),1)):D("",!0)])):D("",!0)])):D("",!0)}}},$a=In(tm,[["__scopeId","data-v-2d075cdb"]]),nm={key:0,class:"mt-3"},sm={key:0,class:"border rounded p-3 mt-2"},im={class:"w-100"},rm=["value"],om={class:"d-flex gap-2 small mb-2"},lm=["disabled"],am={key:1,class:"small mt-2",role:"status"},Ra={__name:"DeviceTransfer",props:{device:Object},setup(n){const e=n,t=P(!1),s=P(""),i=P(!1),r=P(!1),o=P(""),l=ee(()=>(R.value.state.households||[]).filter(d=>d.id!==R.value.state.familyId));Ae(()=>R.value.state.familyId,()=>{t.value=!1,s.value="",i.value=!1,o.value=""});async function c(){if(!(!i.value||!s.value)){r.value=!0,o.value="";try{await K().api("/api/devices/transfer",{source:e.device.source,id:e.device.id,targetFamilyId:s.value}),K().notify("设备已转移,电视需在新家庭重新授权。"),t.value=!1,await K().refresh()}catch(d){o.value=d.message}finally{r.value=!1}}}return(d,u)=>{var p;return((p=j(R).user)==null?void 0:p.role)==="admin"?(y(),x("div",nm,[a("button",{class:"btn btn-sm btn-outline-secondary",onClick:u[0]||(u[0]=f=>t.value=!t.value)},"转移到其他家庭"),t.value?(y(),x("div",sm,[a("label",im,[u[4]||(u[4]=C("目标家庭 / 公司 / 工厂",-1)),Y(a("select",{"onUpdate:modelValue":u[1]||(u[1]=f=>s.value=f),class:"form-select mt-2"},[u[3]||(u[3]=a("option",{value:""},"请选择",-1)),(y(!0),x(H,null,J(l.value,f=>(y(),x("option",{key:f.id,value:f.id},k(f.name),9,rm))),128))],512),[[Te,s.value]])]),u[6]||(u[6]=a("p",{class:"small text-secondary mt-2"},"保留设备编号与基本档案。所属区域、负责人和上级设备需重新设置;电视旧展示授权会停用。关联录像机的摄像头需先解除关联。",-1)),a("label",om,[Y(a("input",{"onUpdate:modelValue":u[2]||(u[2]=f=>i.value=f),type:"checkbox"},null,512),[[st,i.value]]),u[5]||(u[5]=C("确认将这台设备转移给目标家庭管理",-1))]),a("button",{class:"btn btn-primary btn-sm",disabled:r.value||!i.value||!s.value,onClick:c},"确认转移",8,lm)])):D("",!0),o.value?(y(),x("p",am,k(o.value),1)):D("",!0)])):D("",!0)}}},cm={id:"asset-list"},dm={class:"group-title"},um={class:"count-pill"},pm={class:"device-card-grid"},fm={class:"card-body"},hm={class:"device-card-heading"},mm={class:"device-symbol"},gm={class:"flex-grow-1"},bm={class:"small text-secondary"},vm=["onClick"],ym={class:"device-location"},km={class:"compact-details"},xm={class:"font-monospace"},wm={key:0},Sm={key:0,class:"device-tags"},Cm={class:"card-footer device-card-actions"},Mm=["onClick"],Tm=["onClick"],Em=["onClick"],Am={key:0,class:"empty"},Om={__name:"DeviceCollection",setup(n){const e=i=>(R.value.state.cameras||[]).filter(r=>i.source==="camera"?r.assetId===i.id:r.recorderId===i.id||r.archiveRecorderId===i.id),t=i=>({["data-"+(i.source==="camera"?"edit-asset":i.source==="recorder"?"edit-recorder":"edit-device")]:i.id}),s=i=>/路由|网关|服务器/.test(i.deviceType)||/gl\.inet/i.test(i.brand||"");return(i,r)=>(y(),x("div",cm,[(y(!0),x(H,null,J(j(ze).groups,o=>(y(),x("section",{key:o.key,class:"device-group"},[a("h3",dm,[C(k(o.labels.join(" / ")||"全部设备")+" ",1),a("span",um,k(o.items.length),1)]),a("div",pm,[(y(!0),x(H,null,J(o.items,l=>{var c,d,u;return y(),x("article",{key:l.source+l.id,class:"card device-card"},[a("div",fm,[a("div",hm,[a("div",mm,[G(be,{name:l.source==="camera"?"camera":s(l)?"router":"devices"},null,8,["name"])]),a("div",gm,[a("span",bm,k(l.deviceType),1),a("h3",null,[a("button",{class:"device-title",onClick:p=>j(K)().enterDevice(l.source,l.id)},k(l.name),9,vm)])]),j(R).admin?(y(),x("button",Iu({key:0,class:"btn btn-sm btn-outline-secondary"},{ref_for:!0},t(l))," 编辑 ",16)):D("",!0)]),a("p",ym,[C(k(((d=(c=j(K)()).location)==null?void 0:d.call(c,l.siteId))||"区域待填写"),1),l.point?(y(),x(H,{key:0},[C(" · "+k(l.point),1)],64)):D("",!0)]),a("dl",km,[a("div",null,[r[0]||(r[0]=a("dt",null,"品牌型号",-1)),a("dd",null,k([l.brand,l.model].filter(Boolean).join(" / ")||"未填写"),1)]),a("div",null,[r[1]||(r[1]=a("dt",null,"设备地址",-1)),a("dd",xm,k(l.networkHosts.join(" / ")||"未填写"),1)]),a("div",null,[r[2]||(r[2]=a("dt",null,"网络",-1)),a("dd",null,k(j(Zr)(l.networkAccess)),1)]),a("div",null,[r[3]||(r[3]=a("dt",null,"所有人 / 负责人",-1)),a("dd",null,k(l.ownerName||"待指定")+" / "+k(l.managerName||"待指定"),1)]),l.source!=="device"?(y(),x("div",wm,[r[4]||(r[4]=a("dt",null,"镜头通道",-1)),a("dd",null,k(e(l).length)+" 个已配置",1)])):D("",!0)]),(u=l.tags)!=null&&u.length?(y(),x("div",Sm,[(y(!0),x(H,null,J(l.tags,p=>(y(),x("span",{key:p},k(p),1))),128))])):D("",!0),s(l)?(y(),Qe(Qr,{key:1,device:l,active:j(R).page==="objects"&&j(ze).mode==="cards"},null,8,["device","active"])):D("",!0),l.source==="device"&&/电视|显示|大屏/.test(l.deviceType)?(y(),Qe($a,{key:2,device:l},null,8,["device"])):D("",!0),G(Ra,{device:l},null,8,["device"])]),a("div",Cm,[a("button",{class:"btn btn-sm btn-outline-secondary",onClick:p=>j(K)().enterDevice(l.source,l.id,"device")}," 设备详情",8,Mm),l.source!=="device"?(y(),x(H,{key:0},[j(R).admin?(y(),x("button",{key:0,class:"btn btn-sm btn-outline-secondary",onClick:p=>j(K)().enterDevice(l.source,l.id,"cameras")}," 配置镜头",8,Tm)):D("",!0),e(l).length?(y(),x("button",{key:1,class:"btn btn-sm btn-primary",onClick:p=>j(K)().enterDevice(l.source,l.id,"live")}," 实时画面 ",8,Em)):D("",!0)],64)):D("",!0)])])}),128))])]))),128)),j(ze).devices.length?D("",!0):(y(),x("div",Am,[G(be,{name:"devices"}),r[5]||(r[5]=a("h3",null,"当前范围没有设备",-1)),r[6]||(r[6]=a("p",null,"调整筛选条件,或添加摄像机、路由器、灯等设备。",-1))]))]))}},Nm={key:0,class:"network-diagram"},Im={class:"diagram-toolbar"},Dm={class:"small text-secondary"},$m={class:"chart-network-surface"},Rm={__name:"NetworkDiagram",setup(n){const e=P(0),t=ee(()=>op(ze.value.rows,K().location)),s=ee(()=>R.value.loggedIn&&R.value.page==="objects"&&ze.value.mode==="topology");Ae(()=>R.value.session+":"+R.value.state.familyId,()=>e.value++);function i(r){const o=ze.value.rows.find(l=>l.device.id===r);o&&K().enterDevice(o.device.source,r,"device")}return(r,o)=>j(ze).rows.length?(y(),x("div",Nm,[a("div",Im,[a("div",null,[o[1]||(o[1]=a("span",{class:"diagram-dot"},null,-1)),o[2]||(o[2]=a("strong",null,"设备连接图",-1)),a("span",Dm,k(j(ze).rows.length)+" 台设备 · "+k(t.value.series[0].links.length)+" 条已登记连接",1)]),a("button",{class:"btn btn-sm btn-outline-secondary",onClick:o[0]||(o[0]=l=>e.value++)},"重置视图")]),a("div",$m,[(y(),Qe(wn,{key:e.value,option:t.value,active:s.value,height:400,label:"已登记设备连接图,可拖动缩放;下方设备详情提供相同信息及操作。",onSelect:i},null,8,["option","active"]))]),o[3]||(o[3]=a("p",{class:"diagram-note"},"拖动平移、滚轮或双指缩放;点击节点打开档案。未登记上级的设备独立显示;接入方式不代表在线状态。",-1))])):D("",!0)}},Lm={id:"device-topology",hidden:""},Pm={class:"panel network-map"},Bm={class:"network-platform"},_m={class:"topology-nodes"},zm={class:"card-body"},jm={class:"device-card-heading"},Fm={class:"flex-grow-1"},Vm={class:"small text-secondary"},Hm=["onClick"],qm=["onClick"],Um={class:"device-location"},Wm={class:"network-facts"},Km={key:0},Jm={key:1},Gm={key:2},Ym={key:3},Xm={key:0,class:"empty"},Zm={__name:"NetworkMap",setup(n){const e=ee(()=>(R.value.state.households||[]).find(t=>t.id===R.value.state.familyId));return(t,s)=>{var i;return y(),x("div",Lm,[a("section",Pm,[a("div",Bm,[G(be,{name:"network"}),a("div",null,[a("h3",null,k(((i=e.value)==null?void 0:i.name)||"当前场所"),1),a("p",null,k(j(ze).devices.length)+" 台设备 · 随设备档案自动更新",1)])]),s[7]||(s[7]=a("p",{class:"description"}," 连线来自已确认的上级设备关系。上级未填写时单独列出;不代表已自动发现所有交换机或布线。 ",-1)),G(Rm),s[8]||(s[8]=a("h3",{class:"network-details-heading"},"设备与连接详情",-1)),a("div",_m,[(y(!0),x(H,null,J(j(ze).rows,r=>{var o,l;return y(),x("article",{key:r.device.id,class:De(["network-node card",{nested:r.depth>0}]),style:Nn({"--depth":Math.min(r.depth,5)})},[a("div",zm,[a("div",jm,[G(be,{name:r.device.source==="camera"?"camera":"router"},null,8,["name"]),a("div",Fm,[a("span",Vm,k(r.device.deviceType)+" · "+k(j(Zr)(r.device.networkAccess)),1),a("h3",null,[a("button",{class:"device-title",onClick:c=>j(K)().enterDevice(r.device.source,r.device.id)},k(r.device.name),9,Hm)])]),a("button",{class:"btn btn-sm btn-outline-secondary",onClick:c=>j(K)().enterDevice(r.device.source,r.device.id,"device")}," 详情 → ",8,qm)]),a("p",Um,[C(k(((l=(o=j(K)()).location)==null?void 0:l.call(o,r.device.siteId))||"未指定区域")+" ",1),r.device.point?(y(),x(H,{key:0},[C(" · "+k(r.device.point),1)],64)):D("",!0)]),a("div",Wm,[a("span",null,[s[0]||(s[0]=C("IP ",-1)),a("b",null,k(r.device.networkHosts.join(" / ")||"待填写"),1)]),r.device.tailscaleHost?(y(),x("span",Km,[s[1]||(s[1]=C("Tailscale ",-1)),a("b",null,k(r.device.tailscaleHost),1)])):D("",!0),r.device.networkCidr?(y(),x("span",Jm,[s[2]||(s[2]=C("网段 ",-1)),a("b",null,k(r.device.networkCidr),1)])):D("",!0),a("span",null,[s[3]||(s[3]=C("上级 ",-1)),a("b",null,k(r.parentName||"待确认 / 直接接入"),1)]),a("span",null,[s[4]||(s[4]=C("连接 ",-1)),a("b",null,k({wired:"网线",wifi:"Wi-Fi"}[r.device.connectionType]||"待确认"),1)]),r.via.length?(y(),x("span",Gm,[s[5]||(s[5]=C("取流经录像机 ",-1)),a("b",null,k(r.via.join("、")),1)])):D("",!0),r.archiveVia.length?(y(),x("span",Ym,[s[6]||(s[6]=C("录像归档 ",-1)),a("b",null,k(r.archiveVia.join("、")),1)])):D("",!0)]),/路由|网关|服务器/.test(r.device.deviceType)?(y(),Qe(Qr,{key:0,device:r.device,active:j(R).page==="objects"&&j(ze).mode==="topology"},null,8,["device","active"])):D("",!0)])],6)}),128)),j(ze).rows.length?D("",!0):(y(),x("p",Xm," 当前范围尚未登记设备。 "))])])])}}},Qm={key:0,class:"panel"},eg={__name:"DeviceNetworkPanel",setup(n){return(e,t)=>j(R).admin&&j(R).device&&j(R).page==="device"?(y(),x("section",Qm,[t[0]||(t[0]=a("h3",null,"网络状态与管理入口",-1)),j(R).device.source==="device"&&/电视|显示|大屏/.test(j(R).device.deviceType)?(y(),Qe($a,{key:0,device:j(R).device},null,8,["device"])):(y(),Qe(Qr,{key:1,device:j(R).device},null,8,["device"])),G(Ra,{device:j(R).device},null,8,["device"])])):D("",!0)}},tg={key:0,class:"row g-3 mb-4","aria-label":"当前场所设备统计"},ng={class:"col-12 col-lg-7"},sg={class:"chart-card h-100"},ig={class:"chart-heading"},rg={class:"small text-secondary"},og={class:"chart-data"},lg={class:"col-12 col-lg-5"},ag={class:"chart-card h-100"},cg={class:"chart-legend"},dg={__name:"ScopeInsights",setup(n){const e=ee(()=>rp(R.value.state)),t=ee(()=>R.value.loggedIn&&R.value.page==="objects");return(s,i)=>t.value&&e.value.total?(y(),x("section",tg,[a("div",ng,[a("article",sg,[a("div",ig,[i[0]||(i[0]=a("h3",null,"设备类型",-1)),a("span",rg,k(e.value.total)+" 台已授权设备",1)]),G(wn,{option:j(Ia)(e.value.types.slice(0,8)),height:220,label:"设备类型:"+e.value.types.map(r=>r.label+r.count+"台").join(",")},null,8,["option","label"]),a("details",og,[i[1]||(i[1]=a("summary",null,"查看全部类型",-1)),a("ul",null,[(y(!0),x(H,null,J(e.value.types,r=>(y(),x("li",{key:r.label},k(r.label)+":"+k(r.count)+" 台",1))),128))])])])]),a("div",lg,[a("article",ag,[i[2]||(i[2]=a("div",{class:"chart-heading"},[a("h3",null,"网络接入"),a("span",{class:"small text-secondary"},"来自设备档案")],-1)),G(wn,{option:j(Na)(e.value.networks),height:190,label:"登记的网络接入方式:"+e.value.networks.map(r=>r.label+r.count+"台").join(",")},null,8,["option","label"]),a("div",cg,[(y(!0),x(H,null,J(e.value.networks,(r,o)=>(y(),x("span",{key:r.label},[a("i",{style:Nn({background:j(ns)[o]})},null,4),C(k(r.label)+" ",1),a("b",null,k(r.count),1)]))),128))]),i[3]||(i[3]=a("p",{class:"small text-secondary mt-2 mb-0"},"接入方式不代表设备在线状态。",-1))])])])):D("",!0)}},ug={class:"border-top mt-3 pt-3"},pg={class:"col-sm-3"},fg=["value"],hg={class:"col-sm-2"},mg={key:0,class:"col-sm-3"},gg={key:1,class:"col-sm-3"},bg={class:"col-sm-3 align-self-end"},vg=["disabled"],yg={role:"status"},kg=["disabled"],xg={__name:"LocationHistory",props:{members:{type:Array,default:()=>[]}},setup(n){const e=P(""),t=P(new Intl.DateTimeFormat("sv-SE",{timeZone:"Asia/Shanghai"}).format(new Date)),s=P(t.value),i=P("day"),r=P([]),o=P(""),l=P(!1),c=P(null);let d=0,u;function p(){d++,r.value=[],o.value="",l.value=!1,c.value=null,clearTimeout(u)}Ae([e,t,s,i,()=>R.value.state.familyId,()=>R.value.page,()=>R.value.session],p);async function f(g=!1){const b=g?c.value:0;g||p();const m=d;l.value=!0,o.value="正在从网盘读取…";try{const v=await K().api("/api/location-history?"+new URLSearchParams({memberId:e.value,date:t.value,until:s.value,period:i.value,cursor:b}));if(m===d){const S=[...r.value,...v.points];let O=[...new Map(S.map(B=>[B.at,B])).values()].sort((B,E)=>B.at-E.at);O.length>1e4&&(O=Array.from({length:1e4},(B,E)=>O[Math.round(E*(O.length-1)/9999)])),r.value=O,c.value=v.nextCursor,o.value=`已读取 ${v.loadedFiles} / ${v.totalFiles} 段归档 · 显示 ${O.length} 个采样点${v.nextCursor!==null?",点击继续加载读取其余记录":",本时段已读取完毕"}`,clearTimeout(u),u=setTimeout(p,6e4)}}catch(v){m===d&&(r.value=[],c.value=null,o.value=v.message)}finally{m===d&&(l.value=!1)}}function h(){document.hidden&&p()}return document.addEventListener("visibilitychange",h),Bt(()=>{p(),document.removeEventListener("visibilitychange",h)}),(g,b)=>(y(),x("details",ug,[b[11]||(b[11]=a("summary",null,"历史轨迹 · 每天到一生",-1)),b[12]||(b[12]=a("p",{class:"small text-secondary mt-2"},"仅记录本人同意保存的轨迹,长期保留至本人删除。关闭共享后他人不能读取;新查看人不自动获得过去记录。长时段分批从网盘读取,概览抽样展示,原始定位点仍保留。连线不是实际道路路线。画面 1 分钟后清除,需要时重新读取。",-1)),a("form",{class:"row g-2 my-2",onSubmit:b[4]||(b[4]=Ve(m=>f(!1),["prevent"]))},[a("label",pg,[b[7]||(b[7]=C("家人",-1)),Y(a("select",{"onUpdate:modelValue":b[0]||(b[0]=m=>e.value=m),required:"",class:"form-select"},[b[6]||(b[6]=a("option",{value:""},"请选择",-1)),(y(!0),x(H,null,J(n.members,m=>(y(),x("option",{key:m.id,value:m.id},k(m.name),9,fg))),128))],512),[[Te,e.value]])]),a("label",hg,[b[9]||(b[9]=C("时段",-1)),Y(a("select",{"onUpdate:modelValue":b[1]||(b[1]=m=>i.value=m),class:"form-select"},[...b[8]||(b[8]=[ge('',6)])],512),[[Te,i.value]])]),i.value!=="life"?(y(),x("label",mg,[C(k(i.value==="custom"?"开始日期":"选择该时段内的日期"),1),Y(a("input",{type:"date","onUpdate:modelValue":b[2]||(b[2]=m=>t.value=m),required:"",class:"form-control"},null,512),[[At,t.value]])])):D("",!0),i.value==="custom"?(y(),x("label",gg,[b[10]||(b[10]=C("结束日期",-1)),Y(a("input",{type:"date","onUpdate:modelValue":b[3]||(b[3]=m=>s.value=m),required:"",class:"form-control"},null,512),[[At,s.value]])])):D("",!0),a("div",bg,[a("button",{class:"btn btn-primary",disabled:l.value},k(l.value?"读取中":"查看轨迹"),9,vg)])],32),r.value.length?(y(),Qe(Oa,{key:0,track:r.value,height:420},null,8,["track"])):D("",!0),a("p",yg,k(o.value),1),c.value!==null?(y(),x("button",{key:1,class:"btn btn-outline-primary",disabled:l.value,onClick:b[5]||(b[5]=m=>f(!0))},"继续加载",8,kg)):D("",!0)]))}},wg=In(xg,[["__scopeId","data-v-3234de1e"]]),Sg={key:0,class:"panel family-locations mb-4","aria-label":"家庭位置共享"},Cg={class:"d-flex flex-wrap justify-content-between gap-2"},Mg={class:"text-secondary small"},Tg={key:0,class:"alert alert-warning",role:"status"},Eg={class:"row g-3"},Ag={class:"col-12 col-lg-8"},Og={class:"col-12 col-lg-4"},Ng={key:0,class:"location-empty"},Ig=["onClick"],Dg={key:0},$g={class:"mt-3 border-top pt-3"},Rg={key:0,class:"alert alert-info"},Lg={class:"row g-3"},Pg={class:"col-sm-8"},Bg=["disabled"],_g=["value","disabled"],zg={class:"col-sm-4"},jg=["disabled"],Fg={class:"d-flex gap-2 mt-3"},Vg=["disabled"],Hg={key:0,class:"mt-3"},qg=["value","disabled"],Ug={key:1,class:"mt-3"},Wg=["value","disabled"],Kg={key:2,class:"mt-3"},Jg={key:0,class:"small text-secondary"},Gg=["value","disabled"],Yg={key:3},Xg={class:"d-flex flex-wrap gap-2 mt-3"},Zg=["disabled"],Qg=["disabled"],eb={key:4,class:"alert alert-success mt-3",role:"status"},tb={class:"font-monospace fs-3"},nb={key:1,class:"text-danger mt-2",role:"alert"},sb={__name:"FamilyLocations",setup(n){const e=P(null),t=P(""),s=P(!1),i=P(7),r=P(""),o=P(0),l=P(!1),c=P(""),d=P(""),u=P([]),p=P([]),f=P([]),h=P(!0),g=ee(()=>{var N,I;return(I=(N=e.value)==null?void 0:N.bindings)==null?void 0:I.find(Z=>Z.memberId===d.value)}),b=ee(()=>R.value.loggedIn&&R.value.page==="overview"),m=ee(()=>{var N;return(N=R.value.state.households)==null?void 0:N.find(I=>I.id===R.value.state.familyId)});let v,S=0,A=0;const O=ee(()=>{var N;return((N=e.value)==null?void 0:N.items)||[]}),B=N=>N?new Date(N*1e3).toLocaleString("zh-CN"):"尚未收到",E=N=>N.status==="stale"?"位置更新中断":N.status==="live"?"位置已更新":"等待手机定位",M=N=>N.position?`${N.position.latitude.toFixed(4)}°, ${N.position.longitude.toFixed(4)}° · 精度约 ${Math.round(N.position.accuracy)} 米`:"尚无有效位置";async function w(){const N=S,I=++A;if(b.value)try{const Z=await K().api("/api/locations");N===S&&I===A&&(e.value=Z,t.value="")}catch(Z){N===S&&I===A&&(e.value=null,t.value=Z.message)}finally{N===S&&I===A&&b.value&&(v=setTimeout(w,3e4))}}async function T(N){if(l.value)return;l.value=!0,t.value="";const I=S;A++,clearTimeout(v);try{const Z=await K().api("/api/locations",{action:N,memberId:d.value,viewerIds:u.value,displayIds:p.value,phoneIds:f.value,viewOnly:h.value,days:i.value});if(I!==S)return;r.value=Z.code||"",o.value=Z.expires||0,N==="stop"&&(s.value=!1),clearTimeout(v),await w()}catch(Z){I===S&&(t.value=Z.message)}finally{I===S&&(l.value=!1,clearTimeout(v),b.value&&(v=setTimeout(w,3e4)))}}return Ae([b,()=>R.value.state.familyId,()=>R.value.session],()=>{S++,clearTimeout(v),e.value=null,r.value="",d.value="",u.value=[],p.value=[],f.value=[],h.value=!0,c.value="",s.value=!1,l.value=!1,b.value&&w()},{immediate:!0}),Ae([d,u,p,f,h,i],()=>{r.value=""},{deep:!0}),Bt(()=>{S++,clearTimeout(v)}),(N,I)=>{var Z,Oe,le,ae;return b.value?(y(),x("section",Sg,[a("div",Cg,[a("div",null,[I[10]||(I[10]=a("h2",null,"家人位置",-1)),a("p",Mg,k((Z=m.value)==null?void 0:Z.name)+" · "+k(O.value.length)+" 位家人正在共享 · 只显示本人同意分享的最新位置",1)]),a("button",{class:"btn btn-sm btn-outline-secondary align-self-start",onClick:I[0]||(I[0]=_=>c.value="")},"查看全部位置")]),O.value.some(_=>_.status==="stale")?(y(),x("div",Tg,k(O.value.filter(_=>_.status==="stale").map(_=>_.name).join("、"))+"的位置超过 15 分钟未更新。请检查手机网络、定位权限或省电设置;这不代表人员失联。",1)):D("",!0),a("div",Eg,[a("div",Ag,[G(Oa,{items:O.value,selected:c.value,height:420,onSelect:I[1]||(I[1]=_=>c.value=_)},null,8,["items","selected"]),I[11]||(I[11]=a("p",{class:"small text-secondary mb-0"},"点击家人卡片定位,圆圈表示定位精度范围。底图由智家提供,位置仅对获授权的人显示。",-1))]),a("div",Og,[O.value.length?D("",!0):(y(),x("div",Ng,[...I[12]||(I[12]=[a("span",null,"⌖",-1),a("h3",{class:"fs-5"},"等待家人主动分享",-1),a("p",null,"家人无需注册账号。手机配对、本人同意并开启共享后,获准的查看人才能看到位置。",-1)])])),(y(!0),x(H,null,J(O.value,_=>{var fe;return y(),x("button",{key:_.id,class:De(["location-person w-100 text-start",{"location-selected":c.value===_.id}]),onClick:rt=>c.value=_.id},[a("strong",null,k(_.name),1),a("span",{class:De(_.status==="stale"?"text-warning-emphasis":"text-success")},k(E(_)),3),a("small",null,k(M(_)),1),a("small",null,"定位时间:"+k(B((fe=_.position)==null?void 0:fe.at)),1),_.signal==="permission_denied"||_.signal==="location_disabled"?(y(),x("small",Dg,"手机定位或权限未开启")):D("",!0)],10,Ig)}),128))])]),G(wg,{members:[...O.value,...(((Oe=e.value)==null?void 0:Oe.members)||[]).filter(_=>!O.value.some(fe=>fe.id===_.id))]},null,8,["members"]),a("details",$g,[I[25]||(I[25]=a("summary",null,"为家庭成员配对手机",-1)),I[26]||(I[26]=a("p",{class:"small text-secondary mt-2"},"老人和孩子无需登录。先选择真实成员及具体查看人,再将配对码输入本人的手机。本人核对授权内容、允许定位并打开共享后才上传;管理员生成配对码不能代替本人同意。家庭屏需单独勾选。",-1)),(ae=(le=e.value)==null?void 0:le.members)!=null&&ae.length?(y(),x("form",{key:1,onSubmit:I[9]||(I[9]=Ve(_=>T("pair"),["prevent"]))},[a("div",Lg,[a("label",Pg,[I[14]||(I[14]=C("绑定的家庭成员",-1)),Y(a("select",{"onUpdate:modelValue":I[2]||(I[2]=_=>d.value=_),required:"",class:"form-select",disabled:l.value},[I[13]||(I[13]=a("option",{value:""},"请选择成员",-1)),(y(!0),x(H,null,J(e.value.members,_=>(y(),x("option",{key:_.id,value:_.id,disabled:_.status==="historical"||_.lifeStatus==="deceased"},k(_.name)+" "+k(_.label?`· ${_.label}`:""),9,_g))),128))],8,Bg),[[Te,d.value]])]),a("label",zg,[I[16]||(I[16]=C("手机配对有效期",-1)),Y(a("select",{"onUpdate:modelValue":I[3]||(I[3]=_=>i.value=_),class:"form-select",disabled:l.value},[...I[15]||(I[15]=[a("option",{value:1},"1 天",-1),a("option",{value:7},"7 天",-1),a("option",{value:30},"30 天",-1)])],8,jg),[[Te,i.value,void 0,{number:!0}]])])]),a("label",Fg,[Y(a("input",{type:"checkbox","onUpdate:modelValue":I[4]||(I[4]=_=>h.value=_),disabled:l.value},null,8,Vg),[[st,h.value]]),I[17]||(I[17]=C("先仅配对手机查看家人,本人可稍后在手机设置自己的共享",-1))]),h.value?D("",!0):(y(),x("fieldset",Hg,[I[18]||(I[18]=a("legend",{class:"fs-6"},"允许哪些账号查看",-1)),(y(!0),x(H,null,J(e.value.viewers,_=>(y(),x("label",{key:_.id,class:"d-inline-flex gap-2 me-4 mb-2"},[Y(a("input",{type:"checkbox","onUpdate:modelValue":I[5]||(I[5]=fe=>u.value=fe),value:_.id,disabled:l.value},null,8,qg),[[st,u.value]]),C(k(_.name)+"("+k(_.username)+")",1)]))),128))])),h.value?D("",!0):(y(),x("fieldset",Ug,[I[19]||(I[19]=a("legend",{class:"fs-6"},"允许哪些家人手机查看",-1)),(y(!0),x(H,null,J(e.value.phones||[],_=>(y(),x("label",{key:_.id,class:"d-inline-flex gap-2 me-4 mb-2"},[Y(a("input",{type:"checkbox","onUpdate:modelValue":I[6]||(I[6]=fe=>f.value=fe),value:_.id,disabled:l.value},null,8,Wg),[[st,f.value]]),C(k(_.name)+"的手机",1)]))),128))])),h.value?D("",!0):(y(),x("fieldset",Kg,[I[20]||(I[20]=a("legend",{class:"fs-6"},"允许哪些公共显示终端展示(默认不选)",-1)),e.value.displays.length?D("",!0):(y(),x("p",Jg,"尚无已配对显示终端。")),(y(!0),x(H,null,J(e.value.displays,_=>(y(),x("label",{key:_.id,class:"d-inline-flex gap-2 me-4 mb-2"},[Y(a("input",{type:"checkbox","onUpdate:modelValue":I[7]||(I[7]=fe=>p.value=fe),value:_.id,disabled:l.value},null,8,Gg),[[st,p.value]]),C(k(_.name),1)]))),128))])),g.value?(y(),x("p",Yg,k(g.value.enabled?"手机已开启共享":"手机已绑定,共享关闭")+" · "+k(B(g.value.expires))+" 到期",1)):D("",!0),a("div",Xg,[a("button",{class:"btn btn-primary",disabled:l.value||!d.value||!h.value&&!u.value.length&&!p.value.length&&!f.value.length},"生成配对码",8,Zg),g.value||r.value?(y(),x("button",{key:0,type:"button",class:"btn btn-outline-danger",disabled:l.value,onClick:I[8]||(I[8]=_=>T("stop"))},"解除该手机授权",8,Qg)):D("",!0),I[21]||(I[21]=a("a",{class:"btn btn-outline-secondary",href:"/downloads",target:"_blank",rel:"noreferrer"},"下载配套 App",-1))]),r.value?(y(),x("div",eb,[I[22]||(I[22]=C("配对码 ",-1)),a("strong",tb,k(r.value),1),I[23]||(I[23]=C(" · 10 分钟内使用一次",-1)),I[24]||(I[24]=a("br",null,null,-1)),C("请在成员本人的手机核对姓名与查看名单,手机授权有效至 "+k(B(o.value))+"。重新配对会替换旧手机授权。",1)])):D("",!0)],32)):(y(),x("p",Rg,"请先在“家庭成员”登记本人或家人;普通账号需关联本人档案。")),I[27]||(I[27]=a("p",{class:"small text-secondary mt-3"},"手机可在“我的位置设置”选择实时(约 10 秒)、1 分钟或 5 分钟上传,默认 5 分钟。实时位置仅在内存中保存,关闭共享后清除;本人可另行开启历史保存,长期归档到百度网盘并手动删除。定位或网络中断超过 15 分钟隐藏旧坐标,提示更新中断,不表示人员失联。",-1))]),t.value?(y(),x("p",nb,k(t.value),1)):D("",!0)])):D("",!0)}}},ib=In(sb,[["__scopeId","data-v-e83725a4"]]);function Vt(n=0){const e=Math.max(0,Number(n)||0);return e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(1)+" MB":e>=1e3?(e/1e3).toFixed(1)+" KB":e+" B"}function rb(n,e={}){return n.id===e.id?{preparing:"准备上传",uploading:"正在上传",verifying:"云端校验",cleaning:"清理本机"}[e.stage]||"处理中":n.state==="cloud"?n.releasedAt?"已上传 · 本机已清理":"已存网盘":n.state==="expired"?"云端已到期清理":n.error?"等待重试":n.state==="verified"?"待清理本机":"排队中"}function ob(n,e){return new URLSearchParams({state:n.state,family:n.family,camera:n.camera,page:String(e)}).toString()}const lb={key:0,class:"panel upload-tasks mb-4","aria-label":"上传任务"},ab={class:"row g-3 mb-3"},cb={class:"col-6 col-xl-3"},db={class:"upload-metric"},ub={class:"col-6 col-xl-3"},pb={class:"upload-metric freed"},fb={class:"col-6 col-xl-3"},hb={class:"upload-metric"},mb={class:"col-6 col-xl-3"},gb={class:"upload-metric"},bb={key:0,class:"upload-current mb-3",role:"status"},vb={class:"d-flex justify-content-between gap-2"},yb={key:0},kb={class:"small my-2"},xb=["aria-label","aria-valuenow"],wb={key:1,class:"alert alert-warning"},Sb={class:"my-2"},Cb={class:"d-flex flex-wrap align-items-center gap-2"},Mb={class:"small"},Tb=["disabled"],Eb={key:2,class:"small",role:"status"},Ab={key:3,class:"alert alert-danger",role:"alert"},Ob={class:"upload-filters mb-3"},Nb=["value"],Ib=["value"],Db={key:4,class:"py-4 text-center text-secondary"},$b={key:5,class:"py-4 text-center text-secondary"},Rb={key:6,class:"upload-list list-unstyled mb-0"},Lb={class:"upload-task-heading"},Pb={class:"small mb-1"},Bb={key:0,class:"small text-danger mb-1"},_b={class:"small upload-details"},zb={key:0},jb={key:7,class:"d-flex flex-wrap justify-content-between gap-2 align-items-center mt-3"},Fb={class:"small text-secondary"},Vb={class:"d-flex gap-2"},Hb=["disabled"],qb=["disabled"],Ub={class:"border-top pt-3 mt-3"},Wb={class:"small mt-2"},Kb={class:"list-unstyled small"},Jb={class:"ms-2"},Gb={key:0,class:"text-danger mb-0"},Yb={key:0,class:"small text-secondary"},Xb={__name:"UploadTasks",setup(n){const e=P(null),t=P(null),s=P(""),i=P(!1),r=P(""),o=P(1),l=P({state:"pending",family:"",camera:""}),c=ee(()=>R.value.loggedIn&&R.value.platformAdmin&&R.value.page==="storage"),d=ee(()=>{var M;return((M=e.value)==null?void 0:M.totals)||{}}),u=ee(()=>R.value.state.storage||{}),p=ee(()=>{var M;return(((M=e.value)==null?void 0:M.cameras)||[]).filter(w=>!l.value.family||w.familyId===l.value.family)}),f=M=>M?new Date(M*1e3).toLocaleString("zh-CN",{hour12:!1,timeZone:"Asia/Shanghai"})+" 北京时间":"—",h=ee(()=>{var M,w;return(w=(M=e.value)==null?void 0:M.active)==null?void 0:w.stage}),g=ee(()=>({preparing:"核对本机片段并准备上传",uploading:"上传文件分片",verifying:"回读网盘文件,核对完整性",cleaning:"校验成功,正在删除本机片段"})[h.value]||"");let b,m=0;async function v(){const M=++m;if(clearTimeout(b),!(!c.value||document.hidden))try{const[w,T]=await Promise.all([K().api("/api/uploads/recordings?"+ob(l.value,o.value)),K().api("/api/backups")]);if(M!==m)return;e.value=w,o.value=w.page,t.value=T,s.value=""}catch(w){M===m&&(s.value=w.message)}finally{M===m&&c.value&&(b=setTimeout(v,5e3))}}function S(){o.value=1,r.value="",v()}function A(){l.value.camera="",S()}function O(M){o.value+=M,v()}async function B(){if(i.value)return;i.value=!0,r.value="";const M=m;try{if(await K().api("/api/uploads/recordings/retry",{}),M!==m)return;r.value="已安排重试最早的片段,后续片段仍按时间顺序上传。",v()}catch(w){M===m&&(r.value=w.message)}finally{i.value=!1}}function E(){document.hidden?(m++,clearTimeout(b)):c.value&&v()}return Ae([c,()=>R.value.session],()=>{m++,clearTimeout(b),e.value=null,t.value=null,s.value="",r.value="",i.value=!1,o.value=1,l.value={state:"pending",family:"",camera:""},c.value&&v()},{immediate:!0}),document.addEventListener("visibilitychange",E),Bt(()=>{m++,clearTimeout(b),document.removeEventListener("visibilitychange",E)}),(M,w)=>{var T,N,I,Z,Oe,le,ae,_,fe,rt,yt;return c.value?(y(),x("section",lb,[a("div",{class:"d-flex flex-wrap justify-content-between gap-3 align-items-start mb-3"},[w[5]||(w[5]=a("div",null,[a("span",{class:"eyebrow"},"百度网盘 · 自动归档"),a("h2",{class:"fs-4 mt-1"},"上传任务"),a("p",{class:"small text-secondary mb-0"},"录像按录制时间依次上传,云端校验成功后才清理本机。此页每 5 秒自动更新。")],-1)),a("button",{class:"btn btn-outline-secondary",onClick:v},"刷新任务")]),a("div",ab,[a("div",cb,[a("div",db,[w[6]||(w[6]=a("span",null,"待上传",-1)),a("strong",null,k(j(Vt)(d.value.pendingBytes)),1),a("small",null,k(d.value.pendingCount||0)+" 个片段保留在本机",1)])]),a("div",ub,[a("div",pb,[w[7]||(w[7]=a("span",null,"累计清理本机录像",-1)),a("strong",null,k(j(Vt)(d.value.releasedBytes)),1),a("small",null,"今日清理 "+k(j(Vt)(d.value.releasedTodayBytes)),1)])]),a("div",fb,[a("div",hb,[w[8]||(w[8]=a("span",null,"已归档至网盘",-1)),a("strong",null,k(j(Vt)(d.value.cloudBytes)),1),a("small",null,k(d.value.cloudCount||0)+" 个未到期片段",1)])]),a("div",mb,[a("div",gb,[w[9]||(w[9]=a("span",null,"服务器磁盘可用",-1)),a("strong",null,k((T=u.value.freeGB)!=null?T:"—")+" GB",1),a("small",null,"临时录像分区上限 "+k((N=u.value.temporaryMaxGB)!=null?N:"—")+" GB",1)])])]),w[33]||(w[33]=a("p",{class:"small text-secondary"},"清理量按已删除录像文件的大小累计;磁盘可用空间也会受系统和其他文件影响,两者并非同一个数值。",-1)),(Z=(I=e.value)==null?void 0:I.active)!=null&&Z.id?(y(),x("div",bb,[a("div",vb,[a("strong",null,k(g.value),1),e.value.active.percent!==null?(y(),x("span",yb,k(e.value.active.percent)+"%",1)):D("",!0)]),a("p",kb,k(((Oe=e.value.items.find(F=>F.id===e.value.active.id))==null?void 0:Oe.cameraName)||"正在处理队首片段")+" · "+k(h.value==="verifying"?"校验完成后才释放空间":"上传完成后还需云端校验"),1),e.value.active.percent!==null?(y(),x("div",{key:0,class:"progress",role:"progressbar","aria-label":g.value,"aria-valuenow":e.value.active.percent,"aria-valuemin":"0","aria-valuemax":"100"},[a("div",{class:"progress-bar",style:Nn({width:e.value.active.percent+"%"})},null,4)],8,xb)):D("",!0)])):(le=e.value)!=null&&le.status.error?(y(),x("div",wb,[w[11]||(w[11]=a("strong",null,"队首片段等待重试",-1)),a("p",Sb,k(e.value.status.error)+"。本机文件已保留。",1),a("div",Cb,[a("span",Mb,"预计重试:"+k(f(e.value.status.retryAt)),1),a("button",{class:"btn btn-sm btn-outline-secondary",disabled:i.value,onClick:B},"重试队首任务",8,Tb),w[10]||(w[10]=a("button",{class:"btn btn-sm btn-outline-secondary","data-page":"settings","data-settings-section":"baidu"},"检查网盘连接",-1))])])):D("",!0),r.value?(y(),x("p",Eb,k(r.value),1)):D("",!0),s.value?(y(),x("p",Ab,k(s.value)+" · 当前列表可能尚未更新。",1)):D("",!0),a("div",Ob,[a("label",null,[w[13]||(w[13]=C("任务状态",-1)),Y(a("select",{"onUpdate:modelValue":w[0]||(w[0]=F=>l.value.state=F),class:"form-select",onChange:S},[...w[12]||(w[12]=[ge('',5)])],544),[[Te,l.value.state]])]),a("label",null,[w[15]||(w[15]=C("家庭或场所",-1)),Y(a("select",{"onUpdate:modelValue":w[1]||(w[1]=F=>l.value.family=F),class:"form-select",onChange:A},[w[14]||(w[14]=a("option",{value:""},"全部家庭或场所",-1)),(y(!0),x(H,null,J(((ae=e.value)==null?void 0:ae.families)||[],F=>(y(),x("option",{key:F.id,value:F.id},k(F.name),9,Nb))),128))],544),[[Te,l.value.family]])]),a("label",null,[w[17]||(w[17]=C("摄像机",-1)),Y(a("select",{"onUpdate:modelValue":w[2]||(w[2]=F=>l.value.camera=F),class:"form-select",onChange:S},[w[16]||(w[16]=a("option",{value:""},"全部摄像机",-1)),(y(!0),x(H,null,J(p.value,F=>(y(),x("option",{key:F.id+":"+F.familyId,value:F.id},k(F.name),9,Ib))),128))],544),[[Te,l.value.camera]])])]),e.value?e.value.items.length?(y(),x("ol",Rb,[(y(!0),x(H,null,J(e.value.items,F=>{var jt;return y(),x("li",{key:F.id,class:"upload-task"},[a("div",Lb,[a("strong",null,k(F.cameraName),1),a("span",{class:De(["badge",F.error?"text-bg-warning":F.state==="cloud"?"text-bg-success":"text-bg-light"])},k(j(rb)(F,e.value.active)),3)]),a("p",Pb,k(F.familyName)+" · "+k(f(F.started))+" · "+k(Math.round(F.duration))+" 秒 · "+k(j(Vt)(F.size)),1),F.error&&F.id!==e.value.active.id?(y(),x("p",Bb,k(F.error)+" · 已尝试 "+k(F.attempts)+" 次",1)):D("",!0),a("details",null,[w[30]||(w[30]=a("summary",{class:"small"},"文件与任务详情",-1)),a("dl",_b,[a("div",null,[w[18]||(w[18]=a("dt",null,"文件名称",-1)),a("dd",null,k(F.name),1)]),a("div",null,[w[19]||(w[19]=a("dt",null,"录制开始",-1)),a("dd",null,k(f(F.started)),1)]),a("div",null,[w[20]||(w[20]=a("dt",null,"录制结束",-1)),a("dd",null,k(f(F.ended)),1)]),a("div",null,[w[21]||(w[21]=a("dt",null,"编码 / 保存方式",-1)),a("dd",null,k(((jt=F.metadata.codec)==null?void 0:jt.toUpperCase())||"原始码流")+" · 连续保留原始编码画面",1)]),a("div",null,[w[22]||(w[22]=a("dt",null,"时间属性",-1)),a("dd",null,k(F.metadata.start?"已写入 MP4 文件;服务器录制时钟":"历史文件:时间保存在系统索引中"),1)]),a("div",null,[w[23]||(w[23]=a("dt",null,"网盘文件大小",-1)),a("dd",null,k(j(Vt)(F.archiveSize)),1)]),a("div",null,[w[24]||(w[24]=a("dt",null,"摄像机编号",-1)),a("dd",null,k(F.cameraId),1)]),a("div",null,[w[25]||(w[25]=a("dt",null,"保存位置",-1)),a("dd",null,k(F.remotePath||"家庭 / 摄像头类型 / 摄像机 / 年 / 月 / 日"),1)]),a("div",null,[w[26]||(w[26]=a("dt",null,"云端校验时间",-1)),a("dd",null,k(f(F.verifiedAt)),1)]),a("div",null,[w[27]||(w[27]=a("dt",null,"本机清理时间",-1)),a("dd",null,k(f(F.releasedAt)),1)]),a("div",null,[w[28]||(w[28]=a("dt",null,"清理文件大小",-1)),a("dd",null,k(j(Vt)(F.releasedBytes)),1)]),F.retryAt&&F.error?(y(),x("div",zb,[w[29]||(w[29]=a("dt",null,"下一次重试",-1)),a("dd",null,k(f(F.retryAt)),1)])):D("",!0)])])])}),128))])):(y(),x("div",$b,"当前筛选下暂无任务。正在录制的片段完成后才会进入队列。")):(y(),x("div",Db,"正在读取上传队列…")),e.value?(y(),x("div",jb,[a("span",Fb,"共 "+k(e.value.total)+" 个任务 · 第 "+k(e.value.page)+" / "+k(e.value.pages)+" 页 · 更新于 "+k(f(e.value.updatedAt)),1),a("div",Vb,[a("button",{class:"btn btn-sm btn-outline-secondary",disabled:o.value<=1,onClick:w[3]||(w[3]=F=>O(-1))},"上一页",8,Hb),a("button",{class:"btn btn-sm btn-outline-secondary",disabled:o.value>=e.value.pages,onClick:w[4]||(w[4]=F=>O(1))},"下一页",8,qb)])])):D("",!0),a("details",Ub,[w[31]||(w[31]=a("summary",null,"数据库备份上传",-1)),a("p",Wb,k((_=t.value)!=null&&_.running?t.value.stage:"备份任务未在执行")+"。数据库副本使用独立保留策略,不计入上方录像清理量。",1),a("ul",Kb,[(y(!0),x(H,null,J((((fe=t.value)==null?void 0:fe.history)||[]).filter(F=>F.baiduRequested).slice(0,5),F=>(y(),x("li",{key:F.file||F.at,class:"py-2 border-bottom"},[a("strong",null,k(F.file||"数据库备份"),1),a("span",Jb,k(F.baiduOk?"已上传并校验":"上传未完成"),1),F.error?(y(),x("p",Gb,k(F.error),1)):D("",!0)]))),128))]),(yt=(rt=t.value)==null?void 0:rt.history)!=null&&yt.some(F=>F.baiduRequested)?D("",!0):(y(),x("p",Yb,"尚无网盘备份记录。")),w[32]||(w[32]=a("button",{class:"btn btn-sm btn-outline-secondary","data-page":"settings","data-settings-section":"backup"},"打开备份设置",-1))])])):D("",!0)}}},Zb=In(Xb,[["__scopeId","data-v-0c20c09f"]]);var Bo=Object.defineProperty,Qb=(n,e)=>{let t={};for(var s in n)Bo(t,s,{get:n[s],enumerable:!0});return Bo(t,Symbol.toStringTag,{value:"Module"}),t};function Se(n){this.content=n}Se.prototype={constructor:Se,find:function(n){for(var e=0;e>1}};Se.from=function(n){if(n instanceof Se)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Se(e)};function La(n,e,t){for(let s=0;;s++){if(s==n.childCount||s==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(s),r=e.child(s);if(i==r){t+=i.nodeSize;continue}if(!i.sameMarkup(r))return t;if(i.isText&&i.text!=r.text){let o=i.text,l=r.text,c=0;for(;o[c]==l[c];c++)t++;return c&&c0&&f>0&&d[p-1]==u[f-1];)p--,f--,t--,s--;return p&&f&&p=56320&&n<57344}function _a(n){return n>=55296&&n<56320}class ${constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let s=0;se&&s(c,i+l,r||null,o)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,t-u),s,i+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,s,i){let r="",o=!0;return this.nodesBetween(e,t,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,t-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&s&&(o?o=!1:r+=s),r+=d},0),r}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,s=e.firstChild,i=this.content.slice(),r=0;for(t.isText&&t.sameMarkup(s)&&(i[i.length-1]=t.withText(t.text+s.text),r=1);re)for(let r=0,o=0;oe&&((ot)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),s.push(l),i+=l.nodeSize),o=c}return new $(s,i)}cutByIndex(e,t){return e==t?$.empty:e==0&&t==this.content.length?this:new $(this.content.slice(e,t))}replaceChild(e,t){let s=this.content[e];if(s==t)return this;let i=this.content.slice(),r=this.size+t.nodeSize-s.nodeSize;return i[e]=t,new $(i,r)}addToStart(e){return new $([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new $(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,s=0;;t++){let i=this.child(t),r=s+i.nodeSize;if(r>=e)return r==e?Ss(t+1,r):Ss(t,s);s=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return $.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return $.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return $.empty;let t,s=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),s=!0),t&&t.push(r)}}return t||(t=e.slice()),s||t.push(this),t}removeFromSet(e){for(let t=0;ts.type.rank-i.type.rank),t}};ie.none=[];class ss extends Error{}class z{constructor(e,t,s){this.content=e,this.openStart=t,this.openEnd=s}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let s=ja(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return s&&new z(s,this.openStart,this.openEnd)}removeBetween(e,t){return new z(za(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return z.empty;let s=t.openStart||0,i=t.openEnd||0;if(typeof s!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new z($.fromJSON(e,t.content),s,i)}static maxOpen(e,t=!0){let s=0,i=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)s++;for(let r=e.lastChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.lastChild)i++;return new z(e,s,i)}}z.empty=new z($.empty,0,0);function za(n,e,t){let{index:s,offset:i}=n.findIndex(e),r=n.maybeChild(s),{index:o,offset:l}=n.findIndex(t);if(i==e||r.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(s!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(s,r.copy(za(r.content,e-i-1,t-i-1)))}function ja(n,e,t,s,i,r){let{index:o,offset:l}=n.findIndex(e),c=n.maybeChild(o);if(l==e||c.isText)return r&&s<=0&&i<=0&&!r.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let d=ja(c.content,e-l-1,t,o==0?s-1:0,o==n.childCount-1?i-1:0,c);return d&&n.replaceChild(o,c.copy(d))}function ev(n,e,t){if(t.openStart>n.depth)throw new ss("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new ss("Inconsistent open depths");return Fa(n,e,t,0)}function Fa(n,e,t,s){let i=n.index(s),r=n.node(s);if(i==e.index(s)&&s=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Hn(n,e,t,s){let i=(e||n).node(t),r=0,o=e?e.index(t):i.childCount;n&&(r=n.index(t),n.depth>t?r++:n.textOffset&&(Yt(n.nodeAfter,s),r++));for(let l=r;li&&kr(n,e,i+1),o=s.depth>i&&kr(t,s,i+1),l=[];return Hn(null,n,i,l),r&&o&&e.index(i)==t.index(i)?(Va(r,o),Yt(Xt(r,Ha(n,e,t,s,i+1)),l)):(r&&Yt(Xt(r,Ws(n,e,i+1)),l),Hn(e,t,i,l),o&&Yt(Xt(o,Ws(t,s,i+1)),l)),Hn(s,null,i,l),new $(l)}function Ws(n,e,t){let s=[];if(Hn(null,n,t,s),n.depth>t){let i=kr(n,e,t+1);Yt(Xt(i,Ws(n,e,t+1)),s)}return Hn(e,null,t,s),new $(s)}function tv(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let r=t-1;r>=0;r--)i=e.node(r).copy($.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class is{constructor(e,t,s){this.pos=e,this.path=t,this.parentOffset=s,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let s=this.pos-this.path[this.path.length-1],i=e.child(t);return s?e.child(t).cut(s):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let s=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let r=0;r0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;s--)if(e.pos<=this.end(s)&&(!t||t(this.node(s))))return new Ks(this,e,s);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let s=[],i=0,r=t;for(let o=e;;){let{index:l,offset:c}=o.content.findIndex(r),d=r-c;if(s.push(o,l,i+c),!d||(o=o.child(l),o.isText))break;r=d-1,i+=c+1}return new is(t,s,r)}static resolveCached(e,t){let s=_o.get(e);if(s)for(let r=0;re&&this.nodesBetween(e,t,r=>(s.isInSet(r.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),qa(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,s=$.empty,i=0,r=s.childCount){let o=this.contentMatchAt(e).matchFragment(s,i,r),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let c=i;ct.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let s;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");s=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,s)}let i=$.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,s)}};Zt.prototype.text=void 0;class Js extends Zt{constructor(e,t,s,i){if(super(e,t,null,i),!s)throw new RangeError("Empty text nodes are not allowed");this.text=s}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):qa(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Js(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Js(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function qa(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}function zo(n,e,t,s){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${s}`);for(let i in n)n[i].validate&&n[i].validate(e[i])}class tn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let s=new rv(e,t);if(s.next==null)return tn.empty;let i=Ua(s);s.next&&s.err("Unexpected trailing text");let r=pv(uv(i));return fv(r,s),r}matchType(e){for(let t=0;td.createAndFill()));for(let d=0;d=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(s){e.push(s);for(let i=0;i{let r=i+(s.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(s.next[o].next);return r}).join(` +`)}}tn.empty=new tn(!0);class rv{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ua(n){let e=[];do e.push(ov(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function ov(n){let e=[];do e.push(lv(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function lv(n){let e=dv(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=av(n,e);else break;return e}function jo(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function av(n,e){let t=jo(n),s=t;return n.eat(",")&&(n.next!="}"?s=jo(n):s=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:s,expr:e}}function cv(n,e){let t=n.nodeTypes,s=t[e];if(s)return[s];let i=[];for(let r in t){let o=t[r];o.isInGroup(e)&&i.push(o)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function dv(n){if(n.eat("(")){let e=Ua(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=cv(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function uv(n){let e=[[]];return i(r(n,0),t()),e;function t(){return e.push([])-1}function s(o,l,c){let d={term:c,to:l};return e[o].push(d),d}function i(o,l){o.forEach(c=>c.to=l)}function r(o,l){if(o.type=="choice")return o.exprs.reduce((c,d)=>c.concat(r(d,l)),[]);if(o.type=="seq")for(let c=0;;c++){let d=r(o.exprs[c],l);if(c==o.exprs.length-1)return d;i(d,l=t())}else if(o.type=="star"){let c=t();return s(l,c),i(r(o.expr,c),c),[s(c)]}else if(o.type=="plus"){let c=t();return i(r(o.expr,l),c),i(r(o.expr,c),c),[s(c)]}else{if(o.type=="opt")return[s(l)].concat(r(o.expr,l));if(o.type=="range"){let c=l;for(let d=0;d{n[o].forEach(({term:l,to:c})=>{if(!l)return;let d;for(let u=0;u{d||i.push([l,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let r=e[s.join(",")]=new tn(s.indexOf(n.length-1)>-1);for(let o=0;o-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Ja(this.attrs,e)}create(e=null,t,s){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Zt(this,this.computeAttrs(e),$.from(t),ie.setFrom(s))}createChecked(e=null,t,s){return t=$.from(t),this.checkContent(t),new Zt(this,this.computeAttrs(e),t,ie.setFrom(s))}createAndFill(e=null,t,s){if(e=this.computeAttrs(e),t=$.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),r=i&&i.fillBefore($.empty,!0);return r?new Zt(this,e,t.append(r),ie.setFrom(s)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;ts[r]=new Ya(r,t,o));let i=t.spec.topNode||"doc";if(!s[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!s.text)throw new RangeError("Every schema needs a 'text' type");for(let r in s.text.attrs)throw new RangeError("The text node type should not have attributes");return s}};function hv(n,e,t){let s=t.split("|");return i=>{let r=i===null?"null":typeof i;if(s.indexOf(r)<0)throw new RangeError(`Expected value of type ${s} for attribute ${e} on type ${n}, got ${r}`)}}class mv{constructor(e,t,s){this.hasDefault=Object.prototype.hasOwnProperty.call(s,"default"),this.default=s.default,this.validate=typeof s.validate=="string"?hv(e,t,s.validate):s.validate}get isRequired(){return!this.hasDefault}}class Ri{constructor(e,t,s,i){this.name=e,this.rank=t,this.schema=s,this.spec=i,this.attrs=Ga(e,i.attrs),this.excluded=null;let r=Ka(this.attrs);this.instance=r?new ie(this,r):null}create(e=null){return!e&&this.instance?this.instance:new ie(this,Ja(this.attrs,e))}static compile(e,t){let s=Object.create(null),i=0;return e.forEach((r,o)=>s[r]=new Ri(r,i++,t,o)),s}removeFromSet(e){for(var t=0;t-1}}class _s{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Se.from(e.nodes),t.marks=Se.from(e.marks||{}),this.nodes=Vo.compile(this.spec.nodes,this),this.marks=Ri.compile(this.spec.marks,this);let s=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let r=this.nodes[i],o=r.spec.content||"",l=r.spec.marks;if(r.contentMatch=s[o]||(s[o]=tn.parse(o,this.nodes)),r.inlineContent=r.contentMatch.inlineContent,r.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!r.isInline||!r.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=r}r.markSet=l=="_"?null:l?Ho(this,l.split(" ")):l==""||!r.inlineContent?[]:null}for(let i in this.marks){let r=this.marks[i],o=r.spec.excludes;r.excluded=o==null?[r]:o==""?[]:Ho(this,o.split(" "))}this.nodeFromJSON=i=>Zt.fromJSON(this,i),this.markFromJSON=i=>ie.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,s,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Vo){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,s,i)}text(e,t){let s=this.nodes.text;return new Js(s,s.defaultAttrs,e,ie.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Ho(n,e){let t=[];for(let s=0;s-1)&&t.push(o=c)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[s]+"'")}return t}function gv(n){return n.tag!=null}function bv(n){return n.style!=null}class Ot{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let s=this.matchedStyles=[];t.forEach(i=>{if(gv(i))this.tags.push(i);else if(bv(i)){let r=/[^=]*/.exec(i.style)[0];s.indexOf(r)<0&&s.push(r),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let r=e.nodes[i.node];return r.contentMatch.matchType(r)})}parse(e,t={}){let s=new Uo(this,t,!1);return s.addAll(e,ie.none,t.from,t.to),s.finish()}parseSlice(e,t={}){let s=new Uo(this,t,!0);return s.addAll(e,ie.none,t.from,t.to),z.maxOpen(s.finish())}matchTag(e,t,s){for(let i=s?this.tags.indexOf(s)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let c=o.getAttrs(t);if(c===!1)continue;o.attrs=c||void 0}return o}}}static schemaRules(e){let t=[];function s(i){let r=i.priority==null?50:i.priority,o=0;for(;o{s(o=Wo(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let r=e.nodes[i].spec.parseDOM;r&&r.forEach(o=>{s(o=Wo(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ot(e,Ot.schemaRules(e)))}}const Xa={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},vv={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Za={ol:!0,ul:!0},rs=1,wr=2,qn=4;function qo(n,e,t){return e!=null?(e?rs:0)|(e==="full"?wr:0):n&&n.whitespace=="pre"?rs|wr:t&~qn}class Cs{constructor(e,t,s,i,r,o){this.type=e,this.attrs=t,this.marks=s,this.solid=i,this.options=o,this.content=[],this.activeMarks=ie.none,this.match=r||(o&qn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore($.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let s=this.type.contentMatch,i;return(i=s.findWrapping(e.type))?(this.match=s,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&rs)){let s=this.content[this.content.length-1],i;if(s&&s.isText&&(i=/[ \t\r\n\u000c]+$/.exec(s.text))){let r=s;s.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=r.withText(r.text.slice(0,r.text.length-i[0].length))}}let t=$.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore($.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Xa.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Uo{constructor(e,t,s){this.parser=e,this.options=t,this.isOpen=s,this.open=0,this.localPreserveWS=!1;let i=t.topNode,r,o=qo(null,t.preserveWhitespace,0)|(s?qn:0);i?r=new Cs(i.type,i.attrs,ie.none,!0,t.topMatch||i.type.contentMatch,o):s?r=new Cs(null,null,ie.none,!0,null,o):r=new Cs(e.schema.topNodeType,null,ie.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let s=e.nodeValue,i=this.top,r=i.options&wr?"full":this.localPreserveWS||(i.options&rs)>0,{schema:o}=this.parser;if(r==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(s)){if(r)if(r==="full")s=s.replace(/\r\n?/g,` +`);else if(o.linebreakReplacement&&/[\r\n]/.test(s)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=s.split(/\r?\n|\r/);for(let c=0;c!c.clearMark(d)):t=t.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return t}addElementByRule(e,t,s,i){let r,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),s,e.nodeName=="BR")||this.leafFallback(e,s);else{let c=this.enter(o,t.attrs||null,s,t.preserveWhitespace);c&&(r=!0,s=c)}else{let c=this.parser.schema.marks[t.mark];s=s.concat(c.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,s,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,s,!1));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c,s),this.findAround(e,c,!1)}r&&this.sync(l)&&this.open--}addAll(e,t,s,i){let r=s||0;for(let o=s?e.childNodes[s]:e.firstChild,l=i==null?null:e.childNodes[i];o!=l;o=o.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(o,t);this.findAtPoint(e,r)}findPlace(e,t,s){let i,r;for(let o=this.open,l=0;o>=0;o--){let c=this.nodes[o],d=c.findWrapping(e);if(d&&(!i||i.length>d.length+l)&&(i=d,r=c,!d.length))break;if(c.solid){if(s)break;l+=2}}if(!i)return null;this.sync(r);for(let o=0;o(o.type?o.type.allowsMarkType(d.type):Ko(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new Cs(e,t,c,i,null,l)),this.open++,s}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=rs)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let s=this.nodes[t].content;for(let i=s.length-1;i>=0;i--)e+=s[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let s=0;s-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),s=this.options.context,i=!this.isOpen&&(!s||s.parent.type==this.nodes[0].type),r=-(s?s.depth+1:0)+(i?0:1),o=(l,c)=>{for(;l>=0;l--){let d=t[l];if(d==""){if(l==t.length-1||l==0)continue;for(;c>=r;c--)if(o(l-1,c))return!0;return!1}else{let u=c>0||c==0&&i?this.nodes[c].type:s&&c>=r?s.node(c-r).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;c--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let s=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(s&&s.isTextblock&&s.defaultAttrs)return s}for(let t in this.parser.schema.nodes){let s=this.parser.schema.nodes[t];if(s.isTextblock&&s.defaultAttrs)return s}}}function yv(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let s=e.nodeType==1?e.nodeName.toLowerCase():null;s&&Za.hasOwnProperty(s)&&t?(t.appendChild(e),e=t):s=="li"?t=e:s&&(t=null)}}function kv(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Wo(n){let e={};for(let t in n)e[t]=n[t];return e}function Ko(n,e){let t=e.schema.nodes;for(let s in t){let i=t[s];if(!i.allowsMarkType(n))continue;let r=[],o=l=>{r.push(l);for(let c=0;c{if(r.length||o.marks.length){let l=0,c=0;for(;l=0;i--){let r=this.serializeMark(e.marks[i],e.isInline,t);r&&((r.contentDOM||r.dom).appendChild(s),s=r.dom)}return s}serializeMark(e,t,s={}){let i=this.marks[e.type.name];return i&&zs(Ms(s),i(e,t),null,e.attrs)}static renderSpec(e,t,s=null,i){return typeof t=="string"?{dom:e.createTextNode(t)}:zs(e,t,s,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ln(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Jo(e.nodes);return t.text||(t.text=s=>s.text),t}static marksFromSchema(e){return Jo(e.marks)}}function Jo(n){let e={};for(let t in n){let s=n[t].spec.toDOM;s&&(e[t]=s)}return e}function Ms(n){return n.document||window.document}const Go=new WeakMap;function xv(n){let e=Go.get(n);return e===void 0&&Go.set(n,e=wv(n)),e}function wv(n){let e=null;function t(s){if(s&&typeof s=="object")if(Array.isArray(s))if(typeof s[0]=="string")e||(e=[]),e.push(s);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let l,c=t?n.createElementNS(t,i):n.createElement(i),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let p in d)if(d[p]!=null){let f=p.indexOf(" ");f>0?c.setAttributeNS(p.slice(0,f),p.slice(f+1),d[p]):p=="style"&&c.style?c.style.cssText=d[p]:c.setAttribute(p,d[p])}}for(let p=u;pu)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else if(typeof f=="string")c.appendChild(n.createTextNode(f));else{let{dom:h,contentDOM:g}=zs(n,f,t,s);if(c.appendChild(h),g){if(l)throw new RangeError("Multiple content holes");l=g}}}return{dom:c,contentDOM:l}}const Qa=65535,ec=Math.pow(2,16);function Sv(n,e){return n+e*ec}function Yo(n){return n&Qa}function Cv(n){return(n-(n&Qa))/ec}const tc=1,nc=2,js=4,sc=8;class Sr{constructor(e,t,s){this.pos=e,this.delInfo=t,this.recover=s}get deleted(){return(this.delInfo&sc)>0}get deletedBefore(){return(this.delInfo&(tc|js))>0}get deletedAfter(){return(this.delInfo&(nc|js))>0}get deletedAcross(){return(this.delInfo&js)>0}}class He{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&He.empty)return He.empty}recover(e){let t=0,s=Yo(e);if(!this.inverted)for(let i=0;ie)break;let d=this.ranges[l+r],u=this.ranges[l+o],p=c+d;if(e<=p){let f=d?e==c?-1:e==p?1:t:t,h=c+i+(f<0?0:u);if(s)return h;let g=e==(t<0?c:p)?null:Sv(l/3,e-c),b=0;return d&&(b|=e==c?nc:e==p?tc:js,(t<0?e!=c:e!=p)&&(b|=sc)),new Sr(h,b,g)}i+=u-d}return s?e+i:new Sr(e+i,0,null)}touches(e,t){let s=0,i=Yo(t),r=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;le)break;let d=this.ranges[l+r],u=c+d;if(e<=u&&l==i*3)return!0;s+=this.ranges[l+o]-d}return!1}forEach(e){let t=this.inverted?2:1,s=this.inverted?1:2;for(let i=0,r=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?s-i-1:void 0)}}invert(){let e=new ls;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let s=this.from;sr&&c!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return he.fromReplace(e,this.from,this.to,r)}invert(){return new Xe(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),s=e.mapResult(this.to,-1);return t.deleted&&s.deleted||t.pos>=s.pos?null:new Tt(t.pos,s.pos,this.mark)}merge(e){return e instanceof Tt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Tt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Tt(t.from,t.to,e.markFromJSON(t.mark))}}Re.jsonID("addMark",Tt);class Xe extends Re{constructor(e,t,s){super(),this.from=e,this.to=t,this.mark=s}apply(e){let t=e.slice(this.from,this.to),s=new z(eo(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return he.fromReplace(e,this.from,this.to,s)}invert(){return new Tt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),s=e.mapResult(this.to,-1);return t.deleted&&s.deleted||t.pos>=s.pos?null:new Xe(t.pos,s.pos,this.mark)}merge(e){return e instanceof Xe&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Xe(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Xe(t.from,t.to,e.markFromJSON(t.mark))}}Re.jsonID("removeMark",Xe);class Et extends Re{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return he.fail("No node at mark step's position");let s=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return he.fromReplace(e,this.pos,this.pos+1,new z($.from(s),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let s=this.mark.addToSet(t.marks);if(s.length==t.marks.length){for(let i=0;is.pos?null:new xe(t.pos,s.pos,i,r,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new xe(t.from,t.to,t.gapFrom,t.gapTo,z.fromJSON(e,t.slice),t.insert,!!t.structure)}}Re.jsonID("replaceAround",xe);function Cr(n,e,t){let s=n.resolve(e),i=t-e,r=s.depth;for(;i>0&&r>0&&s.indexAfter(r)==s.node(r).childCount;)r--,i--;if(i>0){let o=s.node(r).maybeChild(s.indexAfter(r));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Mv(n,e,t,s){let i=[],r=[],o,l;n.doc.nodesBetween(e,t,(c,d,u)=>{if(!c.isInline)return;let p=c.marks;if(!s.isInSet(p)&&u.type.allowsMarkType(s.type)){let f=Math.max(d,e),h=Math.min(d+c.nodeSize,t),g=s.addToSet(p);for(let b=0;bn.step(c)),r.forEach(c=>n.step(c))}function Tv(n,e,t,s){let i=[],r=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;r++;let c=null;if(s instanceof Ri){let d=o.marks,u;for(;u=s.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else s?s.isInSet(o.marks)&&(c=[s]):c=o.marks;if(c&&c.length){let d=Math.min(l+o.nodeSize,t);for(let u=0;un.step(new Xe(o.from,o.to,o.style)))}function to(n,e,t,s=t.contentMatch,i=!0){let r=n.doc.nodeAt(e),o=[],l=e+1;for(let c=0;c=0;c--)n.step(o[c])}function Ev(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Dn(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let s=n.depth,i=0,r=0;;--s){let o=n.$from.node(s),l=n.$from.index(s)+i,c=n.$to.indexAfter(s)-r;if(st;g--)b||s.index(g)>0?(b=!0,u=$.from(s.node(g).copy(u)),p++):c--;let f=$.empty,h=0;for(let g=r,b=!1;g>t;g--)b||i.after(g+1)=0;o--){if(s.size){let l=t[o].type.contentMatch.matchFragment(s);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}s=$.from(t[o].type.create(t[o].attrs,s))}let i=e.start,r=e.end;n.step(new xe(i,r,i,r,new z(s,0,0),t.length,!0))}function Dv(n,e,t,s,i){if(!s.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let r=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let c=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(s,c)&&$v(n.doc,n.mapping.slice(r).map(l),s)){let d=null;if(s.schema.linebreakReplacement){let h=s.whitespace=="pre",g=!!s.contentMatch.matchType(s.schema.linebreakReplacement);h&&!g?d=!1:!h&&g&&(d=!0)}d===!1&&rc(n,o,l,r),to(n,n.mapping.slice(r).map(l,1),s,void 0,d===null);let u=n.mapping.slice(r),p=u.map(l,1),f=u.map(l+o.nodeSize,1);return n.step(new xe(p,f,p+1,f-1,new z($.from(s.create(c,null,o.marks)),0,0),1,!0)),d===!0&&ic(n,o,l,r),!1}})}function ic(n,e,t,s){e.forEach((i,r)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let c=n.mapping.slice(s).map(t+1+r+o.index);n.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function rc(n,e,t,s){e.forEach((i,r)=>{if(i.type==i.type.schema.linebreakReplacement){let o=n.mapping.slice(s).map(t+1+r);n.replaceWith(o,o+1,e.type.schema.text(` +`))}})}function $v(n,e,t){let s=n.resolve(e),i=s.index();return s.parent.canReplaceWith(i,i+1,t)}function Rv(n,e,t,s,i){let r=n.doc.nodeAt(e);if(!r)throw new RangeError("No node at given position");t||(t=r.type);let o=t.create(s,null,i||r.marks);if(r.isLeaf)return n.replaceWith(e,e+r.nodeSize,o);if(!t.validContent(r.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new xe(e,e+r.nodeSize,e+1,e+r.nodeSize-1,new z($.from(o),0,0),1,!0))}function mt(n,e,t=1,s){let i=n.resolve(e),r=i.depth-t,o=s&&s[s.length-1]||i.parent;if(r<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=t-2;d>r;d--,u--){let p=i.node(d),f=i.index(d);if(p.type.spec.isolating)return!1;let h=p.content.cutByIndex(f,p.childCount),g=s&&s[u+1];g&&(h=h.replaceChild(0,g.type.create(g.attrs)));let b=s&&s[u]||p;if(!p.canReplace(f+1,p.childCount)||!b.type.validContent(h))return!1}let l=i.indexAfter(r),c=s&&s[0];return i.node(r).canReplaceWith(l,l,c?c.type:i.node(r+1).type)}function Lv(n,e,t=1,s){let i=n.doc.resolve(e),r=$.empty,o=$.empty;for(let l=i.depth,c=i.depth-t,d=t-1;l>c;l--,d--){r=$.from(i.node(l).copy(r));let u=s&&s[d];o=$.from(u?u.type.create(u.attrs,o):i.node(l).copy(o))}n.step(new de(e,e,new z(r.append(o),t,t),!0))}function _t(n,e){let t=n.resolve(e),s=t.index();return oc(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(s,s+1)}function Pv(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:s}=n.type.schema;for(let i=0;i0?(r=s.node(i+1),l++,o=s.node(i).maybeChild(l)):(r=s.node(i).maybeChild(l-1),o=s.node(i+1)),r&&!r.isTextblock&&oc(r,o)&&s.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?s.before(i):s.after(i)}}function Bv(n,e,t){let s=null,{linebreakReplacement:i}=n.doc.type.schema,r=n.doc.resolve(e-t),o=r.node().type;if(i&&o.inlineContent){let u=o.whitespace=="pre",p=!!o.contentMatch.matchType(i);u&&!p?s=!1:!u&&p&&(s=!0)}let l=n.steps.length;if(s===!1){let u=n.doc.resolve(e+t);rc(n,u.node(),u.before(),l)}o.inlineContent&&to(n,e+t-1,o,r.node().contentMatchAt(r.index()),s==null);let c=n.mapping.slice(l),d=c.map(e-t);if(n.step(new de(d,c.map(e+t,-1),z.empty,!0)),s===!0){let u=n.doc.resolve(d);ic(n,u.node(),u.before(),n.steps.length)}return n}function _v(n,e,t){let s=n.resolve(e);if(s.parent.canReplaceWith(s.index(),s.index(),t))return e;if(s.parentOffset==0)for(let i=s.depth-1;i>=0;i--){let r=s.index(i);if(s.node(i).canReplaceWith(r,r,t))return s.before(i+1);if(r>0)return null}if(s.parentOffset==s.parent.content.size)for(let i=s.depth-1;i>=0;i--){let r=s.indexAfter(i);if(s.node(i).canReplaceWith(r,r,t))return s.after(i+1);if(r=0;o--){let l=o==s.depth?0:s.pos<=(s.start(o+1)+s.end(o+1))/2?-1:1,c=s.index(o)+(l>0?1:0),d=s.node(o),u=!1;if(r==1)u=d.canReplace(c,c,i);else{let p=d.contentMatchAt(c).findWrapping(i.firstChild.type);u=p&&d.canReplaceWith(c,c,p[0])}if(u)return l==0?s.pos:l<0?s.before(o+1):s.after(o+1)}return null}function Pi(n,e,t=e,s=z.empty){if(e==t&&!s.size)return null;let i=n.resolve(e),r=n.resolve(t);return ac(i,r,s)?new de(e,t,s):new zv(i,r,s).fit()}function ac(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class zv{constructor(e,t,s){this.$from=e,this.$to=t,this.unplaced=s,this.frontier=[],this.placed=$.empty;for(let i=0;i<=e.depth;i++){let r=e.node(i);this.frontier.push({type:r.type,match:r.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=$.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,s=this.$from,i=this.close(e<0?this.$to:s.doc.resolve(e));if(!i)return null;let r=this.placed,o=s.depth,l=i.depth;for(;o&&l&&r.childCount==1;)r=r.firstChild.content,o--,l--;let c=new z(r,o,l);return e>-1?new xe(s.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||s.pos!=this.$to.pos?new de(s.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,s=0,i=this.unplaced.openEnd;s1&&(i=0),r.type.spec.isolating&&i<=s){e=s;break}t=r.content}for(let t=1;t<=2;t++)for(let s=t==1?e:this.unplaced.openStart;s>=0;s--){let i,r=null;s?(r=Zo(this.unplaced.content,s-1).firstChild,i=r.content):i=this.unplaced.content;let o=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:d}=this.frontier[l],u,p=null;if(t==1&&(o?d.matchType(o.type)||(p=d.fillBefore($.from(o),!1)):r&&c.compatibleContent(r.type)))return{sliceDepth:s,frontierDepth:l,parent:r,inject:p};if(t==2&&o&&(u=d.findWrapping(o.type)))return{sliceDepth:s,frontierDepth:l,parent:r,wrap:u};if(r&&d.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:s}=this.unplaced;return Qo(e,-1)<=t?!1:(this.unplaced.size>1&&Qo(e,1)>s&&s++,this.unplaced=new z(e,t+1,s),!0)}dropNode(){let{content:e,openStart:t,openEnd:s}=this.unplaced,i=Zo(e,t);if(i.childCount<=1&&t>0){let r=e.size-t<=t+i.size;this.unplaced=new z(_n(e,t-1,1),t-1,r?t-1:s)}else this.unplaced=new z(_n(e,t,1),t,s)}placeNodes({sliceDepth:e,frontierDepth:t,parent:s,inject:i,wrap:r}){for(;this.depth>t;)this.closeFrontierNode();if(r)for(let b=0;b1||c==0||b.content.size)&&(p=m,u.push(cc(b.mark(f.allowedMarks(b.marks)),d==1?c:0,d==l.childCount?h:-1)))}let g=d==l.childCount;g||(h=-1),this.placed=zn(this.placed,t,$.from(u)),this.frontier[t].match=p,g&&h<0&&s&&s.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,m=l;b1&&i==this.$to.end(--s);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:s,type:i}=this.frontier[t],r=t=0;l--){let{match:c,type:d}=this.frontier[l],u=Qi(e,l,d,c,!0);if(!u||u.childCount)continue e}return{depth:t,fit:o,move:r?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=zn(this.placed,t.depth,t.fit)),e=t.move;for(let s=t.depth+1;s<=e.depth;s++){let i=e.node(s),r=i.type.contentMatch.fillBefore(i.content,!0,e.index(s));this.openFrontierNode(i.type,i.attrs,r)}return e}openFrontierNode(e,t=null,s){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=zn(this.placed,this.depth,$.from(e.create(t,s))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore($.empty,!0);t.childCount&&(this.placed=zn(this.placed,this.frontier.length,t))}}function _n(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(_n(n.firstChild.content,e-1,t)))}function zn(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(zn(n.lastChild.content,e-1,t)))}function Zo(n,e){for(let t=0;t1&&(s=s.replaceChild(0,cc(s.firstChild,e-1,s.childCount==1?t-1:0))),e>0&&(s=n.type.contentMatch.fillBefore(s).append(s),t<=0&&(s=s.append(n.type.contentMatch.matchFragment(s).fillBefore($.empty,!0)))),n.copy(s)}function Qi(n,e,t,s,i){let r=n.node(e),o=i?n.indexAfter(e):n.index(e);if(o==r.childCount&&!t.compatibleContent(r.type))return null;let l=s.fillBefore(r.content,!0,o);return l&&!jv(t,r.content,o)?l:null}function jv(n,e,t){for(let s=t;s0;f--,h--){let g=i.node(f).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;o.indexOf(f)>-1?l=f:i.before(f)==h&&o.splice(1,0,-f)}let c=o.indexOf(l),d=[],u=s.openStart;for(let f=s.content,h=0;;h++){let g=f.firstChild;if(d.push(g),h==s.openStart)break;f=g.content}for(let f=u-1;f>=0;f--){let h=d[f],g=Fv(h.type);if(g&&!h.sameMarkup(i.node(Math.abs(l)-1)))u=f;else if(g||!h.type.isTextblock)break}for(let f=s.openStart;f>=0;f--){let h=(f+u+1)%(s.openStart+1),g=d[h];if(g)for(let b=0;b=0&&(n.replace(e,t,s),!(n.steps.length>p));f--){let h=o[f];h<0||(e=i.before(h),t=r.after(h))}}function dc(n,e,t,s,i){if(es){let r=i.contentMatchAt(0),o=r.fillBefore(n).append(n);n=o.append(r.matchFragment(o).fillBefore($.empty,!0))}return n}function Hv(n,e,t,s){if(!s.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=_v(n.doc,e,s.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new z($.from(s),0,0))}function qv(n,e,t){let s=n.doc.resolve(e),i=n.doc.resolve(t);if(s.parent.isTextblock&&i.parent.isTextblock&&s.start()!=i.start()&&s.parentOffset==0&&i.parentOffset==0){let o=s.sharedDepth(t),l=!1;for(let c=s.depth;c>o;c--)s.node(c).type.spec.isolating&&(l=!0);for(let c=i.depth;c>o;c--)i.node(c).type.spec.isolating&&(l=!0);if(!l){for(let c=s.depth;c>0&&e==s.start(c);c--)e=s.before(c);for(let c=i.depth;c>0&&t==i.start(c);c--)t=i.before(c);s=n.doc.resolve(e),i=n.doc.resolve(t)}}let r=uc(s,i);for(let o=0;o0&&(c||s.node(l-1).canReplace(s.index(l-1),i.indexAfter(l-1))))return n.delete(s.before(l),i.after(l))}for(let o=1;o<=s.depth&&o<=i.depth;o++)if(e-s.start(o)==s.depth-o&&t>s.end(o)&&i.end(o)-t!=i.depth-o&&s.start(o-1)==i.start(o-1)&&s.node(o-1).canReplace(s.index(o-1),i.index(o-1)))return n.delete(s.before(o),t);n.delete(e,t)}function uc(n,e){let t=[],s=Math.min(n.depth,e.depth);for(let i=s;i>=0;i--){let r=n.start(i);if(re.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(r==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==r-1)&&t.push(i)}return t}class kn extends Re{constructor(e,t,s){super(),this.pos=e,this.attr=t,this.value=s}apply(e){let t=e.nodeAt(this.pos);if(!t)return he.fail("No node at attribute step's position");let s=Object.create(null);for(let r in t.attrs)s[r]=t.attrs[r];s[this.attr]=this.value;let i=t.type.create(s,null,t.marks);return he.fromReplace(e,this.pos,this.pos+1,new z($.from(i),0,t.isLeaf?0:1))}getMap(){return He.empty}invert(e){return new kn(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new kn(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new kn(t.pos,t.attr,t.value)}}Re.jsonID("attr",kn);class as extends Re{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let s=e.type.create(t,e.content,e.marks);return he.ok(s)}getMap(){return He.empty}invert(e){return new as(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new as(t.attr,t.value)}}Re.jsonID("docAttr",as);let Sn=class extends Error{};Sn=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};Sn.prototype=Object.create(Error.prototype);Sn.prototype.constructor=Sn;Sn.prototype.name="TransformError";class pc{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ls}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Sn(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let s=0;s{e=Math.min(e,l),t=Math.max(t,c)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,s=z.empty){let i=Pi(this.doc,e,t,s);return i&&this.step(i),this}replaceWith(e,t,s){return this.replace(e,t,new z($.from(s),0,0))}delete(e,t){return this.replace(e,t,z.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,s){return Vv(this,e,t,s),this}replaceRangeWith(e,t,s){return Hv(this,e,t,s),this}deleteRange(e,t){return qv(this,e,t),this}lift(e,t){return Av(this,e,t),this}join(e,t=1){return Bv(this,e,t),this}wrap(e,t){return Iv(this,e,t),this}setBlockType(e,t=e,s,i=null){return Dv(this,e,t,s,i),this}setNodeMarkup(e,t,s=null,i){return Rv(this,e,t,s,i),this}setNodeAttribute(e,t,s){return this.step(new kn(e,t,s)),this}setDocAttribute(e,t){return this.step(new as(e,t)),this}addNodeMark(e,t){return this.step(new Et(e,t)),this}removeNodeMark(e,t){let s=this.doc.nodeAt(e);if(!s)throw new RangeError("No node at position "+e);if(t instanceof ie)t.isInSet(s.marks)&&this.step(new nn(e,t));else{let i=s.marks,r,o=[];for(;r=t.isInSet(i);)o.push(new nn(e,r)),i=r.removeFromSet(i);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(e,t=1,s){return Lv(this,e,t,s),this}addMark(e,t,s){return Mv(this,e,t,s),this}removeMark(e,t,s){return Tv(this,e,t,s),this}clearIncompatible(e,t,s){return to(this,e,t,s),this}}const er=Object.create(null);class X{constructor(e,t,s){this.$anchor=e,this.$head=t,this.ranges=s||[new Uv(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;r--){let o=t<0?mn(e.node(0),e.node(r),e.before(r+1),e.index(r),t,s):mn(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,s);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new qe(e.node(0))}static atStart(e){return mn(e,e,0,0,1)||new qe(e)}static atEnd(e){return mn(e,e,e.content.size,e.childCount,-1)||new qe(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let s=er[t.type];if(!s)throw new RangeError(`No selection type ${t.type} defined`);return s.fromJSON(e,t)}static jsonID(e,t){if(e in er)throw new RangeError("Duplicate use of selection JSON ID "+e);return er[e]=t,t.prototype.jsonID=e,t}getBookmark(){return U.between(this.$anchor,this.$head).getBookmark()}}X.prototype.visible=!0;class Uv{constructor(e,t){this.$from=e,this.$to=t}}let el=!1;function tl(n){!el&&!n.parent.inlineContent&&(el=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class U extends X{constructor(e,t=e){tl(e),tl(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let s=e.resolve(t.map(this.head));if(!s.parent.inlineContent)return X.near(s);let i=e.resolve(t.map(this.anchor));return new U(i.parent.inlineContent?i:s,s)}replace(e,t=z.empty){if(super.replace(e,t),t==z.empty){let s=this.$from.marksAcross(this.$to);s&&e.ensureMarks(s)}}eq(e){return e instanceof U&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Bi(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new U(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,s=t){let i=e.resolve(t);return new this(i,s==t?i:e.resolve(s))}static between(e,t,s){let i=e.pos-t.pos;if((!s||i)&&(s=i>=0?1:-1),!t.parent.inlineContent){let r=X.findFrom(t,s,!0)||X.findFrom(t,-s,!0);if(r)t=r.$head;else return X.near(t,s)}return e.parent.inlineContent||(i==0?e=t:(e=(X.findFrom(e,-s,!0)||X.findFrom(e,s,!0)).$anchor,e.pos0?0:1);i>0?o=0;o+=i){let l=e.child(o);if(l.isAtom){if(!r&&W.isSelectable(l))return W.create(n,t-(i<0?l.nodeSize:0))}else{let c=mn(n,l,t+i,i<0?l.childCount:0,i,r);if(c)return c}t+=l.nodeSize*i}return null}function nl(n,e,t){let s=n.steps.length-1;if(s{o==null&&(o=u)}),n.setSelection(X.near(n.doc.resolve(o),t))}const sl=1,Ts=2,il=4;class Kv extends pc{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ts,this}ensureMarks(e){return ie.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ts)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Ts,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let s=this.selection;return t&&(e=e.mark(this.storedMarks||(s.empty?s.$from.marks():s.$from.marksAcross(s.$to)||ie.none))),s.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,s){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(s==null&&(s=t),!e)return this.deleteRange(t,s);let r=this.storedMarks;if(!r){let o=this.doc.resolve(t);r=s==t?o.marks():o.marksAcross(this.doc.resolve(s))}return this.replaceRangeWith(t,s,i.text(e,r)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(X.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=il,this}get scrolledIntoView(){return(this.updated&il)>0}}function rl(n,e){return!e||!n?n:n.bind(e)}class jn{constructor(e,t,s){this.name=e,this.init=rl(t.init,s),this.apply=rl(t.apply,s)}}const Jv=[new jn("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new jn("selection",{init(n,e){return n.selection||X.atStart(e.doc)},apply(n){return n.selection}}),new jn("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,s){return s.selection.$cursor?n.storedMarks:null}}),new jn("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class tr{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Jv.slice(),t&&t.forEach(s=>{if(this.pluginsByKey[s.key])throw new RangeError("Adding different instances of a keyed plugin ("+s.key+")");this.plugins.push(s),this.pluginsByKey[s.key]=s,s.spec.state&&this.fields.push(new jn(s.key,s.spec.state,s))})}}class pt{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let s=0;ss.toJSON())),e&&typeof e=="object")for(let s in e){if(s=="doc"||s=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[s],r=i.spec.state;r&&r.toJSON&&(t[s]=r.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,s){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new tr(e.schema,e.plugins),r=new pt(i);return i.fields.forEach(o=>{if(o.name=="doc")r.doc=Zt.fromJSON(e.schema,t.doc);else if(o.name=="selection")r.selection=X.fromJSON(r.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(r.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(s)for(let l in s){let c=s[l],d=c.spec.state;if(c.key==o.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){r[o.name]=d.fromJSON.call(c,e,t[l],r);return}}r[o.name]=o.init(e,r)}}),r}}function fc(n,e,t){for(let s in n){let i=n[s];i instanceof Function?i=i.bind(e):s=="handleDOMEvents"&&(i=fc(i,e,{})),t[s]=i}return t}class oe{constructor(e){this.spec=e,this.props={},e.props&&fc(e.props,this,this.props),this.key=e.key?e.key.key:hc("plugin")}getState(e){return e[this.key]}}const nr=Object.create(null);function hc(n){return n in nr?n+"$"+ ++nr[n]:(nr[n]=0,n+"$")}class me{constructor(e="key"){this.key=hc(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const mc=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function gc(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const bc=(n,e,t)=>{let s=gc(n,t);if(!s)return!1;let i=io(s);if(!i){let o=s.blockRange(),l=o&&Dn(o);return l==null?!1:(e&&e(n.tr.lift(o,l).scrollIntoView()),!0)}let r=i.nodeBefore;if(Tc(n,i,e,-1))return!0;if(s.parent.content.size==0&&(Cn(r,"end")||W.isSelectable(r)))for(let o=s.depth;;o--){let l=Pi(n.doc,s.before(o),s.after(o),z.empty);if(l&&l.slice.size1)break}return r.isAtom&&i.depth==s.depth-1?(e&&e(n.tr.delete(i.pos-r.nodeSize,i.pos).scrollIntoView()),!0):!1},Gv=(n,e,t)=>{let s=gc(n,t);if(!s)return!1;let i=io(s);return i?vc(n,i,e):!1},Yv=(n,e,t)=>{let s=kc(n,t);if(!s)return!1;let i=ro(s);return i?vc(n,i,e):!1};function vc(n,e,t){let s=e.nodeBefore,i=s,r=e.pos-1;for(;!i.isTextblock;r--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let o=e.nodeAfter,l=o,c=e.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let d=Pi(n.doc,r,c,z.empty);if(!d||d.from!=r||d instanceof de&&d.slice.size>=c-r)return!1;if(t){let u=n.tr.step(d);u.setSelection(U.create(u.doc,r)),t(u.scrollIntoView())}return!0}function Cn(n,e,t=!1){for(let s=n;s;s=e=="start"?s.firstChild:s.lastChild){if(s.isTextblock)return!0;if(t&&s.childCount!=1)return!1}return!1}const yc=(n,e,t)=>{let{$head:s,empty:i}=n.selection,r=s;if(!i)return!1;if(s.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):s.parentOffset>0)return!1;r=io(s)}let o=r&&r.nodeBefore;return!o||!W.isSelectable(o)?!1:(e&&e(n.tr.setSelection(W.create(n.doc,r.pos-o.nodeSize)).scrollIntoView()),!0)};function io(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function kc(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset{let s=kc(n,t);if(!s)return!1;let i=ro(s);if(!i)return!1;let r=i.nodeAfter;if(Tc(n,i,e,1))return!0;if(s.parent.content.size==0&&(Cn(r,"start")||W.isSelectable(r))){let o=Pi(n.doc,s.before(),s.after(),z.empty);if(o&&o.slice.size{let{$head:s,empty:i}=n.selection,r=s;if(!i)return!1;if(s.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):s.parentOffset=0;e--){let t=n.node(e);if(n.index(e)+1{let t=n.selection,s=t instanceof W,i;if(s){if(t.node.isTextblock||!_t(n.doc,t.from))return!1;i=t.from}else if(i=Li(n.doc,t.from,-1),i==null)return!1;if(e){let r=n.tr.join(i);s&&r.setSelection(W.create(r.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(r.scrollIntoView())}return!0},Zv=(n,e)=>{let t=n.selection,s;if(t instanceof W){if(t.node.isTextblock||!_t(n.doc,t.to))return!1;s=t.to}else if(s=Li(n.doc,t.to,1),s==null)return!1;return e&&e(n.tr.join(s).scrollIntoView()),!0},Qv=(n,e)=>{let{$from:t,$to:s}=n.selection,i=t.blockRange(s),r=i&&Dn(i);return r==null?!1:(e&&e(n.tr.lift(i,r).scrollIntoView()),!0)},Sc=(n,e)=>{let{$head:t,$anchor:s}=n.selection;return!t.parent.type.spec.code||!t.sameParent(s)?!1:(e&&e(n.tr.insertText(` +`).scrollIntoView()),!0)};function oo(n){for(let e=0;e{let{$head:t,$anchor:s}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(s))return!1;let i=t.node(-1),r=t.indexAfter(-1),o=oo(i.contentMatchAt(r));if(!o||!i.canReplaceWith(r,r,o))return!1;if(e){let l=t.after(),c=n.tr.replaceWith(l,l,o.createAndFill());c.setSelection(X.near(c.doc.resolve(l),1)),e(c.scrollIntoView())}return!0},Cc=(n,e)=>{let t=n.selection,{$from:s,$to:i}=t;if(t instanceof qe||s.parent.inlineContent||i.parent.inlineContent)return!1;let r=oo(i.parent.contentMatchAt(i.indexAfter()));if(!r||!r.isTextblock)return!1;if(e){let o=(!s.parentOffset&&i.index(){let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let r=t.before();if(mt(n.doc,r))return e&&e(n.tr.split(r).scrollIntoView()),!0}let s=t.blockRange(),i=s&&Dn(s);return i==null?!1:(e&&e(n.tr.lift(s,i).scrollIntoView()),!0)};function ty(n){return(e,t)=>{if(e.selection instanceof W&&e.selection.node.isBlock){let{$from:h}=e.selection;return!h.parentOffset||!mt(e.doc,h.pos)?!1:(t&&t(e.tr.split(h.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let s=e.tr;!e.selection.empty&&(e.selection instanceof U||e.selection instanceof qe)&&s.deleteSelection();let{$from:i}=s.selection,r=s.steps.length,o=[],l,c,d=!1,u=!1;for(let h=i.depth;;h--)if(i.node(h).isBlock){d=i.end(h)==i.pos+(i.depth-h),u=i.start(h)==i.pos-(i.depth-h),c=oo(i.node(h-1).contentMatchAt(i.indexAfter(h-1))),o.unshift(d&&c?{type:c}:null),l=h;break}else{if(h==1)return!1;o.unshift(null)}let p=i.pos,f=mt(s.doc,p,o.length,o);if(f||(o[0]=c?{type:c}:null,f=mt(s.doc,p,o.length,o)),!f)return!1;if(s.split(p,o.length,o),!d&&u&&i.node(l).type!=c){let h=s.mapping.slice(r),g=h.map(i.before(l)),b=s.doc.resolve(g);c&&i.node(l-1).canReplaceWith(b.index(),b.index()+1,c)&&s.setNodeMarkup(h.map(i.before(l)),c)}return t&&t(s.scrollIntoView()),!0}}const ny=ty(),sy=(n,e)=>{let{$from:t,to:s}=n.selection,i,r=t.sharedDepth(s);return r==0?!1:(i=t.before(r),e&&e(n.tr.setSelection(W.create(n.doc,i))),!0)};function iy(n,e,t){let s=e.nodeBefore,i=e.nodeAfter,r=e.index();return!s||!i||!s.type.compatibleContent(i.type)?!1:!s.content.size&&e.parent.canReplace(r-1,r)?(t&&t(n.tr.delete(e.pos-s.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(r,r+1)||!(i.isTextblock||_t(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function Tc(n,e,t,s){let i=e.nodeBefore,r=e.nodeAfter,o,l,c=i.type.spec.isolating||r.type.spec.isolating;if(!c&&iy(n,e,t))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(o=(l=i.contentMatchAt(i.childCount)).findWrapping(r.type))&&l.matchType(o[0]||r.type).validEnd){if(t){let h=e.pos+r.nodeSize,g=$.empty;for(let v=o.length-1;v>=0;v--)g=$.from(o[v].create(null,g));g=$.from(i.copy(g));let b=n.tr.step(new xe(e.pos-1,h,e.pos,h,new z(g,1,0),o.length,!0)),m=b.doc.resolve(h+2*o.length);m.nodeAfter&&m.nodeAfter.type==i.type&&_t(b.doc,m.pos)&&b.join(m.pos),t(b.scrollIntoView())}return!0}let u=r.type.spec.isolating||s>0&&c?null:X.findFrom(e,1),p=u&&u.$from.blockRange(u.$to),f=p&&Dn(p);if(f!=null&&f>=e.depth)return t&&t(n.tr.lift(p,f).scrollIntoView()),!0;if(d&&Cn(r,"start",!0)&&Cn(i,"end")){let h=i,g=[];for(;g.push(h),!h.isTextblock;)h=h.lastChild;let b=r,m=1;for(;!b.isTextblock;b=b.firstChild)m++;if(h.canReplace(h.childCount,h.childCount,b.content)){if(t){let v=$.empty;for(let A=g.length-1;A>=0;A--)v=$.from(g[A].copy(v));let S=n.tr.step(new xe(e.pos-g.length,e.pos+r.nodeSize,e.pos+m,e.pos+r.nodeSize-m,new z(v,g.length,0),0,!0));t(S.scrollIntoView())}return!0}}return!1}function Ec(n){return function(e,t){let s=e.selection,i=n<0?s.$from:s.$to,r=i.depth;for(;i.node(r).isInline;){if(!r)return!1;r--}return i.node(r).isTextblock?(t&&t(e.tr.setSelection(U.create(e.doc,n<0?i.start(r):i.end(r)))),!0):!1}}const ry=Ec(-1),oy=Ec(1);function ly(n,e=null){return function(t,s){let{$from:i,$to:r}=t.selection,o=i.blockRange(r),l=o&&no(o,n,e);return l?(s&&s(t.tr.wrap(o,l).scrollIntoView()),!0):!1}}function ol(n,e=null){return function(t,s){let i=!1;for(let r=0;r{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(n,e)))if(c.type==n)i=!0;else{let u=t.doc.resolve(d),p=u.index();i=u.parent.canReplaceWith(p,p+1,n)}})}if(!i)return!1;if(s){let r=t.tr;for(let o=0;o=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=o.resolve(e.start-2);r=new Ks(c,c,e.depth),e.endIndex=0;u--)r=$.from(t[u].type.create(t[u].attrs,r));n.step(new xe(e.start-(s?2:0),e.end,e.start,e.end,new z(r,0,0),t.length,!0));let o=0;for(let u=0;uo.childCount>0&&o.firstChild.type==n);return r?t?s.node(r.depth-1).type==n?py(e,t,n,r):fy(e,t,r):!0:!1}}function py(n,e,t,s){let i=n.tr,r=s.end,o=s.$to.end(s.depth);rb;g--)h-=i.child(g).nodeSize,s.delete(h-1,h+1);let r=s.doc.resolve(t.start),o=r.nodeAfter;if(s.mapping.map(t.end)!=t.start+r.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,c=t.endIndex==i.childCount,d=r.node(-1),u=r.index(-1);if(!d.canReplace(u+(l?0:1),u+1,o.content.append(c?$.empty:$.from(i))))return!1;let p=r.pos,f=p+o.nodeSize;return s.step(new xe(p-(l?1:0),f+(c?1:0),p+1,f-1,new z((l?$.empty:$.from(i.copy($.empty))).append(c?$.empty:$.from(i.copy($.empty))),l?0:1,c?0:1),l?0:1)),e(s.scrollIntoView()),!0}function hy(n){return function(e,t){let{$from:s,$to:i}=e.selection,r=s.blockRange(i,d=>d.childCount>0&&d.firstChild.type==n);if(!r)return!1;let o=r.startIndex;if(o==0)return!1;let l=r.parent,c=l.child(o-1);if(c.type!=n)return!1;if(t){let d=c.lastChild&&c.lastChild.type==l.type,u=$.from(d?n.create():null),p=new z($.from(n.create(null,$.from(l.type.create(null,u)))),d?3:1,0),f=r.start,h=r.end;t(e.tr.step(new xe(f-(d?3:1),h,f,h,p,1,!0)).scrollIntoView())}return!0}}const Ce=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Mn=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Mr=null;const ut=function(n,e,t){let s=Mr||(Mr=document.createRange());return s.setEnd(n,t==null?n.nodeValue.length:t),s.setStart(n,e||0),s},my=function(){Mr=null},sn=function(n,e,t,s){return t&&(ll(n,e,t,s,-1)||ll(n,e,t,s,1))},gy=/^(img|br|input|textarea|hr)$/i;function ll(n,e,t,s,i){for(var r;;){if(n==t&&e==s)return!0;if(e==(i<0?0:Ie(n))){let o=n.parentNode;if(!o||!q(o)||ms(n)||gy.test(n.nodeName)||n.contentEditable=="false")return!1;e=Ce(n)+(i<0?0:1),n=o}else if(q(n)){let o=n.childNodes[e+(i<0?-1:0)];if(q(o)&&o.contentEditable=="false")if(!((r=o.pmViewDesc)===null||r===void 0)&&r.ignoreForSelection)e+=i;else return!1;else n=o,e=i<0?Ie(n):0}else return!1}}function Ie(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function q(n){return n.nodeType==1}function ve(n){return n.nodeType==3}function rn(n,e){return e?n.contains(q(e)?e:e.parentNode):!1}function by(n,e){for(;;){if(ve(n)&&e)return n;if(q(n)&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=Ie(n)}else if(n.parentNode&&!ms(n))e=Ce(n),n=n.parentNode;else return null}}function vy(n,e){for(;;){if(ve(n)&&e2),Je=Tn||(it?/Mac/.test(it.platform):!1),Nc=it?/Win/.test(it.platform):!1,ft=/Android \d/.test(zt),zi=!!al&&"webkitFontSmoothing"in al.documentElement.style,wy=zi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Sy(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function ot(n,e){return typeof n=="number"?n:n[e]}function Cy(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,s=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*s}}function cl(n,e,t){if(!Or(e)&&e.left==0)return;let s=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,r=n.dom.ownerDocument;for(let o=t||n.dom;o;){if(!q(o)){o=Mn(o);continue}let l=o==r.body,c=l?Sy(r):Cy(o),d=0,u=0;if(e.topc.bottom-ot(s,"bottom")&&(u=e.bottom-e.top>c.bottom-c.top?e.top+ot(i,"top")-c.top:e.bottom-c.bottom+ot(i,"bottom")),e.leftc.right-ot(s,"right")&&(d=e.right-c.right+ot(i,"right")),d||u)if(l)r.defaultView.scrollBy(d,u);else{let f=o.scrollLeft,h=o.scrollTop;u&&(o.scrollTop+=u),d&&(o.scrollLeft+=d);let g=o.scrollLeft-f,b=o.scrollTop-h;e={left:e.left-g,top:e.top-b,right:e.right-g,bottom:e.bottom-b}}let p=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(p))break;o=p=="absolute"?o.offsetParent:Mn(o)}}function My(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),s,i;for(let r=(e.left+e.right)/2,o=t+1;o=t-20){s=l,i=c.top;break}}return{refDOM:s,refTop:i,stack:Ic(n.dom)}}function Ic(n){let e=[],t=n.ownerDocument;for(let s=n;s&&(e.push({dom:s,top:s.scrollTop,left:s.scrollLeft}),n!=t);s=Mn(s));return e}function Ty({refDOM:n,refTop:e,stack:t}){let s=n?n.getBoundingClientRect().top:0;Dc(t,s==0?0:s-e)}function Dc(n,e){for(let t=0;t=l){o=Math.max(g.bottom,o),l=Math.min(g.top,l);let b=g.left>e.left?g.left-e.left:g.right=(g.left+g.right)/2?1:0));continue}}else g.top>e.top&&!c&&g.left<=e.left&&g.right>=e.left&&(c=u,d={left:Math.max(g.left,Math.min(g.right,e.left)),top:g.top});!t&&(e.left>=g.right&&e.top>=g.top||e.left>=g.left&&e.top>=g.bottom)&&(r=p+1)}}return!t&&c&&(t=c,i=d,s=0),t&&ve(t)?Ay(t,i):!t||s?{node:n,offset:r}:$c(t,i)}function Ay(n,e){let t=n.nodeValue.length,s=document.createRange(),i;for(let r=0;r=(o.left+o.right)/2?1:0)};break}}return s.detach(),i||{node:n,offset:0}}function ao(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function Oy(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(o.left+o.right)/2?1:-1}return n.docView.posFromDOM(s,i,r)}function Iy(n,e,t,s){let i=-1;for(let r=e,o=!1;r!=n.dom;){let l=n.docView.nearestDesc(r,!0),c;if(!l)return null;if(q(l.dom)&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((c=l.dom.getBoundingClientRect()).width||c.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!o&&c.left>s.left||c.top>s.top?i=l.posBefore:(!o&&c.right-1?i:n.docView.posFromDOM(e,t,-1)}function Rc(n,e,t){let s=n.childNodes.length;if(s&&t.tope.top&&i++}let d;zi&&i&&q(s)&&q(d=s.childNodes[i-1])&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,s==n.dom&&i==s.childNodes.length-1&&q(s.lastChild)&&e.top>s.lastChild.getBoundingClientRect().bottom?l=n.state.doc.content.size:(i==0||!q(s)||s.childNodes[i-1].nodeName!="BR")&&(l=Iy(n,s,i,e))}l==null&&(l=Ny(n,o,e));let c=n.docView.nearestDesc(o,!0);return{pos:l,inside:c?c.posAtStart-c.border:-1}}function Or(n){return n.top=0&&i==s.nodeValue.length?(c--,u=1):t<0?c--:d++,$n(xt(ut(s,c,d),u),u<0)}if(!n.state.doc.resolve(e-(r||0)).parent.inlineContent){if(r==null&&i&&(t<0||i==Ie(s))){let c=s.childNodes[i-1];if(q(c))return sr(c.getBoundingClientRect(),!1)}if(r==null&&i=0)}if(r==null&&i&&(t<0||i==Ie(s))){let c=s.childNodes[i-1],d=ve(c)?ut(c,Ie(c)-(o?0:1)):q(c)&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return $n(xt(d,1),!1)}if(r==null&&i=0)}function $n(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function sr(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function Pc(n,e,t){let s=n.state,i=n.root.activeElement;s!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{s!=e&&n.updateState(s),i!=n.dom&&i&&i.focus()}}function Ry(n,e,t){let s=e.selection,i=t=="up"?s.$from:s.$to;return Pc(n,e,()=>{let{node:r}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let l=n.docView.nearestDesc(r,!0);if(!l)break;if(l.node.isBlock){r=l.contentDOM||l.dom;break}r=l.dom.parentNode}let o=Lc(n,i.pos,1);for(let l=r.firstChild;l;l=l.nextSibling){let c;if(q(l))c=l.getClientRects();else if(ve(l))c=ut(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;du.top+1&&(t=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const Ly=/[\u0590-\u08ac]/;function Py(n,e,t){let{$head:s}=e.selection;if(!s.parent.isTextblock)return!1;let i=s.parentOffset,r=!i,o=i==s.parent.content.size,l=n.domSelection();return l?!Ly.test(s.parent.textContent)||!l.modify?t=="left"||t=="backward"?r:o:Pc(n,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:u,anchorOffset:p}=n.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",t,"character");let h=s.depth?n.docView.domAfterPos(s.before()):n.dom,{focusNode:g,focusOffset:b}=n.domSelectionRange(),m=g&&!rn(h,g)||c==g&&d==b;try{l.collapse(u,p),c&&(c!=u||d!=p)&&l.extend&&l.extend(c,d)}catch(v){}return f!=null&&(l.caretBidiLevel=f),m}):s.pos==s.start()||s.pos==s.end()}let dl=null,ul=null,pl=!1;function By(n,e,t){return dl==e&&ul==t?pl:(dl=e,ul=t,pl=t=="up"||t=="down"?Ry(n,e,t):Py(n,e,t))}const Ge=0,fl=1,Ut=2,Ze=3;class gs{constructor(e,t,s,i){this.parent=e,this.children=t,this.dom=s,this.contentDOM=i,this.dirty=Ge,s.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,s){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tCe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=!!(e.compareDocumentPosition(this.contentDOM)&4);else if(this.dom.firstChild){if(t==0)for(let r=e;;r=r.parentNode){if(r==this.dom){i=!1;break}if(r.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let r=e;;r=r.parentNode){if(r==this.dom){i=!0;break}if(r.nextSibling)break}}return(i==null?s>0:i)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let s=!0,i=e;i;i=i.parentNode){let r=this.getDesc(i),o;if(r&&(!t||r.node))if(s&&(o=r.nodeDOM)&&!(q(o)?rn(o,e):o==e))s=!1;else return r}}getDesc(e){let t=e.pmViewDesc;for(let s=t;s;s=s.parent)if(s==this)return t}posFromDOM(e,t,s){for(let i=e;i;i=i.parentNode){let r=this.getDesc(i);if(r)return r.localPosFromDOM(e,t,s)}return-1}descAt(e){for(let t=0,s=0;te){i=e-r;break}r=l}if(i)return this.children[s].domFromPos(i-this.children[s].border,t);for(;s>0;s--){let r=this.children[s-1];if(r.size||!(r instanceof _c||r instanceof Bc&&r.side>=0))break}if(t<=0){let r,o=!0;for(;r=s?this.children[s-1]:null,!(!r||r.dom.parentNode==this.contentDOM);s--,o=!1);return r&&t&&o&&!r.border&&!r.domAtom?r.domFromPos(r.size,t):{node:this.contentDOM,offset:r?Ce(r.dom)+1:0}}else{let r,o=!0;for(;r=s=u&&t<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,t,u);e=o;for(let p=l;p>0;p--){let f=this.children[p-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=Ce(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(d>t||l==this.children.length-1)){t=d;for(let u=l+1;ug&&ot){let g=l;l=c,c=g}let h=document.createRange();h.setEnd(c.node,c.offset),h.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let s=0,i=0;i=s:es){let l=s+r.border,c=o-r.border;if(e>=l&&t<=c){this.dirty=e==s||t==o?Ut:fl,e==l&&t==c&&(r.contentLost||r.dom.parentNode!=this.contentDOM)?r.dirty=Ze:r.markDirty(e-l,t-l);return}else r.dirty=r.dom==r.contentDOM&&r.dom.parentNode==this.contentDOM&&!r.children.length?Ut:Ze}s=o}this.dirty=Ut}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let s=e==1?Ut:fl;t.dirty{if(!r)return i;if(r.parent)return r.parent.posBeforeChild(r)})),!t.type.spec.raw){let l=q(o)?o:document.createElement("span");l!=o&&l.appendChild(o),l.hasAttribute("contenteditable")||(l.contentEditable="false"),l.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,r=this}matchesWidget(e){return this.dirty==Ge&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class _y extends gs{constructor(e,t,s,i){super(e,[],t,null),this.textDOM=s,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class It extends gs{constructor(e,t,s,i,r){super(e,[],s,i),this.mark=t,this.spec=r}static create(e,t,s,i){let r=i.nodeViews[t.type.name],o=r&&r(t,i,s);return(!o||!o.dom)&&(o=ln.renderSpec(document,t.type.spec.toDOM(t,s),null,t.attrs)),new It(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Ze||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ze&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Ge){let s=this.parent;for(;!s.node;)s=s.parent;s.dirty0&&(r=Ir(r,0,e,s));for(let l=0;l{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},s,i),u=d&&d.dom,p=d&&d.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(!ve(u))throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:p}=ln.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!p&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Fc(u,s,t),d?c=new zy(e,t,s,i,u,p||null,f,d):t.isText?new ji(e,t,s,i,u,f):new Dt(e,t,s,i,u,p||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let s=this.children.length-1;s>=0;s--){let i=this.children[s];if(this.dom.contains(i.dom.parentNode)){t.contentElement=i.dom.parentNode;break}}if(!t.contentElement){let s=e&&e.find(i=>q(i)&&e.indexOf(i.parentNode)<0&&this.dom.contains(i));s?t.contentElement=s:t.getContent=()=>$.empty}}return t}matchesNode(e,t,s){return this.dirty==Ge&&e.eq(this.node)&&Gs(t,this.outerDeco)&&s.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let s=this.node.inlineContent,i=t,r=e.composing?this.localCompositionInfo(e,t):null,o=r&&r.pos>-1?r:null,l=r&&r.pos<0,c=new Fy(this,o&&o.node,e),d=this.node.inlineContent,u=d&&this.node.isBlock;qy(this.node,this.innerDeco,(p,f,h)=>{p.spec.marks?c.syncToMarks(p.spec.marks,s,e,f):p.type.side>=0&&!h&&c.syncToMarks(f==this.node.childCount?ie.none:this.node.child(f).marks,s,e,f),c.placeWidget(p,e,i)},(p,f,h,g)=>{c.syncToMarks(p.marks,s,e,g),u&&p.isAtom&&!p.isText&&c.addHackNode("IMG",c.top);let b;c.findNodeMatch(p,f,h,g)||l&&e.state.selection.from>i&&e.state.selection.to-1&&c.updateNodeAt(p,f,h,b,e)||c.updateNextNode(p,f,h,e,g,i)||c.addNode(p,f,h,e,i),i+=p.nodeSize,d&&(u=p.isAtom&&!p.isText)}),c.syncToMarks([],s,e,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Ut)&&(o&&this.protectLocalComposition(e,o),zc(this.contentDOM,this.children,e),Tn&&Uy(this.dom))}localCompositionInfo(e,t){let{from:s,to:i}=e.state.selection;if(!(e.state.selection instanceof U)||st+this.node.content.size)return null;let r=e.input.compositionNode;if(!r||!this.dom.contains(r.parentNode))return null;if(this.node.inlineContent){let o=r.nodeValue,l=Wy(this.node.content,o,s-t,i-t);return l<0?null:{node:r,pos:l,text:o}}else return{node:r,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:s,text:i}){if(this.getDesc(t))return;let r=t;for(;r.parentNode!=this.contentDOM;r=r.parentNode){for(;r.previousSibling;)r.parentNode.removeChild(r.previousSibling);for(;r.nextSibling;)r.parentNode.removeChild(r.nextSibling);r.pmViewDesc&&(r.pmViewDesc=void 0)}let o=new _y(this,r,t,i);e.input.compositionNodes.push(o),this.children=Ir(this.children,s,s+i.length,e,o)}update(e,t,s,i){return this.dirty==Ze||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,s,i),!0)}updateInner(e,t,s,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=s,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Ge}updateOuterDeco(e){if(Gs(e,this.outerDeco))return;let t=!q(this.nodeDOM),s=this.dom;this.dom=jc(this.dom,this.nodeDOM,Nr(this.outerDeco,this.node,t),Nr(e,this.node,t)),this.dom!=s&&(s.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){q(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){q(this.nodeDOM)&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function hl(n,e,t,s,i){Fc(s,e,n);let r=new Dt(void 0,n,e,t,s,s,s);return r.contentDOM&&r.updateChildren(i,0),r}class ji extends Dt{constructor(e,t,s,i,r,o){super(e,t,s,i,r,null,o)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,s,i){return this.dirty==Ze||this.dirty!=Ge&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Ge||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Ge,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,s){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,s)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,s){let i=this.node.cut(e,t),r=document.createTextNode(i.text);return new ji(this.parent,i,this.outerDeco,this.innerDeco,r,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Ze)}get domAtom(){return!1}isText(e){return this.node.text==e}}class _c extends gs{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ge&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class zy extends Dt{constructor(e,t,s,i,r,o,l,c){super(e,t,s,i,r,o,l),this.spec=c}update(e,t,s,i){if(this.dirty==Ze)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let r=this.spec.update(e,t,s);return r&&this.updateInner(e,t,s,i),r}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,s,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,s,i){this.spec.setSelection?this.spec.setSelection(e,t,s.root):super.setSelection(e,t,s,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function zc(n,e,t){let s=n.firstChild,i=!1;for(let r=0;r>1,l=Math.min(o,e.length);for(;r-1)c>this.index&&(this.changed=!0,this.destroyBetween(this.index,c)),this.top=this.top.children[this.index];else{let u=It.create(this.top,e[o],t,s);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,s,i){let r=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,s))r=this.top.children.indexOf(o,this.index);else for(let l=this.index,c=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(s){let d=t.children[s-1];if(d instanceof It)t=d,s=d.children.length;else{l=d,s--;break}}else{if(t==e)break e;s=t.parent.children.indexOf(t),t=t.parent}let c=l.node;if(c){if(c!=n.child(i-1))break;--i,r.set(l,i),o.push(l)}}return{index:i,matched:r,matches:o.reverse()}}function Hy(n,e){return n.type.side-e.type.side}function qy(n,e,t,s){let i=e.locals(n),r=0;if(i.length==0){for(let d=0;dr;)l.push(i[o++]);let g=r+f.nodeSize;if(f.isText){let m=g;o!m.inline):l.slice();s(f,b,e.forChild(r,f),h),r=g}}function Uy(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function Wy(n,e,t,s){for(let i=0,r=0;i=t){if(r>=s&&c.slice(s-e.length-l,s-l)==e)return s-e.length;let d=l=0&&d+e.length+l>=t)return l+d;if(t==s&&c.length>=s+e.length-l&&c.slice(s-l,s-l+e.length)==e)return s}}return-1}function Ir(n,e,t,s,i){let r=[];for(let o=0,l=0;o=t||u<=e?r.push(c):(dt&&r.push(c.slice(t-d,c.size,s)))}return r}function co(n,e=null){let t=n.domSelectionRange(),s=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),r=i&&i.size==0,o=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let l=s.resolve(o),c,d;if(_i(t)){for(c=o;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&W.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&yy(t.focusNode,t.focusOffset,i.dom))){let p=i.posBefore;d=new W(o==p?l:s.resolve(p))}else if(Ue&&e=="key"&&o>n.state.selection.to&&q(t.focusNode)&&t.focusOffset==t.focusNode.childNodes.length&&i&&i.posAtStart>n.state.selection.to)for(let p=t.focusNode;;p=p.parentNode){if(getComputedStyle(p).overflow!="visible"){d=X.findFrom(s.resolve(i.posAtStart),1);break}if(p==i.dom||p.nextSibling||!p.parentNode||!q(p.parentNode))break}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let p=o,f=o;for(let h=0;h{(t.anchorNode!=s||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Vc(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function Jy(n){let e=n.domSelection();if(!e)return;let t=n.cursorWrapper.dom,s=t.nodeName=="IMG";s?e.collapse(t.parentNode,Ce(t)+1):e.collapse(t,0),!s&&!n.state.selection.visible&&je&&Nt<=11&&(t.disabled=!0,t.disabled=!1)}function Hc(n,e){if(e instanceof W){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(yl(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else yl(n)}function yl(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function uo(n,e,t,s){return n.someProp("createSelectionBetween",i=>i(n,e,t))||U.between(e,t,s)}function kl(n){return n.editable&&!n.hasFocus()?!1:qc(n)}function qc(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return rn(n.dom,e.anchorNode)&&(n.editable||rn(n.dom,e.focusNode))}catch(t){return!1}}function Gy(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return sn(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Dr(n,e){let{$anchor:t,$head:s}=n.selection,i=e>0?t.max(s):t.min(s),r=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return r&&X.findFrom(r,e)}function wt(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function xl(n,e,t){let s=n.state.selection;if(s instanceof U)if(t.indexOf("s")>-1){let{$head:i}=s,r=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!r||r.isText||!r.isLeaf)return!1;let o=n.state.doc.resolve(i.pos+r.nodeSize*(e<0?-1:1));return wt(n,new U(s.$anchor,o))}else if(s.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=Dr(n.state,e);return i&&i instanceof W?wt(n,i):!1}else if(!(Je&&t.indexOf("m")>-1)){let i=s.$head,r=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!r||r.isText)return!1;let l=e<0?i.pos-r.nodeSize:i.pos;return r.isAtom||(o=n.docView.descAt(l))&&!o.contentDOM?W.isSelectable(r)?wt(n,new W(e<0?n.state.doc.resolve(i.pos-r.nodeSize):i)):wt(n,new U(n.state.doc.resolve(e<0?l:l+r.nodeSize))):!1}}else return!1;else{if(s instanceof W&&s.node.isInline)return wt(n,new U(e>0?s.$to:s.$from));{let i=Dr(n.state,e);return i?wt(n,i):!1}}}function Wn(n,e){let t=n.pmViewDesc;return t?t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR"):q(n)&&n.contentEditable=="false"}function pn(n,e){return e<0?Yy(n):Xy(n)}function Yy(n){let e=n.domSelectionRange(),t=e.focusNode,s=e.focusOffset;if(!t)return;let i,r,o=!1;for(Ue&&q(t)&&s0){if(!q(t))break;let l=t.childNodes[s-1];if(Wn(l,-1))i=t,r=--s;else if(ve(l))t=l,s=t.nodeValue.length;else break}else{if(Uc(t))break;{let l=t.previousSibling;for(;l&&Wn(l,-1);)i=t.parentNode,r=Ce(l),l=l.previousSibling;if(l)t=l,s=Ie(t);else{if(t=t.parentNode,t==n.dom)break;s=0}}}o?$r(n,t,s):i&&$r(n,i,r)}function Xy(n){let e=n.domSelectionRange(),t=e.focusNode,s=e.focusOffset;if(!t)return;let i=Ie(t),r,o;for(;;)if(s{n.state==i&>(n)},50)}function wl(n,e){let t=n.state.doc.resolve(e);if(!(Ee||Nc)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let r=n.coordsAtPos(e-1),o=(r.top+r.bottom)/2;if(o>i.top&&o1)return r.lefti.top&&o1)return r.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function Sl(n,e,t){let s=n.state.selection;if(s instanceof U&&!s.empty||t.indexOf("s")>-1||Je&&t.indexOf("m")>-1)return!1;let{$from:i,$to:r}=s;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let o=Dr(n.state,e);if(o&&o instanceof W)return wt(n,o)}if(!i.parent.inlineContent){let o=e<0?i:r,l=s instanceof qe?X.near(o,e):X.findFrom(o,e);return l?wt(n,l):!1}return!1}function Cl(n,e){if(!(n.state.selection instanceof U))return!0;let{$head:t,$anchor:s,empty:i}=n.state.selection;if(!t.sameParent(s))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let r=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(r&&!r.isText){let o=n.state.tr;return e<0?o.delete(t.pos-r.nodeSize,t.pos):o.delete(t.pos,t.pos+r.nodeSize),n.dispatch(o),!0}return!1}function Ml(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function e0(n){if(!$e||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&q(e)&&t==0&&e.firstChild&&q(e.firstChild)&&e.firstChild.contentEditable=="false"){let s=e.firstChild;Ml(n,s,"true"),setTimeout(()=>Ml(n,s,"false"),20)}return!1}function t0(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function n0(n,e){let t=e.keyCode,s=t0(e);if(t==8||Je&&t==72&&s=="c")return Cl(n,-1)||pn(n,-1);if(t==46&&!e.shiftKey||Je&&t==68&&s=="c")return Cl(n,1)||pn(n,1);if(t==13||t==27)return!0;if(t==37||Je&&t==66&&s=="c"){let i=t==37?wl(n,n.state.selection.from)=="ltr"?-1:1:-1;return xl(n,i,s)||pn(n,i)}else if(t==39||Je&&t==70&&s=="c"){let i=t==39?wl(n,n.state.selection.from)=="ltr"?1:-1:1;return xl(n,i,s)||pn(n,i)}else{if(t==38||Je&&t==80&&s=="c")return Sl(n,-1,s)||pn(n,-1);if(t==40||Je&&t==78&&s=="c")return e0(n)||Sl(n,1,s)||pn(n,1);if(s==(Je?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function po(n,e){n.someProp("transformCopied",h=>{e=h(e,n)});let t=[],{content:s,openStart:i,openEnd:r}=e;for(;i>1&&r>1&&s.childCount==1&&s.firstChild.childCount==1;){i--,r--;let h=s.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),s=h.content}let o=n.someProp("clipboardSerializer")||ln.fromSchema(n.state.schema),l=Xc(),c=l.createElement("div");c.appendChild(o.serializeFragment(s,{document:l}));let d=c.firstChild,u,p=0;for(;d&&q(d)&&(u=Yc[d.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let g=l.createElement(u[h]);for(;c.firstChild;)g.appendChild(c.firstChild);c.appendChild(g),p++}d=c.firstChild}d&&q(d)&&d.setAttribute("data-pm-slice",`${i} ${r}${p?` -${p}`:""} ${JSON.stringify(t)}`);let f=n.someProp("clipboardTextSerializer",h=>h(e,n))||e.content.textBetween(0,e.content.size,` `);return{dom:c,text:f,slice:e}}function Wc(n,e,t,s,i){let r=i.parent.type.spec.code,o,l;if(!t&&!e)return null;let c=!!e&&(s||r||!t);if(c){if(n.someProp("transformPastedText",f=>{e=f(e,r||s,n)}),r)return l=new z($.from(n.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0),n.someProp("transformPasted",f=>{l=f(l,n,!0)}),l;let p=n.someProp("clipboardTextParser",f=>f(e,i,s,n));if(p)l=p;else{let f=i.marks(),{schema:h}=n.state,g=ln.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(b=>{let m=o.appendChild(document.createElement("p"));b&&m.appendChild(g.serializeNode(h.text(b,f)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),o=r0(t),zi&&o0(o);let d=o&&o.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let p=+u[3];p>0;p--){let f=o.firstChild;for(;f&&!q(f);)f=f.nextSibling;if(!f)break;o=f}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||Ot.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!n0.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=l0(Tl(l,+u[1],+u[2]),u[4]);else if(l=z.maxOpen(s0(l.content,i),!0),l.openStart||l.openEnd){let p=0,f=0;for(let h=l.content.firstChild;p{l=p(l,n,c)}),l}const n0=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function s0(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),r,o=[];if(n.forEach(l=>{if(!o)return;let c=i.findWrapping(l.type),d;if(!c)return o=null;if(d=o.length&&r.length&&Jc(c,r,l,o[o.length-1],0))o[o.length-1]=d;else{o.length&&(o[o.length-1]=Gc(o[o.length-1],r.length));let u=Kc(l,c);o.push(u),i=i.matchType(u.type),r=c}}),o)return $.from(o)}return n}function Kc(n,e,t=0){for(let s=e.length-1;s>=t;s--)n=e[s].create(null,$.from(n));return n}function Jc(n,e,t,s,i){if(i1&&(r=0),i=t&&(l=e<0?o.contentMatchAt(0).fillBefore(l,r<=i).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore($.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,o.copy(l))}function Tl(n,e,t){return et})}return $n.createHTML(n)}function r0(n){let e=/^(\s*]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Xc(),s=t.body,i=/<([a-z][^>\s]+)/i.exec(n),r;if((r=i&&Yc[i[1].toLowerCase()])&&(n=r.map(o=>"<"+o+">").join("")+n+r.map(o=>"").reverse().join("")),s.innerHTML=i0(n),r)for(let o=0;o=0;l-=2){let c=t.nodes[s[l]];if(!c||c.hasRequiredAttrs())break;try{i=$.from(c.create(s[l+1],i))}catch(d){break}r++,o++}return new z(i,r,o)}const Pe={},Be={},a0={touchstart:!0,touchmove:!0};class c0{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function d0(n){for(let e in Pe){let t=Pe[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=s=>{p0(n,s)&&!fo(n,s)&&(n.editable||!(s.type in Be))&&t(n,s)},a0[e]?{passive:!0}:void 0)}$e&&n.dom.addEventListener("input",()=>null),Lr(n)}function ht(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function u0(n){n.input.mouseDown&&n.input.mouseDown.done(),n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Lr(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=s=>fo(n,s))})}function fo(n,e){return n.someProp("handleDOMEvents",t=>{let s=t[e.type];return s?s(n,e)||e.defaultPrevented:!1})}function p0(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function f0(n,e){!fo(n,e)&&Pe[e.type]&&(n.editable||!(e.type in Be))&&Pe[e.type](n,e)}Be.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!td(n)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(ft&&Ee&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Tn&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let s=Date.now();n.input.lastIOSEnter=s,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==s&&(n.someProp("handleKeyDown",i=>i(n,qt(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",s=>s(n,t))||t0(n,t)?t.preventDefault():ht(n,"key")};Be.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Be.keypress=(n,e)=>{let t=e;if(td(n)||!t.charCode||t.ctrlKey&&!t.altKey||Je&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let s=n.state.selection;if(!(s instanceof U)||!s.$from.sameParent(s.$to)){let i=String.fromCharCode(t.charCode),r=()=>n.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,s.$from.pos,s.$to.pos,i,r))&&n.dispatch(r()),t.preventDefault()}};function bs(n){return{left:n.clientX,top:n.clientY}}function h0(n,e){let t=e.x-n.clientX,s=e.y-n.clientY;return t*t+s*s<100}function ho(n,e,t,s,i){if(s==-1)return!1;let r=n.state.doc.resolve(s);for(let o=r.depth+1;o>0;o--)if(n.someProp(e,l=>o>r.depth?l(n,t,r.nodeAfter,r.before(o),i,!0):l(n,t,r.node(o),r.before(o),i,!1)))return!0;return!1}function ys(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let s=n.state.tr.setSelection(e);s.setMeta("pointer",!0),n.dispatch(s)}function m0(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),s=t.nodeAfter;return s&&s.isAtom&&W.isSelectable(s)?(ys(n,new W(t)),!0):!1}function g0(n,e){if(e==-1)return!1;let t=n.state.selection,s,i;t instanceof W&&(s=t.node);let r=n.state.doc.resolve(e);for(let o=r.depth+1;o>0;o--){let l=o>r.depth?r.nodeAfter:r.node(o);if(W.isSelectable(l)){s&&t.$from.depth>0&&o>=t.$from.depth&&r.before(t.$from.depth+1)==t.$from.pos?i=r.before(t.$from.depth):i=r.before(o);break}}return i!=null?(ys(n,W.create(n.state.doc,i)),!0):!1}function b0(n,e,t,s,i){return ho(n,"handleClickOn",e,t,s)||n.someProp("handleClick",r=>r(n,e,s))||(i?g0(n,t):m0(n,t))}function y0(n,e,t,s){return ho(n,"handleDoubleClickOn",e,t,s)||n.someProp("handleDoubleClick",i=>i(n,e,s))}function v0(n,e,t,s){return ho(n,"handleTripleClickOn",e,t,s)||n.someProp("handleTripleClick",i=>i(n,e,s))||k0(n,t,s)}function k0(n,e,t){if(t.button!=0)return!1;let s=Zc(n,e,!0),i=n.state.doc;return s?(ys(n,s),s instanceof U&&i.eq(n.state.doc)&&(n.input.mouseDown=new w0(n,s)),!0):!1}function Zc(n,e,t){let s=n.state.doc;if(e==-1)return s.inlineContent?U.create(s,0,s.content.size):null;let i=s.resolve(e);for(let r=i.depth+1;r>0;r--){let o=r>i.depth?i.nodeAfter:i.node(r),l=i.before(r);if(o.inlineContent)return U.create(s,l+1,l+1+o.content.size);if(t&&W.isSelectable(o))return W.create(s,l)}return null}function mo(n){return Ys(n)}const Qc=Je?"metaKey":"ctrlKey";Pe.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let s=mo(n),i=Date.now(),r="singleClick";i-n.input.lastClick.time<500&&h0(t,n.input.lastClick)&&!t[Qc]&&n.input.lastClick.button==t.button&&(n.input.lastClick.type=="singleClick"?r="doubleClick":n.input.lastClick.type=="doubleClick"&&(r="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:r,button:t.button},n.input.mouseDown&&n.input.mouseDown.done();let o=n.posAtCoords(bs(t));o&&(r=="singleClick"?n.input.mouseDown=new x0(n,o,t,!!s):(r=="doubleClick"?y0:v0)(n,o.pos,o.inside,t)?t.preventDefault():ht(n,"pointer"))};class ed{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class x0 extends ed{constructor(e,t,s,i){super(e),this.pos=t,this.event=s,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!s[Qc],this.allowDefault=s.shiftKey;let r,o;if(t.inside>-1)r=e.state.doc.nodeAt(t.inside),o=t.inside;else{let u=e.state.doc.resolve(t.pos);r=u.parent,o=u.depth?u.before():0}const l=i?null:s.target,c=l?e.docView.nearestDesc(l,!0):null;this.target=c&&q(c.nodeDOM)?c.nodeDOM:null;let{selection:d}=e.state;s.button==0&&(r.type.spec.draggable&&r.type.spec.selectable!==!1||d instanceof W&&d.from<=o&&d.to>o)&&(this.mightDrag={node:r,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ue&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),ht(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||gt(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(bs(e))),this.updateAllowDefault(e),this.allowDefault||!t?ht(this.view,"pointer"):b0(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||$e&&this.mightDrag&&!this.mightDrag.node.isAtom||Ee&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(ys(this.view,X.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):ht(this.view,"pointer")}move(e){this.updateAllowDefault(e),ht(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class w0 extends ed{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),ht(this.view,"pointer");let t=this.view.posAtCoords(bs(e)),s=t&&Zc(this.view,t.inside,!1);if(!s)return;let{doc:i}=this.view.state,r=this.startSelection,[o,l]=s.from{n.input.lastTouch=Date.now(),mo(n),ht(n,"pointer")};Pe.touchmove=n=>{n.input.lastTouch=Date.now(),ht(n,"pointer")};Pe.contextmenu=n=>mo(n);function td(n,e){return n.composing?!0:$e&&Math.abs(Date.now()-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const S0=ft?5e3:-1;Be.compositionstart=Be.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof U&&e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(s=>s.type.spec.inclusive===!1)||Ee&&Nc&&C0(n)))n.markCursor=n.state.storedMarks||t.marks(),Ys(n,!0),n.markCursor=null;else if(Ys(n,!e.selection.empty),Ue&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let s=n.domSelectionRange();for(let i=s.focusNode,r=s.focusOffset;i&&q(i)&&r!=0;){let o=r<0?i.lastChild:i.childNodes[r-1];if(!o)break;if(ye(o)){let l=n.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else i=o,r=-1}}n.input.composing=!0}nd(n,S0)};function C0(n){let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(!e||!q(e)||t>=e.childNodes.length)return!1;let s=e.childNodes[t];return q(s)&&s.contentEditable=="false"}Be.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Date.now(),n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.badSafariComposition?n.domObserver.forceFlush():n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,nd(n,20))};function nd(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Ys(n),e))}function sd(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Date.now());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function M0(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=gv(e.focusNode,e.focusOffset),s=bv(e.focusNode,e.focusOffset);if(t&&s&&t!=s){let i=s.pmViewDesc,r=n.domObserver.lastChangedTextNode;if(t==r||s==r)return r;if(!i||!i.isText(s.nodeValue))return s;if(n.input.compositionNode==s){let o=t.pmViewDesc;if(!(!o||!o.isText(t.nodeValue)))return s}}return t||s}function Ys(n,e=!1){if(!(ft&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),sd(n),e||n.docView&&n.docView.dirty){let t=co(n),s=n.state.selection;return t&&!t.eq(s)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!s.$from.node(s.$from.sharedDepth(s.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function T0(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let s=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),s.removeAllRanges(),s.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const as=je&&Nt<15||Tn&&xv<604;Pe.copy=Be.cut=(n,e)=>{let t=e,s=n.state.selection,i=t.type=="cut";if(s.empty)return;let r=as?null:t.clipboardData,o=s.content(),{dom:l,text:c}=po(n,o);r?(t.preventDefault(),r.clearData(),r.setData("text/html",l.innerHTML),r.setData("text/plain",c)):T0(n,l),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function E0(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function A0(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,s=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(s.contentEditable="true"),s.style.cssText="position: fixed; left: -10000px; top: 10px",s.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),s.parentNode&&s.parentNode.removeChild(s),t?cs(n,s.value,null,i,e):cs(n,s.textContent,s.innerHTML,i,e)},50)}function cs(n,e,t,s,i){let r=Wc(n,e,t,s,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,i,r||z.empty)))return!0;if(!r)return!1;let o=E0(r),l=o?n.state.tr.replaceSelectionWith(o,s):n.state.tr.replaceSelection(r);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function id(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Be.paste=(n,e)=>{let t=e;if(n.composing&&!ft)return;let s=as?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;s&&cs(n,id(s),s.getData("text/html"),i,t)?t.preventDefault():A0(n,t)};class rd{constructor(e,t,s){this.slice=e,this.move=t,this.node=s}}const O0=Je?"altKey":"ctrlKey";function od(n,e){let t;return n.someProp("dragCopies",s=>{t=t||s(e)}),t!=null?!t:!e[O0]}Pe.dragstart=(n,e)=>{let t=e,s=n.input.mouseDown;if(s&&s.done(),!t.dataTransfer)return;let i=n.state.selection,r=i.empty?null:n.posAtCoords(bs(t)),o;if(!(r&&r.pos>=i.from&&r.pos<=(i instanceof W?i.to-1:i.to))){if(s&&s.mightDrag)o=W.create(n.state.doc,s.mightDrag.pos);else if(t.target&&q(t.target)){let p=n.docView.nearestDesc(t.target,!0);p&&p.node.type.spec.draggable&&p!=n.docView&&(o=W.create(n.state.doc,p.posBefore))}}let l=(o||n.state.selection).content(),{dom:c,text:d,slice:u}=po(n,l);(!t.dataTransfer.files.length||!Ee||Oc>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(as?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",as||t.dataTransfer.setData("text/plain",d),n.dragging=new rd(u,od(n,t),o)};Pe.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Be.dragover=Be.dragenter=(n,e)=>e.preventDefault();Be.drop=(n,e)=>{try{N0(n,e,n.dragging)}finally{n.dragging=null}};function N0(n,e,t){if(!e.dataTransfer)return;let s=n.posAtCoords(bs(e));if(!s)return;let i=n.state.doc.resolve(s.pos),r=t&&t.slice;r?n.someProp("transformPasted",h=>{r=h(r,n,!1)}):r=Wc(n,id(e.dataTransfer),as?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(t&&od(n,e));if(n.someProp("handleDrop",h=>h(n,e,r||z.empty,o))){e.preventDefault();return}if(!r)return;e.preventDefault();let l=r?lc(n.state.doc,i.pos,r):i.pos;l==null&&(l=i.pos);let c=n.state.tr;if(o){let{node:h}=t;h?h.replace(c):c.deleteSelection()}let d=c.mapping.map(l),u=r.openStart==0&&r.openEnd==0&&r.content.childCount==1,p=c.doc;if(u?c.replaceRangeWith(d,d,r.content.firstChild):c.replaceRange(d,d,r),c.doc.eq(p))return;let f=c.doc.resolve(d);if(u&&W.isSelectable(r.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(r.content.firstChild))c.setSelection(new W(f));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,b,m,y)=>h=y),c.setSelection(uo(n,f,c.doc.resolve(h)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))}Pe.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&>(n)},20))};Pe.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};Pe.beforeinput=(n,e)=>{if(ft&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:s}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=s||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",r=>r(n,qt(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in Be)Pe[n]=Be[n];function ds(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Xs{constructor(e,t){this.toDOM=e,this.spec=t||Qt,this.side=this.spec.side||0}map(e,t,s,i){let{pos:r,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new Le(r-s,r-s,this)}valid(){return!0}eq(e){return this==e||e instanceof Xs&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ds(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class $t{constructor(e,t){this.attrs=e,this.spec=t||Qt}map(e,t,s,i){let r=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-s,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-s;return r>=o?null:new Le(r,o,this)}valid(e,t){return t.from=e&&(!r||r(l.spec))&&s.push(l.copy(l.from+i,l.to+i))}for(let o=0;oe){let l=this.children[o]+1;this.children[o+2].findInner(e-l,t-l,s,i+l,r)}}map(e,t,s){return this==Ne||e.maps.length==0?this:this.mapInner(e,t,0,0,s||Qt)}mapInner(e,t,s,i,r){let o;for(let l=0;l{let d=c+s,u;if(u=ad(t,l,d)){for(i||(i=this.children.slice());rl&&p.to=e){this.children[l]==e&&(s=this.children[l+2]);break}let r=e+1,o=r+t.content.size;for(let l=0;lr&&c.type instanceof $t){let d=Math.max(r,c.from)-r,u=Math.min(o,c.to)-r;di.map(e,t,Qt));return Mt.from(s)}forChild(e,t){if(t.isLeaf)return ne.empty;let s=[];for(let i=0;it instanceof ne)?e:e.reduce((t,s)=>t.concat(s instanceof ne?s:s.members),[]))}}forEachSet(e){for(let t=0;t{let m=b-g-(h-f);for(let y=0;yS+u-p)continue;let A=l[y]+u-p;h>=A?l[y+1]=f<=A?-2:-1:f>=u&&m&&(l[y]+=m,l[y+1]+=m)}p+=m}),u=t.maps[d].map(u,-1)}let c=!1;for(let d=0;d=s.content.size){c=!0;continue}let f=t.map(n[d+1]+r,-1),h=f-i,{index:g,offset:b}=s.content.findIndex(p),m=s.maybeChild(g);if(m&&b==p&&b+m.nodeSize==h){let y=l[d+2].mapInner(t,m,u+1,n[d]+r+1,o);y!=Ne?(l[d]=p,l[d+1]=h,l[d+2]=y):(l[d+1]=-2,c=!0)}else c=!0}if(c){let d=D0(l,n,e,t,i,r,o),u=Zs(d,s,0,o);e=u.local;for(let p=0;pt&&o.to{let d=ad(n,l,c+t);if(d){r=!0;let u=Zs(d,l,t+c+1,s);u!=Ne&&i.push(c,c+l.nodeSize,u)}});let o=ld(r?cd(n):n,-t).sort(en);for(let l=0;l0;)e++;n.splice(e,0,t)}function rr(n){let e=[];return n.someProp("decorations",t=>{let s=t(n.state);s&&s!=Ne&&e.push(s)}),n.cursorWrapper&&e.push(ne.create(n.state.doc,[n.cursorWrapper.deco])),Mt.from(e)}const $0={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},R0=je&&Nt<=11;class L0{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class P0{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new L0,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(s=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():$e&&e.composing&&s.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),R0&&(this.onCharData=s=>{this.queue.push({target:s.target,type:"characterData",oldValue:s.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,$0)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(kl(this.view)){if(this.suppressingSelectionUpdates)return gt(this.view);if(je&&Nt<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&sn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,s;for(let r=e.focusNode;r;r=Mn(r))t.add(r);for(let r=e.anchorNode;r;r=Mn(r))if(t.has(r)){s=r;break}let i=s&&this.view.docView.nearestDesc(s);if(i&&i.ignoreMutation({type:"selection",target:ye(s)?s.parentNode:s}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let s=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(s)&&kl(e)&&!this.ignoreSelectionChange(s),r=-1,o=-1,l=!1,c=[];if(e.editable)for(let u=0;uu.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||Ee&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(u=>u.type=="childList"&&u.removedNodes.length))){for(let u of c)if(u.nodeName=="BR"&&u.parentNode){let p=u.nextSibling;for(;p&&q(p);){if(p.contentEditable=="false"){u.parentNode.removeChild(u);break}p=p.firstChild}}}else if(Ue&&c.length){let u=c.filter(p=>p.nodeName=="BR");if(u.length==2){let[p,f]=u;p.parentNode&&p.parentNode.parentNode==f.parentNode?f.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let f of u){let h=f.parentNode;h&&h.nodeName=="LI"&&(!p||z0(e,p)!=h)&&f.remove()}}}let d=null;r<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(r>-1&&(e.docView.markDirty(r,o),B0(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,j0(e,c)),this.handleDOMChange(r,o,l,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(s)||gt(e),this.currentSelection.set(s))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let s=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(s==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!s||s.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;ur;y--){let S=i.childNodes[y-1],A=S.pmViewDesc;if(S.nodeName=="BR"&&!A){o=y;break}if(!A||A.size)break}let f=n.state.doc,h=n.someProp("domParser")||Ot.fromSchema(n.state.schema),g=f.resolve(l),b=null,m=h.parse(i,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:r,to:o,preserveWhitespace:g.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:V0(s),context:g});if(u&&u[0].pos!=null){let y=u[0].pos,S=u[1]&&u[1].pos;S==null&&(S=y),b={anchor:y+l,head:S+l}}return{doc:m,sel:b,from:l,to:c}}const V0=n=>e=>{let t=e.pmViewDesc;if(t)return t.parseRule(n);if(e.nodeName=="BR"&&e.parentNode){if($e&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let s=document.createElement("div");return s.appendChild(document.createElement("li")),{skip:s}}else if(e.parentNode.lastChild==e||$e&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},H0=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function q0(n,e,t,s,i){let r=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let M=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,w=co(n,M);if(w&&!n.state.selection.eq(w)){if(Ee&&ft&&n.input.lastKeyCode===13&&Date.now()-100N(n,qt(13,"Enter"))))return;let T=n.state.tr.setSelection(w);M=="pointer"?T.setMeta("pointer",!0):M=="key"&&T.scrollIntoView(),r&&T.setMeta("composition",r),n.dispatch(T)}return}let o=n.state.doc.resolve(e),l=o.sharedDepth(t);e=o.before(l+1),t=n.state.doc.resolve(t).after(l+1);let c=n.state.selection,d=F0(n,e,t,i),u=n.state.doc,p=u.slice(d.from,d.to),f,h;n.input.lastKeyCode===8&&Date.now()-100Date.now()-225||ft)&&i.some(M=>q(M)&&!H0.test(M.nodeName))&&(!g||g.endA>=g.endB)&&n.someProp("handleKeyDown",M=>M(n,qt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!g)if(s&&c instanceof U&&!c.empty&&c.$head.sameParent(c.$anchor)&&!n.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))g={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let M=Il(n,n.state.doc,d.sel);if(M&&!M.eq(n.state.selection)){let w=n.state.tr.setSelection(M);r&&w.setMeta("composition",r),n.dispatch(w)}}return}n.state.selection.fromn.state.selection.from&&g.start<=n.state.selection.from+2&&n.state.selection.from>=d.from?g.start=n.state.selection.from:g.endA=n.state.selection.to-2&&n.state.selection.to<=d.to&&(g.endB+=n.state.selection.to-g.endA,g.endA=n.state.selection.to)),je&&Nt<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>d.from&&d.doc.textBetween(g.start-d.from-1,g.start-d.from+1)=="  "&&(g.start--,g.endA--,g.endB--);let b=d.doc.resolveNoCache(g.start-d.from),m=d.doc.resolveNoCache(g.endB-d.from),y=u.resolve(g.start),S=b.sameParent(m)&&b.parent.inlineContent&&y.end()>=g.endA;if((Tn&&n.input.lastIOSEnter>Date.now()-225&&(!S||i.some(M=>M.nodeName=="DIV"||M.nodeName=="P"))||!S&&K0(d.doc,b.pos,m.pos))&&n.someProp("handleKeyDown",M=>M(n,qt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>g.start&&W0(u,g.start,g.endA,b,m)&&n.someProp("handleKeyDown",M=>M(n,qt(8,"Backspace")))){ft&&Ee&&n.domObserver.suppressSelectionUpdates();return}Ee&&g.endB==g.start&&(n.input.lastChromeDelete=Date.now()),ft&&!S&&b.start()!=m.start()&&m.parentOffset==0&&b.depth==m.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==g.endA&&(g.endB-=2,m=d.doc.resolveNoCache(g.endB-d.from),setTimeout(()=>{n.someProp("handleKeyDown",function(M){return M(n,qt(13,"Enter"))})},20));let A=g.start,O=g.endA,B=M=>{let w=M||n.state.tr.replace(A,O,d.doc.slice(g.start-d.from,g.endB-d.from));if(d.sel){let T=Il(n,w.doc,d.sel);T&&!(Ee&&n.composing&&T.empty&&(g.start!=g.endB||n.input.lastChromeDeletegt(n),20));let M=B(n.state.tr.delete(A,O)),w=u.resolve(g.start).marksAcross(u.resolve(g.endA));w&&M.ensureMarks(w),n.dispatch(M)}else if(g.endA==g.endB&&(E=U0(b.parent.content.cut(b.parentOffset,m.parentOffset),y.parent.content.cut(y.parentOffset,g.endA-y.start())))){let M=B(n.state.tr);E.type=="add"?M.addMark(A,O,E.mark):M.removeMark(A,O,E.mark),n.dispatch(M)}else if(b.parent.child(b.index()).isText&&b.index()==m.index()-(m.textOffset?0:1)){let M=b.parent.textBetween(b.parentOffset,m.parentOffset),w=()=>B(n.state.tr.insertText(M,A,O));n.someProp("handleTextInput",T=>T(n,A,O,M,w))||n.dispatch(w())}else n.dispatch(B());else n.dispatch(B())}function Il(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:uo(n,e.resolve(t.anchor),e.resolve(t.head))}function U0(n,e){let t=n.firstChild.marks,s=e.firstChild.marks,i=t,r=s,o,l,c;for(let u=0;uu.mark(l.addToSet(u.marks));else if(i.length==0&&r.length==1)l=r[0],o="remove",c=u=>u.mark(l.removeFromSet(u.marks));else return null;let d=[];for(let u=0;ut||or(o,!0,!1){r.isTextblock&&o>=e&&o0&&(e||n.indexAfter(s)==n.node(s).childCount);)s--,i++,e=!1;if(t){let r=n.node(s).maybeChild(n.indexAfter(s));for(;r&&!r.isLeaf;)r=r.firstChild,i++}return i}function J0(n,e,t,s,i){let r=n.findDiffStart(e,t),o=t+n.size,l=t+e.size;if(r==null)return null;let{a:c,b:d}=n.findDiffEnd(e,o,l);if(i=="end"){let u=Math.max(0,r-Math.min(c,d));s-=c+u-r}if(c=c?r-s:0;r-=u,d=r+(d-c),c=r}else if(d=d?r-s:0;r-=u,c=r+(c-d),d=r}return{start:r,endA:c,endB:d}}class dd{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new c0,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Pl),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Rl(this),$l(this),this.nodeViews=Ll(this),this.docView=hl(this.state.doc,Dl(this),rr(this),this.dom,this),this.domObserver=new P0(this,(s,i,r,o)=>q0(this,s,i,r,o)),this.domObserver.start(),d0(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Lr(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Pl),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let s in this._props)t[s]=this._props[s];t.state=this.state;for(let s in e)t[s]=e[s];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var s;let i=this.state,r=!1,o=!1;e.storedMarks&&this.composing&&(sd(this),o=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let h=Ll(this);Y0(h,this.nodeViews)&&(this.nodeViews=h,r=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&Lr(this),this.editable=Rl(this),$l(this);let c=rr(this),d=Dl(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",p=r||!this.docView.matchesNode(e.doc,d,c);(p||!e.selection.eq(i.selection))&&(o=!0);let f=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&Cv(this);if(o){this.domObserver.stop();let h=p&&(je||Ee)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&G0(i.selection,e.selection);if(p){let b=Ee?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=M0(this)),(r||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=hl(e.doc,d,c,this.dom,this)),b&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}let g=this.input.mouseDown;h||!(g&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Jv(this)&&g.delaySelUpdate())?gt(this,h):(Hc(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((s=this.dragging)===null||s===void 0)&&s.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&Mv(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!rn(this.dom,e))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof W){let t=this.docView.domAfterPos(this.state.selection.from);q(t)&&cl(this,t.getBoundingClientRect(),e)}else cl(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t0&&rt.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Iv(this,e)}coordsAtPos(e,t=1){return Lc(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,s=-1){let i=this.docView.posFromDOM(e,t,s);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return Pv(this,t||this.state,e)}pasteHTML(e,t){return cs(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return cs(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return po(this,e)}destroy(){this.docView&&(u0(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],rr(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,hv())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return f0(this,e)}domSelectionRange(){let e=this.dom.isConnected!==!1&&this.domSelection();return e?$e&&this.root.nodeType===11&&vv(this.dom.ownerDocument)==this.dom&&_0(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}dd.prototype.dispatch=function(n){let e=this._props.dispatchTransaction;e?e.call(this,n):this.updateState(this.state.apply(n))};function Dl(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let s in t)s=="class"?e.class+=" "+t[s]:s=="style"?e.style=(e.style?e.style+";":"")+t[s]:!e[s]&&s!="contenteditable"&&s!="nodeName"&&(e[s]=String(t[s]))}),e.translate||(e.translate="no"),[Le.node(0,n.state.doc.content.size,e)]}function $l(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:Le.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function Rl(n){return!n.someProp("editable",e=>e(n.state)===!1)}function G0(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function Ll(n){let e=Object.create(null);function t(s){for(let i in s)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=s[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function Y0(n,e){let t=0,s=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)s++;return t!=s}function Pl(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Lt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Qs={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},X0=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),Z0=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Me=0;Me<10;Me++)Lt[48+Me]=Lt[96+Me]=String(Me);for(var Me=1;Me<=24;Me++)Lt[Me+111]="F"+Me;for(var Me=65;Me<=90;Me++)Lt[Me]=String.fromCharCode(Me+32),Qs[Me]=String.fromCharCode(Me);for(var lr in Lt)Qs.hasOwnProperty(lr)||(Qs[lr]=Lt[lr]);function Q0(n){var e=X0&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Z0&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Qs:Lt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const e1=typeof navigator!="undefined"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),t1=typeof navigator!="undefined"&&/Win/.test(navigator.platform);function n1(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let s,i,r,o;for(let l=0;l=t?we.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};we.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};we.prototype.forEach=function(e,t,s){t===void 0&&(t=0),s===void 0&&(s=this.length),t<=s?this.forEachInner(e,t,s,0):this.forEachInvertedInner(e,t,s,0)};we.prototype.map=function(e,t,s){t===void 0&&(t=0),s===void 0&&(s=this.length);var i=[];return this.forEach(function(r,o){return i.push(e(r,o))},t,s),i};we.from=function(e){return e instanceof we?e:e&&e.length?new pd(e):we.empty};var pd=(function(n){function e(s){n.call(this),this.values=s}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,r){return i==0&&r==this.length?this:new e(this.values.slice(i,r))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,r,o,l){for(var c=r;c=o;c--)if(i(this.values[c],l+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=ei)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=ei)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(we);we.empty=new pd([]);var r1=(function(n){function e(t,s){n.call(this),this.left=t,this.right=s,this.length=t.length+s.length,this.depth=Math.max(t.depth,s.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(s){return sl&&this.right.forEachInner(s,Math.max(i-l,0),Math.min(this.length,r)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(s,i,r,o){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(s,i-l,Math.max(r,l)-l,o+l)===!1||r=r?this.right.slice(s-r,i-r):this.left.slice(s,r).append(this.right.slice(0,i-r))},e.prototype.leafAppend=function(s){var i=this.right.leafAppend(s);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(s){var i=this.left.leafPrepend(s);if(i)return new e(i,this.right)},e.prototype.appendInner=function(s){return this.left.depth>=Math.max(this.right.depth,s.depth)+1?new e(this.left,new e(this.right,s)):new e(this,s)},e})(we);const o1=500;class Ye{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}let i,r;t&&(i=this.remapping(s,this.items.length),r=i.maps.length);let o=e.tr,l,c,d=[],u=[];return this.items.forEach((p,f)=>{if(!p.step){i||(i=this.remapping(s,f+1),r=i.maps.length),r--,u.push(p);return}if(i){u.push(new et(p.map));let h=p.step.map(i.slice(r)),g;h&&o.maybeStep(h).doc&&(g=o.mapping.maps[o.mapping.maps.length-1],d.push(new et(g,void 0,void 0,d.length+u.length))),r--,g&&i.appendMap(g,r)}else o.maybeStep(p.step);if(p.selection)return l=i?p.selection.map(i.slice(r)):p.selection,c=new Ye(this.items.slice(0,s).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:l}}addTransform(e,t,s,i){let r=[],o=this.eventCount,l=this.items,c=!i&&l.length?l.get(l.length-1):null;for(let u=0;ua1&&(l=l1(l,d),o-=d),new Ye(l.append(r),o)}remapping(e,t){let s=new rs;return this.items.forEach((i,r)=>{let o=i.mirrorOffset!=null&&r-i.mirrorOffset>=e?s.maps.length-i.mirrorOffset:void 0;s.appendMap(i.map,o)},e,t),s}addMaps(e){return this.eventCount==0?this:new Ye(this.items.append(e.map(t=>new et(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;t=Math.min(this.items.length,t);let s=[],i=this.items.length-t,r=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},i);let c=t;this.items.forEach(f=>{let h=r.getMirror(--c);if(h==null)return;o=Math.min(o,h);let g=r.maps[h];if(f.step){let b=e.steps[h].invert(e.docs[h]),m=f.selection&&f.selection.map(r.slice(c+1,h));m&&l++,s.push(new et(g,b,m))}else s.push(new et(g))},i);let d=[];for(let f=t;fo1&&(p=p.compress(this.items.length-s.length)),p}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),s=t.maps.length,i=[],r=0;return this.items.forEach((o,l)=>{if(l>=e)i.push(o),o.selection&&r++;else if(o.step){let c=o.step.map(t.slice(s)),d=c&&c.getMap();if(s--,d&&t.appendMap(d,s),c){let u=o.selection&&o.selection.map(t.slice(s));u&&r++;let p=new et(d.invert(),c,u),f,h=i.length-1;(f=i.length&&i[h].merge(p))?i[h]=f:i.push(p)}}else o.map&&s--},this.items.length,0),new Ye(we.from(i.reverse()),r)}}Ye.empty=new Ye(we.empty,0);function l1(n,e){let t;return n.forEach((s,i)=>{if(s.selection&&e--==0)return t=i,!1}),n.slice(t)}class et{constructor(e,t,s,i){this.map=e,this.step=t,this.selection=s,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new et(t.getMap().invert(),t,this.selection)}}}class St{constructor(e,t,s,i,r){this.done=e,this.undone=t,this.prevRanges=s,this.prevTime=i,this.prevComposition=r}}const a1=20;function c1(n,e,t,s){let i=t.getMeta(Rt),r;if(i)return i.historyState;t.getMeta(fd)&&(n=new St(n.done,n.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(o&&o.getMeta(Rt))return o.getMeta(Rt).redo?new St(n.done.addTransform(t,void 0,s,Fs(e)),n.undone,Bl(t.mapping.maps),n.prevTime,n.prevComposition):new St(n.done,n.undone.addTransform(t,void 0,s,Fs(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),c=n.prevTime==0||!o&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-s.newGroupDelay||!d1(t,n.prevRanges)),d=o?cr(n.prevRanges,t.mapping):Bl(t.mapping.maps);return new St(n.done.addTransform(t,c?e.selection.getBookmark():void 0,s,Fs(e)),Ye.empty,d,t.time,l==null?n.prevComposition:l)}else return(r=t.getMeta("rebased"))?new St(n.done.rebased(t,r),n.undone.rebased(t,r),cr(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new St(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),cr(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function d1(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((s,i)=>{for(let r=0;r=e[r]&&(t=!0)}),t}function Bl(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((s,i,r,o)=>e.push(r,o));return e}function cr(n,e){if(!n)return null;let t=[];for(let s=0;s{let i=Rt.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(s){let r=u1(i,t,n);r&&s(e?r.scrollIntoView():r)}return!0}}const md=hd(!1,!0),gd=hd(!0,!0);function h1(n){return n.getMeta(Rt)!=null}function Fi(n){const{state:e,transaction:t}=n;let{selection:s}=t,{doc:i}=t,{storedMarks:r}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return r},get selection(){return s},get doc(){return i},get tr(){return s=t.selection,i=t.doc,r=t.storedMarks,t}}}var xn=class bd{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:s}=this,{view:i}=t,{tr:r}=s,o=this.buildProps(r);return Object.fromEntries(Object.entries(e).map(([l,c])=>[l,(...u)=>{const p=c(...u)(o);return!r.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(r),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:s,editor:i,state:r}=this,{view:o}=i,l=[],c=!!e,d=e||r.tr,u=()=>(!c&&t&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(d),l.every(f=>f===!0)),p={...Object.fromEntries(Object.entries(s).map(([f,h])=>[f,(...b)=>{const m=this.buildProps(d,t),y=h(...b)(m);return l.push(y),p}])),run:u};return p}static createFakeChain(){const e=new Proxy({},{get:(t,s)=>{if(s!=="then")return s==="run"?()=>!1:()=>e}});return e}createCan(e){const{rawCommands:t,state:s}=this,i=!1,r=e||s.tr,o=this.buildProps(r,i);return{...Object.fromEntries(Object.entries(t).map(([l,c])=>[l,(...d)=>c(...d)({...o,dispatch:void 0})])),chain:()=>this.createChain(r,i)}}static createFallbackCan(){const e=bd.createFakeChain();return new Proxy({chain:()=>e},{get:(t,s)=>{if(s!=="then")return s==="chain"?t.chain:()=>!1}})}buildProps(e,t=!0){const{rawCommands:s,editor:i,state:r}=this,{view:o}=i,l={tr:e,editor:i,view:o,state:Fi({state:r,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(s).map(([c,d])=>[c,(...u)=>d(...u)(l)]))}};return l}};const m1=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{if(!n.isDestroyed){var t;e.dom.blur(),(t=window)===null||t===void 0||(t=t.getSelection())===null||t===void 0||t.removeAllRanges()}}),!0),g1=(n=!0)=>({commands:e})=>e.setContent("",{emitUpdate:n}),b1=()=>({state:n,tr:e,dispatch:t})=>{const{selection:s}=e,{ranges:i}=s;return t&&i.forEach(({$from:r,$to:o})=>{n.doc.nodesBetween(r.pos,o.pos,(l,c)=>{if(l.type.isText)return;const{doc:d,mapping:u}=e,p=d.resolve(u.map(c)),f=d.resolve(u.map(c+l.nodeSize)),h=p.blockRange(f);if(!h)return;const g=In(h);if(l.type.isTextblock){const{defaultType:b}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(h.start,b)}(g||g===0)&&e.lift(h,g)})}),!0},y1=n=>e=>n(e),v1=()=>({state:n,dispatch:e})=>Cc(n,e),k1=(n,e)=>({editor:t,tr:s})=>{const{state:i}=t,r=i.doc.slice(n.from,n.to);s.deleteRange(n.from,n.to);const o=s.mapping.map(e);return s.insert(o,r.content),s.setSelection(new U(s.doc.resolve(Math.max(o-1,0)))),!0},x1=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,s=t.$anchor.node();if(s.content.size>0)return!1;const i=n.selection.$anchor;for(let r=i.depth;r>0;r-=1)if(i.node(r).type===s.type){if(e){const o=i.before(r),l=i.after(r);n.delete(o,l).scrollIntoView()}return!0}return!1};function ve(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}const w1=n=>({tr:e,state:t,dispatch:s})=>{const i=ve(n,t.schema),r=e.selection.$anchor;for(let o=r.depth;o>0;o-=1)if(r.node(o).type===i){if(s){const l=r.before(o),c=r.after(o);e.delete(l,c).scrollIntoView()}return!0}return!1},S1=n=>({tr:e,dispatch:t})=>{const{from:s,to:i}=n;return t&&e.delete(s,i),!0},C1=n=>n.content?/^text(\*|\+)/.test(n.content):!1,zl=(n,e,t)=>{if(!n.parent.isInline||t==="left"&&n.pos>n.start()||t==="right"&&n.pos({from:zl(n,t,"left"),to:zl(e,t,"right")}),T1=()=>({state:n,dispatch:e})=>{if(n.selection.empty)return!1;if(e){const t=n.tr,{ranges:s}=n.selection,i=t.steps.length;s.forEach(r=>{const o=t.mapping.slice(i),l=t.doc.resolve(o.map(r.$from.pos)),c=t.doc.resolve(o.map(r.$to.pos)),{from:d,to:u}=M1(l,c,n.schema);t.deleteRange(d,u)}),t.selection.empty||t.setSelection(U.near(t.doc.resolve(t.selection.from))),t.scrollIntoView(),e(t)}return!0},E1=()=>({commands:n})=>n.keyboardShortcut("Enter"),A1=()=>({state:n,dispatch:e})=>Qy(n,e);function yo(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function ti(n,e,t={strict:!0}){const s=Object.keys(e);return s.length?s.every(i=>t.strict?e[i]===n[i]:yo(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function yd(n,e,t={}){return n.find(s=>s.type===e&&ti(Object.fromEntries(Object.keys(t).map(i=>[i,s.attrs[i]])),t))}function jl(n,e,t={}){return!!yd(n,e,t)}function vo(n,e,t){if(!n||!e)return;let s=n.parent.childAfter(n.parentOffset);if((!s.node||!s.node.marks.some(c=>c.type===e))&&(s=n.parent.childBefore(n.parentOffset)),!s.node||!s.node.marks.some(c=>c.type===e))return;if(!t){const c=s.node.marks.find(d=>d.type===e);c&&(t=c.attrs)}if(!yd([...s.node.marks],e,t))return;let i=s.index,r=n.start()+s.offset,o=i+1,l=r+s.node.nodeSize;for(;i>0&&jl([...n.parent.child(i-1).marks],e,t);)i-=1,r-=n.parent.child(i).nodeSize;for(;o({tr:t,state:s,dispatch:i})=>{const r=yt(n,s.schema),{doc:o,selection:l}=t,{$from:c,from:d,to:u}=l;if(i){const p=vo(c,r,e);if(p&&p.from<=d&&p.to>=u){const f=U.create(o,p.from,p.to);t.setSelection(f)}}return!0},N1=n=>e=>{const t=typeof n=="function"?n(e):n;for(let s=0;s({editor:t,view:s,tr:i,dispatch:r})=>{e={scrollIntoView:!0,...e};const o=()=>{(ni()||Fl())&&s.dom.focus(),I1()&&!ni()&&!Fl()&&s.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{t.isDestroyed||(s.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};try{if(s.hasFocus()&&n===null||n===!1)return!0}catch(d){return!1}if(r&&n===null&&!vd(t.state.selection))return o(),!0;const l=Pr(i.doc,n)||t.state.selection,c=t.state.selection.eq(l);return r&&(c||i.setSelection(l),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},$1=(n,e)=>t=>n.every((s,i)=>e(s,{...t,index:i})),R1=(n,e)=>({tr:t,commands:s})=>s.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),kd=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const s=e[t];s.nodeType===3&&s.nodeValue&&/^(\n\s\s|\n)$/.test(s.nodeValue)?n.removeChild(s):s.nodeType===1&&kd(s)}return n};function Es(n){if(typeof window=="undefined")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`${n}`,t=new window.DOMParser().parseFromString(e,"text/html").body;return kd(t)}function xd(n){return typeof(n==null?void 0:n.nodesBetween)=="function"}function En(n,e,t){if(xd(n))return n;const s=typeof n=="object"&&n!==null;t={slice:!0,parseOptions:{},...t};const i=typeof n=="string";if(s)try{if(Array.isArray(n)&&n.length>0)return $.fromArray(n.map(o=>e.nodeFromJSON(o)));const r=e.nodeFromJSON(n);return t.errorOnInvalidContent&&r.check(),r}catch(r){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),En("",e,t)}if(i){if(t.errorOnInvalidContent){let o=!1,l="";const c=new _s({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(o=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(t.slice?Ot.fromSchema(c).parseSlice(Es(n),t.parseOptions):Ot.fromSchema(c).parse(Es(n),t.parseOptions),t.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const r=Ot.fromSchema(e);return t.slice?r.parseSlice(Es(n),t.parseOptions).content:r.parse(Es(n),t.parseOptions)}return En("",e,t)}function wd(n){return!("type"in n)}function Sd(n,e,t){const s=n.steps.length-1;if(s{o===0&&(o=u)}),n.setSelection(X.near(n.doc.resolve(o),t))}const L1=(n,e,t)=>({tr:s,dispatch:i,editor:r})=>{if(i){t={parseOptions:r.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let l;const c=m=>{r.emit("contentError",{editor:r,error:m,disableCollaboration:()=>{"collaboration"in r.storage&&typeof r.storage.collaboration=="object"&&r.storage.collaboration&&(r.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!r.options.enableContentCheck&&r.options.emitContentError)try{En(e,r.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(m){c(m)}try{var o;l=En(e,r.schema,{parseOptions:d,errorOnInvalidContent:(o=t.errorOnInvalidContent)!==null&&o!==void 0?o:r.options.enableContentCheck})}catch(m){return c(m),!1}let{from:u,to:p}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},f=!0,h=!0;const g=wd(l)?l.content:[l];if(g.forEach(m=>{m.check(),f=f?m.isText&&m.marks.length===0:!1,h=h?m.isBlock:!1}),u===p&&h){const{parent:m}=s.doc.resolve(u);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(u-=1,p+=1)}let b;if(f)Array.isArray(e)?b=e.map(m=>m.text||"").join(""):xd(e)?b=g.map(m=>{var y;return(y=m.text)!==null&&y!==void 0?y:""}).join(""):typeof e=="object"&&e&&e.text?b=e.text:b=e,s.insertText(b,u,p);else{b=$.from(g);const m=s.doc.resolve(u),y=m.node(),S=m.parentOffset===0,A=y.isText||y.isTextblock,O=y.content.size>0;S&&A&&O&&h&&(u=Math.max(0,u-1)),s.replaceWith(u,p,g)}t.updateSelection&&Sd(s,s.steps.length-1,-1),t.applyInputRules&&s.setMeta("applyInputRules",{from:u,text:b}),t.applyPasteRules&&s.setMeta("applyPasteRules",{from:u,text:b})}return!0};function Cd(n){for(let e=0;e({tr:e,dispatch:t,editor:s})=>{const{pos:i,attrs:r,content:o,updateSelection:l=!0}=n;let c;typeof i=="number"?c=e.doc.resolve(i):i?c=i:c=e.selection.$from;const d=Cd(c.parent.contentMatchAt(c.index()));if(!d)return!1;const u=Object.keys(d.spec.attrs||{}),p=r?Object.fromEntries(Object.entries(r).filter(([h])=>u.includes(h))):{};let f;if(o){const h=En(o,s.schema);f=d.createAndFill(p,h)}else f=d.createAndFill(p);return f?(t&&(e.insert(c.pos,f),l&&Sd(e,e.steps.length-1,-1)),!0):!1},B1=()=>({state:n,dispatch:e})=>Yy(n,e),_1=()=>({state:n,dispatch:e})=>Xy(n,e),z1=()=>({state:n,dispatch:e})=>bc(n,e),j1=()=>({state:n,dispatch:e})=>xc(n,e),Md=(n,e)=>{const t=n.resolve(e),s=t.nodeBefore,i=t.nodeAfter;return!s||!i?!1:!s.type.spec.isolating&&!i.type.spec.isolating},F1=()=>({state:n,dispatch:e,tr:t})=>{try{const s=Li(n.doc,n.selection.$from.pos,-1);return s==null||!Md(n.doc,s)?!1:(t.join(s,2),e&&e(t),!0)}catch(s){return!1}},V1=()=>({state:n,dispatch:e,tr:t})=>{try{const s=Li(n.doc,n.selection.$from.pos,1);return s==null||!Md(n.doc,s)?!1:(t.join(s,2),e&&e(t),!0)}catch(s){return!1}},H1=()=>({state:n,dispatch:e})=>Jy(n,e),q1=()=>({state:n,dispatch:e})=>Gy(n,e);function Td(){return typeof navigator!="undefined"?/Mac/.test(navigator.platform):!1}function U1(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let s,i,r,o;for(let l=0;l({editor:e,view:t,tr:s,dispatch:i})=>{const r=U1(n).split(/-(?!$)/),o=r.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:r.includes("Alt"),ctrlKey:r.includes("Ctrl"),metaKey:r.includes("Meta"),shiftKey:r.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{t.someProp("handleKeyDown",d=>d(t,l))});return c==null||c.steps.forEach(d=>{const u=d.map(s.mapping);u&&i&&s.maybeStep(u)}),!0};function bt(n,e,t={}){const{from:s,to:i,empty:r}=n.selection,o=e?ve(e,n.schema):null,l=[];n.doc.nodesBetween(s,i,(u,p)=>{if(u.isText)return;const f=Math.max(s,p),h=Math.min(i,p+u.nodeSize);l.push({node:u,from:f,to:h})});const c=i-s,d=l.filter(u=>o?o.name===u.node.type.name:!0).filter(u=>ti(u.node.attrs,t,{strict:!1}));return r?!!d.length:d.reduce((u,p)=>u+p.to-p.from,0)>=c}const K1=(n,e={})=>({state:t,dispatch:s})=>bt(t,ve(n,t.schema),e)?Zy(t,s):!1,J1=()=>({state:n,dispatch:e})=>Mc(n,e),G1=n=>({state:e,dispatch:t})=>{const s=ve(n,e.schema);return dv(s)(e,t)},Y1=()=>({state:n,dispatch:e})=>Sc(n,e);function Vi(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Vl(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((s,i)=>(t.includes(i)||(s[i]=n[i]),s),{})}const X1=(n,e)=>({tr:t,state:s,dispatch:i})=>{let r=null,o=null;const l=Vi(typeof n=="string"?n:n.name,s.schema);if(!l)return!1;l==="node"&&(r=ve(n,s.schema)),l==="mark"&&(o=yt(n,s.schema));let c=!1;return t.selection.ranges.forEach(d=>{s.doc.nodesBetween(d.$from.pos,d.$to.pos,(u,p)=>{r&&r===u.type&&(c=!0,i&&t.setNodeMarkup(p,void 0,Vl(u.attrs,e))),o&&u.marks.length&&u.marks.forEach(f=>{o===f.type&&(c=!0,i&&t.addMark(p,p+u.nodeSize,o.create(Vl(f.attrs,e))))})})}),c},Z1=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),Q1=()=>({tr:n,dispatch:e})=>{if(e){const t=new qe(n.doc);n.setSelection(t)}return!0},ek=()=>({state:n,dispatch:e})=>vc(n,e),tk=()=>({state:n,dispatch:e})=>wc(n,e),nk=()=>({state:n,dispatch:e})=>nv(n,e),sk=()=>({state:n,dispatch:e})=>rv(n,e),ik=()=>({state:n,dispatch:e})=>iv(n,e);function Br(n,e,t={},s={}){return En(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:s.errorOnInvalidContent})}const rk=(n,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:s={}}={})=>({editor:i,tr:r,dispatch:o,commands:l})=>{const{doc:c}=r;if(s.preserveWhitespace!=="full"){const d=Br(n,i.schema,s,{errorOnInvalidContent:e!=null?e:i.options.enableContentCheck});if(o){const u=wd(d)?d.content:[d];r.replaceWith(0,c.content.size,u).setMeta("preventUpdate",!t)}return!0}return o&&r.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:c.content.size},n,{parseOptions:s,errorOnInvalidContent:e!=null?e:i.options.enableContentCheck})};function Ed(n,e){const t=yt(e,n.schema),{from:s,to:i,empty:r}=n.selection,o=[];r?(n.storedMarks&&o.push(...n.storedMarks),o.push(...n.selection.$head.marks())):n.doc.nodesBetween(s,i,c=>{o.push(...c.marks)});const l=o.find(c=>c.type.name===t.name);return l?{...l.attrs}:{}}function Ad(n,e){const t=new pc(n);return e.forEach(s=>{s.steps.forEach(i=>{t.step(i)})}),t}function ok(n,e,t){const s=[];return n.nodesBetween(e.from,e.to,(i,r)=>{t(i)&&s.push({node:i,pos:r})}),s}function lk(n,e){for(let t=n.depth;t>0;t-=1){const s=n.node(t);if(e(s))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:s}}}function Hi(n){return e=>lk(e.$from,n)}function V(n,e,t){return n.config[e]===void 0&&n.parent?V(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?V(n.parent,e,t):null}):n.config[e]}function ko(n){return n.map(e=>{const t=V(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...ko(t())]:e}).flat(10)}function xo(n,e){const t=ln.fromSchema(e).serializeFragment(n),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(t),s.innerHTML}function Od(n,e){const t=new Map;for(const i of n){var s;const r=(s=t.get(i.type))!==null&&s!==void 0?s:new Map;r.set(i.name,i),t.set(i.type,r)}return[...Object.values(e.nodes),...Object.values(e.marks)].flatMap(i=>{var r;return Object.entries((r=i.spec.attrs)!==null&&r!==void 0?r:{}).map(([o,l])=>{var c;const d=(c=t.get(i.name))===null||c===void 0?void 0:c.get(o),u=Object.hasOwn(l,"default");return{type:i.name,name:o,attribute:{rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,...d==null?void 0:d.attribute,default:l.default,isRequired:!u,validate:l.validate}}})})}const ak={content:"string",marks:"string",group:"string",inline:"boolean",atom:"boolean",selectable:"boolean",draggable:"boolean",code:"boolean",whitespace:["pre","normal"],definingAsContext:"boolean",definingForContent:"boolean",defining:"boolean",isolating:"boolean",linebreakReplacement:"boolean"},ck={inclusive:"boolean",excludes:"string",group:"string",spanning:"boolean",code:"boolean"};function dk(n,e,t){return Object.fromEntries(Object.entries(e).flatMap(([s,i])=>{const r=n[s];if(r===void 0)return[];if(!(typeof i=="string"?typeof r===i:typeof r=="string"&&i.includes(r)))throw new RangeError(`Invalid schemaSpec field '${t}.${s}'`);return[[s,r]]}))}function Hl(n,e,t,s){return{...Object.fromEntries(Object.entries(e).filter(([i])=>i!=="attrs"&&!Object.hasOwn(s,i))),...dk(t,s,n),attrs:t.attrs}}function ql(n,e,t){for(const s of Object.keys(e))if(!Object.hasOwn(n,s))throw new RangeError(`schemaSpec requires a local ${t} extension named '${s}'`);for(const s of Object.keys(n))if(!Object.hasOwn(e,s))throw new RangeError(`Local ${t} extension '${s}' is not in schemaSpec`)}function uk(n,e){ql(n.nodes,e.nodes,"node"),ql(n.marks,e.marks,"mark");let t=e.spec.nodes,s=e.spec.marks;return e.spec.nodes.forEach((i,r)=>{t=t.update(i,Hl(i,n.nodes[i],r,ak))}),e.spec.marks.forEach((i,r)=>{s=s.update(i,Hl(i,n.marks[i],r,ck))}),{topNode:e.topNodeType.name,nodes:t,marks:s}}function Nd(n){const e=n.filter((t,s)=>n.indexOf(t)!==s);return Array.from(new Set(e))}function An(n){return{baseExtensions:n.filter(e=>e.type==="extension"),nodeExtensions:n.filter(e=>e.type==="node"),markExtensions:n.filter(e=>e.type==="mark")}}function wo(n){const e=[],{nodeExtensions:t,markExtensions:s}=An(n),i=[...t,...s],r={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=t.filter(d=>d.name!=="text").map(d=>d.name),l=s.map(d=>d.name),c=[...o,...l];return n.forEach(d=>{const u=V(d,"addGlobalAttributes",{name:d.name,options:d.options,storage:d.storage,extensions:i});u&&u().forEach(p=>{let f;Array.isArray(p.types)?f=p.types:p.types==="*"?f=c:p.types==="nodes"?f=o:p.types==="marks"?f=l:f=[],f.forEach(h=>{Object.entries(p.attributes).forEach(([g,b])=>{e.push({type:h,name:g,attribute:{...r,...b}})})})})}),i.forEach(d=>{const u=V(d,"addAttributes",{name:d.name,options:d.options,storage:d.storage});if(!u)return;const p=u();Object.entries(p).forEach(([f,h])=>{const g={...r,...h};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,e.push({type:d.name,name:f,attribute:g})})}),e}function _r(n){return typeof n=="function"}function se(n,e=void 0,...t){return _r(n)?e?n.bind(e)(...t):n(...t):n}function pk(n={}){return Object.keys(n).length===0&&n.constructor===Object}function fk(n){const e=[];let t="",s=!1,i=!1,r=0;const o=n.length;for(let l=0;l0){r-=1,t+=c;continue}if(c===";"&&r===0){e.push(t),t="";continue}}t+=c}return t&&e.push(t),e}function Ul(n){const e=[],t=fk(n||""),s=t.length;for(let i=0;i!!e).reduce((e,t)=>{const s={...e};return Object.entries(t).forEach(([i,r])=>{if(i==="__proto__"){Object.defineProperty(s,i,{configurable:!0,enumerable:!0,value:r,writable:!0});return}if(!s[i]){s[i]=r;return}if(i==="class"){const o=r?String(r).split(" "):[],l=s[i]?s[i].split(" "):[],c=o.filter(d=>!l.includes(d));s[i]=[...l,...c].join(" ")}else if(i==="style"){const o=new Map([...Ul(s[i]),...Ul(r)]);s[i]=Array.from(o.entries()).map(([l,c])=>`${l}: ${c}`).join("; ")}else s[i]=r}),s},{})}function us(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,s)=>ke(t,s),{})}function hk(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Wl(n,e){return"style"in n?n:{...n,getAttrs:t=>{const s=n.getAttrs?n.getAttrs(t):n.attrs;if(s===!1)return!1;const i=e.reduce((r,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(t):hk(t.getAttribute(o.name));return l==null?r:{...r,[o.name]:l}},{});return{...s,...i}}}}function Kl(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&pk(t)?!1:t!=null))}function Jl(n){var e,t;const s={};return!(!(n==null||(e=n.attribute)===null||e===void 0)&&e.isRequired)&&"default"in((n==null?void 0:n.attribute)||{})&&(s.default=n.attribute.default),(n==null||(t=n.attribute)===null||t===void 0?void 0:t.validate)!==void 0&&(s.validate=n.attribute.validate),[n.name,s]}function Gl(n,e,t=wo(n)){var s;const{nodeExtensions:i,markExtensions:r}=An(n);return{topNode:(s=i.find(o=>V(o,"topNode")))===null||s===void 0?void 0:s.name,nodes:Object.fromEntries(i.map(o=>{const l=t.filter(h=>h.type===o.name),c={name:o.name,options:o.options,storage:o.storage,editor:e},d=Kl({...n.reduce((h,g)=>{const b=V(g,"extendNodeSchema",c);return{...h,...b?b(o):{}}},{}),content:se(V(o,"content",c)),marks:se(V(o,"marks",c)),group:se(V(o,"group",c)),inline:se(V(o,"inline",c)),atom:se(V(o,"atom",c)),selectable:se(V(o,"selectable",c)),draggable:se(V(o,"draggable",c)),code:se(V(o,"code",c)),whitespace:se(V(o,"whitespace",c)),linebreakReplacement:se(V(o,"linebreakReplacement",c)),defining:se(V(o,"defining",c)),isolating:se(V(o,"isolating",c)),attrs:Object.fromEntries(l.map(Jl))}),u=se(V(o,"parseHTML",c));u&&(d.parseDOM=u.map(h=>Wl(h,l)));const p=V(o,"renderHTML",c);p&&(d.toDOM=h=>p({node:h,HTMLAttributes:us(h,l)}));const f=V(o,"renderText",c);return f&&(d.toText=f),[o.name,d]})),marks:Object.fromEntries(r.map(o=>{const l=t.filter(f=>f.type===o.name),c={name:o.name,options:o.options,storage:o.storage,editor:e},d=Kl({...n.reduce((f,h)=>{const g=V(h,"extendMarkSchema",c);return{...f,...g?g(o):{}}},{}),inclusive:se(V(o,"inclusive",c)),excludes:se(V(o,"excludes",c)),group:se(V(o,"group",c)),spanning:se(V(o,"spanning",c)),code:se(V(o,"code",c)),attrs:Object.fromEntries(l.map(Jl))}),u=se(V(o,"parseHTML",c));u&&(d.parseDOM=u.map(f=>Wl(f,l)));const p=V(o,"renderHTML",c);return p&&(d.toDOM=f=>p({mark:f,HTMLAttributes:us(f,l)})),[o.name,d]}))}}function mk(n,e,t){if(t===void 0)return new _s(Gl(n,e));const s=Nd(n.filter(o=>o.type!=="extension").map(o=>o.name));if(s.length)throw new RangeError(`Duplicate local schema types: ${s.join(", ")}`);const i=new _s(t),r=Gl(n,e,Od(wo(n),i));return new _s(uk(r,i))}function Wn(n){return n.sort((t,s)=>{const i=V(t,"priority")||100,r=V(s,"priority")||100;return i>r?-1:is.name));return t.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${t.map(s=>`'${s}'`).join(", ")}]. This can lead to issues.`),e}function Dd(n,e,t){const{from:s,to:i}=e,{blockSeparator:r=` +`))),0,0),n.someProp("transformPasted",f=>{l=f(l,n,!0)}),l;let p=n.someProp("clipboardTextParser",f=>f(e,i,s,n));if(p)l=p;else{let f=i.marks(),{schema:h}=n.state,g=ln.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(b=>{let m=o.appendChild(document.createElement("p"));b&&m.appendChild(g.serializeNode(h.text(b,f)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),o=o0(t),zi&&l0(o);let d=o&&o.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let p=+u[3];p>0;p--){let f=o.firstChild;for(;f&&!q(f);)f=f.nextSibling;if(!f)break;o=f}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||Ot.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!s0.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=a0(Tl(l,+u[1],+u[2]),u[4]);else if(l=z.maxOpen(i0(l.content,i),!0),l.openStart||l.openEnd){let p=0,f=0;for(let h=l.content.firstChild;p{l=p(l,n,c)}),l}const s0=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function i0(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),r,o=[];if(n.forEach(l=>{if(!o)return;let c=i.findWrapping(l.type),d;if(!c)return o=null;if(d=o.length&&r.length&&Jc(c,r,l,o[o.length-1],0))o[o.length-1]=d;else{o.length&&(o[o.length-1]=Gc(o[o.length-1],r.length));let u=Kc(l,c);o.push(u),i=i.matchType(u.type),r=c}}),o)return $.from(o)}return n}function Kc(n,e,t=0){for(let s=e.length-1;s>=t;s--)n=e[s].create(null,$.from(n));return n}function Jc(n,e,t,s,i){if(i1&&(r=0),i=t&&(l=e<0?o.contentMatchAt(0).fillBefore(l,r<=i).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore($.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,o.copy(l))}function Tl(n,e,t){return et})}return Rn.createHTML(n)}function o0(n){let e=/^(\s*]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Xc(),s=t.body,i=/<([a-z][^>\s]+)/i.exec(n),r;if((r=i&&Yc[i[1].toLowerCase()])&&(n=r.map(o=>"<"+o+">").join("")+n+r.map(o=>"").reverse().join("")),s.innerHTML=r0(n),r)for(let o=0;o=0;l-=2){let c=t.nodes[s[l]];if(!c||c.hasRequiredAttrs())break;try{i=$.from(c.create(s[l+1],i))}catch(d){break}r++,o++}return new z(i,r,o)}const Pe={},Be={},c0={touchstart:!0,touchmove:!0};class d0{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function u0(n){for(let e in Pe){let t=Pe[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=s=>{f0(n,s)&&!fo(n,s)&&(n.editable||!(s.type in Be))&&t(n,s)},c0[e]?{passive:!0}:void 0)}$e&&n.dom.addEventListener("input",()=>null),Lr(n)}function ht(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function p0(n){n.input.mouseDown&&n.input.mouseDown.done(),n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Lr(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=s=>fo(n,s))})}function fo(n,e){return n.someProp("handleDOMEvents",t=>{let s=t[e.type];return s?s(n,e)||e.defaultPrevented:!1})}function f0(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function h0(n,e){!fo(n,e)&&Pe[e.type]&&(n.editable||!(e.type in Be))&&Pe[e.type](n,e)}Be.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!td(n)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(ft&&Ee&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Tn&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let s=Date.now();n.input.lastIOSEnter=s,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==s&&(n.someProp("handleKeyDown",i=>i(n,qt(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",s=>s(n,t))||n0(n,t)?t.preventDefault():ht(n,"key")};Be.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Be.keypress=(n,e)=>{let t=e;if(td(n)||!t.charCode||t.ctrlKey&&!t.altKey||Je&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let s=n.state.selection;if(!(s instanceof U)||!s.$from.sameParent(s.$to)){let i=String.fromCharCode(t.charCode),r=()=>n.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,s.$from.pos,s.$to.pos,i,r))&&n.dispatch(r()),t.preventDefault()}};function bs(n){return{left:n.clientX,top:n.clientY}}function m0(n,e){let t=e.x-n.clientX,s=e.y-n.clientY;return t*t+s*s<100}function ho(n,e,t,s,i){if(s==-1)return!1;let r=n.state.doc.resolve(s);for(let o=r.depth+1;o>0;o--)if(n.someProp(e,l=>o>r.depth?l(n,t,r.nodeAfter,r.before(o),i,!0):l(n,t,r.node(o),r.before(o),i,!1)))return!0;return!1}function vs(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let s=n.state.tr.setSelection(e);s.setMeta("pointer",!0),n.dispatch(s)}function g0(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),s=t.nodeAfter;return s&&s.isAtom&&W.isSelectable(s)?(vs(n,new W(t)),!0):!1}function b0(n,e){if(e==-1)return!1;let t=n.state.selection,s,i;t instanceof W&&(s=t.node);let r=n.state.doc.resolve(e);for(let o=r.depth+1;o>0;o--){let l=o>r.depth?r.nodeAfter:r.node(o);if(W.isSelectable(l)){s&&t.$from.depth>0&&o>=t.$from.depth&&r.before(t.$from.depth+1)==t.$from.pos?i=r.before(t.$from.depth):i=r.before(o);break}}return i!=null?(vs(n,W.create(n.state.doc,i)),!0):!1}function v0(n,e,t,s,i){return ho(n,"handleClickOn",e,t,s)||n.someProp("handleClick",r=>r(n,e,s))||(i?b0(n,t):g0(n,t))}function y0(n,e,t,s){return ho(n,"handleDoubleClickOn",e,t,s)||n.someProp("handleDoubleClick",i=>i(n,e,s))}function k0(n,e,t,s){return ho(n,"handleTripleClickOn",e,t,s)||n.someProp("handleTripleClick",i=>i(n,e,s))||x0(n,t,s)}function x0(n,e,t){if(t.button!=0)return!1;let s=Zc(n,e,!0),i=n.state.doc;return s?(vs(n,s),s instanceof U&&i.eq(n.state.doc)&&(n.input.mouseDown=new S0(n,s)),!0):!1}function Zc(n,e,t){let s=n.state.doc;if(e==-1)return s.inlineContent?U.create(s,0,s.content.size):null;let i=s.resolve(e);for(let r=i.depth+1;r>0;r--){let o=r>i.depth?i.nodeAfter:i.node(r),l=i.before(r);if(o.inlineContent)return U.create(s,l+1,l+1+o.content.size);if(t&&W.isSelectable(o))return W.create(s,l)}return null}function mo(n){return Ys(n)}const Qc=Je?"metaKey":"ctrlKey";Pe.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let s=mo(n),i=Date.now(),r="singleClick";i-n.input.lastClick.time<500&&m0(t,n.input.lastClick)&&!t[Qc]&&n.input.lastClick.button==t.button&&(n.input.lastClick.type=="singleClick"?r="doubleClick":n.input.lastClick.type=="doubleClick"&&(r="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:r,button:t.button},n.input.mouseDown&&n.input.mouseDown.done();let o=n.posAtCoords(bs(t));o&&(r=="singleClick"?n.input.mouseDown=new w0(n,o,t,!!s):(r=="doubleClick"?y0:k0)(n,o.pos,o.inside,t)?t.preventDefault():ht(n,"pointer"))};class ed{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class w0 extends ed{constructor(e,t,s,i){super(e),this.pos=t,this.event=s,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!s[Qc],this.allowDefault=s.shiftKey;let r,o;if(t.inside>-1)r=e.state.doc.nodeAt(t.inside),o=t.inside;else{let u=e.state.doc.resolve(t.pos);r=u.parent,o=u.depth?u.before():0}const l=i?null:s.target,c=l?e.docView.nearestDesc(l,!0):null;this.target=c&&q(c.nodeDOM)?c.nodeDOM:null;let{selection:d}=e.state;s.button==0&&(r.type.spec.draggable&&r.type.spec.selectable!==!1||d instanceof W&&d.from<=o&&d.to>o)&&(this.mightDrag={node:r,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ue&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),ht(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||gt(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(bs(e))),this.updateAllowDefault(e),this.allowDefault||!t?ht(this.view,"pointer"):v0(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||$e&&this.mightDrag&&!this.mightDrag.node.isAtom||Ee&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(vs(this.view,X.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):ht(this.view,"pointer")}move(e){this.updateAllowDefault(e),ht(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class S0 extends ed{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),ht(this.view,"pointer");let t=this.view.posAtCoords(bs(e)),s=t&&Zc(this.view,t.inside,!1);if(!s)return;let{doc:i}=this.view.state,r=this.startSelection,[o,l]=s.from{n.input.lastTouch=Date.now(),mo(n),ht(n,"pointer")};Pe.touchmove=n=>{n.input.lastTouch=Date.now(),ht(n,"pointer")};Pe.contextmenu=n=>mo(n);function td(n,e){return n.composing?!0:$e&&Math.abs(Date.now()-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const C0=ft?5e3:-1;Be.compositionstart=Be.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof U&&e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(s=>s.type.spec.inclusive===!1)||Ee&&Nc&&M0(n)))n.markCursor=n.state.storedMarks||t.marks(),Ys(n,!0),n.markCursor=null;else if(Ys(n,!e.selection.empty),Ue&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let s=n.domSelectionRange();for(let i=s.focusNode,r=s.focusOffset;i&&q(i)&&r!=0;){let o=r<0?i.lastChild:i.childNodes[r-1];if(!o)break;if(ve(o)){let l=n.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else i=o,r=-1}}n.input.composing=!0}nd(n,C0)};function M0(n){let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(!e||!q(e)||t>=e.childNodes.length)return!1;let s=e.childNodes[t];return q(s)&&s.contentEditable=="false"}Be.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Date.now(),n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.badSafariComposition?n.domObserver.forceFlush():n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,nd(n,20))};function nd(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Ys(n),e))}function sd(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Date.now());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function T0(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=by(e.focusNode,e.focusOffset),s=vy(e.focusNode,e.focusOffset);if(t&&s&&t!=s){let i=s.pmViewDesc,r=n.domObserver.lastChangedTextNode;if(t==r||s==r)return r;if(!i||!i.isText(s.nodeValue))return s;if(n.input.compositionNode==s){let o=t.pmViewDesc;if(!(!o||!o.isText(t.nodeValue)))return s}}return t||s}function Ys(n,e=!1){if(!(ft&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),sd(n),e||n.docView&&n.docView.dirty){let t=co(n),s=n.state.selection;return t&&!t.eq(s)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!s.$from.node(s.$from.sharedDepth(s.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function E0(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let s=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),s.removeAllRanges(),s.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const cs=je&&Nt<15||Tn&&wy<604;Pe.copy=Be.cut=(n,e)=>{let t=e,s=n.state.selection,i=t.type=="cut";if(s.empty)return;let r=cs?null:t.clipboardData,o=s.content(),{dom:l,text:c}=po(n,o);r?(t.preventDefault(),r.clearData(),r.setData("text/html",l.innerHTML),r.setData("text/plain",c)):E0(n,l),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function A0(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function O0(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,s=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(s.contentEditable="true"),s.style.cssText="position: fixed; left: -10000px; top: 10px",s.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),s.parentNode&&s.parentNode.removeChild(s),t?ds(n,s.value,null,i,e):ds(n,s.textContent,s.innerHTML,i,e)},50)}function ds(n,e,t,s,i){let r=Wc(n,e,t,s,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,i,r||z.empty)))return!0;if(!r)return!1;let o=A0(r),l=o?n.state.tr.replaceSelectionWith(o,s):n.state.tr.replaceSelection(r);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function id(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Be.paste=(n,e)=>{let t=e;if(n.composing&&!ft)return;let s=cs?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;s&&ds(n,id(s),s.getData("text/html"),i,t)?t.preventDefault():O0(n,t)};class rd{constructor(e,t,s){this.slice=e,this.move=t,this.node=s}}const N0=Je?"altKey":"ctrlKey";function od(n,e){let t;return n.someProp("dragCopies",s=>{t=t||s(e)}),t!=null?!t:!e[N0]}Pe.dragstart=(n,e)=>{let t=e,s=n.input.mouseDown;if(s&&s.done(),!t.dataTransfer)return;let i=n.state.selection,r=i.empty?null:n.posAtCoords(bs(t)),o;if(!(r&&r.pos>=i.from&&r.pos<=(i instanceof W?i.to-1:i.to))){if(s&&s.mightDrag)o=W.create(n.state.doc,s.mightDrag.pos);else if(t.target&&q(t.target)){let p=n.docView.nearestDesc(t.target,!0);p&&p.node.type.spec.draggable&&p!=n.docView&&(o=W.create(n.state.doc,p.posBefore))}}let l=(o||n.state.selection).content(),{dom:c,text:d,slice:u}=po(n,l);(!t.dataTransfer.files.length||!Ee||Oc>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(cs?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",cs||t.dataTransfer.setData("text/plain",d),n.dragging=new rd(u,od(n,t),o)};Pe.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Be.dragover=Be.dragenter=(n,e)=>e.preventDefault();Be.drop=(n,e)=>{try{I0(n,e,n.dragging)}finally{n.dragging=null}};function I0(n,e,t){if(!e.dataTransfer)return;let s=n.posAtCoords(bs(e));if(!s)return;let i=n.state.doc.resolve(s.pos),r=t&&t.slice;r?n.someProp("transformPasted",h=>{r=h(r,n,!1)}):r=Wc(n,id(e.dataTransfer),cs?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(t&&od(n,e));if(n.someProp("handleDrop",h=>h(n,e,r||z.empty,o))){e.preventDefault();return}if(!r)return;e.preventDefault();let l=r?lc(n.state.doc,i.pos,r):i.pos;l==null&&(l=i.pos);let c=n.state.tr;if(o){let{node:h}=t;h?h.replace(c):c.deleteSelection()}let d=c.mapping.map(l),u=r.openStart==0&&r.openEnd==0&&r.content.childCount==1,p=c.doc;if(u?c.replaceRangeWith(d,d,r.content.firstChild):c.replaceRange(d,d,r),c.doc.eq(p))return;let f=c.doc.resolve(d);if(u&&W.isSelectable(r.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(r.content.firstChild))c.setSelection(new W(f));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,b,m,v)=>h=v),c.setSelection(uo(n,f,c.doc.resolve(h)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))}Pe.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&>(n)},20))};Pe.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};Pe.beforeinput=(n,e)=>{if(ft&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:s}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=s||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",r=>r(n,qt(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in Be)Pe[n]=Be[n];function us(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Xs{constructor(e,t){this.toDOM=e,this.spec=t||Qt,this.side=this.spec.side||0}map(e,t,s,i){let{pos:r,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new Le(r-s,r-s,this)}valid(){return!0}eq(e){return this==e||e instanceof Xs&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&us(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class $t{constructor(e,t){this.attrs=e,this.spec=t||Qt}map(e,t,s,i){let r=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-s,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-s;return r>=o?null:new Le(r,o,this)}valid(e,t){return t.from=e&&(!r||r(l.spec))&&s.push(l.copy(l.from+i,l.to+i))}for(let o=0;oe){let l=this.children[o]+1;this.children[o+2].findInner(e-l,t-l,s,i+l,r)}}map(e,t,s){return this==Ne||e.maps.length==0?this:this.mapInner(e,t,0,0,s||Qt)}mapInner(e,t,s,i,r){let o;for(let l=0;l{let d=c+s,u;if(u=ad(t,l,d)){for(i||(i=this.children.slice());rl&&p.to=e){this.children[l]==e&&(s=this.children[l+2]);break}let r=e+1,o=r+t.content.size;for(let l=0;lr&&c.type instanceof $t){let d=Math.max(r,c.from)-r,u=Math.min(o,c.to)-r;di.map(e,t,Qt));return Mt.from(s)}forChild(e,t){if(t.isLeaf)return ne.empty;let s=[];for(let i=0;it instanceof ne)?e:e.reduce((t,s)=>t.concat(s instanceof ne?s:s.members),[]))}}forEachSet(e){for(let t=0;t{let m=b-g-(h-f);for(let v=0;vS+u-p)continue;let A=l[v]+u-p;h>=A?l[v+1]=f<=A?-2:-1:f>=u&&m&&(l[v]+=m,l[v+1]+=m)}p+=m}),u=t.maps[d].map(u,-1)}let c=!1;for(let d=0;d=s.content.size){c=!0;continue}let f=t.map(n[d+1]+r,-1),h=f-i,{index:g,offset:b}=s.content.findIndex(p),m=s.maybeChild(g);if(m&&b==p&&b+m.nodeSize==h){let v=l[d+2].mapInner(t,m,u+1,n[d]+r+1,o);v!=Ne?(l[d]=p,l[d+1]=h,l[d+2]=v):(l[d+1]=-2,c=!0)}else c=!0}if(c){let d=$0(l,n,e,t,i,r,o),u=Zs(d,s,0,o);e=u.local;for(let p=0;pt&&o.to{let d=ad(n,l,c+t);if(d){r=!0;let u=Zs(d,l,t+c+1,s);u!=Ne&&i.push(c,c+l.nodeSize,u)}});let o=ld(r?cd(n):n,-t).sort(en);for(let l=0;l0;)e++;n.splice(e,0,t)}function rr(n){let e=[];return n.someProp("decorations",t=>{let s=t(n.state);s&&s!=Ne&&e.push(s)}),n.cursorWrapper&&e.push(ne.create(n.state.doc,[n.cursorWrapper.deco])),Mt.from(e)}const R0={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},L0=je&&Nt<=11;class P0{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class B0{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new P0,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(s=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():$e&&e.composing&&s.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),L0&&(this.onCharData=s=>{this.queue.push({target:s.target,type:"characterData",oldValue:s.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,R0)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(kl(this.view)){if(this.suppressingSelectionUpdates)return gt(this.view);if(je&&Nt<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&sn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,s;for(let r=e.focusNode;r;r=Mn(r))t.add(r);for(let r=e.anchorNode;r;r=Mn(r))if(t.has(r)){s=r;break}let i=s&&this.view.docView.nearestDesc(s);if(i&&i.ignoreMutation({type:"selection",target:ve(s)?s.parentNode:s}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let s=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(s)&&kl(e)&&!this.ignoreSelectionChange(s),r=-1,o=-1,l=!1,c=[];if(e.editable)for(let u=0;uu.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||Ee&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(u=>u.type=="childList"&&u.removedNodes.length))){for(let u of c)if(u.nodeName=="BR"&&u.parentNode){let p=u.nextSibling;for(;p&&q(p);){if(p.contentEditable=="false"){u.parentNode.removeChild(u);break}p=p.firstChild}}}else if(Ue&&c.length){let u=c.filter(p=>p.nodeName=="BR");if(u.length==2){let[p,f]=u;p.parentNode&&p.parentNode.parentNode==f.parentNode?f.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let f of u){let h=f.parentNode;h&&h.nodeName=="LI"&&(!p||j0(e,p)!=h)&&f.remove()}}}let d=null;r<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(r>-1&&(e.docView.markDirty(r,o),_0(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,F0(e,c)),this.handleDOMChange(r,o,l,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(s)||gt(e),this.currentSelection.set(s))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let s=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(s==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!s||s.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;ur;v--){let S=i.childNodes[v-1],A=S.pmViewDesc;if(S.nodeName=="BR"&&!A){o=v;break}if(!A||A.size)break}let f=n.state.doc,h=n.someProp("domParser")||Ot.fromSchema(n.state.schema),g=f.resolve(l),b=null,m=h.parse(i,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:r,to:o,preserveWhitespace:g.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:H0(s),context:g});if(u&&u[0].pos!=null){let v=u[0].pos,S=u[1]&&u[1].pos;S==null&&(S=v),b={anchor:v+l,head:S+l}}return{doc:m,sel:b,from:l,to:c}}const H0=n=>e=>{let t=e.pmViewDesc;if(t)return t.parseRule(n);if(e.nodeName=="BR"&&e.parentNode){if($e&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let s=document.createElement("div");return s.appendChild(document.createElement("li")),{skip:s}}else if(e.parentNode.lastChild==e||$e&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},q0=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function U0(n,e,t,s,i){let r=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let M=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,w=co(n,M);if(w&&!n.state.selection.eq(w)){if(Ee&&ft&&n.input.lastKeyCode===13&&Date.now()-100N(n,qt(13,"Enter"))))return;let T=n.state.tr.setSelection(w);M=="pointer"?T.setMeta("pointer",!0):M=="key"&&T.scrollIntoView(),r&&T.setMeta("composition",r),n.dispatch(T)}return}let o=n.state.doc.resolve(e),l=o.sharedDepth(t);e=o.before(l+1),t=n.state.doc.resolve(t).after(l+1);let c=n.state.selection,d=V0(n,e,t,i),u=n.state.doc,p=u.slice(d.from,d.to),f,h;n.input.lastKeyCode===8&&Date.now()-100Date.now()-225||ft)&&i.some(M=>q(M)&&!q0.test(M.nodeName))&&(!g||g.endA>=g.endB)&&n.someProp("handleKeyDown",M=>M(n,qt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!g)if(s&&c instanceof U&&!c.empty&&c.$head.sameParent(c.$anchor)&&!n.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))g={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let M=Il(n,n.state.doc,d.sel);if(M&&!M.eq(n.state.selection)){let w=n.state.tr.setSelection(M);r&&w.setMeta("composition",r),n.dispatch(w)}}return}n.state.selection.fromn.state.selection.from&&g.start<=n.state.selection.from+2&&n.state.selection.from>=d.from?g.start=n.state.selection.from:g.endA=n.state.selection.to-2&&n.state.selection.to<=d.to&&(g.endB+=n.state.selection.to-g.endA,g.endA=n.state.selection.to)),je&&Nt<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>d.from&&d.doc.textBetween(g.start-d.from-1,g.start-d.from+1)=="  "&&(g.start--,g.endA--,g.endB--);let b=d.doc.resolveNoCache(g.start-d.from),m=d.doc.resolveNoCache(g.endB-d.from),v=u.resolve(g.start),S=b.sameParent(m)&&b.parent.inlineContent&&v.end()>=g.endA;if((Tn&&n.input.lastIOSEnter>Date.now()-225&&(!S||i.some(M=>M.nodeName=="DIV"||M.nodeName=="P"))||!S&&J0(d.doc,b.pos,m.pos))&&n.someProp("handleKeyDown",M=>M(n,qt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>g.start&&K0(u,g.start,g.endA,b,m)&&n.someProp("handleKeyDown",M=>M(n,qt(8,"Backspace")))){ft&&Ee&&n.domObserver.suppressSelectionUpdates();return}Ee&&g.endB==g.start&&(n.input.lastChromeDelete=Date.now()),ft&&!S&&b.start()!=m.start()&&m.parentOffset==0&&b.depth==m.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==g.endA&&(g.endB-=2,m=d.doc.resolveNoCache(g.endB-d.from),setTimeout(()=>{n.someProp("handleKeyDown",function(M){return M(n,qt(13,"Enter"))})},20));let A=g.start,O=g.endA,B=M=>{let w=M||n.state.tr.replace(A,O,d.doc.slice(g.start-d.from,g.endB-d.from));if(d.sel){let T=Il(n,w.doc,d.sel);T&&!(Ee&&n.composing&&T.empty&&(g.start!=g.endB||n.input.lastChromeDeletegt(n),20));let M=B(n.state.tr.delete(A,O)),w=u.resolve(g.start).marksAcross(u.resolve(g.endA));w&&M.ensureMarks(w),n.dispatch(M)}else if(g.endA==g.endB&&(E=W0(b.parent.content.cut(b.parentOffset,m.parentOffset),v.parent.content.cut(v.parentOffset,g.endA-v.start())))){let M=B(n.state.tr);E.type=="add"?M.addMark(A,O,E.mark):M.removeMark(A,O,E.mark),n.dispatch(M)}else if(b.parent.child(b.index()).isText&&b.index()==m.index()-(m.textOffset?0:1)){let M=b.parent.textBetween(b.parentOffset,m.parentOffset),w=()=>B(n.state.tr.insertText(M,A,O));n.someProp("handleTextInput",T=>T(n,A,O,M,w))||n.dispatch(w())}else n.dispatch(B());else n.dispatch(B())}function Il(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:uo(n,e.resolve(t.anchor),e.resolve(t.head))}function W0(n,e){let t=n.firstChild.marks,s=e.firstChild.marks,i=t,r=s,o,l,c;for(let u=0;uu.mark(l.addToSet(u.marks));else if(i.length==0&&r.length==1)l=r[0],o="remove",c=u=>u.mark(l.removeFromSet(u.marks));else return null;let d=[];for(let u=0;ut||or(o,!0,!1){r.isTextblock&&o>=e&&o0&&(e||n.indexAfter(s)==n.node(s).childCount);)s--,i++,e=!1;if(t){let r=n.node(s).maybeChild(n.indexAfter(s));for(;r&&!r.isLeaf;)r=r.firstChild,i++}return i}function G0(n,e,t,s,i){let r=n.findDiffStart(e,t),o=t+n.size,l=t+e.size;if(r==null)return null;let{a:c,b:d}=n.findDiffEnd(e,o,l);if(i=="end"){let u=Math.max(0,r-Math.min(c,d));s-=c+u-r}if(c=c?r-s:0;r-=u,d=r+(d-c),c=r}else if(d=d?r-s:0;r-=u,c=r+(c-d),d=r}return{start:r,endA:c,endB:d}}class dd{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new d0,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Pl),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Rl(this),$l(this),this.nodeViews=Ll(this),this.docView=hl(this.state.doc,Dl(this),rr(this),this.dom,this),this.domObserver=new B0(this,(s,i,r,o)=>U0(this,s,i,r,o)),this.domObserver.start(),u0(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Lr(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Pl),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let s in this._props)t[s]=this._props[s];t.state=this.state;for(let s in e)t[s]=e[s];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var s;let i=this.state,r=!1,o=!1;e.storedMarks&&this.composing&&(sd(this),o=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let h=Ll(this);X0(h,this.nodeViews)&&(this.nodeViews=h,r=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&Lr(this),this.editable=Rl(this),$l(this);let c=rr(this),d=Dl(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",p=r||!this.docView.matchesNode(e.doc,d,c);(p||!e.selection.eq(i.selection))&&(o=!0);let f=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&My(this);if(o){this.domObserver.stop();let h=p&&(je||Ee)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Y0(i.selection,e.selection);if(p){let b=Ee?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=T0(this)),(r||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=hl(e.doc,d,c,this.dom,this)),b&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}let g=this.input.mouseDown;h||!(g&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Gy(this)&&g.delaySelUpdate())?gt(this,h):(Hc(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((s=this.dragging)===null||s===void 0)&&s.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&Ty(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!rn(this.dom,e))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof W){let t=this.docView.domAfterPos(this.state.selection.from);q(t)&&cl(this,t.getBoundingClientRect(),e)}else cl(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t0&&rt.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Dy(this,e)}coordsAtPos(e,t=1){return Lc(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,s=-1){let i=this.docView.posFromDOM(e,t,s);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return By(this,t||this.state,e)}pasteHTML(e,t){return ds(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ds(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return po(this,e)}destroy(){this.docView&&(p0(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],rr(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,my())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return h0(this,e)}domSelectionRange(){let e=this.dom.isConnected!==!1&&this.domSelection();return e?$e&&this.root.nodeType===11&&ky(this.dom.ownerDocument)==this.dom&&z0(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}dd.prototype.dispatch=function(n){let e=this._props.dispatchTransaction;e?e.call(this,n):this.updateState(this.state.apply(n))};function Dl(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let s in t)s=="class"?e.class+=" "+t[s]:s=="style"?e.style=(e.style?e.style+";":"")+t[s]:!e[s]&&s!="contenteditable"&&s!="nodeName"&&(e[s]=String(t[s]))}),e.translate||(e.translate="no"),[Le.node(0,n.state.doc.content.size,e)]}function $l(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:Le.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function Rl(n){return!n.someProp("editable",e=>e(n.state)===!1)}function Y0(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function Ll(n){let e=Object.create(null);function t(s){for(let i in s)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=s[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function X0(n,e){let t=0,s=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)s++;return t!=s}function Pl(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Lt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Qs={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Z0=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),Q0=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Me=0;Me<10;Me++)Lt[48+Me]=Lt[96+Me]=String(Me);for(var Me=1;Me<=24;Me++)Lt[Me+111]="F"+Me;for(var Me=65;Me<=90;Me++)Lt[Me]=String.fromCharCode(Me+32),Qs[Me]=String.fromCharCode(Me);for(var lr in Lt)Qs.hasOwnProperty(lr)||(Qs[lr]=Lt[lr]);function e1(n){var e=Z0&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Q0&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Qs:Lt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const t1=typeof navigator!="undefined"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),n1=typeof navigator!="undefined"&&/Win/.test(navigator.platform);function s1(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let s,i,r,o;for(let l=0;l=t?we.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};we.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};we.prototype.forEach=function(e,t,s){t===void 0&&(t=0),s===void 0&&(s=this.length),t<=s?this.forEachInner(e,t,s,0):this.forEachInvertedInner(e,t,s,0)};we.prototype.map=function(e,t,s){t===void 0&&(t=0),s===void 0&&(s=this.length);var i=[];return this.forEach(function(r,o){return i.push(e(r,o))},t,s),i};we.from=function(e){return e instanceof we?e:e&&e.length?new pd(e):we.empty};var pd=(function(n){function e(s){n.call(this),this.values=s}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,r){return i==0&&r==this.length?this:new e(this.values.slice(i,r))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,r,o,l){for(var c=r;c=o;c--)if(i(this.values[c],l+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=ei)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=ei)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(we);we.empty=new pd([]);var o1=(function(n){function e(t,s){n.call(this),this.left=t,this.right=s,this.length=t.length+s.length,this.depth=Math.max(t.depth,s.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(s){return sl&&this.right.forEachInner(s,Math.max(i-l,0),Math.min(this.length,r)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(s,i,r,o){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(s,i-l,Math.max(r,l)-l,o+l)===!1||r=r?this.right.slice(s-r,i-r):this.left.slice(s,r).append(this.right.slice(0,i-r))},e.prototype.leafAppend=function(s){var i=this.right.leafAppend(s);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(s){var i=this.left.leafPrepend(s);if(i)return new e(i,this.right)},e.prototype.appendInner=function(s){return this.left.depth>=Math.max(this.right.depth,s.depth)+1?new e(this.left,new e(this.right,s)):new e(this,s)},e})(we);const l1=500;class Ye{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}let i,r;t&&(i=this.remapping(s,this.items.length),r=i.maps.length);let o=e.tr,l,c,d=[],u=[];return this.items.forEach((p,f)=>{if(!p.step){i||(i=this.remapping(s,f+1),r=i.maps.length),r--,u.push(p);return}if(i){u.push(new et(p.map));let h=p.step.map(i.slice(r)),g;h&&o.maybeStep(h).doc&&(g=o.mapping.maps[o.mapping.maps.length-1],d.push(new et(g,void 0,void 0,d.length+u.length))),r--,g&&i.appendMap(g,r)}else o.maybeStep(p.step);if(p.selection)return l=i?p.selection.map(i.slice(r)):p.selection,c=new Ye(this.items.slice(0,s).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:l}}addTransform(e,t,s,i){let r=[],o=this.eventCount,l=this.items,c=!i&&l.length?l.get(l.length-1):null;for(let u=0;uc1&&(l=a1(l,d),o-=d),new Ye(l.append(r),o)}remapping(e,t){let s=new ls;return this.items.forEach((i,r)=>{let o=i.mirrorOffset!=null&&r-i.mirrorOffset>=e?s.maps.length-i.mirrorOffset:void 0;s.appendMap(i.map,o)},e,t),s}addMaps(e){return this.eventCount==0?this:new Ye(this.items.append(e.map(t=>new et(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;t=Math.min(this.items.length,t);let s=[],i=this.items.length-t,r=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},i);let c=t;this.items.forEach(f=>{let h=r.getMirror(--c);if(h==null)return;o=Math.min(o,h);let g=r.maps[h];if(f.step){let b=e.steps[h].invert(e.docs[h]),m=f.selection&&f.selection.map(r.slice(c+1,h));m&&l++,s.push(new et(g,b,m))}else s.push(new et(g))},i);let d=[];for(let f=t;fl1&&(p=p.compress(this.items.length-s.length)),p}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),s=t.maps.length,i=[],r=0;return this.items.forEach((o,l)=>{if(l>=e)i.push(o),o.selection&&r++;else if(o.step){let c=o.step.map(t.slice(s)),d=c&&c.getMap();if(s--,d&&t.appendMap(d,s),c){let u=o.selection&&o.selection.map(t.slice(s));u&&r++;let p=new et(d.invert(),c,u),f,h=i.length-1;(f=i.length&&i[h].merge(p))?i[h]=f:i.push(p)}}else o.map&&s--},this.items.length,0),new Ye(we.from(i.reverse()),r)}}Ye.empty=new Ye(we.empty,0);function a1(n,e){let t;return n.forEach((s,i)=>{if(s.selection&&e--==0)return t=i,!1}),n.slice(t)}class et{constructor(e,t,s,i){this.map=e,this.step=t,this.selection=s,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new et(t.getMap().invert(),t,this.selection)}}}class St{constructor(e,t,s,i,r){this.done=e,this.undone=t,this.prevRanges=s,this.prevTime=i,this.prevComposition=r}}const c1=20;function d1(n,e,t,s){let i=t.getMeta(Rt),r;if(i)return i.historyState;t.getMeta(fd)&&(n=new St(n.done,n.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(o&&o.getMeta(Rt))return o.getMeta(Rt).redo?new St(n.done.addTransform(t,void 0,s,Fs(e)),n.undone,Bl(t.mapping.maps),n.prevTime,n.prevComposition):new St(n.done,n.undone.addTransform(t,void 0,s,Fs(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),c=n.prevTime==0||!o&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-s.newGroupDelay||!u1(t,n.prevRanges)),d=o?cr(n.prevRanges,t.mapping):Bl(t.mapping.maps);return new St(n.done.addTransform(t,c?e.selection.getBookmark():void 0,s,Fs(e)),Ye.empty,d,t.time,l==null?n.prevComposition:l)}else return(r=t.getMeta("rebased"))?new St(n.done.rebased(t,r),n.undone.rebased(t,r),cr(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new St(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),cr(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function u1(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((s,i)=>{for(let r=0;r=e[r]&&(t=!0)}),t}function Bl(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((s,i,r,o)=>e.push(r,o));return e}function cr(n,e){if(!n)return null;let t=[];for(let s=0;s{let i=Rt.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(s){let r=p1(i,t,n);r&&s(e?r.scrollIntoView():r)}return!0}}const md=hd(!1,!0),gd=hd(!0,!0);function m1(n){return n.getMeta(Rt)!=null}function Fi(n){const{state:e,transaction:t}=n;let{selection:s}=t,{doc:i}=t,{storedMarks:r}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return r},get selection(){return s},get doc(){return i},get tr(){return s=t.selection,i=t.doc,r=t.storedMarks,t}}}var xn=class bd{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:s}=this,{view:i}=t,{tr:r}=s,o=this.buildProps(r);return Object.fromEntries(Object.entries(e).map(([l,c])=>[l,(...u)=>{const p=c(...u)(o);return!r.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(r),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:s,editor:i,state:r}=this,{view:o}=i,l=[],c=!!e,d=e||r.tr,u=()=>(!c&&t&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(d),l.every(f=>f===!0)),p={...Object.fromEntries(Object.entries(s).map(([f,h])=>[f,(...b)=>{const m=this.buildProps(d,t),v=h(...b)(m);return l.push(v),p}])),run:u};return p}static createFakeChain(){const e=new Proxy({},{get:(t,s)=>{if(s!=="then")return s==="run"?()=>!1:()=>e}});return e}createCan(e){const{rawCommands:t,state:s}=this,i=!1,r=e||s.tr,o=this.buildProps(r,i);return{...Object.fromEntries(Object.entries(t).map(([l,c])=>[l,(...d)=>c(...d)({...o,dispatch:void 0})])),chain:()=>this.createChain(r,i)}}static createFallbackCan(){const e=bd.createFakeChain();return new Proxy({chain:()=>e},{get:(t,s)=>{if(s!=="then")return s==="chain"?t.chain:()=>!1}})}buildProps(e,t=!0){const{rawCommands:s,editor:i,state:r}=this,{view:o}=i,l={tr:e,editor:i,view:o,state:Fi({state:r,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(s).map(([c,d])=>[c,(...u)=>d(...u)(l)]))}};return l}};const g1=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{if(!n.isDestroyed){var t;e.dom.blur(),(t=window)===null||t===void 0||(t=t.getSelection())===null||t===void 0||t.removeAllRanges()}}),!0),b1=(n=!0)=>({commands:e})=>e.setContent("",{emitUpdate:n}),v1=()=>({state:n,tr:e,dispatch:t})=>{const{selection:s}=e,{ranges:i}=s;return t&&i.forEach(({$from:r,$to:o})=>{n.doc.nodesBetween(r.pos,o.pos,(l,c)=>{if(l.type.isText)return;const{doc:d,mapping:u}=e,p=d.resolve(u.map(c)),f=d.resolve(u.map(c+l.nodeSize)),h=p.blockRange(f);if(!h)return;const g=Dn(h);if(l.type.isTextblock){const{defaultType:b}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(h.start,b)}(g||g===0)&&e.lift(h,g)})}),!0},y1=n=>e=>n(e),k1=()=>({state:n,dispatch:e})=>Cc(n,e),x1=(n,e)=>({editor:t,tr:s})=>{const{state:i}=t,r=i.doc.slice(n.from,n.to);s.deleteRange(n.from,n.to);const o=s.mapping.map(e);return s.insert(o,r.content),s.setSelection(new U(s.doc.resolve(Math.max(o-1,0)))),!0},w1=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,s=t.$anchor.node();if(s.content.size>0)return!1;const i=n.selection.$anchor;for(let r=i.depth;r>0;r-=1)if(i.node(r).type===s.type){if(e){const o=i.before(r),l=i.after(r);n.delete(o,l).scrollIntoView()}return!0}return!1};function ye(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}const S1=n=>({tr:e,state:t,dispatch:s})=>{const i=ye(n,t.schema),r=e.selection.$anchor;for(let o=r.depth;o>0;o-=1)if(r.node(o).type===i){if(s){const l=r.before(o),c=r.after(o);e.delete(l,c).scrollIntoView()}return!0}return!1},C1=n=>({tr:e,dispatch:t})=>{const{from:s,to:i}=n;return t&&e.delete(s,i),!0},M1=n=>n.content?/^text(\*|\+)/.test(n.content):!1,zl=(n,e,t)=>{if(!n.parent.isInline||t==="left"&&n.pos>n.start()||t==="right"&&n.pos({from:zl(n,t,"left"),to:zl(e,t,"right")}),E1=()=>({state:n,dispatch:e})=>{if(n.selection.empty)return!1;if(e){const t=n.tr,{ranges:s}=n.selection,i=t.steps.length;s.forEach(r=>{const o=t.mapping.slice(i),l=t.doc.resolve(o.map(r.$from.pos)),c=t.doc.resolve(o.map(r.$to.pos)),{from:d,to:u}=T1(l,c,n.schema);t.deleteRange(d,u)}),t.selection.empty||t.setSelection(U.near(t.doc.resolve(t.selection.from))),t.scrollIntoView(),e(t)}return!0},A1=()=>({commands:n})=>n.keyboardShortcut("Enter"),O1=()=>({state:n,dispatch:e})=>ey(n,e);function vo(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function ti(n,e,t={strict:!0}){const s=Object.keys(e);return s.length?s.every(i=>t.strict?e[i]===n[i]:vo(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function vd(n,e,t={}){return n.find(s=>s.type===e&&ti(Object.fromEntries(Object.keys(t).map(i=>[i,s.attrs[i]])),t))}function jl(n,e,t={}){return!!vd(n,e,t)}function yo(n,e,t){if(!n||!e)return;let s=n.parent.childAfter(n.parentOffset);if((!s.node||!s.node.marks.some(c=>c.type===e))&&(s=n.parent.childBefore(n.parentOffset)),!s.node||!s.node.marks.some(c=>c.type===e))return;if(!t){const c=s.node.marks.find(d=>d.type===e);c&&(t=c.attrs)}if(!vd([...s.node.marks],e,t))return;let i=s.index,r=n.start()+s.offset,o=i+1,l=r+s.node.nodeSize;for(;i>0&&jl([...n.parent.child(i-1).marks],e,t);)i-=1,r-=n.parent.child(i).nodeSize;for(;o({tr:t,state:s,dispatch:i})=>{const r=vt(n,s.schema),{doc:o,selection:l}=t,{$from:c,from:d,to:u}=l;if(i){const p=yo(c,r,e);if(p&&p.from<=d&&p.to>=u){const f=U.create(o,p.from,p.to);t.setSelection(f)}}return!0},I1=n=>e=>{const t=typeof n=="function"?n(e):n;for(let s=0;s({editor:t,view:s,tr:i,dispatch:r})=>{e={scrollIntoView:!0,...e};const o=()=>{(ni()||Fl())&&s.dom.focus(),D1()&&!ni()&&!Fl()&&s.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{t.isDestroyed||(s.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};try{if(s.hasFocus()&&n===null||n===!1)return!0}catch(d){return!1}if(r&&n===null&&!yd(t.state.selection))return o(),!0;const l=Pr(i.doc,n)||t.state.selection,c=t.state.selection.eq(l);return r&&(c||i.setSelection(l),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},R1=(n,e)=>t=>n.every((s,i)=>e(s,{...t,index:i})),L1=(n,e)=>({tr:t,commands:s})=>s.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),kd=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const s=e[t];s.nodeType===3&&s.nodeValue&&/^(\n\s\s|\n)$/.test(s.nodeValue)?n.removeChild(s):s.nodeType===1&&kd(s)}return n};function Es(n){if(typeof window=="undefined")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`${n}`,t=new window.DOMParser().parseFromString(e,"text/html").body;return kd(t)}function xd(n){return typeof(n==null?void 0:n.nodesBetween)=="function"}function En(n,e,t){if(xd(n))return n;const s=typeof n=="object"&&n!==null;t={slice:!0,parseOptions:{},...t};const i=typeof n=="string";if(s)try{if(Array.isArray(n)&&n.length>0)return $.fromArray(n.map(o=>e.nodeFromJSON(o)));const r=e.nodeFromJSON(n);return t.errorOnInvalidContent&&r.check(),r}catch(r){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),En("",e,t)}if(i){if(t.errorOnInvalidContent){let o=!1,l="";const c=new _s({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(o=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(t.slice?Ot.fromSchema(c).parseSlice(Es(n),t.parseOptions):Ot.fromSchema(c).parse(Es(n),t.parseOptions),t.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const r=Ot.fromSchema(e);return t.slice?r.parseSlice(Es(n),t.parseOptions).content:r.parse(Es(n),t.parseOptions)}return En("",e,t)}function wd(n){return!("type"in n)}function Sd(n,e,t){const s=n.steps.length-1;if(s{o===0&&(o=u)}),n.setSelection(X.near(n.doc.resolve(o),t))}const P1=(n,e,t)=>({tr:s,dispatch:i,editor:r})=>{if(i){t={parseOptions:r.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let l;const c=m=>{r.emit("contentError",{editor:r,error:m,disableCollaboration:()=>{"collaboration"in r.storage&&typeof r.storage.collaboration=="object"&&r.storage.collaboration&&(r.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!r.options.enableContentCheck&&r.options.emitContentError)try{En(e,r.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(m){c(m)}try{var o;l=En(e,r.schema,{parseOptions:d,errorOnInvalidContent:(o=t.errorOnInvalidContent)!==null&&o!==void 0?o:r.options.enableContentCheck})}catch(m){return c(m),!1}let{from:u,to:p}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},f=!0,h=!0;const g=wd(l)?l.content:[l];if(g.forEach(m=>{m.check(),f=f?m.isText&&m.marks.length===0:!1,h=h?m.isBlock:!1}),u===p&&h){const{parent:m}=s.doc.resolve(u);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(u-=1,p+=1)}let b;if(f)Array.isArray(e)?b=e.map(m=>m.text||"").join(""):xd(e)?b=g.map(m=>{var v;return(v=m.text)!==null&&v!==void 0?v:""}).join(""):typeof e=="object"&&e&&e.text?b=e.text:b=e,s.insertText(b,u,p);else{b=$.from(g);const m=s.doc.resolve(u),v=m.node(),S=m.parentOffset===0,A=v.isText||v.isTextblock,O=v.content.size>0;S&&A&&O&&h&&(u=Math.max(0,u-1)),s.replaceWith(u,p,g)}t.updateSelection&&Sd(s,s.steps.length-1,-1),t.applyInputRules&&s.setMeta("applyInputRules",{from:u,text:b}),t.applyPasteRules&&s.setMeta("applyPasteRules",{from:u,text:b})}return!0};function Cd(n){for(let e=0;e({tr:e,dispatch:t,editor:s})=>{const{pos:i,attrs:r,content:o,updateSelection:l=!0}=n;let c;typeof i=="number"?c=e.doc.resolve(i):i?c=i:c=e.selection.$from;const d=Cd(c.parent.contentMatchAt(c.index()));if(!d)return!1;const u=Object.keys(d.spec.attrs||{}),p=r?Object.fromEntries(Object.entries(r).filter(([h])=>u.includes(h))):{};let f;if(o){const h=En(o,s.schema);f=d.createAndFill(p,h)}else f=d.createAndFill(p);return f?(t&&(e.insert(c.pos,f),l&&Sd(e,e.steps.length-1,-1)),!0):!1},_1=()=>({state:n,dispatch:e})=>Xv(n,e),z1=()=>({state:n,dispatch:e})=>Zv(n,e),j1=()=>({state:n,dispatch:e})=>bc(n,e),F1=()=>({state:n,dispatch:e})=>xc(n,e),Md=(n,e)=>{const t=n.resolve(e),s=t.nodeBefore,i=t.nodeAfter;return!s||!i?!1:!s.type.spec.isolating&&!i.type.spec.isolating},V1=()=>({state:n,dispatch:e,tr:t})=>{try{const s=Li(n.doc,n.selection.$from.pos,-1);return s==null||!Md(n.doc,s)?!1:(t.join(s,2),e&&e(t),!0)}catch(s){return!1}},H1=()=>({state:n,dispatch:e,tr:t})=>{try{const s=Li(n.doc,n.selection.$from.pos,1);return s==null||!Md(n.doc,s)?!1:(t.join(s,2),e&&e(t),!0)}catch(s){return!1}},q1=()=>({state:n,dispatch:e})=>Gv(n,e),U1=()=>({state:n,dispatch:e})=>Yv(n,e);function Td(){return typeof navigator!="undefined"?/Mac/.test(navigator.platform):!1}function W1(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let s,i,r,o;for(let l=0;l({editor:e,view:t,tr:s,dispatch:i})=>{const r=W1(n).split(/-(?!$)/),o=r.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:r.includes("Alt"),ctrlKey:r.includes("Ctrl"),metaKey:r.includes("Meta"),shiftKey:r.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{t.someProp("handleKeyDown",d=>d(t,l))});return c==null||c.steps.forEach(d=>{const u=d.map(s.mapping);u&&i&&s.maybeStep(u)}),!0};function bt(n,e,t={}){const{from:s,to:i,empty:r}=n.selection,o=e?ye(e,n.schema):null,l=[];n.doc.nodesBetween(s,i,(u,p)=>{if(u.isText)return;const f=Math.max(s,p),h=Math.min(i,p+u.nodeSize);l.push({node:u,from:f,to:h})});const c=i-s,d=l.filter(u=>o?o.name===u.node.type.name:!0).filter(u=>ti(u.node.attrs,t,{strict:!1}));return r?!!d.length:d.reduce((u,p)=>u+p.to-p.from,0)>=c}const J1=(n,e={})=>({state:t,dispatch:s})=>bt(t,ye(n,t.schema),e)?Qv(t,s):!1,G1=()=>({state:n,dispatch:e})=>Mc(n,e),Y1=n=>({state:e,dispatch:t})=>{const s=ye(n,e.schema);return uy(s)(e,t)},X1=()=>({state:n,dispatch:e})=>Sc(n,e);function Vi(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Vl(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((s,i)=>(t.includes(i)||(s[i]=n[i]),s),{})}const Z1=(n,e)=>({tr:t,state:s,dispatch:i})=>{let r=null,o=null;const l=Vi(typeof n=="string"?n:n.name,s.schema);if(!l)return!1;l==="node"&&(r=ye(n,s.schema)),l==="mark"&&(o=vt(n,s.schema));let c=!1;return t.selection.ranges.forEach(d=>{s.doc.nodesBetween(d.$from.pos,d.$to.pos,(u,p)=>{r&&r===u.type&&(c=!0,i&&t.setNodeMarkup(p,void 0,Vl(u.attrs,e))),o&&u.marks.length&&u.marks.forEach(f=>{o===f.type&&(c=!0,i&&t.addMark(p,p+u.nodeSize,o.create(Vl(f.attrs,e))))})})}),c},Q1=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),ek=()=>({tr:n,dispatch:e})=>{if(e){const t=new qe(n.doc);n.setSelection(t)}return!0},tk=()=>({state:n,dispatch:e})=>yc(n,e),nk=()=>({state:n,dispatch:e})=>wc(n,e),sk=()=>({state:n,dispatch:e})=>sy(n,e),ik=()=>({state:n,dispatch:e})=>oy(n,e),rk=()=>({state:n,dispatch:e})=>ry(n,e);function Br(n,e,t={},s={}){return En(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:s.errorOnInvalidContent})}const ok=(n,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:s={}}={})=>({editor:i,tr:r,dispatch:o,commands:l})=>{const{doc:c}=r;if(s.preserveWhitespace!=="full"){const d=Br(n,i.schema,s,{errorOnInvalidContent:e!=null?e:i.options.enableContentCheck});if(o){const u=wd(d)?d.content:[d];r.replaceWith(0,c.content.size,u).setMeta("preventUpdate",!t)}return!0}return o&&r.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:c.content.size},n,{parseOptions:s,errorOnInvalidContent:e!=null?e:i.options.enableContentCheck})};function Ed(n,e){const t=vt(e,n.schema),{from:s,to:i,empty:r}=n.selection,o=[];r?(n.storedMarks&&o.push(...n.storedMarks),o.push(...n.selection.$head.marks())):n.doc.nodesBetween(s,i,c=>{o.push(...c.marks)});const l=o.find(c=>c.type.name===t.name);return l?{...l.attrs}:{}}function Ad(n,e){const t=new pc(n);return e.forEach(s=>{s.steps.forEach(i=>{t.step(i)})}),t}function lk(n,e,t){const s=[];return n.nodesBetween(e.from,e.to,(i,r)=>{t(i)&&s.push({node:i,pos:r})}),s}function ak(n,e){for(let t=n.depth;t>0;t-=1){const s=n.node(t);if(e(s))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:s}}}function Hi(n){return e=>ak(e.$from,n)}function V(n,e,t){return n.config[e]===void 0&&n.parent?V(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?V(n.parent,e,t):null}):n.config[e]}function ko(n){return n.map(e=>{const t=V(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...ko(t())]:e}).flat(10)}function xo(n,e){const t=ln.fromSchema(e).serializeFragment(n),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(t),s.innerHTML}function Od(n,e){const t=new Map;for(const i of n){var s;const r=(s=t.get(i.type))!==null&&s!==void 0?s:new Map;r.set(i.name,i),t.set(i.type,r)}return[...Object.values(e.nodes),...Object.values(e.marks)].flatMap(i=>{var r;return Object.entries((r=i.spec.attrs)!==null&&r!==void 0?r:{}).map(([o,l])=>{var c;const d=(c=t.get(i.name))===null||c===void 0?void 0:c.get(o),u=Object.hasOwn(l,"default");return{type:i.name,name:o,attribute:{rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,...d==null?void 0:d.attribute,default:l.default,isRequired:!u,validate:l.validate}}})})}const ck={content:"string",marks:"string",group:"string",inline:"boolean",atom:"boolean",selectable:"boolean",draggable:"boolean",code:"boolean",whitespace:["pre","normal"],definingAsContext:"boolean",definingForContent:"boolean",defining:"boolean",isolating:"boolean",linebreakReplacement:"boolean"},dk={inclusive:"boolean",excludes:"string",group:"string",spanning:"boolean",code:"boolean"};function uk(n,e,t){return Object.fromEntries(Object.entries(e).flatMap(([s,i])=>{const r=n[s];if(r===void 0)return[];if(!(typeof i=="string"?typeof r===i:typeof r=="string"&&i.includes(r)))throw new RangeError(`Invalid schemaSpec field '${t}.${s}'`);return[[s,r]]}))}function Hl(n,e,t,s){return{...Object.fromEntries(Object.entries(e).filter(([i])=>i!=="attrs"&&!Object.hasOwn(s,i))),...uk(t,s,n),attrs:t.attrs}}function ql(n,e,t){for(const s of Object.keys(e))if(!Object.hasOwn(n,s))throw new RangeError(`schemaSpec requires a local ${t} extension named '${s}'`);for(const s of Object.keys(n))if(!Object.hasOwn(e,s))throw new RangeError(`Local ${t} extension '${s}' is not in schemaSpec`)}function pk(n,e){ql(n.nodes,e.nodes,"node"),ql(n.marks,e.marks,"mark");let t=e.spec.nodes,s=e.spec.marks;return e.spec.nodes.forEach((i,r)=>{t=t.update(i,Hl(i,n.nodes[i],r,ck))}),e.spec.marks.forEach((i,r)=>{s=s.update(i,Hl(i,n.marks[i],r,dk))}),{topNode:e.topNodeType.name,nodes:t,marks:s}}function Nd(n){const e=n.filter((t,s)=>n.indexOf(t)!==s);return Array.from(new Set(e))}function An(n){return{baseExtensions:n.filter(e=>e.type==="extension"),nodeExtensions:n.filter(e=>e.type==="node"),markExtensions:n.filter(e=>e.type==="mark")}}function wo(n){const e=[],{nodeExtensions:t,markExtensions:s}=An(n),i=[...t,...s],r={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=t.filter(d=>d.name!=="text").map(d=>d.name),l=s.map(d=>d.name),c=[...o,...l];return n.forEach(d=>{const u=V(d,"addGlobalAttributes",{name:d.name,options:d.options,storage:d.storage,extensions:i});u&&u().forEach(p=>{let f;Array.isArray(p.types)?f=p.types:p.types==="*"?f=c:p.types==="nodes"?f=o:p.types==="marks"?f=l:f=[],f.forEach(h=>{Object.entries(p.attributes).forEach(([g,b])=>{e.push({type:h,name:g,attribute:{...r,...b}})})})})}),i.forEach(d=>{const u=V(d,"addAttributes",{name:d.name,options:d.options,storage:d.storage});if(!u)return;const p=u();Object.entries(p).forEach(([f,h])=>{const g={...r,...h};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,e.push({type:d.name,name:f,attribute:g})})}),e}function _r(n){return typeof n=="function"}function se(n,e=void 0,...t){return _r(n)?e?n.bind(e)(...t):n(...t):n}function fk(n={}){return Object.keys(n).length===0&&n.constructor===Object}function hk(n){const e=[];let t="",s=!1,i=!1,r=0;const o=n.length;for(let l=0;l0){r-=1,t+=c;continue}if(c===";"&&r===0){e.push(t),t="";continue}}t+=c}return t&&e.push(t),e}function Ul(n){const e=[],t=hk(n||""),s=t.length;for(let i=0;i!!e).reduce((e,t)=>{const s={...e};return Object.entries(t).forEach(([i,r])=>{if(i==="__proto__"){Object.defineProperty(s,i,{configurable:!0,enumerable:!0,value:r,writable:!0});return}if(!s[i]){s[i]=r;return}if(i==="class"){const o=r?String(r).split(" "):[],l=s[i]?s[i].split(" "):[],c=o.filter(d=>!l.includes(d));s[i]=[...l,...c].join(" ")}else if(i==="style"){const o=new Map([...Ul(s[i]),...Ul(r)]);s[i]=Array.from(o.entries()).map(([l,c])=>`${l}: ${c}`).join("; ")}else s[i]=r}),s},{})}function ps(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,s)=>ke(t,s),{})}function mk(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Wl(n,e){return"style"in n?n:{...n,getAttrs:t=>{const s=n.getAttrs?n.getAttrs(t):n.attrs;if(s===!1)return!1;const i=e.reduce((r,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(t):mk(t.getAttribute(o.name));return l==null?r:{...r,[o.name]:l}},{});return{...s,...i}}}}function Kl(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&fk(t)?!1:t!=null))}function Jl(n){var e,t;const s={};return!(!(n==null||(e=n.attribute)===null||e===void 0)&&e.isRequired)&&"default"in((n==null?void 0:n.attribute)||{})&&(s.default=n.attribute.default),(n==null||(t=n.attribute)===null||t===void 0?void 0:t.validate)!==void 0&&(s.validate=n.attribute.validate),[n.name,s]}function Gl(n,e,t=wo(n)){var s;const{nodeExtensions:i,markExtensions:r}=An(n);return{topNode:(s=i.find(o=>V(o,"topNode")))===null||s===void 0?void 0:s.name,nodes:Object.fromEntries(i.map(o=>{const l=t.filter(h=>h.type===o.name),c={name:o.name,options:o.options,storage:o.storage,editor:e},d=Kl({...n.reduce((h,g)=>{const b=V(g,"extendNodeSchema",c);return{...h,...b?b(o):{}}},{}),content:se(V(o,"content",c)),marks:se(V(o,"marks",c)),group:se(V(o,"group",c)),inline:se(V(o,"inline",c)),atom:se(V(o,"atom",c)),selectable:se(V(o,"selectable",c)),draggable:se(V(o,"draggable",c)),code:se(V(o,"code",c)),whitespace:se(V(o,"whitespace",c)),linebreakReplacement:se(V(o,"linebreakReplacement",c)),defining:se(V(o,"defining",c)),isolating:se(V(o,"isolating",c)),attrs:Object.fromEntries(l.map(Jl))}),u=se(V(o,"parseHTML",c));u&&(d.parseDOM=u.map(h=>Wl(h,l)));const p=V(o,"renderHTML",c);p&&(d.toDOM=h=>p({node:h,HTMLAttributes:ps(h,l)}));const f=V(o,"renderText",c);return f&&(d.toText=f),[o.name,d]})),marks:Object.fromEntries(r.map(o=>{const l=t.filter(f=>f.type===o.name),c={name:o.name,options:o.options,storage:o.storage,editor:e},d=Kl({...n.reduce((f,h)=>{const g=V(h,"extendMarkSchema",c);return{...f,...g?g(o):{}}},{}),inclusive:se(V(o,"inclusive",c)),excludes:se(V(o,"excludes",c)),group:se(V(o,"group",c)),spanning:se(V(o,"spanning",c)),code:se(V(o,"code",c)),attrs:Object.fromEntries(l.map(Jl))}),u=se(V(o,"parseHTML",c));u&&(d.parseDOM=u.map(f=>Wl(f,l)));const p=V(o,"renderHTML",c);return p&&(d.toDOM=f=>p({mark:f,HTMLAttributes:ps(f,l)})),[o.name,d]}))}}function gk(n,e,t){if(t===void 0)return new _s(Gl(n,e));const s=Nd(n.filter(o=>o.type!=="extension").map(o=>o.name));if(s.length)throw new RangeError(`Duplicate local schema types: ${s.join(", ")}`);const i=new _s(t),r=Gl(n,e,Od(wo(n),i));return new _s(pk(r,i))}function Kn(n){return n.sort((t,s)=>{const i=V(t,"priority")||100,r=V(s,"priority")||100;return i>r?-1:is.name));return t.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${t.map(s=>`'${s}'`).join(", ")}]. This can lead to issues.`),e}function Dd(n,e,t){const{from:s,to:i}=e,{blockSeparator:r=` -`,textSerializers:o={}}=t||{};let l="";return n.nodesBetween(s,i,(c,d,u,p)=>{c.isBlock&&d>s&&(l+=r);const f=o==null?void 0:o[c.type.name];if(f)return u&&(l+=f({node:c,pos:d,parent:u,index:p,range:e})),!1;if(c.isText){var h;l+=c==null||(h=c.text)===null||h===void 0?void 0:h.slice(Math.max(s,d)-d,i-d)}}),l}function gk(n,e){return Dd(n,{from:0,to:n.content.size},e)}function $d(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function bk(n,e){const t=ve(e,n.schema),{from:s,to:i}=n.selection,r=[];n.doc.nodesBetween(s,i,l=>{r.push(l)});const o=r.reverse().find(l=>l.type.name===t.name);return o?{...o.attrs}:{}}function Rd(n,e){const t=Vi(typeof e=="string"?e:e.name,n.schema);return t==="node"?bk(n,e):t==="mark"?Ed(n,e):{}}function yk(n,e=JSON.stringify){const t={};return n.filter(s=>{const i=e(s);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function vk(n){const e=yk(n);return e.length===1?e:e.filter((t,s)=>!e.filter((i,r)=>r!==s).some(i=>t.oldRange.from>=i.oldRange.from&&t.oldRange.to<=i.oldRange.to&&t.newRange.from>=i.newRange.from&&t.newRange.to<=i.newRange.to))}function qi(n){const{mapping:e,steps:t}=n,s=[];return e.maps.forEach((i,r)=>{const o=[];if(i.ranges.length)i.forEach((l,c)=>{o.push({from:l,to:c})});else{const{from:l,to:c}=t[r];if(l===void 0||c===void 0)return;o.push({from:l,to:c})}o.forEach(({from:l,to:c})=>{const d=e.slice(r).map(l,-1),u=e.slice(r).map(c),p=e.invert().map(d,-1),f=e.invert().map(u);s.push({oldRange:{from:p,to:f},newRange:{from:d,to:u}})})}),vk(s)}function Ui(n,e,t){const s=[];return n===e?t.resolve(n).marks().forEach(i=>{const r=vo(t.resolve(n),i.type);r&&s.push({mark:i,...r})}):t.nodesBetween(n,e,(i,r)=>{!i||(i==null?void 0:i.nodeSize)===void 0||s.push(...i.marks.map(o=>({from:r,to:r+i.nodeSize,mark:o})))}),s}const kk=(n,e,t,s=20)=>{const i=n.doc.resolve(t);let r=s,o=null;for(;r>0&&o===null;){const l=i.node(r);(l==null?void 0:l.type.name)===e?o=l:r-=1}return[o,r]},xk=n=>{const e=n.depth-1;if(e<0)return null;const t=n.index(e);return t===0?null:n.node(e).child(t-1)};function fn(n,e){return e.nodes[n]||e.marks[n]||null}function Vs(n,e,t){return Object.fromEntries(Object.entries(t).filter(([s])=>{const i=n.find(r=>r.type===e&&r.name===s);return i?i.attribute.keepOnSplit:!1}))}const wk=(n,e=500)=>{let t="";const s=n.parentOffset;return n.parent.nodesBetween(Math.max(0,s-e),s,(i,r,o,l)=>{var c,d;const u=((c=(d=i.type.spec).toText)===null||c===void 0?void 0:c.call(d,{node:i,pos:r,parent:o,index:l}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,s-r))}),t};function zr(n,e,t={}){const{empty:s,ranges:i}=n.selection,r=e?yt(e,n.schema):null;if(s)return!!(n.storedMarks||n.selection.$from.marks()).filter(u=>r?r.name===u.type.name:!0).find(u=>ti(u.attrs,t,{strict:!1}));let o=0;const l=[];if(i.forEach(({$from:u,$to:p})=>{const f=u.pos,h=p.pos;n.doc.nodesBetween(f,h,(g,b)=>{if(r&&g.inlineContent&&!g.type.allowsMarkType(r))return!1;if(!g.isText&&!g.marks.length)return;const m=Math.max(f,b),y=Math.min(h,b+g.nodeSize),S=y-m;o+=S,l.push(...g.marks.map(A=>({mark:A,from:m,to:y})))})}),o===0)return!1;const c=l.filter(u=>r?r.name===u.mark.type.name:!0).filter(u=>ti(u.mark.attrs,t,{strict:!1})).reduce((u,p)=>u+p.to-p.from,0),d=l.filter(u=>r?u.mark.type!==r&&u.mark.type.excludes(r):!0).reduce((u,p)=>u+p.to-p.from,0);return(c>0?c+d:c)>=o}function Sk(n,e,t={}){if(!e)return bt(n,null,t)||zr(n,null,t);const s=Vi(e,n.schema);return s==="node"?bt(n,e,t):s==="mark"?zr(n,e,t):!1}const Ck=(n,e)=>{const{$from:t,$to:s,$anchor:i}=n.selection;if(e){const r=Hi(l=>l.type.name===e)(n.selection);if(!r)return!1;const o=n.doc.resolve(r.pos+1);return i.pos+1===o.end()}return!(s.parentOffset{const{$from:e,$to:t}=n.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function Yl(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function Rn(n,e){const{nodeExtensions:t}=An(e),s=t.find(r=>r.name===n);if(!s)return!1;const i=se(V(s,"group",{name:s.name,options:s.options,storage:s.storage}));return typeof i!="string"?!1:i.split(" ").includes("list")}function vs(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){if(t){if(n.type.name==="hardBreak")return!0;if(n.isText){var s;return!/\S/.test((s=n.text)!==null&&s!==void 0?s:"")}}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let i=!0;return n.content.forEach(r=>{i!==!1&&(vs(r,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function Ld(n){return n instanceof W}function Tk(n){if(n===null||typeof n!="object")return!1;const e=n;return!(typeof e.apply!="function"||typeof e.getMap!="function"||typeof e.invert!="function"||typeof e.map!="function"||typeof e.merge!="function"||typeof e.toJSON!="function")}function Ek(n){if(n===null||typeof n!="object")return!1;const e=n;if(!Tk(e))return!1;const t=e.toJSON();return!(t===null||typeof t!="object"||t.stepType!=="replace")}var Pd=class Bd{constructor(e){this.position=e}static fromJSON(e){return new Bd(e.position)}toJSON(){return{position:this.position}}};function Ak(n,e){const t=e.mapping.mapResult(n.position);return{position:new Pd(t.pos),mapResult:t}}function Ok(n){return new Pd(n)}function Nk(n,e,t){const{selection:s}=e;let i=null;if(vd(s)&&(i=s.$cursor),i){var r;const l=(r=n.storedMarks)!==null&&r!==void 0?r:i.marks();return i.parent.type.allowsMarkType(t)&&(!!t.isInSet(l)||!l.some(c=>c.type.excludes(t)))}const{ranges:o}=s;return o.some(({$from:l,$to:c})=>{let d=l.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(l.pos,c.pos,(u,p,f)=>{if(d)return!1;if(u.isInline){const h=!f||f.type.allowsMarkType(t),g=!!t.isInSet(u.marks)||!u.marks.some(b=>b.type.excludes(t));d=h&&g}return!d}),d})}const Ik=(n,e={})=>({tr:t,state:s,dispatch:i})=>{const{selection:r}=t,{empty:o,ranges:l}=r,c=yt(n,s.schema);if(i)if(o){const d=Ed(s,c);t.addStoredMark(c.create({...d,...e}))}else l.forEach(d=>{const u=d.$from.pos,p=d.$to.pos;s.doc.nodesBetween(u,p,(f,h)=>{const g=Math.max(h,u),b=Math.min(h+f.nodeSize,p);f.marks.find(m=>m.type===c)?f.marks.forEach(m=>{c===m.type&&t.addMark(g,b,c.create({...m.attrs,...e}))}):t.addMark(g,b,c.create(e))})});return Nk(s,t,c)},Dk=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),$k=(n,e={})=>({state:t,dispatch:s,chain:i})=>{const r=ve(n,t.schema);let o;return t.selection.$anchor.sameParent(t.selection.$head)&&(o=t.selection.$anchor.parent.attrs),r.isTextblock?i().command(({commands:l})=>ol(r,{...o,...e})(t)?!0:l.clearNodes()).command(({state:l})=>ol(r,{...o,...e})(l,s)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Rk=n=>({tr:e,dispatch:t})=>{if(t){const{doc:s}=e,i=Kt(n,0,s.content.size),r=W.create(s,i);e.setSelection(r)}return!0},Lk=(n,e)=>({tr:t,state:s,dispatch:i})=>{const{selection:r}=s;let o,l;return typeof e=="number"?(o=e,l=e):e&&"from"in e&&"to"in e?(o=e.from,l=e.to):(o=r.from,l=r.to),i&&t.doc.nodesBetween(o,l,(c,d)=>{c.isText||t.setNodeMarkup(d,void 0,{...c.attrs,dir:n})}),!0},Pk=n=>({tr:e,dispatch:t})=>{if(t){const{doc:s}=e,{from:i,to:r}=typeof n=="number"?{from:n,to:n}:n,o=U.atStart(s).from,l=U.atEnd(s).to,c=Kt(i,o,l),d=Kt(r,o,l),u=U.create(s,c,d);e.setSelection(u)}return!0},Bk=n=>({state:e,dispatch:t})=>{const s=ve(n,e.schema);return fv(s)(e,t)};function Xl(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const s=t.filter(i=>e==null?void 0:e.includes(i.type.name));n.tr.ensureMarks(s)}}const _k=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:s,editor:i})=>{const{selection:r,doc:o}=e,{$from:l,$to:c}=r,d=i.extensionManager.attributes,u=Vs(d,l.node().type.name,l.node().attrs);if(r instanceof W&&r.node.isBlock)return!l.parentOffset||!mt(o,l.pos)?!1:(s&&(n&&Xl(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const p=c.parentOffset===c.parent.content.size,f=l.depth===0?void 0:Cd(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=p&&f?[{type:f,attrs:u}]:void 0;const g=r instanceof U&&!r.empty?pt.create({doc:e.doc,selection:r}).tr.deleteSelection():null,b=g?g.doc:e.doc,m=g?g.mapping.map(l.pos):l.pos;let y=mt(b,m,1,h);if(!h&&!y&&mt(b,m,1,f?[{type:f}]:void 0)&&(y=!0,h=f?[{type:f,attrs:u}]:void 0),s){if(y){const S=e.steps.length;if(r instanceof U&&e.deleteSelection(),e.split(e.mapping.slice(S).map(l.pos),1,h),f&&!p&&!l.parentOffset&&l.parent.type!==f){const A=e.mapping.slice(S).map(l.before()),O=e.doc.resolve(A);l.node(-1).canReplaceWith(O.index(),O.index()+1,f)&&e.setNodeMarkup(e.mapping.slice(S).map(l.before()),f)}}n&&Xl(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return y},zk=(n,e={})=>({tr:t,state:s,dispatch:i,editor:r})=>{const o=ve(n,s.schema),{$from:l,$to:c}=s.selection,d=s.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==o)return!1;const p=r.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==o||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){var f;let O=$.empty;const B=l.index(-1)?1:l.index(-2)?2:3;for(let I=l.depth-B;I>=l.depth-3;I-=1)O=$.from(l.node(I).copy(O));const E=l.indexAfter(-1){if(N>-1)return!1;I.isTextblock&&I.content.size===0&&(N=Z+1)}),N>-1&&t.setSelection(U.near(t.doc.resolve(N))),t.scrollIntoView()}return!0}const h=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,g={...Vs(p,u.type.name,u.attrs),...e},b={...Vs(p,l.node().type.name,l.node().attrs),...e},m=l.parentOffset===0&&l.index(-1)===0,y=l.before(-1);t.delete(l.pos,c.pos);const S=m?u.attrs:g,A=h?[{type:o,attrs:S},{type:h,attrs:b}]:[{type:o,attrs:S}];if(!mt(t.doc,l.pos,2))return!1;if(i){const{selection:O,storedMarks:B}=s,{splittableMarks:E}=r.extensionManager,M=B||O.$to.parentOffset&&O.$from.marks();if(t.split(l.pos,2,A).scrollIntoView(),m&&t.setNodeMarkup(y,void 0,g),!M||!i)return!0;const w=M.filter(T=>E.includes(T.type.name));t.ensureMarks(w)}return!0};function _d(n,e,t){if(!n.validContent(e))return null;try{return n.create(t,e)}catch(s){return null}}function So(n,e){if(n.pendingContent.length===0)return!0;const t=_d(e,$.from(n.pendingContent));return t?(n.items.push(t),n.pendingContent=[],!0):!1}function jk(n,e,t){return t.validContent($.from([...e.pendingContent,n]))?(e.pendingContent.push(n),!0):!So(e,t)||!t.validContent($.from(n))?!1:(e.pendingContent.push(n),!0)}function Fk(n,e,t,s){const i=s(n,t);if(!i)return!1;const r=_d(t.listType,$.from(i),n.attrs);return r?t.itemType.validContent($.from([...e.pendingContent,r]))?(e.pendingContent.push(r),!0):So(e,t.itemType)?(e.items.push(...i),!0):!1:!1}function Vk(n,e,t){const s={items:[],pendingContent:[]};for(let i=0;is!==e?!0:(t=i,!1)),t}function Ql(n){return!n||n==="1"?null:n}function jd(n,e){return Ql(n)===Ql(e)}const As=(n,e)=>{const t=Hi(r=>r.type===e)(n.selection);if(!t)return!0;const s=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(s===void 0)return!0;const i=n.doc.nodeAt(s);return!(t.node.type===(i==null?void 0:i.type)&&_t(n.doc,t.pos))||!jd(t.node.attrs.type,i==null?void 0:i.attrs.type)||n.join(t.pos),!0},Os=(n,e)=>{const t=Hi(r=>r.type===e)(n.selection);if(!t)return!0;const s=n.doc.resolve(t.start).after(t.depth);if(s===void 0)return!0;const i=n.doc.nodeAt(s);return!(t.node.type===(i==null?void 0:i.type)&&_t(n.doc,s))||!jd(t.node.attrs.type,i==null?void 0:i.attrs.type)||n.join(s),!0};function Hk(n){const e=n.doc,t=e.firstChild;if(!t)return null;const s=e.resolve(1),i=e.resolve(t.nodeSize-1);return U.between(s,i)}const qk=(n,e,t,s={})=>({editor:i,tr:r,state:o,dispatch:l,chain:c,commands:d,can:u})=>{const{extensions:p,splittableMarks:f}=i.extensionManager,h=ve(n,o.schema),g=ve(e,o.schema),{selection:b,storedMarks:m}=o,{$from:y,$to:S}=b,A=y.blockRange(S),O=m||b.$to.parentOffset&&b.$from.marks();if(!A)return!1;const B=Hi(le=>Rn(le.type.name,p))(b),E=b.from===0&&b.to===o.doc.content.size,M=o.doc.content.content,w=M.length===1?M[0]:null,T=E&&w&&Rn(w.type.name,p)?{node:w,pos:0}:null,N=B!=null?B:T,I=!!B&&A.depth>=1&&A.depth-B.depth<=1,Z=!!T;if((I||Z)&&N){if(N.node.type===h)return E&&Z?c().command(({tr:le,dispatch:ae})=>{const _=Hk(le);return _?(le.setSelection(_),ae&&ae(le),!0):!1}).liftListItem(g).run():d.liftListItem(g);if(Rn(N.node.type.name,p)&&h.validContent(N.node.content))return c().command(()=>(r.setNodeMarkup(N.pos,h),!0)).command(()=>As(r,h)).command(()=>Os(r,h)).run();if(Rn(N.node.type.name,p)){var Oe;const le=(Oe=N.node.firstChild)===null||Oe===void 0?void 0:Oe.type;if(le&&le!==g){const ae=zd(N.node,{listType:h,itemType:g,isListNode:fe=>Rn(fe.type.name,p)}),_=ae?$.from(ae):null;return!_||!h.validContent(_)?!1:c().command(()=>{const{$anchor:fe,$head:rt}=r.selection,vt=fe.parent,F=rt.parent,jt=fe.parentOffset,xs=rt.parentOffset;let Ft;try{Ft=h.create(s,_)}catch(cn){return!1}if(r.replaceWith(N.pos,N.pos+N.node.nodeSize,Ft),vt.inlineContent&&F.inlineContent){const cn=Zl(Ft,vt),te=Zl(Ft,F);if(cn!==null&&te!==null){const ws=N.pos+cn+2+jt,Ou=N.pos+te+2+xs;r.setSelection(U.create(r.doc,ws,Ou))}}return!0}).command(()=>As(r,h)).command(()=>Os(r,h)).run()}}}return!t||!O||!l?c().command(()=>u().wrapInList(h,s)?!0:d.clearNodes()).wrapInList(h,s).command(()=>As(r,h)).command(()=>Os(r,h)).run():c().command(()=>{const le=u().wrapInList(h,s),ae=O.filter(_=>f.includes(_.type.name));return r.ensureMarks(ae),le?!0:d.clearNodes()}).wrapInList(h,s).command(()=>As(r,h)).command(()=>Os(r,h)).run()},Uk=(n,e={},t={})=>({state:s,commands:i})=>{const{extendEmptyMarkRange:r=!1}=t,o=yt(n,s.schema);return zr(s,o,e)?i.unsetMark(o,{extendEmptyMarkRange:r}):i.setMark(o,e)},Wk=(n,e,t={})=>({state:s,commands:i})=>{const r=ve(n,s.schema),o=ve(e,s.schema),l=bt(s,r,t);let c;return s.selection.$anchor.sameParent(s.selection.$head)&&(c=s.selection.$anchor.parent.attrs),l?i.setNode(o,c):i.setNode(r,{...c,...t})},Kk=(n,e={})=>({state:t,commands:s})=>{const i=ve(n,t.schema);return bt(t,i,e)?s.lift(i):s.wrapIn(i,e)},Jk=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let s=0;s=0;c-=1)o.step(l.steps[c].invert(l.docs[c]));if(r.text){const c=o.doc.resolve(r.from).marks();o.replaceWith(r.from,r.to,n.schema.text(r.text,c))}else o.delete(r.from,r.to)}return!0}}return!1},Gk=(n={})=>({tr:e,dispatch:t,editor:s})=>{const{ignoreClearable:i=!1}=n,{selection:r}=e,{empty:o,ranges:l}=r;if(o)return!0;const{nonClearableMarks:c}=s.extensionManager;if(t){const d=Object.values(s.schema.marks).filter(u=>i||!c.includes(u.name));l.forEach(u=>{for(const p of d)e.removeMark(u.$from.pos,u.$to.pos,p)})}return!0},Yk=(n,e={})=>({tr:t,state:s,dispatch:i})=>{const{extendEmptyMarkRange:r=!1}=e,{selection:o}=t,l=yt(n,s.schema),{$from:c,empty:d,ranges:u}=o;if(!i)return!0;if(d&&r){var p;let{from:f,to:h}=o;const g=vo(c,l,(p=c.marks().find(b=>b.type===l))===null||p===void 0?void 0:p.attrs);g&&(f=g.from,h=g.to),t.removeMark(f,h,l)}else u.forEach(f=>{t.removeMark(f.$from.pos,f.$to.pos,l)});return t.removeStoredMark(l),!0},Xk=n=>({tr:e,state:t,dispatch:s})=>{const{selection:i}=t;let r,o;return typeof n=="number"?(r=n,o=n):n&&"from"in n&&"to"in n?(r=n.from,o=n.to):(r=i.from,o=i.to),s&&e.doc.nodesBetween(r,o,(l,c)=>{if(l.isText)return;const d={...l.attrs};delete d.dir,e.setNodeMarkup(c,void 0,d)}),!0},Zk=(n,e={})=>({tr:t,state:s,dispatch:i})=>{let r=null,o=null;const l=Vi(typeof n=="string"?n:n.name,s.schema);if(!l)return!1;l==="node"&&(r=ve(n,s.schema)),l==="mark"&&(o=yt(n,s.schema));let c=!1;return t.selection.ranges.forEach(d=>{const u=d.$from.pos,p=d.$to.pos;let f,h,g,b;t.selection.empty?s.doc.nodesBetween(u,p,(m,y)=>{r&&r===m.type&&(c=!0,g=Math.max(y,u),b=Math.min(y+m.nodeSize,p),f=y,h=m)}):s.doc.nodesBetween(u,p,(m,y)=>{y=u&&y<=p&&(r&&r===m.type&&(c=!0,i&&t.setNodeMarkup(y,void 0,{...m.attrs,...e})),o&&m.marks.length&&m.marks.forEach(S=>{if(o===S.type&&(c=!0,i)){const A=Math.max(y,u),O=Math.min(y+m.nodeSize,p);t.addMark(A,O,o.create({...S.attrs,...e}))}}))}),h&&(f!==void 0&&i&&t.setNodeMarkup(f,void 0,{...h.attrs,...e}),o&&h.marks.length&&h.marks.forEach(m=>{o===m.type&&i&&t.addMark(g,b,o.create({...m.attrs,...e}))}))}),c},bn=new me("__tiptap_decorations__"),Qk=n=>({tr:e,dispatch:t})=>(t&&e.setMeta(bn,{type:"force",name:n}),!0),ex=(n,e={})=>({state:t,dispatch:s})=>{const i=ve(n,t.schema);return ov(i,e)(t,s)},tx=(n,e={})=>({state:t,dispatch:s})=>{const i=ve(n,t.schema);return lv(i,e)(t,s)};var nx=Zb({blur:()=>m1,clearContent:()=>g1,clearNodes:()=>b1,command:()=>y1,createParagraphNear:()=>v1,cut:()=>k1,deleteCurrentNode:()=>x1,deleteNode:()=>w1,deleteRange:()=>S1,deleteSelection:()=>T1,enter:()=>E1,exitCode:()=>A1,extendMarkRange:()=>O1,first:()=>N1,focus:()=>D1,forEach:()=>$1,insertContent:()=>R1,insertContentAt:()=>L1,insertDefaultBlock:()=>P1,joinBackward:()=>z1,joinDown:()=>_1,joinForward:()=>j1,joinItemBackward:()=>F1,joinItemForward:()=>V1,joinTextblockBackward:()=>H1,joinTextblockForward:()=>q1,joinUp:()=>B1,keyboardShortcut:()=>W1,lift:()=>K1,liftEmptyBlock:()=>J1,liftListItem:()=>G1,newlineInCode:()=>Y1,resetAttributes:()=>X1,scrollIntoView:()=>Z1,selectAll:()=>Q1,selectNodeBackward:()=>ek,selectNodeForward:()=>tk,selectParentNode:()=>nk,selectTextblockEnd:()=>sk,selectTextblockStart:()=>ik,setContent:()=>rk,setMark:()=>Ik,setMeta:()=>Dk,setNode:()=>$k,setNodeSelection:()=>Rk,setTextDirection:()=>Lk,setTextSelection:()=>Pk,sinkListItem:()=>Bk,splitBlock:()=>_k,splitListItem:()=>zk,toggleList:()=>qk,toggleMark:()=>Uk,toggleNode:()=>Wk,toggleWrap:()=>Kk,undoInputRule:()=>Jk,unsetAllMarks:()=>Gk,unsetMark:()=>Yk,unsetTextDirection:()=>Xk,updateAttributes:()=>Zk,updateDecorations:()=>Qk,wrapIn:()=>ex,wrapInList:()=>tx});const Ln=new WeakMap;function sx(n,e){var t;Ln.set(n,((t=Ln.get(n))!==null&&t!==void 0?t:0)+1);try{return e()}finally{var s;const i=((s=Ln.get(n))!==null&&s!==void 0?s:1)-1;i>0?Ln.set(n,i):Ln.delete(n)}}var ix=class{constructor(){this.callbacks={}}on(n,e){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(e),this}emit(n,...e){const t=this.callbacks[n];return t&&t.forEach(s=>s.apply(this,e)),this}off(n,e){const t=this.callbacks[n];return t&&(e?this.callbacks[n]=t.filter(s=>s!==e):delete this.callbacks[n]),this}once(n,e){const t=(...s)=>{this.off(n,t),e.apply(this,s)};return this.on(n,t)}removeAllListeners(){this.callbacks={}}};function rx(n){return n.kind==="widget"}function Fd(n,e){const t=[],s=new Set;for(const i of n)i.kind==="widget"&&rx(i)&&s.add(i.key),t.push(i.toPMDecoration(e));return{decorations:t,widgetKeys:s}}function ox(n,e,t){const{decorations:s,widgetKeys:i}=Fd(e,t);return{set:ne.create(n,s),widgetKeys:i}}function Vd({position:n,from:e,to:t,docSize:s}){return nVd({position:o.anchor,from:e,to:t,docSize:s})?!0:(o.anchor===t||r.has(i)||(r.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${e}, ${t}). It was ignored.`)),!1))}function ax(n){var e;const t=(e=n.spec)===null||e===void 0?void 0:e.key;return typeof t=="string"?t:void 0}function Hd(n){return n.jsonID==="attr"}function cx(n){let e=!1;if(n.getMap().forEach(()=>{e=!0}),e||Hd(n))return!0;const t=n;return typeof t.from=="number"&&typeof t.to=="number"}function dx(n,e){let t=null,s=0,i=0;for(let r=0;re.to);r+=1){const o=i+n.child(r).nodeSize;o>=e.from&&(t===null&&(t=i),s=o),i=o}return t===null?null:{from:t,to:s}}function ux(n,e){if(n.steps.some(r=>!cx(r)))return{type:"full"};const t=qi(n).map(({newRange:r})=>r);n.steps.forEach((r,o)=>{if(!Hd(r))return;const l=n.mapping.slice(o);t.push({from:l.map(r.pos,-1),to:l.map(r.pos+1)})});const s=[];for(const r of t){const o=dx(e,r);o&&s.push(o)}s.sort((r,o)=>r.from-o.from);const i=[];for(const r of s){const o=i[i.length-1];o&&r.from<=o.to?o.to=Math.max(o.to,r.to):i.push({...r})}return{type:"ranges",ranges:i}}function qd(n,e,t,s){return n.map(e,t,{onRemove:i=>{const r=i==null?void 0:i.key;typeof r=="string"&&s.delete(r)}})}function px(n,e,t){var s,i;const r=(s=e.decorationSetsByExtension[n])!==null&&s!==void 0?s:ne.empty,o=new Set((i=e.widgetKeysByExtension[n])!==null&&i!==void 0?i:[]);return{set:qd(r,t.mapping,t.doc,o),widgetKeys:o}}function ea(n,e){const t=Object.values(e).flatMap(s=>s.find());return ne.create(n,t)}function ta(n){const e=new Set;for(const t of Object.values(n))for(const s of t)e.add(s);return e}function fx(n,e){var t;switch((t=e.update)!==null&&t!==void 0?t:"document"){case"document":if(e.createInRange)throw new Error(`[tiptap error]: Extension "${n}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!e.createInRange)throw new Error(`[tiptap error]: Extension "${n}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(e.createInRange)throw new Error(`[tiptap error]: Extension "${n}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(e.shouldUpdate)throw new Error(`[tiptap error]: Extension "${n}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw new Error(`[tiptap error]: Extension "${n}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function hx(n,e,t){return t?!0:n.update==="manual"?!1:n.shouldUpdate?n.shouldUpdate(e):e.tr.docChanged}const mx=new Set;var gx=class{constructor(n){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{const t=bn.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=n.editor,this.entries=this.resolveEntries(n.entries),this.entries.forEach(({name:e,spec:t})=>fx(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){var n,e;return(n=(e=bn.getState(this.editor.state))===null||e===void 0?void 0:e.widgetKeys)!==null&&n!==void 0?n:mx}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(n){const e=[];for(const{name:t,addDecorations:s}of n){const i=s();i&&e.push({name:t,spec:i})}return e}createPlugin(){const{editor:n,entries:e}=this;return new oe({key:bn,state:{init:(t,s)=>{const i={},r={};for(const{name:l,spec:c}of e){const{set:d,widgetKeys:u}=this.buildFullSet(l,c,s);i[l]=d,r[l]=u}const o={decorationSetsByExtension:i,widgetKeysByExtension:r,mergedDecorationSet:this.buildMergedSet(s.doc,i),widgetKeys:ta(r)};return this.warnDuplicateWidgetKeys(o),o},apply:(t,s,i,r)=>{const o=t.getMeta(bn),l=(o==null?void 0:o.type)==="force"&&!o.name,c=(o==null?void 0:o.type)==="force"?o.name:void 0,d={},u={},p=new Set;return sx(n,()=>{for(const{name:f,spec:h}of e){const g=l||c===f;if(hx(h,{editor:n,tr:t,oldState:i,newState:r},g))if(h.update==="changedRanges"&&t.docChanged&&!g){const b=this.applyChangedRangesRecompute(f,h,s,t,r);d[f]=b.set,u[f]=b.widgetKeys,p.add(f)}else{const{set:b,widgetKeys:m}=this.buildFullSet(f,h,r);d[f]=b,u[f]=m,p.add(f)}else{const b=px(f,s,t);d[f]=b.set,u[f]=b.widgetKeys}}}),p.size===0&&!t.docChanged?s:{decorationSetsByExtension:d,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:e,previous:s,tr:t,decorationSetsByExtension:d,recomputedNames:p}),widgetKeys:ta(u)}}},props:{decorations(t){var s,i;return(s=(i=bn.getState(t))===null||i===void 0?void 0:i.mergedDecorationSet)!==null&&s!==void 0?s:ne.empty}}})}applyChangedRangesRecompute(n,e,t,s,i){const r=ux(s,i.doc);return r.type==="full"?this.buildFullSet(n,e,i):this.rebuildRanges(n,e,t,s,i,r.ranges)}rebuildRanges(n,e,t,s,i,r){var o,l;const c=(o=t.decorationSetsByExtension[n])!==null&&o!==void 0?o:ne.empty,d=new Set((l=t.widgetKeysByExtension[n])!==null&&l!==void 0?l:[]);let u=qd(c,s.mapping,s.doc,d);const p=i.doc.content.size;for(const{from:f,to:h}of r){const g=u.find(f,h).filter(y=>Vd({position:y.from,from:f,to:h,docSize:p}));for(const y of g){const S=ax(y);S&&d.delete(S)}u=u.remove(g);const{decorations:b,widgetKeys:m}=Fd(lx({decorations:this.runCreate(n,"createInRange",()=>e.createInRange({editor:this.editor,state:i,view:this.mountedView,from:f,to:h})),from:f,to:h,docSize:p,extensionName:n,warnedExtensions:this.warnedOutOfRangeExtensions}),n);u=u.add(i.doc,b);for(const y of m)d.add(y)}return{set:u,widgetKeys:d}}buildFullSet(n,e,t){const s=this.runCreate(n,"create",()=>e.create({editor:this.editor,state:t,view:this.mountedView}));return ox(t.doc,s,n)}runCreate(n,e,t){try{return t()}catch(s){return console.error(`[tiptap error]: Extension "${n}" threw in \`addDecorations().${e}()\`. Its decorations were dropped for this update.`,s),[]}}warnDuplicateWidgetKeys(n){}buildMergedSet(n,e){const t=Object.keys(e);return t.length===1?e[t[0]]:ea(n,e)}mergeAfterApply({entries:n,previous:e,tr:t,decorationSetsByExtension:s,recomputedNames:i}){return n.length===1?s[n[0].name]:i.size===0?e.mergedDecorationSet.map(t.mapping,t.doc):ea(t.doc,s)}};function bx(n,e){const{selection:t}=n,{$from:s}=t;if(t instanceof W){const r=s.index();return s.parent.canReplaceWith(r,r+1,e)}let i=s.depth;for(;i>=0;){const r=s.index(i);if(s.node(i).contentMatchAt(r).matchType(e))return!0;i-=1}return!1}function yx(n,e,t){const s=document.querySelector("style[data-tiptap-style]");if(s!==null)return s;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(i),i}function vx(n){return typeof n=="number"}function kx(n){return Object.prototype.toString.call(n).slice(8,-1)}function Ns(n){return kx(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function na(n,e,t){const s=n.split(` +`,textSerializers:o={}}=t||{};let l="";return n.nodesBetween(s,i,(c,d,u,p)=>{c.isBlock&&d>s&&(l+=r);const f=o==null?void 0:o[c.type.name];if(f)return u&&(l+=f({node:c,pos:d,parent:u,index:p,range:e})),!1;if(c.isText){var h;l+=c==null||(h=c.text)===null||h===void 0?void 0:h.slice(Math.max(s,d)-d,i-d)}}),l}function bk(n,e){return Dd(n,{from:0,to:n.content.size},e)}function $d(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function vk(n,e){const t=ye(e,n.schema),{from:s,to:i}=n.selection,r=[];n.doc.nodesBetween(s,i,l=>{r.push(l)});const o=r.reverse().find(l=>l.type.name===t.name);return o?{...o.attrs}:{}}function Rd(n,e){const t=Vi(typeof e=="string"?e:e.name,n.schema);return t==="node"?vk(n,e):t==="mark"?Ed(n,e):{}}function yk(n,e=JSON.stringify){const t={};return n.filter(s=>{const i=e(s);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function kk(n){const e=yk(n);return e.length===1?e:e.filter((t,s)=>!e.filter((i,r)=>r!==s).some(i=>t.oldRange.from>=i.oldRange.from&&t.oldRange.to<=i.oldRange.to&&t.newRange.from>=i.newRange.from&&t.newRange.to<=i.newRange.to))}function qi(n){const{mapping:e,steps:t}=n,s=[];return e.maps.forEach((i,r)=>{const o=[];if(i.ranges.length)i.forEach((l,c)=>{o.push({from:l,to:c})});else{const{from:l,to:c}=t[r];if(l===void 0||c===void 0)return;o.push({from:l,to:c})}o.forEach(({from:l,to:c})=>{const d=e.slice(r).map(l,-1),u=e.slice(r).map(c),p=e.invert().map(d,-1),f=e.invert().map(u);s.push({oldRange:{from:p,to:f},newRange:{from:d,to:u}})})}),kk(s)}function Ui(n,e,t){const s=[];return n===e?t.resolve(n).marks().forEach(i=>{const r=yo(t.resolve(n),i.type);r&&s.push({mark:i,...r})}):t.nodesBetween(n,e,(i,r)=>{!i||(i==null?void 0:i.nodeSize)===void 0||s.push(...i.marks.map(o=>({from:r,to:r+i.nodeSize,mark:o})))}),s}const xk=(n,e,t,s=20)=>{const i=n.doc.resolve(t);let r=s,o=null;for(;r>0&&o===null;){const l=i.node(r);(l==null?void 0:l.type.name)===e?o=l:r-=1}return[o,r]},wk=n=>{const e=n.depth-1;if(e<0)return null;const t=n.index(e);return t===0?null:n.node(e).child(t-1)};function fn(n,e){return e.nodes[n]||e.marks[n]||null}function Vs(n,e,t){return Object.fromEntries(Object.entries(t).filter(([s])=>{const i=n.find(r=>r.type===e&&r.name===s);return i?i.attribute.keepOnSplit:!1}))}const Sk=(n,e=500)=>{let t="";const s=n.parentOffset;return n.parent.nodesBetween(Math.max(0,s-e),s,(i,r,o,l)=>{var c,d;const u=((c=(d=i.type.spec).toText)===null||c===void 0?void 0:c.call(d,{node:i,pos:r,parent:o,index:l}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,s-r))}),t};function zr(n,e,t={}){const{empty:s,ranges:i}=n.selection,r=e?vt(e,n.schema):null;if(s)return!!(n.storedMarks||n.selection.$from.marks()).filter(u=>r?r.name===u.type.name:!0).find(u=>ti(u.attrs,t,{strict:!1}));let o=0;const l=[];if(i.forEach(({$from:u,$to:p})=>{const f=u.pos,h=p.pos;n.doc.nodesBetween(f,h,(g,b)=>{if(r&&g.inlineContent&&!g.type.allowsMarkType(r))return!1;if(!g.isText&&!g.marks.length)return;const m=Math.max(f,b),v=Math.min(h,b+g.nodeSize),S=v-m;o+=S,l.push(...g.marks.map(A=>({mark:A,from:m,to:v})))})}),o===0)return!1;const c=l.filter(u=>r?r.name===u.mark.type.name:!0).filter(u=>ti(u.mark.attrs,t,{strict:!1})).reduce((u,p)=>u+p.to-p.from,0),d=l.filter(u=>r?u.mark.type!==r&&u.mark.type.excludes(r):!0).reduce((u,p)=>u+p.to-p.from,0);return(c>0?c+d:c)>=o}function Ck(n,e,t={}){if(!e)return bt(n,null,t)||zr(n,null,t);const s=Vi(e,n.schema);return s==="node"?bt(n,e,t):s==="mark"?zr(n,e,t):!1}const Mk=(n,e)=>{const{$from:t,$to:s,$anchor:i}=n.selection;if(e){const r=Hi(l=>l.type.name===e)(n.selection);if(!r)return!1;const o=n.doc.resolve(r.pos+1);return i.pos+1===o.end()}return!(s.parentOffset{const{$from:e,$to:t}=n.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function Yl(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function Ln(n,e){const{nodeExtensions:t}=An(e),s=t.find(r=>r.name===n);if(!s)return!1;const i=se(V(s,"group",{name:s.name,options:s.options,storage:s.storage}));return typeof i!="string"?!1:i.split(" ").includes("list")}function ys(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){if(t){if(n.type.name==="hardBreak")return!0;if(n.isText){var s;return!/\S/.test((s=n.text)!==null&&s!==void 0?s:"")}}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let i=!0;return n.content.forEach(r=>{i!==!1&&(ys(r,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function Ld(n){return n instanceof W}function Ek(n){if(n===null||typeof n!="object")return!1;const e=n;return!(typeof e.apply!="function"||typeof e.getMap!="function"||typeof e.invert!="function"||typeof e.map!="function"||typeof e.merge!="function"||typeof e.toJSON!="function")}function Ak(n){if(n===null||typeof n!="object")return!1;const e=n;if(!Ek(e))return!1;const t=e.toJSON();return!(t===null||typeof t!="object"||t.stepType!=="replace")}var Pd=class Bd{constructor(e){this.position=e}static fromJSON(e){return new Bd(e.position)}toJSON(){return{position:this.position}}};function Ok(n,e){const t=e.mapping.mapResult(n.position);return{position:new Pd(t.pos),mapResult:t}}function Nk(n){return new Pd(n)}function Ik(n,e,t){const{selection:s}=e;let i=null;if(yd(s)&&(i=s.$cursor),i){var r;const l=(r=n.storedMarks)!==null&&r!==void 0?r:i.marks();return i.parent.type.allowsMarkType(t)&&(!!t.isInSet(l)||!l.some(c=>c.type.excludes(t)))}const{ranges:o}=s;return o.some(({$from:l,$to:c})=>{let d=l.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(l.pos,c.pos,(u,p,f)=>{if(d)return!1;if(u.isInline){const h=!f||f.type.allowsMarkType(t),g=!!t.isInSet(u.marks)||!u.marks.some(b=>b.type.excludes(t));d=h&&g}return!d}),d})}const Dk=(n,e={})=>({tr:t,state:s,dispatch:i})=>{const{selection:r}=t,{empty:o,ranges:l}=r,c=vt(n,s.schema);if(i)if(o){const d=Ed(s,c);t.addStoredMark(c.create({...d,...e}))}else l.forEach(d=>{const u=d.$from.pos,p=d.$to.pos;s.doc.nodesBetween(u,p,(f,h)=>{const g=Math.max(h,u),b=Math.min(h+f.nodeSize,p);f.marks.find(m=>m.type===c)?f.marks.forEach(m=>{c===m.type&&t.addMark(g,b,c.create({...m.attrs,...e}))}):t.addMark(g,b,c.create(e))})});return Ik(s,t,c)},$k=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),Rk=(n,e={})=>({state:t,dispatch:s,chain:i})=>{const r=ye(n,t.schema);let o;return t.selection.$anchor.sameParent(t.selection.$head)&&(o=t.selection.$anchor.parent.attrs),r.isTextblock?i().command(({commands:l})=>ol(r,{...o,...e})(t)?!0:l.clearNodes()).command(({state:l})=>ol(r,{...o,...e})(l,s)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Lk=n=>({tr:e,dispatch:t})=>{if(t){const{doc:s}=e,i=Kt(n,0,s.content.size),r=W.create(s,i);e.setSelection(r)}return!0},Pk=(n,e)=>({tr:t,state:s,dispatch:i})=>{const{selection:r}=s;let o,l;return typeof e=="number"?(o=e,l=e):e&&"from"in e&&"to"in e?(o=e.from,l=e.to):(o=r.from,l=r.to),i&&t.doc.nodesBetween(o,l,(c,d)=>{c.isText||t.setNodeMarkup(d,void 0,{...c.attrs,dir:n})}),!0},Bk=n=>({tr:e,dispatch:t})=>{if(t){const{doc:s}=e,{from:i,to:r}=typeof n=="number"?{from:n,to:n}:n,o=U.atStart(s).from,l=U.atEnd(s).to,c=Kt(i,o,l),d=Kt(r,o,l),u=U.create(s,c,d);e.setSelection(u)}return!0},_k=n=>({state:e,dispatch:t})=>{const s=ye(n,e.schema);return hy(s)(e,t)};function Xl(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const s=t.filter(i=>e==null?void 0:e.includes(i.type.name));n.tr.ensureMarks(s)}}const zk=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:s,editor:i})=>{const{selection:r,doc:o}=e,{$from:l,$to:c}=r,d=i.extensionManager.attributes,u=Vs(d,l.node().type.name,l.node().attrs);if(r instanceof W&&r.node.isBlock)return!l.parentOffset||!mt(o,l.pos)?!1:(s&&(n&&Xl(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const p=c.parentOffset===c.parent.content.size,f=l.depth===0?void 0:Cd(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=p&&f?[{type:f,attrs:u}]:void 0;const g=r instanceof U&&!r.empty?pt.create({doc:e.doc,selection:r}).tr.deleteSelection():null,b=g?g.doc:e.doc,m=g?g.mapping.map(l.pos):l.pos;let v=mt(b,m,1,h);if(!h&&!v&&mt(b,m,1,f?[{type:f}]:void 0)&&(v=!0,h=f?[{type:f,attrs:u}]:void 0),s){if(v){const S=e.steps.length;if(r instanceof U&&e.deleteSelection(),e.split(e.mapping.slice(S).map(l.pos),1,h),f&&!p&&!l.parentOffset&&l.parent.type!==f){const A=e.mapping.slice(S).map(l.before()),O=e.doc.resolve(A);l.node(-1).canReplaceWith(O.index(),O.index()+1,f)&&e.setNodeMarkup(e.mapping.slice(S).map(l.before()),f)}}n&&Xl(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return v},jk=(n,e={})=>({tr:t,state:s,dispatch:i,editor:r})=>{const o=ye(n,s.schema),{$from:l,$to:c}=s.selection,d=s.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==o)return!1;const p=r.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==o||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){var f;let O=$.empty;const B=l.index(-1)?1:l.index(-2)?2:3;for(let I=l.depth-B;I>=l.depth-3;I-=1)O=$.from(l.node(I).copy(O));const E=l.indexAfter(-1){if(N>-1)return!1;I.isTextblock&&I.content.size===0&&(N=Z+1)}),N>-1&&t.setSelection(U.near(t.doc.resolve(N))),t.scrollIntoView()}return!0}const h=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,g={...Vs(p,u.type.name,u.attrs),...e},b={...Vs(p,l.node().type.name,l.node().attrs),...e},m=l.parentOffset===0&&l.index(-1)===0,v=l.before(-1);t.delete(l.pos,c.pos);const S=m?u.attrs:g,A=h?[{type:o,attrs:S},{type:h,attrs:b}]:[{type:o,attrs:S}];if(!mt(t.doc,l.pos,2))return!1;if(i){const{selection:O,storedMarks:B}=s,{splittableMarks:E}=r.extensionManager,M=B||O.$to.parentOffset&&O.$from.marks();if(t.split(l.pos,2,A).scrollIntoView(),m&&t.setNodeMarkup(v,void 0,g),!M||!i)return!0;const w=M.filter(T=>E.includes(T.type.name));t.ensureMarks(w)}return!0};function _d(n,e,t){if(!n.validContent(e))return null;try{return n.create(t,e)}catch(s){return null}}function So(n,e){if(n.pendingContent.length===0)return!0;const t=_d(e,$.from(n.pendingContent));return t?(n.items.push(t),n.pendingContent=[],!0):!1}function Fk(n,e,t){return t.validContent($.from([...e.pendingContent,n]))?(e.pendingContent.push(n),!0):!So(e,t)||!t.validContent($.from(n))?!1:(e.pendingContent.push(n),!0)}function Vk(n,e,t,s){const i=s(n,t);if(!i)return!1;const r=_d(t.listType,$.from(i),n.attrs);return r?t.itemType.validContent($.from([...e.pendingContent,r]))?(e.pendingContent.push(r),!0):So(e,t.itemType)?(e.items.push(...i),!0):!1:!1}function Hk(n,e,t){const s={items:[],pendingContent:[]};for(let i=0;is!==e?!0:(t=i,!1)),t}function Ql(n){return!n||n==="1"?null:n}function jd(n,e){return Ql(n)===Ql(e)}const As=(n,e)=>{const t=Hi(r=>r.type===e)(n.selection);if(!t)return!0;const s=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(s===void 0)return!0;const i=n.doc.nodeAt(s);return!(t.node.type===(i==null?void 0:i.type)&&_t(n.doc,t.pos))||!jd(t.node.attrs.type,i==null?void 0:i.attrs.type)||n.join(t.pos),!0},Os=(n,e)=>{const t=Hi(r=>r.type===e)(n.selection);if(!t)return!0;const s=n.doc.resolve(t.start).after(t.depth);if(s===void 0)return!0;const i=n.doc.nodeAt(s);return!(t.node.type===(i==null?void 0:i.type)&&_t(n.doc,s))||!jd(t.node.attrs.type,i==null?void 0:i.attrs.type)||n.join(s),!0};function qk(n){const e=n.doc,t=e.firstChild;if(!t)return null;const s=e.resolve(1),i=e.resolve(t.nodeSize-1);return U.between(s,i)}const Uk=(n,e,t,s={})=>({editor:i,tr:r,state:o,dispatch:l,chain:c,commands:d,can:u})=>{const{extensions:p,splittableMarks:f}=i.extensionManager,h=ye(n,o.schema),g=ye(e,o.schema),{selection:b,storedMarks:m}=o,{$from:v,$to:S}=b,A=v.blockRange(S),O=m||b.$to.parentOffset&&b.$from.marks();if(!A)return!1;const B=Hi(le=>Ln(le.type.name,p))(b),E=b.from===0&&b.to===o.doc.content.size,M=o.doc.content.content,w=M.length===1?M[0]:null,T=E&&w&&Ln(w.type.name,p)?{node:w,pos:0}:null,N=B!=null?B:T,I=!!B&&A.depth>=1&&A.depth-B.depth<=1,Z=!!T;if((I||Z)&&N){if(N.node.type===h)return E&&Z?c().command(({tr:le,dispatch:ae})=>{const _=qk(le);return _?(le.setSelection(_),ae&&ae(le),!0):!1}).liftListItem(g).run():d.liftListItem(g);if(Ln(N.node.type.name,p)&&h.validContent(N.node.content))return c().command(()=>(r.setNodeMarkup(N.pos,h),!0)).command(()=>As(r,h)).command(()=>Os(r,h)).run();if(Ln(N.node.type.name,p)){var Oe;const le=(Oe=N.node.firstChild)===null||Oe===void 0?void 0:Oe.type;if(le&&le!==g){const ae=zd(N.node,{listType:h,itemType:g,isListNode:fe=>Ln(fe.type.name,p)}),_=ae?$.from(ae):null;return!_||!h.validContent(_)?!1:c().command(()=>{const{$anchor:fe,$head:rt}=r.selection,yt=fe.parent,F=rt.parent,jt=fe.parentOffset,xs=rt.parentOffset;let Ft;try{Ft=h.create(s,_)}catch(cn){return!1}if(r.replaceWith(N.pos,N.pos+N.node.nodeSize,Ft),yt.inlineContent&&F.inlineContent){const cn=Zl(Ft,yt),te=Zl(Ft,F);if(cn!==null&&te!==null){const ws=N.pos+cn+2+jt,Ou=N.pos+te+2+xs;r.setSelection(U.create(r.doc,ws,Ou))}}return!0}).command(()=>As(r,h)).command(()=>Os(r,h)).run()}}}return!t||!O||!l?c().command(()=>u().wrapInList(h,s)?!0:d.clearNodes()).wrapInList(h,s).command(()=>As(r,h)).command(()=>Os(r,h)).run():c().command(()=>{const le=u().wrapInList(h,s),ae=O.filter(_=>f.includes(_.type.name));return r.ensureMarks(ae),le?!0:d.clearNodes()}).wrapInList(h,s).command(()=>As(r,h)).command(()=>Os(r,h)).run()},Wk=(n,e={},t={})=>({state:s,commands:i})=>{const{extendEmptyMarkRange:r=!1}=t,o=vt(n,s.schema);return zr(s,o,e)?i.unsetMark(o,{extendEmptyMarkRange:r}):i.setMark(o,e)},Kk=(n,e,t={})=>({state:s,commands:i})=>{const r=ye(n,s.schema),o=ye(e,s.schema),l=bt(s,r,t);let c;return s.selection.$anchor.sameParent(s.selection.$head)&&(c=s.selection.$anchor.parent.attrs),l?i.setNode(o,c):i.setNode(r,{...c,...t})},Jk=(n,e={})=>({state:t,commands:s})=>{const i=ye(n,t.schema);return bt(t,i,e)?s.lift(i):s.wrapIn(i,e)},Gk=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let s=0;s=0;c-=1)o.step(l.steps[c].invert(l.docs[c]));if(r.text){const c=o.doc.resolve(r.from).marks();o.replaceWith(r.from,r.to,n.schema.text(r.text,c))}else o.delete(r.from,r.to)}return!0}}return!1},Yk=(n={})=>({tr:e,dispatch:t,editor:s})=>{const{ignoreClearable:i=!1}=n,{selection:r}=e,{empty:o,ranges:l}=r;if(o)return!0;const{nonClearableMarks:c}=s.extensionManager;if(t){const d=Object.values(s.schema.marks).filter(u=>i||!c.includes(u.name));l.forEach(u=>{for(const p of d)e.removeMark(u.$from.pos,u.$to.pos,p)})}return!0},Xk=(n,e={})=>({tr:t,state:s,dispatch:i})=>{const{extendEmptyMarkRange:r=!1}=e,{selection:o}=t,l=vt(n,s.schema),{$from:c,empty:d,ranges:u}=o;if(!i)return!0;if(d&&r){var p;let{from:f,to:h}=o;const g=yo(c,l,(p=c.marks().find(b=>b.type===l))===null||p===void 0?void 0:p.attrs);g&&(f=g.from,h=g.to),t.removeMark(f,h,l)}else u.forEach(f=>{t.removeMark(f.$from.pos,f.$to.pos,l)});return t.removeStoredMark(l),!0},Zk=n=>({tr:e,state:t,dispatch:s})=>{const{selection:i}=t;let r,o;return typeof n=="number"?(r=n,o=n):n&&"from"in n&&"to"in n?(r=n.from,o=n.to):(r=i.from,o=i.to),s&&e.doc.nodesBetween(r,o,(l,c)=>{if(l.isText)return;const d={...l.attrs};delete d.dir,e.setNodeMarkup(c,void 0,d)}),!0},Qk=(n,e={})=>({tr:t,state:s,dispatch:i})=>{let r=null,o=null;const l=Vi(typeof n=="string"?n:n.name,s.schema);if(!l)return!1;l==="node"&&(r=ye(n,s.schema)),l==="mark"&&(o=vt(n,s.schema));let c=!1;return t.selection.ranges.forEach(d=>{const u=d.$from.pos,p=d.$to.pos;let f,h,g,b;t.selection.empty?s.doc.nodesBetween(u,p,(m,v)=>{r&&r===m.type&&(c=!0,g=Math.max(v,u),b=Math.min(v+m.nodeSize,p),f=v,h=m)}):s.doc.nodesBetween(u,p,(m,v)=>{v=u&&v<=p&&(r&&r===m.type&&(c=!0,i&&t.setNodeMarkup(v,void 0,{...m.attrs,...e})),o&&m.marks.length&&m.marks.forEach(S=>{if(o===S.type&&(c=!0,i)){const A=Math.max(v,u),O=Math.min(v+m.nodeSize,p);t.addMark(A,O,o.create({...S.attrs,...e}))}}))}),h&&(f!==void 0&&i&&t.setNodeMarkup(f,void 0,{...h.attrs,...e}),o&&h.marks.length&&h.marks.forEach(m=>{o===m.type&&i&&t.addMark(g,b,o.create({...m.attrs,...e}))}))}),c},bn=new me("__tiptap_decorations__"),ex=n=>({tr:e,dispatch:t})=>(t&&e.setMeta(bn,{type:"force",name:n}),!0),tx=(n,e={})=>({state:t,dispatch:s})=>{const i=ye(n,t.schema);return ly(i,e)(t,s)},nx=(n,e={})=>({state:t,dispatch:s})=>{const i=ye(n,t.schema);return ay(i,e)(t,s)};var sx=Qb({blur:()=>g1,clearContent:()=>b1,clearNodes:()=>v1,command:()=>y1,createParagraphNear:()=>k1,cut:()=>x1,deleteCurrentNode:()=>w1,deleteNode:()=>S1,deleteRange:()=>C1,deleteSelection:()=>E1,enter:()=>A1,exitCode:()=>O1,extendMarkRange:()=>N1,first:()=>I1,focus:()=>$1,forEach:()=>R1,insertContent:()=>L1,insertContentAt:()=>P1,insertDefaultBlock:()=>B1,joinBackward:()=>j1,joinDown:()=>z1,joinForward:()=>F1,joinItemBackward:()=>V1,joinItemForward:()=>H1,joinTextblockBackward:()=>q1,joinTextblockForward:()=>U1,joinUp:()=>_1,keyboardShortcut:()=>K1,lift:()=>J1,liftEmptyBlock:()=>G1,liftListItem:()=>Y1,newlineInCode:()=>X1,resetAttributes:()=>Z1,scrollIntoView:()=>Q1,selectAll:()=>ek,selectNodeBackward:()=>tk,selectNodeForward:()=>nk,selectParentNode:()=>sk,selectTextblockEnd:()=>ik,selectTextblockStart:()=>rk,setContent:()=>ok,setMark:()=>Dk,setMeta:()=>$k,setNode:()=>Rk,setNodeSelection:()=>Lk,setTextDirection:()=>Pk,setTextSelection:()=>Bk,sinkListItem:()=>_k,splitBlock:()=>zk,splitListItem:()=>jk,toggleList:()=>Uk,toggleMark:()=>Wk,toggleNode:()=>Kk,toggleWrap:()=>Jk,undoInputRule:()=>Gk,unsetAllMarks:()=>Yk,unsetMark:()=>Xk,unsetTextDirection:()=>Zk,updateAttributes:()=>Qk,updateDecorations:()=>ex,wrapIn:()=>tx,wrapInList:()=>nx});const Pn=new WeakMap;function ix(n,e){var t;Pn.set(n,((t=Pn.get(n))!==null&&t!==void 0?t:0)+1);try{return e()}finally{var s;const i=((s=Pn.get(n))!==null&&s!==void 0?s:1)-1;i>0?Pn.set(n,i):Pn.delete(n)}}var rx=class{constructor(){this.callbacks={}}on(n,e){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(e),this}emit(n,...e){const t=this.callbacks[n];return t&&t.forEach(s=>s.apply(this,e)),this}off(n,e){const t=this.callbacks[n];return t&&(e?this.callbacks[n]=t.filter(s=>s!==e):delete this.callbacks[n]),this}once(n,e){const t=(...s)=>{this.off(n,t),e.apply(this,s)};return this.on(n,t)}removeAllListeners(){this.callbacks={}}};function ox(n){return n.kind==="widget"}function Fd(n,e){const t=[],s=new Set;for(const i of n)i.kind==="widget"&&ox(i)&&s.add(i.key),t.push(i.toPMDecoration(e));return{decorations:t,widgetKeys:s}}function lx(n,e,t){const{decorations:s,widgetKeys:i}=Fd(e,t);return{set:ne.create(n,s),widgetKeys:i}}function Vd({position:n,from:e,to:t,docSize:s}){return nVd({position:o.anchor,from:e,to:t,docSize:s})?!0:(o.anchor===t||r.has(i)||(r.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${e}, ${t}). It was ignored.`)),!1))}function cx(n){var e;const t=(e=n.spec)===null||e===void 0?void 0:e.key;return typeof t=="string"?t:void 0}function Hd(n){return n.jsonID==="attr"}function dx(n){let e=!1;if(n.getMap().forEach(()=>{e=!0}),e||Hd(n))return!0;const t=n;return typeof t.from=="number"&&typeof t.to=="number"}function ux(n,e){let t=null,s=0,i=0;for(let r=0;re.to);r+=1){const o=i+n.child(r).nodeSize;o>=e.from&&(t===null&&(t=i),s=o),i=o}return t===null?null:{from:t,to:s}}function px(n,e){if(n.steps.some(r=>!dx(r)))return{type:"full"};const t=qi(n).map(({newRange:r})=>r);n.steps.forEach((r,o)=>{if(!Hd(r))return;const l=n.mapping.slice(o);t.push({from:l.map(r.pos,-1),to:l.map(r.pos+1)})});const s=[];for(const r of t){const o=ux(e,r);o&&s.push(o)}s.sort((r,o)=>r.from-o.from);const i=[];for(const r of s){const o=i[i.length-1];o&&r.from<=o.to?o.to=Math.max(o.to,r.to):i.push({...r})}return{type:"ranges",ranges:i}}function qd(n,e,t,s){return n.map(e,t,{onRemove:i=>{const r=i==null?void 0:i.key;typeof r=="string"&&s.delete(r)}})}function fx(n,e,t){var s,i;const r=(s=e.decorationSetsByExtension[n])!==null&&s!==void 0?s:ne.empty,o=new Set((i=e.widgetKeysByExtension[n])!==null&&i!==void 0?i:[]);return{set:qd(r,t.mapping,t.doc,o),widgetKeys:o}}function ea(n,e){const t=Object.values(e).flatMap(s=>s.find());return ne.create(n,t)}function ta(n){const e=new Set;for(const t of Object.values(n))for(const s of t)e.add(s);return e}function hx(n,e){var t;switch((t=e.update)!==null&&t!==void 0?t:"document"){case"document":if(e.createInRange)throw new Error(`[tiptap error]: Extension "${n}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!e.createInRange)throw new Error(`[tiptap error]: Extension "${n}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(e.createInRange)throw new Error(`[tiptap error]: Extension "${n}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(e.shouldUpdate)throw new Error(`[tiptap error]: Extension "${n}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw new Error(`[tiptap error]: Extension "${n}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function mx(n,e,t){return t?!0:n.update==="manual"?!1:n.shouldUpdate?n.shouldUpdate(e):e.tr.docChanged}const gx=new Set;var bx=class{constructor(n){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{const t=bn.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=n.editor,this.entries=this.resolveEntries(n.entries),this.entries.forEach(({name:e,spec:t})=>hx(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){var n,e;return(n=(e=bn.getState(this.editor.state))===null||e===void 0?void 0:e.widgetKeys)!==null&&n!==void 0?n:gx}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(n){const e=[];for(const{name:t,addDecorations:s}of n){const i=s();i&&e.push({name:t,spec:i})}return e}createPlugin(){const{editor:n,entries:e}=this;return new oe({key:bn,state:{init:(t,s)=>{const i={},r={};for(const{name:l,spec:c}of e){const{set:d,widgetKeys:u}=this.buildFullSet(l,c,s);i[l]=d,r[l]=u}const o={decorationSetsByExtension:i,widgetKeysByExtension:r,mergedDecorationSet:this.buildMergedSet(s.doc,i),widgetKeys:ta(r)};return this.warnDuplicateWidgetKeys(o),o},apply:(t,s,i,r)=>{const o=t.getMeta(bn),l=(o==null?void 0:o.type)==="force"&&!o.name,c=(o==null?void 0:o.type)==="force"?o.name:void 0,d={},u={},p=new Set;return ix(n,()=>{for(const{name:f,spec:h}of e){const g=l||c===f;if(mx(h,{editor:n,tr:t,oldState:i,newState:r},g))if(h.update==="changedRanges"&&t.docChanged&&!g){const b=this.applyChangedRangesRecompute(f,h,s,t,r);d[f]=b.set,u[f]=b.widgetKeys,p.add(f)}else{const{set:b,widgetKeys:m}=this.buildFullSet(f,h,r);d[f]=b,u[f]=m,p.add(f)}else{const b=fx(f,s,t);d[f]=b.set,u[f]=b.widgetKeys}}}),p.size===0&&!t.docChanged?s:{decorationSetsByExtension:d,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:e,previous:s,tr:t,decorationSetsByExtension:d,recomputedNames:p}),widgetKeys:ta(u)}}},props:{decorations(t){var s,i;return(s=(i=bn.getState(t))===null||i===void 0?void 0:i.mergedDecorationSet)!==null&&s!==void 0?s:ne.empty}}})}applyChangedRangesRecompute(n,e,t,s,i){const r=px(s,i.doc);return r.type==="full"?this.buildFullSet(n,e,i):this.rebuildRanges(n,e,t,s,i,r.ranges)}rebuildRanges(n,e,t,s,i,r){var o,l;const c=(o=t.decorationSetsByExtension[n])!==null&&o!==void 0?o:ne.empty,d=new Set((l=t.widgetKeysByExtension[n])!==null&&l!==void 0?l:[]);let u=qd(c,s.mapping,s.doc,d);const p=i.doc.content.size;for(const{from:f,to:h}of r){const g=u.find(f,h).filter(v=>Vd({position:v.from,from:f,to:h,docSize:p}));for(const v of g){const S=cx(v);S&&d.delete(S)}u=u.remove(g);const{decorations:b,widgetKeys:m}=Fd(ax({decorations:this.runCreate(n,"createInRange",()=>e.createInRange({editor:this.editor,state:i,view:this.mountedView,from:f,to:h})),from:f,to:h,docSize:p,extensionName:n,warnedExtensions:this.warnedOutOfRangeExtensions}),n);u=u.add(i.doc,b);for(const v of m)d.add(v)}return{set:u,widgetKeys:d}}buildFullSet(n,e,t){const s=this.runCreate(n,"create",()=>e.create({editor:this.editor,state:t,view:this.mountedView}));return lx(t.doc,s,n)}runCreate(n,e,t){try{return t()}catch(s){return console.error(`[tiptap error]: Extension "${n}" threw in \`addDecorations().${e}()\`. Its decorations were dropped for this update.`,s),[]}}warnDuplicateWidgetKeys(n){}buildMergedSet(n,e){const t=Object.keys(e);return t.length===1?e[t[0]]:ea(n,e)}mergeAfterApply({entries:n,previous:e,tr:t,decorationSetsByExtension:s,recomputedNames:i}){return n.length===1?s[n[0].name]:i.size===0?e.mergedDecorationSet.map(t.mapping,t.doc):ea(t.doc,s)}};function vx(n,e){const{selection:t}=n,{$from:s}=t;if(t instanceof W){const r=s.index();return s.parent.canReplaceWith(r,r+1,e)}let i=s.depth;for(;i>=0;){const r=s.index(i);if(s.node(i).contentMatchAt(r).matchType(e))return!0;i-=1}return!1}function yx(n,e,t){const s=document.querySelector("style[data-tiptap-style]");if(s!==null)return s;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(i),i}function kx(n){return typeof n=="number"}function xx(n){return Object.prototype.toString.call(n).slice(8,-1)}function Ns(n){return xx(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function na(n,e,t){const s=n.split(` `),i=[];let r="",o=0;const l=e.baseIndentSize||2;for(;o0)break;if(u.trim()===""){o+=1,r=`${r}${u} `;continue}else return}const f=e.extractItemData(p),{indentLevel:h,mainContent:g}=f;r=`${r}${u} `;const b=[g];for(o+=1;oB.trim()!=="");if(O===-1)break;if((((d=s[o+1+O].match(/^(\s*)/))===null||d===void 0||(d=d[1])===null||d===void 0?void 0:d.length)||0)>h){b.push(A),r=`${r}${A} `,o+=1;continue}else break}if((((c=A.match(/^(\s*)/))===null||c===void 0||(c=c[1])===null||c===void 0?void 0:c.length)||0)>h)b.push(A),r=`${r}${A} -`,o+=1;else break}let m;const y=b.slice(1);if(y.length>0){const A=y.map(O=>O.slice(h+l)).join(` -`);A.trim()&&(e.customNestedParser?m=e.customNestedParser(A):m=t.blockTokens(A))}const S=e.createToken(f,m);i.push(S)}if(i.length!==0)return{items:i,raw:r}}const sa=4;function ia(n){let e=0;for(const t of n)e=t===" "?e+sa-e%sa:e+1;return e}function Ud(n,e,t,s,i){if(!n||!Array.isArray(n.content))return"";const r=typeof t=="function"?t(s):t,[o,...l]=n.content;let c=`${r}${e.renderChildren([o])}`;return l&&l.length>0&&l.forEach((d,u)=>{var p,f;const h=(p=(f=e.renderChild)===null||f===void 0?void 0:f.call(e,d,u+1))!==null&&p!==void 0?p:e.renderChildren([d]);if(h!=null){const g=m=>{if(!(i!=null&&i.alignNestedToPrefix))return e.indent(m);const y=e.indent(""),S=ia(r);return(ia(y)>=S?y:" ".repeat(S))+m},b=h.split(` +`,o+=1;else break}let m;const v=b.slice(1);if(v.length>0){const A=v.map(O=>O.slice(h+l)).join(` +`);A.trim()&&(e.customNestedParser?m=e.customNestedParser(A):m=t.blockTokens(A))}const S=e.createToken(f,m);i.push(S)}if(i.length!==0)return{items:i,raw:r}}const sa=4;function ia(n){let e=0;for(const t of n)e=t===" "?e+sa-e%sa:e+1;return e}function Ud(n,e,t,s,i){if(!n||!Array.isArray(n.content))return"";const r=typeof t=="function"?t(s):t,[o,...l]=n.content;let c=`${r}${e.renderChildren([o])}`;return l&&l.length>0&&l.forEach((d,u)=>{var p,f;const h=(p=(f=e.renderChild)===null||f===void 0?void 0:f.call(e,d,u+1))!==null&&p!==void 0?p:e.renderChildren([d]);if(h!=null){const g=m=>{if(!(i!=null&&i.alignNestedToPrefix))return e.indent(m);const v=e.indent(""),S=ia(r);return(ia(v)>=S?v:" ".repeat(S))+m},b=h.split(` `).map(m=>g(m||"")).join(` `);c+=d.type==="paragraph"?` ${b}`:` -${b}`}}),c}function Wd(n,e){const t={...n};return Ns(n)&&Ns(e)&&Object.keys(e).forEach(s=>{Ns(e[s])&&Ns(n[s])?t[s]=Wd(n[s],e[s]):t[s]=e[s]}),t}function xx(n,e,t={}){const{state:s}=e,{doc:i,tr:r}=s,o=n;i.descendants((l,c)=>{const d=r.mapping.map(c),u=r.mapping.map(c)+l.nodeSize;let p=null;if(l.marks.forEach(h=>{if(h!==o)return!1;p=h}),!p)return;let f=!1;if(Object.keys(t).forEach(h=>{t[h]!==p.attrs[h]&&(f=!0)}),f){const h=n.type.create({...n.attrs,...t});r.removeMark(d,u,n.type),r.addMark(d,u,h)}}),r.docChanged&&e.view.dispatch(r)}var ks=class{constructor(n){var e;this.find=n.find,this.handler=n.handler,this.undoable=(e=n.undoable)!==null&&e!==void 0?e:!0}};const wx=(n,e)=>{if(yo(e))return e.exec(n);const t=e(n);if(!t)return null;const s=[t.text];return s.index=t.index,s.input=n,s.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),s.push(t.replaceWith)),s};function Sx(n){const{editor:e,from:t,to:s,text:i,insertText:r}=n;if(!r)return{inputTransaction:null,tr:e.view.state.tr};const o=e.view.state.tr.insertText(i,t,s);return{inputTransaction:o,tr:pt.create({doc:o.doc,selection:o.selection,storedMarks:o.storedMarks}).tr}}function Cx(n){const{editor:e,from:t,to:s,text:i,rule:r,match:o,plugin:l,insertText:c}=n,{view:d}=e,{inputTransaction:u,tr:p}=Sx({editor:e,from:t,to:s,text:i,insertText:c}),f=u?t+i.length:s,h=Fi({state:d.state,transaction:p}),g={from:t-(o[0].length-i.length),to:f},{commands:b,chain:m,can:y}=new xn({editor:e,state:h});return r.handler({state:h,range:g,match:o,commands:b,chain:m,can:y})===null||!p.steps.length?!1:(u&&(d.dispatch(u),!d.state.doc.eq(u.doc))||(p1(p),p.setMeta("inputRule",!0),r.undoable&&p.setMeta(l,{transform:p,from:t,to:f,text:i}),d.dispatch(p)),!0)}function Mx(n,e,t){const s=e[0].length-t.length;if(s<=0)return!0;const i=n.parentOffset-s;return i>=0&&n.parent.textBetween(i,n.parentOffset)===e[0].slice(0,s)}function Is(n){var e;const{editor:t,from:s,to:i,text:r,rules:o,plugin:l,insertText:c}=n,{view:d}=t;if(d.composing)return!1;const u=d.state.doc.resolve(s);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;const p=wk(u)+r;for(const f of o){const h=wx(p,f.find);if(!(!h||!Mx(u,h,r))&&Cx({editor:t,from:s,to:i,text:r,rule:f,match:h,plugin:l,insertText:c}))return!0}return!1}function Tx(n){const{editor:e,rules:t}=n,s=new oe({state:{init(){return null},apply(i,r,o){const l=i.getMeta(s);if(l)return l;const c=i.getMeta("applyInputRules");return c&&setTimeout(()=>{let{text:d}=c;typeof d=="string"?d=d:d=xo($.from(d),o.schema);const{from:u}=c,p=u+d.length;Is({editor:e,from:u,to:p,text:d,rules:t,plugin:s})}),i.selectionSet||i.docChanged?null:r}},props:{handleTextInput(i,r,o,l){return Is({editor:e,from:r,to:o,text:l,rules:t,plugin:s,insertText:!0})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:r}=i.state.selection;r&&Is({editor:e,from:r.pos,to:r.pos,text:"",rules:t,plugin:s})}),!1)},handleKeyDown(i,r){if(r.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?Is({editor:e,from:o.pos,to:o.pos,text:` -`,rules:t,plugin:s}):!1}},isInputRules:!0});return s}var Co=class{constructor(n={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...se(V(this,"addOptions",{name:this.name}))}}get storage(){return{...se(V(this,"addStorage",{name:this.name,options:this.options}))}}configure(n={}){const e=this.extend({...this.config,addOptions:()=>Wd(this.options,n)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(n={}){const e=new this.constructor({...this.config,...n});return e.parent=this,this.child=e,e.name="name"in n?n.name:e.parent.name,e}},an=class Kd extends Co{constructor(...e){super(...e),this.type="mark"}static create(e={}){const t=typeof e=="function"?e():e;return new Kd(t)}static handleExit({editor:e,mark:t}){const{tr:s}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const r=i.marks();if(!r.find(l=>(l==null?void 0:l.type.name)===t.name))return!1;const o=r.find(l=>(l==null?void 0:l.type.name)===t.name);return o&&s.removeStoredMark(o),s.insertText(" ",i.pos),e.view.dispatch(s),!0}return!1}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},Jd=class{constructor(n){this.find=n.find,this.handler=n.handler}};const Ex=(n,e,t)=>{if(yo(e))return[...n.matchAll(e)];const s=e(n,t);return s?s.map(i=>{const r=[i.text];return r.index=i.index,r.input=n,r.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),r.push(i.replaceWith)),r}):[]};function Ax(n){const{editor:e,state:t,from:s,to:i,rule:r,pasteEvent:o,dropEvent:l}=n,{commands:c,chain:d,can:u}=new xn({editor:e,state:t}),p=[];return t.doc.nodesBetween(s,i,(f,h)=>{var g,b,m,y;if(!((g=f.type)===null||g===void 0||(g=g.spec)===null||g===void 0)&&g.code||!(f.isText||f.isTextblock||f.isInline))return;const S=(b=(m=(y=f.content)===null||y===void 0?void 0:y.size)!==null&&m!==void 0?m:f.nodeSize)!==null&&b!==void 0?b:0,A=Math.max(s,h),O=Math.min(i,h+S);if(A>=O)return;const B=f.isText?f.text||"":f.textBetween(A-h,O-h,void 0,"");Ex(B,r.find,o).forEach(E=>{if(E.index===void 0)return;const M=A+E.index+1,w=M+E[0].length,T={from:t.tr.mapping.map(M),to:t.tr.mapping.map(w)},N=r.handler({state:t,range:T,match:E,commands:c,chain:d,can:u,pasteEvent:o,dropEvent:l});p.push(N)})}),p.every(f=>f!==null)}let hn=null;const Ox=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)===null||e===void 0||e.setData("text/html",n),t};function Nx(n){const{editor:e,rules:t}=n;let s=null,i=!1,r=!1,o=typeof ClipboardEvent!="undefined"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent!="undefined"?new DragEvent("drop"):null}catch(d){l=null}const c=({state:d,from:u,to:p,rule:f,pasteEvt:h})=>{const g=d.tr,b=Fi({state:d,transaction:g});if(!(!Ax({editor:e,state:b,from:Math.max(u-1,0),to:p.b-1,rule:f,pasteEvent:h,dropEvent:l})||!g.steps.length)){try{l=typeof DragEvent!="undefined"?new DragEvent("drop"):null}catch(m){l=null}return o=typeof ClipboardEvent!="undefined"?new ClipboardEvent("paste"):null,g}};return e.on("destroy",()=>{hn===e&&(hn=null)}),t.map(d=>new oe({view(u){const p=h=>{var g;s=!((g=u.dom.parentElement)===null||g===void 0)&&g.contains(h.target)?u.dom.parentElement:null,s&&(hn=e)},f=()=>{hn&&(hn=null)};return window.addEventListener("dragstart",p),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",p),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(u,p)=>{if(r=s===u.dom.parentElement,l=p,!r){const f=hn;f!=null&&f.isEditable&&setTimeout(()=>{if(f.isDestroyed)return;const h=f.state.selection;h&&f.commands.deleteRange({from:h.from,to:h.to})},10)}return!1},paste:(u,p)=>{var f;const h=(f=p.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return o=p,i=!!(h!=null&&h.includes("data-pm-slice")),!1}}},appendTransaction:(u,p,f)=>{const h=u[0],g=h.getMeta("uiEvent")==="paste"&&!i,b=h.getMeta("uiEvent")==="drop"&&!r,m=h.getMeta("applyPasteRules"),y=!!m;if(!g&&!b&&!y)return;if(y){let{text:O}=m;typeof O=="string"?O=O:O=xo($.from(O),f.schema);const{from:B}=m,E=B+O.length,M=Ox(O);return c({rule:d,state:f,from:B,to:{b:E},pasteEvt:M})}const S=p.doc.content.findDiffStart(f.doc.content),A=p.doc.content.findDiffEnd(f.doc.content);if(!(!vx(S)||!A||S===A.b))return c({rule:d,state:f,from:S,to:A,pasteEvt:o})}}))}var Wi=class{constructor(n,e){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=e,this.baseExtensions=n,this.extensions=Id(n),this.hasSchemaSpec=e.options.schemaSpec!==void 0,this.schema=mk(this.extensions,e,e.options.schemaSpec),this.setupExtensions()}get commands(){return this.extensions.reduce((n,e)=>{const t=V(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:fn(e.name,this.schema)});return t?{...n,...t()}:n},{})}get plugins(){const{editor:n}=this,e=Wn([...this.extensions].reverse()).flatMap(s=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:n,type:fn(s.name,this.schema)},r=[],o=V(s,"addKeyboardShortcuts",i);let l={};if(s.type==="mark"&&V(s,"exitable",i)&&(l.ArrowRight=()=>an.handleExit({editor:n,mark:s})),o){const f=Object.fromEntries(Object.entries(o()).map(([h,g])=>[h,()=>g({editor:n})]));l={...l,...f}}const c=i1(l);r.push(c);const d=V(s,"addInputRules",i);if(Yl(s,n.options.enableInputRules)&&d){const f=d();if(f&&f.length){const h=Tx({editor:n,rules:f}),g=Array.isArray(h)?h:[h];r.push(...g)}}const u=V(s,"addPasteRules",i);if(Yl(s,n.options.enablePasteRules)&&u){const f=u();if(f&&f.length){const h=Nx({editor:n,rules:f});r.push(...h)}}const p=V(s,"addProseMirrorPlugins",i);if(p){const f=p();r.push(...f)}return r}),t=this.createDecorationPlugin();return t&&e.push(t),e}createDecorationPlugin(){var n;const{editor:e}=this;(n=this.decorationManager)===null||n===void 0||n.destroy();const t=[];return this.extensions.forEach(s=>{const i=V(s,"addDecorations",{name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:fn(s.name,this.schema)});i&&t.push({name:s.name,addDecorations:i})}),this.decorationManager=new gx({editor:e,entries:t}),this.decorationManager.plugin}get attributes(){const n=wo(this.extensions);return this.hasSchemaSpec?Od(n,this.schema):n}get nodeViews(){const{editor:n}=this,{nodeExtensions:e}=An(this.extensions);return Object.fromEntries(e.filter(t=>!!V(t,"addNodeView")).map(t=>{const s=this.attributes.filter(l=>l.type===t.name),i=V(t,"addNodeView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:ve(t.name,this.schema)});if(!i)return[];const r=i();if(!r)return[];const o=(l,c,d,u,p)=>{const f=us(l,s);return r({node:l,view:c,getPos:d,decorations:u,innerDecorations:p,editor:n,extension:t,HTMLAttributes:f})};return[t.name,o]}))}dispatchTransaction(n){const{editor:e}=this;return Wn([...this.extensions].reverse()).reduceRight((t,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:fn(s.name,this.schema)},r=V(s,"dispatchTransaction",i);return r?o=>{r.call(i,{transaction:o,next:t})}:t},n)}transformPastedHTML(n){const{editor:e}=this;return Wn([...this.extensions]).reduce((t,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:fn(s.name,this.schema)},r=V(s,"transformPastedHTML",i);return r?(o,l)=>{const c=t(o,l);return r.call(i,c)}:t},n||(t=>t))}get markViews(){const{editor:n}=this,{markExtensions:e}=An(this.extensions);return Object.fromEntries(e.filter(t=>!!V(t,"addMarkView")).map(t=>{const s=this.attributes.filter(o=>o.type===t.name),i=V(t,"addMarkView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:yt(t.name,this.schema)});if(!i)return[];const r=(o,l,c)=>{const d=us(o,s);return i()({mark:o,view:l,inline:c,editor:n,extension:t,HTMLAttributes:d,updateAttributes:u=>{xx(o,n,u)}})};return[t.name,r]}))}destroy(){var n;(n=this.decorationManager)===null||n===void 0||n.destroy(),this.extensions.forEach(e=>{let t=e;for(;t.parent;){const s=t.parent;s.child===t&&(s.child=null),t=s}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){const n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(e=>[e.name,e.storage])),n.forEach(e=>{const t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:fn(e.name,this.schema)};if(e.type==="mark"){var s,i;(!((s=se(V(e,"keepOnSplit",t)))!==null&&s!==void 0)||s)&&this.splittableMarks.push(e.name),!((i=se(V(e,"clearable",t)))!==null&&i!==void 0)||i||this.nonClearableMarks.push(e.name)}const r=V(e,"onBeforeCreate",t),o=V(e,"onCreate",t),l=V(e,"onUpdate",t),c=V(e,"onSelectionUpdate",t),d=V(e,"onTransaction",t),u=V(e,"onFocus",t),p=V(e,"onBlur",t),f=V(e,"onDestroy",t);r&&this.editor.on("beforeCreate",r),o&&this.editor.on("create",o),l&&this.editor.on("update",l),c&&this.editor.on("selectionUpdate",c),d&&this.editor.on("transaction",d),u&&this.editor.on("focus",u),p&&this.editor.on("blur",p),f&&this.editor.on("destroy",f)})}};Wi.resolve=Id;Wi.sort=Wn;Wi.flatten=ko;var pe=class Gd extends Co{constructor(...e){super(...e),this.type="extension"}static create(e={}){const t=typeof e=="function"?e():e;return new Gd(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};const Ix=pe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new oe({key:new me("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:s,selection:i}=e,r=$d(t),{blockSeparator:o}=this.options,l={...o!==void 0?{blockSeparator:o}:{},textSerializers:r};return[...i.ranges].sort((c,d)=>c.$from.pos-d.$from.pos).map(({$from:c,$to:d})=>Dd(s,{from:c.pos,to:d.pos},l)).join(o!=null?o:` +${b}`}}),c}function Wd(n,e){const t={...n};return Ns(n)&&Ns(e)&&Object.keys(e).forEach(s=>{Ns(e[s])&&Ns(n[s])?t[s]=Wd(n[s],e[s]):t[s]=e[s]}),t}function wx(n,e,t={}){const{state:s}=e,{doc:i,tr:r}=s,o=n;i.descendants((l,c)=>{const d=r.mapping.map(c),u=r.mapping.map(c)+l.nodeSize;let p=null;if(l.marks.forEach(h=>{if(h!==o)return!1;p=h}),!p)return;let f=!1;if(Object.keys(t).forEach(h=>{t[h]!==p.attrs[h]&&(f=!0)}),f){const h=n.type.create({...n.attrs,...t});r.removeMark(d,u,n.type),r.addMark(d,u,h)}}),r.docChanged&&e.view.dispatch(r)}var ks=class{constructor(n){var e;this.find=n.find,this.handler=n.handler,this.undoable=(e=n.undoable)!==null&&e!==void 0?e:!0}};const Sx=(n,e)=>{if(vo(e))return e.exec(n);const t=e(n);if(!t)return null;const s=[t.text];return s.index=t.index,s.input=n,s.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),s.push(t.replaceWith)),s};function Cx(n){const{editor:e,from:t,to:s,text:i,insertText:r}=n;if(!r)return{inputTransaction:null,tr:e.view.state.tr};const o=e.view.state.tr.insertText(i,t,s);return{inputTransaction:o,tr:pt.create({doc:o.doc,selection:o.selection,storedMarks:o.storedMarks}).tr}}function Mx(n){const{editor:e,from:t,to:s,text:i,rule:r,match:o,plugin:l,insertText:c}=n,{view:d}=e,{inputTransaction:u,tr:p}=Cx({editor:e,from:t,to:s,text:i,insertText:c}),f=u?t+i.length:s,h=Fi({state:d.state,transaction:p}),g={from:t-(o[0].length-i.length),to:f},{commands:b,chain:m,can:v}=new xn({editor:e,state:h});return r.handler({state:h,range:g,match:o,commands:b,chain:m,can:v})===null||!p.steps.length?!1:(u&&(d.dispatch(u),!d.state.doc.eq(u.doc))||(f1(p),p.setMeta("inputRule",!0),r.undoable&&p.setMeta(l,{transform:p,from:t,to:f,text:i}),d.dispatch(p)),!0)}function Tx(n,e,t){const s=e[0].length-t.length;if(s<=0)return!0;const i=n.parentOffset-s;return i>=0&&n.parent.textBetween(i,n.parentOffset)===e[0].slice(0,s)}function Is(n){var e;const{editor:t,from:s,to:i,text:r,rules:o,plugin:l,insertText:c}=n,{view:d}=t;if(d.composing)return!1;const u=d.state.doc.resolve(s);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;const p=Sk(u)+r;for(const f of o){const h=Sx(p,f.find);if(!(!h||!Tx(u,h,r))&&Mx({editor:t,from:s,to:i,text:r,rule:f,match:h,plugin:l,insertText:c}))return!0}return!1}function Ex(n){const{editor:e,rules:t}=n,s=new oe({state:{init(){return null},apply(i,r,o){const l=i.getMeta(s);if(l)return l;const c=i.getMeta("applyInputRules");return c&&setTimeout(()=>{let{text:d}=c;typeof d=="string"?d=d:d=xo($.from(d),o.schema);const{from:u}=c,p=u+d.length;Is({editor:e,from:u,to:p,text:d,rules:t,plugin:s})}),i.selectionSet||i.docChanged?null:r}},props:{handleTextInput(i,r,o,l){return Is({editor:e,from:r,to:o,text:l,rules:t,plugin:s,insertText:!0})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:r}=i.state.selection;r&&Is({editor:e,from:r.pos,to:r.pos,text:"",rules:t,plugin:s})}),!1)},handleKeyDown(i,r){if(r.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?Is({editor:e,from:o.pos,to:o.pos,text:` +`,rules:t,plugin:s}):!1}},isInputRules:!0});return s}var Co=class{constructor(n={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...se(V(this,"addOptions",{name:this.name}))}}get storage(){return{...se(V(this,"addStorage",{name:this.name,options:this.options}))}}configure(n={}){const e=this.extend({...this.config,addOptions:()=>Wd(this.options,n)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(n={}){const e=new this.constructor({...this.config,...n});return e.parent=this,this.child=e,e.name="name"in n?n.name:e.parent.name,e}},an=class Kd extends Co{constructor(...e){super(...e),this.type="mark"}static create(e={}){const t=typeof e=="function"?e():e;return new Kd(t)}static handleExit({editor:e,mark:t}){const{tr:s}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const r=i.marks();if(!r.find(l=>(l==null?void 0:l.type.name)===t.name))return!1;const o=r.find(l=>(l==null?void 0:l.type.name)===t.name);return o&&s.removeStoredMark(o),s.insertText(" ",i.pos),e.view.dispatch(s),!0}return!1}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},Jd=class{constructor(n){this.find=n.find,this.handler=n.handler}};const Ax=(n,e,t)=>{if(vo(e))return[...n.matchAll(e)];const s=e(n,t);return s?s.map(i=>{const r=[i.text];return r.index=i.index,r.input=n,r.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),r.push(i.replaceWith)),r}):[]};function Ox(n){const{editor:e,state:t,from:s,to:i,rule:r,pasteEvent:o,dropEvent:l}=n,{commands:c,chain:d,can:u}=new xn({editor:e,state:t}),p=[];return t.doc.nodesBetween(s,i,(f,h)=>{var g,b,m,v;if(!((g=f.type)===null||g===void 0||(g=g.spec)===null||g===void 0)&&g.code||!(f.isText||f.isTextblock||f.isInline))return;const S=(b=(m=(v=f.content)===null||v===void 0?void 0:v.size)!==null&&m!==void 0?m:f.nodeSize)!==null&&b!==void 0?b:0,A=Math.max(s,h),O=Math.min(i,h+S);if(A>=O)return;const B=f.isText?f.text||"":f.textBetween(A-h,O-h,void 0,"");Ax(B,r.find,o).forEach(E=>{if(E.index===void 0)return;const M=A+E.index+1,w=M+E[0].length,T={from:t.tr.mapping.map(M),to:t.tr.mapping.map(w)},N=r.handler({state:t,range:T,match:E,commands:c,chain:d,can:u,pasteEvent:o,dropEvent:l});p.push(N)})}),p.every(f=>f!==null)}let hn=null;const Nx=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)===null||e===void 0||e.setData("text/html",n),t};function Ix(n){const{editor:e,rules:t}=n;let s=null,i=!1,r=!1,o=typeof ClipboardEvent!="undefined"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent!="undefined"?new DragEvent("drop"):null}catch(d){l=null}const c=({state:d,from:u,to:p,rule:f,pasteEvt:h})=>{const g=d.tr,b=Fi({state:d,transaction:g});if(!(!Ox({editor:e,state:b,from:Math.max(u-1,0),to:p.b-1,rule:f,pasteEvent:h,dropEvent:l})||!g.steps.length)){try{l=typeof DragEvent!="undefined"?new DragEvent("drop"):null}catch(m){l=null}return o=typeof ClipboardEvent!="undefined"?new ClipboardEvent("paste"):null,g}};return e.on("destroy",()=>{hn===e&&(hn=null)}),t.map(d=>new oe({view(u){const p=h=>{var g;s=!((g=u.dom.parentElement)===null||g===void 0)&&g.contains(h.target)?u.dom.parentElement:null,s&&(hn=e)},f=()=>{hn&&(hn=null)};return window.addEventListener("dragstart",p),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",p),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(u,p)=>{if(r=s===u.dom.parentElement,l=p,!r){const f=hn;f!=null&&f.isEditable&&setTimeout(()=>{if(f.isDestroyed)return;const h=f.state.selection;h&&f.commands.deleteRange({from:h.from,to:h.to})},10)}return!1},paste:(u,p)=>{var f;const h=(f=p.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return o=p,i=!!(h!=null&&h.includes("data-pm-slice")),!1}}},appendTransaction:(u,p,f)=>{const h=u[0],g=h.getMeta("uiEvent")==="paste"&&!i,b=h.getMeta("uiEvent")==="drop"&&!r,m=h.getMeta("applyPasteRules"),v=!!m;if(!g&&!b&&!v)return;if(v){let{text:O}=m;typeof O=="string"?O=O:O=xo($.from(O),f.schema);const{from:B}=m,E=B+O.length,M=Nx(O);return c({rule:d,state:f,from:B,to:{b:E},pasteEvt:M})}const S=p.doc.content.findDiffStart(f.doc.content),A=p.doc.content.findDiffEnd(f.doc.content);if(!(!kx(S)||!A||S===A.b))return c({rule:d,state:f,from:S,to:A,pasteEvt:o})}}))}var Wi=class{constructor(n,e){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=e,this.baseExtensions=n,this.extensions=Id(n),this.hasSchemaSpec=e.options.schemaSpec!==void 0,this.schema=gk(this.extensions,e,e.options.schemaSpec),this.setupExtensions()}get commands(){return this.extensions.reduce((n,e)=>{const t=V(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:fn(e.name,this.schema)});return t?{...n,...t()}:n},{})}get plugins(){const{editor:n}=this,e=Kn([...this.extensions].reverse()).flatMap(s=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:n,type:fn(s.name,this.schema)},r=[],o=V(s,"addKeyboardShortcuts",i);let l={};if(s.type==="mark"&&V(s,"exitable",i)&&(l.ArrowRight=()=>an.handleExit({editor:n,mark:s})),o){const f=Object.fromEntries(Object.entries(o()).map(([h,g])=>[h,()=>g({editor:n})]));l={...l,...f}}const c=r1(l);r.push(c);const d=V(s,"addInputRules",i);if(Yl(s,n.options.enableInputRules)&&d){const f=d();if(f&&f.length){const h=Ex({editor:n,rules:f}),g=Array.isArray(h)?h:[h];r.push(...g)}}const u=V(s,"addPasteRules",i);if(Yl(s,n.options.enablePasteRules)&&u){const f=u();if(f&&f.length){const h=Ix({editor:n,rules:f});r.push(...h)}}const p=V(s,"addProseMirrorPlugins",i);if(p){const f=p();r.push(...f)}return r}),t=this.createDecorationPlugin();return t&&e.push(t),e}createDecorationPlugin(){var n;const{editor:e}=this;(n=this.decorationManager)===null||n===void 0||n.destroy();const t=[];return this.extensions.forEach(s=>{const i=V(s,"addDecorations",{name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:fn(s.name,this.schema)});i&&t.push({name:s.name,addDecorations:i})}),this.decorationManager=new bx({editor:e,entries:t}),this.decorationManager.plugin}get attributes(){const n=wo(this.extensions);return this.hasSchemaSpec?Od(n,this.schema):n}get nodeViews(){const{editor:n}=this,{nodeExtensions:e}=An(this.extensions);return Object.fromEntries(e.filter(t=>!!V(t,"addNodeView")).map(t=>{const s=this.attributes.filter(l=>l.type===t.name),i=V(t,"addNodeView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:ye(t.name,this.schema)});if(!i)return[];const r=i();if(!r)return[];const o=(l,c,d,u,p)=>{const f=ps(l,s);return r({node:l,view:c,getPos:d,decorations:u,innerDecorations:p,editor:n,extension:t,HTMLAttributes:f})};return[t.name,o]}))}dispatchTransaction(n){const{editor:e}=this;return Kn([...this.extensions].reverse()).reduceRight((t,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:fn(s.name,this.schema)},r=V(s,"dispatchTransaction",i);return r?o=>{r.call(i,{transaction:o,next:t})}:t},n)}transformPastedHTML(n){const{editor:e}=this;return Kn([...this.extensions]).reduce((t,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:fn(s.name,this.schema)},r=V(s,"transformPastedHTML",i);return r?(o,l)=>{const c=t(o,l);return r.call(i,c)}:t},n||(t=>t))}get markViews(){const{editor:n}=this,{markExtensions:e}=An(this.extensions);return Object.fromEntries(e.filter(t=>!!V(t,"addMarkView")).map(t=>{const s=this.attributes.filter(o=>o.type===t.name),i=V(t,"addMarkView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:vt(t.name,this.schema)});if(!i)return[];const r=(o,l,c)=>{const d=ps(o,s);return i()({mark:o,view:l,inline:c,editor:n,extension:t,HTMLAttributes:d,updateAttributes:u=>{wx(o,n,u)}})};return[t.name,r]}))}destroy(){var n;(n=this.decorationManager)===null||n===void 0||n.destroy(),this.extensions.forEach(e=>{let t=e;for(;t.parent;){const s=t.parent;s.child===t&&(s.child=null),t=s}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){const n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(e=>[e.name,e.storage])),n.forEach(e=>{const t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:fn(e.name,this.schema)};if(e.type==="mark"){var s,i;(!((s=se(V(e,"keepOnSplit",t)))!==null&&s!==void 0)||s)&&this.splittableMarks.push(e.name),!((i=se(V(e,"clearable",t)))!==null&&i!==void 0)||i||this.nonClearableMarks.push(e.name)}const r=V(e,"onBeforeCreate",t),o=V(e,"onCreate",t),l=V(e,"onUpdate",t),c=V(e,"onSelectionUpdate",t),d=V(e,"onTransaction",t),u=V(e,"onFocus",t),p=V(e,"onBlur",t),f=V(e,"onDestroy",t);r&&this.editor.on("beforeCreate",r),o&&this.editor.on("create",o),l&&this.editor.on("update",l),c&&this.editor.on("selectionUpdate",c),d&&this.editor.on("transaction",d),u&&this.editor.on("focus",u),p&&this.editor.on("blur",p),f&&this.editor.on("destroy",f)})}};Wi.resolve=Id;Wi.sort=Kn;Wi.flatten=ko;var pe=class Gd extends Co{constructor(...e){super(...e),this.type="extension"}static create(e={}){const t=typeof e=="function"?e():e;return new Gd(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};const Dx=pe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new oe({key:new me("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:s,selection:i}=e,r=$d(t),{blockSeparator:o}=this.options,l={...o!==void 0?{blockSeparator:o}:{},textSerializers:r};return[...i.ranges].sort((c,d)=>c.$from.pos-d.$from.pos).map(({$from:c,$to:d})=>Dd(s,{from:c.pos,to:d.pos},l)).join(o!=null?o:` -`)}}})]}}),Dx=pe.create({name:"commands",addCommands(){return{...nx}}}),$x=pe.create({name:"delete",onUpdate({transaction:n,appendedTransactions:e}){var t,s;const i=()=>{var r,o,l;if((r=(o=this.editor.options.coreExtensionOptions)===null||o===void 0||(o=o.delete)===null||o===void 0||(l=o.filterTransaction)===null||l===void 0?void 0:l.call(o,n))!==null&&r!==void 0?r:n.getMeta("y-sync$"))return;const c=Ad(n.before,[n,...e]);qi(c).forEach(u=>{c.mapping.mapResult(u.oldRange.from).deletedAfter&&c.mapping.mapResult(u.oldRange.to).deletedBefore&&c.before.nodesBetween(u.oldRange.from,u.oldRange.to,(p,f)=>{const h=f+p.nodeSize-2,g=u.oldRange.from<=f&&h<=u.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:f,to:h,newFrom:c.mapping.map(f),newTo:c.mapping.map(h),deletedRange:u.oldRange,newRange:u.newRange,partial:!g,editor:this.editor,transaction:n,combinedTransform:c})})});const d=c.mapping;c.steps.forEach((u,p)=>{if(u instanceof Xe){var f,h;const g=d.slice(p).map(u.from,-1),b=d.slice(p).map(u.to),m=d.invert().map(g,-1),y=d.invert().map(b),S=g>0?(f=c.doc.nodeAt(g-1))===null||f===void 0?void 0:f.marks.some(O=>O.eq(u.mark)):!1,A=(h=c.doc.nodeAt(b))===null||h===void 0?void 0:h.marks.some(O=>O.eq(u.mark));this.editor.emit("delete",{type:"mark",mark:u.mark,from:u.from,to:u.to,deletedRange:{from:m,to:y},newRange:{from:g,to:b},partial:!!(A||S),editor:this.editor,transaction:n,combinedTransform:c})}})};!((t=(s=this.editor.options.coreExtensionOptions)===null||s===void 0||(s=s.delete)===null||s===void 0?void 0:s.async)!==null&&t!==void 0)||t?setTimeout(i,0):i()}}),Rx=pe.create({name:"drop",addProseMirrorPlugins(){return[new oe({key:new me("tiptapDrop"),props:{handleDrop:(n,e,t,s)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:s})}}})]}}),Lx=pe.create({name:"editable",addProseMirrorPlugins(){return[new oe({key:new me("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Px=new me("focusEvents"),Bx=pe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new oe({key:Px,props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const s=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(s),!1},blur:(e,t)=>{n.isFocused=!1;const s=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(s),!1}}}})]}}),_x=pe.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:c,doc:d}=l,{empty:u,$anchor:p}=c,{pos:f,parent:h}=p,g=p.parent.isTextblock&&f>0?l.doc.resolve(f-1):p,b=g.parent.type.spec.isolating,m=p.pos-p.parentOffset,y=b&&g.parent.childCount===1?m===p.pos:X.atStart(d).from===f;return!u||!h.type.isTextblock||h.textContent.length||!y||y&&p.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),s={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...s},r={...s,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return ni()||Td()?r:i},addProseMirrorPlugins(){return[new oe({key:new me("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(h=>h.getMeta("composition")))return;const s=n.some(h=>h.docChanged)&&!e.doc.eq(t.doc),i=n.some(h=>h.getMeta("preventClearDocument"));if(!s||i)return;const{empty:r,from:o,to:l}=e.selection,c=X.atStart(e.doc).from,d=X.atEnd(e.doc).to;if(r||!(o===c&&l===d)||!vs(t.doc))return;const u=t.tr,p=Fi({state:t,transaction:u}),{commands:f}=new xn({editor:this.editor,state:p});if(f.clearNodes(),!!u.steps.length)return u}})]}}),zx=pe.create({name:"paste",addProseMirrorPlugins(){return[new oe({key:new me("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),jx=pe.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new oe({key:new me("tabindex"),props:{attributes:()=>{var n;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(n=this.options.value)!==null&&n!==void 0?n:"0"}}}})]}}),Fx=pe.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:n}=An(this.extensions);return[{types:n.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return t&&(t==="ltr"||t==="rtl"||t==="auto")?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new oe({key:new me("textDirection"),props:{attributes:()=>{const n=this.options.direction;return n?{dir:n}:{}}}})]}});let ra=!1;function Vx(n){if(ra)return;ra=!0;let e;try{const t=de.fromJSON(n,{from:0,to:0});if(!Ek(t))return;e=t.slice.content}catch(t){return}e instanceof $||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}var Hx=class jn{get name(){return this.node.type.name}constructor(e,t,s=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=s,this.resolvedPos=e,this.editor=t,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,s=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,s=this.to-1}this.editor.commands.insertContentAt({from:t,to:s},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new jn(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new jn(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new jn(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,s)=>{const i=t.isBlock&&!t.isTextblock,r=t.isAtom&&!t.isText,o=t.isInline,l=this.pos+s+(r?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const c=this.resolvedPos.doc.resolve(l);if(!i&&!o&&c.depth<=this.depth)return;const d=new jn(c,this.editor,i,i||o?t:null);i&&(d.actualDepth=this.depth+1),e.push(d)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let s=null,i=this.parent;for(;i&&!s;){if(i.node.type.name===e)if(Object.keys(t).length>0){const r=i.node.attrs,o=Object.keys(t);for(let l=0;l{s&&i.length>0||(o.node.type.name===e&&r.every(l=>t[l]===o.node.attrs[l])&&i.push(o),!(s&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,t,s))))}),i}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}};const qx=`.ProseMirror { +`)}}})]}}),$x=pe.create({name:"commands",addCommands(){return{...sx}}}),Rx=pe.create({name:"delete",onUpdate({transaction:n,appendedTransactions:e}){var t,s;const i=()=>{var r,o,l;if((r=(o=this.editor.options.coreExtensionOptions)===null||o===void 0||(o=o.delete)===null||o===void 0||(l=o.filterTransaction)===null||l===void 0?void 0:l.call(o,n))!==null&&r!==void 0?r:n.getMeta("y-sync$"))return;const c=Ad(n.before,[n,...e]);qi(c).forEach(u=>{c.mapping.mapResult(u.oldRange.from).deletedAfter&&c.mapping.mapResult(u.oldRange.to).deletedBefore&&c.before.nodesBetween(u.oldRange.from,u.oldRange.to,(p,f)=>{const h=f+p.nodeSize-2,g=u.oldRange.from<=f&&h<=u.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:f,to:h,newFrom:c.mapping.map(f),newTo:c.mapping.map(h),deletedRange:u.oldRange,newRange:u.newRange,partial:!g,editor:this.editor,transaction:n,combinedTransform:c})})});const d=c.mapping;c.steps.forEach((u,p)=>{if(u instanceof Xe){var f,h;const g=d.slice(p).map(u.from,-1),b=d.slice(p).map(u.to),m=d.invert().map(g,-1),v=d.invert().map(b),S=g>0?(f=c.doc.nodeAt(g-1))===null||f===void 0?void 0:f.marks.some(O=>O.eq(u.mark)):!1,A=(h=c.doc.nodeAt(b))===null||h===void 0?void 0:h.marks.some(O=>O.eq(u.mark));this.editor.emit("delete",{type:"mark",mark:u.mark,from:u.from,to:u.to,deletedRange:{from:m,to:v},newRange:{from:g,to:b},partial:!!(A||S),editor:this.editor,transaction:n,combinedTransform:c})}})};!((t=(s=this.editor.options.coreExtensionOptions)===null||s===void 0||(s=s.delete)===null||s===void 0?void 0:s.async)!==null&&t!==void 0)||t?setTimeout(i,0):i()}}),Lx=pe.create({name:"drop",addProseMirrorPlugins(){return[new oe({key:new me("tiptapDrop"),props:{handleDrop:(n,e,t,s)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:s})}}})]}}),Px=pe.create({name:"editable",addProseMirrorPlugins(){return[new oe({key:new me("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Bx=new me("focusEvents"),_x=pe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new oe({key:Bx,props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const s=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(s),!1},blur:(e,t)=>{n.isFocused=!1;const s=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(s),!1}}}})]}}),zx=pe.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:c,doc:d}=l,{empty:u,$anchor:p}=c,{pos:f,parent:h}=p,g=p.parent.isTextblock&&f>0?l.doc.resolve(f-1):p,b=g.parent.type.spec.isolating,m=p.pos-p.parentOffset,v=b&&g.parent.childCount===1?m===p.pos:X.atStart(d).from===f;return!u||!h.type.isTextblock||h.textContent.length||!v||v&&p.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),s={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...s},r={...s,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return ni()||Td()?r:i},addProseMirrorPlugins(){return[new oe({key:new me("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(h=>h.getMeta("composition")))return;const s=n.some(h=>h.docChanged)&&!e.doc.eq(t.doc),i=n.some(h=>h.getMeta("preventClearDocument"));if(!s||i)return;const{empty:r,from:o,to:l}=e.selection,c=X.atStart(e.doc).from,d=X.atEnd(e.doc).to;if(r||!(o===c&&l===d)||!ys(t.doc))return;const u=t.tr,p=Fi({state:t,transaction:u}),{commands:f}=new xn({editor:this.editor,state:p});if(f.clearNodes(),!!u.steps.length)return u}})]}}),jx=pe.create({name:"paste",addProseMirrorPlugins(){return[new oe({key:new me("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),Fx=pe.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new oe({key:new me("tabindex"),props:{attributes:()=>{var n;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(n=this.options.value)!==null&&n!==void 0?n:"0"}}}})]}}),Vx=pe.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:n}=An(this.extensions);return[{types:n.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return t&&(t==="ltr"||t==="rtl"||t==="auto")?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new oe({key:new me("textDirection"),props:{attributes:()=>{const n=this.options.direction;return n?{dir:n}:{}}}})]}});let ra=!1;function Hx(n){if(ra)return;ra=!0;let e;try{const t=de.fromJSON(n,{from:0,to:0});if(!Ak(t))return;e=t.slice.content}catch(t){return}e instanceof $||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}var qx=class Fn{get name(){return this.node.type.name}constructor(e,t,s=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=s,this.resolvedPos=e,this.editor=t,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,s=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,s=this.to-1}this.editor.commands.insertContentAt({from:t,to:s},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new Fn(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Fn(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Fn(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,s)=>{const i=t.isBlock&&!t.isTextblock,r=t.isAtom&&!t.isText,o=t.isInline,l=this.pos+s+(r?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const c=this.resolvedPos.doc.resolve(l);if(!i&&!o&&c.depth<=this.depth)return;const d=new Fn(c,this.editor,i,i||o?t:null);i&&(d.actualDepth=this.depth+1),e.push(d)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let s=null,i=this.parent;for(;i&&!s;){if(i.node.type.name===e)if(Object.keys(t).length>0){const r=i.node.attrs,o=Object.keys(t);for(let l=0;l{s&&i.length>0||(o.node.type.name===e&&r.every(l=>t[l]===o.node.attrs[l])&&i.push(o),!(s&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,t,s))))}),i}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}};const Ux=`.ProseMirror { position: relative; } @@ -97,13 +97,13 @@ img.ProseMirror-separator { .ProseMirror-focused .ProseMirror-gapcursor { display: block; -}`;var Ux=class extends ix{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document!="undefined"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:s})=>{throw s},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Ak,createMappablePosition:Ok},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:s,slice:i,moved:r})=>this.options.onDrop(s,i,r)),this.on("paste",({event:s,slice:i})=>this.options.onPaste(s,i)),this.on("delete",this.options.onDelete);const t=this.createDoc();if(!this.editorState){const s=Pr(t,this.options.autofocus);this.editorState=pt.create({doc:t,schema:this.schema,selection:s||void 0})}Vx(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document=="undefined")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;const e=this.editorView.dom;e!=null&&e.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():xn.createFakeChain()}can(){return this.commandManager?this.commandManager.can():xn.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document!="undefined"&&(this.css=yx(qx,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const s=_r(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:s});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let s=t;if([].concat(e).forEach(r=>{const o=typeof r=="string"?`${r}$`:r.key;s=s.filter(l=>!l.key.startsWith(o))}),t.length===s.length)return;const i=this.state.reconfigure({plugins:s});return this.view.updateState(i),i}createExtensionManager(){var e,t;const s=[...this.options.enableCoreExtensions?[Lx,Ix.configure({blockSeparator:(e=this.options.coreExtensionOptions)===null||e===void 0||(e=e.clipboardTextSerializer)===null||e===void 0?void 0:e.blockSeparator}),Dx,Bx,_x,jx.configure({value:(t=this.options.coreExtensionOptions)===null||t===void 0||(t=t.tabindex)===null||t===void 0?void 0:t.value}),Rx,zx,$x,Fx.configure({direction:this.options.textDirection})].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new Wi(s,this)}createCommandManager(){this.commandManager=new xn({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Br(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;const s=Br(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=pt.create({doc:s,schema:this.schema,selection:Pr(s,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(i=>i.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return e}getEditorViewAttributes(){var e;const t=(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes;return _r(t)?s=>({role:"textbox",...t(s)}):{role:"textbox",...t}}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:s}=this.options,i=t.dispatchTransaction||this.dispatchTransaction.bind(this),r=s?this.extensionManager.dispatchTransaction(i):i,o=t.transformPastedHTML,l=this.extensionManager.transformPastedHTML(o);this.editorView=new dd(e,{...t,attributes:this.getEditorViewAttributes(),dispatchTransaction:r,transformPastedHTML:l,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const c=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(c),this.prependClass(),this.injectCSS();const d=this.view.dom;d.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(u=>{var p;return(p=this.capturedTransaction)===null||p===void 0?void 0:p.step(u)});return}const{state:t,transactions:s}=this.state.applyTransaction(e),i=!this.state.selection.eq(t.selection),r=s.includes(e),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!r)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:s.slice(1)}),i&&this.emit("selectionUpdate",{editor:this,transaction:e});const l=s.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),c=l==null?void 0:l.getMeta("focus"),d=l==null?void 0:l.getMeta("blur");c&&this.emit("focus",{editor:this,event:c.event,transaction:l}),d&&this.emit("blur",{editor:this,event:d.event,transaction:l}),!(e.getMeta("preventUpdate")||!s.some(u=>u.docChanged)||o.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:s.slice(1)})}getAttributes(e){return Rd(this.state,e)}isActive(e,t){const s=typeof e=="string"?e:null,i=typeof e=="string"?t:e;return Sk(this.state,s,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return xo(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=` +}`;var Wx=class extends rx{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document!="undefined"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:s})=>{throw s},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Ok,createMappablePosition:Nk},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:s,slice:i,moved:r})=>this.options.onDrop(s,i,r)),this.on("paste",({event:s,slice:i})=>this.options.onPaste(s,i)),this.on("delete",this.options.onDelete);const t=this.createDoc();if(!this.editorState){const s=Pr(t,this.options.autofocus);this.editorState=pt.create({doc:t,schema:this.schema,selection:s||void 0})}Hx(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document=="undefined")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;const e=this.editorView.dom;e!=null&&e.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():xn.createFakeChain()}can(){return this.commandManager?this.commandManager.can():xn.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document!="undefined"&&(this.css=yx(Ux,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const s=_r(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:s});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let s=t;if([].concat(e).forEach(r=>{const o=typeof r=="string"?`${r}$`:r.key;s=s.filter(l=>!l.key.startsWith(o))}),t.length===s.length)return;const i=this.state.reconfigure({plugins:s});return this.view.updateState(i),i}createExtensionManager(){var e,t;const s=[...this.options.enableCoreExtensions?[Px,Dx.configure({blockSeparator:(e=this.options.coreExtensionOptions)===null||e===void 0||(e=e.clipboardTextSerializer)===null||e===void 0?void 0:e.blockSeparator}),$x,_x,zx,Fx.configure({value:(t=this.options.coreExtensionOptions)===null||t===void 0||(t=t.tabindex)===null||t===void 0?void 0:t.value}),Lx,jx,Rx,Vx.configure({direction:this.options.textDirection})].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new Wi(s,this)}createCommandManager(){this.commandManager=new xn({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Br(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;const s=Br(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=pt.create({doc:s,schema:this.schema,selection:Pr(s,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(i=>i.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return e}getEditorViewAttributes(){var e;const t=(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes;return _r(t)?s=>({role:"textbox",...t(s)}):{role:"textbox",...t}}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:s}=this.options,i=t.dispatchTransaction||this.dispatchTransaction.bind(this),r=s?this.extensionManager.dispatchTransaction(i):i,o=t.transformPastedHTML,l=this.extensionManager.transformPastedHTML(o);this.editorView=new dd(e,{...t,attributes:this.getEditorViewAttributes(),dispatchTransaction:r,transformPastedHTML:l,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const c=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(c),this.prependClass(),this.injectCSS();const d=this.view.dom;d.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(u=>{var p;return(p=this.capturedTransaction)===null||p===void 0?void 0:p.step(u)});return}const{state:t,transactions:s}=this.state.applyTransaction(e),i=!this.state.selection.eq(t.selection),r=s.includes(e),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!r)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:s.slice(1)}),i&&this.emit("selectionUpdate",{editor:this,transaction:e});const l=s.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),c=l==null?void 0:l.getMeta("focus"),d=l==null?void 0:l.getMeta("blur");c&&this.emit("focus",{editor:this,event:c.event,transaction:l}),d&&this.emit("blur",{editor:this,event:d.event,transaction:l}),!(e.getMeta("preventUpdate")||!s.some(u=>u.docChanged)||o.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:s.slice(1)})}getAttributes(e){return Rd(this.state,e)}isActive(e,t){const s=typeof e=="string"?e:null,i=typeof e=="string"?t:e;return Ck(this.state,s,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return xo(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=` -`,textSerializers:s={}}=e||{};return gk(this.state.doc,{blockSeparator:t,textSerializers:{...$d(this.schema),...s}})}get isEmpty(){return vs(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return(e=(t=this.editorView)===null||t===void 0?void 0:t.isDestroyed)!==null&&e!==void 0?e:!0}$node(e,t){var s;return((s=this.$doc)===null||s===void 0?void 0:s.querySelector(e,t))||null}$nodes(e,t){var s;return((s=this.$doc)===null||s===void 0?void 0:s.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e),s=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new Hx(t,this,!1,s)}get $doc(){return this.$pos(0)}};function on(n){return new ks({find:n.find,handler:({state:e,range:t,match:s})=>{const i=se(n.getAttributes,void 0,s);if(i===!1||i===null)return null;const{tr:r}=e,o=s[s.length-1],l=s[0];if(o){const c=l.search(/\S/),d=t.from+l.indexOf(o),u=d+o.length;if(Ui(t.from,t.to,e.doc).filter(f=>f.mark.type.excluded.find(h=>h===n.type&&h!==f.mark.type)).filter(f=>f.to>d).length)return null;ut.from&&r.delete(t.from+c,d);const p=t.from+c+o.length;r.addMark(t.from+c,p,n.type.create(i||{})),r.removeStoredMark(n.type)}},undoable:n.undoable})}function Wx(n){return new ks({find:n.find,handler:({state:e,range:t,match:s})=>{const i=se(n.getAttributes,void 0,s)||{},{tr:r}=e,o=t.from;let l=t.to;const c=n.type.create(i);if(s[1]){let d=o+s[0].lastIndexOf(s[1]);d>l?d=l:l=d+s[1].length;const u=s[0][s[0].length-1];r.insertText(u,o+s[0].length-1),r.replaceWith(d,l,c)}else if(s[0]){const d=n.type.isInline?o:o-1;r.insert(d,n.type.create(i)).delete(r.mapping.map(o),r.mapping.map(l))}r.scrollIntoView()},undoable:n.undoable})}function jr(n){return new ks({find:n.find,handler:({state:e,range:t,match:s})=>{const i=e.doc.resolve(t.from),r=se(n.getAttributes,void 0,s)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,r)},undoable:n.undoable})}function On(n){return new ks({find:n.find,handler:({state:e,range:t,match:s,chain:i})=>{const r=se(n.getAttributes,void 0,s)||{},o=e.tr.delete(t.from,t.to),l=o.doc.resolve(t.from).blockRange(),c=l&&no(l,n.type,r);if(!c)return null;if(o.wrap(l,c),n.keepMarks&&n.editor){const{selection:u,storedMarks:p}=e,{splittableMarks:f}=n.editor.extensionManager,h=p||u.$to.parentOffset&&u.$from.marks();if(h){const g=h.filter(b=>f.includes(b.type.name));o.ensureMarks(g)}}if(n.keepAttributes){const u=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(u,r).run()}const d=o.doc.resolve(t.from-1).nodeBefore;d&&d.type===n.type&&_t(o.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(s,d))&&o.join(t.from-1)},undoable:n.undoable})}var Fe=class Yd extends Co{constructor(...e){super(...e),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new Yd(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function Pt(n){return new Jd({find:n.find,handler:({state:e,range:t,match:s,pasteEvent:i})=>{const r=se(n.getAttributes,void 0,s,i);if(r===!1||r===null)return null;const{tr:o}=e,l=s[s.length-1],c=s[0];let d=t.to;if(l){const u=c.search(/\S/),p=t.from+c.indexOf(l),f=p+l.length;if(Ui(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>p).length)return null;ft.from&&o.delete(t.from+u,p),d=t.from+u+l.length,o.addMark(t.from+u,d,n.type.create(r||{})),s.index!==void 0&&s.input!==void 0&&s.index+s[0].length>=s.input.length||o.removeStoredMark(n.type)}}})}function oa(n){return Ru((e,t)=>({get(){return e(),n},set(s){n=s,requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})}}))}var Kx=class extends Ux{constructor(n={}){return super(n),this.contentComponent=null,this.appContext=null,this.reactiveState=oa(this.view.state),this.reactiveExtensionStorage=oa(this.extensionStorage),this.on("beforeTransaction",({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),$u(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(n,e){const t=super.registerPlugin(n,e);return this.reactiveState&&(this.reactiveState.value=t),t}unregisterPlugin(n){const e=super.unregisterPlugin(n);return this.reactiveState&&e&&(this.reactiveState.value=e),e}};const Jx=Du({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(n){const e=P(),t=_u();return Pu(()=>{const s=n.editor;s&&s.options.element&&e.value&&Bu(()=>{var i;if(!e.value||!(!((i=s.view.dom)===null||i===void 0)&&i.parentNode))return;const r=j(e.value);e.value.append(...s.view.dom.parentNode.childNodes),s.contentComponent=t.ctx._,t&&(s.appContext={...t.appContext,provides:t.provides}),s.setOptions({element:r}),s.createNodeViews()})}),Bt(()=>{const s=n.editor;s&&(s.contentComponent=null,s.appContext=null)}),{rootEl:e}},render(){return Lu("div",{ref:n=>{this.rootEl=n}})}}),Xd=new WeakSet,Zd=new WeakSet;function Ht(n){const e=n;return Xd.add(e),e}function Fr(n){return Array.isArray(n)&&Xd.has(n)}function Qd(n){return n.flatMap(e=>e==null?[]:Array.isArray(e)&&Zd.has(e)&&!Fr(e)?Qd(e):[e])}function Gx(n,e){if(n==="slot")return 0;if(n instanceof Function){const i=n(e);return Array.isArray(i)&&!Fr(i)&&!Zd.has(i)?Ht(i):i}const{children:t,...s}=e!=null?e:{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(t)){if(Fr(t))return Ht([n,s,t]);if(t.length===0)return Ht([n,s]);const i=Qd(t);return i.length===0?Ht([n,s]):Ht([n,s,...i])}return t!=null?Ht([n,s,t]):Ht([n,s])}const si=(n,e)=>Gx(n,e),Yx=(n,e)=>{var t;const{state:s}=n,{selection:i}=s;if(!i.empty)return!1;const{$from:r}=i;if(r.parentOffset!==0)return!1;const o=r.depth-1;if(o<0)return!1;const l=r.node(o),c=r.index(o);if(c===0)return!1;if(l.type===e)return n.commands.lift(e.name);const d=l.child(c-1);if(d.type!==e||!(!((t=d.lastChild)===null||t===void 0)&&t.isTextblock))return!1;const u=r.before()-1-1;return n.commands.command(({tr:p,dispatch:f})=>{if(!f)return!0;const h=r.parent.content,g=new z(h,0,0);return p.replace(u,r.after(),g),p.setSelection(U.create(p.doc,u+h.size)),p.scrollIntoView(),f(p),!0})},Xx=/^\s*>\s$/,Zx=Fe.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return si("blockquote",{...ke(this.options.HTMLAttributes,n),children:si("slot",{})})},parseMarkdown:(n,e)=>{var t;const s=(t=e.parseBlockChildren)!==null&&t!==void 0?t:e.parseChildren;return e.createNode("blockquote",void 0,s(n.tokens||[]))},renderMarkdown:(n,e)=>{if(!n.content)return"";const t=">",s=[];return n.content.forEach((i,r)=>{var o,l;const c=((o=(l=e.renderChild)===null||l===void 0?void 0:l.call(e,i,r))!==null&&o!==void 0?o:e.renderChildren([i])).split(` +`,textSerializers:s={}}=e||{};return bk(this.state.doc,{blockSeparator:t,textSerializers:{...$d(this.schema),...s}})}get isEmpty(){return ys(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return(e=(t=this.editorView)===null||t===void 0?void 0:t.isDestroyed)!==null&&e!==void 0?e:!0}$node(e,t){var s;return((s=this.$doc)===null||s===void 0?void 0:s.querySelector(e,t))||null}$nodes(e,t){var s;return((s=this.$doc)===null||s===void 0?void 0:s.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e),s=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new qx(t,this,!1,s)}get $doc(){return this.$pos(0)}};function on(n){return new ks({find:n.find,handler:({state:e,range:t,match:s})=>{const i=se(n.getAttributes,void 0,s);if(i===!1||i===null)return null;const{tr:r}=e,o=s[s.length-1],l=s[0];if(o){const c=l.search(/\S/),d=t.from+l.indexOf(o),u=d+o.length;if(Ui(t.from,t.to,e.doc).filter(f=>f.mark.type.excluded.find(h=>h===n.type&&h!==f.mark.type)).filter(f=>f.to>d).length)return null;ut.from&&r.delete(t.from+c,d);const p=t.from+c+o.length;r.addMark(t.from+c,p,n.type.create(i||{})),r.removeStoredMark(n.type)}},undoable:n.undoable})}function Kx(n){return new ks({find:n.find,handler:({state:e,range:t,match:s})=>{const i=se(n.getAttributes,void 0,s)||{},{tr:r}=e,o=t.from;let l=t.to;const c=n.type.create(i);if(s[1]){let d=o+s[0].lastIndexOf(s[1]);d>l?d=l:l=d+s[1].length;const u=s[0][s[0].length-1];r.insertText(u,o+s[0].length-1),r.replaceWith(d,l,c)}else if(s[0]){const d=n.type.isInline?o:o-1;r.insert(d,n.type.create(i)).delete(r.mapping.map(o),r.mapping.map(l))}r.scrollIntoView()},undoable:n.undoable})}function jr(n){return new ks({find:n.find,handler:({state:e,range:t,match:s})=>{const i=e.doc.resolve(t.from),r=se(n.getAttributes,void 0,s)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,r)},undoable:n.undoable})}function On(n){return new ks({find:n.find,handler:({state:e,range:t,match:s,chain:i})=>{const r=se(n.getAttributes,void 0,s)||{},o=e.tr.delete(t.from,t.to),l=o.doc.resolve(t.from).blockRange(),c=l&&no(l,n.type,r);if(!c)return null;if(o.wrap(l,c),n.keepMarks&&n.editor){const{selection:u,storedMarks:p}=e,{splittableMarks:f}=n.editor.extensionManager,h=p||u.$to.parentOffset&&u.$from.marks();if(h){const g=h.filter(b=>f.includes(b.type.name));o.ensureMarks(g)}}if(n.keepAttributes){const u=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(u,r).run()}const d=o.doc.resolve(t.from-1).nodeBefore;d&&d.type===n.type&&_t(o.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(s,d))&&o.join(t.from-1)},undoable:n.undoable})}var Fe=class Yd extends Co{constructor(...e){super(...e),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new Yd(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function Pt(n){return new Jd({find:n.find,handler:({state:e,range:t,match:s,pasteEvent:i})=>{const r=se(n.getAttributes,void 0,s,i);if(r===!1||r===null)return null;const{tr:o}=e,l=s[s.length-1],c=s[0];let d=t.to;if(l){const u=c.search(/\S/),p=t.from+c.indexOf(l),f=p+l.length;if(Ui(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>p).length)return null;ft.from&&o.delete(t.from+u,p),d=t.from+u+l.length,o.addMark(t.from+u,d,n.type.create(r||{})),s.index!==void 0&&s.input!==void 0&&s.index+s[0].length>=s.input.length||o.removeStoredMark(n.type)}}})}function oa(n){return Ru((e,t)=>({get(){return e(),n},set(s){n=s,requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})}}))}var Jx=class extends Wx{constructor(n={}){return super(n),this.contentComponent=null,this.appContext=null,this.reactiveState=oa(this.view.state),this.reactiveExtensionStorage=oa(this.extensionStorage),this.on("beforeTransaction",({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),$u(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(n,e){const t=super.registerPlugin(n,e);return this.reactiveState&&(this.reactiveState.value=t),t}unregisterPlugin(n){const e=super.unregisterPlugin(n);return this.reactiveState&&e&&(this.reactiveState.value=e),e}};const Gx=Du({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(n){const e=P(),t=_u();return Pu(()=>{const s=n.editor;s&&s.options.element&&e.value&&Bu(()=>{var i;if(!e.value||!(!((i=s.view.dom)===null||i===void 0)&&i.parentNode))return;const r=j(e.value);e.value.append(...s.view.dom.parentNode.childNodes),s.contentComponent=t.ctx._,t&&(s.appContext={...t.appContext,provides:t.provides}),s.setOptions({element:r}),s.createNodeViews()})}),Bt(()=>{const s=n.editor;s&&(s.contentComponent=null,s.appContext=null)}),{rootEl:e}},render(){return Lu("div",{ref:n=>{this.rootEl=n}})}}),Xd=new WeakSet,Zd=new WeakSet;function Ht(n){const e=n;return Xd.add(e),e}function Fr(n){return Array.isArray(n)&&Xd.has(n)}function Qd(n){return n.flatMap(e=>e==null?[]:Array.isArray(e)&&Zd.has(e)&&!Fr(e)?Qd(e):[e])}function Yx(n,e){if(n==="slot")return 0;if(n instanceof Function){const i=n(e);return Array.isArray(i)&&!Fr(i)&&!Zd.has(i)?Ht(i):i}const{children:t,...s}=e!=null?e:{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(t)){if(Fr(t))return Ht([n,s,t]);if(t.length===0)return Ht([n,s]);const i=Qd(t);return i.length===0?Ht([n,s]):Ht([n,s,...i])}return t!=null?Ht([n,s,t]):Ht([n,s])}const si=(n,e)=>Yx(n,e),Xx=(n,e)=>{var t;const{state:s}=n,{selection:i}=s;if(!i.empty)return!1;const{$from:r}=i;if(r.parentOffset!==0)return!1;const o=r.depth-1;if(o<0)return!1;const l=r.node(o),c=r.index(o);if(c===0)return!1;if(l.type===e)return n.commands.lift(e.name);const d=l.child(c-1);if(d.type!==e||!(!((t=d.lastChild)===null||t===void 0)&&t.isTextblock))return!1;const u=r.before()-1-1;return n.commands.command(({tr:p,dispatch:f})=>{if(!f)return!0;const h=r.parent.content,g=new z(h,0,0);return p.replace(u,r.after(),g),p.setSelection(U.create(p.doc,u+h.size)),p.scrollIntoView(),f(p),!0})},Zx=/^\s*>\s$/,Qx=Fe.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return si("blockquote",{...ke(this.options.HTMLAttributes,n),children:si("slot",{})})},parseMarkdown:(n,e)=>{var t;const s=(t=e.parseBlockChildren)!==null&&t!==void 0?t:e.parseChildren;return e.createNode("blockquote",void 0,s(n.tokens||[]))},renderMarkdown:(n,e)=>{if(!n.content)return"";const t=">",s=[];return n.content.forEach((i,r)=>{var o,l;const c=((o=(l=e.renderChild)===null||l===void 0?void 0:l.call(e,i,r))!==null&&o!==void 0?o:e.renderChildren([i])).split(` `).map(d=>d.trim()===""?t:`${t} ${d}`);s.push(c.join(` `))}),s.join(` ${t} -`)},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>Yx(this.editor,this.type)}},addInputRules(){return[On({find:Xx,type:this.type})]}}),Qx=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,ew=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,tw=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,nw=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,sw=an.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return si("strong",{...ke(this.options.HTMLAttributes,n),children:si("slot",{})})},markdownTokenName:"strong",parseMarkdown:(n,e)=>e.applyMark("bold",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(n,e)=>`**${e.renderChildren(n)}**`,addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[on({find:Qx,type:this.type}),on({find:tw,type:this.type})]},addPasteRules(){return[Pt({find:ew,type:this.type}),Pt({find:nw,type:this.type})]}}),iw=n=>{const e=/`([^`]+)`(?!`)$/.exec(n);return!e||e.index>0&&n[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},rw=n=>{const e=/`([^`]+)`(?!`)/g,t=[];let s;for(;(s=e.exec(n))!==null;)s.index>0&&n[s.index-1]==="`"||t.push({index:s.index,text:s[0],replaceWith:s[1]});return t};function ow(n){const e=new Set((n.match(/`+/g)||[]).map(s=>s.length));let t=1;for(;e.has(t);)t+=1;return t}const lw=an.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",ke(this.options.HTMLAttributes,n),0]},markdownTokenName:"codespan",parseMarkdown:(n,e)=>e.applyMark("code",[{type:"text",text:n.text||""}]),renderMarkdown:(n,e,t)=>{var s;if(!n.content)return"";const i=typeof(t==null||(s=t.meta)===null||s===void 0?void 0:s.markText)=="string"?t.meta.markText:"",r="`".repeat(ow(i)),o=i.startsWith("`")||i.endsWith("`")?" ":"";return`${r}${o}${e.renderChildren(n.content)}${o}${r}`},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[on({find:iw,type:this.type})]},addPasteRules(){return[Pt({find:rw,type:this.type})]}}),ur=4,aw=/^```([a-z]+)?[\s\n]$/,cw=/^~~~([a-z]+)?[\s\n]$/,dw=Fe.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:ur,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options;if(!t)return null;const s=[...((e=n.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(i=>i.startsWith(t)).map(i=>i.replace(t,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",ke(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(n,e)=>{var t,s;return((t=n.raw)===null||t===void 0?void 0:t.startsWith("```"))===!1&&((s=n.raw)===null||s===void 0?void 0:s.startsWith("~~~"))===!1&&n.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:n.lang||null},n.text?[e.createTextNode(n.text)]:[])},renderMarkdown:(n,e)=>{var t;let s="";const i=((t=n.attrs)===null||t===void 0?void 0:t.language)||"";return n.content?s=[`\`\`\`${i}`,e.renderChildren(n.content),"```"].join(` +`)},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>Xx(this.editor,this.type)}},addInputRules(){return[On({find:Zx,type:this.type})]}}),ew=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,tw=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,nw=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,sw=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,iw=an.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return si("strong",{...ke(this.options.HTMLAttributes,n),children:si("slot",{})})},markdownTokenName:"strong",parseMarkdown:(n,e)=>e.applyMark("bold",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(n,e)=>`**${e.renderChildren(n)}**`,addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[on({find:ew,type:this.type}),on({find:nw,type:this.type})]},addPasteRules(){return[Pt({find:tw,type:this.type}),Pt({find:sw,type:this.type})]}}),rw=n=>{const e=/`([^`]+)`(?!`)$/.exec(n);return!e||e.index>0&&n[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},ow=n=>{const e=/`([^`]+)`(?!`)/g,t=[];let s;for(;(s=e.exec(n))!==null;)s.index>0&&n[s.index-1]==="`"||t.push({index:s.index,text:s[0],replaceWith:s[1]});return t};function lw(n){const e=new Set((n.match(/`+/g)||[]).map(s=>s.length));let t=1;for(;e.has(t);)t+=1;return t}const aw=an.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",ke(this.options.HTMLAttributes,n),0]},markdownTokenName:"codespan",parseMarkdown:(n,e)=>e.applyMark("code",[{type:"text",text:n.text||""}]),renderMarkdown:(n,e,t)=>{var s;if(!n.content)return"";const i=typeof(t==null||(s=t.meta)===null||s===void 0?void 0:s.markText)=="string"?t.meta.markText:"",r="`".repeat(lw(i)),o=i.startsWith("`")||i.endsWith("`")?" ":"";return`${r}${o}${e.renderChildren(n.content)}${o}${r}`},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[on({find:rw,type:this.type})]},addPasteRules(){return[Pt({find:ow,type:this.type})]}}),ur=4,cw=/^```([a-z]+)?[\s\n]$/,dw=/^~~~([a-z]+)?[\s\n]$/,uw=Fe.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:ur,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options;if(!t)return null;const s=[...((e=n.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(i=>i.startsWith(t)).map(i=>i.replace(t,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",ke(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(n,e)=>{var t,s;return((t=n.raw)===null||t===void 0?void 0:t.startsWith("```"))===!1&&((s=n.raw)===null||s===void 0?void 0:s.startsWith("~~~"))===!1&&n.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:n.lang||null},n.text?[e.createTextNode(n.text)]:[])},renderMarkdown:(n,e)=>{var t;let s="";const i=((t=n.attrs)===null||t===void 0?void 0:t.language)||"";return n.content?s=[`\`\`\`${i}`,e.renderChildren(n.content),"```"].join(` `):s=`\`\`\`${i} \`\`\``,s},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!==null&&e!==void 0?e:ur,{state:s}=n,{selection:i}=s,{$from:r,empty:o}=i;if(r.parent.type!==this.type)return!1;const l=" ".repeat(t);return o?n.commands.insertContent(l):n.commands.command(({tr:c})=>{const{from:d,to:u}=i,p=s.doc.textBetween(d,u,` @@ -113,34 +113,34 @@ ${t} `);return c.replaceWith(d,u,s.schema.text(p)),!0})},"Shift-Tab":({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!==null&&e!==void 0?e:ur,{state:s}=n,{selection:i}=s,{$from:r,empty:o}=i;return r.parent.type!==this.type?!1:o?n.commands.command(({tr:l})=>{var c;const{pos:d}=r,u=r.start(),p=r.end(),f=s.doc.textBetween(u,p,` `,` `).split(` -`);let h=0,g=0;const b=d-u;for(let A=0;A=b){h=A;break}g+=f[A].length+1}const m=((c=f[h].match(/^ */))===null||c===void 0?void 0:c[0])||"",y=Math.min(m.length,t);if(y===0)return!0;let S=u;for(let A=0;A{const{from:c,to:d}=i,u=s.doc.textBetween(c,d,` +`);let h=0,g=0;const b=d-u;for(let A=0;A=b){h=A;break}g+=f[A].length+1}const m=((c=f[h].match(/^ */))===null||c===void 0?void 0:c[0])||"",v=Math.min(m.length,t);if(v===0)return!0;let S=u;for(let A=0;A{const{from:c,to:d}=i,u=s.doc.textBetween(c,d,` `,` `).split(` `).map(p=>{var f;const h=((f=p.match(/^ */))===null||f===void 0?void 0:f[0])||"",g=Math.min(h.length,t);return p.slice(g)}).join(` `);return l.replaceWith(c,d,s.schema.text(u)),!0})},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:s,empty:i}=t;if(!i||s.parent.type!==this.type)return!1;const r=s.parentOffset===s.parent.nodeSize-2,o=s.parent.textContent.endsWith(` -`);return!r||!o?!1:n.chain().command(({tr:l})=>(l.delete(s.pos-2,s.pos),!0)).exitCode().run()},ArrowUp:({editor:n})=>{if(!this.options.exitOnArrowUp)return!1;const{state:e}=n,{selection:t}=e,{$from:s,empty:i}=t;if(!i||s.parent.type!==this.type||s.parentOffset!==0)return!1;const r=s.before();return r>0?!1:n.commands.insertDefaultBlock({pos:r})},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:s}=e,{$from:i,empty:r}=t;if(!r||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;const o=i.after();return o===void 0?!1:s.nodeAt(o)?n.commands.command(({tr:l})=>(l.setSelection(X.near(s.resolve(o))),!0)):n.commands.exitCode()}}},addInputRules(){return[jr({find:aw,type:this.type,getAttributes:n=>({language:n[1]})}),jr({find:cw,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new oe({key:new me("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),s=e.clipboardData.getData("vscode-editor-data"),i=s?JSON.parse(s):void 0,r=i==null?void 0:i.mode;if(!t||!r)return!1;const{tr:o,schema:l}=n.state,c=l.text(t.replace(/\r\n?/g,` -`));return o.replaceSelectionWith(this.type.create({language:r},c)),o.selection.$from.parent.type!==this.type&&o.setSelection(U.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),n.dispatch(o),!0}}})]}}),uw=Fe.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` +`);return!r||!o?!1:n.chain().command(({tr:l})=>(l.delete(s.pos-2,s.pos),!0)).exitCode().run()},ArrowUp:({editor:n})=>{if(!this.options.exitOnArrowUp)return!1;const{state:e}=n,{selection:t}=e,{$from:s,empty:i}=t;if(!i||s.parent.type!==this.type||s.parentOffset!==0)return!1;const r=s.before();return r>0?!1:n.commands.insertDefaultBlock({pos:r})},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:s}=e,{$from:i,empty:r}=t;if(!r||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;const o=i.after();return o===void 0?!1:s.nodeAt(o)?n.commands.command(({tr:l})=>(l.setSelection(X.near(s.resolve(o))),!0)):n.commands.exitCode()}}},addInputRules(){return[jr({find:cw,type:this.type,getAttributes:n=>({language:n[1]})}),jr({find:dw,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new oe({key:new me("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),s=e.clipboardData.getData("vscode-editor-data"),i=s?JSON.parse(s):void 0,r=i==null?void 0:i.mode;if(!t||!r)return!1;const{tr:o,schema:l}=n.state,c=l.text(t.replace(/\r\n?/g,` +`));return o.replaceSelectionWith(this.type.create({language:r},c)),o.selection.$from.parent.type!==this.type&&o.setSelection(U.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),n.dispatch(o),!0}}})]}}),pw=Fe.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` -`):""}),pw=Fe.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",ke(this.options.HTMLAttributes,n)]},renderText(){return` +`):""}),fw=Fe.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",ke(this.options.HTMLAttributes,n)]},renderText(){return` `},renderMarkdown:()=>` -`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:s})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:r}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=s.extensionManager,c=r||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&o){const p=c.filter(f=>l.includes(f.type.name));d.ensureMarks(p)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),fw=Fe.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,ke(this.options.HTMLAttributes,e),0]},parseMarkdown:(n,e)=>e.createNode("heading",{level:n.depth||1},e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>{var t;const s=!((t=n.attrs)===null||t===void 0)&&t.level?parseInt(n.attrs.level,10):1,i="#".repeat(s);return n.content?`${i} ${e.renderChildren(n.content)}`:""},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>jr({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),hw=Fe.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",ke(this.options.HTMLAttributes,n)]},markdownTokenName:"hr",parseMarkdown:(n,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{if(!bx(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$to:s}=t,i=n();return Ld(t)?i.insertContentAt(s.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:r,tr:o,dispatch:l})=>{if(l){const{$to:c}=o.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?o.setSelection(U.create(o.doc,c.pos+1)):c.nodeAfter.isBlock?o.setSelection(W.create(o.doc,c.pos)):o.setSelection(U.create(o.doc,c.pos));else{const u=r.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,p=u==null?void 0:u.create();p&&(o.insert(d,p),o.setSelection(U.create(o.doc,d+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Wx({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),mw=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,gw=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,bw=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,yw=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,vw=an.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",ke(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(n,e)=>e.applyMark("italic",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(n,e)=>`*${e.renderChildren(n)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[on({find:mw,type:this.type}),on({find:bw,type:this.type})]},addPasteRules(){return[Pt({find:gw,type:this.type}),Pt({find:yw,type:this.type})]}}),kw="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",xw="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Vr="numeric",Hr="ascii",qr="alpha",Kn="asciinumeric",Fn="alphanumeric",Ur="domain",eu="emoji",ww="scheme",Sw="slashscheme",pr="whitespace";function Cw(n,e){return n in e||(e[n]=[]),e[n]}function Jt(n,e,t){e[Vr]&&(e[Kn]=!0,e[Fn]=!0),e[Hr]&&(e[Kn]=!0,e[qr]=!0),e[Kn]&&(e[Fn]=!0),e[qr]&&(e[Fn]=!0),e[Fn]&&(e[Ur]=!0),e[eu]&&(e[Ur]=!0);for(const s in e){const i=Cw(s,t);i.indexOf(n)<0&&i.push(n)}}function Mw(n,e){const t={};for(const s in e)e[s].indexOf(n)>=0&&(t[s]=!0);return t}function _e(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}_e.groups={};_e.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let s=0;sn.ta(e,t,s,i),ce=(n,e,t,s,i)=>n.tr(e,t,s,i),la=(n,e,t,s,i)=>n.ts(e,t,s,i),L=(n,e,t,s,i)=>n.tt(e,t,s,i),dt="WORD",Wr="UWORD",tu="ASCIINUMERICAL",nu="ALPHANUMERICAL",ps="LOCALHOST",Kr="TLD",Jr="UTLD",Hs="SCHEME",yn="SLASH_SCHEME",Mo="NUM",Gr="WS",To="NL",Jn="OPENBRACE",Gn="CLOSEBRACE",ii="OPENBRACKET",ri="CLOSEBRACKET",oi="OPENPAREN",li="CLOSEPAREN",ai="OPENANGLEBRACKET",ci="CLOSEANGLEBRACKET",di="FULLWIDTHLEFTPAREN",ui="FULLWIDTHRIGHTPAREN",pi="LEFTCORNERBRACKET",fi="RIGHTCORNERBRACKET",hi="LEFTWHITECORNERBRACKET",mi="RIGHTWHITECORNERBRACKET",gi="FULLWIDTHLESSTHAN",bi="FULLWIDTHGREATERTHAN",yi="AMPERSAND",vi="APOSTROPHE",ki="ASTERISK",Ct="AT",xi="BACKSLASH",wi="BACKTICK",Si="CARET",Gt="COLON",Eo="COMMA",Ci="DOLLAR",tt="DOT",Mi="EQUALS",Ao="EXCLAMATION",Ke="HYPHEN",Yn="PERCENT",Ti="PIPE",Ei="PLUS",Ai="POUND",Xn="QUERY",Oo="QUOTE",su="FULLWIDTHMIDDLEDOT",No="SEMI",nt="SLASH",Zn="TILDE",Oi="UNDERSCORE",iu="EMOJI",Ni="SYM";var ru=Object.freeze({__proto__:null,ALPHANUMERICAL:nu,AMPERSAND:yi,APOSTROPHE:vi,ASCIINUMERICAL:tu,ASTERISK:ki,AT:Ct,BACKSLASH:xi,BACKTICK:wi,CARET:Si,CLOSEANGLEBRACKET:ci,CLOSEBRACE:Gn,CLOSEBRACKET:ri,CLOSEPAREN:li,COLON:Gt,COMMA:Eo,DOLLAR:Ci,DOT:tt,EMOJI:iu,EQUALS:Mi,EXCLAMATION:Ao,FULLWIDTHGREATERTHAN:bi,FULLWIDTHLEFTPAREN:di,FULLWIDTHLESSTHAN:gi,FULLWIDTHMIDDLEDOT:su,FULLWIDTHRIGHTPAREN:ui,HYPHEN:Ke,LEFTCORNERBRACKET:pi,LEFTWHITECORNERBRACKET:hi,LOCALHOST:ps,NL:To,NUM:Mo,OPENANGLEBRACKET:ai,OPENBRACE:Jn,OPENBRACKET:ii,OPENPAREN:oi,PERCENT:Yn,PIPE:Ti,PLUS:Ei,POUND:Ai,QUERY:Xn,QUOTE:Oo,RIGHTCORNERBRACKET:fi,RIGHTWHITECORNERBRACKET:mi,SCHEME:Hs,SEMI:No,SLASH:nt,SLASH_SCHEME:yn,SYM:Ni,TILDE:Zn,TLD:Kr,UNDERSCORE:Oi,UTLD:Jr,UWORD:Wr,WORD:dt,WS:Gr});const lt=/[a-z]/,Pn=/\p{L}/u,fr=/\p{Emoji}/u,at=/\d/,hr=/\s/,aa="\r",mr=` -`,Tw="️",Ew="‍",gr="";let Ds=null,$s=null;function Aw(n=[]){const e={};_e.groups=e;const t=new _e;Ds==null&&(Ds=ca(kw)),$s==null&&($s=ca(xw)),L(t,"'",vi),L(t,"{",Jn),L(t,"}",Gn),L(t,"[",ii),L(t,"]",ri),L(t,"(",oi),L(t,")",li),L(t,"<",ai),L(t,">",ci),L(t,"(",di),L(t,")",ui),L(t,"「",pi),L(t,"」",fi),L(t,"『",hi),L(t,"』",mi),L(t,"<",gi),L(t,">",bi),L(t,"&",yi),L(t,"*",ki),L(t,"@",Ct),L(t,"`",wi),L(t,"^",Si),L(t,":",Gt),L(t,",",Eo),L(t,"$",Ci),L(t,".",tt),L(t,"=",Mi),L(t,"!",Ao),L(t,"-",Ke),L(t,"%",Yn),L(t,"|",Ti),L(t,"+",Ei),L(t,"#",Ai),L(t,"?",Xn),L(t,'"',Oo),L(t,"/",nt),L(t,";",No),L(t,"~",Zn),L(t,"_",Oi),L(t,"\\",xi),L(t,"・",su);const s=ce(t,at,Mo,{[Vr]:!0});ce(s,at,s);const i=ce(s,lt,tu,{[Kn]:!0}),r=ce(s,Pn,nu,{[Fn]:!0}),o=ce(t,lt,dt,{[Hr]:!0});ce(o,at,i),ce(o,lt,o),ce(i,at,i),ce(i,lt,i);const l=ce(t,Pn,Wr,{[qr]:!0});ce(l,lt),ce(l,at,r),ce(l,Pn,l),ce(r,at,r),ce(r,lt),ce(r,Pn,r);const c=L(t,mr,To,{[pr]:!0}),d=L(t,aa,Gr,{[pr]:!0}),u=ce(t,hr,Gr,{[pr]:!0});L(t,gr,u),L(d,mr,c),L(d,gr,u),ce(d,hr,u),L(u,aa),L(u,mr),ce(u,hr,u),L(u,gr,u);const p=ce(t,fr,iu,{[eu]:!0});L(p,"#"),ce(p,fr,p),L(p,Tw,p);const f=L(p,Ew);L(f,"#"),ce(f,fr,p);const h=[[lt,o],[at,i]],g=[[lt,null],[Pn,l],[at,r]];for(let b=0;bb[0]>m[0]?1:-1);for(let b=0;b=0?S[Ur]=!0:lt.test(m)?at.test(m)?S[Kn]=!0:S[Hr]=!0:S[Vr]=!0,la(t,m,m,S)}return la(t,"localhost",ps,{ascii:!0}),t.jd=new _e(Ni),{start:t,tokens:Object.assign({groups:e},ru)}}function ou(n,e){const t=Ow(e.replace(/[A-Z]/g,l=>l.toLowerCase())),s=t.length,i=[];let r=0,o=0;for(;o=0&&(p+=t[o].length,f++),d+=t[o].length,r+=t[o].length,o++;r-=p,o-=f,d-=p,i.push({t:u.t,v:e.slice(r-d,r),s:r-d,e:r})}return i}function Ow(n){const e=[],t=n.length;let s=0;for(;s56319||s+1===t||(r=n.charCodeAt(s+1))<56320||r>57343?n[s]:n.slice(s,s+2);e.push(o),s+=o.length}return e}function kt(n,e,t,s,i){let r;const o=e.length;for(let l=0;l=0;)r++;if(r>0){e.push(t.join(""));for(let o=parseInt(n.substring(s,s+r),10);o>0;o--)t.pop();s+=r}else t.push(n[s]),s++}return e}const fs={defaultProtocol:"http",events:null,format:da,formatHref:da,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Io(n,e=null){let t=Object.assign({},fs);n&&(t=Object.assign(t,n instanceof Io?n.o:n));const s=t.ignoreTags,i=[];for(let r=0;rt?s.substring(0,t)+"…":s},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=fs.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),s=n.get("formatHref",t,this),i=n.get("tagName",t,e),r=this.toFormattedString(n),o={},l=n.get("className",t,e),c=n.get("target",t,e),d=n.get("rel",t,e),u=n.getObj("attributes",t,e),p=n.getObj("events",t,e);return o.href=s,l&&(o.class=l),c&&(o.target=c),d&&(o.rel=d),u&&Object.assign(o,u),{tagName:i,attributes:o,content:r,eventListeners:p}}};function Ki(n,e){class t extends lu{constructor(i,r){super(i,r),this.t=n}}for(const s in e)t.prototype[s]=e[s];return t.t=n,t}const Nw=Ki("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ua=Ki("text"),Iw=Ki("nl"),Rs=Ki("url",{isLink:!0,toHref(n=fs.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==ps&&n[1].t===Gt}}),We=n=>new _e(n);function Dw({groups:n}){const e=n.domain.concat([yi,ki,Ct,xi,wi,Si,Ci,Mi,Ke,Mo,Yn,Ti,Ei,Ai,nt,Ni,Zn,Oi]),t=[vi,Gt,Eo,tt,Ao,Yn,Xn,Oo,No,ai,ci,Jn,Gn,ri,ii,oi,li,di,ui,pi,fi,hi,mi,gi,bi],s=[yi,vi,ki,xi,wi,Si,Ci,Mi,Ke,Jn,Gn,Yn,Ti,Ei,Ai,Xn,nt,Ni,Zn,Oi],i=We(),r=L(i,Zn);Q(r,s,r),Q(r,n.domain,r);const o=We(),l=We(),c=We();Q(i,n.domain,o),Q(i,n.scheme,l),Q(i,n.slashscheme,c),Q(o,s,r),Q(o,n.domain,o);const d=L(o,Ct);L(r,Ct,d),L(l,Ct,d),L(c,Ct,d);const u=L(r,tt);Q(u,s,r),Q(u,n.domain,r);const p=We();Q(d,n.domain,p),Q(p,n.domain,p);const f=L(p,tt);Q(f,n.domain,p);const h=We(Nw);Q(f,n.tld,h),Q(f,n.utld,h),L(d,ps,h);const g=L(p,Ke);L(g,Ke,g),Q(g,n.domain,p),Q(h,n.domain,p),L(h,tt,f),L(h,Ke,g);const b=L(o,Ke),m=L(o,tt);L(b,Ke,b),Q(b,n.domain,o),Q(m,s,r),Q(m,n.domain,o);const y=We(Rs);Q(m,n.tld,y),Q(m,n.utld,y),Q(y,n.domain,o),Q(y,s,r),L(y,tt,m),L(y,Ke,b),L(y,Ct,d);const S=L(y,Gt),A=We(Rs);Q(S,n.numeric,A);const O=We(Rs),B=We();Q(O,e,O),Q(O,t,B),Q(B,e,O),Q(B,t,B),L(y,nt,O),L(A,nt,O);const E=L(l,Gt),M=L(c,Gt),w=L(M,nt),T=L(w,nt);Q(l,n.domain,o),L(l,tt,m),L(l,Ke,b),Q(c,n.domain,o),L(c,tt,m),L(c,Ke,b),Q(E,n.domain,O),L(E,nt,O),L(E,Xn,O),Q(T,n.domain,O),Q(T,e,O),L(T,nt,O);const N=[[Jn,Gn],[ii,ri],[oi,li],[ai,ci],[di,ui],[pi,fi],[hi,mi],[gi,bi]];for(let I=0;I=0&&f++,i++,u++;if(f<0)i-=u,i0&&(r.push(br(ua,e,o)),o=[]),i-=f,u-=f;const h=p.t,g=t.slice(i-u,i);r.push(br(h,e,g))}}return o.length>0&&r.push(br(ua,e,o)),r}function br(n,e,t){const s=t[0].s,i=t[t.length-1].e,r=e.slice(s,i);return new n(r,t)}const Rw=typeof console!="undefined"&&console&&console.warn||(()=>{}),Lw="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",re={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Pw(){return _e.groups={},re.scanner=null,re.parser=null,re.tokenQueue=[],re.pluginQueue=[],re.customSchemes=[],re.initialized=!1,re}function pa(n,e=!1){if(re.initialized&&Rw(`linkifyjs: already initialized - will not register custom scheme "${n}" ${Lw}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format. +`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:s})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:r}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=s.extensionManager,c=r||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&o){const p=c.filter(f=>l.includes(f.type.name));d.ensureMarks(p)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),hw=Fe.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,ke(this.options.HTMLAttributes,e),0]},parseMarkdown:(n,e)=>e.createNode("heading",{level:n.depth||1},e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>{var t;const s=!((t=n.attrs)===null||t===void 0)&&t.level?parseInt(n.attrs.level,10):1,i="#".repeat(s);return n.content?`${i} ${e.renderChildren(n.content)}`:""},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>jr({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),mw=Fe.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",ke(this.options.HTMLAttributes,n)]},markdownTokenName:"hr",parseMarkdown:(n,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{if(!vx(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$to:s}=t,i=n();return Ld(t)?i.insertContentAt(s.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:r,tr:o,dispatch:l})=>{if(l){const{$to:c}=o.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?o.setSelection(U.create(o.doc,c.pos+1)):c.nodeAfter.isBlock?o.setSelection(W.create(o.doc,c.pos)):o.setSelection(U.create(o.doc,c.pos));else{const u=r.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,p=u==null?void 0:u.create();p&&(o.insert(d,p),o.setSelection(U.create(o.doc,d+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Kx({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),gw=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,bw=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,vw=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,yw=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,kw=an.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",ke(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(n,e)=>e.applyMark("italic",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(n,e)=>`*${e.renderChildren(n)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[on({find:gw,type:this.type}),on({find:vw,type:this.type})]},addPasteRules(){return[Pt({find:bw,type:this.type}),Pt({find:yw,type:this.type})]}}),xw="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",ww="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Vr="numeric",Hr="ascii",qr="alpha",Jn="asciinumeric",Vn="alphanumeric",Ur="domain",eu="emoji",Sw="scheme",Cw="slashscheme",pr="whitespace";function Mw(n,e){return n in e||(e[n]=[]),e[n]}function Jt(n,e,t){e[Vr]&&(e[Jn]=!0,e[Vn]=!0),e[Hr]&&(e[Jn]=!0,e[qr]=!0),e[Jn]&&(e[Vn]=!0),e[qr]&&(e[Vn]=!0),e[Vn]&&(e[Ur]=!0),e[eu]&&(e[Ur]=!0);for(const s in e){const i=Mw(s,t);i.indexOf(n)<0&&i.push(n)}}function Tw(n,e){const t={};for(const s in e)e[s].indexOf(n)>=0&&(t[s]=!0);return t}function _e(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}_e.groups={};_e.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let s=0;sn.ta(e,t,s,i),ce=(n,e,t,s,i)=>n.tr(e,t,s,i),la=(n,e,t,s,i)=>n.ts(e,t,s,i),L=(n,e,t,s,i)=>n.tt(e,t,s,i),dt="WORD",Wr="UWORD",tu="ASCIINUMERICAL",nu="ALPHANUMERICAL",fs="LOCALHOST",Kr="TLD",Jr="UTLD",Hs="SCHEME",vn="SLASH_SCHEME",Mo="NUM",Gr="WS",To="NL",Gn="OPENBRACE",Yn="CLOSEBRACE",ii="OPENBRACKET",ri="CLOSEBRACKET",oi="OPENPAREN",li="CLOSEPAREN",ai="OPENANGLEBRACKET",ci="CLOSEANGLEBRACKET",di="FULLWIDTHLEFTPAREN",ui="FULLWIDTHRIGHTPAREN",pi="LEFTCORNERBRACKET",fi="RIGHTCORNERBRACKET",hi="LEFTWHITECORNERBRACKET",mi="RIGHTWHITECORNERBRACKET",gi="FULLWIDTHLESSTHAN",bi="FULLWIDTHGREATERTHAN",vi="AMPERSAND",yi="APOSTROPHE",ki="ASTERISK",Ct="AT",xi="BACKSLASH",wi="BACKTICK",Si="CARET",Gt="COLON",Eo="COMMA",Ci="DOLLAR",tt="DOT",Mi="EQUALS",Ao="EXCLAMATION",Ke="HYPHEN",Xn="PERCENT",Ti="PIPE",Ei="PLUS",Ai="POUND",Zn="QUERY",Oo="QUOTE",su="FULLWIDTHMIDDLEDOT",No="SEMI",nt="SLASH",Qn="TILDE",Oi="UNDERSCORE",iu="EMOJI",Ni="SYM";var ru=Object.freeze({__proto__:null,ALPHANUMERICAL:nu,AMPERSAND:vi,APOSTROPHE:yi,ASCIINUMERICAL:tu,ASTERISK:ki,AT:Ct,BACKSLASH:xi,BACKTICK:wi,CARET:Si,CLOSEANGLEBRACKET:ci,CLOSEBRACE:Yn,CLOSEBRACKET:ri,CLOSEPAREN:li,COLON:Gt,COMMA:Eo,DOLLAR:Ci,DOT:tt,EMOJI:iu,EQUALS:Mi,EXCLAMATION:Ao,FULLWIDTHGREATERTHAN:bi,FULLWIDTHLEFTPAREN:di,FULLWIDTHLESSTHAN:gi,FULLWIDTHMIDDLEDOT:su,FULLWIDTHRIGHTPAREN:ui,HYPHEN:Ke,LEFTCORNERBRACKET:pi,LEFTWHITECORNERBRACKET:hi,LOCALHOST:fs,NL:To,NUM:Mo,OPENANGLEBRACKET:ai,OPENBRACE:Gn,OPENBRACKET:ii,OPENPAREN:oi,PERCENT:Xn,PIPE:Ti,PLUS:Ei,POUND:Ai,QUERY:Zn,QUOTE:Oo,RIGHTCORNERBRACKET:fi,RIGHTWHITECORNERBRACKET:mi,SCHEME:Hs,SEMI:No,SLASH:nt,SLASH_SCHEME:vn,SYM:Ni,TILDE:Qn,TLD:Kr,UNDERSCORE:Oi,UTLD:Jr,UWORD:Wr,WORD:dt,WS:Gr});const lt=/[a-z]/,Bn=/\p{L}/u,fr=/\p{Emoji}/u,at=/\d/,hr=/\s/,aa="\r",mr=` +`,Ew="️",Aw="‍",gr="";let Ds=null,$s=null;function Ow(n=[]){const e={};_e.groups=e;const t=new _e;Ds==null&&(Ds=ca(xw)),$s==null&&($s=ca(ww)),L(t,"'",yi),L(t,"{",Gn),L(t,"}",Yn),L(t,"[",ii),L(t,"]",ri),L(t,"(",oi),L(t,")",li),L(t,"<",ai),L(t,">",ci),L(t,"(",di),L(t,")",ui),L(t,"「",pi),L(t,"」",fi),L(t,"『",hi),L(t,"』",mi),L(t,"<",gi),L(t,">",bi),L(t,"&",vi),L(t,"*",ki),L(t,"@",Ct),L(t,"`",wi),L(t,"^",Si),L(t,":",Gt),L(t,",",Eo),L(t,"$",Ci),L(t,".",tt),L(t,"=",Mi),L(t,"!",Ao),L(t,"-",Ke),L(t,"%",Xn),L(t,"|",Ti),L(t,"+",Ei),L(t,"#",Ai),L(t,"?",Zn),L(t,'"',Oo),L(t,"/",nt),L(t,";",No),L(t,"~",Qn),L(t,"_",Oi),L(t,"\\",xi),L(t,"・",su);const s=ce(t,at,Mo,{[Vr]:!0});ce(s,at,s);const i=ce(s,lt,tu,{[Jn]:!0}),r=ce(s,Bn,nu,{[Vn]:!0}),o=ce(t,lt,dt,{[Hr]:!0});ce(o,at,i),ce(o,lt,o),ce(i,at,i),ce(i,lt,i);const l=ce(t,Bn,Wr,{[qr]:!0});ce(l,lt),ce(l,at,r),ce(l,Bn,l),ce(r,at,r),ce(r,lt),ce(r,Bn,r);const c=L(t,mr,To,{[pr]:!0}),d=L(t,aa,Gr,{[pr]:!0}),u=ce(t,hr,Gr,{[pr]:!0});L(t,gr,u),L(d,mr,c),L(d,gr,u),ce(d,hr,u),L(u,aa),L(u,mr),ce(u,hr,u),L(u,gr,u);const p=ce(t,fr,iu,{[eu]:!0});L(p,"#"),ce(p,fr,p),L(p,Ew,p);const f=L(p,Aw);L(f,"#"),ce(f,fr,p);const h=[[lt,o],[at,i]],g=[[lt,null],[Bn,l],[at,r]];for(let b=0;bb[0]>m[0]?1:-1);for(let b=0;b=0?S[Ur]=!0:lt.test(m)?at.test(m)?S[Jn]=!0:S[Hr]=!0:S[Vr]=!0,la(t,m,m,S)}return la(t,"localhost",fs,{ascii:!0}),t.jd=new _e(Ni),{start:t,tokens:Object.assign({groups:e},ru)}}function ou(n,e){const t=Nw(e.replace(/[A-Z]/g,l=>l.toLowerCase())),s=t.length,i=[];let r=0,o=0;for(;o=0&&(p+=t[o].length,f++),d+=t[o].length,r+=t[o].length,o++;r-=p,o-=f,d-=p,i.push({t:u.t,v:e.slice(r-d,r),s:r-d,e:r})}return i}function Nw(n){const e=[],t=n.length;let s=0;for(;s56319||s+1===t||(r=n.charCodeAt(s+1))<56320||r>57343?n[s]:n.slice(s,s+2);e.push(o),s+=o.length}return e}function kt(n,e,t,s,i){let r;const o=e.length;for(let l=0;l=0;)r++;if(r>0){e.push(t.join(""));for(let o=parseInt(n.substring(s,s+r),10);o>0;o--)t.pop();s+=r}else t.push(n[s]),s++}return e}const hs={defaultProtocol:"http",events:null,format:da,formatHref:da,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Io(n,e=null){let t=Object.assign({},hs);n&&(t=Object.assign(t,n instanceof Io?n.o:n));const s=t.ignoreTags,i=[];for(let r=0;rt?s.substring(0,t)+"…":s},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=hs.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),s=n.get("formatHref",t,this),i=n.get("tagName",t,e),r=this.toFormattedString(n),o={},l=n.get("className",t,e),c=n.get("target",t,e),d=n.get("rel",t,e),u=n.getObj("attributes",t,e),p=n.getObj("events",t,e);return o.href=s,l&&(o.class=l),c&&(o.target=c),d&&(o.rel=d),u&&Object.assign(o,u),{tagName:i,attributes:o,content:r,eventListeners:p}}};function Ki(n,e){class t extends lu{constructor(i,r){super(i,r),this.t=n}}for(const s in e)t.prototype[s]=e[s];return t.t=n,t}const Iw=Ki("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ua=Ki("text"),Dw=Ki("nl"),Rs=Ki("url",{isLink:!0,toHref(n=hs.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==fs&&n[1].t===Gt}}),We=n=>new _e(n);function $w({groups:n}){const e=n.domain.concat([vi,ki,Ct,xi,wi,Si,Ci,Mi,Ke,Mo,Xn,Ti,Ei,Ai,nt,Ni,Qn,Oi]),t=[yi,Gt,Eo,tt,Ao,Xn,Zn,Oo,No,ai,ci,Gn,Yn,ri,ii,oi,li,di,ui,pi,fi,hi,mi,gi,bi],s=[vi,yi,ki,xi,wi,Si,Ci,Mi,Ke,Gn,Yn,Xn,Ti,Ei,Ai,Zn,nt,Ni,Qn,Oi],i=We(),r=L(i,Qn);Q(r,s,r),Q(r,n.domain,r);const o=We(),l=We(),c=We();Q(i,n.domain,o),Q(i,n.scheme,l),Q(i,n.slashscheme,c),Q(o,s,r),Q(o,n.domain,o);const d=L(o,Ct);L(r,Ct,d),L(l,Ct,d),L(c,Ct,d);const u=L(r,tt);Q(u,s,r),Q(u,n.domain,r);const p=We();Q(d,n.domain,p),Q(p,n.domain,p);const f=L(p,tt);Q(f,n.domain,p);const h=We(Iw);Q(f,n.tld,h),Q(f,n.utld,h),L(d,fs,h);const g=L(p,Ke);L(g,Ke,g),Q(g,n.domain,p),Q(h,n.domain,p),L(h,tt,f),L(h,Ke,g);const b=L(o,Ke),m=L(o,tt);L(b,Ke,b),Q(b,n.domain,o),Q(m,s,r),Q(m,n.domain,o);const v=We(Rs);Q(m,n.tld,v),Q(m,n.utld,v),Q(v,n.domain,o),Q(v,s,r),L(v,tt,m),L(v,Ke,b),L(v,Ct,d);const S=L(v,Gt),A=We(Rs);Q(S,n.numeric,A);const O=We(Rs),B=We();Q(O,e,O),Q(O,t,B),Q(B,e,O),Q(B,t,B),L(v,nt,O),L(A,nt,O);const E=L(l,Gt),M=L(c,Gt),w=L(M,nt),T=L(w,nt);Q(l,n.domain,o),L(l,tt,m),L(l,Ke,b),Q(c,n.domain,o),L(c,tt,m),L(c,Ke,b),Q(E,n.domain,O),L(E,nt,O),L(E,Zn,O),Q(T,n.domain,O),Q(T,e,O),L(T,nt,O);const N=[[Gn,Yn],[ii,ri],[oi,li],[ai,ci],[di,ui],[pi,fi],[hi,mi],[gi,bi]];for(let I=0;I=0&&f++,i++,u++;if(f<0)i-=u,i0&&(r.push(br(ua,e,o)),o=[]),i-=f,u-=f;const h=p.t,g=t.slice(i-u,i);r.push(br(h,e,g))}}return o.length>0&&r.push(br(ua,e,o)),r}function br(n,e,t){const s=t[0].s,i=t[t.length-1].e,r=e.slice(s,i);return new n(r,t)}const Lw=typeof console!="undefined"&&console&&console.warn||(()=>{}),Pw="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",re={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Bw(){return _e.groups={},re.scanner=null,re.parser=null,re.tokenQueue=[],re.pluginQueue=[],re.customSchemes=[],re.initialized=!1,re}function pa(n,e=!1){if(re.initialized&&Lw(`linkifyjs: already initialized - will not register custom scheme "${n}" ${Pw}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" -3. "-" cannot repeat`);re.customSchemes.push([n,e])}function Bw(){re.scanner=Aw(re.customSchemes);for(let n=0;np.mark.type===t);if(!c.length)return;const{nodeAfter:d}=r;if(d&&c.some(p=>p.mark.isInSet(d.marks)))return;const u=n.storedMarks;n.removeMark(l,e.to,t),n.setStoredMarks(u),n.selection.empty&&n.selection.from===e.to&&n.removeStoredMark(t)}function Hw(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function qw(n){return new oe({key:new me("autolink"),appendTransaction:(e,t,s)=>{const i=e.some(c=>c.docChanged)&&!t.doc.eq(s.doc),r=e.some(c=>c.getMeta("preventAutolink"));if(!i||r)return;const{tr:o}=s,l=Ad(t.doc,[...e]);if(!e.some(h1)){const c=[];l.steps.forEach((d,u)=>{if(!(d instanceof de)||!d.slice.size)return;const p=l.mapping.slice(u+1),f=p.map(d.from,1),h=p.map(d.from+d.slice.size,-1);fu.to-d.to),c.forEach(d=>Vw(o,d,n.type))}if(qi(l).forEach(({newRange:c})=>{const d=ok(s.doc,c,f=>f.isTextblock);let u,p;if(d.length>1)u=d[0],p=s.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(d.length){const f=s.doc.textBetween(c.from,c.to," "," ");if(!zw.test(f))return;u=d[0],p=s.doc.textBetween(u.pos,c.to,void 0," ")}if(u&&p){const f=p.split(_w).filter(Boolean);if(f.length<=0)return!1;const h=f[f.length-1],g=u.pos+p.lastIndexOf(h);if(!h)return!1;const b=Do(h).map(m=>m.toObject(n.defaultProtocol));if(!Hw(b))return!1;b.filter(m=>m.isLink).map(m=>({...m,from:g+m.start+1,to:g+m.end+1})).filter(m=>s.schema.marks.code?!s.doc.rangeHasMark(m.from,m.to,s.schema.marks.code):!0).filter(m=>n.validate(m.value)).filter(m=>n.shouldAutoLink(m.value)).forEach(m=>{Ui(m.from,m.to,s.doc).some(y=>y.mark.type===n.type)||o.addMark(m.from,m.to,n.type.create({href:m.href}))})}}),!!o.steps.length)return o}})}function Uw(n){return new oe({key:new me("handleClickLink"),props:{handleClick:(e,t,s)=>{if(s.button!==0||!e.editable)return!1;let i=null;if(s.target instanceof HTMLAnchorElement)i=s.target;else{const c=s.target;if(!c)return!1;const d=n.editor.view.dom;i=c.closest("a"),i&&!d.contains(i)&&(i=null)}if(!i)return!1;let r=!1;if(n.enableClickSelection&&(r=n.editor.commands.extendMarkRange(n.type.name)),n.openOnClick){var o,l;const c=Rd(e.state,n.type.name),d=(o=i.href)!==null&&o!==void 0?o:c.href,u=(l=i.target)!==null&&l!==void 0?l:c.target;d&&(window.open(d,u),r=!0)}return r}}})}const Ww=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,Kw=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function cu(n,e){let t=0;for(let s=e-1;s>=0&&n[s]==="\\";s-=1)t+=1;return t%2===1}function Jw(n,e){let t=0,s=0;for(;s0}function du(n,e,t){var s,i;const[,r,o]=e;return(e.index?n[e.index-1]:void 0)==="!"||cu(n,(s=e.index)!==null&&s!==void 0?s:0)||Jw(n,(i=e.index)!==null&&i!==void 0?i:0)?!1:!!r.trim()&&t(o)}function uu(n){var e,t;const[s,i,r,,o,l,c]=n,d=(e=o!=null?o:l)!==null&&e!==void 0?e:c;return{index:(t=n.index)!==null&&t!==void 0?t:0,text:s,replaceWith:i,data:{href:r,title:d||null,markdown:!0}}}function Gw(n,e){return n.index{const s=Ww.exec(t);return!s||!du(t,s,n.isAllowedHref)?null:uu(s)},type:n.type,getAttributes:pu});return new ks({find:e.find,handler:t=>{const s=e.handler(t);return s!==null&&t.state.tr.steps.length&&t.state.tr.setMeta("preventAutolink",!0),s}})}function Xw(n){const e=Pt({find:t=>{var s,i;const r=[];for(const l of t.matchAll(Kw))du(t,l,n.isAllowedHref)&&r.push(uu(l));const o=((s=(i=n.findPlainUrls)===null||i===void 0?void 0:i.call(n,t))!==null&&s!==void 0?s:[]).filter(l=>!r.some(c=>Gw(c,l)));return[...r,...o]},type:n.type,getAttributes:pu});return new Jd({find:e.find,handler:t=>{var s;const i=e.handler(t);return i!==null&&t.state.tr.steps.length&&(!((s=t.match.data)===null||s===void 0)&&s.markdown)&&t.state.tr.setMeta("preventAutolink",!0),i}})}function Zw(n){return new oe({key:new me("handlePasteLink"),props:{handlePaste:(e,t,s)=>{const{shouldAutoLink:i}=n,{state:r}=e,{selection:o}=r,{empty:l}=o;if(l)return!1;let c="";s.content.forEach(u=>{c+=u.textContent});const d=au(c,{defaultProtocol:n.defaultProtocol}).find(u=>u.isLink&&u.value===c);return!c||!d||i!==void 0&&!i(d.value)?!1:n.editor.commands.setMark(n.type,{href:d.href})}}})}function ct(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(s=>{const i=typeof s=="string"?s:s.scheme;i&&t.push(i)}),!n||n.replace(Fw,"").match(new RegExp(`^(?:(?:${t.map(s=>s.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const Qw=an.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){pa(n);return}pa(n.scheme,n.optionalSlashes)})},onDestroy(){Pw()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!ct(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(n),t=/^[a-z][a-z0-9+.-]*:/i.test(n);if(e||t&&!n.includes("@"))return!0;const s=(n.includes("@")?n.split("@").pop():n).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(s)||!/\./.test(s))}}},addAttributes(){var n,e,t;return{href:{default:null,parseHTML(s){return s.getAttribute("href")}},target:{default:(n=this.options.HTMLAttributes.target)!==null&&n!==void 0?n:null},rel:{default:(e=this.options.HTMLAttributes.rel)!==null&&e!==void 0?e:null},class:{default:(t=this.options.HTMLAttributes.class)!==null&&t!==void 0?t:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!ct(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!ct(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ke(this.options.HTMLAttributes,n),0]:["a",ke(this.options.HTMLAttributes,{...n,href:""}),0]},markdownTokenName:"link",parseMarkdown:(n,e)=>e.applyMark("link",e.parseInline(n.tokens||[]),{href:n.href,title:n.title||null}),renderMarkdown:(n,e)=>{var t,s,i,r;const o=(t=(s=n.attrs)===null||s===void 0?void 0:s.href)!==null&&t!==void 0?t:"",l=(i=(r=n.attrs)===null||r===void 0?void 0:r.title)!==null&&i!==void 0?i:"",c=e.renderChildren(n);return l?`[${c}](${o} "${l}")`:`[${c}](${o})`},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:s=>!!ct(s,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:s=>!!ct(s,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[Yw({type:this.type,isAllowedHref:n=>this.options.isAllowedUri(n,{defaultValidate:e=>!!ct(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const n=e=>{const t=[];if(e){const{protocols:s,defaultProtocol:i}=this.options;au(e).filter(r=>r.isLink&&this.options.isAllowedUri(r.value,{defaultValidate:o=>!!ct(o,s),protocols:s,defaultProtocol:i})).forEach(r=>{this.options.shouldAutoLink(r.value)&&t.push({text:r.value,data:{href:r.href},index:r.start})})}return t};return this.options.markdownLinks?[Xw({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:t=>!!ct(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:n})]:[Pt({find:n,type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)===null||t===void 0?void 0:t.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(qw({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:s=>this.options.isAllowedUri(s,{defaultValidate:i=>!!ct(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),n.push(Uw({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&n.push(Zw({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),n}}),eS="listItem",fa="textStyle",ha=/^\s*([-+*])\s$/,fu=Fe.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",ke(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>n.type!=="list"||n.ordered?[]:{type:"bulletList",content:n.items?e.parseChildren(n.items):[]},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` -`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(eS,this.editor.getAttributes(fa)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=On({find:ha,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=On({find:ha,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(fa),editor:this.editor})),[n]}}),tS=(n,e,t)=>{const{selection:s}=n;if(!s.empty)return null;const{$from:i}=s;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let r=-1;for(let h=i.depth;h>0;h-=1)if(i.node(h).type.name===e){r=h;break}if(r<0)return null;const o=i.node(r),l=i.index(r);if(l+1>=o.childCount)return null;const c=o.child(l+1);if(!t.includes(c.type.name))return null;const d=n.schema.nodes[e];let u=!1;if(c.forEach(h=>{h.type===d&&h.childCount>1&&(u=!0)}),!u)return null;const p=n.doc.resolve(i.after()).nodeAfter;if(!p||!t.includes(p.type.name))return null;const f=[];return p.forEach(h=>{f.push(h)}),f.length===0?null:{listItemDepth:r,nestedList:p,nestedListPos:i.after(),insertPos:i.after(r),items:f}},nS=(n,e,t,s)=>{const i=tS(n,t,s);if(!i)return!1;const{selection:r}=n,{nestedList:o,nestedListPos:l,insertPos:c,items:d}=i,u=n.tr;u.delete(l,l+o.nodeSize);const p=u.mapping.map(c);return u.insert(p,$.from(d)),u.setSelection(r.map(u.doc,u.mapping)),e&&e(u),!0},sS=(n,e,t)=>nS(n.state,n.view.dispatch,e,t),hu=(n,e)=>pe.create({name:`${n}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const t=()=>sS(this.editor,n,e);return{Delete:t,"Mod-Delete":t}}}),mu=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],Ls="abcdefghijklmnopqrstuvwxyz",gu=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function Gi(n){let e=n,t="";for(const[s,i]of mu)for(;e>=s;)t+=i,e-=s;return t}function $o(n){return Gi(n).toUpperCase()}function bu(n){const e=n.toLowerCase();let t=0,s=0;for(;t0?s:1}const t=parseInt(n,10);return Number.isNaN(t)?1:t}function oS(n,e){if(n==="numeric")return String(e);switch(n){case"a":return Ii(e);case"A":return Ii(e).toUpperCase();case"i":return Gi(e);case"I":return $o(e);default:return String(e)}}function lS(n){var e;if(n.length===0)return!1;const t=(e=Yi(n[0]))!==null&&e!==void 0?e:"numeric",s=Ro(n[0]);if(s<1)return!1;for(let i=0;i{var t;if(n.type!=="list_item")return[];const s=(t=e.parseBlockChildren)!==null&&t!==void 0?t:e.parseChildren;let i=[];if(n.tokens&&n.tokens.length>0){if(uS(n))return{type:"listItem",content:[{type:"paragraph",content:pS(n.text||"",e)}]};if(n.tokens.some(r=>r.type==="paragraph"))i=s(n.tokens);else{const r=n.tokens[0];if(r&&r.type==="text"&&r.tokens&&r.tokens.length>0){if(i=[{type:"paragraph",content:e.parseInline(r.tokens)}],n.tokens.length>1){const o=s(n.tokens.slice(1));i.push(...o)}}else i=s(n.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(n,e,t)=>Ud(n,e,s=>{if(s.parentType==="bulletList")return"- ";if(s.parentType==="orderedList"){var i,r;const o=((i=s.meta)===null||i===void 0||(i=i.parentAttrs)===null||i===void 0?void 0:i.start)||1;return dS((r=s.meta)===null||r===void 0||(r=r.parentAttrs)===null||r===void 0?void 0:r.type,o-1+(s.index||0),". ")}return"- "},t,{alignNestedToPrefix:(t==null?void 0:t.parentType)==="orderedList"}),addExtensions(){return[hu(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Lo=(n,e)=>{const{$from:t}=e.selection,s=ve(n,e.schema);let i=null,r=t.depth,o=t.pos,l=null;for(;r>0&&l===null;)i=t.node(r),i.type===s?l=r:(r-=1,o-=1);return l===null?null:{$pos:e.doc.resolve(o),depth:l}},vu=(n,e)=>{const t=Lo(n,e);if(!t)return!1;const[,s]=kk(e,n,t.$pos.pos+4);return s},fS=(n,e,t)=>{const{$anchor:s}=n.selection,i=Math.max(0,s.pos-2),r=n.doc.resolve(i).node();return!(!r||!t.includes(r.type.name))},ma=(n,e,t)=>{if(n.commands.undoInputRule())return!0;if(n.state.selection.from!==n.state.selection.to)return!1;if(!bt(n.state,e)&&fS(n.state,e,t)){const{$anchor:r}=n.state.selection,o=n.state.doc.resolve(r.before()-1),l=[];o.node().descendants((u,p)=>{u.type.name===e&&l.push({node:u,pos:p})});const c=l.at(-1);if(!c)return!1;const d=n.state.doc.resolve(o.start()+c.pos+1);return n.chain().cut({from:r.start()-1,to:r.end()+1},d.end()).joinForward().run()}if(!bt(n.state,e)||!Mk(n.state))return!1;const{$from:s}=n.state.selection,i=s.depth-1;return s.node(i).type!==n.schema.nodes[e]||s.index(i)!==0?!1:n.chain().liftListItem(e).run()},hS=(n,e)=>{const t=vu(n,e),s=Lo(n,e);return!s||!t?!1:t>s.depth},mS=(n,e)=>{const t=vu(n,e),s=Lo(n,e);return!s||!t?!1:t{if(!bt(n.state,e)||!Ck(n.state,e))return!1;const{selection:t}=n.state,{$from:s,$to:i}=t;return!t.empty&&s.sameParent(i)?!1:hS(e,n.state)?n.chain().focus(n.state.selection.from+4).lift(e).joinBackward().run():mS(e,n.state)?n.chain().joinForward().joinBackward().run():n.commands.joinItemForward()},gS=(n,e,t)=>{const{state:s}=n,{selection:i}=s;if(!i.empty)return!1;const{$from:r}=i;if(r.parentOffset!==0||!r.parent.isTextblock||bt(s,e))return!1;const o=xk(r);if(!o||!t.includes(o.type.name))return!1;const l=o.lastChild;if(!l||l.type.name!==e)return!1;const c=r.parent;if(!l.canReplace(l.childCount,l.childCount,$.from(c)))return!1;const d=r.before(),u=r.after(),p=d-2;return n.commands.command(({tr:f,dispatch:h})=>(h&&(f.delete(d,u).insert(p,$.from(c)),f.setSelection(U.create(f.doc,p+1)),f.scrollIntoView()),!0))},ku=pe.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&ga(n,t)&&(e=!0)}),e},"Mod-Delete":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&ga(n,t)&&(e=!0)}),e},Backspace:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:s})=>{n.state.schema.nodes[t]!==void 0&&ma(n,t,s)&&(e=!0)}),e},"Mod-Backspace":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:s})=>{n.state.schema.nodes[t]!==void 0&&ma(n,t,s)&&(e=!0)}),e},Tab:({editor:n})=>{for(const{itemName:e,wrapperNames:t}of this.options.listTypes)if(n.state.schema.nodes[e]!==void 0&&gS(n,e,t))return!0;return!1}}}}),Di=new RegExp(`^(\\s*)(${gu})([.)])\\s+(.*)$`),bS=/^\s/,vn={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function yS(n){return Di.test(n.trimStart())}function vS(n){const e=n.trimStart();return vn.bulletItem.test(e)||yS(e)||vn.heading.test(e)||vn.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||vn.codeFence.test(e)||vn.blockMath.test(e)}function kS(n){return Object.values(vn).some(e=>e.test(n))}function xS(n){const e=[],t=[];let s=!1;return n.forEach(i=>{if(s){t.push(i);return}if(i.trim()===""){s=!0,t.push(i);return}if(e.length>0&&vS(i)){s=!0,t.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:t}}function ba(n){const e=[];let t=0,s=0;for(;tp.mark.type===t);if(!c.length)return;const{nodeAfter:d}=r;if(d&&c.some(p=>p.mark.isInSet(d.marks)))return;const u=n.storedMarks;n.removeMark(l,e.to,t),n.setStoredMarks(u),n.selection.empty&&n.selection.from===e.to&&n.removeStoredMark(t)}function qw(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function Uw(n){return new oe({key:new me("autolink"),appendTransaction:(e,t,s)=>{const i=e.some(c=>c.docChanged)&&!t.doc.eq(s.doc),r=e.some(c=>c.getMeta("preventAutolink"));if(!i||r)return;const{tr:o}=s,l=Ad(t.doc,[...e]);if(!e.some(m1)){const c=[];l.steps.forEach((d,u)=>{if(!(d instanceof de)||!d.slice.size)return;const p=l.mapping.slice(u+1),f=p.map(d.from,1),h=p.map(d.from+d.slice.size,-1);fu.to-d.to),c.forEach(d=>Hw(o,d,n.type))}if(qi(l).forEach(({newRange:c})=>{const d=lk(s.doc,c,f=>f.isTextblock);let u,p;if(d.length>1)u=d[0],p=s.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(d.length){const f=s.doc.textBetween(c.from,c.to," "," ");if(!jw.test(f))return;u=d[0],p=s.doc.textBetween(u.pos,c.to,void 0," ")}if(u&&p){const f=p.split(zw).filter(Boolean);if(f.length<=0)return!1;const h=f[f.length-1],g=u.pos+p.lastIndexOf(h);if(!h)return!1;const b=Do(h).map(m=>m.toObject(n.defaultProtocol));if(!qw(b))return!1;b.filter(m=>m.isLink).map(m=>({...m,from:g+m.start+1,to:g+m.end+1})).filter(m=>s.schema.marks.code?!s.doc.rangeHasMark(m.from,m.to,s.schema.marks.code):!0).filter(m=>n.validate(m.value)).filter(m=>n.shouldAutoLink(m.value)).forEach(m=>{Ui(m.from,m.to,s.doc).some(v=>v.mark.type===n.type)||o.addMark(m.from,m.to,n.type.create({href:m.href}))})}}),!!o.steps.length)return o}})}function Ww(n){return new oe({key:new me("handleClickLink"),props:{handleClick:(e,t,s)=>{if(s.button!==0||!e.editable)return!1;let i=null;if(s.target instanceof HTMLAnchorElement)i=s.target;else{const c=s.target;if(!c)return!1;const d=n.editor.view.dom;i=c.closest("a"),i&&!d.contains(i)&&(i=null)}if(!i)return!1;let r=!1;if(n.enableClickSelection&&(r=n.editor.commands.extendMarkRange(n.type.name)),n.openOnClick){var o,l;const c=Rd(e.state,n.type.name),d=(o=i.href)!==null&&o!==void 0?o:c.href,u=(l=i.target)!==null&&l!==void 0?l:c.target;d&&(window.open(d,u),r=!0)}return r}}})}const Kw=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,Jw=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function cu(n,e){let t=0;for(let s=e-1;s>=0&&n[s]==="\\";s-=1)t+=1;return t%2===1}function Gw(n,e){let t=0,s=0;for(;s0}function du(n,e,t){var s,i;const[,r,o]=e;return(e.index?n[e.index-1]:void 0)==="!"||cu(n,(s=e.index)!==null&&s!==void 0?s:0)||Gw(n,(i=e.index)!==null&&i!==void 0?i:0)?!1:!!r.trim()&&t(o)}function uu(n){var e,t;const[s,i,r,,o,l,c]=n,d=(e=o!=null?o:l)!==null&&e!==void 0?e:c;return{index:(t=n.index)!==null&&t!==void 0?t:0,text:s,replaceWith:i,data:{href:r,title:d||null,markdown:!0}}}function Yw(n,e){return n.index{const s=Kw.exec(t);return!s||!du(t,s,n.isAllowedHref)?null:uu(s)},type:n.type,getAttributes:pu});return new ks({find:e.find,handler:t=>{const s=e.handler(t);return s!==null&&t.state.tr.steps.length&&t.state.tr.setMeta("preventAutolink",!0),s}})}function Zw(n){const e=Pt({find:t=>{var s,i;const r=[];for(const l of t.matchAll(Jw))du(t,l,n.isAllowedHref)&&r.push(uu(l));const o=((s=(i=n.findPlainUrls)===null||i===void 0?void 0:i.call(n,t))!==null&&s!==void 0?s:[]).filter(l=>!r.some(c=>Yw(c,l)));return[...r,...o]},type:n.type,getAttributes:pu});return new Jd({find:e.find,handler:t=>{var s;const i=e.handler(t);return i!==null&&t.state.tr.steps.length&&(!((s=t.match.data)===null||s===void 0)&&s.markdown)&&t.state.tr.setMeta("preventAutolink",!0),i}})}function Qw(n){return new oe({key:new me("handlePasteLink"),props:{handlePaste:(e,t,s)=>{const{shouldAutoLink:i}=n,{state:r}=e,{selection:o}=r,{empty:l}=o;if(l)return!1;let c="";s.content.forEach(u=>{c+=u.textContent});const d=au(c,{defaultProtocol:n.defaultProtocol}).find(u=>u.isLink&&u.value===c);return!c||!d||i!==void 0&&!i(d.value)?!1:n.editor.commands.setMark(n.type,{href:d.href})}}})}function ct(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(s=>{const i=typeof s=="string"?s:s.scheme;i&&t.push(i)}),!n||n.replace(Vw,"").match(new RegExp(`^(?:(?:${t.map(s=>s.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const eS=an.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){pa(n);return}pa(n.scheme,n.optionalSlashes)})},onDestroy(){Bw()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!ct(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(n),t=/^[a-z][a-z0-9+.-]*:/i.test(n);if(e||t&&!n.includes("@"))return!0;const s=(n.includes("@")?n.split("@").pop():n).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(s)||!/\./.test(s))}}},addAttributes(){var n,e,t;return{href:{default:null,parseHTML(s){return s.getAttribute("href")}},target:{default:(n=this.options.HTMLAttributes.target)!==null&&n!==void 0?n:null},rel:{default:(e=this.options.HTMLAttributes.rel)!==null&&e!==void 0?e:null},class:{default:(t=this.options.HTMLAttributes.class)!==null&&t!==void 0?t:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!ct(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!ct(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ke(this.options.HTMLAttributes,n),0]:["a",ke(this.options.HTMLAttributes,{...n,href:""}),0]},markdownTokenName:"link",parseMarkdown:(n,e)=>e.applyMark("link",e.parseInline(n.tokens||[]),{href:n.href,title:n.title||null}),renderMarkdown:(n,e)=>{var t,s,i,r;const o=(t=(s=n.attrs)===null||s===void 0?void 0:s.href)!==null&&t!==void 0?t:"",l=(i=(r=n.attrs)===null||r===void 0?void 0:r.title)!==null&&i!==void 0?i:"",c=e.renderChildren(n);return l?`[${c}](${o} "${l}")`:`[${c}](${o})`},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:s=>!!ct(s,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:s=>!!ct(s,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[Xw({type:this.type,isAllowedHref:n=>this.options.isAllowedUri(n,{defaultValidate:e=>!!ct(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const n=e=>{const t=[];if(e){const{protocols:s,defaultProtocol:i}=this.options;au(e).filter(r=>r.isLink&&this.options.isAllowedUri(r.value,{defaultValidate:o=>!!ct(o,s),protocols:s,defaultProtocol:i})).forEach(r=>{this.options.shouldAutoLink(r.value)&&t.push({text:r.value,data:{href:r.href},index:r.start})})}return t};return this.options.markdownLinks?[Zw({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:t=>!!ct(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:n})]:[Pt({find:n,type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)===null||t===void 0?void 0:t.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(Uw({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:s=>this.options.isAllowedUri(s,{defaultValidate:i=>!!ct(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),n.push(Ww({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&n.push(Qw({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),n}}),tS="listItem",fa="textStyle",ha=/^\s*([-+*])\s$/,fu=Fe.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",ke(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>n.type!=="list"||n.ordered?[]:{type:"bulletList",content:n.items?e.parseChildren(n.items):[]},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` +`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(tS,this.editor.getAttributes(fa)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=On({find:ha,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=On({find:ha,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(fa),editor:this.editor})),[n]}}),nS=(n,e,t)=>{const{selection:s}=n;if(!s.empty)return null;const{$from:i}=s;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let r=-1;for(let h=i.depth;h>0;h-=1)if(i.node(h).type.name===e){r=h;break}if(r<0)return null;const o=i.node(r),l=i.index(r);if(l+1>=o.childCount)return null;const c=o.child(l+1);if(!t.includes(c.type.name))return null;const d=n.schema.nodes[e];let u=!1;if(c.forEach(h=>{h.type===d&&h.childCount>1&&(u=!0)}),!u)return null;const p=n.doc.resolve(i.after()).nodeAfter;if(!p||!t.includes(p.type.name))return null;const f=[];return p.forEach(h=>{f.push(h)}),f.length===0?null:{listItemDepth:r,nestedList:p,nestedListPos:i.after(),insertPos:i.after(r),items:f}},sS=(n,e,t,s)=>{const i=nS(n,t,s);if(!i)return!1;const{selection:r}=n,{nestedList:o,nestedListPos:l,insertPos:c,items:d}=i,u=n.tr;u.delete(l,l+o.nodeSize);const p=u.mapping.map(c);return u.insert(p,$.from(d)),u.setSelection(r.map(u.doc,u.mapping)),e&&e(u),!0},iS=(n,e,t)=>sS(n.state,n.view.dispatch,e,t),hu=(n,e)=>pe.create({name:`${n}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const t=()=>iS(this.editor,n,e);return{Delete:t,"Mod-Delete":t}}}),mu=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],Ls="abcdefghijklmnopqrstuvwxyz",gu=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function Gi(n){let e=n,t="";for(const[s,i]of mu)for(;e>=s;)t+=i,e-=s;return t}function $o(n){return Gi(n).toUpperCase()}function bu(n){const e=n.toLowerCase();let t=0,s=0;for(;t0?s:1}const t=parseInt(n,10);return Number.isNaN(t)?1:t}function lS(n,e){if(n==="numeric")return String(e);switch(n){case"a":return Ii(e);case"A":return Ii(e).toUpperCase();case"i":return Gi(e);case"I":return $o(e);default:return String(e)}}function aS(n){var e;if(n.length===0)return!1;const t=(e=Yi(n[0]))!==null&&e!==void 0?e:"numeric",s=Ro(n[0]);if(s<1)return!1;for(let i=0;i{var t;if(n.type!=="list_item")return[];const s=(t=e.parseBlockChildren)!==null&&t!==void 0?t:e.parseChildren;let i=[];if(n.tokens&&n.tokens.length>0){if(pS(n))return{type:"listItem",content:[{type:"paragraph",content:fS(n.text||"",e)}]};if(n.tokens.some(r=>r.type==="paragraph"))i=s(n.tokens);else{const r=n.tokens[0];if(r&&r.type==="text"&&r.tokens&&r.tokens.length>0){if(i=[{type:"paragraph",content:e.parseInline(r.tokens)}],n.tokens.length>1){const o=s(n.tokens.slice(1));i.push(...o)}}else i=s(n.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(n,e,t)=>Ud(n,e,s=>{if(s.parentType==="bulletList")return"- ";if(s.parentType==="orderedList"){var i,r;const o=((i=s.meta)===null||i===void 0||(i=i.parentAttrs)===null||i===void 0?void 0:i.start)||1;return uS((r=s.meta)===null||r===void 0||(r=r.parentAttrs)===null||r===void 0?void 0:r.type,o-1+(s.index||0),". ")}return"- "},t,{alignNestedToPrefix:(t==null?void 0:t.parentType)==="orderedList"}),addExtensions(){return[hu(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Lo=(n,e)=>{const{$from:t}=e.selection,s=ye(n,e.schema);let i=null,r=t.depth,o=t.pos,l=null;for(;r>0&&l===null;)i=t.node(r),i.type===s?l=r:(r-=1,o-=1);return l===null?null:{$pos:e.doc.resolve(o),depth:l}},yu=(n,e)=>{const t=Lo(n,e);if(!t)return!1;const[,s]=xk(e,n,t.$pos.pos+4);return s},hS=(n,e,t)=>{const{$anchor:s}=n.selection,i=Math.max(0,s.pos-2),r=n.doc.resolve(i).node();return!(!r||!t.includes(r.type.name))},ma=(n,e,t)=>{if(n.commands.undoInputRule())return!0;if(n.state.selection.from!==n.state.selection.to)return!1;if(!bt(n.state,e)&&hS(n.state,e,t)){const{$anchor:r}=n.state.selection,o=n.state.doc.resolve(r.before()-1),l=[];o.node().descendants((u,p)=>{u.type.name===e&&l.push({node:u,pos:p})});const c=l.at(-1);if(!c)return!1;const d=n.state.doc.resolve(o.start()+c.pos+1);return n.chain().cut({from:r.start()-1,to:r.end()+1},d.end()).joinForward().run()}if(!bt(n.state,e)||!Tk(n.state))return!1;const{$from:s}=n.state.selection,i=s.depth-1;return s.node(i).type!==n.schema.nodes[e]||s.index(i)!==0?!1:n.chain().liftListItem(e).run()},mS=(n,e)=>{const t=yu(n,e),s=Lo(n,e);return!s||!t?!1:t>s.depth},gS=(n,e)=>{const t=yu(n,e),s=Lo(n,e);return!s||!t?!1:t{if(!bt(n.state,e)||!Mk(n.state,e))return!1;const{selection:t}=n.state,{$from:s,$to:i}=t;return!t.empty&&s.sameParent(i)?!1:mS(e,n.state)?n.chain().focus(n.state.selection.from+4).lift(e).joinBackward().run():gS(e,n.state)?n.chain().joinForward().joinBackward().run():n.commands.joinItemForward()},bS=(n,e,t)=>{const{state:s}=n,{selection:i}=s;if(!i.empty)return!1;const{$from:r}=i;if(r.parentOffset!==0||!r.parent.isTextblock||bt(s,e))return!1;const o=wk(r);if(!o||!t.includes(o.type.name))return!1;const l=o.lastChild;if(!l||l.type.name!==e)return!1;const c=r.parent;if(!l.canReplace(l.childCount,l.childCount,$.from(c)))return!1;const d=r.before(),u=r.after(),p=d-2;return n.commands.command(({tr:f,dispatch:h})=>(h&&(f.delete(d,u).insert(p,$.from(c)),f.setSelection(U.create(f.doc,p+1)),f.scrollIntoView()),!0))},ku=pe.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&ga(n,t)&&(e=!0)}),e},"Mod-Delete":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&ga(n,t)&&(e=!0)}),e},Backspace:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:s})=>{n.state.schema.nodes[t]!==void 0&&ma(n,t,s)&&(e=!0)}),e},"Mod-Backspace":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:s})=>{n.state.schema.nodes[t]!==void 0&&ma(n,t,s)&&(e=!0)}),e},Tab:({editor:n})=>{for(const{itemName:e,wrapperNames:t}of this.options.listTypes)if(n.state.schema.nodes[e]!==void 0&&bS(n,e,t))return!0;return!1}}}}),Di=new RegExp(`^(\\s*)(${gu})([.)])\\s+(.*)$`),vS=/^\s/,yn={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function yS(n){return Di.test(n.trimStart())}function kS(n){const e=n.trimStart();return yn.bulletItem.test(e)||yS(e)||yn.heading.test(e)||yn.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||yn.codeFence.test(e)||yn.blockMath.test(e)}function xS(n){return Object.values(yn).some(e=>e.test(n))}function wS(n){const e=[],t=[];let s=!1;return n.forEach(i=>{if(s){t.push(i);return}if(i.trim()===""){s=!0,t.push(i);return}if(e.length>0&&kS(i)){s=!0,t.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:t}}function ba(n){const e=[];let t=0,s=0;for(;ts.trim().length>0);if(e.length===0)return null;const t=[];for(const s of e){const i=s.trim().match(wS);if(!i)return null;t.push({marker:i[1],content:i[3]})}return lS(t.map(s=>s.marker))?{type:"orderedList",attrs:cS(t[0].marker),content:t.map(s=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:s.content}]}]}))}:null}function xu(n,e,t){const s=[];let i=0;for(;is.trim().length>0);if(e.length===0)return null;const t=[];for(const s of e){const i=s.trim().match(SS);if(!i)return null;t.push({marker:i[1],content:i[3]})}return aS(t.map(s=>s.marker))?{type:"orderedList",attrs:dS(t[0].marker),content:t.map(s=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:s.content}]}]}))}:null}function xu(n,e,t){const s=[];let i=0;for(;ie;)f.push(n[p]),p+=1;if(f.length>0){const h=xu(f,Math.min(...f.map(g=>g.indent)),t);d.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:h,raw:f.map(g=>g.raw).join(` -`)})}s.push({type:"list_item",raw:r.raw,tokens:d}),i=p}else i+=1}return s}function CS(n,e){return n.map(t=>{if(t.type!=="list_item")return e.parseChildren([t])[0];const s=[];return t.tokens&&t.tokens.length>0&&t.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")s.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const r=e.parseChildren([i]);s.push({type:"paragraph",content:r})}else{const r=e.parseChildren([i]);r.length>0&&s.push(...r)}}),{type:"listItem",content:s}})}const MS=64;function ya(n,e){const t=[];let s=0;for(;t.lengthn.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>{const e=n.getAttribute("type");if(e)return e;const t=n.getAttribute("style");if(t){const i=xa(t);if(i)return i}const s=n.querySelector("li");if(s){const i=s.getAttribute("style");if(i){const r=xa(i);if(r)return r}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,type:t,...s}=n,i=ke(this.options.HTMLAttributes,s);return e!==1&&(i.start=e),t&&t!=="1"&&(i.type=t),["ol",i,0]},markdownTokenName:"list",parseMarkdown:(n,e)=>{if(n.type!=="list"||!n.ordered)return[];const t=n.start||1,s=n.typeMarker,i=n.items?CS(n.items,e):[],r={};return t!==1&&(r.start=t),s&&(r.type=s),Object.keys(r).length>0?{type:"orderedList",attrs:r,content:i}:{type:"orderedList",content:i}},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` -`):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(n,e,t)=>{var s,i;const[r,o,l]=TS(n);if(r.length===0)return;const c=xu(r,r[0].indent,t);if(c.length!==0)return{type:"list",ordered:!0,start:((s=r[0])===null||s===void 0?void 0:s.number)||1,typeMarker:(i=r[0])===null||i===void 0?void 0:i.type,items:c,raw:l.slice(0,o).join(` -`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ES,this.editor.getAttributes(va)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new oe({props:{handlePaste:(n,e)=>{var t,s;const i=(t=e.clipboardData)===null||t===void 0?void 0:t.getData("text/html");if(i!=null&&i.trim())return!1;const r=(s=e.clipboardData)===null||s===void 0?void 0:s.getData("text/plain");if(!r)return!1;const o=SS(r);if(!o)return!1;try{const l=n.state.schema.nodeFromJSON(o),c=n.state.tr.replaceSelectionWith(l);return n.dispatch(c),!0}catch(l){return!1}}}})]},addInputRules(){const n=(t,s)=>(!s.attrs.type||s.attrs.type==="1")&&s.childCount+s.attrs.start===+t[1];let e=On({find:ka,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:n});return(this.options.keepMarks||this.options.keepAttributes)&&(e=On({find:ka,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(va)}),joinPredicate:n,editor:this.editor})),[e]}}),AS=/^\s*(\[([( |x])?\])\s$/,OS="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",NS=(n,e,t)=>{var s;return(t==null||(s=t.checkboxLabel)===null||s===void 0?void 0:s.call(t,n,e))||`Task item checkbox for ${n.textContent||"empty task item"}`},IS=Fe.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:n=>{var e;return(e=n.querySelector("div"))!==null&&e!==void 0?e:n}}]},renderHTML({node:n,HTMLAttributes:e}){return["li",ke(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(n,e)=>{const t=[];if(n.tokens&&n.tokens.length>0?t.push(e.createNode("paragraph",{},e.parseInline(n.tokens))):n.text?t.push(e.createNode("paragraph",{},[e.createNode("text",{text:n.text})])):t.push(e.createNode("paragraph",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const s=e.parseChildren(n.nestedTokens);t.push(...s)}return e.createNode("taskItem",{checked:n.checked||!1},t)},renderMarkdown:(n,e)=>{var t;const s=`- [${!((t=n.attrs)===null||t===void 0)&&t.checked?"x":" "}] `;return Ud(n,e,s)},addExtensions(){return this.options.nested?[hu(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:s})=>{const i=document.createElement("li"),r=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),c=document.createElement("div");o.style.cssText=OS;const d=p=>{const f=NS(p,p.attrs.checked,this.options.a11y);l.setAttribute("aria-label",f),o.textContent=f};d(n),r.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",p=>p.preventDefault()),l.addEventListener("change",p=>{if(!s.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:f}=p.target;s.isEditable&&typeof t=="function"&&s.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const g=t();if(typeof g!="number")return!1;const b=h.doc.nodeAt(g);return h.setNodeMarkup(g,void 0,{...b==null?void 0:b.attrs,checked:f}),!0}).run(),!s.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,f)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([p,f])=>{i.setAttribute(p,f)}),i.dataset.checked=n.attrs.checked,l.checked=n.attrs.checked,r.append(l,o),i.append(r,c),Object.entries(e).forEach(([p,f])=>{i.setAttribute(p,f)});let u=new Set(Object.keys(e));return{dom:i,contentDOM:c,update:p=>{if(p.type!==this.type)return!1;i.dataset.checked=p.attrs.checked,l.checked=p.attrs.checked,d(p);const f=s.extensionManager.attributes,h=us(p,f),g=new Set(Object.keys(h)),b=this.options.HTMLAttributes;return u.forEach(m=>{g.has(m)||(m in b?i.setAttribute(m,b[m]):i.removeAttribute(m))}),Object.entries(h).forEach(([m,y])=>{y==null?m in b?i.setAttribute(m,b[m]):i.removeAttribute(m):i.setAttribute(m,y)}),u=g,!0}}}},addInputRules(){return[On({find:AS,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),DS=Fe.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",ke(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},parseMarkdown:(n,e)=>e.createNode("taskList",{},e.parseChildren(n.items||[])),renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` -`):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||e===void 0?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const s=r=>{const o=na(r,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,c)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:t.inlineTokens(l.mainContent),nestedTokens:c}),customNestedParser:s},t);if(o){const l={type:"taskList",raw:o.raw,items:o.items},c=r.slice(o.raw.length);return c.trim()?[l,...t.blockTokens(c)]:[l]}return t.blockTokens(r)},i=na(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:r=>({indentLevel:r[1].length,mainContent:r[4],checked:r[3].toLowerCase()==="x"}),createToken:(r,o)=>({type:"taskItem",raw:"",mainContent:r.mainContent,indentLevel:r.indentLevel,checked:r.checked,text:r.mainContent,tokens:t.inlineTokens(r.mainContent),nestedTokens:o}),customNestedParser:s},t);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});pe.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(fu.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(yu.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(ku.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(wu.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(IS.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(DS.configure(this.options.taskList)),n}});const Ps=" ",yr=" ",$S=Fe.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",ke(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];if(t.length===1&&t[0].type==="image")return e.parseChildren([t[0]]);const s=e.parseInline(t);return t.length===1&&t[0].type==="text"&&(t[0].raw===Ps||t[0].text===Ps||t[0].raw===yr||t[0].text===yr)&&s.length===1&&s[0].type==="text"&&(s[0].text===Ps||s[0].text===yr)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,s)},renderMarkdown:(n,e,t)=>{if(!n)return"";const s=Array.isArray(n.content)?n.content:[];if(s.length===0){var i,r;const o=Array.isArray(t==null||(i=t.previousNode)===null||i===void 0?void 0:i.content)?t.previousNode.content:[];return(t==null||(r=t.previousNode)===null||r===void 0?void 0:r.type)==="paragraph"&&o.length===0?Ps:""}return e.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),RS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,LS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,PS=an.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",ke(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[on({find:RS,type:this.type})]},addPasteRules(){return[Pt({find:LS,type:this.type})]}}),BS=Fe.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""}),_S=an.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",ke(this.options.HTMLAttributes,n),0]},parseMarkdown(n,e){return e.applyMark(this.name||"underline",e.parseInline(n.tokens||[]))},renderMarkdown(n,e){return`++${e.renderChildren(n)}++`},markdownTokenizer:{name:"underline",level:"inline",start(n){return n.indexOf("++")},tokenize(n,e,t){const s=/^(\+\+)([\s\S]+?)(\+\+)/.exec(n);if(!s)return;const i=s[2].trim();return{type:"underline",raw:s[0],text:i,tokens:t.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function zS(n={}){return new oe({view(e){return new jS(e,n)}})}class jS{constructor(e,t){var s;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=(s=t.width)!==null&&s!==void 0?s:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let r=o=>{this[i](o)};return e.dom.addEventListener(i,r),{name:i,handler:r}})}destroy(){this.setCursor(null),this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc)if(this.lastDragEvent){let s=this.computeTarget(this.lastDragEvent);s==this.cursorPos?this.updateOverlay():this.setCursor(s)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,s,i=this.editorView.dom,r=i.getBoundingClientRect(),o=r.width/i.offsetWidth,l=r.height/i.offsetHeight;if(t){let p=e.nodeBefore,f=e.nodeAfter;if(p||f){let h=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(h){let g=h.getBoundingClientRect(),b=p?g.bottom:g.top;p&&f&&(b=(b+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let m=this.width/2*l;s={left:g.left,right:g.right,top:b-m,bottom:b+m}}}}if(!s){let p=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;s={left:p.left-f,right:p.left+f,top:p.top,bottom:p.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let d,u;if(!c||c==document.body&&getComputedStyle(c).position=="static")d=-pageXOffset,u=-pageYOffset;else{let p=c.getBoundingClientRect(),f=p.width/c.offsetWidth,h=p.height/c.offsetHeight;d=p.left-c.scrollLeft*f,u=p.top-c.scrollTop*h}this.element.style.left=(s.left-d)/o+"px",this.element.style.top=(s.top-u)/l+"px",this.element.style.width=(s.right-s.left)/o+"px",this.element.style.height=(s.bottom-s.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),s=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=s&&s.type.spec.disableDropCursor,r=typeof i=="function"?i(this.editorView,t,e):i;if(!t||r)return null;let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=lc(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}return o}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class ue extends X{constructor(e){super(e,e)}map(e,t){let s=e.resolve(t.map(this.head));return ue.valid(s)?new ue(s):X.near(s)}content(){return z.empty}eq(e){return e instanceof ue&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ue(e.resolve(t.pos))}getBookmark(){return new Po(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!FS(e)||!VS(e))return!1;let s=t.type.spec.allowGapCursor;if(s!=null)return s;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,s=!1){e:for(;;){if(!s&&ue.valid(e))return e;let i=e.pos,r=null;for(let o=e.depth;;o--){let l=e.node(o);if(t>0?e.indexAfter(o)0){r=l.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let c=e.doc.resolve(i);if(ue.valid(c))return c}for(;;){let o=t>0?r.firstChild:r.lastChild;if(!o){if(r.isAtom&&!r.isText&&!W.isSelectable(r)){e=e.doc.resolve(i+r.nodeSize*t),s=!1;continue e}break}r=o,i+=t;let l=e.doc.resolve(i);if(ue.valid(l))return l}return null}}}ue.prototype.visible=!1;ue.findFrom=ue.findGapCursorFrom;X.jsonID("gapcursor",ue);class Po{constructor(e){this.pos=e}map(e){return new Po(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return ue.valid(t)?new ue(t):X.near(t)}}function Su(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function FS(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),s=n.node(e);if(t==0){if(s.type.spec.isolating)return!0;continue}for(let i=s.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||Su(i.type))return!0;if(i.inlineContent)return!1}}return!0}function VS(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),s=n.node(e);if(t==s.childCount){if(s.type.spec.isolating)return!0;continue}for(let i=s.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||Su(i.type))return!0;if(i.inlineContent)return!1}}return!0}function HS(){return new oe({props:{decorations:KS,createSelectionBetween(n,e,t){return e.pos==t.pos&&ue.valid(t)?new ue(t):null},handleClick:US,handleKeyDown:qS,handleDOMEvents:{beforeinput:WS}}})}const qS=ud({ArrowLeft:Bs("horiz",-1),ArrowRight:Bs("horiz",1),ArrowUp:Bs("vert",-1),ArrowDown:Bs("vert",1)});function Bs(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(s,i,r){let o=s.selection,l=e>0?o.$to:o.$from,c=o.empty;if(o instanceof U){if(!r.endOfTextblock(t)||l.depth==0)return!1;c=!1,l=s.doc.resolve(e>0?l.after():l.before())}let d=ue.findGapCursorFrom(l,e,c);return d?(i&&i(s.tr.setSelection(new ue(d))),!0):!1}}function US(n,e,t){if(!n||!n.editable)return!1;let s=n.state.doc.resolve(e);if(!ue.valid(s))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&W.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new ue(s))),!0)}function WS(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof ue))return!1;let{$from:t}=n.state.selection,s=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!s)return!1;let i=$.empty;for(let o=s.length-1;o>=0;o--)i=$.from(s[o].createAndFill(null,i));let r=n.state.tr.replace(t.pos,t.pos,new z(i,0,0));return r.setSelection(U.near(r.doc.resolve(t.pos+1))),n.dispatch(r),!1}function KS(n){if(!(n.selection instanceof ue))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ne.create(n.doc,[Le.widget(n.selection.head,e,{key:"gapcursor"})])}pe.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc;if(((n==null?void 0:n.mode)||this.options.mode)==="textSize"){const t=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(t)}return e.nodeSize},this.storage.words=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new oe({key:new me("characterCount"),appendTransaction:(e,t,s)=>{if(n)return;const i=this.options.limit,r=this.options.autoTrim;if(i==null||i===0||r===!1){n=!0;return}const o=this.storage.characters({node:s.doc});if(o>i){const l=o-i,c=0,d=l;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const u=s.tr.deleteRange(c,d);return n=!0,u}n=!0},filterTransaction:(e,t)=>{const s=this.options.limit;if(!e.docChanged||s===0||s===null||s===void 0)return!0;const i=this.storage.characters({node:t.doc}),r=this.storage.characters({node:e.doc});if(r<=s||i>s&&r>s&&r<=i)return!0;if(i>s&&r>s&&r>i||!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,l=o-(r-s),c=o;return e.deleteRange(l,c),!(this.storage.characters({node:e.doc})>s)}})]}});const JS=pe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[zS(this.options)]}});pe.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new oe({key:new me("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:s}=this.editor,{anchor:i}=e,r=[];if(!t||!s)return ne.create(n,[]);let o=0;this.options.mode==="deepest"&&n.descendants((c,d)=>{if(!c.isText){if(!(i>=d&&i<=d+c.nodeSize-1))return!1;o+=1}});let l=0;return n.descendants((c,d)=>{if(c.isText||!(i>=d&&i<=d+c.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&o-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";r.push(Le.node(d,d+c.nodeSize,{class:this.options.className}))}),ne.create(n,r)}}})]}});const GS=pe.create({name:"gapCursor",addProseMirrorPlugins(){return[HS()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=se(V(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),Cu="placeholder",wa=new me("tiptap__placeholder");function Mu(n){const{editor:e,placeholder:t,dataAttribute:s,pos:i,node:r,isEmptyDoc:o,hasAnchor:l,classes:{emptyNode:c,emptyEditor:d}}=n,u=[c];return o&&u.push(d),Le.node(i,i+r.nodeSize,{class:u.join(" "),[s]:typeof t=="function"?t({editor:e,node:r,pos:i,hasAnchor:l}):t})}function Tu(n,e){return typeof n=="function"?n(e):n}function Eu({editor:n,options:e,dataAttribute:t,doc:s,selection:i,from:r,to:o}){const{anchor:l}=i,c=[],d=n.isEmpty;return s.nodesBetween(r,o,(u,p)=>{const f=l>=p&&l<=p+u.nodeSize,h=!u.isLeaf&&vs(u);return u.type.isTextblock&&(f||!e.showOnlyCurrent)&&h&&c.push(Mu({editor:n,isEmptyDoc:d,dataAttribute:t,hasAnchor:f,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:Tu(e.emptyNodeClass,{editor:n,node:u,pos:p,hasAnchor:f})},node:u,pos:p})),e.includeChildren}),c}function Au({editor:n,options:e,dataAttribute:t,doc:s,selection:i}){if(!(n.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:r}=i,o=[],l=n.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const c=s.resolve(r),d=c.depth>0?c.node(1):c.nodeAfter,u=c.depth>0?c.before(1):r;if(d&&d.type.isTextblock&&vs(d)){const p=r>=u&&r<=u+d.nodeSize;o.push(Mu({editor:n,isEmptyDoc:l,dataAttribute:t,hasAnchor:p,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:Tu(e.emptyNodeClass,{editor:n,node:d,pos:u,hasAnchor:p})},node:d,pos:u}))}}else o.push(...Eu({editor:n,options:e,dataAttribute:t,doc:s,selection:i,from:0,to:s.content.size}));return ne.create(s,o)}function Qn(n,e){const t=n.resolve(e);if(t.depth===0){var s;const r=(s=t.nodeAfter)!==null&&s!==void 0?s:t.nodeBefore;if(!r)return{from:e,to:e};const o=t.nodeAfter?e:e-r.nodeSize;return{from:o,to:o+r.nodeSize}}const i=t.before(1);return{from:i,to:i+t.node(1).nodeSize}}function es(n,e){return{from:Math.max(0,e.from-1),to:Math.min(n.content.size,e.to-1)}}function YS(n,e,t){const s=[];return n.forEach((i,r)=>{const o=r,l=o+i.nodeSize,c=o+1,d=l+1;ce&&s.push({from:o,to:l})}),s}function XS(n){if(n.length===0)return[];const e=[...n].sort((s,i)=>s.from-i.from),t=[{...e[0]}];for(let s=1;se.from?t.push(es(n,Qn(n,Math.min(e.to,n.content.size+1)-1))):e.fromh.from>=d&&h.to<=u);p.length&&(l=l.remove(p));const f=Eu({editor:t,options:s,dataAttribute:i,doc:r,selection:o,from:d,to:u});f.length&&(l=l.add(r,f))}return l}function nC({editor:n,options:e,dataAttribute:t}){return{init(s,i){const r=Au({editor:n,options:e,dataAttribute:t,doc:i.doc,selection:i.selection});return r!=null?r:ne.empty},apply(s,i,r,o){return!s.docChanged&&!s.selectionSet?i:tC({decorations:i.map(s.mapping,s.doc),ranges:QS(s,r,o),editor:n,options:e,dataAttribute:t,doc:o.doc,selection:o.selection})}}}function sC(n){return n.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function iC({editor:n,options:e}){const t=e.dataAttribute?`data-${sC(e.dataAttribute)}`:`data-${Cu}`,s=e.showOnlyCurrent&&!e.includeChildren;return new oe({key:wa,...s?{}:{state:nC({editor:n,options:e,dataAttribute:t})},props:{decorations:s?({doc:i,selection:r})=>Au({editor:n,options:e,dataAttribute:t,doc:i,selection:r}):i=>{var r;return e.showOnlyWhenEditable&&!n.isEditable?ne.empty:(r=wa.getState(i))!==null&&r!==void 0?r:ne.empty}}})}pe.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:Cu,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[iC({editor:this.editor,options:this.options})]}});function Yr(n,e){return!n.selection.empty&&!Ld(n.selection)&&e.isEditable}function rC(n,e){return Yr(n,e)&&!e.isFocused&&!e.view.dragging}function oC(){var n;(n=window.getSelection())===null||n===void 0||n.removeAllRanges()}function lC(n){n.focus()}pe.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new oe({key:new me("selection"),props:{decorations(t){return rC(t,n)?ne.create(t.doc,[Le.inline(t.selection.from,t.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(t){return Yr(t.state,n)&&oC(),!1},focus(t){return Yr(t.state,n)&&requestAnimationFrame(()=>{!n.isDestroyed&&t.hasFocus()&&lC(t)}),!1}}}})]}});function Sa({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||(e==null?void 0:e.type)===n}const aC=pe.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new me(this.name),t=this.options.node||((n=this.editor.schema.topNodeType.contentMatch.defaultType)===null||n===void 0?void 0:n.name)||"paragraph",s=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(t).includes(i.name));return[new oe({key:e,appendTransaction:(i,r,o)=>{const{doc:l,tr:c,schema:d}=o,u=e.getState(o),p=l.content.size,f=d.nodes[t];if(!i.some(h=>h.getMeta("skipTrailingNode"))&&u)return c.insert(p,f.create())},state:{init:(i,r)=>{const o=r.tr.doc.lastChild;return!Sa({node:o,types:s})},apply:(i,r)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return r;const o=i.doc.lastChild;return!Sa({node:o,types:s})}}})]}}),cC=pe.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>md(n,e),redo:()=>({state:n,dispatch:e})=>gd(n,e)}},addProseMirrorPlugins(){return[f1(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),dC=pe.create({name:"starterKit",addExtensions(){const n=[];if(this.options.bold!==!1&&n.push(sw.configure(this.options.bold)),this.options.blockquote!==!1&&n.push(Zx.configure(this.options.blockquote)),this.options.bulletList!==!1&&n.push(fu.configure(this.options.bulletList)),this.options.code!==!1&&n.push(lw.configure(this.options.code)),this.options.codeBlock!==!1&&n.push(dw.configure(this.options.codeBlock)),this.options.document!==!1&&n.push(uw.configure(this.options.document)),this.options.dropcursor!==!1&&n.push(JS.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&n.push(GS.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&n.push(pw.configure(this.options.hardBreak)),this.options.heading!==!1&&n.push(fw.configure(this.options.heading)),this.options.undoRedo!==!1&&n.push(cC.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&n.push(hw.configure(this.options.horizontalRule)),this.options.italic!==!1&&n.push(vw.configure(this.options.italic)),this.options.listItem!==!1&&n.push(yu.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;n.push(ku.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var t;n.push(Qw.configure((t=this.options)===null||t===void 0?void 0:t.link))}if(this.options.orderedList!==!1&&n.push(wu.configure(this.options.orderedList)),this.options.paragraph!==!1&&n.push($S.configure(this.options.paragraph)),this.options.strike!==!1&&n.push(PS.configure(this.options.strike)),this.options.text!==!1&&n.push(BS.configure(this.options.text)),this.options.underline!==!1){var s;n.push(_S.configure((s=this.options)===null||s===void 0?void 0:s.underline))}if(this.options.trailingNode!==!1){var i;n.push(aC.configure((i=this.options)===null||i===void 0?void 0:i.trailingNode))}return n}});var uC=dC;const pC=()=>({type:"doc",content:[{type:"paragraph"}]});function Ca(n={}){var t;if(((t=n.content)==null?void 0:t.type)==="doc")return n.content;const e=String(n.text||"").split(` +`)})}s.push({type:"list_item",raw:r.raw,tokens:d}),i=p}else i+=1}return s}function MS(n,e){return n.map(t=>{if(t.type!=="list_item")return e.parseChildren([t])[0];const s=[];return t.tokens&&t.tokens.length>0&&t.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")s.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const r=e.parseChildren([i]);s.push({type:"paragraph",content:r})}else{const r=e.parseChildren([i]);r.length>0&&s.push(...r)}}),{type:"listItem",content:s}})}const TS=64;function va(n,e){const t=[];let s=0;for(;t.lengthn.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>{const e=n.getAttribute("type");if(e)return e;const t=n.getAttribute("style");if(t){const i=xa(t);if(i)return i}const s=n.querySelector("li");if(s){const i=s.getAttribute("style");if(i){const r=xa(i);if(r)return r}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,type:t,...s}=n,i=ke(this.options.HTMLAttributes,s);return e!==1&&(i.start=e),t&&t!=="1"&&(i.type=t),["ol",i,0]},markdownTokenName:"list",parseMarkdown:(n,e)=>{if(n.type!=="list"||!n.ordered)return[];const t=n.start||1,s=n.typeMarker,i=n.items?MS(n.items,e):[],r={};return t!==1&&(r.start=t),s&&(r.type=s),Object.keys(r).length>0?{type:"orderedList",attrs:r,content:i}:{type:"orderedList",content:i}},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` +`):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(n,e,t)=>{var s,i;const[r,o,l]=ES(n);if(r.length===0)return;const c=xu(r,r[0].indent,t);if(c.length!==0)return{type:"list",ordered:!0,start:((s=r[0])===null||s===void 0?void 0:s.number)||1,typeMarker:(i=r[0])===null||i===void 0?void 0:i.type,items:c,raw:l.slice(0,o).join(` +`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(AS,this.editor.getAttributes(ya)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new oe({props:{handlePaste:(n,e)=>{var t,s;const i=(t=e.clipboardData)===null||t===void 0?void 0:t.getData("text/html");if(i!=null&&i.trim())return!1;const r=(s=e.clipboardData)===null||s===void 0?void 0:s.getData("text/plain");if(!r)return!1;const o=CS(r);if(!o)return!1;try{const l=n.state.schema.nodeFromJSON(o),c=n.state.tr.replaceSelectionWith(l);return n.dispatch(c),!0}catch(l){return!1}}}})]},addInputRules(){const n=(t,s)=>(!s.attrs.type||s.attrs.type==="1")&&s.childCount+s.attrs.start===+t[1];let e=On({find:ka,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:n});return(this.options.keepMarks||this.options.keepAttributes)&&(e=On({find:ka,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(ya)}),joinPredicate:n,editor:this.editor})),[e]}}),OS=/^\s*(\[([( |x])?\])\s$/,NS="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",IS=(n,e,t)=>{var s;return(t==null||(s=t.checkboxLabel)===null||s===void 0?void 0:s.call(t,n,e))||`Task item checkbox for ${n.textContent||"empty task item"}`},DS=Fe.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:n=>{var e;return(e=n.querySelector("div"))!==null&&e!==void 0?e:n}}]},renderHTML({node:n,HTMLAttributes:e}){return["li",ke(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(n,e)=>{const t=[];if(n.tokens&&n.tokens.length>0?t.push(e.createNode("paragraph",{},e.parseInline(n.tokens))):n.text?t.push(e.createNode("paragraph",{},[e.createNode("text",{text:n.text})])):t.push(e.createNode("paragraph",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const s=e.parseChildren(n.nestedTokens);t.push(...s)}return e.createNode("taskItem",{checked:n.checked||!1},t)},renderMarkdown:(n,e)=>{var t;const s=`- [${!((t=n.attrs)===null||t===void 0)&&t.checked?"x":" "}] `;return Ud(n,e,s)},addExtensions(){return this.options.nested?[hu(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:s})=>{const i=document.createElement("li"),r=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),c=document.createElement("div");o.style.cssText=NS;const d=p=>{const f=IS(p,p.attrs.checked,this.options.a11y);l.setAttribute("aria-label",f),o.textContent=f};d(n),r.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",p=>p.preventDefault()),l.addEventListener("change",p=>{if(!s.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:f}=p.target;s.isEditable&&typeof t=="function"&&s.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const g=t();if(typeof g!="number")return!1;const b=h.doc.nodeAt(g);return h.setNodeMarkup(g,void 0,{...b==null?void 0:b.attrs,checked:f}),!0}).run(),!s.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,f)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([p,f])=>{i.setAttribute(p,f)}),i.dataset.checked=n.attrs.checked,l.checked=n.attrs.checked,r.append(l,o),i.append(r,c),Object.entries(e).forEach(([p,f])=>{i.setAttribute(p,f)});let u=new Set(Object.keys(e));return{dom:i,contentDOM:c,update:p=>{if(p.type!==this.type)return!1;i.dataset.checked=p.attrs.checked,l.checked=p.attrs.checked,d(p);const f=s.extensionManager.attributes,h=ps(p,f),g=new Set(Object.keys(h)),b=this.options.HTMLAttributes;return u.forEach(m=>{g.has(m)||(m in b?i.setAttribute(m,b[m]):i.removeAttribute(m))}),Object.entries(h).forEach(([m,v])=>{v==null?m in b?i.setAttribute(m,b[m]):i.removeAttribute(m):i.setAttribute(m,v)}),u=g,!0}}}},addInputRules(){return[On({find:OS,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),$S=Fe.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",ke(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},parseMarkdown:(n,e)=>e.createNode("taskList",{},e.parseChildren(n.items||[])),renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` +`):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||e===void 0?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const s=r=>{const o=na(r,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,c)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:t.inlineTokens(l.mainContent),nestedTokens:c}),customNestedParser:s},t);if(o){const l={type:"taskList",raw:o.raw,items:o.items},c=r.slice(o.raw.length);return c.trim()?[l,...t.blockTokens(c)]:[l]}return t.blockTokens(r)},i=na(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:r=>({indentLevel:r[1].length,mainContent:r[4],checked:r[3].toLowerCase()==="x"}),createToken:(r,o)=>({type:"taskItem",raw:"",mainContent:r.mainContent,indentLevel:r.indentLevel,checked:r.checked,text:r.mainContent,tokens:t.inlineTokens(r.mainContent),nestedTokens:o}),customNestedParser:s},t);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});pe.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(fu.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(vu.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(ku.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(wu.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(DS.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push($S.configure(this.options.taskList)),n}});const Ps=" ",vr=" ",RS=Fe.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",ke(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];if(t.length===1&&t[0].type==="image")return e.parseChildren([t[0]]);const s=e.parseInline(t);return t.length===1&&t[0].type==="text"&&(t[0].raw===Ps||t[0].text===Ps||t[0].raw===vr||t[0].text===vr)&&s.length===1&&s[0].type==="text"&&(s[0].text===Ps||s[0].text===vr)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,s)},renderMarkdown:(n,e,t)=>{if(!n)return"";const s=Array.isArray(n.content)?n.content:[];if(s.length===0){var i,r;const o=Array.isArray(t==null||(i=t.previousNode)===null||i===void 0?void 0:i.content)?t.previousNode.content:[];return(t==null||(r=t.previousNode)===null||r===void 0?void 0:r.type)==="paragraph"&&o.length===0?Ps:""}return e.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),LS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,PS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,BS=an.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",ke(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[on({find:LS,type:this.type})]},addPasteRules(){return[Pt({find:PS,type:this.type})]}}),_S=Fe.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""}),zS=an.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",ke(this.options.HTMLAttributes,n),0]},parseMarkdown(n,e){return e.applyMark(this.name||"underline",e.parseInline(n.tokens||[]))},renderMarkdown(n,e){return`++${e.renderChildren(n)}++`},markdownTokenizer:{name:"underline",level:"inline",start(n){return n.indexOf("++")},tokenize(n,e,t){const s=/^(\+\+)([\s\S]+?)(\+\+)/.exec(n);if(!s)return;const i=s[2].trim();return{type:"underline",raw:s[0],text:i,tokens:t.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function jS(n={}){return new oe({view(e){return new FS(e,n)}})}class FS{constructor(e,t){var s;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=(s=t.width)!==null&&s!==void 0?s:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let r=o=>{this[i](o)};return e.dom.addEventListener(i,r),{name:i,handler:r}})}destroy(){this.setCursor(null),this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc)if(this.lastDragEvent){let s=this.computeTarget(this.lastDragEvent);s==this.cursorPos?this.updateOverlay():this.setCursor(s)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,s,i=this.editorView.dom,r=i.getBoundingClientRect(),o=r.width/i.offsetWidth,l=r.height/i.offsetHeight;if(t){let p=e.nodeBefore,f=e.nodeAfter;if(p||f){let h=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(h){let g=h.getBoundingClientRect(),b=p?g.bottom:g.top;p&&f&&(b=(b+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let m=this.width/2*l;s={left:g.left,right:g.right,top:b-m,bottom:b+m}}}}if(!s){let p=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;s={left:p.left-f,right:p.left+f,top:p.top,bottom:p.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let d,u;if(!c||c==document.body&&getComputedStyle(c).position=="static")d=-pageXOffset,u=-pageYOffset;else{let p=c.getBoundingClientRect(),f=p.width/c.offsetWidth,h=p.height/c.offsetHeight;d=p.left-c.scrollLeft*f,u=p.top-c.scrollTop*h}this.element.style.left=(s.left-d)/o+"px",this.element.style.top=(s.top-u)/l+"px",this.element.style.width=(s.right-s.left)/o+"px",this.element.style.height=(s.bottom-s.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),s=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=s&&s.type.spec.disableDropCursor,r=typeof i=="function"?i(this.editorView,t,e):i;if(!t||r)return null;let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=lc(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}return o}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class ue extends X{constructor(e){super(e,e)}map(e,t){let s=e.resolve(t.map(this.head));return ue.valid(s)?new ue(s):X.near(s)}content(){return z.empty}eq(e){return e instanceof ue&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ue(e.resolve(t.pos))}getBookmark(){return new Po(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!VS(e)||!HS(e))return!1;let s=t.type.spec.allowGapCursor;if(s!=null)return s;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,s=!1){e:for(;;){if(!s&&ue.valid(e))return e;let i=e.pos,r=null;for(let o=e.depth;;o--){let l=e.node(o);if(t>0?e.indexAfter(o)0){r=l.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let c=e.doc.resolve(i);if(ue.valid(c))return c}for(;;){let o=t>0?r.firstChild:r.lastChild;if(!o){if(r.isAtom&&!r.isText&&!W.isSelectable(r)){e=e.doc.resolve(i+r.nodeSize*t),s=!1;continue e}break}r=o,i+=t;let l=e.doc.resolve(i);if(ue.valid(l))return l}return null}}}ue.prototype.visible=!1;ue.findFrom=ue.findGapCursorFrom;X.jsonID("gapcursor",ue);class Po{constructor(e){this.pos=e}map(e){return new Po(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return ue.valid(t)?new ue(t):X.near(t)}}function Su(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function VS(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),s=n.node(e);if(t==0){if(s.type.spec.isolating)return!0;continue}for(let i=s.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||Su(i.type))return!0;if(i.inlineContent)return!1}}return!0}function HS(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),s=n.node(e);if(t==s.childCount){if(s.type.spec.isolating)return!0;continue}for(let i=s.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||Su(i.type))return!0;if(i.inlineContent)return!1}}return!0}function qS(){return new oe({props:{decorations:JS,createSelectionBetween(n,e,t){return e.pos==t.pos&&ue.valid(t)?new ue(t):null},handleClick:WS,handleKeyDown:US,handleDOMEvents:{beforeinput:KS}}})}const US=ud({ArrowLeft:Bs("horiz",-1),ArrowRight:Bs("horiz",1),ArrowUp:Bs("vert",-1),ArrowDown:Bs("vert",1)});function Bs(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(s,i,r){let o=s.selection,l=e>0?o.$to:o.$from,c=o.empty;if(o instanceof U){if(!r.endOfTextblock(t)||l.depth==0)return!1;c=!1,l=s.doc.resolve(e>0?l.after():l.before())}let d=ue.findGapCursorFrom(l,e,c);return d?(i&&i(s.tr.setSelection(new ue(d))),!0):!1}}function WS(n,e,t){if(!n||!n.editable)return!1;let s=n.state.doc.resolve(e);if(!ue.valid(s))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&W.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new ue(s))),!0)}function KS(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof ue))return!1;let{$from:t}=n.state.selection,s=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!s)return!1;let i=$.empty;for(let o=s.length-1;o>=0;o--)i=$.from(s[o].createAndFill(null,i));let r=n.state.tr.replace(t.pos,t.pos,new z(i,0,0));return r.setSelection(U.near(r.doc.resolve(t.pos+1))),n.dispatch(r),!1}function JS(n){if(!(n.selection instanceof ue))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ne.create(n.doc,[Le.widget(n.selection.head,e,{key:"gapcursor"})])}pe.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc;if(((n==null?void 0:n.mode)||this.options.mode)==="textSize"){const t=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(t)}return e.nodeSize},this.storage.words=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new oe({key:new me("characterCount"),appendTransaction:(e,t,s)=>{if(n)return;const i=this.options.limit,r=this.options.autoTrim;if(i==null||i===0||r===!1){n=!0;return}const o=this.storage.characters({node:s.doc});if(o>i){const l=o-i,c=0,d=l;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const u=s.tr.deleteRange(c,d);return n=!0,u}n=!0},filterTransaction:(e,t)=>{const s=this.options.limit;if(!e.docChanged||s===0||s===null||s===void 0)return!0;const i=this.storage.characters({node:t.doc}),r=this.storage.characters({node:e.doc});if(r<=s||i>s&&r>s&&r<=i)return!0;if(i>s&&r>s&&r>i||!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,l=o-(r-s),c=o;return e.deleteRange(l,c),!(this.storage.characters({node:e.doc})>s)}})]}});const GS=pe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[jS(this.options)]}});pe.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new oe({key:new me("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:s}=this.editor,{anchor:i}=e,r=[];if(!t||!s)return ne.create(n,[]);let o=0;this.options.mode==="deepest"&&n.descendants((c,d)=>{if(!c.isText){if(!(i>=d&&i<=d+c.nodeSize-1))return!1;o+=1}});let l=0;return n.descendants((c,d)=>{if(c.isText||!(i>=d&&i<=d+c.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&o-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";r.push(Le.node(d,d+c.nodeSize,{class:this.options.className}))}),ne.create(n,r)}}})]}});const YS=pe.create({name:"gapCursor",addProseMirrorPlugins(){return[qS()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=se(V(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),Cu="placeholder",wa=new me("tiptap__placeholder");function Mu(n){const{editor:e,placeholder:t,dataAttribute:s,pos:i,node:r,isEmptyDoc:o,hasAnchor:l,classes:{emptyNode:c,emptyEditor:d}}=n,u=[c];return o&&u.push(d),Le.node(i,i+r.nodeSize,{class:u.join(" "),[s]:typeof t=="function"?t({editor:e,node:r,pos:i,hasAnchor:l}):t})}function Tu(n,e){return typeof n=="function"?n(e):n}function Eu({editor:n,options:e,dataAttribute:t,doc:s,selection:i,from:r,to:o}){const{anchor:l}=i,c=[],d=n.isEmpty;return s.nodesBetween(r,o,(u,p)=>{const f=l>=p&&l<=p+u.nodeSize,h=!u.isLeaf&&ys(u);return u.type.isTextblock&&(f||!e.showOnlyCurrent)&&h&&c.push(Mu({editor:n,isEmptyDoc:d,dataAttribute:t,hasAnchor:f,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:Tu(e.emptyNodeClass,{editor:n,node:u,pos:p,hasAnchor:f})},node:u,pos:p})),e.includeChildren}),c}function Au({editor:n,options:e,dataAttribute:t,doc:s,selection:i}){if(!(n.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:r}=i,o=[],l=n.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const c=s.resolve(r),d=c.depth>0?c.node(1):c.nodeAfter,u=c.depth>0?c.before(1):r;if(d&&d.type.isTextblock&&ys(d)){const p=r>=u&&r<=u+d.nodeSize;o.push(Mu({editor:n,isEmptyDoc:l,dataAttribute:t,hasAnchor:p,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:Tu(e.emptyNodeClass,{editor:n,node:d,pos:u,hasAnchor:p})},node:d,pos:u}))}}else o.push(...Eu({editor:n,options:e,dataAttribute:t,doc:s,selection:i,from:0,to:s.content.size}));return ne.create(s,o)}function es(n,e){const t=n.resolve(e);if(t.depth===0){var s;const r=(s=t.nodeAfter)!==null&&s!==void 0?s:t.nodeBefore;if(!r)return{from:e,to:e};const o=t.nodeAfter?e:e-r.nodeSize;return{from:o,to:o+r.nodeSize}}const i=t.before(1);return{from:i,to:i+t.node(1).nodeSize}}function ts(n,e){return{from:Math.max(0,e.from-1),to:Math.min(n.content.size,e.to-1)}}function XS(n,e,t){const s=[];return n.forEach((i,r)=>{const o=r,l=o+i.nodeSize,c=o+1,d=l+1;ce&&s.push({from:o,to:l})}),s}function ZS(n){if(n.length===0)return[];const e=[...n].sort((s,i)=>s.from-i.from),t=[{...e[0]}];for(let s=1;se.from?t.push(ts(n,es(n,Math.min(e.to,n.content.size+1)-1))):e.fromh.from>=d&&h.to<=u);p.length&&(l=l.remove(p));const f=Eu({editor:t,options:s,dataAttribute:i,doc:r,selection:o,from:d,to:u});f.length&&(l=l.add(r,f))}return l}function sC({editor:n,options:e,dataAttribute:t}){return{init(s,i){const r=Au({editor:n,options:e,dataAttribute:t,doc:i.doc,selection:i.selection});return r!=null?r:ne.empty},apply(s,i,r,o){return!s.docChanged&&!s.selectionSet?i:nC({decorations:i.map(s.mapping,s.doc),ranges:eC(s,r,o),editor:n,options:e,dataAttribute:t,doc:o.doc,selection:o.selection})}}}function iC(n){return n.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function rC({editor:n,options:e}){const t=e.dataAttribute?`data-${iC(e.dataAttribute)}`:`data-${Cu}`,s=e.showOnlyCurrent&&!e.includeChildren;return new oe({key:wa,...s?{}:{state:sC({editor:n,options:e,dataAttribute:t})},props:{decorations:s?({doc:i,selection:r})=>Au({editor:n,options:e,dataAttribute:t,doc:i,selection:r}):i=>{var r;return e.showOnlyWhenEditable&&!n.isEditable?ne.empty:(r=wa.getState(i))!==null&&r!==void 0?r:ne.empty}}})}pe.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:Cu,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[rC({editor:this.editor,options:this.options})]}});function Yr(n,e){return!n.selection.empty&&!Ld(n.selection)&&e.isEditable}function oC(n,e){return Yr(n,e)&&!e.isFocused&&!e.view.dragging}function lC(){var n;(n=window.getSelection())===null||n===void 0||n.removeAllRanges()}function aC(n){n.focus()}pe.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new oe({key:new me("selection"),props:{decorations(t){return oC(t,n)?ne.create(t.doc,[Le.inline(t.selection.from,t.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(t){return Yr(t.state,n)&&lC(),!1},focus(t){return Yr(t.state,n)&&requestAnimationFrame(()=>{!n.isDestroyed&&t.hasFocus()&&aC(t)}),!1}}}})]}});function Sa({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||(e==null?void 0:e.type)===n}const cC=pe.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new me(this.name),t=this.options.node||((n=this.editor.schema.topNodeType.contentMatch.defaultType)===null||n===void 0?void 0:n.name)||"paragraph",s=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(t).includes(i.name));return[new oe({key:e,appendTransaction:(i,r,o)=>{const{doc:l,tr:c,schema:d}=o,u=e.getState(o),p=l.content.size,f=d.nodes[t];if(!i.some(h=>h.getMeta("skipTrailingNode"))&&u)return c.insert(p,f.create())},state:{init:(i,r)=>{const o=r.tr.doc.lastChild;return!Sa({node:o,types:s})},apply:(i,r)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return r;const o=i.doc.lastChild;return!Sa({node:o,types:s})}}})]}}),dC=pe.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>md(n,e),redo:()=>({state:n,dispatch:e})=>gd(n,e)}},addProseMirrorPlugins(){return[h1(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),uC=pe.create({name:"starterKit",addExtensions(){const n=[];if(this.options.bold!==!1&&n.push(iw.configure(this.options.bold)),this.options.blockquote!==!1&&n.push(Qx.configure(this.options.blockquote)),this.options.bulletList!==!1&&n.push(fu.configure(this.options.bulletList)),this.options.code!==!1&&n.push(aw.configure(this.options.code)),this.options.codeBlock!==!1&&n.push(uw.configure(this.options.codeBlock)),this.options.document!==!1&&n.push(pw.configure(this.options.document)),this.options.dropcursor!==!1&&n.push(GS.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&n.push(YS.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&n.push(fw.configure(this.options.hardBreak)),this.options.heading!==!1&&n.push(hw.configure(this.options.heading)),this.options.undoRedo!==!1&&n.push(dC.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&n.push(mw.configure(this.options.horizontalRule)),this.options.italic!==!1&&n.push(kw.configure(this.options.italic)),this.options.listItem!==!1&&n.push(vu.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;n.push(ku.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var t;n.push(eS.configure((t=this.options)===null||t===void 0?void 0:t.link))}if(this.options.orderedList!==!1&&n.push(wu.configure(this.options.orderedList)),this.options.paragraph!==!1&&n.push(RS.configure(this.options.paragraph)),this.options.strike!==!1&&n.push(BS.configure(this.options.strike)),this.options.text!==!1&&n.push(_S.configure(this.options.text)),this.options.underline!==!1){var s;n.push(zS.configure((s=this.options)===null||s===void 0?void 0:s.underline))}if(this.options.trailingNode!==!1){var i;n.push(cC.configure((i=this.options)===null||i===void 0?void 0:i.trailingNode))}return n}});var pC=uC;const fC=()=>({type:"doc",content:[{type:"paragraph"}]});function Ca(n={}){var t;if(((t=n.content)==null?void 0:t.type)==="doc")return n.content;const e=String(n.text||"").split(` `).map(s=>({type:"paragraph",...s?{content:[{type:"text",text:s}]}:{}}));for(const s of n.mediaIds||[])e.push({type:"media",attrs:{mediaId:s}});return{type:"doc",content:e}}function Ma(n){const e=[],t=s=>{s.type==="media"&&s.attrs.mediaId&&e.push(s.attrs.mediaId);for(const i of s.content||[])t(i)};return t(n),[...new Set(e)]}function Ta(n){const e=t=>t.type==="text"?t.text:t.type==="hardBreak"?` `:(t.content||[]).map(e).join("")+(["paragraph","heading"].includes(t.type)?` -`:"");return e(n).trim()}function fC(n,e){const t=i=>String(i!=null?i:"").replace(/[&<>"']/g,r=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[r]),s=i=>{var l,c,d;if(i.type==="text")return(i.marks||[]).reduce((u,p)=>{const f={bold:"strong",italic:"em",strike:"s",underline:"u"}[p.type];return f?`<${f}>${u}`:u},t(i.text));if(i.type==="hardBreak")return"
";if(i.type==="media")return/^[a-f0-9]{16}$/.test(((l=i.attrs)==null?void 0:l.mediaId)||"")?e(i.attrs.mediaId):"";const r=(i.content||[]).map(s).join("");if(i.type==="doc")return r;const o={paragraph:"p",heading:((c=i.attrs)==null?void 0:c.level)===3?"h3":"h2",blockquote:"blockquote",bulletList:"ul",orderedList:"ol",listItem:"li"}[i.type];return o?`<${o}${o==="ol"&&Number.isInteger((d=i.attrs)==null?void 0:d.start)?` start="${Math.max(1,Math.min(9999,i.attrs.start))}"`:""}>${r||"
"}`:""};return s(n)}const hC={class:"journal-rich-editor"},mC={class:"journal-editor-toolbar",role:"toolbar","aria-label":"正文格式"},gC=["aria-pressed"],bC=["aria-pressed"],yC=["aria-pressed"],vC=["aria-pressed"],kC=["value"],xC={class:"journal-editor-foot"},wC={__name:"RichJournalEditor",setup(n){const e=Xr(null),t=P(0),s=P("");let i=new Map,r=new Map,o=new Set,l;const c=Fe.create({name:"media",group:"block",atom:!0,draggable:!0,selectable:!0,addAttributes(){return{mediaId:{default:null},uploadClient:{default:null}}},parseHTML(){return[{tag:"figure[data-media-id]",getAttrs:b=>i.has(b.dataset.mediaId)?{mediaId:b.dataset.mediaId}:!1}]},renderHTML({node:b}){return["figure",{"data-media-id":b.attrs.mediaId}]},addNodeView(){return({node:b,getPos:m,editor:y})=>{const S=document.createElement("figure");S.className="journal-inline-media",S.contentEditable="false";let A="";const O=()=>{const B=r.get(b.attrs.uploadClient),E=i.get(b.attrs.mediaId),M=JSON.stringify([E&&[E.name,E.mime,E.src],B&&[B.name,B.status,B.progress,B.error]]);if(A===M)return;A=M,S.querySelectorAll("audio,video").forEach(N=>{N.pause(),N.removeAttribute("src"),N.load()}),S.replaceChildren();const w=document.createElement("figcaption");if(w.textContent=(E==null?void 0:E.name)||(B==null?void 0:B.name)||"云端素材引用",S.append(w),!(E!=null&&E.src)){const N=document.createElement("p");N.textContent=B?B.error||"正在上传 "+Math.round(B.progress||0)+"%":"素材暂不可用",S.append(N)}if(E!=null&&E.src){const N=document.createElement(E.mime.startsWith("image/")?"img":E.mime.startsWith("audio/")?"audio":"video");N.src=E.src,N.tagName==="IMG"?(N.alt=E.name,N.loading="lazy"):(N.controls=!0,N.preload="metadata",N.playsInline=!0,N.addEventListener("play",()=>document.querySelectorAll("#page-journal audio,#page-journal video").forEach(I=>{I!==N&&I.pause()}))),S.append(N)}const T=document.createElement("button");T.type="button",T.className="quiet",T.textContent="移除正文引用",T.setAttribute("aria-label","移除正文引用 "+((E==null?void 0:E.name)||"")),T.addEventListener("click",()=>{if(!y.isEditable)return;const N=m();typeof N=="number"&&y.chain().focus().deleteRange({from:N,to:N+b.nodeSize}).run()}),S.append(T)};return o.add(O),O(),{dom:S,update(B){return B.type!==b.type?!1:(b=B,O(),!0)},stopEvent:B=>B.target.closest("button,audio,video")!==null,ignoreMutation:()=>!0,destroy(){o.delete(O),S.querySelectorAll("audio,video").forEach(B=>{B.pause(),B.removeAttribute("src"),B.load()})}}}}});function d(b,m=!0){var y;s.value=Ta(b.getJSON()),t.value++,m&&((y=document.getElementById("journal-form"))==null||y.dispatchEvent(new Event("input",{bubbles:!0})))}function u(b){var m;(m=e.value)==null||m.destroy(),o.clear(),e.value=new Kx({extensions:[uC.configure({heading:{levels:[2,3]},link:!1,code:!1,codeBlock:!1,horizontalRule:!1}),c],content:b?Ca(b):pC(),editorProps:{attributes:{class:"journal-rich-input",role:"textbox","aria-label":"记事正文","aria-multiline":"true"},handlePaste(y,S){var O;const A=(O=S.clipboardData)==null?void 0:O.getData("text/plain");return A?(S.preventDefault(),y.dispatch(y.state.tr.insertText(A)),!0):!1}},onUpdate:({editor:y})=>d(y),onSelectionUpdate:()=>t.value++,onTransaction:()=>t.value++}),d(e.value,!1)}function p(b,m){var y;(y=e.value)==null||y.chain().focus()[b](m).run()}function f(b){var O;const m=e.value,y=m.state.selection,S=[{type:"media",attrs:b},{type:"paragraph"}],A=m.chain().focus();return((O=y.node)==null?void 0:O.type.name)==="media"?A.insertContentAt(y.to,S):A.insertContent(S),A.run()}function h(b){var m;return t.value,!!((m=e.value)!=null&&m.isActive(b))}function g(){const b=document.getElementById("journal-library");b&&(b.open=!0,b.scrollIntoView({behavior:"smooth",block:"start"}))}return $i(()=>{u(),l={reset:()=>u(),set:u,focus:()=>{var b;return(b=e.value)==null?void 0:b.commands.focus()},document:()=>e.value.getJSON(),ids:()=>Ma(e.value.getJSON()),plainText:()=>Ta(e.value.getJSON()),setEditable:b=>{var m;return(m=e.value)==null?void 0:m.setEditable(b)},insertMedia(b){if(!e.value.isEditable||!i.has(b))return!1;const m=Ma(e.value.getJSON());return!m.includes(b)&&m.length>=9?(window.alert("每条记事最多引用 9 个不同素材"),!1):f({mediaId:b})},clients(){const b=[];return e.value.state.doc.descendants(m=>{m.type.name==="media"&&m.attrs.uploadClient&&b.push(m.attrs.uploadClient)}),[...new Set(b)]},pending(){let b=!1;return e.value.state.doc.descendants(m=>{m.type.name==="media"&&!m.attrs.mediaId&&(b=!0)}),b},insertUpload(b){let m=0;return e.value.state.doc.descendants(y=>{y.type.name==="media"&&m++}),m>=9?(window.alert("本条最多添加 9 个媒体,请先保存记事"),!1):f({uploadClient:b})},removeUpload(b){const m=[];e.value.state.doc.descendants((S,A)=>{S.type.name==="media"&&S.attrs.uploadClient===b&&m.push([A,S.nodeSize])});const y=e.value.state.tr;for(const[S,A]of m.reverse())y.delete(S,S+A);y.docChanged&&e.value.view.dispatch(y)},resolveUpload(b,m){i.set(m.id,m);const y=e.value.state.tr;e.value.state.doc.descendants((S,A)=>{S.type.name==="media"&&S.attrs.uploadClient===b&&y.setNodeMarkup(A,void 0,{...S.attrs,mediaId:m.id})}),y.docChanged&&e.value.view.dispatch(y)},setTasks(b){r=new Map(b.map(m=>[m.clientId,m]));for(const m of o)m()},setMedia(b){i=new Map(b.map(m=>[m.id,m]));for(const m of o)m()},render:(b,m)=>fC(Ca(b),m),clearMedia(){i.clear(),r.clear();for(const b of o)b()}},window.ZhaoJournalEditor=l}),Bt(()=>{var b;(b=e.value)==null||b.destroy(),window.ZhaoJournalEditor===l&&delete window.ZhaoJournalEditor}),(b,m)=>(v(),x("div",hC,[a("div",mC,[a("button",{type:"button",class:"quiet","aria-pressed":h("bold"),onMousedown:m[0]||(m[0]=Ve(()=>{},["prevent"])),onClick:m[1]||(m[1]=y=>p("toggleBold"))},[...m[13]||(m[13]=[a("b",null,"加粗",-1)])],40,gC),a("button",{type:"button",class:"quiet","aria-pressed":h("italic"),onMousedown:m[2]||(m[2]=Ve(()=>{},["prevent"])),onClick:m[3]||(m[3]=y=>p("toggleItalic"))},[...m[14]||(m[14]=[a("i",null,"斜体",-1)])],40,bC),a("button",{type:"button",class:"quiet","aria-pressed":h("heading"),onMousedown:m[4]||(m[4]=Ve(()=>{},["prevent"])),onClick:m[5]||(m[5]=y=>p("toggleHeading",{level:2}))},"标题",40,yC),a("button",{type:"button",class:"quiet","aria-pressed":h("bulletList"),onMousedown:m[6]||(m[6]=Ve(()=>{},["prevent"])),onClick:m[7]||(m[7]=y=>p("toggleBulletList"))},"列表",40,vC),a("button",{type:"button",class:"quiet",onMousedown:m[8]||(m[8]=Ve(()=>{},["prevent"])),onClick:m[9]||(m[9]=y=>p("undo"))},"撤销",32),a("button",{type:"button",class:"quiet",onMousedown:m[10]||(m[10]=Ve(()=>{},["prevent"])),onClick:m[11]||(m[11]=y=>p("redo"))},"重做",32),a("button",{type:"button",class:"journal-insert-button",onMousedown:m[12]||(m[12]=Ve(()=>{},["prevent"])),onClick:g},"+ 插入云端素材",32)]),G(j(Jx),{editor:e.value},null,8,["editor"]),a("input",{type:"hidden",name:"text",value:s.value},null,8,kC),a("div",xC,[m[15]||(m[15]=a("span",null,"在光标处插入照片、视频、语音;可拖动媒体调整位置。",-1)),a("span",{class:De({"text-danger":s.value.length>5e3})},k(s.value.length)+" / 5000 字",3)])]))}},SC={key:0,class:"panel"},CC={class:"d-flex justify-content-between flex-wrap gap-3"},MC={key:0,class:"alert alert-danger",role:"alert"},TC={class:"fs-5"},EC={key:0,class:"d-block mb-3"},AC=["value"],OC={key:1,class:"d-block mb-3"},NC={key:2},IC={class:"row g-3"},DC={class:"col-md-6"},$C={class:"col-md-6"},RC={class:"d-flex gap-2"},LC=["disabled"],PC=["disabled"],BC={class:"row g-3"},_C={class:"card-body"},zC={class:"fs-5"},jC={key:0,class:"badge text-bg-success"},FC={class:"small text-secondary"},VC={class:"d-flex flex-wrap gap-2"},HC=["disabled","onClick"],qC=["disabled","onClick"],UC=["disabled","onClick"],WC={key:2,class:"alert alert-info mt-3"},KC={key:3,class:"border-top pt-3 mt-4"},JC=["value"],GC={class:"d-flex gap-2 my-3"},YC=["disabled"],XC={__name:"FamilyMembers",setup(n){const e=P(null),t=P(""),s=P(!1),i=P(null),r=P(""),o=P(!1),l=ee(()=>R.value.loggedIn&&R.value.page==="members"),c=ee(()=>(R.value.state.households||[]).filter(b=>b.id!==R.value.state.familyId));let d=0;async function u(){const b=++d;try{const m=await K().api("/api/members");b===d&&(e.value=m)}catch(m){b===d&&(t.value=m.message)}}Ae([l,()=>R.value.state.familyId,()=>R.value.session],()=>{d++,e.value=null,i.value=null,t.value="",r.value="",o.value=!1,s.value=!1,l.value&&u()},{immediate:!0});function p(b){i.value=b?{id:b.id,revision:b.revision,personId:b.personId,name:b.name,label:b.label,status:b.status}:{name:"",personId:"",label:"",status:"active",revision:0}}async function f(){if(s.value)return;s.value=!0,t.value="";const b=d;try{if(await K().api("/api/members",i.value),b!==d)return;i.value=null,await u(),await K().refresh()}catch(m){b===d&&(t.value=m.message)}finally{s.value=!1}}async function h(){if(s.value)return;s.value=!0,t.value="";const b=d;try{if(await K().api("/api/genealogy/share",{targetFamilyId:r.value,confirm:o.value}),b!==d)return;o.value=!1,r.value="",await u(),await K().refresh()}catch(m){b===d&&(t.value=m.message)}finally{s.value=!1}}async function g(b,m=!1){if(s.value)return;const y=d;s.value=!0,t.value="";try{m?await K().viewMemberHistory(b.personId,b.name,R.value.state.familyId):await K().viewPerson(b.personId,R.value.state.familyId)}catch(S){y===d&&!S.stale&&(t.value=S.message)}finally{y===d&&(s.value=!1)}}return(b,m)=>{var y,S,A,O,B;return l.value?(v(),x("section",SC,[a("div",CC,[m[8]||(m[8]=a("div",null,[a("h2",null,"家庭成员"),a("p",{class:"text-secondary"},"登记真实家人。老人、孩子无需账号;亲属关系与登录权限分别管理。")],-1)),(y=e.value)!=null&&y.canManage?(v(),x("button",{key:0,class:"btn btn-primary align-self-start",onClick:m[0]||(m[0]=E=>p())},"+ 登记成员")):D("",!0)]),t.value?(v(),x("p",MC,k(t.value),1)):D("",!0),i.value?(v(),x("form",{key:1,class:"border rounded p-3 mb-4",onSubmit:Ve(f,["prevent"])},[a("h3",TC,k(i.value.id?"编辑成员关系":"登记家庭成员"),1),i.value.id?D("",!0):(v(),x("label",EC,[m[10]||(m[10]=C("关联已有族谱人物",-1)),Y(a("select",{class:"form-select","onUpdate:modelValue":m[1]||(m[1]=E=>i.value.personId=E)},[m[9]||(m[9]=a("option",{value:""},"新建人物(尚未录入族谱)",-1)),(v(!0),x(H,null,J(((S=e.value)==null?void 0:S.candidates)||[],E=>(v(),x("option",{key:E.id,value:E.id},k(E.name),9,AC))),128))],512),[[Te,i.value.personId]])])),i.value.personId?i.value.id?(v(),x("p",NC,"人物:"+k(i.value.name)+"。姓名、生平及亲属关系在族谱中维护,仍遵守五代限制。",1)):D("",!0):(v(),x("label",OC,[m[11]||(m[11]=C("姓名",-1)),Y(a("input",{"onUpdate:modelValue":m[2]||(m[2]=E=>i.value.name=E),class:"form-control",maxlength:"80",required:""},null,512),[[At,i.value.name]])])),a("div",IC,[a("label",DC,[m[12]||(m[12]=C("家庭称呼/身份备注",-1)),Y(a("input",{"onUpdate:modelValue":m[3]||(m[3]=E=>i.value.label=E),class:"form-control",maxlength:"60",placeholder:"例如:妈妈、长子、亲友"},null,512),[[At,i.value.label]])]),a("label",$C,[m[14]||(m[14]=C("成员状态",-1)),Y(a("select",{"onUpdate:modelValue":m[4]||(m[4]=E=>i.value.status=E),class:"form-select"},[...m[13]||(m[13]=[a("option",{value:"active"},"当前成员",-1),a("option",{value:"away"},"暂住外地",-1),a("option",{value:"historical"},"历史成员",-1)])],512),[[Te,i.value.status]])])]),m[15]||(m[15]=a("p",{class:"small text-secondary mt-2"},"称呼是本家庭的备注,不自动建立父母、配偶关系或授予管理权限。成员状态不会删除人物和经历;住在外地也可以是家人。",-1)),a("div",RC,[a("button",{class:"btn btn-primary",disabled:s.value},"保存成员",8,LC),a("button",{type:"button",class:"btn btn-outline-secondary",disabled:s.value,onClick:m[5]||(m[5]=E=>i.value=null)},"取消",8,PC)])],32)):D("",!0),a("div",BC,[(v(!0),x(H,null,J(((A=e.value)==null?void 0:A.items)||[],E=>(v(),x("article",{key:E.id,class:"col-md-6 col-xl-4"},[a("div",{class:De(["card h-100",{"border-primary bg-primary-subtle":E.self}])},[a("div",_C,[a("h3",zC,[C(k(E.name)+" ",1),E.self?(v(),x("span",jC,"本人")):D("",!0)]),a("p",null,k(E.label||"家庭身份待补充")+" · "+k({active:"当前成员",away:"暂住外地",historical:"历史成员"}[E.status]),1),a("p",FC,k(E.hasAccount?"已有关联账号":"无需注册账号")+k(E.lifeStatus==="deceased"?" · 已故":""),1),a("div",VC,[e.value.canViewGenealogy?(v(),x("button",{key:0,class:"btn btn-sm btn-outline-primary",disabled:s.value,onClick:M=>g(E)},"人物与亲属",8,HC)):D("",!0),a("button",{class:"btn btn-sm btn-outline-primary",disabled:s.value,onClick:M=>g(E,!0)},"个人阅历",8,qC),e.value.canManage?(v(),x("button",{key:1,class:"btn btn-sm btn-outline-secondary",disabled:s.value,onClick:M=>p(E)},"编辑成员关系",8,UC)):D("",!0)])])],2)]))),128))]),e.value&&!e.value.items.length?(v(),x("p",WC,"还没有登记成员。已有族谱人物可直接关联,避免重复建人。")):D("",!0),j(R).platformAdmin?(v(),x("details",KC,[m[19]||(m[19]=a("summary",null,"与相关家庭共用族谱",-1)),m[20]||(m[20]=a("p",{class:"small text-secondary mt-2"},"相关家庭共用人物与亲属关系;活动、设备、位置授权继续独立。现有同名人物不会自动合并,需核对身份。世代范围限制继续有效。",-1)),a("p",null,"当前已关联:"+k((B=(O=e.value)==null?void 0:O.genealogyHomes)==null?void 0:B.map(E=>E.name).join("、")),1),a("form",{onSubmit:Ve(h,["prevent"])},[a("label",null,[m[17]||(m[17]=C("关联家庭",-1)),Y(a("select",{"onUpdate:modelValue":m[6]||(m[6]=E=>r.value=E),class:"form-select",required:""},[m[16]||(m[16]=a("option",{value:""},"请选择",-1)),(v(!0),x(H,null,J(c.value,E=>(v(),x("option",{value:E.id,key:E.id},k(E.name),9,JC))),128))],512),[[Te,r.value]])]),a("label",GC,[Y(a("input",{"onUpdate:modelValue":m[7]||(m[7]=E=>o.value=E),type:"checkbox",required:""},null,512),[[st,o.value]]),m[18]||(m[18]=C("确认双方族谱人物与关系共用,有族谱查看权限的账号可以查看合并后的族谱",-1))]),a("button",{class:"btn btn-outline-primary",disabled:s.value||!o.value||!r.value},"确认共用族谱",8,YC)],32)])):D("",!0)])):D("",!0)}}},ZC={key:0,class:"panel"},QC={class:"d-flex flex-wrap justify-content-between gap-2"},eM={key:0,class:"alert alert-danger",role:"alert"},tM={class:"table-responsive"},nM={class:"table align-middle"},sM={key:0},iM=["onClick"],rM={class:"row g-3"},oM={class:"col-md-6"},lM=["value"],aM={class:"col-md-6"},cM=["value"],dM={class:"col-md-6"},uM={class:"col-md-6"},pM=["disabled"],fM={__name:"AccountAccess",setup(n){const e=P([]),t=P(""),s=P(!1),i=P(""),r=P(""),o=P("member"),l=P("none"),c=ee(()=>R.value.loggedIn&&R.value.page==="accounts"&&R.value.platformAdmin),d=ee(()=>R.value.state.households||[]),u=ee(()=>e.value.find(m=>m.id===i.value));let p=0;async function f(){const m=++p;try{const y=await K().api("/api/platform/users");m===p&&(e.value=y.users)}catch(y){m===p&&(t.value=y.message)}}Ae([c,()=>R.value.session],()=>{p++,e.value=[],i.value="",r.value="",t.value="",s.value=!1,c.value&&f()},{immediate:!0}),Ae([i,r],()=>{var y,S;const m=(S=(y=u.value)==null?void 0:y.familyGrants)==null?void 0:S[r.value];o.value=(m==null?void 0:m.role)||"member",l.value=(m==null?void 0:m.familyAccess)||"none"});async function h(){if(s.value)return;s.value=!0,t.value="";const m=p;try{await K().api("/api/users/grant",{userId:i.value,familyId:r.value,role:o.value,familyAccess:l.value}),m===p&&(await f(),await K().refresh())}catch(y){m===p&&(t.value=y.message)}finally{s.value=!1}}async function g(m){await K().editAccount(m.id,m.familyId)}const b=m=>{var y;return((y=d.value.find(S=>S.id===m))==null?void 0:y.name)||"未知家庭"};return(m,y)=>c.value?(v(),x("section",ZC,[a("div",QC,[y[5]||(y[5]=a("div",null,[a("h2",null,"系统用户"),a("p",{class:"text-secondary"},"一个账号可访问多个家庭,分别授权。账号与家庭成员档案独立。")],-1)),a("button",{class:"btn btn-outline-primary align-self-start",onClick:y[0]||(y[0]=S=>j(K)().showPage("users"))},"账号建档与密码管理")]),t.value?(v(),x("p",eM,k(t.value),1)):D("",!0),a("div",tM,[a("table",nM,[y[7]||(y[7]=a("thead",null,[a("tr",null,[a("th",null,"登录账号"),a("th",null,"主要授权家庭"),a("th",null,"其他家庭权限"),a("th",null,"状态"),a("th")])],-1)),a("tbody",null,[(v(!0),x(H,null,J(e.value,S=>(v(),x("tr",{key:S.id},[a("td",null,[a("strong",null,k(S.name),1),y[6]||(y[6]=a("br",null,null,-1)),C(k(S.username),1)]),a("td",null,k(S.role==="admin"?"平台管理员":b(S.familyId)),1),a("td",null,[S.role==="admin"?(v(),x("span",sM,"可管理全部家庭;查看位置仍须本人单独授权")):D("",!0),(v(!0),x(H,null,J(S.familyGrants||{},(A,O)=>(v(),x("div",{key:O},k(b(O))+" · "+k(A.role==="family_admin"?"家庭管理员":"访问账号"),1))),128))]),a("td",null,k(S.disabled?"已停用":"启用"),1),a("td",null,[a("button",{class:"btn btn-sm btn-outline-secondary",onClick:A=>g(S)},"编辑账号",8,iM)])]))),128))])])]),a("form",{class:"border-top pt-3",onSubmit:Ve(h,["prevent"])},[y[16]||(y[16]=a("h3",{class:"fs-5"},"设置账号的其他家庭访问权限",-1)),a("div",rM,[a("label",oM,[y[9]||(y[9]=C("系统账号",-1)),Y(a("select",{"onUpdate:modelValue":y[1]||(y[1]=S=>i.value=S),class:"form-select",required:""},[y[8]||(y[8]=a("option",{value:""},"请选择",-1)),(v(!0),x(H,null,J(e.value.filter(S=>S.role!=="admin"),S=>(v(),x("option",{key:S.id,value:S.id},k(S.name)+" · "+k(S.username),9,lM))),128))],512),[[Te,i.value]])]),a("label",aM,[y[11]||(y[11]=C("家庭",-1)),Y(a("select",{"onUpdate:modelValue":y[2]||(y[2]=S=>r.value=S),class:"form-select",required:""},[y[10]||(y[10]=a("option",{value:""},"请选择",-1)),(v(!0),x(H,null,J(d.value.filter(S=>{var A;return S.id!==((A=u.value)==null?void 0:A.familyId)}),S=>(v(),x("option",{key:S.id,value:S.id},k(S.name),9,cM))),128))],512),[[Te,r.value]])]),a("label",dM,[y[13]||(y[13]=C("家庭权限",-1)),Y(a("select",{"onUpdate:modelValue":y[3]||(y[3]=S=>o.value=S),class:"form-select"},[...y[12]||(y[12]=[a("option",{value:"member"},"允许进入(不含设备控制)",-1),a("option",{value:"family_admin"},"管理本家庭及其设备",-1),a("option",{value:"none"},"取消此家庭访问",-1)])],512),[[Te,o.value]])]),a("label",uM,[y[15]||(y[15]=C("族谱权限",-1)),Y(a("select",{"onUpdate:modelValue":y[4]||(y[4]=S=>l.value=S),class:"form-select"},[...y[14]||(y[14]=[a("option",{value:"none"},"不授权",-1),a("option",{value:"read"},"查看",-1),a("option",{value:"edit"},"维护本人上下五代",-1)])],512),[[Te,l.value]])])]),y[17]||(y[17]=a("p",{class:"small text-secondary mt-3"},"授权不会自动登记为家庭成员,也不会自动获得任何人的位置。修改权限后该账号需重新登录。",-1)),a("button",{class:"btn btn-primary",disabled:s.value||!i.value||!r.value},"保存访问权限",8,pM)],32)])):D("",!0)}},hM={key:0,class:"panel mb-4"},mM={key:0},gM={class:"table-responsive"},bM={class:"table align-middle"},yM={key:0,class:"d-block text-danger"},vM=["onClick"],kM={key:1,class:"text-danger"},xM={__name:"MapStorage",setup(n){const e=P(null),t=P(""),s=ee(()=>R.value.loggedIn&&R.value.page==="storage"&&R.value.platformAdmin);let i,r=0;const o=u=>((u||0)/1024/1024).toFixed(1)+" MB",l={queued:"等待下载",downloading:"下载底图",restoring:"从网盘恢复",uploading:"上传网盘",verifying:"核对云端文件",ready:"可使用",cloud:"已归档 · 本地已释放",retry:"等待重试"};async function c(){const u=r;try{const p=await K().api("/api/maps");u===r&&(e.value=p,t.value="")}catch(p){u===r&&(t.value=p.message)}finally{u===r&&s.value&&(i=setTimeout(c,15e3))}}async function d(u){try{await K().api("/api/maps",{action:"retry",id:u}),clearTimeout(i),c()}catch(p){t.value=p.message}}return Ae(s,u=>{r++,clearTimeout(i),u&&c()},{immediate:!0}),Bt(()=>{r++,clearTimeout(i)}),(u,p)=>{var f,h;return s.value?(v(),x("section",hM,[p[1]||(p[1]=a("div",{class:"d-flex justify-content-between"},[a("h2",{class:"fs-5"},"内置地图 · 网盘归档与本机缓存"),a("span",{class:"badge text-bg-light"},"全国概览常驻")],-1)),p[2]||(p[2]=a("p",{class:"text-secondary small"},"家人开启位置共享、进入某个省份后,自动准备该省详细地图。同一省份共用一份。上传并核对成功的省份缓存可回收,需要时从百度网盘取回。",-1)),e.value?(v(),x("p",mM,"本机 "+k(o(e.value.usedBytes))+" / "+k(o(e.value.cacheLimitBytes))+" · 为其他服务至少预留 "+k(o(e.value.reserveBytes)),1)):D("",!0),a("div",gM,[a("table",bM,[p[0]||(p[0]=a("thead",null,[a("tr",null,[a("th",null,"地图"),a("th",null,"状态"),a("th",null,"本机"),a("th",null,"百度网盘"),a("th")])],-1)),a("tbody",null,[(v(!0),x(H,null,J((f=e.value)==null?void 0:f.items,g=>(v(),x("tr",{key:g.id},[a("td",null,k(g.name),1),a("td",null,[C(k(l[g.state]||g.state),1),g.error?(v(),x("small",yM,k(g.error),1)):D("",!0)]),a("td",null,k(o(g.localBytes)),1),a("td",null,k(g.cloud?"已校验归档":g.progress?g.progress+"%":"待归档"),1),a("td",null,[g.state==="retry"?(v(),x("button",{key:0,class:"btn btn-sm btn-outline-primary",onClick:b=>d(g.id)},"重试",8,vM)):D("",!0)])]))),128))])])]),t.value||(h=e.value)!=null&&h.error?(v(),x("p",kM,k(t.value||e.value.error),1)):D("",!0)])):D("",!0)}}},wM={id:"page-members",class:"page",hidden:""},SM={id:"page-accounts",class:"page",hidden:""},CM={id:"page-journal",class:"page",hidden:""},MM={id:"journal-editor-surface"},TM={id:"journal-form",class:"panel journal-compose"},EM={id:"page-overview",class:"page",hidden:""},AM={id:"page-device",class:"page",hidden:""},OM={id:"page-objects",class:"page",hidden:""},NM={id:"page-storage",class:"page",hidden:""},IM={__name:"Workspace",setup(n){return(e,t)=>(v(),x(H,null,[G(xM),a("section",wM,[G(XC)]),a("section",SM,[G(fM)]),t[16]||(t[16]=a("div",{id:"household-context",class:"household-context",hidden:""},[a("label",null,[C("当前归属 "),a("select",{id:"household-filter","aria-label":"当前归属"})]),a("span",{id:"household-context-note"}),a("button",{id:"scope-back",class:"quiet"},"返回场所")],-1)),t[17]||(t[17]=a("div",{id:"device-context",class:"device-context",hidden:""},[a("p",{id:"device-breadcrumb"}),a("div",{role:"group","aria-label":"设备功能"},[a("button",{class:"quiet","data-device-tab":"device"},"设备档案"),a("button",{class:"quiet","data-device-tab":"live"},"实时画面"),a("button",{class:"quiet","data-device-tab":"playback"},"录像回放"),a("button",{class:"quiet","data-device-tab":"cameras"},"镜头与设置")])],-1)),t[18]||(t[18]=ge('
设备—
已接通码流—
录像占用—
空间档案—
可选择任意区域,包含其下级区域
',3)),t[19]||(t[19]=a("section",{id:"page-settings",class:"page",hidden:""},[a("div",{class:"section-head"},[a("h2",null,"把这里布置成你习惯的样子"),a("button",{id:"settings-reload",class:"quiet"},"重新读取设置")]),a("p",{id:"settings-error",role:"status"}),a("div",{class:"settings-sections",role:"group","aria-label":"设置分类"},[a("button",{class:"quiet","data-settings-section":"preferences","aria-pressed":"true"},"我的偏好"),a("button",{class:"quiet","data-settings-section":"baidu","data-platform-setting":"",hidden:""},"网盘连接"),a("button",{class:"quiet","data-settings-section":"brand","data-platform-setting":"",hidden:""},"品牌与外观"),a("button",{class:"quiet","data-settings-section":"backup","data-platform-setting":"",hidden:""},"数据库备份")]),a("form",{id:"preferences-form",class:"panel"},[a("h3",null,"我的偏好"),a("p",{class:"description"},"只影响当前账号,保存后换电脑或手机登录也会沿用。切换选项可以预览,离开未保存的预览会撤销。"),a("div",{id:"personal-choices",class:"form-grid"}),a("p",{id:"preferences-status",role:"status"}),a("div",{class:"device-actions"},[a("button",{type:"submit"},"保存我的偏好"),a("button",{type:"button",id:"personal-follow",class:"quiet"},"全部跟随平台"),a("button",{type:"button",id:"personal-cancel",class:"quiet"},"撤销预览")])]),a("section",{id:"baidu-admin",class:"panel",hidden:""},[a("div",{class:"section-head"},[a("h3",null,"百度网盘 · 统一存储"),a("span",{class:"badge"},"仅超级管理员配置")]),a("p",{class:"description"},"连接一个网盘账号,统一保存封面、Logo、图标及各用户上传的照片、视频和语音。系统按用户、家庭和记事可见范围授权;网盘账号持有人本身可以管理网盘中的文件。服务器仅转发分片,不保存媒体原文件。"),a("details",{id:"baidu-storage-guide"},[a("summary",null,"文件存在哪里?"),a("ul",null,[a("li",null,"家庭与场所:按家庭或场所保存封面。"),a("li",null,"平台外观:保存 Logo 和图标。"),a("li",null,"个人记事:按家庭、用户分组,再分照片、视频、语音。"),a("li",null,"数据库备份:单独存放;新备份上传并校验成功后,清理超过一个自然月的旧云备份。")]),a("p",{class:"description"},"文字、权限和文件引用保存在本机数据库;个人媒体原文件保存在百度网盘。封面和品牌图片仅做有限的内存缓存。更换封面、移除附件或删除记事不会删除网盘原文件。")]),a("form",{id:"baidu-config"},[a("div",{class:"form-grid"},[a("label",null,[C("AppKey"),a("input",{name:"appKey",autocomplete:"off",maxlength:"150",required:""})]),a("label",null,[C("SecretKey"),a("input",{name:"secretKey",type:"password",autocomplete:"new-password",maxlength:"150"})]),a("label",null,[C("百度后台应用名称"),a("input",{name:"appFolder",value:"智家",required:"",maxlength:"40"})]),a("label",null,[C("OAuth 回调地址"),a("input",{name:"redirectUri",type:"url",placeholder:"https://你的域名/api/baidu/callback",required:"",maxlength:"400"})])]),a("p",{class:"description"},"回调地址须与百度后台完全一致。SecretKey 留空保持已保存值,SignKey 不需要填写。当前开发者应用仅限个人场景,适用范围以百度后台为准。"),a("p",{id:"baidu-config-status",role:"status"}),a("button",{type:"submit"},"保存网盘应用配置")]),a("hr"),a("p",{id:"baidu-status",role:"status"}),a("div",{class:"device-actions"},[a("button",{id:"baidu-connect"},"连接/重新授权百度网盘"),a("button",{id:"baidu-disconnect",class:"quiet"},"解除本机连接")]),a("p",{class:"description"},"解除连接不会删除云端文件。临时媒体地址由后台按需获取,令牌不发送给浏览器。网盘授权凭据单独保存在服务器受限目录,不包含在数据库备份或公开源码中。")]),a("div",{id:"settings-private",hidden:""},[a("form",{id:"brand-form",class:"panel"},[a("h3",null,"发布与品牌配置"),a("p",{class:"description"},"仅超级管理员可修改。名称、Logo、浏览器图标及登录文案会公开显示;适用于整套系统。已有个人偏好优先于平台默认。"),a("div",{class:"form-grid"},[a("label",null,[C("系统名称"),a("input",{name:"name",required:"",maxlength:"40"})]),a("label",null,[C("系统副标题"),a("input",{name:"subtitle",required:"",maxlength:"60"})]),a("label",{class:"full"},[C("页首题词"),a("input",{name:"motto",maxlength:"100"})]),a("label",null,[C("登录标题"),a("input",{name:"loginTitle",required:"",maxlength:"40"})]),a("label",null,[C("登录说明"),a("input",{name:"loginNote",maxlength:"160"})]),a("label",{class:"full"},[C("页脚说明"),a("input",{name:"footer",maxlength:"120"})])]),a("div",{class:"brand-image-grid"},[a("div",null,[a("img",{id:"brand-logo-preview",alt:"Logo 预览",src:"/zhao-icon.png"}),a("label",null,[C("更换系统 Logo"),a("input",{id:"brand-logo-file",type:"file",accept:"image/png,image/jpeg,image/webp"})]),a("button",{type:"button",id:"brand-logo-reset",class:"quiet"},"使用默认 Logo")]),a("div",null,[a("img",{id:"brand-icon-preview",alt:"浏览器图标预览",src:"/zhao-icon.png"}),a("label",null,[C("更换浏览器图标"),a("input",{id:"brand-icon-file",type:"file",accept:"image/png,image/jpeg,image/webp"})]),a("button",{type:"button",id:"brand-icon-reset",class:"quiet"},"使用默认图标")])]),a("p",{class:"description"},"支持 PNG、JPEG、WebP,原图最多 5 MB;上传时自动缩小,图片随系统数据库保存。"),a("h3",null,"新账号与跟随平台账号的默认外观"),a("div",{id:"brand-defaults",class:"form-grid"}),a("p",{id:"brand-status",role:"status"}),a("div",{class:"device-actions"},[a("button",{type:"submit"},"保存发布配置"),a("button",{type:"button",id:"brand-export",class:"quiet"},"导出发布配置"),a("label",{class:"config-import"},[C("导入配置到表单"),a("input",{id:"brand-import",type:"file",accept:"application/json,.json"})])]),a("p",{class:"description"},"导入后先核对再保存。导出的配置只含品牌与默认外观,不含账号、设备凭据、家庭资料和网络备份目录。")]),a("section",{id:"backup-panel",class:"panel"},[a("h3",null,"数据库备份"),a("p",{class:"description"},"整台服务的数据库包含所有家庭、账号、设备连接配置和网盘文件引用,因此仅超级管理员可操作。网盘中的照片、视频、语音及录像文件不包含在新数据库副本中;旧版备份可能仍含历史内嵌图片。恢复后所有账号需要重新登录。"),a("form",{id:"backup-form"},[a("div",{class:"form-grid"},[a("label",{class:"check full"},[a("input",{name:"enabled",type:"checkbox"}),C("启用每日定时备份")]),a("label",{class:"check full"},[a("input",{name:"baidu",type:"checkbox"}),C("同时上传到已连接的百度网盘")]),a("label",null,[C("每日时间(北京时间)"),a("input",{name:"time",type:"time",required:"",value:"03:00"})]),a("label",null,[C("本机/挂载目录保留份数"),a("input",{name:"keep",type:"number",min:"1",max:"90",required:"",value:"14"})]),a("label",{class:"full"},[C("网络备份目录(可留空)"),a("input",{name:"networkPath",maxlength:"500",placeholder:"/var/lib/zhaovision/network-backup"})])]),a("p",{class:"description"},"填写本服务器已挂载的网络盘目录。使用百度接口备份只需勾选上方选项;此路径用于其他已挂载的网络存储,不能填网页地址或分享链接。写入网络目录成功不等于已确认百度云端同步完成。"),a("p",{class:"description"},"默认部署允许写入 /var/lib/zhaovision 下的目录。挂载和目录权限须由主机管理员配置;本页不会保存网盘登录密码。保留份数只清理本机和挂载目录中本系统生成的旧备份,百度网盘保留最近一个自然月;新备份上传并校验成功后才清理本应用的过期副本。"),a("p",{id:"backup-local-path",class:"description"}),a("p",{id:"backup-save-status",role:"status"}),a("button",{type:"submit"},"保存备份设置")]),a("div",{class:"section-head"},[a("h3",null,"备份记录"),a("button",{id:"backup-run"},"立即备份数据库")]),a("p",{id:"backup-result",role:"status"}),a("div",{id:"backup-history"})])])],-1)),a("section",CM,[t[6]||(t[6]=a("div",{class:"scope-intro"},[a("span",{class:"eyebrow"},"岁月有迹 · 日常成章"),a("h2",null,"把生活,写成自己的来时路"),a("p",null,"与家人分享近况,也为自己留下一份阅历。")],-1)),a("div",MM,[t[4]||(t[4]=a("div",{class:"journal-editor-heading"},[a("strong",null,"记下此刻 · 留住声音"),a("button",{id:"journal-record",disabled:"",type:"button"},"● 开始录音"),a("button",{id:"journal-stop-record",type:"button",hidden:""},"■ 结束录音并插入"),a("button",{id:"journal-discard-record",type:"button",class:"quiet",hidden:""},"取消录音"),a("span",{id:"journal-record-elapsed",role:"status"}),a("button",{id:"journal-pick-media",disabled:"",type:"button",class:"quiet"},"插入照片/视频"),a("button",{type:"submit",form:"journal-form"},"保存"),a("button",{id:"journal-expand",type:"button",class:"quiet"},"全屏编辑"),a("button",{id:"journal-close-editor",type:"button",class:"quiet",hidden:""},"关闭编辑 · Esc")],-1)),a("form",TM,[t[0]||(t[0]=ge('

写一条记事

文字和媒体按正文顺序呈现。先将光标放在想插入的位置,再选择云端素材。

',6)),G(wC),t[1]||(t[1]=ge('
参与/相关家人(可多选)
录入账号与经历中的人物分别记录;未注册的老人和孩子也可关联。关联人物不会扩大可见范围。
',1)),t[2]||(t[2]=a("p",{id:"journal-status",role:"status","aria-live":"polite"},null,-1)),t[3]||(t[3]=a("div",{class:"device-actions"},[a("button",{id:"journal-save",type:"submit"},"保存记事"),a("button",{id:"journal-new",type:"button",class:"quiet"},"另写一条")],-1))]),t[5]||(t[5]=a("section",{class:"panel journal-materials","aria-label":"云端素材"},[a("div",{class:"section-head"},[a("div",null,[a("h3",null,"云端素材"),a("p",{class:"description"},"上传即插入正文,在原位置显示进度。上传期间可以继续写文字。")])]),a("div",{class:"journal-add-media"},[a("label",{class:"quiet"},[C("+ 上传照片、视频、语音"),a("input",{id:"journal-files",disabled:"",type:"file",multiple:"",accept:"image/jpeg,image/png,image/webp,video/mp4,video/quicktime,video/webm,audio/mpeg,audio/mp4,audio/aac,audio/wav,audio/ogg,audio/webm,.m4a"})]),a("button",{id:"journal-cancel-upload",type:"button",class:"quiet",hidden:""},"暂停全部上传")]),a("p",{id:"journal-cloud-note",class:"description"}),a("p",{class:"description"},"可混合选择文件,同时上传 3 个;单个最多 256 MB。每条正文可引用 9 个不同素材。录音最长 5 分钟。"),a("p",{id:"journal-upload-status",role:"status","aria-live":"polite"}),a("div",{id:"journal-upload-list"}),a("details",{id:"journal-library",class:"journal-library"},[a("summary",null,[C("我的云端素材("),a("span",{id:"journal-library-count"},"0"),C(")")]),a("div",{class:"journal-library-list-tools"},[a("span",{class:"description"},"已保存正文使用的素材,可在其他记事中再次引用。"),a("label",null,[C("筛选"),a("select",{id:"journal-media-filter"},[a("option",{value:""},"全部素材"),a("option",{value:"image/"},"照片"),a("option",{value:"video/"},"视频"),a("option",{value:"audio/"},"语音"),a("option",{value:"unused"},"草稿临时素材")])])]),a("div",{id:"journal-library-list",class:"journal-upload-grid"})]),a("details",{id:"journal-trash",class:"journal-trash",hidden:""},[a("summary",null,[C("已移除素材("),a("span",{id:"journal-trash-count"},"0"),C(")")]),a("p",{class:"description"},"仍被正文引用的素材可以恢复;最后一个引用删除后,网盘原文件自动删除。"),a("div",{id:"journal-trash-list"})]),a("details",{id:"journal-cleanup",hidden:""},[a("summary",null,"网盘清理记录"),a("button",{id:"journal-cleanup-refresh",type:"button",class:"quiet"},"刷新清理状态"),a("div",{id:"journal-cleanup-list"})]),a("p",{class:"description"},"放弃草稿或关闭页面会取消本次上传,并删除无其他引用的文件。意外断网退出时,服务器在草稿失联 10 分钟后自动清理。删除最后一处正文引用,也会删除网盘文件。")],-1))]),t[7]||(t[7]=ge('

个人阅历保留同一条记事的正文、媒体和互动;查看他人时只展示其分享给当前家庭/场所的内容。删除正文中的媒体或整条记事,会解除对应引用;最后一个引用删除后,网盘原文件自动清理。

',2)),t[8]||(t[8]=a("div",{class:"section-head"},[a("p",{id:"journal-query-status",role:"status"}),a("div",null,[a("button",{id:"journal-prev",class:"quiet"},"上一页"),a("button",{id:"journal-next",class:"quiet"},"下一页")])],-1)),t[9]||(t[9]=a("div",{id:"journal-list",class:"journal-feed"},null,-1))]),a("section",EM,[G(sb),t[10]||(t[10]=a("div",{id:"scope-overview"},null,-1))]),a("section",AM,[G(eg),t[11]||(t[11]=a("div",{id:"device-detail"},null,-1))]),t[20]||(t[20]=a("section",{id:"page-heritage",class:"page",hidden:""},[a("div",{id:"heritage-home"})],-1)),t[21]||(t[21]=a("section",{id:"page-live",class:"page"},[a("div",{class:"section-head"},[a("h2",{id:"live-heading"},"本场所监控墙"),a("div",null,[a("label",null,[C("清晰度 "),a("select",{id:"quality"},[a("option",{value:"hd"},"主码流"),a("option",{value:"compat"},"子码流")])])])]),a("details",{class:"live-help"},[a("summary",null,"画面与清晰度说明"),a("p",{id:"wall-context",class:"description"},"这里汇总当前场所内已授权的镜头;点击摄像头详情可进入单台设备。"),a("p",{class:"description",id:"quality-note"},"主码流画面更清晰,最高 1920×1080;子码流更流畅,最高 768×432,适合网络较慢时使用。")]),a("div",{class:"wall-toolbar"},[a("label",null,[C("分屏 "),a("select",{id:"wall-layout"},[a("option",{value:"auto"},"自适应"),a("option",{value:"1"},"1 画面"),a("option",{value:"2"},"2 画面"),a("option",{value:"4"},"4 画面"),a("option",{value:"6"},"6 画面"),a("option",{value:"9"},"9 画面"),a("option",{value:"16"},"16 画面")])]),a("label",{class:"check"},[a("input",{id:"wall-arrange",type:"checkbox"}),C("调整顺序")]),a("div",{class:"wall-paging"},[a("button",{id:"wall-prev",class:"quiet","aria-label":"上一组画面"},"‹"),a("span",{id:"wall-page"}),a("button",{id:"wall-next",class:"quiet","aria-label":"下一组画面"},"›")]),a("span",{id:"wall-clock"}),a("button",{id:"wall-fullscreen"},"全屏监控")]),a("div",{id:"live-grid",class:"live-grid"}),a("section",{id:"ptz-panel",class:"ptz-panel",hidden:""},[a("div",null,[a("strong",{id:"ptz-title"},"云台"),a("p",{id:"ptz-status",role:"status"})]),a("div",{class:"ptz-pad"},[a("button",{"data-ptz-action":"up","aria-label":"云台向上"},"↑"),a("button",{"data-ptz-action":"left","aria-label":"云台向左"},"←"),a("button",{"data-ptz-action":"stop"},"停止"),a("button",{"data-ptz-action":"right","aria-label":"云台向右"},"→"),a("button",{"data-ptz-action":"down","aria-label":"云台向下"},"↓")]),a("div",{id:"ptz-presets"},[a("div",{class:"section-head"},[a("strong",null,[C("常用位置 "),a("small",{id:"preset-count"})]),a("button",{id:"preset-reload",class:"quiet"},"重新读取")]),a("p",{id:"preset-status",role:"status"}),a("div",{id:"preset-list"}),a("p",{class:"description"},"调整位置后可另存为新预置位。本版不覆盖已有位置,避免设备固件拒绝或误改。"),a("form",{id:"preset-form",hidden:""},[a("label",null,[C("当前位置名称"),a("input",{id:"preset-name",required:"",maxlength:"40",placeholder:"例如:大门、院子"})]),a("button",{type:"submit"},"保存当前位置")]),a("div",{id:"preset-confirmation",hidden:""},[a("p",{id:"preset-confirm-text"}),a("button",{id:"preset-confirm-yes"},"确认"),a("button",{id:"preset-confirm-cancel",class:"quiet"},"取消")])]),a("button",{id:"ptz-close",class:"quiet"},"收起云台")])],-1)),t[22]||(t[22]=a("section",{id:"page-playback",class:"page",hidden:""},[a("div",{class:"section-head"},[a("h2",null,[C("回到那一刻 "),a("small",null,"光阴")])]),a("div",{class:"panel playback-controls"},[a("label",null,[C("镜头 / 通道"),a("select",{id:"play-camera"})]),a("label",null,[C("录像来源"),a("select",{id:"archive-source"},[a("option",{value:"recorder"},"录像机原有录像(待接入)"),a("option",{value:"baidu"},"百度网盘录像"),a("option",{value:"local"},"本机待上传录像")])]),a("label",null,[C("日期"),a("input",{id:"play-date",type:"date"})]),a("button",{id:"query-recordings"},"查找录像"),a("span",{id:"play-info"},"选择日期,查看实际录像时段")]),a("aside",{id:"recording-health",class:"panel","aria-label":"本机录像状态",hidden:""},[a("div",{class:"section-head"},[a("strong",{id:"recording-health-text",role:"status"}),a("button",{id:"recording-configure",class:"quiet",hidden:""},"录像设置")]),a("p",{id:"recording-policy-note",class:"description"}),a("p",{id:"recording-start-note",class:"description"})]),a("div",{class:"video-panel"},[a("video",{id:"play-video",controls:"",playsinline:""}),a("div",{id:"play-empty",class:"video-empty"},"选择一个有录像的时间段")]),a("div",{class:"panel"},[a("div",{class:"timeline-head"},[a("strong",null,"当日时间轴"),a("span",null,[a("i",{class:"legend"}),C(" 有录像的时段 · 点击定位")])]),a("canvas",{id:"timeline",height:"76","aria-label":"录像时间轴"}),a("div",{class:"time-labels"},[a("span",null,"00:00"),a("span",null,"06:00"),a("span",null,"12:00"),a("span",null,"18:00"),a("span",null,"24:00")]),a("div",{class:"seek-row"},[a("label",null,[C("定位时间 "),a("input",{id:"seek-time",type:"time",step:"1",value:"12:00:00"})]),a("button",{id:"seek-button",class:"secondary"},"定位播放"),a("a",{id:"download",class:"button secondary",hidden:""},"下载原始片段")])]),a("div",{class:"panel"},[a("div",{class:"playback-tools"},[a("label",{class:"check"},[a("input",{id:"play-autonext",type:"checkbox",checked:""}),C("自动续播下一时段(跳过空档)")]),a("button",{id:"play-snapshot",class:"quiet"},"回放截图"),a("span",{id:"play-position",role:"status"})]),a("details",{class:"clip-editor"},[a("summary",null,"选取并下载指定片段"),a("form",{id:"clip-form"},[a("div",{class:"form-grid"},[a("label",null,[C("开始时间"),a("input",{id:"clip-start",type:"datetime-local",step:"1",required:""})]),a("label",null,[C("结束时间"),a("input",{id:"clip-end",type:"datetime-local",step:"1",required:""})])]),a("div",{class:"playback-tools"},[a("button",{type:"button",class:"quiet","data-clip-mark":"start"},"当前位置作起点"),a("button",{type:"button",class:"quiet","data-clip-mark":"end"},"当前位置作终点"),a("button",{type:"submit"},"生成下载链接"),a("a",{id:"clip-download",class:"button secondary",hidden:""},"下载所选片段")]),a("p",{id:"clip-status",role:"status",class:"description"}),a("p",{class:"description"},"每段最多一小时,不可跨越无录像时段。下载保留原始编码,剪辑边界可能受设备关键帧影响。")])])]),a("div",{id:"recording-list",class:"recording-list"})],-1)),t[23]||(t[23]=ge('',1)),a("section",OM,[t[12]||(t[12]=ge('

一物一档 设备 · 归属

同一设备可同时记录类型、区域、所有人、负责人和标签。分组顺序可自由组合,例如“灯 → 卧室”或“负责人 → 类型 → 区域”。人员归属不自动授予访问权限。

',2)),t[13]||(t[13]=a("div",{class:"panel device-view-controls"},[a("div",{class:"device-search-row"},[a("label",null,[C("设备类型"),a("select",{id:"device-type"},[a("option",{value:""},"所有类型")])]),a("label",null,[C("搜索设备或人员"),a("input",{id:"device-search",type:"search",placeholder:"例如:卧室 灯;也可查 IP、品牌、型号、人员"})]),a("button",{id:"device-clear",type:"button",class:"quiet",hidden:""},"清除设备筛选")]),a("div",{class:"device-actions view-presets",role:"group","aria-label":"设备分组方式"},[a("button",{type:"button",class:"quiet","data-group-preset":"space,type"},"按区域查看"),a("button",{type:"button",class:"quiet","data-group-preset":"type,space"},"按类型查看"),a("button",{type:"button",class:"quiet","data-group-preset":"manager,type,space"},"按负责人查看")]),a("details",{class:"group-custom"},[a("summary",null,"自定义分组顺序"),a("p",{class:"description"},"依次分组(前面的维度优先,区域按你定义的完整层级展示)"),a("div",{id:"device-group-order",class:"device-group-order"}),a("div",{class:"device-actions"},[a("button",{id:"device-group-add",class:"quiet"},"+ 增加分组维度"),a("button",{"data-admin":"",id:"device-view-save",class:"secondary"},"保存为本归属的默认视图")])]),a("p",{id:"device-count",class:"description"})],-1)),t[14]||(t[14]=a("div",{class:"device-actions",role:"group","aria-label":"设备展示方式"},[a("button",{id:"devices-card-view",class:"quiet","aria-pressed":"true"},"设备卡片"),a("button",{id:"devices-topology-view",class:"quiet","aria-pressed":"false"},"网络拓扑")],-1)),G(Om),G(Zm),G(dg)]),t[24]||(t[24]=ge('',2)),a("section",NM,[G(Xb),t[15]||(t[15]=ge('

录像与存储 留存

录像上传与保留策略

网盘录像默认每段 5 分钟,按录制时间上传;云端大小及 SHA-256 校验成功后删除本地片段。上传失败会保留并自动重试,未上传片段不会按天数清理。云端默认保留 30 天。容量上限由全部摄像头共用;临时录像分区另有硬容量限制,空间不足时暂停并在释放后恢复。

运行状态

每台摄像头可选择录像机或百度网盘。网盘方式临时保存原始主码流,上传并校验后腾出本机空间。预览默认使用主码流高清画面(最高 1920×1080、15 帧/秒),也可切换子码流流畅画面(最高 768×432、10 帧/秒)。本机录像保留设备原始编码。

最近操作

',2))]),t[25]||(t[25]=a("section",{id:"page-heritage-records",class:"page",hidden:""},[a("div",{class:"section-head"},[a("h2",{id:"heritage-records-title"},"文化与家风"),a("div",null,[a("button",{class:"quiet","data-page":"heritage"},"返回家庭传承"),a("button",{id:"heritage-new"},"+ 新建档案")])]),a("div",{class:"panel heritage-controls"},[a("label",null,[C("查找档案"),a("input",{id:"heritage-search",type:"search",placeholder:"名称、内容、相关人员"})]),a("label",{class:"check"},[a("input",{id:"heritage-archived",type:"checkbox"}),C("包含归档资料")]),a("button",{id:"heritage-reload",class:"quiet"},"重新载入")]),a("p",{id:"heritage-error",class:"form-error",role:"status"}),a("div",{id:"heritage-list",class:"site-grid"}),a("aside",{id:"heritage-detail",class:"panel",hidden:""})],-1)),t[26]||(t[26]=a("section",{id:"page-family",class:"page",hidden:""},[a("div",{class:"section-head"},[a("h2",null,[C("家族的来处与延续 "),a("small",null,"世系 · 传承")]),a("div",null,[a("button",{id:"family-reload",class:"quiet"},"重新载入"),a("button",{id:"family-export",class:"quiet"},"导出家谱"),a("button",{id:"new-person"},"+ 录入人物")])]),a("p",{class:"description"},"从祖辈到后辈,一张图看全家。点击人物查看档案,暖金色卡片是当前账号关联的本人。"),a("p",{id:"family-edit-note",class:"alert alert-info",role:"status"}),a("div",{class:"panel family-toolbar"},[a("label",null,[C("关系参照人物"),a("select",{id:"family-reference"})]),a("label",null,[C("查找人物"),a("input",{id:"family-search",type:"search",placeholder:"姓名、别名或籍贯"})]),a("button",{id:"family-find",class:"quiet",hidden:""},"定位搜索结果"),a("label",{class:"check"},[a("input",{id:"family-archived",type:"checkbox"}),C("显示归档人物")]),a("span",{id:"family-count"})]),a("div",{id:"family-error",class:"form-error",role:"status"}),a("div",{id:"family-workspace",class:"family-workspace"},[a("section",{id:"family-canvas-panel",class:"family-canvas-panel","aria-label":"全家关系图"},[a("div",{class:"family-map-heading"},[a("div",null,[a("span",{class:"eyebrow"},"枝叶相连 · 世代相承"),a("h2",{id:"family-view-title"},"全家关系图")]),a("div",{class:"family-view-tabs",role:"group","aria-label":"家谱显示方式"},[a("button",{id:"family-view-tree",class:"quiet","aria-pressed":"true"},"关系图"),a("button",{id:"family-view-list",class:"quiet","aria-pressed":"false"},"人物名册"),a("button",{id:"family-view-timeline",class:"quiet","aria-pressed":"false"},"家族时间线")])]),a("div",{id:"family-map-controls",class:"family-map-controls"},[a("div",{class:"family-zoom-controls"},[a("button",{id:"family-zoom-out",class:"quiet","aria-label":"缩小家谱"},"−"),a("output",{id:"family-zoom-value","aria-live":"polite"},"100%"),a("button",{id:"family-zoom-in",class:"quiet","aria-label":"放大家谱"},"+"),a("button",{id:"family-fit",class:"quiet"},"查看全谱")]),a("button",{id:"family-locate-self",class:"quiet"},"◎ 定位本人"),a("button",{id:"family-fullscreen",class:"quiet"},"全屏家谱")]),a("div",{id:"family-tree",class:"family-map-viewport",tabindex:"0",role:"region","aria-label":"家谱关系图,可拖动空白处或使用滚动条浏览"}),a("div",{id:"family-people",class:"family-people family-register",hidden:""}),a("section",{id:"family-events",hidden:"","aria-label":"家族重大记事"},[a("div",{class:"family-event-intro"},[a("div",null,[a("h3",null,"把值得记住的事,留给后来的人"),a("p",{class:"description"},"按事情发生的日期排列,可关联多位亲人,并附上详细记载或报道链接。")]),a("button",{id:"family-new-event"},"+ 写一则记事")]),a("div",{class:"family-event-filters"},[a("label",null,[C("关联人物"),a("select",{id:"family-event-person"},[a("option",{value:""},"全家")])]),a("label",null,[C("年份"),a("select",{id:"family-event-year"},[a("option",{value:""},"所有年份")])]),a("label",null,[C("排列"),a("select",{id:"family-event-order"},[a("option",{value:"desc"},"从近到远"),a("option",{value:"asc"},"从远到近")])]),a("label",null,[C("搜索记事"),a("input",{id:"family-event-search",type:"search",placeholder:"标题、摘要或正文"})]),a("label",{class:"check"},[a("input",{id:"family-event-relatives",type:"checkbox"}),C("包括此人的父母、配偶和子女")]),a("label",{id:"family-event-state-label"},[C("状态"),a("select",{id:"family-event-state"},[a("option",{value:"published"},"已发布"),a("option",{value:"draft"},"草稿箱"),a("option",{value:"archived"},"已归档"),a("option",{value:"all"},"全部")])]),a("button",{id:"family-event-clear",class:"quiet"},"清除筛选")]),a("p",{id:"family-event-count",class:"description",role:"status"}),a("div",{id:"family-timeline",class:"family-timeline"})]),a("div",{id:"family-map-footer",class:"family-map-footer"},[a("div",{class:"family-map-legend"},[a("span",null,[a("i",{class:"legend-self"}),C("本人")]),a("span",null,[a("i",{class:"legend-selected"}),C("正在查看")]),a("span",null,[a("i",{class:"legend-parent"}),C("父母 → 子女")]),a("span",null,[a("i",{class:"legend-spouse"}),C("配偶")]),a("span",null,[a("i",{class:"legend-adoptive"}),C("收养 / 继亲")])]),a("p",{id:"family-map-note",class:"description",role:"status"}),a("span",{class:"description"},"拖动空白处移动 · 点击人物查看档案 · 关系称谓按参照人物计算")])]),a("aside",{id:"family-detail",class:"panel family-inspector","aria-label":"人物档案"})])],-1)),G(ih),t[27]||(t[27]=ge('
赵府 · 智能数字管家独立部署 / 数据自有
',2))],64))}},DM={};function $M(n,e){return v(),x(H,null,[e[0]||(e[0]=ge('
灯火可亲 · 归家有时

欢迎回来

使用自己的账号,进入家庭空间。

设备档案

网络与连接

保存后自动更新拓扑。网络信息用于设备档案;摄像机实际取流地址在“配置镜头”内设置。选择人员不改变账号访问权限。

手机、灯、冰箱等当前支持设备档案、分类和责任归属。自动控制需另行接入对应协议,登记不代表已连接设备。

传承资料

这里只保存资料和意愿;不会据此转移财产或授予任何账号权限。链接内容保存在原位置,本系统保存链接和文字记录。

空间档案

镜头通道配置

直接接入摄像头时,可读取设备实际提供的媒体配置。端口请按设备填写:通常为 80,部分 TP-Link 设备为 2020。服务器需要能够访问该设备所在网络。

选择录像机时,本平台不重复录制,须在录像机上开启录像计划;设备是否实际录制需在原厂后台核对。选择百度网盘时,请勾选启用网盘录像。账号和密码只保存在本机受限数据目录。RTSP 服务响应代表设备可达,实际码流接通后才显示在线。路径预设需要与设备型号、通道一致。

摄像头对象

网络与连接

保存后自动更新拓扑。网络信息用于设备档案;摄像机实际取流地址在“配置镜头”内设置。选择人员不改变账号访问权限。

录像机配置

网络与连接

保存后自动更新拓扑。网络信息用于设备档案;摄像机实际取流地址在“配置镜头”内设置。选择人员不改变账号访问权限。

驱动在当前版本提供路径模板。录像机历史录像检索、回放及通道自动导入,需要型号确认后接入,当前尚未实现。

',7)),e[1]||(e[1]=a("dialog",{id:"leadership-dialog"},[a("form",{id:"leadership-form"},[a("div",{class:"dialog-heading"},[a("h2",null,"负责人安排与交接"),a("button",{type:"button",class:"quiet","data-close":"leadership-dialog"},"关闭")]),a("input",{name:"id",type:"hidden"}),a("input",{name:"revision",type:"hidden"}),a("p",{class:"description"},"从已获本家庭访问权限的系统账号中,指定主要和备用负责人。主要负责人即一家之主;普通账号需明确确认授予本家庭管理权限。真实家庭成员可以没有登录账号。"),a("p",{id:"leadership-scope",class:"fw-semibold"}),a("div",{id:"leadership-empty",class:"alert alert-info",role:"status",hidden:""},"本家庭还没有可选账号。请由平台管理员在系统用户中授予家庭访问权限,再指定负责人。"),a("div",{class:"leadership-member-actions d-flex flex-wrap gap-2 mb-3"},[a("button",{type:"button",id:"leadership-new",class:"secondary"},"+ 添加本家庭管理员"),a("button",{type:"button",id:"leadership-members",class:"quiet"},"管理授权账号")]),a("div",{class:"form-grid"},[a("label",null,[C("主要负责人 *"),a("select",{name:"ownerId",required:""})]),a("label",null,[C("备用负责人"),a("select",{name:"successorId"})]),a("label",{id:"leadership-grant",class:"check full alert alert-warning",hidden:""},[a("input",{type:"checkbox",name:"grantManagement"}),a("span",{id:"leadership-grant-note"})]),a("label",{class:"full"},[C("安排 / 交接说明 *"),a("textarea",{name:"reason",required:"",maxlength:"300",rows:"3",placeholder:"说明负责人安排或本次交接原因"})])]),a("p",{class:"description"},"交接后原负责人仍保留本归属的管理员权限。系统不会依据未登录或家谱去世日期自动转移权限;交接记录可追溯。"),a("p",{class:"form-error",role:"status"}),a("div",{class:"dialog-footer"},[a("button",{type:"submit"},"确认保存负责人安排")])])],-1)),e[2]||(e[2]=a("dialog",{id:"household-dialog"},[a("form",{id:"household-form"},[a("div",{class:"dialog-heading"},[a("h2",null,"家庭 / 场所档案"),a("button",{type:"button",class:"quiet","data-close":"household-dialog"},"关闭")]),a("input",{name:"id",type:"hidden"}),a("input",{name:"profileRevision",type:"hidden",value:"0"}),a("div",{class:"form-grid"},[a("label",{class:"full"},[C("归属名称 *"),a("input",{name:"name",maxlength:"80",required:"",placeholder:"例如:赵府、济南办公室、莱阳工厂"})]),a("label",{class:"full"},[C("归属类型"),a("select",{name:"kind"},[a("option",{value:"home"},"家庭"),a("option",{value:"office"},"办公场所"),a("option",{value:"factory"},"工厂")])]),a("fieldset",{class:"full geo-picker","data-geography":"","data-geo-title":"所在地"}),a("div",{class:"full cover-editor"},[a("img",{id:"household-cover-preview",alt:"场所封面预览",hidden:""}),a("label",null,[C("卡片封面照片"),a("input",{id:"household-cover-file",type:"file",accept:"image/png,image/jpeg,image/webp"})]),a("button",{type:"button",id:"household-cover-cancel",class:"quiet"},"取消本次图片选择"),a("button",{type:"button",id:"household-cover-reset",class:"quiet"},"使用默认封面"),a("p",{id:"household-cover-status",class:"description",role:"status","aria-live":"polite"},"照片仅向有权进入该家庭或场所的账号开放。")]),a("label",{class:"full"},[C("备注"),a("textarea",{name:"note",maxlength:"300",rows:"3"})])]),a("p",{class:"description"},"创建后进入该归属,建立管理员,再自行划分区域和登记设备。"),a("p",{class:"form-error"}),a("div",{class:"dialog-footer"},[a("button",{type:"submit"},"保存家庭")])])],-1)),e[3]||(e[3]=ge('

账号档案

亲属关系在家庭成员对应的族谱人物之间建立;登录账号仅关联本人身份和访问权限。

允许查看摄像头的空间

普通成员只访问本归属内已授权的区域。默认仅授权所选区域;勾选“包含下级区域”后同时包含其所有后代。管理员可管理本归属全部区域。

',2)),e[4]||(e[4]=a("dialog",{id:"person-dialog"},[a("form",{id:"person-form"},[a("div",{class:"dialog-heading"},[a("h2",null,"家谱人物"),a("button",{type:"button",class:"quiet","data-close":"person-dialog"},"关闭")]),a("input",{name:"id",type:"hidden"}),a("input",{name:"revision",type:"hidden"}),a("p",{id:"person-self-note",class:"alert alert-info",hidden:""},"这将建立并固定关联为您本人,用于确定上下五代维护范围。如族谱已有您的人物,请关闭此窗口并请管理员关联,避免重复建档。"),a("fieldset",{id:"person-relative-fields"},[a("legend",null,"新人物与已有亲属的关系"),a("div",{class:"form-grid"},[a("label",null,[C("已有亲属"),a("select",{name:"relativeId"})]),a("label",null,[C("新人物是其"),a("select",{name:"relativeKind"},[a("option",{value:"parent"},"父母一方(上一代)"),a("option",{value:"child"},"子女(下一代)"),a("option",{value:"spouse"},"配偶(同代)")])])]),a("p",{class:"description"},"人物与关系一起保存,无需为亲属开设登录账号;超出五代时不会写入。")]),a("div",{class:"form-grid"},[a("label",null,[C("姓名 / 称呼 *"),a("input",{name:"name",required:"",maxlength:"80",placeholder:"姓名暂不知时可先填称呼"})]),a("label",null,[C("别名 / 字 / 号"),a("input",{name:"alias",maxlength:"120"})]),a("label",null,[C("性别"),a("select",{name:"gender"},[a("option",{value:"unknown"},"待确认"),a("option",{value:"male"},"男"),a("option",{value:"female"},"女")])]),a("label",null,[C("在世情况"),a("select",{name:"lifeStatus"},[a("option",{value:"alive"},"在世"),a("option",{value:"deceased"},"不在世"),a("option",{value:"unknown"},"待确认")])]),a("fieldset",{class:"family-date","data-date-field":"birthDate"},[a("legend",null,"出生日期"),a("input",{name:"birthDate",type:"hidden"}),a("label",null,[C("历法"),a("select",{"data-calendar":"","aria-label":"出生日期历法"},[a("option",{value:"solar"},"公历"),a("option",{value:"lunar"},"农历")])]),a("label",null,[C("日期"),a("input",{"data-date-value":"","aria-label":"出生日期",type:"text",inputmode:"numeric",placeholder:"YYYY-MM-DD",maxlength:"10"})]),a("label",{"data-leap-label":"",class:"check",hidden:""},[a("input",{"data-date-leap":"",type:"checkbox"}),C("闰月")]),a("output",{"data-date-hint":"","aria-live":"polite"},"日期不详可留空")]),a("fieldset",{class:"family-date","data-date-field":"deathDate",hidden:""},[a("legend",null,"去世日期"),a("input",{name:"deathDate",type:"hidden"}),a("label",null,[C("历法"),a("select",{"data-calendar":"","aria-label":"去世日期历法"},[a("option",{value:"solar"},"公历"),a("option",{value:"lunar"},"农历")])]),a("label",null,[C("日期"),a("input",{"data-date-value":"","aria-label":"去世日期",type:"text",inputmode:"numeric",placeholder:"YYYY-MM-DD",maxlength:"10"})]),a("label",{"data-leap-label":"",class:"check",hidden:""},[a("input",{"data-date-leap":"",type:"checkbox"}),C("闰月")]),a("output",{"data-date-hint":"","aria-live":"polite"},"日期不详可留空")]),a("label",{class:"full",id:"person-legacy-place"},[C("原籍贯/出生地记录"),a("input",{name:"birthplace",maxlength:"160"}),a("small",null,"历史填写内容保留,可在下方分别补充。")]),a("fieldset",{class:"full person-location"},[a("legend",null,"籍贯(祖籍)"),a("div",{class:"form-grid"},[a("fieldset",{class:"full geo-picker","data-geography":"native","data-geo-title":"籍贯(祖籍)"}),a("label",null,[C("乡镇/街道"),a("input",{name:"nativeTown",maxlength:"80",placeholder:"","aria-label":"籍贯(祖籍) · 乡镇/街道"})]),a("label",null,[C("村/社区"),a("input",{name:"nativeCommunity",maxlength:"80",placeholder:"","aria-label":"籍贯(祖籍) · 村/社区"})]),a("label",{class:"full"},[C("详细地址/历史地名"),a("input",{name:"nativeAddress",maxlength:"200",placeholder:"楼栋、门牌或旧称,可按已知信息填写","aria-label":"籍贯(祖籍) · 详细地址/历史地名"})])])]),a("fieldset",{class:"full person-location"},[a("legend",null,"出生地"),a("div",{class:"form-grid"},[a("fieldset",{class:"full geo-picker","data-geography":"birth","data-geo-title":"出生地"}),a("label",null,[C("乡镇/街道"),a("input",{name:"birthTown",maxlength:"80",placeholder:"","aria-label":"出生地 · 乡镇/街道"})]),a("label",null,[C("村/社区"),a("input",{name:"birthCommunity",maxlength:"80",placeholder:"","aria-label":"出生地 · 村/社区"})]),a("label",{class:"full"},[C("详细地址/历史地名"),a("input",{name:"birthAddress",maxlength:"200",placeholder:"楼栋、门牌或旧称,可按已知信息填写","aria-label":"出生地 · 详细地址/历史地名"})])])]),a("p",{class:"description full"},"籍贯与出生地可不同;选择中国、世界或自定义地域,不详的层级可留空。"),a("label",{class:"full"},[C("生平简介"),a("textarea",{name:"biography",rows:"4",maxlength:"2000"})]),a("label",{class:"full"},[C("备注 / 信息来源"),a("textarea",{name:"note",rows:"3",maxlength:"500",placeholder:"例如:长辈口述、族谱记载、待考证信息"})]),a("label",{class:"check"},[a("input",{name:"archived",type:"checkbox"}),C("归档人物(保留关系,可恢复)")])]),a("p",{class:"form-error"}),a("div",{class:"dialog-footer"},[a("button",{type:"submit"},"保存人物")])])],-1)),e[5]||(e[5]=ge('

连接人物关系

每条亲子关系连接一位父母与一位子女。双方需在本人上下五代内;不能通过移动或断开已确认世系来改变维护范围。

',1)),e[6]||(e[6]=a("dialog",{id:"event-dialog","aria-labelledby":"event-editor-title"},[a("form",{id:"event-form"},[a("div",{class:"dialog-heading"},[a("h2",{id:"event-editor-title"},"写一则家族记事"),a("button",{type:"button",class:"quiet","data-close":"event-dialog"},"关闭")]),a("input",{name:"id",type:"hidden"}),a("input",{name:"revision",type:"hidden"}),a("div",{class:"form-grid"},[a("label",{class:"full"},[C("记事标题 *"),a("input",{name:"title",required:"",maxlength:"160",placeholder:"用一句话概括这件事"})]),a("fieldset",{class:"family-date full","data-date-field":"eventDate"},[a("legend",null,"事情发生的日期 *"),a("input",{name:"eventDate",type:"hidden"}),a("label",null,[C("历法"),a("select",{"data-calendar":"","aria-label":"记事日期历法"},[a("option",{value:"solar"},"公历"),a("option",{value:"lunar"},"农历")])]),a("label",null,[C("日期"),a("input",{"data-date-value":"","aria-label":"记事日期",required:"",type:"text",inputmode:"numeric",placeholder:"YYYY-MM-DD",maxlength:"10"})]),a("label",{"data-leap-label":"",class:"check",hidden:""},[a("input",{"data-date-leap":"",type:"checkbox"}),C("闰月")]),a("output",{"data-date-hint":"","aria-live":"polite"})]),a("fieldset",{class:"full"},[a("legend",null,"关联人物(可多选)"),a("input",{id:"event-person-search",type:"search",placeholder:"查找要关联的亲人","aria-label":"查找关联人物"}),a("div",{id:"event-person-choices"}),a("p",{class:"description"},"未选择人物时记为全家记事。每位关联人物的档案都可以追溯到这条记事。")]),a("label",{class:"full"},[C("摘要"),a("textarea",{name:"summary",maxlength:"400",rows:"2",placeholder:"简要说明这件事"})]),a("label",{class:"full"},[C("详细记载"),a("textarea",{name:"body",maxlength:"12000",rows:"7",placeholder:"记录经过、意义、长辈口述或资料出处。可分段书写。"})]),a("label",null,[C("报道 / 资料来源"),a("input",{name:"sourceName",maxlength:"160",placeholder:"例如:报刊名称、个人博客"})]),a("label",null,[C("原始报道链接"),a("input",{name:"sourceUrl",type:"url",maxlength:"2000",placeholder:"https://…"})]),a("label",{class:"check full"},[a("input",{name:"archived",type:"checkbox"}),C("归档记事(保留内容,可恢复)")])]),a("p",{class:"description"},"正式发布后,有家谱查看权限的账号即可在时间线看到;草稿只对有编辑权限的人可见。"),a("p",{class:"form-error",role:"status"}),a("div",{class:"dialog-footer event-editor-actions"},[a("button",{type:"submit","data-save-event":"",value:"draft",class:"secondary"},"保存草稿"),a("button",{type:"submit","data-publish-event":"",value:"published"},"发布记事"),a("button",{type:"submit","data-withdraw-event":"",value:"draft",class:"secondary",hidden:""},"撤回为草稿")])])],-1)),e[7]||(e[7]=ge('
家事 · 家声
',1)),e[8]||(e[8]=a("dialog",{id:"history-dialog","aria-labelledby":"history-title"},[a("div",{class:"dialog-heading"},[a("h2",{id:"history-title"},"修改记录"),a("button",{type:"button",class:"quiet","data-close":"history-dialog"},"关闭")]),a("p",{class:"description"},"人物、关系与记事每次保存都会留存版本。仅有家谱编辑权限的账号可查阅和恢复。"),a("p",{id:"history-error",class:"form-error",role:"status"}),a("div",{id:"history-list"}),a("button",{id:"history-more",class:"quiet",hidden:""},"加载更早记录"),a("article",{id:"history-detail"})],-1)),e[9]||(e[9]=a("dialog",{id:"password-dialog","aria-labelledby":"password-title"},[a("form",{id:"password-form"},[a("div",{class:"dialog-heading"},[a("h2",{id:"password-title"},"修改我的密码"),a("button",{type:"button",class:"quiet","data-close":"password-dialog"},"关闭")]),a("p",{id:"password-account",class:"description"}),a("label",null,[C("当前密码"),a("input",{name:"currentPassword",type:"password",required:"",maxlength:"128",autocomplete:"current-password"})]),a("label",null,[C("新密码"),a("input",{name:"newPassword",type:"password",required:"",minlength:"8",maxlength:"128",autocomplete:"new-password"})]),a("label",null,[C("再次输入新密码"),a("input",{name:"confirmPassword",type:"password",required:"",minlength:"8",maxlength:"128",autocomplete:"new-password"})]),a("p",{class:"description"},"保存后,这个账号在所有设备上都需要用新密码重新登录。"),a("p",{class:"form-error",role:"status"}),a("div",{class:"dialog-footer"},[a("button",{type:"submit"},"保存新密码")])])],-1)),e[10]||(e[10]=a("dialog",{id:"camera-settings-dialog","aria-labelledby":"camera-settings-title"},[a("div",{class:"dialog-heading"},[a("h2",{id:"camera-settings-title"},"摄像机参数"),a("button",{class:"quiet","data-close":"camera-settings-dialog"},"关闭")]),a("div",{class:"section-head"},[a("label",null,[C("设置码流"),a("select",{id:"camera-settings-quality"},[a("option",{value:"main"},"主码流"),a("option",{value:"sub"},"子码流")])]),a("button",{id:"camera-settings-reload",class:"quiet"},"重新读取")]),a("div",{id:"camera-settings-info"}),a("p",{id:"camera-settings-status",class:"form-error",role:"status"}),a("form",{id:"camera-image-form"},[a("h3",null,"图像与日夜模式"),a("p",{class:"description"},"作用于当前物理镜头,主、子码流共用这些图像参数。"),a("div",{id:"camera-image-fields",class:"form-grid"}),a("div",{class:"dialog-footer"},[a("button",{type:"submit",disabled:""},"保存图像参数")])]),a("form",{id:"camera-video-form"},[a("h3",null,"码流与清晰度"),a("p",{class:"description"},"作用于上方选定的码流。保存后画面可能短暂重连,录像机也会使用调整后的码流。本页保留原有视频编码。"),a("div",{id:"camera-video-fields",class:"form-grid"}),a("div",{class:"dialog-footer"},[a("button",{type:"submit",disabled:""},"保存码流参数")])]),a("details",null,[a("summary",null,"其他萤石功能的接入情况"),a("ul",null,[a("li",null,"云台方向微调与预置位:在实时画面的“云台”中使用,按设备能力启用。"),a("li",null,"实时声音与全屏:通过画面播放器控制。"),a("li",null,"双向对讲、智能追踪、声光告警、隐私遮蔽、设备翻转、云录像和消息推送:当前尚未接入,请使用萤石 App。"),a("li",null,"录像机原有录像:仍通过录像机或原厂 App 查看;本系统已支持本机额外录像的回放。")]),a("p",{class:"description"},"功能按设备实际开放能力逐项接入,型号与固件不同可能有差异。")])],-1)),e[11]||(e[11]=a("div",{id:"toast",role:"status",hidden:""},null,-1)),e[12]||(e[12]=ge('

画面截图

当前视频画面截图

下载 PNG 图片

附件预览

',2))],64)}const RM=hs(DM,[["render",$M]]),LM=["/vendor/hls.min.js","/live-player.js","/kinship.js","/family-graph.js","/calendar.js","/device-model.js","/data/geography-data.js","/geography.js","/app.js","/monitor.js","/date-fields.js","/family-map.js","/family.js","/family-events.js","/family-history.js","/camera-settings.js","/recording-ranges.js","/recording-ui.js","/snapshot.js","/households.js","/devices.js","/steward.js","/heritage.js","/personalization.js","/file-hash.js","/journal-queue.js","/journal.js"];function Ea(n){if(!(n instanceof Element))return;const e=[n,...n.querySelectorAll("button,input,select,textarea,table")];for(const t of e)t.matches("button")&&!t.closest(".family-map-viewport")&&!t.classList.contains("btn")&&t.classList.add("btn",t.matches(".quiet,.secondary")?"btn-outline-secondary":"btn-primary"),t.matches("select")&&t.classList.add("form-select"),t.matches("textarea,input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden])")&&t.classList.add("form-control"),t.matches("input[type=checkbox],input[type=radio]")&&t.classList.add("form-check-input"),t.matches("table")&&t.classList.add("table","align-middle")}async function PM(){Ea(document.getElementById("app")),new MutationObserver(n=>{for(const e of n)for(const t of e.addedNodes)Ea(t)}).observe(document.getElementById("app"),{childList:!0,subtree:!0});for(const n of[...LM,"/vue-bridge.js"])await new Promise((e,t)=>{const s=document.createElement("script");s.src=n+"?ui=cf1dd21672863b5d",s.onload=e,s.onerror=()=>t(new Error("Could not load "+n)),document.head.append(s)});await window.ZhaoVue.boot()}const BM=["data-page"],_M={key:0,class:"alert alert-danger",role:"alert"},zM={__name:"App",setup(n){const e=P(!1);return $i(async()=>{try{await PM()}catch(t){console.error("Application startup failed",t),e.value=!0}}),(t,s)=>(v(),x(H,null,[G(ep),a("main",{"data-page":j(R).page},[G(sp),e.value?(v(),x("div",_M,"页面组件加载失败,请检查网络后重新打开页面。")):D("",!0),G(IM)],8,BM),G(RM)],64))}};zu(zM).mount("#app"); +`:"");return e(n).trim()}function hC(n,e){const t=i=>String(i!=null?i:"").replace(/[&<>"']/g,r=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[r]),s=i=>{var l,c,d;if(i.type==="text")return(i.marks||[]).reduce((u,p)=>{const f={bold:"strong",italic:"em",strike:"s",underline:"u"}[p.type];return f?`<${f}>${u}`:u},t(i.text));if(i.type==="hardBreak")return"
";if(i.type==="media")return/^[a-f0-9]{16}$/.test(((l=i.attrs)==null?void 0:l.mediaId)||"")?e(i.attrs.mediaId):"";const r=(i.content||[]).map(s).join("");if(i.type==="doc")return r;const o={paragraph:"p",heading:((c=i.attrs)==null?void 0:c.level)===3?"h3":"h2",blockquote:"blockquote",bulletList:"ul",orderedList:"ol",listItem:"li"}[i.type];return o?`<${o}${o==="ol"&&Number.isInteger((d=i.attrs)==null?void 0:d.start)?` start="${Math.max(1,Math.min(9999,i.attrs.start))}"`:""}>${r||"
"}`:""};return s(n)}const mC={class:"journal-rich-editor"},gC={class:"journal-editor-toolbar",role:"toolbar","aria-label":"正文格式"},bC=["aria-pressed"],vC=["aria-pressed"],yC=["aria-pressed"],kC=["aria-pressed"],xC=["value"],wC={class:"journal-editor-foot"},SC={__name:"RichJournalEditor",setup(n){const e=Xr(null),t=P(0),s=P("");let i=new Map,r=new Map,o=new Set,l;const c=Fe.create({name:"media",group:"block",atom:!0,draggable:!0,selectable:!0,addAttributes(){return{mediaId:{default:null},uploadClient:{default:null}}},parseHTML(){return[{tag:"figure[data-media-id]",getAttrs:b=>i.has(b.dataset.mediaId)?{mediaId:b.dataset.mediaId}:!1}]},renderHTML({node:b}){return["figure",{"data-media-id":b.attrs.mediaId}]},addNodeView(){return({node:b,getPos:m,editor:v})=>{const S=document.createElement("figure");S.className="journal-inline-media",S.contentEditable="false";let A="";const O=()=>{const B=r.get(b.attrs.uploadClient),E=i.get(b.attrs.mediaId),M=JSON.stringify([E&&[E.name,E.mime,E.src],B&&[B.name,B.status,B.progress,B.error]]);if(A===M)return;A=M,S.querySelectorAll("audio,video").forEach(N=>{N.pause(),N.removeAttribute("src"),N.load()}),S.replaceChildren();const w=document.createElement("figcaption");if(w.textContent=(E==null?void 0:E.name)||(B==null?void 0:B.name)||"云端素材引用",S.append(w),!(E!=null&&E.src)){const N=document.createElement("p");N.textContent=B?B.error||"正在上传 "+Math.round(B.progress||0)+"%":"素材暂不可用",S.append(N)}if(E!=null&&E.src){const N=document.createElement(E.mime.startsWith("image/")?"img":E.mime.startsWith("audio/")?"audio":"video");N.src=E.src,N.tagName==="IMG"?(N.alt=E.name,N.loading="lazy"):(N.controls=!0,N.preload="metadata",N.playsInline=!0,N.addEventListener("play",()=>document.querySelectorAll("#page-journal audio,#page-journal video").forEach(I=>{I!==N&&I.pause()}))),S.append(N)}const T=document.createElement("button");T.type="button",T.className="quiet",T.textContent="移除正文引用",T.setAttribute("aria-label","移除正文引用 "+((E==null?void 0:E.name)||"")),T.addEventListener("click",()=>{if(!v.isEditable)return;const N=m();typeof N=="number"&&v.chain().focus().deleteRange({from:N,to:N+b.nodeSize}).run()}),S.append(T)};return o.add(O),O(),{dom:S,update(B){return B.type!==b.type?!1:(b=B,O(),!0)},stopEvent:B=>B.target.closest("button,audio,video")!==null,ignoreMutation:()=>!0,destroy(){o.delete(O),S.querySelectorAll("audio,video").forEach(B=>{B.pause(),B.removeAttribute("src"),B.load()})}}}}});function d(b,m=!0){var v;s.value=Ta(b.getJSON()),t.value++,m&&((v=document.getElementById("journal-form"))==null||v.dispatchEvent(new Event("input",{bubbles:!0})))}function u(b){var m;(m=e.value)==null||m.destroy(),o.clear(),e.value=new Jx({extensions:[pC.configure({heading:{levels:[2,3]},link:!1,code:!1,codeBlock:!1,horizontalRule:!1}),c],content:b?Ca(b):fC(),editorProps:{attributes:{class:"journal-rich-input",role:"textbox","aria-label":"记事正文","aria-multiline":"true"},handlePaste(v,S){var O;const A=(O=S.clipboardData)==null?void 0:O.getData("text/plain");return A?(S.preventDefault(),v.dispatch(v.state.tr.insertText(A)),!0):!1}},onUpdate:({editor:v})=>d(v),onSelectionUpdate:()=>t.value++,onTransaction:()=>t.value++}),d(e.value,!1)}function p(b,m){var v;(v=e.value)==null||v.chain().focus()[b](m).run()}function f(b){var O;const m=e.value,v=m.state.selection,S=[{type:"media",attrs:b},{type:"paragraph"}],A=m.chain().focus();return((O=v.node)==null?void 0:O.type.name)==="media"?A.insertContentAt(v.to,S):A.insertContent(S),A.run()}function h(b){var m;return t.value,!!((m=e.value)!=null&&m.isActive(b))}function g(){const b=document.getElementById("journal-library");b&&(b.open=!0,b.scrollIntoView({behavior:"smooth",block:"start"}))}return $i(()=>{u(),l={reset:()=>u(),set:u,focus:()=>{var b;return(b=e.value)==null?void 0:b.commands.focus()},document:()=>e.value.getJSON(),ids:()=>Ma(e.value.getJSON()),plainText:()=>Ta(e.value.getJSON()),setEditable:b=>{var m;return(m=e.value)==null?void 0:m.setEditable(b)},insertMedia(b){if(!e.value.isEditable||!i.has(b))return!1;const m=Ma(e.value.getJSON());return!m.includes(b)&&m.length>=9?(window.alert("每条记事最多引用 9 个不同素材"),!1):f({mediaId:b})},clients(){const b=[];return e.value.state.doc.descendants(m=>{m.type.name==="media"&&m.attrs.uploadClient&&b.push(m.attrs.uploadClient)}),[...new Set(b)]},pending(){let b=!1;return e.value.state.doc.descendants(m=>{m.type.name==="media"&&!m.attrs.mediaId&&(b=!0)}),b},insertUpload(b){let m=0;return e.value.state.doc.descendants(v=>{v.type.name==="media"&&m++}),m>=9?(window.alert("本条最多添加 9 个媒体,请先保存记事"),!1):f({uploadClient:b})},removeUpload(b){const m=[];e.value.state.doc.descendants((S,A)=>{S.type.name==="media"&&S.attrs.uploadClient===b&&m.push([A,S.nodeSize])});const v=e.value.state.tr;for(const[S,A]of m.reverse())v.delete(S,S+A);v.docChanged&&e.value.view.dispatch(v)},resolveUpload(b,m){i.set(m.id,m);const v=e.value.state.tr;e.value.state.doc.descendants((S,A)=>{S.type.name==="media"&&S.attrs.uploadClient===b&&v.setNodeMarkup(A,void 0,{...S.attrs,mediaId:m.id})}),v.docChanged&&e.value.view.dispatch(v)},setTasks(b){r=new Map(b.map(m=>[m.clientId,m]));for(const m of o)m()},setMedia(b){i=new Map(b.map(m=>[m.id,m]));for(const m of o)m()},render:(b,m)=>hC(Ca(b),m),clearMedia(){i.clear(),r.clear();for(const b of o)b()}},window.ZhaoJournalEditor=l}),Bt(()=>{var b;(b=e.value)==null||b.destroy(),window.ZhaoJournalEditor===l&&delete window.ZhaoJournalEditor}),(b,m)=>(y(),x("div",mC,[a("div",gC,[a("button",{type:"button",class:"quiet","aria-pressed":h("bold"),onMousedown:m[0]||(m[0]=Ve(()=>{},["prevent"])),onClick:m[1]||(m[1]=v=>p("toggleBold"))},[...m[13]||(m[13]=[a("b",null,"加粗",-1)])],40,bC),a("button",{type:"button",class:"quiet","aria-pressed":h("italic"),onMousedown:m[2]||(m[2]=Ve(()=>{},["prevent"])),onClick:m[3]||(m[3]=v=>p("toggleItalic"))},[...m[14]||(m[14]=[a("i",null,"斜体",-1)])],40,vC),a("button",{type:"button",class:"quiet","aria-pressed":h("heading"),onMousedown:m[4]||(m[4]=Ve(()=>{},["prevent"])),onClick:m[5]||(m[5]=v=>p("toggleHeading",{level:2}))},"标题",40,yC),a("button",{type:"button",class:"quiet","aria-pressed":h("bulletList"),onMousedown:m[6]||(m[6]=Ve(()=>{},["prevent"])),onClick:m[7]||(m[7]=v=>p("toggleBulletList"))},"列表",40,kC),a("button",{type:"button",class:"quiet",onMousedown:m[8]||(m[8]=Ve(()=>{},["prevent"])),onClick:m[9]||(m[9]=v=>p("undo"))},"撤销",32),a("button",{type:"button",class:"quiet",onMousedown:m[10]||(m[10]=Ve(()=>{},["prevent"])),onClick:m[11]||(m[11]=v=>p("redo"))},"重做",32),a("button",{type:"button",class:"journal-insert-button",onMousedown:m[12]||(m[12]=Ve(()=>{},["prevent"])),onClick:g},"+ 插入云端素材",32)]),G(j(Gx),{editor:e.value},null,8,["editor"]),a("input",{type:"hidden",name:"text",value:s.value},null,8,xC),a("div",wC,[m[15]||(m[15]=a("span",null,"在光标处插入照片、视频、语音;可拖动媒体调整位置。",-1)),a("span",{class:De({"text-danger":s.value.length>5e3})},k(s.value.length)+" / 5000 字",3)])]))}},CC={key:0,class:"panel"},MC={class:"d-flex justify-content-between flex-wrap gap-3"},TC={key:0,class:"alert alert-danger",role:"alert"},EC={class:"fs-5"},AC={key:0,class:"d-block mb-3"},OC=["value"],NC={key:1,class:"d-block mb-3"},IC={key:2},DC={class:"row g-3"},$C={class:"col-md-6"},RC={class:"col-md-6"},LC={class:"d-flex gap-2"},PC=["disabled"],BC=["disabled"],_C={class:"row g-3"},zC={class:"card-body"},jC={class:"fs-5"},FC={key:0,class:"badge text-bg-success"},VC={class:"small text-secondary"},HC={class:"d-flex flex-wrap gap-2"},qC=["disabled","onClick"],UC=["disabled","onClick"],WC=["disabled","onClick"],KC={key:2,class:"alert alert-info mt-3"},JC={key:3,class:"border-top pt-3 mt-4"},GC=["value"],YC={class:"d-flex gap-2 my-3"},XC=["disabled"],ZC={__name:"FamilyMembers",setup(n){const e=P(null),t=P(""),s=P(!1),i=P(null),r=P(""),o=P(!1),l=ee(()=>R.value.loggedIn&&R.value.page==="members"),c=ee(()=>(R.value.state.households||[]).filter(b=>b.id!==R.value.state.familyId));let d=0;async function u(){const b=++d;try{const m=await K().api("/api/members");b===d&&(e.value=m)}catch(m){b===d&&(t.value=m.message)}}Ae([l,()=>R.value.state.familyId,()=>R.value.session],()=>{d++,e.value=null,i.value=null,t.value="",r.value="",o.value=!1,s.value=!1,l.value&&u()},{immediate:!0});function p(b){i.value=b?{id:b.id,revision:b.revision,personId:b.personId,name:b.name,label:b.label,status:b.status}:{name:"",personId:"",label:"",status:"active",revision:0}}async function f(){if(s.value)return;s.value=!0,t.value="";const b=d;try{if(await K().api("/api/members",i.value),b!==d)return;i.value=null,await u(),await K().refresh()}catch(m){b===d&&(t.value=m.message)}finally{s.value=!1}}async function h(){if(s.value)return;s.value=!0,t.value="";const b=d;try{if(await K().api("/api/genealogy/share",{targetFamilyId:r.value,confirm:o.value}),b!==d)return;o.value=!1,r.value="",await u(),await K().refresh()}catch(m){b===d&&(t.value=m.message)}finally{s.value=!1}}async function g(b,m=!1){if(s.value)return;const v=d;s.value=!0,t.value="";try{m?await K().viewMemberHistory(b.personId,b.name,R.value.state.familyId):await K().viewPerson(b.personId,R.value.state.familyId)}catch(S){v===d&&!S.stale&&(t.value=S.message)}finally{v===d&&(s.value=!1)}}return(b,m)=>{var v,S,A,O,B;return l.value?(y(),x("section",CC,[a("div",MC,[m[8]||(m[8]=a("div",null,[a("h2",null,"家庭成员"),a("p",{class:"text-secondary"},"登记真实家人。老人、孩子无需账号;亲属关系与登录权限分别管理。")],-1)),(v=e.value)!=null&&v.canManage?(y(),x("button",{key:0,class:"btn btn-primary align-self-start",onClick:m[0]||(m[0]=E=>p())},"+ 登记成员")):D("",!0)]),t.value?(y(),x("p",TC,k(t.value),1)):D("",!0),i.value?(y(),x("form",{key:1,class:"border rounded p-3 mb-4",onSubmit:Ve(f,["prevent"])},[a("h3",EC,k(i.value.id?"编辑成员关系":"登记家庭成员"),1),i.value.id?D("",!0):(y(),x("label",AC,[m[10]||(m[10]=C("关联已有族谱人物",-1)),Y(a("select",{class:"form-select","onUpdate:modelValue":m[1]||(m[1]=E=>i.value.personId=E)},[m[9]||(m[9]=a("option",{value:""},"新建人物(尚未录入族谱)",-1)),(y(!0),x(H,null,J(((S=e.value)==null?void 0:S.candidates)||[],E=>(y(),x("option",{key:E.id,value:E.id},k(E.name),9,OC))),128))],512),[[Te,i.value.personId]])])),i.value.personId?i.value.id?(y(),x("p",IC,"人物:"+k(i.value.name)+"。姓名、生平及亲属关系在族谱中维护,仍遵守五代限制。",1)):D("",!0):(y(),x("label",NC,[m[11]||(m[11]=C("姓名",-1)),Y(a("input",{"onUpdate:modelValue":m[2]||(m[2]=E=>i.value.name=E),class:"form-control",maxlength:"80",required:""},null,512),[[At,i.value.name]])])),a("div",DC,[a("label",$C,[m[12]||(m[12]=C("家庭称呼/身份备注",-1)),Y(a("input",{"onUpdate:modelValue":m[3]||(m[3]=E=>i.value.label=E),class:"form-control",maxlength:"60",placeholder:"例如:妈妈、长子、亲友"},null,512),[[At,i.value.label]])]),a("label",RC,[m[14]||(m[14]=C("成员状态",-1)),Y(a("select",{"onUpdate:modelValue":m[4]||(m[4]=E=>i.value.status=E),class:"form-select"},[...m[13]||(m[13]=[a("option",{value:"active"},"当前成员",-1),a("option",{value:"away"},"暂住外地",-1),a("option",{value:"historical"},"历史成员",-1)])],512),[[Te,i.value.status]])])]),m[15]||(m[15]=a("p",{class:"small text-secondary mt-2"},"称呼是本家庭的备注,不自动建立父母、配偶关系或授予管理权限。成员状态不会删除人物和经历;住在外地也可以是家人。",-1)),a("div",LC,[a("button",{class:"btn btn-primary",disabled:s.value},"保存成员",8,PC),a("button",{type:"button",class:"btn btn-outline-secondary",disabled:s.value,onClick:m[5]||(m[5]=E=>i.value=null)},"取消",8,BC)])],32)):D("",!0),a("div",_C,[(y(!0),x(H,null,J(((A=e.value)==null?void 0:A.items)||[],E=>(y(),x("article",{key:E.id,class:"col-md-6 col-xl-4"},[a("div",{class:De(["card h-100",{"border-primary bg-primary-subtle":E.self}])},[a("div",zC,[a("h3",jC,[C(k(E.name)+" ",1),E.self?(y(),x("span",FC,"本人")):D("",!0)]),a("p",null,k(E.label||"家庭身份待补充")+" · "+k({active:"当前成员",away:"暂住外地",historical:"历史成员"}[E.status]),1),a("p",VC,k(E.hasAccount?"已有关联账号":"无需注册账号")+k(E.lifeStatus==="deceased"?" · 已故":""),1),a("div",HC,[e.value.canViewGenealogy?(y(),x("button",{key:0,class:"btn btn-sm btn-outline-primary",disabled:s.value,onClick:M=>g(E)},"人物与亲属",8,qC)):D("",!0),a("button",{class:"btn btn-sm btn-outline-primary",disabled:s.value,onClick:M=>g(E,!0)},"个人阅历",8,UC),e.value.canManage?(y(),x("button",{key:1,class:"btn btn-sm btn-outline-secondary",disabled:s.value,onClick:M=>p(E)},"编辑成员关系",8,WC)):D("",!0)])])],2)]))),128))]),e.value&&!e.value.items.length?(y(),x("p",KC,"还没有登记成员。已有族谱人物可直接关联,避免重复建人。")):D("",!0),j(R).platformAdmin?(y(),x("details",JC,[m[19]||(m[19]=a("summary",null,"与相关家庭共用族谱",-1)),m[20]||(m[20]=a("p",{class:"small text-secondary mt-2"},"相关家庭共用人物与亲属关系;活动、设备、位置授权继续独立。现有同名人物不会自动合并,需核对身份。世代范围限制继续有效。",-1)),a("p",null,"当前已关联:"+k((B=(O=e.value)==null?void 0:O.genealogyHomes)==null?void 0:B.map(E=>E.name).join("、")),1),a("form",{onSubmit:Ve(h,["prevent"])},[a("label",null,[m[17]||(m[17]=C("关联家庭",-1)),Y(a("select",{"onUpdate:modelValue":m[6]||(m[6]=E=>r.value=E),class:"form-select",required:""},[m[16]||(m[16]=a("option",{value:""},"请选择",-1)),(y(!0),x(H,null,J(c.value,E=>(y(),x("option",{value:E.id,key:E.id},k(E.name),9,GC))),128))],512),[[Te,r.value]])]),a("label",YC,[Y(a("input",{"onUpdate:modelValue":m[7]||(m[7]=E=>o.value=E),type:"checkbox",required:""},null,512),[[st,o.value]]),m[18]||(m[18]=C("确认双方族谱人物与关系共用,有族谱查看权限的账号可以查看合并后的族谱",-1))]),a("button",{class:"btn btn-outline-primary",disabled:s.value||!o.value||!r.value},"确认共用族谱",8,XC)],32)])):D("",!0)])):D("",!0)}}},QC={key:0,class:"panel"},eM={class:"d-flex flex-wrap justify-content-between gap-2"},tM={key:0,class:"alert alert-danger",role:"alert"},nM={class:"table-responsive"},sM={class:"table align-middle"},iM={key:0},rM=["onClick"],oM={class:"row g-3"},lM={class:"col-md-6"},aM=["value"],cM={class:"col-md-6"},dM=["value"],uM={class:"col-md-6"},pM={class:"col-md-6"},fM=["disabled"],hM={__name:"AccountAccess",setup(n){const e=P([]),t=P(""),s=P(!1),i=P(""),r=P(""),o=P("member"),l=P("none"),c=ee(()=>R.value.loggedIn&&R.value.page==="accounts"&&R.value.platformAdmin),d=ee(()=>R.value.state.households||[]),u=ee(()=>e.value.find(m=>m.id===i.value));let p=0;async function f(){const m=++p;try{const v=await K().api("/api/platform/users");m===p&&(e.value=v.users)}catch(v){m===p&&(t.value=v.message)}}Ae([c,()=>R.value.session],()=>{p++,e.value=[],i.value="",r.value="",t.value="",s.value=!1,c.value&&f()},{immediate:!0}),Ae([i,r],()=>{var v,S;const m=(S=(v=u.value)==null?void 0:v.familyGrants)==null?void 0:S[r.value];o.value=(m==null?void 0:m.role)||"member",l.value=(m==null?void 0:m.familyAccess)||"none"});async function h(){if(s.value)return;s.value=!0,t.value="";const m=p;try{await K().api("/api/users/grant",{userId:i.value,familyId:r.value,role:o.value,familyAccess:l.value}),m===p&&(await f(),await K().refresh())}catch(v){m===p&&(t.value=v.message)}finally{s.value=!1}}async function g(m){await K().editAccount(m.id,m.familyId)}const b=m=>{var v;return((v=d.value.find(S=>S.id===m))==null?void 0:v.name)||"未知家庭"};return(m,v)=>c.value?(y(),x("section",QC,[a("div",eM,[v[5]||(v[5]=a("div",null,[a("h2",null,"系统用户"),a("p",{class:"text-secondary"},"一个账号可访问多个家庭,分别授权。账号与家庭成员档案独立。")],-1)),a("button",{class:"btn btn-outline-primary align-self-start",onClick:v[0]||(v[0]=S=>j(K)().showPage("users"))},"账号建档与密码管理")]),t.value?(y(),x("p",tM,k(t.value),1)):D("",!0),a("div",nM,[a("table",sM,[v[7]||(v[7]=a("thead",null,[a("tr",null,[a("th",null,"登录账号"),a("th",null,"主要授权家庭"),a("th",null,"其他家庭权限"),a("th",null,"状态"),a("th")])],-1)),a("tbody",null,[(y(!0),x(H,null,J(e.value,S=>(y(),x("tr",{key:S.id},[a("td",null,[a("strong",null,k(S.name),1),v[6]||(v[6]=a("br",null,null,-1)),C(k(S.username),1)]),a("td",null,k(S.role==="admin"?"平台管理员":b(S.familyId)),1),a("td",null,[S.role==="admin"?(y(),x("span",iM,"可管理全部家庭;查看位置仍须本人单独授权")):D("",!0),(y(!0),x(H,null,J(S.familyGrants||{},(A,O)=>(y(),x("div",{key:O},k(b(O))+" · "+k(A.role==="family_admin"?"家庭管理员":"访问账号"),1))),128))]),a("td",null,k(S.disabled?"已停用":"启用"),1),a("td",null,[a("button",{class:"btn btn-sm btn-outline-secondary",onClick:A=>g(S)},"编辑账号",8,rM)])]))),128))])])]),a("form",{class:"border-top pt-3",onSubmit:Ve(h,["prevent"])},[v[16]||(v[16]=a("h3",{class:"fs-5"},"设置账号的其他家庭访问权限",-1)),a("div",oM,[a("label",lM,[v[9]||(v[9]=C("系统账号",-1)),Y(a("select",{"onUpdate:modelValue":v[1]||(v[1]=S=>i.value=S),class:"form-select",required:""},[v[8]||(v[8]=a("option",{value:""},"请选择",-1)),(y(!0),x(H,null,J(e.value.filter(S=>S.role!=="admin"),S=>(y(),x("option",{key:S.id,value:S.id},k(S.name)+" · "+k(S.username),9,aM))),128))],512),[[Te,i.value]])]),a("label",cM,[v[11]||(v[11]=C("家庭",-1)),Y(a("select",{"onUpdate:modelValue":v[2]||(v[2]=S=>r.value=S),class:"form-select",required:""},[v[10]||(v[10]=a("option",{value:""},"请选择",-1)),(y(!0),x(H,null,J(d.value.filter(S=>{var A;return S.id!==((A=u.value)==null?void 0:A.familyId)}),S=>(y(),x("option",{key:S.id,value:S.id},k(S.name),9,dM))),128))],512),[[Te,r.value]])]),a("label",uM,[v[13]||(v[13]=C("家庭权限",-1)),Y(a("select",{"onUpdate:modelValue":v[3]||(v[3]=S=>o.value=S),class:"form-select"},[...v[12]||(v[12]=[a("option",{value:"member"},"允许进入(不含设备控制)",-1),a("option",{value:"family_admin"},"管理本家庭及其设备",-1),a("option",{value:"none"},"取消此家庭访问",-1)])],512),[[Te,o.value]])]),a("label",pM,[v[15]||(v[15]=C("族谱权限",-1)),Y(a("select",{"onUpdate:modelValue":v[4]||(v[4]=S=>l.value=S),class:"form-select"},[...v[14]||(v[14]=[a("option",{value:"none"},"不授权",-1),a("option",{value:"read"},"查看",-1),a("option",{value:"edit"},"维护本人上下五代",-1)])],512),[[Te,l.value]])])]),v[17]||(v[17]=a("p",{class:"small text-secondary mt-3"},"授权不会自动登记为家庭成员,也不会自动获得任何人的位置。修改权限后该账号需重新登录。",-1)),a("button",{class:"btn btn-primary",disabled:s.value||!i.value||!r.value},"保存访问权限",8,fM)],32)])):D("",!0)}},mM={key:0,class:"panel mb-4"},gM={key:0},bM={class:"table-responsive"},vM={class:"table align-middle"},yM={key:0,class:"d-block text-danger"},kM=["onClick"],xM={key:1,class:"text-danger"},wM={__name:"MapStorage",setup(n){const e=P(null),t=P(""),s=ee(()=>R.value.loggedIn&&R.value.page==="storage"&&R.value.platformAdmin);let i,r=0;const o=u=>((u||0)/1024/1024).toFixed(1)+" MB",l={queued:"等待下载",downloading:"下载底图",restoring:"从网盘恢复",uploading:"上传网盘",verifying:"核对云端文件",ready:"可使用",cloud:"已归档 · 本地已释放",retry:"等待重试"};async function c(){const u=r;try{const p=await K().api("/api/maps");u===r&&(e.value=p,t.value="")}catch(p){u===r&&(t.value=p.message)}finally{u===r&&s.value&&(i=setTimeout(c,15e3))}}async function d(u){try{await K().api("/api/maps",{action:"retry",id:u}),clearTimeout(i),c()}catch(p){t.value=p.message}}return Ae(s,u=>{r++,clearTimeout(i),u&&c()},{immediate:!0}),Bt(()=>{r++,clearTimeout(i)}),(u,p)=>{var f,h;return s.value?(y(),x("section",mM,[p[1]||(p[1]=a("div",{class:"d-flex justify-content-between"},[a("h2",{class:"fs-5"},"内置地图 · 网盘归档与本机缓存"),a("span",{class:"badge text-bg-light"},"全国概览常驻")],-1)),p[2]||(p[2]=a("p",{class:"text-secondary small"},"家人开启位置共享、进入某个省份后,自动准备该省详细地图。同一省份共用一份。上传并核对成功的省份缓存可回收,需要时从百度网盘取回。",-1)),e.value?(y(),x("p",gM,"本机 "+k(o(e.value.usedBytes))+" / "+k(o(e.value.cacheLimitBytes))+" · 为其他服务至少预留 "+k(o(e.value.reserveBytes)),1)):D("",!0),a("div",bM,[a("table",vM,[p[0]||(p[0]=a("thead",null,[a("tr",null,[a("th",null,"地图"),a("th",null,"状态"),a("th",null,"本机"),a("th",null,"百度网盘"),a("th")])],-1)),a("tbody",null,[(y(!0),x(H,null,J((f=e.value)==null?void 0:f.items,g=>(y(),x("tr",{key:g.id},[a("td",null,k(g.name),1),a("td",null,[C(k(l[g.state]||g.state),1),g.error?(y(),x("small",yM,k(g.error),1)):D("",!0)]),a("td",null,k(o(g.localBytes)),1),a("td",null,k(g.cloud?"已校验归档":g.progress?g.progress+"%":"待归档"),1),a("td",null,[g.state==="retry"?(y(),x("button",{key:0,class:"btn btn-sm btn-outline-primary",onClick:b=>d(g.id)},"重试",8,kM)):D("",!0)])]))),128))])])]),t.value||(h=e.value)!=null&&h.error?(y(),x("p",xM,k(t.value||e.value.error),1)):D("",!0)])):D("",!0)}}},SM={id:"page-members",class:"page",hidden:""},CM={id:"page-accounts",class:"page",hidden:""},MM={id:"page-journal",class:"page",hidden:""},TM={id:"journal-editor-surface"},EM={id:"journal-form",class:"panel journal-compose"},AM={id:"page-overview",class:"page",hidden:""},OM={id:"page-device",class:"page",hidden:""},NM={id:"page-objects",class:"page",hidden:""},IM={id:"page-storage",class:"page",hidden:""},DM={__name:"Workspace",setup(n){return(e,t)=>(y(),x(H,null,[G(wM),a("section",SM,[G(ZC)]),a("section",CM,[G(hM)]),t[16]||(t[16]=a("div",{id:"household-context",class:"household-context",hidden:""},[a("label",null,[C("当前归属 "),a("select",{id:"household-filter","aria-label":"当前归属"})]),a("span",{id:"household-context-note"}),a("button",{id:"scope-back",class:"quiet"},"返回场所")],-1)),t[17]||(t[17]=a("div",{id:"device-context",class:"device-context",hidden:""},[a("p",{id:"device-breadcrumb"}),a("div",{role:"group","aria-label":"设备功能"},[a("button",{class:"quiet","data-device-tab":"device"},"设备档案"),a("button",{class:"quiet","data-device-tab":"live"},"实时画面"),a("button",{class:"quiet","data-device-tab":"playback"},"录像回放"),a("button",{class:"quiet","data-device-tab":"cameras"},"镜头与设置")])],-1)),t[18]||(t[18]=ge('
设备—
已接通码流—
录像占用—
空间档案—
可选择任意区域,包含其下级区域
',3)),t[19]||(t[19]=a("section",{id:"page-settings",class:"page",hidden:""},[a("div",{class:"section-head"},[a("h2",null,"把这里布置成你习惯的样子"),a("button",{id:"settings-reload",class:"quiet"},"重新读取设置")]),a("p",{id:"settings-error",role:"status"}),a("div",{class:"settings-sections",role:"group","aria-label":"设置分类"},[a("button",{class:"quiet","data-settings-section":"preferences","aria-pressed":"true"},"我的偏好"),a("button",{class:"quiet","data-settings-section":"baidu","data-platform-setting":"",hidden:""},"网盘连接"),a("button",{class:"quiet","data-settings-section":"brand","data-platform-setting":"",hidden:""},"品牌与外观"),a("button",{class:"quiet","data-settings-section":"backup","data-platform-setting":"",hidden:""},"数据库备份")]),a("form",{id:"preferences-form",class:"panel"},[a("h3",null,"我的偏好"),a("p",{class:"description"},"只影响当前账号,保存后换电脑或手机登录也会沿用。切换选项可以预览,离开未保存的预览会撤销。"),a("div",{id:"personal-choices",class:"form-grid"}),a("p",{id:"preferences-status",role:"status"}),a("div",{class:"device-actions"},[a("button",{type:"submit"},"保存我的偏好"),a("button",{type:"button",id:"personal-follow",class:"quiet"},"全部跟随平台"),a("button",{type:"button",id:"personal-cancel",class:"quiet"},"撤销预览")])]),a("section",{id:"baidu-admin",class:"panel",hidden:""},[a("div",{class:"section-head"},[a("h3",null,"百度网盘 · 统一存储"),a("span",{class:"badge"},"仅超级管理员配置")]),a("p",{class:"description"},"连接一个网盘账号,统一保存封面、Logo、图标及各用户上传的照片、视频和语音。系统按用户、家庭和记事可见范围授权;网盘账号持有人本身可以管理网盘中的文件。服务器仅转发分片,不保存媒体原文件。"),a("details",{id:"baidu-storage-guide"},[a("summary",null,"文件存在哪里?"),a("ul",null,[a("li",null,"家庭与场所:按家庭或场所保存封面。"),a("li",null,"平台外观:保存 Logo 和图标。"),a("li",null,"个人记事:按家庭、用户分组,再分照片、视频、语音。"),a("li",null,"数据库备份:单独存放;新备份上传并校验成功后,清理超过一个自然月的旧云备份。")]),a("p",{class:"description"},"文字、权限和文件引用保存在本机数据库;个人媒体原文件保存在百度网盘。封面和品牌图片仅做有限的内存缓存。更换封面、移除附件或删除记事不会删除网盘原文件。")]),a("form",{id:"baidu-config"},[a("div",{class:"form-grid"},[a("label",null,[C("AppKey"),a("input",{name:"appKey",autocomplete:"off",maxlength:"150",required:""})]),a("label",null,[C("SecretKey"),a("input",{name:"secretKey",type:"password",autocomplete:"new-password",maxlength:"150"})]),a("label",null,[C("百度后台应用名称"),a("input",{name:"appFolder",value:"智家",required:"",maxlength:"40"})]),a("label",null,[C("OAuth 回调地址"),a("input",{name:"redirectUri",type:"url",placeholder:"https://你的域名/api/baidu/callback",required:"",maxlength:"400"})])]),a("p",{class:"description"},"回调地址须与百度后台完全一致。SecretKey 留空保持已保存值,SignKey 不需要填写。当前开发者应用仅限个人场景,适用范围以百度后台为准。"),a("p",{id:"baidu-config-status",role:"status"}),a("button",{type:"submit"},"保存网盘应用配置")]),a("hr"),a("p",{id:"baidu-status",role:"status"}),a("div",{class:"device-actions"},[a("button",{id:"baidu-connect"},"连接/重新授权百度网盘"),a("button",{id:"baidu-disconnect",class:"quiet"},"解除本机连接")]),a("p",{class:"description"},"解除连接不会删除云端文件。临时媒体地址由后台按需获取,令牌不发送给浏览器。网盘授权凭据单独保存在服务器受限目录,不包含在数据库备份或公开源码中。")]),a("div",{id:"settings-private",hidden:""},[a("form",{id:"brand-form",class:"panel"},[a("h3",null,"发布与品牌配置"),a("p",{class:"description"},"仅超级管理员可修改。名称、Logo、浏览器图标及登录文案会公开显示;适用于整套系统。已有个人偏好优先于平台默认。"),a("div",{class:"form-grid"},[a("label",null,[C("系统名称"),a("input",{name:"name",required:"",maxlength:"40"})]),a("label",null,[C("系统副标题"),a("input",{name:"subtitle",required:"",maxlength:"60"})]),a("label",{class:"full"},[C("页首题词"),a("input",{name:"motto",maxlength:"100"})]),a("label",null,[C("登录标题"),a("input",{name:"loginTitle",required:"",maxlength:"40"})]),a("label",null,[C("登录说明"),a("input",{name:"loginNote",maxlength:"160"})]),a("label",{class:"full"},[C("页脚说明"),a("input",{name:"footer",maxlength:"120"})])]),a("div",{class:"brand-image-grid"},[a("div",null,[a("img",{id:"brand-logo-preview",alt:"Logo 预览",src:"/zhao-icon.png"}),a("label",null,[C("更换系统 Logo"),a("input",{id:"brand-logo-file",type:"file",accept:"image/png,image/jpeg,image/webp"})]),a("button",{type:"button",id:"brand-logo-reset",class:"quiet"},"使用默认 Logo")]),a("div",null,[a("img",{id:"brand-icon-preview",alt:"浏览器图标预览",src:"/zhao-icon.png"}),a("label",null,[C("更换浏览器图标"),a("input",{id:"brand-icon-file",type:"file",accept:"image/png,image/jpeg,image/webp"})]),a("button",{type:"button",id:"brand-icon-reset",class:"quiet"},"使用默认图标")])]),a("p",{class:"description"},"支持 PNG、JPEG、WebP,原图最多 5 MB;上传时自动缩小,图片随系统数据库保存。"),a("h3",null,"新账号与跟随平台账号的默认外观"),a("div",{id:"brand-defaults",class:"form-grid"}),a("p",{id:"brand-status",role:"status"}),a("div",{class:"device-actions"},[a("button",{type:"submit"},"保存发布配置"),a("button",{type:"button",id:"brand-export",class:"quiet"},"导出发布配置"),a("label",{class:"config-import"},[C("导入配置到表单"),a("input",{id:"brand-import",type:"file",accept:"application/json,.json"})])]),a("p",{class:"description"},"导入后先核对再保存。导出的配置只含品牌与默认外观,不含账号、设备凭据、家庭资料和网络备份目录。")]),a("section",{id:"backup-panel",class:"panel"},[a("h3",null,"数据库备份"),a("p",{class:"description"},"整台服务的数据库包含所有家庭、账号、设备连接配置和网盘文件引用,因此仅超级管理员可操作。网盘中的照片、视频、语音及录像文件不包含在新数据库副本中;旧版备份可能仍含历史内嵌图片。恢复后所有账号需要重新登录。"),a("form",{id:"backup-form"},[a("div",{class:"form-grid"},[a("label",{class:"check full"},[a("input",{name:"enabled",type:"checkbox"}),C("启用每日定时备份")]),a("label",{class:"check full"},[a("input",{name:"baidu",type:"checkbox"}),C("同时上传到已连接的百度网盘")]),a("label",null,[C("每日时间(北京时间)"),a("input",{name:"time",type:"time",required:"",value:"03:00"})]),a("label",null,[C("本机/挂载目录保留份数"),a("input",{name:"keep",type:"number",min:"1",max:"90",required:"",value:"14"})]),a("label",{class:"full"},[C("网络备份目录(可留空)"),a("input",{name:"networkPath",maxlength:"500",placeholder:"/var/lib/zhaovision/network-backup"})])]),a("p",{class:"description"},"填写本服务器已挂载的网络盘目录。使用百度接口备份只需勾选上方选项;此路径用于其他已挂载的网络存储,不能填网页地址或分享链接。写入网络目录成功不等于已确认百度云端同步完成。"),a("p",{class:"description"},"默认部署允许写入 /var/lib/zhaovision 下的目录。挂载和目录权限须由主机管理员配置;本页不会保存网盘登录密码。保留份数只清理本机和挂载目录中本系统生成的旧备份,百度网盘保留最近一个自然月;新备份上传并校验成功后才清理本应用的过期副本。"),a("p",{id:"backup-local-path",class:"description"}),a("p",{id:"backup-save-status",role:"status"}),a("button",{type:"submit"},"保存备份设置")]),a("div",{class:"section-head"},[a("h3",null,"备份记录"),a("button",{id:"backup-run"},"立即备份数据库")]),a("p",{id:"backup-result",role:"status"}),a("div",{id:"backup-history"})])])],-1)),a("section",MM,[t[6]||(t[6]=a("div",{class:"scope-intro"},[a("span",{class:"eyebrow"},"岁月有迹 · 日常成章"),a("h2",null,"把生活,写成自己的来时路"),a("p",null,"与家人分享近况,也为自己留下一份阅历。")],-1)),a("div",TM,[t[4]||(t[4]=a("div",{class:"journal-editor-heading"},[a("strong",null,"记下此刻 · 留住声音"),a("button",{id:"journal-record",disabled:"",type:"button"},"● 开始录音"),a("button",{id:"journal-stop-record",type:"button",hidden:""},"■ 结束录音并插入"),a("button",{id:"journal-discard-record",type:"button",class:"quiet",hidden:""},"取消录音"),a("span",{id:"journal-record-elapsed",role:"status"}),a("button",{id:"journal-pick-media",disabled:"",type:"button",class:"quiet"},"插入照片/视频"),a("button",{type:"submit",form:"journal-form"},"保存"),a("button",{id:"journal-expand",type:"button",class:"quiet"},"全屏编辑"),a("button",{id:"journal-close-editor",type:"button",class:"quiet",hidden:""},"关闭编辑 · Esc")],-1)),a("form",EM,[t[0]||(t[0]=ge('

写一条记事

文字和媒体按正文顺序呈现。先将光标放在想插入的位置,再选择云端素材。

',6)),G(SC),t[1]||(t[1]=ge('
参与/相关家人(可多选)
录入账号与经历中的人物分别记录;未注册的老人和孩子也可关联。关联人物不会扩大可见范围。
',1)),t[2]||(t[2]=a("p",{id:"journal-status",role:"status","aria-live":"polite"},null,-1)),t[3]||(t[3]=a("div",{class:"device-actions"},[a("button",{id:"journal-save",type:"submit"},"保存记事"),a("button",{id:"journal-new",type:"button",class:"quiet"},"另写一条")],-1))]),t[5]||(t[5]=a("section",{class:"panel journal-materials","aria-label":"云端素材"},[a("div",{class:"section-head"},[a("div",null,[a("h3",null,"云端素材"),a("p",{class:"description"},"上传即插入正文,在原位置显示进度。上传期间可以继续写文字。")])]),a("div",{class:"journal-add-media"},[a("label",{class:"quiet"},[C("+ 上传照片、视频、语音"),a("input",{id:"journal-files",disabled:"",type:"file",multiple:"",accept:"image/jpeg,image/png,image/webp,video/mp4,video/quicktime,video/webm,audio/mpeg,audio/mp4,audio/aac,audio/wav,audio/ogg,audio/webm,.m4a"})]),a("button",{id:"journal-cancel-upload",type:"button",class:"quiet",hidden:""},"暂停全部上传")]),a("p",{id:"journal-cloud-note",class:"description"}),a("p",{class:"description"},"可混合选择文件,同时上传 3 个;单个最多 256 MB。每条正文可引用 9 个不同素材。录音最长 5 分钟。"),a("p",{id:"journal-upload-status",role:"status","aria-live":"polite"}),a("div",{id:"journal-upload-list"}),a("details",{id:"journal-library",class:"journal-library"},[a("summary",null,[C("我的云端素材("),a("span",{id:"journal-library-count"},"0"),C(")")]),a("div",{class:"journal-library-list-tools"},[a("span",{class:"description"},"已保存正文使用的素材,可在其他记事中再次引用。"),a("label",null,[C("筛选"),a("select",{id:"journal-media-filter"},[a("option",{value:""},"全部素材"),a("option",{value:"image/"},"照片"),a("option",{value:"video/"},"视频"),a("option",{value:"audio/"},"语音"),a("option",{value:"unused"},"草稿临时素材")])])]),a("div",{id:"journal-library-list",class:"journal-upload-grid"})]),a("details",{id:"journal-trash",class:"journal-trash",hidden:""},[a("summary",null,[C("已移除素材("),a("span",{id:"journal-trash-count"},"0"),C(")")]),a("p",{class:"description"},"仍被正文引用的素材可以恢复;最后一个引用删除后,网盘原文件自动删除。"),a("div",{id:"journal-trash-list"})]),a("details",{id:"journal-cleanup",hidden:""},[a("summary",null,"网盘清理记录"),a("button",{id:"journal-cleanup-refresh",type:"button",class:"quiet"},"刷新清理状态"),a("div",{id:"journal-cleanup-list"})]),a("p",{class:"description"},"放弃草稿或关闭页面会取消本次上传,并删除无其他引用的文件。意外断网退出时,服务器在草稿失联 10 分钟后自动清理。删除最后一处正文引用,也会删除网盘文件。")],-1))]),t[7]||(t[7]=ge('

个人阅历保留同一条记事的正文、媒体和互动;查看他人时只展示其分享给当前家庭/场所的内容。删除正文中的媒体或整条记事,会解除对应引用;最后一个引用删除后,网盘原文件自动清理。

',2)),t[8]||(t[8]=a("div",{class:"section-head"},[a("p",{id:"journal-query-status",role:"status"}),a("div",null,[a("button",{id:"journal-prev",class:"quiet"},"上一页"),a("button",{id:"journal-next",class:"quiet"},"下一页")])],-1)),t[9]||(t[9]=a("div",{id:"journal-list",class:"journal-feed"},null,-1))]),a("section",AM,[G(ib),t[10]||(t[10]=a("div",{id:"scope-overview"},null,-1))]),a("section",OM,[G(eg),t[11]||(t[11]=a("div",{id:"device-detail"},null,-1))]),t[20]||(t[20]=a("section",{id:"page-heritage",class:"page",hidden:""},[a("div",{id:"heritage-home"})],-1)),t[21]||(t[21]=a("section",{id:"page-live",class:"page"},[a("div",{class:"section-head"},[a("h2",{id:"live-heading"},"本场所监控墙"),a("div",null,[a("label",null,[C("清晰度 "),a("select",{id:"quality"},[a("option",{value:"hd"},"主码流"),a("option",{value:"compat"},"子码流")])])])]),a("details",{class:"live-help"},[a("summary",null,"画面与清晰度说明"),a("p",{id:"wall-context",class:"description"},"这里汇总当前场所内已授权的镜头;点击摄像头详情可进入单台设备。"),a("p",{class:"description",id:"quality-note"},"主码流画面更清晰,最高 1920×1080;子码流更流畅,最高 768×432,适合网络较慢时使用。")]),a("div",{class:"wall-toolbar"},[a("label",null,[C("分屏 "),a("select",{id:"wall-layout"},[a("option",{value:"auto"},"自适应"),a("option",{value:"1"},"1 画面"),a("option",{value:"2"},"2 画面"),a("option",{value:"4"},"4 画面"),a("option",{value:"6"},"6 画面"),a("option",{value:"9"},"9 画面"),a("option",{value:"16"},"16 画面")])]),a("label",{class:"check"},[a("input",{id:"wall-arrange",type:"checkbox"}),C("调整顺序")]),a("div",{class:"wall-paging"},[a("button",{id:"wall-prev",class:"quiet","aria-label":"上一组画面"},"‹"),a("span",{id:"wall-page"}),a("button",{id:"wall-next",class:"quiet","aria-label":"下一组画面"},"›")]),a("span",{id:"wall-clock"}),a("button",{id:"wall-fullscreen"},"全屏监控")]),a("div",{id:"live-grid",class:"live-grid"}),a("section",{id:"ptz-panel",class:"ptz-panel",hidden:""},[a("div",null,[a("strong",{id:"ptz-title"},"云台"),a("p",{id:"ptz-status",role:"status"})]),a("div",{class:"ptz-pad"},[a("button",{"data-ptz-action":"up","aria-label":"云台向上"},"↑"),a("button",{"data-ptz-action":"left","aria-label":"云台向左"},"←"),a("button",{"data-ptz-action":"stop"},"停止"),a("button",{"data-ptz-action":"right","aria-label":"云台向右"},"→"),a("button",{"data-ptz-action":"down","aria-label":"云台向下"},"↓")]),a("div",{id:"ptz-presets"},[a("div",{class:"section-head"},[a("strong",null,[C("常用位置 "),a("small",{id:"preset-count"})]),a("button",{id:"preset-reload",class:"quiet"},"重新读取")]),a("p",{id:"preset-status",role:"status"}),a("div",{id:"preset-list"}),a("p",{class:"description"},"调整位置后可另存为新预置位。本版不覆盖已有位置,避免设备固件拒绝或误改。"),a("form",{id:"preset-form",hidden:""},[a("label",null,[C("当前位置名称"),a("input",{id:"preset-name",required:"",maxlength:"40",placeholder:"例如:大门、院子"})]),a("button",{type:"submit"},"保存当前位置")]),a("div",{id:"preset-confirmation",hidden:""},[a("p",{id:"preset-confirm-text"}),a("button",{id:"preset-confirm-yes"},"确认"),a("button",{id:"preset-confirm-cancel",class:"quiet"},"取消")])]),a("button",{id:"ptz-close",class:"quiet"},"收起云台")])],-1)),t[22]||(t[22]=a("section",{id:"page-playback",class:"page",hidden:""},[a("div",{class:"section-head"},[a("h2",null,[C("回到那一刻 "),a("small",null,"光阴")])]),a("div",{class:"panel playback-controls"},[a("label",null,[C("镜头 / 通道"),a("select",{id:"play-camera"})]),a("label",null,[C("录像来源"),a("select",{id:"archive-source"},[a("option",{value:"recorder"},"录像机原有录像(待接入)"),a("option",{value:"baidu"},"百度网盘录像"),a("option",{value:"local"},"本机待上传录像")])]),a("label",null,[C("日期"),a("input",{id:"play-date",type:"date"})]),a("button",{id:"query-recordings"},"查找录像"),a("span",{id:"play-info"},"选择日期,查看实际录像时段")]),a("aside",{id:"recording-health",class:"panel","aria-label":"本机录像状态",hidden:""},[a("div",{class:"section-head"},[a("strong",{id:"recording-health-text",role:"status"}),a("button",{id:"recording-configure",class:"quiet",hidden:""},"录像设置")]),a("p",{id:"recording-policy-note",class:"description"}),a("p",{id:"recording-start-note",class:"description"})]),a("div",{class:"video-panel"},[a("video",{id:"play-video",controls:"",playsinline:""}),a("div",{id:"play-empty",class:"video-empty"},"选择一个有录像的时间段")]),a("div",{class:"panel"},[a("div",{class:"timeline-head"},[a("strong",null,"当日时间轴"),a("span",null,[a("i",{class:"legend"}),C(" 有录像的时段 · 点击定位")])]),a("canvas",{id:"timeline",height:"76","aria-label":"录像时间轴"}),a("div",{class:"time-labels"},[a("span",null,"00:00"),a("span",null,"06:00"),a("span",null,"12:00"),a("span",null,"18:00"),a("span",null,"24:00")]),a("div",{class:"seek-row"},[a("label",null,[C("定位时间 "),a("input",{id:"seek-time",type:"time",step:"1",value:"12:00:00"})]),a("button",{id:"seek-button",class:"secondary"},"定位播放"),a("a",{id:"download",class:"button secondary",hidden:""},"下载原始片段")])]),a("div",{class:"panel"},[a("div",{class:"playback-tools"},[a("label",{class:"check"},[a("input",{id:"play-autonext",type:"checkbox",checked:""}),C("自动续播下一时段(跳过空档)")]),a("button",{id:"play-snapshot",class:"quiet"},"回放截图"),a("span",{id:"play-position",role:"status"})]),a("details",{class:"clip-editor"},[a("summary",null,"选取并下载指定片段"),a("form",{id:"clip-form"},[a("div",{class:"form-grid"},[a("label",null,[C("开始时间"),a("input",{id:"clip-start",type:"datetime-local",step:"1",required:""})]),a("label",null,[C("结束时间"),a("input",{id:"clip-end",type:"datetime-local",step:"1",required:""})])]),a("div",{class:"playback-tools"},[a("button",{type:"button",class:"quiet","data-clip-mark":"start"},"当前位置作起点"),a("button",{type:"button",class:"quiet","data-clip-mark":"end"},"当前位置作终点"),a("button",{type:"submit"},"生成下载链接"),a("a",{id:"clip-download",class:"button secondary",hidden:""},"下载所选片段")]),a("p",{id:"clip-status",role:"status",class:"description"}),a("p",{class:"description"},"每段最多一小时,不可跨越无录像时段。下载保留原始编码,剪辑边界可能受设备关键帧影响。")])])]),a("div",{id:"recording-list",class:"recording-list"})],-1)),t[23]||(t[23]=ge('',1)),a("section",NM,[t[12]||(t[12]=ge('

一物一档 设备 · 归属

同一设备可同时记录类型、区域、所有人、负责人和标签。分组顺序可自由组合,例如“灯 → 卧室”或“负责人 → 类型 → 区域”。人员归属不自动授予访问权限。

',2)),t[13]||(t[13]=a("div",{class:"panel device-view-controls"},[a("div",{class:"device-search-row"},[a("label",null,[C("设备类型"),a("select",{id:"device-type"},[a("option",{value:""},"所有类型")])]),a("label",null,[C("搜索设备或人员"),a("input",{id:"device-search",type:"search",placeholder:"例如:卧室 灯;也可查 IP、品牌、型号、人员"})]),a("button",{id:"device-clear",type:"button",class:"quiet",hidden:""},"清除设备筛选")]),a("div",{class:"device-actions view-presets",role:"group","aria-label":"设备分组方式"},[a("button",{type:"button",class:"quiet","data-group-preset":"space,type"},"按区域查看"),a("button",{type:"button",class:"quiet","data-group-preset":"type,space"},"按类型查看"),a("button",{type:"button",class:"quiet","data-group-preset":"manager,type,space"},"按负责人查看")]),a("details",{class:"group-custom"},[a("summary",null,"自定义分组顺序"),a("p",{class:"description"},"依次分组(前面的维度优先,区域按你定义的完整层级展示)"),a("div",{id:"device-group-order",class:"device-group-order"}),a("div",{class:"device-actions"},[a("button",{id:"device-group-add",class:"quiet"},"+ 增加分组维度"),a("button",{"data-admin":"",id:"device-view-save",class:"secondary"},"保存为本归属的默认视图")])]),a("p",{id:"device-count",class:"description"})],-1)),t[14]||(t[14]=a("div",{class:"device-actions",role:"group","aria-label":"设备展示方式"},[a("button",{id:"devices-card-view",class:"quiet","aria-pressed":"true"},"设备卡片"),a("button",{id:"devices-topology-view",class:"quiet","aria-pressed":"false"},"网络拓扑")],-1)),G(Om),G(Zm),G(dg)]),t[24]||(t[24]=ge('',2)),a("section",IM,[G(Zb),t[15]||(t[15]=ge('

录像与存储 留存

录像上传与保留策略

网盘录像默认每段 5 分钟,按录制时间上传;云端大小及 SHA-256 校验成功后删除本地片段。上传失败会保留并自动重试,未上传片段不会按天数清理。云端默认保留 30 天。容量上限由全部摄像头共用;临时录像分区另有硬容量限制,空间不足时暂停并在释放后恢复。

运行状态

每台摄像头可选择录像机或百度网盘。网盘方式临时保存原始主码流,上传并校验后腾出本机空间。预览默认使用主码流高清画面(最高 1920×1080、15 帧/秒),也可切换子码流流畅画面(最高 768×432、10 帧/秒)。本机录像保留设备原始编码。

最近操作

',2))]),t[25]||(t[25]=a("section",{id:"page-heritage-records",class:"page",hidden:""},[a("div",{class:"section-head"},[a("h2",{id:"heritage-records-title"},"文化与家风"),a("div",null,[a("button",{class:"quiet","data-page":"heritage"},"返回家庭传承"),a("button",{id:"heritage-new"},"+ 新建档案")])]),a("div",{class:"panel heritage-controls"},[a("label",null,[C("查找档案"),a("input",{id:"heritage-search",type:"search",placeholder:"名称、内容、相关人员"})]),a("label",{class:"check"},[a("input",{id:"heritage-archived",type:"checkbox"}),C("包含归档资料")]),a("button",{id:"heritage-reload",class:"quiet"},"重新载入")]),a("p",{id:"heritage-error",class:"form-error",role:"status"}),a("div",{id:"heritage-list",class:"site-grid"}),a("aside",{id:"heritage-detail",class:"panel",hidden:""})],-1)),t[26]||(t[26]=a("section",{id:"page-family",class:"page",hidden:""},[a("div",{class:"section-head"},[a("h2",null,[C("家族的来处与延续 "),a("small",null,"世系 · 传承")]),a("div",null,[a("button",{id:"family-reload",class:"quiet"},"重新载入"),a("button",{id:"family-export",class:"quiet"},"导出家谱"),a("button",{id:"new-person"},"+ 录入人物")])]),a("p",{class:"description"},"从祖辈到后辈,一张图看全家。点击人物查看档案,暖金色卡片是当前账号关联的本人。"),a("p",{id:"family-edit-note",class:"alert alert-info",role:"status"}),a("div",{class:"panel family-toolbar"},[a("label",null,[C("关系参照人物"),a("select",{id:"family-reference"})]),a("label",null,[C("查找人物"),a("input",{id:"family-search",type:"search",placeholder:"姓名、别名或籍贯"})]),a("button",{id:"family-find",class:"quiet",hidden:""},"定位搜索结果"),a("label",{class:"check"},[a("input",{id:"family-archived",type:"checkbox"}),C("显示归档人物")]),a("span",{id:"family-count"})]),a("div",{id:"family-error",class:"form-error",role:"status"}),a("div",{id:"family-workspace",class:"family-workspace"},[a("section",{id:"family-canvas-panel",class:"family-canvas-panel","aria-label":"全家关系图"},[a("div",{class:"family-map-heading"},[a("div",null,[a("span",{class:"eyebrow"},"枝叶相连 · 世代相承"),a("h2",{id:"family-view-title"},"全家关系图")]),a("div",{class:"family-view-tabs",role:"group","aria-label":"家谱显示方式"},[a("button",{id:"family-view-tree",class:"quiet","aria-pressed":"true"},"关系图"),a("button",{id:"family-view-list",class:"quiet","aria-pressed":"false"},"人物名册"),a("button",{id:"family-view-timeline",class:"quiet","aria-pressed":"false"},"家族时间线")])]),a("div",{id:"family-map-controls",class:"family-map-controls"},[a("div",{class:"family-zoom-controls"},[a("button",{id:"family-zoom-out",class:"quiet","aria-label":"缩小家谱"},"−"),a("output",{id:"family-zoom-value","aria-live":"polite"},"100%"),a("button",{id:"family-zoom-in",class:"quiet","aria-label":"放大家谱"},"+"),a("button",{id:"family-fit",class:"quiet"},"查看全谱")]),a("button",{id:"family-locate-self",class:"quiet"},"◎ 定位本人"),a("button",{id:"family-fullscreen",class:"quiet"},"全屏家谱")]),a("div",{id:"family-tree",class:"family-map-viewport",tabindex:"0",role:"region","aria-label":"家谱关系图,可拖动空白处或使用滚动条浏览"}),a("div",{id:"family-people",class:"family-people family-register",hidden:""}),a("section",{id:"family-events",hidden:"","aria-label":"家族重大记事"},[a("div",{class:"family-event-intro"},[a("div",null,[a("h3",null,"把值得记住的事,留给后来的人"),a("p",{class:"description"},"按事情发生的日期排列,可关联多位亲人,并附上详细记载或报道链接。")]),a("button",{id:"family-new-event"},"+ 写一则记事")]),a("div",{class:"family-event-filters"},[a("label",null,[C("关联人物"),a("select",{id:"family-event-person"},[a("option",{value:""},"全家")])]),a("label",null,[C("年份"),a("select",{id:"family-event-year"},[a("option",{value:""},"所有年份")])]),a("label",null,[C("排列"),a("select",{id:"family-event-order"},[a("option",{value:"desc"},"从近到远"),a("option",{value:"asc"},"从远到近")])]),a("label",null,[C("搜索记事"),a("input",{id:"family-event-search",type:"search",placeholder:"标题、摘要或正文"})]),a("label",{class:"check"},[a("input",{id:"family-event-relatives",type:"checkbox"}),C("包括此人的父母、配偶和子女")]),a("label",{id:"family-event-state-label"},[C("状态"),a("select",{id:"family-event-state"},[a("option",{value:"published"},"已发布"),a("option",{value:"draft"},"草稿箱"),a("option",{value:"archived"},"已归档"),a("option",{value:"all"},"全部")])]),a("button",{id:"family-event-clear",class:"quiet"},"清除筛选")]),a("p",{id:"family-event-count",class:"description",role:"status"}),a("div",{id:"family-timeline",class:"family-timeline"})]),a("div",{id:"family-map-footer",class:"family-map-footer"},[a("div",{class:"family-map-legend"},[a("span",null,[a("i",{class:"legend-self"}),C("本人")]),a("span",null,[a("i",{class:"legend-selected"}),C("正在查看")]),a("span",null,[a("i",{class:"legend-parent"}),C("父母 → 子女")]),a("span",null,[a("i",{class:"legend-spouse"}),C("配偶")]),a("span",null,[a("i",{class:"legend-adoptive"}),C("收养 / 继亲")])]),a("p",{id:"family-map-note",class:"description",role:"status"}),a("span",{class:"description"},"拖动空白处移动 · 点击人物查看档案 · 关系称谓按参照人物计算")])]),a("aside",{id:"family-detail",class:"panel family-inspector","aria-label":"人物档案"})])],-1)),G(ih),t[27]||(t[27]=ge('
赵府 · 智能数字管家独立部署 / 数据自有
',2))],64))}},$M={};function RM(n,e){return y(),x(H,null,[e[0]||(e[0]=ge('
灯火可亲 · 归家有时

欢迎回来

使用自己的账号,进入家庭空间。

设备档案

网络与连接

保存后自动更新拓扑。网络信息用于设备档案;摄像机实际取流地址在“配置镜头”内设置。选择人员不改变账号访问权限。

手机、灯、冰箱等当前支持设备档案、分类和责任归属。自动控制需另行接入对应协议,登记不代表已连接设备。

传承资料

这里只保存资料和意愿;不会据此转移财产或授予任何账号权限。链接内容保存在原位置,本系统保存链接和文字记录。

空间档案

镜头通道配置

直接接入摄像头时,可读取设备实际提供的媒体配置。端口请按设备填写:通常为 80,部分 TP-Link 设备为 2020。服务器需要能够访问该设备所在网络。

选择录像机时,本平台不重复录制,须在录像机上开启录像计划;设备是否实际录制需在原厂后台核对。选择百度网盘时,请勾选启用网盘录像。账号和密码只保存在本机受限数据目录。RTSP 服务响应代表设备可达,实际码流接通后才显示在线。路径预设需要与设备型号、通道一致。

摄像头对象

网络与连接

保存后自动更新拓扑。网络信息用于设备档案;摄像机实际取流地址在“配置镜头”内设置。选择人员不改变账号访问权限。

录像机配置

网络与连接

保存后自动更新拓扑。网络信息用于设备档案;摄像机实际取流地址在“配置镜头”内设置。选择人员不改变账号访问权限。

驱动在当前版本提供路径模板。录像机历史录像检索、回放及通道自动导入,需要型号确认后接入,当前尚未实现。

',7)),e[1]||(e[1]=a("dialog",{id:"leadership-dialog"},[a("form",{id:"leadership-form"},[a("div",{class:"dialog-heading"},[a("h2",null,"负责人安排与交接"),a("button",{type:"button",class:"quiet","data-close":"leadership-dialog"},"关闭")]),a("input",{name:"id",type:"hidden"}),a("input",{name:"revision",type:"hidden"}),a("p",{class:"description"},"从已获本家庭访问权限的系统账号中,指定主要和备用负责人。主要负责人即一家之主;普通账号需明确确认授予本家庭管理权限。真实家庭成员可以没有登录账号。"),a("p",{id:"leadership-scope",class:"fw-semibold"}),a("div",{id:"leadership-empty",class:"alert alert-info",role:"status",hidden:""},"本家庭还没有可选账号。请由平台管理员在系统用户中授予家庭访问权限,再指定负责人。"),a("div",{class:"leadership-member-actions d-flex flex-wrap gap-2 mb-3"},[a("button",{type:"button",id:"leadership-new",class:"secondary"},"+ 添加本家庭管理员"),a("button",{type:"button",id:"leadership-members",class:"quiet"},"管理授权账号")]),a("div",{class:"form-grid"},[a("label",null,[C("主要负责人 *"),a("select",{name:"ownerId",required:""})]),a("label",null,[C("备用负责人"),a("select",{name:"successorId"})]),a("label",{id:"leadership-grant",class:"check full alert alert-warning",hidden:""},[a("input",{type:"checkbox",name:"grantManagement"}),a("span",{id:"leadership-grant-note"})]),a("label",{class:"full"},[C("安排 / 交接说明 *"),a("textarea",{name:"reason",required:"",maxlength:"300",rows:"3",placeholder:"说明负责人安排或本次交接原因"})])]),a("p",{class:"description"},"交接后原负责人仍保留本归属的管理员权限。系统不会依据未登录或家谱去世日期自动转移权限;交接记录可追溯。"),a("p",{class:"form-error",role:"status"}),a("div",{class:"dialog-footer"},[a("button",{type:"submit"},"确认保存负责人安排")])])],-1)),e[2]||(e[2]=a("dialog",{id:"household-dialog"},[a("form",{id:"household-form"},[a("div",{class:"dialog-heading"},[a("h2",null,"家庭 / 场所档案"),a("button",{type:"button",class:"quiet","data-close":"household-dialog"},"关闭")]),a("input",{name:"id",type:"hidden"}),a("input",{name:"profileRevision",type:"hidden",value:"0"}),a("div",{class:"form-grid"},[a("label",{class:"full"},[C("归属名称 *"),a("input",{name:"name",maxlength:"80",required:"",placeholder:"例如:赵府、济南办公室、莱阳工厂"})]),a("label",{class:"full"},[C("归属类型"),a("select",{name:"kind"},[a("option",{value:"home"},"家庭"),a("option",{value:"office"},"办公场所"),a("option",{value:"factory"},"工厂")])]),a("fieldset",{class:"full geo-picker","data-geography":"","data-geo-title":"所在地"}),a("div",{class:"full cover-editor"},[a("img",{id:"household-cover-preview",alt:"场所封面预览",hidden:""}),a("label",null,[C("卡片封面照片"),a("input",{id:"household-cover-file",type:"file",accept:"image/png,image/jpeg,image/webp"})]),a("button",{type:"button",id:"household-cover-cancel",class:"quiet"},"取消本次图片选择"),a("button",{type:"button",id:"household-cover-reset",class:"quiet"},"使用默认封面"),a("p",{id:"household-cover-status",class:"description",role:"status","aria-live":"polite"},"照片仅向有权进入该家庭或场所的账号开放。")]),a("label",{class:"full"},[C("备注"),a("textarea",{name:"note",maxlength:"300",rows:"3"})])]),a("p",{class:"description"},"创建后进入该归属,建立管理员,再自行划分区域和登记设备。"),a("p",{class:"form-error"}),a("div",{class:"dialog-footer"},[a("button",{type:"submit"},"保存家庭")])])],-1)),e[3]||(e[3]=ge('

账号档案

亲属关系在家庭成员对应的族谱人物之间建立;登录账号仅关联本人身份和访问权限。

允许查看摄像头的空间

普通成员只访问本归属内已授权的区域。默认仅授权所选区域;勾选“包含下级区域”后同时包含其所有后代。管理员可管理本归属全部区域。

',2)),e[4]||(e[4]=a("dialog",{id:"person-dialog"},[a("form",{id:"person-form"},[a("div",{class:"dialog-heading"},[a("h2",null,"家谱人物"),a("button",{type:"button",class:"quiet","data-close":"person-dialog"},"关闭")]),a("input",{name:"id",type:"hidden"}),a("input",{name:"revision",type:"hidden"}),a("p",{id:"person-self-note",class:"alert alert-info",hidden:""},"这将建立并固定关联为您本人,用于确定上下五代维护范围。如族谱已有您的人物,请关闭此窗口并请管理员关联,避免重复建档。"),a("fieldset",{id:"person-relative-fields"},[a("legend",null,"新人物与已有亲属的关系"),a("div",{class:"form-grid"},[a("label",null,[C("已有亲属"),a("select",{name:"relativeId"})]),a("label",null,[C("新人物是其"),a("select",{name:"relativeKind"},[a("option",{value:"parent"},"父母一方(上一代)"),a("option",{value:"child"},"子女(下一代)"),a("option",{value:"spouse"},"配偶(同代)")])])]),a("p",{class:"description"},"人物与关系一起保存,无需为亲属开设登录账号;超出五代时不会写入。")]),a("div",{class:"form-grid"},[a("label",null,[C("姓名 / 称呼 *"),a("input",{name:"name",required:"",maxlength:"80",placeholder:"姓名暂不知时可先填称呼"})]),a("label",null,[C("别名 / 字 / 号"),a("input",{name:"alias",maxlength:"120"})]),a("label",null,[C("性别"),a("select",{name:"gender"},[a("option",{value:"unknown"},"待确认"),a("option",{value:"male"},"男"),a("option",{value:"female"},"女")])]),a("label",null,[C("在世情况"),a("select",{name:"lifeStatus"},[a("option",{value:"alive"},"在世"),a("option",{value:"deceased"},"不在世"),a("option",{value:"unknown"},"待确认")])]),a("fieldset",{class:"family-date","data-date-field":"birthDate"},[a("legend",null,"出生日期"),a("input",{name:"birthDate",type:"hidden"}),a("label",null,[C("历法"),a("select",{"data-calendar":"","aria-label":"出生日期历法"},[a("option",{value:"solar"},"公历"),a("option",{value:"lunar"},"农历")])]),a("label",null,[C("日期"),a("input",{"data-date-value":"","aria-label":"出生日期",type:"text",inputmode:"numeric",placeholder:"YYYY-MM-DD",maxlength:"10"})]),a("label",{"data-leap-label":"",class:"check",hidden:""},[a("input",{"data-date-leap":"",type:"checkbox"}),C("闰月")]),a("output",{"data-date-hint":"","aria-live":"polite"},"日期不详可留空")]),a("fieldset",{class:"family-date","data-date-field":"deathDate",hidden:""},[a("legend",null,"去世日期"),a("input",{name:"deathDate",type:"hidden"}),a("label",null,[C("历法"),a("select",{"data-calendar":"","aria-label":"去世日期历法"},[a("option",{value:"solar"},"公历"),a("option",{value:"lunar"},"农历")])]),a("label",null,[C("日期"),a("input",{"data-date-value":"","aria-label":"去世日期",type:"text",inputmode:"numeric",placeholder:"YYYY-MM-DD",maxlength:"10"})]),a("label",{"data-leap-label":"",class:"check",hidden:""},[a("input",{"data-date-leap":"",type:"checkbox"}),C("闰月")]),a("output",{"data-date-hint":"","aria-live":"polite"},"日期不详可留空")]),a("label",{class:"full",id:"person-legacy-place"},[C("原籍贯/出生地记录"),a("input",{name:"birthplace",maxlength:"160"}),a("small",null,"历史填写内容保留,可在下方分别补充。")]),a("fieldset",{class:"full person-location"},[a("legend",null,"籍贯(祖籍)"),a("div",{class:"form-grid"},[a("fieldset",{class:"full geo-picker","data-geography":"native","data-geo-title":"籍贯(祖籍)"}),a("label",null,[C("乡镇/街道"),a("input",{name:"nativeTown",maxlength:"80",placeholder:"","aria-label":"籍贯(祖籍) · 乡镇/街道"})]),a("label",null,[C("村/社区"),a("input",{name:"nativeCommunity",maxlength:"80",placeholder:"","aria-label":"籍贯(祖籍) · 村/社区"})]),a("label",{class:"full"},[C("详细地址/历史地名"),a("input",{name:"nativeAddress",maxlength:"200",placeholder:"楼栋、门牌或旧称,可按已知信息填写","aria-label":"籍贯(祖籍) · 详细地址/历史地名"})])])]),a("fieldset",{class:"full person-location"},[a("legend",null,"出生地"),a("div",{class:"form-grid"},[a("fieldset",{class:"full geo-picker","data-geography":"birth","data-geo-title":"出生地"}),a("label",null,[C("乡镇/街道"),a("input",{name:"birthTown",maxlength:"80",placeholder:"","aria-label":"出生地 · 乡镇/街道"})]),a("label",null,[C("村/社区"),a("input",{name:"birthCommunity",maxlength:"80",placeholder:"","aria-label":"出生地 · 村/社区"})]),a("label",{class:"full"},[C("详细地址/历史地名"),a("input",{name:"birthAddress",maxlength:"200",placeholder:"楼栋、门牌或旧称,可按已知信息填写","aria-label":"出生地 · 详细地址/历史地名"})])])]),a("p",{class:"description full"},"籍贯与出生地可不同;选择中国、世界或自定义地域,不详的层级可留空。"),a("label",{class:"full"},[C("生平简介"),a("textarea",{name:"biography",rows:"4",maxlength:"2000"})]),a("label",{class:"full"},[C("备注 / 信息来源"),a("textarea",{name:"note",rows:"3",maxlength:"500",placeholder:"例如:长辈口述、族谱记载、待考证信息"})]),a("label",{class:"check"},[a("input",{name:"archived",type:"checkbox"}),C("归档人物(保留关系,可恢复)")])]),a("p",{class:"form-error"}),a("div",{class:"dialog-footer"},[a("button",{type:"submit"},"保存人物")])])],-1)),e[5]||(e[5]=ge('

连接人物关系

每条亲子关系连接一位父母与一位子女。双方需在本人上下五代内;不能通过移动或断开已确认世系来改变维护范围。

',1)),e[6]||(e[6]=a("dialog",{id:"event-dialog","aria-labelledby":"event-editor-title"},[a("form",{id:"event-form"},[a("div",{class:"dialog-heading"},[a("h2",{id:"event-editor-title"},"写一则家族记事"),a("button",{type:"button",class:"quiet","data-close":"event-dialog"},"关闭")]),a("input",{name:"id",type:"hidden"}),a("input",{name:"revision",type:"hidden"}),a("div",{class:"form-grid"},[a("label",{class:"full"},[C("记事标题 *"),a("input",{name:"title",required:"",maxlength:"160",placeholder:"用一句话概括这件事"})]),a("fieldset",{class:"family-date full","data-date-field":"eventDate"},[a("legend",null,"事情发生的日期 *"),a("input",{name:"eventDate",type:"hidden"}),a("label",null,[C("历法"),a("select",{"data-calendar":"","aria-label":"记事日期历法"},[a("option",{value:"solar"},"公历"),a("option",{value:"lunar"},"农历")])]),a("label",null,[C("日期"),a("input",{"data-date-value":"","aria-label":"记事日期",required:"",type:"text",inputmode:"numeric",placeholder:"YYYY-MM-DD",maxlength:"10"})]),a("label",{"data-leap-label":"",class:"check",hidden:""},[a("input",{"data-date-leap":"",type:"checkbox"}),C("闰月")]),a("output",{"data-date-hint":"","aria-live":"polite"})]),a("fieldset",{class:"full"},[a("legend",null,"关联人物(可多选)"),a("input",{id:"event-person-search",type:"search",placeholder:"查找要关联的亲人","aria-label":"查找关联人物"}),a("div",{id:"event-person-choices"}),a("p",{class:"description"},"未选择人物时记为全家记事。每位关联人物的档案都可以追溯到这条记事。")]),a("label",{class:"full"},[C("摘要"),a("textarea",{name:"summary",maxlength:"400",rows:"2",placeholder:"简要说明这件事"})]),a("label",{class:"full"},[C("详细记载"),a("textarea",{name:"body",maxlength:"12000",rows:"7",placeholder:"记录经过、意义、长辈口述或资料出处。可分段书写。"})]),a("label",null,[C("报道 / 资料来源"),a("input",{name:"sourceName",maxlength:"160",placeholder:"例如:报刊名称、个人博客"})]),a("label",null,[C("原始报道链接"),a("input",{name:"sourceUrl",type:"url",maxlength:"2000",placeholder:"https://…"})]),a("label",{class:"check full"},[a("input",{name:"archived",type:"checkbox"}),C("归档记事(保留内容,可恢复)")])]),a("p",{class:"description"},"正式发布后,有家谱查看权限的账号即可在时间线看到;草稿只对有编辑权限的人可见。"),a("p",{class:"form-error",role:"status"}),a("div",{class:"dialog-footer event-editor-actions"},[a("button",{type:"submit","data-save-event":"",value:"draft",class:"secondary"},"保存草稿"),a("button",{type:"submit","data-publish-event":"",value:"published"},"发布记事"),a("button",{type:"submit","data-withdraw-event":"",value:"draft",class:"secondary",hidden:""},"撤回为草稿")])])],-1)),e[7]||(e[7]=ge('
家事 · 家声
',1)),e[8]||(e[8]=a("dialog",{id:"history-dialog","aria-labelledby":"history-title"},[a("div",{class:"dialog-heading"},[a("h2",{id:"history-title"},"修改记录"),a("button",{type:"button",class:"quiet","data-close":"history-dialog"},"关闭")]),a("p",{class:"description"},"人物、关系与记事每次保存都会留存版本。仅有家谱编辑权限的账号可查阅和恢复。"),a("p",{id:"history-error",class:"form-error",role:"status"}),a("div",{id:"history-list"}),a("button",{id:"history-more",class:"quiet",hidden:""},"加载更早记录"),a("article",{id:"history-detail"})],-1)),e[9]||(e[9]=a("dialog",{id:"password-dialog","aria-labelledby":"password-title"},[a("form",{id:"password-form"},[a("div",{class:"dialog-heading"},[a("h2",{id:"password-title"},"修改我的密码"),a("button",{type:"button",class:"quiet","data-close":"password-dialog"},"关闭")]),a("p",{id:"password-account",class:"description"}),a("label",null,[C("当前密码"),a("input",{name:"currentPassword",type:"password",required:"",maxlength:"128",autocomplete:"current-password"})]),a("label",null,[C("新密码"),a("input",{name:"newPassword",type:"password",required:"",minlength:"8",maxlength:"128",autocomplete:"new-password"})]),a("label",null,[C("再次输入新密码"),a("input",{name:"confirmPassword",type:"password",required:"",minlength:"8",maxlength:"128",autocomplete:"new-password"})]),a("p",{class:"description"},"保存后,这个账号在所有设备上都需要用新密码重新登录。"),a("p",{class:"form-error",role:"status"}),a("div",{class:"dialog-footer"},[a("button",{type:"submit"},"保存新密码")])])],-1)),e[10]||(e[10]=a("dialog",{id:"camera-settings-dialog","aria-labelledby":"camera-settings-title"},[a("div",{class:"dialog-heading"},[a("h2",{id:"camera-settings-title"},"摄像机参数"),a("button",{class:"quiet","data-close":"camera-settings-dialog"},"关闭")]),a("div",{class:"section-head"},[a("label",null,[C("设置码流"),a("select",{id:"camera-settings-quality"},[a("option",{value:"main"},"主码流"),a("option",{value:"sub"},"子码流")])]),a("button",{id:"camera-settings-reload",class:"quiet"},"重新读取")]),a("div",{id:"camera-settings-info"}),a("p",{id:"camera-settings-status",class:"form-error",role:"status"}),a("form",{id:"camera-image-form"},[a("h3",null,"图像与日夜模式"),a("p",{class:"description"},"作用于当前物理镜头,主、子码流共用这些图像参数。"),a("div",{id:"camera-image-fields",class:"form-grid"}),a("div",{class:"dialog-footer"},[a("button",{type:"submit",disabled:""},"保存图像参数")])]),a("form",{id:"camera-video-form"},[a("h3",null,"码流与清晰度"),a("p",{class:"description"},"作用于上方选定的码流。保存后画面可能短暂重连,录像机也会使用调整后的码流。本页保留原有视频编码。"),a("div",{id:"camera-video-fields",class:"form-grid"}),a("div",{class:"dialog-footer"},[a("button",{type:"submit",disabled:""},"保存码流参数")])]),a("details",null,[a("summary",null,"其他萤石功能的接入情况"),a("ul",null,[a("li",null,"云台方向微调与预置位:在实时画面的“云台”中使用,按设备能力启用。"),a("li",null,"实时声音与全屏:通过画面播放器控制。"),a("li",null,"双向对讲、智能追踪、声光告警、隐私遮蔽、设备翻转、云录像和消息推送:当前尚未接入,请使用萤石 App。"),a("li",null,"录像机原有录像:仍通过录像机或原厂 App 查看;本系统已支持本机额外录像的回放。")]),a("p",{class:"description"},"功能按设备实际开放能力逐项接入,型号与固件不同可能有差异。")])],-1)),e[11]||(e[11]=a("div",{id:"toast",role:"status",hidden:""},null,-1)),e[12]||(e[12]=ge('

画面截图

当前视频画面截图

下载 PNG 图片

附件预览

',2))],64)}const LM=In($M,[["render",RM]]),PM=["/vendor/hls.min.js","/live-player.js","/kinship.js","/family-graph.js","/calendar.js","/device-model.js","/data/geography-data.js","/geography.js","/app.js","/monitor.js","/date-fields.js","/family-map.js","/family.js","/family-events.js","/family-history.js","/camera-settings.js","/recording-ranges.js","/recording-ui.js","/snapshot.js","/households.js","/devices.js","/steward.js","/heritage.js","/personalization.js","/file-hash.js","/journal-queue.js","/journal.js"];function Ea(n){if(!(n instanceof Element))return;const e=[n,...n.querySelectorAll("button,input,select,textarea,table")];for(const t of e)t.matches("button")&&!t.closest(".family-map-viewport")&&!t.classList.contains("btn")&&t.classList.add("btn",t.matches(".quiet,.secondary")?"btn-outline-secondary":"btn-primary"),t.matches("select")&&t.classList.add("form-select"),t.matches("textarea,input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden])")&&t.classList.add("form-control"),t.matches("input[type=checkbox],input[type=radio]")&&t.classList.add("form-check-input"),t.matches("table")&&t.classList.add("table","align-middle")}async function BM(){Ea(document.getElementById("app")),new MutationObserver(n=>{for(const e of n)for(const t of e.addedNodes)Ea(t)}).observe(document.getElementById("app"),{childList:!0,subtree:!0});for(const n of[...PM,"/vue-bridge.js"])await new Promise((e,t)=>{const s=document.createElement("script");s.src=n+"?ui=cf1dd21672863b5d",s.onload=e,s.onerror=()=>t(new Error("Could not load "+n)),document.head.append(s)});await window.ZhaoVue.boot()}const _M=["data-page"],zM={key:0,class:"alert alert-danger",role:"alert"},jM={__name:"App",setup(n){const e=P(!1);return $i(async()=>{try{await BM()}catch(t){console.error("Application startup failed",t),e.value=!0}}),(t,s)=>(y(),x(H,null,[G(ep),a("main",{"data-page":j(R).page},[G(sp),e.value?(y(),x("div",zM,"页面组件加载失败,请检查网络后重新打开页面。")):D("",!0),G(DM)],8,_M),G(LM)],64))}};zu(jM).mount("#app"); diff --git a/web/ui/assets/map-CT6w3aO1.js b/web/ui/assets/map-qt6gqu0E.js similarity index 90% rename from web/ui/assets/map-CT6w3aO1.js rename to web/ui/assets/map-qt6gqu0E.js index 9ccff1f..18f3ea3 100644 --- a/web/ui/assets/map-CT6w3aO1.js +++ b/web/ui/assets/map-qt6gqu0E.js @@ -1 +1 @@ -import"./modulepreload-polyfill-B5Qt9EMX.js";import{createFamilyMap as n}from"./controller-Je5cOZA3.js";const e=n(document.getElementById("map"),{onStatus:t=>document.getElementById("status").textContent=t});window.ZhaoMap={setItems:t=>e.setItems(t),setTrack:t=>e.setTrack(t),focus:t=>e.focus(t),fit:()=>e.fit(),setNight:t=>{document.documentElement.dataset.theme=t?"night":"day",e.setNight(t)}};document.addEventListener("visibilitychange",()=>{document.hidden&&(e.setItems([]),e.setTrack([]))});window.addEventListener("pagehide",()=>e.setItems([]));const s=()=>window.ZhaoMap.setNight(new Date().getHours()>=20||new Date().getHours()<7);s();setInterval(s,6e4); +import"./modulepreload-polyfill-B5Qt9EMX.js";import{createFamilyMap as n}from"./controller-NWgljfVQ.js";const e=n(document.getElementById("map"),{onStatus:t=>document.getElementById("status").textContent=t});window.ZhaoMap={setItems:t=>e.setItems(t),setTrack:t=>e.setTrack(t),focus:t=>e.focus(t),fit:()=>e.fit(),setNight:t=>{document.documentElement.dataset.theme=t?"night":"day",e.setNight(t)}};document.addEventListener("visibilitychange",()=>{document.hidden&&(e.setItems([]),e.setTrack([]))});window.addEventListener("pagehide",()=>e.setItems([]));const s=()=>window.ZhaoMap.setNight(new Date().getHours()>=20||new Date().getHours()<7);s();setInterval(s,6e4); diff --git a/web/ui/assets/tv-BLhSIH0H.js b/web/ui/assets/tv-Dxkdq4LJ.js similarity index 99% rename from web/ui/assets/tv-BLhSIH0H.js rename to web/ui/assets/tv-Dxkdq4LJ.js index aad672c..c85a7fd 100644 --- a/web/ui/assets/tv-BLhSIH0H.js +++ b/web/ui/assets/tv-Dxkdq4LJ.js @@ -1 +1 @@ -import"./modulepreload-polyfill-B5Qt9EMX.js";import{w as ve,f as de,g as he,o as i,c,a as e,e as B,t as n,u as V,h as _,F as U,j as R,i as me,B as ye,k as Y,l as C,r as S,n as ie,K as ge}from"./FamilyMap-CoPJzTbz.js";function pe(v){const r=Object.fromEntries(new Intl.DateTimeFormat("en-GB",{timeZone:"Asia/Shanghai",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}).formatToParts(v).map(k=>[k.type,k.value])),h=new Date(Date.UTC(+r.year,+r.month-1,+r.day)),m=h.getUTCDay(),g=new Date(h);g.setUTCDate(h.getUTCDate()+4-(m||7));const T=new Date(Date.UTC(g.getUTCFullYear(),0,1));return{...r,weekday:"星期"+"日一二三四五六"[m],week:Math.ceil(((g-T)/864e5+1)/7),weekYear:g.getUTCFullYear(),date:`${r.year}-${r.month}-${r.day}`}}const ue=v=>v===0?"晴":v<=3?"多云":v<=48?"有雾":v<=67?"有雨":v<=77?"有雪":v<=82?"阵雨":v<=86?"阵雪":v>=95?"雷雨":"天气更新中",j="zhao.display",Z=v=>typeof v=="string"&&/^[A-Za-z0-9_-]{43}$/.test(v);function fe({fetcher:v=fetch,storage:r=localStorage,url:h=location,historyApi:m=history,onChange:g,later:T=setTimeout,cancel:k=clearTimeout,now:P=Date.now}={}){let d="",D=0,$,w,p=!1,f=0,o={data:null,error:"",authRequired:!1,loading:!1,lastSync:0};const b=l=>{o={...o,...l},g({...o})},L=()=>{try{return r.getItem(j)||""}catch(l){return""}},I=l=>{try{l?r.setItem(j,l):r.removeItem(j)}catch(M){}};function N(){D++,k($),w==null||w.abort()}function x(l){if(!p&&(N(),d=Z(l)?l:"",I(d),f=0,b({data:null,lastSync:0,error:d?"":"请在家庭的显示终端管理中获取配对码,完成绑定。",authRequired:!d,loading:!!d}),d))return E()}function F(){const l=new URLSearchParams(h.hash.slice(1));if(!l.has("display"))return!1;const M=l.get("display");l.delete("display");try{m.replaceState(null,"",h.pathname+h.search+(l.toString()?"#"+l.toString():""))}catch(u){}return x(M),!0}async function E(){if(p||!d)return;k($);const l=++D,M=d;w==null||w.abort();const u=new AbortController;w=u;const O=T(()=>u.abort(),12e3);b({loading:!0});try{const y=await v("/api/display/snapshot",{headers:{Authorization:"Bearer "+M},signal:u.signal,cache:"no-store"}),A=await y.json();if(p||l!==D)return;if(y.status===401||y.status===403){const q=L();if(Z(q)&&q!==M){x(q);return}d="",I(""),b({data:null,lastSync:0,error:A.error||"展示授权已失效,请重新连接显示终端。",authRequired:!0});return}if(!y.ok)throw Error(A.error||"暂时无法同步家庭资料");f=0,b({data:A,error:"",authRequired:!1,lastSync:P()})}catch(y){!p&&l===D&&(f++,b({error:y.name==="AbortError"?"家庭连接暂时超时":y.message||"家庭连接暂时中断"}))}finally{k(O),!p&&l===D&&(b({loading:!1}),d&&($=T(E,Math.min(12e4,3e4*Math.max(1,f)))))}}return{start(){if(!F())return x(L())},hashChanged:F,storageChanged(l){if(l.key===j||l.key===null)return x(L())},retry(){if(F())return;const l=L();return Z(l)&&l!==d?x(l):d?E():x("")},stop(){p=!0,N()}}}const _e={class:"tv-shell"},ke={class:"tv-top"},we={key:0,class:"tv-reconnect",role:"alert"},be=["disabled"],xe={class:"tv-upper"},Ce={class:"square-clock","aria-label":"北京时间时钟"},Te=["aria-label"],De=["transform"],Se=["y1","y2"],Ee=["x","y"],Le=["transform"],Me=["transform"],$e=["transform"],Fe={x:"220",y:"303",class:"digital-time"},qe={class:"tv-home"},Ie={class:"tv-greeting"},Ae={class:"tv-date"},ze={class:"tv-date-extra"},Be={key:0},Ue={class:"tv-weather tv-card","aria-label":"天气"},Re={class:"weather-current"},Pe={class:"section-label"},Ne={class:"weather-big"},Ye={class:"weather-symbol"},je={key:0},Oe={class:"weather-note"},Ve={key:0,class:"weather-forecast"},Ze={class:"tv-bottom"},Ge={class:"tv-card tv-devices"},Ke={class:"tv-section-heading"},He={class:"tv-device-grid"},Je={class:"device-emblem"},Qe={key:0,class:"tv-empty"},We={key:0,class:"tv-page-count"},Xe={class:"tv-family-presence tv-card"},et={key:0},tt={key:2,class:"tv-positions"},at={key:0},st={key:0},nt={class:"tv-footer"},lt={key:0,class:"sync-error"},ot={__name:"Television",setup(v){const r=S(null),h=S(Date.now()),m=S(""),g=S(0),T=S(0),k=S(0),P=S(!1),d=S(!1),D=S(!1);let $,w,p;const f=fe({onChange:a=>{if(r.value=a.data,m.value=a.error,g.value=a.lastSync,d.value=a.authRequired,D.value=a.loading,a.data){const t=new Date(a.data.serverTime).getTime();Number.isFinite(t)&&(k.value=t-a.lastSync)}}}),o=C(()=>pe(new Date(h.value+k.value))),b=C(()=>+o.value.hour>=20||+o.value.hour<7),L=a=>(b.value?["#978469","#739486","#8299aa","#ab8278"]:["#ee8a25","#148a7e","#2585cb","#d44e6b"])[a%4];ve(b,a=>document.documentElement.dataset.theme=a?"night":"day",{immediate:!0});const I=C(()=>{try{return new Intl.DateTimeFormat("zh-CN-u-ca-chinese",{timeZone:"Asia/Shanghai",month:"long",day:"numeric"}).format(new Date(h.value+k.value))}catch(a){return""}}),N=C(()=>+o.value.hour<6?"夜深了,愿你好梦":+o.value.hour<11?"早安,新的一天":+o.value.hour<14?"午安,慢慢生活":+o.value.hour<18?"午后,家有暖意":"晚安时光,灯火可亲"),x=C(()=>({hour:+o.value.hour%12*30+ +o.value.minute/2,minute:+o.value.minute*6,second:+o.value.second*6})),F=C(()=>{var z;const a=((z=r.value)==null?void 0:z.devices)||[],t=T.value%Math.max(1,Math.ceil(a.length/3))*3;return a.slice(t,t+3)}),E=C(()=>{var t;if(h.value-g.value>9e4||m.value)return[];const a=((t=r.value)==null?void 0:t.locations)||[];return a.slice(T.value%Math.max(1,Math.ceil(a.length/3))*3,T.value%Math.max(1,Math.ceil(a.length/3))*3+3)}),l=C(()=>{var a;return h.value-g.value>9e4||m.value?[]:((a=r.value)==null?void 0:a.locations)||[]}),M=a=>a.status==="stale"?"位置更新中断 · 请检查手机":a.position?`${a.position.latitude.toFixed(3)}°, ${a.position.longitude.toFixed(3)}°`:"等待手机定位",u=C(()=>{var a;return(a=r.value)==null?void 0:a.weather}),O=C(()=>d.value?"等待重新连接":g.value?m.value||h.value-g.value>9e4?"网络暂时中断 · 显示上次资料":"家庭资料已同步":"正在连接家庭"),y=a=>typeof a=="number"?Math.round(a):"—";async function A(){try{document.fullscreenElement?await document.exitFullscreen():await document.documentElement.requestFullscreen(),P.value=!!document.fullscreenElement,navigator.wakeLock&&(p=await navigator.wakeLock.request("screen"))}catch(a){}}const q=()=>{!document.hidden&&navigator.wakeLock&&navigator.wakeLock.request("screen").then(a=>p=a).catch(()=>{})};return de(()=>{f.start(),$=setInterval(()=>h.value=Date.now(),1e3),w=setInterval(()=>T.value++,15e3),document.addEventListener("visibilitychange",q),window.addEventListener("hashchange",f.hashChanged),window.addEventListener("storage",f.storageChanged)}),he(()=>{f.stop(),clearInterval($),clearInterval(w),p==null||p.release(),document.removeEventListener("visibilitychange",q),window.removeEventListener("hashchange",f.hashChanged),window.removeEventListener("storage",f.storageChanged)}),(a,t)=>{var z,G,K,H,J,Q,W,X,ee,te,ae,se,ne,le,oe,re;return i(),c("div",_e,[e("header",ke,[t[1]||(t[1]=e("span",{class:"tv-brand"},[e("img",{src:"/zhao-icon.png",alt:"赵"}),B("赵府 "),e("span",null,"家庭时光")],-1)),e("button",{class:"tv-fullscreen",onClick:A,"aria-label":"切换全屏"},n(P.value?"退出全屏":"全屏展示")+" ⛶",1)]),d.value?(i(),c("section",we,[t[2]||(t[2]=e("strong",null,"显示终端需要重新连接",-1)),e("p",null,n(m.value),1),t[3]||(t[3]=e("p",null,"若刚完成配对,请退出并重新打开 App。需要更换配对时,点击下方「绑定家庭」,输入管理员生成的 8 位显示终端配对码。",-1)),e("button",{onClick:t[0]||(t[0]=s=>V(f).retry()),disabled:D.value},n(D.value?"正在连接…":"重试连接"),9,be)])):_("",!0),e("div",xe,[e("section",Ce,[(i(),c("svg",{viewBox:"0 0 440 440",role:"img","aria-label":`${o.value.hour}:${o.value.minute}:${o.value.second}`},[(i(),c(U,null,R(60,s=>e("g",{key:s,transform:`rotate(${s*6} 220 220)`},[e("line",{x1:"220",y1:s%5===0?29:32,x2:"220",y2:s%5===0?46:39,style:ie(s%5===0?{stroke:L(s/5)}:{}),class:Y(s%5===0?"hour-mark":"minute-mark")},null,14,Se)],8,De)),64)),(i(),c(U,null,R(12,s=>e("text",{key:"n"+s,x:220+148*Math.sin(s*Math.PI/6),y:220-148*Math.cos(s*Math.PI/6)+10,style:ie({fill:L(s)}),class:"clock-number"},n(s),13,Ee)),64)),t[4]||(t[4]=e("text",{x:"220",y:"140",class:"clock-word"},"家 · 在 此 刻",-1)),e("line",{x1:"220",y1:"231",x2:"220",y2:"127",class:"clock-hour",transform:`rotate(${x.value.hour} 220 220)`},null,8,Le),e("line",{x1:"220",y1:"234",x2:"220",y2:"91",class:"clock-minute",transform:`rotate(${x.value.minute} 220 220)`},null,8,Me),e("line",{x1:"220",y1:"247",x2:"220",y2:"65",class:"clock-second",transform:`rotate(${x.value.second} 220 220)`},null,8,$e),t[5]||(t[5]=e("circle",{cx:"220",cy:"220",r:"8",fill:"#a66645"},null,-1)),t[6]||(t[6]=e("circle",{cx:"220",cy:"220",r:"3",fill:"#fffaf0"},null,-1)),e("text",Fe,n(o.value.hour)+":"+n(o.value.minute),1),t[7]||(t[7]=e("text",{x:"220",y:"329",class:"clock-zone"},"北京时间",-1))],8,Te))]),e("section",qe,[e("div",Ie,n(N.value),1),e("h1",null,n(((z=r.value)==null?void 0:z.home.name)||"欢迎回家"),1),e("div",Ae,[B(n(o.value.year)+" 年 "+n(+o.value.month)+" 月 "+n(+o.value.day)+" 日 ",1),e("b",null,n(o.value.weekday),1)]),e("div",ze,[I.value?(i(),c("span",Be,"农历 "+n(I.value),1)):_("",!0),e("span",null,n(o.value.weekYear)+" 年 · 第 "+n(o.value.week)+" 周",1)])])]),e("section",Ue,[e("div",Re,[e("div",Pe,n(((G=u.value)==null?void 0:G.city)||((K=r.value)==null?void 0:K.home.city)||"本地")+" · 天气",1),e("div",Ne,[e("span",Ye,n((H=u.value)!=null&&H.available&&u.value.current.weather_code<3?"☀":"☁"),1),e("strong",null,[B(n((J=u.value)!=null&&J.available?y(u.value.current.temperature_2m):"—"),1),t[8]||(t[8]=e("small",null,"°",-1))]),e("div",null,[e("b",null,n((Q=u.value)!=null&&Q.available?V(ue)(u.value.current.weather_code):"天气更新中"),1),(W=u.value)!=null&&W.available?(i(),c("span",je,"体感 "+n(y(u.value.current.apparent_temperature))+"° · 湿度 "+n(y(u.value.current.relative_humidity_2m))+"%",1)):_("",!0)])]),e("div",Oe,n((X=u.value)!=null&&X.stale?"上次天气 · 待更新":(ee=u.value)!=null&&ee.available?"室外天气 · "+(u.value.current.time||"").slice(11,16)+" 更新":((te=u.value)==null?void 0:te.message)||"正在连接天气服务"),1)]),(ae=u.value)!=null&&ae.available?(i(),c("div",Ve,[(i(!0),c(U,null,R(u.value.days,(s,ce)=>(i(),c("div",{key:s.date},[e("span",null,n(["今天","明天","后天"][ce]),1),e("b",null,n(V(ue)(s.code)),1),e("span",null,n(y(s.low))+"° / "+n(y(s.high))+"°",1)]))),128))])):_("",!0)]),e("div",Ze,[e("section",Ge,[e("div",Ke,[t[9]||(t[9]=e("h2",null,"家中设备",-1)),e("span",null,n((ne=(se=r.value)==null?void 0:se.home.deviceCount)!=null?ne:"—")+" 台 · "+n((oe=(le=r.value)==null?void 0:le.home.spaces)!=null?oe:"—")+" 处区域",1)]),e("div",He,[(i(!0),c(U,null,R(F.value,s=>(i(),c("article",{key:s.id,class:"tv-device"},[e("div",Je,n(/电视|显示/.test(s.type)?"▣":/摄像/.test(s.type)?"◉":/路由|网关/.test(s.type)?"⌁":"◇"),1),e("div",null,[e("h3",null,n(s.name),1),e("p",null,n(s.location),1),e("span",{class:Y(["tv-status",s.status])},[t[10]||(t[10]=e("i",null,null,-1)),B(n(s.statusLabel),1)],2)])]))),128)),F.value.length?_("",!0):(i(),c("div",Qe,"设备接入后,会在这里与你见面。"))]),(((re=r.value)==null?void 0:re.devices.length)||0)>3?(i(),c("div",We,"设备分组自动轮换 · 每 15 秒")):_("",!0)]),e("section",Xe,[e("div",null,[t[11]||(t[11]=e("h2",null,"家人位置",-1)),E.value.length?_("",!0):(i(),c("p",et,"等待家人主动开启位置共享")),l.value.some(s=>s.position)?(i(),me(ye,{key:1,items:l.value,night:b.value,height:220},null,8,["items","night"])):_("",!0),E.value.length?(i(),c("div",tt,[(i(!0),c(U,null,R(E.value,s=>(i(),c("div",{key:s.id},[e("b",null,n(s.name),1),e("span",{class:Y({warning:s.status==="stale"})},n(M(s)),3),s.position?(i(),c("small",at,n(new Date(s.position.at*1e3).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}))+" 更新",1)):_("",!0)]))),128))])):_("",!0)]),E.value.length?_("",!0):(i(),c("span",st,"暂无共享位置"))])]),e("footer",nt,[e("span",{class:Y({warning:!!m.value})},[t[12]||(t[12]=e("i",null,null,-1)),B(n(O.value),1)],2),m.value?(i(),c("span",lt,n(m.value),1)):_("",!0),t[13]||(t[13]=e("span",null,"愿每个平常日,都有家的温度",-1)),t[14]||(t[14]=e("a",{href:"https://open-meteo.com/",target:"_blank",rel:"noreferrer"},"天气 Open-Meteo",-1))])])}}};ge(ot).mount("#app"); +import"./modulepreload-polyfill-B5Qt9EMX.js";import{w as ve,f as de,g as he,o as i,c,a as e,e as B,t as n,u as V,h as _,F as U,j as R,i as me,B as ye,k as Y,l as C,r as S,n as ie,K as ge}from"./FamilyMap-CiWCoS6Z.js";function pe(v){const r=Object.fromEntries(new Intl.DateTimeFormat("en-GB",{timeZone:"Asia/Shanghai",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}).formatToParts(v).map(k=>[k.type,k.value])),h=new Date(Date.UTC(+r.year,+r.month-1,+r.day)),m=h.getUTCDay(),g=new Date(h);g.setUTCDate(h.getUTCDate()+4-(m||7));const T=new Date(Date.UTC(g.getUTCFullYear(),0,1));return{...r,weekday:"星期"+"日一二三四五六"[m],week:Math.ceil(((g-T)/864e5+1)/7),weekYear:g.getUTCFullYear(),date:`${r.year}-${r.month}-${r.day}`}}const ue=v=>v===0?"晴":v<=3?"多云":v<=48?"有雾":v<=67?"有雨":v<=77?"有雪":v<=82?"阵雨":v<=86?"阵雪":v>=95?"雷雨":"天气更新中",j="zhao.display",Z=v=>typeof v=="string"&&/^[A-Za-z0-9_-]{43}$/.test(v);function fe({fetcher:v=fetch,storage:r=localStorage,url:h=location,historyApi:m=history,onChange:g,later:T=setTimeout,cancel:k=clearTimeout,now:P=Date.now}={}){let d="",D=0,$,w,p=!1,f=0,o={data:null,error:"",authRequired:!1,loading:!1,lastSync:0};const b=l=>{o={...o,...l},g({...o})},L=()=>{try{return r.getItem(j)||""}catch(l){return""}},I=l=>{try{l?r.setItem(j,l):r.removeItem(j)}catch(M){}};function N(){D++,k($),w==null||w.abort()}function x(l){if(!p&&(N(),d=Z(l)?l:"",I(d),f=0,b({data:null,lastSync:0,error:d?"":"请在家庭的显示终端管理中获取配对码,完成绑定。",authRequired:!d,loading:!!d}),d))return E()}function F(){const l=new URLSearchParams(h.hash.slice(1));if(!l.has("display"))return!1;const M=l.get("display");l.delete("display");try{m.replaceState(null,"",h.pathname+h.search+(l.toString()?"#"+l.toString():""))}catch(u){}return x(M),!0}async function E(){if(p||!d)return;k($);const l=++D,M=d;w==null||w.abort();const u=new AbortController;w=u;const O=T(()=>u.abort(),12e3);b({loading:!0});try{const y=await v("/api/display/snapshot",{headers:{Authorization:"Bearer "+M},signal:u.signal,cache:"no-store"}),A=await y.json();if(p||l!==D)return;if(y.status===401||y.status===403){const q=L();if(Z(q)&&q!==M){x(q);return}d="",I(""),b({data:null,lastSync:0,error:A.error||"展示授权已失效,请重新连接显示终端。",authRequired:!0});return}if(!y.ok)throw Error(A.error||"暂时无法同步家庭资料");f=0,b({data:A,error:"",authRequired:!1,lastSync:P()})}catch(y){!p&&l===D&&(f++,b({error:y.name==="AbortError"?"家庭连接暂时超时":y.message||"家庭连接暂时中断"}))}finally{k(O),!p&&l===D&&(b({loading:!1}),d&&($=T(E,Math.min(12e4,3e4*Math.max(1,f)))))}}return{start(){if(!F())return x(L())},hashChanged:F,storageChanged(l){if(l.key===j||l.key===null)return x(L())},retry(){if(F())return;const l=L();return Z(l)&&l!==d?x(l):d?E():x("")},stop(){p=!0,N()}}}const _e={class:"tv-shell"},ke={class:"tv-top"},we={key:0,class:"tv-reconnect",role:"alert"},be=["disabled"],xe={class:"tv-upper"},Ce={class:"square-clock","aria-label":"北京时间时钟"},Te=["aria-label"],De=["transform"],Se=["y1","y2"],Ee=["x","y"],Le=["transform"],Me=["transform"],$e=["transform"],Fe={x:"220",y:"303",class:"digital-time"},qe={class:"tv-home"},Ie={class:"tv-greeting"},Ae={class:"tv-date"},ze={class:"tv-date-extra"},Be={key:0},Ue={class:"tv-weather tv-card","aria-label":"天气"},Re={class:"weather-current"},Pe={class:"section-label"},Ne={class:"weather-big"},Ye={class:"weather-symbol"},je={key:0},Oe={class:"weather-note"},Ve={key:0,class:"weather-forecast"},Ze={class:"tv-bottom"},Ge={class:"tv-card tv-devices"},Ke={class:"tv-section-heading"},He={class:"tv-device-grid"},Je={class:"device-emblem"},Qe={key:0,class:"tv-empty"},We={key:0,class:"tv-page-count"},Xe={class:"tv-family-presence tv-card"},et={key:0},tt={key:2,class:"tv-positions"},at={key:0},st={key:0},nt={class:"tv-footer"},lt={key:0,class:"sync-error"},ot={__name:"Television",setup(v){const r=S(null),h=S(Date.now()),m=S(""),g=S(0),T=S(0),k=S(0),P=S(!1),d=S(!1),D=S(!1);let $,w,p;const f=fe({onChange:a=>{if(r.value=a.data,m.value=a.error,g.value=a.lastSync,d.value=a.authRequired,D.value=a.loading,a.data){const t=new Date(a.data.serverTime).getTime();Number.isFinite(t)&&(k.value=t-a.lastSync)}}}),o=C(()=>pe(new Date(h.value+k.value))),b=C(()=>+o.value.hour>=20||+o.value.hour<7),L=a=>(b.value?["#978469","#739486","#8299aa","#ab8278"]:["#ee8a25","#148a7e","#2585cb","#d44e6b"])[a%4];ve(b,a=>document.documentElement.dataset.theme=a?"night":"day",{immediate:!0});const I=C(()=>{try{return new Intl.DateTimeFormat("zh-CN-u-ca-chinese",{timeZone:"Asia/Shanghai",month:"long",day:"numeric"}).format(new Date(h.value+k.value))}catch(a){return""}}),N=C(()=>+o.value.hour<6?"夜深了,愿你好梦":+o.value.hour<11?"早安,新的一天":+o.value.hour<14?"午安,慢慢生活":+o.value.hour<18?"午后,家有暖意":"晚安时光,灯火可亲"),x=C(()=>({hour:+o.value.hour%12*30+ +o.value.minute/2,minute:+o.value.minute*6,second:+o.value.second*6})),F=C(()=>{var z;const a=((z=r.value)==null?void 0:z.devices)||[],t=T.value%Math.max(1,Math.ceil(a.length/3))*3;return a.slice(t,t+3)}),E=C(()=>{var t;if(h.value-g.value>9e4||m.value)return[];const a=((t=r.value)==null?void 0:t.locations)||[];return a.slice(T.value%Math.max(1,Math.ceil(a.length/3))*3,T.value%Math.max(1,Math.ceil(a.length/3))*3+3)}),l=C(()=>{var a;return h.value-g.value>9e4||m.value?[]:((a=r.value)==null?void 0:a.locations)||[]}),M=a=>a.status==="stale"?"位置更新中断 · 请检查手机":a.position?`${a.position.latitude.toFixed(3)}°, ${a.position.longitude.toFixed(3)}°`:"等待手机定位",u=C(()=>{var a;return(a=r.value)==null?void 0:a.weather}),O=C(()=>d.value?"等待重新连接":g.value?m.value||h.value-g.value>9e4?"网络暂时中断 · 显示上次资料":"家庭资料已同步":"正在连接家庭"),y=a=>typeof a=="number"?Math.round(a):"—";async function A(){try{document.fullscreenElement?await document.exitFullscreen():await document.documentElement.requestFullscreen(),P.value=!!document.fullscreenElement,navigator.wakeLock&&(p=await navigator.wakeLock.request("screen"))}catch(a){}}const q=()=>{!document.hidden&&navigator.wakeLock&&navigator.wakeLock.request("screen").then(a=>p=a).catch(()=>{})};return de(()=>{f.start(),$=setInterval(()=>h.value=Date.now(),1e3),w=setInterval(()=>T.value++,15e3),document.addEventListener("visibilitychange",q),window.addEventListener("hashchange",f.hashChanged),window.addEventListener("storage",f.storageChanged)}),he(()=>{f.stop(),clearInterval($),clearInterval(w),p==null||p.release(),document.removeEventListener("visibilitychange",q),window.removeEventListener("hashchange",f.hashChanged),window.removeEventListener("storage",f.storageChanged)}),(a,t)=>{var z,G,K,H,J,Q,W,X,ee,te,ae,se,ne,le,oe,re;return i(),c("div",_e,[e("header",ke,[t[1]||(t[1]=e("span",{class:"tv-brand"},[e("img",{src:"/zhao-icon.png",alt:"赵"}),B("赵府 "),e("span",null,"家庭时光")],-1)),e("button",{class:"tv-fullscreen",onClick:A,"aria-label":"切换全屏"},n(P.value?"退出全屏":"全屏展示")+" ⛶",1)]),d.value?(i(),c("section",we,[t[2]||(t[2]=e("strong",null,"显示终端需要重新连接",-1)),e("p",null,n(m.value),1),t[3]||(t[3]=e("p",null,"若刚完成配对,请退出并重新打开 App。需要更换配对时,点击下方「绑定家庭」,输入管理员生成的 8 位显示终端配对码。",-1)),e("button",{onClick:t[0]||(t[0]=s=>V(f).retry()),disabled:D.value},n(D.value?"正在连接…":"重试连接"),9,be)])):_("",!0),e("div",xe,[e("section",Ce,[(i(),c("svg",{viewBox:"0 0 440 440",role:"img","aria-label":`${o.value.hour}:${o.value.minute}:${o.value.second}`},[(i(),c(U,null,R(60,s=>e("g",{key:s,transform:`rotate(${s*6} 220 220)`},[e("line",{x1:"220",y1:s%5===0?29:32,x2:"220",y2:s%5===0?46:39,style:ie(s%5===0?{stroke:L(s/5)}:{}),class:Y(s%5===0?"hour-mark":"minute-mark")},null,14,Se)],8,De)),64)),(i(),c(U,null,R(12,s=>e("text",{key:"n"+s,x:220+148*Math.sin(s*Math.PI/6),y:220-148*Math.cos(s*Math.PI/6)+10,style:ie({fill:L(s)}),class:"clock-number"},n(s),13,Ee)),64)),t[4]||(t[4]=e("text",{x:"220",y:"140",class:"clock-word"},"家 · 在 此 刻",-1)),e("line",{x1:"220",y1:"231",x2:"220",y2:"127",class:"clock-hour",transform:`rotate(${x.value.hour} 220 220)`},null,8,Le),e("line",{x1:"220",y1:"234",x2:"220",y2:"91",class:"clock-minute",transform:`rotate(${x.value.minute} 220 220)`},null,8,Me),e("line",{x1:"220",y1:"247",x2:"220",y2:"65",class:"clock-second",transform:`rotate(${x.value.second} 220 220)`},null,8,$e),t[5]||(t[5]=e("circle",{cx:"220",cy:"220",r:"8",fill:"#a66645"},null,-1)),t[6]||(t[6]=e("circle",{cx:"220",cy:"220",r:"3",fill:"#fffaf0"},null,-1)),e("text",Fe,n(o.value.hour)+":"+n(o.value.minute),1),t[7]||(t[7]=e("text",{x:"220",y:"329",class:"clock-zone"},"北京时间",-1))],8,Te))]),e("section",qe,[e("div",Ie,n(N.value),1),e("h1",null,n(((z=r.value)==null?void 0:z.home.name)||"欢迎回家"),1),e("div",Ae,[B(n(o.value.year)+" 年 "+n(+o.value.month)+" 月 "+n(+o.value.day)+" 日 ",1),e("b",null,n(o.value.weekday),1)]),e("div",ze,[I.value?(i(),c("span",Be,"农历 "+n(I.value),1)):_("",!0),e("span",null,n(o.value.weekYear)+" 年 · 第 "+n(o.value.week)+" 周",1)])])]),e("section",Ue,[e("div",Re,[e("div",Pe,n(((G=u.value)==null?void 0:G.city)||((K=r.value)==null?void 0:K.home.city)||"本地")+" · 天气",1),e("div",Ne,[e("span",Ye,n((H=u.value)!=null&&H.available&&u.value.current.weather_code<3?"☀":"☁"),1),e("strong",null,[B(n((J=u.value)!=null&&J.available?y(u.value.current.temperature_2m):"—"),1),t[8]||(t[8]=e("small",null,"°",-1))]),e("div",null,[e("b",null,n((Q=u.value)!=null&&Q.available?V(ue)(u.value.current.weather_code):"天气更新中"),1),(W=u.value)!=null&&W.available?(i(),c("span",je,"体感 "+n(y(u.value.current.apparent_temperature))+"° · 湿度 "+n(y(u.value.current.relative_humidity_2m))+"%",1)):_("",!0)])]),e("div",Oe,n((X=u.value)!=null&&X.stale?"上次天气 · 待更新":(ee=u.value)!=null&&ee.available?"室外天气 · "+(u.value.current.time||"").slice(11,16)+" 更新":((te=u.value)==null?void 0:te.message)||"正在连接天气服务"),1)]),(ae=u.value)!=null&&ae.available?(i(),c("div",Ve,[(i(!0),c(U,null,R(u.value.days,(s,ce)=>(i(),c("div",{key:s.date},[e("span",null,n(["今天","明天","后天"][ce]),1),e("b",null,n(V(ue)(s.code)),1),e("span",null,n(y(s.low))+"° / "+n(y(s.high))+"°",1)]))),128))])):_("",!0)]),e("div",Ze,[e("section",Ge,[e("div",Ke,[t[9]||(t[9]=e("h2",null,"家中设备",-1)),e("span",null,n((ne=(se=r.value)==null?void 0:se.home.deviceCount)!=null?ne:"—")+" 台 · "+n((oe=(le=r.value)==null?void 0:le.home.spaces)!=null?oe:"—")+" 处区域",1)]),e("div",He,[(i(!0),c(U,null,R(F.value,s=>(i(),c("article",{key:s.id,class:"tv-device"},[e("div",Je,n(/电视|显示/.test(s.type)?"▣":/摄像/.test(s.type)?"◉":/路由|网关/.test(s.type)?"⌁":"◇"),1),e("div",null,[e("h3",null,n(s.name),1),e("p",null,n(s.location),1),e("span",{class:Y(["tv-status",s.status])},[t[10]||(t[10]=e("i",null,null,-1)),B(n(s.statusLabel),1)],2)])]))),128)),F.value.length?_("",!0):(i(),c("div",Qe,"设备接入后,会在这里与你见面。"))]),(((re=r.value)==null?void 0:re.devices.length)||0)>3?(i(),c("div",We,"设备分组自动轮换 · 每 15 秒")):_("",!0)]),e("section",Xe,[e("div",null,[t[11]||(t[11]=e("h2",null,"家人位置",-1)),E.value.length?_("",!0):(i(),c("p",et,"等待家人主动开启位置共享")),l.value.some(s=>s.position)?(i(),me(ye,{key:1,items:l.value,night:b.value,height:220},null,8,["items","night"])):_("",!0),E.value.length?(i(),c("div",tt,[(i(!0),c(U,null,R(E.value,s=>(i(),c("div",{key:s.id},[e("b",null,n(s.name),1),e("span",{class:Y({warning:s.status==="stale"})},n(M(s)),3),s.position?(i(),c("small",at,n(new Date(s.position.at*1e3).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}))+" 更新",1)):_("",!0)]))),128))])):_("",!0)]),E.value.length?_("",!0):(i(),c("span",st,"暂无共享位置"))])]),e("footer",nt,[e("span",{class:Y({warning:!!m.value})},[t[12]||(t[12]=e("i",null,null,-1)),B(n(O.value),1)],2),m.value?(i(),c("span",lt,n(m.value),1)):_("",!0),t[13]||(t[13]=e("span",null,"愿每个平常日,都有家的温度",-1)),t[14]||(t[14]=e("a",{href:"https://open-meteo.com/",target:"_blank",rel:"noreferrer"},"天气 Open-Meteo",-1))])])}}};ge(ot).mount("#app"); diff --git a/web/ui/index.html b/web/ui/index.html index 65010a8..3e1b774 100644 --- a/web/ui/index.html +++ b/web/ui/index.html @@ -1,6 +1,6 @@ -赵府 · 智能数字管家 +赵府 · 智能数字管家 - + - +
diff --git a/web/ui/map.html b/web/ui/map.html index c9a5145..2037cb3 100644 --- a/web/ui/map.html +++ b/web/ui/map.html @@ -1,6 +1,6 @@ -家人位置地图 +家人位置地图 - - + +
正在加载内置地图…
diff --git a/web/ui/tv.html b/web/ui/tv.html index 07ab6e7..e7b4fcd 100644 --- a/web/ui/tv.html +++ b/web/ui/tv.html @@ -1,6 +1,6 @@ -赵府 · 家庭时光 +赵府 · 家庭时光 - +