{s||=!!t.dynamicChildren;let{type:l,dynamicProps:u,props:d,patchFlag:f,shapeFlag:p,dirs:h,transition:g}=t,_=l===`input`||l===`option`,b=!!u;if(_||b||f!==-1){h&&hr(t,null,n,`created`);let l=!1;if(y(e)){l=Vo(null,g)&&n&&n.vnode.props&&n.vnode.props.appear;let r=e.content.firstChild;if(l){let e=r.getAttribute(`class`);e&&(r.$cls=e),g.beforeEnter(r)}v(r,e,n),t.el=e=r}if(p&16&&!(d&&(d.innerHTML||d.textContent))){let r=m(e.firstChild,t,e,n,i,o,s);for(r&&!Si(e,1)&&fi();r;){let e=r;r=r.nextSibling,c(e)}}else if(p&8){let n=t.children;n[0]===`
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
`)&&(Si(e,0)||fi(),e.textContent=t.children)}if(d){if(_||b||!s||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let o in d)if(_&&(o.endsWith(`value`)||o===`indeterminate`)||a(o)&&!E(o)||o[0]===`.`||t&&!E(o)||u&&u.includes(o)){if(yi(e,o,d[o]))continue;r(e,o,null,d[o],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&Qt(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Ms(x,n,t),h&&hr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&rs(()=>{x&&Ms(x,n,t),l&&g.enter(e),h&&hr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,a,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=s(e),f=m(o(e),t,d,n,r,i,a);return f&&gi(f)&&f.data===`]`?o(t.anchor=f):(fi(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,a,l)=>{if(wi(e,t)||fi(),t.el=null,l){let t=_(e);for(;;){let n=o(e);if(n&&n!==t)c(n);else break}}let u=o(e),d=s(e);return c(e),n(null,t,d,u,r,i,hi(d),a),r&&(r.vnode.el=t.el,_o(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=o(e),e&&gi(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return o(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var vi=new Set([`src`,`srcset`,`href`,`poster`]);function yi(e,t,n){return vi.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var bi=`data-allow-mismatch`,xi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function Si(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(bi);)e=e.parentElement;return Ci(e&&e.getAttribute(bi),t)}function Ci(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(xi[t])}}function wi(e,t){return Si(e.parentElement,1)||Ti(e)||Ei(t)}function Ti(e){return e.nodeType===1&&Ci(e.getAttribute(bi),1)}function Ei({props:e}){let t=e&&e[bi];return typeof t==`string`&&Ci(t,1)}var Di=ce().requestIdleCallback||(e=>setTimeout(e,1)),Oi=ce().cancelIdleCallback||(e=>clearTimeout(e)),ki=(e=1e4)=>t=>{let n=Di(t,{timeout:e});return()=>Oi(n)};function Ai(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t0&&r 0&&n0&&i(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Ai(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Mi=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Ni=(e=[])=>(t,n)=>{_(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Pi(e,t){if(gi(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(gi(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Fi=e=>!!e.type.__asyncLoader;function Ii(e){g(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return ri({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Pi(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=U;if(ai(e),u)return()=>Li(u,e);let t=t=>{l=null,Vn(t,e,13,!r)};if(s&&e.suspense||Hs)return p().then(t=>()=>Li(t,e)).catch(e=>(t(e),()=>r?H(r,{error:e}):null));let a=on(!1),c=on(),d=on(!!i),f,m;return ea(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Ri(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Li(u,e);if(c.value&&r)return H(r,{error:c.value});if(n&&!d.value)return Li(n,e)}}})}function Li(e,t){let{ref:n,props:r,children:i,ce:a}=t.vnode,o=H(e,r,i);return o.ref=n,o.ce=a,delete t.vnode.ce,o}var Ri=e=>e.type.__isKeepAlive,zi={name:`KeepAlive`,__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=Is(),r=n.ctx;if(!r.renderer)return()=>{let e=t.default&&t.default();return e&&e.length===1?e[0]:e};let i=new Map,a=new Set,o=null,s=n.suspense,{renderer:{p:c,m:l,um:u,o:{createElement:d}}}=r,f=d(`div`);r.activate=(e,t,n,r,i)=>{let a=e.component;l(e,t,n,0,s),c(a.vnode,e,t,n,a,s,r,e.slotScopeIds,i),R(()=>{a.isDeactivated=!1,a.a&&j(a.a);let t=e.props&&e.props.onVnodeMounted;t&&Ms(t,a.parent,e)},s)},r.deactivate=e=>{let t=e.component;Go(t.m),Go(t.a),l(e,f,null,1,s),R(()=>{t.da&&j(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&Ms(n,t.parent,e),t.isDeactivated=!0},s)};function p(e){Gi(e),u(e,n,s,!0)}function m(e){i.forEach((t,n)=>{let r=ec(Fi(t)?t.type.__asyncResolved||{}:t.type);r&&!e(r)&&h(n)})}function h(e){let t=i.get(e);t&&(!o||!_s(t,o))?p(t):o&&Gi(o),i.delete(e),a.delete(e)}wr(()=>[e.include,e.exclude],([e,t])=>{e&&m(t=>Bi(e,t)),t&&m(e=>!Bi(t,e))},{flush:`post`,deep:!0});let g=null,_=()=>{g!=null&&(qo(n.subTree.type)?R(()=>{let e=Ki(n.subTree);e.component&&i.set(g,e)},n.subTree.suspense):i.set(g,Ki(n.subTree)))};return Xi(_),Qi(_),$i(()=>{i.forEach(e=>{let{subTree:t,suspense:r}=n,i=Ki(t);if(e.type===i.type&&e.key===i.key){Gi(i);let e=i.component.da;e&&R(e,r);return}p(e)})}),()=>{if(g=null,!t.default)return o=null;let n=t.default(),r=n[0];if(n.length>1)return o=null,n;if(!gs(r)||!(r.shapeFlag&4)&&!(r.shapeFlag&128))return o=null,r;let s=Ki(r);if(s.type===B)return o=null,s;let c=s.type,l=ec(Fi(s)?s.type.__asyncResolved||{}:c),{include:u,exclude:d,max:f}=e;if(u&&(!l||!Bi(u,l))||d&&l&&Bi(d,l))return s.shapeFlag&=-257,o=s,r;let p=s.key==null?c:s.key,m=i.get(p);return s.el&&(s=ws(s),r.shapeFlag&128&&(r.ssContent=s)),g=p,m?(s.el=m.el,s.component=m.component,s.transition&&ti(s,s.transition),s.shapeFlag|=512,a.delete(p),a.add(p)):(a.add(p),f&&a.size>parseInt(f,10)&&h(a.values().next().value)),s.shapeFlag|=256,o=s,qo(r.type)?r:s}}};function Bi(e,t){return d(e)?e.some(e=>Bi(e,t)):_(e)?e.split(`,`).includes(t):h(e)?(e.lastIndex=0,e.test(t)):!1}function Vi(e,t){Ui(e,`a`,t)}function Hi(e,t){Ui(e,`da`,t)}function Ui(e,t,n=U){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(qi(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Ri(e.parent.vnode)&&Wi(r,t,n,e),e=e.parent}}function Wi(e,t,n,r){let i=qi(t,e,r,!0);ea(()=>{c(r[t],i)},n)}function Gi(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Ki(e){return e.shapeFlag&128?e.ssContent:e}function qi(e,t,n=U,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{$e();let i=zs(n),a=Bn(t,n,e,r);return i(),et(),a};return r?i.unshift(a):i.push(a),a}}var Ji=e=>(t,n=U)=>{(!Hs||e===`sp`)&&qi(e,(...e)=>t(...e),n)},Yi=Ji(`bm`),Xi=Ji(`m`),Zi=Ji(`bu`),Qi=Ji(`u`),$i=Ji(`bum`),ea=Ji(`um`),ta=Ji(`sp`),na=Ji(`rtg`),ra=Ji(`rtc`);function ia(e,t=U){qi(`ec`,e,t)}var aa=`components`,oa=`directives`;function sa(e,t){return da(aa,e,!0,t)||e}var ca=Symbol.for(`v-ndc`);function la(e){return _(e)?da(aa,e,!1)||e:e||ca}function ua(e){return da(oa,e)}function da(e,t,n=!0,r=!1){let i=L||U;if(i){let n=i.type;if(e===aa){let e=ec(n,!1);if(e&&(e===t||e===O(t)||e===ne(O(t))))return n}let a=fa(i[e]||n[e],t)||fa(i.appContext[e],t);return!a&&r?n:a}}function fa(e,t){return e&&(e[t]||e[O(t)]||e[ne(O(t))])}function pa(e,t,n,r){let i,a=n&&n[r],o=d(e);if(o||_(e)){let n=o&&Qt(e),r=!1,s=!1;n&&(r=!en(e),s=$t(e),e=pt(e)),i=Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function ha(e,t,n,r,i,a){if(n??={},L.ce||L.parent&&Fi(L.parent)&&L.parent.ce){let e=a!=null&&n.key==null?s({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),ls(),hs(z,null,[H(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let c=cs.length;ls();let l;try{let i=o&&ga(o(n)),s=n.key||a||i&&i.key;l=hs(z,{key:(s&&!v(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=cs.length;e>c;e--)us();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&l.scopeId&&(l.slotScopeIds=[l.scopeId+`-s`]),l}function ga(e){return e.some(e=>!gs(e)||!(e.type===B||e.type===z&&!ga(e.children)))?e:null}function _a(e,t){let n={};for(let r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:re(r)]=e[r];return n}var va=e=>e?Vs(e)?$s(e):va(e.parent):null,ya=s(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=>va(e.parent),$root:e=>va(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ua(e),$forceUpdate:e=>e.f||=()=>{Qn(e.update)},$nextTick:e=>e.n||=Xn.bind(e.proxy),$watch:e=>Er.bind(e)}),ba=(e,n)=>e!==t&&!e.__isScriptSetup&&u(e,n),xa={get({_:e},n){if(n===`__v_skip`)return!0;let{ctx:r,setupState:i,data:a,props:o,accessCache:s,type:c,appContext:l}=e;if(n[0]!==`$`){let e=s[n];if(e!==void 0)switch(e){case 1:return i[n];case 2:return a[n];case 4:return r[n];case 3:return o[n]}else if(ba(i,n))return s[n]=1,i[n];else if(a!==t&&u(a,n))return s[n]=2,a[n];else if(u(o,n))return s[n]=3,o[n];else if(r!==t&&u(r,n))return s[n]=4,r[n];else Ra&&(s[n]=0)}let d=ya[n],f,p;if(d)return n===`$attrs`&&P(e.attrs,`get`,``),d(e);if((f=c.__cssModules)&&(f=f[n]))return f;if(r!==t&&u(r,n))return s[n]=4,r[n];if(p=l.config.globalProperties,u(p,n))return p[n]},set({_:e},n,r){let{data:i,setupState:a,ctx:o}=e;return ba(a,n)?(a[n]=r,!0):i!==t&&u(i,n)?(i[n]=r,!0):u(e.props,n)||n[0]===`$`&&n.slice(1)in e?!1:(o[n]=r,!0)},has({_:{data:e,setupState:n,accessCache:r,ctx:i,appContext:a,props:o,type:s}},c){let l;return!!(r[c]||e!==t&&c[0]!==`$`&&u(e,c)||ba(n,c)||u(o,c)||u(i,c)||u(ya,c)||u(a.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?u(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}},Sa=s({},xa,{get(e,t){if(t!==Symbol.unscopables)return xa.get(e,t,e)},has(e,t){return t[0]!==`_`&&!le(t)}});function Ca(){return null}function wa(){return null}function Ta(e){}function Ea(e){}function Da(){return null}function Oa(){}function ka(e,t){return null}function Aa(){return Ma(`useSlots`).slots}function ja(){return Ma(`useAttrs`).attrs}function Ma(e){let t=Is();return t.setupContext||=Qs(t)}function Na(e){return d(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function Pa(e,t){let n=Na(e);for(let e in t){if(e.startsWith(`__skip`))continue;let r=n[e];r?d(r)||g(r)?r=n[e]={type:r,default:t[e]}:r.default=t[e]:r===null&&(r=n[e]={default:t[e]}),r&&t[`__skip_${e}`]&&(r.skipFactory=!0)}return n}function Fa(e,t){return!e||!t?e||t:d(e)&&d(t)?e.concat(t):s({},Na(e),Na(t))}function Ia(e,t){let n={};for(let r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n}function La(e){let t=Is(),n=Hs,r=e();Bs(),n&&Rs(!1);let i=()=>{zs(t),n&&Rs(!0)},a=()=>{Is()!==t&&t.scope.off(),Bs(),n&&Rs(!1)};return b(r)&&(r=r.catch(e=>{throw i(),Promise.resolve().then(()=>Promise.resolve().then(a)),e})),[r,()=>{i(),Promise.resolve().then(a)}]}var Ra=!0;function za(e){let t=Ua(e),n=e.proxy,i=e.ctx;Ra=!1,t.beforeCreate&&Va(t.beforeCreate,e,`bc`);let{data:a,computed:o,methods:s,watch:c,provide:l,inject:u,created:f,beforeMount:p,mounted:m,beforeUpdate:h,updated:_,activated:v,deactivated:b,beforeDestroy:x,beforeUnmount:S,destroyed:C,unmounted:w,render:T,renderTracked:E,renderTriggered:D,errorCaptured:ee,serverPrefetch:O,expose:te,inheritAttrs:k,components:ne,directives:re,filters:A}=t;if(u&&Ba(u,i,null),s)for(let e in s){let t=s[e];g(t)&&(i[e]=t.bind(n))}if(a){let t=a.call(n,n);y(t)&&(e.data=qt(t))}if(Ra=!0,o)for(let e in o){let t=o[e],a=W({get:g(t)?t.bind(n,n):g(t.get)?t.get.bind(n,n):r,set:!g(t)&&g(t.set)?t.set.bind(n):r});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(c)for(let e in c)Ha(c[e],i,n,e);if(l){let e=g(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{gr(t,e[t])})}f&&Va(f,e,`c`);function j(e,t){d(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(j(Yi,p),j(Xi,m),j(Zi,h),j(Qi,_),j(Vi,v),j(Hi,b),j(ia,ee),j(ra,E),j(na,D),j($i,S),j(ea,w),j(ta,O),d(te)){if(te.length){let t=e.exposed||={};te.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}T&&e.render===r&&(e.render=T),k!=null&&(e.inheritAttrs=k),ne&&(e.components=ne),re&&(e.directives=re),O&&ai(e)}function Ba(e,t,n=r){d(e)&&(e=Ja(e));for(let n in e){let r=e[n],i;i=y(r)?`default`in r?_r(r.from||n,r.default,!0):_r(r.from||n):_r(r),I(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function Va(e,t,n){Bn(d(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Ha(e,t,n,r){let i=r.includes(`.`)?Dr(n,r):()=>n[r];if(_(e)){let n=t[e];g(n)&&wr(i,n)}else if(g(e))wr(i,e.bind(n));else if(y(e)){if(d(e))e.forEach(e=>Ha(e,t,n,r));else{let r=g(e.handler)?e.handler.bind(n):t[e.handler];g(r)&&wr(i,r,e)}}}function Ua(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>Wa(c,e,o,!0)),Wa(c,t,o)),y(t)&&a.set(t,c),c}function Wa(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&Wa(e,a,n,!0),i&&i.forEach(t=>Wa(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=Ga[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var Ga={data:Ka,props:Za,emits:Za,methods:Xa,computed:Xa,beforeCreate:Ya,created:Ya,beforeMount:Ya,mounted:Ya,beforeUpdate:Ya,updated:Ya,beforeDestroy:Ya,beforeUnmount:Ya,destroyed:Ya,unmounted:Ya,activated:Ya,deactivated:Ya,errorCaptured:Ya,serverPrefetch:Ya,components:Xa,directives:Xa,watch:Qa,provide:Ka,inject:qa};function Ka(e,t){return t?e?function(){return s(g(e)?e.call(this,this):e,g(t)?t.call(this,this):t)}:t:e}function qa(e,t){return Xa(Ja(e),Ja(t))}function Ja(e){if(d(e)){let t={};for(let n=0;n{let l,u=t,d;return Cr(()=>{let t=e[a];A(l,t)&&(l=t,c())}),{get(){return s(),r.get?r.get(l):l},set(e){let s=r.set?r.set(e):e;if(!A(s,l)&&!(u!==t&&A(e,u)))return;let f=i.vnode.props,p=!!(f&&(n in f||a in f||o in f)&&(`onUpdate:${n}`in f||`onUpdate:${a}`in f||`onUpdate:${o}`in f));p||(l=e,c()),i.emit(`update:${n}`,s),A(e,u)&&(A(e,s)&&!A(s,d)||p&&u!==t&&!A(s,l))&&c(),u=e,d=s}}});return c[Symbol.iterator]=()=>{let e=0;return{next(){return e<2?{value:e++?s||t:c,done:!1}:{done:!0}}}},c}var io=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${O(t)}Modifiers`]||e[`${k(t)}Modifiers`];function ao(e,n,...r){if(e.isUnmounted)return;let i=e.vnode.props||t,a=r,o=n.startsWith(`update:`),s=o&&io(i,n.slice(7));s&&(s.trim&&(a=r.map(e=>_(e)?e.trim():e)),s.number&&(a=a.map(ae)));let c,l=i[c=re(n)]||i[c=re(O(n))];!l&&o&&(l=i[c=re(k(n))]),l&&Bn(l,e,6,a);let u=i[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,Bn(u,e,6,a)}}var oo=new WeakMap;function so(e,t,n=!1){let r=n?oo:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},c=!1;if(!g(e)){let r=e=>{let n=so(e,t,!0);n&&(c=!0,s(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!c?(y(e)&&r.set(e,null),null):(d(a)?a.forEach(e=>o[e]=null):s(o,a),y(e)&&r.set(e,o),o)}function co(e,t){return!e||!a(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),u(e,t[0].toLowerCase()+t.slice(1))||u(e,k(t))||u(e,t))}function lo(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:s,attrs:c,emit:l,render:u,renderCache:d,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=lr(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Os(u.call(t,e,d,f,m,p,h)),y=c}else{let e=t;v=Os(e.length>1?e(f,{attrs:c,slots:s,emit:l}):e(f,null)),y=t.props?c:fo(c)}}catch(t){cs.length=0,Vn(t,e,1),v=H(B)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(o)&&(y=po(y,a)),b=ws(b,y,!1,!0))}return n.dirs&&(b=ws(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&ti(Ar(b.type)&&ei(b)||b,n.transition),v=b,lr(_),v}function uo(e,t=!0){let n;for(let t=0;t{let t;for(let n in e)(n===`class`||n===`style`||a(n))&&((t||={})[n]=e[n]);return t},po=(e,t)=>{let n={};for(let r in e)(!o(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function mo(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?ho(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;tObject.create(vo),bo=e=>Object.getPrototypeOf(e)===vo;function xo(e,t,n,r=!1){let i={},a=yo();e.propsDefaults=Object.create(null),Co(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:Jt(i):e.type.props?i:a,e.attrs=a}function So(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=F(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r{p=!0;let[t,n]=Eo(e,r,!0);s(l,t),n&&f.push(...n)};!i&&r.mixins.length&&r.mixins.forEach(t),e.extends&&t(e.extends),e.mixins&&e.mixins.forEach(t)}if(!c&&!p)return y(e)&&a.set(e,n),n;if(d(c))for(let e=0;ee===`_`||e===`_ctx`||e===`$stable`,ko=e=>d(e)?e.map(Os):[Os(e)],Ao=(e,t,n)=>{if(t._n)return t;let r=pr((...e)=>ko(t(...e)),n);return r._c=!1,r},jo=(e,t,n)=>{let r=e._ctx;for(let n in e){if(Oo(n))continue;let i=e[n];if(g(i))t[n]=Ao(n,i,r);else if(i!=null){let e=ko(i);t[n]=()=>e}}},Mo=(e,t)=>{let n=ko(t);e.slots.default=()=>n},No=(e,t,n)=>{for(let r in t)(n||!Oo(r))&&(e[r]=t[r])},Po=(e,t,n)=>{let r=e.slots=yo();if(e.vnode.shapeFlag&32){let e=t._;e?(No(r,t,n),n&&ie(r,`_`,e,!0)):jo(t,r)}else t&&Mo(e,t)},Fo=(e,n,r)=>{let{vnode:i,slots:a}=e,o=!0,s=t;if(i.shapeFlag&32){let e=n._;e?r&&e===1?o=!1:No(a,n,r):(o=!n.$stable,jo(n,a)),s=n}else n&&(Mo(e,n),s={default:1});if(o)for(let e in a)!Oo(e)&&s[e]==null&&delete a[e]},R=rs;function Io(e){return Ro(e)}function Lo(e){return Ro(e,_i)}function Ro(e,i){let a=ce();a.__VUE__=!0;let{insert:o,remove:s,patchProp:c,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=r,insertStaticContent:_}=e,v=(e,t,r,i=null,a=null,o=null,s=void 0,c=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!_s(e,t)&&(i=_e(e),fe(e,a,o,!0),e=null),t.patchFlag===-2&&(l=!1,t.dynamicChildren=null),t.dynamicChildren&&e&&e.dynamicChildren&&e.dynamicChildren.hasOnce&&(t.dynamicChildren===n&&(t.dynamicChildren=[]),t.dynamicChildren.hasOnce=!0);let{type:u,ref:d,shapeFlag:f}=t;switch(u){case os:y(e,t,r,i);break;case B:b(e,t,r,i);break;case ss:e??x(t,r,i,s);break;case z:ne(e,t,r,i,a,o,s,c,l);break;default:f&1?w(e,t,r,i,a,o,s,c,l):f&6?re(e,t,r,i,a,o,s,c,l):(f&64||f&128)&&u.process(e,t,r,i,a,o,s,c,l,be)}d!=null&&a?li(d,e&&e.ref,o,t||e,!t):d==null&&e&&e.ref!=null&&li(e.ref,null,o,e,!0)},y=(e,t,n,r)=>{if(e==null)o(t.el=u(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,r)=>{e==null?o(t.el=d(t.children||``),n,r):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=h(e),o(e,n,r),e=i;o(t,n,r)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)T(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),O(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},T=(e,t,n,r,i,a,s,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,a,m&&m.is,m),h&8?p(d,e.children):h&16&&ee(e.children,d,null,r,i,zo(e,a),s,u),_&&hr(e,null,r,`created`),D(d,e,e.scopeId,s,r),m){for(let e in m)e!==`value`&&!E(e)&&c(d,e,null,m[e],a,r);`value`in m&&c(d,`value`,null,m.value,a),(f=m.onVnodeBeforeMount)&&Ms(f,r,e)}_&&hr(e,null,r,`beforeMount`);let v=Vo(i,g);v&&g.beforeEnter(d),o(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&R(()=>{try{f&&Ms(f,r,e),v&&g.enter(d),_&&hr(e,null,r,`mounted`)}finally{}},i)},D=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t{for(let l=c;l{let l=n.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=n;u|=e.patchFlag&16;let m=e.props||t,h=n.props||t,g;if(r&&Bo(r,!1),(g=h.onVnodeBeforeUpdate)&&Ms(g,r,n,e),f&&hr(n,e,r,`beforeUpdate`),r&&Bo(r,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(u=0,s=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?te(e.dynamicChildren,d,l,r,i,zo(n,a),o):s||se(e,n,l,null,r,i,zo(n,a),o,!1),u>0){if(u&16)k(l,m,h,r,a);else if(u&2&&m.class!==h.class&&c(l,`class`,null,h.class,a),u&4&&c(l,`style`,m.style,h.style,a),u&8){let e=n.dynamicProps;for(let t=0;t{g&&Ms(g,r,n,e),f&&hr(n,e,r,`updated`)},i)},te=(e,t,n,r,i,a,o)=>{for(let s=0;s{if(n!==r){if(n!==t)for(let t in n)!E(t)&&!(t in r)&&c(e,t,n[t],null,a,i);for(let t in r){if(E(t))continue;let o=r[t],s=n[t];o!==s&&t!==`value`&&c(e,t,s,o,a,i)}`value`in r&&c(e,`value`,n.value,r.value,a)}},ne=(e,t,n,r,i,a,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(o(d,n,r),o(f,n,r),ee(t.children||[],n,f,i,a,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(te(e.dynamicChildren,m,n,i,a,s,c),(t.key!=null||i&&t===i.subTree)&&Ho(e,t,!0)):se(e,t,n,f,i,a,s,c,l)},re=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):A(t,n,r,i,a,o,c):ie(e,t,c)},A=(e,t,n,r,i,a,o)=>{let s=e.component=Fs(e,r,i);if(Ri(e)&&(s.ctx.renderer=be),Us(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,ae,o),!e.el){let r=s.subTree=H(B);b(null,r,t,n),e.placeholder=r.el}}else ae(s,e,t,n,i,a,o)},ie=(e,t,n)=>{let r=t.component=e.component;if(mo(e,t,n)){if(r.asyncDep&&!r.asyncResolved){t.el=e.el,oe(r,t,n);return}r.next=t,r.update()}else t.el=e.el,r.vnode=t},ae=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Wo(e);if(n){t&&(t.el=c.el,oe(e,t,o)),n.asyncDep.then(()=>{R(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;Bo(e,!1),t?(t.el=c.el,oe(e,t,o)):t=c,n&&j(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Ms(d,s,t,c),Bo(e,!0);let f=lo(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),_e(p),e,i,a),t.el=f.el,u===null&&_o(e,f.el),r&&R(r,i),(d=t.props&&t.props.onVnodeUpdated)&&R(()=>Ms(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Fi(t);if(Bo(e,!1),l&&j(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Ms(o,d,t),Bo(e,!0),s&&Se){let t=()=>{e.subTree=lo(e),Se(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=lo(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&R(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;R(()=>Ms(o,d,e),i)}(t.shapeFlag&256||d&&Fi(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&R(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Ie(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Qn(u),Bo(e,!0),l()},oe=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,So(e,t.props,r,n),Fo(e,t.children,n),$e(),tr(e),et()},se=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){ue(l,d,n,r,i,a,o,s,c);return}if(f&256){le(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&ge(l,i,a),d!==l&&p(n,d)):u&16?m&16?ue(l,d,n,r,i,a,o,s,c):ge(l,i,a,!0):(u&8&&p(n,``),m&16&&ee(d,n,r,i,a,o,s,c))},le=(e,t,r,i,a,o,s,c,l)=>{e||=n,t||=n;let u=e.length,d=t.length,f=Math.min(u,d),p=0;for(;pd?ge(e,a,o,!0,!1,f):ee(t,r,i,a,o,s,c,l,f)},ue=(e,t,r,i,a,o,s,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let n=e[u],i=t[u]=l?ks(t[u]):Os(t[u]);if(_s(n,i))v(n,i,r,null,a,o,s,c,l);else break;u++}for(;u<=f&&u<=p;){let n=e[f],i=t[p]=l?ks(t[p]):Os(t[p]);if(_s(n,i))v(n,i,r,null,a,o,s,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,n=ep)for(;u<=f;)fe(e[u],a,o,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?ks(t[u]):Os(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(u=0;u=b){fe(n,a,o,!0);continue}let i;if(n.key!=null)i=g.get(n.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&_s(n,t[_])){i=_;break}i===void 0?fe(n,a,o,!0):(C[i-h]=u+1,i>=S?S=i:x=!0,v(n,t[i],r,null,a,o,s,c,l),y++)}let w=x?Uo(C):n;for(_=w.length-1,u=b-1;u>=0;u--){let e=h+u,n=t[e],f=t[e+1],p=e+1{let{el:a,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){de(e.component.subTree,t,n,r);return}if(d&128){e.suspense.move(t,n,r);return}if(d&64){c.move(e,t,n,be);return}if(c===z){o(a,t,n);for(let e=0;el.enter(a),i));else{let{leave:r,delayLeave:i,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?s(a):o(a,t,n)},d=()=>{let e=a._isLeaving||!!a[Hr];a._isLeaving&&a[Hr](!0),l.persisted&&!e?u():r(a,()=>{u(),c&&c()})};i?i(a,u,d):d()}}else o(a,t,n)},fe=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if((d===-2||l&&l.hasOnce)&&(i=!1),s!=null&&($e(),li(s,null,n,e,!0),et()),p!=null&&(!e.ctx||e.ctx===t)&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Fi(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Ms(_,t,e),u&6)he(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&hr(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,be,r):l&&!l.hasOnce&&(a!==z||d>0&&d&64)?ge(l,t,n,!1,!0):(a===z&&d&384||!i&&u&16)&&ge(c,t,n),r&&pe(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&R(()=>{_&&Ms(_,t,e),h&&hr(e,null,t,`unmounted`),v&&(e.el=null)},n)},pe=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===z){me(n,r);return}if(t===ss){C(e),i&&!i.persisted&&i.afterLeave&&i.afterLeave();return}let a=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(e.shapeFlag&1&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},me=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},he=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;Go(c),Go(l),r&&j(r),i.stop(),a?(a.flags|=8,fe(o,e,t,n)):e.vnode.el&&o&&(o.transition=e.vnode.transition,fe(o,e,t,n)),s&&R(s,t),R(()=>{e.isUnmounted=!0},t)},ge=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o{if(e.shapeFlag&6)return _e(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[kr];return n?h(n):t},ve=!1,ye=(e,t,n)=>{let r;e==null?t._vnode&&(fe(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ve||=(ve=!0,tr(r),nr(),!1)},be={p:v,um:fe,m:de,r:pe,mt:A,mc:ee,pc:se,pbc:te,n:_e,o:e},xe,Se;return i&&([xe,Se]=i(be)),{render:ye,hydrate:xe,createApp:to(ye,xe)}}function zo({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Bo({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Vo(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ho(e,t,n=!1){let r=e.children,i=t.children;if(d(r)&&d(i))for(let e=0;e>1,e[n[s]]0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function Wo(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Wo(t)}function Go(e){if(e)for(let t=0;te.__isSuspense,Jo=0,Yo={name:`Suspense`,__isSuspense:!0,process(e,t,n,r,i,a,o,s,c,l){if(e==null)Zo(t,n,r,i,a,o,s,c,l);else{if(a&&a.deps>0&&!e.suspense.isInFallback&&!a.isHydrating){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}Qo(e,t,n,r,i,o,s,c,l)}},hydrate:es,normalize:ts};function Xo(e,t){let n=e.props&&e.props[t];g(n)&&n()}function Zo(e,t,n,r,i,a,o,s,c){let{p:l,o:{createElement:u}}=c,d=u(`div`),f=e.suspense=$o(e,i,r,t,d,n,a,o,s,c);l(null,f.pendingBranch=e.ssContent,d,null,r,f,a,o),f.deps>0?(Xo(e,`onPending`),Xo(e,`onFallback`),l(null,e.ssFallback,t,n,r,null,a,o),is(f,e.ssFallback)):f.resolve(!1,!0)}function Qo(e,t,n,r,i,a,o,s,{p:c,um:l,o:{createElement:u}}){let d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;let f=t.ssContent,p=t.ssFallback,{activeBranch:m,pendingBranch:h,isInFallback:g,isHydrating:_}=d;if(h)d.pendingBranch=f,_s(h,f)?(d.deps++,c(h,f,_?n:d.hiddenContainer,null,i,d,a,o,s),d.deps--,d.deps<=0?d.resolve():g&&!_&&!d.isFallbackMountPending&&(c(m,p,n,r,i,null,a,o,s),is(d,p))):(d.pendingId=Jo++,_?(d.isHydrating=!1,d.activeBranch=h):l(h,i,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u(`div`),g?(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():d.isFallbackMountPending||(c(m,p,n,r,i,null,a,o,s),is(d,p))):m&&_s(m,f)?(c(m,f,n,r,i,d,a,o,s),d.resolve(!0)):(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0&&d.resolve()));else if(m&&_s(m,f))c(m,f,n,r,i,d,a,o,s),is(d,f);else if(Xo(t,`onPending`),d.pendingBranch=f,d.pendingId=f.shapeFlag&512?f.component.suspenseId:Jo++,c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0)d.resolve();else{let{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(p)},e):e===0&&d.fallback(p)}}function $o(e,t,n,r,i,a,o,s,c,l,u=!1){let{p:d,m:f,um:p,n:m,o:{parentNode:h,remove:g}}=l,_,v=as(e);v&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);let y=e.props?oe(e.props.timeout):void 0,b=a,x={vnode:e,parent:t,parentComponent:n,namespace:o,container:r,hiddenContainer:i,deps:0,pendingId:Jo++,timeout:typeof y==`number`?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:r,activeBranch:i,pendingBranch:o,pendingId:s,effects:c,parentComponent:l,container:u,isInFallback:d}=x,g=!1;if(x.isHydrating)x.isHydrating=!1;else if(!e){g=i&&o.transition&&o.transition.mode===`out-in`;let e=!1;g&&(i.transition.afterLeave=()=>{s===x.pendingId&&(f(o,u,a===b&&!e?m(i):a,0),er(c),d&&r.ssFallback&&(r.ssFallback.el=null))}),i&&!x.isFallbackMountPending&&(h(i.el)===u&&(a=m(i),e=!0),p(i,l,x,!0),!g&&d&&r.ssFallback&&R(()=>r.ssFallback.el=null,x)),g||f(o,u,a,0)}x.isFallbackMountPending=!1,is(x,o),x.pendingBranch=null,x.isInFallback=!1;let y=x.parent,S=!1;for(;y;){if(y.pendingBranch){for(let e=0;e{if(x.isFallbackMountPending=!1,!x.isInFallback)return;let e=x.vnode.ssFallback;d(null,e,i,o,r,null,a,s,c),is(x,e)},u=e.transition&&e.transition.mode===`out-in`;u&&(x.isFallbackMountPending=!0,n.transition.afterLeave=l),x.isInFallback=!0,p(n,r,null,!0),u||l()},move(e,t,n){x.activeBranch&&f(x.activeBranch,e,t,n),x.container=e},next(){return x.activeBranch&&m(x.activeBranch)},registerDep(e,t,n){let r=!!x.pendingBranch;r&&x.deps++;let i=e.vnode.el;e.asyncDep.catch(t=>{Vn(t,e,0)}).then(a=>{if(e.isUnmounted||x.isUnmounted||x.pendingId!==e.suspenseId)return;if(Bs(),i&&!e.scope.active){r&&--x.deps===0&&x.resolve();return}e.asyncResolved=!0;let{vnode:s}=e;Gs(e,a,!1),i&&(s.el=i);let c=!i&&e.subTree.el;t(e,s,h(i||e.subTree.el),i?null:m(e.subTree),x,o,n),c&&(s.placeholder=null,g(c)),_o(e,s.el),r&&--x.deps===0&&x.resolve()})},unmount(e,t){x.isUnmounted=!0,x.activeBranch&&p(x.activeBranch,n,e,t),x.pendingBranch&&p(x.pendingBranch,n,e,t)}};return x}function es(e,t,n,r,i,a,o,s,c){let l=t.suspense=$o(t,r,n,e.parentNode,document.createElement(`div`),null,i,a,o,s,!0),u=c(e,l.pendingBranch=t.ssContent,n,l,a,o);return l.deps===0&&l.resolve(!1,!0),u}function ts(e){let{shapeFlag:t,children:n}=e,r=t&32;e.ssContent=ns(r?n.default:n),e.ssFallback=r?ns(n.fallback):H(B)}function ns(e){let t;if(g(e)){let n=ds&&e._c;n&&(e._d=!1,ls()),e=e(),n&&(e._d=!0,t=V,us())}return d(e)&&(e=uo(e)),e=Os(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function rs(e,t){t&&t.pendingBranch?d(e)?t.effects.push(...e):t.effects.push(e):er(e)}function is(e,t){e.activeBranch=t;let{vnode:n,parentComponent:r}=e,i=t.el;for(;!i&&t.component;)t=t.component.subTree,i=t.el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,_o(r,i))}function as(e){let t=e.props&&e.props.suspensible;return t!=null&&t!==!1}var z=Symbol.for(`v-fgt`),os=Symbol.for(`v-txt`),B=Symbol.for(`v-cmt`),ss=Symbol.for(`v-stc`),cs=[],V=null;function ls(e=!1){cs.push(V=e?null:[])}function us(){cs.pop(),V=cs[cs.length-1]||null}var ds=1;function fs(e,t=!1){ds+=e,e<0&&V&&t&&(V.hasOnce=!0)}function ps(e){return e.dynamicChildren=ds>0?V||n:null,us(),ds>0&&V&&V.push(e),e}function ms(e,t,n,r,i,a){return ps(xs(e,t,n,r,i,a,!0))}function hs(e,t,n,r,i){return ps(H(e,t,n,r,i,!0))}function gs(e){return e?e.__v_isVNode===!0:!1}function _s(e,t){return e.type===t.type&&e.key===t.key}function vs(e){}var ys=({key:e})=>e??null,bs=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:_(e)||I(e)||g(e)?{i:L,r:e,k:t,f:!!n}:e);function xs(e,t=null,n=null,r=0,i=null,a=e===z?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ys(t),ref:t&&bs(t),scopeId:cr,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:L};return s?(As(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=_(n)?8:16),ds>0&&!o&&V&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&V.push(c),c}var H=Ss;function Ss(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===ca)&&(e=B),gs(e)){let r=ws(e,t,!0);return n&&As(r,n),ds>0&&!a&&V&&(r.shapeFlag&6?V[V.indexOf(e)]=r:V.push(r)),r.patchFlag=-2,r}if(tc(e)&&(e=e.__vccOpts),t){t=Cs(t);let{class:e,style:n}=t;e&&!_(e)&&(t.class=he(e)),y(n)&&(tn(n)&&!d(n)&&(n=s({},n)),t.style=ue(n))}let o=_(e)?1:qo(e)?128:Ar(e)?64:y(e)?4:g(e)?2:0;return xs(e,t,n,r,i,o,a,!0)}function Cs(e){return e?tn(e)||bo(e)?s({},e):e:null}function ws(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?js(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&ys(l),ref:t&&t.ref?n&&a?d(a)?a.concat(bs(t)):[a,bs(t)]:bs(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==z?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ws(e.ssContent),ssFallback:e.ssFallback&&ws(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return c&&r&&ti(u,c.clone(u)),u}function Ts(e=` `,t=0){return H(os,null,e,t)}function Es(e,t){let n=H(ss,null,e);return n.staticCount=t,n}function Ds(e=``,t=!1){return t?(ls(),hs(B,null,e)):H(B,null,e)}function Os(e){return e==null||typeof e==`boolean`?H(B):d(e)?H(z,null,e.slice()):gs(e)?ks(e):H(os,null,String(e))}function ks(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ws(e)}function As(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(d(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),As(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!bo(t)?t._ctx=L:r===3&&L&&(L.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(g(t)){if(r&65){As(e,{default:t});return}t={default:t,_ctx:L},n=32}else t=String(t),r&64?(n=16,t=[Ts(t)]):n=8;e.children=t,e.shapeFlag|=n}function js(...e){let t={};for(let n=0;nU||L,Ls,Rs;{let e=ce(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Ls=t(`__VUE_INSTANCE_SETTERS__`,e=>U=e),Rs=t(`__VUE_SSR_SETTERS__`,e=>Hs=e)}var zs=e=>{let t=U;return Ls(e),e.scope.on(),()=>{e.scope.off(),Ls(t)}},Bs=()=>{U&&U.scope.off(),Ls(null)};function Vs(e){return e.vnode.shapeFlag&4}var Hs=!1;function Us(e,t=!1,n=!1){t&&Rs(t);let{props:r,children:i}=e.vnode,a=Vs(e);xo(e,r,a,t),Po(e,i,n||t);let o=a?Ws(e,t):void 0;return t&&Rs(!1),o}function Ws(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,xa);let{setup:r}=n;if(r){$e();let n=e.setupContext=r.length>1?Qs(e):null,i=zs(e),a=zn(r,e,0,[e.props,n]),o=b(a);if(et(),i(),(o||e.sp)&&!Fi(e)&&ai(e),o){if(a.then(Bs,Bs),t)return a.then(n=>{Rs(!0);try{Gs(e,n,t)}finally{Rs(!1)}}).catch(t=>{Vn(t,e,0)});e.asyncDep=a}else Gs(e,a,t)}else Xs(e,t)}function Gs(e,t,n){g(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:y(t)&&(e.setupState=mn(t)),Xs(e,n)}var Ks,qs;function Js(e){Ks=e,qs=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,Sa))}}var Ys=()=>!Ks;function Xs(e,t,n){let i=e.type;if(!e.render){if(!t&&Ks&&!i.render){let t=i.template||Ua(e).template;if(t){let{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:a,compilerOptions:o}=i,c=s(s({isCustomElement:n,delimiters:a},r),o);i.render=Ks(t,c)}}e.render=i.render||r,qs&&qs(e)}{let t=zs(e);$e();try{za(e)}finally{et(),t()}}}var Zs={get(e,t){return P(e,`get`,``),e[t]}};function Qs(e){return{attrs:new Proxy(e.attrs,Zs),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function $s(e){return e.exposed?e.exposeProxy||=new Proxy(mn(nn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ya)return ya[n](e)},has(e,t){return t in e||t in ya}}):e.proxy}function ec(e,t=!0){return g(e)?e.displayName||e.name:e.name||t&&e.__name}function tc(e){return g(e)&&`__vccOpts`in e}var W=(e,t)=>Cn(e,t,Hs);function nc(e,t,n){try{fs(-1);let r=arguments.length;return r===2?y(t)&&!d(t)?gs(t)?H(e,null,[t]):H(e,t):H(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&gs(n)&&(n=[n]),H(e,t,n))}finally{fs(1)}}function rc(){}function ic(e,t,n,r){let i=n[r];if(i&&ac(i,e))return i;let a=t();return a.memo=e.slice(),a.cacheIndex=r,n[r]=a}function ac(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&V&&V.push(e),!0}var oc=`3.5.43`,sc=r,cc=Rn,lc=ar,uc=sr,dc={createComponentInstance:Fs,setupComponent:Us,renderComponentRoot:lo,setCurrentRenderingInstance:lr,isVNode:gs,normalizeVNode:Os,getComponentPublicInstance:$s,ensureValidVNode:ga,pushWarningContext:Pn,popWarningContext:Fn},fc=void 0,pc=typeof window<`u`&&window.trustedTypes;if(pc)try{fc=pc.createPolicy(`vue`,{createHTML:e=>e})}catch{}var mc=fc?e=>fc.createHTML(e):e=>e,hc=`http://www.w3.org/2000/svg`,gc=`http://www.w3.org/1998/Math/MathML`,_c=typeof document<`u`?document:null,vc=_c&&_c.createElement(`template`),yc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?_c.createElementNS(hc,e):t===`mathml`?_c.createElementNS(gc,e):n?_c.createElement(e,{is:n}):_c.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>_c.createTextNode(e),createComment:e=>_c.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>_c.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{vc.innerHTML=mc(r===`svg`?`${e} `:r===`mathml`?`${e} `:e);let i=vc.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},bc=`transition`,xc=`animation`,Sc=Symbol(`_vtc`),Cc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},wc=s({},Kr,Cc),Tc=(e=>(e.displayName=`Transition`,e.props=wc,e))((e,{slots:t})=>nc(Xr,Oc(e),t)),Ec=(e,t=[])=>{d(e)?e.forEach(e=>e(...t)):e&&e(...t)},Dc=e=>e?d(e)?e.some(e=>e.length>1):e.length>1:!1;function Oc(e){let t={};for(let n in e)n in Cc||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:c=`${n}-enter-to`,appearFromClass:l=a,appearActiveClass:u=o,appearToClass:d=c,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,h=kc(i),g=h&&h[0],_=h&&h[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:C=v,onAppear:w=y,onAppearCancelled:T=b}=t,E=(e,t,n,r)=>{e._enterCancelled=r,Mc(e,t?d:c),Mc(e,t?u:o),n&&n()},D=(e,t)=>{e._isLeaving=!1,Mc(e,f),Mc(e,m),Mc(e,p),t&&t()},ee=e=>(t,n)=>{let i=e?w:y,o=()=>E(t,e,n);Ec(i,[t,o]),Nc(()=>{Mc(t,e?l:a),jc(t,e?d:c),Dc(i)||Fc(t,r,g,o)})};return s(t,{onBeforeEnter(e){Ec(v,[e]),jc(e,a),jc(e,o)},onBeforeAppear(e){Ec(C,[e]),jc(e,l),jc(e,u)},onEnter:ee(!1),onAppear:ee(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>D(e,t);jc(e,f),e._enterCancelled?(jc(e,p),zc(e)):(zc(e),jc(e,p)),Nc(()=>{e._isLeaving&&(Mc(e,f),jc(e,m),Dc(x)||Fc(e,r,_,n))}),Ec(x,[e,n])},onEnterCancelled(e){E(e,!1,void 0,!0),Ec(b,[e])},onAppearCancelled(e){E(e,!0,void 0,!0),Ec(T,[e])},onLeaveCancelled(e){D(e),Ec(S,[e])}})}function kc(e){if(e==null)return null;if(y(e))return[Ac(e.enter),Ac(e.leave)];{let t=Ac(e);return[t,t]}}function Ac(e){return oe(e)}function jc(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Sc]||(e[Sc]=new Set)).add(t)}function Mc(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[Sc];n&&(n.delete(t),n.size||(e[Sc]=void 0))}function Nc(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Pc=0;function Fc(e,t,n,r){let i=e._endId=++Pc,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Ic(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u(n[e]||``).split(`, `),i=r(`${bc}Delay`),a=r(`${bc}Duration`),o=Lc(i,a),s=r(`${xc}Delay`),c=r(`${xc}Duration`),l=Lc(s,c),u=null,d=0,f=0;t===bc?o>0&&(u=bc,d=o,f=a.length):t===xc?l>0&&(u=xc,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?bc:xc:null,f=u?u===bc?a.length:c.length:0);let p=u===bc&&/\b(?:transform|all)(?:,|$)/.test(r(`${bc}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Lc(e,t){for(;e.lengthRc(t)+Rc(e[n])))}function Rc(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function zc(e){return(e?e.ownerDocument:document).body.offsetHeight}function Bc(e,t,n){let r=e[Sc];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Vc=Symbol(`_vod`),Hc=Symbol(`_vsh`),Uc={name:`show`,beforeMount(e,{value:t},{transition:n}){e[Vc]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):Wc(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Wc(e,!0),r.enter(e)):r.leave(e,()=>{Wc(e,!1)}):Wc(e,t))},beforeUnmount(e,{value:t}){Wc(e,t)}};function Wc(e,t){e.style.display=t?e[Vc]:`none`,e[Hc]=!t}function Gc(){Uc.getSSRProps=({value:e})=>{if(!e)return{style:{display:`none`}}}}var Kc=Symbol(``);function qc(e){let t=Is();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>Yc(e,n))},i=()=>{let r=e(t.proxy);t.ce?Yc(t.ce,r):Jc(t.subTree,r),n(r)};Zi(()=>{er(i)}),Xi(()=>{wr(i,r,{flush:`post`});let e=new MutationObserver(i);e.observe(t.subTree.el.parentNode,{childList:!0}),ea(()=>e.disconnect())})}function Jc(e,t){if(e.shapeFlag&128){let n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Jc(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Yc(e.el,t);else if(e.type===z)e.children.forEach(e=>Jc(e,t));else if(e.type===ss){let{el:n,anchor:r}=e;for(;n&&(Yc(n,t),n!==r);)n=n.nextSibling}}function Yc(e,t){if(e.nodeType===1){let n=e.style,r=``;for(let e in t){let i=Ae(t[e]);n.setProperty(`--${e}`,i),r+=`--${e}: ${i};`}n[Kc]=r}}var Xc=/(?:^|;)\s*display\s*:/;function Zc(e,t,n){let r=e.style,i=_(n),a=!1;if(n&&!i){if(t){if(_(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??$c(r,t,``)}else for(let e in t)n[e]??$c(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?$c(r,i,``):rl(e,i,!_(t)&&t?t[i]:void 0,o)||$c(r,i,o)}}else if(i){if(t!==n){let e=r[Kc];e&&(n+=`;`+e),r.cssText=n,a=Xc.test(n)}}else t&&e.removeAttribute(`style`);Vc in e&&(e[Vc]=a?r.display:``,e[Hc]&&(r.display=`none`))}var Qc=/\s*!important$/;function $c(e,t,n){if(d(n))n.forEach(n=>$c(e,t,n));else if(n??=``,t.startsWith(`--`))Qc.test(n)?e.setProperty(t,n.replace(Qc,``),`important`):e.setProperty(t,n);else{let r=nl(e,t);Qc.test(n)?e.setProperty(k(r),n.replace(Qc,``),`important`):e[r]=n}}var el=[`Webkit`,`Moz`,`ms`],tl={};function nl(e,t){let n=tl[t];if(n)return n;let r=O(t);if(r!==`filter`&&r in e)return tl[t]=r;r=ne(r);for(let n=0;nml||=(hl.then(()=>ml=0),Date.now());function _l(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(d(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;ne.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,yl=(e,t,n,r,i,s)=>{let c=i===`svg`;t===`class`?Bc(e,r,c):t===`style`?Zc(e,n,r):a(t)?o(t)||ul(e,t,n,r,s):(t[0]===`.`?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):bl(e,t,r,c))?(ol(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&al(e,t,r,c,s,t!==`value`)):e._isVueCE&&(xl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!_(r)))?ol(e,O(t),r,s,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),al(e,t,r,c))};function bl(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&vl(t)&&g(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return vl(t)&&_(n)?!1:t in e}function xl(e,t){let n=e._def.props;if(!n)return!1;let r=O(t);return Array.isArray(n)?n.some(e=>O(e)===r):Object.keys(n).some(e=>O(e)===r)}var Sl={};function Cl(e,t,n){let r=ri(e,t);w(r)&&(r=s({},r,t));class i extends El{constructor(e){super(r,e,n)}}return i.def=r,i}var wl=((e,t)=>Cl(e,t,vu)),Tl=typeof HTMLElement<`u`?HTMLElement:class{},El=class e extends Tl{constructor(e,t={},n=_u){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&n!==_u?this._root=this.shadowRoot:e.shadowRoot===!1?this._root=this:(this.attachShadow(s({},e.shadowRootOptions,{mode:`open`})),this._root=this.shadowRoot)}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t&&=t.assignedSlot||t.parentNode||t.host;)if(t instanceof e){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{if(this._pendingResolve=void 0,this.isConnected)return this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._inheritParentContext(e))}_inheritParentContext(e=this._parent){e&&this._app&&Object.setPrototypeOf(this._app._context.provides,e._instance.provides)}disconnectedCallback(){this._connected=!1,Xn(()=>{this._connected||(this._ob&&=(this._ob.disconnect(),null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&=(this._teleportTargets.clear(),void 0))})}_processMutations(e){for(let t of e)this._setAttr(t.attributeName)}_resolveDef(){if(this._pendingResolve)return this._pendingResolve;for(let e=0;e{this._resolved=!0,this._pendingResolve=void 0;let{props:n,styles:r}=e,i;if(n&&!d(n))for(let e in n){let t=n[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=oe(this._props[e])),(i||=Object.create(null))[O(e)]=!0)}this._numberProps=i,this._resolveProps(e),this.shadowRoot&&this._applyStyles(r),this._mount(e)},t=this._def.__asyncLoader;if(t)return this._pendingResolve=t().then(t=>{t.configureApp=this._def.configureApp,e(this._def=t,!0)}),this._pendingResolve;e(this._def)}_mount(e){this._app=this._createApp(e),this._inheritParentContext(),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)u(this,e)||Object.defineProperty(this,e,{get:()=>dn(t[e])})}_resolveProps(e){let{props:t}=e,n=d(t)?t:Object.keys(t||{});for(let e of Object.keys(this))e[0]!==`_`&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(O))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!this._patching)}})}_setAttr(e){if(e.startsWith(`data-v-`))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):Sl,r=O(e);t&&this._numberProps&&this._numberProps[r]&&(n=oe(n)),this._setProp(r,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,r=!1){if(t!==this._props[e]&&(this._dirty=!0,t===Sl?delete this._props[e]:(this._props[e]=t,e===`key`&&this._app&&(this._app._ceVNode.key=t)),r&&this._instance&&this._update(),n)){let n=this._ob;n&&(this._processMutations(n.takeRecords()),n.disconnect()),t===!0?this.setAttribute(k(e),``):typeof t==`string`||typeof t==`number`?this.setAttribute(k(e),t+``):t||this.removeAttribute(k(e)),n&&n.observe(this,{attributes:!0})}}_update(){let e=this._createVNode();this._app&&(e.appContext=this._app._context),hu(e,this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=H(this._def,s(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,w(t[0])?s({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),k(e)!==e&&t(k(e),n)},this._setParent()}),t}_applyStyles(e,t,n){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let r=this._nonce,i=this.shadowRoot,a=n?this._getStyleAnchor(n)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i),o=null;for(let s=e.length-1;s>=0;s--){let c=document.createElement(`style`);r&&c.setAttribute(`nonce`,r),c.textContent=e[s],i.insertBefore(c,o||a),o=c,s===0&&(n||this._styleAnchors.set(this._def,c),t&&this._styleAnchors.set(t,c))}}_getStyleAnchor(e){if(!e)return null;let t=this._styleAnchors.get(e);return t&&t.parentNode===this.shadowRoot?t:(t&&this._styleAnchors.delete(e),null)}_getRootStyleInsertionAnchor(e){for(let t=0;t(delete e.props.mode,e))({name:`TransitionGroup`,props:s({},wc,{tag:String,moveClass:String}),setup(e,{slots:t}){let n=Is(),r=Wr(),i,a;return Qi(()=>{if(!i.length)return;let t=e.moveClass||`${e.name||`v`}-move`;if(!zl(i[0].el,n.vnode.el,t)){i=[];return}i.forEach(Fl),i.forEach(Il);let r=i.filter(Ll);zc(n.vnode.el),r.forEach(e=>{let n=e.el,r=n.style;jc(n,t),r.transform=r.webkitTransform=r.transitionDuration=``;let i=n[Ml]=e=>{e&&e.target!==n||(!e||e.propertyName.endsWith(`transform`))&&(n.removeEventListener(`transitionend`,i),n[Ml]=null,Mc(n,t))};n.addEventListener(`transitionend`,i)}),i=[]}),()=>{let o=F(e),s=Oc(o),c=o.tag||z;if(i=[],a)for(let e=0;e{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display=`none`;let a=t.nodeType===1?t:t.parentNode;a.appendChild(r);let{hasTransform:o}=Ic(r);return a.removeChild(r),o}var Bl=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return d(t)?e=>j(t,e):t};function Vl(e){e.target.composing=!0}function Hl(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var Ul=Symbol(`_assign`),Wl=Symbol(`_initialValue`);function Gl(e,t,n){return t&&(e=e.trim()),n&&(e=ae(e)),e}var Kl={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[Wl]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[Wl]=e.defaultValue.replace(/\r\n?/g,`
@@ -90,4 +90,4 @@ function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
- `,document.head.appendChild(t)},vh={configure:ih,isStarted:oh,done:ch,set:ah,remove:fh,start:sh,status:nh,show:()=>{if(rh=!1,Z?.isConnected){if(eh)try{Z.showPopover()}catch{}else Z.style.display=``}},hide:()=>{if(rh=!0,Z?.isConnected){if(eh)try{Z.hidePopover()}catch{}else Z.style.display=`none`}}},yh=new class{hideCount=0;start(){vh.start()}reveal(e=!1){this.hideCount=Math.max(0,this.hideCount-1),(e||this.hideCount===0)&&vh.show()}hide(){this.hideCount++,vh.hide()}set(e){vh.set(Math.max(0,Math.min(1,e)))}finish(){vh.done()}reset(){vh.set(0)}remove(){vh.done(),vh.remove()}isStarted(){return vh.isStarted()}getStatus(){return vh.status}};function bh(e){document.addEventListener(`inertia:start`,t=>xh(t,e)),document.addEventListener(`inertia:progress`,Sh)}function xh(e,t){e.detail.visit.showProgress||yh.hide();let n=setTimeout(()=>yh.start(),t);document.addEventListener(`inertia:finish`,e=>Ch(e,n),{once:!0})}function Sh(e){yh.isStarted()&&e.detail.progress?.percentage&&yh.set(Math.max(yh.getStatus(),e.detail.progress.percentage/100*.9))}function Ch(e,t){clearTimeout(t),yh.isStarted()&&(e.detail.visit.completed?yh.finish():e.detail.visit.interrupted?yh.reset():e.detail.visit.cancelled&&yh.remove())}function wh({delay:e=250,color:t=`#29d`,includeCSS:n=!0,showSpinner:r=!1,popover:i=null}={}){bh(e),vh.configure({showSpinner:r,includeCSS:n,color:t,popover:i})}function Th(e,t,n){return`
+
+
+ {{-- Version und Kanal --}}
+
+
+
+
Installierte Version
+
{{ $release }} @if ($shortSha)({{ $shortSha }}) @endif
+
+
+ Update-Kanal
+
+ @foreach ($channels as $key => $label)
+ {{ $label }}
+ @endforeach
+
+
+
+
+
+ {{-- Suche und Installation --}}
+
+
+
+
+ Nach Updates suchen
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Hinweis: Der Stand stammt aus einem anderen Kanal und ist älter als der installierte – das ist beim Zurückwechseln normal.
+
+
+
+
+
+
+
+
+
+
+ Jetzt aktualisieren
+
+ Das Portal zeigt währenddessen eine Wartungsseite.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Die bisherige Version läuft weiter.
+
+
+
+
+
+ {{-- Datenschutzhinweis: dauerhaft sichtbar, Wortlaut nach Vorgabe (docs/specs/self-updater.md). --}}
+
+
Bei der Suche nach Updates und beim Herunterladen einer neuen Fassung werden Daten an update.loheide.cloud übertragen. Übermittelt werden:
+
+ die auf Ihrer Lizenz hinterlegte E-Mail-Adresse und der Lizenzschlüssel
+ eine Gerätekennung, die dieses Programm einmalig als Zufallszahl erzeugt hat (keine Hardwarekennung, keine Seriennummer) – damit wird gezählt, auf wie vielen Geräten die Lizenz genutzt wird
+ Rechnername, Betriebssystem und Programmversion, damit Sie Ihre Geräte im Kundenportal auseinanderhalten können
+ der bei Ihnen installierte Stand, damit die Gegenstelle weiß, was neu ist
+ technisch bedingt: Ihre IP-Adresse, Datum und Uhrzeit des Abrufs
+
+
Zweck: Bereitstellung der Aktualisierung und Prüfung der Lizenz.
+
Nicht übertragen werden Inhalte aus diesem Programm: keine Dokumente, keine Datenbank, keine Eingaben. Die Verbindung ist verschlüsselt.
+
+
+
+
+ {{-- Lizenz --}}
+
+
+ @if ($licenseError || $licenseStatusError)
+
+ @endif
+
+ @if ($licenseSummary)
+ @if ($licenseSummary['expires_soon'])
+
+ @endif
+
+
+ Registriert auf {{ collect([$licenseSummary['registered_to']['company'] ?? null, $licenseSummary['registered_to']['contact_name'] ?? null])->filter()->implode(' · ') ?: '–' }}
+ Laufzeit
+ @if ($licenseSummary['unlimited'])
+ unbefristet
+ @elseif ($licenseSummary['expired'])
+ abgelaufen
+ @elseif ($licenseSummary['valid_until'])
+ bis {{ \Illuminate\Support\Carbon::parse($licenseSummary['valid_until'])->format('d.m.Y') }}@if ($licenseSummary['days_remaining'] !== null) (noch {{ $licenseSummary['days_remaining'] }} Tage)@endif
+ @else
+ –
+ @endif
+
+ Geräteplätze {{ $licenseSummary['devices']['used'] ?? '?' }} von {{ $licenseSummary['devices']['max'] ?? '?' }} belegt
+ Diese Installation {{ $deviceLabel }}
+
+ @endif
+
+
+
+
+
+ {{-- Migrationen --}}
+
+
+
+ Migrationen ausführen
+
+
+
+ @foreach ($migrations as $migration)
+
+ {{ $migration['name'] }}
+
+ {{ $migration['ran'] ? 'angewendet' : 'offen' }}
+
+
+ @endforeach
+
+
+
+
+ {{-- Änderungsprotokoll --}}
+
+ @forelse ($changelog as $section)
+
+
Version {{ $section['heading'] }}
+
{!! $section['html'] !!}
+
+ @empty
+ Kein Änderungsprotokoll vorhanden.
+ @endforelse
+
+
+
+
diff --git a/resources/views/install/account.blade.php b/resources/views/install/account.blade.php
new file mode 100644
index 00000000..fd1c4126
--- /dev/null
+++ b/resources/views/install/account.blade.php
@@ -0,0 +1,55 @@
+@extends('install.layout', ['step' => 3])
+
+@section('content')
+ Portal und Administrator
+ Mit diesem Konto verwalten Sie das Portal. Weitere Personen legen Sie später im Admin-Bereich an oder binden Ihren Identity Provider an.
+
+
+@endsection
diff --git a/resources/views/install/database.blade.php b/resources/views/install/database.blade.php
new file mode 100644
index 00000000..7cb01d7a
--- /dev/null
+++ b/resources/views/install/database.blade.php
@@ -0,0 +1,38 @@
+@extends('install.layout', ['step' => 2])
+
+@section('content')
+ Datenbank
+ Die Zugangsdaten finden Sie in der Verwaltung Ihres Hosters. Die Datenbank muss dort bereits angelegt sein (MySQL ab 8.0 oder MariaDB ab 10.6).
+
+
+@endsection
diff --git a/resources/views/install/layout.blade.php b/resources/views/install/layout.blade.php
new file mode 100644
index 00000000..4a12a3ae
--- /dev/null
+++ b/resources/views/install/layout.blade.php
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+ Einrichtung
+
+
+
+
+
+ $step === 1])>1 Systemprüfung
+ $step === 2])>2 Datenbank
+ $step === 3])>3 Administrator
+
+
+ @yield('content')
+
+
+
+
diff --git a/resources/views/install/requirements.blade.php b/resources/views/install/requirements.blade.php
new file mode 100644
index 00000000..321aa48d
--- /dev/null
+++ b/resources/views/install/requirements.blade.php
@@ -0,0 +1,21 @@
+@extends('install.layout', ['step' => 1])
+
+@section('content')
+ Willkommen
+ In drei Schritten ist Ihr Mitarbeiterportal eingerichtet. Zuerst prüfen wir, ob der Server alles Nötige mitbringt.
+
+ @foreach ($checks as $check)
+
+
$check['status'] === 'ok', 'warning' => $check['status'] === 'warning', 'error-dot' => $check['status'] === 'error'])>
+
{{ $check['label'] }} {{ $check['message'] }}
+
+ @endforeach
+
+ @unless ($envWritable)
+ Die Konfigurationsdatei .env fehlt oder ist nicht beschreibbar. Bitte Schreibrechte für das Installationsverzeichnis vergeben.
+ @endunless
+
+
+@endsection
diff --git a/resources/views/maintenance.blade.php b/resources/views/maintenance.blade.php
new file mode 100644
index 00000000..51a2b223
--- /dev/null
+++ b/resources/views/maintenance.blade.php
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+ Wartung
+
+
+
+
+
+ Das Portal wird gerade aktualisiert
+ Das dauert meist nur wenige Minuten. Diese Seite lädt sich automatisch neu.
+
+
+
diff --git a/routes/console.php b/routes/console.php
index 3c9adf1a..c6ffc302 100644
--- a/routes/console.php
+++ b/routes/console.php
@@ -1,8 +1,26 @@
comment(Inspiring::quote());
-})->purpose('Display an inspiring quote');
+/*
+| Geplante Aufgaben. Ausgelöst per Cron, Web-Cron oder Pseudo-Cron (App\Support\BackgroundTasks).
+*/
+
+// Lebenszeichen des echten Crons. Web-Cron und Pseudo-Cron vermerken sich selbst.
+Schedule::call(fn () => app(BackgroundTasks::class)->heartbeat('cron'))
+ ->everyMinute()
+ ->name('heartbeat')
+ ->when(fn () => app()->runningInConsole());
+
+Schedule::call(fn () => app(FeedbackOutbox::class)->processDue())
+ ->everyMinute()
+ ->name('feedback-outbox')
+ ->withoutOverlapping(10);
+
+// Aufträge der Datenbank-Queue in kurzen Häppchen abarbeiten (kein Dauerprozess nötig).
+Schedule::command('queue:work --stop-when-empty --max-time=40 --tries=3')
+ ->everyMinute()
+ ->name('queue')
+ ->withoutOverlapping(5);
diff --git a/routes/web.php b/routes/web.php
index 14c44948..8ace813c 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -1,12 +1,27 @@
middleware('throttle:30,1')->group(function () {
+ Route::get('/', [InstallController::class, 'requirements']);
+ Route::get('/datenbank', [InstallController::class, 'database']);
+ Route::post('/datenbank', [InstallController::class, 'saveDatabase']);
+ Route::get('/konto', [InstallController::class, 'account']);
+ Route::post('/konto', [InstallController::class, 'saveAccount']);
+});
+
+// Web-Cron für Hoster ohne Cron (siehe App\Support\BackgroundTasks).
+Route::get('/cron/{token}', CronController::class)->middleware('throttle:10,1')->name('cron');
+
// Login, Logout und Passwort-Reset stellt Laravel Fortify bereit (FortifyServiceProvider).
Route::middleware('auth')->group(function () {
@@ -29,3 +44,12 @@ Route::middleware('auth')->group(function () {
Route::delete('/profil/bild', [ProfileController::class, 'destroyAvatar'])->name('profile.avatar.destroy');
Route::put('/profil/darstellung', [ProfileController::class, 'updateTheme'])->name('profile.theme.update');
});
+
+// Self-Updater (docs/specs/self-updater.md) – nur für Administratoren, CSRF über die web-Gruppe.
+Route::middleware(['auth', 'can:admin'])->prefix('admin/update')->name('admin.update.')->group(function () {
+ Route::post('/check', [UpdateController::class, 'check'])->name('check');
+ Route::post('/install', [UpdateController::class, 'install'])->name('install');
+ Route::get('/progress', [UpdateController::class, 'progress'])->name('progress');
+ Route::post('/channel', [UpdateController::class, 'channel'])->name('channel');
+ Route::post('/migrations', [UpdateController::class, 'migrations'])->name('migrations');
+});
diff --git a/storage/.background.lock b/storage/.background.lock
new file mode 100644
index 00000000..e69de29b
diff --git a/storage/.migrations-fingerprint b/storage/.migrations-fingerprint
new file mode 100644
index 00000000..87e60f11
--- /dev/null
+++ b/storage/.migrations-fingerprint
@@ -0,0 +1 @@
+e880d7878d8f731b6539839a9721d2bff91c425b
\ No newline at end of file
diff --git a/tests/Feature/BackgroundTasksTest.php b/tests/Feature/BackgroundTasksTest.php
new file mode 100644
index 00000000..d9891d38
--- /dev/null
+++ b/tests/Feature/BackgroundTasksTest.php
@@ -0,0 +1,53 @@
+webCronToken();
+
+ $this->assertSame(40, strlen($token));
+ $this->get('/cron/falsch')->assertNotFound();
+ $this->get("/cron/{$token}")->assertNoContent();
+
+ $this->assertArrayHasKey('webcron', app(BackgroundTasks::class)->heartbeats());
+ }
+
+ public function test_pseudo_cron_only_steps_in_without_external_cron(): void
+ {
+ $tasks = app(BackgroundTasks::class);
+
+ $this->assertTrue($tasks->pseudoCronDue());
+
+ $tasks->heartbeat('cron');
+ $this->assertFalse($tasks->pseudoCronDue());
+
+ $this->travel(BackgroundTasks::PSEUDO_CRON_AFTER_SECONDS + 5)->seconds();
+ $this->assertTrue($tasks->pseudoCronDue());
+
+ $tasks->heartbeat('pseudo');
+ $this->assertFalse($tasks->pseudoCronDue(), 'Höchstens einmal pro Minute.');
+ }
+}
diff --git a/tests/Feature/Feedback/FeedbackTest.php b/tests/Feature/Feedback/FeedbackTest.php
new file mode 100644
index 00000000..fc1d4c75
--- /dev/null
+++ b/tests/Feature/Feedback/FeedbackTest.php
@@ -0,0 +1,274 @@
+dir = sys_get_temp_dir().'/inhaus-fb-'.bin2hex(random_bytes(4));
+ mkdir($this->dir);
+ $this->app->instance(LicenseStore::class, new LicenseStore($this->dir.'/license.json'));
+ $this->app->instance(InstalledVersion::class, new InstalledVersion($this->dir.'/.version'));
+ app(InstalledVersion::class)->save(str_repeat('9', 40));
+ Cache::put('feedback.endpoints', ['bugreport', 'featurerequest', 'telemetry'], 60);
+ }
+
+ protected function tearDown(): void
+ {
+ Filesystem::deleteDirectory($this->dir);
+
+ parent::tearDown();
+ }
+
+ /**
+ * @return array
+ */
+ private function payload(): array
+ {
+ return ['title' => 'Export bricht ab', 'body' => 'Ab etwa 5000 Zeilen passiert nichts mehr.', 'severity' => 'high'];
+ }
+
+ public function test_request_body_and_headers_with_license(): void
+ {
+ app(LicenseStore::class)->setLicense('lizenz@firma.de', 'KEY-1');
+ Http::fake([self::URL => Http::response(['ok' => true, 'reference' => 'BUG-8F3K2Q', 'id' => 'x'], 201)]);
+ $user = User::factory()->admin()->create();
+ $this->actingAs($user);
+
+ Livewire::test(Feedback::class)
+ ->set('type', 'bugreport')
+ ->set('subject', 'Export bricht ab')
+ ->set('body', 'Ab etwa 5000 Zeilen passiert nichts mehr.')
+ ->set('severity', 'high')
+ ->set('email', 'rueckfrage@firma.de')
+ ->call('submit')
+ ->assertHasNoErrors()
+ ->assertSet('lastReference', 'BUG-8F3K2Q')
+ ->assertSet('subject', '')
+ ->assertSee('BUG-8F3K2Q');
+
+ Http::assertSent(function (Request $request) {
+ $data = $request->data();
+
+ return $request->url() === self::URL
+ && $request->method() === 'POST'
+ && $request->hasHeader('X-License-Email', 'lizenz@firma.de')
+ && $request->hasHeader('Authorization', 'Bearer KEY-1')
+ && strlen($request->header('Idempotency-Key')[0]) === 32
+ && $data['title'] === 'Export bricht ab'
+ && $data['email'] === 'rueckfrage@firma.de'
+ && $data['severity'] === 'high'
+ && $data['app_version'] === Version::VERSION
+ && $data['current_sha'] === str_repeat('9', 40)
+ && $data['os'] !== ''
+ && isset($data['metadata']['php'])
+ && ! isset($data['name']);
+ });
+
+ $feedback = VendorFeedback::query()->sole();
+ $this->assertSame('sent', $feedback->status);
+ $this->assertSame('BUG-8F3K2Q', $feedback->reference);
+ }
+
+ public function test_no_license_headers_without_license(): void
+ {
+ Http::fake([self::URL => Http::response(['ok' => true, 'reference' => 'BUG-1'], 201)]);
+
+ app(FeedbackOutbox::class)->submit(null, 'bugreport', $this->payload());
+
+ Http::assertSent(fn (Request $request) => ! $request->hasHeader('X-License-Email')
+ && ! $request->hasHeader('Authorization')
+ && ! $request->hasHeader('X-Device-Id'));
+ }
+
+ public function test_expired_license_does_not_prevent_sending(): void
+ {
+ app(LicenseStore::class)->setLicense('lizenz@firma.de', 'ABGELAUFEN');
+ app(LicenseStore::class)->rememberStatus(null, 'license_expired');
+ Http::fake([self::URL => Http::response(['ok' => true, 'reference' => 'BUG-2'], 201)]);
+
+ $result = app(FeedbackOutbox::class)->submit(null, 'bugreport', $this->payload());
+
+ $this->assertSame(FeedbackResult::SENT, $result->status);
+ Http::assertSentCount(1);
+ }
+
+ public function test_422_shows_error_on_field_and_keeps_input(): void
+ {
+ Http::fake([self::URL => Http::response(['code' => 'validation_failed', 'errors' => ['title' => ['Der Betreff ist zu lang.']]], 422)]);
+ $this->actingAs(User::factory()->admin()->create());
+
+ Livewire::test(Feedback::class)
+ ->set('type', 'bugreport')
+ ->set('subject', 'Betreff')
+ ->set('body', 'Eine ausreichend lange Beschreibung.')
+ ->call('submit')
+ ->assertHasErrors(['subject'])
+ ->assertSet('subject', 'Betreff')
+ ->assertSet('body', 'Eine ausreichend lange Beschreibung.');
+
+ $this->assertSame(0, VendorFeedback::query()->count());
+ }
+
+ public function test_429_names_the_waiting_time_and_keeps_input(): void
+ {
+ Http::fake([self::URL => Http::response(['code' => 'rate_limited'], 429, ['Retry-After' => '600'])]);
+ $this->actingAs(User::factory()->admin()->create());
+
+ Livewire::test(Feedback::class)
+ ->set('type', 'bugreport')
+ ->set('subject', 'Betreff')
+ ->set('body', 'Eine ausreichend lange Beschreibung.')
+ ->call('submit')
+ ->assertSet('notice', fn (string $notice) => str_contains($notice, 'in etwa 10 Minute(n)'))
+ ->assertSet('body', 'Eine ausreichend lange Beschreibung.');
+
+ Http::assertSentCount(1);
+ $this->assertSame(0, VendorFeedback::query()->count());
+ }
+
+ public function test_404_hides_the_channel_permanently(): void
+ {
+ Http::fake([self::URL => Http::response(['code' => 'not_found'], 404)]);
+ $this->actingAs(User::factory()->admin()->create());
+
+ Livewire::test(Feedback::class)
+ ->set('type', 'bugreport')
+ ->set('subject', 'Betreff')
+ ->set('body', 'Eine ausreichend lange Beschreibung.')
+ ->call('submit')
+ ->assertSet('type', 'featurerequest')
+ ->assertSet('body', 'Eine ausreichend lange Beschreibung.');
+
+ $this->assertSame(['featurerequest' => 'Funktionswunsch'], app(FeedbackChannels::class)->available());
+ }
+
+ public function test_only_enabled_channels_are_offered(): void
+ {
+ Cache::put('feedback.endpoints', ['featurerequest', 'telemetry'], 60);
+
+ $this->assertSame(['featurerequest' => 'Funktionswunsch'], app(FeedbackChannels::class)->available());
+ }
+
+ public function test_channels_are_read_from_software_list(): void
+ {
+ Cache::forget('feedback.endpoints');
+ Http::fake(['api.loheide.cloud/v1/software' => Http::response(['software' => [
+ ['slug' => 'andere', 'endpoints' => ['bugreport']],
+ ['slug' => 'mitarbeiterportal', 'endpoints' => ['bugreport', 'telemetry']],
+ ]])]);
+
+ $this->assertSame(['bugreport' => 'Fehlerbericht'], app(FeedbackChannels::class)->available());
+ }
+
+ public function test_503_queues_and_retries_with_same_idempotency_key(): void
+ {
+ Http::fakeSequence(self::URL)
+ ->push(['code' => 'maintenance'], 503)
+ ->push(['code' => 'maintenance'], 503)
+ ->push(['ok' => true, 'reference' => 'BUG-SPAET'], 201);
+
+ $result = app(FeedbackOutbox::class)->submit(null, 'bugreport', $this->payload());
+ $this->assertSame(FeedbackResult::RETRY, $result->status);
+
+ $feedback = VendorFeedback::query()->sole();
+ $this->assertSame('pending', $feedback->status);
+ $this->assertSame(1, $feedback->attempts);
+
+ // Noch nicht fällig.
+ $this->assertSame(0, app(FeedbackOutbox::class)->processDue());
+
+ $this->travel(2)->minutes();
+ app(FeedbackOutbox::class)->processDue();
+ $this->travel(10)->minutes();
+ app(FeedbackOutbox::class)->processDue();
+
+ $feedback->refresh();
+ $this->assertSame('sent', $feedback->status);
+ $this->assertSame('BUG-SPAET', $feedback->reference);
+
+ $keys = collect(Http::recorded())->map(fn ($pair) => $pair[0]->header('Idempotency-Key')[0])->unique();
+ $this->assertCount(1, $keys, 'Wiederholungen müssen denselben Idempotency-Key senden.');
+ }
+
+ public function test_gives_up_after_five_attempts_and_informs_the_user(): void
+ {
+ Http::fake([self::URL => Http::response('', 503)]);
+ $user = User::factory()->admin()->create();
+
+ app(FeedbackOutbox::class)->submit($user, 'bugreport', $this->payload());
+
+ for ($i = 0; $i < 6; $i++) {
+ $this->travel(2)->hours();
+ app(FeedbackOutbox::class)->processDue();
+ }
+
+ $feedback = VendorFeedback::query()->sole();
+ $this->assertSame('discarded', $feedback->status);
+ $this->assertSame(5, $feedback->attempts);
+ Http::assertSentCount(5);
+ $this->assertSame(1, $user->notifications()->count());
+ }
+
+ public function test_network_failure_is_queued(): void
+ {
+ Http::fake([self::URL => fn () => throw new ConnectionException('offline')]);
+
+ $result = app(FeedbackOutbox::class)->submit(null, 'bugreport', $this->payload());
+
+ $this->assertSame(FeedbackResult::RETRY, $result->status);
+ $this->assertSame('pending', VendorFeedback::query()->sole()->status);
+ }
+
+ public function test_409_is_not_shown_as_error_but_retried(): void
+ {
+ Http::fake([self::URL => Http::response(['code' => 'in_progress'], 409)]);
+
+ $result = app(FeedbackOutbox::class)->submit(null, 'bugreport', $this->payload());
+
+ $this->assertSame(FeedbackResult::RETRY, $result->status);
+ $this->assertTrue(VendorFeedback::query()->sole()->next_attempt_at->isFuture());
+ }
+
+ public function test_page_shows_technical_info_and_privacy_notice_and_is_admin_only(): void
+ {
+ $this->actingAs(User::factory()->create())->get('/admin/rueckmeldung')->assertForbidden();
+
+ $this->actingAs(User::factory()->admin()->create())
+ ->get('/admin/rueckmeldung')
+ ->assertOk()
+ ->assertSee('Diese technischen Angaben werden mitgesendet')
+ ->assertSee(Version::VERSION)
+ ->assertSee(str_repeat('9', 40))
+ ->assertSee('Mit dem Absenden werden Daten an api.loheide.cloud übertragen.')
+ ->assertDontSee('die von Ihnen angehängten Dateien')
+ ->assertDontSee('Ihre Lizenzdaten, damit die Meldung');
+ }
+}
diff --git a/tests/Feature/InstallerTest.php b/tests/Feature/InstallerTest.php
new file mode 100644
index 00000000..5c7a423a
--- /dev/null
+++ b/tests/Feature/InstallerTest.php
@@ -0,0 +1,117 @@
+dir = sys_get_temp_dir().'/inhaus-inst-'.bin2hex(random_bytes(4));
+ mkdir($this->dir);
+ copy(base_path('.env.example'), $this->dir.'/.env');
+ $this->app->useEnvironmentPath($this->dir);
+ $this->app->instance(LicenseStore::class, new LicenseStore($this->dir.'/license.json'));
+ config(['inhaus.installed' => false]);
+ }
+
+ protected function tearDown(): void
+ {
+ @unlink(storage_path('.installed'));
+ Filesystem::deleteDirectory($this->dir);
+
+ parent::tearDown();
+ }
+
+ public function test_every_page_leads_to_the_installer(): void
+ {
+ $this->get('/')->assertRedirect('/install');
+ $this->get('/login')->assertRedirect('/install');
+ $this->get('/install')->assertOk()->assertSee('Systemprüfung')->assertSee('PHP-Version');
+ }
+
+ public function test_wrong_database_credentials_are_explained(): void
+ {
+ $this->post('/install/datenbank', [
+ 'host' => config('database.connections.mysql.host'),
+ 'port' => config('database.connections.mysql.port'),
+ 'database' => config('database.connections.mysql.database'),
+ 'username' => 'gibtesnicht',
+ 'password' => 'falsch',
+ ])->assertSessionHasErrors(['host' => 'Verbindung fehlgeschlagen: Benutzername oder Passwort sind falsch, oder der Benutzer hat keinen Zugriff auf diese Datenbank.']);
+ }
+
+ public function test_database_settings_are_written_to_env(): void
+ {
+ $this->post('/install/datenbank', [
+ 'host' => config('database.connections.mysql.host'),
+ 'port' => config('database.connections.mysql.port'),
+ 'database' => config('database.connections.mysql.database'),
+ 'username' => config('database.connections.mysql.username'),
+ 'password' => config('database.connections.mysql.password'),
+ ])->assertRedirect('/install/konto');
+
+ $env = file_get_contents($this->dir.'/.env');
+ $this->assertStringContainsString('DB_DATABASE='.config('database.connections.mysql.database'), $env);
+ $this->assertStringContainsString('DB_USERNAME='.config('database.connections.mysql.username'), $env);
+ $this->assertStringContainsString('APP_URL='.url('/'), $env);
+ }
+
+ public function test_account_step_completes_the_installation(): void
+ {
+ $this->post('/install/konto', [
+ 'portal_name' => 'Caritas-Netz',
+ 'first_name' => 'Ada',
+ 'last_name' => 'Admin',
+ 'email' => 'Ada@Example.com',
+ 'password' => 'SicheresPasswort1',
+ 'password_confirmation' => 'SicheresPasswort1',
+ 'license_email' => 'lizenz@example.com',
+ 'license_key' => 'KEY-123',
+ ])->assertRedirect('/login?eingerichtet=1');
+
+ $admin = User::query()->where('email', 'ada@example.com')->sole();
+ $this->assertTrue($admin->is_admin);
+ $this->assertSame('Ada Admin', $admin->name);
+ $this->assertSame('Caritas-Netz', app(Settings::class)->get('branding.portal_name'));
+ $this->assertSame('KEY-123', app(LicenseStore::class)->key());
+ $this->assertFileExists(storage_path('.installed'));
+
+ config(['inhaus.installed' => null]);
+ $this->assertTrue(Installation::isInstalled());
+ $this->get('/install')->assertNotFound();
+ $this->get('/login?eingerichtet=1')->assertInertia(fn ($page) => $page
+ ->where('status', 'Die Einrichtung ist abgeschlossen. Sie können sich jetzt mit Ihrem Administratorkonto anmelden.'));
+ }
+
+ public function test_weak_admin_password_is_rejected(): void
+ {
+ $this->post('/install/konto', [
+ 'portal_name' => 'Portal', 'first_name' => 'A', 'last_name' => 'B', 'email' => 'a@example.com',
+ 'password' => 'kurz', 'password_confirmation' => 'kurz',
+ ])->assertSessionHasErrors('password');
+
+ $this->assertFileDoesNotExist(storage_path('.installed'));
+ }
+
+ public function test_installer_is_gone_once_installed(): void
+ {
+ config(['inhaus.installed' => true]);
+
+ $this->get('/install')->assertNotFound();
+ $this->post('/install/konto', [])->assertNotFound();
+ }
+}
diff --git a/tests/Feature/SiteHealthTest.php b/tests/Feature/SiteHealthTest.php
new file mode 100644
index 00000000..9e0e6afb
--- /dev/null
+++ b/tests/Feature/SiteHealthTest.php
@@ -0,0 +1,42 @@
+requirements();
+
+ foreach ($requirements as $check) {
+ $this->assertNotSame(SiteHealth::ERROR, $check['status'], $check['label'].': '.$check['message']);
+ }
+ }
+
+ public function test_page_shows_checks_and_cron_setup(): void
+ {
+ $this->actingAs(User::factory()->create())->get('/admin/systemzustand')->assertForbidden();
+
+ $this->actingAs(User::factory()->admin()->create())
+ ->get('/admin/systemzustand')
+ ->assertOk()
+ ->assertSee('PHP-Version')
+ ->assertSee('Hintergrundaufgaben')
+ ->assertSee('php artisan schedule:run')
+ ->assertSee('/cron/');
+ }
+
+ public function test_byte_values_are_parsed(): void
+ {
+ $this->assertSame(128 * 1024 ** 2, SiteHealth::bytes('128M'));
+ $this->assertSame(2 * 1024 ** 3, SiteHealth::bytes('2G'));
+ $this->assertSame(-1, SiteHealth::bytes('-1'));
+ }
+}
diff --git a/tests/Feature/Update/ArchiveTest.php b/tests/Feature/Update/ArchiveTest.php
new file mode 100644
index 00000000..2a5a4f7f
--- /dev/null
+++ b/tests/Feature/Update/ArchiveTest.php
@@ -0,0 +1,148 @@
+dir = sys_get_temp_dir().'/inhaus-zip-'.bin2hex(random_bytes(4));
+ mkdir($this->dir);
+ }
+
+ protected function tearDown(): void
+ {
+ Filesystem::deleteDirectory($this->dir);
+
+ parent::tearDown();
+ }
+
+ /**
+ * @param array $files
+ */
+ private function zip(array $files): string
+ {
+ $path = $this->dir.'/archiv.zip';
+ $zip = new ZipArchive;
+ $zip->open($path, ZipArchive::CREATE | ZipArchive::OVERWRITE);
+
+ foreach ($files as $name => $contents) {
+ $zip->addFromString($name, $contents);
+ }
+
+ $zip->close();
+
+ return $path;
+ }
+
+ public function test_common_top_level_folder_is_stripped(): void
+ {
+ $zip = $this->zip([
+ 'repo-abc/app/Version.php' => ' 'Hallo',
+ ]);
+
+ $count = (new ZipExtractor)->extract($zip, $this->dir.'/staging');
+
+ $this->assertSame(2, $count);
+ $this->assertFileExists($this->dir.'/staging/app/Version.php');
+ $this->assertFileExists($this->dir.'/staging/README.md');
+ }
+
+ public function test_zip_slip_creates_nothing_outside_staging(): void
+ {
+ $zip = $this->zip([
+ 'repo-abc/ok.txt' => 'ok',
+ 'repo-abc/../../evil.php' => 'extract($zip, $this->dir.'/staging');
+ $this->fail('Das Archiv hätte abgelehnt werden müssen.');
+ } catch (RuntimeException $e) {
+ $this->assertStringContainsString('Unsicherer Pfad', $e->getMessage());
+ }
+
+ $this->assertFileDoesNotExist($this->dir.'/evil.php');
+ $this->assertFileDoesNotExist(dirname($this->dir).'/evil.php');
+ $this->assertFileDoesNotExist($this->dir.'/staging/../evil.php');
+ }
+
+ public function test_dangerous_entry_names_are_rejected(): void
+ {
+ foreach (['../evil', 'a/../../evil', '/etc/passwd', 'C:\\Windows\\evil.dll', "a\0b", '..\\evil'] as $name) {
+ $this->assertFalse(ZipExtractor::isSafeEntryName($name), $name);
+ }
+
+ foreach (['app/Version.php', 'repo-abc/public/.htaccess', 'a/..b/c'] as $name) {
+ $this->assertTrue(ZipExtractor::isSafeEntryName($name), $name);
+ }
+ }
+
+ public function test_protected_paths_are_skipped_and_nothing_is_deleted(): void
+ {
+ $staging = $this->dir.'/staging';
+ $target = $this->dir.'/target';
+
+ foreach ([
+ 'app/Neu.php' => 'neu',
+ 'app/Version.php' => 'neue Version',
+ '.env' => 'APP_KEY=aus-dem-archiv',
+ 'storage/app/license.json' => '{}',
+ 'public/uploads/bild.jpg' => 'fremd',
+ 'plugins/kunde/plugin.json' => '{}',
+ 'vendor/autoload.php' => 'neu',
+ ] as $file => $contents) {
+ @mkdir(dirname("{$staging}/{$file}"), 0777, true);
+ file_put_contents("{$staging}/{$file}", $contents);
+ }
+
+ foreach ([
+ 'app/Version.php' => 'alte Version',
+ 'app/Alt.php' => 'bleibt',
+ '.env' => 'APP_KEY=geheim',
+ 'storage/app/license.json' => '{"email":"lizenz@example.com"}',
+ ] as $file => $contents) {
+ @mkdir(dirname("{$target}/{$file}"), 0777, true);
+ file_put_contents("{$target}/{$file}", $contents);
+ }
+
+ $result = (new StagingApplier(new ProtectedPaths(config('updater.protected_paths'))))->apply($staging, $target);
+
+ $this->assertSame(['copied' => 3, 'skipped' => 4], $result);
+ $this->assertSame('neue Version', file_get_contents("{$target}/app/Version.php"));
+ $this->assertSame('neu', file_get_contents("{$target}/app/Neu.php"));
+ $this->assertSame('neu', file_get_contents("{$target}/vendor/autoload.php"));
+ $this->assertSame('bleibt', file_get_contents("{$target}/app/Alt.php"));
+ $this->assertSame('APP_KEY=geheim', file_get_contents("{$target}/.env"));
+ $this->assertSame('{"email":"lizenz@example.com"}', file_get_contents("{$target}/storage/app/license.json"));
+ $this->assertFileDoesNotExist("{$target}/public/uploads/bild.jpg");
+ $this->assertFileDoesNotExist("{$target}/plugins/kunde/plugin.json");
+ $this->assertEmpty(glob("{$target}/app/*.update-*"));
+ }
+
+ public function test_protected_path_matching(): void
+ {
+ $paths = new ProtectedPaths(['.env', 'storage/', 'config/local.php']);
+
+ $this->assertTrue($paths->isProtected('.env'));
+ $this->assertTrue($paths->isProtected('storage'));
+ $this->assertTrue($paths->isProtected('storage/logs/x.log'));
+ $this->assertTrue($paths->isProtected('config/local.php'));
+ $this->assertFalse($paths->isProtected('.env.example'));
+ $this->assertFalse($paths->isProtected('storagebox/a'));
+ $this->assertFalse($paths->isProtected('config/app.php'));
+ }
+}
diff --git a/tests/Feature/Update/LicenseTest.php b/tests/Feature/Update/LicenseTest.php
new file mode 100644
index 00000000..c31c6986
--- /dev/null
+++ b/tests/Feature/Update/LicenseTest.php
@@ -0,0 +1,193 @@
+dir = sys_get_temp_dir().'/inhaus-lic-'.bin2hex(random_bytes(4));
+ mkdir($this->dir);
+ $this->app->instance(LicenseStore::class, new LicenseStore($this->dir.'/license.json'));
+ $this->app->instance(InstalledVersion::class, new InstalledVersion($this->dir.'/.version'));
+ }
+
+ protected function tearDown(): void
+ {
+ Filesystem::deleteDirectory($this->dir);
+
+ parent::tearDown();
+ }
+
+ private function store(): LicenseStore
+ {
+ return app(LicenseStore::class);
+ }
+
+ public function test_device_id_is_created_once_and_kept(): void
+ {
+ $id = $this->store()->deviceId();
+
+ $this->assertMatchesRegularExpression('/^[0-9a-f]{32}$/', $id);
+ $this->assertSame($id, (new LicenseStore($this->dir.'/license.json'))->deviceId());
+ }
+
+ public function test_license_headers_are_sent_with_device_data(): void
+ {
+ $this->store()->setLicense('lizenz@firma.de', 'SCHLUESSEL-123');
+ $this->store()->saveDeviceToken('token-1');
+ Http::fake(['*' => Http::response(['has_update' => false, 'latest_sha' => str_repeat('a', 40)])]);
+
+ app(Channels::class)->client()->check(null);
+
+ Http::assertSent(function (Request $request) {
+ parse_str((string) parse_url($request->url(), PHP_URL_QUERY), $query);
+
+ return $request->hasHeader('X-License-Email', 'lizenz@firma.de')
+ && $request->hasHeader('Authorization', 'Bearer SCHLUESSEL-123')
+ && $request->hasHeader('X-Device-Id', $this->store()->deviceId())
+ && $request->hasHeader('X-Device-Token', 'token-1')
+ && ($query['hostname'] ?? null) === gethostname()
+ && str_contains($query['device_label'] ?? '', base_path())
+ && ($query['app_version'] ?? null) === Version::VERSION
+ && str_starts_with($request->url(), 'https://update.loheide.cloud/mitarbeiterportal/check');
+ });
+ }
+
+ public function test_no_license_headers_without_license(): void
+ {
+ Http::fake(['*' => Http::response(['code' => 'license_required', 'error' => 'x'], 401)]);
+
+ try {
+ app(Channels::class)->client()->version();
+ } catch (ServerError) {
+ }
+
+ Http::assertSent(fn (Request $request) => ! $request->hasHeader('X-License-Email')
+ && ! $request->hasHeader('Authorization')
+ && ! $request->hasHeader('X-Device-Id'));
+ }
+
+ public function test_new_device_token_is_stored_even_on_error_responses(): void
+ {
+ $this->store()->setLicense('lizenz@firma.de', 'SCHLUESSEL');
+
+ Http::fake(['*' => Http::response(['code' => 'license_expired', 'error' => 'abgelaufen'], 403, ['X-Device-Token' => 'rotiert-im-fehler'])]);
+
+ try {
+ app(Channels::class)->client()->check(null);
+ $this->fail('Fehler erwartet.');
+ } catch (ServerError $e) {
+ $this->assertSame('license_expired', $e->errorCode);
+ }
+
+ $this->assertSame('rotiert-im-fehler', (new LicenseStore($this->dir.'/license.json'))->deviceToken());
+ }
+
+ public function test_device_token_from_json_body_is_stored(): void
+ {
+ $this->store()->setLicense('lizenz@firma.de', 'SCHLUESSEL');
+ Http::fake(['*' => Http::response(['sha' => str_repeat('b', 40), 'device_token' => 'aus-dem-json'])]);
+
+ $data = app(Channels::class)->client()->version();
+
+ $this->assertSame(str_repeat('b', 40), $data['sha']);
+ $this->assertSame('aus-dem-json', $this->store()->deviceToken());
+ }
+
+ public function test_device_token_from_download_is_stored(): void
+ {
+ $this->store()->setLicense('lizenz@firma.de', 'SCHLUESSEL');
+ Http::fake(['*' => Http::response('PK...', 200, ['X-Device-Token' => 'vom-download'])]);
+
+ app(Channels::class)->client()->downloadZip(str_repeat('c', 40), $this->dir.'/x.zip');
+
+ $this->assertSame('vom-download', $this->store()->deviceToken());
+ }
+
+ public function test_license_errors_give_messages_and_never_block_the_portal(): void
+ {
+ $admin = User::factory()->admin()->create();
+ $this->store()->setLicense('lizenz@firma.de', 'SCHLUESSEL');
+
+ $code = null;
+ Http::fake(function () use (&$code) {
+ return Http::response(
+ ['code' => $code, 'error' => 'egal', 'devices_used' => 3, 'devices_max' => 3],
+ $code === 'rate_limited' ? 429 : 403,
+ );
+ });
+
+ foreach ([
+ 'license_expired' => 'abgelaufen',
+ 'invalid_key' => 'Lizenzschlüssel ist unbekannt',
+ 'device_limit_reached' => '3 von 3',
+ 'license_revoked' => 'Support',
+ 'device_cloned' => 'kopierten Installation',
+ 'rate_limited' => 'erneut versuchen',
+ ] as $code => $expected) {
+ $response = $this->actingAs($admin)
+ ->postJson('/admin/update/check')
+ ->assertOk()
+ ->assertJson(['ok' => false, 'code' => $code]);
+
+ $this->assertStringContainsString($expected, $response->json('message'));
+
+ // Das Portal bleibt uneingeschränkt nutzbar.
+ $this->actingAs($admin)->get('/')->assertOk();
+ $this->actingAs($admin)->get('/admin')->assertOk();
+ $this->actingAs($admin)->get('/admin/aktualisierung')->assertOk();
+ }
+ }
+
+ public function test_unlimited_license_is_not_treated_as_expired(): void
+ {
+ $this->store()->setLicense('lizenz@firma.de', 'SCHLUESSEL');
+ Http::fake(['*' => Http::response([
+ 'licensing_required' => true,
+ 'license' => ['status' => 'active', 'valid_until' => null, 'unlimited' => true, 'days_remaining' => null, 'expired' => false],
+ 'registered_to' => ['license_email' => 'lizenz@firma.de', 'company' => 'Beispiel GmbH', 'contact_name' => 'Max Muster'],
+ 'devices' => ['used' => 1, 'max' => 2, 'policy' => 'enforce'],
+ ])]);
+
+ app(LicenseService::class)->check();
+ $summary = app(LicenseService::class)->summary();
+
+ $this->assertTrue($summary['unlimited']);
+ $this->assertFalse($summary['expired']);
+ $this->assertFalse($summary['expires_soon']);
+
+ $this->actingAs(User::factory()->admin()->create())
+ ->get('/admin/aktualisierung')
+ ->assertOk()
+ ->assertSee('unbefristet')
+ ->assertSee('Beispiel GmbH')
+ ->assertSee('1 von 2 belegt');
+ }
+
+ public function test_unknown_channel_is_rejected(): void
+ {
+ $this->expectException(\InvalidArgumentException::class);
+
+ app(Channels::class)->client('nightly');
+ }
+}
diff --git a/tests/Feature/Update/UpdateEndpointsTest.php b/tests/Feature/Update/UpdateEndpointsTest.php
new file mode 100644
index 00000000..2987e3bd
--- /dev/null
+++ b/tests/Feature/Update/UpdateEndpointsTest.php
@@ -0,0 +1,142 @@
+dir = sys_get_temp_dir().'/inhaus-ep-'.bin2hex(random_bytes(4));
+ mkdir($this->dir);
+ $this->app->instance(MaintenanceFlag::class, new MaintenanceFlag($this->dir.'/.maintenance'));
+ $this->app->instance(UpdateProgress::class, new UpdateProgress($this->dir.'/.progress'));
+ $this->app->instance(InstalledVersion::class, new InstalledVersion($this->dir.'/.version'));
+ }
+
+ protected function tearDown(): void
+ {
+ Filesystem::deleteDirectory($this->dir);
+
+ parent::tearDown();
+ }
+
+ public function test_update_endpoints_are_admin_only(): void
+ {
+ $this->postJson('/admin/update/check')->assertUnauthorized();
+
+ $user = User::factory()->create();
+
+ foreach (['check', 'install', 'channel', 'migrations'] as $endpoint) {
+ $this->actingAs($user)->postJson("/admin/update/{$endpoint}")->assertForbidden();
+ }
+
+ $this->actingAs($user)->getJson('/admin/update/progress')->assertForbidden();
+ $this->actingAs($user)->get('/admin/aktualisierung')->assertForbidden();
+ }
+
+ public function test_maintenance_mode_shows_503_but_keeps_update_pages_reachable(): void
+ {
+ $admin = User::factory()->admin()->create();
+ app(MaintenanceFlag::class)->activate(300);
+
+ $this->actingAs($admin)->get('/')
+ ->assertStatus(503)
+ ->assertHeader('Retry-After')
+ ->assertSee('Das Portal wird gerade aktualisiert');
+
+ $this->actingAs($admin)->getJson('/admin/update/progress')->assertOk()->assertJson(['step' => 'idle']);
+ $this->actingAs($admin)->get('/admin/aktualisierung')->assertOk();
+ $this->get('/up')->assertOk();
+
+ app(MaintenanceFlag::class)->deactivate();
+ $this->actingAs($admin)->get('/')->assertOk();
+ }
+
+ public function test_first_check_of_fresh_installation_remembers_latest_sha(): void
+ {
+ Http::fake(['*' => Http::response(['has_update' => false, 'latest_sha' => str_repeat('d', 40), 'version' => '0.2.0'])]);
+
+ $this->actingAs(User::factory()->admin()->create())
+ ->postJson('/admin/update/check')
+ ->assertOk()
+ ->assertJson(['ok' => true, 'result' => ['has_update' => false, 'changelog' => []]]);
+
+ Http::assertSent(fn ($request) => ! str_contains($request->url(), 'current_sha'));
+ $this->assertSame(str_repeat('d', 40), app(InstalledVersion::class)->current());
+ }
+
+ public function test_check_shows_changelog_preview_without_commit_texts(): void
+ {
+ app(InstalledVersion::class)->save(str_repeat('a', 40));
+
+ Http::fake(['*' => Http::response([
+ 'has_update' => true,
+ 'latest_sha' => str_repeat('b', 40),
+ 'version' => '0.3.0',
+ 'versions_behind' => 4,
+ 'changelog_preview' => [
+ 'entries' => [['version' => '0.3.0', 'heading' => '0.3.0', 'text' => "- Neue **Umfragen**\n- "]],
+ 'complete' => false,
+ ],
+ ])]);
+
+ $response = $this->actingAs(User::factory()->admin()->create())
+ ->postJson('/admin/update/check')
+ ->assertOk()
+ ->assertJsonPath('result.has_update', true)
+ ->assertJsonPath('result.version', '0.3.0')
+ ->assertJsonPath('result.latest_short', 'bbbbbbb')
+ ->assertJsonPath('result.versions_behind', 4)
+ ->assertJsonPath('result.changelog_complete', false);
+
+ Http::assertSent(fn ($request) => str_contains($request->url(), 'current_sha='.str_repeat('a', 40)));
+ $this->assertStringContainsString('Umfragen ', $response->json('result.changelog.0.html'));
+ $this->assertStringNotContainsString('
+
+ ## 1.1.3 – Fehlerbehebung
+
+ - Fix
+ MD);
+
+ $this->assertCount(2, $sections);
+ $this->assertSame('1.2.0', $sections[0]['version']);
+ $this->assertSame('1.1.3', $sections[1]['version']);
+ $this->assertSame('1.1.3 – Fehlerbehebung', $sections[1]['heading']);
+ $this->assertStringContainsString('Funktion ', $sections[0]['html']);
+ $this->assertStringNotContainsString('javascript:', $sections[0]['html']);
+ $this->assertStringNotContainsString('