{
  "version": 3,
  "sources": ["../src/join.js"],
  "sourcesContent": ["/**\n * Internal dependencies\n */\n\nimport { create } from './create';\nimport { normaliseFormats } from './normalise-formats';\n\n/** @typedef {import('./types').RichTextValue} RichTextValue */\n\n/**\n * Combine an array of Rich Text values into one, optionally separated by\n * `separator`, which can be a Rich Text value, HTML string, or plain text\n * string. This is similar to `Array.prototype.join`.\n *\n * @param {Array<RichTextValue>} values      An array of values to join.\n * @param {string|RichTextValue} [separator] Separator string or value.\n *\n * @return {RichTextValue} A new combined value.\n */\nexport function join( values, separator = '' ) {\n\tif ( typeof separator === 'string' ) {\n\t\tseparator = create( { text: separator } );\n\t}\n\n\treturn normaliseFormats(\n\t\tvalues.reduce( ( accumulator, { formats, replacements, text } ) => ( {\n\t\t\tformats: accumulator.formats.concat( separator.formats, formats ),\n\t\t\treplacements: accumulator.replacements.concat(\n\t\t\t\tseparator.replacements,\n\t\t\t\treplacements\n\t\t\t),\n\t\t\ttext: accumulator.text + separator.text + text,\n\t\t} ) )\n\t);\n}\n"],
  "mappings": ";AAIA,SAAS,cAAc;AACvB,SAAS,wBAAwB;AAc1B,SAAS,KAAM,QAAQ,YAAY,IAAK;AAC9C,MAAK,OAAO,cAAc,UAAW;AACpC,gBAAY,OAAQ,EAAE,MAAM,UAAU,CAAE;AAAA,EACzC;AAEA,SAAO;AAAA,IACN,OAAO,OAAQ,CAAE,aAAa,EAAE,SAAS,cAAc,KAAK,OAAS;AAAA,MACpE,SAAS,YAAY,QAAQ,OAAQ,UAAU,SAAS,OAAQ;AAAA,MAChE,cAAc,YAAY,aAAa;AAAA,QACtC,UAAU;AAAA,QACV;AAAA,MACD;AAAA,MACA,MAAM,YAAY,OAAO,UAAU,OAAO;AAAA,IAC3C,EAAI;AAAA,EACL;AACD;",
  "names": []
}
