@yongdall/web 0.1.0 → 0.1.1

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
@@ -75,6 +75,6 @@ A 0.38 0.38 0 0 0 0.2326051608575812 0.23
75
75
  Z
76
76
  `},hi=_(()=>({...mi,...k.get(`icons`).named(),logo:`
77
77
  M 0.29739625333333336 0.04334391666666666 M 0.06325983999999997 0.34186114333333334 H 0.08357982999999995 V 0.27435362333333335 L 0.1393469133333333 0.18517144333333335 H 0.1169949233333333 L 0.07500027666666663 0.25606563000000004 H 0.07364560999999996 L 0.03142518666666665 0.18517144333333332 H 0.007944309999999984 L 0.06325983999999997 0.2745794 Z M 0.29739625333333336 0.04334391666666666 M 0.21046684333333332 0.34411892 C 0.24659127 0.34411892 0.26668548233333333 0.32944337333333334 0.26668548233333333 0.28090117333333336 C 0.26668548233333333 0.2323589766666667 0.24659127 0.21768343000000004 0.21046684333333332 0.21768343000000004 C 0.17434241666666667 0.21768343000000004 0.15402242666666668 0.2323589766666667 0.15402242666666668 0.28090117333333336 C 0.15402242666666668 0.32944337333333334 0.17434241666666667 0.34411892 0.21046684333333332 0.34411892 Z M 0.21046684333333332 0.32763715000000004 C 0.18405085666666665 0.32763715000000004 0.17479397333333332 0.31657404666666666 0.17479397333333332 0.28090117333333336 C 0.17479397333333332 0.24545408000000002 0.18314774666666667 0.23393942 0.21046684333333332 0.23393942 C 0.23710860666666667 0.23393942 0.24613971333333332 0.24545408000000002 0.24613971333333332 0.28090117333333336 C 0.24613971333333332 0.3165740466666667 0.2382374966666667 0.32763715000000004 0.21046684333333332 0.32763715000000004 Z M 0.29739625333333336 0.04334391666666666 M 0.3592538966666667 0.21768342999999998 C 0.34435257 0.21768342999999998 0.3274192466666667 0.22152165 0.32019436133333334 0.23732608666666666 V 0.21994120666666667 H 0.30077748233333335 V 0.34186114333333334 H 0.3201943613333333 V 0.2594522966666667 C 0.32674191366666666 0.2380034166666667 0.3418690166666667 0.23506831000000003 0.35722189666666665 0.23506831000000003 C 0.37641300000000005 0.23506831000000003 0.3804769966666667 0.2459056366666667 0.3804769966666667 0.26464518333333337 V 0.34186114333333334 H 0.4001196533333333 V 0.2574202966666667 C 0.4001196533333333 0.2341651966666667 0.39108854666666665 0.21768343000000004 0.3592538966666667 0.21768343000000004 Z M 0.5233938433333333 0.21994120666666667 V 0.24274475 C 0.5186525133333334 0.22829498000000004 0.50849252 0.21768342999999998 0.48388275333333336 0.21768342999999998 C 0.4432427733333333 0.21768342999999998 0.43330855666666673 0.24613141333333333 0.43330855666666673 0.2797722866666667 C 0.43330855666666673 0.31679982333333334 0.4432427733333333 0.3418611433333334 0.48388275333333336 0.3418611433333334 C 0.5073636300000001 0.3418611433333334 0.5182009566666667 0.3335073700000001 0.5233938433333333 0.31905760000000005 V 0.3312495933333333 C 0.5233938433333333 0.35924602333333333 0.5105245166666667 0.37030913 0.4834311966666667 0.37030913 C 0.47281964666666665 0.37030913 0.46288543 0.36940602 0.4536285466666667 0.3675997966666667 V 0.38408158333333337 C 0.4615307633333333 0.3856620166666667 0.47259386999999997 0.38701668333333333 0.48320541999999994 0.38701668333333333 C 0.5245227333333333 0.38701668333333333 0.5428107233333334 0.36692246333333334 0.5428107233333334 0.33328159333333335 V 0.21994120666666667 Z M 0.48659208666666665 0.32560515333333334 C 0.45769254333333337 0.32560515333333334 0.45408010000000004 0.3050593833333333 0.45408010000000004 0.2797722866666667 C 0.45408010000000004 0.25606563 0.45701521 0.23393942 0.48659208666666665 0.23393942 C 0.51616896 0.23393942 0.5240711766666667 0.2517758566666667 0.5240711766666667 0.2797722866666667 C 0.5240711766666667 0.3088976033333333 0.51616896 0.32560515333333334 0.48659208666666665 0.32560515333333334 Z M 0.29739625333333336 0.04334391666666666 M 0.5841279533333333 0.18517144333333332 V 0.34186114333333334 H 0.6292834866666667 C 0.6742132533333334 0.34186114333333334 0.7049190200000001 0.32402471 0.7049190200000001 0.2635162933333333 C 0.7049190200000001 0.19826654999999999 0.6742132533333334 0.1851714433333333 0.6292834866666667 0.1851714433333333 Z M 0.6044479433333334 0.32402471000000005 V 0.20278210333333335 H 0.6288319333333333 C 0.6604408199999999 0.20278210333333335 0.6839216866666666 0.21361943000000003 0.6839216866666666 0.2635162933333334 C 0.6839216866666666 0.31070382666666674 0.6615696866666667 0.32402471000000005 0.6288319333333333 0.32402471000000005 Z M 0.7900370533333333 0.21768342999999998 C 0.78123172 0.21768342999999998 0.7712974866666666 0.21836076000000001 0.7622663866666667 0.21948964999999998 V 0.23664875333333335 C 0.77107172 0.23484252999999997 0.7810059533333333 0.23393942 0.7891339533333334 0.23393942 C 0.8137436866666667 0.23393942 0.8191623533333334 0.24409941666666665 0.8191623533333334 0.25877496333333333 V 0.26893495666666667 H 0.7819090533333334 C 0.75300952 0.26893495666666667 0.7335926199999999 0.27886917666666666 0.7335926199999999 0.30776871666666666 C 0.7335926199999999 0.33102381666666664 0.7464619533333333 0.34411892 0.7755872866666667 0.34411892 C 0.7941010533333333 0.34411892 0.8119374866666667 0.33644248000000004 0.8191623533333333 0.3233473766666667 L 0.8220974866666666 0.34186114333333334 H 0.8385792533333333 V 0.2553883 C 0.8385792533333333 0.23348786666666665 0.8286450200000001 0.21768342999999998 0.7900370533333333 0.21768342999999998 Z M 0.7773934866666666 0.32786293000000005 C 0.7602343866666667 0.32786293000000005 0.7536868533333334 0.32108960000000003 0.7536868533333334 0.30754294000000004 C 0.7536868533333334 0.2885776166666667 0.76316952 0.2845136166666667 0.7832637200000001 0.2845136166666667 H 0.8191623533333334 V 0.30460783 C 0.8128405866666667 0.31905760000000005 0.7979392533333334 0.32786293000000005 0.7773934866666666 0.32786293000000005 Z M 0.9069897533333334 0.34321581 C 0.9124084200000001 0.34321581 0.9162466533333335 0.3427642533333333 0.9198590866666666 0.34186114333333334 V 0.32583092999999996 C 0.9164724200000001 0.32673404 0.9133115200000002 0.3269598166666667 0.9106021866666667 0.3269598166666667 C 0.9026999866666667 0.3269598166666667 0.8993133200000001 0.32470203999999997 0.8993133200000001 0.31228427 V 0.17027012 H 0.8798964533333333 V 0.31725137999999997 C 0.8798964533333333 0.33553936999999995 0.8889275533333334 0.34321580999999995 0.9069897533333334 0.34321580999999995 Z M 0.9715620200000001 0.34321581 C 0.9769806533333334 0.34321581 0.9808188866666668 0.3427642533333333 0.98443132 0.34186114333333334 V 0.32583092999999996 C 0.9810446533333335 0.32673404 0.9778837866666668 0.3269598166666667 0.9751744533333333 0.3269598166666667 C 0.9672722200000001 0.3269598166666667 0.9638855533333334 0.32470203999999997 0.9638855533333334 0.31228427 V 0.17027012 H 0.9444686866666666 V 0.31725137999999997 C 0.9444686866666666 0.33553936999999995 0.9534997866666667 0.34321580999999995 0.9715620200000001 0.34321580999999995 Z M 0.29739625333333336 0.04334391666666666 M 0.20087005 0.5902171833333334 L 0.1977091533333333 0.5730580500000001 C 0.18867801999999997 0.57802515 0.17513132 0.5838954166666667 0.1575206133333333 0.5911203166666668 V 0.5143556833333334 H 0.20087004999999997 V 0.4827467166666667 H 0.1575206133333333 V 0.4005634166666667 L 0.1263632033333333 0.39920871666666674 V 0.4827467166666667 H 0.07940130999999999 V 0.5143556833333334 H 0.12636320333333334 V 0.6037638833333334 C 0.10514004 0.6118919166666668 0.08572310333333333 0.6186652499999999 0.06811239666666666 0.62408395 L 0.07578885666666665 0.6574991500000001 C 0.09249645333333331 0.6516288833333335 0.10965560666666664 0.6453071166666667 0.1263632033333333 0.6385337500000001 V 0.7432948833333335 C 0.1263632033333333 0.7581962833333334 0.12004140999999997 0.7636149500000001 0.10152758666666664 0.7654211833333334 L 0.08211064999999997 0.7676789500000002 L 0.09294800999999996 0.8001910500000001 L 0.11010716333333329 0.7979332500000001 C 0.1466832533333333 0.7934176833333335 0.15752061333333328 0.7875474500000001 0.15752061333333328 0.7541322500000002 V 0.6258901833333335 L 0.20357938999999997 0.6060216833333334 Z M 0.21757764666666665 0.60105455 C 0.21667453333333334 0.7058156833333333 0.21125585333333333 0.7306513166666667 0.17603443333333332 0.7929661166666667 L 0.20538561666666666 0.8069643833333334 C 0.21848075999999997 0.7848381166666667 0.22796344999999998 0.7631633833333334 0.2347368 0.7423917833333333 C 0.24151014999999998 0.7216201833333333 0.24557416 0.6976876833333334 0.24783194333333333 0.6705942833333334 H 0.3173716663333333 V 0.7934176833333334 H 0.3485290766666667 V 0.6705942833333335 H 0.4185203566666667 V 0.7383277833333335 C 0.4185203566666667 0.7590993833333335 0.4149079033333333 0.7604540500000001 0.39323318333333335 0.7631633833333334 L 0.37336469 0.7649696166666667 L 0.3846536066666667 0.7974816833333335 L 0.4036189866666667 0.7952239166666668 C 0.43929196333333337 0.7907083500000002 0.45058088 0.7830318833333334 0.45058088 0.7482620166666668 V 0.42404435000000007 H 0.21757764666666665 Z M 0.24963817 0.53241795 V 0.4565564166666667 H 0.3173716663333333 V 0.5324179500000001 Z M 0.34852907666666666 0.4565564166666667 H 0.4185203566666667 V 0.53241795 H 0.3485290766666667 Z M 0.24918661333333333 0.63853375 C 0.24963817 0.6331150833333334 0.24963817 0.6249870500000001 0.24963817 0.61369815 V 0.5640269166666667 H 0.3173716663333333 V 0.63853375 Z M 0.4185203566666667 0.5640269166666667 V 0.63853375 H 0.3485290766666667 V 0.5640269166666667 Z M 0.6610059533333333 0.5107432166666667 V 0.7184592833333333 H 0.8745922533333332 V 0.5107432166666667 H 0.7720888866666666 C 0.7761528866666666 0.49900274999999994 0.7797653533333333 0.4868107166666666 0.7829262533333332 0.4737155833333333 H 0.9116198866666666 V 0.4448159499999999 H 0.8262756866666666 C 0.8384677199999999 0.4299145833333333 0.8493050533333332 0.41501321666666663 0.8587877533333332 0.40011184999999994 L 0.8294365866666666 0.38430734999999994 C 0.8253725533333333 0.39198381666666665 0.81859922 0.4019180833333333 0.8100196533333334 0.41365854999999996 C 0.8014400533333333 0.4253990166666666 0.7937635866666666 0.4357848166666666 0.78608712 0.4448159499999999 H 0.7305456533333333 L 0.74047992 0.43804261666666666 C 0.7373190199999999 0.43126924999999994 0.7319003533333334 0.4222381166666666 0.7251269866666666 0.4114007499999999 C 0.7183536533333332 0.40011184999999994 0.7129349533333332 0.3919838166666666 0.7084193866666666 0.38611358333333323 L 0.6826806533333333 0.4014665166666666 C 0.6899055533333333 0.41049764999999994 0.7011944866666665 0.42901148333333333 0.7088709533333333 0.4448159499999999 H 0.6307516533333333 V 0.4737155833333333 H 0.7481563866666666 C 0.7440923533333332 0.4886169499999999 0.7404799199999998 0.5012605499999999 0.7368674533333333 0.5107432166666667 Z M 0.6199142900000001 0.48861695 C 0.6140440533333333 0.47732801666666663 0.6045613633333333 0.46242665 0.59146622 0.44436438333333333 C 0.5788226333333334 0.42585058333333337 0.5679852733333334 0.4118523166666667 0.5594056966666667 0.40236961666666665 L 0.5318607433333333 0.42178655 C 0.5413434300000001 0.43262391666666666 0.5517292333333335 0.44707375 0.5639212633333334 0.46558755 C 0.5761132933333333 0.48410138333333336 0.5851444266666667 0.4994543166666666 0.5910146633333333 0.51254945 Z M 0.6939695866666667 0.53648195 H 0.84162862 V 0.5712518166666667 H 0.6939695866666667 Z M 0.8027947200000001 0.7586478166666666 C 0.77073422 0.7586478166666666 0.7418345866666667 0.7581962833333333 0.7169989533333333 0.7568415833333333 C 0.6573934866666666 0.75322915 0.63617032 0.74781045 0.6045613633333333 0.7008485833333333 V 0.5473193166666667 H 0.5205718266666667 V 0.58118605 H 0.5729523966666666 V 0.7017516833333334 L 0.5169593733333333 0.7609056166666668 L 0.5354731966666667 0.7911599166666667 C 0.5571479133333334 0.7708398500000001 0.57521018 0.7518744833333335 0.5896599933333334 0.7347153166666668 C 0.6262360833333334 0.7803225500000001 0.6483623533333335 0.7857412166666669 0.7120318533333334 0.7884505500000001 C 0.7368674533333334 0.78980525 0.7657670866666667 0.7902567833333334 0.7978276200000001 0.7902567833333334 C 0.8253725533333334 0.7902567833333334 0.8651095533333334 0.7893536833333334 0.9170385533333335 0.78754745 L 0.9224572533333333 0.7559384833333334 C 0.87052822 0.7577447166666667 0.8307912533333335 0.7586478166666667 0.8027947200000001 0.7586478166666667 Z M 0.84162862 0.6317604166666667 H 0.6939695866666667 V 0.59699055 H 0.84162862 Z M 0.84162862 0.6570475833333334 V 0.69272055 H 0.6939695866666667 V 0.6570475833333334 Z
