@yongdall/theme 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import{Application as e,ErrorAlerter as t,Ident as n,Menu as r,Page as i,PageIdent as a,PageSider as o,Pattern as s,User as c,createComputed as l,createFrame as u,createIcon as d,createNeverAbortedSignal as f,createShowField as p,createState as m,createTick as h,effect as g,flatPermission as _,isMac as ee,loadNavButtons as v,root as y,toFileLink as b,toPermissionFilter as te,waitAbortSignal as ne,watch as x}from"@yongdall/web";import"@neeloong/components";const S=`YongDallTheme`,C=`${S}-activity`,w=document.createElement(`div`);w.classList.add(C);const re=new Map;let T,ie=!1;function ae(e){ie=e}const oe=e=>{let t=document.createElement(`div`);t.classList.add(`${C}-page`);let n=t.appendChild(document.createElement(`a`));n.classList.add(`${C}-title`),n.href=e.href,n.innerText=e.title;let r=t.appendChild(document.createElement(`button`));r.type=`button`,r.classList.add(`${C}-close`),r.addEventListener(`click`,()=>{e.destroy()});let i={button:t,link:n,next:T};T&&(T.last=i),T=i,re.set(e,i),w.insertBefore(t,ie?null:w.firstChild),g(()=>{n.innerText=e.title},e.signal),g(()=>{n.href=e.href},e.signal),g(()=>{e.current?t.classList.add(`${C}-current`):t.classList.remove(`${C}-current`)},e.signal),g(()=>{e.loading?t.classList.add(`${C}-loading`):t.classList.remove(`${C}-loading`)},e.signal),g(()=>{e.unsaved?t.classList.add(`${C}-unsaved`):t.classList.remove(`${C}-unsaved`)},e.signal),ne(e.signal).then(()=>{let{last:e,next:n}=i;e&&(e.next=n),n&&(n.last=e),T===i&&(T=n),t.remove()})};var E=class{#e;#t;#n;#r;#i=[];#a=document.createElement(`table`);#o=this.#a.appendChild(document.createElement(`thead`));#s=this.#o.appendChild(document.createElement(`tr`));#c=this.#a.appendChild(document.createElement(`tbody`));get root(){return this.#a}get createUrl(){return this.#e}set createUrl(e){let t=typeof e==`function`?e:null;this.#e!==t&&(this.#e=t,this.#l())}constructor(e,t){let n=Object.entries(t.fields).filter(([,{type:e}])=>e&&typeof e!=`object`),r=Object.entries(t.fields).filter(([,e])=>e.primary).map(([e])=>e),i=t.labelPattern||``;this.#n=i,this.#e=typeof e==`function`?e:null,this.#t=n,this.#r=r;let a=this.#s;a.innerHTML=``,a.appendChild(document.createElement(`th`)).appendChild(document.createTextNode(`#`));for(let[e,t]of n)a.appendChild(document.createElement(`th`)).appendChild(document.createTextNode(t.label||e))}#l(){let e=this.#c;e.innerHTML=``;let t=this.#r,n=this.#n,r=this.#t,i=this.#e;for(let a of this.#i){let o=e.appendChild(document.createElement(`tr`)),c=o.appendChild(document.createElement(`td`)),l=s.generate(n,a)||t.map(e=>a[e]).join(`$`);if(i){let e=c.appendChild(document.createElement(`a`));e.href=i(t.map(e=>a[e]).join(`$`)),e.appendChild(document.createTextNode(l))}else c.appendChild(document.createTextNode(l));for(let[e,t]of r){let n=o.appendChild(document.createElement(`td`)),r=p(e,t,{inline:!0},a);n.appendChild(r.root)}}}setData(e){this.#i=e,this.#l()}destroy(){}},D=class{#e;#t;constructor(){let e=document.createElement(`nl-pagination`);e.size=20,e.appendChild(document.createElement(`nl-pagination-value`)).name=`start`,e.appendChild(document.createTextNode(`-`)),e.appendChild(document.createElement(`nl-pagination-value`)).name=`end`,e.appendChild(document.createTextNode(`/`)),e.appendChild(document.createElement(`nl-pagination-value`)).name=`total`,e.appendChild(document.createElement(`nl-pagination-prev`)).innerText=`上一页`,e.appendChild(document.createElement(`nl-pagination-pager`)),e.appendChild(document.createElement(`nl-pagination-next`)).innerText=`下一页`,e.appendChild(document.createElement(`nl-pagination-sizer`));let t=new Set;e.addEventListener(`change`,()=>{for(let e of t)e()}),this.#e=t,this.#t=e}get root(){return this.#t}get size(){return this.#t.size}set size(e){this.#t.size=e}get page(){return this.#t.page}set page(e){this.#t.page=e}get total(){return this.#t.total}set total(e){this.#t.total=e}listen(e){let t=this.#e,n=()=>e(this);return t.add(n),()=>{t.delete(n)}}destroy(){}};function se(e){e.listen(`update`,()=>{let{container:t}=e;t.innerHTML=``})}function*ce(e,t,n){if(!e)return;let r=e.indexOf(`?`),i=r<0?e:e.slice(0,r);if(r>=0&&r+1<e.length)for(let n=e.slice(r).split(`&`);n.length;n.pop()){let e=t.get(`${i}${n.join(`&`)}`);e?.length&&(yield e)}let a=t.get(i);a?.length&&(yield a);let o=n.get(i);o?.length&&(yield o.map(e=>e[0]))}function*le(e,t,r,i,a){if(yield*ce(e,t,r),i)for(let e of[...n.stringifyPaths(i)].reverse()){let t=a.get(e);t?.length&&(yield t)}}function*ue(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let e;e=t.nextNode();)yield e}function de(e,t){let n=[],r=[...ue(t)].filter(e=>e.nodeValue?.length),i=r.reduce((e,t)=>{let n=e[e.length-1]?.[1]||0;return[...e,[n,n+(t.nodeValue?.length||0),t]]},[]),a=r.map(e=>e.nodeValue).join(``),o=0;for(let t of e){let e=a.indexOf(t,o);if(e===-1)return[];let r=e+t.length,s=i.findLast(([t])=>t<=e);if(!s)return[];let c=i.findLast(([,e])=>e>=r);if(!c)return[];o=e+t.length;let l=new Range;l.setStart(s[2],e-s[0]),l.setEnd(c[2],r-s[0]),n.push(l)}return n}function fe(t,r,i={}){let o=new Map,s=new Map,c=new Map,l=null,u=[],d=[];function p(t,r){let i=document.createElement(`a`),l=i;i.appendChild(document.createTextNode(t.label||t.title||``)),i.title=t.title||``;let{page:u,path:d,uri:f,target:p}=t,m=null,g=u&&n.parse(u);if(g)m=new URL(a.stringify(g,d),e.root),i.href=m.href,p&&typeof p==`string`&&(i.target=p);else if(f){i.href=f;try{m=new URL(f),m.origin!==location.origin&&(m=null)}catch{}p!==``&&(i.target=p??`_blank`)}if(m&&(i.target||`_self`)===`_self`){i.addEventListener(`click`,()=>{h=l,requestIdleCallback(()=>{h===l&&(h=null)})});let{pathname:e,search:t}=m,r=`${e}${t}`,a=s.get(r);a?a.push(l):s.set(e,[l]);let u=o.get(r);if(u?u.push([l,t.length]):o.set(e,[[l,t.length]]),g&&(!d||d[0]===`?`||d[0]===`#`)){let e=n.stringify(g),t=c.get(e);t?t.push(l):c.set(e,[l])}}return i}function m(e){let t=p(e);return t.classList.add(`NavMenu-button`),t}let h=null;function g(e,t){let{children:n}=e;if(!n.length){let t=document.createElement(`div`),n=t.appendChild(p(e,t));for(let n of e.buttons||[])t.appendChild(m(n));return t.classList.add(`NavMenu-item`),n.classList.add(`NavMenu-item-link`),{el:t,filter(e,r){let i=r?de(r,n):[];return t.hidden=!!(!e&&r&&!i.length),i}}}let r=document.createElement(`nl-collapse`);r.setAttribute(`animation`,``),r.setAttribute(`menu`,``);let i=r.appendChild(document.createElement(`div`));i.appendChild(document.createTextNode(e.label||e.title||``)),i.className=`NavMenu-label`,i.slot=`label`,i.style.flex=`1`;for(let t of e.buttons||[])r.appendChild(m(t)).slot=`label`;let a=_(r,n,t+1);return a.length?{el:r,filter(e,t){if(!t){for(let t of a)t.filter(e);return r.hidden=!1,r.open=!1,[]}let n=de(t,i),o=!!(e||n.length),s=a.flatMap(e=>e.filter(o,t));r.open=!!s.length;let c=[...n,...s];return r.hidden=!e&&!c.length,c}}:null}function _(e,t,n){let r=!1,i=!1,a=[];for(let o of t){if(!o){if(!r)continue;i=!0;continue}i&&(i=!1,e.appendChild(document.createElement(`hr`)));let t=g(o,n);t&&(a.push(t),r=!0,e.appendChild(t.el),u.push(t.el),t.el.style.setProperty(`--NavMenu-level`,String(n)))}return a}let ee=_(t,r,0),v=!1;function y(){if(!v){v=!0;for(let e of u)e.remove();for(let e of d)e()}}let b=i.signal||f();b.aborted?y():b.addEventListener(`abort`,y,{once:!0});let te=[];return x(()=>{let e=i.active;return e?typeof e==`string`?e.replace(/#.*/,``)||``:Array.isArray(e)?e[1]?[e[0]?.replace(/#.*/,``)||``,e[1]||null]:e[0]?.replace(/#.*/,``)||null:null:null},e=>{if(!e)return;let n=Array.isArray(e)?e[0]:``,r=Array.isArray(e)?e[1]:null;for(let e of le(n,s,o,r,c)){let n=h&&e.includes(h)?h:null;if(n&&(h=null),!n&&l&&e.includes(l))return;let r=n||e[0],i=[],a=r.parentElement;for(;a&&a!==t;a=a.parentElement)i.push(a);if(a!==t)return;te=i,l?.classList.remove(`NavMenu-current`);for(let e of te)e.setAttribute(`open`,``);l=r,l?.classList.add(`NavMenu-current`);return}},{signal:b,immediate:!0}),e=>{let t=e.toLowerCase().split(/[\s\n]+/).filter(Boolean);if(t.length)return ee.flatMap(e=>e.filter(!1,t));ee.flatMap(e=>e.filter(!1));for(let e of te)e.setAttribute(`open`,``);return[]}}const O=document.createElement(`div`);O.style.display=`flex`,O.style.flexDirection=`column`;const pe=O.appendChild(document.createElement(`header`));pe.classList.add(`NavMenu-header`);const k=pe.appendChild(document.createElement(`input`));k.placeholder=`过滤菜单...`,k.type=`search`;const A=pe.appendChild(document.createElement(`button`));A.appendChild(d(`refresh`,!0)),A.classList.add(`icon`),A.title=`刷新`;const j=O.appendChild(document.createElement(`main`));j.style.flex=`1`,j.style.overflow=`auto`,j.classList.add(`NavMenu`);let me=null;function he(){let e=me?.(k.value)||[],t=new Highlight(...e);CSS.highlights.set(`NavMenu-filter-highlight`,t)}k.addEventListener(`input`,he);const ge=l(()=>r.fromDefine(e.menus,[])),_e=l(()=>{let e=c.permissions,t=ge.get();if(e.size<0)return t;let n=te({permissions:e,organizationPermissions:c.organizationPermissions,allOrganizationPermissions:c.allOrganizationPermissions});return r.filter(t,e=>{let t=_(e.permission);return!t.length||!!t.find(n)})}),ve=m(``);let ye=null;g(()=>{ye?.abort(),j.innerHTML=``,ye=new AbortController,me=fe(j,_e.get(),{signal:ye.signal,get active(){return ve.get()}}),he()});function M(e,t,n,r){if(!r){ve.set(`${e}${t}`);return}ve.set([`${e}${t}`,r])}A.addEventListener(`click`,()=>e.loadMenus(!0));function be(e,t,n){if(!e){let e=d(`user`,t);return n||e.setAttribute(`fill-opacity`,`0.5`),e}let r=document.createElement(`img`);return r.src=e,r}function xe(e,t,n=f()){e.classList.add(`${S}-user-avatar`);let r=l(()=>c.single?null:c.session?.avatar||``).get(),i=new AbortController,a=AbortSignal.any([i.signal,n]),o=r===null?d(`singleUser`,a):be(r,a,t);e.appendChild(o),g(()=>{let a=c.single?null:c.session?.avatar||``;if(a===r)return;r=a,i?.abort(),i=new AbortController;let s=AbortSignal.any([i.signal,n]),l=r===null?d(`singleUser`,s):be(r,s,t);!t&&r===null&&l.setAttribute(`fill-opacity`,`0.5`),e.replaceChild(l,o),o.remove(),o=l},n);let s=l(()=>{let e=c.impersonation,t=c.session;return!e||e.id===(t?.id||``)?null:e.avatar||``}),u=null,p=null,m=null;g(()=>{let r=s.get();r!==u&&(u=r,p?.remove(),p=null,m?.abort(),r!==null&&(m=new AbortController,p=be(r,AbortSignal.any([m.signal,n]),t),e.insertBefore(p,o)))},n)}const N=document.createElement(`div`);N.classList.add(`${S}-user`);const P=document.createElement(`div`);P.classList.add(`${S}-user-button`),xe(P,!0);const F=N.appendChild(document.createElement(`span`));F.classList.add(`${S}-user-info`);const Se=F.appendChild(document.createElement(`span`));xe(Se),Se.classList.add(`avatar`);const Ce=F.appendChild(document.createElement(`span`));Ce.classList.add(`username`),Ce.innerText=`用户名`;const we=F.appendChild(document.createElement(`div`));let I=we.appendChild(document.createComment(``));x(()=>e.help,(e,t,n)=>{if(!e){let e=document.createComment(``);I.replaceWith(e),I=e;return}let r=document.createElement(`a`);r.href=e,r.target=`_blank`,r.appendChild(d(`help`,n())),r.title=`帮助`,I.replaceWith(r),I=r},{immediate:!0});const Te=we.appendChild(document.createElement(`div`));Te.appendChild(d(`logout`,!0)),Te.title=`退出登录`,g(()=>{Te.hidden=!c.operator}),Te.addEventListener(`click`,()=>c.exit(!0)),g(()=>{Ce.innerText=c.operator?.name||``});const Ee=l(()=>r.fromDefine(e.userMenus,[])),De=l(()=>{let e=Ee.get();return c.operator?e:r.filter(e,e=>!e.logged)}),L=N.appendChild(document.createElement(`main`));L.style.flex=`1`,L.style.overflow=`auto`,L.classList.add(`NavMenu`);let Oe=null;g(()=>{Oe?.abort(),L.innerHTML=``,Oe=new AbortController,fe(L,De.get(),{signal:Oe.signal})});const R=document.createElement(`a`);R.classList.add(`${S}-logo`),x(()=>e.root,e=>{R.href=e},{immediate:!0}),x(()=>b(e.logo),(e,t,n)=>{let r=n(),i;e?(i=document.createElement(`img`),i.src=e.href):i=d(`logo`,r),R.appendChild(i),i.classList.add(`logo`),n(()=>{i.remove()})},{immediate:!0});const ke={404:{title:`您所请求的页面无法找到`,description:`服务器无法正常提供信息。
2
- 目标页面可能已经被更改、删除或移到其他位置,或您所输入页面地址错误。`}};function z(e,t){if((t??``)==``){e.container.appendChild(document.createTextNode(`空页面`));return}let n=(typeof t==`number`||typeof t==`string`)&&Object.hasOwn(ke,t)&&ke[t]||ke[404],r=n?.title||`Error`,i=n?.description,a=document.createElement(`div`),o=a.appendChild(document.createElement(`div`)),s=o.appendChild(document.createElement(`div`)),c=o.appendChild(document.createElement(`div`));if(a.style.marginBlock=`8%`,a.style.marginInline=`auto`,a.style.inlineSize=`600px`,a.style.maxInlineSize=`100%`,a.style.padding=`20px`,s.style.paddingBlock=`20px`,s.style.fontSize=`20px`,s.style.color=`#8e8e8e`,s.style.textAlign=`center`,c.style.fontSize=`13px`,c.style.lineHeight=`1.3em`,c.style.color=`#b5b5b5`,s.appendChild(document.createTextNode(r)),e.title=r||`Error`,i&&typeof i==`string`)for(let e of i.split(`
3
- `))c.appendChild(document.createTextNode(e)),c.appendChild(document.createElement(`br`));e.container.appendChild(a),e.loading=!1}const B=`${S}-allSider-nav`,V=document.createElement(`header`);V.className=`${B}-header`;const H=V.appendChild(document.createElement(`div`));H.classList.add(`${B}-actions`);const Ae=V.appendChild(document.createElement(`div`));Ae.classList.add(`${B}-sidebar`);const je=`${B}-open`;let U=null;function Me(){window.innerWidth>800||U?.()}var Ne=class{button;sider;#e;#t=!1;get disabled(){return this.#t}set disabled(e){e?this.disable():this.enable()}disable(){if(this.#t)return;this.#t=!0;let e=this.#e;U===e&&e(),this.button.hidden=!0,this.sider.hidden=!0}enable(){this.#t&&(this.#t=!1,this.button.hidden=!1)}#n=()=>this.toggle();constructor(e,t){let n=t instanceof HTMLElement?t:document.createElement(`div`),r=e instanceof HTMLElement?e:document.createElement(`div`);n.tabIndex=0,n.classList.add(`${B}-button`),r.hidden=!0,Ae.appendChild(r),n.classList.add(`${B}-selectable`);let i=()=>{U=null,document.body.classList.remove(je),n.classList.remove(`${B}-selected`),r.hidden=!0,this.#r.set(!1)};n.addEventListener(`click`,this.#n),this.#e=i,this.button=n,this.sider=r}#r=m(!1);get shown(){return this.#r.get()}set shown(e){e?this.show():this.hide()}get hidden(){return this.button.hidden}set hidden(e){this.button.hidden=!!e,e&&this.hide()}get open(){return U===this.#e}set open(e){e?this.show():this.hide()}show(){if(this.hidden||this.#t)return;let e=this.#e;U!==e&&(U?.(),U=e,document.body.classList.add(je),this.button.classList.add(`${B}-selected`),this.sider.hidden=!1,this.#r.set(!0))}toggle(){if(this.hidden||this.#t)return;let e=this.#e;if(U===e){e();return}this.show()}hide(){if(this.hidden||this.#t)return;let e=this.#e;U===e&&e()}remove(){let e=this.#e;U===e&&e();let{button:t,sider:n}=this;t.remove(),n.remove(),t.classList.remove(`${B}-button`),t.classList.remove(`${B}-selectable`),t.removeEventListener(`click`,this.#n),n.hidden=!1}};Ae.addEventListener(`click`,e=>{e.target===e.currentTarget&&U?.()});var W=class e{root=document.createElement(`div`);#e=new Set;constructor(e){let t=this.root;e.appendChild(t),t.className=`${B}-group`}remove(){this.root.remove();for(let e of[...this.#e])e()}createGroup(){let t=new e(this.root),n=this.#e,r=()=>{n.delete(r),t.remove()};return n.add(r),t}createAction(e){let t=document.createElement(e?`a`:`div`);t.tabIndex=0,t.classList.add(`${B}-button`),t.addEventListener(`click`,()=>{Me()}),this.root.appendChild(t);let n=this.#e,r=()=>{n.delete(r),t.remove()};return n.add(r),t}createSider(e,t){let n=new Ne(e,t);this.root.appendChild(n.button);let r=this.#e,i=()=>{r.delete(i),n.remove()};return r.add(i),n}};const Pe=document.createElement(`div`),G=new W(H),Fe=new W(H);new W(H),H.appendChild(document.createElement(`span`));const Ie=new W(H),K=Fe.createSider(Pe);K.button.innerText=`页面`,K.disabled=!0;var Le=class extends o{#e;#t;constructor(e,t,n,r,i){super(t,n,r,i),this.#e=e,this.#t=t,i.addEventListener(`abort`,()=>{this.#n()})}insert(){super.insert(),this.#e.show&&(K.disabled=!1)}#n(){this.#e.show&&!this.#t.children.length&&(K.disabled=!0)}remove(){super.remove(),this.#n()}},Re=class extends i{#e=(()=>{let e=document.createElement(`div`);return e.classList.add(`Page-sides`),Pe.appendChild(e),e})();destroy(){return super.destroy()?(this.#e.remove(),!0):!1}toggle(e){super.toggle(e),K.disabled=!(e&&this.#e.children.length)}get siderOpen(){return K.open}set siderOpen(e){e?K.show():K.hide()}createSider(e,t){if(this.destroyed)throw Error(`页面组件已被销毁`);t?.throwIfAborted();let n=this.#e;return new Le(this,n,null,e!==!1,t instanceof AbortSignal?AbortSignal.any([t,this.signal]):this.signal)}constructor(e){super(e),e&&(K.disabled=!this.#e.children.length)}};function ze(e,t,n,r=!1,i){if(n.signal.aborted)return null;let{create:a,signal:o}=n,s=!1,c=!1,u=null,d=[],f=[],p=[];function m(){let e=u;if(!e)return;let t=f;x(()=>t.some(e=>e.get()),t=>{e.hidden=t},{signal:o,immediate:!0})}let h=()=>{if(s=!0,!c)return;c=!1,m();let t=document.createElement(`hr`);u=t,f=p,p=[],e.appendChild(t)};function g(e){h(),f.push(e),p.push(e),d.push(e)}for(let u of t){if(!u){if(!s)continue;c=!0;continue}let{children:d}=u;if(!d?.length){let t=a(u,{button:r});if(!t)continue;h(),g(l(()=>!!u.hidden)),e.appendChild(t);continue}let f=document.createElement(`nl-menu`),p=ze(f,t,n);if(!p)continue;let m=l(()=>!!(u.hidden||p.get()));if(g(m),i)i(e,f,u,m);else{x(()=>m.get(),e=>{t.hidden=e},{signal:o,immediate:!0});let t=e.appendChild(f),n=t.insertBefore(document.createElement(`div`),t.firstChild);n.appendChild(document.createTextNode(u.label||u.title||``)),n.slot=`label`}}return s?(m(),l(()=>d.some(e=>e.get()))):null}function q(e,t){if(t.signal.aborted)return null;let{create:n,signal:r}=t,i=document.createElement(`div`);return ze(i,e,t,!0,(e,t,n,i)=>{let a=e.appendChild(document.createElement(`button`));a.appendChild(document.createTextNode(n.label||n.title||``)),t.targetElement=a,a.addEventListener(`click`,()=>t.show?.()),e.appendChild(t),x(()=>i.get(),e=>{a.hidden=e,t.hidden=e},{signal:r,immediate:!0})}),i.childNodes.length?(i.classList.add(`MenuButtons`),i):null}function Be(t){let{page:n}=t;if(n){let{path:r}=t;return new URL(r?.[0]===`/`?`${n}${r}`:`${n}/${r||``}`,e.root).href}let{uri:r}=t;return r||null}function J(e,t){let{signal:n,button:r}=t,i=document.createElement(`a`),a=r?document.createElement(`button`):null;x(()=>e.label||e.title||``,e=>{i.textContent=e},{signal:n,immediate:!0});let{commands:o}=t,s=l(()=>{if(e.disabled)return!0;let{command:n}=e,r=n&&Object.hasOwn(o,n)&&o[n];return!!(r?r.disabled:t.disabled(e))}),c=l(()=>{let n=Be(e);if(n)return n;let{command:r}=e,i=r&&Object.hasOwn(o,r)&&o[r];return i?Be(i)||null:t.uri(e)||null});function u(){let{click:n}=e;if(typeof n==`function`)return n();let{script:r}=e;if(r)return;let{command:i}=e,a=i&&Object.hasOwn(o,i)&&o[i];return a?a.click?.():t.click(e)}return g(()=>{let t=s.get();if(i.disabled=t,i.ariaDisabled=t?`true`:`false`,t)i.removeAttribute(`tabindex`),i.removeAttribute(`href`),i.removeAttribute(`target`);else{i.tabIndex=0;let t=``,n=c.get();n&&(i.href=n,t=e.target||(e.page?`_self`:``)),t?i.target=t:i.removeAttribute(`target`)}a&&(a.disabled=t)},n),i.addEventListener(`click`,e=>{s.get()&&(e.preventDefault(),e.stopPropagation())},{capture:!0}),i.addEventListener(`click`,e=>{s.get()||e.defaultPrevented||c.get()&&(e.shiftKey||(ee?e.metaKey:e.ctrlKey)||e.altKey)||u()===!1&&e.preventDefault()}),a?(a.appendChild(i),a):i}function Y(e,t,n){let r=document.createElement(`div`),i=document.createElement(`nl-menu`),a=ze(i,e,n);if(!a)return a;let o=r.appendChild(document.createElement(`button`)),s=t?.label||t?.title||``;return s?o.appendChild(document.createTextNode(s)):o.appendChild(d(t?.icon||`more`,n.signal)),i.targetElement=o,o.addEventListener(`click`,()=>i.show()),r.appendChild(i),x(()=>a.get(),e=>r.hidden=e,{signal:n.signal,immediate:!0}),r}function Ve({hidden:e,title:t,disabled:n,createIcon:r,createPanel:i,href:a,click:o},s){if(s.aborted)return;let c=m(m(!1)),u={get shown(){return c.get().get()},get signal(){return s}},f;if(i){let e=G.createSider(i(u));f=e.button,c.set(l(()=>e.shown)),s.addEventListener(`abort`,()=>{e.remove()},{once:!0})}else if(a){let e=G.createAction(!0);g(()=>{let t=!n?.(u)&&a(u);t?e.href=t:e.removeAttribute(`href`)},s),o&&e.addEventListener(`click`,e=>{o(u)===!1&&e.preventDefault()},{signal:s}),f=e,s.addEventListener(`abort`,()=>{e.remove()},{once:!0})}else{let e=G.createAction();n&&g(()=>{n(u)?e.removeAttribute(`tabIndex`):e.tabIndex=0},s),o&&e.addEventListener(`click`,()=>{o(u)},{signal:s}),f=e,s.addEventListener(`abort`,()=>{e.remove()},{once:!0})}e&&g(()=>{f.hidden=e(u)},s),t&&g(()=>{f.title=t(u)},s),r?f.appendChild(r(u)):f.appendChild(d([`icon`,`logo`],s))}const He={title(t){return[t.title,e.title||`拥道YongDall`].filter(Boolean).join(` | `)},icon(e){return e.icon},components:{List:E,Pagination:D,createMenuButtons:q,createMenuItem:J,createMenuButton:Y},updatePath:M,pageManager:oe,elements:[y,V],classNames:[S,`${S}-allSider`],styleFiles:[`theme-allSider.css`],home:se,alertError:t,rootClassName:`${S}-root`,createFrame:u,createPage(e){return new Re(e)},renderError(e,t){z(e,t)},async setup(e){ae(!1),R.addEventListener(`click`,()=>{Me()},{signal:e}),H.insertBefore(R,H.firstElementChild);let t=G.createSider(O);t.button.appendChild(d(`menu`,e)),t.button.title=`菜单`;let n=G.createSider(w);n.button.appendChild(d(`activity`,e)),n.button.title=`活动`,window.innerWidth>800&&t.show();let r=Ie.createSider(N,P);e.addEventListener(`abort`,()=>{R.remove(),t.remove(),n.remove(),r.remove()},{once:!0});for await(let t of v()){if(e.aborted)return;Ve(t,e)}}};function Ue(e,t,{hidden:n,title:r,disabled:i,createIcon:a,createPanel:o,href:s,click:c},u){if(u.aborted)return;let f=e.parentNode;if(!f)return;let p=m(m(!1)),h={get shown(){return p.get().get()},get signal(){return u}},_;if(o){let e=document.createElement(`div`),n=o(h);_=e;let r=m(!0);p.set(l(()=>!p.get())),t.appendChild(n),e.addEventListener(`click`,()=>{n.showPopover()},{signal:u}),n.setAttribute(`popover`,`auto`),n.addEventListener(`toggle`,e=>{r.set(e.newState===`closed`)},{signal:u}),u.addEventListener(`abort`,()=>{n.removeAttribute(`popover`),n.remove()},{once:!0})}else if(s){let e=document.createElement(`a`);c&&e.addEventListener(`click`,e=>{c(h)===!1&&e.preventDefault()},{signal:u}),g(()=>{let t=!i?.(h)&&s(h);t?e.href=t:e.removeAttribute(`href`)},u),_=e}else{let e=document.createElement(`div`);c&&e.addEventListener(`click`,()=>{c(h)},{signal:u}),i&&g(()=>{i(h)?e.removeAttribute(`tabIndex`):e.tabIndex=0},u),_=e}n&&g(()=>{_.hidden=n(h)},u),r&&g(()=>{_.title=r(h)},u),f.insertBefore(_,e),a?_.appendChild(a(h)):_.appendChild(d([`icon`,`logo`],u)),u.addEventListener(`abort`,()=>{_.remove()},{once:!0})}const X=`${S}-base`,We=[`theme-base.css`],Ge=document.createElement(`header`),Z=Ge.appendChild(document.createElement(`div`));Z.classList.add(`${X}-header`);const Ke=Ge.appendChild(document.createElement(`div`));Ke.classList.add(`${X}-sidebar`);const qe=Z.appendChild(d(`menu`,!0));qe.classList.add(`${X}-menu-button`);const Je=Z.appendChild(document.createElement(`span`)),Ye=`${X}-menu-open`;qe.addEventListener(`click`,()=>{document.body.classList.toggle(Ye)}),Ke.addEventListener(`click`,e=>{e.target===e.currentTarget&&document.body.classList.remove(Ye)});let Xe=null;const Ze={title(t){return[[Xe&&t.loading?`⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏`[Xe.get()%10]:``,t.unsaved?`🔴`:``,t.title].join(``),e.title||`拥道YongDall`].filter(Boolean).join(` | `)},icon(e){return e.icon},components:{List:E,Pagination:D,createMenuButtons:q,createMenuItem:J,createMenuButton:Y},updatePath:M,pageManager(e){let t=!1;g(()=>{if(!e.current){t&&e.destroy();return}t=!0},e.signal)},elements:[Ge,y],classNames:[S,X],styleFiles:We,home:se,alertError:t,rootClassName:`${S}-root`,createFrame:u,createPage(e){return new i(e)},renderError(e,t){z(e,t)},async setup(t){Xe=h(80,t),R.addEventListener(`click`,()=>{window.innerWidth>800||document.body.classList.remove(Ye)},{signal:t});let n=document.createElement(`div`);n.classList.add(`${X}-header-title`),g(()=>{n.innerText=e.title||e.company||``},t),Z.insertBefore(R,Je),Z.insertBefore(n,Je),window.innerWidth>800&&document.body.classList.add(Ye),Ke.appendChild(O);let r=document.createElement(`div`);r.classList.add(`${X}-panels`),document.body.appendChild(r),r.appendChild(N),N.setAttribute(`popover`,`auto`),P.addEventListener(`click`,()=>{N.showPopover()},{signal:t});let i=Z.appendChild(document.createElement(`div`));i.classList.add(`${X}-actions`);let a=i.appendChild(document.createElement(`span`));i.appendChild(P),t.addEventListener(`abort`,()=>{R.remove(),n.remove(),O.remove(),r.remove(),N.removeAttribute(`popover`),N.remove(),P.remove(),a.remove(),i.remove()},{once:!0});for await(let e of v()){if(t.aborted)return;Ue(a,r,e,t)}}},Qe=`${S}-pure`,$e=[`theme-pure.css`];let et=null;const tt={title(t){return[[et&&t.loading?`⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏`[et.get()%10]:``,t.unsaved?`🔴`:``,t.title].join(``),e.title||`拥道YongDall`].filter(Boolean).join(` | `)},icon(e){return e.icon},components:{List:E,Pagination:D,createMenuButtons:q,createMenuItem:J,createMenuButton:Y},updatePath:M,pageManager(e){let t=!1;g(()=>{if(!e.current){t&&e.destroy();return}t=!0},e.signal)},elements:[y],classNames:[S,Qe],styleFiles:$e,home:se,alertError:t,rootClassName:`${S}-root`,createFrame:u,createPage(e){return new i(e)},renderError(e,t){z(e,t)},async setup(e){et=h(80,e)}},Q=`${S}-tabs`,nt=document.createElement(`header`),$=nt.appendChild(document.createElement(`div`));$.classList.add(`${Q}-header`);const rt=nt.appendChild(document.createElement(`div`));rt.classList.add(`${Q}-sidebar`);const it=$.appendChild(d(`menu`,!0));it.classList.add(`${Q}-menu-button`);const at=$.appendChild(document.createElement(`span`)),ot=`${Q}-menu-open`;it.addEventListener(`click`,()=>{document.body.classList.toggle(ot)});function st(){window.innerWidth>800||document.body.classList.remove(ot)}rt.addEventListener(`click`,e=>{e.target===e.currentTarget&&document.body.classList.remove(ot)});const ct={title(t){return[t.title,e.title||`拥道YongDall`].filter(Boolean).join(` | `)},icon(e){return e.icon},components:{List:E,Pagination:D,createMenuButtons:q,createMenuItem:J,createMenuButton:Y},updatePath:M,pageManager:oe,elements:[nt,y],classNames:[S,`${S}-tabs`],styleFiles:[`theme-tabs.css`],home:se,alertError:t,rootClassName:`${S}-root`,createFrame:u,createPage(e){return new i(e)},renderError(e,t){z(e,t)},async setup(t){ae(!0),R.addEventListener(`click`,()=>{st()},{signal:t});let n=document.createElement(`div`);n.classList.add(`${Q}-header-title`),g(()=>{n.innerText=e.title||e.company||``},t),$.insertBefore(R,at),$.insertBefore(n,at),nt.appendChild(w),window.innerWidth>800&&document.body.classList.add(ot),rt.appendChild(O);let r=document.createElement(`div`);r.classList.add(`${Q}-panels`),document.body.appendChild(r),r.appendChild(N),N.setAttribute(`popover`,`auto`),P.addEventListener(`click`,()=>{N.showPopover()},{signal:t});let i=$.appendChild(document.createElement(`div`));i.classList.add(`${Q}-actions`);let a=i.appendChild(document.createElement(`span`));i.appendChild(P),t.addEventListener(`abort`,()=>{R.remove(),n.remove(),w.remove(),O.remove(),N.removeAttribute(`popover`),N.remove(),P.remove()},{once:!0});for await(let e of v()){if(t.aborted)return;Ue(a,r,e,t)}}};export{He as allSider,He as theme,Ze as base,Ze as tradition,tt as pure,ct as tabs};
1
+ import{Application as e,ErrorAlerter as t,Ident as n,Menu as r,Page as i,PageIdent as a,PageSider as o,Pattern as s,User as c,createComputed as l,createFrame as u,createIcon as d,createNeverAbortedSignal as f,createShowField as p,createState as m,createTick as h,effect as g,flatPermission as _,isMac as ee,loadNavButtons as v,root as y,toFileLink as b,toPermissionFilter as x,waitAbortSignal as te,watch as S}from"@yongdall/web";import"@neeloong/components";const C=`YongDallTheme`,w=`${C}-activity`,T=document.createElement(`div`);T.classList.add(w);const ne=new Map;let E,re=!1;function ie(e){re=e}const ae=e=>{let t=document.createElement(`div`);t.classList.add(`${w}-page`);let n=t.appendChild(document.createElement(`a`));n.classList.add(`${w}-title`),n.href=e.href,n.innerText=e.title;let r=t.appendChild(document.createElement(`button`));r.type=`button`,r.classList.add(`${w}-close`),r.addEventListener(`click`,()=>{e.destroy()});let i={button:t,link:n,next:E};E&&(E.last=i),E=i,ne.set(e,i),T.insertBefore(t,re?null:T.firstChild),g(()=>{n.innerText=e.title},e.signal),g(()=>{n.href=e.href},e.signal),g(()=>{e.current?t.classList.add(`${w}-current`):t.classList.remove(`${w}-current`)},e.signal),g(()=>{e.loading?t.classList.add(`${w}-loading`):t.classList.remove(`${w}-loading`)},e.signal),g(()=>{e.unsaved?t.classList.add(`${w}-unsaved`):t.classList.remove(`${w}-unsaved`)},e.signal),te(e.signal).then(()=>{let{last:e,next:n}=i;e&&(e.next=n),n&&(n.last=e),E===i&&(E=n),t.remove()})};var D=class{#e;#t;#n;#r;#i=[];#a=document.createElement(`table`);#o=this.#a.appendChild(document.createElement(`thead`));#s=this.#o.appendChild(document.createElement(`tr`));#c=this.#a.appendChild(document.createElement(`tbody`));get root(){return this.#a}get createUrl(){return this.#e}set createUrl(e){let t=typeof e==`function`?e:null;this.#e!==t&&(this.#e=t,this.#l())}constructor(e,t){let n=Object.entries(t.fields).filter(([,{type:e}])=>e&&typeof e!=`object`),r=Object.entries(t.fields).filter(([,e])=>e.primary).map(([e])=>e),i=t.labelPattern||``;this.#n=i,this.#e=typeof e==`function`?e:null,this.#t=n,this.#r=r;let a=this.#s;a.innerHTML=``,a.appendChild(document.createElement(`th`)).appendChild(document.createTextNode(`#`));for(let[e,t]of n)a.appendChild(document.createElement(`th`)).appendChild(document.createTextNode(t.label||e))}#l(){let e=this.#c;e.innerHTML=``;let t=this.#r,n=this.#n,r=this.#t,i=this.#e;for(let a of this.#i){let o=e.appendChild(document.createElement(`tr`)),c=o.appendChild(document.createElement(`td`)),l=s.generate(n,a)||t.map(e=>a[e]).join(`$`);if(i){let e=c.appendChild(document.createElement(`a`));e.href=i(t.map(e=>a[e]).join(`$`)),e.appendChild(document.createTextNode(l))}else c.appendChild(document.createTextNode(l));for(let[e,t]of r){let n=o.appendChild(document.createElement(`td`)),r=p(e,t,{inline:!0},a);n.appendChild(r.root)}}}setData(e){this.#i=e,this.#l()}destroy(){}},O=class{#e;#t;constructor(){let e=document.createElement(`nl-pagination`);e.size=20,e.appendChild(document.createElement(`nl-pagination-value`)).name=`start`,e.appendChild(document.createTextNode(`-`)),e.appendChild(document.createElement(`nl-pagination-value`)).name=`end`,e.appendChild(document.createTextNode(`/`)),e.appendChild(document.createElement(`nl-pagination-value`)).name=`total`,e.appendChild(document.createElement(`nl-pagination-prev`)).innerText=`上一页`,e.appendChild(document.createElement(`nl-pagination-pager`)),e.appendChild(document.createElement(`nl-pagination-next`)).innerText=`下一页`,e.appendChild(document.createElement(`nl-pagination-sizer`));let t=new Set;e.addEventListener(`change`,()=>{for(let e of t)e()}),this.#e=t,this.#t=e}get root(){return this.#t}get size(){return this.#t.size}set size(e){this.#t.size=e}get page(){return this.#t.page}set page(e){this.#t.page=e}get total(){return this.#t.total}set total(e){this.#t.total=e}listen(e){let t=this.#e,n=()=>e(this);return t.add(n),()=>{t.delete(n)}}destroy(){}};function k(e){e.listen(`update`,()=>{let{container:t}=e;t.innerHTML=``})}function*oe(e,t,n){if(!e)return;let r=e.indexOf(`?`),i=r<0?e:e.slice(0,r);if(r>=0&&r+1<e.length)for(let n=e.slice(r).split(`&`);n.length;n.pop()){let e=t.get(`${i}${n.join(`&`)}`);e?.length&&(yield e)}let a=t.get(i);a?.length&&(yield a);let o=n.get(i);o?.length&&(yield o.map(e=>e[0]))}function*se(e,t,r,i,a){if(yield*oe(e,t,r),i)for(let e of[...n.stringifyPaths(i)].reverse()){let t=a.get(e);t?.length&&(yield t)}}function*ce(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let e;e=t.nextNode();)yield e}function le(e,t){let n=[],r=[...ce(t)].filter(e=>e.nodeValue?.length),i=r.reduce((e,t)=>{let n=e[e.length-1]?.[1]||0;return[...e,[n,n+(t.nodeValue?.length||0),t]]},[]),a=r.map(e=>e.nodeValue).join(``),o=0;for(let t of e){let e=a.indexOf(t,o);if(e===-1)return[];let r=e+t.length,s=i.findLast(([t])=>t<=e);if(!s)return[];let c=i.findLast(([,e])=>e>=r);if(!c)return[];o=e+t.length;let l=new Range;l.setStart(s[2],e-s[0]),l.setEnd(c[2],r-s[0]),n.push(l)}return n}function ue(t,r,i={}){let o=new Map,s=new Map,c=new Map,l=null,u=[],d=[];function p(t,r){let i=document.createElement(`a`),l=i;i.appendChild(document.createTextNode(t.label||t.title||``)),i.title=t.title||``;let{page:u,path:d,uri:f,target:p}=t,m=null,g=u&&n.parse(u);if(g)m=new URL(a.stringify(g,d),e.root),i.href=m.href,p&&typeof p==`string`&&(i.target=p);else if(f){i.href=f;try{m=new URL(f),m.origin!==location.origin&&(m=null)}catch{}p!==``&&(i.target=p??`_blank`)}if(m&&(i.target||`_self`)===`_self`){i.addEventListener(`click`,()=>{h=l,requestIdleCallback(()=>{h===l&&(h=null)})});let{pathname:e,search:t}=m,r=`${e}${t}`,a=s.get(r);a?a.push(l):s.set(e,[l]);let u=o.get(r);if(u?u.push([l,t.length]):o.set(e,[[l,t.length]]),g&&(!d||d[0]===`?`||d[0]===`#`)){let e=n.stringify(g),t=c.get(e);t?t.push(l):c.set(e,[l])}}return i}function m(e){let t=p(e);return t.classList.add(`NavMenu-button`),t}let h=null;function g(e,t){let{children:n}=e;if(!n.length){let t=document.createElement(`div`),n=t.appendChild(p(e,t));for(let n of e.buttons||[])t.appendChild(m(n));return t.classList.add(`NavMenu-item`),n.classList.add(`NavMenu-item-link`),{el:t,filter(e,r){let i=r?le(r,n):[];return t.hidden=!!(!e&&r&&!i.length),i}}}let r=document.createElement(`nl-collapse`);r.setAttribute(`animation`,``),r.setAttribute(`menu`,``);let i=r.appendChild(document.createElement(`div`));i.appendChild(document.createTextNode(e.label||e.title||``)),i.className=`NavMenu-label`,i.slot=`label`,i.style.flex=`1`;for(let t of e.buttons||[])r.appendChild(m(t)).slot=`label`;let a=_(r,n,t+1);return a.length?{el:r,filter(e,t){if(!t){for(let t of a)t.filter(e);return r.hidden=!1,r.open=!1,[]}let n=le(t,i),o=!!(e||n.length),s=a.flatMap(e=>e.filter(o,t));r.open=!!s.length;let c=[...n,...s];return r.hidden=!e&&!c.length,c}}:null}function _(e,t,n){let r=!1,i=!1,a=[];for(let o of t){if(!o){if(!r)continue;i=!0;continue}i&&(i=!1,e.appendChild(document.createElement(`hr`)));let t=g(o,n);t&&(a.push(t),r=!0,e.appendChild(t.el),u.push(t.el),t.el.style.setProperty(`--NavMenu-level`,String(n)))}return a}let ee=_(t,r,0),v=!1;function y(){if(!v){v=!0;for(let e of u)e.remove();for(let e of d)e()}}let b=i.signal||f();b.aborted?y():b.addEventListener(`abort`,y,{once:!0});let x=[];return S(()=>{let e=i.active;return e?typeof e==`string`?e.replace(/#.*/,``)||``:Array.isArray(e)?e[1]?[e[0]?.replace(/#.*/,``)||``,e[1]||null]:e[0]?.replace(/#.*/,``)||null:null:null},e=>{if(!e)return;let n=Array.isArray(e)?e[0]:``,r=Array.isArray(e)?e[1]:null;for(let e of se(n,s,o,r,c)){let n=h&&e.includes(h)?h:null;if(n&&(h=null),!n&&l&&e.includes(l))return;let r=n||e[0],i=[],a=r.parentElement;for(;a&&a!==t;a=a.parentElement)i.push(a);if(a!==t)return;x=i,l?.classList.remove(`NavMenu-current`);for(let e of x)e.setAttribute(`open`,``);l=r,l?.classList.add(`NavMenu-current`);return}},{signal:b,immediate:!0}),e=>{let t=e.toLowerCase().split(/[\s\n]+/).filter(Boolean);if(t.length)return ee.flatMap(e=>e.filter(!1,t));ee.flatMap(e=>e.filter(!1));for(let e of x)e.setAttribute(`open`,``);return[]}}const A=document.createElement(`div`);A.style.display=`flex`,A.style.flexDirection=`column`;const de=A.appendChild(document.createElement(`header`));de.classList.add(`NavMenu-header`);const j=de.appendChild(document.createElement(`input`));j.placeholder=`过滤菜单...`,j.type=`search`;const M=de.appendChild(document.createElement(`button`));M.appendChild(d(`refresh`,!0)),M.classList.add(`icon`),M.title=`刷新`;const N=A.appendChild(document.createElement(`main`));N.style.flex=`1`,N.style.overflow=`auto`,N.classList.add(`NavMenu`);let fe=null;function pe(){let e=fe?.(j.value)||[],t=new Highlight(...e);CSS.highlights.set(`NavMenu-filter-highlight`,t)}j.addEventListener(`input`,pe);const me=l(()=>r.fromDefine(e.menus,[])),he=l(()=>{let e=c.permissions,t=me.get();if(e.size<0)return t;let n=x({permissions:e,organizationPermissions:c.organizationPermissions,allOrganizationPermissions:c.allOrganizationPermissions});return r.filter(t,e=>{let t=_(e.permission);return!t.length||!!t.find(n)})}),ge=m(``);let _e=null;g(()=>{_e?.abort(),N.innerHTML=``,_e=new AbortController,fe=ue(N,he.get(),{signal:_e.signal,get active(){return ge.get()}}),pe()});function P(e,t,n,r){if(!r){ge.set(`${e}${t}`);return}ge.set([`${e}${t}`,r])}M.addEventListener(`click`,()=>e.loadMenus(!0));const F=document.createElement(`a`);F.classList.add(`${C}-logo`),S(()=>e.root,e=>{F.href=e},{immediate:!0}),S(()=>b(e.logo),(e,t,n)=>{let r=n(),i;e?(i=document.createElement(`img`),i.src=e.href):i=d(`logo`,r),F.appendChild(i),i.classList.add(`logo`),n(()=>{i.remove()})},{immediate:!0});const ve={404:{title:`您所请求的页面无法找到`,description:`服务器无法正常提供信息。
2
+ 目标页面可能已经被更改、删除或移到其他位置,或您所输入页面地址错误。`}};function I(e,t){if((t??``)==``){e.container.appendChild(document.createTextNode(`空页面`));return}let n=(typeof t==`number`||typeof t==`string`)&&Object.hasOwn(ve,t)&&ve[t]||ve[404],r=n?.title||`Error`,i=n?.description,a=document.createElement(`div`),o=a.appendChild(document.createElement(`div`)),s=o.appendChild(document.createElement(`div`)),c=o.appendChild(document.createElement(`div`));if(a.style.marginBlock=`8%`,a.style.marginInline=`auto`,a.style.inlineSize=`600px`,a.style.maxInlineSize=`100%`,a.style.padding=`20px`,s.style.paddingBlock=`20px`,s.style.fontSize=`20px`,s.style.color=`#8e8e8e`,s.style.textAlign=`center`,c.style.fontSize=`13px`,c.style.lineHeight=`1.3em`,c.style.color=`#b5b5b5`,s.appendChild(document.createTextNode(r)),e.title=r||`Error`,i&&typeof i==`string`)for(let e of i.split(`
3
+ `))c.appendChild(document.createTextNode(e)),c.appendChild(document.createElement(`br`));e.container.appendChild(a),e.loading=!1}const L=`${C}-allSider-nav`,R=document.createElement(`header`);R.className=`${L}-header`;const z=R.appendChild(document.createElement(`div`));z.classList.add(`${L}-actions`);const ye=R.appendChild(document.createElement(`div`));ye.classList.add(`${L}-sidebar`);const be=`${L}-open`;let B=null;function xe(){window.innerWidth>800||B?.()}var Se=class{button;sider;#e;#t=!1;get disabled(){return this.#t}set disabled(e){e?this.disable():this.enable()}disable(){if(this.#t)return;this.#t=!0;let e=this.#e;B===e&&e(),this.button.hidden=!0,this.sider.hidden=!0}enable(){this.#t&&(this.#t=!1,this.button.hidden=!1)}#n=()=>this.toggle();constructor(e,t){let n=t instanceof HTMLElement?t:document.createElement(`div`),r=e instanceof HTMLElement?e:document.createElement(`div`);n.tabIndex=0,n.classList.add(`${L}-button`),r.hidden=!0,ye.appendChild(r),n.classList.add(`${L}-selectable`);let i=()=>{B=null,document.body.classList.remove(be),n.classList.remove(`${L}-selected`),r.hidden=!0,this.#r.set(!1)};n.addEventListener(`click`,this.#n),this.#e=i,this.button=n,this.sider=r}#r=m(!1);get shown(){return this.#r.get()}set shown(e){e?this.show():this.hide()}get hidden(){return this.button.hidden}set hidden(e){this.button.hidden=!!e,e&&this.hide()}get open(){return B===this.#e}set open(e){e?this.show():this.hide()}show(){if(this.hidden||this.#t)return;let e=this.#e;B!==e&&(B?.(),B=e,document.body.classList.add(be),this.button.classList.add(`${L}-selected`),this.sider.hidden=!1,this.#r.set(!0))}toggle(){if(this.hidden||this.#t)return;let e=this.#e;if(B===e){e();return}this.show()}hide(){if(this.hidden||this.#t)return;let e=this.#e;B===e&&e()}remove(){let e=this.#e;B===e&&e();let{button:t,sider:n}=this;t.remove(),n.remove(),t.classList.remove(`${L}-button`),t.classList.remove(`${L}-selectable`),t.removeEventListener(`click`,this.#n),n.hidden=!1}};ye.addEventListener(`click`,e=>{e.target===e.currentTarget&&B?.()});var V=class e{root=document.createElement(`div`);#e=new Set;constructor(e){let t=this.root;e.appendChild(t),t.className=`${L}-group`}remove(){this.root.remove();for(let e of[...this.#e])e()}createGroup(){let t=new e(this.root),n=this.#e,r=()=>{n.delete(r),t.remove()};return n.add(r),t}createAction(e){let t=document.createElement(e?`a`:`div`);t.tabIndex=0,t.classList.add(`${L}-button`),t.addEventListener(`click`,()=>{xe()}),this.root.appendChild(t);let n=this.#e,r=()=>{n.delete(r),t.remove()};return n.add(r),t}createSider(e,t){let n=new Se(e,t);this.root.appendChild(n.button);let r=this.#e,i=()=>{r.delete(i),n.remove()};return r.add(i),n}};const Ce=document.createElement(`div`),H=new V(z),we=new V(z);new V(z),z.appendChild(document.createElement(`span`));const Te=new V(z),U=we.createSider(Ce);U.button.innerText=`页面`,U.disabled=!0;var Ee=class extends o{#e;#t;constructor(e,t,n,r,i){super(t,n,r,i),this.#e=e,this.#t=t,i.addEventListener(`abort`,()=>{this.#n()})}insert(){super.insert(),this.#e.show&&(U.disabled=!1)}#n(){this.#e.show&&!this.#t.children.length&&(U.disabled=!0)}remove(){super.remove(),this.#n()}},De=class extends i{#e=(()=>{let e=document.createElement(`div`);return e.classList.add(`Page-sides`),Ce.appendChild(e),e})();destroy(){return super.destroy()?(this.#e.remove(),!0):!1}toggle(e){super.toggle(e),U.disabled=!(e&&this.#e.children.length)}get siderOpen(){return U.open}set siderOpen(e){e?U.show():U.hide()}createSider(e,t){if(this.destroyed)throw Error(`页面组件已被销毁`);t?.throwIfAborted();let n=this.#e;return new Ee(this,n,null,e!==!1,t instanceof AbortSignal?AbortSignal.any([t,this.signal]):this.signal)}constructor(e){super(e),e&&(U.disabled=!this.#e.children.length)}};function Oe(e,t,n,r=!1,i){if(n.signal.aborted)return null;let{create:a,signal:o}=n,s=!1,c=!1,u=null,d=[],f=[],p=[];function m(){let e=u;if(!e)return;let t=f;S(()=>t.some(e=>e.get()),t=>{e.hidden=t},{signal:o,immediate:!0})}let h=()=>{if(s=!0,!c)return;c=!1,m();let t=document.createElement(`hr`);u=t,f=p,p=[],e.appendChild(t)};function g(e){h(),f.push(e),p.push(e),d.push(e)}for(let u of t){if(!u){if(!s)continue;c=!0;continue}let{children:t}=u;if(!t?.length){let t=a(u,{button:r});if(!t)continue;h(),g(l(()=>!!u.hidden)),e.appendChild(t);continue}let d=document.createElement(`nl-menu`),f=Oe(d,t,n);if(!f)continue;let p=l(()=>!!(u.hidden||f.get()));if(g(p),i)i(e,d,u,p);else{S(()=>p.get(),e=>{t.hidden=e},{signal:o,immediate:!0});let t=e.appendChild(d),n=t.insertBefore(document.createElement(`div`),t.firstChild);n.appendChild(document.createTextNode(u.label||u.title||``)),n.slot=`label`}}return s?(m(),l(()=>d.some(e=>e.get()))):null}function W(e,t){if(t.signal.aborted)return null;let{create:n,signal:r}=t,i=document.createElement(`div`);return Oe(i,e,t,!0,(e,t,n,i)=>{let a=e.appendChild(document.createElement(`button`));a.appendChild(document.createTextNode(n.label||n.title||``)),t.targetElement=a,a.addEventListener(`click`,()=>t.show?.()),e.appendChild(t),S(()=>i.get(),e=>{a.hidden=e,t.hidden=e},{signal:r,immediate:!0})}),i.childNodes.length?(i.classList.add(`MenuButtons`),i):null}function ke(t){let{page:n}=t;if(n){let{path:r}=t;return new URL(r?.[0]===`/`?`${n}${r}`:`${n}/${r||``}`,e.root).href}let{uri:r}=t;return r||null}function G(e,t){let{signal:n,button:r}=t,i=document.createElement(`a`),a=r?document.createElement(`button`):null;S(()=>e.label||e.title||``,e=>{i.textContent=e},{signal:n,immediate:!0});let{commands:o}=t,s=l(()=>{if(e.disabled)return!0;let{command:n}=e,r=n&&Object.hasOwn(o,n)&&o[n];return!!(r?r.disabled:t.disabled(e))}),c=l(()=>{let n=ke(e);if(n)return n;let{command:r}=e,i=r&&Object.hasOwn(o,r)&&o[r];return i?ke(i)||null:t.uri(e)||null});function u(){let{click:n}=e;if(typeof n==`function`)return n();let{script:r}=e;if(r)return;let{command:i}=e,a=i&&Object.hasOwn(o,i)&&o[i];return a?a.click?.():t.click(e)}return g(()=>{let t=s.get();if(i.disabled=t,i.ariaDisabled=t?`true`:`false`,t)i.removeAttribute(`tabindex`),i.removeAttribute(`href`),i.removeAttribute(`target`);else{i.tabIndex=0;let t=``,n=c.get();n&&(i.href=n,t=e.target||(e.page?`_self`:``)),t?i.target=t:i.removeAttribute(`target`)}a&&(a.disabled=t)},n),i.addEventListener(`click`,e=>{s.get()&&(e.preventDefault(),e.stopPropagation())},{capture:!0}),i.addEventListener(`click`,e=>{s.get()||e.defaultPrevented||c.get()&&(e.shiftKey||(ee?e.metaKey:e.ctrlKey)||e.altKey)||u()===!1&&e.preventDefault()}),a?(a.appendChild(i),a):i}function K(e,t,n){let r=document.createElement(`div`),i=document.createElement(`nl-menu`),a=Oe(i,e,n);if(!a)return a;let o=r.appendChild(document.createElement(`button`)),s=t?.label||t?.title||``;return s?o.appendChild(document.createTextNode(s)):o.appendChild(d(t?.icon||`more`,n.signal)),i.targetElement=o,o.addEventListener(`click`,()=>i.show()),r.appendChild(i),S(()=>a.get(),e=>r.hidden=e,{signal:n.signal,immediate:!0}),r}function Ae(e,t,n){if(!e){let e=d(`user`,t);return n||e.setAttribute(`fill-opacity`,`0.5`),e}let r=document.createElement(`img`);return r.src=e,r}function je(e,t,n=f()){e.classList.add(`${C}-user-avatar`);let r=l(()=>c.single?null:c.session?.avatar||``).get(),i=new AbortController,a=AbortSignal.any([i.signal,n]),o=r===null?d(`singleUser`,a):Ae(r,a,t);e.appendChild(o),g(()=>{let a=c.single?null:c.session?.avatar||``;if(a===r)return;r=a,i?.abort(),i=new AbortController;let s=AbortSignal.any([i.signal,n]),l=r===null?d(`singleUser`,s):Ae(r,s,t);!t&&r===null&&l.setAttribute(`fill-opacity`,`0.5`),e.replaceChild(l,o),o.remove(),o=l},n);let s=l(()=>{let e=c.impersonation,t=c.session;return!e||e.id===(t?.id||``)?null:e.avatar||``}),u=null,p=null,m=null;g(()=>{let r=s.get();r!==u&&(u=r,p?.remove(),p=null,m?.abort(),r!==null&&(m=new AbortController,p=Ae(r,AbortSignal.any([m.signal,n]),t),e.insertBefore(p,o)))},n)}function Me(t){let n=document.createElement(`div`);n.classList.add(`${C}-user`);let i=n.appendChild(document.createElement(`span`));i.classList.add(`${C}-user-info`);let a=i.appendChild(document.createElement(`span`));je(a,!1,t),a.classList.add(`avatar`);let o=i.appendChild(document.createElement(`span`));o.classList.add(`username`),o.innerText=`用户名`;let s=i.appendChild(document.createElement(`div`)),u=s.appendChild(document.createComment(``));S(()=>e.help,(e,t,n)=>{if(!e){let e=document.createComment(``);u.replaceWith(e),u=e;return}let r=document.createElement(`a`);r.href=e,r.target=`_blank`,r.appendChild(d(`help`,n())),r.title=`帮助`,u.replaceWith(r),u=r},{immediate:!0,signal:t});let f=s.appendChild(document.createElement(`div`));f.appendChild(d(`logout`,t)),f.title=`退出登录`,g(()=>{f.hidden=!c.operator},t),f.addEventListener(`click`,()=>c.exit(!0)),g(()=>{o.innerText=c.operator?.name||``},t);let p=l(()=>r.fromDefine(e.userMenus,[])),m=l(()=>{let e=p.get();return c.operator?e:r.filter(e,e=>!e.logged)}),h=n.appendChild(document.createElement(`main`));h.style.flex=`1`,h.style.overflow=`auto`,h.classList.add(`NavMenu`);let _=null;return g(()=>{_?.abort(),h.innerHTML=``,_=new AbortController,ue(h,m.get(),{signal:_.signal})},t),t.addEventListener(`abort`,()=>_?.abort()),n}function Ne(e){let t=document.createElement(`div`);return t.classList.add(`${C}-user-button`),je(t,!0,e),t}function Pe({hidden:e,title:t,disabled:n,createIcon:r,createPanel:i,href:a,click:o},s){if(s.aborted)return;let c=m(m(!1)),u={get shown(){return c.get().get()},get signal(){return s}},f;if(i){let e=H.createSider(i(u));f=e.button,c.set(l(()=>e.shown)),s.addEventListener(`abort`,()=>{e.remove()},{once:!0})}else if(a){let e=H.createAction(!0);g(()=>{let t=!n?.(u)&&a(u);t?e.href=t:e.removeAttribute(`href`)},s),o&&e.addEventListener(`click`,e=>{o(u)===!1&&e.preventDefault()},{signal:s}),f=e,s.addEventListener(`abort`,()=>{e.remove()},{once:!0})}else{let e=H.createAction();n&&g(()=>{n(u)?e.removeAttribute(`tabIndex`):e.tabIndex=0},s),o&&e.addEventListener(`click`,()=>{o(u)},{signal:s}),f=e,s.addEventListener(`abort`,()=>{e.remove()},{once:!0})}e&&g(()=>{f.hidden=e(u)},s),t&&g(()=>{f.title=t(u)},s),r?f.appendChild(r(u)):f.appendChild(d([`icon`,`logo`],s))}const Fe={title(t){return[t.title,e.title||`拥道YongDall`].filter(Boolean).join(` | `)},icon(e){return e.icon},components:{List:D,Pagination:O,createMenuButtons:W,createMenuItem:G,createMenuButton:K},updatePath:P,pageManager:ae,elements:[y,R],classNames:[C,`${C}-allSider`],styleFiles:[`theme-allSider.css`],home:k,alertError:t,rootClassName:`${C}-root`,createFrame:u,createPage(e){return new De(e)},renderError(e,t){I(e,t)},async setup(e){ie(!1),F.addEventListener(`click`,()=>{xe()},{signal:e}),z.insertBefore(F,z.firstElementChild);let t=H.createSider(A);t.button.appendChild(d(`menu`,e)),t.button.title=`菜单`;let n=H.createSider(T);n.button.appendChild(d(`activity`,e)),n.button.title=`活动`,window.innerWidth>800&&t.show();let r=Me(e),i=Ne(e),a=Te.createSider(r,i);e.addEventListener(`abort`,()=>{F.remove(),t.remove(),n.remove(),a.remove()},{once:!0});for await(let t of v()){if(e.aborted)return;Pe(t,e)}}};function Ie(e,t,{hidden:n,title:r,disabled:i,createIcon:a,createPanel:o,href:s,click:c},u){if(u.aborted)return;let f=e.parentNode;if(!f)return;let p=m(m(!1)),h={get shown(){return p.get().get()},get signal(){return u}},_;if(o){let e=document.createElement(`div`),n=o(h);_=e;let r=m(!0);p.set(l(()=>!p.get())),t.appendChild(n),e.addEventListener(`click`,()=>{n.showPopover()},{signal:u}),n.setAttribute(`popover`,`auto`),n.addEventListener(`toggle`,e=>{r.set(e.newState===`closed`)},{signal:u}),u.addEventListener(`abort`,()=>{n.removeAttribute(`popover`),n.remove()},{once:!0})}else if(s){let e=document.createElement(`a`);c&&e.addEventListener(`click`,e=>{c(h)===!1&&e.preventDefault()},{signal:u}),g(()=>{let t=!i?.(h)&&s(h);t?e.href=t:e.removeAttribute(`href`)},u),_=e}else{let e=document.createElement(`div`);c&&e.addEventListener(`click`,()=>{c(h)},{signal:u}),i&&g(()=>{i(h)?e.removeAttribute(`tabIndex`):e.tabIndex=0},u),_=e}n&&g(()=>{_.hidden=n(h)},u),r&&g(()=>{_.title=r(h)},u),f.insertBefore(_,e),a?_.appendChild(a(h)):_.appendChild(d([`icon`,`logo`],u)),u.addEventListener(`abort`,()=>{_.remove()},{once:!0})}const q=`${C}-base`,Le=[`theme-base.css`],Re=document.createElement(`header`),J=Re.appendChild(document.createElement(`div`));J.classList.add(`${q}-header`);const ze=Re.appendChild(document.createElement(`div`));ze.classList.add(`${q}-sidebar`);const Be=J.appendChild(d(`menu`,!0));Be.classList.add(`${q}-menu-button`);const Ve=J.appendChild(document.createElement(`span`)),Y=`${q}-menu-open`;Be.addEventListener(`click`,()=>{document.body.classList.toggle(Y)}),ze.addEventListener(`click`,e=>{e.target===e.currentTarget&&document.body.classList.remove(Y)});let He=null;const Ue={title(t){return[[He&&t.loading?`⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏`[He.get()%10]:``,t.unsaved?`🔴`:``,t.title].join(``),e.title||`拥道YongDall`].filter(Boolean).join(` | `)},icon(e){return e.icon},components:{List:D,Pagination:O,createMenuButtons:W,createMenuItem:G,createMenuButton:K},updatePath:P,pageManager(e){let t=!1;g(()=>{if(!e.current){t&&e.destroy();return}t=!0},e.signal)},elements:[Re,y],classNames:[C,q],styleFiles:Le,home:k,alertError:t,rootClassName:`${C}-root`,createFrame:u,createPage(e){return new i(e)},renderError(e,t){I(e,t)},async setup(t){He=h(80,t),F.addEventListener(`click`,()=>{window.innerWidth>800||document.body.classList.remove(Y)},{signal:t});let n=document.createElement(`div`);n.classList.add(`${q}-header-title`),g(()=>{n.innerText=e.title||e.company||``},t),J.insertBefore(F,Ve),J.insertBefore(n,Ve),window.innerWidth>800&&document.body.classList.add(Y),ze.appendChild(A);let r=document.createElement(`div`);r.classList.add(`${q}-panels`),document.body.appendChild(r);let i=Me(t);r.appendChild(i),i.setAttribute(`popover`,`auto`);let a=Ne(t);a.addEventListener(`click`,()=>{i.showPopover()},{signal:t});let o=J.appendChild(document.createElement(`div`));o.classList.add(`${q}-actions`);let s=o.appendChild(document.createElement(`span`));o.appendChild(a),t.addEventListener(`abort`,()=>{F.remove(),n.remove(),A.remove(),r.remove(),i.removeAttribute(`popover`),i.remove(),a.remove(),s.remove(),o.remove()},{once:!0});for await(let e of v()){if(t.aborted)return;Ie(s,r,e,t)}}},We=`${C}-pure`,Ge=[`theme-pure.css`];let Ke=null;const qe={title(t){return[[Ke&&t.loading?`⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏`[Ke.get()%10]:``,t.unsaved?`🔴`:``,t.title].join(``),e.title||`拥道YongDall`].filter(Boolean).join(` | `)},icon(e){return e.icon},components:{List:D,Pagination:O,createMenuButtons:W,createMenuItem:G,createMenuButton:K},updatePath:P,pageManager(e){let t=!1;g(()=>{if(!e.current){t&&e.destroy();return}t=!0},e.signal)},elements:[y],classNames:[C,We],styleFiles:Ge,home:k,alertError:t,rootClassName:`${C}-root`,createFrame:u,createPage(e){return new i(e)},renderError(e,t){I(e,t)},async setup(e){Ke=h(80,e)}},X=`${C}-tabs`,Z=document.createElement(`header`),Q=Z.appendChild(document.createElement(`div`));Q.classList.add(`${X}-header`);const Je=Z.appendChild(document.createElement(`div`));Je.classList.add(`${X}-sidebar`);const Ye=Q.appendChild(d(`menu`,!0));Ye.classList.add(`${X}-menu-button`);const Xe=Q.appendChild(document.createElement(`span`)),$=`${X}-menu-open`;Ye.addEventListener(`click`,()=>{document.body.classList.toggle($)});function Ze(){window.innerWidth>800||document.body.classList.remove($)}Je.addEventListener(`click`,e=>{e.target===e.currentTarget&&document.body.classList.remove($)});const Qe={title(t){return[t.title,e.title||`拥道YongDall`].filter(Boolean).join(` | `)},icon(e){return e.icon},components:{List:D,Pagination:O,createMenuButtons:W,createMenuItem:G,createMenuButton:K},updatePath:P,pageManager:ae,elements:[Z,y],classNames:[C,`${C}-tabs`],styleFiles:[`theme-tabs.css`],home:k,alertError:t,rootClassName:`${C}-root`,createFrame:u,createPage(e){return new i(e)},renderError(e,t){I(e,t)},async setup(t){ie(!0),F.addEventListener(`click`,()=>{Ze()},{signal:t});let n=document.createElement(`div`);n.classList.add(`${X}-header-title`),g(()=>{n.innerText=e.title||e.company||``},t),Q.insertBefore(F,Xe),Q.insertBefore(n,Xe),Z.appendChild(T),window.innerWidth>800&&document.body.classList.add($),Je.appendChild(A);let r=document.createElement(`div`);r.classList.add(`${X}-panels`),document.body.appendChild(r);let i=Me(t);r.appendChild(i),i.setAttribute(`popover`,`auto`);let a=Ne(t);a.addEventListener(`click`,()=>{i.showPopover()},{signal:t});let o=Q.appendChild(document.createElement(`div`));o.classList.add(`${X}-actions`);let s=o.appendChild(document.createElement(`span`));o.appendChild(a),t.addEventListener(`abort`,()=>{F.remove(),n.remove(),T.remove(),A.remove(),i.removeAttribute(`popover`),i.remove(),a.remove()},{once:!0});for await(let e of v()){if(t.aborted)return;Ie(s,r,e,t)}}};export{Fe as allSider,Fe as theme,Ue as base,Ue as tradition,qe as pure,Qe as tabs};
4
4
  //# sourceMappingURL=index.mjs.map
package/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["prefix","#table","#thead","#createUrl","#renderList","#labelPattern","#fieldsShow","#idFields","#tr","#tbody","#documents","#fns","#pagination","filter","header","main","allMenus","currentMenus","ac","prefix","header","sidebar","openedClassName","prefix","closeSidebarWhenMobile","Sider","#disabled","#hide","#shown","#click","sidebar","prefix","#children","Sider","span","#page","#parent","#hidden","#sides","addButton","rootContainer","header","prefix","styleFiles","headerEl","header","sidebar","menuButton","span","openedClassName","tick","spinner","theme","rootContainer","prefix","theme","rootContainer","theme","rootContainer"],"sources":["../../packages/theme/styles/variables.mjs","../../packages/theme/pageManager/index.mjs","../../packages/theme/components/List.mjs","../../packages/theme/components/Pagination.mjs","../../packages/theme/home/index.mjs","../../packages/theme/menu/createNavMenu.mts","../../packages/theme/workspace/index.mjs","../../packages/theme/user/userAvatar.mjs","../../packages/theme/user/index.mjs","../../packages/theme/logo.mjs","../../packages/theme/error/index.mjs","../../packages/theme/theme-allSider/dom.mjs","../../packages/theme/theme-allSider/Sider.mjs","../../packages/theme/theme-allSider/Group.mjs","../../packages/theme/theme-allSider/sides.mjs","../../packages/theme/theme-allSider/AllSiderPage.mjs","../../packages/theme/menu/createMenu.mts","../../packages/theme/menu/createMenuButtons.mts","../../packages/theme/menu/createMenuItem.mts","../../packages/theme/menu/createMenuButton.mts","../../packages/theme/theme-allSider/index.mts","../../packages/theme/utils/addButton.mts","../../packages/theme/theme-base/index.mts","../../packages/theme/theme-pure/index.mts","../../packages/theme/theme-tabs/dom.mjs","../../packages/theme/theme-tabs/index.mts"],"sourcesContent":["export const cssPrefix = `YongDallTheme`;\n","import { effect, waitAbortSignal } from '@yongdall/web';\n/** @import { PageHandle, PageManager } from '@yongdall/web' */\nimport { cssPrefix } from '../styles/variables.mjs';\nconst prefix = `${cssPrefix}-activity`;\n\nexport const activityContainer = document.createElement('div');\nactivityContainer.classList.add(prefix);\n\n\n\n/**\n * @typedef {object} ButtonProxy\n * @property {HTMLElement} button\n * @property {HTMLAnchorElement} link\n * @property {ButtonProxy} [last]\n * @property {ButtonProxy} [next]\n */\n\n/** @type {Map<PageHandle, ButtonProxy>} */\nconst buttons = new Map();\n/** @type {ButtonProxy | undefined} */\nlet first;\nlet append = false;\n/**\n * \n * @param {boolean} a \n */\nexport function setMode(a){\n\tappend = a;\n}\n/** @type {PageManager} */\nconst pageManager = (page) => {\n\tconst button = document.createElement('div');\n\tbutton.classList.add(`${prefix}-page`);\n\tconst link = button.appendChild(document.createElement('a'));\n\tlink.classList.add(`${prefix}-title`);\n\tlink.href = page.href;\n\tlink.innerText = page.title;\n\tconst close = button.appendChild(document.createElement('button'));\n\tclose.type = 'button';\n\tclose.classList.add(`${prefix}-close`);\n\tclose.addEventListener('click', () => {\n\t\tpage.destroy();\n\t});\n\t/** @type {ButtonProxy} */\n\tconst btn = {\n\t\tbutton, link,\n\t\tnext: first,\n\t};\n\tif (first) { first.last = btn; }\n\tfirst = btn;\n\tbuttons.set(page, btn);\n\tactivityContainer.insertBefore(button, append ? null : activityContainer.firstChild);\n\n\teffect(() => { link.innerText = page.title; }, page.signal);\n\teffect(() => { link.href = page.href; }, page.signal);\n\n\teffect(() => {\n\t\tif (page.current) {\n\t\t\tbutton.classList.add(`${prefix}-current`);\n\t\t} else {\n\t\t\tbutton.classList.remove(`${prefix}-current`);\n\t\t}\n\t}, page.signal);\n\teffect(() => {\n\t\tif (page.loading) {\n\t\t\tbutton.classList.add(`${prefix}-loading`);\n\t\t} else {\n\t\t\tbutton.classList.remove(`${prefix}-loading`);\n\t\t}\n\t}, page.signal);\n\teffect(() => {\n\t\tif (page.unsaved) {\n\t\t\tbutton.classList.add(`${prefix}-unsaved`);\n\t\t} else {\n\t\t\tbutton.classList.remove(`${prefix}-unsaved`);\n\t\t}\n\t}, page.signal);\n\twaitAbortSignal(page.signal).then(() => {\n\t\tconst { last, next } = btn;\n\t\tif (last) { last.next = next; }\n\t\tif (next) { next.last = last; }\n\t\tif (first === btn) { first = next; }\n\t\tbutton.remove();\n\t});\n};\nexport default pageManager;\n","/** @import { FieldScriptConfiguration, ModelScriptConfiguration } from '@yongdall/web' */\nimport { createShowField, Pattern } from '@yongdall/web';\n\n\nexport default class List {\n\t/** @type {((id: string) => string)?} */\n\t#createUrl;\n\t/** @type {readonly [string, FieldScriptConfiguration][]} */\n\t#fieldsShow;\n\t/** @type {string} */\n\t#labelPattern;\n\t/** @type {string[]} */\n\t#idFields;\n\t/** @type {readonly any[]} */\n\t#documents = [];\n\t#table = document.createElement('table');\n\t#thead = this.#table.appendChild(document.createElement('thead'));\n\t#tr = this.#thead.appendChild(document.createElement('tr'));\n\t#tbody = this.#table.appendChild(document.createElement('tbody'));\n\tget root() { return this.#table }\n\tget createUrl() {\n\t\treturn this.#createUrl;\n\t}\n\tset createUrl(fn) {\n\t\tconst createUrl = typeof fn === 'function' ? fn : null;\n\t\tif (this.#createUrl === createUrl) { return }\n\t\tthis.#createUrl = createUrl;\n\t\tthis.#renderList();\n\t}\n\t/**\n\t * \n\t * @param {(id: string) => string} createUrl \n\t * @param {ModelScriptConfiguration} model \n\t */\n\tconstructor(createUrl, model) {\n\t\tconst fieldsShow = Object.entries(model.fields).filter(([,{type}]) => type && typeof type !== 'object');\n\t\tconst idFields = Object.entries(model.fields).filter(([,v]) => v.primary).map(([v]) => v);\n\t\tconst labelPattern = model.labelPattern || '';\n\t\tthis.#labelPattern = labelPattern;\n\t\tthis.#createUrl = typeof createUrl === 'function' ? createUrl : null;\n\t\tthis.#fieldsShow = fieldsShow;\n\t\tthis.#idFields = idFields;\n\t\tconst tr = this.#tr;\n\t\ttr.innerHTML = '';\n\t\tconst th = tr.appendChild(document.createElement('th'));\n\t\tth.appendChild(document.createTextNode('#'));\n\t\tfor (const [name,field] of fieldsShow) {\n\t\t\tconst th = tr.appendChild(document.createElement('th'));\n\t\t\tth.appendChild(document.createTextNode(field.label || name));\n\t\t}\n\t}\n\t#renderList() {\n\t\tconst tbody = this.#tbody;\n\t\ttbody.innerHTML = '';\n\t\tconst idFields = this.#idFields;\n\t\tconst labelPattern = this.#labelPattern;\n\t\tconst fieldsShow = this.#fieldsShow;\n\t\tconst createUrl = this.#createUrl;\n\t\tfor (const r of this.#documents) {\n\t\t\tconst tr = tbody.appendChild(document.createElement('tr'));\n\t\t\tconst td = tr.appendChild(document.createElement('td'));\n\t\t\tconst label = Pattern.generate(labelPattern, r) || idFields.map(v => r[v]).join('$')\n\t\t\tif (createUrl) {\n\t\t\t\tconst a = td.appendChild(document.createElement('a'));\n\t\t\t\ta.href = createUrl(idFields.map(v => r[v]).join('$'));\n\t\t\t\ta.appendChild(document.createTextNode(label));\n\t\t\t} else {\n\t\t\t\ttd.appendChild(document.createTextNode(label));\n\t\t\t}\n\t\t\tfor (const [name,field] of fieldsShow) {\n\t\t\t\tconst td = tr.appendChild(document.createElement('td'));\n\t\t\t\tconst f = createShowField(name, field, {inline: true}, r);\n\t\t\t\ttd.appendChild(f.root);\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * \n\t * @param {readonly any[]} list \n\t */\n\tsetData(list) {\n\t\tthis.#documents = list;\n\t\tthis.#renderList();\n\n\t}\n\tdestroy() {\n\t\t\n\t}\n}\n","import { Pagination as NlPagination } from '@neeloong/components'\n\nexport default class Pagination {\n\t#fns;\n\t#pagination;\n\tconstructor() {\n\t\tconst pagination = /** @type {NlPagination} */(document.createElement('nl-pagination'));\n\t\tpagination.size = 20;\n\t\tpagination.appendChild(/** @type {NlPagination.Value} */(document.createElement('nl-pagination-value'))).name=\"start\";\n\t\tpagination.appendChild(document.createTextNode('-'));\n\t\tpagination.appendChild(/** @type {NlPagination.Value} */(document.createElement('nl-pagination-value'))).name=\"end\";\n\t\tpagination.appendChild(document.createTextNode('/'));\n\t\tpagination.appendChild(/** @type {NlPagination.Value} */(document.createElement('nl-pagination-value'))).name=\"total\";\n\t\tpagination.appendChild(document.createElement('nl-pagination-prev')).innerText = '上一页';\n\t\tpagination.appendChild(document.createElement('nl-pagination-pager'));\n\t\tpagination.appendChild(document.createElement('nl-pagination-next')).innerText = '下一页';\n\t\tpagination.appendChild(document.createElement('nl-pagination-sizer'));\n\t\tconst fns = new Set();\n\t\t\n\t\tpagination.addEventListener('change', () => {\n\t\t\tfor (const fn of fns) {\n\t\t\t\tfn();\n\t\t\t}\n\t\t})\n\t\tthis.#fns = fns;\n\t\tthis.#pagination = pagination;\n\n\t}\n\tget root() {return this.#pagination; }\n\tget size() { return this.#pagination.size}\n\tset size(v) { this.#pagination.size = v}\n\tget page() { return this.#pagination.page}\n\tset page(v) { this.#pagination.page = v}\n\tget total() { return this.#pagination.total}\n\tset total(v) { this.#pagination.total = v}\n\t/**\n\t * \n\t * @param {(p: Pagination) => void} listen \n\t * @returns {() => void}\n\t */\n\tlisten(listen) {\n\t\tconst fns = this.#fns;\n\t\tconst f = () => listen(this);\n\t\tfns.add(f);\n\t\treturn () => {fns.delete(f)}\n\t}\n\tdestroy() {\n\t\t\n\t}\n}\n","/** @import { HomeContext } from '@yongdall/web' */\n/**\n *\n * @param {string} href\n * @param {string} title\n */\nfunction createLink(href, title) {\n\tconst a = document.createElement('a');\n\ta.href = href;\n\ta.title = title;\n\ta.style.display = 'block';\n\ta.appendChild(document.createTextNode(title));\n\treturn a;\n}\n\n\n/**\n * @param {HTMLElement} container\n */\nfunction renderHome(container) {\n}\n\n\n/**\n * \n * @param {HomeContext} homeContext \n */\nexport default function home(homeContext) {\n\thomeContext.listen('update', () => {\n\t\tconst { container } = homeContext;\n\t\tcontainer.innerHTML = '';\n\t\treturn renderHome(container);\n\t});\n}\n","import type { Menu } from '@yongdall/web';\nimport type { Collapse } from '@neeloong/components';\nimport '@neeloong/components';\nimport { Application, createNeverAbortedSignal, Ident, PageIdent, watch } from '@yongdall/web';\n\n\n\nfunction* toFindPath(\n\tactive: string,\n\tmenuMap: Map<string, HTMLElement[]>,\n\tpathMenuMap: Map<string, [HTMLElement, number: number][]>,\n): IterableIterator<HTMLElement[]> {\n\tif (!active) { return; }\n\tconst index = active.indexOf('?');\n\tconst path = index < 0 ? active : active.slice(0, index);\n\tif (index >= 0 && index + 1 < active.length) {\n\t\tfor (const list = active.slice(index).split('&'); list.length; list.pop()) {\n\n\t\t\tconst menus = menuMap.get(`${path}${list.join('&')}`);\n\t\t\tif (!menus?.length) { continue; }\n\t\t\tyield menus;\n\t\t}\n\n\t}\n\n\tconst menus = menuMap.get(path);\n\tif (menus?.length) { yield menus; }\n\tconst pathMenus = pathMenuMap.get(path);\n\tif (pathMenus?.length) { yield pathMenus.map(v => v[0]); }\n}\n\n\nfunction* findMenu(\n\tactive: string,\n\tmenuMap: Map<string, HTMLElement[]>,\n\tpathMenuMap: Map<string, [HTMLElement, number: number][]>,\n\tident: PageIdent | null,\n\tidentMap: Map<string, HTMLElement[]>,\n): IterableIterator<HTMLElement[]> {\n\tyield* toFindPath(active, menuMap, pathMenuMap);\n\tif (!ident) { return; }\n\tfor (const p of [...Ident.stringifyPaths(ident)].reverse()) {\n\t\tconst menus = identMap.get(p);\n\t\tif (!menus?.length) { continue; }\n\t\tyield menus;\n\t}\n}\n\n\nfunction* findTextNode(element: HTMLElement): Iterable<Text> {\n\tconst walker = document.createTreeWalker(element, NodeFilter.SHOW_TEXT);\n\tfor (let node; node = walker.nextNode();) {\n\t\t// @ts-ignore\n\t\tyield node;\n\t}\n}\n\nfunction filter(texts: string[], element: HTMLElement): Range[] {\n\tconst ranges = [];\n\n\tconst textNodes = [...findTextNode(element)].filter(n => n.nodeValue?.length);\n\tconst indexes = textNodes.reduce<[number, number, Text][]>((list, currentValue) => {\n\t\tconst index = list[list.length - 1]?.[1] || 0;\n\t\treturn [...list, [\n\t\t\tindex,\n\t\t\tindex + (currentValue.nodeValue?.length || 0),\n\t\t\tcurrentValue,\n\t\t]];\n\t}, []);\n\tconst fullText = textNodes.map(n => n.nodeValue).join('');\n\n\tlet startIndex = 0;\n\tfor (const searchText of texts) {\n\t\tconst index = fullText.indexOf(searchText, startIndex);\n\t\tif (index === -1) { return []; }\n\t\tconst endIndex = index + searchText.length;\n\n\t\tconst start = indexes.findLast(([start]) => start <= index);\n\t\tif (!start) { return []; }\n\t\tconst end = indexes.findLast(([, end]) => end >= endIndex);\n\t\tif (!end) { return []; }\n\t\tstartIndex = index + searchText.length;\n\n\n\t\tconst range = new Range();\n\t\trange.setStart(start[2], index - start[0]);\n\t\trange.setEnd(end[2], endIndex - start[0]);\n\t\tranges.push(range);\n\t}\n\treturn ranges;\n}\n\nexport default function createNavMenu(\n\troot: Element,\n\tmenus: (Menu | null)[],\n\toptions: {\n\t\tactive?: string | [string | null | undefined, PageIdent | null | undefined];\n\t\tsignal?: AbortSignal;\n\t\tfilter?: string;\n\t} = {},\n) {\n\tconst pathMenuMap: Map<string, [HTMLElement, number: number][]> = new Map();\n\tconst menuMap: Map<string, HTMLElement[]> = new Map();\n\tconst identMap: Map<string, HTMLElement[]> = new Map();\n\tlet current: HTMLElement | null = null;\n\tconst allMenus: HTMLElement[] = [];\n\tconst destroyList: (() => void)[] = [];\n\n\tfunction createLink(menu: Menu | Menu.Button, el?: HTMLElement) {\n\t\tconst link = document.createElement('a');\n\t\tconst item = link;\n\t\tlink.appendChild(document.createTextNode(menu.label || menu.title || ''));\n\t\tlink.title = menu.title || '';\n\t\tconst { page, path, uri, target } = menu;\n\t\tlet url: URL | null = null;\n\t\tconst ident = page && Ident.parse(page);\n\t\tif (ident) {\n\t\t\turl = new URL(PageIdent.stringify(ident, path), Application.root);\n\t\t\tlink.href = url.href;\n\t\t\tif (target && typeof target === 'string') { link.target = target; }\n\n\t\t} else if (uri) {\n\t\t\tlink.href = uri;\n\t\t\ttry {\n\t\t\t\turl = new URL(uri);\n\t\t\t\tif (url.origin !== location.origin) {\n\t\t\t\t\turl = null;\n\t\t\t\t}\n\t\t\t} catch { }\n\t\t\tif (target !== '') { link.target = target ?? '_blank'; }\n\t\t}\n\t\tif (url && (link.target || '_self') === '_self') {\n\t\t\tlink.addEventListener('click', () => {\n\t\t\t\tclickedItem = item;\n\t\t\t\trequestIdleCallback(() => {\n\t\t\t\t\tif (clickedItem !== item) { return; }\n\t\t\t\t\tclickedItem = null;\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst { pathname: pathname, search } = url;\n\t\t\tconst fullPath = `${pathname}${search}`;\n\t\t\tconst list = menuMap.get(fullPath);\n\t\t\tif (list) {\n\t\t\t\tlist.push(item);\n\t\t\t} else {\n\t\t\t\tmenuMap.set(pathname, [item]);\n\t\t\t}\n\t\t\tconst list2 = pathMenuMap.get(fullPath);\n\t\t\tif (list2) {\n\t\t\t\tlist2.push([item, search.length]);\n\t\t\t} else {\n\t\t\t\tpathMenuMap.set(pathname, [[item, search.length]]);\n\t\t\t}\n\t\t\tif (ident && (!path || path[0] === '?' || path[0] === '#')) {\n\t\t\t\tconst key = Ident.stringify(ident);\n\t\t\t\tconst list = identMap.get(key);\n\t\t\t\tif (list) {\n\t\t\t\t\tlist.push(item);\n\t\t\t\t} else {\n\t\t\t\t\tidentMap.set(key, [item]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn link;\n\t}\n\n\tfunction createButton(button: Menu.Button) {\n\t\tconst link = createLink(button);\n\t\tlink.classList.add('NavMenu-button');\n\t\treturn link;\n\t}\n\tlet clickedItem: HTMLElement | null = null;\n\n\n\tfunction renderMenu(\n\t\tmenu: Menu,\n\t\tlevel: number,\n\t): { el: HTMLElement; filter(show: boolean, t?: string[] | null): Range[]; } | null {\n\t\tconst { children } = menu;\n\t\tif (!children.length) {\n\t\t\tconst item = document.createElement('div');\n\t\t\tconst link = item.appendChild(createLink(menu, item));\n\n\t\t\tfor (const button of menu.buttons || []) {\n\t\t\t\titem.appendChild(createButton(button));\n\t\t\t}\n\t\t\titem.classList.add('NavMenu-item');\n\t\t\tlink.classList.add('NavMenu-item-link');\n\t\t\treturn {\n\t\t\t\tel: item, filter(show, text) {\n\t\t\t\t\tconst list = text ? filter(text, link) : [];\n\t\t\t\t\titem.hidden = Boolean(!show && text && !list.length);\n\t\t\t\t\treturn list;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\tconst item = document.createElement('nl-collapse') as Collapse;\n\t\titem.setAttribute('animation', '');\n\t\titem.setAttribute('menu', '');\n\t\tconst header = item.appendChild(document.createElement('div'));\n\t\theader.appendChild(document.createTextNode(menu.label || menu.title || ''));\n\t\theader.className = 'NavMenu-label';\n\t\theader.slot = 'label';\n\t\theader.style.flex = '1';\n\t\tfor (const button of menu.buttons || []) {\n\t\t\titem.appendChild(createButton(button)).slot = 'label';\n\t\t}\n\t\tconst childrenMenu = renderChildren(item, children, level + 1);\n\t\tif (!childrenMenu.length) { return null; }\n\t\treturn {\n\t\t\tel: item, filter(show, text) {\n\t\t\t\tif (!text) {\n\t\t\t\t\tfor (const menu of childrenMenu) { menu.filter(show); }\n\t\t\t\t\titem.hidden = false;\n\t\t\t\t\titem.open = false;\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tconst self = filter(text, header);\n\t\t\t\tconst hasSelf = Boolean(show || self.length);\n\n\t\t\t\tconst ranges = childrenMenu.flatMap(v => v.filter(hasSelf, text));\n\t\t\t\titem.open = Boolean(ranges.length);\n\t\t\t\tconst list = [...self, ...ranges];\n\t\t\t\titem.hidden = !show && !list.length;\n\t\t\t\treturn list;\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction renderChildren(\n\t\tparent: Element,\n\t\tmenus: (Menu | null)[],\n\t\tlevel: number,\n\t) {\n\t\tlet has = false;\n\t\tlet divider = false;\n\t\tlet children = [];\n\t\tfor (const menu of menus) {\n\t\t\tif (!menu) {\n\t\t\t\tif (!has) { continue; }\n\t\t\t\tdivider = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (divider) {\n\t\t\t\tdivider = false;\n\t\t\t\tparent.appendChild(document.createElement('hr'));\n\t\t\t}\n\t\t\tconst item = renderMenu(menu, level);\n\t\t\tif (!item) { continue; }\n\t\t\tchildren.push(item);\n\t\t\thas = true;\n\t\t\tparent.appendChild(item.el);\n\t\t\tallMenus.push(item.el);\n\t\t\titem.el.style.setProperty('--NavMenu-level', String(level));\n\t\t}\n\t\treturn children;\n\t}\n\tconst menuList = renderChildren(root, menus, 0);\n\tlet destroyed = false;\n\tfunction destroy() {\n\t\tif (destroyed) { return; }\n\t\tdestroyed = true;\n\t\tfor (const m of allMenus) {\n\t\t\tm.remove();\n\t\t}\n\t\tfor (const destroy of destroyList) {\n\t\t\tdestroy();\n\t\t}\n\t}\n\tconst signal = options.signal || createNeverAbortedSignal();\n\tif (signal.aborted) {\n\t\tdestroy();\n\t} else {\n\t\tsignal.addEventListener('abort', destroy, { once: true });\n\t}\n\tlet parents: HTMLElement[] = [];\n\twatch(() => {\n\t\tconst active = options.active;\n\t\tif (!active) { return null; }\n\t\tif (typeof active === 'string') {\n\t\t\treturn active.replace(/#.*/, '') || '';\n\t\t}\n\t\tif (!Array.isArray(active)) { return null; }\n\t\tconst page = active[1] || null;\n\t\tif (!page) {\n\t\t\treturn active[0]?.replace(/#.*/, '') || null;\n\n\t\t}\n\t\tconst result: [string, PageIdent | null] = [active[0]?.replace(/#.*/, '') || '', active[1] || null];\n\t\treturn result;\n\t}, active => {\n\t\tif (!active) { return; }\n\t\tconst path = Array.isArray(active) ? active[0] : '';\n\t\tconst page = Array.isArray(active) ? active[1] : null;\n\t\tfor (const menus of findMenu(path, menuMap, pathMenuMap, page, identMap)) {\n\t\t\tconst clicked = clickedItem && menus.includes(clickedItem) ? clickedItem : null;\n\t\t\tif (clicked) { clickedItem = null; }\n\t\t\tif (!clicked && current && menus.includes(current)) { return; }\n\t\t\tconst menu = clicked || menus[0];\n\t\t\tconst list = [];\n\t\t\tlet parent = menu.parentElement;\n\t\t\tfor (; parent && parent !== root; parent = parent.parentElement) {\n\t\t\t\tlist.push(parent);\n\t\t\t}\n\t\t\tif (parent !== root) { return; }\n\t\t\tparents = list;\n\t\t\tcurrent?.classList.remove('NavMenu-current');\n\t\t\tfor (const item of parents) {\n\t\t\t\titem.setAttribute('open', '');\n\t\t\t}\n\t\t\tcurrent = menu;\n\t\t\tcurrent?.classList.add('NavMenu-current');\n\t\t\treturn;\n\t\t}\n\n\n\t}, { signal, immediate: true });\n\n\treturn (text: string) => {\n\t\tconst texts: string[] | null = text.toLowerCase().split(/[\\s\\n]+/).filter(Boolean);\n\t\tif (texts.length) {\n\t\t\treturn menuList.flatMap(v => v.filter(false, texts));\n\t\t}\n\t\tmenuList.flatMap(v => v.filter(false));\n\t\tfor (const item of parents) {\n\t\t\titem.setAttribute('open', '');\n\t\t}\n\t\treturn [];\n\t};\n}\n","import { Application, createComputed, createIcon, createState, effect, flatPermission, Menu, PageIdent, toPermissionFilter, User } from '@yongdall/web';\nimport createNavMenu from '../menu/createNavMenu.mts';\n\n\n\n\nexport const menuContainer = document.createElement('div');\n\n\nmenuContainer.style.display = 'flex';\nmenuContainer.style.flexDirection = 'column';\nconst header = menuContainer.appendChild(document.createElement('header'));\nheader.classList.add('NavMenu-header');\nconst filter = header.appendChild(document.createElement('input'));\nfilter.placeholder = '过滤菜单...';\nfilter.type = 'search';\nconst refreshButton = header.appendChild(document.createElement('button'));\nrefreshButton.appendChild(createIcon('refresh', true));\nrefreshButton.classList.add('icon');\nrefreshButton.title = '刷新';\n\n\nconst main = menuContainer.appendChild(document.createElement('main'));\nmain.style.flex = '1';\nmain.style.overflow = 'auto';\nmain.classList.add('NavMenu');\nlet k = 0;\nlet loaded = false;\n/** @type {ReturnType<typeof createNavMenu>?} */\nlet navMenu = null;\nfunction filterMenu() {\n\tconst list = navMenu?.(filter.value) || [];\n\tconst highlight = new Highlight(...list);\n\tCSS.highlights.set(\"NavMenu-filter-highlight\", highlight);\n}\nfilter.addEventListener('input', filterMenu);\n\nconst allMenus = createComputed(\n\t() => Menu.fromDefine(Application.menus, [])\n);\nconst currentMenus = createComputed(() => {\n\tconst permissions = User.permissions;\n\tconst menus = allMenus.get();\n\tif (permissions.size < 0) { return menus; }\n\n\tconst filter = toPermissionFilter({\n\t\tpermissions,\n\t\torganizationPermissions: User.organizationPermissions,\n\t\tallOrganizationPermissions: User.allOrganizationPermissions,\n\t});\n\treturn Menu.filter(menus, m => {\n\t\tconst permissions = flatPermission(m.permission);\n\t\tif (!permissions.length) { return true; }\n\t\treturn Boolean(permissions.find(filter));\n\t});\n});\nconst currentPath = createState(/** @type {string | [string, PageIdent]} */(''));\n/** @type {AbortController?} */\nlet ac = null;\neffect(() => {\n\tac?.abort();\n\tmain.innerHTML = '';\n\tac = new AbortController();\n\tnavMenu = createNavMenu(main, currentMenus.get(), {\n\t\tsignal: ac.signal,\n\t\tget active() { return currentPath.get(); },\n\t});\n\tfilterMenu();\n});\n/**\n * \n * @param {string} path \n * @param {string} search \n * @param {string} hash \n * @param {(PageIdent & {path: string})?} page \n */\nexport function updatePath(path, search, hash, page) {\n\tif (!page) {\n\t\tcurrentPath.set(`${path}${search}`);\n\t\treturn;\n\t}\n\tcurrentPath.set([`${path}${search}`, page]);\n}\n\nrefreshButton.addEventListener('click', () => Application.loadMenus(true));\n","import { createComputed, createIcon, createNeverAbortedSignal, effect, User } from '@yongdall/web';\nimport { cssPrefix } from '../styles/variables.mjs';\n\n\n/**\n * \n * @param {string} avatar \n * @param {AbortSignal} signal\n * @param {boolean} [button] \n */\nfunction createAvatar(avatar, signal, button) {\n\tif (!avatar) {\n\t\tconst svg = createIcon('user', signal);\n\t\tif (!button) { svg.setAttribute('fill-opacity', '0.5'); }\n\t\treturn svg;\n\t}\n\tconst img = document.createElement('img');\n\timg.src = avatar;\n\treturn img;\n\n}\n/**\n * \n * @param {HTMLElement} root \n * @param {boolean} [button] \n * @param {AbortSignal} [signal] \n * @returns \n */\nexport function createUserAvatar(root, button, signal = createNeverAbortedSignal()) {\n\troot.classList.add(`${cssPrefix}-user-avatar`);\n\n\tconst sessionAvatarComputed = createComputed(() => User.single ? null : User.session?.avatar || '');\n\t/** @type {string?} */\n\tlet sessionAvatar = sessionAvatarComputed.get();\n\t/** @type {AbortController?} */\n\tlet sessionAbortController = new AbortController();\n\tconst sessionSignal = AbortSignal.any([sessionAbortController.signal, signal]);\n\tlet sessionAvatarElement = sessionAvatar === null\n\t\t? createIcon('singleUser', sessionSignal)\n\t\t: createAvatar(sessionAvatar, sessionSignal, button);\n\troot.appendChild(sessionAvatarElement);\n\teffect(() => {\n\t\tconst newAvatar = User.single ? null : User.session?.avatar || '';\n\t\tif (newAvatar === sessionAvatar) { return; }\n\t\tsessionAvatar = newAvatar;\n\t\tsessionAbortController?.abort();\n\t\tsessionAbortController = new AbortController();\n\n\t\tconst sessionSignal = AbortSignal.any([sessionAbortController.signal, signal]);\n\t\tconst newAvatarElement = sessionAvatar === null\n\t\t\t? createIcon('singleUser', sessionSignal)\n\t\t\t: createAvatar(sessionAvatar, sessionSignal, button);\n\t\tif (!button && sessionAvatar === null) {\n\t\t\tnewAvatarElement.setAttribute('fill-opacity', '0.5');\n\t\t}\n\t\troot.replaceChild(newAvatarElement, sessionAvatarElement);\n\t\tsessionAvatarElement.remove();\n\t\tsessionAvatarElement = newAvatarElement;\n\t}, signal);\n\n\tconst targetAvatarComputed = createComputed(() => {\n\t\tconst impersonation = User.impersonation;\n\t\tconst session = User.session;\n\t\tif (!impersonation) { return null; }\n\t\tif (impersonation.id === (session?.id || '')) { return null; }\n\t\treturn impersonation.avatar || '';\n\t});\n\t/** @type {string?} */\n\tlet targetAvatar = null;\n\t/** @type {Element?} */\n\tlet targetAvatarElement = null;\n\t/** @type {AbortController?} */\n\tlet targetAbortController = null;\n\teffect(() => {\n\t\tconst newAvatar = targetAvatarComputed.get();\n\t\tif (newAvatar === targetAvatar) { return; }\n\t\ttargetAvatar = newAvatar;\n\t\ttargetAvatarElement?.remove();\n\t\ttargetAvatarElement = null;\n\t\ttargetAbortController?.abort();\n\t\tif (newAvatar === null) { return; }\n\t\ttargetAbortController = new AbortController();\n\t\tconst targetSignal = AbortSignal.any([targetAbortController.signal, signal]);\n\t\ttargetAvatarElement = createAvatar(newAvatar, targetSignal, button);\n\t\troot.insertBefore(targetAvatarElement, sessionAvatarElement);\n\t}, signal);\n\n}\n","import { Application, createComputed, createIcon, effect, Menu, User, watch } from '@yongdall/web';\nimport { createUserAvatar } from './userAvatar.mjs';\nimport { cssPrefix } from '../styles/variables.mjs';\nimport createNavMenu from '../menu/createNavMenu.mts';\n\nexport const userContainer = document.createElement('div');\nuserContainer.classList.add(`${cssPrefix}-user`);\nexport const userButton = document.createElement('div');\nuserButton.classList.add(`${cssPrefix}-user-button`);\ncreateUserAvatar(userButton, true);\nconst userInfo = userContainer.appendChild(document.createElement('span'));\nuserInfo.classList.add(`${cssPrefix}-user-info`);\nconst avatar = userInfo.appendChild(document.createElement('span'));\ncreateUserAvatar(avatar);\navatar.classList.add('avatar');\nconst username = userInfo.appendChild(document.createElement('span'));\nusername.classList.add('username');\nusername.innerText = '用户名';\nconst btns = userInfo.appendChild(document.createElement('div'));\n\n/** @type {ChildNode} */\nlet helpEl = btns.appendChild(document.createComment(''));\nwatch(() => Application.help, (help, _help, onCleanup) => {\n\tif (!help) {\n\t\tconst el = document.createComment('');\n\t\thelpEl.replaceWith(el);\n\t\thelpEl = el;\n\t\treturn;\n\t}\n\tconst el = document.createElement('a');\n\tel.href = help;\n\tel.target = '_blank';\n\tel.appendChild(createIcon('help', onCleanup()));\n\tel.title = '帮助';\n\thelpEl.replaceWith(el);\n\thelpEl = el;\n}, { immediate: true });\n\nconst exitButton = btns.appendChild(document.createElement('div'));\nexitButton.appendChild(createIcon('logout', true));\nexitButton.title = '退出登录';\neffect(() => {\n\texitButton.hidden = !User.operator;\n});\nexitButton.addEventListener('click', () => User.exit(true));\n\neffect(() => {\n\tusername.innerText = User.operator?.name || '';\n});\n\n\nconst allMenus = createComputed(\n\t() => Menu.fromDefine(Application.userMenus, [])\n);\n\n\nconst currentMenus = createComputed(() => {\n\tconst menus = allMenus.get();\n\tif (User.operator) { return menus; }\n\treturn Menu.filter(menus, v => !v.logged);\n});\n\nconst main = userContainer.appendChild(document.createElement('main'));\nmain.style.flex = '1';\nmain.style.overflow = 'auto';\nmain.classList.add('NavMenu');\n\n/** @type {AbortController?} */\nlet ac = null;\neffect(() => {\n\tac?.abort();\n\tmain.innerHTML = '';\n\tac = new AbortController();\n\tcreateNavMenu(main, currentMenus.get(), {\n\t\tsignal: ac.signal,\n\t});\n});\n","\nimport { Application, createIcon, toFileLink, watch } from '@yongdall/web';\nimport { cssPrefix } from './styles/variables.mjs';\n\nconst logoLink = document.createElement('a');\nlogoLink.classList.add(`${cssPrefix}-logo`);\nwatch(() => Application.root, root => {\n\tlogoLink.href = root;\n}, { immediate: true });\nwatch(() => toFileLink(Application.logo), (logo, _logo, onCleanup) => {\n\tconst signal = onCleanup();\n\tlet logoEl;\n\tif (logo) {\n\t\tlogoEl = document.createElement('img');\n\t\tlogoEl.src = logo.href;\n\t} else {\n\t\tlogoEl = createIcon('logo', signal);\n\t}\n\tlogoLink.appendChild(logoEl);\n\tlogoEl.classList.add('logo');\n\tonCleanup(() => { logoEl.remove(); });\n}, { immediate: true });\nexport { logoLink };\n","/** @import { PageContext } from '@yongdall/web' */\n\n/**\n * @typedef {object} PageError\n * @property {string} title\n * @property {string} [description]\n */\n\n/** @type {Record<string, PageError>} */\nexport const errors = {\n\t404: {\n\t\ttitle: '您所请求的页面无法找到',\n\t\tdescription: '服务器无法正常提供信息。\\n目标页面可能已经被更改、删除或移到其他位置,或您所输入页面地址错误。',\n\t}\n};\n\n/**\n * @param {PageContext} ctx\n * @param {unknown} error\n */\nexport default function renderError(ctx, error) {\n\tif ((error ?? '') == '') {\n\t\tctx.container.appendChild(document.createTextNode('空页面'));\n\t\treturn;\n\t}\n\tconst e = (typeof error === 'number' || typeof error === 'string')\n\t\t&& Object.hasOwn(errors, error) && errors[error]\n\t\t|| errors['404'];\n\tconst title = e?.title || 'Error';\n\tconst info = e?.description;\n\tconst errorContainer = document.createElement('div');\n\tconst main = errorContainer.appendChild(document.createElement('div'));\n\tconst titleDiv = main.appendChild(document.createElement('div'));\n\tconst infoDiv = main.appendChild(document.createElement('div'));\n\terrorContainer.style.marginBlock = '8%';\n\terrorContainer.style.marginInline = 'auto';\n\terrorContainer.style.inlineSize = '600px';\n\terrorContainer.style.maxInlineSize = '100%';\n\terrorContainer.style.padding = '20px';\n\ttitleDiv.style.paddingBlock = '20px';\n\ttitleDiv.style.fontSize = '20px';\n\ttitleDiv.style.color = '#8e8e8e';\n\ttitleDiv.style.textAlign = 'center';\n\tinfoDiv.style.fontSize = '13px';\n\tinfoDiv.style.lineHeight = '1.3em';\n\tinfoDiv.style.color = '#b5b5b5';\n\ttitleDiv.appendChild(document.createTextNode(title));\n\tctx.title = title || 'Error';\n\tif (info && typeof info === 'string') {\n\t\tfor (const p of info.split('\\n')) {\n\t\t\tinfoDiv.appendChild(document.createTextNode(p));\n\t\t\tinfoDiv.appendChild(document.createElement('br'));\n\t\t}\n\t}\n\tctx.container.appendChild(errorContainer);\n\tctx.loading = false;\n}\n","import { cssPrefix } from '../styles/variables.mjs';\n\nexport const prefix = `${cssPrefix}-allSider-nav`\n\nexport const header = document.createElement('header');\nheader.className = `${prefix}-header`;\nexport const actions = header.appendChild(document.createElement('div'));\nactions.classList.add(`${prefix}-actions`)\nexport const sidebar = header.appendChild(document.createElement('div'));\nsidebar.classList.add(`${prefix}-sidebar`);\n","import { createState } from '@yongdall/web';\nimport { prefix, sidebar } from './dom.mjs';\nconst openedClassName = `${prefix}-open`;\n/** @type {(() => void)?} */\nlet current = null;\n\nexport function closeSidebarWhenMobile() {\n\tif (window.innerWidth > 800) { return; }\n\tcurrent?.();\n}\n\nexport default class Sider {\n\t/** @readonly @type {HTMLElement} */\n\tbutton;\n\t/** @readonly @type {HTMLElement} */\n\tsider;\n\t/** @type {() => void} */\n\t#hide;\n\n\t#disabled = false;\n\tget disabled() { return this.#disabled; }\n\tset disabled(v) {\n\t\tif (v) {\n\t\t\tthis.disable();\n\t\t} else {\n\t\t\tthis.enable();\n\t\t}\n\t}\n\tdisable() {\n\t\tif (this.#disabled) { return; }\n\t\tthis.#disabled = true;\n\t\tconst hide = this.#hide;\n\t\tif (current === hide) {\n\t\t\thide();\n\t\t}\n\t\tthis.button.hidden = true;\n\t\tthis.sider.hidden = true;\n\t\t// TODO: 隐藏分组\n\t}\n\tenable() {\n\t\tif (!this.#disabled) { return; }\n\t\tthis.#disabled = false;\n\t\tthis.button.hidden = false;\n\t\t// TODO: 显示分组\n\t}\n\t#click = () => this.toggle();\n\t/**\n\t * \n\t * @param {HTMLElement} [siderContainer] \n\t * @param {HTMLElement} [buttonContainer] \n\t */\n\tconstructor(siderContainer, buttonContainer) {\n\t\tconst button = buttonContainer instanceof HTMLElement\n\t\t\t? buttonContainer\n\t\t\t: document.createElement('div');\n\t\tconst sider = siderContainer instanceof HTMLElement\n\t\t\t? siderContainer\n\t\t\t: document.createElement('div');\n\t\tbutton.tabIndex = 0;\n\t\tbutton.classList.add(`${prefix}-button`);\n\t\tsider.hidden = true;\n\t\tsidebar.appendChild(sider);\n\t\tbutton.classList.add(`${prefix}-selectable`);\n\t\tconst hide = () => {\n\t\t\tcurrent = null;\n\t\t\tdocument.body.classList.remove(openedClassName);\n\t\t\tbutton.classList.remove(`${prefix}-selected`);\n\t\t\tsider.hidden = true;\n\t\tthis.#shown.set(false);\n\t\t};\n\t\tbutton.addEventListener('click', this.#click);\n\t\tthis.#hide = hide;\n\t\tthis.button = button;\n\t\tthis.sider = sider;\n\t}\n\t#shown = createState(false);\n\tget shown() { return this.#shown.get(); }\n\tset shown(p) {\n\t\tif (p) {\n\t\t\tthis.show();\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\tget hidden() { return this.button.hidden; }\n\tset hidden(v) {\n\t\tthis.button.hidden = Boolean(v);\n\t\tif (!v) { return; }\n\t\tthis.hide();\n\t}\n\tget open() { return current === this.#hide; }\n\tset open(p) {\n\t\tif (p) {\n\t\t\tthis.show();\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\tshow() {\n\t\tif (this.hidden) { return; }\n\t\tif (this.#disabled) { return; }\n\t\tconst hide = this.#hide;\n\t\tif (current === hide) { return; }\n\t\tcurrent?.();\n\t\tcurrent = hide;\n\t\tdocument.body.classList.add(openedClassName);\n\t\tthis.button.classList.add(`${prefix}-selected`);\n\t\tthis.sider.hidden = false;\n\t\tthis.#shown.set(true);\n\t}\n\ttoggle() {\n\t\tif (this.hidden) { return; }\n\t\tif (this.#disabled) { return; }\n\t\tconst hide = this.#hide;\n\t\tif (current === hide) {\n\t\t\thide();\n\t\t\treturn;\n\t\t}\n\t\tthis.show();\n\t}\n\thide() {\n\t\tif (this.hidden) { return; }\n\t\tif (this.#disabled) { return; }\n\t\tconst hide = this.#hide;\n\t\tif (current !== hide) { return; }\n\t\thide();\n\t}\n\tremove() {\n\t\tconst hide = this.#hide;\n\t\tif (current === hide) {\n\t\t\thide();\n\t\t}\n\t\tconst { button, sider } = this;\n\t\tbutton.remove();\n\t\tsider.remove();\n\t\tbutton.classList.remove(`${prefix}-button`);\n\t\tbutton.classList.remove(`${prefix}-selectable`);\n\t\tbutton.removeEventListener('click', this.#click);\n\t\tsider.hidden = false;\n\t\t// TODO: ...\n\t\t// TODO: 隐藏分组\n\t}\n}\nsidebar.addEventListener('click', (e) => {\n\tif (e.target !== e.currentTarget) { return; }\n\tcurrent?.();\n});\n","import Sider, { closeSidebarWhenMobile } from './Sider.mjs';\nimport { prefix } from './dom.mjs';\n\n\n\nexport default class Group {\n\t/** @readonly */\n\troot = document.createElement('div');\n\t/** @type {Set<() => void>} */\n\t#children = new Set()\n\t/**\n\t * \n\t * @param {HTMLElement} parent \n\t */\n\tconstructor(parent) {\n\t\tconst root = this.root;\n\t\tparent.appendChild(root);\n\t\troot.className = `${prefix}-group`;\n\t}\n\tremove() {\n\t\tthis.root.remove();\n\t\tfor (const r of [...this.#children]) {\n\t\t\tr();\n\t\t}\n\t}\n\tcreateGroup() {\n\t\tconst group = new Group(this.root);\n\t\tconst children = this.#children;\n\t\tconst remove = () => {children.delete(remove); group. remove(); }\n\t\tchildren.add(remove);\n\t\treturn group;\n\t}\n\t/**\n\t * \n\t * @overload\n\t * @param {true} isLink \n\t * @returns {HTMLAnchorElement}\n\t */\n\t/**\n\t * \n\t * @overload\n\t * @param {boolean} [isLink] \n\t * @returns {HTMLElement}\n\t */\n\t/**\n\t * \n\t * @param {boolean} [isLink] \n\t * @returns {HTMLElement}\n\t */\n\tcreateAction(isLink) {\n\t\tconst btn = document.createElement(isLink ? 'a' : 'div');\n\t\tbtn.tabIndex = 0;\n\t\tbtn.classList.add(`${prefix}-button`);\n\t\tbtn.addEventListener('click', () => { closeSidebarWhenMobile(); });\n\t\tthis.root.appendChild(btn);\n\n\n\t\tconst children = this.#children;\n\t\tconst remove = () => {children.delete(remove); btn.remove(); }\n\t\tchildren.add(remove);\n\t\treturn btn;\n\t}\n\t/**\n\t * \n\t * @param {HTMLElement} [siderContainer] \n\t * @param {HTMLElement} [buttonContainer] \n\t */\n\tcreateSider(siderContainer, buttonContainer) {\n\t\tconst sider = new Sider(siderContainer, buttonContainer);\n\t\tthis.root.appendChild(sider.button);\n\n\n\t\tconst children = this.#children;\n\t\tconst remove = () => {children.delete(remove); sider.remove(); }\n\t\tchildren.add(remove);\n\t\treturn sider;\n\t}\n}\n","import Group from './Group.mjs';\nimport { actions } from './dom.mjs';\nexport const pageSiderContainer = document.createElement('div');\nexport const startGroup = new Group(actions);\nexport const pageGroup = new Group(actions);\nexport const mainGroup = new Group(actions);\nexport const span = actions.appendChild(document.createElement('span'));\nexport const endGroup = new Group(actions);\n\nexport const pageSider = pageGroup.createSider(pageSiderContainer);\npageSider.button.innerText = '页面';\npageSider.disabled = true;\n","import { pageSider, pageSiderContainer } from './sides.mjs';\n\nimport { PageSider, Page } from '@yongdall/web';\n\n\nclass Sider extends PageSider {\n\t#page;\n\t#parent;\n\t/**\n\t * @param {AllSiderPage} page \n\t * @param {ParentNode} parent \n\t * @param {Node?} next \n\t * @param {boolean} inserted \n\t * @param {AbortSignal} signal \n\t * @param {ParentNode} parent \n\t * @returns \n\t */\n\tconstructor(page, parent, next, inserted, signal) {\n\t\tsuper(parent, next, inserted, signal);\n\t\tthis.#page = page;\n\t\tthis.#parent = parent;\n\t\tsignal.addEventListener('abort', () => {\n\t\tthis.#hidden();\n\t\t})\n\t}\n\tinsert() {\n\t\tsuper.insert();\n\n\t\tif (this.#page.show) { pageSider.disabled = false; }\n\t}\n\t#hidden() {\n\t\tif (this.#page.show && !this.#parent.children.length) {\n\t\t\tpageSider.disabled = true;\n\t\t}\n\t}\n\tremove() {\n\t\tsuper.remove();\n\t\tthis.#hidden();\n\t}\n\n}\n\nexport default class AllSiderPage extends Page {\n\t#sides = (() => {\n\t\tconst sides = document.createElement('div');\n\t\tsides.classList.add('Page-sides');\n\t\tpageSiderContainer.appendChild(sides);\n\t\treturn sides;\n\t})();\n\tdestroy() {\n\t\tif (!super.destroy()) { return false; }\n\t\tthis.#sides.remove();\n\t\treturn true;\n\t}\n\t/**\n\t * \n\t * @param {boolean} show \n\t */\n\ttoggle(show) {\n\t\tsuper.toggle(show);\n\t\t// TODO: 区别区域\n\t\tpageSider.disabled = !(show && this.#sides.children.length);\n\t}\n\tget siderOpen() { return pageSider.open; }\n\tset siderOpen(open) {\n\t\t// TODO: 判断是不是当前的\n\t\tif (open) {\n\t\t\tpageSider.show();\n\t\t} else {\n\t\t\tpageSider.hide();\n\t\t}\n\t}\n\t/**\n\t * \n\t * @param {boolean} [inserted] \n\t * @param {AbortSignal} [signal] \n\t * @returns {PageSider}\n\t */\n\tcreateSider(inserted, signal) {\n\t\tif (this.destroyed) { throw new Error('页面组件已被销毁'); }\n\t\tsignal?.throwIfAborted();\n\t\tconst parent = this.#sides;\n\t\treturn new Sider(\n\t\t\tthis,\n\t\t\tparent,\n\t\t\tnull,\n\t\t\tinserted !== false,\n\t\t\tsignal instanceof AbortSignal\n\t\t\t\t? AbortSignal.any([signal, this.signal])\n\t\t\t\t: this.signal\n\t\t);\n\t}\n\t/**\n\t * \n\t * @param {boolean} show \n\t */\n\tconstructor(show) {\n\t\tsuper(show);\n\t\tif (show) {\n\t\t\tpageSider.disabled = !this.#sides.children.length;\n\t\t}\n\t}\n}\n","import '@neeloong/components';\nimport type { Menu, State } from '@yongdall/web';\nimport type { Menu as NeeloongMenu } from '@neeloong/components';\nimport { createComputed, watch } from '@yongdall/web';\n\n\nexport default function createMenu<T extends Node>(\n\tparent: T,\n\tmenus: (Menu | null)[],\n\toptions: Menu.RendererOptions,\n\tbutton: boolean = false,\n\tcreateSub?: (parent: T | NeeloongMenu, child: NeeloongMenu, menu: Menu, hidden: State<boolean>) => void,\n): State<boolean> | null {\n\tif (options.signal.aborted) { return null; }\n\tconst { create, signal } = options;\n\tlet has = false;\n\tlet divider = false;\n\tlet lastHr: HTMLHRElement | null = null;\n\tconst allButtons: State<boolean>[] = [];\n\tlet lastButtons: State<boolean>[] = [];\n\tlet buttons: State<boolean>[] = [];\n\tfunction updateHr() {\n\t\tconst hr = lastHr;\n\t\tif (!hr) { return }\n\t\tconst list = lastButtons;\n\t\twatch(() => list.some(v => v.get()), hidden => {\n\t\t\thr.hidden = hidden\n\t\t}, { signal, immediate: true })\n\t}\n\tconst createDivider = () => {\n\t\thas = true;\n\t\tif (!divider) { return; }\n\t\tdivider = false;\n\t\tupdateHr();\n\t\tconst hr = document.createElement('hr');\n\t\tlastHr = hr;\n\t\tlastButtons = buttons;\n\t\tbuttons = [];\n\t\tparent.appendChild(hr);\n\t};\n\tfunction add(hidden: State<boolean>) {\n\t\tcreateDivider();\n\t\tlastButtons.push(hidden);\n\t\tbuttons.push(hidden);\n\t\tallButtons.push(hidden);\n\t}\n\tfor (const menu of menus) {\n\t\tif (!menu) {\n\t\t\tif (!has) { continue; }\n\t\t\tdivider = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst { children } = menu;\n\t\tif (!children?.length) {\n\t\t\tconst result = create(menu, { button });\n\t\t\tif (!result) { continue; }\n\t\t\tcreateDivider();\n\t\t\tadd(createComputed(() => Boolean(menu.hidden)));\n\t\t\tparent.appendChild(result);\n\t\t\tcontinue;\n\t\t}\n\t\tconst child = document.createElement('nl-menu') as NeeloongMenu;\n\t\tconst childHidden = createMenu<NeeloongMenu>(child, menus, options);\n\t\tif (!childHidden) { continue; }\n\t\tconst hidden = createComputed(() => Boolean(menu.hidden || childHidden.get()));\n\t\tadd(hidden);\n\t\tif (createSub) {\n\t\t\tcreateSub(parent, child, menu, hidden);\n\t\t} else {\n\n\t\t\twatch(() => hidden.get(), hidden => { item.hidden = hidden }, { signal, immediate: true })\n\t\t\tconst item = parent.appendChild(child);\n\t\t\tconst header = item.insertBefore(document.createElement('div'), item.firstChild);\n\t\t\theader.appendChild(document.createTextNode(menu.label || menu.title || ''));\n\t\t\theader.slot = 'label';\n\t\t}\n\n\t}\n\tif (!has) { return null; }\n\tupdateHr();\n\treturn createComputed(() => allButtons.some(v => v.get()));\n}\n","import { watch, type Menu } from '@yongdall/web';\nimport '@neeloong/components';\nimport createMenuList from './createMenu.mts';\n\nexport default function createMenuButtons(\n\tmenus: (Menu | null)[],\n\toptions: Menu.RendererOptions,\n) {\n\tif (options.signal.aborted) { return null; }\n\tconst { create, signal } = options;\n\tconst root = document.createElement('div');\n\tcreateMenuList(root, menus, options, true, (root, child, menu, hidden) => {\n\t\tconst button = root.appendChild(document.createElement('button'));\n\t\tbutton.appendChild(document.createTextNode(menu.label || menu.title || ''));\n\t\tchild.targetElement = button;\n\t\tbutton.addEventListener('click', () => child.show?.());\n\t\troot.appendChild(child);\n\t\twatch(() => hidden.get(), hidden => {\n\t\t\tbutton.hidden = hidden\n\t\t\tchild.hidden = hidden\n\t\t}, { signal, immediate: true });\n\t});\n\tif (!root.childNodes.length) { return null; }\n\troot.classList.add('MenuButtons');\n\treturn root;\n}\n","import type { Menu } from '@yongdall/web';\nimport { Application, createComputed, effect, isMac, watch } from '@yongdall/web';\n\n\nfunction getUri(item: Menu.Renderer.Command) {\n\tconst { page } = item;\n\tif (page) {\n\t\tconst { path } = item;\n\t\treturn new URL(path?.[0] === '/' ? `${page}${path}` : `${page}/${path || ''}`, Application.root).href;\n\t}\n\tconst { uri } = item;\n\tif (uri) { return uri; }\n\treturn null;\n}\nexport default function createMenuItem(menu: Menu, options: Menu.Renderer.Options): HTMLElement {\n\tconst { signal, button: isButton } = options;\n\tconst link = document.createElement('a');\n\tconst button = isButton ? document.createElement('button') : null;\n\twatch(() => menu.label || menu.title || '', label => {\n\t\tlink.textContent = label;\n\t}, { signal, immediate: true });\n\n\tconst { commands } = options;\n\n\tconst disabled = createComputed(() => {\n\t\tif (menu.disabled) { return true; }\n\t\tconst { command } = menu;\n\t\tconst cmd = command && Object.hasOwn(commands, command) && commands[command];\n\t\treturn Boolean(cmd ? cmd.disabled : options.disabled(menu));\n\t});\n\n\tconst href = createComputed(() => {\n\t\tconst href = getUri(menu);\n\t\tif (href) { return href; }\n\t\tconst { command } = menu;\n\t\tconst cmd = command && Object.hasOwn(commands, command) && commands[command];\n\t\treturn cmd ? getUri(cmd) || null : options.uri(menu) || null;\n\t});\n\tfunction click() {\n\t\tconst { click } = menu;\n\t\tif (typeof click === 'function') { return click(); }\n\t\tconst { script } = menu;\n\t\tif (script) {\n\t\t\t// TODO:\n\t\t\treturn;\n\t\t}\n\t\tconst { command } = menu;\n\t\tconst cmd = command && Object.hasOwn(commands, command) && commands[command];\n\t\treturn cmd ? cmd.click?.() : options.click(menu);\n\t}\n\teffect(() => {\n\t\tconst isDisabled = disabled.get();\n\t\t// @ts-ignore\n\t\tlink.disabled = isDisabled;\n\t\tlink.ariaDisabled = isDisabled ? 'true' : 'false';\n\t\tif (isDisabled) {\n\t\t\tlink.removeAttribute('tabindex');\n\t\t\tlink.removeAttribute('href');\n\t\t\tlink.removeAttribute('target');\n\t\t} else {\n\t\t\tlink.tabIndex = 0;\n\t\t\tlet target = '';\n\t\t\tconst hrefValue = href.get();\n\t\t\tif (hrefValue) {\n\t\t\t\tlink.href = hrefValue;\n\t\t\t\ttarget = menu.target || (menu.page ? '_self' : '');\n\t\t\t}\n\t\t\tif (target) {\n\t\t\t\tlink.target = target;\n\t\t\t} else {\n\t\t\t\tlink.removeAttribute('target');\n\t\t\t}\n\t\t}\n\t\tif (button) {\n\t\t\tbutton.disabled = isDisabled;\n\t\t}\n\t}, signal);\n\tlink.addEventListener('click', (e) => {\n\t\tif (!disabled.get()) { return; }\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t}, { capture: true });\n\tlink.addEventListener('click', (e) => {\n\t\tif (disabled.get()) { return; }\n\t\tif (e.defaultPrevented) { return; }\n\t\tif (href.get()) {\n\t\t\tif (e.shiftKey) { return; }\n\t\t\tif (isMac ? e.metaKey : e.ctrlKey) { return; }\n\t\t\tif (e.altKey) { return; }\n\t\t}\n\t\tif (click() === false) {\n\t\t\te.preventDefault();\n\t\t}\n\t});\n\tif (button) {\n\t\tbutton.appendChild(link);\n\t\treturn button;\n\t}\n\treturn link;\n\n}\n","import type { Menu as NeeloongMenu } from '@neeloong/components';\nimport type { Menu } from '@yongdall/web';\nimport '@neeloong/components';\nimport { createIcon, watch } from '@yongdall/web';\n\nimport createMenu from './createMenu.mts';\n\n\nexport default function createMenuButton(\n\tmenus: (Menu | null)[],\n\tmenu: Menu | null,\n\toptions: Menu.RendererOptions,\n) {\n\tconst root = document.createElement('div');\n\tconst child = document.createElement('nl-menu') as NeeloongMenu;\n\tconst hidden = createMenu(child, menus, options);\n\tif (!hidden) { return hidden; }\n\tconst button = root.appendChild(document.createElement('button'));\n\tconst label = menu?.label || menu?.title || '';\n\tif (label) {\n\t\tbutton.appendChild(document.createTextNode(label));\n\t} else {\n\t\tbutton.appendChild(createIcon(menu?.icon || 'more', options.signal));\n\t}\n\tchild.targetElement = button;\n\tbutton.addEventListener('click', () => child.show());\n\troot.appendChild(child);\n\twatch(() => hidden.get(), hidden => root.hidden = hidden, {\n\t\tsignal: options.signal,\n\t\timmediate: true,\n\t})\n\treturn root;\n}\n","import type { NavButton, Theme } from '@yongdall/web';\nimport { Application, createComputed, createFrame, createIcon, createState, effect, ErrorAlerter, loadNavButtons, root as rootContainer } from '@yongdall/web';\nimport { cssPrefix } from '../styles/variables.mjs';\nimport pageManager, { activityContainer, setMode } from '../pageManager/index.mjs';\n\nimport List from '../components/List.mjs';\nimport Pagination from '../components/Pagination.mjs';\nimport { default as home } from '../home/index.mjs';\nimport { menuContainer, updatePath } from '../workspace/index.mjs';\nimport { userButton, userContainer } from '../user/index.mjs';\nimport { logoLink } from '../logo.mjs';\nimport renderError from '../error/index.mjs';\n\nimport { actions, header } from './dom.mjs';\nimport { closeSidebarWhenMobile } from './Sider.mjs';\nimport { endGroup, startGroup } from './sides.mjs';\nimport AllSiderPage from './AllSiderPage.mjs';\nimport createMenuButtons from '../menu/createMenuButtons.mts';\nimport createMenuItem from '../menu/createMenuItem.mts';\nimport createMenuButton from '../menu/createMenuButton.mts';\n\n\nfunction addButton({\n\thidden, title, disabled, createIcon: createButtonIcon,\n\tcreatePanel, href, click,\n}: NavButton, signal: AbortSignal) {\n\tif (signal.aborted) { return; }\n\tconst shown = createState(createState(false));\n\tconst ctx: NavButton.Context = {\n\t\tget shown() { return shown.get().get(); },\n\t\tget signal() { return signal; },\n\t}\n\tlet button: HTMLElement\n\tif (createPanel) {\n\t\tconst sider = startGroup.createSider(createPanel(ctx));\n\t\tbutton = sider.button;\n\t\tshown.set(createComputed(() => sider.shown));\n\t\tsignal.addEventListener('abort', () => { sider.remove(); }, { once: true });\n\t} else if (href) {\n\t\tconst action = startGroup.createAction(true);\n\t\teffect(() => {\n\t\t\tconst url = !disabled?.(ctx) && href(ctx);\n\t\t\tif (url) { action.href = url; }\n\t\t\telse { action.removeAttribute('href'); }\n\t\t}, signal);\n\t\tif (click) {\n\t\t\taction.addEventListener('click', event => {\n\t\t\t\tif (click(ctx) === false) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}, { signal });\n\t\t}\n\t\tbutton = action;\n\t\tsignal.addEventListener('abort', () => { action.remove(); }, { once: true });\n\n\t} else {\n\n\t\tconst action = startGroup.createAction();\n\t\tif (disabled) {\n\t\t\teffect(() => {\n\t\t\t\tif (disabled(ctx)) {\n\n\t\t\t\t\taction.removeAttribute('tabIndex');\n\t\t\t\t} else {\n\t\t\t\t\taction.tabIndex = 0;\n\t\t\t\t}\n\t\t\t}, signal);\n\t\t}\n\t\tif (click) {\n\t\t\taction.addEventListener('click', () => { click(ctx) }, { signal });\n\t\t}\n\t\tbutton = action;\n\t\tsignal.addEventListener('abort', () => { action.remove(); }, { once: true });\n\n\t}\n\tif (hidden) {\n\t\teffect(() => { button.hidden = hidden(ctx); }, signal);\n\t}\n\tif (title) {\n\t\teffect(() => { button.title = title(ctx) }, signal);\n\t}\n\tif (createButtonIcon) {\n\t\tbutton.appendChild(createButtonIcon(ctx));\n\t} else {\n\t\tbutton.appendChild(createIcon(['icon', 'logo'], signal));\n\t}\n}\nconst theme: Theme = {\n\ttitle(p) { return [p.title, Application.title || '拥道YongDall'].filter(Boolean).join(' | ') },\n\ticon(p) { return p.icon },\n\tcomponents: { List, Pagination, createMenuButtons, createMenuItem, createMenuButton },\n\tupdatePath,\n\tpageManager,\n\telements: [rootContainer, header],\n\tclassNames: [cssPrefix, `${cssPrefix}-allSider`],\n\tstyleFiles: ['theme-allSider.css'],\n\thome,\n\talertError: ErrorAlerter,\n\trootClassName: `${cssPrefix}-root`,\n\tcreateFrame,\n\tcreatePage(show) { return new AllSiderPage(show); },\n\trenderError(ctx, error) { renderError(ctx, error); },\n\tasync setup(signal) {\n\t\tsetMode(false);\n\t\tlogoLink.addEventListener('click', () => { closeSidebarWhenMobile(); }, { signal });\n\t\tactions.insertBefore(logoLink, actions.firstElementChild);\n\n\t\tconst workspaceSider = startGroup.createSider(menuContainer);\n\t\tworkspaceSider.button.appendChild(createIcon('menu', signal));\n\t\tworkspaceSider.button.title = '菜单';\n\t\tconst activitySider = startGroup.createSider(activityContainer);\n\t\tactivitySider.button.appendChild(createIcon('activity', signal));\n\t\tactivitySider.button.title = '活动';\n\t\tif (window.innerWidth > 800) {\n\t\t\tworkspaceSider.show();\n\t\t}\n\n\t\tconst userSider = endGroup.createSider(userContainer, userButton);\n\n\t\tsignal.addEventListener('abort', () => {\n\t\t\tlogoLink.remove();\n\t\t\tworkspaceSider.remove();\n\t\t\tactivitySider.remove();\n\t\t\tuserSider.remove();\n\t\t}, { once: true });\n\t\tfor await (const button of loadNavButtons()) {\n\t\t\tif (signal.aborted) { return; }\n\t\t\taddButton(button, signal);\n\t\t}\n\t},\n\n};\n\nexport default theme\n","import { type NavButton, createState, createComputed, effect, createIcon } from '@yongdall/web';\n\nexport function addButton(anchor: Node, container: ParentNode, {\n\thidden, title, disabled, createIcon: createButtonIcon,\n\tcreatePanel, href, click,\n}: NavButton, signal: AbortSignal) {\n\tif (signal.aborted) { return; }\n\tconst parent = anchor.parentNode;\n\tif (!parent) { return; }\n\tconst shown = createState(createState(false));\n\tconst ctx: NavButton.Context = {\n\t\tget shown() { return shown.get().get(); },\n\t\tget signal() { return signal; },\n\t};\n\tlet button;\n\tif (createPanel) {\n\t\tconst btn = document.createElement('div');\n\t\tconst panel = createPanel(ctx);\n\t\tbutton = btn;\n\t\tconst panelShown = createState(true);\n\t\tshown.set(createComputed(() => !shown.get()));\n\n\t\tcontainer.appendChild(panel);\n\t\tbtn.addEventListener('click', () => { panel.showPopover(); }, { signal });\n\t\tpanel.setAttribute('popover', 'auto');\n\t\tpanel.addEventListener('toggle', event => { panelShown.set(event.newState === 'closed'); }, { signal });\n\t\tsignal.addEventListener('abort', () => {\n\t\t\tpanel.removeAttribute('popover');\n\t\t\tpanel.remove();\n\t\t}, { once: true });\n\t} else if (href) {\n\t\tconst action = document.createElement('a');\n\t\tif (click) {\n\t\t\taction.addEventListener('click', event => {\n\t\t\t\tif (click(ctx) === false) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}, { signal });\n\t\t}\n\t\teffect(() => {\n\t\t\tconst url = !disabled?.(ctx) && href(ctx);\n\t\t\tif (url) { action.href = url; }\n\t\t\telse { action.removeAttribute('href'); }\n\t\t}, signal);\n\t\tbutton = action;\n\t} else {\n\t\tconst action = document.createElement('div');\n\t\tif (click) {\n\t\t\taction.addEventListener('click', () => { click(ctx) }, { signal });\n\t\t}\n\t\tif (disabled) {\n\t\t\teffect(() => {\n\t\t\t\tif (disabled(ctx)) {\n\n\t\t\t\t\taction.removeAttribute('tabIndex');\n\t\t\t\t} else {\n\t\t\t\t\taction.tabIndex = 0;\n\t\t\t\t}\n\t\t\t}, signal);\n\t\t}\n\t\tbutton = action;\n\t}\n\tif (hidden) {\n\t\teffect(() => { button.hidden = hidden(ctx); }, signal);\n\t}\n\tif (title) {\n\t\teffect(() => { button.title = title(ctx); }, signal);\n\t}\n\tparent.insertBefore(button, anchor);\n\tif (createButtonIcon) {\n\t\tbutton.appendChild(createButtonIcon(ctx));\n\t} else {\n\t\tbutton.appendChild(createIcon(['icon', 'logo'], signal));\n\t}\n\tsignal.addEventListener('abort', () => { button.remove(); }, { once: true });\n}\n","import type { State, Theme } from '@yongdall/web';\nimport { createFrame, createTick, ErrorAlerter, loadNavButtons, Page, root as rootContainer } from '@yongdall/web';\nimport { Application, createIcon, effect } from '@yongdall/web';\n\nimport { cssPrefix } from '../styles/variables.mjs';\nimport List from '../components/List.mjs';\nimport Pagination from '../components/Pagination.mjs';\nimport { default as home } from '../home/index.mjs';\nimport { menuContainer, updatePath } from '../workspace/index.mjs';\nimport { userButton, userContainer } from '../user/index.mjs';\nimport { logoLink } from '../logo.mjs';\nimport renderError from '../error/index.mjs';\n\nimport createMenuButtons from '../menu/createMenuButtons.mts';\nimport createMenuItem from '../menu/createMenuItem.mts';\nimport createMenuButton from '../menu/createMenuButton.mts';\nimport { addButton } from '../utils/addButton.mts';\n\n\n\nconst prefix = `${cssPrefix}-base`;\nconst styleFiles = ['theme-base.css'];\n\nconst headerEl = document.createElement('header');\nconst header = headerEl.appendChild(document.createElement('div'));\nheader.classList.add(`${prefix}-header`);\nconst sidebar = headerEl.appendChild(document.createElement('div'));\nsidebar.classList.add(`${prefix}-sidebar`);\n\nconst menuButton = header.appendChild(createIcon('menu', true));\nmenuButton.classList.add(`${prefix}-menu-button`);\n\nconst span = header.appendChild(document.createElement('span'));\n\nconst openedClassName = `${prefix}-menu-open`;\n\nmenuButton.addEventListener('click', () => {\n\tdocument.body.classList.toggle(openedClassName);\n});\n\n\nsidebar.addEventListener('click', (e) => {\n\tif (e.target !== e.currentTarget) { return; }\n\tdocument.body.classList.remove(openedClassName);\n});\n\n\nlet tick: State<number> | null = null;\nconst spinner = '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏';\n\n\nconst theme: Theme = {\n\ttitle(p) {\n\t\treturn [[\n\t\t\ttick && p.loading ? spinner[tick.get() % spinner.length] : '',\n\t\t\tp.unsaved ? '🔴' : '',\n\t\t\tp.title,\n\t\t].join(''), Application.title || '拥道YongDall'].filter(Boolean).join(' | ')\n\t},\n\ticon(p) { return p.icon },\n\tcomponents: { List, Pagination, createMenuButtons, createMenuItem, createMenuButton },\n\tupdatePath,\n\tpageManager(page) {\n\t\tlet shown = false;\n\t\teffect(() => {\n\t\t\tif (!page.current) {\n\t\t\t\tif (shown) { page.destroy(); }\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tshown = true;\n\t\t}, page.signal);\n\t},\n\telements: [headerEl, rootContainer],\n\tclassNames: [cssPrefix, prefix],\n\tstyleFiles,\n\thome,\n\talertError: ErrorAlerter,\n\trootClassName: `${cssPrefix}-root`,\n\tcreateFrame,\n\tcreatePage(show) { return new Page(show); },\n\trenderError(ctx, error) { renderError(ctx, error); },\n\tasync setup(signal) {\n\t\ttick = createTick(80, signal);\n\t\tlogoLink.addEventListener('click', () => {\n\t\t\tif (window.innerWidth > 800) { return; }\n\t\t\tdocument.body.classList.remove(openedClassName);\n\t\t}, { signal });\n\n\t\tconst titleSpan = document.createElement('div');\n\t\ttitleSpan.classList.add(`${prefix}-header-title`);\n\t\teffect(() => {\n\t\t\ttitleSpan.innerText = Application.title || Application.company || '';\n\t\t}, signal);\n\t\theader.insertBefore(logoLink, span);\n\t\theader.insertBefore(titleSpan, span);\n\n\t\tif (window.innerWidth > 800) {\n\t\t\tdocument.body.classList.add(openedClassName);\n\t\t}\n\n\t\tsidebar.appendChild(menuContainer);\n\n\t\tconst panelContainer = document.createElement('div');\n\t\tpanelContainer.classList.add(`${prefix}-panels`);\n\t\tdocument.body.appendChild(panelContainer);\n\n\t\tpanelContainer.appendChild(userContainer);\n\t\tuserContainer.setAttribute('popover', 'auto');\n\t\tuserButton.addEventListener('click', () => { userContainer.showPopover(); }, { signal });\n\n\n\n\t\tconst actions = header.appendChild(document.createElement('div'));\n\t\tactions.classList.add(`${prefix}-actions`);\n\n\t\tconst anchor = actions.appendChild(document.createElement('span'));\n\t\tactions.appendChild(userButton);\n\n\n\t\tsignal.addEventListener('abort', () => {\n\t\t\tlogoLink.remove();\n\t\t\ttitleSpan.remove();\n\t\t\tmenuContainer.remove();\n\t\t\tpanelContainer.remove();\n\t\t\tuserContainer.removeAttribute('popover');\n\t\t\tuserContainer.remove();\n\t\t\tuserButton.remove();\n\t\t\tanchor.remove();\n\t\t\tactions.remove();\n\t\t}, { once: true });\n\t\tfor await (const button of loadNavButtons()) {\n\t\t\tif (signal.aborted) { return; }\n\t\t\taddButton(anchor, panelContainer, button, signal);\n\t\t}\n\t},\n\n};\nexport default theme;\n","import type { State, Theme } from '@yongdall/web';\nimport { createFrame, createTick, ErrorAlerter, Page, root as rootContainer } from '@yongdall/web';\nimport { Application, effect } from '@yongdall/web';\n\nimport { cssPrefix } from '../styles/variables.mjs';\nimport List from '../components/List.mjs';\nimport Pagination from '../components/Pagination.mjs';\nimport { default as home } from '../home/index.mjs';\nimport { updatePath } from '../workspace/index.mjs';\nimport renderError from '../error/index.mjs';\n\nimport createMenuButtons from '../menu/createMenuButtons.mts';\nimport createMenuItem from '../menu/createMenuItem.mts';\nimport createMenuButton from '../menu/createMenuButton.mts';\n\n\n\nconst prefix = `${cssPrefix}-pure`;\nconst styleFiles = ['theme-pure.css'];\n\n\n\n\nlet tick: State<number> | null = null;\nconst spinner = '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏';\nconst theme: Theme = {\n\ttitle(p) {\n\t\treturn [[\n\t\t\ttick && p.loading ? spinner[tick.get() % spinner.length] : '',\n\t\t\tp.unsaved ? '🔴' : '',\n\t\t\tp.title,\n\t\t].join(''), Application.title || '拥道YongDall'].filter(Boolean).join(' | ')\n\t},\n\ticon(p) { return p.icon },\n\tcomponents: { List, Pagination, createMenuButtons, createMenuItem, createMenuButton },\n\tupdatePath,\n\tpageManager(page) {\n\t\tlet shown = false;\n\t\teffect(() => {\n\t\t\tif (!page.current) {\n\t\t\t\tif (shown) { page.destroy(); }\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tshown = true;\n\t\t}, page.signal);\n\t},\n\telements: [rootContainer],\n\tclassNames: [cssPrefix, prefix],\n\tstyleFiles,\n\thome,\n\talertError: ErrorAlerter,\n\trootClassName: `${cssPrefix}-root`,\n\tcreateFrame,\n\tcreatePage(show) { return new Page(show); },\n\trenderError(ctx, error) { renderError(ctx, error); },\n\tasync setup(signal) {\n\t\ttick = createTick(80, signal);\n\t},\n\n};\nexport default theme;\n","import { createIcon } from '@yongdall/web';\nimport { cssPrefix } from '../styles/variables.mjs';\n\nexport const prefix = `${cssPrefix}-tabs`;\n\nexport const headerEl = document.createElement('header');\nexport const header = headerEl.appendChild(document.createElement('div'));\nheader.classList.add(`${prefix}-header`);\nexport const sidebar = headerEl.appendChild(document.createElement('div'));\nsidebar.classList.add(`${prefix}-sidebar`);\n\nconst menuButton = header.appendChild(createIcon('menu', true));\nmenuButton.classList.add(`${prefix}-menu-button`);\n\nexport const span = header.appendChild(document.createElement('span'));\n\n\nexport const openedClassName = `${prefix}-menu-open`;\n\nmenuButton.addEventListener('click', () => {\n\tdocument.body.classList.toggle(openedClassName);\n});\n\n\nexport function closeSidebarWhenMobile() {\n\tif (window.innerWidth > 800) { return; }\n\tdocument.body.classList.remove(openedClassName);\n}\nsidebar.addEventListener('click', (e) => {\n\tif (e.target !== e.currentTarget) { return; }\n\tdocument.body.classList.remove(openedClassName);\n});\n","import type { Theme } from '@yongdall/web';\nimport { Application, createFrame, effect, ErrorAlerter, loadNavButtons, Page, root as rootContainer } from '@yongdall/web';\nimport { cssPrefix } from '../styles/variables.mjs';\nimport pageManager, { activityContainer, setMode } from '../pageManager/index.mjs';\n\nimport List from '../components/List.mjs';\nimport Pagination from '../components/Pagination.mjs';\nimport { default as home } from '../home/index.mjs';\nimport { menuContainer, updatePath } from '../workspace/index.mjs';\nimport { userButton, userContainer } from '../user/index.mjs';\nimport { logoLink } from '../logo.mjs';\nimport renderError from '../error/index.mjs';\n\nimport { header, closeSidebarWhenMobile, openedClassName, prefix, span } from './dom.mjs';\nimport { headerEl, sidebar } from './dom.mjs';\nimport createMenuButtons from '../menu/createMenuButtons.mts';\nimport createMenuItem from '../menu/createMenuItem.mts';\nimport createMenuButton from '../menu/createMenuButton.mts';\nimport { addButton } from '../utils/addButton.mts';\n\n\n\nconst theme: Theme = {\n\ttitle(p) { return [p.title, Application.title || '拥道YongDall'].filter(Boolean).join(' | ') },\n\ticon(p) { return p.icon },\n\tcomponents: { List, Pagination, createMenuButtons, createMenuItem, createMenuButton },\n\tupdatePath,\n\tpageManager,\n\telements: [headerEl, rootContainer],\n\tclassNames: [cssPrefix, `${cssPrefix}-tabs`],\n\tstyleFiles: ['theme-tabs.css'],\n\thome,\n\talertError: ErrorAlerter,\n\trootClassName: `${cssPrefix}-root`,\n\tcreateFrame,\n\tcreatePage(show) { return new Page(show); },\n\trenderError(ctx, error) { renderError(ctx, error);},\n\tasync setup(signal) {\n\t\tsetMode(true);\n\t\tlogoLink.addEventListener('click', () => { closeSidebarWhenMobile(); }, {signal});\n\n\t\tconst titleSpan = document.createElement('div');\n\t\ttitleSpan.classList.add(`${prefix}-header-title`);\n\t\teffect(() => {\n\t\t\ttitleSpan.innerText = Application.title || Application.company || '';\n\t\t}, signal);\n\t\t\n\t\theader.insertBefore(logoLink, span);\n\t\theader.insertBefore(titleSpan, span);\n\t\theaderEl.appendChild(activityContainer);\n\n\t\tif (window.innerWidth > 800) {\n\t\t\tdocument.body.classList.add(openedClassName);\n\t\t}\n\n\t\tsidebar.appendChild(menuContainer);\n\n\t\tconst panelContainer = document.createElement('div');\n\t\tpanelContainer.classList.add(`${prefix}-panels`);\n\t\tdocument.body.appendChild(panelContainer);\n\n\t\tpanelContainer.appendChild(userContainer);\n\t\tuserContainer.setAttribute('popover', 'auto')\n\t\tuserButton.addEventListener('click', () => { userContainer.showPopover(); }, {signal});\n\n\n\t\tconst actions = header.appendChild(document.createElement('div'));\n\t\tactions.classList.add(`${prefix}-actions`);\n\n\t\tconst anchor = actions.appendChild(document.createElement('span'));\n\t\tactions.appendChild(userButton);\n\n\n\t\tsignal.addEventListener('abort', () => {\n\t\t\tlogoLink.remove();\n\t\t\ttitleSpan.remove();\n\t\t\tactivityContainer.remove();\n\t\t\tmenuContainer.remove();\n\t\t\tuserContainer.removeAttribute('popover')\n\t\t\tuserContainer.remove();\n\t\t\tuserButton.remove();\n\t\t}, {once: true});\n\t\t\t\tfor await (const button of loadNavButtons()) {\n\t\t\t\t\tif (signal.aborted) { return; }\n\t\t\t\t\taddButton(anchor, panelContainer, button, signal);\n\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AAG,EAAG,CAAC,QAAM,CAAC,EAGrF,IAAM,EAAU,EAAO,YAAY,SAAS,cAAc,KAAK,CAAC,EAChE,EAAQ,UAAU,IAAI,GAAG,EAAO,SAAS,EAEzC,IAAM,EAAS,EAAQ,YAAY,SAAS,cAAc,MAAM,CAAC,EACjE,EAAQ,YAAY,CAAU,EAG9B,EAAO,iBAAiB,YAAe,CACtC,EAAS,OAAO,EAChB,EAAU,OAAO,EACjB,EAAkB,OAAO,EACzB,EAAc,OAAO,EACrB,EAAc,gBAAgB,SAAS,EACvC,EAAc,OAAO,EACrB,EAAW,OAAO,CACnB,EAAG,CAAC,KAAM,EAAI,CAAC,EACb,UAAW,IAAM,KAAU,EAAe,EAAG,CAC5C,GAAI,EAAO,QAAW,OACtB,GAAU,EAAQ,EAAgB,EAAQ,CAAM,CACjD,CACH,CAED"}
1
+ {"version":3,"file":"index.mjs","names":["prefix","#table","#thead","#createUrl","#renderList","#labelPattern","#fieldsShow","#idFields","#tr","#tbody","#documents","#fns","#pagination","filter","header","prefix","header","sidebar","openedClassName","prefix","closeSidebarWhenMobile","Sider","#disabled","#hide","#shown","#click","sidebar","prefix","#children","Sider","span","#page","#parent","#hidden","#sides","addButton","rootContainer","header","prefix","styleFiles","headerEl","header","sidebar","menuButton","span","openedClassName","tick","spinner","theme","rootContainer","prefix","theme","rootContainer","theme","rootContainer"],"sources":["../../packages/theme/styles/variables.mjs","../../packages/theme/pageManager/index.mjs","../../packages/theme/components/List.mjs","../../packages/theme/components/Pagination.mjs","../../packages/theme/home/index.mjs","../../packages/theme/menu/createNavMenu.mts","../../packages/theme/workspace/index.mjs","../../packages/theme/logo.mjs","../../packages/theme/error/index.mjs","../../packages/theme/theme-allSider/dom.mjs","../../packages/theme/theme-allSider/Sider.mjs","../../packages/theme/theme-allSider/Group.mjs","../../packages/theme/theme-allSider/sides.mjs","../../packages/theme/theme-allSider/AllSiderPage.mjs","../../packages/theme/menu/createMenu.mts","../../packages/theme/menu/createMenuButtons.mts","../../packages/theme/menu/createMenuItem.mts","../../packages/theme/menu/createMenuButton.mts","../../packages/theme/user/userAvatar.mjs","../../packages/theme/user/buildUserContainer.mts","../../packages/theme/user/buildUserButton.mts","../../packages/theme/theme-allSider/index.mts","../../packages/theme/utils/addButton.mts","../../packages/theme/theme-base/index.mts","../../packages/theme/theme-pure/index.mts","../../packages/theme/theme-tabs/dom.mjs","../../packages/theme/theme-tabs/index.mts"],"sourcesContent":["export const cssPrefix = `YongDallTheme`;\n","import { effect, waitAbortSignal } from '@yongdall/web';\n/** @import { PageHandle, PageManager } from '@yongdall/web' */\nimport { cssPrefix } from '../styles/variables.mjs';\nconst prefix = `${cssPrefix}-activity`;\n\nexport const activityContainer = document.createElement('div');\nactivityContainer.classList.add(prefix);\n\n\n\n/**\n * @typedef {object} ButtonProxy\n * @property {HTMLElement} button\n * @property {HTMLAnchorElement} link\n * @property {ButtonProxy} [last]\n * @property {ButtonProxy} [next]\n */\n\n/** @type {Map<PageHandle, ButtonProxy>} */\nconst buttons = new Map();\n/** @type {ButtonProxy | undefined} */\nlet first;\nlet append = false;\n/**\n * \n * @param {boolean} a \n */\nexport function setMode(a){\n\tappend = a;\n}\n/** @type {PageManager} */\nconst pageManager = (page) => {\n\tconst button = document.createElement('div');\n\tbutton.classList.add(`${prefix}-page`);\n\tconst link = button.appendChild(document.createElement('a'));\n\tlink.classList.add(`${prefix}-title`);\n\tlink.href = page.href;\n\tlink.innerText = page.title;\n\tconst close = button.appendChild(document.createElement('button'));\n\tclose.type = 'button';\n\tclose.classList.add(`${prefix}-close`);\n\tclose.addEventListener('click', () => {\n\t\tpage.destroy();\n\t});\n\t/** @type {ButtonProxy} */\n\tconst btn = {\n\t\tbutton, link,\n\t\tnext: first,\n\t};\n\tif (first) { first.last = btn; }\n\tfirst = btn;\n\tbuttons.set(page, btn);\n\tactivityContainer.insertBefore(button, append ? null : activityContainer.firstChild);\n\n\teffect(() => { link.innerText = page.title; }, page.signal);\n\teffect(() => { link.href = page.href; }, page.signal);\n\n\teffect(() => {\n\t\tif (page.current) {\n\t\t\tbutton.classList.add(`${prefix}-current`);\n\t\t} else {\n\t\t\tbutton.classList.remove(`${prefix}-current`);\n\t\t}\n\t}, page.signal);\n\teffect(() => {\n\t\tif (page.loading) {\n\t\t\tbutton.classList.add(`${prefix}-loading`);\n\t\t} else {\n\t\t\tbutton.classList.remove(`${prefix}-loading`);\n\t\t}\n\t}, page.signal);\n\teffect(() => {\n\t\tif (page.unsaved) {\n\t\t\tbutton.classList.add(`${prefix}-unsaved`);\n\t\t} else {\n\t\t\tbutton.classList.remove(`${prefix}-unsaved`);\n\t\t}\n\t}, page.signal);\n\twaitAbortSignal(page.signal).then(() => {\n\t\tconst { last, next } = btn;\n\t\tif (last) { last.next = next; }\n\t\tif (next) { next.last = last; }\n\t\tif (first === btn) { first = next; }\n\t\tbutton.remove();\n\t});\n};\nexport default pageManager;\n","/** @import { FieldScriptConfiguration, ModelScriptConfiguration } from '@yongdall/web' */\nimport { createShowField, Pattern } from '@yongdall/web';\n\n\nexport default class List {\n\t/** @type {((id: string) => string)?} */\n\t#createUrl;\n\t/** @type {readonly [string, FieldScriptConfiguration][]} */\n\t#fieldsShow;\n\t/** @type {string} */\n\t#labelPattern;\n\t/** @type {string[]} */\n\t#idFields;\n\t/** @type {readonly any[]} */\n\t#documents = [];\n\t#table = document.createElement('table');\n\t#thead = this.#table.appendChild(document.createElement('thead'));\n\t#tr = this.#thead.appendChild(document.createElement('tr'));\n\t#tbody = this.#table.appendChild(document.createElement('tbody'));\n\tget root() { return this.#table }\n\tget createUrl() {\n\t\treturn this.#createUrl;\n\t}\n\tset createUrl(fn) {\n\t\tconst createUrl = typeof fn === 'function' ? fn : null;\n\t\tif (this.#createUrl === createUrl) { return }\n\t\tthis.#createUrl = createUrl;\n\t\tthis.#renderList();\n\t}\n\t/**\n\t * \n\t * @param {(id: string) => string} createUrl \n\t * @param {ModelScriptConfiguration} model \n\t */\n\tconstructor(createUrl, model) {\n\t\tconst fieldsShow = Object.entries(model.fields).filter(([,{type}]) => type && typeof type !== 'object');\n\t\tconst idFields = Object.entries(model.fields).filter(([,v]) => v.primary).map(([v]) => v);\n\t\tconst labelPattern = model.labelPattern || '';\n\t\tthis.#labelPattern = labelPattern;\n\t\tthis.#createUrl = typeof createUrl === 'function' ? createUrl : null;\n\t\tthis.#fieldsShow = fieldsShow;\n\t\tthis.#idFields = idFields;\n\t\tconst tr = this.#tr;\n\t\ttr.innerHTML = '';\n\t\tconst th = tr.appendChild(document.createElement('th'));\n\t\tth.appendChild(document.createTextNode('#'));\n\t\tfor (const [name,field] of fieldsShow) {\n\t\t\tconst th = tr.appendChild(document.createElement('th'));\n\t\t\tth.appendChild(document.createTextNode(field.label || name));\n\t\t}\n\t}\n\t#renderList() {\n\t\tconst tbody = this.#tbody;\n\t\ttbody.innerHTML = '';\n\t\tconst idFields = this.#idFields;\n\t\tconst labelPattern = this.#labelPattern;\n\t\tconst fieldsShow = this.#fieldsShow;\n\t\tconst createUrl = this.#createUrl;\n\t\tfor (const r of this.#documents) {\n\t\t\tconst tr = tbody.appendChild(document.createElement('tr'));\n\t\t\tconst td = tr.appendChild(document.createElement('td'));\n\t\t\tconst label = Pattern.generate(labelPattern, r) || idFields.map(v => r[v]).join('$')\n\t\t\tif (createUrl) {\n\t\t\t\tconst a = td.appendChild(document.createElement('a'));\n\t\t\t\ta.href = createUrl(idFields.map(v => r[v]).join('$'));\n\t\t\t\ta.appendChild(document.createTextNode(label));\n\t\t\t} else {\n\t\t\t\ttd.appendChild(document.createTextNode(label));\n\t\t\t}\n\t\t\tfor (const [name,field] of fieldsShow) {\n\t\t\t\tconst td = tr.appendChild(document.createElement('td'));\n\t\t\t\tconst f = createShowField(name, field, {inline: true}, r);\n\t\t\t\ttd.appendChild(f.root);\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * \n\t * @param {readonly any[]} list \n\t */\n\tsetData(list) {\n\t\tthis.#documents = list;\n\t\tthis.#renderList();\n\n\t}\n\tdestroy() {\n\t\t\n\t}\n}\n","import { Pagination as NlPagination } from '@neeloong/components'\n\nexport default class Pagination {\n\t#fns;\n\t#pagination;\n\tconstructor() {\n\t\tconst pagination = /** @type {NlPagination} */(document.createElement('nl-pagination'));\n\t\tpagination.size = 20;\n\t\tpagination.appendChild(/** @type {NlPagination.Value} */(document.createElement('nl-pagination-value'))).name=\"start\";\n\t\tpagination.appendChild(document.createTextNode('-'));\n\t\tpagination.appendChild(/** @type {NlPagination.Value} */(document.createElement('nl-pagination-value'))).name=\"end\";\n\t\tpagination.appendChild(document.createTextNode('/'));\n\t\tpagination.appendChild(/** @type {NlPagination.Value} */(document.createElement('nl-pagination-value'))).name=\"total\";\n\t\tpagination.appendChild(document.createElement('nl-pagination-prev')).innerText = '上一页';\n\t\tpagination.appendChild(document.createElement('nl-pagination-pager'));\n\t\tpagination.appendChild(document.createElement('nl-pagination-next')).innerText = '下一页';\n\t\tpagination.appendChild(document.createElement('nl-pagination-sizer'));\n\t\tconst fns = new Set();\n\t\t\n\t\tpagination.addEventListener('change', () => {\n\t\t\tfor (const fn of fns) {\n\t\t\t\tfn();\n\t\t\t}\n\t\t})\n\t\tthis.#fns = fns;\n\t\tthis.#pagination = pagination;\n\n\t}\n\tget root() {return this.#pagination; }\n\tget size() { return this.#pagination.size}\n\tset size(v) { this.#pagination.size = v}\n\tget page() { return this.#pagination.page}\n\tset page(v) { this.#pagination.page = v}\n\tget total() { return this.#pagination.total}\n\tset total(v) { this.#pagination.total = v}\n\t/**\n\t * \n\t * @param {(p: Pagination) => void} listen \n\t * @returns {() => void}\n\t */\n\tlisten(listen) {\n\t\tconst fns = this.#fns;\n\t\tconst f = () => listen(this);\n\t\tfns.add(f);\n\t\treturn () => {fns.delete(f)}\n\t}\n\tdestroy() {\n\t\t\n\t}\n}\n","/** @import { HomeContext } from '@yongdall/web' */\n/**\n *\n * @param {string} href\n * @param {string} title\n */\nfunction createLink(href, title) {\n\tconst a = document.createElement('a');\n\ta.href = href;\n\ta.title = title;\n\ta.style.display = 'block';\n\ta.appendChild(document.createTextNode(title));\n\treturn a;\n}\n\n\n/**\n * @param {HTMLElement} container\n */\nfunction renderHome(container) {\n}\n\n\n/**\n * \n * @param {HomeContext} homeContext \n */\nexport default function home(homeContext) {\n\thomeContext.listen('update', () => {\n\t\tconst { container } = homeContext;\n\t\tcontainer.innerHTML = '';\n\t\treturn renderHome(container);\n\t});\n}\n","import type { Menu } from '@yongdall/web';\nimport type { Collapse } from '@neeloong/components';\nimport '@neeloong/components';\nimport { Application, createNeverAbortedSignal, Ident, PageIdent, watch } from '@yongdall/web';\n\n\n\nfunction* toFindPath(\n\tactive: string,\n\tmenuMap: Map<string, HTMLElement[]>,\n\tpathMenuMap: Map<string, [HTMLElement, number: number][]>,\n): IterableIterator<HTMLElement[]> {\n\tif (!active) { return; }\n\tconst index = active.indexOf('?');\n\tconst path = index < 0 ? active : active.slice(0, index);\n\tif (index >= 0 && index + 1 < active.length) {\n\t\tfor (const list = active.slice(index).split('&'); list.length; list.pop()) {\n\n\t\t\tconst menus = menuMap.get(`${path}${list.join('&')}`);\n\t\t\tif (!menus?.length) { continue; }\n\t\t\tyield menus;\n\t\t}\n\n\t}\n\n\tconst menus = menuMap.get(path);\n\tif (menus?.length) { yield menus; }\n\tconst pathMenus = pathMenuMap.get(path);\n\tif (pathMenus?.length) { yield pathMenus.map(v => v[0]); }\n}\n\n\nfunction* findMenu(\n\tactive: string,\n\tmenuMap: Map<string, HTMLElement[]>,\n\tpathMenuMap: Map<string, [HTMLElement, number: number][]>,\n\tident: PageIdent | null,\n\tidentMap: Map<string, HTMLElement[]>,\n): IterableIterator<HTMLElement[]> {\n\tyield* toFindPath(active, menuMap, pathMenuMap);\n\tif (!ident) { return; }\n\tfor (const p of [...Ident.stringifyPaths(ident)].reverse()) {\n\t\tconst menus = identMap.get(p);\n\t\tif (!menus?.length) { continue; }\n\t\tyield menus;\n\t}\n}\n\n\nfunction* findTextNode(element: HTMLElement): Iterable<Text> {\n\tconst walker = document.createTreeWalker(element, NodeFilter.SHOW_TEXT);\n\tfor (let node; node = walker.nextNode();) {\n\t\t// @ts-ignore\n\t\tyield node;\n\t}\n}\n\nfunction filter(texts: string[], element: HTMLElement): Range[] {\n\tconst ranges = [];\n\n\tconst textNodes = [...findTextNode(element)].filter(n => n.nodeValue?.length);\n\tconst indexes = textNodes.reduce<[number, number, Text][]>((list, currentValue) => {\n\t\tconst index = list[list.length - 1]?.[1] || 0;\n\t\treturn [...list, [\n\t\t\tindex,\n\t\t\tindex + (currentValue.nodeValue?.length || 0),\n\t\t\tcurrentValue,\n\t\t]];\n\t}, []);\n\tconst fullText = textNodes.map(n => n.nodeValue).join('');\n\n\tlet startIndex = 0;\n\tfor (const searchText of texts) {\n\t\tconst index = fullText.indexOf(searchText, startIndex);\n\t\tif (index === -1) { return []; }\n\t\tconst endIndex = index + searchText.length;\n\n\t\tconst start = indexes.findLast(([start]) => start <= index);\n\t\tif (!start) { return []; }\n\t\tconst end = indexes.findLast(([, end]) => end >= endIndex);\n\t\tif (!end) { return []; }\n\t\tstartIndex = index + searchText.length;\n\n\n\t\tconst range = new Range();\n\t\trange.setStart(start[2], index - start[0]);\n\t\trange.setEnd(end[2], endIndex - start[0]);\n\t\tranges.push(range);\n\t}\n\treturn ranges;\n}\n\nexport default function createNavMenu(\n\troot: Element,\n\tmenus: (Menu | null)[],\n\toptions: {\n\t\tactive?: string | [string | null | undefined, PageIdent | null | undefined];\n\t\tsignal?: AbortSignal;\n\t\tfilter?: string;\n\t} = {},\n) {\n\tconst pathMenuMap: Map<string, [HTMLElement, number: number][]> = new Map();\n\tconst menuMap: Map<string, HTMLElement[]> = new Map();\n\tconst identMap: Map<string, HTMLElement[]> = new Map();\n\tlet current: HTMLElement | null = null;\n\tconst allMenus: HTMLElement[] = [];\n\tconst destroyList: (() => void)[] = [];\n\n\tfunction createLink(menu: Menu | Menu.Button, el?: HTMLElement) {\n\t\tconst link = document.createElement('a');\n\t\tconst item = link;\n\t\tlink.appendChild(document.createTextNode(menu.label || menu.title || ''));\n\t\tlink.title = menu.title || '';\n\t\tconst { page, path, uri, target } = menu;\n\t\tlet url: URL | null = null;\n\t\tconst ident = page && Ident.parse(page);\n\t\tif (ident) {\n\t\t\turl = new URL(PageIdent.stringify(ident, path), Application.root);\n\t\t\tlink.href = url.href;\n\t\t\tif (target && typeof target === 'string') { link.target = target; }\n\n\t\t} else if (uri) {\n\t\t\tlink.href = uri;\n\t\t\ttry {\n\t\t\t\turl = new URL(uri);\n\t\t\t\tif (url.origin !== location.origin) {\n\t\t\t\t\turl = null;\n\t\t\t\t}\n\t\t\t} catch { }\n\t\t\tif (target !== '') { link.target = target ?? '_blank'; }\n\t\t}\n\t\tif (url && (link.target || '_self') === '_self') {\n\t\t\tlink.addEventListener('click', () => {\n\t\t\t\tclickedItem = item;\n\t\t\t\trequestIdleCallback(() => {\n\t\t\t\t\tif (clickedItem !== item) { return; }\n\t\t\t\t\tclickedItem = null;\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst { pathname: pathname, search } = url;\n\t\t\tconst fullPath = `${pathname}${search}`;\n\t\t\tconst list = menuMap.get(fullPath);\n\t\t\tif (list) {\n\t\t\t\tlist.push(item);\n\t\t\t} else {\n\t\t\t\tmenuMap.set(pathname, [item]);\n\t\t\t}\n\t\t\tconst list2 = pathMenuMap.get(fullPath);\n\t\t\tif (list2) {\n\t\t\t\tlist2.push([item, search.length]);\n\t\t\t} else {\n\t\t\t\tpathMenuMap.set(pathname, [[item, search.length]]);\n\t\t\t}\n\t\t\tif (ident && (!path || path[0] === '?' || path[0] === '#')) {\n\t\t\t\tconst key = Ident.stringify(ident);\n\t\t\t\tconst list = identMap.get(key);\n\t\t\t\tif (list) {\n\t\t\t\t\tlist.push(item);\n\t\t\t\t} else {\n\t\t\t\t\tidentMap.set(key, [item]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn link;\n\t}\n\n\tfunction createButton(button: Menu.Button) {\n\t\tconst link = createLink(button);\n\t\tlink.classList.add('NavMenu-button');\n\t\treturn link;\n\t}\n\tlet clickedItem: HTMLElement | null = null;\n\n\n\tfunction renderMenu(\n\t\tmenu: Menu,\n\t\tlevel: number,\n\t): { el: HTMLElement; filter(show: boolean, t?: string[] | null): Range[]; } | null {\n\t\tconst { children } = menu;\n\t\tif (!children.length) {\n\t\t\tconst item = document.createElement('div');\n\t\t\tconst link = item.appendChild(createLink(menu, item));\n\n\t\t\tfor (const button of menu.buttons || []) {\n\t\t\t\titem.appendChild(createButton(button));\n\t\t\t}\n\t\t\titem.classList.add('NavMenu-item');\n\t\t\tlink.classList.add('NavMenu-item-link');\n\t\t\treturn {\n\t\t\t\tel: item, filter(show, text) {\n\t\t\t\t\tconst list = text ? filter(text, link) : [];\n\t\t\t\t\titem.hidden = Boolean(!show && text && !list.length);\n\t\t\t\t\treturn list;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\tconst item = document.createElement('nl-collapse') as Collapse;\n\t\titem.setAttribute('animation', '');\n\t\titem.setAttribute('menu', '');\n\t\tconst header = item.appendChild(document.createElement('div'));\n\t\theader.appendChild(document.createTextNode(menu.label || menu.title || ''));\n\t\theader.className = 'NavMenu-label';\n\t\theader.slot = 'label';\n\t\theader.style.flex = '1';\n\t\tfor (const button of menu.buttons || []) {\n\t\t\titem.appendChild(createButton(button)).slot = 'label';\n\t\t}\n\t\tconst childrenMenu = renderChildren(item, children, level + 1);\n\t\tif (!childrenMenu.length) { return null; }\n\t\treturn {\n\t\t\tel: item, filter(show, text) {\n\t\t\t\tif (!text) {\n\t\t\t\t\tfor (const menu of childrenMenu) { menu.filter(show); }\n\t\t\t\t\titem.hidden = false;\n\t\t\t\t\titem.open = false;\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tconst self = filter(text, header);\n\t\t\t\tconst hasSelf = Boolean(show || self.length);\n\n\t\t\t\tconst ranges = childrenMenu.flatMap(v => v.filter(hasSelf, text));\n\t\t\t\titem.open = Boolean(ranges.length);\n\t\t\t\tconst list = [...self, ...ranges];\n\t\t\t\titem.hidden = !show && !list.length;\n\t\t\t\treturn list;\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction renderChildren(\n\t\tparent: Element,\n\t\tmenus: (Menu | null)[],\n\t\tlevel: number,\n\t) {\n\t\tlet has = false;\n\t\tlet divider = false;\n\t\tlet children = [];\n\t\tfor (const menu of menus) {\n\t\t\tif (!menu) {\n\t\t\t\tif (!has) { continue; }\n\t\t\t\tdivider = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (divider) {\n\t\t\t\tdivider = false;\n\t\t\t\tparent.appendChild(document.createElement('hr'));\n\t\t\t}\n\t\t\tconst item = renderMenu(menu, level);\n\t\t\tif (!item) { continue; }\n\t\t\tchildren.push(item);\n\t\t\thas = true;\n\t\t\tparent.appendChild(item.el);\n\t\t\tallMenus.push(item.el);\n\t\t\titem.el.style.setProperty('--NavMenu-level', String(level));\n\t\t}\n\t\treturn children;\n\t}\n\tconst menuList = renderChildren(root, menus, 0);\n\tlet destroyed = false;\n\tfunction destroy() {\n\t\tif (destroyed) { return; }\n\t\tdestroyed = true;\n\t\tfor (const m of allMenus) {\n\t\t\tm.remove();\n\t\t}\n\t\tfor (const destroy of destroyList) {\n\t\t\tdestroy();\n\t\t}\n\t}\n\tconst signal = options.signal || createNeverAbortedSignal();\n\tif (signal.aborted) {\n\t\tdestroy();\n\t} else {\n\t\tsignal.addEventListener('abort', destroy, { once: true });\n\t}\n\tlet parents: HTMLElement[] = [];\n\twatch(() => {\n\t\tconst active = options.active;\n\t\tif (!active) { return null; }\n\t\tif (typeof active === 'string') {\n\t\t\treturn active.replace(/#.*/, '') || '';\n\t\t}\n\t\tif (!Array.isArray(active)) { return null; }\n\t\tconst page = active[1] || null;\n\t\tif (!page) {\n\t\t\treturn active[0]?.replace(/#.*/, '') || null;\n\n\t\t}\n\t\tconst result: [string, PageIdent | null] = [active[0]?.replace(/#.*/, '') || '', active[1] || null];\n\t\treturn result;\n\t}, active => {\n\t\tif (!active) { return; }\n\t\tconst path = Array.isArray(active) ? active[0] : '';\n\t\tconst page = Array.isArray(active) ? active[1] : null;\n\t\tfor (const menus of findMenu(path, menuMap, pathMenuMap, page, identMap)) {\n\t\t\tconst clicked = clickedItem && menus.includes(clickedItem) ? clickedItem : null;\n\t\t\tif (clicked) { clickedItem = null; }\n\t\t\tif (!clicked && current && menus.includes(current)) { return; }\n\t\t\tconst menu = clicked || menus[0];\n\t\t\tconst list = [];\n\t\t\tlet parent = menu.parentElement;\n\t\t\tfor (; parent && parent !== root; parent = parent.parentElement) {\n\t\t\t\tlist.push(parent);\n\t\t\t}\n\t\t\tif (parent !== root) { return; }\n\t\t\tparents = list;\n\t\t\tcurrent?.classList.remove('NavMenu-current');\n\t\t\tfor (const item of parents) {\n\t\t\t\titem.setAttribute('open', '');\n\t\t\t}\n\t\t\tcurrent = menu;\n\t\t\tcurrent?.classList.add('NavMenu-current');\n\t\t\treturn;\n\t\t}\n\n\n\t}, { signal, immediate: true });\n\n\treturn (text: string) => {\n\t\tconst texts: string[] | null = text.toLowerCase().split(/[\\s\\n]+/).filter(Boolean);\n\t\tif (texts.length) {\n\t\t\treturn menuList.flatMap(v => v.filter(false, texts));\n\t\t}\n\t\tmenuList.flatMap(v => v.filter(false));\n\t\tfor (const item of parents) {\n\t\t\titem.setAttribute('open', '');\n\t\t}\n\t\treturn [];\n\t};\n}\n","import { Application, createComputed, createIcon, createState, effect, flatPermission, Menu, PageIdent, toPermissionFilter, User } from '@yongdall/web';\nimport createNavMenu from '../menu/createNavMenu.mts';\n\n\n\n\nexport const menuContainer = document.createElement('div');\n\n\nmenuContainer.style.display = 'flex';\nmenuContainer.style.flexDirection = 'column';\nconst header = menuContainer.appendChild(document.createElement('header'));\nheader.classList.add('NavMenu-header');\nconst filter = header.appendChild(document.createElement('input'));\nfilter.placeholder = '过滤菜单...';\nfilter.type = 'search';\nconst refreshButton = header.appendChild(document.createElement('button'));\nrefreshButton.appendChild(createIcon('refresh', true));\nrefreshButton.classList.add('icon');\nrefreshButton.title = '刷新';\n\n\nconst main = menuContainer.appendChild(document.createElement('main'));\nmain.style.flex = '1';\nmain.style.overflow = 'auto';\nmain.classList.add('NavMenu');\nlet k = 0;\nlet loaded = false;\n/** @type {ReturnType<typeof createNavMenu>?} */\nlet navMenu = null;\nfunction filterMenu() {\n\tconst list = navMenu?.(filter.value) || [];\n\tconst highlight = new Highlight(...list);\n\tCSS.highlights.set(\"NavMenu-filter-highlight\", highlight);\n}\nfilter.addEventListener('input', filterMenu);\n\nconst allMenus = createComputed(\n\t() => Menu.fromDefine(Application.menus, [])\n);\nconst currentMenus = createComputed(() => {\n\tconst permissions = User.permissions;\n\tconst menus = allMenus.get();\n\tif (permissions.size < 0) { return menus; }\n\n\tconst filter = toPermissionFilter({\n\t\tpermissions,\n\t\torganizationPermissions: User.organizationPermissions,\n\t\tallOrganizationPermissions: User.allOrganizationPermissions,\n\t});\n\treturn Menu.filter(menus, m => {\n\t\tconst permissions = flatPermission(m.permission);\n\t\tif (!permissions.length) { return true; }\n\t\treturn Boolean(permissions.find(filter));\n\t});\n});\nconst currentPath = createState(/** @type {string | [string, PageIdent]} */(''));\n/** @type {AbortController?} */\nlet ac = null;\neffect(() => {\n\tac?.abort();\n\tmain.innerHTML = '';\n\tac = new AbortController();\n\tnavMenu = createNavMenu(main, currentMenus.get(), {\n\t\tsignal: ac.signal,\n\t\tget active() { return currentPath.get(); },\n\t});\n\tfilterMenu();\n});\n/**\n * \n * @param {string} path \n * @param {string} search \n * @param {string} hash \n * @param {(PageIdent & {path: string})?} page \n */\nexport function updatePath(path, search, hash, page) {\n\tif (!page) {\n\t\tcurrentPath.set(`${path}${search}`);\n\t\treturn;\n\t}\n\tcurrentPath.set([`${path}${search}`, page]);\n}\n\nrefreshButton.addEventListener('click', () => Application.loadMenus(true));\n","\nimport { Application, createIcon, toFileLink, watch } from '@yongdall/web';\nimport { cssPrefix } from './styles/variables.mjs';\n\nconst logoLink = document.createElement('a');\nlogoLink.classList.add(`${cssPrefix}-logo`);\nwatch(() => Application.root, root => {\n\tlogoLink.href = root;\n}, { immediate: true });\nwatch(() => toFileLink(Application.logo), (logo, _logo, onCleanup) => {\n\tconst signal = onCleanup();\n\tlet logoEl;\n\tif (logo) {\n\t\tlogoEl = document.createElement('img');\n\t\tlogoEl.src = logo.href;\n\t} else {\n\t\tlogoEl = createIcon('logo', signal);\n\t}\n\tlogoLink.appendChild(logoEl);\n\tlogoEl.classList.add('logo');\n\tonCleanup(() => { logoEl.remove(); });\n}, { immediate: true });\nexport { logoLink };\n","/** @import { PageContext } from '@yongdall/web' */\n\n/**\n * @typedef {object} PageError\n * @property {string} title\n * @property {string} [description]\n */\n\n/** @type {Record<string, PageError>} */\nexport const errors = {\n\t404: {\n\t\ttitle: '您所请求的页面无法找到',\n\t\tdescription: '服务器无法正常提供信息。\\n目标页面可能已经被更改、删除或移到其他位置,或您所输入页面地址错误。',\n\t}\n};\n\n/**\n * @param {PageContext} ctx\n * @param {unknown} error\n */\nexport default function renderError(ctx, error) {\n\tif ((error ?? '') == '') {\n\t\tctx.container.appendChild(document.createTextNode('空页面'));\n\t\treturn;\n\t}\n\tconst e = (typeof error === 'number' || typeof error === 'string')\n\t\t&& Object.hasOwn(errors, error) && errors[error]\n\t\t|| errors['404'];\n\tconst title = e?.title || 'Error';\n\tconst info = e?.description;\n\tconst errorContainer = document.createElement('div');\n\tconst main = errorContainer.appendChild(document.createElement('div'));\n\tconst titleDiv = main.appendChild(document.createElement('div'));\n\tconst infoDiv = main.appendChild(document.createElement('div'));\n\terrorContainer.style.marginBlock = '8%';\n\terrorContainer.style.marginInline = 'auto';\n\terrorContainer.style.inlineSize = '600px';\n\terrorContainer.style.maxInlineSize = '100%';\n\terrorContainer.style.padding = '20px';\n\ttitleDiv.style.paddingBlock = '20px';\n\ttitleDiv.style.fontSize = '20px';\n\ttitleDiv.style.color = '#8e8e8e';\n\ttitleDiv.style.textAlign = 'center';\n\tinfoDiv.style.fontSize = '13px';\n\tinfoDiv.style.lineHeight = '1.3em';\n\tinfoDiv.style.color = '#b5b5b5';\n\ttitleDiv.appendChild(document.createTextNode(title));\n\tctx.title = title || 'Error';\n\tif (info && typeof info === 'string') {\n\t\tfor (const p of info.split('\\n')) {\n\t\t\tinfoDiv.appendChild(document.createTextNode(p));\n\t\t\tinfoDiv.appendChild(document.createElement('br'));\n\t\t}\n\t}\n\tctx.container.appendChild(errorContainer);\n\tctx.loading = false;\n}\n","import { cssPrefix } from '../styles/variables.mjs';\n\nexport const prefix = `${cssPrefix}-allSider-nav`\n\nexport const header = document.createElement('header');\nheader.className = `${prefix}-header`;\nexport const actions = header.appendChild(document.createElement('div'));\nactions.classList.add(`${prefix}-actions`)\nexport const sidebar = header.appendChild(document.createElement('div'));\nsidebar.classList.add(`${prefix}-sidebar`);\n","import { createState } from '@yongdall/web';\nimport { prefix, sidebar } from './dom.mjs';\nconst openedClassName = `${prefix}-open`;\n/** @type {(() => void)?} */\nlet current = null;\n\nexport function closeSidebarWhenMobile() {\n\tif (window.innerWidth > 800) { return; }\n\tcurrent?.();\n}\n\nexport default class Sider {\n\t/** @readonly @type {HTMLElement} */\n\tbutton;\n\t/** @readonly @type {HTMLElement} */\n\tsider;\n\t/** @type {() => void} */\n\t#hide;\n\n\t#disabled = false;\n\tget disabled() { return this.#disabled; }\n\tset disabled(v) {\n\t\tif (v) {\n\t\t\tthis.disable();\n\t\t} else {\n\t\t\tthis.enable();\n\t\t}\n\t}\n\tdisable() {\n\t\tif (this.#disabled) { return; }\n\t\tthis.#disabled = true;\n\t\tconst hide = this.#hide;\n\t\tif (current === hide) {\n\t\t\thide();\n\t\t}\n\t\tthis.button.hidden = true;\n\t\tthis.sider.hidden = true;\n\t\t// TODO: 隐藏分组\n\t}\n\tenable() {\n\t\tif (!this.#disabled) { return; }\n\t\tthis.#disabled = false;\n\t\tthis.button.hidden = false;\n\t\t// TODO: 显示分组\n\t}\n\t#click = () => this.toggle();\n\t/**\n\t * \n\t * @param {HTMLElement} [siderContainer] \n\t * @param {HTMLElement} [buttonContainer] \n\t */\n\tconstructor(siderContainer, buttonContainer) {\n\t\tconst button = buttonContainer instanceof HTMLElement\n\t\t\t? buttonContainer\n\t\t\t: document.createElement('div');\n\t\tconst sider = siderContainer instanceof HTMLElement\n\t\t\t? siderContainer\n\t\t\t: document.createElement('div');\n\t\tbutton.tabIndex = 0;\n\t\tbutton.classList.add(`${prefix}-button`);\n\t\tsider.hidden = true;\n\t\tsidebar.appendChild(sider);\n\t\tbutton.classList.add(`${prefix}-selectable`);\n\t\tconst hide = () => {\n\t\t\tcurrent = null;\n\t\t\tdocument.body.classList.remove(openedClassName);\n\t\t\tbutton.classList.remove(`${prefix}-selected`);\n\t\t\tsider.hidden = true;\n\t\tthis.#shown.set(false);\n\t\t};\n\t\tbutton.addEventListener('click', this.#click);\n\t\tthis.#hide = hide;\n\t\tthis.button = button;\n\t\tthis.sider = sider;\n\t}\n\t#shown = createState(false);\n\tget shown() { return this.#shown.get(); }\n\tset shown(p) {\n\t\tif (p) {\n\t\t\tthis.show();\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\tget hidden() { return this.button.hidden; }\n\tset hidden(v) {\n\t\tthis.button.hidden = Boolean(v);\n\t\tif (!v) { return; }\n\t\tthis.hide();\n\t}\n\tget open() { return current === this.#hide; }\n\tset open(p) {\n\t\tif (p) {\n\t\t\tthis.show();\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\tshow() {\n\t\tif (this.hidden) { return; }\n\t\tif (this.#disabled) { return; }\n\t\tconst hide = this.#hide;\n\t\tif (current === hide) { return; }\n\t\tcurrent?.();\n\t\tcurrent = hide;\n\t\tdocument.body.classList.add(openedClassName);\n\t\tthis.button.classList.add(`${prefix}-selected`);\n\t\tthis.sider.hidden = false;\n\t\tthis.#shown.set(true);\n\t}\n\ttoggle() {\n\t\tif (this.hidden) { return; }\n\t\tif (this.#disabled) { return; }\n\t\tconst hide = this.#hide;\n\t\tif (current === hide) {\n\t\t\thide();\n\t\t\treturn;\n\t\t}\n\t\tthis.show();\n\t}\n\thide() {\n\t\tif (this.hidden) { return; }\n\t\tif (this.#disabled) { return; }\n\t\tconst hide = this.#hide;\n\t\tif (current !== hide) { return; }\n\t\thide();\n\t}\n\tremove() {\n\t\tconst hide = this.#hide;\n\t\tif (current === hide) {\n\t\t\thide();\n\t\t}\n\t\tconst { button, sider } = this;\n\t\tbutton.remove();\n\t\tsider.remove();\n\t\tbutton.classList.remove(`${prefix}-button`);\n\t\tbutton.classList.remove(`${prefix}-selectable`);\n\t\tbutton.removeEventListener('click', this.#click);\n\t\tsider.hidden = false;\n\t\t// TODO: ...\n\t\t// TODO: 隐藏分组\n\t}\n}\nsidebar.addEventListener('click', (e) => {\n\tif (e.target !== e.currentTarget) { return; }\n\tcurrent?.();\n});\n","import Sider, { closeSidebarWhenMobile } from './Sider.mjs';\nimport { prefix } from './dom.mjs';\n\n\n\nexport default class Group {\n\t/** @readonly */\n\troot = document.createElement('div');\n\t/** @type {Set<() => void>} */\n\t#children = new Set()\n\t/**\n\t * \n\t * @param {HTMLElement} parent \n\t */\n\tconstructor(parent) {\n\t\tconst root = this.root;\n\t\tparent.appendChild(root);\n\t\troot.className = `${prefix}-group`;\n\t}\n\tremove() {\n\t\tthis.root.remove();\n\t\tfor (const r of [...this.#children]) {\n\t\t\tr();\n\t\t}\n\t}\n\tcreateGroup() {\n\t\tconst group = new Group(this.root);\n\t\tconst children = this.#children;\n\t\tconst remove = () => {children.delete(remove); group. remove(); }\n\t\tchildren.add(remove);\n\t\treturn group;\n\t}\n\t/**\n\t * \n\t * @overload\n\t * @param {true} isLink \n\t * @returns {HTMLAnchorElement}\n\t */\n\t/**\n\t * \n\t * @overload\n\t * @param {boolean} [isLink] \n\t * @returns {HTMLElement}\n\t */\n\t/**\n\t * \n\t * @param {boolean} [isLink] \n\t * @returns {HTMLElement}\n\t */\n\tcreateAction(isLink) {\n\t\tconst btn = document.createElement(isLink ? 'a' : 'div');\n\t\tbtn.tabIndex = 0;\n\t\tbtn.classList.add(`${prefix}-button`);\n\t\tbtn.addEventListener('click', () => { closeSidebarWhenMobile(); });\n\t\tthis.root.appendChild(btn);\n\n\n\t\tconst children = this.#children;\n\t\tconst remove = () => {children.delete(remove); btn.remove(); }\n\t\tchildren.add(remove);\n\t\treturn btn;\n\t}\n\t/**\n\t * \n\t * @param {HTMLElement} [siderContainer] \n\t * @param {HTMLElement} [buttonContainer] \n\t */\n\tcreateSider(siderContainer, buttonContainer) {\n\t\tconst sider = new Sider(siderContainer, buttonContainer);\n\t\tthis.root.appendChild(sider.button);\n\n\n\t\tconst children = this.#children;\n\t\tconst remove = () => {children.delete(remove); sider.remove(); }\n\t\tchildren.add(remove);\n\t\treturn sider;\n\t}\n}\n","import Group from './Group.mjs';\nimport { actions } from './dom.mjs';\nexport const pageSiderContainer = document.createElement('div');\nexport const startGroup = new Group(actions);\nexport const pageGroup = new Group(actions);\nexport const mainGroup = new Group(actions);\nexport const span = actions.appendChild(document.createElement('span'));\nexport const endGroup = new Group(actions);\n\nexport const pageSider = pageGroup.createSider(pageSiderContainer);\npageSider.button.innerText = '页面';\npageSider.disabled = true;\n","import { pageSider, pageSiderContainer } from './sides.mjs';\n\nimport { PageSider, Page } from '@yongdall/web';\n\n\nclass Sider extends PageSider {\n\t#page;\n\t#parent;\n\t/**\n\t * @param {AllSiderPage} page \n\t * @param {ParentNode} parent \n\t * @param {Node?} next \n\t * @param {boolean} inserted \n\t * @param {AbortSignal} signal \n\t * @param {ParentNode} parent \n\t * @returns \n\t */\n\tconstructor(page, parent, next, inserted, signal) {\n\t\tsuper(parent, next, inserted, signal);\n\t\tthis.#page = page;\n\t\tthis.#parent = parent;\n\t\tsignal.addEventListener('abort', () => {\n\t\tthis.#hidden();\n\t\t})\n\t}\n\tinsert() {\n\t\tsuper.insert();\n\n\t\tif (this.#page.show) { pageSider.disabled = false; }\n\t}\n\t#hidden() {\n\t\tif (this.#page.show && !this.#parent.children.length) {\n\t\t\tpageSider.disabled = true;\n\t\t}\n\t}\n\tremove() {\n\t\tsuper.remove();\n\t\tthis.#hidden();\n\t}\n\n}\n\nexport default class AllSiderPage extends Page {\n\t#sides = (() => {\n\t\tconst sides = document.createElement('div');\n\t\tsides.classList.add('Page-sides');\n\t\tpageSiderContainer.appendChild(sides);\n\t\treturn sides;\n\t})();\n\tdestroy() {\n\t\tif (!super.destroy()) { return false; }\n\t\tthis.#sides.remove();\n\t\treturn true;\n\t}\n\t/**\n\t * \n\t * @param {boolean} show \n\t */\n\ttoggle(show) {\n\t\tsuper.toggle(show);\n\t\t// TODO: 区别区域\n\t\tpageSider.disabled = !(show && this.#sides.children.length);\n\t}\n\tget siderOpen() { return pageSider.open; }\n\tset siderOpen(open) {\n\t\t// TODO: 判断是不是当前的\n\t\tif (open) {\n\t\t\tpageSider.show();\n\t\t} else {\n\t\t\tpageSider.hide();\n\t\t}\n\t}\n\t/**\n\t * \n\t * @param {boolean} [inserted] \n\t * @param {AbortSignal} [signal] \n\t * @returns {PageSider}\n\t */\n\tcreateSider(inserted, signal) {\n\t\tif (this.destroyed) { throw new Error('页面组件已被销毁'); }\n\t\tsignal?.throwIfAborted();\n\t\tconst parent = this.#sides;\n\t\treturn new Sider(\n\t\t\tthis,\n\t\t\tparent,\n\t\t\tnull,\n\t\t\tinserted !== false,\n\t\t\tsignal instanceof AbortSignal\n\t\t\t\t? AbortSignal.any([signal, this.signal])\n\t\t\t\t: this.signal\n\t\t);\n\t}\n\t/**\n\t * \n\t * @param {boolean} show \n\t */\n\tconstructor(show) {\n\t\tsuper(show);\n\t\tif (show) {\n\t\t\tpageSider.disabled = !this.#sides.children.length;\n\t\t}\n\t}\n}\n","import '@neeloong/components';\nimport type { Menu, State } from '@yongdall/web';\nimport type { Menu as NeeloongMenu } from '@neeloong/components';\nimport { createComputed, watch } from '@yongdall/web';\n\n\nexport default function createMenu<T extends Node>(\n\tparent: T,\n\tmenus: (Menu | null)[],\n\toptions: Menu.RendererOptions,\n\tbutton: boolean = false,\n\tcreateSub?: (parent: T | NeeloongMenu, child: NeeloongMenu, menu: Menu, hidden: State<boolean>) => void,\n): State<boolean> | null {\n\tif (options.signal.aborted) { return null; }\n\tconst { create, signal } = options;\n\tlet has = false;\n\tlet divider = false;\n\tlet lastHr: HTMLHRElement | null = null;\n\tconst allButtons: State<boolean>[] = [];\n\tlet lastButtons: State<boolean>[] = [];\n\tlet buttons: State<boolean>[] = [];\n\tfunction updateHr() {\n\t\tconst hr = lastHr;\n\t\tif (!hr) { return }\n\t\tconst list = lastButtons;\n\t\twatch(() => list.some(v => v.get()), hidden => {\n\t\t\thr.hidden = hidden\n\t\t}, { signal, immediate: true })\n\t}\n\tconst createDivider = () => {\n\t\thas = true;\n\t\tif (!divider) { return; }\n\t\tdivider = false;\n\t\tupdateHr();\n\t\tconst hr = document.createElement('hr');\n\t\tlastHr = hr;\n\t\tlastButtons = buttons;\n\t\tbuttons = [];\n\t\tparent.appendChild(hr);\n\t};\n\tfunction add(hidden: State<boolean>) {\n\t\tcreateDivider();\n\t\tlastButtons.push(hidden);\n\t\tbuttons.push(hidden);\n\t\tallButtons.push(hidden);\n\t}\n\tfor (const menu of menus) {\n\t\tif (!menu) {\n\t\t\tif (!has) { continue; }\n\t\t\tdivider = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst { children } = menu;\n\t\tif (!children?.length) {\n\t\t\tconst result = create(menu, { button });\n\t\t\tif (!result) { continue; }\n\t\t\tcreateDivider();\n\t\t\tadd(createComputed(() => Boolean(menu.hidden)));\n\t\t\tparent.appendChild(result);\n\t\t\tcontinue;\n\t\t}\n\t\tconst child = document.createElement('nl-menu') as NeeloongMenu;\n\t\tconst childHidden = createMenu<NeeloongMenu>(child, children, options);\n\t\tif (!childHidden) { continue; }\n\t\tconst hidden = createComputed(() => Boolean(menu.hidden || childHidden.get()));\n\t\tadd(hidden);\n\t\tif (createSub) {\n\t\t\tcreateSub(parent, child, menu, hidden);\n\t\t} else {\n\n\t\t\twatch(() => hidden.get(), hidden => { item.hidden = hidden }, { signal, immediate: true })\n\t\t\tconst item = parent.appendChild(child);\n\t\t\tconst header = item.insertBefore(document.createElement('div'), item.firstChild);\n\t\t\theader.appendChild(document.createTextNode(menu.label || menu.title || ''));\n\t\t\theader.slot = 'label';\n\t\t}\n\n\t}\n\tif (!has) { return null; }\n\tupdateHr();\n\treturn createComputed(() => allButtons.some(v => v.get()));\n}\n","import { watch, type Menu } from '@yongdall/web';\nimport '@neeloong/components';\nimport createMenuList from './createMenu.mts';\n\nexport default function createMenuButtons(\n\tmenus: (Menu | null)[],\n\toptions: Menu.RendererOptions,\n) {\n\tif (options.signal.aborted) { return null; }\n\tconst { create, signal } = options;\n\tconst root = document.createElement('div');\n\tcreateMenuList(root, menus, options, true, (root, child, menu, hidden) => {\n\t\tconst button = root.appendChild(document.createElement('button'));\n\t\tbutton.appendChild(document.createTextNode(menu.label || menu.title || ''));\n\t\tchild.targetElement = button;\n\t\tbutton.addEventListener('click', () => child.show?.());\n\t\troot.appendChild(child);\n\t\twatch(() => hidden.get(), hidden => {\n\t\t\tbutton.hidden = hidden\n\t\t\tchild.hidden = hidden\n\t\t}, { signal, immediate: true });\n\t});\n\tif (!root.childNodes.length) { return null; }\n\troot.classList.add('MenuButtons');\n\treturn root;\n}\n","import type { Menu } from '@yongdall/web';\nimport { Application, createComputed, effect, isMac, watch } from '@yongdall/web';\n\n\nfunction getUri(item: Menu.Renderer.Command) {\n\tconst { page } = item;\n\tif (page) {\n\t\tconst { path } = item;\n\t\treturn new URL(path?.[0] === '/' ? `${page}${path}` : `${page}/${path || ''}`, Application.root).href;\n\t}\n\tconst { uri } = item;\n\tif (uri) { return uri; }\n\treturn null;\n}\nexport default function createMenuItem(menu: Menu, options: Menu.Renderer.Options): HTMLElement {\n\tconst { signal, button: isButton } = options;\n\tconst link = document.createElement('a');\n\tconst button = isButton ? document.createElement('button') : null;\n\twatch(() => menu.label || menu.title || '', label => {\n\t\tlink.textContent = label;\n\t}, { signal, immediate: true });\n\n\tconst { commands } = options;\n\n\tconst disabled = createComputed(() => {\n\t\tif (menu.disabled) { return true; }\n\t\tconst { command } = menu;\n\t\tconst cmd = command && Object.hasOwn(commands, command) && commands[command];\n\t\treturn Boolean(cmd ? cmd.disabled : options.disabled(menu));\n\t});\n\n\tconst href = createComputed(() => {\n\t\tconst href = getUri(menu);\n\t\tif (href) { return href; }\n\t\tconst { command } = menu;\n\t\tconst cmd = command && Object.hasOwn(commands, command) && commands[command];\n\t\treturn cmd ? getUri(cmd) || null : options.uri(menu) || null;\n\t});\n\tfunction click() {\n\t\tconst { click } = menu;\n\t\tif (typeof click === 'function') { return click(); }\n\t\tconst { script } = menu;\n\t\tif (script) {\n\t\t\t// TODO:\n\t\t\treturn;\n\t\t}\n\t\tconst { command } = menu;\n\t\tconst cmd = command && Object.hasOwn(commands, command) && commands[command];\n\t\treturn cmd ? cmd.click?.() : options.click(menu);\n\t}\n\teffect(() => {\n\t\tconst isDisabled = disabled.get();\n\t\t// @ts-ignore\n\t\tlink.disabled = isDisabled;\n\t\tlink.ariaDisabled = isDisabled ? 'true' : 'false';\n\t\tif (isDisabled) {\n\t\t\tlink.removeAttribute('tabindex');\n\t\t\tlink.removeAttribute('href');\n\t\t\tlink.removeAttribute('target');\n\t\t} else {\n\t\t\tlink.tabIndex = 0;\n\t\t\tlet target = '';\n\t\t\tconst hrefValue = href.get();\n\t\t\tif (hrefValue) {\n\t\t\t\tlink.href = hrefValue;\n\t\t\t\ttarget = menu.target || (menu.page ? '_self' : '');\n\t\t\t}\n\t\t\tif (target) {\n\t\t\t\tlink.target = target;\n\t\t\t} else {\n\t\t\t\tlink.removeAttribute('target');\n\t\t\t}\n\t\t}\n\t\tif (button) {\n\t\t\tbutton.disabled = isDisabled;\n\t\t}\n\t}, signal);\n\tlink.addEventListener('click', (e) => {\n\t\tif (!disabled.get()) { return; }\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t}, { capture: true });\n\tlink.addEventListener('click', (e) => {\n\t\tif (disabled.get()) { return; }\n\t\tif (e.defaultPrevented) { return; }\n\t\tif (href.get()) {\n\t\t\tif (e.shiftKey) { return; }\n\t\t\tif (isMac ? e.metaKey : e.ctrlKey) { return; }\n\t\t\tif (e.altKey) { return; }\n\t\t}\n\t\tif (click() === false) {\n\t\t\te.preventDefault();\n\t\t}\n\t});\n\tif (button) {\n\t\tbutton.appendChild(link);\n\t\treturn button;\n\t}\n\treturn link;\n\n}\n","import type { Menu as NeeloongMenu } from '@neeloong/components';\nimport type { Menu } from '@yongdall/web';\nimport '@neeloong/components';\nimport { createIcon, watch } from '@yongdall/web';\n\nimport createMenu from './createMenu.mts';\n\n\nexport default function createMenuButton(\n\tmenus: (Menu | null)[],\n\tmenu: Menu | null,\n\toptions: Menu.RendererOptions,\n) {\n\tconst root = document.createElement('div');\n\tconst child = document.createElement('nl-menu') as NeeloongMenu;\n\tconst hidden = createMenu(child, menus, options);\n\tif (!hidden) { return hidden; }\n\tconst button = root.appendChild(document.createElement('button'));\n\tconst label = menu?.label || menu?.title || '';\n\tif (label) {\n\t\tbutton.appendChild(document.createTextNode(label));\n\t} else {\n\t\tbutton.appendChild(createIcon(menu?.icon || 'more', options.signal));\n\t}\n\tchild.targetElement = button;\n\tbutton.addEventListener('click', () => child.show());\n\troot.appendChild(child);\n\twatch(() => hidden.get(), hidden => root.hidden = hidden, {\n\t\tsignal: options.signal,\n\t\timmediate: true,\n\t})\n\treturn root;\n}\n","import { createComputed, createIcon, createNeverAbortedSignal, effect, User } from '@yongdall/web';\nimport { cssPrefix } from '../styles/variables.mjs';\n\n\n/**\n * \n * @param {string} avatar \n * @param {AbortSignal} signal\n * @param {boolean} [button] \n */\nfunction createAvatar(avatar, signal, button) {\n\tif (!avatar) {\n\t\tconst svg = createIcon('user', signal);\n\t\tif (!button) { svg.setAttribute('fill-opacity', '0.5'); }\n\t\treturn svg;\n\t}\n\tconst img = document.createElement('img');\n\timg.src = avatar;\n\treturn img;\n\n}\n/**\n * \n * @param {HTMLElement} root \n * @param {boolean} [button] \n * @param {AbortSignal} [signal] \n * @returns \n */\nexport function createUserAvatar(root, button, signal = createNeverAbortedSignal()) {\n\troot.classList.add(`${cssPrefix}-user-avatar`);\n\n\tconst sessionAvatarComputed = createComputed(() => User.single ? null : User.session?.avatar || '');\n\t/** @type {string?} */\n\tlet sessionAvatar = sessionAvatarComputed.get();\n\t/** @type {AbortController?} */\n\tlet sessionAbortController = new AbortController();\n\tconst sessionSignal = AbortSignal.any([sessionAbortController.signal, signal]);\n\tlet sessionAvatarElement = sessionAvatar === null\n\t\t? createIcon('singleUser', sessionSignal)\n\t\t: createAvatar(sessionAvatar, sessionSignal, button);\n\troot.appendChild(sessionAvatarElement);\n\teffect(() => {\n\t\tconst newAvatar = User.single ? null : User.session?.avatar || '';\n\t\tif (newAvatar === sessionAvatar) { return; }\n\t\tsessionAvatar = newAvatar;\n\t\tsessionAbortController?.abort();\n\t\tsessionAbortController = new AbortController();\n\n\t\tconst sessionSignal = AbortSignal.any([sessionAbortController.signal, signal]);\n\t\tconst newAvatarElement = sessionAvatar === null\n\t\t\t? createIcon('singleUser', sessionSignal)\n\t\t\t: createAvatar(sessionAvatar, sessionSignal, button);\n\t\tif (!button && sessionAvatar === null) {\n\t\t\tnewAvatarElement.setAttribute('fill-opacity', '0.5');\n\t\t}\n\t\troot.replaceChild(newAvatarElement, sessionAvatarElement);\n\t\tsessionAvatarElement.remove();\n\t\tsessionAvatarElement = newAvatarElement;\n\t}, signal);\n\n\tconst targetAvatarComputed = createComputed(() => {\n\t\tconst impersonation = User.impersonation;\n\t\tconst session = User.session;\n\t\tif (!impersonation) { return null; }\n\t\tif (impersonation.id === (session?.id || '')) { return null; }\n\t\treturn impersonation.avatar || '';\n\t});\n\t/** @type {string?} */\n\tlet targetAvatar = null;\n\t/** @type {Element?} */\n\tlet targetAvatarElement = null;\n\t/** @type {AbortController?} */\n\tlet targetAbortController = null;\n\teffect(() => {\n\t\tconst newAvatar = targetAvatarComputed.get();\n\t\tif (newAvatar === targetAvatar) { return; }\n\t\ttargetAvatar = newAvatar;\n\t\ttargetAvatarElement?.remove();\n\t\ttargetAvatarElement = null;\n\t\ttargetAbortController?.abort();\n\t\tif (newAvatar === null) { return; }\n\t\ttargetAbortController = new AbortController();\n\t\tconst targetSignal = AbortSignal.any([targetAbortController.signal, signal]);\n\t\ttargetAvatarElement = createAvatar(newAvatar, targetSignal, button);\n\t\troot.insertBefore(targetAvatarElement, sessionAvatarElement);\n\t}, signal);\n\n}\n","import { Application, createComputed, createIcon, effect, Menu, User, watch } from '@yongdall/web';\nimport { createUserAvatar } from './userAvatar.mjs';\nimport { cssPrefix } from '../styles/variables.mjs';\nimport createNavMenu from '../menu/createNavMenu.mts';\n\n\nexport default function buildUserContainer(signal: AbortSignal) {\n\tconst userContainer = document.createElement('div');\n\tuserContainer.classList.add(`${cssPrefix}-user`);\n\n\tconst userInfo = userContainer.appendChild(document.createElement('span'));\n\tuserInfo.classList.add(`${cssPrefix}-user-info`);\n\tconst avatar = userInfo.appendChild(document.createElement('span'));\n\tcreateUserAvatar(avatar, false, signal);\n\tavatar.classList.add('avatar');\n\tconst username = userInfo.appendChild(document.createElement('span'));\n\tusername.classList.add('username');\n\tusername.innerText = '用户名';\n\tconst btns = userInfo.appendChild(document.createElement('div'));\n\n\tlet helpEl: ChildNode = btns.appendChild(document.createComment(''));\n\twatch(() => Application.help, (help, _help, onCleanup) => {\n\t\tif (!help) {\n\t\t\tconst el = document.createComment('');\n\t\t\thelpEl.replaceWith(el);\n\t\t\thelpEl = el;\n\t\t\treturn;\n\t\t}\n\t\tconst el = document.createElement('a');\n\t\tel.href = help;\n\t\tel.target = '_blank';\n\t\tel.appendChild(createIcon('help', onCleanup()));\n\t\tel.title = '帮助';\n\t\thelpEl.replaceWith(el);\n\t\thelpEl = el;\n\t}, { immediate: true, signal });\n\n\tconst exitButton = btns.appendChild(document.createElement('div'));\n\texitButton.appendChild(createIcon('logout', signal));\n\texitButton.title = '退出登录';\n\teffect(() => {\n\t\texitButton.hidden = !User.operator;\n\t}, signal);\n\texitButton.addEventListener('click', () => User.exit(true));\n\n\teffect(() => {\n\t\tusername.innerText = User.operator?.name || '';\n\t}, signal);\n\n\n\tconst allMenus = createComputed(\n\t\t() => Menu.fromDefine(Application.userMenus, [])\n\t);\n\n\n\tconst currentMenus = createComputed(() => {\n\t\tconst menus = allMenus.get();\n\t\tif (User.operator) { return menus; }\n\t\treturn Menu.filter(menus, v => !v.logged);\n\t});\n\n\tconst main = userContainer.appendChild(document.createElement('main'));\n\tmain.style.flex = '1';\n\tmain.style.overflow = 'auto';\n\tmain.classList.add('NavMenu');\n\n\tlet ac: AbortController | null = null;\n\teffect(() => {\n\t\tac?.abort();\n\t\tmain.innerHTML = '';\n\t\tac = new AbortController();\n\t\tcreateNavMenu(main, currentMenus.get(), {\n\t\t\tsignal: ac.signal,\n\t\t});\n\t}, signal);\n\tsignal.addEventListener('abort', () => ac?.abort());\n\treturn userContainer;\n}\n","import { createUserAvatar } from './userAvatar.mjs';\nimport { cssPrefix } from '../styles/variables.mjs';\n\n\nexport default function buildUserButton(signal: AbortSignal) {\n\tconst userButton = document.createElement('div');\n\tuserButton.classList.add(`${cssPrefix}-user-button`);\n\tcreateUserAvatar(userButton, true, signal);\n\treturn userButton;\n}\n","import type { NavButton, Theme } from '@yongdall/web';\nimport { Application, createComputed, createFrame, createIcon, createState, effect, ErrorAlerter, loadNavButtons, root as rootContainer } from '@yongdall/web';\nimport { cssPrefix } from '../styles/variables.mjs';\nimport pageManager, { activityContainer, setMode } from '../pageManager/index.mjs';\n\nimport List from '../components/List.mjs';\nimport Pagination from '../components/Pagination.mjs';\nimport { default as home } from '../home/index.mjs';\nimport { menuContainer, updatePath } from '../workspace/index.mjs';\nimport { logoLink } from '../logo.mjs';\nimport renderError from '../error/index.mjs';\n\nimport { actions, header } from './dom.mjs';\nimport { closeSidebarWhenMobile } from './Sider.mjs';\nimport { endGroup, startGroup } from './sides.mjs';\nimport AllSiderPage from './AllSiderPage.mjs';\nimport createMenuButtons from '../menu/createMenuButtons.mts';\nimport createMenuItem from '../menu/createMenuItem.mts';\nimport createMenuButton from '../menu/createMenuButton.mts';\nimport buildUserContainer from '../user/buildUserContainer.mts';\nimport buildUserButton from '../user/buildUserButton.mts';\n\n\nfunction addButton({\n\thidden, title, disabled, createIcon: createButtonIcon,\n\tcreatePanel, href, click,\n}: NavButton, signal: AbortSignal) {\n\tif (signal.aborted) { return; }\n\tconst shown = createState(createState(false));\n\tconst ctx: NavButton.Context = {\n\t\tget shown() { return shown.get().get(); },\n\t\tget signal() { return signal; },\n\t}\n\tlet button: HTMLElement\n\tif (createPanel) {\n\t\tconst sider = startGroup.createSider(createPanel(ctx));\n\t\tbutton = sider.button;\n\t\tshown.set(createComputed(() => sider.shown));\n\t\tsignal.addEventListener('abort', () => { sider.remove(); }, { once: true });\n\t} else if (href) {\n\t\tconst action = startGroup.createAction(true);\n\t\teffect(() => {\n\t\t\tconst url = !disabled?.(ctx) && href(ctx);\n\t\t\tif (url) { action.href = url; }\n\t\t\telse { action.removeAttribute('href'); }\n\t\t}, signal);\n\t\tif (click) {\n\t\t\taction.addEventListener('click', event => {\n\t\t\t\tif (click(ctx) === false) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}, { signal });\n\t\t}\n\t\tbutton = action;\n\t\tsignal.addEventListener('abort', () => { action.remove(); }, { once: true });\n\n\t} else {\n\n\t\tconst action = startGroup.createAction();\n\t\tif (disabled) {\n\t\t\teffect(() => {\n\t\t\t\tif (disabled(ctx)) {\n\n\t\t\t\t\taction.removeAttribute('tabIndex');\n\t\t\t\t} else {\n\t\t\t\t\taction.tabIndex = 0;\n\t\t\t\t}\n\t\t\t}, signal);\n\t\t}\n\t\tif (click) {\n\t\t\taction.addEventListener('click', () => { click(ctx) }, { signal });\n\t\t}\n\t\tbutton = action;\n\t\tsignal.addEventListener('abort', () => { action.remove(); }, { once: true });\n\n\t}\n\tif (hidden) {\n\t\teffect(() => { button.hidden = hidden(ctx); }, signal);\n\t}\n\tif (title) {\n\t\teffect(() => { button.title = title(ctx) }, signal);\n\t}\n\tif (createButtonIcon) {\n\t\tbutton.appendChild(createButtonIcon(ctx));\n\t} else {\n\t\tbutton.appendChild(createIcon(['icon', 'logo'], signal));\n\t}\n}\nconst theme: Theme = {\n\ttitle(p) { return [p.title, Application.title || '拥道YongDall'].filter(Boolean).join(' | ') },\n\ticon(p) { return p.icon },\n\tcomponents: { List, Pagination, createMenuButtons, createMenuItem, createMenuButton },\n\tupdatePath,\n\tpageManager,\n\telements: [rootContainer, header],\n\tclassNames: [cssPrefix, `${cssPrefix}-allSider`],\n\tstyleFiles: ['theme-allSider.css'],\n\thome,\n\talertError: ErrorAlerter,\n\trootClassName: `${cssPrefix}-root`,\n\tcreateFrame,\n\tcreatePage(show) { return new AllSiderPage(show); },\n\trenderError(ctx, error) { renderError(ctx, error); },\n\tasync setup(signal) {\n\t\tsetMode(false);\n\t\tlogoLink.addEventListener('click', () => { closeSidebarWhenMobile(); }, { signal });\n\t\tactions.insertBefore(logoLink, actions.firstElementChild);\n\n\t\tconst workspaceSider = startGroup.createSider(menuContainer);\n\t\tworkspaceSider.button.appendChild(createIcon('menu', signal));\n\t\tworkspaceSider.button.title = '菜单';\n\t\tconst activitySider = startGroup.createSider(activityContainer);\n\t\tactivitySider.button.appendChild(createIcon('activity', signal));\n\t\tactivitySider.button.title = '活动';\n\t\tif (window.innerWidth > 800) {\n\t\t\tworkspaceSider.show();\n\t\t}\n\n\t\tconst userContainer = buildUserContainer(signal);\n\t\tconst userButton = buildUserButton(signal);\n\t\tconst userSider = endGroup.createSider(userContainer, userButton);\n\n\t\tsignal.addEventListener('abort', () => {\n\t\t\tlogoLink.remove();\n\t\t\tworkspaceSider.remove();\n\t\t\tactivitySider.remove();\n\t\t\tuserSider.remove();\n\t\t}, { once: true });\n\t\tfor await (const button of loadNavButtons()) {\n\t\t\tif (signal.aborted) { return; }\n\t\t\taddButton(button, signal);\n\t\t}\n\t},\n\n};\n\nexport default theme\n","import { type NavButton, createState, createComputed, effect, createIcon } from '@yongdall/web';\n\nexport function addButton(anchor: Node, container: ParentNode, {\n\thidden, title, disabled, createIcon: createButtonIcon,\n\tcreatePanel, href, click,\n}: NavButton, signal: AbortSignal) {\n\tif (signal.aborted) { return; }\n\tconst parent = anchor.parentNode;\n\tif (!parent) { return; }\n\tconst shown = createState(createState(false));\n\tconst ctx: NavButton.Context = {\n\t\tget shown() { return shown.get().get(); },\n\t\tget signal() { return signal; },\n\t};\n\tlet button;\n\tif (createPanel) {\n\t\tconst btn = document.createElement('div');\n\t\tconst panel = createPanel(ctx);\n\t\tbutton = btn;\n\t\tconst panelShown = createState(true);\n\t\tshown.set(createComputed(() => !shown.get()));\n\n\t\tcontainer.appendChild(panel);\n\t\tbtn.addEventListener('click', () => { panel.showPopover(); }, { signal });\n\t\tpanel.setAttribute('popover', 'auto');\n\t\tpanel.addEventListener('toggle', event => { panelShown.set(event.newState === 'closed'); }, { signal });\n\t\tsignal.addEventListener('abort', () => {\n\t\t\tpanel.removeAttribute('popover');\n\t\t\tpanel.remove();\n\t\t}, { once: true });\n\t} else if (href) {\n\t\tconst action = document.createElement('a');\n\t\tif (click) {\n\t\t\taction.addEventListener('click', event => {\n\t\t\t\tif (click(ctx) === false) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}, { signal });\n\t\t}\n\t\teffect(() => {\n\t\t\tconst url = !disabled?.(ctx) && href(ctx);\n\t\t\tif (url) { action.href = url; }\n\t\t\telse { action.removeAttribute('href'); }\n\t\t}, signal);\n\t\tbutton = action;\n\t} else {\n\t\tconst action = document.createElement('div');\n\t\tif (click) {\n\t\t\taction.addEventListener('click', () => { click(ctx) }, { signal });\n\t\t}\n\t\tif (disabled) {\n\t\t\teffect(() => {\n\t\t\t\tif (disabled(ctx)) {\n\n\t\t\t\t\taction.removeAttribute('tabIndex');\n\t\t\t\t} else {\n\t\t\t\t\taction.tabIndex = 0;\n\t\t\t\t}\n\t\t\t}, signal);\n\t\t}\n\t\tbutton = action;\n\t}\n\tif (hidden) {\n\t\teffect(() => { button.hidden = hidden(ctx); }, signal);\n\t}\n\tif (title) {\n\t\teffect(() => { button.title = title(ctx); }, signal);\n\t}\n\tparent.insertBefore(button, anchor);\n\tif (createButtonIcon) {\n\t\tbutton.appendChild(createButtonIcon(ctx));\n\t} else {\n\t\tbutton.appendChild(createIcon(['icon', 'logo'], signal));\n\t}\n\tsignal.addEventListener('abort', () => { button.remove(); }, { once: true });\n}\n","import type { State, Theme } from '@yongdall/web';\nimport { createFrame, createTick, ErrorAlerter, loadNavButtons, Page, root as rootContainer } from '@yongdall/web';\nimport { Application, createIcon, effect } from '@yongdall/web';\n\nimport { cssPrefix } from '../styles/variables.mjs';\nimport List from '../components/List.mjs';\nimport Pagination from '../components/Pagination.mjs';\nimport { default as home } from '../home/index.mjs';\nimport { menuContainer, updatePath } from '../workspace/index.mjs';\nimport { logoLink } from '../logo.mjs';\nimport renderError from '../error/index.mjs';\n\nimport createMenuButtons from '../menu/createMenuButtons.mts';\nimport createMenuItem from '../menu/createMenuItem.mts';\nimport createMenuButton from '../menu/createMenuButton.mts';\nimport { addButton } from '../utils/addButton.mts';\nimport buildUserContainer from '../user/buildUserContainer.mts';\nimport buildUserButton from '../user/buildUserButton.mts';\n\n\n\nconst prefix = `${cssPrefix}-base`;\nconst styleFiles = ['theme-base.css'];\n\nconst headerEl = document.createElement('header');\nconst header = headerEl.appendChild(document.createElement('div'));\nheader.classList.add(`${prefix}-header`);\nconst sidebar = headerEl.appendChild(document.createElement('div'));\nsidebar.classList.add(`${prefix}-sidebar`);\n\nconst menuButton = header.appendChild(createIcon('menu', true));\nmenuButton.classList.add(`${prefix}-menu-button`);\n\nconst span = header.appendChild(document.createElement('span'));\n\nconst openedClassName = `${prefix}-menu-open`;\n\nmenuButton.addEventListener('click', () => {\n\tdocument.body.classList.toggle(openedClassName);\n});\n\n\nsidebar.addEventListener('click', (e) => {\n\tif (e.target !== e.currentTarget) { return; }\n\tdocument.body.classList.remove(openedClassName);\n});\n\n\nlet tick: State<number> | null = null;\nconst spinner = '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏';\n\n\nconst theme: Theme = {\n\ttitle(p) {\n\t\treturn [[\n\t\t\ttick && p.loading ? spinner[tick.get() % spinner.length] : '',\n\t\t\tp.unsaved ? '🔴' : '',\n\t\t\tp.title,\n\t\t].join(''), Application.title || '拥道YongDall'].filter(Boolean).join(' | ')\n\t},\n\ticon(p) { return p.icon },\n\tcomponents: { List, Pagination, createMenuButtons, createMenuItem, createMenuButton },\n\tupdatePath,\n\tpageManager(page) {\n\t\tlet shown = false;\n\t\teffect(() => {\n\t\t\tif (!page.current) {\n\t\t\t\tif (shown) { page.destroy(); }\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tshown = true;\n\t\t}, page.signal);\n\t},\n\telements: [headerEl, rootContainer],\n\tclassNames: [cssPrefix, prefix],\n\tstyleFiles,\n\thome,\n\talertError: ErrorAlerter,\n\trootClassName: `${cssPrefix}-root`,\n\tcreateFrame,\n\tcreatePage(show) { return new Page(show); },\n\trenderError(ctx, error) { renderError(ctx, error); },\n\tasync setup(signal) {\n\t\ttick = createTick(80, signal);\n\t\tlogoLink.addEventListener('click', () => {\n\t\t\tif (window.innerWidth > 800) { return; }\n\t\t\tdocument.body.classList.remove(openedClassName);\n\t\t}, { signal });\n\n\t\tconst titleSpan = document.createElement('div');\n\t\ttitleSpan.classList.add(`${prefix}-header-title`);\n\t\teffect(() => {\n\t\t\ttitleSpan.innerText = Application.title || Application.company || '';\n\t\t}, signal);\n\t\theader.insertBefore(logoLink, span);\n\t\theader.insertBefore(titleSpan, span);\n\n\t\tif (window.innerWidth > 800) {\n\t\t\tdocument.body.classList.add(openedClassName);\n\t\t}\n\n\t\tsidebar.appendChild(menuContainer);\n\n\t\tconst panelContainer = document.createElement('div');\n\t\tpanelContainer.classList.add(`${prefix}-panels`);\n\t\tdocument.body.appendChild(panelContainer);\n\n\t\tconst userContainer = buildUserContainer(signal);\n\t\tpanelContainer.appendChild(userContainer);\n\t\tuserContainer.setAttribute('popover', 'auto');\n\t\tconst userButton = buildUserButton(signal);\n\t\tuserButton.addEventListener('click', () => { userContainer.showPopover(); }, { signal });\n\n\n\n\t\tconst actions = header.appendChild(document.createElement('div'));\n\t\tactions.classList.add(`${prefix}-actions`);\n\n\t\tconst anchor = actions.appendChild(document.createElement('span'));\n\t\tactions.appendChild(userButton);\n\n\n\t\tsignal.addEventListener('abort', () => {\n\t\t\tlogoLink.remove();\n\t\t\ttitleSpan.remove();\n\t\t\tmenuContainer.remove();\n\t\t\tpanelContainer.remove();\n\t\t\tuserContainer.removeAttribute('popover');\n\t\t\tuserContainer.remove();\n\t\t\tuserButton.remove();\n\t\t\tanchor.remove();\n\t\t\tactions.remove();\n\t\t}, { once: true });\n\t\tfor await (const button of loadNavButtons()) {\n\t\t\tif (signal.aborted) { return; }\n\t\t\taddButton(anchor, panelContainer, button, signal);\n\t\t}\n\t},\n\n};\nexport default theme;\n","import type { State, Theme } from '@yongdall/web';\nimport { createFrame, createTick, ErrorAlerter, Page, root as rootContainer } from '@yongdall/web';\nimport { Application, effect } from '@yongdall/web';\n\nimport { cssPrefix } from '../styles/variables.mjs';\nimport List from '../components/List.mjs';\nimport Pagination from '../components/Pagination.mjs';\nimport { default as home } from '../home/index.mjs';\nimport { updatePath } from '../workspace/index.mjs';\nimport renderError from '../error/index.mjs';\n\nimport createMenuButtons from '../menu/createMenuButtons.mts';\nimport createMenuItem from '../menu/createMenuItem.mts';\nimport createMenuButton from '../menu/createMenuButton.mts';\n\n\n\nconst prefix = `${cssPrefix}-pure`;\nconst styleFiles = ['theme-pure.css'];\n\n\n\n\nlet tick: State<number> | null = null;\nconst spinner = '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏';\nconst theme: Theme = {\n\ttitle(p) {\n\t\treturn [[\n\t\t\ttick && p.loading ? spinner[tick.get() % spinner.length] : '',\n\t\t\tp.unsaved ? '🔴' : '',\n\t\t\tp.title,\n\t\t].join(''), Application.title || '拥道YongDall'].filter(Boolean).join(' | ')\n\t},\n\ticon(p) { return p.icon },\n\tcomponents: { List, Pagination, createMenuButtons, createMenuItem, createMenuButton },\n\tupdatePath,\n\tpageManager(page) {\n\t\tlet shown = false;\n\t\teffect(() => {\n\t\t\tif (!page.current) {\n\t\t\t\tif (shown) { page.destroy(); }\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tshown = true;\n\t\t}, page.signal);\n\t},\n\telements: [rootContainer],\n\tclassNames: [cssPrefix, prefix],\n\tstyleFiles,\n\thome,\n\talertError: ErrorAlerter,\n\trootClassName: `${cssPrefix}-root`,\n\tcreateFrame,\n\tcreatePage(show) { return new Page(show); },\n\trenderError(ctx, error) { renderError(ctx, error); },\n\tasync setup(signal) {\n\t\ttick = createTick(80, signal);\n\t},\n\n};\nexport default theme;\n","import { createIcon } from '@yongdall/web';\nimport { cssPrefix } from '../styles/variables.mjs';\n\nexport const prefix = `${cssPrefix}-tabs`;\n\nexport const headerEl = document.createElement('header');\nexport const header = headerEl.appendChild(document.createElement('div'));\nheader.classList.add(`${prefix}-header`);\nexport const sidebar = headerEl.appendChild(document.createElement('div'));\nsidebar.classList.add(`${prefix}-sidebar`);\n\nconst menuButton = header.appendChild(createIcon('menu', true));\nmenuButton.classList.add(`${prefix}-menu-button`);\n\nexport const span = header.appendChild(document.createElement('span'));\n\n\nexport const openedClassName = `${prefix}-menu-open`;\n\nmenuButton.addEventListener('click', () => {\n\tdocument.body.classList.toggle(openedClassName);\n});\n\n\nexport function closeSidebarWhenMobile() {\n\tif (window.innerWidth > 800) { return; }\n\tdocument.body.classList.remove(openedClassName);\n}\nsidebar.addEventListener('click', (e) => {\n\tif (e.target !== e.currentTarget) { return; }\n\tdocument.body.classList.remove(openedClassName);\n});\n","import type { Theme } from '@yongdall/web';\nimport { Application, createFrame, effect, ErrorAlerter, loadNavButtons, Page, root as rootContainer } from '@yongdall/web';\nimport { cssPrefix } from '../styles/variables.mjs';\nimport pageManager, { activityContainer, setMode } from '../pageManager/index.mjs';\n\nimport List from '../components/List.mjs';\nimport Pagination from '../components/Pagination.mjs';\nimport { default as home } from '../home/index.mjs';\nimport { menuContainer, updatePath } from '../workspace/index.mjs';\nimport { logoLink } from '../logo.mjs';\nimport renderError from '../error/index.mjs';\n\nimport { header, closeSidebarWhenMobile, openedClassName, prefix, span } from './dom.mjs';\nimport { headerEl, sidebar } from './dom.mjs';\nimport createMenuButtons from '../menu/createMenuButtons.mts';\nimport createMenuItem from '../menu/createMenuItem.mts';\nimport createMenuButton from '../menu/createMenuButton.mts';\nimport { addButton } from '../utils/addButton.mts';\nimport buildUserContainer from '../user/buildUserContainer.mts';\nimport buildUserButton from '../user/buildUserButton.mts';\n\n\n\nconst theme: Theme = {\n\ttitle(p) { return [p.title, Application.title || '拥道YongDall'].filter(Boolean).join(' | ') },\n\ticon(p) { return p.icon },\n\tcomponents: { List, Pagination, createMenuButtons, createMenuItem, createMenuButton },\n\tupdatePath,\n\tpageManager,\n\telements: [headerEl, rootContainer],\n\tclassNames: [cssPrefix, `${cssPrefix}-tabs`],\n\tstyleFiles: ['theme-tabs.css'],\n\thome,\n\talertError: ErrorAlerter,\n\trootClassName: `${cssPrefix}-root`,\n\tcreateFrame,\n\tcreatePage(show) { return new Page(show); },\n\trenderError(ctx, error) { renderError(ctx, error);},\n\tasync setup(signal) {\n\t\tsetMode(true);\n\t\tlogoLink.addEventListener('click', () => { closeSidebarWhenMobile(); }, {signal});\n\n\t\tconst titleSpan = document.createElement('div');\n\t\ttitleSpan.classList.add(`${prefix}-header-title`);\n\t\teffect(() => {\n\t\t\ttitleSpan.innerText = Application.title || Application.company || '';\n\t\t}, signal);\n\t\t\n\t\theader.insertBefore(logoLink, span);\n\t\theader.insertBefore(titleSpan, span);\n\t\theaderEl.appendChild(activityContainer);\n\n\t\tif (window.innerWidth > 800) {\n\t\t\tdocument.body.classList.add(openedClassName);\n\t\t}\n\n\t\tsidebar.appendChild(menuContainer);\n\n\t\tconst panelContainer = document.createElement('div');\n\t\tpanelContainer.classList.add(`${prefix}-panels`);\n\t\tdocument.body.appendChild(panelContainer);\n\n\t\tconst userContainer = buildUserContainer(signal);\n\t\tpanelContainer.appendChild(userContainer);\n\t\tuserContainer.setAttribute('popover', 'auto');\n\t\tconst userButton = buildUserButton(signal);\n\t\tuserButton.addEventListener('click', () => { userContainer.showPopover(); }, {signal});\n\n\n\t\tconst actions = header.appendChild(document.createElement('div'));\n\t\tactions.classList.add(`${prefix}-actions`);\n\n\t\tconst anchor = actions.appendChild(document.createElement('span'));\n\t\tactions.appendChild(userButton);\n\n\n\t\tsignal.addEventListener('abort', () => {\n\t\t\tlogoLink.remove();\n\t\t\ttitleSpan.remove();\n\t\t\tactivityContainer.remove();\n\t\t\tmenuContainer.remove();\n\t\t\tuserContainer.removeAttribute('popover')\n\t\t\tuserContainer.remove();\n\t\t\tuserButton.remove();\n\t\t}, {once: true});\n\t\t\t\tfor await (const button of loadNavButtons()) {\n\t\t\t\t\tif (signal.aborted) { return; }\n\t\t\t\t\taddButton(anchor, panelContainer, button, signal);\n\t\t\t\t}\n\t},\n\n};\n\nexport default theme;\n"],"mappings":"2cAAA,MAAa,EAAY,gBCGnBA,EAAS,GAAG,EAAU,WAEf,EAAoB,SAAS,cAAc,KAAK,EAC7D,EAAkB,UAAU,IAAIA,CAAM,EAatC,MAAM,GAAU,IAAI,IAEpB,IAAI,EACA,GAAS,GAKb,SAAgB,GAAQ,EAAE,CACzB,GAAS,CACV,CAEA,MAAM,GAAe,GAAS,CAC7B,IAAM,EAAS,SAAS,cAAc,KAAK,EAC3C,EAAO,UAAU,IAAI,GAAGA,EAAO,MAAM,EACrC,IAAM,EAAO,EAAO,YAAY,SAAS,cAAc,GAAG,CAAC,EAC3D,EAAK,UAAU,IAAI,GAAGA,EAAO,OAAO,EACpC,EAAK,KAAO,EAAK,KACjB,EAAK,UAAY,EAAK,MACtB,IA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