diff --git a/dist/Draft.js b/dist/Draft.js index bcc93578b3..8ad7bc0623 100644 --- a/dist/Draft.js +++ b/dist/Draft.js @@ -80,7 +80,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; var AtomicBlockUtils = __webpack_require__(63); - var BlockMapBuilder = __webpack_require__(16); + var BlockMapBuilder = __webpack_require__(17); var CharacterMetadata = __webpack_require__(4); var CompositeDraftDecorator = __webpack_require__(64); var ContentBlock = __webpack_require__(10); @@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap var KeyBindingUtil = __webpack_require__(27); var RichTextEditorUtil = __webpack_require__(45); var NestedTextEditorUtil = __webpack_require__(81); - var SelectionState = __webpack_require__(15); + var SelectionState = __webpack_require__(16); var convertFromDraftStateToRaw = __webpack_require__(86); var convertFromHTMLToContentBlocks = __webpack_require__(46); @@ -234,7 +234,7 @@ return /******/ (function(modules) { // webpackBootstrap var ContentState = __webpack_require__(22); var EditorBidiService = __webpack_require__(80); var Immutable = __webpack_require__(1); - var SelectionState = __webpack_require__(15); + var SelectionState = __webpack_require__(16); var OrderedSet = Immutable.OrderedSet, Record = Immutable.Record, @@ -1493,7 +1493,7 @@ return /******/ (function(modules) { // webpackBootstrap var CharacterMetadata = __webpack_require__(4); var Immutable = __webpack_require__(1); - var findRangesImmutable = __webpack_require__(17); + var findRangesImmutable = __webpack_require__(18); var List = Immutable.List, Map = Immutable.Map, @@ -1656,6 +1656,35 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }), /* 13 */ +/***/ (function(module, exports) { + + /** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule isEventHandled + * @format + * + */ + + 'use strict'; + + /** + * Utility method for determining whether or not the value returned + * from a handler indicates that it was handled. + */ + function isEventHandled(value) { + return value === 'handled' || value === true; + } + + module.exports = isEventHandled; + +/***/ }), +/* 14 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -1872,7 +1901,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = UnicodeUtils; /***/ }), -/* 14 */ +/* 15 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -1905,7 +1934,7 @@ return /******/ (function(modules) { // webpackBootstrap var CharacterMetadata = __webpack_require__(4); var Immutable = __webpack_require__(1); - var findRangesImmutable = __webpack_require__(17); + var findRangesImmutable = __webpack_require__(18); var List = Immutable.List, Map = Immutable.Map, @@ -2032,7 +2061,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = ContentBlockNode; /***/ }), -/* 15 */ +/* 16 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -2171,7 +2200,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = SelectionState; /***/ }), -/* 16 */ +/* 17 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -2205,7 +2234,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = BlockMapBuilder; /***/ }), -/* 17 */ +/* 18 */ /***/ (function(module, exports) { /** @@ -2252,35 +2281,6 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = findRangesImmutable; -/***/ }), -/* 18 */ -/***/ (function(module, exports) { - - /** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule isEventHandled - * @format - * - */ - - 'use strict'; - - /** - * Utility method for determining whether or not the value returned - * from a handler indicates that it was handled. - */ - function isEventHandled(value) { - return value === 'handled' || value === true; - } - - module.exports = isEventHandled; - /***/ }), /* 19 */ /***/ (function(module, exports, __webpack_require__) { @@ -2404,14 +2404,14 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var BlockMapBuilder = __webpack_require__(16); + var BlockMapBuilder = __webpack_require__(17); var CharacterMetadata = __webpack_require__(4); var ContentBlock = __webpack_require__(10); - var ContentBlockNode = __webpack_require__(14); + var ContentBlockNode = __webpack_require__(15); var DraftEntity = __webpack_require__(24); var DraftFeatureFlags = __webpack_require__(12); var Immutable = __webpack_require__(1); - var SelectionState = __webpack_require__(15); + var SelectionState = __webpack_require__(16); var generateRandomKey = __webpack_require__(6); var sanitizeDraftText = __webpack_require__(32); @@ -3658,7 +3658,7 @@ return /******/ (function(modules) { // webpackBootstrap var Immutable = __webpack_require__(1); var emptyFunction = __webpack_require__(37); - var findRangesImmutable = __webpack_require__(17); + var findRangesImmutable = __webpack_require__(18); var List = Immutable.List, Repeat = Immutable.Repeat, @@ -4203,7 +4203,7 @@ return /******/ (function(modules) { // webpackBootstrap var DraftModifier = __webpack_require__(5); var EditorState = __webpack_require__(3); - var SelectionState = __webpack_require__(15); + var SelectionState = __webpack_require__(16); var adjustBlockDepthForContentState = __webpack_require__(83); var nullthrows = __webpack_require__(7); @@ -4522,7 +4522,7 @@ return /******/ (function(modules) { // webpackBootstrap var CharacterMetadata = __webpack_require__(4); var ContentBlock = __webpack_require__(10); - var ContentBlockNode = __webpack_require__(14); + var ContentBlockNode = __webpack_require__(15); var DefaultDraftBlockRenderMap = __webpack_require__(23); var DraftEntity = __webpack_require__(24); var DraftFeatureFlags = __webpack_require__(12); @@ -5816,7 +5816,7 @@ return /******/ (function(modules) { // webpackBootstrap var CharacterMetadata = __webpack_require__(4); - var findRangesImmutable = __webpack_require__(17); + var findRangesImmutable = __webpack_require__(18); var invariant = __webpack_require__(2); function removeEntitiesAtEdges(contentState, selectionState) { @@ -6432,13 +6432,13 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var BlockMapBuilder = __webpack_require__(16); + var BlockMapBuilder = __webpack_require__(17); var CharacterMetadata = __webpack_require__(4); var ContentBlock = __webpack_require__(10); var DraftModifier = __webpack_require__(5); var EditorState = __webpack_require__(3); var Immutable = __webpack_require__(1); - var SelectionState = __webpack_require__(15); + var SelectionState = __webpack_require__(16); var generateRandomKey = __webpack_require__(6); var moveBlockInContentState = __webpack_require__(124); @@ -7465,7 +7465,7 @@ return /******/ (function(modules) { // webpackBootstrap var Keys = __webpack_require__(33); var getEntityKeyForSelection = __webpack_require__(30); - var isEventHandled = __webpack_require__(18); + var isEventHandled = __webpack_require__(13); var isSelectionAtLeafStart = __webpack_require__(56); /** @@ -7834,7 +7834,7 @@ return /******/ (function(modules) { // webpackBootstrap var findAncestorOffsetKey = __webpack_require__(28); var getTextContentFromFiles = __webpack_require__(53); var getUpdatedSelectionState = __webpack_require__(54); - var isEventHandled = __webpack_require__(18); + var isEventHandled = __webpack_require__(13); var nullthrows = __webpack_require__(7); /** @@ -8530,7 +8530,7 @@ return /******/ (function(modules) { // webpackBootstrap var CharacterMetadata = __webpack_require__(4); var ContentBlock = __webpack_require__(10); - var ContentBlockNode = __webpack_require__(14); + var ContentBlockNode = __webpack_require__(15); var DraftFeatureFlags = __webpack_require__(12); var Immutable = __webpack_require__(1); @@ -9548,13 +9548,13 @@ return /******/ (function(modules) { // webpackBootstrap var _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var ContentBlock = __webpack_require__(10); - var ContentBlockNode = __webpack_require__(14); + var ContentBlockNode = __webpack_require__(15); var ContentState = __webpack_require__(22); var DraftEntity = __webpack_require__(24); var DraftFeatureFlags = __webpack_require__(12); var DraftTreeAdapter = __webpack_require__(79); var Immutable = __webpack_require__(1); - var SelectionState = __webpack_require__(15); + var SelectionState = __webpack_require__(16); var createCharacterList = __webpack_require__(88); var decodeEntityRanges = __webpack_require__(89); @@ -9813,7 +9813,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var UnicodeUtils = __webpack_require__(13); + var UnicodeUtils = __webpack_require__(14); var substr = UnicodeUtils.substr; @@ -9861,7 +9861,7 @@ return /******/ (function(modules) { // webpackBootstrap var _require = __webpack_require__(1), OrderedSet = _require.OrderedSet; - var UnicodeUtils = __webpack_require__(13); + var UnicodeUtils = __webpack_require__(14); var substr = UnicodeUtils.substr; @@ -9913,7 +9913,7 @@ return /******/ (function(modules) { // webpackBootstrap var UserAgent = __webpack_require__(8); var getEntityKeyForSelection = __webpack_require__(30); - var isEventHandled = __webpack_require__(18); + var isEventHandled = __webpack_require__(13); var isSelectionAtLeafStart = __webpack_require__(56); var nullthrows = __webpack_require__(7); var setImmediate = __webpack_require__(151); @@ -10088,7 +10088,7 @@ return /******/ (function(modules) { // webpackBootstrap var containsNode = __webpack_require__(36); var getActiveElement = __webpack_require__(62); - function editOnBlur(editor, e) { + function editOnBlur(editor, event) { // In a contentEditable element, when you select a range and then click // another active element, this does trigger a `blur` event but will not // remove the DOM selection from the contenteditable. @@ -10112,8 +10112,9 @@ return /******/ (function(modules) { // webpackBootstrap } var selection = currentSelection.set('hasFocus', false); - editor.props.onBlur && editor.props.onBlur(e); - editor.update(EditorState.acceptSelection(editorState, selection)); + var updatedEditorState = EditorState.acceptSelection(editorState, selection); + editor.update(updatedEditorState); + editor.props.onBlur && editor.props.onBlur(event); } module.exports = editOnBlur; @@ -10173,19 +10174,26 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; var getFragmentFromSelection = __webpack_require__(49); + var isEventHandled = __webpack_require__(13); /** * If we have a selection, create a ContentState fragment and store * it in our internal clipboard. Subsequent paste events will use this * fragment if no external clipboard data is supplied. */ - function editOnCopy(editor, e) { + function editOnCopy(editor, event) { + var shouldPreventDefault = editor.props.onCopy && isEventHandled(editor.props.onCopy(event)); + + if (shouldPreventDefault) { + return; + } + var editorState = editor._latestEditorState; var selection = editorState.getSelection(); // No selection, so there's nothing to copy. if (selection.isCollapsed()) { - e.preventDefault(); + event.preventDefault(); return; } @@ -10219,6 +10227,7 @@ return /******/ (function(modules) { // webpackBootstrap var getFragmentFromSelection = __webpack_require__(49); var getScrollPosition = __webpack_require__(38); + var isEventHandled = __webpack_require__(13); /** * On `cut` events, native behavior is allowed to occur so that the system @@ -10229,15 +10238,21 @@ return /******/ (function(modules) { // webpackBootstrap * In addition, we can keep a copy of the removed fragment, including all * styles and entities, for use as an internal paste. */ - function editOnCut(editor, e) { + function editOnCut(editor, event) { + var shouldPreventDefault = editor.props.onCut && isEventHandled(editor.props.onCut(event)); + + if (shouldPreventDefault) { + return; + } + var editorState = editor._latestEditorState; var selection = editorState.getSelection(); - var element = e.target; + var element = event.target; var scrollPosition = void 0; // No selection, so there's nothing to cut. if (selection.isCollapsed()) { - e.preventDefault(); + event.preventDefault(); return; } @@ -10263,6 +10278,7 @@ return /******/ (function(modules) { // webpackBootstrap function removeFragment(editorState) { var newContent = DraftModifier.removeRange(editorState.getCurrentContent(), editorState.getSelection(), 'forward'); + return EditorState.push(editorState, newContent, 'remove-range'); } @@ -10586,7 +10602,7 @@ return /******/ (function(modules) { // webpackBootstrap var SecondaryClipboard = __webpack_require__(82); var UserAgent = __webpack_require__(8); - var isEventHandled = __webpack_require__(18); + var isEventHandled = __webpack_require__(13); var keyCommandBackspaceToStartOfLine = __webpack_require__(113); var keyCommandBackspaceWord = __webpack_require__(114); var keyCommandDeleteWord = __webpack_require__(115); @@ -10738,7 +10754,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var BlockMapBuilder = __webpack_require__(16); + var BlockMapBuilder = __webpack_require__(17); var CharacterMetadata = __webpack_require__(4); var DataTransfer = __webpack_require__(59); var DraftModifier = __webpack_require__(5); @@ -10748,15 +10764,15 @@ return /******/ (function(modules) { // webpackBootstrap var getEntityKeyForSelection = __webpack_require__(30); var getTextContentFromFiles = __webpack_require__(53); - var isEventHandled = __webpack_require__(18); + var isEventHandled = __webpack_require__(13); var splitTextIntoTextBlocks = __webpack_require__(131); /** * Paste content. */ - function editOnPaste(editor, e) { - e.preventDefault(); - var data = new DataTransfer(e.clipboardData); + function editOnPaste(editor, event) { + event.preventDefault(); + var data = new DataTransfer(event.clipboardData); // Get files, unless this is likely to be a string the user wants inline. if (!data.isRichText()) { @@ -10800,7 +10816,9 @@ return /******/ (function(modules) { // webpackBootstrap var html = data.getHTML(); var editorState = editor._latestEditorState; - if (editor.props.handlePastedText && isEventHandled(editor.props.handlePastedText(text, html, editorState))) { + var shouldPreventDefault = editor.props.handlePastedText && isEventHandled(editor.props.handlePastedText(text, html, editorState)); + + if (shouldPreventDefault) { return; } @@ -10983,7 +11001,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; var DraftStringKey = __webpack_require__(44); - var UnicodeUtils = __webpack_require__(13); + var UnicodeUtils = __webpack_require__(14); var strlen = UnicodeUtils.strlen; @@ -11029,9 +11047,9 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var UnicodeUtils = __webpack_require__(13); + var UnicodeUtils = __webpack_require__(14); - var findRangesImmutable = __webpack_require__(17); + var findRangesImmutable = __webpack_require__(18); var areEqual = function areEqual(a, b) { return a === b; @@ -11103,7 +11121,7 @@ return /******/ (function(modules) { // webpackBootstrap * */ - var UnicodeUtils = __webpack_require__(13); + var UnicodeUtils = __webpack_require__(14); var getRangeClientRects = __webpack_require__(50); var invariant = __webpack_require__(2); @@ -11634,7 +11652,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var BlockMapBuilder = __webpack_require__(16); + var BlockMapBuilder = __webpack_require__(17); var generateRandomKey = __webpack_require__(6); var insertIntoList = __webpack_require__(55); @@ -12105,7 +12123,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; var EditorState = __webpack_require__(3); - var UnicodeUtils = __webpack_require__(13); + var UnicodeUtils = __webpack_require__(14); var moveSelectionBackward = __webpack_require__(31); var removeTextWithStrategy = __webpack_require__(19); @@ -12155,7 +12173,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; var EditorState = __webpack_require__(3); - var UnicodeUtils = __webpack_require__(13); + var UnicodeUtils = __webpack_require__(14); var moveSelectionForward = __webpack_require__(57); var removeTextWithStrategy = __webpack_require__(19); @@ -12386,7 +12404,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var ContentBlockNode = __webpack_require__(14); + var ContentBlockNode = __webpack_require__(15); var Immutable = __webpack_require__(1); var invariant = __webpack_require__(2); @@ -12599,7 +12617,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var ContentBlockNode = __webpack_require__(14); + var ContentBlockNode = __webpack_require__(15); var Immutable = __webpack_require__(1); var generateRandomKey = __webpack_require__(6); diff --git a/dist/Draft.min.js b/dist/Draft.min.js index 0314776e2a..3c00cc7440 100644 --- a/dist/Draft.min.js +++ b/dist/Draft.min.js @@ -8,13 +8,13 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("immutable"),require("react"),require("react-dom"),require("fast-deep-equal")):"function"==typeof define&&define.amd?define(["immutable","react","react-dom","fast-deep-equal"],t):"object"==typeof exports?exports.Draft=t(require("immutable"),require("react"),require("react-dom"),require("fast-deep-equal")):e.Draft=t(e.Immutable,e.React,e.ReactDOM,e.fastDeepEqual)}(this,function(e,t,n,r){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var r=n(63),o=n(16),i=n(4),a=n(64),s=n(10),c=n(22),u=n(23),l=n(40),f=n(66),p=n(41),g=n(24),d=n(5),h=n(42),y=n(3),m=n(27),v=n(45),b=n(81),k=n(15),S=n(86),w=n(46),C=n(87),x=n(29),E=n(6),O=n(47),T=n(110),K={Editor:f,EditorBlock:p,EditorState:y,CompositeDecorator:a,Entity:g,EntityInstance:h,BlockMapBuilder:o,CharacterMetadata:i,ContentBlock:s,ContentState:c,SelectionState:k,AtomicBlockUtils:r,KeyBindingUtil:m,Modifier:d,NestedUtils:b,RichUtils:v,DefaultDraftBlockRenderMap:u,DefaultDraftInlineStyle:l,convertFromHTML:w,convertFromRaw:C,convertToRaw:S,genNestedKey:x,genKey:E,getDefaultKeyBinding:O,getVisibleSelectionRect:T};e.exports=K},function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e,t,n,r,i,a,s,c){var u,l,f;if(o(t),!e)throw void 0===t?u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."):(l=[n,r,i,a,s,c],f=0,u=new Error(t.replace(/%s/g,function(){return l[f++]})),u.name="Invariant Violation"),u.framesToPop=1,u}var o=function(e){};e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t,n){var r=e.getSelection();return r.getAnchorKey()===t.getAnchorKey()&&r.getAnchorOffset()===t.getAnchorOffset()&&r.getFocusKey()===t.getFocusKey()&&r.getFocusOffset()===t.getFocusOffset()&&r.getIsBackward()===t.getIsBackward()?x.set(e,{selection:t,forceSelection:n}):x.set(e,{selection:t,forceSelection:n,nativelyRenderedContent:null,inlineStyleOverride:null})}function i(e,t){return e.getBlockMap().map(function(n){return d.generate(e,n,t)}).toOrderedMap()}function a(e,t,n,r){var o=e.getCurrentContent().set("entityMap",n),i=o.getBlockMap(),a=e.getImmutable().get("treeMap");return a.merge(t.toSeq().filter(function(e,t){return e!==i.get(t)}).map(function(e){return d.generate(o,e,r)}))}function s(e,t,n,r,o){return n.merge(t.toSeq().filter(function(t){return r.getDecorations(t,e)!==o.getDecorations(t,e)}).map(function(t){return d.generate(e,t,r)}))}function c(e,t){var n=e.getLastChangeType();return t!==n||"insert-characters"!==t&&"backspace-character"!==t&&"delete-character"!==t}function u(e,t){var n=t.getStartKey(),r=t.getStartOffset(),o=e.getBlockForKey(n);return r>0?o.getInlineStyleAt(r-1):o.getLength()?o.getInlineStyleAt(0):f(e,n)}function l(e,t){var n=t.getStartKey(),r=t.getStartOffset(),o=e.getBlockForKey(n);return r0?o.getInlineStyleAt(r-1):f(e,n)}function f(e,t){var n=e.getBlockMap().reverse().skipUntil(function(e,n){return n===t}).skip(1).skipUntil(function(e,t){return e.getLength()}).first();return n?n.getInlineStyleAt(n.getLength()-1):b()}var p=n(9),g=p||function(e){var t,n,r;for(t=1;t0?o.getInlineStyleAt(r-1):o.getLength()?o.getInlineStyleAt(0):f(e,n)}function l(e,t){var n=t.getStartKey(),r=t.getStartOffset(),o=e.getBlockForKey(n);return r0?o.getInlineStyleAt(r-1):f(e,n)}function f(e,t){var n=e.getBlockMap().reverse().skipUntil(function(e,n){return n===t}).skip(1).skipUntil(function(e,t){return e.getLength()}).first();return n?n.getInlineStyleAt(n.getLength()-1):b()}var p=n(9),g=p||function(e){var t,n,r;for(t=1;tr||n<=0)return"";if(o=0,t>0){for(;t>0&&o=r)return""}else if(t<0){for(o=r;t<0&&00&&s0&&void 0!==arguments[0]?arguments[0]:h;return r(this,t),o(this,e.call(this,v(n)))}return i(t,e),t.prototype.getKey=function(){return this.get("key")},t.prototype.getType=function(){return this.get("type")},t.prototype.getText=function(){return this.get("text")},t.prototype.getCharacterList=function(){return this.get("characterList")},t.prototype.getLength=function(){return this.getText().length},t.prototype.getDepth=function(){return this.get("depth")},t.prototype.getData=function(){return this.get("data")},t.prototype.getInlineStyleAt=function(e){var t=this.getCharacterList().get(e);return t?t.getStyle():d},t.prototype.getEntityAt=function(e){var t=this.getCharacterList().get(e);return t?t.getEntity():null},t.prototype.getChildKeys=function(){return this.get("children")},t.prototype.getParentKey=function(){return this.get("parent")},t.prototype.getPrevSiblingKey=function(){return this.get("prevSibling")},t.prototype.getNextSiblingKey=function(){return this.get("nextSibling")},t.prototype.findStyleRanges=function(e,t){c(this.getCharacterList(),y,e,t)},t.prototype.findEntityRanges=function(e,t){c(this.getCharacterList(),m,e,t)},t}(p(h));e.exports=b},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(1),s=a.Record,c={anchorKey:"",anchorOffset:0,focusKey:"",focusOffset:0,isBackward:!1,hasFocus:!1},u=s(c),l=function(e){function t(){return r(this,t),o(this,e.apply(this,arguments))}return i(t,e),t.prototype.serialize=function(){return"Anchor: "+this.getAnchorKey()+":"+this.getAnchorOffset()+", Focus: "+this.getFocusKey()+":"+this.getFocusOffset()+", Is Backward: "+String(this.getIsBackward())+", Has Focus: "+String(this.getHasFocus())},t.prototype.getAnchorKey=function(){return this.get("anchorKey")},t.prototype.getAnchorOffset=function(){return this.get("anchorOffset")},t.prototype.getFocusKey=function(){return this.get("focusKey")},t.prototype.getFocusOffset=function(){return this.get("focusOffset")},t.prototype.getIsBackward=function(){return this.get("isBackward")},t.prototype.getHasFocus=function(){return this.get("hasFocus")},t.prototype.hasEdgeWithin=function(e,t,n){var r,o,i,a=this.getAnchorKey(),s=this.getFocusKey();return a===s&&a===e?(r=this.getStartOffset(),o=this.getEndOffset(),t<=o&&r<=n):(e===a||e===s)&&(i=e===a?this.getAnchorOffset():this.getFocusOffset(),t<=i&&n>=i)},t.prototype.isCollapsed=function(){return this.getAnchorKey()===this.getFocusKey()&&this.getAnchorOffset()===this.getFocusOffset()},t.prototype.getStartKey=function(){return this.getIsBackward()?this.getFocusKey():this.getAnchorKey()},t.prototype.getStartOffset=function(){return this.getIsBackward()?this.getFocusOffset():this.getAnchorOffset()},t.prototype.getEndKey=function(){return this.getIsBackward()?this.getAnchorKey():this.getFocusKey()},t.prototype.getEndOffset=function(){return this.getIsBackward()?this.getAnchorOffset():this.getFocusOffset()},t.createEmpty=function(e){return new t({anchorKey:e,anchorOffset:0,focusKey:e,focusOffset:0,isBackward:!1,hasFocus:!1})},t}(u);e.exports=l},function(e,t,n){"use strict";var r=n(1),o=r.OrderedMap,i={createFromArray:function(e){return o(e.map(function(e){return[e.getKey(),e]}))}};e.exports=i},function(e,t){"use strict";function n(e,t,n,r){if(e.size){var o=0;e.reduce(function(e,i,a){return t(e,i)||(n(e)&&r(o,a),o=a),i}),n(e.last())&&r(o,e.count())}}e.exports=n},function(e,t){"use strict";function n(e){return"handled"===e||e===!0}e.exports=n},function(e,t,n){"use strict";function r(e,t,n){var r=e.getSelection(),i=e.getCurrentContent(),a=r;if(r.isCollapsed()){if("forward"===n){if(e.isSelectionAtEndOfContent())return i}else if(e.isSelectionAtStartOfContent())return i;if(a=t(e),a===r)return i}return o.removeRange(i,a,n)}var o=n(5);e.exports=r},function(e,t){"use strict";function n(e){return"object"==typeof e?Object.keys(e).filter(function(t){return e[t]}).map(r).join(" "):Array.prototype.map.call(arguments,r).join(" ")}function r(e){return e.replace(/\//g,"-")}e.exports=n},function(e,t){e.exports=n},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(16),s=n(4),c=n(10),u=n(14),l=n(24),f=n(12),p=n(1),g=n(15),d=n(6),h=n(32),y=p.List,m=p.Record,v=p.Repeat,b=f.draft_tree_data_support,k={entityMap:null,blockMap:null,selectionBefore:null,selectionAfter:null},S=b?u:c,w=m(k),C=function(e){function t(){return r(this,t),o(this,e.apply(this,arguments))}return i(t,e),t.prototype.getEntityMap=function(){return l},t.prototype.getBlockMap=function(){return this.get("blockMap")},t.prototype.getSelectionBefore=function(){return this.get("selectionBefore")},t.prototype.getSelectionAfter=function(){return this.get("selectionAfter")},t.prototype.getBlockForKey=function(e){var t=this.getBlockMap().get(e);return t},t.prototype.getKeyBefore=function(e){return this.getBlockMap().reverse().keySeq().skipUntil(function(t){return t===e}).skip(1).first()},t.prototype.getKeyAfter=function(e){return this.getBlockMap().keySeq().skipUntil(function(t){return t===e}).skip(1).first()},t.prototype.getBlockAfter=function(e){return this.getBlockMap().skipUntil(function(t,n){return n===e}).skip(1).first()},t.prototype.getBlockBefore=function(e){return this.getBlockMap().reverse().skipUntil(function(t,n){return n===e}).skip(1).first()},t.prototype.getBlocksAsArray=function(){return this.getBlockMap().toArray()},t.prototype.getFirstBlock=function(){return this.getBlockMap().first()},t.prototype.getLastBlock=function(){return this.getBlockMap().last()},t.prototype.getPlainText=function(e){return this.getBlockMap().map(function(e){return e?e.getText():""}).join(e||"\n")},t.prototype.getLastCreatedEntityKey=function(){return l.__getLastCreatedEntityKey()},t.prototype.hasText=function(){var e=this.getBlockMap();return e.size>1||e.first().getLength()>0},t.prototype.createEntity=function(e,t,n){return l.__create(e,t,n),this},t.prototype.mergeEntityData=function(e,t){return l.__mergeData(e,t),this},t.prototype.replaceEntityData=function(e,t){return l.__replaceData(e,t),this},t.prototype.addEntity=function(e){return l.__add(e),this},t.prototype.getEntity=function(e){return l.__get(e)},t.prototype.getFirstLevelBlocks=function(){return this.getBlockChildren("")},t.prototype.getBlockDescendants=function(){return this.getBlockMap().reverse().reduce(function(e,t){var n,r,o,i,a,s,c=t.getKey(),u=t.getParentKey().length>0?t.getParentKey():"__ROOT__",l=e.get(c)?e:e.set(c,new p.Map({firstLevelBlocks:new p.OrderedMap,childrenBlocks:new p.Set}));return u?(n=l.get(u)?l:l.set(u,new p.Map({firstLevelBlocks:new p.OrderedMap,childrenBlocks:new p.Set})),r=n.setIn([u,"firstLevelBlocks",c],t),o=r.setIn([u,"childrenBlocks"],r.getIn([u,"childrenBlocks"]).add(r.getIn([c,"childrenBlocks"]).add(t)))):(i=l.get(u)?l:l.set(u,new p.Map({firstLevelBlocks:new p.OrderedMap,childrenBlocks:new p.Set})),a=i.setIn([u,"firstLevelBlocks",c],t),s=a.setIn([u,"childrenBlocks"],a.getIn([u,"childrenBlocks"]).add(a.getIn([c,"childrenBlocks"]).add(t))))},new p.Map).map(function(e){return e.set("firstLevelBlocks",e.get("firstLevelBlocks").reverse())})},t.prototype.getBlockChildren=function(e){return this.getBlockMap().filter(function(t){return t.getParentKey()===e})},t.createFromBlockArray=function(e,n){var r=Array.isArray(e)?e:e.contentBlocks,o=a.createFromArray(r),i=o.isEmpty()?new g:g.createEmpty(o.first().getKey());return new t({blockMap:o,entityMap:n||l,selectionBefore:i,selectionAfter:i})},t.createFromText=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/\r\n?|\n/g,r=e.split(n),o=r.map(function(e){return e=h(e),new S({key:d(),text:e,type:"unstyled",characterList:y(v(s.EMPTY,e.length))})});return t.createFromBlockArray(o)},t}(w);e.exports=C},function(e,t,n){"use strict";var r=n(1),o=r.Map,i=n(11),a=n(20),s=i.createElement("ul",{className:a("public/DraftStyleDefault/ul")}),c=i.createElement("ol",{className:a("public/DraftStyleDefault/ol")}),u=i.createElement("pre",{className:a("public/DraftStyleDefault/pre")}),l=o({"header-one":{element:"h1"},"header-two":{element:"h2"},"header-three":{element:"h3"},"header-four":{element:"h4"},"header-five":{element:"h5"},"header-six":{element:"h6"},"unordered-list-item":{element:"li",wrapper:s},"ordered-list-item":{element:"li",wrapper:c},blockquote:{element:"blockquote"},atomic:{element:"figure"},"code-block":{element:"pre",wrapper:u},unstyled:{element:"div",aliasedElements:["p"]}});e.exports=l},function(e,t,n){"use strict";function r(e,t){console.warn("WARNING: "+e+' will be deprecated soon!\nPlease use "'+t+'" instead.')}var o=n(9),i=o||function(e){var t,n,r;for(t=1;t0?(n=e.getBlockForKey(o).getEntityAt(i-1),n!==e.getBlockForKey(o).getEntityAt(i)?null:r(e.getEntityMap(),n)):null):(a=t.getStartKey(),s=t.getStartOffset(),c=e.getBlockForKey(a),n=s===c.getLength()?null:c.getEntityAt(s),r(e.getEntityMap(),n))}function r(e,t){if(t){var n=e.__get(t);return"MUTABLE"===n.getMutability()?t:null}return null}e.exports=n},function(e,t){"use strict";function n(e,t){var n,r,o=e.getSelection(),i=e.getCurrentContent(),a=o.getStartKey(),s=o.getStartOffset(),c=a,u=0;return t>s?(n=i.getKeyBefore(a),null==n?c=a:(c=n,r=i.getBlockForKey(n),u=r.getText().length)):u=s-t,o.merge({focusKey:c,focusOffset:u,isBackward:!0})}e.exports=n},function(e,t){"use strict";function n(e){return e.replace(r,"")}var r=new RegExp("\r","g");e.exports=n},function(e,t){"use strict";e.exports={BACKSPACE:8,TAB:9,RETURN:13,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,COMMA:188,PERIOD:190,A:65,Z:90,ZERO:48,NUMPAD_0:96,NUMPAD_9:105}},function(e,t,n){"use strict";function r(e,t){var n=i.get(e,t);return"auto"===n||"scroll"===n}var o=n(142),i={get:o,getScrollParent:function(e){if(!e)return null;for(var t=e.ownerDocument;e&&e!==t.body;){if(r(e,"overflow")||r(e,"overflowY")||r(e,"overflowX"))return e;e=e.parentNode}return t.defaultView||t.parentWindow}};e.exports=i},function(e,t,n){"use strict";function r(e){return e===f||e===p}function o(e){return r(e)?void 0:u(!1),e===f?"ltr":"rtl"}function i(e,t){return r(e)?void 0:u(!1),r(t)?void 0:u(!1),e===t?null:o(e)}function a(e){g=e}function s(){a(f)}function c(){return g||this.initGlobalDir(),g?void 0:u(!1),g}var u=n(2),l="NEUTRAL",f="LTR",p="RTL",g=null,d={NEUTRAL:l,LTR:f,RTL:p,isStrong:r,getHTMLDir:o,getHTMLDirIfDifferent:i,setGlobalDir:a,initGlobalDir:s,getGlobalDir:c};e.exports=d},function(e,t,n){"use strict";function r(e,t){return!(!e||!t)&&(e===t||!o(e)&&(o(t)?r(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}var o=n(147);e.exports=r},function(e,t){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";function r(e){var t,n,r,a,s=o(e.ownerDocument||e.document);return e.Window&&e instanceof e.Window&&(e=s),t=i(e),n=e===s?e.ownerDocument.documentElement:e,r=e.scrollWidth-n.clientWidth,a=e.scrollHeight-n.clientHeight,t.x=Math.max(0,Math.min(t.x,r)),t.y=Math.max(0,Math.min(t.y,a)),t}var o=n(139),i=n(143);e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=[],r=e.map(function(e){return e.getStyle()}).toList();return s(r,o,f,function(e,r){n.push(new d({start:e+t,end:r+t}))}),c(n)}function o(e,t){return e===t}var i=n(1),a=n(37),s=n(17),c=i.List,u=i.Repeat,l=i.Record,f=a.thatReturnsTrue,p="-",g={start:null,end:null},d=l(g),h={start:null,end:null,decoratorKey:null,leaves:null},y=l(h),m={generate:function(e,t,n){var i,a,l,p=t.getLength();return p?(i=[],a=n?n.getDecorations(t,e):c(u(null,p)),l=t.getCharacterList(),s(a,o,f,function(e,t){i.push(new y({start:e,end:t,decoratorKey:a.get(e),leaves:r(l.slice(e,t).toList(),e)}))}),c(i)):c.of(new y({start:0,end:0,decoratorKey:null,leaves:c.of(new d({start:0,end:0}))}))},getFingerprint:function(e){return e.map(function(e){var t=e.get("decoratorKey"),n=null!==t?t+"."+(e.get("end")-e.get("start")):"";return""+n+"."+e.get("leaves").size}).join(p)}};e.exports=m},function(e,t){"use strict";e.exports={BOLD:{fontWeight:"bold"},CODE:{fontFamily:"monospace",wordWrap:"break-word"},ITALIC:{fontStyle:"italic"},STRIKETHROUGH:{textDecoration:"line-through"},UNDERLINE:{textDecoration:"underline"}}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(9),s=a||function(e){var t,n,r;for(t=1;t0&&window.scrollTo(n.x,n.y+r+w)):(e instanceof HTMLElement?void 0:k(!1),s=e.offsetHeight+e.offsetTop,c=t.offsetHeight+n.y,r=s-c,r>0&&p.setTop(t,p.getTop(t)+r+w)))},t.prototype._renderBlockMap=function(e){var t=this.props.DraftEditorBlocks;return l.createElement(t,s({},this.props,{blockMap:e}))},t.prototype._renderChildren=function(){var e=this,t=this.props.block,n=t.getKey(),r=t.getText(),o=this.props.tree.size-1,i=C(this.props.selection,n);return this.props.tree.map(function(a,f){var p,g,y,m,v,b,k=a.get("leaves"),w=k.size-1,C=k.map(function(a,s){var p=u.encode(n,f,s),g=a.get("start"),d=a.get("end");return l.createElement(c,{key:p,offsetKey:p,block:t,start:g,selection:i?e.props.selection:null,forceSelection:e.props.forceSelection,text:r.slice(g,d),styleSet:t.getInlineStyleAt(g),customStyleMap:e.props.customStyleMap,customStyleFn:e.props.customStyleFn,isLast:f===o&&s===w})}).toArray(),x=a.get("decoratorKey");return null==x?C:e.props.decorator?(p=S(e.props.decorator),(g=p.getComponentForKey(x))?(y=p.getPropsForKey(x),m=u.encode(n,f,0),v=r.slice(k.first().get("start"),k.last().get("end")),b=h.getHTMLDirIfDifferent(d.getDirection(v),e.props.direction),l.createElement(g,s({},y,{contentState:e.props.contentState,decoratedText:v,dir:b,key:m,entityKey:t.getEntityAt(a.get("start")),offsetKey:m}),C)):C):C}).toArray()},t.prototype.render=function(){var e=this.props,t=e.direction,n=e.offsetKey,r=e.blockMap,o=y({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":"LTR"===t,"public/DraftStyleDefault/rtl":"RTL"===t});return r&&r.size&&r.size>0?this._renderBlockMap(r):l.createElement("div",{"data-offset-key":n,className:o},this._renderChildren())},t}(l.Component);e.exports=x},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(1),s=a.Record,c=s({type:"TOKEN",mutability:"IMMUTABLE",data:Object}),u=function(e){function t(){return r(this,t),o(this,e.apply(this,arguments))}return i(t,e),t.prototype.getType=function(){return this.get("type")},t.prototype.getMutability=function(){return this.get("mutability")},t.prototype.getData=function(){return this.get("data")},t}(c);e.exports=u},function(e,t,n){"use strict";function r(e,t){var n=t?f.exec(e):u.exec(e);return n?n[0]:e}var o=n(133),i=o.getPunctuation(),a="['‘’]",s="\\s|(?![_])"+i,c="^(?:"+s+")*(?:"+a+"|(?!"+s+").)*(?:(?!"+s+").)",u=new RegExp(c),l="(?:(?!"+s+").)(?:"+a+"|(?!"+s+").)*(?:"+s+")*$",f=new RegExp(l),p={getBackward:function(e){return r(e,!0)},getForward:function(e){return r(e,!1)}};e.exports=p},function(e,t){"use strict";var n={stringify:function(e){return"_"+String(e)},unstringify:function(e){return e.slice(1)}};e.exports=n},function(e,t,n){"use strict";var r=n(5),o=n(3),i=(n(15),n(83)),a=n(7),s={currentBlockContainsLink:function(e){var t=e.getSelection(),n=e.getCurrentContent(),r=n.getEntityMap();return n.getBlockForKey(t.getAnchorKey()).getCharacterList().slice(t.getStartOffset(),t.getEndOffset()).some(function(e){var t=e.getEntity();return!!t&&"LINK"===r.__get(t).getType()})},getCurrentBlockType:function(e){var t=e.getSelection();return e.getCurrentContent().getBlockForKey(t.getStartKey()).getType()},getDataObjectForLinkURL:function(e){return{url:e.toString()}},handleKeyCommand:function(e,t){switch(t){case"bold":return s.toggleInlineStyle(e,"BOLD");case"italic":return s.toggleInlineStyle(e,"ITALIC");case"underline":return s.toggleInlineStyle(e,"UNDERLINE");case"code":return s.toggleCode(e);case"backspace":case"backspace-word":case"backspace-to-start-of-line":return s.onBackspace(e);case"delete":case"delete-word":case"delete-to-end-of-block":return s.onDelete(e);default:return null}},insertSoftNewline:function(e){var t=r.insertText(e.getCurrentContent(),e.getSelection(),"\n",e.getCurrentInlineStyle(),null),n=o.push(e,t,"insert-characters");return o.forceSelection(n,t.getSelectionAfter())},onBackspace:function(e){var t,n,r,i,a,c,u=e.getSelection();return!u.isCollapsed()||u.getAnchorOffset()||u.getFocusOffset()?null:(t=e.getCurrentContent(),n=u.getStartKey(),r=t.getBlockBefore(n),r&&"atomic"===r.getType()&&(i=t.getBlockMap().delete(r.getKey()),a=t.merge({blockMap:i,selectionAfter:u}),a!==t)?o.push(e,a,"remove-range"):(c=s.tryToRemoveBlockStyle(e),c?o.push(e,c,"change-block-type"):null))},onDelete:function(e){var t,n,i,a,s,c,u,l=e.getSelection();return l.isCollapsed()?(t=e.getCurrentContent(),n=l.getStartKey(),i=t.getBlockForKey(n),a=i.getLength(),l.getStartOffset()0&&o!==i)return null;if(a=o.getType(),s=n.getBlockBefore(t),"code-block"===a&&s&&"code-block"===s.getType()&&0!==s.getLength())return null;if("unstyled"!==a)return r.setBlockType(n,c,"unstyled")}return null}};e.exports=s},function(e,t,n){"use strict";var r=n(9),o=r||function(e){var t,n,r;for(t=1;t=0?e.add("BOLD"):O.indexOf(t)>=0&&e.remove("BOLD"),"italic"===n?e.add("ITALIC"):"normal"===n&&e.remove("ITALIC"),"underline"===o&&e.add("UNDERLINE"),"line-through"===o&&e.add("STRIKETHROUGH"),"none"===o&&(e.remove("UNDERLINE"),e.remove("STRIKETHROUGH"))}).toOrderedSet()),n},D=function(e,t,n,r,o){var i=e.text.slice(-1),a=t.text.slice(0,1);return"\r"===i&&"\r"===a&&"paragraph"===e.blocks[e.blocks.length-1].type&&"paragraph"!==t.blocks[0].type&&(e.text=e.text.split("\r")[0]), -"\r"===i&&"\r"===a&&"paragraph"===e.blocks[e.blocks.length-1].type&&"paragraph"===t.blocks[0].type&&(e.text=e.text.split("\r")[0]),{text:r&&!o?e.text.split("\r").concat(t.text.split("\r")).join("\r"):e.text+t.text,inlines:e.inlines.concat(t.inlines),entities:e.entities.concat(t.entities),blocks:o?t.blocks:e.blocks.concat(t.blocks)}},L=function(e,t){return t.some(function(t){return e.indexOf("<"+t)!==-1})},R=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o({},B,e)},F=function(e,t,n){return{text:"\r",inlines:[m()],entities:new Array(1),blocks:[R({parentKey:n||"",key:g(),type:e,depth:Math.max(0,Math.min(k,t))})]}},N=function e(t,n,r,i,a,s,c,u,l,f){var p,d,h,y,m,v,b,k,S,w=n.nodeName.toLowerCase(),C=t,x=o({},K),E=null,O=!1;if("#text"===w)return p=n.textContent,{chunk:{text:p,inlines:Array(p.length).fill(r),entities:Array(p.length).fill(l),blocks:[{depth:c,key:g(),parentKey:f||"",type:"paragraph"}]},entityMap:t};if("br"===w)return{chunk:{text:"",inlines:[],entities:[],blocks:[{depth:c,key:g(),parentKey:f||"",type:"paragraph"}]},entityMap:t};for(r=A(w,n,r),d=M(w),"ul"!==w&&"ol"!==w||(E=F(d,c,f),x=D(x,E),f=x.blocks[0].key),"li"===w&&(E=F(d,c,f),x=D(x,E),f=x.blocks[0].key),"table"===w&&(E=F(d,c,f),x=D(x,E),f=x.blocks[0].key),"tbody"===w&&(E=F(d,c,f),x=D(x,E),f=x.blocks[0].key),"tr"===w&&(E=F(d,c,f),x=D(x,E),f=x.blocks[0].key),"td"===w&&(E=F(d,c,f),x=D(x,E),f=x.blocks[0].key),h=n.firstChild,h&&"span"===h.nodeName.toLowerCase()&&(O=!0),y=null,m=!1;h;)y=void 0,v=e(C,h,r,i,!0,s,c,u,y||l,f),b=v.chunk,k=v.entityMap,E=b,C=k,x=D(x,E,a,m,O),S=h.nextSibling,S&&(m=!0,w=S.nodeName.toLowerCase()),h=S;return{chunk:x,entityMap:C}},I=function(e,t,n,r){var i,a,s,c,u,l;return e=e.trim().replace(S,"").replace(w,b).replace(C,"").replace(x,""),i=_(n),(a=t(e))?(s=L(e,i)?i:["div"],c=N(r,a,m(),"ul",null,s,-1,n),u=c.chunk,l=c.entityMap,0===u.blocks.length&&u.blocks.push(o({},K,{type:"paragraph",depth:0})),{chunk:u,entityMap:l}):null},P=function(e){var t,n,r,o,s,c,u;return e&&e.text&&Array.isArray(e.blocks)?(t={cacheRef:{},contentBlocks:[]},n=0,r=e.blocks,o=e.inlines,s=e.entities,c=a,u=e.text.split("\r"),u.reduce(function(e,t,a){var u,l,f,p,d,m,v,b,k,S,w,C;return t=h(t),u=r[a],l=n+(t.length?t.length:1),f=o.slice(n,l),p=s.slice(n,l),d=y(f.map(function(e,t){var n={style:e,entity:null};return p[t]&&(n.entity=p[t]),i.create(n)})),n=l,u?(m=u.depth,v=u.type,b=u.parentKey,k=u.key||g(),S=null,w=new c({key:k,parentKey:b,type:v,depth:m,text:t,characterList:d,prevSibling:S||(0===a||r[a-1].parent!==parent?null:r[a-1].key),nextSibling:a===r.length-1||r[a+1].parent!==parent?null:r[a+1].key}),e.contentBlocks.push(w),e.cacheRef[w.key]=a,e):(C=new c({key:g(),parentKey:"",type:"paragraph",depth:0,text:"",characterList:y()}),e.contentBlocks.push(C),e.cacheRef[C.key]=a,e)},t).contentBlocks):null},j=function(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s,a=I(e,o,i,c);return null==a?null:(t=a.chunk,n=a.entityMap,r=P(t),{contentBlocks:r,entityMap:n})};e.exports=j},function(e,t,n){"use strict";function r(e){return f&&e.altKey||h(e)}function o(e){return d(e)?e.shiftKey?"redo":"undo":null}function i(e){return p&&e.shiftKey?null:r(e)?"delete-word":"delete"}function a(e){return d(e)&&f?"backspace-to-start-of-line":r(e)?"backspace-word":"backspace"}function s(e){switch(e.keyCode){case 66:return d(e)?"bold":null;case 68:return h(e)?"delete":null;case 72:return h(e)?"backspace":null;case 73:return d(e)?"italic":null;case 74:return d(e)?"code":null;case 75:return!p&&h(e)?"secondary-cut":null;case 77:return h(e)?"split-block":null;case 79:return h(e)?"split-block":null;case 84:return f&&h(e)?"transpose-characters":null;case 85:return d(e)?"underline":null;case 87:return f&&h(e)?"backspace-word":null;case 89:return h(e)?p?"redo":"secondary-paste":null;case 90:return o(e)||null;case u.RETURN:return"split-block";case u.DELETE:return i(e);case u.BACKSPACE:return a(e);case u.LEFT:return g&&d(e)?"move-selection-to-start-of-block":null;case u.RIGHT:return g&&d(e)?"move-selection-to-end-of-block":null;default:return null}}var c=n(27),u=n(33),l=n(8),f=l.isPlatform("Mac OS X"),p=l.isPlatform("Windows"),g=f&&l.isBrowser("Firefox < 29"),d=c.hasCommandModifier,h=c.isCtrlKeyCommand;e.exports=s},function(e,t,n){"use strict";function r(e,t,n,r,o,i){var s,u,f,g=n.nodeType===Node.TEXT_NODE,d=o.nodeType===Node.TEXT_NODE;return g&&d?{selectionState:l(e,p(c(n)),r,p(c(o)),i),needsRecovery:!1}:(s=null,u=null,f=!0,g?(s={key:p(c(n)),offset:r},u=a(t,o,i)):d?(u={key:p(c(o)),offset:i},s=a(t,n,r)):(s=a(t,n,r),u=a(t,o,i),n===o&&r===i&&(f=!!n.firstChild&&"BR"!==n.firstChild.nodeName)),{selectionState:l(e,s.key,s.offset,u.key,u.offset),needsRecovery:f})}function o(e){for(;e.firstChild&&(e.firstChild instanceof Element&&"true"===e.firstChild.getAttribute("data-blocks")||u(e.firstChild));)e=e.firstChild;return e}function i(e){for(;e.lastChild&&(e.lastChild instanceof Element&&"true"===e.lastChild.getAttribute("data-blocks")||u(e.lastChild));)e=e.lastChild;return e}function a(e,t,n){var r,a,l,g,d,h,y=t,m=c(y);return null!=m||e&&(e===y||e.firstChild===y)?void 0:f(!1),e===y&&(y=y.firstChild,y instanceof Element&&"true"===y.getAttribute("data-contents")?void 0:f(!1),n>0&&(n=y.childNodes.length)),0===n?(r=null,null!=m?r=m:(a=o(y),r=p(u(a))),{key:r,offset:0}):(l=y.childNodes[n-1],g=null,d=null,u(l)?(h=i(l),g=p(u(h)),d=s(h)):(g=p(m),d=s(l)),{key:g,offset:d})}function s(e){var t=e.textContent;return"\n"===t?0:t.length}var c=n(28),u=n(52),l=n(54),f=n(2),p=n(7);e.exports=r},function(e,t,n){"use strict";function r(e){var t=e.getSelection();return t.isCollapsed()?null:o(e.getCurrentContent(),t)}var o=n(26);e.exports=r},function(e,t,n){"use strict";function r(e){var t,n,r,o,a=e.cloneRange(),s=[];for(t=e.endContainer;null!=t;t=t.parentNode){if(n=t===e.commonAncestorContainer,n?a.setStart(e.startContainer,e.startOffset):a.setStart(a.endContainer,0),r=Array.from(a.getClientRects()),s.push(r),n)return s.reverse(),(o=[]).concat.apply(o,s);a.setEndBefore(t)}i(!1)}var o=n(8),i=n(2),a=o.isBrowser("Chrome"),s=a?r:function(e){return Array.from(e.getClientRects())};e.exports=s},function(e,t,n){"use strict";function r(e){var t,n=null;return!a&&document.implementation&&document.implementation.createHTMLDocument&&(t=document.implementation.createHTMLDocument("foo"),t.documentElement?void 0:i(!1),t.documentElement.innerHTML=e,n=t.getElementsByTagName("body")[0]),n}var o=n(8),i=n(2),a=o.isBrowser("IE <= 9");e.exports=r},function(e,t){"use strict";function n(e){var t,r,o;if(e instanceof Element){if(t=e.getAttribute("data-offset-key"))return t;for(r=0;rc.getText().length-i?(s=a.getKeyAfter(o),n=0):n=i+t,r.merge({focusKey:s,focusOffset:n})}e.exports=n},function(e,t,n){"use strict";function r(e,t){var n,r,o,a,s=e.getBlockMap(),c=e.getEntityMap(),u={},l=t.getStartKey(),f=t.getStartOffset(),p=s.get(l),g=i(c,p,f);return g!==p&&(u[l]=g),n=t.getEndKey(),r=t.getEndOffset(),o=s.get(n),l===n&&(o=g),a=i(c,o,r),a!==o&&(u[n]=a),Object.keys(u).length?e.merge({blockMap:s.merge(u),selectionAfter:t}):e.set("selectionAfter",t)}function o(e,t,n){var r;return s(e,function(e,t){return e.getEntity()===t.getEntity()},function(e){return e.getEntity()===t},function(e,t){e<=n&&t>=n&&(r={start:e,end:t})}),"object"!=typeof r?c(!1):void 0,r}function i(e,t,n){var r,i,s,c,u,l=t.getCharacterList(),f=n>0?l.get(n-1):void 0,p=n0},e}();e.exports=f},function(e,t){"use strict";function n(e,t){return!!t&&(e===t.documentElement||e===t.body)}var r={getTop:function(e){var t=e.ownerDocument;return n(e,t)?t.body.scrollTop||t.documentElement.scrollTop:e.scrollTop},setTop:function(e,t){var r=e.ownerDocument;n(e,r)?r.body.scrollTop=r.documentElement.scrollTop=t:e.scrollTop=t},getLeft:function(e){var t=e.ownerDocument;return n(e,t)?t.body.scrollLeft||t.documentElement.scrollLeft:e.scrollLeft},setLeft:function(e,t){var r=e.ownerDocument;n(e,r)?r.body.scrollLeft=r.documentElement.scrollLeft=t:e.scrollLeft=t}};e.exports=r},function(e,t,n){"use strict";function r(e){var t=p.exec(e);return null==t?null:t[0]}function o(e){var t=r(e);return null==t?u.NEUTRAL:g.exec(t)?u.RTL:u.LTR}function i(e,t){if(t=t||u.NEUTRAL,!e.length)return t;var n=o(e);return n===u.NEUTRAL?t:n}function a(e,t){return t||(t=u.getGlobalDir()),u.isStrong(t)?void 0:l(!1),i(e,t)}function s(e,t){return a(e,t)===u.LTR}function c(e,t){return a(e,t)===u.RTL}var u=n(35),l=n(2),f={L:"A-Za-zªµºÀ-ÖØ-öø-ƺƻƼ-ƿǀ-ǃDŽ-ʓʔʕ-ʯʰ-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͷͺͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҂Ҋ-ԯԱ-Ֆՙ՚-՟ա-և։ःऄ-हऻऽा-ीॉ-ौॎ-ॏॐक़-ॡ।-॥०-९॰ॱॲ-ঀং-ঃঅ-ঌএ-ঐও-নপ-রলশ-হঽা-ীে-ৈো-ৌৎৗড়-ঢ়য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽા-ીૉો-ૌૐૠ-ૡ૦-૯૰ଂ-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽାୀେ-ୈୋ-ୌୗଡ଼-ଢ଼ୟ-ୡ୦-୯୰ୱ୲-୷ஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹா-ிு-ூெ-ைொ-ௌௐௗ௦-௯௰-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౙౠ-ౡ౦-౯౿ಂ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽಾಿೀ-ೄೆೇ-ೈೊ-ೋೕ-ೖೞೠ-ೡ೦-೯ೱ-ೲം-ഃഅ-ഌഎ-ഐഒ-ഺഽാ-ീെ-ൈൊ-ൌൎൗൠ-ൡ൦-൯൰-൵൹ൺ-ൿං-ඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-ෳ෴ก-ะา-ำเ-ๅๆ๏๐-๙๚-๛ກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆ໐-໙ໜ-ໟༀ༁-༃༄-༒༓༔༕-༗༚-༟༠-༩༪-༳༴༶༸༾-༿ཀ-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿏࿐-࿔࿕-࿘࿙-࿚က-ဪါ-ာေးျ-ြဿ၀-၉၊-၏ၐ-ၕၖ-ၗၚ-ၝၡၢ-ၤၥ-ၦၧ-ၭၮ-ၰၵ-ႁႃ-ႄႇ-ႌႎႏ႐-႙ႚ-ႜ႞-႟Ⴀ-ჅჇჍა-ჺ჻ჼჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፨፩-፼ᎀ-ᎏᎠ-Ᏼᐁ-ᙬ᙭-᙮ᙯ-ᙿᚁ-ᚚᚠ-ᛪ᛫-᛭ᛮ-ᛰᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵-᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះ-ៈ។-៖ៗ៘-៚ៜ០-៩᠐-᠙ᠠ-ᡂᡃᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰ-ᤱᤳ-ᤸ᥆-᥏ᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧀᧁ-ᧇᧈ-ᧉ᧐-᧙᧚ᨀ-ᨖᨙ-ᨚ᨞-᨟ᨠ-ᩔᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪦ᪧ᪨-᪭ᬄᬅ-ᬳᬵᬻᬽ-ᭁᭃ-᭄ᭅ-ᭋ᭐-᭙᭚-᭠᭡-᭪᭴-᭼ᮂᮃ-ᮠᮡᮦ-ᮧ᮪ᮮ-ᮯ᮰-᮹ᮺ-ᯥᯧᯪ-ᯬᯮ᯲-᯳᯼-᯿ᰀ-ᰣᰤ-ᰫᰴ-ᰵ᰻-᰿᱀-᱉ᱍ-ᱏ᱐-᱙ᱚ-ᱷᱸ-ᱽ᱾-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳱᳲ-ᳳᳵ-ᳶᴀ-ᴫᴬ-ᵪᵫ-ᵷᵸᵹ-ᶚᶛ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℴℵ-ℸℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↂↃ-ↄↅ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⱻⱼ-ⱽⱾ-ⳤⳫ-ⳮⳲ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々〆〇〡-〩〮-〯〱-〵〸-〺〻〼ぁ-ゖゝ-ゞゟァ-ヺー-ヾヿㄅ-ㄭㄱ-ㆎ㆐-㆑㆒-㆕㆖-㆟ㆠ-ㆺㇰ-ㇿ㈀-㈜㈠-㈩㈪-㉇㉈-㉏㉠-㉻㉿㊀-㊉㊊-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿌ꀀ-ꀔꀕꀖ-ꒌꓐ-ꓷꓸ-ꓽ꓾-꓿ꔀ-ꘋꘌꘐ-ꘟ꘠-꘩ꘪ-ꘫꙀ-ꙭꙮꚀ-ꚛꚜ-ꚝꚠ-ꛥꛦ-ꛯ꛲-꛷Ꜣ-ꝯꝰꝱ-ꞇ꞉-꞊Ꞌ-ꞎꞐ-ꞭꞰ-Ʇꟷꟸ-ꟹꟺꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꠣ-ꠤꠧ꠰-꠵꠶-꠷ꡀ-ꡳꢀ-ꢁꢂ-ꢳꢴ-ꣃ꣎-꣏꣐-꣙ꣲ-ꣷ꣸-꣺ꣻ꤀-꤉ꤊ-ꤥ꤮-꤯ꤰ-ꥆꥒ-꥓꥟ꥠ-ꥼꦃꦄ-ꦲꦴ-ꦵꦺ-ꦻꦽ-꧀꧁-꧍ꧏ꧐-꧙꧞-꧟ꧠ-ꧤꧦꧧ-ꧯ꧰-꧹ꧺ-ꧾꨀ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-꩟ꩠ-ꩯꩰꩱ-ꩶ꩷-꩹ꩺꩻꩽꩾ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ꫜꫝ꫞-꫟ꫠ-ꫪꫫꫮ-ꫯ꫰-꫱ꫲꫳ-ꫴꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚ꭛ꭜ-ꭟꭤ-ꭥꯀ-ꯢꯣ-ꯤꯦ-ꯧꯩ-ꯪ꯫꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-豈-舘並-龎ff-stﬓ-ﬗA-Za-zヲ-ッーア-ン゙-゚ᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",R:"֐־׀׃׆׈-׏א-ת׫-ׯװ-ײ׳-״׵-׿߀-߉ߊ-ߪߴ-ߵߺ߻-߿ࠀ-ࠕࠚࠤࠨ࠮-࠯࠰-࠾࠿ࡀ-ࡘ࡜-࡝࡞࡟-࢟‏יִײַ-ﬨשׁ-זּ﬷טּ-לּ﬽מּ﬿נּ-סּ﭂ףּ-פּ﭅צּ-ﭏ",AL:"؈؋؍؛؜؝؞-؟ؠ-ؿـف-ي٭ٮ-ٯٱ-ۓ۔ەۥ-ۦۮ-ۯۺ-ۼ۽-۾ۿ܀-܍܎܏ܐܒ-ܯ݋-݌ݍ-ޥޱ޲-޿ࢠ-ࢲࢳ-ࣣﭐ-ﮱ﮲-﯁﯂-﯒ﯓ-ﴽ﵀-﵏ﵐ-ﶏ﶐-﶑ﶒ-ﷇ﷈-﷏ﷰ-ﷻ﷼﷾-﷿ﹰ-ﹴ﹵ﹶ-ﻼ﻽-﻾"},p=new RegExp("["+f.L+f.R+f.AL+"]"),g=new RegExp("["+f.R+f.AL+"]"),d={firstStrongChar:r,firstStrongCharDir:o,resolveBlockDir:i,getDirection:a,isDirectionLTR:s,isDirectionRTL:c};e.exports=d},function(e,t){"use strict";function n(e){if(e=e||("undefined"!=typeof document?document:void 0),"undefined"==typeof e)return null;try{return e.activeElement||e.body}catch(t){return e.body}}e.exports=n},function(e,t,n){"use strict";var r=n(16),o=n(4),i=n(10),a=n(5),s=n(3),c=n(1),u=(n(15),n(6)),l=n(124),f=c.List,p=c.Repeat,g={insertAtomicBlock:function(e,t,n){var c=e.getCurrentContent(),l=e.getSelection(),g=a.removeRange(c,l,"backward"),d=g.getSelectionAfter(),h=a.splitBlock(g,d),y=h.getSelectionAfter(),m=a.setBlockType(h,y,"atomic"),v=o.create({entity:t}),b=[new i({key:u(),type:"atomic",text:n,characterList:f(p(v,n.length))}),new i({key:u(),type:"unstyled",text:"",characterList:f()})],k=r.createFromArray(b),S=a.replaceWithFragment(m,y,k),w=S.merge({selectionBefore:l,selectionAfter:S.getSelectionAfter().set("hasFocus",!0)});return s.push(e,w,"insert-fragment")},moveAtomicBlock:function(e,t,n,r){var o,i,c,u,f,p,g,d,h=e.getCurrentContent(),y=e.getSelection(),m=void 0;return"before"===r||"after"===r?(o=h.getBlockForKey("before"===r?n.getStartKey():n.getEndKey()),m=l(h,t,o,r)):(i=a.removeRange(h,n,"backward"),c=i.getSelectionAfter(),u=i.getBlockForKey(c.getFocusKey()),0===c.getStartOffset()?m=l(i,t,u,"before"):c.getEndOffset()===u.getLength()?m=l(i,t,u,"after"):(f=a.splitBlock(i,c),p=f.getSelectionAfter(),g=f.getBlockForKey(p.getFocusKey()),m=l(f,t,g,"before"))),d=m.merge({selectionBefore:y,selectionAfter:m.getSelectionAfter().set("hasFocus",!0)}),s.push(e,d,"move-block")}};e.exports=g},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t,n){for(var r=t;rM,G=g(G,a(L,V,X,P))),J=o||u,F={className:G,"data-block":!0,"data-editor":r.props.editorKey,"data-offset-key":j,key:D},void 0!==b&&(F=c({},F,{contentEditable:b,suppressContentEditableWarning:!0})),"custom"===q?(H.childProps=F,R=f.createElement(J,H)):R=f.createElement(q,F,f.createElement(J,H)),I?(A=[],B=f.cloneElement(I,{key:D+"-wrap","data-offset-key":j},A),K.push(B),M=e.getDepth(),d(A).push(R)):N?(W&&(A=[],B=f.cloneElement(N,{key:D+"-wrap","data-offset-key":j},A),_=N,K.push(B)),M=e.getDepth(),d(A).push(R)):(A=null,B=null,_=null,M=null,K.push(R))}),e="contents"===i||null,n=!e||null,[].concat(K)},t}(f.Component);e.exports=h},function(e,t,n){"use strict";var r=n(12),o=n(5),i=n(3),a=n(33),s=n(30),c=n(18),u=n(56),l=20,f=!1,p=!1,g="",d={onBeforeInput:function(e,t){g=(g||"")+t.data},onCompositionStart:function(e){p=!0},onCompositionEnd:function(e){f=!1,p=!1,setTimeout(function(){f||d.resolveComposition(e)},l)},onKeyDown:function(e,t){return p?void(t.which!==a.RIGHT&&t.which!==a.LEFT||t.preventDefault()):(d.resolveComposition(e),void e._onKeyDown(t))},onKeyPress:function(e,t){t.which===a.RETURN&&t.preventDefault()},resolveComposition:function(e){var t,n,a,l,d,h;if(!p){if(f=!0,t=g,g="",n=i.set(e._latestEditorState,{inCompositionMode:!1}),a=n.getCurrentInlineStyle(),l=s(n.getCurrentContent(),n.getSelection()),d=!t||u(n)||a.size>0||null!==l,d&&e.restoreEditorDOM(),e.exitCurrentMode(),t){if(r.draft_handlebeforeinput_composed_text&&e.props.handleBeforeInput&&c(e.props.handleBeforeInput(t,n)))return;return h=o.replaceText(n.getCurrentContent(),n.getSelection(),t,a,l),void e.update(i.push(n,h,"insert-characters"))}d&&e.update(i.set(n,{nativelyRenderedContent:null,forceSelection:!0}))}}};e.exports=d},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(67),s=(n(3),n(11)),c=n(7),u=n(156),l=function(e){function t(){var n,i,a,s,c,u;for(r(this,t),s=arguments.length,c=Array(s),u=0;u0){if(e.props.handleDroppedFiles&&p(e.props.handleDroppedFiles(f,n)))return;return void l(n,function(t){t&&e.update(i(u,f,t))})}if(s=e._internalDrag?"internal":"external",!e.props.handleDrop||!p(e.props.handleDrop(f,c,s)))return e._internalDrag?void e.update(o(u,f)):void e.update(i(u,f,c.getText()))}}};e.exports=d},function(e,t,n){"use strict";var r=n(91),o=n(92),i=n(93),a=n(94),s=n(95),c=n(96),u=n(97),l=n(98),f=n(99),p=n(100),g=n(101),d=n(102),h={onBeforeInput:r,onBlur:o,onCompositionStart:i,onCopy:a,onCut:s,onDragOver:c,onDragStart:u,onFocus:l,onInput:f,onKeyDown:p,onPaste:g,onSelect:d};e.exports=h},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(9),s=n(74),c=n(11),u=n(21),l=n(2),f=n(127),p=function(e){function t(){return r(this,t),o(this,e.apply(this,arguments))}return i(t,e),t.prototype._setSelection=function(){var e,t,n,r,o,i,a,s,c,p=this.props.selection;null!=p&&p.getHasFocus()&&(e=this.props,t=e.block,n=e.start,r=e.text,o=t.getKey(),i=n+r.length,p.hasEdgeWithin(o,n,i)&&(a=u.findDOMNode(this),a?void 0:l(!1),s=a.firstChild,s?void 0:l(!1),c=void 0,s.nodeType===Node.TEXT_NODE?c=s:"BR"===s.tagName?c=a:(c=s.firstChild,c?void 0:l(!1)),f(p,c,o,n,i)))},t.prototype.shouldComponentUpdate=function(e){var t=u.findDOMNode(this.leaf);return t?void 0:l(!1),t.textContent!==e.text||e.styleSet!==this.props.styleSet||e.forceSelection},t.prototype.componentDidUpdate=function(){this._setSelection()},t.prototype.componentDidMount=function(){this._setSelection()},t.prototype.render=function(){var e,t,n,r,o,i,u,l=this,f=this.props.block,p=this.props.text;return p.endsWith("\n")&&this.props.isLast&&(p+="\n"),e=this.props,t=e.customStyleMap,n=e.customStyleFn,r=e.offsetKey,o=e.styleSet,i=o.reduce(function(e,n){var r={},o=t[n];return void 0!==o&&e.textDecoration!==o.textDecoration&&(r.textDecoration=[e.textDecoration,o.textDecoration].join(" ").trim()),a(e,o,r)},{}),n&&(u=n(o,f),i=a(i,u)),c.createElement("span",{"data-offset-key":r,ref:function(e){return l.leaf=e},style:i},c.createElement(s,null,p))},t}(c.Component);e.exports=p},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(11),s=n(20),c=function(e){function t(){return r(this,t),o(this,e.apply(this,arguments))}return i(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.text!==e.text||this.props.editorState.getSelection().getHasFocus()!==e.editorState.getSelection().getHasFocus()},t.prototype.render=function(){var e=this.props.editorState.getSelection().getHasFocus(),t=s({"public/DraftEditorPlaceholder/root":!0,"public/DraftEditorPlaceholder/hasFocus":e}),n={whiteSpace:"pre-wrap"};return a.createElement("div",{className:t},a.createElement("div",{className:s("public/DraftEditorPlaceholder/inner"),id:this.props.accessibilityID,style:n},this.props.text))},t}(a.Component);e.exports=c},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){return f?"\n"===e.textContent:"BR"===e.tagName}var s=n(11),c=n(21),u=n(8),l=n(2),f=u.isBrowser("IE <= 11"),p=f?s.createElement("span",{key:"A","data-text":"true"},"\n"):s.createElement("br",{key:"A","data-text":"true"}),g=f?s.createElement("span",{key:"B","data-text":"true"},"\n"):s.createElement("br",{key:"B","data-text":"true"}),d=function(e){function t(n){r(this,t);var i=o(this,e.call(this,n));return i._forceFlag=!1,i}return i(t,e),t.prototype.shouldComponentUpdate=function(e){var t=c.findDOMNode(this),n=""===e.children;return t instanceof Element?void 0:l(!1),n?!a(t):t.textContent!==e.children},t.prototype.componentDidMount=function(){this._forceFlag=!this._forceFlag},t.prototype.componentDidUpdate=function(){this._forceFlag=!this._forceFlag},t.prototype.render=function(){return""===this.props.children?this._forceFlag?p:g:s.createElement("span",{key:this._forceFlag?"A":"B","data-text":"true"},this.props.children)},t}(s.Component);e.exports=d},function(e,t){"use strict";var n={getRemovalRange:function(e,t,n,r,o){var i,a,s,c,u,l,f,p,g,d=n.split(" ");for(d=d.map(function(e,t){if("forward"===o){if(t>0)return" "+e}else if(t0?(r=t[c-1],r?void 0:i(!1),void r.children.push(u)):void n.push(u)):(t={},void n.push(u))}),o({},e,{blocks:n})}};e.exports=u},function(e,t,n){"use strict";var r,o=n(1),i=n(134),a=n(7),s=o.OrderedMap,c={getDirectionMap:function(e,t){var n,c,u;return r?r.reset():r=new i,n=e.getBlockMap(),c=n.valueSeq().map(function(e){return a(r).getDirection(e.getText())}),u=s(n.keySeq().zip(c)),null!=t&&o.is(t,u)?t:u}};e.exports=c},function(e,t,n){"use strict";function r(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=t.getBlockBefore(e.getKey());r&&0!==t.getBlockChildren(r.getKey()).size&&!n(r);)r=t.getBlockBefore(r.getKey());return r||e}function o(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=t.getBlockAfter(e.getKey());r&&0!==t.getBlockChildren(r.getKey()).size&&t.getBlockAfter(r.getKey())&&!n(r);)r=t.getBlockAfter(r.getKey());return r||e}var i=n(4),a=n(10),s=n(22),c=n(23),u=n(3),l=n(1),f=n(29),p=n(6),g=n(129),d=n(130),h=l.List,y=l.Repeat,m="",v=h(y(i.create(),m.length)),b=new l.Map(new l.fromJS(c.toJS()).mergeDeep(new l.fromJS({blockquote:{nestingEnabled:!0},"unordered-list-item":{nestingEnabled:!0},"ordered-list-item":{nestingEnabled:!0}})).toJS()),k={DefaultBlockRenderMap:b,toggleBlockType:function(e,t){var n,r,o,i,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.DefaultBlockRenderMap,l=e.getCurrentContent(),p=e.getSelection(),g=l.getBlockForKey(p.getStartKey()),d=g.getKey(),h=c.get(g.getType()),y=h&&h.nestingEnabled,b=c.get(t),S=g.getParentKey(),w=l.getBlockForKey(S),C=w&&c.get(w.getType()),x=h&&b&&h.element===b.element,E=C&&b&&C.element===b.element,O=(y||b.nestingEnabled)&&t!==g.getType();return O?(n=l.getBlockMap(),E?(r=s.createFromBlockArray(n.map(function(e,n){return e===w?new a({key:e.getKey(),type:t,depth:e.getDepth(),text:e.getText(),characterList:e.getCharacterList()}):e===g?new a({key:e.getKey(),type:"unstyled",depth:e.getDepth(),text:e.getText(),characterList:e.getCharacterList()}):e}).toArray()),{editorState:u.push(e,r.merge({selectionBefore:p,selectionAfter:p.merge({anchorKey:d,anchorOffset:p.getAnchorOffset(),focusKey:d,focusOffset:p.getFocusOffset(),isBackward:!1})}),"change-block-type"),blockType:g.getType()}):(o=f(d),i=s.createFromBlockArray(n.map(function(e,t){return e===g?x?new a({key:d,type:"unstyled",depth:g.getDepth(),text:g.getText(),characterList:g.getCharacterList()}):[new a({key:d,type:g.getType(),depth:g.getDepth(),text:m,characterList:v}),new a({key:o,type:"unstyled",depth:0,text:g.getText(),characterList:g.getCharacterList()})]:e}).reduce(function(e,t){return e.concat(t)},[])),{editorState:u.push(e,i.merge({selectionBefore:p,selectionAfter:p.merge({anchorKey:x?d:o,anchorOffset:p.getAnchorOffset(),focusKey:x?d:o,focusOffset:p.getFocusOffset(),isBackward:!1})}),"change-block-type"),blockType:t})):{editorState:e,blockType:t}},handleKeyCommand:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:b,r=e.getSelection(),o=e.getCurrentContent(),i=r.getAnchorKey(),a=o.getBlockForKey(i),s=o.getBlockChildren(i),c=a.getParentKey(),u=o.getBlockForKey(c),l=o.getBlockAfter(i),f=n.get(a.getType()),p=u&&n.get(u.getType()),g=f&&f.nestingEnabled,d=f&&f.wrapper,h=p&&p.wrapper;switch("split-block"===t&&(!a.hasParent()||g&&0!==a.getLength()||!(!l||d&&l.getType()!==a.getType()||l.getParentKey()!==a.getParentKey()&&(0===a.getLength()||h))||(t="split-parent-block"),"split-block"===t&&s.size>0&&(t="split-nested-block")),g||"split-nested-block"!==t||(t="split-block"),t){case"backspace":return k.onBackspace(e,n);case"delete":return k.onDelete(e,n);case"split-nested-block":return k.onSplitNestedBlock(e,n);case"split-parent-block":return k.onSplitParent(e,n);default:return null}},keyBinding:function(e){if(13===e.keyCode&&e.shiftKey)return"split-nested-block"},onBackspace:function(e){var t,n,o,i,c,l=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:b,e.getSelection()),f=l.isCollapsed(),p=e.getCurrentContent(),g=l.getAnchorKey(),d=p.getBlockForKey(g),h=p.getBlockBefore(g),y=f&&0===l.getEndOffset()&&h&&h.getKey()===d.getParentKey();return y?(t=r(d,p),t===d?null:(n=p.getBlockMap(),o=t.getKey(),i=s.createFromBlockArray(n.filter(function(e){return null!==e}).map(function(e,n){return t||h!==e?t&&e===t?new a({key:o,type:t.getType(),depth:t.getDepth(),text:t.getText()+d.getText(),characterList:t.getCharacterList().concat(d.getCharacterList())}):e:[new a({key:o,type:d.getType(),depth:d.getDepth(),text:d.getText(),characterList:d.getCharacterList()}),e]}).filter(function(e){return e!==d}).reduce(function(e,t){return e.concat(t)},[])),c=i.getBlockForKey(o).getLength(),u.push(e,i.merge({selectionBefore:l,selectionAfter:l.merge({anchorKey:o,anchorOffset:c,focusKey:o,focusOffset:c,isBackward:!1})}),"backspace-character"))):null},onDelete:function(e){var t,n,r,i,c=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:b,e.getSelection()),l=e.getCurrentContent(),f=c.getAnchorKey(),p=l.getBlockForKey(f),g=l.getBlockAfter(f),d=c.isCollapsed(),h=g&&d&&c.getEndOffset()===p.getLength()&&l.getBlockChildren(g.getKey()).size;return h?(t=l.getBlockMap(),n=o(p,l),r=s.createFromBlockArray(t.filter(function(e){return null!==e}).map(function(e,t){return e===p?new a({key:f,type:p.getType(),depth:p.getDepth(),text:p.getText()+n.getText(),characterList:p.getCharacterList().concat(n.getCharacterList())}):e}).filter(function(e){return e!==n}).reduce(function(e,t){return e.concat(t)},[])),i=p.getLength(),u.push(e,r.merge({selectionBefore:c,selectionAfter:c.merge({anchorKey:f,anchorOffset:i,focusKey:f,focusOffset:i,isBackward:!1})}),"delete-character")):null},onSplitNestedBlock:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:b,e.getSelection()),n=e.getCurrentContent();return u.push(e,g(n,t),"split-block")},onSplitCurrentBlock:function(e,t){return d(e,t)},onSplitParent:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b,n=e.getSelection(),r=e.getCurrentContent(),o=n.getAnchorKey(),i=r.getBlockForKey(o),c=i.getParentKey(),l=r.getBlockForKey(c),g=t.get(i.getType()),d=l&&t.get(l.getType()),h=g&&g.wrapper,y=d&&d.wrapper,m=r.getBlockMap(),v=h?f(c):l&&l.getParentKey()?f(l.getParentKey()):p(),k=s.createFromBlockArray(m.filter(function(e){return null!==e}).map(function(e,t){var s,c;return e===i?(s=y||!h&&l.getParentKey()?l.getType():"unstyled",c=new a({key:v,type:s,depth:l?l.getDepth():0,text:i.getText().slice(n.getEndOffset()),characterList:i.getCharacterList().slice(n.getEndOffset())}),0===i.getLength()&&0===r.getBlockChildren(o).size?c:[new a({key:e.getKey(),type:e.getType(),depth:e.getDepth(),text:i.getText().slice(0,n.getStartOffset()),characterList:i.getCharacterList().slice(0,n.getStartOffset())}),c]):e}).filter(function(e){return null!==e}).reduce(function(e,t){return e.concat(t)},[]));return u.push(e,k.merge({selectionBefore:n,selectionAfter:n.merge({anchorKey:v,anchorOffset:0,focusKey:v,focusOffset:0,isBackward:!1})}),"split-block")}};e.exports=k},function(e,t,n){"use strict";var r=n(5),o=n(3),i=n(26),a=n(7),s=null,c={cut:function(e){var t,n,c,u=e.getCurrentContent(),l=e.getSelection(),f=null;if(l.isCollapsed()){if(t=l.getAnchorKey(),n=u.getBlockForKey(t).getLength(),n===l.getAnchorOffset())return e;f=l.set("focusOffset",n)}else f=l;return f=a(f),s=i(u,f),c=r.removeRange(u,f,"forward"),c===u?e:o.push(e,c,"remove-range")},paste:function(e){if(!s)return e;var t=r.replaceWithFragment(e.getCurrentContent(),e.getSelection(),s);return o.push(e,t,"insert-fragment")}};e.exports=c},function(e,t){"use strict";function n(e,t,n,r){var o=t.getStartKey(),i=t.getEndKey(),a=e.getBlockMap(),s=a.toSeq().skipUntil(function(e,t){return t===o}).takeUntil(function(e,t){return t===i}).concat([[i,a.get(i)]]).map(function(e){var t=e.getDepth()+n;return t=Math.max(0,Math.min(t,r)),e.set("depth",t)});return a=a.merge(s),e.merge({blockMap:a,selectionBefore:t,selectionAfter:t})}e.exports=n},function(e,t,n){"use strict";function r(e,t,n,r){for(var i=e.getCharacterList();t0;){if(l=u.pop(),f=l.parentRef,p=f.getChildKeys(),g=p.indexOf(l.key),d=Array.isArray(l.children),!d){d?void 0:m(!1);break}h=l.children.map(x),y=new a(o({},w(l,t),{parent:f.getKey(),children:b(h.map(function(e){return e.key})),prevSibling:0===g?null:p.get(g-1),nextSibling:g===p.size-1?null:p.get(g+1)})),n=n.set(y.getKey(),y),u=E(u,h,y)}return n},S())},T=function(e,t){return S(e.map(function(e){var n=new i(w(e,t));return[n.getKey(),n]}))},K=function(e,t){var n=Array.isArray(e.blocks[0].children),r=v&&!n?l.fromRawStateToRawTreeState(e).blocks:e.blocks;return v?O(r,t):T(n?l.fromRawTreeStateToRawState(e).blocks:r,t)},B=function(e){var t=e.entityMap,n={};return Object.keys(t).forEach(function(e){var r=t[e],o=r.type,i=r.mutability,a=r.data;n[e]=c.__create(o,i,a||{})}),n},_=function(e){var t,n,r;return Array.isArray(e.blocks)?void 0:m(!1),t=B(e),n=K(e,t),r=n.isEmpty()?new p:p.createEmpty(n.first().getKey()),new s({blockMap:n,entityMap:t,selectionBefore:r,selectionAfter:r})};e.exports=_},function(e,t,n){"use strict";function r(e,t){var n=e.map(function(e,n){var r=t[n];return o.create({style:e,entity:r})});return a(n)}var o=n(4),i=n(1),a=i.List;e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=Array(e.length).fill(null);return t&&t.forEach(function(t){var r,o=i(e,0,t.offset).length,a=o+i(e,t.offset,t.length).length;for(r=o;r0)){if(e.props.handlePastedFiles&&h(e.props.handlePastedFiles(r)))return;return void d(r,function(t){var n,r,o,i,c,d,h;t=t||m,t&&(n=e._latestEditorState,r=y(t),o=s.create({style:n.getCurrentInlineStyle(),entity:g(n.getCurrentContent(),n.getSelection())}),i=p.getCurrentBlockType(n),c=l.processText(r,o,i),d=a.createFromArray(c),h=u.replaceWithFragment(n.getCurrentContent(),n.getSelection(),d),e.update(f.push(n,h,"insert-fragment")))})}if(v=[],b=n.getText(),k=n.getHTML(),S=e._latestEditorState,!e.props.handlePastedText||!h(e.props.handlePastedText(b,k,S))){if(b&&(v=y(b)),!e.props.stripPastedStyles){if(w=e.getClipboard(),n.isRichText()&&w){if(k.indexOf(e.getEditorKey())!==-1||1===v.length&&1===w.size&&w.first().getText()===b)return void e.update(o(e._latestEditorState,w))}else if(w&&n.types.includes("com.apple.webarchive")&&!n.types.includes("text/html")&&i(v,w))return void e.update(o(e._latestEditorState,w));if(k){if(C=document.createRange().createContextualFragment(k),x=C.querySelectorAll("meta"),E=[],x.forEach(function(e){var t=e.getAttribute("content");t&&E.push(t)}),E.length)return O=s.create({style:S.getCurrentInlineStyle(),entity:g(S.getCurrentContent(),S.getSelection())}),T=p.getCurrentBlockType(S),K=l.processText(v,O,T),B=a.createFromArray(K),void e.update(o(e._latestEditorState,B));if(_=l.processHTML(k,e.props.blockRenderMap),_&&(M=_.contentBlocks,A=_.entityMap,M))return D=a.createFromArray(M),void e.update(o(e._latestEditorState,D,A))}e.setClipboard(null)}v.length&&(O=s.create({style:S.getCurrentInlineStyle(),entity:g(S.getCurrentContent(),S.getSelection())}),T=p.getCurrentBlockType(S),K=l.processText(v,O,T),B=a.createFromArray(K),e.update(o(e._latestEditorState,B)))}}function o(e,t,n){var r=u.replaceWithFragment(e.getCurrentContent(),e.getSelection(),t);return f.push(e,r.set("entityMap",n),"insert-fragment")}function i(e,t){return e.length===t.size&&t.valueSeq().every(function(t,n){return t.getText()===e[n]})}var a=n(16),s=n(4),c=n(59),u=n(5),l=n(78),f=n(3),p=n(45),g=n(30),d=n(53),h=n(18),y=n(131);e.exports=r},function(e,t,n){"use strict";function r(e){var t,n,r,c;e._blockSelectEvents||e._latestEditorState!==e.props.editorState||(t=e.props.editorState,n=i.findDOMNode(e.editorContainer),n?void 0:s(!1),n.firstChild instanceof HTMLElement?void 0:s(!1),r=a(t,n.firstChild),c=r.selectionState,c!==t.getSelection()&&(t=r.needsRecovery?o.forceSelection(t,c):o.acceptSelection(t,c),e.update(t)))}var o=n(3),i=n(21),a=n(107),s=n(2);e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=[];return e.findEntityRanges(function(e){return!!e.getEntity()},function(r,i){var s=e.getText(),c=e.getEntityAt(r);n.push({offset:a(s.slice(0,r)),length:a(s.slice(r,i)),key:Number(t[o.stringify(c)])})}),n}var o=n(44),i=n(13),a=i.strlen;e.exports=r},function(e,t,n){"use strict";function r(e,t,n){var r=[],o=t.map(function(e){return e.has(n)}).toList();return a(o,s,c,function(t,o){var a=e.getText();r.push({offset:i.strlen(a.slice(0,t)),length:i.strlen(a.slice(t,o)),style:n})}),r}function o(e){var t=e.getCharacterList().map(function(e){return e.getStyle()}).toList(),n=t.flatten().toSet().map(function(n){return r(e,t,n)});return Array.prototype.concat.apply(u,n.toJS())}var i=n(13),a=n(17),s=function(e,t){return e===t},c=function(e){return!!e},u=[];e.exports=o},function(e,t,n){"use strict";function r(e){var t,n,r=getComputedStyle(e),o=document.createElement("div");return o.style.fontFamily=r.fontFamily,o.style.fontSize=r.fontSize,o.style.fontStyle=r.fontStyle,o.style.fontWeight=r.fontWeight,o.style.lineHeight=r.lineHeight,o.style.position="absolute",o.textContent="M",t=document.body,t?void 0:u(!1),t.appendChild(o),n=o.getBoundingClientRect(),t.removeChild(o),n.height}function o(e,t){var n,r,o=1/0,i=1/0,a=-(1/0),s=-(1/0);for(n=0;n=0;d--)if(!(null!=g&&d>0&&s.isSurrogatePair(g,d-1))){if(e.setStart(f,d),!o(c(e),n))break;a=f,l=d}if(d===-1||0===f.childNodes.length)break; -f=f.childNodes[d],p=i(f)}return e.setStart(a,l),e}var s=n(13),c=n(50),u=n(2);e.exports=a},function(e,t,n){"use strict";function r(e,t,n,r,i){var a,s,c,u,l,f=r.getStartOffset(),p=r.getEndOffset(),g=t.getEntityAt(f),d=n.getEntityAt(p-1);return g||d?(a=r,g&&g===d?a=o(e,t,a,i,g,!0,!0):g&&d?(s=o(e,t,a,i,g,!1,!0),c=o(e,n,a,i,d,!1,!1),a=a.merge({anchorOffset:s.getAnchorOffset(),focusOffset:c.getFocusOffset(),isBackward:!1})):g?(u=o(e,t,a,i,g,!1,!0),a=a.merge({anchorOffset:u.getStartOffset(),isBackward:!1})):d&&(l=o(e,n,a,i,d,!1,!1),a=a.merge({focusOffset:l.getEndOffset(),isBackward:!1})),a):r}function o(e,t,n,r,o,c,u){var l,f,p,g=n.getStartOffset(),d=n.getEndOffset(),h=e.__get(o),y=h.getMutability(),m=u?g:d;return"MUTABLE"===y?n:(l=a(t,o).filter(function(e){return m<=e.end&&m>=e.start}),1!=l.length?s(!1):void 0,f=l[0],"IMMUTABLE"===y?n.merge({anchorOffset:f.start,focusOffset:f.end,isBackward:!1}):(c||(u?d=f.end:g=f.start),p=i.getRemovalRange(g,d,t.getText().slice(f.start,f.end),f.start,r),n.merge({anchorOffset:p.start,focusOffset:p.end,isBackward:!1})))}var i=n(75),a=n(109),s=n(2);e.exports=r},function(e,t,n){(function(t){"use strict";function r(e,n){var r=t.getSelection();return 0===r.rangeCount?{selectionState:e.getSelection().set("hasFocus",!1),needsRecovery:!1}:o(e,n,r.anchorNode,r.anchorOffset,r.focusNode,r.focusOffset)}var o=n(48);e.exports=r}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){var t,n,r,i,a=o(e),s=0,c=0,u=0,l=0;if(a.length)for(a.length>1&&0===a[0].width?(t=a[1],s=t.top,c=t.right,u=t.bottom,l=t.left):(n=a[0],s=n.top,c=n.right,u=n.bottom,l=n.left),r=1;rt;)e=e.pop(),n--;else r=e.slice(0,t),o=e.slice(n),e=r.concat(o).toList();return e}var i=n(1);e.exports=r},function(e,t,n){(function(t){"use strict";function r(e){var t=document.body.createTextRange,n=0===e.rangeCount||0===e.getRangeAt(0).getClientRects().length;t&&n?window.getSelection().removeAllRanges():e.removeAllRanges()}function o(){var e,t=document.createElement("div");t.style.position="absolute",document.body.appendChild(t),window.getSelection().removeAllRanges(),e=document.createRange();try{window.getSelection().addRange(e)}catch(e){}document.body.removeChild(t)}function i(e,t){var n,r,i,a,s=document.body.createTextRange;return s&&(n=0===e.rangeCount||0===e.getRangeAt(0).getClientRects().length,r=t.startOffset===t.endOffset,i=!e.anchorNode&&!e.focusNode,a=n&&r&&i)?(o(),void window.getSelection().addRange(t)):void e.addRange(t)}function a(e,t){if(!e)return"[empty]";var n=s(e,t);return n.nodeType===Node.TEXT_NODE?n.textContent:(n instanceof Element?void 0:y(!1),n.outerHTML)}function s(e,t){var n,r,o,i,a=void 0!==t?t(e):[];if(e.nodeType===Node.TEXT_NODE)return n=e.textContent.length,document.createTextNode("[text "+n+(a.length?" | "+a.join(", "):"")+"]");for(r=e.cloneNode(),1===r.nodeType&&a.length&&r.setAttribute("data-labels",a.join(", ")),o=e.childNodes,i=0;i=u,b=l===o&&i<=g&&a>=g,v&&b?(r(s),p(s,n,u-i,e),void f(s,n,g-i,e)):void(h?(b&&(r(s),p(s,n,g-i,e)),v&&(k=s.focusNode,S=s.focusOffset,r(s),p(s,n,u-i,e),k&&f(s,k,S,e))):(v&&(r(s),p(s,n,u-i,e)),b&&f(s,n,g-i,e)))}function f(e,t,n,r){var o,a,s=h();if(e.extend&&d(s,t)){if(n>u(t)&&g.logSelectionStateFailure({anonymizedDom:c(t),extraParams:JSON.stringify({offset:n}),selectionState:JSON.stringify(r.toJS())}),"None"!==e.type){o=t===e.focusNode;try{e.extend(t,n)}catch(i){throw g.logSelectionStateFailure({anonymizedDom:c(t,function(t){var n=[];return t===s&&n.push("active element"),t===e.anchorNode&&n.push("selection anchor node"),t===e.focusNode&&n.push("selection focus node"),n}),extraParams:JSON.stringify({activeElementName:s?s.nodeName:null,nodeIsFocus:t===e.focusNode,nodeWasFocus:o,selectionRangeCount:e.rangeCount,selectionAnchorNodeName:e.anchorNode?e.anchorNode.nodeName:null,selectionAnchorOffset:e.anchorOffset,selectionFocusNodeName:e.focusNode?e.focusNode.nodeName:null,selectionFocusOffset:e.focusOffset,message:i?""+i:null,offset:n},null,2),selectionState:JSON.stringify(r.toJS(),null,2)}),i}}}else e.rangeCount>0&&(a=e.getRangeAt(0),a.setEnd(t,n),i(e,a.cloneRange()))}function p(e,t,n,r){var o=document.createRange();n>u(t)&&g.logSelectionStateFailure({anonymizedDom:c(t),extraParams:JSON.stringify({offset:n}),selectionState:JSON.stringify(r.toJS())}),o.setStart(t,n),i(e,o.cloneRange())}var g=n(77),d=n(36),h=n(62),y=n(2);e.exports=l}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e,t){var n,r,o,c,u,l,f,p,g,d,h,y;return t.isCollapsed()?void 0:a(!1),n=t.getAnchorKey(),r=t.getAnchorOffset(),o=e.getBlockMap(),c=o.get(n),u=c.getText(),l=c.getCharacterList(),f=c.merge({text:u.slice(0,r),characterList:l.slice(0,r)}),p=i(),g=f.merge({key:p,text:u.slice(r),characterList:l.slice(r),data:s()}),d=o.toSeq().takeUntil(function(e){return e===c}),h=o.toSeq().skipUntil(function(e){return e===c}).rest(),y=d.concat([[f.getKey(),f],[g.getKey(),g]],h).toOrderedMap(),e.merge({blockMap:y,selectionBefore:t,selectionAfter:t.merge({anchorKey:p,anchorOffset:0,focusKey:p,focusOffset:0,isBackward:!1})})}var o=n(1),i=n(6),a=n(2),s=o.Map;e.exports=r},function(e,t,n){"use strict";function r(e,t){var n,r,o,u,l,f,p,g,d,h,y,m,v,b,k=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unstyled";return t.isCollapsed()?void 0:a(!1),n=t.getAnchorKey(),r=t.getAnchorOffset(),o=e.getBlockMap(),u=o.get(n),l=u.getText(),f=u.getCharacterList(),p=i(n),g=i(n),d=u.merge({text:"",characterList:c()}),h=new s({key:p,type:k,text:l.slice(0,r),characterList:f.slice(0,r)}),y=new s({key:g,type:k,text:l.slice(r),characterList:f.slice(r)}),m=o.toSeq().takeUntil(function(e){return e===u}),v=o.toSeq().skipUntil(function(e){return e===u}).rest(),b=m.concat([[d.getKey(),d],[h.getKey(),h],[y.getKey(),y]],v).toOrderedMap(),e.merge({blockMap:b,selectionBefore:t,selectionAfter:t.merge({anchorKey:g,anchorOffset:0,focusKey:g,focusOffset:0,isBackward:!1})})}var o=n(1),i=n(29),a=n(2),s=n(10),c=o.List;e.exports=r},function(e,t,n){"use strict";function r(e,t){var n,r,o,u,l,f,p,g,d,h,y,m,v;return t.isCollapsed()?void 0:a(!1),n=t.getAnchorKey(),r=t.getAnchorOffset(),o=e.getBlockMap(),u=o.get(n),l=u.getParentKey(),f=u.getText(),p=u.getCharacterList(),g=u.merge({text:f.slice(0,r),characterList:p.slice(0,r),key:i(),parentKey:l}),d=g.merge({key:i(),parentKey:l,text:f.slice(r),characterList:p.slice(r),data:c()}),h=u.merge({text:"",characterList:s(),parentKey:l}),y=o.toSeq().takeUntil(function(e){return e===u}),m=o.toSeq().skipUntil(function(e){return e===u}).rest(),0===g.text.length?(v=y.concat([[g.getKey(),g],[d.getKey(),d]],m).toOrderedMap(),e.merge({blockMap:v,selectionBefore:t,selectionAfter:t.merge({anchorKey:g.getKey(),anchorOffset:0,focusKey:g.getKey(),focusOffset:0,isBackward:!1})})):0!==g.text.length&&0===d.text.length?(v=y.concat([[g.getKey(),g],[h.getKey(),h]],m).toOrderedMap(),e.merge({blockMap:v,selectionBefore:t,selectionAfter:t.merge({anchorKey:h.getKey(),anchorOffset:0,focusKey:h.getKey(),focusOffset:0,isBackward:!1})})):(v=y.concat([[g.getKey(),g],[h.getKey(),h],[d.getKey(),d]],m).toOrderedMap(),e.merge({blockMap:v,selectionBefore:t,selectionAfter:t.merge({anchorKey:h.getKey(),anchorOffset:0,focusKey:h.getKey(),focusOffset:0,isBackward:!1})}))}var o=n(1),i=n(6),a=n(2),s=o.List,c=o.Map;e.exports=r},function(e,t){"use strict";function n(e){return e.split(r)}var r=/\r\n?|\n/g;e.exports=n},function(e,t){"use strict";function n(e){return e.split("/")}var r={isImage:function(e){return"image"===n(e)[0]},isJpeg:function(e){var t=n(e);return r.isImage(e)&&("jpeg"===t[1]||"pjpeg"===t[1])}};e.exports=r},function(e,t){"use strict";var n="[.,+*?$|#{}()'\\^\\-\\[\\]\\\\\\/!@%\"~=<>_:;・、。〈-】〔-〟:-?!-/[-`{-・⸮؟٪-٬؛،؍﴾﴿᠁।၊။‐-‧‰-⁞¡-±´-¸º»¿]";e.exports={getPunctuation:function(){return n}}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=n(61),i=n(35),a=n(2),s=function(){function e(t){r(this,e),t?i.isStrong(t)?void 0:a(!1):t=i.getGlobalDir(),this._defaultDir=t,this.reset()}return e.prototype.reset=function(){this._lastDir=this._defaultDir},e.prototype.getDirection=function(e){return this._lastDir=o.getDirection(e,this._lastDir),this._lastDir},e}();e.exports=s},function(e,t,n){"use strict";function r(e){return s[e]||e}function o(e){if(!e)return{major:"",minor:""};var t=e.split(".");return{major:t[0],minor:t[1]}}var i=n(154),a="Unknown",s={"Mac OS":"Mac OS X"},c=new i,u=c.getResult(),l=o(u.browser.version),f={browserArchitecture:u.cpu.architecture||a,browserFullVersion:u.browser.version||a,browserMinorVersion:l.minor||a,browserName:u.browser.name||a,browserVersion:u.browser.major||a,deviceName:u.device.model||a,engineName:u.engine.name||a,engineVersion:u.engine.version||a,platformArchitecture:u.cpu.architecture||a,platformName:r(u.os.name)||a,platformVersion:u.os.version||a,platformFullVersion:u.os.version||a};e.exports=f},function(e,t,n){"use strict";function r(e,t){var n=e.split(w);return n.length>1?n.some(function(e){return O.contains(e,t)}):(e=n[0].trim(),o(e,t))}function o(e,t){var n,r,o=e.split(C);return o.length>0&&o.length<=2?void 0:k(!1),1===o.length?i(o[0],t):(n=o[0],r=o[1],d(n)&&d(r)?void 0:k(!1),i(">="+n,t)&&i("<="+r,t))}function i(e,t){var n,r,o,i;if(e=e.trim(),""===e)return!0;switch(n=t.split(S),r=p(e),o=r.modifier,i=r.rangeComponents,o){case"<":return a(n,i);case"<=":return s(n,i);case">=":return u(n,i);case">":return l(n,i);case"~":case"~>":return f(n,i);default:return c(n,i)}}function a(e,t){return b(e,t)===-1}function s(e,t){var n=b(e,t);return n===-1||0===n}function c(e,t){return 0===b(e,t)}function u(e,t){var n=b(e,t);return 1===n||0===n}function l(e,t){return 1===b(e,t)}function f(e,t){var n,r,o=t.slice(),i=t.slice();return i.length>1&&i.pop(),n=i.length-1,r=parseInt(i[n],10),g(r)&&(i[n]=r+1+""),u(e,o)&&a(e,i)}function p(e){var t=e.split(S),n=t[0].match(x);return n?void 0:k(!1),{modifier:n[1],rangeComponents:[n[2]].concat(t.slice(1))}}function g(e){return!isNaN(e)&&isFinite(e)}function d(e){return!p(e).modifier}function h(e,t){for(var n=e.length;nt?1:e=|~>|~|>|)?\s*(.+)/,E=/^(\d*)(.*)/,O={contains:function(e,t){return r(e.trim(),t.trim())}};e.exports=O},function(e,t){"use strict";function n(e){return e.replace(r,function(e,t){return t.toUpperCase()})}var r=/-(.)/g;e.exports=n},function(e,t,n){"use strict";function r(e){var t,n,r=e.length;if(Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e?a(!1):void 0,"number"!=typeof r?a(!1):void 0,0===r||r-1 in e?void 0:a(!1),"function"==typeof e.callee?a(!1):void 0,e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(e){}for(t=Array(r),n=0;n-1;e.exports=n},function(e,t,n){"use strict";function r(e){var t=o(e);return{x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top}}var o=n(141);e.exports=r},function(e,t,n){"use strict";function r(e){var t,n=e.ownerDocument.documentElement;return"getBoundingClientRect"in e&&o(n,e)?(t=e.getBoundingClientRect(),{left:Math.round(t.left)-n.clientLeft,right:Math.round(t.right)-n.clientLeft,top:Math.round(t.top)-n.clientTop,bottom:Math.round(t.bottom)-n.clientTop}):{left:0,right:0,top:0,bottom:0}}var o=n(36);e.exports=r},function(e,t,n){"use strict";function r(e){return null==e?e:String(e)}function o(e,t){var n=void 0;if(window.getComputedStyle&&(n=window.getComputedStyle(e,null)))return r(n.getPropertyValue(a(t)));if(document.defaultView&&document.defaultView.getComputedStyle){if(n=document.defaultView.getComputedStyle(e,null))return r(n.getPropertyValue(a(t)));if("display"===t)return"none"}return r(e.currentStyle?"float"===t?e.currentStyle.cssFloat||e.currentStyle.styleFloat:e.currentStyle[i(t)]:e.style&&e.style[i(t)])}var i=n(137),a=n(145);e.exports=o},function(e,t){"use strict";function n(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}e.exports=n},function(e,t){"use strict";function n(){var e=void 0;return document.documentElement&&(e=document.documentElement.clientWidth),!e&&document.body&&(e=document.body.clientWidth),e||0}function r(){var e=void 0;return document.documentElement&&(e=document.documentElement.clientHeight),!e&&document.body&&(e=document.body.clientHeight),e||0}function o(){return{width:window.innerWidth||n(),height:window.innerHeight||r()}}o.withoutScrollbars=function(){return{width:n(),height:r()}},e.exports=o},function(e,t){"use strict";function n(e){return e.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;e.exports=n},function(e,t){"use strict";function n(e){var t=e?e.ownerDocument||e:document,n=t.defaultView||window;return!(!e||!("function"==typeof n.Node?e instanceof n.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=n},function(e,t,n){"use strict";function r(e){return o(e)&&3==e.nodeType}var o=n(146);e.exports=r},function(e,t){"use strict";function n(e){var t,n,r;if(e||(e=""),t=void 0,n=arguments.length,n>1)for(r=1;r1)for(t=1;t0?2==a.length?typeof a[1]==f?this[a[0]]=a[1].call(this,c):this[a[0]]=a[1]:3==a.length?typeof a[1]!==f||a[1].exec&&a[1].test?this[a[0]]=c?c.replace(a[1],a[2]):i:this[a[0]]=c?a[1].call(this,c,a[2]):i:4==a.length&&(this[a[0]]=c?a[3].call(this,c.replace(a[1],a[2])):i):this[a]=c?c:i;p+=2}},str:function(e,t){var n,r;for(n in t)if(typeof t[n]===g&&t[n].length>0){for(r=0;rr||n<=0)return"";if(o=0,t>0){for(;t>0&&o=r)return""}else if(t<0){for(o=r;t<0&&00&&s0&&void 0!==arguments[0]?arguments[0]:h;return r(this,t),o(this,e.call(this,v(n)))}return i(t,e),t.prototype.getKey=function(){return this.get("key")},t.prototype.getType=function(){return this.get("type")},t.prototype.getText=function(){return this.get("text")},t.prototype.getCharacterList=function(){return this.get("characterList")},t.prototype.getLength=function(){return this.getText().length},t.prototype.getDepth=function(){return this.get("depth")},t.prototype.getData=function(){return this.get("data")},t.prototype.getInlineStyleAt=function(e){var t=this.getCharacterList().get(e);return t?t.getStyle():d},t.prototype.getEntityAt=function(e){var t=this.getCharacterList().get(e);return t?t.getEntity():null},t.prototype.getChildKeys=function(){return this.get("children")},t.prototype.getParentKey=function(){return this.get("parent")},t.prototype.getPrevSiblingKey=function(){return this.get("prevSibling")},t.prototype.getNextSiblingKey=function(){return this.get("nextSibling")},t.prototype.findStyleRanges=function(e,t){c(this.getCharacterList(),y,e,t)},t.prototype.findEntityRanges=function(e,t){c(this.getCharacterList(),m,e,t)},t}(p(h));e.exports=b},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(1),s=a.Record,c={anchorKey:"",anchorOffset:0,focusKey:"",focusOffset:0,isBackward:!1,hasFocus:!1},u=s(c),l=function(e){function t(){return r(this,t),o(this,e.apply(this,arguments))}return i(t,e),t.prototype.serialize=function(){return"Anchor: "+this.getAnchorKey()+":"+this.getAnchorOffset()+", Focus: "+this.getFocusKey()+":"+this.getFocusOffset()+", Is Backward: "+String(this.getIsBackward())+", Has Focus: "+String(this.getHasFocus())},t.prototype.getAnchorKey=function(){return this.get("anchorKey")},t.prototype.getAnchorOffset=function(){return this.get("anchorOffset")},t.prototype.getFocusKey=function(){return this.get("focusKey")},t.prototype.getFocusOffset=function(){return this.get("focusOffset")},t.prototype.getIsBackward=function(){return this.get("isBackward")},t.prototype.getHasFocus=function(){return this.get("hasFocus")},t.prototype.hasEdgeWithin=function(e,t,n){var r,o,i,a=this.getAnchorKey(),s=this.getFocusKey();return a===s&&a===e?(r=this.getStartOffset(),o=this.getEndOffset(),t<=o&&r<=n):(e===a||e===s)&&(i=e===a?this.getAnchorOffset():this.getFocusOffset(),t<=i&&n>=i)},t.prototype.isCollapsed=function(){return this.getAnchorKey()===this.getFocusKey()&&this.getAnchorOffset()===this.getFocusOffset()},t.prototype.getStartKey=function(){return this.getIsBackward()?this.getFocusKey():this.getAnchorKey()},t.prototype.getStartOffset=function(){return this.getIsBackward()?this.getFocusOffset():this.getAnchorOffset()},t.prototype.getEndKey=function(){return this.getIsBackward()?this.getAnchorKey():this.getFocusKey()},t.prototype.getEndOffset=function(){return this.getIsBackward()?this.getAnchorOffset():this.getFocusOffset()},t.createEmpty=function(e){return new t({anchorKey:e,anchorOffset:0,focusKey:e,focusOffset:0,isBackward:!1,hasFocus:!1})},t}(u);e.exports=l},function(e,t,n){"use strict";var r=n(1),o=r.OrderedMap,i={createFromArray:function(e){return o(e.map(function(e){return[e.getKey(),e]}))}};e.exports=i},function(e,t){"use strict";function n(e,t,n,r){if(e.size){var o=0;e.reduce(function(e,i,a){return t(e,i)||(n(e)&&r(o,a),o=a),i}),n(e.last())&&r(o,e.count())}}e.exports=n},function(e,t,n){"use strict";function r(e,t,n){var r=e.getSelection(),i=e.getCurrentContent(),a=r;if(r.isCollapsed()){if("forward"===n){if(e.isSelectionAtEndOfContent())return i}else if(e.isSelectionAtStartOfContent())return i;if(a=t(e),a===r)return i}return o.removeRange(i,a,n)}var o=n(5);e.exports=r},function(e,t){"use strict";function n(e){return"object"==typeof e?Object.keys(e).filter(function(t){return e[t]}).map(r).join(" "):Array.prototype.map.call(arguments,r).join(" ")}function r(e){return e.replace(/\//g,"-")}e.exports=n},function(e,t){e.exports=n},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(17),s=n(4),c=n(10),u=n(15),l=n(24),f=n(12),p=n(1),g=n(16),d=n(6),h=n(32),y=p.List,m=p.Record,v=p.Repeat,b=f.draft_tree_data_support,k={entityMap:null,blockMap:null,selectionBefore:null,selectionAfter:null},S=b?u:c,w=m(k),C=function(e){function t(){return r(this,t),o(this,e.apply(this,arguments))}return i(t,e),t.prototype.getEntityMap=function(){return l},t.prototype.getBlockMap=function(){return this.get("blockMap")},t.prototype.getSelectionBefore=function(){return this.get("selectionBefore")},t.prototype.getSelectionAfter=function(){return this.get("selectionAfter")},t.prototype.getBlockForKey=function(e){var t=this.getBlockMap().get(e);return t},t.prototype.getKeyBefore=function(e){return this.getBlockMap().reverse().keySeq().skipUntil(function(t){return t===e}).skip(1).first()},t.prototype.getKeyAfter=function(e){return this.getBlockMap().keySeq().skipUntil(function(t){return t===e}).skip(1).first()},t.prototype.getBlockAfter=function(e){return this.getBlockMap().skipUntil(function(t,n){return n===e}).skip(1).first()},t.prototype.getBlockBefore=function(e){return this.getBlockMap().reverse().skipUntil(function(t,n){return n===e}).skip(1).first()},t.prototype.getBlocksAsArray=function(){return this.getBlockMap().toArray()},t.prototype.getFirstBlock=function(){return this.getBlockMap().first()},t.prototype.getLastBlock=function(){return this.getBlockMap().last()},t.prototype.getPlainText=function(e){return this.getBlockMap().map(function(e){return e?e.getText():""}).join(e||"\n")},t.prototype.getLastCreatedEntityKey=function(){return l.__getLastCreatedEntityKey()},t.prototype.hasText=function(){var e=this.getBlockMap();return e.size>1||e.first().getLength()>0},t.prototype.createEntity=function(e,t,n){return l.__create(e,t,n),this},t.prototype.mergeEntityData=function(e,t){return l.__mergeData(e,t),this},t.prototype.replaceEntityData=function(e,t){return l.__replaceData(e,t),this},t.prototype.addEntity=function(e){return l.__add(e),this},t.prototype.getEntity=function(e){return l.__get(e)},t.prototype.getFirstLevelBlocks=function(){return this.getBlockChildren("")},t.prototype.getBlockDescendants=function(){return this.getBlockMap().reverse().reduce(function(e,t){var n,r,o,i,a,s,c=t.getKey(),u=t.getParentKey().length>0?t.getParentKey():"__ROOT__",l=e.get(c)?e:e.set(c,new p.Map({firstLevelBlocks:new p.OrderedMap,childrenBlocks:new p.Set}));return u?(n=l.get(u)?l:l.set(u,new p.Map({firstLevelBlocks:new p.OrderedMap,childrenBlocks:new p.Set})),r=n.setIn([u,"firstLevelBlocks",c],t),o=r.setIn([u,"childrenBlocks"],r.getIn([u,"childrenBlocks"]).add(r.getIn([c,"childrenBlocks"]).add(t)))):(i=l.get(u)?l:l.set(u,new p.Map({firstLevelBlocks:new p.OrderedMap,childrenBlocks:new p.Set})),a=i.setIn([u,"firstLevelBlocks",c],t),s=a.setIn([u,"childrenBlocks"],a.getIn([u,"childrenBlocks"]).add(a.getIn([c,"childrenBlocks"]).add(t))))},new p.Map).map(function(e){return e.set("firstLevelBlocks",e.get("firstLevelBlocks").reverse())})},t.prototype.getBlockChildren=function(e){return this.getBlockMap().filter(function(t){return t.getParentKey()===e})},t.createFromBlockArray=function(e,n){var r=Array.isArray(e)?e:e.contentBlocks,o=a.createFromArray(r),i=o.isEmpty()?new g:g.createEmpty(o.first().getKey());return new t({blockMap:o,entityMap:n||l,selectionBefore:i,selectionAfter:i})},t.createFromText=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/\r\n?|\n/g,r=e.split(n),o=r.map(function(e){return e=h(e),new S({key:d(),text:e,type:"unstyled",characterList:y(v(s.EMPTY,e.length))})});return t.createFromBlockArray(o)},t}(w);e.exports=C},function(e,t,n){"use strict";var r=n(1),o=r.Map,i=n(11),a=n(20),s=i.createElement("ul",{className:a("public/DraftStyleDefault/ul")}),c=i.createElement("ol",{className:a("public/DraftStyleDefault/ol")}),u=i.createElement("pre",{className:a("public/DraftStyleDefault/pre")}),l=o({"header-one":{element:"h1"},"header-two":{element:"h2"},"header-three":{element:"h3"},"header-four":{element:"h4"},"header-five":{element:"h5"},"header-six":{element:"h6"},"unordered-list-item":{element:"li",wrapper:s},"ordered-list-item":{element:"li",wrapper:c},blockquote:{element:"blockquote"},atomic:{element:"figure"},"code-block":{element:"pre",wrapper:u},unstyled:{element:"div",aliasedElements:["p"]}});e.exports=l},function(e,t,n){"use strict";function r(e,t){console.warn("WARNING: "+e+' will be deprecated soon!\nPlease use "'+t+'" instead.')}var o=n(9),i=o||function(e){var t,n,r;for(t=1;t0?(n=e.getBlockForKey(o).getEntityAt(i-1),n!==e.getBlockForKey(o).getEntityAt(i)?null:r(e.getEntityMap(),n)):null):(a=t.getStartKey(),s=t.getStartOffset(),c=e.getBlockForKey(a),n=s===c.getLength()?null:c.getEntityAt(s),r(e.getEntityMap(),n))}function r(e,t){if(t){var n=e.__get(t);return"MUTABLE"===n.getMutability()?t:null}return null}e.exports=n},function(e,t){"use strict";function n(e,t){var n,r,o=e.getSelection(),i=e.getCurrentContent(),a=o.getStartKey(),s=o.getStartOffset(),c=a,u=0;return t>s?(n=i.getKeyBefore(a),null==n?c=a:(c=n,r=i.getBlockForKey(n),u=r.getText().length)):u=s-t,o.merge({focusKey:c,focusOffset:u,isBackward:!0})}e.exports=n},function(e,t){"use strict";function n(e){return e.replace(r,"")}var r=new RegExp("\r","g");e.exports=n},function(e,t){"use strict";e.exports={BACKSPACE:8,TAB:9,RETURN:13,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,COMMA:188,PERIOD:190,A:65,Z:90,ZERO:48,NUMPAD_0:96,NUMPAD_9:105}},function(e,t,n){"use strict";function r(e,t){var n=i.get(e,t);return"auto"===n||"scroll"===n}var o=n(142),i={get:o,getScrollParent:function(e){if(!e)return null;for(var t=e.ownerDocument;e&&e!==t.body;){if(r(e,"overflow")||r(e,"overflowY")||r(e,"overflowX"))return e;e=e.parentNode}return t.defaultView||t.parentWindow}};e.exports=i},function(e,t,n){"use strict";function r(e){return e===f||e===p}function o(e){return r(e)?void 0:u(!1),e===f?"ltr":"rtl"}function i(e,t){return r(e)?void 0:u(!1),r(t)?void 0:u(!1),e===t?null:o(e)}function a(e){g=e}function s(){a(f)}function c(){return g||this.initGlobalDir(),g?void 0:u(!1),g}var u=n(2),l="NEUTRAL",f="LTR",p="RTL",g=null,d={NEUTRAL:l,LTR:f,RTL:p,isStrong:r,getHTMLDir:o,getHTMLDirIfDifferent:i,setGlobalDir:a,initGlobalDir:s,getGlobalDir:c};e.exports=d},function(e,t,n){"use strict";function r(e,t){return!(!e||!t)&&(e===t||!o(e)&&(o(t)?r(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}var o=n(147);e.exports=r},function(e,t){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";function r(e){var t,n,r,a,s=o(e.ownerDocument||e.document);return e.Window&&e instanceof e.Window&&(e=s),t=i(e),n=e===s?e.ownerDocument.documentElement:e,r=e.scrollWidth-n.clientWidth,a=e.scrollHeight-n.clientHeight,t.x=Math.max(0,Math.min(t.x,r)),t.y=Math.max(0,Math.min(t.y,a)),t}var o=n(139),i=n(143);e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=[],r=e.map(function(e){return e.getStyle()}).toList();return s(r,o,f,function(e,r){n.push(new d({start:e+t,end:r+t}))}),c(n)}function o(e,t){return e===t}var i=n(1),a=n(37),s=n(18),c=i.List,u=i.Repeat,l=i.Record,f=a.thatReturnsTrue,p="-",g={start:null,end:null},d=l(g),h={start:null,end:null,decoratorKey:null,leaves:null},y=l(h),m={generate:function(e,t,n){var i,a,l,p=t.getLength();return p?(i=[],a=n?n.getDecorations(t,e):c(u(null,p)),l=t.getCharacterList(),s(a,o,f,function(e,t){i.push(new y({start:e,end:t,decoratorKey:a.get(e),leaves:r(l.slice(e,t).toList(),e)}))}),c(i)):c.of(new y({start:0,end:0,decoratorKey:null,leaves:c.of(new d({start:0,end:0}))}))},getFingerprint:function(e){return e.map(function(e){var t=e.get("decoratorKey"),n=null!==t?t+"."+(e.get("end")-e.get("start")):"";return""+n+"."+e.get("leaves").size}).join(p)}};e.exports=m},function(e,t){"use strict";e.exports={BOLD:{fontWeight:"bold"},CODE:{fontFamily:"monospace",wordWrap:"break-word"},ITALIC:{fontStyle:"italic"},STRIKETHROUGH:{textDecoration:"line-through"},UNDERLINE:{textDecoration:"underline"}}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(9),s=a||function(e){var t,n,r;for(t=1;t0&&window.scrollTo(n.x,n.y+r+w)):(e instanceof HTMLElement?void 0:k(!1),s=e.offsetHeight+e.offsetTop,c=t.offsetHeight+n.y,r=s-c,r>0&&p.setTop(t,p.getTop(t)+r+w)))},t.prototype._renderBlockMap=function(e){var t=this.props.DraftEditorBlocks;return l.createElement(t,s({},this.props,{blockMap:e}))},t.prototype._renderChildren=function(){var e=this,t=this.props.block,n=t.getKey(),r=t.getText(),o=this.props.tree.size-1,i=C(this.props.selection,n);return this.props.tree.map(function(a,f){var p,g,y,m,v,b,k=a.get("leaves"),w=k.size-1,C=k.map(function(a,s){var p=u.encode(n,f,s),g=a.get("start"),d=a.get("end");return l.createElement(c,{key:p,offsetKey:p,block:t,start:g,selection:i?e.props.selection:null,forceSelection:e.props.forceSelection,text:r.slice(g,d),styleSet:t.getInlineStyleAt(g),customStyleMap:e.props.customStyleMap,customStyleFn:e.props.customStyleFn,isLast:f===o&&s===w})}).toArray(),x=a.get("decoratorKey");return null==x?C:e.props.decorator?(p=S(e.props.decorator),(g=p.getComponentForKey(x))?(y=p.getPropsForKey(x),m=u.encode(n,f,0),v=r.slice(k.first().get("start"),k.last().get("end")),b=h.getHTMLDirIfDifferent(d.getDirection(v),e.props.direction),l.createElement(g,s({},y,{contentState:e.props.contentState,decoratedText:v,dir:b,key:m,entityKey:t.getEntityAt(a.get("start")),offsetKey:m}),C)):C):C}).toArray()},t.prototype.render=function(){var e=this.props,t=e.direction,n=e.offsetKey,r=e.blockMap,o=y({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":"LTR"===t,"public/DraftStyleDefault/rtl":"RTL"===t});return r&&r.size&&r.size>0?this._renderBlockMap(r):l.createElement("div",{"data-offset-key":n,className:o},this._renderChildren())},t}(l.Component);e.exports=x},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(1),s=a.Record,c=s({type:"TOKEN",mutability:"IMMUTABLE",data:Object}),u=function(e){function t(){return r(this,t),o(this,e.apply(this,arguments))}return i(t,e),t.prototype.getType=function(){return this.get("type")},t.prototype.getMutability=function(){return this.get("mutability")},t.prototype.getData=function(){return this.get("data")},t}(c);e.exports=u},function(e,t,n){"use strict";function r(e,t){var n=t?f.exec(e):u.exec(e);return n?n[0]:e}var o=n(133),i=o.getPunctuation(),a="['‘’]",s="\\s|(?![_])"+i,c="^(?:"+s+")*(?:"+a+"|(?!"+s+").)*(?:(?!"+s+").)",u=new RegExp(c),l="(?:(?!"+s+").)(?:"+a+"|(?!"+s+").)*(?:"+s+")*$",f=new RegExp(l),p={getBackward:function(e){return r(e,!0)},getForward:function(e){return r(e,!1)}};e.exports=p},function(e,t){"use strict";var n={stringify:function(e){return"_"+String(e)},unstringify:function(e){return e.slice(1)}};e.exports=n},function(e,t,n){"use strict";var r=n(5),o=n(3),i=(n(16),n(83)),a=n(7),s={currentBlockContainsLink:function(e){var t=e.getSelection(),n=e.getCurrentContent(),r=n.getEntityMap();return n.getBlockForKey(t.getAnchorKey()).getCharacterList().slice(t.getStartOffset(),t.getEndOffset()).some(function(e){var t=e.getEntity();return!!t&&"LINK"===r.__get(t).getType()})},getCurrentBlockType:function(e){var t=e.getSelection();return e.getCurrentContent().getBlockForKey(t.getStartKey()).getType()},getDataObjectForLinkURL:function(e){return{url:e.toString()}},handleKeyCommand:function(e,t){switch(t){case"bold":return s.toggleInlineStyle(e,"BOLD");case"italic":return s.toggleInlineStyle(e,"ITALIC");case"underline":return s.toggleInlineStyle(e,"UNDERLINE");case"code":return s.toggleCode(e);case"backspace":case"backspace-word":case"backspace-to-start-of-line":return s.onBackspace(e);case"delete":case"delete-word":case"delete-to-end-of-block":return s.onDelete(e);default:return null}},insertSoftNewline:function(e){var t=r.insertText(e.getCurrentContent(),e.getSelection(),"\n",e.getCurrentInlineStyle(),null),n=o.push(e,t,"insert-characters");return o.forceSelection(n,t.getSelectionAfter())},onBackspace:function(e){var t,n,r,i,a,c,u=e.getSelection();return!u.isCollapsed()||u.getAnchorOffset()||u.getFocusOffset()?null:(t=e.getCurrentContent(),n=u.getStartKey(),r=t.getBlockBefore(n),r&&"atomic"===r.getType()&&(i=t.getBlockMap().delete(r.getKey()),a=t.merge({blockMap:i,selectionAfter:u}),a!==t)?o.push(e,a,"remove-range"):(c=s.tryToRemoveBlockStyle(e),c?o.push(e,c,"change-block-type"):null))},onDelete:function(e){var t,n,i,a,s,c,u,l=e.getSelection();return l.isCollapsed()?(t=e.getCurrentContent(),n=l.getStartKey(),i=t.getBlockForKey(n),a=i.getLength(),l.getStartOffset()0&&o!==i)return null;if(a=o.getType(),s=n.getBlockBefore(t),"code-block"===a&&s&&"code-block"===s.getType()&&0!==s.getLength())return null;if("unstyled"!==a)return r.setBlockType(n,c,"unstyled")}return null}};e.exports=s},function(e,t,n){"use strict";var r=n(9),o=r||function(e){var t,n,r;for(t=1;t=0?e.add("BOLD"):O.indexOf(t)>=0&&e.remove("BOLD"),"italic"===n?e.add("ITALIC"):"normal"===n&&e.remove("ITALIC"),"underline"===o&&e.add("UNDERLINE"),"line-through"===o&&e.add("STRIKETHROUGH"),"none"===o&&(e.remove("UNDERLINE"),e.remove("STRIKETHROUGH"))}).toOrderedSet()),n},D=function(e,t,n,r,o){var i=e.text.slice(-1),a=t.text.slice(0,1);return"\r"===i&&"\r"===a&&"paragraph"===e.blocks[e.blocks.length-1].type&&"paragraph"!==t.blocks[0].type&&(e.text=e.text.split("\r")[0]), +"\r"===i&&"\r"===a&&"paragraph"===e.blocks[e.blocks.length-1].type&&"paragraph"===t.blocks[0].type&&(e.text=e.text.split("\r")[0]),{text:r&&!o?e.text.split("\r").concat(t.text.split("\r")).join("\r"):e.text+t.text,inlines:e.inlines.concat(t.inlines),entities:e.entities.concat(t.entities),blocks:o?t.blocks:e.blocks.concat(t.blocks)}},L=function(e,t){return t.some(function(t){return e.indexOf("<"+t)!==-1})},R=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o({},B,e)},F=function(e,t,n){return{text:"\r",inlines:[m()],entities:new Array(1),blocks:[R({parentKey:n||"",key:g(),type:e,depth:Math.max(0,Math.min(k,t))})]}},N=function e(t,n,r,i,a,s,c,u,l,f){var p,d,h,y,m,v,b,k,S,w=n.nodeName.toLowerCase(),C=t,x=o({},K),E=null,O=!1;if("#text"===w)return p=n.textContent,{chunk:{text:p,inlines:Array(p.length).fill(r),entities:Array(p.length).fill(l),blocks:[{depth:c,key:g(),parentKey:f||"",type:"paragraph"}]},entityMap:t};if("br"===w)return{chunk:{text:"",inlines:[],entities:[],blocks:[{depth:c,key:g(),parentKey:f||"",type:"paragraph"}]},entityMap:t};for(r=A(w,n,r),d=M(w),"ul"!==w&&"ol"!==w||(E=F(d,c,f),x=D(x,E),f=x.blocks[0].key),"li"===w&&(E=F(d,c,f),x=D(x,E),f=x.blocks[0].key),"table"===w&&(E=F(d,c,f),x=D(x,E),f=x.blocks[0].key),"tbody"===w&&(E=F(d,c,f),x=D(x,E),f=x.blocks[0].key),"tr"===w&&(E=F(d,c,f),x=D(x,E),f=x.blocks[0].key),"td"===w&&(E=F(d,c,f),x=D(x,E),f=x.blocks[0].key),h=n.firstChild,h&&"span"===h.nodeName.toLowerCase()&&(O=!0),y=null,m=!1;h;)y=void 0,v=e(C,h,r,i,!0,s,c,u,y||l,f),b=v.chunk,k=v.entityMap,E=b,C=k,x=D(x,E,a,m,O),S=h.nextSibling,S&&(m=!0,w=S.nodeName.toLowerCase()),h=S;return{chunk:x,entityMap:C}},I=function(e,t,n,r){var i,a,s,c,u,l;return e=e.trim().replace(S,"").replace(w,b).replace(C,"").replace(x,""),i=_(n),(a=t(e))?(s=L(e,i)?i:["div"],c=N(r,a,m(),"ul",null,s,-1,n),u=c.chunk,l=c.entityMap,0===u.blocks.length&&u.blocks.push(o({},K,{type:"paragraph",depth:0})),{chunk:u,entityMap:l}):null},P=function(e){var t,n,r,o,s,c,u;return e&&e.text&&Array.isArray(e.blocks)?(t={cacheRef:{},contentBlocks:[]},n=0,r=e.blocks,o=e.inlines,s=e.entities,c=a,u=e.text.split("\r"),u.reduce(function(e,t,a){var u,l,f,p,d,m,v,b,k,S,w,C;return t=h(t),u=r[a],l=n+(t.length?t.length:1),f=o.slice(n,l),p=s.slice(n,l),d=y(f.map(function(e,t){var n={style:e,entity:null};return p[t]&&(n.entity=p[t]),i.create(n)})),n=l,u?(m=u.depth,v=u.type,b=u.parentKey,k=u.key||g(),S=null,w=new c({key:k,parentKey:b,type:v,depth:m,text:t,characterList:d,prevSibling:S||(0===a||r[a-1].parent!==parent?null:r[a-1].key),nextSibling:a===r.length-1||r[a+1].parent!==parent?null:r[a+1].key}),e.contentBlocks.push(w),e.cacheRef[w.key]=a,e):(C=new c({key:g(),parentKey:"",type:"paragraph",depth:0,text:"",characterList:y()}),e.contentBlocks.push(C),e.cacheRef[C.key]=a,e)},t).contentBlocks):null},j=function(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s,a=I(e,o,i,c);return null==a?null:(t=a.chunk,n=a.entityMap,r=P(t),{contentBlocks:r,entityMap:n})};e.exports=j},function(e,t,n){"use strict";function r(e){return f&&e.altKey||h(e)}function o(e){return d(e)?e.shiftKey?"redo":"undo":null}function i(e){return p&&e.shiftKey?null:r(e)?"delete-word":"delete"}function a(e){return d(e)&&f?"backspace-to-start-of-line":r(e)?"backspace-word":"backspace"}function s(e){switch(e.keyCode){case 66:return d(e)?"bold":null;case 68:return h(e)?"delete":null;case 72:return h(e)?"backspace":null;case 73:return d(e)?"italic":null;case 74:return d(e)?"code":null;case 75:return!p&&h(e)?"secondary-cut":null;case 77:return h(e)?"split-block":null;case 79:return h(e)?"split-block":null;case 84:return f&&h(e)?"transpose-characters":null;case 85:return d(e)?"underline":null;case 87:return f&&h(e)?"backspace-word":null;case 89:return h(e)?p?"redo":"secondary-paste":null;case 90:return o(e)||null;case u.RETURN:return"split-block";case u.DELETE:return i(e);case u.BACKSPACE:return a(e);case u.LEFT:return g&&d(e)?"move-selection-to-start-of-block":null;case u.RIGHT:return g&&d(e)?"move-selection-to-end-of-block":null;default:return null}}var c=n(27),u=n(33),l=n(8),f=l.isPlatform("Mac OS X"),p=l.isPlatform("Windows"),g=f&&l.isBrowser("Firefox < 29"),d=c.hasCommandModifier,h=c.isCtrlKeyCommand;e.exports=s},function(e,t,n){"use strict";function r(e,t,n,r,o,i){var s,u,f,g=n.nodeType===Node.TEXT_NODE,d=o.nodeType===Node.TEXT_NODE;return g&&d?{selectionState:l(e,p(c(n)),r,p(c(o)),i),needsRecovery:!1}:(s=null,u=null,f=!0,g?(s={key:p(c(n)),offset:r},u=a(t,o,i)):d?(u={key:p(c(o)),offset:i},s=a(t,n,r)):(s=a(t,n,r),u=a(t,o,i),n===o&&r===i&&(f=!!n.firstChild&&"BR"!==n.firstChild.nodeName)),{selectionState:l(e,s.key,s.offset,u.key,u.offset),needsRecovery:f})}function o(e){for(;e.firstChild&&(e.firstChild instanceof Element&&"true"===e.firstChild.getAttribute("data-blocks")||u(e.firstChild));)e=e.firstChild;return e}function i(e){for(;e.lastChild&&(e.lastChild instanceof Element&&"true"===e.lastChild.getAttribute("data-blocks")||u(e.lastChild));)e=e.lastChild;return e}function a(e,t,n){var r,a,l,g,d,h,y=t,m=c(y);return null!=m||e&&(e===y||e.firstChild===y)?void 0:f(!1),e===y&&(y=y.firstChild,y instanceof Element&&"true"===y.getAttribute("data-contents")?void 0:f(!1),n>0&&(n=y.childNodes.length)),0===n?(r=null,null!=m?r=m:(a=o(y),r=p(u(a))),{key:r,offset:0}):(l=y.childNodes[n-1],g=null,d=null,u(l)?(h=i(l),g=p(u(h)),d=s(h)):(g=p(m),d=s(l)),{key:g,offset:d})}function s(e){var t=e.textContent;return"\n"===t?0:t.length}var c=n(28),u=n(52),l=n(54),f=n(2),p=n(7);e.exports=r},function(e,t,n){"use strict";function r(e){var t=e.getSelection();return t.isCollapsed()?null:o(e.getCurrentContent(),t)}var o=n(26);e.exports=r},function(e,t,n){"use strict";function r(e){var t,n,r,o,a=e.cloneRange(),s=[];for(t=e.endContainer;null!=t;t=t.parentNode){if(n=t===e.commonAncestorContainer,n?a.setStart(e.startContainer,e.startOffset):a.setStart(a.endContainer,0),r=Array.from(a.getClientRects()),s.push(r),n)return s.reverse(),(o=[]).concat.apply(o,s);a.setEndBefore(t)}i(!1)}var o=n(8),i=n(2),a=o.isBrowser("Chrome"),s=a?r:function(e){return Array.from(e.getClientRects())};e.exports=s},function(e,t,n){"use strict";function r(e){var t,n=null;return!a&&document.implementation&&document.implementation.createHTMLDocument&&(t=document.implementation.createHTMLDocument("foo"),t.documentElement?void 0:i(!1),t.documentElement.innerHTML=e,n=t.getElementsByTagName("body")[0]),n}var o=n(8),i=n(2),a=o.isBrowser("IE <= 9");e.exports=r},function(e,t){"use strict";function n(e){var t,r,o;if(e instanceof Element){if(t=e.getAttribute("data-offset-key"))return t;for(r=0;rc.getText().length-i?(s=a.getKeyAfter(o),n=0):n=i+t,r.merge({focusKey:s,focusOffset:n})}e.exports=n},function(e,t,n){"use strict";function r(e,t){var n,r,o,a,s=e.getBlockMap(),c=e.getEntityMap(),u={},l=t.getStartKey(),f=t.getStartOffset(),p=s.get(l),g=i(c,p,f);return g!==p&&(u[l]=g),n=t.getEndKey(),r=t.getEndOffset(),o=s.get(n),l===n&&(o=g),a=i(c,o,r),a!==o&&(u[n]=a),Object.keys(u).length?e.merge({blockMap:s.merge(u),selectionAfter:t}):e.set("selectionAfter",t)}function o(e,t,n){var r;return s(e,function(e,t){return e.getEntity()===t.getEntity()},function(e){return e.getEntity()===t},function(e,t){e<=n&&t>=n&&(r={start:e,end:t})}),"object"!=typeof r?c(!1):void 0,r}function i(e,t,n){var r,i,s,c,u,l=t.getCharacterList(),f=n>0?l.get(n-1):void 0,p=n0},e}();e.exports=f},function(e,t){"use strict";function n(e,t){return!!t&&(e===t.documentElement||e===t.body)}var r={getTop:function(e){var t=e.ownerDocument;return n(e,t)?t.body.scrollTop||t.documentElement.scrollTop:e.scrollTop},setTop:function(e,t){var r=e.ownerDocument;n(e,r)?r.body.scrollTop=r.documentElement.scrollTop=t:e.scrollTop=t},getLeft:function(e){var t=e.ownerDocument;return n(e,t)?t.body.scrollLeft||t.documentElement.scrollLeft:e.scrollLeft},setLeft:function(e,t){var r=e.ownerDocument;n(e,r)?r.body.scrollLeft=r.documentElement.scrollLeft=t:e.scrollLeft=t}};e.exports=r},function(e,t,n){"use strict";function r(e){var t=p.exec(e);return null==t?null:t[0]}function o(e){var t=r(e);return null==t?u.NEUTRAL:g.exec(t)?u.RTL:u.LTR}function i(e,t){if(t=t||u.NEUTRAL,!e.length)return t;var n=o(e);return n===u.NEUTRAL?t:n}function a(e,t){return t||(t=u.getGlobalDir()),u.isStrong(t)?void 0:l(!1),i(e,t)}function s(e,t){return a(e,t)===u.LTR}function c(e,t){return a(e,t)===u.RTL}var u=n(35),l=n(2),f={L:"A-Za-zªµºÀ-ÖØ-öø-ƺƻƼ-ƿǀ-ǃDŽ-ʓʔʕ-ʯʰ-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͷͺͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҂Ҋ-ԯԱ-Ֆՙ՚-՟ա-և։ःऄ-हऻऽा-ीॉ-ौॎ-ॏॐक़-ॡ।-॥०-९॰ॱॲ-ঀং-ঃঅ-ঌএ-ঐও-নপ-রলশ-হঽা-ীে-ৈো-ৌৎৗড়-ঢ়য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽા-ીૉો-ૌૐૠ-ૡ૦-૯૰ଂ-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽାୀେ-ୈୋ-ୌୗଡ଼-ଢ଼ୟ-ୡ୦-୯୰ୱ୲-୷ஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹா-ிு-ூெ-ைொ-ௌௐௗ௦-௯௰-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౙౠ-ౡ౦-౯౿ಂ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽಾಿೀ-ೄೆೇ-ೈೊ-ೋೕ-ೖೞೠ-ೡ೦-೯ೱ-ೲം-ഃഅ-ഌഎ-ഐഒ-ഺഽാ-ീെ-ൈൊ-ൌൎൗൠ-ൡ൦-൯൰-൵൹ൺ-ൿං-ඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-ෳ෴ก-ะา-ำเ-ๅๆ๏๐-๙๚-๛ກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆ໐-໙ໜ-ໟༀ༁-༃༄-༒༓༔༕-༗༚-༟༠-༩༪-༳༴༶༸༾-༿ཀ-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿏࿐-࿔࿕-࿘࿙-࿚က-ဪါ-ာေးျ-ြဿ၀-၉၊-၏ၐ-ၕၖ-ၗၚ-ၝၡၢ-ၤၥ-ၦၧ-ၭၮ-ၰၵ-ႁႃ-ႄႇ-ႌႎႏ႐-႙ႚ-ႜ႞-႟Ⴀ-ჅჇჍა-ჺ჻ჼჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፨፩-፼ᎀ-ᎏᎠ-Ᏼᐁ-ᙬ᙭-᙮ᙯ-ᙿᚁ-ᚚᚠ-ᛪ᛫-᛭ᛮ-ᛰᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵-᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះ-ៈ។-៖ៗ៘-៚ៜ០-៩᠐-᠙ᠠ-ᡂᡃᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰ-ᤱᤳ-ᤸ᥆-᥏ᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧀᧁ-ᧇᧈ-ᧉ᧐-᧙᧚ᨀ-ᨖᨙ-ᨚ᨞-᨟ᨠ-ᩔᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪦ᪧ᪨-᪭ᬄᬅ-ᬳᬵᬻᬽ-ᭁᭃ-᭄ᭅ-ᭋ᭐-᭙᭚-᭠᭡-᭪᭴-᭼ᮂᮃ-ᮠᮡᮦ-ᮧ᮪ᮮ-ᮯ᮰-᮹ᮺ-ᯥᯧᯪ-ᯬᯮ᯲-᯳᯼-᯿ᰀ-ᰣᰤ-ᰫᰴ-ᰵ᰻-᰿᱀-᱉ᱍ-ᱏ᱐-᱙ᱚ-ᱷᱸ-ᱽ᱾-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳱᳲ-ᳳᳵ-ᳶᴀ-ᴫᴬ-ᵪᵫ-ᵷᵸᵹ-ᶚᶛ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℴℵ-ℸℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↂↃ-ↄↅ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⱻⱼ-ⱽⱾ-ⳤⳫ-ⳮⳲ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々〆〇〡-〩〮-〯〱-〵〸-〺〻〼ぁ-ゖゝ-ゞゟァ-ヺー-ヾヿㄅ-ㄭㄱ-ㆎ㆐-㆑㆒-㆕㆖-㆟ㆠ-ㆺㇰ-ㇿ㈀-㈜㈠-㈩㈪-㉇㉈-㉏㉠-㉻㉿㊀-㊉㊊-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿌ꀀ-ꀔꀕꀖ-ꒌꓐ-ꓷꓸ-ꓽ꓾-꓿ꔀ-ꘋꘌꘐ-ꘟ꘠-꘩ꘪ-ꘫꙀ-ꙭꙮꚀ-ꚛꚜ-ꚝꚠ-ꛥꛦ-ꛯ꛲-꛷Ꜣ-ꝯꝰꝱ-ꞇ꞉-꞊Ꞌ-ꞎꞐ-ꞭꞰ-Ʇꟷꟸ-ꟹꟺꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꠣ-ꠤꠧ꠰-꠵꠶-꠷ꡀ-ꡳꢀ-ꢁꢂ-ꢳꢴ-ꣃ꣎-꣏꣐-꣙ꣲ-ꣷ꣸-꣺ꣻ꤀-꤉ꤊ-ꤥ꤮-꤯ꤰ-ꥆꥒ-꥓꥟ꥠ-ꥼꦃꦄ-ꦲꦴ-ꦵꦺ-ꦻꦽ-꧀꧁-꧍ꧏ꧐-꧙꧞-꧟ꧠ-ꧤꧦꧧ-ꧯ꧰-꧹ꧺ-ꧾꨀ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-꩟ꩠ-ꩯꩰꩱ-ꩶ꩷-꩹ꩺꩻꩽꩾ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ꫜꫝ꫞-꫟ꫠ-ꫪꫫꫮ-ꫯ꫰-꫱ꫲꫳ-ꫴꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚ꭛ꭜ-ꭟꭤ-ꭥꯀ-ꯢꯣ-ꯤꯦ-ꯧꯩ-ꯪ꯫꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-豈-舘並-龎ff-stﬓ-ﬗA-Za-zヲ-ッーア-ン゙-゚ᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",R:"֐־׀׃׆׈-׏א-ת׫-ׯװ-ײ׳-״׵-׿߀-߉ߊ-ߪߴ-ߵߺ߻-߿ࠀ-ࠕࠚࠤࠨ࠮-࠯࠰-࠾࠿ࡀ-ࡘ࡜-࡝࡞࡟-࢟‏יִײַ-ﬨשׁ-זּ﬷טּ-לּ﬽מּ﬿נּ-סּ﭂ףּ-פּ﭅צּ-ﭏ",AL:"؈؋؍؛؜؝؞-؟ؠ-ؿـف-ي٭ٮ-ٯٱ-ۓ۔ەۥ-ۦۮ-ۯۺ-ۼ۽-۾ۿ܀-܍܎܏ܐܒ-ܯ݋-݌ݍ-ޥޱ޲-޿ࢠ-ࢲࢳ-ࣣﭐ-ﮱ﮲-﯁﯂-﯒ﯓ-ﴽ﵀-﵏ﵐ-ﶏ﶐-﶑ﶒ-ﷇ﷈-﷏ﷰ-ﷻ﷼﷾-﷿ﹰ-ﹴ﹵ﹶ-ﻼ﻽-﻾"},p=new RegExp("["+f.L+f.R+f.AL+"]"),g=new RegExp("["+f.R+f.AL+"]"),d={firstStrongChar:r,firstStrongCharDir:o,resolveBlockDir:i,getDirection:a,isDirectionLTR:s,isDirectionRTL:c};e.exports=d},function(e,t){"use strict";function n(e){if(e=e||("undefined"!=typeof document?document:void 0),"undefined"==typeof e)return null;try{return e.activeElement||e.body}catch(t){return e.body}}e.exports=n},function(e,t,n){"use strict";var r=n(17),o=n(4),i=n(10),a=n(5),s=n(3),c=n(1),u=(n(16),n(6)),l=n(124),f=c.List,p=c.Repeat,g={insertAtomicBlock:function(e,t,n){var c=e.getCurrentContent(),l=e.getSelection(),g=a.removeRange(c,l,"backward"),d=g.getSelectionAfter(),h=a.splitBlock(g,d),y=h.getSelectionAfter(),m=a.setBlockType(h,y,"atomic"),v=o.create({entity:t}),b=[new i({key:u(),type:"atomic",text:n,characterList:f(p(v,n.length))}),new i({key:u(),type:"unstyled",text:"",characterList:f()})],k=r.createFromArray(b),S=a.replaceWithFragment(m,y,k),w=S.merge({selectionBefore:l,selectionAfter:S.getSelectionAfter().set("hasFocus",!0)});return s.push(e,w,"insert-fragment")},moveAtomicBlock:function(e,t,n,r){var o,i,c,u,f,p,g,d,h=e.getCurrentContent(),y=e.getSelection(),m=void 0;return"before"===r||"after"===r?(o=h.getBlockForKey("before"===r?n.getStartKey():n.getEndKey()),m=l(h,t,o,r)):(i=a.removeRange(h,n,"backward"),c=i.getSelectionAfter(),u=i.getBlockForKey(c.getFocusKey()),0===c.getStartOffset()?m=l(i,t,u,"before"):c.getEndOffset()===u.getLength()?m=l(i,t,u,"after"):(f=a.splitBlock(i,c),p=f.getSelectionAfter(),g=f.getBlockForKey(p.getFocusKey()),m=l(f,t,g,"before"))),d=m.merge({selectionBefore:y,selectionAfter:m.getSelectionAfter().set("hasFocus",!0)}),s.push(e,d,"move-block")}};e.exports=g},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t,n){for(var r=t;rM,G=g(G,a(L,V,X,P))),J=o||u,F={className:G,"data-block":!0,"data-editor":r.props.editorKey,"data-offset-key":j,key:D},void 0!==b&&(F=c({},F,{contentEditable:b,suppressContentEditableWarning:!0})),"custom"===q?(H.childProps=F,R=f.createElement(J,H)):R=f.createElement(q,F,f.createElement(J,H)),I?(A=[],B=f.cloneElement(I,{key:D+"-wrap","data-offset-key":j},A),K.push(B),M=e.getDepth(),d(A).push(R)):N?(W&&(A=[],B=f.cloneElement(N,{key:D+"-wrap","data-offset-key":j},A),_=N,K.push(B)),M=e.getDepth(),d(A).push(R)):(A=null,B=null,_=null,M=null,K.push(R))}),e="contents"===i||null,n=!e||null,[].concat(K)},t}(f.Component);e.exports=h},function(e,t,n){"use strict";var r=n(12),o=n(5),i=n(3),a=n(33),s=n(30),c=n(13),u=n(56),l=20,f=!1,p=!1,g="",d={onBeforeInput:function(e,t){g=(g||"")+t.data},onCompositionStart:function(e){p=!0},onCompositionEnd:function(e){f=!1,p=!1,setTimeout(function(){f||d.resolveComposition(e)},l)},onKeyDown:function(e,t){return p?void(t.which!==a.RIGHT&&t.which!==a.LEFT||t.preventDefault()):(d.resolveComposition(e),void e._onKeyDown(t))},onKeyPress:function(e,t){t.which===a.RETURN&&t.preventDefault()},resolveComposition:function(e){var t,n,a,l,d,h;if(!p){if(f=!0,t=g,g="",n=i.set(e._latestEditorState,{inCompositionMode:!1}),a=n.getCurrentInlineStyle(),l=s(n.getCurrentContent(),n.getSelection()),d=!t||u(n)||a.size>0||null!==l,d&&e.restoreEditorDOM(),e.exitCurrentMode(),t){if(r.draft_handlebeforeinput_composed_text&&e.props.handleBeforeInput&&c(e.props.handleBeforeInput(t,n)))return;return h=o.replaceText(n.getCurrentContent(),n.getSelection(),t,a,l),void e.update(i.push(n,h,"insert-characters"))}d&&e.update(i.set(n,{nativelyRenderedContent:null,forceSelection:!0}))}}};e.exports=d},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(67),s=(n(3),n(11)),c=n(7),u=n(156),l=function(e){function t(){var n,i,a,s,c,u;for(r(this,t),s=arguments.length,c=Array(s),u=0;u0){if(e.props.handleDroppedFiles&&p(e.props.handleDroppedFiles(f,n)))return;return void l(n,function(t){t&&e.update(i(u,f,t))})}if(s=e._internalDrag?"internal":"external",!e.props.handleDrop||!p(e.props.handleDrop(f,c,s)))return e._internalDrag?void e.update(o(u,f)):void e.update(i(u,f,c.getText()))}}};e.exports=d},function(e,t,n){"use strict";var r=n(91),o=n(92),i=n(93),a=n(94),s=n(95),c=n(96),u=n(97),l=n(98),f=n(99),p=n(100),g=n(101),d=n(102),h={onBeforeInput:r,onBlur:o,onCompositionStart:i,onCopy:a,onCut:s,onDragOver:c,onDragStart:u,onFocus:l,onInput:f,onKeyDown:p,onPaste:g,onSelect:d};e.exports=h},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(9),s=n(74),c=n(11),u=n(21),l=n(2),f=n(127),p=function(e){function t(){return r(this,t),o(this,e.apply(this,arguments))}return i(t,e),t.prototype._setSelection=function(){var e,t,n,r,o,i,a,s,c,p=this.props.selection;null!=p&&p.getHasFocus()&&(e=this.props,t=e.block,n=e.start,r=e.text,o=t.getKey(),i=n+r.length,p.hasEdgeWithin(o,n,i)&&(a=u.findDOMNode(this),a?void 0:l(!1),s=a.firstChild,s?void 0:l(!1),c=void 0,s.nodeType===Node.TEXT_NODE?c=s:"BR"===s.tagName?c=a:(c=s.firstChild,c?void 0:l(!1)),f(p,c,o,n,i)))},t.prototype.shouldComponentUpdate=function(e){var t=u.findDOMNode(this.leaf);return t?void 0:l(!1),t.textContent!==e.text||e.styleSet!==this.props.styleSet||e.forceSelection},t.prototype.componentDidUpdate=function(){this._setSelection()},t.prototype.componentDidMount=function(){this._setSelection()},t.prototype.render=function(){var e,t,n,r,o,i,u,l=this,f=this.props.block,p=this.props.text;return p.endsWith("\n")&&this.props.isLast&&(p+="\n"),e=this.props,t=e.customStyleMap,n=e.customStyleFn,r=e.offsetKey,o=e.styleSet,i=o.reduce(function(e,n){var r={},o=t[n];return void 0!==o&&e.textDecoration!==o.textDecoration&&(r.textDecoration=[e.textDecoration,o.textDecoration].join(" ").trim()),a(e,o,r)},{}),n&&(u=n(o,f),i=a(i,u)),c.createElement("span",{"data-offset-key":r,ref:function(e){return l.leaf=e},style:i},c.createElement(s,null,p))},t}(c.Component);e.exports=p},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(11),s=n(20),c=function(e){function t(){return r(this,t),o(this,e.apply(this,arguments))}return i(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.text!==e.text||this.props.editorState.getSelection().getHasFocus()!==e.editorState.getSelection().getHasFocus()},t.prototype.render=function(){var e=this.props.editorState.getSelection().getHasFocus(),t=s({"public/DraftEditorPlaceholder/root":!0,"public/DraftEditorPlaceholder/hasFocus":e}),n={whiteSpace:"pre-wrap"};return a.createElement("div",{className:t},a.createElement("div",{className:s("public/DraftEditorPlaceholder/inner"),id:this.props.accessibilityID,style:n},this.props.text))},t}(a.Component);e.exports=c},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){return f?"\n"===e.textContent:"BR"===e.tagName}var s=n(11),c=n(21),u=n(8),l=n(2),f=u.isBrowser("IE <= 11"),p=f?s.createElement("span",{key:"A","data-text":"true"},"\n"):s.createElement("br",{key:"A","data-text":"true"}),g=f?s.createElement("span",{key:"B","data-text":"true"},"\n"):s.createElement("br",{key:"B","data-text":"true"}),d=function(e){function t(n){r(this,t);var i=o(this,e.call(this,n));return i._forceFlag=!1,i}return i(t,e),t.prototype.shouldComponentUpdate=function(e){var t=c.findDOMNode(this),n=""===e.children;return t instanceof Element?void 0:l(!1),n?!a(t):t.textContent!==e.children},t.prototype.componentDidMount=function(){this._forceFlag=!this._forceFlag},t.prototype.componentDidUpdate=function(){this._forceFlag=!this._forceFlag},t.prototype.render=function(){return""===this.props.children?this._forceFlag?p:g:s.createElement("span",{key:this._forceFlag?"A":"B","data-text":"true"},this.props.children)},t}(s.Component);e.exports=d},function(e,t){"use strict";var n={getRemovalRange:function(e,t,n,r,o){var i,a,s,c,u,l,f,p,g,d=n.split(" ");for(d=d.map(function(e,t){if("forward"===o){if(t>0)return" "+e}else if(t0?(r=t[c-1],r?void 0:i(!1),void r.children.push(u)):void n.push(u)):(t={},void n.push(u))}),o({},e,{blocks:n})}};e.exports=u},function(e,t,n){"use strict";var r,o=n(1),i=n(134),a=n(7),s=o.OrderedMap,c={getDirectionMap:function(e,t){var n,c,u;return r?r.reset():r=new i,n=e.getBlockMap(),c=n.valueSeq().map(function(e){return a(r).getDirection(e.getText())}),u=s(n.keySeq().zip(c)),null!=t&&o.is(t,u)?t:u}};e.exports=c},function(e,t,n){"use strict";function r(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=t.getBlockBefore(e.getKey());r&&0!==t.getBlockChildren(r.getKey()).size&&!n(r);)r=t.getBlockBefore(r.getKey());return r||e}function o(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=t.getBlockAfter(e.getKey());r&&0!==t.getBlockChildren(r.getKey()).size&&t.getBlockAfter(r.getKey())&&!n(r);)r=t.getBlockAfter(r.getKey());return r||e}var i=n(4),a=n(10),s=n(22),c=n(23),u=n(3),l=n(1),f=n(29),p=n(6),g=n(129),d=n(130),h=l.List,y=l.Repeat,m="",v=h(y(i.create(),m.length)),b=new l.Map(new l.fromJS(c.toJS()).mergeDeep(new l.fromJS({blockquote:{nestingEnabled:!0},"unordered-list-item":{nestingEnabled:!0},"ordered-list-item":{nestingEnabled:!0}})).toJS()),k={DefaultBlockRenderMap:b,toggleBlockType:function(e,t){var n,r,o,i,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.DefaultBlockRenderMap,l=e.getCurrentContent(),p=e.getSelection(),g=l.getBlockForKey(p.getStartKey()),d=g.getKey(),h=c.get(g.getType()),y=h&&h.nestingEnabled,b=c.get(t),S=g.getParentKey(),w=l.getBlockForKey(S),C=w&&c.get(w.getType()),x=h&&b&&h.element===b.element,E=C&&b&&C.element===b.element,O=(y||b.nestingEnabled)&&t!==g.getType();return O?(n=l.getBlockMap(),E?(r=s.createFromBlockArray(n.map(function(e,n){return e===w?new a({key:e.getKey(),type:t,depth:e.getDepth(),text:e.getText(),characterList:e.getCharacterList()}):e===g?new a({key:e.getKey(),type:"unstyled",depth:e.getDepth(),text:e.getText(),characterList:e.getCharacterList()}):e}).toArray()),{editorState:u.push(e,r.merge({selectionBefore:p,selectionAfter:p.merge({anchorKey:d,anchorOffset:p.getAnchorOffset(),focusKey:d,focusOffset:p.getFocusOffset(),isBackward:!1})}),"change-block-type"),blockType:g.getType()}):(o=f(d),i=s.createFromBlockArray(n.map(function(e,t){return e===g?x?new a({key:d,type:"unstyled",depth:g.getDepth(),text:g.getText(),characterList:g.getCharacterList()}):[new a({key:d,type:g.getType(),depth:g.getDepth(),text:m,characterList:v}),new a({key:o,type:"unstyled",depth:0,text:g.getText(),characterList:g.getCharacterList()})]:e}).reduce(function(e,t){return e.concat(t)},[])),{editorState:u.push(e,i.merge({selectionBefore:p,selectionAfter:p.merge({anchorKey:x?d:o,anchorOffset:p.getAnchorOffset(),focusKey:x?d:o,focusOffset:p.getFocusOffset(),isBackward:!1})}),"change-block-type"),blockType:t})):{editorState:e,blockType:t}},handleKeyCommand:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:b,r=e.getSelection(),o=e.getCurrentContent(),i=r.getAnchorKey(),a=o.getBlockForKey(i),s=o.getBlockChildren(i),c=a.getParentKey(),u=o.getBlockForKey(c),l=o.getBlockAfter(i),f=n.get(a.getType()),p=u&&n.get(u.getType()),g=f&&f.nestingEnabled,d=f&&f.wrapper,h=p&&p.wrapper;switch("split-block"===t&&(!a.hasParent()||g&&0!==a.getLength()||!(!l||d&&l.getType()!==a.getType()||l.getParentKey()!==a.getParentKey()&&(0===a.getLength()||h))||(t="split-parent-block"),"split-block"===t&&s.size>0&&(t="split-nested-block")),g||"split-nested-block"!==t||(t="split-block"),t){case"backspace":return k.onBackspace(e,n);case"delete":return k.onDelete(e,n);case"split-nested-block":return k.onSplitNestedBlock(e,n);case"split-parent-block":return k.onSplitParent(e,n);default:return null}},keyBinding:function(e){if(13===e.keyCode&&e.shiftKey)return"split-nested-block"},onBackspace:function(e){var t,n,o,i,c,l=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:b,e.getSelection()),f=l.isCollapsed(),p=e.getCurrentContent(),g=l.getAnchorKey(),d=p.getBlockForKey(g),h=p.getBlockBefore(g),y=f&&0===l.getEndOffset()&&h&&h.getKey()===d.getParentKey();return y?(t=r(d,p),t===d?null:(n=p.getBlockMap(),o=t.getKey(),i=s.createFromBlockArray(n.filter(function(e){return null!==e}).map(function(e,n){return t||h!==e?t&&e===t?new a({key:o,type:t.getType(),depth:t.getDepth(),text:t.getText()+d.getText(),characterList:t.getCharacterList().concat(d.getCharacterList())}):e:[new a({key:o,type:d.getType(),depth:d.getDepth(),text:d.getText(),characterList:d.getCharacterList()}),e]}).filter(function(e){return e!==d}).reduce(function(e,t){return e.concat(t)},[])),c=i.getBlockForKey(o).getLength(),u.push(e,i.merge({selectionBefore:l,selectionAfter:l.merge({anchorKey:o,anchorOffset:c,focusKey:o,focusOffset:c,isBackward:!1})}),"backspace-character"))):null},onDelete:function(e){var t,n,r,i,c=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:b,e.getSelection()),l=e.getCurrentContent(),f=c.getAnchorKey(),p=l.getBlockForKey(f),g=l.getBlockAfter(f),d=c.isCollapsed(),h=g&&d&&c.getEndOffset()===p.getLength()&&l.getBlockChildren(g.getKey()).size;return h?(t=l.getBlockMap(),n=o(p,l),r=s.createFromBlockArray(t.filter(function(e){return null!==e}).map(function(e,t){return e===p?new a({key:f,type:p.getType(),depth:p.getDepth(),text:p.getText()+n.getText(),characterList:p.getCharacterList().concat(n.getCharacterList())}):e}).filter(function(e){return e!==n}).reduce(function(e,t){return e.concat(t)},[])),i=p.getLength(),u.push(e,r.merge({selectionBefore:c,selectionAfter:c.merge({anchorKey:f,anchorOffset:i,focusKey:f,focusOffset:i,isBackward:!1})}),"delete-character")):null},onSplitNestedBlock:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:b,e.getSelection()),n=e.getCurrentContent();return u.push(e,g(n,t),"split-block")},onSplitCurrentBlock:function(e,t){return d(e,t)},onSplitParent:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b,n=e.getSelection(),r=e.getCurrentContent(),o=n.getAnchorKey(),i=r.getBlockForKey(o),c=i.getParentKey(),l=r.getBlockForKey(c),g=t.get(i.getType()),d=l&&t.get(l.getType()),h=g&&g.wrapper,y=d&&d.wrapper,m=r.getBlockMap(),v=h?f(c):l&&l.getParentKey()?f(l.getParentKey()):p(),k=s.createFromBlockArray(m.filter(function(e){return null!==e}).map(function(e,t){var s,c;return e===i?(s=y||!h&&l.getParentKey()?l.getType():"unstyled",c=new a({key:v,type:s,depth:l?l.getDepth():0,text:i.getText().slice(n.getEndOffset()),characterList:i.getCharacterList().slice(n.getEndOffset())}),0===i.getLength()&&0===r.getBlockChildren(o).size?c:[new a({key:e.getKey(),type:e.getType(),depth:e.getDepth(),text:i.getText().slice(0,n.getStartOffset()),characterList:i.getCharacterList().slice(0,n.getStartOffset())}),c]):e}).filter(function(e){return null!==e}).reduce(function(e,t){return e.concat(t)},[]));return u.push(e,k.merge({selectionBefore:n,selectionAfter:n.merge({anchorKey:v,anchorOffset:0,focusKey:v,focusOffset:0,isBackward:!1})}),"split-block")}};e.exports=k},function(e,t,n){"use strict";var r=n(5),o=n(3),i=n(26),a=n(7),s=null,c={cut:function(e){var t,n,c,u=e.getCurrentContent(),l=e.getSelection(),f=null;if(l.isCollapsed()){if(t=l.getAnchorKey(),n=u.getBlockForKey(t).getLength(),n===l.getAnchorOffset())return e;f=l.set("focusOffset",n)}else f=l;return f=a(f),s=i(u,f),c=r.removeRange(u,f,"forward"),c===u?e:o.push(e,c,"remove-range")},paste:function(e){if(!s)return e;var t=r.replaceWithFragment(e.getCurrentContent(),e.getSelection(),s);return o.push(e,t,"insert-fragment")}};e.exports=c},function(e,t){"use strict";function n(e,t,n,r){var o=t.getStartKey(),i=t.getEndKey(),a=e.getBlockMap(),s=a.toSeq().skipUntil(function(e,t){return t===o}).takeUntil(function(e,t){return t===i}).concat([[i,a.get(i)]]).map(function(e){var t=e.getDepth()+n;return t=Math.max(0,Math.min(t,r)),e.set("depth",t)});return a=a.merge(s),e.merge({blockMap:a,selectionBefore:t,selectionAfter:t})}e.exports=n},function(e,t,n){"use strict";function r(e,t,n,r){for(var i=e.getCharacterList();t0;){if(l=u.pop(),f=l.parentRef,p=f.getChildKeys(),g=p.indexOf(l.key),d=Array.isArray(l.children),!d){d?void 0:m(!1);break}h=l.children.map(x),y=new a(o({},w(l,t),{parent:f.getKey(),children:b(h.map(function(e){return e.key})),prevSibling:0===g?null:p.get(g-1),nextSibling:g===p.size-1?null:p.get(g+1)})),n=n.set(y.getKey(),y),u=E(u,h,y)}return n},S())},T=function(e,t){return S(e.map(function(e){var n=new i(w(e,t));return[n.getKey(),n]}))},K=function(e,t){var n=Array.isArray(e.blocks[0].children),r=v&&!n?l.fromRawStateToRawTreeState(e).blocks:e.blocks;return v?O(r,t):T(n?l.fromRawTreeStateToRawState(e).blocks:r,t)},B=function(e){var t=e.entityMap,n={};return Object.keys(t).forEach(function(e){var r=t[e],o=r.type,i=r.mutability,a=r.data;n[e]=c.__create(o,i,a||{})}),n},_=function(e){var t,n,r;return Array.isArray(e.blocks)?void 0:m(!1),t=B(e),n=K(e,t),r=n.isEmpty()?new p:p.createEmpty(n.first().getKey()),new s({blockMap:n,entityMap:t,selectionBefore:r,selectionAfter:r})};e.exports=_},function(e,t,n){"use strict";function r(e,t){var n=e.map(function(e,n){var r=t[n];return o.create({style:e,entity:r})});return a(n)}var o=n(4),i=n(1),a=i.List;e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=Array(e.length).fill(null);return t&&t.forEach(function(t){var r,o=i(e,0,t.offset).length,a=o+i(e,t.offset,t.length).length;for(r=o;r0)){if(e.props.handlePastedFiles&&h(e.props.handlePastedFiles(r)))return;return void d(r,function(t){var n,r,o,i,c,d,h;t=t||m,t&&(n=e._latestEditorState,r=y(t),o=s.create({style:n.getCurrentInlineStyle(),entity:g(n.getCurrentContent(),n.getSelection())}),i=p.getCurrentBlockType(n),c=l.processText(r,o,i),d=a.createFromArray(c),h=u.replaceWithFragment(n.getCurrentContent(),n.getSelection(),d),e.update(f.push(n,h,"insert-fragment")))})}if(v=[],b=n.getText(),k=n.getHTML(),S=e._latestEditorState,w=e.props.handlePastedText&&h(e.props.handlePastedText(b,k,S)),!w){if(b&&(v=y(b)),!e.props.stripPastedStyles){if(C=e.getClipboard(),n.isRichText()&&C){if(k.indexOf(e.getEditorKey())!==-1||1===v.length&&1===C.size&&C.first().getText()===b)return void e.update(o(e._latestEditorState,C))}else if(C&&n.types.includes("com.apple.webarchive")&&!n.types.includes("text/html")&&i(v,C))return void e.update(o(e._latestEditorState,C));if(k){if(x=document.createRange().createContextualFragment(k),E=x.querySelectorAll("meta"),O=[],E.forEach(function(e){var t=e.getAttribute("content");t&&O.push(t)}),O.length)return T=s.create({style:S.getCurrentInlineStyle(),entity:g(S.getCurrentContent(),S.getSelection())}),K=p.getCurrentBlockType(S),B=l.processText(v,T,K),_=a.createFromArray(B),void e.update(o(e._latestEditorState,_));if(M=l.processHTML(k,e.props.blockRenderMap),M&&(A=M.contentBlocks,D=M.entityMap,A))return L=a.createFromArray(A),void e.update(o(e._latestEditorState,L,D))}e.setClipboard(null)}v.length&&(T=s.create({style:S.getCurrentInlineStyle(),entity:g(S.getCurrentContent(),S.getSelection())}),K=p.getCurrentBlockType(S),B=l.processText(v,T,K),_=a.createFromArray(B),e.update(o(e._latestEditorState,_)))}}function o(e,t,n){var r=u.replaceWithFragment(e.getCurrentContent(),e.getSelection(),t);return f.push(e,r.set("entityMap",n),"insert-fragment")}function i(e,t){return e.length===t.size&&t.valueSeq().every(function(t,n){return t.getText()===e[n]})}var a=n(17),s=n(4),c=n(59),u=n(5),l=n(78),f=n(3),p=n(45),g=n(30),d=n(53),h=n(13),y=n(131);e.exports=r},function(e,t,n){"use strict";function r(e){var t,n,r,c;e._blockSelectEvents||e._latestEditorState!==e.props.editorState||(t=e.props.editorState,n=i.findDOMNode(e.editorContainer),n?void 0:s(!1),n.firstChild instanceof HTMLElement?void 0:s(!1),r=a(t,n.firstChild),c=r.selectionState,c!==t.getSelection()&&(t=r.needsRecovery?o.forceSelection(t,c):o.acceptSelection(t,c),e.update(t)))}var o=n(3),i=n(21),a=n(107),s=n(2);e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=[];return e.findEntityRanges(function(e){return!!e.getEntity()},function(r,i){var s=e.getText(),c=e.getEntityAt(r);n.push({offset:a(s.slice(0,r)),length:a(s.slice(r,i)),key:Number(t[o.stringify(c)])})}),n}var o=n(44),i=n(14),a=i.strlen;e.exports=r},function(e,t,n){"use strict";function r(e,t,n){var r=[],o=t.map(function(e){return e.has(n)}).toList();return a(o,s,c,function(t,o){var a=e.getText();r.push({offset:i.strlen(a.slice(0,t)),length:i.strlen(a.slice(t,o)),style:n})}),r}function o(e){var t=e.getCharacterList().map(function(e){return e.getStyle()}).toList(),n=t.flatten().toSet().map(function(n){return r(e,t,n)});return Array.prototype.concat.apply(u,n.toJS())}var i=n(14),a=n(18),s=function(e,t){return e===t},c=function(e){return!!e},u=[];e.exports=o},function(e,t,n){"use strict";function r(e){var t,n,r=getComputedStyle(e),o=document.createElement("div");return o.style.fontFamily=r.fontFamily,o.style.fontSize=r.fontSize,o.style.fontStyle=r.fontStyle,o.style.fontWeight=r.fontWeight,o.style.lineHeight=r.lineHeight,o.style.position="absolute",o.textContent="M",t=document.body,t?void 0:u(!1),t.appendChild(o),n=o.getBoundingClientRect(),t.removeChild(o),n.height}function o(e,t){var n,r,o=1/0,i=1/0,a=-(1/0),s=-(1/0);for(n=0;n=0;d--)if(!(null!=g&&d>0&&s.isSurrogatePair(g,d-1))){if(e.setStart(f,d),!o(c(e),n))break;a=f,l=d}if(d===-1||0===f.childNodes.length)break;f=f.childNodes[d],p=i(f)}return e.setStart(a,l),e}var s=n(14),c=n(50),u=n(2);e.exports=a},function(e,t,n){"use strict";function r(e,t,n,r,i){var a,s,c,u,l,f=r.getStartOffset(),p=r.getEndOffset(),g=t.getEntityAt(f),d=n.getEntityAt(p-1);return g||d?(a=r,g&&g===d?a=o(e,t,a,i,g,!0,!0):g&&d?(s=o(e,t,a,i,g,!1,!0),c=o(e,n,a,i,d,!1,!1),a=a.merge({anchorOffset:s.getAnchorOffset(),focusOffset:c.getFocusOffset(),isBackward:!1})):g?(u=o(e,t,a,i,g,!1,!0),a=a.merge({anchorOffset:u.getStartOffset(),isBackward:!1})):d&&(l=o(e,n,a,i,d,!1,!1),a=a.merge({focusOffset:l.getEndOffset(),isBackward:!1})),a):r}function o(e,t,n,r,o,c,u){var l,f,p,g=n.getStartOffset(),d=n.getEndOffset(),h=e.__get(o),y=h.getMutability(),m=u?g:d;return"MUTABLE"===y?n:(l=a(t,o).filter(function(e){return m<=e.end&&m>=e.start}),1!=l.length?s(!1):void 0,f=l[0],"IMMUTABLE"===y?n.merge({anchorOffset:f.start,focusOffset:f.end,isBackward:!1}):(c||(u?d=f.end:g=f.start),p=i.getRemovalRange(g,d,t.getText().slice(f.start,f.end),f.start,r),n.merge({anchorOffset:p.start,focusOffset:p.end,isBackward:!1})))}var i=n(75),a=n(109),s=n(2);e.exports=r},function(e,t,n){(function(t){"use strict";function r(e,n){var r=t.getSelection();return 0===r.rangeCount?{selectionState:e.getSelection().set("hasFocus",!1),needsRecovery:!1}:o(e,n,r.anchorNode,r.anchorOffset,r.focusNode,r.focusOffset)}var o=n(48);e.exports=r}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){var t,n,r,i,a=o(e),s=0,c=0,u=0,l=0;if(a.length)for(a.length>1&&0===a[0].width?(t=a[1],s=t.top,c=t.right,u=t.bottom,l=t.left):(n=a[0],s=n.top,c=n.right,u=n.bottom,l=n.left),r=1;rt;)e=e.pop(),n--;else r=e.slice(0,t),o=e.slice(n),e=r.concat(o).toList();return e}var i=n(1);e.exports=r},function(e,t,n){(function(t){"use strict";function r(e){var t=document.body.createTextRange,n=0===e.rangeCount||0===e.getRangeAt(0).getClientRects().length;t&&n?window.getSelection().removeAllRanges():e.removeAllRanges()}function o(){var e,t=document.createElement("div");t.style.position="absolute",document.body.appendChild(t),window.getSelection().removeAllRanges(),e=document.createRange();try{window.getSelection().addRange(e)}catch(e){}document.body.removeChild(t)}function i(e,t){var n,r,i,a,s=document.body.createTextRange;return s&&(n=0===e.rangeCount||0===e.getRangeAt(0).getClientRects().length,r=t.startOffset===t.endOffset,i=!e.anchorNode&&!e.focusNode,a=n&&r&&i)?(o(),void window.getSelection().addRange(t)):void e.addRange(t)}function a(e,t){if(!e)return"[empty]";var n=s(e,t);return n.nodeType===Node.TEXT_NODE?n.textContent:(n instanceof Element?void 0:y(!1),n.outerHTML)}function s(e,t){var n,r,o,i,a=void 0!==t?t(e):[];if(e.nodeType===Node.TEXT_NODE)return n=e.textContent.length,document.createTextNode("[text "+n+(a.length?" | "+a.join(", "):"")+"]");for(r=e.cloneNode(),1===r.nodeType&&a.length&&r.setAttribute("data-labels",a.join(", ")),o=e.childNodes,i=0;i=u,b=l===o&&i<=g&&a>=g,v&&b?(r(s),p(s,n,u-i,e),void f(s,n,g-i,e)):void(h?(b&&(r(s),p(s,n,g-i,e)),v&&(k=s.focusNode,S=s.focusOffset,r(s),p(s,n,u-i,e),k&&f(s,k,S,e))):(v&&(r(s),p(s,n,u-i,e)),b&&f(s,n,g-i,e)))}function f(e,t,n,r){var o,a,s=h();if(e.extend&&d(s,t)){if(n>u(t)&&g.logSelectionStateFailure({anonymizedDom:c(t),extraParams:JSON.stringify({offset:n}),selectionState:JSON.stringify(r.toJS())}),"None"!==e.type){o=t===e.focusNode;try{e.extend(t,n)}catch(i){throw g.logSelectionStateFailure({anonymizedDom:c(t,function(t){var n=[];return t===s&&n.push("active element"),t===e.anchorNode&&n.push("selection anchor node"),t===e.focusNode&&n.push("selection focus node"),n}),extraParams:JSON.stringify({activeElementName:s?s.nodeName:null,nodeIsFocus:t===e.focusNode,nodeWasFocus:o,selectionRangeCount:e.rangeCount,selectionAnchorNodeName:e.anchorNode?e.anchorNode.nodeName:null,selectionAnchorOffset:e.anchorOffset,selectionFocusNodeName:e.focusNode?e.focusNode.nodeName:null,selectionFocusOffset:e.focusOffset,message:i?""+i:null,offset:n},null,2),selectionState:JSON.stringify(r.toJS(),null,2)}),i}}}else e.rangeCount>0&&(a=e.getRangeAt(0),a.setEnd(t,n),i(e,a.cloneRange()))}function p(e,t,n,r){var o=document.createRange();n>u(t)&&g.logSelectionStateFailure({anonymizedDom:c(t),extraParams:JSON.stringify({offset:n}),selectionState:JSON.stringify(r.toJS())}),o.setStart(t,n),i(e,o.cloneRange())}var g=n(77),d=n(36),h=n(62),y=n(2);e.exports=l}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e,t){var n,r,o,c,u,l,f,p,g,d,h,y;return t.isCollapsed()?void 0:a(!1),n=t.getAnchorKey(),r=t.getAnchorOffset(),o=e.getBlockMap(),c=o.get(n),u=c.getText(),l=c.getCharacterList(),f=c.merge({text:u.slice(0,r),characterList:l.slice(0,r)}),p=i(),g=f.merge({key:p,text:u.slice(r),characterList:l.slice(r),data:s()}),d=o.toSeq().takeUntil(function(e){return e===c}),h=o.toSeq().skipUntil(function(e){return e===c}).rest(),y=d.concat([[f.getKey(),f],[g.getKey(),g]],h).toOrderedMap(),e.merge({blockMap:y,selectionBefore:t,selectionAfter:t.merge({anchorKey:p,anchorOffset:0,focusKey:p,focusOffset:0,isBackward:!1})})}var o=n(1),i=n(6),a=n(2),s=o.Map;e.exports=r},function(e,t,n){"use strict";function r(e,t){var n,r,o,u,l,f,p,g,d,h,y,m,v,b,k=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unstyled";return t.isCollapsed()?void 0:a(!1),n=t.getAnchorKey(),r=t.getAnchorOffset(),o=e.getBlockMap(),u=o.get(n),l=u.getText(),f=u.getCharacterList(),p=i(n),g=i(n),d=u.merge({text:"",characterList:c()}),h=new s({key:p,type:k,text:l.slice(0,r),characterList:f.slice(0,r)}),y=new s({key:g,type:k,text:l.slice(r),characterList:f.slice(r)}),m=o.toSeq().takeUntil(function(e){return e===u}),v=o.toSeq().skipUntil(function(e){return e===u}).rest(),b=m.concat([[d.getKey(),d],[h.getKey(),h],[y.getKey(),y]],v).toOrderedMap(),e.merge({blockMap:b,selectionBefore:t,selectionAfter:t.merge({anchorKey:g,anchorOffset:0,focusKey:g,focusOffset:0,isBackward:!1})})}var o=n(1),i=n(29),a=n(2),s=n(10),c=o.List;e.exports=r},function(e,t,n){"use strict";function r(e,t){var n,r,o,u,l,f,p,g,d,h,y,m,v;return t.isCollapsed()?void 0:a(!1),n=t.getAnchorKey(),r=t.getAnchorOffset(),o=e.getBlockMap(),u=o.get(n),l=u.getParentKey(),f=u.getText(),p=u.getCharacterList(),g=u.merge({text:f.slice(0,r),characterList:p.slice(0,r),key:i(),parentKey:l}),d=g.merge({key:i(),parentKey:l,text:f.slice(r),characterList:p.slice(r),data:c()}),h=u.merge({text:"",characterList:s(),parentKey:l}),y=o.toSeq().takeUntil(function(e){return e===u}),m=o.toSeq().skipUntil(function(e){return e===u}).rest(),0===g.text.length?(v=y.concat([[g.getKey(),g],[d.getKey(),d]],m).toOrderedMap(),e.merge({blockMap:v,selectionBefore:t,selectionAfter:t.merge({anchorKey:g.getKey(),anchorOffset:0,focusKey:g.getKey(),focusOffset:0,isBackward:!1})})):0!==g.text.length&&0===d.text.length?(v=y.concat([[g.getKey(),g],[h.getKey(),h]],m).toOrderedMap(),e.merge({blockMap:v,selectionBefore:t,selectionAfter:t.merge({anchorKey:h.getKey(),anchorOffset:0,focusKey:h.getKey(),focusOffset:0,isBackward:!1})})):(v=y.concat([[g.getKey(),g],[h.getKey(),h],[d.getKey(),d]],m).toOrderedMap(),e.merge({blockMap:v,selectionBefore:t,selectionAfter:t.merge({anchorKey:h.getKey(),anchorOffset:0,focusKey:h.getKey(),focusOffset:0,isBackward:!1})}))}var o=n(1),i=n(6),a=n(2),s=o.List,c=o.Map;e.exports=r},function(e,t){"use strict";function n(e){return e.split(r)}var r=/\r\n?|\n/g;e.exports=n},function(e,t){"use strict";function n(e){return e.split("/")}var r={isImage:function(e){return"image"===n(e)[0]},isJpeg:function(e){var t=n(e);return r.isImage(e)&&("jpeg"===t[1]||"pjpeg"===t[1])}};e.exports=r},function(e,t){"use strict";var n="[.,+*?$|#{}()'\\^\\-\\[\\]\\\\\\/!@%\"~=<>_:;・、。〈-】〔-〟:-?!-/[-`{-・⸮؟٪-٬؛،؍﴾﴿᠁।၊။‐-‧‰-⁞¡-±´-¸º»¿]";e.exports={getPunctuation:function(){return n}}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=n(61),i=n(35),a=n(2),s=function(){function e(t){r(this,e),t?i.isStrong(t)?void 0:a(!1):t=i.getGlobalDir(),this._defaultDir=t,this.reset()}return e.prototype.reset=function(){this._lastDir=this._defaultDir},e.prototype.getDirection=function(e){return this._lastDir=o.getDirection(e,this._lastDir),this._lastDir},e}();e.exports=s},function(e,t,n){"use strict";function r(e){return s[e]||e}function o(e){if(!e)return{major:"",minor:""};var t=e.split(".");return{major:t[0],minor:t[1]}}var i=n(154),a="Unknown",s={"Mac OS":"Mac OS X"},c=new i,u=c.getResult(),l=o(u.browser.version),f={browserArchitecture:u.cpu.architecture||a,browserFullVersion:u.browser.version||a,browserMinorVersion:l.minor||a,browserName:u.browser.name||a,browserVersion:u.browser.major||a,deviceName:u.device.model||a,engineName:u.engine.name||a,engineVersion:u.engine.version||a,platformArchitecture:u.cpu.architecture||a,platformName:r(u.os.name)||a,platformVersion:u.os.version||a,platformFullVersion:u.os.version||a};e.exports=f},function(e,t,n){"use strict";function r(e,t){var n=e.split(w);return n.length>1?n.some(function(e){return O.contains(e,t)}):(e=n[0].trim(),o(e,t))}function o(e,t){var n,r,o=e.split(C);return o.length>0&&o.length<=2?void 0:k(!1),1===o.length?i(o[0],t):(n=o[0],r=o[1],d(n)&&d(r)?void 0:k(!1),i(">="+n,t)&&i("<="+r,t))}function i(e,t){var n,r,o,i;if(e=e.trim(),""===e)return!0;switch(n=t.split(S),r=p(e),o=r.modifier,i=r.rangeComponents,o){case"<":return a(n,i);case"<=":return s(n,i);case">=":return u(n,i);case">":return l(n,i);case"~":case"~>":return f(n,i);default:return c(n,i)}}function a(e,t){return b(e,t)===-1}function s(e,t){var n=b(e,t);return n===-1||0===n}function c(e,t){return 0===b(e,t)}function u(e,t){var n=b(e,t);return 1===n||0===n}function l(e,t){return 1===b(e,t)}function f(e,t){var n,r,o=t.slice(),i=t.slice();return i.length>1&&i.pop(),n=i.length-1,r=parseInt(i[n],10),g(r)&&(i[n]=r+1+""),u(e,o)&&a(e,i)}function p(e){var t=e.split(S),n=t[0].match(x);return n?void 0:k(!1),{modifier:n[1],rangeComponents:[n[2]].concat(t.slice(1))}}function g(e){return!isNaN(e)&&isFinite(e)}function d(e){return!p(e).modifier}function h(e,t){for(var n=e.length;nt?1:e=|~>|~|>|)?\s*(.+)/,E=/^(\d*)(.*)/,O={contains:function(e,t){return r(e.trim(),t.trim())}};e.exports=O},function(e,t){"use strict";function n(e){return e.replace(r,function(e,t){return t.toUpperCase()})}var r=/-(.)/g;e.exports=n},function(e,t,n){"use strict";function r(e){var t,n,r=e.length;if(Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e?a(!1):void 0,"number"!=typeof r?a(!1):void 0,0===r||r-1 in e?void 0:a(!1),"function"==typeof e.callee?a(!1):void 0,e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(e){}for(t=Array(r),n=0;n-1;e.exports=n},function(e,t,n){"use strict";function r(e){var t=o(e);return{x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top}}var o=n(141);e.exports=r},function(e,t,n){"use strict";function r(e){var t,n=e.ownerDocument.documentElement;return"getBoundingClientRect"in e&&o(n,e)?(t=e.getBoundingClientRect(),{left:Math.round(t.left)-n.clientLeft,right:Math.round(t.right)-n.clientLeft,top:Math.round(t.top)-n.clientTop,bottom:Math.round(t.bottom)-n.clientTop}):{left:0,right:0,top:0,bottom:0}}var o=n(36);e.exports=r},function(e,t,n){"use strict";function r(e){return null==e?e:String(e)}function o(e,t){var n=void 0;if(window.getComputedStyle&&(n=window.getComputedStyle(e,null)))return r(n.getPropertyValue(a(t)));if(document.defaultView&&document.defaultView.getComputedStyle){if(n=document.defaultView.getComputedStyle(e,null))return r(n.getPropertyValue(a(t)));if("display"===t)return"none"}return r(e.currentStyle?"float"===t?e.currentStyle.cssFloat||e.currentStyle.styleFloat:e.currentStyle[i(t)]:e.style&&e.style[i(t)])}var i=n(137),a=n(145);e.exports=o},function(e,t){"use strict";function n(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}e.exports=n},function(e,t){"use strict";function n(){var e=void 0;return document.documentElement&&(e=document.documentElement.clientWidth),!e&&document.body&&(e=document.body.clientWidth),e||0}function r(){var e=void 0;return document.documentElement&&(e=document.documentElement.clientHeight),!e&&document.body&&(e=document.body.clientHeight),e||0}function o(){return{width:window.innerWidth||n(),height:window.innerHeight||r()}}o.withoutScrollbars=function(){return{width:n(),height:r()}},e.exports=o},function(e,t){"use strict";function n(e){return e.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;e.exports=n},function(e,t){"use strict";function n(e){var t=e?e.ownerDocument||e:document,n=t.defaultView||window;return!(!e||!("function"==typeof n.Node?e instanceof n.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=n},function(e,t,n){"use strict";function r(e){return o(e)&&3==e.nodeType}var o=n(146);e.exports=r},function(e,t){"use strict";function n(e){var t,n,r;if(e||(e=""),t=void 0,n=arguments.length,n>1)for(r=1;r1)for(t=1;t0?2==a.length?typeof a[1]==f?this[a[0]]=a[1].call(this,c):this[a[0]]=a[1]:3==a.length?typeof a[1]!==f||a[1].exec&&a[1].test?this[a[0]]=c?c.replace(a[1],a[2]):i:this[a[0]]=c?a[1].call(this,c,a[2]):i:4==a.length&&(this[a[0]]=c?a[3].call(this,c.replace(a[1],a[2])):i):this[a]=c?c:i;p+=2}},str:function(e,t){var n,r;for(n in t)if(typeof t[n]===g&&t[n].length>0){for(r=0;r) => void; onBlur?: (e: SyntheticEvent<>) => void; - onFocus?: (e: SyntheticEvent<>) => void + onFocus?: (e: SyntheticEvent<>) => void; + onCopy?: (e: SyntheticEvent<>) => void; + onCut?: (e: SyntheticEvent<>) => void // Provide a map of inline style names corresponding to CSS style objects // that will be rendered for matching ranges. diff --git a/lib/editOnBlur.js b/lib/editOnBlur.js index f27c1530b1..f31b60fb52 100644 --- a/lib/editOnBlur.js +++ b/lib/editOnBlur.js @@ -18,7 +18,7 @@ var EditorState = require('./EditorState'); var containsNode = require('fbjs/lib/containsNode'); var getActiveElement = require('fbjs/lib/getActiveElement'); -function editOnBlur(editor, e) { +function editOnBlur(editor, event) { // In a contentEditable element, when you select a range and then click // another active element, this does trigger a `blur` event but will not // remove the DOM selection from the contenteditable. @@ -42,8 +42,9 @@ function editOnBlur(editor, e) { } var selection = currentSelection.set('hasFocus', false); - editor.props.onBlur && editor.props.onBlur(e); - editor.update(EditorState.acceptSelection(editorState, selection)); + var updatedEditorState = EditorState.acceptSelection(editorState, selection); + editor.update(updatedEditorState); + editor.props.onBlur && editor.props.onBlur(event); } module.exports = editOnBlur; \ No newline at end of file diff --git a/lib/editOnBlur.js.flow b/lib/editOnBlur.js.flow index 0e097970ba..6f4411702e 100644 --- a/lib/editOnBlur.js.flow +++ b/lib/editOnBlur.js.flow @@ -20,7 +20,7 @@ const EditorState = require('./EditorState'); const containsNode = require('fbjs/lib/containsNode'); const getActiveElement = require('fbjs/lib/getActiveElement'); -function editOnBlur(editor: DraftEditor, e: SyntheticEvent<>): void { +function editOnBlur(editor: DraftEditor, event: SyntheticEvent<>): void { // In a contentEditable element, when you select a range and then click // another active element, this does trigger a `blur` event but will not // remove the DOM selection from the contenteditable. @@ -44,8 +44,9 @@ function editOnBlur(editor: DraftEditor, e: SyntheticEvent<>): void { } var selection = currentSelection.set('hasFocus', false); - editor.props.onBlur && editor.props.onBlur(e); - editor.update(EditorState.acceptSelection(editorState, selection)); + var updatedEditorState = EditorState.acceptSelection(editorState, selection); + editor.update(updatedEditorState); + editor.props.onBlur && editor.props.onBlur(event); } module.exports = editOnBlur; \ No newline at end of file diff --git a/lib/editOnCopy.js b/lib/editOnCopy.js index ff6b553f41..19c7eaa174 100644 --- a/lib/editOnCopy.js +++ b/lib/editOnCopy.js @@ -14,19 +14,26 @@ 'use strict'; var getFragmentFromSelection = require('./getFragmentFromSelection'); +var isEventHandled = require('./isEventHandled'); /** * If we have a selection, create a ContentState fragment and store * it in our internal clipboard. Subsequent paste events will use this * fragment if no external clipboard data is supplied. */ -function editOnCopy(editor, e) { +function editOnCopy(editor, event) { + var shouldPreventDefault = editor.props.onCopy && isEventHandled(editor.props.onCopy(event)); + + if (shouldPreventDefault) { + return; + } + var editorState = editor._latestEditorState; var selection = editorState.getSelection(); // No selection, so there's nothing to copy. if (selection.isCollapsed()) { - e.preventDefault(); + event.preventDefault(); return; } diff --git a/lib/editOnCopy.js.flow b/lib/editOnCopy.js.flow index a268b133de..0a2ea64757 100644 --- a/lib/editOnCopy.js.flow +++ b/lib/editOnCopy.js.flow @@ -14,21 +14,27 @@ 'use strict'; import type DraftEditor from './DraftEditor.react'; - -var getFragmentFromSelection = require('./getFragmentFromSelection'); +const getFragmentFromSelection = require('./getFragmentFromSelection'); +const isEventHandled = require('./isEventHandled'); /** * If we have a selection, create a ContentState fragment and store * it in our internal clipboard. Subsequent paste events will use this * fragment if no external clipboard data is supplied. */ -function editOnCopy(editor: DraftEditor, e: SyntheticClipboardEvent<>): void { +function editOnCopy(editor: DraftEditor, event: SyntheticClipboardEvent<>): void { + const shouldPreventDefault = editor.props.onCopy && isEventHandled(editor.props.onCopy(event)); + + if (shouldPreventDefault) { + return; + } + var editorState = editor._latestEditorState; var selection = editorState.getSelection(); // No selection, so there's nothing to copy. if (selection.isCollapsed()) { - e.preventDefault(); + event.preventDefault(); return; } diff --git a/lib/editOnCut.js b/lib/editOnCut.js index 8b174fdba8..283578860d 100644 --- a/lib/editOnCut.js +++ b/lib/editOnCut.js @@ -19,6 +19,7 @@ var Style = require('fbjs/lib/Style'); var getFragmentFromSelection = require('./getFragmentFromSelection'); var getScrollPosition = require('fbjs/lib/getScrollPosition'); +var isEventHandled = require('./isEventHandled'); /** * On `cut` events, native behavior is allowed to occur so that the system @@ -29,15 +30,21 @@ var getScrollPosition = require('fbjs/lib/getScrollPosition'); * In addition, we can keep a copy of the removed fragment, including all * styles and entities, for use as an internal paste. */ -function editOnCut(editor, e) { +function editOnCut(editor, event) { + var shouldPreventDefault = editor.props.onCut && isEventHandled(editor.props.onCut(event)); + + if (shouldPreventDefault) { + return; + } + var editorState = editor._latestEditorState; var selection = editorState.getSelection(); - var element = e.target; + var element = event.target; var scrollPosition = void 0; // No selection, so there's nothing to cut. if (selection.isCollapsed()) { - e.preventDefault(); + event.preventDefault(); return; } @@ -63,6 +70,7 @@ function editOnCut(editor, e) { function removeFragment(editorState) { var newContent = DraftModifier.removeRange(editorState.getCurrentContent(), editorState.getSelection(), 'forward'); + return EditorState.push(editorState, newContent, 'remove-range'); } diff --git a/lib/editOnCut.js.flow b/lib/editOnCut.js.flow index 651974f093..8a847dbe16 100644 --- a/lib/editOnCut.js.flow +++ b/lib/editOnCut.js.flow @@ -21,6 +21,7 @@ const Style = require('fbjs/lib/Style'); const getFragmentFromSelection = require('./getFragmentFromSelection'); const getScrollPosition = require('fbjs/lib/getScrollPosition'); +const isEventHandled = require('./isEventHandled'); /** * On `cut` events, native behavior is allowed to occur so that the system @@ -31,15 +32,21 @@ const getScrollPosition = require('fbjs/lib/getScrollPosition'); * In addition, we can keep a copy of the removed fragment, including all * styles and entities, for use as an internal paste. */ -function editOnCut(editor: DraftEditor, e: SyntheticClipboardEvent<>): void { +function editOnCut(editor: DraftEditor, event: SyntheticClipboardEvent<>): void { + const shouldPreventDefault = editor.props.onCut && isEventHandled(editor.props.onCut(event)); + + if (shouldPreventDefault) { + return; + } + const editorState = editor._latestEditorState; const selection = editorState.getSelection(); - const element = e.target; + const element = event.target; let scrollPosition; // No selection, so there's nothing to cut. if (selection.isCollapsed()) { - e.preventDefault(); + event.preventDefault(); return; } @@ -65,6 +72,7 @@ function editOnCut(editor: DraftEditor, e: SyntheticClipboardEvent<>): void { function removeFragment(editorState: EditorState): EditorState { const newContent = DraftModifier.removeRange(editorState.getCurrentContent(), editorState.getSelection(), 'forward'); + return EditorState.push(editorState, newContent, 'remove-range'); } diff --git a/lib/editOnPaste.js b/lib/editOnPaste.js index b01063ad3e..8254141d26 100644 --- a/lib/editOnPaste.js +++ b/lib/editOnPaste.js @@ -29,9 +29,9 @@ var splitTextIntoTextBlocks = require('./splitTextIntoTextBlocks'); /** * Paste content. */ -function editOnPaste(editor, e) { - e.preventDefault(); - var data = new DataTransfer(e.clipboardData); +function editOnPaste(editor, event) { + event.preventDefault(); + var data = new DataTransfer(event.clipboardData); // Get files, unless this is likely to be a string the user wants inline. if (!data.isRichText()) { @@ -75,7 +75,9 @@ function editOnPaste(editor, e) { var html = data.getHTML(); var editorState = editor._latestEditorState; - if (editor.props.handlePastedText && isEventHandled(editor.props.handlePastedText(text, html, editorState))) { + var shouldPreventDefault = editor.props.handlePastedText && isEventHandled(editor.props.handlePastedText(text, html, editorState)); + + if (shouldPreventDefault) { return; } diff --git a/lib/editOnPaste.js.flow b/lib/editOnPaste.js.flow index b531a1abed..8d5656e673 100644 --- a/lib/editOnPaste.js.flow +++ b/lib/editOnPaste.js.flow @@ -33,9 +33,9 @@ var splitTextIntoTextBlocks = require('./splitTextIntoTextBlocks'); /** * Paste content. */ -function editOnPaste(editor: DraftEditor, e: SyntheticClipboardEvent<>): void { - e.preventDefault(); - var data = new DataTransfer(e.clipboardData); +function editOnPaste(editor: DraftEditor, event: SyntheticClipboardEvent<>): void { + event.preventDefault(); + var data = new DataTransfer(event.clipboardData); // Get files, unless this is likely to be a string the user wants inline. if (!data.isRichText()) { @@ -79,7 +79,9 @@ function editOnPaste(editor: DraftEditor, e: SyntheticClipboardEvent<>): void { const html = data.getHTML(); const editorState = editor._latestEditorState; - if (editor.props.handlePastedText && isEventHandled(editor.props.handlePastedText(text, html, editorState))) { + const shouldPreventDefault = editor.props.handlePastedText && isEventHandled(editor.props.handlePastedText(text, html, editorState)); + + if (shouldPreventDefault) { return; } diff --git a/src/component/base/DraftEditorProps.js b/src/component/base/DraftEditorProps.js index b24f08779f..7aae5e8388 100644 --- a/src/component/base/DraftEditorProps.js +++ b/src/component/base/DraftEditorProps.js @@ -164,6 +164,8 @@ export type DraftEditorProps = { onBlur?: (e: SyntheticEvent<>) => void, onFocus?: (e: SyntheticEvent<>) => void, + onCopy?: (e: SyntheticEvent<>) => void, + onCut?: (e: SyntheticEvent<>) => void, // Provide a map of inline style names corresponding to CSS style objects // that will be rendered for matching ranges. diff --git a/src/component/handlers/edit/editOnBlur.js b/src/component/handlers/edit/editOnBlur.js index d96d751886..adfa2c55c7 100644 --- a/src/component/handlers/edit/editOnBlur.js +++ b/src/component/handlers/edit/editOnBlur.js @@ -20,7 +20,7 @@ const EditorState = require('EditorState'); const containsNode = require('containsNode'); const getActiveElement = require('getActiveElement'); -function editOnBlur(editor: DraftEditor, e: SyntheticEvent<>): void { +function editOnBlur(editor: DraftEditor, event: SyntheticEvent<>): void { // In a contentEditable element, when you select a range and then click // another active element, this does trigger a `blur` event but will not // remove the DOM selection from the contenteditable. @@ -48,8 +48,9 @@ function editOnBlur(editor: DraftEditor, e: SyntheticEvent<>): void { } var selection = currentSelection.set('hasFocus', false); - editor.props.onBlur && editor.props.onBlur(e); - editor.update(EditorState.acceptSelection(editorState, selection)); + var updatedEditorState = EditorState.acceptSelection(editorState, selection); + editor.update(updatedEditorState); + editor.props.onBlur && editor.props.onBlur(event); } module.exports = editOnBlur; diff --git a/src/component/handlers/edit/editOnCopy.js b/src/component/handlers/edit/editOnCopy.js index 0970ce683b..83891bad5b 100644 --- a/src/component/handlers/edit/editOnCopy.js +++ b/src/component/handlers/edit/editOnCopy.js @@ -14,21 +14,28 @@ 'use strict'; import type DraftEditor from 'DraftEditor.react'; - -var getFragmentFromSelection = require('getFragmentFromSelection'); +const getFragmentFromSelection = require('getFragmentFromSelection'); +const isEventHandled = require('isEventHandled'); /** * If we have a selection, create a ContentState fragment and store * it in our internal clipboard. Subsequent paste events will use this * fragment if no external clipboard data is supplied. */ -function editOnCopy(editor: DraftEditor, e: SyntheticClipboardEvent<>): void { +function editOnCopy(editor: DraftEditor, event: SyntheticClipboardEvent<>): void { + const shouldPreventDefault = editor.props.onCopy && + isEventHandled(editor.props.onCopy(event)); + + if (shouldPreventDefault) { + return; + } + var editorState = editor._latestEditorState; var selection = editorState.getSelection(); // No selection, so there's nothing to copy. if (selection.isCollapsed()) { - e.preventDefault(); + event.preventDefault(); return; } diff --git a/src/component/handlers/edit/editOnCut.js b/src/component/handlers/edit/editOnCut.js index 575b9578a2..7071e80a4e 100644 --- a/src/component/handlers/edit/editOnCut.js +++ b/src/component/handlers/edit/editOnCut.js @@ -21,6 +21,7 @@ const Style = require('Style'); const getFragmentFromSelection = require('getFragmentFromSelection'); const getScrollPosition = require('getScrollPosition'); +const isEventHandled = require('isEventHandled'); /** * On `cut` events, native behavior is allowed to occur so that the system @@ -31,15 +32,22 @@ const getScrollPosition = require('getScrollPosition'); * In addition, we can keep a copy of the removed fragment, including all * styles and entities, for use as an internal paste. */ -function editOnCut(editor: DraftEditor, e: SyntheticClipboardEvent<>): void { +function editOnCut(editor: DraftEditor, event: SyntheticClipboardEvent<>): void { + const shouldPreventDefault = editor.props.onCut && + isEventHandled(editor.props.onCut(event)); + + if (shouldPreventDefault) { + return; + } + const editorState = editor._latestEditorState; const selection = editorState.getSelection(); - const element = e.target; + const element = event.target; let scrollPosition; // No selection, so there's nothing to cut. if (selection.isCollapsed()) { - e.preventDefault(); + event.preventDefault(); return; } @@ -69,6 +77,7 @@ function removeFragment(editorState: EditorState): EditorState { editorState.getSelection(), 'forward', ); + return EditorState.push(editorState, newContent, 'remove-range'); } diff --git a/src/component/handlers/edit/editOnPaste.js b/src/component/handlers/edit/editOnPaste.js index e66cbf9a79..69630d8ebd 100644 --- a/src/component/handlers/edit/editOnPaste.js +++ b/src/component/handlers/edit/editOnPaste.js @@ -33,9 +33,9 @@ var splitTextIntoTextBlocks = require('splitTextIntoTextBlocks'); /** * Paste content. */ -function editOnPaste(editor: DraftEditor, e: SyntheticClipboardEvent<>): void { - e.preventDefault(); - var data = new DataTransfer(e.clipboardData); +function editOnPaste(editor: DraftEditor, event: SyntheticClipboardEvent<>): void { + event.preventDefault(); + var data = new DataTransfer(event.clipboardData); // Get files, unless this is likely to be a string the user wants inline. if (!data.isRichText()) { @@ -97,10 +97,10 @@ function editOnPaste(editor: DraftEditor, e: SyntheticClipboardEvent<>): void { const html = data.getHTML(); const editorState = editor._latestEditorState; - if ( - editor.props.handlePastedText && - isEventHandled(editor.props.handlePastedText(text, html, editorState)) - ) { + const shouldPreventDefault = editor.props.handlePastedText && + isEventHandled(editor.props.handlePastedText(text, html, editorState)); + + if (shouldPreventDefault) { return; }