{"version":3,"sources":["webpack:///./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js","webpack:///./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js","webpack:///./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js","webpack:///./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js"],"names":["BlockQuoteCommand","this","value","_getValue","isEnabled","_checkEnabled","_this","options","arguments","length","undefined","model","editor","schema","selection","document","blocks","Array","from","getSelectedBlocks","forceValue","change","writer","blocksToQuote","filter","block","findQuote","checkCanBeQuoted","_applyQuote","_removeQuote","firstBlock","first","getRangesOfBlockGroups","reverse","forEach","groupRange","start","isAtStart","end","isAtEnd","unwrap","parent","positionBefore","createPositionBefore","move","split","positionAfter","createPositionAfter","quotesToMerge","quote","createElement","wrap","push","reduce","currentQuote","nextQuote","nextSibling","merge","Command","elementOrPosition","name","startPosition","i","ranges","nextBlock","createRange","isBQAllowed","checkChild","isBlockAllowedInBQ","BlockQuoteEditing","commands","add","register","allowWhere","allowContentOf","conversion","elementToElement","view","registerPostFixer","_step","changes","differ","getChanges","_iterator","_createForOfIteratorHelper","s","n","done","entry","type","element","position","nodeAfter","is","isEmpty","remove","_step2","range","createRangeIn","_iterator2","getItems","child","err","e","f","viewDocument","editing","blockQuoteCommand","get","listenTo","evt","data","isCollapsed","positionParent","getLastPosition","execute","scrollToTheSelection","preventDefault","stop","context","direction","previousSibling","Enter","Delete","Plugin","BlockQuoteUI","t","ui","componentFactory","locale","command","buttonView","ButtonView","set","label","icon","icons","tooltip","isToggleable","bind","to","focus","BlockQuote"],"mappings":";;;;OAiBqBA,8JAYpB,WACCC,KAAKC,MAAQD,KAAKE,YAClBF,KAAKG,UAAYH,KAAKI,uCAavB,WAAwB,IAAAC,EAAAL,KAAfM,EAAeC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,MACjBG,EAAQV,KAAKW,OAAOD,MACpBE,EAASF,EAAME,OACfC,EAAYH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EAAOuG,QAAS,cAChBvG,EAAO8F,QAAQ7B,KAAKuC,uBAEpBL,EAAKM,iBACLP,EAAIQ,WAEDC,QAAS,eAIdtH,KAAK4G,SAAUJ,EAAc,SAAU,SAAEK,EAAKC,GAC7C,GAAuB,YAAlBA,EAAKS,WAA4B1G,EAAUkG,aAAgBL,EAAkBzG,MAAlF,CAIA,IAAM+G,EAAiBnG,EAAUoG,kBAAkBzE,OAE9CwE,EAAenB,UAAYmB,EAAeQ,kBAC9C7G,EAAOuG,QAAS,cAChBvG,EAAO8F,QAAQ7B,KAAKuC,uBAEpBL,EAAKM,iBACLP,EAAIQ,WAEDC,QAAS,yCAtHf,WACC,MAAO,0CAMR,WACC,OAASG,OAAOC,eAZ6BC;;;;OCD1BC,2JAWpB,WAAO,IAAAvH,EAAAL,KACAW,EAASX,KAAKW,OACdkH,EAAIlH,EAAOkH,EAEjBlH,EAAOmH,GAAGC,iBAAiBzD,IAAK,aAAc,SAAA0D,GAC7C,IAAMC,EAAUtH,EAAO0D,SAASsC,IAAK,cAC/BuB,EAAa,IAAIC,OAAYH,GAkBnC,OAhBAE,EAAWE,KACVC,MAAOR,EAAG,eACVS,KAAMC,OAAMvF,MACZwF,SAAS,EACTC,cAAc,IAIfP,EAAWQ,KAAM,OAAQ,aAAcC,GAAIV,EAAS,QAAS,aAG7D5H,EAAKuG,SAAUsB,EAAY,UAAW,WACrCvH,EAAOuG,QAAS,cAChBvG,EAAO8F,QAAQ7B,KAAKgE,UAGdV,8BA/BT,WACC,MAAO,sBALiCP;;;;OCGrBkB,kKAIpB,WACC,OAASzE,EAAmBwD,2BAM7B,WACC,MAAO,oBAZ+BD","file":"js/chunk-6363e473.b50ffc50.js","sourcesContent":["/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module block-quote/blockquotecommand\n */\n\nimport { Command } from 'ckeditor5/src/core';\nimport { first } from 'ckeditor5/src/utils';\n\n/**\n * The block quote command plugin.\n *\n * @extends module:core/command~Command\n */\nexport default class BlockQuoteCommand extends Command {\n\t/**\n\t * Whether the selection starts in a block quote.\n\t *\n\t * @observable\n\t * @readonly\n\t * @member {Boolean} #value\n\t */\n\n\t/**\n\t * @inheritDoc\n\t */\n\trefresh() {\n\t\tthis.value = this._getValue();\n\t\tthis.isEnabled = this._checkEnabled();\n\t}\n\n\t/**\n\t * Executes the command. When the command {@link #value is on}, all top-most block quotes within\n\t * the selection will be removed. If it is off, all selected blocks will be wrapped with\n\t * a block quote.\n\t *\n\t * @fires execute\n\t * @param {Object} [options] Command options.\n\t * @param {Boolean} [options.forceValue] If set, it will force the command behavior. If `true`, the command will apply a block quote,\n\t * otherwise the command will remove the block quote. If not set, the command will act basing on its current value.\n\t */\n\texecute( options = {} ) {\n\t\tconst model = this.editor.model;\n\t\tconst schema = model.schema;\n\t\tconst selection = model.document.selection;\n\n\t\tconst blocks = Array.from( selection.getSelectedBlocks() );\n\n\t\tconst value = ( options.forceValue === undefined ) ? !this.value : options.forceValue;\n\n\t\tmodel.change( writer => {\n\t\t\tif ( !value ) {\n\t\t\t\tthis._removeQuote( writer, blocks.filter( findQuote ) );\n\t\t\t} else {\n\t\t\t\tconst blocksToQuote = blocks.filter( block => {\n\t\t\t\t\t// Already quoted blocks needs to be considered while quoting too\n\t\t\t\t\t// in order to reuse their elements.\n\t\t\t\t\treturn findQuote( block ) || checkCanBeQuoted( schema, block );\n\t\t\t\t} );\n\n\t\t\t\tthis._applyQuote( writer, blocksToQuote );\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * Checks the command's {@link #value}.\n\t *\n\t * @private\n\t * @returns {Boolean} The current value.\n\t */\n\t_getValue() {\n\t\tconst selection = this.editor.model.document.selection;\n\n\t\tconst firstBlock = first( selection.getSelectedBlocks() );\n\n\t\t// In the current implementation, the block quote must be an immediate parent of a block element.\n\t\treturn !!( firstBlock && findQuote( firstBlock ) );\n\t}\n\n\t/**\n\t * Checks whether the command can be enabled in the current context.\n\t *\n\t * @private\n\t * @returns {Boolean} Whether the command should be enabled.\n\t */\n\t_checkEnabled() {\n\t\tif ( this.value ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst selection = this.editor.model.document.selection;\n\t\tconst schema = this.editor.model.schema;\n\n\t\tconst firstBlock = first( selection.getSelectedBlocks() );\n\n\t\tif ( !firstBlock ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn checkCanBeQuoted( schema, firstBlock );\n\t}\n\n\t/**\n\t * Removes the quote from given blocks.\n\t *\n\t * If blocks which are supposed to be \"unquoted\" are in the middle of a quote,\n\t * start it or end it, then the quote will be split (if needed) and the blocks\n\t * will be moved out of it, so other quoted blocks remained quoted.\n\t *\n\t * @private\n\t * @param {module:engine/model/writer~Writer} writer\n\t * @param {Array.} blocks\n\t */\n\t_removeQuote( writer, blocks ) {\n\t\t// Unquote all groups of block. Iterate in the reverse order to not break following ranges.\n\t\tgetRangesOfBlockGroups( writer, blocks ).reverse().forEach( groupRange => {\n\t\t\tif ( groupRange.start.isAtStart && groupRange.end.isAtEnd ) {\n\t\t\t\twriter.unwrap( groupRange.start.parent );\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The group of blocks are at the beginning of an so let's move them left (out of the ).\n\t\t\tif ( groupRange.start.isAtStart ) {\n\t\t\t\tconst positionBefore = writer.createPositionBefore( groupRange.start.parent );\n\n\t\t\t\twriter.move( groupRange, positionBefore );\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The blocks are in the middle of an so we need to split the after the last block\n\t\t\t// so we move the items there.\n\t\t\tif ( !groupRange.end.isAtEnd ) {\n\t\t\t\twriter.split( groupRange.end );\n\t\t\t}\n\n\t\t\t// Now we are sure that groupRange.end.isAtEnd is true, so let's move the blocks right.\n\n\t\t\tconst positionAfter = writer.createPositionAfter( groupRange.end.parent );\n\n\t\t\twriter.move( groupRange, positionAfter );\n\t\t} );\n\t}\n\n\t/**\n\t * Applies the quote to given blocks.\n\t *\n\t * @private\n\t * @param {module:engine/model/writer~Writer} writer\n\t * @param {Array.} blocks\n\t */\n\t_applyQuote( writer, blocks ) {\n\t\tconst quotesToMerge = [];\n\n\t\t// Quote all groups of block. Iterate in the reverse order to not break following ranges.\n\t\tgetRangesOfBlockGroups( writer, blocks ).reverse().forEach( groupRange => {\n\t\t\tlet quote = findQuote( groupRange.start );\n\n\t\t\tif ( !quote ) {\n\t\t\t\tquote = writer.createElement( 'blockQuote' );\n\n\t\t\t\twriter.wrap( groupRange, quote );\n\t\t\t}\n\n\t\t\tquotesToMerge.push( quote );\n\t\t} );\n\n\t\t// Merge subsequent elements. Reverse the order again because this time we want to go through\n\t\t// the elements in the source order (due to how merge works – it moves the right element's content\n\t\t// to the first element and removes the right one. Since we may need to merge a couple of subsequent `` elements\n\t\t// we want to keep the reference to the first (furthest left) one.\n\t\tquotesToMerge.reverse().reduce( ( currentQuote, nextQuote ) => {\n\t\t\tif ( currentQuote.nextSibling == nextQuote ) {\n\t\t\t\twriter.merge( writer.createPositionAfter( currentQuote ) );\n\n\t\t\t\treturn currentQuote;\n\t\t\t}\n\n\t\t\treturn nextQuote;\n\t\t} );\n\t}\n}\n\nfunction findQuote( elementOrPosition ) {\n\treturn elementOrPosition.parent.name == 'blockQuote' ? elementOrPosition.parent : null;\n}\n\n// Returns a minimal array of ranges containing groups of subsequent blocks.\n//\n// content: abcdefgh\n// blocks: [ a, b, d, f, g, h ]\n// output ranges: [ab]c[d]e[fgh]\n//\n// @param {Array.} blocks\n// @returns {Array.}\nfunction getRangesOfBlockGroups( writer, blocks ) {\n\tlet startPosition;\n\tlet i = 0;\n\tconst ranges = [];\n\n\twhile ( i < blocks.length ) {\n\t\tconst block = blocks[ i ];\n\t\tconst nextBlock = blocks[ i + 1 ];\n\n\t\tif ( !startPosition ) {\n\t\t\tstartPosition = writer.createPositionBefore( block );\n\t\t}\n\n\t\tif ( !nextBlock || block.nextSibling != nextBlock ) {\n\t\t\tranges.push( writer.createRange( startPosition, writer.createPositionAfter( block ) ) );\n\t\t\tstartPosition = null;\n\t\t}\n\n\t\ti++;\n\t}\n\n\treturn ranges;\n}\n\n// Checks whether can wrap the block.\nfunction checkCanBeQuoted( schema, block ) {\n\t// TMP will be replaced with schema.checkWrap().\n\tconst isBQAllowed = schema.checkChild( block.parent, 'blockQuote' );\n\tconst isBlockAllowedInBQ = schema.checkChild( [ '$root', 'blockQuote' ], block );\n\n\treturn isBQAllowed && isBlockAllowedInBQ;\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module block-quote/blockquoteediting\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Enter } from 'ckeditor5/src/enter';\nimport { Delete } from 'ckeditor5/src/typing';\n\nimport BlockQuoteCommand from './blockquotecommand';\n\n/**\n * The block quote editing.\n *\n * Introduces the `'blockQuote'` command and the `'blockQuote'` model element.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class BlockQuoteEditing extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'BlockQuoteEditing';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get requires() {\n\t\treturn [ Enter, Delete ];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst schema = editor.model.schema;\n\n\t\teditor.commands.add( 'blockQuote', new BlockQuoteCommand( editor ) );\n\n\t\tschema.register( 'blockQuote', {\n\t\t\tallowWhere: '$block',\n\t\t\tallowContentOf: '$root'\n\t\t} );\n\n\t\teditor.conversion.elementToElement( { model: 'blockQuote', view: 'blockquote' } );\n\n\t\t// Postfixer which cleans incorrect model states connected with block quotes.\n\t\teditor.model.document.registerPostFixer( writer => {\n\t\t\tconst changes = editor.model.document.differ.getChanges();\n\n\t\t\tfor ( const entry of changes ) {\n\t\t\t\tif ( entry.type == 'insert' ) {\n\t\t\t\t\tconst element = entry.position.nodeAfter;\n\n\t\t\t\t\tif ( !element ) {\n\t\t\t\t\t\t// We are inside a text node.\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( element.is( 'element', 'blockQuote' ) && element.isEmpty ) {\n\t\t\t\t\t\t// Added an empty blockQuote - remove it.\n\t\t\t\t\t\twriter.remove( element );\n\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else if ( element.is( 'element', 'blockQuote' ) && !schema.checkChild( entry.position, element ) ) {\n\t\t\t\t\t\t// Added a blockQuote in incorrect place. Unwrap it so the content inside is not lost.\n\t\t\t\t\t\twriter.unwrap( element );\n\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else if ( element.is( 'element' ) ) {\n\t\t\t\t\t\t// Just added an element. Check that all children meet the scheme rules.\n\t\t\t\t\t\tconst range = writer.createRangeIn( element );\n\n\t\t\t\t\t\tfor ( const child of range.getItems() ) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tchild.is( 'element', 'blockQuote' ) &&\n\t\t\t\t\t\t\t\t!schema.checkChild( writer.createPositionBefore( child ), child )\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\twriter.unwrap( child );\n\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if ( entry.type == 'remove' ) {\n\t\t\t\t\tconst parent = entry.position.parent;\n\n\t\t\t\t\tif ( parent.is( 'element', 'blockQuote' ) && parent.isEmpty ) {\n\t\t\t\t\t\t// Something got removed and now blockQuote is empty. Remove the blockQuote as well.\n\t\t\t\t\t\twriter.remove( parent );\n\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t} );\n\n\t\tconst viewDocument = this.editor.editing.view.document;\n\t\tconst selection = editor.model.document.selection;\n\t\tconst blockQuoteCommand = editor.commands.get( 'blockQuote' );\n\n\t\t// Overwrite default Enter key behavior.\n\t\t// If Enter key is pressed with selection collapsed in empty block inside a quote, break the quote.\n\t\tthis.listenTo( viewDocument, 'enter', ( evt, data ) => {\n\t\t\tif ( !selection.isCollapsed || !blockQuoteCommand.value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst positionParent = selection.getLastPosition().parent;\n\n\t\t\tif ( positionParent.isEmpty ) {\n\t\t\t\teditor.execute( 'blockQuote' );\n\t\t\t\teditor.editing.view.scrollToTheSelection();\n\n\t\t\t\tdata.preventDefault();\n\t\t\t\tevt.stop();\n\t\t\t}\n\t\t}, { context: 'blockquote' } );\n\n\t\t// Overwrite default Backspace key behavior.\n\t\t// If Backspace key is pressed with selection collapsed in first empty block inside a quote, break the quote.\n\t\tthis.listenTo( viewDocument, 'delete', ( evt, data ) => {\n\t\t\tif ( data.direction != 'backward' || !selection.isCollapsed || !blockQuoteCommand.value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst positionParent = selection.getLastPosition().parent;\n\n\t\t\tif ( positionParent.isEmpty && !positionParent.previousSibling ) {\n\t\t\t\teditor.execute( 'blockQuote' );\n\t\t\t\teditor.editing.view.scrollToTheSelection();\n\n\t\t\t\tdata.preventDefault();\n\t\t\t\tevt.stop();\n\t\t\t}\n\t\t}, { context: 'blockquote' } );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module block-quote/blockquoteui\n */\n\nimport { Plugin, icons } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\n\nimport '../theme/blockquote.css';\n\n/**\n * The block quote UI plugin.\n *\n * It introduces the `'blockQuote'` button.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class BlockQuoteUI extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'BlockQuoteUI';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst t = editor.t;\n\n\t\teditor.ui.componentFactory.add( 'blockQuote', locale => {\n\t\t\tconst command = editor.commands.get( 'blockQuote' );\n\t\t\tconst buttonView = new ButtonView( locale );\n\n\t\t\tbuttonView.set( {\n\t\t\t\tlabel: t( 'Block quote' ),\n\t\t\t\ticon: icons.quote,\n\t\t\t\ttooltip: true,\n\t\t\t\tisToggleable: true\n\t\t\t} );\n\n\t\t\t// Bind button model to command.\n\t\t\tbuttonView.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );\n\n\t\t\t// Execute command.\n\t\t\tthis.listenTo( buttonView, 'execute', () => {\n\t\t\t\teditor.execute( 'blockQuote' );\n\t\t\t\teditor.editing.view.focus();\n\t\t\t} );\n\n\t\t\treturn buttonView;\n\t\t} );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module block-quote/blockquote\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\n\nimport BlockQuoteEditing from './blockquoteediting';\nimport BlockQuoteUI from './blockquoteui';\n\n/**\n * The block quote plugin.\n *\n * For more information about this feature check the {@glink api/block-quote package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:block-quote/blockquoteediting~BlockQuoteEditing block quote editing feature}\n * and {@link module:block-quote/blockquoteui~BlockQuoteUI block quote UI feature}.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class BlockQuote extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get requires() {\n\t\treturn [ BlockQuoteEditing, BlockQuoteUI ];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'BlockQuote';\n\t}\n}\n"],"sourceRoot":""}