{"version":3,"sources":["webpack:///./node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.js","webpack:///./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js","webpack:///./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js","webpack:///./node_modules/@ckeditor/ckeditor5-select-all/src/selectall.js","webpack:///./node_modules/@ckeditor/ckeditor5-select-all/theme/icons/select-all.svg"],"names":["SelectAllCommand","model","this","editor","selection","document","scopeElement","schema","getLimitElement","containsEntireContent","isSelectAllScope","parent","change","writer","setSelection","Command","element","isLimit","checkChild","SELECT_ALL_KEYSTROKE","parseKeystroke","SelectAllEditing","view","editing","viewDocument","commands","add","listenTo","eventInfo","domEventData","getCode","execute","preventDefault","Plugin","SelectAllUI","_this","ui","componentFactory","locale","command","get","ButtonView","t","set","label","icon","selectAllIcon","keystroke","tooltip","bind","to","focus","SelectAll","module","exports"],"mappings":";;;;OA2BqBA,8JAIpB,WACC,IAAMC,EAAQC,KAAKC,OAAOF,MACpBG,EAAYH,EAAMI,SAASD,UAC7BE,EAAeL,EAAMM,OAAOC,gBAAiBJ,GAIjD,GAAKA,EAAUK,sBAAuBH,KAAmBI,EAAkBT,EAAMM,OAAQD,GACxF,GAIC,GAHAA,EAAeA,EAAaK,QAGtBL,EACL,cAESI,EAAkBT,EAAMM,OAAQD,IAG5CL,EAAMW,OAAQ,SAAAC,GACbA,EAAOC,aAAcR,EAAc,eAvBQS,QAmC9C,SAASL,EAAkBH,EAAQS,GAClC,OAAOT,EAAOU,QAASD,KAAeT,EAAOW,WAAYF,EAAS,UAAaT,EAAOW,WAAYF,EAAS;;;;GClD5G,IAAMG,EAAuBC,eAAgB,UAUxBC,2JAWpB,WACC,IAAMlB,EAASD,KAAKC,OACdmB,EAAOnB,EAAOoB,QAAQD,KACtBE,EAAeF,EAAKjB,SAE1BF,EAAOsB,SAASC,IAAK,YAAa,IAAI1B,EAAkBG,IAExDD,KAAKyB,SAAUH,EAAc,UAAW,SAAEI,EAAWC,GAC/CC,eAASD,KAAmBV,IAChChB,EAAO4B,QAAS,aAChBF,EAAaG,8CAjBhB,WACC,MAAO,0BALqCC;;;;OCAzBC,2JAWpB,WAAO,IAAAC,EAAAjC,KACAC,EAASD,KAAKC,OAEpBA,EAAOiC,GAAGC,iBAAiBX,IAAK,YAAa,SAAAY,GAC5C,IAAMC,EAAUpC,EAAOsB,SAASe,IAAK,aAC/BlB,EAAO,IAAImB,OAAYH,GACvBI,EAAIJ,EAAOI,EAiBjB,OAfApB,EAAKqB,KACJC,MAAOF,EAAG,cACVG,KAAMC,IACNC,UAAW,SACXC,SAAS,IAGV1B,EAAK2B,KAAM,OAAQ,aAAcC,GAAIX,EAAS,QAAS,aAGvDJ,EAAKR,SAAUL,EAAM,UAAW,WAC/BnB,EAAO4B,QAAS,aAChB5B,EAAOoB,QAAQD,KAAK6B,UAGd7B,8BA9BT,WACC,MAAO,qBALgCW;;;;OCApBmB,kKAIpB,WACC,OAAS/B,EAAkBa,2BAM5B,WACC,MAAO,mBAZ8BD;;;;wBCvBvCoB,EAAAC,QAAA","file":"js/chunk-5cf3ac62.029cbe91.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 select-all/selectallcommand\n */\n\nimport Command from '@ckeditor/ckeditor5-core/src/command';\n\n/**\n * The select all command.\n *\n * It is used by the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature} to handle\n * the Ctrl/⌘+A keystroke.\n *\n * Executing this command changes the {@glink framework/guides/architecture/editing-engine#model model}\n * selection so it contains the entire content of the editable root of the editor the selection is\n * {@link module:engine/model/selection~Selection#anchor anchored} in.\n *\n * If the selection was anchored in a {@glink framework/guides/tutorials/implementing-a-block-widget nested editable}\n * (e.g. a caption of an image), the new selection will contain its entire content. Successive executions of this command\n * will expand the selection to encompass more and more content up to the entire editable root of the editor.\n *\n * @extends module:core/command~Command\n */\nexport default class SelectAllCommand extends Command {\n\t/**\n\t * @inheritDoc\n\t */\n\texecute() {\n\t\tconst model = this.editor.model;\n\t\tconst selection = model.document.selection;\n\t\tlet scopeElement = model.schema.getLimitElement( selection );\n\n\t\t// If an entire scope is selected, or the selection's ancestor is not a scope yet,\n\t\t// browse through ancestors to find the enclosing parent scope.\n\t\tif ( selection.containsEntireContent( scopeElement ) || !isSelectAllScope( model.schema, scopeElement ) ) {\n\t\t\tdo {\n\t\t\t\tscopeElement = scopeElement.parent;\n\n\t\t\t\t// Do nothing, if the entire `root` is already selected.\n\t\t\t\tif ( !scopeElement ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} while ( !isSelectAllScope( model.schema, scopeElement ) );\n\t\t}\n\n\t\tmodel.change( writer => {\n\t\t\twriter.setSelection( scopeElement, 'in' );\n\t\t} );\n\t}\n}\n\n// Checks whether the element is a valid select-all scope.\n// Returns true, if the element is a {@link module:engine/model/schema~Schema#isLimit limit},\n// and can contain any text or paragraph.\n//\n// @param {module:engine/model/schema~Schema} schema The schema to check against.\n// @param {module:engine/model/element~Element} element\n// @return {Boolean}\nfunction isSelectAllScope( schema, element ) {\n\treturn schema.isLimit( element ) && ( schema.checkChild( element, '$text' ) || schema.checkChild( element, 'paragraph' ) );\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 select-all/selectallediting\n */\n\nimport Plugin from '@ckeditor/ckeditor5-core/src/plugin';\nimport { getCode, parseKeystroke } from '@ckeditor/ckeditor5-utils/src/keyboard';\nimport SelectAllCommand from './selectallcommand';\n\nconst SELECT_ALL_KEYSTROKE = parseKeystroke( 'Ctrl+A' );\n\n/**\n * The select all editing feature.\n *\n * It registers the `'selectAll'` {@link module:select-all/selectallcommand~SelectAllCommand command}\n * and the Ctrl/⌘+A keystroke listener which executes it.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class SelectAllEditing extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'SelectAllEditing';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst view = editor.editing.view;\n\t\tconst viewDocument = view.document;\n\n\t\teditor.commands.add( 'selectAll', new SelectAllCommand( editor ) );\n\n\t\tthis.listenTo( viewDocument, 'keydown', ( eventInfo, domEventData ) => {\n\t\t\tif ( getCode( domEventData ) === SELECT_ALL_KEYSTROKE ) {\n\t\t\t\teditor.execute( 'selectAll' );\n\t\t\t\tdomEventData.preventDefault();\n\t\t\t}\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 select-all/selectallui\n */\n\nimport Plugin from '@ckeditor/ckeditor5-core/src/plugin';\nimport ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';\n\nimport selectAllIcon from '../theme/icons/select-all.svg';\n\n/**\n * The select all UI feature.\n *\n * It registers the `'selectAll'` UI button in the editor's\n * {@link module:ui/componentfactory~ComponentFactory component factory}. When clicked, the button\n * executes the {@link module:select-all/selectallcommand~SelectAllCommand select all command}.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class SelectAllUI extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'SelectAllUI';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\n\t\teditor.ui.componentFactory.add( 'selectAll', locale => {\n\t\t\tconst command = editor.commands.get( 'selectAll' );\n\t\t\tconst view = new ButtonView( locale );\n\t\t\tconst t = locale.t;\n\n\t\t\tview.set( {\n\t\t\t\tlabel: t( 'Select all' ),\n\t\t\t\ticon: selectAllIcon,\n\t\t\t\tkeystroke: 'Ctrl+A',\n\t\t\t\ttooltip: true\n\t\t\t} );\n\n\t\t\tview.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );\n\n\t\t\t// Execute the command.\n\t\t\tthis.listenTo( view, 'execute', () => {\n\t\t\t\teditor.execute( 'selectAll' );\n\t\t\t\teditor.editing.view.focus();\n\t\t\t} );\n\n\t\t\treturn view;\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 select-all/selectall\n */\n\nimport Plugin from '@ckeditor/ckeditor5-core/src/plugin';\nimport SelectAllEditing from './selectallediting';\nimport SelectAllUI from './selectallui';\n\n/**\n * The select all feature.\n *\n * This is a \"glue\" plugin which loads the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature}\n * and the {@link module:select-all/selectallui~SelectAllUI select all UI feature}.\n *\n * Please refer to the documentation of individual features to learn more.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class SelectAll extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get requires() {\n\t\treturn [ SelectAllEditing, SelectAllUI ];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'SelectAll';\n\t}\n}\n","module.exports = \"\""],"sourceRoot":""}