{"version":3,"sources":["../../src/sections/content-section.ts"],"sourcesContent":["import { DocumentSection, DocumentSectionOptions } from './section.js';\nimport { heading } from '../elements/heading.js';\n\ntype Content = string | Array<string>;\n\nexport interface ContentSectionOptions extends DocumentSectionOptions {\n  content?: Content;\n}\n\nexport class ContentSection extends DocumentSection {\n  private content: Array<string> = [];\n\n  constructor(options: ContentSectionOptions) {\n    super(options);\n    this.appendContent(options.content ?? '');\n  }\n\n  public appendContent(content: Content) {\n    if (Array.isArray(content)) {\n      this.content.push(...content);\n    } else {\n      this.content.push(content);\n    }\n\n    return this;\n  }\n\n  protected synthesizeContent(): Array<string> {\n    const content = this.content.join('\\n\\n');\n    return [heading(this.headingLevel, this.title), '', content];\n  }\n}\n\nexport function contentSection(options: ContentSectionOptions) {\n  return new ContentSection(options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwD;AACxD,qBAAwB;AAQjB,MAAM,uBAAuB,+BAAgB;AAAA,EAC1C,UAAyB,CAAC;AAAA,EAElC,YAAY,SAAgC;AAC1C,UAAM,OAAO;AACb,SAAK,cAAc,QAAQ,WAAW,EAAE;AAAA,EAC1C;AAAA,EAEO,cAAc,SAAkB;AACrC,QAAI,MAAM,QAAQ,OAAO,GAAG;AAC1B,WAAK,QAAQ,KAAK,GAAG,OAAO;AAAA,IAC9B,OAAO;AACL,WAAK,QAAQ,KAAK,OAAO;AAAA,IAC3B;AAEA,WAAO;AAAA,EACT;AAAA,EAEU,oBAAmC;AAC3C,UAAM,UAAU,KAAK,QAAQ,KAAK,MAAM;AACxC,WAAO,KAAC,wBAAQ,KAAK,cAAc,KAAK,KAAK,GAAG,IAAI,OAAO;AAAA,EAC7D;AACF;AAEO,SAAS,eAAe,SAAgC;AAC7D,SAAO,IAAI,eAAe,OAAO;AACnC;","names":[]}