@likec4/core 1.58.0 → 1.59.0
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/builder/index.d.mts +2 -2
- package/dist/builder/index.mjs +2 -1
- package/dist/chunks/Builder.view-element.mjs +2 -0
- package/dist/{_chunks → chunks}/LikeC4Model.d.mts +24 -26
- package/dist/{_chunks → chunks}/_types.d.mts +302 -57
- package/dist/{_chunks → chunks}/_types2.d.mts +2 -2
- package/dist/chunks/assignTagColors.mjs +1 -0
- package/dist/chunks/calcDriftsFromSnapshot.mjs +1 -0
- package/dist/chunks/default-map.d.mts +29 -0
- package/dist/{_chunks → chunks}/index.d.mts +933 -194
- package/dist/{_chunks → chunks}/index2.d.mts +21 -19
- package/dist/{_chunks → chunks}/index3.d.mts +2 -2
- package/dist/{_chunks/index5.d.mts → chunks/index4.d.mts} +153 -4
- package/dist/{_chunks/index4.d.mts → chunks/index5.d.mts} +2 -2
- package/dist/chunks/libs/chroma-js.mjs +15 -0
- package/dist/chunks/libs/graphology-dag.mjs +1 -0
- package/dist/chunks/libs/graphology.mjs +1 -0
- package/dist/chunks/libs/hast-util-sanitize.mjs +1 -0
- package/dist/chunks/libs/hast-util-to-html.mjs +9 -0
- package/dist/chunks/libs/mdast.mjs +29 -0
- package/dist/chunks/libs/mnemonist.mjs +1 -0
- package/dist/chunks/libs/ohash.mjs +1 -0
- package/dist/chunks/libs/remark.mjs +3 -0
- package/dist/chunks/libs/remeda.mjs +1 -0
- package/dist/chunks/libs/unified.mjs +1 -0
- package/dist/chunks/model.mjs +4 -0
- package/dist/chunks/rolldown-runtime.mjs +1 -0
- package/dist/chunks/types.mjs +9 -0
- package/dist/compute-view/index.d.mts +56 -18
- package/dist/compute-view/index.mjs +2 -2
- package/dist/geometry/index.d.mts +2 -2
- package/dist/geometry/index.mjs +1 -1
- package/dist/index.d.mts +10 -10
- package/dist/index.mjs +1 -1
- package/dist/model/index.d.mts +3 -3
- package/dist/model/index.mjs +1 -1
- package/dist/styles/index.d.mts +3 -3
- package/dist/styles/index.mjs +1 -1
- package/dist/types/index.d.mts +3 -3
- package/dist/types/index.mjs +1 -1
- package/dist/utils/graphology/index.d.mts +618 -1
- package/dist/utils/graphology/index.mjs +1 -1
- package/dist/utils/index.d.mts +4 -4
- package/dist/utils/index.mjs +1 -1
- package/package.json +13 -14
- package/dist/THIRD-PARTY-LICENSES.md +0 -1034
- package/dist/_chunks/Builder.view-element.mjs +0 -2
- package/dist/_chunks/assignTagColors.mjs +0 -1
- package/dist/_chunks/libs/@ungap/structured-clone.mjs +0 -1
- package/dist/_chunks/libs/bail.mjs +0 -1
- package/dist/_chunks/libs/ccount.mjs +0 -1
- package/dist/_chunks/libs/character-entities-html4.mjs +0 -1
- package/dist/_chunks/libs/character-entities-legacy.mjs +0 -1
- package/dist/_chunks/libs/character-entities.mjs +0 -2
- package/dist/_chunks/libs/chroma-js.mjs +0 -15
- package/dist/_chunks/libs/comma-separated-tokens.mjs +0 -1
- package/dist/_chunks/libs/decode-named-character-reference.mjs +0 -1
- package/dist/_chunks/libs/defu.mjs +0 -1
- package/dist/_chunks/libs/devlop.mjs +0 -1
- package/dist/_chunks/libs/escape-string-regexp.mjs +0 -1
- package/dist/_chunks/libs/extend.mjs +0 -1
- package/dist/_chunks/libs/graphology-dag.d.mts +0 -607
- package/dist/_chunks/libs/graphology-dag.mjs +0 -1
- package/dist/_chunks/libs/graphology.mjs +0 -1
- package/dist/_chunks/libs/hast-util-sanitize.mjs +0 -1
- package/dist/_chunks/libs/hast-util-to-html.mjs +0 -9
- package/dist/_chunks/libs/is-plain-obj.mjs +0 -1
- package/dist/_chunks/libs/longest-streak.mjs +0 -1
- package/dist/_chunks/libs/markdown-table.mjs +0 -2
- package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +0 -1
- package/dist/_chunks/libs/mdast-util-from-markdown.mjs +0 -3
- package/dist/_chunks/libs/mdast-util-gfm.mjs +0 -15
- package/dist/_chunks/libs/mdast-util-to-hast.mjs +0 -11
- package/dist/_chunks/libs/micromark-extension-gfm.mjs +0 -1
- package/dist/_chunks/libs/mnemonist.d.mts +0 -164
- package/dist/_chunks/libs/mnemonist.mjs +0 -1
- package/dist/_chunks/libs/natural-compare-lite.mjs +0 -9
- package/dist/_chunks/libs/ohash.mjs +0 -1
- package/dist/_chunks/libs/rehype-sanitize.mjs +0 -1
- package/dist/_chunks/libs/rehype-stringify.mjs +0 -1
- package/dist/_chunks/libs/remark-gfm.mjs +0 -1
- package/dist/_chunks/libs/remark-github-blockquote-alert.mjs +0 -3
- package/dist/_chunks/libs/remark-parse.mjs +0 -1
- package/dist/_chunks/libs/remark-rehype.mjs +0 -1
- package/dist/_chunks/libs/remeda.mjs +0 -2
- package/dist/_chunks/libs/trough.mjs +0 -1
- package/dist/_chunks/libs/unified.mjs +0 -1
- package/dist/_chunks/manual-layout.mjs +0 -1
- package/dist/_chunks/mnemonist.d.mts +0 -1
- package/dist/_chunks/model.mjs +0 -4
- package/dist/_chunks/rolldown-runtime.mjs +0 -1
- package/dist/_chunks/types.mjs +0 -1
- /package/dist/{_chunks → chunks}/libs/@radix-ui/colors.mjs +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"../rolldown-runtime.mjs";var t=e((e=>{e.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<`u`,e.SYMBOL_SUPPORT=typeof Symbol<`u`})),n=e(((e,n)=>{var r=t(),i=r.ARRAY_BUFFER_SUPPORT,a=r.SYMBOL_SUPPORT;n.exports=function e(t,n){var r,o,s,c,l;if(!t)throw Error(`obliterator/forEach: invalid iterable.`);if(typeof n!=`function`)throw Error(`obliterator/forEach: expecting a callback.`);if(Array.isArray(t)||i&&ArrayBuffer.isView(t)||typeof t==`string`||t.toString()===`[object Arguments]`){for(s=0,c=t.length;s<c;s++)n(t[s],s);return}if(typeof t.forEach==`function`){t.forEach(n);return}if(a&&Symbol.iterator in t&&typeof t.next!=`function`&&(t=t[Symbol.iterator]()),typeof t.next==`function`){for(r=t,s=0;l=r.next(),l.done!==!0;)n(l.value,s),s++;return}for(o in t)t.hasOwnProperty(o)&&n(t[o],o)}})),r=e(((e,t)=>{function n(e){if(typeof e!=`function`)throw Error(`obliterator/iterator: expecting a function!`);this.next=e}typeof Symbol<`u`&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var e=arguments,t=e.length,r=0;return new n(function(){return r>=t?{done:!0}:{done:!1,value:e[r++]}})},n.empty=function(){return new n(function(){return{done:!0}})},n.fromSequence=function(e){var t=0,r=e.length;return new n(function(){return t>=r?{done:!0}:{done:!1,value:e[t++]}})},n.is=function(e){return e instanceof n?!0:typeof e==`object`&&!!e&&typeof e.next==`function`},t.exports=n})),i=e(((e,t)=>{t.exports=function e(t){return typeof t==`object`&&!!t&&typeof t.addUndirectedEdgeWithKey==`function`&&typeof t.dropNode==`function`&&typeof t.multi==`boolean`}})),a=e((e=>{var t=2**8-1,n=2**16-1,r=2**32-1,i=2**7-1,a=2**15-1,o=2**31-1;e.getPointerArray=function(e){var i=e-1;if(i<=t)return Uint8Array;if(i<=n)return Uint16Array;if(i<=r)return Uint32Array;throw Error(`mnemonist: Pointer Array of size > 4294967295 is not supported.`)},e.getSignedPointerArray=function(e){var t=e-1;return t<=i?Int8Array:t<=a?Int16Array:t<=o?Int32Array:Float64Array},e.getNumberType=function(e){return e===(e|0)?Math.sign(e)===-1?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var s={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(t,n){var r=null,i=0,a,o,c,l,u;for(l=0,u=t.length;l<u;l++)c=n?n(t[l]):t[l],o=e.getNumberType(c),a=s[o.name],a>i&&(i=a,r=o);return r},e.isTypedArray=function(e){return typeof ArrayBuffer<`u`&&ArrayBuffer.isView(e)},e.concat=function(){var e=0,t,n,r;for(t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var i=new arguments[0].constructor(e);for(t=0,n=0;t<r;t++)i.set(arguments[t],n),n+=arguments[t].length;return i},e.indices=function(t){for(var n=new(e.getPointerArray(t))(t),r=0;r<t;r++)n[r]=r;return n}})),o=e((e=>{var t=n(),r=a();function i(e){return Array.isArray(e)||r.isTypedArray(e)}function o(e){if(typeof e.length==`number`)return e.length;if(typeof e.size==`number`)return e.size}function s(e){var n=o(e),r=typeof n==`number`?Array(n):[],i=0;return t(e,function(e){r[i++]=e}),r}function c(e){var n=o(e),i=typeof n==`number`?r.getPointerArray(n):Array,a=typeof n==`number`?Array(n):[],s=typeof n==`number`?new i(n):[],c=0;return t(e,function(e){a[c]=e,s[c]=c++}),[a,s]}e.isArrayLike=i,e.guessLength=o,e.toArray=s,e.toArrayWithIndices=c})),s=e(((e,t)=>{var n=o(),i=r();function a(e,t){if(arguments.length<2)throw Error(`mnemonist/fixed-deque: expecting an Array class and a capacity.`);if(typeof t!=`number`||t<=0)throw Error("mnemonist/fixed-deque: `capacity` should be a positive number.");this.ArrayClass=e,this.capacity=t,this.items=new e(this.capacity),this.clear()}a.prototype.clear=function(){this.start=0,this.size=0},a.prototype.push=function(e){if(this.size===this.capacity)throw Error(`mnemonist/fixed-deque.push: deque capacity (`+this.capacity+`) exceeded!`);var t=this.start+this.size;return t>=this.capacity&&(t-=this.capacity),this.items[t]=e,++this.size},a.prototype.unshift=function(e){if(this.size===this.capacity)throw Error(`mnemonist/fixed-deque.unshift: deque capacity (`+this.capacity+`) exceeded!`);var t=this.start-1;return this.start===0&&(t=this.capacity-1),this.items[t]=e,this.start=t,++this.size},a.prototype.pop=function(){if(this.size!==0){this.size--;var e=this.start+this.size;return e>=this.capacity&&(e-=this.capacity),this.items[e]}},a.prototype.shift=function(){if(this.size!==0){var e=this.start;return this.size--,this.start++,this.start===this.capacity&&(this.start=0),this.items[e]}},a.prototype.peekFirst=function(){if(this.size!==0)return this.items[this.start]},a.prototype.peekLast=function(){if(this.size!==0){var e=this.start+this.size-1;return e>=this.capacity&&(e-=this.capacity),this.items[e]}},a.prototype.get=function(e){if(!(this.size===0||e>=this.capacity))return e=this.start+e,e>=this.capacity&&(e-=this.capacity),this.items[e]},a.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.capacity,r=this.size,i=this.start,a=0;a<r;)e.call(t,this.items[i],a,this),i++,a++,i===n&&(i=0)},a.prototype.toArray=function(){var e=this.start+this.size;if(e<this.capacity)return this.items.slice(this.start,e);for(var t=new this.ArrayClass(this.size),n=this.capacity,r=this.size,i=this.start,a=0;a<r;)t[a]=this.items[i],i++,a++,i===n&&(i=0);return t},a.prototype.values=function(){var e=this.items,t=this.capacity,n=this.size,r=this.start,a=0;return new i(function(){if(a>=n)return{done:!0};var i=e[r];return r++,a++,r===t&&(r=0),{value:i,done:!1}})},a.prototype.entries=function(){var e=this.items,t=this.capacity,n=this.size,r=this.start,a=0;return new i(function(){if(a>=n)return{done:!0};var i=e[r];return r++,r===t&&(r=0),{value:[a++,i],done:!1}})},typeof Symbol<`u`&&(a.prototype[Symbol.iterator]=a.prototype.values),a.prototype.inspect=function(){var e=this.toArray();return e.type=this.ArrayClass.name,e.capacity=this.capacity,Object.defineProperty(e,"constructor",{value:a,enumerable:!1}),e},typeof Symbol<`u`&&(a.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=a.prototype.inspect),a.from=function(e,t,r){if(arguments.length<3&&(r=n.guessLength(e),typeof r!=`number`))throw Error(`mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.`);var i=new a(t,r);if(n.isArrayLike(e)){var o,s;for(o=0,s=e.length;o<s;o++)i.items[o]=e[o];return i.size=s,i}return n.forEach(e,function(e){i.push(e)}),i},t.exports=a})),c=e((e=>{let t=i(),n=s();function r(e,t){let n=0;return e.forEachInNeighbor(t,()=>{n++}),n}function a(e,i){if(!t(e))throw Error(`graphology-dag/topological-sort: the given graph is not a valid graphology instance.`);if(e.type===`undirected`||e.undirectedSize!==0)throw Error(`graphology-dag/topological-sort: cannot work if graph is not directed.`);if(e.order===0)return;let a=new n(Array,e.order),o={},s=0;e.forEachNode((t,n)=>{let i=e.multi?r(e,t):e.inDegree(t);i===0?a.push([t,n,0]):(o[t]=i,s+=i)});let c=0;function l(e,t){let n=--o[e];s--,n===0&&a.push([e,t,c+1]),o[e]=n}for(;a.size!==0;){let[t,n,r]=a.shift();c=r,i(t,n,r),e.forEachOutNeighbor(t,l)}if(s!==0)throw Error(`graphology-dag/topological-sort: given graph is not acyclic.`)}function o(e){if(!t(e))throw Error(`graphology-dag/topological-sort: the given graph is not a valid graphology instance.`);let n=Array(e.order),r=0;return a(e,e=>{n[r++]=e}),n}e.topologicalSort=o})),l=e(((e,t)=>{let n=i();t.exports=function e(t,r,i){if(!n(t))throw Error(`graphology-dag/will-create-cycle: the given graph is not a valid graphology instance.`);if(r=``+r,i=``+i,r===i)return!0;if(!t.hasNode(r)||!t.hasNode(i)||t.hasDirectedEdge(r,i))return!1;if(t.hasDirectedEdge(i,r))return!0;let a=t.outNeighbors(i);function o(e){a.push(e)}for(;a.length!==0;){let e=a.pop();if(e===r)return!0;t.forEachOutNeighbor(e,o)}return!1}}));export{n as i,c as n,r,l as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e;function t(){}t.prototype=Object.create(null);function n(){n.init.call(this)}n.EventEmitter=n,n.usingDomains=!1,n.prototype.domain=void 0,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.init=function(){this.domain=null,n.usingDomains&&e.active&&!(this instanceof e.Domain)&&(this.domain=e.active),(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new t,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},n.prototype.setMaxListeners=function e(t){if(typeof t!=`number`||t<0||isNaN(t))throw TypeError(`"n" argument must be a positive number`);return this._maxListeners=t,this};function r(e){return e._maxListeners===void 0?n.defaultMaxListeners:e._maxListeners}n.prototype.getMaxListeners=function e(){return r(this)};function i(e,t,n){if(t)e.call(n);else for(var r=e.length,i=m(e,r),a=0;a<r;++a)i[a].call(n)}function a(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,a=m(e,i),o=0;o<i;++o)a[o].call(n,r)}function o(e,t,n,r,i){if(t)e.call(n,r,i);else for(var a=e.length,o=m(e,a),s=0;s<a;++s)o[s].call(n,r,i)}function s(e,t,n,r,i,a){if(t)e.call(n,r,i,a);else for(var o=e.length,s=m(e,o),c=0;c<o;++c)s[c].call(n,r,i,a)}function c(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,a=m(e,i),o=0;o<i;++o)a[o].apply(n,r)}n.prototype.emit=function e(t){var n,r,l,u,d,f,p,m=!1,h=t===`error`;if(f=this._events,f)h&&=f.error==null;else if(!h)return!1;if(p=this.domain,h){if(n=arguments[1],p)n||=Error(`Uncaught, unspecified "error" event`),n.domainEmitter=this,n.domain=p,n.domainThrown=!1,p.emit(`error`,n);else if(n instanceof Error)throw n;else{var g=Error(`Uncaught, unspecified "error" event. (`+n+`)`);throw g.context=n,g}return!1}if(r=f[t],!r)return!1;var _=typeof r==`function`;switch(l=arguments.length,l){case 1:i(r,_,this);break;case 2:a(r,_,this,arguments[1]);break;case 3:o(r,_,this,arguments[1],arguments[2]);break;case 4:s(r,_,this,arguments[1],arguments[2],arguments[3]);break;default:for(u=Array(l-1),d=1;d<l;d++)u[d-1]=arguments[d];c(r,_,this,u)}return m&&p.exit(),!0};function l(e,n,i,a){var o,s,c;if(typeof i!=`function`)throw TypeError(`"listener" argument must be a function`);if(s=e._events,s?(s.newListener&&(e.emit(`newListener`,n,i.listener?i.listener:i),s=e._events),c=s[n]):(s=e._events=new t,e._eventsCount=0),!c)c=s[n]=i,++e._eventsCount;else if(typeof c==`function`?c=s[n]=a?[i,c]:[c,i]:a?c.unshift(i):c.push(i),!c.warned&&(o=r(e),o&&o>0&&c.length>o)){c.warned=!0;var l=Error(`Possible EventEmitter memory leak detected. `+c.length+` `+n+` listeners added. Use emitter.setMaxListeners() to increase limit`);l.name=`MaxListenersExceededWarning`,l.emitter=e,l.type=n,l.count=c.length,u(l)}return e}function u(e){typeof console.warn==`function`?console.warn(e):console.log(e)}n.prototype.addListener=function e(t,n){return l(this,t,n,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function e(t,n){return l(this,t,n,!0)};function d(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}n.prototype.once=function e(t,n){if(typeof n!=`function`)throw TypeError(`"listener" argument must be a function`);return this.on(t,d(this,t,n)),this},n.prototype.prependOnceListener=function e(t,n){if(typeof n!=`function`)throw TypeError(`"listener" argument must be a function`);return this.prependListener(t,d(this,t,n)),this},n.prototype.removeListener=function e(n,r){var i,a,o,s,c;if(typeof r!=`function`)throw TypeError(`"listener" argument must be a function`);if(a=this._events,!a||(i=a[n],!i))return this;if(i===r||i.listener&&i.listener===r)--this._eventsCount===0?this._events=new t:(delete a[n],a.removeListener&&this.emit(`removeListener`,n,i.listener||r));else if(typeof i!=`function`){for(o=-1,s=i.length;s-- >0;)if(i[s]===r||i[s].listener&&i[s].listener===r){c=i[s].listener,o=s;break}if(o<0)return this;if(i.length===1){if(i[0]=void 0,--this._eventsCount===0)return this._events=new t,this;delete a[n]}else p(i,o);a.removeListener&&this.emit(`removeListener`,n,c||r)}return this},n.prototype.off=function(e,t){return this.removeListener(e,t)},n.prototype.removeAllListeners=function e(n){var r,i=this._events;if(!i)return this;if(!i.removeListener)return arguments.length===0?(this._events=new t,this._eventsCount=0):i[n]&&(--this._eventsCount===0?this._events=new t:delete i[n]),this;if(arguments.length===0){for(var a=Object.keys(i),o=0,s;o<a.length;++o)s=a[o],s!==`removeListener`&&this.removeAllListeners(s);return this.removeAllListeners(`removeListener`),this._events=new t,this._eventsCount=0,this}if(r=i[n],typeof r==`function`)this.removeListener(n,r);else if(r)do this.removeListener(n,r[r.length-1]);while(r[0]);return this},n.prototype.listeners=function e(t){var n,r,i=this._events;return i?(n=i[t],r=n?typeof n==`function`?[n.listener||n]:h(n):[]):r=[],r},n.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):f.call(e,t)},n.prototype.listenerCount=f;function f(e){var t=this._events;if(t){var n=t[e];if(typeof n==`function`)return 1;if(n)return n.length}return 0}n.prototype.eventNames=function e(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function p(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}function m(e,t){for(var n=Array(t);t--;)n[t]=e[t];return n}function h(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function g(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++)if(arguments[t])for(let n in arguments[t])e[n]=arguments[t][n];return e}let _=g;typeof Object.assign==`function`&&(_=Object.assign);function v(e,t,n,r){let i=e._nodes.get(t),a=null;return i&&(a=r===`mixed`?i.out&&i.out[n]||i.undirected&&i.undirected[n]:r===`directed`?i.out&&i.out[n]:i.undirected&&i.undirected[n]),a}function y(e){return typeof e==`object`&&!!e}function b(e){let t;for(t in e)return!1;return!0}function x(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function S(e,t,n){let r={enumerable:!0,configurable:!0};typeof n==`function`?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function C(e){return!(!y(e)||e.attributes&&!Array.isArray(e.attributes))}function ee(){let e=Math.floor(Math.random()*256)&255;return()=>e++}function w(){let e=arguments,t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function T(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}var E=class extends Error{constructor(e){super(),this.name=`GraphError`,this.message=e}},D=class e extends E{constructor(t){super(t),this.name=`InvalidArgumentsGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},O=class e extends E{constructor(t){super(t),this.name=`NotFoundGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},k=class e extends E{constructor(t){super(t),this.name=`UsageGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}};function A(e,t){this.key=e,this.attributes=t,this.clear()}A.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function j(e,t){this.key=e,this.attributes=t,this.clear()}j.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function M(e,t){this.key=e,this.attributes=t,this.clear()}M.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function N(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}N.prototype.attach=function(){let e=`out`,t=`in`;this.undirected&&(e=t=`undirected`);let n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)},N.prototype.attachMulti=function(){let e=`out`,t=`in`,n=this.source.key,r=this.target.key;this.undirected&&(e=t=`undirected`);let i=this.source[e],a=i[r];if(a===void 0){i[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}a.previous=this,this.next=a,i[r]=this,this.target[t][n]=this},N.prototype.detach=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),delete this.source[n][t],delete this.target[r][e]},N.prototype.detachMulti=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};function P(e,t,n,r,i,a,o){let s,c,l,u;if(r=``+r,n===0){if(s=e._nodes.get(r),!s)throw new O(`Graph.${t}: could not find the "${r}" node in the graph.`);l=i,u=a}else if(n===3){if(i=``+i,c=e._edges.get(i),!c)throw new O(`Graph.${t}: could not find the "${i}" edge in the graph.`);let n=c.source.key,d=c.target.key;if(r===n)s=c.target;else if(r===d)s=c.source;else throw new O(`Graph.${t}: the "${r}" node is not attached to the "${i}" edge (${n}, ${d}).`);l=a,u=o}else{if(c=e._edges.get(r),!c)throw new O(`Graph.${t}: could not find the "${r}" edge in the graph.`);s=n===1?c.source:c.target,l=i,u=a}return[s,l,u]}function te(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=P(this,t,n,e,r,i);return a.attributes[o]}}function ne(e,t,n){e.prototype[t]=function(e,r){let[i]=P(this,t,n,e,r);return i.attributes}}function re(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=P(this,t,n,e,r,i);return a.attributes.hasOwnProperty(o)}}function ie(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=P(this,t,n,e,r,i,a);return o.attributes[s]=c,this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function ae(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=P(this,t,n,e,r,i,a);if(typeof c!=`function`)throw new D(`Graph.${t}: updater should be a function.`);let l=o.attributes;return l[s]=c(l[s]),this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function oe(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=P(this,t,n,e,r,i);return delete a.attributes[o],this.emit(`nodeAttributesUpdated`,{key:a.key,type:`remove`,attributes:a.attributes,name:o}),this}}function se(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=P(this,t,n,e,r,i);if(!y(o))throw new D(`Graph.${t}: provided attributes are not a plain object.`);return a.attributes=o,this.emit(`nodeAttributesUpdated`,{key:a.key,type:`replace`,attributes:a.attributes}),this}}function ce(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=P(this,t,n,e,r,i);if(!y(o))throw new D(`Graph.${t}: provided attributes are not a plain object.`);return _(a.attributes,o),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`merge`,attributes:a.attributes,data:o}),this}}function le(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=P(this,t,n,e,r,i);if(typeof o!=`function`)throw new D(`Graph.${t}: provided updater is not a function.`);return a.attributes=o(a.attributes),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`update`,attributes:a.attributes}),this}}const ue=[{name:e=>`get${e}Attribute`,attacher:te},{name:e=>`get${e}Attributes`,attacher:ne},{name:e=>`has${e}Attribute`,attacher:re},{name:e=>`set${e}Attribute`,attacher:ie},{name:e=>`update${e}Attribute`,attacher:ae},{name:e=>`remove${e}Attribute`,attacher:oe},{name:e=>`replace${e}Attributes`,attacher:se},{name:e=>`merge${e}Attributes`,attacher:ce},{name:e=>`update${e}Attributes`,attacher:le}];function de(e){ue.forEach(function({name:t,attacher:n}){n(e,t(`Node`),0),n(e,t(`Source`),1),n(e,t(`Target`),2),n(e,t(`Opposite`),3)})}function fe(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new k(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new k(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=v(this,a,o,n),!i)throw new O(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new k(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new O(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes[r]}}function pe(e,t,n){e.prototype[t]=function(e){let r;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new k(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new k(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let i=``+e,a=``+arguments[1];if(r=v(this,i,a,n),!r)throw new O(`Graph.${t}: could not find an edge for the given path ("${i}" - "${a}").`)}else{if(n!==`mixed`)throw new k(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,r=this._edges.get(e),!r)throw new O(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return r.attributes}}function me(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new k(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new k(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=v(this,a,o,n),!i)throw new O(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new k(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new O(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes.hasOwnProperty(r)}}function he(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new k(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new k(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=v(this,o,s,n),!a)throw new O(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new k(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new O(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return a.attributes[r]=i,this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function ge(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new k(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new k(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=v(this,o,s,n),!a)throw new O(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new k(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new O(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof i!=`function`)throw new D(`Graph.${t}: updater should be a function.`);return a.attributes[r]=i(a.attributes[r]),this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function _e(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new k(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new k(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=v(this,a,o,n),!i)throw new O(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new k(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new O(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return delete i.attributes[r],this.emit(`edgeAttributesUpdated`,{key:i.key,type:`remove`,attributes:i.attributes,name:r}),this}}function ve(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new k(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new k(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=v(this,a,o,n),!i)throw new O(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new k(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new O(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!y(r))throw new D(`Graph.${t}: provided attributes are not a plain object.`);return i.attributes=r,this.emit(`edgeAttributesUpdated`,{key:i.key,type:`replace`,attributes:i.attributes}),this}}function ye(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new k(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new k(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=v(this,a,o,n),!i)throw new O(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new k(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new O(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!y(r))throw new D(`Graph.${t}: provided attributes are not a plain object.`);return _(i.attributes,r),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`merge`,attributes:i.attributes,data:r}),this}}function be(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new k(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new k(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=v(this,a,o,n),!i)throw new O(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new k(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new O(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof r!=`function`)throw new D(`Graph.${t}: provided updater is not a function.`);return i.attributes=r(i.attributes),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`update`,attributes:i.attributes}),this}}const xe=[{name:e=>`get${e}Attribute`,attacher:fe},{name:e=>`get${e}Attributes`,attacher:pe},{name:e=>`has${e}Attribute`,attacher:me},{name:e=>`set${e}Attribute`,attacher:he},{name:e=>`update${e}Attribute`,attacher:ge},{name:e=>`remove${e}Attribute`,attacher:_e},{name:e=>`replace${e}Attributes`,attacher:ve},{name:e=>`merge${e}Attributes`,attacher:ye},{name:e=>`update${e}Attributes`,attacher:be}];function Se(e){xe.forEach(function({name:t,attacher:n}){n(e,t(`Edge`),`mixed`),n(e,t(`DirectedEdge`),`directed`),n(e,t(`UndirectedEdge`),`undirected`)})}const Ce=[{name:`edges`,type:`mixed`},{name:`inEdges`,type:`directed`,direction:`in`},{name:`outEdges`,type:`directed`,direction:`out`},{name:`inboundEdges`,type:`mixed`,direction:`in`},{name:`outboundEdges`,type:`mixed`,direction:`out`},{name:`directedEdges`,type:`directed`},{name:`undirectedEdges`,type:`undirected`}];function we(e,t,n,r){let i=!1;for(let a in t){if(a===r)continue;let o=t[a];if(i=n(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&i)return o.key}}function Te(e,t,n,r){let i,a,o,s=!1;for(let c in t)if(c!==r){i=t[c];do{if(a=i.source,o=i.target,s=n(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected),e&&s)return i.key;i=i.next}while(i!==void 0)}}function F(e,t){let n=Object.keys(e),r=n.length,i,a=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(a>=r)return{done:!0};let o=n[a++];if(o===t){i=void 0;continue}i=e[o]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}function Ee(e,t,n,r){let i=t[n];if(!i)return;let a=i.source,o=i.target;if(r(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected)&&e)return i.key}function De(e,t,n,r){let i=t[n];if(!i)return;let a=!1;do{if(a=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&a)return i.key;i=i.next}while(i!==void 0)}function I(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};let e={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:e}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function Oe(e,t){if(e.size===0)return[];if(t===`mixed`||t===e.type)return Array.from(e._edges.keys());let n=t===`undirected`?e.undirectedSize:e.directedSize,r=Array(n),i=t===`undirected`,a=e._edges.values(),o=0,s,c;for(;s=a.next(),s.done!==!0;)c=s.value,c.undirected===i&&(r[o++]=c.key);return r}function L(e,t,n,r){if(t.size===0)return;let i=n!==`mixed`&&n!==t.type,a=n===`undirected`,o,s,c=!1,l=t._edges.values();for(;o=l.next(),o.done!==!0;){if(s=o.value,i&&s.undirected!==a)continue;let{key:t,attributes:n,source:l,target:u}=s;if(c=r(t,n,l.key,u.key,l.attributes,u.attributes,s.undirected),e&&c)return t}}function ke(e,t){if(e.size===0)return T();let n=t!==`mixed`&&t!==e.type,r=t===`undirected`,i=e._edges.values();return{[Symbol.iterator](){return this},next(){let e,t;for(;;){if(e=i.next(),e.done)return e;if(t=e.value,!(n&&t.undirected!==r))break}return{value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected},done:!1}}}}function R(e,t,n,r,i,a){let o=t?Te:we,s;if(n!==`undirected`&&(r!==`out`&&(s=o(e,i.in,a),e&&s)||r!==`in`&&(s=o(e,i.out,a,r?void 0:i.key),e&&s))||n!==`directed`&&(s=o(e,i.undirected,a),e&&s))return s}function Ae(e,t,n,r){let i=[];return R(!1,e,t,n,r,function(e){i.push(e)}),i}function je(e,t,n){let r=T();return e!==`undirected`&&(t!==`out`&&n.in!==void 0&&(r=w(r,F(n.in))),t!==`in`&&n.out!==void 0&&(r=w(r,F(n.out,t?void 0:n.key)))),e!==`directed`&&n.undirected!==void 0&&(r=w(r,F(n.undirected))),r}function z(e,t,n,r,i,a,o){let s=n?De:Ee,c;if(t!==`undirected`&&(i.in!==void 0&&r!==`out`&&(c=s(e,i.in,a,o),e&&c)||i.out!==void 0&&r!==`in`&&(r||i.key!==a)&&(c=s(e,i.out,a,o),e&&c))||t!==`directed`&&i.undirected!==void 0&&(c=s(e,i.undirected,a,o),e&&c))return c}function Me(e,t,n,r,i){let a=[];return z(!1,e,t,n,r,i,function(e){a.push(e)}),a}function Ne(e,t,n,r){let i=T();return e!==`undirected`&&(n.in!==void 0&&t!==`out`&&r in n.in&&(i=w(i,I(n.in,r))),n.out!==void 0&&t!==`in`&&r in n.out&&(t||n.key!==r)&&(i=w(i,I(n.out,r)))),e!==`directed`&&n.undirected!==void 0&&r in n.undirected&&(i=w(i,I(n.undirected,r))),i}function Pe(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];if(!arguments.length)return Oe(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new O(`Graph.${n}: could not find the "${e}" node in the graph.`);return Ae(this.multi,r===`mixed`?this.type:r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let a=this._nodes.get(e);if(!a)throw new O(`Graph.${n}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new O(`Graph.${n}: could not find the "${t}" target node in the graph.`);return Me(r,this.multi,i,a,t)}throw new D(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Fe(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(!(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)){if(arguments.length===1)return n=e,L(!1,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new O(`Graph.${a}: could not find the "${e}" node in the graph.`);return R(!1,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new O(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new O(`Graph.${a}: could not find the "${t}" target node in the graph.`);return z(!1,r,this.multi,i,o,t,n)}throw new D(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n;if(e.length===0){let i=0;r!==`directed`&&(i+=this.undirectedSize),r!==`undirected`&&(i+=this.directedSize),n=Array(i);let a=0;e.push((e,r,i,o,s,c,l)=>{n[a++]=t(e,r,i,o,s,c,l)})}else n=[],e.push((e,r,i,a,o,s,c)=>{n.push(t(e,r,i,a,o,s,c))});return this[a].apply(this,e),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n=[];return e.push((e,r,i,a,o,s,c)=>{t(e,r,i,a,o,s,c)&&n.push(e)}),this[a].apply(this,e),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let e=Array.prototype.slice.call(arguments);if(e.length<2||e.length>4)throw new D(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${e.length}).`);if(typeof e[e.length-1]==`function`&&typeof e[e.length-2]!=`function`)throw new D(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let t,n;e.length===2?(t=e[0],n=e[1],e=[]):e.length===3?(t=e[1],n=e[2],e=[e[0]]):e.length===4&&(t=e[2],n=e[3],e=[e[0],e[1]]);let r=n;return e.push((e,n,i,a,o,s,c)=>{r=t(r,e,n,i,a,o,s,c)}),this[a].apply(this,e),r}}function Ie(e,t){let{name:n,type:r,direction:i}=t,a=`find`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return!1;if(arguments.length===1)return n=e,L(!0,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new O(`Graph.${a}: could not find the "${e}" node in the graph.`);return R(!0,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new O(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new O(`Graph.${a}: could not find the "${t}" target node in the graph.`);return z(!0,r,this.multi,i,o,t,n)}throw new D(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};let o=`some`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>t(e,n,r,i,a,o,s)),!!this[a].apply(this,e)};let s=`every`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>!t(e,n,r,i,a,o,s)),!this[a].apply(this,e)}}function Le(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return T();if(!arguments.length)return ke(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.${a}: could not find the "${e}" node in the graph.`);return je(r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new O(`Graph.${a}: could not find the "${t}" target node in the graph.`);return Ne(r,i,n,t)}throw new D(`Graph.${a}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Re(e){Ce.forEach(t=>{Pe(e,t),Fe(e,t),Ie(e,t),Le(e,t)})}const ze=[{name:`neighbors`,type:`mixed`},{name:`inNeighbors`,type:`directed`,direction:`in`},{name:`outNeighbors`,type:`directed`,direction:`out`},{name:`inboundNeighbors`,type:`mixed`,direction:`in`},{name:`outboundNeighbors`,type:`mixed`,direction:`out`},{name:`directedNeighbors`,type:`directed`},{name:`undirectedNeighbors`,type:`undirected`}];function B(){this.A=null,this.B=null}B.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)},B.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function V(e,t,n,r,i){for(let a in r){let o=r[a],s=o.source,c=o.target,l=s===n?c:s;if(t&&t.has(l.key))continue;let u=i(l.key,l.attributes);if(e&&u)return l.key}}function H(e,t,n,r,i){if(t!==`mixed`){if(t===`undirected`)return V(e,null,r,r.undirected,i);if(typeof n==`string`)return V(e,null,r,r[n],i)}let a=new B,o;if(t!==`undirected`){if(n!==`out`){if(o=V(e,null,r,r.in,i),e&&o)return o;a.wrap(r.in)}if(n!==`in`){if(o=V(e,a,r,r.out,i),e&&o)return o;a.wrap(r.out)}}if(t!==`directed`&&(o=V(e,a,r,r.undirected,i),e&&o))return o}function Be(e,t,n){if(e!==`mixed`){if(e===`undirected`)return Object.keys(n.undirected);if(typeof t==`string`)return Object.keys(n[t])}let r=[];return H(!1,e,t,n,function(e){r.push(e)}),r}function U(e,t,n){let r=Object.keys(n),i=r.length,a=0;return{[Symbol.iterator](){return this},next(){let o=null;do{if(a>=i)return e&&e.wrap(n),{done:!0};let s=n[r[a++]],c=s.source,l=s.target;if(o=c===t?l:c,e&&e.has(o.key)){o=null;continue}}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}}}}function Ve(e,t,n){if(e!==`mixed`){if(e===`undirected`)return U(null,n,n.undirected);if(typeof t==`string`)return U(null,n,n[t])}let r=T(),i=new B;return e!==`undirected`&&(t!==`out`&&(r=w(r,U(i,n,n.in))),t!==`in`&&(r=w(r,U(i,n,n.out)))),e!==`directed`&&(r=w(r,U(i,n,n.undirected))),r}function He(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new O(`Graph.${n}: could not find the "${e}" node in the graph.`);return Be(r===`mixed`?this.type:r,i,t)}}function Ue(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new O(`Graph.${a}: could not find the "${e}" node in the graph.`);H(!1,r===`mixed`?this.type:r,i,n,t)};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(e,t){let n=[];return this[a](e,(e,r)=>{n.push(t(e,r))}),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(e,t){let n=[];return this[a](e,(e,r)=>{t(e,r)&&n.push(e)}),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(e,t,n){if(arguments.length<3)throw new D(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let r=n;return this[a](e,(e,n)=>{r=t(r,e,n)}),r}}function We(e,t){let{name:n,type:r,direction:i}=t,a=n[0].toUpperCase()+n.slice(1,-1),o=`find`+a;e.prototype[o]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new O(`Graph.${o}: could not find the "${e}" node in the graph.`);return H(!0,r===`mixed`?this.type:r,i,n,t)};let s=`some`+a;e.prototype[s]=function(e,t){return!!this[o](e,t)};let c=`every`+a;e.prototype[c]=function(e,t){return!this[o](e,(e,n)=>!t(e,n))}}function Ge(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return T();e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new O(`Graph.${a}: could not find the "${e}" node in the graph.`);return Ve(r===`mixed`?this.type:r,i,t)}}function Ke(e){ze.forEach(t=>{He(e,t),Ue(e,t),We(e,t),Ge(e,t)})}function W(e,t,n,r,i){let a=r._nodes.values(),o=r.type,s,c,l,u,d,f,p;for(;s=a.next(),s.done!==!0;){let r=!1;if(c=s.value,o!==`undirected`)for(l in u=c.out,u){d=u[l];do{if(f=d.target,r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}if(o!==`directed`){for(l in u=c.undirected,u)if(!(t&&c.key>l)){d=u[l];do{if(f=d.target,f.key!==l&&(f=d.source),r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}}if(n&&!r&&(p=i(c.key,null,c.attributes,null,null,null,null),e&&p))return null}}function qe(e,t){let n={key:e};return b(t.attributes)||(n.attributes=_({},t.attributes)),n}function Je(e,t,n){let r={key:t,source:n.source.key,target:n.target.key};return b(n.attributes)||(r.attributes=_({},n.attributes)),e===`mixed`&&n.undirected&&(r.undirected=!0),r}function Ye(e){if(!y(e))throw new D(`Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.`);if(!(`key`in e))throw new D(`Graph.import: serialized node is missing its key.`);if(`attributes`in e&&(!y(e.attributes)||e.attributes===null))throw new D(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`)}function Xe(e){if(!y(e))throw new D(`Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.`);if(!(`source`in e))throw new D(`Graph.import: serialized edge is missing its source.`);if(!(`target`in e))throw new D(`Graph.import: serialized edge is missing its target.`);if(`attributes`in e&&(!y(e.attributes)||e.attributes===null))throw new D(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`);if(`undirected`in e&&typeof e.undirected!=`boolean`)throw new D(`Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.`)}const Ze=ee(),Qe=new Set([`directed`,`undirected`,`mixed`]),G=new Set([`domain`,`_events`,`_eventsCount`,`_maxListeners`]),$e=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:`directed`},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:`undirected`},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:`directed`},{name:e=>`${e}UndirectedEdgeWithKey`,type:`undirected`}],et={allowSelfLoops:!0,multi:!1,type:`mixed`};function tt(e,t,n){if(n&&!y(n))throw new D(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=``+t,n||={},e._nodes.has(t))throw new k(`Graph.addNode: the "${t}" node already exist in the graph.`);let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function K(e,t,n){let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function q(e,t,n,r,i,a,o,s){if(!r&&e.type===`undirected`)throw new k(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new k(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!y(s))throw new D(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`);if(a=``+a,o=``+o,s||={},!e.allowSelfLoops&&a===o)throw new k(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let c=e._nodes.get(a),l=e._nodes.get(o);if(!c)throw new O(`Graph.${t}: source node "${a}" not found.`);if(!l)throw new O(`Graph.${t}: target node "${o}" not found.`);let u={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new k(`Graph.${t}: the "${i}" edge already exists in the graph.`);if(!e.multi&&(r?c.undirected[o]!==void 0:c.out[o]!==void 0))throw new k(`Graph.${t}: an edge linking "${a}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);let d=new N(r,i,c,l,s);e._edges.set(i,d);let f=a===o;return r?(c.undirectedDegree++,l.undirectedDegree++,f&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,l.inDegree++,f&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?d.attachMulti():d.attach(),r?e._undirectedSize++:e._directedSize++,u.key=i,e.emit(`edgeAdded`,u),i}function nt(e,t,n,r,i,a,o,s,c){if(!r&&e.type===`undirected`)throw new k(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new k(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(s){if(c){if(typeof s!=`function`)throw new D(`Graph.${t}: invalid updater function. Expecting a function but got "${s}"`)}else if(!y(s))throw new D(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`)}a=``+a,o=``+o;let l;if(c&&(l=s,s=void 0),!e.allowSelfLoops&&a===o)throw new k(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let u=e._nodes.get(a),d=e._nodes.get(o),f,p;if(!n&&(f=e._edges.get(i),f)){if((f.source.key!==a||f.target.key!==o)&&(!r||f.source.key!==o||f.target.key!==a))throw new k(`Graph.${t}: inconsistency detected when attempting to merge the "${i}" edge with "${a}" source & "${o}" target vs. ("${f.source.key}", "${f.target.key}").`);p=f}if(!p&&!e.multi&&u&&(p=r?u.undirected[o]:u.out[o]),p){let t=[p.key,!1,!1,!1];if(c?!l:!s)return t;if(c){let t=p.attributes;p.attributes=l(t),e.emit(`edgeAttributesUpdated`,{type:`replace`,key:p.key,attributes:p.attributes})}else _(p.attributes,s),e.emit(`edgeAttributesUpdated`,{type:`merge`,key:p.key,attributes:p.attributes,data:s});return t}s||={},c&&l&&(s=l(s));let m={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new k(`Graph.${t}: the "${i}" edge already exists in the graph.`);let h=!1,g=!1;u||(u=K(e,a,{}),h=!0,a===o&&(d=u,g=!0)),d||(d=K(e,o,{}),g=!0),f=new N(r,i,u,d,s),e._edges.set(i,f);let v=a===o;return r?(u.undirectedDegree++,d.undirectedDegree++,v&&(u.undirectedLoops++,e._undirectedSelfLoopCount++)):(u.outDegree++,d.inDegree++,v&&(u.directedLoops++,e._directedSelfLoopCount++)),e.multi?f.attachMulti():f.attach(),r?e._undirectedSize++:e._directedSize++,m.key=i,e.emit(`edgeAdded`,m),[i,!0,h,g]}function J(e,t){e._edges.delete(t.key);let{source:n,target:r,attributes:i}=t,a=t.undirected,o=n===r;a?(n.undirectedDegree--,r.undirectedDegree--,o&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,o&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),a?e._undirectedSize--:e._directedSize--,e.emit(`edgeDropped`,{key:t.key,attributes:i,source:n.key,target:r.key,undirected:a})}var Y=class e extends n{constructor(e){if(super(),e=_({},et,e),typeof e.multi!=`boolean`)throw new D(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!Qe.has(e.type))throw new D(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!=`boolean`)throw new D(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);let t=e.type===`mixed`?A:e.type===`directed`?j:M;x(this,`NodeDataClass`,t);let n=`geid_`+Ze()+`_`,r=0,i=()=>{let e;do e=n+ r++;while(this._edges.has(e));return e};x(this,`_attributes`,{}),x(this,`_nodes`,new Map),x(this,`_edges`,new Map),x(this,`_directedSize`,0),x(this,`_undirectedSize`,0),x(this,`_directedSelfLoopCount`,0),x(this,`_undirectedSelfLoopCount`,0),x(this,`_edgeKeyGenerator`,i),x(this,`_options`,e),G.forEach(e=>x(this,e,this[e])),S(this,`order`,()=>this._nodes.size),S(this,`size`,()=>this._edges.size),S(this,`directedSize`,()=>this._directedSize),S(this,`undirectedSize`,()=>this._undirectedSize),S(this,`selfLoopCount`,()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),S(this,`directedSelfLoopCount`,()=>this._directedSelfLoopCount),S(this,`undirectedSelfLoopCount`,()=>this._undirectedSelfLoopCount),S(this,`multi`,this._options.multi),S(this,`type`,this._options.type),S(this,`allowSelfLoops`,this._options.allowSelfLoops),S(this,`implementation`,()=>`graphology`)}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(``+e)}hasDirectedEdge(e,t){if(this.type===`undirected`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&!n.undirected}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new D(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type===`directed`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&n.undirected}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new D(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){let t=``+e;return this._edges.has(t)}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out!==void 0&&n.out.hasOwnProperty(t)||n.undirected!==void 0&&n.undirected.hasOwnProperty(t):!1}throw new D(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type===`undirected`)return;if(e=``+e,t=``+t,this.multi)throw new k(`Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new O(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new O(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||void 0;if(r)return r.key}undirectedEdge(e,t){if(this.type===`directed`)return;if(e=``+e,t=``+t,this.multi)throw new k(`Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new O(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new O(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);let r=n.undirected&&n.undirected[t]||void 0;if(r)return r.key}edge(e,t){if(this.multi)throw new k(`Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.`);e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new O(`Graph.edge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.out}areInNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in}areUndirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`directed`?!1:t in n.undirected}areNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&(t in n.in||t in n.out)||this.type!==`directed`&&t in n.undirected}areInboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.in||this.type!==`directed`&&t in n.undirected}areOutboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.out||this.type!==`directed`&&t in n.undirected}inDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree}outDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree}directedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree}undirectedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree}inboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree),n}outboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.outDegree),n}degree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree,r+=t.directedLoops),n-r}outboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.outDegree,r+=t.directedLoops),n-r}degreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree,r+=t.directedLoops*2),n-r}source(e){e=``+e;let t=this._edges.get(e);if(!t)throw new O(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=``+e;let t=this._edges.get(e);if(!t)throw new O(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=``+e;let t=this._edges.get(e);if(!t)throw new O(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=``+e,t=``+t;let n=this._edges.get(t);if(!n)throw new O(`Graph.opposite: could not find the "${t}" edge in the graph.`);let r=n.source.key,i=n.target.key;if(e===r)return i;if(e===i)return r;throw new O(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${r}, ${i}).`)}hasExtremity(e,t){e=``+e,t=``+t;let n=this._edges.get(e);if(!n)throw new O(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new O(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new O(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=``+e;let t=this._edges.get(e);if(!t)throw new O(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return tt(this,e,t).key}mergeNode(e,t){if(t&&!y(t))throw new D(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=``+e,t||={};let n=this._nodes.get(e);return n?(t&&(_(n.attributes,t),this.emit(`nodeAttributesUpdated`,{type:`merge`,key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!=`function`)throw new D(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=``+e;let n=this._nodes.get(e);if(n){if(t){let r=n.attributes;n.attributes=t(r),this.emit(`nodeAttributesUpdated`,{type:`replace`,key:e,attributes:n.attributes})}return[e,!1]}let r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:r}),[e,!0]}dropNode(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!==`undirected`){for(let e in t.out){n=t.out[e];do J(this,n),n=n.next;while(n)}for(let e in t.in){n=t.in[e];do J(this,n),n=n.next;while(n)}}if(this.type!==`directed`)for(let e in t.undirected){n=t.undirected[e];do J(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit(`nodeDropped`,{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){let e=``+arguments[0],n=``+arguments[1];if(t=v(this,e,n,this.type),!t)throw new O(`Graph.dropEdge: could not find the "${e}" -> "${n}" edge in the graph.`)}else if(e=``+e,t=this._edges.get(e),!t)throw new O(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return J(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new k(`Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new k(`Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);e=``+e,t=``+t;let n=v(this,e,t,`directed`);if(!n)throw new O(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return J(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new k(`Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new k(`Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);let n=v(this,e,t,`undirected`);if(!n)throw new O(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return J(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit(`cleared`)}clearEdges(){let e=this._nodes.values(),t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit(`edgesCleared`)}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!=`function`)throw new D(`Graph.updateAttribute: updater should be a function.`);let n=this._attributes[e];return this._attributes[e]=t(n),this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit(`attributesUpdated`,{type:`remove`,attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!y(e))throw new D(`Graph.replaceAttributes: provided attributes are not a plain object.`);return this._attributes=e,this.emit(`attributesUpdated`,{type:`replace`,attributes:this._attributes}),this}mergeAttributes(e){if(!y(e))throw new D(`Graph.mergeAttributes: provided attributes are not a plain object.`);return _(this._attributes,e),this.emit(`attributesUpdated`,{type:`merge`,attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!=`function`)throw new D(`Graph.updateAttributes: provided updater is not a function.`);return this._attributes=e(this._attributes),this.emit(`attributesUpdated`,{type:`update`,attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!=`function`)throw new D(`Graph.updateEachNodeAttributes: expecting an updater function.`);if(t&&!C(t))throw new D(`Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,i.attributes=e(i.key,i.attributes);this.emit(`eachNodeAttributesUpdated`,{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!=`function`)throw new D(`Graph.updateEachEdgeAttributes: expecting an updater function.`);if(t&&!C(t))throw new D(`Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._edges.values(),r,i,a,o;for(;r=n.next(),r.done!==!0;)i=r.value,a=i.source,o=i.target,i.attributes=e(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected);this.emit(`eachEdgeAttributesUpdated`,{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!=`function`)throw new D(`Graph.forEachAdjacencyEntry: expecting a callback.`);W(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new D(`Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.`);W(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!=`function`)throw new D(`Graph.forEachAssymetricAdjacencyEntry: expecting a callback.`);W(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new D(`Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.`);W(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!=`function`)throw new D(`Graph.forEachNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)}findNode(e){if(typeof e!=`function`)throw new D(`Graph.findNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return r.key}mapNodes(e){if(typeof e!=`function`)throw new D(`Graph.mapNode: expecting a callback.`);let t=this._nodes.values(),n,r,i=Array(this.order),a=0;for(;n=t.next(),n.done!==!0;)r=n.value,i[a++]=e(r.key,r.attributes);return i}someNode(e){if(typeof e!=`function`)throw new D(`Graph.someNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return!0;return!1}everyNode(e){if(typeof e!=`function`)throw new D(`Graph.everyNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,!e(r.key,r.attributes))return!1;return!0}filterNodes(e){if(typeof e!=`function`)throw new D(`Graph.filterNodes: expecting a callback.`);let t=this._nodes.values(),n,r,i=[];for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)&&i.push(r.key);return i}reduceNodes(e,t){if(typeof e!=`function`)throw new D(`Graph.reduceNodes: expecting a callback.`);if(arguments.length<2)throw new D(`Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let n=t,r=this._nodes.values(),i,a;for(;i=r.next(),i.done!==!0;)a=i.value,n=e(n,a.key,a.attributes);return n}nodeEntries(){let e=this._nodes.values();return{[Symbol.iterator](){return this},next(){let t=e.next();if(t.done)return t;let n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){let e=Array(this._nodes.size),t=0;this._nodes.forEach((n,r)=>{e[t++]=qe(r,n)});let n=Array(this._edges.size);return t=0,this._edges.forEach((e,r)=>{n[t++]=Je(this.type,r,e)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(t,n=!1){if(t instanceof e)return t.forEachNode((e,t)=>{n?this.mergeNode(e,t):this.addNode(e,t)}),t.forEachEdge((e,t,r,i,a,o,s)=>{n?s?this.mergeUndirectedEdgeWithKey(e,r,i,t):this.mergeDirectedEdgeWithKey(e,r,i,t):s?this.addUndirectedEdgeWithKey(e,r,i,t):this.addDirectedEdgeWithKey(e,r,i,t)}),this;if(!y(t))throw new D(`Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.`);if(t.attributes){if(!y(t.attributes))throw new D(`Graph.import: invalid attributes. Expecting a plain object.`);n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,i,a,o,s;if(t.nodes){if(a=t.nodes,!Array.isArray(a))throw new D(`Graph.import: invalid nodes. Expecting an array.`);for(r=0,i=a.length;r<i;r++){o=a[r],Ye(o);let{key:e,attributes:t}=o;n?this.mergeNode(e,t):this.addNode(e,t)}}if(t.edges){let e=!1;if(this.type===`undirected`&&(e=!0),a=t.edges,!Array.isArray(a))throw new D(`Graph.import: invalid edges. Expecting an array.`);for(r=0,i=a.length;r<i;r++){s=a[r],Xe(s);let{source:t,target:i,attributes:o,undirected:c=e}=s,l;`key`in s?(l=n?c?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:c?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,l.call(this,s.key,t,i,o)):(l=n?c?this.mergeUndirectedEdge:this.mergeDirectedEdge:c?this.addUndirectedEdge:this.addDirectedEdge,l.call(this,t,i,o))}}return this}nullCopy(t){let n=new e(_({},this._options,t));return n.replaceAttributes(_({},this.getAttributes())),n}emptyCopy(e){let t=this.nullCopy(e);return this._nodes.forEach((e,n)=>{let r=_({},e.attributes);e=new t.NodeDataClass(n,r),t._nodes.set(n,e)}),t}copy(e){if(e||={},typeof e.type==`string`&&e.type!==this.type&&e.type!==`mixed`)throw new k(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi==`boolean`&&e.multi!==this.multi&&e.multi!==!0)throw new k(`Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.`);if(typeof e.allowSelfLoops==`boolean`&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new k(`Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.`);let t=this.emptyCopy(e),n=this._edges.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,q(t,`copy`,!1,i.undirected,i.key,i.source.key,i.target.key,_({},i.attributes));return t}toJSON(){return this.export()}toString(){return`[object Graph]`}inspect(){let e={};this._nodes.forEach((t,n)=>{e[n]=t.attributes});let t={},n={};this._edges.forEach((e,r)=>{let i=e.undirected?`--`:`->`,a=``,o=e.source.key,s=e.target.key,c;e.undirected&&o>s&&(c=o,o=s,s=c);let l=`(${o})${i}(${s})`;r.startsWith(`geid_`)?this.multi&&(n[l]===void 0?n[l]=0:n[l]++,a+=`${n[l]}. `):a+=`[${r}]: `,a+=l,t[a]=e.attributes});let r={};for(let e in this)this.hasOwnProperty(e)&&!G.has(e)&&typeof this[e]!=`function`&&typeof e!=`symbol`&&(r[e]=this[e]);return r.attributes=this._attributes,r.nodes=e,r.edges=t,x(r,`constructor`,this.constructor),r}};typeof Symbol<`u`&&(Y.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=Y.prototype.inspect),$e.forEach(e=>{[`add`,`merge`,`update`].forEach(t=>{let n=e.name(t),r=t===`add`?q:nt;e.generateKey?Y.prototype[n]=function(i,a,o){return r(this,n,!0,(e.type||this.type)===`undirected`,null,i,a,o,t===`update`)}:Y.prototype[n]=function(i,a,o,s){return r(this,n,!1,(e.type||this.type)===`undirected`,i,a,o,s,t===`update`)}})}),de(Y),Se(Y),Re(Y),Ke(Y);var X=class extends Y{constructor(e){let t=_({type:`directed`},e);if(`multi`in t&&t.multi!==!1)throw new D(`DirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`directed`)throw new D(`DirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},Z=class extends Y{constructor(e){let t=_({type:`undirected`},e);if(`multi`in t&&t.multi!==!1)throw new D(`UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`undirected`)throw new D(`UndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},rt=class extends Y{constructor(e){let t=_({multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new D(`MultiGraph.from: inconsistent indication that the graph should be simple in given options!`);super(t)}},it=class extends Y{constructor(e){let t=_({type:`directed`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new D(`MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`directed`)throw new D(`MultiDirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},Q=class extends Y{constructor(e){let t=_({type:`undirected`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new D(`MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`undirected`)throw new D(`MultiUndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}};function $(e){e.from=function(t,n){let r=new e(_({},t.options,n));return r.import(t),r}}$(Y),$(X),$(Z),$(rt),$(it),$(Q),Y.Graph=Y,Y.DirectedGraph=X,Y.UndirectedGraph=Z,Y.MultiGraph=rt,Y.MultiDirectedGraph=it,Y.MultiUndirectedGraph=Q,Y.InvalidArgumentsGraphError=D,Y.NotFoundGraphError=O,Y.UsageGraphError=k;export{Y as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./@ungap/structured-clone.mjs";const t=r(`end`),n=r(`start`);function r(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function i(e){let r=n(e),i=t(e);if(r&&i)return{start:r,end:i}}const a=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],o={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...a,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...a],h2:[[`className`,`sr-only`]],img:[...a,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...a,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...a],table:[...a],ul:[...a,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},s={}.hasOwnProperty;function c(e,t){let n={type:`root`,children:[]},r=l({schema:t?{...o,...t}:o,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function l(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return u(e,n);case`doctype`:return d(e,n);case`element`:return f(e,n);case`root`:return p(e,n);case`text`:return m(e,n);default:}}}function u(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return x(r,t),r}}function d(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return x(e,t),e}}function f(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=h(e,t.children),i=g(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&s.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return x(o,t),o}function p(e,t){let n={type:`root`,children:h(e,t.children)};return x(n,t),n}function m(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return x(n,t),n}function h(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=l(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function g(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&s.call(r,n)?r[n]:void 0,o=r&&s.call(r,`*`)?r[`*`]:void 0,c=t&&typeof t==`object`?t:{},l={},u;for(u in c)if(s.call(c,u)){let t=c[u],n=_(e,S(a,u),u,t);n??=_(e,S(o,u),u,t),n!=null&&(l[u]=n)}if(i&&s.call(i,n)){let e=i[n];for(u in e)s.call(e,u)&&!s.call(l,u)&&(l[u]=e[u])}return l}function _(e,t,n,r){return t?Array.isArray(r)?v(e,t,n,r):y(e,t,n,r):void 0}function v(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=y(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function y(e,t,n,r){if(!(typeof r!=`boolean`&&typeof r!=`number`&&typeof r!=`string`)&&b(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function b(e,t,n){let r=e.schema.protocols&&s.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),c=i.indexOf(`#`),l=i.indexOf(`/`);if(a<0||l>-1&&a>l||o>-1&&a>o||c>-1&&a>c)return!0;let u=-1;for(;++u<r.length;){let e=r[u];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function x(t,n){let r=i(n);n.data&&(t.data=e(n.data)),r&&(t.position=r)}function S(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}export{i as a,n as i,o as n,t as r,c as t};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{n as e}from"../rolldown-runtime.mjs";import{t}from"./character-entities-legacy.mjs";import{t as n}from"./character-entities-html4.mjs";import{t as r}from"./ccount.mjs";import{t as i}from"./comma-separated-tokens.mjs";const a=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`];var o=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};o.prototype.normal={},o.prototype.property={},o.prototype.space=void 0;function s(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new o(n,r,t)}function c(e){return e.toLowerCase()}var l=class{constructor(e,t){this.attribute=t,this.property=e}};l.prototype.attribute=``,l.prototype.booleanish=!1,l.prototype.boolean=!1,l.prototype.commaOrSpaceSeparated=!1,l.prototype.commaSeparated=!1,l.prototype.defined=!1,l.prototype.mustUseProperty=!1,l.prototype.number=!1,l.prototype.overloadedBoolean=!1,l.prototype.property=``,l.prototype.spaceSeparated=!1,l.prototype.space=void 0;var u=e({boolean:()=>d,booleanish:()=>f,commaOrSpaceSeparated:()=>_,commaSeparated:()=>g,number:()=>m,overloadedBoolean:()=>p,spaceSeparated:()=>h});let ee=0;const d=v(),f=v(),p=v(),m=v(),h=v(),g=v(),_=v();function v(){return 2**++ee}const y=Object.keys(u);var b=class extends l{constructor(e,t,n,r){let i=-1;if(super(e,t),x(this,`space`,r),typeof n==`number`)for(;++i<y.length;){let e=y[i];x(this,y[i],(n&u[e])===u[e])}}};b.prototype.defined=!0;function x(e,t,n){n&&(e[t]=n)}function S(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new b(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[c(r)]=r,n[c(a.attribute)]=r}return new o(t,n,e.space)}const C=S({properties:{ariaActiveDescendant:null,ariaAtomic:f,ariaAutoComplete:null,ariaBusy:f,ariaChecked:f,ariaColCount:m,ariaColIndex:m,ariaColSpan:m,ariaControls:h,ariaCurrent:null,ariaDescribedBy:h,ariaDetails:null,ariaDisabled:f,ariaDropEffect:h,ariaErrorMessage:null,ariaExpanded:f,ariaFlowTo:h,ariaGrabbed:f,ariaHasPopup:null,ariaHidden:f,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:h,ariaLevel:m,ariaLive:null,ariaModal:f,ariaMultiLine:f,ariaMultiSelectable:f,ariaOrientation:null,ariaOwns:h,ariaPlaceholder:null,ariaPosInSet:m,ariaPressed:f,ariaReadOnly:f,ariaRelevant:null,ariaRequired:f,ariaRoleDescription:h,ariaRowCount:m,ariaRowIndex:m,ariaRowSpan:m,ariaSelected:f,ariaSetSize:m,ariaSort:null,ariaValueMax:m,ariaValueMin:m,ariaValueNow:m,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function w(e,t){return t in e?e[t]:t}function T(e,t){return w(e,t.toLowerCase())}const te=S({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:g,acceptCharset:h,accessKey:h,action:null,allow:null,allowFullScreen:d,allowPaymentRequest:d,allowUserMedia:d,alt:null,as:null,async:d,autoCapitalize:null,autoComplete:h,autoFocus:d,autoPlay:d,blocking:h,capture:null,charSet:null,checked:d,cite:null,className:h,cols:m,colSpan:null,content:null,contentEditable:f,controls:d,controlsList:h,coords:m|g,crossOrigin:null,data:null,dateTime:null,decoding:null,default:d,defer:d,dir:null,dirName:null,disabled:d,download:p,draggable:f,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:d,formTarget:null,headers:h,height:m,hidden:d,high:m,href:null,hrefLang:null,htmlFor:h,httpEquiv:h,id:null,imageSizes:null,imageSrcSet:null,inert:d,inputMode:null,integrity:null,is:null,isMap:d,itemId:null,itemProp:h,itemRef:h,itemScope:d,itemType:h,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:d,low:m,manifest:null,max:null,maxLength:m,media:null,method:null,min:null,minLength:m,multiple:d,muted:d,name:null,nonce:null,noModule:d,noValidate:d,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:d,optimum:m,pattern:null,ping:h,placeholder:null,playsInline:d,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:d,referrerPolicy:null,rel:h,required:d,reversed:d,rows:m,rowSpan:m,sandbox:h,scope:null,scoped:d,seamless:d,selected:d,shadowRootClonable:d,shadowRootDelegatesFocus:d,shadowRootMode:null,shape:null,size:m,sizes:null,slot:null,span:m,spellCheck:f,src:null,srcDoc:null,srcLang:null,srcSet:null,start:m,step:null,style:null,tabIndex:m,target:null,title:null,translate:null,type:null,typeMustMatch:d,useMap:null,value:f,width:m,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:h,axis:null,background:null,bgColor:null,border:m,borderColor:null,bottomMargin:m,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:d,declare:d,event:null,face:null,frame:null,frameBorder:null,hSpace:m,leftMargin:m,link:null,longDesc:null,lowSrc:null,marginHeight:m,marginWidth:m,noResize:d,noHref:d,noShade:d,noWrap:d,object:null,profile:null,prompt:null,rev:null,rightMargin:m,rules:null,scheme:null,scrolling:f,standby:null,summary:null,text:null,topMargin:m,valueType:null,version:null,vAlign:null,vLink:null,vSpace:m,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:d,disableRemotePlayback:d,prefix:null,property:null,results:m,security:null,unselectable:null},space:`html`,transform:T}),ne=S({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:_,accentHeight:m,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:m,amplitude:m,arabicForm:null,ascent:m,attributeName:null,attributeType:null,azimuth:m,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:m,by:null,calcMode:null,capHeight:m,className:h,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:m,diffuseConstant:m,direction:null,display:null,dur:null,divisor:m,dominantBaseline:null,download:d,dx:null,dy:null,edgeMode:null,editable:null,elevation:m,enableBackground:null,end:null,event:null,exponent:m,externalResourcesRequired:null,fill:null,fillOpacity:m,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:g,g2:g,glyphName:g,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:m,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:m,horizOriginX:m,horizOriginY:m,id:null,ideographic:m,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:m,k:m,k1:m,k2:m,k3:m,k4:m,kernelMatrix:_,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:m,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:m,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:m,overlineThickness:m,paintOrder:null,panose1:null,path:null,pathLength:m,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:h,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:m,pointsAtY:m,pointsAtZ:m,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:_,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:_,rev:_,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:_,requiredFeatures:_,requiredFonts:_,requiredFormats:_,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:m,specularExponent:m,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:m,strikethroughThickness:m,string:null,stroke:null,strokeDashArray:_,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:m,strokeOpacity:m,strokeWidth:null,style:null,surfaceScale:m,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:_,tabIndex:m,tableValues:null,target:null,targetX:m,targetY:m,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:_,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:m,underlineThickness:m,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:m,values:null,vAlphabetic:m,vMathematical:m,vectorEffect:null,vHanging:m,vIdeographic:m,version:null,vertAdvY:m,vertOriginX:m,vertOriginY:m,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:m,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:w}),E=S({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),D=S({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:T}),O=S({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),re=/[A-Z]/g,k=/-[a-z]/g,ie=/^data[-\w.:]+$/i;function ae(e,t){let n=c(t),r=t,i=l;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ie.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(k,se);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!k.test(e)){let n=e.replace(re,oe);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=b}return new i(r,t)}function oe(e){return`-`+e.toLowerCase()}function se(e){return e.charAt(1).toUpperCase()}const ce=s([C,te,E,D,O],`html`),A=s([C,ne,E,D,O],`svg`),j={}.hasOwnProperty;function le(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&j.call(t,e)){let n=String(t[e]);i=j.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const ue=/["&'<>`]/g,de=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,fe=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,pe=/[|\\{}()[\]^$+*?.]/g,M=new WeakMap;function me(e,t){if(e=e.replace(t.subset?he(t.subset):ue,r),t.subset||t.escapeOnly)return e;return e.replace(de,n).replace(fe,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function he(e){let t=M.get(e);return t||(t=ge(e),M.set(e,t)),t}function ge(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(pe,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}const _e=/[\dA-Fa-f]/;function N(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!_e.test(String.fromCharCode(t))?r:r+`;`}const P=/\d/;function F(e,t,n){let r=`&#`+String(e);return n&&t&&!P.test(String.fromCharCode(t))?r:r+`;`}const I=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],L={}.hasOwnProperty,R={};let z;for(z in n)L.call(n,z)&&(R[n[z]]=z);const ve=/[^\dA-Za-z]/;function ye(e,n,r,i){let a=String.fromCharCode(e);if(L.call(R,a)){let e=R[a],o=`&`+e;return r&&t.includes(e)&&!I.includes(e)&&(!i||n&&n!==61&&ve.test(String.fromCharCode(n)))?o:o+`;`}return``}function be(e,t,n){let r=N(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=ye(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=F(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function B(e,t){return me(e,Object.assign({format:be},t))}const xe=/^>|^->|<!--|-->|--!>|<!-$/g,Se=[`>`],Ce=[`<`,`>`];function we(e,t,n,r){return r.settings.bogusComments?`<?`+B(e.value,Object.assign({},r.settings.characterReferences,{subset:Se}))+`>`:`<!--`+e.value.replace(xe,i)+`-->`;function i(e){return B(e,Object.assign({},r.settings.characterReferences,{subset:Ce}))}}function Te(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function Ee(e){return e.join(` `).trim()}const De=/[ \t\n\f\r]/g;function V(e){return typeof e==`object`?e.type===`text`?H(e.value):!1:H(e)}function H(e){return e.replace(De,``)===``}const U=G(1),W=G(-1),Oe=[];function G(e){return t;function t(t,n,r){let i=t?t.children:Oe,a=(n||0)+e,o=i[a];if(!r)for(;o&&V(o);)a+=e,o=i[a];return o}}const ke={}.hasOwnProperty;function K(e){return t;function t(t,n,r){return ke.call(e,t.tagName)&&e[t.tagName](t,n,r)}}const q=K({body:je,caption:J,colgroup:J,dd:Fe,dt:Pe,head:J,html:Ae,li:Ne,optgroup:Ie,option:Le,p:Me,rp:Y,rt:Y,tbody:ze,td:X,tfoot:Be,th:X,thead:Re,tr:Ve});function J(e,t,n){let r=U(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&V(r.value.charAt(0)))}function Ae(e,t,n){let r=U(n,t);return!r||r.type!==`comment`}function je(e,t,n){let r=U(n,t);return!r||r.type!==`comment`}function Me(e,t,n){let r=U(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function Ne(e,t,n){let r=U(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Pe(e,t,n){let r=U(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function Fe(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function Y(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Ie(e,t,n){let r=U(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Le(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Re(e,t,n){let r=U(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function ze(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Be(e,t,n){return!U(n,t)}function Ve(e,t,n){let r=U(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function X(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}const He=K({body:Ge,colgroup:Ke,head:We,html:Ue,tbody:qe});function Ue(e){let t=U(e,-1);return!t||t.type!==`comment`}function We(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Ge(e){let t=U(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&V(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function Ke(e,t,n){let r=W(n,t),i=U(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&q(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function qe(e,t,n){let r=W(n,t),i=U(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&q(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}const Z={name:[[`
|
|
2
|
-
\f\r &/=>`.split(``),`
|
|
3
|
-
\f\r "&'/=>\``.split(``)],[`\0
|
|
4
|
-
\f\r "&'/<=>`.split(``),`\0
|
|
5
|
-
\f\r "&'/<=>\``.split(``)]],unquoted:[[`
|
|
6
|
-
\f\r &>`.split(``),`\0
|
|
7
|
-
\f\r "&'<=>\``.split(``)],[`\0
|
|
8
|
-
\f\r "&'<=>\``.split(``),`\0
|
|
9
|
-
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Je(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=A);let l=Ye(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!He(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!q(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Ye(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Q(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Q(e,t,n){let a=ae(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,s=+!e.settings.allowDangerousCharacters,c=e.quote,l;if(a.overloadedBoolean&&(n===a.attribute||n===``)?n=!0:(a.boolean||a.overloadedBoolean)&&(typeof n!=`string`||n===a.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let u=B(a.attribute,Object.assign({},e.settings.characterReferences,{subset:Z.name[o][s]}));return n===!0||(n=Array.isArray(n)?(a.commaSeparated?i:Ee)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?u:(e.settings.preferUnquoted&&(l=B(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Z.unquoted[o][s]}))),l!==n&&(e.settings.quoteSmart&&r(n,c)>r(n,e.alternative)&&(c=e.alternative),l=c+B(n,Object.assign({},e.settings.characterReferences,{subset:(c===`'`?Z.single:Z.double)[o][s],attribute:!0}))+c),u+(l&&`=`+l))}const Xe=[`<`,`&`];function $(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:B(e.value,Object.assign({},r.settings.characterReferences,{subset:Xe}))}function Ze(e,t,n,r){return r.settings.allowDangerousHtml?e.value:$(e,t,n,r)}function Qe(e,t,n,r){return r.all(e)}const $e=le(`type`,{invalid:et,unknown:tt,handlers:{comment:we,doctype:Te,element:Je,raw:Ze,root:Qe,text:$}});function et(e){throw Error("Expected node, not `"+e+"`")}function tt(e){throw Error("Cannot compile unknown node `"+e.type+"`")}const nt={},rt={},it=[];function at(e,t){let n=t||nt,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:ot,all:st,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||a,characterReferences:n.characterReferences||rt,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?A:ce,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function ot(e,t,n){return $e(e,t,n,this)}function st(e){let t=[],n=e&&e.children||it,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}export{at as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}export{e as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}export{e as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function e(e){return e.length}function t(t,i){let a=i||{},o=(a.align||[]).concat(),s=a.stringLength||e,c=[],l=[],u=[],d=[],f=0,p=-1;for(;++p<t.length;){let e=[],r=[],i=-1;for(t[p].length>f&&(f=t[p].length);++i<t[p].length;){let o=n(t[p][i]);if(a.alignDelimiters!==!1){let e=s(o);r[i]=e,(d[i]===void 0||e>d[i])&&(d[i]=e)}e.push(o)}l[p]=e,u[p]=r}let m=-1;if(typeof o==`object`&&`length`in o)for(;++m<f;)c[m]=r(o[m]);else{let e=r(o);for(;++m<f;)c[m]=e}m=-1;let h=[],g=[];for(;++m<f;){let e=c[m],t=``,n=``;e===99?(t=`:`,n=`:`):e===108?t=`:`:e===114&&(n=`:`);let r=a.alignDelimiters===!1?1:Math.max(1,d[m]-t.length-n.length),i=t+`-`.repeat(r)+n;a.alignDelimiters!==!1&&(r=t.length+r+n.length,r>d[m]&&(d[m]=r),g[m]=r),h[m]=i}l.splice(1,0,h),u.splice(1,0,g),p=-1;let _=[];for(;++p<l.length;){let e=l[p],t=u[p];m=-1;let n=[];for(;++m<f;){let r=e[m]||``,i=``,o=``;if(a.alignDelimiters!==!1){let e=d[m]-(t[m]||0),n=c[m];n===114?i=` `.repeat(e):n===99?e%2?(i=` `.repeat(e/2+.5),o=` `.repeat(e/2-.5)):(i=` `.repeat(e/2),o=i):o=` `.repeat(e)}a.delimiterStart!==!1&&!m&&n.push(`|`),a.padding!==!1&&!(a.alignDelimiters===!1&&r===``)&&(a.delimiterStart!==!1||m)&&n.push(` `),a.alignDelimiters!==!1&&n.push(i),n.push(r),a.alignDelimiters!==!1&&n.push(o),a.padding!==!1&&n.push(` `),(a.delimiterEnd!==!1||m!==f-1)&&n.push(`|`)}_.push(a.delimiterEnd===!1?n.join(``).replace(/ +$/,``):n.join(``))}return _.join(`
|
|
2
|
-
`)}function n(e){return e==null?``:String(e)}function r(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./escape-string-regexp.mjs";const t=(function(e){if(e==null)return o;if(typeof e==`function`)return a(e);if(typeof e==`object`)return Array.isArray(e)?n(e):r(e);if(typeof e==`string`)return i(e);throw Error(`Expected function, string, or object as test`)});function n(e){let n=[],r=-1;for(;++r<e.length;)n[r]=t(e[r]);return a(i);function i(...e){let t=-1;for(;++t<n.length;)if(n[t].apply(this,e))return!0;return!1}}function r(e){let t=e;return a(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function i(e){return a(t);function t(t){return t&&t.type===e}}function a(e){return t;function t(t,n,r){return!!(s(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function o(){return!0}function s(e){return typeof e==`object`&&!!e&&`type`in e}function c(e){return e}const l=[];function u(e,n,r,i){let a;typeof n==`function`&&typeof r!=`function`?(i=r,r=n):a=n;let o=t(a),s=i?-1:1;u(e,void 0,[])();function u(e,t,a){let f=e&&typeof e==`object`?e:{};if(typeof f.type==`string`){let t=typeof f.tagName==`string`?f.tagName:typeof f.name==`string`?f.name:void 0;Object.defineProperty(p,"name",{value:`node (`+c(e.type+(t?`<`+t+`>`:``))+`)`})}return p;function p(){let c=l,f,p,m;if((!n||o(e,t,a[a.length-1]||void 0))&&(c=d(r(e,a)),c[0]===!1))return c;if(`children`in e&&e.children){let t=e;if(t.children&&c[0]!==`skip`)for(p=(i?t.children.length:-1)+s,m=a.concat(t);p>-1&&p<t.children.length;){let e=t.children[p];if(f=u(e,p,m)(),f[0]===!1)return f;p=typeof f[1]==`number`?f[1]:p+s}}return c}}}function d(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?l:[e]}function f(e,n,r){let i=t((r||{}).ignore||[]),a=p(n),o=-1;for(;++o<a.length;)u(e,`text`,s);function s(e,t){let n=-1,r;for(;++n<t.length;){let e=t[n],a=r?r.children:void 0;if(i(e,a?a.indexOf(e):void 0,r))return;r=e}if(r)return c(e,t)}function c(e,t){let n=t[t.length-1],r=a[o][0],i=a[o][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,a={index:d.index,input:d.input,stack:[...t,e]},o=i(...d,a);if(typeof o==`string`&&(o=o.length>0?{type:`text`,value:o}:void 0),o===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(o)?u.push(...o):o&&u.push(o),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function p(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([m(e[0]),h(e[1])])}return t}function m(t){return typeof t==`string`?new RegExp(e(t),`g`):t}function h(e){return typeof e==`function`?e:function(){return e}}export{u as n,t as r,f as t};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e}from"../rolldown-runtime.mjs";import{t}from"./decode-named-character-reference.mjs";const n=m(/[A-Za-z]/),r=m(/[\dA-Za-z]/),i=m(/[#-'*+\--9=?A-Z^-~]/);function a(e){return e!==null&&(e<32||e===127)}const o=m(/\d/),s=m(/[\dA-Fa-f]/),c=m(/[!-/:-@[-`{-~]/);function l(e){return e!==null&&e<-2}function u(e){return e!==null&&(e<0||e===32)}function d(e){return e===-2||e===-1||e===32}const f=m(/\p{P}|\p{S}/u),p=m(/\s/);function m(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function h(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}function g(e){if(e===null||u(e)||p(e))return 1;if(f(e))return 2}const _={};function v(e,t){let n=t||_;return y(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function y(e,t,n){if(x(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return b(e.children,t,n)}return Array.isArray(e)?b(e,t,n):``}function b(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=y(e[i],t,n);return r.join(``)}function x(e){return!!(e&&typeof e==`object`)}function S(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}const C=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function w(e){return e.replace(C,T)}function T(e,n,r){if(n)return n;if(r.charCodeAt(0)===35){let e=r.charCodeAt(1),t=e===120||e===88;return S(r.slice(t?2:1),t?16:10)}return t(r)||e}function E(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function D(e,t){return e.length>0?(E(e,e.length,0,t),e):t}const O={}.hasOwnProperty;function k(e){let t={},n=-1;for(;++n<e.length;)A(t,e[n]);return t}function A(e,t){let n;for(n in t){let r=(O.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){O.call(r,a)||(r[a]=[]);let e=i[a];j(r[a],Array.isArray(e)?e:e?[e]:[])}}}function j(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);E(e,0,0,r)}function M(e){let t=[],n=-1,i=0,a=0;for(;++n<e.length;){let o=e.charCodeAt(n),s=``;if(o===37&&r(e.charCodeAt(n+1))&&r(e.charCodeAt(n+2)))a=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){let t=e.charCodeAt(n+1);o<56320&&t>56319&&t<57344?(s=String.fromCharCode(o,t),a=1):s=`�`}else s=String.fromCharCode(o);s&&=(t.push(e.slice(i,n),encodeURIComponent(s)),i=n+a+1,``),a&&=(n+=a,0)}return t.join(``)+e.slice(i)}function N(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const P={name:`attention`,resolveAll:F,tokenize:I};function F(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};L(d,-c),L(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=D(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=D(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=D(l,N(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=D(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=D(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,E(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function I(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=g(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=g(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function L(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const R={name:`autolink`,tokenize:z};function z(e,t,o){let s=0;return c;function c(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),l}function l(t){return n(t)?(e.consume(t),u):t===64?o(t):p(t)}function u(e){return e===43||e===45||e===46||r(e)?(s=1,d(e)):p(e)}function d(t){return t===58?(e.consume(t),s=0,f):(t===43||t===45||t===46||r(t))&&s++<32?(e.consume(t),d):(s=0,p(t))}function f(n){return n===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):n===null||n===32||n===60||a(n)?o(n):(e.consume(n),f)}function p(t){return t===64?(e.consume(t),m):i(t)?(e.consume(t),p):o(t)}function m(e){return r(e)?h(e):o(e)}function h(n){return n===46?(e.consume(n),s=0,m):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):g(n)}function g(t){if((t===45||r(t))&&s++<63){let n=t===45?g:h;return e.consume(t),n}return o(t)}}function B(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return d(r)?(e.enter(n),s(r)):t(r)}function s(r){return d(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const V={partial:!0,tokenize:H};function H(e,t,n){return r;function r(t){return d(t)?B(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||l(e)?t(e):n(e)}}const U={continuation:{tokenize:te},exit:W,name:`blockQuote`,tokenize:ee};function ee(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return d(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function te(e,t,n){let r=this;return i;function i(t){return d(t)?B(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(U,t,n)(r)}}function W(e){e.exit(`blockQuote`)}const ne={name:`characterEscape`,tokenize:re};function re(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return c(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const G={name:`characterReference`,tokenize:ie};function ie(e,n,i){let a=this,c=0,l,u;return d;function d(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),f}function f(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),p):(e.enter(`characterReferenceValue`),l=31,u=r,m(t))}function p(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),l=6,u=s,m):(e.enter(`characterReferenceValue`),l=7,u=o,m(t))}function m(o){if(o===59&&c){let s=e.exit(`characterReferenceValue`);return u===r&&!t(a.sliceSerialize(s))?i(o):(e.enter(`characterReferenceMarker`),e.consume(o),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),n)}return u(o)&&c++<l?(e.consume(o),m):i(o)}}const ae={partial:!0,tokenize:se},K={concrete:!0,name:`codeFenced`,tokenize:oe};function oe(e,t,n){let r=this,i={partial:!0,tokenize:C},a=0,o=0,s;return c;function c(e){return u(e)}function u(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),f(t)}function f(t){return t===s?(o++,e.consume(t),f):o<3?n(t):(e.exit(`codeFencedFenceSequence`),d(t)?B(e,p,`whitespace`)(t):p(t))}function p(n){return n===null||l(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(ae,_,S)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),m(n))}function m(t){return t===null||l(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),p(t)):d(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),B(e,h,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return t===null||l(t)?p(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),g(t))}function g(t){return t===null||l(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),p(t)):t===96&&t===s?n(t):(e.consume(t),g)}function _(t){return e.attempt(i,S,v)(t)}function v(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),y}function y(t){return a>0&&d(t)?B(e,b,`linePrefix`,a+1)(t):b(t)}function b(t){return t===null||l(t)?e.check(ae,_,S)(t):(e.enter(`codeFlowValue`),x(t))}function x(t){return t===null||l(t)?(e.exit(`codeFlowValue`),b(t)):(e.consume(t),x)}function S(n){return e.exit(`codeFenced`),t(n)}function C(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),d(t)?B(e,u,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):u(t)}function u(t){return t===s?(e.enter(`codeFencedFenceSequence`),f(t)):n(t)}function f(t){return t===s?(i++,e.consume(t),f):i>=o?(e.exit(`codeFencedFenceSequence`),d(t)?B(e,p,`whitespace`)(t):p(t)):n(t)}function p(r){return r===null||l(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function se(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const q={name:`codeIndented`,tokenize:le},ce={partial:!0,tokenize:ue};function le(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),B(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):l(t)?e.attempt(ce,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||l(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function ue(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):l(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):B(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):l(e)?i(e):n(e)}}const de={name:`codeText`,previous:pe,resolve:fe,tokenize:me};function fe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function pe(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function me(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,d(t)):l(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),u(t))}function u(t){return t===null||t===32||t===96||l(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),u)}function d(n){return n===96?(e.consume(n),i++,d):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,u(n))}}var he=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&J(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),J(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),J(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);J(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);J(this.left,t.reverse())}}};function J(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ge(e){let t={},n=-1,r,i,a,o,s,c,l,u=new he(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,_e(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return E(e,0,1/0,u.slice(0)),!l}function _e(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const ve={resolve:be,tokenize:xe},ye={partial:!0,tokenize:Se};function be(e){return ge(e),e}function xe(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):l(t)?e.check(ye,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Se(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),B(e,a,`linePrefix`)}function a(i){if(i===null||l(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Ce(e,t,n,r,i,o,s,c,d){let f=d||1/0,p=0;return m;function m(t){return t===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(t),e.exit(o),h):t===null||t===32||t===41||a(t)?n(t):(e.enter(r),e.enter(s),e.enter(c),e.enter(`chunkString`,{contentType:`string`}),v(t))}function h(n){return n===62?(e.enter(o),e.consume(n),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(c),e.enter(`chunkString`,{contentType:`string`}),g(n))}function g(t){return t===62?(e.exit(`chunkString`),e.exit(c),h(t)):t===null||t===60||l(t)?n(t):(e.consume(t),t===92?_:g)}function _(t){return t===60||t===62||t===92?(e.consume(t),g):g(t)}function v(i){return!p&&(i===null||i===41||u(i))?(e.exit(`chunkString`),e.exit(c),e.exit(s),e.exit(r),t(i)):p<f&&i===40?(e.consume(i),p++,v):i===41?(e.consume(i),p--,v):i===null||i===32||i===40||a(i)?n(i):(e.consume(i),i===92?y:v)}function y(t){return t===40||t===41||t===92?(e.consume(t),v):v(t)}}function we(e,t,n,r,i,a){let o=this,s=0,c;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),f}function f(u){return s>999||u===null||u===91||u===93&&!c||u===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(u):u===93?(e.exit(a),e.enter(i),e.consume(u),e.exit(i),e.exit(r),t):l(u)?(e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),f):(e.enter(`chunkString`,{contentType:`string`}),p(u))}function p(t){return t===null||t===91||t===93||l(t)||s++>999?(e.exit(`chunkString`),f(t)):(e.consume(t),c||=!d(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}}function Te(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),u(n))}function u(t){return t===o?(e.exit(a),c(o)):t===null?n(t):l(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),B(e,u,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),d(t))}function d(t){return t===o||t===null||l(t)?(e.exit(`chunkString`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===o||t===92?(e.consume(t),d):d(t)}}function Y(e,t){let n;return r;function r(i){return l(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):d(i)?B(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const Ee={name:`definition`,tokenize:Oe},De={partial:!0,tokenize:ke};function Oe(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return we.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=h(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return u(t)?Y(e,f)(t):f(t)}function f(t){return Ce(e,p,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function p(t){return e.attempt(De,m,m)(t)}function m(t){return d(t)?B(e,g,`whitespace`)(t):g(t)}function g(a){return a===null||l(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function ke(e,t,n){return r;function r(t){return u(t)?Y(e,i)(t):n(t)}function i(t){return Te(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return d(t)?B(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||l(e)?t(e):n(e)}}const Ae={name:`hardBreakEscape`,tokenize:je};function je(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return l(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const Me={name:`headingAtx`,resolve:Ne,tokenize:Pe};function Ne(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},E(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Pe(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||u(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||l(n)?(e.exit(`atxHeading`),t(n)):d(n)?B(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),f(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function f(t){return t===null||t===35||u(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),f)}}const Fe=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Ie=[`pre`,`script`,`style`,`textarea`],Le={concrete:!0,name:`htmlFlow`,resolveTo:Be,tokenize:Ve},Re={partial:!0,tokenize:Ue},ze={partial:!0,tokenize:He};function Be(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ve(e,t,i){let a=this,o,s,c,f,p;return m;function m(e){return h(e)}function h(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),g}function g(r){return r===33?(e.consume(r),_):r===47?(e.consume(r),s=!0,b):r===63?(e.consume(r),o=3,a.interrupt?t:V):n(r)?(e.consume(r),c=String.fromCharCode(r),x):i(r)}function _(r){return r===45?(e.consume(r),o=2,v):r===91?(e.consume(r),o=5,f=0,y):n(r)?(e.consume(r),o=4,a.interrupt?t:V):i(r)}function v(n){return n===45?(e.consume(n),a.interrupt?t:V):i(n)}function y(n){return n===`CDATA[`.charCodeAt(f++)?(e.consume(n),f===6?a.interrupt?t:N:y):i(n)}function b(t){return n(t)?(e.consume(t),c=String.fromCharCode(t),x):i(t)}function x(n){if(n===null||n===47||n===62||u(n)){let r=n===47,l=c.toLowerCase();return!r&&!s&&Ie.includes(l)?(o=1,a.interrupt?t(n):N(n)):Fe.includes(c.toLowerCase())?(o=6,r?(e.consume(n),S):a.interrupt?t(n):N(n)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?i(n):s?C(n):w(n))}return n===45||r(n)?(e.consume(n),c+=String.fromCharCode(n),x):i(n)}function S(n){return n===62?(e.consume(n),a.interrupt?t:N):i(n)}function C(t){return d(t)?(e.consume(t),C):j(t)}function w(t){return t===47?(e.consume(t),j):t===58||t===95||n(t)?(e.consume(t),T):d(t)?(e.consume(t),w):j(t)}function T(t){return t===45||t===46||t===58||t===95||r(t)?(e.consume(t),T):E(t)}function E(t){return t===61?(e.consume(t),D):d(t)?(e.consume(t),E):w(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?i(t):t===34||t===39?(e.consume(t),p=t,O):d(t)?(e.consume(t),D):k(t)}function O(t){return t===p?(e.consume(t),p=null,A):t===null||l(t)?i(t):(e.consume(t),O)}function k(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||u(t)?E(t):(e.consume(t),k)}function A(e){return e===47||e===62||d(e)?w(e):i(e)}function j(t){return t===62?(e.consume(t),M):i(t)}function M(t){return t===null||l(t)?N(t):d(t)?(e.consume(t),M):i(t)}function N(t){return t===45&&o===2?(e.consume(t),L):t===60&&o===1?(e.consume(t),R):t===62&&o===4?(e.consume(t),H):t===63&&o===3?(e.consume(t),V):t===93&&o===5?(e.consume(t),B):l(t)&&(o===6||o===7)?(e.exit(`htmlFlowData`),e.check(Re,U,P)(t)):t===null||l(t)?(e.exit(`htmlFlowData`),P(t)):(e.consume(t),N)}function P(t){return e.check(ze,F,U)(t)}function F(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),I}function I(t){return t===null||l(t)?P(t):(e.enter(`htmlFlowData`),N(t))}function L(t){return t===45?(e.consume(t),V):N(t)}function R(t){return t===47?(e.consume(t),c=``,z):N(t)}function z(t){if(t===62){let n=c.toLowerCase();return Ie.includes(n)?(e.consume(t),H):N(t)}return n(t)&&c.length<8?(e.consume(t),c+=String.fromCharCode(t),z):N(t)}function B(t){return t===93?(e.consume(t),V):N(t)}function V(t){return t===62?(e.consume(t),H):t===45&&o===2?(e.consume(t),V):N(t)}function H(t){return t===null||l(t)?(e.exit(`htmlFlowData`),U(t)):(e.consume(t),H)}function U(n){return e.exit(`htmlFlow`),t(n)}}function He(e,t,n){let r=this;return i;function i(t){return l(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Ue(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(V,t,n)}}const We={name:`htmlText`,tokenize:Ge};function Ge(e,t,i){let a=this,o,s,c;return f;function f(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),p}function p(t){return t===33?(e.consume(t),m):t===47?(e.consume(t),E):t===63?(e.consume(t),w):n(t)?(e.consume(t),k):i(t)}function m(t){return t===45?(e.consume(t),h):t===91?(e.consume(t),s=0,y):n(t)?(e.consume(t),C):i(t)}function h(t){return t===45?(e.consume(t),v):i(t)}function g(t){return t===null?i(t):t===45?(e.consume(t),_):l(t)?(c=g,R(t)):(e.consume(t),g)}function _(t){return t===45?(e.consume(t),v):g(t)}function v(e){return e===62?L(e):e===45?_(e):g(e)}function y(t){return t===`CDATA[`.charCodeAt(s++)?(e.consume(t),s===6?b:y):i(t)}function b(t){return t===null?i(t):t===93?(e.consume(t),x):l(t)?(c=b,R(t)):(e.consume(t),b)}function x(t){return t===93?(e.consume(t),S):b(t)}function S(t){return t===62?L(t):t===93?(e.consume(t),S):b(t)}function C(t){return t===null||t===62?L(t):l(t)?(c=C,R(t)):(e.consume(t),C)}function w(t){return t===null?i(t):t===63?(e.consume(t),T):l(t)?(c=w,R(t)):(e.consume(t),w)}function T(e){return e===62?L(e):w(e)}function E(t){return n(t)?(e.consume(t),D):i(t)}function D(t){return t===45||r(t)?(e.consume(t),D):O(t)}function O(t){return l(t)?(c=O,R(t)):d(t)?(e.consume(t),O):L(t)}function k(t){return t===45||r(t)?(e.consume(t),k):t===47||t===62||u(t)?A(t):i(t)}function A(t){return t===47?(e.consume(t),L):t===58||t===95||n(t)?(e.consume(t),j):l(t)?(c=A,R(t)):d(t)?(e.consume(t),A):L(t)}function j(t){return t===45||t===46||t===58||t===95||r(t)?(e.consume(t),j):M(t)}function M(t){return t===61?(e.consume(t),N):l(t)?(c=M,R(t)):d(t)?(e.consume(t),M):A(t)}function N(t){return t===null||t===60||t===61||t===62||t===96?i(t):t===34||t===39?(e.consume(t),o=t,P):l(t)?(c=N,R(t)):d(t)?(e.consume(t),N):(e.consume(t),F)}function P(t){return t===o?(e.consume(t),o=void 0,I):t===null?i(t):l(t)?(c=P,R(t)):(e.consume(t),P)}function F(t){return t===null||t===34||t===39||t===60||t===61||t===96?i(t):t===47||t===62||u(t)?A(t):(e.consume(t),F)}function I(e){return e===47||e===62||u(e)?A(e):i(e)}function L(n){return n===62?(e.consume(n),e.exit(`htmlTextData`),e.exit(`htmlText`),t):i(n)}function R(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),z}function z(t){return d(t)?B(e,V,`linePrefix`,a.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):V(t)}function V(t){return e.enter(`htmlTextData`),c(t)}}const Ke={name:`labelEnd`,resolveAll:Xe,resolveTo:Ze,tokenize:Qe},qe={tokenize:$e},Je={tokenize:et},Ye={tokenize:tt};function Xe(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&E(e,0,e.length,n),e}function Ze(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=D(s,e.slice(a+1,a+r+3)),s=D(s,[[`enter`,u,t]]),s=D(s,N(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=D(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=D(s,e.slice(o+1)),s=D(s,[[`exit`,c,t]]),E(e,a,e.length,s),e}function Qe(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(h(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(qe,u,o?u:d)(t):t===91?e.attempt(Je,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Ye,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function $e(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return u(t)?Y(e,a)(t):a(t)}function a(t){return t===41?d(t):Ce(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return u(t)?Y(e,c)(t):d(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Te(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):d(t)}function l(t){return u(t)?Y(e,d)(t):d(t)}function d(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function et(e,t,n){let r=this;return i;function i(t){return we.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(h(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function tt(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const nt={name:`labelStartImage`,resolveAll:Ke.resolveAll,tokenize:rt};function rt(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const it={name:`labelStartLink`,resolveAll:Ke.resolveAll,tokenize:at};function at(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const ot={name:`lineEnding`,tokenize:st};function st(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),B(e,t,`linePrefix`)}}const X={name:`thematicBreak`,tokenize:ct};function ct(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||l(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),d(t)?B(e,s,`whitespace`)(t):s(t))}}const Z={continuation:{tokenize:ft},exit:mt,name:`list`,tokenize:dt},lt={partial:!0,tokenize:ht},ut={partial:!0,tokenize:pt};function dt(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,s=0;return c;function c(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:o(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(X,n,u)(t):u(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),l(t)}return n(t)}function l(t){return o(t)&&++s<10?(e.consume(t),l):(!r.interrupt||s<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),u(t)):n(t)}function u(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(V,r.interrupt?n:f,e.attempt(lt,m,p))}function f(e){return r.containerState.initialBlankLine=!0,a++,m(e)}function p(t){return d(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),m):n(t)}function m(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function ft(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(V,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,B(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!d(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ut,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,B(e,e.attempt(Z,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function pt(e,t,n){let r=this;return B(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function mt(e){e.exit(this.containerState.type)}function ht(e,t,n){let r=this;return B(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!d(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const gt={name:`setextUnderline`,resolveTo:_t,tokenize:vt};function _t(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function vt(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),d(t)?B(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||l(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}({}).hasOwnProperty;const yt={tokenize:bt};function bt(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),B(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return l(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const xt={tokenize:Ct},St={tokenize:wt};function Ct(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,u)(i)}return u(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}v(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return E(t.events,a+1,0,t.events.slice(n)),t.events.length=s,u(e)}return s(e)}function u(a){if(r===n.length){if(!i)return p(a);if(i.currentConstruct&&i.currentConstruct.concrete)return h(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(St,d,f)(a)}function d(e){return i&&y(),v(r),p(e)}function f(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,h(e)}function p(n){return t.containerState={},e.attempt(St,m,h)(n)}function m(e){return r++,n.push([t.currentConstruct,t.containerState]),p(e)}function h(n){if(n===null){i&&y(),v(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),g(n)}function g(n){if(n===null){_(e.exit(`chunkFlow`),!0),v(0),e.consume(n);return}return l(n)?(e.consume(n),_(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),g)}function _(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(v(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;E(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function v(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function y(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function wt(e,t,n){return B(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}const Tt={tokenize:Et};function Et(e){let t=this,n=e.attempt(V,r,e.attempt(this.parser.constructs.flowInitial,i,B(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ve,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const Dt={resolveAll:jt()},Ot=At(`string`),kt=At(`text`);function At(e){return{resolveAll:jt(e===`text`?Mt:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function jt(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Mt(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Nt=e({attentionMarkers:()=>Vt,contentInitial:()=>Ft,disable:()=>Ht,document:()=>Pt,flow:()=>Lt,flowInitial:()=>It,insideSpan:()=>Bt,string:()=>Rt,text:()=>zt});const Pt={42:Z,43:Z,45:Z,48:Z,49:Z,50:Z,51:Z,52:Z,53:Z,54:Z,55:Z,56:Z,57:Z,62:U},Ft={91:Ee},It={[-2]:q,[-1]:q,32:q},Lt={35:Me,42:X,45:[gt,X],60:Le,61:gt,95:X,96:K,126:K},Rt={38:G,92:ne},zt={[-5]:ot,[-4]:ot,[-3]:ot,33:nt,38:G,42:P,60:[R,We],91:it,92:[Ae,ne],93:Ke,95:P,96:de},Bt={null:[P,Dt]},Vt={null:[42,95]},Ht={null:[]};function Ut(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:w(S),check:w(C),consume:y,enter:b,exit:x,interrupt:w(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:g,events:[],now:h,parser:e,previous:null,sliceSerialize:p,sliceStream:m,write:f},d=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function f(e){return o=D(o,e),_(),o[o.length-1]===null?(T(t,0),u.events=N(a,u.events,u),u.events):[]}function p(e,t){return Gt(m(e),t)}function m(e){return Wt(o,e)}function h(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function g(e){i[e.line]=e.column,k()}function _(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)v(t.charCodeAt(r._bufferIndex));else v(t)}}function v(e){d=d(e)}function y(e){l(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,k()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=e}function b(e,t){let n=t||{};return n.type=e,n.start=h(),u.events.push([`enter`,n,u]),s.push(n),n}function x(e){let t=s.pop();return t.end=h(),u.events.push([`exit`,t,u]),t}function S(e,t){T(e,t.from)}function C(e,t){t.restore()}function w(e,t){return n;function n(n,r,i){let a,o,s,l;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return l=O(),s=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(u),t):u,c,m,h)(n)}}function m(t){return e(s,l),r}function h(e){return l.restore(),++o<a.length?p(a[o]):i}}}function T(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&E(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function O(){let e=h(),t=u.previous,n=u.currentConstruct,i=u.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=i,s=a,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Wt(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Gt(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
2
|
-
`;break;case-3:o=`\r
|
|
3
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Kt(e){let t={constructs:k([Nt,...(e||{}).extensions||[]]),content:n(yt),defined:[],document:n(xt),flow:n(Tt),lazy:{},string:n(Ot),text:n(kt)};return t;function n(e){return n;function n(n){return Ut(t,e,n)}}}function qt(e){for(;!ge(e););return e}const Jt=/[\0\t\n\r]/g;function Yt(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Jt.lastIndex=u,c=Jt.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}function Q(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Zt(e.position):`start`in e||`end`in e?Zt(e):`line`in e||`column`in e?Xt(e):``}function Xt(e){return Qt(e&&e.line)+`:`+Qt(e&&e.column)}function Zt(e){return Xt(e&&e.start)+`-`+Xt(e&&e.end)}function Qt(e){return e&&typeof e==`number`?e:1}const $t={}.hasOwnProperty;function en(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),tn(n)(qt(Kt(n).document().write(Yt()(e,t,!0))))}function tn(e){let n={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(fe),autolinkProtocol:A,autolinkEmail:A,atxHeading:o(ce),blockQuote:o(ae),characterEscape:A,characterReference:A,codeFenced:o(K),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(K,s),codeText:o(oe,s),codeTextData:A,data:A,codeFlowValue:A,definition:o(se),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(q),hardBreakEscape:o(le),hardBreakTrailing:o(le),htmlFlow:o(ue,s),htmlFlowData:A,htmlText:o(ue,s),htmlTextData:A,image:o(de),label:s,link:o(fe),listItem:o(me),listItemValue:p,listOrdered:o(pe,f),listUnordered:o(pe),paragraph:o(he),reference:ee,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ce),strong:o(J),thematicBreak:o(_e)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:ie,autolinkProtocol:G,blockQuote:l(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:W,characterReferenceMarkerNumeric:W,characterReferenceValue:ne,characterReference:re,codeFenced:l(y),codeFencedFence:_,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:j,codeIndented:l(b),codeText:l(I),codeTextData:j,data:j,definition:l(),definitionDestinationString:T,definitionLabelString:x,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(N),hardBreakTrailing:l(N),htmlFlow:l(P),htmlFlowData:j,htmlText:l(F),htmlTextData:j,image:l(R),label:B,labelText:z,lineEnding:M,link:l(L),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:te,resourceDestinationString:V,resourceTitleString:H,resource:U,setextHeading:l(k),setextHeadingLineSequence:O,setextHeadingText:D,strong:l(),thematicBreak:l()}};nn(n,(e||{}).mdastExtensions||[]);let r={};return i;function i(e){let t={type:`root`,children:[]},i={stack:[t],tokenStack:[],config:n,enter:c,exit:u,buffer:s,resume:d,data:r},o=[],l=-1;for(;++l<e.length;)(e[l][1].type===`listOrdered`||e[l][1].type===`listUnordered`)&&(e[l][0]===`enter`?o.push(l):l=a(e,o.pop(),l));for(l=-1;++l<e.length;){let t=n[e[l][0]];$t.call(t,e[l][1].type)&&t[e[l][1].type].call(Object.assign({sliceSerialize:e[l][2].sliceSerialize},i),e[l][1])}if(i.tokenStack.length>0){let e=i.tokenStack[i.tokenStack.length-1];(e[1]||an).call(i,void 0,e[0])}for(t.position={start:$(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:$(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},l=-1;++l<n.transforms.length;)t=n.transforms[l](t)||t;return t}function a(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:$(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||an).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Q({start:e.start,end:e.end})+`): it’s not open`);n.position.end=$(e.end)}function d(){return v(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function x(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=h(this.sliceSerialize(e)).toLowerCase()}function C(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function T(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function E(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function D(){this.data.setextHeadingSlurpLineEnding=!0}function O(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function A(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ge(),n.position={start:$(e.start),end:void 0},t.push(n)),this.stack.push(n)}function j(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=$(e.end)}function M(e){let t=this.stack[this.stack.length-1];if(this.data.atHardBreak){let n=t.children[t.children.length-1];n.position.end=$(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(t.type)&&(A.call(this,e),j.call(this,e))}function N(){this.data.atHardBreak=!0}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function L(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function R(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function z(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=w(t),n.identifier=h(t).toLowerCase()}function B(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function V(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function H(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function U(){this.data.inReference=void 0}function ee(){this.data.referenceType=`collapsed`}function te(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=h(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function W(e){this.data.characterReferenceType=e.type}function ne(e){let n=this.sliceSerialize(e),r=this.data.characterReferenceType,i;r?(i=S(n,r===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):i=t(n);let a=this.stack[this.stack.length-1];a.value+=i}function re(e){let t=this.stack.pop();t.position.end=$(e.end)}function G(e){j.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ie(e){j.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ae(){return{type:`blockquote`,children:[]}}function K(){return{type:`code`,lang:null,meta:null,value:``}}function oe(){return{type:`inlineCode`,value:``}}function se(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function q(){return{type:`emphasis`,children:[]}}function ce(){return{type:`heading`,depth:0,children:[]}}function le(){return{type:`break`}}function ue(){return{type:`html`,value:``}}function de(){return{type:`image`,title:null,url:``,alt:null}}function fe(){return{type:`link`,title:null,url:``,children:[]}}function pe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function me(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function he(){return{type:`paragraph`,children:[]}}function J(){return{type:`strong`,children:[]}}function ge(){return{type:`text`,value:``}}function _e(){return{type:`thematicBreak`}}}function $(e){return{line:e.line,column:e.column,offset:e.offset}}function nn(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?nn(e,r):rn(e,r)}}function rn(e,t){let n;for(n in t)if($t.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function an(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Q({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Q({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Q({start:t.start,end:t.end})+`) is still open`)}export{d as _,N as a,E as c,h as d,n as f,u as g,l as h,B as i,v as l,a as m,Q as n,M as o,r as p,V as r,k as s,en as t,g as u,f as v,p as y};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import"./hast-util-to-html.mjs";import{t as e}from"./ccount.mjs";import"./devlop.mjs";import{d as t,l as n,u as r,v as i,y as a}from"./mdast-util-from-markdown.mjs";import{n as o,r as s,t as c}from"./mdast-util-find-and-replace.mjs";import{t as l}from"./markdown-table.mjs";import{t as u}from"./longest-streak.mjs";const d=`phrasing`,f=[`autolink`,`link`,`image`,`label`];function p(){return{transforms:[re],enter:{literalAutolink:te,literalAutolinkEmail:m,literalAutolinkHttp:m,literalAutolinkWww:m},exit:{literalAutolink:_,literalAutolinkEmail:g,literalAutolinkHttp:ne,literalAutolinkWww:h}}}function ee(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:d,notInConstruct:f},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:d,notInConstruct:f},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:d,notInConstruct:f}]}}function te(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function m(e){this.config.enter.autolinkProtocol.call(this,e)}function ne(e){this.config.exit.autolinkProtocol.call(this,e)}function h(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function g(e){this.config.exit.autolinkEmail.call(this,e)}function _(e){this.exit(e)}function re(e){c(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ie],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,ae]],{ignore:[`link`,`linkReference`]})}function ie(e,t,n,r,i){let a=``;if(!v(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!oe(n)))return!1;let o=se(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function ae(e,t,n,r){return!v(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function oe(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function se(t){let n=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!n)return[t,void 0];t=t.slice(0,n.index);let r=n[0],i=r.indexOf(`)`),a=e(t,`(`),o=e(t,`)`);for(;i!==-1&&a>o;)t+=r.slice(0,i+1),r=r.slice(i+1),i=r.indexOf(`)`),o++;return[t,r]}function v(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||a(n)||i(n))&&(!t||n!==47)}y.peek=ge;function ce(){this.buffer()}function le(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function ue(){this.buffer()}function de(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function fe(e){let n=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=t(this.sliceSerialize(e)).toLowerCase(),r.label=n}function pe(e){this.exit(e)}function me(e){let n=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=t(this.sliceSerialize(e)).toLowerCase(),r.label=n}function he(e){this.exit(e)}function ge(){return`[`}function y(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function _e(){return{enter:{gfmFootnoteCallString:ce,gfmFootnoteCall:le,gfmFootnoteDefinitionLabelString:ue,gfmFootnoteDefinition:de},exit:{gfmFootnoteCallString:fe,gfmFootnoteCall:pe,gfmFootnoteDefinitionLabelString:me,gfmFootnoteDefinition:he}}}function ve(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:y},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
2
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?b:ye))),s(),o}}function ye(e,t,n){return t===0?e:b(e,t,n)}function b(e,t,n){return(n?``:` `)+e}const be=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];T.peek=E;function x(){return{canContainEols:[`delete`],enter:{strikethrough:C},exit:{strikethrough:w}}}function S(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:be}],handlers:{delete:T}}}function C(e){this.enter({type:`delete`,children:[]},e)}function w(e){this.exit(e)}function T(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function E(){return`~`}({}).hasOwnProperty;function D(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),O);return i(),o}function O(e,t,n){return`>`+(n?``:` `)+e}function k(e,t){return A(e,t.inConstruct,!0)&&!A(e,t.notInConstruct,!1)}function A(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function j(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
3
|
-
`&&k(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
4
|
-
`}function M(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function N(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function xe(e,t,n,r){let i=N(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(M(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Se);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(u(a,i)+1,3)),l=n.enter(`codeFenced`),d=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);d+=s.move(n.safe(e.lang,{before:d,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);d+=s.move(` `),d+=s.move(n.safe(e.meta,{before:d,after:`
|
|
5
|
-
`,encode:["`"],...s.current()})),t()}return d+=s.move(`
|
|
6
|
-
`),a&&(d+=s.move(a+`
|
|
7
|
-
`)),d+=s.move(c),l(),d}function Se(e,t,n){return(n?``:` `)+e}function P(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Ce(e,t,n,r){let i=P(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
8
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function we(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function F(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function I(e,t,n){let i=r(e),a=r(t);return i===void 0?a===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}L.peek=Te;function L(e,t,n,r){let i=we(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=I(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=F(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=I(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+F(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Te(e,t,n){return n.options.emphasis||`*`}function R(e,t,n,r){let i,a,s;typeof t==`function`&&typeof n!=`function`?(a=void 0,s=t,i=n):(a=t,s=n,i=r),o(e,a,c,i);function c(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return s(e,r,n)}}function Ee(e,t){let r=!1;return R(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return r=!0,!1}),!!((!e.depth||e.depth<3)&&n(e)&&(t.options.setext||r))}function De(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Ee(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
9
|
-
`,after:`
|
|
10
|
-
`});return r(),t(),o+`
|
|
11
|
-
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
12
|
-
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
13
|
-
`,...a.current()});return/^[\t ]/.test(l)&&(l=F(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}z.peek=Oe;function z(e){return e.value||``}function Oe(){return`<`}B.peek=ke;function B(e,t,n,r){let i=P(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function ke(){return`!`}V.peek=Ae;function V(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Ae(){return`!`}H.peek=je;function H(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function je(){return"`"}function U(e,t){let r=n(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(r===e.url||`mailto:`+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}W.peek=Me;function W(e,t,n,r){let i=P(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(U(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Me(e,t,n){return U(e,n)?`<`:`[`}G.peek=Ne;function G(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Ne(){return`[`}function K(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Pe(e){let t=K(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Fe(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function q(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Ie(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Fe(n):K(n),s=e.ordered?o===`.`?`)`:`.`:Pe(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),q(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Le(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Re(e,t,n,r){let i=Le(n),a=n.bulletCurrent||K(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function ze(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}const Be=s([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Ve(e,t,n,r){return(e.children.some(function(e){return Be(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function He(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}J.peek=Ue;function J(e,t,n,r){let i=He(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=I(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=F(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=I(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+F(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Ue(e,t,n){return n.options.strong||`*`}function We(e,t,n,r){return n.safe(e.value,r)}function Ge(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Ke(e,t,n){let r=(q(n)+(n.options.ruleSpaces?` `:``)).repeat(Ge(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Y={blockquote:D,break:j,code:xe,definition:Ce,emphasis:L,hardBreak:j,heading:De,html:z,image:B,imageReference:V,inlineCode:H,link:W,linkReference:G,list:Ie,listItem:Re,paragraph:ze,root:Ve,strong:J,text:We,thematicBreak:Ke};function qe(){return{enter:{table:Je,tableData:Z,tableHeader:Z,tableRow:Xe},exit:{codeText:Ze,table:Ye,tableData:X,tableHeader:X,tableRow:X}}}function Je(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Ye(e){this.exit(e),this.data.inTable=void 0}function Xe(e){this.enter({type:`tableRow`,children:[]},e)}function X(e){this.exit(e)}function Z(e){this.enter({type:`tableCell`,children:[]},e)}function Ze(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Qe));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Qe(e,t){return t===`|`?t:e}function Q(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
14
|
-
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:p,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return u(d(e,n,r),e.align)}function s(e,t,n,r){let i=u([f(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
15
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function u(e,t){return l(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=f(r[i],t,n);return o(),a}function f(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function p(e,t,n){let r=Y.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function $e(){return{exit:{taskListCheckValueChecked:$,taskListCheckValueUnchecked:$,paragraph:tt}}}function et(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:nt}}}function $(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function tt(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function nt(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Y.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function rt(){return[p(),_e(),x(),qe(),$e()]}function it(e){return{extensions:[ee(),ve(e),S(),Q(e),et()]}}export{it as n,R as r,rt as t};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./@ungap/structured-clone.mjs";import{a as t,i as n,r}from"./hast-util-sanitize.mjs";import"./devlop.mjs";import{o as i}from"./mdast-util-from-markdown.mjs";import{r as a}from"./mdast-util-gfm.mjs";function o(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function s(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
2
|
-
`}]}function c(e,t){let n=t.value?t.value+`
|
|
3
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function l(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function u(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function d(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),a=i(r.toLowerCase()),o=e.footnoteOrder.indexOf(r),s,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,c+=1,e.footnoteCounts.set(r,c);let l={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+a,id:n+`fnref-`+a+(c>1?`-`+c:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(s)}]};e.patch(t,l);let u={type:`element`,tagName:`sup`,properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function f(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function p(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function m(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function h(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return m(e,t);let a={src:i(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);let o={type:`element`,tagName:`img`,properties:a,children:[]};return e.patch(t,o),e.applyData(t,o)}function g(e,t){let n={src:i(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function _(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function v(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return m(e,t);let a={href:i(r.url||``)};r.title!==null&&r.title!==void 0&&(a.title=r.title);let o={type:`element`,tagName:`a`,properties:a,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function y(e,t){let n={href:i(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function b(e,t,n){let r=e.all(t),i=n?x(n):S(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
4
|
-
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
5
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function x(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=S(n[r])}return t}function S(e){return e.spread??e.children.length>1}function C(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function w(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function T(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function E(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function D(e,t){let i=e.all(t),a=i.shift(),o=[];if(a){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],n),o.push(n)}if(i.length>0){let a={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(i,!0)},s=n(t.children[1]),c=r(t.children[t.children.length-1]);s&&c&&(a.position={start:s,end:c}),o.push(a)}let s={type:`element`,tagName:`table`,properties:{},children:e.wrap(o,!0)};return e.patch(t,s),e.applyData(t,s)}function O(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function k(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function A(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(j(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(j(t.slice(i),i>0,!1)),a.join(``)}function j(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===9||t===32;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===9||t===32;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function M(e,t){let n={type:`text`,value:A(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function N(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const P={blockquote:o,break:s,code:c,delete:l,emphasis:u,footnoteReference:d,heading:f,html:p,imageReference:h,image:g,inlineCode:_,linkReference:v,link:y,listItem:b,list:C,paragraph:w,root:T,strong:E,table:D,tableCell:k,tableRow:O,text:M,thematicBreak:N,toml:F,yaml:F,definition:F,footnoteDefinition:F};function F(){}function I(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function L(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function R(t){let n=typeof t.options.clobberPrefix==`string`?t.options.clobberPrefix:`user-content-`,r=t.options.footnoteBackContent||I,a=t.options.footnoteBackLabel||L,o=t.options.footnoteLabel||`Footnotes`,s=t.options.footnoteLabelTagName||`h2`,c=t.options.footnoteLabelProperties||{className:[`sr-only`]},l=[],u=-1;for(;++u<t.footnoteOrder.length;){let e=t.footnoteById.get(t.footnoteOrder[u]);if(!e)continue;let o=t.all(e),s=String(e.identifier).toUpperCase(),c=i(s.toLowerCase()),d=0,f=[],p=t.footnoteCounts.get(s);for(;p!==void 0&&++d<=p;){f.length>0&&f.push({type:`text`,value:` `});let e=typeof r==`string`?r:r(u,d);typeof e==`string`&&(e={type:`text`,value:e}),f.push({type:`element`,tagName:`a`,properties:{href:`#`+n+`fnref-`+c+(d>1?`-`+d:``),dataFootnoteBackref:``,ariaLabel:typeof a==`string`?a:a(u,d),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let m=o[o.length-1];if(m&&m.type===`element`&&m.tagName===`p`){let e=m.children[m.children.length-1];e&&e.type===`text`?e.value+=` `:m.children.push({type:`text`,value:` `}),m.children.push(...f)}else o.push(...f);let h={type:`element`,tagName:`li`,properties:{id:n+`fn-`+c},children:t.wrap(o,!0)};t.patch(e,h),l.push(h)}if(l.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:s,properties:{...e(c),id:`footnote-label`},children:[{type:`text`,value:o}]},{type:`text`,value:`
|
|
6
|
-
`},{type:`element`,tagName:`ol`,properties:{},children:t.wrap(l,!0)},{type:`text`,value:`
|
|
7
|
-
`}]}}const z={}.hasOwnProperty,B={};function V(t,n){let r=n||B,i=new Map,o=new Map,s={all:l,applyData:U,definitionById:i,footnoteById:o,footnoteCounts:new Map,footnoteOrder:[],handlers:{...P,...r.handlers},one:c,options:r,patch:H,wrap:G};return a(t,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?i:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),s;function c(t,n){let r=t.type,i=s.handlers[r];if(z.call(s.handlers,r)&&i)return i(s,t,n);if(s.options.passThrough&&s.options.passThrough.includes(r)){if(`children`in t){let{children:n,...r}=t,i=e(r);return i.children=s.all(t),i}return e(t)}return(s.options.unknownHandler||W)(s,t,n)}function l(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=s.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=K(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=K(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function H(e,n){e.position&&(n.position=t(e))}function U(t,n){let r=n;if(t&&t.data){let n=t.data.hName,i=t.data.hChildren,a=t.data.hProperties;typeof n==`string`&&(r.type===`element`?r.tagName=n:r={type:`element`,tagName:n,properties:{},children:`children`in r?r.children:[r]}),r.type===`element`&&a&&Object.assign(r.properties,e(a)),`children`in r&&r.children&&i!=null&&(r.children=i)}return r}function W(e,t){let n=t.data||{},r=`value`in t&&!(z.call(n,`hProperties`)||z.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function G(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
8
|
-
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
9
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
10
|
-
`}),n}function K(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function q(e,t){let n=V(e,t),r=n.one(e,void 0),i=R(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
11
|
-
`},i)),a}export{q as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,m as c,p as l,r as u,s as d,u as f,v as p,y as m}from"./mdast-util-from-markdown.mjs";const h={tokenize:k,partial:!0},g={tokenize:ee,partial:!0},_={tokenize:te,partial:!0},v={tokenize:ne,partial:!0},y={tokenize:A,partial:!0},b={name:`wwwAutolink`,tokenize:D,previous:j},x={name:`protocolAutolink`,tokenize:O,previous:M},S={name:`emailAutolink`,tokenize:E,previous:N},C={};function w(){return{text:C}}let T=48;for(;T<123;)C[T]=S,T++,T===58?T=65:T===91&&(T=97);C[43]=S,C[45]=S,C[46]=S,C[95]=S,C[72]=[S,x],C[104]=[S,x],C[87]=[S,b],C[119]=[S,b];function E(e,t,n){let r=this,a,o;return s;function s(t){return!P(t)||!N.call(r,r.previous)||F(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),c(t))}function c(t){return P(t)?(e.consume(t),c):t===64?(e.consume(t),u):n(t)}function u(t){return t===46?e.check(y,f,d)(t):t===45||t===95||l(t)?(o=!0,e.consume(t),u):f(t)}function d(t){return e.consume(t),a=!0,u}function f(s){return o&&a&&i(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(s)):n(s)}}function D(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!j.call(r,r.previous)||F(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(h,e.attempt(g,e.attempt(_,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function O(e,t,n){let r=this,o=``,s=!1;return l;function l(t){return(t===72||t===104)&&M.call(r,r.previous)&&!F(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),o+=String.fromCodePoint(t),e.consume(t),u):n(t)}function u(t){if(i(t)&&o.length<5)return o+=String.fromCodePoint(t),e.consume(t),u;if(t===58){let n=o.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),d}return n(t)}function d(t){return t===47?(e.consume(t),s?f:(s=!0,d)):n(t)}function f(t){return t===null||c(t)||a(t)||m(t)||p(t)?n(t):e.attempt(g,e.attempt(_,h),n)(t)}function h(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function k(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function ee(e,t,n){let r,i,o;return s;function s(t){return t===46||t===95?e.check(v,l,c)(t):t===null||a(t)||m(t)||t!==45&&p(t)?l(t):(o=!0,e.consume(t),s)}function c(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),s}function l(e){return i||r||!o?n(e):t(e)}}function te(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(v,t,o)(s):s===null||a(s)||m(s)?t(s):(e.consume(s),i)}function o(t){return t===41&&r++,e.consume(t),i}}function ne(e,t,n){return r;function r(i){return i===33||i===34||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===63||i===95||i===126?(e.consume(i),r):i===38?(e.consume(i),s):i===93?(e.consume(i),o):i===60||i===null||a(i)||m(i)?t(i):n(i)}function o(e){return e===null||e===40||e===91||a(e)||m(e)?t(e):r(e)}function s(e){return i(e)?c(e):n(e)}function c(t){return t===59?(e.consume(t),r):i(t)?(e.consume(t),c):n(t)}}function A(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return l(e)?n(e):t(e)}}function j(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||a(e)}function M(e){return!i(e)}function N(e){return!(e===47||P(e))}function P(e){return e===43||e===45||e===46||e===95||l(e)}function F(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const I={tokenize:W,partial:!0};function L(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:V,continuation:{tokenize:H},exit:U}},text:{91:{name:`gfmFootnoteCall`,tokenize:B},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:R,resolveTo:z}}}}function R(e,t,n){let i=this,a=i.events.length,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),s;for(;a--;){let e=i.events[a][1];if(e.type===`labelImage`){s=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return c;function c(a){if(!s||!s._balanced)return n(a);let c=r(i.sliceSerialize({start:s.end,end:i.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(a):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(a),e.exit(`gfmFootnoteCallLabelMarker`),t(a))}}function z(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function B(e,t,n){let i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),s=0,c;return l;function l(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),u}function u(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,d):n(t)}function d(l){if(s>999||l===93&&!c||l===null||l===91||a(l))return n(l);if(l===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return o.includes(r(i.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(l),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(l)}return a(l)||(c=!0),s++,e.consume(l),l===92?f:d}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function V(e,t,n){let i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),c,l=0,u;return d;function d(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),f}function f(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,p):n(t)}function p(t){if(l>999||t===93&&!u||t===null||t===91||a(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return c=r(i.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),h}return a(t)||(u=!0),l++,e.consume(t),t===92?m:p}function m(t){return t===91||t===92||t===93?(e.consume(t),l++,p):p(t)}function h(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),o.includes(c)||o.push(c),s(e,g,`gfmFootnoteDefinitionWhitespace`)):n(t)}function g(e){return t(e)}}function H(e,t,n){return e.check(u,t,e.attempt(I,t,n))}function U(e){e.exit(`gfmFootnoteDefinition`)}function W(e,t,n){let r=this;return s(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}({}).hasOwnProperty;function G(e){let r=(e||{}).singleTilde,i={name:`strikethrough`,tokenize:o,resolveAll:a};return r??=!0,{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function a(e,r){let i=-1;for(;++i<e.length;)if(e[i][0]===`enter`&&e[i][1].type===`strikethroughSequenceTemporary`&&e[i][1]._close){let a=i;for(;a--;)if(e[a][0]===`exit`&&e[a][1].type===`strikethroughSequenceTemporary`&&e[a][1]._open&&e[i][1].end.offset-e[i][1].start.offset===e[a][1].end.offset-e[a][1].start.offset){e[i][1].type=`strikethroughSequence`,e[a][1].type=`strikethroughSequence`;let o={type:`strikethrough`,start:Object.assign({},e[a][1].start),end:Object.assign({},e[i][1].end)},s={type:`strikethroughText`,start:Object.assign({},e[a][1].end),end:Object.assign({},e[i][1].start)},c=[[`enter`,o,r],[`enter`,e[a][1],r],[`exit`,e[a][1],r],[`enter`,s,r]],l=r.parser.constructs.insideSpan.null;l&&n(c,c.length,0,t(l,e.slice(a+1,i),r)),n(c,c.length,0,[[`exit`,s,r],[`enter`,e[i][1],r],[`exit`,e[i][1],r],[`exit`,o,r]]),n(e,a-1,i-a+3,c),i=a+c.length-2;break}}for(i=-1;++i<e.length;)e[i][1].type===`strikethroughSequenceTemporary`&&(e[i][1].type=`data`);return e}function o(e,t,n){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?n(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=f(i);if(a===126)return o>1?n(a):(e.consume(a),o++,c);if(o<2&&!r)return n(a);let l=e.exit(`strikethroughSequenceTemporary`),u=f(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,t(a)}}}var K=class{constructor(){this.map=[]}add(e,t,n){q(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function q(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function J(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Y(){return{flow:{null:{name:`table`,tokenize:X,resolveAll:re}}}}function X(t,n,r){let i=this,c=0,l=0,u;return d;function d(e){let t=i.events.length-1;for(;t>-1;){let e=i.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let n=t>-1?i.events[t][1].type:null,a=n===`tableHead`||n===`tableRow`?E:f;return a===E&&i.parser.lazy[i.now().line]?r(e):a(e)}function f(e){return t.enter(`tableHead`),t.enter(`tableRow`),p(e)}function p(e){return e===124?m(e):(u=!0,l+=1,m(e))}function m(n){return n===null?r(n):o(n)?l>1?(l=0,i.interrupt=!0,t.exit(`tableRow`),t.enter(`lineEnding`),t.consume(n),t.exit(`lineEnding`),_):r(n):e(n)?s(t,m,`whitespace`)(n):(l+=1,u&&(u=!1,c+=1),n===124?(t.enter(`tableCellDivider`),t.consume(n),t.exit(`tableCellDivider`),u=!0,m):(t.enter(`data`),h(n)))}function h(e){return e===null||e===124||a(e)?(t.exit(`data`),m(e)):(t.consume(e),e===92?g:h)}function g(e){return e===92||e===124?(t.consume(e),h):h(e)}function _(n){return i.interrupt=!1,i.parser.lazy[i.now().line]?r(n):(t.enter(`tableDelimiterRow`),u=!1,e(n)?s(t,v,`linePrefix`,i.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(n):v(n))}function v(e){return e===45||e===58?b(e):e===124?(u=!0,t.enter(`tableCellDivider`),t.consume(e),t.exit(`tableCellDivider`),y):T(e)}function y(n){return e(n)?s(t,b,`whitespace`)(n):b(n)}function b(e){return e===58?(l+=1,u=!0,t.enter(`tableDelimiterMarker`),t.consume(e),t.exit(`tableDelimiterMarker`),x):e===45?(l+=1,x(e)):e===null||o(e)?w(e):T(e)}function x(e){return e===45?(t.enter(`tableDelimiterFiller`),S(e)):T(e)}function S(e){return e===45?(t.consume(e),S):e===58?(u=!0,t.exit(`tableDelimiterFiller`),t.enter(`tableDelimiterMarker`),t.consume(e),t.exit(`tableDelimiterMarker`),C):(t.exit(`tableDelimiterFiller`),C(e))}function C(n){return e(n)?s(t,w,`whitespace`)(n):w(n)}function w(e){return e===124?v(e):e===null||o(e)?!u||c!==l?T(e):(t.exit(`tableDelimiterRow`),t.exit(`tableHead`),n(e)):T(e)}function T(e){return r(e)}function E(e){return t.enter(`tableRow`),D(e)}function D(r){return r===124?(t.enter(`tableCellDivider`),t.consume(r),t.exit(`tableCellDivider`),D):r===null||o(r)?(t.exit(`tableRow`),n(r)):e(r)?s(t,D,`whitespace`)(r):(t.enter(`data`),O(r))}function O(e){return e===null||e===124||a(e)?(t.exit(`data`),D(e)):(t.consume(e),e===92?k:O)}function k(e){return e===92||e===124?(t.consume(e),O):O(e)}}function re(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new K;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Q(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Z(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Z(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Z(f,t,o,i,n,d)):(o[0]=o[1],d=Z(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Q(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=J(t.events,n))}return e}function Z(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},$(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=$(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=$(t.events,n[2]),a=$(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},$(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Q(e,t,n,r,i){let a=[],o=$(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function $(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const ie={name:`tasklistCheck`,tokenize:oe};function ae(){return{text:{91:ie}}}function oe(t,n,r){let i=this;return s;function s(e){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?r(e):(t.enter(`taskListCheck`),t.enter(`taskListCheckMarker`),t.consume(e),t.exit(`taskListCheckMarker`),c)}function c(e){return a(e)?(t.enter(`taskListCheckValueUnchecked`),t.consume(e),t.exit(`taskListCheckValueUnchecked`),l):e===88||e===120?(t.enter(`taskListCheckValueChecked`),t.consume(e),t.exit(`taskListCheckValueChecked`),l):r(e)}function l(e){return e===93?(t.enter(`taskListCheckMarker`),t.consume(e),t.exit(`taskListCheckMarker`),t.exit(`taskListCheck`),u):r(e)}function u(i){return o(i)?n(i):e(i)?t.check({tokenize:se},n,r)(i):r(i)}}function se(e,t,n){return s(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function ce(e){return d([w(),L(),G(e),Y(),ae()])}export{ce as t};
|