F[o{o
B}ar
Xy]z
\n //\n //Fo{o
B}ar
z
\n //F{
B}ar
z
\n //F{
}z
\n //F{}z
\n //\n if (this.start.isEqual(operation.targetPosition) && this.end.isEqual(operation.deletionPosition)) {\n return new Range(this.start);\n }\n var start = this.start._getTransformedByMergeOperation(operation);\n var end = this.end._getTransformedByMergeOperation(operation);\n if (start.root != end.root) {\n // This happens when the end position was next to the merged (deleted) element.\n // Then, the end position was moved to the graveyard root. In this case we need to fix\n // the range cause its boundaries would be in different roots.\n end = this.end.getShiftedBy(-1);\n }\n if (start.isAfter(end)) {\n // This happens in three following cases:\n //\n // Case 1: Merge operation source position is before the target position (due to some transformations, OT, etc.)\n // This means that start can be moved before the end of the range.\n //\n // Before:a{a
b}b
cc
\n // Merge:b}b
cca{a
\n // Fix:{b}b
ccaa
\n //\n // Case 2: Range start is before merged node but not directly.\n // Result should include all nodes that were in the original range.\n //\n // Before:aa
{cc
b}b
\n // Merge:aab}b
{cc
\n // Fix:aa{bb
cc
}\n //\n // The range is expanded by an additional `b` letter but it is better than dropping the whole `cc` paragraph.\n //\n // Case 3: Range start is directly before merged node.\n // Resulting range should include only nodes from the merged element:\n //\n // Before:aa
{b}b
cc
\n // Merge:aab}b
{cc
\n // Fix:aa{b}b
cc
\n //\n\n if (operation.sourcePosition.isBefore(operation.targetPosition)) {\n // Case 1.\n start = Position._createAt(end);\n start.offset = 0;\n } else {\n if (!operation.deletionPosition.isEqual(start)) {\n // Case 2.\n end = operation.deletionPosition;\n }\n\n // In both case 2 and 3 start is at the end of the merge-to element.\n start = operation.targetPosition;\n }\n return new Range(start, end);\n }\n return new Range(start, end);\n }\n\n /**\n * Returns an array containing one or two {@link ~Range ranges} that are a result of transforming this\n * {@link ~Range range} by inserting `howMany` nodes at `insertPosition`. Two {@link ~Range ranges} are\n * returned if the insertion was inside this {@link ~Range range} and `spread` is set to `true`.\n *\n * Examples:\n *\n *\t\tlet range = model.createRange(\n *\t\t\tmodel.createPositionFromPath( root, [ 2, 7 ] ),\n *\t\t\tmodel.createPositionFromPath( root, [ 4, 0, 1 ] )\n *\t\t);\n *\t\tlet transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 1 ] ), 2 );\n *\t\t// transformed array has one range from [ 4, 7 ] to [ 6, 0, 1 ]\n *\n *\t\ttransformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 4, 0, 0 ] ), 4 );\n *\t\t// transformed array has one range from [ 2, 7 ] to [ 4, 0, 5 ]\n *\n *\t\ttransformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 3, 2 ] ), 4 );\n *\t\t// transformed array has one range, which is equal to original range\n *\n *\t\ttransformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 3, 2 ] ), 4, true );\n *\t\t// transformed array has two ranges: from [ 2, 7 ] to [ 3, 2 ] and from [ 3, 6 ] to [ 4, 0, 1 ]\n *\n * @protected\n * @param {module:engine/model/position~Position} insertPosition Position where nodes are inserted.\n * @param {Number} howMany How many nodes are inserted.\n * @param {Boolean} [spread] Flag indicating whether this {~Range range} should be spread if insertion\n * was inside the range. Defaults to `false`.\n * @returns {Array.ab
c[d
e]f
-->ab
c[d
e]f
\n //e[f
a]b
cd
e[f
a]b
cd
ab
c[d
e]f
-->ab
{c[d
e]f
\n //\n // This special case is applied only if the range is to be kept together (not spread).\n var moveRange = Range._createFromPositionAndShift(sourcePosition, howMany);\n var insertPosition = targetPosition._getTransformedByDeletion(sourcePosition, howMany);\n if (this.containsPosition(targetPosition) && !spread) {\n if (moveRange.containsPosition(this.start) || moveRange.containsPosition(this.end)) {\n var start = this.start._getTransformedByMove(sourcePosition, targetPosition, howMany);\n var end = this.end._getTransformedByMove(sourcePosition, targetPosition, howMany);\n return [new Range(start, end)];\n }\n }\n\n // Default algorithm.\n var result;\n var differenceSet = this.getDifference(moveRange);\n var difference = null;\n var common = this.getIntersection(moveRange);\n if (differenceSet.length == 1) {\n // `moveRange` and this range may intersect but may be separate.\n difference = new Range(differenceSet[0].start._getTransformedByDeletion(sourcePosition, howMany), differenceSet[0].end._getTransformedByDeletion(sourcePosition, howMany));\n } else if (differenceSet.length == 2) {\n // `moveRange` is inside this range.\n difference = new Range(this.start, this.end._getTransformedByDeletion(sourcePosition, howMany));\n } // else, `moveRange` contains this range.\n\n if (difference) {\n result = difference._getTransformedByInsertion(insertPosition, howMany, common !== null || spread);\n } else {\n result = [];\n }\n if (common) {\n var transformedCommon = new Range(common.start._getCombined(moveRange.start, insertPosition), common.end._getCombined(moveRange.start, insertPosition));\n if (result.length == 2) {\n result.splice(1, 0, transformedCommon);\n } else {\n result.push(transformedCommon);\n }\n }\n return result;\n }\n\n /**\n * Returns a copy of this range that is transformed by deletion of `howMany` nodes from `deletePosition`.\n *\n * If the deleted range is intersecting with the transformed range, the transformed range will be shrank.\n *\n * If the deleted range contains transformed range, `null` will be returned.\n *\n * @protected\n * @param {module:engine/model/position~Position} deletionPosition Position from which nodes are removed.\n * @param {Number} howMany How many nodes are removed.\n * @returns {module:engine/model/range~Range|null} Result of the transformation.\n */\n }, {\n key: \"_getTransformedByDeletion\",\n value: function _getTransformedByDeletion(deletePosition, howMany) {\n var newStart = this.start._getTransformedByDeletion(deletePosition, howMany);\n var newEnd = this.end._getTransformedByDeletion(deletePosition, howMany);\n if (newStart == null && newEnd == null) {\n return null;\n }\n if (newStart == null) {\n newStart = deletePosition;\n }\n if (newEnd == null) {\n newEnd = deletePosition;\n }\n return new Range(newStart, newEnd);\n }\n\n /**\n * Creates a new range, spreading from specified {@link module:engine/model/position~Position position} to a position moved by\n * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.\n *\n * @protected\n * @param {module:engine/model/position~Position} position Beginning of the range.\n * @param {Number} shift How long the range should be.\n * @returns {module:engine/model/range~Range}\n */\n }], [{\n key: \"_createFromPositionAndShift\",\n value: function _createFromPositionAndShift(position, shift) {\n var start = position;\n var end = position.getShiftedBy(shift);\n return shift > 0 ? new this(start, end) : new this(end, start);\n }\n\n /**\n * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * @protected\n * @param {module:engine/model/element~Element} element Element which is a parent for the range.\n * @returns {module:engine/model/range~Range}\n */\n }, {\n key: \"_createIn\",\n value: function _createIn(element) {\n return new this(Position._createAt(element, 0), Position._createAt(element, element.maxOffset));\n }\n\n /**\n * Creates a range that starts before given {@link module:engine/model/item~Item model item} and ends after it.\n *\n * @protected\n * @param {module:engine/model/item~Item} item\n * @returns {module:engine/model/range~Range}\n */\n }, {\n key: \"_createOn\",\n value: function _createOn(item) {\n return this._createFromPositionAndShift(Position._createBefore(item), item.offsetSize);\n }\n\n /**\n * Combines all ranges from the passed array into a one range. At least one range has to be passed.\n * Passed ranges must not have common parts.\n *\n * The first range from the array is a reference range. If other ranges start or end on the exactly same position where\n * the reference range, they get combined into one range.\n *\n *\t\t[ ][] [ ][ ][ ][ ][] [ ] // Passed ranges, shown sorted\n *\t\t[ ] // The result of the function if the first range was a reference range.\n *\t [ ] // The result of the function if the third-to-seventh range was a reference range.\n *\t [ ] // The result of the function if the last range was a reference range.\n *\n * @param {Array.f^|oo
->fbar|oo
\n *\t\t- sticks to next node:f^|oo
->fbar|oo
\n *\t\t- sticks to previous node:f|^oo
->f|baroo
\n *\n *\n *\t\tMove. Position is at | and range [oo] is moved to position ^:\n *\n *\t\t- sticks to none:f|[oo]
b^ar
->f|
booar
\n *\t\t- sticks to none:f[oo]|
b^ar
->f|
booar
\n *\n *\t\t- sticks to next node:f|[oo]
b^ar
->f
b|ooar
\n *\t\t- sticks to next node:f[oo]|
b^ar
->f|
booar
\n *\n *\t\t- sticks to previous node:f|[oo]
b^ar
->f|
booar
\n *\t\t- sticks to previous node:f[oo]|
b^ar
->f
boo|ar
\n *\n * @typedef {String} module:engine/model/position~PositionStickiness\n */\nexport { Position as default };","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n/**\n * @license Copyright (c) 2003-2019, 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 engine/view/position\n */\n\nimport TreeWalker from './treewalker';\nimport compareArrays from '@ckeditor/ckeditor5-utils/src/comparearrays';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport EditableElement from './editableelement';\n\n// To check if component is loaded more than once.\nimport '@ckeditor/ckeditor5-utils/src/version';\n\n/**\n * Position in the view tree. Position is represented by its parent node and an offset in this parent.\n *\n * In order to create a new position instance use the `createPosition*()` factory methods available in:\n *\n * * {@link module:engine/view/view~View}\n * * {@link module:engine/view/downcastwriter~DowncastWriter}\n * * {@link module:engine/view/upcastwriter~UpcastWriter}\n */\nvar Position = /*#__PURE__*/function () {\n /**\n * Creates a position.\n *\n * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} parent Position parent.\n * @param {Number} offset Position offset.\n */\n function Position(parent, offset) {\n _classCallCheck(this, Position);\n /**\n * Position parent.\n *\n * @readonly\n * @member {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}\n * module:engine/view/position~Position#parent\n */\n this.parent = parent;\n\n /**\n * Position offset.\n *\n * @readonly\n * @member {Number} module:engine/view/position~Position#offset\n */\n this.offset = offset;\n }\n\n /**\n * Node directly after the position. Equals `null` when there is no node after position or position is located\n * inside text node.\n *\n * @readonly\n * @type {module:engine/view/node~Node|null}\n */\n _createClass(Position, [{\n key: \"nodeAfter\",\n get: function get() {\n if (this.parent.is('text')) {\n return null;\n }\n return this.parent.getChild(this.offset) || null;\n }\n\n /**\n * Node directly before the position. Equals `null` when there is no node before position or position is located\n * inside text node.\n *\n * @readonly\n * @type {module:engine/view/node~Node|null}\n */\n }, {\n key: \"nodeBefore\",\n get: function get() {\n if (this.parent.is('text')) {\n return null;\n }\n return this.parent.getChild(this.offset - 1) || null;\n }\n\n /**\n * Is `true` if position is at the beginning of its {@link module:engine/view/position~Position#parent parent}, `false` otherwise.\n *\n * @readonly\n * @type {Boolean}\n */\n }, {\n key: \"isAtStart\",\n get: function get() {\n return this.offset === 0;\n }\n\n /**\n * Is `true` if position is at the end of its {@link module:engine/view/position~Position#parent parent}, `false` otherwise.\n *\n * @readonly\n * @type {Boolean}\n */\n }, {\n key: \"isAtEnd\",\n get: function get() {\n var endOffset = this.parent.is('text') ? this.parent.data.length : this.parent.childCount;\n return this.offset === endOffset;\n }\n\n /**\n * Position's root, that is the root of the position's parent element.\n *\n * @readonly\n * @type {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}\n */\n }, {\n key: \"root\",\n get: function get() {\n return this.parent.root;\n }\n\n /**\n * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this position, or `null` if\n * position is not inside an editable element.\n *\n * @type {module:engine/view/editableelement~EditableElement|null}\n */\n }, {\n key: \"editableElement\",\n get: function get() {\n var editable = this.parent;\n while (!(editable instanceof EditableElement)) {\n if (editable.parent) {\n editable = editable.parent;\n } else {\n return null;\n }\n }\n return editable;\n }\n\n /**\n * Returns a new instance of Position with offset incremented by `shift` value.\n *\n * @param {Number} shift How position offset should get changed. Accepts negative values.\n * @returns {module:engine/view/position~Position} Shifted position.\n */\n }, {\n key: \"getShiftedBy\",\n value: function getShiftedBy(shift) {\n var shifted = Position._createAt(this);\n var offset = shifted.offset + shift;\n shifted.offset = offset < 0 ? 0 : offset;\n return shifted;\n }\n\n /**\n * Gets the farthest position which matches the callback using\n * {@link module:engine/view/treewalker~TreeWalker TreeWalker}.\n *\n * For example:\n *\n * \t\tgetLastMatchingPosition( value => value.type == 'text' ); //{}foo
->foo[]
\n * \t\tgetLastMatchingPosition( value => value.type == 'text', { direction: 'backward' } ); //foo[]
->{}foo
\n * \t\tgetLastMatchingPosition( value => false ); // Do not move the position.\n *\n * @param {Function} skip Callback function. Gets {@link module:engine/view/treewalker~TreeWalkerValue} and should\n * return `true` if the value should be skipped or `false` if not.\n * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.\n *\n * @returns {module:engine/view/position~Position} The position after the last item which matches the `skip` callback test.\n */\n }, {\n key: \"getLastMatchingPosition\",\n value: function getLastMatchingPosition(skip) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n options.startPosition = this;\n var treeWalker = new TreeWalker(options);\n treeWalker.skip(skip);\n return treeWalker.position;\n }\n\n /**\n * Returns ancestors array of this position, that is this position's parent and it's ancestors.\n *\n * @returns {Array} Array with ancestors.\n */\n }, {\n key: \"getAncestors\",\n value: function getAncestors() {\n if (this.parent.is('documentFragment')) {\n return [this.parent];\n } else {\n return this.parent.getAncestors({\n includeSelf: true\n });\n }\n }\n\n /**\n * Returns a {@link module:engine/view/node~Node} or {@link module:engine/view/documentfragment~DocumentFragment}\n * which is a common ancestor of both positions.\n *\n * @param {module:engine/view/position~Position} position\n * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null}\n */\n }, {\n key: \"getCommonAncestor\",\n value: function getCommonAncestor(position) {\n var ancestorsA = this.getAncestors();\n var ancestorsB = position.getAncestors();\n var i = 0;\n while (ancestorsA[i] == ancestorsB[i] && ancestorsA[i]) {\n i++;\n }\n return i === 0 ? null : ancestorsA[i - 1];\n }\n\n /**\n * Checks whether this object is of the given type.\n *\n *\t\tposition.is( 'position' ); // -> true\n *\t\tposition.is( 'view:position' ); // -> true\n *\n *\t\tposition.is( 'model:position' ); // -> false\n *\t\tposition.is( 'element' ); // -> false\n *\t\tposition.is( 'range' ); // -> false\n *\n * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.\n *\n * @param {String} type\n * @returns {Boolean}\n */\n }, {\n key: \"is\",\n value: function is(type) {\n return type == 'position' || type == 'view:position';\n }\n\n /**\n * Checks whether this position equals given position.\n *\n * @param {module:engine/view/position~Position} otherPosition Position to compare with.\n * @returns {Boolean} True if positions are same.\n */\n }, {\n key: \"isEqual\",\n value: function isEqual(otherPosition) {\n return this.parent == otherPosition.parent && this.offset == otherPosition.offset;\n }\n\n /**\n * Checks whether this position is located before given position. When method returns `false` it does not mean that\n * this position is after give one. Two positions may be located inside separate roots and in that situation this\n * method will still return `false`.\n *\n * @see module:engine/view/position~Position#isAfter\n * @see module:engine/view/position~Position#compareWith\n * @param {module:engine/view/position~Position} otherPosition Position to compare with.\n * @returns {Boolean} Returns `true` if this position is before given position.\n */\n }, {\n key: \"isBefore\",\n value: function isBefore(otherPosition) {\n return this.compareWith(otherPosition) == 'before';\n }\n\n /**\n * Checks whether this position is located after given position. When method returns `false` it does not mean that\n * this position is before give one. Two positions may be located inside separate roots and in that situation this\n * method will still return `false`.\n *\n * @see module:engine/view/position~Position#isBefore\n * @see module:engine/view/position~Position#compareWith\n * @param {module:engine/view/position~Position} otherPosition Position to compare with.\n * @returns {Boolean} Returns `true` if this position is after given position.\n */\n }, {\n key: \"isAfter\",\n value: function isAfter(otherPosition) {\n return this.compareWith(otherPosition) == 'after';\n }\n\n /**\n * Checks whether this position is before, after or in same position that other position. Two positions may be also\n * different when they are located in separate roots.\n *\n * @param {module:engine/view/position~Position} otherPosition Position to compare with.\n * @returns {module:engine/view/position~PositionRelation}\n */\n }, {\n key: \"compareWith\",\n value: function compareWith(otherPosition) {\n if (this.root !== otherPosition.root) {\n return 'different';\n }\n if (this.isEqual(otherPosition)) {\n return 'same';\n }\n\n // Get path from root to position's parent element.\n var thisPath = this.parent.is('node') ? this.parent.getPath() : [];\n var otherPath = otherPosition.parent.is('node') ? otherPosition.parent.getPath() : [];\n\n // Add the positions' offsets to the parents offsets.\n thisPath.push(this.offset);\n otherPath.push(otherPosition.offset);\n\n // Compare both path arrays to find common ancestor.\n var result = compareArrays(thisPath, otherPath);\n switch (result) {\n case 'prefix':\n return 'before';\n case 'extension':\n return 'after';\n default:\n return thisPath[result] < otherPath[result] ? 'before' : 'after';\n }\n }\n\n /**\n * Creates a {@link module:engine/view/treewalker~TreeWalker TreeWalker} instance with this positions as a start position.\n *\n * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}\n * @param {module:engine/view/range~Range} [options.boundaries=null] Range to define boundaries of the iterator.\n * @param {Boolean} [options.singleCharacters=false]\n * @param {Boolean} [options.shallow=false]\n * @param {Boolean} [options.ignoreElementEnd=false]\n */\n }, {\n key: \"getWalker\",\n value: function getWalker() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n options.startPosition = this;\n return new TreeWalker(options);\n }\n }, {\n key: \"clone\",\n value: function clone() {\n return new Position(this.parent, this.offset);\n }\n\n /**\n * Creates position at the given location. The location can be specified as:\n *\n * * a {@link module:engine/view/position~Position position},\n * * parent element and offset (offset defaults to `0`),\n * * parent element and `'end'` (sets position at the end of that element),\n * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).\n *\n * This method is a shortcut to other constructors such as:\n *\n * * {@link module:engine/view/position~Position._createBefore},\n * * {@link module:engine/view/position~Position._createAfter}.\n *\n * @protected\n * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition\n * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when\n * first parameter is a {@link module:engine/view/item~Item view item}.\n */\n }], [{\n key: \"_createAt\",\n value: function _createAt(itemOrPosition, offset) {\n if (itemOrPosition instanceof Position) {\n return new this(itemOrPosition.parent, itemOrPosition.offset);\n } else {\n var node = itemOrPosition;\n if (offset == 'end') {\n offset = node.is('text') ? node.data.length : node.childCount;\n } else if (offset == 'before') {\n return this._createBefore(node);\n } else if (offset == 'after') {\n return this._createAfter(node);\n } else if (offset !== 0 && !offset) {\n /**\n * {@link module:engine/view/view~View#createPositionAt `View#createPositionAt()`}\n * requires the offset to be specified when the first parameter is a view item.\n *\n * @error view-createPositionAt-offset-required\n */\n throw new CKEditorError('view-createPositionAt-offset-required: ' + 'View#createPositionAt() requires the offset when the first parameter is a view item.', node);\n }\n return new Position(node, offset);\n }\n }\n\n /**\n * Creates a new position after given view item.\n *\n * @protected\n * @param {module:engine/view/item~Item} item View item after which the position should be located.\n * @returns {module:engine/view/position~Position}\n */\n }, {\n key: \"_createAfter\",\n value: function _createAfter(item) {\n // TextProxy is not a instance of Node so we need do handle it in specific way.\n if (item.is('textProxy')) {\n return new Position(item.textNode, item.offsetInText + item.data.length);\n }\n if (!item.parent) {\n /**\n * You can not make a position after a root.\n *\n * @error view-position-after-root\n * @param {module:engine/view/node~Node} root\n */\n throw new CKEditorError('view-position-after-root: You can not make position after root.', item, {\n root: item\n });\n }\n return new Position(item.parent, item.index + 1);\n }\n\n /**\n * Creates a new position before given view item.\n *\n * @protected\n * @param {module:engine/view/item~Item} item View item before which the position should be located.\n * @returns {module:engine/view/position~Position}\n */\n }, {\n key: \"_createBefore\",\n value: function _createBefore(item) {\n // TextProxy is not a instance of Node so we need do handle it in specific way.\n if (item.is('textProxy')) {\n return new Position(item.textNode, item.offsetInText);\n }\n if (!item.parent) {\n /**\n * You cannot make a position before a root.\n *\n * @error view-position-before-root\n * @param {module:engine/view/node~Node} root\n */\n throw new CKEditorError('view-position-before-root: You can not make position before root.', item, {\n root: item\n });\n }\n return new Position(item.parent, item.index);\n }\n }]);\n return Position;\n}();\n/**\n * A flag indicating whether this position is `'before'` or `'after'` or `'same'` as given position.\n * If positions are in different roots `'different'` flag is returned.\n *\n * @typedef {String} module:engine/view/position~PositionRelation\n */\nexport { Position as default };","/**\n * @license Copyright (c) 2003-2019, 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 utils/mix\n */\n\n/**\n * Copies enumerable properties and symbols from the objects given as 2nd+ parameters to the\n * prototype of first object (a constructor).\n *\n *\t\tclass Editor {\n *\t\t\t...\n *\t\t}\n *\n *\t\tconst SomeMixin = {\n *\t\t\ta() {\n *\t\t\t\treturn 'a';\n *\t\t\t}\n *\t\t};\n *\n *\t\tmix( Editor, SomeMixin, ... );\n *\n *\t\tnew Editor().a(); // -> 'a'\n *\n * Note: Properties which already exist in the base class will not be overriden.\n *\n * @param {Function} [baseClass] Class which prototype will be extended.\n * @param {Object} [...mixins] Objects from which to get properties.\n */\nexport default function mix(baseClass) {\n for (var _len = arguments.length, mixins = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n mixins[_key - 1] = arguments[_key];\n }\n mixins.forEach(function (mixin) {\n Object.getOwnPropertyNames(mixin).concat(Object.getOwnPropertySymbols(mixin)).forEach(function (key) {\n if (key in baseClass.prototype) {\n return;\n }\n var sourceDescriptor = Object.getOwnPropertyDescriptor(mixin, key);\n sourceDescriptor.enumerable = false;\n Object.defineProperty(baseClass.prototype, key, sourceDescriptor);\n });\n });\n}","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n/*!\n * jQuery JavaScript Library v3.5.1\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2020-05-04T22:49Z\n */\n(function (global, factory) {\n \"use strict\";\n\n if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === \"object\" && _typeof(module.exports) === \"object\") {\n // For CommonJS and CommonJS-like environments where a proper `window`\n // is present, execute the factory and get jQuery.\n // For environments that do not have a `window` with a `document`\n // (such as Node.js), expose a factory as module.exports.\n // This accentuates the need for the creation of a real `window`.\n // e.g. var jQuery = require(\"jquery\")(window);\n // See ticket #14549 for more info.\n module.exports = global.document ? factory(global, true) : function (w) {\n if (!w.document) {\n throw new Error(\"jQuery requires a window with a document\");\n }\n return factory(w);\n };\n } else {\n factory(global);\n }\n\n // Pass this if window is not defined yet\n})(typeof window !== \"undefined\" ? window : this, function (window, noGlobal) {\n // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n // enough that all such attempts are guarded in a try block.\n \"use strict\";\n\n var arr = [];\n var getProto = Object.getPrototypeOf;\n var _slice = arr.slice;\n var flat = arr.flat ? function (array) {\n return arr.flat.call(array);\n } : function (array) {\n return arr.concat.apply([], array);\n };\n var push = arr.push;\n var indexOf = arr.indexOf;\n var class2type = {};\n var toString = class2type.toString;\n var hasOwn = class2type.hasOwnProperty;\n var fnToString = hasOwn.toString;\n var ObjectFunctionString = fnToString.call(Object);\n var support = {};\n var isFunction = function isFunction(obj) {\n // Support: Chrome <=57, Firefox <=52\n // In some browsers, typeof returns \"function\" for HTML