@malloy-publisher/app 0.0.202 → 0.0.204
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/dist/api-doc.yaml +25 -3
- package/dist/assets/{EnvironmentPage-CNQYDaxR.js → EnvironmentPage-CX06cjOF.js} +1 -1
- package/dist/assets/HomePage-CNFt_eUU.js +1 -0
- package/dist/assets/{MainPage-B0kNpkxT.js → MainPage-nUJ9YatG.js} +1 -1
- package/dist/assets/{PackagePage-yAh0TrOV.js → MaterializationsPage-B5goxVXW.js} +1 -1
- package/dist/assets/{ModelPage-DcVElc9L.js → ModelPage-Ba7Xh4lL.js} +1 -1
- package/dist/assets/PackagePage-BaEVdEAG.js +1 -0
- package/dist/assets/{RouteError-DknUbx_s.js → RouteError-BShQjZio.js} +1 -1
- package/dist/assets/{WorkbookPage-CCqc8otA.js → WorkbookPage-CBn6ZjJW.js} +1 -1
- package/dist/assets/{core-B3A61KGJ.es-iOUZ6RJL.js → core-DECXYL4E.es-OaRfXwuQ.js} +1 -1
- package/dist/assets/{index-W0bOLKGl.js → index-BLfPC1gy.js} +2 -2
- package/dist/assets/index-DqiJ0bWp.js +455 -0
- package/dist/assets/index-Dy3YhAZQ.js +1812 -0
- package/dist/assets/index.umd-DAN9K8yC.js +2469 -0
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/HomePage-DBFTIoD8.js +0 -1
- package/dist/assets/index-F_o127LC.js +0 -454
- package/dist/assets/index-QeX_e740.js +0 -1803
- package/dist/assets/index.umd-CEDRw4TK.js +0 -1145
package/dist/api-doc.yaml
CHANGED
|
@@ -2480,11 +2480,16 @@ components:
|
|
|
2480
2480
|
description: Whether the server is fully initialized and ready to serve requests
|
|
2481
2481
|
operationalState:
|
|
2482
2482
|
type: string
|
|
2483
|
-
enum: [ "initializing", "serving", "draining" ]
|
|
2483
|
+
enum: [ "initializing", "serving", "draining", "throttled" ]
|
|
2484
2484
|
description: Status of the server; initializing when the server is loading
|
|
2485
2485
|
environments, packages and connections, serving when the server is
|
|
2486
|
-
initialized and ready to serve requests,
|
|
2487
|
-
server is going to shut down
|
|
2486
|
+
initialized and ready to serve requests, draining when the
|
|
2487
|
+
server is going to shut down, and throttled when the server has hit
|
|
2488
|
+
its memory back-pressure limit and is rejecting new package loads and
|
|
2489
|
+
queries to stay under PUBLISHER_MAX_MEMORY_BYTES (see the memory
|
|
2490
|
+
governor). Already-loaded packages remain serviceable while throttled;
|
|
2491
|
+
the control plane treats a throttled worker as unhealthy for new load.
|
|
2492
|
+
Only reported when the memory governor is enabled.
|
|
2488
2493
|
frozenConfig:
|
|
2489
2494
|
type: boolean
|
|
2490
2495
|
description: Whether the server configuration is frozen (read-only mode). When
|
|
@@ -2741,6 +2746,13 @@ components:
|
|
|
2741
2746
|
description: Annotations attached to the given declaration
|
|
2742
2747
|
items:
|
|
2743
2748
|
type: string
|
|
2749
|
+
default:
|
|
2750
|
+
type: string
|
|
2751
|
+
description: The given's default value as a Malloy source literal
|
|
2752
|
+
(e.g. `'WN'`, `2003`, `@2024-01-01`, `f'WN'`), exactly as written in
|
|
2753
|
+
the model. Omitted when the given declares no default. Consumers
|
|
2754
|
+
render or prefill it per the given's `type` (e.g. unquote a string
|
|
2755
|
+
literal for a text input).
|
|
2744
2756
|
|
|
2745
2757
|
Givens:
|
|
2746
2758
|
type: object
|
|
@@ -2780,6 +2792,16 @@ components:
|
|
|
2780
2792
|
without a second lookup.
|
|
2781
2793
|
items:
|
|
2782
2794
|
$ref: "#/components/schemas/Given"
|
|
2795
|
+
authorize:
|
|
2796
|
+
type: array
|
|
2797
|
+
description: Effective authorize expressions declared on this source via
|
|
2798
|
+
`#(authorize)` / `##(authorize)` annotations — file-level expressions
|
|
2799
|
+
first, then the source's own. Each is a Malloy boolean expression over
|
|
2800
|
+
declared givens. Surfaced for introspection only; these expressions
|
|
2801
|
+
are NOT yet enforced by the query path (enforcement lands in a later
|
|
2802
|
+
release), so their presence does not currently restrict access.
|
|
2803
|
+
items:
|
|
2804
|
+
type: string
|
|
2783
2805
|
|
|
2784
2806
|
QueryRequest:
|
|
2785
2807
|
type: object
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{N as r,F as t,j as e,_ as i,a3 as o}from"./index-DqiJ0bWp.js";function m(){const s=r(),{environmentName:n}=t();if(n){const a=i({environmentName:n});return e.jsx(o,{onSelectPackage:s,resourceUri:a})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N as n,j as t,e as o}from"./index-DqiJ0bWp.js";function s(){const e=n();return t.jsx(o,{onClickEnvironment:e})}export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as we,g as ke,r as u,R as Se,a as Pe,c as $,j as t,s as I,B as Ee,m as _,
|
|
1
|
+
import{u as we,g as ke,r as u,R as Se,a as Pe,c as $,j as t,s as I,B as Ee,m as _,b as ne,d as se,f as ae,h as ie,i as Ce,k as O,l as le,T as K,n as G,o as Ie,p as Me,q as Re,t as ce,v as ze,w as oe,x as De,y as Te,z as Be,A,C as L,M as $e,P as He,D as Le,E as Ne,S as Ae,F as de,N as J,G as x,H as We,I as X,J as Z,K as Oe,L as q,X as Ve,O as Ue,Q as pe,U as ue,V as he,W as Qe,Y as Fe,Z as Xe}from"./index-DqiJ0bWp.js";function Ye(e,r,n,o,s){const[a,i]=u.useState(()=>s&&n?n(e).matches:o?o(e).matches:r);return Pe(()=>{if(!n)return;const c=n(e),h=()=>{i(c.matches)};return h(),c.addEventListener("change",h),()=>{c.removeEventListener("change",h)}},[e,n]),a}const _e={...Se},fe=_e.useSyncExternalStore;function Ke(e,r,n,o,s){const a=u.useCallback(()=>r,[r]),i=u.useMemo(()=>{if(s&&n)return()=>n(e).matches;if(o!==null){const{matches:p}=o(e);return()=>p}return a},[a,e,o,s,n]),[c,h]=u.useMemo(()=>{if(n===null)return[a,()=>()=>{}];const p=n(e);return[()=>p.matches,m=>(p.addEventListener("change",m),()=>{p.removeEventListener("change",m)})]},[a,n,e]);return fe(h,c,i)}function me(e={}){const{themeId:r}=e;return function(o,s={}){let a=we();a&&r&&(a=a[r]||a);const i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:c=!1,matchMedia:h=i?window.matchMedia:null,ssrMatchMedia:f=null,noSsr:p=!1}=ke({name:"MuiUseMediaQuery",props:s,theme:a});let m=typeof o=="function"?o(a):o;return m=m.replace(/^@media( ?)/m,""),m.includes("print")&&console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.","Using the print media query to modify print styles can lead to unexpected results.","Consider using the `displayPrint` field in the `sx` prop instead.","More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(`
|
|
2
2
|
`)),(fe!==void 0?Ke:Ye)(m,c,h,f,p)}}me();const Ge=$(t.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),Je=I(Ee,{name:"MuiBreadcrumbCollapsed"})(_(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:ne(e.palette.grey[200],.12)}:{backgroundColor:ne(e.palette.grey[600],.12)}}}))),Ze=I(Ge)({width:24,height:16});function qe(e){const{slots:r={},slotProps:n={},...o}=e,s=e;return t.jsx("li",{children:t.jsx(Je,{focusRipple:!0,...o,ownerState:s,children:t.jsx(Ze,{as:r.CollapsedIcon,ownerState:s,...n.collapsedIcon})})})}function et(e){return ae("MuiBreadcrumbs",e)}const tt=se("MuiBreadcrumbs",["root","ol","li","separator"]),rt=e=>{const{classes:r}=e;return le({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},et,r)},nt=I(K,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${tt.li}`]:r.li},r.root]})({}),ot=I("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),st=I("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function at(e,r,n,o){return e.reduce((s,a,i)=>(i<e.length-1?s=s.concat(a,t.jsx(st,{"aria-hidden":!0,className:r,ownerState:o,children:n},`separator-${i}`)):s.push(a),s),[])}const it=u.forwardRef(function(r,n){const o=ie({props:r,name:"MuiBreadcrumbs"}),{children:s,className:a,component:i="nav",slots:c={},slotProps:h={},expandText:f="Show path",itemsAfterCollapse:p=1,itemsBeforeCollapse:m=1,maxItems:y=8,separator:S="/",...H}=o,[M,P]=u.useState(!1),v={...o,component:i,expanded:M,expandText:f,itemsAfterCollapse:p,itemsBeforeCollapse:m,maxItems:y,separator:S},E=rt(v),R=Ce({elementType:c.CollapsedIcon,externalSlotProps:h.collapsedIcon,ownerState:v}),j=u.useRef(null),w=d=>{const k=()=>{P(!0);const b=j.current.querySelector("a[href],button,[tabindex]");b&&b.focus()};return m+p>=d.length?d:[...d.slice(0,m),t.jsx(qe,{"aria-label":f,slots:{CollapsedIcon:c.CollapsedIcon},slotProps:{collapsedIcon:R},onClick:k},"ellipsis"),...d.slice(d.length-p,d.length)]},z=u.Children.toArray(s).filter(d=>u.isValidElement(d)).map((d,k)=>t.jsx("li",{className:E.li,children:d},`child-${k}`));return t.jsx(nt,{ref:n,component:i,color:"textSecondary",className:O(E.root,a),ownerState:v,...H,children:t.jsx(ot,{className:E.ol,ref:j,ownerState:v,children:at(M||y&&z.length<=y?z:w(z),E.separator,S,v)})})});function lt(e,r,n){const o=r.getBoundingClientRect(),s=n&&n.getBoundingClientRect(),a=ce(r);let i;if(r.fakeTransform)i=r.fakeTransform;else{const f=a.getComputedStyle(r);i=f.getPropertyValue("-webkit-transform")||f.getPropertyValue("transform")}let c=0,h=0;if(i&&i!=="none"&&typeof i=="string"){const f=i.split("(")[1].split(")")[0].split(",");c=parseInt(f[4],10),h=parseInt(f[5],10)}return e==="left"?s?`translateX(${s.right+c-o.left}px)`:`translateX(${a.innerWidth+c-o.left}px)`:e==="right"?s?`translateX(-${o.right-s.left-c}px)`:`translateX(-${o.left+o.width-c}px)`:e==="up"?s?`translateY(${s.bottom+h-o.top}px)`:`translateY(${a.innerHeight+h-o.top}px)`:s?`translateY(-${o.top-s.top+o.height-h}px)`:`translateY(-${o.top+o.height-h}px)`}function ct(e){return typeof e=="function"?e():e}function W(e,r,n){const o=ct(n),s=lt(e,r,o);s&&(r.style.webkitTransform=s,r.style.transform=s)}const dt=u.forwardRef(function(r,n){const o=G(),s={enter:o.transitions.easing.easeOut,exit:o.transitions.easing.sharp},a={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{addEndListener:i,appear:c=!0,children:h,container:f,direction:p="down",easing:m=s,in:y,onEnter:S,onEntered:H,onEntering:M,onExit:P,onExited:v,onExiting:E,style:R,timeout:j=a,TransitionComponent:w=Ie,...z}=r,d=u.useRef(null),k=Me(Re(h),d,n),b=l=>g=>{l&&(g===void 0?l(d.current):l(d.current,g))},V=b((l,g)=>{W(p,l,f),De(l),S&&S(l,g)}),ee=b((l,g)=>{const B=oe({timeout:j,style:R,easing:m},{mode:"enter"});l.style.webkitTransition=o.transitions.create("-webkit-transform",{...B}),l.style.transition=o.transitions.create("transform",{...B}),l.style.webkitTransform="none",l.style.transform="none",M&&M(l,g)}),D=b(H),T=b(E),C=b(l=>{const g=oe({timeout:j,style:R,easing:m},{mode:"exit"});l.style.webkitTransition=o.transitions.create("-webkit-transform",g),l.style.transition=o.transitions.create("transform",g),W(p,l,f),P&&P(l)}),U=b(l=>{l.style.webkitTransition="",l.style.transition="",v&&v(l)}),Q=l=>{i&&i(d.current,l)},N=u.useCallback(()=>{d.current&&W(p,d.current,f)},[p,f]);return u.useEffect(()=>{if(y||p==="down"||p==="right")return;const l=ze(()=>{d.current&&W(p,d.current,f)}),g=ce(d.current);return g.addEventListener("resize",l),()=>{l.clear(),g.removeEventListener("resize",l)}},[p,y,f]),u.useEffect(()=>{y||N()},[y,N]),t.jsx(w,{nodeRef:d,onEnter:V,onEntered:D,onEntering:ee,onExit:C,onExited:U,onExiting:T,addEndListener:Q,appear:c,in:y,timeout:j,...z,children:(l,{ownerState:g,...B})=>u.cloneElement(h,{ref:k,style:{visibility:l==="exited"&&!y?"hidden":void 0,...R,...h.props.style},...B})})});function pt(e){return ae("MuiDrawer",e)}se("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const xe=(e,r)=>{const{ownerState:n}=e;return[r.root,(n.variant==="permanent"||n.variant==="persistent")&&r.docked,r.modal]},ut=e=>{const{classes:r,anchor:n,variant:o}=e,s={root:["root",`anchor${L(n)}`],docked:[(o==="permanent"||o==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${L(n)}`,o!=="temporary"&&`paperAnchorDocked${L(n)}`]};return le(s,pt,r)},ht=I($e,{name:"MuiDrawer",slot:"Root",overridesResolver:xe})(_(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),ft=I("div",{shouldForwardProp:Le,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:xe})({flex:"0 0 auto"}),mt=I(He,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,r)=>{const{ownerState:n}=e;return[r.paper,r[`paperAnchor${L(n.anchor)}`],n.variant!=="temporary"&&r[`paperAnchorDocked${L(n.anchor)}`]]}})(_(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:r})=>r.anchor==="left"&&r.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="top"&&r.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="right"&&r.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="bottom"&&r.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),ge={left:"right",right:"left",top:"down",bottom:"up"};function xt(e){return["left","right"].includes(e)}function gt({direction:e},r){return e==="rtl"&&xt(r)?ge[r]:r}const yt=u.forwardRef(function(r,n){const o=ie({props:r,name:"MuiDrawer"}),s=G(),a=Te(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:c="left",BackdropProps:h,children:f,className:p,elevation:m=16,hideBackdrop:y=!1,ModalProps:{BackdropProps:S,...H}={},onClose:M,open:P=!1,PaperProps:v={},SlideProps:E,TransitionComponent:R,transitionDuration:j=i,variant:w="temporary",slots:z={},slotProps:d={},...k}=o,b=u.useRef(!1);u.useEffect(()=>{b.current=!0},[]);const V=gt({direction:a?"rtl":"ltr"},c),D={...o,anchor:c,elevation:m,open:P,variant:w,...k},T=ut(D),C={slots:{transition:R,...z},slotProps:{paper:v,transition:E,...d,backdrop:Be(d.backdrop||{...h,...S},{transitionDuration:j})}},[U,Q]=A("root",{ref:n,elementType:ht,className:O(T.root,T.modal,p),shouldForwardComponentProp:!0,ownerState:D,externalForwardedProps:{...C,...k,...H},additionalProps:{open:P,onClose:M,hideBackdrop:y,slots:{backdrop:C.slots.backdrop},slotProps:{backdrop:C.slotProps.backdrop}}}),[N,l]=A("paper",{elementType:mt,shouldForwardComponentProp:!0,className:O(T.paper,v.className),ownerState:D,externalForwardedProps:C,additionalProps:{elevation:w==="temporary"?m:0,square:!0,...w==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[g,B]=A("docked",{elementType:ft,ref:n,className:O(T.root,T.docked,p),ownerState:D,externalForwardedProps:C,additionalProps:k}),[ve,je]=A("transition",{elementType:dt,ownerState:D,externalForwardedProps:C,additionalProps:{in:P,direction:ge[V],timeout:j,appear:b.current}}),te=t.jsx(N,{...l,children:f});if(w==="permanent")return t.jsx(g,{...B,children:te});const re=t.jsx(ve,{...je,children:te});return w==="persistent"?t.jsx(g,{...B,children:re}):t.jsx(U,{...Q,children:re})}),bt=me({themeId:Ne}),vt=$([t.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),t.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),jt=$(t.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),wt=$(t.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),kt=$(t.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),St=$(t.jsx("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"})),Pt=$(t.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}));function Y(e){return t.jsxs(Ae,{...e,viewBox:"0 0 24 24",sx:{fill:"none",...e.sx},children:[t.jsx("rect",{x:"3.25",y:"4.75",width:"17.5",height:"14.5",rx:"2.25",stroke:"currentColor",strokeWidth:"1.5"}),t.jsx("line",{x1:"8.5",y1:"5",x2:"8.5",y2:"19",stroke:"currentColor",strokeWidth:"1.5"})]})}function F({label:e,onClick:r}){return t.jsx(We,{clickable:!0,onClick:r,label:e,size:"small","aria-label":`Navigate to ${e}`,sx:{backgroundColor:"background.paper",color:"text.primary",fontWeight:500,fontSize:"0.875rem",height:32,cursor:"pointer",borderRadius:"4px",maxWidth:320,"& .MuiChip-label":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"&:hover":{backgroundColor:"grey.100"}}})}function Et(){const e=de(),r=e["*"],n=J();return!e.environmentName&&!e.packageName&&!r?null:t.jsx(x,{sx:{display:"flex",alignItems:"center",minWidth:0},children:t.jsxs(it,{"aria-label":"breadcrumb",separator:t.jsx(jt,{sx:{fontSize:14,color:"text.secondary"}}),children:[e.environmentName&&t.jsx(F,{label:e.environmentName,onClick:o=>n(`/${e.environmentName}/`,o)}),e.packageName&&t.jsx(F,{label:e.packageName,onClick:o=>n(`/${e.environmentName}/${e.packageName}/`,o)}),r&&t.jsx(F,{label:r,onClick:o=>n(`/${e.environmentName}/${e.packageName}/${r}`,o)})]})})}const Ct=260,It=64;function ye({isCollapsed:e,onToggleCollapse:r,logoHeader:n}){return t.jsxs(x,{sx:{height:"100dvh",width:e?It:Ct,flexShrink:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",transition:"width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",overflow:"hidden"},children:[t.jsx(Mt,{isCollapsed:e,onToggleCollapse:r,logoHeader:n}),t.jsxs(x,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",py:1},children:[t.jsx(Rt,{isCollapsed:e}),t.jsx(zt,{isCollapsed:e})]}),t.jsx(Dt,{isCollapsed:e})]})}function Mt({isCollapsed:e,onToggleCollapse:r,logoHeader:n}){const o=J();return n?t.jsxs(x,{sx:{height:56,display:"flex",alignItems:"center",justifyContent:"space-between",px:e?0:2,flexShrink:0},children:[n,t.jsx(X,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(Y,{fontSize:"small"})})]}):t.jsxs(x,{sx:{minHeight:56,display:"flex",flexDirection:e?"column":"row",alignItems:"center",justifyContent:e?"center":"space-between",gap:e?.5:0,py:e?1:0,px:e?0:2,flexShrink:0},children:[t.jsxs(x,{onClick:s=>o("/",s),sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",minWidth:0},children:[t.jsx(x,{component:"img",src:"/logo.svg",alt:"Malloy",sx:{width:24,height:24,flexShrink:0}}),!e&&t.jsx(K,{variant:"subtitle1",sx:{color:"text.primary",fontWeight:500,letterSpacing:"-0.025em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:"Malloy Publisher"})]}),t.jsx(Z,{title:e?"Expand sidebar":"Collapse sidebar",placement:"right",children:t.jsx(X,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(Y,{fontSize:"small"})})})]})}function Rt({isCollapsed:e}){const n=Oe().pathname==="/";return t.jsx(q,{sx:{py:0},children:t.jsx(be,{icon:t.jsx(St,{fontSize:"small"}),label:"Home",to:"/",selected:n,isCollapsed:e})})}function zt({isCollapsed:e}){const{apiClients:r}=Ve(),n=de(),{data:o}=Ue({queryKey:["environments"],queryFn:()=>r.environments.listEnvironments()}),s=o?.data??[];return s.length===0?null:t.jsxs(x,{sx:{mt:1},children:[!e&&t.jsx(K,{variant:"caption",sx:{display:"block",px:3,py:1,color:"text.secondary",fontWeight:500,textTransform:"uppercase",fontSize:"0.6875rem",letterSpacing:"0.5px"},children:"Environments"}),t.jsx(q,{sx:{py:0},children:s.map(a=>{const i=a.name??"";return t.jsx(be,{icon:t.jsx(kt,{fontSize:"small"}),label:i,to:`/${i}`,selected:n.environmentName===i,isCollapsed:e},i)})})]})}function Dt({isCollapsed:e}){const r=[{label:"Malloy Docs",href:"https://docs.malloydata.dev/documentation/",icon:t.jsx(vt,{fontSize:"small"}),external:!0},{label:"Publisher Docs",href:"https://github.com/malloydata/publisher/blob/main/README.md",icon:t.jsx(Pt,{fontSize:"small"}),external:!0},{label:"Publisher API",href:"/api-doc.html",icon:t.jsx(wt,{fontSize:"small"}),external:!1}];return t.jsx(q,{sx:{py:1},children:r.map(n=>t.jsx(Tt,{label:n.label,href:n.href,icon:n.icon,external:n.external,isCollapsed:e},n.label))})}function be({icon:e,label:r,to:n,selected:o,isCollapsed:s}){const a=J(),i=t.jsxs(pe,{selected:o,onClick:c=>a(n,c),sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ue,{sx:{minWidth:s?0:36,justifyContent:"center",color:o?"text.primary":"text.secondary"},children:e}),!s&&t.jsx(he,{primary:r,primaryTypographyProps:{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(Z,{title:r,placement:"right",children:t.jsx(x,{children:i})}):i}function Tt({label:e,href:r,icon:n,external:o,isCollapsed:s}){const a=t.jsxs(pe,{component:"a",href:r,target:o?"_blank":void 0,rel:o?"noopener noreferrer":void 0,sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ue,{sx:{minWidth:s?0:36,justifyContent:"center",color:"text.secondary"},children:n}),!s&&t.jsx(he,{primary:e,primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(Z,{title:e,placement:"right",children:t.jsx(x,{children:a})}):a}function Bt({open:e,onClose:r,logoHeader:n}){return t.jsx(yt,{anchor:"left",open:e,onClose:r,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:260}},children:t.jsx(ye,{isCollapsed:!1,onToggleCollapse:r,logoHeader:n})})}function Ht({headerProps:e}){const r=G(),n=bt(r.breakpoints.up("md")),[o,s]=u.useState(!1),[a,i]=u.useState(!1);return u.useEffect(()=>{n&&o&&s(!1)},[n,o]),t.jsxs(x,{sx:{height:"100dvh",display:"flex",flexDirection:"row",bgcolor:"background.default"},children:[n&&t.jsx(ye,{isCollapsed:a,onToggleCollapse:()=>i(c=>!c),logoHeader:e?.logoHeader}),t.jsxs(x,{component:"main",sx:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs(x,{sx:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",height:Qe.headerHeight,px:{xs:1,md:3},backgroundColor:"background.default"},children:[t.jsx(x,{sx:{display:{xs:"flex",md:"none"},alignItems:"center",mr:1},children:t.jsx(X,{size:"small",onClick:()=>s(!0),"aria-label":"Open navigation",children:t.jsx(Y,{fontSize:"small"})})}),t.jsx(x,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center"},children:t.jsx(Et,{})}),t.jsx(x,{id:"header-actions-portal",sx:{display:"flex",alignItems:"center",flexShrink:0,gap:1},children:e?.endCap})]}),t.jsx(x,{sx:{flex:1,overflow:"auto",minWidth:320,minHeight:0},children:t.jsx(u.Suspense,{fallback:t.jsx(Xe,{}),children:t.jsx(Fe,{})})})]}),t.jsx(Bt,{open:o,onClose:()=>s(!1),logoHeader:e?.logoHeader})]})}export{Ht as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{F as r,N as t,j as e,_ as c,a2 as o}from"./index-DqiJ0bWp.js";function m(){const{environmentName:a,packageName:n}=r(),s=t();if(a)if(n){const i=c({environmentName:a,packageName:n});return e.jsx(o,{onClickPackageFile:s,resourceUri:i})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing package name"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{F as t,j as e,_ as m,G as r,$ as x,a0 as o}from"./index-DqiJ0bWp.js";function d(){const n=t(),a=n["*"];if(!n.environmentName)return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})});if(!n.packageName)return e.jsx("div",{children:e.jsx("h2",{children:"Missing package name"})});const i=m({environmentName:n.environmentName,packageName:n.packageName,modelPath:a}),s={p:3,maxWidth:1200,mx:"auto"};return a?.endsWith(".malloy")?e.jsx(r,{sx:s,children:e.jsx(x,{resourceUri:i,runOnDemand:!0,maxResultSize:512*1024})}):a?.endsWith(".malloynb")?e.jsx(r,{sx:s,children:e.jsx(o,{resourceUri:i,maxResultSize:1024*1024})}):e.jsx(r,{sx:s,children:e.jsxs("h2",{children:["Unrecognized file type: ",a]})})}export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as r,N as t,j as e,_ as c,a1 as o}from"./index-DqiJ0bWp.js";function l(){const{environmentName:a,packageName:n}=r(),s=t();if(a)if(n){const i=c({environmentName:a,packageName:n});return e.jsx(o,{onClickPackageFile:s,resourceUri:i})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing package name"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a4 as o,j as r,a5 as s,a6 as n,G as t,T as a}from"./index-DqiJ0bWp.js";function x(){const e=o();return console.error(e),r.jsx(s,{maxWidth:"lg",component:"main",sx:{display:"flex",flexDirection:"column",my:2,gap:0},children:r.jsxs(n,{sx:{m:"auto",flexDirection:"column"},children:[r.jsx(t,{sx:{height:"300px"}}),r.jsx("img",{src:"/error.png"}),r.jsx(a,{variant:"subtitle1",children:"An unexpected error occurred"})]})})}export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{F as o,j as e,_ as t,a7 as c}from"./index-DqiJ0bWp.js";function d(){const{workspace:r,workbookPath:s,environmentName:i,packageName:n}=o();if(r)if(s)if(i)if(n){const a=t({environmentName:i,packageName:n});return e.jsx(c,{workbookPath:{path:s,workspace:r},resourceUri:a},`${s}`)}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing package name"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing workbook path"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing workspace"})})}export{d as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createOnigurumaEngine as At,getDefaultWasmLoader as Gr,loadWasm as Mr}from"./engine-oniguruma-C4vnmooL.es-jdkXmgTr.js";import{a7 as Cn,a8 as Br,a9 as Or,aa as Fr,ab as jr,ac as Dr,ad as Wr,ae as Dt,af as xt}from"./index-F_o127LC.js";let V=class extends Error{constructor(t){super(t),this.name="ShikiError"}},Ee=!1,wn=!1;function Zi(t=!0,e=!1){Ee=t,wn=e}function F(t,e=3){if(Ee&&!(typeof Ee=="number"&&e>Ee)){if(wn)throw new Error(`[SHIKI DEPRECATE]: ${t}`);console.trace(`[SHIKI DEPRECATE]: ${t}`)}}function Ur(t){return vt(t)}function vt(t){return Array.isArray(t)?qr(t):t instanceof RegExp?t:typeof t=="object"?Hr(t):t}function qr(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=vt(t[n]);return e}function Hr(t){let e={};for(let n in t)e[n]=vt(t[n]);return e}function Sn(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}function An(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?An(t.substring(0,t.length-1)):t.substr(~e+1)}var Ke=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,we=class{static hasCaptures(t){return t===null?!1:(Ke.lastIndex=0,Ke.test(t))}static replaceCaptures(t,e,n){return t.replace(Ke,(r,s,a,o)=>{let i=n[parseInt(s||a,10)];if(i){let c=e.substring(i.start,i.end);for(;c[0]===".";)c=c.substring(1);switch(o){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return r})}};function xn(t,e){return t<e?-1:t>e?1:0}function vn(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let s=0;s<n;s++){let a=xn(t[s],e[s]);if(a!==0)return a}return 0}return n-r}function Wt(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function En(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Nn=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},Re=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(Qr(t),e)}static createFromParsedTheme(t,e){return Zr(t,e)}_cachedMatchRoot=new Nn(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,n=this._cachedMatchRoot.get(e).find(r=>zr(t.parent,r.parentScopes));return n?new In(n.fontStyle,n.foreground,n.background):null}},Ye=class Ne{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const r of n)e=new Ne(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new Ne(n,e[r]);return n}push(e){return new Ne(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function zr(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],s=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],s=!0}for(;t&&!Vr(t.scopeName,r);){if(s)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Vr(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var In=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Qr(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let s=0,a=e.length;s<a;s++){let o=e[s];if(!o.settings)continue;let i;if(typeof o.scope=="string"){let h=o.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),i=h.split(",")}else Array.isArray(o.scope)?i=o.scope:i=[""];let c=-1;if(typeof o.settings.fontStyle=="string"){c=0;let h=o.settings.fontStyle.split(" ");for(let d=0,p=h.length;d<p;d++)switch(h[d]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof o.settings.foreground=="string"&&Wt(o.settings.foreground)&&(l=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&Wt(o.settings.background)&&(u=o.settings.background);for(let h=0,d=i.length;h<d;h++){let p=i[h].trim().split(" "),g=p[p.length-1],k=null;p.length>1&&(k=p.slice(0,p.length-1),k.reverse()),n[r++]=new Xr(g,k,s,c,l,u)}}return n}var Xr=class{constructor(t,e,n,r,s,a){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=s,this.background=a}},z=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(z||{});function Zr(t,e){t.sort((c,l)=>{let u=xn(c.scope,l.scope);return u!==0||(u=vn(c.parentScopes,l.parentScopes),u!==0)?u:c.index-l.index});let n=0,r="#000000",s="#ffffff";for(;t.length>=1&&t[0].scope==="";){let c=t.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(r=c.foreground),c.background!==null&&(s=c.background)}let a=new Kr(e),o=new In(n,a.getId(r),a.getId(s)),i=new Jr(new ut(0,null,-1,0,0),[]);for(let c=0,l=t.length;c<l;c++){let u=t[c];i.insert(0,u.scope,u.parentScopes,u.fontStyle,a.getId(u.foreground),a.getId(u.background))}return new Re(a,o,i)}var Kr=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Yr=Object.freeze([]),ut=class $n{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,r,s,a){this.scopeDepth=e,this.parentScopes=n||Yr,this.fontStyle=r,this.foreground=s,this.background=a}clone(){return new $n(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,s=e.length;r<s;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,s){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},Jr=class ht{constructor(e,n=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,s=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[s]===">"&&s++,!(r>=e.parentScopes.length||s>=n.parentScopes.length);){const a=n.parentScopes[s].length-e.parentScopes[r].length;if(a!==0)return a;r++,s++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,a;if(r===-1?(s=e,a=""):(s=e.substring(0,r),a=e.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(a)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(ht._cmpBySpecificity),n}insert(e,n,r,s,a,o){if(n===""){this._doInsertHere(e,r,s,a,o);return}let i=n.indexOf("."),c,l;i===-1?(c=n,l=""):(c=n.substring(0,i),l=n.substring(i+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new ht(this._mainRule.clone(),ut.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(e+1,l,r,s,a,o)}_doInsertHere(e,n,r,s,a){if(n===null){this._mainRule.acceptOverwrite(e,r,s,a);return}for(let o=0,i=this._rulesWithParentScopes.length;o<i;o++){let c=this._rulesWithParentScopes[o];if(vn(c.parentScopes,n)===0){c.acceptOverwrite(e,r,s,a);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),a===0&&(a=this._mainRule.background),this._rulesWithParentScopes.push(new ut(e,n,r,s,a))}},ie=class M{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=M.getLanguageId(e),r=M.getTokenType(e),s=M.getFontStyle(e),a=M.getForeground(e),o=M.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:s,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,s,a,o,i){let c=M.getLanguageId(e),l=M.getTokenType(e),u=M.containsBalancedBrackets(e)?1:0,h=M.getFontStyle(e),d=M.getForeground(e),p=M.getBackground(e);return n!==0&&(c=n),r!==8&&(l=r),s!==null&&(u=s?1:0),a!==-1&&(h=a),o!==0&&(d=o),i!==0&&(p=i),(c<<0|l<<8|u<<10|h<<11|d<<15|p<<24)>>>0}};function Pe(t,e){const n=[],r=es(t);let s=r.next();for(;s!==null;){let c=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let l=o();if(n.push({matcher:l,priority:c}),s!==",")break;s=r.next()}return n;function a(){if(s==="-"){s=r.next();const c=a();return l=>!!c&&!c(l)}if(s==="("){s=r.next();const c=i();return s===")"&&(s=r.next()),c}if(Ut(s)){const c=[];do c.push(s),s=r.next();while(Ut(s));return l=>e(c,l)}return null}function o(){const c=[];let l=a();for(;l;)c.push(l),l=a();return u=>c.every(h=>h(u))}function i(){const c=[];let l=o();for(;l&&(c.push(l),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");l=o()}return u=>c.some(h=>h(u))}}function Ut(t){return!!t&&!!t.match(/[\w\.:]+/)}function es(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const r=n[0];return n=e.exec(t),r}}}function Rn(t){typeof t.dispose=="function"&&t.dispose()}var de=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},ts=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},ns=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},rs=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new de(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new ns;for(const n of t)ss(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof de){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function ss(t,e,n,r){const s=n.lookup(t.scopeName);if(!s){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const a=n.lookup(e);t instanceof de?Ie({baseGrammar:a,selfGrammar:s},r):pt(t.ruleName,{baseGrammar:a,selfGrammar:s,repository:s.repository},r);const o=n.injections(t.scopeName);if(o)for(const i of o)r.add(new de(i))}function pt(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];Te([r],e,n)}}function Ie(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Te(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Te(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Te(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const s=r.repository?Sn({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&Te(r.patterns,{...e,repository:s},n);const a=r.include;if(!a)continue;const o=Pn(a);switch(o.kind){case 0:Ie({...e,selfGrammar:e.baseGrammar},n);break;case 1:Ie(e,n);break;case 2:pt(o.ruleName,{...e,repository:s},n);break;case 3:case 4:const i=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(i){const c={baseGrammar:e.baseGrammar,selfGrammar:i,repository:s};o.kind===4?pt(o.ruleName,c,n):Ie(c,n)}else o.kind===4?n.add(new ts(o.scopeName,o.ruleName)):n.add(new de(o.scopeName));break}}}var as=class{kind=0},os=class{kind=1},is=class{constructor(t){this.ruleName=t}kind=2},cs=class{constructor(t){this.scopeName=t}kind=3},ls=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function Pn(t){if(t==="$base")return new as;if(t==="$self")return new os;const e=t.indexOf("#");if(e===-1)return new cs(t);if(e===0)return new is(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new ls(n,r)}}var us=/\\(\d+)/,qt=/\\(\d+)/g,hs=-1,Tn=-2,ke=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,r){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=we.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=we.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${An(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:we.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:we.replaceCaptures(this._contentName,t,e)}},ps=class extends ke{retokenizeCapturedWithRuleId;constructor(t,e,n,r,s){super(t,e,n,r),this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,r){throw new Error("Not supported!")}},ds=class extends ke{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,null),this._match=new ge(r,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new fe,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ht=class extends ke{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,r),this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new fe,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},dt=class extends ke{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s,a,o,i,c,l){super(t,e,n,r),this._begin=new ge(s,this.id),this.beginCaptures=a,this._end=new ge(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=i,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,r)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new fe;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Le=class extends ke{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,r,s,a,o,i,c){super(t,e,n,r),this._begin=new ge(s,this.id),this.beginCaptures=a,this.whileCaptures=i,this._while=new ge(o,Tn),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new fe;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,r){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,r)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new fe,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||""),this._cachedCompiledWhilePatterns}},Ln=class R{static createCaptureRule(e,n,r,s,a){return e.registerRule(o=>new ps(n,o,r,s,a))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(s=>{if(e.id=s,e.match)return new ds(e.$vscodeTextmateLocation,e.id,e.name,e.match,R._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=Sn({},r,e.repository));let a=e.patterns;return typeof a>"u"&&e.include&&(a=[{include:e.include}]),new Ht(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,R._compilePatterns(a,n,r))}return e.while?new Le(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,R._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,R._compileCaptures(e.whileCaptures||e.captures,n,r),R._compilePatterns(e.patterns,n,r)):new dt(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,R._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,R._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,R._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let s=[];if(e){let a=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const i=parseInt(o,10);i>a&&(a=i)}for(let o=0;o<=a;o++)s[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const i=parseInt(o,10);let c=0;e[o].patterns&&(c=R.getCompiledRuleId(e[o],n,r)),s[i]=R.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,c)}}return s}static _compilePatterns(e,n,r){let s=[];if(e)for(let a=0,o=e.length;a<o;a++){const i=e[a];let c=-1;if(i.include){const l=Pn(i.include);switch(l.kind){case 0:case 1:c=R.getCompiledRuleId(r[i.include],n,r);break;case 2:let u=r[l.ruleName];u&&(c=R.getCompiledRuleId(u,n,r));break;case 3:case 4:const h=l.scopeName,d=l.kind===4?l.ruleName:null,p=n.getExternalGrammar(h,r);if(p)if(d){let g=p.repository[d];g&&(c=R.getCompiledRuleId(g,n,p.repository))}else c=R.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else c=R.getCompiledRuleId(i,n,r);if(c!==-1){const l=n.getRule(c);let u=!1;if((l instanceof Ht||l instanceof dt||l instanceof Le)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;s.push(c)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},ge=class Gn{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const r=e.length;let s=0,a=[],o=!1;for(let i=0;i<r;i++)if(e.charAt(i)==="\\"&&i+1<r){const c=e.charAt(i+1);c==="z"?(a.push(e.substring(s,i)),a.push("$(?!\\n)(?<!\\n)"),s=i+2):(c==="A"||c==="G")&&(o=!0),i++}this.hasAnchor=o,s===0?this.source=e:(a.push(e.substring(s,r)),this.source=a.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=us.test(this.source):this.hasBackReferences=!1}clone(){return new Gn(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(s=>e.substring(s.start,s.end));return qt.lastIndex=0,this.source.replace(qt,(s,a)=>En(r[parseInt(a,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],r=[],s=[],a,o,i,c;for(a=0,o=this.source.length;a<o;a++)i=this.source.charAt(a),e[a]=i,n[a]=i,r[a]=i,s[a]=i,i==="\\"&&a+1<o&&(c=this.source.charAt(a+1),c==="A"?(e[a+1]="",n[a+1]="",r[a+1]="A",s[a+1]="A"):c==="G"?(e[a+1]="",n[a+1]="G",r[a+1]="",s[a+1]="G"):(e[a+1]=c,n[a+1]=c,r[a+1]=c,s[a+1]=c),a++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},fe=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new zt(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(s=>s.resolveAnchors(e,n));return new zt(t,r,this._items.map(s=>s.ruleId))}},zt=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
1
|
+
import{createOnigurumaEngine as At,getDefaultWasmLoader as Gr,loadWasm as Mr}from"./engine-oniguruma-C4vnmooL.es-jdkXmgTr.js";import{a8 as Cn,a9 as Br,aa as Or,ab as Fr,ac as jr,ad as Dr,ae as Wr,af as Dt,ag as xt}from"./index-DqiJ0bWp.js";let V=class extends Error{constructor(t){super(t),this.name="ShikiError"}},Ee=!1,wn=!1;function Zi(t=!0,e=!1){Ee=t,wn=e}function F(t,e=3){if(Ee&&!(typeof Ee=="number"&&e>Ee)){if(wn)throw new Error(`[SHIKI DEPRECATE]: ${t}`);console.trace(`[SHIKI DEPRECATE]: ${t}`)}}function Ur(t){return vt(t)}function vt(t){return Array.isArray(t)?qr(t):t instanceof RegExp?t:typeof t=="object"?Hr(t):t}function qr(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=vt(t[n]);return e}function Hr(t){let e={};for(let n in t)e[n]=vt(t[n]);return e}function Sn(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}function An(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?An(t.substring(0,t.length-1)):t.substr(~e+1)}var Ke=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,we=class{static hasCaptures(t){return t===null?!1:(Ke.lastIndex=0,Ke.test(t))}static replaceCaptures(t,e,n){return t.replace(Ke,(r,s,a,o)=>{let i=n[parseInt(s||a,10)];if(i){let c=e.substring(i.start,i.end);for(;c[0]===".";)c=c.substring(1);switch(o){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return r})}};function xn(t,e){return t<e?-1:t>e?1:0}function vn(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let s=0;s<n;s++){let a=xn(t[s],e[s]);if(a!==0)return a}return 0}return n-r}function Wt(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function En(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Nn=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},Re=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(Qr(t),e)}static createFromParsedTheme(t,e){return Zr(t,e)}_cachedMatchRoot=new Nn(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,n=this._cachedMatchRoot.get(e).find(r=>zr(t.parent,r.parentScopes));return n?new In(n.fontStyle,n.foreground,n.background):null}},Ye=class Ne{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const r of n)e=new Ne(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new Ne(n,e[r]);return n}push(e){return new Ne(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function zr(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],s=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],s=!0}for(;t&&!Vr(t.scopeName,r);){if(s)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Vr(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var In=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Qr(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let s=0,a=e.length;s<a;s++){let o=e[s];if(!o.settings)continue;let i;if(typeof o.scope=="string"){let h=o.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),i=h.split(",")}else Array.isArray(o.scope)?i=o.scope:i=[""];let c=-1;if(typeof o.settings.fontStyle=="string"){c=0;let h=o.settings.fontStyle.split(" ");for(let d=0,p=h.length;d<p;d++)switch(h[d]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof o.settings.foreground=="string"&&Wt(o.settings.foreground)&&(l=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&Wt(o.settings.background)&&(u=o.settings.background);for(let h=0,d=i.length;h<d;h++){let p=i[h].trim().split(" "),g=p[p.length-1],k=null;p.length>1&&(k=p.slice(0,p.length-1),k.reverse()),n[r++]=new Xr(g,k,s,c,l,u)}}return n}var Xr=class{constructor(t,e,n,r,s,a){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=s,this.background=a}},z=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(z||{});function Zr(t,e){t.sort((c,l)=>{let u=xn(c.scope,l.scope);return u!==0||(u=vn(c.parentScopes,l.parentScopes),u!==0)?u:c.index-l.index});let n=0,r="#000000",s="#ffffff";for(;t.length>=1&&t[0].scope==="";){let c=t.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(r=c.foreground),c.background!==null&&(s=c.background)}let a=new Kr(e),o=new In(n,a.getId(r),a.getId(s)),i=new Jr(new ut(0,null,-1,0,0),[]);for(let c=0,l=t.length;c<l;c++){let u=t[c];i.insert(0,u.scope,u.parentScopes,u.fontStyle,a.getId(u.foreground),a.getId(u.background))}return new Re(a,o,i)}var Kr=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Yr=Object.freeze([]),ut=class $n{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,r,s,a){this.scopeDepth=e,this.parentScopes=n||Yr,this.fontStyle=r,this.foreground=s,this.background=a}clone(){return new $n(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,s=e.length;r<s;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,s){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},Jr=class ht{constructor(e,n=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,s=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[s]===">"&&s++,!(r>=e.parentScopes.length||s>=n.parentScopes.length);){const a=n.parentScopes[s].length-e.parentScopes[r].length;if(a!==0)return a;r++,s++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,a;if(r===-1?(s=e,a=""):(s=e.substring(0,r),a=e.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(a)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(ht._cmpBySpecificity),n}insert(e,n,r,s,a,o){if(n===""){this._doInsertHere(e,r,s,a,o);return}let i=n.indexOf("."),c,l;i===-1?(c=n,l=""):(c=n.substring(0,i),l=n.substring(i+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new ht(this._mainRule.clone(),ut.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(e+1,l,r,s,a,o)}_doInsertHere(e,n,r,s,a){if(n===null){this._mainRule.acceptOverwrite(e,r,s,a);return}for(let o=0,i=this._rulesWithParentScopes.length;o<i;o++){let c=this._rulesWithParentScopes[o];if(vn(c.parentScopes,n)===0){c.acceptOverwrite(e,r,s,a);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),a===0&&(a=this._mainRule.background),this._rulesWithParentScopes.push(new ut(e,n,r,s,a))}},ie=class M{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=M.getLanguageId(e),r=M.getTokenType(e),s=M.getFontStyle(e),a=M.getForeground(e),o=M.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:s,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,s,a,o,i){let c=M.getLanguageId(e),l=M.getTokenType(e),u=M.containsBalancedBrackets(e)?1:0,h=M.getFontStyle(e),d=M.getForeground(e),p=M.getBackground(e);return n!==0&&(c=n),r!==8&&(l=r),s!==null&&(u=s?1:0),a!==-1&&(h=a),o!==0&&(d=o),i!==0&&(p=i),(c<<0|l<<8|u<<10|h<<11|d<<15|p<<24)>>>0}};function Pe(t,e){const n=[],r=es(t);let s=r.next();for(;s!==null;){let c=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let l=o();if(n.push({matcher:l,priority:c}),s!==",")break;s=r.next()}return n;function a(){if(s==="-"){s=r.next();const c=a();return l=>!!c&&!c(l)}if(s==="("){s=r.next();const c=i();return s===")"&&(s=r.next()),c}if(Ut(s)){const c=[];do c.push(s),s=r.next();while(Ut(s));return l=>e(c,l)}return null}function o(){const c=[];let l=a();for(;l;)c.push(l),l=a();return u=>c.every(h=>h(u))}function i(){const c=[];let l=o();for(;l&&(c.push(l),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");l=o()}return u=>c.some(h=>h(u))}}function Ut(t){return!!t&&!!t.match(/[\w\.:]+/)}function es(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const r=n[0];return n=e.exec(t),r}}}function Rn(t){typeof t.dispose=="function"&&t.dispose()}var de=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},ts=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},ns=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},rs=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new de(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new ns;for(const n of t)ss(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof de){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function ss(t,e,n,r){const s=n.lookup(t.scopeName);if(!s){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const a=n.lookup(e);t instanceof de?Ie({baseGrammar:a,selfGrammar:s},r):pt(t.ruleName,{baseGrammar:a,selfGrammar:s,repository:s.repository},r);const o=n.injections(t.scopeName);if(o)for(const i of o)r.add(new de(i))}function pt(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];Te([r],e,n)}}function Ie(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Te(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Te(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Te(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const s=r.repository?Sn({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&Te(r.patterns,{...e,repository:s},n);const a=r.include;if(!a)continue;const o=Pn(a);switch(o.kind){case 0:Ie({...e,selfGrammar:e.baseGrammar},n);break;case 1:Ie(e,n);break;case 2:pt(o.ruleName,{...e,repository:s},n);break;case 3:case 4:const i=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(i){const c={baseGrammar:e.baseGrammar,selfGrammar:i,repository:s};o.kind===4?pt(o.ruleName,c,n):Ie(c,n)}else o.kind===4?n.add(new ts(o.scopeName,o.ruleName)):n.add(new de(o.scopeName));break}}}var as=class{kind=0},os=class{kind=1},is=class{constructor(t){this.ruleName=t}kind=2},cs=class{constructor(t){this.scopeName=t}kind=3},ls=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function Pn(t){if(t==="$base")return new as;if(t==="$self")return new os;const e=t.indexOf("#");if(e===-1)return new cs(t);if(e===0)return new is(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new ls(n,r)}}var us=/\\(\d+)/,qt=/\\(\d+)/g,hs=-1,Tn=-2,ke=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,r){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=we.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=we.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${An(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:we.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:we.replaceCaptures(this._contentName,t,e)}},ps=class extends ke{retokenizeCapturedWithRuleId;constructor(t,e,n,r,s){super(t,e,n,r),this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,r){throw new Error("Not supported!")}},ds=class extends ke{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,null),this._match=new ge(r,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new fe,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ht=class extends ke{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,r),this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new fe,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},dt=class extends ke{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s,a,o,i,c,l){super(t,e,n,r),this._begin=new ge(s,this.id),this.beginCaptures=a,this._end=new ge(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=i,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,r)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new fe;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Le=class extends ke{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,r,s,a,o,i,c){super(t,e,n,r),this._begin=new ge(s,this.id),this.beginCaptures=a,this.whileCaptures=i,this._while=new ge(o,Tn),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new fe;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,r){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,r)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new fe,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||""),this._cachedCompiledWhilePatterns}},Ln=class R{static createCaptureRule(e,n,r,s,a){return e.registerRule(o=>new ps(n,o,r,s,a))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(s=>{if(e.id=s,e.match)return new ds(e.$vscodeTextmateLocation,e.id,e.name,e.match,R._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=Sn({},r,e.repository));let a=e.patterns;return typeof a>"u"&&e.include&&(a=[{include:e.include}]),new Ht(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,R._compilePatterns(a,n,r))}return e.while?new Le(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,R._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,R._compileCaptures(e.whileCaptures||e.captures,n,r),R._compilePatterns(e.patterns,n,r)):new dt(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,R._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,R._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,R._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let s=[];if(e){let a=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const i=parseInt(o,10);i>a&&(a=i)}for(let o=0;o<=a;o++)s[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const i=parseInt(o,10);let c=0;e[o].patterns&&(c=R.getCompiledRuleId(e[o],n,r)),s[i]=R.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,c)}}return s}static _compilePatterns(e,n,r){let s=[];if(e)for(let a=0,o=e.length;a<o;a++){const i=e[a];let c=-1;if(i.include){const l=Pn(i.include);switch(l.kind){case 0:case 1:c=R.getCompiledRuleId(r[i.include],n,r);break;case 2:let u=r[l.ruleName];u&&(c=R.getCompiledRuleId(u,n,r));break;case 3:case 4:const h=l.scopeName,d=l.kind===4?l.ruleName:null,p=n.getExternalGrammar(h,r);if(p)if(d){let g=p.repository[d];g&&(c=R.getCompiledRuleId(g,n,p.repository))}else c=R.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else c=R.getCompiledRuleId(i,n,r);if(c!==-1){const l=n.getRule(c);let u=!1;if((l instanceof Ht||l instanceof dt||l instanceof Le)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;s.push(c)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},ge=class Gn{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const r=e.length;let s=0,a=[],o=!1;for(let i=0;i<r;i++)if(e.charAt(i)==="\\"&&i+1<r){const c=e.charAt(i+1);c==="z"?(a.push(e.substring(s,i)),a.push("$(?!\\n)(?<!\\n)"),s=i+2):(c==="A"||c==="G")&&(o=!0),i++}this.hasAnchor=o,s===0?this.source=e:(a.push(e.substring(s,r)),this.source=a.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=us.test(this.source):this.hasBackReferences=!1}clone(){return new Gn(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(s=>e.substring(s.start,s.end));return qt.lastIndex=0,this.source.replace(qt,(s,a)=>En(r[parseInt(a,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],r=[],s=[],a,o,i,c;for(a=0,o=this.source.length;a<o;a++)i=this.source.charAt(a),e[a]=i,n[a]=i,r[a]=i,s[a]=i,i==="\\"&&a+1<o&&(c=this.source.charAt(a+1),c==="A"?(e[a+1]="",n[a+1]="",r[a+1]="A",s[a+1]="A"):c==="G"?(e[a+1]="",n[a+1]="G",r[a+1]="",s[a+1]="G"):(e[a+1]=c,n[a+1]=c,r[a+1]=c,s[a+1]=c),a++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},fe=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new zt(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(s=>s.resolveAnchors(e,n));return new zt(t,r,this._items.map(s=>s.ruleId))}},zt=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
2
2
|
`)}findNextMatchSync(t,e,n){const r=this.scanner.findNextMatchSync(t,e,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Je=class{constructor(t,e){this.languageId=t,this.tokenType=e}},gs=class gt{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new Je(e,8),this._embeddedLanguagesMatcher=new fs(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?gt._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new Je(0,0);_getBasicScopeAttributes=new Nn(e=>{const n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new Je(n,r)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(gt.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},fs=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,r])=>En(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},Vt=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function Mn(t,e,n,r,s,a,o,i){const c=e.content.length;let l=!1,u=-1;if(o){const p=ms(t,e,n,r,s,a);s=p.stack,r=p.linePos,n=p.isFirstLine,u=p.anchorPosition}const h=Date.now();for(;!l;){if(i!==0&&Date.now()-h>i)return new Vt(s,!0);d()}return new Vt(s,!1);function d(){const p=bs(t,e,n,r,s,u);if(!p){a.produce(s,c),l=!0;return}const g=p.captureIndices,k=p.matchedRuleId,m=g&&g.length>0?g[0].end>r:!1;if(k===hs){const C=s.getRule(t);a.produce(s,g[0].start),s=s.withContentNameScopesList(s.nameScopesList),ue(t,e,n,s,a,C.endCaptures,g),a.produce(s,g[0].end);const b=s;if(s=s.parent,u=b.getAnchorPos(),!m&&b.getEnterPos()===r){s=b,a.produce(s,c),l=!0;return}}else{const C=t.getRule(k);a.produce(s,g[0].start);const b=s,w=C.getName(e.content,g),I=s.contentNameScopesList.pushAttributed(w,t);if(s=s.push(k,r,u,g[0].end===c,null,I,I),C instanceof dt){const v=C;ue(t,e,n,s,a,v.beginCaptures,g),a.produce(s,g[0].end),u=g[0].end;const j=v.getContentName(e.content,g),L=I.pushAttributed(j,t);if(s=s.withContentNameScopesList(L),v.endHasBackReferences&&(s=s.withEndRule(v.getEndWithResolvedBackReferences(e.content,g))),!m&&b.hasSameRuleAs(s)){s=s.pop(),a.produce(s,c),l=!0;return}}else if(C instanceof Le){const v=C;ue(t,e,n,s,a,v.beginCaptures,g),a.produce(s,g[0].end),u=g[0].end;const j=v.getContentName(e.content,g),L=I.pushAttributed(j,t);if(s=s.withContentNameScopesList(L),v.whileHasBackReferences&&(s=s.withEndRule(v.getWhileWithResolvedBackReferences(e.content,g))),!m&&b.hasSameRuleAs(s)){s=s.pop(),a.produce(s,c),l=!0;return}}else if(ue(t,e,n,s,a,C.captures,g),a.produce(s,g[0].end),s=s.pop(),!m){s=s.safePop(),a.produce(s,c),l=!0;return}}g[0].end>r&&(r=g[0].end,n=!1)}}function ms(t,e,n,r,s,a){let o=s.beginRuleCapturedEOL?0:-1;const i=[];for(let c=s;c;c=c.pop()){const l=c.getRule(t);l instanceof Le&&i.push({rule:l,stack:c})}for(let c=i.pop();c;c=i.pop()){const{ruleScanner:l,findOptions:u}=ks(c.rule,t,c.stack.endRule,n,r===o),h=l.findNextMatchSync(e,r,u);if(h){if(h.ruleId!==Tn){s=c.stack.pop();break}h.captureIndices&&h.captureIndices.length&&(a.produce(c.stack,h.captureIndices[0].start),ue(t,e,n,c.stack,a,c.rule.whileCaptures,h.captureIndices),a.produce(c.stack,h.captureIndices[0].end),o=h.captureIndices[0].end,h.captureIndices[0].end>r&&(r=h.captureIndices[0].end,n=!1))}else{s=c.stack.pop();break}}return{stack:s,linePos:r,anchorPosition:o,isFirstLine:n}}function bs(t,e,n,r,s,a){const o=ys(t,e,n,r,s,a),i=t.getInjections();if(i.length===0)return o;const c=_s(i,t,e,n,r,s,a);if(!c)return o;if(!o)return c;const l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function ys(t,e,n,r,s,a){const o=s.getRule(t),{ruleScanner:i,findOptions:c}=Bn(o,t,s.endRule,n,r===a),l=i.findNextMatchSync(e,r,c);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function _s(t,e,n,r,s,a,o){let i=Number.MAX_VALUE,c=null,l,u=0;const h=a.contentNameScopesList.getScopeNames();for(let d=0,p=t.length;d<p;d++){const g=t[d];if(!g.matcher(h))continue;const k=e.getRule(g.ruleId),{ruleScanner:m,findOptions:C}=Bn(k,e,null,r,s===o),b=m.findNextMatchSync(n,s,C);if(!b)continue;const w=b.captureIndices[0].start;if(!(w>=i)&&(i=w,c=b.captureIndices,l=b.ruleId,u=g.priority,i===s))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Bn(t,e,n,r,s){return{ruleScanner:t.compileAG(e,n,r,s),findOptions:0}}function ks(t,e,n,r,s){return{ruleScanner:t.compileWhileAG(e,n,r,s),findOptions:0}}function ue(t,e,n,r,s,a,o){if(a.length===0)return;const i=e.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let h=0;h<c;h++){const d=a[h];if(d===null)continue;const p=o[h];if(p.length===0)continue;if(p.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=p.start;)s.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?s.produceFromScopes(l[l.length-1].scopes,p.start):s.produce(r,p.start),d.retokenizeCapturedWithRuleId){const k=d.getName(i,o),m=r.contentNameScopesList.pushAttributed(k,t),C=d.getContentName(i,o),b=m.pushAttributed(C,t),w=r.push(d.retokenizeCapturedWithRuleId,p.start,-1,!1,null,m,b),I=t.createOnigString(i.substring(0,p.end));Mn(t,I,n&&p.start===0,p.start,w,s,!1,0),Rn(I);continue}const g=d.getName(i,o);if(g!==null){const k=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(g,t);l.push(new Cs(k,p.end))}}for(;l.length>0;)s.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Cs=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function ws(t,e,n,r,s,a,o,i){return new As(t,e,n,r,s,a,o,i)}function Qt(t,e,n,r,s){const a=Pe(e,Ge),o=Ln.getCompiledRuleId(n,r,s.repository);for(const i of a)t.push({debugSelector:e,matcher:i.matcher,ruleId:o,grammar:s,priority:i.priority})}function Ge(t,e){if(e.length<t.length)return!1;let n=0;return t.every(r=>{for(let s=n;s<e.length;s++)if(Ss(e[s],r))return n=s+1,!0;return!1})}function Ss(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var As=class{constructor(t,e,n,r,s,a,o,i){if(this._rootScopeName=t,this.balancedBracketSelectors=a,this._onigLib=i,this._basicScopeAttributesProvider=new gs(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Xt(e,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const c of Object.keys(s)){const l=Pe(c,Ge);for(const u of l)this._tokenTypeMatchers.push({matcher:u.matcher,type:s[c]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){const s=r.injections;if(s)for(let o in s)Qt(e,o,s[o],this,r);const a=this._grammarRepository.injections(n);a&&a.forEach(o=>{const i=this.getExternalGrammar(o);if(i){const c=i.injectionSelector;c&&Qt(e,c,i,this,i)}})}return e.sort((s,a)=>s.priority-a.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=Xt(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){const r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){this._rootId===-1&&(this._rootId=Ln.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!e||e===ft.NULL){s=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),h=ie.set(0,l.languageId,l.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),d=this.getRule(this._rootId).getName(null,null);let p;d?p=he.createRootAndLookUpScopeName(d,h,this):p=he.createRoot("unknown",h),e=new ft(null,this._rootId,-1,-1,!1,null,p,p)}else s=!1,e.reset();t=t+`
|
|
3
3
|
`;const a=this.createOnigString(t),o=a.content.length,i=new vs(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Mn(this,a,s,0,e,i,!0,r);return Rn(a),{lineLength:o,lineTokens:i,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Xt(t,e){return t=Ur(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var he=class D{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}static fromExtension(e,n){let r=e,s=e?.scopePath??null;for(const a of n)s=Ye.push(s,a.scopeNames),r=new D(r,s,a.encodedTokenAttributes);return r}static createRoot(e,n){return new D(null,new Ye(null,e),n)}static createRootAndLookUpScopeName(e,n,r){const s=r.getMetadataForScope(e),a=new Ye(null,e),o=r.themeProvider.themeMatch(a),i=D.mergeAttributes(n,s,o);return new D(null,a,i)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return D.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,r){let s=-1,a=0,o=0;return r!==null&&(s=r.fontStyle,a=r.foregroundId,o=r.backgroundId),ie.set(e,n.languageId,n.tokenType,null,s,a,o)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return D._pushAttributed(this,e,n);const r=e.split(/ /g);let s=this;for(const a of r)s=D._pushAttributed(s,a,n);return s}static _pushAttributed(e,n,r){const s=r.getMetadataForScope(n),a=e.scopePath.push(n),o=r.themeProvider.themeMatch(a),i=D.mergeAttributes(e.tokenAttributes,s,o);return new D(e,a,i)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===e?n.reverse():void 0}},ft=class Y{constructor(e,n,r,s,a,o,i,c){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=a,this.endRule=o,this.nameScopesList=i,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}_stackElementBrand=void 0;static NULL=new Y(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:Y._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?he.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){Y._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,s,a,o,i){return new Y(this,e,n,r,s,a,o,i)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new Y(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,n){const r=he.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new Y(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,he.fromExtension(r,n.contentNameScopesList))}},xs=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Pe(n,Ge).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>Pe(n,Ge).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},vs=class{constructor(t,e,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let r=t?.tokenAttributes??0,s=!1;if(this.balancedBracketSelectors?.matchesAlways&&(s=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const a=t?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(a)&&(r=ie.set(r,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(s=this.balancedBracketSelectors.match(a))}if(s&&(r=ie.set(r,0,8,s,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=e;return}const n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,s=this._binaryTokens.length;r<s;r++)n[r]=this._binaryTokens[r];return n}},Es=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,r,s){if(!this._grammars.has(t)){let a=this._rawGrammars.get(t);if(!a)return null;this._grammars.set(t,ws(t,a,e,n,r,s,this,this._onigLib))}return this._grammars.get(t)}},Ns=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new Es(Re.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,e){this._syncRegistry.setTheme(Re.createFromRawTheme(t,e))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,e,n){return this.loadGrammarWithConfiguration(t,e,{embeddedLanguages:n})}loadGrammarWithConfiguration(t,e,n){return this._loadGrammar(t,e,n.embeddedLanguages,n.tokenTypes,new xs(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,e,n,r,s){const a=new rs(this._syncRegistry,t);for(;a.Q.length>0;)a.Q.map(o=>this._loadSingleGrammar(o.scopeName)),a.processQueue();return this._grammarForScopeName(t,e,n,r,s)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const e=this._options.loadGrammar(t);if(e){const n=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(e,n)}}addGrammar(t,e=[],n=0,r=null){return this._syncRegistry.addGrammar(t,e),this._grammarForScopeName(t.scopeName,n,r)}_grammarForScopeName(t,e=0,n=null,r=null,s=null){return this._syncRegistry.grammarForScopeName(t,e,n,r,s)}},mt=ft.NULL;const Is=/["&'<>`]/g,$s=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Rs=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ps=/[|\\{}()[\]^$+*?.]/g,Zt=new WeakMap;function Ts(t,e){if(t=t.replace(e.subset?Ls(e.subset):Is,r),e.subset||e.escapeOnly)return t;return t.replace($s,n).replace(Rs,r);function n(s,a,o){return e.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,o.charCodeAt(a+2),e)}function r(s,a,o){return e.format(s.charCodeAt(0),o.charCodeAt(a+1),e)}}function Ls(t){let e=Zt.get(t);return e||(e=Gs(t),Zt.set(t,e)),e}function Gs(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Ps,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const Ms=/[\dA-Fa-f]/;function Bs(t,e,n){const r="&#x"+t.toString(16).toUpperCase();return n&&e&&!Ms.test(String.fromCharCode(e))?r:r+";"}const Os=/\d/;function Fs(t,e,n){const r="&#"+String(t);return n&&e&&!Os.test(String.fromCharCode(e))?r:r+";"}const js=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],et={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Ds=["cent","copy","divide","gt","lt","not","para","times"],On={}.hasOwnProperty,bt={};let Se;for(Se in et)On.call(et,Se)&&(bt[et[Se]]=Se);const Ws=/[^\dA-Za-z]/;function Us(t,e,n,r){const s=String.fromCharCode(t);if(On.call(bt,s)){const a=bt[s],o="&"+a;return n&&js.includes(a)&&!Ds.includes(a)&&(!r||e&&e!==61&&Ws.test(String.fromCharCode(e)))?o:o+";"}return""}function qs(t,e,n){let r=Bs(t,e,n.omitOptionalSemicolons),s;if((n.useNamedReferences||n.useShortestReferences)&&(s=Us(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!s)&&n.useShortestReferences){const a=Fs(t,e,n.omitOptionalSemicolons);a.length<r.length&&(r=a)}return s&&(!n.useShortestReferences||s.length<r.length)?s:r}function ae(t,e){return Ts(t,Object.assign({format:qs},e))}const Hs=/^>|^->|<!--|-->|--!>|<!-$/g,zs=[">"],Vs=["<",">"];function Qs(t,e,n,r){return r.settings.bogusComments?"<?"+ae(t.value,Object.assign({},r.settings.characterReferences,{subset:zs}))+">":"<!--"+t.value.replace(Hs,s)+"-->";function s(a){return ae(a,Object.assign({},r.settings.characterReferences,{subset:Vs}))}}function Xs(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}const N=jn(1),Fn=jn(-1),Zs=[];function jn(t){return e;function e(n,r,s){const a=n?n.children:Zs;let o=(r||0)+t,i=a[o];if(!s)for(;i&&xt(i);)o+=t,i=a[o];return i}}const Ks={}.hasOwnProperty;function Dn(t){return e;function e(n,r,s){return Ks.call(t,n.tagName)&&t[n.tagName](n,r,s)}}const Et=Dn({body:Js,caption:tt,colgroup:tt,dd:ra,dt:na,head:tt,html:Ys,li:ta,optgroup:sa,option:aa,p:ea,rp:Kt,rt:Kt,tbody:ia,td:Yt,tfoot:ca,th:Yt,thead:oa,tr:la});function tt(t,e,n){const r=N(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&xt(r.value.charAt(0)))}function Ys(t,e,n){const r=N(n,e);return!r||r.type!=="comment"}function Js(t,e,n){const r=N(n,e);return!r||r.type!=="comment"}function ea(t,e,n){const r=N(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function ta(t,e,n){const r=N(n,e);return!r||r.type==="element"&&r.tagName==="li"}function na(t,e,n){const r=N(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function ra(t,e,n){const r=N(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Kt(t,e,n){const r=N(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function sa(t,e,n){const r=N(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function aa(t,e,n){const r=N(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function oa(t,e,n){const r=N(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function ia(t,e,n){const r=N(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function ca(t,e,n){return!N(n,e)}function la(t,e,n){const r=N(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function Yt(t,e,n){const r=N(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const ua=Dn({body:da,colgroup:ga,head:pa,html:ha,tbody:fa});function ha(t){const e=N(t,-1);return!e||e.type!=="comment"}function pa(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function da(t){const e=N(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&xt(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function ga(t,e,n){const r=Fn(n,e),s=N(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&Et(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function fa(t,e,n){const r=Fn(n,e),s=N(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&Et(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const Ae={name:[[`
|
|
4
4
|
\f\r &/=>`.split(""),`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{am as Ni}from"./index-DqiJ0bWp.js";function Mi(u,M){for(var z=0;z<M.length;z++){const V=M[z];if(typeof V!="string"&&!Array.isArray(V)){for(const g in V)if(g!=="default"&&!(g in u)){const l=Object.getOwnPropertyDescriptor(V,g);l&&Object.defineProperty(u,g,l.get?l:{enumerable:!0,get:()=>V[g]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}var kr={},Rt={},Mr;function Jt(){if(Mr)return Rt;Mr=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.formatRef=u,Rt.isRef=M,Rt.isDataNode=z,Rt.isEnvRef=V;function u(g){let l="$";for(let c=0;c<g.linkUps;c++)l+="^";let f=!0;for(const c of g.linkTo)typeof c=="string"?((!f||g.linkUps>0)&&(l+="."),l+=c,f=!1):l+=`[${c}]`;return l}function M(g){return typeof g=="object"&&g!==null&&"linkTo"in g&&"linkUps"in g&&!Array.isArray(g)&&!(g instanceof Date)}function z(g){return typeof g=="object"&&g!==null&&!M(g)}function V(g){return typeof g=="object"&&g!==null&&"env"in g&&!Array.isArray(g)&&!(g instanceof Date)}return Rt}var $t={},jr;function vn(){if(jr)return $t;jr=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.MotValue=$t.Mot=void 0,$t.buildMot=d;const u=Jt();class M{text(...w){return this.get(...w)._text()}numeric(...w){return this.get(...w)._numeric()}boolean(...w){return this.get(...w)._boolean()}date(...w){return this.get(...w)._date()}valueType(...w){return this.get(...w)._valueType()}values(...w){return this.get(...w)._values()}texts(...w){const E=this.get(...w)._values();if(!E)return;const x=[];for(const G of E){const oe=G._text();if(oe===void 0)return;x.push(oe)}return x}numerics(...w){const E=this.get(...w)._values();if(!E)return;const x=[];for(const G of E){const oe=G._numeric();if(oe===void 0)return;x.push(oe)}return x}booleans(...w){const E=this.get(...w)._values();if(!E)return;const x=[];for(const G of E){const oe=G._boolean();if(oe===void 0)return;x.push(oe)}return x}dates(...w){const E=this.get(...w)._values();if(!E)return;const x=[];for(const G of E){const oe=G._date();if(oe===void 0)return;x.push(oe)}return x}has(...w){return this.get(...w).exists}}$t.Mot=M;class z extends M{constructor(w,E,x=!0){super(),this.isRef=!1,this._val=w,this._props=E,this.exists=x}_text(){return this._val?.type==="string"?this._val.value:void 0}_numeric(){return this._val?.type==="number"?this._val.value:void 0}_boolean(){return this._val?.type==="boolean"?this._val.value:void 0}_date(){return this._val?.type==="date"?this._val.value:void 0}_values(){return this._val?.type==="array"?this._val.value:void 0}_valueType(){return this._val?.type}get keys(){return this._props.keys()}get entries(){return this._props.entries()}get(...w){let E=this;for(const x of w){if(typeof x=="number"){const G=E.values();if(!G||!Number.isInteger(x)||x<0||x>=G.length)return f;E=G[x]}else E===this?E=this._props.get(x)??f:E=E.get(x);if(!E.exists)return f}return E}}$t.MotValue=z;class V extends M{constructor(w,E){super(),this.exists=!0,this.isRef=!0,this._target=E}_text(){return this._target.text()}_numeric(){return this._target.numeric()}_boolean(){return this._target.boolean()}_date(){return this._target.date()}_values(){return this._target.values()}_valueType(){return this._target.valueType()}get keys(){return this._target.keys}get entries(){return this._target.entries}get(...w){return this._target.get(...w)}}const g={[Symbol.iterator]:()=>({next:()=>({done:!0,value:void 0})})};class l extends M{constructor(){super(...arguments),this.exists=!1,this.isRef=!1}_text(){}_numeric(){}_boolean(){}_date(){}_values(){}_valueType(){}get keys(){return g}get entries(){return g}get(...w){return this}}const f=new l,c={createMot(e,w){return new z(e,w)},createRefMot(e,w){return new V(e,w)},undefinedMot:f};function s(e,w,E,x){let G,oe;if(e.linkUps===0)G=w,oe=[];else{const N=E.length-e.linkUps;if(N<0||N>=E.length)return;G=E[N],oe=E.slice(0,N)}let C=G,R=oe,P=G;for(let N=0;N<e.linkTo.length;N++){if((0,u.isRef)(C)){if(x.has(C))return;x.add(C);const Ee=s(C,w,R,x);if(x.delete(C),!Ee)return;C=Ee.target,R=Ee.ancestors,P=C,N--;continue}const ye=C,Se=e.linkTo[N];if(typeof Se=="string"){if(!ye.properties||!(Se in ye.properties))return;N>0&&(R=[...R,P]),P=ye,C=ye.properties[Se]}else{if(!ye.eq||!Array.isArray(ye.eq)||Se>=ye.eq.length)return;N>0&&(R=[...R,P]),P=ye,C=ye.eq[Se]}}if((0,u.isRef)(C)){if(x.has(C))return;x.add(C);const N=s(C,w,R,x);return x.delete(C),N}return{target:C,ancestors:R}}function d(e,w){const E=w?.env,x=w?.factory??c,G=x.undefinedMot,oe=new Map;function C(N,ye,Se){if(N.deleted)return G;if(oe.has(N))return oe.get(N);const Ee=new Map,xe=P(N.eq,ye,Se,N),ve=x.createMot(xe,Ee);if(oe.set(N,ve),N.properties)for(const[$e,D]of Object.entries(N.properties)){const B=R(D,ye,Se,N);B.exists&&Ee.set($e,B)}return ve}function R(N,ye,Se,Ee){if((0,u.isRef)(N)){const ve=new Set;ve.add(N);const $e=s(N,ye,Se,ve);if(!$e||$e.target.deleted)return G;const D=C($e.target,ye,$e.ancestors);return x.createRefMot(N,D)}const xe=N;return xe.deleted?G:C(xe,ye,[...Se,Ee])}function P(N,ye,Se,Ee){if(N!==void 0){if((0,u.isEnvRef)(N)){const xe=E?E[N.env]:void 0;return xe===void 0?void 0:{type:"string",value:xe}}if(Array.isArray(N)){const xe=[...Se,Ee],ve=[];for(const $e of N)ve.push(R($e,ye,xe,Ee));return{type:"array",value:ve}}if(typeof N=="string")return{type:"string",value:N};if(typeof N=="number")return{type:"number",value:N};if(typeof N=="boolean")return{type:"boolean",value:N};if(N instanceof Date)return{type:"date",value:N}}}return C(e,e,[e])}return $t}var yt={},ir={},Ur;function ji(){if(Ur)return ir;Ur=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.parse=V;class u{constructor(l){this.input=l,this.pos=0}peekChar(){return this.pos<this.input.length?this.input[this.pos]:void 0}advance(l){this.pos+=l}startsWith(l){return this.input.startsWith(l,this.pos)}eatChar(l){return this.peekChar()===l?(this.advance(1),!0):!1}expectChar(l){if(!this.eatChar(l))throw this.errorPoint(`Expected '${l}'`)}position(){const l=this.input.substring(0,this.pos),f=(l.match(/\n/g)||[]).length,c=l.lastIndexOf(`
|
|
2
2
|
`),s=this.pos-(c===-1?0:c+1);return{line:f,column:s,offset:this.pos}}errorPoint(l){const f=this.position();return{code:"tag-parse-syntax-error",message:l,begin:f,end:f}}errorSpan(l,f){return{code:"tag-parse-syntax-error",message:l,begin:f,end:this.position()}}skipWs(){for(;;){for(;this.pos<this.input.length;){const l=this.input[this.pos];if(l===" "||l===" "||l==="\r"||l===`
|
|
3
3
|
`)this.pos++;else break}if(this.peekChar()==="#")for(;this.pos<this.input.length;){const l=this.input[this.pos];if(l==="\r"||l===`
|
|
4
4
|
`)break;this.pos++}else break}}skipWsAndCommas(){for(this.skipWs();this.peekChar()===",";)this.advance(1),this.skipWs()}parseStatements(){const l=[];for(this.skipWsAndCommas();this.pos<this.input.length;)l.push(this.parseStatement()),this.skipWsAndCommas();return l}parseStatement(){const l=this.position();if(this.startsWith("-..."))return this.advance(4),{kind:"clearAll",span:{begin:l,end:this.position()}};if(this.peekChar()==="-")return this.advance(1),{kind:"define",path:this.parsePropName(),deleted:!0,span:{begin:l,end:this.position()}};const f=this.parsePropName();this.skipWs();const c=this.peekChar();if(c===":"&&this.startsWith(":=")){this.advance(2),this.skipWs();const s=this.parseEqValue();if(this.skipWs(),this.peekChar()==="{"){const d=this.parsePropertiesBlock();return{kind:"assignBoth",path:f,value:s,properties:d,span:{begin:l,end:this.position()}}}return{kind:"assignBoth",path:f,value:s,properties:null,span:{begin:l,end:this.position()}}}if(c==="="){if(this.advance(1),this.skipWs(),this.peekChar()==="{")throw this.errorPoint("'=' requires a value; use ': { ... }' to replace properties");const s=this.parseEqValue();if(this.skipWs(),this.peekChar()==="{"){const d=this.parsePropertiesBlock();return{kind:"setEq",path:f,value:s,properties:d,span:{begin:l,end:this.position()}}}return{kind:"setEq",path:f,value:s,properties:null,span:{begin:l,end:this.position()}}}if(c===":"){this.advance(1),this.skipWs();const s=this.parsePropertiesBlock();return{kind:"replaceProperties",path:f,properties:s,span:{begin:l,end:this.position()}}}if(c==="{"){const s=this.parsePropertiesBlock();return{kind:"updateProperties",path:f,properties:s,span:{begin:l,end:this.position()}}}return{kind:"define",path:f,deleted:!1,span:{begin:l,end:this.position()}}}parsePropName(){const f=[this.parseIdentifier()];for(;this.peekChar()===".";)this.advance(1),f.push(this.parseIdentifier());return f}parseIdentifier(){return this.peekChar()==="`"?this.parseBacktickString():this.parseBareString()}parseEqValue(l=!0){const f=this.peekChar();if(l&&f==="[")return{kind:"array",elements:this.parseArray()};if(this.startsWith("<<<"))return{kind:"scalar",value:{kind:"string",value:this.parseHeredoc()}};if(f==="@")return{kind:"scalar",value:this.parseAtValue()};if(f==="$")return{kind:"scalar",value:this.parseReference()};if(f==='"')return this.startsWith('"""')?{kind:"scalar",value:{kind:"string",value:this.parseTripleString()}}:{kind:"scalar",value:{kind:"string",value:this.parseDoubleQuotedString()}};if(f==="'")return this.startsWith("'''")?{kind:"scalar",value:{kind:"string",value:this.parseTripleSingleQuotedString()}}:{kind:"scalar",value:{kind:"string",value:this.parseSingleQuotedString()}};if(f!==void 0&&(f==="-"||f>="0"&&f<="9"||f==="."))return this.parseNumberOrString();if(f!==void 0&&M(f))return{kind:"scalar",value:{kind:"string",value:this.parseBareString()}};throw this.errorPoint("Expected a value")}parseAtValue(){const l=this.position();if(this.expectChar("@"),this.startsWith("true")&&!this.isBareCharAt(4))return this.advance(4),{kind:"boolean",value:!0};if(this.startsWith("false")&&!this.isBareCharAt(5))return this.advance(5),{kind:"boolean",value:!1};if(this.startsWith("none")&&!this.isBareCharAt(4))return this.advance(4),{kind:"none"};if(this.startsWith("env."))return this.advance(4),{kind:"env",name:this.parseIdentifier()};const f=this.peekChar();if(f!==void 0&&f>="0"&&f<="9")return this.parseDate(l);const c=this.pos;for(;this.pos<this.input.length&&M(this.input[this.pos]);)this.pos++;const s=this.pos>c?this.input.substring(c,this.pos):"";throw this.errorSpan(`Illegal constant @${s}; expected @true, @false, @none, @env.NAME, or @date`,l)}isBareCharAt(l){const f=this.pos+l;return f<this.input.length&&M(this.input[f])}parseDate(l){const f=this.pos;if(this.consumeDigits(4,l),this.expectChar("-"),this.consumeDigits(2,l),this.expectChar("-"),this.consumeDigits(2,l),this.peekChar()==="T"){if(this.advance(1),this.consumeDigits(2,l),this.expectChar(":"),this.consumeDigits(2,l),this.peekChar()===":"&&(this.advance(1),this.consumeDigits(2,l),this.peekChar()===".")){this.advance(1);const d=this.pos;for(;this.pos<this.input.length&&this.input[this.pos]>="0"&&this.input[this.pos]<="9";)this.pos++;if(this.pos===d)throw this.errorSpan("Expected fractional digits in date",l)}const s=this.peekChar();s==="Z"?this.advance(1):(s==="+"||s==="-")&&(this.advance(1),this.consumeDigits(2,l),this.peekChar()===":"&&this.advance(1),this.consumeDigits(2,l))}return{kind:"date",value:this.input.substring(f,this.pos)}}consumeDigits(l,f){for(let c=0;c<l;c++){const s=this.peekChar();if(s===void 0||s<"0"||s>"9")throw this.errorSpan("Expected digit",f);this.advance(1)}}parseNumberOrString(){const l=this.pos,f=this.position(),c=this.peekChar()==="-";c&&this.advance(1);let s=!1,d=!1;for(;this.pos<this.input.length&&this.input[this.pos]>="0"&&this.input[this.pos]<="9";)s=!0,this.advance(1);if(this.peekChar()==="."){d=!0,this.advance(1);const G=this.pos;for(;this.pos<this.input.length&&this.input[this.pos]>="0"&&this.input[this.pos]<="9";)this.advance(1);if(this.pos===G)return this.pos=l,this.parseIntegerOrBare(l,c)}if(!s&&!d){if(this.pos=l,c)throw this.errorPoint("Expected a value");return{kind:"scalar",value:{kind:"string",value:this.parseBareString()}}}const e=this.peekChar();if(e==="e"||e==="E"){this.advance(1);const G=this.peekChar();(G==="+"||G==="-")&&this.advance(1);const oe=this.pos;for(;this.pos<this.input.length&&this.input[this.pos]>="0"&&this.input[this.pos]<="9";)this.advance(1);if(this.pos===oe)throw this.errorSpan("Expected exponent digits",f)}const w=this.peekChar();if(w!==void 0&&M(w)&&!(w>="0"&&w<="9")){if(this.pos=l,c)throw this.errorPoint("Expected a value");return{kind:"scalar",value:{kind:"string",value:this.parseBareString()}}}const E=this.input.substring(l,this.pos),x=parseFloat(E);if(isNaN(x))throw this.errorSpan(`Invalid number: ${E}`,f);return{kind:"scalar",value:{kind:"number",value:x}}}parseIntegerOrBare(l,f){this.pos=l;const c=this.position();f&&this.advance(1);const s=this.pos;for(;this.pos<this.input.length&&this.input[this.pos]>="0"&&this.input[this.pos]<="9";)this.advance(1);if(this.pos===s){if(this.pos=l,f)throw this.errorPoint("Expected a value");return{kind:"scalar",value:{kind:"string",value:this.parseBareString()}}}if(!f){const E=this.peekChar();if(E!==void 0&&M(E)&&!(E>="0"&&E<="9"))return this.pos=l,{kind:"scalar",value:{kind:"string",value:this.parseBareString()}}}const d=this.peekChar();if(d==="e"||d==="E"){this.advance(1);const E=this.peekChar();(E==="+"||E==="-")&&this.advance(1);const x=this.pos;for(;this.pos<this.input.length&&this.input[this.pos]>="0"&&this.input[this.pos]<="9";)this.advance(1);if(this.pos===x)throw this.errorSpan("Expected exponent digits",c)}const e=this.input.substring(l,this.pos),w=parseFloat(e);if(isNaN(w))throw this.errorSpan(`Invalid number: ${e}`,c);return{kind:"scalar",value:{kind:"number",value:w}}}parseBareString(){const l=this.pos;for(;this.pos<this.input.length&&M(this.input[this.pos]);)this.pos++;if(this.pos===l)throw this.errorPoint("Expected an identifier");return this.input.substring(l,this.pos)}parseDoubleQuotedString(){const l=this.position();this.expectChar('"');let f="";for(;;){const c=this.peekChar();if(c===void 0||c==="\r"||c===`
|
|
@@ -20,7 +20,7 @@ ${l} ]`:f+=`
|
|
|
20
20
|
${l} =: ${this.eq}`),this.properties)for(const c in this.properties)f+=`
|
|
21
21
|
${l} ${c}: ${this.properties[c].peek(g+2)}`;return f+=`
|
|
22
22
|
${l}}`,f}constructor(g={},l){if(this._read=!1,l!==void 0&&(this._parent=l),g.eq!==void 0&&(Array.isArray(g.eq)?this.eq=g.eq.map(f=>f instanceof u?f:new u(f,this)):this.eq=g.eq),g.properties){this.properties={};for(const[f,c]of Object.entries(g.properties))this.properties[f]=c instanceof u?c:new u(c,this)}g.deleted&&(this.deleted=g.deleted),g.prefix&&(this.prefix=g.prefix)}static withPrefix(g){return new u({prefix:g})}tag(...g){return this.find(g)}text(...g){var l;const f=(l=this.find(g))===null||l===void 0?void 0:l.getEq();if(!(f===void 0||Array.isArray(f)))return f instanceof Date?f.toISOString():String(f)}scalarType(...g){var l;const f=g.length>0?(l=this.find(g))===null||l===void 0?void 0:l.getEq():this.getEq();if(!(f===void 0||Array.isArray(f)))return f instanceof Date?"date":typeof f}numeric(...g){var l;const f=(l=this.find(g))===null||l===void 0?void 0:l.getEq();if(typeof f=="number")return f;if(typeof f=="string"){const c=Number.parseFloat(f);if(!Number.isNaN(c))return c}}boolean(...g){var l;const f=(l=this.find(g))===null||l===void 0?void 0:l.getEq();if(typeof f=="boolean")return f}isTrue(...g){var l;return((l=this.find(g))===null||l===void 0?void 0:l.getEq())===!0}isFalse(...g){var l;return((l=this.find(g))===null||l===void 0?void 0:l.getEq())===!1}date(...g){var l;const f=(l=this.find(g))===null||l===void 0?void 0:l.getEq();if(f instanceof Date)return f}bare(...g){const l=this.find(g);if(l!==void 0)return!l.hasProperties()}getEq(){return this.eq}getProperty(g){var l;return(l=this.properties)===null||l===void 0?void 0:l[g]}getArrayElement(g){if(Array.isArray(this.eq)&&g<this.eq.length)return this.eq[g]}get dict(){var g;return(g=this.properties)!==null&&g!==void 0?g:{}}*entries(){if(this.properties)for(const g in this.properties)yield[g,this.properties[g]]}*keys(){if(this.properties)for(const g in this.properties)yield g}hasProperties(){return this.properties!==void 0&&Object.keys(this.properties).length>0}array(...g){const l=this.find(g);if(l===void 0)return;const f=l.getEq();if(Array.isArray(f))return f.map((c,s)=>l.getArrayElement(s))}textArray(...g){const l=this.find(g);if(l===void 0)return;const f=l.getEq();if(Array.isArray(f))return f.reduce((c,s,d)=>{const e=l.getArrayElement(d),w=e?.getEq();return w===void 0||Array.isArray(w)?c:w instanceof Date?c.concat(w.toISOString()):c.concat(String(w))},[])}numericArray(...g){const l=this.find(g);if(l===void 0)return;const f=l.getEq();if(Array.isArray(f))return f.reduce((c,s,d)=>{const e=l.getArrayElement(d),w=e?.getEq();if(typeof w=="number")return c.concat(w);if(typeof w=="string"){const E=Number.parseFloat(w);if(!Number.isNaN(E))return c.concat(E)}return c},[])}getProperties(){return this.properties===void 0&&(this.properties={}),this.properties}clone(g){this._read=!0;const l=new u({},g);if(l.prefix=this.prefix,l.deleted=this.deleted,l.location=this.location,l._clonedFrom=this,this.eq!==void 0&&(Array.isArray(this.eq)?l.eq=this.eq.map(f=>f.clone(l)):l.eq=this.eq instanceof Date?new Date(this.eq):this.eq),this.properties){l.properties={};for(const[f,c]of Object.entries(this.properties))l.properties[f]=c.clone(l)}return l}toJSON(){const g={};if(this.eq!==void 0&&(Array.isArray(this.eq)?g.eq=this.eq.map(l=>l.toJSON()):g.eq=this.eq),this.properties!==void 0){g.properties={};for(const[l,f]of Object.entries(this.properties))g.properties[l]=f.toJSON()}return this.deleted&&(g.deleted=!0),this.prefix&&(g.prefix=this.prefix),this.location&&(g.location=this.location),g}validateReferences(){const g=[];return this.collectReferenceErrors(g,[]),g}collectReferenceErrors(g,l){if(this.properties)for(const[f,c]of Object.entries(this.properties))c.deleted||c.collectReferenceErrors(g,[...l,f]);Array.isArray(this.eq)&&this.eq.forEach((f,c)=>{f.collectReferenceErrors(g,[...l,`[${c}]`])})}static escapeString(g){return g.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n")}static escapeProp(g){return g.replace(/\\/g,"\\\\").replace(/`/g,"\\`")}static quoteAndEscape(g,l=!1){return g.match(/^[0-9A-Za-z_]+$/)?g:l?`\`${u.escapeProp(g)}\``:`"${u.escapeString(g)}"`}static serializeScalar(g){return typeof g=="boolean"?g?"@true":"@false":g instanceof Date?`@${g.toISOString()}`:typeof g=="number"?String(g):u.quoteAndEscape(g)}toString(){var g;let l=(g=this.prefix)!==null&&g!==void 0?g:"# ";function f(d){var e;const w=Object.keys((e=d.properties)!==null&&e!==void 0?e:{});for(let E=0;E<w.length;E++)s(w[E],d.properties[w[E]]),E<w.length-1&&(l+=" ")}function c(d,e=!1){if(d.eq!==void 0)if(e||(l+=" = "),Array.isArray(d.eq)){l+="[";for(let w=0;w<d.eq.length;w++)c(d.eq[w],!0),w!==d.eq.length-1&&(l+=", ");l+="]"}else l+=u.serializeScalar(d.eq);if(d.properties){const w=Object.keys(d.properties);!e&&w.length===1&&!w.some(E=>{var x;return((x=d.properties)!==null&&x!==void 0?x:{})[E].deleted})&&d.eq===void 0?(l+=".",f(d)):((!e||d.eq!==void 0)&&(l+=" "),l+="{ ",f(d),l+=" }")}}function s(d,e){if(e.deleted){l+=`-${u.quoteAndEscape(d,!0)}`;return}l+=u.quoteAndEscape(d,!0),c(e)}return f(this),l+=`
|
|
23
|
-
`,l}find(g){let l=this;for(const f of g){let c;if(typeof f=="number"?c=l.getArrayElement(f):c=l.getProperty(f),c===void 0)return;c.markRead(),l=c}return l.deleted?void 0:l}markRead(){this._read=!0,this._clonedFrom&&(this._clonedFrom._read=!0)}get wasRead(){return this._read}*walk(g=[]){if(this.properties)for(const[l,f]of Object.entries(this.properties)){if(f.deleted)continue;const c=[...g,l];yield{path:c,tag:f},yield*f.walk(c)}if(Array.isArray(this.eq))for(let l=0;l<this.eq.length;l++){const f=[...g,l.toString()];yield{path:f,tag:this.eq[l]},yield*this.eq[l].walk(f)}}resetReadTracking(){this._read=!1;for(const{tag:g}of this.walk())g._read=!1}getUnreadProperties(g=[]){const l=[];if(this.properties)for(const[f,c]of Object.entries(this.properties)){if(c.deleted)continue;const s=[...g,f];c._read?l.push(...c.getUnreadProperties(s)):l.push(s)}return l}has(...g){return this.find(g)!==void 0}set(g,l=null){let f=this,c,s;for(const d of g)if(c=f,s=d,typeof d=="number"){if(f.eq===void 0||!Array.isArray(f.eq))f.eq=Array.from({length:d+1}).map(()=>new u({},f));else if(f.eq.length<=d){const e=f.eq,w=Array.from({length:d+1}).map((E,x)=>x<e.length?e[x]:new u({},f));f.eq=w}f=f.eq[d]}else{const e=f.properties;e===void 0?(f.properties={[d]:new u({},f)},f=f.properties[d]):d in e?(f=e[d],f.deleted&&(f.deleted=!1)):(e[d]=new u({},f),f=e[d])}if(l===null)f.eq=void 0;else if(l instanceof u){const d=l.clone(c);c&&s!==void 0&&(typeof s=="number"&&Array.isArray(c.eq)?c.eq[s]=d:typeof s=="string"&&c.properties&&(c.properties[s]=d))}else typeof l=="string"||typeof l=="number"||typeof l=="boolean"||l instanceof Date?f.eq=l:Array.isArray(l)&&(f.eq=l.map(d=>new u({eq:d},f)));return this}delete(...g){return this.remove(g,!1)}unset(...g){return this.remove(g,!0)}remove(g,l=!1){var f;let c=this;for(const d of g.slice(0,g.length-1))if(typeof d=="number"){if(c.eq===void 0||!Array.isArray(c.eq)){if(!l)return this;c.eq=Array.from({length:d}).map(()=>new u({},c))}else if(c.eq.length<=d){if(!l)return this;const e=c.eq,w=Array.from({length:d}).map((E,x)=>x<e.length?e[x]:new u({},c));c.eq=w}c=c.eq[d]}else{const e=c.properties;if(e===void 0){if(!l)return this;c.properties={[d]:new u({},c)},c=c.properties[d]}else if(d in e)c=e[d];else{if(!l)return this;e[d]=new u({},c),c=e[d]}}const s=g[g.length-1];return typeof s=="string"?c.properties&&s in c.properties?delete c.properties[s]:l&&((f=c.properties)!==null&&f!==void 0||(c.properties={}),c.properties[s]=new u({deleted:!0},c)):Array.isArray(c.eq)&&c.eq.splice(s,1),this}}xt.Tag=u,u.ids=new Map,u.nextTagId=1e3;function M(V){const g={};return V.eq!==void 0&&(Array.isArray(V.eq)?g.eq=V.eq.map(l=>M(l)):g.eq=V.eq),V.properties!==void 0&&(g.properties=z(V.properties)),V.deleted&&(g.deleted=!0),g}function z(V){const g={};for(const[l,f]of Object.entries(V))g[l]=M(f);return g}return xt}var Vt={},tn;function Ji(){if(tn)return Vt;tn=1;var u={};Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.TagParser=void 0,Vt.parseTag=s,Vt.parseAnnotation=d;const M=Wi(),z=An();function V(e){const w=e.search(/[ \n]/);return w>0?e.slice(w):""}function g(e){return{code:e.code,message:e.message,line:e.begin.line,offset:e.begin.column}}function l(e,w){const E=w.get(e.parseId);if(E)return{url:E.url,range:{start:{line:E.startLine+e.begin.line,character:e.begin.line===0?E.startColumn+e.begin.column:e.begin.column},end:{line:E.startLine+e.end.line,character:e.end.line===0?E.startColumn+e.end.column:e.end.column}}}}function f(e,w,E){if((0,M.isRef)(e))return new z.Tag({deleted:!0},w);const x=new z.Tag({},w);if(e.location&&E&&(x.location=l(e.location,E)),e.eq!==void 0)if(Array.isArray(e.eq))x.eq=e.eq.map(G=>f(G,x,E));else if((0,M.isEnvRef)(e.eq)){const G=u[e.eq.env];G!==void 0&&(x.eq=G)}else e.eq instanceof Date?x.eq=new Date(e.eq):x.eq=e.eq;if(e.properties!==void 0){x.properties={};for(const[G,oe]of Object.entries(e.properties))x.properties[G]=f(oe,x,E)}return e.deleted&&(x.deleted=!0),x}class c{constructor(){this.origins=new Map,this.session=new M.MOTLYSession}parse(w,E){return this.parseSource(w,0,E)}parseAnnotation(w,E){const x=V(w),G=w.length-x.length;return this.parseSource(x,G,E)}parseSource(w,E,x){const{parseId:G,errors:oe}=this.session.parse(w);x&&this.origins.set(G,{url:x.url,startLine:x.startLine,startColumn:x.startColumn+E});const C=oe.map(g);return{tag:new z.Tag,log:C}}finish(){const E=this.session.finish().getValue();return this.session.dispose(),f(E,void 0,this.origins)}}Vt.TagParser=c;function s(e){const w=new c;if(typeof e=="string"){const{log:x}=w.parse(e);return{tag:w.finish(),log:x}}const E=[];for(let x=0;x<e.length;x++){const G=w.parse(e[x]);for(const oe of G.log)E.push({...oe,line:x+oe.line})}return{tag:w.finish(),log:E}}function d(e){const w=new c;if(typeof e=="string"){const{log:x}=w.parseAnnotation(e);return{tag:w.finish(),log:x}}const E=[];for(let x=0;x<e.length;x++){const G=w.parseAnnotation(e[x]);for(const oe of G.log)E.push({...oe,line:x+oe.line})}return{tag:w.finish(),log:E}}return Vt}var ar={},rn;function Xi(){if(rn)return ar;rn=1,Object.defineProperty(ar,"__esModule",{value:!0}),ar.parseString=M;var u;(function(z){z[z.Normal=0]="Normal",z[z.ReverseVirgule=1]="ReverseVirgule",z[z.Unicode=2]="Unicode"})(u||(u={}));function M(z,V=""){let g=z.slice(V.length),l=u.Normal;V.length&&(g=g.slice(0,-V.length));let f="",c="";for(const s of g)switch(l){case u.Normal:{s==="\\"?l=u.ReverseVirgule:f+=s;break}case u.ReverseVirgule:{let d=s;if(s==="u"){l=u.Unicode,c="";continue}s==="b"?d="\b":s==="f"?d="\f":s==="n"?d=`
|
|
23
|
+
`,l}find(g){let l=this;for(const f of g){let c;if(typeof f=="number"?c=l.getArrayElement(f):c=l.getProperty(f),c===void 0)return;c.markRead(),l=c}return l.deleted?void 0:l}markRead(){this._read=!0,this._clonedFrom&&(this._clonedFrom._read=!0)}get wasRead(){return this._read}*walk(g=[]){if(this.properties)for(const[l,f]of Object.entries(this.properties)){if(f.deleted)continue;const c=[...g,l];yield{path:c,tag:f},yield*f.walk(c)}if(Array.isArray(this.eq))for(let l=0;l<this.eq.length;l++){const f=[...g,l.toString()];yield{path:f,tag:this.eq[l]},yield*this.eq[l].walk(f)}}resetReadTracking(){this._read=!1;for(const{tag:g}of this.walk())g._read=!1}getUnreadProperties(g=[]){const l=[];if(this.properties)for(const[f,c]of Object.entries(this.properties)){if(c.deleted)continue;const s=[...g,f];c._read?l.push(...c.getUnreadProperties(s)):l.push(s)}return l}has(...g){return this.find(g)!==void 0}set(g,l=null){let f=this,c,s;for(const d of g)if(c=f,s=d,typeof d=="number"){if(f.eq===void 0||!Array.isArray(f.eq))f.eq=Array.from({length:d+1}).map(()=>new u({},f));else if(f.eq.length<=d){const e=f.eq,w=Array.from({length:d+1}).map((E,x)=>x<e.length?e[x]:new u({},f));f.eq=w}f=f.eq[d]}else{const e=f.properties;e===void 0?(f.properties={[d]:new u({},f)},f=f.properties[d]):d in e?(f=e[d],f.deleted&&(f.deleted=!1)):(e[d]=new u({},f),f=e[d])}if(l===null)f.eq=void 0;else if(l instanceof u){const d=l.clone(c);c&&s!==void 0&&(typeof s=="number"&&Array.isArray(c.eq)?c.eq[s]=d:typeof s=="string"&&c.properties&&(c.properties[s]=d))}else typeof l=="string"||typeof l=="number"||typeof l=="boolean"||l instanceof Date?f.eq=l:Array.isArray(l)&&(f.eq=l.map(d=>new u({eq:d},f)));return this}delete(...g){return this.remove(g,!1)}unset(...g){return this.remove(g,!0)}remove(g,l=!1){var f;let c=this;for(const d of g.slice(0,g.length-1))if(typeof d=="number"){if(c.eq===void 0||!Array.isArray(c.eq)){if(!l)return this;c.eq=Array.from({length:d}).map(()=>new u({},c))}else if(c.eq.length<=d){if(!l)return this;const e=c.eq,w=Array.from({length:d}).map((E,x)=>x<e.length?e[x]:new u({},c));c.eq=w}c=c.eq[d]}else{const e=c.properties;if(e===void 0){if(!l)return this;c.properties={[d]:new u({},c)},c=c.properties[d]}else if(d in e)c=e[d];else{if(!l)return this;e[d]=new u({},c),c=e[d]}}const s=g[g.length-1];return typeof s=="string"?c.properties&&s in c.properties?delete c.properties[s]:l&&((f=c.properties)!==null&&f!==void 0||(c.properties={}),c.properties[s]=new u({deleted:!0},c)):Array.isArray(c.eq)&&c.eq.splice(s,1),this}}xt.Tag=u,u.ids=new Map,u.nextTagId=1e3;function M(V){const g={};return V.eq!==void 0&&(Array.isArray(V.eq)?g.eq=V.eq.map(l=>M(l)):g.eq=V.eq),V.properties!==void 0&&(g.properties=z(V.properties)),V.deleted&&(g.deleted=!0),g}function z(V){const g={};for(const[l,f]of Object.entries(V))g[l]=M(f);return g}return xt}var Vt={},tn;function Ji(){if(tn)return Vt;tn=1;var u={};Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.TagParser=void 0,Vt.parseTag=s,Vt.parseAnnotation=d;const M=Wi(),z=An();function V(e){const w=e.search(/[ \t\r\n]/);return w>0?e.slice(w):""}function g(e){return{code:e.code,message:e.message,line:e.begin.line,offset:e.begin.column}}function l(e,w){const E=w.get(e.parseId);if(E)return{url:E.url,range:{start:{line:E.startLine+e.begin.line,character:e.begin.line===0?E.startColumn+e.begin.column:e.begin.column},end:{line:E.startLine+e.end.line,character:e.end.line===0?E.startColumn+e.end.column:e.end.column}}}}function f(e,w,E){if((0,M.isRef)(e))return new z.Tag({deleted:!0},w);const x=new z.Tag({},w);if(e.location&&E&&(x.location=l(e.location,E)),e.eq!==void 0)if(Array.isArray(e.eq))x.eq=e.eq.map(G=>f(G,x,E));else if((0,M.isEnvRef)(e.eq)){const G=u[e.eq.env];G!==void 0&&(x.eq=G)}else e.eq instanceof Date?x.eq=new Date(e.eq):x.eq=e.eq;if(e.properties!==void 0){x.properties={};for(const[G,oe]of Object.entries(e.properties))x.properties[G]=f(oe,x,E)}return e.deleted&&(x.deleted=!0),x}class c{constructor(){this.origins=new Map,this.session=new M.MOTLYSession}parse(w,E){return this.parseSource(w,0,E)}parseAnnotation(w,E){const x=V(w),G=w.length-x.length;return this.parseSource(x,G,E)}parseSource(w,E,x){const{parseId:G,errors:oe}=this.session.parse(w);x&&this.origins.set(G,{url:x.url,startLine:x.startLine,startColumn:x.startColumn+E});const C=oe.map(g);return{tag:new z.Tag,log:C}}finish(){const E=this.session.finish().getValue();return this.session.dispose(),f(E,void 0,this.origins)}}Vt.TagParser=c;function s(e){const w=new c;if(typeof e=="string"){const{log:x}=w.parse(e);return{tag:w.finish(),log:x}}const E=[];for(let x=0;x<e.length;x++){const G=w.parse(e[x]);for(const oe of G.log)E.push({...oe,line:x+oe.line})}return{tag:w.finish(),log:E}}function d(e){const w=new c;if(typeof e=="string"){const{log:x}=w.parseAnnotation(e);return{tag:w.finish(),log:x}}const E=[];for(let x=0;x<e.length;x++){const G=w.parseAnnotation(e[x]);for(const oe of G.log)E.push({...oe,line:x+oe.line})}return{tag:w.finish(),log:E}}return Vt}var ar={},rn;function Xi(){if(rn)return ar;rn=1,Object.defineProperty(ar,"__esModule",{value:!0}),ar.parseString=M;var u;(function(z){z[z.Normal=0]="Normal",z[z.ReverseVirgule=1]="ReverseVirgule",z[z.Unicode=2]="Unicode"})(u||(u={}));function M(z,V=""){let g=z.slice(V.length),l=u.Normal;V.length&&(g=g.slice(0,-V.length));let f="",c="";for(const s of g)switch(l){case u.Normal:{s==="\\"?l=u.ReverseVirgule:f+=s;break}case u.ReverseVirgule:{let d=s;if(s==="u"){l=u.Unicode,c="";continue}s==="b"?d="\b":s==="f"?d="\f":s==="n"?d=`
|
|
24
24
|
`:s==="r"?d="\r":s==="t"&&(d=" "),f+=d,l=u.Normal;break}case u.Unicode:"ABCDEFabcdef0123456789".includes(s)?(c+=s,c.length===4&&(f+=String.fromCharCode(parseInt(c,16)),l=u.Normal)):l=u.Normal}return f}return ar}var nn;function Zi(){return nn||(nn=1,(function(u){var M=pt&&pt.__createBinding||(Object.create?(function(f,c,s,d){d===void 0&&(d=s);var e=Object.getOwnPropertyDescriptor(c,s);(!e||("get"in e?!c.__esModule:e.writable||e.configurable))&&(e={enumerable:!0,get:function(){return c[s]}}),Object.defineProperty(f,d,e)}):(function(f,c,s,d){d===void 0&&(d=s),f[d]=c[s]})),z=pt&&pt.__setModuleDefault||(Object.create?(function(f,c){Object.defineProperty(f,"default",{enumerable:!0,value:c})}):function(f,c){f.default=c}),V=pt&&pt.__exportStar||function(f,c){for(var s in f)s!=="default"&&!Object.prototype.hasOwnProperty.call(c,s)&&M(c,f,s)},g=pt&&pt.__importStar||(function(){var f=function(c){return f=Object.getOwnPropertyNames||function(s){var d=[];for(var e in s)Object.prototype.hasOwnProperty.call(s,e)&&(d[d.length]=e);return d},f(c)};return function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var d=f(c),e=0;e<d.length;e++)d[e]!=="default"&&M(s,c,d[e]);return z(s,c),s}})();Object.defineProperty(u,"__esModule",{value:!0}),u.ParseUtil=u.TagParser=u.parseAnnotation=u.parseTag=void 0,V(An(),u);var l=Ji();Object.defineProperty(u,"parseTag",{enumerable:!0,get:function(){return l.parseTag}}),Object.defineProperty(u,"parseAnnotation",{enumerable:!0,get:function(){return l.parseAnnotation}}),Object.defineProperty(u,"TagParser",{enumerable:!0,get:function(){return l.TagParser}}),u.ParseUtil=g(Xi())})(pt)),pt}var It={},dt={},sn;function Nt(){if(sn)return dt;sn=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.isChainOp=u,dt.isStringCondition=M,dt.isStringFilter=z,dt.isBooleanFilter=V,dt.isNumberFilter=g,dt.isTemporalFilter=l,dt.isFilterExpression=f,dt.isFilterable=c;function u(s){return["and","or",","].includes(s)}function M(s){return["starts","ends","contains","="].includes(s.operator)}function z(s){return typeof s=="object"&&s!==null&&"operator"in s&&typeof s.operator=="string"&&["starts","ends","contains","=","~","null","empty","and","or",",","()"].includes(s.operator)}function V(s){return typeof s=="object"&&s!==null&&"operator"in s&&typeof s.operator=="string"&&["null","true","false","=false","=true"].includes(s.operator)}function g(s){return typeof s=="object"&&s!==null&&"operator"in s&&typeof s.operator=="string"&&["range","<=",">=","!=","=",">","<","and","or","()","null"].includes(s.operator)}function l(s){return typeof s=="object"&&s!==null&&"operator"in s&&typeof s.operator=="string"&&["literal","before","after","to","for","in","and","or","in_last","this","last","next","()","null"].includes(s.operator)}function f(s){return typeof s=="object"&&s!==null&&"operator"in s}function c(s){return["string","number","boolean","timestamp","timestamptz","date"].includes(s)}return dt}var Ht={},an;function es(){return an||(an=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.BooleanFilterExpression=void 0,Ht.BooleanFilterExpression={parse(u){var M;if(u.match(/^\s*$/))return{parsed:null,log:[]};const z={parsed:null,log:[]};let V=u.toLowerCase().trim().replace(/\s\s+/," "),g=!1;if(V.startsWith("not ")&&(g=!0,V=V.slice(4)),V==="true")z.parsed={operator:"true"};else if(V==="=true")z.parsed={operator:"=true"};else if(V==="false")z.parsed={operator:"false"};else if(V==="=false")z.parsed={operator:"=false"};else if(V==="null")z.parsed={operator:"null"};else{const l=u.match(/[^\s]/),f=l&&(M=l.index)!==null&&M!==void 0?M:0;z.log=[{message:`Illegal boolean filter '${V}'. Must be one of true,=true,false,=false,null`,severity:"error",startIndex:f,endIndex:f+u.length-1}]}return g&&z.parsed&&(z.parsed.not=!0),z},unparse(u){return u===null?"":(u.not?"not ":"")+u.operator}}),Ht}var Sr={},ot={},on;function lr(){if(on)return ot;on=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.maybeNot=M,ot.unescape=z,ot.escape=V,ot.matchOp=l,ot.conjoin=c,ot.joinNumbers=s,ot.mkRange=d,ot.mkValues=e,ot.numNot=w,ot.temporalNot=E,ot.joinTemporal=x,ot.timeLiteral=G,ot.mkUnits=oe;const u=Nt();function M(C){const[R,P]=C;return R&&P&&(0,u.isStringFilter)(P)?{...P,not:!0}:P}function z(C){return C.replace(/\\(.)/g,"$1")}function V(C){const R=C.toLowerCase();return R==="null"||R==="empty"?"\\"+C:C.replace(/([,; |()\\%_-])/g,"\\$1")}function g(C){let R=!1,P=!1,N=0,ye=!1;const Se=C.length;for(let Ee=0;Ee<Se;Ee+=1){const xe=C[Ee];if(xe===" "||xe===" "){N+=1;continue}N=0,xe==="%"?(ye=!0,Ee===0&&(R=!0),P=!0):(P=!1,xe==="\\"?Ee+=1:xe==="_"&&(ye=!0))}return{hasLike:ye,percentEnd:P&&Se>1,percentStart:R&&Se>1,endSpace:N}}function l(C){let R=C.trimStart();const{hasLike:P,percentEnd:N,percentStart:ye,endSpace:Se}=g(R);if(Se>0&&(R=R.slice(0,-Se)),P){if(ye&&N){const Ee=R.slice(1,-1);if(!g(Ee).hasLike&&Ee.length>0)return{operator:"contains",values:[z(Ee)]}}else if(N){const Ee=R.slice(0,-1);if(!g(Ee).hasLike)return{operator:"starts",values:[z(Ee)]}}else if(ye){const Ee=R.slice(1);if(!g(Ee).hasLike)return{operator:"ends",values:[z(Ee)]}}return{operator:"~",escaped_values:[R]}}return R.toLowerCase()==="null"?{operator:"null"}:R.toLowerCase()==="empty"?{operator:"empty"}:{operator:"=",values:[z(R)]}}function f(C,R){var P,N;return C.operator===R.operator&&((P=C.not)!==null&&P!==void 0?P:!1)===((N=R.not)!==null&&N!==void 0?N:!1)}function c(C,R,P){if(R=R.toLowerCase(),(0,u.isStringFilter)(C)&&(0,u.isStringFilter)(P)){if(R===","){if(C.operator==="~"&&f(C,P))return{...C,escaped_values:[...C.escaped_values,...P.escaped_values]};if((0,u.isStringCondition)(C)&&f(C,P))return{...C,values:[...C.values,...P.values]}}const N=R===","?",":R==="|"?"or":R===";"?"and":void 0;if(N)return C.operator===N?{...C,members:[...C.members,P]}:{operator:N,members:[C,P]}}return null}function s(C,R,P){if(R=R.toLowerCase(),(0,u.isNumberFilter)(C)&&(0,u.isNumberFilter)(P)){if(R==="or"&&C.operator==="="&&f(C,P)){const N={operator:"=",values:[...C.values,...P.values]};return C.not&&(N.not=!0),N}if(R==="and"||R==="or")return C.operator===R?{...C,members:[...C.members,P]}:{operator:R,members:[C,P]}}return null}function d(C,R,P,N){return{operator:"range",startValue:R,startOperator:C==="("?">":">=",endValue:P,endOperator:N===")"?"<":"<="}}function e(C,R){return{values:[C,...R]}}function w(C,R){return(0,u.isNumberFilter)(C)&&R?C.operator==="="?{operator:"!=",values:C.values}:C.operator==="!="?{operator:"=",values:C.values}:{...C,not:!0}:C}function E(C,R){if((0,u.isTemporalFilter)(C)&&R){if("not"in C){const P={...C};return C.not?delete P.not:P.not=!0,P}return{...C,not:!0}}return C}function x(C,R,P){return R=R.toLowerCase(),(0,u.isTemporalFilter)(C)&&(0,u.isTemporalFilter)(P)&&(R==="and"||R==="or")?C.operator===R?{...C,members:[...C.members,P]}:{operator:R,members:[C,P]}:null}function G(C,R){const P={moment:"literal",literal:C};return R&&(P.units=R),P}function oe(C){switch(C.toLowerCase()){case"second":case"seconds":return"second";case"minute":case"minutes":return"minute";case"hour":case"hours":return"hour";case"day":case"days":return"day";case"week":case"weeks":return"week";case"month":case"months":return"month";case"quarter":case"quarters":return"quarter";case"year":case"years":return"year"}}return ot}var Er,ln;function ts(){if(ln)return Er;ln=1;const{numNot:u,mkRange:M,joinNumbers:z,mkValues:V}=lr();function g(s,d){function e(){this.constructor=s}e.prototype=d.prototype,s.prototype=new e}function l(s,d,e,w){var E=Error.call(this,s);return Object.setPrototypeOf&&Object.setPrototypeOf(E,l.prototype),E.expected=d,E.found=e,E.location=w,E.name="SyntaxError",E}g(l,Error);function f(s,d,e){return e=e||" ",s.length>d?s:(d-=s.length,e+=e.repeat(d),s+e.slice(0,d))}l.prototype.format=function(s){var d="Error: "+this.message;if(this.location){var e=null,w;for(w=0;w<s.length;w++)if(s[w].source===this.location.source){e=s[w].text.split(/\r\n|\n|\r/g);break}var E=this.location.start,x=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(E):E,G=this.location.source+":"+x.line+":"+x.column;if(e){var oe=this.location.end,C=f("",x.line.toString().length," "),R=e[E.line-1],P=E.line===oe.line?oe.column:R.length+1,N=P-E.column||1;d+=`
|
|
25
25
|
--> `+G+`
|
|
26
26
|
`+C+` |
|