{
  "version": 3,
  "sources": ["../../../src/api/parser/serialize-raw-block.ts"],
  "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { getCommentDelimitedContent } from '../serializer';\nimport type { RawBlock } from '../../types';\n\ninterface SerializeRawBlockOptions {\n\t/** Whether to output HTML comments around blocks. */\n\tisCommentDelimited?: boolean;\n}\n\n/**\n * Serializes a block node into the native HTML-comment-powered block format.\n * CAVEAT: This function is intended for re-serializing blocks as parsed by\n * valid parsers and skips any validation steps. This is NOT a generic\n * serialization function for in-memory blocks. For most purposes, see the\n * following functions available in the `@wordpress/blocks` package:\n *\n * @see serializeBlock\n * @see serialize\n *\n * For more on the format of block nodes as returned by valid parsers:\n *\n * @see `@wordpress/block-serialization-default-parser` package\n * @see `@wordpress/block-serialization-spec-parser` package\n *\n * @param rawBlock     A block node as returned by a valid parser.\n * @param [options={}] Serialization options.\n *\n * @return An HTML string representing a block.\n */\nexport function serializeRawBlock(\n\trawBlock: RawBlock,\n\toptions: SerializeRawBlockOptions = {}\n): string {\n\tconst { isCommentDelimited = true } = options;\n\tconst {\n\t\tblockName,\n\t\tattrs = {},\n\t\tinnerBlocks = [],\n\t\tinnerContent = [],\n\t} = rawBlock;\n\n\tlet childIndex = 0;\n\tconst content = innerContent\n\t\t.map( ( item ) =>\n\t\t\t// `null` denotes a nested block, otherwise we have an HTML fragment.\n\t\t\titem !== null\n\t\t\t\t? item\n\t\t\t\t: serializeRawBlock( innerBlocks[ childIndex++ ], options )\n\t\t)\n\t\t.join( '\\n' )\n\t\t.replace( /\\n+/g, '\\n' )\n\t\t.trim();\n\n\treturn isCommentDelimited\n\t\t? getCommentDelimitedContent( blockName ?? undefined, attrs, content )\n\t\t: content;\n}\n"],
  "mappings": ";AAGA,SAAS,kCAAkC;AA4BpC,SAAS,kBACf,UACA,UAAoC,CAAC,GAC5B;AACT,QAAM,EAAE,qBAAqB,KAAK,IAAI;AACtC,QAAM;AAAA,IACL;AAAA,IACA,QAAQ,CAAC;AAAA,IACT,cAAc,CAAC;AAAA,IACf,eAAe,CAAC;AAAA,EACjB,IAAI;AAEJ,MAAI,aAAa;AACjB,QAAM,UAAU,aACd;AAAA,IAAK,CAAE;AAAA;AAAA,MAEP,SAAS,OACN,OACA,kBAAmB,YAAa,YAAa,GAAG,OAAQ;AAAA;AAAA,EAC5D,EACC,KAAM,IAAK,EACX,QAAS,QAAQ,IAAK,EACtB,KAAK;AAEP,SAAO,qBACJ,2BAA4B,aAAa,QAAW,OAAO,OAAQ,IACnE;AACJ;",
  "names": []
}