78
- `}));function gi(e,t){let n=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);n.setAttribute(`fill`,`currentColor`),n.classList.add(`icon`);let r=_(()=>{let t=hi.get();return Object.hasOwn(t,e)&&t[e]||null});if(t instanceof AbortSignal&&t.aborted)return n;let i=t instanceof AbortSignal?t:R;function a(e){if(Array.isArray(e)&&e.length<=2){let[t,r]=e;n.setAttribute(`viewBox`,r||`0 0 1 1`);let i=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);n.appendChild(i),i.setAttribute(`d`,t);return}if(n.setAttribute(`viewBox`,`0 0 1 1`),e){if(typeof e==`string`){let t=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);n.appendChild(t),t.setAttribute(`d`,e);return}typeof e==`function`&&e({root:n},i)}}return t?h(()=>r.get(),a,{signal:i,immediate:!0}):a(r.get()),n}async function _i({types:e,excludeAcceptAllOption:t}={}){if(`showOpenFilePicker`in window&&typeof showOpenFilePicker==`function`){let[n]=await showOpenFilePicker({types:e,excludeAcceptAllOption:!!(t&&Array.isArray(e)&&e.length)});return n?n.getFile():null}let n=document.createElement(`input`);n.type=`file`;let r=Array.isArray(e)&&e.map(e=>Object.entries(e.accept)).flat(3)||``;return r&&(n.accept=r.join(`,`)),new Promise((e,t)=>{n.addEventListener(`click`,()=>{e(n.files?.[0]||null)}),n.addEventListener(`error`,e=>{t(e.error)}),n.click()})}function vi(e,t){let n=e.path;n[0]===`/`&&(n=n.slice(1));let r=`+file://${e.domain}/${n}`;return t?`${r}#${t}`:r}function yi(e){if(!e||typeof e!=`string`)return null;let t=e.indexOf(`#`),n=decodeURIComponent((t>=0?e.slice(t+1):``)||e.replace(/[#?].*/,``).split(`/`).filter(Boolean).pop()||``);if(/^\+file:\/\//.test(e)){let{pathname:t,hostname:r}=new URL(e.slice(1)),i=t.split(`/`).filter(Boolean).join(`/`);return i?{name:n,href:`${Ke.file}/${r||`_`}/files/${i}`}:null}return{name:n,href:e}}function bi(e){if(!Bt(e))throw Error(`无效的 plugin: ${e}`);return{importStyle(t){return Kt(t,e,!0)},import(t){return B(t,e)},request:j.clone().prefix(`${qe.api}/plugins/${e}`),user:L.plugin(e)}}function xi(e){let t;return()=>t||=Promise.resolve().then(()=>e())}async function Si(){let e=Object.entries(N).map(([e,{hooks:t}])=>typeof t==`string`?t?`/#?`.includes(t[0])?[e,B(`${e}${t}`)]:[e,B(`${e}/${t}`)]:[e,B(`${e}`)]:[``,``]),t=Object.entries(N).flatMap(([e,{styles:t}])=>[t].flat().map(t=>{if(!(!t||typeof t!=`string`))return Kt(t,e,!0)})),n=await Promise.all(e.filter(([e])=>e).map(e=>Promise.all(e))).then(e=>e.filter(([,e])=>e&&typeof e==`object`));await Promise.all(t),Fe(Object.fromEntries(n))}async function Ci(e){let t=[];for(let[n,r]of e||[])t.push(Kt(n,r,!0));for(let[e,n]of k.get(`styles`))typeof n==`string`&&t.push(Kt(n,e,!0));await Promise.all(t)}let wi=()=>({}),Ti=()=>({}),$=()=>{},Ei=!1;async function Di(){if(Ei)return;Ei=!0,$();let e=!1;$=()=>{e=!0,Ei=!1};let{classNames:t,elements:n,rootClassName:r,setup:i,pageManager:a}=await Ti();if(e)return;let o=[];for(let e of[t,k.get(`className`).values()].flat())e&&typeof e==`string`&&document.body.classList.add(e);r&&typeof r==`string`&&q.classList.add(r);for(let e of[n,k.get(`elements`).values()].flat())e instanceof Element&&document.body.appendChild(e);a&&o.push(Jn(a));for(let e of k.get(`pageManager`).values())e&&o.push(Jn(e));Qr();let s=new AbortController;$=()=>{$=()=>{},s.abort(),Ei=!1,$r();for(let e of o)e();for(let e of[n,k.get(`elements`).values()].flat())e instanceof Element&&e.remove();r&&typeof r==`string`&&q.classList.remove(r);for(let e of[t,k.get(`className`).values()].flat())e&&typeof e==`string`&&document.body.classList.remove(e)},i?.(s.signal)}async function Oi(){$();let e=!1;$=()=>{e=!0};let t=await wi();if(e)return;let{classNames:n,elements:r,rootClassName:i}=t;for(let e of[n].flat())e&&typeof e==`string`&&document.body.classList.add(e);i&&typeof i==`string`&&q.classList.add(i);for(let e of[r].flat())e instanceof Element&&document.body.appendChild(e);let a=new AbortController;$=()=>{$=()=>{},a.abort();for(let e of[r].flat())e instanceof Element&&e.remove();i&&typeof i==`string`&&q.classList.remove(i);for(let e of[n].flat())e&&typeof e==`string`&&document.body.classList.remove(e)},await t.login?.(a.signal),!a.signal.aborted&&await L.load()}let ki=!1;async function Ai(e,t,n){ki||(ki=!0,wi=xi(async()=>{let t=await e(),{styleFiles:n}=t;return await Ci(n),t}),Ti=xi(async()=>{let[e,r]=await Promise.all([t(),n()]);r&&Ar(r);let{home:i,components:a,styleFiles:o,createPage:s,renderError:c}=e;return await Ci(o),_r(i),Tn(a),Hr(s),Pr(c),e}),await Si(),await L.load(),h(()=>L.waitLogin,e=>{e?Oi():Di()},{immediate:!0}))}function ji(e,t,n){if(!e)return!0;let r=typeof e==`string`?e.split(`
78
+ `}));function gi(e,t){let n=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);n.setAttribute(`fill`,`currentColor`),n.classList.add(`icon`);let r=_(()=>{let t=hi.get();return Object.hasOwn(t,e)&&t[e]||null});if(t instanceof AbortSignal&&t.aborted)return n;let i=t instanceof AbortSignal?t:R;function a(e){if(Array.isArray(e)&&e.length<=2){let[t,r]=e;n.setAttribute(`viewBox`,r||`0 0 1 1`);let i=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);n.appendChild(i),i.setAttribute(`d`,t);return}if(n.setAttribute(`viewBox`,`0 0 1 1`),e){if(typeof e==`string`){let t=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);n.appendChild(t),t.setAttribute(`d`,e);return}typeof e==`function`&&e({root:n},i)}}return t?h(()=>r.get(),a,{signal:i,immediate:!0}):a(r.get()),n}async function _i({types:e,excludeAcceptAllOption:t}={}){if(`showOpenFilePicker`in window&&typeof showOpenFilePicker==`function`){let[n]=await showOpenFilePicker({types:e,excludeAcceptAllOption:!!(t&&Array.isArray(e)&&e.length)});return n?n.getFile():null}let n=document.createElement(`input`);n.type=`file`;let r=Array.isArray(e)&&e.map(e=>Object.entries(e.accept)).flat(3)||``;return r&&(n.accept=r.join(`,`)),new Promise((e,t)=>{n.addEventListener(`change`,()=>{e(n.files?.[0]||null)}),n.addEventListener(`error`,e=>{t(e.error)}),n.click()})}function vi(e,t){let n=e.path;n[0]===`/`&&(n=n.slice(1));let r=`+file://${e.domain}/${n}`;return t?`${r}#${t}`:r}function yi(e){if(!e||typeof e!=`string`)return null;let t=e.indexOf(`#`),n=decodeURIComponent((t>=0?e.slice(t+1):``)||e.replace(/[#?].*/,``).split(`/`).filter(Boolean).pop()||``);if(/^\+file:\/\//.test(e)){let{pathname:t,hostname:r}=new URL(e.slice(1)),i=t.split(`/`).filter(Boolean).join(`/`);return i?{name:n,href:`${Ke.file}/${r||`_`}/files/${i}`}:null}return{name:n,href:e}}function bi(e){if(!Bt(e))throw Error(`无效的 plugin: ${e}`);return{importStyle(t){return Kt(t,e,!0)},import(t){return B(t,e)},request:j.clone().prefix(`${qe.api}/plugins/${e}`),user:L.plugin(e)}}function xi(e){let t;return()=>t||=Promise.resolve().then(()=>e())}async function Si(){let e=Object.entries(N).map(([e,{hooks:t}])=>typeof t==`string`?t?`/#?`.includes(t[0])?[e,B(`${e}${t}`)]:[e,B(`${e}/${t}`)]:[e,B(`${e}`)]:[``,``]),t=Object.entries(N).flatMap(([e,{styles:t}])=>[t].flat().map(t=>{if(!(!t||typeof t!=`string`))return Kt(t,e,!0)})),n=await Promise.all(e.filter(([e])=>e).map(e=>Promise.all(e))).then(e=>e.filter(([,e])=>e&&typeof e==`object`));await Promise.all(t),Fe(Object.fromEntries(n))}async function Ci(e){let t=[];for(let[n,r]of e||[])t.push(Kt(n,r,!0));for(let[e,n]of k.get(`styles`))typeof n==`string`&&t.push(Kt(n,e,!0));await Promise.all(t)}let wi=()=>({}),Ti=()=>({}),$=()=>{},Ei=!1;async function Di(){if(Ei)return;Ei=!0,$();let e=!1;$=()=>{e=!0,Ei=!1};let{classNames:t,elements:n,rootClassName:r,setup:i,pageManager:a}=await Ti();if(e)return;let o=[];for(let e of[t,k.get(`className`).values()].flat())e&&typeof e==`string`&&document.body.classList.add(e);r&&typeof r==`string`&&q.classList.add(r);for(let e of[n,k.get(`elements`).values()].flat())e instanceof Element&&document.body.appendChild(e);a&&o.push(Jn(a));for(let e of k.get(`pageManager`).values())e&&o.push(Jn(e));Qr();let s=new AbortController;$=()=>{$=()=>{},s.abort(),Ei=!1,$r();for(let e of o)e();for(let e of[n,k.get(`elements`).values()].flat())e instanceof Element&&e.remove();r&&typeof r==`string`&&q.classList.remove(r);for(let e of[t,k.get(`className`).values()].flat())e&&typeof e==`string`&&document.body.classList.remove(e)},i?.(s.signal)}async function Oi(){$();let e=!1;$=()=>{e=!0};let t=await wi();if(e)return;let{classNames:n,elements:r,rootClassName:i}=t;for(let e of[n].flat())e&&typeof e==`string`&&document.body.classList.add(e);i&&typeof i==`string`&&q.classList.add(i);for(let e of[r].flat())e instanceof Element&&document.body.appendChild(e);let a=new AbortController;$=()=>{$=()=>{},a.abort();for(let e of[r].flat())e instanceof Element&&e.remove();i&&typeof i==`string`&&q.classList.remove(i);for(let e of[n].flat())e&&typeof e==`string`&&document.body.classList.remove(e)},await t.login?.(a.signal),!a.signal.aborted&&await L.load()}let ki=!1;async function Ai(e,t,n){ki||(ki=!0,wi=xi(async()=>{let t=await e(),{styleFiles:n}=t;return await Ci(n),t}),Ti=xi(async()=>{let[e,r]=await Promise.all([t(),n()]);r&&Ar(r);let{home:i,components:a,styleFiles:o,createPage:s,renderError:c}=e;return await Ci(o),_r(i),Tn(a),Hr(s),Pr(c),e}),await Si(),await L.load(),h(()=>L.waitLogin,e=>{e?Oi():Di()},{immediate:!0}))}function ji(e,t,n){if(!e)return!0;let r=typeof e==`string`?e.split(`
79
79
  `):e;if(!Array.isArray(r))return!0;let i=r.filter(e=>e&&typeof e==`string`);if(!i.length)return!0;for(let e of i)if(e[0]===`#`){if(n?.has(e.slice(1)))return!0}else if(t.has(e))return!0;return!1}function Mi(e,t){if(!e||!t||typeof t!=`object`)return!0;for(let[n,r]of Object.entries(e)){if(!r)continue;let{value:e,values:i,user:a}=r,o=t[n];if(e!==void 0){if(o!==e)return!1}else if(Array.isArray(i)&&i.length){if(!i.includes(o))return!1}else if(i instanceof Set&&i.size){if(!i.has(o))return!1}else if(a&&!P&&o!==L.current?.id)return!1}return!0}function Ni({permission:e,organizationField:t,constraints:n},r,i,a){if(!Mi(n,i))return!1;if(!e)return!0;if(!t)return!!r.has(e);if(t===`_`){if(a){let t=L.allOrganizationPermissions;if(!t||t.has(e))return!0}return!1}if(a)return!0;let o=String(i?.[t]||``);if(!a||o){let t=L.organizationPermissions;if(!t)return!0;let n=Object.hasOwn(t,o)?t[o]:null;if(n&&n.has(e))return!0}return!0}function Pi(e,t,n,r){let i=e.filter(({authorizations:e})=>{if(e instanceof Set||Array.isArray(e))return!0}).filter(e=>Ni(e,t,n,r)).flatMap(({authorizations:e})=>e?[...e]:[]);return new Set(i)}export{n as ArrayStore,pi as Command,u as DotRequest,Z as GeneralContext,De as Hook,Cr as Ident,bn as List,K as Menu,i as ObjectStore,Br as Page,Fr as PageFooter,Ir as PageHeader,Lr as PageSection,Rr as PageSider,xn as Pagination,V as ResponseError,Se as Search,e as Signal,o as Store,L as User,Jn as addManager,k as allHooks,bi as buildPlugin,tt as configuration,_ as createComputed,Rt as createFilters,gi as createIcon,Ft as createQuickFilters,Mt as createShowField,g as createState,jt as createStore,wt as createStoreField,m as effect,sn as enumerationsService,Ht as execScript,ji as filterPermission,Me as findPluginIdRegex,ln as formLayoutsService,Pi as getAuthorizations,Ve as getField,A as getFieldFilter,We as getFieldFilterOperators,Qn as getPages,ke as getPatternFields,ci as getPrimaryFields,He as hasField,Ge as hasFieldFilter,Kt as importStyle,B as importWidget,Ne as isFunction,Bt as isPluginId,yn as loadMenu,si as loadOptions,an as modelService,R as neverAbortedSignal,Ke as pathRoots,gn as permissionsService,je as pluginIdRegex,N as plugins,At as renderForm,Tt as renderGridForm,c as renderStore,j as request,q as root,O as runPattern,_i as selectFile,Kn as setIcon,zt as showFilterDialog,P as single,Ai as start,Ni as testPermission,Mi as testPermissionConstraints,yi as toFileLink,vi as toFileURL,li as toId,St as toSchema,z as toUrl,Fe as updateHooks,et as userMenus,Vt as waitAbortSignal,h as watch,F as webRoot,Ae as yieldPermissionConstraintFields};
80
80
  //# sourceMappingURL=index.mjs.map