{"version":3,"sources":["webpack:///./node_modules/@ckeditor/ckeditor5-link/src/utils.js","webpack:///./node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.js","webpack:///./node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.js"],"names":["ATTRIBUTE_WHITESPACES","SAFE_URL","EMAIL_REG_EXP","PROTOCOL_REG_EXP","LINK_KEYSTROKE","isLinkElement","node","is","getCustomProperty","createLinkElement","href","_ref","writer","linkElement","createAttributeElement","priority","setCustomProperty","ensureSafeUrl","url","String","isSafeUrl","normalizedUrl","replace","match","getLocalizedDecorators","t","decorators","localizedDecoratorsLabels","Open in a new tab","Downloadable","forEach","decorator","label","normalizeDecorators","retArray","_i","_Object$entries","Object","entries","length","_Object$entries$_i","D_Projects_UA_repo_Source_Client_UA_User_Web_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__","key","value","assign","id","concat","upperFirst","push","isLinkableElement","element","schema","checkAttribute","name","isEmail","test","addLinkProtocolIfApplicable","link","defaultProtocol","protocol","isProtocolNeeded","AutomaticDecorators","D_Projects_UA_repo_Source_Client_UA_User_Web_node_modules_babel_runtime_helpers_esm_classCallCheck_js__WEBPACK_IMPORTED_MODULE_10__","this","_definitions","Set","size","item","_this","Array","isArray","add","_this2","dispatcher","on","evt","data","conversionApi","consumable","_step","viewWriter","viewSelection","document","selection","_iterator","_createForOfIteratorHelper","s","n","done","viewElement","attributes","classes","addClass","styles","setStyle","callback","attributeNewValue","wrap","getFirstRange","mapper","toViewRange","range","unwrap","err","e","f","_this3","_step2","viewFigure","toViewElement","linkInImage","from","getChildren","find","child","_iterator2","toMap","_step3","_iterator3","_step3$value","D_Projects_UA_repo_Source_Client_UA_User_Web_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__","val","setAttribute","_step4","_iterator4","_step4$value","removeClass","removeAttribute","removeStyle","ManualDecorator","defaultValue","D_Projects_UA_repo_Source_Client_UA_User_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AtC,MAAAqC,EAAAC,EAAArC,KAAAC,MAAyC,KAAAqC,EAAAxF,OAAAmF,EAAA,KAAAnF,CAAAsF,EAAAhF,MAAA,GAA3BD,EAA2BmF,EAAA,GAAtBJ,EAAsBI,EAAA,GAC3B,UAARnF,EACJ9B,EAAOkH,YAAaL,EAAKX,GAEzBlG,EAAOmH,gBAAiBrF,EAAKoE,IALzB,MAAAP,GAAAqB,EAAApB,EAAAD,GAAA,QAAAqB,EAAAnB,IAaN,IAAM,IAAM/D,KAJPyB,EAAKwB,SACT/E,EAAOkH,YAAa3D,EAAKwB,QAASmB,GAGhB3C,EAAK0B,OACvBjF,EAAOoH,YAAatF,EAAKoE,KAvCwD,MAAAP,GAAAY,EAAAX,EAAAD,GAAA,QAAAY,EAAAV,4HC1FnEwB,aAYpB,SAAAA,EAAAtH,GAAwE,IAAzDkC,EAAyDlC,EAAzDkC,GAAIb,EAAqDrB,EAArDqB,MAAO0D,EAA8C/E,EAA9C+E,WAAYC,EAAkChF,EAAlCgF,QAASE,EAAyBlF,EAAzBkF,OAAQqC,EAAiBvH,EAAjBuH,aAAiB7F,OAAA8F,EAAA,KAAA9F,CAAA0B,KAAAkE,GAMvElE,KAAKlB,GAAKA,EAQVkB,KAAKqE,IAAK,SAOVrE,KAAKmE,aAAeA,EAOpBnE,KAAK/B,MAAQA,EAQb+B,KAAK2B,WAAaA,EAQlB3B,KAAK4B,QAAUA,EAQf5B,KAAK8B,OAASA,uDASf,WACC,OACCH,WAAY3B,KAAK2B,WACjBC,QAAS5B,KAAK4B,QACdE,OAAQ9B,KAAK8B,iBAKhBwC,eAAKJ,EAAiBK","file":"js/chunk-5689be28.1b1c3b75.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 link/utils\n */\n\nimport { upperFirst } from 'lodash-es';\n\nconst ATTRIBUTE_WHITESPACES = /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205f\\u3000]/g; // eslint-disable-line no-control-regex\nconst SAFE_URL = /^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;\n\n// Simplified email test - should be run over previously found URL.\nconst EMAIL_REG_EXP = /^[\\S]+@((?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.))+(?:[a-z\\u00a1-\\uffff]{2,})$/i;\n\n// The regex checks for the protocol syntax ('xxxx://' or 'xxxx:')\n// or non-word characters at the beginning of the link ('/', '#' etc.).\nconst PROTOCOL_REG_EXP = /^((\\w+:(\\/{2,})?)|(\\W))/i;\n\n/**\n * A keystroke used by the {@link module:link/linkui~LinkUI link UI feature}.\n */\nexport const LINK_KEYSTROKE = 'Ctrl+K';\n\n/**\n * Returns `true` if a given view node is the link element.\n *\n * @param {module:engine/view/node~Node} node\n * @returns {Boolean}\n */\nexport function isLinkElement( node ) {\n\treturn node.is( 'attributeElement' ) && !!node.getCustomProperty( 'link' );\n}\n\n/**\n * Creates a link {@link module:engine/view/attributeelement~AttributeElement} with the provided `href` attribute.\n *\n * @param {String} href\n * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi\n * @returns {module:engine/view/attributeelement~AttributeElement}\n */\nexport function createLinkElement( href, { writer } ) {\n\t// Priority 5 - https://github.com/ckeditor/ckeditor5-link/issues/121.\n\tconst linkElement = writer.createAttributeElement( 'a', { href }, { priority: 5 } );\n\twriter.setCustomProperty( 'link', true, linkElement );\n\n\treturn linkElement;\n}\n\n/**\n * Returns a safe URL based on a given value.\n *\n * A URL is considered safe if it is safe for the user (does not contain any malicious code).\n *\n * If a URL is considered unsafe, a simple `\"#\"` is returned.\n *\n * @protected\n * @param {*} url\n * @returns {String} Safe URL.\n */\nexport function ensureSafeUrl( url ) {\n\turl = String( url );\n\n\treturn isSafeUrl( url ) ? url : '#';\n}\n\n// Checks whether the given URL is safe for the user (does not contain any malicious code).\n//\n// @param {String} url URL to check.\nfunction isSafeUrl( url ) {\n\tconst normalizedUrl = url.replace( ATTRIBUTE_WHITESPACES, '' );\n\n\treturn normalizedUrl.match( SAFE_URL );\n}\n\n/**\n * Returns the {@link module:link/link~LinkConfig#decorators `config.link.decorators`} configuration processed\n * to respect the locale of the editor, i.e. to display the {@link module:link/link~LinkDecoratorManualDefinition label}\n * in the correct language.\n *\n * **Note**: Only the few most commonly used labels are translated automatically. Other labels should be manually\n * translated in the {@link module:link/link~LinkConfig#decorators `config.link.decorators`} configuration.\n *\n * @param {module:utils/locale~Locale#t} t shorthand for {@link module:utils/locale~Locale#t Locale#t}\n * @param {Array.} The decorator reference\n * where the label values should be localized.\n * @returns {Array.}\n */\nexport function getLocalizedDecorators( t, decorators ) {\n\tconst localizedDecoratorsLabels = {\n\t\t'Open in a new tab': t( 'Open in a new tab' ),\n\t\t'Downloadable': t( 'Downloadable' )\n\t};\n\n\tdecorators.forEach( decorator => {\n\t\tif ( decorator.label && localizedDecoratorsLabels[ decorator.label ] ) {\n\t\t\tdecorator.label = localizedDecoratorsLabels[ decorator.label ];\n\t\t}\n\t\treturn decorator;\n\t} );\n\n\treturn decorators;\n}\n\n/**\n * Converts an object with defined decorators to a normalized array of decorators. The `id` key is added for each decorator and\n * is used as the attribute's name in the model.\n *\n * @param {Object.} decorators\n * @returns {Array.}\n */\nexport function normalizeDecorators( decorators ) {\n\tconst retArray = [];\n\n\tif ( decorators ) {\n\t\tfor ( const [ key, value ] of Object.entries( decorators ) ) {\n\t\t\tconst decorator = Object.assign(\n\t\t\t\t{},\n\t\t\t\tvalue,\n\t\t\t\t{ id: `link${ upperFirst( key ) }` }\n\t\t\t);\n\t\t\tretArray.push( decorator );\n\t\t}\n\t}\n\n\treturn retArray;\n}\n\n/**\n * Returns `true` if the specified `element` can be linked (the element allows the `linkHref` attribute).\n *\n * @params {module:engine/model/element~Element|null} element\n * @params {module:engine/model/schema~Schema} schema\n * @returns {Boolean}\n */\nexport function isLinkableElement( element, schema ) {\n\tif ( !element ) {\n\t\treturn false;\n\t}\n\n\treturn schema.checkAttribute( element.name, 'linkHref' );\n}\n\n/**\n * Returns `true` if the specified `value` is an email.\n *\n * @params {String} value\n * @returns {Boolean}\n */\nexport function isEmail( value ) {\n\treturn EMAIL_REG_EXP.test( value );\n}\n\n/**\n * Adds the protocol prefix to the specified `link` when:\n *\n * * it does not contain it already, and there is a {@link module:link/link~LinkConfig#defaultProtocol `defaultProtocol` }\n * configuration value provided,\n * * or the link is an email address.\n *\n *\n * @params {String} link\n * @params {String} defaultProtocol\n * @returns {Boolean}\n */\nexport function addLinkProtocolIfApplicable( link, defaultProtocol ) {\n\tconst protocol = isEmail( link ) ? 'mailto:' : defaultProtocol;\n\tconst isProtocolNeeded = !!protocol && !PROTOCOL_REG_EXP.test( link );\n\n\treturn link && isProtocolNeeded ? protocol + link : link;\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module link/utils\n */\n\nimport { toMap } from 'ckeditor5/src/utils';\n\n/**\n * Helper class that ties together all {@link module:link/link~LinkDecoratorAutomaticDefinition} and provides\n * the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement downcast dispatchers} for them.\n */\nexport default class AutomaticDecorators {\n\tconstructor() {\n\t\t/**\n\t\t * Stores the definition of {@link module:link/link~LinkDecoratorAutomaticDefinition automatic decorators}.\n\t\t * This data is used as a source for a downcast dispatcher to create a proper conversion to output data.\n\t\t *\n\t\t * @private\n\t\t * @type {Set}\n\t\t */\n\t\tthis._definitions = new Set();\n\t}\n\n\t/**\n\t * Gives information about the number of decorators stored in the {@link module:link/utils~AutomaticDecorators} instance.\n\t *\n\t * @readonly\n\t * @protected\n\t * @type {Number}\n\t */\n\tget length() {\n\t\treturn this._definitions.size;\n\t}\n\n\t/**\n\t * Adds automatic decorator objects or an array with them to be used during downcasting.\n\t *\n\t * @param {module:link/link~LinkDecoratorAutomaticDefinition|Array.} item\n\t * A configuration object of automatic rules for decorating links. It might also be an array of such objects.\n\t */\n\tadd( item ) {\n\t\tif ( Array.isArray( item ) ) {\n\t\t\titem.forEach( item => this._definitions.add( item ) );\n\t\t} else {\n\t\t\tthis._definitions.add( item );\n\t\t}\n\t}\n\n\t/**\n\t * Provides the conversion helper used in the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method.\n\t *\n\t * @returns {Function} A dispatcher function used as conversion helper\n\t * in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add}.\n\t */\n\tgetDispatcher() {\n\t\treturn dispatcher => {\n\t\t\tdispatcher.on( 'attribute:linkHref', ( evt, data, conversionApi ) => {\n\t\t\t\t// There is only test as this behavior decorates links and\n\t\t\t\t// it is run before dispatcher which actually consumes this node.\n\t\t\t\t// This allows on writing own dispatcher with highest priority,\n\t\t\t\t// which blocks both native converter and this additional decoration.\n\t\t\t\tif ( !conversionApi.consumable.test( data.item, 'attribute:linkHref' ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst viewWriter = conversionApi.writer;\n\t\t\t\tconst viewSelection = viewWriter.document.selection;\n\n\t\t\t\tfor ( const item of this._definitions ) {\n\t\t\t\t\tconst viewElement = viewWriter.createAttributeElement( 'a', item.attributes, {\n\t\t\t\t\t\tpriority: 5\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( item.classes ) {\n\t\t\t\t\t\tviewWriter.addClass( item.classes, viewElement );\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( const key in item.styles ) {\n\t\t\t\t\t\tviewWriter.setStyle( key, item.styles[ key ], viewElement );\n\t\t\t\t\t}\n\n\t\t\t\t\tviewWriter.setCustomProperty( 'link', true, viewElement );\n\t\t\t\t\tif ( item.callback( data.attributeNewValue ) ) {\n\t\t\t\t\t\tif ( data.item.is( 'selection' ) ) {\n\t\t\t\t\t\t\tviewWriter.wrap( viewSelection.getFirstRange(), viewElement );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tviewWriter.wrap( conversionApi.mapper.toViewRange( data.range ), viewElement );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tviewWriter.unwrap( conversionApi.mapper.toViewRange( data.range ), viewElement );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, { priority: 'high' } );\n\t\t};\n\t}\n\n\t/**\n\t * Provides the conversion helper used in the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method\n\t * when linking images.\n\t *\n\t * @returns {Function} A dispatcher function used as conversion helper\n\t * in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add}.\n\t */\n\tgetDispatcherForLinkedImage() {\n\t\treturn dispatcher => {\n\t\t\tdispatcher.on( 'attribute:linkHref:imageBlock', ( evt, data, { writer, mapper } ) => {\n\t\t\t\tconst viewFigure = mapper.toViewElement( data.item );\n\t\t\t\tconst linkInImage = Array.from( viewFigure.getChildren() ).find( child => child.name === 'a' );\n\n\t\t\t\tfor ( const item of this._definitions ) {\n\t\t\t\t\tconst attributes = toMap( item.attributes );\n\n\t\t\t\t\tif ( item.callback( data.attributeNewValue ) ) {\n\t\t\t\t\t\tfor ( const [ key, val ] of attributes ) {\n\t\t\t\t\t\t\t// Left for backward compatibility. Since v30 decorator should\n\t\t\t\t\t\t\t// accept `classes` and `styles` separately from `attributes`.\n\t\t\t\t\t\t\tif ( key === 'class' ) {\n\t\t\t\t\t\t\t\twriter.addClass( val, linkInImage );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twriter.setAttribute( key, val, linkInImage );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( item.classes ) {\n\t\t\t\t\t\t\twriter.addClass( item.classes, linkInImage );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor ( const key in item.styles ) {\n\t\t\t\t\t\t\twriter.setStyle( key, item.styles[ key ], linkInImage );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor ( const [ key, val ] of attributes ) {\n\t\t\t\t\t\t\tif ( key === 'class' ) {\n\t\t\t\t\t\t\t\twriter.removeClass( val, linkInImage );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twriter.removeAttribute( key, linkInImage );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( item.classes ) {\n\t\t\t\t\t\t\twriter.removeClass( item.classes, linkInImage );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor ( const key in item.styles ) {\n\t\t\t\t\t\t\twriter.removeStyle( key, linkInImage );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\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 link/utils\n */\n\nimport { ObservableMixin, mix } from 'ckeditor5/src/utils';\n\n/**\n * Helper class that stores manual decorators with observable {@link module:link/utils~ManualDecorator#value}\n * to support integration with the UI state. An instance of this class is a model with the state of individual manual decorators.\n * These decorators are kept as collections in {@link module:link/linkcommand~LinkCommand#manualDecorators}.\n *\n * @mixes module:utils/observablemixin~ObservableMixin\n */\nexport default class ManualDecorator {\n\t/**\n\t * Creates a new instance of {@link module:link/utils~ManualDecorator}.\n\t *\n\t * @param {Object} config\n\t * @param {String} config.id The name of the attribute used in the model that represents a given manual decorator.\n\t * For example: `'linkIsExternal'`.\n\t * @param {String} config.label The label used in the user interface to toggle the manual decorator.\n\t * @param {Object} config.attributes A set of attributes added to output data when the decorator is active for a specific link.\n\t * Attributes should keep the format of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.\n\t * @param {Boolean} [config.defaultValue] Controls whether the decorator is \"on\" by default.\n\t */\n\tconstructor( { id, label, attributes, classes, styles, defaultValue } ) {\n\t\t/**\n\t\t * An ID of a manual decorator which is the name of the attribute in the model, for example: 'linkManualDecorator0'.\n\t\t *\n\t\t * @type {String}\n\t\t */\n\t\tthis.id = id;\n\n\t\t/**\n\t\t * The value of the current manual decorator. It reflects its state from the UI.\n\t\t *\n\t\t * @observable\n\t\t * @member {Boolean} module:link/utils~ManualDecorator#value\n\t\t */\n\t\tthis.set( 'value' );\n\n\t\t/**\n\t\t * The default value of manual decorator.\n\t\t *\n\t\t * @type {Boolean}\n\t\t */\n\t\tthis.defaultValue = defaultValue;\n\n\t\t/**\n\t\t * The label used in the user interface to toggle the manual decorator.\n\t\t *\n\t\t * @type {String}\n\t\t */\n\t\tthis.label = label;\n\n\t\t/**\n\t\t * A set of attributes added to downcasted data when the decorator is activated for a specific link.\n\t\t * Attributes should be added in a form of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.attributes = attributes;\n\n\t\t/**\n\t\t * A set of classes added to downcasted data when the decorator is activated for a specific link.\n\t\t * Classes should be added in a form of classes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.classes = classes;\n\n\t\t/**\n\t\t * A set of styles added to downcasted data when the decorator is activated for a specific link.\n\t\t * Styles should be added in a form of styles defined in {@link module:engine/view/elementdefinition~ElementDefinition}.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.styles = styles;\n\t}\n\n\t/**\n\t * Returns {@link module:engine/view/matcher~MatcherPattern} with decorator attributes.\n\t *\n\t * @protected\n\t * @returns {module:engine/view/matcher~MatcherPattern}\n\t */\n\t_createPattern() {\n\t\treturn {\n\t\t\tattributes: this.attributes,\n\t\t\tclasses: this.classes,\n\t\t\tstyles: this.styles\n\t\t};\n\t}\n}\n\nmix( ManualDecorator, ObservableMixin );\n"],"sourceRoot":""}