@nowline/embed 0.0.0-dev.20261019024645.g95fa9ba → 0.0.0-dev.20261019064527.g87aafc2
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/nowline.esm.js +3 -3
- package/dist/nowline.min.js +2 -2
- package/package.json +6 -6
package/dist/nowline.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @nowline/embed 0.0.0-dev.
|
|
1
|
+
/*! @nowline/embed 0.0.0-dev.20261019064527.g87aafc2 sha=87aafc2 built=2026-10-19T06:39:09Z */
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -40655,8 +40655,8 @@ function effectiveTheme(theme, systemTheme) {
|
|
|
40655
40655
|
}
|
|
40656
40656
|
|
|
40657
40657
|
// src/index.ts
|
|
40658
|
-
var version = true ? "0.0.0-dev.
|
|
40659
|
-
var sha = true ? "
|
|
40658
|
+
var version = true ? "0.0.0-dev.20261019064527.g87aafc2" : "0.0.0";
|
|
40659
|
+
var sha = true ? "87aafc2" : "unknown";
|
|
40660
40660
|
var DEFAULT_SELECTOR = "pre code.language-nowline, code.language-nowline";
|
|
40661
40661
|
var initialConfig = {
|
|
40662
40662
|
theme: "auto",
|
package/dist/nowline.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @nowline/embed 0.0.0-dev.
|
|
1
|
+
/*! @nowline/embed 0.0.0-dev.20261019064527.g87aafc2 sha=87aafc2 built=2026-10-19T06:39:09Z */
|
|
2
2
|
"use strict";var nowline=(()=>{var EN=Object.create;var Os=Object.defineProperty;var wN=Object.getOwnPropertyDescriptor;var TN=Object.getOwnPropertyNames;var vN=Object.getPrototypeOf,_N=Object.prototype.hasOwnProperty;var AN=(e,t,n)=>t in e?Os(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var kN=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var Ds=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},_p=(e,t)=>{for(var n in t)Os(e,n,{get:t[n],enumerable:!0})},Vx=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of TN(t))!_N.call(e,i)&&i!==n&&Os(e,i,{get:()=>t[i],enumerable:!(r=wN(t,i))||r.enumerable});return e};var Ap=(e,t,n)=>(n=e!=null?EN(vN(e)):{},Vx(t||!e||!e.__esModule?Os(n,"default",{value:e,enumerable:!0}):n,e)),IN=e=>Vx(Os({},"__esModule",{value:!0}),e);var B=(e,t,n)=>AN(e,typeof t!="symbol"?t+"":t,n);var qh=Ds(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0});var Yh;function Vh(){if(Yh===void 0)throw new Error("No runtime abstraction layer installed");return Yh}(function(e){function t(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Yh=n}e.install=t})(Vh||(Vh={}));Kh.default=Vh});var Zh=Ds(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.boolean=SD;Ln.string=y_;Ln.number=ND;Ln.error=LD;Ln.func=PD;Ln.array=x_;Ln.stringArray=$D;function SD(e){return e===!0||e===!1}function y_(e){return typeof e=="string"||e instanceof String}function ND(e){return typeof e=="number"||e instanceof Number}function LD(e){return e instanceof Error}function PD(e){return typeof e=="function"}function x_(e){return Array.isArray(e)}function $D(e){return x_(e)&&e.every(t=>y_(t))}});var em=Ds(Tr=>{"use strict";var CD=Tr&&Tr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tr,"__esModule",{value:!0});Tr.Emitter=Tr.Event=void 0;var OD=CD(qh()),E_;(function(e){let t={dispose(){}};e.None=function(){return t}})(E_||(Tr.Event=E_={}));var Jh=class{constructor(){B(this,"_callbacks");B(this,"_contexts")}add(t,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(t,n)})}remove(t,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===t)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...t){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{n.push(r[o].apply(i[o],t))}catch(a){(0,OD.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},ku=class ku{constructor(t){B(this,"_options");B(this,"_event");B(this,"_callbacks");this._options=t}get event(){return this._event||(this._event=(t,n,r)=>{this._callbacks||(this._callbacks=new Jh),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),i.dispose=ku._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};B(ku,"_noop",function(){});var Qh=ku;Tr.Emitter=Qh});var w_=Ds(wt=>{"use strict";var DD=wt&&wt.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),MD=wt&&wt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),FD=wt&&wt.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&DD(n,t,r[i]);return MD(n,t),n}})(),BD=wt&&wt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wt,"__esModule",{value:!0});wt.CancellationTokenSource=wt.CancellationToken=void 0;var WD=BD(qh()),UD=FD(Zh()),tm=em(),Iu;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:tm.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:tm.Event.None});function t(n){let r=n;return r&&(r===e.None||r===e.Cancelled||UD.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}e.is=t})(Iu||(wt.CancellationToken=Iu={}));var XD=Object.freeze(function(e,t){let n=(0,WD.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}),Ru=class{constructor(){B(this,"_isCancelled",!1);B(this,"_emitter")}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?XD:(this._emitter||(this._emitter=new tm.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},nm=class{constructor(){B(this,"_token")}get token(){return this._token||(this._token=new Ru),this._token}cancel(){this._token?this._token.cancel():this._token=Iu.Cancelled}dispose(){this._token?this._token instanceof Ru&&this._token.dispose():this._token=Iu.None}};wt.CancellationTokenSource=nm});var v_=Ds(te=>{"use strict";var GD=te&&te.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),zD=te&&te.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),HD=te&&te.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&GD(n,t,r[i]);return zD(n,t),n}})();Object.defineProperty(te,"__esModule",{value:!0});te.Message=te.NotificationType9=te.NotificationType8=te.NotificationType7=te.NotificationType6=te.NotificationType5=te.NotificationType4=te.NotificationType3=te.NotificationType2=te.NotificationType1=te.NotificationType0=te.NotificationType=te.RequestType9=te.RequestType8=te.RequestType7=te.RequestType6=te.RequestType5=te.RequestType4=te.RequestType3=te.RequestType2=te.RequestType1=te.RequestType=te.RequestType0=te.AbstractMessageSignature=te.ParameterStructures=te.ResponseError=te.ErrorCodes=void 0;var di=HD(Zh()),rm;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(rm||(te.ErrorCodes=rm={}));var im=class e extends Error{constructor(n,r,i){super(r);B(this,"code");B(this,"data");this.code=di.number(n)?n:rm.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,e.prototype)}toJson(){let n={code:this.code,message:this.message};return this.data!==void 0&&(n.data=this.data),n}};te.ResponseError=im;var Yt=class Yt{constructor(t){B(this,"kind");this.kind=t}static is(t){return t===Yt.auto||t===Yt.byName||t===Yt.byPosition}toString(){return this.kind}};B(Yt,"auto",new Yt("auto")),B(Yt,"byPosition",new Yt("byPosition")),B(Yt,"byName",new Yt("byName"));var vr=Yt;te.ParameterStructures=vr;var $e=class{constructor(t,n){B(this,"method");B(this,"numberOfParams");this.method=t,this.numberOfParams=n}get parameterStructures(){return vr.auto}};te.AbstractMessageSignature=$e;var om=class extends $e{constructor(n){super(n,0);B(this,"_")}};te.RequestType0=om;var sm=class extends $e{constructor(n,r=vr.auto){super(n,1);B(this,"_parameterStructures");B(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.RequestType=sm;var am=class extends $e{constructor(n,r=vr.auto){super(n,1);B(this,"_parameterStructures");B(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.RequestType1=am;var lm=class extends $e{constructor(n){super(n,2);B(this,"_")}};te.RequestType2=lm;var cm=class extends $e{constructor(n){super(n,3);B(this,"_")}};te.RequestType3=cm;var um=class extends $e{constructor(n){super(n,4);B(this,"_")}};te.RequestType4=um;var fm=class extends $e{constructor(n){super(n,5);B(this,"_")}};te.RequestType5=fm;var dm=class extends $e{constructor(n){super(n,6);B(this,"_")}};te.RequestType6=dm;var pm=class extends $e{constructor(n){super(n,7);B(this,"_")}};te.RequestType7=pm;var hm=class extends $e{constructor(n){super(n,8);B(this,"_")}};te.RequestType8=hm;var mm=class extends $e{constructor(n){super(n,9);B(this,"_")}};te.RequestType9=mm;var gm=class extends $e{constructor(n,r=vr.auto){super(n,1);B(this,"_parameterStructures");B(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.NotificationType=gm;var ym=class extends $e{constructor(n){super(n,0);B(this,"_")}};te.NotificationType0=ym;var xm=class extends $e{constructor(n,r=vr.auto){super(n,1);B(this,"_parameterStructures");B(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.NotificationType1=xm;var Em=class extends $e{constructor(n){super(n,2);B(this,"_")}};te.NotificationType2=Em;var wm=class extends $e{constructor(n){super(n,3);B(this,"_")}};te.NotificationType3=wm;var Tm=class extends $e{constructor(n){super(n,4);B(this,"_")}};te.NotificationType4=Tm;var vm=class extends $e{constructor(n){super(n,5);B(this,"_")}};te.NotificationType5=vm;var _m=class extends $e{constructor(n){super(n,6);B(this,"_")}};te.NotificationType6=_m;var Am=class extends $e{constructor(n){super(n,7);B(this,"_")}};te.NotificationType7=Am;var km=class extends $e{constructor(n){super(n,8);B(this,"_")}};te.NotificationType8=km;var Im=class extends $e{constructor(n){super(n,9);B(this,"_")}};te.NotificationType9=Im;var T_;(function(e){function t(i){let o=i;return o&&di.string(o.method)&&(di.string(o.id)||di.number(o.id))}e.isRequest=t;function n(i){let o=i;return o&&di.string(o.method)&&i.id===void 0}e.isNotification=n;function r(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(di.string(o.id)||di.number(o.id)||o.id===null)}e.isResponse=r})(T_||(te.Message=T_={}))});var Vk={};_p(Vk,{nodeReadFile:()=>$F});async function $F(){throw new Error("nowline: filesystem readers are unavailable in the browser embed")}var Kk=kN(()=>{});var oX={};_p(oX,{EmbedRenderError:()=>Ol,__resetForTests:()=>iX,init:()=>zx,initialize:()=>eX,parse:()=>nX,render:()=>tX,run:()=>rX,sha:()=>JU,version:()=>ZU});function Xe(e){return typeof e=="object"&&e!==null&&typeof e.$type=="string"}function it(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"ref"in e}function $t(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"items"in e}function Kx(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&typeof e.type=="string"&&typeof e.path=="string"}function Bi(e){return typeof e=="object"&&e!==null&&typeof e.info=="object"&&typeof e.message=="string"}var Fi=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(t){let n=this.types[t.container.$type];if(!n)throw new Error(`Type ${t.container.$type||"undefined"} not found.`);let r=n.properties[t.property]?.referenceType;if(!r)throw new Error(`Property ${t.property||"undefined"} of type ${t.container.$type} is not a reference.`);return r}getTypeMetaData(t){let n=this.types[t];return n||{name:t,properties:{},superTypes:[]}}isInstance(t,n){return Xe(t)&&this.isSubtype(t.$type,n)}isSubtype(t,n){if(t===n)return!0;let r=this.subtypes[t];r||(r=this.subtypes[t]={});let i=r[n];if(i!==void 0)return i;{let o=this.types[t],s=o?o.superTypes.some(a=>this.isSubtype(a,n)):!1;return r[n]=s,s}}getAllSubTypes(t){let n=this.allSubtypes[t];if(n)return n;{let r=this.getAllTypes(),i=[];for(let o of r)this.isSubtype(o,t)&&i.push(o);return this.allSubtypes[t]=i,i}}isComplete(t){let n=this.getTypeMetaData(t.$type);for(let r of Object.keys(n.properties)){let i=n.properties[r];if(i.optional)continue;let o=t[i.name];if(o==null)return!1}return!0}};function Jn(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}function Wl(e){return typeof e=="object"&&e!==null&&typeof e.tokenType=="object"}function Ul(e){return Jn(e)&&typeof e.fullText=="string"}var Ut=class e{constructor(t,n){this.startFn=t,this.nextFn=n}iterator(){let t={state:this.startFn(),next:()=>this.nextFn(t.state),[Symbol.iterator]:()=>t};return t}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let t=this.iterator(),n=0,r=t.next();for(;!r.done;)n++,r=t.next();return n}toArray(){let t=[],n=this.iterator(),r;do r=n.next(),r.value!==void 0&&t.push(r.value);while(!r.done);return t}toSet(){return new Set(this)}toMap(t,n){let r=this.map(i=>[t?t(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(t){return new e(()=>({first:this.startFn(),firstDone:!1,iterator:t[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do if(r=this.nextFn(n.first),!r.done)return r;while(!r.done);n.firstDone=!0}do if(r=n.iterator.next(),!r.done)return r;while(!r.done);return gt})}join(t=","){let n=this.iterator(),r="",i,o=!1;do i=n.next(),i.done||(o&&(r+=t),r+=bN(i.value)),o=!0;while(!i.done);return r}indexOf(t,n=0){let r=this.iterator(),i=0,o=r.next();for(;!o.done;){if(i>=n&&o.value===t)return i;o=r.next(),i++}return-1}every(t){let n=this.iterator(),r=n.next();for(;!r.done;){if(!t(r.value))return!1;r=n.next()}return!0}some(t){let n=this.iterator(),r=n.next();for(;!r.done;){if(t(r.value))return!0;r=n.next()}return!1}forEach(t){let n=this.iterator(),r=0,i=n.next();for(;!i.done;)t(i.value,r),i=n.next(),r++}map(t){return new e(this.startFn,n=>{let{done:r,value:i}=this.nextFn(n);return r?gt:{done:!1,value:t(i)}})}filter(t){return new e(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&t(r.value))return r;while(!r.done);return gt})}nonNullable(){return this.filter(t=>t!=null)}reduce(t,n){let r=this.iterator(),i=n,o=r.next();for(;!o.done;)i===void 0?i=o.value:i=t(i,o.value),o=r.next();return i}reduceRight(t,n){return this.recursiveReduce(this.iterator(),t,n)}recursiveReduce(t,n,r){let i=t.next();if(i.done)return r;let o=this.recursiveReduce(t,n,r);return o===void 0?i.value:n(o,i.value)}find(t){let n=this.iterator(),r=n.next();for(;!r.done;){if(t(r.value))return r.value;r=n.next()}}findIndex(t){let n=this.iterator(),r=0,i=n.next();for(;!i.done;){if(t(i.value))return r;i=n.next(),r++}return-1}includes(t){let n=this.iterator(),r=n.next();for(;!r.done;){if(r.value===t)return!0;r=n.next()}return!1}flatMap(t){return new e(()=>({this:this.startFn()}),n=>{do{if(n.iterator){let o=n.iterator.next();if(o.done)n.iterator=void 0;else return o}let{done:r,value:i}=this.nextFn(n.this);if(!r){let o=t(i);if(Xl(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(n.iterator);return gt})}flat(t){if(t===void 0&&(t=1),t<=0)return this;let n=t>1?this.flat(t-1):this;return new e(()=>({this:n.startFn()}),r=>{do{if(r.iterator){let s=r.iterator.next();if(s.done)r.iterator=void 0;else return s}let{done:i,value:o}=n.nextFn(r.this);if(!i)if(Xl(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(r.iterator);return gt})}head(){let n=this.iterator().next();if(!n.done)return n.value}tail(t=1){return new e(()=>{let n=this.startFn();for(let r=0;r<t;r++)if(this.nextFn(n).done)return n;return n},this.nextFn)}limit(t){return new e(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>t?gt:this.nextFn(n.state)))}distinct(t){return new e(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do if(r=this.nextFn(n.internalState),!r.done){let i=t?t(r.value):r.value;if(!n.set.has(i))return n.set.add(i),r}while(!r.done);return gt})}exclude(t,n){let r=new Set;for(let i of t){let o=n?n(i):i;r.add(o)}return this.filter(i=>{let o=n?n(i):i;return!r.has(o)})}};function bN(e){return typeof e=="string"?e:typeof e>"u"?"undefined":typeof e.toString=="function"?e.toString():Object.prototype.toString.call(e)}function Xl(e){return!!e&&typeof e[Symbol.iterator]=="function"}var zl=new Ut(()=>{},()=>gt),gt=Object.freeze({done:!0,value:void 0});function ye(...e){if(e.length===1){let t=e[0];if(t instanceof Ut)return t;if(Xl(t))return new Ut(()=>t[Symbol.iterator](),n=>n.next());if(typeof t.length=="number")return new Ut(()=>({index:0}),n=>n.index<t.length?{done:!1,value:t[n.index++]}:gt)}return e.length>1?new Ut(()=>({collIndex:0,arrIndex:0}),t=>{do{if(t.iterator){let n=t.iterator.next();if(!n.done)return n;t.iterator=void 0}if(t.array){if(t.arrIndex<t.array.length)return{done:!1,value:t.array[t.arrIndex++]};t.array=void 0,t.arrIndex=0}if(t.collIndex<e.length){let n=e[t.collIndex++];Xl(n)?t.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(t.array=n)}}while(t.iterator||t.array||t.collIndex<e.length);return gt}):zl}var Qn=class extends Ut{constructor(t,n,r){super(()=>({iterators:r?.includeRoot?[[t][Symbol.iterator]()]:[n(t)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){let s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(n(s.value)[Symbol.iterator]()),s}return gt})}iterator(){let t={state:this.startFn(),next:()=>this.nextFn(t.state),prune:()=>{t.state.pruned=!0},[Symbol.iterator]:()=>t};return t}},Gl;(function(e){function t(o){return o.reduce((s,a)=>s+a,0)}e.sum=t;function n(o){return o.reduce((s,a)=>s*a,0)}e.product=n;function r(o){return o.reduce((s,a)=>Math.min(s,a))}e.min=r;function i(o){return o.reduce((s,a)=>Math.max(s,a))}e.max=i})(Gl||(Gl={}));function Hl(e,t={}){for(let[n,r]of Object.entries(e))n.startsWith("$")||(Array.isArray(r)?r.forEach((i,o)=>{Xe(i)&&(i.$container=e,i.$containerProperty=n,i.$containerIndex=o,t.deep&&Hl(i,t))}):Xe(r)&&(r.$container=e,r.$containerProperty=n,t.deep&&Hl(r,t)))}function Wi(e,t){let n=e;for(;n;){if(t(n))return n;n=n.$container}}function at(e){let n=Ms(e).$document;if(!n)throw new Error("AST node has no document.");return n}function Ms(e){for(;e.$container;)e=e.$container;return e}function Ip(e){return it(e)?e.ref?[e.ref]:[]:$t(e)?e.items.map(t=>t.ref):[]}function jl(e,t){if(!e)throw new Error("Node must be an AstNode.");let n=t?.range;return new Ut(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){let i=r.keys[r.keyIndex];if(!i.startsWith("$")){let o=e[i];if(Xe(o)){if(r.keyIndex++,kp(o,n))return{done:!1,value:o}}else if(Array.isArray(o)){for(;r.arrayIndex<o.length;){let s=r.arrayIndex++,a=o[s];if(Xe(a)&&kp(a,n))return{done:!1,value:a}}r.arrayIndex=0}}r.keyIndex++}return gt})}function rn(e,t){if(!e)throw new Error("Root node must be an AstNode.");return new Qn(e,n=>jl(n,t))}function yt(e,t){if(e){if(t?.range&&!kp(e,t.range))return new Qn(e,()=>[])}else throw new Error("Root node must be an AstNode.");return new Qn(e,n=>jl(n,t),{includeRoot:!0})}function kp(e,t){if(!t)return!0;let n=e.$cstNode?.range;return n?Jx(n,t):!1}function Xr(e){return new Ut(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndex<t.keys.length;){let n=t.keys[t.keyIndex];if(!n.startsWith("$")){let r=e[n];if(it(r)||$t(r))return t.keyIndex++,{done:!1,value:{reference:r,container:e,property:n}};if(Array.isArray(r)){for(;t.arrayIndex<r.length;){let i=t.arrayIndex++,o=r[i];if(it(o)||$t(o))return{done:!1,value:{reference:o,container:e,property:n,index:i}}}t.arrayIndex=0}}t.keyIndex++}return gt})}function qx(e,t){let n=e.getTypeMetaData(t.$type),r=t;for(let i of Object.values(n.properties))i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=Zx(i.defaultValue))}function Zx(e){return Array.isArray(e)?[...e.map(Zx)]:e}var Rt={$type:"AbstractElement",cardinality:"cardinality"};function rc(e){return he.isInstance(e,Rt.$type)}var ql={$type:"AbstractParserRule"};function tr(e){return he.isInstance(e,ql.$type)}var Yl={$type:"AbstractRule"};var Xt={$type:"AbstractType"};var zr={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function nr(e){return he.isInstance(e,zr.$type)}var Zl={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Dp(e){return he.isInstance(e,Zl.$type)}var Qx={$type:"ArrayLiteral",elements:"elements"};var bp={$type:"ArrayType",elementType:"elementType"};function iE(e){return he.isInstance(e,bp.$type)}var Hr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function sn(e){return he.isInstance(e,Hr.$type)}var Sp={$type:"BooleanLiteral",true:"true"};function oE(e){return he.isInstance(e,Sp.$type)}var jr={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function sE(e){return he.isInstance(e,jr.$type)}var Ui={$type:"Condition"};var Jl={$type:"Conjunction",left:"left",right:"right"};function aE(e){return he.isInstance(e,Jl.$type)}var Yr={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function an(e){return he.isInstance(e,Yr.$type)}var Ql={$type:"Disjunction",left:"left",right:"right"};function lE(e){return he.isInstance(e,Ql.$type)}var Np={$type:"EndOfFile",cardinality:"cardinality"};function cE(e){return he.isInstance(e,Np.$type)}var Gr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};var eE={$type:"GrammarImport",path:"path"};var Xi={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Vr(e){return he.isInstance(e,Xi.$type)}var Lp={$type:"InferredType",name:"name"};function ic(e){return he.isInstance(e,Lp.$type)}var yn={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function Kr(e){return he.isInstance(e,yn.$type)}var Rp={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};var tE={$type:"InfixRuleOperators",precedences:"precedences"};var Us={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function uE(e){return he.isInstance(e,Us.$type)}var Xs={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Gt(e){return he.isInstance(e,Xs.$type)}var Vl={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};var Gi={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function fE(e){return he.isInstance(e,Gi.$type)}var Pp={$type:"Negation",value:"value"};function dE(e){return he.isInstance(e,Pp.$type)}var nE={$type:"NumberLiteral",value:"value"};var Kl={$type:"Parameter",name:"name"};var $p={$type:"ParameterReference",parameter:"parameter"};function pE(e){return he.isInstance(e,$p.$type)}var on={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function lt(e){return he.isInstance(e,on.$type)}var ec={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function hE(e){return he.isInstance(e,ec.$type)}var zi={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function mE(e){return he.isInstance(e,zi.$type)}var Cp={$type:"ReturnType",name:"name"};function gE(e){return he.isInstance(e,Cp.$type)}var Hi={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function ln(e){return he.isInstance(e,Hi.$type)}var Gs={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function Mp(e){return he.isInstance(e,Gs.$type)}var rE={$type:"StringLiteral",value:"value"};var ji={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function yE(e){return he.isInstance(e,ji.$type)}var Ct={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};var Yi={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function xE(e){return he.isInstance(e,Yi.$type)}var er={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function xt(e){return he.isInstance(e,er.$type)}var Vi={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function Fp(e){return he.isInstance(e,Vi.$type)}var tc={$type:"Type",name:"name",type:"type"};function Bp(e){return he.isInstance(e,tc.$type)}var Fs={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};var Bs={$type:"TypeDefinition"};var Op={$type:"UnionType",types:"types"};function EE(e){return he.isInstance(e,Op.$type)}var nc={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Wp(e){return he.isInstance(e,nc.$type)}var Ki={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function wE(e){return he.isInstance(e,Ki.$type)}var Ws={$type:"ValueLiteral"};var zs={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function TE(e){return he.isInstance(e,zs.$type)}var Hs=class extends Fi{constructor(){super(...arguments),this.types={AbstractElement:{name:Rt.$type,properties:{cardinality:{name:Rt.cardinality,optional:!0}},superTypes:[]},AbstractParserRule:{name:ql.$type,properties:{},superTypes:[Yl.$type,Xt.$type]},AbstractRule:{name:Yl.$type,properties:{},superTypes:[]},AbstractType:{name:Xt.$type,properties:{},superTypes:[]},Action:{name:zr.$type,properties:{cardinality:{name:zr.cardinality,optional:!0},feature:{name:zr.feature,optional:!0},inferredType:{name:zr.inferredType,optional:!0},operator:{name:zr.operator,optional:!0},type:{name:zr.type,referenceType:Xt.$type,optional:!0}},superTypes:[Rt.$type]},Alternatives:{name:Zl.$type,properties:{cardinality:{name:Zl.cardinality,optional:!0},elements:{name:Zl.elements,defaultValue:[]}},superTypes:[Rt.$type]},ArrayLiteral:{name:Qx.$type,properties:{elements:{name:Qx.elements,defaultValue:[]}},superTypes:[Ws.$type]},ArrayType:{name:bp.$type,properties:{elementType:{name:bp.elementType}},superTypes:[Bs.$type]},Assignment:{name:Hr.$type,properties:{cardinality:{name:Hr.cardinality,optional:!0},feature:{name:Hr.feature},operator:{name:Hr.operator},predicate:{name:Hr.predicate,optional:!0},terminal:{name:Hr.terminal}},superTypes:[Rt.$type]},BooleanLiteral:{name:Sp.$type,properties:{true:{name:Sp.true,defaultValue:!1}},superTypes:[Ui.$type,Ws.$type]},CharacterRange:{name:jr.$type,properties:{cardinality:{name:jr.cardinality,optional:!0},left:{name:jr.left},lookahead:{name:jr.lookahead,optional:!0},parenthesized:{name:jr.parenthesized,defaultValue:!1,optional:!0},right:{name:jr.right,optional:!0}},superTypes:[Ct.$type]},Condition:{name:Ui.$type,properties:{},superTypes:[]},Conjunction:{name:Jl.$type,properties:{left:{name:Jl.left},right:{name:Jl.right}},superTypes:[Ui.$type]},CrossReference:{name:Yr.$type,properties:{cardinality:{name:Yr.cardinality,optional:!0},deprecatedSyntax:{name:Yr.deprecatedSyntax,defaultValue:!1},isMulti:{name:Yr.isMulti,defaultValue:!1},terminal:{name:Yr.terminal,optional:!0},type:{name:Yr.type,referenceType:Xt.$type}},superTypes:[Rt.$type]},Disjunction:{name:Ql.$type,properties:{left:{name:Ql.left},right:{name:Ql.right}},superTypes:[Ui.$type]},EndOfFile:{name:Np.$type,properties:{cardinality:{name:Np.cardinality,optional:!0}},superTypes:[Rt.$type]},Grammar:{name:Gr.$type,properties:{imports:{name:Gr.imports,defaultValue:[]},interfaces:{name:Gr.interfaces,defaultValue:[]},isDeclared:{name:Gr.isDeclared,defaultValue:!1},name:{name:Gr.name,optional:!0},rules:{name:Gr.rules,defaultValue:[]},types:{name:Gr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:eE.$type,properties:{path:{name:eE.path}},superTypes:[]},Group:{name:Xi.$type,properties:{cardinality:{name:Xi.cardinality,optional:!0},elements:{name:Xi.elements,defaultValue:[]},guardCondition:{name:Xi.guardCondition,optional:!0},predicate:{name:Xi.predicate,optional:!0}},superTypes:[Rt.$type]},InferredType:{name:Lp.$type,properties:{name:{name:Lp.name}},superTypes:[Xt.$type]},InfixRule:{name:yn.$type,properties:{call:{name:yn.call},dataType:{name:yn.dataType,optional:!0},inferredType:{name:yn.inferredType,optional:!0},name:{name:yn.name},operators:{name:yn.operators},parameters:{name:yn.parameters,defaultValue:[]},returnType:{name:yn.returnType,referenceType:Xt.$type,optional:!0}},superTypes:[ql.$type]},InfixRuleOperatorList:{name:Rp.$type,properties:{associativity:{name:Rp.associativity,optional:!0},operators:{name:Rp.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:tE.$type,properties:{precedences:{name:tE.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Us.$type,properties:{attributes:{name:Us.attributes,defaultValue:[]},name:{name:Us.name},superTypes:{name:Us.superTypes,defaultValue:[],referenceType:Xt.$type}},superTypes:[Xt.$type]},Keyword:{name:Xs.$type,properties:{cardinality:{name:Xs.cardinality,optional:!0},predicate:{name:Xs.predicate,optional:!0},value:{name:Xs.value}},superTypes:[Rt.$type]},NamedArgument:{name:Vl.$type,properties:{calledByName:{name:Vl.calledByName,defaultValue:!1},parameter:{name:Vl.parameter,referenceType:Kl.$type,optional:!0},value:{name:Vl.value}},superTypes:[]},NegatedToken:{name:Gi.$type,properties:{cardinality:{name:Gi.cardinality,optional:!0},lookahead:{name:Gi.lookahead,optional:!0},parenthesized:{name:Gi.parenthesized,defaultValue:!1,optional:!0},terminal:{name:Gi.terminal}},superTypes:[Ct.$type]},Negation:{name:Pp.$type,properties:{value:{name:Pp.value}},superTypes:[Ui.$type]},NumberLiteral:{name:nE.$type,properties:{value:{name:nE.value}},superTypes:[Ws.$type]},Parameter:{name:Kl.$type,properties:{name:{name:Kl.name}},superTypes:[]},ParameterReference:{name:$p.$type,properties:{parameter:{name:$p.parameter,referenceType:Kl.$type}},superTypes:[Ui.$type]},ParserRule:{name:on.$type,properties:{dataType:{name:on.dataType,optional:!0},definition:{name:on.definition},entry:{name:on.entry,defaultValue:!1},fragment:{name:on.fragment,defaultValue:!1},inferredType:{name:on.inferredType,optional:!0},name:{name:on.name},parameters:{name:on.parameters,defaultValue:[]},returnType:{name:on.returnType,referenceType:Xt.$type,optional:!0}},superTypes:[ql.$type]},ReferenceType:{name:ec.$type,properties:{isMulti:{name:ec.isMulti,defaultValue:!1},referenceType:{name:ec.referenceType}},superTypes:[Bs.$type]},RegexToken:{name:zi.$type,properties:{cardinality:{name:zi.cardinality,optional:!0},lookahead:{name:zi.lookahead,optional:!0},parenthesized:{name:zi.parenthesized,defaultValue:!1,optional:!0},regex:{name:zi.regex}},superTypes:[Ct.$type]},ReturnType:{name:Cp.$type,properties:{name:{name:Cp.name}},superTypes:[]},RuleCall:{name:Hi.$type,properties:{arguments:{name:Hi.arguments,defaultValue:[]},cardinality:{name:Hi.cardinality,optional:!0},predicate:{name:Hi.predicate,optional:!0},rule:{name:Hi.rule,referenceType:Yl.$type}},superTypes:[Rt.$type]},SimpleType:{name:Gs.$type,properties:{primitiveType:{name:Gs.primitiveType,optional:!0},stringType:{name:Gs.stringType,optional:!0},typeRef:{name:Gs.typeRef,referenceType:Xt.$type,optional:!0}},superTypes:[Bs.$type]},StringLiteral:{name:rE.$type,properties:{value:{name:rE.value}},superTypes:[Ws.$type]},TerminalAlternatives:{name:ji.$type,properties:{cardinality:{name:ji.cardinality,optional:!0},elements:{name:ji.elements,defaultValue:[]},lookahead:{name:ji.lookahead,optional:!0},parenthesized:{name:ji.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Ct.$type]},TerminalElement:{name:Ct.$type,properties:{cardinality:{name:Ct.cardinality,optional:!0},lookahead:{name:Ct.lookahead,optional:!0},parenthesized:{name:Ct.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Rt.$type]},TerminalGroup:{name:Yi.$type,properties:{cardinality:{name:Yi.cardinality,optional:!0},elements:{name:Yi.elements,defaultValue:[]},lookahead:{name:Yi.lookahead,optional:!0},parenthesized:{name:Yi.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Ct.$type]},TerminalRule:{name:er.$type,properties:{definition:{name:er.definition},fragment:{name:er.fragment,defaultValue:!1},hidden:{name:er.hidden,defaultValue:!1},name:{name:er.name},type:{name:er.type,optional:!0}},superTypes:[Yl.$type]},TerminalRuleCall:{name:Vi.$type,properties:{cardinality:{name:Vi.cardinality,optional:!0},lookahead:{name:Vi.lookahead,optional:!0},parenthesized:{name:Vi.parenthesized,defaultValue:!1,optional:!0},rule:{name:Vi.rule,referenceType:er.$type}},superTypes:[Ct.$type]},Type:{name:tc.$type,properties:{name:{name:tc.name},type:{name:tc.type}},superTypes:[Xt.$type]},TypeAttribute:{name:Fs.$type,properties:{defaultValue:{name:Fs.defaultValue,optional:!0},isOptional:{name:Fs.isOptional,defaultValue:!1},name:{name:Fs.name},type:{name:Fs.type}},superTypes:[]},TypeDefinition:{name:Bs.$type,properties:{},superTypes:[]},UnionType:{name:Op.$type,properties:{types:{name:Op.types,defaultValue:[]}},superTypes:[Bs.$type]},UnorderedGroup:{name:nc.$type,properties:{cardinality:{name:nc.cardinality,optional:!0},elements:{name:nc.elements,defaultValue:[]}},superTypes:[Rt.$type]},UntilToken:{name:Ki.$type,properties:{cardinality:{name:Ki.cardinality,optional:!0},lookahead:{name:Ki.lookahead,optional:!0},parenthesized:{name:Ki.parenthesized,defaultValue:!1,optional:!0},terminal:{name:Ki.terminal}},superTypes:[Ct.$type]},ValueLiteral:{name:Ws.$type,properties:{},superTypes:[]},Wildcard:{name:zs.$type,properties:{cardinality:{name:zs.cardinality,optional:!0},lookahead:{name:zs.lookahead,optional:!0},parenthesized:{name:zs.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Ct.$type]}}}},he=new Hs;function js(e){return new Qn(e,t=>Jn(t)?t.content:[],{includeRoot:!0})}function AE(e,t){for(;e.container;)if(e=e.container,e===t)return!0;return!1}function kE(e){return{start:{line:e.startLine-1,character:e.startColumn-1},end:{line:e.endLine-1,character:e.endColumn}}}function Ys(e){let{startOffset:t,endOffset:n}=e;return typeof t=="number"&&Number.isFinite(t)&&t>=0&&typeof n=="number"&&Number.isFinite(n)&&n>=t}function qi(e){if(!e)return;let{offset:t,end:n,range:r}=e;return{range:r,offset:t,end:n,length:n-t}}var xn;(function(e){e[e.Before=0]="Before",e[e.After=1]="After",e[e.OverlapFront=2]="OverlapFront",e[e.OverlapBack=3]="OverlapBack",e[e.Inside=4]="Inside",e[e.Outside=5]="Outside"})(xn||(xn={}));function SN(e,t){if(e.end.line<t.start.line||e.end.line===t.start.line&&e.end.character<=t.start.character)return xn.Before;if(e.start.line>t.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return xn.After;let n=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character,r=e.end.line<t.end.line||e.end.line===t.end.line&&e.end.character<=t.end.character;return n&&r?xn.Inside:n?xn.OverlapBack:r?xn.OverlapFront:xn.Outside}function Jx(e,t){return SN(e,t)>xn.After}var IE=/^[\w\p{L}]$/u;function RE(e,t){if(e){let n=NN(e,!0);if(n&&_E(n,t))return n;if(Ul(e)){let r=e.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){let o=e.content[i];if(_E(o,t))return o}}}}function _E(e,t){return Wl(e)&&t.includes(e.tokenType.name)}function NN(e,t=!0){for(;e.container;){let n=e.container,r=n.content.indexOf(e);for(;r>0;){r--;let i=n.content[r];if(t||!i.hidden)return i}e=n}}var uc={};_p(uc,{findAssignment:()=>Qp,findNameAssignment:()=>lc,findNodeForKeyword:()=>Zp,findNodeForProperty:()=>Qs,findNodesForKeyword:()=>MN,findNodesForKeywordInternal:()=>Jp,findNodesForProperty:()=>Kp,getActionAtElement:()=>OE,getActionType:()=>ME,getAllReachableRules:()=>Js,getAllRulesUsedForCrossReferences:()=>DN,getCrossReferenceTerminal:()=>Yp,getEntryRule:()=>LE,getExplicitRuleType:()=>cc,getHiddenRules:()=>PE,getRuleType:()=>eh,getRuleTypeName:()=>XN,getTypeName:()=>ir,isArrayCardinality:()=>BN,isArrayOperator:()=>WN,isCommentTerminal:()=>Vp,isDataType:()=>UN,isDataTypeRule:()=>ea,isOptionalCardinality:()=>FN,terminalRegex:()=>Ji});var Vs=class extends Error{constructor(t,n){let r=typeof n=="string"?n:n();super(t?`${r} at ${t.range.start.line}:${t.range.start.character}`:r)}};function rr(e,t="Error: Got unexpected value."){throw new Error(typeof t=="string"?t:t())}function ie(e){return e.charCodeAt(0)}function oc(e,t){Array.isArray(e)?e.forEach(function(n){t.push(n)}):t.push(e)}function Zi(e,t){if(e[t]===!0)throw"duplicate flag "+t;let n=e[t];e[t]=!0}function qr(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}function Ks(){throw Error("Internal Error - Should never get here!")}function Up(e){return e.type==="Character"}var qs=[];for(let e=ie("0");e<=ie("9");e++)qs.push(e);var Zs=[ie("_")].concat(qs);for(let e=ie("a");e<=ie("z");e++)Zs.push(e);for(let e=ie("A");e<=ie("Z");e++)Zs.push(e);var Xp=[ie(" "),ie("\f"),ie(`
|
|
3
3
|
`),ie("\r"),ie(" "),ie("\v"),ie(" "),ie("\xA0"),ie("\u1680"),ie("\u2000"),ie("\u2001"),ie("\u2002"),ie("\u2003"),ie("\u2004"),ie("\u2005"),ie("\u2006"),ie("\u2007"),ie("\u2008"),ie("\u2009"),ie("\u200A"),ie("\u2028"),ie("\u2029"),ie("\u202F"),ie("\u205F"),ie("\u3000"),ie("\uFEFF")];var LN=/[0-9a-fA-F]/,sc=/[0-9]/,PN=/[1-9]/,Zr=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(t){this.idx=t.idx,this.input=t.input,this.groupIdx=t.groupIdx}pattern(t){this.idx=0,this.input=t,this.groupIdx=0,this.consumeChar("/");let n=this.disjunction();this.consumeChar("/");let r={type:"Flags",loc:{begin:this.idx,end:t.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Zi(r,"global");break;case"i":Zi(r,"ignoreCase");break;case"m":Zi(r,"multiLine");break;case"u":Zi(r,"unicode");break;case"y":Zi(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:n,loc:this.loc(0)}}disjunction(){let t=[],n=this.idx;for(t.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),t.push(this.alternative());return{type:"Disjunction",value:t,loc:this.loc(n)}}alternative(){let t=[],n=this.idx;for(;this.isTerm();)t.push(this.term());return{type:"Alternative",value:t,loc:this.loc(n)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let t=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(t)};case"$":return{type:"EndAnchor",loc:this.loc(t)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(t)};case"B":return{type:"NonWordBoundary",loc:this.loc(t)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let n;switch(this.popChar()){case"=":n="Lookahead";break;case"!":n="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":n="Lookbehind";break;case"!":n="NegativeLookbehind"}break}}qr(n);let r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(t)}}return Ks()}quantifier(t=!1){let n,r=this.idx;switch(this.popChar()){case"*":n={atLeast:0,atMost:1/0};break;case"+":n={atLeast:1,atMost:1/0};break;case"?":n={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":n={atLeast:i,atMost:i};break;case",":let o;this.isDigit()?(o=this.integerIncludingZero(),n={atLeast:i,atMost:o}):n={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(t===!0&&n===void 0)return;qr(n);break}if(!(t===!0&&n===void 0)&&qr(n))return this.peekChar(0)==="?"?(this.consumeChar("?"),n.greedy=!1):n.greedy=!0,n.type="Quantifier",n.loc=this.loc(r),n}atom(){let t,n=this.idx;switch(this.peekChar()){case".":t=this.dotAll();break;case"\\":t=this.atomEscape();break;case"[":t=this.characterClass();break;case"(":t=this.group();break}return t===void 0&&this.isPatternCharacter()&&(t=this.patternCharacter()),qr(t)?(t.loc=this.loc(n),this.isQuantifier()&&(t.quantifier=this.quantifier()),t):Ks()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ie(`
|
|
4
4
|
`),ie("\r"),ie("\u2028"),ie("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let t,n=!1;switch(this.popChar()){case"d":t=qs;break;case"D":t=qs,n=!0;break;case"s":t=Xp;break;case"S":t=Xp,n=!0;break;case"w":t=Zs;break;case"W":t=Zs,n=!0;break}return qr(t)?{type:"Set",value:t,complement:n}:Ks()}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=ie("\f");break;case"n":t=ie(`
|
|
@@ -2917,5 +2917,5 @@ ${n}`),this.inline?`{${i}}`:i}};function lM(e,t,n){if(e==="linkplain"||e==="link
|
|
|
2917
2917
|
`);)r--;for(;r>=0&&(t[r]===" "||t[r]===" ");)r--;return r<0||t[r]!=="\\"}},mR={parser:{TokenBuilder:()=>new by({indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[["[","]"]]}),Lexer:e=>new Ef(e),ParserConfig:()=>({maxLookahead:4}),ValueConverter:()=>new Ry},validation:{NowlineValidator:()=>new wd}};function Sy(e={}){let t=e.shared??Bo(xf(wf),lk),n=Bo(yf({shared:t}),ck,mR);return t.ServiceRegistry.register(n),hR(n),{shared:t,Nowline:n}}function Ny(e,t){return t.code===void 0?t.message:Qt(e,t.code,...t.args??[])}function Pi(e){let{content:t}=e,n=[...t.waves?.values()??[]];if(n.length===0)return;let r=new Map;n.forEach((u,f)=>{r.set(u.name,f+1)});let i=Ts(t),o=n.map(u=>gl(u,i)),s=new WeakMap,a=new WeakMap,c=u=>{let f=ld(u,r);for(let[d,p]of f.waveOf)s.set(d,p);for(let[d,p]of f.leadOf)a.set(d,p)};c([...t.swimlanes.values()]);for(let u of t.isolatedRegions)c([...u.content.swimlanes.values()]);let l=u=>Ve(u)?s.get(u):void 0;return{waves:n,index:r,floors:o,waveOf:s,leadOf:a,memberWave:l,isMember:(u,f)=>{let d=l(u);return d!==void 0&&(f===void 0||d===f)}}}var _l="en-US",r2={"en-US":{nowLabel:"now",quarterPrefix:"Q",waveHeldBy:"held by",waveNoItems:"no items",waveBackgroundItem:"Background (no wave)",waveLegendBackground:"Background work (not in a wave)",waveLegendBoundary:"Wave boundary",waveLegendPrefix:"Waves:",wavesDeclaredPlaceholder:"Waves declared: {names} \u2014 no items assigned yet"},fr:{nowLabel:"maint.",quarterPrefix:"T",waveHeldBy:"retenue par",waveNoItems:"aucun \xE9l\xE9ment",waveBackgroundItem:"Travail de fond (hors vague)",waveLegendBackground:"Travail de fond (dans aucune vague)",waveLegendBoundary:"Limite de vague",waveLegendPrefix:"Vagues\xA0:",wavesDeclaredPlaceholder:"Vagues d\xE9clar\xE9es\xA0: {names} \u2014 aucun \xE9l\xE9ment affect\xE9 pour l\u2019instant"}};function gR(e,t){return t??e??_l}function Gn(e){let t={};for(let n of i2(e)){let r=r2[n];if(r)for(let i of Object.keys(r))t[i]===void 0&&r[i]!==void 0&&(t[i]=r[i])}return t}function yR(e,t){return e.wavesDeclaredPlaceholder.replace("{names}",()=>t.join(", "))}function i2(e){let t=[],n=o2(e);for(;n.length>0;){t.includes(n)||t.push(n);let r=n.lastIndexOf("-");if(r<=0)break;n=n.slice(0,r)}return t.includes(_l)||t.push(_l),t}function o2(e){return e.split("-").map((n,r)=>r===0?n.toLowerCase():/^[a-zA-Z]{2}$/.test(n)?n.toUpperCase():n).join("-")}function Td(e){return e==="hide"||e==="show"}var xR={red:"#f87171",blue:"#60a5fa",yellow:"#facc15",green:"#34d399",orange:"#fb923c",purple:"#a78bfa",gray:"#94a3b8",navy:"#818cf8",white:"#e2e8f0"},zn={bg:"none",fg:"#e2e8f0",text:"#e2e8f0",border:"solid",icon:"none",shadow:"none",font:"sans",weight:"normal",italic:!1,textSize:"md",padding:"sm",spacing:"sm",headerHeight:"sm",cornerRadius:"sm",bracket:"none",capacityIcon:"multiplier"},Ly={name:"dark",surface:{page:"#0b1220",chart:"#111827",headerBox:"#1e293b"},entities:{roadmap:{...zn,headerHeight:"md",padding:"md"},swimlane:{...zn,fg:"#e2e8f0",text:"#e2e8f0",padding:"sm",spacing:"none",textSize:"sm"},item:{...zn,bg:"#0f172a",fg:"#94a3b8",text:"#e2e8f0",shadow:"subtle",cornerRadius:"sm"},parallel:{...zn,bg:"#8c84ff",bracket:"dashed",padding:"xs"},group:{...zn,bg:"#f0a832",bracket:"solid",padding:"xs",fg:"#94a3b8"},anchor:{...zn,bg:"#0b1220",fg:"#cbd5e1",text:"#cbd5e1",cornerRadius:"sm"},milestone:{...zn,bg:"#e2e8f0",fg:"#e2e8f0",text:"#0b1220",border:"solid"},footnote:{...zn,bg:"none",fg:"#94a3b8",text:"#e2e8f0",textSize:"sm"},label:{...zn,bg:"#1e293b",fg:"#94a3b8",text:"#e2e8f0",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#111827",bandOdd:"#0f172a",separator:"#1f2937",frameTabText:"#e2e8f0",frameTabMuted:"#94a3b8",border:"#334155",tabFill:"#1e293b",tabStroke:"#475569",tabText:"#e2e8f0",ownerText:"#94a3b8",footnoteIndicator:"#f87171",rowTintEven:"#0f172a",rowTintOdd:"#1e293b",utilizationOk:"#34d399",utilizationWarn:"#fbbf24",utilizationOver:"#f87171"},timeline:{gridLine:"#475569",minorGridLine:"#334155",nonWorkingSeam:"#6b7a90",nonWorkingFill:"#94a3b8",tickMark:"#334155",labelText:"#cbd5e1",panelFill:"#0f172a",border:"#334155"},header:{cardBorder:"#475569",author:"#94a3b8"},item:{overflowX:"#f87171",linkIconFg:"#94a3b8",overflowTailFill:"#7f1d1d",overflowTailStroke:"#f87171",overflowCaption:"#fecaca"},parallel:{bracketStroke:"#cbd5e1"},anchorDiamond:{fill:"#0f172a",stroke:"#cbd5e1",label:"#cbd5e1",cutLine:"#94a3b8"},milestoneDiamond:{fill:"#e2e8f0",label:"#e2e8f0",cutLineNormal:"#a5b4fc",cutLineOverrun:"#ef4444",slack:"#cbd5e1"},footnotePanel:{fill:"#0f172a",border:"#334155",header:"#e2e8f0",title:"#e2e8f0",description:"#94a3b8",number:"#f87171"},nowline:{stroke:"#f87171",labelText:"#0b1220",labelBg:"#f87171"},milestone:{dashedInk:"#a5b4fc",overrun:"#ef4444"},anchor:{predecessorLine:"#94a3b8"},dependency:{edgeStroke:"#cbd5e1",overflowStroke:"#ef5350"},footnote:{indicatorText:"#f87171",descriptionMuted:"#94a3b8"},includeRegion:{border:"#475569",label:"#cbd5e1",badge:"#94a3b8",fill:"#0b1220",tabFill:"#111827",tabStroke:"#475569",tabText:"#e2e8f0",badgeFill:"#1e293b",badgeStroke:"#475569",badgeText:"#94a3b8"},wave:{stripFill:"#042f2e",stripFillAlt:"#134e4a",labelText:"#99f6e4",labelMuted:"#5eead4",boundary:"#2dd4bf",hatch:"#0f172a",hatchOnDark:"#ffffff"},arrowhead:{neutral:"#94a3b8",light:"#64748b",dark:"#e2e8f0"},status:{done:"#34d399",inProgress:"#60a5fa",atRisk:"#facc15",blocked:"#ef4444",planned:"#94a3b8",neutral:"#94a3b8"},statusTint:{done:"#052e16",inProgress:"#172554",atRisk:"#422006",blocked:"#7f1d1d",planned:"#1e293b",neutral:"#1e293b"},statusDot:{onLight:{done:"#065f46",inProgress:"#1e3a8a",atRisk:"#92400e",blocked:"#991b1b",planned:"#334155",neutral:"#334155"},onDark:{done:"#d1fae5",inProgress:"#dbeafe",atRisk:"#fef3c7",blocked:"#fee2e2",planned:"#e2e8f0",neutral:"#e2e8f0"}},attribution:{mark:"#cbd5e1",link:"#f87171"},diagnostic:{overlayBg:"#7f1d1d",errorText:"#fecaca"}};var ER={red:"#4a4a4a",blue:"#6b6b6b",green:"#8a8a8a",yellow:"#c8c8c8",orange:"#5c5c5c",purple:"#3a3a3a",gray:"#9e9e9e",navy:"#2a2a2a",white:"#ffffff"},Hn={bg:"none",fg:"#1a1a1a",text:"#1a1a1a",border:"solid",icon:"none",shadow:"none",font:"sans",weight:"normal",italic:!1,textSize:"md",padding:"sm",spacing:"sm",headerHeight:"sm",cornerRadius:"sm",bracket:"none",capacityIcon:"multiplier"},Py={name:"grayscale",surface:{page:"#f5f5f5",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Hn,headerHeight:"md",padding:"md"},swimlane:{...Hn,fg:"#3a3a3a",text:"#3a3a3a",padding:"sm",spacing:"none",textSize:"sm"},item:{...Hn,bg:"#ffffff",fg:"#9e9e9e",text:"#1a1a1a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Hn,bg:"#9e9e9e",bracket:"dashed",padding:"xs"},group:{...Hn,bg:"#595959",bracket:"solid",padding:"xs",fg:"#595959"},anchor:{...Hn,bg:"#1a1a1a",fg:"#1a1a1a",text:"#1a1a1a",cornerRadius:"sm"},milestone:{...Hn,bg:"#2a2a2a",fg:"#2a2a2a",text:"#ffffff",border:"solid"},footnote:{...Hn,bg:"none",fg:"#595959",text:"#595959",textSize:"sm"},label:{...Hn,bg:"#e8e8e8",fg:"#595959",text:"#595959",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#ffffff",bandOdd:"#f5f5f5",separator:"#d4d4d4",frameTabText:"#3a3a3a",frameTabMuted:"#737373",border:"#d4d4d4",tabFill:"#e8e8e8",tabStroke:"#bdbdbd",tabText:"#3a3a3a",ownerText:"#737373",footnoteIndicator:"#4a4a4a",rowTintEven:"#ffffff",rowTintOdd:"#f5f5f5",utilizationOk:"#8a8a8a",utilizationWarn:"#595959",utilizationOver:"#1a1a1a"},timeline:{gridLine:"#bdbdbd",minorGridLine:"#d4d4d4",nonWorkingSeam:"#9a9a9a",nonWorkingFill:"#737373",tickMark:"#bdbdbd",labelText:"#737373",panelFill:"#ffffff",border:"#d4d4d4"},header:{cardBorder:"#d4d4d4",author:"#737373"},item:{overflowX:"#1a1a1a",linkIconFg:"#1a1a1a",overflowTailFill:"#e8e8e8",overflowTailStroke:"#4a4a4a",overflowCaption:"#3a3a3a"},parallel:{bracketStroke:"#3a3a3a"},anchorDiamond:{fill:"#ffffff",stroke:"#3a3a3a",label:"#3a3a3a",cutLine:"#737373"},milestoneDiamond:{fill:"#1a1a1a",label:"#1a1a1a",cutLineNormal:"#2a2a2a",cutLineOverrun:"#4a4a4a",slack:"#1a1a1a"},footnotePanel:{fill:"#ffffff",border:"#d4d4d4",header:"#1a1a1a",title:"#1a1a1a",description:"#737373",number:"#4a4a4a"},nowline:{stroke:"#1a1a1a",labelText:"#ffffff",labelBg:"#1a1a1a"},milestone:{dashedInk:"#9e9e9e",overrun:"#4a4a4a"},anchor:{predecessorLine:"#9e9e9e"},dependency:{edgeStroke:"#595959",overflowStroke:"#1a1a1a"},footnote:{indicatorText:"#4a4a4a",descriptionMuted:"#737373"},includeRegion:{border:"#9e9e9e",label:"#3a3a3a",badge:"#737373",fill:"#f5f5f5",tabFill:"#ffffff",tabStroke:"#bdbdbd",tabText:"#1a1a1a",badgeFill:"#e8e8e8",badgeStroke:"#bdbdbd",badgeText:"#595959"},wave:{stripFill:"#fafafa",stripFillAlt:"#e0e0e0",labelText:"#212121",labelMuted:"#616161",boundary:"#616161",hatch:"#000000",hatchOnDark:"#ffffff"},arrowhead:{neutral:"#595959",light:"#9e9e9e",dark:"#1a1a1a"},status:{done:"#8a8a8a",inProgress:"#595959",atRisk:"#737373",blocked:"#3a3a3a",planned:"#bdbdbd",neutral:"#bdbdbd"},statusTint:{done:"#ebebeb",inProgress:"#e4e4e4",atRisk:"#eeeeee",blocked:"#dcdcdc",planned:"#f5f5f5",neutral:"#f5f5f5"},statusDot:{onLight:{done:"#3a3a3a",inProgress:"#2a2a2a",atRisk:"#4a4a4a",blocked:"#1a1a1a",planned:"#595959",neutral:"#595959"},onDark:{done:"#d4d4d4",inProgress:"#e8e8e8",atRisk:"#c8c8c8",blocked:"#f0f0f0",planned:"#d4d4d4",neutral:"#d4d4d4"}},attribution:{mark:"#9e9e9e",link:"#1a1a1a"},diagnostic:{overlayBg:"#e8e8e8",errorText:"#1a1a1a"}};var wR={red:"#e53935",blue:"#1e88e5",yellow:"#fdd835",green:"#43a047",orange:"#fb8c00",purple:"#8e24aa",gray:"#9e9e9e",navy:"#0d47a1",white:"#ffffff"},jn={bg:"none",fg:"#0f172a",text:"#0f172a",border:"solid",icon:"none",shadow:"none",font:"sans",weight:"normal",italic:!1,textSize:"md",padding:"sm",spacing:"sm",headerHeight:"sm",cornerRadius:"sm",bracket:"none",capacityIcon:"multiplier"},$y={name:"light",surface:{page:"#f8fafc",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...jn,headerHeight:"md",padding:"md"},swimlane:{...jn,fg:"#334155",text:"#334155",padding:"sm",spacing:"none",textSize:"sm"},item:{...jn,bg:"#ffffff",fg:"#94a3b8",text:"#0f172a",shadow:"subtle",cornerRadius:"sm"},parallel:{...jn,bg:"#635cf1",bracket:"dashed",padding:"xs"},group:{...jn,bg:"#ea9818",bracket:"solid",padding:"xs",fg:"#475569"},anchor:{...jn,bg:"#0f172a",fg:"#0f172a",text:"#0f172a",cornerRadius:"sm"},milestone:{...jn,bg:"#312e81",fg:"#312e81",text:"#ffffff",border:"solid"},footnote:{...jn,bg:"none",fg:"#475569",text:"#475569",textSize:"sm"},label:{...jn,bg:"#f1f5f9",fg:"#475569",text:"#475569",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#ffffff",bandOdd:"#f8fafc",separator:"#e2e8f0",frameTabText:"#334155",frameTabMuted:"#64748b",border:"#e2e8f0",tabFill:"#f1f5f9",tabStroke:"#cbd5e1",tabText:"#334155",ownerText:"#64748b",footnoteIndicator:"#dc2626",rowTintEven:"#ffffff",rowTintOdd:"#f8fafc",utilizationOk:"#10b981",utilizationWarn:"#f59e0b",utilizationOver:"#ef4444"},timeline:{gridLine:"#cbd5e1",minorGridLine:"#e2e8f0",nonWorkingSeam:"#a0aec0",nonWorkingFill:"#64748b",tickMark:"#cbd5e1",labelText:"#64748b",panelFill:"#ffffff",border:"#e2e8f0"},header:{cardBorder:"#e2e8f0",author:"#64748b"},item:{overflowX:"#dc2626",linkIconFg:"#0f172a",overflowTailFill:"#fee2e2",overflowTailStroke:"#ef4444",overflowCaption:"#b91c1c"},parallel:{bracketStroke:"#334155"},anchorDiamond:{fill:"#ffffff",stroke:"#334155",label:"#334155",cutLine:"#64748b"},milestoneDiamond:{fill:"#0f172a",label:"#0f172a",cutLineNormal:"#1e1b4b",cutLineOverrun:"#b91c1c",slack:"#0f172a"},footnotePanel:{fill:"#ffffff",border:"#e2e8f0",header:"#0f172a",title:"#0f172a",description:"#64748b",number:"#dc2626"},nowline:{stroke:"#e53e3e",labelText:"#ffffff",labelBg:"#e53e3e"},milestone:{dashedInk:"#94a3b8",overrun:"#ef4444"},anchor:{predecessorLine:"#94a3b8"},dependency:{edgeStroke:"#475569",overflowStroke:"#d32f2f"},footnote:{indicatorText:"#e53e3e",descriptionMuted:"#64748b"},includeRegion:{border:"#94a3b8",label:"#334155",badge:"#64748b",fill:"#f8fafc",tabFill:"#ffffff",tabStroke:"#cbd5e1",tabText:"#0f172a",badgeFill:"#e2e8f0",badgeStroke:"#cbd5e1",badgeText:"#475569"},wave:{stripFill:"#f0fdfa",stripFillAlt:"#ccfbf1",labelText:"#134e4a",labelMuted:"#0f766e",boundary:"#0d9488",hatch:"#0f172a",hatchOnDark:"#ffffff"},arrowhead:{neutral:"#475569",light:"#94a3b8",dark:"#0f172a"},status:{done:"#10b981",inProgress:"#3b82f6",atRisk:"#f59e0b",blocked:"#ef4444",planned:"#94a3b8",neutral:"#94a3b8"},statusTint:{done:"#ecfdf5",inProgress:"#eff6ff",atRisk:"#fffbeb",blocked:"#fee2e2",planned:"#f8fafc",neutral:"#f8fafc"},statusDot:{onLight:{done:"#065f46",inProgress:"#1e3a8a",atRisk:"#92400e",blocked:"#991b1b",planned:"#334155",neutral:"#334155"},onDark:{done:"#d1fae5",inProgress:"#dbeafe",atRisk:"#fef3c7",blocked:"#fee2e2",planned:"#e2e8f0",neutral:"#e2e8f0"}},attribution:{mark:"#94a3b8",link:"#e53e3e"},diagnostic:{overlayBg:"#fee2e2",errorText:"#991b1b"}};var TR=["light","dark","grayscale"],Cy={light:$y,dark:Ly,grayscale:Py};var s2={greyscale:"grayscale"};function Oy(e){let t=e.toLowerCase(),n=s2[t]??t;return TR.find(r=>r===n)}var a2={grey:"gray",violet:"purple"};function Yn(e,t){if(e==="none")return"none";if(e.startsWith("#"))return e;let n=t.name==="dark"?xR:t.name==="grayscale"?ER:wR,r=a2[e]??e,i=n[r];return typeof i=="string"?i:e}function l2(e,t){return{bg:Yn(e.bg,t),fg:Yn(e.fg,t),text:Yn(e.text,t),border:e.border,icon:e.icon,shadow:e.shadow,font:e.font,weight:e.weight,italic:e.italic,textSize:e.textSize,padding:e.padding,spacing:e.spacing,headerHeight:e.headerHeight,cornerRadius:e.cornerRadius,bracket:e.bracket,headerPosition:"beside",capacityIcon:e.capacityIcon,timelinePosition:"top",minorGrid:!1,nonWorking:"hide"}}function vR(e,t,n,r){switch(t){case"bg":e.bg=Yn(n,r);break;case"fg":e.fg=Yn(n,r);break;case"text":e.text=Yn(n,r);break;case"border":(n==="solid"||n==="dashed"||n==="dotted")&&(e.border=n);break;case"icon":e.icon=n;break;case"shadow":(n==="none"||n==="subtle"||n==="soft"||n==="hard")&&(e.shadow=n);break;case"font":(n==="sans"||n==="serif"||n==="mono")&&(e.font=n);break;case"weight":(n==="thin"||n==="light"||n==="normal"||n==="bold")&&(e.weight=n);break;case"italic":e.italic=n==="true";break;case"text-size":e.textSize=Al(n,"xl");break;case"padding":e.padding=Al(n,"xl");break;case"spacing":e.spacing=Al(n,"xl");break;case"header-height":e.headerHeight=Al(n,"xl");break;case"corner-radius":e.cornerRadius=Al(n,"full");break;case"bracket":(n==="none"||n==="solid"||n==="dashed")&&(e.bracket=n);break;case"header-position":(n==="beside"||n==="above")&&(e.headerPosition=n);break;case"capacity-icon":e.capacityIcon=n;break;case"timeline-position":(n==="top"||n==="bottom"||n==="both")&&(e.timelinePosition=n);break;case"minor-grid":e.minorGrid=n==="true";break;case"non-working":Td(n)&&(e.nonWorking=n);break;default:break}}function Al(e,t){let n=["none","xs","sm","md","lg","xl","full"],r=n.indexOf(t),i=n.indexOf(e);return i<0?"md":i>r?n[r]:n[i]}function c2(e,t,n){if(t)for(let r of t.properties)vR(e,q(r),r.value,n)}function u2(e,t,n){for(let r of t){let i=q(r);r.value!==void 0&&vR(e,i,r.value,n)}}function be(e,t,n){let r=n.theme.entities[e],i=l2(r,n.theme);for(let o of Sf(e,t,n))switch(o.level){case"default":case"inline":u2(i,o.props,n.theme);break;case"label":break;default:c2(i,o.decl,n.theme)}return i}function _R(e,t){return be("label",e.properties,t)}function kR(e,t){let r=_t(e.roadmapDecl?.properties??[],"scale")?.value,i="weeks",o,s;if(r)if(r==="days"||r==="weeks"||r==="months"||r==="quarters"||r==="years")i=r;else{let l=/^(\d+)([dwmqy])$/.exec(r);if(l){let u=Math.max(1,parseInt(l[1],10));switch(l[2]){case"d":i="days";break;case"w":i="weeks";break;case"m":i="months";break;case"q":i="quarters";break;case"y":i="years";break}o=Dy(i)*u,s=1}}let a=s??YA[i]??4,c=l=>s===void 0&&!l?{labelEveryDefault:!0}:{};if(t){let l=_t(t.properties,"label-every"),u=l&&parseInt(l.value,10)||0,f=u!==0?Math.max(1,u):a;return{unit:i,labelEvery:f,pixelsPerUnit:o??Dy(i),...c(u!==0)}}return{unit:i,labelEvery:a,pixelsPerUnit:o??Dy(i),...c(!1)}}function Dy(e){switch(e){case"days":return GA;case"weeks":return 40;case"months":return 80;case"quarters":return 160;case"years":return 320}}var f2=.5,My=.5,kl=7;function Mr(e){return e==="months"||e==="quarters"||e==="years"}function vd(e,t){let n=e.getUTCFullYear(),r=e.getUTCMonth();switch(t){case"months":return new Date(Date.UTC(n,r+1,1));case"quarters":return new Date(Date.UTC(n,r-r%3+3,1));case"years":return new Date(Date.UTC(n+1,0,1))}}function d2(e,t){if(e.getUTCDate()!==1)return!1;let n=e.getUTCMonth();switch(t){case"months":return!0;case"quarters":return n%3===0;case"years":return n===0}}function $i(e,t,n,r,i){let o=Math.ceil(t-1e-6);if(i?.hasNonWorkingDays){if(!Mr(n)&&o<=0)return 0;let a=o<=0?e:Ue(i.dateAtWorkingIndex(e,o-1),1),c=Mr(n)?AR(a,n):n==="weeks"?IR(a,e,i.weekStart):a;return i.workingIndexOf(e,c)}if(!Mr(n))return Math.ceil(t/r)*r;let s=Ue(e,o);return At(e,AR(s,n))}function AR(e,t){return d2(e,t)?e:vd(e,t)}function IR(e,t,n){let r=n===void 0?-At(t,e):n-e.getUTCDay();return Ue(e,(r%kl+kl)%kl)}function p2(e,t,n){return IR(Ue(e,1),t,n)}function _d(e,t,n,r=_l){if(e.calendar?.hasNonWorkingDays)return h2(e,t,e.calendar,r);if(Mr(t.unit))return w2(e,t,t.unit,r);let i=n.daysPerUnit(t.unit),o=i*e.pixelsPerDay,s=Math.max(1,Math.round(e.widthPx/e.pixelsPerDay)),a=Math.floor(s/i)+1,c=[];for(let l=0;l<a;l++){let u=l*i,f=e.originX+u*e.pixelsPerDay,d=l%t.labelEvery===0,p=l===a-1;c.push({x:f,labelX:p?void 0:f+o/2,major:d,label:d&&!p?Wy(t.unit,Ue(e.domain[0],u),l,r):void 0})}return c}function h2(e,t,n,r){let{unit:i}=t,[o,s]=e.domain,a=E=>Mr(i)?vd(E,i):i==="weeks"?p2(E,o,n.weekStart):Ue(E,1),c=[o];for(let E=a(o);E<s;E=a(E))c.push(E);let l=e.forward(s),u=[];c.forEach((E,y)=>{let x=e.forward(E);(y+1<c.length?e.forward(c[y+1]):l)>x&&!y2(e,i,c,y)&&u.push({date:E,x})});let f=i==="days"&&t.labelEveryDefault===!0&&n.weekStart!==void 0,d=(E,y)=>f?g2(E,n,e.showsNonWorking):y%t.labelEvery===0,m=(e.showsNonWorking?wA(i):n.daysPerUnit(i))*e.pixelsPerDay,g=u.map(({date:E,x:y},x)=>{let T=(x+1<u.length?u[x+1].x:l)-y,v=d(E,x),k=v?Wy(i,E,x,r):void 0,C=k===void 0?0:se(k,ki),$=Mr(i)?x===0||x===u.length-1:T<m-f2,O=k!==void 0&&!(C>T&&$);return{x:y,columnPx:T,major:v,label:k,labelPx:C,isNarrowed:$,isShown:O}});Mr(i)||m2(g);let w=g.map(E=>({x:E.x,labelX:E.x+E.columnPx/2,major:E.major,label:E.isShown?E.label:void 0}));return s>o&&w.push({x:l,labelX:void 0,major:d(s,u.length),label:void 0}),w}function m2(e){let t=n=>{let r=e[n];return r===void 0||r.isShown?0:r.columnPx/2};e.forEach((n,r)=>{if(n.label===void 0||n.isShown||!n.isNarrowed||!(e[r-1]?.isNarrowed===!0||e[r+1]?.isNarrowed===!0))return;let o=n.labelPx/2,s=n.columnPx/2;n.isShown=o<=s+t(r-1)&&o<=s+t(r+1)})}function g2(e,t,n){let r=t.weekStart;if(n)return e.getUTCDay()===r;let i=(e.getUTCDay()-r+kl)%kl;for(let o=1;o<=i;o++)if(t.isWorkingDay(Ue(e,-o)))return!1;return!0}function y2(e,t,n,r){let i=e.calendar;if(!e.showsNonWorking||!i||!Mr(t)||r===0||r!==n.length-1)return!1;let[o,s]=e.domain;return i.workingIndexOf(o,n[r])>=i.workingIndexOf(o,s)}function Fy(e,t,n,r){let i=e.calendar;if(!i?.hasNonWorkingDays)return;let o=i.nonWorkingRuns(e.domain[0],e.domain[1]);if(o.length===0)return;let[s,a]=e.range;if(e.showsNonWorking)return o.map(l=>E2(e,l,n));let c=l=>t.some(u=>Math.abs(u.x-l)<My&&(u.major||r));return o.map(l=>{let u=e.forward(l.from),f={x:u,width:e.forward(Ue(l.through,1))-u,from:l.from,through:l.through};l.titles.length>0&&(f.titles=l.titles,f.label=bR(l,i.workingWeekdays),f.cut=!0);let d=u-s>My&&a-u>My;return n==="days"&&d&&!c(u)&&(f.seam=!0),f})}function By(e){let t=e.calendar?.workingExceptionRuns(e.domain[0],e.domain[1])??[];if(t.length===0)return;let[n]=e.range;return t.map(r=>({x:Math.max(n,e.forward(r.from)),from:r.from,through:r.through,titles:r.titles,label:x2(r)}))}function x2(e){let t=At(e.from,e.through)+1;return`${e.titles.join(", ")}${RR}+${t}d`}var RR=" \xB7 ";function bR(e,t){let n=0;for(let i=e.from;i<=e.through;i=Ue(i,1))t.has(i.getUTCDay())&&n++;let r=e.titles.join(", ");return n>0?`${r}${RR}${n}d`:r}function E2(e,t,n){let[r,i]=e.range,o=Math.max(r,e.forward(t.from)),s=Math.min(i,e.forward(Ue(t.through,1))),a={x:o,width:s-o,from:t.from,through:t.through};return t.titles.length>0&&(a.titles=t.titles,e.calendar&&(a.label=bR(t,e.calendar.workingWeekdays))),(n==="days"||n==="weeks"||t.titles.length>0)&&(a.band=!0),a}function w2(e,t,n,r){let[i,o]=e.domain,s=[i];for(let l=vd(i,n);l<o;l=vd(l,n))s.push(l);o>i&&s.push(o);let a=s.map(l=>e.forward(l)),c=s.length-1;return s.map((l,u)=>{let f=a[u],d=u%t.labelEvery===0;if(u===c)return{x:f,labelX:void 0,major:d,label:void 0};let p=a[u+1]-f,m=d?Wy(n,l,u,r):void 0,g=u===0||u===c-1;return m!==void 0&&g&&se(m,ki)>p&&(m=void 0),{x:f,labelX:f+p/2,major:d,label:m}})}function Wy(e,t,n,r){switch(e){case"days":return`${t.getUTCMonth()+1}/${t.getUTCDate()}`;case"weeks":{let i=t.toLocaleString(r,{month:"short",timeZone:"UTC"}),o=t.getUTCDate().toString().padStart(2,"0");return`${i} ${o}`}case"months":return t.toLocaleString(r,{month:"short",timeZone:"UTC"});case"quarters":{let i=Math.floor(t.getUTCMonth()/3)+1;return`${Gn(r).quarterPrefix}${i} ${t.getUTCFullYear()}`}case"years":return`${t.getUTCFullYear()}`}}function SR(e,t,n){let r=n.theme??"light",i=Cy[r],o=gR(n.locale,v2(e)),s={theme:i,styles:t.config.styles,defaults:t.config.defaults,labels:t.content.labels},a=be("roadmap",e.roadmapDecl?.properties??[],s);return{themeName:r,theme:i,locale:o,styleCtx:s,roadmapStyle:a}}function NR(e,t,n,r,i){let{config:o,working:s}=$f(e,t),a=kR(e,t.config.scale),{startDate:c,endDate:l}=T2(e,i,n.today,a),u=Td(n.nonWorking)?n.nonWorking:r.roadmapStyle.nonWorking,f=u==="show"&&s.hasNonWorkingDays,d=Math.max(1,s.workingIndexOf(c,l)),p=f?Math.max(1,At(c,l)):d;return{cal:o,calendar:s,preset:a,schedule:i,startDate:c,naturalEndDate:l,spanDays:d,timelineDays:p,nonWorking:u}}function T2(e,t,n,r){let i=e.roadmapDecl?.properties??[],{config:o,working:s}=t.calendar,{startDate:a}=t,c=re(i,"length"),l=0;if(c){let m=is(c,o);m>0&&(l=m)}let u=t.extent.contentEndDay;if(n&&!(l>0)){let m=s.workingIndexOf(a,n);m>0&&(u=Math.max(u,m))}let f=xA(r.unit,o),d=$i(a,u>0?u:4*o.daysPerWeek,r.unit,f,s),p=Math.max(l,d);return{startDate:a,endDate:s.dateAtWorkingIndex(a,Math.max(1,p))}}function v2(e){return _t(e.directive?.properties??[],"locale")?.value}var _2=1e-6,vs=class{constructor(t,n){B(this,"scale");B(this,"startDate");B(this,"spanDays");B(this,"unit");B(this,"calendar");this.scale=n,this.startDate=t.startDate,this.spanDays=t.spanDays,this.unit=t.preset.unit,this.calendar=t.calendar}isPast(t,n){return this.scale.indexAtX(t)>n+_2}boundaryAtOrAfterX(t){return this.boundaryAtOrAfter(this.scale.indexAtX(t))}boundaryAtOrAfter(t){return $i(this.startDate,t,this.unit,this.calendar.daysPerUnit(this.unit),this.calendar)}captionColumn(t){let n=this.boundaryAtOrAfter(t);return{start:n,end:this.nextBoundary(n)}}nextBoundary(t){return $i(this.startDate,t+.5,this.unit,this.calendar.daysPerUnit(this.unit),this.calendar)}xAt(t){return this.scale.forward(this.calendar.dateAtWorkingIndex(this.startDate,t))}captionCapX(t){let n=this.isPast(t,this.spanDays)?Math.max(this.spanDays,this.boundaryAtOrAfterX(t)):this.spanDays;return this.xAt(this.captionColumn(n).end)}};function LR(e,t){e.box.y+=t;for(let n of e.inlineDatePins??[])n.glyphTopLeft.y+=t;if(e.kind==="item"){for(let n of e.labelChips)n.box.y+=t;e.overflowBox&&(e.overflowBox.y+=t);return}for(let n of e.children)LR(n,t)}function _s(e,t){e.box.y+=t;for(let n of e.children)LR(n,t);for(let n of e.nested)_s(n,t)}function PR(e,t){e.box.y+=t;for(let n of e.nestedSwimlanes)_s(n,t);for(let n of[...e.anchors??[],...e.milestones??[]])n.center.y+=t,n.labelBox.y+=t,n.cutTopY+=t,n.cutBottomY+=t;for(let n of e.milestones??[])for(let r of n.slackArrows??[])r.y+=t;for(let n of e.edges??[])for(let r of n.waypoints)r.y+=t}function $R(e,t){e.cutTopY+=t,e.cutBottomY+=t;for(let n of e.slackArrows??[])n.y+=t}var Xy=class{constructor(t,n){B(this,"id");B(this,"anchor");this.id=t,this.anchor=n}place(t,n){let r=re(this.anchor.properties,"date"),i=_e(r);if(!i)return null;let o=t.scale.forwardWithinDomain(i);if(o===null)return null;let s=be("anchor",this.anchor.properties,t.styleCtx),a=t.markerRowPlacements.get(this.id),c=a?.centerY??t.timeline.markerRow.y,l={x:o,y:c},u=a?.labelBox??{x:o+6+6,y:c-4,width:0,height:12},f=a?.labelSide??"right";t.entityLeftEdges.set(this.id,o),t.entityRightEdges.set(this.id,o),t.entityMidpoints.set(this.id,l);let d={id:this.id,title:this.anchor.title??this.id,center:l,radius:6,style:s,predecessorPoints:[],cutTopY:t.chartTopY,cutBottomY:t.swimlaneBottomY,bumpedUp:(a?.rowIndex??0)>0,labelBox:u,labelSide:f};return!t.scale.showsNonWorking&&!t.calendar.isWorkingDay(i)&&(d.hiddenDate=wi(i)),d}};function kd(e,t,n){let r=[];for(let[i,o]of e){let s=new Xy(i,o).place(t,n);s&&r.push(s)}return r}function Il(e){if(e.kind==="item"){let n=e.textSpills||e.dotSpills||e.iconSpills||e.footnoteSpills;return Math.max(e.box.x+e.box.width,n?e.decorationsRightX:Number.NEGATIVE_INFINITY,e.chipsOutside?e.chipsRightX:Number.NEGATIVE_INFINITY)}let t=Math.max(e.box.x+e.box.width,hs(e));for(let n of e.children)t=Math.max(t,Il(n));return t}function As(e){let t=0;for(let n of e)t=Math.max(t,CR(n.children)),n.nested.length>0&&(t=Math.max(t,As(n.nested)));return t}function CR(e){let t=0;for(let n of e)n.kind==="item"?t=Math.max(t,n.box.x+n.box.width):t=Math.max(t,CR(n.children));return t}function Id(e){let t=0;for(let n of e)t=Math.max(t,OR(n.children)),n.nested.length>0&&(t=Math.max(t,Id(n.nested)));return t}function OR(e){let t=0;for(let n of e)n.kind==="item"?n.textSpills&&(t=Math.max(t,n.decorationsRightX)):t=Math.max(t,OR(n.children));return t}function k2(e){return e.box.y+e.box.height-Jt/2}function Gy(e,t){let{box:n}=e;return{startX:e.dateSpan.startX,endX:e.dateSpan.endX,paintedX:n.x,paintedWidth:n.width,top:n.y,bottom:n.y+n.height,rowY:n.y+t/2,exitY:zy(e,t)}}function DR(e){let{box:t}=e;return{startX:t.x,endX:t.x+t.width,paintedX:t.x,paintedWidth:t.width,top:t.y,bottom:t.y+t.height}}function zy(e,t){return e.textSpills?k2(e):e.box.y+t/2}function MR(e){let{box:t,afterDate:n,beforeDate:r,hasLinkIcon:i,footnoteCount:o}=e;if(!n&&!r)return[];let s=[],a=Dn,c=t.y+DA,l=bg(t.width);if(n){let u=Sg(t.x,i),f=l?{x:t.x-Mn-a,y:c}:{x:u,y:c};s.push({side:"after",isoDate:n,glyphTopLeft:f,glyphSize:a,spilled:l})}if(r){let u=t.x+t.width,f=Ng(u,o),d=l?{x:u+Mn,y:c}:{x:f,y:c};s.push({side:"before",isoDate:r,glyphTopLeft:d,glyphSize:a,spilled:l})}return s}function Rd(e){let{box:t,afterDate:n,beforeDate:r,title:i}=e;if(!n&&!r)return[];let o=[],s=Dn,a=t.y+(fl-s)/2,c=i?ps(t.x,!!n)+iy(i):t.x;if(n&&(c=Math.max(c,t.x+s),o.push({side:"after",isoDate:n,glyphTopLeft:{x:t.x,y:a},glyphSize:s,spilled:!1})),r){let l=t.x+t.width-Rg-s,u=c>t.x?c+Sr:t.x;o.push({side:"before",isoDate:r,glyphTopLeft:{x:Math.max(l,u),y:a},glyphSize:s,spilled:!1})}return o}function Bt(e){for(let t of e)if(_e(t))return t}function Fr(e){return{after:Be(e,"after").map(n=>{let r=_e(n);return r?{raw:n,date:r}:{raw:n,ref:n}})}}function bd(e){return e.floors.map(t=>t?_e(t.date):null)}function Sd(e,t,n,r,i=0,o){let s=n.map(l=>l??-1/0),a=[];for(let l=0;l<e;l++){let u=FR(l===0?t:a[l-1],s[l],i);a.push(l===0?u:Math.max(u,o?.S[l]??-1/0))}let c=a.map((l,u)=>Math.max(l,o?.E[u]??-1/0));for(let l=1;l<=e+1;l++){let u=r(a,c).memberEnd,f=[],d=[];for(let p=0;p<e;p++)f.push(p===0?a[0]:FR(d[p-1],s[p],i)),d.push(Math.max(f[p],u[p]??-1/0));if(BR(a,f)&&BR(c,d))return{S:a,E:c,passes:l,capped:!1};a=f,c=d}return r(a,c),{S:a,E:c,passes:e+1,capped:!0}}function FR(e,t,n){return t-e>n?t:e}function BR(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function WR(e,t,n){return bd(e).map(r=>r?n.workingIndexOf(t,r):null)}var Ci=class{constructor(t,n){B(this,"plan");B(this,"S");B(this,"memberEnd");B(this,"binding");B(this,"memberCount");this.plan=t,this.S=n;let r=t.waves.length;this.memberEnd=new Array(r).fill(-1/0),this.binding=new Array(r).fill(void 0),this.memberCount=new Array(r).fill(0)}floor(t){let n=this.plan.waveOf.get(t),r=t.$type==="ItemDeclaration"?void 0:this.plan.leadOf.get(t),i;return n!==void 0&&(i=this.S[n-1]),r!==void 0&&(i=Math.max(i??-1/0,this.S[r-1])),i}apply(t,n){let r=this.floor(t);return r===void 0?n:Math.max(n,r)}accumulate(t,n){let r=this.plan.memberWave(t);r!==void 0&&(this.memberCount[r-1]++,n>this.memberEnd[r-1]&&(this.memberEnd[r-1]=n,this.binding[r-1]=t))}};function Nd(e,t,n,r,i,o=0){return e.waves.map((s,a)=>{let c={id:s.name,index:a+1,start:t.S[a],end:t.E[a],memberCount:n.memberCount[a]},l=n.binding[a];if(l!==void 0&&n.memberEnd[a]===t.E[a]&&t.E[a]>t.S[a]){let p=l.name??l.title;p!==void 0&&(c.heldBy=p)}let u=i[a],f=e.floors[a]?.ref,d=a===0?r:t.E[a-1];return u!=null&&f!==void 0&&u-d>o&&(c.floorRef=f),c})}var It=.5;function UR(e,t,n,r){let i=e.waves.map(()=>n);return{plan:e,ids:e.waves.map(o=>o.name),origin:n,floors:bd(e).map(o=>o?t.forward(o):null),S:i,E:i,pass:new Ci(e,i),frozen:!1,backgroundTooltip:r}}function XR(e,t,n){e.S=t,e.E=n,e.pass=new Ci(e.plan,t)}function GR(e,t){e.S=t.S,e.E=t.E,e.frozen=!0,e.solve=t}function Ld(e,t,n){e.ids.forEach((r,i)=>{t.set(r,e.S[i]),n.set(r,e.E[i])})}function Br(e,t,n){return n.waves?n.waves.pass.apply(e,t):t}function zR(e,t,n){n.waves&&!n.waves.frozen&&n.waves.pass.accumulate(e,t)}function HR(e,t){if(t.waves)return t.waves.plan.memberWave(e)!==void 0?"member":"background"}function jR(e,t){for(let n of[...e.S,...e.E])if(!(Math.abs(n-e.origin)<It)&&Math.abs(t-n)<It)return!0;return!1}function Hy(e,t){let n=Math.round((e-t.timeline.originX)/t.timeline.pixelsPerDay);if(!t.scale.showsNonWorking)return n;let r=t.timeline.startDate;return t.calendar.workingIndexOf(r,Ue(r,n))}function Pd(e,t){return t.calendar.dateAtWorkingIndex(t.timeline.startDate,Hy(e,t))}function YR(e,t,n){return Pf(n.calendar,n.timeline.startDate,Hy(e,n),Hy(t,n))}function Rl(e,t,n){return Br(e,bl(e.properties,t,n),n)}var I2=!0;function VR(){return I2}function bl(e,t,n){let{after:r}=Fr(e);if(r.length>0){let i=t;for(let o of r){if("date"in o){let a=n.scale.forwardWithinDomain(o.date);a!==null&&(i=Math.max(i,a));continue}let s=n.entityRightEdges.get(o.ref);s!==void 0&&(i=Math.max(i,s))}return i}return t}function KR(e,t,n){if(!n.calendar.hasNonWorkingDays)return;let r=R2(e);if(!r||n.calendar.isWorkingDay(r.date))return;let i=n.scale.forwardWithinDomain(r.date);if(!(i===null||Math.abs(t-i)>=It))return{key:r.key,pin:r.raw,start:wi(Pd(t,n))}}function R2(e){let{after:t}=Fr(e);for(let n of t)if("date"in n)return{key:"after",raw:n.raw,date:n.date}}function ks(e,t,n){return e.scale.showsNonWorking?e.scale.advanceX(t,n)-t:n*e.timeline.pixelsPerDay}function Sl(e,t){return{x:e,startX:e,y:t,height:0}}function qR(e,t){let n=e.schedule.byNode.get(t);if(!n)throw new Error(`layout: item "${t.name??t.title??"(unnamed)"}" is not in the day schedule`);return n.days}function $d(e,t,n,r){return{cal:t.cal,schedule:t.schedule,styleCtx:{theme:t.theme,styles:e.config.styles,defaults:e.config.defaults,labels:e.content.labels},sizes:os(e.content.sizes,t.cal),labels:e.content.labels,teams:e.content.teams,persons:e.content.persons,symbols:e.config.symbols,footnoteIndex:r.footnotes?.index??new Map,footnoteHosts:r.footnotes?.hosts??new Map,timeline:t.timeline,scale:t.scale,calendar:t.calendar,...t.axisColumns?{axisColumns:t.axisColumns}:{},bandScale:t.bandScale,entityLeftEdges:new Map,entityRightEdges:new Map,entityMidpoints:new Map,placedItems:new Map,itemFlowKey:new Map,currentFlowKey:"",slackCorridors:[],markerRowPlacements:r.markerRowPlacements??new Map,chartTopY:n.chartTopY,estimatedChartTopY:n.estimatedChartTopY,chartBottomY:n.chartBottomY,swimlaneBottomY:n.swimlaneBottomY,nextParallelId:0,nextGroupId:0,...t.waves?{waves:t.waves}:{}}}function jy(e,t){return e-t.estimatedChartTopY}var b2=12,S2=4,Cd=13,N2=11;function L2(e,t){return(e?se(e,N2):0)+t}function Dd(e){return Math.max(0,Math.min(XA,(e-Pg)/2))}function Yy(e){return Math.max(Pg,e-2*Dd(e))}function ZR(e){if(!/[\r\n]/.test(e))return;let t=e.replace(/\r\n?/g,`
|
|
2918
2918
|
`).split(`
|
|
2919
2919
|
`).map(i=>i.trim()),n=0,r=t.length;for(;n<r&&t[n]==="";)n+=1;for(;r>n&&t[r-1]==="";)r-=1;return t.slice(n,r)}function P2(e,t,n,r=t){let i=e,o=ZR(e);if(o){if(o.length>=2)return{textSpills:!(n<=t&&o.every((l,u)=>se(l,Cd)<=(u===0?r:t))),titleLines:o};i=o[0]??""}let s=i.length>0&&se(i,Cd)>r,a=n>t;if(!s&&!a)return{textSpills:!1,titleLines:[i]};if(s&&!a){let c=Ti(i,t,Cd,r);if(c.length>=2&&c.length<=vg&&c.every((l,u)=>se(l,Cd)<=(u===0?r:t)))return{textSpills:!1,titleLines:c}}return{textSpills:!0,titleLines:[i]}}function JR(e,t,n){let r=ZR(e);return r&&r.length>=2?r:!t.textSpills&&!n&&t.titleLines.length>=2?t.titleLines:[r?r[0]??"":e]}function QR(e){let{visualWidth:t}=e,n=ls(!!e.hasLinkIcon,e.hasAfterGlyph?{barWidth:t}:void 0),r=Math.max(0,t-n-b2),i=L2(e.metaText,e.metaTrailingWidth??0),o=Math.max(0,t-n-(e.titleFirstLineRightReservePx??nl({barWidth:t,footnoteLabels:[],hasBeforeGlyph:!1})));return{leftInset:n,fit:P2(e.title,r,i,o)}}var $2;function eb(e,t,n){$2?.(e,t,n)}var Od=class{constructor(t){B(this,"geometry");this.geometry=t}get id(){return this.geometry.id}measure(t){return{width:this.geometry.naturalWidth,height:t.bands.bandwidth()+this.geometry.barExtra}}place(t,n){let{naturalWidth:r,visualWidth:i,caption:o,barExtra:s}=this.geometry,a=n.bands.bandwidth(),c=t.x+Dd(r),l={x:c,y:t.y,width:i,height:s>0?a+s:a},{textSpills:u,titleLines:f}=o.fit,d=u?c+i+S2:c+o.leftInset;return{id:this.geometry.id,box:l,textX:d,textSpills:u,titleLines:f}}};function C2(e){switch(e){case"done":case"completed":return"done";case"in-progress":case"active":return"in-progress";case"at-risk":case"blocked":case"planned":return e;case void 0:return"planned";default:return"neutral"}}function O2(e){if(!e)return 0;let t=/^(\d{1,3})%$/.exec(e);return t?Math.max(0,Math.min(100,parseInt(t[1],10)))/100:0}function D2(e,t){if(e)return/^\d+(?:\.\d+)?[dwmqy]$/.test(e)||/^\d+%$/.test(e)?e:t.sizes.get(e)?.effortLiteral??e}function M2(e,t){if(e)return t.teams.get(e)?.title??t.persons.get(e)?.title??e}function F2(e){if(!e)return{icon:"none"};let t=e.toLowerCase();return t.includes("linear.app")?{icon:"linear",href:e}:t.includes("github.com")?{icon:"github",href:e}:t.includes("atlassian.net")||t.includes("jira.")?{icon:"jira",href:e}:{icon:"generic",href:e}}function Md(e,t,n,r,i){let o=_R(e,t),s=e.name??e.title??"",a=o.padding==="none"?"xs":o.padding,c=WA[a],l=Math.max(20,Math.round(s.length*5.5+c*2));return i!==void 0&&(l=Math.min(l,i)),{text:s,style:o,box:{x:n,y:r,width:l,height:$r}}}function B2(e,t){let n=hA(e,t.sizes,t.cal),r=dA(re(e,"remaining"),t.sizes,t.cal),i=re(e,"status"),o=C2(i),s=O2(i);s===0&&o==="done"&&(s=1);let a=/^(\d{1,3})%$/.exec(re(e,"remaining")??"");return s===0&&o==="in-progress"&&a&&(s=1-Math.max(0,Math.min(100,parseInt(a[1],10)))/100),s===0&&o==="in-progress"&&r>0&&n>0&&(s=Math.max(0,Math.min(1,1-r/n))),{status:o,progress:s}}function W2(e,t,n,r,i,o){let s=re(e,"duration"),a=!!s&&/^\d+(?:\.\d+)?[dwmqy]$/.test(s),c=n?n.title??n.name:"",l=a?s:c||void 0,u=re(e,"remaining"),f=D2(u,t),d=M2(re(e,"owner"),t),p=()=>[l,d].filter(Boolean).join(" "),m;if(r==="in-progress"&&f){let x=p();m=x?`${x} \u2014 ${f} remaining`:`${f} remaining`}else if(r==="in-progress"&&i>0&&i<1){let x=Math.round((1-i)*100),T=p();m=T?`${T} \u2014 ${x}% remaining`:`${x}% remaining`}else(d||l)&&(m=p()||void 0);let g=re(e,"capacity"),w=Rr(g),E=null,y=0;if(w!==null){let x=Ka(w),T=qa(o,t.symbols);E={value:w,text:x,icon:T};let v=11;y=(m?se(" ",v):0)+Ei(x,T,v)}return{metaText:m,ownerDisplay:d,capacity:E,capacityTrailingWidth:y}}function U2(e,t){let n=new Set;if(e){for(let[r,i]of t.footnoteHosts.entries())if(i.includes(e)){let o=t.footnoteIndex.get(r);o!==void 0&&n.add(o)}}return[...n].sort((r,i)=>r-i)}function X2(e,t,n){return nl({barWidth:e,footnoteLabels:t.map(String),hasBeforeGlyph:Bt(n)!==void 0})}var G2={done:"done","in-progress":"inProgress","at-risk":"atRisk",blocked:"blocked",planned:"planned",neutral:"neutral"};function z2(e,t,n){let r=G2[t],i={...e};return i.bg===n.entities.item.bg&&(i.bg=n.statusTint[r]),i.fg===n.entities.item.fg&&(i.fg=n.status[r]),i}function H2(e,t,n,r,i){if(n===0)return 0;let o=r-Jt-$r-Fn,s;e&&t?s=Math.max(vi,i)+Fn:e?s=o:s=Math.max(o,i+Fn);let c=s+(n-1)*Ff+$r+Fn+Jt;return Math.max(0,c-r)}function j2(e,t,n){let r=n.axisColumns;if(!t.textSpills||!r)return{lines:e,truncated:!1};let i=Math.max(0,...e.map(g=>se(g,Nr))),{metaText:o,capacityTrailingWidth:s}=t.meta,a=(o?se(o,Qa):0)+s,c=Math.max(i,a),l=Mf({barRightX:t.barRightX,iconSpills:t.iconSpills,captionWidth:c,footnoteCount:t.visualWidth<cs?t.footnoteCount:0,dotSpills:t.visualWidth<Pr}),u=r.captionCapX(t.barRightX);if(l.rightX<=u+Y2||l.captionX===null)return{lines:e,truncated:!1};let f=l.rightX-(l.captionX+c),d=u-l.captionX-f,p=!1;return{lines:e.map(g=>{let w=$A(g,d,Nr);return w!==g&&(p=!0),w}),truncated:p}}var Y2=1e-6;function Fd(e,t,n){let r=e.properties,i=be("item",r,n.styleCtx),o=re(r,"size"),s=o?n.sizes.get(o)??null:null,a=qR(n,e),c=Be(r,"after"),l=Be(r,"before"),u=ks(n,t,a),f=Yy(u),d=F2(re(r,"link")),p=d.icon!=="none",m=Yy(u),g=Be(r,"labels"),w=[];for(let G of g){let X=n.labels.get(G);if(!X)continue;let Q=Md(X,n.styleCtx,0,0);w.push({id:X,width:Q.box.width})}let E=0;for(let G=0;G<w.length;G+=1)G>0&&(E+=Bn),E+=w[G].width;let y=Math.max(0,m-2*On),x=w.length>0&&E>y,{status:T,progress:v}=B2(r,n),k=z2(i,T,n.styleCtx.theme),C=W2(r,n,s,T,v,k.capacityIcon),$=e.title??e.name??"",O=U2(e.name,n),H=QR({title:$,visualWidth:f,metaText:C.metaText,metaTrailingWidth:C.capacityTrailingWidth,hasLinkIcon:p,hasAfterGlyph:Bt(c)!==void 0,titleFirstLineRightReservePx:X2(m,O,l)}),P=p&&f<Ig,R=H.fit.textSpills||P,b=j2(JR($,H.fit,P),{textSpills:R,iconSpills:P,barRightX:t+Dd(u)+f,visualWidth:f,footnoteCount:O.length,meta:C},n),M=b.lines,_=x?FA(w,f):null,S=_?_.rows.length:w.length>0?1:0,L=C.metaText!==void 0||C.capacity!==null,F=Df(M.length,L),N=_g(M.length,L),W=H2(x,R,S,n.bandScale.bandwidth(),F);return{node:e,id:e.name??"",startX:t,durationDays:a,naturalWidth:u,visualWidth:f,naturalVisualWidth:m,style:k,size:s,status:T,progress:v,meta:C,link:d,chips:{samples:w,outside:x,pack:_,rowCount:S},footnoteIndicators:O,caption:{...H,title:$,iconSpills:P,lines:M,truncated:b.truncated,lastBaseline:F},barExtra:Math.max(N,W)}}function Bd(e,t,n,r){let i=e.properties,o=Be(i,"after"),s=Be(i,"before"),a=bl(i,t.x,n);n.waves&&(a=Br(e,a,n));let c=KR(i,a,n),l=n.scale.startX(a),u=r??Fd(e,l,n);if(u.startX!==l)throw new Error(`layout: item "${e.name??e.title??"(unnamed)"}" was measured at x ${u.startX} but placed at x ${l}`);let{naturalWidth:f,style:d,status:p,progress:m,footnoteIndicators:g,caption:w}=u,{metaText:E,ownerDisplay:y,capacity:x,capacityTrailingWidth:T}=u.meta,v=u.link,k=v.icon!=="none",C=u.chips.samples,$=u.chips.outside,O=l,H=l+f,P=l+ks(n,l,u.durationDays),R=!1,b,M;if(s.length>0){let qe,Zn;for(let Pt of s){let $s=_e(Pt),Cs=$s?n.scale.forwardWithinDomain($s)??void 0:n.entityLeftEdges.get(Pt);Cs!==void 0&&(qe===void 0||Cs<qe)&&(qe=Cs,Zn=Pt)}qe!==void 0&&P>qe&&(R=!0,b={x:qe,y:t.y,width:H-qe,height:n.bandScale.bandwidth()},M=Zn)}let _=w.title,S=new Od(u),L={time:n.scale,bands:n.bandScale,style:d},F=S.place({x:O,y:t.y},L),N=F.box,W=n.bandScale.bandwidth(),G=N.width<Pr,X=w.iconSpills,Q=N.width<cs,j=F.textSpills||X,ne=w.lines,A=u.chips.pack,D=w.lastBaseline,U=u.barExtra,z=[],J=N.y+W-Jt-$r-Fn,Z=N.y+($&&j?Math.max(vi,D):D)+Fn,oe=$&&j||!$&&C.length>0?Math.max(J,Z):J,ge=$?N.x+N.width+Mn:N.x+On,ue=ge;if(A)for(let qe=0;qe<A.rows.length;qe+=1){let Zn=oe+qe*Ff,Pt=ge;for(let Cs of A.rows[qe]){let Yx=Md(Cs.id,n.styleCtx,Pt,Zn);z.push(Yx),Pt+=Yx.box.width+Bn}let $s=Pt-Bn;$s>ue&&(ue=$s)}else{let qe=ge;for(let Zn of C){let Pt=Md(Zn.id,n.styleCtx,qe,oe);z.push(Pt),qe+=Pt.box.width+Bn}ue=C.length>0?qe-Bn:ge}let fe=y??re(i,"owner"),rt=e.description?.text,ht=g.length>0&&Q,mt=null;if(j){let qe=Math.max(...ne.map(Pt=>se(Pt,Nr))),Zn=(E?se(E,11):0)+T;mt=Math.max(qe,Zn)}let Bl=Mf({barRightX:N.x+N.width,iconSpills:X,captionWidth:mt,footnoteCount:ht?g.length:0,dotSpills:G}),{iconSpillX:mN,footnoteSpillStartX:gN,dotSpillCx:yN}=Bl,xN=Math.max(N.x+N.width,Bl.rightX),Ps=e.name;Ps&&(n.entityLeftEdges.set(Ps,O),n.entityRightEdges.set(Ps,P)),zR(e,P,n);let Hx=Ps??Vy(e);n.itemFlowKey.set(Hx,n.currentFlowKey),t.startX=O,t.x=P,t.height=Math.max(t.height,n.bandScale.step()+U);let jx=MR({box:N,afterDate:Bt(o),beforeDate:Bt(s),hasLinkIcon:k,footnoteCount:g.length}),Ur={kind:"item",id:Ps,title:_,...ne.length>=2||ne[0]!==_?{titleLines:ne}:{},box:N,dateSpan:{startX:O,endX:H},status:p,progressFraction:m,footnoteIndicators:g,labelChips:z,chipsOutside:$,chipsRightX:ue,linkIcon:v.icon,linkHref:v.href,hasOverflow:R,overflowBox:b,overflowAnchorId:M,owner:fe,description:rt,metaText:E,textSpills:j,dotSpills:G,iconSpills:X,footnoteSpills:ht,dotSpillCx:yN,iconSpillX:mN,footnoteSpillStartX:gN,decorationsRightX:xN,capacity:x,size:u.size,style:d,inlineDatePins:jx.length>0?jx:void 0},vp=HR(e,n);return vp!==void 0&&(Ur.waveRole=vp),c!==void 0&&(Ur.nonWorkingPin=c),w.truncated&&(Ur.titleTruncated=!0),vp==="background"&&n.waves&&(Ur.waveTooltip=n.waves.backgroundTooltip),n.placedItems.set(Hx,Ur),eb(S,L,Ur),Ur}function Vy(e){let t=e.$cstNode?.range.start;return`#item@${t?t.line+1:0}:${t?t.character+1:0}`}function Ky(e){let t=new Map;for(let n of Q0(e))Ve(n)&&t.set(n.name??Vy(n),n);return t}var V2=.01;function K2(e,t){let n={blocks:[],edges:[]},r=new Map,i=(a,c,l)=>{n.blocks.push({x:a,y:l,width:c,height:0})},o=(a,c)=>{let{box:l}=a;if(a.kind==="item"){n.blocks.push({...l,width:Il(a)-l.x}),n.edges.push({x:l.x,top:l.y,bottom:l.y+l.height},{x:l.x+l.width,top:l.y,bottom:l.y+l.height});return}c&&a.id&&r.set(a.id,a),a.kind==="group"&&a.waveOnly||(a.headerHeight>0&&n.blocks.push({x:l.x,y:l.y,width:Math.max(l.width,hs(a)-l.x),height:a.headerHeight}),i(l.x,l.width,l.y+l.height),n.edges.push({x:l.x,top:l.y,bottom:l.y+l.height},{x:l.x+l.width,top:l.y,bottom:l.y+l.height}));for(let u of a.children)o(u,c)},s=(a,c)=>{i(a.box.x,a.box.width,a.box.y),i(a.box.x,a.box.width,a.box.y+a.box.height);for(let l of a.children)o(l,c);for(let l of a.nested)s(l,c)};for(let a of e)s(a,!0);for(let a of t){i(a.box.x,a.box.width,a.box.y),i(a.box.x,a.box.width,a.box.y+a.box.height);for(let c of a.nestedSwimlanes)s(c,!1)}return{obstacles:n,containers:r}}function qy(e,t,n,r){let{obstacles:i,containers:o}=K2(t,n),s=r.bandScale.bandwidth(),a=be("item",[],r.styleCtx),c=[];for(let[p,m]of e){let g=r.placedItems.get(p);if(!g)continue;let w=Gy(g,s);for(let E of Be(m.properties,"after")){let y=r.placedItems.get(E),x=y?void 0:o.get(E),T;if(y?T=Gy(y,s):x&&(T=DR(x)),T){c.push({fromId:E,toId:p,source:T,target:w});continue}let v=r.entityMidpoints.get(E);if(!v||w.startX-v.x<=V2)continue;let k=w.rowY??w.top;c.push({fromId:E,toId:p,waypoints:[{x:v.x,y:k},{x:w.paintedX,y:k}],slack:!0,...ms(w.bottom-w.top),style:a})}}let l=c.filter(p=>p!==null&&"source"in p),u=QA(l,i,r.scale.pixelsPerDay),f=new Map(l.map((p,m)=>[p,u[m]])),d=[];for(let p of c){if(!p)continue;if(!("source"in p)){d.push(p);continue}let m=f.get(p);m&&d.push({...m,style:a})}return d}function Ud(e,t=0){let n=new Map,r=new Map;return[...e.entries()].forEach(([i,o],s)=>{n.set(i,t+s+1),r.set(i,Be(o.properties,"on"))}),{index:n,hosts:r}}var Wd=11,q2=120,Z2=6,tb="\u2014 ";function rb(e,t,n,r,i=[]){let o=Ft,s=n+Ft,a=r-2*Ft,c=o+2*Ft,l=o+a-Ft,u=s+Gf+Ft,f=[],d=0,p=(g,w,E)=>{for(let[y,x]of g){let T=x.title??y,v=x.description?.text,k=J2(T,v,c,l),C=u+d*ds,$=H=>({x:H.x,y:C+H.row*ds,text:H.text}),O={number:w.footnoteIndex.get(y)??f.length+1,y:C,title:T,titleLines:k.title.map($),description:v,style:be("footnote",x.properties,w.styleCtx)};k.description.length>0&&(O.descriptionLines=k.description.map($)),E!==void 0&&(O.region=E),f.push(O),d+=k.rows}};p(e,t);for(let g of i){if(g.footnotes.size===0)continue;let w=u+d*ds;d+=1;let E=f.length;p(g.footnotes,g.ctx,g.title),f[E].regionHeadingY=w}return{box:{x:o,y:s,width:a,height:f.length===0?0:Gf+d*ds+Ft},entries:f}}function J2(e,t,n,r){let i=r-n,o=nb(e,i,i),s=o.map((g,w)=>({x:n,row:w,text:g}));if(!t)return{title:s,description:[],rows:o.length};let a=se(tb,Wd),c=t.trim().split(/\s+/)[0]??"",l=n+Math.max(q2,e.length*Z2),u=o.length===1&&a+se(c,Wd)<=r-l,f=u?l:n,d=u?o.length-1:o.length,p=nb(t,i,r-f-a),m=p.map((g,w)=>({x:w===0?f:n,row:d+w,text:w===0?`${tb}${g}`:g}));return{title:s,description:m,rows:d+p.length}}function nb(e,t,n){if(se(e,Wd)<=n)return[e];let r=Ti(e,t,Wd,n);return r.length>0?r:[e]}function Nl(e,t,n){let r=[],i=(o,s,a)=>{let c=_e(re(s.properties,"date"));if(!c)return;let l=n.forwardWithinDomain(c);l!==null&&r.push({id:o,centerX:l,radius:6,title:s.title??o,fontSize:10,bold:a,date:c,isMilestone:a})};for(let[o,s]of e)i(o,s,!1);for(let[o,s]of t)i(o,s,!0);return r}function Gd(e,t){return[...eB(e),...tB(t)]}function Is(e,t){let n=new Map;for(let[r,i]of e){let o=t+13+i.rowIndex*26;n.set(r,{rowIndex:i.rowIndex,centerY:o,labelBox:{...i.labelBox,y:o-4},labelSide:i.labelSide})}return n}function Jy(e){return`nonworking:${e.from.toISOString().slice(0,10)}`}function Qy(e){return`working:${e.from.toISOString().slice(0,10)}`}function ib(e,t,n){return{id:e,centerX:t,radius:0,title:n,fontSize:10,bold:!1}}function eB(e){let t=[];for(let n of e??[])n.label!==void 0&&t.push(ib(Jy(n),n.x,n.label));return t}function tB(e){return(e??[]).map(t=>ib(Qy(t),t.x,t.label))}function Oi(e,t,n,r){let i=n;for(let o of e){let s=ob(o,r),a=o.centerX+o.radius+6+s,c=o.centerX-o.radius-6-s;a>n&&c<t&&(i=Math.max(i,a+st))}return i}function ob(e,t){return t(e.title,e.fontSize)*(e.bold?1.05:1)}function Rs(e,t,n,r){let i=[...e].sort((a,c)=>a.centerX-c.centerX),o=new Map,s=[];for(let a of i){let c=ob(a,r),l=a.centerX+a.radius+6,u=a.centerX-a.radius-6-c,f=l+c<=n,d=u>=t,p=a.centerX-a.radius,m=a.centerX+a.radius,g=C=>C==="right"?l:u,w=C=>C==="right"?f:d,E=(C,$)=>{let O=Math.min(p,C),H=Math.max(m,C+c);return s[$].some(P=>P.left<H&&P.right>O)},y=-1,x="right",T=l;e:for(let C=s.length-1;C>=0;C--)for(let $ of["right","left"]){if(!w($))continue;let O=g($);if(!E(O,C)){y=C,x=$,T=O;break e}}if(y===-1){for(let[C,$]of o)o.set(C,{...$,rowIndex:$.rowIndex+1});s=[[],...s],y=0,x=f?"right":"left",T=g(x)}let v=Math.min(p,T),k=Math.max(m,T+c);s[y].push({left:v,right:k}),o.set(a.id,{rowIndex:y,labelBox:{x:T,y:0,width:c,height:12},labelSide:x})}return{placements:o,rowCount:s.length}}function ex(e,t){let n=[];for(let r of e){let i=t.placedItems.get(r),o=t.entityRightEdges.get(r);if(o===void 0)continue;let s=i?void 0:t.entityMidpoints.get(r)?.y,a=i?zy(i,t.bandScale.bandwidth()):s===void 0?void 0:jy(s,t);if(!i&&t.waves?.plan.index.has(r)){n.push({ref:r,endX:o,y:a,flowKey:`wave:${r}`,wave:r});continue}let c=t.itemFlowKey.get(r)??`marker:${r}`;n.push({ref:r,endX:o,y:a,flowKey:c})}return n}function tx(e){let t=new Map;for(let n of e){let r=t.get(n.flowKey);(!r||n.endX>r.endX)&&t.set(n.flowKey,n)}return Array.from(t.values())}function sb(e,t){return e.endX<t&&e.y!==void 0&&e.wave===void 0}function ab(e){let t=null;for(let n of e)n.wave===void 0&&(!t||n.endX>t.endX)&&(t=n);return t}function nB(e,t){let n;for(let r of e)r.wave===void 0||r.endX-t<It||(!n||r.endX>n.endX)&&(n=r);return n?.wave}var nx=class{constructor(t,n){B(this,"id");B(this,"milestone");this.id=t,this.milestone=n}place(t){let n=this.milestone,r=be("milestone",n.properties,t.styleCtx),i=re(n.properties,"date"),o=Be(n.properties,"after"),s=_e(i),a=t.timeline.markerRow.y,c=6,l=n.title??this.id,u=null,f=a,d=!1,p,m=!1,g;if(s){let y=t.scale.forwardWithinDomain(s);if(y===null)return null;u=y,d=!0;let x=t.markerRowPlacements.get(this.id);x&&(f=x.centerY);let T=ex(o,t),v=tx(T),k=ab(v);k&&k.endX>y&&(m=!0,p=[{x:k.endX,y:k.y??jy(f,t)}]),g=nB(v,y),g!==void 0&&(m=!0)}else if(o.length>0){let y=ex(o,t),x=tx(y);x.sort((k,C)=>C.endX-k.endX);let T=x[0]?.endX??t.timeline.originX;u=T,d=!1;let v=[];for(let k=1;k<x.length;k++){let C=x[k];sb(C,T)&&v.push({x:C.endX,y:C.y})}v.length>0&&(p=v)}if(u===null)return null;let w={x:u,y:f};t.entityLeftEdges.set(this.id,w.x),t.entityRightEdges.set(this.id,w.x),t.entityMidpoints.set(this.id,w);let E={id:this.id,title:l,x:u,radius:c,fixed:d,slackArrows:p,isOverrun:m,style:r,cutTopY:t.chartTopY,cutBottomY:t.swimlaneBottomY};return t.waves&&!m&&jR(t.waves,u)&&(E.onWaveBoundary=!0),g!==void 0&&s&&(E.overrunByWave=g,E.overrunDate=wi(s)),s&&!t.scale.showsNonWorking&&!t.calendar.isWorkingDay(s)&&(E.hiddenDate=wi(s)),E}};function zd(e,t){let n=[];for(let[r,i]of e){let o=new nx(r,i).place(t);o&&n.push(o)}return n}function Hd(e,t){return e.map(n=>{let r=t.get(n.id);if(!r)throw new Error(`layout: milestone "${n.id}" has no marker-row placement`);let i={id:n.id,title:n.title,center:{x:n.x,y:r.centerY},radius:n.radius,fixed:n.fixed,slackArrows:n.slackArrows,isOverrun:n.isOverrun,style:n.style,cutTopY:n.cutTopY,cutBottomY:n.cutBottomY,labelBox:r.labelBox,labelSide:r.labelSide};return n.onWaveBoundary&&(i.onWaveBoundary=!0),n.overrunByWave!==void 0&&(i.overrunByWave=n.overrunByWave),n.overrunDate!==void 0&&(i.overrunDate=n.overrunDate),n.hiddenDate!==void 0&&(i.hiddenDate=n.hiddenDate),i})}function lb(e,t){let n=[];for(let[r,i]of e){let o=re(i.properties,"date"),s=Be(i.properties,"after"),a=_e(o),c=ex(s,t),l=tx(c);if(a){let f=t.scale.forwardWithinDomain(a);if(f===null)continue;let d=ab(l);d&&d.endX>f&&d.y!==void 0&&n.push({xStart:Math.min(d.endX,f),xEnd:Math.max(d.endX,f),y:d.y,slackPredId:d.ref,milestoneId:r});continue}if(l.length===0)continue;l.sort((f,d)=>d.endX-f.endX);let u=l[0].endX;for(let f=1;f<l.length;f++){let d=l[f];sb(d,u)&&n.push({xStart:d.endX,xEnd:u,y:d.y,slackPredId:d.ref,milestoneId:r})}}return n}var Ll=16,rB=8,iB=6;function ub(e,t,n,r,i,o){rx(e.content.anchors,t);let s=zd(e.content.milestones,t),a=oB(e.content.anchors,s,t);if(a.length===0)return{anchors:[],milestones:[],laneShift:0};let c=Ll,l=Rs(a,c,Oi(a,c,o-Ll,se),se),u=n+rB,f=u+l.rowCount*26+iB-r,d=i+f,p=Is(l.placements,u);t.markerRowPlacements=p,t.chartTopY=r+f,t.swimlaneBottomY=d;let m=kd(e.content.anchors,t,new Set),g=Hd(s.map(w=>({...w,cutTopY:t.chartTopY,cutBottomY:d,slackArrows:w.slackArrows?.map(E=>({x:E.x,y:E.y+f}))})),p);return{anchors:m,milestones:g,laneShift:f}}function fb(e,t){let n=[...(e.anchors??[]).map(i=>cb(i,!1)),...(e.milestones??[]).map(i=>cb(i,!0))];return n.length===0?t:Oi(n,e.box.x+Ll,t-Ll,se)+Ll}function db(e){let t=0;for(let n of[...e.anchors??[],...e.milestones??[]])t=Math.max(t,n.labelBox.x+n.labelBox.width);return t}function oB(e,t,n){let r=Nl(e,new Map,n.scale),i=o=>({id:o.id,centerX:o.x,radius:o.radius,title:o.title,fontSize:10,bold:!0});return r.push(...t.filter(o=>o.fixed).map(i)),r.push(...t.filter(o=>!o.fixed).map(i)),r}function cb(e,t){return{id:e.id??"",centerX:e.center.x,radius:e.radius,title:e.title,fontSize:10,bold:t}}function rx(e,t){for(let n of Nl(e,new Map,t.scale))t.entityLeftEdges.set(n.id,n.centerX),t.entityRightEdges.set(n.id,n.centerX)}var sB=.8,aB=1;function lB(e){let t=[];return hb(e,t),t}function hb(e,t){for(let n of e)if(n.kind==="item"){let r=cB(n);r>0&&n.box.width>0&&t.push({startX:n.box.x,endX:n.box.x+n.box.width,load:r})}else(n.kind==="parallel"||n.kind==="group")&&hb(n.children,t)}function cB(e){return e.capacity?e.capacity.value:e.size?1:0}function mb(e){if(e.capacityValue<=0||e.warnFraction===null&&e.overFraction===null)return null;let t=lB(e.children);if(t.length===0)return null;let n=new Set;for(let s of t)n.add(s.startX),n.add(s.endX);let r=Array.from(n).sort((s,a)=>s-a);if(r.length<2)return null;let i=[];for(let s=0;s<r.length-1;s++){let a=r[s],c=r[s+1],l=(a+c)/2,u=0;for(let f of t)f.startX<=l&&l<f.endX&&(u+=f.load);i.push({startX:a,endX:c,load:u,classification:uB(u,e.capacityValue,e.warnFraction,e.overFraction)})}let o=[];for(let s of i){let a=o[o.length-1];a&&a.classification===s.classification&&a.endX===s.startX?a.endX=s.endX:o.push({...s})}return{segments:o,capacityValue:e.capacityValue,warnFraction:e.warnFraction,overFraction:e.overFraction}}function uB(e,t,n,r){let i=e/t;return r!==null&&i>=r?"red":n!==null&&i>=n?"yellow":"green"}function gb(e,t){let n=t.get("swimlane"),r=pb(re(e.properties,"utilization-warn-at"),n?re(n.properties,"utilization-warn-at"):void 0,sB),i=pb(re(e.properties,"utilization-over-at"),n?re(n.properties,"utilization-over-at"):void 0,aB);return{warn:r,over:i}}function pb(e,t,n){let i=pB(e??t);return i.kind==="unset"?n:i.kind==="none"?null:i.value}var fB=/^\d+(?:\.\d+)?%$/,dB=/^\d+\.\d+$/;function pB(e){if(e===void 0)return{kind:"unset"};if(e==="none")return{kind:"none"};if(fB.test(e)){let t=parseFloat(e)/100;return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}if(dB.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}return{kind:"unset"}}var jd=class{constructor(t){B(this,"rows");B(this,"opts");B(this,"paintedRightX");this.opts=t,this.paintedRightX=t.laneLeftX,this.rows=[{y:t.originY,height:t.minRowHeight,rightEdge:t.laneLeftX,spillX:t.laneLeftX}]}placeItem(t){let n=this.rows[this.rows.length-1],i=t.desiredStart>=n.rightEdge&&t.desiredStart>=n.spillX&&!this.rowIntersectsCorridor(n,t)&&!this.rowCrossesOwnCorridor(n,t)?n:this.appendRow(Math.max(this.opts.minRowHeight,t.predictedHeight));return{rowIndex:this.rows.length-1,y:i.y}}placeBlock(){let t=this.rows[this.rows.length-1];if(t.rightEdge>this.opts.laneLeftX){let n=this.appendRow(this.opts.minRowHeight);return{rowIndex:this.rows.length-1,y:n.y}}return{rowIndex:this.rows.length-1,y:t.y}}commitItem(t){let n=this.rows[t.rowIndex];n.height=Math.max(n.height,t.placed.box.height,t.rowHeight??0),n.rightEdge=t.logicalEnd,n.spillX=t.spillReservation??this.opts.laneLeftX}commitBlock(t){let n=this.rows[t.rowIndex];n.height=Math.max(n.height,t.blockHeight),n.rightEdge=t.blockEnd,n.spillX=t.spillReservation??this.opts.laneLeftX,t.paintedRight!==void 0&&t.paintedRight>this.paintedRightX&&(this.paintedRightX=t.paintedRight)}usedHeight(){let t=this.rows[this.rows.length-1];return t.y+t.height-this.opts.originY}usedRightX(){let t=this.paintedRightX;for(let n of this.rows)n.rightEdge>t&&(t=n.rightEdge),n.spillX>t&&(t=n.spillX);return t}rowIntersectsCorridor(t,n){return this.opts.slackCorridors.some(r=>r.y>=t.y&&r.y<t.y+t.height&&n.desiredStart<r.xEnd&&n.desiredEnd>r.xStart&&r.slackPredId!==n.childId&&!n.pendingIds?.has(r.slackPredId))}rowCrossesOwnCorridor(t,n){return this.opts.slackCorridors.some(r=>r.slackPredId===n.childId&&r.xStart<n.desiredStart&&t.rightEdge>Math.max(r.xStart,this.opts.laneLeftX))}appendRow(t){let n=this.rows[this.rows.length-1],r={y:n.y+n.height,height:t,rightEdge:this.opts.laneLeftX,spillX:this.opts.laneLeftX};return this.rows.push(r),r}};function ix(e){return Ve(e)?e.name?[e.name]:[]:vt(e).flatMap(ix)}function Yd(e,t,n,r){let i=n.bandScale.step(),o=t.leftX,s=new jd({laneLeftX:o,originY:t.firstRowY,minRowHeight:i,slackCorridors:n.slackCorridors}),a=o,c=Number.POSITIVE_INFINITY,l=new Set(vt(e).flatMap(ix)),u=[];for(let f of vt(e)){for(let $ of ix(f))l.delete($);if(!Ve(f)){let $=Rl(f,a,n),{rowIndex:O,y:H}=s.placeBlock(),P=Sl($,H),R=r.sequenceOne(f,P,n);u.push(R);let b=R.box.x+R.box.width,M=Math.max(i,P.height),_=xb(R);s.commitBlock({rowIndex:O,placed:R,blockHeight:M,blockEnd:b,spillReservation:_>b?_:null,paintedRight:Il(R)}),c=Math.min(c,P.startX),a=Math.max(a,P.x);continue}let d=f,p=Rl(d,a,n),m=n.scale.startX(p),g=Fd(d,m,n),w=m+g.naturalWidth,E=i+g.barExtra,{rowIndex:y,y:x}=s.placeItem({childId:d.name??"",desiredStart:m,desiredEnd:w,predictedHeight:E,pendingIds:l}),T=Sl(p,x),v=Bd(d,T,n,g);u.push(v),c=Math.min(c,T.startX);let k=Math.max(m+g.naturalWidth,v.box.x+v.box.width),C=m+ks(n,m,g.durationDays);a=Math.max(a,C),s.commitItem({rowIndex:y,placed:v,logicalEnd:k,spillReservation:yb(v),rowHeight:E})}return c===Number.POSITIVE_INFINITY&&(c=n.scale.startX(o)),{children:u,timeCursorX:a,timeStartX:c,packer:s}}function yb(e){return e.textSpills||e.chipsOutside||e.dotSpills||e.iconSpills||e.footnoteSpills?Math.max(e.decorationsRightX,e.chipsOutside?e.chipsRightX:0)+6:null}function xb(e){let t=e.box.x+e.box.width;if(e.kind==="item")return Math.max(t,yb(e)??t);let n=hs(e);return Math.max(t,n>t?n+qA:t,...e.children.map(xb))}var Eb=10;function hB(e,t,n){let r=re(e.properties,"capacity"),i=Rr(r);if(i===null)return{capacity:null,badgeWidthPx:0};let o=Ka(i),s=qa(t.capacityIcon,n),a=Ei(o,s,Eb);return{capacity:{value:i,text:o,icon:s},badgeWidthPx:a}}var mB=10,gB=38,yB=8;function xB(e,t,n){let r=e.title??e.name??"";if(!r)return 0;let i=re(e.properties,"owner");return dl(0,r,i??void 0,t,n).rightX}function EB(e,t){if(!e.name)return[];let n=[];for(let[r,i]of t.footnoteHosts.entries())if(i.includes(e.name)){let o=t.footnoteIndex.get(r);o!==void 0&&n.push(o)}return n.sort((r,i)=>r-i),n}function wB(e,t,n){for(let r of e.content)if(r.$type!=="DescriptionDirective")return n.scale.startX(Rl(r,t,n))}var bs=class{constructor(t,n){B(this,"input");B(this,"helpers");this.input=t,this.helpers=n}get id(){return this.input.lane.name??""}place(t,n){let{lane:r,bandIndex:i}=this.input,{helpers:o}=this,s=be("swimlane",r.properties,n.styleCtx),a=t.x,c=n.bandScale.step(),l=n.currentFlowKey;n.currentFlowKey=`lane:${r.name??i}`;let{capacity:u,badgeWidthPx:f}=hB(r,s,n.symbols),d=EB(r,n),p=d.length>0?se(d.join(","),Eb):0,m=xB(r,f,p),g=wB(r,a,n),w=!r.title||g===void 0||g>=m+yB,E=t.y+(w?mB:gB),y=Yd(r,{leftX:a,firstRowY:E},n,o),{children:x}=y,T=E-t.y,v=Math.max(c+32,T+y.packer.usedHeight()+16),k=Math.max(y.packer.usedRightX(),m),C={x:0,y:t.y,width:0,height:v},$=re(r.properties,"owner"),O;if($){let P=n.teams.get($),R=n.persons.get($);O=P?.title??R?.title??$}let H=u?(()=>{let{warn:P,over:R}=gb(r,n.styleCtx.defaults);return mb({children:x,capacityValue:u.value,warnFraction:P,overFraction:R})})():null;return n.currentFlowKey=l,{positioned:{id:r.name,title:r.title??r.name??"",box:C,bandIndex:i,children:x,nested:[],style:s,owner:O,footnoteIndicators:d,capacity:u,utilization:H},usedHeight:v,usedRightX:k}}};var TB=18,vB=14,_B=14,AB=16,kB=32;function ox(e,t,n,r,i){let o=n+TB,s=[],a=[],c=!0,l=t.footnoteIndex.size;for(let u of e){c||(o+=AB),c=!1;let f=u.content.roadmap?.title??u.sourcePath,d=o+vB,p=$d(u,{theme:t.styleCtx.theme,cal:t.cal,schedule:t.schedule,timeline:t.timeline,scale:t.scale,calendar:t.calendar,axisColumns:t.axisColumns,bandScale:t.bandScale,waves:t.waves},{chartTopY:d,estimatedChartTopY:t.estimatedChartTopY,chartBottomY:d,swimlaneBottomY:d},{footnotes:Ud(u.content.footnotes,l)});l+=u.content.footnotes.size,t.waves?Ld(t.waves,p.entityLeftEdges,p.entityRightEdges):rx(u.content.anchors,p);let m=[],g=d,w=0;for(let k of u.content.swimlanes.values()){p.nextParallelId=0,p.nextGroupId=0;let{positioned:C,usedHeight:$}=new bs({lane:k,bandIndex:w},r).place({x:p.timeline.originX,y:g},p);m.push(C),g+=$,w++}let E=ub(u,p,o,d,g,i);if(E.laneShift!==0){for(let k of m)_s(k,E.laneShift);g+=E.laneShift}let y=g,x=Math.max(t.bandScale.bandwidth(),y-o+_B),T={x:0,y:o,width:0,height:x},v={sourcePath:u.sourcePath,label:f,box:T,nestedSwimlanes:m,style:be("swimlane",[],t.styleCtx)};E.anchors.length>0&&(v.anchors=E.anchors),E.milestones.length>0&&(v.milestones=E.milestones),s.push(v),a.push(p),o+=x}return{regions:s,contexts:a,endY:o}}function wb(e,t){let n=Vd(e,t);e.box.width=n;for(let r of e.nestedSwimlanes)r.box.width=n}function Vd(e,t){let n=e.box.x,{chromeRightX:r}=pl(n,e.label,e.sourcePath),i=As(e.nestedSwimlanes),o=Math.max(r,i,db(e))+kB;return Math.min(t-n,o-n)}function Tb(e,t,n,r){if(!e)return null;let i=t.scale.forwardWithinDomain(e);if(i===null)return null;let o=t.timeline.box.y,s=t.timeline.tickPanelY,a=Gn(n).nowLabel,c=se(a,sl),l=Math.max($g,Math.ceil(c+2*fs)),u=t.timeline.originX-st,f=l/2,d;i-f<u?d="flag-right":i+f>r?d="flag-left":d="center";let p=t.timeline.bottomTickPanelY,m=t.timeline.bottomTickPanelHeight??0,g=p!==void 0&&m>0?p+m:t.swimlaneBottomY;return{x:i,topY:s,bottomY:g,pillTopY:o,pillMode:d,label:a,pillWidth:l,style:be("item",[],t.styleCtx)}}function Kd(e){let t=e.trim().replace(/^#/,"");if(t.length===3&&(t=t.split("").map(n=>n+n).join("")),!/^[0-9a-fA-F]{6}$/.test(t))throw new Error(`Unsupported hex colour: ${e}`);return[Number.parseInt(t.slice(0,2),16),Number.parseInt(t.slice(2,4),16),Number.parseInt(t.slice(4,6),16)]}function vb(e){let[t,n,r]=Kd(e).map(i=>{let o=i/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r}function qd(e,t){let n=vb(e),r=vb(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}var IB=4.5;function kb(e,t,n,r,i){if(!e.frozen||!e.solve)throw new Error("buildWaves: the wave barrier has not settled");let o=t.timeline.waveStrip;if(!o)throw new Error("buildWaves: the timeline has no wave strip");let s=Nd(e.plan,e.solve,e.pass,e.origin,e.floors,It),a=s.every(y=>y.memberCount===0),c=t.timeline.box.x,l=c+t.timeline.box.width,u=o.y+o.height/2,f=[],d=0,p=s.map((y,x)=>{let T=e.plan.waves[x],v=T.title??y.id,k=y.memberCount===0,C=Pd(y.start,t),$=YR(y.start,y.end,t),O=k?void 0:d++,H=RB(y.id,t),P=bB(T.properties,O,t),R=Math.max(y.start,c),b=Math.min(y.end,l),M=Math.max(0,b-R),_,S=!1;if(!k){if(H.length>0){let Q=H.length*Zt;_=_b(v,y.id,x+1,M,Q),S=_!==void 0}_??(_=_b(v,y.id,x+1,M,0))}let L=(R+b)/2,F;if(k&&(L=y.start,!a)){let Q=f.filter(j=>Math.abs(j-y.start)<It).length;f.push(y.start),L=y.start+Q*Jg,F={x:L,y:u}}let N=k?sx(C):`${sx(C)} \u2013 ${sx($)}`,W=[v,N];k?W.push(n.waveNoItems):y.heldBy!==void 0&&W.push(`${n.waveHeldBy} ${y.heldBy}`);let G,X=s[x-1];if(!a&&X!==void 0&&y.floorRef!==void 0&&y.start-X.end>It){let Q=Math.max(X.end,c),j=Math.min(y.start,l);se(y.floorRef,mn)+2*Wn<=j-Q&&(G={text:y.floorRef,x:(Q+j)/2})}return{id:y.id,title:v,index:x,...O!==void 0?{visibleOrdinal:O}:{},startX:y.start,endX:y.end,startDate:C,endDate:$,memberCount:y.memberCount,empty:k,...y.heldBy!==void 0?{heldBy:y.heldBy}:{},...y.floorRef!==void 0?{floorRef:y.floorRef}:{},columnBox:{x:y.start,y:t.chartTopY,width:y.end-y.start,height:t.swimlaneBottomY-t.chartTopY},strip:{box:{x:y.start,y:o.y,width:y.end-y.start,height:o.height},..._?{label:_.label}:{},labelKind:_?.kind??"none",labelX:L,tooltip:W.join(" \xB7 "),footnotesShown:S,...F?{marker:F}:{},...G?{gapLabel:G}:{}},style:P,footnoteIndicators:H}}),m=a?[]:LB(p,e.origin,o.y,t),g=ax(r),w=i.map(y=>ax(y.nestedSwimlanes)),E={waves:p,boundaries:m,crossings:Ab(g,m),regionCrossings:w.map(y=>Ab(y,m)),hasBackground:g.length+w.flat().length>0};return a&&(E.placeholder=yR(n,p.map(y=>y.title))),E}function _b(e,t,n,r,i){let o=a=>se(a,mn)*1.05+i+2*Wn<=r;if(o(e))return{kind:"title",label:e};if(t!==e&&o(t))return{kind:"id",label:t};for(let a=e.length-1;a>=3;a--){let c=e.slice(0,a).trimEnd();if(c.length<3)break;let l=`${c}\u2026`;if(o(l))return{kind:"ellipsis",label:l}}let s=`#${n}`;if(o(s))return{kind:"ordinal",label:s}}function RB(e,t){let n=[];for(let[r,i]of t.footnoteHosts.entries()){if(!i.includes(e))continue;let o=t.footnoteIndex.get(r);o!==void 0&&n.push(o)}return n.sort((r,i)=>r-i)}function bB(e,t,n){let r=n.styleCtx.theme,i=new Map,o=re(e,"style"),s=o?n.styleCtx.styles.get(o):void 0;for(let d of s?.properties??[])i.set(q(d),d.value);let a=d=>{let p=i.get(d);if(p===void 0)return;let m=Yn(p,r);return m==="none"?void 0:m},c=a("bg"),l=t!==void 0&&t%2===1?r.wave.stripFillAlt:r.wave.stripFill,u=c?SB(l,c,cl)??l:l,f=i.get("border");return{...c?{tint:c}:{},stripFill:l,text:a("text")??NB(r.wave,u),boundary:a("fg")??r.wave.boundary,boundaryDash:f==="dashed"?"4 2":f==="dotted"?"1 2":null}}var Zd=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function SB(e,t,n){if(!Zd.test(e)||!Zd.test(t))return;let r=Kd(e),i=Kd(t);return`#${r.map((o,s)=>Math.round(o*(1-n)+i[s]*n).toString(16).padStart(2,"0")).join("")}`}function NB(e,t){let n=e.labelText;return!Zd.test(n)||!Zd.test(t)||qd(n,t)>=IB?n:qd(e.hatch,t)>=qd(e.hatchOnDark,t)?e.hatch:e.hatchOnDark}function LB(e,t,n,r){let i=[];for(let a of e)a.empty||(i.push({x:a.startX,wave:a,opening:!0}),i.push({x:a.endX,wave:a,opening:!1}));i.sort((a,c)=>a.x-c.x);let o=[],s=0;for(;s<i.length;){let a=s;for(;a<i.length&&i[a].x-i[s].x<It;)a++;let c=i.slice(s,a);s=a;let l=c[0].x;if(Math.abs(l-t)<It)continue;let u=(c.find(f=>f.opening)??c[0]).wave;o.push({x:l,topY:n,bottomY:r.swimlaneBottomY,stroke:u.style.boundary,dash:u.style.boundaryDash})}return o}function ax(e){let t=[],n=r=>{for(let i of r)i.kind==="item"?i.waveRole==="background"&&t.push(i):n(i.children)};for(let r of e)n(r.children),t.push(...ax(r.nested));return t}function Ab(e,t){let n=[];for(let r of e){let i=r.box.x,o=r.box.x+r.box.width;for(let s of t)i<s.x&&s.x<o&&n.push({x:s.x,topY:r.box.y,bottomY:r.box.y+r.box.height,stroke:s.stroke})}return n}var PB="\u2070\xB9\xB2\xB3\u2074\u2075\u2076\u2077\u2078\u2079";function $B(e){return String(e).replace(/[0-9]/g,t=>PB[Number(t)])}function Ib(e,t,n,r,i){let{waves:o}=e,s=o.some(v=>!v.empty&&v.strip.labelKind!=="title"),a=o.some(v=>v.empty),c=o.some(v=>v.footnoteIndicators.length>0&&!v.strip.footnotesShown);if(!e.hasBackground&&!s&&!a&&!c)return;let l=mn,u=v=>se(v,l),f=t.timeline.originX,d=Math.max(f,i-st),p=0,m=f,g=!1,w=0,E=v=>r+v*ul+Qf,y=v=>{g&&m+Jf+v>d&&(p++,m=f,g=!1);let k=g?m+Jf:m;return m=k+v,g=!0,w=Math.max(w,m-f),k},x=[],T=(v,k)=>{let C=qf+Qg,$=y(C+u(k)),O=E(p);x.push({kind:v,text:k,swatch:{x:$,y:O-Qf+(ul-Zf)/2,width:qf,height:Zf},runs:[{text:k,x:$+C,y:O}]})};if(e.hasBackground&&T("background",n.waveLegendBackground),e.boundaries.length>0&&T("boundary",n.waveLegendBoundary),s||a||c){let v=o.map(O=>{let H=`#${O.index+1} ${O.title}`;return O.footnoteIndicators.length>0&&!O.strip.footnotesShown&&(H+=` ${O.footnoteIndicators.map($B).join(",")}`),O.empty&&(H+=` (${n.waveNoItems})`),H}),k=" \xB7 ",C=`${n.waveLegendPrefix} ${v[0]}`,$=[{text:C,x:y(u(C)),y:E(p)}];for(let O of v.slice(1)){let H=$[$.length-1];m+u(k+O)<=d?(H.text+=k+O,m+=u(k+O),w=Math.max(w,m-f)):(p++,m=f,g=!1,$.push({text:O,x:y(u(O)),y:E(p)}))}x.push({kind:"waves",text:`${n.waveLegendPrefix} ${v.join(k)}`,runs:$})}return{box:{x:f,y:r,width:w,height:(p+1)*ul},entries:x}}function sx(e){return e.toISOString().slice(0,10)}var Rb=1e-6,Ss=class{constructor(t){B(this,"domain");B(this,"range");B(this,"pixelsPerDay");B(this,"calendar");B(this,"nonWorking");this.domain=t.domain,this.range=t.range,this.calendar=t.calendar,this.nonWorking=t.nonWorking??"hide";let n=Math.max(1,this.showsNonWorking?At(t.domain[0],t.domain[1]):this.indexOf(t.domain[1]));this.pixelsPerDay=(t.range[1]-t.range[0])/n}get showsNonWorking(){return this.nonWorking==="show"&&this.calendar?.hasNonWorkingDays===!0}indexOf(t){return this.calendar?this.calendar.workingIndexOf(this.domain[0],t):At(this.domain[0],t)}dayAt(t){let n=(t-this.range[0])/this.pixelsPerDay;return{days:n,day:Math.floor(n+Rb)}}forward(t){return this.showsNonWorking?this.range[0]+At(this.domain[0],t)*this.pixelsPerDay:this.range[0]+this.indexOf(t)*this.pixelsPerDay}forwardWithinDomain(t){return t<this.domain[0]||t>this.domain[1]?null:this.forward(t)}invert(t){let n=Math.round((t-this.range[0])/this.pixelsPerDay);return this.showsNonWorking?Ue(this.domain[0],n):this.calendar?this.calendar.dateAtWorkingIndex(this.domain[0],n):Ue(this.domain[0],n)}indexAtX(t){let{days:n,day:r}=this.dayAt(t);if(!this.showsNonWorking||!this.calendar)return n;let i=Ue(this.domain[0],r),o=this.calendar.workingIndexOf(this.domain[0],i);return this.calendar.isWorkingDay(i)?o+Math.max(0,n-r):o}startX(t){if(!this.showsNonWorking||!this.calendar)return t;let n=Ue(this.domain[0],this.dayAt(t).day);if(this.calendar.isWorkingDay(n))return t;let r=this.calendar.workingIndexOf(this.domain[0],n);return this.forward(this.calendar.dateAtWorkingIndex(this.domain[0],r))}advanceX(t,n){if(!this.showsNonWorking||!this.calendar)return t+n*this.pixelsPerDay;let r=this.startX(t);if(n<=0)return r;let i=this.indexAtX(r)+n,o=Math.ceil(i-Rb)-1,s=i-o,a=this.calendar.dateAtWorkingIndex(this.domain[0],o);return this.forward(a)+s*this.pixelsPerDay}get originX(){return this.range[0]}get widthPx(){return this.range[1]-this.range[0]}};var Jd=6,OB=4,bb=8,ep=class{constructor(t){B(this,"input");this.input=t}measure(){let{title:t,author:n,style:r,logo:i}=this.input,o=r.headerPosition==="beside",s=DB(t,n,i),a=i?Math.max(Mg,i.height+20):Mg;return{position:r.headerPosition,titleLines:s.titleLines,authorLines:s.authorLines,cardWidth:s.cardWidth,cardHeight:s.cardHeight,textCardHeight:s.textCardHeight,logoSlot:s.logoSlot,...i?{logo:i}:{},chartLeftX:o?s.boxWidth:0,aboveHeight:a,chartTopY:o?bb:a+bb,minRowsBottomY:o?s.cardHeight+OB:0}}place(t,n){let{title:r,author:i,style:o}=this.input,s=t.position==="beside",a=s?{x:0,y:0,width:t.chartLeftX,height:n.chartBottomY}:{x:0,y:0,width:n.canvasRightX,height:t.aboveHeight},c=s?{x:Jd,y:n.rowsBottomY-t.cardHeight,width:t.cardWidth,height:t.cardHeight}:{x:0,y:0,width:n.canvasRightX,height:t.aboveHeight},l,u;return t.logo&&(l={box:{x:a.x+c.x+16,y:a.y+c.y+(c.height-t.logo.height)/2,width:t.logo.width,height:t.logo.height},assetRef:t.logo.assetRef,intrinsic:t.logo.intrinsic},u={x:t.logoSlot,y:Math.max(0,(c.height-t.textCardHeight)/2)}),{box:a,position:o.headerPosition,title:r,author:i,titleLines:t.titleLines,authorLines:t.authorLines,cardBox:c,logo:l,...u?{textInset:u}:{},style:o}}};function DB(e,t,n){let r=Dg-32,i=Ti(e,r,16),o=Ti(t??"",r,11),s=0;for(let w of i)s=Math.max(s,se(w,16));for(let w of o)s=Math.max(s,se(w,11));let a=i.length>0||o.length>0,c=n?n.width+(a?12:0):0,l=s+32,u=Math.max(zA-Jd,Math.min(Dg-Jd,l)+c),f=i.length>0?(i.length-1)*20:0,d=o.length>0?18+(o.length-1)*14:0,p=26+f+d+14,m=n?Math.max(p,n.height+20):p,g=u+Jd;return{titleLines:i,authorLines:o,cardWidth:u,cardHeight:m,textCardHeight:p,logoSlot:c,boxWidth:g}}var MB=8;function Lb(e,t,n,r,i){let{locale:o,styleCtx:s}=r,{calendar:a,preset:c,startDate:l,timelineDays:u,nonWorking:f}=i,d=i.naturalEndDate,p=i.schedule.plan,m=r.roadmapStyle,g=il[m.headerHeight]??il.md,w=g>0&&m.timelinePosition!=="bottom",E=g>0&&(m.timelinePosition==="bottom"||m.timelinePosition==="both"),y=e.roadmapDecl?.title??e.roadmapDecl?.name??"",x=re(e.roadmapDecl?.properties??[],"author"),T=new ep({title:y,author:x,style:m,logo:tk(e,n.logo)}),v=T.measure(),{chartLeftX:k}=v,C=PA({naturalPixelsPerDay:c.pixelsPerUnit/a.daysPerUnit(c.unit),dayCount:u,chromeWidth:k+2*st,maxWidth:n.width}),$=u*C,O=k+st,H=$,R=n.today!==void 0&&n.today>=l&&n.today<=d?Mt:0,b=w?g:0,M=p?Hg:0,_=new Ss({domain:[l,d],range:[O,O+$],calendar:a,nonWorking:f}),S=Gd(Fy(_,[],c.unit,!1),By(_)),L=t.content.anchors.size+t.content.milestones.size>0||S.length>0,F=O+H+st,N=Nl(t.content.anchors,t.content.milestones,_),W=[...N,...S],G=Rs(W,k,Oi(W,k,F,se),se),X=L?Math.max(1,G.rowCount):0,Q=X*26,j=R+b+M+Q,ne=j+MB,A=dx(v,j),D=A+R,U=D+b,z=U+M,J=_d(_,c,a,o),Z={box:{x:O,y:A,width:$,height:0},ticks:J,pixelsPerDay:C,originX:O,startDate:l,endDate:d,labelStyle:be("roadmap",[],s),pillRowHeight:R,tickPanelY:D,tickPanelHeight:b,markerRow:{y:z+13,height:Q,collisionY:z-8},minorGrid:m.minorGrid,...p?{waveStrip:{y:U,height:M}}:{}};return px(Z,_,c.unit),{header:v,headerNode:T,axis:{originX:O,ppd:C,naturalWidth:$,scale:_},naturalChartRightX:F,bands:{timelineY:A,pillRowHeight:R,tickPanelY:D,tickPanelHeight:b,waveStripY:U,markerRowY:z,estimatedMarkerRows:X,rowsHeight:j,chartTopY:A+ne,bottomTickPanelHeight:E?g:0},timeline:Z,markers:{datePinned:N,placements:Is(G.placements,z),hasEntities:L}}}function dx(e,t){return Math.max(e.chartTopY,e.minRowsBottomY-t)}function px(e,t,n){let r=Fy(t,e.ticks,n,e.minorGrid);r&&(e.nonWorkingDisplay=t.showsNonWorking?"show":"hide",e.nonWorking=r);let i=By(t);i&&(e.workingExceptions=i)}var Pb=8,hx=class{constructor(t){B(this,"rightX");B(this,"frozen",!1);this.rightX=t}grow(t){if(this.frozen)throw new Error("layout: the canvas grew after it was frozen");return t<=this.rightX?!1:(this.rightX=t,!0)}freeze(){this.frozen=!0}get provisional(){return this.rightX}get final(){if(!this.frozen)throw new Error("layout: the canvas was read before it was final");return this.rightX}},FB;var tp=class{constructor(t,n,r,i,o,s,a){B(this,"file");B(this,"resolved");B(this,"options");B(this,"scope");B(this,"window");B(this,"measured");B(this,"chart");B(this,"canvas");B(this,"chartY");B(this,"draft",{});B(this,"scaleIsFinal",!1);B(this,"band");B(this,"rowsTop");B(this,"rowsBottom");B(this,"why");this.file=t,this.resolved=n,this.options=r,this.scope=i,this.window=o,this.measured=s,this.chart=a,this.canvas=new hx(s.naturalChartRightX);let c=a.ctx;this.chartY={get top(){return c.chartTopY},set top(l){c.chartTopY=l},get swimlaneBottom(){return c.swimlaneBottomY},set swimlaneBottom(l){c.swimlaneBottomY=l},get bottom(){return c.chartBottomY},set bottom(l){c.chartBottomY=l}}}get ctx(){return this.chart.ctx}get scale(){return this.chart.ctx.scale}finalScale(){if(!this.scaleIsFinal)throw new Error("layout: the final scale was read before the timeline extension");return this.chart.ctx.scale}extendScale(t){if(this.scaleIsFinal)throw new Error("layout: the scale was extended after it was final");this.chart.ctx.scale=t}settleScale(){this.scaleIsFinal=!0}markerBand(){if(!this.band)throw new Error("layout: the marker band was read before the final pack");return this.band}setMarkerBand(t){if(this.band)throw new Error("layout: the marker band was packed twice");this.band=t,this.chart.ctx.markerRowPlacements=t.placements}headerRowsTop(){return this.rowsTop||(this.rowsTop=BB(this.measured,this.options.today,this.finalScale())),this.rowsTop}headerRowsBottom(){if(this.rowsBottom===void 0)throw new Error("layout: the header rows bottom was read before the rows grew");return this.rowsBottom}setHeaderRowsBottom(t){if(this.rowsBottom!==void 0)throw new Error("layout: the header rows grew twice");this.rowsBottom=t}explain(t){this.why=t}report(t,n){FB?.(t,n,this.why),this.why=void 0}};function BB(e,t,n){let{bands:r,header:i}=e;if(!(r.pillRowHeight===0&&t!==void 0&&n.forwardWithinDomain(t)!==null))return{timelineY:r.timelineY,pillRowHeight:r.pillRowHeight,tickPanelY:r.tickPanelY,markerRowY:r.markerRowY,shift:0};let s=dx(i,Mt+r.rowsHeight),a=s+Mt,c=a-r.tickPanelY;return{timelineY:s,pillRowHeight:Mt,tickPanelY:a,markerRowY:r.markerRowY+c,shift:c}}function WB(e){return e.canvas.grow(e.chart.maxRightX+st)}function UB(e){let{swimlanes:t,includes:n,milestones:r}=e.chart,{calendar:i,preset:o,startDate:s,spanDays:a,nonWorking:c}=e.window,{originX:l,ppd:u}=e.measured.axis,f=e.measured.timeline,d=As(t);for(let k of n)d=Math.max(d,As(k.nestedSwimlanes));let p=0;for(let k of e.measured.markers.datePinned)p=Math.max(p,k.centerX+k.radius);let m=0;for(let k of r)k.fixed?p=Math.max(p,k.x+k.radius):m=Math.max(m,k.x+k.radius);for(let k of n){for(let C of k.anchors??[])p=Math.max(p,C.center.x+C.radius);for(let C of k.milestones??[])C.fixed?p=Math.max(p,C.center.x+C.radius):m=Math.max(m,C.center.x+C.radius)}let g=Math.max(d,p,m),w=i.daysPerUnit(o.unit),E=e.scale.showsNonWorking?e.scale.indexAtX(g):(g-l)/u,y=E>0?$i(s,E,o.unit,w,i):0,x=Id(t);for(let k of n)x=Math.max(x,Id(k.nestedSwimlanes));let T=new vs(e.window,e.scale);if(x>0){let k=Math.max(a,y);T.isPast(x,k)&&(y=Math.max(y,Math.min(T.boundaryAtOrAfterX(x),T.captionColumn(k).end)))}let v=!1;if(y>a){let k={bar:d,caption:x,datedMarker:p,afterMilestone:m};e.explain(Object.keys(k).filter(H=>k[H]>0&&T.isPast(k[H],a)));let C=i.dateAtWorkingIndex(s,y),$=e.scale.showsNonWorking?At(s,C)*u:y*u,O=new Ss({domain:[s,C],range:[l,l+$],calendar:i,nonWorking:c});e.extendScale(O),f.endDate=C,f.box.width=$,f.ticks=_d(O,o,i,e.scope.locale),px(f,O,o.unit),e.canvas.grow(l+$+st),v=!0}return e.settleScale(),v}function XB(e){let t=e.measured.timeline,n=e.measured.markers.datePinned.map(s=>({id:s.id,centerX:s.centerX,radius:s.radius,title:s.title,fontSize:s.fontSize,bold:s.bold}));for(let s of e.chart.milestones)s.fixed||n.push({id:s.id,centerX:s.x,radius:s.radius,title:s.title,fontSize:10,bold:!0});let r=Gd(t.nonWorking,t.workingExceptions);n.push(...r),e.draft.markerEntries={all:n,calendarCount:r.length};let i=Oi(n,e.measured.header.chartLeftX,e.canvas.provisional,se);for(let s of e.chart.includes)i=Math.max(i,fb(s,e.canvas.provisional));let o=e.canvas.grow(i);return e.canvas.freeze(),o}function GB(e){let t=e.canvas.final,n=e.measured.naturalChartRightX,r=e.chart.swimlanes.length>0&&t!==n;for(let i of e.chart.swimlanes)i.box.width=t;for(let i of e.chart.includes)Vd(i,t)!==Vd(i,n)&&(r=!0),wb(i,t);return r}function zB(e){let t=Wt(e.draft.markerEntries,"the marker entries"),n=Rs(t.all,e.measured.header.chartLeftX,e.canvas.final,se),r=Is(n.placements,e.headerRowsTop().markerRowY),i=e.measured.markers.hasEntities||t.calendarCount>0?Math.max(1,n.rowCount):0;e.setMarkerBand({rowCount:i,placements:r});let o=!1;for(let[s,a]of e.measured.markers.placements){let c=r.get(s);(!c||!iW(a,c))&&(o=!0)}return o}function HB(e){let t=e.markerBand(),n=e.ctx,r=e.measured.timeline,i=Hd(e.chart.milestones,t.placements),o=i.some(s=>n.entityMidpoints.get(s.id??"")?.y!==s.center.y);for(let s of r.nonWorking??[]){if(s.label===void 0)continue;let a=t.placements.get(Jy(s));a&&(s.labelBox=a.labelBox,s.labelSide=a.labelSide)}for(let s of r.workingExceptions??[]){let a=t.placements.get(Qy(s));a&&(s.labelBox=a.labelBox,s.labelSide=a.labelSide)}for(let s of e.measured.markers.datePinned){let a=t.placements.get(s.id);a&&n.entityMidpoints.set(s.id,{x:s.centerX,y:a.centerY})}for(let s of i)s.fixed||n.entityMidpoints.set(s.id??"",{x:s.center.x,y:s.center.y});return e.draft.milestones=i,o}function jB(e){let t=e.markerBand(),n=e.headerRowsTop(),r=e.measured.bands,i=r.estimatedMarkerRows,o=e.ctx,s=o.timeline,a=!1;n.pillRowHeight!==r.pillRowHeight&&(s.box.y=n.timelineY,s.pillRowHeight=n.pillRowHeight,s.tickPanelY=n.tickPanelY,s.waveStrip&&(s.waveStrip.y+=n.shift),s.markerRow.y+=n.shift,s.markerRow.collisionY+=n.shift,a=!0);let c=n.shift;t.rowCount>i&&(c+=(t.rowCount-i)*26,s.markerRow.height=t.rowCount*26,a=!0),e.setHeaderRowsBottom(n.markerRowY+s.markerRow.height);let l=o.estimatedChartTopY+c;e.chartY.top=l,e.chartY.bottom+=l,e.chartY.swimlaneBottom+=l,s.box.height=e.chartY.bottom-s.box.y;for(let u of e.chart.swimlanes)_s(u,l);for(let u of e.chart.includes)PR(u,l);for(let u of Wt(e.draft.milestones,"the milestones"))$R(u,l);return a}function YB(e){let t=e.measured.bands.bottomTickPanelHeight;return t<=0?!1:(e.ctx.timeline.bottomTickPanelY=e.chartY.bottom+Pb,e.ctx.timeline.bottomTickPanelHeight=t,e.chartY.bottom+=Pb+t,!0)}function VB(e){e.finalScale();let t=e.ctx;if(!t.waves)return!1;let n=kb(t.waves,t,Gn(e.scope.locale),e.chart.swimlanes,e.chart.includes);return n.regionCrossings.forEach((r,i)=>{r.length>0&&(e.chart.includes[i].waveCrossings=r)}),n.placeholder!==void 0&&t.timeline.waveStrip&&(t.timeline.waveStrip.placeholder=n.placeholder),e.draft.waves=n,!0}function KB(e){e.finalScale(),e.markerBand();let t=new Set(Wt(e.draft.milestones,"the milestones").map(r=>r.center.x)),n=kd(e.resolved.content.anchors,e.ctx,t);return e.draft.anchors=n,n.length>0}function qB(e){let t=Ky(e.chart.laneEntries),n=qy(t,e.chart.swimlanes,e.chart.includes,e.ctx);e.draft.edges=n;let r=0;return e.resolved.content.isolatedRegions.forEach((i,o)=>{let s=e.chart.includes[o],a=e.chart.regionContexts[o];if(!s||!a)return;let c=qy(Ky([...i.content.swimlanes.values()]),s.nestedSwimlanes,[],a);c.length>0&&(s.edges=c),r+=c.length}),n.length+r>0}function ZB(e){e.finalScale();let t=Tb(e.options.today,e.ctx,e.scope.locale,e.canvas.final);return e.draft.nowline=t,t!==null}function JB(e){let t=e.draft.waves;if(!t)return!1;let n=Ib(t,e.ctx,Gn(e.scope.locale),e.chartY.bottom+Kf,e.canvas.final);return n?(e.chartY.bottom+=Kf+n.box.height,e.draft.waveLegend=n,!0):!1}function QB(e){let t=e.resolved.content.isolatedRegions.flatMap((r,i)=>{let o=e.chart.regionContexts[i],s=e.chart.includes[i];return o&&s?[{title:s.label,footnotes:r.content.footnotes,ctx:o}]:[]}),n=rb(e.resolved.content.footnotes,e.ctx,e.chartY.bottom,e.canvas.final,t);return e.draft.footnotes=n,n.entries.length>0}function eW(e){let{header:t,headerNode:n}=e.measured;return e.draft.header=n.place(t,{rowsBottomY:e.headerRowsBottom(),chartBottomY:e.chartY.bottom,canvasRightX:e.canvas.final}),t.position==="beside"}function tW(e){let t=Wt(e.draft.footnotes,"the footnote panel"),n=e.canvas.final,r=t.entries.length>0?t.box.y+t.box.height:e.chartY.bottom,i={x:n-st-Xg,y:r+st,width:Xg,height:jA};return e.draft.attributionBox=i,e.draft.height=i.y+i.height+st,!0}var nW=[{name:"growCanvasForSpill",reads:["placement"],writes:["canvas"],run:WB},{name:"extendTimeline",reads:["placement","window","scale"],writes:["scale","timeline","calendarRuns","canvas"],run:UB},{name:"growCanvasForMarkerLabels",reads:["placement","calendarRuns","canvas"],writes:["markerEntries","canvas"],run:XB},{name:"fitWidths",reads:["placement","canvas"],writes:["laneWidths"],run:GB},{name:"packMarkers",reads:["canvas","markerEntries","headerBands","scale"],writes:["markerBand"],run:zB},{name:"placeMarkers",reads:["placement","markerBand","calendarRuns"],writes:["milestones","calendarLabels","markerMidpoints"],run:HB},{name:"growHeaderRows",reads:["markerBand","headerBands","scale","milestones","chartTop","laneBottom"],writes:["chartTop","rowsBottom","laneBottom","chartBottom","laneY","milestones","timeline"],run:jB},{name:"bottomTickPanel",reads:["headerBands","chartBottom"],writes:["chartBottom","timeline"],run:YB},{name:"waves",reads:["scale","chartTop","laneBottom","timeline","laneY"],writes:["waves","timeline"],run:VB},{name:"anchors",reads:["scale","markerBand","chartTop","laneBottom","milestones"],writes:["anchors","markerMidpoints"],run:KB},{name:"dependencyEdges",reads:["laneY","markerMidpoints"],writes:["edges"],run:qB},{name:"nowline",reads:["scale","canvas","laneBottom","timeline"],writes:["nowline"],run:ZB},{name:"waveLegend",reads:["waves","canvas","chartBottom"],writes:["legend","chartBottom"],run:JB},{name:"footnotePanel",reads:["chartBottom","canvas"],writes:["footnotes"],run:QB},{name:"header",reads:["chartBottom","canvas","rowsBottom"],writes:["header"],run:eW},{name:"attribution",reads:["footnotes","chartBottom","canvas"],writes:["attribution"],run:tW}];function $b(e,t=nW){for(let n of t)e.report(n.name,n.run(e));return rW(e)}function rW(e){let{draft:t}=e,{themeName:n,theme:r}=e.scope,{swimlanes:i,includes:o,waveSolve:s}=e.chart,a=e.canvas.final,c=e.measured.header.chartLeftX,l=t.waves,u=t.waveLegend;return{width:a,height:Wt(t.height,"the canvas height"),theme:n,palette:r,backgroundColor:r.surface.page,header:{...Wt(t.header,"the header"),attributionBox:Wt(t.attributionBox,"the attribution box")},timeline:e.measured.timeline,nowline:Wt(t.nowline,"the now-line"),swimlanes:i,anchors:Wt(t.anchors,"the anchors"),milestones:Wt(t.milestones,"the milestones"),edges:Wt(t.edges,"the edges"),footnotes:Wt(t.footnotes,"the footnote panel"),includes:o,chartBox:{x:c,y:e.chartY.top,width:a-c,height:e.chartY.bottom-e.chartY.top},...s?{waveSolve:s}:{},...l?{waves:l.waves}:{},...l&&l.boundaries.length>0?{waveBoundaries:l.boundaries}:{},...l&&l.crossings.length>0?{waveCrossings:l.crossings}:{},...u?{waveLegend:u}:{}}}function Wt(e,t){if(e===void 0)throw new Error(`layout: ${t} was read before its step ran`);return e}function iW(e,t){return e.rowIndex===t.rowIndex&&e.centerY===t.centerY&&e.labelSide===t.labelSide&&e.labelBox.x===t.labelBox.x&&e.labelBox.y===t.labelBox.y&&e.labelBox.width===t.labelBox.width&&e.labelBox.height===t.labelBox.height}var Ns=class extends Map{constructor(t,n=aW){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(let[r,i]of t)this.set(r,i)}get(t){return super.get(Cb(this,t))}has(t){return super.has(Cb(this,t))}set(t,n){return super.set(oW(this,t),n)}delete(t){return super.delete(sW(this,t))}};function Cb({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function oW({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function sW({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function aW(e){return e!==null&&typeof e=="object"?e.valueOf():e}function np(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function rp(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}var Ob=Symbol("implicit");function ip(){var e=new Ns,t=[],n=[],r=Ob;function i(o){let s=e.get(o);if(s===void 0){if(r!==Ob)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Ns;for(let s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return ip(t,n).unknown(r)},rp.apply(i,arguments),i}function Pl(){var e=ip().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,a=!1,c=0,l=0,u=.5;delete e.unknown;function f(){var d=t().length,p=i<r,m=p?i:r,g=p?r:i;o=(g-m)/Math.max(1,d-c+l*2),a&&(o=Math.floor(o)),m+=(g-m-o*(d-c))*u,s=o*(1-c),a&&(m=Math.round(m),s=Math.round(s));var w=np(d).map(function(E){return m+o*E});return n(p?w.reverse():w)}return e.domain=function(d){return arguments.length?(t(d),f()):t()},e.range=function(d){return arguments.length?([r,i]=d,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(d){return[r,i]=d,r=+r,i=+i,a=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(d){return arguments.length?(a=!!d,f()):a},e.padding=function(d){return arguments.length?(c=Math.min(1,l=+d),f()):c},e.paddingInner=function(d){return arguments.length?(c=Math.min(1,d),f()):c},e.paddingOuter=function(d){return arguments.length?(l=+d,f()):l},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),f()):u},e.copy=function(){return Pl(t(),[r,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},rp.apply(f(),arguments)}var mx=class e{constructor(t,n,r){B(this,"bandwidthPx");B(this,"stepPx");B(this,"d3");this.bandwidthPx=t,this.stepPx=n,this.d3=r}static fixedRow(t){return new e(t.bandwidth,t.step)}static forRows(t){let n=Array.from({length:t.count},(i,o)=>String(o)),r=Pl().domain(n).range(t.range).paddingInner(t.paddingInner??0).paddingOuter(t.paddingOuter??0);return new e(r.bandwidth(),r.step(),r)}bandwidth(){return this.bandwidthPx}step(){return this.stepPx}forward(t){if(!this.d3)throw new Error("BandScale.forward is only available on closed-domain bands (BandScale.forRows)");let n=this.d3(t);if(n===void 0)throw new Error(`BandScale: unknown band id "${t}"`);return n}},lW={bandwidth:56,step:64};function Db(){return mx.fixedRow(lW)}var Mb=8;function Fb(e,t,n,r,i){let{theme:o,styleCtx:s}=t,{cal:a,calendar:c,schedule:l}=n,u=l.plan,{originX:f,scale:d}=r.axis,{timeline:p,bands:m}=r,g=$d(e,{theme:o,cal:a,schedule:l,timeline:p,scale:d,calendar:c,axisColumns:new vs(n,d),bandScale:Db(),waves:u?UR(u,d,f,Gn(t.locale).waveBackgroundItem):void 0},{chartTopY:0,estimatedChartTopY:m.chartTopY,chartBottomY:0,swimlaneBottomY:0},{footnotes:Ud(e.content.footnotes),markerRowPlacements:new Map(r.markers.placements)});for(let F of r.markers.datePinned){let N=g.markerRowPlacements.get(F.id);N&&(g.entityLeftEdges.set(F.id,F.centerX),g.entityRightEdges.set(F.id,F.centerX),g.entityMidpoints.set(F.id,{x:F.centerX,y:N.centerY}))}let w=new Map(g.entityLeftEdges),E=new Map(g.entityRightEdges),y=new Map(g.entityMidpoints),x=()=>{g.entityLeftEdges=new Map(w),g.entityRightEdges=new Map(E),g.entityMidpoints=new Map(y),g.placedItems=new Map,g.itemFlowKey=new Map,g.currentFlowKey="",g.waves&&Ld(g.waves,g.entityLeftEdges,g.entityRightEdges)},T=[...e.content.swimlanes.values()],v=be("swimlane",[],s),k=BA[v.spacing]??0,C=()=>{g.nextParallelId=0,g.nextGroupId=0;let F=[],N=g.chartTopY,W=0,G=g.timeline.originX;for(let X of T){W>0&&(N+=k);let{positioned:Q,usedHeight:j,usedRightX:ne}=new bs({lane:X,bandIndex:W},i).place({x:g.timeline.originX,y:N},g);F.push(Q),N+=j,ne>G&&(G=ne),W++}return{swimlanes:F,nextY:N,maxRightX:G}},$=e.content.isolatedRegions,O,H,P=g.waves;if(P){let F,N=VR()?cW(P.ids,l,d):void 0,W=Sd(P.ids.length,P.origin,P.floors,(G,X)=>(XR(P,G,X),x(),F=C(),$.length>0&&ox($,g,F.nextY+Mb,i,r.naturalChartRightX),P.pass),It,N);GR(P,W),H={passes:W.passes,capped:W.capped},O=F}else O=C();let R=O.swimlanes,b=O.nextY,M=lb(e.content.milestones,g);M.length>0&&(x(),g.slackCorridors=M,O=C(),R=O.swimlanes,b=O.nextY);let _=[],S=[];if($.length>0){let F=ox($,g,b+Mb,i,r.naturalChartRightX);_=F.regions,S=F.contexts,b=F.endY}g.chartBottomY=b,g.swimlaneBottomY=b;let L=zd(e.content.milestones,g);return{ctx:g,swimlanes:R,includes:_,regionContexts:S,milestones:L,laneEntries:T,maxRightX:O.maxRightX,bottomY:b,...H?{waveSolve:H}:{}}}function cW(e,t,n){let r=e.map(i=>t.waves?.get(i));return{S:r.map(i=>i?n.forward(i.start):null),E:r.map(i=>i?n.forward(i.end):null)}}var op=class{constructor(t,n){B(this,"node");B(this,"helpers");this.node=t,this.helpers=n}get id(){return this.node.name??""}place(t,n){let{node:r}=this,{helpers:i}=this,o=be("group",r.properties,n.styleCtx),s=Br(r,bl(r.properties,t.x,n),n),a=n.waves!==void 0&&r.title===void 0&&re(r.properties,"wave")!==void 0&&re(r.properties,"style")===void 0&&Be(r.properties,"labels").length===0,c=a?void 0:r.title??r.name,l=n.currentFlowKey;n.nextGroupId+=1,n.currentFlowKey=`${l}/group:${r.name??`group-${n.nextGroupId}`}`;let u=Bt(Be(r.properties,"after")),f=Bt(Be(r.properties,"before")),d=td({drawn:!a,hasTitle:!!c,hasPins:!!(u||f),hasBracket:o.bracket!=="none"}),p=Yd(r,{leftX:s,firstRowY:t.y+d.header+d.pad},n,i),{children:m,timeCursorX:g,timeStartX:w}=p,E=n.bandScale.step(),y=E-n.bandScale.bandwidth(),x=Math.max(E,p.packer.usedHeight())-y,T={x:w,y:t.y,width:g-w,height:d.header+d.pad+x+d.pad};t.startX=T.x,t.x=g,t.height=Math.max(t.height,T.height+y);let v=r.name;v&&(n.entityLeftEdges.set(v,T.x),n.entityRightEdges.set(v,g)),n.currentFlowKey=l;let k=a?[]:Rd({box:T,afterDate:u,beforeDate:f,title:c});return{kind:"group",id:v,title:c,box:T,headerHeight:d.header,children:m,style:o,inlineDatePins:k.length>0?k:void 0,...a?{waveOnly:!0}:{}}}};var sp=class{constructor(t,n){B(this,"node");B(this,"helpers");this.node=t,this.helpers=n}get id(){return this.node.name??""}place(t,n){let{node:r}=this,{helpers:i}=this,o=be("parallel",r.properties,n.styleCtx),s=Br(r,t.x,n),a=Bt(Be(r.properties,"after")),c=Bt(Be(r.properties,"before")),l=r.title??r.name,u=td({drawn:!0,hasTitle:!!l,hasPins:!!(a||c),hasBracket:o.bracket!=="none"}),f=t.y+u.header+u.pad,d=[],p=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=0,w=n.currentFlowKey;n.nextParallelId+=1;let E=r.name??`parallel-${n.nextParallelId}`,y=0;for(let O of r.content){if(O.$type==="DescriptionDirective")continue;n.currentFlowKey=`${w}/par:${E}#${y}`;let H=Sl(s,f+g),P=i.sequenceOne(O,H,n);d.push(P),g+=Math.max(n.bandScale.step(),H.height),p=Math.min(p,H.startX),m=Math.max(m,H.x),y++}n.currentFlowKey=w,d.length===0&&(p=n.scale.showsNonWorking?n.scale.startX(s):s,m=p);let x=n.bandScale.step(),T=x-n.bandScale.bandwidth(),v=Math.max(x,g)-T,k={x:p,y:t.y,width:m-p,height:u.header+u.pad+v+u.pad};t.startX=k.x,t.x=m,t.height=Math.max(t.height,k.height+T);let C=r.name;C&&(n.entityLeftEdges.set(C,k.x),n.entityRightEdges.set(C,m));let $=Rd({box:k,afterDate:a,beforeDate:c,title:l});return{kind:"parallel",id:C,title:l,box:k,headerHeight:u.header,children:d,style:o,inlineDatePins:$.length>0?$:void 0}}};function uW(e,t,n){return new sp(e,{sequenceOne:ap}).place(t,n)}function fW(e,t,n){return new op(e,{sequenceOne:ap}).place(t,n)}function ap(e,t,n){if(Ve(e))return Bd(e,t,n);if(et(e))return uW(e,t,n);if(Oe(e))return fW(e,t,n);throw new Error(`Unknown swimlane child type: ${e.$type??"unknown"}`)}var lp=class{place(t,n,r,i){let o={sequenceOne:ap},s=SR(t,n,r),a=NR(t,n,r,s,i),c=Lb(t,n,r,s,a),l=Fb(n,s,a,c,o);return $b(new tp(t,n,r,s,a,c,l))}};function $l(e,t,n={}){let r=$f(e,t),{config:i,working:o}=r,s=os(t.content.sizes,i),a=re(e.roadmapDecl?.properties??[],"start"),c=_e(a)??dW(n.today??new Date),l=b=>o.workingIndexOf(c,b),u=b=>o.dateAtWorkingIndex(c,b),f=(b,M)=>Pf(o,c,b,M),d=0,p=b=>{d=Math.max(d,b)},m=new Map,g=new Map,w=new Map,E=new Map,y=new WeakMap,x=new Map,T=new WeakMap,v=new Map;for(let[b,M]of t.content.anchors){let _=_e(re(M.properties,"date"));if(_){let S=l(_);g.set(b,S),v.set(b,_),p(S)}}let k=()=>({itemEnd:m,anchorEnd:g,milestoneEnd:w,sizes:s,itemResults:E,inByNode:!0}),C=(b,M,_)=>{let S=N=>{if("date"in N)return l(N.date);let W=N.ref;return b.itemEnd.has(W)?b.itemEnd.get(W):b.anchorEnd.has(W)?b.anchorEnd.get(W):b.milestoneEnd.has(W)?b.milestoneEnd.get(W):0},L=(N,W)=>{let G=W;for(let X of vt(N))G=F(X,G),_(G);return G},F=(N,W)=>{if(Ve(N)){let G=pA(N.properties,b.sizes,i),{after:X}=Fr(N.properties),Q=X.length>0?Math.max(W,...X.map(S)):W;M&&(Q=M.apply(N,Q));let j=Q+G,ne={start:u(Q),end:f(Q,j),days:G};return b.inByNode&&y.set(N,ne),N.name&&(b.itemEnd.set(N.name,j),b.itemResults?.set(N.name,ne)),M?.accumulate(N,j),j}if(et(N)){let{after:G}=Fr(N.properties),X=G.length>0?Math.max(W,...G.map(S)):W;M&&(X=M.apply(N,X));let Q=X;for(let j of vt(N))Q=Math.max(Q,F(j,X));return N.name&&b.itemEnd.set(N.name,Q),Q}if(Oe(N)){let{after:G}=Fr(N.properties),X=G.length>0?Math.max(W,...G.map(S)):W;M&&(X=M.apply(N,X));let Q=L(N,X);return N.name&&b.itemEnd.set(N.name,Q),Q}return W};return{walkLane:L,resolveAfterDay:S}},$=(b,M)=>{let _=_e(re(b.properties,"date"));if(_)return l(_);let{after:S}=Fr(b.properties);return S.length>0?Math.max(0,...S.map(M)):void 0},O=(b,M)=>{let _=new Map,S=new Map,L=new Map;for(let[W,G]of b.anchors){let X=_e(re(G.properties,"date"));if(X){let Q=l(X);S.set(W,Q),p(Q)}}let{walkLane:F,resolveAfterDay:N}=C({itemEnd:_,anchorEnd:S,milestoneEnd:L,sizes:os(b.sizes,i),inByNode:M},void 0,p);for(let W of b.swimlanes.values())F(W,0);for(let[W,G]of b.milestones){let X=$(G,N);X!==void 0&&(L.set(W,X),p(X))}for(let W of b.isolatedRegions)O(W.content,!1)},H=n.plan!==void 0?n.plan??void 0:Pi(t),P;if(H){let b=H.waves.map(N=>N.name),M=WR(H,c,o),_,S=0,L=N=>{S=Math.max(S,N)},F=Sd(b.length,0,M,(N,W)=>{let G=b.map((j,ne)=>[j,W[ne]]);m=new Map(G),E=new Map,y=new WeakMap,S=0;let X=new Ci(H,N),{walkLane:Q}=C(k(),X,L);for(let j of t.content.swimlanes.values())Q(j,0);for(let j of t.content.isolatedRegions){let ne=C({itemEnd:new Map(G),anchorEnd:new Map,milestoneEnd:new Map,sizes:os(j.content.sizes,i),inByNode:!0},X,L);for(let A of j.content.swimlanes.values())ne.walkLane(A,0)}return _=X,X});p(Math.max(S,...F.S,...F.E.slice(-1))),P=new Map;for(let N of Nd(H,F,_,0,M))P.set(N.id,{index:N.index,start:u(N.start),end:f(N.start,N.end),memberCount:N.memberCount,...N.heldBy!==void 0?{heldBy:N.heldBy}:{},...N.floorRef!==void 0?{floorRef:N.floorRef}:{}})}else{let{walkLane:b}=C(k(),void 0,p);for(let M of t.content.swimlanes.values())b(M,0)}let{resolveAfterDay:R}=C(k(),void 0,p);for(let[b,M]of t.content.milestones){let _=$(M,R);if(_===void 0)continue;let S=_e(re(M.properties,"date"))??u(_);w.set(b,_),x.set(b,S),T.set(M,S),p(_)}if(!H)for(let b of t.content.isolatedRegions)O(b.content,!0);return{startDate:c,calendar:r,items:E,byNode:y,milestones:x,milestoneByNode:T,anchors:v,...P?{waves:P}:{},...H?{plan:H}:{},resolved:t,extent:{contentEndDay:d}}}function dW(e){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}function gx(e,t,n={}){let r=n.schedule?.resolved===t?n.schedule:$l(e,t,{today:n.today,plan:Pi(t)??null});return new lp().place(e,t,n,r)}function cp(e){return e.toISOString().slice(0,10)}function Bb(e){return e.id!==void 0?e.id:/[\r\n]/.test(e.title)?e.title.replace(/\s*[\r\n]+\s*/g," ").trim():e.title}function yx(e,t){for(let n of e)n.kind==="item"?t(n):yx(n.children,t)}function pW(e,t,n){let r=Bb(e);e.textSpills&&n.push(tn(t,"NL.I1000","info",{name:r},r)),e.chipsOutside&&n.push(tn(t,"NL.I1001","info",{name:r},r)),(e.box.width<Pr||e.dotSpills||e.iconSpills||e.footnoteSpills)&&n.push(tn(t,"NL.I1002","info",{name:r},r)),e.hasOverflow&&n.push(tn(t,"NL.I1003","info",{name:r,anchor:e.overflowAnchorId},r)),Wb(e,t,n)}function Wb(e,t,n){let r=e.nonWorkingPin;if(!r)return;let i=Bb(e);n.push(tn(t,"NL.I1008","info",{name:i,pin:r.pin,key:r.key,start:r.start},i))}function tn(e,t,n,r,i){return{message:Qt(e,t,r),severity:n,code:t,entityId:i,lspSeverity:n==="warning"?2:3,data:{code:t,args:r}}}function Ub(e,t,n){let r=e.id??e.title,i=[];yx(e.children,a=>i.push(a));for(let a of i)pW(a,t,n);let o=new Set(i.map(a=>a.box.y));o.size>1&&n.push(tn(t,"NL.I1004","info",{lane:r,rows:o.size},r)),(e.utilization?.segments.some(a=>a.classification==="red")??!1)&&n.push(tn(t,"NL.I1005","info",{lane:r},r));for(let a of e.nested)Ub(a,t,n)}function Xb(e,t,n){yx(e.children,r=>{Wb(r,t,n)});for(let r of e.nested)Xb(r,t,n)}function hW(e,t,n){e.waveSolve?.capped&&n.push(tn(t,"NL.W1002","warning",{passes:e.waveSolve.passes}));let r=e.waves??[],i=r.filter(o=>o.empty).map(o=>o.id);if(i.length>0){let o=i.length===r.length?{reason:"all",names:i}:i.length===1?{reason:"one",name:i[0]}:{reason:"many",names:i};n.push(tn(t,"NL.I1006","info",o,o.reason==="one"?o.name:void 0))}for(let o of e.milestones){if(o.overrunByWave===void 0||o.overrunDate===void 0)continue;let s=r.find(c=>c.id===o.overrunByWave);if(!s)continue;let a=o.id??o.title;n.push(tn(t,"NL.I1007","info",{name:a,date:o.overrunDate,wave:s.id,end:cp(s.endDate)},a))}}function xx(e,t={}){let n=t.locale??"en-US",r=[];for(let i of e.swimlanes)Ub(i,n,r);for(let i of e.includes)for(let o of i.nestedSwimlanes)Xb(o,n,r);if(hW(e,n,r),t.today){let i=t.today,o=e.timeline.startDate,s=e.timeline.endDate;(i<o||i>s)&&r.push(tn(n,"NL.W1000","warning",{date:cp(i),start:cp(o),end:cp(s)}))}return r}var Di=class extends Error{constructor(t){super(t),this.name="TimezoneError"}};function Ex(e){if(!e||e.toLowerCase()==="local")return{kind:"local"};if(e.toUpperCase()==="UTC")return{kind:"utc"};if(e==="Z")return{kind:"offset",ms:0};let t=/^([+-])(\d{2})(?::?(\d{2}))?$/.exec(e);if(t){let n=t[1]==="+"?1:-1,r=parseInt(t[2],10),i=t[3]!==void 0?parseInt(t[3],10):0;if(r>23||i>59)throw new Di(`nowline: invalid timezone offset "${e}". Hours must be 0\u201323 and minutes 0\u201359.`);return{kind:"offset",ms:n*(r*60+i)*6e4}}try{return{kind:"iana",name:Intl.DateTimeFormat(void 0,{timeZone:e}).resolvedOptions().timeZone}}catch{throw new Di(`nowline: unrecognised timezone "${e}". Use "local", "UTC", an ISO 8601 offset (e.g. "+05:30", "-07:00", "Z"), or an IANA timezone name (e.g. "America/Los_Angeles", "Asia/Kolkata").`)}}function up(e,t){switch(t.kind){case"local":return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()));case"utc":return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()));case"offset":{let n=new Date(e.getTime()+t.ms);return new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()))}case"iana":{let n=new Intl.DateTimeFormat("en-CA",{timeZone:t.name,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(e),r=0,i=0,o=0;for(let s of n)s.type==="year"?r=parseInt(s.value,10):s.type==="month"?i=parseInt(s.value,10)-1:s.type==="day"&&(o=parseInt(s.value,10));return new Date(Date.UTC(r,i,o))}}}var Gb=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?)(Z|([+-])(\d{2})(?::?(\d{2}))?)$/,zb=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?$/;function Hb(e){return(ot.test(e)||Gb.test(e)||zb.test(e))&&!ze(e.slice(0,10))}function wx(e={}){let t=e.zone??{kind:"local"},n=e.clock??(()=>new Date),r=e.now;if(!(r==="-"||r===null)){if(r instanceof Date)return r;if(r!==void 0){if(Hb(r))return;let i=_e(r);if(i)return i;let o=Gb.exec(r);if(o){let s=new Date(r);if(!Number.isNaN(s.getTime())){if(o[2]==="Z")return up(s,{kind:"utc"});let c=o[3]==="+"?1:-1,l=parseInt(o[4],10),u=o[5]!==void 0?parseInt(o[5],10):0,f=c*(l*60+u)*6e4;return up(s,{kind:"offset",ms:f})}}return zb.test(r)?_e(r.slice(0,10))??void 0:void 0}return up(n(),t)}}function mW(e){return e===2?"warning":e===3?"info":"error"}function jb(e,t){return{severity:mW(e.severity),code:sy(e),message:e.message,suggestion:rd(e.message),file:t,line:(e.range?.start.line??0)+1,column:(e.range?.start.character??0)+1}}function Tx(e,t){return{severity:"error",code:"parse-error",message:e.message,file:t,line:e.token?.startLine??1,column:e.token?.startColumn??1}}function vx(e,t){return{severity:"error",code:"lex-error",message:e.message,file:t,line:e.line??1,column:e.column??1}}function Yb(e,t){if(e.syntax?.origin==="lexer")return vx(e.syntax.error,e.sourcePath);if(e.syntax?.origin==="parser")return Tx(e.syntax.error,e.sourcePath);let n=(e.range?.start.line??e.line??0)+1,r=(e.range?.start.character??0)+1;if(!Dr(e))return{severity:e.severity,code:"include",message:e.message,file:e.sourcePath,line:n,column:1};let i=t?Ny(t,e):e.message,o=rd(i);return{severity:e.severity,code:e.code??id(e.message),message:i,...o===void 0?{}:{suggestion:o},file:e.sourcePath,line:n,column:r}}function Vb(e,t,n="warning"){return{severity:n,code:"render.warning",message:e,file:t,line:1,column:1}}function Kb(e,t){return{severity:e.severity,code:e.code,message:e.message,file:t,line:1,column:1}}var qb="__nowline_browser_noop_include__";async function Zb(e){throw new Error(`${qb}: include "${e}" was skipped \u2014 running in single-file mode.`)}function _x(e){return e.includes(qb)}function tS(e,t){let n=t==="image/png"?yW(e):t==="image/jpeg"?xW(e):EW(e);return n&&n.width>0&&n.height>0?n:void 0}var gW=[137,80,78,71,13,10,26,10];function Ax(e,t){return e[t]<<8|e[t+1]}function Jb(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function Qb(e,t){return e[t]|e[t+1]<<8}function eS(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16}function fp(e,t,n){return String.fromCharCode(...e.subarray(t,t+n))}function yW(e){if(!(e.length<24||gW.some((t,n)=>e[n]!==t))&&fp(e,12,4)==="IHDR")return{width:Jb(e,16),height:Jb(e,20)}}function xW(e){if(e.length<4||e[0]!==255||e[1]!==216)return;let t=2;for(;t+3<e.length;){if(e[t]!==255)return;let n=e[t+1];if(n===255){t+=1;continue}if(n===1||n>=208&&n<=217){t+=2;continue}let r=Ax(e,t+2);if(n>=192&&n<=207&&n!==196&&n!==200&&n!==204)return t+8>=e.length?void 0:{width:Ax(e,t+7),height:Ax(e,t+5)};if(r<2)return;t+=2+r}}function EW(e){if(e.length<16||fp(e,0,4)!=="RIFF"||fp(e,8,4)!=="WEBP")return;let t=fp(e,12,4),n=t==="VP8L"?25:30;if(!(e.length<n)){if(t==="VP8 ")return e[23]!==157||e[24]!==1||e[25]!==42?void 0:{width:Qb(e,26)&16383,height:Qb(e,28)&16383};if(t==="VP8L"){if(e[20]!==47)return;let r=e[21],i=e[22],o=e[23],s=e[24];return{width:1+(r|(i&63)<<8),height:1+(i>>6|o<<2|(s&15)<<10)}}if(t==="VP8X")return{width:1+eS(e,24),height:1+eS(e,27)}}}var wW=new Set(["svg","g","defs","symbol","use","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","linearGradient","radialGradient","stop","clipPath","mask","pattern","filter","feGaussianBlur","feColorMatrix","feOffset","feMerge","feMergeNode","feFlood","feComposite","feBlend","feDropShadow","image"]),TW=new Set(["d","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height","viewBox","preserveAspectRatio","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","opacity","transform","points","id","clip-path","mask","filter","font-family","font-size","font-weight","font-style","text-anchor","dx","dy","rotate","letter-spacing","word-spacing","xmlns","href","xlink:href","offset","stop-color","stop-opacity","gradientUnits","gradientTransform","spreadMethod","maskUnits","maskContentUnits","stdDeviation","values","in","in2","mode","type","result","flood-color","flood-opacity","patternUnits","patternContentUnits","role","aria-label","display","visibility","clip-rule","color","font-variant","font-stretch","text-decoration","dominant-baseline","alignment-baseline","baseline-shift","writing-mode","paint-order","vector-effect","shape-rendering","text-rendering","image-rendering","color-interpolation","color-interpolation-filters"]),vW=new Set(["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","opacity","clip-path","clip-rule","mask","filter","font-family","font-size","font-weight","font-style","font-variant","font-stretch","text-anchor","text-decoration","letter-spacing","word-spacing","dominant-baseline","alignment-baseline","baseline-shift","writing-mode","stop-color","stop-opacity","flood-color","flood-opacity","display","visibility","color","paint-order","vector-effect","shape-rendering","text-rendering","image-rendering","color-interpolation","color-interpolation-filters"]),_W=new Set(["line-height","text-align","font-variant-ligatures","font-variant-caps","font-variant-numeric","font-variant-east-asian","font-variant-position","font-variant-alternates","font-feature-settings","font-variation-settings","font-kerning","white-space","text-orientation","overflow","isolation","solid-color","solid-opacity","enable-background","color-rendering"]),AW=new Set(["none","normal","auto","initial","inherit","unset"]);function kW(e){return e==="xlink:href"?!1:e.includes(":")||e.startsWith("data-")||e==="version"||e==="baseProfile"||e==="enable-background"}function IW(e){return e==="metadata"||e.includes(":")&&!e.startsWith("svg:")}var RW=new Set(["x","y","width","height"]);function rS(e){let t=[],n=0,r=e.length;for(;n<r;){if(e[n]!=="<"){let u=n;for(;n<r&&e[n]!=="<";)n++;let f=e.slice(u,n);f.trim().length>0?t.push({kind:"text",text:f}):f.length>0&&t.push({kind:"text",text:f});continue}if(e.startsWith("<!--",n)){let u=e.indexOf("-->",n+4);if(u<0)break;t.push({kind:"comment",text:e.slice(n+4,u)}),n=u+3;continue}if(e.startsWith("<![CDATA[",n)){let u=e.indexOf("]]>",n+9);if(u<0)break;t.push({kind:"cdata",text:e.slice(n+9,u)}),n=u+3;continue}if(e.startsWith("<?",n)){let u=e.indexOf("?>",n+2);if(u<0)break;t.push({kind:"decl",text:e.slice(n+2,u)}),n=u+2;continue}if(e.startsWith("<!",n)){let u=e.indexOf(">",n+2);if(u<0)break;t.push({kind:"decl",text:e.slice(n+2,u)}),n=u+1;continue}if(e[n+1]==="/"){let u=e.indexOf(">",n+2);if(u<0)break;let f=e.slice(n+2,u).trim();t.push({kind:"close",name:f}),n=u+1;continue}let i=bW(e,n);if(i<0)break;let o=e.slice(n+1,i).trim(),s=o.endsWith("/"),a=s?o.slice(0,-1).trim():o,{name:c,attrs:l}=SW(a);t.push({kind:s?"self":"open",name:c,attrs:l}),n=i+1}return t}function bW(e,t){let n=t+1,r=null;for(;n<e.length;){let i=e[n];if(r)i===r&&(r=null);else if(i==='"'||i==="'")r=i;else if(i===">")return n;n++}return-1}function SW(e){let t=0;for(;t<e.length&&/\s/.test(e[t]);)t++;let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.slice(n,t),i={};for(;t<e.length;){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t>=e.length)break;let o=t;for(;t<e.length&&e[t]!=="="&&!/\s/.test(e[t]);)t++;let s=e.slice(o,t);if(t>=e.length||e[t]!=="="){s&&(i[s]="");continue}if(t++,t>=e.length)break;let a=e[t];if(a!=='"'&&a!=="'"){let l=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;i[s]=e.slice(l,t);continue}t++;let c=t;for(;t<e.length&&e[t]!==a;)t++;i[s]=e.slice(c,t),t<e.length&&t++}return{name:r,attrs:i}}function Cl(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function NW(e,t){if(e.startsWith("#")){let n=t.get(e.slice(1));return n?`#${n}`:null}if(/^url\(#[^)]+\)$/.test(e)){let n=e.slice(5,-1),r=t.get(n);return r?`url(#${r})`:null}return null}function iS(e,t={}){let n=t.idPrefix??"nl-logo",r=t.onWarn??(()=>{}),i=rS(e),o="",s=0;for(let d of i)d.kind==="open"&&d.name==="style"?s++:d.kind==="close"&&d.name==="style"?s=Math.max(0,s-1):s>0&&(d.kind==="text"||d.kind==="cdata")&&(o+=d.text??"");let a=LW(o,d=>r(`sanitizer: dropping ${d}`)),c=new Map,l=0;for(let d of i)if((d.kind==="open"||d.kind==="self")&&d.attrs&&"id"in d.attrs){let p=d.attrs.id;p&&!c.has(p)&&c.set(p,`${n}-${l++}`)}let u=[],f=[];for(let d of i)if(d.kind!=="comment"&&d.kind!=="decl"){if(d.kind==="cdata"){f[f.length-1]&&u.push(Cl(d.text??""));continue}if(d.kind==="text"){if(f.length===0||f[f.length-1]){let p=(d.text??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");u.push(p)}continue}if(d.kind==="open"||d.kind==="self"){let p=d.name??"";if(p==="script"||p==="foreignObject"||p==="animate"||p==="animateTransform"||p==="animateMotion"||p==="set"){r(`sanitizer: dropping <${p}>`),d.kind==="open"&&f.push(!1);continue}if(p==="style"||IW(p)){d.kind==="open"&&f.push(!1);continue}if(!wW.has(p)){r(`sanitizer: dropping unknown element <${p}>`),d.kind==="open"&&f.push(!1);continue}let m=[`<${p}`],g=p==="svg"&&f.length===0,w=PW(d.attrs??{},a,r),E=Object.keys(w).sort();for(let y of E){let x=w[y];if(g&&t.stripRootSize&&RW.has(y))continue;if(/^on/i.test(y)){r(`sanitizer: dropping event handler ${y}`);continue}if(kW(y)||y==="class")continue;if(!TW.has(y)){r(`sanitizer: dropping attribute ${y}`);continue}if(y==="href"||y==="xlink:href"){let v=NW(x,c);if(v===null){r(`sanitizer: dropping external href ${x}`);continue}m.push(` ${y}="${Cl(v)}"`);continue}if(y==="id"){let v=c.get(x);v&&m.push(` id="${Cl(v)}"`);continue}let T=/url\(#([^)]+)\)/gi;if(/data:|javascript:|vbscript:|url\(|expression\s*\(|[\\{}]/i.test(x.replace(T,""))){r(`sanitizer: dropping suspicious value at ${y}`);continue}if(/url\(#/i.test(x)){let v=x.replace(T,(k,C)=>{let $=c.get(C);return $?`url(#${$})`:"none"});m.push(` ${y}="${Cl(v)}"`);continue}m.push(` ${y}="${Cl(x)}"`)}m.push(d.kind==="self"?"/>":">"),u.push(m.join("")),d.kind==="open"&&f.push(!0);continue}d.kind==="close"&&f.pop()&&u.push(`</${d.name}>`)}return u.join("")}function nS(e){if(e===void 0)return;let t=/^\s*([0-9]*\.?[0-9]+(?:e[+-]?[0-9]+)?)\s*(px)?\s*$/i.exec(e);if(!t)return;let n=Number(t[1]);return n>0&&Number.isFinite(n)?n:void 0}function dp(e){let t=rS(e).find(s=>(s.kind==="open"||s.kind==="self")&&s.name==="svg");if(!t)return;let n=t.attrs??{},r=nS(n.width),i=nS(n.height);if(r!==void 0&&i!==void 0)return{width:r,height:i};let o=(n.viewBox??"").trim().split(/[\s,]+/).map(Number);if(o.length===4&&o.every(Number.isFinite)&&o[2]>0&&o[3]>0)return{width:o[2],height:o[3]}}function oS(e){let t=[];for(let n of e.split(";")){let r=n.indexOf(":");if(r<0)continue;let i=n.slice(0,r).trim().toLowerCase(),o=n.slice(r+1).replace(/!\s*important\s*$/i,"").trim();i&&o&&t.push({property:i,value:o})}return t}function LW(e,t){let n=[],r=e.replace(/\/\*[\s\S]*?\*\//g,""),i=/([^{}]+)\{([^{}]*)\}/g;for(let o of r.matchAll(i)){let s=o[1].trim(),a=s.split(",").map(c=>c.trim());if(s.startsWith("@")||!a.every(c=>/^\.[A-Za-z_][\w-]*$/.test(c))){t(`<style> rule ${s}`);continue}n.push({classes:a.map(c=>c.slice(1)),declarations:oS(o[2])})}return/@[a-z-]+[^{;]*;/i.test(r)&&t("<style> at-rule"),n}function PW(e,t,n){let r=new Set((e.class??"").split(/\s+/).filter(Boolean)),i=[];for(let s of t)s.classes.some(a=>r.has(a))&&i.push(...s.declarations);if(e.style!==void 0&&i.push(...oS(e.style)),i.length===0&&e.style===void 0)return e;let o={...e};delete o.style;for(let{property:s,value:a}of i)vW.has(s)?o[s]=a:!s.startsWith("-")&&!_W.has(s)&&!AW.has(a.toLowerCase())&&n(`sanitizer: dropping style property ${s}`);return o}var $W={".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp"};function CW(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n).toLowerCase():""}async function sS(e,t,n){if(!e||!t)return;let r=CW(e),i=$W[r];if(!i){n(`unsupported logo format: ${r||"(none)"} (${e})`);return}let o;try{o=await t(e)}catch(c){let l=c instanceof Error?c.message:String(c);n(`logo file not found: ${e} (${l})`);return}let s=o.bytes,a=i==="image/svg+xml"?dp(new TextDecoder().decode(s)):tS(s,i);if(!a){let c=i==="image/svg+xml"?"no viewBox and no pixel width/height on the root <svg>":`not a readable ${r.slice(1).toUpperCase()} header`;n(`logo could not be parsed: ${e} (${c})`);return}return{ref:e,dimensions:a,asset:o}}var OW=1,DW=0;function MW(){return Ce.parse(`memory:///stage-${++DW}.nowline`)}async function FW(e){if(e.document)return e.document;let{workspace:t}=e.services.shared,n=t.LangiumDocumentFactory.fromString(e.source,MW());return await t.DocumentBuilder.build([n],{validation:!0}),n}function BW(e){return e.origin!=="validation"||e.diagnostic.severity===OW}async function kx(e){let t=await FW(e),n=Ii(t);if(n.some(BW))return{kind:"invalid",document:t,diagnostics:n};let r=t.parseResult.value,i=await yy(r,e.sourcePath,{services:e.services.Nowline,readFile:e.readSource}),o=e.isToleratedIncludeError??(()=>!1),s=i.diagnostics.filter(T=>T.severity==="error"&&!o(T)),a=i.diagnostics.filter(Dr),c=s.find(T=>!Dr(T));if(c)return{kind:"include-error",document:t,legacy:c,routed:[],resolved:i};if(s.length>0)return{kind:"include-error",document:t,routed:a,resolved:i};let l=[],u=await sS(nd(r),e.assetResolver,T=>l.push(T)),{theme:f,today:d,width:p,locale:m,nonWorking:g}=e.layout,w={theme:f,today:d,width:p,locale:m,nonWorking:g},E=Pi(i)??null,y=$l(r,i,{today:d,plan:E}),x=gx(r,i,{...w,schedule:y,logo:u?.dimensions});return{kind:"staged",document:t,ast:r,resolved:i,routed:a,logo:u,warnings:l,plan:E,schedule:y,model:x,layout:w}}var Wr={person:{viewBox:"0 0 24 24",body:'<circle cx="12" cy="8" r="4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 21a8 8 0 0 1 16 0" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"p"},people:{viewBox:"0 0 24 24",body:'<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle cx="9" cy="7" r="4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M22 21v-2a4 4 0 0 0-3-3.87" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 3.13a4 4 0 0 1 0 7.75" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"P"},points:{viewBox:"0 0 24 24",body:'<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" fill="currentColor" stroke="currentColor" stroke-width="1" stroke-linejoin="round"/>',ascii:"*"},time:{viewBox:"0 0 24 24",body:'<line x1="10" x2="14" y1="2" y2="2" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="12" x2="15" y1="14" y2="11" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle cx="12" cy="14" r="8" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"t"}},WW={calendar:{viewBox:"0 0 24 24",body:'<rect x="3" y="4" width="18" height="18" rx="2" ry="2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="16" x2="16" y1="2" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="8" x2="8" y1="2" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="3" x2="21" y1="10" y2="10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"d"}},aS={...Wr,...WW};var fse={none:"",multiplier:"x",person:Wr.person.ascii,people:Wr.people.ascii,points:Wr.points.ascii,time:Wr.time.ascii};var pp=class{constructor(t="nl"){B(this,"prefix");B(this,"counter",0);this.prefix=t}next(t){let n=`${this.prefix}-${this.counter++}`;return t?`${n}-${t}`:n}};var lS=/&/g,cS=/</g,uS=/>/g,UW=/"/g,XW=/'/g;function tt(e){return e.replace(lS,"&").replace(cS,"<").replace(uS,">")}function Vn(e){return e.replace(lS,"&").replace(cS,"<").replace(uS,">").replace(UW,""").replace(XW,"'")}function Ls(e){let t=Object.keys(e).sort(),n=[];for(let r of t){let i=e[r];i==null||i===!1||(i===!0?n.push(r):n.push(`${r}="${Vn(String(i))}"`))}return n.length?` ${n.join(" ")}`:""}function Y(e,t,n){return n===void 0||n===""?`<${e}${Ls(t)}/>`:`<${e}${Ls(t)}>${n}</${e}>`}function pe(e,t){return`<text${Ls(e)}>${tt(t)}</text>`}function h(e){return Number.isFinite(e)?Number.isInteger(e)?e.toString():(Math.round(e*100)/100).toString():"0"}var GW={none:{dx:0,dy:0,stdDeviation:0,opacity:0},subtle:{dx:0,dy:1,stdDeviation:1.5,opacity:.2},soft:{dx:0,dy:3,stdDeviation:5,opacity:.3},hard:{dx:2,dy:2,stdDeviation:0,opacity:.45}};function zW(e,t){let n=`${e}-shadow-${t}`,r=GW[t],i=`<feGaussianBlur in="SourceAlpha" stdDeviation="${r.stdDeviation}"/><feOffset dx="${r.dx}" dy="${r.dy}" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="${r.opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>`;return Y("filter",{id:n,x:"-50%",y:"-50%",width:"200%",height:"200%"},i)}function fS(e,t){return t==="none"?null:`url(#${e}-shadow-${t})`}function dS(e){return["subtle","soft","hard"].map(t=>zW(e,t)).join("")}var YW={thin:100,light:300,normal:400,bold:700};function VW(e){return us[e]??14}function xS(e,t,n){return{"font-family":t[e.font],"font-size":n??VW(e.textSize),"font-weight":YW[e.weight]??400,"font-style":e.italic?"italic":"normal",fill:e.text}}function KW(e){if(e.border==="dashed")return"4 3";if(e.border==="dotted")return"1 3"}function ES(e){if(!e||e==="none"||e==="transparent")return 1;let t=e.startsWith("#")?e.slice(1):e;if(t.length===3&&(t=t.split("").map(s=>s+s).join("")),t.length!==6)return 1;let n=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,i=parseInt(t.slice(4,6),16)/255,o=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4;return .2126*o(n)+.7152*o(r)+.0722*o(i)}function qW(e,t){return ES(e)>=.24?t.statusDot.onLight:t.statusDot.onDark}function gp(e,t){return e.length*t*.58}function wS(e,t,n,r,i,o,s){let a=i*.58,c=t?gp(t,i):0,l=t?a:0,u=n+c+l,{text:f,icon:d}=e,p=gp(f,i),m={"font-family":o,"font-size":i,fill:s};if(!d)return pe({x:h(u),y:h(r),...m},f);if(d.kind==="builtin"&&d.name==="multiplier")return pe({x:h(u),y:h(r),...m},`${f}\xD7`);if(d.kind==="builtin"){let w=Wr[d.name],E=pe({x:h(u),y:h(r),...m},f),y=i*.1,x=i,T=u+p+y,v=r-i*.85,k=`<svg x="${h(T)}" y="${h(v)}" width="${h(x)}" height="${h(x)}" viewBox="${w.viewBox}" style="color:${Vn(s)}" aria-hidden="true">${w.body}</svg>`;return E+k}let g=h(i*.1);return`<text x="${h(u)}" y="${h(r)}" font-family="${Vn(o)}" font-size="${i}" fill="${Vn(s)}">${tt(f)}<tspan dx="${g}">${tt(d.text)}</tspan></text>`}var pS=.6,ZW=.5;function JW(e){let{metaText:t,capacity:n,x:r,baselineY:i,fontSize:o,fontFamily:s,color:a}=e;if(!t&&!n)return"";let c={"font-family":s,"font-size":o,fill:a};if(!n)return pe({x:h(r),y:h(i),...c},t);if(!t)return wS(n,void 0,r,i,o,s,a);let l=h(o*pS),u=`<text x="${h(r)}" y="${h(i)}" font-family="${Vn(s)}" font-size="${o}" fill="${Vn(a)}">`,{text:f,icon:d}=n;if(!d)return u+tt(t)+`<tspan dx="${l}">${tt(f)}</tspan></text>`;if(d.kind==="builtin"&&d.name==="multiplier")return u+tt(t)+`<tspan dx="${l}">${tt(f)}\xD7</tspan></text>`;if(d.kind==="literal"){let k=h(o*.1);return u+tt(t)+`<tspan dx="${l}">${tt(f)}</tspan><tspan dx="${k}">${tt(d.text)}</tspan></text>`}let p=Wr[d.name],m=k=>k.length*o*ZW,g=r+m(t)+o*pS,w=o*.1,E=o,y=g+m(f)+w,x=i-o*.85,T=u+tt(t)+`<tspan dx="${l}">${tt(f)}</tspan></text>`,v=`<svg x="${h(y)}" y="${h(x)}" width="${h(E)}" height="${h(E)}" viewBox="${p.viewBox}" style="color:${Vn(a)}" aria-hidden="true">${p.body}</svg>`;return T+v}function QW(e,t){let n=aS.calendar,r=`<svg x="${h(e.glyphTopLeft.x)}" y="${h(e.glyphTopLeft.y)}" width="${h(e.glyphSize)}" height="${h(e.glyphSize)}" viewBox="${n.viewBox}" style="color:${Vn(t)}" aria-hidden="true">${n.body}</svg>`,i=`<title>${tt(e.isoDate)}</title>`;return Y("g",{"data-layer":"inline-date-pin","data-side":e.side,"data-date":e.isoDate,"data-spilled":e.spilled?"true":null},i+r)}function TS(e,t){return!e||e.length===0?"":e.map(n=>QW(n,t)).join("")}function eU(e){return e?.some(t=>t.side==="after")??!1}function tU(e,t,n,r,i,o={}){let s=Math.min(rl[i.cornerRadius]??4,r/2,n/2);return Y("rect",{x:h(e),y:h(t),width:h(n),height:h(r),rx:h(s),ry:h(s),fill:i.bg==="none"?"transparent":i.bg,stroke:i.fg,"stroke-width":1,"stroke-dasharray":KW(i)??null,...o})}function nU(e,t,n,r){let i=e.box.x+e.cardBox.x,o=e.box.y+e.cardBox.y,s=e.cardBox.width,a=e.cardBox.height,c=e.style.bg==="none"?n.surface.headerBox:e.style.bg,l=n.header.cardBorder,u=Y("rect",{x:h(i),y:h(o),width:h(s),height:h(a),rx:6,ry:6,fill:c,stroke:l,"stroke-width":1,filter:`url(#${t}-shadow-subtle)`}),f=i+16+(e.textInset?.x??0),d=o+(e.textInset?.y??0),p=[];e.titleLines.forEach((x,T)=>{p.push(pe({x:h(f),y:h(d+26+T*20),"font-family":r[e.style.font],"font-size":16,"font-weight":600,fill:e.style.text},x))});let m=p.join(""),g=d+26+Math.max(0,e.titleLines.length-1)*20,w=n.header.author,E=[];e.authorLines.forEach((x,T)=>{E.push(pe({x:h(f),y:h(g+18+T*14),"font-family":r[e.style.font],"font-size":11,fill:w},x))});let y=E.join("");return Y("g",{"data-layer":"header","data-id":`${t}-header`},u+m+y)}function rU(e,t,n){let r=n.timeline.gridLine,i=n.timeline.minorGridLine,o=e.bottomTickPanelHeight??0,s=e.bottomTickPanelY!==void 0&&o>0,a=e.tickPanelY,c=s?e.bottomTickPanelY+o:e.box.y+e.box.height,l=t,u=e.box.y+e.box.height,f=[];for(let d of e.ticks)if(d.major)f.push(Y("line",{x1:h(d.x),y1:h(a),x2:h(d.x),y2:h(c),stroke:r,"stroke-width":1}));else if(e.minorGrid){if(d.labelX===void 0)continue;f.push(Y("line",{x1:h(d.x),y1:h(l),x2:h(d.x),y2:h(u),stroke:i,"stroke-width":1}))}for(let d of e.nonWorking??[])d.seam&&f.push(Y("line",{x1:h(d.x),y1:h(l),x2:h(d.x),y2:h(u),stroke:n.timeline.nonWorkingSeam,"stroke-width":1,"stroke-dasharray":"1 3"}));return Y("g",{"data-layer":"grid"},f.join(""))}function vS(e,t,n,r){let i=e.box.y+e.box.height,o=[];for(let s of e.nonWorking??[]){if(!s.band)continue;let a={x:s.x,y:t,width:s.width,height:i-t},c=r?bx(a,r):a;!c||c.width<=0||c.height<=0||o.push(Y("rect",{x:h(c.x),y:h(c.y),width:h(c.width),height:h(c.height),fill:n.timeline.nonWorkingFill,"fill-opacity":zg}))}return o.length===0?"":Y("g",{"data-layer":"non-working"},o.join(""))}function iU(e,t,n){let r=e.box.y+e.box.height,i=[];for(let o of e.nonWorking??[])o.label===void 0||!o.labelBox||(o.cut&&i.push(Y("line",{x1:h(o.x),y1:h(o.labelBox.y+4),x2:h(o.x),y2:h(r),stroke:t.timeline.nonWorkingSeam,"stroke-width":1,"stroke-dasharray":"1 3"})),i.push(hS(o.label,o.labelBox,o.labelSide,t,n)));for(let o of e.workingExceptions??[])o.labelBox&&i.push(hS(o.label,o.labelBox,o.labelSide,t,n));return i.length===0?"":Y("g",{"data-layer":"non-working-label"},i.join(""))}function hS(e,t,n,r,i){let o=n==="left",s=t.y+4,a={x:h(o?t.x+t.width:t.x),y:h(s+4),"font-family":i.sans,"font-size":10,fill:r.timeline.labelText};return o&&(a["text-anchor"]="end"),pe(a,e)}function oU(e,t,n){let r=t.timeline.panelFill,i=t.timeline.border,o=t.timeline.labelText,s=[],a=e.tickPanelY,c=e.tickPanelHeight,l=c>0,u=e.markerRow.height>0,f=e.waveStrip?e.waveStrip.y+e.waveStrip.height:a+c,d=e.markerRow.height,p=e.bottomTickPanelY,m=e.bottomTickPanelHeight??0,g=p!==void 0&&m>0;l&&s.push(Y("rect",{x:h(e.box.x),y:h(a),width:h(e.box.width),height:h(c),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1})),u&&s.push(Y("rect",{x:h(e.box.x),y:h(f),width:h(e.box.width),height:h(d),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1})),g&&s.push(Y("rect",{x:h(e.box.x),y:h(p),width:h(e.box.width),height:h(m),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1}));for(let w of e.ticks)w.major&&(!w.label||w.labelX===void 0||(l&&s.push(pe({x:h(w.labelX),y:h(a+ol(c)),"font-family":n.sans,"font-size":ki,fill:o,"text-anchor":"middle"},w.label)),g&&s.push(pe({x:h(w.labelX),y:h(p+ol(m)),"font-family":n.sans,"font-size":ki,fill:o,"text-anchor":"middle"},w.label))));return Y("g",{"data-layer":"timeline"},s.join(""))}function sU(e,t,n){if(!e)return"";let r=t.nowline.stroke,i=t.nowline.labelText,o=Y("line",{x1:h(e.x),y1:h(e.topY),x2:h(e.x),y2:h(e.bottomY),stroke:r,"stroke-width":Xf}),s=aU(e,r),a=lU(e,i,n);return Y("g",{"data-layer":"nowline"},o+s+a)}function _S(e){let t=Xf/2;return e.pillMode==="flag-right"?e.x-t:e.pillMode==="flag-left"?e.x+t:e.x}function aU(e,t){let n=e.pillTopY,r=e.pillTopY+Mt,i=Cg,o=e.pillWidth;if(e.pillMode==="center")return Y("rect",{x:h(e.x-o/2),y:h(n),width:h(o),height:h(Mt),rx:i,ry:i,fill:t});let s=_S(e);if(e.pillMode==="flag-right"){let l=s+o,u=[`M ${h(s)} ${h(n)}`,`L ${h(l-i)} ${h(n)}`,`A ${i} ${i} 0 0 1 ${h(l)} ${h(n+i)}`,`L ${h(l)} ${h(r-i)}`,`A ${i} ${i} 0 0 1 ${h(l-i)} ${h(r)}`,`L ${h(s)} ${h(r)}`,"Z"].join(" ");return Y("path",{d:u,fill:t})}let a=s-o,c=[`M ${h(s)} ${h(n)}`,`L ${h(a+i)} ${h(n)}`,`A ${i} ${i} 0 0 0 ${h(a)} ${h(n+i)}`,`L ${h(a)} ${h(r-i)}`,`A ${i} ${i} 0 0 0 ${h(a+i)} ${h(r)}`,`L ${h(s)} ${h(r)}`,"Z"].join(" ");return Y("path",{d:c,fill:t})}function lU(e,t,n){let r=e.pillTopY+Og,i=_S(e),o,s;return e.pillMode==="center"?(o=e.x,s="middle"):e.pillMode==="flag-right"?(o=i+fs,s="start"):(o=i-fs,s="end"),pe({x:h(o),y:h(r),"font-family":n.sans,"font-size":sl,"font-weight":700,fill:t,"text-anchor":s},e.label)}function cU(e,t,n,r,i){let o=[],s=[];e.titleTruncated&&s.push(e.title),e.waveTooltip!==void 0&&s.push(e.waveTooltip),s.length>0&&o.push(`<title>${tt(s.join(`
|
|
2920
|
-
`))}</title>`);let a=fS(n,e.style.shadow);o.push(tU(e.box.x,e.box.y,e.box.width,e.box.height,e.style,{filter:a??null})),e.waveRole==="background"&&o.push(SU(e.box,e.style,n));let c=qW(e.style.bg,r),l={done:c.done,"in-progress":c.inProgress,"at-risk":c.atRisk,blocked:c.blocked,planned:c.planned,neutral:c.neutral},u=l[e.status]??l.neutral;if(e.progressFraction>0){let y=Math.max(0,Math.min(e.box.width,e.box.width*e.progressFraction));o.push(Y("rect",{x:h(e.box.x),y:h(e.box.y+e.box.height-Jt),width:h(y),height:Jt,fill:e.style.fg,opacity:.55}))}let f=e.dotSpills&&e.dotSpillCx!==null?e.dotSpillCx:e.box.x+e.box.width-_i;o.push(Y("circle",{cx:h(f),cy:h(e.box.y+Ag),r:br,fill:u})),o.push(TS(e.inlineDatePins,e.style.fg));let d;if(e.textSpills)d=e.box.x+e.box.width+Mn,e.iconSpills&&(d+=Lr+hn);else{let y=!!e.linkIcon&&e.linkIcon!=="none",T=e.inlineDatePins?.find(v=>v.side==="after"&&!v.spilled)?ls(y,{barWidth:e.box.width}):ls(!t.noLinks&&y&&!e.iconSpills);d=e.box.x+T}let p=e.style.text,m=r.entities.item.text,g=e.textSpills?m:p,w=e.textSpills?m:e.style.fg,E=e.titleLines??(e.title?[e.title]:[]);if(E.forEach((y,x)=>{y!==""&&o.push(pe({x:h(d),y:h(e.box.y+Cf+x*el),"font-family":i[e.style.font],"font-size":Nr,"font-weight":600,fill:g},y))}),(e.metaText||e.capacity)&&o.push(JW({metaText:e.metaText,capacity:e.capacity,x:d,baselineY:e.box.y+Of(E.length),fontSize:Qa,fontFamily:i[e.style.font],color:w})),e.footnoteIndicators.length>0){let y=e.box.y+kg;if(e.footnoteSpills&&e.footnoteSpillStartX!==null){let x=e.footnoteSpillStartX;for(let T=0;T<e.footnoteIndicators.length;T++){let v=e.footnoteIndicators[T];o.push(pe({x:h(x),y:h(y),"font-family":i.sans,"font-size":tl,"font-weight":700,fill:m},String(v))),x+=Zt}}else{let x=e.box.x+e.box.width-as;for(let T=e.footnoteIndicators.length-1;T>=0;T--){let v=e.footnoteIndicators[T];o.push(pe({x:h(x),y:h(y),"font-family":i.sans,"font-size":tl,"font-weight":700,fill:e.style.text,"text-anchor":"end"},String(v))),x-=Zt}}}if(!t.noLinks&&e.linkIcon&&e.linkIcon!=="none"){let y={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:r.item.linkIconFg},x=y[e.linkIcon]??y.generic,T=Lr,v=e.iconSpills&&e.iconSpillX!==null?e.iconSpillX:e.box.x+Ai,k=e.box.y+Ai,C=Y("rect",{x:h(v),y:h(k),width:T,height:T,rx:2,ry:2,fill:x}),$=v,O=k,H=Y("path",{d:`M${h($+4)} ${h(O+10)} L${h($+10)} ${h(O+4)} M${h($+6)} ${h(O+4)} H${h($+10)} V${h(O+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),P=C+H,R=e.linkHref?Y("a",{href:e.linkHref,target:"_blank",rel:"noopener"},P):P;o.push(R)}if(e.hasOverflow&&e.overflowBox){let y=r.item.overflowTailFill,x=r.item.overflowTailStroke,T=r.item.overflowCaption;o.push(Y("rect",{x:h(e.overflowBox.x),y:h(e.overflowBox.y),width:h(e.overflowBox.width),height:h(e.overflowBox.height),fill:y,stroke:x,"stroke-width":1})),e.overflowAnchorId&&e.overflowBox.width>60&&o.push(pe({x:h(e.overflowBox.x+e.overflowBox.width/2),y:h(e.overflowBox.y+e.overflowBox.height/2+3),"font-family":i.sans,"font-size":9,"font-weight":700,fill:T,"text-anchor":"middle"},`past ${e.overflowAnchorId}`))}for(let y of e.labelChips){let x=Math.min(rl[y.style.cornerRadius]??8,y.box.height/2);o.push(Y("rect",{x:h(y.box.x),y:h(y.box.y),width:h(y.box.width),height:h(y.box.height),rx:h(x),ry:h(x),fill:y.style.bg==="none"?"transparent":y.style.bg,stroke:y.style.fg,"stroke-width":.5})),o.push(pe({x:h(y.box.x+y.box.width/2),y:h(y.box.y+y.box.height/2+3),...xS(y.style,i,us.xs),"text-anchor":"middle"},y.text))}return Y("g",{"data-layer":"item","data-id":e.id??null},o.join(""))}function uU(e,t,n,r,i,o){let s=[];if(!(e.kind==="group"&&e.waveOnly)){let c=e.box.y+e.headerHeight,l=e.box.height-e.headerHeight;if(e.style.bg!=="none"){let f=t<=ry;s.push(Y("rect",{x:h(e.box.x),y:h(c),width:h(e.box.width),height:h(l),fill:f?e.style.bg:"none","fill-opacity":f?t===1?ty:ny:null,stroke:f?null:e.style.bg,"stroke-opacity":f?null:.6,"stroke-width":f?null:1}))}let u=e.kind==="group"?e.style.fg:i.parallel.bracketStroke;if(e.headerHeight>0&&e.style.bracket!=="none"){let f=e.box.y+fl,d=e.box.x,p=e.box.x+e.box.width;s.push(Y("path",{d:`M${h(d)} ${h(c)} V${h(f)} H${h(p)} V${h(c)}`,fill:"none",stroke:u,"stroke-width":1.2,"stroke-dasharray":e.style.bracket==="dashed"?"3 2":null}))}e.title&&e.headerHeight>0&&s.push(pe({x:h(ps(e.box.x,eU(e.inlineDatePins))),y:h(e.box.y+ey),...xS(e.style,o,ed),"font-weight":600,fill:u},e.title)),s.push(TS(e.inlineDatePins,e.style.fg))}for(let c of e.children)s.push(AS(c,n,r,i,o,t));return Y("g",{"data-layer":e.kind,"data-id":e.id??null},s.join(""))}function AS(e,t,n,r,i,o=0){return e.kind==="item"?cU(e,t,n,r,i):uU(e,o+1,t,n,r,i)}var mS=2;function fU(e,t){switch(e){case"green":return t.swimlane.utilizationOk;case"yellow":return t.swimlane.utilizationWarn;case"red":return t.swimlane.utilizationOver}}function dU(e,t){if(!e.utilization||e.utilization.segments.length===0)return"";let n=e.box.y+e.box.height-mS,r=e.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":Y("rect",{x:h(i.startX),y:h(n),width:h(o),height:mS,fill:fU(i.classification,t),"data-utilization":i.classification,"data-load":h(i.load)})});return Y("g",{"data-layer":"lane-utilization","data-id":e.id??null},r.join(""))}function pU(e,t){let n=e.bandIndex%2===0?t.swimlane.rowTintEven:t.swimlane.rowTintOdd,r=t.swimlane.border;return Y("g",{"data-layer":"swimlane-bg","data-id":e.id??null},Y("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),fill:n,stroke:r,"stroke-width":1}))}function kS(e,t,n,r,i){let o=r.swimlane.tabFill,s=r.swimlane.tabStroke,a=r.swimlane.tabText,c=r.swimlane.ownerText,l=r.swimlane.footnoteIndicator,u=[];if(e.title){let d=e.capacity?Ei(e.capacity.text,e.capacity.icon,10):0,p=e.footnoteIndicators.length>0?e.footnoteIndicators.join(","):"",m=p?gp(p,10):0,g=dl(e.box.x,e.title,e.owner,d,m),w=Bf,E=e.box.y+10,y=E+Wf;u.push(Y("rect",{x:h(g.tabX),y:h(E),width:h(g.tabW),height:h(w),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(pe({x:h(g.titleX),y:h(y),"font-family":i[e.style.font],"font-size":12,"font-weight":600,fill:a},e.title)),e.owner&&u.push(pe({x:h(g.ownerX),y:h(y),"font-family":i[e.style.font],"font-size":10,fill:c},`owner: ${e.owner}`)),e.capacity&&u.push(wS(e.capacity,void 0,g.badgeX,y,10,i[e.style.font],c)),p&&u.push(pe({x:h(g.footnoteRightX),y:h(E+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:l,"text-anchor":"end"},p))}for(let f of e.children)u.push(AS(f,t,n,r,i));return u.push(dU(e,r)),Y("g",{"data-layer":"swimlane","data-id":e.id??null},u.join(""))}function IS(e,t,n){let r=e.radius,i=e.center.x,o=e.center.y,s=t.anchorDiamond.fill,a=t.anchorDiamond.stroke,c=Y("path",{d:`M${h(i)} ${h(o-r)} L${h(i+r)} ${h(o)} L${h(i)} ${h(o+r)} L${h(i-r)} ${h(o)} Z`,fill:s,stroke:a,"stroke-width":1.25}),l=t.anchorDiamond.label,u=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,f={x:h(u),y:h(o+4),"font-family":n.sans,"font-size":10,fill:l};e.labelSide==="left"&&(f["text-anchor"]="end");let d=e.title?pe(f,e.title):"";return Y("g",{"data-layer":"anchor","data-id":e.id??null},SS(e.hiddenDate)+c+d)}function RS(e,t){let n=t.anchorDiamond.cutLine;return Y("line",{x1:h(e.center.x),y1:h(e.center.y+e.radius+1),x2:h(e.center.x),y2:h(e.cutBottomY),stroke:n,"stroke-width":1,"stroke-dasharray":"1 3"})}function bS(e,t,n){let r=e.center.x,i=e.center.y,o=e.radius,s=t.milestoneDiamond.fill,a=Y("path",{d:`M${h(r)} ${h(i-o)} L${h(r+o)} ${h(i)} L${h(r)} ${h(i+o)} L${h(r-o)} ${h(i)} Z`,fill:s,stroke:s,"stroke-width":1}),c=t.milestoneDiamond.label,l=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,u={x:h(l),y:h(i+4),"font-family":n.sans,"font-size":10,"font-weight":600,fill:c};e.labelSide==="left"&&(u["text-anchor"]="end");let f=e.title?pe(u,e.title):"";return Y("g",{"data-layer":"milestone","data-id":e.id??null},SS(e.hiddenDate)+a+f)}function SS(e){return e===void 0?"":`<title>${tt(e)}</title>`}function NS(e,t,n){let r=e.isOverrun?n.milestoneDiamond.cutLineOverrun:n.milestoneDiamond.cutLineNormal,i=[];if(e.onWaveBoundary||i.push(Y("line",{x1:h(e.center.x),y1:h(e.center.y+e.radius+1),x2:h(e.center.x),y2:h(e.cutBottomY),stroke:r,"stroke-width":2,"stroke-dasharray":Uf,"stroke-linecap":"round"})),e.slackArrows&&e.slackArrows.length>0){let o=n.milestoneDiamond.slack;for(let s of e.slackArrows)i.push(Y("path",{d:`M${h(s.x)} ${h(s.y)} H${h(e.center.x-6)}`,fill:"none",stroke:o,"stroke-width":1.1,"stroke-dasharray":"3 3","stroke-linecap":"round","marker-end":`url(#${t}-arrow-dark)`}))}return i.join("")}var hU="3 3";function LS(e,t){let n=e.waypoints;if(n.length<2)return"";let r=t.dependency.edgeStroke,i=n[n.length-1],o=n[n.length-2],s=Math.hypot(i.x-o.x,i.y-o.y);if(s===0)return"";let a=(i.x-o.x)/s,c=(i.y-o.y)/s,l=e.headWidth/2,u=e.head==="dot"?l:e.headWidth*5/7,f=s>u?[...n.slice(0,-1),{x:i.x-a*u,y:i.y-c*u}]:n.slice(0,-1),d=[mU(f,e.slack,r)],p=t.arrowhead.neutral;if(e.head==="dot")d.push(Y("circle",{cx:h(i.x-a*l),cy:h(i.y-c*l),r:h(l),fill:p}));else{let m=i.x-a*u,g=i.y-c*u;d.push(Y("path",{d:`M${h(m-c*l)} ${h(g+a*l)} L${h(i.x)} ${h(i.y)} L${h(m+c*l)} ${h(g-a*l)} z`,fill:p}))}return Y("g",{"data-layer":"dependency"},d.join(""))}function mU(e,t,n){if(e.length<2)return"";let r={fill:"none",stroke:n,"stroke-width":1.1,"stroke-linejoin":"round"};if(!t)return Y("path",{d:yU(e,Yf),...r});let{solid:i,dotted:o}=gU(e,Yf);return(i?Y("path",{d:i,...r}):"")+(o?Y("path",{d:o,...r,"stroke-dasharray":hU,"stroke-linecap":"round"}):"")}function gU(e,t){let n=e.length,r=[],i=[],o=[];for(let a=1;a<n-1;a++){let c=e[a-1],l=e[a],u=e[a+1],f=Math.hypot(l.x-c.x,l.y-c.y),d=Math.hypot(u.x-l.x,u.y-l.y),p=Math.min(t,f/2,d/2),m={x:Math.sign(l.x-c.x),y:Math.sign(l.y-c.y)},g={x:Math.sign(u.x-l.x),y:Math.sign(u.y-l.y)};r[a]={x:l.x-m.x*p,y:l.y-m.y*p},i[a]={x:l.x+g.x*p,y:l.y+g.y*p},p>0&&o.push(`M${h(r[a].x)} ${h(r[a].y)} Q${h(l.x)} ${h(l.y)} ${h(i[a].x)} ${h(i[a].y)}`)}let s=[];for(let a=0;a<n-1;a++){let c=a===0?e[0]:i[a],l=a===n-2?e[n-1]:r[a+1],u=`M${h(c.x)} ${h(c.y)} L${h(l.x)} ${h(l.y)}`;Math.abs(e[a+1].y-e[a].y)<1e-9?s.push(u):o.push(u)}return{solid:o.join(" "),dotted:s.join(" ")}}function yU(e,t){if(e.length<2)return"";let n=[`M${h(e[0].x)} ${h(e[0].y)}`];for(let r=1;r<e.length;r++){let i=e[r-1],o=e[r];if(r===e.length-1){n.push(`L${h(o.x)} ${h(o.y)}`);continue}let s=e[r+1],a=Math.sign(o.x-i.x),c=Math.sign(o.y-i.y),l=Math.sign(s.x-o.x),u=Math.sign(s.y-o.y),f=Math.hypot(o.x-i.x,o.y-i.y),d=Math.hypot(s.x-o.x,s.y-o.y),p=Math.min(t,f/2,d/2);if(p<=0||a!==0&&l!==0||c!==0&&u!==0){n.push(`L${h(o.x)} ${h(o.y)}`);continue}let m={x:o.x-a*p,y:o.y-c*p},g={x:o.x+l*p,y:o.y+u*p};n.push(`L${h(m.x)} ${h(m.y)}`),n.push(`Q${h(o.x)} ${h(o.y)} ${h(g.x)} ${h(g.y)}`)}return n.join(" ")}function xU(e,t,n,r){if(e.entries.length===0)return"";let i=n.footnotePanel.fill,o=n.footnotePanel.border,s=n.footnotePanel.header,a=n.footnotePanel.title,c=n.footnotePanel.description,l=n.footnotePanel.number,u=[];u.push(Y("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),rx:6,ry:6,fill:i,stroke:o,"stroke-width":1,filter:`url(#${t}-shadow-subtle)`})),u.push(pe({x:h(e.box.x+Ft),y:h(e.box.y+Fg),"font-family":r.sans,"font-size":12,"font-weight":700,fill:s},"Footnotes"));let f=e.box.x+Ft;for(let d of e.entries){d.region!==void 0&&d.regionHeadingY!==void 0&&u.push(pe({x:h(f),y:h(d.regionHeadingY),"font-family":r.sans,"font-size":10,"font-weight":700,fill:s},d.region)),u.push(pe({x:h(f),y:h(d.y),"font-family":r.sans,"font-size":10,"font-weight":700,fill:l},String(d.number)));for(let p of d.titleLines)u.push(pe({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,"font-weight":600,fill:a},p.text));for(let p of d.descriptionLines??[])u.push(pe({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,fill:c},p.text))}return Y("g",{"data-layer":"footnotes"},u.join(""))}function EU(e,t,n,r,i,o){let s=r.includeRegion.border,a=r.includeRegion.fill,c=r.includeRegion.tabFill,l=r.includeRegion.tabStroke,u=r.includeRegion.tabText,f=r.includeRegion.badgeFill,d=r.includeRegion.badgeStroke,p=r.includeRegion.badgeText,m=e.box.x+8,g=e.box.y,w=e.box.width-16,E=e.box.height,y=Y("rect",{x:h(m),y:h(g),width:h(w),height:h(E),rx:8,ry:8,fill:a,stroke:s,"stroke-width":1,"stroke-dasharray":Uf}),x=Bf,T=pl(e.box.x,e.label,e.sourcePath),v=g-x/2,k=Y("rect",{x:h(T.tabX),y:h(v),width:h(T.tabWidth),height:x,rx:4,ry:4,fill:c,stroke:l,"stroke-width":1}),C=pe({x:h(T.tabLabelX),y:h(v+Wf),"font-family":i.sans,"font-size":11,"font-weight":600,fill:u},e.label),$=T.badgeX,O=T.badgeSize,H=g-O/2,P=Y("rect",{x:h($),y:h(H),width:O,height:O,rx:4,ry:4,fill:f,stroke:d,"stroke-width":1}),R=Y("path",{d:`M${h($+7)} ${h(H+4)} H${h($+14)} V${h(H+11)} M${h($+4)} ${h(H+7)} H${h($+11)} V${h(H+14)} H${h($+4)} Z`,stroke:p,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),b=9,M=g+4,_=Y("rect",{x:h(T.sourceHaloX),y:h(M-b),width:h(T.sourceHaloWidth),height:b+6,fill:a}),S=pe({x:h(T.sourceTextX),y:h(M),"font-family":i.mono,"font-size":b,fill:p},e.sourcePath),L={x:m,y:g,width:w,height:E},F=o?vS(o.timeline,o.chartBox.y,r,L):"",N=o?.waves?OS(o.waves,L)+DS(o.waveBoundaries,L):"",W=o?.waves?MS(e.waveCrossings):"",G=e.nestedSwimlanes.map(A=>kS(A,t,n,r,i)).join(""),X=(e.edges??[]).map(A=>LS(A,r)).join(""),Q=e.anchors??[],j=e.milestones??[],ne=Q.map(A=>RS(A,r)).join("")+j.map(A=>NS(A,n,r)).join("")+Q.map(A=>IS(A,r,i)).join("")+j.map(A=>bS(A,r,i)).join("");return Y("g",{"data-layer":"include"},y+F+N+X+G+W+ne+k+C+P+R+_+S)}function wU(e,t){let n=e.palette.attribution.mark,r=e.palette.attribution.link;if(e.swimlanes.length===0)return"";let i=e.header.attributionBox.x,o=e.header.attributionBox.y,s=Cr,a=pe({x:"0",y:s,"font-family":t.sans,"font-size":Hf,"font-weight":400,fill:n},zf)+pe({x:ll,y:s,"font-family":t.sans,"font-size":Cr,"font-weight":700,fill:n},"now")+Y("rect",{x:Wg,y:12,width:Ug,height:Cr,fill:r})+pe({x:jf,y:s,"font-family":t.sans,"font-size":Cr,"font-weight":400,fill:n},"ine"),c=Y("g",{transform:`translate(${h(i)} ${h(o)}) scale(${h(al)})`},a);return Y("a",{href:Bg,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},Y("g",{"data-layer":"attribution"},c))}async function TU(e,t,n,r){let i=e.assetRef??"",{x:o,y:s,width:a,height:c}=e.box,l;try{if(r.logo&&r.logo.ref===i)l=r.logo.asset;else if(t)l=await t(i);else return""}catch(d){let p=`logo file not found: ${i} (${d instanceof Error?d.message:String(d)})`;if(r.strict)throw d;return r.warn?.(p),""}let u=(l.mime??"").toLowerCase();if(u==="image/svg+xml"){let d=new TextDecoder().decode(l.bytes),p=e.intrinsic??dp(d)??{width:a,height:c},m=new Set,g=iS(d,{idPrefix:`${n}-logo`,onWarn:w=>m.add(w.replace(/^sanitizer: dropping /,"")),stripRootSize:!0});return m.size>0&&r.warn?.(`logo ${i}: removed unsupported SVG content: ${[...m].join(", ")}`),Y("svg",{"data-layer":"logo",x:h(o),y:h(s),width:h(a),height:h(c),viewBox:`0 0 ${h(p.width)} ${h(p.height)}`,preserveAspectRatio:"xMidYMid meet",overflow:"hidden"},g)}if(u==="image/png"||u==="image/jpeg"||u==="image/jpg"||u==="image/webp"){let d=vU(l.bytes);return Y("image",{"data-layer":"logo",href:`data:${u};base64,${d}`,x:h(o),y:h(s),width:h(a),height:h(c),preserveAspectRatio:"xMidYMid meet"})}let f=`unsupported logo format: ${u} (${i})`;if(r.strict)throw new Error(f);return r.warn?.(f),""}function vU(e){if(typeof btoa<"u"){let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}let t=globalThis;if(t.Buffer)return t.Buffer.from(e).toString("base64");throw new Error("renderer: no base64 encoder available")}var _U=.24,hp=2,gS=3,AU=4,kU=8,IU=10;function PS(e){return e.bg==="none"?"transparent":e.bg}function yp(e){return ES(e)>=_U?"dark":"light"}function $S(e,t){return`url(#${e}-wave-hatch-${t})`}function RU(e,t,n){let r=Vg;return Y("pattern",{id:`${e}-wave-hatch-${t}`,width:r,height:r,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)"},Y("line",{x1:h(r/2),y1:0,x2:h(r/2),y2:r,stroke:t==="dark"?n.wave.hatch:n.wave.hatchOnDark,"stroke-width":Kg,opacity:Yg}))}function bU(e){if(!e.waves)return[];let t=new Set,n=i=>{for(let o of i)o.kind==="item"?o.waveRole==="background"&&t.add(yp(PS(o.style))):n(o.children)},r=i=>{for(let o of i)n(o.children),r(o.nested)};r(e.swimlanes);for(let i of e.includes)r(i.nestedSwimlanes);return e.waveLegend?.entries.some(i=>i.kind==="background")&&t.add(yp(FS(e.palette))),["dark","light"].filter(i=>t.has(i))}function SU(e,t,n){let i=Math.min(rl[t.cornerRadius]??4,e.height/2);return Y("rect",{x:h(e.x+.5),y:h(e.y+.5),width:h(Math.max(0,e.width-2*.5)),height:h(Math.max(0,e.height-2*.5)),rx:h(i),ry:h(i),fill:$S(n,yp(PS(t)))})}function bx(e,t){let n=Math.max(e.x,t.x),r=Math.max(e.y,t.y),i=Math.min(e.x+e.width,t.x+t.width),o=Math.min(e.y+e.height,t.y+t.height);if(!(i<=n||o<=r))return{x:n,y:r,width:i-n,height:o-r}}var Ix=4,mp=.5;function CS(e,t){if(e.empty)return;let n=mp;return bx({x:e.strip.box.x,y:e.strip.box.y+n,width:e.strip.box.width,height:e.strip.box.height-2*n},{x:t.box.x+n,y:e.strip.box.y,width:t.box.width-2*n,height:e.strip.box.height})}function NU(e,t){let n=Math.min(Ix-mp,e.width/2,e.height/2),r=1e-6;return{left:e.x<=t.box.x+mp+r?n:0,right:e.x+e.width>=t.box.x+t.box.width-mp-r?n:0}}function LU(e,t){let{x:n,y:r,width:i,height:o}=e,s=(a,c,l)=>a>0?` A${h(a)} ${h(a)} 0 0 1 ${h(c)} ${h(l)}`:"";return`M${h(n+t.left)} ${h(r)} H${h(n+i-t.right)}`+s(t.right,n+i,r+t.right)+` V${h(r+o-t.right)}`+s(t.right,n+i-t.right,r+o)+` H${h(n+t.left)}`+s(t.left,n,r+o-t.left)+` V${h(r+t.left)}`+s(t.left,n+t.left,r)+" Z"}function Rx(e,t,n){let r=o=>n&&(n.left>0||n.right>0)?Y("path",{d:LU(t,n),...o}):Y("rect",{x:h(t.x),y:h(t.y),width:h(t.width),height:h(t.height),...o}),i=r({fill:e.style.stripFill});return e.style.tint?i+r({fill:e.style.tint,"fill-opacity":cl}):i}function PU(e,t){let n=e.timeline,r=n.waveStrip;if(!e.waves||!r)return"";let i=[Y("rect",{x:h(n.box.x),y:h(r.y),width:h(n.box.width),height:h(r.height),rx:Ix,ry:Ix,fill:t.timeline.panelFill,stroke:t.timeline.border,"stroke-width":1})];for(let o of e.waves){let s=CS(o,n);s&&i.push(Y("g",{"data-id":o.id},`<title>${tt(o.strip.tooltip)}</title>${Rx(o,s,NU(s,n))}`))}return Y("g",{"data-layer":"wave-strip"},i.join(""))}function OS(e,t){let n=[];for(let r of e){if(!r.style.tint||r.empty)continue;let i=t?bx(r.columnBox,t):r.columnBox;!i||i.width<=0||i.height<=0||n.push(Y("rect",{x:h(i.x),y:h(i.y),width:h(i.width),height:h(i.height),fill:r.style.tint,"fill-opacity":qg}))}return n.length===0?"":Y("g",{"data-layer":"wave-bg"},n.join(""))}function DS(e,t){let n=[];for(let r of e??[]){let i=r.topY,o=r.bottomY;t&&(r.x<=t.x||r.x>=t.x+t.width||(i=Math.max(i,t.y),o=Math.min(o,t.y+t.height),o<=i))||n.push(Y("line",{x1:h(r.x),y1:h(i),x2:h(r.x),y2:h(o),stroke:r.stroke,"stroke-width":Vf,"stroke-dasharray":r.dash}))}return n.length===0?"":Y("g",{"data-layer":"wave-boundary"},n.join(""))}function yS(e,t){let n=gp(e,mn);return t?n*1.05:n}function $U(e,t,n){let r=e.timeline,i=r.waveStrip;if(!e.waves||!i)return"";let o=i.y+i.height/2+AU,s=i.y+gS,a=i.height-2*gS,c=[],l=(u,f)=>{let d=yS(f,!1)+2*hp;return Y("rect",{x:h(u-d/2),y:h(s),width:h(d),height:h(a),fill:t.timeline.panelFill})+pe({x:h(u),y:h(o),"font-family":n.sans,"font-size":mn,"font-style":"italic",fill:t.wave.labelMuted,"text-anchor":"middle"},f)};i.placeholder!==void 0&&c.push(l(r.box.x+r.box.width/2,i.placeholder));for(let u of e.waves){if(u.strip.gapLabel){let{text:m,x:g}=u.strip.gapLabel;c.push(l(g,m))}if(u.strip.marker){let{x:m,y:g}=u.strip.marker,w=Zg/2;c.push(Y("path",{d:`M${h(m)} ${h(g-w)} L${h(m+w)} ${h(g)} L${h(m)} ${h(g+w)} L${h(m-w)} ${h(g)} Z`,fill:t.timeline.panelFill,stroke:t.wave.boundary,"stroke-width":1.5},`<title>${tt(u.strip.tooltip)}</title>`))}let f=CS(u,r);if(!f)continue;let d=f.x+f.width,p=u.strip.footnotesShown?u.footnoteIndicators.length*Zt:0;if(p){let m=d-Wn+hp,g=d-Wn-p-hp;c.push(Rx(u,{x:g,y:s,width:m-g,height:a}))}if(u.strip.label!==void 0){let m=yS(u.strip.label,!0),g=p?Math.min(u.strip.labelX,d-Wn-p-m/2):u.strip.labelX,w=m+2*hp;c.push(Rx(u,{x:g-w/2,y:s,width:w,height:a})),c.push(pe({x:h(g),y:h(o),"font-family":n.sans,"font-size":mn,"font-weight":600,fill:u.style.text,"text-anchor":"middle"},u.strip.label))}if(u.strip.footnotesShown){let m=d-Wn;for(let g=u.footnoteIndicators.length-1;g>=0;g--)c.push(pe({x:h(m),y:h(i.y+IU),"font-family":n.sans,"font-size":kU,"font-weight":700,fill:u.style.text,"text-anchor":"end"},String(u.footnoteIndicators[g]))),m-=Zt}}return c.length===0?"":Y("g",{"data-layer":"wave-labels"},c.join(""))}function MS(e){if(!e||e.length===0)return"";let t=e.map(n=>Y("line",{x1:h(n.x),y1:h(n.topY),x2:h(n.x),y2:h(n.bottomY),stroke:n.stroke,"stroke-width":1,"stroke-dasharray":jg}));return Y("g",{"data-layer":"wave-cross"},t.join(""))}function FS(e){let t=e.entities.item.bg;return t==="none"?"transparent":t}function CU(e,t,n,r){if(!e)return"";let i=[];for(let o of e.entries){let s=o.swatch;if(s&&o.kind==="background"){let a=FS(n),c={x:h(s.x),y:h(s.y),width:h(s.width),height:h(s.height)};i.push(Y("rect",{...c,rx:2,ry:2,fill:a,stroke:n.entities.item.fg,"stroke-width":1})),i.push(Y("rect",{x:h(s.x+.5),y:h(s.y+.5),width:h(s.width-1),height:h(s.height-1),rx:2,ry:2,fill:$S(t,yp(a))}))}else if(s&&o.kind==="boundary"){let a=s.x+s.width/2;i.push(Y("line",{x1:h(a),y1:h(s.y),x2:h(a),y2:h(s.y+s.height),stroke:n.wave.boundary,"stroke-width":Vf}))}for(let a of o.runs)i.push(pe({x:h(a.x),y:h(a.y),"font-family":r.sans,"font-size":mn,fill:n.wave.labelText},a.text))}return Y("g",{"data-layer":"wave-legend"},i.join(""))}async function Sx(e,t={}){let r=new pp(t.idPrefix??"nl").next("root"),i=e.palette,o=t.fontFamilies??Gg,s=[],a=(u,f)=>`<marker id="${u}" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" fill="${f}"/></marker>`,c=`<defs>${dS(r)}`+a(`${r}-arrow-dark`,i.arrowhead.dark)+bU(e).map(u=>RU(r,u,i)).join("")+"</defs>";s.push(c),s.push(Y("rect",{x:0,y:0,width:h(e.width),height:h(e.height),fill:e.backgroundColor})),s.push(oU(e.timeline,i,o)),s.push(PU(e,i));for(let u of e.swimlanes)s.push(pU(u,i));s.push(vS(e.timeline,e.chartBox.y,i)),e.waves&&s.push(OS(e.waves)),s.push(rU(e.timeline,e.chartBox.y,i)),s.push(DS(e.waveBoundaries)),s.push($U(e,i,o));for(let u of e.edges)s.push(LS(u,i));for(let u of e.swimlanes)s.push(kS(u,t,r,i,o));for(let u of e.includes)s.push(EU(u,t,r,i,o,e));s.push(MS(e.waveCrossings));for(let u of e.anchors)s.push(RS(u,i));for(let u of e.milestones)s.push(NS(u,r,i));s.push(iU(e.timeline,i,o));for(let u of e.anchors)s.push(IS(u,i,o));for(let u of e.milestones)s.push(bS(u,i,o));if(s.push(sU(e.nowline,i,o)),s.push(xU(e.footnotes,r,i,o)),s.push(CU(e.waveLegend,r,i,o)),s.push(nU(e.header,r,i,o)),s.push(wU(e,o)),e.header.logo&&(t.logo||t.assetResolver)){let u=await TU(e.header.logo,t.assetResolver,r,t);u&&s.push(u)}return`<svg${Ls({xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${h(e.width)} ${h(e.height)}`,width:h(e.width),height:h(e.height),"data-theme":e.theme,"data-generator":"nowline"})}>${s.join("")}</svg>`}var Nx="/browser-source.nowline",OU={error:3,warning:2,info:1},DU={error:3,warning:2,info:1};function BS(e,t){return OU[e]>=DU[t]}var xp,WS=0;function US(){return xp||(xp=Sy()),xp}function MU(){return Ce.parse(`memory:///nowline-browser-${++WS}.nowline`)}async function Lx(e,t={}){let n=t.filePath??Nx,r=US(),o=r.shared.workspace.LangiumDocumentFactory.fromString(e,MU());return await r.shared.workspace.DocumentBuilder.build([o],{validation:!0}),{ast:o.parseResult.value,diagnostics:XS(o,n)}}function XS(e,t){return GS(Ii(e),t)}function GS(e,t){return e.map(n=>n.origin==="lexer"?vx(n.error,t):n.origin==="parser"?Tx(n.error,t):jb(n.diagnostic,t))}async function Px(e,t={}){let n=t.filePath??Nx,r=US(),i,o;if(t.timezone)try{i=Ex(t.timezone)}catch(x){if(!(x instanceof Di))throw x;o=x}let s=o?void 0:wx({now:t.today,zone:i}),a=await kx({source:e,sourcePath:n,services:r,readSource:t.readFile??Zb,assetResolver:t.assetResolver,isToleratedIncludeError:x=>_x(x.message),layout:{theme:t.theme,today:s,locale:t.locale,width:t.width,nonWorking:t.nonWorking}});if(a.kind==="invalid")return{kind:"diagnostics",diagnostics:GS(a.diagnostics,n)};let c=a.kind==="include-error"&&a.legacy!==void 0,l=XS(a.document,n);for(let x of a.resolved.diagnostics){if(x.severity==="error"&&_x(x.message)){t.onSkippedInclude?.({sourcePath:x.sourcePath,message:x.message});continue}c&&Dr(x)||l.push(Yb(x))}if(a.kind==="include-error"||l.some(x=>x.severity==="error"))return{kind:"diagnostics",diagnostics:l};if(o)return{kind:"diagnostics",diagnostics:[{severity:"error",code:"invalid-timezone",message:o.message,file:n,line:1,column:1}]};let u=[...a.warnings],{logo:f,model:d}=a,p=t.diagnosticLevel??"error",m=xx(d,{today:s??void 0,locale:t.locale??"en-US"}).map(x=>Kb(x,n)),g=t.showLinks!==!1,w=t.strict===!0,E=await Sx(d,{idPrefix:t.idPrefix,assetResolver:t.assetResolver,logo:f,noLinks:!g,strict:w,warn:x=>u.push(x),fontFamilies:t.fontFamilies}),y=[...m,...u.map(x=>Vb(x,n,w?"error":"warning"))].filter(x=>BS(x.severity,p));return w&&y.length>0?{kind:"diagnostics",diagnostics:[...l,...y]}:{kind:"svg",svg:E,warnings:y}}function $x(){xp=void 0,WS=0}var zS="/embed.nowline",Cx=!1;async function HS(e){let{ast:t,diagnostics:n}=await Lx(e,{filePath:zS});return{ast:t,errors:n.filter(r=>r.severity==="error").map(r=>r.message)}}async function Ep(e,t={}){let n={filePath:zS,theme:t.theme,today:t.today,timezone:t.timezone,locale:t.locale,width:t.width,nonWorking:t.nonWorking,idPrefix:t.idPrefix,onSkippedInclude:()=>{Cx||(Cx=!0,console.warn("nowline: `include` directives are skipped in the browser embed (single-file mode). Render multi-file roadmaps with the CLI or the GitHub Action."))}},r=await Px(e,n);if(r.kind==="svg")return r.svg;let i=r.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Ol(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Ol=class extends Error{constructor(n,r){super(n);B(this,"details",r);this.name="EmbedRenderError"}};function jS(){Cx=!1,$x()}var nn=Uint8Array,Lt=Uint16Array,Bx=Int32Array,Wx=new nn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ux=new nn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),YS=new nn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ZS=function(e,t){for(var n=new Lt(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Bx(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},JS=ZS(Wx,2),FU=JS.b,Dx=JS.r;FU[28]=258,Dx[258]=28;var QS=ZS(Ux,0),Wse=QS.b,VS=QS.r,Mx=new Lt(32768);for(xe=0;xe<32768;++xe)Kn=(xe&43690)>>1|(xe&21845)<<1,Kn=(Kn&52428)>>2|(Kn&13107)<<2,Kn=(Kn&61680)>>4|(Kn&3855)<<4,Mx[xe]=((Kn&65280)>>8|(Kn&255)<<8)>>1;var Kn,xe,Fl=(function(e,t,n){for(var r=e.length,i=0,o=new Lt(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new Lt(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new Lt(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],f=s[e[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[Mx[f]>>c]=l}else for(a=new Lt(r),i=0;i<r;++i)e[i]&&(a[i]=Mx[s[e[i]-1]++]>>15-e[i]);return a}),Mi=new nn(288);for(xe=0;xe<144;++xe)Mi[xe]=8;var xe;for(xe=144;xe<256;++xe)Mi[xe]=9;var xe;for(xe=256;xe<280;++xe)Mi[xe]=7;var xe;for(xe=280;xe<288;++xe)Mi[xe]=8;var xe,wp=new nn(32);for(xe=0;xe<32;++xe)wp[xe]=5;var xe,BU=Fl(Mi,9,0);var WU=Fl(wp,5,0);var eN=function(e){return(e+7)/8|0},UU=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new nn(e.subarray(t,n))};var qn=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Dl=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},Ox=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return{t:nN,l:0};if(i==1){var s=new nn(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(v,k){return v.f-k.f}),n.push({s:-1,f:25001});var a=n[0],c=n[1],l=0,u=1,f=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=i-1;)a=n[n[l].f<n[f].f?l++:f++],c=n[l!=u&&n[l].f<n[f].f?l++:f++],n[u++]={s:-1,f:a.f+c.f,l:a,r:c};for(var d=o[0].s,r=1;r<i;++r)o[r].s>d&&(d=o[r].s);var p=new Lt(d+1),m=Fx(n[u-1],p,0);if(m>t){var r=0,g=0,w=m-t,E=1<<w;for(o.sort(function(k,C){return p[C.s]-p[k.s]||k.f-C.f});r<i;++r){var y=o[r].s;if(p[y]>t)g+=E-(1<<m-p[y]),p[y]=t;else break}for(g>>=w;g>0;){var x=o[r].s;p[x]<t?g-=1<<t-p[x]++-1:++r}for(;r>=0&&g;--r){var T=o[r].s;p[T]==t&&(--p[T],++g)}m=t}return{t:new nn(p),l:m}},Fx=function(e,t,n){return e.s==-1?Math.max(Fx(e.l,t,n+1),Fx(e.r,t,n+1)):t[e.s]=n},KS=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Lt(++t),r=0,i=e[0],o=1,s=function(c){n[r++]=c},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return{c:n.subarray(0,r),n:t}},Ml=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},tN=function(e,t,n){var r=n.length,i=eN(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var o=0;o<r;++o)e[i+o+4]=n[o];return(i+4+r)*8},qS=function(e,t,n,r,i,o,s,a,c,l,u){qn(t,u++,n),++i[256];for(var f=Ox(i,15),d=f.t,p=f.l,m=Ox(o,15),g=m.t,w=m.l,E=KS(d),y=E.c,x=E.n,T=KS(g),v=T.c,k=T.n,C=new Lt(19),$=0;$<y.length;++$)++C[y[$]&31];for(var $=0;$<v.length;++$)++C[v[$]&31];for(var O=Ox(C,7),H=O.t,P=O.l,R=19;R>4&&!H[YS[R-1]];--R);var b=l+5<<3,M=Ml(i,Mi)+Ml(o,wp)+s,_=Ml(i,d)+Ml(o,g)+s+14+3*R+Ml(C,H)+2*C[16]+3*C[17]+7*C[18];if(c>=0&&b<=M&&b<=_)return tN(t,u,e.subarray(c,c+l));var S,L,F,N;if(qn(t,u,1+(_<M)),u+=2,_<M){S=Fl(d,p,0),L=d,F=Fl(g,w,0),N=g;var W=Fl(H,P,0);qn(t,u,x-257),qn(t,u+5,k-1),qn(t,u+10,R-4),u+=14;for(var $=0;$<R;++$)qn(t,u+3*$,H[YS[$]]);u+=3*R;for(var G=[y,v],X=0;X<2;++X)for(var Q=G[X],$=0;$<Q.length;++$){var j=Q[$]&31;qn(t,u,W[j]),u+=H[j],j>15&&(qn(t,u,Q[$]>>5&127),u+=Q[$]>>12)}}else S=BU,L=Mi,F=WU,N=wp;for(var $=0;$<a;++$){var ne=r[$];if(ne>255){var j=ne>>18&31;Dl(t,u,S[j+257]),u+=L[j+257],j>7&&(qn(t,u,ne>>23&31),u+=Wx[j]);var A=ne&31;Dl(t,u,F[A]),u+=N[A],A>3&&(Dl(t,u,ne>>5&8191),u+=Ux[A])}else Dl(t,u,S[ne]),u+=L[ne]}return Dl(t,u,S[256]),u+L[256]},XU=new Bx([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nN=new nn(0),GU=function(e,t,n,r,i,o){var s=o.z||e.length,a=new nn(r+s+5*(1+Math.ceil(s/7e3))+i),c=a.subarray(r,a.length-i),l=o.l,u=(o.r||0)&7;if(t){u&&(c[0]=o.r>>3);for(var f=XU[t-1],d=f>>13,p=f&8191,m=(1<<n)-1,g=o.p||new Lt(32768),w=o.h||new Lt(m+1),E=Math.ceil(n/3),y=2*E,x=function(ge){return(e[ge]^e[ge+1]<<E^e[ge+2]<<y)&m},T=new Bx(25e3),v=new Lt(288),k=new Lt(32),C=0,$=0,O=o.i||0,H=0,P=o.w||0,R=0;O+2<s;++O){var b=x(O),M=O&32767,_=w[b];if(g[M]=_,w[b]=M,P<=O){var S=s-O;if((C>7e3||H>24576)&&(S>423||!l)){u=qS(e,c,0,T,v,k,$,H,R,O-R,u),H=C=$=0,R=O;for(var L=0;L<286;++L)v[L]=0;for(var L=0;L<30;++L)k[L]=0}var F=2,N=0,W=p,G=M-_&32767;if(S>2&&b==x(O-G))for(var X=Math.min(d,S)-1,Q=Math.min(32767,O),j=Math.min(258,S);G<=Q&&--W&&M!=_;){if(e[O+F]==e[O+F-G]){for(var ne=0;ne<j&&e[O+ne]==e[O+ne-G];++ne);if(ne>F){if(F=ne,N=G,ne>X)break;for(var A=Math.min(G,ne-2),D=0,L=0;L<A;++L){var U=O-G+L&32767,z=g[U],J=U-z&32767;J>D&&(D=J,_=U)}}}M=_,_=g[M],G+=M-_&32767}if(N){T[H++]=268435456|Dx[F]<<18|VS[N];var Z=Dx[F]&31,ee=VS[N]&31;$+=Wx[Z]+Ux[ee],++v[257+Z],++k[ee],P=O+F,++C}else T[H++]=e[O],++v[e[O]]}}for(O=Math.max(O,P);O<s;++O)T[H++]=e[O],++v[e[O]];u=qS(e,c,l,T,v,k,$,H,R,O-R,u),l||(o.r=u&7|c[u/8|0]<<3,u-=7,o.h=w,o.p=g,o.i=O,o.w=P)}else{for(var O=o.w||0;O<s+l;O+=65535){var oe=O+65535;oe>=s&&(c[u/8|0]=l,oe=s),u=tN(c,u+1,e.subarray(O,oe))}o.i=s}return UU(a,0,r+eN(u)+i)};var rN=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,o=n.length|0,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=r+=n[s];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}e=r,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},zU=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new nn(o.length+e.length);s.set(o),s.set(e,o.length),e=s,i.w=o.length}return GU(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)};var iN=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};var HU=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=rN();i.p(t.dictionary),iN(e,2,i.d())}};function oN(e,t){t||(t={});var n=rN();n.p(e);var r=zU(e,t,t.dictionary?6:2,4);return HU(r,t),iN(r,r.length-4,n.d()),r}var jU=typeof TextDecoder<"u"&&new TextDecoder,YU=0;try{jU.decode(nN,{stream:!0}),YU=1}catch{}var lN="https://free.nowline.io/open";function sN(e){let t=new TextEncoder().encode(e),n=oN(t),r=32768,i="";for(let o=0;o<n.length;o+=r)i+=String.fromCharCode(...n.subarray(o,o+r));return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Xx({source:e,sourceUrl:t,share:n}){if(n===!1||n==="none")return null;if(typeof n=="object")return t!==void 0&&aN(t)?n.remoteUrl.replace("{url}",encodeURIComponent(t)):n.textUrl.replace("{text}",sN(e));let r=n===!0?lN:n,i=new URL(r);return t!==void 0&&aN(t)?i.hash=`url=${encodeURIComponent(t)}`:i.hash=`text=${sN(e)}`,i.toString()}function aN(e){try{return new URL(e).protocol==="https:"}catch{return!1}}var cN=0;async function uN(e){let t=e.document??globalThis.document;if(!t)return{rendered:0,failed:0};let n=t.querySelectorAll(e.selector),r=0,i=0,o=++cN,s=e.share??!0,a=[],c=0;for(let l of Array.from(n)){let u=VU(l);if(!u)continue;let f=KU(l),d=`nl-r${o}-${c++}`,p={theme:e.theme,locale:e.locale,width:e.width,nonWorking:e.nonWorking,today:e.today,timezone:e.timezone,idPrefix:d},m=u.parentElement,g=u.nextSibling,E=l.getAttribute("data-nowline-source-url")??void 0??e.sourceUrl;a.push(Ep(f,p).then(y=>{if(qU(u,y),r++,m!==null){let x=Xx({source:f,sourceUrl:E,share:s});if(x!==null){let T=t.createElement("a");T.className="nowline-share",T.href=x,T.target="_blank",T.rel="noopener noreferrer",T.textContent="Share on Nowline",m.insertBefore(T,g)}}},y=>{i++,console.error("nowline: render failed",y)}))}return await Promise.all(a),{rendered:r,failed:i}}function VU(e){let t=e.parentElement;return t&&t.tagName.toUpperCase()==="PRE"?t:e}function KU(e){return e.textContent??""}function qU(e,t){e.outerHTML=t}function fN(){cN=0}function Tp(){if(typeof globalThis>"u")return"light";let e=globalThis.matchMedia;if(typeof e!="function")return"light";try{return e("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}function dN(e,t){return e&&e!=="auto"?Oy(e)??t:t}var ZU="0.0.0-dev.20261019024645.g95fa9ba",JU="95fa9ba",QU="pre code.language-nowline, code.language-nowline",pN={theme:"auto",startOnLoad:!0,selector:QU,systemTheme:Tp(),share:!0},Ae={...pN},Gx=!1;function eX(e={}){Ae={theme:e.theme??Ae.theme,startOnLoad:e.startOnLoad??Ae.startOnLoad,selector:e.selector??Ae.selector,locale:e.locale??Ae.locale,width:e.width??Ae.width,nonWorking:e.nonWorking??Ae.nonWorking,today:e.today!==void 0?e.today:Ae.today,timezone:e.timezone??Ae.timezone,share:e.share??Ae.share,sourceUrl:e.sourceUrl??Ae.sourceUrl,systemTheme:Tp()}}function hN(){return{theme:dN(Ae.theme,Ae.systemTheme),locale:Ae.locale,width:Ae.width,nonWorking:Ae.nonWorking,today:Ae.today,timezone:Ae.timezone}}async function tX(e,t={}){let n={...hN(),...t};return Ep(e,n)}async function nX(e){return HS(e)}async function zx(e){let t={selector:e?.selector??Ae.selector,theme:e?.theme??hN().theme,locale:e?.locale??Ae.locale,width:e?.width??Ae.width,nonWorking:e?.nonWorking??Ae.nonWorking,today:e?.today!==void 0?e.today:Ae.today,timezone:e?.timezone??Ae.timezone,share:e?.share??Ae.share,sourceUrl:e?.sourceUrl??Ae.sourceUrl,document:e?.document};return uN(t)}var rX=zx;if(typeof document<"u"&&!Gx){Gx=!0;let e=()=>{Ae.startOnLoad&&zx()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):queueMicrotask(e)}function iX(){Ae={...pN,systemTheme:Tp()},Gx=!1,jS(),fN()}return IN(oX);})();
|
|
2920
|
+
`))}</title>`);let a=fS(n,e.style.shadow);o.push(tU(e.box.x,e.box.y,e.box.width,e.box.height,e.style,{filter:a??null})),e.waveRole==="background"&&o.push(SU(e.box,e.style,n));let c=qW(e.style.bg,r),l={done:c.done,"in-progress":c.inProgress,"at-risk":c.atRisk,blocked:c.blocked,planned:c.planned,neutral:c.neutral},u=l[e.status]??l.neutral;if(e.progressFraction>0){let y=Math.max(0,Math.min(e.box.width,e.box.width*e.progressFraction));o.push(Y("rect",{x:h(e.box.x),y:h(e.box.y+e.box.height-Jt),width:h(y),height:Jt,fill:e.style.fg,opacity:.55}))}let f=e.dotSpills&&e.dotSpillCx!==null?e.dotSpillCx:e.box.x+e.box.width-_i;o.push(Y("circle",{cx:h(f),cy:h(e.box.y+Ag),r:br,fill:u})),o.push(TS(e.inlineDatePins,e.style.fg));let d;if(e.textSpills)d=e.box.x+e.box.width+Mn,e.iconSpills&&(d+=Lr+hn);else{let y=!!e.linkIcon&&e.linkIcon!=="none",T=e.inlineDatePins?.find(v=>v.side==="after"&&!v.spilled)?ls(y,{barWidth:e.box.width}):ls(!t.noLinks&&y&&!e.iconSpills);d=e.box.x+T}let p=e.style.text,m=r.entities.item.text,g=e.textSpills?m:p,w=e.textSpills?m:e.style.fg,E=e.titleLines??(e.title?[e.title]:[]);if(E.forEach((y,x)=>{y!==""&&o.push(pe({x:h(d),y:h(e.box.y+Cf+x*el),"font-family":i[e.style.font],"font-size":Nr,"font-weight":600,fill:g},y))}),(e.metaText||e.capacity)&&o.push(JW({metaText:e.metaText,capacity:e.capacity,x:d,baselineY:e.box.y+Of(E.length),fontSize:Qa,fontFamily:i[e.style.font],color:w})),e.footnoteIndicators.length>0){let y=e.box.y+kg;if(e.footnoteSpills&&e.footnoteSpillStartX!==null){let x=e.footnoteSpillStartX;for(let T=0;T<e.footnoteIndicators.length;T++){let v=e.footnoteIndicators[T];o.push(pe({x:h(x),y:h(y),"font-family":i.sans,"font-size":tl,"font-weight":700,fill:m},String(v))),x+=Zt}}else{let x=e.box.x+e.box.width-as;for(let T=e.footnoteIndicators.length-1;T>=0;T--){let v=e.footnoteIndicators[T];o.push(pe({x:h(x),y:h(y),"font-family":i.sans,"font-size":tl,"font-weight":700,fill:e.style.text,"text-anchor":"end"},String(v))),x-=Zt}}}if(!t.noLinks&&e.linkIcon&&e.linkIcon!=="none"){let y={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:r.item.linkIconFg},x=y[e.linkIcon]??y.generic,T=Lr,v=e.iconSpills&&e.iconSpillX!==null?e.iconSpillX:e.box.x+Ai,k=e.box.y+Ai,C=Y("rect",{x:h(v),y:h(k),width:T,height:T,rx:2,ry:2,fill:x}),$=v,O=k,H=Y("path",{d:`M${h($+4)} ${h(O+10)} L${h($+10)} ${h(O+4)} M${h($+6)} ${h(O+4)} H${h($+10)} V${h(O+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),P=C+H,R=e.linkHref?Y("a",{href:e.linkHref,target:"_blank",rel:"noopener"},P):P;o.push(R)}if(e.hasOverflow&&e.overflowBox){let y=r.item.overflowTailFill,x=r.item.overflowTailStroke,T=r.item.overflowCaption;o.push(Y("rect",{x:h(e.overflowBox.x),y:h(e.overflowBox.y),width:h(e.overflowBox.width),height:h(e.overflowBox.height),fill:y,stroke:x,"stroke-width":1})),e.overflowAnchorId&&e.overflowBox.width>60&&o.push(pe({x:h(e.overflowBox.x+e.overflowBox.width/2),y:h(e.overflowBox.y+e.overflowBox.height/2+3),"font-family":i.sans,"font-size":9,"font-weight":700,fill:T,"text-anchor":"middle"},`past ${e.overflowAnchorId}`))}for(let y of e.labelChips){let x=Math.min(rl[y.style.cornerRadius]??8,y.box.height/2);o.push(Y("rect",{x:h(y.box.x),y:h(y.box.y),width:h(y.box.width),height:h(y.box.height),rx:h(x),ry:h(x),fill:y.style.bg==="none"?"transparent":y.style.bg,stroke:y.style.fg,"stroke-width":.5})),o.push(pe({x:h(y.box.x+y.box.width/2),y:h(y.box.y+y.box.height/2+3),...xS(y.style,i,us.xs),"text-anchor":"middle"},y.text))}return Y("g",{"data-layer":"item","data-id":e.id??null},o.join(""))}function uU(e,t,n,r,i,o){let s=[];if(!(e.kind==="group"&&e.waveOnly)){let c=e.box.y+e.headerHeight,l=e.box.height-e.headerHeight;if(e.style.bg!=="none"){let f=t<=ry;s.push(Y("rect",{x:h(e.box.x),y:h(c),width:h(e.box.width),height:h(l),fill:f?e.style.bg:"none","fill-opacity":f?t===1?ty:ny:null,stroke:f?null:e.style.bg,"stroke-opacity":f?null:.6,"stroke-width":f?null:1}))}let u=e.kind==="group"?e.style.fg:i.parallel.bracketStroke;if(e.headerHeight>0&&e.style.bracket!=="none"){let f=e.box.y+fl,d=e.box.x,p=e.box.x+e.box.width;s.push(Y("path",{d:`M${h(d)} ${h(c)} V${h(f)} H${h(p)} V${h(c)}`,fill:"none",stroke:u,"stroke-width":1.2,"stroke-dasharray":e.style.bracket==="dashed"?"3 2":null}))}e.title&&e.headerHeight>0&&s.push(pe({x:h(ps(e.box.x,eU(e.inlineDatePins))),y:h(e.box.y+ey),...xS(e.style,o,ed),"font-weight":600,fill:u},e.title)),s.push(TS(e.inlineDatePins,e.style.fg))}for(let c of e.children)s.push(AS(c,n,r,i,o,t));return Y("g",{"data-layer":e.kind,"data-id":e.id??null},s.join(""))}function AS(e,t,n,r,i,o=0){return e.kind==="item"?cU(e,t,n,r,i):uU(e,o+1,t,n,r,i)}var mS=2;function fU(e,t){switch(e){case"green":return t.swimlane.utilizationOk;case"yellow":return t.swimlane.utilizationWarn;case"red":return t.swimlane.utilizationOver}}function dU(e,t){if(!e.utilization||e.utilization.segments.length===0)return"";let n=e.box.y+e.box.height-mS,r=e.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":Y("rect",{x:h(i.startX),y:h(n),width:h(o),height:mS,fill:fU(i.classification,t),"data-utilization":i.classification,"data-load":h(i.load)})});return Y("g",{"data-layer":"lane-utilization","data-id":e.id??null},r.join(""))}function pU(e,t){let n=e.bandIndex%2===0?t.swimlane.rowTintEven:t.swimlane.rowTintOdd,r=t.swimlane.border;return Y("g",{"data-layer":"swimlane-bg","data-id":e.id??null},Y("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),fill:n,stroke:r,"stroke-width":1}))}function kS(e,t,n,r,i){let o=r.swimlane.tabFill,s=r.swimlane.tabStroke,a=r.swimlane.tabText,c=r.swimlane.ownerText,l=r.swimlane.footnoteIndicator,u=[];if(e.title){let d=e.capacity?Ei(e.capacity.text,e.capacity.icon,10):0,p=e.footnoteIndicators.length>0?e.footnoteIndicators.join(","):"",m=p?gp(p,10):0,g=dl(e.box.x,e.title,e.owner,d,m),w=Bf,E=e.box.y+10,y=E+Wf;u.push(Y("rect",{x:h(g.tabX),y:h(E),width:h(g.tabW),height:h(w),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(pe({x:h(g.titleX),y:h(y),"font-family":i[e.style.font],"font-size":12,"font-weight":600,fill:a},e.title)),e.owner&&u.push(pe({x:h(g.ownerX),y:h(y),"font-family":i[e.style.font],"font-size":10,fill:c},`owner: ${e.owner}`)),e.capacity&&u.push(wS(e.capacity,void 0,g.badgeX,y,10,i[e.style.font],c)),p&&u.push(pe({x:h(g.footnoteRightX),y:h(E+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:l,"text-anchor":"end"},p))}for(let f of e.children)u.push(AS(f,t,n,r,i));return u.push(dU(e,r)),Y("g",{"data-layer":"swimlane","data-id":e.id??null},u.join(""))}function IS(e,t,n){let r=e.radius,i=e.center.x,o=e.center.y,s=t.anchorDiamond.fill,a=t.anchorDiamond.stroke,c=Y("path",{d:`M${h(i)} ${h(o-r)} L${h(i+r)} ${h(o)} L${h(i)} ${h(o+r)} L${h(i-r)} ${h(o)} Z`,fill:s,stroke:a,"stroke-width":1.25}),l=t.anchorDiamond.label,u=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,f={x:h(u),y:h(o+4),"font-family":n.sans,"font-size":10,fill:l};e.labelSide==="left"&&(f["text-anchor"]="end");let d=e.title?pe(f,e.title):"";return Y("g",{"data-layer":"anchor","data-id":e.id??null},SS(e.hiddenDate)+c+d)}function RS(e,t){let n=t.anchorDiamond.cutLine;return Y("line",{x1:h(e.center.x),y1:h(e.center.y+e.radius+1),x2:h(e.center.x),y2:h(e.cutBottomY),stroke:n,"stroke-width":1,"stroke-dasharray":"1 3"})}function bS(e,t,n){let r=e.center.x,i=e.center.y,o=e.radius,s=t.milestoneDiamond.fill,a=Y("path",{d:`M${h(r)} ${h(i-o)} L${h(r+o)} ${h(i)} L${h(r)} ${h(i+o)} L${h(r-o)} ${h(i)} Z`,fill:s,stroke:s,"stroke-width":1}),c=t.milestoneDiamond.label,l=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,u={x:h(l),y:h(i+4),"font-family":n.sans,"font-size":10,"font-weight":600,fill:c};e.labelSide==="left"&&(u["text-anchor"]="end");let f=e.title?pe(u,e.title):"";return Y("g",{"data-layer":"milestone","data-id":e.id??null},SS(e.hiddenDate)+a+f)}function SS(e){return e===void 0?"":`<title>${tt(e)}</title>`}function NS(e,t,n){let r=e.isOverrun?n.milestoneDiamond.cutLineOverrun:n.milestoneDiamond.cutLineNormal,i=[];if(e.onWaveBoundary||i.push(Y("line",{x1:h(e.center.x),y1:h(e.center.y+e.radius+1),x2:h(e.center.x),y2:h(e.cutBottomY),stroke:r,"stroke-width":2,"stroke-dasharray":Uf,"stroke-linecap":"round"})),e.slackArrows&&e.slackArrows.length>0){let o=n.milestoneDiamond.slack;for(let s of e.slackArrows)i.push(Y("path",{d:`M${h(s.x)} ${h(s.y)} H${h(e.center.x-6)}`,fill:"none",stroke:o,"stroke-width":1.1,"stroke-dasharray":"3 3","stroke-linecap":"round","marker-end":`url(#${t}-arrow-dark)`}))}return i.join("")}var hU="3 3";function LS(e,t){let n=e.waypoints;if(n.length<2)return"";let r=t.dependency.edgeStroke,i=n[n.length-1],o=n[n.length-2],s=Math.hypot(i.x-o.x,i.y-o.y);if(s===0)return"";let a=(i.x-o.x)/s,c=(i.y-o.y)/s,l=e.headWidth/2,u=e.head==="dot"?l:e.headWidth*5/7,f=s>u?[...n.slice(0,-1),{x:i.x-a*u,y:i.y-c*u}]:n.slice(0,-1),d=[mU(f,e.slack,r)],p=t.arrowhead.neutral;if(e.head==="dot")d.push(Y("circle",{cx:h(i.x-a*l),cy:h(i.y-c*l),r:h(l),fill:p}));else{let m=i.x-a*u,g=i.y-c*u;d.push(Y("path",{d:`M${h(m-c*l)} ${h(g+a*l)} L${h(i.x)} ${h(i.y)} L${h(m+c*l)} ${h(g-a*l)} z`,fill:p}))}return Y("g",{"data-layer":"dependency"},d.join(""))}function mU(e,t,n){if(e.length<2)return"";let r={fill:"none",stroke:n,"stroke-width":1.1,"stroke-linejoin":"round"};if(!t)return Y("path",{d:yU(e,Yf),...r});let{solid:i,dotted:o}=gU(e,Yf);return(i?Y("path",{d:i,...r}):"")+(o?Y("path",{d:o,...r,"stroke-dasharray":hU,"stroke-linecap":"round"}):"")}function gU(e,t){let n=e.length,r=[],i=[],o=[];for(let a=1;a<n-1;a++){let c=e[a-1],l=e[a],u=e[a+1],f=Math.hypot(l.x-c.x,l.y-c.y),d=Math.hypot(u.x-l.x,u.y-l.y),p=Math.min(t,f/2,d/2),m={x:Math.sign(l.x-c.x),y:Math.sign(l.y-c.y)},g={x:Math.sign(u.x-l.x),y:Math.sign(u.y-l.y)};r[a]={x:l.x-m.x*p,y:l.y-m.y*p},i[a]={x:l.x+g.x*p,y:l.y+g.y*p},p>0&&o.push(`M${h(r[a].x)} ${h(r[a].y)} Q${h(l.x)} ${h(l.y)} ${h(i[a].x)} ${h(i[a].y)}`)}let s=[];for(let a=0;a<n-1;a++){let c=a===0?e[0]:i[a],l=a===n-2?e[n-1]:r[a+1],u=`M${h(c.x)} ${h(c.y)} L${h(l.x)} ${h(l.y)}`;Math.abs(e[a+1].y-e[a].y)<1e-9?s.push(u):o.push(u)}return{solid:o.join(" "),dotted:s.join(" ")}}function yU(e,t){if(e.length<2)return"";let n=[`M${h(e[0].x)} ${h(e[0].y)}`];for(let r=1;r<e.length;r++){let i=e[r-1],o=e[r];if(r===e.length-1){n.push(`L${h(o.x)} ${h(o.y)}`);continue}let s=e[r+1],a=Math.sign(o.x-i.x),c=Math.sign(o.y-i.y),l=Math.sign(s.x-o.x),u=Math.sign(s.y-o.y),f=Math.hypot(o.x-i.x,o.y-i.y),d=Math.hypot(s.x-o.x,s.y-o.y),p=Math.min(t,f/2,d/2);if(p<=0||a!==0&&l!==0||c!==0&&u!==0){n.push(`L${h(o.x)} ${h(o.y)}`);continue}let m={x:o.x-a*p,y:o.y-c*p},g={x:o.x+l*p,y:o.y+u*p};n.push(`L${h(m.x)} ${h(m.y)}`),n.push(`Q${h(o.x)} ${h(o.y)} ${h(g.x)} ${h(g.y)}`)}return n.join(" ")}function xU(e,t,n,r){if(e.entries.length===0)return"";let i=n.footnotePanel.fill,o=n.footnotePanel.border,s=n.footnotePanel.header,a=n.footnotePanel.title,c=n.footnotePanel.description,l=n.footnotePanel.number,u=[];u.push(Y("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),rx:6,ry:6,fill:i,stroke:o,"stroke-width":1,filter:`url(#${t}-shadow-subtle)`})),u.push(pe({x:h(e.box.x+Ft),y:h(e.box.y+Fg),"font-family":r.sans,"font-size":12,"font-weight":700,fill:s},"Footnotes"));let f=e.box.x+Ft;for(let d of e.entries){d.region!==void 0&&d.regionHeadingY!==void 0&&u.push(pe({x:h(f),y:h(d.regionHeadingY),"font-family":r.sans,"font-size":10,"font-weight":700,fill:s},d.region)),u.push(pe({x:h(f),y:h(d.y),"font-family":r.sans,"font-size":10,"font-weight":700,fill:l},String(d.number)));for(let p of d.titleLines)u.push(pe({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,"font-weight":600,fill:a},p.text));for(let p of d.descriptionLines??[])u.push(pe({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,fill:c},p.text))}return Y("g",{"data-layer":"footnotes"},u.join(""))}function EU(e,t,n,r,i,o){let s=r.includeRegion.border,a=r.includeRegion.fill,c=r.includeRegion.tabFill,l=r.includeRegion.tabStroke,u=r.includeRegion.tabText,f=r.includeRegion.badgeFill,d=r.includeRegion.badgeStroke,p=r.includeRegion.badgeText,m=e.box.x+8,g=e.box.y,w=e.box.width-16,E=e.box.height,y=Y("rect",{x:h(m),y:h(g),width:h(w),height:h(E),rx:8,ry:8,fill:a,stroke:s,"stroke-width":1,"stroke-dasharray":Uf}),x=Bf,T=pl(e.box.x,e.label,e.sourcePath),v=g-x/2,k=Y("rect",{x:h(T.tabX),y:h(v),width:h(T.tabWidth),height:x,rx:4,ry:4,fill:c,stroke:l,"stroke-width":1}),C=pe({x:h(T.tabLabelX),y:h(v+Wf),"font-family":i.sans,"font-size":11,"font-weight":600,fill:u},e.label),$=T.badgeX,O=T.badgeSize,H=g-O/2,P=Y("rect",{x:h($),y:h(H),width:O,height:O,rx:4,ry:4,fill:f,stroke:d,"stroke-width":1}),R=Y("path",{d:`M${h($+7)} ${h(H+4)} H${h($+14)} V${h(H+11)} M${h($+4)} ${h(H+7)} H${h($+11)} V${h(H+14)} H${h($+4)} Z`,stroke:p,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),b=9,M=g+4,_=Y("rect",{x:h(T.sourceHaloX),y:h(M-b),width:h(T.sourceHaloWidth),height:b+6,fill:a}),S=pe({x:h(T.sourceTextX),y:h(M),"font-family":i.mono,"font-size":b,fill:p},e.sourcePath),L={x:m,y:g,width:w,height:E},F=o?vS(o.timeline,o.chartBox.y,r,L):"",N=o?.waves?OS(o.waves,L)+DS(o.waveBoundaries,L):"",W=o?.waves?MS(e.waveCrossings):"",G=e.nestedSwimlanes.map(A=>kS(A,t,n,r,i)).join(""),X=(e.edges??[]).map(A=>LS(A,r)).join(""),Q=e.anchors??[],j=e.milestones??[],ne=Q.map(A=>RS(A,r)).join("")+j.map(A=>NS(A,n,r)).join("")+Q.map(A=>IS(A,r,i)).join("")+j.map(A=>bS(A,r,i)).join("");return Y("g",{"data-layer":"include"},y+F+N+X+G+W+ne+k+C+P+R+_+S)}function wU(e,t){let n=e.palette.attribution.mark,r=e.palette.attribution.link;if(e.swimlanes.length===0)return"";let i=e.header.attributionBox.x,o=e.header.attributionBox.y,s=Cr,a=pe({x:"0",y:s,"font-family":t.sans,"font-size":Hf,"font-weight":400,fill:n},zf)+pe({x:ll,y:s,"font-family":t.sans,"font-size":Cr,"font-weight":700,fill:n},"now")+Y("rect",{x:Wg,y:12,width:Ug,height:Cr,fill:r})+pe({x:jf,y:s,"font-family":t.sans,"font-size":Cr,"font-weight":400,fill:n},"ine"),c=Y("g",{transform:`translate(${h(i)} ${h(o)}) scale(${h(al)})`},a);return Y("a",{href:Bg,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},Y("g",{"data-layer":"attribution"},c))}async function TU(e,t,n,r){let i=e.assetRef??"",{x:o,y:s,width:a,height:c}=e.box,l;try{if(r.logo&&r.logo.ref===i)l=r.logo.asset;else if(t)l=await t(i);else return""}catch(d){let p=`logo file not found: ${i} (${d instanceof Error?d.message:String(d)})`;if(r.strict)throw d;return r.warn?.(p),""}let u=(l.mime??"").toLowerCase();if(u==="image/svg+xml"){let d=new TextDecoder().decode(l.bytes),p=e.intrinsic??dp(d)??{width:a,height:c},m=new Set,g=iS(d,{idPrefix:`${n}-logo`,onWarn:w=>m.add(w.replace(/^sanitizer: dropping /,"")),stripRootSize:!0});return m.size>0&&r.warn?.(`logo ${i}: removed unsupported SVG content: ${[...m].join(", ")}`),Y("svg",{"data-layer":"logo",x:h(o),y:h(s),width:h(a),height:h(c),viewBox:`0 0 ${h(p.width)} ${h(p.height)}`,preserveAspectRatio:"xMidYMid meet",overflow:"hidden"},g)}if(u==="image/png"||u==="image/jpeg"||u==="image/jpg"||u==="image/webp"){let d=vU(l.bytes);return Y("image",{"data-layer":"logo",href:`data:${u};base64,${d}`,x:h(o),y:h(s),width:h(a),height:h(c),preserveAspectRatio:"xMidYMid meet"})}let f=`unsupported logo format: ${u} (${i})`;if(r.strict)throw new Error(f);return r.warn?.(f),""}function vU(e){if(typeof btoa<"u"){let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}let t=globalThis;if(t.Buffer)return t.Buffer.from(e).toString("base64");throw new Error("renderer: no base64 encoder available")}var _U=.24,hp=2,gS=3,AU=4,kU=8,IU=10;function PS(e){return e.bg==="none"?"transparent":e.bg}function yp(e){return ES(e)>=_U?"dark":"light"}function $S(e,t){return`url(#${e}-wave-hatch-${t})`}function RU(e,t,n){let r=Vg;return Y("pattern",{id:`${e}-wave-hatch-${t}`,width:r,height:r,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)"},Y("line",{x1:h(r/2),y1:0,x2:h(r/2),y2:r,stroke:t==="dark"?n.wave.hatch:n.wave.hatchOnDark,"stroke-width":Kg,opacity:Yg}))}function bU(e){if(!e.waves)return[];let t=new Set,n=i=>{for(let o of i)o.kind==="item"?o.waveRole==="background"&&t.add(yp(PS(o.style))):n(o.children)},r=i=>{for(let o of i)n(o.children),r(o.nested)};r(e.swimlanes);for(let i of e.includes)r(i.nestedSwimlanes);return e.waveLegend?.entries.some(i=>i.kind==="background")&&t.add(yp(FS(e.palette))),["dark","light"].filter(i=>t.has(i))}function SU(e,t,n){let i=Math.min(rl[t.cornerRadius]??4,e.height/2);return Y("rect",{x:h(e.x+.5),y:h(e.y+.5),width:h(Math.max(0,e.width-2*.5)),height:h(Math.max(0,e.height-2*.5)),rx:h(i),ry:h(i),fill:$S(n,yp(PS(t)))})}function bx(e,t){let n=Math.max(e.x,t.x),r=Math.max(e.y,t.y),i=Math.min(e.x+e.width,t.x+t.width),o=Math.min(e.y+e.height,t.y+t.height);if(!(i<=n||o<=r))return{x:n,y:r,width:i-n,height:o-r}}var Ix=4,mp=.5;function CS(e,t){if(e.empty)return;let n=mp;return bx({x:e.strip.box.x,y:e.strip.box.y+n,width:e.strip.box.width,height:e.strip.box.height-2*n},{x:t.box.x+n,y:e.strip.box.y,width:t.box.width-2*n,height:e.strip.box.height})}function NU(e,t){let n=Math.min(Ix-mp,e.width/2,e.height/2),r=1e-6;return{left:e.x<=t.box.x+mp+r?n:0,right:e.x+e.width>=t.box.x+t.box.width-mp-r?n:0}}function LU(e,t){let{x:n,y:r,width:i,height:o}=e,s=(a,c,l)=>a>0?` A${h(a)} ${h(a)} 0 0 1 ${h(c)} ${h(l)}`:"";return`M${h(n+t.left)} ${h(r)} H${h(n+i-t.right)}`+s(t.right,n+i,r+t.right)+` V${h(r+o-t.right)}`+s(t.right,n+i-t.right,r+o)+` H${h(n+t.left)}`+s(t.left,n,r+o-t.left)+` V${h(r+t.left)}`+s(t.left,n+t.left,r)+" Z"}function Rx(e,t,n){let r=o=>n&&(n.left>0||n.right>0)?Y("path",{d:LU(t,n),...o}):Y("rect",{x:h(t.x),y:h(t.y),width:h(t.width),height:h(t.height),...o}),i=r({fill:e.style.stripFill});return e.style.tint?i+r({fill:e.style.tint,"fill-opacity":cl}):i}function PU(e,t){let n=e.timeline,r=n.waveStrip;if(!e.waves||!r)return"";let i=[Y("rect",{x:h(n.box.x),y:h(r.y),width:h(n.box.width),height:h(r.height),rx:Ix,ry:Ix,fill:t.timeline.panelFill,stroke:t.timeline.border,"stroke-width":1})];for(let o of e.waves){let s=CS(o,n);s&&i.push(Y("g",{"data-id":o.id},`<title>${tt(o.strip.tooltip)}</title>${Rx(o,s,NU(s,n))}`))}return Y("g",{"data-layer":"wave-strip"},i.join(""))}function OS(e,t){let n=[];for(let r of e){if(!r.style.tint||r.empty)continue;let i=t?bx(r.columnBox,t):r.columnBox;!i||i.width<=0||i.height<=0||n.push(Y("rect",{x:h(i.x),y:h(i.y),width:h(i.width),height:h(i.height),fill:r.style.tint,"fill-opacity":qg}))}return n.length===0?"":Y("g",{"data-layer":"wave-bg"},n.join(""))}function DS(e,t){let n=[];for(let r of e??[]){let i=r.topY,o=r.bottomY;t&&(r.x<=t.x||r.x>=t.x+t.width||(i=Math.max(i,t.y),o=Math.min(o,t.y+t.height),o<=i))||n.push(Y("line",{x1:h(r.x),y1:h(i),x2:h(r.x),y2:h(o),stroke:r.stroke,"stroke-width":Vf,"stroke-dasharray":r.dash}))}return n.length===0?"":Y("g",{"data-layer":"wave-boundary"},n.join(""))}function yS(e,t){let n=gp(e,mn);return t?n*1.05:n}function $U(e,t,n){let r=e.timeline,i=r.waveStrip;if(!e.waves||!i)return"";let o=i.y+i.height/2+AU,s=i.y+gS,a=i.height-2*gS,c=[],l=(u,f)=>{let d=yS(f,!1)+2*hp;return Y("rect",{x:h(u-d/2),y:h(s),width:h(d),height:h(a),fill:t.timeline.panelFill})+pe({x:h(u),y:h(o),"font-family":n.sans,"font-size":mn,"font-style":"italic",fill:t.wave.labelMuted,"text-anchor":"middle"},f)};i.placeholder!==void 0&&c.push(l(r.box.x+r.box.width/2,i.placeholder));for(let u of e.waves){if(u.strip.gapLabel){let{text:m,x:g}=u.strip.gapLabel;c.push(l(g,m))}if(u.strip.marker){let{x:m,y:g}=u.strip.marker,w=Zg/2;c.push(Y("path",{d:`M${h(m)} ${h(g-w)} L${h(m+w)} ${h(g)} L${h(m)} ${h(g+w)} L${h(m-w)} ${h(g)} Z`,fill:t.timeline.panelFill,stroke:t.wave.boundary,"stroke-width":1.5},`<title>${tt(u.strip.tooltip)}</title>`))}let f=CS(u,r);if(!f)continue;let d=f.x+f.width,p=u.strip.footnotesShown?u.footnoteIndicators.length*Zt:0;if(p){let m=d-Wn+hp,g=d-Wn-p-hp;c.push(Rx(u,{x:g,y:s,width:m-g,height:a}))}if(u.strip.label!==void 0){let m=yS(u.strip.label,!0),g=p?Math.min(u.strip.labelX,d-Wn-p-m/2):u.strip.labelX,w=m+2*hp;c.push(Rx(u,{x:g-w/2,y:s,width:w,height:a})),c.push(pe({x:h(g),y:h(o),"font-family":n.sans,"font-size":mn,"font-weight":600,fill:u.style.text,"text-anchor":"middle"},u.strip.label))}if(u.strip.footnotesShown){let m=d-Wn;for(let g=u.footnoteIndicators.length-1;g>=0;g--)c.push(pe({x:h(m),y:h(i.y+IU),"font-family":n.sans,"font-size":kU,"font-weight":700,fill:u.style.text,"text-anchor":"end"},String(u.footnoteIndicators[g]))),m-=Zt}}return c.length===0?"":Y("g",{"data-layer":"wave-labels"},c.join(""))}function MS(e){if(!e||e.length===0)return"";let t=e.map(n=>Y("line",{x1:h(n.x),y1:h(n.topY),x2:h(n.x),y2:h(n.bottomY),stroke:n.stroke,"stroke-width":1,"stroke-dasharray":jg}));return Y("g",{"data-layer":"wave-cross"},t.join(""))}function FS(e){let t=e.entities.item.bg;return t==="none"?"transparent":t}function CU(e,t,n,r){if(!e)return"";let i=[];for(let o of e.entries){let s=o.swatch;if(s&&o.kind==="background"){let a=FS(n),c={x:h(s.x),y:h(s.y),width:h(s.width),height:h(s.height)};i.push(Y("rect",{...c,rx:2,ry:2,fill:a,stroke:n.entities.item.fg,"stroke-width":1})),i.push(Y("rect",{x:h(s.x+.5),y:h(s.y+.5),width:h(s.width-1),height:h(s.height-1),rx:2,ry:2,fill:$S(t,yp(a))}))}else if(s&&o.kind==="boundary"){let a=s.x+s.width/2;i.push(Y("line",{x1:h(a),y1:h(s.y),x2:h(a),y2:h(s.y+s.height),stroke:n.wave.boundary,"stroke-width":Vf}))}for(let a of o.runs)i.push(pe({x:h(a.x),y:h(a.y),"font-family":r.sans,"font-size":mn,fill:n.wave.labelText},a.text))}return Y("g",{"data-layer":"wave-legend"},i.join(""))}async function Sx(e,t={}){let r=new pp(t.idPrefix??"nl").next("root"),i=e.palette,o=t.fontFamilies??Gg,s=[],a=(u,f)=>`<marker id="${u}" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" fill="${f}"/></marker>`,c=`<defs>${dS(r)}`+a(`${r}-arrow-dark`,i.arrowhead.dark)+bU(e).map(u=>RU(r,u,i)).join("")+"</defs>";s.push(c),s.push(Y("rect",{x:0,y:0,width:h(e.width),height:h(e.height),fill:e.backgroundColor})),s.push(oU(e.timeline,i,o)),s.push(PU(e,i));for(let u of e.swimlanes)s.push(pU(u,i));s.push(vS(e.timeline,e.chartBox.y,i)),e.waves&&s.push(OS(e.waves)),s.push(rU(e.timeline,e.chartBox.y,i)),s.push(DS(e.waveBoundaries)),s.push($U(e,i,o));for(let u of e.edges)s.push(LS(u,i));for(let u of e.swimlanes)s.push(kS(u,t,r,i,o));for(let u of e.includes)s.push(EU(u,t,r,i,o,e));s.push(MS(e.waveCrossings));for(let u of e.anchors)s.push(RS(u,i));for(let u of e.milestones)s.push(NS(u,r,i));s.push(iU(e.timeline,i,o));for(let u of e.anchors)s.push(IS(u,i,o));for(let u of e.milestones)s.push(bS(u,i,o));if(s.push(sU(e.nowline,i,o)),s.push(xU(e.footnotes,r,i,o)),s.push(CU(e.waveLegend,r,i,o)),s.push(nU(e.header,r,i,o)),s.push(wU(e,o)),e.header.logo&&(t.logo||t.assetResolver)){let u=await TU(e.header.logo,t.assetResolver,r,t);u&&s.push(u)}return`<svg${Ls({xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${h(e.width)} ${h(e.height)}`,width:h(e.width),height:h(e.height),"data-theme":e.theme,"data-generator":"nowline"})}>${s.join("")}</svg>`}var Nx="/browser-source.nowline",OU={error:3,warning:2,info:1},DU={error:3,warning:2,info:1};function BS(e,t){return OU[e]>=DU[t]}var xp,WS=0;function US(){return xp||(xp=Sy()),xp}function MU(){return Ce.parse(`memory:///nowline-browser-${++WS}.nowline`)}async function Lx(e,t={}){let n=t.filePath??Nx,r=US(),o=r.shared.workspace.LangiumDocumentFactory.fromString(e,MU());return await r.shared.workspace.DocumentBuilder.build([o],{validation:!0}),{ast:o.parseResult.value,diagnostics:XS(o,n)}}function XS(e,t){return GS(Ii(e),t)}function GS(e,t){return e.map(n=>n.origin==="lexer"?vx(n.error,t):n.origin==="parser"?Tx(n.error,t):jb(n.diagnostic,t))}async function Px(e,t={}){let n=t.filePath??Nx,r=US(),i,o;if(t.timezone)try{i=Ex(t.timezone)}catch(x){if(!(x instanceof Di))throw x;o=x}let s=o?void 0:wx({now:t.today,zone:i}),a=await kx({source:e,sourcePath:n,services:r,readSource:t.readFile??Zb,assetResolver:t.assetResolver,isToleratedIncludeError:x=>_x(x.message),layout:{theme:t.theme,today:s,locale:t.locale,width:t.width,nonWorking:t.nonWorking}});if(a.kind==="invalid")return{kind:"diagnostics",diagnostics:GS(a.diagnostics,n)};let c=a.kind==="include-error"&&a.legacy!==void 0,l=XS(a.document,n);for(let x of a.resolved.diagnostics){if(x.severity==="error"&&_x(x.message)){t.onSkippedInclude?.({sourcePath:x.sourcePath,message:x.message});continue}c&&Dr(x)||l.push(Yb(x))}if(a.kind==="include-error"||l.some(x=>x.severity==="error"))return{kind:"diagnostics",diagnostics:l};if(o)return{kind:"diagnostics",diagnostics:[{severity:"error",code:"invalid-timezone",message:o.message,file:n,line:1,column:1}]};let u=[...a.warnings],{logo:f,model:d}=a,p=t.diagnosticLevel??"error",m=xx(d,{today:s??void 0,locale:t.locale??"en-US"}).map(x=>Kb(x,n)),g=t.showLinks!==!1,w=t.strict===!0,E=await Sx(d,{idPrefix:t.idPrefix,assetResolver:t.assetResolver,logo:f,noLinks:!g,strict:w,warn:x=>u.push(x),fontFamilies:t.fontFamilies}),y=[...m,...u.map(x=>Vb(x,n,w?"error":"warning"))].filter(x=>BS(x.severity,p));return w&&y.length>0?{kind:"diagnostics",diagnostics:[...l,...y]}:{kind:"svg",svg:E,warnings:y}}function $x(){xp=void 0,WS=0}var zS="/embed.nowline",Cx=!1;async function HS(e){let{ast:t,diagnostics:n}=await Lx(e,{filePath:zS});return{ast:t,errors:n.filter(r=>r.severity==="error").map(r=>r.message)}}async function Ep(e,t={}){let n={filePath:zS,theme:t.theme,today:t.today,timezone:t.timezone,locale:t.locale,width:t.width,nonWorking:t.nonWorking,idPrefix:t.idPrefix,onSkippedInclude:()=>{Cx||(Cx=!0,console.warn("nowline: `include` directives are skipped in the browser embed (single-file mode). Render multi-file roadmaps with the CLI or the GitHub Action."))}},r=await Px(e,n);if(r.kind==="svg")return r.svg;let i=r.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Ol(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Ol=class extends Error{constructor(n,r){super(n);B(this,"details",r);this.name="EmbedRenderError"}};function jS(){Cx=!1,$x()}var nn=Uint8Array,Lt=Uint16Array,Bx=Int32Array,Wx=new nn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ux=new nn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),YS=new nn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ZS=function(e,t){for(var n=new Lt(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Bx(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},JS=ZS(Wx,2),FU=JS.b,Dx=JS.r;FU[28]=258,Dx[258]=28;var QS=ZS(Ux,0),Wse=QS.b,VS=QS.r,Mx=new Lt(32768);for(xe=0;xe<32768;++xe)Kn=(xe&43690)>>1|(xe&21845)<<1,Kn=(Kn&52428)>>2|(Kn&13107)<<2,Kn=(Kn&61680)>>4|(Kn&3855)<<4,Mx[xe]=((Kn&65280)>>8|(Kn&255)<<8)>>1;var Kn,xe,Fl=(function(e,t,n){for(var r=e.length,i=0,o=new Lt(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new Lt(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new Lt(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],f=s[e[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[Mx[f]>>c]=l}else for(a=new Lt(r),i=0;i<r;++i)e[i]&&(a[i]=Mx[s[e[i]-1]++]>>15-e[i]);return a}),Mi=new nn(288);for(xe=0;xe<144;++xe)Mi[xe]=8;var xe;for(xe=144;xe<256;++xe)Mi[xe]=9;var xe;for(xe=256;xe<280;++xe)Mi[xe]=7;var xe;for(xe=280;xe<288;++xe)Mi[xe]=8;var xe,wp=new nn(32);for(xe=0;xe<32;++xe)wp[xe]=5;var xe,BU=Fl(Mi,9,0);var WU=Fl(wp,5,0);var eN=function(e){return(e+7)/8|0},UU=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new nn(e.subarray(t,n))};var qn=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Dl=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},Ox=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return{t:nN,l:0};if(i==1){var s=new nn(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(v,k){return v.f-k.f}),n.push({s:-1,f:25001});var a=n[0],c=n[1],l=0,u=1,f=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=i-1;)a=n[n[l].f<n[f].f?l++:f++],c=n[l!=u&&n[l].f<n[f].f?l++:f++],n[u++]={s:-1,f:a.f+c.f,l:a,r:c};for(var d=o[0].s,r=1;r<i;++r)o[r].s>d&&(d=o[r].s);var p=new Lt(d+1),m=Fx(n[u-1],p,0);if(m>t){var r=0,g=0,w=m-t,E=1<<w;for(o.sort(function(k,C){return p[C.s]-p[k.s]||k.f-C.f});r<i;++r){var y=o[r].s;if(p[y]>t)g+=E-(1<<m-p[y]),p[y]=t;else break}for(g>>=w;g>0;){var x=o[r].s;p[x]<t?g-=1<<t-p[x]++-1:++r}for(;r>=0&&g;--r){var T=o[r].s;p[T]==t&&(--p[T],++g)}m=t}return{t:new nn(p),l:m}},Fx=function(e,t,n){return e.s==-1?Math.max(Fx(e.l,t,n+1),Fx(e.r,t,n+1)):t[e.s]=n},KS=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Lt(++t),r=0,i=e[0],o=1,s=function(c){n[r++]=c},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return{c:n.subarray(0,r),n:t}},Ml=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},tN=function(e,t,n){var r=n.length,i=eN(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var o=0;o<r;++o)e[i+o+4]=n[o];return(i+4+r)*8},qS=function(e,t,n,r,i,o,s,a,c,l,u){qn(t,u++,n),++i[256];for(var f=Ox(i,15),d=f.t,p=f.l,m=Ox(o,15),g=m.t,w=m.l,E=KS(d),y=E.c,x=E.n,T=KS(g),v=T.c,k=T.n,C=new Lt(19),$=0;$<y.length;++$)++C[y[$]&31];for(var $=0;$<v.length;++$)++C[v[$]&31];for(var O=Ox(C,7),H=O.t,P=O.l,R=19;R>4&&!H[YS[R-1]];--R);var b=l+5<<3,M=Ml(i,Mi)+Ml(o,wp)+s,_=Ml(i,d)+Ml(o,g)+s+14+3*R+Ml(C,H)+2*C[16]+3*C[17]+7*C[18];if(c>=0&&b<=M&&b<=_)return tN(t,u,e.subarray(c,c+l));var S,L,F,N;if(qn(t,u,1+(_<M)),u+=2,_<M){S=Fl(d,p,0),L=d,F=Fl(g,w,0),N=g;var W=Fl(H,P,0);qn(t,u,x-257),qn(t,u+5,k-1),qn(t,u+10,R-4),u+=14;for(var $=0;$<R;++$)qn(t,u+3*$,H[YS[$]]);u+=3*R;for(var G=[y,v],X=0;X<2;++X)for(var Q=G[X],$=0;$<Q.length;++$){var j=Q[$]&31;qn(t,u,W[j]),u+=H[j],j>15&&(qn(t,u,Q[$]>>5&127),u+=Q[$]>>12)}}else S=BU,L=Mi,F=WU,N=wp;for(var $=0;$<a;++$){var ne=r[$];if(ne>255){var j=ne>>18&31;Dl(t,u,S[j+257]),u+=L[j+257],j>7&&(qn(t,u,ne>>23&31),u+=Wx[j]);var A=ne&31;Dl(t,u,F[A]),u+=N[A],A>3&&(Dl(t,u,ne>>5&8191),u+=Ux[A])}else Dl(t,u,S[ne]),u+=L[ne]}return Dl(t,u,S[256]),u+L[256]},XU=new Bx([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nN=new nn(0),GU=function(e,t,n,r,i,o){var s=o.z||e.length,a=new nn(r+s+5*(1+Math.ceil(s/7e3))+i),c=a.subarray(r,a.length-i),l=o.l,u=(o.r||0)&7;if(t){u&&(c[0]=o.r>>3);for(var f=XU[t-1],d=f>>13,p=f&8191,m=(1<<n)-1,g=o.p||new Lt(32768),w=o.h||new Lt(m+1),E=Math.ceil(n/3),y=2*E,x=function(ge){return(e[ge]^e[ge+1]<<E^e[ge+2]<<y)&m},T=new Bx(25e3),v=new Lt(288),k=new Lt(32),C=0,$=0,O=o.i||0,H=0,P=o.w||0,R=0;O+2<s;++O){var b=x(O),M=O&32767,_=w[b];if(g[M]=_,w[b]=M,P<=O){var S=s-O;if((C>7e3||H>24576)&&(S>423||!l)){u=qS(e,c,0,T,v,k,$,H,R,O-R,u),H=C=$=0,R=O;for(var L=0;L<286;++L)v[L]=0;for(var L=0;L<30;++L)k[L]=0}var F=2,N=0,W=p,G=M-_&32767;if(S>2&&b==x(O-G))for(var X=Math.min(d,S)-1,Q=Math.min(32767,O),j=Math.min(258,S);G<=Q&&--W&&M!=_;){if(e[O+F]==e[O+F-G]){for(var ne=0;ne<j&&e[O+ne]==e[O+ne-G];++ne);if(ne>F){if(F=ne,N=G,ne>X)break;for(var A=Math.min(G,ne-2),D=0,L=0;L<A;++L){var U=O-G+L&32767,z=g[U],J=U-z&32767;J>D&&(D=J,_=U)}}}M=_,_=g[M],G+=M-_&32767}if(N){T[H++]=268435456|Dx[F]<<18|VS[N];var Z=Dx[F]&31,ee=VS[N]&31;$+=Wx[Z]+Ux[ee],++v[257+Z],++k[ee],P=O+F,++C}else T[H++]=e[O],++v[e[O]]}}for(O=Math.max(O,P);O<s;++O)T[H++]=e[O],++v[e[O]];u=qS(e,c,l,T,v,k,$,H,R,O-R,u),l||(o.r=u&7|c[u/8|0]<<3,u-=7,o.h=w,o.p=g,o.i=O,o.w=P)}else{for(var O=o.w||0;O<s+l;O+=65535){var oe=O+65535;oe>=s&&(c[u/8|0]=l,oe=s),u=tN(c,u+1,e.subarray(O,oe))}o.i=s}return UU(a,0,r+eN(u)+i)};var rN=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,o=n.length|0,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=r+=n[s];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}e=r,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},zU=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new nn(o.length+e.length);s.set(o),s.set(e,o.length),e=s,i.w=o.length}return GU(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)};var iN=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};var HU=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=rN();i.p(t.dictionary),iN(e,2,i.d())}};function oN(e,t){t||(t={});var n=rN();n.p(e);var r=zU(e,t,t.dictionary?6:2,4);return HU(r,t),iN(r,r.length-4,n.d()),r}var jU=typeof TextDecoder<"u"&&new TextDecoder,YU=0;try{jU.decode(nN,{stream:!0}),YU=1}catch{}var lN="https://free.nowline.io/open";function sN(e){let t=new TextEncoder().encode(e),n=oN(t),r=32768,i="";for(let o=0;o<n.length;o+=r)i+=String.fromCharCode(...n.subarray(o,o+r));return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Xx({source:e,sourceUrl:t,share:n}){if(n===!1||n==="none")return null;if(typeof n=="object")return t!==void 0&&aN(t)?n.remoteUrl.replace("{url}",encodeURIComponent(t)):n.textUrl.replace("{text}",sN(e));let r=n===!0?lN:n,i=new URL(r);return t!==void 0&&aN(t)?i.hash=`url=${encodeURIComponent(t)}`:i.hash=`text=${sN(e)}`,i.toString()}function aN(e){try{return new URL(e).protocol==="https:"}catch{return!1}}var cN=0;async function uN(e){let t=e.document??globalThis.document;if(!t)return{rendered:0,failed:0};let n=t.querySelectorAll(e.selector),r=0,i=0,o=++cN,s=e.share??!0,a=[],c=0;for(let l of Array.from(n)){let u=VU(l);if(!u)continue;let f=KU(l),d=`nl-r${o}-${c++}`,p={theme:e.theme,locale:e.locale,width:e.width,nonWorking:e.nonWorking,today:e.today,timezone:e.timezone,idPrefix:d},m=u.parentElement,g=u.nextSibling,E=l.getAttribute("data-nowline-source-url")??void 0??e.sourceUrl;a.push(Ep(f,p).then(y=>{if(qU(u,y),r++,m!==null){let x=Xx({source:f,sourceUrl:E,share:s});if(x!==null){let T=t.createElement("a");T.className="nowline-share",T.href=x,T.target="_blank",T.rel="noopener noreferrer",T.textContent="Share on Nowline",m.insertBefore(T,g)}}},y=>{i++,console.error("nowline: render failed",y)}))}return await Promise.all(a),{rendered:r,failed:i}}function VU(e){let t=e.parentElement;return t&&t.tagName.toUpperCase()==="PRE"?t:e}function KU(e){return e.textContent??""}function qU(e,t){e.outerHTML=t}function fN(){cN=0}function Tp(){if(typeof globalThis>"u")return"light";let e=globalThis.matchMedia;if(typeof e!="function")return"light";try{return e("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}function dN(e,t){return e&&e!=="auto"?Oy(e)??t:t}var ZU="0.0.0-dev.20261019064527.g87aafc2",JU="87aafc2",QU="pre code.language-nowline, code.language-nowline",pN={theme:"auto",startOnLoad:!0,selector:QU,systemTheme:Tp(),share:!0},Ae={...pN},Gx=!1;function eX(e={}){Ae={theme:e.theme??Ae.theme,startOnLoad:e.startOnLoad??Ae.startOnLoad,selector:e.selector??Ae.selector,locale:e.locale??Ae.locale,width:e.width??Ae.width,nonWorking:e.nonWorking??Ae.nonWorking,today:e.today!==void 0?e.today:Ae.today,timezone:e.timezone??Ae.timezone,share:e.share??Ae.share,sourceUrl:e.sourceUrl??Ae.sourceUrl,systemTheme:Tp()}}function hN(){return{theme:dN(Ae.theme,Ae.systemTheme),locale:Ae.locale,width:Ae.width,nonWorking:Ae.nonWorking,today:Ae.today,timezone:Ae.timezone}}async function tX(e,t={}){let n={...hN(),...t};return Ep(e,n)}async function nX(e){return HS(e)}async function zx(e){let t={selector:e?.selector??Ae.selector,theme:e?.theme??hN().theme,locale:e?.locale??Ae.locale,width:e?.width??Ae.width,nonWorking:e?.nonWorking??Ae.nonWorking,today:e?.today!==void 0?e.today:Ae.today,timezone:e?.timezone??Ae.timezone,share:e?.share??Ae.share,sourceUrl:e?.sourceUrl??Ae.sourceUrl,document:e?.document};return uN(t)}var rX=zx;if(typeof document<"u"&&!Gx){Gx=!0;let e=()=>{Ae.startOnLoad&&zx()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):queueMicrotask(e)}function iX(){Ae={...pN,systemTheme:Tp()},Gx=!1,jS(),fN()}return IN(oX);})();
|
|
2921
2921
|
//# sourceMappingURL=nowline.min.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nowline/embed",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.20261019064527.g87aafc2",
|
|
4
4
|
"description": "Browser embed bundle for Nowline. Drop a <script> tag and ```nowline``` blocks render in place.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"engines": {
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"cdn"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@nowline/browser": "0.0.0-dev.
|
|
43
|
-
"@nowline/core": "0.0.0-dev.
|
|
44
|
-
"@nowline/layout": "0.0.0-dev.
|
|
45
|
-
"@nowline/renderer": "0.0.0-dev.
|
|
46
|
-
"@nowline/share-link": "0.0.0-dev.
|
|
42
|
+
"@nowline/browser": "0.0.0-dev.20261019064527.g87aafc2",
|
|
43
|
+
"@nowline/core": "0.0.0-dev.20261019064527.g87aafc2",
|
|
44
|
+
"@nowline/layout": "0.0.0-dev.20261019064527.g87aafc2",
|
|
45
|
+
"@nowline/renderer": "0.0.0-dev.20261019064527.g87aafc2",
|
|
46
|
+
"@nowline/share-link": "0.0.0-dev.20261019064527.g87aafc2",
|
|
47
47
|
"langium": "~4.4.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|