legal-markdown-js 2.16.1 → 2.16.3

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/browser.d.ts CHANGED
@@ -71,24 +71,19 @@ export declare function processLegalMarkdown(content: string, options?: Omit<Leg
71
71
  /**
72
72
  * UMD-compatible export object for browser environments
73
73
  *
74
- * This constant provides a namespace object that can be used in UMD builds
75
- * and script tag implementations, making the library accessible through
76
- * global window object or module systems.
74
+ * This object will be automatically exported by webpack as UMD.
75
+ * No manual window assignment needed - webpack handles this.
77
76
  *
78
- * {Object} LegalMarkdown
79
77
  * @example
80
78
  * ```typescript
81
- * // ES6 import
82
- * import { LegalMarkdown } from 'legal-markdown-js/browser';
83
- *
84
79
  * // UMD/Script tag usage
85
80
  * const result = window.LegalMarkdown.processLegalMarkdown(content);
86
81
  * ```
87
82
  */
88
- export declare const LegalMarkdown: {
83
+ declare const LegalMarkdown: {
89
84
  processLegalMarkdown: typeof processLegalMarkdown;
90
85
  processLegalMarkdownWithRemark: typeof processLegalMarkdownWithRemark;
91
86
  processLegalMarkdownWithRemarkSync: typeof processLegalMarkdownWithRemarkSync;
92
87
  };
93
- export {};
88
+ export default LegalMarkdown;
94
89
  //# sourceMappingURL=browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AA6CH,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAG/C,iBAAS,8BAA8B,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,GAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAKxF;AAED,iBAAS,kCAAkC,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,GAAQ,GAAG,GAAG,CAKnF;AAED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IlB,CAAC;AAGF,eAAe,aAAa,CAAC"}
package/dist/browser.js CHANGED
@@ -198,38 +198,20 @@ export function processLegalMarkdown(content, options = {}) {
198
198
  /**
199
199
  * UMD-compatible export object for browser environments
200
200
  *
201
- * This constant provides a namespace object that can be used in UMD builds
202
- * and script tag implementations, making the library accessible through
203
- * global window object or module systems.
201
+ * This object will be automatically exported by webpack as UMD.
202
+ * No manual window assignment needed - webpack handles this.
204
203
  *
205
- * {Object} LegalMarkdown
206
204
  * @example
207
205
  * ```typescript
208
- * // ES6 import
209
- * import { LegalMarkdown } from 'legal-markdown-js/browser';
210
- *
211
206
  * // UMD/Script tag usage
212
207
  * const result = window.LegalMarkdown.processLegalMarkdown(content);
213
208
  * ```
214
209
  */
215
- export const LegalMarkdown = {
216
- processLegalMarkdown: processLegalMarkdown,
217
- processLegalMarkdownWithRemark: processLegalMarkdownWithRemark,
218
- processLegalMarkdownWithRemarkSync: processLegalMarkdownWithRemarkSync,
210
+ const LegalMarkdown = {
211
+ processLegalMarkdown,
212
+ processLegalMarkdownWithRemark,
213
+ processLegalMarkdownWithRemarkSync,
219
214
  };
220
- // Create global window object for script tag usage with explicit assignments
221
- if (typeof window !== 'undefined') {
222
- // eslint-disable-next-line no-undef
223
- window.LegalMarkdown = {
224
- processLegalMarkdown: processLegalMarkdown,
225
- processLegalMarkdownWithRemark: processLegalMarkdownWithRemark,
226
- processLegalMarkdownWithRemarkSync: processLegalMarkdownWithRemarkSync,
227
- };
228
- // Debug logging to see what's being assigned
229
- console.log('Browser bundle loaded - functions available:');
230
- console.log(' processLegalMarkdown:', typeof processLegalMarkdown, processLegalMarkdown);
231
- console.log(' processLegalMarkdownWithRemark:', typeof processLegalMarkdownWithRemark, processLegalMarkdownWithRemark);
232
- console.log(' processLegalMarkdownWithRemarkSync:', typeof processLegalMarkdownWithRemarkSync, processLegalMarkdownWithRemarkSync);
233
- console.log('Final window.LegalMarkdown:', window.LegalMarkdown);
234
- }
215
+ // Export as default for webpack UMD to handle
216
+ export default LegalMarkdown;
235
217
  //# sourceMappingURL=browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,gDAAgD;AAChD,IAAI,6BAA0D,CAAC;AAC/D,IAAI,+BAA4D,CAAC;AAEjE,wCAAwC;AACxC,gGAAgG;AAChG,6BAA6B,GAAG,CAAC,OAAe,EAAE,EAAE;IAClD,uFAAuF;IACvF,uCAAuC;IACvC,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,+BAA+B,GAAG,CAAC,OAAe,EAAE,EAAE;IACpD,yFAAyF;IACzF,uCAAuC;IACvC,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,qEAAqE;AACrE,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,mDAAmD;IACnD,IAAI,CAAC;QACH,8DAA8D;QAC9D,MAAM,SAAS,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;QACrD,6BAA6B,GAAG,SAAS,CAAC,6BAA6B,CAAC;IAC1E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,gBAAgB;IAClB,CAAC;IAED,IAAI,CAAC;QACH,8DAA8D;QAC9D,MAAM,WAAW,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;QACzD,+BAA+B,GAAG,WAAW,CAAC,+BAA+B,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,EAAE;YAC5D,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,6BAA6B,EAAE,OAAO,CAAC,6BAA6B;SACrE,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;IAC9C,CAAC;IAED,6DAA6D;IAC7D,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;QAChC,MAAM,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACnD,gBAAgB,GAAG,YAAY,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACvE,CAAC;IAED,MAAM,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,YAAY,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5F,MAAM,CAAC,KAAK,CAAC,qCAAqC,EAAE;QAClD,YAAY,EAAE,gBAAgB,CAAC,MAAM;QACrC,aAAa,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;QACtC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,MAAM;KAClD,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE,gBAAgB;QACzB,QAAQ;QACR,WAAW;KACZ,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,aAAa,GAAG;IACpB,oBAAoB;IACpB,8BAA8B;IAC9B,kCAAkC;CACnC,CAAC;AAEF,8CAA8C;AAC9C,eAAe,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"archive-options.d.ts","sourceRoot":"","sources":["../../../../src/cli/interactive/prompts/archive-options.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,mCAAmC;IACnC,eAAe,EAAE,OAAO,CAAC;IACzB,6CAA6C;IAC7C,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAsDzE"}
1
+ {"version":3,"file":"archive-options.d.ts","sourceRoot":"","sources":["../../../../src/cli/interactive/prompts/archive-options.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,mCAAmC;IACnC,eAAe,EAAE,OAAO,CAAC;IACzB,6CAA6C;IAC7C,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAyDzE"}
@@ -37,6 +37,8 @@ export async function promptArchiveOptions() {
37
37
  let archiveDirectory;
38
38
  if (useCustomDirectory) {
39
39
  let validDirectory = false;
40
+ // Show where the custom directory will be created
41
+ console.log(chalk.gray(`Custom directory will be created relative to: ${process.cwd()}`));
40
42
  while (!validDirectory) {
41
43
  const customDir = await input({
42
44
  message: 'Enter custom archive directory:',
@@ -1 +1 @@
1
- {"version":3,"file":"archive-options.js","sourceRoot":"","sources":["../../../../src/cli/interactive/prompts/archive-options.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,CAAC;IAC5D,OAAO,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;IAE/E,wCAAwC;IACxC,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC;QACpC,OAAO,EAAE,kDAAkD;QAC3D,OAAO,EAAE,KAAK;KACf,CAAC,CAAC;IAEH,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;IACpC,CAAC;IAED,yBAAyB;IACzB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,8BAA8B,cAAc,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAEpF,+CAA+C;IAC/C,MAAM,kBAAkB,GAAG,MAAM,OAAO,CAAC;QACvC,OAAO,EAAE,iCAAiC;QAC1C,OAAO,EAAE,KAAK;KACf,CAAC,CAAC;IAEH,IAAI,gBAAoC,CAAC;IAEzC,IAAI,kBAAkB,EAAE,CAAC;QACvB,IAAI,cAAc,GAAG,KAAK,CAAC;QAE3B,OAAO,CAAC,cAAc,EAAE,CAAC;YACvB,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC;gBAC5B,OAAO,EAAE,iCAAiC;gBAC1C,OAAO,EAAE,WAAW;gBACpB,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE;oBAC1B,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;wBAClB,OAAO,mCAAmC,CAAC;oBAC7C,CAAC;oBAED,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;wBAC1D,OAAO,mDAAmD,CAAC;oBAC7D,CAAC;oBAED,OAAO,IAAI,CAAC;gBACd,CAAC;aACF,CAAC,CAAC;YAEH,gBAAgB,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;YACpC,cAAc,GAAG,IAAI,CAAC;QACxB,CAAC;IACH,CAAC;IAED,OAAO;QACL,eAAe;QACf,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"archive-options.js","sourceRoot":"","sources":["../../../../src/cli/interactive/prompts/archive-options.ts"],"names":[],"mappings":"AA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,EAAE,WAAW;gBACpB,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE;oBAC1B,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;wBAClB,OAAO,mCAAmC,CAAC;oBAC7C,CAAC;oBAED,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;wBAC1D,OAAO,mDAAmD,CAAC;oBAC7D,CAAC;oBAED,OAAO,IAAI,CAAC;gBACd,CAAC;aACF,CAAC,CAAC;YAEH,gBAAgB,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;YACpC,cAAc,GAAG,IAAI,CAAC;QACxB,CAAC;IACH,CAAC;IAED,OAAO;QACL,eAAe;QACf,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
@@ -203,13 +203,13 @@ export class InteractiveService {
203
203
  try {
204
204
  const archiveManager = new ArchiveManager();
205
205
  const { archiveOptions } = this.getConfig();
206
- // Determine archive directory - should be relative to DEFAULT_OUTPUT_DIR
206
+ // Determine archive directory - should be relative to project root
207
207
  let archiveDir;
208
208
  if (archiveOptions.directory) {
209
- // Custom directory should be relative to DEFAULT_OUTPUT_DIR
209
+ // Custom directory should be relative to project root (consistent with ARCHIVE_DIR)
210
210
  // Ensure directory name doesn't have trailing slash (normalize)
211
211
  const customDir = archiveOptions.directory.replace(/\/+$/, '');
212
- archiveDir = path.resolve(RESOLVED_PATHS.DEFAULT_OUTPUT_DIR, customDir);
212
+ archiveDir = path.resolve(process.cwd(), customDir);
213
213
  }
214
214
  else {
215
215
  archiveDir = RESOLVED_PATHS.ARCHIVE_DIR;
@@ -1 +1 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/cli/interactive/service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,cAA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B,eAAe;gBACf,gBAAgB,EAAE,eAAe,CAAC,OAAO;aAC1C,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;gBAC3C,YAAY,EAAE,MAAM,CAAC,YAAY;gBACjC,oBAAoB,EAAE,MAAM,CAAC,oBAAoB;gBACjD,qBAAqB,EAAE,MAAM,CAAC,qBAAqB;gBACnD,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;aAChE,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;;;OAIG;IACK,SAAS;QACf,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("child_process"),function(){try{return require("pandoc-wasm")}catch(e){}}()):"function"==typeof define&&define.amd?define("LegalMarkdown",["child_process","pandoc-wasm"],t):"object"==typeof exports?exports.LegalMarkdown=t(require("child_process"),function(){try{return require("pandoc-wasm")}catch(e){}}()):e.LegalMarkdown=t(e.child_process,e["pandoc-wasm"])}(this,(e,t)=>(()=>{"use strict";var n,r,i={162:e=>{if(void 0===t){var n=new Error("Cannot find module 'pandoc-wasm'");throw n.code="MODULE_NOT_FOUND",n}e.exports=t},480:(e,t,n)=>{n.r(t),n.d(t,{convertRstToLegalMarkdown:()=>c,convertRstToLegalMarkdownSync:()=>u,isRestructuredText:()=>l,parseRestructuredText:()=>a,parseRestructuredTextSync:()=>s});var r=n(516),i=n(834),o=n(509);async function a(e){try{const t=await i.w.createForContent(e);return t?(await t.convert(e,"rst","markdown")).replace(/\n{3,}/g,"\n\n").trim():o.f.convertRstBasic(e)}catch(t){return console.error("Error parsing RST:",t),o.f.convertRstBasic(e)}}function s(e){return o.f.convertRstBasic(e)}function l(e){return r.w.needsRstParser(e)}async function c(e){return l(e)?await a(e):e}function u(e){return l(e)?s(e):e}},509:(e,t,n)=>{n.d(t,{f:()=>r});class r{static convertRstBasic(e){console.warn("Using basic RST parser - some features may not work correctly");let t=e;return t=t.replace(/^(.+)\n([=]{3,})\s*$/gm,"# $1"),t=t.replace(/^(.+)\n([-]{3,})\s*$/gm,"## $1"),t=t.replace(/^(.+)\n([~]{3,})\s*$/gm,"### $1"),t=t.replace(/^(.+)\n([\^]{3,})\s*$/gm,"#### $1"),t=t.replace(/^(.+)\n(["]{3,})\s*$/gm,"##### $1"),t=t.replace(/^(.+)\n([']{3,})\s*$/gm,"###### $1"),t=t.replace(/^([=]{3,})\n(.+)\n([=]{3,})\s*$/gm,"# $2"),t=t.replace(/^([-]{3,})\n(.+)\n([-]{3,})\s*$/gm,"## $2"),t=t.replace(/\*\*([^*]+)\*\*/g,"**$1**"),t=t.replace(/\*([^*]+)\*/g,"*$1*"),t=t.replace(/:emphasis:`([^`]+)`/g,"*$1*"),t=t.replace(/:strong:`([^`]+)`/g,"**$1**"),t=t.replace(/:literal:`([^`]+)`/g,"`$1`"),t=t.replace(/``([^`]+)``/g,"`$1`"),t=t.replace(/`([^<]+?)\s*<([^>]+?)>`_/g,"[$1]($2)"),t=t.replace(/`([^`]+)`_/g,"[$1][$1]"),t=t.replace(/^(\s*)\* (.+)/gm,"$1- $2"),t=t.replace(/^(\s*)(\d+)\. (.+)/gm,"$1$2. $3"),t=t.replace(/^(\s*)(\d+)\) (.+)/gm,"$1$2. $3"),t=t.replace(/^(.+)::\s*$/gm,(e,t)=>t+"\n\n```"),t=t.replace(/^::\s*$/gm,"```"),(t.match(/```/g)||[]).length%2==1&&(t+="\n```"),t=t.replace(/^([^\n]+)\n(\s{4,})(.+)/gm,(e,t,n,r)=>t.includes("```")||r.includes("```")?e:`**${t}**\n${n}${r}`),t=t.replace(/^\.\.[ \t]+note::[ \t]*(.*)$/gm,"> **Note:** $1"),t=t.replace(/^\.\.[ \t]+warning::[ \t]*(.*)$/gm,"> **Warning:** $1"),t=t.replace(/^\.\.[ \t]+important::[ \t]*(.*)$/gm,"> **Important:** $1"),t=t.replace(/^\.\.[ \t]+(\w+)::[ \t]*(.*)$/gm,"\x3c!-- $1: $2 --\x3e"),t=t.replace(/(?<!\]\()https?:\/\/[^\s<>)]+(?!\))/g,"<$&>"),t=t.replace(/\n{3,}/g,"\n\n"),t.trim()}static convertLatexBasic(e){console.warn("Using basic LaTeX parser - some features may not work correctly");let t=e;const n=t.match(/\\title\{([^}]+)\}/),r=t.match(/\\author\{([^}]+)\}/),i=t.match(/\\date\{([^}]+)\}/);let o="";(n||r||i)&&(o="---\n",n&&(o+=`title: "${n[1]}"\n`),r&&(o+=`author: "${r[1]}"\n`),i&&(o+=`date: "${i[1]}"\n`),o+="---\n\n"),t=t.replace(/\\documentclass\{[^}]*\}/g,""),t=t.replace(/\\usepackage\{[^}]*\}/g,""),t=t.replace(/\\title\{[^}]*\}/g,""),t=t.replace(/\\author\{[^}]*\}/g,""),t=t.replace(/\\date\{[^}]*\}/g,""),t=t.replace(/\\maketitle/g,""),t=t.replace(/\\begin\{document\}/g,""),t=t.replace(/\\end\{document\}/g,""),t=t.replace(/\\section\*?\{([^}]+)\}/g,"# $1"),t=t.replace(/\\subsection\*?\{([^}]+)\}/g,"## $1"),t=t.replace(/\\subsubsection\*?\{([^}]+)\}/g,"### $1"),t=t.replace(/\\paragraph\*?\{([^}]+)\}/g,"#### $1"),t=t.replace(/\\subparagraph\*?\{([^}]+)\}/g,"##### $1"),t=t.replace(/\\textbf\{([^}]+)\}/g,"**$1**"),t=t.replace(/\\textit\{([^}]+)\}/g,"*$1*"),t=t.replace(/\\emph\{([^}]+)\}/g,"*$1*"),t=t.replace(/\\texttt\{([^}]+)\}/g,"`$1`"),t=t.replace(/\\underline\{([^}]+)\}/g,"__$1__"),t=t.replace(/\\verb\|([^|]+)\|/g,"`$1`"),t=t.replace(/\\href\{([^}]+)\}\{([^}]+)\}/g,"[$2]($1)"),t=t.replace(/\\url\{([^}]+)\}/g,"<$1>"),t=t.replace(/\\cite\{([^}]+)\}/g,"[$1]"),t=t.replace(/\\ref\{([^}]+)\}/g,"[$1]"),t=t.replace(/\\label\{([^}]+)\}/g,'<a name="$1"></a>'),t=t.replace(/\\begin\{enumerate\}([\s\S]*?)\\end\{enumerate\}/g,(e,t)=>{let n=1;return t.replace(/\\item\s+/g,()=>n+++". ")}),t=t.replace(/\\begin\{itemize\}([\s\S]*?)\\end\{itemize\}/g,(e,t)=>t.replace(/\\item\s+/g,"- ")),t=t.replace(/\\begin\{description\}([\s\S]*?)\\end\{description\}/g,(e,t)=>t.replace(/\\item\[([^\]]+)\]\s*([^\n\r]*)/g,"**$1**\n $2")),t=t.replace(/\\begin\{itemize\}/g,""),t=t.replace(/\\end\{itemize\}/g,""),t=t.replace(/\\begin\{enumerate\}/g,""),t=t.replace(/\\end\{enumerate\}/g,""),t=t.replace(/\\begin\{description\}/g,""),t=t.replace(/\\end\{description\}/g,""),t=t.replace(/\\item\s+/g,"- ");let a=1;const s=[];return t=t.replace(/\\footnote\{([^}]+)\}/g,(e,t)=>(s.push(`[^${a}]: ${t}`),`[^${a++}]`)),t=t.replace(/\\begin\{quote\}([\s\S]*?)\\end\{quote\}/g,(e,t)=>t.trim().split("\n").map(e=>e.trim()?`> ${e}`:">").join("\n")),t=t.replace(/``([^']+)''/g,'"$1"'),t=t.replace(/\\`([^']+)'/g,"'$1'"),t=t.replace(/\\begin\{verbatim\}/g,"```\n"),t=t.replace(/\\end\{verbatim\}/g,"\n```"),t=t.replace(/\\begin\{lstlisting\}(\[language=([^\]]+)\])?/g,"```$2\n"),t=t.replace(/\\end\{lstlisting\}/g,"\n```"),t=t.replace(/\\begin\{minted\}\{([^}]+)\}/g,"```$1\n"),t=t.replace(/\\end\{minted\}/g,"\n```"),t=t.replace(/\\tableofcontents/g,""),t=t.replace(/\\newpage/g,""),t=t.replace(/\\clearpage/g,""),t=t.replace(/\\bigskip/g,""),t=t.replace(/\\\\/g," "),t=t.replace(/^%.*$/gm,""),t=t.replace(/([^\\])%.*$/gm,"$1"),t=t.replace(/\\[a-zA-Z]+(\[[^\]]*\])?(\{[^}]*\})?/g,""),t=t.replace(/\n{3,}/g,"\n\n"),t=t.replace(/\s{2,}/g," "),s.length>0&&(t+="\n\n"+s.join("\n")),(o+t).trim()}}},516:(e,t,n)=>{n.d(t,{w:()=>r});class r{static needsRstParser(e){return!e.startsWith("---")&&([/^\.\.[ \t]+\w+::/m,/`[^<]+[ \t]*<[^>]+>`_/,/^\.\.[ \t]+(note|warning|important)::/m,/::[ \t]*$/m].filter(t=>t.test(e)).length>=1||(!!/^.+\n[=~^"'`#*+<>-]{4,}[ \t]*$/m.test(e)||[/^\.\.[ \t]+\w+::/m,/^[=~^"'`#*+<>-]{4,}[ \t]*$/m,/`[^`]+`__?/,/`[^<]+[ \t]*<[^>]+>`_/,/::[ \t]*$/m,/^\.\.[ \t]+(note|warning|important)::/m,/^\*[ \t]+\S/m,/^\d+\.[ \t]+\S/m].filter(t=>t.test(e)).length>=2))}static needsLatexParser(e){return!e.startsWith("---")&&([/\\documentclass\{/,/\\begin\{document\}/,/\\section\*?\{/,/\\subsection\*?\{/,/\\usepackage\{/,/\\textbf\{/,/\\textit\{/,/\\emph\{/,/\\item\b/,/\\cite\{/,/\\ref\{/,/\\label\{/].filter(t=>t.test(e)).length>=1||[/\\documentclass\{/,/\\begin\{document\}/,/\\section\*?\{/,/\\subsection\*?\{/,/\\begin\{[^}]+\}/,/\\[a-zA-Z]+\{[^}]*\}/,/\\textbf\{/,/\\textit\{/,/\\emph\{/,/\\usepackage\{/,/\\href\{[^}]*\}\{[^}]*\}/,/\\item\b/,/\\cite\{/,/\\ref\{/,/\\label\{/].filter(t=>t.test(e)).length>=2)}static needsPandoc(e){return this.needsRstParser(e)||this.needsLatexParser(e)}}},660:t=>{t.exports=e},811:(e,t,n)=>{n.r(t),n.d(t,{convertLatexToLegalMarkdown:()=>c,convertLatexToLegalMarkdownSync:()=>u,isLatex:()=>l,parseLatex:()=>a,parseLatexSync:()=>s});var r=n(516),i=n(834),o=n(509);async function a(e){try{const t=await i.w.createForContent(e);return t?(await t.convert(e,"latex","markdown")).replace(/\n{3,}/g,"\n\n").trim():o.f.convertLatexBasic(e)}catch(t){return console.error("Error parsing LaTeX:",t),o.f.convertLatexBasic(e)}}function s(e){return o.f.convertLatexBasic(e)}function l(e){return r.w.needsLatexParser(e)}async function c(e){return l(e)?await a(e):e}function u(e){return l(e)?s(e):e}},834:(e,t,n)=>{n.d(t,{w:()=>l});var r=n(516);class i{static pandocWasm=null;static loadingPromise=null;static async loadIfNeeded(e){if(!r.w.needsPandoc(e))return!1;if("undefined"==typeof window)return!0;if(this.pandocWasm)return!0;if(this.loadingPromise)try{return await this.loadingPromise,null!==this.pandocWasm}catch(e){return!1}this.loadingPromise=this.loadPandocWasm();try{return this.pandocWasm=await this.loadingPromise,!0}catch(e){return console.warn("Failed to load pandoc-wasm:",e),!1}finally{this.loadingPromise=null}}static getPandocWasm(){return this.pandocWasm}static async loadPandocWasm(){try{const e=await Promise.resolve().then(n.t.bind(n,162,23));return"function"==typeof e.init?await e.init():"function"==typeof e.default?await e.default():"object"==typeof e.default&&e.default.convert?e.default:e}catch(e){throw new Error(`Failed to load pandoc-wasm: ${e.message}`)}}static reset(){this.pandocWasm=null,this.loadingPromise=null}}var o=n(660);class a{options;constructor(e={}){this.options={timeout:1e4,verbose:!1,...e}}async convert(e,t,n){return new Promise((r,i)=>{const a=["-f",t,"-t",n,"--wrap=none"];this.options.args&&a.push(...this.options.args),this.options.verbose&&console.log(`Running pandoc with args: ${a.join(" ")}`);const s=(0,o.spawn)("pandoc",a);let l="",c="";const u=setTimeout(()=>{s.kill(),i(new Error(`Pandoc conversion timed out after ${this.options.timeout}ms`))},this.options.timeout);s.stdout.on("data",e=>{l+=e.toString()}),s.stderr.on("data",e=>{c+=e.toString()}),s.on("close",e=>{clearTimeout(u),0===e?r(l):i(new Error(`Pandoc failed with code ${e}: ${c}`))}),s.on("error",e=>{clearTimeout(u),i(new Error(`Failed to start pandoc: ${e.message}`))}),s.stdin.write(e),s.stdin.end()})}}class s{pandocWasm;options;constructor(e,t={}){this.pandocWasm=e,this.options={timeout:1e4,verbose:!1,...t}}async convert(e,t,n){if(!this.pandocWasm)throw new Error("Pandoc WASM not initialized");try{this.options.verbose&&console.log(`Converting ${t} to ${n} using pandoc-wasm`);const r=new Promise((e,t)=>{setTimeout(()=>{t(new Error(`Pandoc WASM conversion timed out after ${this.options.timeout}ms`))},this.options.timeout)});let i;if("function"==typeof this.pandocWasm.convert)i=Promise.resolve(this.pandocWasm.convert(e,t,n));else if("function"==typeof this.pandocWasm.pandoc)i=Promise.resolve(this.pandocWasm.pandoc(e,{from:t,to:n}));else{if("function"!=typeof this.pandocWasm.run)throw new Error("Unsupported pandoc-wasm API");{const r=["-f",t,"-t",n,"--wrap=none"];this.options.args&&r.push(...this.options.args),i=Promise.resolve(this.pandocWasm.run(r,e))}}return await Promise.race([i,r])}catch(e){throw new Error(`Pandoc WASM conversion failed: ${e.message}`)}}}class l{static async create(e={}){if("undefined"==typeof window)return new a(e);{const t=i.getPandocWasm();if(t)return new s(t,e);if(await i.loadIfNeeded("# dummy content to trigger loading")){const t=i.getPandocWasm();if(t)return new s(t,e)}return null}}static async createForContent(e,t={}){return await i.loadIfNeeded(e)?this.create(t):null}static async isAvailable(){try{return null!==await this.create()}catch(e){return!1}}static getEnvironmentInfo(){const e="undefined"==typeof window?"node":"browser",t=i.getPandocWasm();return{environment:e,pandocWasmLoaded:null!==t,pandocWasmInstance:t}}}}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return i[e](n,n.exports,a),n.exports}r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var i=Object.create(null);a.r(i);var o={};n=n||[null,r({}),r([]),r(r)];for(var s=2&t&&e;("object"==typeof s||"function"==typeof s)&&!~n.indexOf(s);s=r(s))Object.getOwnPropertyNames(s).forEach(t=>o[t]=()=>e[t]);return o.default=()=>e,a.d(i,o),i},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};a.r(s),a.d(s,{LegalMarkdown:()=>wt,processLegalMarkdown:()=>yt});var l=function(e){return"object"==typeof e&&null!==e},c=function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},u=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e};function p(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),r+" "+n):r}function d(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=p(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}d.prototype=Object.create(Error.prototype),d.prototype.constructor=d,d.prototype.toString=function(e){return this.name+": "+p(this,e)};var f=d;function g(e,t,n,r,i){var o="",a="",s=Math.floor(i/2)-1;return r-t>s&&(t=r-s+(o=" ... ").length),n-r>s&&(n=r+s-(a=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"→")+a,pos:r-t+o.length}}function h(e,t){return c(" ",t-e.length)+e}var m=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],v=["scalar","sequence","mapping"],b=function(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===m.indexOf(t))throw new f('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}(t.styleAliases||null),-1===v.indexOf(this.kind))throw new f('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function y(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}function w(e){return this.extend(e)}w.prototype.extend=function(e){var t=[],n=[];if(e instanceof b)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new f("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach(function(e){if(!(e instanceof b))throw new f("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new f("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new f("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(e){if(!(e instanceof b))throw new f("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(w.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=y(r,"implicit"),r.compiledExplicit=y(r,"explicit"),r.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(r.compiledImplicit,r.compiledExplicit),r};var $=new w({explicit:[new b("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),new b("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),new b("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})]}),k=new b("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),x=new b("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function S(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function A(e){return 48<=e&&e<=55}function M(e){return 48<=e&&e<=57}var C=new b("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n=e.length,r=0,i=!1;if(!n)return!1;if("-"!==(t=e[r])&&"+"!==t||(t=e[++r]),"0"===t){if(r+1===n)return!0;if("b"===(t=e[++r])){for(r++;r<n;r++)if("_"!==(t=e[r])){if("0"!==t&&"1"!==t)return!1;i=!0}return i&&"_"!==t}if("x"===t){for(r++;r<n;r++)if("_"!==(t=e[r])){if(!S(e.charCodeAt(r)))return!1;i=!0}return i&&"_"!==t}if("o"===t){for(r++;r<n;r++)if("_"!==(t=e[r])){if(!A(e.charCodeAt(r)))return!1;i=!0}return i&&"_"!==t}}if("_"===t)return!1;for(;r<n;r++)if("_"!==(t=e[r])){if(!M(e.charCodeAt(r)))return!1;i=!0}return!(!i||"_"===t)},construct:function(e){var t,n=e,r=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(r=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return r*parseInt(n.slice(2),2);if("x"===n[1])return r*parseInt(n.slice(2),16);if("o"===n[1])return r*parseInt(n.slice(2),8)}return r*parseInt(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!u(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),I=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),L=/^[-+]?[0-9]+e/,T=new b("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!I.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||u(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(u(e))return"-0.0";return n=e.toString(10),L.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),O=$.extend({implicit:[k,x,C,T]}),E=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),F=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"),j=new b("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==E.exec(e)||null!==F.exec(e))},construct:function(e){var t,n,r,i,o,a,s,l,c=0,u=null;if(null===(t=E.exec(e))&&(t=F.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(o=+t[4],a=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),l=new Date(Date.UTC(n,r,i,o,a,s,c)),u&&l.setTime(l.getTime()-u),l},instanceOf:Date,represent:function(e){return e.toISOString()}}),N=new b("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),Y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r",D=new b("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,i=e.length,o=Y;for(n=0;n<i;n++)if(!((t=o.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,o=Y,a=0,s=[];for(t=0;t<i;t++)t%4==0&&t&&(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|o.indexOf(r.charAt(t));return 0==(n=i%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===n?(s.push(a>>10&255),s.push(a>>2&255)):12===n&&s.push(a>>4&255),new Uint8Array(s)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,r="",i=0,o=e.length,a=Y;for(t=0;t<o;t++)t%3==0&&t&&(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]),i=(i<<8)+e[t];return 0==(n=o%3)?(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]):2===n?(r+=a[i>>10&63],r+=a[i>>4&63],r+=a[i<<2&63],r+=a[64]):1===n&&(r+=a[i>>2&63],r+=a[i<<4&63],r+=a[64],r+=a[64]),r}}),R=Object.prototype.hasOwnProperty,W=Object.prototype.toString,P=new b("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,i,o,a=[],s=e;for(t=0,n=s.length;t<n;t+=1){if(r=s[t],o=!1,"[object Object]"!==W.call(r))return!1;for(i in r)if(R.call(r,i)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==a.indexOf(i))return!1;a.push(i)}return!0},construct:function(e){return null!==e?e:[]}}),_=Object.prototype.toString,U=new b("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,i,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1){if(r=a[t],"[object Object]"!==_.call(r))return!1;if(1!==(i=Object.keys(r)).length)return!1;o[t]=[i[0],r[i[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,i,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1)r=a[t],i=Object.keys(r),o[t]=[i[0],r[i[0]]];return o}}),q=Object.prototype.hasOwnProperty,B=new b("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(q.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}}),z=O.extend({implicit:[j,N],explicit:[D,P,U,B]}),G=Object.prototype.hasOwnProperty,V=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,J=/[\x85\u2028\u2029]/,X=/[,\[\]\{\}]/,Z=/^(?:!|!!|![a-z\-]+!)$/i,H=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function K(e){return Object.prototype.toString.call(e)}function Q(e){return 10===e||13===e}function ee(e){return 9===e||32===e}function te(e){return 9===e||32===e||10===e||13===e}function ne(e){return 44===e||91===e||93===e||123===e||125===e}function re(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function ie(e){return 120===e?2:117===e?4:85===e?8:0}function oe(e){return 48<=e&&e<=57?e-48:-1}function ae(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function se(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var le=new Array(256),ce=new Array(256),ue=0;ue<256;ue++)le[ue]=ae(ue)?1:0,ce[ue]=ae(ue);function pe(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||z,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function de(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,r=/\r?\n|\r|\0/g,i=[0],o=[],a=-1;n=r.exec(e.buffer);)o.push(n.index),i.push(n.index+n[0].length),e.position<=n.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var s,l,u="",p=Math.min(e.line+t.linesAfter,o.length).toString().length,d=t.maxLength-(t.indent+p+3);for(s=1;s<=t.linesBefore&&!(a-s<0);s++)l=g(e.buffer,i[a-s],o[a-s],e.position-(i[a]-i[a-s]),d),u=c(" ",t.indent)+h((e.line-s+1).toString(),p)+" | "+l.str+"\n"+u;for(l=g(e.buffer,i[a],o[a],e.position,d),u+=c(" ",t.indent)+h((e.line+1).toString(),p)+" | "+l.str+"\n",u+=c("-",t.indent+p+3+l.pos)+"^\n",s=1;s<=t.linesAfter&&!(a+s>=o.length);s++)l=g(e.buffer,i[a+s],o[a+s],e.position-(i[a]-i[a+s]),d),u+=c(" ",t.indent)+h((e.line+s+1).toString(),p)+" | "+l.str+"\n";return u.replace(/\n$/,"")}(n),new f(t,n)}function fe(e,t){throw de(e,t)}function ge(e,t){e.onWarning&&e.onWarning.call(null,de(e,t))}var he={YAML:function(e,t,n){var r,i,o;null!==e.version&&fe(e,"duplication of %YAML directive"),1!==n.length&&fe(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&fe(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&fe(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&ge(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&fe(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],Z.test(r)||fe(e,"ill-formed tag handle (first argument) of the TAG directive"),G.call(e.tagMap,r)&&fe(e,'there is a previously declared suffix for "'+r+'" tag handle'),H.test(i)||fe(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(t){fe(e,"tag prefix is malformed: "+i)}e.tagMap[r]=i}};function me(e,t,n,r){var i,o,a,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,o=s.length;i<o;i+=1)9===(a=s.charCodeAt(i))||32<=a&&a<=1114111||fe(e,"expected valid JSON character");else V.test(s)&&fe(e,"the stream contains non-printable characters");e.result+=s}}function ve(e,t,n,r){var i,o,a,s;for(l(n)||fe(e,"cannot merge mappings; the provided source object is unacceptable"),a=0,s=(i=Object.keys(n)).length;a<s;a+=1)o=i[a],G.call(t,o)||(t[o]=n[o],r[o]=!0)}function be(e,t,n,r,i,o,a,s,l){var c,u;if(Array.isArray(i))for(c=0,u=(i=Array.prototype.slice.call(i)).length;c<u;c+=1)Array.isArray(i[c])&&fe(e,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===K(i[c])&&(i[c]="[object Object]");if("object"==typeof i&&"[object Object]"===K(i)&&(i="[object Object]"),i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(o))for(c=0,u=o.length;c<u;c+=1)ve(e,t,o[c],n);else ve(e,t,o,n);else e.json||G.call(n,i)||!G.call(t,i)||(e.line=a||e.line,e.lineStart=s||e.lineStart,e.position=l||e.position,fe(e,"duplicated mapping key")),"__proto__"===i?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:o}):t[i]=o,delete n[i];return t}function ye(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):fe(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function we(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);0!==i;){for(;ee(i);)9===i&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&35===i)do{i=e.input.charCodeAt(++e.position)}while(10!==i&&13!==i&&0!==i);if(!Q(i))break;for(ye(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&ge(e,"deficient indentation"),r}function $e(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!te(t)))}function ke(e,t){1===t?e.result+=" ":t>1&&(e.result+=c("\n",t-1))}function xe(e,t){var n,r,i=e.tag,o=e.anchor,a=[],s=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),r=e.input.charCodeAt(e.position);0!==r&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,fe(e,"tab characters must not be used in indentation")),45===r)&&te(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,we(e,!0,-1)&&e.lineIndent<=t)a.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,Me(e,t,3,!1,!0),a.push(e.result),we(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)fe(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!s&&(e.tag=i,e.anchor=o,e.kind="sequence",e.result=a,!0)}function Se(e){var t,n,r,i,o=!1,a=!1;if(33!==(i=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&fe(e,"duplication of a tag property"),60===(i=e.input.charCodeAt(++e.position))?(o=!0,i=e.input.charCodeAt(++e.position)):33===i?(a=!0,n="!!",i=e.input.charCodeAt(++e.position)):n="!",t=e.position,o){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&62!==i);e.position<e.length?(r=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):fe(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!te(i);)33===i&&(a?fe(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),Z.test(n)||fe(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),X.test(r)&&fe(e,"tag suffix cannot contain flow indicator characters")}r&&!H.test(r)&&fe(e,"tag name cannot contain such characters: "+r);try{r=decodeURIComponent(r)}catch(t){fe(e,"tag name is malformed: "+r)}return o?e.tag=r:G.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:fe(e,'undeclared tag handle "'+n+'"'),!0}function Ae(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&fe(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!te(n)&&!ne(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&fe(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Me(e,t,n,r,i){var o,a,s,l,u,p,d,f,g,h=1,m=!1,v=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=s=4===n||3===n,r&&we(e,!0,-1)&&(m=!0,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)),1===h)for(;Se(e)||Ae(e);)we(e,!0,-1)?(m=!0,s=o,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)):s=!1;if(s&&(s=m||i),1!==h&&4!==n||(f=1===n||2===n?t:t+1,g=e.position-e.lineStart,1===h?s&&(xe(e,g)||function(e,t,n){var r,i,o,a,s,l,c,u=e.tag,p=e.anchor,d={},f=Object.create(null),g=null,h=null,m=null,v=!1,b=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=d),c=e.input.charCodeAt(e.position);0!==c;){if(v||-1===e.firstTabInLine||(e.position=e.firstTabInLine,fe(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,63!==c&&58!==c||!te(r)){if(a=e.line,s=e.lineStart,l=e.position,!Me(e,n,2,!1,!0))break;if(e.line===o){for(c=e.input.charCodeAt(e.position);ee(c);)c=e.input.charCodeAt(++e.position);if(58===c)te(c=e.input.charCodeAt(++e.position))||fe(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(be(e,d,f,g,h,null,a,s,l),g=h=m=null),b=!0,v=!1,i=!1,g=e.tag,h=e.result;else{if(!b)return e.tag=u,e.anchor=p,!0;fe(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!b)return e.tag=u,e.anchor=p,!0;fe(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(v&&(be(e,d,f,g,h,null,a,s,l),g=h=m=null),b=!0,v=!0,i=!0):v?(v=!1,i=!0):fe(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,c=r;if((e.line===o||e.lineIndent>t)&&(v&&(a=e.line,s=e.lineStart,l=e.position),Me(e,t,4,!0,i)&&(v?h=e.result:m=e.result),v||(be(e,d,f,g,h,m,a,s,l),g=h=m=null),we(e,!0,-1),c=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==c)fe(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&be(e,d,f,g,h,null,a,s,l),b&&(e.tag=u,e.anchor=p,e.kind="mapping",e.result=d),b}(e,g,f))||function(e,t){var n,r,i,o,a,s,l,c,u,p,d,f,g=!0,h=e.tag,m=e.anchor,v=Object.create(null);if(91===(f=e.input.charCodeAt(e.position)))a=93,c=!1,o=[];else{if(123!==f)return!1;a=125,c=!0,o={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),f=e.input.charCodeAt(++e.position);0!==f;){if(we(e,!0,t),(f=e.input.charCodeAt(e.position))===a)return e.position++,e.tag=h,e.anchor=m,e.kind=c?"mapping":"sequence",e.result=o,!0;g?44===f&&fe(e,"expected the node content, but found ','"):fe(e,"missed comma between flow collection entries"),d=null,s=l=!1,63===f&&te(e.input.charCodeAt(e.position+1))&&(s=l=!0,e.position++,we(e,!0,t)),n=e.line,r=e.lineStart,i=e.position,Me(e,t,1,!1,!0),p=e.tag,u=e.result,we(e,!0,t),f=e.input.charCodeAt(e.position),!l&&e.line!==n||58!==f||(s=!0,f=e.input.charCodeAt(++e.position),we(e,!0,t),Me(e,t,1,!1,!0),d=e.result),c?be(e,o,v,p,u,d,n,r,i):s?o.push(be(e,null,v,p,u,d,n,r,i)):o.push(u),we(e,!0,t),44===(f=e.input.charCodeAt(e.position))?(g=!0,f=e.input.charCodeAt(++e.position)):g=!1}fe(e,"unexpected end of the stream within a flow collection")}(e,f)?v=!0:(a&&function(e,t){var n,r,i,o,a=1,s=!1,l=!1,u=t,p=0,d=!1;if(124===(o=e.input.charCodeAt(e.position)))r=!1;else{if(62!==o)return!1;r=!0}for(e.kind="scalar",e.result="";0!==o;)if(43===(o=e.input.charCodeAt(++e.position))||45===o)1===a?a=43===o?3:2:fe(e,"repeat of a chomping mode identifier");else{if(!((i=oe(o))>=0))break;0===i?fe(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?fe(e,"repeat of an indentation width identifier"):(u=t+i-1,l=!0)}if(ee(o)){do{o=e.input.charCodeAt(++e.position)}while(ee(o));if(35===o)do{o=e.input.charCodeAt(++e.position)}while(!Q(o)&&0!==o)}for(;0!==o;){for(ye(e),e.lineIndent=0,o=e.input.charCodeAt(e.position);(!l||e.lineIndent<u)&&32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>u&&(u=e.lineIndent),Q(o))p++;else{if(e.lineIndent<u){3===a?e.result+=c("\n",s?1+p:p):1===a&&s&&(e.result+="\n");break}for(r?ee(o)?(d=!0,e.result+=c("\n",s?1+p:p)):d?(d=!1,e.result+=c("\n",p+1)):0===p?s&&(e.result+=" "):e.result+=c("\n",p):e.result+=c("\n",s?1+p:p),s=!0,l=!0,p=0,n=e.position;!Q(o)&&0!==o;)o=e.input.charCodeAt(++e.position);me(e,n,e.position,!1)}}return!0}(e,f)||function(e,t){var n,r,i;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(me(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,i=e.position}else Q(n)?(me(e,r,i,!0),ke(e,we(e,!1,t)),r=i=e.position):e.position===e.lineStart&&$e(e)?fe(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);fe(e,"unexpected end of the stream within a single quoted scalar")}(e,f)||function(e,t){var n,r,i,o,a,s;if(34!==(s=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(s=e.input.charCodeAt(e.position));){if(34===s)return me(e,n,e.position,!0),e.position++,!0;if(92===s){if(me(e,n,e.position,!0),Q(s=e.input.charCodeAt(++e.position)))we(e,!1,t);else if(s<256&&le[s])e.result+=ce[s],e.position++;else if((a=ie(s))>0){for(i=a,o=0;i>0;i--)(a=re(s=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+a:fe(e,"expected hexadecimal character");e.result+=se(o),e.position++}else fe(e,"unknown escape sequence");n=r=e.position}else Q(s)?(me(e,n,r,!0),ke(e,we(e,!1,t)),n=r=e.position):e.position===e.lineStart&&$e(e)?fe(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}fe(e,"unexpected end of the stream within a double quoted scalar")}(e,f)?v=!0:function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!te(r)&&!ne(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&fe(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),G.call(e.anchorMap,n)||fe(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],we(e,!0,-1),!0}(e)?(v=!0,null===e.tag&&null===e.anchor||fe(e,"alias node should not have any properties")):function(e,t,n){var r,i,o,a,s,l,c,u,p=e.kind,d=e.result;if(te(u=e.input.charCodeAt(e.position))||ne(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(te(r=e.input.charCodeAt(e.position+1))||n&&ne(r)))return!1;for(e.kind="scalar",e.result="",i=o=e.position,a=!1;0!==u;){if(58===u){if(te(r=e.input.charCodeAt(e.position+1))||n&&ne(r))break}else if(35===u){if(te(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&$e(e)||n&&ne(u))break;if(Q(u)){if(s=e.line,l=e.lineStart,c=e.lineIndent,we(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=l,e.lineIndent=c;break}}a&&(me(e,i,o,!1),ke(e,e.line-s),i=o=e.position,a=!1),ee(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return me(e,i,o,!1),!!e.result||(e.kind=p,e.result=d,!1)}(e,f,1===n)&&(v=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===h&&(v=s&&xe(e,g))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&fe(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),l=0,u=e.implicitTypes.length;l<u;l+=1)if((d=e.implicitTypes[l]).resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(G.call(e.typeMap[e.kind||"fallback"],e.tag))d=e.typeMap[e.kind||"fallback"][e.tag];else for(d=null,l=0,u=(p=e.typeMap.multi[e.kind||"fallback"]).length;l<u;l+=1)if(e.tag.slice(0,p[l].tag.length)===p[l].tag){d=p[l];break}d||fe(e,"unknown tag !<"+e.tag+">"),null!==e.result&&d.kind!==e.kind&&fe(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result,e.tag)?(e.result=d.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):fe(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||v}function Ce(e){var t,n,r,i,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(i=e.input.charCodeAt(e.position))&&(we(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(a=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!te(i);)i=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&fe(e,"directive name must not be less than one character in length");0!==i;){for(;ee(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!Q(i));break}if(Q(i))break;for(t=e.position;0!==i&&!te(i);)i=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==i&&ye(e),G.call(he,n)?he[n](e,n,r):ge(e,'unknown document directive "'+n+'"')}we(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,we(e,!0,-1)):a&&fe(e,"directives end mark is expected"),Me(e,e.lineIndent-1,4,!1,!0),we(e,!0,-1),e.checkLineBreaks&&J.test(e.input.slice(o,e.position))&&ge(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&$e(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,we(e,!0,-1)):e.position<e.length-1&&fe(e,"end of the stream or a document separator is expected")}function Ie(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new pe(e,t),r=e.indexOf("\0");for(-1!==r&&(n.position=r,fe(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Ce(n);return n.documents}var Le=function(e,t){var n=Ie(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new f("expected a single document in the stream, but found more")}};function Te(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}Object.prototype.toString,Object.prototype.hasOwnProperty;var Oe=Le;function Ee(e,t=!1){if(e<=0)return"";const n=[{value:1e3,numeral:"M"},{value:900,numeral:"CM"},{value:500,numeral:"D"},{value:400,numeral:"CD"},{value:100,numeral:"C"},{value:90,numeral:"XC"},{value:50,numeral:"L"},{value:40,numeral:"XL"},{value:10,numeral:"X"},{value:9,numeral:"IX"},{value:5,numeral:"V"},{value:4,numeral:"IV"},{value:1,numeral:"I"}];let r="",i=e;for(const{value:e,numeral:t}of n)for(;i>=e;)r+=t,i-=e;return t?r.toLowerCase():r}function Fe(e){if(e<=0)return"";let t="",n=e;for(;n>0;){const e=(n-1)%26;t=String.fromCharCode(97+e)+t,n=Math.floor((n-1)/26)}return t}function je(e,t,n,r,i=0){if(e<1||e>6)return`l${e}. ${t}`;const o=t.replace(/\s*\|[\w.-]+\|\s*$/g,"").trim(),a=function(e,t){let n;switch(e){case 1:n=t.levelOne;break;case 2:n=t.levelTwo;break;case 3:n=t.levelThree;break;case 4:n=t.levelFour;break;case 5:n=t.levelFive;break;case 6:n=t.levelSix;break;default:n="%n."}if("string"!=typeof n)switch(e){case 1:return"Article %n.";case 2:return"Section %n.";case 3:return"(%n)";case 4:return"(%n%c)";case 5:return"(%n%c%r)";case 6:return"Annex %r -";default:return"%n."}return n}(e,r);if("string"!=typeof a)return`l${e}. ${o}`;let s=a;const l=a.includes("%r.%n")||a.includes("%R.%n"),c=a.includes("%c.%n"),u=r.levelOne?.includes("%c")&&r.levelTwo?.includes("%c.%n");if(s=s.replace(/%0(\d+)n/g,(t,r)=>n[e-1].toString().padStart(parseInt(r),"0")),s=s.replace(/%0(\d+)s/g,(e,t)=>n[0].toString().padStart(parseInt(t),"0")),s=s.replace(/%0(\d+)t/g,(e,t)=>n[1].toString().padStart(parseInt(t),"0")),s=s.replace(/%0(\d+)f/g,(e,t)=>n[2].toString().padStart(parseInt(t),"0")),s=s.replace(/%0(\d+)i/g,(e,t)=>n[3].toString().padStart(parseInt(t),"0")),4===e)!s.includes("%n%c")||s.includes(".%s")||s.includes(".%t")||s.includes(".%f")||(s=s.replace(/%n/g,n[2].toString()),s=s.replace(/%c/g,Fe(n[3])));else if(5===e&&(s.includes("%c%r")||s.includes("%n%c%r"))){s=s.replace(/%n/g,n[2].toString()),s=s.replace(/%c/g,Fe(n[3]));const e=!0;s=s.replace(/%r/g,Ee(n[4],e))}const p="string"==typeof r.levelThree&&r.levelThree.includes("%n.%s.%t")||"string"==typeof r.levelFour&&r.levelFour.includes("%n.%s.%t.%f")||"string"==typeof r.levelFive&&r.levelFive.includes("%n.%s.%t.%f.%i"),d=(s.includes(".%s.%t")||s.includes(".%t.%f")||s.includes(".%f.%i")||s.includes(".%s")&&p)&&!s.includes("%r.")&&!s.includes("%R.")&&!s.includes("%c.");s=d?s.replace(/%n/g,n[0].toString()):s.replace(/%n/g,n[e-1].toString()),s=d?s.replace(/%s/g,n[1].toString()):s.replace(/%s/g,n[0].toString()),s=s.replace(/%t/g,n[2].toString()),s=s.replace(/%f/g,n[3].toString()),s=s.replace(/%i/g,n[4].toString()),c&&e>1||u&&e>1?s=s.replace(/%c/g,Fe(n[0])):(e<=3||e>=4&&s.includes("%c"))&&(s=s.replace(/%c/g,Fe(n[e-1]))),l&&e>1?s=s.replace(/%r/g,Ee(n[0],!0)):(e<=3||e>=4&&s.includes("%r"))&&(s=s.replace(/%r/g,Ee(n[e-1],!0))),a.includes("%R.%n")&&e>1?s=s.replace(/%R/g,Ee(n[0],!1)):(e<=3||e>=4&&s.includes("%R"))&&(s=s.replace(/%R/g,Ee(n[e-1],!1)));const f=r.noIndent?"":" ".repeat(Math.floor((e-1)*(r.levelIndent||1.5)*2));return r.enableFieldTrackingInMarkdown?`${f}<span class="${["legal-header",`legal-header-level-${e}`,Ne(e)].join(" ")}" data-level="${e}" data-number="${n[e-1]}">${s} ${o}</span>`:`${f}${s} ${o}`}function Ne(e){switch(e){case 1:return"legal-article";case 2:return"legal-section";case 3:return"legal-subsection";case 4:return"legal-sub-subsection";case 5:return"legal-paragraph";case 6:return"legal-annex";default:return"legal-header-unknown"}}function Ye(e,t){return e.replace(/\[([^[\]]*(?:\[[^\]]*\][^[\]]*)*?)\]\{([^{}]*?)\}/g,(e,n,r)=>De(r,t)?n:"")}function De(e,t){if(!e.trim())return!0;if(!(e.includes("=")||e.includes("!")||e.includes("AND")||e.includes("OR"))){const n=Re(t,e.trim());return Boolean(n)}try{if(e.includes(" AND "))return e.split(" AND ").map(e=>e.trim()).every(e=>De(e,t));if(e.includes(" OR "))return e.split(" OR ").map(e=>e.trim()).some(e=>De(e,t));if(e.includes("=")){const n=e.includes("!="),r=e.split(n?"!=":"=").map(e=>e.trim());if(2!==r.length)return!1;const[i,o]=r,a=Re(t,i);let s=o;return o.startsWith('"')&&o.endsWith('"')?s=o.slice(1,-1):"true"===o?s=!0:"false"===o?s=!1:isNaN(Number(o))||(s=Number(o)),n?a!==s:a===s}return!1}catch(e){return console.error("Error evaluating condition:",e),!1}}function Re(e,t){const n=t.split(".");let r=e;for(const e of n){if(null==r)return;r=r[e]}return r}Te("safeLoad","load"),Te("safeLoadAll","loadAll"),Te("safeDump","dump");let We=!1,Pe={}.env&&{}.env.LOG_LEVEL||"error";const _e={setDebugEnabled:e=>{We=e},setLogLevel:e=>{Pe=e},debug:(e,t)=>{We&&console.debug(`[DEBUG] ${e}`,t||"")},info:(e,t)=>{"none"!==Pe&&"warn"!==Pe&&"error"!==Pe&&console.info(`[INFO] ${e}`,t||"")},warn:(e,t)=>{"none"!==Pe&&"error"!==Pe&&console.warn(`[WARN] ${e}`,t||"")},error:(e,t)=>{"none"!==Pe&&console.error(`[ERROR] ${e}`,t||"")}};var Ue;!function(e){e.FILLED="filled",e.EMPTY="empty",e.LOGIC="logic"}(Ue||(Ue={}));const qe=new class{fields=new Map;processedContent="";totalOccurrences=0;constructor(){}trackField(e,t){const{value:n,originalValue:r,hasLogic:i=!1,mixinUsed:o}=t;let a;a=i||o&&["conditional","helper","loop"].includes(o)?Ue.LOGIC:null==n||""===n?Ue.EMPTY:Ue.FILLED;const s={name:e,status:a,value:n,originalValue:r,hasLogic:i,mixinUsed:o};this.fields.set(e,s),this.totalOccurrences++,_e.debug("Field tracked",{fieldName:e,status:a,hasLogic:i})}applyFieldTracking(e){let t=e;return this.fields.forEach((e,n)=>{const r=this.getFieldCssClass(e.status),i=this.escapeRegex(n).replace(/_/g,"\\\\_?"),o=new RegExp(`\\{\\{\\s*${i}\\s*\\}\\}`,"g");if(t=t.replace(o,(t,i,o)=>{const a=o.substring(0,i),s=a.lastIndexOf("<span");if(s>a.lastIndexOf("</span>")&&-1!==s)return t;const l=void 0!==e.value&&null!==e.value&&""!==e.value?String(e.value):t;return`<span class="${r}" data-field="${n.replace(/"/g,"&quot;")}">${l}</span>`}),void 0!==e.value&&null!==e.value&&""!==e.value){const i=String(e.value);if("logic"===e.status||n.startsWith("crossref.")){const e=t.split(/(<[^>]*>)/);for(let t=0;t<e.length;t++)if(t%2==0&&e[t]&&e[t].includes(i)){const o=e[t],a=t>0?e[t-1]:"",s=t<e.length-1?e[t+1]:"";if((a.includes('class="highlight"')||a.includes('class="imported-value"')||a.includes('class="missing-value"'))&&"</span>"===s)continue;const l=this.escapeRegex(i);e[t]=o.replace(new RegExp(l,"g"),e=>`<span class="${r}" data-field="${n.replace(/"/g,"&quot;")}">${e}</span>`)}t=e.join("")}}}),this.processedContent=t,t}getFieldCssClass(e){switch(e){case Ue.FILLED:return"legal-field imported-value";case Ue.EMPTY:return"legal-field missing-value";case Ue.LOGIC:return"legal-field highlight";default:return""}}escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}getFields(){return new Map(this.fields)}getTotalOccurrences(){return this.totalOccurrences}getFieldsByStatus(e){return Array.from(this.fields.values()).filter(t=>t.status===e)}generateReport(){const e=Array.from(this.fields.values());return{total:e.length,filled:e.filter(e=>e.status===Ue.FILLED).length,empty:e.filter(e=>e.status===Ue.EMPTY).length,logic:e.filter(e=>e.status===Ue.LOGIC).length,fields:e}}clear(){this.fields.clear(),this.processedContent="",this.totalOccurrences=0}};function Be(e){const t=["th","st","nd","rd"],n=e%100;return n>=11&&n<=13?e+t[0]:e+(t[n%10]||t[0])}function ze(e,t="EUR",n=2){const r="string"==typeof e?parseFloat(e):e;if(isNaN(r))return String(e);const i=r.toFixed(n).replace(/\B(?=(\d{3})+(?!\d))/g,","),o={EUR:"€",USD:"$",GBP:"£"}[t]||t;return"EUR"===t?`${i} ${o}`:`${o}${i}`}function Ge(e){return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""}function Ve(e){return e?e.split(/[\s-_]+/).map((e,t)=>0===t?e.toLowerCase():e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(""):""}const Je={addYears:function(e,t){if(!e)throw new Error("Date is required for addYears");const n=new Date(e);if(isNaN(n.getTime()))throw new Error(`Invalid date: ${e}`);return n.setFullYear(n.getFullYear()+t),n},addMonths:function(e,t){if(!e)throw new Error("Date is required for addMonths");const n=new Date(e);if(isNaN(n.getTime()))throw new Error(`Invalid date: ${e}`);return n.setMonth(n.getMonth()+t),n},addDays:function(e,t){if(!e)throw new Error("Date is required for addDays");const n=new Date(e);if(isNaN(n.getTime()))throw new Error(`Invalid date: ${e}`);return n.setDate(n.getDate()+t),n},formatDate:function(e,t="YYYY-MM-DD"){const n="string"==typeof e?new Date(e):e;if(isNaN(n.getTime()))throw new Error(`Invalid date: ${e}`);const r=n.getFullYear(),i=n.getMonth(),o=n.getDate(),a=n.getDay(),s={YYYY:String(r),YY:String(r).slice(-2),MMMM:["January","February","March","April","May","June","July","August","September","October","November","December"][i],MMMMES:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"][i],MMM:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][i],MM:String(i+1).padStart(2,"0"),M:String(i+1),DD:String(o).padStart(2,"0"),D:String(o),Do:Be(o),dddd:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][a],ddd:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][a]};let l=t;const c=Object.keys(s).sort((e,t)=>t.length-e.length);for(const e of c){const t=s[e],n=e.length<=2?new RegExp(`\\b${e}\\b`,"g"):new RegExp(e,"g");l=l.replace(n,t)}return l},DateFormats:{LEGAL:"Do day of MMMM, YYYY",FORMAL:"dddd, MMMM Do, YYYY",SPANISH:"D de MMMMES de YYYY",US:"MM/DD/YYYY",EU:"DD/MM/YYYY",ISO:"YYYY-MM-DD",LONG:"MMMM D, YYYY",SHORT:"MMM D, YYYY",YEAR:"YYYY",MONTH_YEAR:"MMMM YYYY"},formatInteger:function(e,t=","){const n="string"==typeof e?parseFloat(e):e;return isNaN(n)?String(e):Math.floor(n).toString().replace(/\B(?=(\d{3})+(?!\d))/g,t)},formatPercent:function(e,t=2,n=!0){const r="string"==typeof e?parseFloat(e):e;if(isNaN(r))return String(e);const i=(100*r).toFixed(t);return n?`${i}%`:i},formatCurrency:ze,formatEuro:function(e,t=2){return ze(e,"EUR",t)},formatDollar:function(e,t=2){return ze(e,"USD",t)},formatPound:function(e,t=2){return ze(e,"GBP",t)},numberToWords:function e(t){const n="string"==typeof t?parseFloat(t):t;if(isNaN(n))return String(t);if(0===n)return"zero";const r=["","one","two","three","four","five","six","seven","eight","nine"],i=["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"],o=["ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],a=e=>e>=1e6?a(Math.floor(e/1e6))+" million "+s(e%1e6):s(e),s=e=>e>=1e3?l(Math.floor(e/1e3))+" thousand "+l(e%1e3):l(e),l=e=>{let t="";if(e>99&&(t+=r[Math.floor(e/100)]+" hundred ",e%=100),e>19)t+=i[Math.floor(e/10)]+" ",e%=10;else if(e>9)return t+=o[e-10]+" ",t.trim();return e>0&&(t+=r[e]+" "),t.trim()};if(n<0)return"negative "+e(Math.abs(n));const c=Math.floor(n),u=Math.round(100*(n-c));let p=a(c);return u>0&&(p+=" and "+l(u)+" cents"),p.trim()},round:function(e,t=0){const n="string"==typeof e?parseFloat(e):e;if(isNaN(n))return 0;const r=Math.pow(10,t);return Math.round(n*r)/r},capitalize:Ge,capitalizeWords:function(e){return e?e.split(" ").map(e=>Ge(e)).join(" "):""},upper:function(e){return e?e.toUpperCase():""},lower:function(e){return e?e.toLowerCase():""},titleCase:function(e){if(!e)return"";const t=new Set(["a","an","and","as","at","but","by","for","if","in","nor","of","on","or","so","the","to","up","yet"]);return e.split(" ").map((n,r)=>{const i=n.toLowerCase();return 0===r||r===e.split(" ").length-1?Ge(n):t.has(i)?i:Ge(n)}).join(" ")},kebabCase:function(e){return e?e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase():""},snakeCase:function(e){return e?e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase():""},camelCase:Ve,pascalCase:function(e){if(!e)return"";const t=Ve(e);return t.charAt(0).toUpperCase()+t.slice(1)},truncate:function(e,t,n="..."){return e?e.length<=t?e:e.slice(0,t-n.length)+n:""},clean:function(e){return e?e.replace(/\s+/g," ").trim():""},pluralize:function(e,t,n){if(1===t)return e;if(n)return n;const r=[[/s$/i,"s"],[/([^aeiou])y$/i,"$1ies"],[/(x|z|s|sh|ch)$/i,"$1es"],[/$/i,"s"]];for(const[t,n]of r)if(t.test(e))return e.replace(t,n);return e+"s"},padStart:function(e,t,n=" "){return e?e.padStart(t,n):n.repeat(t)},padEnd:function(e,t,n=" "){return e?e.padEnd(t,n):n.repeat(t)},contains:function(e,t,n=!1){return!(!e||!t)&&(n?e.includes(t):e.toLowerCase().includes(t.toLowerCase()))},replaceAll:function(e,t,n){return e?e.split(t).join(n):""},initials:function(e){return e?e.split(" ").map(e=>e.charAt(0).toUpperCase()).join(""):""}},Xe=new Map,Ze=100,He=3e5;function Ke(e,t,n){for(const r of n)if(e>=r.start&&t<=r.end)return!0;return!1}function Qe(e){const t=e.trim();return t.includes("?")&&t.includes(":")?"conditional":t.includes("(")&&t.includes(")")?"helper":"variable"}function et(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function tt(e,t){return"."===t?e?.["."]:t.split(".").reduce((e,t)=>{const n=t.match(/^(\w+)\[(\d+)\]$/);if(n){const[,t,r]=n;return e?.[t]?.[parseInt(r,10)]}return e?.[t]},e)}function nt(e,t){if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);if(/^-?\d+(\.\d+)?$/.test(e))return parseFloat(e);if("true"===e)return!0;if("false"===e)return!1;if("null"===e)return null;if("undefined"!==e){if("@today"===e)return new Date;if(e.includes("(")&&e.includes(")")){const n=rt(e,t);if(void 0!==n)return n}return tt(t,e)}}function rt(e,t){try{const n=e.match(/^(\w+)\((.*)\)$/);if(!n)return;const[,r,i]=n,o=Je[r];if(!o||"function"!=typeof o)return;const a=function(e,t){if(!e.trim())return[];const n=[];let r="",i=!1,o="",a=0;for(let s=0;s<e.length;s++){const l=e[s];i||'"'!==l&&"'"!==l?i&&l===o?(i=!1,o="",r+=l):i||"("!==l?i||")"!==l?i||","!==l||0!==a?r+=l:(n.push(nt(r.trim(),t)),r=""):(a--,r+=l):(a++,r+=l):(i=!0,o=l,r+=l)}return r.trim()&&n.push(nt(r.trim(),t)),n}(i,t);return o(...a)}catch(t){return void console.warn(`Error evaluating helper expression: ${e}`,t)}}function it(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ot(e,t,n,r=!0){const i=function(e){const t=[],n=/\{\{#([\w.]+)\}\}([\s\S]*?)\{\{\/\1\}\}/g;let r;for(;null!==(r=n.exec(e));){const[e,n,i]=r;t.push({variable:n,content:i,start:r.index,end:r.index+e.length,fullMatch:e})}return t}(e);if(0===i.length)return e;let o=e;for(let e=i.length-1;e>=0;e--){const a=i[e],s=at(a,t,n,r);o=o.slice(0,a.start)+s+o.slice(a.end)}return o}function at(e,t,n,r=!0){const{variable:i,content:o}=e,a=function(e,t,n){const r=ut(t,e);if(void 0!==r)return r;if(n&&n.item){const t=ut(n.item,e);if(void 0!==t)return t}let i=n;for(;i&&i.parent;)if(i=i.parent,i.item){const t=ut(i.item,e);if(void 0!==t)return t}}(i,t,n);return qe.trackField(i,{value:a,hasLogic:!0,mixinUsed:"loop"}),Array.isArray(a)?function(e,t,n,r,i,o=!0){const a=[];for(let s=0;s<n.length;s++){const l=n[s],c={variable:e,item:l,index:s,total:n.length,parent:i},u=st(r,l,c);let p=t;p=ot(p,u,c,o),p=pt(p,u,c,o),p=gt(p),a.push(p)}return a.join("\n")}(i,o,a,t,n,r):a?function(e,t,n,r,i,o=!0){const a={...r,[e]:n};let s=ot(t,a,i,o);return s=pt(s,a,i,o),s}(i,o,a,t,n,r):""}function st(e,t,n){const r={...e};return t&&"object"==typeof t&&!Array.isArray(t)&&Object.assign(r,t),r["."]=t,r["@index"]=n.index,r["@total"]=n.total,r["@first"]=0===n.index,r["@last"]=n.index===n.total-1,r}function lt(e,t){try{const n=e.match(/^(\w+)\((.*)\)$/);if(!n)return;const[,r,i]=n,o=Je[r];if(!o||"function"!=typeof o)return;const a=i?function(e,t){const n=[];let r="",i=0,o=!1,a="";for(let s=0;s<e.length;s++){const l=e[s];'"'!==l&&"'"!==l||o?l===a&&o?(o=!1,a="",r+=l):"("!==l||o?")"!==l||o?","!==l||0!==i||o?r+=l:(n.push(ct(r.trim(),t)),r=""):(i--,r+=l):(i++,r+=l):(o=!0,a=l,r+=l)}return r.trim()&&n.push(ct(r.trim(),t)),n}(i,t):[];return o(...a)}catch(t){return void console.error(`Error evaluating helper expression: ${e}`,t)}}function ct(e,t){if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);if("true"===e)return!0;if("false"===e)return!1;if(/^\d+$/.test(e))return parseInt(e,10);if(/^\d+\.\d+$/.test(e))return parseFloat(e);if("@today"===e)return new Date;if(e.includes("(")&&e.includes(")")){const n=lt(e,t);if(void 0!==n)return n}return ut(t,e)}function ut(e,t){const n=t.split(".");let r=e;for(const e of n){if(!r||"object"!=typeof r||!(e in r))return;r=r[e]}return r}function pt(e,t,n,r=!0){return e.replace(/\{\{([^}]+)\}\}/g,(e,n)=>{const i=n.trim();if(i.includes("?")&&i.includes(":")){const e=function(e,t,n=!0){const r=dt(e,"?"),i=dt(e,":",r);if(-1===r||-1===i)return e;const o=e.substring(0,r).trim(),a=e.substring(r+1,i).trim(),s=e.substring(i+1).trim(),l=ft(o,t)?a:s;if(l.startsWith('"')&&l.endsWith('"')||l.startsWith("'")&&l.endsWith("'")){const t=l.slice(1,-1);return n?`<span class="imported-value" data-field="${it(e)}">${t}</span>`:t}const c=function(e,t){if(e.includes("+"))return e.split("+").map(e=>{const n=e.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);const r=ft(n,t);return void 0!==r?String(r):n}).join("");const n=ft(e,t);return void 0!==n?String(n):e}(l,t);return n?`<span class="imported-value" data-field="${it(e)}">${c}</span>`:c}(i,t,r);return r?`<span class="highlight">${e}</span>`:e}if(i.includes("(")&&i.includes(")")){const e=lt(i,t);if(void 0!==e)return qe.trackField(i,{value:e,hasLogic:!0,mixinUsed:"helper"}),r?`<span class="highlight"><span class="imported-value" data-field="${it(i)}">${String(e)}</span></span>`:String(e)}const o=ft(i,t);return null==o?r?`<span class="missing-value" data-field="${it(i)}">[[${i}]]</span>`:`{{${i}}}`:r?`<span class="imported-value" data-field="${it(i)}">${String(o)}</span>`:String(o)})}function dt(e,t,n=0){let r=!1,i="";for(let o=n;o<e.length;o++){const n=e[o];if(r||'"'!==n&&"'"!==n){if(r&&n===i)r=!1,i="";else if(!r&&n===t)return o}else r=!0,i=n}return-1}function ft(e,t,n){if("."===e)return t["."];const r=e.split(".");let i=t;for(const e of r){if(!i||"object"!=typeof i||!Object.prototype.hasOwnProperty.call(i,e))return;i=i[e]}return i}function gt(e){const t=e.trim();return t.startsWith("- ")?`<li>${t.substring(2).trim()}</li>`:e}let ht,mt;if(ht=e=>e,mt=e=>e,"undefined"==typeof window){try{const e=a(480);ht=e.convertRstToLegalMarkdownSync}catch(e){}try{const e=a(811);mt=e.convertLatexToLegalMarkdownSync}catch(e){}}function vt(e,t={}){return console.warn("Using fallback processor - Remark functions not fully implemented in browser bundle"),Promise.resolve(yt(e,t))}function bt(e,t={}){return console.warn("Using fallback processor - Remark functions not fully implemented in browser bundle"),yt(e,t)}function yt(e,t={}){t.debug?(_e.setDebugEnabled(!0),_e.debug("Debug mode enabled for Legal Markdown processing",{options:t})):_e.setDebugEnabled(!1),qe.clear();let n=ht(e);n=mt(n);const{content:r,metadata:i}=function(e,t=!1){const n={content:e,metadata:{}};if(!e.startsWith("---"))return n;const r=e.indexOf("---",3);if(-1===r)return n;let i=e.substring(3,r).trim();const o=e.substring(r+3).trim();i=function(e){return e.replace(/@today(?:\[([^\]]+)\])?/g,(e,t)=>{const n=t||"YYYY-MM-DD",r=function(e,t){try{switch(t.toLowerCase()){case"iso":case"yyyy-mm-dd":default:return e.toISOString().split("T")[0];case"long":return e.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});case"medium":return e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});case"short":return e.toLocaleDateString("en-US",{year:"2-digit",month:"short",day:"numeric"})}}catch(t){return e.toISOString().split("T")[0]}}(new Date,n);return`"${r}"`})}(i);try{const e=Oe(i);return e&&"object"==typeof e?{content:o,metadata:e}:{content:o,metadata:{}}}catch(e){if(t)throw new Error(`Invalid YAML Front Matter: ${e instanceof Error?e.message:"Unknown error"}`);return{content:o,metadata:{}}}}(n,t.throwOnYamlError);if(_e.debug("YAML front matter parsed",{metadata:i,yamlVariables:Object.keys(i||{}).length}),t.yamlOnly)return _e.debug("YAML-only processing mode: returning content without variable substitution"),{content:r,metadata:i};let o=r;_e.debug("Starting content processing",{contentLength:o.length}),t.noClauses?_e.debug("Skipping optional clauses processing"):(_e.debug("Processing optional clauses"),o=Ye(o,i)),t.noReferences?_e.debug("Skipping cross references processing"):(_e.debug("Processing cross references"),o=function(e,t){const n=function(e,t){const n=[],r=e.split("\n"),i={level1:0,level2:0,level3:0,level4:0,level5:0,level6:0},o={level1:t["level-one"]||"Article %n.",level2:t["level-two"]||"Section %n.",level3:t["level-three"]||"(%n)",level4:t["level-four"]||"(%n)",level5:t["level-five"]||"(%n%c)",level6:t["level-six"]||"Annex %r -"};for(const e of r){const t=e.trim(),r=t.match(/^(l+)\. (.+) \|([\w.-]+)\|$/),a=t.match(/^l(\d+)\. (.+) \|([\w.-]+)\|$/);if(r||a){let e,t,s,l,c;if(r){const[,n,i,o]=r;e=n.length,t=i,s=o}else{const[,n,r,i]=a;e=parseInt(n,10),t=r,s=i}1===e?(i.level1++,i.level2=0,i.level3=0,i.level4=0,i.level5=0,i.level6=0):2===e?(i.level2++,i.level3=0,i.level4=0,i.level5=0,i.level6=0):3===e?(i.level3++,i.level4=0,i.level5=0,i.level6=0):4===e?(i.level4++,i.level5=0,i.level6=0):5===e?(i.level5++,i.level6=0):6===e&&i.level6++,1===e?(l=o.level1.replace(/%n/g,i.level1.toString()),c=`${l} ${t}`):2===e?(l=o.level2.replace(/%n/g,i.level2.toString()),c=`${l} ${t}`):3===e?(l=o.level3.replace(/%n/g,i.level3.toString()),c=`${l} ${t}`):4===e?(l=o.level4.replace(/%n/g,i.level4.toString()).replace(/%c/g,Fe(i.level4)).replace(/%r/g,Ee(i.level4,!0)).replace(/%R/g,Ee(i.level4,!1)),c=`${l} ${t}`):5===e?(l=o.level5.replace(/%n/g,i.level5.toString()).replace(/%c/g,Fe(i.level5)).replace(/%r/g,Ee(i.level5,!0)).replace(/%R/g,Ee(i.level5,!1)),c=`${l} ${t}`):6===e?(l=o.level6.replace(/%n/g,i.level6.toString()).replace(/%r/g,Ee(i.level6,!0)).replace(/%R/g,Ee(i.level6,!1)),c=`${l} ${t}`):(l=`Level ${e}.`,c=`${l} ${t}`),n.push({key:s,sectionNumber:l.trim(),sectionText:c.trim()})}}return n}(e,t);return t._cross_references=n.map(e=>({key:e.key,sectionNumber:e.sectionNumber,sectionText:e.sectionText})),0===n.length&&(t._cross_references=[]),function(e,t,n){const r=new Map;for(const e of t)r.set(e.key,e.sectionNumber);const i=e.split("\n").map(e=>{const t=e.trim();return t.match(/^(l+)\. (.+) \|([\w.-]+)\|$/)||t.match(/^l(\d+)\. (.+) \|([\w.-]+)\|$/)?e:e.replace(/\|([^|]+)\|/g,(e,t)=>{const i=t.trim(),o=r.get(i);if(o)return qe.trackField(`crossref.${i}`,{value:o,originalValue:e,hasLogic:!0}),o;const a=function(e,t){const n=t.split(".");let r=e;for(const e of n){if(null==r)return;r=r[e]}return r}(n,i);if(void 0!==a){const t=function(e,t,n){if(void 0===e)return"";if(null===e)return"null";if(e instanceof Date)return e.toISOString().split("T")[0];if("number"==typeof e&&t.includes("amount")){const t=n.payment_currency||"USD";return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e)}return String(e)}(a,i,n);return qe.trackField(`crossref.${i}`,{value:t,originalValue:e,hasLogic:!1}),t}return qe.trackField(`crossref.${i}`,{value:"",originalValue:e,hasLogic:!1}),e})});return i.join("\n")}(e,n,t)}(o,i)),t.noMixins?_e.debug("Skipping mixins processing"):(_e.debug("Processing mixins and template variables with AST-based processor"),o=function(e,t,n={}){try{const r=function(e){const t=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t.toString(36)}(e),n=Xe.get(t);if(n&&n.content===e)return{nodes:[...n.nodes],hasErrors:!1,errors:[]};Xe.size>Ze&&function(){const e=Date.now();for(const[t,n]of Xe.entries())e-n.timestamp>He&&Xe.delete(t)}();const r=[],i=[],o=function(e){const t=[],n=/\{\{#([\w.]+)\}\}([\s\S]*?)\{\{\/\1\}\}/g;let r;for(;null!==(r=n.exec(e));){const[e,n]=r;t.push({start:r.index,end:r.index+e.length,variable:n})}return t}(e),a=/\{\{([^}]+)\}\}/g;let s,l=0;for(;null!==(s=a.exec(e));){const[t,n]=s,a=s.index,c=a+t.length;if(Ke(a,c,o))continue;a>l&&r.push({type:"text",content:e.slice(l,a),position:{start:l,end:a}});const u=n.trim();if(u.startsWith("#")||u.startsWith("/")||"."===u)r.push({type:"text",content:t,position:{start:a,end:c}});else if(n&&""!==n.trim()){const e=Qe(n);r.push({type:e,content:t,variable:n.trim(),position:{start:a,end:c}})}else{const e={type:"variable",content:t,variable:n,position:{start:a,end:c},hasError:!0,errorMessage:"Empty or malformed mixin"};r.push(e),i.push({node:e,message:"Empty or malformed mixin",position:{start:a,end:c}})}l=c}return l<e.length&&r.push({type:"text",content:e.slice(l),position:{start:l,end:e.length}}),Xe.set(t,{content:e,hash:t,nodes:[...r],timestamp:Date.now()}),{nodes:r,hasErrors:i.length>0,errors:i}}(e);return r.hasErrors&&console.warn("Mixin parsing errors detected:",r.errors),function(e,t,n={}){if(n.noMixins)return e.map(e=>e.content).join("");const r=function(e,t=""){const n=new Set;return function e(t,r){if("string"==typeof t)t.match(/^\[.*\]$/)&&n.add(r);else if(t&&"object"==typeof t&&!Array.isArray(t))for(const[n,i]of Object.entries(t))e(i,r?`${r}.${n}`:n);else Array.isArray(t)&&t.forEach((t,n)=>{e(t,`${r}[${n}]`)})}(e,t),n}(t),i=e.map(e=>{if("text"===e.type)return e.content;if(e.hasError||!e.variable)return n.enableFieldTrackingInMarkdown?`<span class="highlight"><span class="missing-value" data-field="${et(e.content)}">{{${e.variable||"malformed"}}}</span></span>`:e.content;let i,o=!1,a="variable";switch(e.type){case"variable":i=function(e,t){return tt(t,e)}(e.variable,t),a="variable";break;case"helper":i=rt(e.variable,t),o=!0,a="helper";break;case"conditional":i=function(e,t){try{const n=e.indexOf("?"),r=e.indexOf(":",n);if(-1===n||-1===r)return;const i=e.substring(0,n).trim(),o=e.substring(n+1,r).trim(),a=e.substring(r+1).trim();return nt(tt(t,i)?o:a,t)}catch(t){return void console.warn(`Error evaluating conditional expression: ${e}`,t)}}(e.variable,t),o=!0,a="conditional";break;default:i=void 0}const s=r.has(e.variable),l=null==i||s;if(qe.trackField(e.variable,{value:l?void 0:i,hasLogic:o,mixinUsed:a}),l)return n.enableFieldTrackingInMarkdown?`<span class="missing-value" data-field="${et(e.variable)}">{{${e.variable}}}</span>`:e.content;const c=String(i);return n.enableFieldTrackingInMarkdown?o?`<span class="highlight" data-field="${et(e.variable)}">${c}</span>`:`<span class="imported-value" data-field="${et(e.variable)}">${c}</span>`:c});return i.join("")}(r.nodes,t,n)}catch(t){return console.error("Critical error in AST mixin processing, falling back to original content:",t),e}}(o,i,t)),_e.debug("Processing template loops"),o=ot(o,i,void 0,t.enableFieldTrackingInMarkdown||!1),t.noHeaders?_e.debug("Skipping headers processing"):(_e.debug("Processing headers and numbering"),o=function(e,t,n={}){const r=function(e,t={}){return{levelOne:e["level-one"]||"Article %n.",levelTwo:e["level-two"]||"Section %n.",levelThree:e["level-three"]||"(%n)",levelFour:e["level-four"]||"(%n%c)",levelFive:e["level-five"]||"(%n%c%r)",levelSix:e["level-six"]||"Annex %r -",levelIndent:parseFloat(e["level-indent"]||"1.5"),noReset:t.noReset||e["no-reset"]||!1,noIndent:t.noIndent||e["no-indent"]||!1,enableFieldTrackingInMarkdown:t.enableFieldTrackingInMarkdown||!1}}(t,n),i=/^(l+)\.\s+(.*?)$/gm,o=/^l(\d+)\.\s+(.*?)$/gm,a=[0,0,0,0,0,0],s=[];let l;const c=e.slice();for(i.lastIndex=0;null!==(l=i.exec(c));)s.push({match:l[0],level:l[1].length,text:l[2],index:l.index});for(o.lastIndex=0;null!==(l=o.exec(c));)s.push({match:l[0],level:parseInt(l[1],10),text:l[2],index:l.index});s.sort((e,t)=>e.index-t.index);let u=e,p=0,d=0;for(const e of s){const t=e.level;if(5===t)5===d?a[4]++:a[4]=1;else{for(let e=d;e<t-1;e++)0===a[e]&&(a[e]=1);if(a[t-1]++,!r.noReset)for(let e=t;e<a.length;e++)a[e]=0}const n=je(t,e.text,[...a],r,d),i=e.index+p,o=i+e.match.length;u=u.substring(0,i)+n+u.substring(o),p+=n.length-e.match.length,d=t}return u}(o,i,{noReset:t.noReset,noIndent:t.noIndent,enableFieldTrackingInMarkdown:t.enableFieldTrackingInMarkdown})),t.enableFieldTracking&&(_e.debug("Applying field tracking to content"),o=qe.applyFieldTracking(o));const a=t.enableFieldTracking?qe.generateReport():void 0;return _e.debug("Legal Markdown processing completed",{outputLength:o.length,fieldsTracked:a?.total||0,yamlVariables:Object.keys(i||{}).length}),{content:o,metadata:i,fieldReport:a}}const wt={processLegalMarkdown:yt,processLegalMarkdownWithRemark:vt,processLegalMarkdownWithRemarkSync:bt};return"undefined"!=typeof window&&(window.LegalMarkdown={processLegalMarkdown:yt,processLegalMarkdownWithRemark:vt,processLegalMarkdownWithRemarkSync:bt},console.log("Browser bundle loaded - functions available:"),console.log(" processLegalMarkdown:",typeof yt,yt),console.log(" processLegalMarkdownWithRemark:",typeof vt,vt),console.log(" processLegalMarkdownWithRemarkSync:",typeof bt,bt),console.log("Final window.LegalMarkdown:",window.LegalMarkdown)),s})());
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("child_process"),function(){try{return require("pandoc-wasm")}catch(e){}}()):"function"==typeof define&&define.amd?define("LegalMarkdown",["child_process","pandoc-wasm"],t):"object"==typeof exports?exports.LegalMarkdown=t(require("child_process"),function(){try{return require("pandoc-wasm")}catch(e){}}()):e.LegalMarkdown=t(e.child_process,e["pandoc-wasm"])}(this,(e,t)=>(()=>{"use strict";var n,r,i={162:e=>{if(void 0===t){var n=new Error("Cannot find module 'pandoc-wasm'");throw n.code="MODULE_NOT_FOUND",n}e.exports=t},480:(e,t,n)=>{n.r(t),n.d(t,{convertRstToLegalMarkdown:()=>c,convertRstToLegalMarkdownSync:()=>u,isRestructuredText:()=>l,parseRestructuredText:()=>a,parseRestructuredTextSync:()=>s});var r=n(516),i=n(834),o=n(509);async function a(e){try{const t=await i.w.createForContent(e);return t?(await t.convert(e,"rst","markdown")).replace(/\n{3,}/g,"\n\n").trim():o.f.convertRstBasic(e)}catch(t){return console.error("Error parsing RST:",t),o.f.convertRstBasic(e)}}function s(e){return o.f.convertRstBasic(e)}function l(e){return r.w.needsRstParser(e)}async function c(e){return l(e)?await a(e):e}function u(e){return l(e)?s(e):e}},509:(e,t,n)=>{n.d(t,{f:()=>r});class r{static convertRstBasic(e){console.warn("Using basic RST parser - some features may not work correctly");let t=e;return t=t.replace(/^(.+)\n([=]{3,})\s*$/gm,"# $1"),t=t.replace(/^(.+)\n([-]{3,})\s*$/gm,"## $1"),t=t.replace(/^(.+)\n([~]{3,})\s*$/gm,"### $1"),t=t.replace(/^(.+)\n([\^]{3,})\s*$/gm,"#### $1"),t=t.replace(/^(.+)\n(["]{3,})\s*$/gm,"##### $1"),t=t.replace(/^(.+)\n([']{3,})\s*$/gm,"###### $1"),t=t.replace(/^([=]{3,})\n(.+)\n([=]{3,})\s*$/gm,"# $2"),t=t.replace(/^([-]{3,})\n(.+)\n([-]{3,})\s*$/gm,"## $2"),t=t.replace(/\*\*([^*]+)\*\*/g,"**$1**"),t=t.replace(/\*([^*]+)\*/g,"*$1*"),t=t.replace(/:emphasis:`([^`]+)`/g,"*$1*"),t=t.replace(/:strong:`([^`]+)`/g,"**$1**"),t=t.replace(/:literal:`([^`]+)`/g,"`$1`"),t=t.replace(/``([^`]+)``/g,"`$1`"),t=t.replace(/`([^<]+?)\s*<([^>]+?)>`_/g,"[$1]($2)"),t=t.replace(/`([^`]+)`_/g,"[$1][$1]"),t=t.replace(/^(\s*)\* (.+)/gm,"$1- $2"),t=t.replace(/^(\s*)(\d+)\. (.+)/gm,"$1$2. $3"),t=t.replace(/^(\s*)(\d+)\) (.+)/gm,"$1$2. $3"),t=t.replace(/^(.+)::\s*$/gm,(e,t)=>t+"\n\n```"),t=t.replace(/^::\s*$/gm,"```"),(t.match(/```/g)||[]).length%2==1&&(t+="\n```"),t=t.replace(/^([^\n]+)\n(\s{4,})(.+)/gm,(e,t,n,r)=>t.includes("```")||r.includes("```")?e:`**${t}**\n${n}${r}`),t=t.replace(/^\.\.[ \t]+note::[ \t]*(.*)$/gm,"> **Note:** $1"),t=t.replace(/^\.\.[ \t]+warning::[ \t]*(.*)$/gm,"> **Warning:** $1"),t=t.replace(/^\.\.[ \t]+important::[ \t]*(.*)$/gm,"> **Important:** $1"),t=t.replace(/^\.\.[ \t]+(\w+)::[ \t]*(.*)$/gm,"\x3c!-- $1: $2 --\x3e"),t=t.replace(/(?<!\]\()https?:\/\/[^\s<>)]+(?!\))/g,"<$&>"),t=t.replace(/\n{3,}/g,"\n\n"),t.trim()}static convertLatexBasic(e){console.warn("Using basic LaTeX parser - some features may not work correctly");let t=e;const n=t.match(/\\title\{([^}]+)\}/),r=t.match(/\\author\{([^}]+)\}/),i=t.match(/\\date\{([^}]+)\}/);let o="";(n||r||i)&&(o="---\n",n&&(o+=`title: "${n[1]}"\n`),r&&(o+=`author: "${r[1]}"\n`),i&&(o+=`date: "${i[1]}"\n`),o+="---\n\n"),t=t.replace(/\\documentclass\{[^}]*\}/g,""),t=t.replace(/\\usepackage\{[^}]*\}/g,""),t=t.replace(/\\title\{[^}]*\}/g,""),t=t.replace(/\\author\{[^}]*\}/g,""),t=t.replace(/\\date\{[^}]*\}/g,""),t=t.replace(/\\maketitle/g,""),t=t.replace(/\\begin\{document\}/g,""),t=t.replace(/\\end\{document\}/g,""),t=t.replace(/\\section\*?\{([^}]+)\}/g,"# $1"),t=t.replace(/\\subsection\*?\{([^}]+)\}/g,"## $1"),t=t.replace(/\\subsubsection\*?\{([^}]+)\}/g,"### $1"),t=t.replace(/\\paragraph\*?\{([^}]+)\}/g,"#### $1"),t=t.replace(/\\subparagraph\*?\{([^}]+)\}/g,"##### $1"),t=t.replace(/\\textbf\{([^}]+)\}/g,"**$1**"),t=t.replace(/\\textit\{([^}]+)\}/g,"*$1*"),t=t.replace(/\\emph\{([^}]+)\}/g,"*$1*"),t=t.replace(/\\texttt\{([^}]+)\}/g,"`$1`"),t=t.replace(/\\underline\{([^}]+)\}/g,"__$1__"),t=t.replace(/\\verb\|([^|]+)\|/g,"`$1`"),t=t.replace(/\\href\{([^}]+)\}\{([^}]+)\}/g,"[$2]($1)"),t=t.replace(/\\url\{([^}]+)\}/g,"<$1>"),t=t.replace(/\\cite\{([^}]+)\}/g,"[$1]"),t=t.replace(/\\ref\{([^}]+)\}/g,"[$1]"),t=t.replace(/\\label\{([^}]+)\}/g,'<a name="$1"></a>'),t=t.replace(/\\begin\{enumerate\}([\s\S]*?)\\end\{enumerate\}/g,(e,t)=>{let n=1;return t.replace(/\\item\s+/g,()=>n+++". ")}),t=t.replace(/\\begin\{itemize\}([\s\S]*?)\\end\{itemize\}/g,(e,t)=>t.replace(/\\item\s+/g,"- ")),t=t.replace(/\\begin\{description\}([\s\S]*?)\\end\{description\}/g,(e,t)=>t.replace(/\\item\[([^\]]+)\]\s*([^\n\r]*)/g,"**$1**\n $2")),t=t.replace(/\\begin\{itemize\}/g,""),t=t.replace(/\\end\{itemize\}/g,""),t=t.replace(/\\begin\{enumerate\}/g,""),t=t.replace(/\\end\{enumerate\}/g,""),t=t.replace(/\\begin\{description\}/g,""),t=t.replace(/\\end\{description\}/g,""),t=t.replace(/\\item\s+/g,"- ");let a=1;const s=[];return t=t.replace(/\\footnote\{([^}]+)\}/g,(e,t)=>(s.push(`[^${a}]: ${t}`),`[^${a++}]`)),t=t.replace(/\\begin\{quote\}([\s\S]*?)\\end\{quote\}/g,(e,t)=>t.trim().split("\n").map(e=>e.trim()?`> ${e}`:">").join("\n")),t=t.replace(/``([^']+)''/g,'"$1"'),t=t.replace(/\\`([^']+)'/g,"'$1'"),t=t.replace(/\\begin\{verbatim\}/g,"```\n"),t=t.replace(/\\end\{verbatim\}/g,"\n```"),t=t.replace(/\\begin\{lstlisting\}(\[language=([^\]]+)\])?/g,"```$2\n"),t=t.replace(/\\end\{lstlisting\}/g,"\n```"),t=t.replace(/\\begin\{minted\}\{([^}]+)\}/g,"```$1\n"),t=t.replace(/\\end\{minted\}/g,"\n```"),t=t.replace(/\\tableofcontents/g,""),t=t.replace(/\\newpage/g,""),t=t.replace(/\\clearpage/g,""),t=t.replace(/\\bigskip/g,""),t=t.replace(/\\\\/g," "),t=t.replace(/^%.*$/gm,""),t=t.replace(/([^\\])%.*$/gm,"$1"),t=t.replace(/\\[a-zA-Z]+(\[[^\]]*\])?(\{[^}]*\})?/g,""),t=t.replace(/\n{3,}/g,"\n\n"),t=t.replace(/\s{2,}/g," "),s.length>0&&(t+="\n\n"+s.join("\n")),(o+t).trim()}}},516:(e,t,n)=>{n.d(t,{w:()=>r});class r{static needsRstParser(e){return!e.startsWith("---")&&([/^\.\.[ \t]+\w+::/m,/`[^<]+[ \t]*<[^>]+>`_/,/^\.\.[ \t]+(note|warning|important)::/m,/::[ \t]*$/m].filter(t=>t.test(e)).length>=1||(!!/^.+\n[=~^"'`#*+<>-]{4,}[ \t]*$/m.test(e)||[/^\.\.[ \t]+\w+::/m,/^[=~^"'`#*+<>-]{4,}[ \t]*$/m,/`[^`]+`__?/,/`[^<]+[ \t]*<[^>]+>`_/,/::[ \t]*$/m,/^\.\.[ \t]+(note|warning|important)::/m,/^\*[ \t]+\S/m,/^\d+\.[ \t]+\S/m].filter(t=>t.test(e)).length>=2))}static needsLatexParser(e){return!e.startsWith("---")&&([/\\documentclass\{/,/\\begin\{document\}/,/\\section\*?\{/,/\\subsection\*?\{/,/\\usepackage\{/,/\\textbf\{/,/\\textit\{/,/\\emph\{/,/\\item\b/,/\\cite\{/,/\\ref\{/,/\\label\{/].filter(t=>t.test(e)).length>=1||[/\\documentclass\{/,/\\begin\{document\}/,/\\section\*?\{/,/\\subsection\*?\{/,/\\begin\{[^}]+\}/,/\\[a-zA-Z]+\{[^}]*\}/,/\\textbf\{/,/\\textit\{/,/\\emph\{/,/\\usepackage\{/,/\\href\{[^}]*\}\{[^}]*\}/,/\\item\b/,/\\cite\{/,/\\ref\{/,/\\label\{/].filter(t=>t.test(e)).length>=2)}static needsPandoc(e){return this.needsRstParser(e)||this.needsLatexParser(e)}}},660:t=>{t.exports=e},811:(e,t,n)=>{n.r(t),n.d(t,{convertLatexToLegalMarkdown:()=>c,convertLatexToLegalMarkdownSync:()=>u,isLatex:()=>l,parseLatex:()=>a,parseLatexSync:()=>s});var r=n(516),i=n(834),o=n(509);async function a(e){try{const t=await i.w.createForContent(e);return t?(await t.convert(e,"latex","markdown")).replace(/\n{3,}/g,"\n\n").trim():o.f.convertLatexBasic(e)}catch(t){return console.error("Error parsing LaTeX:",t),o.f.convertLatexBasic(e)}}function s(e){return o.f.convertLatexBasic(e)}function l(e){return r.w.needsLatexParser(e)}async function c(e){return l(e)?await a(e):e}function u(e){return l(e)?s(e):e}},834:(e,t,n)=>{n.d(t,{w:()=>l});var r=n(516);class i{static pandocWasm=null;static loadingPromise=null;static async loadIfNeeded(e){if(!r.w.needsPandoc(e))return!1;if("undefined"==typeof window)return!0;if(this.pandocWasm)return!0;if(this.loadingPromise)try{return await this.loadingPromise,null!==this.pandocWasm}catch(e){return!1}this.loadingPromise=this.loadPandocWasm();try{return this.pandocWasm=await this.loadingPromise,!0}catch(e){return console.warn("Failed to load pandoc-wasm:",e),!1}finally{this.loadingPromise=null}}static getPandocWasm(){return this.pandocWasm}static async loadPandocWasm(){try{const e=await Promise.resolve().then(n.t.bind(n,162,23));return"function"==typeof e.init?await e.init():"function"==typeof e.default?await e.default():"object"==typeof e.default&&e.default.convert?e.default:e}catch(e){throw new Error(`Failed to load pandoc-wasm: ${e.message}`)}}static reset(){this.pandocWasm=null,this.loadingPromise=null}}var o=n(660);class a{options;constructor(e={}){this.options={timeout:1e4,verbose:!1,...e}}async convert(e,t,n){return new Promise((r,i)=>{const a=["-f",t,"-t",n,"--wrap=none"];this.options.args&&a.push(...this.options.args),this.options.verbose&&console.log(`Running pandoc with args: ${a.join(" ")}`);const s=(0,o.spawn)("pandoc",a);let l="",c="";const u=setTimeout(()=>{s.kill(),i(new Error(`Pandoc conversion timed out after ${this.options.timeout}ms`))},this.options.timeout);s.stdout.on("data",e=>{l+=e.toString()}),s.stderr.on("data",e=>{c+=e.toString()}),s.on("close",e=>{clearTimeout(u),0===e?r(l):i(new Error(`Pandoc failed with code ${e}: ${c}`))}),s.on("error",e=>{clearTimeout(u),i(new Error(`Failed to start pandoc: ${e.message}`))}),s.stdin.write(e),s.stdin.end()})}}class s{pandocWasm;options;constructor(e,t={}){this.pandocWasm=e,this.options={timeout:1e4,verbose:!1,...t}}async convert(e,t,n){if(!this.pandocWasm)throw new Error("Pandoc WASM not initialized");try{this.options.verbose&&console.log(`Converting ${t} to ${n} using pandoc-wasm`);const r=new Promise((e,t)=>{setTimeout(()=>{t(new Error(`Pandoc WASM conversion timed out after ${this.options.timeout}ms`))},this.options.timeout)});let i;if("function"==typeof this.pandocWasm.convert)i=Promise.resolve(this.pandocWasm.convert(e,t,n));else if("function"==typeof this.pandocWasm.pandoc)i=Promise.resolve(this.pandocWasm.pandoc(e,{from:t,to:n}));else{if("function"!=typeof this.pandocWasm.run)throw new Error("Unsupported pandoc-wasm API");{const r=["-f",t,"-t",n,"--wrap=none"];this.options.args&&r.push(...this.options.args),i=Promise.resolve(this.pandocWasm.run(r,e))}}return await Promise.race([i,r])}catch(e){throw new Error(`Pandoc WASM conversion failed: ${e.message}`)}}}class l{static async create(e={}){if("undefined"==typeof window)return new a(e);{const t=i.getPandocWasm();if(t)return new s(t,e);if(await i.loadIfNeeded("# dummy content to trigger loading")){const t=i.getPandocWasm();if(t)return new s(t,e)}return null}}static async createForContent(e,t={}){return await i.loadIfNeeded(e)?this.create(t):null}static async isAvailable(){try{return null!==await this.create()}catch(e){return!1}}static getEnvironmentInfo(){const e="undefined"==typeof window?"node":"browser",t=i.getPandocWasm();return{environment:e,pandocWasmLoaded:null!==t,pandocWasmInstance:t}}}}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return i[e](n,n.exports,a),n.exports}r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var i=Object.create(null);a.r(i);var o={};n=n||[null,r({}),r([]),r(r)];for(var s=2&t&&e;("object"==typeof s||"function"==typeof s)&&!~n.indexOf(s);s=r(s))Object.getOwnPropertyNames(s).forEach(t=>o[t]=()=>e[t]);return o.default=()=>e,a.d(i,o),i},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};a.d(s,{default:()=>mt});var l=function(e){return"object"==typeof e&&null!==e},c=function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},u=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e};function p(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),r+" "+n):r}function f(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=p(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}f.prototype=Object.create(Error.prototype),f.prototype.constructor=f,f.prototype.toString=function(e){return this.name+": "+p(this,e)};var d=f;function g(e,t,n,r,i){var o="",a="",s=Math.floor(i/2)-1;return r-t>s&&(t=r-s+(o=" ... ").length),n-r>s&&(n=r+s-(a=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"→")+a,pos:r-t+o.length}}function h(e,t){return c(" ",t-e.length)+e}var m=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],v=["scalar","sequence","mapping"],b=function(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===m.indexOf(t))throw new d('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}(t.styleAliases||null),-1===v.indexOf(this.kind))throw new d('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function y(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}function w(e){return this.extend(e)}w.prototype.extend=function(e){var t=[],n=[];if(e instanceof b)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new d("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach(function(e){if(!(e instanceof b))throw new d("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new d("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new d("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(e){if(!(e instanceof b))throw new d("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(w.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=y(r,"implicit"),r.compiledExplicit=y(r,"explicit"),r.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(r.compiledImplicit,r.compiledExplicit),r};var $=new w({explicit:[new b("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),new b("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),new b("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})]}),x=new b("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),k=new b("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function A(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function S(e){return 48<=e&&e<=55}function M(e){return 48<=e&&e<=57}var C=new b("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n=e.length,r=0,i=!1;if(!n)return!1;if("-"!==(t=e[r])&&"+"!==t||(t=e[++r]),"0"===t){if(r+1===n)return!0;if("b"===(t=e[++r])){for(r++;r<n;r++)if("_"!==(t=e[r])){if("0"!==t&&"1"!==t)return!1;i=!0}return i&&"_"!==t}if("x"===t){for(r++;r<n;r++)if("_"!==(t=e[r])){if(!A(e.charCodeAt(r)))return!1;i=!0}return i&&"_"!==t}if("o"===t){for(r++;r<n;r++)if("_"!==(t=e[r])){if(!S(e.charCodeAt(r)))return!1;i=!0}return i&&"_"!==t}}if("_"===t)return!1;for(;r<n;r++)if("_"!==(t=e[r])){if(!M(e.charCodeAt(r)))return!1;i=!0}return!(!i||"_"===t)},construct:function(e){var t,n=e,r=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(r=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return r*parseInt(n.slice(2),2);if("x"===n[1])return r*parseInt(n.slice(2),16);if("o"===n[1])return r*parseInt(n.slice(2),8)}return r*parseInt(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!u(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),I=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),L=/^[-+]?[0-9]+e/,T=new b("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!I.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||u(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(u(e))return"-0.0";return n=e.toString(10),L.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),O=$.extend({implicit:[x,k,C,T]}),E=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),F=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"),j=new b("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==E.exec(e)||null!==F.exec(e))},construct:function(e){var t,n,r,i,o,a,s,l,c=0,u=null;if(null===(t=E.exec(e))&&(t=F.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(o=+t[4],a=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),l=new Date(Date.UTC(n,r,i,o,a,s,c)),u&&l.setTime(l.getTime()-u),l},instanceOf:Date,represent:function(e){return e.toISOString()}}),N=new b("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),Y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r",D=new b("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,i=e.length,o=Y;for(n=0;n<i;n++)if(!((t=o.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,o=Y,a=0,s=[];for(t=0;t<i;t++)t%4==0&&t&&(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|o.indexOf(r.charAt(t));return 0==(n=i%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===n?(s.push(a>>10&255),s.push(a>>2&255)):12===n&&s.push(a>>4&255),new Uint8Array(s)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,r="",i=0,o=e.length,a=Y;for(t=0;t<o;t++)t%3==0&&t&&(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]),i=(i<<8)+e[t];return 0==(n=o%3)?(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]):2===n?(r+=a[i>>10&63],r+=a[i>>4&63],r+=a[i<<2&63],r+=a[64]):1===n&&(r+=a[i>>2&63],r+=a[i<<4&63],r+=a[64],r+=a[64]),r}}),P=Object.prototype.hasOwnProperty,R=Object.prototype.toString,W=new b("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,i,o,a=[],s=e;for(t=0,n=s.length;t<n;t+=1){if(r=s[t],o=!1,"[object Object]"!==R.call(r))return!1;for(i in r)if(P.call(r,i)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==a.indexOf(i))return!1;a.push(i)}return!0},construct:function(e){return null!==e?e:[]}}),_=Object.prototype.toString,U=new b("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,i,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1){if(r=a[t],"[object Object]"!==_.call(r))return!1;if(1!==(i=Object.keys(r)).length)return!1;o[t]=[i[0],r[i[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,i,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1)r=a[t],i=Object.keys(r),o[t]=[i[0],r[i[0]]];return o}}),q=Object.prototype.hasOwnProperty,B=new b("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(q.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}}),z=O.extend({implicit:[j,N],explicit:[D,W,U,B]}),G=Object.prototype.hasOwnProperty,V=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,J=/[\x85\u2028\u2029]/,X=/[,\[\]\{\}]/,Z=/^(?:!|!!|![a-z\-]+!)$/i,H=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function K(e){return Object.prototype.toString.call(e)}function Q(e){return 10===e||13===e}function ee(e){return 9===e||32===e}function te(e){return 9===e||32===e||10===e||13===e}function ne(e){return 44===e||91===e||93===e||123===e||125===e}function re(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function ie(e){return 120===e?2:117===e?4:85===e?8:0}function oe(e){return 48<=e&&e<=57?e-48:-1}function ae(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function se(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var le=new Array(256),ce=new Array(256),ue=0;ue<256;ue++)le[ue]=ae(ue)?1:0,ce[ue]=ae(ue);function pe(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||z,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function fe(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,r=/\r?\n|\r|\0/g,i=[0],o=[],a=-1;n=r.exec(e.buffer);)o.push(n.index),i.push(n.index+n[0].length),e.position<=n.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var s,l,u="",p=Math.min(e.line+t.linesAfter,o.length).toString().length,f=t.maxLength-(t.indent+p+3);for(s=1;s<=t.linesBefore&&!(a-s<0);s++)l=g(e.buffer,i[a-s],o[a-s],e.position-(i[a]-i[a-s]),f),u=c(" ",t.indent)+h((e.line-s+1).toString(),p)+" | "+l.str+"\n"+u;for(l=g(e.buffer,i[a],o[a],e.position,f),u+=c(" ",t.indent)+h((e.line+1).toString(),p)+" | "+l.str+"\n",u+=c("-",t.indent+p+3+l.pos)+"^\n",s=1;s<=t.linesAfter&&!(a+s>=o.length);s++)l=g(e.buffer,i[a+s],o[a+s],e.position-(i[a]-i[a+s]),f),u+=c(" ",t.indent)+h((e.line+s+1).toString(),p)+" | "+l.str+"\n";return u.replace(/\n$/,"")}(n),new d(t,n)}function de(e,t){throw fe(e,t)}function ge(e,t){e.onWarning&&e.onWarning.call(null,fe(e,t))}var he={YAML:function(e,t,n){var r,i,o;null!==e.version&&de(e,"duplication of %YAML directive"),1!==n.length&&de(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&de(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&de(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&ge(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&de(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],Z.test(r)||de(e,"ill-formed tag handle (first argument) of the TAG directive"),G.call(e.tagMap,r)&&de(e,'there is a previously declared suffix for "'+r+'" tag handle'),H.test(i)||de(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(t){de(e,"tag prefix is malformed: "+i)}e.tagMap[r]=i}};function me(e,t,n,r){var i,o,a,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,o=s.length;i<o;i+=1)9===(a=s.charCodeAt(i))||32<=a&&a<=1114111||de(e,"expected valid JSON character");else V.test(s)&&de(e,"the stream contains non-printable characters");e.result+=s}}function ve(e,t,n,r){var i,o,a,s;for(l(n)||de(e,"cannot merge mappings; the provided source object is unacceptable"),a=0,s=(i=Object.keys(n)).length;a<s;a+=1)o=i[a],G.call(t,o)||(t[o]=n[o],r[o]=!0)}function be(e,t,n,r,i,o,a,s,l){var c,u;if(Array.isArray(i))for(c=0,u=(i=Array.prototype.slice.call(i)).length;c<u;c+=1)Array.isArray(i[c])&&de(e,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===K(i[c])&&(i[c]="[object Object]");if("object"==typeof i&&"[object Object]"===K(i)&&(i="[object Object]"),i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(o))for(c=0,u=o.length;c<u;c+=1)ve(e,t,o[c],n);else ve(e,t,o,n);else e.json||G.call(n,i)||!G.call(t,i)||(e.line=a||e.line,e.lineStart=s||e.lineStart,e.position=l||e.position,de(e,"duplicated mapping key")),"__proto__"===i?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:o}):t[i]=o,delete n[i];return t}function ye(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):de(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function we(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);0!==i;){for(;ee(i);)9===i&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&35===i)do{i=e.input.charCodeAt(++e.position)}while(10!==i&&13!==i&&0!==i);if(!Q(i))break;for(ye(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&ge(e,"deficient indentation"),r}function $e(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!te(t)))}function xe(e,t){1===t?e.result+=" ":t>1&&(e.result+=c("\n",t-1))}function ke(e,t){var n,r,i=e.tag,o=e.anchor,a=[],s=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),r=e.input.charCodeAt(e.position);0!==r&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,de(e,"tab characters must not be used in indentation")),45===r)&&te(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,we(e,!0,-1)&&e.lineIndent<=t)a.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,Me(e,t,3,!1,!0),a.push(e.result),we(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)de(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!s&&(e.tag=i,e.anchor=o,e.kind="sequence",e.result=a,!0)}function Ae(e){var t,n,r,i,o=!1,a=!1;if(33!==(i=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&de(e,"duplication of a tag property"),60===(i=e.input.charCodeAt(++e.position))?(o=!0,i=e.input.charCodeAt(++e.position)):33===i?(a=!0,n="!!",i=e.input.charCodeAt(++e.position)):n="!",t=e.position,o){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&62!==i);e.position<e.length?(r=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):de(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!te(i);)33===i&&(a?de(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),Z.test(n)||de(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),X.test(r)&&de(e,"tag suffix cannot contain flow indicator characters")}r&&!H.test(r)&&de(e,"tag name cannot contain such characters: "+r);try{r=decodeURIComponent(r)}catch(t){de(e,"tag name is malformed: "+r)}return o?e.tag=r:G.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:de(e,'undeclared tag handle "'+n+'"'),!0}function Se(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&de(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!te(n)&&!ne(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&de(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Me(e,t,n,r,i){var o,a,s,l,u,p,f,d,g,h=1,m=!1,v=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=s=4===n||3===n,r&&we(e,!0,-1)&&(m=!0,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)),1===h)for(;Ae(e)||Se(e);)we(e,!0,-1)?(m=!0,s=o,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)):s=!1;if(s&&(s=m||i),1!==h&&4!==n||(d=1===n||2===n?t:t+1,g=e.position-e.lineStart,1===h?s&&(ke(e,g)||function(e,t,n){var r,i,o,a,s,l,c,u=e.tag,p=e.anchor,f={},d=Object.create(null),g=null,h=null,m=null,v=!1,b=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=f),c=e.input.charCodeAt(e.position);0!==c;){if(v||-1===e.firstTabInLine||(e.position=e.firstTabInLine,de(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,63!==c&&58!==c||!te(r)){if(a=e.line,s=e.lineStart,l=e.position,!Me(e,n,2,!1,!0))break;if(e.line===o){for(c=e.input.charCodeAt(e.position);ee(c);)c=e.input.charCodeAt(++e.position);if(58===c)te(c=e.input.charCodeAt(++e.position))||de(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(be(e,f,d,g,h,null,a,s,l),g=h=m=null),b=!0,v=!1,i=!1,g=e.tag,h=e.result;else{if(!b)return e.tag=u,e.anchor=p,!0;de(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!b)return e.tag=u,e.anchor=p,!0;de(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(v&&(be(e,f,d,g,h,null,a,s,l),g=h=m=null),b=!0,v=!0,i=!0):v?(v=!1,i=!0):de(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,c=r;if((e.line===o||e.lineIndent>t)&&(v&&(a=e.line,s=e.lineStart,l=e.position),Me(e,t,4,!0,i)&&(v?h=e.result:m=e.result),v||(be(e,f,d,g,h,m,a,s,l),g=h=m=null),we(e,!0,-1),c=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==c)de(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&be(e,f,d,g,h,null,a,s,l),b&&(e.tag=u,e.anchor=p,e.kind="mapping",e.result=f),b}(e,g,d))||function(e,t){var n,r,i,o,a,s,l,c,u,p,f,d,g=!0,h=e.tag,m=e.anchor,v=Object.create(null);if(91===(d=e.input.charCodeAt(e.position)))a=93,c=!1,o=[];else{if(123!==d)return!1;a=125,c=!0,o={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),d=e.input.charCodeAt(++e.position);0!==d;){if(we(e,!0,t),(d=e.input.charCodeAt(e.position))===a)return e.position++,e.tag=h,e.anchor=m,e.kind=c?"mapping":"sequence",e.result=o,!0;g?44===d&&de(e,"expected the node content, but found ','"):de(e,"missed comma between flow collection entries"),f=null,s=l=!1,63===d&&te(e.input.charCodeAt(e.position+1))&&(s=l=!0,e.position++,we(e,!0,t)),n=e.line,r=e.lineStart,i=e.position,Me(e,t,1,!1,!0),p=e.tag,u=e.result,we(e,!0,t),d=e.input.charCodeAt(e.position),!l&&e.line!==n||58!==d||(s=!0,d=e.input.charCodeAt(++e.position),we(e,!0,t),Me(e,t,1,!1,!0),f=e.result),c?be(e,o,v,p,u,f,n,r,i):s?o.push(be(e,null,v,p,u,f,n,r,i)):o.push(u),we(e,!0,t),44===(d=e.input.charCodeAt(e.position))?(g=!0,d=e.input.charCodeAt(++e.position)):g=!1}de(e,"unexpected end of the stream within a flow collection")}(e,d)?v=!0:(a&&function(e,t){var n,r,i,o,a=1,s=!1,l=!1,u=t,p=0,f=!1;if(124===(o=e.input.charCodeAt(e.position)))r=!1;else{if(62!==o)return!1;r=!0}for(e.kind="scalar",e.result="";0!==o;)if(43===(o=e.input.charCodeAt(++e.position))||45===o)1===a?a=43===o?3:2:de(e,"repeat of a chomping mode identifier");else{if(!((i=oe(o))>=0))break;0===i?de(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?de(e,"repeat of an indentation width identifier"):(u=t+i-1,l=!0)}if(ee(o)){do{o=e.input.charCodeAt(++e.position)}while(ee(o));if(35===o)do{o=e.input.charCodeAt(++e.position)}while(!Q(o)&&0!==o)}for(;0!==o;){for(ye(e),e.lineIndent=0,o=e.input.charCodeAt(e.position);(!l||e.lineIndent<u)&&32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>u&&(u=e.lineIndent),Q(o))p++;else{if(e.lineIndent<u){3===a?e.result+=c("\n",s?1+p:p):1===a&&s&&(e.result+="\n");break}for(r?ee(o)?(f=!0,e.result+=c("\n",s?1+p:p)):f?(f=!1,e.result+=c("\n",p+1)):0===p?s&&(e.result+=" "):e.result+=c("\n",p):e.result+=c("\n",s?1+p:p),s=!0,l=!0,p=0,n=e.position;!Q(o)&&0!==o;)o=e.input.charCodeAt(++e.position);me(e,n,e.position,!1)}}return!0}(e,d)||function(e,t){var n,r,i;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(me(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,i=e.position}else Q(n)?(me(e,r,i,!0),xe(e,we(e,!1,t)),r=i=e.position):e.position===e.lineStart&&$e(e)?de(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);de(e,"unexpected end of the stream within a single quoted scalar")}(e,d)||function(e,t){var n,r,i,o,a,s;if(34!==(s=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(s=e.input.charCodeAt(e.position));){if(34===s)return me(e,n,e.position,!0),e.position++,!0;if(92===s){if(me(e,n,e.position,!0),Q(s=e.input.charCodeAt(++e.position)))we(e,!1,t);else if(s<256&&le[s])e.result+=ce[s],e.position++;else if((a=ie(s))>0){for(i=a,o=0;i>0;i--)(a=re(s=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+a:de(e,"expected hexadecimal character");e.result+=se(o),e.position++}else de(e,"unknown escape sequence");n=r=e.position}else Q(s)?(me(e,n,r,!0),xe(e,we(e,!1,t)),n=r=e.position):e.position===e.lineStart&&$e(e)?de(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}de(e,"unexpected end of the stream within a double quoted scalar")}(e,d)?v=!0:function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!te(r)&&!ne(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&de(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),G.call(e.anchorMap,n)||de(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],we(e,!0,-1),!0}(e)?(v=!0,null===e.tag&&null===e.anchor||de(e,"alias node should not have any properties")):function(e,t,n){var r,i,o,a,s,l,c,u,p=e.kind,f=e.result;if(te(u=e.input.charCodeAt(e.position))||ne(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(te(r=e.input.charCodeAt(e.position+1))||n&&ne(r)))return!1;for(e.kind="scalar",e.result="",i=o=e.position,a=!1;0!==u;){if(58===u){if(te(r=e.input.charCodeAt(e.position+1))||n&&ne(r))break}else if(35===u){if(te(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&$e(e)||n&&ne(u))break;if(Q(u)){if(s=e.line,l=e.lineStart,c=e.lineIndent,we(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=l,e.lineIndent=c;break}}a&&(me(e,i,o,!1),xe(e,e.line-s),i=o=e.position,a=!1),ee(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return me(e,i,o,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,d,1===n)&&(v=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===h&&(v=s&&ke(e,g))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&de(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),l=0,u=e.implicitTypes.length;l<u;l+=1)if((f=e.implicitTypes[l]).resolve(e.result)){e.result=f.construct(e.result),e.tag=f.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(G.call(e.typeMap[e.kind||"fallback"],e.tag))f=e.typeMap[e.kind||"fallback"][e.tag];else for(f=null,l=0,u=(p=e.typeMap.multi[e.kind||"fallback"]).length;l<u;l+=1)if(e.tag.slice(0,p[l].tag.length)===p[l].tag){f=p[l];break}f||de(e,"unknown tag !<"+e.tag+">"),null!==e.result&&f.kind!==e.kind&&de(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+f.kind+'", not "'+e.kind+'"'),f.resolve(e.result,e.tag)?(e.result=f.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):de(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||v}function Ce(e){var t,n,r,i,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(i=e.input.charCodeAt(e.position))&&(we(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(a=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!te(i);)i=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&de(e,"directive name must not be less than one character in length");0!==i;){for(;ee(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!Q(i));break}if(Q(i))break;for(t=e.position;0!==i&&!te(i);)i=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==i&&ye(e),G.call(he,n)?he[n](e,n,r):ge(e,'unknown document directive "'+n+'"')}we(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,we(e,!0,-1)):a&&de(e,"directives end mark is expected"),Me(e,e.lineIndent-1,4,!1,!0),we(e,!0,-1),e.checkLineBreaks&&J.test(e.input.slice(o,e.position))&&ge(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&$e(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,we(e,!0,-1)):e.position<e.length-1&&de(e,"end of the stream or a document separator is expected")}function Ie(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new pe(e,t),r=e.indexOf("\0");for(-1!==r&&(n.position=r,de(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Ce(n);return n.documents}var Le=function(e,t){var n=Ie(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new d("expected a single document in the stream, but found more")}};function Te(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}Object.prototype.toString,Object.prototype.hasOwnProperty;var Oe=Le;function Ee(e,t=!1){if(e<=0)return"";const n=[{value:1e3,numeral:"M"},{value:900,numeral:"CM"},{value:500,numeral:"D"},{value:400,numeral:"CD"},{value:100,numeral:"C"},{value:90,numeral:"XC"},{value:50,numeral:"L"},{value:40,numeral:"XL"},{value:10,numeral:"X"},{value:9,numeral:"IX"},{value:5,numeral:"V"},{value:4,numeral:"IV"},{value:1,numeral:"I"}];let r="",i=e;for(const{value:e,numeral:t}of n)for(;i>=e;)r+=t,i-=e;return t?r.toLowerCase():r}function Fe(e){if(e<=0)return"";let t="",n=e;for(;n>0;){const e=(n-1)%26;t=String.fromCharCode(97+e)+t,n=Math.floor((n-1)/26)}return t}function je(e,t,n,r,i=0){if(e<1||e>6)return`l${e}. ${t}`;const o=t.replace(/\s*\|[\w.-]+\|\s*$/g,"").trim(),a=function(e,t){let n;switch(e){case 1:n=t.levelOne;break;case 2:n=t.levelTwo;break;case 3:n=t.levelThree;break;case 4:n=t.levelFour;break;case 5:n=t.levelFive;break;case 6:n=t.levelSix;break;default:n="%n."}if("string"!=typeof n)switch(e){case 1:return"Article %n.";case 2:return"Section %n.";case 3:return"(%n)";case 4:return"(%n%c)";case 5:return"(%n%c%r)";case 6:return"Annex %r -";default:return"%n."}return n}(e,r);if("string"!=typeof a)return`l${e}. ${o}`;let s=a;const l=a.includes("%r.%n")||a.includes("%R.%n"),c=a.includes("%c.%n"),u=r.levelOne?.includes("%c")&&r.levelTwo?.includes("%c.%n");if(s=s.replace(/%0(\d+)n/g,(t,r)=>n[e-1].toString().padStart(parseInt(r),"0")),s=s.replace(/%0(\d+)s/g,(e,t)=>n[0].toString().padStart(parseInt(t),"0")),s=s.replace(/%0(\d+)t/g,(e,t)=>n[1].toString().padStart(parseInt(t),"0")),s=s.replace(/%0(\d+)f/g,(e,t)=>n[2].toString().padStart(parseInt(t),"0")),s=s.replace(/%0(\d+)i/g,(e,t)=>n[3].toString().padStart(parseInt(t),"0")),4===e)!s.includes("%n%c")||s.includes(".%s")||s.includes(".%t")||s.includes(".%f")||(s=s.replace(/%n/g,n[2].toString()),s=s.replace(/%c/g,Fe(n[3])));else if(5===e&&(s.includes("%c%r")||s.includes("%n%c%r"))){s=s.replace(/%n/g,n[2].toString()),s=s.replace(/%c/g,Fe(n[3]));const e=!0;s=s.replace(/%r/g,Ee(n[4],e))}const p="string"==typeof r.levelThree&&r.levelThree.includes("%n.%s.%t")||"string"==typeof r.levelFour&&r.levelFour.includes("%n.%s.%t.%f")||"string"==typeof r.levelFive&&r.levelFive.includes("%n.%s.%t.%f.%i"),f=(s.includes(".%s.%t")||s.includes(".%t.%f")||s.includes(".%f.%i")||s.includes(".%s")&&p)&&!s.includes("%r.")&&!s.includes("%R.")&&!s.includes("%c.");s=f?s.replace(/%n/g,n[0].toString()):s.replace(/%n/g,n[e-1].toString()),s=f?s.replace(/%s/g,n[1].toString()):s.replace(/%s/g,n[0].toString()),s=s.replace(/%t/g,n[2].toString()),s=s.replace(/%f/g,n[3].toString()),s=s.replace(/%i/g,n[4].toString()),c&&e>1||u&&e>1?s=s.replace(/%c/g,Fe(n[0])):(e<=3||e>=4&&s.includes("%c"))&&(s=s.replace(/%c/g,Fe(n[e-1]))),l&&e>1?s=s.replace(/%r/g,Ee(n[0],!0)):(e<=3||e>=4&&s.includes("%r"))&&(s=s.replace(/%r/g,Ee(n[e-1],!0))),a.includes("%R.%n")&&e>1?s=s.replace(/%R/g,Ee(n[0],!1)):(e<=3||e>=4&&s.includes("%R"))&&(s=s.replace(/%R/g,Ee(n[e-1],!1)));const d=r.noIndent?"":" ".repeat(Math.floor((e-1)*(r.levelIndent||1.5)*2));return r.enableFieldTrackingInMarkdown?`${d}<span class="${["legal-header",`legal-header-level-${e}`,Ne(e)].join(" ")}" data-level="${e}" data-number="${n[e-1]}">${s} ${o}</span>`:`${d}${s} ${o}`}function Ne(e){switch(e){case 1:return"legal-article";case 2:return"legal-section";case 3:return"legal-subsection";case 4:return"legal-sub-subsection";case 5:return"legal-paragraph";case 6:return"legal-annex";default:return"legal-header-unknown"}}function Ye(e,t){return e.replace(/\[([^[\]]*(?:\[[^\]]*\][^[\]]*)*?)\]\{([^{}]*?)\}/g,(e,n,r)=>De(r,t)?n:"")}function De(e,t){if(!e.trim())return!0;if(!(e.includes("=")||e.includes("!")||e.includes("AND")||e.includes("OR"))){const n=Pe(t,e.trim());return Boolean(n)}try{if(e.includes(" AND "))return e.split(" AND ").map(e=>e.trim()).every(e=>De(e,t));if(e.includes(" OR "))return e.split(" OR ").map(e=>e.trim()).some(e=>De(e,t));if(e.includes("=")){const n=e.includes("!="),r=e.split(n?"!=":"=").map(e=>e.trim());if(2!==r.length)return!1;const[i,o]=r,a=Pe(t,i);let s=o;return o.startsWith('"')&&o.endsWith('"')?s=o.slice(1,-1):"true"===o?s=!0:"false"===o?s=!1:isNaN(Number(o))||(s=Number(o)),n?a!==s:a===s}return!1}catch(e){return console.error("Error evaluating condition:",e),!1}}function Pe(e,t){const n=t.split(".");let r=e;for(const e of n){if(null==r)return;r=r[e]}return r}Te("safeLoad","load"),Te("safeLoadAll","loadAll"),Te("safeDump","dump");let Re=!1;({}).env&&{}.env.LOG_LEVEL;const We=e=>{Re=e},_e=(e,t)=>{Re&&console.debug(`[DEBUG] ${e}`,t||"")};var Ue;!function(e){e.FILLED="filled",e.EMPTY="empty",e.LOGIC="logic"}(Ue||(Ue={}));const qe=new class{fields=new Map;processedContent="";totalOccurrences=0;constructor(){}trackField(e,t){const{value:n,originalValue:r,hasLogic:i=!1,mixinUsed:o}=t;let a;a=i||o&&["conditional","helper","loop"].includes(o)?Ue.LOGIC:null==n||""===n?Ue.EMPTY:Ue.FILLED;const s={name:e,status:a,value:n,originalValue:r,hasLogic:i,mixinUsed:o};this.fields.set(e,s),this.totalOccurrences++,_e("Field tracked",{fieldName:e,status:a,hasLogic:i})}applyFieldTracking(e){let t=e;return this.fields.forEach((e,n)=>{const r=this.getFieldCssClass(e.status),i=this.escapeRegex(n).replace(/_/g,"\\\\_?"),o=new RegExp(`\\{\\{\\s*${i}\\s*\\}\\}`,"g");if(t=t.replace(o,(t,i,o)=>{const a=o.substring(0,i),s=a.lastIndexOf("<span");if(s>a.lastIndexOf("</span>")&&-1!==s)return t;const l=void 0!==e.value&&null!==e.value&&""!==e.value?String(e.value):t;return`<span class="${r}" data-field="${n.replace(/"/g,"&quot;")}">${l}</span>`}),void 0!==e.value&&null!==e.value&&""!==e.value){const i=String(e.value);if("logic"===e.status||n.startsWith("crossref.")){const e=t.split(/(<[^>]*>)/);for(let t=0;t<e.length;t++)if(t%2==0&&e[t]&&e[t].includes(i)){const o=e[t],a=t>0?e[t-1]:"",s=t<e.length-1?e[t+1]:"";if((a.includes('class="highlight"')||a.includes('class="imported-value"')||a.includes('class="missing-value"'))&&"</span>"===s)continue;const l=this.escapeRegex(i);e[t]=o.replace(new RegExp(l,"g"),e=>`<span class="${r}" data-field="${n.replace(/"/g,"&quot;")}">${e}</span>`)}t=e.join("")}}}),this.processedContent=t,t}getFieldCssClass(e){switch(e){case Ue.FILLED:return"legal-field imported-value";case Ue.EMPTY:return"legal-field missing-value";case Ue.LOGIC:return"legal-field highlight";default:return""}}escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}getFields(){return new Map(this.fields)}getTotalOccurrences(){return this.totalOccurrences}getFieldsByStatus(e){return Array.from(this.fields.values()).filter(t=>t.status===e)}generateReport(){const e=Array.from(this.fields.values());return{total:e.length,filled:e.filter(e=>e.status===Ue.FILLED).length,empty:e.filter(e=>e.status===Ue.EMPTY).length,logic:e.filter(e=>e.status===Ue.LOGIC).length,fields:e}}clear(){this.fields.clear(),this.processedContent="",this.totalOccurrences=0}};function Be(e){const t=["th","st","nd","rd"],n=e%100;return n>=11&&n<=13?e+t[0]:e+(t[n%10]||t[0])}function ze(e,t="EUR",n=2){const r="string"==typeof e?parseFloat(e):e;if(isNaN(r))return String(e);const i=r.toFixed(n).replace(/\B(?=(\d{3})+(?!\d))/g,","),o={EUR:"€",USD:"$",GBP:"£"}[t]||t;return"EUR"===t?`${i} ${o}`:`${o}${i}`}function Ge(e){return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""}function Ve(e){return e?e.split(/[\s-_]+/).map((e,t)=>0===t?e.toLowerCase():e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(""):""}const Je={addYears:function(e,t){if(!e)throw new Error("Date is required for addYears");const n=new Date(e);if(isNaN(n.getTime()))throw new Error(`Invalid date: ${e}`);return n.setFullYear(n.getFullYear()+t),n},addMonths:function(e,t){if(!e)throw new Error("Date is required for addMonths");const n=new Date(e);if(isNaN(n.getTime()))throw new Error(`Invalid date: ${e}`);return n.setMonth(n.getMonth()+t),n},addDays:function(e,t){if(!e)throw new Error("Date is required for addDays");const n=new Date(e);if(isNaN(n.getTime()))throw new Error(`Invalid date: ${e}`);return n.setDate(n.getDate()+t),n},formatDate:function(e,t="YYYY-MM-DD"){const n="string"==typeof e?new Date(e):e;if(isNaN(n.getTime()))throw new Error(`Invalid date: ${e}`);const r=n.getFullYear(),i=n.getMonth(),o=n.getDate(),a=n.getDay(),s={YYYY:String(r),YY:String(r).slice(-2),MMMM:["January","February","March","April","May","June","July","August","September","October","November","December"][i],MMMMES:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"][i],MMM:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][i],MM:String(i+1).padStart(2,"0"),M:String(i+1),DD:String(o).padStart(2,"0"),D:String(o),Do:Be(o),dddd:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][a],ddd:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][a]};let l=t;const c=Object.keys(s).sort((e,t)=>t.length-e.length);for(const e of c){const t=s[e],n=e.length<=2?new RegExp(`\\b${e}\\b`,"g"):new RegExp(e,"g");l=l.replace(n,t)}return l},DateFormats:{LEGAL:"Do day of MMMM, YYYY",FORMAL:"dddd, MMMM Do, YYYY",SPANISH:"D de MMMMES de YYYY",US:"MM/DD/YYYY",EU:"DD/MM/YYYY",ISO:"YYYY-MM-DD",LONG:"MMMM D, YYYY",SHORT:"MMM D, YYYY",YEAR:"YYYY",MONTH_YEAR:"MMMM YYYY"},formatInteger:function(e,t=","){const n="string"==typeof e?parseFloat(e):e;return isNaN(n)?String(e):Math.floor(n).toString().replace(/\B(?=(\d{3})+(?!\d))/g,t)},formatPercent:function(e,t=2,n=!0){const r="string"==typeof e?parseFloat(e):e;if(isNaN(r))return String(e);const i=(100*r).toFixed(t);return n?`${i}%`:i},formatCurrency:ze,formatEuro:function(e,t=2){return ze(e,"EUR",t)},formatDollar:function(e,t=2){return ze(e,"USD",t)},formatPound:function(e,t=2){return ze(e,"GBP",t)},numberToWords:function e(t){const n="string"==typeof t?parseFloat(t):t;if(isNaN(n))return String(t);if(0===n)return"zero";const r=["","one","two","three","four","five","six","seven","eight","nine"],i=["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"],o=["ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],a=e=>e>=1e6?a(Math.floor(e/1e6))+" million "+s(e%1e6):s(e),s=e=>e>=1e3?l(Math.floor(e/1e3))+" thousand "+l(e%1e3):l(e),l=e=>{let t="";if(e>99&&(t+=r[Math.floor(e/100)]+" hundred ",e%=100),e>19)t+=i[Math.floor(e/10)]+" ",e%=10;else if(e>9)return t+=o[e-10]+" ",t.trim();return e>0&&(t+=r[e]+" "),t.trim()};if(n<0)return"negative "+e(Math.abs(n));const c=Math.floor(n),u=Math.round(100*(n-c));let p=a(c);return u>0&&(p+=" and "+l(u)+" cents"),p.trim()},round:function(e,t=0){const n="string"==typeof e?parseFloat(e):e;if(isNaN(n))return 0;const r=Math.pow(10,t);return Math.round(n*r)/r},capitalize:Ge,capitalizeWords:function(e){return e?e.split(" ").map(e=>Ge(e)).join(" "):""},upper:function(e){return e?e.toUpperCase():""},lower:function(e){return e?e.toLowerCase():""},titleCase:function(e){if(!e)return"";const t=new Set(["a","an","and","as","at","but","by","for","if","in","nor","of","on","or","so","the","to","up","yet"]);return e.split(" ").map((n,r)=>{const i=n.toLowerCase();return 0===r||r===e.split(" ").length-1?Ge(n):t.has(i)?i:Ge(n)}).join(" ")},kebabCase:function(e){return e?e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase():""},snakeCase:function(e){return e?e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase():""},camelCase:Ve,pascalCase:function(e){if(!e)return"";const t=Ve(e);return t.charAt(0).toUpperCase()+t.slice(1)},truncate:function(e,t,n="..."){return e?e.length<=t?e:e.slice(0,t-n.length)+n:""},clean:function(e){return e?e.replace(/\s+/g," ").trim():""},pluralize:function(e,t,n){if(1===t)return e;if(n)return n;const r=[[/s$/i,"s"],[/([^aeiou])y$/i,"$1ies"],[/(x|z|s|sh|ch)$/i,"$1es"],[/$/i,"s"]];for(const[t,n]of r)if(t.test(e))return e.replace(t,n);return e+"s"},padStart:function(e,t,n=" "){return e?e.padStart(t,n):n.repeat(t)},padEnd:function(e,t,n=" "){return e?e.padEnd(t,n):n.repeat(t)},contains:function(e,t,n=!1){return!(!e||!t)&&(n?e.includes(t):e.toLowerCase().includes(t.toLowerCase()))},replaceAll:function(e,t,n){return e?e.split(t).join(n):""},initials:function(e){return e?e.split(" ").map(e=>e.charAt(0).toUpperCase()).join(""):""}},Xe=new Map;function Ze(e,t,n){for(const r of n)if(e>=r.start&&t<=r.end)return!0;return!1}function He(e){const t=e.trim();return t.includes("?")&&t.includes(":")?"conditional":t.includes("(")&&t.includes(")")?"helper":"variable"}function Ke(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Qe(e,t){return"."===t?e?.["."]:t.split(".").reduce((e,t)=>{const n=t.match(/^(\w+)\[(\d+)\]$/);if(n){const[,t,r]=n;return e?.[t]?.[parseInt(r,10)]}return e?.[t]},e)}function et(e,t){if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);if(/^-?\d+(\.\d+)?$/.test(e))return parseFloat(e);if("true"===e)return!0;if("false"===e)return!1;if("null"===e)return null;if("undefined"!==e){if("@today"===e)return new Date;if(e.includes("(")&&e.includes(")")){const n=tt(e,t);if(void 0!==n)return n}return Qe(t,e)}}function tt(e,t){try{const n=e.match(/^(\w+)\((.*)\)$/);if(!n)return;const[,r,i]=n,o=Je[r];if(!o||"function"!=typeof o)return;const a=function(e,t){if(!e.trim())return[];const n=[];let r="",i=!1,o="",a=0;for(let s=0;s<e.length;s++){const l=e[s];i||'"'!==l&&"'"!==l?i&&l===o?(i=!1,o="",r+=l):i||"("!==l?i||")"!==l?i||","!==l||0!==a?r+=l:(n.push(et(r.trim(),t)),r=""):(a--,r+=l):(a++,r+=l):(i=!0,o=l,r+=l)}return r.trim()&&n.push(et(r.trim(),t)),n}(i,t);return o(...a)}catch(t){return void console.warn(`Error evaluating helper expression: ${e}`,t)}}function nt(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function rt(e,t,n,r=!0){const i=function(e){const t=[],n=/\{\{#([\w.]+)\}\}([\s\S]*?)\{\{\/\1\}\}/g;let r;for(;null!==(r=n.exec(e));){const[e,n,i]=r;t.push({variable:n,content:i,start:r.index,end:r.index+e.length,fullMatch:e})}return t}(e);if(0===i.length)return e;let o=e;for(let e=i.length-1;e>=0;e--){const a=i[e],s=it(a,t,n,r);o=o.slice(0,a.start)+s+o.slice(a.end)}return o}function it(e,t,n,r=!0){const{variable:i,content:o}=e,a=function(e,t,n){const r=lt(t,e);if(void 0!==r)return r;if(n&&n.item){const t=lt(n.item,e);if(void 0!==t)return t}let i=n;for(;i&&i.parent;)if(i=i.parent,i.item){const t=lt(i.item,e);if(void 0!==t)return t}}(i,t,n);return qe.trackField(i,{value:a,hasLogic:!0,mixinUsed:"loop"}),Array.isArray(a)?function(e,t,n,r,i,o=!0){const a=[];for(let s=0;s<n.length;s++){const l=n[s],c={variable:e,item:l,index:s,total:n.length,parent:i},u=ot(r,l,c);let p=t;p=rt(p,u,c,o),p=ct(p,u,c,o),p=ft(p),a.push(p)}return a.join("\n")}(i,o,a,t,n,r):a?function(e,t,n,r,i,o=!0){const a={...r,[e]:n};let s=rt(t,a,i,o);return s=ct(s,a,i,o),s}(i,o,a,t,n,r):""}function ot(e,t,n){const r={...e};return t&&"object"==typeof t&&!Array.isArray(t)&&Object.assign(r,t),r["."]=t,r["@index"]=n.index,r["@total"]=n.total,r["@first"]=0===n.index,r["@last"]=n.index===n.total-1,r}function at(e,t){try{const n=e.match(/^(\w+)\((.*)\)$/);if(!n)return;const[,r,i]=n,o=Je[r];if(!o||"function"!=typeof o)return;const a=i?function(e,t){const n=[];let r="",i=0,o=!1,a="";for(let s=0;s<e.length;s++){const l=e[s];'"'!==l&&"'"!==l||o?l===a&&o?(o=!1,a="",r+=l):"("!==l||o?")"!==l||o?","!==l||0!==i||o?r+=l:(n.push(st(r.trim(),t)),r=""):(i--,r+=l):(i++,r+=l):(o=!0,a=l,r+=l)}return r.trim()&&n.push(st(r.trim(),t)),n}(i,t):[];return o(...a)}catch(t){return void console.error(`Error evaluating helper expression: ${e}`,t)}}function st(e,t){if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);if("true"===e)return!0;if("false"===e)return!1;if(/^\d+$/.test(e))return parseInt(e,10);if(/^\d+\.\d+$/.test(e))return parseFloat(e);if("@today"===e)return new Date;if(e.includes("(")&&e.includes(")")){const n=at(e,t);if(void 0!==n)return n}return lt(t,e)}function lt(e,t){const n=t.split(".");let r=e;for(const e of n){if(!r||"object"!=typeof r||!(e in r))return;r=r[e]}return r}function ct(e,t,n,r=!0){return e.replace(/\{\{([^}]+)\}\}/g,(e,n)=>{const i=n.trim();if(i.includes("?")&&i.includes(":")){const e=function(e,t,n=!0){const r=ut(e,"?"),i=ut(e,":",r);if(-1===r||-1===i)return e;const o=e.substring(0,r).trim(),a=e.substring(r+1,i).trim(),s=e.substring(i+1).trim(),l=pt(o,t)?a:s;if(l.startsWith('"')&&l.endsWith('"')||l.startsWith("'")&&l.endsWith("'")){const t=l.slice(1,-1);return n?`<span class="imported-value" data-field="${nt(e)}">${t}</span>`:t}const c=function(e,t){if(e.includes("+"))return e.split("+").map(e=>{const n=e.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);const r=pt(n,t);return void 0!==r?String(r):n}).join("");const n=pt(e,t);return void 0!==n?String(n):e}(l,t);return n?`<span class="imported-value" data-field="${nt(e)}">${c}</span>`:c}(i,t,r);return r?`<span class="highlight">${e}</span>`:e}if(i.includes("(")&&i.includes(")")){const e=at(i,t);if(void 0!==e)return qe.trackField(i,{value:e,hasLogic:!0,mixinUsed:"helper"}),r?`<span class="highlight"><span class="imported-value" data-field="${nt(i)}">${String(e)}</span></span>`:String(e)}const o=pt(i,t);return null==o?r?`<span class="missing-value" data-field="${nt(i)}">[[${i}]]</span>`:`{{${i}}}`:r?`<span class="imported-value" data-field="${nt(i)}">${String(o)}</span>`:String(o)})}function ut(e,t,n=0){let r=!1,i="";for(let o=n;o<e.length;o++){const n=e[o];if(r||'"'!==n&&"'"!==n){if(r&&n===i)r=!1,i="";else if(!r&&n===t)return o}else r=!0,i=n}return-1}function pt(e,t,n){if("."===e)return t["."];const r=e.split(".");let i=t;for(const e of r){if(!i||"object"!=typeof i||!Object.prototype.hasOwnProperty.call(i,e))return;i=i[e]}return i}function ft(e){const t=e.trim();return t.startsWith("- ")?`<li>${t.substring(2).trim()}</li>`:e}let dt,gt;if(dt=e=>e,gt=e=>e,"undefined"==typeof window){try{const e=a(480);dt=e.convertRstToLegalMarkdownSync}catch(e){}try{const e=a(811);gt=e.convertLatexToLegalMarkdownSync}catch(e){}}function ht(e,t={}){t.debug?(We(!0),_e("Debug mode enabled for Legal Markdown processing",{options:t})):We(!1),qe.clear();let n=dt(e);n=gt(n);const{content:r,metadata:i}=function(e,t=!1){const n={content:e,metadata:{}};if(!e.startsWith("---"))return n;const r=e.indexOf("---",3);if(-1===r)return n;let i=e.substring(3,r).trim();const o=e.substring(r+3).trim();i=function(e){return e.replace(/@today(?:\[([^\]]+)\])?/g,(e,t)=>{const n=t||"YYYY-MM-DD",r=function(e,t){try{switch(t.toLowerCase()){case"iso":case"yyyy-mm-dd":default:return e.toISOString().split("T")[0];case"long":return e.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});case"medium":return e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});case"short":return e.toLocaleDateString("en-US",{year:"2-digit",month:"short",day:"numeric"})}}catch(t){return e.toISOString().split("T")[0]}}(new Date,n);return`"${r}"`})}(i);try{const e=Oe(i);return e&&"object"==typeof e?{content:o,metadata:e}:{content:o,metadata:{}}}catch(e){if(t)throw new Error(`Invalid YAML Front Matter: ${e instanceof Error?e.message:"Unknown error"}`);return{content:o,metadata:{}}}}(n,t.throwOnYamlError);if(_e("YAML front matter parsed",{metadata:i,yamlVariables:Object.keys(i||{}).length}),t.yamlOnly)return _e("YAML-only processing mode: returning content without variable substitution"),{content:r,metadata:i};let o=r;_e("Starting content processing",{contentLength:o.length}),t.noClauses?_e("Skipping optional clauses processing"):(_e("Processing optional clauses"),o=Ye(o,i)),t.noReferences?_e("Skipping cross references processing"):(_e("Processing cross references"),o=function(e,t){const n=function(e,t){const n=[],r=e.split("\n"),i={level1:0,level2:0,level3:0,level4:0,level5:0,level6:0},o={level1:t["level-one"]||"Article %n.",level2:t["level-two"]||"Section %n.",level3:t["level-three"]||"(%n)",level4:t["level-four"]||"(%n)",level5:t["level-five"]||"(%n%c)",level6:t["level-six"]||"Annex %r -"};for(const e of r){const t=e.trim(),r=t.match(/^(l+)\. (.+) \|([\w.-]+)\|$/),a=t.match(/^l(\d+)\. (.+) \|([\w.-]+)\|$/);if(r||a){let e,t,s,l,c;if(r){const[,n,i,o]=r;e=n.length,t=i,s=o}else{const[,n,r,i]=a;e=parseInt(n,10),t=r,s=i}1===e?(i.level1++,i.level2=0,i.level3=0,i.level4=0,i.level5=0,i.level6=0):2===e?(i.level2++,i.level3=0,i.level4=0,i.level5=0,i.level6=0):3===e?(i.level3++,i.level4=0,i.level5=0,i.level6=0):4===e?(i.level4++,i.level5=0,i.level6=0):5===e?(i.level5++,i.level6=0):6===e&&i.level6++,1===e?(l=o.level1.replace(/%n/g,i.level1.toString()),c=`${l} ${t}`):2===e?(l=o.level2.replace(/%n/g,i.level2.toString()),c=`${l} ${t}`):3===e?(l=o.level3.replace(/%n/g,i.level3.toString()),c=`${l} ${t}`):4===e?(l=o.level4.replace(/%n/g,i.level4.toString()).replace(/%c/g,Fe(i.level4)).replace(/%r/g,Ee(i.level4,!0)).replace(/%R/g,Ee(i.level4,!1)),c=`${l} ${t}`):5===e?(l=o.level5.replace(/%n/g,i.level5.toString()).replace(/%c/g,Fe(i.level5)).replace(/%r/g,Ee(i.level5,!0)).replace(/%R/g,Ee(i.level5,!1)),c=`${l} ${t}`):6===e?(l=o.level6.replace(/%n/g,i.level6.toString()).replace(/%r/g,Ee(i.level6,!0)).replace(/%R/g,Ee(i.level6,!1)),c=`${l} ${t}`):(l=`Level ${e}.`,c=`${l} ${t}`),n.push({key:s,sectionNumber:l.trim(),sectionText:c.trim()})}}return n}(e,t);return t._cross_references=n.map(e=>({key:e.key,sectionNumber:e.sectionNumber,sectionText:e.sectionText})),0===n.length&&(t._cross_references=[]),function(e,t,n){const r=new Map;for(const e of t)r.set(e.key,e.sectionNumber);const i=e.split("\n").map(e=>{const t=e.trim();return t.match(/^(l+)\. (.+) \|([\w.-]+)\|$/)||t.match(/^l(\d+)\. (.+) \|([\w.-]+)\|$/)?e:e.replace(/\|([^|]+)\|/g,(e,t)=>{const i=t.trim(),o=r.get(i);if(o)return qe.trackField(`crossref.${i}`,{value:o,originalValue:e,hasLogic:!0}),o;const a=function(e,t){const n=t.split(".");let r=e;for(const e of n){if(null==r)return;r=r[e]}return r}(n,i);if(void 0!==a){const t=function(e,t,n){if(void 0===e)return"";if(null===e)return"null";if(e instanceof Date)return e.toISOString().split("T")[0];if("number"==typeof e&&t.includes("amount")){const t=n.payment_currency||"USD";return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e)}return String(e)}(a,i,n);return qe.trackField(`crossref.${i}`,{value:t,originalValue:e,hasLogic:!1}),t}return qe.trackField(`crossref.${i}`,{value:"",originalValue:e,hasLogic:!1}),e})});return i.join("\n")}(e,n,t)}(o,i)),t.noMixins?_e("Skipping mixins processing"):(_e("Processing mixins and template variables with AST-based processor"),o=function(e,t,n={}){try{const r=function(e){const t=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t.toString(36)}(e),n=Xe.get(t);if(n&&n.content===e)return{nodes:[...n.nodes],hasErrors:!1,errors:[]};Xe.size>100&&function(){const e=Date.now();for(const[t,n]of Xe.entries())e-n.timestamp>3e5&&Xe.delete(t)}();const r=[],i=[],o=function(e){const t=[],n=/\{\{#([\w.]+)\}\}([\s\S]*?)\{\{\/\1\}\}/g;let r;for(;null!==(r=n.exec(e));){const[e,n]=r;t.push({start:r.index,end:r.index+e.length,variable:n})}return t}(e),a=/\{\{([^}]+)\}\}/g;let s,l=0;for(;null!==(s=a.exec(e));){const[t,n]=s,a=s.index,c=a+t.length;if(Ze(a,c,o))continue;a>l&&r.push({type:"text",content:e.slice(l,a),position:{start:l,end:a}});const u=n.trim();if(u.startsWith("#")||u.startsWith("/")||"."===u)r.push({type:"text",content:t,position:{start:a,end:c}});else if(n&&""!==n.trim()){const e=He(n);r.push({type:e,content:t,variable:n.trim(),position:{start:a,end:c}})}else{const e={type:"variable",content:t,variable:n,position:{start:a,end:c},hasError:!0,errorMessage:"Empty or malformed mixin"};r.push(e),i.push({node:e,message:"Empty or malformed mixin",position:{start:a,end:c}})}l=c}return l<e.length&&r.push({type:"text",content:e.slice(l),position:{start:l,end:e.length}}),Xe.set(t,{content:e,hash:t,nodes:[...r],timestamp:Date.now()}),{nodes:r,hasErrors:i.length>0,errors:i}}(e);return r.hasErrors&&console.warn("Mixin parsing errors detected:",r.errors),function(e,t,n={}){if(n.noMixins)return e.map(e=>e.content).join("");const r=function(e,t=""){const n=new Set;return function e(t,r){if("string"==typeof t)t.match(/^\[.*\]$/)&&n.add(r);else if(t&&"object"==typeof t&&!Array.isArray(t))for(const[n,i]of Object.entries(t))e(i,r?`${r}.${n}`:n);else Array.isArray(t)&&t.forEach((t,n)=>{e(t,`${r}[${n}]`)})}(e,t),n}(t),i=e.map(e=>{if("text"===e.type)return e.content;if(e.hasError||!e.variable)return n.enableFieldTrackingInMarkdown?`<span class="highlight"><span class="missing-value" data-field="${Ke(e.content)}">{{${e.variable||"malformed"}}}</span></span>`:e.content;let i,o=!1,a="variable";switch(e.type){case"variable":i=function(e,t){return Qe(t,e)}(e.variable,t),a="variable";break;case"helper":i=tt(e.variable,t),o=!0,a="helper";break;case"conditional":i=function(e,t){try{const n=e.indexOf("?"),r=e.indexOf(":",n);if(-1===n||-1===r)return;const i=e.substring(0,n).trim(),o=e.substring(n+1,r).trim(),a=e.substring(r+1).trim();return et(Qe(t,i)?o:a,t)}catch(t){return void console.warn(`Error evaluating conditional expression: ${e}`,t)}}(e.variable,t),o=!0,a="conditional";break;default:i=void 0}const s=r.has(e.variable),l=null==i||s;if(qe.trackField(e.variable,{value:l?void 0:i,hasLogic:o,mixinUsed:a}),l)return n.enableFieldTrackingInMarkdown?`<span class="missing-value" data-field="${Ke(e.variable)}">{{${e.variable}}}</span>`:e.content;const c=String(i);return n.enableFieldTrackingInMarkdown?o?`<span class="highlight" data-field="${Ke(e.variable)}">${c}</span>`:`<span class="imported-value" data-field="${Ke(e.variable)}">${c}</span>`:c});return i.join("")}(r.nodes,t,n)}catch(t){return console.error("Critical error in AST mixin processing, falling back to original content:",t),e}}(o,i,t)),_e("Processing template loops"),o=rt(o,i,void 0,t.enableFieldTrackingInMarkdown||!1),t.noHeaders?_e("Skipping headers processing"):(_e("Processing headers and numbering"),o=function(e,t,n={}){const r=function(e,t={}){return{levelOne:e["level-one"]||"Article %n.",levelTwo:e["level-two"]||"Section %n.",levelThree:e["level-three"]||"(%n)",levelFour:e["level-four"]||"(%n%c)",levelFive:e["level-five"]||"(%n%c%r)",levelSix:e["level-six"]||"Annex %r -",levelIndent:parseFloat(e["level-indent"]||"1.5"),noReset:t.noReset||e["no-reset"]||!1,noIndent:t.noIndent||e["no-indent"]||!1,enableFieldTrackingInMarkdown:t.enableFieldTrackingInMarkdown||!1}}(t,n),i=/^(l+)\.\s+(.*?)$/gm,o=/^l(\d+)\.\s+(.*?)$/gm,a=[0,0,0,0,0,0],s=[];let l;const c=e.slice();for(i.lastIndex=0;null!==(l=i.exec(c));)s.push({match:l[0],level:l[1].length,text:l[2],index:l.index});for(o.lastIndex=0;null!==(l=o.exec(c));)s.push({match:l[0],level:parseInt(l[1],10),text:l[2],index:l.index});s.sort((e,t)=>e.index-t.index);let u=e,p=0,f=0;for(const e of s){const t=e.level;if(5===t)5===f?a[4]++:a[4]=1;else{for(let e=f;e<t-1;e++)0===a[e]&&(a[e]=1);if(a[t-1]++,!r.noReset)for(let e=t;e<a.length;e++)a[e]=0}const n=je(t,e.text,[...a],r,f),i=e.index+p,o=i+e.match.length;u=u.substring(0,i)+n+u.substring(o),p+=n.length-e.match.length,f=t}return u}(o,i,{noReset:t.noReset,noIndent:t.noIndent,enableFieldTrackingInMarkdown:t.enableFieldTrackingInMarkdown})),t.enableFieldTracking&&(_e("Applying field tracking to content"),o=qe.applyFieldTracking(o));const a=t.enableFieldTracking?qe.generateReport():void 0;return _e("Legal Markdown processing completed",{outputLength:o.length,fieldsTracked:a?.total||0,yamlVariables:Object.keys(i||{}).length}),{content:o,metadata:i,fieldReport:a}}const mt={processLegalMarkdown:ht,processLegalMarkdownWithRemark:function(e,t={}){return console.warn("Using fallback processor - Remark functions not fully implemented in browser bundle"),Promise.resolve(ht(e,t))},processLegalMarkdownWithRemarkSync:function(e,t={}){return console.warn("Using fallback processor - Remark functions not fully implemented in browser bundle"),ht(e,t)}};return s.default})());
2
2
  //# sourceMappingURL=legal-markdown.umd.min.js.map